From: Andrea Bianco Date: Mon, 13 Apr 2020 08:35:03 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.14 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2012cense.mail?a=commitdiff_plain;h=abb8509367769c76af5c8d9706f3e485a7ae2354;p=motion2.git Built motion from commit (unavailable).|2.4.14 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4fe73ca..8652695 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.14", "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-04-13T08:02:38.013Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.14", "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-04-13T08:25:50.184Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 346cace..f4d7804 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.14", "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-04-13T08:02:38.013Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.14", "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-04-13T08:25:50.184Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 5bba245..587eba7 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 _0xba10=['sequelize','exports','VIRTUAL','getDataValue','contactManager','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT'];(function(_0x395d98,_0x5ef021){var _0x36e2e1=function(_0x116ebb){while(--_0x116ebb){_0x395d98['push'](_0x395d98['shift']());}};_0x36e2e1(++_0x5ef021);}(_0xba10,0x1a4));var _0x0ba1=function(_0x5024ff,_0x2f119a){_0x5024ff=_0x5024ff-0x0;var _0x383c12=_0xba10[_0x5024ff];return _0x383c12;};'use strict';var Sequelize=require(_0x0ba1('0x0'));module[_0x0ba1('0x1')]={'name':{'type':Sequelize[_0x0ba1('0x2')],'get':function(_0x5508f7){return this[_0x0ba1('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0ba1('0x4'),'integration',_0x0ba1('0x5'),_0x0ba1('0x6'),_0x0ba1('0x7'),'browser',_0x0ba1('0x8'),_0x0ba1('0x9')]],'msg':_0x0ba1('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0ba1('0xb')](0x1000),'comment':_0x0ba1('0xc')},'data2':{'type':Sequelize[_0x0ba1('0xb')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x0ba1('0xb')](0x1000),'comment':_0x0ba1('0xd')},'data4':{'type':Sequelize[_0x0ba1('0xb')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x0ba1('0xe')]}}; \ No newline at end of file +var _0x3d4d=['bot','script','STRING','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','getDataValue','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x3d4d,0x106));var _0xd3d4=function(_0x5d4818,_0x3ccae2){_0x5d4818=_0x5d4818-0x0;var _0x578a9c=_0x3d4d[_0x5d4818];return _0x578a9c;};'use strict';var Sequelize=require(_0xd3d4('0x0'));module[_0xd3d4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5f48d5){return this[_0xd3d4('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd3d4('0x3'),_0xd3d4('0x4'),_0xd3d4('0x5'),_0xd3d4('0x6'),_0xd3d4('0x7'),'browser',_0xd3d4('0x8'),_0xd3d4('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xd3d4('0xa')](0x1000),'comment':_0xd3d4('0xb')},'data2':{'type':Sequelize[_0xd3d4('0xa')](0x1000),'comment':_0xd3d4('0xc')},'data3':{'type':Sequelize[_0xd3d4('0xa')](0x1000),'comment':_0xd3d4('0xd')},'data4':{'type':Sequelize[_0xd3d4('0xa')](0x1000)},'data5':{'type':Sequelize[_0xd3d4('0xa')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xd3d4('0xe')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index a461fb3..036eb74 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 _0xe8fe=['error','stack','name','send','body','Action','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy'];(function(_0x3c14d4,_0x32819b){var _0x545983=function(_0x58e997){while(--_0x58e997){_0x3c14d4['push'](_0x3c14d4['shift']());}};_0x545983(++_0x32819b);}(_0xe8fe,0x177));var _0xee8f=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0xe8fe[_0x1ce9ea];return _0x2a95b9;};'use strict';var pdf=require(_0xee8f('0x0'));var emlformat=require(_0xee8f('0x1'));var rimraf=require(_0xee8f('0x2'));var zipdir=require(_0xee8f('0x3'));var jsonpatch=require(_0xee8f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee8f('0x5'));var Mustache=require(_0xee8f('0x6'));var util=require(_0xee8f('0x7'));var path=require(_0xee8f('0x8'));var sox=require(_0xee8f('0x9'));var csv=require('to-csv');var ejs=require(_0xee8f('0xa'));var fs=require('fs');var _=require(_0xee8f('0xb'));var squel=require(_0xee8f('0xc'));var crypto=require(_0xee8f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xee8f('0xe'));var toCsv=require(_0xee8f('0xf'));var querystring=require('querystring');var Papa=require(_0xee8f('0x10'));var Redis=require(_0xee8f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xee8f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xee8f('0x13'))(_0xee8f('0x14'));var utils=require(_0xee8f('0x15'));var config=require(_0xee8f('0x16'));var db=require(_0xee8f('0x17'))['db'];function respondWithStatusCode(_0x11ff09,_0x59a358){_0x59a358=_0x59a358||0xcc;return function(_0x2fbb3a){if(_0x2fbb3a){return _0x11ff09[_0xee8f('0x18')](_0x59a358);}return _0x11ff09['status'](_0x59a358)['end']();};}function respondWithResult(_0x3fb02f,_0x437325){_0x437325=_0x437325||0xc8;return function(_0x571a80){if(_0x571a80){return _0x3fb02f[_0xee8f('0x19')](_0x437325)[_0xee8f('0x1a')](_0x571a80);}};}function respondWithFilteredResult(_0x129092,_0x1e65f5){return function(_0x2bd1b1){if(_0x2bd1b1){var _0x51f9cf=_0x2bd1b1['count'],_0x109f4e=_0x1e65f5['offset'],_0x1190a1=_0x1e65f5[_0xee8f('0x1b')]+_0x1e65f5[_0xee8f('0x1c')],_0x1ce4c7;if(_0x1190a1>=_0x51f9cf){_0x1190a1=_0x51f9cf;_0x1ce4c7=0xc8;}else{_0x1ce4c7=0xce;}_0x129092['status'](_0x1ce4c7);return _0x129092[_0xee8f('0x1d')](_0xee8f('0x1e'),_0x109f4e+'-'+_0x1190a1+'/'+_0x51f9cf)[_0xee8f('0x1a')](_0x2bd1b1);}return null;};}function patchUpdates(_0x245ade){return function(_0x76dbe4){try{jsonpatch['apply'](_0x76dbe4,_0x245ade,!![]);}catch(_0x4856c3){return BPromise[_0xee8f('0x1f')](_0x4856c3);}return _0x76dbe4['save']();};}function saveUpdates(_0x3edfb0,_0x5cdde0){return function(_0x163f9f){if(_0x163f9f){return _0x163f9f[_0xee8f('0x20')](_0x3edfb0)[_0xee8f('0x21')](function(_0x382933){return _0x382933;});}return null;};}function removeEntity(_0x2717ae,_0x1af101){return function(_0x56c57d){if(_0x56c57d){return _0x56c57d[_0xee8f('0x22')]()[_0xee8f('0x21')](function(){_0x2717ae[_0xee8f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8728,_0x37f026){return function(_0x3dcbe4){if(!_0x3dcbe4){_0x2f8728[_0xee8f('0x18')](0x194);}return _0x3dcbe4;};}function handleError(_0x258439,_0x2d3245){_0x2d3245=_0x2d3245||0x1f4;return function(_0x3ee8d7){logger[_0xee8f('0x23')](_0x3ee8d7[_0xee8f('0x24')]);if(_0x3ee8d7[_0xee8f('0x25')]){delete _0x3ee8d7[_0xee8f('0x25')];}_0x258439[_0xee8f('0x19')](_0x2d3245)[_0xee8f('0x26')](_0x3ee8d7);};}exports[_0xee8f('0x20')]=function(_0x288bcc,_0x1a8d8c){if(_0x288bcc[_0xee8f('0x27')]['id']){delete _0x288bcc[_0xee8f('0x27')]['id'];}return db['Action']['find']({'where':{'id':_0x288bcc['params']['id']}})[_0xee8f('0x21')](handleEntityNotFound(_0x1a8d8c,null))[_0xee8f('0x21')](saveUpdates(_0x288bcc[_0xee8f('0x27')],null))[_0xee8f('0x21')](respondWithResult(_0x1a8d8c,null))['catch'](handleError(_0x1a8d8c,null));};exports['destroy']=function(_0x3cf2da,_0x8cba82){return db[_0xee8f('0x28')]['find']({'where':{'id':_0x3cf2da['params']['id']}})[_0xee8f('0x21')](handleEntityNotFound(_0x8cba82,null))[_0xee8f('0x21')](removeEntity(_0x8cba82,null))['catch'](handleError(_0x8cba82,null));}; \ No newline at end of file +var _0x8b37=['path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','body','find','catch','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x3fb073,_0x1db347){var _0x873c91=function(_0xd9ab3c){while(--_0xd9ab3c){_0x3fb073['push'](_0x3fb073['shift']());}};_0x873c91(++_0x1db347);}(_0x8b37,0x197));var _0x78b3=function(_0x34d27e,_0x307d39){_0x34d27e=_0x34d27e-0x0;var _0x3e995a=_0x8b37[_0x34d27e];return _0x3e995a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x78b3('0x0'));var rimraf=require(_0x78b3('0x1'));var zipdir=require(_0x78b3('0x2'));var jsonpatch=require(_0x78b3('0x3'));var rp=require(_0x78b3('0x4'));var moment=require('moment');var BPromise=require(_0x78b3('0x5'));var Mustache=require(_0x78b3('0x6'));var util=require('util');var path=require(_0x78b3('0x7'));var sox=require(_0x78b3('0x8'));var csv=require('to-csv');var ejs=require(_0x78b3('0x9'));var fs=require('fs');var _=require(_0x78b3('0xa'));var squel=require('squel');var crypto=require(_0x78b3('0xb'));var jsforce=require(_0x78b3('0xc'));var deskjs=require(_0x78b3('0xd'));var toCsv=require(_0x78b3('0xe'));var querystring=require(_0x78b3('0xf'));var Papa=require(_0x78b3('0x10'));var Redis=require(_0x78b3('0x11'));var authService=require(_0x78b3('0x12'));var qs=require(_0x78b3('0x13'));var as=require(_0x78b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78b3('0x15'));var utils=require(_0x78b3('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38db77,_0x37af41){_0x37af41=_0x37af41||0xcc;return function(_0x89f8af){if(_0x89f8af){return _0x38db77[_0x78b3('0x17')](_0x37af41);}return _0x38db77[_0x78b3('0x18')](_0x37af41)['end']();};}function respondWithResult(_0x5d40ba,_0xa4a5fb){_0xa4a5fb=_0xa4a5fb||0xc8;return function(_0x4b5dff){if(_0x4b5dff){return _0x5d40ba[_0x78b3('0x18')](_0xa4a5fb)[_0x78b3('0x19')](_0x4b5dff);}};}function respondWithFilteredResult(_0x5182a7,_0x228c28){return function(_0x481021){if(_0x481021){var _0x25af34=_0x481021[_0x78b3('0x1a')],_0x95d966=_0x228c28['offset'],_0x559650=_0x228c28[_0x78b3('0x1b')]+_0x228c28[_0x78b3('0x1c')],_0x40c843;if(_0x559650>=_0x25af34){_0x559650=_0x25af34;_0x40c843=0xc8;}else{_0x40c843=0xce;}_0x5182a7[_0x78b3('0x18')](_0x40c843);return _0x5182a7[_0x78b3('0x1d')](_0x78b3('0x1e'),_0x95d966+'-'+_0x559650+'/'+_0x25af34)[_0x78b3('0x19')](_0x481021);}return null;};}function patchUpdates(_0x12aadb){return function(_0x293f36){try{jsonpatch[_0x78b3('0x1f')](_0x293f36,_0x12aadb,!![]);}catch(_0x5d2240){return BPromise[_0x78b3('0x20')](_0x5d2240);}return _0x293f36[_0x78b3('0x21')]();};}function saveUpdates(_0x47d619,_0x448786){return function(_0x34e824){if(_0x34e824){return _0x34e824[_0x78b3('0x22')](_0x47d619)[_0x78b3('0x23')](function(_0xa3a7d5){return _0xa3a7d5;});}return null;};}function removeEntity(_0x35e218,_0x3128ec){return function(_0x4cdd38){if(_0x4cdd38){return _0x4cdd38[_0x78b3('0x24')]()[_0x78b3('0x23')](function(){_0x35e218['status'](0xcc)[_0x78b3('0x25')]();});}};}function handleEntityNotFound(_0x29fff8,_0x3b97a0){return function(_0x48b597){if(!_0x48b597){_0x29fff8[_0x78b3('0x17')](0x194);}return _0x48b597;};}function handleError(_0x4e20c0,_0x2ca79b){_0x2ca79b=_0x2ca79b||0x1f4;return function(_0x5562e0){logger['error'](_0x5562e0[_0x78b3('0x26')]);if(_0x5562e0[_0x78b3('0x27')]){delete _0x5562e0['name'];}_0x4e20c0[_0x78b3('0x18')](_0x2ca79b)[_0x78b3('0x28')](_0x5562e0);};}exports[_0x78b3('0x22')]=function(_0xf3db76,_0x2a6cdf){if(_0xf3db76[_0x78b3('0x29')]['id']){delete _0xf3db76[_0x78b3('0x29')]['id'];}return db['Action'][_0x78b3('0x2a')]({'where':{'id':_0xf3db76['params']['id']}})[_0x78b3('0x23')](handleEntityNotFound(_0x2a6cdf,null))[_0x78b3('0x23')](saveUpdates(_0xf3db76[_0x78b3('0x29')],null))[_0x78b3('0x23')](respondWithResult(_0x2a6cdf,null))[_0x78b3('0x2b')](handleError(_0x2a6cdf,null));};exports[_0x78b3('0x24')]=function(_0x5333cb,_0x585eaa){return db[_0x78b3('0x2c')][_0x78b3('0x2a')]({'where':{'id':_0x5333cb[_0x78b3('0x2d')]['id']}})[_0x78b3('0x23')](handleEntityNotFound(_0x585eaa,null))[_0x78b3('0x23')](removeEntity(_0x585eaa,null))[_0x78b3('0x2b')](handleError(_0x585eaa,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 22029a3..cd0d744 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 _0x2a1d=['rimraf','../../config/environment','./action.attributes','define','Action','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0x2a1d,0x95));var _0xd2a1=function(_0x58a305,_0x29dac6){_0x58a305=_0x58a305-0x0;var _0x3b72c1=_0x2a1d[_0x58a305];return _0x3b72c1;};'use strict';var _=require(_0xd2a1('0x0'));var util=require(_0xd2a1('0x1'));var logger=require(_0xd2a1('0x2'))(_0xd2a1('0x3'));var moment=require(_0xd2a1('0x4'));var BPromise=require(_0xd2a1('0x5'));var rp=require(_0xd2a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2a1('0x7'));var config=require(_0xd2a1('0x8'));var attributes=require(_0xd2a1('0x9'));module['exports']=function(_0x1a88d7,_0x945504){return _0x1a88d7[_0xd2a1('0xa')](_0xd2a1('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3e6=['../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x28254b,_0x47617d){var _0x5ba614=function(_0x9d10c5){while(--_0x9d10c5){_0x28254b['push'](_0x28254b['shift']());}};_0x5ba614(++_0x47617d);}(_0xc3e6,0x73));var _0x6c3e=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xc3e6[_0x576d8a];return _0x3dc3ef;};'use strict';var _=require(_0x6c3e('0x0'));var util=require(_0x6c3e('0x1'));var logger=require(_0x6c3e('0x2'))('api');var moment=require(_0x6c3e('0x3'));var BPromise=require(_0x6c3e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c3e('0x5'));var rimraf=require('rimraf');var config=require(_0x6c3e('0x6'));var attributes=require(_0x6c3e('0x7'));module[_0x6c3e('0x8')]=function(_0x492753,_0x16359b){return _0x492753[_0x6c3e('0x9')](_0x6c3e('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c276c0e..94bf288 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 _0x0713=['Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x230dd5,_0x3ef714){var _0x59bf1e=function(_0x49ac13){while(--_0x49ac13){_0x230dd5['push'](_0x230dd5['shift']());}};_0x59bf1e(++_0x3ef714);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0xb653b7,_0x10ce5a){var _0x4ef36c=function(_0x45913f){while(--_0x45913f){_0xb653b7['push'](_0xb653b7['shift']());}};_0x4ef36c(++_0x10ce5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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/action/index.js b/server/api/action/index.js index 6745bbf..8007bfa 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 _0x9721=['Router','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2b515d,_0xdd85ca){var _0x290209=function(_0x3f5690){while(--_0x3f5690){_0x2b515d['push'](_0x2b515d['shift']());}};_0x290209(++_0xdd85ca);}(_0x9721,0x1cf));var _0x1972=function(_0x463f95,_0x9e3871){_0x463f95=_0x463f95-0x0;var _0x1adb88=_0x9721[_0x463f95];return _0x1adb88;};'use strict';var multer=require(_0x1972('0x0'));var util=require(_0x1972('0x1'));var path=require(_0x1972('0x2'));var timeout=require(_0x1972('0x3'));var express=require(_0x1972('0x4'));var router=express[_0x1972('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1972('0x6'));router['put'](_0x1972('0x7'),auth[_0x1972('0x8')](),controller[_0x1972('0x9')]);router[_0x1972('0xa')](_0x1972('0x7'),auth['isAuthenticated'](),controller[_0x1972('0xb')]);module[_0x1972('0xc')]=router; \ No newline at end of file +var _0x1fba=['destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./action.controller','isAuthenticated','delete','/:id'];(function(_0x2d5ea2,_0x1b319e){var _0x3e2ecb=function(_0x2b8323){while(--_0x2b8323){_0x2d5ea2['push'](_0x2d5ea2['shift']());}};_0x3e2ecb(++_0x1b319e);}(_0x1fba,0x18e));var _0xa1fb=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x1fba[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0xa1fb('0x0'));var util=require('util');var path=require(_0xa1fb('0x1'));var timeout=require(_0xa1fb('0x2'));var express=require(_0xa1fb('0x3'));var router=express[_0xa1fb('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa1fb('0x5'));var controller=require(_0xa1fb('0x6'));router['put']('/:id',auth[_0xa1fb('0x7')](),controller['update']);router[_0xa1fb('0x8')](_0xa1fb('0x9'),auth[_0xa1fb('0x7')](),controller[_0xa1fb('0xa')]);module[_0xa1fb('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2dc54a9..245a60c 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 _0x5f83=['TEXT','sequelize','exports','STRING'];(function(_0x1f9187,_0x32b961){var _0x167794=function(_0x246dc){while(--_0x246dc){_0x1f9187['push'](_0x1f9187['shift']());}};_0x167794(++_0x32b961);}(_0x5f83,0x125));var _0x35f8=function(_0x481336,_0x327d8f){_0x481336=_0x481336-0x0;var _0x57d69f=_0x5f83[_0x481336];return _0x57d69f;};'use strict';var Sequelize=require(_0x35f8('0x0'));module[_0x35f8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x35f8('0x2')]},'conditions':{'type':Sequelize[_0x35f8('0x3')]},'joins':{'type':Sequelize[_0x35f8('0x3')]}}; \ No newline at end of file +var _0x90db=['STRING','TEXT','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x90db,0x15e));var _0xb90d=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x90db[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0xb90d('0x0'));module[_0xb90d('0x1')]={'name':{'type':Sequelize[_0xb90d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb90d('0x2')]},'parent':{'type':Sequelize[_0xb90d('0x2')]},'table':{'type':Sequelize[_0xb90d('0x2')]},'conditions':{'type':Sequelize[_0xb90d('0x3')]},'joins':{'type':Sequelize[_0xb90d('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 433c899..2a94ffd 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 _0x1487=['MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','field','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','sequelize','QueryTypes','SELECT','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20EMPTY','operator','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','toString','No\x20available\x20data','web','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../files/reports','run','runReport','COUNT(DISTINCT\x20%s)','UNIX_TIMESTAMP(%s)','value','keyBy','debug','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','AnalyticCustomReport','count','includeAll','include','findAll','catch','show','params','keys','create','body','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x1487,0xf2));var _0x7148=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x1487[_0x1e4a8e];return _0x5408f9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7148('0x0'));var rimraf=require(_0x7148('0x1'));var zipdir=require(_0x7148('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7148('0x3'));var moment=require(_0x7148('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7148('0x5'));var util=require(_0x7148('0x6'));var path=require(_0x7148('0x7'));var sox=require(_0x7148('0x8'));var csv=require(_0x7148('0x9'));var ejs=require(_0x7148('0xa'));var fs=require('fs');var _=require(_0x7148('0xb'));var squel=require(_0x7148('0xc'));var crypto=require(_0x7148('0xd'));var jsforce=require(_0x7148('0xe'));var deskjs=require(_0x7148('0xf'));var toCsv=require(_0x7148('0x9'));var querystring=require(_0x7148('0x10'));var Papa=require(_0x7148('0x11'));var Redis=require(_0x7148('0x12'));var authService=require(_0x7148('0x13'));var qs=require(_0x7148('0x14'));var as=require(_0x7148('0x15'));var hardwareService=require(_0x7148('0x16'));var logger=require('../../config/logger')(_0x7148('0x17'));var utils=require(_0x7148('0x18'));var config=require('../../config/environment');var db=require(_0x7148('0x19'))['db'];function respondWithStatusCode(_0x41b292,_0x23ebea){_0x23ebea=_0x23ebea||0xcc;return function(_0x10b8d8){if(_0x10b8d8){return _0x41b292[_0x7148('0x1a')](_0x23ebea);}return _0x41b292[_0x7148('0x1b')](_0x23ebea)[_0x7148('0x1c')]();};}function respondWithResult(_0x1b460c,_0x508ebb){_0x508ebb=_0x508ebb||0xc8;return function(_0x571222){if(_0x571222){return _0x1b460c['status'](_0x508ebb)[_0x7148('0x1d')](_0x571222);}};}function respondWithFilteredResult(_0x2ea568,_0x1e1428){return function(_0x126b75){if(_0x126b75){var _0x21372d=_0x126b75['count'],_0x141ad9=_0x1e1428[_0x7148('0x1e')],_0x2e6a02=_0x1e1428['offset']+_0x1e1428['limit'],_0x2deca0;if(_0x2e6a02>=_0x21372d){_0x2e6a02=_0x21372d;_0x2deca0=0xc8;}else{_0x2deca0=0xce;}_0x2ea568[_0x7148('0x1b')](_0x2deca0);return _0x2ea568['set'](_0x7148('0x1f'),_0x141ad9+'-'+_0x2e6a02+'/'+_0x21372d)['json'](_0x126b75);}return null;};}function patchUpdates(_0x218710){return function(_0x36a688){try{jsonpatch[_0x7148('0x20')](_0x36a688,_0x218710,!![]);}catch(_0x412258){return BPromise[_0x7148('0x21')](_0x412258);}return _0x36a688[_0x7148('0x22')]();};}function saveUpdates(_0x3efe73,_0x5ac51f){return function(_0x1e16bd){if(_0x1e16bd){return _0x1e16bd[_0x7148('0x23')](_0x3efe73)['then'](function(_0x10254f){return _0x10254f;});}return null;};}function removeEntity(_0x10a167,_0x122cb0){return function(_0x3dbdc4){if(_0x3dbdc4){return _0x3dbdc4[_0x7148('0x24')]()[_0x7148('0x25')](function(){var _0x471e71=_0x3dbdc4[_0x7148('0x26')]({'plain':!![]});var _0x248c6e=_0x7148('0x27');return db[_0x7148('0x28')][_0x7148('0x24')]({'where':{'type':_0x248c6e,'resourceId':_0x471e71['id']}})['then'](function(){return _0x3dbdc4;});})['then'](function(){_0x10a167['status'](0xcc)[_0x7148('0x1c')]();});}};}function handleEntityNotFound(_0x44d87b,_0x169b4b){return function(_0x1be7f9){if(!_0x1be7f9){_0x44d87b['sendStatus'](0x194);}return _0x1be7f9;};}function handleError(_0x4fa6c3,_0x3f0f08){_0x3f0f08=_0x3f0f08||0x1f4;return function(_0x5d416b){logger[_0x7148('0x29')](_0x5d416b[_0x7148('0x2a')]);if(_0x5d416b['name']){delete _0x5d416b[_0x7148('0x2b')];}_0x4fa6c3[_0x7148('0x1b')](_0x3f0f08)[_0x7148('0x2c')](_0x5d416b);};}exports[_0x7148('0x2d')]=function(_0x3275fb,_0x3f33f3){var _0x230189={},_0x5e633a={},_0x152b7f={'count':0x0,'rows':[]};var _0x2d796d=_[_0x7148('0x2e')](db['AnalyticCustomReport'][_0x7148('0x2f')],function(_0x4b400b){return{'name':_0x4b400b[_0x7148('0x30')],'type':_0x4b400b['type'][_0x7148('0x31')]};});_0x5e633a[_0x7148('0x32')]=_[_0x7148('0x2e')](_0x2d796d,_0x7148('0x2b'));_0x5e633a[_0x7148('0x33')]=_['keys'](_0x3275fb[_0x7148('0x33')]);_0x5e633a['filters']=_[_0x7148('0x34')](_0x5e633a[_0x7148('0x32')],_0x5e633a[_0x7148('0x33')]);_0x230189[_0x7148('0x35')]=_[_0x7148('0x34')](_0x5e633a['model'],qs['fields'](_0x3275fb[_0x7148('0x33')][_0x7148('0x36')]));_0x230189[_0x7148('0x35')]=_0x230189[_0x7148('0x35')][_0x7148('0x37')]?_0x230189[_0x7148('0x35')]:_0x5e633a[_0x7148('0x32')];if(!_0x3275fb[_0x7148('0x33')]['hasOwnProperty'](_0x7148('0x38'))){_0x230189[_0x7148('0x39')]=qs['limit'](_0x3275fb[_0x7148('0x33')][_0x7148('0x39')]);_0x230189['offset']=qs[_0x7148('0x1e')](_0x3275fb[_0x7148('0x33')]['offset']);}_0x230189['order']=qs[_0x7148('0x3a')](_0x3275fb[_0x7148('0x33')]['sort']);_0x230189[_0x7148('0x3b')]=qs[_0x7148('0x3c')](_[_0x7148('0x3d')](_0x3275fb['query'],_0x5e633a[_0x7148('0x3c')]));if(_0x3275fb[_0x7148('0x33')]['filter']){_0x230189[_0x7148('0x3b')]=_['merge'](_0x230189[_0x7148('0x3b')],{'$or':_['map'](_0x2d796d,function(_0x4ccdd4){if(_0x4ccdd4[_0x7148('0x3e')]!==_0x7148('0x3f')){var _0x536d78={};_0x536d78[_0x4ccdd4['name']]={'$like':'%'+_0x3275fb[_0x7148('0x33')][_0x7148('0x40')]+'%'};return _0x536d78;}})});}_0x230189=_[_0x7148('0x41')]({},_0x230189,_0x3275fb[_0x7148('0x42')]);var _0x3bef50={'where':_0x230189[_0x7148('0x3b')]};return db[_0x7148('0x43')]['count'](_0x3bef50)[_0x7148('0x25')](function(_0x32c13c){_0x152b7f[_0x7148('0x44')]=_0x32c13c;if(_0x3275fb['query'][_0x7148('0x45')]){_0x230189[_0x7148('0x46')]=[{'all':!![]}];}return db[_0x7148('0x43')][_0x7148('0x47')](_0x230189);})[_0x7148('0x25')](function(_0x551ea8){_0x152b7f['rows']=_0x551ea8;return _0x152b7f;})[_0x7148('0x25')](respondWithFilteredResult(_0x3f33f3,_0x230189))[_0x7148('0x48')](handleError(_0x3f33f3,null));};exports[_0x7148('0x49')]=function(_0x29d5c1,_0x2168a0){var _0x41609c={'raw':![],'where':{'id':_0x29d5c1[_0x7148('0x4a')]['id']}},_0xc36377={};_0xc36377[_0x7148('0x32')]=_[_0x7148('0x4b')](db[_0x7148('0x43')][_0x7148('0x2f')]);_0xc36377['query']=_[_0x7148('0x4b')](_0x29d5c1[_0x7148('0x33')]);_0xc36377[_0x7148('0x3c')]=_[_0x7148('0x34')](_0xc36377[_0x7148('0x32')],_0xc36377[_0x7148('0x33')]);_0x41609c['attributes']=_[_0x7148('0x34')](_0xc36377[_0x7148('0x32')],qs[_0x7148('0x36')](_0x29d5c1[_0x7148('0x33')][_0x7148('0x36')]));_0x41609c[_0x7148('0x35')]=_0x41609c['attributes'][_0x7148('0x37')]?_0x41609c[_0x7148('0x35')]:_0xc36377[_0x7148('0x32')];if(_0x29d5c1[_0x7148('0x33')][_0x7148('0x45')]){_0x41609c[_0x7148('0x46')]=[{'all':!![]}];}_0x41609c=_[_0x7148('0x41')]({},_0x41609c,_0x29d5c1[_0x7148('0x42')]);return db[_0x7148('0x43')]['find'](_0x41609c)[_0x7148('0x25')](handleEntityNotFound(_0x2168a0,null))[_0x7148('0x25')](respondWithResult(_0x2168a0,null))[_0x7148('0x48')](handleError(_0x2168a0,null));};exports['create']=function(_0x1b8dd6,_0x1bf228){return db[_0x7148('0x43')][_0x7148('0x4c')](_0x1b8dd6[_0x7148('0x4d')],{})[_0x7148('0x25')](function(_0x29c776){var _0x517bbb=_0x1b8dd6['user'][_0x7148('0x26')]({'plain':!![]});if(!_0x517bbb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x517bbb[_0x7148('0x4e')]==='user'){var _0x273184=_0x29c776[_0x7148('0x26')]({'plain':!![]});var _0x14a053=_0x7148('0x4f');return db[_0x7148('0x50')]['find']({'where':{'name':_0x14a053,'userProfileId':_0x517bbb[_0x7148('0x51')]},'raw':!![]})[_0x7148('0x25')](function(_0x353188){if(_0x353188&&_0x353188[_0x7148('0x52')]===0x0){return db[_0x7148('0x28')][_0x7148('0x4c')]({'name':_0x273184['name'],'resourceId':_0x273184['id'],'type':_0x7148('0x27'),'sectionId':_0x353188['id']},{})[_0x7148('0x25')](function(){return _0x29c776;});}else{return _0x29c776;}})[_0x7148('0x48')](function(_0x5871a6){logger[_0x7148('0x29')](_0x7148('0x53'),_0x5871a6);throw _0x5871a6;});}return _0x29c776;})[_0x7148('0x25')](respondWithResult(_0x1bf228,0xc9))[_0x7148('0x48')](handleError(_0x1bf228,null));};exports[_0x7148('0x23')]=function(_0x15ebc1,_0x1c96de){if(_0x15ebc1[_0x7148('0x4d')]['id']){delete _0x15ebc1[_0x7148('0x4d')]['id'];}return db[_0x7148('0x43')][_0x7148('0x54')]({'where':{'id':_0x15ebc1['params']['id']}})[_0x7148('0x25')](handleEntityNotFound(_0x1c96de,null))[_0x7148('0x25')](saveUpdates(_0x15ebc1['body'],null))['then'](respondWithResult(_0x1c96de,null))[_0x7148('0x48')](handleError(_0x1c96de,null));};exports[_0x7148('0x24')]=function(_0x50901c,_0x2cbd82){return db['AnalyticCustomReport'][_0x7148('0x54')]({'where':{'id':_0x50901c['params']['id']}})[_0x7148('0x25')](handleEntityNotFound(_0x2cbd82,null))['then'](removeEntity(_0x2cbd82,null))['catch'](handleError(_0x2cbd82,null));};exports[_0x7148('0x55')]=function(_0x48bf97,_0x2b6ae0){var _0x36271f=0xa;var _0x1153c9=[_0x7148('0x56'),_0x7148('0x57'),_0x7148('0x58'),_0x7148('0x59')];var _0x4adb89={'SUM':'SUM(%s)','COUNT':_0x7148('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7148('0x5b'),'MIN':_0x7148('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7148('0x5d'),'GROUP_CONCAT DESC':_0x7148('0x5e')};var _0x38db30={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x7148('0x5f'),'ROUND':_0x7148('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1100ff=function(_0x199558){return!_[_0x7148('0x61')]([_0x7148('0x62'),_0x7148('0x63'),'IS\x20EMPTY',_0x7148('0x64')],_0x199558);};var _0x153cb7=function(_0x3c5624){if(!_0x3c5624||!_0x3c5624[_0x7148('0x65')][_0x7148('0x37')]){return'';}for(var _0x1615e3='(',_0x1d8741=0x0;_0x1d8741<_0x3c5624[_0x7148('0x65')][_0x7148('0x37')];_0x1d8741+=0x1){_0x1d8741>0x0&&(_0x1615e3+='\x20'+_0x3c5624['operator']+'\x20');_0x1615e3+=_0x3c5624[_0x7148('0x65')][_0x1d8741]['group']?_0x153cb7(_0x3c5624[_0x7148('0x65')][_0x1d8741][_0x7148('0x66')]):_0x3c5624[_0x7148('0x65')][_0x1d8741]['field']+'\x20'+_0x3c5624['rules'][_0x1d8741][_0x7148('0x67')]+(_0x1100ff(_0x3c5624[_0x7148('0x65')][_0x1d8741]['condition'])?'\x20'+_0x3c5624[_0x7148('0x65')][_0x1d8741]['value']:'');}return _0x1615e3+')';};var _0x2944be={'where':{'id':_0x48bf97[_0x7148('0x4a')]['id']}},_0x1db506,_0x171d0b,_0x1338e3,_0x1899d7,_0x9bf54e;_0x2944be=_[_0x7148('0x41')]({},_0x2944be,_0x48bf97[_0x7148('0x42')]);return db[_0x7148('0x43')]['find'](_0x2944be)[_0x7148('0x25')](function(_0x4f6f3f){if(_0x4f6f3f){_0x1db506=_0x4f6f3f;return _0x4f6f3f[_0x7148('0x68')]();}return null;})[_0x7148('0x25')](function(_0xf146f9){if(_0xf146f9){if(!_0xf146f9[_0x7148('0x37')]){throw new db['Sequelize'][(_0x7148('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x171d0b=_0xf146f9;return db[_0x7148('0x6a')][_0x7148('0x47')]({'raw':!![]});}return null;})[_0x7148('0x25')](function(_0x16c96e){if(_0x16c96e){_0x1338e3=_['keyBy'](_0x16c96e,'id');var _0x3bf83c;var _0x24b442=squel[_0x7148('0x6b')]();_0x24b442[_0x7148('0x6c')](_0x1db506['table']);for(var _0x4b1a00=0x0;_0x4b1a00<_0x171d0b[_0x7148('0x37')];_0x4b1a00+=0x1){_0x3bf83c=_0x171d0b[_0x4b1a00][_0x7148('0x6d')]?_0x1338e3[_0x171d0b[_0x4b1a00]['MetricId']][_0x7148('0x6e')]:_0x171d0b[_0x4b1a00]['field'];_0x3bf83c=_0x171d0b[_0x4b1a00][_0x7148('0x6f')]?_[_0x7148('0x70')](_0x4adb89[_0x171d0b[_0x4b1a00][_0x7148('0x6f')]],'%s',_0x3bf83c):_0x3bf83c;_0x3bf83c=_0x171d0b[_0x4b1a00][_0x7148('0x71')]?_[_0x7148('0x70')](_0x38db30[_0x171d0b[_0x4b1a00][_0x7148('0x71')]],'%s',_0x3bf83c):_0x3bf83c;if(_0x171d0b[_0x4b1a00][_0x7148('0x72')]){_0x24b442[_0x7148('0x66')](_0x3bf83c);}_0x171d0b[_0x4b1a00][_0x7148('0x73')]&&_0x24b442[_0x7148('0x74')](_0x3bf83c,_0x171d0b[_0x4b1a00][_0x7148('0x73')]===_0x7148('0x75')?![]:!![]);_0x24b442[_0x7148('0x76')](_0x3bf83c,_0x171d0b[_0x4b1a00][_0x7148('0x77')]||_0x3bf83c);}if(_0x1db506[_0x7148('0x78')]){_0x1db506[_0x7148('0x78')]=JSON[_0x7148('0x79')](_0x1db506[_0x7148('0x78')]);for(var _0x21b6b6=0x0;_0x21b6b6<_0x1db506[_0x7148('0x78')][_0x7148('0x37')];_0x21b6b6+=0x1){if(_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x3e')]&&_[_0x7148('0x61')](_0x1153c9,_0x1db506['joins'][_0x21b6b6]['type'])&&_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x7a')]&&_0x1db506['joins'][_0x21b6b6][_0x7148('0x7b')]&&_0x1db506[_0x7148('0x78')][_0x21b6b6]['foreignKey']){_0x24b442[_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x3e')]](_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x7b')],null,util[_0x7148('0x71')](_0x7148('0x7c'),_0x1db506[_0x7148('0x7d')],_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x7a')],_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x7b')],_0x1db506[_0x7148('0x78')][_0x21b6b6][_0x7148('0x7e')]));}}}if(_0x1db506['conditions']){_0x1db506[_0x7148('0x7f')]=JSON['parse'](_0x1db506[_0x7148('0x7f')]);_0x24b442[_0x7148('0x3b')](_0x153cb7(_0x1db506[_0x7148('0x7f')][_0x7148('0x66')]));}_0x9bf54e=_0x24b442[_0x7148('0x80')]();_0x24b442[_0x7148('0x39')](_0x36271f);_0x24b442[_0x7148('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x24b442['toString']());return db[_0x7148('0x81')]['query'](_0x24b442['toString'](),{'type':db[_0x7148('0x81')][_0x7148('0x82')][_0x7148('0x83')]});}})[_0x7148('0x25')](respondWithResult(_0x2b6ae0,null))[_0x7148('0x48')](handleError(_0x2b6ae0,null));};function runReport(_0x331c50,_0x166e73,_0x4c9288){var _0x2cdc42=_0x166e73['name'];var _0x1d884b=0xa;var _0x27d8f2=['join','left_join',_0x7148('0x58'),_0x7148('0x59')];var _0x2df13b={'SUM':_0x7148('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7148('0x5b'),'MIN':_0x7148('0x5c'),'AVG':_0x7148('0x85'),'GROUP_CONCAT':_0x7148('0x86'),'GROUP_CONCAT ASC':_0x7148('0x5d'),'GROUP_CONCAT DESC':_0x7148('0x5e')};var _0x22984f={'SEC_TO_TIME':_0x7148('0x87'),'DATE':_0x7148('0x88'),'HOUR':_0x7148('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4f9782=function(_0x394af6){return!_[_0x7148('0x61')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7148('0x89'),_0x7148('0x64')],_0x394af6);};var _0x3931cf=function(_0xc8fb86){if(!_0xc8fb86||!_0xc8fb86[_0x7148('0x65')][_0x7148('0x37')]){return'';}for(var _0x46fabc='(',_0x24466e=0x0;_0x24466e<_0xc8fb86[_0x7148('0x65')]['length'];_0x24466e+=0x1){_0x24466e>0x0&&(_0x46fabc+='\x20'+_0xc8fb86[_0x7148('0x8a')]+'\x20');_0x46fabc+=_0xc8fb86[_0x7148('0x65')][_0x24466e][_0x7148('0x66')]?_0x3931cf(_0xc8fb86[_0x7148('0x65')][_0x24466e][_0x7148('0x66')]):_0xc8fb86[_0x7148('0x65')][_0x24466e][_0x7148('0x76')]+'\x20'+_0xc8fb86[_0x7148('0x65')][_0x24466e][_0x7148('0x67')]+(_0x4f9782(_0xc8fb86[_0x7148('0x65')][_0x24466e][_0x7148('0x67')])?'\x20'+_0xc8fb86['rules'][_0x24466e]['value']:'');}return _0x46fabc+')';};var _0xac15a2={'where':{'id':_0x331c50['id']}},_0x428e7c,_0x24aafb,_0x49c4a0,_0x405b2f,_0x4abd8f;_0xac15a2=_[_0x7148('0x41')]({},_0xac15a2,_0x4c9288);return db[_0x7148('0x43')][_0x7148('0x54')](_0xac15a2)[_0x7148('0x25')](function(_0x63f0f7){if(_0x63f0f7){_0x428e7c=_0x63f0f7;return _0x63f0f7[_0x7148('0x68')]();}return null;})[_0x7148('0x25')](function(_0x165980){if(_0x165980){if(!_0x165980[_0x7148('0x37')]){throw new db[(_0x7148('0x8b'))]['ValidationErrorItem'](_0x7148('0x8c'),0x193);}_0x24aafb=_0x165980;return db[_0x7148('0x6a')][_0x7148('0x47')]({'raw':!![]});}return null;})['then'](function(_0x4202a7){if(_0x4202a7){_0x49c4a0=_['keyBy'](_0x4202a7,'id');var _0x227392;var _0x388a05=squel[_0x7148('0x6b')]();_0x388a05[_0x7148('0x6c')](_0x428e7c[_0x7148('0x7d')]);for(var _0x8cbd68=0x0;_0x8cbd68<_0x24aafb['length'];_0x8cbd68+=0x1){_0x227392=_0x24aafb[_0x8cbd68][_0x7148('0x6d')]?_0x49c4a0[_0x24aafb[_0x8cbd68][_0x7148('0x6d')]][_0x7148('0x6e')]:_0x24aafb[_0x8cbd68][_0x7148('0x76')];_0x227392=_0x24aafb[_0x8cbd68][_0x7148('0x6f')]?_[_0x7148('0x70')](_0x2df13b[_0x24aafb[_0x8cbd68]['function']],'%s',_0x227392):_0x227392;_0x227392=_0x24aafb[_0x8cbd68][_0x7148('0x71')]?_[_0x7148('0x70')](_0x22984f[_0x24aafb[_0x8cbd68]['format']],'%s',_0x227392):_0x227392;if(_0x24aafb[_0x8cbd68][_0x7148('0x72')]){_0x388a05[_0x7148('0x66')](_0x227392);}_0x24aafb[_0x8cbd68]['orderBy']&&_0x388a05[_0x7148('0x74')](_0x227392,_0x24aafb[_0x8cbd68][_0x7148('0x73')]===_0x7148('0x75')?![]:!![]);_0x388a05['field'](_0x227392,_0x24aafb[_0x8cbd68][_0x7148('0x77')]||_0x227392);}if(_0x428e7c[_0x7148('0x78')]){_0x428e7c[_0x7148('0x78')]=JSON[_0x7148('0x79')](_0x428e7c['joins']);for(var _0x47fee5=0x0;_0x47fee5<_0x428e7c[_0x7148('0x78')][_0x7148('0x37')];_0x47fee5+=0x1){if(_0x428e7c['joins'][_0x47fee5]['type']&&_[_0x7148('0x61')](_0x27d8f2,_0x428e7c[_0x7148('0x78')][_0x47fee5][_0x7148('0x3e')])&&_0x428e7c[_0x7148('0x78')][_0x47fee5][_0x7148('0x7a')]&&_0x428e7c[_0x7148('0x78')][_0x47fee5][_0x7148('0x7b')]&&_0x428e7c[_0x7148('0x78')][_0x47fee5]['foreignKey']){_0x388a05[_0x428e7c[_0x7148('0x78')][_0x47fee5]['type']](_0x428e7c['joins'][_0x47fee5][_0x7148('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x428e7c[_0x7148('0x7d')],_0x428e7c['joins'][_0x47fee5]['parentKey'],_0x428e7c[_0x7148('0x78')][_0x47fee5]['foreignTable'],_0x428e7c[_0x7148('0x78')][_0x47fee5][_0x7148('0x7e')]));}}}if(_0x428e7c[_0x7148('0x7f')]){_0x428e7c[_0x7148('0x7f')]=JSON[_0x7148('0x79')](_0x428e7c[_0x7148('0x7f')]);_0x388a05[_0x7148('0x3b')](_0x3931cf(_0x428e7c[_0x7148('0x7f')][_0x7148('0x66')]));}_0x4abd8f=_0x388a05[_0x7148('0x80')]();_0x388a05[_0x7148('0x39')](_0x1d884b);_0x388a05['offset'](0x0);logger['debug'](_0x7148('0x8d'),_0x388a05['toString']());return db[_0x7148('0x81')]['query'](_0x388a05[_0x7148('0x8e')](),{'type':db[_0x7148('0x81')][_0x7148('0x82')][_0x7148('0x83')]});}})['then'](function(_0x331583){if(!_0x331583['length']){throw new db['Sequelize'][(_0x7148('0x69'))](_0x7148('0x8f'),0xcc);}if(_0x166e73['output']===_0x7148('0x90')){return null;}var _0x592f7d=_[_0x7148('0x41')](_0x166e73,{'name':_0x166e73[_0x7148('0x91')]||_0x166e73[_0x7148('0x2b')]||_0x428e7c[_0x7148('0x2b')],'basename':_0x2cdc42,'savename':util[_0x7148('0x71')](_0x7148('0x92'),_0x166e73[_0x7148('0x2b')]||_0x428e7c[_0x7148('0x2b')],require('randomstring')[_0x7148('0x93')](0x4),_0x166e73[_0x7148('0x94')]||_0x7148('0x95')),'reportId':_0x428e7c['id'],'reportType':_0x7148('0x96')});return db[_0x7148('0x97')]['create'](_0x592f7d,{'raw':!![]});})['then'](function(_0x28e8ab){if(_0x428e7c[_0x7148('0x7d')]===_0x7148('0x98')){_0x4abd8f['where'](_0x428e7c[_0x7148('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x166e73[_0x7148('0x99')],_0x166e73[_0x7148('0x9a')]);}else{_0x4abd8f[_0x7148('0x3b')](_0x428e7c['table']+_0x7148('0x9b'),_0x166e73[_0x7148('0x99')],_0x166e73[_0x7148('0x9a')]);}if(_0x28e8ab){logger[_0x7148('0x9c')](_0x7148('0x9d'),_0x4abd8f[_0x7148('0x8e')]());require(_0x7148('0x9e'))['fork'](path[_0x7148('0x56')](__dirname,'../../components/export/',_0x28e8ab['output']),[_0x28e8ab['id'],_0x4abd8f[_0x7148('0x8e')](),path[_0x7148('0x56')](__dirname,_0x7148('0x9f'),_0x28e8ab['savename']),_0x2cdc42]);return _0x28e8ab;}else{var _0x8b5570=squel[_0x7148('0x6b')]();_0x8b5570[_0x7148('0x6c')]('('+_0x4abd8f[_0x7148('0x8e')]()+')','countTable');_0x8b5570[_0x7148('0x76')]('COUNT(*)',_0x7148('0x44'));_0x4abd8f['limit'](_0x166e73['limit']||_0x1d884b);_0x4abd8f[_0x7148('0x1e')](_0x166e73[_0x7148('0x1e')]||0x0);return db[_0x7148('0x81')][_0x7148('0x33')](_0x8b5570[_0x7148('0x8e')](),{'type':db['sequelize']['QueryTypes'][_0x7148('0x83')]})[_0x7148('0x25')](function(_0x12d45c){if(!_0x12d45c[_0x7148('0x37')]){_0x405b2f=0x0;}else{_0x405b2f=_0x12d45c[0x0]['count']||0x0;}return db[_0x7148('0x81')][_0x7148('0x33')](_0x4abd8f[_0x7148('0x8e')](),{'type':db['sequelize'][_0x7148('0x82')][_0x7148('0x83')]});})[_0x7148('0x25')](function(_0x130a0c){return{'rows':_0x130a0c||[],'count':_0x405b2f};});}});}exports[_0x7148('0xa0')]=function(_0x3a0038,_0x572623){return runReport(_0x3a0038[_0x7148('0x4a')],_0x3a0038[_0x7148('0x33')],_0x3a0038[_0x7148('0x42')])[_0x7148('0x25')](respondWithResult(_0x572623,null))[_0x7148('0x48')](handleError(_0x572623,null));};exports[_0x7148('0xa1')]=runReport;exports[_0x7148('0x33')]=function(_0x32c44f,_0x1f0997){var _0x4fe3af=0xa;var _0x49c9f9=[_0x7148('0x56'),_0x7148('0x57'),_0x7148('0x58'),'cross_join'];var _0x52fe24={'SUM':'SUM(%s)','COUNT':_0x7148('0x5a'),'COUNT DISTINCT':_0x7148('0xa2'),'MAX':_0x7148('0x5b'),'MIN':_0x7148('0x5c'),'AVG':_0x7148('0x85'),'GROUP_CONCAT':_0x7148('0x86'),'GROUP_CONCAT ASC':_0x7148('0x5d'),'GROUP_CONCAT DESC':_0x7148('0x5e')};var _0x5743d8={'SEC_TO_TIME':_0x7148('0x87'),'DATE':_0x7148('0x88'),'HOUR':_0x7148('0x5f'),'ROUND':_0x7148('0x60'),'UNIX_TIMESTAMP':_0x7148('0xa3')};var _0x6dbc65=function(_0x2430cc){return!_[_0x7148('0x61')](['IS\x20NULL',_0x7148('0x63'),_0x7148('0x89'),'IS\x20NOT\x20EMPTY'],_0x2430cc);};var _0x180343=function(_0x3288fa){if(!_0x3288fa||!_0x3288fa[_0x7148('0x65')][_0x7148('0x37')]){return'';}for(var _0x5df2a3='(',_0x1facec=0x0;_0x1facec<_0x3288fa[_0x7148('0x65')][_0x7148('0x37')];_0x1facec+=0x1){_0x1facec>0x0&&(_0x5df2a3+='\x20'+_0x3288fa[_0x7148('0x8a')]+'\x20');_0x5df2a3+=_0x3288fa[_0x7148('0x65')][_0x1facec][_0x7148('0x66')]?_0x180343(_0x3288fa[_0x7148('0x65')][_0x1facec][_0x7148('0x66')]):_0x3288fa['rules'][_0x1facec][_0x7148('0x76')]+'\x20'+_0x3288fa['rules'][_0x1facec][_0x7148('0x67')]+(_0x6dbc65(_0x3288fa[_0x7148('0x65')][_0x1facec][_0x7148('0x67')])?'\x20'+_0x3288fa['rules'][_0x1facec][_0x7148('0xa4')]:'');}return _0x5df2a3+')';};var _0x33df47={'where':{'id':_0x32c44f[_0x7148('0x4a')]['id']}},_0x44d260,_0x2fee6c,_0x497207,_0xa7526,_0x25e2d1;_0x33df47=_[_0x7148('0x41')]({},_0x33df47,_0x32c44f[_0x7148('0x42')]);return db[_0x7148('0x43')][_0x7148('0x54')](_0x33df47)[_0x7148('0x25')](function(_0x4233a8){if(_0x4233a8){_0x44d260=_0x4233a8;return _0x4233a8[_0x7148('0x68')]();}return null;})[_0x7148('0x25')](function(_0x1cf678){if(_0x1cf678){if(!_0x1cf678[_0x7148('0x37')]){throw new db[(_0x7148('0x8b'))][(_0x7148('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2fee6c=_0x1cf678;return db[_0x7148('0x6a')][_0x7148('0x47')]({'raw':!![]});}return null;})['then'](function(_0x36f99b){if(_0x36f99b){_0x497207=_[_0x7148('0xa5')](_0x36f99b,'id');var _0x2023c4;var _0x37c0af=squel[_0x7148('0x6b')]();_0x37c0af[_0x7148('0x6c')](_0x44d260[_0x7148('0x7d')]);for(var _0x3c8b95=0x0;_0x3c8b95<_0x2fee6c[_0x7148('0x37')];_0x3c8b95+=0x1){_0x2023c4=_0x2fee6c[_0x3c8b95][_0x7148('0x6d')]?_0x497207[_0x2fee6c[_0x3c8b95][_0x7148('0x6d')]][_0x7148('0x6e')]:_0x2fee6c[_0x3c8b95][_0x7148('0x76')];_0x2023c4=_0x2fee6c[_0x3c8b95][_0x7148('0x6f')]?_[_0x7148('0x70')](_0x52fe24[_0x2fee6c[_0x3c8b95]['function']],'%s',_0x2023c4):_0x2023c4;_0x2023c4=_0x2fee6c[_0x3c8b95][_0x7148('0x71')]?_[_0x7148('0x70')](_0x5743d8[_0x2fee6c[_0x3c8b95][_0x7148('0x71')]],'%s',_0x2023c4):_0x2023c4;if(_0x2fee6c[_0x3c8b95][_0x7148('0x72')]){_0x37c0af[_0x7148('0x66')](_0x2023c4);}_0x2fee6c[_0x3c8b95]['orderBy']&&_0x37c0af[_0x7148('0x74')](_0x2023c4,_0x2fee6c[_0x3c8b95][_0x7148('0x73')]===_0x7148('0x75')?![]:!![]);_0x37c0af[_0x7148('0x76')](_0x2023c4,_0x2fee6c[_0x3c8b95][_0x7148('0x77')]||_0x2023c4);}if(_0x44d260[_0x7148('0x78')]){_0x44d260['joins']=JSON[_0x7148('0x79')](_0x44d260[_0x7148('0x78')]);for(var _0x466f49=0x0;_0x466f49<_0x44d260['joins'][_0x7148('0x37')];_0x466f49+=0x1){if(_0x44d260['joins'][_0x466f49][_0x7148('0x3e')]&&_[_0x7148('0x61')](_0x49c9f9,_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x3e')])&&_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x7a')]&&_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x7b')]&&_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x7e')]){_0x37c0af[_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x3e')]](_0x44d260[_0x7148('0x78')][_0x466f49]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x44d260['table'],_0x44d260[_0x7148('0x78')][_0x466f49]['parentKey'],_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x7b')],_0x44d260[_0x7148('0x78')][_0x466f49][_0x7148('0x7e')]));}}}if(_0x44d260[_0x7148('0x7f')]){_0x44d260[_0x7148('0x7f')]=JSON[_0x7148('0x79')](_0x44d260['conditions']);_0x37c0af[_0x7148('0x3b')](_0x180343(_0x44d260[_0x7148('0x7f')][_0x7148('0x66')]));}_0x25e2d1=_0x37c0af['clone']();_0x37c0af['limit'](_0x4fe3af);_0x37c0af[_0x7148('0x1e')](0x0);logger[_0x7148('0xa6')](_0x7148('0x8d'),_0x37c0af[_0x7148('0x8e')]());return db[_0x7148('0x81')][_0x7148('0x33')](_0x37c0af[_0x7148('0x8e')](),{'type':db['sequelize'][_0x7148('0x82')][_0x7148('0x83')]});}})[_0x7148('0x25')](function(){return{'sql':_0x25e2d1[_0x7148('0x8e')]()};})[_0x7148('0x25')](respondWithResult(_0x1f0997,null))[_0x7148('0x48')](handleError(_0x1f0997,null));}; \ No newline at end of file +var _0xf273=['parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','No\x20available\x20data','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','countTable','COUNT(*)','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','clone','Limited\x20Query:','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes'];(function(_0x9b7a4c,_0x31aa64){var _0x1633bf=function(_0x749f8f){while(--_0x749f8f){_0x9b7a4c['push'](_0x9b7a4c['shift']());}};_0x1633bf(++_0x31aa64);}(_0xf273,0xce));var _0x3f27=function(_0x30acf5,_0xd894f1){_0x30acf5=_0x30acf5-0x0;var _0x1c7d62=_0xf273[_0x30acf5];return _0x1c7d62;};'use strict';var pdf=require(_0x3f27('0x0'));var emlformat=require(_0x3f27('0x1'));var rimraf=require(_0x3f27('0x2'));var zipdir=require(_0x3f27('0x3'));var jsonpatch=require(_0x3f27('0x4'));var rp=require('request-promise');var moment=require(_0x3f27('0x5'));var BPromise=require(_0x3f27('0x6'));var Mustache=require(_0x3f27('0x7'));var util=require(_0x3f27('0x8'));var path=require(_0x3f27('0x9'));var sox=require('sox');var csv=require(_0x3f27('0xa'));var ejs=require(_0x3f27('0xb'));var fs=require('fs');var _=require(_0x3f27('0xc'));var squel=require(_0x3f27('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f27('0xe'));var deskjs=require(_0x3f27('0xf'));var toCsv=require(_0x3f27('0xa'));var querystring=require(_0x3f27('0x10'));var Papa=require(_0x3f27('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f27('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f27('0x13'));var logger=require(_0x3f27('0x14'))(_0x3f27('0x15'));var utils=require(_0x3f27('0x16'));var config=require(_0x3f27('0x17'));var db=require(_0x3f27('0x18'))['db'];function respondWithStatusCode(_0x291e8d,_0x37b355){_0x37b355=_0x37b355||0xcc;return function(_0x2b235e){if(_0x2b235e){return _0x291e8d[_0x3f27('0x19')](_0x37b355);}return _0x291e8d[_0x3f27('0x1a')](_0x37b355)['end']();};}function respondWithResult(_0x15b782,_0x1c5d5e){_0x1c5d5e=_0x1c5d5e||0xc8;return function(_0x5a4647){if(_0x5a4647){return _0x15b782[_0x3f27('0x1a')](_0x1c5d5e)[_0x3f27('0x1b')](_0x5a4647);}};}function respondWithFilteredResult(_0x1e18ec,_0x525238){return function(_0x21d221){if(_0x21d221){var _0x56d3d2=_0x21d221[_0x3f27('0x1c')],_0x1bc7be=_0x525238[_0x3f27('0x1d')],_0x55a49f=_0x525238[_0x3f27('0x1d')]+_0x525238[_0x3f27('0x1e')],_0x58e256;if(_0x55a49f>=_0x56d3d2){_0x55a49f=_0x56d3d2;_0x58e256=0xc8;}else{_0x58e256=0xce;}_0x1e18ec[_0x3f27('0x1a')](_0x58e256);return _0x1e18ec[_0x3f27('0x1f')](_0x3f27('0x20'),_0x1bc7be+'-'+_0x55a49f+'/'+_0x56d3d2)[_0x3f27('0x1b')](_0x21d221);}return null;};}function patchUpdates(_0x31d875){return function(_0x5937f6){try{jsonpatch[_0x3f27('0x21')](_0x5937f6,_0x31d875,!![]);}catch(_0x56978e){return BPromise['reject'](_0x56978e);}return _0x5937f6['save']();};}function saveUpdates(_0x1e55be,_0x231052){return function(_0x510165){if(_0x510165){return _0x510165[_0x3f27('0x22')](_0x1e55be)[_0x3f27('0x23')](function(_0x12a331){return _0x12a331;});}return null;};}function removeEntity(_0x56779d,_0x4b52bb){return function(_0x332b03){if(_0x332b03){return _0x332b03[_0x3f27('0x24')]()[_0x3f27('0x23')](function(){var _0x5f49ca=_0x332b03['get']({'plain':!![]});var _0x36c641=_0x3f27('0x25');return db[_0x3f27('0x26')]['destroy']({'where':{'type':_0x36c641,'resourceId':_0x5f49ca['id']}})[_0x3f27('0x23')](function(){return _0x332b03;});})[_0x3f27('0x23')](function(){_0x56779d[_0x3f27('0x1a')](0xcc)[_0x3f27('0x27')]();});}};}function handleEntityNotFound(_0x2eb69f,_0x33a6b0){return function(_0x2fc8f7){if(!_0x2fc8f7){_0x2eb69f['sendStatus'](0x194);}return _0x2fc8f7;};}function handleError(_0x3d75f7,_0x4f2de0){_0x4f2de0=_0x4f2de0||0x1f4;return function(_0x4f38ee){logger[_0x3f27('0x28')](_0x4f38ee[_0x3f27('0x29')]);if(_0x4f38ee[_0x3f27('0x2a')]){delete _0x4f38ee['name'];}_0x3d75f7['status'](_0x4f2de0)[_0x3f27('0x2b')](_0x4f38ee);};}exports[_0x3f27('0x2c')]=function(_0x1195bf,_0x19fa23){var _0x154e7e={},_0x32002a={},_0x584547={'count':0x0,'rows':[]};var _0x596724=_[_0x3f27('0x2d')](db[_0x3f27('0x2e')][_0x3f27('0x2f')],function(_0x9684bb){return{'name':_0x9684bb[_0x3f27('0x30')],'type':_0x9684bb[_0x3f27('0x31')]['key']};});_0x32002a[_0x3f27('0x32')]=_[_0x3f27('0x2d')](_0x596724,'name');_0x32002a[_0x3f27('0x33')]=_[_0x3f27('0x34')](_0x1195bf['query']);_0x32002a[_0x3f27('0x35')]=_[_0x3f27('0x36')](_0x32002a['model'],_0x32002a[_0x3f27('0x33')]);_0x154e7e[_0x3f27('0x37')]=_[_0x3f27('0x36')](_0x32002a[_0x3f27('0x32')],qs[_0x3f27('0x38')](_0x1195bf[_0x3f27('0x33')][_0x3f27('0x38')]));_0x154e7e[_0x3f27('0x37')]=_0x154e7e[_0x3f27('0x37')]['length']?_0x154e7e[_0x3f27('0x37')]:_0x32002a[_0x3f27('0x32')];if(!_0x1195bf[_0x3f27('0x33')][_0x3f27('0x39')](_0x3f27('0x3a'))){_0x154e7e[_0x3f27('0x1e')]=qs[_0x3f27('0x1e')](_0x1195bf[_0x3f27('0x33')][_0x3f27('0x1e')]);_0x154e7e[_0x3f27('0x1d')]=qs['offset'](_0x1195bf[_0x3f27('0x33')]['offset']);}_0x154e7e[_0x3f27('0x3b')]=qs[_0x3f27('0x3c')](_0x1195bf[_0x3f27('0x33')][_0x3f27('0x3c')]);_0x154e7e[_0x3f27('0x3d')]=qs[_0x3f27('0x35')](_[_0x3f27('0x3e')](_0x1195bf[_0x3f27('0x33')],_0x32002a['filters']));if(_0x1195bf[_0x3f27('0x33')][_0x3f27('0x3f')]){_0x154e7e[_0x3f27('0x3d')]=_['merge'](_0x154e7e[_0x3f27('0x3d')],{'$or':_[_0x3f27('0x2d')](_0x596724,function(_0x187256){if(_0x187256[_0x3f27('0x31')]!==_0x3f27('0x40')){var _0x4d9c34={};_0x4d9c34[_0x187256[_0x3f27('0x2a')]]={'$like':'%'+_0x1195bf[_0x3f27('0x33')][_0x3f27('0x3f')]+'%'};return _0x4d9c34;}})});}_0x154e7e=_[_0x3f27('0x41')]({},_0x154e7e,_0x1195bf[_0x3f27('0x42')]);var _0x50767a={'where':_0x154e7e[_0x3f27('0x3d')]};return db[_0x3f27('0x2e')][_0x3f27('0x1c')](_0x50767a)[_0x3f27('0x23')](function(_0x239dda){_0x584547[_0x3f27('0x1c')]=_0x239dda;if(_0x1195bf[_0x3f27('0x33')]['includeAll']){_0x154e7e[_0x3f27('0x43')]=[{'all':!![]}];}return db[_0x3f27('0x2e')][_0x3f27('0x44')](_0x154e7e);})[_0x3f27('0x23')](function(_0x2f1156){_0x584547[_0x3f27('0x45')]=_0x2f1156;return _0x584547;})[_0x3f27('0x23')](respondWithFilteredResult(_0x19fa23,_0x154e7e))['catch'](handleError(_0x19fa23,null));};exports[_0x3f27('0x46')]=function(_0x5430e6,_0x5571be){var _0x49d853={'raw':![],'where':{'id':_0x5430e6[_0x3f27('0x47')]['id']}},_0x218c4a={};_0x218c4a[_0x3f27('0x32')]=_[_0x3f27('0x34')](db['AnalyticCustomReport']['rawAttributes']);_0x218c4a[_0x3f27('0x33')]=_[_0x3f27('0x34')](_0x5430e6[_0x3f27('0x33')]);_0x218c4a[_0x3f27('0x35')]=_['intersection'](_0x218c4a[_0x3f27('0x32')],_0x218c4a[_0x3f27('0x33')]);_0x49d853['attributes']=_[_0x3f27('0x36')](_0x218c4a[_0x3f27('0x32')],qs['fields'](_0x5430e6[_0x3f27('0x33')]['fields']));_0x49d853[_0x3f27('0x37')]=_0x49d853[_0x3f27('0x37')][_0x3f27('0x48')]?_0x49d853[_0x3f27('0x37')]:_0x218c4a['model'];if(_0x5430e6[_0x3f27('0x33')][_0x3f27('0x49')]){_0x49d853[_0x3f27('0x43')]=[{'all':!![]}];}_0x49d853=_[_0x3f27('0x41')]({},_0x49d853,_0x5430e6[_0x3f27('0x42')]);return db[_0x3f27('0x2e')][_0x3f27('0x4a')](_0x49d853)[_0x3f27('0x23')](handleEntityNotFound(_0x5571be,null))[_0x3f27('0x23')](respondWithResult(_0x5571be,null))[_0x3f27('0x4b')](handleError(_0x5571be,null));};exports[_0x3f27('0x4c')]=function(_0x208e61,_0x2351ab){return db[_0x3f27('0x2e')][_0x3f27('0x4c')](_0x208e61[_0x3f27('0x4d')],{})[_0x3f27('0x23')](function(_0x4e6f99){var _0x4d7c84=_0x208e61[_0x3f27('0x4e')][_0x3f27('0x4f')]({'plain':!![]});if(!_0x4d7c84)throw new Error(_0x3f27('0x50'));if(_0x4d7c84[_0x3f27('0x51')]===_0x3f27('0x4e')){var _0x9eeac=_0x4e6f99['get']({'plain':!![]});var _0x6dafd1='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x6dafd1,'userProfileId':_0x4d7c84[_0x3f27('0x52')]},'raw':!![]})[_0x3f27('0x23')](function(_0xb4e140){if(_0xb4e140&&_0xb4e140[_0x3f27('0x53')]===0x0){return db[_0x3f27('0x26')][_0x3f27('0x4c')]({'name':_0x9eeac['name'],'resourceId':_0x9eeac['id'],'type':_0x3f27('0x25'),'sectionId':_0xb4e140['id']},{})[_0x3f27('0x23')](function(){return _0x4e6f99;});}else{return _0x4e6f99;}})[_0x3f27('0x4b')](function(_0x31f6eb){logger[_0x3f27('0x28')](_0x3f27('0x54'),_0x31f6eb);throw _0x31f6eb;});}return _0x4e6f99;})[_0x3f27('0x23')](respondWithResult(_0x2351ab,0xc9))[_0x3f27('0x4b')](handleError(_0x2351ab,null));};exports[_0x3f27('0x22')]=function(_0x2741e5,_0x141a37){if(_0x2741e5[_0x3f27('0x4d')]['id']){delete _0x2741e5['body']['id'];}return db[_0x3f27('0x2e')][_0x3f27('0x4a')]({'where':{'id':_0x2741e5['params']['id']}})[_0x3f27('0x23')](handleEntityNotFound(_0x141a37,null))[_0x3f27('0x23')](saveUpdates(_0x2741e5[_0x3f27('0x4d')],null))['then'](respondWithResult(_0x141a37,null))[_0x3f27('0x4b')](handleError(_0x141a37,null));};exports['destroy']=function(_0x123b84,_0x521230){return db[_0x3f27('0x2e')][_0x3f27('0x4a')]({'where':{'id':_0x123b84['params']['id']}})['then'](handleEntityNotFound(_0x521230,null))[_0x3f27('0x23')](removeEntity(_0x521230,null))[_0x3f27('0x4b')](handleError(_0x521230,null));};exports[_0x3f27('0x55')]=function(_0x2df445,_0x496616){var _0x1a2559=0xa;var _0x1b3a7e=[_0x3f27('0x56'),_0x3f27('0x57'),_0x3f27('0x58'),_0x3f27('0x59')];var _0x5ca916={'SUM':_0x3f27('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3f27('0x5b'),'MAX':_0x3f27('0x5c'),'MIN':_0x3f27('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3f27('0x5e'),'GROUP_CONCAT ASC':_0x3f27('0x5f'),'GROUP_CONCAT DESC':_0x3f27('0x60')};var _0x3baca9={'SEC_TO_TIME':_0x3f27('0x61'),'DATE':'DATE(%s)','HOUR':_0x3f27('0x62'),'ROUND':_0x3f27('0x63'),'UNIX_TIMESTAMP':_0x3f27('0x64')};var _0x38597a=function(_0x1d52aa){return!_['includes']([_0x3f27('0x65'),_0x3f27('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1d52aa);};var _0x2a0d9f=function(_0x1f90b4){if(!_0x1f90b4||!_0x1f90b4[_0x3f27('0x67')][_0x3f27('0x48')]){return'';}for(var _0x3e4bff='(',_0x9af335=0x0;_0x9af335<_0x1f90b4[_0x3f27('0x67')]['length'];_0x9af335+=0x1){_0x9af335>0x0&&(_0x3e4bff+='\x20'+_0x1f90b4[_0x3f27('0x68')]+'\x20');_0x3e4bff+=_0x1f90b4[_0x3f27('0x67')][_0x9af335][_0x3f27('0x69')]?_0x2a0d9f(_0x1f90b4[_0x3f27('0x67')][_0x9af335][_0x3f27('0x69')]):_0x1f90b4[_0x3f27('0x67')][_0x9af335][_0x3f27('0x6a')]+'\x20'+_0x1f90b4[_0x3f27('0x67')][_0x9af335][_0x3f27('0x6b')]+(_0x38597a(_0x1f90b4[_0x3f27('0x67')][_0x9af335][_0x3f27('0x6b')])?'\x20'+_0x1f90b4[_0x3f27('0x67')][_0x9af335][_0x3f27('0x6c')]:'');}return _0x3e4bff+')';};var _0x44b2a3={'where':{'id':_0x2df445[_0x3f27('0x47')]['id']}},_0x821271,_0x3b4085,_0x325172,_0x4550ab,_0x3194cb;_0x44b2a3=_['merge']({},_0x44b2a3,_0x2df445[_0x3f27('0x42')]);return db['AnalyticCustomReport'][_0x3f27('0x4a')](_0x44b2a3)[_0x3f27('0x23')](function(_0x2120b4){if(_0x2120b4){_0x821271=_0x2120b4;return _0x2120b4[_0x3f27('0x6d')]();}return null;})[_0x3f27('0x23')](function(_0x1869de){if(_0x1869de){if(!_0x1869de[_0x3f27('0x48')]){throw new db[(_0x3f27('0x6e'))][(_0x3f27('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3b4085=_0x1869de;return db['AnalyticMetric'][_0x3f27('0x44')]({'raw':!![]});}return null;})[_0x3f27('0x23')](function(_0x179f52){if(_0x179f52){_0x325172=_['keyBy'](_0x179f52,'id');var _0x105a10;var _0xcdfc4=squel[_0x3f27('0x70')]();_0xcdfc4[_0x3f27('0x71')](_0x821271['table']);for(var _0x17d750=0x0;_0x17d750<_0x3b4085['length'];_0x17d750+=0x1){_0x105a10=_0x3b4085[_0x17d750]['MetricId']?_0x325172[_0x3b4085[_0x17d750][_0x3f27('0x72')]][_0x3f27('0x73')]:_0x3b4085[_0x17d750][_0x3f27('0x6a')];_0x105a10=_0x3b4085[_0x17d750][_0x3f27('0x74')]?_[_0x3f27('0x75')](_0x5ca916[_0x3b4085[_0x17d750]['function']],'%s',_0x105a10):_0x105a10;_0x105a10=_0x3b4085[_0x17d750][_0x3f27('0x76')]?_['replace'](_0x3baca9[_0x3b4085[_0x17d750]['format']],'%s',_0x105a10):_0x105a10;if(_0x3b4085[_0x17d750][_0x3f27('0x77')]){_0xcdfc4[_0x3f27('0x69')](_0x105a10);}_0x3b4085[_0x17d750][_0x3f27('0x78')]&&_0xcdfc4[_0x3f27('0x3b')](_0x105a10,_0x3b4085[_0x17d750][_0x3f27('0x78')]===_0x3f27('0x79')?![]:!![]);_0xcdfc4[_0x3f27('0x6a')](_0x105a10,_0x3b4085[_0x17d750][_0x3f27('0x7a')]||_0x105a10);}if(_0x821271[_0x3f27('0x7b')]){_0x821271['joins']=JSON[_0x3f27('0x7c')](_0x821271[_0x3f27('0x7b')]);for(var _0x6c5911=0x0;_0x6c5911<_0x821271[_0x3f27('0x7b')][_0x3f27('0x48')];_0x6c5911+=0x1){if(_0x821271[_0x3f27('0x7b')][_0x6c5911]['type']&&_[_0x3f27('0x7d')](_0x1b3a7e,_0x821271[_0x3f27('0x7b')][_0x6c5911][_0x3f27('0x31')])&&_0x821271['joins'][_0x6c5911][_0x3f27('0x7e')]&&_0x821271[_0x3f27('0x7b')][_0x6c5911]['foreignTable']&&_0x821271[_0x3f27('0x7b')][_0x6c5911]['foreignKey']){_0xcdfc4[_0x821271[_0x3f27('0x7b')][_0x6c5911][_0x3f27('0x31')]](_0x821271[_0x3f27('0x7b')][_0x6c5911][_0x3f27('0x7f')],null,util[_0x3f27('0x76')](_0x3f27('0x80'),_0x821271[_0x3f27('0x81')],_0x821271[_0x3f27('0x7b')][_0x6c5911]['parentKey'],_0x821271[_0x3f27('0x7b')][_0x6c5911][_0x3f27('0x7f')],_0x821271['joins'][_0x6c5911][_0x3f27('0x82')]));}}}if(_0x821271['conditions']){_0x821271[_0x3f27('0x83')]=JSON['parse'](_0x821271[_0x3f27('0x83')]);_0xcdfc4[_0x3f27('0x3d')](_0x2a0d9f(_0x821271['conditions'][_0x3f27('0x69')]));}_0x3194cb=_0xcdfc4['clone']();_0xcdfc4[_0x3f27('0x1e')](_0x1a2559);_0xcdfc4[_0x3f27('0x1d')](0x0);logger[_0x3f27('0x84')]('Limited\x20Query:',_0xcdfc4[_0x3f27('0x85')]());return db['sequelize'][_0x3f27('0x33')](_0xcdfc4[_0x3f27('0x85')](),{'type':db[_0x3f27('0x86')][_0x3f27('0x87')][_0x3f27('0x88')]});}})[_0x3f27('0x23')](respondWithResult(_0x496616,null))[_0x3f27('0x4b')](handleError(_0x496616,null));};function runReport(_0x5f5500,_0x3ccb76,_0x568ca4){var _0x5de64f=_0x3ccb76[_0x3f27('0x2a')];var _0x18b578=0xa;var _0x5219a1=[_0x3f27('0x56'),_0x3f27('0x57'),'right_join',_0x3f27('0x59')];var _0x114bd8={'SUM':_0x3f27('0x5a'),'COUNT':_0x3f27('0x89'),'COUNT DISTINCT':_0x3f27('0x5b'),'MAX':'MAX(%s)','MIN':_0x3f27('0x5d'),'AVG':_0x3f27('0x8a'),'GROUP_CONCAT':_0x3f27('0x5e'),'GROUP_CONCAT ASC':_0x3f27('0x5f'),'GROUP_CONCAT DESC':_0x3f27('0x60')};var _0x2ef875={'SEC_TO_TIME':_0x3f27('0x61'),'DATE':_0x3f27('0x8b'),'HOUR':'HOUR(%s)','ROUND':_0x3f27('0x63'),'UNIX_TIMESTAMP':_0x3f27('0x64')};var _0x10326b=function(_0xc38d3c){return!_[_0x3f27('0x7d')]([_0x3f27('0x65'),_0x3f27('0x66'),'IS\x20EMPTY',_0x3f27('0x8c')],_0xc38d3c);};var _0x48359b=function(_0x4d5c72){if(!_0x4d5c72||!_0x4d5c72[_0x3f27('0x67')][_0x3f27('0x48')]){return'';}for(var _0x29b1a3='(',_0x2180c0=0x0;_0x2180c0<_0x4d5c72[_0x3f27('0x67')][_0x3f27('0x48')];_0x2180c0+=0x1){_0x2180c0>0x0&&(_0x29b1a3+='\x20'+_0x4d5c72[_0x3f27('0x68')]+'\x20');_0x29b1a3+=_0x4d5c72['rules'][_0x2180c0][_0x3f27('0x69')]?_0x48359b(_0x4d5c72[_0x3f27('0x67')][_0x2180c0][_0x3f27('0x69')]):_0x4d5c72['rules'][_0x2180c0]['field']+'\x20'+_0x4d5c72[_0x3f27('0x67')][_0x2180c0][_0x3f27('0x6b')]+(_0x10326b(_0x4d5c72[_0x3f27('0x67')][_0x2180c0][_0x3f27('0x6b')])?'\x20'+_0x4d5c72[_0x3f27('0x67')][_0x2180c0][_0x3f27('0x6c')]:'');}return _0x29b1a3+')';};var _0x2e9eb0={'where':{'id':_0x5f5500['id']}},_0xa8a6af,_0x1676f8,_0x183c69,_0x26bffd,_0x5da638;_0x2e9eb0=_[_0x3f27('0x41')]({},_0x2e9eb0,_0x568ca4);return db[_0x3f27('0x2e')][_0x3f27('0x4a')](_0x2e9eb0)[_0x3f27('0x23')](function(_0x53abee){if(_0x53abee){_0xa8a6af=_0x53abee;return _0x53abee['getFields']();}return null;})[_0x3f27('0x23')](function(_0x5ddbdc){if(_0x5ddbdc){if(!_0x5ddbdc[_0x3f27('0x48')]){throw new db[(_0x3f27('0x6e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1676f8=_0x5ddbdc;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3f27('0x23')](function(_0x203bb8){if(_0x203bb8){_0x183c69=_['keyBy'](_0x203bb8,'id');var _0x36456d;var _0x1037da=squel['select']();_0x1037da['from'](_0xa8a6af[_0x3f27('0x81')]);for(var _0x959a1d=0x0;_0x959a1d<_0x1676f8[_0x3f27('0x48')];_0x959a1d+=0x1){_0x36456d=_0x1676f8[_0x959a1d]['MetricId']?_0x183c69[_0x1676f8[_0x959a1d][_0x3f27('0x72')]][_0x3f27('0x73')]:_0x1676f8[_0x959a1d][_0x3f27('0x6a')];_0x36456d=_0x1676f8[_0x959a1d][_0x3f27('0x74')]?_[_0x3f27('0x75')](_0x114bd8[_0x1676f8[_0x959a1d][_0x3f27('0x74')]],'%s',_0x36456d):_0x36456d;_0x36456d=_0x1676f8[_0x959a1d][_0x3f27('0x76')]?_['replace'](_0x2ef875[_0x1676f8[_0x959a1d][_0x3f27('0x76')]],'%s',_0x36456d):_0x36456d;if(_0x1676f8[_0x959a1d][_0x3f27('0x77')]){_0x1037da[_0x3f27('0x69')](_0x36456d);}_0x1676f8[_0x959a1d]['orderBy']&&_0x1037da['order'](_0x36456d,_0x1676f8[_0x959a1d][_0x3f27('0x78')]==='DESC'?![]:!![]);_0x1037da[_0x3f27('0x6a')](_0x36456d,_0x1676f8[_0x959a1d][_0x3f27('0x7a')]||_0x36456d);}if(_0xa8a6af[_0x3f27('0x7b')]){_0xa8a6af[_0x3f27('0x7b')]=JSON[_0x3f27('0x7c')](_0xa8a6af[_0x3f27('0x7b')]);for(var _0x1cdf13=0x0;_0x1cdf13<_0xa8a6af['joins'][_0x3f27('0x48')];_0x1cdf13+=0x1){if(_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x31')]&&_['includes'](_0x5219a1,_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x31')])&&_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x7e')]&&_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x7f')]&&_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x82')]){_0x1037da[_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x31')]](_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x7f')],null,util[_0x3f27('0x76')](_0x3f27('0x80'),_0xa8a6af['table'],_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x7e')],_0xa8a6af[_0x3f27('0x7b')][_0x1cdf13][_0x3f27('0x7f')],_0xa8a6af['joins'][_0x1cdf13][_0x3f27('0x82')]));}}}if(_0xa8a6af[_0x3f27('0x83')]){_0xa8a6af[_0x3f27('0x83')]=JSON[_0x3f27('0x7c')](_0xa8a6af['conditions']);_0x1037da[_0x3f27('0x3d')](_0x48359b(_0xa8a6af['conditions'][_0x3f27('0x69')]));}_0x5da638=_0x1037da['clone']();_0x1037da[_0x3f27('0x1e')](_0x18b578);_0x1037da[_0x3f27('0x1d')](0x0);logger[_0x3f27('0x84')]('Limited\x20Query:',_0x1037da[_0x3f27('0x85')]());return db[_0x3f27('0x86')][_0x3f27('0x33')](_0x1037da[_0x3f27('0x85')](),{'type':db[_0x3f27('0x86')][_0x3f27('0x87')][_0x3f27('0x88')]});}})[_0x3f27('0x23')](function(_0x51271f){if(!_0x51271f[_0x3f27('0x48')]){throw new db['Sequelize'][(_0x3f27('0x6f'))](_0x3f27('0x8d'),0xcc);}if(_0x3ccb76['output']==='web'){return null;}var _0x28c839=_['merge'](_0x3ccb76,{'name':_0x3ccb76[_0x3f27('0x8e')]||_0x3ccb76[_0x3f27('0x2a')]||_0xa8a6af[_0x3f27('0x2a')],'basename':_0x5de64f,'savename':util[_0x3f27('0x76')]('%s-%s.%s',_0x3ccb76[_0x3f27('0x2a')]||_0xa8a6af[_0x3f27('0x2a')],require(_0x3f27('0x8f'))[_0x3f27('0x90')](0x4),_0x3ccb76['output']||_0x3f27('0x91')),'reportId':_0xa8a6af['id'],'reportType':_0x3f27('0x92')});return db[_0x3f27('0x93')][_0x3f27('0x4c')](_0x28c839,{'raw':!![]});})[_0x3f27('0x23')](function(_0x1548de){if(_0xa8a6af['table']===_0x3f27('0x94')){_0x5da638[_0x3f27('0x3d')](_0xa8a6af[_0x3f27('0x81')]+_0x3f27('0x95'),_0x3ccb76[_0x3f27('0x96')],_0x3ccb76[_0x3f27('0x97')]);}else{_0x5da638[_0x3f27('0x3d')](_0xa8a6af[_0x3f27('0x81')]+_0x3f27('0x98'),_0x3ccb76[_0x3f27('0x96')],_0x3ccb76[_0x3f27('0x97')]);}if(_0x1548de){logger[_0x3f27('0x99')](_0x3f27('0x9a'),_0x5da638[_0x3f27('0x85')]());require(_0x3f27('0x9b'))[_0x3f27('0x9c')](path[_0x3f27('0x56')](__dirname,_0x3f27('0x9d'),_0x1548de['output']),[_0x1548de['id'],_0x5da638['toString'](),path[_0x3f27('0x56')](__dirname,'../../files/reports',_0x1548de['savename']),_0x5de64f]);return _0x1548de;}else{var _0x5725ff=squel['select']();_0x5725ff['from']('('+_0x5da638[_0x3f27('0x85')]()+')',_0x3f27('0x9e'));_0x5725ff[_0x3f27('0x6a')](_0x3f27('0x9f'),_0x3f27('0x1c'));_0x5da638[_0x3f27('0x1e')](_0x3ccb76['limit']||_0x18b578);_0x5da638[_0x3f27('0x1d')](_0x3ccb76[_0x3f27('0x1d')]||0x0);return db['sequelize'][_0x3f27('0x33')](_0x5725ff[_0x3f27('0x85')](),{'type':db[_0x3f27('0x86')]['QueryTypes'][_0x3f27('0x88')]})['then'](function(_0x1daff5){if(!_0x1daff5[_0x3f27('0x48')]){_0x26bffd=0x0;}else{_0x26bffd=_0x1daff5[0x0][_0x3f27('0x1c')]||0x0;}return db[_0x3f27('0x86')][_0x3f27('0x33')](_0x5da638[_0x3f27('0x85')](),{'type':db[_0x3f27('0x86')]['QueryTypes'][_0x3f27('0x88')]});})[_0x3f27('0x23')](function(_0x50ab78){return{'rows':_0x50ab78||[],'count':_0x26bffd};});}});}exports['run']=function(_0x755604,_0x5f38a1){return runReport(_0x755604['params'],_0x755604[_0x3f27('0x33')],_0x755604[_0x3f27('0x42')])[_0x3f27('0x23')](respondWithResult(_0x5f38a1,null))[_0x3f27('0x4b')](handleError(_0x5f38a1,null));};exports['runReport']=runReport;exports[_0x3f27('0x33')]=function(_0x545a9d,_0x325d16){var _0xabf287=0xa;var _0x1a5553=[_0x3f27('0x56'),_0x3f27('0x57'),'right_join',_0x3f27('0x59')];var _0x237ba5={'SUM':_0x3f27('0x5a'),'COUNT':_0x3f27('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3f27('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x3f27('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3f27('0x60')};var _0x1c5b8a={'SEC_TO_TIME':_0x3f27('0x61'),'DATE':_0x3f27('0x8b'),'HOUR':_0x3f27('0x62'),'ROUND':_0x3f27('0x63'),'UNIX_TIMESTAMP':_0x3f27('0x64')};var _0x273edb=function(_0x4853df){return!_[_0x3f27('0x7d')](['IS\x20NULL',_0x3f27('0x66'),_0x3f27('0xa0'),_0x3f27('0x8c')],_0x4853df);};var _0x2ef4b9=function(_0x497a62){if(!_0x497a62||!_0x497a62['rules'][_0x3f27('0x48')]){return'';}for(var _0x95e16b='(',_0x4b9346=0x0;_0x4b9346<_0x497a62[_0x3f27('0x67')]['length'];_0x4b9346+=0x1){_0x4b9346>0x0&&(_0x95e16b+='\x20'+_0x497a62[_0x3f27('0x68')]+'\x20');_0x95e16b+=_0x497a62[_0x3f27('0x67')][_0x4b9346][_0x3f27('0x69')]?_0x2ef4b9(_0x497a62[_0x3f27('0x67')][_0x4b9346][_0x3f27('0x69')]):_0x497a62[_0x3f27('0x67')][_0x4b9346]['field']+'\x20'+_0x497a62['rules'][_0x4b9346][_0x3f27('0x6b')]+(_0x273edb(_0x497a62[_0x3f27('0x67')][_0x4b9346][_0x3f27('0x6b')])?'\x20'+_0x497a62[_0x3f27('0x67')][_0x4b9346][_0x3f27('0x6c')]:'');}return _0x95e16b+')';};var _0x43a8ec={'where':{'id':_0x545a9d[_0x3f27('0x47')]['id']}},_0x268a68,_0x4c0fe1,_0x3c10d5,_0x39b2e5,_0x5227e6;_0x43a8ec=_[_0x3f27('0x41')]({},_0x43a8ec,_0x545a9d[_0x3f27('0x42')]);return db[_0x3f27('0x2e')][_0x3f27('0x4a')](_0x43a8ec)[_0x3f27('0x23')](function(_0x2235e3){if(_0x2235e3){_0x268a68=_0x2235e3;return _0x2235e3[_0x3f27('0x6d')]();}return null;})[_0x3f27('0x23')](function(_0x49438f){if(_0x49438f){if(!_0x49438f[_0x3f27('0x48')]){throw new db[(_0x3f27('0x6e'))][(_0x3f27('0x6f'))](_0x3f27('0xa1'),0x193);}_0x4c0fe1=_0x49438f;return db[_0x3f27('0xa2')]['findAll']({'raw':!![]});}return null;})[_0x3f27('0x23')](function(_0x3a54b7){if(_0x3a54b7){_0x3c10d5=_[_0x3f27('0xa3')](_0x3a54b7,'id');var _0x16ceec;var _0x478642=squel[_0x3f27('0x70')]();_0x478642[_0x3f27('0x71')](_0x268a68[_0x3f27('0x81')]);for(var _0x1b705e=0x0;_0x1b705e<_0x4c0fe1[_0x3f27('0x48')];_0x1b705e+=0x1){_0x16ceec=_0x4c0fe1[_0x1b705e][_0x3f27('0x72')]?_0x3c10d5[_0x4c0fe1[_0x1b705e][_0x3f27('0x72')]][_0x3f27('0x73')]:_0x4c0fe1[_0x1b705e][_0x3f27('0x6a')];_0x16ceec=_0x4c0fe1[_0x1b705e][_0x3f27('0x74')]?_[_0x3f27('0x75')](_0x237ba5[_0x4c0fe1[_0x1b705e][_0x3f27('0x74')]],'%s',_0x16ceec):_0x16ceec;_0x16ceec=_0x4c0fe1[_0x1b705e]['format']?_[_0x3f27('0x75')](_0x1c5b8a[_0x4c0fe1[_0x1b705e]['format']],'%s',_0x16ceec):_0x16ceec;if(_0x4c0fe1[_0x1b705e][_0x3f27('0x77')]){_0x478642['group'](_0x16ceec);}_0x4c0fe1[_0x1b705e][_0x3f27('0x78')]&&_0x478642[_0x3f27('0x3b')](_0x16ceec,_0x4c0fe1[_0x1b705e][_0x3f27('0x78')]===_0x3f27('0x79')?![]:!![]);_0x478642[_0x3f27('0x6a')](_0x16ceec,_0x4c0fe1[_0x1b705e][_0x3f27('0x7a')]||_0x16ceec);}if(_0x268a68['joins']){_0x268a68[_0x3f27('0x7b')]=JSON['parse'](_0x268a68['joins']);for(var _0x123e0f=0x0;_0x123e0f<_0x268a68[_0x3f27('0x7b')][_0x3f27('0x48')];_0x123e0f+=0x1){if(_0x268a68[_0x3f27('0x7b')][_0x123e0f]['type']&&_[_0x3f27('0x7d')](_0x1a5553,_0x268a68[_0x3f27('0x7b')][_0x123e0f]['type'])&&_0x268a68[_0x3f27('0x7b')][_0x123e0f]['parentKey']&&_0x268a68[_0x3f27('0x7b')][_0x123e0f][_0x3f27('0x7f')]&&_0x268a68[_0x3f27('0x7b')][_0x123e0f][_0x3f27('0x82')]){_0x478642[_0x268a68[_0x3f27('0x7b')][_0x123e0f]['type']](_0x268a68[_0x3f27('0x7b')][_0x123e0f][_0x3f27('0x7f')],null,util[_0x3f27('0x76')](_0x3f27('0x80'),_0x268a68[_0x3f27('0x81')],_0x268a68[_0x3f27('0x7b')][_0x123e0f][_0x3f27('0x7e')],_0x268a68[_0x3f27('0x7b')][_0x123e0f][_0x3f27('0x7f')],_0x268a68[_0x3f27('0x7b')][_0x123e0f]['foreignKey']));}}}if(_0x268a68['conditions']){_0x268a68[_0x3f27('0x83')]=JSON['parse'](_0x268a68[_0x3f27('0x83')]);_0x478642['where'](_0x2ef4b9(_0x268a68[_0x3f27('0x83')][_0x3f27('0x69')]));}_0x5227e6=_0x478642[_0x3f27('0xa4')]();_0x478642[_0x3f27('0x1e')](_0xabf287);_0x478642[_0x3f27('0x1d')](0x0);logger[_0x3f27('0x84')](_0x3f27('0xa5'),_0x478642['toString']());return db[_0x3f27('0x86')][_0x3f27('0x33')](_0x478642[_0x3f27('0x85')](),{'type':db[_0x3f27('0x86')]['QueryTypes']['SELECT']});}})[_0x3f27('0x23')](function(){return{'sql':_0x5227e6[_0x3f27('0x85')]()};})[_0x3f27('0x23')](respondWithResult(_0x325d16,null))[_0x3f27('0x4b')](handleError(_0x325d16,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index cbb873b..d0eaa0f 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 _0x143d=['path','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x143d,0xed));var _0xd143=function(_0x5b89a0,_0x315a2a){_0x5b89a0=_0x5b89a0-0x0;var _0x44d81a=_0x143d[_0x5b89a0];return _0x44d81a;};'use strict';var _=require(_0xd143('0x0'));var util=require(_0xd143('0x1'));var logger=require(_0xd143('0x2'))(_0xd143('0x3'));var moment=require('moment');var BPromise=require(_0xd143('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd143('0x5'));var rimraf=require('rimraf');var config=require(_0xd143('0x6'));var attributes=require(_0xd143('0x7'));module[_0xd143('0x8')]=function(_0x48928c,_0x405dc7){return _0x48928c['define'](_0xd143('0x9'),attributes,{'tableName':_0xd143('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4161=['analytics_custom_reports','lodash','util','../../config/logger','moment','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x49873f,_0xebd2b8){var _0x518b6d=function(_0x258b41){while(--_0x258b41){_0x49873f['push'](_0x49873f['shift']());}};_0x518b6d(++_0xebd2b8);}(_0x4161,0x11f));var _0x1416=function(_0x2b227c,_0x5327e7){_0x2b227c=_0x2b227c-0x0;var _0x5b817e=_0x4161[_0x2b227c];return _0x5b817e;};'use strict';var _=require(_0x1416('0x0'));var util=require(_0x1416('0x1'));var logger=require(_0x1416('0x2'))('api');var moment=require(_0x1416('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1416('0x4'));var rimraf=require('rimraf');var config=require(_0x1416('0x5'));var attributes=require(_0x1416('0x6'));module[_0x1416('0x7')]=function(_0x3dbc5e,_0x1fb09d){return _0x3dbc5e[_0x1416('0x8')](_0x1416('0x9'),attributes,{'tableName':_0x1416('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 4b6b923..b2ca854 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 _0x427c=['catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xe6bb44,_0x4f6623){var _0x4998db=function(_0x4bc65a){while(--_0x4bc65a){_0xe6bb44['push'](_0xe6bb44['shift']());}};_0x4998db(++_0x4f6623);}(_0x427c,0xa1));var _0xc427=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x427c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xc427('0x0'));var moment=require(_0xc427('0x1'));var BPromise=require(_0xc427('0x2'));var rs=require(_0xc427('0x3'));var fs=require('fs');var Redis=require(_0xc427('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc427('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc427('0x6')][_0xc427('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb1e811,_0x10a0c6,_0xba2eb){return new BPromise(function(_0x45ce67,_0x5dad91){return client[_0xc427('0x8')](_0xb1e811,_0xba2eb)[_0xc427('0x9')](function(_0x5d7d10){logger[_0xc427('0xa')](_0xc427('0xb'),_0x10a0c6,_0xc427('0xc'));logger[_0xc427('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x10a0c6,_0xc427('0xc'),JSON[_0xc427('0xe')](_0x5d7d10));if(_0x5d7d10['error']){if(_0x5d7d10[_0xc427('0xf')][_0xc427('0x10')]===0x1f4){logger[_0xc427('0xf')](_0xc427('0xb'),_0x10a0c6,_0x5d7d10[_0xc427('0xf')]['message']);return _0x5dad91(_0x5d7d10[_0xc427('0xf')][_0xc427('0x11')]);}logger[_0xc427('0xf')](_0xc427('0xb'),_0x10a0c6,_0x5d7d10['error'][_0xc427('0x11')]);return _0x45ce67(_0x5d7d10[_0xc427('0xf')][_0xc427('0x11')]);}else{logger[_0xc427('0xa')](_0xc427('0xb'),_0x10a0c6,_0xc427('0xc'));_0x45ce67(_0x5d7d10[_0xc427('0x12')][_0xc427('0x11')]);}})[_0xc427('0x13')](function(_0x188efa){logger[_0xc427('0xf')](_0xc427('0xb'),_0x10a0c6,_0x188efa);_0x5dad91(_0x188efa);});});} \ No newline at end of file +var _0xfec3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch'];(function(_0x6ff747,_0x15dc6c){var _0x121169=function(_0x444c78){while(--_0x444c78){_0x6ff747['push'](_0x6ff747['shift']());}};_0x121169(++_0x15dc6c);}(_0xfec3,0x1c8));var _0x3fec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfec3[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3fec('0x0'));var util=require(_0x3fec('0x1'));var moment=require(_0x3fec('0x2'));var BPromise=require(_0x3fec('0x3'));var rs=require(_0x3fec('0x4'));var fs=require('fs');var Redis=require(_0x3fec('0x5'));var db=require(_0x3fec('0x6'))['db'];var utils=require(_0x3fec('0x7'));var logger=require(_0x3fec('0x8'))(_0x3fec('0x9'));var config=require(_0x3fec('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3fec('0xb')][_0x3fec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x199c1a,_0x4ea44b,_0x2aff6b){return new BPromise(function(_0x342b23,_0x1fbcf0){return client['request'](_0x199c1a,_0x2aff6b)[_0x3fec('0xd')](function(_0x1f6060){logger[_0x3fec('0xe')](_0x3fec('0xf'),_0x4ea44b,'request\x20sent');logger[_0x3fec('0x10')](_0x3fec('0x11'),_0x4ea44b,'request\x20sent',JSON['stringify'](_0x1f6060));if(_0x1f6060[_0x3fec('0x12')]){if(_0x1f6060[_0x3fec('0x12')][_0x3fec('0x13')]===0x1f4){logger[_0x3fec('0x12')](_0x3fec('0xf'),_0x4ea44b,_0x1f6060[_0x3fec('0x12')][_0x3fec('0x14')]);return _0x1fbcf0(_0x1f6060['error'][_0x3fec('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4ea44b,_0x1f6060[_0x3fec('0x12')][_0x3fec('0x14')]);return _0x342b23(_0x1f6060[_0x3fec('0x12')]['message']);}else{logger[_0x3fec('0xe')](_0x3fec('0xf'),_0x4ea44b,_0x3fec('0x15'));_0x342b23(_0x1f6060[_0x3fec('0x16')]['message']);}})[_0x3fec('0x17')](function(_0x1fb71e){logger['error'](_0x3fec('0xf'),_0x4ea44b,_0x1fb71e);_0x1fbcf0(_0x1fb71e);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d9243ec..9969b4d 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 _0x0113=['get','isAuthenticated','index','/:id','show','/:id/preview','run','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x5f5d66,_0x4601d7){var _0x5aac65=function(_0x9c44fc){while(--_0x9c44fc){_0x5f5d66['push'](_0x5f5d66['shift']());}};_0x5aac65(++_0x4601d7);}(_0x0113,0x150));var _0x3011=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0113[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3011('0x0'));var util=require(_0x3011('0x1'));var path=require(_0x3011('0x2'));var timeout=require(_0x3011('0x3'));var express=require(_0x3011('0x4'));var router=express[_0x3011('0x5')]();var auth=require(_0x3011('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3011('0x7'));var controller=require(_0x3011('0x8'));router[_0x3011('0x9')]('/',auth[_0x3011('0xa')](),controller[_0x3011('0xb')]);router['get'](_0x3011('0xc'),auth[_0x3011('0xa')](),controller[_0x3011('0xd')]);router[_0x3011('0x9')](_0x3011('0xe'),auth[_0x3011('0xa')](),controller['preview']);router[_0x3011('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0x3011('0xf')]);router[_0x3011('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x3011('0x10')]);router['post']('/',auth[_0x3011('0xa')](),controller[_0x3011('0x11')]);router[_0x3011('0x12')]('/:id',auth[_0x3011('0xa')](),controller[_0x3011('0x13')]);router[_0x3011('0x14')](_0x3011('0xc'),auth[_0x3011('0xa')](),controller[_0x3011('0x15')]);module[_0x3011('0x16')]=router; \ No newline at end of file +var _0xdcd2=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update'];(function(_0x16c66c,_0x3dc8ed){var _0x53296c=function(_0x27a9c3){while(--_0x27a9c3){_0x16c66c['push'](_0x16c66c['shift']());}};_0x53296c(++_0x3dc8ed);}(_0xdcd2,0x74));var _0x2dcd=function(_0x3f5dce,_0x230dce){_0x3f5dce=_0x3f5dce-0x0;var _0x595545=_0xdcd2[_0x3f5dce];return _0x595545;};'use strict';var multer=require(_0x2dcd('0x0'));var util=require(_0x2dcd('0x1'));var path=require(_0x2dcd('0x2'));var timeout=require(_0x2dcd('0x3'));var express=require(_0x2dcd('0x4'));var router=express[_0x2dcd('0x5')]();var auth=require(_0x2dcd('0x6'));var interaction=require(_0x2dcd('0x7'));var config=require(_0x2dcd('0x8'));var controller=require(_0x2dcd('0x9'));router[_0x2dcd('0xa')]('/',auth[_0x2dcd('0xb')](),controller[_0x2dcd('0xc')]);router[_0x2dcd('0xa')]('/:id',auth[_0x2dcd('0xb')](),controller[_0x2dcd('0xd')]);router[_0x2dcd('0xa')](_0x2dcd('0xe'),auth['isAuthenticated'](),controller[_0x2dcd('0xf')]);router[_0x2dcd('0xa')](_0x2dcd('0x10'),auth['isAuthenticated'](),controller[_0x2dcd('0x11')]);router[_0x2dcd('0xa')](_0x2dcd('0x12'),auth['isAuthenticated'](),controller[_0x2dcd('0x13')]);router[_0x2dcd('0x14')]('/',auth['isAuthenticated'](),controller[_0x2dcd('0x15')]);router[_0x2dcd('0x16')]('/:id',auth[_0x2dcd('0xb')](),controller[_0x2dcd('0x17')]);router[_0x2dcd('0x18')](_0x2dcd('0x19'),auth[_0x2dcd('0xb')](),controller[_0x2dcd('0x1a')]);module[_0x2dcd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c68bb27..10915e9 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 _0xeb70=['exports','STRING','TEXT','sequelize'];(function(_0x4ce9e3,_0xada7ff){var _0x5e8aa3=function(_0x365a11){while(--_0x365a11){_0x4ce9e3['push'](_0x4ce9e3['shift']());}};_0x5e8aa3(++_0xada7ff);}(_0xeb70,0x1c3));var _0x0eb7=function(_0x2f06a2,_0x22c8af){_0x2f06a2=_0x2f06a2-0x0;var _0x584af3=_0xeb70[_0x2f06a2];return _0x584af3;};'use strict';var Sequelize=require(_0x0eb7('0x0'));module[_0x0eb7('0x1')]={'name':{'type':Sequelize[_0x0eb7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0eb7('0x2')]},'parent':{'type':Sequelize[_0x0eb7('0x2')]},'table':{'type':Sequelize[_0x0eb7('0x2')]},'conditions':{'type':Sequelize[_0x0eb7('0x3')]},'joins':{'type':Sequelize[_0x0eb7('0x3')]}}; \ No newline at end of file +var _0xbb3f=['TEXT','STRING'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0xbb3f,0x1c1));var _0xfbb3=function(_0x282a1c,_0x2c705f){_0x282a1c=_0x282a1c-0x0;var _0x5f1cda=_0xbb3f[_0x282a1c];return _0x5f1cda;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfbb3('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xfbb3('0x0')]},'table':{'type':Sequelize[_0xfbb3('0x0')]},'conditions':{'type':Sequelize[_0xfbb3('0x1')]},'joins':{'type':Sequelize[_0xfbb3('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index ac7d418..99a5068 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 _0xc809=['fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','DefaultReports','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','field','function','replace','format','order','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','groupBy','orderBy','No\x20available\x20data','web','%s-%s.%s','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','DESC','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','AnalyticDefaultReport'];(function(_0x5078b3,_0x110a1f){var _0x19067d=function(_0x2b624f){while(--_0x2b624f){_0x5078b3['push'](_0x5078b3['shift']());}};_0x19067d(++_0x110a1f);}(_0xc809,0x1b8));var _0x9c80=function(_0x199ed7,_0x3e6b61){_0x199ed7=_0x199ed7-0x0;var _0x71902=_0xc809[_0x199ed7];return _0x71902;};'use strict';var pdf=require(_0x9c80('0x0'));var emlformat=require(_0x9c80('0x1'));var rimraf=require(_0x9c80('0x2'));var zipdir=require(_0x9c80('0x3'));var jsonpatch=require(_0x9c80('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c80('0x5'));var Mustache=require(_0x9c80('0x6'));var util=require(_0x9c80('0x7'));var path=require(_0x9c80('0x8'));var sox=require(_0x9c80('0x9'));var csv=require(_0x9c80('0xa'));var ejs=require(_0x9c80('0xb'));var fs=require('fs');var _=require(_0x9c80('0xc'));var squel=require('squel');var crypto=require(_0x9c80('0xd'));var jsforce=require(_0x9c80('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c80('0xa'));var querystring=require('querystring');var Papa=require(_0x9c80('0xf'));var Redis=require(_0x9c80('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9c80('0x11'));var as=require(_0x9c80('0x12'));var hardwareService=require(_0x9c80('0x13'));var logger=require(_0x9c80('0x14'))('api');var utils=require(_0x9c80('0x15'));var config=require(_0x9c80('0x16'));var db=require(_0x9c80('0x17'))['db'];function respondWithStatusCode(_0x441e51,_0x4ac5c6){_0x4ac5c6=_0x4ac5c6||0xcc;return function(_0x4c5535){if(_0x4c5535){return _0x441e51[_0x9c80('0x18')](_0x4ac5c6);}return _0x441e51[_0x9c80('0x19')](_0x4ac5c6)[_0x9c80('0x1a')]();};}function respondWithResult(_0x4832d7,_0x1d671d){_0x1d671d=_0x1d671d||0xc8;return function(_0x415bfc){if(_0x415bfc){return _0x4832d7[_0x9c80('0x19')](_0x1d671d)['json'](_0x415bfc);}};}function respondWithFilteredResult(_0x190316,_0x37bf4b){return function(_0x4b1e96){if(_0x4b1e96){var _0xb9463=_0x4b1e96[_0x9c80('0x1b')],_0xb844df=_0x37bf4b[_0x9c80('0x1c')],_0x1095bf=_0x37bf4b[_0x9c80('0x1c')]+_0x37bf4b[_0x9c80('0x1d')],_0x4e97af;if(_0x1095bf>=_0xb9463){_0x1095bf=_0xb9463;_0x4e97af=0xc8;}else{_0x4e97af=0xce;}_0x190316[_0x9c80('0x19')](_0x4e97af);return _0x190316[_0x9c80('0x1e')]('Content-Range',_0xb844df+'-'+_0x1095bf+'/'+_0xb9463)[_0x9c80('0x1f')](_0x4b1e96);}return null;};}function patchUpdates(_0x2de79e){return function(_0x2af91a){try{jsonpatch['apply'](_0x2af91a,_0x2de79e,!![]);}catch(_0x4f9392){return BPromise['reject'](_0x4f9392);}return _0x2af91a[_0x9c80('0x20')]();};}function saveUpdates(_0x389ae8,_0x343e3f){return function(_0x34564f){if(_0x34564f){return _0x34564f[_0x9c80('0x21')](_0x389ae8)[_0x9c80('0x22')](function(_0x4b73a4){return _0x4b73a4;});}return null;};}function removeEntity(_0x411aa5,_0x48fdf1){return function(_0x496c7e){if(_0x496c7e){return _0x496c7e[_0x9c80('0x23')]()['then'](function(){var _0x1b7a7e=_0x496c7e[_0x9c80('0x24')]({'plain':!![]});var _0x73df74='DefaultReports';return db[_0x9c80('0x25')][_0x9c80('0x23')]({'where':{'type':_0x73df74,'resourceId':_0x1b7a7e['id']}})['then'](function(){return _0x496c7e;});})[_0x9c80('0x22')](function(){_0x411aa5[_0x9c80('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a9b0a,_0x4c31c2){return function(_0x414099){if(!_0x414099){_0x3a9b0a[_0x9c80('0x18')](0x194);}return _0x414099;};}function handleError(_0x59919f,_0xaaf14){_0xaaf14=_0xaaf14||0x1f4;return function(_0x5b1a84){logger[_0x9c80('0x26')](_0x5b1a84[_0x9c80('0x27')]);if(_0x5b1a84[_0x9c80('0x28')]){delete _0x5b1a84[_0x9c80('0x28')];}_0x59919f[_0x9c80('0x19')](_0xaaf14)['send'](_0x5b1a84);};}exports['index']=function(_0x27bf8c,_0x52076a){var _0x1e8f07={},_0x31b41={},_0x3bf4d6={'count':0x0,'rows':[]};var _0x54013a=_[_0x9c80('0x29')](db[_0x9c80('0x2a')]['rawAttributes'],function(_0x282c8c){return{'name':_0x282c8c[_0x9c80('0x2b')],'type':_0x282c8c[_0x9c80('0x2c')]['key']};});_0x31b41[_0x9c80('0x2d')]=_[_0x9c80('0x29')](_0x54013a,'name');_0x31b41[_0x9c80('0x2e')]=_[_0x9c80('0x2f')](_0x27bf8c['query']);_0x31b41['filters']=_[_0x9c80('0x30')](_0x31b41[_0x9c80('0x2d')],_0x31b41[_0x9c80('0x2e')]);_0x1e8f07[_0x9c80('0x31')]=_[_0x9c80('0x30')](_0x31b41['model'],qs[_0x9c80('0x32')](_0x27bf8c['query'][_0x9c80('0x32')]));_0x1e8f07[_0x9c80('0x31')]=_0x1e8f07[_0x9c80('0x31')][_0x9c80('0x33')]?_0x1e8f07[_0x9c80('0x31')]:_0x31b41[_0x9c80('0x2d')];if(!_0x27bf8c[_0x9c80('0x2e')][_0x9c80('0x34')]('nolimit')){_0x1e8f07[_0x9c80('0x1d')]=qs[_0x9c80('0x1d')](_0x27bf8c[_0x9c80('0x2e')][_0x9c80('0x1d')]);_0x1e8f07['offset']=qs[_0x9c80('0x1c')](_0x27bf8c[_0x9c80('0x2e')][_0x9c80('0x1c')]);}_0x1e8f07['order']=qs['sort'](_0x27bf8c[_0x9c80('0x2e')][_0x9c80('0x35')]);_0x1e8f07[_0x9c80('0x36')]=qs['filters'](_[_0x9c80('0x37')](_0x27bf8c[_0x9c80('0x2e')],_0x31b41['filters']));if(_0x27bf8c[_0x9c80('0x2e')]['filter']){_0x1e8f07['where']=_['merge'](_0x1e8f07[_0x9c80('0x36')],{'$or':_['map'](_0x54013a,function(_0x4ae0a7){if(_0x4ae0a7[_0x9c80('0x2c')]!==_0x9c80('0x38')){var _0x5ef0dd={};_0x5ef0dd[_0x4ae0a7[_0x9c80('0x28')]]={'$like':'%'+_0x27bf8c[_0x9c80('0x2e')]['filter']+'%'};return _0x5ef0dd;}})});}_0x1e8f07=_[_0x9c80('0x39')]({},_0x1e8f07,_0x27bf8c['options']);var _0x3e80f7={'where':_0x1e8f07[_0x9c80('0x36')]};return db[_0x9c80('0x2a')][_0x9c80('0x1b')](_0x3e80f7)[_0x9c80('0x22')](function(_0x132ec8){_0x3bf4d6['count']=_0x132ec8;if(_0x27bf8c[_0x9c80('0x2e')]['includeAll']){_0x1e8f07[_0x9c80('0x3a')]=[{'all':!![]}];}return db[_0x9c80('0x2a')][_0x9c80('0x3b')](_0x1e8f07);})['then'](function(_0x38a991){_0x3bf4d6[_0x9c80('0x3c')]=_0x38a991;return _0x3bf4d6;})[_0x9c80('0x22')](respondWithFilteredResult(_0x52076a,_0x1e8f07))[_0x9c80('0x3d')](handleError(_0x52076a,null));};exports[_0x9c80('0x3e')]=function(_0x1f6004,_0x49d4b9){var _0x1ede57={'raw':!![],'where':{'id':_0x1f6004[_0x9c80('0x3f')]['id']}},_0x3ec52b={};_0x3ec52b[_0x9c80('0x2d')]=_[_0x9c80('0x2f')](db[_0x9c80('0x2a')][_0x9c80('0x40')]);_0x3ec52b[_0x9c80('0x2e')]=_['keys'](_0x1f6004['query']);_0x3ec52b['filters']=_[_0x9c80('0x30')](_0x3ec52b['model'],_0x3ec52b['query']);_0x1ede57[_0x9c80('0x31')]=_[_0x9c80('0x30')](_0x3ec52b['model'],qs[_0x9c80('0x32')](_0x1f6004['query']['fields']));_0x1ede57[_0x9c80('0x31')]=_0x1ede57[_0x9c80('0x31')][_0x9c80('0x33')]?_0x1ede57['attributes']:_0x3ec52b[_0x9c80('0x2d')];if(_0x1f6004[_0x9c80('0x2e')][_0x9c80('0x41')]){_0x1ede57[_0x9c80('0x3a')]=[{'all':!![]}];}_0x1ede57=_[_0x9c80('0x39')]({},_0x1ede57,_0x1f6004[_0x9c80('0x42')]);return db[_0x9c80('0x2a')][_0x9c80('0x43')](_0x1ede57)[_0x9c80('0x22')](handleEntityNotFound(_0x49d4b9,null))[_0x9c80('0x22')](respondWithResult(_0x49d4b9,null))[_0x9c80('0x3d')](handleError(_0x49d4b9,null));};exports[_0x9c80('0x44')]=function(_0x32311e,_0x1aa48c){return db[_0x9c80('0x2a')][_0x9c80('0x44')](_0x32311e[_0x9c80('0x45')],{})['then'](function(_0x517849){var _0x465c41=_0x32311e['user'][_0x9c80('0x24')]({'plain':!![]});if(!_0x465c41)throw new Error(_0x9c80('0x46'));if(_0x465c41[_0x9c80('0x47')]===_0x9c80('0x48')){var _0x122625=_0x517849[_0x9c80('0x24')]({'plain':!![]});var _0x26a693='Reports';return db[_0x9c80('0x49')][_0x9c80('0x43')]({'where':{'name':_0x26a693,'userProfileId':_0x465c41[_0x9c80('0x4a')]},'raw':!![]})[_0x9c80('0x22')](function(_0x45c937){if(_0x45c937&&_0x45c937[_0x9c80('0x4b')]===0x0){return db[_0x9c80('0x25')][_0x9c80('0x44')]({'name':_0x122625['name'],'resourceId':_0x122625['id'],'type':_0x9c80('0x4c'),'sectionId':_0x45c937['id']},{})['then'](function(){return _0x517849;});}else{return _0x517849;}})['catch'](function(_0x7125b1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7125b1);throw _0x7125b1;});}return _0x517849;})[_0x9c80('0x22')](respondWithResult(_0x1aa48c,0xc9))[_0x9c80('0x3d')](handleError(_0x1aa48c,null));};exports[_0x9c80('0x21')]=function(_0x53349c,_0x2e9181){if(_0x53349c[_0x9c80('0x45')]['id']){delete _0x53349c['body']['id'];}return db['AnalyticDefaultReport'][_0x9c80('0x43')]({'where':{'id':_0x53349c['params']['id']}})[_0x9c80('0x22')](handleEntityNotFound(_0x2e9181,null))[_0x9c80('0x22')](saveUpdates(_0x53349c[_0x9c80('0x45')],null))[_0x9c80('0x22')](respondWithResult(_0x2e9181,null))[_0x9c80('0x3d')](handleError(_0x2e9181,null));};exports[_0x9c80('0x23')]=function(_0x152997,_0x3b8504){return db['AnalyticDefaultReport'][_0x9c80('0x43')]({'where':{'id':_0x152997['params']['id']}})[_0x9c80('0x22')](handleEntityNotFound(_0x3b8504,null))[_0x9c80('0x22')](removeEntity(_0x3b8504,null))['catch'](handleError(_0x3b8504,null));};exports[_0x9c80('0x4d')]=function(_0x560dcd,_0x45dfb0){var _0x29961c=0xa;var _0x57d2c8=[_0x9c80('0x4e'),_0x9c80('0x4f'),_0x9c80('0x50'),_0x9c80('0x51')];var _0x575b14={'SUM':_0x9c80('0x52'),'COUNT':_0x9c80('0x53'),'COUNT DISTINCT':_0x9c80('0x54'),'MAX':_0x9c80('0x55'),'MIN':_0x9c80('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9c80('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9c80('0x58')};var _0x3faef3={'SEC_TO_TIME':_0x9c80('0x59'),'DATE':_0x9c80('0x5a'),'HOUR':_0x9c80('0x5b'),'ROUND':_0x9c80('0x5c'),'UNIX_TIMESTAMP':_0x9c80('0x5d')};var _0x514c43=function(_0x5a4c9c){return!_[_0x9c80('0x5e')]([_0x9c80('0x5f'),_0x9c80('0x60'),_0x9c80('0x61'),_0x9c80('0x62')],_0x5a4c9c);};var _0x44d5ba=function(_0x3c1c53){if(!_0x3c1c53||!_0x3c1c53[_0x9c80('0x63')][_0x9c80('0x33')]){return'';}for(var _0x12fd22='(',_0x5292fb=0x0;_0x5292fb<_0x3c1c53[_0x9c80('0x63')][_0x9c80('0x33')];_0x5292fb+=0x1){_0x5292fb>0x0&&(_0x12fd22+='\x20'+_0x3c1c53[_0x9c80('0x64')]+'\x20');_0x12fd22+=_0x3c1c53[_0x9c80('0x63')][_0x5292fb]['group']?_0x44d5ba(_0x3c1c53['rules'][_0x5292fb][_0x9c80('0x65')]):_0x3c1c53[_0x9c80('0x63')][_0x5292fb]['field']+'\x20'+_0x3c1c53[_0x9c80('0x63')][_0x5292fb]['condition']+(_0x514c43(_0x3c1c53['rules'][_0x5292fb][_0x9c80('0x66')])?'\x20'+_0x3c1c53[_0x9c80('0x63')][_0x5292fb][_0x9c80('0x67')]:'');}return _0x12fd22+')';};var _0x2a3126={'where':{'id':_0x560dcd[_0x9c80('0x3f')]['id']}},_0x4534d8,_0x474d4d,_0x4afdba,_0x452ce1,_0x30dc61;_0x2a3126=_[_0x9c80('0x39')]({},_0x2a3126,_0x560dcd[_0x9c80('0x42')]);return db[_0x9c80('0x2a')][_0x9c80('0x43')](_0x2a3126)['then'](function(_0x81c364){if(_0x81c364){_0x4534d8=_0x81c364;return _0x81c364[_0x9c80('0x68')]();}return null;})[_0x9c80('0x22')](function(_0x79d8ed){if(_0x79d8ed){if(!_0x79d8ed[_0x9c80('0x33')]){throw new db[(_0x9c80('0x69'))][(_0x9c80('0x6a'))](_0x9c80('0x6b'),0x193);}_0x474d4d=_0x79d8ed;return db[_0x9c80('0x6c')][_0x9c80('0x3b')]({'raw':!![]});}return null;})[_0x9c80('0x22')](function(_0x133570){if(_0x133570){_0x4afdba=_[_0x9c80('0x6d')](_0x133570,'id');var _0x3ba9c6;var _0x2e4a5c=squel[_0x9c80('0x6e')]();_0x2e4a5c[_0x9c80('0x6f')](_0x4534d8['table']);for(var _0xcbc0aa=0x0;_0xcbc0aa<_0x474d4d[_0x9c80('0x33')];_0xcbc0aa+=0x1){_0x3ba9c6=_0x474d4d[_0xcbc0aa][_0x9c80('0x70')]?_0x4afdba[_0x474d4d[_0xcbc0aa]['MetricId']][_0x9c80('0x71')]:_0x474d4d[_0xcbc0aa][_0x9c80('0x72')];_0x3ba9c6=_0x474d4d[_0xcbc0aa][_0x9c80('0x73')]?_[_0x9c80('0x74')](_0x575b14[_0x474d4d[_0xcbc0aa][_0x9c80('0x73')]],'%s',_0x3ba9c6):_0x3ba9c6;_0x3ba9c6=_0x474d4d[_0xcbc0aa][_0x9c80('0x75')]?_[_0x9c80('0x74')](_0x3faef3[_0x474d4d[_0xcbc0aa][_0x9c80('0x75')]],'%s',_0x3ba9c6):_0x3ba9c6;if(_0x474d4d[_0xcbc0aa]['groupBy']){_0x2e4a5c[_0x9c80('0x65')](_0x3ba9c6);}_0x474d4d[_0xcbc0aa]['orderBy']&&_0x2e4a5c[_0x9c80('0x76')](_0x3ba9c6,_0x474d4d[_0xcbc0aa]['orderBy']==='DESC'?![]:!![]);_0x2e4a5c[_0x9c80('0x72')](_0x3ba9c6,_0x474d4d[_0xcbc0aa][_0x9c80('0x77')]||_0x3ba9c6);}if(_0x4534d8[_0x9c80('0x78')]){_0x4534d8[_0x9c80('0x78')]=JSON['parse'](_0x4534d8[_0x9c80('0x78')]);for(var _0x381454=0x0;_0x381454<_0x4534d8[_0x9c80('0x78')][_0x9c80('0x33')];_0x381454+=0x1){if(_0x4534d8[_0x9c80('0x78')][_0x381454]['type']&&_[_0x9c80('0x5e')](_0x57d2c8,_0x4534d8[_0x9c80('0x78')][_0x381454][_0x9c80('0x2c')])&&_0x4534d8[_0x9c80('0x78')][_0x381454][_0x9c80('0x79')]&&_0x4534d8[_0x9c80('0x78')][_0x381454][_0x9c80('0x7a')]&&_0x4534d8[_0x9c80('0x78')][_0x381454][_0x9c80('0x7b')]){_0x2e4a5c[_0x4534d8['joins'][_0x381454]['type']](_0x4534d8['joins'][_0x381454][_0x9c80('0x7a')],null,util['format'](_0x9c80('0x7c'),_0x4534d8[_0x9c80('0x7d')],_0x4534d8['joins'][_0x381454]['parentKey'],_0x4534d8[_0x9c80('0x78')][_0x381454][_0x9c80('0x7a')],_0x4534d8['joins'][_0x381454][_0x9c80('0x7b')]));}}}if(_0x4534d8[_0x9c80('0x7e')]){_0x4534d8[_0x9c80('0x7e')]=JSON[_0x9c80('0x7f')](_0x4534d8['conditions']);_0x2e4a5c['where'](_0x44d5ba(_0x4534d8[_0x9c80('0x7e')]['group']));}_0x30dc61=_0x2e4a5c[_0x9c80('0x80')]();_0x2e4a5c[_0x9c80('0x1d')](_0x29961c);_0x2e4a5c['offset'](0x0);logger[_0x9c80('0x81')](_0x9c80('0x82'),_0x2e4a5c[_0x9c80('0x83')]());return db[_0x9c80('0x84')][_0x9c80('0x2e')](_0x2e4a5c[_0x9c80('0x83')](),{'type':db[_0x9c80('0x84')][_0x9c80('0x85')][_0x9c80('0x86')]});}})[_0x9c80('0x22')](respondWithResult(_0x45dfb0,null))['catch'](handleError(_0x45dfb0,null));};function runReport(_0x28b4ab,_0x21d7c4,_0x50b34c){var _0x3c1b37=_0x21d7c4[_0x9c80('0x28')];var _0x430bf4=0xa;var _0x1ad373=[_0x9c80('0x4e'),_0x9c80('0x4f'),'right_join',_0x9c80('0x51')];var _0x38d470={'SUM':_0x9c80('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9c80('0x55'),'MIN':_0x9c80('0x56'),'AVG':_0x9c80('0x87'),'GROUP_CONCAT':_0x9c80('0x57'),'GROUP_CONCAT ASC':_0x9c80('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x371dac={'SEC_TO_TIME':_0x9c80('0x59'),'DATE':_0x9c80('0x5a'),'HOUR':_0x9c80('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x297dfa=function(_0x5a8533){return!_['includes']([_0x9c80('0x5f'),_0x9c80('0x60'),_0x9c80('0x61'),_0x9c80('0x62')],_0x5a8533);};var _0x48b9dd=function(_0x16e071){if(!_0x16e071||!_0x16e071[_0x9c80('0x63')]['length']){return'';}for(var _0x30e9e0='(',_0xb7ebaf=0x0;_0xb7ebaf<_0x16e071['rules'][_0x9c80('0x33')];_0xb7ebaf+=0x1){_0xb7ebaf>0x0&&(_0x30e9e0+='\x20'+_0x16e071[_0x9c80('0x64')]+'\x20');_0x30e9e0+=_0x16e071['rules'][_0xb7ebaf][_0x9c80('0x65')]?_0x48b9dd(_0x16e071[_0x9c80('0x63')][_0xb7ebaf][_0x9c80('0x65')]):_0x16e071[_0x9c80('0x63')][_0xb7ebaf][_0x9c80('0x72')]+'\x20'+_0x16e071['rules'][_0xb7ebaf][_0x9c80('0x66')]+(_0x297dfa(_0x16e071[_0x9c80('0x63')][_0xb7ebaf][_0x9c80('0x66')])?'\x20'+_0x16e071[_0x9c80('0x63')][_0xb7ebaf]['value']:'');}return _0x30e9e0+')';};var _0x440603={'where':{'id':_0x28b4ab['id']}},_0x119109,_0x1f260c,_0x4ec26e,_0x11ae46,_0x1eba4d;_0x440603=_[_0x9c80('0x39')]({},_0x440603,_0x50b34c);return db[_0x9c80('0x2a')][_0x9c80('0x43')](_0x440603)['then'](function(_0x270331){if(_0x270331){_0x119109=_0x270331;return _0x270331[_0x9c80('0x68')]();}return null;})['then'](function(_0x427ab4){if(_0x427ab4){if(!_0x427ab4['length']){throw new db[(_0x9c80('0x69'))][(_0x9c80('0x6a'))](_0x9c80('0x6b'),0x193);}_0x1f260c=_0x427ab4;return db[_0x9c80('0x6c')][_0x9c80('0x3b')]({'raw':!![]});}return null;})['then'](function(_0x2e2a95){if(_0x2e2a95){_0x4ec26e=_[_0x9c80('0x6d')](_0x2e2a95,'id');var _0x22b42d;var _0x1beaf1=squel[_0x9c80('0x6e')]();_0x1beaf1[_0x9c80('0x6f')](_0x119109[_0x9c80('0x7d')]);for(var _0x23134d=0x0;_0x23134d<_0x1f260c[_0x9c80('0x33')];_0x23134d+=0x1){_0x22b42d=_0x1f260c[_0x23134d]['MetricId']?_0x4ec26e[_0x1f260c[_0x23134d][_0x9c80('0x70')]][_0x9c80('0x71')]:_0x1f260c[_0x23134d][_0x9c80('0x72')];_0x22b42d=_0x1f260c[_0x23134d][_0x9c80('0x73')]?_[_0x9c80('0x74')](_0x38d470[_0x1f260c[_0x23134d][_0x9c80('0x73')]],'%s',_0x22b42d):_0x22b42d;_0x22b42d=_0x1f260c[_0x23134d][_0x9c80('0x75')]?_[_0x9c80('0x74')](_0x371dac[_0x1f260c[_0x23134d][_0x9c80('0x75')]],'%s',_0x22b42d):_0x22b42d;if(_0x1f260c[_0x23134d][_0x9c80('0x89')]){_0x1beaf1['group'](_0x22b42d);}_0x1f260c[_0x23134d][_0x9c80('0x8a')]&&_0x1beaf1['order'](_0x22b42d,_0x1f260c[_0x23134d][_0x9c80('0x8a')]==='DESC'?![]:!![]);_0x1beaf1[_0x9c80('0x72')](_0x22b42d,_0x1f260c[_0x23134d]['alias']||_0x22b42d);}if(_0x119109[_0x9c80('0x78')]){_0x119109[_0x9c80('0x78')]=JSON['parse'](_0x119109['joins']);for(var _0x56626a=0x0;_0x56626a<_0x119109[_0x9c80('0x78')][_0x9c80('0x33')];_0x56626a+=0x1){if(_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x2c')]&&_[_0x9c80('0x5e')](_0x1ad373,_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x2c')])&&_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x79')]&&_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x7a')]&&_0x119109['joins'][_0x56626a]['foreignKey']){_0x1beaf1[_0x119109['joins'][_0x56626a][_0x9c80('0x2c')]](_0x119109['joins'][_0x56626a][_0x9c80('0x7a')],null,util[_0x9c80('0x75')](_0x9c80('0x7c'),_0x119109[_0x9c80('0x7d')],_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x79')],_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x7a')],_0x119109[_0x9c80('0x78')][_0x56626a][_0x9c80('0x7b')]));}}}if(_0x119109['conditions']){_0x119109['conditions']=JSON[_0x9c80('0x7f')](_0x119109[_0x9c80('0x7e')]);_0x1beaf1['where'](_0x48b9dd(_0x119109[_0x9c80('0x7e')][_0x9c80('0x65')]));}_0x1eba4d=_0x1beaf1[_0x9c80('0x80')]();_0x1beaf1[_0x9c80('0x1d')](_0x430bf4);_0x1beaf1[_0x9c80('0x1c')](0x0);logger[_0x9c80('0x81')](_0x9c80('0x82'),_0x1beaf1[_0x9c80('0x83')]());return db[_0x9c80('0x84')][_0x9c80('0x2e')](_0x1beaf1[_0x9c80('0x83')](),{'type':db[_0x9c80('0x84')]['QueryTypes']['SELECT']});}})[_0x9c80('0x22')](function(_0x311740){if(!_0x311740[_0x9c80('0x33')]){throw new db[(_0x9c80('0x69'))][(_0x9c80('0x6a'))](_0x9c80('0x8b'),0xcc);}if(_0x21d7c4['output']===_0x9c80('0x8c')){return null;}var _0x533ec1=_['merge'](_0x21d7c4,{'name':_0x21d7c4['fullPath']||_0x21d7c4[_0x9c80('0x28')]||_0x119109['name'],'basename':_0x3c1b37,'savename':util['format'](_0x9c80('0x8d'),_0x21d7c4[_0x9c80('0x28')]||_0x119109[_0x9c80('0x28')],require(_0x9c80('0x8e'))[_0x9c80('0x8f')](0x4),_0x21d7c4[_0x9c80('0x90')]||'csv'),'reportId':_0x119109['id'],'reportType':_0x9c80('0x91')});return db['AnalyticExtractedReport'][_0x9c80('0x44')](_0x533ec1,{'raw':!![]});})[_0x9c80('0x22')](function(_0x2cc4d3){if(_0x119109['table']===_0x9c80('0x92')){_0x1eba4d[_0x9c80('0x36')](_0x119109[_0x9c80('0x7d')]+_0x9c80('0x93'),_0x21d7c4[_0x9c80('0x94')],_0x21d7c4[_0x9c80('0x95')]);}else{_0x1eba4d[_0x9c80('0x36')](_0x119109['table']+_0x9c80('0x96'),_0x21d7c4[_0x9c80('0x94')],_0x21d7c4['endDate']);}if(_0x2cc4d3){logger['info'](_0x9c80('0x97'),_0x1eba4d[_0x9c80('0x83')]());require(_0x9c80('0x98'))[_0x9c80('0x99')](path[_0x9c80('0x4e')](__dirname,_0x9c80('0x9a'),_0x2cc4d3[_0x9c80('0x90')]),[_0x2cc4d3['id'],_0x1eba4d[_0x9c80('0x83')](),path[_0x9c80('0x4e')](__dirname,_0x9c80('0x9b'),_0x2cc4d3[_0x9c80('0x9c')]),_0x3c1b37]);return _0x2cc4d3;}else{var _0x42829e=squel[_0x9c80('0x6e')]();_0x42829e[_0x9c80('0x6f')]('('+_0x1eba4d[_0x9c80('0x83')]()+')','countTable');_0x42829e[_0x9c80('0x72')](_0x9c80('0x9d'),_0x9c80('0x1b'));_0x1eba4d[_0x9c80('0x1d')](_0x21d7c4[_0x9c80('0x1d')]||_0x430bf4);_0x1eba4d[_0x9c80('0x1c')](_0x21d7c4[_0x9c80('0x1c')]||0x0);return db[_0x9c80('0x84')]['query'](_0x42829e[_0x9c80('0x83')](),{'type':db[_0x9c80('0x84')][_0x9c80('0x85')][_0x9c80('0x86')]})[_0x9c80('0x22')](function(_0x40b2d5){if(!_0x40b2d5[_0x9c80('0x33')]){_0x11ae46=0x0;}else{_0x11ae46=_0x40b2d5[0x0][_0x9c80('0x1b')]||0x0;}return db[_0x9c80('0x84')][_0x9c80('0x2e')](_0x1eba4d[_0x9c80('0x83')](),{'type':db[_0x9c80('0x84')]['QueryTypes']['SELECT']});})[_0x9c80('0x22')](function(_0x5a9703){return{'rows':_0x5a9703||[],'count':_0x11ae46};});}});}exports[_0x9c80('0x9e')]=function(_0x302167,_0x4fbad8){return runReport(_0x302167['params'],_0x302167[_0x9c80('0x2e')],_0x302167[_0x9c80('0x42')])[_0x9c80('0x22')](respondWithResult(_0x4fbad8,null))[_0x9c80('0x3d')](handleError(_0x4fbad8,null));};exports[_0x9c80('0x9f')]=runReport;exports[_0x9c80('0x2e')]=function(_0x33965c,_0x483872){var _0x1429bc=0xa;var _0x3c8499=['join',_0x9c80('0x4f'),'right_join','cross_join'];var _0x4976f8={'SUM':_0x9c80('0x52'),'COUNT':_0x9c80('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9c80('0x55'),'MIN':_0x9c80('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9c80('0x58')};var _0x1ebdf3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9c80('0x5a'),'HOUR':_0x9c80('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9c80('0x5d')};var _0x4f47ae=function(_0x590aa0){return!_[_0x9c80('0x5e')]([_0x9c80('0x5f'),_0x9c80('0x60'),_0x9c80('0x61'),_0x9c80('0x62')],_0x590aa0);};var _0x2adf1f=function(_0x3f676e){if(!_0x3f676e||!_0x3f676e[_0x9c80('0x63')][_0x9c80('0x33')]){return'';}for(var _0x23cc81='(',_0x18d5a8=0x0;_0x18d5a8<_0x3f676e[_0x9c80('0x63')][_0x9c80('0x33')];_0x18d5a8+=0x1){_0x18d5a8>0x0&&(_0x23cc81+='\x20'+_0x3f676e[_0x9c80('0x64')]+'\x20');_0x23cc81+=_0x3f676e['rules'][_0x18d5a8][_0x9c80('0x65')]?_0x2adf1f(_0x3f676e[_0x9c80('0x63')][_0x18d5a8][_0x9c80('0x65')]):_0x3f676e['rules'][_0x18d5a8][_0x9c80('0x72')]+'\x20'+_0x3f676e[_0x9c80('0x63')][_0x18d5a8][_0x9c80('0x66')]+(_0x4f47ae(_0x3f676e['rules'][_0x18d5a8][_0x9c80('0x66')])?'\x20'+_0x3f676e['rules'][_0x18d5a8][_0x9c80('0x67')]:'');}return _0x23cc81+')';};var _0x1d377b={'where':{'id':_0x33965c['params']['id']}},_0x62f823,_0x108cd1,_0x41c13c,_0x1e1459,_0x32fe5d;_0x1d377b=_['merge']({},_0x1d377b,_0x33965c[_0x9c80('0x42')]);return db['AnalyticDefaultReport'][_0x9c80('0x43')](_0x1d377b)[_0x9c80('0x22')](function(_0x2152f2){if(_0x2152f2){_0x62f823=_0x2152f2;return _0x2152f2[_0x9c80('0x68')]();}return null;})[_0x9c80('0x22')](function(_0x2f3224){if(_0x2f3224){if(!_0x2f3224[_0x9c80('0x33')]){throw new db[(_0x9c80('0x69'))][(_0x9c80('0x6a'))](_0x9c80('0x6b'),0x193);}_0x108cd1=_0x2f3224;return db['AnalyticMetric'][_0x9c80('0x3b')]({'raw':!![]});}return null;})[_0x9c80('0x22')](function(_0xb7f631){if(_0xb7f631){_0x41c13c=_['keyBy'](_0xb7f631,'id');var _0xf10f87;var _0x45d38a=squel[_0x9c80('0x6e')]();_0x45d38a['from'](_0x62f823[_0x9c80('0x7d')]);for(var _0x10ceca=0x0;_0x10ceca<_0x108cd1[_0x9c80('0x33')];_0x10ceca+=0x1){_0xf10f87=_0x108cd1[_0x10ceca][_0x9c80('0x70')]?_0x41c13c[_0x108cd1[_0x10ceca][_0x9c80('0x70')]][_0x9c80('0x71')]:_0x108cd1[_0x10ceca][_0x9c80('0x72')];_0xf10f87=_0x108cd1[_0x10ceca][_0x9c80('0x73')]?_['replace'](_0x4976f8[_0x108cd1[_0x10ceca][_0x9c80('0x73')]],'%s',_0xf10f87):_0xf10f87;_0xf10f87=_0x108cd1[_0x10ceca]['format']?_[_0x9c80('0x74')](_0x1ebdf3[_0x108cd1[_0x10ceca]['format']],'%s',_0xf10f87):_0xf10f87;if(_0x108cd1[_0x10ceca][_0x9c80('0x89')]){_0x45d38a[_0x9c80('0x65')](_0xf10f87);}_0x108cd1[_0x10ceca][_0x9c80('0x8a')]&&_0x45d38a['order'](_0xf10f87,_0x108cd1[_0x10ceca][_0x9c80('0x8a')]===_0x9c80('0xa0')?![]:!![]);_0x45d38a[_0x9c80('0x72')](_0xf10f87,_0x108cd1[_0x10ceca][_0x9c80('0x77')]||_0xf10f87);}if(_0x62f823[_0x9c80('0x78')]){_0x62f823[_0x9c80('0x78')]=JSON[_0x9c80('0x7f')](_0x62f823[_0x9c80('0x78')]);for(var _0x4377f9=0x0;_0x4377f9<_0x62f823[_0x9c80('0x78')][_0x9c80('0x33')];_0x4377f9+=0x1){if(_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x2c')]&&_[_0x9c80('0x5e')](_0x3c8499,_0x62f823[_0x9c80('0x78')][_0x4377f9]['type'])&&_0x62f823[_0x9c80('0x78')][_0x4377f9]['parentKey']&&_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x7a')]&&_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x7b')]){_0x45d38a[_0x62f823['joins'][_0x4377f9][_0x9c80('0x2c')]](_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x7a')],null,util[_0x9c80('0x75')]('%s.%s\x20=\x20%s.%s',_0x62f823[_0x9c80('0x7d')],_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x79')],_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x7a')],_0x62f823[_0x9c80('0x78')][_0x4377f9][_0x9c80('0x7b')]));}}}if(_0x62f823[_0x9c80('0x7e')]){_0x62f823['conditions']=JSON[_0x9c80('0x7f')](_0x62f823['conditions']);_0x45d38a['where'](_0x2adf1f(_0x62f823[_0x9c80('0x7e')][_0x9c80('0x65')]));}_0x32fe5d=_0x45d38a[_0x9c80('0x80')]();_0x45d38a['limit'](_0x1429bc);_0x45d38a[_0x9c80('0x1c')](0x0);logger['debug'](_0x9c80('0x82'),_0x45d38a[_0x9c80('0x83')]());return db[_0x9c80('0x84')][_0x9c80('0x2e')](_0x45d38a[_0x9c80('0x83')](),{'type':db[_0x9c80('0x84')][_0x9c80('0x85')][_0x9c80('0x86')]});}})[_0x9c80('0x22')](function(){return{'sql':_0x32fe5d[_0x9c80('0x83')]()};})['then'](respondWithResult(_0x483872,null))['catch'](handleError(_0x483872,null));}; \ No newline at end of file +var _0x9501=['IS\x20NULL','IS\x20NOT\x20EMPTY','condition','from','MetricId','DESC','sequelize','QueryTypes','output','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','COUNT(%s)','UNIX_TIMESTAMP(%s)','value','alias','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','AnalyticDefaultReport','includeAll','findAll','catch','show','params','include','find','create','role','user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','metric','function','replace','format','groupBy','orderBy','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)'];(function(_0xe0f242,_0x2f4ecf){var _0x3b801a=function(_0x29d08c){while(--_0x29d08c){_0xe0f242['push'](_0xe0f242['shift']());}};_0x3b801a(++_0x2f4ecf);}(_0x9501,0xc0));var _0x1950=function(_0x517363,_0x17275e){_0x517363=_0x517363-0x0;var _0x52388a=_0x9501[_0x517363];return _0x52388a;};'use strict';var pdf=require(_0x1950('0x0'));var emlformat=require(_0x1950('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1950('0x2'));var jsonpatch=require(_0x1950('0x3'));var rp=require(_0x1950('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1950('0x5'));var util=require(_0x1950('0x6'));var path=require(_0x1950('0x7'));var sox=require(_0x1950('0x8'));var csv=require(_0x1950('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1950('0xa'));var squel=require(_0x1950('0xb'));var crypto=require(_0x1950('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1950('0xd'));var toCsv=require(_0x1950('0x9'));var querystring=require(_0x1950('0xe'));var Papa=require(_0x1950('0xf'));var Redis=require('ioredis');var authService=require(_0x1950('0x10'));var qs=require(_0x1950('0x11'));var as=require(_0x1950('0x12'));var hardwareService=require(_0x1950('0x13'));var logger=require('../../config/logger')(_0x1950('0x14'));var utils=require(_0x1950('0x15'));var config=require('../../config/environment');var db=require(_0x1950('0x16'))['db'];function respondWithStatusCode(_0x4cc622,_0x937d12){_0x937d12=_0x937d12||0xcc;return function(_0x5dc993){if(_0x5dc993){return _0x4cc622['sendStatus'](_0x937d12);}return _0x4cc622[_0x1950('0x17')](_0x937d12)[_0x1950('0x18')]();};}function respondWithResult(_0x2cc60a,_0x421b48){_0x421b48=_0x421b48||0xc8;return function(_0x2f85d2){if(_0x2f85d2){return _0x2cc60a[_0x1950('0x17')](_0x421b48)[_0x1950('0x19')](_0x2f85d2);}};}function respondWithFilteredResult(_0x43dc73,_0x53b17b){return function(_0x330e84){if(_0x330e84){var _0x33123d=_0x330e84[_0x1950('0x1a')],_0x4cdf55=_0x53b17b[_0x1950('0x1b')],_0x310efe=_0x53b17b['offset']+_0x53b17b[_0x1950('0x1c')],_0x17b3b7;if(_0x310efe>=_0x33123d){_0x310efe=_0x33123d;_0x17b3b7=0xc8;}else{_0x17b3b7=0xce;}_0x43dc73[_0x1950('0x17')](_0x17b3b7);return _0x43dc73[_0x1950('0x1d')](_0x1950('0x1e'),_0x4cdf55+'-'+_0x310efe+'/'+_0x33123d)[_0x1950('0x19')](_0x330e84);}return null;};}function patchUpdates(_0x3e05c9){return function(_0x240dba){try{jsonpatch[_0x1950('0x1f')](_0x240dba,_0x3e05c9,!![]);}catch(_0x70067c){return BPromise[_0x1950('0x20')](_0x70067c);}return _0x240dba[_0x1950('0x21')]();};}function saveUpdates(_0x463eb1,_0x46787c){return function(_0x5d7a49){if(_0x5d7a49){return _0x5d7a49['update'](_0x463eb1)[_0x1950('0x22')](function(_0x5f128a){return _0x5f128a;});}return null;};}function removeEntity(_0x5079ea,_0x32dc20){return function(_0x876ada){if(_0x876ada){return _0x876ada['destroy']()['then'](function(){var _0x5b14f1=_0x876ada[_0x1950('0x23')]({'plain':!![]});var _0xd55e6a='DefaultReports';return db[_0x1950('0x24')][_0x1950('0x25')]({'where':{'type':_0xd55e6a,'resourceId':_0x5b14f1['id']}})['then'](function(){return _0x876ada;});})[_0x1950('0x22')](function(){_0x5079ea[_0x1950('0x17')](0xcc)[_0x1950('0x18')]();});}};}function handleEntityNotFound(_0x1b310f,_0x5d39a3){return function(_0x497d9e){if(!_0x497d9e){_0x1b310f[_0x1950('0x26')](0x194);}return _0x497d9e;};}function handleError(_0xa9217a,_0x199355){_0x199355=_0x199355||0x1f4;return function(_0x793acb){logger[_0x1950('0x27')](_0x793acb[_0x1950('0x28')]);if(_0x793acb[_0x1950('0x29')]){delete _0x793acb[_0x1950('0x29')];}_0xa9217a[_0x1950('0x17')](_0x199355)[_0x1950('0x2a')](_0x793acb);};}exports[_0x1950('0x2b')]=function(_0x1866da,_0x1da35e){var _0x5d6ab8={},_0x41db7d={},_0x444e5f={'count':0x0,'rows':[]};var _0x9319e7=_[_0x1950('0x2c')](db['AnalyticDefaultReport'][_0x1950('0x2d')],function(_0x361325){return{'name':_0x361325[_0x1950('0x2e')],'type':_0x361325[_0x1950('0x2f')][_0x1950('0x30')]};});_0x41db7d['model']=_[_0x1950('0x2c')](_0x9319e7,_0x1950('0x29'));_0x41db7d[_0x1950('0x31')]=_[_0x1950('0x32')](_0x1866da[_0x1950('0x31')]);_0x41db7d[_0x1950('0x33')]=_[_0x1950('0x34')](_0x41db7d['model'],_0x41db7d[_0x1950('0x31')]);_0x5d6ab8['attributes']=_[_0x1950('0x34')](_0x41db7d[_0x1950('0x35')],qs[_0x1950('0x36')](_0x1866da[_0x1950('0x31')][_0x1950('0x36')]));_0x5d6ab8[_0x1950('0x37')]=_0x5d6ab8['attributes'][_0x1950('0x38')]?_0x5d6ab8[_0x1950('0x37')]:_0x41db7d[_0x1950('0x35')];if(!_0x1866da[_0x1950('0x31')]['hasOwnProperty'](_0x1950('0x39'))){_0x5d6ab8['limit']=qs[_0x1950('0x1c')](_0x1866da[_0x1950('0x31')][_0x1950('0x1c')]);_0x5d6ab8['offset']=qs['offset'](_0x1866da[_0x1950('0x31')][_0x1950('0x1b')]);}_0x5d6ab8[_0x1950('0x3a')]=qs['sort'](_0x1866da['query'][_0x1950('0x3b')]);_0x5d6ab8[_0x1950('0x3c')]=qs['filters'](_[_0x1950('0x3d')](_0x1866da[_0x1950('0x31')],_0x41db7d[_0x1950('0x33')]));if(_0x1866da[_0x1950('0x31')][_0x1950('0x3e')]){_0x5d6ab8[_0x1950('0x3c')]=_[_0x1950('0x3f')](_0x5d6ab8[_0x1950('0x3c')],{'$or':_[_0x1950('0x2c')](_0x9319e7,function(_0x1b4246){if(_0x1b4246[_0x1950('0x2f')]!=='VIRTUAL'){var _0x354db7={};_0x354db7[_0x1b4246[_0x1950('0x29')]]={'$like':'%'+_0x1866da[_0x1950('0x31')]['filter']+'%'};return _0x354db7;}})});}_0x5d6ab8=_[_0x1950('0x3f')]({},_0x5d6ab8,_0x1866da[_0x1950('0x40')]);var _0x557afd={'where':_0x5d6ab8[_0x1950('0x3c')]};return db[_0x1950('0x41')][_0x1950('0x1a')](_0x557afd)[_0x1950('0x22')](function(_0x7dede7){_0x444e5f[_0x1950('0x1a')]=_0x7dede7;if(_0x1866da[_0x1950('0x31')][_0x1950('0x42')]){_0x5d6ab8['include']=[{'all':!![]}];}return db[_0x1950('0x41')][_0x1950('0x43')](_0x5d6ab8);})['then'](function(_0x4438b4){_0x444e5f['rows']=_0x4438b4;return _0x444e5f;})[_0x1950('0x22')](respondWithFilteredResult(_0x1da35e,_0x5d6ab8))[_0x1950('0x44')](handleError(_0x1da35e,null));};exports[_0x1950('0x45')]=function(_0x336121,_0x3294d9){var _0x413f98={'raw':!![],'where':{'id':_0x336121[_0x1950('0x46')]['id']}},_0x5d7f4f={};_0x5d7f4f[_0x1950('0x35')]=_[_0x1950('0x32')](db[_0x1950('0x41')][_0x1950('0x2d')]);_0x5d7f4f[_0x1950('0x31')]=_[_0x1950('0x32')](_0x336121['query']);_0x5d7f4f[_0x1950('0x33')]=_[_0x1950('0x34')](_0x5d7f4f[_0x1950('0x35')],_0x5d7f4f[_0x1950('0x31')]);_0x413f98['attributes']=_[_0x1950('0x34')](_0x5d7f4f[_0x1950('0x35')],qs[_0x1950('0x36')](_0x336121[_0x1950('0x31')][_0x1950('0x36')]));_0x413f98[_0x1950('0x37')]=_0x413f98[_0x1950('0x37')][_0x1950('0x38')]?_0x413f98[_0x1950('0x37')]:_0x5d7f4f[_0x1950('0x35')];if(_0x336121['query'][_0x1950('0x42')]){_0x413f98[_0x1950('0x47')]=[{'all':!![]}];}_0x413f98=_[_0x1950('0x3f')]({},_0x413f98,_0x336121['options']);return db[_0x1950('0x41')][_0x1950('0x48')](_0x413f98)[_0x1950('0x22')](handleEntityNotFound(_0x3294d9,null))[_0x1950('0x22')](respondWithResult(_0x3294d9,null))['catch'](handleError(_0x3294d9,null));};exports[_0x1950('0x49')]=function(_0x1a0bd5,_0x466e4b){return db[_0x1950('0x41')]['create'](_0x1a0bd5['body'],{})['then'](function(_0x53a72f){var _0x28d472=_0x1a0bd5['user'][_0x1950('0x23')]({'plain':!![]});if(!_0x28d472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28d472[_0x1950('0x4a')]===_0x1950('0x4b')){var _0x2986d9=_0x53a72f[_0x1950('0x23')]({'plain':!![]});var _0x99579f=_0x1950('0x4c');return db[_0x1950('0x4d')][_0x1950('0x48')]({'where':{'name':_0x99579f,'userProfileId':_0x28d472['userProfileId']},'raw':!![]})[_0x1950('0x22')](function(_0x5119fd){if(_0x5119fd&&_0x5119fd[_0x1950('0x4e')]===0x0){return db['UserProfileResource'][_0x1950('0x49')]({'name':_0x2986d9[_0x1950('0x29')],'resourceId':_0x2986d9['id'],'type':_0x1950('0x4f'),'sectionId':_0x5119fd['id']},{})['then'](function(){return _0x53a72f;});}else{return _0x53a72f;}})[_0x1950('0x44')](function(_0x1834c7){logger[_0x1950('0x27')](_0x1950('0x50'),_0x1834c7);throw _0x1834c7;});}return _0x53a72f;})[_0x1950('0x22')](respondWithResult(_0x466e4b,0xc9))[_0x1950('0x44')](handleError(_0x466e4b,null));};exports[_0x1950('0x51')]=function(_0x6c2069,_0x13d0fb){if(_0x6c2069[_0x1950('0x52')]['id']){delete _0x6c2069['body']['id'];}return db['AnalyticDefaultReport'][_0x1950('0x48')]({'where':{'id':_0x6c2069[_0x1950('0x46')]['id']}})[_0x1950('0x22')](handleEntityNotFound(_0x13d0fb,null))[_0x1950('0x22')](saveUpdates(_0x6c2069['body'],null))[_0x1950('0x22')](respondWithResult(_0x13d0fb,null))[_0x1950('0x44')](handleError(_0x13d0fb,null));};exports[_0x1950('0x25')]=function(_0x1d59a1,_0x2ad7ad){return db[_0x1950('0x41')]['find']({'where':{'id':_0x1d59a1[_0x1950('0x46')]['id']}})[_0x1950('0x22')](handleEntityNotFound(_0x2ad7ad,null))[_0x1950('0x22')](removeEntity(_0x2ad7ad,null))[_0x1950('0x44')](handleError(_0x2ad7ad,null));};exports[_0x1950('0x53')]=function(_0x41976a,_0xa8ff79){var _0x1e40ef=0xa;var _0x367b5f=[_0x1950('0x54'),_0x1950('0x55'),_0x1950('0x56'),_0x1950('0x57')];var _0x5f3b36={'SUM':_0x1950('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1950('0x59'),'MAX':_0x1950('0x5a'),'MIN':'MIN(%s)','AVG':_0x1950('0x5b'),'GROUP_CONCAT':_0x1950('0x5c'),'GROUP_CONCAT ASC':_0x1950('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x413291={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1950('0x5e'),'HOUR':_0x1950('0x5f'),'ROUND':_0x1950('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51e1d0=function(_0x1db006){return!_[_0x1950('0x61')](['IS\x20NULL',_0x1950('0x62'),_0x1950('0x63'),'IS\x20NOT\x20EMPTY'],_0x1db006);};var _0x9bf7ac=function(_0x4cc73d){if(!_0x4cc73d||!_0x4cc73d['rules'][_0x1950('0x38')]){return'';}for(var _0x1032f5='(',_0x4958ca=0x0;_0x4958ca<_0x4cc73d[_0x1950('0x64')]['length'];_0x4958ca+=0x1){_0x4958ca>0x0&&(_0x1032f5+='\x20'+_0x4cc73d[_0x1950('0x65')]+'\x20');_0x1032f5+=_0x4cc73d[_0x1950('0x64')][_0x4958ca][_0x1950('0x66')]?_0x9bf7ac(_0x4cc73d[_0x1950('0x64')][_0x4958ca]['group']):_0x4cc73d['rules'][_0x4958ca][_0x1950('0x67')]+'\x20'+_0x4cc73d[_0x1950('0x64')][_0x4958ca]['condition']+(_0x51e1d0(_0x4cc73d[_0x1950('0x64')][_0x4958ca]['condition'])?'\x20'+_0x4cc73d[_0x1950('0x64')][_0x4958ca]['value']:'');}return _0x1032f5+')';};var _0x399be5={'where':{'id':_0x41976a[_0x1950('0x46')]['id']}},_0x7031af,_0x1efc2e,_0x1bd828,_0x78aea6,_0x38b6cd;_0x399be5=_[_0x1950('0x3f')]({},_0x399be5,_0x41976a['options']);return db[_0x1950('0x41')][_0x1950('0x48')](_0x399be5)[_0x1950('0x22')](function(_0x35bf55){if(_0x35bf55){_0x7031af=_0x35bf55;return _0x35bf55[_0x1950('0x68')]();}return null;})[_0x1950('0x22')](function(_0x18d990){if(_0x18d990){if(!_0x18d990[_0x1950('0x38')]){throw new db[(_0x1950('0x69'))][(_0x1950('0x6a'))](_0x1950('0x6b'),0x193);}_0x1efc2e=_0x18d990;return db[_0x1950('0x6c')][_0x1950('0x43')]({'raw':!![]});}return null;})[_0x1950('0x22')](function(_0x1105e3){if(_0x1105e3){_0x1bd828=_[_0x1950('0x6d')](_0x1105e3,'id');var _0x16bc8b;var _0x58e6a9=squel[_0x1950('0x6e')]();_0x58e6a9['from'](_0x7031af[_0x1950('0x6f')]);for(var _0x597858=0x0;_0x597858<_0x1efc2e['length'];_0x597858+=0x1){_0x16bc8b=_0x1efc2e[_0x597858]['MetricId']?_0x1bd828[_0x1efc2e[_0x597858]['MetricId']][_0x1950('0x70')]:_0x1efc2e[_0x597858][_0x1950('0x67')];_0x16bc8b=_0x1efc2e[_0x597858][_0x1950('0x71')]?_[_0x1950('0x72')](_0x5f3b36[_0x1efc2e[_0x597858][_0x1950('0x71')]],'%s',_0x16bc8b):_0x16bc8b;_0x16bc8b=_0x1efc2e[_0x597858][_0x1950('0x73')]?_[_0x1950('0x72')](_0x413291[_0x1efc2e[_0x597858][_0x1950('0x73')]],'%s',_0x16bc8b):_0x16bc8b;if(_0x1efc2e[_0x597858][_0x1950('0x74')]){_0x58e6a9[_0x1950('0x66')](_0x16bc8b);}_0x1efc2e[_0x597858][_0x1950('0x75')]&&_0x58e6a9[_0x1950('0x3a')](_0x16bc8b,_0x1efc2e[_0x597858][_0x1950('0x75')]==='DESC'?![]:!![]);_0x58e6a9[_0x1950('0x67')](_0x16bc8b,_0x1efc2e[_0x597858]['alias']||_0x16bc8b);}if(_0x7031af[_0x1950('0x76')]){_0x7031af[_0x1950('0x76')]=JSON['parse'](_0x7031af[_0x1950('0x76')]);for(var _0x2f0c91=0x0;_0x2f0c91<_0x7031af[_0x1950('0x76')][_0x1950('0x38')];_0x2f0c91+=0x1){if(_0x7031af['joins'][_0x2f0c91]['type']&&_[_0x1950('0x61')](_0x367b5f,_0x7031af['joins'][_0x2f0c91]['type'])&&_0x7031af[_0x1950('0x76')][_0x2f0c91][_0x1950('0x77')]&&_0x7031af[_0x1950('0x76')][_0x2f0c91][_0x1950('0x78')]&&_0x7031af['joins'][_0x2f0c91][_0x1950('0x79')]){_0x58e6a9[_0x7031af[_0x1950('0x76')][_0x2f0c91]['type']](_0x7031af['joins'][_0x2f0c91][_0x1950('0x78')],null,util[_0x1950('0x73')](_0x1950('0x7a'),_0x7031af[_0x1950('0x6f')],_0x7031af[_0x1950('0x76')][_0x2f0c91][_0x1950('0x77')],_0x7031af[_0x1950('0x76')][_0x2f0c91][_0x1950('0x78')],_0x7031af['joins'][_0x2f0c91][_0x1950('0x79')]));}}}if(_0x7031af[_0x1950('0x7b')]){_0x7031af['conditions']=JSON[_0x1950('0x7c')](_0x7031af[_0x1950('0x7b')]);_0x58e6a9['where'](_0x9bf7ac(_0x7031af[_0x1950('0x7b')][_0x1950('0x66')]));}_0x38b6cd=_0x58e6a9[_0x1950('0x7d')]();_0x58e6a9[_0x1950('0x1c')](_0x1e40ef);_0x58e6a9[_0x1950('0x1b')](0x0);logger['debug'](_0x1950('0x7e'),_0x58e6a9['toString']());return db['sequelize']['query'](_0x58e6a9[_0x1950('0x7f')](),{'type':db['sequelize']['QueryTypes'][_0x1950('0x80')]});}})[_0x1950('0x22')](respondWithResult(_0xa8ff79,null))[_0x1950('0x44')](handleError(_0xa8ff79,null));};function runReport(_0x31f508,_0x5b7030,_0x46a46a){var _0xd1594c=_0x5b7030[_0x1950('0x29')];var _0x435dcd=0xa;var _0x37a0e0=[_0x1950('0x54'),_0x1950('0x55'),_0x1950('0x56'),_0x1950('0x57')];var _0x4b4a64={'SUM':_0x1950('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1950('0x59'),'MAX':_0x1950('0x5a'),'MIN':_0x1950('0x81'),'AVG':_0x1950('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1950('0x5d'),'GROUP_CONCAT DESC':_0x1950('0x82')};var _0x50b653={'SEC_TO_TIME':_0x1950('0x83'),'DATE':_0x1950('0x5e'),'HOUR':_0x1950('0x5f'),'ROUND':_0x1950('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3be684=function(_0x134424){return!_[_0x1950('0x61')]([_0x1950('0x84'),'IS\x20NOT\x20NULL',_0x1950('0x63'),_0x1950('0x85')],_0x134424);};var _0x41b323=function(_0x4ea8be){if(!_0x4ea8be||!_0x4ea8be['rules'][_0x1950('0x38')]){return'';}for(var _0x3a0e5b='(',_0x1f77d0=0x0;_0x1f77d0<_0x4ea8be[_0x1950('0x64')]['length'];_0x1f77d0+=0x1){_0x1f77d0>0x0&&(_0x3a0e5b+='\x20'+_0x4ea8be[_0x1950('0x65')]+'\x20');_0x3a0e5b+=_0x4ea8be[_0x1950('0x64')][_0x1f77d0]['group']?_0x41b323(_0x4ea8be[_0x1950('0x64')][_0x1f77d0]['group']):_0x4ea8be[_0x1950('0x64')][_0x1f77d0][_0x1950('0x67')]+'\x20'+_0x4ea8be['rules'][_0x1f77d0]['condition']+(_0x3be684(_0x4ea8be[_0x1950('0x64')][_0x1f77d0][_0x1950('0x86')])?'\x20'+_0x4ea8be[_0x1950('0x64')][_0x1f77d0]['value']:'');}return _0x3a0e5b+')';};var _0x222499={'where':{'id':_0x31f508['id']}},_0x840c58,_0x423a28,_0x59cd8c,_0x1a6f6c,_0x30e178;_0x222499=_[_0x1950('0x3f')]({},_0x222499,_0x46a46a);return db[_0x1950('0x41')][_0x1950('0x48')](_0x222499)[_0x1950('0x22')](function(_0x2caa90){if(_0x2caa90){_0x840c58=_0x2caa90;return _0x2caa90[_0x1950('0x68')]();}return null;})[_0x1950('0x22')](function(_0x39ca8a){if(_0x39ca8a){if(!_0x39ca8a['length']){throw new db[(_0x1950('0x69'))][(_0x1950('0x6a'))](_0x1950('0x6b'),0x193);}_0x423a28=_0x39ca8a;return db[_0x1950('0x6c')][_0x1950('0x43')]({'raw':!![]});}return null;})[_0x1950('0x22')](function(_0x527d7c){if(_0x527d7c){_0x59cd8c=_[_0x1950('0x6d')](_0x527d7c,'id');var _0x5d6a0;var _0x127d27=squel[_0x1950('0x6e')]();_0x127d27[_0x1950('0x87')](_0x840c58[_0x1950('0x6f')]);for(var _0x347ad4=0x0;_0x347ad4<_0x423a28['length'];_0x347ad4+=0x1){_0x5d6a0=_0x423a28[_0x347ad4][_0x1950('0x88')]?_0x59cd8c[_0x423a28[_0x347ad4][_0x1950('0x88')]]['metric']:_0x423a28[_0x347ad4][_0x1950('0x67')];_0x5d6a0=_0x423a28[_0x347ad4][_0x1950('0x71')]?_['replace'](_0x4b4a64[_0x423a28[_0x347ad4]['function']],'%s',_0x5d6a0):_0x5d6a0;_0x5d6a0=_0x423a28[_0x347ad4][_0x1950('0x73')]?_['replace'](_0x50b653[_0x423a28[_0x347ad4][_0x1950('0x73')]],'%s',_0x5d6a0):_0x5d6a0;if(_0x423a28[_0x347ad4]['groupBy']){_0x127d27[_0x1950('0x66')](_0x5d6a0);}_0x423a28[_0x347ad4][_0x1950('0x75')]&&_0x127d27[_0x1950('0x3a')](_0x5d6a0,_0x423a28[_0x347ad4][_0x1950('0x75')]===_0x1950('0x89')?![]:!![]);_0x127d27[_0x1950('0x67')](_0x5d6a0,_0x423a28[_0x347ad4]['alias']||_0x5d6a0);}if(_0x840c58[_0x1950('0x76')]){_0x840c58[_0x1950('0x76')]=JSON[_0x1950('0x7c')](_0x840c58[_0x1950('0x76')]);for(var _0x5a066a=0x0;_0x5a066a<_0x840c58[_0x1950('0x76')][_0x1950('0x38')];_0x5a066a+=0x1){if(_0x840c58['joins'][_0x5a066a][_0x1950('0x2f')]&&_['includes'](_0x37a0e0,_0x840c58[_0x1950('0x76')][_0x5a066a]['type'])&&_0x840c58['joins'][_0x5a066a][_0x1950('0x77')]&&_0x840c58[_0x1950('0x76')][_0x5a066a][_0x1950('0x78')]&&_0x840c58[_0x1950('0x76')][_0x5a066a][_0x1950('0x79')]){_0x127d27[_0x840c58[_0x1950('0x76')][_0x5a066a][_0x1950('0x2f')]](_0x840c58[_0x1950('0x76')][_0x5a066a][_0x1950('0x78')],null,util[_0x1950('0x73')]('%s.%s\x20=\x20%s.%s',_0x840c58[_0x1950('0x6f')],_0x840c58[_0x1950('0x76')][_0x5a066a]['parentKey'],_0x840c58['joins'][_0x5a066a][_0x1950('0x78')],_0x840c58[_0x1950('0x76')][_0x5a066a]['foreignKey']));}}}if(_0x840c58[_0x1950('0x7b')]){_0x840c58['conditions']=JSON['parse'](_0x840c58['conditions']);_0x127d27[_0x1950('0x3c')](_0x41b323(_0x840c58['conditions']['group']));}_0x30e178=_0x127d27[_0x1950('0x7d')]();_0x127d27[_0x1950('0x1c')](_0x435dcd);_0x127d27[_0x1950('0x1b')](0x0);logger['debug'](_0x1950('0x7e'),_0x127d27[_0x1950('0x7f')]());return db[_0x1950('0x8a')][_0x1950('0x31')](_0x127d27[_0x1950('0x7f')](),{'type':db['sequelize'][_0x1950('0x8b')][_0x1950('0x80')]});}})['then'](function(_0x4e53ef){if(!_0x4e53ef[_0x1950('0x38')]){throw new db['Sequelize']['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x5b7030[_0x1950('0x8c')]==='web'){return null;}var _0x5e514d=_[_0x1950('0x3f')](_0x5b7030,{'name':_0x5b7030[_0x1950('0x8d')]||_0x5b7030[_0x1950('0x29')]||_0x840c58[_0x1950('0x29')],'basename':_0xd1594c,'savename':util[_0x1950('0x73')](_0x1950('0x8e'),_0x5b7030['name']||_0x840c58[_0x1950('0x29')],require('randomstring')[_0x1950('0x8f')](0x4),_0x5b7030[_0x1950('0x8c')]||_0x1950('0x90')),'reportId':_0x840c58['id'],'reportType':'default'});return db[_0x1950('0x91')][_0x1950('0x49')](_0x5e514d,{'raw':!![]});})[_0x1950('0x22')](function(_0x4642c6){if(_0x840c58[_0x1950('0x6f')]===_0x1950('0x92')){_0x30e178['where'](_0x840c58[_0x1950('0x6f')]+_0x1950('0x93'),_0x5b7030[_0x1950('0x94')],_0x5b7030[_0x1950('0x95')]);}else{_0x30e178[_0x1950('0x3c')](_0x840c58[_0x1950('0x6f')]+_0x1950('0x96'),_0x5b7030[_0x1950('0x94')],_0x5b7030['endDate']);}if(_0x4642c6){logger['info'](_0x1950('0x97'),_0x30e178[_0x1950('0x7f')]());require(_0x1950('0x98'))['fork'](path['join'](__dirname,_0x1950('0x99'),_0x4642c6[_0x1950('0x8c')]),[_0x4642c6['id'],_0x30e178['toString'](),path[_0x1950('0x54')](__dirname,_0x1950('0x9a'),_0x4642c6['savename']),_0xd1594c]);return _0x4642c6;}else{var _0x24a716=squel[_0x1950('0x6e')]();_0x24a716[_0x1950('0x87')]('('+_0x30e178[_0x1950('0x7f')]()+')',_0x1950('0x9b'));_0x24a716[_0x1950('0x67')](_0x1950('0x9c'),_0x1950('0x1a'));_0x30e178['limit'](_0x5b7030['limit']||_0x435dcd);_0x30e178[_0x1950('0x1b')](_0x5b7030[_0x1950('0x1b')]||0x0);return db[_0x1950('0x8a')]['query'](_0x24a716[_0x1950('0x7f')](),{'type':db[_0x1950('0x8a')][_0x1950('0x8b')]['SELECT']})[_0x1950('0x22')](function(_0x1f44a5){if(!_0x1f44a5[_0x1950('0x38')]){_0x1a6f6c=0x0;}else{_0x1a6f6c=_0x1f44a5[0x0][_0x1950('0x1a')]||0x0;}return db[_0x1950('0x8a')][_0x1950('0x31')](_0x30e178[_0x1950('0x7f')](),{'type':db['sequelize'][_0x1950('0x8b')][_0x1950('0x80')]});})[_0x1950('0x22')](function(_0x487307){return{'rows':_0x487307||[],'count':_0x1a6f6c};});}});}exports['run']=function(_0x32bf42,_0x50abb4){return runReport(_0x32bf42['params'],_0x32bf42[_0x1950('0x31')],_0x32bf42[_0x1950('0x40')])[_0x1950('0x22')](respondWithResult(_0x50abb4,null))[_0x1950('0x44')](handleError(_0x50abb4,null));};exports[_0x1950('0x9d')]=runReport;exports[_0x1950('0x31')]=function(_0x38f30d,_0x38f9e5){var _0x20542d=0xa;var _0x3759bb=[_0x1950('0x54'),_0x1950('0x55'),_0x1950('0x56'),_0x1950('0x57')];var _0x1cd929={'SUM':_0x1950('0x58'),'COUNT':_0x1950('0x9e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1950('0x5a'),'MIN':_0x1950('0x81'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1950('0x5c'),'GROUP_CONCAT ASC':_0x1950('0x5d'),'GROUP_CONCAT DESC':_0x1950('0x82')};var _0x524017={'SEC_TO_TIME':_0x1950('0x83'),'DATE':_0x1950('0x5e'),'HOUR':_0x1950('0x5f'),'ROUND':_0x1950('0x60'),'UNIX_TIMESTAMP':_0x1950('0x9f')};var _0x21affa=function(_0x21aec5){return!_[_0x1950('0x61')]([_0x1950('0x84'),'IS\x20NOT\x20NULL',_0x1950('0x63'),_0x1950('0x85')],_0x21aec5);};var _0x1d2bf0=function(_0x53a68b){if(!_0x53a68b||!_0x53a68b[_0x1950('0x64')][_0x1950('0x38')]){return'';}for(var _0x5f5570='(',_0x37b995=0x0;_0x37b995<_0x53a68b['rules']['length'];_0x37b995+=0x1){_0x37b995>0x0&&(_0x5f5570+='\x20'+_0x53a68b['operator']+'\x20');_0x5f5570+=_0x53a68b[_0x1950('0x64')][_0x37b995][_0x1950('0x66')]?_0x1d2bf0(_0x53a68b[_0x1950('0x64')][_0x37b995]['group']):_0x53a68b[_0x1950('0x64')][_0x37b995][_0x1950('0x67')]+'\x20'+_0x53a68b[_0x1950('0x64')][_0x37b995][_0x1950('0x86')]+(_0x21affa(_0x53a68b[_0x1950('0x64')][_0x37b995][_0x1950('0x86')])?'\x20'+_0x53a68b['rules'][_0x37b995][_0x1950('0xa0')]:'');}return _0x5f5570+')';};var _0x245569={'where':{'id':_0x38f30d[_0x1950('0x46')]['id']}},_0xf5220,_0x1069da,_0x22f24e,_0x4b151c,_0x5b0760;_0x245569=_[_0x1950('0x3f')]({},_0x245569,_0x38f30d[_0x1950('0x40')]);return db[_0x1950('0x41')][_0x1950('0x48')](_0x245569)[_0x1950('0x22')](function(_0x54d382){if(_0x54d382){_0xf5220=_0x54d382;return _0x54d382['getFields']();}return null;})[_0x1950('0x22')](function(_0x32112b){if(_0x32112b){if(!_0x32112b[_0x1950('0x38')]){throw new db[(_0x1950('0x69'))][(_0x1950('0x6a'))](_0x1950('0x6b'),0x193);}_0x1069da=_0x32112b;return db[_0x1950('0x6c')][_0x1950('0x43')]({'raw':!![]});}return null;})[_0x1950('0x22')](function(_0x5774e0){if(_0x5774e0){_0x22f24e=_['keyBy'](_0x5774e0,'id');var _0x4e7254;var _0x45f7b7=squel['select']();_0x45f7b7[_0x1950('0x87')](_0xf5220[_0x1950('0x6f')]);for(var _0x4fb2aa=0x0;_0x4fb2aa<_0x1069da[_0x1950('0x38')];_0x4fb2aa+=0x1){_0x4e7254=_0x1069da[_0x4fb2aa][_0x1950('0x88')]?_0x22f24e[_0x1069da[_0x4fb2aa][_0x1950('0x88')]][_0x1950('0x70')]:_0x1069da[_0x4fb2aa][_0x1950('0x67')];_0x4e7254=_0x1069da[_0x4fb2aa]['function']?_['replace'](_0x1cd929[_0x1069da[_0x4fb2aa][_0x1950('0x71')]],'%s',_0x4e7254):_0x4e7254;_0x4e7254=_0x1069da[_0x4fb2aa][_0x1950('0x73')]?_[_0x1950('0x72')](_0x524017[_0x1069da[_0x4fb2aa]['format']],'%s',_0x4e7254):_0x4e7254;if(_0x1069da[_0x4fb2aa][_0x1950('0x74')]){_0x45f7b7[_0x1950('0x66')](_0x4e7254);}_0x1069da[_0x4fb2aa][_0x1950('0x75')]&&_0x45f7b7['order'](_0x4e7254,_0x1069da[_0x4fb2aa]['orderBy']===_0x1950('0x89')?![]:!![]);_0x45f7b7[_0x1950('0x67')](_0x4e7254,_0x1069da[_0x4fb2aa][_0x1950('0xa1')]||_0x4e7254);}if(_0xf5220[_0x1950('0x76')]){_0xf5220[_0x1950('0x76')]=JSON['parse'](_0xf5220[_0x1950('0x76')]);for(var _0x2c1fd9=0x0;_0x2c1fd9<_0xf5220[_0x1950('0x76')][_0x1950('0x38')];_0x2c1fd9+=0x1){if(_0xf5220['joins'][_0x2c1fd9][_0x1950('0x2f')]&&_['includes'](_0x3759bb,_0xf5220[_0x1950('0x76')][_0x2c1fd9][_0x1950('0x2f')])&&_0xf5220[_0x1950('0x76')][_0x2c1fd9]['parentKey']&&_0xf5220[_0x1950('0x76')][_0x2c1fd9]['foreignTable']&&_0xf5220[_0x1950('0x76')][_0x2c1fd9][_0x1950('0x79')]){_0x45f7b7[_0xf5220[_0x1950('0x76')][_0x2c1fd9]['type']](_0xf5220[_0x1950('0x76')][_0x2c1fd9]['foreignTable'],null,util[_0x1950('0x73')](_0x1950('0x7a'),_0xf5220[_0x1950('0x6f')],_0xf5220['joins'][_0x2c1fd9]['parentKey'],_0xf5220[_0x1950('0x76')][_0x2c1fd9]['foreignTable'],_0xf5220[_0x1950('0x76')][_0x2c1fd9][_0x1950('0x79')]));}}}if(_0xf5220['conditions']){_0xf5220[_0x1950('0x7b')]=JSON[_0x1950('0x7c')](_0xf5220[_0x1950('0x7b')]);_0x45f7b7[_0x1950('0x3c')](_0x1d2bf0(_0xf5220[_0x1950('0x7b')][_0x1950('0x66')]));}_0x5b0760=_0x45f7b7[_0x1950('0x7d')]();_0x45f7b7[_0x1950('0x1c')](_0x20542d);_0x45f7b7[_0x1950('0x1b')](0x0);logger['debug'](_0x1950('0x7e'),_0x45f7b7[_0x1950('0x7f')]());return db[_0x1950('0x8a')][_0x1950('0x31')](_0x45f7b7[_0x1950('0x7f')](),{'type':db[_0x1950('0x8a')][_0x1950('0x8b')][_0x1950('0x80')]});}})[_0x1950('0x22')](function(){return{'sql':_0x5b0760['toString']()};})[_0x1950('0x22')](respondWithResult(_0x38f9e5,null))['catch'](handleError(_0x38f9e5,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index e317490..4a89f86 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 _0x3248=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a3915,_0xaee529){var _0x42a56a=function(_0x2923f9){while(--_0x2923f9){_0x2a3915['push'](_0x2a3915['shift']());}};_0x42a56a(++_0xaee529);}(_0x3248,0x1bc));var _0x8324=function(_0x13570d,_0x4fa7b5){_0x13570d=_0x13570d-0x0;var _0x87bf41=_0x3248[_0x13570d];return _0x87bf41;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8324('0x1'));var BPromise=require(_0x8324('0x2'));var rp=require(_0x8324('0x3'));var fs=require('fs');var path=require(_0x8324('0x4'));var rimraf=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x8324('0x7')]=function(_0x1c5c2a,_0x5157f4){return _0x1c5c2a[_0x8324('0x8')](_0x8324('0x9'),attributes,{'tableName':_0x8324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb04=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b3497,_0x37b1dd){var _0x292f65=function(_0x13e4f5){while(--_0x13e4f5){_0x1b3497['push'](_0x1b3497['shift']());}};_0x292f65(++_0x37b1dd);}(_0xbb04,0x18f));var _0x4bb0=function(_0x5098d3,_0x245091){_0x5098d3=_0x5098d3-0x0;var _0x285389=_0xbb04[_0x5098d3];return _0x285389;};'use strict';var _=require(_0x4bb0('0x0'));var util=require(_0x4bb0('0x1'));var logger=require('../../config/logger')(_0x4bb0('0x2'));var moment=require(_0x4bb0('0x3'));var BPromise=require(_0x4bb0('0x4'));var rp=require(_0x4bb0('0x5'));var fs=require('fs');var path=require(_0x4bb0('0x6'));var rimraf=require(_0x4bb0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4bb0('0x8'));module[_0x4bb0('0x9')]=function(_0x3a447b,_0x8cba0a){return _0x3a447b['define'](_0x4bb0('0xa'),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 f543ef4..1da2eeb 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 _0x847d=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x213a1d,_0x3464dd){var _0x28eeec=function(_0x178a1a){while(--_0x178a1a){_0x213a1d['push'](_0x213a1d['shift']());}};_0x28eeec(++_0x3464dd);}(_0x847d,0x14a));var _0xd847=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x847d[_0x578275];return _0xf78041;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var moment=require(_0xd847('0x1'));var BPromise=require(_0xd847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd847('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd847('0x4'));var logger=require(_0xd847('0x5'))('rpc');var config=require(_0xd847('0x6'));var jayson=require(_0xd847('0x7'));var client=jayson[_0xd847('0x8')][_0xd847('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f3349,_0x20dbfd,_0x19fdb5){return new BPromise(function(_0x2bb22b,_0x235e82){return client[_0xd847('0xa')](_0x5f3349,_0x19fdb5)[_0xd847('0xb')](function(_0x17cb36){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x20dbfd,'request\x20sent');logger['debug'](_0xd847('0xc'),_0x20dbfd,_0xd847('0xd'),JSON[_0xd847('0xe')](_0x17cb36));if(_0x17cb36['error']){if(_0x17cb36['error'][_0xd847('0xf')]===0x1f4){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x235e82(_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);}logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x2bb22b(_0x17cb36['error'][_0xd847('0x12')]);}else{logger[_0xd847('0x13')](_0xd847('0x11'),_0x20dbfd,_0xd847('0xd'));_0x2bb22b(_0x17cb36[_0xd847('0x14')]['message']);}})[_0xd847('0x15')](function(_0x3e1e1c){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x3e1e1c);_0x235e82(_0x3e1e1c);});});} \ No newline at end of file +var _0x7980=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b06a4,_0x5f53c1){var _0x34bfff=function(_0x160a07){while(--_0x160a07){_0x3b06a4['push'](_0x3b06a4['shift']());}};_0x34bfff(++_0x5f53c1);}(_0x7980,0xab));var _0x0798=function(_0x46557a,_0x4a09b1){_0x46557a=_0x46557a-0x0;var _0x5d2cea=_0x7980[_0x46557a];return _0x5d2cea;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7834a5f..07f01f3 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 _0xd146=['isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','multer','path','connect-timeout','Router','../../components/interaction/service','./analyticDefaultReport.controller','get','/:id'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0xd146,0x6a));var _0x6d14=function(_0x404740,_0x3b1a7c){_0x404740=_0x404740-0x0;var _0x332fea=_0xd146[_0x404740];return _0x332fea;};'use strict';var multer=require(_0x6d14('0x0'));var util=require('util');var path=require(_0x6d14('0x1'));var timeout=require(_0x6d14('0x2'));var express=require('express');var router=express[_0x6d14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6d14('0x4'));var config=require('../../config/environment');var controller=require(_0x6d14('0x5'));router[_0x6d14('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d14('0x6')](_0x6d14('0x7'),auth[_0x6d14('0x8')](),controller['show']);router['get'](_0x6d14('0x9'),auth[_0x6d14('0x8')](),controller['preview']);router['get'](_0x6d14('0xa'),auth[_0x6d14('0x8')](),controller[_0x6d14('0xb')]);router[_0x6d14('0x6')](_0x6d14('0xc'),auth[_0x6d14('0x8')](),controller[_0x6d14('0xd')]);router[_0x6d14('0xe')]('/',auth[_0x6d14('0x8')](),controller[_0x6d14('0xf')]);router[_0x6d14('0x10')](_0x6d14('0x7'),auth['isAuthenticated'](),controller[_0x6d14('0x11')]);router[_0x6d14('0x12')](_0x6d14('0x7'),auth[_0x6d14('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc6b3=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xc6b3,0x19c));var _0x3c6b=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0xc6b3[_0x277107];return _0x1da046;};'use strict';var multer=require('multer');var util=require(_0x3c6b('0x0'));var path=require(_0x3c6b('0x1'));var timeout=require(_0x3c6b('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3c6b('0x3'));var interaction=require(_0x3c6b('0x4'));var config=require(_0x3c6b('0x5'));var controller=require(_0x3c6b('0x6'));router[_0x3c6b('0x7')]('/',auth[_0x3c6b('0x8')](),controller[_0x3c6b('0x9')]);router[_0x3c6b('0x7')]('/:id',auth[_0x3c6b('0x8')](),controller['show']);router['get'](_0x3c6b('0xa'),auth[_0x3c6b('0x8')](),controller[_0x3c6b('0xb')]);router[_0x3c6b('0x7')](_0x3c6b('0xc'),auth[_0x3c6b('0x8')](),controller[_0x3c6b('0xd')]);router[_0x3c6b('0x7')](_0x3c6b('0xe'),auth[_0x3c6b('0x8')](),controller[_0x3c6b('0xf')]);router[_0x3c6b('0x10')]('/',auth[_0x3c6b('0x8')](),controller['create']);router[_0x3c6b('0x11')](_0x3c6b('0x12'),auth[_0x3c6b('0x8')](),controller['update']);router[_0x3c6b('0x13')](_0x3c6b('0x12'),auth[_0x3c6b('0x8')](),controller[_0x3c6b('0x14')]);module[_0x3c6b('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 85d5bfe..2054e0a 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 _0x397c=['pdf','xlsx','DATE','Loading','manual','INTEGER','sequelize','exports','STRING','ENUM','csv'];(function(_0x1591a7,_0x105f98){var _0x1085f4=function(_0x2ced1b){while(--_0x2ced1b){_0x1591a7['push'](_0x1591a7['shift']());}};_0x1085f4(++_0x105f98);}(_0x397c,0x166));var _0xc397=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x397c[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require(_0xc397('0x0'));var moment=require('moment');module[_0xc397('0x1')]={'name':{'type':Sequelize[_0xc397('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc397('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc397('0x3')](_0xc397('0x4'),_0xc397('0x5'),_0xc397('0x6')),'allowNull':![],'defaultValue':_0xc397('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc397('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xc397('0x2')],'defaultValue':_0xc397('0x8')},'type':{'type':Sequelize[_0xc397('0x3')](_0xc397('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xc397('0x9')},'reportId':{'type':Sequelize[_0xc397('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xc397('0x2')]}}; \ No newline at end of file +var _0x346f=['manual','scheduled','UNSIGNED','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x57ac75,_0x188093){var _0x553e55=function(_0x5b4341){while(--_0x5b4341){_0x57ac75['push'](_0x57ac75['shift']());}};_0x553e55(++_0x188093);}(_0x346f,0xcb));var _0xf346=function(_0x1e5836,_0x4f9e1d){_0x1e5836=_0x1e5836-0x0;var _0x1086bd=_0x346f[_0x1e5836];return _0x1086bd;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf346('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xf346('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xf346('0x2')](_0xf346('0x3'),_0xf346('0x4'),_0xf346('0x5')),'allowNull':![],'defaultValue':_0xf346('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xf346('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xf346('0x2')](_0xf346('0x7'),_0xf346('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xf346('0x9')]},'reportType':{'type':Sequelize[_0xf346('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 45180af..86fb4c1 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 _0xbb55=['ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','body','params','download','basename','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','exists','root','format','%s.%s','toLowerCase','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','update','then','destroy','get'];(function(_0x5a64eb,_0x286782){var _0x3ad930=function(_0x36a52f){while(--_0x36a52f){_0x5a64eb['push'](_0x5a64eb['shift']());}};_0x3ad930(++_0x286782);}(_0xbb55,0xf5));var _0x5bb5=function(_0x595120,_0x49b23e){_0x595120=_0x595120-0x0;var _0x1e20c0=_0xbb55[_0x595120];return _0x1e20c0;};'use strict';var pdf=require(_0x5bb5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5bb5('0x1'));var zipdir=require(_0x5bb5('0x2'));var jsonpatch=require(_0x5bb5('0x3'));var rp=require('request-promise');var moment=require(_0x5bb5('0x4'));var BPromise=require(_0x5bb5('0x5'));var Mustache=require('mustache');var util=require(_0x5bb5('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5bb5('0x7'));var fs=require('fs');var _=require(_0x5bb5('0x8'));var squel=require(_0x5bb5('0x9'));var crypto=require(_0x5bb5('0xa'));var jsforce=require(_0x5bb5('0xb'));var deskjs=require(_0x5bb5('0xc'));var toCsv=require(_0x5bb5('0xd'));var querystring=require(_0x5bb5('0xe'));var Papa=require(_0x5bb5('0xf'));var Redis=require(_0x5bb5('0x10'));var authService=require(_0x5bb5('0x11'));var qs=require(_0x5bb5('0x12'));var as=require(_0x5bb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bb5('0x14'))(_0x5bb5('0x15'));var utils=require(_0x5bb5('0x16'));var config=require(_0x5bb5('0x17'));var db=require(_0x5bb5('0x18'))['db'];function respondWithStatusCode(_0x280d52,_0x1e7ff4){_0x1e7ff4=_0x1e7ff4||0xcc;return function(_0x56ad9f){if(_0x56ad9f){return _0x280d52[_0x5bb5('0x19')](_0x1e7ff4);}return _0x280d52[_0x5bb5('0x1a')](_0x1e7ff4)[_0x5bb5('0x1b')]();};}function respondWithResult(_0x3e6e0e,_0x4fd58e){_0x4fd58e=_0x4fd58e||0xc8;return function(_0x559491){if(_0x559491){return _0x3e6e0e[_0x5bb5('0x1a')](_0x4fd58e)[_0x5bb5('0x1c')](_0x559491);}};}function respondWithFilteredResult(_0x52abc4,_0x2b28a1){return function(_0x56eff4){if(_0x56eff4){var _0x5d83b9=_0x56eff4['count'],_0x1c1818=_0x2b28a1['offset'],_0x176b54=_0x2b28a1[_0x5bb5('0x1d')]+_0x2b28a1[_0x5bb5('0x1e')],_0x18c508;if(_0x176b54>=_0x5d83b9){_0x176b54=_0x5d83b9;_0x18c508=0xc8;}else{_0x18c508=0xce;}_0x52abc4['status'](_0x18c508);return _0x52abc4[_0x5bb5('0x1f')](_0x5bb5('0x20'),_0x1c1818+'-'+_0x176b54+'/'+_0x5d83b9)[_0x5bb5('0x1c')](_0x56eff4);}return null;};}function patchUpdates(_0x1606f2){return function(_0x1f1b8c){try{jsonpatch['apply'](_0x1f1b8c,_0x1606f2,!![]);}catch(_0x1c6f4b){return BPromise['reject'](_0x1c6f4b);}return _0x1f1b8c['save']();};}function saveUpdates(_0x511205,_0x29c173){return function(_0x17c13d){if(_0x17c13d){return _0x17c13d[_0x5bb5('0x21')](_0x511205)[_0x5bb5('0x22')](function(_0x3a4ea8){return _0x3a4ea8;});}return null;};}function removeEntity(_0x4ca6d3,_0x1ace41){return function(_0x2d5060){if(_0x2d5060){return _0x2d5060[_0x5bb5('0x23')]()['then'](function(){var _0x40d332=_0x2d5060[_0x5bb5('0x24')]({'plain':!![]});var _0x36a831=_0x5bb5('0x25');return db[_0x5bb5('0x26')][_0x5bb5('0x23')]({'where':{'type':_0x36a831,'resourceId':_0x40d332['id']}})[_0x5bb5('0x22')](function(){return _0x2d5060;});})[_0x5bb5('0x22')](function(){_0x4ca6d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x437095,_0x62d8a3){return function(_0x2d93b0){if(!_0x2d93b0){_0x437095[_0x5bb5('0x19')](0x194);}return _0x2d93b0;};}function handleError(_0x3656e0,_0x440549){_0x440549=_0x440549||0x1f4;return function(_0x3e9559){logger[_0x5bb5('0x27')](_0x3e9559[_0x5bb5('0x28')]);if(_0x3e9559[_0x5bb5('0x29')]){delete _0x3e9559['name'];}_0x3656e0[_0x5bb5('0x1a')](_0x440549)[_0x5bb5('0x2a')](_0x3e9559);};}exports['index']=function(_0x436921,_0x445c7a){var _0x732ad1={},_0x535279={},_0x2d6286={'count':0x0,'rows':[]};var _0x454a4f=_[_0x5bb5('0x2b')](db[_0x5bb5('0x2c')][_0x5bb5('0x2d')],function(_0x5367ad){return{'name':_0x5367ad['fieldName'],'type':_0x5367ad[_0x5bb5('0x2e')][_0x5bb5('0x2f')]};});_0x535279[_0x5bb5('0x30')]=_[_0x5bb5('0x2b')](_0x454a4f,_0x5bb5('0x29'));_0x535279[_0x5bb5('0x31')]=_[_0x5bb5('0x32')](_0x436921[_0x5bb5('0x31')]);_0x535279[_0x5bb5('0x33')]=_[_0x5bb5('0x34')](_0x535279[_0x5bb5('0x30')],_0x535279['query']);_0x732ad1[_0x5bb5('0x35')]=_[_0x5bb5('0x34')](_0x535279[_0x5bb5('0x30')],qs[_0x5bb5('0x36')](_0x436921[_0x5bb5('0x31')][_0x5bb5('0x36')]));_0x732ad1['attributes']=_0x732ad1[_0x5bb5('0x35')][_0x5bb5('0x37')]?_0x732ad1['attributes']:_0x535279[_0x5bb5('0x30')];if(!_0x436921[_0x5bb5('0x31')]['hasOwnProperty'](_0x5bb5('0x38'))){_0x732ad1['limit']=qs[_0x5bb5('0x1e')](_0x436921[_0x5bb5('0x31')]['limit']);_0x732ad1['offset']=qs['offset'](_0x436921[_0x5bb5('0x31')][_0x5bb5('0x1d')]);}_0x732ad1['order']=qs[_0x5bb5('0x39')](_0x436921['query'][_0x5bb5('0x39')]);_0x732ad1[_0x5bb5('0x3a')]=qs[_0x5bb5('0x33')](_[_0x5bb5('0x3b')](_0x436921[_0x5bb5('0x31')],_0x535279[_0x5bb5('0x33')]));if(_0x436921[_0x5bb5('0x31')]['filter']){_0x732ad1['where']=_[_0x5bb5('0x3c')](_0x732ad1[_0x5bb5('0x3a')],{'$or':_[_0x5bb5('0x2b')](_0x454a4f,function(_0x3992b5){if(_0x3992b5[_0x5bb5('0x2e')]!==_0x5bb5('0x3d')){var _0x404ec9={};_0x404ec9[_0x3992b5[_0x5bb5('0x29')]]={'$like':'%'+_0x436921[_0x5bb5('0x31')][_0x5bb5('0x3e')]+'%'};return _0x404ec9;}})});}_0x732ad1=_[_0x5bb5('0x3c')]({},_0x732ad1,_0x436921[_0x5bb5('0x3f')]);var _0x2d6052={'where':_0x732ad1[_0x5bb5('0x3a')]};return db[_0x5bb5('0x2c')][_0x5bb5('0x40')](_0x2d6052)[_0x5bb5('0x22')](function(_0xdb5841){_0x2d6286['count']=_0xdb5841;if(_0x436921[_0x5bb5('0x31')][_0x5bb5('0x41')]){_0x732ad1[_0x5bb5('0x42')]=[{'all':!![]}];}return db[_0x5bb5('0x2c')][_0x5bb5('0x43')](_0x732ad1);})['then'](function(_0x5a2600){_0x2d6286[_0x5bb5('0x44')]=_0x5a2600;return _0x2d6286;})[_0x5bb5('0x22')](respondWithFilteredResult(_0x445c7a,_0x732ad1))[_0x5bb5('0x45')](handleError(_0x445c7a,null));};exports[_0x5bb5('0x46')]=function(_0x3e2fed,_0x54935e){var _0x49920f={'raw':!![],'where':{'id':_0x3e2fed['params']['id']}},_0x24699e={};_0x24699e[_0x5bb5('0x30')]=_[_0x5bb5('0x32')](db[_0x5bb5('0x2c')][_0x5bb5('0x2d')]);_0x24699e[_0x5bb5('0x31')]=_[_0x5bb5('0x32')](_0x3e2fed[_0x5bb5('0x31')]);_0x24699e[_0x5bb5('0x33')]=_[_0x5bb5('0x34')](_0x24699e['model'],_0x24699e[_0x5bb5('0x31')]);_0x49920f[_0x5bb5('0x35')]=_[_0x5bb5('0x34')](_0x24699e['model'],qs[_0x5bb5('0x36')](_0x3e2fed[_0x5bb5('0x31')]['fields']));_0x49920f[_0x5bb5('0x35')]=_0x49920f[_0x5bb5('0x35')]['length']?_0x49920f[_0x5bb5('0x35')]:_0x24699e[_0x5bb5('0x30')];if(_0x3e2fed[_0x5bb5('0x31')][_0x5bb5('0x41')]){_0x49920f['include']=[{'all':!![]}];}_0x49920f=_[_0x5bb5('0x3c')]({},_0x49920f,_0x3e2fed[_0x5bb5('0x3f')]);return db[_0x5bb5('0x2c')]['find'](_0x49920f)[_0x5bb5('0x22')](handleEntityNotFound(_0x54935e,null))[_0x5bb5('0x22')](respondWithResult(_0x54935e,null))[_0x5bb5('0x45')](handleError(_0x54935e,null));};exports[_0x5bb5('0x47')]=function(_0x18e8e4,_0x3a140b){return db[_0x5bb5('0x2c')][_0x5bb5('0x47')](_0x18e8e4['body'],{})['then'](function(_0x3316da){var _0x1b8931=_0x18e8e4['user'][_0x5bb5('0x24')]({'plain':!![]});if(!_0x1b8931)throw new Error(_0x5bb5('0x48'));if(_0x1b8931[_0x5bb5('0x49')]===_0x5bb5('0x4a')){var _0x58f01a=_0x3316da[_0x5bb5('0x24')]({'plain':!![]});var _0x1458c8=_0x5bb5('0x25');return db[_0x5bb5('0x4b')][_0x5bb5('0x4c')]({'where':{'name':_0x1458c8,'userProfileId':_0x1b8931[_0x5bb5('0x4d')]},'raw':!![]})[_0x5bb5('0x22')](function(_0x421e3d){if(_0x421e3d&&_0x421e3d[_0x5bb5('0x4e')]===0x0){return db[_0x5bb5('0x26')][_0x5bb5('0x47')]({'name':_0x58f01a[_0x5bb5('0x29')],'resourceId':_0x58f01a['id'],'type':_0x421e3d[_0x5bb5('0x29')],'sectionId':_0x421e3d['id']},{})[_0x5bb5('0x22')](function(){return _0x3316da;});}else{return _0x3316da;}})['catch'](function(_0x1948dd){logger[_0x5bb5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1948dd);throw _0x1948dd;});}return _0x3316da;})['then'](respondWithResult(_0x3a140b,0xc9))[_0x5bb5('0x45')](handleError(_0x3a140b,null));};exports[_0x5bb5('0x21')]=function(_0x1d8e7b,_0x55892a){if(_0x1d8e7b[_0x5bb5('0x4f')]['id']){delete _0x1d8e7b[_0x5bb5('0x4f')]['id'];}return db[_0x5bb5('0x2c')][_0x5bb5('0x4c')]({'where':{'id':_0x1d8e7b[_0x5bb5('0x50')]['id']}})[_0x5bb5('0x22')](handleEntityNotFound(_0x55892a,null))[_0x5bb5('0x22')](saveUpdates(_0x1d8e7b[_0x5bb5('0x4f')],null))['then'](respondWithResult(_0x55892a,null))['catch'](handleError(_0x55892a,null));};exports['destroy']=function(_0x90074d,_0x3758c9){return db[_0x5bb5('0x2c')]['find']({'where':{'id':_0x90074d[_0x5bb5('0x50')]['id']}})[_0x5bb5('0x22')](handleEntityNotFound(_0x3758c9,null))[_0x5bb5('0x22')](removeEntity(_0x3758c9,null))['catch'](handleError(_0x3758c9,null));};exports[_0x5bb5('0x51')]=function(_0x1dc47c,_0x327d56,_0x9522e3){return db[_0x5bb5('0x2c')][_0x5bb5('0x4c')]({'where':{'id':_0x1dc47c[_0x5bb5('0x50')]['id']},'attributes':['name',_0x5bb5('0x52'),_0x5bb5('0x53'),_0x5bb5('0x54')],'raw':!![]})[_0x5bb5('0x22')](handleEntityNotFound(_0x327d56,null))['then'](function(_0x1c80f6){if(_0x1c80f6){if(!fs[_0x5bb5('0x55')](path['join'](config['root'],_0x5bb5('0x56'),_0x1c80f6['savename']))){throw new db[(_0x5bb5('0x57'))][(_0x5bb5('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1dc47c[_0x5bb5('0x31')][_0x5bb5('0x59')]){return _0x327d56[_0x5bb5('0x19')](0xc8);}return _0x327d56['download'](path['join'](config[_0x5bb5('0x5a')],_0x5bb5('0x56'),_0x1c80f6['savename']),util[_0x5bb5('0x5b')](_0x5bb5('0x5c'),_0x1c80f6[_0x5bb5('0x52')]||_0x1c80f6['name'],_0x1c80f6[_0x5bb5('0x54')][_0x5bb5('0x5d')]()));}})[_0x5bb5('0x45')](handleError(_0x327d56,null));}; \ No newline at end of file +var _0x3bfd=['exists','root','format','%s.%s','basename','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','VIRTUAL','filter','merge','findAll','rows','catch','params','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3bfd,0x185));var _0xd3bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bfd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd3bf('0x0'));var emlformat=require(_0xd3bf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd3bf('0x2'));var jsonpatch=require(_0xd3bf('0x3'));var rp=require(_0xd3bf('0x4'));var moment=require(_0xd3bf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd3bf('0x6'));var util=require(_0xd3bf('0x7'));var path=require(_0xd3bf('0x8'));var sox=require(_0xd3bf('0x9'));var csv=require(_0xd3bf('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd3bf('0xb'));var squel=require(_0xd3bf('0xc'));var crypto=require(_0xd3bf('0xd'));var jsforce=require(_0xd3bf('0xe'));var deskjs=require(_0xd3bf('0xf'));var toCsv=require(_0xd3bf('0xa'));var querystring=require(_0xd3bf('0x10'));var Papa=require(_0xd3bf('0x11'));var Redis=require(_0xd3bf('0x12'));var authService=require(_0xd3bf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd3bf('0x14'));var hardwareService=require(_0xd3bf('0x15'));var logger=require(_0xd3bf('0x16'))(_0xd3bf('0x17'));var utils=require('../../config/utils');var config=require(_0xd3bf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9ecf4,_0x55907e){_0x55907e=_0x55907e||0xcc;return function(_0x596ce0){if(_0x596ce0){return _0x9ecf4[_0xd3bf('0x19')](_0x55907e);}return _0x9ecf4['status'](_0x55907e)[_0xd3bf('0x1a')]();};}function respondWithResult(_0x211c3e,_0x3cd198){_0x3cd198=_0x3cd198||0xc8;return function(_0x310405){if(_0x310405){return _0x211c3e[_0xd3bf('0x1b')](_0x3cd198)[_0xd3bf('0x1c')](_0x310405);}};}function respondWithFilteredResult(_0x5c2018,_0x3e17ed){return function(_0x4e7e16){if(_0x4e7e16){var _0x35157c=_0x4e7e16[_0xd3bf('0x1d')],_0x58d8f6=_0x3e17ed[_0xd3bf('0x1e')],_0x26432d=_0x3e17ed[_0xd3bf('0x1e')]+_0x3e17ed[_0xd3bf('0x1f')],_0x5d2862;if(_0x26432d>=_0x35157c){_0x26432d=_0x35157c;_0x5d2862=0xc8;}else{_0x5d2862=0xce;}_0x5c2018[_0xd3bf('0x1b')](_0x5d2862);return _0x5c2018[_0xd3bf('0x20')](_0xd3bf('0x21'),_0x58d8f6+'-'+_0x26432d+'/'+_0x35157c)[_0xd3bf('0x1c')](_0x4e7e16);}return null;};}function patchUpdates(_0x290752){return function(_0x2c015c){try{jsonpatch[_0xd3bf('0x22')](_0x2c015c,_0x290752,!![]);}catch(_0x77bb5d){return BPromise['reject'](_0x77bb5d);}return _0x2c015c[_0xd3bf('0x23')]();};}function saveUpdates(_0x48b37e,_0x500cb3){return function(_0x42c9f6){if(_0x42c9f6){return _0x42c9f6[_0xd3bf('0x24')](_0x48b37e)[_0xd3bf('0x25')](function(_0x52c5d5){return _0x52c5d5;});}return null;};}function removeEntity(_0x146e95,_0x43b224){return function(_0x353561){if(_0x353561){return _0x353561[_0xd3bf('0x26')]()[_0xd3bf('0x25')](function(){var _0x4eebb8=_0x353561[_0xd3bf('0x27')]({'plain':!![]});var _0x4a289a='ExtractedReports';return db['UserProfileResource'][_0xd3bf('0x26')]({'where':{'type':_0x4a289a,'resourceId':_0x4eebb8['id']}})[_0xd3bf('0x25')](function(){return _0x353561;});})[_0xd3bf('0x25')](function(){_0x146e95[_0xd3bf('0x1b')](0xcc)[_0xd3bf('0x1a')]();});}};}function handleEntityNotFound(_0x621702,_0x263d89){return function(_0x1fb9a8){if(!_0x1fb9a8){_0x621702[_0xd3bf('0x19')](0x194);}return _0x1fb9a8;};}function handleError(_0x1a8e64,_0x29819e){_0x29819e=_0x29819e||0x1f4;return function(_0x368205){logger['error'](_0x368205[_0xd3bf('0x28')]);if(_0x368205[_0xd3bf('0x29')]){delete _0x368205[_0xd3bf('0x29')];}_0x1a8e64[_0xd3bf('0x1b')](_0x29819e)[_0xd3bf('0x2a')](_0x368205);};}exports[_0xd3bf('0x2b')]=function(_0x486c0c,_0x53126c){var _0x2c6949={},_0x449104={},_0x428b11={'count':0x0,'rows':[]};var _0xe33460=_[_0xd3bf('0x2c')](db[_0xd3bf('0x2d')][_0xd3bf('0x2e')],function(_0x19ac3e){return{'name':_0x19ac3e['fieldName'],'type':_0x19ac3e[_0xd3bf('0x2f')][_0xd3bf('0x30')]};});_0x449104[_0xd3bf('0x31')]=_[_0xd3bf('0x2c')](_0xe33460,_0xd3bf('0x29'));_0x449104[_0xd3bf('0x32')]=_[_0xd3bf('0x33')](_0x486c0c[_0xd3bf('0x32')]);_0x449104[_0xd3bf('0x34')]=_[_0xd3bf('0x35')](_0x449104[_0xd3bf('0x31')],_0x449104[_0xd3bf('0x32')]);_0x2c6949[_0xd3bf('0x36')]=_[_0xd3bf('0x35')](_0x449104[_0xd3bf('0x31')],qs[_0xd3bf('0x37')](_0x486c0c['query'][_0xd3bf('0x37')]));_0x2c6949['attributes']=_0x2c6949[_0xd3bf('0x36')]['length']?_0x2c6949[_0xd3bf('0x36')]:_0x449104[_0xd3bf('0x31')];if(!_0x486c0c[_0xd3bf('0x32')][_0xd3bf('0x38')]('nolimit')){_0x2c6949['limit']=qs[_0xd3bf('0x1f')](_0x486c0c[_0xd3bf('0x32')][_0xd3bf('0x1f')]);_0x2c6949[_0xd3bf('0x1e')]=qs[_0xd3bf('0x1e')](_0x486c0c[_0xd3bf('0x32')][_0xd3bf('0x1e')]);}_0x2c6949[_0xd3bf('0x39')]=qs['sort'](_0x486c0c[_0xd3bf('0x32')]['sort']);_0x2c6949[_0xd3bf('0x3a')]=qs['filters'](_[_0xd3bf('0x3b')](_0x486c0c['query'],_0x449104[_0xd3bf('0x34')]));if(_0x486c0c['query']['filter']){_0x2c6949[_0xd3bf('0x3a')]=_['merge'](_0x2c6949[_0xd3bf('0x3a')],{'$or':_['map'](_0xe33460,function(_0x29d287){if(_0x29d287['type']!==_0xd3bf('0x3c')){var _0x4a2821={};_0x4a2821[_0x29d287[_0xd3bf('0x29')]]={'$like':'%'+_0x486c0c['query'][_0xd3bf('0x3d')]+'%'};return _0x4a2821;}})});}_0x2c6949=_[_0xd3bf('0x3e')]({},_0x2c6949,_0x486c0c['options']);var _0x2bd028={'where':_0x2c6949[_0xd3bf('0x3a')]};return db[_0xd3bf('0x2d')][_0xd3bf('0x1d')](_0x2bd028)[_0xd3bf('0x25')](function(_0x9db570){_0x428b11['count']=_0x9db570;if(_0x486c0c['query']['includeAll']){_0x2c6949['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xd3bf('0x3f')](_0x2c6949);})[_0xd3bf('0x25')](function(_0x24dc5c){_0x428b11[_0xd3bf('0x40')]=_0x24dc5c;return _0x428b11;})[_0xd3bf('0x25')](respondWithFilteredResult(_0x53126c,_0x2c6949))[_0xd3bf('0x41')](handleError(_0x53126c,null));};exports['show']=function(_0x5e7357,_0x43a4b0){var _0x124698={'raw':!![],'where':{'id':_0x5e7357[_0xd3bf('0x42')]['id']}},_0x2bae0d={};_0x2bae0d[_0xd3bf('0x31')]=_[_0xd3bf('0x33')](db[_0xd3bf('0x2d')][_0xd3bf('0x2e')]);_0x2bae0d[_0xd3bf('0x32')]=_['keys'](_0x5e7357[_0xd3bf('0x32')]);_0x2bae0d[_0xd3bf('0x34')]=_[_0xd3bf('0x35')](_0x2bae0d[_0xd3bf('0x31')],_0x2bae0d[_0xd3bf('0x32')]);_0x124698[_0xd3bf('0x36')]=_['intersection'](_0x2bae0d[_0xd3bf('0x31')],qs[_0xd3bf('0x37')](_0x5e7357[_0xd3bf('0x32')][_0xd3bf('0x37')]));_0x124698['attributes']=_0x124698['attributes'][_0xd3bf('0x43')]?_0x124698[_0xd3bf('0x36')]:_0x2bae0d[_0xd3bf('0x31')];if(_0x5e7357[_0xd3bf('0x32')]['includeAll']){_0x124698[_0xd3bf('0x44')]=[{'all':!![]}];}_0x124698=_[_0xd3bf('0x3e')]({},_0x124698,_0x5e7357[_0xd3bf('0x45')]);return db['AnalyticExtractedReport'][_0xd3bf('0x46')](_0x124698)['then'](handleEntityNotFound(_0x43a4b0,null))['then'](respondWithResult(_0x43a4b0,null))[_0xd3bf('0x41')](handleError(_0x43a4b0,null));};exports[_0xd3bf('0x47')]=function(_0x11f512,_0x1aee1a){return db[_0xd3bf('0x2d')][_0xd3bf('0x47')](_0x11f512[_0xd3bf('0x48')],{})['then'](function(_0x268bc5){var _0x41b6c2=_0x11f512[_0xd3bf('0x49')][_0xd3bf('0x27')]({'plain':!![]});if(!_0x41b6c2)throw new Error(_0xd3bf('0x4a'));if(_0x41b6c2[_0xd3bf('0x4b')]===_0xd3bf('0x49')){var _0x5d11cf=_0x268bc5[_0xd3bf('0x27')]({'plain':!![]});var _0x284797=_0xd3bf('0x4c');return db[_0xd3bf('0x4d')][_0xd3bf('0x46')]({'where':{'name':_0x284797,'userProfileId':_0x41b6c2[_0xd3bf('0x4e')]},'raw':!![]})[_0xd3bf('0x25')](function(_0xa5b52c){if(_0xa5b52c&&_0xa5b52c[_0xd3bf('0x4f')]===0x0){return db[_0xd3bf('0x50')][_0xd3bf('0x47')]({'name':_0x5d11cf[_0xd3bf('0x29')],'resourceId':_0x5d11cf['id'],'type':_0xa5b52c[_0xd3bf('0x29')],'sectionId':_0xa5b52c['id']},{})[_0xd3bf('0x25')](function(){return _0x268bc5;});}else{return _0x268bc5;}})[_0xd3bf('0x41')](function(_0x5c8e45){logger[_0xd3bf('0x51')](_0xd3bf('0x52'),_0x5c8e45);throw _0x5c8e45;});}return _0x268bc5;})[_0xd3bf('0x25')](respondWithResult(_0x1aee1a,0xc9))[_0xd3bf('0x41')](handleError(_0x1aee1a,null));};exports['update']=function(_0x18d86f,_0x32cd33){if(_0x18d86f['body']['id']){delete _0x18d86f[_0xd3bf('0x48')]['id'];}return db[_0xd3bf('0x2d')][_0xd3bf('0x46')]({'where':{'id':_0x18d86f[_0xd3bf('0x42')]['id']}})[_0xd3bf('0x25')](handleEntityNotFound(_0x32cd33,null))[_0xd3bf('0x25')](saveUpdates(_0x18d86f[_0xd3bf('0x48')],null))[_0xd3bf('0x25')](respondWithResult(_0x32cd33,null))[_0xd3bf('0x41')](handleError(_0x32cd33,null));};exports['destroy']=function(_0x2dbef8,_0xcbfc43){return db['AnalyticExtractedReport'][_0xd3bf('0x46')]({'where':{'id':_0x2dbef8['params']['id']}})[_0xd3bf('0x25')](handleEntityNotFound(_0xcbfc43,null))[_0xd3bf('0x25')](removeEntity(_0xcbfc43,null))[_0xd3bf('0x41')](handleError(_0xcbfc43,null));};exports[_0xd3bf('0x53')]=function(_0x3d70e2,_0x286c39,_0x272987){return db[_0xd3bf('0x2d')]['find']({'where':{'id':_0x3d70e2[_0xd3bf('0x42')]['id']},'attributes':[_0xd3bf('0x29'),'basename',_0xd3bf('0x54'),_0xd3bf('0x55')],'raw':!![]})[_0xd3bf('0x25')](handleEntityNotFound(_0x286c39,null))[_0xd3bf('0x25')](function(_0x404899){if(_0x404899){if(!fs[_0xd3bf('0x56')](path[_0xd3bf('0x57')](config['root'],_0xd3bf('0x58'),_0x404899[_0xd3bf('0x54')]))){throw new db[(_0xd3bf('0x59'))]['ValidationError'](_0xd3bf('0x5a'));}if(_0x3d70e2[_0xd3bf('0x32')][_0xd3bf('0x5b')]){return _0x286c39[_0xd3bf('0x19')](0xc8);}return _0x286c39['download'](path[_0xd3bf('0x57')](config[_0xd3bf('0x5c')],_0xd3bf('0x58'),_0x404899[_0xd3bf('0x54')]),util[_0xd3bf('0x5d')](_0xd3bf('0x5e'),_0x404899[_0xd3bf('0x5f')]||_0x404899[_0xd3bf('0x29')],_0x404899[_0xd3bf('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x286c39,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f3b77b9..b988a44 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 _0xb4ac=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger'];(function(_0x5823a7,_0x3cc2d7){var _0x4f1d86=function(_0x26ff02){while(--_0x26ff02){_0x5823a7['push'](_0x5823a7['shift']());}};_0x4f1d86(++_0x3cc2d7);}(_0xb4ac,0x11c));var _0xcb4a=function(_0x5174e4,_0x9e7a57){_0x5174e4=_0x5174e4-0x0;var _0x52f449=_0xb4ac[_0x5174e4];return _0x52f449;};'use strict';var _=require('lodash');var util=require(_0xcb4a('0x0'));var logger=require(_0xcb4a('0x1'))(_0xcb4a('0x2'));var moment=require('moment');var BPromise=require(_0xcb4a('0x3'));var rp=require(_0xcb4a('0x4'));var fs=require('fs');var path=require(_0xcb4a('0x5'));var rimraf=require(_0xcb4a('0x6'));var config=require(_0xcb4a('0x7'));var attributes=require(_0xcb4a('0x8'));module[_0xcb4a('0x9')]=function(_0x434b9e,_0x21ce00){return _0x434b9e[_0xcb4a('0xa')](_0xcb4a('0xb'),attributes,{'tableName':_0xcb4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd90=['request-promise','../../config/environment','exports','define','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0xbd90,0x155));var _0x0bd9=function(_0x937011,_0x3fca23){_0x937011=_0x937011-0x0;var _0x570452=_0xbd90[_0x937011];return _0x570452;};'use strict';var _=require('lodash');var util=require(_0x0bd9('0x0'));var logger=require(_0x0bd9('0x1'))(_0x0bd9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0bd9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0bd9('0x4'));var attributes=require('./analyticExtractedReport.attributes');module[_0x0bd9('0x5')]=function(_0x4d5ea3,_0x5d7306){return _0x4d5ea3[_0x0bd9('0x6')]('AnalyticExtractedReport',attributes,{'tableName':_0x0bd9('0x7'),'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 9adafbe..915e6f6 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 _0x4f4f=['result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','code','error','AnalyticExtractedReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x44f7a3,_0x1dc8b4){var _0x1fca6d=function(_0xf70f48){while(--_0xf70f48){_0x44f7a3['push'](_0x44f7a3['shift']());}};_0x1fca6d(++_0x1dc8b4);}(_0x4f4f,0x1a6));var _0xf4f4=function(_0x29740e,_0x200cc1){_0x29740e=_0x29740e-0x0;var _0x89660b=_0x4f4f[_0x29740e];return _0x89660b;};'use strict';var _=require('lodash');var util=require(_0xf4f4('0x0'));var moment=require('moment');var BPromise=require(_0xf4f4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f4('0x2'));var db=require(_0xf4f4('0x3'))['db'];var utils=require(_0xf4f4('0x4'));var logger=require('../../config/logger')(_0xf4f4('0x5'));var config=require(_0xf4f4('0x6'));var jayson=require(_0xf4f4('0x7'));var client=jayson[_0xf4f4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5310b8,_0x2231d1,_0x362190){return new BPromise(function(_0x3d14b8,_0x504f36){return client[_0xf4f4('0x9')](_0x5310b8,_0x362190)[_0xf4f4('0xa')](function(_0xf202c0){logger[_0xf4f4('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2231d1,'request\x20sent');logger[_0xf4f4('0xc')](_0xf4f4('0xd'),_0x2231d1,'request\x20sent',JSON['stringify'](_0xf202c0));if(_0xf202c0['error']){if(_0xf202c0['error'][_0xf4f4('0xe')]===0x1f4){logger[_0xf4f4('0xf')](_0xf4f4('0x10'),_0x2231d1,_0xf202c0[_0xf4f4('0xf')][_0xf4f4('0x11')]);return _0x504f36(_0xf202c0[_0xf4f4('0xf')][_0xf4f4('0x11')]);}logger[_0xf4f4('0xf')](_0xf4f4('0x10'),_0x2231d1,_0xf202c0['error'][_0xf4f4('0x11')]);return _0x3d14b8(_0xf202c0['error'][_0xf4f4('0x11')]);}else{logger[_0xf4f4('0xb')](_0xf4f4('0x10'),_0x2231d1,_0xf4f4('0x12'));_0x3d14b8(_0xf202c0[_0xf4f4('0x13')][_0xf4f4('0x11')]);}})[_0xf4f4('0x14')](function(_0x3855d6){logger[_0xf4f4('0xf')](_0xf4f4('0x10'),_0x2231d1,_0x3855d6);_0x504f36(_0x3855d6);});});} \ No newline at end of file +var _0xa6be=['client','request','then','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1d7ff1,_0x173947){var _0x22c8db=function(_0x1ae291){while(--_0x1ae291){_0x1d7ff1['push'](_0x1d7ff1['shift']());}};_0x22c8db(++_0x173947);}(_0xa6be,0xac));var _0xea6b=function(_0x2bc37f,_0x4cef84){_0x2bc37f=_0x2bc37f-0x0;var _0x2b6cb0=_0xa6be[_0x2bc37f];return _0x2b6cb0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xea6b('0x0'));var rs=require(_0xea6b('0x1'));var fs=require('fs');var Redis=require(_0xea6b('0x2'));var db=require(_0xea6b('0x3'))['db'];var utils=require(_0xea6b('0x4'));var logger=require('../../config/logger')(_0xea6b('0x5'));var config=require(_0xea6b('0x6'));var jayson=require(_0xea6b('0x7'));var client=jayson[_0xea6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb945b,_0x1a5d86,_0x15eb2e){return new BPromise(function(_0x1dd967,_0x55ffb9){return client[_0xea6b('0x9')](_0xb945b,_0x15eb2e)[_0xea6b('0xa')](function(_0x5d8ce8){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a5d86,'request\x20sent');logger['debug'](_0xea6b('0xb'),_0x1a5d86,_0xea6b('0xc'),JSON[_0xea6b('0xd')](_0x5d8ce8));if(_0x5d8ce8[_0xea6b('0xe')]){if(_0x5d8ce8[_0xea6b('0xe')][_0xea6b('0xf')]===0x1f4){logger['error'](_0xea6b('0x10'),_0x1a5d86,_0x5d8ce8[_0xea6b('0xe')][_0xea6b('0x11')]);return _0x55ffb9(_0x5d8ce8['error'][_0xea6b('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a5d86,_0x5d8ce8[_0xea6b('0xe')][_0xea6b('0x11')]);return _0x1dd967(_0x5d8ce8[_0xea6b('0xe')][_0xea6b('0x11')]);}else{logger[_0xea6b('0x12')](_0xea6b('0x10'),_0x1a5d86,'request\x20sent');_0x1dd967(_0x5d8ce8['result'][_0xea6b('0x11')]);}})[_0xea6b('0x13')](function(_0x527378){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a5d86,_0x527378);_0x55ffb9(_0x527378);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b757c82..3adbd47 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 _0x1bf8=['../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x21d2a4,_0x1594cb){var _0x4c51e7=function(_0x5ab1e1){while(--_0x5ab1e1){_0x21d2a4['push'](_0x21d2a4['shift']());}};_0x4c51e7(++_0x1594cb);}(_0x1bf8,0x161));var _0x81bf=function(_0x5ef252,_0x396cf1){_0x5ef252=_0x5ef252-0x0;var _0x469b0e=_0x1bf8[_0x5ef252];return _0x469b0e;};'use strict';var multer=require(_0x81bf('0x0'));var util=require(_0x81bf('0x1'));var path=require(_0x81bf('0x2'));var timeout=require(_0x81bf('0x3'));var express=require(_0x81bf('0x4'));var router=express[_0x81bf('0x5')]();var auth=require(_0x81bf('0x6'));var interaction=require(_0x81bf('0x7'));var config=require('../../config/environment');var controller=require(_0x81bf('0x8'));router[_0x81bf('0x9')]('/',auth[_0x81bf('0xa')](),controller['index']);router['get'](_0x81bf('0xb'),auth[_0x81bf('0xa')](),controller['show']);router['get'](_0x81bf('0xc'),auth[_0x81bf('0xa')](),controller['download']);router['post']('/',auth[_0x81bf('0xa')](),controller[_0x81bf('0xd')]);router[_0x81bf('0xe')](_0x81bf('0xb'),auth[_0x81bf('0xa')](),controller['update']);router[_0x81bf('0xf')](_0x81bf('0xb'),auth[_0x81bf('0xa')](),controller[_0x81bf('0x10')]);module[_0x81bf('0x11')]=router; \ No newline at end of file +var _0x3ea0=['post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','download'];(function(_0x41574f,_0x460a02){var _0x5e770c=function(_0x8ee3e1){while(--_0x8ee3e1){_0x41574f['push'](_0x41574f['shift']());}};_0x5e770c(++_0x460a02);}(_0x3ea0,0x1bb));var _0x03ea=function(_0xc9bc0f,_0x12e2ac){_0xc9bc0f=_0xc9bc0f-0x0;var _0x4aacbc=_0x3ea0[_0xc9bc0f];return _0x4aacbc;};'use strict';var multer=require(_0x03ea('0x0'));var util=require(_0x03ea('0x1'));var path=require('path');var timeout=require(_0x03ea('0x2'));var express=require(_0x03ea('0x3'));var router=express[_0x03ea('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x03ea('0x5'));var config=require(_0x03ea('0x6'));var controller=require(_0x03ea('0x7'));router['get']('/',auth[_0x03ea('0x8')](),controller[_0x03ea('0x9')]);router[_0x03ea('0xa')](_0x03ea('0xb'),auth[_0x03ea('0x8')](),controller['show']);router[_0x03ea('0xa')]('/:id/download',auth[_0x03ea('0x8')](),controller[_0x03ea('0xc')]);router[_0x03ea('0xd')]('/',auth[_0x03ea('0x8')](),controller[_0x03ea('0xe')]);router[_0x03ea('0xf')](_0x03ea('0xb'),auth['isAuthenticated'](),controller[_0x03ea('0x10')]);router['delete']('/:id',auth[_0x03ea('0x8')](),controller[_0x03ea('0x11')]);module[_0x03ea('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 04f1cb6..4a882e4 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 _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x5ac1ae,_0x2bbf6d){var _0x2ca11f=function(_0x1a8b4f){while(--_0x1a8b4f){_0x5ac1ae['push'](_0x5ac1ae['shift']());}};_0x2ca11f(++_0x2bbf6d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe14b=['sequelize','exports','STRING'];(function(_0xeb8aae,_0x5225e3){var _0x1564f8=function(_0x1ca7bb){while(--_0x1ca7bb){_0xeb8aae['push'](_0xeb8aae['shift']());}};_0x1564f8(++_0x5225e3);}(_0xe14b,0x93));var _0xbe14=function(_0x5ac4c8,_0x4bb353){_0x5ac4c8=_0x5ac4c8-0x0;var _0x5f292c=_0xe14b[_0x5ac4c8];return _0x5f292c;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 807c074..04778b5 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 _0xf811=['intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','filters'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0xf811,0x6f));var _0x1f81=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf811[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x1f81('0x0'));var emlformat=require(_0x1f81('0x1'));var rimraf=require(_0x1f81('0x2'));var zipdir=require(_0x1f81('0x3'));var jsonpatch=require(_0x1f81('0x4'));var rp=require(_0x1f81('0x5'));var moment=require(_0x1f81('0x6'));var BPromise=require(_0x1f81('0x7'));var Mustache=require(_0x1f81('0x8'));var util=require(_0x1f81('0x9'));var path=require(_0x1f81('0xa'));var sox=require(_0x1f81('0xb'));var csv=require(_0x1f81('0xc'));var ejs=require(_0x1f81('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1f81('0xe'));var crypto=require(_0x1f81('0xf'));var jsforce=require(_0x1f81('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1f81('0xc'));var querystring=require(_0x1f81('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x13'));var as=require(_0x1f81('0x14'));var hardwareService=require(_0x1f81('0x15'));var logger=require(_0x1f81('0x16'))(_0x1f81('0x17'));var utils=require(_0x1f81('0x18'));var config=require(_0x1f81('0x19'));var db=require(_0x1f81('0x1a'))['db'];function respondWithStatusCode(_0xe81519,_0x111c85){_0x111c85=_0x111c85||0xcc;return function(_0x14851a){if(_0x14851a){return _0xe81519[_0x1f81('0x1b')](_0x111c85);}return _0xe81519[_0x1f81('0x1c')](_0x111c85)[_0x1f81('0x1d')]();};}function respondWithResult(_0x37bc72,_0x247b10){_0x247b10=_0x247b10||0xc8;return function(_0x5a4992){if(_0x5a4992){return _0x37bc72[_0x1f81('0x1c')](_0x247b10)[_0x1f81('0x1e')](_0x5a4992);}};}function respondWithFilteredResult(_0x576001,_0x5e1036){return function(_0x20cea6){if(_0x20cea6){var _0x1a781d=_0x20cea6[_0x1f81('0x1f')],_0x5da9d1=_0x5e1036[_0x1f81('0x20')],_0x3c042c=_0x5e1036['offset']+_0x5e1036['limit'],_0x558761;if(_0x3c042c>=_0x1a781d){_0x3c042c=_0x1a781d;_0x558761=0xc8;}else{_0x558761=0xce;}_0x576001[_0x1f81('0x1c')](_0x558761);return _0x576001[_0x1f81('0x21')]('Content-Range',_0x5da9d1+'-'+_0x3c042c+'/'+_0x1a781d)[_0x1f81('0x1e')](_0x20cea6);}return null;};}function patchUpdates(_0x5310fb){return function(_0x25df22){try{jsonpatch[_0x1f81('0x22')](_0x25df22,_0x5310fb,!![]);}catch(_0x38bd05){return BPromise['reject'](_0x38bd05);}return _0x25df22[_0x1f81('0x23')]();};}function saveUpdates(_0x3f0de8,_0x2d9b8d){return function(_0x3d35bd){if(_0x3d35bd){return _0x3d35bd[_0x1f81('0x24')](_0x3f0de8)[_0x1f81('0x25')](function(_0x5e8577){return _0x5e8577;});}return null;};}function removeEntity(_0x299974,_0x37b6ff){return function(_0x3751d4){if(_0x3751d4){return _0x3751d4['destroy']()['then'](function(){_0x299974[_0x1f81('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13e8c5,_0x4f714a){return function(_0x59c93a){if(!_0x59c93a){_0x13e8c5[_0x1f81('0x1b')](0x194);}return _0x59c93a;};}function handleError(_0x4c8d4a,_0x3d97a3){_0x3d97a3=_0x3d97a3||0x1f4;return function(_0x599b8f){logger[_0x1f81('0x26')](_0x599b8f[_0x1f81('0x27')]);if(_0x599b8f[_0x1f81('0x28')]){delete _0x599b8f[_0x1f81('0x28')];}_0x4c8d4a[_0x1f81('0x1c')](_0x3d97a3)[_0x1f81('0x29')](_0x599b8f);};}exports[_0x1f81('0x2a')]=function(_0x1bd2b3,_0x34bc53){var _0x243bf5={},_0x587636={},_0x292758={'count':0x0,'rows':[]};var _0x5413a1=_[_0x1f81('0x2b')](db[_0x1f81('0x2c')]['rawAttributes'],function(_0x3d547b){return{'name':_0x3d547b[_0x1f81('0x2d')],'type':_0x3d547b[_0x1f81('0x2e')][_0x1f81('0x2f')]};});_0x587636[_0x1f81('0x30')]=_[_0x1f81('0x2b')](_0x5413a1,_0x1f81('0x28'));_0x587636[_0x1f81('0x31')]=_['keys'](_0x1bd2b3[_0x1f81('0x31')]);_0x587636[_0x1f81('0x32')]=_[_0x1f81('0x33')](_0x587636[_0x1f81('0x30')],_0x587636[_0x1f81('0x31')]);_0x243bf5[_0x1f81('0x34')]=_[_0x1f81('0x33')](_0x587636[_0x1f81('0x30')],qs[_0x1f81('0x35')](_0x1bd2b3[_0x1f81('0x31')][_0x1f81('0x35')]));_0x243bf5['attributes']=_0x243bf5[_0x1f81('0x34')][_0x1f81('0x36')]?_0x243bf5[_0x1f81('0x34')]:_0x587636[_0x1f81('0x30')];if(!_0x1bd2b3['query'][_0x1f81('0x37')](_0x1f81('0x38'))){_0x243bf5[_0x1f81('0x39')]=qs['limit'](_0x1bd2b3['query'][_0x1f81('0x39')]);_0x243bf5['offset']=qs[_0x1f81('0x20')](_0x1bd2b3['query'][_0x1f81('0x20')]);}_0x243bf5[_0x1f81('0x3a')]=qs[_0x1f81('0x3b')](_0x1bd2b3[_0x1f81('0x31')][_0x1f81('0x3b')]);_0x243bf5[_0x1f81('0x3c')]=qs[_0x1f81('0x32')](_['pick'](_0x1bd2b3[_0x1f81('0x31')],_0x587636['filters']));if(_0x1bd2b3[_0x1f81('0x31')][_0x1f81('0x3d')]){_0x243bf5['where']=_[_0x1f81('0x3e')](_0x243bf5[_0x1f81('0x3c')],{'$or':_[_0x1f81('0x2b')](_0x5413a1,function(_0x47f78f){if(_0x47f78f[_0x1f81('0x2e')]!==_0x1f81('0x3f')){var _0x42a7eb={};_0x42a7eb[_0x47f78f[_0x1f81('0x28')]]={'$like':'%'+_0x1bd2b3[_0x1f81('0x31')]['filter']+'%'};return _0x42a7eb;}})});}_0x243bf5=_[_0x1f81('0x3e')]({},_0x243bf5,_0x1bd2b3[_0x1f81('0x40')]);var _0x4dd4b3={'where':_0x243bf5['where']};return db['AnalyticFieldReport'][_0x1f81('0x1f')](_0x4dd4b3)[_0x1f81('0x25')](function(_0x500b32){_0x292758['count']=_0x500b32;if(_0x1bd2b3['query'][_0x1f81('0x41')]){_0x243bf5[_0x1f81('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1f81('0x43')](_0x243bf5);})[_0x1f81('0x25')](function(_0x8100d1){_0x292758['rows']=_0x8100d1;return _0x292758;})[_0x1f81('0x25')](respondWithFilteredResult(_0x34bc53,_0x243bf5))[_0x1f81('0x44')](handleError(_0x34bc53,null));};exports[_0x1f81('0x45')]=function(_0x2133b5,_0x2f2d11){var _0xb0d536={'raw':![],'where':{'id':_0x2133b5[_0x1f81('0x46')]['id']}},_0x5ac2a2={};_0x5ac2a2[_0x1f81('0x30')]=_[_0x1f81('0x47')](db[_0x1f81('0x2c')]['rawAttributes']);_0x5ac2a2[_0x1f81('0x31')]=_[_0x1f81('0x47')](_0x2133b5['query']);_0x5ac2a2[_0x1f81('0x32')]=_['intersection'](_0x5ac2a2[_0x1f81('0x30')],_0x5ac2a2['query']);_0xb0d536[_0x1f81('0x34')]=_['intersection'](_0x5ac2a2[_0x1f81('0x30')],qs[_0x1f81('0x35')](_0x2133b5[_0x1f81('0x31')]['fields']));_0xb0d536[_0x1f81('0x34')]=_0xb0d536[_0x1f81('0x34')]['length']?_0xb0d536[_0x1f81('0x34')]:_0x5ac2a2[_0x1f81('0x30')];if(_0x2133b5[_0x1f81('0x31')][_0x1f81('0x41')]){_0xb0d536[_0x1f81('0x42')]=[{'all':!![]}];}_0xb0d536=_[_0x1f81('0x3e')]({},_0xb0d536,_0x2133b5[_0x1f81('0x40')]);return db['AnalyticFieldReport'][_0x1f81('0x48')](_0xb0d536)[_0x1f81('0x25')](handleEntityNotFound(_0x2f2d11,null))['then'](respondWithResult(_0x2f2d11,null))[_0x1f81('0x44')](handleError(_0x2f2d11,null));};exports[_0x1f81('0x49')]=function(_0x230ec1,_0x590b47){return db[_0x1f81('0x2c')][_0x1f81('0x49')](_0x230ec1['body'],{})[_0x1f81('0x25')](respondWithResult(_0x590b47,0xc9))['catch'](handleError(_0x590b47,null));};exports['bulkCreate']=function(_0x19f10d,_0x43f658){return db[_0x1f81('0x2c')]['bulkCreate'](_0x19f10d['body'],{'raw':![],'individualHooks':!![]})[_0x1f81('0x25')](respondWithResult(_0x43f658,0xc9))['catch'](handleError(_0x43f658,null));};exports[_0x1f81('0x24')]=function(_0x388936,_0x40be51){if(_0x388936[_0x1f81('0x4a')]['id']){delete _0x388936[_0x1f81('0x4a')]['id'];}return db['AnalyticFieldReport'][_0x1f81('0x48')]({'where':{'id':_0x388936[_0x1f81('0x46')]['id']}})[_0x1f81('0x25')](handleEntityNotFound(_0x40be51,null))[_0x1f81('0x25')](saveUpdates(_0x388936['body'],null))['then'](respondWithResult(_0x40be51,null))[_0x1f81('0x44')](handleError(_0x40be51,null));};exports[_0x1f81('0x4b')]=function(_0x56beff,_0x475a2d){return db['AnalyticFieldReport'][_0x1f81('0x48')]({'where':{'id':_0x56beff['params']['id']}})[_0x1f81('0x25')](handleEntityNotFound(_0x475a2d,null))['then'](removeEntity(_0x475a2d,null))[_0x1f81('0x44')](handleError(_0x475a2d,null));};exports['bulkDestroy']=function(_0x45729c,_0x374340){return db[_0x1f81('0x2c')]['destroy']({'where':{'id':_0x45729c[_0x1f81('0x31')][_0x1f81('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x1f81('0x25')](respondWithResult(_0x374340,0xcc))[_0x1f81('0x44')](handleError(_0x374340,null));};exports['addFields']=function(_0x5be589,_0xbdddd,_0xd5f5d0){return db[_0x1f81('0x4d')]['findOne']({'where':{'id':_0x5be589[_0x1f81('0x46')]['id']}})['then'](handleEntityNotFound(_0xbdddd,null))[_0x1f81('0x25')](function(_0x4f6895){if(_0x4f6895){return db[_0x1f81('0x4e')][_0x1f81('0x4f')](function(_0x13aca7){return db[_0x1f81('0x2c')][_0x1f81('0x4b')]({'where':{'CustomReportId':_0x5be589[_0x1f81('0x46')]['id']},'transaction':_0x13aca7})[_0x1f81('0x25')](function(_0x4c7ff0){var _0x4a799d=_[_0x1f81('0x2b')](_0x5be589['body'],function(_0x4b6816){delete _0x4b6816['id'];_0x4b6816[_0x1f81('0x50')]=_0x5be589['params']['id'];return _0x4b6816;});return db['AnalyticFieldReport']['bulkCreate'](_0x4a799d,{'transaction':_0x13aca7});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x5be589[_0x1f81('0x46')]['id']}});});}})['then'](respondWithResult(_0xbdddd,null))[_0x1f81('0x44')](handleError(_0xbdddd,null));}; \ No newline at end of file +var _0x6a0b=['merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','update','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','then','destroy','error','stack','name','send','index','AnalyticFieldReport','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter'];(function(_0x3c6dd4,_0xe0d89a){var _0x265d4b=function(_0x135519){while(--_0x135519){_0x3c6dd4['push'](_0x3c6dd4['shift']());}};_0x265d4b(++_0xe0d89a);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x515ef2,_0x19dfa0){_0x515ef2=_0x515ef2-0x0;var _0x564aa7=_0x6a0b[_0x515ef2];return _0x564aa7;};'use strict';var pdf=require(_0xb6a0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb6a0('0x1'));var jsonpatch=require(_0xb6a0('0x2'));var rp=require('request-promise');var moment=require(_0xb6a0('0x3'));var BPromise=require(_0xb6a0('0x4'));var Mustache=require(_0xb6a0('0x5'));var util=require(_0xb6a0('0x6'));var path=require(_0xb6a0('0x7'));var sox=require('sox');var csv=require(_0xb6a0('0x8'));var ejs=require(_0xb6a0('0x9'));var fs=require('fs');var _=require(_0xb6a0('0xa'));var squel=require(_0xb6a0('0xb'));var crypto=require(_0xb6a0('0xc'));var jsforce=require(_0xb6a0('0xd'));var deskjs=require(_0xb6a0('0xe'));var toCsv=require(_0xb6a0('0x8'));var querystring=require(_0xb6a0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6a0('0x10'));var logger=require('../../config/logger')(_0xb6a0('0x11'));var utils=require(_0xb6a0('0x12'));var config=require('../../config/environment');var db=require(_0xb6a0('0x13'))['db'];function respondWithStatusCode(_0x1efc37,_0x22c772){_0x22c772=_0x22c772||0xcc;return function(_0x205531){if(_0x205531){return _0x1efc37[_0xb6a0('0x14')](_0x22c772);}return _0x1efc37[_0xb6a0('0x15')](_0x22c772)[_0xb6a0('0x16')]();};}function respondWithResult(_0x138b6c,_0x453a7e){_0x453a7e=_0x453a7e||0xc8;return function(_0x3f4145){if(_0x3f4145){return _0x138b6c['status'](_0x453a7e)[_0xb6a0('0x17')](_0x3f4145);}};}function respondWithFilteredResult(_0x40b199,_0x32e535){return function(_0x2d41de){if(_0x2d41de){var _0x45a4df=_0x2d41de[_0xb6a0('0x18')],_0x242694=_0x32e535['offset'],_0x374b74=_0x32e535[_0xb6a0('0x19')]+_0x32e535[_0xb6a0('0x1a')],_0xb864a1;if(_0x374b74>=_0x45a4df){_0x374b74=_0x45a4df;_0xb864a1=0xc8;}else{_0xb864a1=0xce;}_0x40b199[_0xb6a0('0x15')](_0xb864a1);return _0x40b199['set'](_0xb6a0('0x1b'),_0x242694+'-'+_0x374b74+'/'+_0x45a4df)[_0xb6a0('0x17')](_0x2d41de);}return null;};}function patchUpdates(_0x1708e4){return function(_0x17b9ee){try{jsonpatch[_0xb6a0('0x1c')](_0x17b9ee,_0x1708e4,!![]);}catch(_0x4b70ca){return BPromise['reject'](_0x4b70ca);}return _0x17b9ee[_0xb6a0('0x1d')]();};}function saveUpdates(_0x430ced,_0x47b1d0){return function(_0x12a58f){if(_0x12a58f){return _0x12a58f['update'](_0x430ced)[_0xb6a0('0x1e')](function(_0x432984){return _0x432984;});}return null;};}function removeEntity(_0x327071,_0x5604c9){return function(_0x2f7c95){if(_0x2f7c95){return _0x2f7c95[_0xb6a0('0x1f')]()[_0xb6a0('0x1e')](function(){_0x327071['status'](0xcc)[_0xb6a0('0x16')]();});}};}function handleEntityNotFound(_0x2e0cb0,_0x5eb55f){return function(_0x75bbe7){if(!_0x75bbe7){_0x2e0cb0['sendStatus'](0x194);}return _0x75bbe7;};}function handleError(_0x4ed339,_0xa40d72){_0xa40d72=_0xa40d72||0x1f4;return function(_0x5ea3f1){logger[_0xb6a0('0x20')](_0x5ea3f1[_0xb6a0('0x21')]);if(_0x5ea3f1[_0xb6a0('0x22')]){delete _0x5ea3f1[_0xb6a0('0x22')];}_0x4ed339[_0xb6a0('0x15')](_0xa40d72)[_0xb6a0('0x23')](_0x5ea3f1);};}exports[_0xb6a0('0x24')]=function(_0x55835b,_0xb67a1a){var _0x29dbb9={},_0xd6e536={},_0x17274={'count':0x0,'rows':[]};var _0x2cbcd3=_['map'](db[_0xb6a0('0x25')]['rawAttributes'],function(_0x25ed03){return{'name':_0x25ed03[_0xb6a0('0x26')],'type':_0x25ed03[_0xb6a0('0x27')][_0xb6a0('0x28')]};});_0xd6e536[_0xb6a0('0x29')]=_[_0xb6a0('0x2a')](_0x2cbcd3,'name');_0xd6e536['query']=_[_0xb6a0('0x2b')](_0x55835b[_0xb6a0('0x2c')]);_0xd6e536[_0xb6a0('0x2d')]=_[_0xb6a0('0x2e')](_0xd6e536[_0xb6a0('0x29')],_0xd6e536['query']);_0x29dbb9['attributes']=_[_0xb6a0('0x2e')](_0xd6e536[_0xb6a0('0x29')],qs[_0xb6a0('0x2f')](_0x55835b[_0xb6a0('0x2c')]['fields']));_0x29dbb9['attributes']=_0x29dbb9[_0xb6a0('0x30')][_0xb6a0('0x31')]?_0x29dbb9[_0xb6a0('0x30')]:_0xd6e536[_0xb6a0('0x29')];if(!_0x55835b[_0xb6a0('0x2c')]['hasOwnProperty']('nolimit')){_0x29dbb9[_0xb6a0('0x1a')]=qs[_0xb6a0('0x1a')](_0x55835b[_0xb6a0('0x2c')][_0xb6a0('0x1a')]);_0x29dbb9[_0xb6a0('0x19')]=qs[_0xb6a0('0x19')](_0x55835b[_0xb6a0('0x2c')]['offset']);}_0x29dbb9[_0xb6a0('0x32')]=qs[_0xb6a0('0x33')](_0x55835b[_0xb6a0('0x2c')]['sort']);_0x29dbb9[_0xb6a0('0x34')]=qs[_0xb6a0('0x2d')](_['pick'](_0x55835b[_0xb6a0('0x2c')],_0xd6e536[_0xb6a0('0x2d')]));if(_0x55835b[_0xb6a0('0x2c')][_0xb6a0('0x35')]){_0x29dbb9[_0xb6a0('0x34')]=_[_0xb6a0('0x36')](_0x29dbb9['where'],{'$or':_[_0xb6a0('0x2a')](_0x2cbcd3,function(_0x91cc98){if(_0x91cc98[_0xb6a0('0x27')]!=='VIRTUAL'){var _0x4befc3={};_0x4befc3[_0x91cc98[_0xb6a0('0x22')]]={'$like':'%'+_0x55835b[_0xb6a0('0x2c')][_0xb6a0('0x35')]+'%'};return _0x4befc3;}})});}_0x29dbb9=_[_0xb6a0('0x36')]({},_0x29dbb9,_0x55835b[_0xb6a0('0x37')]);var _0x2e2c7b={'where':_0x29dbb9[_0xb6a0('0x34')]};return db['AnalyticFieldReport'][_0xb6a0('0x18')](_0x2e2c7b)['then'](function(_0x31a513){_0x17274[_0xb6a0('0x18')]=_0x31a513;if(_0x55835b['query'][_0xb6a0('0x38')]){_0x29dbb9['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xb6a0('0x39')](_0x29dbb9);})['then'](function(_0x2af3f3){_0x17274['rows']=_0x2af3f3;return _0x17274;})['then'](respondWithFilteredResult(_0xb67a1a,_0x29dbb9))[_0xb6a0('0x3a')](handleError(_0xb67a1a,null));};exports[_0xb6a0('0x3b')]=function(_0x2b6cc3,_0x211665){var _0x315127={'raw':![],'where':{'id':_0x2b6cc3[_0xb6a0('0x3c')]['id']}},_0x153a91={};_0x153a91[_0xb6a0('0x29')]=_[_0xb6a0('0x2b')](db[_0xb6a0('0x25')][_0xb6a0('0x3d')]);_0x153a91[_0xb6a0('0x2c')]=_[_0xb6a0('0x2b')](_0x2b6cc3[_0xb6a0('0x2c')]);_0x153a91[_0xb6a0('0x2d')]=_[_0xb6a0('0x2e')](_0x153a91['model'],_0x153a91[_0xb6a0('0x2c')]);_0x315127['attributes']=_['intersection'](_0x153a91[_0xb6a0('0x29')],qs[_0xb6a0('0x2f')](_0x2b6cc3[_0xb6a0('0x2c')][_0xb6a0('0x2f')]));_0x315127[_0xb6a0('0x30')]=_0x315127[_0xb6a0('0x30')][_0xb6a0('0x31')]?_0x315127[_0xb6a0('0x30')]:_0x153a91[_0xb6a0('0x29')];if(_0x2b6cc3[_0xb6a0('0x2c')][_0xb6a0('0x38')]){_0x315127[_0xb6a0('0x3e')]=[{'all':!![]}];}_0x315127=_[_0xb6a0('0x36')]({},_0x315127,_0x2b6cc3[_0xb6a0('0x37')]);return db[_0xb6a0('0x25')][_0xb6a0('0x3f')](_0x315127)[_0xb6a0('0x1e')](handleEntityNotFound(_0x211665,null))[_0xb6a0('0x1e')](respondWithResult(_0x211665,null))['catch'](handleError(_0x211665,null));};exports[_0xb6a0('0x40')]=function(_0x2c10b4,_0x20132d){return db['AnalyticFieldReport'][_0xb6a0('0x40')](_0x2c10b4[_0xb6a0('0x41')],{})['then'](respondWithResult(_0x20132d,0xc9))[_0xb6a0('0x3a')](handleError(_0x20132d,null));};exports['bulkCreate']=function(_0x681627,_0x201fc){return db[_0xb6a0('0x25')]['bulkCreate'](_0x681627[_0xb6a0('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x201fc,0xc9))[_0xb6a0('0x3a')](handleError(_0x201fc,null));};exports[_0xb6a0('0x42')]=function(_0x38aaf6,_0x2ef71c){if(_0x38aaf6['body']['id']){delete _0x38aaf6[_0xb6a0('0x41')]['id'];}return db[_0xb6a0('0x25')]['find']({'where':{'id':_0x38aaf6[_0xb6a0('0x3c')]['id']}})[_0xb6a0('0x1e')](handleEntityNotFound(_0x2ef71c,null))[_0xb6a0('0x1e')](saveUpdates(_0x38aaf6[_0xb6a0('0x41')],null))[_0xb6a0('0x1e')](respondWithResult(_0x2ef71c,null))[_0xb6a0('0x3a')](handleError(_0x2ef71c,null));};exports[_0xb6a0('0x1f')]=function(_0x628d9b,_0x540d91){return db['AnalyticFieldReport'][_0xb6a0('0x3f')]({'where':{'id':_0x628d9b[_0xb6a0('0x3c')]['id']}})[_0xb6a0('0x1e')](handleEntityNotFound(_0x540d91,null))[_0xb6a0('0x1e')](removeEntity(_0x540d91,null))[_0xb6a0('0x3a')](handleError(_0x540d91,null));};exports[_0xb6a0('0x43')]=function(_0x49360e,_0x2832be){return db[_0xb6a0('0x25')][_0xb6a0('0x1f')]({'where':{'id':_0x49360e['query'][_0xb6a0('0x44')]||[]},'raw':![],'individualHooks':!![]})[_0xb6a0('0x1e')](respondWithResult(_0x2832be,0xcc))[_0xb6a0('0x3a')](handleError(_0x2832be,null));};exports['addFields']=function(_0x2060d6,_0x3cce0c,_0x111a65){return db[_0xb6a0('0x45')][_0xb6a0('0x46')]({'where':{'id':_0x2060d6['params']['id']}})[_0xb6a0('0x1e')](handleEntityNotFound(_0x3cce0c,null))['then'](function(_0x308b94){if(_0x308b94){return db[_0xb6a0('0x47')][_0xb6a0('0x48')](function(_0x3eb478){return db[_0xb6a0('0x25')][_0xb6a0('0x1f')]({'where':{'CustomReportId':_0x2060d6[_0xb6a0('0x3c')]['id']},'transaction':_0x3eb478})[_0xb6a0('0x1e')](function(_0x299aa3){var _0x458033=_['map'](_0x2060d6['body'],function(_0x14bff7){delete _0x14bff7['id'];_0x14bff7[_0xb6a0('0x49')]=_0x2060d6[_0xb6a0('0x3c')]['id'];return _0x14bff7;});return db[_0xb6a0('0x25')][_0xb6a0('0x4a')](_0x458033,{'transaction':_0x3eb478});});})['then'](function(){return db[_0xb6a0('0x25')][_0xb6a0('0x39')]({'where':{'CustomReportId':_0x2060d6[_0xb6a0('0x3c')]['id']}});});}})['then'](respondWithResult(_0x3cce0c,null))['catch'](handleError(_0x3cce0c,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 14aee2e..0b37815 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 _0xdb11=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','AnalyticFieldReport'];(function(_0x3765ce,_0x296346){var _0xc72fb=function(_0x57cf03){while(--_0x57cf03){_0x3765ce['push'](_0x3765ce['shift']());}};_0xc72fb(++_0x296346);}(_0xdb11,0x64));var _0x1db1=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xdb11[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require('lodash');var util=require(_0x1db1('0x0'));var logger=require(_0x1db1('0x1'))(_0x1db1('0x2'));var moment=require(_0x1db1('0x3'));var BPromise=require(_0x1db1('0x4'));var rp=require(_0x1db1('0x5'));var fs=require('fs');var path=require(_0x1db1('0x6'));var rimraf=require('rimraf');var config=require(_0x1db1('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x442492,_0xeeee82){return _0x442492[_0x1db1('0x8')](_0x1db1('0x9'),attributes,{'tableName':_0x1db1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb3=['api','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1cb3,0xd0));var _0x31cb=function(_0x13bc40,_0xccb9a8){_0x13bc40=_0x13bc40-0x0;var _0x5c8466=_0x1cb3[_0x13bc40];return _0x5c8466;};'use strict';var _=require(_0x31cb('0x0'));var util=require('util');var logger=require(_0x31cb('0x1'))(_0x31cb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x31cb('0x3'));var fs=require('fs');var path=require(_0x31cb('0x4'));var rimraf=require(_0x31cb('0x5'));var config=require(_0x31cb('0x6'));var attributes=require(_0x31cb('0x7'));module[_0x31cb('0x8')]=function(_0x2c035f,_0x564583){return _0x2c035f['define'](_0x31cb('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 9c9598f..7c97823 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 _0xcfa3=['rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcfa3,0x121));var _0x3cfa=function(_0x4ac572,_0x3ac4f4){_0x4ac572=_0x4ac572-0x0;var _0x1e9ec4=_0xcfa3[_0x4ac572];return _0x1e9ec4;};'use strict';var _=require(_0x3cfa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cfa('0x1'));var db=require(_0x3cfa('0x2'))['db'];var utils=require(_0x3cfa('0x3'));var logger=require(_0x3cfa('0x4'))(_0x3cfa('0x5'));var config=require(_0x3cfa('0x6'));var jayson=require(_0x3cfa('0x7'));var client=jayson[_0x3cfa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaaea4d,_0x358485,_0x3069c3){return new BPromise(function(_0x46c4d7,_0x3af680){return client[_0x3cfa('0x9')](_0xaaea4d,_0x3069c3)[_0x3cfa('0xa')](function(_0xe51abb){logger[_0x3cfa('0xb')](_0x3cfa('0xc'),_0x358485,_0x3cfa('0xd'));logger[_0x3cfa('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x358485,_0x3cfa('0xd'),JSON[_0x3cfa('0xf')](_0xe51abb));if(_0xe51abb['error']){if(_0xe51abb[_0x3cfa('0x10')][_0x3cfa('0x11')]===0x1f4){logger[_0x3cfa('0x10')](_0x3cfa('0xc'),_0x358485,_0xe51abb['error']['message']);return _0x3af680(_0xe51abb[_0x3cfa('0x10')][_0x3cfa('0x12')]);}logger[_0x3cfa('0x10')](_0x3cfa('0xc'),_0x358485,_0xe51abb[_0x3cfa('0x10')][_0x3cfa('0x12')]);return _0x46c4d7(_0xe51abb[_0x3cfa('0x10')]['message']);}else{logger[_0x3cfa('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x358485,_0x3cfa('0xd'));_0x46c4d7(_0xe51abb[_0x3cfa('0x13')]['message']);}})[_0x3cfa('0x14')](function(_0x495479){logger[_0x3cfa('0x10')](_0x3cfa('0xc'),_0x358485,_0x495479);_0x3af680(_0x495479);});});} \ No newline at end of file +var _0x2b91=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x32dfb9,_0xd2cb8a){var _0x4fe07e=function(_0x356a52){while(--_0x356a52){_0x32dfb9['push'](_0x32dfb9['shift']());}};_0x4fe07e(++_0xd2cb8a);}(_0x2b91,0xa8));var _0x12b9=function(_0x89ec81,_0x17712f){_0x89ec81=_0x89ec81-0x0;var _0x4d2a1b=_0x2b91[_0x89ec81];return _0x4d2a1b;};'use strict';var _=require(_0x12b9('0x0'));var util=require(_0x12b9('0x1'));var moment=require(_0x12b9('0x2'));var BPromise=require(_0x12b9('0x3'));var rs=require(_0x12b9('0x4'));var fs=require('fs');var Redis=require(_0x12b9('0x5'));var db=require(_0x12b9('0x6'))['db'];var utils=require(_0x12b9('0x7'));var logger=require(_0x12b9('0x8'))(_0x12b9('0x9'));var config=require(_0x12b9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x12b9('0xb')][_0x12b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16ba2b,_0x1aaa11,_0x29587e){return new BPromise(function(_0x2332ea,_0x549a49){return client[_0x12b9('0xd')](_0x16ba2b,_0x29587e)['then'](function(_0x4aef41){logger[_0x12b9('0xe')](_0x12b9('0xf'),_0x1aaa11,_0x12b9('0x10'));logger[_0x12b9('0x11')](_0x12b9('0x12'),_0x1aaa11,_0x12b9('0x10'),JSON[_0x12b9('0x13')](_0x4aef41));if(_0x4aef41['error']){if(_0x4aef41[_0x12b9('0x14')][_0x12b9('0x15')]===0x1f4){logger[_0x12b9('0x14')](_0x12b9('0xf'),_0x1aaa11,_0x4aef41[_0x12b9('0x14')]['message']);return _0x549a49(_0x4aef41[_0x12b9('0x14')][_0x12b9('0x16')]);}logger['error'](_0x12b9('0xf'),_0x1aaa11,_0x4aef41[_0x12b9('0x14')]['message']);return _0x2332ea(_0x4aef41[_0x12b9('0x14')][_0x12b9('0x16')]);}else{logger[_0x12b9('0xe')](_0x12b9('0xf'),_0x1aaa11,_0x12b9('0x10'));_0x2332ea(_0x4aef41[_0x12b9('0x17')][_0x12b9('0x16')]);}})[_0x12b9('0x18')](function(_0x53695a){logger[_0x12b9('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1aaa11,_0x53695a);_0x549a49(_0x53695a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 66d4ce2..88ce38b 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 _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x185a5a,_0x19442b){var _0x39bd2d=function(_0xfe0213){while(--_0xfe0213){_0x185a5a['push'](_0x185a5a['shift']());}};_0x39bd2d(++_0x19442b);}(_0xe14b,0x93));var _0xbe14=function(_0x34ab8e,_0x153166){_0x34ab8e=_0x34ab8e-0x0;var _0x26c218=_0xe14b[_0x34ab8e];return _0x26c218;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file +var _0x326f=['/:id','show','post','/create_many','bulkCreate','/:id/create_many','addFields','update','/destroy_many','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x326f,0xd1));var _0xf326=function(_0x5640bf,_0x1ac188){_0x5640bf=_0x5640bf-0x0;var _0x4bd8b1=_0x326f[_0x5640bf];return _0x4bd8b1;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf326('0xe'),auth[_0xf326('0x9')](),controller[_0xf326('0xf')]);router[_0xf326('0xd')](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['put'](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x12')]);router['delete'](_0xf326('0x13'),auth[_0xf326('0x9')](),controller['bulkDestroy']);router[_0xf326('0x14')](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index a8f7263..67ce385 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 _0x92a3=['sequelize','exports','STRING','name','TEXT'];(function(_0x126252,_0x2e41d4){var _0x589e99=function(_0x313b0b){while(--_0x313b0b){_0x126252['push'](_0x126252['shift']());}};_0x589e99(++_0x2e41d4);}(_0x92a3,0x140));var _0x392a=function(_0x38cbc3,_0x39b1e3){_0x38cbc3=_0x38cbc3-0x0;var _0x1486be=_0x92a3[_0x38cbc3];return _0x1486be;};'use strict';var Sequelize=require(_0x392a('0x0'));module[_0x392a('0x1')]={'name':{'type':Sequelize[_0x392a('0x2')],'allowNull':![],'unique':_0x392a('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x392a('0x4')]},'description':{'type':Sequelize[_0x392a('0x2')]}}; \ No newline at end of file +var _0xa249=['exports','name','STRING','sequelize'];(function(_0x802a5e,_0x6dc732){var _0x46e667=function(_0x21865d){while(--_0x21865d){_0x802a5e['push'](_0x802a5e['shift']());}};_0x46e667(++_0x6dc732);}(_0xa249,0x183));var _0x9a24=function(_0xb8b6b7,_0x2b3e7f){_0xb8b6b7=_0xb8b6b7-0x0;var _0x14b5b2=_0xa249[_0xb8b6b7];return _0x14b5b2;};'use strict';var Sequelize=require(_0x9a24('0x0'));module[_0x9a24('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a24('0x2')},'table':{'type':Sequelize[_0x9a24('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x9a24('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ea832dd..c20a35e 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 _0xe9b5=['json','offset','limit','set','apply','reject','update','then','Metrics','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x58a37e,_0xea3572){var _0x504358=function(_0xd97f86){while(--_0xd97f86){_0x58a37e['push'](_0x58a37e['shift']());}};_0x504358(++_0xea3572);}(_0xe9b5,0x1b0));var _0x5e9b=function(_0x18d587,_0x511cc1){_0x18d587=_0x18d587-0x0;var _0x9f28aa=_0xe9b5[_0x18d587];return _0x9f28aa;};'use strict';var pdf=require(_0x5e9b('0x0'));var emlformat=require(_0x5e9b('0x1'));var rimraf=require(_0x5e9b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e9b('0x3'));var rp=require(_0x5e9b('0x4'));var moment=require('moment');var BPromise=require(_0x5e9b('0x5'));var Mustache=require('mustache');var util=require(_0x5e9b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5e9b('0x7'));var ejs=require(_0x5e9b('0x8'));var fs=require('fs');var _=require(_0x5e9b('0x9'));var squel=require(_0x5e9b('0xa'));var crypto=require(_0x5e9b('0xb'));var jsforce=require(_0x5e9b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5e9b('0x7'));var querystring=require(_0x5e9b('0xd'));var Papa=require(_0x5e9b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e9b('0xf'));var as=require(_0x5e9b('0x10'));var hardwareService=require(_0x5e9b('0x11'));var logger=require(_0x5e9b('0x12'))('api');var utils=require(_0x5e9b('0x13'));var config=require(_0x5e9b('0x14'));var db=require(_0x5e9b('0x15'))['db'];function respondWithStatusCode(_0x4ed8cc,_0x35d4f8){_0x35d4f8=_0x35d4f8||0xcc;return function(_0x27efb4){if(_0x27efb4){return _0x4ed8cc['sendStatus'](_0x35d4f8);}return _0x4ed8cc[_0x5e9b('0x16')](_0x35d4f8)[_0x5e9b('0x17')]();};}function respondWithResult(_0xa7403,_0x4e4629){_0x4e4629=_0x4e4629||0xc8;return function(_0x129517){if(_0x129517){return _0xa7403[_0x5e9b('0x16')](_0x4e4629)[_0x5e9b('0x18')](_0x129517);}};}function respondWithFilteredResult(_0x5637b3,_0x23540d){return function(_0x28ce63){if(_0x28ce63){var _0xa5a5e1=_0x28ce63['count'],_0x30237a=_0x23540d['offset'],_0x15fa38=_0x23540d[_0x5e9b('0x19')]+_0x23540d[_0x5e9b('0x1a')],_0x1699ff;if(_0x15fa38>=_0xa5a5e1){_0x15fa38=_0xa5a5e1;_0x1699ff=0xc8;}else{_0x1699ff=0xce;}_0x5637b3['status'](_0x1699ff);return _0x5637b3[_0x5e9b('0x1b')]('Content-Range',_0x30237a+'-'+_0x15fa38+'/'+_0xa5a5e1)[_0x5e9b('0x18')](_0x28ce63);}return null;};}function patchUpdates(_0x5a13a0){return function(_0xb531f8){try{jsonpatch[_0x5e9b('0x1c')](_0xb531f8,_0x5a13a0,!![]);}catch(_0x52fd4a){return BPromise[_0x5e9b('0x1d')](_0x52fd4a);}return _0xb531f8['save']();};}function saveUpdates(_0x3d6f47,_0x48bdf1){return function(_0x596d5a){if(_0x596d5a){return _0x596d5a[_0x5e9b('0x1e')](_0x3d6f47)[_0x5e9b('0x1f')](function(_0x4ebe26){return _0x4ebe26;});}return null;};}function removeEntity(_0x350cd2,_0x4f6709){return function(_0x17b9bf){if(_0x17b9bf){return _0x17b9bf['destroy']()[_0x5e9b('0x1f')](function(){var _0x4b9687=_0x17b9bf['get']({'plain':!![]});var _0x346182=_0x5e9b('0x20');return db[_0x5e9b('0x21')][_0x5e9b('0x22')]({'where':{'type':_0x346182,'resourceId':_0x4b9687['id']}})[_0x5e9b('0x1f')](function(){return _0x17b9bf;});})['then'](function(){_0x350cd2[_0x5e9b('0x16')](0xcc)[_0x5e9b('0x17')]();});}};}function handleEntityNotFound(_0x56cd64,_0x117178){return function(_0x2e1043){if(!_0x2e1043){_0x56cd64[_0x5e9b('0x23')](0x194);}return _0x2e1043;};}function handleError(_0x31203f,_0x54f2df){_0x54f2df=_0x54f2df||0x1f4;return function(_0x508140){logger[_0x5e9b('0x24')](_0x508140[_0x5e9b('0x25')]);if(_0x508140[_0x5e9b('0x26')]){delete _0x508140[_0x5e9b('0x26')];}_0x31203f['status'](_0x54f2df)[_0x5e9b('0x27')](_0x508140);};}exports['index']=function(_0x153edf,_0x240a89){var _0x2f00d6={},_0x18652a={},_0xd25041={'count':0x0,'rows':[]};var _0x549bb5=_[_0x5e9b('0x28')](db[_0x5e9b('0x29')][_0x5e9b('0x2a')],function(_0x2d0ab3){return{'name':_0x2d0ab3[_0x5e9b('0x2b')],'type':_0x2d0ab3['type']['key']};});_0x18652a[_0x5e9b('0x2c')]=_[_0x5e9b('0x28')](_0x549bb5,'name');_0x18652a['query']=_[_0x5e9b('0x2d')](_0x153edf[_0x5e9b('0x2e')]);_0x18652a[_0x5e9b('0x2f')]=_[_0x5e9b('0x30')](_0x18652a[_0x5e9b('0x2c')],_0x18652a[_0x5e9b('0x2e')]);_0x2f00d6[_0x5e9b('0x31')]=_[_0x5e9b('0x30')](_0x18652a[_0x5e9b('0x2c')],qs[_0x5e9b('0x32')](_0x153edf['query'][_0x5e9b('0x32')]));_0x2f00d6[_0x5e9b('0x31')]=_0x2f00d6['attributes'][_0x5e9b('0x33')]?_0x2f00d6[_0x5e9b('0x31')]:_0x18652a[_0x5e9b('0x2c')];if(!_0x153edf['query']['hasOwnProperty'](_0x5e9b('0x34'))){_0x2f00d6['limit']=qs[_0x5e9b('0x1a')](_0x153edf[_0x5e9b('0x2e')][_0x5e9b('0x1a')]);_0x2f00d6[_0x5e9b('0x19')]=qs[_0x5e9b('0x19')](_0x153edf[_0x5e9b('0x2e')][_0x5e9b('0x19')]);}_0x2f00d6[_0x5e9b('0x35')]=qs[_0x5e9b('0x36')](_0x153edf[_0x5e9b('0x2e')][_0x5e9b('0x36')]);_0x2f00d6[_0x5e9b('0x37')]=qs[_0x5e9b('0x2f')](_[_0x5e9b('0x38')](_0x153edf[_0x5e9b('0x2e')],_0x18652a[_0x5e9b('0x2f')]));if(_0x153edf['query']['filter']){_0x2f00d6['where']=_[_0x5e9b('0x39')](_0x2f00d6['where'],{'$or':_[_0x5e9b('0x28')](_0x549bb5,function(_0x33d2d3){if(_0x33d2d3[_0x5e9b('0x3a')]!==_0x5e9b('0x3b')){var _0x27247a={};_0x27247a[_0x33d2d3[_0x5e9b('0x26')]]={'$like':'%'+_0x153edf['query']['filter']+'%'};return _0x27247a;}})});}_0x2f00d6=_[_0x5e9b('0x39')]({},_0x2f00d6,_0x153edf[_0x5e9b('0x3c')]);var _0x46cde5={'where':_0x2f00d6[_0x5e9b('0x37')]};return db[_0x5e9b('0x29')][_0x5e9b('0x3d')](_0x46cde5)[_0x5e9b('0x1f')](function(_0x4c27a9){_0xd25041[_0x5e9b('0x3d')]=_0x4c27a9;if(_0x153edf[_0x5e9b('0x2e')][_0x5e9b('0x3e')]){_0x2f00d6[_0x5e9b('0x3f')]=[{'all':!![]}];}return db[_0x5e9b('0x29')][_0x5e9b('0x40')](_0x2f00d6);})[_0x5e9b('0x1f')](function(_0x1f4c85){_0xd25041[_0x5e9b('0x41')]=_0x1f4c85;return _0xd25041;})[_0x5e9b('0x1f')](respondWithFilteredResult(_0x240a89,_0x2f00d6))[_0x5e9b('0x42')](handleError(_0x240a89,null));};exports[_0x5e9b('0x43')]=function(_0x706e1d,_0x23c770){var _0x2f5906={'raw':!![],'where':{'id':_0x706e1d[_0x5e9b('0x44')]['id']}},_0xd5f78f={};_0xd5f78f['model']=_['keys'](db[_0x5e9b('0x29')]['rawAttributes']);_0xd5f78f['query']=_[_0x5e9b('0x2d')](_0x706e1d[_0x5e9b('0x2e')]);_0xd5f78f[_0x5e9b('0x2f')]=_[_0x5e9b('0x30')](_0xd5f78f[_0x5e9b('0x2c')],_0xd5f78f['query']);_0x2f5906[_0x5e9b('0x31')]=_['intersection'](_0xd5f78f[_0x5e9b('0x2c')],qs[_0x5e9b('0x32')](_0x706e1d['query'][_0x5e9b('0x32')]));_0x2f5906[_0x5e9b('0x31')]=_0x2f5906[_0x5e9b('0x31')][_0x5e9b('0x33')]?_0x2f5906[_0x5e9b('0x31')]:_0xd5f78f[_0x5e9b('0x2c')];if(_0x706e1d[_0x5e9b('0x2e')][_0x5e9b('0x3e')]){_0x2f5906[_0x5e9b('0x3f')]=[{'all':!![]}];}_0x2f5906=_[_0x5e9b('0x39')]({},_0x2f5906,_0x706e1d[_0x5e9b('0x3c')]);return db[_0x5e9b('0x29')][_0x5e9b('0x45')](_0x2f5906)[_0x5e9b('0x1f')](handleEntityNotFound(_0x23c770,null))[_0x5e9b('0x1f')](respondWithResult(_0x23c770,null))['catch'](handleError(_0x23c770,null));};exports['create']=function(_0x1b8fbe,_0x36601d){return db[_0x5e9b('0x29')][_0x5e9b('0x46')](_0x1b8fbe['body'],{})[_0x5e9b('0x1f')](function(_0x350ff6){var _0x54b7ef=_0x1b8fbe[_0x5e9b('0x47')]['get']({'plain':!![]});if(!_0x54b7ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54b7ef['role']===_0x5e9b('0x47')){var _0x2cbc24=_0x350ff6[_0x5e9b('0x48')]({'plain':!![]});var _0x3dd18e=_0x5e9b('0x20');return db['UserProfileSection'][_0x5e9b('0x45')]({'where':{'name':_0x3dd18e,'userProfileId':_0x54b7ef[_0x5e9b('0x49')]},'raw':!![]})[_0x5e9b('0x1f')](function(_0x4aca22){if(_0x4aca22&&_0x4aca22['autoAssociation']===0x0){return db[_0x5e9b('0x21')]['create']({'name':_0x2cbc24['name'],'resourceId':_0x2cbc24['id'],'type':_0x4aca22['name'],'sectionId':_0x4aca22['id']},{})[_0x5e9b('0x1f')](function(){return _0x350ff6;});}else{return _0x350ff6;}})[_0x5e9b('0x42')](function(_0x13f7a2){logger[_0x5e9b('0x24')](_0x5e9b('0x4a'),_0x13f7a2);throw _0x13f7a2;});}return _0x350ff6;})[_0x5e9b('0x1f')](respondWithResult(_0x36601d,0xc9))[_0x5e9b('0x42')](handleError(_0x36601d,null));};exports[_0x5e9b('0x1e')]=function(_0x4c2b63,_0x10fe48){if(_0x4c2b63[_0x5e9b('0x4b')]['id']){delete _0x4c2b63['body']['id'];}return db['AnalyticMetric'][_0x5e9b('0x45')]({'where':{'id':_0x4c2b63['params']['id']}})[_0x5e9b('0x1f')](handleEntityNotFound(_0x10fe48,null))[_0x5e9b('0x1f')](saveUpdates(_0x4c2b63[_0x5e9b('0x4b')],null))[_0x5e9b('0x1f')](respondWithResult(_0x10fe48,null))[_0x5e9b('0x42')](handleError(_0x10fe48,null));};exports[_0x5e9b('0x22')]=function(_0x2ed282,_0x21dd59){return db[_0x5e9b('0x29')]['find']({'where':{'id':_0x2ed282[_0x5e9b('0x44')]['id']}})[_0x5e9b('0x1f')](handleEntityNotFound(_0x21dd59,null))[_0x5e9b('0x1f')](removeEntity(_0x21dd59,null))[_0x5e9b('0x42')](handleError(_0x21dd59,null));}; \ No newline at end of file +var _0x8b49=['limit','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','stack','name','send','index','map','AnalyticMetric','rawAttributes','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','html-pdf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x2570e2,_0x34d5f2){var _0x12dcfd=function(_0x4eb41e){while(--_0x4eb41e){_0x2570e2['push'](_0x2570e2['shift']());}};_0x12dcfd(++_0x34d5f2);}(_0x8b49,0xcf));var _0x98b4=function(_0x34750b,_0x34aae5){_0x34750b=_0x34750b-0x0;var _0x244258=_0x8b49[_0x34750b];return _0x244258;};'use strict';var pdf=require(_0x98b4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x98b4('0x1'));var moment=require(_0x98b4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x98b4('0x3'));var util=require(_0x98b4('0x4'));var path=require(_0x98b4('0x5'));var sox=require(_0x98b4('0x6'));var csv=require(_0x98b4('0x7'));var ejs=require(_0x98b4('0x8'));var fs=require('fs');var _=require(_0x98b4('0x9'));var squel=require(_0x98b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x98b4('0x7'));var querystring=require(_0x98b4('0xb'));var Papa=require('papaparse');var Redis=require(_0x98b4('0xc'));var authService=require(_0x98b4('0xd'));var qs=require(_0x98b4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98b4('0xf'));var logger=require(_0x98b4('0x10'))(_0x98b4('0x11'));var utils=require(_0x98b4('0x12'));var config=require(_0x98b4('0x13'));var db=require(_0x98b4('0x14'))['db'];function respondWithStatusCode(_0x4cf01d,_0x44c885){_0x44c885=_0x44c885||0xcc;return function(_0x50ae45){if(_0x50ae45){return _0x4cf01d[_0x98b4('0x15')](_0x44c885);}return _0x4cf01d[_0x98b4('0x16')](_0x44c885)[_0x98b4('0x17')]();};}function respondWithResult(_0x48490d,_0x45c914){_0x45c914=_0x45c914||0xc8;return function(_0x52a416){if(_0x52a416){return _0x48490d[_0x98b4('0x16')](_0x45c914)[_0x98b4('0x18')](_0x52a416);}};}function respondWithFilteredResult(_0x511904,_0x2951b7){return function(_0xfe599e){if(_0xfe599e){var _0x7efbce=_0xfe599e[_0x98b4('0x19')],_0x1f6487=_0x2951b7[_0x98b4('0x1a')],_0x2ff697=_0x2951b7[_0x98b4('0x1a')]+_0x2951b7[_0x98b4('0x1b')],_0x49d447;if(_0x2ff697>=_0x7efbce){_0x2ff697=_0x7efbce;_0x49d447=0xc8;}else{_0x49d447=0xce;}_0x511904['status'](_0x49d447);return _0x511904[_0x98b4('0x1c')]('Content-Range',_0x1f6487+'-'+_0x2ff697+'/'+_0x7efbce)[_0x98b4('0x18')](_0xfe599e);}return null;};}function patchUpdates(_0x2fa375){return function(_0x45cf93){try{jsonpatch[_0x98b4('0x1d')](_0x45cf93,_0x2fa375,!![]);}catch(_0x506a7b){return BPromise[_0x98b4('0x1e')](_0x506a7b);}return _0x45cf93[_0x98b4('0x1f')]();};}function saveUpdates(_0x9bfbfb,_0x16e7ce){return function(_0x3d9162){if(_0x3d9162){return _0x3d9162[_0x98b4('0x20')](_0x9bfbfb)[_0x98b4('0x21')](function(_0x25a9c7){return _0x25a9c7;});}return null;};}function removeEntity(_0x360109,_0xa91469){return function(_0x5299ee){if(_0x5299ee){return _0x5299ee[_0x98b4('0x22')]()[_0x98b4('0x21')](function(){var _0x75bd12=_0x5299ee[_0x98b4('0x23')]({'plain':!![]});var _0x186893=_0x98b4('0x24');return db[_0x98b4('0x25')][_0x98b4('0x22')]({'where':{'type':_0x186893,'resourceId':_0x75bd12['id']}})[_0x98b4('0x21')](function(){return _0x5299ee;});})[_0x98b4('0x21')](function(){_0x360109[_0x98b4('0x16')](0xcc)[_0x98b4('0x17')]();});}};}function handleEntityNotFound(_0x2178d3,_0x2b39d1){return function(_0x6b0146){if(!_0x6b0146){_0x2178d3['sendStatus'](0x194);}return _0x6b0146;};}function handleError(_0x144fee,_0x364678){_0x364678=_0x364678||0x1f4;return function(_0x1e4ba7){logger['error'](_0x1e4ba7[_0x98b4('0x26')]);if(_0x1e4ba7[_0x98b4('0x27')]){delete _0x1e4ba7[_0x98b4('0x27')];}_0x144fee[_0x98b4('0x16')](_0x364678)[_0x98b4('0x28')](_0x1e4ba7);};}exports[_0x98b4('0x29')]=function(_0x5a8e7f,_0x27f1bf){var _0x4581dd={},_0x28310e={},_0x265d80={'count':0x0,'rows':[]};var _0x5aba2c=_[_0x98b4('0x2a')](db[_0x98b4('0x2b')][_0x98b4('0x2c')],function(_0x1227f9){return{'name':_0x1227f9['fieldName'],'type':_0x1227f9['type'][_0x98b4('0x2d')]};});_0x28310e[_0x98b4('0x2e')]=_[_0x98b4('0x2a')](_0x5aba2c,'name');_0x28310e['query']=_[_0x98b4('0x2f')](_0x5a8e7f[_0x98b4('0x30')]);_0x28310e['filters']=_[_0x98b4('0x31')](_0x28310e[_0x98b4('0x2e')],_0x28310e[_0x98b4('0x30')]);_0x4581dd['attributes']=_[_0x98b4('0x31')](_0x28310e[_0x98b4('0x2e')],qs[_0x98b4('0x32')](_0x5a8e7f['query']['fields']));_0x4581dd['attributes']=_0x4581dd[_0x98b4('0x33')]['length']?_0x4581dd[_0x98b4('0x33')]:_0x28310e[_0x98b4('0x2e')];if(!_0x5a8e7f[_0x98b4('0x30')]['hasOwnProperty'](_0x98b4('0x34'))){_0x4581dd[_0x98b4('0x1b')]=qs[_0x98b4('0x1b')](_0x5a8e7f[_0x98b4('0x30')][_0x98b4('0x1b')]);_0x4581dd[_0x98b4('0x1a')]=qs[_0x98b4('0x1a')](_0x5a8e7f['query'][_0x98b4('0x1a')]);}_0x4581dd[_0x98b4('0x35')]=qs[_0x98b4('0x36')](_0x5a8e7f[_0x98b4('0x30')][_0x98b4('0x36')]);_0x4581dd[_0x98b4('0x37')]=qs[_0x98b4('0x38')](_[_0x98b4('0x39')](_0x5a8e7f[_0x98b4('0x30')],_0x28310e[_0x98b4('0x38')]));if(_0x5a8e7f[_0x98b4('0x30')]['filter']){_0x4581dd[_0x98b4('0x37')]=_[_0x98b4('0x3a')](_0x4581dd[_0x98b4('0x37')],{'$or':_[_0x98b4('0x2a')](_0x5aba2c,function(_0x2b6707){if(_0x2b6707[_0x98b4('0x3b')]!==_0x98b4('0x3c')){var _0x2e3157={};_0x2e3157[_0x2b6707[_0x98b4('0x27')]]={'$like':'%'+_0x5a8e7f[_0x98b4('0x30')][_0x98b4('0x3d')]+'%'};return _0x2e3157;}})});}_0x4581dd=_[_0x98b4('0x3a')]({},_0x4581dd,_0x5a8e7f[_0x98b4('0x3e')]);var _0x32b7b2={'where':_0x4581dd['where']};return db[_0x98b4('0x2b')][_0x98b4('0x19')](_0x32b7b2)[_0x98b4('0x21')](function(_0x1ccaf0){_0x265d80[_0x98b4('0x19')]=_0x1ccaf0;if(_0x5a8e7f[_0x98b4('0x30')][_0x98b4('0x3f')]){_0x4581dd['include']=[{'all':!![]}];}return db[_0x98b4('0x2b')][_0x98b4('0x40')](_0x4581dd);})[_0x98b4('0x21')](function(_0x43ac94){_0x265d80[_0x98b4('0x41')]=_0x43ac94;return _0x265d80;})[_0x98b4('0x21')](respondWithFilteredResult(_0x27f1bf,_0x4581dd))[_0x98b4('0x42')](handleError(_0x27f1bf,null));};exports['show']=function(_0x5b7857,_0x5142ce){var _0x1ecd4e={'raw':!![],'where':{'id':_0x5b7857[_0x98b4('0x43')]['id']}},_0x2f6117={};_0x2f6117[_0x98b4('0x2e')]=_[_0x98b4('0x2f')](db['AnalyticMetric'][_0x98b4('0x2c')]);_0x2f6117[_0x98b4('0x30')]=_[_0x98b4('0x2f')](_0x5b7857['query']);_0x2f6117[_0x98b4('0x38')]=_[_0x98b4('0x31')](_0x2f6117[_0x98b4('0x2e')],_0x2f6117[_0x98b4('0x30')]);_0x1ecd4e[_0x98b4('0x33')]=_[_0x98b4('0x31')](_0x2f6117[_0x98b4('0x2e')],qs['fields'](_0x5b7857[_0x98b4('0x30')][_0x98b4('0x32')]));_0x1ecd4e[_0x98b4('0x33')]=_0x1ecd4e['attributes']['length']?_0x1ecd4e[_0x98b4('0x33')]:_0x2f6117[_0x98b4('0x2e')];if(_0x5b7857[_0x98b4('0x30')][_0x98b4('0x3f')]){_0x1ecd4e[_0x98b4('0x44')]=[{'all':!![]}];}_0x1ecd4e=_[_0x98b4('0x3a')]({},_0x1ecd4e,_0x5b7857['options']);return db[_0x98b4('0x2b')]['find'](_0x1ecd4e)[_0x98b4('0x21')](handleEntityNotFound(_0x5142ce,null))[_0x98b4('0x21')](respondWithResult(_0x5142ce,null))['catch'](handleError(_0x5142ce,null));};exports[_0x98b4('0x45')]=function(_0x2d67a3,_0x1092e9){return db[_0x98b4('0x2b')]['create'](_0x2d67a3[_0x98b4('0x46')],{})['then'](function(_0x20bee6){var _0x2717e5=_0x2d67a3[_0x98b4('0x47')][_0x98b4('0x23')]({'plain':!![]});if(!_0x2717e5)throw new Error(_0x98b4('0x48'));if(_0x2717e5[_0x98b4('0x49')]===_0x98b4('0x47')){var _0x4e9e40=_0x20bee6[_0x98b4('0x23')]({'plain':!![]});var _0x3fbbba=_0x98b4('0x24');return db[_0x98b4('0x4a')][_0x98b4('0x4b')]({'where':{'name':_0x3fbbba,'userProfileId':_0x2717e5[_0x98b4('0x4c')]},'raw':!![]})['then'](function(_0x3a036d){if(_0x3a036d&&_0x3a036d[_0x98b4('0x4d')]===0x0){return db[_0x98b4('0x25')][_0x98b4('0x45')]({'name':_0x4e9e40[_0x98b4('0x27')],'resourceId':_0x4e9e40['id'],'type':_0x3a036d[_0x98b4('0x27')],'sectionId':_0x3a036d['id']},{})[_0x98b4('0x21')](function(){return _0x20bee6;});}else{return _0x20bee6;}})[_0x98b4('0x42')](function(_0x585228){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x585228);throw _0x585228;});}return _0x20bee6;})[_0x98b4('0x21')](respondWithResult(_0x1092e9,0xc9))[_0x98b4('0x42')](handleError(_0x1092e9,null));};exports[_0x98b4('0x20')]=function(_0x2a7db4,_0xdcd84b){if(_0x2a7db4['body']['id']){delete _0x2a7db4[_0x98b4('0x46')]['id'];}return db[_0x98b4('0x2b')][_0x98b4('0x4b')]({'where':{'id':_0x2a7db4[_0x98b4('0x43')]['id']}})[_0x98b4('0x21')](handleEntityNotFound(_0xdcd84b,null))[_0x98b4('0x21')](saveUpdates(_0x2a7db4[_0x98b4('0x46')],null))[_0x98b4('0x21')](respondWithResult(_0xdcd84b,null))[_0x98b4('0x42')](handleError(_0xdcd84b,null));};exports[_0x98b4('0x22')]=function(_0x15442e,_0x4b8bc8){return db[_0x98b4('0x2b')]['find']({'where':{'id':_0x15442e[_0x98b4('0x43')]['id']}})[_0x98b4('0x21')](handleEntityNotFound(_0x4b8bc8,null))[_0x98b4('0x21')](removeEntity(_0x4b8bc8,null))[_0x98b4('0x42')](handleError(_0x4b8bc8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 2a2c679..79232e5 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 _0xbfdc=['exports','AnalyticMetric','analytics_metrics','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x33c4c6,_0x34fb0a){var _0x2f0f8a=function(_0x53cf67){while(--_0x53cf67){_0x33c4c6['push'](_0x33c4c6['shift']());}};_0x2f0f8a(++_0x34fb0a);}(_0xbfdc,0x143));var _0xcbfd=function(_0x4f12bf,_0x260426){_0x4f12bf=_0x4f12bf-0x0;var _0x5a052d=_0xbfdc[_0x4f12bf];return _0x5a052d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcbfd('0x0'))(_0xcbfd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcbfd('0x2'));var fs=require('fs');var path=require(_0xcbfd('0x3'));var rimraf=require(_0xcbfd('0x4'));var config=require(_0xcbfd('0x5'));var attributes=require(_0xcbfd('0x6'));module[_0xcbfd('0x7')]=function(_0x15388e,_0x1dbe5a){return _0x15388e['define'](_0xcbfd('0x8'),attributes,{'tableName':_0xcbfd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd95d=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd95d,0x143));var _0xdd95=function(_0x423f20,_0x11fbd2){_0x423f20=_0x423f20-0x0;var _0x5988fa=_0xd95d[_0x423f20];return _0x5988fa;};'use strict';var _=require(_0xdd95('0x0'));var util=require(_0xdd95('0x1'));var logger=require(_0xdd95('0x2'))(_0xdd95('0x3'));var moment=require(_0xdd95('0x4'));var BPromise=require(_0xdd95('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd95('0x6'));var rimraf=require(_0xdd95('0x7'));var config=require(_0xdd95('0x8'));var attributes=require(_0xdd95('0x9'));module[_0xdd95('0xa')]=function(_0xc59657,_0x1755df){return _0xc59657[_0xdd95('0xb')]('AnalyticMetric',attributes,{'tableName':_0xdd95('0xc'),'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 e725e4f..d6fbb23 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 _0xf6f1=['request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6f1,0x115));var _0x1f6f=function(_0xc21b81,_0x290f96){_0xc21b81=_0xc21b81-0x0;var _0x232286=_0xf6f1[_0xc21b81];return _0x232286;};'use strict';var _=require('lodash');var util=require(_0x1f6f('0x0'));var moment=require(_0x1f6f('0x1'));var BPromise=require(_0x1f6f('0x2'));var rs=require(_0x1f6f('0x3'));var fs=require('fs');var Redis=require(_0x1f6f('0x4'));var db=require(_0x1f6f('0x5'))['db'];var utils=require(_0x1f6f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1f6f('0x7'));var jayson=require(_0x1f6f('0x8'));var client=jayson[_0x1f6f('0x9')][_0x1f6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e432e,_0x479d21,_0x26da01){return new BPromise(function(_0x232caa,_0x4a7b2e){return client[_0x1f6f('0xb')](_0x3e432e,_0x26da01)[_0x1f6f('0xc')](function(_0x6fd151){logger[_0x1f6f('0xd')](_0x1f6f('0xe'),_0x479d21,_0x1f6f('0xf'));logger[_0x1f6f('0x10')](_0x1f6f('0x11'),_0x479d21,'request\x20sent',JSON[_0x1f6f('0x12')](_0x6fd151));if(_0x6fd151[_0x1f6f('0x13')]){if(_0x6fd151[_0x1f6f('0x13')][_0x1f6f('0x14')]===0x1f4){logger['error'](_0x1f6f('0xe'),_0x479d21,_0x6fd151[_0x1f6f('0x13')]['message']);return _0x4a7b2e(_0x6fd151[_0x1f6f('0x13')][_0x1f6f('0x15')]);}logger[_0x1f6f('0x13')](_0x1f6f('0xe'),_0x479d21,_0x6fd151[_0x1f6f('0x13')][_0x1f6f('0x15')]);return _0x232caa(_0x6fd151[_0x1f6f('0x13')][_0x1f6f('0x15')]);}else{logger[_0x1f6f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x479d21,'request\x20sent');_0x232caa(_0x6fd151[_0x1f6f('0x16')]['message']);}})[_0x1f6f('0x17')](function(_0x44d688){logger[_0x1f6f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x479d21,_0x44d688);_0x4a7b2e(_0x44d688);});});} \ No newline at end of file +var _0x97b0=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x5c30b5,_0x59c283){var _0x26ca3d=function(_0xc4f7cc){while(--_0xc4f7cc){_0x5c30b5['push'](_0x5c30b5['shift']());}};_0x26ca3d(++_0x59c283);}(_0x97b0,0xad));var _0x097b=function(_0x4e175e,_0x785e47){_0x4e175e=_0x4e175e-0x0;var _0x28c60c=_0x97b0[_0x4e175e];return _0x28c60c;};'use strict';var _=require(_0x097b('0x0'));var util=require(_0x097b('0x1'));var moment=require(_0x097b('0x2'));var BPromise=require(_0x097b('0x3'));var rs=require(_0x097b('0x4'));var fs=require('fs');var Redis=require(_0x097b('0x5'));var db=require(_0x097b('0x6'))['db'];var utils=require(_0x097b('0x7'));var logger=require(_0x097b('0x8'))(_0x097b('0x9'));var config=require(_0x097b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x097b('0xb')][_0x097b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e390f,_0x58f67a,_0x1c963f){return new BPromise(function(_0x3177c1,_0x1a430d){return client[_0x097b('0xd')](_0x2e390f,_0x1c963f)['then'](function(_0x63fb88){logger['info'](_0x097b('0xe'),_0x58f67a,'request\x20sent');logger[_0x097b('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x58f67a,_0x097b('0x10'),JSON[_0x097b('0x11')](_0x63fb88));if(_0x63fb88[_0x097b('0x12')]){if(_0x63fb88[_0x097b('0x12')][_0x097b('0x13')]===0x1f4){logger[_0x097b('0x12')](_0x097b('0xe'),_0x58f67a,_0x63fb88[_0x097b('0x12')]['message']);return _0x1a430d(_0x63fb88[_0x097b('0x12')][_0x097b('0x14')]);}logger[_0x097b('0x12')](_0x097b('0xe'),_0x58f67a,_0x63fb88[_0x097b('0x12')][_0x097b('0x14')]);return _0x3177c1(_0x63fb88[_0x097b('0x12')]['message']);}else{logger[_0x097b('0x15')](_0x097b('0xe'),_0x58f67a,_0x097b('0x10'));_0x3177c1(_0x63fb88[_0x097b('0x16')][_0x097b('0x14')]);}})[_0x097b('0x17')](function(_0x265993){logger[_0x097b('0x12')](_0x097b('0xe'),_0x58f67a,_0x265993);_0x1a430d(_0x265993);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e20f54e..fc6a167 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 _0x326f=['show','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x326f,0xd1));var _0xf326=function(_0x1c30e9,_0x218649){_0x1c30e9=_0x1c30e9-0x0;var _0x3a13bb=_0x326f[_0x1c30e9];return _0x3a13bb;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xe')]);router[_0xf326('0xf')](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x10')]);module['exports']=router; \ No newline at end of file +var _0xba34=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','./analyticMetric.controller'];(function(_0x14f641,_0x1e2063){var _0x128dcf=function(_0x1ad96d){while(--_0x1ad96d){_0x14f641['push'](_0x14f641['shift']());}};_0x128dcf(++_0x1e2063);}(_0xba34,0x119));var _0x4ba3=function(_0x102cf0,_0x36291e){_0x102cf0=_0x102cf0-0x0;var _0x2e46d6=_0xba34[_0x102cf0];return _0x2e46d6;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ba3('0x5'));var controller=require(_0x4ba3('0x6'));router[_0x4ba3('0x7')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0x9')]);router[_0x4ba3('0x7')](_0x4ba3('0xa'),auth['isAuthenticated'](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0xc')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller['destroy']);module[_0x4ba3('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0f15060..44bcf28 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 _0x3d29=['sequelize','exports'];(function(_0x22e7c5,_0x1bdc90){var _0x47de2c=function(_0x2b6962){while(--_0x2b6962){_0x22e7c5['push'](_0x22e7c5['shift']());}};_0x47de2c(++_0x1bdc90);}(_0x3d29,0x15c));var _0x93d2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3d29[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x93d2('0x0'));module[_0x93d2('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x622d=['TEXT','sequelize','exports'];(function(_0x3ecd75,_0x1dc887){var _0x5a3141=function(_0x21bf7d){while(--_0x21bf7d){_0x3ecd75['push'](_0x3ecd75['shift']());}};_0x5a3141(++_0x1dc887);}(_0x622d,0xe8));var _0xd622=function(_0x1e1ea1,_0x24f4d1){_0x1e1ea1=_0x1e1ea1-0x0;var _0x47485f=_0x622d[_0x1e1ea1];return _0x47485f;};'use strict';var Sequelize=require(_0xd622('0x0'));module[_0xd622('0x1')]={'tree':{'type':Sequelize[_0xd622('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4a031b5..ea969c4 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 _0xac4a=['set','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','params','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit'];(function(_0x1cff93,_0x132b43){var _0x2ececc=function(_0x328808){while(--_0x328808){_0x1cff93['push'](_0x1cff93['shift']());}};_0x2ececc(++_0x132b43);}(_0xac4a,0x13f));var _0xaac4=function(_0xf06204,_0x38fea1){_0xf06204=_0xf06204-0x0;var _0xfa2485=_0xac4a[_0xf06204];return _0xfa2485;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2348c2,_0x2e2d02){_0x2e2d02=_0x2e2d02||0xcc;return function(_0x45e512){if(_0x45e512){return _0x2348c2['sendStatus'](_0x2e2d02);}return _0x2348c2[_0xaac4('0x14')](_0x2e2d02)[_0xaac4('0x15')]();};}function respondWithResult(_0x5bcacd,_0xf06b1d){_0xf06b1d=_0xf06b1d||0xc8;return function(_0x2b20d0){if(_0x2b20d0){return _0x5bcacd[_0xaac4('0x14')](_0xf06b1d)[_0xaac4('0x16')](_0x2b20d0);}};}function respondWithFilteredResult(_0x187624,_0x2fbeb7){return function(_0x31b7e5){if(_0x31b7e5){var _0x1df9ae=_0x31b7e5[_0xaac4('0x17')],_0x233278=_0x2fbeb7[_0xaac4('0x18')],_0xb8466e=_0x2fbeb7['offset']+_0x2fbeb7[_0xaac4('0x19')],_0x35bc32;if(_0xb8466e>=_0x1df9ae){_0xb8466e=_0x1df9ae;_0x35bc32=0xc8;}else{_0x35bc32=0xce;}_0x187624['status'](_0x35bc32);return _0x187624[_0xaac4('0x1a')]('Content-Range',_0x233278+'-'+_0xb8466e+'/'+_0x1df9ae)[_0xaac4('0x16')](_0x31b7e5);}return null;};}function patchUpdates(_0x27fe7b){return function(_0xa22b76){try{jsonpatch[_0xaac4('0x1b')](_0xa22b76,_0x27fe7b,!![]);}catch(_0x3cbcb1){return BPromise[_0xaac4('0x1c')](_0x3cbcb1);}return _0xa22b76[_0xaac4('0x1d')]();};}function saveUpdates(_0x25b946,_0x4166ee){return function(_0x480fb0){if(_0x480fb0){return _0x480fb0[_0xaac4('0x1e')](_0x25b946)['then'](function(_0x3303f1){return _0x3303f1;});}return null;};}function removeEntity(_0x2013b7,_0x43625c){return function(_0x477b77){if(_0x477b77){return _0x477b77[_0xaac4('0x1f')]()[_0xaac4('0x20')](function(){_0x2013b7['status'](0xcc)[_0xaac4('0x15')]();});}};}function handleEntityNotFound(_0x27a84d,_0x174860){return function(_0x4f10ec){if(!_0x4f10ec){_0x27a84d[_0xaac4('0x21')](0x194);}return _0x4f10ec;};}function handleError(_0x2dcc59,_0xb2577b){_0xb2577b=_0xb2577b||0x1f4;return function(_0x577b3d){logger[_0xaac4('0x22')](_0x577b3d['stack']);if(_0x577b3d['name']){delete _0x577b3d['name'];}_0x2dcc59['status'](_0xb2577b)[_0xaac4('0x23')](_0x577b3d);};}exports[_0xaac4('0x24')]=function(_0x22cda2,_0xe93120){var _0x3c1445={},_0x249a5d={},_0x43b122={'count':0x0,'rows':[]};var _0x2d68b6=_[_0xaac4('0x25')](db[_0xaac4('0x26')]['rawAttributes'],function(_0x316445){return{'name':_0x316445[_0xaac4('0x27')],'type':_0x316445[_0xaac4('0x28')][_0xaac4('0x29')]};});_0x249a5d[_0xaac4('0x2a')]=_[_0xaac4('0x25')](_0x2d68b6,'name');_0x249a5d[_0xaac4('0x2b')]=_['keys'](_0x22cda2[_0xaac4('0x2b')]);_0x249a5d[_0xaac4('0x2c')]=_[_0xaac4('0x2d')](_0x249a5d[_0xaac4('0x2a')],_0x249a5d['query']);_0x3c1445['attributes']=_['intersection'](_0x249a5d[_0xaac4('0x2a')],qs[_0xaac4('0x2e')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x2e')]));_0x3c1445[_0xaac4('0x2f')]=_0x3c1445[_0xaac4('0x2f')][_0xaac4('0x30')]?_0x3c1445[_0xaac4('0x2f')]:_0x249a5d[_0xaac4('0x2a')];if(!_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x31')](_0xaac4('0x32'))){_0x3c1445[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x22cda2[_0xaac4('0x2b')]['limit']);_0x3c1445['offset']=qs[_0xaac4('0x18')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x18')]);}_0x3c1445['order']=qs[_0xaac4('0x33')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x33')]);_0x3c1445[_0xaac4('0x34')]=qs[_0xaac4('0x2c')](_[_0xaac4('0x35')](_0x22cda2[_0xaac4('0x2b')],_0x249a5d['filters']));if(_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x36')]){_0x3c1445[_0xaac4('0x34')]=_['merge'](_0x3c1445[_0xaac4('0x34')],{'$or':_['map'](_0x2d68b6,function(_0x577b5b){if(_0x577b5b[_0xaac4('0x28')]!==_0xaac4('0x37')){var _0x2da28a={};_0x2da28a[_0x577b5b['name']]={'$like':'%'+_0x22cda2['query'][_0xaac4('0x36')]+'%'};return _0x2da28a;}})});}_0x3c1445=_[_0xaac4('0x38')]({},_0x3c1445,_0x22cda2[_0xaac4('0x39')]);var _0x268295={'where':_0x3c1445[_0xaac4('0x34')]};return db[_0xaac4('0x26')]['count'](_0x268295)['then'](function(_0x220bdc){_0x43b122[_0xaac4('0x17')]=_0x220bdc;if(_0x22cda2['query'][_0xaac4('0x3a')]){_0x3c1445[_0xaac4('0x3b')]=[{'all':!![]}];}return db[_0xaac4('0x26')]['findAll'](_0x3c1445);})[_0xaac4('0x20')](function(_0x4a4773){_0x43b122[_0xaac4('0x3c')]=_0x4a4773;return _0x43b122;})['then'](respondWithFilteredResult(_0xe93120,_0x3c1445))[_0xaac4('0x3d')](handleError(_0xe93120,null));};exports[_0xaac4('0x3e')]=function(_0x3dcade,_0x33bf83){var _0x51e59d={'raw':!![],'where':{'id':_0x3dcade['params']['id']}},_0x247fea={};_0x247fea['model']=_[_0xaac4('0x3f')](db[_0xaac4('0x26')][_0xaac4('0x40')]);_0x247fea[_0xaac4('0x2b')]=_[_0xaac4('0x3f')](_0x3dcade[_0xaac4('0x2b')]);_0x247fea[_0xaac4('0x2c')]=_[_0xaac4('0x2d')](_0x247fea['model'],_0x247fea[_0xaac4('0x2b')]);_0x51e59d[_0xaac4('0x2f')]=_[_0xaac4('0x2d')](_0x247fea[_0xaac4('0x2a')],qs['fields'](_0x3dcade[_0xaac4('0x2b')][_0xaac4('0x2e')]));_0x51e59d[_0xaac4('0x2f')]=_0x51e59d['attributes'][_0xaac4('0x30')]?_0x51e59d[_0xaac4('0x2f')]:_0x247fea[_0xaac4('0x2a')];if(_0x3dcade[_0xaac4('0x2b')]['includeAll']){_0x51e59d[_0xaac4('0x3b')]=[{'all':!![]}];}_0x51e59d=_[_0xaac4('0x38')]({},_0x51e59d,_0x3dcade[_0xaac4('0x39')]);return db['AnalyticTreeReport'][_0xaac4('0x41')](_0x51e59d)[_0xaac4('0x20')](handleEntityNotFound(_0x33bf83,null))[_0xaac4('0x20')](respondWithResult(_0x33bf83,null))[_0xaac4('0x3d')](handleError(_0x33bf83,null));};exports[_0xaac4('0x42')]=function(_0x1ad713,_0x25e1b1){return db[_0xaac4('0x26')][_0xaac4('0x42')](_0x1ad713['body'],{})[_0xaac4('0x20')](respondWithResult(_0x25e1b1,0xc9))[_0xaac4('0x3d')](handleError(_0x25e1b1,null));};exports[_0xaac4('0x1e')]=function(_0x360420,_0x130bb5){if(_0x360420['body']['id']){delete _0x360420['body']['id'];}return db[_0xaac4('0x26')][_0xaac4('0x41')]({'where':{'id':_0x360420[_0xaac4('0x43')]['id']}})[_0xaac4('0x20')](handleEntityNotFound(_0x130bb5,null))['then'](saveUpdates(_0x360420[_0xaac4('0x44')],null))['then'](respondWithResult(_0x130bb5,null))[_0xaac4('0x3d')](handleError(_0x130bb5,null));};exports[_0xaac4('0x1f')]=function(_0x487203,_0x282de3){return db[_0xaac4('0x26')][_0xaac4('0x41')]({'where':{'id':_0x487203['params']['id']}})['then'](handleEntityNotFound(_0x282de3,null))[_0xaac4('0x20')](removeEntity(_0x282de3,null))[_0xaac4('0x3d')](handleError(_0x282de3,null));}; \ No newline at end of file +var _0xe706=['includeAll','options','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','AnalyticTreeReport','include','findAll','rows','params'];(function(_0x3b39f4,_0x4fcbf0){var _0x2d8acc=function(_0x19d7e6){while(--_0x19d7e6){_0x3b39f4['push'](_0x3b39f4['shift']());}};_0x2d8acc(++_0x4fcbf0);}(_0xe706,0xa3));var _0x6e70=function(_0x5ac8fe,_0x143e86){_0x5ac8fe=_0x5ac8fe-0x0;var _0x243105=_0xe706[_0x5ac8fe];return _0x243105;};'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 as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['AnalyticTreeReport'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]));if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type']!==_0x6e70('0x41')){var _0x3841a0={};_0x3841a0[_0x5446a2[_0x6e70('0x29')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x3841a0;}})});}_0x2c4d37=_[_0x6e70('0x40')]({},_0x2c4d37,_0x4a67ac['options']);var _0x3b508c={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x42')][_0x6e70('0x1f')](_0x3b508c)[_0x6e70('0x27')](function(_0x37bf46){_0x83c836[_0x6e70('0x1f')]=_0x37bf46;if(_0x4a67ac[_0x6e70('0x32')]['includeAll']){_0x2c4d37[_0x6e70('0x43')]=[{'all':!![]}];}return db[_0x6e70('0x42')][_0x6e70('0x44')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x201da9){_0x83c836[_0x6e70('0x45')]=_0x201da9;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};exports['show']=function(_0x5ae898,_0x154e0c){var _0x2b63cc={'raw':!![],'where':{'id':_0x5ae898[_0x6e70('0x46')]['id']}},_0x83847b={};_0x83847b[_0x6e70('0x31')]=_['keys'](db[_0x6e70('0x42')][_0x6e70('0x2d')]);_0x83847b[_0x6e70('0x32')]=_['keys'](_0x5ae898['query']);_0x83847b['filters']=_[_0x6e70('0x36')](_0x83847b['model'],_0x83847b[_0x6e70('0x32')]);_0x2b63cc[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x83847b[_0x6e70('0x31')],qs['fields'](_0x5ae898[_0x6e70('0x32')]['fields']));_0x2b63cc[_0x6e70('0x35')]=_0x2b63cc[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2b63cc[_0x6e70('0x35')]:_0x83847b['model'];if(_0x5ae898[_0x6e70('0x32')][_0x6e70('0x47')]){_0x2b63cc[_0x6e70('0x43')]=[{'all':!![]}];}_0x2b63cc=_[_0x6e70('0x40')]({},_0x2b63cc,_0x5ae898[_0x6e70('0x48')]);return db[_0x6e70('0x42')][_0x6e70('0x49')](_0x2b63cc)['then'](handleEntityNotFound(_0x154e0c,null))[_0x6e70('0x27')](respondWithResult(_0x154e0c,null))[_0x6e70('0x4a')](handleError(_0x154e0c,null));};exports[_0x6e70('0x4b')]=function(_0x2f99cb,_0x3f86cf){return db[_0x6e70('0x42')][_0x6e70('0x4b')](_0x2f99cb['body'],{})[_0x6e70('0x27')](respondWithResult(_0x3f86cf,0xc9))['catch'](handleError(_0x3f86cf,null));};exports[_0x6e70('0x26')]=function(_0x3836e4,_0x4b351e){if(_0x3836e4['body']['id']){delete _0x3836e4[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x3836e4['params']['id']}})['then'](handleEntityNotFound(_0x4b351e,null))[_0x6e70('0x27')](saveUpdates(_0x3836e4[_0x6e70('0x4c')],null))[_0x6e70('0x27')](respondWithResult(_0x4b351e,null))[_0x6e70('0x4a')](handleError(_0x4b351e,null));};exports[_0x6e70('0x4d')]=function(_0x340674,_0x4ad5a9){return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x340674[_0x6e70('0x46')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x4ad5a9,null))[_0x6e70('0x27')](removeEntity(_0x4ad5a9,null))['catch'](handleError(_0x4ad5a9,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index af9e3ed..877bc32 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 _0x3f48=['../../config/logger','api','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x4eee11,_0x4a9b78){var _0x2d014f=function(_0xfb1e4e){while(--_0xfb1e4e){_0x4eee11['push'](_0x4eee11['shift']());}};_0x2d014f(++_0x4a9b78);}(_0x3f48,0x17c));var _0x83f4=function(_0x21fdf4,_0x3a5a01){_0x21fdf4=_0x21fdf4-0x0;var _0x25dae3=_0x3f48[_0x21fdf4];return _0x25dae3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x83f4('0x0'))(_0x83f4('0x1'));var moment=require(_0x83f4('0x2'));var BPromise=require(_0x83f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x83f4('0x4'));var rimraf=require(_0x83f4('0x5'));var config=require('../../config/environment');var attributes=require(_0x83f4('0x6'));module['exports']=function(_0x3a3551,_0x6cca1b){return _0x3a3551[_0x83f4('0x7')](_0x83f4('0x8'),attributes,{'tableName':_0x83f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3b3=['path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x45b4f3,_0x3a270b){_0x45b4f3=_0x45b4f3-0x0;var _0x11e35b=_0xe3b3[_0x45b4f3];return _0x11e35b;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var logger=require(_0x3e3b('0x2'))(_0x3e3b('0x3'));var moment=require(_0x3e3b('0x4'));var BPromise=require(_0x3e3b('0x5'));var rp=require(_0x3e3b('0x6'));var fs=require('fs');var path=require(_0x3e3b('0x7'));var rimraf=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0x3e3b('0xa')]=function(_0x3fd79a,_0x410458){return _0x3fd79a['define'](_0x3e3b('0xb'),attributes,{'tableName':_0x3e3b('0xc'),'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 b2292ee..a1adb87 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 _0xa68c=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x633c,_0xbf2cbc){var _0x245760=function(_0x43922b){while(--_0x43922b){_0x633c['push'](_0x633c['shift']());}};_0x245760(++_0xbf2cbc);}(_0xa68c,0x1a4));var _0xca68=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xa68c[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xca68('0x0'));var util=require(_0xca68('0x1'));var moment=require(_0xca68('0x2'));var BPromise=require('bluebird');var rs=require(_0xca68('0x3'));var fs=require('fs');var Redis=require(_0xca68('0x4'));var db=require(_0xca68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca68('0x6'))(_0xca68('0x7'));var config=require(_0xca68('0x8'));var jayson=require(_0xca68('0x9'));var client=jayson[_0xca68('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3029c3,_0x286a32,_0x3b1790){return new BPromise(function(_0x23eeaf,_0x4eced0){return client[_0xca68('0xb')](_0x3029c3,_0x3b1790)[_0xca68('0xc')](function(_0x4e02c8){logger['info'](_0xca68('0xd'),_0x286a32,_0xca68('0xe'));logger[_0xca68('0xf')](_0xca68('0x10'),_0x286a32,_0xca68('0xe'),JSON[_0xca68('0x11')](_0x4e02c8));if(_0x4e02c8[_0xca68('0x12')]){if(_0x4e02c8[_0xca68('0x12')][_0xca68('0x13')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x286a32,_0x4e02c8[_0xca68('0x12')][_0xca68('0x14')]);return _0x4eced0(_0x4e02c8[_0xca68('0x12')][_0xca68('0x14')]);}logger['error'](_0xca68('0xd'),_0x286a32,_0x4e02c8[_0xca68('0x12')][_0xca68('0x14')]);return _0x23eeaf(_0x4e02c8[_0xca68('0x12')][_0xca68('0x14')]);}else{logger['info'](_0xca68('0xd'),_0x286a32,_0xca68('0xe'));_0x23eeaf(_0x4e02c8['result'][_0xca68('0x14')]);}})[_0xca68('0x15')](function(_0x3908da){logger[_0xca68('0x12')](_0xca68('0xd'),_0x286a32,_0x3908da);_0x4eced0(_0x3908da);});});} \ No newline at end of file +var _0x6478=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','AnalyticTreeReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x6478,0x97));var _0x8647=function(_0x141352,_0x5aa338){_0x141352=_0x141352-0x0;var _0x3d8110=_0x6478[_0x141352];return _0x3d8110;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var moment=require(_0x8647('0x2'));var BPromise=require(_0x8647('0x3'));var rs=require(_0x8647('0x4'));var fs=require('fs');var Redis=require(_0x8647('0x5'));var db=require(_0x8647('0x6'))['db'];var utils=require(_0x8647('0x7'));var logger=require(_0x8647('0x8'))(_0x8647('0x9'));var config=require(_0x8647('0xa'));var jayson=require(_0x8647('0xb'));var client=jayson[_0x8647('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53f279,_0x291363,_0x1389a5){return new BPromise(function(_0x16b8b9,_0x16c73c){return client[_0x8647('0xd')](_0x53f279,_0x1389a5)[_0x8647('0xe')](function(_0x155f2c){logger[_0x8647('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x291363,_0x8647('0x10'));logger[_0x8647('0x11')](_0x8647('0x12'),_0x291363,_0x8647('0x10'),JSON['stringify'](_0x155f2c));if(_0x155f2c[_0x8647('0x13')]){if(_0x155f2c[_0x8647('0x13')]['code']===0x1f4){logger[_0x8647('0x13')](_0x8647('0x14'),_0x291363,_0x155f2c[_0x8647('0x13')]['message']);return _0x16c73c(_0x155f2c[_0x8647('0x13')][_0x8647('0x15')]);}logger[_0x8647('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x291363,_0x155f2c[_0x8647('0x13')]['message']);return _0x16b8b9(_0x155f2c[_0x8647('0x13')][_0x8647('0x15')]);}else{logger[_0x8647('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x291363,_0x8647('0x10'));_0x16b8b9(_0x155f2c[_0x8647('0x16')]['message']);}})['catch'](function(_0x4040d7){logger['error'](_0x8647('0x14'),_0x291363,_0x4040d7);_0x16c73c(_0x4040d7);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7d6daca..0b6c27f 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 _0xec2e=['destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete'];(function(_0x49ac1d,_0x14bdfb){var _0x2b38be=function(_0x3a14dd){while(--_0x3a14dd){_0x49ac1d['push'](_0x49ac1d['shift']());}};_0x2b38be(++_0x14bdfb);}(_0xec2e,0x155));var _0xeec2=function(_0x468273,_0x20cf62){_0x468273=_0x468273-0x0;var _0x364928=_0xec2e[_0x468273];return _0x364928;};'use strict';var multer=require('multer');var util=require(_0xeec2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeec2('0x1'));var router=express[_0xeec2('0x2')]();var auth=require(_0xeec2('0x3'));var interaction=require(_0xeec2('0x4'));var config=require(_0xeec2('0x5'));var controller=require(_0xeec2('0x6'));router[_0xeec2('0x7')]('/',auth['isAuthenticated'](),controller[_0xeec2('0x8')]);router[_0xeec2('0x7')](_0xeec2('0x9'),auth[_0xeec2('0xa')](),controller['show']);router[_0xeec2('0xb')]('/',auth['isAuthenticated'](),controller[_0xeec2('0xc')]);router[_0xeec2('0xd')](_0xeec2('0x9'),auth[_0xeec2('0xa')](),controller[_0xeec2('0xe')]);router[_0xeec2('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xeec2('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb0db=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x26cb40,_0x1f0309){var _0x3b4e66=function(_0x3865b9){while(--_0x3865b9){_0x26cb40['push'](_0x26cb40['shift']());}};_0x3b4e66(++_0x1f0309);}(_0xb0db,0xc0));var _0xbb0d=function(_0x3040be,_0x3354a0){_0x3040be=_0x3040be-0x0;var _0x3746d9=_0xb0db[_0x3040be];return _0x3746d9;};'use strict';var multer=require(_0xbb0d('0x0'));var util=require(_0xbb0d('0x1'));var path=require('path');var timeout=require(_0xbb0d('0x2'));var express=require(_0xbb0d('0x3'));var router=express[_0xbb0d('0x4')]();var auth=require(_0xbb0d('0x5'));var interaction=require(_0xbb0d('0x6'));var config=require(_0xbb0d('0x7'));var controller=require(_0xbb0d('0x8'));router[_0xbb0d('0x9')]('/',auth[_0xbb0d('0xa')](),controller[_0xbb0d('0xb')]);router['get'](_0xbb0d('0xc'),auth['isAuthenticated'](),controller[_0xbb0d('0xd')]);router[_0xbb0d('0xe')]('/',auth[_0xbb0d('0xa')](),controller['create']);router[_0xbb0d('0xf')](_0xbb0d('0xc'),auth[_0xbb0d('0xa')](),controller[_0xbb0d('0x10')]);router[_0xbb0d('0x11')]('/:id',auth[_0xbb0d('0xa')](),controller[_0xbb0d('0x12')]);module[_0xbb0d('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 50d2213..1723cb9 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 _0x5874=['exports','STRING','sequelize'];(function(_0x4ad329,_0x28df8c){var _0x57539b=function(_0x2ba7b4){while(--_0x2ba7b4){_0x4ad329['push'](_0x4ad329['shift']());}};_0x57539b(++_0x28df8c);}(_0x5874,0x1e2));var _0x4587=function(_0x2a4e95,_0x16e2c0){_0x2a4e95=_0x2a4e95-0x0;var _0x2aef2a=_0x5874[_0x2a4e95];return _0x2aef2a;};'use strict';var Sequelize=require(_0x4587('0x0'));module[_0x4587('0x1')]={'name':{'type':Sequelize[_0x4587('0x2')]},'basename':{'type':Sequelize[_0x4587('0x2')]},'type':{'type':Sequelize[_0x4587('0x2')]}}; \ No newline at end of file +var _0x9715=['STRING','sequelize'];(function(_0x152d29,_0x434d4d){var _0x5aef4c=function(_0x40572d){while(--_0x40572d){_0x152d29['push'](_0x152d29['shift']());}};_0x5aef4c(++_0x434d4d);}(_0x9715,0x1b9));var _0x5971=function(_0x22aa61,_0x45e107){_0x22aa61=_0x22aa61-0x0;var _0x51500a=_0x9715[_0x22aa61];return _0x51500a;};'use strict';var Sequelize=require(_0x5971('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x5971('0x1')]},'type':{'type':Sequelize[_0x5971('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 0bbef40..53906fa 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 _0xa5ba=['include','findAll','rows','catch','show','params','keys','find','clone','get','omit','createdAt','body','updatedAt','create','update','file','originalname','filename','download','findOne','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll'];(function(_0x1d6dea,_0x1f8978){var _0x1b5967=function(_0x4a95f6){while(--_0x4a95f6){_0x1d6dea['push'](_0x1d6dea['shift']());}};_0x1b5967(++_0x1f8978);}(_0xa5ba,0x118));var _0xaa5b=function(_0x646821,_0x374c2e){_0x646821=_0x646821-0x0;var _0x54864a=_0xa5ba[_0x646821];return _0x54864a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa5b('0x0'));var rimraf=require(_0xaa5b('0x1'));var zipdir=require(_0xaa5b('0x2'));var jsonpatch=require(_0xaa5b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa5b('0x4'));var util=require(_0xaa5b('0x5'));var path=require('path');var sox=require(_0xaa5b('0x6'));var csv=require(_0xaa5b('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa5b('0x8'));var squel=require(_0xaa5b('0x9'));var crypto=require(_0xaa5b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaa5b('0x7'));var querystring=require(_0xaa5b('0xb'));var Papa=require(_0xaa5b('0xc'));var Redis=require(_0xaa5b('0xd'));var authService=require(_0xaa5b('0xe'));var qs=require(_0xaa5b('0xf'));var as=require(_0xaa5b('0x10'));var hardwareService=require(_0xaa5b('0x11'));var logger=require(_0xaa5b('0x12'))(_0xaa5b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xaa5b('0x14'))['db'];function respondWithStatusCode(_0x3d7e00,_0x3a8409){_0x3a8409=_0x3a8409||0xcc;return function(_0x332e6b){if(_0x332e6b){return _0x3d7e00[_0xaa5b('0x15')](_0x3a8409);}return _0x3d7e00[_0xaa5b('0x16')](_0x3a8409)[_0xaa5b('0x17')]();};}function respondWithResult(_0x3f3b87,_0x393168){_0x393168=_0x393168||0xc8;return function(_0x403fcc){if(_0x403fcc){return _0x3f3b87[_0xaa5b('0x16')](_0x393168)[_0xaa5b('0x18')](_0x403fcc);}};}function respondWithFilteredResult(_0x4706e2,_0x59b96a){return function(_0x21ccc3){if(_0x21ccc3){var _0x35c0c8=_0x21ccc3[_0xaa5b('0x19')],_0x34e2df=_0x59b96a[_0xaa5b('0x1a')],_0xd064a=_0x59b96a[_0xaa5b('0x1a')]+_0x59b96a[_0xaa5b('0x1b')],_0x3088ae;if(_0xd064a>=_0x35c0c8){_0xd064a=_0x35c0c8;_0x3088ae=0xc8;}else{_0x3088ae=0xce;}_0x4706e2['status'](_0x3088ae);return _0x4706e2['set']('Content-Range',_0x34e2df+'-'+_0xd064a+'/'+_0x35c0c8)['json'](_0x21ccc3);}return null;};}function patchUpdates(_0x265d87){return function(_0x3a0722){try{jsonpatch[_0xaa5b('0x1c')](_0x3a0722,_0x265d87,!![]);}catch(_0x307b34){return BPromise[_0xaa5b('0x1d')](_0x307b34);}return _0x3a0722[_0xaa5b('0x1e')]();};}function saveUpdates(_0x1feb42,_0x4acf0e){return function(_0x2d62e9){if(_0x2d62e9){return _0x2d62e9['update'](_0x1feb42)['then'](function(_0x2d64f5){return _0x2d64f5;});}return null;};}function removeEntity(_0x38bbe0,_0x44d84d){return function(_0x5f0b7e){if(_0x5f0b7e){return _0x5f0b7e['destroy']()['then'](function(){_0x38bbe0[_0xaa5b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f0df,_0x523309){return function(_0x2251bd){if(!_0x2251bd){_0x18f0df[_0xaa5b('0x15')](0x194);}return _0x2251bd;};}function handleError(_0x4602f5,_0x543278){_0x543278=_0x543278||0x1f4;return function(_0x49da80){logger[_0xaa5b('0x1f')](_0x49da80[_0xaa5b('0x20')]);if(_0x49da80[_0xaa5b('0x21')]){delete _0x49da80[_0xaa5b('0x21')];}_0x4602f5['status'](_0x543278)[_0xaa5b('0x22')](_0x49da80);};}exports[_0xaa5b('0x23')]=function(_0x3990b3,_0xc052df){var _0x285db7={},_0x3221c5={},_0x5af587={'count':0x0,'rows':[]};var _0x104f3f=_[_0xaa5b('0x24')](db[_0xaa5b('0x25')][_0xaa5b('0x26')],function(_0x5384c5){return{'name':_0x5384c5['fieldName'],'type':_0x5384c5[_0xaa5b('0x27')][_0xaa5b('0x28')]};});_0x3221c5[_0xaa5b('0x29')]=_[_0xaa5b('0x24')](_0x104f3f,_0xaa5b('0x21'));_0x3221c5['query']=_['keys'](_0x3990b3['query']);_0x3221c5[_0xaa5b('0x2a')]=_['intersection'](_0x3221c5['model'],_0x3221c5[_0xaa5b('0x2b')]);_0x285db7[_0xaa5b('0x2c')]=_[_0xaa5b('0x2d')](_0x3221c5[_0xaa5b('0x29')],qs['fields'](_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x2e')]));_0x285db7[_0xaa5b('0x2c')]=_0x285db7[_0xaa5b('0x2c')][_0xaa5b('0x2f')]?_0x285db7[_0xaa5b('0x2c')]:_0x3221c5[_0xaa5b('0x29')];if(!_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x30')](_0xaa5b('0x31'))){_0x285db7['limit']=qs[_0xaa5b('0x1b')](_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x1b')]);_0x285db7[_0xaa5b('0x1a')]=qs['offset'](_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x1a')]);}_0x285db7[_0xaa5b('0x32')]=qs[_0xaa5b('0x33')](_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x33')]);_0x285db7[_0xaa5b('0x34')]=qs[_0xaa5b('0x2a')](_[_0xaa5b('0x35')](_0x3990b3[_0xaa5b('0x2b')],_0x3221c5[_0xaa5b('0x2a')]));if(_0x3990b3[_0xaa5b('0x2b')]['filter']){_0x285db7['where']=_[_0xaa5b('0x36')](_0x285db7['where'],{'$or':_[_0xaa5b('0x24')](_0x104f3f,function(_0x5dbb79){if(_0x5dbb79[_0xaa5b('0x27')]!==_0xaa5b('0x37')){var _0x25b444={};_0x25b444[_0x5dbb79[_0xaa5b('0x21')]]={'$like':'%'+_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x38')]+'%'};return _0x25b444;}})});}_0x285db7=_['merge']({},_0x285db7,_0x3990b3[_0xaa5b('0x39')]);var _0x53e696={'where':_0x285db7[_0xaa5b('0x34')]};return db[_0xaa5b('0x25')]['count'](_0x53e696)[_0xaa5b('0x3a')](function(_0x21f9a8){_0x5af587[_0xaa5b('0x19')]=_0x21f9a8;if(_0x3990b3[_0xaa5b('0x2b')][_0xaa5b('0x3b')]){_0x285db7[_0xaa5b('0x3c')]=[{'all':!![]}];}return db[_0xaa5b('0x25')][_0xaa5b('0x3d')](_0x285db7);})['then'](function(_0x307b53){_0x5af587[_0xaa5b('0x3e')]=_0x307b53;return _0x5af587;})[_0xaa5b('0x3a')](respondWithFilteredResult(_0xc052df,_0x285db7))[_0xaa5b('0x3f')](handleError(_0xc052df,null));};exports[_0xaa5b('0x40')]=function(_0x591681,_0x3b1b95){var _0x25f541={'raw':!![],'where':{'id':_0x591681[_0xaa5b('0x41')]['id']}},_0xedb5f3={};_0xedb5f3[_0xaa5b('0x29')]=_[_0xaa5b('0x42')](db['Attachment'][_0xaa5b('0x26')]);_0xedb5f3[_0xaa5b('0x2b')]=_[_0xaa5b('0x42')](_0x591681['query']);_0xedb5f3[_0xaa5b('0x2a')]=_[_0xaa5b('0x2d')](_0xedb5f3[_0xaa5b('0x29')],_0xedb5f3['query']);_0x25f541['attributes']=_[_0xaa5b('0x2d')](_0xedb5f3[_0xaa5b('0x29')],qs[_0xaa5b('0x2e')](_0x591681['query']['fields']));_0x25f541['attributes']=_0x25f541['attributes'][_0xaa5b('0x2f')]?_0x25f541[_0xaa5b('0x2c')]:_0xedb5f3['model'];if(_0x591681['query'][_0xaa5b('0x3b')]){_0x25f541[_0xaa5b('0x3c')]=[{'all':!![]}];}_0x25f541=_[_0xaa5b('0x36')]({},_0x25f541,_0x591681[_0xaa5b('0x39')]);return db[_0xaa5b('0x25')][_0xaa5b('0x43')](_0x25f541)['then'](handleEntityNotFound(_0x3b1b95,null))[_0xaa5b('0x3a')](respondWithResult(_0x3b1b95,null))[_0xaa5b('0x3f')](handleError(_0x3b1b95,null));};exports[_0xaa5b('0x44')]=function(_0x3e90de,_0x173c9d){var _0xe76c91={'where':{'id':_0x3e90de[_0xaa5b('0x41')]['id']}},_0x4cf183={};_0x4cf183[_0xaa5b('0x29')]=_[_0xaa5b('0x42')](db[_0xaa5b('0x25')]['rawAttributes']);_0xe76c91[_0xaa5b('0x2c')]=_[_0xaa5b('0x2d')](_0x4cf183[_0xaa5b('0x29')],qs[_0xaa5b('0x2e')](_0x3e90de[_0xaa5b('0x2b')][_0xaa5b('0x2e')]));_0xe76c91[_0xaa5b('0x2c')]=_0xe76c91['attributes'][_0xaa5b('0x2f')]?_0xe76c91[_0xaa5b('0x2c')]:_0x4cf183['model'];if(_0x3e90de[_0xaa5b('0x2b')]['includeAll']){_0xe76c91[_0xaa5b('0x3c')]=[{'all':!![]}];}_0xe76c91=_[_0xaa5b('0x36')]({},_0xe76c91,_0x3e90de[_0xaa5b('0x39')]);return db[_0xaa5b('0x25')][_0xaa5b('0x43')](_0xe76c91)[_0xaa5b('0x3a')](handleEntityNotFound(_0x173c9d,null))['then'](function(_0x1fb4f0){if(_0x1fb4f0){var _0xdf6a04=_0x1fb4f0[_0xaa5b('0x45')]({'plain':!![]});_0xdf6a04=qs[_0xaa5b('0x46')](_0xdf6a04,['id',_0xaa5b('0x47'),'updatedAt']);_0x3e90de['body']=_[_0xaa5b('0x46')](_0x3e90de[_0xaa5b('0x48')],['id',_0xaa5b('0x47'),_0xaa5b('0x49')]);return db[_0xaa5b('0x25')][_0xaa5b('0x4a')](_['merge'](_0xdf6a04,_0x3e90de[_0xaa5b('0x48')]),{'include':_0x3e90de[_0xaa5b('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xaa5b('0x3a')](respondWithResult(_0x173c9d,0xc9))['catch'](handleError(_0x173c9d,null));};exports[_0xaa5b('0x4b')]=function(_0x5a73b7,_0x341d93){if(_0x5a73b7[_0xaa5b('0x48')]['id']){delete _0x5a73b7[_0xaa5b('0x48')]['id'];}return db[_0xaa5b('0x25')]['find']({'where':{'id':_0x5a73b7[_0xaa5b('0x41')]['id']}})[_0xaa5b('0x3a')](handleEntityNotFound(_0x341d93,null))[_0xaa5b('0x3a')](saveUpdates(_0x5a73b7['body'],null))['then'](respondWithResult(_0x341d93,null))[_0xaa5b('0x3f')](handleError(_0x341d93,null));};exports['destroy']=function(_0xb4ec4d,_0x10ac65){return db[_0xaa5b('0x25')][_0xaa5b('0x43')]({'where':{'id':_0xb4ec4d[_0xaa5b('0x41')]['id']}})[_0xaa5b('0x3a')](handleEntityNotFound(_0x10ac65,null))[_0xaa5b('0x3a')](removeEntity(_0x10ac65,null))[_0xaa5b('0x3f')](handleError(_0x10ac65,null));};exports['create']=function(_0x4bdb40,_0x1fdea7,_0x3f287c){_0x4bdb40['body']['name']=_0x4bdb40[_0xaa5b('0x4c')][_0xaa5b('0x4d')];_0x4bdb40['body']['basename']=_0x4bdb40[_0xaa5b('0x4c')][_0xaa5b('0x4e')];_0x4bdb40['body'][_0xaa5b('0x27')]=_0x4bdb40['file']['mimetype'];return db['Attachment'][_0xaa5b('0x4a')](_0x4bdb40[_0xaa5b('0x48')])[_0xaa5b('0x3a')](respondWithResult(_0x1fdea7,0xc9))[_0xaa5b('0x3f')](handleError(_0x1fdea7,null));};exports[_0xaa5b('0x4f')]=function(_0x5802eb,_0x42ddd2,_0x1f1a40){return db[_0xaa5b('0x25')][_0xaa5b('0x50')]({'where':{'id':_0x5802eb['params']['id']},'raw':!![]})[_0xaa5b('0x3a')](handleEntityNotFound(_0x42ddd2,null))['then'](function(_0x25d157){if(_0x25d157){return _0x42ddd2[_0xaa5b('0x4f')](path[_0xaa5b('0x51')](config[_0xaa5b('0x52')],_0xaa5b('0x53'),_0x25d157[_0xaa5b('0x54')]));}})[_0xaa5b('0x3f')](handleError(_0x42ddd2,null));}; \ No newline at end of file +var _0x7457=['join','root','server/files/attachments/','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','send','Attachment','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','catch','clone','get','omit','createdAt','updatedAt','body','find','create','file','basename','filename','download','findOne'];(function(_0x144263,_0x302908){var _0x5ea5f0=function(_0x3936ac){while(--_0x3936ac){_0x144263['push'](_0x144263['shift']());}};_0x5ea5f0(++_0x302908);}(_0x7457,0x153));var _0x7745=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x7457[_0x381589];return _0x2a075d;};'use strict';var pdf=require(_0x7745('0x0'));var emlformat=require(_0x7745('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7745('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7745('0x3'));var moment=require('moment');var BPromise=require(_0x7745('0x4'));var Mustache=require(_0x7745('0x5'));var util=require(_0x7745('0x6'));var path=require(_0x7745('0x7'));var sox=require('sox');var csv=require(_0x7745('0x8'));var ejs=require(_0x7745('0x9'));var fs=require('fs');var _=require(_0x7745('0xa'));var squel=require(_0x7745('0xb'));var crypto=require('crypto');var jsforce=require(_0x7745('0xc'));var deskjs=require(_0x7745('0xd'));var toCsv=require(_0x7745('0x8'));var querystring=require(_0x7745('0xe'));var Papa=require(_0x7745('0xf'));var Redis=require(_0x7745('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7745('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7745('0x12'));var logger=require('../../config/logger')(_0x7745('0x13'));var utils=require(_0x7745('0x14'));var config=require('../../config/environment');var db=require(_0x7745('0x15'))['db'];function respondWithStatusCode(_0x1355b7,_0x3341b5){_0x3341b5=_0x3341b5||0xcc;return function(_0x102ab6){if(_0x102ab6){return _0x1355b7['sendStatus'](_0x3341b5);}return _0x1355b7[_0x7745('0x16')](_0x3341b5)[_0x7745('0x17')]();};}function respondWithResult(_0x3fa2ff,_0x5e6d37){_0x5e6d37=_0x5e6d37||0xc8;return function(_0x1fdcb0){if(_0x1fdcb0){return _0x3fa2ff['status'](_0x5e6d37)['json'](_0x1fdcb0);}};}function respondWithFilteredResult(_0x22e16f,_0x4090f0){return function(_0x538eb9){if(_0x538eb9){var _0x2d0023=_0x538eb9[_0x7745('0x18')],_0x404c18=_0x4090f0[_0x7745('0x19')],_0x316275=_0x4090f0[_0x7745('0x19')]+_0x4090f0[_0x7745('0x1a')],_0x5b0ed7;if(_0x316275>=_0x2d0023){_0x316275=_0x2d0023;_0x5b0ed7=0xc8;}else{_0x5b0ed7=0xce;}_0x22e16f[_0x7745('0x16')](_0x5b0ed7);return _0x22e16f[_0x7745('0x1b')](_0x7745('0x1c'),_0x404c18+'-'+_0x316275+'/'+_0x2d0023)[_0x7745('0x1d')](_0x538eb9);}return null;};}function patchUpdates(_0x3f1d5b){return function(_0xfc16f8){try{jsonpatch['apply'](_0xfc16f8,_0x3f1d5b,!![]);}catch(_0x32101b){return BPromise[_0x7745('0x1e')](_0x32101b);}return _0xfc16f8[_0x7745('0x1f')]();};}function saveUpdates(_0x37d4ab,_0x507d8c){return function(_0x23e70e){if(_0x23e70e){return _0x23e70e[_0x7745('0x20')](_0x37d4ab)[_0x7745('0x21')](function(_0x324acb){return _0x324acb;});}return null;};}function removeEntity(_0x5e8739,_0x433214){return function(_0x3899d4){if(_0x3899d4){return _0x3899d4['destroy']()[_0x7745('0x21')](function(){_0x5e8739[_0x7745('0x16')](0xcc)[_0x7745('0x17')]();});}};}function handleEntityNotFound(_0x45fe5b,_0xbddfa2){return function(_0x2951ad){if(!_0x2951ad){_0x45fe5b[_0x7745('0x22')](0x194);}return _0x2951ad;};}function handleError(_0x5d37eb,_0x5c74b7){_0x5c74b7=_0x5c74b7||0x1f4;return function(_0x37bc24){logger[_0x7745('0x23')](_0x37bc24[_0x7745('0x24')]);if(_0x37bc24[_0x7745('0x25')]){delete _0x37bc24[_0x7745('0x25')];}_0x5d37eb['status'](_0x5c74b7)[_0x7745('0x26')](_0x37bc24);};}exports['index']=function(_0x509b49,_0xbac020){var _0x3b9edf={},_0x333c6c={},_0x13c650={'count':0x0,'rows':[]};var _0x778deb=_['map'](db[_0x7745('0x27')][_0x7745('0x28')],function(_0x24434f){return{'name':_0x24434f[_0x7745('0x29')],'type':_0x24434f[_0x7745('0x2a')][_0x7745('0x2b')]};});_0x333c6c[_0x7745('0x2c')]=_[_0x7745('0x2d')](_0x778deb,_0x7745('0x25'));_0x333c6c[_0x7745('0x2e')]=_['keys'](_0x509b49[_0x7745('0x2e')]);_0x333c6c[_0x7745('0x2f')]=_[_0x7745('0x30')](_0x333c6c[_0x7745('0x2c')],_0x333c6c['query']);_0x3b9edf[_0x7745('0x31')]=_[_0x7745('0x30')](_0x333c6c['model'],qs[_0x7745('0x32')](_0x509b49[_0x7745('0x2e')]['fields']));_0x3b9edf[_0x7745('0x31')]=_0x3b9edf[_0x7745('0x31')][_0x7745('0x33')]?_0x3b9edf[_0x7745('0x31')]:_0x333c6c[_0x7745('0x2c')];if(!_0x509b49[_0x7745('0x2e')]['hasOwnProperty'](_0x7745('0x34'))){_0x3b9edf[_0x7745('0x1a')]=qs[_0x7745('0x1a')](_0x509b49[_0x7745('0x2e')][_0x7745('0x1a')]);_0x3b9edf[_0x7745('0x19')]=qs[_0x7745('0x19')](_0x509b49[_0x7745('0x2e')]['offset']);}_0x3b9edf[_0x7745('0x35')]=qs[_0x7745('0x36')](_0x509b49[_0x7745('0x2e')]['sort']);_0x3b9edf['where']=qs[_0x7745('0x2f')](_[_0x7745('0x37')](_0x509b49[_0x7745('0x2e')],_0x333c6c[_0x7745('0x2f')]));if(_0x509b49[_0x7745('0x2e')]['filter']){_0x3b9edf[_0x7745('0x38')]=_[_0x7745('0x39')](_0x3b9edf[_0x7745('0x38')],{'$or':_[_0x7745('0x2d')](_0x778deb,function(_0x5b3f36){if(_0x5b3f36[_0x7745('0x2a')]!==_0x7745('0x3a')){var _0x1d20ed={};_0x1d20ed[_0x5b3f36[_0x7745('0x25')]]={'$like':'%'+_0x509b49['query'][_0x7745('0x3b')]+'%'};return _0x1d20ed;}})});}_0x3b9edf=_['merge']({},_0x3b9edf,_0x509b49[_0x7745('0x3c')]);var _0x2339a8={'where':_0x3b9edf[_0x7745('0x38')]};return db[_0x7745('0x27')][_0x7745('0x18')](_0x2339a8)['then'](function(_0x27e0d7){_0x13c650[_0x7745('0x18')]=_0x27e0d7;if(_0x509b49[_0x7745('0x2e')][_0x7745('0x3d')]){_0x3b9edf[_0x7745('0x3e')]=[{'all':!![]}];}return db[_0x7745('0x27')][_0x7745('0x3f')](_0x3b9edf);})[_0x7745('0x21')](function(_0x40d42c){_0x13c650[_0x7745('0x40')]=_0x40d42c;return _0x13c650;})['then'](respondWithFilteredResult(_0xbac020,_0x3b9edf))['catch'](handleError(_0xbac020,null));};exports['show']=function(_0x1692c7,_0x37c863){var _0x2dd2de={'raw':!![],'where':{'id':_0x1692c7[_0x7745('0x41')]['id']}},_0x8d66c3={};_0x8d66c3['model']=_['keys'](db[_0x7745('0x27')][_0x7745('0x28')]);_0x8d66c3[_0x7745('0x2e')]=_[_0x7745('0x42')](_0x1692c7[_0x7745('0x2e')]);_0x8d66c3[_0x7745('0x2f')]=_[_0x7745('0x30')](_0x8d66c3['model'],_0x8d66c3[_0x7745('0x2e')]);_0x2dd2de['attributes']=_['intersection'](_0x8d66c3['model'],qs[_0x7745('0x32')](_0x1692c7['query'][_0x7745('0x32')]));_0x2dd2de[_0x7745('0x31')]=_0x2dd2de['attributes'][_0x7745('0x33')]?_0x2dd2de[_0x7745('0x31')]:_0x8d66c3[_0x7745('0x2c')];if(_0x1692c7['query']['includeAll']){_0x2dd2de[_0x7745('0x3e')]=[{'all':!![]}];}_0x2dd2de=_[_0x7745('0x39')]({},_0x2dd2de,_0x1692c7['options']);return db[_0x7745('0x27')]['find'](_0x2dd2de)[_0x7745('0x21')](handleEntityNotFound(_0x37c863,null))[_0x7745('0x21')](respondWithResult(_0x37c863,null))[_0x7745('0x43')](handleError(_0x37c863,null));};exports[_0x7745('0x44')]=function(_0x49c40b,_0x1b8e35){var _0x1ea5f2={'where':{'id':_0x49c40b[_0x7745('0x41')]['id']}},_0x3c218e={};_0x3c218e['model']=_[_0x7745('0x42')](db[_0x7745('0x27')]['rawAttributes']);_0x1ea5f2[_0x7745('0x31')]=_[_0x7745('0x30')](_0x3c218e[_0x7745('0x2c')],qs[_0x7745('0x32')](_0x49c40b[_0x7745('0x2e')][_0x7745('0x32')]));_0x1ea5f2[_0x7745('0x31')]=_0x1ea5f2[_0x7745('0x31')][_0x7745('0x33')]?_0x1ea5f2['attributes']:_0x3c218e[_0x7745('0x2c')];if(_0x49c40b['query']['includeAll']){_0x1ea5f2['include']=[{'all':!![]}];}_0x1ea5f2=_[_0x7745('0x39')]({},_0x1ea5f2,_0x49c40b[_0x7745('0x3c')]);return db[_0x7745('0x27')]['find'](_0x1ea5f2)[_0x7745('0x21')](handleEntityNotFound(_0x1b8e35,null))[_0x7745('0x21')](function(_0x1197ba){if(_0x1197ba){var _0x5eadbd=_0x1197ba[_0x7745('0x45')]({'plain':!![]});_0x5eadbd=qs[_0x7745('0x46')](_0x5eadbd,['id',_0x7745('0x47'),_0x7745('0x48')]);_0x49c40b['body']=_[_0x7745('0x46')](_0x49c40b[_0x7745('0x49')],['id',_0x7745('0x47'),_0x7745('0x48')]);return db[_0x7745('0x27')]['create'](_['merge'](_0x5eadbd,_0x49c40b['body']),{'include':_0x49c40b[_0x7745('0x2e')][_0x7745('0x3d')]?[{'all':!![]}]:undefined});}})[_0x7745('0x21')](respondWithResult(_0x1b8e35,0xc9))['catch'](handleError(_0x1b8e35,null));};exports['update']=function(_0x1f14bf,_0x3053ed){if(_0x1f14bf[_0x7745('0x49')]['id']){delete _0x1f14bf[_0x7745('0x49')]['id'];}return db['Attachment'][_0x7745('0x4a')]({'where':{'id':_0x1f14bf[_0x7745('0x41')]['id']}})[_0x7745('0x21')](handleEntityNotFound(_0x3053ed,null))[_0x7745('0x21')](saveUpdates(_0x1f14bf[_0x7745('0x49')],null))[_0x7745('0x21')](respondWithResult(_0x3053ed,null))['catch'](handleError(_0x3053ed,null));};exports['destroy']=function(_0x231d30,_0x3098dc){return db[_0x7745('0x27')][_0x7745('0x4a')]({'where':{'id':_0x231d30[_0x7745('0x41')]['id']}})[_0x7745('0x21')](handleEntityNotFound(_0x3098dc,null))['then'](removeEntity(_0x3098dc,null))[_0x7745('0x43')](handleError(_0x3098dc,null));};exports[_0x7745('0x4b')]=function(_0x16e1e,_0x9d8c47,_0x3e2779){_0x16e1e[_0x7745('0x49')][_0x7745('0x25')]=_0x16e1e[_0x7745('0x4c')]['originalname'];_0x16e1e[_0x7745('0x49')][_0x7745('0x4d')]=_0x16e1e['file'][_0x7745('0x4e')];_0x16e1e[_0x7745('0x49')]['type']=_0x16e1e[_0x7745('0x4c')]['mimetype'];return db[_0x7745('0x27')][_0x7745('0x4b')](_0x16e1e[_0x7745('0x49')])[_0x7745('0x21')](respondWithResult(_0x9d8c47,0xc9))[_0x7745('0x43')](handleError(_0x9d8c47,null));};exports[_0x7745('0x4f')]=function(_0x2bd278,_0x364776,_0x53cc91){return db[_0x7745('0x27')][_0x7745('0x50')]({'where':{'id':_0x2bd278[_0x7745('0x41')]['id']},'raw':!![]})[_0x7745('0x21')](handleEntityNotFound(_0x364776,null))[_0x7745('0x21')](function(_0x15ce5b){if(_0x15ce5b){return _0x364776['download'](path[_0x7745('0x51')](config[_0x7745('0x52')],_0x7745('0x53'),_0x15ce5b[_0x7745('0x4d')]));}})[_0x7745('0x43')](handleError(_0x364776,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9bd2902..1d90ebb 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 _0xd4a2=['Attachment','attachments','lodash','api','bluebird','path','../../config/environment','./attachment.attributes','exports'];(function(_0x1a4628,_0x5df88d){var _0x2bda1e=function(_0x90812c){while(--_0x90812c){_0x1a4628['push'](_0x1a4628['shift']());}};_0x2bda1e(++_0x5df88d);}(_0xd4a2,0x173));var _0x2d4a=function(_0x366fcd,_0x8fdbc9){_0x366fcd=_0x366fcd-0x0;var _0x3dd274=_0xd4a2[_0x366fcd];return _0x3dd274;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','../../config/logger'];(function(_0x134058,_0x423995){var _0x14a1a9=function(_0x47a2c9){while(--_0x47a2c9){_0x134058['push'](_0x134058['shift']());}};_0x14a1a9(++_0x423995);}(_0xb10b,0x12a));var _0xbb10=function(_0x19a0bc,_0x2f7125){_0x19a0bc=_0x19a0bc-0x0;var _0x4d6c30=_0xb10b[_0x19a0bc];return _0x4d6c30;};'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')]('Attachment',attributes,{'tableName':_0xbb10('0xb'),'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 d90ff23..f0eee2c 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 _0x3b22=['request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','body','options','raw','stringify','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x386708,_0x321f00){var _0x37bca4=function(_0x2dbd02){while(--_0x2dbd02){_0x386708['push'](_0x386708['shift']());}};_0x37bca4(++_0x321f00);}(_0x3b22,0x187));var _0x23b2=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x3b22[_0x16bb4b];return _0x8aeb84;};'use strict';var _=require(_0x23b2('0x0'));var util=require(_0x23b2('0x1'));var moment=require('moment');var BPromise=require(_0x23b2('0x2'));var rs=require(_0x23b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x23b2('0x4'));var logger=require(_0x23b2('0x5'))('rpc');var config=require(_0x23b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23b2('0x7')][_0x23b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8c9f70,_0x1ed8f1,_0x3a0d04){return new BPromise(function(_0x41644e,_0x4b2334){return client[_0x23b2('0x9')](_0x8c9f70,_0x3a0d04)[_0x23b2('0xa')](function(_0x4bcc82){logger['info'](_0x23b2('0xb'),_0x1ed8f1,_0x23b2('0xc'));logger[_0x23b2('0xd')](_0x23b2('0xe'),_0x1ed8f1,'request\x20sent',JSON['stringify'](_0x4bcc82));if(_0x4bcc82[_0x23b2('0xf')]){if(_0x4bcc82[_0x23b2('0xf')][_0x23b2('0x10')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x1ed8f1,_0x4bcc82['error'][_0x23b2('0x11')]);return _0x4b2334(_0x4bcc82[_0x23b2('0xf')][_0x23b2('0x11')]);}logger['error'](_0x23b2('0xb'),_0x1ed8f1,_0x4bcc82[_0x23b2('0xf')][_0x23b2('0x11')]);return _0x41644e(_0x4bcc82[_0x23b2('0xf')][_0x23b2('0x11')]);}else{logger['info'](_0x23b2('0xb'),_0x1ed8f1,'request\x20sent');_0x41644e(_0x4bcc82[_0x23b2('0x12')][_0x23b2('0x11')]);}})[_0x23b2('0x13')](function(_0x225581){logger[_0x23b2('0xf')](_0x23b2('0xb'),_0x1ed8f1,_0x225581);_0x4b2334(_0x225581);});});}exports[_0x23b2('0x14')]=function(_0x2effb9){var _0x4cc9e7=this;return new Promise(function(_0x4d1eaf,_0x206891){return db['Attachment']['create'](_0x2effb9[_0x23b2('0x15')],{'raw':_0x2effb9[_0x23b2('0x16')]?_0x2effb9[_0x23b2('0x16')][_0x23b2('0x17')]===undefined?!![]:![]:!![]})[_0x23b2('0xa')](function(_0x2eb7e){logger['info'](_0x23b2('0x14'),_0x2effb9);logger[_0x23b2('0xd')](_0x23b2('0x14'),_0x2effb9,JSON[_0x23b2('0x18')](_0x2eb7e));_0x4d1eaf(_0x2eb7e);})['catch'](function(_0x537d69){logger[_0x23b2('0xf')](_0x23b2('0x14'),_0x537d69['message'],_0x2effb9);_0x206891(_0x4cc9e7[_0x23b2('0xf')](0x1f4,_0x537d69[_0x23b2('0x11')]));});});}; \ No newline at end of file +var _0x9c51=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','create','body','options','raw','catch','lodash'];(function(_0x80544e,_0x37a3f3){var _0x4f9b90=function(_0x4f95d6){while(--_0x4f95d6){_0x80544e['push'](_0x80544e['shift']());}};_0x4f9b90(++_0x37a3f3);}(_0x9c51,0x18f));var _0x19c5=function(_0x4b5276,_0x5dd6dc){_0x4b5276=_0x4b5276-0x0;var _0x3fb636=_0x9c51[_0x4b5276];return _0x3fb636;};'use strict';var _=require(_0x19c5('0x0'));var util=require(_0x19c5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19c5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19c5('0x3'))['db'];var utils=require(_0x19c5('0x4'));var logger=require(_0x19c5('0x5'))(_0x19c5('0x6'));var config=require(_0x19c5('0x7'));var jayson=require(_0x19c5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45f9ab,_0x44fbef,_0x2f64d0){return new BPromise(function(_0x2227f5,_0x1cf6c4){return client['request'](_0x45f9ab,_0x2f64d0)['then'](function(_0x439bce){logger[_0x19c5('0x9')](_0x19c5('0xa'),_0x44fbef,_0x19c5('0xb'));logger[_0x19c5('0xc')](_0x19c5('0xd'),_0x44fbef,_0x19c5('0xb'),JSON[_0x19c5('0xe')](_0x439bce));if(_0x439bce[_0x19c5('0xf')]){if(_0x439bce[_0x19c5('0xf')][_0x19c5('0x10')]===0x1f4){logger[_0x19c5('0xf')](_0x19c5('0xa'),_0x44fbef,_0x439bce['error'][_0x19c5('0x11')]);return _0x1cf6c4(_0x439bce[_0x19c5('0xf')][_0x19c5('0x11')]);}logger[_0x19c5('0xf')](_0x19c5('0xa'),_0x44fbef,_0x439bce[_0x19c5('0xf')][_0x19c5('0x11')]);return _0x2227f5(_0x439bce[_0x19c5('0xf')][_0x19c5('0x11')]);}else{logger[_0x19c5('0x9')]('Attachment,\x20%s,\x20%s',_0x44fbef,'request\x20sent');_0x2227f5(_0x439bce[_0x19c5('0x12')][_0x19c5('0x11')]);}})['catch'](function(_0xcad535){logger['error'](_0x19c5('0xa'),_0x44fbef,_0xcad535);_0x1cf6c4(_0xcad535);});});}exports[_0x19c5('0x13')]=function(_0x587181){var _0x56f435=this;return new Promise(function(_0x29ff64,_0x5d7ab7){return db['Attachment'][_0x19c5('0x14')](_0x587181[_0x19c5('0x15')],{'raw':_0x587181[_0x19c5('0x16')]?_0x587181['options'][_0x19c5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x25c9a){logger[_0x19c5('0x9')](_0x19c5('0x13'),_0x587181);logger['debug'](_0x19c5('0x13'),_0x587181,JSON['stringify'](_0x25c9a));_0x29ff64(_0x25c9a);})[_0x19c5('0x18')](function(_0x2037a6){logger[_0x19c5('0xf')](_0x19c5('0x13'),_0x2037a6['message'],_0x587181);_0x5d7ab7(_0x56f435[_0x19c5('0xf')](0x1f4,_0x2037a6['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a152d7a..9f2076a 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 _0x9bb3=['/:id','show','/:id/download','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9bb3,0x134));var _0x39bb=function(_0xd1b127,_0x18b201){_0xd1b127=_0xd1b127-0x0;var _0x2d08cf=_0x9bb3[_0xd1b127];return _0x2d08cf;};'use strict';var multer=require(_0x39bb('0x0'));var util=require(_0x39bb('0x1'));var path=require(_0x39bb('0x2'));var timeout=require(_0x39bb('0x3'));var express=require(_0x39bb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x39bb('0x5'));var config=require(_0x39bb('0x6'));var controller=require(_0x39bb('0x7'));router[_0x39bb('0x8')]('/',auth[_0x39bb('0x9')](),controller[_0x39bb('0xa')]);router[_0x39bb('0x8')](_0x39bb('0xb'),auth[_0x39bb('0x9')](),controller[_0x39bb('0xc')]);router[_0x39bb('0x8')](_0x39bb('0xd'),auth[_0x39bb('0x9')](),controller['download']);router['post'](_0x39bb('0xe'),auth[_0x39bb('0x9')](),controller['clone']);var upload=multer({'storage':multer[_0x39bb('0xf')]({'destination':function(_0x5215fb,_0x318814,_0x24207e){_0x24207e(null,path[_0x39bb('0x10')](config['root'],_0x39bb('0x11')));},'filename':function(_0x55eaf3,_0x5cec25,_0x986cf){_0x986cf(null,util[_0x39bb('0x12')](_0x39bb('0x13'),Date[_0x39bb('0x14')](),_0x5cec25[_0x39bb('0x15')][_0x39bb('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x39bb('0x17')]('/',upload['single']('file'),controller[_0x39bb('0x18')]);router['put'](_0x39bb('0xb'),auth[_0x39bb('0x9')](),controller[_0x39bb('0x19')]);router[_0x39bb('0x1a')](_0x39bb('0xb'),auth[_0x39bb('0x9')](),controller[_0x39bb('0x1b')]);module[_0x39bb('0x1c')]=router; \ No newline at end of file +var _0x5ae9=['./attachment.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','clone','diskStorage','root','format','%s-%s','now','replace','single','create','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4b77f5,_0x442a33){var _0xf39992=function(_0x44f353){while(--_0x44f353){_0x4b77f5['push'](_0x4b77f5['shift']());}};_0xf39992(++_0x442a33);}(_0x5ae9,0x19b));var _0x95ae=function(_0x5bd4fc,_0x4fbd8c){_0x5bd4fc=_0x5bd4fc-0x0;var _0x14b56e=_0x5ae9[_0x5bd4fc];return _0x14b56e;};'use strict';var multer=require(_0x95ae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x95ae('0x1'));var express=require(_0x95ae('0x2'));var router=express['Router']();var auth=require(_0x95ae('0x3'));var interaction=require(_0x95ae('0x4'));var config=require('../../config/environment');var controller=require(_0x95ae('0x5'));router['get']('/',auth[_0x95ae('0x6')](),controller[_0x95ae('0x7')]);router[_0x95ae('0x8')](_0x95ae('0x9'),auth[_0x95ae('0x6')](),controller['show']);router['get'](_0x95ae('0xa'),auth[_0x95ae('0x6')](),controller[_0x95ae('0xb')]);router[_0x95ae('0xc')]('/:id/clone',auth['isAuthenticated'](),controller[_0x95ae('0xd')]);var upload=multer({'storage':multer[_0x95ae('0xe')]({'destination':function(_0x7846a2,_0x34b023,_0x4bb632){_0x4bb632(null,path['join'](config[_0x95ae('0xf')],'server/files/attachments/'));},'filename':function(_0x119b2d,_0x2a9b87,_0x530bb8){_0x530bb8(null,util[_0x95ae('0x10')](_0x95ae('0x11'),Date[_0x95ae('0x12')](),_0x2a9b87['originalname'][_0x95ae('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x95ae('0xc')]('/',upload[_0x95ae('0x14')]('file'),controller[_0x95ae('0x15')]);router['put'](_0x95ae('0x9'),auth['isAuthenticated'](),controller[_0x95ae('0x16')]);router[_0x95ae('0x17')](_0x95ae('0x9'),auth[_0x95ae('0x6')](),controller[_0x95ae('0x18')]);module[_0x95ae('0x19')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5b66465..5322b3b 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 _0xdcc9=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login','email','callback','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','emails','value','admin'];(function(_0x35b0cd,_0xa18a9d){var _0x21ee8a=function(_0x250f93){while(--_0x250f93){_0x35b0cd['push'](_0x35b0cd['shift']());}};_0x21ee8a(++_0xa18a9d);}(_0xdcc9,0x17d));var _0x9dcc=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0xdcc9[_0x11309c];return _0x3fea9c;};'use strict';var _=require('lodash');var passport=require(_0x9dcc('0x0'));var GoogleStrategy=require(_0x9dcc('0x1'))[_0x9dcc('0x2')];var moment=require(_0x9dcc('0x3'));var db=require(_0x9dcc('0x4'))['db'];var config=require(_0x9dcc('0x5'));var signToken=require(_0x9dcc('0x6'))[_0x9dcc('0x7')];var utils=require('../../config/utils');exports[_0x9dcc('0x8')]=passport[_0x9dcc('0x9')](_0x9dcc('0xa'),{'failureRedirect':_0x9dcc('0xb'),'scope':['profile',_0x9dcc('0xc')],'session':![]});exports[_0x9dcc('0xd')]=passport['authenticate']('google',{'failureRedirect':'/login','session':![]});passport[_0x9dcc('0xe')](new GoogleStrategy({'clientID':config[_0x9dcc('0xa')]?config[_0x9dcc('0xa')]['clientID']:'id','clientSecret':config[_0x9dcc('0xa')]?config[_0x9dcc('0xa')][_0x9dcc('0xf')]:_0x9dcc('0x10'),'callbackURL':config['google']?config[_0x9dcc('0xa')][_0x9dcc('0x11')]:''},function(_0x207f46,_0x236884,_0x2dc9a1,_0x1422ee){var _0x3ac890,_0x37e526;return db[_0x9dcc('0x12')][_0x9dcc('0x13')]({'where':{'id':0x1},'attributes':[_0x9dcc('0x14'),_0x9dcc('0x15')],'raw':!![]})[_0x9dcc('0x16')](function(_0xfb187a){_0x3ac890=_0xfb187a;return db[_0x9dcc('0x17')]['find']({'where':{'email':_['map'](_0x2dc9a1[_0x9dcc('0x18')],_0x9dcc('0x19')),'role':{'$or':[_0x9dcc('0x1a'),'user',_0x9dcc('0x1b')]}}});})[_0x9dcc('0x16')](function(_0x184698){_0x37e526=_0x184698;if(_0x37e526){if(_0x37e526['disabled']){return _0x1422ee(_0x9dcc('0x1c'));}else if(_0x3ac890[_0x9dcc('0x15')]>0x0){if(_0x37e526['blocked']){if(moment(_0x37e526[_0x9dcc('0x1d')])['add'](_0x3ac890['blockDuration'],_0x9dcc('0x1e'))>moment()){return _0x1422ee('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x9dcc('0x1f')](_0x37e526,0x0,![],null)['then'](function(){return utils[_0x9dcc('0x20')](_0x37e526);})['then'](function(){return _0x1422ee(null,_0x37e526);});}}else{return utils['getLicense'](_0x37e526)[_0x9dcc('0x16')](function(){return _0x1422ee(null,_0x37e526);});}}else{return utils[_0x9dcc('0x20')](_0x37e526)[_0x9dcc('0x16')](function(){return _0x1422ee(null,_0x37e526);});}}return _0x1422ee('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x9dcc('0x21')](function(_0x400b9d){_0x1422ee(_0x400b9d);});})); \ No newline at end of file +var _0xe29f=['admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','getLicense','catch','lodash','passport','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','profile','email','callback','/login','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','find'];(function(_0x3c4070,_0x5e9836){var _0x2a9549=function(_0x180fd3){while(--_0x180fd3){_0x3c4070['push'](_0x3c4070['shift']());}};_0x2a9549(++_0x5e9836);}(_0xe29f,0x1d8));var _0xfe29=function(_0x53f781,_0x2aac26){_0x53f781=_0x53f781-0x0;var _0x56b46c=_0xe29f[_0x53f781];return _0x56b46c;};'use strict';var _=require(_0xfe29('0x0'));var passport=require(_0xfe29('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xfe29('0x2')];var moment=require('moment');var db=require(_0xfe29('0x3'))['db'];var config=require(_0xfe29('0x4'));var signToken=require(_0xfe29('0x5'))[_0xfe29('0x6')];var utils=require(_0xfe29('0x7'));exports['login']=passport[_0xfe29('0x8')](_0xfe29('0x9'),{'failureRedirect':'/login','scope':[_0xfe29('0xa'),_0xfe29('0xb')],'session':![]});exports[_0xfe29('0xc')]=passport[_0xfe29('0x8')](_0xfe29('0x9'),{'failureRedirect':_0xfe29('0xd'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xfe29('0x9')]?config[_0xfe29('0x9')][_0xfe29('0xe')]:'id','clientSecret':config['google']?config['google']['clientSecret']:_0xfe29('0xf'),'callbackURL':config['google']?config['google'][_0xfe29('0x10')]:''},function(_0x41b7cd,_0x1b233b,_0x677391,_0xe66cf4){var _0x16bade,_0x5531a4;return db[_0xfe29('0x11')][_0xfe29('0x12')]({'where':{'id':0x1},'attributes':[_0xfe29('0x13'),'blockDuration'],'raw':!![]})[_0xfe29('0x14')](function(_0x5e855c){_0x16bade=_0x5e855c;return db[_0xfe29('0x15')][_0xfe29('0x16')]({'where':{'email':_['map'](_0x677391['emails'],'value'),'role':{'$or':[_0xfe29('0x17'),_0xfe29('0x18'),_0xfe29('0x19')]}}});})[_0xfe29('0x14')](function(_0x27f70a){_0x5531a4=_0x27f70a;if(_0x5531a4){if(_0x5531a4[_0xfe29('0x1a')]){return _0xe66cf4(_0xfe29('0x1b'));}else if(_0x16bade[_0xfe29('0x1c')]>0x0){if(_0x5531a4[_0xfe29('0x1d')]){if(moment(_0x5531a4['blockedAt'])[_0xfe29('0x1e')](_0x16bade[_0xfe29('0x1c')],'minutes')>moment()){return _0xe66cf4(_0xfe29('0x1b'));}else{return utils['clearBlockUser'](_0x5531a4,0x0,![],null)[_0xfe29('0x14')](function(){return utils[_0xfe29('0x1f')](_0x5531a4);})[_0xfe29('0x14')](function(){return _0xe66cf4(null,_0x5531a4);});}}else{return utils[_0xfe29('0x1f')](_0x5531a4)[_0xfe29('0x14')](function(){return _0xe66cf4(null,_0x5531a4);});}}else{return utils[_0xfe29('0x1f')](_0x5531a4)[_0xfe29('0x14')](function(){return _0xe66cf4(null,_0x5531a4);});}}return _0xe66cf4(_0xfe29('0x1b'));})[_0xfe29('0x20')](function(_0x24524f){_0xe66cf4(_0x24524f);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 76395f6..5a995b9 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 _0xb7c8=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x5aba1b,_0x1d537d){var _0x4adba3=function(_0x161f00){while(--_0x161f00){_0x5aba1b['push'](_0x5aba1b['shift']());}};_0x4adba3(++_0x1d537d);}(_0xb7c8,0x119));var _0x8b7c=function(_0x20d5c0,_0x4f2508){_0x20d5c0=_0x20d5c0-0x0;var _0x30d38f=_0xb7c8[_0x20d5c0];return _0x30d38f;};'use strict';var express=require('express');var passport=require(_0x8b7c('0x0'));var router=express[_0x8b7c('0x1')]();var controller=require(_0x8b7c('0x2'));var userController=require(_0x8b7c('0x3'));var authService=require(_0x8b7c('0x4'));router[_0x8b7c('0x5')]('/',controller[_0x8b7c('0x6')]);router['get'](_0x8b7c('0x7'),controller[_0x8b7c('0x8')],authService[_0x8b7c('0x9')],userController[_0x8b7c('0x6')],authService[_0x8b7c('0xa')]);module[_0x8b7c('0xb')]=router; \ No newline at end of file +var _0x50a8=['isMiddleware','setTokenCookie','exports','express','../user/user.controller.js','get','login','/callback','callback'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x50a8,0x198));var _0x850a=function(_0x5e3022,_0x5ef1ae){_0x5e3022=_0x5e3022-0x0;var _0x1dd4b7=_0x50a8[_0x5e3022];return _0x1dd4b7;};'use strict';var express=require(_0x850a('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x850a('0x1'));var authService=require('../../components/auth/service');router[_0x850a('0x2')]('/',controller[_0x850a('0x3')]);router[_0x850a('0x2')](_0x850a('0x4'),controller[_0x850a('0x5')],authService[_0x850a('0x6')],userController[_0x850a('0x3')],authService[_0x850a('0x7')]);module[_0x850a('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 6e35d6b..06d1e66 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 _0x8afe=['User','util','passport-local','Strategy','jayson/promise','lodash','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','role','disabled','loginAttempts','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','clearBlockUser','blocked','add','minutes','getLicense','catch','MailAccount','find','name','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','message','test','login','local','signToken','json','online','body','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','save','Password\x20reset!','use'];(function(_0x50e40a,_0x3a0f69){var _0x52396d=function(_0x1fd069){while(--_0x1fd069){_0x50e40a['push'](_0x50e40a['shift']());}};_0x52396d(++_0x3a0f69);}(_0x8afe,0xa1));var _0xe8af=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8afe[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0xe8af('0x0'));var passport=require('passport');var LocalStrategy=require(_0xe8af('0x1'))[_0xe8af('0x2')];var jayson=require(_0xe8af('0x3'));var _=require(_0xe8af('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xe8af('0x5'));var utils=require(_0xe8af('0x6'));var client=jayson[_0xe8af('0x7')][_0xe8af('0x8')]({'port':0x232b});function localAuthenticate(_0x428ba8,_0xb4eb80,_0x3d6015,_0x17a1d1){var _0x23c1a5,_0x1f4601;return db[_0xe8af('0x9')][_0xe8af('0xa')]({'where':{'id':0x1},'attributes':[_0xe8af('0xb'),_0xe8af('0xc')],'raw':!![]})[_0xe8af('0xd')](function(_0x3c44a3){_0x23c1a5=_0x3c44a3;return _0x428ba8['findOne']({'attributes':['id','name',_0xe8af('0xe'),'salt',_0xe8af('0xf'),_0xe8af('0x10'),'blocked','blockedAt',_0xe8af('0x11')],'where':{'name':_0xb4eb80,'role':{'$or':['admin',_0xe8af('0x12'),_0xe8af('0x13')]}}});})[_0xe8af('0xd')](function(_0x5f9d6e){if(!_0x5f9d6e||_0x5f9d6e&&_0x5f9d6e['name']!==_0xb4eb80){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1f4601=_0x5f9d6e;return _0x1f4601;}})[_0xe8af('0xd')](function(){_0x1f4601[_0xe8af('0x14')](_0x3d6015,function(_0x3900b1,_0x5cc8fd){var _0xf1a7f4=_0x1f4601[_0xe8af('0x11')]+0x1;if(_0x3900b1){return _0x17a1d1(_0x3900b1);}else if(!_0x5cc8fd){if(_0x1f4601[_0xe8af('0x10')]){return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});}else if(_0x23c1a5[_0xe8af('0xb')]>0x0){if(_0x1f4601['blocked']){if(_0x23c1a5[_0xe8af('0xc')]>0x0){if(moment(_0x1f4601[_0xe8af('0x16')])['add'](_0x23c1a5[_0xe8af('0xc')],'minutes')>moment()){return _0x17a1d1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x1f4601,_0xf1a7f4,![],null)[_0xe8af('0xd')](function(){return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});});}}else{return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});}}else{if(_0xf1a7f4>=_0x23c1a5[_0xe8af('0xb')]){return utils['clearBlockUser'](_0x1f4601,0x0,!![],moment())[_0xe8af('0xd')](function(){return _0x17a1d1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xe8af('0x17')](_0x1f4601,_0xf1a7f4,![],null)[_0xe8af('0xd')](function(){return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});});}}}else{return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});}}else{if(_0x1f4601[_0xe8af('0x10')]){return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});}else if(_0x23c1a5[_0xe8af('0xb')]>0x0){if(_0x1f4601[_0xe8af('0x18')]){if(_0x23c1a5[_0xe8af('0xc')]>0x0){if(moment(_0x1f4601['blockedAt'])[_0xe8af('0x19')](_0x23c1a5[_0xe8af('0xc')],_0xe8af('0x1a'))>moment()){return _0x17a1d1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x1f4601,0x0,![],null)[_0xe8af('0xd')](function(){return utils[_0xe8af('0x1b')](_0x1f4601);})[_0xe8af('0xd')](function(){return _0x17a1d1(null,_0x1f4601);});}}else{return _0x17a1d1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe8af('0x17')](_0x1f4601,0x0,![],null)[_0xe8af('0xd')](function(){return utils[_0xe8af('0x1b')](_0x1f4601);})[_0xe8af('0xd')](function(){return _0x17a1d1(null,_0x1f4601);})[_0xe8af('0x1c')](function(_0x2725cd){return _0x17a1d1(null,![],_0x2725cd);});}}else{if(_0x1f4601[_0xe8af('0x18')]){return _0x17a1d1(null,![],{'message':_0xe8af('0x15')});}else{return utils['getLicense'](_0x1f4601)[_0xe8af('0xd')](function(){return _0x17a1d1(null,_0x1f4601);});}}}});})[_0xe8af('0x1c')](function(_0x5b436e){return _0x17a1d1(null,![],_0x5b436e);});}function sendServiceMail(_0x312356){return db[_0xe8af('0x1d')][_0xe8af('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xe8af('0x1f'),_0xe8af('0x20')],'include':[{'model':db[_0xe8af('0x21')],'as':'Smtp'}]})[_0xe8af('0xd')](function(_0x2c563a){if(!_0x2c563a){throw new Error(_0xe8af('0x22'));}var _0x173438={'tls':{'rejectUnauthorized':![]}};if(_0x2c563a[_0xe8af('0x23')][_0xe8af('0x24')]){_0x173438[_0xe8af('0x24')]=_0x2c563a[_0xe8af('0x23')][_0xe8af('0x24')];}else{_0x173438[_0xe8af('0x25')]=_0x2c563a[_0xe8af('0x23')][_0xe8af('0x25')];_0x173438[_0xe8af('0x26')]=_0x2c563a['Smtp'][_0xe8af('0x26')];_0x173438[_0xe8af('0x27')]=_0x2c563a[_0xe8af('0x23')][_0xe8af('0x27')];}if(_0x2c563a[_0xe8af('0x23')][_0xe8af('0x28')]){_0x173438['auth']={'user':_0x2c563a[_0xe8af('0x23')][_0xe8af('0x12')],'pass':_0x2c563a['Smtp']['pass']};}var _0xb1441d={'account':_0x173438,'message':_[_0xe8af('0x29')]({'from':util[_0xe8af('0x2a')](_0xe8af('0x2b'),_0x2c563a[_0xe8af('0x1f')],_0x2c563a[_0xe8af('0x20')]||_0x2c563a[_0xe8af('0x23')][_0xe8af('0x12')])},_0x312356)};return client['request'](_0xe8af('0x2c'),_0xb1441d);})['then'](function(_0x2f1831){if(_0x2f1831[_0xe8af('0x2d')]){throw new Error(util[_0xe8af('0x2a')](_0xe8af('0x2e'),_0x2f1831['error']['message']||JSON[_0xe8af('0x2f')](_0x2f1831[_0xe8af('0x2d')])));}return!![];});}function handleError(_0x4b1267,_0x5005e6,_0xebd2fe){return _0x4b1267[_0xe8af('0x30')](_0x5005e6||0x1f4)['send']({'message':_0xebd2fe?_0xebd2fe[_0xe8af('0x31')]||_0xebd2fe:''});}function checkPasswordPattern(_0x260737,_0x38a617,_0x53bcd2){if(_0x53bcd2){var _0x35076f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35076f[_0xe8af('0x32')](_0x38a617)){return _0x260737;}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 _0x260737;}}exports[_0xe8af('0x33')]=function(_0x459efa,_0xeccc2b,_0x520587){passport[_0xe8af('0x14')](_0xe8af('0x34'),function(_0x5e2c0b,_0xf1f68a,_0x3b4c4e){var _0x5d3147=_0x5e2c0b||_0x3b4c4e;if(_0x5d3147){return handleError(_0xeccc2b,0x191,_0x5d3147);}if(!_0xf1f68a){return handleError(_0xeccc2b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2f60fb={'payload':{'id':_0xf1f68a['id'],'role':_0xf1f68a[_0xe8af('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xe8af('0x35')](_0x2f60fb)[_0xe8af('0xd')](function(_0x4a4437){_0xeccc2b[_0xe8af('0x36')]({'id':_0xf1f68a['id'],'token':_0x4a4437,'statusCall':'','isAlreadyLogged':_0xf1f68a[_0xe8af('0x37')]});});}})(_0x459efa,_0xeccc2b,_0x520587);};exports['forgot']=function(_0x72ab8c,_0xbd13c1,_0x82cd1f){if(!_0x72ab8c[_0xe8af('0x38')][_0xe8af('0x20')]){return handleError(_0xbd13c1,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x39e138=rs[_0xe8af('0x39')]();_0x72ab8c['body']['email']=_0x72ab8c[_0xe8af('0x38')][_0xe8af('0x20')][_0xe8af('0x3a')]()[_0xe8af('0x3b')]();var _0x3d642f;return db[_0xe8af('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xe8af('0xd')](function(_0x2862a3){_0x3d642f=_0x2862a3;return db['User'][_0xe8af('0x1e')]({'where':{'email':_0x72ab8c['body'][_0xe8af('0x20')]}});})[_0xe8af('0xd')](function(_0x40a6c7){if(!_0x40a6c7){throw new Error(_0xe8af('0x3c'));}if(_0x40a6c7[_0xe8af('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x40a6c7[_0xe8af('0x18')]){if(moment(_0x40a6c7[_0xe8af('0x16')])[_0xe8af('0x19')](_0x3d642f[_0xe8af('0xc')],'minutes')>moment()){throw new Error(_0xe8af('0x3d'));}else{_0x40a6c7[_0xe8af('0x18')]=![];_0x40a6c7['blockedAt']=null;}}_0x40a6c7[_0xe8af('0x3e')]=_0x39e138;_0x40a6c7[_0xe8af('0x3f')]=Date['now']()+0x36ee80;return _0x40a6c7['save']();})['then'](function(){return sendServiceMail({'to':_0x72ab8c[_0xe8af('0x38')][_0xe8af('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe8af('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe8af('0x41')+_0x72ab8c[_0xe8af('0x42')][_0xe8af('0x25')]+'/reset/'+_0x39e138+'\x0a\x0a'+_0xe8af('0x43')});})[_0xe8af('0xd')](function(){_0xbd13c1['status'](0xc8)[_0xe8af('0x44')]({'message':_0xe8af('0x45')});})['catch'](function(_0x5dc888){return handleError(_0xbd13c1,0x1f4,_0x5dc888);});};exports[_0xe8af('0x46')]=function(_0x180063,_0x27a4e0,_0x1eff27){var _0x196389;return db['User'][_0xe8af('0x1e')]({'where':{'resetPasswordToken':_0x180063[_0xe8af('0x47')][_0xe8af('0x48')],'resetPasswordExpires':{'$gt':Date[_0xe8af('0x49')]()}}})['then'](function(_0x889324){_0x196389=_0x889324;if(!_0x196389){throw new Error(_0xe8af('0x4a'));}return db['Setting'][_0xe8af('0xa')]({'attributes':['id',_0xe8af('0x4b')]});})['then'](function(_0x45a257){return checkPasswordPattern(_0x45a257,_0x180063['body'][_0xe8af('0xe')],_0x45a257[_0xe8af('0x4b')]);})[_0xe8af('0xd')](function(){_0x196389[_0xe8af('0xe')]=_0x180063[_0xe8af('0x38')][_0xe8af('0xe')];_0x196389[_0xe8af('0x3e')]=null;_0x196389[_0xe8af('0x3f')]=null;return _0x196389[_0xe8af('0x4c')]();})[_0xe8af('0xd')](function(){_0x27a4e0[_0xe8af('0x30')](0xc8)['send']({'message':_0xe8af('0x4d')});})[_0xe8af('0x1c')](function(_0xe5e28c){return handleError(_0x27a4e0,0x1f4,_0xe5e28c);});};passport[_0xe8af('0x4e')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x1ad20a,_0x3090b1,_0x13611b){return localAuthenticate(db[_0xe8af('0x4f')],_0x1ad20a,_0x3090b1,_0x13611b);})); \ No newline at end of file +var _0x5a0f=['securePassword','resetPasswordToken','resetPasswordExpires','use','util','passport-local','Strategy','moment','../../mysqldb','../../config/utils','client','http','allowedLoginAttempts','then','findOne','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','auth','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','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.','blockedAt','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','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5a0f,0x1e4));var _0xf5a0=function(_0x3fb391,_0x6ac912){_0x3fb391=_0x3fb391-0x0;var _0x4712d0=_0x5a0f[_0x3fb391];return _0x4712d0;};'use strict';var util=require(_0xf5a0('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf5a0('0x1'))[_0xf5a0('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require(_0xf5a0('0x3'));var db=require(_0xf5a0('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf5a0('0x5'));var client=jayson[_0xf5a0('0x6')][_0xf5a0('0x7')]({'port':0x232b});function localAuthenticate(_0x202f8a,_0x36322a,_0x442c73,_0x3c0d2e){var _0x4c0266,_0x29934b;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xf5a0('0x8'),'blockDuration'],'raw':!![]})[_0xf5a0('0x9')](function(_0x3eaf15){_0x4c0266=_0x3eaf15;return _0x202f8a[_0xf5a0('0xa')]({'attributes':['id',_0xf5a0('0xb'),_0xf5a0('0xc'),_0xf5a0('0xd'),_0xf5a0('0xe'),_0xf5a0('0xf'),_0xf5a0('0x10'),'blockedAt',_0xf5a0('0x11')],'where':{'name':_0x36322a,'role':{'$or':[_0xf5a0('0x12'),_0xf5a0('0x13'),_0xf5a0('0x14')]}}});})['then'](function(_0x2e6bc7){if(!_0x2e6bc7||_0x2e6bc7&&_0x2e6bc7['name']!==_0x36322a){throw new Error(_0xf5a0('0x15'));}else{_0x29934b=_0x2e6bc7;return _0x29934b;}})[_0xf5a0('0x9')](function(){_0x29934b['authenticate'](_0x442c73,function(_0xd2c290,_0xbd6e0b){var _0x18cd94=_0x29934b['loginAttempts']+0x1;if(_0xd2c290){return _0x3c0d2e(_0xd2c290);}else if(!_0xbd6e0b){if(_0x29934b[_0xf5a0('0xf')]){return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});}else if(_0x4c0266[_0xf5a0('0x8')]>0x0){if(_0x29934b[_0xf5a0('0x10')]){if(_0x4c0266[_0xf5a0('0x16')]>0x0){if(moment(_0x29934b['blockedAt'])[_0xf5a0('0x17')](_0x4c0266[_0xf5a0('0x16')],_0xf5a0('0x18'))>moment()){return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});}else{return utils[_0xf5a0('0x19')](_0x29934b,_0x18cd94,![],null)[_0xf5a0('0x9')](function(){return _0x3c0d2e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});}}else{if(_0x18cd94>=_0x4c0266[_0xf5a0('0x8')]){return utils[_0xf5a0('0x19')](_0x29934b,0x0,!![],moment())['then'](function(){return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});});}else{return utils[_0xf5a0('0x19')](_0x29934b,_0x18cd94,![],null)[_0xf5a0('0x9')](function(){return _0x3c0d2e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});}}else{if(_0x29934b[_0xf5a0('0xf')]){return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});}else if(_0x4c0266[_0xf5a0('0x8')]>0x0){if(_0x29934b[_0xf5a0('0x10')]){if(_0x4c0266[_0xf5a0('0x16')]>0x0){if(moment(_0x29934b['blockedAt'])['add'](_0x4c0266['blockDuration'],_0xf5a0('0x18'))>moment()){return _0x3c0d2e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf5a0('0x19')](_0x29934b,0x0,![],null)[_0xf5a0('0x9')](function(){return utils[_0xf5a0('0x1a')](_0x29934b);})['then'](function(){return _0x3c0d2e(null,_0x29934b);});}}else{return _0x3c0d2e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x29934b,0x0,![],null)[_0xf5a0('0x9')](function(){return utils[_0xf5a0('0x1a')](_0x29934b);})[_0xf5a0('0x9')](function(){return _0x3c0d2e(null,_0x29934b);})['catch'](function(_0x4d82cf){return _0x3c0d2e(null,![],_0x4d82cf);});}}else{if(_0x29934b[_0xf5a0('0x10')]){return _0x3c0d2e(null,![],{'message':_0xf5a0('0x15')});}else{return utils[_0xf5a0('0x1a')](_0x29934b)[_0xf5a0('0x9')](function(){return _0x3c0d2e(null,_0x29934b);});}}}});})[_0xf5a0('0x1b')](function(_0x246514){return _0x3c0d2e(null,![],_0x246514);});}function sendServiceMail(_0x589d65){return db[_0xf5a0('0x1c')][_0xf5a0('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xf5a0('0xb'),_0xf5a0('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0xf5a0('0x1f')}]})[_0xf5a0('0x9')](function(_0x42820f){if(!_0x42820f){throw new Error(_0xf5a0('0x20'));}var _0x50ce08={'tls':{'rejectUnauthorized':![]}};if(_0x42820f[_0xf5a0('0x1f')]['service']){_0x50ce08[_0xf5a0('0x21')]=_0x42820f[_0xf5a0('0x1f')][_0xf5a0('0x21')];}else{_0x50ce08['host']=_0x42820f[_0xf5a0('0x1f')][_0xf5a0('0x22')];_0x50ce08[_0xf5a0('0x23')]=_0x42820f[_0xf5a0('0x1f')][_0xf5a0('0x23')];_0x50ce08['secure']=_0x42820f[_0xf5a0('0x1f')]['secure'];}if(_0x42820f[_0xf5a0('0x1f')][_0xf5a0('0x24')]){_0x50ce08[_0xf5a0('0x25')]={'user':_0x42820f[_0xf5a0('0x1f')][_0xf5a0('0x13')],'pass':_0x42820f[_0xf5a0('0x1f')]['pass']};}var _0x2b2bc5={'account':_0x50ce08,'message':_['merge']({'from':util['format'](_0xf5a0('0x26'),_0x42820f[_0xf5a0('0xb')],_0x42820f[_0xf5a0('0x1e')]||_0x42820f[_0xf5a0('0x1f')][_0xf5a0('0x13')])},_0x589d65)};return client[_0xf5a0('0x27')]('SendMail',_0x2b2bc5);})[_0xf5a0('0x9')](function(_0x3ae293){if(_0x3ae293[_0xf5a0('0x28')]){throw new Error(util[_0xf5a0('0x29')](_0xf5a0('0x2a'),_0x3ae293[_0xf5a0('0x28')]['message']||JSON[_0xf5a0('0x2b')](_0x3ae293[_0xf5a0('0x28')])));}return!![];});}function handleError(_0x36ec92,_0x3ed40c,_0x848ad9){return _0x36ec92[_0xf5a0('0x2c')](_0x3ed40c||0x1f4)['send']({'message':_0x848ad9?_0x848ad9['message']||_0x848ad9:''});}function checkPasswordPattern(_0x480b67,_0x34d061,_0xdef60d){if(_0xdef60d){var _0x34ac04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34ac04['test'](_0x34d061)){return _0x480b67;}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 _0x480b67;}}exports['login']=function(_0x50015f,_0x1c5a98,_0x82bd27){passport[_0xf5a0('0x2d')](_0xf5a0('0x2e'),function(_0x312074,_0x1c24c3,_0x5e43f1){var _0xabe836=_0x312074||_0x5e43f1;if(_0xabe836){return handleError(_0x1c5a98,0x191,_0xabe836);}if(!_0x1c24c3){return handleError(_0x1c5a98,0x194,{'message':_0xf5a0('0x2f')});}else{var _0x470bb0={'payload':{'id':_0x1c24c3['id'],'role':_0x1c24c3[_0xf5a0('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xf5a0('0x30')](_0x470bb0)[_0xf5a0('0x9')](function(_0x4ae443){_0x1c5a98[_0xf5a0('0x31')]({'id':_0x1c24c3['id'],'token':_0x4ae443,'statusCall':'','isAlreadyLogged':_0x1c24c3[_0xf5a0('0x32')]});});}})(_0x50015f,_0x1c5a98,_0x82bd27);};exports[_0xf5a0('0x33')]=function(_0x54abe7,_0x323827,_0x139118){if(!_0x54abe7[_0xf5a0('0x34')]['email']){return handleError(_0x323827,0x1f4,{'message':_0xf5a0('0x35')});}var _0x51c61e=rs[_0xf5a0('0x36')]();_0x54abe7[_0xf5a0('0x34')][_0xf5a0('0x1e')]=_0x54abe7[_0xf5a0('0x34')][_0xf5a0('0x1e')][_0xf5a0('0x37')]()['toLowerCase']();var _0x589c62;return db[_0xf5a0('0x38')][_0xf5a0('0xa')]({'where':{'id':0x1},'attributes':[_0xf5a0('0x8'),_0xf5a0('0x16')],'raw':!![]})[_0xf5a0('0x9')](function(_0x1fa0c1){_0x589c62=_0x1fa0c1;return db[_0xf5a0('0x39')][_0xf5a0('0x1d')]({'where':{'email':_0x54abe7[_0xf5a0('0x34')][_0xf5a0('0x1e')]}});})[_0xf5a0('0x9')](function(_0x1ec384){if(!_0x1ec384){throw new Error(_0xf5a0('0x3a'));}if(_0x1ec384[_0xf5a0('0xf')]){throw new Error(_0xf5a0('0x3b'));}if(_0x1ec384['blocked']){if(moment(_0x1ec384['blockedAt'])[_0xf5a0('0x17')](_0x589c62[_0xf5a0('0x16')],_0xf5a0('0x18'))>moment()){throw new Error(_0xf5a0('0x3c'));}else{_0x1ec384[_0xf5a0('0x10')]=![];_0x1ec384[_0xf5a0('0x3d')]=null;}}_0x1ec384['resetPasswordToken']=_0x51c61e;_0x1ec384['resetPasswordExpires']=Date[_0xf5a0('0x3e')]()+0x36ee80;return _0x1ec384[_0xf5a0('0x3f')]();})[_0xf5a0('0x9')](function(){return sendServiceMail({'to':_0x54abe7[_0xf5a0('0x34')]['email'],'subject':_0xf5a0('0x40'),'text':_0xf5a0('0x41')+_0xf5a0('0x42')+'http://'+_0x54abe7[_0xf5a0('0x43')][_0xf5a0('0x22')]+_0xf5a0('0x44')+_0x51c61e+'\x0a\x0a'+_0xf5a0('0x45')});})[_0xf5a0('0x9')](function(){_0x323827[_0xf5a0('0x2c')](0xc8)[_0xf5a0('0x46')]({'message':_0xf5a0('0x47')});})[_0xf5a0('0x1b')](function(_0x5b57f5){return handleError(_0x323827,0x1f4,_0x5b57f5);});};exports[_0xf5a0('0x48')]=function(_0x4ac4f0,_0x4870aa,_0x40a752){var _0x45e208;return db[_0xf5a0('0x39')][_0xf5a0('0x1d')]({'where':{'resetPasswordToken':_0x4ac4f0[_0xf5a0('0x49')][_0xf5a0('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xf5a0('0x3e')]()}}})[_0xf5a0('0x9')](function(_0x50d605){_0x45e208=_0x50d605;if(!_0x45e208){throw new Error(_0xf5a0('0x4b'));}return db['Setting'][_0xf5a0('0xa')]({'attributes':['id','securePassword']});})[_0xf5a0('0x9')](function(_0x9ac070){return checkPasswordPattern(_0x9ac070,_0x4ac4f0['body'][_0xf5a0('0xc')],_0x9ac070[_0xf5a0('0x4c')]);})[_0xf5a0('0x9')](function(){_0x45e208[_0xf5a0('0xc')]=_0x4ac4f0[_0xf5a0('0x34')][_0xf5a0('0xc')];_0x45e208[_0xf5a0('0x4d')]=null;_0x45e208[_0xf5a0('0x4e')]=null;return _0x45e208['save']();})['then'](function(){_0x4870aa['status'](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x4a9828){return handleError(_0x4870aa,0x1f4,_0x4a9828);});};passport[_0xf5a0('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':_0xf5a0('0xc')},function(_0xccef42,_0x446cda,_0x3cf073){return localAuthenticate(db[_0xf5a0('0x39')],_0xccef42,_0x446cda,_0x3cf073);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ebec6db..975c309 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 _0x97df=['post','login','forgot','reset','exports','express','./authLocal.controller'];(function(_0x4aa741,_0x5134c1){var _0x272370=function(_0x1aa778){while(--_0x1aa778){_0x4aa741['push'](_0x4aa741['shift']());}};_0x272370(++_0x5134c1);}(_0x97df,0x163));var _0xf97d=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x97df[_0x25248b];return _0x509939;};'use strict';var express=require(_0xf97d('0x0'));var router=express['Router']();var controller=require(_0xf97d('0x1'));router[_0xf97d('0x2')]('/',controller[_0xf97d('0x3')]);router[_0xf97d('0x2')]('/forgot',controller[_0xf97d('0x4')]);router['post']('/reset/:token',controller[_0xf97d('0x5')]);module[_0xf97d('0x6')]=router; \ No newline at end of file +var _0x0aae=['/forgot','reset','Router','./authLocal.controller','post','login'];(function(_0x620150,_0x54cb8e){var _0x475be2=function(_0x546831){while(--_0x546831){_0x620150['push'](_0x620150['shift']());}};_0x475be2(++_0x54cb8e);}(_0x0aae,0x152));var _0xe0aa=function(_0x314945,_0x3b61a2){_0x314945=_0x314945-0x0;var _0x3f98c9=_0x0aae[_0x314945];return _0x3f98c9;};'use strict';var express=require('express');var router=express[_0xe0aa('0x0')]();var controller=require(_0xe0aa('0x1'));router[_0xe0aa('0x2')]('/',controller[_0xe0aa('0x3')]);router['post'](_0xe0aa('0x4'),controller['forgot']);router[_0xe0aa('0x2')]('/reset/:token',controller[_0xe0aa('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2b75cac..c259a25 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 _0x5a5c=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x16ff13,_0x574da6){var _0x167afd=function(_0x183173){while(--_0x183173){_0x16ff13['push'](_0x16ff13['shift']());}};_0x167afd(++_0x574da6);}(_0x5a5c,0xae));var _0xc5a5=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x5a5c[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0xc5a5('0x0'));module[_0xc5a5('0x1')]={'name':{'type':Sequelize[_0xc5a5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xc5a5('0x2')]},'description':{'type':Sequelize[_0xc5a5('0x2')]},'status':{'type':Sequelize[_0xc5a5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc5a5('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xbffe=['STRING','INTEGER','sequelize','exports'];(function(_0x5cbb7b,_0x2a86a6){var _0x28db2a=function(_0x277195){while(--_0x277195){_0x5cbb7b['push'](_0x5cbb7b['shift']());}};_0x28db2a(++_0x2a86a6);}(_0xbffe,0x152));var _0xebff=function(_0x3bec85,_0x1b7e5c){_0x3bec85=_0x3bec85-0x0;var _0x2b0b63=_0xbffe[_0x3bec85];return _0x2b0b63;};'use strict';var Sequelize=require(_0xebff('0x0'));module[_0xebff('0x1')]={'name':{'type':Sequelize[_0xebff('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xebff('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 0462dd9..8519a2a 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 _0x2078=['Action','omit','pick','getActions','html-pdf','rimraf','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','destroy','stack','send','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Automation','include','findAll','rows','params','catch','create','body','find','addConditions','ids','getConditions','findOne','Condition','addActions'];(function(_0x367334,_0x27a54a){var _0x36b4a7=function(_0x1fd2d9){while(--_0x1fd2d9){_0x367334['push'](_0x367334['shift']());}};_0x36b4a7(++_0x27a54a);}(_0x2078,0xa0));var _0x8207=function(_0x14731d,_0x184efe){_0x14731d=_0x14731d-0x0;var _0x42e609=_0x2078[_0x14731d];return _0x42e609;};'use strict';var pdf=require(_0x8207('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8207('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8207('0x2'));var rp=require(_0x8207('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8207('0x4'));var path=require(_0x8207('0x5'));var sox=require('sox');var csv=require(_0x8207('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8207('0x7'));var squel=require(_0x8207('0x8'));var crypto=require(_0x8207('0x9'));var jsforce=require(_0x8207('0xa'));var deskjs=require(_0x8207('0xb'));var toCsv=require(_0x8207('0x6'));var querystring=require(_0x8207('0xc'));var Papa=require(_0x8207('0xd'));var Redis=require('ioredis');var authService=require(_0x8207('0xe'));var qs=require(_0x8207('0xf'));var as=require(_0x8207('0x10'));var hardwareService=require(_0x8207('0x11'));var logger=require('../../config/logger')(_0x8207('0x12'));var utils=require(_0x8207('0x13'));var config=require(_0x8207('0x14'));var db=require(_0x8207('0x15'))['db'];function respondWithStatusCode(_0x1cad40,_0x414f1c){_0x414f1c=_0x414f1c||0xcc;return function(_0x1f0d3d){if(_0x1f0d3d){return _0x1cad40[_0x8207('0x16')](_0x414f1c);}return _0x1cad40[_0x8207('0x17')](_0x414f1c)[_0x8207('0x18')]();};}function respondWithResult(_0x57f793,_0x40163f){_0x40163f=_0x40163f||0xc8;return function(_0x278ade){if(_0x278ade){return _0x57f793[_0x8207('0x17')](_0x40163f)[_0x8207('0x19')](_0x278ade);}};}function respondWithFilteredResult(_0x1d29be,_0x31e1d6){return function(_0x31d518){if(_0x31d518){var _0x589d53=_0x31d518[_0x8207('0x1a')],_0x314ee6=_0x31e1d6[_0x8207('0x1b')],_0x27f374=_0x31e1d6['offset']+_0x31e1d6[_0x8207('0x1c')],_0x4a3f40;if(_0x27f374>=_0x589d53){_0x27f374=_0x589d53;_0x4a3f40=0xc8;}else{_0x4a3f40=0xce;}_0x1d29be['status'](_0x4a3f40);return _0x1d29be['set']('Content-Range',_0x314ee6+'-'+_0x27f374+'/'+_0x589d53)[_0x8207('0x19')](_0x31d518);}return null;};}function patchUpdates(_0x24889b){return function(_0x18eb21){try{jsonpatch[_0x8207('0x1d')](_0x18eb21,_0x24889b,!![]);}catch(_0x28447){return BPromise['reject'](_0x28447);}return _0x18eb21[_0x8207('0x1e')]();};}function saveUpdates(_0x7e1f4e,_0x31d007){return function(_0x2f9f58){if(_0x2f9f58){return _0x2f9f58[_0x8207('0x1f')](_0x7e1f4e)[_0x8207('0x20')](function(_0x519536){return _0x519536;});}return null;};}function removeEntity(_0x3720ad,_0x2fe598){return function(_0x336821){if(_0x336821){return _0x336821[_0x8207('0x21')]()[_0x8207('0x20')](function(){_0x3720ad[_0x8207('0x17')](0xcc)[_0x8207('0x18')]();});}};}function handleEntityNotFound(_0x143dc9,_0x2789d4){return function(_0x162d0b){if(!_0x162d0b){_0x143dc9[_0x8207('0x16')](0x194);}return _0x162d0b;};}function handleError(_0x539a77,_0xa56439){_0xa56439=_0xa56439||0x1f4;return function(_0x4a9d75){logger['error'](_0x4a9d75[_0x8207('0x22')]);if(_0x4a9d75['name']){delete _0x4a9d75['name'];}_0x539a77['status'](_0xa56439)[_0x8207('0x23')](_0x4a9d75);};}exports['index']=function(_0x5375b4,_0x431032){var _0x524dbb={},_0x251c3c={},_0x4faba1={'count':0x0,'rows':[]};var _0x5320ed=_['map'](db['Automation'][_0x8207('0x24')],function(_0x193ec6){return{'name':_0x193ec6[_0x8207('0x25')],'type':_0x193ec6[_0x8207('0x26')][_0x8207('0x27')]};});_0x251c3c[_0x8207('0x28')]=_[_0x8207('0x29')](_0x5320ed,_0x8207('0x2a'));_0x251c3c['query']=_[_0x8207('0x2b')](_0x5375b4[_0x8207('0x2c')]);_0x251c3c[_0x8207('0x2d')]=_[_0x8207('0x2e')](_0x251c3c[_0x8207('0x28')],_0x251c3c[_0x8207('0x2c')]);_0x524dbb[_0x8207('0x2f')]=_[_0x8207('0x2e')](_0x251c3c['model'],qs[_0x8207('0x30')](_0x5375b4[_0x8207('0x2c')][_0x8207('0x30')]));_0x524dbb[_0x8207('0x2f')]=_0x524dbb[_0x8207('0x2f')][_0x8207('0x31')]?_0x524dbb[_0x8207('0x2f')]:_0x251c3c[_0x8207('0x28')];if(!_0x5375b4['query'][_0x8207('0x32')](_0x8207('0x33'))){_0x524dbb[_0x8207('0x1c')]=qs[_0x8207('0x1c')](_0x5375b4[_0x8207('0x2c')][_0x8207('0x1c')]);_0x524dbb[_0x8207('0x1b')]=qs[_0x8207('0x1b')](_0x5375b4['query'][_0x8207('0x1b')]);}_0x524dbb[_0x8207('0x34')]=qs[_0x8207('0x35')](_0x5375b4['query'][_0x8207('0x35')]);_0x524dbb[_0x8207('0x36')]=qs[_0x8207('0x2d')](_['pick'](_0x5375b4[_0x8207('0x2c')],_0x251c3c[_0x8207('0x2d')]));if(_0x5375b4[_0x8207('0x2c')][_0x8207('0x37')]){_0x524dbb[_0x8207('0x36')]=_[_0x8207('0x38')](_0x524dbb[_0x8207('0x36')],{'$or':_[_0x8207('0x29')](_0x5320ed,function(_0x5b2e54){if(_0x5b2e54[_0x8207('0x26')]!==_0x8207('0x39')){var _0x3ff1a1={};_0x3ff1a1[_0x5b2e54[_0x8207('0x2a')]]={'$like':'%'+_0x5375b4[_0x8207('0x2c')][_0x8207('0x37')]+'%'};return _0x3ff1a1;}})});}_0x524dbb=_[_0x8207('0x38')]({},_0x524dbb,_0x5375b4[_0x8207('0x3a')]);var _0x262b55={'where':_0x524dbb[_0x8207('0x36')]};return db[_0x8207('0x3b')]['count'](_0x262b55)['then'](function(_0xde3d83){_0x4faba1[_0x8207('0x1a')]=_0xde3d83;if(_0x5375b4[_0x8207('0x2c')]['includeAll']){_0x524dbb[_0x8207('0x3c')]=[{'all':!![]}];}return db[_0x8207('0x3b')][_0x8207('0x3d')](_0x524dbb);})['then'](function(_0x4070b3){_0x4faba1[_0x8207('0x3e')]=_0x4070b3;return _0x4faba1;})[_0x8207('0x20')](respondWithFilteredResult(_0x431032,_0x524dbb))['catch'](handleError(_0x431032,null));};exports['show']=function(_0x40e686,_0x5739a5){var _0x506564={'raw':![],'where':{'id':_0x40e686[_0x8207('0x3f')]['id']}},_0x48c866={};_0x48c866['model']=_['keys'](db[_0x8207('0x3b')]['rawAttributes']);_0x48c866[_0x8207('0x2c')]=_[_0x8207('0x2b')](_0x40e686[_0x8207('0x2c')]);_0x48c866[_0x8207('0x2d')]=_[_0x8207('0x2e')](_0x48c866['model'],_0x48c866[_0x8207('0x2c')]);_0x506564[_0x8207('0x2f')]=_[_0x8207('0x2e')](_0x48c866['model'],qs[_0x8207('0x30')](_0x40e686[_0x8207('0x2c')][_0x8207('0x30')]));_0x506564[_0x8207('0x2f')]=_0x506564['attributes'][_0x8207('0x31')]?_0x506564[_0x8207('0x2f')]:_0x48c866[_0x8207('0x28')];if(_0x40e686[_0x8207('0x2c')]['includeAll']){_0x506564[_0x8207('0x3c')]=[{'all':!![]}];}_0x506564=_[_0x8207('0x38')]({},_0x506564,_0x40e686[_0x8207('0x3a')]);return db[_0x8207('0x3b')]['find'](_0x506564)[_0x8207('0x20')](handleEntityNotFound(_0x5739a5,null))[_0x8207('0x20')](respondWithResult(_0x5739a5,null))[_0x8207('0x40')](handleError(_0x5739a5,null));};exports[_0x8207('0x41')]=function(_0x26cde8,_0x4e7f6c){return db[_0x8207('0x3b')]['create'](_0x26cde8[_0x8207('0x42')],{})[_0x8207('0x20')](respondWithResult(_0x4e7f6c,0xc9))['catch'](handleError(_0x4e7f6c,null));};exports[_0x8207('0x1f')]=function(_0x1e17b9,_0x360afb){if(_0x1e17b9[_0x8207('0x42')]['id']){delete _0x1e17b9[_0x8207('0x42')]['id'];}return db[_0x8207('0x3b')][_0x8207('0x43')]({'where':{'id':_0x1e17b9['params']['id']}})[_0x8207('0x20')](handleEntityNotFound(_0x360afb,null))['then'](saveUpdates(_0x1e17b9[_0x8207('0x42')],null))[_0x8207('0x20')](respondWithResult(_0x360afb,null))[_0x8207('0x40')](handleError(_0x360afb,null));};exports[_0x8207('0x21')]=function(_0x2f3a19,_0x422415){return db[_0x8207('0x3b')][_0x8207('0x43')]({'where':{'id':_0x2f3a19[_0x8207('0x3f')]['id']}})[_0x8207('0x20')](handleEntityNotFound(_0x422415,null))[_0x8207('0x20')](removeEntity(_0x422415,null))[_0x8207('0x40')](handleError(_0x422415,null));};exports['addConditions']=function(_0x45dc56,_0x5155bf,_0x25e985){return db['Condition'][_0x8207('0x43')]({'where':{'id':_0x45dc56[_0x8207('0x3f')]['id']}})[_0x8207('0x20')](handleEntityNotFound(_0x5155bf,null))[_0x8207('0x20')](function(_0x25847e){if(_0x25847e){return _0x25847e[_0x8207('0x44')](_0x45dc56[_0x8207('0x42')][_0x8207('0x45')],_['omit'](_0x45dc56[_0x8207('0x42')],[_0x8207('0x45'),'id'])||{});}})['then'](respondWithResult(_0x5155bf,null))[_0x8207('0x40')](handleError(_0x5155bf,null));};exports[_0x8207('0x46')]=function(_0x13173,_0x2d85a4,_0x55dc33){var _0xf5876f={};var _0x2a401a={};var _0x3efee7;var _0x378e6a;return db[_0x8207('0x3b')][_0x8207('0x47')]({'where':{'id':_0x13173['params']['id']}})[_0x8207('0x20')](handleEntityNotFound(_0x2d85a4,null))[_0x8207('0x20')](function(_0x56f63e){if(_0x56f63e){_0x3efee7=_0x56f63e;_0x2a401a[_0x8207('0x28')]=_[_0x8207('0x2b')](db[_0x8207('0x48')][_0x8207('0x24')]);_0x2a401a[_0x8207('0x2c')]=_['keys'](_0x13173[_0x8207('0x2c')]);_0x2a401a[_0x8207('0x2d')]=_[_0x8207('0x2e')](_0x2a401a[_0x8207('0x28')],_0x2a401a[_0x8207('0x2c')]);_0xf5876f[_0x8207('0x2f')]=_[_0x8207('0x2e')](_0x2a401a[_0x8207('0x28')],qs[_0x8207('0x30')](_0x13173[_0x8207('0x2c')][_0x8207('0x30')]));_0xf5876f[_0x8207('0x2f')]=_0xf5876f[_0x8207('0x2f')][_0x8207('0x31')]?_0xf5876f[_0x8207('0x2f')]:_0x2a401a[_0x8207('0x28')];_0xf5876f['order']=qs['sort'](_0x13173[_0x8207('0x2c')]['sort']);_0xf5876f[_0x8207('0x36')]=qs[_0x8207('0x2d')](_['pick'](_0x13173[_0x8207('0x2c')],_0x2a401a[_0x8207('0x2d')]));if(_0x13173[_0x8207('0x2c')][_0x8207('0x37')]){_0xf5876f[_0x8207('0x36')]=_[_0x8207('0x38')](_0xf5876f[_0x8207('0x36')],{'$or':_[_0x8207('0x29')](_0xf5876f[_0x8207('0x2f')],function(_0x3bdfdf){var _0x32aa41={};_0x32aa41[_0x3bdfdf]={'$like':'%'+_0x13173[_0x8207('0x2c')][_0x8207('0x37')]+'%'};return _0x32aa41;})});}_0xf5876f=_[_0x8207('0x38')]({},_0xf5876f,_0x13173[_0x8207('0x3a')]);return _0x3efee7[_0x8207('0x46')](_0xf5876f);}})[_0x8207('0x20')](function(_0xfdda08){if(_0xfdda08){_0x378e6a=_0xfdda08[_0x8207('0x31')];if(!_0x13173[_0x8207('0x2c')]['hasOwnProperty'](_0x8207('0x33'))){_0xf5876f['limit']=qs[_0x8207('0x1c')](_0x13173['query']['limit']);_0xf5876f[_0x8207('0x1b')]=qs[_0x8207('0x1b')](_0x13173[_0x8207('0x2c')][_0x8207('0x1b')]);}return _0x3efee7['getConditions'](_0xf5876f);}})[_0x8207('0x20')](function(_0x2eea1f){if(_0x2eea1f){return _0x2eea1f?{'count':_0x378e6a,'rows':_0x2eea1f}:null;}})[_0x8207('0x20')](respondWithResult(_0x2d85a4,null))[_0x8207('0x40')](handleError(_0x2d85a4,null));};exports[_0x8207('0x49')]=function(_0x86aaa0,_0x2d8606,_0x5910e1){return db[_0x8207('0x4a')][_0x8207('0x43')]({'where':{'id':_0x86aaa0[_0x8207('0x3f')]['id']}})[_0x8207('0x20')](handleEntityNotFound(_0x2d8606,null))[_0x8207('0x20')](function(_0x45d9a9){if(_0x45d9a9){return _0x45d9a9['addActions'](_0x86aaa0[_0x8207('0x42')][_0x8207('0x45')],_[_0x8207('0x4b')](_0x86aaa0['body'],['ids','id'])||{});}})[_0x8207('0x20')](respondWithResult(_0x2d8606,null))[_0x8207('0x40')](handleError(_0x2d8606,null));};exports['getActions']=function(_0x265ba5,_0x15d30f,_0x35d8f8){var _0x10fa7b={};var _0x3184ef={};var _0x26885d;var _0x1bd344;return db[_0x8207('0x3b')][_0x8207('0x47')]({'where':{'id':_0x265ba5[_0x8207('0x3f')]['id']}})[_0x8207('0x20')](handleEntityNotFound(_0x15d30f,null))[_0x8207('0x20')](function(_0x3bb4e3){if(_0x3bb4e3){_0x26885d=_0x3bb4e3;_0x3184ef[_0x8207('0x28')]=_[_0x8207('0x2b')](db['Action'][_0x8207('0x24')]);_0x3184ef[_0x8207('0x2c')]=_[_0x8207('0x2b')](_0x265ba5[_0x8207('0x2c')]);_0x3184ef['filters']=_[_0x8207('0x2e')](_0x3184ef[_0x8207('0x28')],_0x3184ef[_0x8207('0x2c')]);_0x10fa7b[_0x8207('0x2f')]=_[_0x8207('0x2e')](_0x3184ef[_0x8207('0x28')],qs[_0x8207('0x30')](_0x265ba5['query'][_0x8207('0x30')]));_0x10fa7b[_0x8207('0x2f')]=_0x10fa7b[_0x8207('0x2f')][_0x8207('0x31')]?_0x10fa7b['attributes']:_0x3184ef[_0x8207('0x28')];_0x10fa7b[_0x8207('0x34')]=qs[_0x8207('0x35')](_0x265ba5[_0x8207('0x2c')][_0x8207('0x35')]);_0x10fa7b[_0x8207('0x36')]=qs[_0x8207('0x2d')](_[_0x8207('0x4c')](_0x265ba5[_0x8207('0x2c')],_0x3184ef[_0x8207('0x2d')]));if(_0x265ba5[_0x8207('0x2c')]['filter']){_0x10fa7b['where']=_[_0x8207('0x38')](_0x10fa7b[_0x8207('0x36')],{'$or':_['map'](_0x10fa7b[_0x8207('0x2f')],function(_0x555fa2){var _0x380531={};_0x380531[_0x555fa2]={'$like':'%'+_0x265ba5['query'][_0x8207('0x37')]+'%'};return _0x380531;})});}_0x10fa7b=_[_0x8207('0x38')]({},_0x10fa7b,_0x265ba5[_0x8207('0x3a')]);return _0x26885d[_0x8207('0x4d')](_0x10fa7b);}})[_0x8207('0x20')](function(_0xa67a1d){if(_0xa67a1d){_0x1bd344=_0xa67a1d[_0x8207('0x31')];if(!_0x265ba5['query']['hasOwnProperty'](_0x8207('0x33'))){_0x10fa7b['limit']=qs['limit'](_0x265ba5['query'][_0x8207('0x1c')]);_0x10fa7b[_0x8207('0x1b')]=qs[_0x8207('0x1b')](_0x265ba5[_0x8207('0x2c')]['offset']);}return _0x26885d[_0x8207('0x4d')](_0x10fa7b);}})['then'](function(_0x4348ac){if(_0x4348ac){return _0x4348ac?{'count':_0x1bd344,'rows':_0x4348ac}:null;}})['then'](respondWithResult(_0x15d30f,null))[_0x8207('0x40')](handleError(_0x15d30f,null));}; \ No newline at end of file +var _0xb9fe=['then','end','error','stack','name','send','index','map','Automation','rawAttributes','type','keys','query','filters','model','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','fields','find','create','body','catch','destroy','addConditions','Condition','ids','omit','getConditions','order','hasOwnProperty','Action','addActions','getActions','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','update'];(function(_0x5a6c09,_0xc5fb44){var _0x2f1b7f=function(_0x52295f){while(--_0x52295f){_0x5a6c09['push'](_0x5a6c09['shift']());}};_0x2f1b7f(++_0xc5fb44);}(_0xb9fe,0x124));var _0xeb9f=function(_0x31f861,_0xdd95cb){_0x31f861=_0x31f861-0x0;var _0x52789f=_0xb9fe[_0x31f861];return _0x52789f;};'use strict';var pdf=require(_0xeb9f('0x0'));var emlformat=require(_0xeb9f('0x1'));var rimraf=require(_0xeb9f('0x2'));var zipdir=require(_0xeb9f('0x3'));var jsonpatch=require(_0xeb9f('0x4'));var rp=require('request-promise');var moment=require(_0xeb9f('0x5'));var BPromise=require(_0xeb9f('0x6'));var Mustache=require(_0xeb9f('0x7'));var util=require(_0xeb9f('0x8'));var path=require(_0xeb9f('0x9'));var sox=require('sox');var csv=require(_0xeb9f('0xa'));var ejs=require(_0xeb9f('0xb'));var fs=require('fs');var _=require(_0xeb9f('0xc'));var squel=require('squel');var crypto=require(_0xeb9f('0xd'));var jsforce=require(_0xeb9f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb9f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeb9f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9f('0x11'));var hardwareService=require(_0xeb9f('0x12'));var logger=require('../../config/logger')(_0xeb9f('0x13'));var utils=require(_0xeb9f('0x14'));var config=require(_0xeb9f('0x15'));var db=require(_0xeb9f('0x16'))['db'];function respondWithStatusCode(_0x552a1e,_0x27b989){_0x27b989=_0x27b989||0xcc;return function(_0x503c99){if(_0x503c99){return _0x552a1e[_0xeb9f('0x17')](_0x27b989);}return _0x552a1e[_0xeb9f('0x18')](_0x27b989)['end']();};}function respondWithResult(_0xc17843,_0x13073b){_0x13073b=_0x13073b||0xc8;return function(_0x40ec96){if(_0x40ec96){return _0xc17843['status'](_0x13073b)[_0xeb9f('0x19')](_0x40ec96);}};}function respondWithFilteredResult(_0x47db70,_0x54006f){return function(_0x418c54){if(_0x418c54){var _0x3d97b5=_0x418c54[_0xeb9f('0x1a')],_0x30c7a3=_0x54006f[_0xeb9f('0x1b')],_0x4c4615=_0x54006f[_0xeb9f('0x1b')]+_0x54006f[_0xeb9f('0x1c')],_0x2270d3;if(_0x4c4615>=_0x3d97b5){_0x4c4615=_0x3d97b5;_0x2270d3=0xc8;}else{_0x2270d3=0xce;}_0x47db70[_0xeb9f('0x18')](_0x2270d3);return _0x47db70['set'](_0xeb9f('0x1d'),_0x30c7a3+'-'+_0x4c4615+'/'+_0x3d97b5)['json'](_0x418c54);}return null;};}function patchUpdates(_0x1fad2c){return function(_0x40cd93){try{jsonpatch['apply'](_0x40cd93,_0x1fad2c,!![]);}catch(_0x24d103){return BPromise[_0xeb9f('0x1e')](_0x24d103);}return _0x40cd93['save']();};}function saveUpdates(_0x3b937c,_0x1fd1c9){return function(_0x224f02){if(_0x224f02){return _0x224f02[_0xeb9f('0x1f')](_0x3b937c)[_0xeb9f('0x20')](function(_0x13cd2b){return _0x13cd2b;});}return null;};}function removeEntity(_0x1ed792,_0x52fd89){return function(_0x16f2fa){if(_0x16f2fa){return _0x16f2fa['destroy']()[_0xeb9f('0x20')](function(){_0x1ed792[_0xeb9f('0x18')](0xcc)[_0xeb9f('0x21')]();});}};}function handleEntityNotFound(_0x4ff8de,_0x2a8c30){return function(_0xebab15){if(!_0xebab15){_0x4ff8de[_0xeb9f('0x17')](0x194);}return _0xebab15;};}function handleError(_0x2921d9,_0x18d2e1){_0x18d2e1=_0x18d2e1||0x1f4;return function(_0x5c6fa2){logger[_0xeb9f('0x22')](_0x5c6fa2[_0xeb9f('0x23')]);if(_0x5c6fa2[_0xeb9f('0x24')]){delete _0x5c6fa2[_0xeb9f('0x24')];}_0x2921d9[_0xeb9f('0x18')](_0x18d2e1)[_0xeb9f('0x25')](_0x5c6fa2);};}exports[_0xeb9f('0x26')]=function(_0xafc569,_0xf6d1e7){var _0x4a3467={},_0x2f0a30={},_0x24de03={'count':0x0,'rows':[]};var _0x1cb7b7=_[_0xeb9f('0x27')](db[_0xeb9f('0x28')][_0xeb9f('0x29')],function(_0x241ed5){return{'name':_0x241ed5['fieldName'],'type':_0x241ed5[_0xeb9f('0x2a')]['key']};});_0x2f0a30['model']=_['map'](_0x1cb7b7,_0xeb9f('0x24'));_0x2f0a30['query']=_[_0xeb9f('0x2b')](_0xafc569[_0xeb9f('0x2c')]);_0x2f0a30[_0xeb9f('0x2d')]=_['intersection'](_0x2f0a30[_0xeb9f('0x2e')],_0x2f0a30[_0xeb9f('0x2c')]);_0x4a3467[_0xeb9f('0x2f')]=_['intersection'](_0x2f0a30['model'],qs['fields'](_0xafc569[_0xeb9f('0x2c')]['fields']));_0x4a3467['attributes']=_0x4a3467['attributes'][_0xeb9f('0x30')]?_0x4a3467[_0xeb9f('0x2f')]:_0x2f0a30['model'];if(!_0xafc569[_0xeb9f('0x2c')]['hasOwnProperty'](_0xeb9f('0x31'))){_0x4a3467[_0xeb9f('0x1c')]=qs['limit'](_0xafc569[_0xeb9f('0x2c')][_0xeb9f('0x1c')]);_0x4a3467[_0xeb9f('0x1b')]=qs[_0xeb9f('0x1b')](_0xafc569[_0xeb9f('0x2c')][_0xeb9f('0x1b')]);}_0x4a3467['order']=qs[_0xeb9f('0x32')](_0xafc569[_0xeb9f('0x2c')][_0xeb9f('0x32')]);_0x4a3467['where']=qs[_0xeb9f('0x2d')](_[_0xeb9f('0x33')](_0xafc569[_0xeb9f('0x2c')],_0x2f0a30[_0xeb9f('0x2d')]));if(_0xafc569[_0xeb9f('0x2c')][_0xeb9f('0x34')]){_0x4a3467[_0xeb9f('0x35')]=_[_0xeb9f('0x36')](_0x4a3467[_0xeb9f('0x35')],{'$or':_['map'](_0x1cb7b7,function(_0x1cf112){if(_0x1cf112['type']!==_0xeb9f('0x37')){var _0x3fe6ca={};_0x3fe6ca[_0x1cf112[_0xeb9f('0x24')]]={'$like':'%'+_0xafc569[_0xeb9f('0x2c')][_0xeb9f('0x34')]+'%'};return _0x3fe6ca;}})});}_0x4a3467=_[_0xeb9f('0x36')]({},_0x4a3467,_0xafc569[_0xeb9f('0x38')]);var _0x479093={'where':_0x4a3467['where']};return db[_0xeb9f('0x28')]['count'](_0x479093)[_0xeb9f('0x20')](function(_0xab2aaf){_0x24de03['count']=_0xab2aaf;if(_0xafc569[_0xeb9f('0x2c')][_0xeb9f('0x39')]){_0x4a3467[_0xeb9f('0x3a')]=[{'all':!![]}];}return db['Automation'][_0xeb9f('0x3b')](_0x4a3467);})[_0xeb9f('0x20')](function(_0x4b739f){_0x24de03[_0xeb9f('0x3c')]=_0x4b739f;return _0x24de03;})[_0xeb9f('0x20')](respondWithFilteredResult(_0xf6d1e7,_0x4a3467))['catch'](handleError(_0xf6d1e7,null));};exports[_0xeb9f('0x3d')]=function(_0x39f0ff,_0x425132){var _0x37e090={'raw':![],'where':{'id':_0x39f0ff[_0xeb9f('0x3e')]['id']}},_0x38e713={};_0x38e713[_0xeb9f('0x2e')]=_[_0xeb9f('0x2b')](db[_0xeb9f('0x28')][_0xeb9f('0x29')]);_0x38e713[_0xeb9f('0x2c')]=_[_0xeb9f('0x2b')](_0x39f0ff['query']);_0x38e713[_0xeb9f('0x2d')]=_[_0xeb9f('0x3f')](_0x38e713[_0xeb9f('0x2e')],_0x38e713[_0xeb9f('0x2c')]);_0x37e090[_0xeb9f('0x2f')]=_[_0xeb9f('0x3f')](_0x38e713['model'],qs[_0xeb9f('0x40')](_0x39f0ff['query']['fields']));_0x37e090[_0xeb9f('0x2f')]=_0x37e090[_0xeb9f('0x2f')]['length']?_0x37e090[_0xeb9f('0x2f')]:_0x38e713[_0xeb9f('0x2e')];if(_0x39f0ff['query']['includeAll']){_0x37e090['include']=[{'all':!![]}];}_0x37e090=_['merge']({},_0x37e090,_0x39f0ff['options']);return db[_0xeb9f('0x28')][_0xeb9f('0x41')](_0x37e090)[_0xeb9f('0x20')](handleEntityNotFound(_0x425132,null))[_0xeb9f('0x20')](respondWithResult(_0x425132,null))['catch'](handleError(_0x425132,null));};exports[_0xeb9f('0x42')]=function(_0x4a16c5,_0x1b8eec){return db[_0xeb9f('0x28')]['create'](_0x4a16c5[_0xeb9f('0x43')],{})[_0xeb9f('0x20')](respondWithResult(_0x1b8eec,0xc9))[_0xeb9f('0x44')](handleError(_0x1b8eec,null));};exports['update']=function(_0x105efb,_0x48ba9f){if(_0x105efb[_0xeb9f('0x43')]['id']){delete _0x105efb['body']['id'];}return db[_0xeb9f('0x28')][_0xeb9f('0x41')]({'where':{'id':_0x105efb[_0xeb9f('0x3e')]['id']}})[_0xeb9f('0x20')](handleEntityNotFound(_0x48ba9f,null))[_0xeb9f('0x20')](saveUpdates(_0x105efb['body'],null))[_0xeb9f('0x20')](respondWithResult(_0x48ba9f,null))[_0xeb9f('0x44')](handleError(_0x48ba9f,null));};exports[_0xeb9f('0x45')]=function(_0x3d426e,_0x19c68b){return db['Automation'][_0xeb9f('0x41')]({'where':{'id':_0x3d426e[_0xeb9f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x19c68b,null))['then'](removeEntity(_0x19c68b,null))[_0xeb9f('0x44')](handleError(_0x19c68b,null));};exports[_0xeb9f('0x46')]=function(_0xac63d8,_0x5a7f4d,_0x17921f){return db[_0xeb9f('0x47')][_0xeb9f('0x41')]({'where':{'id':_0xac63d8[_0xeb9f('0x3e')]['id']}})[_0xeb9f('0x20')](handleEntityNotFound(_0x5a7f4d,null))[_0xeb9f('0x20')](function(_0x3416d7){if(_0x3416d7){return _0x3416d7['addConditions'](_0xac63d8[_0xeb9f('0x43')][_0xeb9f('0x48')],_[_0xeb9f('0x49')](_0xac63d8[_0xeb9f('0x43')],[_0xeb9f('0x48'),'id'])||{});}})[_0xeb9f('0x20')](respondWithResult(_0x5a7f4d,null))[_0xeb9f('0x44')](handleError(_0x5a7f4d,null));};exports[_0xeb9f('0x4a')]=function(_0x3c0c99,_0x5b8133,_0x2811d4){var _0x4f8797={};var _0x5df19c={};var _0xc4eedd;var _0x29c421;return db[_0xeb9f('0x28')]['findOne']({'where':{'id':_0x3c0c99['params']['id']}})['then'](handleEntityNotFound(_0x5b8133,null))[_0xeb9f('0x20')](function(_0x2ad9d3){if(_0x2ad9d3){_0xc4eedd=_0x2ad9d3;_0x5df19c[_0xeb9f('0x2e')]=_[_0xeb9f('0x2b')](db[_0xeb9f('0x47')][_0xeb9f('0x29')]);_0x5df19c[_0xeb9f('0x2c')]=_[_0xeb9f('0x2b')](_0x3c0c99[_0xeb9f('0x2c')]);_0x5df19c[_0xeb9f('0x2d')]=_[_0xeb9f('0x3f')](_0x5df19c[_0xeb9f('0x2e')],_0x5df19c['query']);_0x4f8797[_0xeb9f('0x2f')]=_['intersection'](_0x5df19c['model'],qs[_0xeb9f('0x40')](_0x3c0c99[_0xeb9f('0x2c')][_0xeb9f('0x40')]));_0x4f8797[_0xeb9f('0x2f')]=_0x4f8797['attributes'][_0xeb9f('0x30')]?_0x4f8797[_0xeb9f('0x2f')]:_0x5df19c['model'];_0x4f8797[_0xeb9f('0x4b')]=qs[_0xeb9f('0x32')](_0x3c0c99['query'][_0xeb9f('0x32')]);_0x4f8797[_0xeb9f('0x35')]=qs[_0xeb9f('0x2d')](_[_0xeb9f('0x33')](_0x3c0c99[_0xeb9f('0x2c')],_0x5df19c['filters']));if(_0x3c0c99[_0xeb9f('0x2c')][_0xeb9f('0x34')]){_0x4f8797[_0xeb9f('0x35')]=_[_0xeb9f('0x36')](_0x4f8797[_0xeb9f('0x35')],{'$or':_[_0xeb9f('0x27')](_0x4f8797[_0xeb9f('0x2f')],function(_0x2461f1){var _0x22b69e={};_0x22b69e[_0x2461f1]={'$like':'%'+_0x3c0c99[_0xeb9f('0x2c')][_0xeb9f('0x34')]+'%'};return _0x22b69e;})});}_0x4f8797=_[_0xeb9f('0x36')]({},_0x4f8797,_0x3c0c99[_0xeb9f('0x38')]);return _0xc4eedd[_0xeb9f('0x4a')](_0x4f8797);}})[_0xeb9f('0x20')](function(_0x2a4db4){if(_0x2a4db4){_0x29c421=_0x2a4db4[_0xeb9f('0x30')];if(!_0x3c0c99[_0xeb9f('0x2c')][_0xeb9f('0x4c')]('nolimit')){_0x4f8797[_0xeb9f('0x1c')]=qs[_0xeb9f('0x1c')](_0x3c0c99[_0xeb9f('0x2c')][_0xeb9f('0x1c')]);_0x4f8797[_0xeb9f('0x1b')]=qs[_0xeb9f('0x1b')](_0x3c0c99[_0xeb9f('0x2c')]['offset']);}return _0xc4eedd[_0xeb9f('0x4a')](_0x4f8797);}})['then'](function(_0x1ab49e){if(_0x1ab49e){return _0x1ab49e?{'count':_0x29c421,'rows':_0x1ab49e}:null;}})['then'](respondWithResult(_0x5b8133,null))[_0xeb9f('0x44')](handleError(_0x5b8133,null));};exports['addActions']=function(_0x2d1ae6,_0x464ced,_0x4c703d){return db[_0xeb9f('0x4d')][_0xeb9f('0x41')]({'where':{'id':_0x2d1ae6['params']['id']}})[_0xeb9f('0x20')](handleEntityNotFound(_0x464ced,null))[_0xeb9f('0x20')](function(_0x63491c){if(_0x63491c){return _0x63491c[_0xeb9f('0x4e')](_0x2d1ae6[_0xeb9f('0x43')][_0xeb9f('0x48')],_[_0xeb9f('0x49')](_0x2d1ae6[_0xeb9f('0x43')],[_0xeb9f('0x48'),'id'])||{});}})['then'](respondWithResult(_0x464ced,null))[_0xeb9f('0x44')](handleError(_0x464ced,null));};exports[_0xeb9f('0x4f')]=function(_0xb590dd,_0x5aaad4,_0x222244){var _0x358834={};var _0x2c1ff4={};var _0x229d4a;var _0x1f17e1;return db[_0xeb9f('0x28')][_0xeb9f('0x50')]({'where':{'id':_0xb590dd[_0xeb9f('0x3e')]['id']}})[_0xeb9f('0x20')](handleEntityNotFound(_0x5aaad4,null))[_0xeb9f('0x20')](function(_0x201c5f){if(_0x201c5f){_0x229d4a=_0x201c5f;_0x2c1ff4[_0xeb9f('0x2e')]=_['keys'](db[_0xeb9f('0x4d')][_0xeb9f('0x29')]);_0x2c1ff4['query']=_[_0xeb9f('0x2b')](_0xb590dd[_0xeb9f('0x2c')]);_0x2c1ff4[_0xeb9f('0x2d')]=_[_0xeb9f('0x3f')](_0x2c1ff4[_0xeb9f('0x2e')],_0x2c1ff4[_0xeb9f('0x2c')]);_0x358834[_0xeb9f('0x2f')]=_[_0xeb9f('0x3f')](_0x2c1ff4[_0xeb9f('0x2e')],qs[_0xeb9f('0x40')](_0xb590dd[_0xeb9f('0x2c')][_0xeb9f('0x40')]));_0x358834['attributes']=_0x358834[_0xeb9f('0x2f')][_0xeb9f('0x30')]?_0x358834[_0xeb9f('0x2f')]:_0x2c1ff4[_0xeb9f('0x2e')];_0x358834['order']=qs[_0xeb9f('0x32')](_0xb590dd[_0xeb9f('0x2c')]['sort']);_0x358834['where']=qs['filters'](_['pick'](_0xb590dd[_0xeb9f('0x2c')],_0x2c1ff4[_0xeb9f('0x2d')]));if(_0xb590dd[_0xeb9f('0x2c')][_0xeb9f('0x34')]){_0x358834[_0xeb9f('0x35')]=_[_0xeb9f('0x36')](_0x358834[_0xeb9f('0x35')],{'$or':_[_0xeb9f('0x27')](_0x358834[_0xeb9f('0x2f')],function(_0x135b8b){var _0x52c738={};_0x52c738[_0x135b8b]={'$like':'%'+_0xb590dd['query'][_0xeb9f('0x34')]+'%'};return _0x52c738;})});}_0x358834=_[_0xeb9f('0x36')]({},_0x358834,_0xb590dd['options']);return _0x229d4a['getActions'](_0x358834);}})['then'](function(_0x2c69d1){if(_0x2c69d1){_0x1f17e1=_0x2c69d1['length'];if(!_0xb590dd['query'][_0xeb9f('0x4c')](_0xeb9f('0x31'))){_0x358834[_0xeb9f('0x1c')]=qs[_0xeb9f('0x1c')](_0xb590dd[_0xeb9f('0x2c')]['limit']);_0x358834[_0xeb9f('0x1b')]=qs[_0xeb9f('0x1b')](_0xb590dd[_0xeb9f('0x2c')]['offset']);}return _0x229d4a[_0xeb9f('0x4f')](_0x358834);}})[_0xeb9f('0x20')](function(_0x1b5fff){if(_0x1b5fff){return _0x1b5fff?{'count':_0x1f17e1,'rows':_0x1b5fff}:null;}})['then'](respondWithResult(_0x5aaad4,null))[_0xeb9f('0x44')](handleError(_0x5aaad4,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6e0b3d8..1b724b6 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 _0x9071=['exports','define','Automation','tools_automations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes'];(function(_0x3ff813,_0x16741d){var _0x1e1f5c=function(_0x117364){while(--_0x117364){_0x3ff813['push'](_0x3ff813['shift']());}};_0x1e1f5c(++_0x16741d);}(_0x9071,0xe8));var _0x1907=function(_0x147437,_0x1271b0){_0x147437=_0x147437-0x0;var _0x5be728=_0x9071[_0x147437];return _0x5be728;};'use strict';var _=require('lodash');var util=require(_0x1907('0x0'));var logger=require(_0x1907('0x1'))(_0x1907('0x2'));var moment=require('moment');var BPromise=require(_0x1907('0x3'));var rp=require(_0x1907('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1907('0x5'));var config=require(_0x1907('0x6'));var attributes=require(_0x1907('0x7'));module[_0x1907('0x8')]=function(_0x2b1e77,_0x3614e7){return _0x2b1e77[_0x1907('0x9')](_0x1907('0xa'),attributes,{'tableName':_0x1907('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1de7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0x1de7,0x1de));var _0x71de=function(_0x26510a,_0x48b83e){_0x26510a=_0x26510a-0x0;var _0x2be0bf=_0x1de7[_0x26510a];return _0x2be0bf;};'use strict';var _=require(_0x71de('0x0'));var util=require(_0x71de('0x1'));var logger=require(_0x71de('0x2'))('api');var moment=require(_0x71de('0x3'));var BPromise=require(_0x71de('0x4'));var rp=require(_0x71de('0x5'));var fs=require('fs');var path=require(_0x71de('0x6'));var rimraf=require(_0x71de('0x7'));var config=require(_0x71de('0x8'));var attributes=require(_0x71de('0x9'));module[_0x71de('0xa')]=function(_0x4a0047,_0x48624a){return _0x4a0047['define'](_0x71de('0xb'),attributes,{'tableName':_0x71de('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 6580ba5..b5ed298 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 _0xcc25=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xd93cbe,_0x11202e){var _0xe0bb40=function(_0x50f4cc){while(--_0x50f4cc){_0xd93cbe['push'](_0xd93cbe['shift']());}};_0xe0bb40(++_0x11202e);}(_0xcc25,0x1e1));var _0x5cc2=function(_0x5b06b7,_0x5cdcaf){_0x5b06b7=_0x5b06b7-0x0;var _0x2e1422=_0xcc25[_0x5b06b7];return _0x2e1422;};'use strict';var _=require('lodash');var util=require(_0x5cc2('0x0'));var moment=require('moment');var BPromise=require(_0x5cc2('0x1'));var rs=require(_0x5cc2('0x2'));var fs=require('fs');var Redis=require(_0x5cc2('0x3'));var db=require(_0x5cc2('0x4'))['db'];var utils=require(_0x5cc2('0x5'));var logger=require(_0x5cc2('0x6'))(_0x5cc2('0x7'));var config=require(_0x5cc2('0x8'));var jayson=require(_0x5cc2('0x9'));var client=jayson['client'][_0x5cc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55c175,_0x75eefa,_0x2954a9){return new BPromise(function(_0x4bedba,_0x47580c){return client[_0x5cc2('0xb')](_0x55c175,_0x2954a9)[_0x5cc2('0xc')](function(_0x143c8c){logger['info'](_0x5cc2('0xd'),_0x75eefa,_0x5cc2('0xe'));logger[_0x5cc2('0xf')](_0x5cc2('0x10'),_0x75eefa,_0x5cc2('0xe'),JSON[_0x5cc2('0x11')](_0x143c8c));if(_0x143c8c[_0x5cc2('0x12')]){if(_0x143c8c['error'][_0x5cc2('0x13')]===0x1f4){logger['error'](_0x5cc2('0xd'),_0x75eefa,_0x143c8c[_0x5cc2('0x12')][_0x5cc2('0x14')]);return _0x47580c(_0x143c8c['error']['message']);}logger['error'](_0x5cc2('0xd'),_0x75eefa,_0x143c8c[_0x5cc2('0x12')][_0x5cc2('0x14')]);return _0x4bedba(_0x143c8c[_0x5cc2('0x12')][_0x5cc2('0x14')]);}else{logger[_0x5cc2('0x15')](_0x5cc2('0xd'),_0x75eefa,'request\x20sent');_0x4bedba(_0x143c8c[_0x5cc2('0x16')]['message']);}})[_0x5cc2('0x17')](function(_0x134ad6){logger[_0x5cc2('0x12')](_0x5cc2('0xd'),_0x75eefa,_0x134ad6);_0x47580c(_0x134ad6);});});} \ No newline at end of file +var _0xcca9=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','result'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcca9,0x1ee));var _0x9cca=function(_0x465aa9,_0x1bf1c8){_0x465aa9=_0x465aa9-0x0;var _0x4104e4=_0xcca9[_0x465aa9];return _0x4104e4;};'use strict';var _=require(_0x9cca('0x0'));var util=require('util');var moment=require(_0x9cca('0x1'));var BPromise=require(_0x9cca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cca('0x3'));var db=require(_0x9cca('0x4'))['db'];var utils=require(_0x9cca('0x5'));var logger=require('../../config/logger')(_0x9cca('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9cca('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37b7b3,_0x2f150e,_0x1bf723){return new BPromise(function(_0x1640af,_0x50a6ab){return client[_0x9cca('0x8')](_0x37b7b3,_0x1bf723)[_0x9cca('0x9')](function(_0x4da8d8){logger['info']('Automation,\x20%s,\x20%s',_0x2f150e,_0x9cca('0xa'));logger[_0x9cca('0xb')](_0x9cca('0xc'),_0x2f150e,_0x9cca('0xa'),JSON['stringify'](_0x4da8d8));if(_0x4da8d8[_0x9cca('0xd')]){if(_0x4da8d8[_0x9cca('0xd')][_0x9cca('0xe')]===0x1f4){logger[_0x9cca('0xd')](_0x9cca('0xf'),_0x2f150e,_0x4da8d8[_0x9cca('0xd')][_0x9cca('0x10')]);return _0x50a6ab(_0x4da8d8[_0x9cca('0xd')][_0x9cca('0x10')]);}logger[_0x9cca('0xd')](_0x9cca('0xf'),_0x2f150e,_0x4da8d8[_0x9cca('0xd')][_0x9cca('0x10')]);return _0x1640af(_0x4da8d8[_0x9cca('0xd')]['message']);}else{logger[_0x9cca('0x11')](_0x9cca('0xf'),_0x2f150e,'request\x20sent');_0x1640af(_0x4da8d8[_0x9cca('0x12')][_0x9cca('0x10')]);}})['catch'](function(_0x4e7735){logger[_0x9cca('0xd')]('Automation,\x20%s,\x20%s',_0x2f150e,_0x4e7735);_0x50a6ab(_0x4e7735);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2b50925..26e73c4 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 _0x88b5=['getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions'];(function(_0x4b7960,_0x535a21){var _0x27a8d1=function(_0x1af43f){while(--_0x1af43f){_0x4b7960['push'](_0x4b7960['shift']());}};_0x27a8d1(++_0x535a21);}(_0x88b5,0x167));var _0x588b=function(_0x67bf22,_0x2c3655){_0x67bf22=_0x67bf22-0x0;var _0x4525e9=_0x88b5[_0x67bf22];return _0x4525e9;};'use strict';var multer=require(_0x588b('0x0'));var util=require(_0x588b('0x1'));var path=require(_0x588b('0x2'));var timeout=require(_0x588b('0x3'));var express=require(_0x588b('0x4'));var router=express[_0x588b('0x5')]();var auth=require(_0x588b('0x6'));var interaction=require(_0x588b('0x7'));var config=require(_0x588b('0x8'));var controller=require(_0x588b('0x9'));router[_0x588b('0xa')]('/',auth[_0x588b('0xb')](),controller[_0x588b('0xc')]);router['get'](_0x588b('0xd'),auth[_0x588b('0xb')](),controller[_0x588b('0xe')]);router[_0x588b('0xa')](_0x588b('0xf'),auth[_0x588b('0xb')](),controller[_0x588b('0x10')]);router['get'](_0x588b('0x11'),auth[_0x588b('0xb')](),controller[_0x588b('0x12')]);router[_0x588b('0x13')]('/',auth[_0x588b('0xb')](),controller['create']);router[_0x588b('0x13')](_0x588b('0xf'),auth['isAuthenticated'](),controller[_0x588b('0x14')]);router[_0x588b('0x13')](_0x588b('0x11'),auth[_0x588b('0xb')](),controller[_0x588b('0x15')]);router['put'](_0x588b('0xd'),auth[_0x588b('0xb')](),controller[_0x588b('0x16')]);router[_0x588b('0x17')](_0x588b('0xd'),auth['isAuthenticated'](),controller[_0x588b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0ea9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','destroy','exports','multer','util','path','Router'];(function(_0x1c4951,_0x2038ee){var _0x345e1b=function(_0x69ee47){while(--_0x69ee47){_0x1c4951['push'](_0x1c4951['shift']());}};_0x345e1b(++_0x2038ee);}(_0x0ea9,0x130));var _0x90ea=function(_0x4387a6,_0x514cbc){_0x4387a6=_0x4387a6-0x0;var _0x51aecd=_0x0ea9[_0x4387a6];return _0x51aecd;};'use strict';var multer=require(_0x90ea('0x0'));var util=require(_0x90ea('0x1'));var path=require(_0x90ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x90ea('0x3')]();var auth=require(_0x90ea('0x4'));var interaction=require(_0x90ea('0x5'));var config=require(_0x90ea('0x6'));var controller=require('./automation.controller');router[_0x90ea('0x7')]('/',auth[_0x90ea('0x8')](),controller['index']);router['get'](_0x90ea('0x9'),auth[_0x90ea('0x8')](),controller[_0x90ea('0xa')]);router[_0x90ea('0x7')](_0x90ea('0xb'),auth[_0x90ea('0x8')](),controller[_0x90ea('0xc')]);router[_0x90ea('0x7')](_0x90ea('0xd'),auth[_0x90ea('0x8')](),controller[_0x90ea('0xe')]);router[_0x90ea('0xf')]('/',auth[_0x90ea('0x8')](),controller[_0x90ea('0x10')]);router['post']('/:id/conditions',auth[_0x90ea('0x8')](),controller['addConditions']);router['post'](_0x90ea('0xd'),auth[_0x90ea('0x8')](),controller[_0x90ea('0x11')]);router[_0x90ea('0x12')](_0x90ea('0x9'),auth[_0x90ea('0x8')](),controller[_0x90ea('0x13')]);router['delete'](_0x90ea('0x9'),auth[_0x90ea('0x8')](),controller[_0x90ea('0x14')]);module[_0x90ea('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 84b9233..4251d3b 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 _0xa62c=['ENUM','always','never','onlyIfOpen','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','name','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa62c,0x196));var _0xca62=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xa62c[_0x3b5049];return _0x12454e;};'use strict';var Sequelize=require(_0xca62('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xca62('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xca62('0x2')),'allowNull':![],'defaultValue':_0xca62('0x2')},'description':{'type':Sequelize[_0xca62('0x3')]},'active':{'type':Sequelize[_0xca62('0x4')],'defaultValue':0x0,'comment':_0xca62('0x5')},'limitCalls':{'type':Sequelize[_0xca62('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xca62('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xca62('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xca62('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xca62('0x6')](0x3)[_0xca62('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xca62('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xca62('0x6')](0x5)[_0xca62('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xca62('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xca62('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xca62('0x6')](0x5)[_0xca62('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xca62('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xca62('0x6')](0x3)[_0xca62('0x8')],'defaultValue':0x3,'comment':_0xca62('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xca62('0x6')](0x5)[_0xca62('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xca62('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xca62('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xca62('0xd')},'dialTimezone':{'type':Sequelize[_0xca62('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xca62('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xca62('0xe')](_0xca62('0xf'),_0xca62('0x10'),_0xca62('0x11')),'defaultValue':_0xca62('0xf')},'dialAMDActive':{'type':Sequelize[_0xca62('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xca62('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xca62('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xca62('0x6')](0x9)[_0xca62('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xca62('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xca62('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xca62('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xca62('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xca62('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xca62('0x6')](0x9)[_0xca62('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xca62('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xca62('0x6')](0x9)[_0xca62('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xca62('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xca62('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xca62('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xca62('0x6')](0x5)[_0xca62('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xca62('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xca62('0x6')](0x9)[_0xca62('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xca62('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xca62('0x1b'),_0xca62('0x1c')),'defaultValue':_0xca62('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xca62('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xca62('0x1d')},'dialCutDigit':{'type':Sequelize[_0xca62('0x6')](0x3)[_0xca62('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file +var _0x1c1f=['#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','STRING','name','ENUM','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1c1f,0x18b));var _0xf1c1=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x1c1f[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf1c1('0x0')],'unique':_0xf1c1('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf1c1('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf1c1('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf1c1('0x3')},'limitCalls':{'type':Sequelize[_0xf1c1('0x4')](0x4)[_0xf1c1('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf1c1('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf1c1('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf1c1('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf1c1('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1c1('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf1c1('0x4')](0x3)[_0xf1c1('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1c1('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf1c1('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1c1('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xf1c1('0x4')](0x3)[_0xf1c1('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1c1('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf1c1('0x4')](0x5)[_0xf1c1('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1c1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf1c1('0x4')](0x3)[_0xf1c1('0x5')],'defaultValue':0x3,'comment':_0xf1c1('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf1c1('0x4')](0x5)[_0xf1c1('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xf1c1('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf1c1('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf1c1('0x0')],'defaultValue':_0xf1c1('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xf1c1('0x2')](_0xf1c1('0xf'),_0xf1c1('0x10'),'onlyIfOpen'),'defaultValue':_0xf1c1('0xf')},'dialAMDActive':{'type':Sequelize[_0xf1c1('0x11')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf1c1('0x4')](0x9)[_0xf1c1('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf1c1('0x4')](0x9)[_0xf1c1('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf1c1('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf1c1('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf1c1('0x4')](0x9)[_0xf1c1('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf1c1('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xf1c1('0x4')](0x9)[_0xf1c1('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf1c1('0x4')](0x9)[_0xf1c1('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf1c1('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf1c1('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf1c1('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf1c1('0x4')](0x5)[_0xf1c1('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf1c1('0x4')](0x9)[_0xf1c1('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf1c1('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf1c1('0x17'),_0xf1c1('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf1c1('0x4')](0x3)[_0xf1c1('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf1c1('0x19')},'dialCutDigit':{'type':Sequelize[_0xf1c1('0x4')](0x3)[_0xf1c1('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf1c1('0x1a')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index b23adb6..298e22d 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 _0x2870=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','body','user','userProfileId','getHoppers','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0x2870,0x79));var _0x0287=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0x2870[_0x204ad4];return _0x50675f;};'use strict';var pdf=require(_0x0287('0x0'));var emlformat=require(_0x0287('0x1'));var rimraf=require(_0x0287('0x2'));var zipdir=require(_0x0287('0x3'));var jsonpatch=require(_0x0287('0x4'));var rp=require('request-promise');var moment=require(_0x0287('0x5'));var BPromise=require(_0x0287('0x6'));var Mustache=require(_0x0287('0x7'));var util=require('util');var path=require(_0x0287('0x8'));var sox=require(_0x0287('0x9'));var csv=require(_0x0287('0xa'));var ejs=require(_0x0287('0xb'));var fs=require('fs');var _=require(_0x0287('0xc'));var squel=require(_0x0287('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0287('0xe'));var toCsv=require(_0x0287('0xa'));var querystring=require(_0x0287('0xf'));var Papa=require(_0x0287('0x10'));var Redis=require(_0x0287('0x11'));var authService=require(_0x0287('0x12'));var qs=require(_0x0287('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0287('0x14'));var logger=require(_0x0287('0x15'))('api');var utils=require(_0x0287('0x16'));var config=require(_0x0287('0x17'));var db=require(_0x0287('0x18'))['db'];function respondWithStatusCode(_0x3f5569,_0x37e287){_0x37e287=_0x37e287||0xcc;return function(_0x4b8dfa){if(_0x4b8dfa){return _0x3f5569['sendStatus'](_0x37e287);}return _0x3f5569[_0x0287('0x19')](_0x37e287)['end']();};}function respondWithResult(_0x217567,_0x2f8275){_0x2f8275=_0x2f8275||0xc8;return function(_0x5f1700){if(_0x5f1700){return _0x217567[_0x0287('0x19')](_0x2f8275)[_0x0287('0x1a')](_0x5f1700);}};}function respondWithFilteredResult(_0x1efa36,_0x2bd69d){return function(_0x15cfb3){if(_0x15cfb3){var _0xaf78d1=_0x15cfb3[_0x0287('0x1b')],_0x53d9af=_0x2bd69d[_0x0287('0x1c')],_0x1da58e=_0x2bd69d[_0x0287('0x1c')]+_0x2bd69d[_0x0287('0x1d')],_0x4f0676;if(_0x1da58e>=_0xaf78d1){_0x1da58e=_0xaf78d1;_0x4f0676=0xc8;}else{_0x4f0676=0xce;}_0x1efa36[_0x0287('0x19')](_0x4f0676);return _0x1efa36[_0x0287('0x1e')]('Content-Range',_0x53d9af+'-'+_0x1da58e+'/'+_0xaf78d1)['json'](_0x15cfb3);}return null;};}function patchUpdates(_0x17f5f7){return function(_0x282b01){try{jsonpatch[_0x0287('0x1f')](_0x282b01,_0x17f5f7,!![]);}catch(_0x5e60ee){return BPromise[_0x0287('0x20')](_0x5e60ee);}return _0x282b01['save']();};}function saveUpdates(_0x1bf315,_0x12e926){return function(_0x509474){if(_0x509474){return _0x509474[_0x0287('0x21')](_0x1bf315)['then'](function(_0x1c9da4){return _0x1c9da4;});}return null;};}function removeEntity(_0xd5cde2,_0x523c69){return function(_0x4612b1){if(_0x4612b1){return _0x4612b1[_0x0287('0x22')]()[_0x0287('0x23')](function(){var _0x483ff0=_0x4612b1[_0x0287('0x24')]({'plain':!![]});var _0x3564f3=_0x0287('0x25');return db[_0x0287('0x26')][_0x0287('0x22')]({'where':{'type':_0x3564f3,'resourceId':_0x483ff0['id']}})[_0x0287('0x23')](function(){return _0x4612b1;});})['then'](function(){_0xd5cde2[_0x0287('0x19')](0xcc)[_0x0287('0x27')]();});}};}function handleEntityNotFound(_0x77c224,_0x4af67c){return function(_0x1588bf){if(!_0x1588bf){_0x77c224[_0x0287('0x28')](0x194);}return _0x1588bf;};}function handleError(_0x5518e3,_0x255e55){_0x255e55=_0x255e55||0x1f4;return function(_0x295086){logger[_0x0287('0x29')](_0x295086[_0x0287('0x2a')]);if(_0x295086[_0x0287('0x2b')]){delete _0x295086[_0x0287('0x2b')];}_0x5518e3[_0x0287('0x19')](_0x255e55)[_0x0287('0x2c')](_0x295086);};}exports[_0x0287('0x2d')]=function(_0x2e7720,_0x1c0821){var _0x2d67e2={},_0x3ffae0={},_0x2acab4={'count':0x0,'rows':[]};var _0x160d07=_[_0x0287('0x2e')](db[_0x0287('0x2f')][_0x0287('0x30')],function(_0x3c6321){return{'name':_0x3c6321[_0x0287('0x31')],'type':_0x3c6321['type'][_0x0287('0x32')]};});_0x3ffae0['model']=_[_0x0287('0x2e')](_0x160d07,'name');_0x3ffae0['query']=_[_0x0287('0x33')](_0x2e7720[_0x0287('0x34')]);_0x3ffae0[_0x0287('0x35')]=_[_0x0287('0x36')](_0x3ffae0[_0x0287('0x37')],_0x3ffae0[_0x0287('0x34')]);_0x2d67e2['attributes']=_[_0x0287('0x36')](_0x3ffae0[_0x0287('0x37')],qs[_0x0287('0x38')](_0x2e7720[_0x0287('0x34')][_0x0287('0x38')]));_0x2d67e2[_0x0287('0x39')]=_0x2d67e2[_0x0287('0x39')][_0x0287('0x3a')]?_0x2d67e2[_0x0287('0x39')]:_0x3ffae0['model'];if(!_0x2e7720[_0x0287('0x34')][_0x0287('0x3b')](_0x0287('0x3c'))){_0x2d67e2['limit']=qs['limit'](_0x2e7720[_0x0287('0x34')][_0x0287('0x1d')]);_0x2d67e2[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x2e7720[_0x0287('0x34')][_0x0287('0x1c')]);}_0x2d67e2[_0x0287('0x3d')]=qs[_0x0287('0x3e')](_0x2e7720[_0x0287('0x34')][_0x0287('0x3e')]);_0x2d67e2[_0x0287('0x3f')]=qs[_0x0287('0x35')](_[_0x0287('0x40')](_0x2e7720[_0x0287('0x34')],_0x3ffae0[_0x0287('0x35')]));if(_0x2e7720[_0x0287('0x34')][_0x0287('0x41')]){_0x2d67e2[_0x0287('0x3f')]=_[_0x0287('0x42')](_0x2d67e2[_0x0287('0x3f')],{'$or':_['map'](_0x160d07,function(_0x2e9209){if(_0x2e9209[_0x0287('0x43')]!==_0x0287('0x44')){var _0x1438d9={};_0x1438d9[_0x2e9209[_0x0287('0x2b')]]={'$like':'%'+_0x2e7720['query'][_0x0287('0x41')]+'%'};return _0x1438d9;}})});}_0x2d67e2=_[_0x0287('0x42')]({},_0x2d67e2,_0x2e7720[_0x0287('0x45')]);var _0x3da5f1={'where':_0x2d67e2[_0x0287('0x3f')]};return db[_0x0287('0x2f')][_0x0287('0x1b')](_0x3da5f1)['then'](function(_0x208810){_0x2acab4[_0x0287('0x1b')]=_0x208810;if(_0x2e7720[_0x0287('0x34')][_0x0287('0x46')]){_0x2d67e2[_0x0287('0x47')]=[{'all':!![]}];}return db[_0x0287('0x2f')]['findAll'](_0x2d67e2);})['then'](function(_0x36d454){_0x2acab4[_0x0287('0x48')]=_0x36d454;return _0x2acab4;})[_0x0287('0x23')](respondWithFilteredResult(_0x1c0821,_0x2d67e2))[_0x0287('0x49')](handleError(_0x1c0821,null));};exports[_0x0287('0x4a')]=function(_0x787d16,_0x220816){var _0xc699c7={'raw':![],'where':{'id':_0x787d16[_0x0287('0x4b')]['id']}},_0x361913={};_0x361913[_0x0287('0x37')]=_[_0x0287('0x33')](db[_0x0287('0x2f')]['rawAttributes']);_0x361913[_0x0287('0x34')]=_[_0x0287('0x33')](_0x787d16[_0x0287('0x34')]);_0x361913[_0x0287('0x35')]=_[_0x0287('0x36')](_0x361913[_0x0287('0x37')],_0x361913[_0x0287('0x34')]);_0xc699c7[_0x0287('0x39')]=_[_0x0287('0x36')](_0x361913[_0x0287('0x37')],qs[_0x0287('0x38')](_0x787d16[_0x0287('0x34')][_0x0287('0x38')]));_0xc699c7[_0x0287('0x39')]=_0xc699c7['attributes'][_0x0287('0x3a')]?_0xc699c7['attributes']:_0x361913[_0x0287('0x37')];if(_0x787d16[_0x0287('0x34')]['includeAll']){_0xc699c7[_0x0287('0x47')]=[{'all':!![]}];}_0xc699c7=_['merge']({},_0xc699c7,_0x787d16[_0x0287('0x45')]);return db[_0x0287('0x2f')][_0x0287('0x4c')](_0xc699c7)[_0x0287('0x23')](handleEntityNotFound(_0x220816,null))[_0x0287('0x23')](respondWithResult(_0x220816,null))[_0x0287('0x49')](handleError(_0x220816,null));};exports['create']=function(_0x199fa0,_0x57f634){return db['Campaign'][_0x0287('0x4d')](_0x199fa0['body'],{})[_0x0287('0x23')](function(_0x2ad995){var _0x1cfcb1=_0x199fa0['user'][_0x0287('0x24')]({'plain':!![]});if(!_0x1cfcb1)throw new Error(_0x0287('0x4e'));if(_0x1cfcb1[_0x0287('0x4f')]==='user'){var _0x18b98d=_0x2ad995[_0x0287('0x24')]({'plain':!![]});var _0x4e3bc5=_0x0287('0x25');return db[_0x0287('0x50')][_0x0287('0x4c')]({'where':{'name':_0x4e3bc5,'userProfileId':_0x1cfcb1['userProfileId']},'raw':!![]})[_0x0287('0x23')](function(_0x53d5a6){if(_0x53d5a6&&_0x53d5a6[_0x0287('0x51')]===0x0){return db[_0x0287('0x26')][_0x0287('0x4d')]({'name':_0x18b98d['name'],'resourceId':_0x18b98d['id'],'type':_0x53d5a6[_0x0287('0x2b')],'sectionId':_0x53d5a6['id']},{})['then'](function(){return _0x2ad995;});}else{return _0x2ad995;}})[_0x0287('0x49')](function(_0x5ebdba){logger[_0x0287('0x29')](_0x0287('0x52'),_0x5ebdba);throw _0x5ebdba;});}return _0x2ad995;})[_0x0287('0x23')](respondWithResult(_0x57f634,0xc9))[_0x0287('0x49')](handleError(_0x57f634,null));};exports[_0x0287('0x53')]=function(_0x168a28,_0x2b4b79){var _0x3f7f5c={'where':{'id':_0x168a28[_0x0287('0x4b')]['id']}},_0x377f9f={};_0x377f9f[_0x0287('0x37')]=_[_0x0287('0x33')](db[_0x0287('0x2f')][_0x0287('0x30')]);_0x3f7f5c[_0x0287('0x39')]=_[_0x0287('0x36')](_0x377f9f[_0x0287('0x37')],qs[_0x0287('0x38')](_0x168a28['query'][_0x0287('0x38')]));_0x3f7f5c[_0x0287('0x39')]=_0x3f7f5c['attributes'][_0x0287('0x3a')]?_0x3f7f5c['attributes']:_0x377f9f[_0x0287('0x37')];if(_0x168a28['query']['includeAll']){_0x3f7f5c['include']=[{'all':!![]}];}_0x3f7f5c=_[_0x0287('0x42')]({},_0x3f7f5c,_0x168a28[_0x0287('0x45')]);return db[_0x0287('0x2f')][_0x0287('0x4c')](_0x3f7f5c)['then'](handleEntityNotFound(_0x2b4b79,null))['then'](function(_0x23296d){if(_0x23296d){var _0x72d7e4=_0x23296d[_0x0287('0x24')]({'plain':!![]});_0x72d7e4=qs['omit'](_0x72d7e4,['id',_0x0287('0x54'),'updatedAt']);_0x168a28['body']=_[_0x0287('0x55')](_0x168a28[_0x0287('0x56')],['id',_0x0287('0x54'),'updatedAt']);return db['Campaign'][_0x0287('0x4d')](_['merge'](_0x72d7e4,_0x168a28['body']),{'include':_0x168a28[_0x0287('0x34')][_0x0287('0x46')]?[{'all':!![]}]:undefined})[_0x0287('0x23')](function(_0x4c3490){var _0x2c51b2=_0x168a28['user'][_0x0287('0x24')]({'plain':!![]});if(!_0x2c51b2)throw new Error(_0x0287('0x4e'));if(_0x2c51b2[_0x0287('0x4f')]===_0x0287('0x57')){var _0x4d80eb=_0x4c3490['get']({'plain':!![]});var _0x3db8e3=_0x0287('0x25');return db['UserProfileSection'][_0x0287('0x4c')]({'where':{'name':_0x3db8e3,'userProfileId':_0x2c51b2[_0x0287('0x58')]},'raw':!![]})['then'](function(_0x549d23){if(_0x549d23&&_0x549d23[_0x0287('0x51')]===0x0){return db[_0x0287('0x26')]['create']({'name':_0x4d80eb[_0x0287('0x2b')],'resourceId':_0x4d80eb['id'],'type':_0x549d23[_0x0287('0x2b')],'sectionId':_0x549d23['id']},{})[_0x0287('0x23')](function(){return _0x4c3490;});}else{return _0x4c3490;}})[_0x0287('0x49')](function(_0x545ca9){logger['error'](_0x0287('0x52'),_0x545ca9);throw _0x545ca9;});}return _0x4c3490;});}})[_0x0287('0x23')](respondWithResult(_0x2b4b79,0xc9))[_0x0287('0x49')](handleError(_0x2b4b79,null));};exports[_0x0287('0x21')]=function(_0x5e43e3,_0x533b8c){if(_0x5e43e3[_0x0287('0x56')]['id']){delete _0x5e43e3['body']['id'];}return db['Campaign'][_0x0287('0x4c')]({'where':{'id':_0x5e43e3[_0x0287('0x4b')]['id']}})['then'](handleEntityNotFound(_0x533b8c,null))[_0x0287('0x23')](saveUpdates(_0x5e43e3[_0x0287('0x56')],null))['then'](respondWithResult(_0x533b8c,null))[_0x0287('0x49')](handleError(_0x533b8c,null));};exports[_0x0287('0x22')]=function(_0x43922c,_0x1ad9d4){return db[_0x0287('0x2f')][_0x0287('0x4c')]({'where':{'id':_0x43922c['params']['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x1ad9d4,null))[_0x0287('0x23')](removeEntity(_0x1ad9d4,null))['catch'](handleError(_0x1ad9d4,null));};exports[_0x0287('0x59')]=function(_0x564d63,_0x12563e,_0x4fa1bc){var _0xcca664={'raw':!![],'where':{}};var _0xc2a5a0={};var _0x50a525={'count':0x0,'rows':[]};return db[_0x0287('0x2f')]['findOne']({'where':{'id':_0x564d63['params']['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x12563e,null))[_0x0287('0x23')](function(_0x429a5d){if(_0x429a5d){_0xc2a5a0[_0x0287('0x37')]=_[_0x0287('0x33')](db[_0x0287('0x5a')][_0x0287('0x30')]);_0xc2a5a0[_0x0287('0x34')]=_[_0x0287('0x33')](_0x564d63[_0x0287('0x34')]);_0xc2a5a0[_0x0287('0x35')]=_['intersection'](_0xc2a5a0[_0x0287('0x37')],_0xc2a5a0['query']);_0xcca664['attributes']=_[_0x0287('0x36')](_0xc2a5a0['model'],qs[_0x0287('0x38')](_0x564d63[_0x0287('0x34')][_0x0287('0x38')]));_0xcca664[_0x0287('0x39')]=_0xcca664['attributes'][_0x0287('0x3a')]?_0xcca664[_0x0287('0x39')]:_0xc2a5a0['model'];if(!_0x564d63[_0x0287('0x34')]['hasOwnProperty'](_0x0287('0x3c'))){_0xcca664[_0x0287('0x1d')]=qs[_0x0287('0x1d')](_0x564d63[_0x0287('0x34')][_0x0287('0x1d')]);_0xcca664[_0x0287('0x1c')]=qs['offset'](_0x564d63[_0x0287('0x34')][_0x0287('0x1c')]);}_0xcca664[_0x0287('0x3d')]=qs['sort'](_0x564d63[_0x0287('0x34')][_0x0287('0x3e')]);_0xcca664[_0x0287('0x3f')]=qs[_0x0287('0x35')](_['pick'](_0x564d63['query'],_0xc2a5a0[_0x0287('0x35')]));_0xcca664[_0x0287('0x3f')][_0x0287('0x5b')]=_0x429a5d['id'];if(_0x564d63[_0x0287('0x34')][_0x0287('0x41')]){_0xcca664[_0x0287('0x3f')]=_[_0x0287('0x42')](_0xcca664['where'],{'$or':_[_0x0287('0x2e')](_0xcca664[_0x0287('0x39')],function(_0x1312cb){var _0x283ec6={};_0x283ec6[_0x1312cb]={'$like':'%'+_0x564d63['query'][_0x0287('0x41')]+'%'};return _0x283ec6;})});}_0xcca664=_['merge']({},_0xcca664,_0x564d63[_0x0287('0x45')]);return db['CmHopper'][_0x0287('0x1b')]({'where':_0xcca664[_0x0287('0x3f')]})[_0x0287('0x23')](function(_0x1d1c15){_0x50a525[_0x0287('0x1b')]=_0x1d1c15;if(_0x564d63[_0x0287('0x34')][_0x0287('0x46')]){_0xcca664['include']=[{'all':!![]}];}return db[_0x0287('0x5a')][_0x0287('0x5c')](_0xcca664);})[_0x0287('0x23')](function(_0x59785e){_0x50a525[_0x0287('0x48')]=_0x59785e;return _0x50a525;});}})[_0x0287('0x23')](respondWithFilteredResult(_0x12563e,_0xcca664))['catch'](handleError(_0x12563e,null));};exports[_0x0287('0x5d')]=function(_0x3b59ca,_0x404016,_0xab4c98){var _0x3e3ebb={'raw':!![],'where':{}};var _0x1ff9bc={};var _0x576f7f={'count':0x0,'rows':[]};return db['Campaign'][_0x0287('0x5e')]({'where':{'id':_0x3b59ca[_0x0287('0x4b')]['id']}})['then'](handleEntityNotFound(_0x404016,null))[_0x0287('0x23')](function(_0x41ea22){if(_0x41ea22){_0x1ff9bc['model']=_[_0x0287('0x33')](db[_0x0287('0x5f')]['rawAttributes']);_0x1ff9bc['query']=_[_0x0287('0x33')](_0x3b59ca[_0x0287('0x34')]);_0x1ff9bc[_0x0287('0x35')]=_['intersection'](_0x1ff9bc[_0x0287('0x37')],_0x1ff9bc[_0x0287('0x34')]);_0x3e3ebb[_0x0287('0x39')]=_[_0x0287('0x36')](_0x1ff9bc['model'],qs[_0x0287('0x38')](_0x3b59ca[_0x0287('0x34')][_0x0287('0x38')]));_0x3e3ebb[_0x0287('0x39')]=_0x3e3ebb['attributes']['length']?_0x3e3ebb[_0x0287('0x39')]:_0x1ff9bc[_0x0287('0x37')];if(!_0x3b59ca[_0x0287('0x34')][_0x0287('0x3b')](_0x0287('0x3c'))){_0x3e3ebb[_0x0287('0x1d')]=qs[_0x0287('0x1d')](_0x3b59ca[_0x0287('0x34')][_0x0287('0x1d')]);_0x3e3ebb[_0x0287('0x1c')]=qs['offset'](_0x3b59ca[_0x0287('0x34')]['offset']);}_0x3e3ebb['order']=qs[_0x0287('0x3e')](_0x3b59ca[_0x0287('0x34')]['sort']);_0x3e3ebb[_0x0287('0x3f')]=qs[_0x0287('0x35')](_[_0x0287('0x40')](_0x3b59ca[_0x0287('0x34')],_0x1ff9bc[_0x0287('0x35')]));_0x3e3ebb['where']['CampaignId']=_0x41ea22['id'];if(_0x3b59ca['query'][_0x0287('0x41')]){_0x3e3ebb[_0x0287('0x3f')]=_[_0x0287('0x42')](_0x3e3ebb[_0x0287('0x3f')],{'$or':_[_0x0287('0x2e')](_0x3e3ebb['attributes'],function(_0x2730ff){var _0xe7bb7f={};_0xe7bb7f[_0x2730ff]={'$like':'%'+_0x3b59ca[_0x0287('0x34')][_0x0287('0x41')]+'%'};return _0xe7bb7f;})});}_0x3e3ebb=_[_0x0287('0x42')]({},_0x3e3ebb,_0x3b59ca[_0x0287('0x45')]);return db['CmHopperHistory'][_0x0287('0x1b')]({'where':_0x3e3ebb[_0x0287('0x3f')]})['then'](function(_0x158a17){_0x576f7f[_0x0287('0x1b')]=_0x158a17;if(_0x3b59ca[_0x0287('0x34')]['includeAll']){_0x3e3ebb['include']=[{'all':!![]}];}return db[_0x0287('0x5f')]['findAll'](_0x3e3ebb);})[_0x0287('0x23')](function(_0x11a8e4){_0x576f7f[_0x0287('0x48')]=_0x11a8e4;return _0x576f7f;});}})[_0x0287('0x23')](respondWithFilteredResult(_0x404016,_0x3e3ebb))['catch'](handleError(_0x404016,null));};exports[_0x0287('0x60')]=function(_0x279f8b,_0x537be1,_0x8052d8){var _0x2713c7={'raw':!![],'where':{}};var _0x3e8750={};var _0x77a60e={'count':0x0,'rows':[]};return db['Campaign'][_0x0287('0x5e')]({'where':{'id':_0x279f8b[_0x0287('0x4b')]['id']}})['then'](handleEntityNotFound(_0x537be1,null))[_0x0287('0x23')](function(_0x515c70){if(_0x515c70){_0x3e8750['model']=_[_0x0287('0x33')](db['CmHopperFinal']['rawAttributes']);_0x3e8750[_0x0287('0x34')]=_['keys'](_0x279f8b['query']);_0x3e8750[_0x0287('0x35')]=_[_0x0287('0x36')](_0x3e8750[_0x0287('0x37')],_0x3e8750[_0x0287('0x34')]);_0x2713c7['attributes']=_[_0x0287('0x36')](_0x3e8750['model'],qs[_0x0287('0x38')](_0x279f8b[_0x0287('0x34')][_0x0287('0x38')]));_0x2713c7[_0x0287('0x39')]=_0x2713c7[_0x0287('0x39')][_0x0287('0x3a')]?_0x2713c7[_0x0287('0x39')]:_0x3e8750['model'];if(!_0x279f8b[_0x0287('0x34')][_0x0287('0x3b')](_0x0287('0x3c'))){_0x2713c7[_0x0287('0x1d')]=qs[_0x0287('0x1d')](_0x279f8b[_0x0287('0x34')][_0x0287('0x1d')]);_0x2713c7[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x279f8b[_0x0287('0x34')]['offset']);}_0x2713c7[_0x0287('0x3d')]=qs[_0x0287('0x3e')](_0x279f8b[_0x0287('0x34')][_0x0287('0x3e')]);_0x2713c7['where']=qs['filters'](_[_0x0287('0x40')](_0x279f8b[_0x0287('0x34')],_0x3e8750['filters']));_0x2713c7['where']['CampaignId']=_0x515c70['id'];if(_0x279f8b[_0x0287('0x34')][_0x0287('0x41')]){_0x2713c7[_0x0287('0x3f')]=_['merge'](_0x2713c7[_0x0287('0x3f')],{'$or':_[_0x0287('0x2e')](_0x2713c7[_0x0287('0x39')],function(_0x8b1b3c){var _0x36cac1={};_0x36cac1[_0x8b1b3c]={'$like':'%'+_0x279f8b[_0x0287('0x34')]['filter']+'%'};return _0x36cac1;})});}_0x2713c7=_['merge']({},_0x2713c7,_0x279f8b[_0x0287('0x45')]);return db[_0x0287('0x61')][_0x0287('0x1b')]({'where':_0x2713c7['where']})[_0x0287('0x23')](function(_0x46ec55){_0x77a60e[_0x0287('0x1b')]=_0x46ec55;if(_0x279f8b['query'][_0x0287('0x46')]){_0x2713c7['include']=[{'all':!![]}];}return db[_0x0287('0x61')][_0x0287('0x5c')](_0x2713c7);})[_0x0287('0x23')](function(_0x437685){_0x77a60e[_0x0287('0x48')]=_0x437685;return _0x77a60e;});}})[_0x0287('0x23')](respondWithFilteredResult(_0x537be1,_0x2713c7))[_0x0287('0x49')](handleError(_0x537be1,null));};exports[_0x0287('0x62')]=function(_0x14883c,_0x52bc0d,_0x3baa0c){var _0x1d9c9a={'raw':!![],'where':{}};var _0x3ed8cc={};var _0xcbef92={'count':0x0,'rows':[]};return db[_0x0287('0x2f')][_0x0287('0x5e')]({'where':{'id':_0x14883c[_0x0287('0x4b')]['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x52bc0d,null))[_0x0287('0x23')](function(_0x5094b9){if(_0x5094b9){_0x3ed8cc[_0x0287('0x37')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x3ed8cc[_0x0287('0x34')]=_['keys'](_0x14883c['query']);_0x3ed8cc[_0x0287('0x35')]=_['intersection'](_0x3ed8cc[_0x0287('0x37')],_0x3ed8cc[_0x0287('0x34')]);_0x1d9c9a[_0x0287('0x39')]=_['intersection'](_0x3ed8cc[_0x0287('0x37')],qs['fields'](_0x14883c[_0x0287('0x34')][_0x0287('0x38')]));_0x1d9c9a[_0x0287('0x39')]=_0x1d9c9a[_0x0287('0x39')][_0x0287('0x3a')]?_0x1d9c9a[_0x0287('0x39')]:_0x3ed8cc[_0x0287('0x37')];if(!_0x14883c[_0x0287('0x34')][_0x0287('0x3b')]('nolimit')){_0x1d9c9a[_0x0287('0x1d')]=qs[_0x0287('0x1d')](_0x14883c[_0x0287('0x34')][_0x0287('0x1d')]);_0x1d9c9a[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x14883c[_0x0287('0x34')][_0x0287('0x1c')]);}_0x1d9c9a['order']=qs[_0x0287('0x3e')](_0x14883c[_0x0287('0x34')][_0x0287('0x3e')]);_0x1d9c9a['where']=qs[_0x0287('0x35')](_[_0x0287('0x40')](_0x14883c[_0x0287('0x34')],_0x3ed8cc[_0x0287('0x35')]));_0x1d9c9a[_0x0287('0x3f')][_0x0287('0x5b')]=_0x5094b9['id'];if(_0x14883c[_0x0287('0x34')][_0x0287('0x41')]){_0x1d9c9a[_0x0287('0x3f')]=_[_0x0287('0x42')](_0x1d9c9a[_0x0287('0x3f')],{'$or':_['map'](_0x1d9c9a['attributes'],function(_0x51ffa0){var _0x264cd1={};_0x264cd1[_0x51ffa0]={'$like':'%'+_0x14883c[_0x0287('0x34')][_0x0287('0x41')]+'%'};return _0x264cd1;})});}_0x1d9c9a=_[_0x0287('0x42')]({},_0x1d9c9a,_0x14883c[_0x0287('0x45')]);return db[_0x0287('0x63')][_0x0287('0x1b')]({'where':_0x1d9c9a[_0x0287('0x3f')]})[_0x0287('0x23')](function(_0x3fbabf){_0xcbef92[_0x0287('0x1b')]=_0x3fbabf;if(_0x14883c[_0x0287('0x34')][_0x0287('0x46')]){_0x1d9c9a[_0x0287('0x47')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0287('0x5c')](_0x1d9c9a);})[_0x0287('0x23')](function(_0x1a6e4d){_0xcbef92[_0x0287('0x48')]=_0x1a6e4d;return _0xcbef92;});}})['then'](respondWithFilteredResult(_0x52bc0d,_0x1d9c9a))[_0x0287('0x49')](handleError(_0x52bc0d,null));};exports[_0x0287('0x64')]=function(_0x387c9b,_0x5c990e,_0x31e429){var _0x512f28={};var _0x3fea7a={};var _0x6a59c7;var _0x4f40a1;return db[_0x0287('0x2f')][_0x0287('0x5e')]({'where':{'id':_0x387c9b[_0x0287('0x4b')]['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x5c990e,null))[_0x0287('0x23')](function(_0x56dfa4){if(_0x56dfa4){_0x6a59c7=_0x56dfa4;_0x3fea7a[_0x0287('0x37')]=_[_0x0287('0x33')](db[_0x0287('0x65')][_0x0287('0x30')]);_0x3fea7a[_0x0287('0x34')]=_[_0x0287('0x33')](_0x387c9b[_0x0287('0x34')]);_0x3fea7a[_0x0287('0x35')]=_['intersection'](_0x3fea7a[_0x0287('0x37')],_0x3fea7a[_0x0287('0x34')]);_0x512f28[_0x0287('0x39')]=_[_0x0287('0x36')](_0x3fea7a['model'],qs['fields'](_0x387c9b[_0x0287('0x34')][_0x0287('0x38')]));_0x512f28[_0x0287('0x39')]=_0x512f28[_0x0287('0x39')][_0x0287('0x3a')]?_0x512f28[_0x0287('0x39')]:_0x3fea7a[_0x0287('0x37')];_0x512f28[_0x0287('0x3d')]=qs[_0x0287('0x3e')](_0x387c9b[_0x0287('0x34')][_0x0287('0x3e')]);_0x512f28['where']=qs[_0x0287('0x35')](_[_0x0287('0x40')](_0x387c9b[_0x0287('0x34')],_0x3fea7a[_0x0287('0x35')]));if(_0x387c9b[_0x0287('0x34')][_0x0287('0x41')]){_0x512f28['where']=_[_0x0287('0x42')](_0x512f28[_0x0287('0x3f')],{'$or':_[_0x0287('0x2e')](_0x512f28[_0x0287('0x39')],function(_0x59ea92){var _0x1ebaa6={};_0x1ebaa6[_0x59ea92]={'$like':'%'+_0x387c9b['query'][_0x0287('0x41')]+'%'};return _0x1ebaa6;})});}_0x512f28=_[_0x0287('0x42')]({},_0x512f28,_0x387c9b[_0x0287('0x45')]);return _0x6a59c7[_0x0287('0x64')](_0x512f28);}})[_0x0287('0x23')](function(_0x44d5ea){if(_0x44d5ea){_0x4f40a1=_0x44d5ea[_0x0287('0x3a')];if(!_0x387c9b['query'][_0x0287('0x3b')](_0x0287('0x3c'))){_0x512f28[_0x0287('0x1d')]=qs[_0x0287('0x1d')](_0x387c9b[_0x0287('0x34')][_0x0287('0x1d')]);_0x512f28[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x387c9b[_0x0287('0x34')][_0x0287('0x1c')]);}return _0x6a59c7[_0x0287('0x64')](_0x512f28);}})[_0x0287('0x23')](function(_0x4f5c49){if(_0x4f5c49){return _0x4f5c49?{'count':_0x4f40a1,'rows':_0x4f5c49}:null;}})[_0x0287('0x23')](respondWithResult(_0x5c990e,null))['catch'](handleError(_0x5c990e,null));};exports[_0x0287('0x66')]=function(_0x1ea6d3,_0x353e2b,_0x1f5fe9){var _0x49f847,_0x1268f5;return db[_0x0287('0x2f')][_0x0287('0x4c')]({'where':{'id':_0x1ea6d3['params']['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x353e2b,null))[_0x0287('0x23')](function(_0x12e769){if(_0x12e769){_0x1268f5=_0x12e769;return _0x12e769[_0x0287('0x66')](_0x1ea6d3[_0x0287('0x56')][_0x0287('0x67')],_[_0x0287('0x55')](_0x1ea6d3[_0x0287('0x56')],[_0x0287('0x67'),'id'])||{});}return null;})[_0x0287('0x68')](function(_0x588c10){var _0x152416;_0x49f847=_0x588c10||[];var _0x3e9326=[];if(_0x588c10){for(var _0x46c925=0x0;_0x46c925<_0x588c10[_0x0287('0x3a')];_0x46c925+=0x1){var _0x3c936e=_0x588c10[_0x46c925][_0x0287('0x24')]({'plain':!![]});_0x1268f5[_0x0287('0x69')]=_0x1ea6d3[_0x0287('0x56')]['dialCheckDuplicateType']?_0x1ea6d3[_0x0287('0x56')][_0x0287('0x69')]:_0x1268f5[_0x0287('0x69')];switch(_0x1268f5['dialCheckDuplicateType']){case _0x0287('0x6a'):_0x152416=squel[_0x0287('0x6b')]()[_0x0287('0x6c')](_0x0287('0x6d'))[_0x0287('0x6e')]([_0x0287('0x6f'),_0x0287('0x70'),_0x0287('0x71'),_0x0287('0x72'),_0x0287('0x5b'),'createdAt','updatedAt'],squel['select']()['field'](_0x0287('0x6f'),_0x0287('0x6f'))[_0x0287('0x73')](_0x0287('0x74'),'scheduledAt')[_0x0287('0x73')]('id',_0x0287('0x71'))[_0x0287('0x73')](_0x3c936e[_0x0287('0x75')][_0x0287('0x76')](),_0x0287('0x72'))[_0x0287('0x73')](_0x1ea6d3[_0x0287('0x4b')]['id']['toString'](),'CampaignId')[_0x0287('0x73')](_0x0287('0x74'),_0x0287('0x54'))[_0x0287('0x73')]('NOW()',_0x0287('0x77'))[_0x0287('0x78')](_0x0287('0x79'))[_0x0287('0x3f')](_0x0287('0x7a'))[_0x0287('0x3f')](_0x0287('0x7b'),_0x3c936e[_0x0287('0x75')][_0x0287('0x76')]())['where'](_0x0287('0x7c'))[_0x0287('0x3f')](_0x0287('0x7d'),squel['select']()[_0x0287('0x73')](_0x0287('0x7e'))['from'](_0x0287('0x7f'))[_0x0287('0x3f')](_0x0287('0x80'),_0x1ea6d3[_0x0287('0x4b')]['id'][_0x0287('0x76')]()))[_0x0287('0x3f')](_0x0287('0x7d'),squel[_0x0287('0x81')]()[_0x0287('0x73')](_0x0287('0x82'))[_0x0287('0x78')](_0x0287('0x6d'))[_0x0287('0x3f')](_0x0287('0x80'),_0x1ea6d3[_0x0287('0x4b')]['id'][_0x0287('0x76')]())))[_0x0287('0x76')]();break;case _0x0287('0x83'):_0x152416=squel[_0x0287('0x6b')]()[_0x0287('0x6c')](_0x0287('0x6d'))[_0x0287('0x6e')]([_0x0287('0x6f'),'scheduledAt',_0x0287('0x71'),_0x0287('0x72'),_0x0287('0x5b'),_0x0287('0x54'),_0x0287('0x77')],squel['select']()[_0x0287('0x73')](_0x0287('0x6f'),'phone')[_0x0287('0x73')](_0x0287('0x74'),_0x0287('0x70'))[_0x0287('0x73')]('id',_0x0287('0x71'))[_0x0287('0x73')](_0x3c936e[_0x0287('0x75')][_0x0287('0x76')](),'ListId')['field'](_0x1ea6d3[_0x0287('0x4b')]['id'][_0x0287('0x76')](),_0x0287('0x5b'))[_0x0287('0x73')](_0x0287('0x74'),_0x0287('0x54'))['field'](_0x0287('0x74'),_0x0287('0x77'))[_0x0287('0x78')](_0x0287('0x79'))[_0x0287('0x3f')](_0x0287('0x7a'))[_0x0287('0x3f')](_0x0287('0x7b'),_0x3c936e[_0x0287('0x75')]['toString']())[_0x0287('0x3f')](_0x0287('0x7c'))[_0x0287('0x3f')](_0x0287('0x7d'),squel[_0x0287('0x81')]()[_0x0287('0x73')]('COALESCE(phone,\x27\x27)')[_0x0287('0x78')](_0x0287('0x6d'))['where']('CampaignId\x20=\x20?',_0x1ea6d3[_0x0287('0x4b')]['id'][_0x0287('0x76')]())))[_0x0287('0x76')]();break;default:_0x152416=squel[_0x0287('0x6b')]()[_0x0287('0x6c')](_0x0287('0x6d'))['fromQuery']([_0x0287('0x6f'),_0x0287('0x70'),_0x0287('0x71'),'ListId',_0x0287('0x5b'),'createdAt',_0x0287('0x77')],squel[_0x0287('0x81')]()['field'](_0x0287('0x6f'),_0x0287('0x6f'))['field'](_0x0287('0x74'),_0x0287('0x70'))[_0x0287('0x73')]('id',_0x0287('0x71'))[_0x0287('0x73')](_0x3c936e['CmListId']['toString'](),_0x0287('0x72'))[_0x0287('0x73')](_0x1ea6d3[_0x0287('0x4b')]['id'][_0x0287('0x76')](),_0x0287('0x5b'))[_0x0287('0x73')](_0x0287('0x74'),'createdAt')[_0x0287('0x73')]('NOW()',_0x0287('0x77'))['from'](_0x0287('0x79'))['where'](_0x0287('0x7a'))[_0x0287('0x3f')]('ListId\x20=\x20?',_0x3c936e[_0x0287('0x75')]['toString']())[_0x0287('0x3f')](_0x0287('0x7c')))['toString']();}_0x3e9326['push'](db[_0x0287('0x84')]['query'](_0x152416));}return BPromise[_0x0287('0x85')](_0x3e9326);}})[_0x0287('0x23')](function(){return _0x49f847;})[_0x0287('0x23')](respondWithResult(_0x353e2b,null))[_0x0287('0x49')](handleError(_0x353e2b,null));};exports[_0x0287('0x86')]=function(_0x3414d1,_0x3ca383,_0x141048){return db[_0x0287('0x2f')][_0x0287('0x4c')]({'where':{'id':_0x3414d1[_0x0287('0x4b')]['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x3ca383,null))['then'](function(_0x485a4e){if(_0x485a4e){return _0x485a4e[_0x0287('0x86')](_0x3414d1[_0x0287('0x34')][_0x0287('0x67')]);}})[_0x0287('0x23')](function(_0x1f29cf){if(_0x1f29cf){return db[_0x0287('0x5a')][_0x0287('0x22')]({'where':{'ListId':_0x3414d1[_0x0287('0x34')]['ids'],'CampaignId':_0x3414d1[_0x0287('0x4b')]['id']}})[_0x0287('0x23')](function(){return _0x1f29cf;});}})[_0x0287('0x23')](respondWithStatusCode(_0x3ca383,null))[_0x0287('0x49')](handleError(_0x3ca383,null));};exports[_0x0287('0x87')]=function(_0x54f9e9,_0x443836,_0x3655ba){var _0x3962c5={'raw':!![],'where':{}};var _0x4bbcc3={};var _0x53c8e6={'count':0x0,'rows':[]};return db[_0x0287('0x2f')]['findOne']({'where':{'id':_0x54f9e9[_0x0287('0x4b')]['id']}})['then'](handleEntityNotFound(_0x443836,null))['then'](function(_0x29ac86){if(_0x29ac86){_0x4bbcc3[_0x0287('0x37')]=_[_0x0287('0x33')](db[_0x0287('0x65')][_0x0287('0x30')]);_0x4bbcc3[_0x0287('0x34')]=_['keys'](_0x54f9e9[_0x0287('0x34')]);_0x4bbcc3[_0x0287('0x35')]=_[_0x0287('0x36')](_0x4bbcc3[_0x0287('0x37')],_0x4bbcc3['query']);_0x3962c5[_0x0287('0x39')]=_[_0x0287('0x36')](_0x4bbcc3[_0x0287('0x37')],qs['fields'](_0x54f9e9[_0x0287('0x34')]['fields']));_0x3962c5[_0x0287('0x39')]=_0x3962c5[_0x0287('0x39')][_0x0287('0x3a')]?_0x3962c5[_0x0287('0x39')]:_0x4bbcc3['model'];if(!_0x54f9e9[_0x0287('0x34')][_0x0287('0x3b')](_0x0287('0x3c'))){_0x3962c5[_0x0287('0x1d')]=qs[_0x0287('0x1d')](_0x54f9e9[_0x0287('0x34')]['limit']);_0x3962c5[_0x0287('0x1c')]=qs[_0x0287('0x1c')](_0x54f9e9[_0x0287('0x34')][_0x0287('0x1c')]);}_0x3962c5['order']=qs['sort'](_0x54f9e9[_0x0287('0x34')][_0x0287('0x3e')]);_0x3962c5['where']=qs[_0x0287('0x35')](_[_0x0287('0x40')](_0x54f9e9['query'],_0x4bbcc3[_0x0287('0x35')]));_0x3962c5[_0x0287('0x3f')][_0x0287('0x5b')]=_0x29ac86['id'];if(_0x54f9e9['query'][_0x0287('0x41')]){_0x3962c5['where']=_[_0x0287('0x42')](_0x3962c5[_0x0287('0x3f')],{'$or':_['map'](_0x3962c5[_0x0287('0x39')],function(_0x12b170){var _0x81be00={};_0x81be00[_0x12b170]={'$like':'%'+_0x54f9e9['query'][_0x0287('0x41')]+'%'};return _0x81be00;})});}_0x3962c5=_['merge']({},_0x3962c5,_0x54f9e9[_0x0287('0x45')]);return db[_0x0287('0x65')]['count']({'where':_0x3962c5[_0x0287('0x3f')]})['then'](function(_0x2e09d0){_0x53c8e6[_0x0287('0x1b')]=_0x2e09d0;if(_0x54f9e9['query']['includeAll']){_0x3962c5[_0x0287('0x47')]=[{'all':!![]}];}return db[_0x0287('0x65')][_0x0287('0x5c')](_0x3962c5);})[_0x0287('0x23')](function(_0x1932af){_0x53c8e6[_0x0287('0x48')]=_0x1932af;return _0x53c8e6;});}})[_0x0287('0x23')](respondWithFilteredResult(_0x443836,_0x3962c5))[_0x0287('0x49')](handleError(_0x443836,null));};exports[_0x0287('0x88')]=function(_0x11cc57,_0x2f5415,_0x164cca){var _0x34c3ab,_0x212440;return db['Campaign']['find']({'where':{'id':_0x11cc57['params']['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x2f5415,null))[_0x0287('0x23')](function(_0x3bd76e){if(_0x3bd76e){_0x212440=_0x3bd76e;return _0x3bd76e[_0x0287('0x88')](_0x11cc57['body']['ids'],_['omit'](_0x11cc57[_0x0287('0x56')],['ids','id'])||{});}return null;})['spread'](function(_0x1a5b08){var _0x5c5f9b;_0x34c3ab=_0x1a5b08||[];var _0x3a1dca=[];if(_0x1a5b08){for(var _0x13e3c1=0x0;_0x13e3c1<_0x1a5b08[_0x0287('0x3a')];_0x13e3c1+=0x1){var _0x1c5678=_0x1a5b08[_0x13e3c1][_0x0287('0x24')]({'plain':!![]});_0x5c5f9b=squel[_0x0287('0x6b')]()[_0x0287('0x6c')](_0x0287('0x89'))[_0x0287('0x6e')]([_0x0287('0x6f'),_0x0287('0x71'),_0x0287('0x72'),_0x0287('0x5b'),_0x0287('0x54'),_0x0287('0x77')],squel[_0x0287('0x81')]()[_0x0287('0x73')](_0x0287('0x6f'),_0x0287('0x6f'))[_0x0287('0x73')]('id',_0x0287('0x71'))['field'](_0x1c5678['CmListId']['toString'](),_0x0287('0x72'))[_0x0287('0x73')](_0x11cc57['params']['id']['toString'](),_0x0287('0x5b'))[_0x0287('0x73')](_0x0287('0x74'),'createdAt')[_0x0287('0x73')]('NOW()',_0x0287('0x77'))[_0x0287('0x78')](_0x0287('0x79'))[_0x0287('0x3f')]('deletedAt\x20IS\x20NULL')[_0x0287('0x3f')](_0x0287('0x7b'),_0x1c5678[_0x0287('0x75')]['toString']())[_0x0287('0x3f')](_0x0287('0x7c')))['toString']();_0x3a1dca[_0x0287('0x8a')](db[_0x0287('0x84')]['query'](_0x5c5f9b));}return BPromise['all'](_0x3a1dca);}})[_0x0287('0x23')](function(){return _0x34c3ab;})[_0x0287('0x23')](respondWithResult(_0x2f5415,null))['catch'](handleError(_0x2f5415,null));};exports['removeBlackLists']=function(_0x1827b8,_0x32fc57,_0x2936f5){return db[_0x0287('0x2f')][_0x0287('0x4c')]({'where':{'id':_0x1827b8[_0x0287('0x4b')]['id']}})[_0x0287('0x23')](handleEntityNotFound(_0x32fc57,null))['then'](function(_0xd182ca){if(_0xd182ca){return _0xd182ca[_0x0287('0x8b')](_0x1827b8[_0x0287('0x34')][_0x0287('0x67')]);}})[_0x0287('0x23')](function(_0x1100ee){if(_0x1100ee){return db[_0x0287('0x63')][_0x0287('0x22')]({'where':{'ListId':_0x1827b8['query'][_0x0287('0x67')],'CampaignId':_0x1827b8[_0x0287('0x4b')]['id']}})[_0x0287('0x23')](function(){return _0x1100ee;});}})[_0x0287('0x23')](respondWithStatusCode(_0x32fc57,null))[_0x0287('0x49')](handleError(_0x32fc57,null));}; \ No newline at end of file +var _0x1b2f=['path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','length','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','nolimit','CampaignId','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','insert','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','mustache','util'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x1b2f,0x82));var _0xf1b2=function(_0x3fe375,_0x11e210){_0x3fe375=_0x3fe375-0x0;var _0x247c41=_0x1b2f[_0x3fe375];return _0x247c41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1b2('0x0'));var rimraf=require(_0xf1b2('0x1'));var zipdir=require(_0xf1b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf1b2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf1b2('0x4'));var util=require(_0xf1b2('0x5'));var path=require(_0xf1b2('0x6'));var sox=require(_0xf1b2('0x7'));var csv=require('to-csv');var ejs=require(_0xf1b2('0x8'));var fs=require('fs');var _=require(_0xf1b2('0x9'));var squel=require(_0xf1b2('0xa'));var crypto=require('crypto');var jsforce=require(_0xf1b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf1b2('0xc'));var querystring=require(_0xf1b2('0xd'));var Papa=require(_0xf1b2('0xe'));var Redis=require('ioredis');var authService=require(_0xf1b2('0xf'));var qs=require(_0xf1b2('0x10'));var as=require(_0xf1b2('0x11'));var hardwareService=require(_0xf1b2('0x12'));var logger=require(_0xf1b2('0x13'))(_0xf1b2('0x14'));var utils=require('../../config/utils');var config=require(_0xf1b2('0x15'));var db=require(_0xf1b2('0x16'))['db'];function respondWithStatusCode(_0x43dd7a,_0x1cac85){_0x1cac85=_0x1cac85||0xcc;return function(_0x46b539){if(_0x46b539){return _0x43dd7a[_0xf1b2('0x17')](_0x1cac85);}return _0x43dd7a[_0xf1b2('0x18')](_0x1cac85)['end']();};}function respondWithResult(_0x16de25,_0x11d051){_0x11d051=_0x11d051||0xc8;return function(_0x525556){if(_0x525556){return _0x16de25[_0xf1b2('0x18')](_0x11d051)[_0xf1b2('0x19')](_0x525556);}};}function respondWithFilteredResult(_0x2562ff,_0x51a7f2){return function(_0x72f1ea){if(_0x72f1ea){var _0x2cb4e9=_0x72f1ea[_0xf1b2('0x1a')],_0x248548=_0x51a7f2[_0xf1b2('0x1b')],_0x40bc5e=_0x51a7f2['offset']+_0x51a7f2[_0xf1b2('0x1c')],_0x46edf9;if(_0x40bc5e>=_0x2cb4e9){_0x40bc5e=_0x2cb4e9;_0x46edf9=0xc8;}else{_0x46edf9=0xce;}_0x2562ff[_0xf1b2('0x18')](_0x46edf9);return _0x2562ff[_0xf1b2('0x1d')](_0xf1b2('0x1e'),_0x248548+'-'+_0x40bc5e+'/'+_0x2cb4e9)['json'](_0x72f1ea);}return null;};}function patchUpdates(_0x30851f){return function(_0x3a7e4d){try{jsonpatch[_0xf1b2('0x1f')](_0x3a7e4d,_0x30851f,!![]);}catch(_0x196a08){return BPromise[_0xf1b2('0x20')](_0x196a08);}return _0x3a7e4d[_0xf1b2('0x21')]();};}function saveUpdates(_0x75eb88,_0x2a506f){return function(_0x4fc22b){if(_0x4fc22b){return _0x4fc22b[_0xf1b2('0x22')](_0x75eb88)[_0xf1b2('0x23')](function(_0x25d102){return _0x25d102;});}return null;};}function removeEntity(_0x2bb720,_0x4cbd2b){return function(_0x550d95){if(_0x550d95){return _0x550d95[_0xf1b2('0x24')]()[_0xf1b2('0x23')](function(){var _0x47fa46=_0x550d95['get']({'plain':!![]});var _0x473c27=_0xf1b2('0x25');return db[_0xf1b2('0x26')][_0xf1b2('0x24')]({'where':{'type':_0x473c27,'resourceId':_0x47fa46['id']}})['then'](function(){return _0x550d95;});})[_0xf1b2('0x23')](function(){_0x2bb720[_0xf1b2('0x18')](0xcc)[_0xf1b2('0x27')]();});}};}function handleEntityNotFound(_0x2ad42c,_0x298675){return function(_0x1510d6){if(!_0x1510d6){_0x2ad42c[_0xf1b2('0x17')](0x194);}return _0x1510d6;};}function handleError(_0x413972,_0x579d41){_0x579d41=_0x579d41||0x1f4;return function(_0x4f875f){logger[_0xf1b2('0x28')](_0x4f875f[_0xf1b2('0x29')]);if(_0x4f875f['name']){delete _0x4f875f[_0xf1b2('0x2a')];}_0x413972['status'](_0x579d41)[_0xf1b2('0x2b')](_0x4f875f);};}exports[_0xf1b2('0x2c')]=function(_0x3b3e7d,_0x19bd46){var _0x275ef1={},_0xaa254c={},_0x1dd63a={'count':0x0,'rows':[]};var _0x39fcf5=_[_0xf1b2('0x2d')](db[_0xf1b2('0x2e')][_0xf1b2('0x2f')],function(_0x582451){return{'name':_0x582451[_0xf1b2('0x30')],'type':_0x582451[_0xf1b2('0x31')][_0xf1b2('0x32')]};});_0xaa254c[_0xf1b2('0x33')]=_[_0xf1b2('0x2d')](_0x39fcf5,_0xf1b2('0x2a'));_0xaa254c['query']=_[_0xf1b2('0x34')](_0x3b3e7d[_0xf1b2('0x35')]);_0xaa254c[_0xf1b2('0x36')]=_[_0xf1b2('0x37')](_0xaa254c[_0xf1b2('0x33')],_0xaa254c[_0xf1b2('0x35')]);_0x275ef1[_0xf1b2('0x38')]=_[_0xf1b2('0x37')](_0xaa254c[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x3b3e7d[_0xf1b2('0x35')][_0xf1b2('0x39')]));_0x275ef1[_0xf1b2('0x38')]=_0x275ef1[_0xf1b2('0x38')]['length']?_0x275ef1[_0xf1b2('0x38')]:_0xaa254c[_0xf1b2('0x33')];if(!_0x3b3e7d['query'][_0xf1b2('0x3a')]('nolimit')){_0x275ef1[_0xf1b2('0x1c')]=qs['limit'](_0x3b3e7d[_0xf1b2('0x35')][_0xf1b2('0x1c')]);_0x275ef1[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x3b3e7d['query']['offset']);}_0x275ef1[_0xf1b2('0x3b')]=qs[_0xf1b2('0x3c')](_0x3b3e7d['query'][_0xf1b2('0x3c')]);_0x275ef1[_0xf1b2('0x3d')]=qs[_0xf1b2('0x36')](_[_0xf1b2('0x3e')](_0x3b3e7d[_0xf1b2('0x35')],_0xaa254c[_0xf1b2('0x36')]));if(_0x3b3e7d[_0xf1b2('0x35')][_0xf1b2('0x3f')]){_0x275ef1[_0xf1b2('0x3d')]=_[_0xf1b2('0x40')](_0x275ef1[_0xf1b2('0x3d')],{'$or':_[_0xf1b2('0x2d')](_0x39fcf5,function(_0x130517){if(_0x130517[_0xf1b2('0x31')]!==_0xf1b2('0x41')){var _0x325bb3={};_0x325bb3[_0x130517[_0xf1b2('0x2a')]]={'$like':'%'+_0x3b3e7d['query'][_0xf1b2('0x3f')]+'%'};return _0x325bb3;}})});}_0x275ef1=_['merge']({},_0x275ef1,_0x3b3e7d[_0xf1b2('0x42')]);var _0x27b604={'where':_0x275ef1['where']};return db[_0xf1b2('0x2e')]['count'](_0x27b604)['then'](function(_0x129733){_0x1dd63a['count']=_0x129733;if(_0x3b3e7d[_0xf1b2('0x35')][_0xf1b2('0x43')]){_0x275ef1[_0xf1b2('0x44')]=[{'all':!![]}];}return db[_0xf1b2('0x2e')][_0xf1b2('0x45')](_0x275ef1);})['then'](function(_0x27eaf6){_0x1dd63a[_0xf1b2('0x46')]=_0x27eaf6;return _0x1dd63a;})['then'](respondWithFilteredResult(_0x19bd46,_0x275ef1))[_0xf1b2('0x47')](handleError(_0x19bd46,null));};exports['show']=function(_0x386d8e,_0x12292b){var _0x39456c={'raw':![],'where':{'id':_0x386d8e[_0xf1b2('0x48')]['id']}},_0x202202={};_0x202202[_0xf1b2('0x33')]=_['keys'](db[_0xf1b2('0x2e')]['rawAttributes']);_0x202202[_0xf1b2('0x35')]=_[_0xf1b2('0x34')](_0x386d8e[_0xf1b2('0x35')]);_0x202202[_0xf1b2('0x36')]=_[_0xf1b2('0x37')](_0x202202[_0xf1b2('0x33')],_0x202202[_0xf1b2('0x35')]);_0x39456c[_0xf1b2('0x38')]=_[_0xf1b2('0x37')](_0x202202[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x386d8e[_0xf1b2('0x35')]['fields']));_0x39456c[_0xf1b2('0x38')]=_0x39456c[_0xf1b2('0x38')]['length']?_0x39456c[_0xf1b2('0x38')]:_0x202202[_0xf1b2('0x33')];if(_0x386d8e[_0xf1b2('0x35')][_0xf1b2('0x43')]){_0x39456c['include']=[{'all':!![]}];}_0x39456c=_['merge']({},_0x39456c,_0x386d8e['options']);return db['Campaign'][_0xf1b2('0x49')](_0x39456c)[_0xf1b2('0x23')](handleEntityNotFound(_0x12292b,null))[_0xf1b2('0x23')](respondWithResult(_0x12292b,null))['catch'](handleError(_0x12292b,null));};exports['create']=function(_0x2be300,_0x5a2d3b){return db[_0xf1b2('0x2e')]['create'](_0x2be300[_0xf1b2('0x4a')],{})[_0xf1b2('0x23')](function(_0x17b137){var _0x3e948f=_0x2be300[_0xf1b2('0x4b')][_0xf1b2('0x4c')]({'plain':!![]});if(!_0x3e948f)throw new Error(_0xf1b2('0x4d'));if(_0x3e948f[_0xf1b2('0x4e')]===_0xf1b2('0x4b')){var _0x3b6696=_0x17b137['get']({'plain':!![]});var _0x26ba1b=_0xf1b2('0x25');return db[_0xf1b2('0x4f')][_0xf1b2('0x49')]({'where':{'name':_0x26ba1b,'userProfileId':_0x3e948f[_0xf1b2('0x50')]},'raw':!![]})['then'](function(_0x36743c){if(_0x36743c&&_0x36743c[_0xf1b2('0x51')]===0x0){return db[_0xf1b2('0x26')][_0xf1b2('0x52')]({'name':_0x3b6696[_0xf1b2('0x2a')],'resourceId':_0x3b6696['id'],'type':_0x36743c['name'],'sectionId':_0x36743c['id']},{})['then'](function(){return _0x17b137;});}else{return _0x17b137;}})[_0xf1b2('0x47')](function(_0x4fad45){logger[_0xf1b2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fad45);throw _0x4fad45;});}return _0x17b137;})[_0xf1b2('0x23')](respondWithResult(_0x5a2d3b,0xc9))[_0xf1b2('0x47')](handleError(_0x5a2d3b,null));};exports['clone']=function(_0x4c886e,_0xf52195){var _0x114b13={'where':{'id':_0x4c886e[_0xf1b2('0x48')]['id']}},_0x276859={};_0x276859[_0xf1b2('0x33')]=_['keys'](db['Campaign'][_0xf1b2('0x2f')]);_0x114b13[_0xf1b2('0x38')]=_[_0xf1b2('0x37')](_0x276859[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x4c886e['query'][_0xf1b2('0x39')]));_0x114b13['attributes']=_0x114b13[_0xf1b2('0x38')][_0xf1b2('0x53')]?_0x114b13[_0xf1b2('0x38')]:_0x276859['model'];if(_0x4c886e['query'][_0xf1b2('0x43')]){_0x114b13['include']=[{'all':!![]}];}_0x114b13=_['merge']({},_0x114b13,_0x4c886e[_0xf1b2('0x42')]);return db['Campaign'][_0xf1b2('0x49')](_0x114b13)[_0xf1b2('0x23')](handleEntityNotFound(_0xf52195,null))[_0xf1b2('0x23')](function(_0x2e7bf6){if(_0x2e7bf6){var _0x49a620=_0x2e7bf6[_0xf1b2('0x4c')]({'plain':!![]});_0x49a620=qs[_0xf1b2('0x54')](_0x49a620,['id',_0xf1b2('0x55'),'updatedAt']);_0x4c886e['body']=_['omit'](_0x4c886e[_0xf1b2('0x4a')],['id',_0xf1b2('0x55'),_0xf1b2('0x56')]);return db[_0xf1b2('0x2e')][_0xf1b2('0x52')](_[_0xf1b2('0x40')](_0x49a620,_0x4c886e[_0xf1b2('0x4a')]),{'include':_0x4c886e[_0xf1b2('0x35')][_0xf1b2('0x43')]?[{'all':!![]}]:undefined})[_0xf1b2('0x23')](function(_0x4a3d7a){var _0x464499=_0x4c886e[_0xf1b2('0x4b')]['get']({'plain':!![]});if(!_0x464499)throw new Error(_0xf1b2('0x4d'));if(_0x464499[_0xf1b2('0x4e')]===_0xf1b2('0x4b')){var _0x562115=_0x4a3d7a[_0xf1b2('0x4c')]({'plain':!![]});var _0x4f1d36=_0xf1b2('0x25');return db[_0xf1b2('0x4f')][_0xf1b2('0x49')]({'where':{'name':_0x4f1d36,'userProfileId':_0x464499[_0xf1b2('0x50')]},'raw':!![]})[_0xf1b2('0x23')](function(_0x35f949){if(_0x35f949&&_0x35f949[_0xf1b2('0x51')]===0x0){return db[_0xf1b2('0x26')]['create']({'name':_0x562115[_0xf1b2('0x2a')],'resourceId':_0x562115['id'],'type':_0x35f949[_0xf1b2('0x2a')],'sectionId':_0x35f949['id']},{})['then'](function(){return _0x4a3d7a;});}else{return _0x4a3d7a;}})[_0xf1b2('0x47')](function(_0x418c04){logger[_0xf1b2('0x28')](_0xf1b2('0x57'),_0x418c04);throw _0x418c04;});}return _0x4a3d7a;});}})[_0xf1b2('0x23')](respondWithResult(_0xf52195,0xc9))[_0xf1b2('0x47')](handleError(_0xf52195,null));};exports['update']=function(_0x1ee7e3,_0x3b29c1){if(_0x1ee7e3[_0xf1b2('0x4a')]['id']){delete _0x1ee7e3[_0xf1b2('0x4a')]['id'];}return db[_0xf1b2('0x2e')][_0xf1b2('0x49')]({'where':{'id':_0x1ee7e3[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x3b29c1,null))[_0xf1b2('0x23')](saveUpdates(_0x1ee7e3['body'],null))['then'](respondWithResult(_0x3b29c1,null))[_0xf1b2('0x47')](handleError(_0x3b29c1,null));};exports[_0xf1b2('0x24')]=function(_0x294cb6,_0x4f9d0c){return db['Campaign']['find']({'where':{'id':_0x294cb6[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x4f9d0c,null))[_0xf1b2('0x23')](removeEntity(_0x4f9d0c,null))['catch'](handleError(_0x4f9d0c,null));};exports[_0xf1b2('0x58')]=function(_0x4eb1aa,_0x37ca2f,_0x1e902e){var _0x1a60c5={'raw':!![],'where':{}};var _0x30ed9e={};var _0x3fbdbf={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4eb1aa['params']['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x37ca2f,null))['then'](function(_0x55a852){if(_0x55a852){_0x30ed9e[_0xf1b2('0x33')]=_[_0xf1b2('0x34')](db[_0xf1b2('0x59')][_0xf1b2('0x2f')]);_0x30ed9e['query']=_[_0xf1b2('0x34')](_0x4eb1aa['query']);_0x30ed9e[_0xf1b2('0x36')]=_['intersection'](_0x30ed9e[_0xf1b2('0x33')],_0x30ed9e[_0xf1b2('0x35')]);_0x1a60c5['attributes']=_['intersection'](_0x30ed9e[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x4eb1aa['query'][_0xf1b2('0x39')]));_0x1a60c5[_0xf1b2('0x38')]=_0x1a60c5[_0xf1b2('0x38')][_0xf1b2('0x53')]?_0x1a60c5[_0xf1b2('0x38')]:_0x30ed9e['model'];if(!_0x4eb1aa[_0xf1b2('0x35')][_0xf1b2('0x3a')](_0xf1b2('0x5a'))){_0x1a60c5['limit']=qs[_0xf1b2('0x1c')](_0x4eb1aa[_0xf1b2('0x35')]['limit']);_0x1a60c5['offset']=qs['offset'](_0x4eb1aa[_0xf1b2('0x35')]['offset']);}_0x1a60c5[_0xf1b2('0x3b')]=qs[_0xf1b2('0x3c')](_0x4eb1aa[_0xf1b2('0x35')]['sort']);_0x1a60c5[_0xf1b2('0x3d')]=qs[_0xf1b2('0x36')](_[_0xf1b2('0x3e')](_0x4eb1aa[_0xf1b2('0x35')],_0x30ed9e[_0xf1b2('0x36')]));_0x1a60c5[_0xf1b2('0x3d')]['CampaignId']=_0x55a852['id'];if(_0x4eb1aa[_0xf1b2('0x35')][_0xf1b2('0x3f')]){_0x1a60c5[_0xf1b2('0x3d')]=_[_0xf1b2('0x40')](_0x1a60c5[_0xf1b2('0x3d')],{'$or':_['map'](_0x1a60c5[_0xf1b2('0x38')],function(_0x3b5621){var _0x22027d={};_0x22027d[_0x3b5621]={'$like':'%'+_0x4eb1aa[_0xf1b2('0x35')][_0xf1b2('0x3f')]+'%'};return _0x22027d;})});}_0x1a60c5=_[_0xf1b2('0x40')]({},_0x1a60c5,_0x4eb1aa[_0xf1b2('0x42')]);return db['CmHopper'][_0xf1b2('0x1a')]({'where':_0x1a60c5['where']})[_0xf1b2('0x23')](function(_0x1566f4){_0x3fbdbf[_0xf1b2('0x1a')]=_0x1566f4;if(_0x4eb1aa['query'][_0xf1b2('0x43')]){_0x1a60c5['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1a60c5);})[_0xf1b2('0x23')](function(_0x316d84){_0x3fbdbf['rows']=_0x316d84;return _0x3fbdbf;});}})['then'](respondWithFilteredResult(_0x37ca2f,_0x1a60c5))[_0xf1b2('0x47')](handleError(_0x37ca2f,null));};exports['getHopperHistories']=function(_0x32ef29,_0x48aba4,_0x19a541){var _0x4b6a09={'raw':!![],'where':{}};var _0x215e10={};var _0x50942d={'count':0x0,'rows':[]};return db[_0xf1b2('0x2e')]['findOne']({'where':{'id':_0x32ef29[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x48aba4,null))[_0xf1b2('0x23')](function(_0x3f5cc4){if(_0x3f5cc4){_0x215e10[_0xf1b2('0x33')]=_[_0xf1b2('0x34')](db['CmHopperHistory'][_0xf1b2('0x2f')]);_0x215e10['query']=_[_0xf1b2('0x34')](_0x32ef29[_0xf1b2('0x35')]);_0x215e10[_0xf1b2('0x36')]=_[_0xf1b2('0x37')](_0x215e10[_0xf1b2('0x33')],_0x215e10['query']);_0x4b6a09[_0xf1b2('0x38')]=_['intersection'](_0x215e10[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x32ef29['query']['fields']));_0x4b6a09[_0xf1b2('0x38')]=_0x4b6a09[_0xf1b2('0x38')][_0xf1b2('0x53')]?_0x4b6a09[_0xf1b2('0x38')]:_0x215e10[_0xf1b2('0x33')];if(!_0x32ef29[_0xf1b2('0x35')]['hasOwnProperty'](_0xf1b2('0x5a'))){_0x4b6a09['limit']=qs[_0xf1b2('0x1c')](_0x32ef29[_0xf1b2('0x35')][_0xf1b2('0x1c')]);_0x4b6a09[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x32ef29[_0xf1b2('0x35')]['offset']);}_0x4b6a09[_0xf1b2('0x3b')]=qs[_0xf1b2('0x3c')](_0x32ef29['query'][_0xf1b2('0x3c')]);_0x4b6a09[_0xf1b2('0x3d')]=qs[_0xf1b2('0x36')](_[_0xf1b2('0x3e')](_0x32ef29[_0xf1b2('0x35')],_0x215e10[_0xf1b2('0x36')]));_0x4b6a09['where'][_0xf1b2('0x5b')]=_0x3f5cc4['id'];if(_0x32ef29[_0xf1b2('0x35')][_0xf1b2('0x3f')]){_0x4b6a09[_0xf1b2('0x3d')]=_['merge'](_0x4b6a09[_0xf1b2('0x3d')],{'$or':_[_0xf1b2('0x2d')](_0x4b6a09[_0xf1b2('0x38')],function(_0x3324f3){var _0x191c82={};_0x191c82[_0x3324f3]={'$like':'%'+_0x32ef29[_0xf1b2('0x35')][_0xf1b2('0x3f')]+'%'};return _0x191c82;})});}_0x4b6a09=_[_0xf1b2('0x40')]({},_0x4b6a09,_0x32ef29[_0xf1b2('0x42')]);return db[_0xf1b2('0x5c')][_0xf1b2('0x1a')]({'where':_0x4b6a09[_0xf1b2('0x3d')]})[_0xf1b2('0x23')](function(_0x55c68a){_0x50942d['count']=_0x55c68a;if(_0x32ef29[_0xf1b2('0x35')]['includeAll']){_0x4b6a09[_0xf1b2('0x44')]=[{'all':!![]}];}return db[_0xf1b2('0x5c')][_0xf1b2('0x45')](_0x4b6a09);})[_0xf1b2('0x23')](function(_0xeb7925){_0x50942d[_0xf1b2('0x46')]=_0xeb7925;return _0x50942d;});}})[_0xf1b2('0x23')](respondWithFilteredResult(_0x48aba4,_0x4b6a09))[_0xf1b2('0x47')](handleError(_0x48aba4,null));};exports[_0xf1b2('0x5d')]=function(_0x255a2f,_0x50a551,_0x4f127b){var _0x1279b8={'raw':!![],'where':{}};var _0xea030f={};var _0x90681b={'count':0x0,'rows':[]};return db[_0xf1b2('0x2e')][_0xf1b2('0x5e')]({'where':{'id':_0x255a2f['params']['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x50a551,null))[_0xf1b2('0x23')](function(_0x4a2385){if(_0x4a2385){_0xea030f[_0xf1b2('0x33')]=_[_0xf1b2('0x34')](db['CmHopperFinal'][_0xf1b2('0x2f')]);_0xea030f['query']=_[_0xf1b2('0x34')](_0x255a2f[_0xf1b2('0x35')]);_0xea030f[_0xf1b2('0x36')]=_[_0xf1b2('0x37')](_0xea030f[_0xf1b2('0x33')],_0xea030f[_0xf1b2('0x35')]);_0x1279b8['attributes']=_[_0xf1b2('0x37')](_0xea030f['model'],qs[_0xf1b2('0x39')](_0x255a2f[_0xf1b2('0x35')][_0xf1b2('0x39')]));_0x1279b8['attributes']=_0x1279b8[_0xf1b2('0x38')]['length']?_0x1279b8[_0xf1b2('0x38')]:_0xea030f[_0xf1b2('0x33')];if(!_0x255a2f[_0xf1b2('0x35')]['hasOwnProperty'](_0xf1b2('0x5a'))){_0x1279b8[_0xf1b2('0x1c')]=qs[_0xf1b2('0x1c')](_0x255a2f[_0xf1b2('0x35')]['limit']);_0x1279b8[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x255a2f['query'][_0xf1b2('0x1b')]);}_0x1279b8[_0xf1b2('0x3b')]=qs[_0xf1b2('0x3c')](_0x255a2f[_0xf1b2('0x35')][_0xf1b2('0x3c')]);_0x1279b8['where']=qs['filters'](_[_0xf1b2('0x3e')](_0x255a2f[_0xf1b2('0x35')],_0xea030f['filters']));_0x1279b8[_0xf1b2('0x3d')]['CampaignId']=_0x4a2385['id'];if(_0x255a2f['query']['filter']){_0x1279b8[_0xf1b2('0x3d')]=_[_0xf1b2('0x40')](_0x1279b8[_0xf1b2('0x3d')],{'$or':_[_0xf1b2('0x2d')](_0x1279b8['attributes'],function(_0x52b3a9){var _0x46bc8b={};_0x46bc8b[_0x52b3a9]={'$like':'%'+_0x255a2f[_0xf1b2('0x35')][_0xf1b2('0x3f')]+'%'};return _0x46bc8b;})});}_0x1279b8=_['merge']({},_0x1279b8,_0x255a2f[_0xf1b2('0x42')]);return db[_0xf1b2('0x5f')][_0xf1b2('0x1a')]({'where':_0x1279b8[_0xf1b2('0x3d')]})[_0xf1b2('0x23')](function(_0x38e300){_0x90681b['count']=_0x38e300;if(_0x255a2f[_0xf1b2('0x35')][_0xf1b2('0x43')]){_0x1279b8[_0xf1b2('0x44')]=[{'all':!![]}];}return db[_0xf1b2('0x5f')]['findAll'](_0x1279b8);})['then'](function(_0x42f975){_0x90681b[_0xf1b2('0x46')]=_0x42f975;return _0x90681b;});}})[_0xf1b2('0x23')](respondWithFilteredResult(_0x50a551,_0x1279b8))[_0xf1b2('0x47')](handleError(_0x50a551,null));};exports[_0xf1b2('0x60')]=function(_0x49f1ee,_0x3e6d97,_0x18bf15){var _0x3f6a7a={'raw':!![],'where':{}};var _0x3fa73a={};var _0x564abd={'count':0x0,'rows':[]};return db['Campaign'][_0xf1b2('0x5e')]({'where':{'id':_0x49f1ee[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x3e6d97,null))[_0xf1b2('0x23')](function(_0x6be9e3){if(_0x6be9e3){_0x3fa73a[_0xf1b2('0x33')]=_['keys'](db[_0xf1b2('0x61')][_0xf1b2('0x2f')]);_0x3fa73a[_0xf1b2('0x35')]=_[_0xf1b2('0x34')](_0x49f1ee[_0xf1b2('0x35')]);_0x3fa73a[_0xf1b2('0x36')]=_[_0xf1b2('0x37')](_0x3fa73a[_0xf1b2('0x33')],_0x3fa73a[_0xf1b2('0x35')]);_0x3f6a7a['attributes']=_['intersection'](_0x3fa73a[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x49f1ee['query'][_0xf1b2('0x39')]));_0x3f6a7a[_0xf1b2('0x38')]=_0x3f6a7a[_0xf1b2('0x38')][_0xf1b2('0x53')]?_0x3f6a7a[_0xf1b2('0x38')]:_0x3fa73a[_0xf1b2('0x33')];if(!_0x49f1ee[_0xf1b2('0x35')][_0xf1b2('0x3a')](_0xf1b2('0x5a'))){_0x3f6a7a['limit']=qs['limit'](_0x49f1ee['query']['limit']);_0x3f6a7a['offset']=qs[_0xf1b2('0x1b')](_0x49f1ee[_0xf1b2('0x35')][_0xf1b2('0x1b')]);}_0x3f6a7a[_0xf1b2('0x3b')]=qs[_0xf1b2('0x3c')](_0x49f1ee[_0xf1b2('0x35')][_0xf1b2('0x3c')]);_0x3f6a7a[_0xf1b2('0x3d')]=qs[_0xf1b2('0x36')](_[_0xf1b2('0x3e')](_0x49f1ee['query'],_0x3fa73a[_0xf1b2('0x36')]));_0x3f6a7a[_0xf1b2('0x3d')][_0xf1b2('0x5b')]=_0x6be9e3['id'];if(_0x49f1ee[_0xf1b2('0x35')][_0xf1b2('0x3f')]){_0x3f6a7a[_0xf1b2('0x3d')]=_[_0xf1b2('0x40')](_0x3f6a7a[_0xf1b2('0x3d')],{'$or':_[_0xf1b2('0x2d')](_0x3f6a7a['attributes'],function(_0x29fa77){var _0x253698={};_0x253698[_0x29fa77]={'$like':'%'+_0x49f1ee[_0xf1b2('0x35')][_0xf1b2('0x3f')]+'%'};return _0x253698;})});}_0x3f6a7a=_[_0xf1b2('0x40')]({},_0x3f6a7a,_0x49f1ee[_0xf1b2('0x42')]);return db[_0xf1b2('0x61')]['count']({'where':_0x3f6a7a[_0xf1b2('0x3d')]})[_0xf1b2('0x23')](function(_0x1464f3){_0x564abd[_0xf1b2('0x1a')]=_0x1464f3;if(_0x49f1ee['query'][_0xf1b2('0x43')]){_0x3f6a7a[_0xf1b2('0x44')]=[{'all':!![]}];}return db[_0xf1b2('0x61')][_0xf1b2('0x45')](_0x3f6a7a);})[_0xf1b2('0x23')](function(_0x47f09b){_0x564abd[_0xf1b2('0x46')]=_0x47f09b;return _0x564abd;});}})[_0xf1b2('0x23')](respondWithFilteredResult(_0x3e6d97,_0x3f6a7a))[_0xf1b2('0x47')](handleError(_0x3e6d97,null));};exports[_0xf1b2('0x62')]=function(_0x7ab4ad,_0x642c93,_0x5f1941){var _0x1629ba={};var _0x302fee={};var _0x47401b;var _0x33c0c3;return db[_0xf1b2('0x2e')][_0xf1b2('0x5e')]({'where':{'id':_0x7ab4ad['params']['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x642c93,null))['then'](function(_0x28acb1){if(_0x28acb1){_0x47401b=_0x28acb1;_0x302fee[_0xf1b2('0x33')]=_[_0xf1b2('0x34')](db[_0xf1b2('0x63')]['rawAttributes']);_0x302fee[_0xf1b2('0x35')]=_['keys'](_0x7ab4ad[_0xf1b2('0x35')]);_0x302fee[_0xf1b2('0x36')]=_['intersection'](_0x302fee[_0xf1b2('0x33')],_0x302fee['query']);_0x1629ba['attributes']=_[_0xf1b2('0x37')](_0x302fee[_0xf1b2('0x33')],qs['fields'](_0x7ab4ad[_0xf1b2('0x35')][_0xf1b2('0x39')]));_0x1629ba[_0xf1b2('0x38')]=_0x1629ba['attributes']['length']?_0x1629ba[_0xf1b2('0x38')]:_0x302fee[_0xf1b2('0x33')];_0x1629ba['order']=qs['sort'](_0x7ab4ad['query']['sort']);_0x1629ba[_0xf1b2('0x3d')]=qs[_0xf1b2('0x36')](_[_0xf1b2('0x3e')](_0x7ab4ad[_0xf1b2('0x35')],_0x302fee[_0xf1b2('0x36')]));if(_0x7ab4ad[_0xf1b2('0x35')]['filter']){_0x1629ba[_0xf1b2('0x3d')]=_['merge'](_0x1629ba[_0xf1b2('0x3d')],{'$or':_[_0xf1b2('0x2d')](_0x1629ba[_0xf1b2('0x38')],function(_0x1244e7){var _0x175eb7={};_0x175eb7[_0x1244e7]={'$like':'%'+_0x7ab4ad['query'][_0xf1b2('0x3f')]+'%'};return _0x175eb7;})});}_0x1629ba=_['merge']({},_0x1629ba,_0x7ab4ad[_0xf1b2('0x42')]);return _0x47401b['getLists'](_0x1629ba);}})[_0xf1b2('0x23')](function(_0x672bca){if(_0x672bca){_0x33c0c3=_0x672bca[_0xf1b2('0x53')];if(!_0x7ab4ad[_0xf1b2('0x35')][_0xf1b2('0x3a')](_0xf1b2('0x5a'))){_0x1629ba['limit']=qs[_0xf1b2('0x1c')](_0x7ab4ad[_0xf1b2('0x35')]['limit']);_0x1629ba[_0xf1b2('0x1b')]=qs['offset'](_0x7ab4ad['query'][_0xf1b2('0x1b')]);}return _0x47401b[_0xf1b2('0x62')](_0x1629ba);}})[_0xf1b2('0x23')](function(_0x38ba3f){if(_0x38ba3f){return _0x38ba3f?{'count':_0x33c0c3,'rows':_0x38ba3f}:null;}})[_0xf1b2('0x23')](respondWithResult(_0x642c93,null))[_0xf1b2('0x47')](handleError(_0x642c93,null));};exports['addLists']=function(_0x14edb5,_0x5a939a,_0xac7a50){var _0x331e5a,_0xd3faf9;return db['Campaign'][_0xf1b2('0x49')]({'where':{'id':_0x14edb5['params']['id']}})['then'](handleEntityNotFound(_0x5a939a,null))[_0xf1b2('0x23')](function(_0x5a0fcb){if(_0x5a0fcb){_0xd3faf9=_0x5a0fcb;return _0x5a0fcb[_0xf1b2('0x64')](_0x14edb5['body'][_0xf1b2('0x65')],_[_0xf1b2('0x54')](_0x14edb5[_0xf1b2('0x4a')],[_0xf1b2('0x65'),'id'])||{});}return null;})[_0xf1b2('0x66')](function(_0x4874fd){var _0x4ad4ea;_0x331e5a=_0x4874fd||[];var _0x3c71f7=[];if(_0x4874fd){for(var _0x291bce=0x0;_0x291bce<_0x4874fd[_0xf1b2('0x53')];_0x291bce+=0x1){var _0x4920ce=_0x4874fd[_0x291bce][_0xf1b2('0x4c')]({'plain':!![]});_0xd3faf9[_0xf1b2('0x67')]=_0x14edb5[_0xf1b2('0x4a')][_0xf1b2('0x67')]?_0x14edb5[_0xf1b2('0x4a')][_0xf1b2('0x67')]:_0xd3faf9[_0xf1b2('0x67')];switch(_0xd3faf9['dialCheckDuplicateType']){case _0xf1b2('0x68'):_0x4ad4ea=squel['insert']()[_0xf1b2('0x69')](_0xf1b2('0x6a'))[_0xf1b2('0x6b')]([_0xf1b2('0x6c'),_0xf1b2('0x6d'),_0xf1b2('0x6e'),_0xf1b2('0x6f'),'CampaignId',_0xf1b2('0x55'),_0xf1b2('0x56')],squel['select']()[_0xf1b2('0x70')](_0xf1b2('0x6c'),'phone')[_0xf1b2('0x70')](_0xf1b2('0x71'),_0xf1b2('0x6d'))[_0xf1b2('0x70')]('id',_0xf1b2('0x6e'))[_0xf1b2('0x70')](_0x4920ce['CmListId']['toString'](),_0xf1b2('0x6f'))[_0xf1b2('0x70')](_0x14edb5['params']['id'][_0xf1b2('0x72')](),_0xf1b2('0x5b'))[_0xf1b2('0x70')](_0xf1b2('0x71'),_0xf1b2('0x55'))[_0xf1b2('0x70')]('NOW()',_0xf1b2('0x56'))['from'](_0xf1b2('0x73'))[_0xf1b2('0x3d')](_0xf1b2('0x74'))[_0xf1b2('0x3d')](_0xf1b2('0x75'),_0x4920ce[_0xf1b2('0x76')][_0xf1b2('0x72')]())[_0xf1b2('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xf1b2('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf1b2('0x77')]()['field'](_0xf1b2('0x78'))[_0xf1b2('0x79')](_0xf1b2('0x7a'))[_0xf1b2('0x3d')](_0xf1b2('0x7b'),_0x14edb5[_0xf1b2('0x48')]['id'][_0xf1b2('0x72')]()))[_0xf1b2('0x3d')](_0xf1b2('0x7c'),squel[_0xf1b2('0x77')]()[_0xf1b2('0x70')](_0xf1b2('0x7d'))[_0xf1b2('0x79')](_0xf1b2('0x6a'))['where'](_0xf1b2('0x7b'),_0x14edb5[_0xf1b2('0x48')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x4ad4ea=squel['insert']()['into'](_0xf1b2('0x6a'))['fromQuery'](['phone',_0xf1b2('0x6d'),_0xf1b2('0x6e'),_0xf1b2('0x6f'),_0xf1b2('0x5b'),_0xf1b2('0x55'),_0xf1b2('0x56')],squel[_0xf1b2('0x77')]()[_0xf1b2('0x70')](_0xf1b2('0x6c'),_0xf1b2('0x6c'))[_0xf1b2('0x70')](_0xf1b2('0x71'),_0xf1b2('0x6d'))[_0xf1b2('0x70')]('id',_0xf1b2('0x6e'))[_0xf1b2('0x70')](_0x4920ce[_0xf1b2('0x76')][_0xf1b2('0x72')](),_0xf1b2('0x6f'))[_0xf1b2('0x70')](_0x14edb5[_0xf1b2('0x48')]['id'][_0xf1b2('0x72')](),_0xf1b2('0x5b'))[_0xf1b2('0x70')](_0xf1b2('0x71'),_0xf1b2('0x55'))[_0xf1b2('0x70')]('NOW()',_0xf1b2('0x56'))[_0xf1b2('0x79')](_0xf1b2('0x73'))['where'](_0xf1b2('0x74'))[_0xf1b2('0x3d')]('ListId\x20=\x20?',_0x4920ce[_0xf1b2('0x76')][_0xf1b2('0x72')]())[_0xf1b2('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xf1b2('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf1b2('0x77')]()[_0xf1b2('0x70')](_0xf1b2('0x7d'))[_0xf1b2('0x79')](_0xf1b2('0x6a'))[_0xf1b2('0x3d')](_0xf1b2('0x7b'),_0x14edb5[_0xf1b2('0x48')]['id']['toString']())))[_0xf1b2('0x72')]();break;default:_0x4ad4ea=squel[_0xf1b2('0x7e')]()['into']('cm_hopper')[_0xf1b2('0x6b')]([_0xf1b2('0x6c'),_0xf1b2('0x6d'),_0xf1b2('0x6e'),_0xf1b2('0x6f'),_0xf1b2('0x5b'),_0xf1b2('0x55'),_0xf1b2('0x56')],squel[_0xf1b2('0x77')]()[_0xf1b2('0x70')](_0xf1b2('0x6c'),_0xf1b2('0x6c'))['field'](_0xf1b2('0x71'),_0xf1b2('0x6d'))[_0xf1b2('0x70')]('id',_0xf1b2('0x6e'))[_0xf1b2('0x70')](_0x4920ce[_0xf1b2('0x76')][_0xf1b2('0x72')](),_0xf1b2('0x6f'))[_0xf1b2('0x70')](_0x14edb5[_0xf1b2('0x48')]['id'][_0xf1b2('0x72')](),'CampaignId')['field'](_0xf1b2('0x71'),_0xf1b2('0x55'))[_0xf1b2('0x70')](_0xf1b2('0x71'),_0xf1b2('0x56'))[_0xf1b2('0x79')](_0xf1b2('0x73'))[_0xf1b2('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4920ce[_0xf1b2('0x76')][_0xf1b2('0x72')]())[_0xf1b2('0x3d')](_0xf1b2('0x7f')))[_0xf1b2('0x72')]();}_0x3c71f7[_0xf1b2('0x80')](db[_0xf1b2('0x81')][_0xf1b2('0x35')](_0x4ad4ea));}return BPromise[_0xf1b2('0x82')](_0x3c71f7);}})[_0xf1b2('0x23')](function(){return _0x331e5a;})[_0xf1b2('0x23')](respondWithResult(_0x5a939a,null))['catch'](handleError(_0x5a939a,null));};exports[_0xf1b2('0x83')]=function(_0x223404,_0x5b21ef,_0x16d669){return db['Campaign']['find']({'where':{'id':_0x223404['params']['id']}})['then'](handleEntityNotFound(_0x5b21ef,null))[_0xf1b2('0x23')](function(_0x2511fd){if(_0x2511fd){return _0x2511fd[_0xf1b2('0x83')](_0x223404[_0xf1b2('0x35')]['ids']);}})[_0xf1b2('0x23')](function(_0x204895){if(_0x204895){return db[_0xf1b2('0x59')][_0xf1b2('0x24')]({'where':{'ListId':_0x223404[_0xf1b2('0x35')]['ids'],'CampaignId':_0x223404['params']['id']}})[_0xf1b2('0x23')](function(){return _0x204895;});}})[_0xf1b2('0x23')](respondWithStatusCode(_0x5b21ef,null))['catch'](handleError(_0x5b21ef,null));};exports[_0xf1b2('0x84')]=function(_0x178e27,_0x1966bf,_0x2a5ded){var _0x441a67={'raw':!![],'where':{}};var _0x10b271={};var _0x11eecf={'count':0x0,'rows':[]};return db[_0xf1b2('0x2e')][_0xf1b2('0x5e')]({'where':{'id':_0x178e27[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x1966bf,null))[_0xf1b2('0x23')](function(_0x599dba){if(_0x599dba){_0x10b271['model']=_[_0xf1b2('0x34')](db[_0xf1b2('0x63')]['rawAttributes']);_0x10b271[_0xf1b2('0x35')]=_[_0xf1b2('0x34')](_0x178e27[_0xf1b2('0x35')]);_0x10b271['filters']=_[_0xf1b2('0x37')](_0x10b271[_0xf1b2('0x33')],_0x10b271[_0xf1b2('0x35')]);_0x441a67[_0xf1b2('0x38')]=_['intersection'](_0x10b271[_0xf1b2('0x33')],qs[_0xf1b2('0x39')](_0x178e27[_0xf1b2('0x35')][_0xf1b2('0x39')]));_0x441a67[_0xf1b2('0x38')]=_0x441a67[_0xf1b2('0x38')][_0xf1b2('0x53')]?_0x441a67['attributes']:_0x10b271[_0xf1b2('0x33')];if(!_0x178e27[_0xf1b2('0x35')][_0xf1b2('0x3a')](_0xf1b2('0x5a'))){_0x441a67['limit']=qs[_0xf1b2('0x1c')](_0x178e27[_0xf1b2('0x35')]['limit']);_0x441a67[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x178e27[_0xf1b2('0x35')][_0xf1b2('0x1b')]);}_0x441a67['order']=qs[_0xf1b2('0x3c')](_0x178e27[_0xf1b2('0x35')][_0xf1b2('0x3c')]);_0x441a67[_0xf1b2('0x3d')]=qs['filters'](_[_0xf1b2('0x3e')](_0x178e27['query'],_0x10b271['filters']));_0x441a67[_0xf1b2('0x3d')][_0xf1b2('0x5b')]=_0x599dba['id'];if(_0x178e27['query'][_0xf1b2('0x3f')]){_0x441a67[_0xf1b2('0x3d')]=_[_0xf1b2('0x40')](_0x441a67[_0xf1b2('0x3d')],{'$or':_[_0xf1b2('0x2d')](_0x441a67[_0xf1b2('0x38')],function(_0x2cf7a0){var _0x3b9984={};_0x3b9984[_0x2cf7a0]={'$like':'%'+_0x178e27['query'][_0xf1b2('0x3f')]+'%'};return _0x3b9984;})});}_0x441a67=_[_0xf1b2('0x40')]({},_0x441a67,_0x178e27[_0xf1b2('0x42')]);return db[_0xf1b2('0x63')][_0xf1b2('0x1a')]({'where':_0x441a67[_0xf1b2('0x3d')]})[_0xf1b2('0x23')](function(_0x11a5c3){_0x11eecf[_0xf1b2('0x1a')]=_0x11a5c3;if(_0x178e27[_0xf1b2('0x35')][_0xf1b2('0x43')]){_0x441a67[_0xf1b2('0x44')]=[{'all':!![]}];}return db[_0xf1b2('0x63')]['findAll'](_0x441a67);})[_0xf1b2('0x23')](function(_0x250623){_0x11eecf[_0xf1b2('0x46')]=_0x250623;return _0x11eecf;});}})[_0xf1b2('0x23')](respondWithFilteredResult(_0x1966bf,_0x441a67))[_0xf1b2('0x47')](handleError(_0x1966bf,null));};exports['addBlackLists']=function(_0x1671cc,_0x1f4e24,_0x36f3c2){var _0x53682a,_0x3995f3;return db['Campaign']['find']({'where':{'id':_0x1671cc['params']['id']}})['then'](handleEntityNotFound(_0x1f4e24,null))[_0xf1b2('0x23')](function(_0x2c47a5){if(_0x2c47a5){_0x3995f3=_0x2c47a5;return _0x2c47a5[_0xf1b2('0x85')](_0x1671cc[_0xf1b2('0x4a')][_0xf1b2('0x65')],_[_0xf1b2('0x54')](_0x1671cc['body'],[_0xf1b2('0x65'),'id'])||{});}return null;})['spread'](function(_0x16db7f){var _0x1a112a;_0x53682a=_0x16db7f||[];var _0x3a92dd=[];if(_0x16db7f){for(var _0x217576=0x0;_0x217576<_0x16db7f[_0xf1b2('0x53')];_0x217576+=0x1){var _0x1572a0=_0x16db7f[_0x217576]['get']({'plain':!![]});_0x1a112a=squel['insert']()['into'](_0xf1b2('0x86'))[_0xf1b2('0x6b')]([_0xf1b2('0x6c'),_0xf1b2('0x6e'),_0xf1b2('0x6f'),_0xf1b2('0x5b'),'createdAt',_0xf1b2('0x56')],squel[_0xf1b2('0x77')]()[_0xf1b2('0x70')](_0xf1b2('0x6c'),'phone')[_0xf1b2('0x70')]('id',_0xf1b2('0x6e'))['field'](_0x1572a0[_0xf1b2('0x76')][_0xf1b2('0x72')](),_0xf1b2('0x6f'))['field'](_0x1671cc[_0xf1b2('0x48')]['id'][_0xf1b2('0x72')](),_0xf1b2('0x5b'))[_0xf1b2('0x70')]('NOW()',_0xf1b2('0x55'))[_0xf1b2('0x70')]('NOW()',_0xf1b2('0x56'))['from'](_0xf1b2('0x73'))['where'](_0xf1b2('0x74'))[_0xf1b2('0x3d')](_0xf1b2('0x75'),_0x1572a0['CmListId'][_0xf1b2('0x72')]())[_0xf1b2('0x3d')](_0xf1b2('0x7f')))[_0xf1b2('0x72')]();_0x3a92dd[_0xf1b2('0x80')](db[_0xf1b2('0x81')][_0xf1b2('0x35')](_0x1a112a));}return BPromise[_0xf1b2('0x82')](_0x3a92dd);}})[_0xf1b2('0x23')](function(){return _0x53682a;})[_0xf1b2('0x23')](respondWithResult(_0x1f4e24,null))[_0xf1b2('0x47')](handleError(_0x1f4e24,null));};exports[_0xf1b2('0x87')]=function(_0x26b215,_0x1409cd,_0x170d17){return db['Campaign'][_0xf1b2('0x49')]({'where':{'id':_0x26b215[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](handleEntityNotFound(_0x1409cd,null))[_0xf1b2('0x23')](function(_0x524e52){if(_0x524e52){return _0x524e52['removeBlackLists'](_0x26b215[_0xf1b2('0x35')]['ids']);}})[_0xf1b2('0x23')](function(_0x3cbb73){if(_0x3cbb73){return db[_0xf1b2('0x61')][_0xf1b2('0x24')]({'where':{'ListId':_0x26b215[_0xf1b2('0x35')][_0xf1b2('0x65')],'CampaignId':_0x26b215[_0xf1b2('0x48')]['id']}})[_0xf1b2('0x23')](function(){return _0x3cbb73;});}})[_0xf1b2('0x23')](respondWithStatusCode(_0x1409cd,null))['catch'](handleError(_0x1409cd,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3d7b357..6df41b3 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 _0x6c51=['campaigns','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign'];(function(_0x326bbb,_0x2a807b){var _0x1ba652=function(_0x1fd76d){while(--_0x1fd76d){_0x326bbb['push'](_0x326bbb['shift']());}};_0x1ba652(++_0x2a807b);}(_0x6c51,0x112));var _0x16c5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6c51[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x16c5('0x0'));var util=require(_0x16c5('0x1'));var logger=require('../../config/logger')(_0x16c5('0x2'));var moment=require(_0x16c5('0x3'));var BPromise=require(_0x16c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16c5('0x5'));var rimraf=require(_0x16c5('0x6'));var config=require(_0x16c5('0x7'));var attributes=require(_0x16c5('0x8'));module[_0x16c5('0x9')]=function(_0x4a0fb9,_0x4909c3){return _0x4a0fb9[_0x16c5('0xa')](_0x16c5('0xb'),attributes,{'tableName':_0x16c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e6f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','define','Campaign','campaigns','lodash'];(function(_0x584daa,_0x58b797){var _0xeb3fc3=function(_0x48896d){while(--_0x48896d){_0x584daa['push'](_0x584daa['shift']());}};_0xeb3fc3(++_0x58b797);}(_0x4e6f,0xe9));var _0xf4e6=function(_0x1d4602,_0x18c980){_0x1d4602=_0x1d4602-0x0;var _0x218fa1=_0x4e6f[_0x1d4602];return _0x218fa1;};'use strict';var _=require(_0xf4e6('0x0'));var util=require(_0xf4e6('0x1'));var logger=require(_0xf4e6('0x2'))(_0xf4e6('0x3'));var moment=require(_0xf4e6('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4e6('0x5'));var fs=require('fs');var path=require(_0xf4e6('0x6'));var rimraf=require(_0xf4e6('0x7'));var config=require(_0xf4e6('0x8'));var attributes=require(_0xf4e6('0x9'));module['exports']=function(_0x40cac8,_0x5728c9){return _0x40cac8[_0xf4e6('0xa')](_0xf4e6('0xb'),attributes,{'tableName':_0xf4e6('0xc'),'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 c7f415c..0394150 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x57c853,_0x34e153){var _0x36a03b=function(_0x20785e){while(--_0x20785e){_0x57c853['push'](_0x57c853['shift']());}};_0x36a03b(++_0x34e153);}(_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});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x3ddda1,_0x46865b){var _0x4836a4=function(_0x33aa0d){while(--_0x33aa0d){_0x3ddda1['push'](_0x3ddda1['shift']());}};_0x4836a4(++_0x46865b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 01a70c2..cd380ba 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 _0xdf92=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addLists','addBlackLists','put','delete','removeLists','removeBlackLists','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0xdf92,0x10c));var _0x2df9=function(_0x50d3bc,_0x4c6640){_0x50d3bc=_0x50d3bc-0x0;var _0xb201f3=_0xdf92[_0x50d3bc];return _0xb201f3;};'use strict';var multer=require(_0x2df9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2df9('0x1'));var express=require(_0x2df9('0x2'));var router=express[_0x2df9('0x3')]();var auth=require(_0x2df9('0x4'));var interaction=require(_0x2df9('0x5'));var config=require(_0x2df9('0x6'));var controller=require(_0x2df9('0x7'));router[_0x2df9('0x8')]('/',auth[_0x2df9('0x9')](),controller[_0x2df9('0xa')]);router['get'](_0x2df9('0xb'),auth[_0x2df9('0x9')](),controller[_0x2df9('0xc')]);router[_0x2df9('0x8')](_0x2df9('0xd'),auth['isAuthenticated'](),controller[_0x2df9('0xe')]);router[_0x2df9('0x8')](_0x2df9('0xf'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x10')]);router[_0x2df9('0x8')](_0x2df9('0x11'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x12')]);router['get']('/:id/hopper_black',auth[_0x2df9('0x9')](),controller['getHopperBlacks']);router[_0x2df9('0x8')](_0x2df9('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0x2df9('0x8')](_0x2df9('0x14'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x15')]);router['post']('/',auth[_0x2df9('0x9')](),controller[_0x2df9('0x16')]);router[_0x2df9('0x17')](_0x2df9('0x18'),auth[_0x2df9('0x9')](),controller['clone']);router[_0x2df9('0x17')](_0x2df9('0x13'),auth['isAuthenticated'](),controller[_0x2df9('0x19')]);router[_0x2df9('0x17')](_0x2df9('0x14'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x1a')]);router[_0x2df9('0x1b')]('/:id',auth[_0x2df9('0x9')](),controller['update']);router[_0x2df9('0x1c')]('/:id',auth[_0x2df9('0x9')](),controller['destroy']);router[_0x2df9('0x1c')](_0x2df9('0x13'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x1d')]);router[_0x2df9('0x1c')](_0x2df9('0x14'),auth[_0x2df9('0x9')](),controller[_0x2df9('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x3174=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x3174,0x154));var _0x4317=function(_0x389482,_0x39c06a){_0x389482=_0x389482-0x0;var _0x5238f3=_0x3174[_0x389482];return _0x5238f3;};'use strict';var multer=require(_0x4317('0x0'));var util=require('util');var path=require(_0x4317('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4317('0x2')]();var auth=require(_0x4317('0x3'));var interaction=require(_0x4317('0x4'));var config=require(_0x4317('0x5'));var controller=require(_0x4317('0x6'));router['get']('/',auth[_0x4317('0x7')](),controller[_0x4317('0x8')]);router[_0x4317('0x9')](_0x4317('0xa'),auth[_0x4317('0x7')](),controller[_0x4317('0xb')]);router['get'](_0x4317('0xc'),auth[_0x4317('0x7')](),controller[_0x4317('0xd')]);router['get'](_0x4317('0xe'),auth[_0x4317('0x7')](),controller[_0x4317('0xf')]);router[_0x4317('0x9')](_0x4317('0x10'),auth[_0x4317('0x7')](),controller['getHopperFinals']);router['get'](_0x4317('0x11'),auth[_0x4317('0x7')](),controller[_0x4317('0x12')]);router[_0x4317('0x9')](_0x4317('0x13'),auth[_0x4317('0x7')](),controller[_0x4317('0x14')]);router[_0x4317('0x9')](_0x4317('0x15'),auth[_0x4317('0x7')](),controller[_0x4317('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4317('0x17')]);router[_0x4317('0x18')](_0x4317('0x19'),auth[_0x4317('0x7')](),controller[_0x4317('0x1a')]);router[_0x4317('0x18')](_0x4317('0x13'),auth[_0x4317('0x7')](),controller[_0x4317('0x1b')]);router[_0x4317('0x18')](_0x4317('0x15'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x4317('0x1c')](_0x4317('0xa'),auth[_0x4317('0x7')](),controller[_0x4317('0x1d')]);router['delete'](_0x4317('0xa'),auth[_0x4317('0x7')](),controller[_0x4317('0x1e')]);router[_0x4317('0x1f')](_0x4317('0x13'),auth[_0x4317('0x7')](),controller[_0x4317('0x20')]);router[_0x4317('0x1f')](_0x4317('0x15'),auth['isAuthenticated'](),controller[_0x4317('0x21')]);module[_0x4317('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9dea2c1..338d589 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 _0xc8e1=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x55feb0,_0x4ec101){var _0x1cec9b=function(_0x18bd2c){while(--_0x18bd2c){_0x55feb0['push'](_0x55feb0['shift']());}};_0x1cec9b(++_0x4ec101);}(_0xc8e1,0x69));var _0x1c8e=function(_0x4c9441,_0x2ea921){_0x4c9441=_0x4c9441-0x0;var _0x59066d=_0xc8e1[_0x4c9441];return _0x59066d;};'use strict';var Sequelize=require(_0x1c8e('0x0'));module[_0x1c8e('0x1')]={'key':{'type':Sequelize[_0x1c8e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1c8e('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x1c8e('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1c8e('0x4')](_0x1c8e('0x5'));}}}; \ No newline at end of file +var _0x210b=['TEXT','STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x99259f,_0x4512e0){var _0x561c66=function(_0x45c7de){while(--_0x45c7de){_0x99259f['push'](_0x99259f['shift']());}};_0x561c66(++_0x4512e0);}(_0x210b,0x9f));var _0xb210=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x210b[_0x1e4f2f];return _0xccea89;};'use strict';var Sequelize=require(_0xb210('0x0'));module[_0xb210('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xb210('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb210('0x3')]},'name':{'type':Sequelize[_0xb210('0x4')],'get':function(){return this[_0xb210('0x5')](_0xb210('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1a0d8ed..402dc53 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 _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file +var _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d37b5fb..e394d87 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 _0x4dcb=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','exports','CannedAnswer'];(function(_0x2f0b0b,_0x50f639){var _0x49abf6=function(_0x1147d0){while(--_0x1147d0){_0x2f0b0b['push'](_0x2f0b0b['shift']());}};_0x49abf6(++_0x50f639);}(_0x4dcb,0x153));var _0xb4dc=function(_0x345395,_0x352807){_0x345395=_0x345395-0x0;var _0x19dfaa=_0x4dcb[_0x345395];return _0x19dfaa;};'use strict';var _=require(_0xb4dc('0x0'));var util=require(_0xb4dc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb4dc('0x2'));var BPromise=require(_0xb4dc('0x3'));var rp=require(_0xb4dc('0x4'));var fs=require('fs');var path=require(_0xb4dc('0x5'));var rimraf=require(_0xb4dc('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xb4dc('0x7')]=function(_0x493ce7,_0x38f8bc){return _0x493ce7['define'](_0xb4dc('0x8'),attributes,{'tableName':_0xb4dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4dc('0xa'),'collate':_0xb4dc('0xb')});}; \ No newline at end of file +var _0x3246=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x4692e2,_0xdf48f0){var _0x10bc91=function(_0x5ddb2d){while(--_0x5ddb2d){_0x4692e2['push'](_0x4692e2['shift']());}};_0x10bc91(++_0xdf48f0);}(_0x3246,0x1ce));var _0x6324=function(_0x4b9d4b,_0x5af65c){_0x4b9d4b=_0x4b9d4b-0x0;var _0x2d8151=_0x3246[_0x4b9d4b];return _0x2d8151;};'use strict';var _=require(_0x6324('0x0'));var util=require(_0x6324('0x1'));var logger=require(_0x6324('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6324('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6324('0x4'));var config=require(_0x6324('0x5'));var attributes=require(_0x6324('0x6'));module[_0x6324('0x7')]=function(_0x4656a1,_0x3bdffb){return _0x4656a1[_0x6324('0x8')](_0x6324('0x9'),attributes,{'tableName':_0x6324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6324('0xb'),'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 bb32d58..4899603 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 _0x9119=['client','http','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9119,0x11c));var _0x9911=function(_0x5143e2,_0x2af385){_0x5143e2=_0x5143e2-0x0;var _0x2deac3=_0x9119[_0x5143e2];return _0x2deac3;};'use strict';var _=require(_0x9911('0x0'));var util=require(_0x9911('0x1'));var moment=require(_0x9911('0x2'));var BPromise=require(_0x9911('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9911('0x4'));var db=require(_0x9911('0x5'))['db'];var utils=require(_0x9911('0x6'));var logger=require(_0x9911('0x7'))(_0x9911('0x8'));var config=require(_0x9911('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9911('0xa')][_0x9911('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137304,_0xb9119e,_0xd1cd1f){return new BPromise(function(_0x43b1ba,_0xf9000f){return client[_0x9911('0xc')](_0x137304,_0xd1cd1f)[_0x9911('0xd')](function(_0x4fe4fd){logger['info'](_0x9911('0xe'),_0xb9119e,_0x9911('0xf'));logger['debug'](_0x9911('0x10'),_0xb9119e,'request\x20sent',JSON['stringify'](_0x4fe4fd));if(_0x4fe4fd['error']){if(_0x4fe4fd[_0x9911('0x11')][_0x9911('0x12')]===0x1f4){logger[_0x9911('0x11')]('CannedAnswer,\x20%s,\x20%s',_0xb9119e,_0x4fe4fd[_0x9911('0x11')][_0x9911('0x13')]);return _0xf9000f(_0x4fe4fd[_0x9911('0x11')][_0x9911('0x13')]);}logger[_0x9911('0x11')](_0x9911('0xe'),_0xb9119e,_0x4fe4fd[_0x9911('0x11')][_0x9911('0x13')]);return _0x43b1ba(_0x4fe4fd[_0x9911('0x11')][_0x9911('0x13')]);}else{logger[_0x9911('0x14')]('CannedAnswer,\x20%s,\x20%s',_0xb9119e,_0x9911('0xf'));_0x43b1ba(_0x4fe4fd['result'][_0x9911('0x13')]);}})['catch'](function(_0x3d2eb7){logger['error'](_0x9911('0xe'),_0xb9119e,_0x3d2eb7);_0xf9000f(_0x3d2eb7);});});} \ No newline at end of file +var _0xed0d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request\x20sent','stringify','error','code','message','info','CannedAnswer,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x181ddd,_0x3ddbd4){var _0x5483ae=function(_0x414475){while(--_0x414475){_0x181ddd['push'](_0x181ddd['shift']());}};_0x5483ae(++_0x3ddbd4);}(_0xed0d,0x162));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xded0('0x0'));var util=require(_0xded0('0x1'));var moment=require(_0xded0('0x2'));var BPromise=require(_0xded0('0x3'));var rs=require(_0xded0('0x4'));var fs=require('fs');var Redis=require(_0xded0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xded0('0x6'));var logger=require('../../config/logger')(_0xded0('0x7'));var config=require(_0xded0('0x8'));var jayson=require(_0xded0('0x9'));var client=jayson[_0xded0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2dd4,_0x5e2546,_0x5086f0){return new BPromise(function(_0x3857dd,_0x194567){return client['request'](_0x1a2dd4,_0x5086f0)['then'](function(_0x4f6848){logger['info']('CannedAnswer,\x20%s,\x20%s',_0x5e2546,_0xded0('0xb'));logger['debug']('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x5e2546,_0xded0('0xb'),JSON[_0xded0('0xc')](_0x4f6848));if(_0x4f6848[_0xded0('0xd')]){if(_0x4f6848['error'][_0xded0('0xe')]===0x1f4){logger[_0xded0('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x5e2546,_0x4f6848['error'][_0xded0('0xf')]);return _0x194567(_0x4f6848[_0xded0('0xd')][_0xded0('0xf')]);}logger[_0xded0('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x5e2546,_0x4f6848[_0xded0('0xd')]['message']);return _0x3857dd(_0x4f6848[_0xded0('0xd')][_0xded0('0xf')]);}else{logger[_0xded0('0x10')](_0xded0('0x11'),_0x5e2546,'request\x20sent');_0x3857dd(_0x4f6848[_0xded0('0x12')]['message']);}})[_0xded0('0x13')](function(_0x1b9e64){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x5e2546,_0x1b9e64);_0x194567(_0x1b9e64);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 0dead4c..1b86486 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 _0x1f96=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x2c7648,_0x567729){var _0x1cebc4=function(_0x358087){while(--_0x358087){_0x2c7648['push'](_0x2c7648['shift']());}};_0x1cebc4(++_0x567729);}(_0x1f96,0x108));var _0x61f9=function(_0x35f736,_0x23a5d0){_0x35f736=_0x35f736-0x0;var _0x3bd2e0=_0x1f96[_0x35f736];return _0x3bd2e0;};'use strict';var multer=require(_0x61f9('0x0'));var util=require(_0x61f9('0x1'));var path=require(_0x61f9('0x2'));var timeout=require(_0x61f9('0x3'));var express=require(_0x61f9('0x4'));var router=express['Router']();var auth=require(_0x61f9('0x5'));var interaction=require(_0x61f9('0x6'));var config=require(_0x61f9('0x7'));var controller=require(_0x61f9('0x8'));router['get']('/',auth[_0x61f9('0x9')](),controller[_0x61f9('0xa')]);router['get'](_0x61f9('0xb'),auth[_0x61f9('0x9')](),controller[_0x61f9('0xc')]);router[_0x61f9('0xd')]('/',auth['isAuthenticated'](),controller[_0x61f9('0xe')]);router[_0x61f9('0xf')](_0x61f9('0xb'),auth[_0x61f9('0x9')](),controller[_0x61f9('0x10')]);router[_0x61f9('0x11')](_0x61f9('0xb'),auth[_0x61f9('0x9')](),controller[_0x61f9('0x12')]);module[_0x61f9('0x13')]=router; \ No newline at end of file +var _0x11ac=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x11ac,0x19e));var _0xc11a=function(_0x11c510,_0x37ecc3){_0x11c510=_0x11c510-0x0;var _0x2f23a8=_0x11ac[_0x11c510];return _0x2f23a8;};'use strict';var multer=require(_0xc11a('0x0'));var util=require(_0xc11a('0x1'));var path=require(_0xc11a('0x2'));var timeout=require(_0xc11a('0x3'));var express=require(_0xc11a('0x4'));var router=express['Router']();var auth=require(_0xc11a('0x5'));var interaction=require(_0xc11a('0x6'));var config=require(_0xc11a('0x7'));var controller=require(_0xc11a('0x8'));router[_0xc11a('0x9')]('/',auth[_0xc11a('0xa')](),controller[_0xc11a('0xb')]);router['get'](_0xc11a('0xc'),auth[_0xc11a('0xa')](),controller[_0xc11a('0xd')]);router[_0xc11a('0xe')]('/',auth[_0xc11a('0xa')](),controller[_0xc11a('0xf')]);router['put'](_0xc11a('0xc'),auth[_0xc11a('0xa')](),controller['update']);router[_0xc11a('0x10')](_0xc11a('0xc'),auth[_0xc11a('0xa')](),controller[_0xc11a('0x11')]);module[_0xc11a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 6d8a1a6..6a2638c 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 _0x073e=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x50af01,_0x1c148f){var _0x4349bb=function(_0x201e8b){while(--_0x201e8b){_0x50af01['push'](_0x50af01['shift']());}};_0x4349bb(++_0x1c148f);}(_0x073e,0x184));var _0xe073=function(_0x283090,_0x1b7a3d){_0x283090=_0x283090-0x0;var _0x155051=_0x073e[_0x283090];return _0x155051;};'use strict';var Sequelize=require(_0xe073('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xe073('0x1')],'allowNull':![],'defaultValue':_0xe073('0x2')},'clid':{'type':Sequelize[_0xe073('0x3')]},'src':{'type':Sequelize[_0xe073('0x3')]},'dst':{'type':Sequelize[_0xe073('0x3')]},'dcontext':{'type':Sequelize[_0xe073('0x3')]},'channel':{'type':Sequelize[_0xe073('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe073('0x3')]},'duration':{'type':Sequelize[_0xe073('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe073('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe073('0x3')]},'amaflags':{'type':Sequelize[_0xe073('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe073('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe073('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xe073('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe073('0x3')]},'tag':{'type':Sequelize[_0xe073('0x3')]}}; \ No newline at end of file +var _0x7f14=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x327c4d,_0x243307){var _0x83bd0=function(_0x1fc491){while(--_0x1fc491){_0x327c4d['push'](_0x327c4d['shift']());}};_0x83bd0(++_0x243307);}(_0x7f14,0x133));var _0x47f1=function(_0x1a226b,_0x463c4c){_0x1a226b=_0x1a226b-0x0;var _0xbc317a=_0x7f14[_0x1a226b];return _0xbc317a;};'use strict';var Sequelize=require(_0x47f1('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x47f1('0x1')},'clid':{'type':Sequelize[_0x47f1('0x2')]},'src':{'type':Sequelize[_0x47f1('0x2')]},'dst':{'type':Sequelize[_0x47f1('0x2')]},'dcontext':{'type':Sequelize[_0x47f1('0x2')]},'channel':{'type':Sequelize[_0x47f1('0x2')]},'dstchannel':{'type':Sequelize[_0x47f1('0x2')]},'lastapp':{'type':Sequelize[_0x47f1('0x2')]},'lastdata':{'type':Sequelize[_0x47f1('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x47f1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x47f1('0x2')]},'amaflags':{'type':Sequelize[_0x47f1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x47f1('0x2')]},'userfield':{'type':Sequelize[_0x47f1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x47f1('0x2')]},'sequence':{'type':Sequelize[_0x47f1('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x47f1('0x2')]},'tag':{'type':Sequelize[_0x47f1('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 5d24115..cb80945 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 _0xa473=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','reject','save','update','destroy','then','error','stack','name','index','Cdr','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','find','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x5f45bf,_0x29322e){var _0x385e0d=function(_0x1c4afc){while(--_0x1c4afc){_0x5f45bf['push'](_0x5f45bf['shift']());}};_0x385e0d(++_0x29322e);}(_0xa473,0x1cb));var _0x3a47=function(_0x500b35,_0x1f4144){_0x500b35=_0x500b35-0x0;var _0x3d5d43=_0xa473[_0x500b35];return _0x3d5d43;};'use strict';var pdf=require(_0x3a47('0x0'));var emlformat=require(_0x3a47('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3a47('0x2'));var jsonpatch=require(_0x3a47('0x3'));var rp=require('request-promise');var moment=require(_0x3a47('0x4'));var BPromise=require(_0x3a47('0x5'));var Mustache=require(_0x3a47('0x6'));var util=require(_0x3a47('0x7'));var path=require(_0x3a47('0x8'));var sox=require('sox');var csv=require(_0x3a47('0x9'));var ejs=require(_0x3a47('0xa'));var fs=require('fs');var _=require(_0x3a47('0xb'));var squel=require(_0x3a47('0xc'));var crypto=require(_0x3a47('0xd'));var jsforce=require(_0x3a47('0xe'));var deskjs=require(_0x3a47('0xf'));var toCsv=require(_0x3a47('0x9'));var querystring=require(_0x3a47('0x10'));var Papa=require(_0x3a47('0x11'));var Redis=require(_0x3a47('0x12'));var authService=require(_0x3a47('0x13'));var qs=require(_0x3a47('0x14'));var as=require(_0x3a47('0x15'));var hardwareService=require(_0x3a47('0x16'));var logger=require(_0x3a47('0x17'))(_0x3a47('0x18'));var utils=require(_0x3a47('0x19'));var config=require(_0x3a47('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58847e,_0x53aacc){_0x53aacc=_0x53aacc||0xcc;return function(_0x1aa412){if(_0x1aa412){return _0x58847e[_0x3a47('0x1b')](_0x53aacc);}return _0x58847e[_0x3a47('0x1c')](_0x53aacc)[_0x3a47('0x1d')]();};}function respondWithResult(_0x1b0ed1,_0xa23105){_0xa23105=_0xa23105||0xc8;return function(_0x17aa1e){if(_0x17aa1e){return _0x1b0ed1[_0x3a47('0x1c')](_0xa23105)[_0x3a47('0x1e')](_0x17aa1e);}};}function respondWithFilteredResult(_0x2824bf,_0x1c00a5){return function(_0x57efe4){if(_0x57efe4){var _0x4d6964=_0x57efe4[_0x3a47('0x1f')],_0x48182c=_0x1c00a5[_0x3a47('0x20')],_0x4f867d=_0x1c00a5[_0x3a47('0x20')]+_0x1c00a5[_0x3a47('0x21')],_0x3b9508;if(_0x4f867d>=_0x4d6964){_0x4f867d=_0x4d6964;_0x3b9508=0xc8;}else{_0x3b9508=0xce;}_0x2824bf[_0x3a47('0x1c')](_0x3b9508);return _0x2824bf['set']('Content-Range',_0x48182c+'-'+_0x4f867d+'/'+_0x4d6964)['json'](_0x57efe4);}return null;};}function patchUpdates(_0xee3320){return function(_0x1da19d){try{jsonpatch['apply'](_0x1da19d,_0xee3320,!![]);}catch(_0x5725bc){return BPromise[_0x3a47('0x22')](_0x5725bc);}return _0x1da19d[_0x3a47('0x23')]();};}function saveUpdates(_0x28e152,_0x16b16b){return function(_0x40c629){if(_0x40c629){return _0x40c629[_0x3a47('0x24')](_0x28e152)['then'](function(_0x435c62){return _0x435c62;});}return null;};}function removeEntity(_0x456402,_0x257ec2){return function(_0x79cdfd){if(_0x79cdfd){return _0x79cdfd[_0x3a47('0x25')]()[_0x3a47('0x26')](function(){_0x456402[_0x3a47('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x66b78,_0x547831){return function(_0x519379){if(!_0x519379){_0x66b78[_0x3a47('0x1b')](0x194);}return _0x519379;};}function handleError(_0x209ef1,_0x232ff1){_0x232ff1=_0x232ff1||0x1f4;return function(_0x1f13ee){logger[_0x3a47('0x27')](_0x1f13ee[_0x3a47('0x28')]);if(_0x1f13ee[_0x3a47('0x29')]){delete _0x1f13ee['name'];}_0x209ef1[_0x3a47('0x1c')](_0x232ff1)['send'](_0x1f13ee);};}exports[_0x3a47('0x2a')]=function(_0xf94135,_0x42cf39){var _0x342761={},_0x5dd350={},_0x37fbdf={'count':0x0,'rows':[]};var _0x580843=_['map'](db[_0x3a47('0x2b')][_0x3a47('0x2c')],function(_0x1a9693){return{'name':_0x1a9693[_0x3a47('0x2d')],'type':_0x1a9693['type'][_0x3a47('0x2e')]};});_0x5dd350[_0x3a47('0x2f')]=_[_0x3a47('0x30')](_0x580843,_0x3a47('0x29'));_0x5dd350['query']=_[_0x3a47('0x31')](_0xf94135[_0x3a47('0x32')]);_0x5dd350['filters']=_[_0x3a47('0x33')](_0x5dd350[_0x3a47('0x2f')],_0x5dd350['query']);_0x342761[_0x3a47('0x34')]=_[_0x3a47('0x33')](_0x5dd350['model'],qs['fields'](_0xf94135[_0x3a47('0x32')][_0x3a47('0x35')]));_0x342761[_0x3a47('0x34')]=_0x342761[_0x3a47('0x34')][_0x3a47('0x36')]?_0x342761[_0x3a47('0x34')]:_0x5dd350[_0x3a47('0x2f')];if(!_0xf94135[_0x3a47('0x32')][_0x3a47('0x37')](_0x3a47('0x38'))){_0x342761[_0x3a47('0x21')]=qs['limit'](_0xf94135['query'][_0x3a47('0x21')]);_0x342761[_0x3a47('0x20')]=qs[_0x3a47('0x20')](_0xf94135[_0x3a47('0x32')]['offset']);}_0x342761[_0x3a47('0x39')]=qs[_0x3a47('0x3a')](_0xf94135[_0x3a47('0x32')][_0x3a47('0x3a')]);_0x342761[_0x3a47('0x3b')]=qs[_0x3a47('0x3c')](_[_0x3a47('0x3d')](_0xf94135[_0x3a47('0x32')],_0x5dd350['filters']));if(_0xf94135[_0x3a47('0x32')][_0x3a47('0x3e')]){_0x342761[_0x3a47('0x3b')]=_[_0x3a47('0x3f')](_0x342761[_0x3a47('0x3b')],{'$or':_[_0x3a47('0x30')](_0x580843,function(_0x4579bb){if(_0x4579bb[_0x3a47('0x40')]!==_0x3a47('0x41')){var _0x2c8a21={};_0x2c8a21[_0x4579bb[_0x3a47('0x29')]]={'$like':'%'+_0xf94135[_0x3a47('0x32')][_0x3a47('0x3e')]+'%'};return _0x2c8a21;}})});}_0x342761=_[_0x3a47('0x3f')]({},_0x342761,_0xf94135[_0x3a47('0x42')]);var _0x370ce0={'where':_0x342761[_0x3a47('0x3b')]};return db['Cdr']['count'](_0x370ce0)[_0x3a47('0x26')](function(_0x202c12){_0x37fbdf[_0x3a47('0x1f')]=_0x202c12;if(_0xf94135[_0x3a47('0x32')][_0x3a47('0x43')]){_0x342761['include']=[{'all':!![]}];}return db['Cdr'][_0x3a47('0x44')](_0x342761);})[_0x3a47('0x26')](function(_0x3d6ee3){_0x37fbdf[_0x3a47('0x45')]=_0x3d6ee3;return _0x37fbdf;})[_0x3a47('0x26')](respondWithFilteredResult(_0x42cf39,_0x342761))[_0x3a47('0x46')](handleError(_0x42cf39,null));};exports[_0x3a47('0x47')]=function(_0x39a982,_0x4cadf9){var _0x3d1707={'raw':!![],'where':{'id':_0x39a982['params']['id']}},_0x1a9852={};_0x1a9852['model']=_[_0x3a47('0x31')](db['Cdr']['rawAttributes']);_0x1a9852[_0x3a47('0x32')]=_[_0x3a47('0x31')](_0x39a982['query']);_0x1a9852[_0x3a47('0x3c')]=_[_0x3a47('0x33')](_0x1a9852[_0x3a47('0x2f')],_0x1a9852['query']);_0x3d1707[_0x3a47('0x34')]=_[_0x3a47('0x33')](_0x1a9852[_0x3a47('0x2f')],qs[_0x3a47('0x35')](_0x39a982['query']['fields']));_0x3d1707[_0x3a47('0x34')]=_0x3d1707[_0x3a47('0x34')][_0x3a47('0x36')]?_0x3d1707[_0x3a47('0x34')]:_0x1a9852[_0x3a47('0x2f')];if(_0x39a982[_0x3a47('0x32')][_0x3a47('0x43')]){_0x3d1707[_0x3a47('0x48')]=[{'all':!![]}];}_0x3d1707=_[_0x3a47('0x3f')]({},_0x3d1707,_0x39a982[_0x3a47('0x42')]);return db[_0x3a47('0x2b')]['find'](_0x3d1707)[_0x3a47('0x26')](handleEntityNotFound(_0x4cadf9,null))[_0x3a47('0x26')](respondWithResult(_0x4cadf9,null))[_0x3a47('0x46')](handleError(_0x4cadf9,null));};exports[_0x3a47('0x49')]=function(_0x2b52d3,_0xc0076c){return db['Cdr'][_0x3a47('0x49')](_0x2b52d3['body'],{})[_0x3a47('0x26')](respondWithResult(_0xc0076c,0xc9))['catch'](handleError(_0xc0076c,null));};exports['update']=function(_0x1672ec,_0x3ecb85){if(_0x1672ec[_0x3a47('0x4a')]['id']){delete _0x1672ec[_0x3a47('0x4a')]['id'];}return db[_0x3a47('0x2b')][_0x3a47('0x4b')]({'where':{'id':_0x1672ec[_0x3a47('0x4c')]['id']}})[_0x3a47('0x26')](handleEntityNotFound(_0x3ecb85,null))['then'](saveUpdates(_0x1672ec[_0x3a47('0x4a')],null))[_0x3a47('0x26')](respondWithResult(_0x3ecb85,null))[_0x3a47('0x46')](handleError(_0x3ecb85,null));};exports[_0x3a47('0x25')]=function(_0x23a9ad,_0x3e2980){return db[_0x3a47('0x2b')]['find']({'where':{'id':_0x23a9ad[_0x3a47('0x4c')]['id']}})[_0x3a47('0x26')](handleEntityNotFound(_0x3e2980,null))[_0x3a47('0x26')](removeEntity(_0x3e2980,null))['catch'](handleError(_0x3e2980,null));};exports[_0x3a47('0x4d')]=function(_0x37d2dc,_0x2acd40){return db[_0x3a47('0x2b')][_0x3a47('0x4d')]()['then'](respondWithResult(_0x2acd40,null))[_0x3a47('0x46')](handleError(_0x2acd40,null));}; \ No newline at end of file +var _0xb841=['limit','set','Content-Range','apply','reject','then','destroy','error','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0xb841,0x114));var _0x1b84=function(_0x33cf07,_0x8a24bd){_0x33cf07=_0x33cf07-0x0;var _0x56998a=_0xb841[_0x33cf07];return _0x56998a;};'use strict';var pdf=require(_0x1b84('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1b84('0x1'));var zipdir=require(_0x1b84('0x2'));var jsonpatch=require(_0x1b84('0x3'));var rp=require(_0x1b84('0x4'));var moment=require(_0x1b84('0x5'));var BPromise=require(_0x1b84('0x6'));var Mustache=require(_0x1b84('0x7'));var util=require(_0x1b84('0x8'));var path=require(_0x1b84('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1b84('0xa'));var fs=require('fs');var _=require(_0x1b84('0xb'));var squel=require(_0x1b84('0xc'));var crypto=require(_0x1b84('0xd'));var jsforce=require(_0x1b84('0xe'));var deskjs=require(_0x1b84('0xf'));var toCsv=require(_0x1b84('0x10'));var querystring=require(_0x1b84('0x11'));var Papa=require('papaparse');var Redis=require(_0x1b84('0x12'));var authService=require(_0x1b84('0x13'));var qs=require(_0x1b84('0x14'));var as=require(_0x1b84('0x15'));var hardwareService=require(_0x1b84('0x16'));var logger=require(_0x1b84('0x17'))('api');var utils=require(_0x1b84('0x18'));var config=require(_0x1b84('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b811f,_0x15b2fd){_0x15b2fd=_0x15b2fd||0xcc;return function(_0x47d9e1){if(_0x47d9e1){return _0x1b811f[_0x1b84('0x1a')](_0x15b2fd);}return _0x1b811f[_0x1b84('0x1b')](_0x15b2fd)[_0x1b84('0x1c')]();};}function respondWithResult(_0x432f9c,_0x3929b4){_0x3929b4=_0x3929b4||0xc8;return function(_0x19502e){if(_0x19502e){return _0x432f9c['status'](_0x3929b4)[_0x1b84('0x1d')](_0x19502e);}};}function respondWithFilteredResult(_0x210aad,_0x16ded8){return function(_0x2d641a){if(_0x2d641a){var _0x2bf02f=_0x2d641a[_0x1b84('0x1e')],_0x4e263e=_0x16ded8[_0x1b84('0x1f')],_0x55a52b=_0x16ded8[_0x1b84('0x1f')]+_0x16ded8[_0x1b84('0x20')],_0x399a9d;if(_0x55a52b>=_0x2bf02f){_0x55a52b=_0x2bf02f;_0x399a9d=0xc8;}else{_0x399a9d=0xce;}_0x210aad['status'](_0x399a9d);return _0x210aad[_0x1b84('0x21')](_0x1b84('0x22'),_0x4e263e+'-'+_0x55a52b+'/'+_0x2bf02f)['json'](_0x2d641a);}return null;};}function patchUpdates(_0x31caee){return function(_0x44865c){try{jsonpatch[_0x1b84('0x23')](_0x44865c,_0x31caee,!![]);}catch(_0x1acc77){return BPromise[_0x1b84('0x24')](_0x1acc77);}return _0x44865c['save']();};}function saveUpdates(_0x34ac74,_0x395a2a){return function(_0x53898f){if(_0x53898f){return _0x53898f['update'](_0x34ac74)[_0x1b84('0x25')](function(_0x31601a){return _0x31601a;});}return null;};}function removeEntity(_0x568c99,_0x30c0e3){return function(_0x52b219){if(_0x52b219){return _0x52b219[_0x1b84('0x26')]()[_0x1b84('0x25')](function(){_0x568c99['status'](0xcc)[_0x1b84('0x1c')]();});}};}function handleEntityNotFound(_0x3e5811,_0x347946){return function(_0x5a1b5c){if(!_0x5a1b5c){_0x3e5811['sendStatus'](0x194);}return _0x5a1b5c;};}function handleError(_0x20dd1f,_0xe4fe88){_0xe4fe88=_0xe4fe88||0x1f4;return function(_0x5a5e62){logger[_0x1b84('0x27')](_0x5a5e62['stack']);if(_0x5a5e62[_0x1b84('0x28')]){delete _0x5a5e62[_0x1b84('0x28')];}_0x20dd1f[_0x1b84('0x1b')](_0xe4fe88)[_0x1b84('0x29')](_0x5a5e62);};}exports['index']=function(_0x22216c,_0x1c4004){var _0x3f1d21={},_0x12c0ad={},_0x1e32ab={'count':0x0,'rows':[]};var _0x2cc830=_['map'](db[_0x1b84('0x2a')][_0x1b84('0x2b')],function(_0x475b1d){return{'name':_0x475b1d[_0x1b84('0x2c')],'type':_0x475b1d[_0x1b84('0x2d')][_0x1b84('0x2e')]};});_0x12c0ad[_0x1b84('0x2f')]=_[_0x1b84('0x30')](_0x2cc830,_0x1b84('0x28'));_0x12c0ad[_0x1b84('0x31')]=_['keys'](_0x22216c[_0x1b84('0x31')]);_0x12c0ad[_0x1b84('0x32')]=_[_0x1b84('0x33')](_0x12c0ad[_0x1b84('0x2f')],_0x12c0ad[_0x1b84('0x31')]);_0x3f1d21[_0x1b84('0x34')]=_['intersection'](_0x12c0ad[_0x1b84('0x2f')],qs[_0x1b84('0x35')](_0x22216c[_0x1b84('0x31')][_0x1b84('0x35')]));_0x3f1d21[_0x1b84('0x34')]=_0x3f1d21[_0x1b84('0x34')][_0x1b84('0x36')]?_0x3f1d21[_0x1b84('0x34')]:_0x12c0ad[_0x1b84('0x2f')];if(!_0x22216c[_0x1b84('0x31')][_0x1b84('0x37')](_0x1b84('0x38'))){_0x3f1d21[_0x1b84('0x20')]=qs[_0x1b84('0x20')](_0x22216c[_0x1b84('0x31')][_0x1b84('0x20')]);_0x3f1d21[_0x1b84('0x1f')]=qs[_0x1b84('0x1f')](_0x22216c[_0x1b84('0x31')][_0x1b84('0x1f')]);}_0x3f1d21[_0x1b84('0x39')]=qs['sort'](_0x22216c[_0x1b84('0x31')][_0x1b84('0x3a')]);_0x3f1d21[_0x1b84('0x3b')]=qs['filters'](_[_0x1b84('0x3c')](_0x22216c[_0x1b84('0x31')],_0x12c0ad['filters']));if(_0x22216c['query'][_0x1b84('0x3d')]){_0x3f1d21[_0x1b84('0x3b')]=_[_0x1b84('0x3e')](_0x3f1d21['where'],{'$or':_[_0x1b84('0x30')](_0x2cc830,function(_0x579b52){if(_0x579b52[_0x1b84('0x2d')]!==_0x1b84('0x3f')){var _0x2f8fbd={};_0x2f8fbd[_0x579b52[_0x1b84('0x28')]]={'$like':'%'+_0x22216c[_0x1b84('0x31')][_0x1b84('0x3d')]+'%'};return _0x2f8fbd;}})});}_0x3f1d21=_[_0x1b84('0x3e')]({},_0x3f1d21,_0x22216c[_0x1b84('0x40')]);var _0x28c0ba={'where':_0x3f1d21['where']};return db[_0x1b84('0x2a')]['count'](_0x28c0ba)[_0x1b84('0x25')](function(_0x1d788d){_0x1e32ab[_0x1b84('0x1e')]=_0x1d788d;if(_0x22216c[_0x1b84('0x31')][_0x1b84('0x41')]){_0x3f1d21[_0x1b84('0x42')]=[{'all':!![]}];}return db[_0x1b84('0x2a')][_0x1b84('0x43')](_0x3f1d21);})[_0x1b84('0x25')](function(_0x44a907){_0x1e32ab[_0x1b84('0x44')]=_0x44a907;return _0x1e32ab;})[_0x1b84('0x25')](respondWithFilteredResult(_0x1c4004,_0x3f1d21))[_0x1b84('0x45')](handleError(_0x1c4004,null));};exports['show']=function(_0x367bf9,_0x178a68){var _0x5aa0b2={'raw':!![],'where':{'id':_0x367bf9[_0x1b84('0x46')]['id']}},_0xde7dcf={};_0xde7dcf[_0x1b84('0x2f')]=_['keys'](db[_0x1b84('0x2a')]['rawAttributes']);_0xde7dcf['query']=_[_0x1b84('0x47')](_0x367bf9['query']);_0xde7dcf['filters']=_[_0x1b84('0x33')](_0xde7dcf['model'],_0xde7dcf['query']);_0x5aa0b2[_0x1b84('0x34')]=_[_0x1b84('0x33')](_0xde7dcf[_0x1b84('0x2f')],qs[_0x1b84('0x35')](_0x367bf9[_0x1b84('0x31')][_0x1b84('0x35')]));_0x5aa0b2[_0x1b84('0x34')]=_0x5aa0b2[_0x1b84('0x34')]['length']?_0x5aa0b2[_0x1b84('0x34')]:_0xde7dcf[_0x1b84('0x2f')];if(_0x367bf9['query'][_0x1b84('0x41')]){_0x5aa0b2['include']=[{'all':!![]}];}_0x5aa0b2=_['merge']({},_0x5aa0b2,_0x367bf9[_0x1b84('0x40')]);return db['Cdr'][_0x1b84('0x48')](_0x5aa0b2)[_0x1b84('0x25')](handleEntityNotFound(_0x178a68,null))[_0x1b84('0x25')](respondWithResult(_0x178a68,null))['catch'](handleError(_0x178a68,null));};exports[_0x1b84('0x49')]=function(_0x27e2f5,_0x4b40b4){return db[_0x1b84('0x2a')][_0x1b84('0x49')](_0x27e2f5[_0x1b84('0x4a')],{})[_0x1b84('0x25')](respondWithResult(_0x4b40b4,0xc9))['catch'](handleError(_0x4b40b4,null));};exports[_0x1b84('0x4b')]=function(_0x22fa0e,_0x5a5fa5){if(_0x22fa0e[_0x1b84('0x4a')]['id']){delete _0x22fa0e['body']['id'];}return db[_0x1b84('0x2a')][_0x1b84('0x48')]({'where':{'id':_0x22fa0e[_0x1b84('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a5fa5,null))['then'](saveUpdates(_0x22fa0e[_0x1b84('0x4a')],null))[_0x1b84('0x25')](respondWithResult(_0x5a5fa5,null))[_0x1b84('0x45')](handleError(_0x5a5fa5,null));};exports[_0x1b84('0x26')]=function(_0xede512,_0x38486e){return db[_0x1b84('0x2a')][_0x1b84('0x48')]({'where':{'id':_0xede512['params']['id']}})[_0x1b84('0x25')](handleEntityNotFound(_0x38486e,null))['then'](removeEntity(_0x38486e,null))['catch'](handleError(_0x38486e,null));};exports['describe']=function(_0x839e9c,_0x3fb26d){return db['Cdr'][_0x1b84('0x4c')]()[_0x1b84('0x25')](respondWithResult(_0x3fb26d,null))[_0x1b84('0x45')](handleError(_0x3fb26d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b2abf73..dcb1269 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 _0x2542=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid'];(function(_0xd35184,_0x46dc7a){var _0x42daa4=function(_0x3430b7){while(--_0x3430b7){_0xd35184['push'](_0xd35184['shift']());}};_0x42daa4(++_0x46dc7a);}(_0x2542,0x169));var _0x2254=function(_0x64fc8d,_0x370e08){_0x64fc8d=_0x64fc8d-0x0;var _0x5dd810=_0x2542[_0x64fc8d];return _0x5dd810;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]},{'name':_0x2254('0x10'),'fields':['dst']},{'name':_0x2254('0x11'),'fields':[_0x2254('0x11')]},{'name':_0x2254('0x12'),'fields':[_0x2254('0x12')]}],'timestamps':![]});}; \ No newline at end of file +var _0x430c=['bluebird','./cdr.attributes','exports','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','api','moment'];(function(_0x7de34b,_0x2dd6ae){var _0x135feb=function(_0x5db593){while(--_0x5db593){_0x7de34b['push'](_0x7de34b['shift']());}};_0x135feb(++_0x2dd6ae);}(_0x430c,0x1a1));var _0xc430=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x430c[_0x8e9386];return _0x4abf26;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));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(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x8')]},{'name':_0xc430('0x9'),'fields':[_0xc430('0x9')]},{'name':_0xc430('0xa'),'fields':[_0xc430('0xa')]},{'name':_0xc430('0xb'),'fields':['dst']},{'name':_0xc430('0xc'),'fields':[_0xc430('0xc')]},{'name':'uniqueid','fields':[_0xc430('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 222f75f..955d614 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 _0x7f09=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x7f09,0x1c5));var _0x97f0=function(_0x2cef5b,_0x2d0b6d){_0x2cef5b=_0x2cef5b-0x0;var _0x5cb172=_0x7f09[_0x2cef5b];return _0x5cb172;};'use strict';var _=require(_0x97f0('0x0'));var util=require(_0x97f0('0x1'));var moment=require('moment');var BPromise=require(_0x97f0('0x2'));var rs=require(_0x97f0('0x3'));var fs=require('fs');var Redis=require(_0x97f0('0x4'));var db=require(_0x97f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x97f0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x97f0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b40d2,_0x40b44a,_0x340bcb){return new BPromise(function(_0x1ec803,_0x2dc9ce){return client['request'](_0x1b40d2,_0x340bcb)['then'](function(_0x47ab67){logger[_0x97f0('0x8')]('Cdr,\x20%s,\x20%s',_0x40b44a,_0x97f0('0x9'));logger['debug'](_0x97f0('0xa'),_0x40b44a,_0x97f0('0x9'),JSON[_0x97f0('0xb')](_0x47ab67));if(_0x47ab67['error']){if(_0x47ab67[_0x97f0('0xc')][_0x97f0('0xd')]===0x1f4){logger[_0x97f0('0xc')](_0x97f0('0xe'),_0x40b44a,_0x47ab67[_0x97f0('0xc')][_0x97f0('0xf')]);return _0x2dc9ce(_0x47ab67['error'][_0x97f0('0xf')]);}logger[_0x97f0('0xc')](_0x97f0('0xe'),_0x40b44a,_0x47ab67[_0x97f0('0xc')][_0x97f0('0xf')]);return _0x1ec803(_0x47ab67[_0x97f0('0xc')][_0x97f0('0xf')]);}else{logger[_0x97f0('0x8')](_0x97f0('0xe'),_0x40b44a,_0x97f0('0x9'));_0x1ec803(_0x47ab67[_0x97f0('0x10')][_0x97f0('0xf')]);}})[_0x97f0('0x11')](function(_0x1fe410){logger[_0x97f0('0xc')]('Cdr,\x20%s,\x20%s',_0x40b44a,_0x1fe410);_0x2dc9ce(_0x1fe410);});});} \ No newline at end of file +var _0x4c60=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x4c60,0xed));var _0x04c6=function(_0x4c44bd,_0xf93338){_0x4c44bd=_0x4c44bd-0x0;var _0x101d21=_0x4c60[_0x4c44bd];return _0x101d21;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require(_0x04c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x04c6('0x6'))(_0x04c6('0x7'));var config=require(_0x04c6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04c6('0x9')][_0x04c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x161fe2,_0x4bd183,_0x431baa){return new BPromise(function(_0x5530bc,_0x2b909a){return client[_0x04c6('0xb')](_0x161fe2,_0x431baa)[_0x04c6('0xc')](function(_0x2e7d98){logger[_0x04c6('0xd')](_0x04c6('0xe'),_0x4bd183,'request\x20sent');logger[_0x04c6('0xf')](_0x04c6('0x10'),_0x4bd183,_0x04c6('0x11'),JSON[_0x04c6('0x12')](_0x2e7d98));if(_0x2e7d98[_0x04c6('0x13')]){if(_0x2e7d98[_0x04c6('0x13')][_0x04c6('0x14')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x4bd183,_0x2e7d98[_0x04c6('0x13')][_0x04c6('0x15')]);return _0x2b909a(_0x2e7d98[_0x04c6('0x13')][_0x04c6('0x15')]);}logger[_0x04c6('0x13')](_0x04c6('0xe'),_0x4bd183,_0x2e7d98[_0x04c6('0x13')][_0x04c6('0x15')]);return _0x5530bc(_0x2e7d98[_0x04c6('0x13')]['message']);}else{logger[_0x04c6('0xd')](_0x04c6('0xe'),_0x4bd183,_0x04c6('0x11'));_0x5530bc(_0x2e7d98[_0x04c6('0x16')][_0x04c6('0x15')]);}})['catch'](function(_0x209b90){logger[_0x04c6('0x13')]('Cdr,\x20%s,\x20%s',_0x4bd183,_0x209b90);_0x2b909a(_0x209b90);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 6ee6881..1f150b7 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 _0x5219=['show','post','put','/:id','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./cdr.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5219,0x138));var _0x9521=function(_0x1a6453,_0x464e3c){_0x1a6453=_0x1a6453-0x0;var _0x593b00=_0x5219[_0x1a6453];return _0x593b00;};'use strict';var multer=require(_0x9521('0x0'));var util=require('util');var path=require(_0x9521('0x1'));var timeout=require('connect-timeout');var express=require(_0x9521('0x2'));var router=express['Router']();var auth=require(_0x9521('0x3'));var interaction=require(_0x9521('0x4'));var config=require('../../config/environment');var controller=require(_0x9521('0x5'));router['get']('/',auth[_0x9521('0x6')](),controller[_0x9521('0x7')]);router[_0x9521('0x8')](_0x9521('0x9'),auth[_0x9521('0x6')](),controller[_0x9521('0xa')]);router[_0x9521('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9521('0xb')]);router[_0x9521('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9521('0xd')](_0x9521('0xe'),auth['isAuthenticated'](),controller[_0x9521('0xf')]);router[_0x9521('0x10')](_0x9521('0xe'),auth[_0x9521('0x6')](),controller[_0x9521('0x11')]);module[_0x9521('0x12')]=router; \ No newline at end of file +var _0x4ff0=['index','get','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cdr.controller','isAuthenticated'];(function(_0x4f32e7,_0x48ce18){var _0xbb8e09=function(_0x1cd071){while(--_0x1cd071){_0x4f32e7['push'](_0x4f32e7['shift']());}};_0xbb8e09(++_0x48ce18);}(_0x4ff0,0xe7));var _0x04ff=function(_0xf067c6,_0x4f9076){_0xf067c6=_0xf067c6-0x0;var _0x1ef3fd=_0x4ff0[_0xf067c6];return _0x1ef3fd;};'use strict';var multer=require(_0x04ff('0x0'));var util=require(_0x04ff('0x1'));var path=require(_0x04ff('0x2'));var timeout=require(_0x04ff('0x3'));var express=require(_0x04ff('0x4'));var router=express[_0x04ff('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x04ff('0x6'));var config=require('../../config/environment');var controller=require(_0x04ff('0x7'));router['get']('/',auth[_0x04ff('0x8')](),controller[_0x04ff('0x9')]);router[_0x04ff('0xa')](_0x04ff('0xb'),auth['isAuthenticated'](),controller[_0x04ff('0xc')]);router[_0x04ff('0xa')](_0x04ff('0xd'),auth[_0x04ff('0x8')](),controller[_0x04ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x04ff('0xf')]);router[_0x04ff('0x10')]('/:id',auth[_0x04ff('0x8')](),controller['update']);router[_0x04ff('0x11')](_0x04ff('0xd'),auth[_0x04ff('0x8')](),controller[_0x04ff('0x12')]);module[_0x04ff('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 d79e97f..29e5efb 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 _0x0d63=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x52b33d,_0x5ad450){var _0x2cedf6=function(_0x2e30f9){while(--_0x2e30f9){_0x52b33d['push'](_0x52b33d['shift']());}};_0x2cedf6(++_0x5ad450);}(_0x0d63,0x1de));var _0x30d6=function(_0x34bff6,_0x36f01d){_0x34bff6=_0x34bff6-0x0;var _0x2704ee=_0x0d63[_0x34bff6];return _0x2704ee;};'use strict';var Sequelize=require(_0x30d6('0x0'));module[_0x30d6('0x1')]={'priority':{'type':Sequelize[_0x30d6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x30d6('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x30d6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x30d6('0x3')],'defaultValue':_0x30d6('0x5')}}; \ No newline at end of file +var _0x8e23=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x129f74,_0x3d64d8){var _0x1cf683=function(_0x232179){while(--_0x232179){_0x129f74['push'](_0x129f74['shift']());}};_0x1cf683(++_0x3d64d8);}(_0x8e23,0x101));var _0x38e2=function(_0x2b3c2e,_0x1358c9){_0x2b3c2e=_0x2b3c2e-0x0;var _0x40f3e1=_0x8e23[_0x2b3c2e];return _0x40f3e1;};'use strict';var Sequelize=require(_0x38e2('0x0'));module[_0x38e2('0x1')]={'priority':{'type':Sequelize[_0x38e2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x38e2('0x3')],'allowNull':![],'defaultValue':_0x38e2('0x4')},'appdata':{'type':Sequelize[_0x38e2('0x5')]()},'description':{'type':Sequelize[_0x38e2('0x3')]},'interval':{'type':Sequelize[_0x38e2('0x3')],'defaultValue':_0x38e2('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 464e2e6..fd6bfc6 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 _0xe529=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','stack','name','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','options','find','catch','body','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x50d235,_0x5633de){var _0x2b2f29=function(_0x32e0b1){while(--_0x32e0b1){_0x50d235['push'](_0x50d235['shift']());}};_0x2b2f29(++_0x5633de);}(_0xe529,0xe0));var _0x9e52=function(_0x188917,_0x1ec7cf){_0x188917=_0x188917-0x0;var _0x4ff346=_0xe529[_0x188917];return _0x4ff346;};'use strict';var pdf=require(_0x9e52('0x0'));var emlformat=require(_0x9e52('0x1'));var rimraf=require(_0x9e52('0x2'));var zipdir=require(_0x9e52('0x3'));var jsonpatch=require(_0x9e52('0x4'));var rp=require('request-promise');var moment=require(_0x9e52('0x5'));var BPromise=require(_0x9e52('0x6'));var Mustache=require(_0x9e52('0x7'));var util=require(_0x9e52('0x8'));var path=require(_0x9e52('0x9'));var sox=require(_0x9e52('0xa'));var csv=require(_0x9e52('0xb'));var ejs=require(_0x9e52('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9e52('0xd'));var crypto=require(_0x9e52('0xe'));var jsforce=require(_0x9e52('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9e52('0xb'));var querystring=require('querystring');var Papa=require(_0x9e52('0x10'));var Redis=require(_0x9e52('0x11'));var authService=require(_0x9e52('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9e52('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e52('0x14'))(_0x9e52('0x15'));var utils=require('../../config/utils');var config=require(_0x9e52('0x16'));var db=require(_0x9e52('0x17'))['db'];function respondWithStatusCode(_0x4bf4c4,_0x4af930){_0x4af930=_0x4af930||0xcc;return function(_0x4782fc){if(_0x4782fc){return _0x4bf4c4[_0x9e52('0x18')](_0x4af930);}return _0x4bf4c4['status'](_0x4af930)[_0x9e52('0x19')]();};}function respondWithResult(_0x567ec4,_0x4b554c){_0x4b554c=_0x4b554c||0xc8;return function(_0x5c76e5){if(_0x5c76e5){return _0x567ec4[_0x9e52('0x1a')](_0x4b554c)['json'](_0x5c76e5);}};}function respondWithFilteredResult(_0x3969ba,_0x26907e){return function(_0x4b4612){if(_0x4b4612){var _0x1d41d3=_0x4b4612[_0x9e52('0x1b')],_0x272edd=_0x26907e[_0x9e52('0x1c')],_0x59feef=_0x26907e[_0x9e52('0x1c')]+_0x26907e[_0x9e52('0x1d')],_0x5cc25d;if(_0x59feef>=_0x1d41d3){_0x59feef=_0x1d41d3;_0x5cc25d=0xc8;}else{_0x5cc25d=0xce;}_0x3969ba['status'](_0x5cc25d);return _0x3969ba['set'](_0x9e52('0x1e'),_0x272edd+'-'+_0x59feef+'/'+_0x1d41d3)[_0x9e52('0x1f')](_0x4b4612);}return null;};}function patchUpdates(_0x1fb20a){return function(_0x104a90){try{jsonpatch[_0x9e52('0x20')](_0x104a90,_0x1fb20a,!![]);}catch(_0x4c2247){return BPromise['reject'](_0x4c2247);}return _0x104a90[_0x9e52('0x21')]();};}function saveUpdates(_0x10b56b,_0x3589fb){return function(_0x11c853){if(_0x11c853){return _0x11c853[_0x9e52('0x22')](_0x10b56b)[_0x9e52('0x23')](function(_0x51b8f9){return _0x51b8f9;});}return null;};}function removeEntity(_0x7972d5,_0x230861){return function(_0x1a8786){if(_0x1a8786){return _0x1a8786[_0x9e52('0x24')]()['then'](function(){_0x7972d5['status'](0xcc)[_0x9e52('0x19')]();});}};}function handleEntityNotFound(_0x572f4e,_0x27bde8){return function(_0x2fbb97){if(!_0x2fbb97){_0x572f4e[_0x9e52('0x18')](0x194);}return _0x2fbb97;};}function handleError(_0x277a6f,_0xf28a36){_0xf28a36=_0xf28a36||0x1f4;return function(_0x578c43){logger['error'](_0x578c43[_0x9e52('0x25')]);if(_0x578c43[_0x9e52('0x26')]){delete _0x578c43[_0x9e52('0x26')];}_0x277a6f[_0x9e52('0x1a')](_0xf28a36)['send'](_0x578c43);};}exports[_0x9e52('0x27')]=function(_0x484691,_0x56817b){var _0x25eff5={'raw':!![],'where':{'id':_0x484691[_0x9e52('0x28')]['id']}},_0x2cb82d={};_0x2cb82d['model']=_[_0x9e52('0x29')](db[_0x9e52('0x2a')][_0x9e52('0x2b')]);_0x2cb82d['query']=_['keys'](_0x484691[_0x9e52('0x2c')]);_0x2cb82d[_0x9e52('0x2d')]=_[_0x9e52('0x2e')](_0x2cb82d['model'],_0x2cb82d['query']);_0x25eff5[_0x9e52('0x2f')]=_[_0x9e52('0x2e')](_0x2cb82d[_0x9e52('0x30')],qs[_0x9e52('0x31')](_0x484691[_0x9e52('0x2c')][_0x9e52('0x31')]));_0x25eff5[_0x9e52('0x2f')]=_0x25eff5[_0x9e52('0x2f')][_0x9e52('0x32')]?_0x25eff5[_0x9e52('0x2f')]:_0x2cb82d['model'];if(_0x484691['query'][_0x9e52('0x33')]){_0x25eff5[_0x9e52('0x34')]=[{'all':!![]}];}_0x25eff5=_['merge']({},_0x25eff5,_0x484691[_0x9e52('0x35')]);return db['ChatApplication'][_0x9e52('0x36')](_0x25eff5)[_0x9e52('0x23')](handleEntityNotFound(_0x56817b,null))[_0x9e52('0x23')](respondWithResult(_0x56817b,null))[_0x9e52('0x37')](handleError(_0x56817b,null));};exports[_0x9e52('0x22')]=function(_0x46b672,_0x23ff0a){if(_0x46b672['body']['id']){delete _0x46b672[_0x9e52('0x38')]['id'];}return db['ChatApplication'][_0x9e52('0x36')]({'where':{'id':_0x46b672[_0x9e52('0x28')]['id']}})['then'](handleEntityNotFound(_0x23ff0a,null))[_0x9e52('0x23')](saveUpdates(_0x46b672['body'],null))[_0x9e52('0x23')](respondWithResult(_0x23ff0a,null))['catch'](handleError(_0x23ff0a,null));};exports[_0x9e52('0x24')]=function(_0x1ee130,_0x1e4500){return db[_0x9e52('0x2a')][_0x9e52('0x36')]({'where':{'id':_0x1ee130[_0x9e52('0x28')]['id']}})[_0x9e52('0x23')](handleEntityNotFound(_0x1e4500,null))['then'](removeEntity(_0x1e4500,null))[_0x9e52('0x37')](handleError(_0x1e4500,null));}; \ No newline at end of file +var _0x8fc9=['status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','keys','ChatApplication','rawAttributes','query','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8fc9,0x15e));var _0x98fc=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x8fc9[_0x14a0a0];return _0x56b651;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x98fc('0x0'));var rimraf=require(_0x98fc('0x1'));var zipdir=require(_0x98fc('0x2'));var jsonpatch=require(_0x98fc('0x3'));var rp=require(_0x98fc('0x4'));var moment=require(_0x98fc('0x5'));var BPromise=require(_0x98fc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x98fc('0x7'));var ejs=require(_0x98fc('0x8'));var fs=require('fs');var _=require(_0x98fc('0x9'));var squel=require(_0x98fc('0xa'));var crypto=require(_0x98fc('0xb'));var jsforce=require(_0x98fc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x98fc('0x7'));var querystring=require(_0x98fc('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98fc('0xe'));var qs=require(_0x98fc('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98fc('0x10'));var logger=require('../../config/logger')(_0x98fc('0x11'));var utils=require(_0x98fc('0x12'));var config=require('../../config/environment');var db=require(_0x98fc('0x13'))['db'];function respondWithStatusCode(_0x50add2,_0x2bf0dd){_0x2bf0dd=_0x2bf0dd||0xcc;return function(_0x23f851){if(_0x23f851){return _0x50add2[_0x98fc('0x14')](_0x2bf0dd);}return _0x50add2[_0x98fc('0x15')](_0x2bf0dd)['end']();};}function respondWithResult(_0x13db2e,_0x667d90){_0x667d90=_0x667d90||0xc8;return function(_0x536b65){if(_0x536b65){return _0x13db2e['status'](_0x667d90)[_0x98fc('0x16')](_0x536b65);}};}function respondWithFilteredResult(_0x29606c,_0x32f421){return function(_0x3cfb45){if(_0x3cfb45){var _0x2372d2=_0x3cfb45['count'],_0x5a7bb7=_0x32f421['offset'],_0x4d9424=_0x32f421[_0x98fc('0x17')]+_0x32f421[_0x98fc('0x18')],_0x457142;if(_0x4d9424>=_0x2372d2){_0x4d9424=_0x2372d2;_0x457142=0xc8;}else{_0x457142=0xce;}_0x29606c[_0x98fc('0x15')](_0x457142);return _0x29606c[_0x98fc('0x19')](_0x98fc('0x1a'),_0x5a7bb7+'-'+_0x4d9424+'/'+_0x2372d2)[_0x98fc('0x16')](_0x3cfb45);}return null;};}function patchUpdates(_0x7c227d){return function(_0x2dd89d){try{jsonpatch[_0x98fc('0x1b')](_0x2dd89d,_0x7c227d,!![]);}catch(_0x26b35e){return BPromise[_0x98fc('0x1c')](_0x26b35e);}return _0x2dd89d[_0x98fc('0x1d')]();};}function saveUpdates(_0x2b3fd2,_0x134a11){return function(_0x31aa0e){if(_0x31aa0e){return _0x31aa0e[_0x98fc('0x1e')](_0x2b3fd2)[_0x98fc('0x1f')](function(_0x7e1891){return _0x7e1891;});}return null;};}function removeEntity(_0x123b86,_0xb48011){return function(_0xfb5014){if(_0xfb5014){return _0xfb5014['destroy']()[_0x98fc('0x1f')](function(){_0x123b86[_0x98fc('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a20ad,_0x472a9f){return function(_0xea061b){if(!_0xea061b){_0x1a20ad[_0x98fc('0x14')](0x194);}return _0xea061b;};}function handleError(_0x208683,_0x3788d0){_0x3788d0=_0x3788d0||0x1f4;return function(_0xd93758){logger[_0x98fc('0x20')](_0xd93758[_0x98fc('0x21')]);if(_0xd93758[_0x98fc('0x22')]){delete _0xd93758[_0x98fc('0x22')];}_0x208683[_0x98fc('0x15')](_0x3788d0)[_0x98fc('0x23')](_0xd93758);};}exports[_0x98fc('0x24')]=function(_0x50e942,_0x39c665){var _0x3afb20={'raw':!![],'where':{'id':_0x50e942['params']['id']}},_0x5bef13={};_0x5bef13['model']=_[_0x98fc('0x25')](db[_0x98fc('0x26')][_0x98fc('0x27')]);_0x5bef13[_0x98fc('0x28')]=_[_0x98fc('0x25')](_0x50e942[_0x98fc('0x28')]);_0x5bef13['filters']=_[_0x98fc('0x29')](_0x5bef13[_0x98fc('0x2a')],_0x5bef13['query']);_0x3afb20['attributes']=_[_0x98fc('0x29')](_0x5bef13['model'],qs[_0x98fc('0x2b')](_0x50e942[_0x98fc('0x28')][_0x98fc('0x2b')]));_0x3afb20[_0x98fc('0x2c')]=_0x3afb20[_0x98fc('0x2c')]['length']?_0x3afb20['attributes']:_0x5bef13[_0x98fc('0x2a')];if(_0x50e942[_0x98fc('0x28')][_0x98fc('0x2d')]){_0x3afb20[_0x98fc('0x2e')]=[{'all':!![]}];}_0x3afb20=_['merge']({},_0x3afb20,_0x50e942[_0x98fc('0x2f')]);return db[_0x98fc('0x26')][_0x98fc('0x30')](_0x3afb20)[_0x98fc('0x1f')](handleEntityNotFound(_0x39c665,null))[_0x98fc('0x1f')](respondWithResult(_0x39c665,null))[_0x98fc('0x31')](handleError(_0x39c665,null));};exports['update']=function(_0x593969,_0x55d086){if(_0x593969[_0x98fc('0x32')]['id']){delete _0x593969[_0x98fc('0x32')]['id'];}return db[_0x98fc('0x26')]['find']({'where':{'id':_0x593969[_0x98fc('0x33')]['id']}})['then'](handleEntityNotFound(_0x55d086,null))[_0x98fc('0x1f')](saveUpdates(_0x593969[_0x98fc('0x32')],null))['then'](respondWithResult(_0x55d086,null))[_0x98fc('0x31')](handleError(_0x55d086,null));};exports[_0x98fc('0x34')]=function(_0x41b635,_0x26e716){return db['ChatApplication'][_0x98fc('0x30')]({'where':{'id':_0x41b635[_0x98fc('0x33')]['id']}})[_0x98fc('0x1f')](handleEntityNotFound(_0x26e716,null))[_0x98fc('0x1f')](removeEntity(_0x26e716,null))[_0x98fc('0x31')](handleError(_0x26e716,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index cbf3abe..63b7ead 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5e0f2d5..68f3e49 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 _0x9522=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','debug','stringify','error','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x594b5b,_0x41f388){var _0x5c7e28=function(_0x37cd5e){while(--_0x37cd5e){_0x594b5b['push'](_0x594b5b['shift']());}};_0x5c7e28(++_0x41f388);}(_0x9522,0x13a));var _0x2952=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0x9522[_0x375325];return _0x228f57;};'use strict';var _=require(_0x2952('0x0'));var util=require(_0x2952('0x1'));var moment=require(_0x2952('0x2'));var BPromise=require(_0x2952('0x3'));var rs=require(_0x2952('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2952('0x5'))['db'];var utils=require(_0x2952('0x6'));var logger=require(_0x2952('0x7'))(_0x2952('0x8'));var config=require('../../config/environment');var jayson=require(_0x2952('0x9'));var client=jayson[_0x2952('0xa')][_0x2952('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa9cdb5,_0x131a0e,_0x53de53){return new BPromise(function(_0x4448db,_0x254aa3){return client['request'](_0xa9cdb5,_0x53de53)[_0x2952('0xc')](function(_0x5b75e5){logger['info']('ChatApplication,\x20%s,\x20%s',_0x131a0e,'request\x20sent');logger[_0x2952('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x131a0e,'request\x20sent',JSON[_0x2952('0xe')](_0x5b75e5));if(_0x5b75e5[_0x2952('0xf')]){if(_0x5b75e5[_0x2952('0xf')]['code']===0x1f4){logger[_0x2952('0xf')](_0x2952('0x10'),_0x131a0e,_0x5b75e5[_0x2952('0xf')][_0x2952('0x11')]);return _0x254aa3(_0x5b75e5[_0x2952('0xf')][_0x2952('0x11')]);}logger[_0x2952('0xf')](_0x2952('0x10'),_0x131a0e,_0x5b75e5[_0x2952('0xf')][_0x2952('0x11')]);return _0x4448db(_0x5b75e5[_0x2952('0xf')][_0x2952('0x11')]);}else{logger[_0x2952('0x12')]('ChatApplication,\x20%s,\x20%s',_0x131a0e,'request\x20sent');_0x4448db(_0x5b75e5[_0x2952('0x13')]['message']);}})[_0x2952('0x14')](function(_0x22981d){logger['error'](_0x2952('0x10'),_0x131a0e,_0x22981d);_0x254aa3(_0x22981d);});});} \ No newline at end of file +var _0x2690=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x2690,0xd0));var _0x0269=function(_0x24b245,_0x1b3508){_0x24b245=_0x24b245-0x0;var _0x56f828=_0x2690[_0x24b245];return _0x56f828;};'use strict';var _=require(_0x0269('0x0'));var util=require(_0x0269('0x1'));var moment=require(_0x0269('0x2'));var BPromise=require('bluebird');var rs=require(_0x0269('0x3'));var fs=require('fs');var Redis=require(_0x0269('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0269('0x5'));var logger=require(_0x0269('0x6'))(_0x0269('0x7'));var config=require(_0x0269('0x8'));var jayson=require(_0x0269('0x9'));var client=jayson[_0x0269('0xa')][_0x0269('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4670d0,_0x2b07d6,_0x4498cc){return new BPromise(function(_0x596139,_0x19a8f0){return client[_0x0269('0xc')](_0x4670d0,_0x4498cc)[_0x0269('0xd')](function(_0x8e0df2){logger[_0x0269('0xe')](_0x0269('0xf'),_0x2b07d6,_0x0269('0x10'));logger[_0x0269('0x11')](_0x0269('0x12'),_0x2b07d6,_0x0269('0x10'),JSON[_0x0269('0x13')](_0x8e0df2));if(_0x8e0df2[_0x0269('0x14')]){if(_0x8e0df2['error'][_0x0269('0x15')]===0x1f4){logger[_0x0269('0x14')](_0x0269('0xf'),_0x2b07d6,_0x8e0df2[_0x0269('0x14')]['message']);return _0x19a8f0(_0x8e0df2[_0x0269('0x14')]['message']);}logger[_0x0269('0x14')]('ChatApplication,\x20%s,\x20%s',_0x2b07d6,_0x8e0df2['error'][_0x0269('0x16')]);return _0x596139(_0x8e0df2[_0x0269('0x14')]['message']);}else{logger['info'](_0x0269('0xf'),_0x2b07d6,_0x0269('0x10'));_0x596139(_0x8e0df2[_0x0269('0x17')][_0x0269('0x16')]);}})[_0x0269('0x18')](function(_0xa1e025){logger[_0x0269('0x14')](_0x0269('0xf'),_0x2b07d6,_0xa1e025);_0x19a8f0(_0xa1e025);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 86db081..489e89f 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 _0x0e15=['Router','../../components/interaction/service','get','isAuthenticated','put','/:id','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x2a7066,_0x279e23){var _0x21814e=function(_0x3925a5){while(--_0x3925a5){_0x2a7066['push'](_0x2a7066['shift']());}};_0x21814e(++_0x279e23);}(_0x0e15,0xcc));var _0x50e1=function(_0x18565f,_0x101c2e){_0x18565f=_0x18565f-0x0;var _0x30929f=_0x0e15[_0x18565f];return _0x30929f;};'use strict';var multer=require(_0x50e1('0x0'));var util=require('util');var path=require(_0x50e1('0x1'));var timeout=require(_0x50e1('0x2'));var express=require(_0x50e1('0x3'));var router=express[_0x50e1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x50e1('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x50e1('0x6')]('/:id',auth[_0x50e1('0x7')](),controller['show']);router[_0x50e1('0x8')](_0x50e1('0x9'),auth[_0x50e1('0x7')](),controller[_0x50e1('0xa')]);router[_0x50e1('0xb')](_0x50e1('0x9'),auth[_0x50e1('0x7')](),controller[_0x50e1('0xc')]);module['exports']=router; \ No newline at end of file +var _0x2e94=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports'];(function(_0x38576d,_0x527dc7){var _0x32534a=function(_0x2fd590){while(--_0x2fd590){_0x38576d['push'](_0x38576d['shift']());}};_0x32534a(++_0x527dc7);}(_0x2e94,0x170));var _0x42e9=function(_0x1ae608,_0x4732eb){_0x1ae608=_0x1ae608-0x0;var _0x38b314=_0x2e94[_0x1ae608];return _0x38b314;};'use strict';var multer=require(_0x42e9('0x0'));var util=require(_0x42e9('0x1'));var path=require(_0x42e9('0x2'));var timeout=require(_0x42e9('0x3'));var express=require(_0x42e9('0x4'));var router=express[_0x42e9('0x5')]();var auth=require(_0x42e9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x42e9('0x7'));var controller=require(_0x42e9('0x8'));router['get'](_0x42e9('0x9'),auth[_0x42e9('0xa')](),controller[_0x42e9('0xb')]);router[_0x42e9('0xc')](_0x42e9('0x9'),auth[_0x42e9('0xa')](),controller[_0x42e9('0xd')]);router[_0x42e9('0xe')](_0x42e9('0x9'),auth[_0x42e9('0xa')](),controller['destroy']);module[_0x42e9('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6c4fe4f..4ae3d10 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 _0x107f=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5036fd,_0x587df8){var _0x7f20ee=function(_0x1a5fe6){while(--_0x1a5fe6){_0x5036fd['push'](_0x5036fd['shift']());}};_0x7f20ee(++_0x587df8);}(_0x107f,0xb1));var _0xf107=function(_0x30f76e,_0x4f5665){_0x30f76e=_0x30f76e-0x0;var _0x12267c=_0x107f[_0x30f76e];return _0x12267c;};'use strict';var Sequelize=require(_0xf107('0x0'));module[_0xf107('0x1')]={'name':{'type':Sequelize[_0xf107('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xf107('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x545a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x47af66,_0xe6aafd){var _0x516e95=function(_0x237747){while(--_0x237747){_0x47af66['push'](_0x47af66['shift']());}};_0x516e95(++_0xe6aafd);}(_0x545a,0x126));var _0xa545=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x545a[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0xa545('0x0'));module[_0xa545('0x1')]={'name':{'type':Sequelize[_0xa545('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa545('0x2')]},'write':{'type':Sequelize[_0xa545('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3dba499..0f9015f 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 _0x2641=['destroy','end','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','addMessage','getMessages','$gte','split','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','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x2641,0x174));var _0x1264=function(_0x6323e2,_0x314096){_0x6323e2=_0x6323e2-0x0;var _0x3a37f3=_0x2641[_0x6323e2];return _0x3a37f3;};'use strict';var pdf=require(_0x1264('0x0'));var emlformat=require(_0x1264('0x1'));var rimraf=require(_0x1264('0x2'));var zipdir=require(_0x1264('0x3'));var jsonpatch=require(_0x1264('0x4'));var rp=require(_0x1264('0x5'));var moment=require(_0x1264('0x6'));var BPromise=require(_0x1264('0x7'));var Mustache=require('mustache');var util=require(_0x1264('0x8'));var path=require(_0x1264('0x9'));var sox=require(_0x1264('0xa'));var csv=require(_0x1264('0xb'));var ejs=require(_0x1264('0xc'));var fs=require('fs');var _=require(_0x1264('0xd'));var squel=require(_0x1264('0xe'));var crypto=require(_0x1264('0xf'));var jsforce=require(_0x1264('0x10'));var deskjs=require(_0x1264('0x11'));var toCsv=require(_0x1264('0xb'));var querystring=require(_0x1264('0x12'));var Papa=require(_0x1264('0x13'));var Redis=require('ioredis');var authService=require(_0x1264('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1264('0x15'));var hardwareService=require(_0x1264('0x16'));var logger=require(_0x1264('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1264('0x18'))['db'];config[_0x1264('0x19')]=_['defaults'](config[_0x1264('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1264('0x1a'))(new Redis(config[_0x1264('0x19')]));require('./chatGroup.socket')[_0x1264('0x1b')](socket);var jayson=require(_0x1264('0x1c'));var client=jayson[_0x1264('0x1d')][_0x1264('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x5e69bf,_0x2113bb,_0x1eed77){if(_0x1eed77){var _0x37b3ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37b3ab['test'](_0x2113bb)){return _0x5e69bf;}else{throw new db[(_0x1264('0x1f'))][(_0x1264('0x20'))](_0x1264('0x21'));}}else{return _0x5e69bf;}}function respondWithRpcPromise(_0x58e91d,_0x9ab669,_0x376302,_0x5b92fc){return new BPromise(function(_0x36ccf2,_0x59f297){var _0x40b8fd=_0x5b92fc||client;return _0x40b8fd[_0x1264('0x22')](_0x58e91d,_0x376302)[_0x1264('0x23')](function(_0x238840){logger[_0x1264('0x24')]('ChatGroup,\x20%s,\x20%s',_0x9ab669,_0x1264('0x25'));logger[_0x1264('0x26')](_0x1264('0x27'),_0x9ab669,_0x1264('0x25'),JSON[_0x1264('0x28')](_0x238840));if(_0x238840[_0x1264('0x29')]){if(_0x238840[_0x1264('0x29')]['code']===0x1f4){logger[_0x1264('0x29')](_0x1264('0x2a'),_0x9ab669,_0x238840[_0x1264('0x29')][_0x1264('0x2b')]);return _0x59f297(_0x238840[_0x1264('0x29')][_0x1264('0x2b')]);}logger[_0x1264('0x29')]('ChatGroup,\x20%s,\x20%s',_0x9ab669,_0x238840['error'][_0x1264('0x2b')]);return _0x36ccf2(_0x238840[_0x1264('0x29')][_0x1264('0x2b')]);}else{logger[_0x1264('0x24')](_0x1264('0x2a'),_0x9ab669,'request\x20sent');_0x36ccf2(_0x238840['result']['message']);}})[_0x1264('0x2c')](function(_0x1ca041){logger['error'](_0x1264('0x2a'),_0x9ab669,_0x1ca041);_0x59f297(_0x1ca041);});});}function respondWithStatusCode(_0x341bc6,_0x14f582){_0x14f582=_0x14f582||0xcc;return function(_0x4ab07a){if(_0x4ab07a){return _0x341bc6['sendStatus'](_0x14f582);}return _0x341bc6[_0x1264('0x2d')](_0x14f582)['end']();};}function respondWithResult(_0x141425,_0x458420){_0x458420=_0x458420||0xc8;return function(_0x3bb5de){if(_0x3bb5de){return _0x141425['status'](_0x458420)[_0x1264('0x2e')](_0x3bb5de);}};}function respondWithFilteredResult(_0x3ef484,_0x1413ce){return function(_0x412a5f){if(_0x412a5f){var _0x8642b1=_0x412a5f[_0x1264('0x2f')],_0x50fca4=_0x1413ce[_0x1264('0x30')],_0x4fdd81=_0x1413ce[_0x1264('0x30')]+_0x1413ce[_0x1264('0x31')],_0x1ae881;if(_0x4fdd81>=_0x8642b1){_0x4fdd81=_0x8642b1;_0x1ae881=0xc8;}else{_0x1ae881=0xce;}_0x3ef484['status'](_0x1ae881);return _0x3ef484[_0x1264('0x32')](_0x1264('0x33'),_0x50fca4+'-'+_0x4fdd81+'/'+_0x8642b1)[_0x1264('0x2e')](_0x412a5f);}return null;};}function patchUpdates(_0x3fc6e3){return function(_0x3b9863){try{jsonpatch[_0x1264('0x34')](_0x3b9863,_0x3fc6e3,!![]);}catch(_0x2e4046){return BPromise[_0x1264('0x35')](_0x2e4046);}return _0x3b9863[_0x1264('0x36')]();};}function saveUpdates(_0x1c50c9,_0x2aa14c){return function(_0x4c3895){if(_0x4c3895){return _0x4c3895[_0x1264('0x37')](_0x1c50c9)['then'](function(_0x4e01c4){return _0x4e01c4;});}return null;};}function removeEntity(_0x4ceabc,_0x42ad32){return function(_0x34cc3f){if(_0x34cc3f){return _0x34cc3f[_0x1264('0x38')]()['then'](function(){_0x4ceabc[_0x1264('0x2d')](0xcc)[_0x1264('0x39')]();});}};}function handleEntityNotFound(_0x5c55d8,_0x1d5ae7){return function(_0x2c4905){if(!_0x2c4905){_0x5c55d8['sendStatus'](0x194);}return _0x2c4905;};}function handleError(_0x102b7e,_0x435e89){_0x435e89=_0x435e89||0x1f4;return function(_0x5c525a){logger[_0x1264('0x29')](_0x5c525a['stack']);if(_0x5c525a[_0x1264('0x3a')]){delete _0x5c525a[_0x1264('0x3a')];}_0x102b7e['status'](_0x435e89)[_0x1264('0x3b')](_0x5c525a);};}exports[_0x1264('0x3c')]=function(_0x450491,_0x1d1d2a){var _0x250778={},_0x1c1c1c={},_0x1175de={'count':0x0,'rows':[]};var _0x5f3e89=_['map'](db[_0x1264('0x3d')][_0x1264('0x3e')],function(_0x50db01){return{'name':_0x50db01[_0x1264('0x3f')],'type':_0x50db01[_0x1264('0x40')][_0x1264('0x41')]};});_0x1c1c1c['model']=_[_0x1264('0x42')](_0x5f3e89,_0x1264('0x3a'));_0x1c1c1c[_0x1264('0x43')]=_[_0x1264('0x44')](_0x450491[_0x1264('0x43')]);_0x1c1c1c[_0x1264('0x45')]=_[_0x1264('0x46')](_0x1c1c1c[_0x1264('0x47')],_0x1c1c1c[_0x1264('0x43')]);_0x250778[_0x1264('0x48')]=_[_0x1264('0x46')](_0x1c1c1c[_0x1264('0x47')],qs[_0x1264('0x49')](_0x450491[_0x1264('0x43')]['fields']));_0x250778[_0x1264('0x48')]=_0x250778[_0x1264('0x48')]['length']?_0x250778[_0x1264('0x48')]:_0x1c1c1c[_0x1264('0x47')];if(!_0x450491[_0x1264('0x43')][_0x1264('0x4a')](_0x1264('0x4b'))){_0x250778[_0x1264('0x31')]=qs[_0x1264('0x31')](_0x450491[_0x1264('0x43')][_0x1264('0x31')]);_0x250778['offset']=qs['offset'](_0x450491['query']['offset']);}_0x250778[_0x1264('0x4c')]=qs[_0x1264('0x4d')](_0x450491['query'][_0x1264('0x4d')]);_0x250778[_0x1264('0x4e')]=qs[_0x1264('0x45')](_[_0x1264('0x4f')](_0x450491[_0x1264('0x43')],_0x1c1c1c[_0x1264('0x45')]));if(_0x450491[_0x1264('0x43')][_0x1264('0x50')]){_0x250778['where']=_[_0x1264('0x51')](_0x250778['where'],{'$or':_[_0x1264('0x42')](_0x5f3e89,function(_0x48a582){if(_0x48a582[_0x1264('0x40')]!==_0x1264('0x52')){var _0x320b1e={};_0x320b1e[_0x48a582[_0x1264('0x3a')]]={'$like':'%'+_0x450491['query'][_0x1264('0x50')]+'%'};return _0x320b1e;}})});}_0x250778=_[_0x1264('0x51')]({},_0x250778,_0x450491[_0x1264('0x53')]);var _0x58a53d={'where':_0x250778[_0x1264('0x4e')]};return db['ChatGroup'][_0x1264('0x2f')](_0x58a53d)[_0x1264('0x23')](function(_0x51cd17){_0x1175de[_0x1264('0x2f')]=_0x51cd17;if(_0x450491[_0x1264('0x43')][_0x1264('0x54')]){_0x250778[_0x1264('0x55')]=[{'all':!![]}];}return db[_0x1264('0x3d')][_0x1264('0x56')](_0x250778);})[_0x1264('0x23')](function(_0x4f8486){_0x1175de[_0x1264('0x57')]=_0x4f8486;return _0x1175de;})[_0x1264('0x23')](respondWithFilteredResult(_0x1d1d2a,_0x250778))['catch'](handleError(_0x1d1d2a,null));};exports['show']=function(_0x2fd0ad,_0x5583a5){var _0x2185fb={'raw':!![],'where':{'id':_0x2fd0ad['params']['id']}},_0x14c844={};_0x14c844[_0x1264('0x47')]=_['keys'](db[_0x1264('0x3d')][_0x1264('0x3e')]);_0x14c844[_0x1264('0x43')]=_[_0x1264('0x44')](_0x2fd0ad[_0x1264('0x43')]);_0x14c844[_0x1264('0x45')]=_[_0x1264('0x46')](_0x14c844[_0x1264('0x47')],_0x14c844[_0x1264('0x43')]);_0x2185fb[_0x1264('0x48')]=_['intersection'](_0x14c844[_0x1264('0x47')],qs[_0x1264('0x49')](_0x2fd0ad[_0x1264('0x43')][_0x1264('0x49')]));_0x2185fb[_0x1264('0x48')]=_0x2185fb[_0x1264('0x48')][_0x1264('0x58')]?_0x2185fb[_0x1264('0x48')]:_0x14c844[_0x1264('0x47')];if(_0x2fd0ad[_0x1264('0x43')][_0x1264('0x54')]){_0x2185fb[_0x1264('0x55')]=[{'all':!![]}];}_0x2185fb=_[_0x1264('0x51')]({},_0x2185fb,_0x2fd0ad[_0x1264('0x53')]);return db[_0x1264('0x3d')][_0x1264('0x59')](_0x2185fb)[_0x1264('0x23')](handleEntityNotFound(_0x5583a5,null))[_0x1264('0x23')](respondWithResult(_0x5583a5,null))['catch'](handleError(_0x5583a5,null));};exports[_0x1264('0x5a')]=function(_0x523ad4,_0x49a9a3){return db['ChatGroup'][_0x1264('0x5a')](_0x523ad4[_0x1264('0x5b')],{})[_0x1264('0x23')](respondWithResult(_0x49a9a3,0xc9))[_0x1264('0x2c')](handleError(_0x49a9a3,null));};exports[_0x1264('0x37')]=function(_0x752824,_0x56cc7f){if(_0x752824['body']['id']){delete _0x752824['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x752824[_0x1264('0x5c')]['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x56cc7f,null))['then'](saveUpdates(_0x752824[_0x1264('0x5b')],null))[_0x1264('0x23')](respondWithResult(_0x56cc7f,null))[_0x1264('0x2c')](handleError(_0x56cc7f,null));};exports[_0x1264('0x38')]=function(_0x388804,_0x3e185a){return db['ChatGroup'][_0x1264('0x59')]({'where':{'id':_0x388804[_0x1264('0x5c')]['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x3e185a,null))[_0x1264('0x23')](removeEntity(_0x3e185a,null))[_0x1264('0x2c')](handleError(_0x3e185a,null));};exports['describe']=function(_0xb805ab,_0xd9a57e){return db['ChatGroup'][_0x1264('0x5d')]()['then'](respondWithResult(_0xd9a57e,null))['catch'](handleError(_0xd9a57e,null));};exports['getUnread']=function(_0x3fe0d0,_0x425953,_0x24a401){return db[_0x1264('0x5e')][_0x1264('0x2f')]({'where':{'ChatGroupId':_0x3fe0d0['params']['id'],'ToId':_0x3fe0d0[_0x1264('0x5f')]['id'],'read':![]}})[_0x1264('0x23')](function(_0x4e669f){return{'id':_[_0x1264('0x60')](_0x3fe0d0[_0x1264('0x5c')]['id']),'count':_0x4e669f};})[_0x1264('0x23')](respondWithResult(_0x425953,null))[_0x1264('0x2c')](handleError(_0x425953,null));};exports[_0x1264('0x61')]=function(_0x4657b2,_0x2dbc47,_0x4d4ac1){return db[_0x1264('0x3d')][_0x1264('0x59')]({'where':{'id':_0x4657b2[_0x1264('0x5c')]['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x2dbc47,null))['then'](function(_0x46d642){if(_0x46d642){return _0x46d642[_0x1264('0x61')](_0x4657b2[_0x1264('0x5b')][_0x1264('0x62')],_[_0x1264('0x63')](_0x4657b2[_0x1264('0x5b')],[_0x1264('0x62'),'id'])||{});}})[_0x1264('0x23')](respondWithResult(_0x2dbc47,null))[_0x1264('0x2c')](handleError(_0x2dbc47,null));};exports['getMembers']=function(_0x2cce8b,_0x33ddb7,_0x18a253){var _0x362015={};var _0x4fd3ab={};var _0x48b693;var _0xcb7293;return db['ChatGroup'][_0x1264('0x64')]({'where':{'id':_0x2cce8b[_0x1264('0x5c')]['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x33ddb7,null))[_0x1264('0x23')](function(_0x4fccb4){if(_0x4fccb4){_0x48b693=_0x4fccb4;_0x4fd3ab[_0x1264('0x47')]=_[_0x1264('0x44')](db[_0x1264('0x65')]['rawAttributes']);_0x4fd3ab['query']=_[_0x1264('0x44')](_0x2cce8b['query']);_0x4fd3ab[_0x1264('0x45')]=_[_0x1264('0x46')](_0x4fd3ab[_0x1264('0x47')],_0x4fd3ab['query']);_0x362015[_0x1264('0x48')]=_[_0x1264('0x46')](_0x4fd3ab[_0x1264('0x47')],qs[_0x1264('0x49')](_0x2cce8b[_0x1264('0x43')][_0x1264('0x49')]));_0x362015[_0x1264('0x48')]=_0x362015[_0x1264('0x48')][_0x1264('0x58')]?_0x362015['attributes']:_0x4fd3ab[_0x1264('0x47')];_0x362015[_0x1264('0x4c')]=qs['sort'](_0x2cce8b['query'][_0x1264('0x4d')]);_0x362015[_0x1264('0x4e')]=qs[_0x1264('0x45')](_[_0x1264('0x4f')](_0x2cce8b[_0x1264('0x43')],_0x4fd3ab['filters']));if(_0x2cce8b[_0x1264('0x43')]['filter']){_0x362015[_0x1264('0x4e')]=_['merge'](_0x362015[_0x1264('0x4e')],{'$or':_[_0x1264('0x42')](_0x362015[_0x1264('0x48')],function(_0x42de23){var _0x24624b={};_0x24624b[_0x42de23]={'$like':'%'+_0x2cce8b[_0x1264('0x43')][_0x1264('0x50')]+'%'};return _0x24624b;})});}_0x362015=_[_0x1264('0x51')]({},_0x362015,_0x2cce8b[_0x1264('0x53')]);return _0x48b693[_0x1264('0x66')](_0x362015);}})[_0x1264('0x23')](function(_0x373150){if(_0x373150){_0xcb7293=_0x373150['length'];if(!_0x2cce8b[_0x1264('0x43')][_0x1264('0x4a')](_0x1264('0x4b'))){_0x362015['limit']=qs[_0x1264('0x31')](_0x2cce8b[_0x1264('0x43')][_0x1264('0x31')]);_0x362015['offset']=qs[_0x1264('0x30')](_0x2cce8b[_0x1264('0x43')][_0x1264('0x30')]);}return _0x48b693[_0x1264('0x66')](_0x362015);}})[_0x1264('0x23')](function(_0x12f1e9){if(_0x12f1e9){return _0x12f1e9?{'count':_0xcb7293,'rows':_0x12f1e9}:null;}})[_0x1264('0x23')](respondWithResult(_0x33ddb7,null))[_0x1264('0x2c')](handleError(_0x33ddb7,null));};exports['removeMembers']=function(_0x1a7200,_0x363bc7,_0x3349e5){return db[_0x1264('0x3d')]['find']({'where':{'id':_0x1a7200[_0x1264('0x5c')]['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x363bc7,null))[_0x1264('0x23')](function(_0x25f057){if(_0x25f057){return _0x25f057['removeMembers'](_0x1a7200['query'][_0x1264('0x62')]);}})[_0x1264('0x23')](respondWithStatusCode(_0x363bc7,null))[_0x1264('0x2c')](handleError(_0x363bc7,null));};exports[_0x1264('0x67')]=function(_0x4df983,_0x35b346,_0x365432){if(_0x4df983[_0x1264('0x5b')]['id']){delete _0x4df983[_0x1264('0x5b')]['id'];}return db['ChatGroup'][_0x1264('0x59')]({'where':{'id':_0x4df983[_0x1264('0x5c')]['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x35b346,null))[_0x1264('0x23')](function(_0x282424){if(_0x282424){_0x4df983[_0x1264('0x5b')]['ChatGroupId']=_0x282424['id'];return db['ChatInternalMessage'][_0x1264('0x5a')](_0x4df983[_0x1264('0x5b')]);}})['then'](respondWithResult(_0x35b346,null))[_0x1264('0x2c')](handleError(_0x35b346,null));};exports[_0x1264('0x68')]=function(_0x5286d2,_0x4f987f,_0x1b9227){var _0x44a948={};var _0x72d1d7={};var _0x2339c4;var _0x2a251d;return db['ChatGroup']['findOne']({'where':{'id':_0x5286d2['params']['id']}})[_0x1264('0x23')](handleEntityNotFound(_0x4f987f,null))['then'](function(_0x3a27b6){if(_0x3a27b6){_0x2339c4=_0x3a27b6;_0x72d1d7[_0x1264('0x47')]=_[_0x1264('0x44')](db[_0x1264('0x5e')]['rawAttributes']);_0x72d1d7[_0x1264('0x43')]=_[_0x1264('0x44')](_0x5286d2['query']);_0x72d1d7[_0x1264('0x45')]=_['intersection'](_0x72d1d7[_0x1264('0x47')],_0x72d1d7['query']);_0x44a948[_0x1264('0x48')]=_[_0x1264('0x46')](_0x72d1d7[_0x1264('0x47')],qs[_0x1264('0x49')](_0x5286d2[_0x1264('0x43')]['fields']));_0x44a948[_0x1264('0x48')]=_0x44a948[_0x1264('0x48')][_0x1264('0x58')]?_0x44a948['attributes']:_0x72d1d7[_0x1264('0x47')];_0x44a948[_0x1264('0x4c')]=qs[_0x1264('0x4d')](_0x5286d2[_0x1264('0x43')][_0x1264('0x4d')]);_0x44a948[_0x1264('0x4e')]=qs['filters'](_[_0x1264('0x4f')](_0x5286d2[_0x1264('0x43')],_0x72d1d7[_0x1264('0x45')]));if(_0x5286d2[_0x1264('0x43')][_0x1264('0x50')]){_0x44a948[_0x1264('0x4e')]=_['merge'](_0x44a948[_0x1264('0x4e')],{'$or':_['map'](_0x44a948[_0x1264('0x48')],function(_0x243879){var _0x2f3d74={};_0x2f3d74[_0x243879]={'$like':'%'+_0x5286d2[_0x1264('0x43')]['filter']+'%'};return _0x2f3d74;})});}if(_0x5286d2[_0x1264('0x43')]['$gte']){var _0x36e792=_0x5286d2['query'][_0x1264('0x69')][_0x1264('0x6a')](',');var _0x490f0f={};_0x490f0f[_0x36e792[0x0]]={'$gte':moment(_0x36e792[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x44a948[_0x1264('0x4e')]=_['merge'](_0x44a948[_0x1264('0x4e')],_0x490f0f);}_0x44a948=_['merge']({},_0x44a948,_0x5286d2[_0x1264('0x53')]);return _0x2339c4['getMessages'](_0x44a948);}})['then'](function(_0xeeacca){if(_0xeeacca){_0x2a251d=_0xeeacca[_0x1264('0x58')];if(!_0x5286d2[_0x1264('0x43')][_0x1264('0x4a')](_0x1264('0x4b'))){_0x44a948[_0x1264('0x31')]=qs[_0x1264('0x31')](_0x5286d2[_0x1264('0x43')]['limit']);_0x44a948[_0x1264('0x30')]=qs[_0x1264('0x30')](_0x5286d2[_0x1264('0x43')][_0x1264('0x30')]);}return _0x2339c4['getMessages'](_0x44a948);}})[_0x1264('0x23')](function(_0x90bb4d){if(_0x90bb4d){return _0x90bb4d?{'count':_0x2a251d,'rows':_0x90bb4d}:null;}})[_0x1264('0x23')](respondWithResult(_0x4f987f,null))[_0x1264('0x2c')](handleError(_0x4f987f,null));}; \ No newline at end of file +var _0x4c70=['save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','ChatGroup','findAll','rows','show','keys','find','body','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','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','./chatGroup.socket','register','jayson/promise','http','test','Sequelize','ValidationError','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject'];(function(_0x2e132b,_0x1faa83){var _0x40849a=function(_0x2f93d3){while(--_0x2f93d3){_0x2e132b['push'](_0x2e132b['shift']());}};_0x40849a(++_0x1faa83);}(_0x4c70,0x18d));var _0x04c7=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0x4c70[_0x2f1172];return _0x58e374;};'use strict';var pdf=require(_0x04c7('0x0'));var emlformat=require(_0x04c7('0x1'));var rimraf=require(_0x04c7('0x2'));var zipdir=require(_0x04c7('0x3'));var jsonpatch=require(_0x04c7('0x4'));var rp=require(_0x04c7('0x5'));var moment=require(_0x04c7('0x6'));var BPromise=require(_0x04c7('0x7'));var Mustache=require('mustache');var util=require(_0x04c7('0x8'));var path=require('path');var sox=require(_0x04c7('0x9'));var csv=require('to-csv');var ejs=require(_0x04c7('0xa'));var fs=require('fs');var _=require(_0x04c7('0xb'));var squel=require(_0x04c7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x04c7('0xd'));var toCsv=require(_0x04c7('0xe'));var querystring=require(_0x04c7('0xf'));var Papa=require(_0x04c7('0x10'));var Redis=require(_0x04c7('0x11'));var authService=require(_0x04c7('0x12'));var qs=require(_0x04c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04c7('0x14'));var logger=require(_0x04c7('0x15'))(_0x04c7('0x16'));var utils=require(_0x04c7('0x17'));var config=require(_0x04c7('0x18'));var db=require(_0x04c7('0x19'))['db'];config[_0x04c7('0x1a')]=_[_0x04c7('0x1b')](config[_0x04c7('0x1a')],{'host':_0x04c7('0x1c'),'port':0x18eb});var socket=require(_0x04c7('0x1d'))(new Redis(config[_0x04c7('0x1a')]));require(_0x04c7('0x1e'))[_0x04c7('0x1f')](socket);var jayson=require(_0x04c7('0x20'));var client=jayson['client'][_0x04c7('0x21')]({'port':0x232a});function checkPasswordPattern(_0x2041d2,_0x2a3577,_0x589909){if(_0x589909){var _0x5afee6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5afee6[_0x04c7('0x22')](_0x2a3577)){return _0x2041d2;}else{throw new db[(_0x04c7('0x23'))][(_0x04c7('0x24'))]('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 _0x2041d2;}}function respondWithRpcPromise(_0x405d4e,_0x2b3dc6,_0x5b2efc,_0x5cdf6a){return new BPromise(function(_0x4fa4e8,_0x10c130){var _0x5c4342=_0x5cdf6a||client;return _0x5c4342[_0x04c7('0x25')](_0x405d4e,_0x5b2efc)[_0x04c7('0x26')](function(_0x5c246f){logger['info'](_0x04c7('0x27'),_0x2b3dc6,_0x04c7('0x28'));logger[_0x04c7('0x29')](_0x04c7('0x2a'),_0x2b3dc6,_0x04c7('0x28'),JSON[_0x04c7('0x2b')](_0x5c246f));if(_0x5c246f[_0x04c7('0x2c')]){if(_0x5c246f[_0x04c7('0x2c')][_0x04c7('0x2d')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2b3dc6,_0x5c246f['error'][_0x04c7('0x2e')]);return _0x10c130(_0x5c246f[_0x04c7('0x2c')][_0x04c7('0x2e')]);}logger[_0x04c7('0x2c')]('ChatGroup,\x20%s,\x20%s',_0x2b3dc6,_0x5c246f['error'][_0x04c7('0x2e')]);return _0x4fa4e8(_0x5c246f['error']['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x2b3dc6,'request\x20sent');_0x4fa4e8(_0x5c246f[_0x04c7('0x2f')][_0x04c7('0x2e')]);}})[_0x04c7('0x30')](function(_0x82384){logger[_0x04c7('0x2c')](_0x04c7('0x27'),_0x2b3dc6,_0x82384);_0x10c130(_0x82384);});});}function respondWithStatusCode(_0x5af6d2,_0x22a1fd){_0x22a1fd=_0x22a1fd||0xcc;return function(_0x2bb3e7){if(_0x2bb3e7){return _0x5af6d2[_0x04c7('0x31')](_0x22a1fd);}return _0x5af6d2['status'](_0x22a1fd)[_0x04c7('0x32')]();};}function respondWithResult(_0x1630b6,_0x2f1027){_0x2f1027=_0x2f1027||0xc8;return function(_0x508183){if(_0x508183){return _0x1630b6['status'](_0x2f1027)[_0x04c7('0x33')](_0x508183);}};}function respondWithFilteredResult(_0x2a958c,_0x38ae58){return function(_0x2f0a72){if(_0x2f0a72){var _0x7b9384=_0x2f0a72['count'],_0x5aeb3d=_0x38ae58[_0x04c7('0x34')],_0xd38fa5=_0x38ae58[_0x04c7('0x34')]+_0x38ae58[_0x04c7('0x35')],_0xe94578;if(_0xd38fa5>=_0x7b9384){_0xd38fa5=_0x7b9384;_0xe94578=0xc8;}else{_0xe94578=0xce;}_0x2a958c[_0x04c7('0x36')](_0xe94578);return _0x2a958c[_0x04c7('0x37')](_0x04c7('0x38'),_0x5aeb3d+'-'+_0xd38fa5+'/'+_0x7b9384)[_0x04c7('0x33')](_0x2f0a72);}return null;};}function patchUpdates(_0x1aaeb8){return function(_0x1a40fa){try{jsonpatch[_0x04c7('0x39')](_0x1a40fa,_0x1aaeb8,!![]);}catch(_0x20b68c){return BPromise[_0x04c7('0x3a')](_0x20b68c);}return _0x1a40fa[_0x04c7('0x3b')]();};}function saveUpdates(_0x55b5b3,_0x587593){return function(_0x272142){if(_0x272142){return _0x272142['update'](_0x55b5b3)[_0x04c7('0x26')](function(_0x3894f7){return _0x3894f7;});}return null;};}function removeEntity(_0x2464db,_0x19ffc5){return function(_0x1ccc09){if(_0x1ccc09){return _0x1ccc09[_0x04c7('0x3c')]()[_0x04c7('0x26')](function(){_0x2464db[_0x04c7('0x36')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e746,_0x1e042b){return function(_0x4cbbc2){if(!_0x4cbbc2){_0x59e746['sendStatus'](0x194);}return _0x4cbbc2;};}function handleError(_0x28180a,_0x429a3d){_0x429a3d=_0x429a3d||0x1f4;return function(_0x40fc33){logger[_0x04c7('0x2c')](_0x40fc33[_0x04c7('0x3d')]);if(_0x40fc33[_0x04c7('0x3e')]){delete _0x40fc33[_0x04c7('0x3e')];}_0x28180a['status'](_0x429a3d)[_0x04c7('0x3f')](_0x40fc33);};}exports[_0x04c7('0x40')]=function(_0x574918,_0x25e27c){var _0xb3fe0a={},_0x507f9c={},_0x4d7ca3={'count':0x0,'rows':[]};var _0x5a7bdd=_[_0x04c7('0x41')](db['ChatGroup'][_0x04c7('0x42')],function(_0x4dcb40){return{'name':_0x4dcb40[_0x04c7('0x43')],'type':_0x4dcb40[_0x04c7('0x44')]['key']};});_0x507f9c[_0x04c7('0x45')]=_['map'](_0x5a7bdd,'name');_0x507f9c[_0x04c7('0x46')]=_['keys'](_0x574918[_0x04c7('0x46')]);_0x507f9c[_0x04c7('0x47')]=_[_0x04c7('0x48')](_0x507f9c[_0x04c7('0x45')],_0x507f9c[_0x04c7('0x46')]);_0xb3fe0a[_0x04c7('0x49')]=_[_0x04c7('0x48')](_0x507f9c['model'],qs['fields'](_0x574918[_0x04c7('0x46')][_0x04c7('0x4a')]));_0xb3fe0a[_0x04c7('0x49')]=_0xb3fe0a[_0x04c7('0x49')][_0x04c7('0x4b')]?_0xb3fe0a[_0x04c7('0x49')]:_0x507f9c[_0x04c7('0x45')];if(!_0x574918[_0x04c7('0x46')][_0x04c7('0x4c')](_0x04c7('0x4d'))){_0xb3fe0a['limit']=qs[_0x04c7('0x35')](_0x574918[_0x04c7('0x46')][_0x04c7('0x35')]);_0xb3fe0a[_0x04c7('0x34')]=qs[_0x04c7('0x34')](_0x574918['query']['offset']);}_0xb3fe0a[_0x04c7('0x4e')]=qs['sort'](_0x574918[_0x04c7('0x46')][_0x04c7('0x4f')]);_0xb3fe0a[_0x04c7('0x50')]=qs[_0x04c7('0x47')](_[_0x04c7('0x51')](_0x574918[_0x04c7('0x46')],_0x507f9c[_0x04c7('0x47')]));if(_0x574918['query'][_0x04c7('0x52')]){_0xb3fe0a[_0x04c7('0x50')]=_[_0x04c7('0x53')](_0xb3fe0a[_0x04c7('0x50')],{'$or':_[_0x04c7('0x41')](_0x5a7bdd,function(_0x5cae01){if(_0x5cae01[_0x04c7('0x44')]!==_0x04c7('0x54')){var _0x2ec9ad={};_0x2ec9ad[_0x5cae01[_0x04c7('0x3e')]]={'$like':'%'+_0x574918['query'][_0x04c7('0x52')]+'%'};return _0x2ec9ad;}})});}_0xb3fe0a=_[_0x04c7('0x53')]({},_0xb3fe0a,_0x574918[_0x04c7('0x55')]);var _0x473b47={'where':_0xb3fe0a[_0x04c7('0x50')]};return db['ChatGroup'][_0x04c7('0x56')](_0x473b47)['then'](function(_0x59c877){_0x4d7ca3[_0x04c7('0x56')]=_0x59c877;if(_0x574918['query'][_0x04c7('0x57')]){_0xb3fe0a[_0x04c7('0x58')]=[{'all':!![]}];}return db[_0x04c7('0x59')][_0x04c7('0x5a')](_0xb3fe0a);})['then'](function(_0x18640f){_0x4d7ca3[_0x04c7('0x5b')]=_0x18640f;return _0x4d7ca3;})['then'](respondWithFilteredResult(_0x25e27c,_0xb3fe0a))[_0x04c7('0x30')](handleError(_0x25e27c,null));};exports[_0x04c7('0x5c')]=function(_0x216c60,_0x2305c2){var _0x1f41d8={'raw':!![],'where':{'id':_0x216c60['params']['id']}},_0x5e05b5={};_0x5e05b5['model']=_[_0x04c7('0x5d')](db[_0x04c7('0x59')][_0x04c7('0x42')]);_0x5e05b5['query']=_[_0x04c7('0x5d')](_0x216c60[_0x04c7('0x46')]);_0x5e05b5[_0x04c7('0x47')]=_[_0x04c7('0x48')](_0x5e05b5[_0x04c7('0x45')],_0x5e05b5[_0x04c7('0x46')]);_0x1f41d8[_0x04c7('0x49')]=_[_0x04c7('0x48')](_0x5e05b5[_0x04c7('0x45')],qs[_0x04c7('0x4a')](_0x216c60['query'][_0x04c7('0x4a')]));_0x1f41d8['attributes']=_0x1f41d8['attributes'][_0x04c7('0x4b')]?_0x1f41d8[_0x04c7('0x49')]:_0x5e05b5[_0x04c7('0x45')];if(_0x216c60[_0x04c7('0x46')][_0x04c7('0x57')]){_0x1f41d8[_0x04c7('0x58')]=[{'all':!![]}];}_0x1f41d8=_[_0x04c7('0x53')]({},_0x1f41d8,_0x216c60[_0x04c7('0x55')]);return db[_0x04c7('0x59')][_0x04c7('0x5e')](_0x1f41d8)[_0x04c7('0x26')](handleEntityNotFound(_0x2305c2,null))[_0x04c7('0x26')](respondWithResult(_0x2305c2,null))[_0x04c7('0x30')](handleError(_0x2305c2,null));};exports['create']=function(_0x466e8c,_0xf984e){return db['ChatGroup']['create'](_0x466e8c[_0x04c7('0x5f')],{})['then'](respondWithResult(_0xf984e,0xc9))[_0x04c7('0x30')](handleError(_0xf984e,null));};exports['update']=function(_0x5bbee7,_0x441fb8){if(_0x5bbee7['body']['id']){delete _0x5bbee7[_0x04c7('0x5f')]['id'];}return db[_0x04c7('0x59')][_0x04c7('0x5e')]({'where':{'id':_0x5bbee7[_0x04c7('0x60')]['id']}})['then'](handleEntityNotFound(_0x441fb8,null))[_0x04c7('0x26')](saveUpdates(_0x5bbee7[_0x04c7('0x5f')],null))[_0x04c7('0x26')](respondWithResult(_0x441fb8,null))['catch'](handleError(_0x441fb8,null));};exports[_0x04c7('0x3c')]=function(_0x526eeb,_0x1b865f){return db['ChatGroup'][_0x04c7('0x5e')]({'where':{'id':_0x526eeb['params']['id']}})['then'](handleEntityNotFound(_0x1b865f,null))['then'](removeEntity(_0x1b865f,null))[_0x04c7('0x30')](handleError(_0x1b865f,null));};exports[_0x04c7('0x61')]=function(_0x1fa302,_0x14f4ea){return db[_0x04c7('0x59')][_0x04c7('0x61')]()[_0x04c7('0x26')](respondWithResult(_0x14f4ea,null))[_0x04c7('0x30')](handleError(_0x14f4ea,null));};exports['getUnread']=function(_0x2eafb1,_0x1fd7cb,_0x500e96){return db[_0x04c7('0x62')][_0x04c7('0x56')]({'where':{'ChatGroupId':_0x2eafb1[_0x04c7('0x60')]['id'],'ToId':_0x2eafb1[_0x04c7('0x63')]['id'],'read':![]}})[_0x04c7('0x26')](function(_0x172eb4){return{'id':_[_0x04c7('0x64')](_0x2eafb1[_0x04c7('0x60')]['id']),'count':_0x172eb4};})[_0x04c7('0x26')](respondWithResult(_0x1fd7cb,null))[_0x04c7('0x30')](handleError(_0x1fd7cb,null));};exports[_0x04c7('0x65')]=function(_0x4e34e8,_0x3ddccc,_0x325c42){return db['ChatGroup'][_0x04c7('0x5e')]({'where':{'id':_0x4e34e8[_0x04c7('0x60')]['id']}})[_0x04c7('0x26')](handleEntityNotFound(_0x3ddccc,null))[_0x04c7('0x26')](function(_0x4aad96){if(_0x4aad96){return _0x4aad96[_0x04c7('0x65')](_0x4e34e8[_0x04c7('0x5f')][_0x04c7('0x66')],_[_0x04c7('0x67')](_0x4e34e8['body'],[_0x04c7('0x66'),'id'])||{});}})[_0x04c7('0x26')](respondWithResult(_0x3ddccc,null))[_0x04c7('0x30')](handleError(_0x3ddccc,null));};exports[_0x04c7('0x68')]=function(_0x3640c2,_0x14f1b2,_0x3cd418){var _0x27155c={};var _0x4948d7={};var _0xa1e996;var _0x1b15b1;return db['ChatGroup'][_0x04c7('0x69')]({'where':{'id':_0x3640c2['params']['id']}})[_0x04c7('0x26')](handleEntityNotFound(_0x14f1b2,null))[_0x04c7('0x26')](function(_0x255653){if(_0x255653){_0xa1e996=_0x255653;_0x4948d7['model']=_['keys'](db[_0x04c7('0x6a')]['rawAttributes']);_0x4948d7['query']=_[_0x04c7('0x5d')](_0x3640c2['query']);_0x4948d7['filters']=_['intersection'](_0x4948d7[_0x04c7('0x45')],_0x4948d7[_0x04c7('0x46')]);_0x27155c[_0x04c7('0x49')]=_[_0x04c7('0x48')](_0x4948d7[_0x04c7('0x45')],qs[_0x04c7('0x4a')](_0x3640c2[_0x04c7('0x46')][_0x04c7('0x4a')]));_0x27155c[_0x04c7('0x49')]=_0x27155c[_0x04c7('0x49')]['length']?_0x27155c[_0x04c7('0x49')]:_0x4948d7['model'];_0x27155c[_0x04c7('0x4e')]=qs[_0x04c7('0x4f')](_0x3640c2[_0x04c7('0x46')][_0x04c7('0x4f')]);_0x27155c['where']=qs[_0x04c7('0x47')](_[_0x04c7('0x51')](_0x3640c2[_0x04c7('0x46')],_0x4948d7[_0x04c7('0x47')]));if(_0x3640c2[_0x04c7('0x46')][_0x04c7('0x52')]){_0x27155c['where']=_[_0x04c7('0x53')](_0x27155c['where'],{'$or':_[_0x04c7('0x41')](_0x27155c[_0x04c7('0x49')],function(_0x203310){var _0x536e62={};_0x536e62[_0x203310]={'$like':'%'+_0x3640c2['query'][_0x04c7('0x52')]+'%'};return _0x536e62;})});}_0x27155c=_[_0x04c7('0x53')]({},_0x27155c,_0x3640c2['options']);return _0xa1e996['getMembers'](_0x27155c);}})[_0x04c7('0x26')](function(_0x510098){if(_0x510098){_0x1b15b1=_0x510098[_0x04c7('0x4b')];if(!_0x3640c2[_0x04c7('0x46')]['hasOwnProperty'](_0x04c7('0x4d'))){_0x27155c[_0x04c7('0x35')]=qs[_0x04c7('0x35')](_0x3640c2[_0x04c7('0x46')][_0x04c7('0x35')]);_0x27155c[_0x04c7('0x34')]=qs['offset'](_0x3640c2[_0x04c7('0x46')]['offset']);}return _0xa1e996['getMembers'](_0x27155c);}})[_0x04c7('0x26')](function(_0x54a51a){if(_0x54a51a){return _0x54a51a?{'count':_0x1b15b1,'rows':_0x54a51a}:null;}})[_0x04c7('0x26')](respondWithResult(_0x14f1b2,null))[_0x04c7('0x30')](handleError(_0x14f1b2,null));};exports['removeMembers']=function(_0x1d5faa,_0x483efe,_0x257828){return db[_0x04c7('0x59')]['find']({'where':{'id':_0x1d5faa[_0x04c7('0x60')]['id']}})[_0x04c7('0x26')](handleEntityNotFound(_0x483efe,null))[_0x04c7('0x26')](function(_0x290990){if(_0x290990){return _0x290990[_0x04c7('0x6b')](_0x1d5faa[_0x04c7('0x46')][_0x04c7('0x66')]);}})[_0x04c7('0x26')](respondWithStatusCode(_0x483efe,null))['catch'](handleError(_0x483efe,null));};exports['addMessage']=function(_0x55fcef,_0x3d3537,_0x5ace43){if(_0x55fcef[_0x04c7('0x5f')]['id']){delete _0x55fcef[_0x04c7('0x5f')]['id'];}return db['ChatGroup'][_0x04c7('0x5e')]({'where':{'id':_0x55fcef[_0x04c7('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d3537,null))[_0x04c7('0x26')](function(_0x25d503){if(_0x25d503){_0x55fcef[_0x04c7('0x5f')][_0x04c7('0x6c')]=_0x25d503['id'];return db[_0x04c7('0x62')]['create'](_0x55fcef[_0x04c7('0x5f')]);}})[_0x04c7('0x26')](respondWithResult(_0x3d3537,null))[_0x04c7('0x30')](handleError(_0x3d3537,null));};exports[_0x04c7('0x6d')]=function(_0x159599,_0x52266b,_0x3576c0){var _0x25aad8={};var _0x3a05be={};var _0x2baec7;var _0xd458c0;return db['ChatGroup'][_0x04c7('0x69')]({'where':{'id':_0x159599[_0x04c7('0x60')]['id']}})['then'](handleEntityNotFound(_0x52266b,null))['then'](function(_0x2aed32){if(_0x2aed32){_0x2baec7=_0x2aed32;_0x3a05be[_0x04c7('0x45')]=_['keys'](db[_0x04c7('0x62')][_0x04c7('0x42')]);_0x3a05be[_0x04c7('0x46')]=_[_0x04c7('0x5d')](_0x159599[_0x04c7('0x46')]);_0x3a05be[_0x04c7('0x47')]=_[_0x04c7('0x48')](_0x3a05be[_0x04c7('0x45')],_0x3a05be['query']);_0x25aad8[_0x04c7('0x49')]=_['intersection'](_0x3a05be[_0x04c7('0x45')],qs[_0x04c7('0x4a')](_0x159599[_0x04c7('0x46')][_0x04c7('0x4a')]));_0x25aad8[_0x04c7('0x49')]=_0x25aad8[_0x04c7('0x49')]['length']?_0x25aad8[_0x04c7('0x49')]:_0x3a05be[_0x04c7('0x45')];_0x25aad8[_0x04c7('0x4e')]=qs[_0x04c7('0x4f')](_0x159599['query'][_0x04c7('0x4f')]);_0x25aad8[_0x04c7('0x50')]=qs[_0x04c7('0x47')](_[_0x04c7('0x51')](_0x159599[_0x04c7('0x46')],_0x3a05be[_0x04c7('0x47')]));if(_0x159599[_0x04c7('0x46')][_0x04c7('0x52')]){_0x25aad8['where']=_[_0x04c7('0x53')](_0x25aad8[_0x04c7('0x50')],{'$or':_[_0x04c7('0x41')](_0x25aad8[_0x04c7('0x49')],function(_0x91748d){var _0x1d457f={};_0x1d457f[_0x91748d]={'$like':'%'+_0x159599[_0x04c7('0x46')][_0x04c7('0x52')]+'%'};return _0x1d457f;})});}if(_0x159599[_0x04c7('0x46')][_0x04c7('0x6e')]){var _0x186396=_0x159599[_0x04c7('0x46')][_0x04c7('0x6e')][_0x04c7('0x6f')](',');var _0x11302d={};_0x11302d[_0x186396[0x0]]={'$gte':moment(_0x186396[0x1])[_0x04c7('0x70')](_0x04c7('0x71'))};_0x25aad8[_0x04c7('0x50')]=_[_0x04c7('0x53')](_0x25aad8[_0x04c7('0x50')],_0x11302d);}_0x25aad8=_[_0x04c7('0x53')]({},_0x25aad8,_0x159599[_0x04c7('0x55')]);return _0x2baec7[_0x04c7('0x6d')](_0x25aad8);}})[_0x04c7('0x26')](function(_0xe86cfb){if(_0xe86cfb){_0xd458c0=_0xe86cfb[_0x04c7('0x4b')];if(!_0x159599[_0x04c7('0x46')][_0x04c7('0x4c')](_0x04c7('0x4d'))){_0x25aad8[_0x04c7('0x35')]=qs[_0x04c7('0x35')](_0x159599[_0x04c7('0x46')]['limit']);_0x25aad8[_0x04c7('0x34')]=qs[_0x04c7('0x34')](_0x159599[_0x04c7('0x46')][_0x04c7('0x34')]);}return _0x2baec7[_0x04c7('0x6d')](_0x25aad8);}})[_0x04c7('0x26')](function(_0x376add){if(_0x376add){return _0x376add?{'count':_0xd458c0,'rows':_0x376add}:null;}})[_0x04c7('0x26')](respondWithResult(_0x52266b,null))['catch'](handleError(_0x52266b,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 5a24737..b358dd4 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 _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x26a815,_0xcde2b9){var _0x539ed1=function(_0x66f759){while(--_0x66f759){_0x26a815['push'](_0x26a815['shift']());}};_0x539ed1(++_0xcde2b9);}(_0x2ef3,0xba));var _0x32ef=function(_0x448429,_0x2eaaa4){_0x448429=_0x448429-0x0;var _0x34a449=_0x2ef3[_0x448429];return _0x34a449;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var ChatGroup=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){ChatGroupEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);ChatGroupEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x581de4,_0x18cb2e){var _0x2ebdb4=function(_0x54f1ed){while(--_0x54f1ed){_0x581de4['push'](_0x581de4['shift']());}};_0x2ebdb4(++_0x18cb2e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65f6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){ChatGroupEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);ChatGroupEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 90810a2..6d7ac86 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 _0x872a=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x872a,0x100));var _0xa872=function(_0x3e5e49,_0xf89498){_0x3e5e49=_0x3e5e49-0x0;var _0x57efca=_0x872a[_0x3e5e49];return _0x57efca;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa872('0x4'));var rimraf=require(_0xa872('0x5'));var config=require(_0xa872('0x6'));var attributes=require(_0xa872('0x7'));module[_0xa872('0x8')]=function(_0x1c8d2f,_0x3e3cd4){return _0x1c8d2f['define'](_0xa872('0x9'),attributes,{'tableName':_0xa872('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95d9=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird'];(function(_0x5ab347,_0x1017fa){var _0x585f63=function(_0x34aa55){while(--_0x34aa55){_0x5ab347['push'](_0x5ab347['shift']());}};_0x585f63(++_0x1017fa);}(_0x95d9,0x97));var _0x995d=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x95d9[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var logger=require(_0x995d('0x2'))(_0x995d('0x3'));var moment=require('moment');var BPromise=require(_0x995d('0x4'));var rp=require(_0x995d('0x5'));var fs=require('fs');var path=require(_0x995d('0x6'));var rimraf=require('rimraf');var config=require(_0x995d('0x7'));var attributes=require(_0x995d('0x8'));module[_0x995d('0x9')]=function(_0x226250,_0xe6d244){return _0x226250['define'](_0x995d('0xa'),attributes,{'tableName':_0x995d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 4cdb2c8..5331013 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 _0x4dab=['ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug'];(function(_0x2407f5,_0xd26f99){var _0xa5e20=function(_0x49d359){while(--_0x49d359){_0x2407f5['push'](_0x2407f5['shift']());}};_0xa5e20(++_0xd26f99);}(_0x4dab,0x6e));var _0xb4da=function(_0x3f0aea,_0x40ea8c){_0x3f0aea=_0x3f0aea-0x0;var _0x382714=_0x4dab[_0x3f0aea];return _0x382714;};'use strict';var _=require(_0xb4da('0x0'));var util=require(_0xb4da('0x1'));var moment=require(_0xb4da('0x2'));var BPromise=require(_0xb4da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb4da('0x4'));var logger=require(_0xb4da('0x5'))(_0xb4da('0x6'));var config=require(_0xb4da('0x7'));var jayson=require(_0xb4da('0x8'));var client=jayson[_0xb4da('0x9')][_0xb4da('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb4da('0xb'),'port':0x18eb});var socket=require(_0xb4da('0xc'))(new Redis(config[_0xb4da('0xd')]));require('./chatGroup.socket')[_0xb4da('0xe')](socket);function respondWithRpcPromise(_0x2e2538,_0xfe5f4a,_0x57040d){return new BPromise(function(_0x4165be,_0x2d56f1){return client[_0xb4da('0xf')](_0x2e2538,_0x57040d)[_0xb4da('0x10')](function(_0x183a43){logger[_0xb4da('0x11')](_0xb4da('0x12'),_0xfe5f4a,'request\x20sent');logger[_0xb4da('0x13')](_0xb4da('0x14'),_0xfe5f4a,'request\x20sent',JSON[_0xb4da('0x15')](_0x183a43));if(_0x183a43['error']){if(_0x183a43['error'][_0xb4da('0x16')]===0x1f4){logger[_0xb4da('0x17')](_0xb4da('0x12'),_0xfe5f4a,_0x183a43[_0xb4da('0x17')][_0xb4da('0x18')]);return _0x2d56f1(_0x183a43[_0xb4da('0x17')][_0xb4da('0x18')]);}logger[_0xb4da('0x17')](_0xb4da('0x12'),_0xfe5f4a,_0x183a43[_0xb4da('0x17')][_0xb4da('0x18')]);return _0x4165be(_0x183a43[_0xb4da('0x17')][_0xb4da('0x18')]);}else{logger['info'](_0xb4da('0x12'),_0xfe5f4a,'request\x20sent');_0x4165be(_0x183a43[_0xb4da('0x19')][_0xb4da('0x18')]);}})['catch'](function(_0x46d363){logger[_0xb4da('0x17')](_0xb4da('0x12'),_0xfe5f4a,_0x46d363);_0x2d56f1(_0x46d363);});});} \ No newline at end of file +var _0x89e1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x21f9d2,_0x2730b4){var _0x32fa8d=function(_0x3811b5){while(--_0x3811b5){_0x21f9d2['push'](_0x21f9d2['shift']());}};_0x32fa8d(++_0x2730b4);}(_0x89e1,0x13e));var _0x189e=function(_0x31c17a,_0x48b398){_0x31c17a=_0x31c17a-0x0;var _0x1e2e8f=_0x89e1[_0x31c17a];return _0x1e2e8f;};'use strict';var _=require(_0x189e('0x0'));var util=require(_0x189e('0x1'));var moment=require(_0x189e('0x2'));var BPromise=require(_0x189e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x189e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x189e('0x5'));var logger=require(_0x189e('0x6'))(_0x189e('0x7'));var config=require(_0x189e('0x8'));var jayson=require(_0x189e('0x9'));var client=jayson[_0x189e('0xa')]['http']({'port':0x232a});config[_0x189e('0xb')]=_[_0x189e('0xc')](config[_0x189e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x189e('0xd'))(new Redis(config[_0x189e('0xb')]));require('./chatGroup.socket')[_0x189e('0xe')](socket);function respondWithRpcPromise(_0x524aa5,_0x1845e7,_0x5bc8fb){return new BPromise(function(_0x5f50ed,_0x5a2cb7){return client[_0x189e('0xf')](_0x524aa5,_0x5bc8fb)[_0x189e('0x10')](function(_0x24ccba){logger[_0x189e('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1845e7,'request\x20sent');logger[_0x189e('0x12')](_0x189e('0x13'),_0x1845e7,_0x189e('0x14'),JSON['stringify'](_0x24ccba));if(_0x24ccba[_0x189e('0x15')]){if(_0x24ccba[_0x189e('0x15')][_0x189e('0x16')]===0x1f4){logger[_0x189e('0x15')](_0x189e('0x17'),_0x1845e7,_0x24ccba[_0x189e('0x15')][_0x189e('0x18')]);return _0x5a2cb7(_0x24ccba[_0x189e('0x15')][_0x189e('0x18')]);}logger['error'](_0x189e('0x17'),_0x1845e7,_0x24ccba[_0x189e('0x15')][_0x189e('0x18')]);return _0x5f50ed(_0x24ccba[_0x189e('0x15')][_0x189e('0x18')]);}else{logger[_0x189e('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1845e7,'request\x20sent');_0x5f50ed(_0x24ccba[_0x189e('0x19')][_0x189e('0x18')]);}})[_0x189e('0x1a')](function(_0x45fb96){logger[_0x189e('0x15')](_0x189e('0x17'),_0x1845e7,_0x45fb96);_0x5a2cb7(_0x45fb96);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9b3d08b..0ac1a48 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 _0xda18=['update','emit','register','length','chatGroup:','save'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xda18,0xd7));var _0x8da1=function(_0x5521a8,_0xedc965){_0x5521a8=_0x5521a8-0x0;var _0x69e41a=_0xda18[_0x5521a8];return _0x69e41a;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x8da1('0x0'),'remove',_0x8da1('0x1')];function createListener(_0x235b30,_0x39eb81){return function(_0x3e3479){_0x39eb81[_0x8da1('0x2')](_0x235b30,_0x3e3479);};}function removeListener(_0x593061,_0x4f6a39){return function(){ChatGroupEvents['removeListener'](_0x593061,_0x4f6a39);};}exports[_0x8da1('0x3')]=function(_0x6b81cd){for(var _0x2d1bfb=0x0,_0x2828c5=events[_0x8da1('0x4')];_0x2d1bfb<_0x2828c5;_0x2d1bfb++){var _0x58990a=events[_0x2d1bfb];var _0x51194b=createListener(_0x8da1('0x5')+_0x58990a,_0x6b81cd);ChatGroupEvents['on'](_0x58990a,_0x51194b);}}; \ No newline at end of file +var _0x8df2=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register'];(function(_0x56196d,_0x4575ea){var _0xda77bf=function(_0x3e21aa){while(--_0x3e21aa){_0x56196d['push'](_0x56196d['shift']());}};_0xda77bf(++_0x4575ea);}(_0x8df2,0x104));var _0x28df=function(_0x821d86,_0x1fe414){_0x821d86=_0x821d86-0x0;var _0x4d908d=_0x8df2[_0x821d86];return _0x4d908d;};'use strict';var ChatGroupEvents=require(_0x28df('0x0'));var events=['save',_0x28df('0x1'),_0x28df('0x2')];function createListener(_0x5b3494,_0x5a3632){return function(_0x514010){_0x5a3632[_0x28df('0x3')](_0x5b3494,_0x514010);};}function removeListener(_0x16b33f,_0x11cc24){return function(){ChatGroupEvents[_0x28df('0x4')](_0x16b33f,_0x11cc24);};}exports[_0x28df('0x5')]=function(_0x50f660){for(var _0x3663f5=0x0,_0xa71f84=events['length'];_0x3663f5<_0xa71f84;_0x3663f5++){var _0x3e30f8=events[_0x3663f5];var _0x2a560f=createListener(_0x28df('0x6')+_0x3e30f8,_0x50f660);ChatGroupEvents['on'](_0x3e30f8,_0x2a560f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 302490b..c6dbbc8 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 _0x8106=['/:id/messages','getMessages','post','create','addMessage','/:id','delete','removeMembers','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','show','/:id/unread','getUnread','/:id/members'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8106,0xb8));var _0x6810=function(_0x421c2a,_0x55f7ee){_0x421c2a=_0x421c2a-0x0;var _0x1e2295=_0x8106[_0x421c2a];return _0x1e2295;};'use strict';var multer=require(_0x6810('0x0'));var util=require(_0x6810('0x1'));var path=require(_0x6810('0x2'));var timeout=require(_0x6810('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6810('0x4'));var interaction=require(_0x6810('0x5'));var config=require(_0x6810('0x6'));var controller=require(_0x6810('0x7'));router[_0x6810('0x8')]('/',auth['isAuthenticated'](),controller[_0x6810('0x9')]);router['get'](_0x6810('0xa'),auth[_0x6810('0xb')](),controller['describe']);router['get']('/:id',auth[_0x6810('0xb')](),controller[_0x6810('0xc')]);router[_0x6810('0x8')](_0x6810('0xd'),auth[_0x6810('0xb')](),controller[_0x6810('0xe')]);router[_0x6810('0x8')](_0x6810('0xf'),auth[_0x6810('0xb')](),controller['getMembers']);router[_0x6810('0x8')](_0x6810('0x10'),auth[_0x6810('0xb')](),controller[_0x6810('0x11')]);router[_0x6810('0x12')]('/',auth[_0x6810('0xb')](),controller[_0x6810('0x13')]);router['post'](_0x6810('0xf'),auth[_0x6810('0xb')](),controller['addMembers']);router[_0x6810('0x12')](_0x6810('0x10'),auth[_0x6810('0xb')](),controller[_0x6810('0x14')]);router['put'](_0x6810('0x15'),auth[_0x6810('0xb')](),controller['update']);router[_0x6810('0x16')](_0x6810('0x15'),auth[_0x6810('0xb')](),controller['destroy']);router[_0x6810('0x16')](_0x6810('0xf'),auth[_0x6810('0xb')](),controller[_0x6810('0x17')]);module[_0x6810('0x18')]=router; \ No newline at end of file +var _0xbac5=['/:id/unread','/:id/members','/:id/messages','post','create','addMembers','addMessage','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x34c40d,_0x5f2a48){var _0x26e984=function(_0x125d95){while(--_0x125d95){_0x34c40d['push'](_0x34c40d['shift']());}};_0x26e984(++_0x5f2a48);}(_0xbac5,0xfc));var _0x5bac=function(_0x567e55,_0x4968d9){_0x567e55=_0x567e55-0x0;var _0x316288=_0xbac5[_0x567e55];return _0x316288;};'use strict';var multer=require(_0x5bac('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5bac('0x1'));var express=require(_0x5bac('0x2'));var router=express[_0x5bac('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5bac('0x4'));var config=require(_0x5bac('0x5'));var controller=require(_0x5bac('0x6'));router[_0x5bac('0x7')]('/',auth[_0x5bac('0x8')](),controller[_0x5bac('0x9')]);router['get'](_0x5bac('0xa'),auth[_0x5bac('0x8')](),controller[_0x5bac('0xb')]);router[_0x5bac('0x7')]('/:id',auth[_0x5bac('0x8')](),controller['show']);router[_0x5bac('0x7')](_0x5bac('0xc'),auth[_0x5bac('0x8')](),controller['getUnread']);router[_0x5bac('0x7')](_0x5bac('0xd'),auth[_0x5bac('0x8')](),controller['getMembers']);router['get'](_0x5bac('0xe'),auth[_0x5bac('0x8')](),controller['getMessages']);router[_0x5bac('0xf')]('/',auth[_0x5bac('0x8')](),controller[_0x5bac('0x10')]);router[_0x5bac('0xf')](_0x5bac('0xd'),auth[_0x5bac('0x8')](),controller[_0x5bac('0x11')]);router[_0x5bac('0xf')](_0x5bac('0xe'),auth[_0x5bac('0x8')](),controller[_0x5bac('0x12')]);router[_0x5bac('0x13')](_0x5bac('0x14'),auth[_0x5bac('0x8')](),controller['update']);router[_0x5bac('0x15')](_0x5bac('0x14'),auth[_0x5bac('0x8')](),controller[_0x5bac('0x16')]);router[_0x5bac('0x15')](_0x5bac('0xd'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x5bac('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 873ac62..f5b236c 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 _0xadd2=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long','out','sequelize','BOOLEAN'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0xadd2,0xcf));var _0x2add=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xadd2[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x2add('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2add('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2add('0x2')]},'ratingType':{'type':Sequelize[_0x2add('0x3')](_0x2add('0x4'),_0x2add('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2add('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2add('0x7')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2add('0x8')]},'browserName':{'type':Sequelize[_0x2add('0x8')]},'browserVersion':{'type':Sequelize[_0x2add('0x8')]},'osName':{'type':Sequelize[_0x2add('0x8')]},'osVersion':{'type':Sequelize[_0x2add('0x8')]},'deviceModel':{'type':Sequelize[_0x2add('0x8')]},'deviceVendor':{'type':Sequelize[_0x2add('0x8')]},'deviceType':{'type':Sequelize[_0x2add('0x8')]},'referer':{'type':Sequelize[_0x2add('0x6')]},'customerIp':{'type':Sequelize[_0x2add('0x8')]},'formData':{'type':Sequelize[_0x2add('0x6')](_0x2add('0x9'))},'read1stAt':{'type':Sequelize[_0x2add('0x7')]},'lastMsgAt':{'type':Sequelize[_0x2add('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x2add('0x3')]('in',_0x2add('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2add('0x8')]},'customerPort':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe49a=['STRING','long','out','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe49a,0x6f));var _0xae49=function(_0x3d381f,_0x5642c4){_0x3d381f=_0x3d381f-0x0;var _0x98094=_0xe49a[_0x3d381f];return _0x98094;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xae49('0x0')]},'ratingType':{'type':Sequelize[_0xae49('0x1')](_0xae49('0x2'),_0xae49('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xae49('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xae49('0x5')]},'disposition':{'type':Sequelize[_0xae49('0x6')]},'note':{'type':Sequelize[_0xae49('0x6')]},'browserName':{'type':Sequelize[_0xae49('0x6')]},'browserVersion':{'type':Sequelize[_0xae49('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xae49('0x6')]},'deviceType':{'type':Sequelize[_0xae49('0x6')]},'referer':{'type':Sequelize[_0xae49('0x4')]},'customerIp':{'type':Sequelize[_0xae49('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xae49('0x7'))},'read1stAt':{'type':Sequelize[_0xae49('0x5')]},'lastMsgAt':{'type':Sequelize[_0xae49('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xae49('0x1')]('in',_0xae49('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xae49('0x6')]},'customerPort':{'type':Sequelize[_0xae49('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a02579b..8a04d4c 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 _0x3e32=['ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','getChatWebsites','sequelize','toString','merge','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','keys','rawAttributes','includeAll','include','options','body','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','create','attachmentDownload','findOne','Unauthorized','Attachment','attachId','download','join','server/files/attachments/','mailTranscript','server/files/chat/upload/','now','ChatMessage','Messages','User','CmContact','agentAlias','System','format','%s%d','agentIdentifier','website_alias','alias','fullname','agent_fullname','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','setTags','emit','chatInteractionTags:save','removeTags','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','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\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','mkdirSync','N.A.','closedAt','disposition','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','direction','out','lastName','renderFile','transcript-','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','count','offset','limit','json','reject','update','destroy','end','stack','name','send','map','TagIds','split','forEach','Tags','push','index','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','select','u.id'];(function(_0x2f2364,_0xb5ee12){var _0x2809ac=function(_0x559dbc){while(--_0x559dbc){_0x2f2364['push'](_0x2f2364['shift']());}};_0x2809ac(++_0xb5ee12);}(_0x3e32,0x1e7));var _0x23e3=function(_0x27c7b9,_0x57ac59){_0x27c7b9=_0x27c7b9-0x0;var _0x3150f6=_0x3e32[_0x27c7b9];return _0x3150f6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x23e3('0x0'));var rimraf=require(_0x23e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23e3('0x2'));var rp=require(_0x23e3('0x3'));var moment=require(_0x23e3('0x4'));var BPromise=require(_0x23e3('0x5'));var Mustache=require(_0x23e3('0x6'));var util=require(_0x23e3('0x7'));var path=require(_0x23e3('0x8'));var sox=require('sox');var csv=require(_0x23e3('0x9'));var ejs=require(_0x23e3('0xa'));var fs=require('fs');var _=require(_0x23e3('0xb'));var squel=require(_0x23e3('0xc'));var crypto=require(_0x23e3('0xd'));var jsforce=require(_0x23e3('0xe'));var deskjs=require(_0x23e3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x23e3('0x10'));var Papa=require(_0x23e3('0x11'));var Redis=require(_0x23e3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x23e3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23e3('0x14'));var logger=require(_0x23e3('0x15'))(_0x23e3('0x16'));var utils=require('../../config/utils');var config=require(_0x23e3('0x17'));var db=require(_0x23e3('0x18'))['db'];config[_0x23e3('0x19')]=_[_0x23e3('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23e3('0x19')]));require(_0x23e3('0x1b'))['register'](socket);var jayson=require(_0x23e3('0x1c'));var client=jayson[_0x23e3('0x1d')][_0x23e3('0x1e')]({'port':0x232b});var client9004=jayson[_0x23e3('0x1d')][_0x23e3('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x40ccf0,_0x537dd0,_0x27b571){if(_0x27b571){var _0x5de303=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5de303['test'](_0x537dd0)){return _0x40ccf0;}else{throw new db[(_0x23e3('0x1f'))]['ValidationError'](_0x23e3('0x20'));}}else{return _0x40ccf0;}}function respondWithRpcPromise(_0x582d50,_0x45694d,_0x441b4d,_0x5e9210){return new BPromise(function(_0x1cba05,_0x165dff){var _0x61dba=_0x5e9210||client;return _0x61dba['request'](_0x582d50,_0x441b4d)[_0x23e3('0x21')](function(_0x369b14){logger['info'](_0x23e3('0x22'),_0x45694d,_0x23e3('0x23'));logger[_0x23e3('0x24')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x45694d,_0x23e3('0x23'),JSON[_0x23e3('0x25')](_0x369b14));if(_0x369b14[_0x23e3('0x26')]){if(_0x369b14['error'][_0x23e3('0x27')]===0x1f4){logger['error'](_0x23e3('0x22'),_0x45694d,_0x369b14[_0x23e3('0x26')]['message']);return _0x165dff(_0x369b14[_0x23e3('0x26')][_0x23e3('0x28')]);}logger[_0x23e3('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x45694d,_0x369b14[_0x23e3('0x26')][_0x23e3('0x28')]);return _0x1cba05(_0x369b14[_0x23e3('0x26')][_0x23e3('0x28')]);}else{logger[_0x23e3('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x45694d,'request\x20sent');_0x1cba05(_0x369b14[_0x23e3('0x2a')][_0x23e3('0x28')]);}})[_0x23e3('0x2b')](function(_0x102fb5){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x45694d,_0x102fb5);_0x165dff(_0x102fb5);});});}function respondWithStatusCode(_0xa02372,_0x233313){_0x233313=_0x233313||0xcc;return function(_0x452aaa){if(_0x452aaa){return _0xa02372[_0x23e3('0x2c')](_0x233313);}return _0xa02372[_0x23e3('0x2d')](_0x233313)['end']();};}function respondWithResult(_0x9da890,_0x2ef42e){_0x2ef42e=_0x2ef42e||0xc8;return function(_0x242b42){if(_0x242b42){return _0x9da890['status'](_0x2ef42e)['json'](_0x242b42);}};}function respondWithFilteredResult(_0x319041,_0x58e8cc){return function(_0x6c5991){if(_0x6c5991){var _0x4d7960=_0x6c5991[_0x23e3('0x2e')],_0x1c453d=_0x58e8cc[_0x23e3('0x2f')],_0x142ae0=_0x58e8cc[_0x23e3('0x2f')]+_0x58e8cc[_0x23e3('0x30')],_0x2728f0;if(_0x142ae0>=_0x4d7960){_0x142ae0=_0x4d7960;_0x2728f0=0xc8;}else{_0x2728f0=0xce;}_0x319041[_0x23e3('0x2d')](_0x2728f0);return _0x319041['set']('Content-Range',_0x1c453d+'-'+_0x142ae0+'/'+_0x4d7960)[_0x23e3('0x31')](_0x6c5991);}return null;};}function patchUpdates(_0x2f4861){return function(_0x55fd6d){try{jsonpatch['apply'](_0x55fd6d,_0x2f4861,!![]);}catch(_0x536e2e){return BPromise[_0x23e3('0x32')](_0x536e2e);}return _0x55fd6d['save']();};}function saveUpdates(_0x35475d,_0x58d93f){return function(_0x2be6b6){if(_0x2be6b6){return _0x2be6b6[_0x23e3('0x33')](_0x35475d)[_0x23e3('0x21')](function(_0x107538){return _0x107538;});}return null;};}function removeEntity(_0x492701,_0x5a93d3){return function(_0x37bc3a){if(_0x37bc3a){return _0x37bc3a[_0x23e3('0x34')]()[_0x23e3('0x21')](function(){_0x492701['status'](0xcc)[_0x23e3('0x35')]();});}};}function handleEntityNotFound(_0x9e8edf,_0x16c9b5){return function(_0x2c454f){if(!_0x2c454f){_0x9e8edf[_0x23e3('0x2c')](0x194);}return _0x2c454f;};}function handleError(_0x1e43d2,_0x3296bd){_0x3296bd=_0x3296bd||0x1f4;return function(_0xcfee9b){logger[_0x23e3('0x26')](_0xcfee9b[_0x23e3('0x36')]);if(_0xcfee9b[_0x23e3('0x37')]){delete _0xcfee9b['name'];}_0x1e43d2['status'](_0x3296bd)[_0x23e3('0x38')](_0xcfee9b);};}function getInteractionUsers(_0x2e56e5,_0x44367e){return new BPromise(function(_0xeb199c,_0x116054){try{if(_0x44367e[_0x2e56e5['id']]){_0x2e56e5['Users']=_[_0x23e3('0x39')](_0x44367e[_0x2e56e5['id']],function(_0x542880){return{'id':_0x542880['id']};});}}catch(_0x3a4084){_0x116054(_0x3a4084);}_0xeb199c(_0x2e56e5);});}function getInteractionTags(_0x4a759a,_0x3b97e0){return new BPromise(function(_0x9df759,_0x5e02a1){try{if(_0x4a759a[_0x23e3('0x3a')]){_0x4a759a['Tags']=[];_0x4a759a[_0x23e3('0x3a')][_0x23e3('0x3b')](',')[_0x23e3('0x3c')](function(_0x1ee019){_0x4a759a[_0x23e3('0x3d')][_0x23e3('0x3e')](_0x3b97e0[_0x1ee019]);});}delete _0x4a759a[_0x23e3('0x3a')];}catch(_0x1ec815){_0x5e02a1(_0x1ec815);}_0x9df759(_0x4a759a);});}function updateChatInteraction(_0x27c53a,_0x474fa0,_0x4d27aa){return new BPromise(function(_0x5763af,_0x2e5f7b){return getInteractionUsers(_0x27c53a,_0x4d27aa)[_0x23e3('0x21')](function(_0x39fd38){return getInteractionTags(_0x39fd38,_0x474fa0);})[_0x23e3('0x21')](function(_0x286c71){_0x5763af(_0x286c71);})[_0x23e3('0x2b')](function(_0x319dc9){_0x2e5f7b(_0x319dc9);});});}exports[_0x23e3('0x3f')]=function(_0x3a6b82,_0x3aec16){var _0x1c3ce2={},_0x5c5231={},_0x3f0c2d={'count':0x0,'rows':[]};var _0x183ded=_['map'](db['ChatInteraction']['rawAttributes'],function(_0x52acf8){return{'name':_0x52acf8[_0x23e3('0x40')],'type':_0x52acf8['type'][_0x23e3('0x41')]};});_0x5c5231[_0x23e3('0x42')]=_[_0x23e3('0x39')](_0x183ded,_0x23e3('0x37'));_0x5c5231[_0x23e3('0x43')]=_['keys'](_0x3a6b82[_0x23e3('0x43')]);_0x5c5231[_0x23e3('0x44')]=_[_0x23e3('0x45')](_0x5c5231[_0x23e3('0x42')],_0x5c5231['query']);_0x1c3ce2[_0x23e3('0x46')]=_['intersection'](_0x5c5231['model'],qs[_0x23e3('0x47')](_0x3a6b82['query'][_0x23e3('0x47')]));_0x1c3ce2[_0x23e3('0x46')]=_0x1c3ce2[_0x23e3('0x46')][_0x23e3('0x48')]?_0x1c3ce2['attributes']:_0x5c5231[_0x23e3('0x42')];if(!_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x49')](_0x23e3('0x4a'))){_0x1c3ce2[_0x23e3('0x30')]=qs['limit'](_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x30')]);_0x1c3ce2[_0x23e3('0x2f')]=qs[_0x23e3('0x2f')](_0x3a6b82['query'][_0x23e3('0x2f')]);}_0x1c3ce2[_0x23e3('0x4b')]=qs[_0x23e3('0x4c')](_0x3a6b82[_0x23e3('0x43')]['sort']);_0x1c3ce2[_0x23e3('0x4d')]=qs['filters'](_[_0x23e3('0x4e')](_0x3a6b82[_0x23e3('0x43')],_0x5c5231[_0x23e3('0x44')]));var _0x2caf7b=[];var _0x1a1a7a=squel['select']()[_0x23e3('0x4f')]('id')[_0x23e3('0x4f')](_0x23e3('0x37'))[_0x23e3('0x4f')](_0x23e3('0x50'))['from']('tools_tags');var _0x562e8d=squel[_0x23e3('0x51')]()[_0x23e3('0x4f')](_0x23e3('0x52'))[_0x23e3('0x4f')](_0x23e3('0x53'))[_0x23e3('0x54')](_0x23e3('0x55'),'ui')[_0x23e3('0x56')](_0x23e3('0x57'),'u',_0x23e3('0x58'));var _0x31edb1=squel[_0x23e3('0x51')]()['from']('chat_interactions','i')[_0x23e3('0x56')](_0x23e3('0x59'),'c',_0x23e3('0x5a'))[_0x23e3('0x56')]('users','o',_0x23e3('0x5b'))[_0x23e3('0x56')](_0x23e3('0x5c'),'a',_0x23e3('0x5d'))[_0x23e3('0x56')](_0x23e3('0x5e'),'me',_0x23e3('0x5f'))['left_join']('chat_interaction_has_tags','it',_0x23e3('0x60'))[_0x23e3('0x56')](_0x23e3('0x61'),'t','t.id\x20=\x20it.TagId');var _0x16c892=squel[_0x23e3('0x62')]();var _0x2fb92a=[];var _0x2ed9ab=squel[_0x23e3('0x62')]();var _0x412dd0;if(_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x63')]){_0x412dd0=as['parseSearch'](_0x3a6b82[_0x23e3('0x43')]['search']);var _0x1561e0=_0x412dd0[_0x23e3('0x64')];for(var _0x487968=0x0;_0x487968<_0x412dd0[_0x23e3('0x65')]['length'];_0x487968++){var _0x9af681=_0x412dd0[_0x23e3('0x65')][_0x487968];var _0x18d9dc='i';var _0x2032c0=_['find'](_0x183ded,[_0x23e3('0x37'),_0x9af681[_0x23e3('0x4f')]]);if(!_0x2032c0){switch(_0x9af681['field']){case _0x23e3('0x66'):if(_0x9af681[_0x23e3('0x67')]==0x1){_0x31edb1[_0x23e3('0x68')]('`'+_0x9af681['field']+_0x23e3('0x69'));}else{_0x31edb1[_0x23e3('0x68')]('`'+_0x9af681['field']+'`\x20>\x200');}break;case _0x23e3('0x6a'):if(_0x9af681[_0x23e3('0x6b')]===_0x23e3('0x6c')){if(_0x9af681['value'][_0x23e3('0x3b')]('\x20')[_0x23e3('0x48')]>0x1){_0x16c892[_0x1561e0](_0x23e3('0x6d'),qs[_0x23e3('0x6e')](_0x9af681[_0x23e3('0x67')]),null);}else{var _0x541874='%'+_0x9af681[_0x23e3('0x67')]+'%';_0x16c892[_0x1561e0](_0x23e3('0x6f'),_0x541874,_0x541874,_0x541874);}}else{_0x2032c0=_[_0x23e3('0x70')](_0x183ded,[_0x23e3('0x37'),_0x23e3('0x71')]);_0x9af681[_0x23e3('0x4f')]=_0x23e3('0x71');_0x40128e=as[_0x23e3('0x72')](_0x18d9dc,_0x2032c0[_0x23e3('0x73')],_0x9af681);_0x16c892[_0x1561e0](_0x40128e['text'],_0x40128e[_0x23e3('0x67')][_0x23e3('0x74')],_0x40128e['value'][_0x23e3('0x35')]);}break;case _0x23e3('0x75'):var _0x17aa94=_0x9af681[_0x23e3('0x67')][_0x23e3('0x3b')](',')[_0x23e3('0x39')](function(_0x4c1e29){return Number(_0x4c1e29);});_0x17aa94[_0x23e3('0x3c')](function(_0x224d98){_0x2ed9ab['or'](_0x23e3('0x76'),'%,'+_0x224d98+',%');});_0x2fb92a=_[_0x23e3('0x77')](_0x2fb92a,_0x17aa94);break;case'User':if(_0x9af681[_0x23e3('0x6b')]==='$substring'){_0x16c892[_0x1561e0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x9af681['value']+'%',null);}else{_0x2032c0=_[_0x23e3('0x70')](_0x183ded,['name',_0x23e3('0x78')]);_0x9af681[_0x23e3('0x4f')]=_0x23e3('0x78');_0x40128e=as['buildExpression'](_0x18d9dc,_0x2032c0['type'],_0x9af681);_0x16c892[_0x1561e0](_0x40128e[_0x23e3('0x79')],_0x40128e[_0x23e3('0x67')][_0x23e3('0x74')],_0x40128e[_0x23e3('0x67')][_0x23e3('0x35')]);}break;case'body':_0x40128e=as[_0x23e3('0x72')]('me',null,_0x9af681);_0x16c892[_0x1561e0](_0x40128e[_0x23e3('0x79')],_0x40128e['value'][_0x23e3('0x74')],_0x40128e[_0x23e3('0x67')][_0x23e3('0x35')]);break;}}else{var _0x40128e=as['buildExpression'](_0x18d9dc,_0x2032c0['type'],_0x9af681);_0x16c892[_0x1561e0](_0x40128e[_0x23e3('0x79')],_0x40128e[_0x23e3('0x67')][_0x23e3('0x74')],_0x40128e[_0x23e3('0x67')][_0x23e3('0x35')]);}}}else{var _0x1d47e9=_(_0x3a6b82[_0x23e3('0x43')])['keys']()[_0x23e3('0x39')](function(_0x1cf627){return _[_0x23e3('0x7a')](_0x183ded,[_0x23e3('0x37'),_0x1cf627])?_0x1cf627:undefined;})[_0x23e3('0x7b')]()[_0x23e3('0x67')]();if(!_[_0x23e3('0x7c')](_0x1d47e9)){_0x1d47e9[_0x23e3('0x3c')](function(_0x494a7a){if(_0x494a7a===_0x23e3('0x7d')){_0x31edb1[_0x23e3('0x4d')](_0x23e3('0x7e'),[][_0x23e3('0x7f')](_0x3a6b82[_0x23e3('0x43')][_0x494a7a]));}else if(_0x494a7a===_0x23e3('0x80')){var _0x452438=JSON[_0x23e3('0x81')](_0x3a6b82['query'][_0x494a7a])[_0x23e3('0x82')];var _0x5b6bde=JSON[_0x23e3('0x81')](_0x3a6b82[_0x23e3('0x43')][_0x494a7a])['$lte'];_0x31edb1['where'](_0x23e3('0x83'),_0x452438,_0x5b6bde);}else{if(_0x3a6b82['query'][_0x494a7a]===_0x23e3('0x84')){_0x31edb1[_0x23e3('0x4d')]('i.'+_0x494a7a+'\x20IS\x20NULL');}else{_0x31edb1[_0x23e3('0x4d')]('i.'+_0x494a7a+'\x20=\x20?',_0x3a6b82[_0x23e3('0x43')][_0x494a7a]);}}});}if(_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x85')]){if(_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x85')]==0x1){_0x31edb1[_0x23e3('0x68')]('`unreadMessages`\x20=\x200');}else{_0x31edb1[_0x23e3('0x68')](_0x23e3('0x86'));}}if(_0x3a6b82[_0x23e3('0x43')]['tag']){_0x2fb92a=_[_0x23e3('0x87')](_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x88')])?_0x3a6b82[_0x23e3('0x43')]['tag']:new Array(_0x3a6b82['query'][_0x23e3('0x88')]);_0x2fb92a[_0x23e3('0x3c')](function(_0x17429f){_0x2ed9ab['or'](_0x23e3('0x76'),'%,'+_0x17429f+',%');});}if(_0x3a6b82[_0x23e3('0x43')]['filter']){var _0x4b7194=_0x3a6b82[_0x23e3('0x43')][_0x23e3('0x89')][_0x23e3('0x8a')]('\x5c','\x5c\x5c')[_0x23e3('0x8a')]('\x27\x27',_0x23e3('0x8b'));if(qs[_0x23e3('0x8c')](_0x4b7194)){_0x16c892['or'](_0x23e3('0x8d'),_0x4b7194+'%');}else{_0x16c892['or'](_0x23e3('0x8e'),qs[_0x23e3('0x6e')](_0x4b7194))['or'](_0x23e3('0x8f'),_0x4b7194+'%');}}}_0x31edb1[_0x23e3('0x4d')](_0x16c892);_0x31edb1[_0x23e3('0x90')](_0x23e3('0x91'));var _0x25e5fe={'type':db['Sequelize'][_0x23e3('0x92')][_0x23e3('0x93')],'raw':!![]};var _0x308fa4=_0x31edb1[_0x23e3('0x94')]();_0x308fa4[_0x23e3('0x4f')]('i.id');_0x308fa4[_0x23e3('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1c3ce2[_0x23e3('0x4b')]){_0x1c3ce2[_0x23e3('0x4b')][_0x23e3('0x3c')](function(_0x127730){_0x31edb1[_0x23e3('0x4b')]('i.'+_0x127730[0x0],_0x127730[0x1]===_0x23e3('0x95')?![]:!![]);});}if(!_[_0x23e3('0x7c')](_0x2fb92a)){_0x31edb1[_0x23e3('0x68')](_0x2ed9ab);_0x308fa4[_0x23e3('0x4d')](_0x23e3('0x96'),_0x2fb92a);}BPromise[_0x23e3('0x97')]()['then'](function(){if(!_0x412dd0)return;return _0x3a6b82[_0x23e3('0x98')][_0x23e3('0x99')]({'attributes':['id'],'raw':!![]})[_0x23e3('0x21')](function(_0x298ffc){_0x308fa4[_0x23e3('0x4d')](_0x23e3('0x7e'),_['map'](_0x298ffc,'id'));_0x31edb1[_0x23e3('0x4d')](_0x23e3('0x7e'),_['map'](_0x298ffc,'id'));});})[_0x23e3('0x21')](function(){db[_0x23e3('0x9a')][_0x23e3('0x43')](_0x308fa4[_0x23e3('0x9b')](),_0x25e5fe)[_0x23e3('0x21')](function(_0x48195f){_0x3f0c2d['count']=_0x48195f[_0x23e3('0x48')];if(_0x3f0c2d[_0x23e3('0x2e')]===0x0)return[];return db[_0x23e3('0x9a')][_0x23e3('0x43')](_0x1a1a7a['toString'](),_0x25e5fe)[_0x23e3('0x21')](function(_0xb28de){_0x2caf7b=_['keyBy'](_0xb28de,'id');_0x25e5fe=_[_0x23e3('0x9c')](_0x25e5fe,{'model':db[_0x23e3('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x31edb1[_0x23e3('0x4f')](_0x23e3('0x9e'),_0x23e3('0x66'));_0x31edb1[_0x23e3('0x4f')](_0x23e3('0x9f'),_0x23e3('0xa0'));_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xa1'),'Account.mandatoryDisposition');_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xa2'));_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xa3'),'Contact.firstName');_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xa4'),_0x23e3('0xa5'));_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xa6'),_0x23e3('0xa7'));_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xa8'),_0x23e3('0xa9'));_0x31edb1[_0x23e3('0x4f')](_0x23e3('0xaa'),_0x23e3('0xab'));_0x31edb1['field'](_0x23e3('0xac'),_0x23e3('0xad'));_0x31edb1[_0x23e3('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x23e3('0x3a'));_0x31edb1[_0x23e3('0x30')](_0x1c3ce2[_0x23e3('0x30')]);_0x31edb1[_0x23e3('0x2f')](_0x1c3ce2[_0x23e3('0x2f')]);return db[_0x23e3('0x9a')][_0x23e3('0x43')](_0x31edb1[_0x23e3('0x9b')](),_0x25e5fe);})['then'](function(_0x4442f6){_0x562e8d['where'](_0x23e3('0xae'),_[_0x23e3('0x39')](_0x4442f6,'id'));return db['sequelize'][_0x23e3('0x43')](_0x562e8d[_0x23e3('0x9b')](),_0x25e5fe)[_0x23e3('0x21')](function(_0x29abe7){var _0x15de76=_[_0x23e3('0xaf')](_0x29abe7,_0x23e3('0xb0'));var _0x5a9923=[];_0x4442f6['forEach'](function(_0x4a53f0){_0x5a9923['push'](updateChatInteraction(_0x4a53f0,_0x2caf7b,_0x15de76));});return BPromise['all'](_0x5a9923);});});})[_0x23e3('0x21')](function(_0x1a7207){_0x3f0c2d[_0x23e3('0xb1')]=_0x1a7207;return _0x3f0c2d;})['then'](respondWithFilteredResult(_0x3aec16,_0x1c3ce2));})['catch'](handleError(_0x3aec16,null));};exports[_0x23e3('0xb2')]=function(_0xfcf2c3,_0x5f2a48){var _0x3b5af1={'raw':![],'where':{'id':_0xfcf2c3[_0x23e3('0xb3')]['id']}},_0x5c3f09={};_0x5c3f09[_0x23e3('0x42')]=_[_0x23e3('0xb4')](db[_0x23e3('0x9d')][_0x23e3('0xb5')]);_0x5c3f09[_0x23e3('0x43')]=_['keys'](_0xfcf2c3[_0x23e3('0x43')]);_0x5c3f09[_0x23e3('0x44')]=_[_0x23e3('0x45')](_0x5c3f09[_0x23e3('0x42')],_0x5c3f09[_0x23e3('0x43')]);_0x3b5af1[_0x23e3('0x46')]=_[_0x23e3('0x45')](_0x5c3f09['model'],qs[_0x23e3('0x47')](_0xfcf2c3['query'][_0x23e3('0x47')]));_0x3b5af1[_0x23e3('0x46')]=_0x3b5af1[_0x23e3('0x46')][_0x23e3('0x48')]?_0x3b5af1[_0x23e3('0x46')]:_0x5c3f09[_0x23e3('0x42')];if(_0xfcf2c3[_0x23e3('0x43')][_0x23e3('0xb6')]){_0x3b5af1[_0x23e3('0xb7')]=[{'all':!![]}];}_0x3b5af1=_[_0x23e3('0x9c')]({},_0x3b5af1,_0xfcf2c3[_0x23e3('0xb8')]);return db[_0x23e3('0x9d')][_0x23e3('0x70')](_0x3b5af1)[_0x23e3('0x21')](handleEntityNotFound(_0x5f2a48,null))[_0x23e3('0x21')](respondWithResult(_0x5f2a48,null))[_0x23e3('0x2b')](handleError(_0x5f2a48,null));};exports['create']=function(_0x3c1beb,_0x20eed6){return db[_0x23e3('0x9d')]['create'](_0x3c1beb[_0x23e3('0xb9')],{})['then'](respondWithResult(_0x20eed6,0xc9))[_0x23e3('0x2b')](handleError(_0x20eed6,null));};exports[_0x23e3('0x33')]=function(_0x2f4040,_0x13cfd1){if(_0x2f4040[_0x23e3('0xb9')]['id']){delete _0x2f4040[_0x23e3('0xb9')]['id'];}return db[_0x23e3('0x9d')][_0x23e3('0x70')]({'where':{'id':_0x2f4040[_0x23e3('0xb3')]['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x13cfd1,null))[_0x23e3('0x21')](saveUpdates(_0x2f4040[_0x23e3('0xb9')],null))['then'](respondWithResult(_0x13cfd1,null))[_0x23e3('0x2b')](handleError(_0x13cfd1,null));};exports[_0x23e3('0x34')]=function(_0x2e2157,_0x18b193){return db[_0x23e3('0x9d')]['find']({'where':{'id':_0x2e2157[_0x23e3('0xb3')]['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x18b193,null))['then'](removeEntity(_0x18b193,null))[_0x23e3('0x2b')](handleError(_0x18b193,null));};exports[_0x23e3('0xba')]=function(_0x50f727,_0x1672c4){return db[_0x23e3('0x9d')][_0x23e3('0xba')]()[_0x23e3('0x21')](respondWithResult(_0x1672c4,null))['catch'](handleError(_0x1672c4,null));};exports[_0x23e3('0xbb')]=function(_0x4caedd,_0x706f4b){if(_0x4caedd[_0x23e3('0xb9')]['id']){delete _0x4caedd[_0x23e3('0xb9')]['id'];}return db['ChatInteraction'][_0x23e3('0x70')]({'where':{'id':_0x4caedd[_0x23e3('0xb3')]['id']}})['then'](handleEntityNotFound(_0x706f4b,null))[_0x23e3('0x21')](saveUpdates(_0x4caedd['body'],null))[_0x23e3('0x21')](respondWithResult(_0x706f4b,null))[_0x23e3('0x2b')](handleError(_0x706f4b,null));};exports['abandon']=function(_0x3c3a5,_0x30b378,_0x466f9b){if(_0x3c3a5[_0x23e3('0xb9')]['id']){delete _0x3c3a5[_0x23e3('0xb9')]['id'];}return db[_0x23e3('0x9d')][_0x23e3('0x70')]({'where':{'id':_0x3c3a5[_0x23e3('0xb3')]['id']}})[_0x23e3('0x21')](function(_0xc08744){if(!_0xc08744){logger[_0x23e3('0x26')](_0x23e3('0xbc'),_0x23e3('0xbd'),0x194,_0x23e3('0xbe'));_0x30b378[_0x23e3('0x2c')](0x194);}else{if(_0xc08744[_0x23e3('0x78')]){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0xc08744;})[_0x23e3('0x21')](function(_0x20cbda){if(_0x20cbda){return _0x20cbda[_0x23e3('0x33')]({'closed':_0x3c3a5[_0x23e3('0xb9')][_0x23e3('0xbf')],'disposition':_0x3c3a5[_0x23e3('0xb9')]['disposition']})['then'](function(_0x10ecd2){return _0x10ecd2;});}})['then'](function(_0x1814fe){return respondWithRpcPromise(_0x23e3('0xc0'),_0x23e3('0xbd'),_0x3c3a5[_0x23e3('0xb9')],client9004);})[_0x23e3('0x21')](respondWithResult(_0x30b378,null))['catch'](handleError(_0x30b378,null));};exports[_0x23e3('0xc1')]=function(_0x37c0ae,_0x39704b,_0x36273d){_0x37c0ae[_0x23e3('0xb9')][_0x23e3('0x37')]=_0x37c0ae['file'][_0x23e3('0xc2')];_0x37c0ae['body'][_0x23e3('0xc3')]=_0x37c0ae['file']['filename'];_0x37c0ae[_0x23e3('0xb9')]['type']=_0x37c0ae[_0x23e3('0xc4')][_0x23e3('0xc5')];return db['Attachment'][_0x23e3('0xc6')](_0x37c0ae[_0x23e3('0xb9')])[_0x23e3('0x21')](respondWithResult(_0x39704b,0xc9))[_0x23e3('0x2b')](handleError(_0x39704b,null));};exports[_0x23e3('0xc7')]=function(_0x1f66d9,_0x437013,_0x2df322){return db[_0x23e3('0x9d')][_0x23e3('0xc8')]({'where':{'id':_0x1f66d9[_0x23e3('0xb3')]['id']},'raw':!![]})[_0x23e3('0x21')](handleEntityNotFound(_0x437013,null))['then'](function(_0x307fd1){if(_0x307fd1){if(_0x307fd1[_0x23e3('0xbf')]){return _0x437013['status'](0x193)[_0x23e3('0x31')]({'status':0x193,'message':_0x23e3('0xc9')});}return db[_0x23e3('0xca')][_0x23e3('0xc8')]({'where':{'id':_0x1f66d9['query'][_0x23e3('0xcb')]},'raw':!![]})['then'](handleEntityNotFound(_0x437013,null));}})[_0x23e3('0x21')](function(_0x8da4f1){if(_0x8da4f1){return _0x437013[_0x23e3('0xcc')](path[_0x23e3('0xcd')](config['root'],_0x23e3('0xce'),_0x8da4f1[_0x23e3('0xc3')]));}})[_0x23e3('0x2b')](handleError(_0x437013,null));};exports['close']=function(_0x6a3250,_0x3922de){var _0x433177=null;var _0x57be23=null;var _0x319abe=null;var _0x3592f3=null;if(_0x6a3250[_0x23e3('0xb9')]['id']){delete _0x6a3250[_0x23e3('0xb9')]['id'];}if(_0x6a3250['body'][_0x23e3('0xcf')]){_0x3592f3=path[_0x23e3('0xcd')](config['root'],_0x23e3('0xd0'),util['format']('transcript-%s.txt',Date[_0x23e3('0xd1')]()));_0x6a3250[_0x23e3('0xb9')]['pathTranscript']=_0x3592f3;}return db['ChatInteraction'][_0x23e3('0x70')]({'where':{'id':_0x6a3250[_0x23e3('0xb3')]['id']},'include':[{'model':db[_0x23e3('0xd2')],'as':_0x23e3('0xd3'),'include':[{'model':db[_0x23e3('0xd4')],'as':_0x23e3('0xd4')}]}]})[_0x23e3('0x21')](handleEntityNotFound(_0x3922de,null))[_0x23e3('0x21')](saveUpdates(_0x6a3250['body'],null))[_0x23e3('0x21')](function(_0x4c7a94){if(_0x4c7a94){_0x433177=_0x4c7a94;return db['ChatWebsite'][_0x23e3('0x70')]({'where':{'id':_0x433177[_0x23e3('0x7d')]}});}})[_0x23e3('0x21')](function(_0x5894ee){if(_0x5894ee){_0x319abe=_0x5894ee;return db[_0x23e3('0xd5')]['find']({'where':{'id':_0x433177[_0x23e3('0x71')]}});}})[_0x23e3('0x21')](function(_0x469ca6){if(_0x469ca6){_0x57be23=_0x469ca6;if(_0x3592f3){var _0x118549=null;for(var _0x47c802=0x1;_0x47c802<_0x433177[_0x23e3('0xd3')][_0x23e3('0x48')];++_0x47c802){_0x118549=_0x433177[_0x23e3('0xd3')][_0x47c802];var _0x4dfd7c=_0x118549[_0x23e3('0x78')]?util['format']('%s%d',_0x319abe[_0x23e3('0xd6')],_0x118549[_0x23e3('0x78')]):_0x23e3('0xd7');var _0x4f0d26=_0x6a3250[_0x23e3('0xb9')]['customer']||util[_0x23e3('0xd8')](_0x23e3('0xd9'),'Visitor',_0x118549[_0x23e3('0x71')]);switch(_0x319abe[_0x23e3('0xda')]){case _0x23e3('0xdb'):_0x4dfd7c=_0x118549[_0x23e3('0x78')]?util[_0x23e3('0xd8')](_0x23e3('0xd9'),_0x319abe[_0x23e3('0xd6')],_0x118549[_0x23e3('0x78')]):_0x23e3('0xd7');break;case'agent_alias':_0x4dfd7c=_0x118549[_0x23e3('0x78')]?_0x118549[_0x23e3('0xd4')][_0x23e3('0xdc')]||_0x118549[_0x23e3('0xd4')][_0x23e3('0xdd')]:_0x23e3('0xd7');break;case _0x23e3('0xde'):_0x4dfd7c=_0x118549[_0x23e3('0x78')]?_0x118549['User'][_0x23e3('0xdd')]:_0x23e3('0xd7');break;default:_0x4dfd7c=_0x118549[_0x23e3('0x78')]?util[_0x23e3('0xd8')](_0x23e3('0xd9'),_0x319abe['agentAlias'],_0x118549[_0x23e3('0x78')]):_0x23e3('0xd7');}var _0x3bedd3=util[_0x23e3('0xd8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x118549[_0x23e3('0x80')])[_0x23e3('0xd8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x118549['direction']==='in'?_0x4f0d26:_0x4dfd7c,_0x118549[_0x23e3('0xb9')]);if(!_0x118549[_0x23e3('0xdf')]){fs[_0x23e3('0xe0')](_0x3592f3,_0x3bedd3);}}return db[_0x23e3('0xe1')][_0x23e3('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x23e3('0xe2')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0xfd7484){if(_0xfd7484&&_0xfd7484[_0x23e3('0xe3')]&&_0x6a3250[_0x23e3('0xb9')]){var _0x50155a={'tls':{'rejectUnauthorized':![]}};if(_0xfd7484['Smtp'][_0x23e3('0xe4')]){_0x50155a[_0x23e3('0xe4')]=_0xfd7484[_0x23e3('0xe3')]['service'];}else{_0x50155a[_0x23e3('0xe5')]=_0xfd7484[_0x23e3('0xe3')][_0x23e3('0xe5')];_0x50155a[_0x23e3('0xe6')]=_0xfd7484['Smtp']['port'];_0x50155a[_0x23e3('0xe7')]=_0xfd7484['Smtp'][_0x23e3('0xe7')];}if(_0xfd7484['Smtp'][_0x23e3('0xe8')]){_0x50155a[_0x23e3('0xe9')]={'user':_0xfd7484[_0x23e3('0xe3')]['user'],'pass':_0xfd7484['Smtp'][_0x23e3('0xea')]};}return respondWithRpcPromise(_0x23e3('0xeb'),_0x23e3('0xec'),{'account':_0x50155a,'message':{'from':util['format'](_0x23e3('0xed'),_0xfd7484[_0x23e3('0x37')],_0xfd7484[_0x23e3('0xee')]||_0xfd7484['Smtp'][_0x23e3('0x98')]),'to':_0x6a3250[_0x23e3('0xb9')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x23e3('0xd8')](_0x23e3('0xef'),_0x6a3250[_0x23e3('0xb9')]['mailTranscript']),'attachments':[{'path':_0x3592f3}]}})[_0x23e3('0x21')](function(){return _0x433177;})[_0x23e3('0x2b')](function(_0x2af4bc){console[_0x23e3('0x26')](_0x2af4bc);});}else{return _0x433177;}})[_0x23e3('0x21')](respondWithStatusCode(_0x3922de,0xc8))[_0x23e3('0x2b')](handleError(_0x3922de,null));};exports[_0x23e3('0xf0')]=function(_0x276464,_0x319a4f,_0x184af0){return db['ChatMessage'][_0x23e3('0x70')]({'where':{'id':_0x276464['params']['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x319a4f,null))[_0x23e3('0x21')](function(_0x16fd96){if(_0x16fd96){return _0x16fd96[_0x23e3('0xf0')](_0x276464[_0x23e3('0xb9')][_0x23e3('0xf1')],_[_0x23e3('0xf2')](_0x276464[_0x23e3('0xb9')],[_0x23e3('0xf1'),'id'])||{});}})[_0x23e3('0x21')](respondWithResult(_0x319a4f,null))['catch'](handleError(_0x319a4f,null));};exports[_0x23e3('0xf3')]=function(_0x7be94,_0x2b9a36,_0xf56d86){var _0x2c5aeb={'raw':![],'where':{}};var _0xa65969={};var _0x46142b={'count':0x0,'rows':[]};return db[_0x23e3('0x9d')]['findOne']({'where':{'id':_0x7be94[_0x23e3('0xb3')]['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x2b9a36,null))[_0x23e3('0x21')](function(_0x59148c){if(_0x59148c){_0xa65969[_0x23e3('0x42')]=_['keys'](db['ChatMessage'][_0x23e3('0xb5')]);_0xa65969['query']=_['keys'](_0x7be94['query']);_0xa65969[_0x23e3('0x44')]=_[_0x23e3('0x45')](_0xa65969['model'],_0xa65969['query']);_0x2c5aeb['attributes']=_[_0x23e3('0x45')](_0xa65969[_0x23e3('0x42')],qs[_0x23e3('0x47')](_0x7be94[_0x23e3('0x43')][_0x23e3('0x47')]));_0x2c5aeb[_0x23e3('0x46')]=_0x2c5aeb['attributes']['length']?_0x2c5aeb['attributes']:_0xa65969[_0x23e3('0x42')];if(!_0x7be94[_0x23e3('0x43')][_0x23e3('0x49')](_0x23e3('0x4a'))){_0x2c5aeb[_0x23e3('0x30')]=qs[_0x23e3('0x30')](_0x7be94[_0x23e3('0x43')]['limit']);_0x2c5aeb[_0x23e3('0x2f')]=qs['offset'](_0x7be94['query'][_0x23e3('0x2f')]);}_0x2c5aeb[_0x23e3('0x4b')]=qs[_0x23e3('0x4c')](_0x7be94['query'][_0x23e3('0x4c')]);_0x2c5aeb['where']=qs[_0x23e3('0x44')](_[_0x23e3('0x4e')](_0x7be94[_0x23e3('0x43')],_0xa65969['filters']));_0x2c5aeb[_0x23e3('0x4d')]['ChatInteractionId']=_0x59148c['id'];if(_0x7be94[_0x23e3('0x43')][_0x23e3('0x89')]){_0x2c5aeb[_0x23e3('0x4d')]=_[_0x23e3('0x9c')](_0x2c5aeb['where'],{'$or':_[_0x23e3('0x39')](_0x2c5aeb[_0x23e3('0x46')],function(_0x3e327f){var _0x5c4eab={};_0x5c4eab[_0x3e327f]={'$like':'%'+_0x7be94['query'][_0x23e3('0x89')]+'%'};return _0x5c4eab;})});}if(_0x7be94[_0x23e3('0x43')][_0x23e3('0x82')]){var _0x1d4141=_0x7be94[_0x23e3('0x43')]['$gte'][_0x23e3('0x3b')](',');var _0x301730={};_0x301730[_0x1d4141[0x0]]={'$gte':moment(_0x1d4141[0x1])[_0x23e3('0xd8')](_0x23e3('0xf4'))};_0x2c5aeb[_0x23e3('0x4d')]=_[_0x23e3('0x9c')](_0x2c5aeb['where'],_0x301730);}_0x2c5aeb=_[_0x23e3('0x9c')]({},_0x2c5aeb,_0x7be94[_0x23e3('0xb8')]);return db[_0x23e3('0xd2')]['count']({'where':_0x2c5aeb[_0x23e3('0x4d')]})['then'](function(_0x44a426){_0x46142b['count']=_0x44a426;if(_0x7be94[_0x23e3('0x43')][_0x23e3('0xb6')]){_0x2c5aeb[_0x23e3('0xb7')]=[{'all':!![]}];}return db[_0x23e3('0xd2')][_0x23e3('0xf5')](_0x2c5aeb);})[_0x23e3('0x21')](function(_0x4a67d1){_0x46142b[_0x23e3('0xb1')]=_0x4a67d1;return _0x46142b;});}})[_0x23e3('0x21')](respondWithFilteredResult(_0x2b9a36,_0x2c5aeb))['catch'](handleError(_0x2b9a36,null));};exports[_0x23e3('0xf6')]=function(_0x285abe,_0x2fd86d,_0x4a4536){var _0x2de5d9={'where':{}},_0x45b6c6={},_0x32f0e0={'count':0x0,'rows':[]};return db[_0x23e3('0x9d')]['findOne']({'where':{'id':_0x285abe[_0x23e3('0xb3')]['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x2fd86d,null))[_0x23e3('0x21')](function(_0x278a65){if(_0x278a65){_0x45b6c6[_0x23e3('0x42')]=_['keys'](db[_0x23e3('0xd2')][_0x23e3('0xb5')]);_0x45b6c6[_0x23e3('0x43')]=_[_0x23e3('0xb4')](_0x285abe[_0x23e3('0x43')]);_0x45b6c6[_0x23e3('0x44')]=_[_0x23e3('0x45')](_0x45b6c6[_0x23e3('0x42')],_0x45b6c6[_0x23e3('0x43')]);_0x2de5d9[_0x23e3('0x46')]=_[_0x23e3('0x45')](_0x45b6c6[_0x23e3('0x42')],qs[_0x23e3('0x47')](_0x285abe[_0x23e3('0x43')][_0x23e3('0x47')]));_0x2de5d9[_0x23e3('0x46')]=_0x2de5d9[_0x23e3('0x46')]['length']?_0x2de5d9['attributes']:_0x45b6c6[_0x23e3('0x42')];if(!_0x285abe[_0x23e3('0x43')][_0x23e3('0x49')]('nolimit')){_0x2de5d9[_0x23e3('0x30')]=qs['limit'](_0x285abe[_0x23e3('0x43')][_0x23e3('0x30')]);_0x2de5d9['offset']=qs[_0x23e3('0x2f')](_0x285abe[_0x23e3('0x43')]['offset']);}_0x2de5d9[_0x23e3('0x4b')]=qs[_0x23e3('0x4c')](_0x285abe[_0x23e3('0x43')][_0x23e3('0x4c')]);_0x2de5d9['where']=qs[_0x23e3('0x44')](_[_0x23e3('0x4e')](_0x285abe['query'],_0x45b6c6[_0x23e3('0x44')]));_0x2de5d9[_0x23e3('0x4d')][_0x23e3('0xb0')]=_0x278a65['id'];if(_0x285abe['query'][_0x23e3('0x89')]){_0x2de5d9[_0x23e3('0x4d')]=_[_0x23e3('0x9c')](_0x2de5d9['where'],{'$or':_['map'](_0x2de5d9[_0x23e3('0x46')],function(_0x53911e){var _0x35b8cd={};_0x35b8cd[_0x53911e]={'$like':'%'+_0x285abe[_0x23e3('0x43')]['filter']+'%'};return _0x35b8cd;})});}_0x2de5d9[_0x23e3('0x4d')][_0x23e3('0xdf')]=![];if(_0x285abe[_0x23e3('0x43')]['id']){_0x2de5d9[_0x23e3('0x4d')]['id']={'$gt':_0x285abe[_0x23e3('0x43')]['id']};}_0x2de5d9=_[_0x23e3('0x9c')]({},_0x2de5d9,_0x285abe[_0x23e3('0xb8')]);return db[_0x23e3('0xd2')]['count']({'where':_0x2de5d9['where']})[_0x23e3('0x21')](function(_0x5be3dc){_0x32f0e0[_0x23e3('0x2e')]=_0x5be3dc;_0x2de5d9[_0x23e3('0xb7')]=[];if(_0x285abe[_0x23e3('0x43')]['includeAgent']){_0x2de5d9[_0x23e3('0xb7')]['push']({'model':db[_0x23e3('0xd4')],'as':_0x23e3('0xd4'),'attributes':['id',_0x23e3('0xdd'),_0x23e3('0xdc')]});}if(_0x285abe[_0x23e3('0x43')]['includeAll']){_0x2de5d9[_0x23e3('0xb7')]=[{'all':!![]}];}return db['ChatMessage'][_0x23e3('0xf5')](_0x2de5d9);})[_0x23e3('0x21')](function(_0x103cbc){_0x32f0e0[_0x23e3('0xb1')]=_0x103cbc;return _0x32f0e0;});}})[_0x23e3('0x21')](respondWithFilteredResult(_0x2fd86d,_0x2de5d9))[_0x23e3('0x2b')](handleError(_0x2fd86d,null));};exports[_0x23e3('0xf7')]=function(_0x191ef5,_0x1c3bb6,_0x35d6dc){return db[_0x23e3('0x9d')]['find']({'where':{'id':_0x191ef5[_0x23e3('0xb3')]['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x1c3bb6,null))['then'](function(_0x5eb510){if(_0x5eb510){return _0x5eb510[_0x23e3('0xf8')](_0x191ef5['body'][_0x23e3('0xf1')],_['omit'](_0x191ef5[_0x23e3('0xb9')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x23e3('0x37'),_0x23e3('0x50')],'where':{'id':_0x191ef5['body'][_0x23e3('0xf1')]}});})[_0x23e3('0x21')](function(_0x3b4065){socket[_0x23e3('0xf9')](_0x23e3('0xfa'),{'id':Number(_0x191ef5[_0x23e3('0xb3')]['id']),'tags':_0x3b4065||[]});return{'id':Number(_0x191ef5[_0x23e3('0xb3')]['id']),'tags':_0x3b4065||[]};});}})['then'](respondWithResult(_0x1c3bb6,null))[_0x23e3('0x2b')](handleError(_0x1c3bb6,null));};exports[_0x23e3('0xfb')]=function(_0x176842,_0x3f3589,_0x108545){return db[_0x23e3('0x9d')]['find']({'where':{'id':_0x176842['params']['id']}})[_0x23e3('0x21')](handleEntityNotFound(_0x3f3589,null))[_0x23e3('0x21')](function(_0x108b8d){if(_0x108b8d){return _0x108b8d[_0x23e3('0xfb')](_0x176842[_0x23e3('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x3f3589,null))[_0x23e3('0x2b')](handleError(_0x3f3589,null));};exports[_0x23e3('0xcc')]=function(_0x28c5ba,_0x417e00){var _0x1fd055=moment()['unix']()[_0x23e3('0x9b')]();var _0x53c2cf=path[_0x23e3('0xcd')](config[_0x23e3('0xfc')],_0x23e3('0xfd'),_0x23e3('0xfe'),_0x23e3('0xff'));var _0x331f30=path[_0x23e3('0xcd')](config[_0x23e3('0xfc')],_0x23e3('0xfd'),_0x23e3('0xfe'),_0x23e3('0x100'));var _0x1e65d9=path['join'](_0x53c2cf,_0x1fd055);var _0xd8b604=util[_0x23e3('0xd8')](_0x23e3('0x101'),_0x28c5ba[_0x23e3('0xb3')]['id'],_0x1fd055);var _0x173a23=path['join'](_0x53c2cf,_0xd8b604);var _0x564379=![];return db['ChatInteraction']['find']({'where':{'id':_0x28c5ba['params']['id']},'include':[{'model':db[_0x23e3('0xd2')],'as':_0x23e3('0xd3'),'attributes':['id',_0x23e3('0xb9'),_0x23e3('0x80'),'direction',_0x23e3('0xdf'),_0x23e3('0x85')],'include':[{'model':db[_0x23e3('0xd4')],'as':'User','attributes':['id',_0x23e3('0xdd')],'raw':!![]},{'model':db['CmContact'],'as':_0x23e3('0x6a'),'attributes':['id',_0x23e3('0x102'),'lastName'],'raw':!![]},{'model':db[_0x23e3('0xca')],'as':_0x23e3('0xca'),'raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x23e3('0x103'),'attributes':['id','name']},{'model':db['User'],'as':_0x23e3('0x104'),'attributes':['id',_0x23e3('0xdd')]}]})[_0x23e3('0x21')](handleEntityNotFound(_0x417e00,null))[_0x23e3('0x21')](function(_0x1ffd8f){if(_0x1ffd8f){var _0x111620=_0x1ffd8f['get']({'plain':!![]});_0x564379=!![];var _0x4a954e={'format':'A4','border':_0x23e3('0x105'),'header':{'height':'40px','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':'30px','contents':{'default':util[_0x23e3('0xd8')](_0x23e3('0x106'),util['format'](_0x23e3('0x107'),_0x23e3('0x108'),_0x111620['id']),moment()[_0x23e3('0xd8')](_0x23e3('0x109'))['toString']())}}};fs[_0x23e3('0x10a')](_0x1e65d9);var _0x567d28={'channel':_0x23e3('0x108'),'account':_0x111620[_0x23e3('0x103')][_0x23e3('0x37')],'agent':_0x111620[_0x23e3('0x104')]?_0x111620[_0x23e3('0x104')][_0x23e3('0xdd')]:_0x23e3('0x10b'),'createdAt':moment(_0x111620[_0x23e3('0x80')])[_0x23e3('0xd8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x23e3('0x9b')](),'closedAt':_0x111620[_0x23e3('0xbf')]?moment(_0x111620[_0x23e3('0x10c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x23e3('0x9b')]():'','disposition':_0x111620[_0x23e3('0x10d')],'chatInfo':{'browser':_0x111620[_0x23e3('0x10e')],'os':_0x111620['osName'],'referer':_0x111620[_0x23e3('0x10f')],'customerIp':_0x111620[_0x23e3('0x110')],'customerPort':_0x111620[_0x23e3('0x111')]?_0x111620[_0x23e3('0x111')]:_0x23e3('0x10b')},'messages':_(_0x111620[_0x23e3('0xd3')])[_0x23e3('0x112')]()[_0x23e3('0x89')]({'secret':![]})[_0x23e3('0x39')](function(_0x21cf7e){if(_0x21cf7e[_0x23e3('0xca')]){var _0x4a4a1a=path['join'](_0x331f30,_0x21cf7e[_0x23e3('0xca')]['basename']);if(fs[_0x23e3('0x113')](_0x4a4a1a)){fs[_0x23e3('0x114')](_0x4a4a1a)[_0x23e3('0x115')](fs['createWriteStream'](path[_0x23e3('0xcd')](_0x1e65d9,_0x21cf7e[_0x23e3('0xca')][_0x23e3('0xc3')])));}}return{'date':moment(_0x21cf7e[_0x23e3('0x80')])[_0x23e3('0xd8')](_0x23e3('0xf4'))[_0x23e3('0x9b')](),'sender':_0x21cf7e[_0x23e3('0x116')]===_0x23e3('0x117')?_0x21cf7e[_0x23e3('0xd4')]?_0x21cf7e[_0x23e3('0xd4')]['fullname']:'System':_0x21cf7e[_0x23e3('0x6a')][_0x23e3('0x102')]+(_0x21cf7e[_0x23e3('0x6a')]['lastName']?'\x20'+_0x21cf7e[_0x23e3('0x6a')][_0x23e3('0x118')]:''),'body':_0x21cf7e[_0x23e3('0xca')]?_0x21cf7e[_0x23e3('0xca')][_0x23e3('0xc3')]:_0x21cf7e[_0x23e3('0xb9')],'direction':_0x21cf7e[_0x23e3('0x116')]===_0x23e3('0x117')?'A':'C','secret':_0x21cf7e[_0x23e3('0xdf')],'read':_0x21cf7e[_0x23e3('0x85')],'attachment':_0x21cf7e[_0x23e3('0xca')]};})[_0x23e3('0x67')]()};return ejs[_0x23e3('0x119')](path[_0x23e3('0xcd')](config[_0x23e3('0xfc')],_0x23e3('0xfd'),'views','downloadInteraction.html'),{'interaction':_0x567d28})['then'](function(_0x145d26){return new BPromise(function(_0x25f833,_0x3e7a15){pdf[_0x23e3('0xc6')](_0x145d26,_0x4a954e)['toFile'](path[_0x23e3('0xcd')](_0x1e65d9,_0x23e3('0x11a')+_0x111620['id']+'-'+_0x1fd055+'.pdf'),function(_0x522475,_0x407538){if(_0x522475)return _0x3e7a15(_0x522475);_0x25f833(_0x407538);});});});}})[_0x23e3('0x21')](function(){if(_0x564379){return new BPromise(function(_0x18dcb3,_0x40b3e0){zipdir(_0x1e65d9,{'saveTo':_0x173a23},function(_0x50809b,_0x523c08){if(_0x50809b)return _0x40b3e0(_0x50809b);return _0x18dcb3(_0x523c08);});})[_0x23e3('0x21')](function(){return new BPromise(function(_0x3b2699,_0x1e854d){rimraf(_0x1e65d9,function(_0x2f8f31){if(_0x2f8f31)_0x1e854d(_0x2f8f31);return _0x3b2699();});});})[_0x23e3('0x21')](function(){return _0x417e00[_0x23e3('0xcc')](_0x173a23,_0xd8b604,function(_0x58981d){if(_0x58981d){console['log'](_0x23e3('0x11b'),_0x58981d);}else{fs[_0x23e3('0x11c')](_0x173a23);}});});}else{return _0x417e00[_0x23e3('0x2c')](0xc8);}})['catch'](handleError(_0x417e00,null));}; \ No newline at end of file +var _0xadc9=['c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','getChatWebsites','sequelize','toString','keyBy','merge','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','push','all','rows','show','includeAll','include','options','create','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','originalname','basename','Attachment','attachmentDownload','findOne','closed','Unauthorized','attachId','download','join','root','server/files/attachments/','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ChatWebsite','CmContact','%s%d','customer','Visitor','agentAlias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','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','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','Account','Owner','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\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','Chat','YYYY-MM-DD','browserName','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','firstName','out','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','Users','map','TagIds','Tags','split','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','select','field','color','from','user_has_chat_interactions','left_join','users','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','having','`\x20=\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x3a05ef,_0x24e452){var _0x1ab302=function(_0x3b919d){while(--_0x3b919d){_0x3a05ef['push'](_0x3a05ef['shift']());}};_0x1ab302(++_0x24e452);}(_0xadc9,0x1e3));var _0x9adc=function(_0x44a998,_0x2e1f91){_0x44a998=_0x44a998-0x0;var _0x1a8c53=_0xadc9[_0x44a998];return _0x1a8c53;};'use strict';var pdf=require(_0x9adc('0x0'));var emlformat=require(_0x9adc('0x1'));var rimraf=require(_0x9adc('0x2'));var zipdir=require(_0x9adc('0x3'));var jsonpatch=require(_0x9adc('0x4'));var rp=require(_0x9adc('0x5'));var moment=require('moment');var BPromise=require(_0x9adc('0x6'));var Mustache=require(_0x9adc('0x7'));var util=require(_0x9adc('0x8'));var path=require(_0x9adc('0x9'));var sox=require(_0x9adc('0xa'));var csv=require('to-csv');var ejs=require(_0x9adc('0xb'));var fs=require('fs');var _=require(_0x9adc('0xc'));var squel=require(_0x9adc('0xd'));var crypto=require(_0x9adc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9adc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9adc('0x10'));var Papa=require('papaparse');var Redis=require(_0x9adc('0x11'));var authService=require(_0x9adc('0x12'));var qs=require(_0x9adc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9adc('0x14'));var logger=require(_0x9adc('0x15'))(_0x9adc('0x16'));var utils=require(_0x9adc('0x17'));var config=require(_0x9adc('0x18'));var db=require(_0x9adc('0x19'))['db'];config['redis']=_[_0x9adc('0x1a')](config[_0x9adc('0x1b')],{'host':_0x9adc('0x1c'),'port':0x18eb});var socket=require(_0x9adc('0x1d'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x9adc('0x1e'));var client=jayson['client'][_0x9adc('0x1f')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x276a36,_0xfc2f86,_0x49c3d6){if(_0x49c3d6){var _0x1fe66a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1fe66a[_0x9adc('0x20')](_0xfc2f86)){return _0x276a36;}else{throw new db['Sequelize'][(_0x9adc('0x21'))](_0x9adc('0x22'));}}else{return _0x276a36;}}function respondWithRpcPromise(_0x414857,_0x19597b,_0x7190d5,_0x136a40){return new BPromise(function(_0x5181e8,_0x174061){var _0x4c80b8=_0x136a40||client;return _0x4c80b8['request'](_0x414857,_0x7190d5)[_0x9adc('0x23')](function(_0x100bd7){logger[_0x9adc('0x24')](_0x9adc('0x25'),_0x19597b,_0x9adc('0x26'));logger[_0x9adc('0x27')](_0x9adc('0x28'),_0x19597b,_0x9adc('0x26'),JSON[_0x9adc('0x29')](_0x100bd7));if(_0x100bd7[_0x9adc('0x2a')]){if(_0x100bd7[_0x9adc('0x2a')][_0x9adc('0x2b')]===0x1f4){logger['error'](_0x9adc('0x25'),_0x19597b,_0x100bd7[_0x9adc('0x2a')][_0x9adc('0x2c')]);return _0x174061(_0x100bd7[_0x9adc('0x2a')][_0x9adc('0x2c')]);}logger[_0x9adc('0x2a')](_0x9adc('0x25'),_0x19597b,_0x100bd7['error']['message']);return _0x5181e8(_0x100bd7[_0x9adc('0x2a')][_0x9adc('0x2c')]);}else{logger[_0x9adc('0x24')](_0x9adc('0x25'),_0x19597b,'request\x20sent');_0x5181e8(_0x100bd7[_0x9adc('0x2d')]['message']);}})[_0x9adc('0x2e')](function(_0xf3e6f0){logger[_0x9adc('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x19597b,_0xf3e6f0);_0x174061(_0xf3e6f0);});});}function respondWithStatusCode(_0x37fe3b,_0x185f22){_0x185f22=_0x185f22||0xcc;return function(_0x950622){if(_0x950622){return _0x37fe3b['sendStatus'](_0x185f22);}return _0x37fe3b[_0x9adc('0x2f')](_0x185f22)[_0x9adc('0x30')]();};}function respondWithResult(_0x3860c8,_0xe3ad22){_0xe3ad22=_0xe3ad22||0xc8;return function(_0x5a2598){if(_0x5a2598){return _0x3860c8['status'](_0xe3ad22)[_0x9adc('0x31')](_0x5a2598);}};}function respondWithFilteredResult(_0x196ddf,_0x10ef8b){return function(_0x5bdac0){if(_0x5bdac0){var _0x27d10f=_0x5bdac0[_0x9adc('0x32')],_0x350449=_0x10ef8b[_0x9adc('0x33')],_0x4ca4d0=_0x10ef8b[_0x9adc('0x33')]+_0x10ef8b[_0x9adc('0x34')],_0x562e27;if(_0x4ca4d0>=_0x27d10f){_0x4ca4d0=_0x27d10f;_0x562e27=0xc8;}else{_0x562e27=0xce;}_0x196ddf[_0x9adc('0x2f')](_0x562e27);return _0x196ddf[_0x9adc('0x35')]('Content-Range',_0x350449+'-'+_0x4ca4d0+'/'+_0x27d10f)[_0x9adc('0x31')](_0x5bdac0);}return null;};}function patchUpdates(_0x5db1b8){return function(_0x37cbe5){try{jsonpatch[_0x9adc('0x36')](_0x37cbe5,_0x5db1b8,!![]);}catch(_0x41a4a5){return BPromise[_0x9adc('0x37')](_0x41a4a5);}return _0x37cbe5[_0x9adc('0x38')]();};}function saveUpdates(_0x53513e,_0x39957f){return function(_0x1932ed){if(_0x1932ed){return _0x1932ed[_0x9adc('0x39')](_0x53513e)[_0x9adc('0x23')](function(_0x20fac5){return _0x20fac5;});}return null;};}function removeEntity(_0x5183cd,_0x3676dc){return function(_0x4f74ed){if(_0x4f74ed){return _0x4f74ed[_0x9adc('0x3a')]()[_0x9adc('0x23')](function(){_0x5183cd[_0x9adc('0x2f')](0xcc)[_0x9adc('0x30')]();});}};}function handleEntityNotFound(_0xcc903e,_0x5ba3fe){return function(_0x376d08){if(!_0x376d08){_0xcc903e[_0x9adc('0x3b')](0x194);}return _0x376d08;};}function handleError(_0x16b87,_0x349e5f){_0x349e5f=_0x349e5f||0x1f4;return function(_0x20cd1b){logger['error'](_0x20cd1b[_0x9adc('0x3c')]);if(_0x20cd1b[_0x9adc('0x3d')]){delete _0x20cd1b[_0x9adc('0x3d')];}_0x16b87[_0x9adc('0x2f')](_0x349e5f)[_0x9adc('0x3e')](_0x20cd1b);};}function getInteractionUsers(_0x5bac0b,_0x1668f1){return new BPromise(function(_0x4c4a6f,_0x25324e){try{if(_0x1668f1[_0x5bac0b['id']]){_0x5bac0b[_0x9adc('0x3f')]=_[_0x9adc('0x40')](_0x1668f1[_0x5bac0b['id']],function(_0x4747a5){return{'id':_0x4747a5['id']};});}}catch(_0x48fa05){_0x25324e(_0x48fa05);}_0x4c4a6f(_0x5bac0b);});}function getInteractionTags(_0x345689,_0x372a8a){return new BPromise(function(_0x13f19f,_0x502d67){try{if(_0x345689[_0x9adc('0x41')]){_0x345689[_0x9adc('0x42')]=[];_0x345689[_0x9adc('0x41')][_0x9adc('0x43')](',')['forEach'](function(_0x2e81e3){_0x345689[_0x9adc('0x42')]['push'](_0x372a8a[_0x2e81e3]);});}delete _0x345689[_0x9adc('0x41')];}catch(_0x6b1a88){_0x502d67(_0x6b1a88);}_0x13f19f(_0x345689);});}function updateChatInteraction(_0x157e12,_0x17f20e,_0x4f6fb7){return new BPromise(function(_0x1e030c,_0x40f075){return getInteractionUsers(_0x157e12,_0x4f6fb7)[_0x9adc('0x23')](function(_0x41eb35){return getInteractionTags(_0x41eb35,_0x17f20e);})[_0x9adc('0x23')](function(_0x2ca889){_0x1e030c(_0x2ca889);})[_0x9adc('0x2e')](function(_0x9267e5){_0x40f075(_0x9267e5);});});}exports[_0x9adc('0x44')]=function(_0x35b121,_0x87d3f9){var _0x26dcb9={},_0x144465={},_0x596eb1={'count':0x0,'rows':[]};var _0x576032=_[_0x9adc('0x40')](db['ChatInteraction'][_0x9adc('0x45')],function(_0x1c7c06){return{'name':_0x1c7c06[_0x9adc('0x46')],'type':_0x1c7c06[_0x9adc('0x47')][_0x9adc('0x48')]};});_0x144465[_0x9adc('0x49')]=_['map'](_0x576032,_0x9adc('0x3d'));_0x144465[_0x9adc('0x4a')]=_['keys'](_0x35b121[_0x9adc('0x4a')]);_0x144465[_0x9adc('0x4b')]=_[_0x9adc('0x4c')](_0x144465[_0x9adc('0x49')],_0x144465[_0x9adc('0x4a')]);_0x26dcb9['attributes']=_[_0x9adc('0x4c')](_0x144465[_0x9adc('0x49')],qs[_0x9adc('0x4d')](_0x35b121[_0x9adc('0x4a')][_0x9adc('0x4d')]));_0x26dcb9[_0x9adc('0x4e')]=_0x26dcb9[_0x9adc('0x4e')]['length']?_0x26dcb9['attributes']:_0x144465[_0x9adc('0x49')];if(!_0x35b121[_0x9adc('0x4a')][_0x9adc('0x4f')](_0x9adc('0x50'))){_0x26dcb9['limit']=qs[_0x9adc('0x34')](_0x35b121['query'][_0x9adc('0x34')]);_0x26dcb9[_0x9adc('0x33')]=qs[_0x9adc('0x33')](_0x35b121['query'][_0x9adc('0x33')]);}_0x26dcb9[_0x9adc('0x51')]=qs[_0x9adc('0x52')](_0x35b121[_0x9adc('0x4a')][_0x9adc('0x52')]);_0x26dcb9['where']=qs[_0x9adc('0x4b')](_['pick'](_0x35b121[_0x9adc('0x4a')],_0x144465[_0x9adc('0x4b')]));var _0x3e1ecf=[];var _0x516064=squel[_0x9adc('0x53')]()[_0x9adc('0x54')]('id')[_0x9adc('0x54')]('name')[_0x9adc('0x54')](_0x9adc('0x55'))[_0x9adc('0x56')]('tools_tags');var _0x2c5449=squel[_0x9adc('0x53')]()[_0x9adc('0x54')]('u.id')[_0x9adc('0x54')]('ui.ChatInteractionId')[_0x9adc('0x56')](_0x9adc('0x57'),'ui')[_0x9adc('0x58')](_0x9adc('0x59'),'u','u.id\x20=\x20ui.UserId');var _0x30e972=squel[_0x9adc('0x53')]()[_0x9adc('0x56')](_0x9adc('0x5a'),'i')[_0x9adc('0x58')]('cm_contacts','c',_0x9adc('0x5b'))['left_join']('users','o',_0x9adc('0x5c'))['left_join']('chat_websites','a',_0x9adc('0x5d'))[_0x9adc('0x58')](_0x9adc('0x5e'),'me',_0x9adc('0x5f'))[_0x9adc('0x58')](_0x9adc('0x60'),'it',_0x9adc('0x61'))[_0x9adc('0x58')](_0x9adc('0x62'),'t','t.id\x20=\x20it.TagId');var _0x8dd3c6=squel[_0x9adc('0x63')]();var _0x135f62=[];var _0x5a66f7=squel[_0x9adc('0x63')]();var _0x365c61;if(_0x35b121[_0x9adc('0x4a')][_0x9adc('0x64')]){_0x365c61=as[_0x9adc('0x65')](_0x35b121[_0x9adc('0x4a')][_0x9adc('0x64')]);var _0x3a5ad1=_0x365c61[_0x9adc('0x66')];for(var _0x513d75=0x0;_0x513d75<_0x365c61[_0x9adc('0x67')][_0x9adc('0x68')];_0x513d75++){var _0x6743f4=_0x365c61[_0x9adc('0x67')][_0x513d75];var _0xb371e1='i';var _0x2509ab=_[_0x9adc('0x69')](_0x576032,[_0x9adc('0x3d'),_0x6743f4['field']]);if(!_0x2509ab){switch(_0x6743f4['field']){case'unreadMessages':if(_0x6743f4['value']==0x1){_0x30e972[_0x9adc('0x6a')]('`'+_0x6743f4[_0x9adc('0x54')]+_0x9adc('0x6b'));}else{_0x30e972[_0x9adc('0x6a')]('`'+_0x6743f4[_0x9adc('0x54')]+'`\x20>\x200');}break;case _0x9adc('0x6c'):if(_0x6743f4[_0x9adc('0x6d')]===_0x9adc('0x6e')){if(_0x6743f4[_0x9adc('0x6f')][_0x9adc('0x43')]('\x20')['length']>0x1){_0x8dd3c6[_0x3a5ad1](_0x9adc('0x70'),qs['getFullTextValue'](_0x6743f4['value']),null);}else{var _0x367e13='%'+_0x6743f4[_0x9adc('0x6f')]+'%';_0x8dd3c6[_0x3a5ad1](_0x9adc('0x71'),_0x367e13,_0x367e13,_0x367e13);}}else{_0x2509ab=_[_0x9adc('0x69')](_0x576032,[_0x9adc('0x3d'),_0x9adc('0x72')]);_0x6743f4[_0x9adc('0x54')]=_0x9adc('0x72');_0x33e4f0=as[_0x9adc('0x73')](_0xb371e1,_0x2509ab['type'],_0x6743f4);_0x8dd3c6[_0x3a5ad1](_0x33e4f0[_0x9adc('0x74')],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x75')],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x30')]);}break;case'Tag':var _0x537cdc=_0x6743f4[_0x9adc('0x6f')]['split'](',')[_0x9adc('0x40')](function(_0x385a27){return Number(_0x385a27);});_0x537cdc[_0x9adc('0x76')](function(_0xc398b1){_0x5a66f7['or'](_0x9adc('0x77'),'%,'+_0xc398b1+',%');});_0x135f62=_[_0x9adc('0x78')](_0x135f62,_0x537cdc);break;case _0x9adc('0x79'):if(_0x6743f4['operator']===_0x9adc('0x6e')){_0x8dd3c6[_0x3a5ad1](_0x9adc('0x7a'),'%'+_0x6743f4[_0x9adc('0x6f')]+'%',null);}else{_0x2509ab=_[_0x9adc('0x69')](_0x576032,[_0x9adc('0x3d'),'UserId']);_0x6743f4[_0x9adc('0x54')]='UserId';_0x33e4f0=as[_0x9adc('0x73')](_0xb371e1,_0x2509ab['type'],_0x6743f4);_0x8dd3c6[_0x3a5ad1](_0x33e4f0[_0x9adc('0x74')],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x75')],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x30')]);}break;case _0x9adc('0x7b'):_0x33e4f0=as[_0x9adc('0x73')]('me',null,_0x6743f4);_0x8dd3c6[_0x3a5ad1](_0x33e4f0['text'],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x75')],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x30')]);break;}}else{var _0x33e4f0=as[_0x9adc('0x73')](_0xb371e1,_0x2509ab[_0x9adc('0x47')],_0x6743f4);_0x8dd3c6[_0x3a5ad1](_0x33e4f0[_0x9adc('0x74')],_0x33e4f0[_0x9adc('0x6f')][_0x9adc('0x75')],_0x33e4f0[_0x9adc('0x6f')]['end']);}}}else{var _0x2856df=_(_0x35b121[_0x9adc('0x4a')])[_0x9adc('0x7c')]()['map'](function(_0x57c350){return _[_0x9adc('0x7d')](_0x576032,[_0x9adc('0x3d'),_0x57c350])?_0x57c350:undefined;})[_0x9adc('0x7e')]()[_0x9adc('0x6f')]();if(!_[_0x9adc('0x7f')](_0x2856df)){_0x2856df[_0x9adc('0x76')](function(_0x515359){if(_0x515359===_0x9adc('0x80')){_0x30e972['where'](_0x9adc('0x81'),[][_0x9adc('0x82')](_0x35b121[_0x9adc('0x4a')][_0x515359]));}else if(_0x515359===_0x9adc('0x83')){var _0x3cdc53=JSON[_0x9adc('0x84')](_0x35b121[_0x9adc('0x4a')][_0x515359])[_0x9adc('0x85')];var _0x105931=JSON[_0x9adc('0x84')](_0x35b121[_0x9adc('0x4a')][_0x515359])['$lte'];_0x30e972[_0x9adc('0x86')](_0x9adc('0x87'),_0x3cdc53,_0x105931);}else{if(_0x35b121[_0x9adc('0x4a')][_0x515359]===_0x9adc('0x88')){_0x30e972[_0x9adc('0x86')]('i.'+_0x515359+_0x9adc('0x89'));}else{_0x30e972[_0x9adc('0x86')]('i.'+_0x515359+_0x9adc('0x8a'),_0x35b121['query'][_0x515359]);}}});}if(_0x35b121['query'][_0x9adc('0x8b')]){if(_0x35b121[_0x9adc('0x4a')]['read']==0x1){_0x30e972[_0x9adc('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x30e972['having'](_0x9adc('0x8c'));}}if(_0x35b121[_0x9adc('0x4a')][_0x9adc('0x8d')]){_0x135f62=_['isArray'](_0x35b121[_0x9adc('0x4a')][_0x9adc('0x8d')])?_0x35b121[_0x9adc('0x4a')][_0x9adc('0x8d')]:new Array(_0x35b121[_0x9adc('0x4a')][_0x9adc('0x8d')]);_0x135f62[_0x9adc('0x76')](function(_0x55e661){_0x5a66f7['or'](_0x9adc('0x77'),'%,'+_0x55e661+',%');});}if(_0x35b121[_0x9adc('0x4a')][_0x9adc('0x8e')]){var _0x587731=_0x35b121[_0x9adc('0x4a')][_0x9adc('0x8e')][_0x9adc('0x8f')]('\x5c','\x5c\x5c')[_0x9adc('0x8f')]('\x27\x27',_0x9adc('0x90'));if(qs[_0x9adc('0x91')](_0x587731)){_0x8dd3c6['or'](_0x9adc('0x92'),_0x587731+'%');}else{_0x8dd3c6['or'](_0x9adc('0x93'),qs[_0x9adc('0x94')](_0x587731))['or'](_0x9adc('0x95'),_0x587731+'%');}}}_0x30e972[_0x9adc('0x86')](_0x8dd3c6);_0x30e972[_0x9adc('0x96')]('i.id');var _0x5535f9={'type':db[_0x9adc('0x97')][_0x9adc('0x98')][_0x9adc('0x99')],'raw':!![]};var _0xd2d2d5=_0x30e972[_0x9adc('0x9a')]();_0xd2d2d5[_0x9adc('0x54')](_0x9adc('0x9b'));_0xd2d2d5[_0x9adc('0x54')](_0x9adc('0x9c'),_0x9adc('0x9d'));if(_0x26dcb9[_0x9adc('0x51')]){_0x26dcb9['order'][_0x9adc('0x76')](function(_0xc04515){_0x30e972[_0x9adc('0x51')]('i.'+_0xc04515[0x0],_0xc04515[0x1]===_0x9adc('0x9e')?![]:!![]);});}if(!_[_0x9adc('0x7f')](_0x135f62)){_0x30e972[_0x9adc('0x6a')](_0x5a66f7);_0xd2d2d5[_0x9adc('0x86')](_0x9adc('0x9f'),_0x135f62);}BPromise[_0x9adc('0xa0')]()[_0x9adc('0x23')](function(){if(!_0x365c61)return;return _0x35b121['user'][_0x9adc('0xa1')]({'attributes':['id'],'raw':!![]})[_0x9adc('0x23')](function(_0x4136c8){_0xd2d2d5[_0x9adc('0x86')](_0x9adc('0x81'),_['map'](_0x4136c8,'id'));_0x30e972[_0x9adc('0x86')](_0x9adc('0x81'),_[_0x9adc('0x40')](_0x4136c8,'id'));});})['then'](function(){db[_0x9adc('0xa2')][_0x9adc('0x4a')](_0xd2d2d5[_0x9adc('0xa3')](),_0x5535f9)['then'](function(_0x3dbaed){_0x596eb1['count']=_0x3dbaed[_0x9adc('0x68')];if(_0x596eb1['count']===0x0)return[];return db[_0x9adc('0xa2')][_0x9adc('0x4a')](_0x516064['toString'](),_0x5535f9)[_0x9adc('0x23')](function(_0x31fe15){_0x3e1ecf=_[_0x9adc('0xa4')](_0x31fe15,'id');_0x5535f9=_[_0x9adc('0xa5')](_0x5535f9,{'model':db[_0x9adc('0xa6')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x30e972[_0x9adc('0x54')](_0x9adc('0x9c'),'unreadMessages');_0x30e972[_0x9adc('0x54')](_0x9adc('0xa7'),_0x9adc('0xa8'));_0x30e972['field'](_0x9adc('0xa9'),'Account.mandatoryDisposition');_0x30e972[_0x9adc('0x54')](_0x9adc('0xaa'));_0x30e972[_0x9adc('0x54')](_0x9adc('0xab'),'Contact.firstName');_0x30e972[_0x9adc('0x54')](_0x9adc('0xac'),_0x9adc('0xad'));_0x30e972[_0x9adc('0x54')](_0x9adc('0xae'),_0x9adc('0xaf'));_0x30e972[_0x9adc('0x54')](_0x9adc('0xb0'),_0x9adc('0xb1'));_0x30e972[_0x9adc('0x54')](_0x9adc('0xb2'),_0x9adc('0xb3'));_0x30e972[_0x9adc('0x54')](_0x9adc('0xb4'),_0x9adc('0xb5'));_0x30e972[_0x9adc('0x54')](_0x9adc('0xb6'),'TagIds');_0x30e972[_0x9adc('0x34')](_0x26dcb9[_0x9adc('0x34')]);_0x30e972[_0x9adc('0x33')](_0x26dcb9[_0x9adc('0x33')]);return db[_0x9adc('0xa2')][_0x9adc('0x4a')](_0x30e972[_0x9adc('0xa3')](),_0x5535f9);})['then'](function(_0x10c1e1){_0x2c5449[_0x9adc('0x86')](_0x9adc('0xb7'),_[_0x9adc('0x40')](_0x10c1e1,'id'));return db[_0x9adc('0xa2')]['query'](_0x2c5449[_0x9adc('0xa3')](),_0x5535f9)[_0x9adc('0x23')](function(_0x281fa7){var _0x5ada81=_[_0x9adc('0xb8')](_0x281fa7,'ChatInteractionId');var _0x341add=[];_0x10c1e1['forEach'](function(_0x4973d6){_0x341add[_0x9adc('0xb9')](updateChatInteraction(_0x4973d6,_0x3e1ecf,_0x5ada81));});return BPromise[_0x9adc('0xba')](_0x341add);});});})[_0x9adc('0x23')](function(_0x3041aa){_0x596eb1[_0x9adc('0xbb')]=_0x3041aa;return _0x596eb1;})[_0x9adc('0x23')](respondWithFilteredResult(_0x87d3f9,_0x26dcb9));})[_0x9adc('0x2e')](handleError(_0x87d3f9,null));};exports[_0x9adc('0xbc')]=function(_0x3eb5bf,_0x1bd463){var _0x25beaf={'raw':![],'where':{'id':_0x3eb5bf['params']['id']}},_0x29d9d0={};_0x29d9d0[_0x9adc('0x49')]=_[_0x9adc('0x7c')](db[_0x9adc('0xa6')][_0x9adc('0x45')]);_0x29d9d0[_0x9adc('0x4a')]=_[_0x9adc('0x7c')](_0x3eb5bf[_0x9adc('0x4a')]);_0x29d9d0[_0x9adc('0x4b')]=_[_0x9adc('0x4c')](_0x29d9d0[_0x9adc('0x49')],_0x29d9d0['query']);_0x25beaf[_0x9adc('0x4e')]=_[_0x9adc('0x4c')](_0x29d9d0[_0x9adc('0x49')],qs[_0x9adc('0x4d')](_0x3eb5bf[_0x9adc('0x4a')][_0x9adc('0x4d')]));_0x25beaf[_0x9adc('0x4e')]=_0x25beaf[_0x9adc('0x4e')]['length']?_0x25beaf['attributes']:_0x29d9d0[_0x9adc('0x49')];if(_0x3eb5bf[_0x9adc('0x4a')][_0x9adc('0xbd')]){_0x25beaf[_0x9adc('0xbe')]=[{'all':!![]}];}_0x25beaf=_[_0x9adc('0xa5')]({},_0x25beaf,_0x3eb5bf[_0x9adc('0xbf')]);return db[_0x9adc('0xa6')][_0x9adc('0x69')](_0x25beaf)[_0x9adc('0x23')](handleEntityNotFound(_0x1bd463,null))[_0x9adc('0x23')](respondWithResult(_0x1bd463,null))['catch'](handleError(_0x1bd463,null));};exports[_0x9adc('0xc0')]=function(_0x3531e5,_0x38f415){return db[_0x9adc('0xa6')]['create'](_0x3531e5['body'],{})[_0x9adc('0x23')](respondWithResult(_0x38f415,0xc9))[_0x9adc('0x2e')](handleError(_0x38f415,null));};exports[_0x9adc('0x39')]=function(_0x1dbcad,_0x49c3c5){if(_0x1dbcad['body']['id']){delete _0x1dbcad[_0x9adc('0x7b')]['id'];}return db[_0x9adc('0xa6')]['find']({'where':{'id':_0x1dbcad[_0x9adc('0xc1')]['id']}})[_0x9adc('0x23')](handleEntityNotFound(_0x49c3c5,null))['then'](saveUpdates(_0x1dbcad[_0x9adc('0x7b')],null))[_0x9adc('0x23')](respondWithResult(_0x49c3c5,null))[_0x9adc('0x2e')](handleError(_0x49c3c5,null));};exports[_0x9adc('0x3a')]=function(_0x2dfc5c,_0x560ee7){return db[_0x9adc('0xa6')][_0x9adc('0x69')]({'where':{'id':_0x2dfc5c[_0x9adc('0xc1')]['id']}})[_0x9adc('0x23')](handleEntityNotFound(_0x560ee7,null))['then'](removeEntity(_0x560ee7,null))[_0x9adc('0x2e')](handleError(_0x560ee7,null));};exports[_0x9adc('0xc2')]=function(_0x597158,_0x50c10f){return db[_0x9adc('0xa6')]['describe']()[_0x9adc('0x23')](respondWithResult(_0x50c10f,null))['catch'](handleError(_0x50c10f,null));};exports[_0x9adc('0xc3')]=function(_0x2e3e62,_0x41683b){if(_0x2e3e62['body']['id']){delete _0x2e3e62[_0x9adc('0x7b')]['id'];}return db[_0x9adc('0xa6')][_0x9adc('0x69')]({'where':{'id':_0x2e3e62[_0x9adc('0xc1')]['id']}})['then'](handleEntityNotFound(_0x41683b,null))[_0x9adc('0x23')](saveUpdates(_0x2e3e62[_0x9adc('0x7b')],null))[_0x9adc('0x23')](respondWithResult(_0x41683b,null))[_0x9adc('0x2e')](handleError(_0x41683b,null));};exports[_0x9adc('0xc4')]=function(_0x25609a,_0x349a2,_0x519aa8){if(_0x25609a[_0x9adc('0x7b')]['id']){delete _0x25609a['body']['id'];}return db[_0x9adc('0xa6')][_0x9adc('0x69')]({'where':{'id':_0x25609a['params']['id']}})[_0x9adc('0x23')](function(_0x40e2db){if(!_0x40e2db){logger[_0x9adc('0x2a')](_0x9adc('0xc5'),_0x9adc('0xc4'),0x194,_0x9adc('0xc6'));_0x349a2[_0x9adc('0x3b')](0x194);}else{if(_0x40e2db[_0x9adc('0xc7')]){throw new db[(_0x9adc('0x97'))][(_0x9adc('0x21'))](_0x9adc('0xc8'));}}return _0x40e2db;})[_0x9adc('0x23')](function(_0x4078dd){if(_0x4078dd){return _0x4078dd[_0x9adc('0x39')]({'closed':_0x25609a[_0x9adc('0x7b')]['closed'],'disposition':_0x25609a[_0x9adc('0x7b')][_0x9adc('0xc9')]})[_0x9adc('0x23')](function(_0x2c7ab5){return _0x2c7ab5;});}})[_0x9adc('0x23')](function(_0x4c6a59){return respondWithRpcPromise(_0x9adc('0xca'),_0x9adc('0xc4'),_0x25609a[_0x9adc('0x7b')],client9004);})[_0x9adc('0x23')](respondWithResult(_0x349a2,null))[_0x9adc('0x2e')](handleError(_0x349a2,null));};exports['attachmentUpload']=function(_0x2e8054,_0x1c169,_0x1eda2e){_0x2e8054['body'][_0x9adc('0x3d')]=_0x2e8054[_0x9adc('0xcb')][_0x9adc('0xcc')];_0x2e8054['body'][_0x9adc('0xcd')]=_0x2e8054[_0x9adc('0xcb')]['filename'];_0x2e8054[_0x9adc('0x7b')]['type']=_0x2e8054[_0x9adc('0xcb')]['mimetype'];return db[_0x9adc('0xce')][_0x9adc('0xc0')](_0x2e8054[_0x9adc('0x7b')])[_0x9adc('0x23')](respondWithResult(_0x1c169,0xc9))[_0x9adc('0x2e')](handleError(_0x1c169,null));};exports[_0x9adc('0xcf')]=function(_0x12a542,_0x3cee53,_0x195f6a){return db['ChatInteraction'][_0x9adc('0xd0')]({'where':{'id':_0x12a542['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3cee53,null))[_0x9adc('0x23')](function(_0x36a897){if(_0x36a897){if(_0x36a897[_0x9adc('0xd1')]){return _0x3cee53[_0x9adc('0x2f')](0x193)[_0x9adc('0x31')]({'status':0x193,'message':_0x9adc('0xd2')});}return db['Attachment'][_0x9adc('0xd0')]({'where':{'id':_0x12a542[_0x9adc('0x4a')][_0x9adc('0xd3')]},'raw':!![]})['then'](handleEntityNotFound(_0x3cee53,null));}})[_0x9adc('0x23')](function(_0x513d74){if(_0x513d74){return _0x3cee53[_0x9adc('0xd4')](path[_0x9adc('0xd5')](config[_0x9adc('0xd6')],_0x9adc('0xd7'),_0x513d74[_0x9adc('0xcd')]));}})[_0x9adc('0x2e')](handleError(_0x3cee53,null));};exports[_0x9adc('0xd8')]=function(_0x255a35,_0x1ff450){var _0x37b6ce=null;var _0x302f67=null;var _0x110f87=null;var _0x49f6d1=null;if(_0x255a35[_0x9adc('0x7b')]['id']){delete _0x255a35['body']['id'];}if(_0x255a35[_0x9adc('0x7b')][_0x9adc('0xd9')]){_0x49f6d1=path[_0x9adc('0xd5')](config[_0x9adc('0xd6')],'server/files/chat/upload/',util[_0x9adc('0xda')](_0x9adc('0xdb'),Date['now']()));_0x255a35[_0x9adc('0x7b')][_0x9adc('0xdc')]=_0x49f6d1;}return db[_0x9adc('0xa6')]['find']({'where':{'id':_0x255a35[_0x9adc('0xc1')]['id']},'include':[{'model':db[_0x9adc('0xdd')],'as':_0x9adc('0xde'),'include':[{'model':db[_0x9adc('0x79')],'as':_0x9adc('0x79')}]}]})['then'](handleEntityNotFound(_0x1ff450,null))[_0x9adc('0x23')](saveUpdates(_0x255a35[_0x9adc('0x7b')],null))['then'](function(_0x1aaa44){if(_0x1aaa44){_0x37b6ce=_0x1aaa44;return db[_0x9adc('0xdf')][_0x9adc('0x69')]({'where':{'id':_0x37b6ce['ChatWebsiteId']}});}})['then'](function(_0x673ac8){if(_0x673ac8){_0x110f87=_0x673ac8;return db[_0x9adc('0xe0')][_0x9adc('0x69')]({'where':{'id':_0x37b6ce[_0x9adc('0x72')]}});}})[_0x9adc('0x23')](function(_0x5b219e){if(_0x5b219e){_0x302f67=_0x5b219e;if(_0x49f6d1){var _0x15acc5=null;for(var _0x5e0ee4=0x1;_0x5e0ee4<_0x37b6ce[_0x9adc('0xde')][_0x9adc('0x68')];++_0x5e0ee4){_0x15acc5=_0x37b6ce['Messages'][_0x5e0ee4];var _0x2e5869=_0x15acc5[_0x9adc('0xc7')]?util[_0x9adc('0xda')](_0x9adc('0xe1'),_0x110f87['agentAlias'],_0x15acc5[_0x9adc('0xc7')]):'System';var _0x5f5740=_0x255a35[_0x9adc('0x7b')][_0x9adc('0xe2')]||util[_0x9adc('0xda')](_0x9adc('0xe1'),_0x9adc('0xe3'),_0x15acc5[_0x9adc('0x72')]);switch(_0x110f87['agentIdentifier']){case'website_alias':_0x2e5869=_0x15acc5[_0x9adc('0xc7')]?util[_0x9adc('0xda')](_0x9adc('0xe1'),_0x110f87[_0x9adc('0xe4')],_0x15acc5[_0x9adc('0xc7')]):_0x9adc('0xe5');break;case _0x9adc('0xe6'):_0x2e5869=_0x15acc5[_0x9adc('0xc7')]?_0x15acc5[_0x9adc('0x79')][_0x9adc('0xe7')]||_0x15acc5['User'][_0x9adc('0xe8')]:'System';break;case _0x9adc('0xe9'):_0x2e5869=_0x15acc5[_0x9adc('0xc7')]?_0x15acc5['User'][_0x9adc('0xe8')]:'System';break;default:_0x2e5869=_0x15acc5['UserId']?util[_0x9adc('0xda')](_0x9adc('0xe1'),_0x110f87['agentAlias'],_0x15acc5[_0x9adc('0xc7')]):_0x9adc('0xe5');}var _0xb7e710=util[_0x9adc('0xda')](_0x9adc('0xea'),moment(_0x15acc5['createdAt'])['format'](_0x9adc('0xeb')),_0x15acc5[_0x9adc('0xec')]==='in'?_0x5f5740:_0x2e5869,_0x15acc5[_0x9adc('0x7b')]);if(!_0x15acc5['secret']){fs['appendFileSync'](_0x49f6d1,_0xb7e710);}}return db['MailAccount'][_0x9adc('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x9adc('0xed')],'as':_0x9adc('0xee'),'raw':!![]}]});}}})[_0x9adc('0x23')](function(_0x3fba55){if(_0x3fba55&&_0x3fba55['Smtp']&&_0x255a35[_0x9adc('0x7b')]){var _0x39bc66={'tls':{'rejectUnauthorized':![]}};if(_0x3fba55[_0x9adc('0xee')][_0x9adc('0xef')]){_0x39bc66[_0x9adc('0xef')]=_0x3fba55[_0x9adc('0xee')][_0x9adc('0xef')];}else{_0x39bc66[_0x9adc('0xf0')]=_0x3fba55[_0x9adc('0xee')][_0x9adc('0xf0')];_0x39bc66[_0x9adc('0xf1')]=_0x3fba55[_0x9adc('0xee')][_0x9adc('0xf1')];_0x39bc66[_0x9adc('0xf2')]=_0x3fba55[_0x9adc('0xee')][_0x9adc('0xf2')];}if(_0x3fba55[_0x9adc('0xee')][_0x9adc('0xf3')]){_0x39bc66[_0x9adc('0xf4')]={'user':_0x3fba55['Smtp']['user'],'pass':_0x3fba55[_0x9adc('0xee')][_0x9adc('0xf5')]};}return respondWithRpcPromise(_0x9adc('0xf6'),_0x9adc('0xf7'),{'account':_0x39bc66,'message':{'from':util['format'](_0x9adc('0xf8'),_0x3fba55[_0x9adc('0x3d')],_0x3fba55[_0x9adc('0xf9')]||_0x3fba55[_0x9adc('0xee')]['user']),'to':_0x255a35['body'][_0x9adc('0xd9')],'subject':_0x9adc('0xfa'),'text':util[_0x9adc('0xda')](_0x9adc('0xfb'),_0x255a35['body'][_0x9adc('0xd9')]),'attachments':[{'path':_0x49f6d1}]}})['then'](function(){return _0x37b6ce;})[_0x9adc('0x2e')](function(_0x37afc3){console[_0x9adc('0x2a')](_0x37afc3);});}else{return _0x37b6ce;}})['then'](respondWithStatusCode(_0x1ff450,0xc8))[_0x9adc('0x2e')](handleError(_0x1ff450,null));};exports['addMessage']=function(_0x36ad3d,_0x5ba798,_0x45c3d2){return db[_0x9adc('0xdd')][_0x9adc('0x69')]({'where':{'id':_0x36ad3d['params']['id']}})['then'](handleEntityNotFound(_0x5ba798,null))['then'](function(_0x4290){if(_0x4290){return _0x4290[_0x9adc('0xfc')](_0x36ad3d['body']['ids'],_[_0x9adc('0xfd')](_0x36ad3d['body'],[_0x9adc('0xfe'),'id'])||{});}})[_0x9adc('0x23')](respondWithResult(_0x5ba798,null))[_0x9adc('0x2e')](handleError(_0x5ba798,null));};exports[_0x9adc('0xff')]=function(_0x469497,_0x4a6b5a,_0x6ddcaa){var _0x1b7a9a={'raw':![],'where':{}};var _0x4ca4a7={};var _0x4cdacc={'count':0x0,'rows':[]};return db[_0x9adc('0xa6')][_0x9adc('0xd0')]({'where':{'id':_0x469497[_0x9adc('0xc1')]['id']}})[_0x9adc('0x23')](handleEntityNotFound(_0x4a6b5a,null))['then'](function(_0x76dd44){if(_0x76dd44){_0x4ca4a7[_0x9adc('0x49')]=_[_0x9adc('0x7c')](db['ChatMessage'][_0x9adc('0x45')]);_0x4ca4a7['query']=_[_0x9adc('0x7c')](_0x469497[_0x9adc('0x4a')]);_0x4ca4a7[_0x9adc('0x4b')]=_[_0x9adc('0x4c')](_0x4ca4a7[_0x9adc('0x49')],_0x4ca4a7[_0x9adc('0x4a')]);_0x1b7a9a[_0x9adc('0x4e')]=_[_0x9adc('0x4c')](_0x4ca4a7[_0x9adc('0x49')],qs[_0x9adc('0x4d')](_0x469497[_0x9adc('0x4a')][_0x9adc('0x4d')]));_0x1b7a9a[_0x9adc('0x4e')]=_0x1b7a9a['attributes']['length']?_0x1b7a9a[_0x9adc('0x4e')]:_0x4ca4a7[_0x9adc('0x49')];if(!_0x469497[_0x9adc('0x4a')][_0x9adc('0x4f')](_0x9adc('0x50'))){_0x1b7a9a[_0x9adc('0x34')]=qs[_0x9adc('0x34')](_0x469497['query']['limit']);_0x1b7a9a[_0x9adc('0x33')]=qs[_0x9adc('0x33')](_0x469497[_0x9adc('0x4a')]['offset']);}_0x1b7a9a[_0x9adc('0x51')]=qs[_0x9adc('0x52')](_0x469497[_0x9adc('0x4a')][_0x9adc('0x52')]);_0x1b7a9a[_0x9adc('0x86')]=qs[_0x9adc('0x4b')](_[_0x9adc('0x100')](_0x469497[_0x9adc('0x4a')],_0x4ca4a7['filters']));_0x1b7a9a['where'][_0x9adc('0x101')]=_0x76dd44['id'];if(_0x469497[_0x9adc('0x4a')]['filter']){_0x1b7a9a[_0x9adc('0x86')]=_[_0x9adc('0xa5')](_0x1b7a9a[_0x9adc('0x86')],{'$or':_[_0x9adc('0x40')](_0x1b7a9a[_0x9adc('0x4e')],function(_0x34700c){var _0x2955ad={};_0x2955ad[_0x34700c]={'$like':'%'+_0x469497[_0x9adc('0x4a')]['filter']+'%'};return _0x2955ad;})});}if(_0x469497[_0x9adc('0x4a')]['$gte']){var _0x2bba74=_0x469497[_0x9adc('0x4a')][_0x9adc('0x85')][_0x9adc('0x43')](',');var _0x476ee4={};_0x476ee4[_0x2bba74[0x0]]={'$gte':moment(_0x2bba74[0x1])[_0x9adc('0xda')](_0x9adc('0x102'))};_0x1b7a9a[_0x9adc('0x86')]=_['merge'](_0x1b7a9a[_0x9adc('0x86')],_0x476ee4);}_0x1b7a9a=_[_0x9adc('0xa5')]({},_0x1b7a9a,_0x469497[_0x9adc('0xbf')]);return db['ChatMessage']['count']({'where':_0x1b7a9a[_0x9adc('0x86')]})[_0x9adc('0x23')](function(_0x50eae2){_0x4cdacc['count']=_0x50eae2;if(_0x469497[_0x9adc('0x4a')][_0x9adc('0xbd')]){_0x1b7a9a[_0x9adc('0xbe')]=[{'all':!![]}];}return db[_0x9adc('0xdd')][_0x9adc('0x103')](_0x1b7a9a);})['then'](function(_0x4e9924){_0x4cdacc[_0x9adc('0xbb')]=_0x4e9924;return _0x4cdacc;});}})[_0x9adc('0x23')](respondWithFilteredResult(_0x4a6b5a,_0x1b7a9a))['catch'](handleError(_0x4a6b5a,null));};exports[_0x9adc('0x104')]=function(_0x49cb91,_0x5b2f0f,_0x54d9dc){var _0x246089={'where':{}},_0x3d4d24={},_0x2e38c5={'count':0x0,'rows':[]};return db[_0x9adc('0xa6')]['findOne']({'where':{'id':_0x49cb91[_0x9adc('0xc1')]['id']}})[_0x9adc('0x23')](handleEntityNotFound(_0x5b2f0f,null))[_0x9adc('0x23')](function(_0x558281){if(_0x558281){_0x3d4d24[_0x9adc('0x49')]=_[_0x9adc('0x7c')](db[_0x9adc('0xdd')][_0x9adc('0x45')]);_0x3d4d24[_0x9adc('0x4a')]=_[_0x9adc('0x7c')](_0x49cb91[_0x9adc('0x4a')]);_0x3d4d24[_0x9adc('0x4b')]=_[_0x9adc('0x4c')](_0x3d4d24[_0x9adc('0x49')],_0x3d4d24[_0x9adc('0x4a')]);_0x246089[_0x9adc('0x4e')]=_[_0x9adc('0x4c')](_0x3d4d24[_0x9adc('0x49')],qs[_0x9adc('0x4d')](_0x49cb91[_0x9adc('0x4a')]['fields']));_0x246089[_0x9adc('0x4e')]=_0x246089[_0x9adc('0x4e')]['length']?_0x246089[_0x9adc('0x4e')]:_0x3d4d24['model'];if(!_0x49cb91[_0x9adc('0x4a')][_0x9adc('0x4f')](_0x9adc('0x50'))){_0x246089[_0x9adc('0x34')]=qs[_0x9adc('0x34')](_0x49cb91[_0x9adc('0x4a')][_0x9adc('0x34')]);_0x246089[_0x9adc('0x33')]=qs['offset'](_0x49cb91[_0x9adc('0x4a')][_0x9adc('0x33')]);}_0x246089[_0x9adc('0x51')]=qs[_0x9adc('0x52')](_0x49cb91['query'][_0x9adc('0x52')]);_0x246089[_0x9adc('0x86')]=qs['filters'](_['pick'](_0x49cb91[_0x9adc('0x4a')],_0x3d4d24['filters']));_0x246089['where'][_0x9adc('0x101')]=_0x558281['id'];if(_0x49cb91[_0x9adc('0x4a')]['filter']){_0x246089[_0x9adc('0x86')]=_[_0x9adc('0xa5')](_0x246089[_0x9adc('0x86')],{'$or':_['map'](_0x246089[_0x9adc('0x4e')],function(_0x339c52){var _0x36e7d5={};_0x36e7d5[_0x339c52]={'$like':'%'+_0x49cb91[_0x9adc('0x4a')]['filter']+'%'};return _0x36e7d5;})});}_0x246089['where'][_0x9adc('0x105')]=![];if(_0x49cb91[_0x9adc('0x4a')]['id']){_0x246089[_0x9adc('0x86')]['id']={'$gt':_0x49cb91['query']['id']};}_0x246089=_[_0x9adc('0xa5')]({},_0x246089,_0x49cb91[_0x9adc('0xbf')]);return db['ChatMessage'][_0x9adc('0x32')]({'where':_0x246089[_0x9adc('0x86')]})[_0x9adc('0x23')](function(_0x37804b){_0x2e38c5['count']=_0x37804b;_0x246089[_0x9adc('0xbe')]=[];if(_0x49cb91[_0x9adc('0x4a')]['includeAgent']){_0x246089[_0x9adc('0xbe')]['push']({'model':db['User'],'as':_0x9adc('0x79'),'attributes':['id',_0x9adc('0xe8'),_0x9adc('0xe7')]});}if(_0x49cb91[_0x9adc('0x4a')]['includeAll']){_0x246089[_0x9adc('0xbe')]=[{'all':!![]}];}return db['ChatMessage'][_0x9adc('0x103')](_0x246089);})['then'](function(_0x31d04c){_0x2e38c5[_0x9adc('0xbb')]=_0x31d04c;return _0x2e38c5;});}})['then'](respondWithFilteredResult(_0x5b2f0f,_0x246089))[_0x9adc('0x2e')](handleError(_0x5b2f0f,null));};exports['addTags']=function(_0x658f97,_0x40b561,_0x12adc1){return db['ChatInteraction'][_0x9adc('0x69')]({'where':{'id':_0x658f97[_0x9adc('0xc1')]['id']}})[_0x9adc('0x23')](handleEntityNotFound(_0x40b561,null))[_0x9adc('0x23')](function(_0x21ece9){if(_0x21ece9){return _0x21ece9[_0x9adc('0x106')](_0x658f97[_0x9adc('0x7b')][_0x9adc('0xfe')],_[_0x9adc('0xfd')](_0x658f97[_0x9adc('0x7b')],[_0x9adc('0xfe'),'id'])||{})[_0x9adc('0x107')](function(){return db[_0x9adc('0x108')][_0x9adc('0x103')]({'attributes':['id','name',_0x9adc('0x55')],'where':{'id':_0x658f97[_0x9adc('0x7b')][_0x9adc('0xfe')]}});})[_0x9adc('0x23')](function(_0x26d526){socket[_0x9adc('0x109')](_0x9adc('0x10a'),{'id':Number(_0x658f97[_0x9adc('0xc1')]['id']),'tags':_0x26d526||[]});return{'id':Number(_0x658f97[_0x9adc('0xc1')]['id']),'tags':_0x26d526||[]};});}})['then'](respondWithResult(_0x40b561,null))[_0x9adc('0x2e')](handleError(_0x40b561,null));};exports[_0x9adc('0x10b')]=function(_0x316a80,_0x355936,_0x50401e){return db[_0x9adc('0xa6')]['find']({'where':{'id':_0x316a80['params']['id']}})[_0x9adc('0x23')](handleEntityNotFound(_0x355936,null))[_0x9adc('0x23')](function(_0x149c04){if(_0x149c04){return _0x149c04[_0x9adc('0x10b')](_0x316a80['query']['ids']);}})['then'](respondWithStatusCode(_0x355936,null))[_0x9adc('0x2e')](handleError(_0x355936,null));};exports[_0x9adc('0xd4')]=function(_0x2da53c,_0x9167b1){var _0x5da271=moment()[_0x9adc('0x10c')]()['toString']();var _0x5f2e05=path[_0x9adc('0xd5')](config[_0x9adc('0xd6')],'server','files',_0x9adc('0x10d'));var _0x3ea4e1=path[_0x9adc('0xd5')](config[_0x9adc('0xd6')],_0x9adc('0x10e'),_0x9adc('0x10f'),_0x9adc('0x110'));var _0x1fcc2f=path[_0x9adc('0xd5')](_0x5f2e05,_0x5da271);var _0x6d73d=util['format'](_0x9adc('0x111'),_0x2da53c[_0x9adc('0xc1')]['id'],_0x5da271);var _0x38d755=path[_0x9adc('0xd5')](_0x5f2e05,_0x6d73d);var _0x57bbd9=![];return db[_0x9adc('0xa6')][_0x9adc('0x69')]({'where':{'id':_0x2da53c['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x9adc('0xde'),'attributes':['id','body',_0x9adc('0x83'),_0x9adc('0xec'),'secret',_0x9adc('0x8b')],'include':[{'model':db[_0x9adc('0x79')],'as':_0x9adc('0x79'),'attributes':['id',_0x9adc('0xe8')],'raw':!![]},{'model':db[_0x9adc('0xe0')],'as':_0x9adc('0x6c'),'attributes':['id','firstName',_0x9adc('0x112')],'raw':!![]},{'model':db[_0x9adc('0xce')],'as':'Attachment','raw':!![]}]},{'model':db[_0x9adc('0xdf')],'as':_0x9adc('0x113'),'attributes':['id','name']},{'model':db['User'],'as':_0x9adc('0x114'),'attributes':['id',_0x9adc('0xe8')]}]})['then'](handleEntityNotFound(_0x9167b1,null))[_0x9adc('0x23')](function(_0x4f6a02){if(_0x4f6a02){var _0x2b1f62=_0x4f6a02['get']({'plain':!![]});_0x57bbd9=!![];var _0x182c00={'format':'A4','border':_0x9adc('0x115'),'header':{'height':_0x9adc('0x116'),'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':'30px','contents':{'default':util[_0x9adc('0xda')](_0x9adc('0x117'),util[_0x9adc('0xda')]('%s\x20#%d',_0x9adc('0x118'),_0x2b1f62['id']),moment()[_0x9adc('0xda')](_0x9adc('0x119'))[_0x9adc('0xa3')]())}}};fs['mkdirSync'](_0x1fcc2f);var _0x16374d={'channel':_0x9adc('0x118'),'account':_0x2b1f62[_0x9adc('0x113')][_0x9adc('0x3d')],'agent':_0x2b1f62[_0x9adc('0x114')]?_0x2b1f62[_0x9adc('0x114')][_0x9adc('0xe8')]:'N.A.','createdAt':moment(_0x2b1f62[_0x9adc('0x83')])[_0x9adc('0xda')](_0x9adc('0x102'))[_0x9adc('0xa3')](),'closedAt':_0x2b1f62[_0x9adc('0xd1')]?moment(_0x2b1f62['closedAt'])[_0x9adc('0xda')](_0x9adc('0x102'))[_0x9adc('0xa3')]():'','disposition':_0x2b1f62[_0x9adc('0xc9')],'chatInfo':{'browser':_0x2b1f62[_0x9adc('0x11a')],'os':_0x2b1f62['osName'],'referer':_0x2b1f62['referer'],'customerIp':_0x2b1f62[_0x9adc('0x11b')],'customerPort':_0x2b1f62[_0x9adc('0x11c')]?_0x2b1f62[_0x9adc('0x11c')]:_0x9adc('0x11d')},'messages':_(_0x2b1f62[_0x9adc('0xde')])['tail']()[_0x9adc('0x8e')]({'secret':![]})[_0x9adc('0x40')](function(_0x192a2f){if(_0x192a2f[_0x9adc('0xce')]){var _0x300989=path[_0x9adc('0xd5')](_0x3ea4e1,_0x192a2f[_0x9adc('0xce')][_0x9adc('0xcd')]);if(fs[_0x9adc('0x11e')](_0x300989)){fs[_0x9adc('0x11f')](_0x300989)[_0x9adc('0x120')](fs['createWriteStream'](path[_0x9adc('0xd5')](_0x1fcc2f,_0x192a2f[_0x9adc('0xce')][_0x9adc('0xcd')])));}}return{'date':moment(_0x192a2f['createdAt'])[_0x9adc('0xda')](_0x9adc('0x102'))[_0x9adc('0xa3')](),'sender':_0x192a2f['direction']==='out'?_0x192a2f[_0x9adc('0x79')]?_0x192a2f[_0x9adc('0x79')][_0x9adc('0xe8')]:_0x9adc('0xe5'):_0x192a2f[_0x9adc('0x6c')][_0x9adc('0x121')]+(_0x192a2f[_0x9adc('0x6c')][_0x9adc('0x112')]?'\x20'+_0x192a2f[_0x9adc('0x6c')][_0x9adc('0x112')]:''),'body':_0x192a2f['Attachment']?_0x192a2f[_0x9adc('0xce')][_0x9adc('0xcd')]:_0x192a2f[_0x9adc('0x7b')],'direction':_0x192a2f['direction']===_0x9adc('0x122')?'A':'C','secret':_0x192a2f[_0x9adc('0x105')],'read':_0x192a2f[_0x9adc('0x8b')],'attachment':_0x192a2f[_0x9adc('0xce')]};})['value']()};return ejs[_0x9adc('0x123')](path[_0x9adc('0xd5')](config['root'],_0x9adc('0x10e'),_0x9adc('0x124'),_0x9adc('0x125')),{'interaction':_0x16374d})[_0x9adc('0x23')](function(_0x9af9fa){return new BPromise(function(_0x55ab30,_0x3daa58){pdf[_0x9adc('0xc0')](_0x9af9fa,_0x182c00)[_0x9adc('0x126')](path['join'](_0x1fcc2f,_0x9adc('0x127')+_0x2b1f62['id']+'-'+_0x5da271+'.pdf'),function(_0x2df6ce,_0x49f545){if(_0x2df6ce)return _0x3daa58(_0x2df6ce);_0x55ab30(_0x49f545);});});});}})[_0x9adc('0x23')](function(){if(_0x57bbd9){return new BPromise(function(_0x21e089,_0x57ffe4){zipdir(_0x1fcc2f,{'saveTo':_0x38d755},function(_0x47a40d,_0x315bd9){if(_0x47a40d)return _0x57ffe4(_0x47a40d);return _0x21e089(_0x315bd9);});})['then'](function(){return new BPromise(function(_0x5b8057,_0x14fd5f){rimraf(_0x1fcc2f,function(_0x20e559){if(_0x20e559)_0x14fd5f(_0x20e559);return _0x5b8057();});});})[_0x9adc('0x23')](function(){return _0x9167b1[_0x9adc('0xd4')](_0x38d755,_0x6d73d,function(_0x345ac1){if(_0x345ac1){console[_0x9adc('0x128')](_0x9adc('0x129'),_0x345ac1);}else{fs['unlinkSync'](_0x38d755);}});});}else{return _0x9167b1[_0x9adc('0x3b')](0xc8);}})['catch'](handleError(_0x9167b1,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d35e31d..a69f3e0 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 _0x431b=['hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x5e1bbb,_0x3e7dae){var _0x757fec=function(_0x271660){while(--_0x271660){_0x5e1bbb['push'](_0x5e1bbb['shift']());}};_0x757fec(++_0x3e7dae);}(_0x431b,0x18d));var _0xb431=function(_0x147f5c,_0x1e5deb){_0x147f5c=_0x147f5c-0x0;var _0x545070=_0x431b[_0x147f5c];return _0x545070;};'use strict';var EventEmitter=require(_0xb431('0x0'));var ChatInteraction=require(_0xb431('0x1'))['db'][_0xb431('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xb431('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb431('0x4')](0x0);var events={'afterCreate':_0xb431('0x5'),'afterUpdate':_0xb431('0x6'),'afterDestroy':_0xb431('0x7')};function emitEvent(_0x42dcc1){return function(_0x29bf28,_0x5b48dc,_0x2f2e67){_0x29bf28['getUsers']({'attributes':['id'],'raw':!![]})[_0xb431('0x8')](function(_0x58eb22){_0x29bf28['setDataValue'](_0xb431('0x9'),_0x58eb22['map'](function(_0x58f0ac){return{'id':_0x58f0ac['id']};}));return ChatMessage[_0xb431('0xa')]({'where':{'ChatInteractionId':_0x29bf28['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb431('0x8')](function(_0x437365){_0x29bf28[_0xb431('0xb')](_0xb431('0xc'),_0x437365[_0xb431('0xd')]);ChatInteractionEvents[_0xb431('0xe')](_0x42dcc1+':'+_0x29bf28['id'],_0x29bf28);ChatInteractionEvents['emit'](_0x42dcc1,_0x29bf28);_0x2f2e67(null);})[_0xb431('0xf')](_0x2f2e67(null));};}for(var e in events){if(events[_0xb431('0x10')](e)){var event=events[e];ChatInteraction[_0xb431('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x51b4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x76236f,_0x1e45de){var _0x59b862=function(_0x16abf3){while(--_0x16abf3){_0x76236f['push'](_0x76236f['shift']());}};_0x59b862(++_0x1e45de);}(_0x51b4,0x1a1));var _0x451b=function(_0x3e821f,_0x2f157c){_0x3e821f=_0x3e821f-0x0;var _0x1d5246=_0x51b4[_0x3e821f];return _0x1d5246;};'use strict';var EventEmitter=require(_0x451b('0x0'));var ChatInteraction=require(_0x451b('0x1'))['db'][_0x451b('0x2')];var ChatMessage=require(_0x451b('0x1'))['db'][_0x451b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x451b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x451b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x156b94){return function(_0x39123b,_0x36c8e9,_0x1ddd3f){_0x39123b[_0x451b('0x6')]({'attributes':['id'],'raw':!![]})[_0x451b('0x7')](function(_0x28ce84){_0x39123b[_0x451b('0x8')](_0x451b('0x9'),_0x28ce84[_0x451b('0xa')](function(_0x4d0358){return{'id':_0x4d0358['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x39123b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x56ad87){_0x39123b['setDataValue'](_0x451b('0xb'),_0x56ad87[_0x451b('0xc')]);ChatInteractionEvents[_0x451b('0xd')](_0x156b94+':'+_0x39123b['id'],_0x39123b);ChatInteractionEvents[_0x451b('0xd')](_0x156b94,_0x39123b);_0x1ddd3f(null);})[_0x451b('0xe')](_0x1ddd3f(null));};}for(var e in events){if(events[_0x451b('0xf')](e)){var event=events[e];ChatInteraction[_0x451b('0x10')](e,emitEvent(event));}}module[_0x451b('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e2f0ce3..eebb428 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 _0x0a7e=['utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x22b471,_0x58f9a4){var _0x4c5529=function(_0x55e1e7){while(--_0x55e1e7){_0x22b471['push'](_0x22b471['shift']());}};_0x4c5529(++_0x58f9a4);}(_0x0a7e,0x6a));var _0xe0a7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0a7e[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe0a7('0x0'))(_0xe0a7('0x1'));var moment=require(_0xe0a7('0x2'));var BPromise=require(_0xe0a7('0x3'));var rp=require(_0xe0a7('0x4'));var fs=require('fs');var path=require(_0xe0a7('0x5'));var rimraf=require(_0xe0a7('0x6'));var config=require('../../config/environment');var attributes=require(_0xe0a7('0x7'));module['exports']=function(_0x468785,_0x3a06d0){return _0x468785['define'](_0xe0a7('0x8'),attributes,{'tableName':_0xe0a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2515d0,_0x39e334,_0x27701c){if(_0x2515d0[_0xe0a7('0xa')](_0xe0a7('0xb'))){_0x2515d0[_0xe0a7('0xc')]=moment()['format'](_0xe0a7('0xd'));}_0x27701c(null,_0x2515d0);}},'charset':_0xe0a7('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x975c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x975c,0xee));var _0xc975=function(_0x1ff4e1,_0x4073e6){_0x1ff4e1=_0x1ff4e1-0x0;var _0x3a77d1=_0x975c[_0x1ff4e1];return _0x3a77d1;};'use strict';var _=require(_0xc975('0x0'));var util=require(_0xc975('0x1'));var logger=require(_0xc975('0x2'))(_0xc975('0x3'));var moment=require(_0xc975('0x4'));var BPromise=require(_0xc975('0x5'));var rp=require(_0xc975('0x6'));var fs=require('fs');var path=require(_0xc975('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc975('0x8'));module[_0xc975('0x9')]=function(_0x1fb523,_0x5465ee){return _0x1fb523[_0xc975('0xa')](_0xc975('0xb'),attributes,{'tableName':_0xc975('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47be64,_0x530248,_0x4ce1fb){if(_0x47be64[_0xc975('0xd')]('closed')){_0x47be64[_0xc975('0xe')]=moment()['format'](_0xc975('0xf'));}_0x4ce1fb(null,_0x47be64);}},'charset':'utf8mb4','collate':_0xc975('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e87e6ab..979443d 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 _0x3f53=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x7a3848,_0x26ce07){var _0x5f1c43=function(_0x5cff73){while(--_0x5cff73){_0x7a3848['push'](_0x7a3848['shift']());}};_0x5f1c43(++_0x26ce07);}(_0x3f53,0x16a));var _0x33f5=function(_0x145c40,_0x50009e){_0x145c40=_0x145c40-0x0;var _0x275bd5=_0x3f53[_0x145c40];return _0x275bd5;};'use strict';var _=require(_0x33f5('0x0'));var util=require(_0x33f5('0x1'));var moment=require(_0x33f5('0x2'));var BPromise=require(_0x33f5('0x3'));var rs=require(_0x33f5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33f5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x33f5('0x6'));var config=require(_0x33f5('0x7'));var jayson=require(_0x33f5('0x8'));var client=jayson['client'][_0x33f5('0x9')]({'port':0x232a});config[_0x33f5('0xa')]=_[_0x33f5('0xb')](config[_0x33f5('0xa')],{'host':_0x33f5('0xc'),'port':0x18eb});var socket=require(_0x33f5('0xd'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x33f5('0xe')](socket);function respondWithRpcPromise(_0x1b4a50,_0x299322,_0x89f582){return new BPromise(function(_0x10e515,_0x66c986){return client[_0x33f5('0xf')](_0x1b4a50,_0x89f582)[_0x33f5('0x10')](function(_0xc503da){logger[_0x33f5('0x11')](_0x33f5('0x12'),_0x299322,_0x33f5('0x13'));logger[_0x33f5('0x14')](_0x33f5('0x15'),_0x299322,_0x33f5('0x13'),JSON['stringify'](_0xc503da));if(_0xc503da[_0x33f5('0x16')]){if(_0xc503da[_0x33f5('0x16')]['code']===0x1f4){logger[_0x33f5('0x16')](_0x33f5('0x12'),_0x299322,_0xc503da[_0x33f5('0x16')][_0x33f5('0x17')]);return _0x66c986(_0xc503da[_0x33f5('0x16')][_0x33f5('0x17')]);}logger[_0x33f5('0x16')](_0x33f5('0x12'),_0x299322,_0xc503da[_0x33f5('0x16')][_0x33f5('0x17')]);return _0x10e515(_0xc503da[_0x33f5('0x16')][_0x33f5('0x17')]);}else{logger[_0x33f5('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x299322,_0x33f5('0x13'));_0x10e515(_0xc503da[_0x33f5('0x18')]['message']);}})[_0x33f5('0x19')](function(_0x5608f0){logger[_0x33f5('0x16')](_0x33f5('0x12'),_0x299322,_0x5608f0);_0x66c986(_0x5608f0);});});}exports[_0x33f5('0x1a')]=function(_0x422483){var _0x4422be=this;return new Promise(function(_0x235523,_0x1beac1){return db[_0x33f5('0x1b')][_0x33f5('0x1c')](_0x422483[_0x33f5('0x1d')],{'raw':_0x422483['options']?_0x422483[_0x33f5('0x1e')][_0x33f5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422483['options']?_0x422483['options'][_0x33f5('0x20')]||null:null,'attributes':_0x422483[_0x33f5('0x1e')]?_0x422483[_0x33f5('0x1e')][_0x33f5('0x21')]||null:null,'limit':_0x422483['options']?_0x422483[_0x33f5('0x1e')][_0x33f5('0x22')]||null:null})[_0x33f5('0x10')](function(_0x587626){logger[_0x33f5('0x11')]('UpdateChatInteraction',_0x422483);logger[_0x33f5('0x14')](_0x33f5('0x1a'),_0x422483,JSON['stringify'](_0x587626));_0x235523(_0x587626);})[_0x33f5('0x19')](function(_0x38d846){logger[_0x33f5('0x16')](_0x33f5('0x1a'),_0x38d846['message'],_0x422483);_0x1beac1(_0x4422be[_0x33f5('0x16')](0x1f4,_0x38d846[_0x33f5('0x17')]));});});};exports[_0x33f5('0x23')]=function(_0x38a8da){return new Promise(function(_0x138025,_0x1ed3c4){return db[_0x33f5('0x1b')][_0x33f5('0x24')]({'where':_0x38a8da['options']?_0x38a8da['options'][_0x33f5('0x20')]||null:null})[_0x33f5('0x10')](function(_0xac09fa){if(_0xac09fa){return _0xac09fa['addTags'](_0x38a8da['body'][_0x33f5('0x25')],_[_0x33f5('0x26')](_0x38a8da[_0x33f5('0x1d')],[_0x33f5('0x25'),'id'])||{});}})[_0x33f5('0x27')](function(_0x4d58ec){logger[_0x33f5('0x11')](_0x33f5('0x28'),_0x38a8da);logger[_0x33f5('0x14')](_0x33f5('0x28'),_0x38a8da,JSON[_0x33f5('0x29')](_0x4d58ec));_0x138025(_0x4d58ec);})['catch'](function(_0x5f5b8d){logger['error']('AddTags',_0x5f5b8d[_0x33f5('0x17')],_0x38a8da);_0x1ed3c4(_this[_0x33f5('0x16')](0x1f4,_0x5f5b8d[_0x33f5('0x17')]));});});}; \ No newline at end of file +var _0x7562=['catch','UpdateChatInteraction','update','body','options','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x167459,_0x3bbce7){var _0x478c07=function(_0x59e44e){while(--_0x59e44e){_0x167459['push'](_0x167459['shift']());}};_0x478c07(++_0x3bbce7);}(_0x7562,0xa8));var _0x2756=function(_0x55aec7,_0x4f8a34){_0x55aec7=_0x55aec7-0x0;var _0x236963=_0x7562[_0x55aec7];return _0x236963;};'use strict';var _=require(_0x2756('0x0'));var util=require('util');var moment=require(_0x2756('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2756('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2756('0x3'))(_0x2756('0x4'));var config=require(_0x2756('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2756('0x6')]['http']({'port':0x232a});config[_0x2756('0x7')]=_[_0x2756('0x8')](config['redis'],{'host':_0x2756('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2756('0xa')](socket);function respondWithRpcPromise(_0x40eaca,_0x2306ba,_0x2859d8){return new BPromise(function(_0x34060c,_0xc8e8d5){return client[_0x2756('0xb')](_0x40eaca,_0x2859d8)[_0x2756('0xc')](function(_0x520bbf){logger[_0x2756('0xd')](_0x2756('0xe'),_0x2306ba,'request\x20sent');logger[_0x2756('0xf')](_0x2756('0x10'),_0x2306ba,_0x2756('0x11'),JSON[_0x2756('0x12')](_0x520bbf));if(_0x520bbf[_0x2756('0x13')]){if(_0x520bbf[_0x2756('0x13')][_0x2756('0x14')]===0x1f4){logger[_0x2756('0x13')](_0x2756('0xe'),_0x2306ba,_0x520bbf[_0x2756('0x13')][_0x2756('0x15')]);return _0xc8e8d5(_0x520bbf[_0x2756('0x13')][_0x2756('0x15')]);}logger[_0x2756('0x13')](_0x2756('0xe'),_0x2306ba,_0x520bbf[_0x2756('0x13')][_0x2756('0x15')]);return _0x34060c(_0x520bbf[_0x2756('0x13')][_0x2756('0x15')]);}else{logger[_0x2756('0xd')](_0x2756('0xe'),_0x2306ba,_0x2756('0x11'));_0x34060c(_0x520bbf['result'][_0x2756('0x15')]);}})[_0x2756('0x16')](function(_0x22b018){logger[_0x2756('0x13')](_0x2756('0xe'),_0x2306ba,_0x22b018);_0xc8e8d5(_0x22b018);});});}exports[_0x2756('0x17')]=function(_0x4fc474){var _0x175fea=this;return new Promise(function(_0x2c0275,_0x3d559a){return db['ChatInteraction'][_0x2756('0x18')](_0x4fc474[_0x2756('0x19')],{'raw':_0x4fc474[_0x2756('0x1a')]?_0x4fc474['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fc474[_0x2756('0x1a')]?_0x4fc474[_0x2756('0x1a')]['where']||null:null,'attributes':_0x4fc474[_0x2756('0x1a')]?_0x4fc474[_0x2756('0x1a')][_0x2756('0x1b')]||null:null,'limit':_0x4fc474['options']?_0x4fc474['options'][_0x2756('0x1c')]||null:null})[_0x2756('0xc')](function(_0x2a8341){logger[_0x2756('0xd')](_0x2756('0x17'),_0x4fc474);logger[_0x2756('0xf')](_0x2756('0x17'),_0x4fc474,JSON[_0x2756('0x12')](_0x2a8341));_0x2c0275(_0x2a8341);})[_0x2756('0x16')](function(_0x130c78){logger[_0x2756('0x13')]('UpdateChatInteraction',_0x130c78[_0x2756('0x15')],_0x4fc474);_0x3d559a(_0x175fea[_0x2756('0x13')](0x1f4,_0x130c78[_0x2756('0x15')]));});});};exports[_0x2756('0x1d')]=function(_0x28459e){return new Promise(function(_0x1db5f1,_0x3432cd){return db[_0x2756('0x1e')][_0x2756('0x1f')]({'where':_0x28459e[_0x2756('0x1a')]?_0x28459e[_0x2756('0x1a')][_0x2756('0x20')]||null:null})['then'](function(_0x223e9d){if(_0x223e9d){return _0x223e9d[_0x2756('0x21')](_0x28459e[_0x2756('0x19')][_0x2756('0x22')],_[_0x2756('0x23')](_0x28459e['body'],[_0x2756('0x22'),'id'])||{});}})[_0x2756('0x24')](function(_0x2b7706){logger['info'](_0x2756('0x25'),_0x28459e);logger[_0x2756('0xf')]('AddTags',_0x28459e,JSON['stringify'](_0x2b7706));_0x1db5f1(_0x2b7706);})[_0x2756('0x16')](function(_0xb1902b){logger[_0x2756('0x13')]('AddTags',_0xb1902b['message'],_0x28459e);_0x3432cd(_this[_0x2756('0x13')](0x1f4,_0xb1902b['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index e0b9f19..4b08d74 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 _0x9568=['save','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9568,0x10f));var _0x8956=function(_0x4e7fd0,_0x29cccd){_0x4e7fd0=_0x4e7fd0-0x0;var _0x1de972=_0x9568[_0x4e7fd0];return _0x1de972;};'use strict';var ChatInteractionEvents=require(_0x8956('0x0'));var events=[_0x8956('0x1'),'remove',_0x8956('0x2')];function createListener(_0x48d329,_0x3b1077){return function(_0x50285b){_0x3b1077[_0x8956('0x3')](_0x48d329,_0x50285b);};}function removeListener(_0x277a90,_0x519b76){return function(){ChatInteractionEvents[_0x8956('0x4')](_0x277a90,_0x519b76);};}exports[_0x8956('0x5')]=function(_0x558a82){for(var _0x19767e=0x0,_0xc9aa40=events[_0x8956('0x6')];_0x19767e<_0xc9aa40;_0x19767e++){var _0x1fc43a=events[_0x19767e];var _0x135510=createListener(_0x8956('0x7')+_0x1fc43a,_0x558a82);ChatInteractionEvents['on'](_0x1fc43a,_0x135510);}}; \ No newline at end of file +var _0xf4f0=['update','emit','removeListener','./chatInteraction.events','save'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xf4f0,0x1bb));var _0x0f4f=function(_0x3308a0,_0x5a71c4){_0x3308a0=_0x3308a0-0x0;var _0x3adbf3=_0xf4f0[_0x3308a0];return _0x3adbf3;};'use strict';var ChatInteractionEvents=require(_0x0f4f('0x0'));var events=[_0x0f4f('0x1'),'remove',_0x0f4f('0x2')];function createListener(_0x1d17ee,_0xaf78c5){return function(_0x3640b0){_0xaf78c5[_0x0f4f('0x3')](_0x1d17ee,_0x3640b0);};}function removeListener(_0x424c81,_0x326bbe){return function(){ChatInteractionEvents[_0x0f4f('0x4')](_0x424c81,_0x326bbe);};}exports['register']=function(_0x267da8){for(var _0x2533f3=0x0,_0x1c5e93=events['length'];_0x2533f3<_0x1c5e93;_0x2533f3++){var _0x555c1c=events[_0x2533f3];var _0x5805d5=createListener('chatInteraction:'+_0x555c1c,_0x267da8);ChatInteractionEvents['on'](_0x555c1c,_0x5805d5);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 9ca5382..cf9b047 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 _0x546e=['/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','put','tracked','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','single','file','attachmentUpload'];(function(_0x5ac69e,_0x10fba1){var _0xf3a518=function(_0x4bdb9a){while(--_0x4bdb9a){_0x5ac69e['push'](_0x5ac69e['shift']());}};_0xf3a518(++_0x10fba1);}(_0x546e,0x199));var _0xe546=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x546e[_0x47a349];return _0x18ab75;};'use strict';var multer=require(_0xe546('0x0'));var util=require(_0xe546('0x1'));var path=require(_0xe546('0x2'));var timeout=require(_0xe546('0x3'));var express=require(_0xe546('0x4'));var router=express[_0xe546('0x5')]();var auth=require(_0xe546('0x6'));var interaction=require(_0xe546('0x7'));var config=require('../../config/environment');var controller=require(_0xe546('0x8'));router[_0xe546('0x9')]('/',auth[_0xe546('0xa')](),controller['index']);router[_0xe546('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe546('0x9')](_0xe546('0xb'),auth[_0xe546('0xc')](),controller[_0xe546('0xd')]);router[_0xe546('0x9')](_0xe546('0xe'),auth[_0xe546('0xc')](),controller[_0xe546('0xf')]);router[_0xe546('0x9')]('/:id/messages',auth[_0xe546('0xa')](),controller[_0xe546('0x10')]);router[_0xe546('0x9')](_0xe546('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe546('0x12')]);router[_0xe546('0x9')](_0xe546('0x13'),auth['isAuthenticated'](),controller['download']);router[_0xe546('0x14')]('/',auth[_0xe546('0xa')](),controller[_0xe546('0x15')]);var upload=multer({'storage':multer[_0xe546('0x16')]({'destination':function(_0x4d3a3b,_0x28476d,_0xf9b616){_0xf9b616(null,path[_0xe546('0x17')](config[_0xe546('0x18')],_0xe546('0x19')));},'filename':function(_0x527dd3,_0x393663,_0x1f1163){_0x1f1163(null,util['format'](_0xe546('0x1a'),Date[_0xe546('0x1b')](),_0x393663[_0xe546('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe546('0x14')]('/:id/attachment_upload',upload[_0xe546('0x1d')](_0xe546('0x1e')),controller[_0xe546('0x1f')]);router[_0xe546('0x14')](_0xe546('0x20'),auth[_0xe546('0xc')](),controller[_0xe546('0x21')]);router['post'](_0xe546('0x22'),auth[_0xe546('0xa')](),interaction['tracked'](_0xe546('0x23'),_0xe546('0x24')),controller['addTags']);router[_0xe546('0x25')](_0xe546('0xb'),auth[_0xe546('0xa')](),interaction[_0xe546('0x26')](_0xe546('0x23'),'chatinteraction:update'),controller[_0xe546('0x27')]);router['put'](_0xe546('0x28'),controller[_0xe546('0x29')]);router[_0xe546('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xe546('0x2a')]);router[_0xe546('0x25')](_0xe546('0x2b'),controller[_0xe546('0x2c')]);router['delete'](_0xe546('0xb'),auth['isAuthenticated'](),interaction[_0xe546('0x26')]('chat',_0xe546('0x2d')),controller[_0xe546('0x2e')]);router[_0xe546('0x2f')](_0xe546('0x22'),auth[_0xe546('0xa')](),controller['removeTags']);module[_0xe546('0x30')]=router; \ No newline at end of file +var _0x0d44=['diskStorage','join','root','format','now','originalname','replace','/:id/attachment_upload','single','file','/:id/messages','addMessage','post','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','getMyMessages','download','create'];(function(_0x3794a0,_0x1a9cfc){var _0x5bdaba=function(_0x14a764){while(--_0x14a764){_0x3794a0['push'](_0x3794a0['shift']());}};_0x5bdaba(++_0x1a9cfc);}(_0x0d44,0x1f2));var _0x40d4=function(_0x4bcd6a,_0x3456b3){_0x4bcd6a=_0x4bcd6a-0x0;var _0x5c646a=_0x0d44[_0x4bcd6a];return _0x5c646a;};'use strict';var multer=require('multer');var util=require(_0x40d4('0x0'));var path=require('path');var timeout=require(_0x40d4('0x1'));var express=require(_0x40d4('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x40d4('0x3'));var config=require(_0x40d4('0x4'));var controller=require(_0x40d4('0x5'));router[_0x40d4('0x6')]('/',auth[_0x40d4('0x7')](),controller['index']);router[_0x40d4('0x6')](_0x40d4('0x8'),auth[_0x40d4('0x7')](),controller[_0x40d4('0x9')]);router[_0x40d4('0x6')](_0x40d4('0xa'),auth[_0x40d4('0xb')](),controller[_0x40d4('0xc')]);router[_0x40d4('0x6')](_0x40d4('0xd'),auth[_0x40d4('0xb')](),controller[_0x40d4('0xe')]);router['get']('/:id/messages',auth[_0x40d4('0x7')](),controller[_0x40d4('0xf')]);router['get']('/:id/my_messages',auth[_0x40d4('0xb')](),controller[_0x40d4('0x10')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x40d4('0x11')]);router['post']('/',auth[_0x40d4('0x7')](),controller[_0x40d4('0x12')]);var upload=multer({'storage':multer[_0x40d4('0x13')]({'destination':function(_0xa78666,_0xd6747b,_0x49041c){_0x49041c(null,path[_0x40d4('0x14')](config[_0x40d4('0x15')],'server/files/attachments/'));},'filename':function(_0x43495d,_0xb3593e,_0x247909){_0x247909(null,util[_0x40d4('0x16')]('%s-%s',Date[_0x40d4('0x17')](),_0xb3593e[_0x40d4('0x18')][_0x40d4('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x40d4('0x1a'),upload[_0x40d4('0x1b')](_0x40d4('0x1c')),controller['attachmentUpload']);router['post'](_0x40d4('0x1d'),auth[_0x40d4('0xb')](),controller[_0x40d4('0x1e')]);router[_0x40d4('0x1f')](_0x40d4('0x20'),auth[_0x40d4('0x7')](),interaction[_0x40d4('0x21')](_0x40d4('0x22'),_0x40d4('0x23')),controller[_0x40d4('0x24')]);router[_0x40d4('0x25')](_0x40d4('0xa'),auth[_0x40d4('0x7')](),interaction['tracked'](_0x40d4('0x22'),_0x40d4('0x26')),controller['update']);router[_0x40d4('0x25')](_0x40d4('0x27'),controller[_0x40d4('0x28')]);router[_0x40d4('0x25')]('/:id/abandon',auth[_0x40d4('0xb')](),controller[_0x40d4('0x29')]);router['put'](_0x40d4('0x2a'),controller[_0x40d4('0x2b')]);router[_0x40d4('0x2c')](_0x40d4('0xa'),auth[_0x40d4('0x7')](),interaction[_0x40d4('0x21')](_0x40d4('0x22'),_0x40d4('0x2d')),controller['destroy']);router['delete']('/:id/tags',auth[_0x40d4('0x7')](),controller[_0x40d4('0x2e')]);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 5862826..de9a629 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 _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x5482bf,_0x1d1aeb){var _0x142ef5=function(_0xa62443){while(--_0xa62443){_0x5482bf['push'](_0x5482bf['shift']());}};_0x142ef5(++_0x1d1aeb);}(_0xdb28,0x106));var _0x8db2=function(_0x3eafcf,_0x2f27be){_0x3eafcf=_0x3eafcf-0x0;var _0x134e4d=_0xdb28[_0x3eafcf];return _0x134e4d;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}}; \ No newline at end of file +var _0xadb5=['INTEGER','exports','medium','BOOLEAN'];(function(_0x571556,_0x1e0b4a){var _0x5e0e8e=function(_0x2670cf){while(--_0x2670cf){_0x571556['push'](_0x571556['shift']());}};_0x5e0e8e(++_0x1e0b4a);}(_0xadb5,0xad));var _0x5adb=function(_0x55690c,_0x493bc9){_0x55690c=_0x55690c-0x0;var _0x57e280=_0xadb5[_0x55690c];return _0x57e280;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5adb('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6c7d221..d76558f 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 _0xe7fb=['VIRTUAL','filter','count','include','findAll','catch','show','params','keys','length','includeAll','options','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','User','admin','user','fullname','userpic','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','isEmpty','agent','push','createdAt','FromId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','end','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0xe7fb,0x162));var _0xbe7f=function(_0x45d841,_0x4fb155){_0x45d841=_0x45d841-0x0;var _0xcd8034=_0xe7fb[_0x45d841];return _0xcd8034;};'use strict';var pdf=require(_0xbe7f('0x0'));var emlformat=require(_0xbe7f('0x1'));var rimraf=require(_0xbe7f('0x2'));var zipdir=require(_0xbe7f('0x3'));var jsonpatch=require(_0xbe7f('0x4'));var rp=require('request-promise');var moment=require(_0xbe7f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbe7f('0x6'));var util=require(_0xbe7f('0x7'));var path=require(_0xbe7f('0x8'));var sox=require('sox');var csv=require(_0xbe7f('0x9'));var ejs=require(_0xbe7f('0xa'));var fs=require('fs');var _=require(_0xbe7f('0xb'));var squel=require(_0xbe7f('0xc'));var crypto=require(_0xbe7f('0xd'));var jsforce=require(_0xbe7f('0xe'));var deskjs=require(_0xbe7f('0xf'));var toCsv=require(_0xbe7f('0x9'));var querystring=require('querystring');var Papa=require(_0xbe7f('0x10'));var Redis=require(_0xbe7f('0x11'));var authService=require(_0xbe7f('0x12'));var qs=require(_0xbe7f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbe7f('0x14'));var utils=require(_0xbe7f('0x15'));var config=require(_0xbe7f('0x16'));var db=require(_0xbe7f('0x17'))['db'];config[_0xbe7f('0x18')]=_[_0xbe7f('0x19')](config[_0xbe7f('0x18')],{'host':_0xbe7f('0x1a'),'port':0x18eb});var socket=require(_0xbe7f('0x1b'))(new Redis(config[_0xbe7f('0x18')]));require('./chatInternalMessage.socket')[_0xbe7f('0x1c')](socket);function respondWithStatusCode(_0x18c6bc,_0x31089c){_0x31089c=_0x31089c||0xcc;return function(_0x36e33b){if(_0x36e33b){return _0x18c6bc[_0xbe7f('0x1d')](_0x31089c);}return _0x18c6bc[_0xbe7f('0x1e')](_0x31089c)['end']();};}function respondWithResult(_0x3d7810,_0x12c421){_0x12c421=_0x12c421||0xc8;return function(_0x28f002){if(_0x28f002){return _0x3d7810['status'](_0x12c421)['json'](_0x28f002);}};}function respondWithFilteredResult(_0x142cc3,_0x2a7dba){return function(_0x4c2819){if(_0x4c2819){var _0x4d362c=_0x4c2819['count'],_0x1e336b=_0x2a7dba[_0xbe7f('0x1f')],_0x1ee9c5=_0x2a7dba[_0xbe7f('0x1f')]+_0x2a7dba[_0xbe7f('0x20')],_0x3eace2;if(_0x1ee9c5>=_0x4d362c){_0x1ee9c5=_0x4d362c;_0x3eace2=0xc8;}else{_0x3eace2=0xce;}_0x142cc3[_0xbe7f('0x1e')](_0x3eace2);return _0x142cc3[_0xbe7f('0x21')](_0xbe7f('0x22'),_0x1e336b+'-'+_0x1ee9c5+'/'+_0x4d362c)[_0xbe7f('0x23')](_0x4c2819);}return null;};}function patchUpdates(_0x252d8b){return function(_0x5504e9){try{jsonpatch[_0xbe7f('0x24')](_0x5504e9,_0x252d8b,!![]);}catch(_0x4f7d8c){return BPromise[_0xbe7f('0x25')](_0x4f7d8c);}return _0x5504e9['save']();};}function saveUpdates(_0x81d3cd,_0x2fb21e){return function(_0x5c8a2e){if(_0x5c8a2e){return _0x5c8a2e[_0xbe7f('0x26')](_0x81d3cd)[_0xbe7f('0x27')](function(_0x3ec325){return _0x3ec325;});}return null;};}function removeEntity(_0x5a3055,_0x29490e){return function(_0x5ef915){if(_0x5ef915){return _0x5ef915[_0xbe7f('0x28')]()['then'](function(){_0x5a3055[_0xbe7f('0x1e')](0xcc)[_0xbe7f('0x29')]();});}};}function handleEntityNotFound(_0x9ca442,_0x1d7efd){return function(_0x141224){if(!_0x141224){_0x9ca442[_0xbe7f('0x1d')](0x194);}return _0x141224;};}function handleError(_0x409f4f,_0x29a265){_0x29a265=_0x29a265||0x1f4;return function(_0x36b90c){logger['error'](_0x36b90c['stack']);if(_0x36b90c[_0xbe7f('0x2a')]){delete _0x36b90c['name'];}_0x409f4f['status'](_0x29a265)[_0xbe7f('0x2b')](_0x36b90c);};}exports[_0xbe7f('0x2c')]=function(_0x216001,_0x5c51d3){var _0x24eaa0={},_0x41f209={},_0x2bc8be={'count':0x0,'rows':[]};var _0x4139ac=_[_0xbe7f('0x2d')](db[_0xbe7f('0x2e')][_0xbe7f('0x2f')],function(_0x499830){return{'name':_0x499830[_0xbe7f('0x30')],'type':_0x499830[_0xbe7f('0x31')][_0xbe7f('0x32')]};});_0x41f209[_0xbe7f('0x33')]=_['map'](_0x4139ac,_0xbe7f('0x2a'));_0x41f209[_0xbe7f('0x34')]=_['keys'](_0x216001[_0xbe7f('0x34')]);_0x41f209[_0xbe7f('0x35')]=_[_0xbe7f('0x36')](_0x41f209[_0xbe7f('0x33')],_0x41f209[_0xbe7f('0x34')]);_0x24eaa0['attributes']=_[_0xbe7f('0x36')](_0x41f209['model'],qs[_0xbe7f('0x37')](_0x216001[_0xbe7f('0x34')]['fields']));_0x24eaa0[_0xbe7f('0x38')]=_0x24eaa0[_0xbe7f('0x38')]['length']?_0x24eaa0[_0xbe7f('0x38')]:_0x41f209['model'];if(!_0x216001['query'][_0xbe7f('0x39')](_0xbe7f('0x3a'))){_0x24eaa0[_0xbe7f('0x20')]=qs[_0xbe7f('0x20')](_0x216001[_0xbe7f('0x34')][_0xbe7f('0x20')]);_0x24eaa0[_0xbe7f('0x1f')]=qs[_0xbe7f('0x1f')](_0x216001[_0xbe7f('0x34')][_0xbe7f('0x1f')]);}_0x24eaa0['order']=qs[_0xbe7f('0x3b')](_0x216001['query'][_0xbe7f('0x3b')]);_0x24eaa0['where']=qs['filters'](_['pick'](_0x216001['query'],_0x41f209[_0xbe7f('0x35')]));if(_0x216001[_0xbe7f('0x34')]['filter']){_0x24eaa0[_0xbe7f('0x3c')]=_[_0xbe7f('0x3d')](_0x24eaa0[_0xbe7f('0x3c')],{'$or':_[_0xbe7f('0x2d')](_0x4139ac,function(_0x1572c7){if(_0x1572c7[_0xbe7f('0x31')]!==_0xbe7f('0x3e')){var _0x2b2d90={};_0x2b2d90[_0x1572c7[_0xbe7f('0x2a')]]={'$like':'%'+_0x216001[_0xbe7f('0x34')][_0xbe7f('0x3f')]+'%'};return _0x2b2d90;}})});}_0x24eaa0=_[_0xbe7f('0x3d')]({},_0x24eaa0,_0x216001['options']);var _0x49c16a={'where':_0x24eaa0[_0xbe7f('0x3c')]};return db[_0xbe7f('0x2e')][_0xbe7f('0x40')](_0x49c16a)[_0xbe7f('0x27')](function(_0x746d54){_0x2bc8be[_0xbe7f('0x40')]=_0x746d54;if(_0x216001['query']['includeAll']){_0x24eaa0[_0xbe7f('0x41')]=[{'all':!![]}];}return db[_0xbe7f('0x2e')][_0xbe7f('0x42')](_0x24eaa0);})[_0xbe7f('0x27')](function(_0x1e2f89){_0x2bc8be['rows']=_0x1e2f89;return _0x2bc8be;})['then'](respondWithFilteredResult(_0x5c51d3,_0x24eaa0))[_0xbe7f('0x43')](handleError(_0x5c51d3,null));};exports[_0xbe7f('0x44')]=function(_0x10a1a2,_0x1675c5){var _0x173ef2={'raw':!![],'where':{'id':_0x10a1a2[_0xbe7f('0x45')]['id']}},_0x507eff={};_0x507eff[_0xbe7f('0x33')]=_[_0xbe7f('0x46')](db[_0xbe7f('0x2e')]['rawAttributes']);_0x507eff[_0xbe7f('0x34')]=_[_0xbe7f('0x46')](_0x10a1a2[_0xbe7f('0x34')]);_0x507eff[_0xbe7f('0x35')]=_[_0xbe7f('0x36')](_0x507eff[_0xbe7f('0x33')],_0x507eff[_0xbe7f('0x34')]);_0x173ef2[_0xbe7f('0x38')]=_[_0xbe7f('0x36')](_0x507eff[_0xbe7f('0x33')],qs[_0xbe7f('0x37')](_0x10a1a2['query']['fields']));_0x173ef2[_0xbe7f('0x38')]=_0x173ef2['attributes'][_0xbe7f('0x47')]?_0x173ef2[_0xbe7f('0x38')]:_0x507eff[_0xbe7f('0x33')];if(_0x10a1a2[_0xbe7f('0x34')][_0xbe7f('0x48')]){_0x173ef2[_0xbe7f('0x41')]=[{'all':!![]}];}_0x173ef2=_[_0xbe7f('0x3d')]({},_0x173ef2,_0x10a1a2[_0xbe7f('0x49')]);return db[_0xbe7f('0x2e')][_0xbe7f('0x4a')](_0x173ef2)[_0xbe7f('0x27')](handleEntityNotFound(_0x1675c5,null))['then'](respondWithResult(_0x1675c5,null))[_0xbe7f('0x43')](handleError(_0x1675c5,null));};exports[_0xbe7f('0x4b')]=function(_0x58317e,_0x44a1b4){return db['ChatInternalMessage'][_0xbe7f('0x4b')](_0x58317e[_0xbe7f('0x4c')],{})[_0xbe7f('0x27')](respondWithResult(_0x44a1b4,0xc9))['catch'](handleError(_0x44a1b4,null));};exports[_0xbe7f('0x26')]=function(_0x55e4e8,_0x49f061){if(_0x55e4e8[_0xbe7f('0x4c')]['id']){delete _0x55e4e8['body']['id'];}return db[_0xbe7f('0x2e')][_0xbe7f('0x4a')]({'where':{'id':_0x55e4e8[_0xbe7f('0x45')]['id']}})['then'](handleEntityNotFound(_0x49f061,null))[_0xbe7f('0x27')](saveUpdates(_0x55e4e8[_0xbe7f('0x4c')],null))[_0xbe7f('0x27')](respondWithResult(_0x49f061,null))[_0xbe7f('0x43')](handleError(_0x49f061,null));};exports[_0xbe7f('0x28')]=function(_0xe9fac0,_0x3b4e29){return db[_0xbe7f('0x2e')][_0xbe7f('0x4a')]({'where':{'id':_0xe9fac0[_0xbe7f('0x45')]['id']}})[_0xbe7f('0x27')](handleEntityNotFound(_0x3b4e29,null))['then'](removeEntity(_0x3b4e29,null))[_0xbe7f('0x43')](handleError(_0x3b4e29,null));};exports[_0xbe7f('0x4d')]=function(_0xabf5c7,_0x96ca36){return db['ChatInternalMessage'][_0xbe7f('0x4d')]()[_0xbe7f('0x27')](respondWithResult(_0x96ca36,null))[_0xbe7f('0x43')](handleError(_0x96ca36,null));};function wrapUser(_0xb1d2cd){return function(_0x1602d7){var _0x20100f=_0xb1d2cd[_0xbe7f('0x4e')]({'plain':!![]});_0x20100f[_0xbe7f('0x4f')]=[];if(_0x1602d7){_0x20100f[_0xbe7f('0x50')]=_0x1602d7['createdAt'];_0x20100f[_0xbe7f('0x51')]=_0x1602d7;}else{_0x20100f['lastMessageAt']=moment(0x0)[_0xbe7f('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x20100f['lastMessage']={};}return _0x20100f;};}exports['getUsers']=function(_0x42c45b,_0x49a507,_0x10f6e9){var _0x2f350a=[];return db[_0xbe7f('0x53')][_0xbe7f('0x42')]({'where':{'role':['agent',_0xbe7f('0x54'),_0xbe7f('0x55')]},'attributes':['id',_0xbe7f('0x56'),_0xbe7f('0x2a'),'role',_0xbe7f('0x57'),'internal',_0xbe7f('0x58'),'lastLoginAt',_0xbe7f('0x59'),_0xbe7f('0x5a')],'order':qs['sort']('-online'),'include':[{'model':db[_0xbe7f('0x5b')],'as':_0xbe7f('0x5c'),'attributes':['id',_0xbe7f('0x2a'),_0xbe7f('0x31')],'through':{'attributes':[]}}]})[_0xbe7f('0x27')](function(_0x2ca8b4){if(_0x2ca8b4){var _0x2e60e1=_0x42c45b[_0xbe7f('0x55')][_0xbe7f('0x4e')]({'plain':!![]});if(!_0x2e60e1)throw new Error(_0xbe7f('0x5d'));if(_0x2e60e1[_0xbe7f('0x5e')]===_0xbe7f('0x55')){return db['UserProfileSection'][_0xbe7f('0x4a')]({'where':{'name':'Agents','userProfileId':_0x2e60e1['userProfileId']},'raw':!![]})[_0xbe7f('0x27')](function(_0x810fc9){if(_0x810fc9){if(_0x810fc9[_0xbe7f('0x5f')]===0x0){return db['UserProfileResource'][_0xbe7f('0x42')]({'where':{'sectionId':_0x810fc9['id']},'raw':!![]})['then'](function(_0x1f8bef){var _0x401d82=[];if(_[_0xbe7f('0x60')](_0x1f8bef)){_0x401d82=_[_0xbe7f('0x3f')](_0x2ca8b4,function(_0x399bb8){if(_0x399bb8[_0xbe7f('0x5e')]!==_0xbe7f('0x61')){return _0x399bb8;}});return _0x401d82;}else{for(var _0x3ae282=0x0;_0x3ae282<_0x2ca8b4[_0xbe7f('0x47')];_0x3ae282++){var _0xde9251=_0x2ca8b4[_0x3ae282];if(_0xde9251['role']===_0xbe7f('0x61')){var _0x5f0d58=_[_0xbe7f('0x4a')](_0x1f8bef,function(_0x49c69f){return _0x49c69f['resourceId']===_0xde9251['id'];});if(_0x5f0d58)_0x401d82['push'](_0xde9251);}else{_0x401d82[_0xbe7f('0x62')](_0xde9251);}}return _0x401d82;}});}else{return _0x2ca8b4;}}else{var _0x5f1f85=_[_0xbe7f('0x3f')](_0x2ca8b4,function(_0x3227a4){if(_0x3227a4[_0xbe7f('0x5e')]!==_0xbe7f('0x61')){return _0x3227a4;}});return _0x5f1f85;}});}else{return _0x2ca8b4;}}})[_0xbe7f('0x27')](function(_0x35e21f){var _0x21d8b4=[];if(_0x35e21f){_0x2f350a=_0x35e21f;for(var _0x2b6947=0x0;_0x2b6947<_0x35e21f['length'];_0x2b6947+=0x1){_0x2f350a[_0x2b6947][_0xbe7f('0x4f')]=[];_0x21d8b4[_0xbe7f('0x62')](db[_0xbe7f('0x2e')]['find']({'where':{'FromId':[_0x42c45b['user']['id'],_0x35e21f[_0x2b6947]['id']],'ToId':[_0x42c45b[_0xbe7f('0x55')]['id'],_0x35e21f[_0x2b6947]['id']],'ChatGroupId':null},'attributes':['id',_0xbe7f('0x63'),_0xbe7f('0x64'),'ToId',_0xbe7f('0x65'),'body'],'order':qs[_0xbe7f('0x3b')](_0xbe7f('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x35e21f[_0x2b6947])));}return BPromise[_0xbe7f('0x67')](_0x21d8b4);}return[];})[_0xbe7f('0x27')](function(_0x5116b2){return{'rows':_0x5116b2,'count':_0x5116b2['length']};})[_0xbe7f('0x27')](respondWithResult(_0x49a507,null))[_0xbe7f('0x43')](handleError(_0x49a507,null));}; \ No newline at end of file +var _0x14eb=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ChatInternalMessage','include','show','params','includeAll','options','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0x14eb,0xc1));var _0xb14e=function(_0x2ff2dc,_0x4869a3){_0x2ff2dc=_0x2ff2dc-0x0;var _0x10d260=_0x14eb[_0x2ff2dc];return _0x10d260;};'use strict';var pdf=require(_0xb14e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb14e('0x1'));var jsonpatch=require(_0xb14e('0x2'));var rp=require(_0xb14e('0x3'));var moment=require(_0xb14e('0x4'));var BPromise=require(_0xb14e('0x5'));var Mustache=require(_0xb14e('0x6'));var util=require(_0xb14e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb14e('0x8'));var fs=require('fs');var _=require(_0xb14e('0x9'));var squel=require(_0xb14e('0xa'));var crypto=require(_0xb14e('0xb'));var jsforce=require(_0xb14e('0xc'));var deskjs=require(_0xb14e('0xd'));var toCsv=require(_0xb14e('0xe'));var querystring=require(_0xb14e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb14e('0x10'));var qs=require(_0xb14e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb14e('0x12'));var logger=require(_0xb14e('0x13'))(_0xb14e('0x14'));var utils=require(_0xb14e('0x15'));var config=require('../../config/environment');var db=require(_0xb14e('0x16'))['db'];config[_0xb14e('0x17')]=_[_0xb14e('0x18')](config[_0xb14e('0x17')],{'host':_0xb14e('0x19'),'port':0x18eb});var socket=require(_0xb14e('0x1a'))(new Redis(config[_0xb14e('0x17')]));require(_0xb14e('0x1b'))[_0xb14e('0x1c')](socket);function respondWithStatusCode(_0x58dcb3,_0x5afdad){_0x5afdad=_0x5afdad||0xcc;return function(_0x3d004f){if(_0x3d004f){return _0x58dcb3[_0xb14e('0x1d')](_0x5afdad);}return _0x58dcb3[_0xb14e('0x1e')](_0x5afdad)[_0xb14e('0x1f')]();};}function respondWithResult(_0x15dbde,_0x2cb45d){_0x2cb45d=_0x2cb45d||0xc8;return function(_0x4667dd){if(_0x4667dd){return _0x15dbde[_0xb14e('0x1e')](_0x2cb45d)[_0xb14e('0x20')](_0x4667dd);}};}function respondWithFilteredResult(_0x362c10,_0x20a1f9){return function(_0x3107bd){if(_0x3107bd){var _0x25d844=_0x3107bd[_0xb14e('0x21')],_0x523c75=_0x20a1f9[_0xb14e('0x22')],_0x513a74=_0x20a1f9[_0xb14e('0x22')]+_0x20a1f9[_0xb14e('0x23')],_0x1a32d3;if(_0x513a74>=_0x25d844){_0x513a74=_0x25d844;_0x1a32d3=0xc8;}else{_0x1a32d3=0xce;}_0x362c10['status'](_0x1a32d3);return _0x362c10[_0xb14e('0x24')](_0xb14e('0x25'),_0x523c75+'-'+_0x513a74+'/'+_0x25d844)[_0xb14e('0x20')](_0x3107bd);}return null;};}function patchUpdates(_0x23d668){return function(_0x107f32){try{jsonpatch[_0xb14e('0x26')](_0x107f32,_0x23d668,!![]);}catch(_0x1c88ef){return BPromise[_0xb14e('0x27')](_0x1c88ef);}return _0x107f32['save']();};}function saveUpdates(_0x10d948,_0x247fbd){return function(_0x37abe6){if(_0x37abe6){return _0x37abe6[_0xb14e('0x28')](_0x10d948)[_0xb14e('0x29')](function(_0x37d492){return _0x37d492;});}return null;};}function removeEntity(_0x15aa9a,_0x46c220){return function(_0x2916bb){if(_0x2916bb){return _0x2916bb[_0xb14e('0x2a')]()[_0xb14e('0x29')](function(){_0x15aa9a[_0xb14e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0d79,_0x364d62){return function(_0x2411d1){if(!_0x2411d1){_0x4e0d79['sendStatus'](0x194);}return _0x2411d1;};}function handleError(_0x506cca,_0x43e98f){_0x43e98f=_0x43e98f||0x1f4;return function(_0x5e877f){logger[_0xb14e('0x2b')](_0x5e877f[_0xb14e('0x2c')]);if(_0x5e877f[_0xb14e('0x2d')]){delete _0x5e877f[_0xb14e('0x2d')];}_0x506cca[_0xb14e('0x1e')](_0x43e98f)[_0xb14e('0x2e')](_0x5e877f);};}exports[_0xb14e('0x2f')]=function(_0x69780b,_0x38f67a){var _0x140d9d={},_0x552a08={},_0x5a882a={'count':0x0,'rows':[]};var _0x448b0e=_[_0xb14e('0x30')](db['ChatInternalMessage'][_0xb14e('0x31')],function(_0x34651c){return{'name':_0x34651c[_0xb14e('0x32')],'type':_0x34651c[_0xb14e('0x33')][_0xb14e('0x34')]};});_0x552a08[_0xb14e('0x35')]=_[_0xb14e('0x30')](_0x448b0e,_0xb14e('0x2d'));_0x552a08['query']=_[_0xb14e('0x36')](_0x69780b[_0xb14e('0x37')]);_0x552a08[_0xb14e('0x38')]=_['intersection'](_0x552a08['model'],_0x552a08[_0xb14e('0x37')]);_0x140d9d['attributes']=_[_0xb14e('0x39')](_0x552a08[_0xb14e('0x35')],qs[_0xb14e('0x3a')](_0x69780b[_0xb14e('0x37')]['fields']));_0x140d9d[_0xb14e('0x3b')]=_0x140d9d['attributes'][_0xb14e('0x3c')]?_0x140d9d['attributes']:_0x552a08['model'];if(!_0x69780b[_0xb14e('0x37')]['hasOwnProperty'](_0xb14e('0x3d'))){_0x140d9d['limit']=qs['limit'](_0x69780b['query'][_0xb14e('0x23')]);_0x140d9d['offset']=qs[_0xb14e('0x22')](_0x69780b[_0xb14e('0x37')]['offset']);}_0x140d9d[_0xb14e('0x3e')]=qs[_0xb14e('0x3f')](_0x69780b['query'][_0xb14e('0x3f')]);_0x140d9d[_0xb14e('0x40')]=qs[_0xb14e('0x38')](_[_0xb14e('0x41')](_0x69780b['query'],_0x552a08['filters']));if(_0x69780b['query']['filter']){_0x140d9d[_0xb14e('0x40')]=_[_0xb14e('0x42')](_0x140d9d[_0xb14e('0x40')],{'$or':_[_0xb14e('0x30')](_0x448b0e,function(_0x430a52){if(_0x430a52[_0xb14e('0x33')]!==_0xb14e('0x43')){var _0x137359={};_0x137359[_0x430a52['name']]={'$like':'%'+_0x69780b[_0xb14e('0x37')][_0xb14e('0x44')]+'%'};return _0x137359;}})});}_0x140d9d=_[_0xb14e('0x42')]({},_0x140d9d,_0x69780b['options']);var _0x38a28c={'where':_0x140d9d[_0xb14e('0x40')]};return db[_0xb14e('0x45')][_0xb14e('0x21')](_0x38a28c)[_0xb14e('0x29')](function(_0x28e290){_0x5a882a[_0xb14e('0x21')]=_0x28e290;if(_0x69780b[_0xb14e('0x37')]['includeAll']){_0x140d9d[_0xb14e('0x46')]=[{'all':!![]}];}return db[_0xb14e('0x45')]['findAll'](_0x140d9d);})[_0xb14e('0x29')](function(_0x2ab42c){_0x5a882a['rows']=_0x2ab42c;return _0x5a882a;})[_0xb14e('0x29')](respondWithFilteredResult(_0x38f67a,_0x140d9d))['catch'](handleError(_0x38f67a,null));};exports[_0xb14e('0x47')]=function(_0x1d00da,_0x3b21e2){var _0x539645={'raw':!![],'where':{'id':_0x1d00da[_0xb14e('0x48')]['id']}},_0x56945d={};_0x56945d[_0xb14e('0x35')]=_['keys'](db[_0xb14e('0x45')]['rawAttributes']);_0x56945d[_0xb14e('0x37')]=_[_0xb14e('0x36')](_0x1d00da[_0xb14e('0x37')]);_0x56945d['filters']=_[_0xb14e('0x39')](_0x56945d[_0xb14e('0x35')],_0x56945d['query']);_0x539645[_0xb14e('0x3b')]=_['intersection'](_0x56945d[_0xb14e('0x35')],qs[_0xb14e('0x3a')](_0x1d00da['query']['fields']));_0x539645[_0xb14e('0x3b')]=_0x539645['attributes'][_0xb14e('0x3c')]?_0x539645[_0xb14e('0x3b')]:_0x56945d[_0xb14e('0x35')];if(_0x1d00da[_0xb14e('0x37')][_0xb14e('0x49')]){_0x539645['include']=[{'all':!![]}];}_0x539645=_['merge']({},_0x539645,_0x1d00da[_0xb14e('0x4a')]);return db[_0xb14e('0x45')][_0xb14e('0x4b')](_0x539645)['then'](handleEntityNotFound(_0x3b21e2,null))['then'](respondWithResult(_0x3b21e2,null))['catch'](handleError(_0x3b21e2,null));};exports[_0xb14e('0x4c')]=function(_0x5959ae,_0x415c28){return db['ChatInternalMessage'][_0xb14e('0x4c')](_0x5959ae['body'],{})['then'](respondWithResult(_0x415c28,0xc9))['catch'](handleError(_0x415c28,null));};exports[_0xb14e('0x28')]=function(_0x172542,_0x258fd9){if(_0x172542[_0xb14e('0x4d')]['id']){delete _0x172542[_0xb14e('0x4d')]['id'];}return db[_0xb14e('0x45')][_0xb14e('0x4b')]({'where':{'id':_0x172542[_0xb14e('0x48')]['id']}})[_0xb14e('0x29')](handleEntityNotFound(_0x258fd9,null))['then'](saveUpdates(_0x172542[_0xb14e('0x4d')],null))['then'](respondWithResult(_0x258fd9,null))['catch'](handleError(_0x258fd9,null));};exports[_0xb14e('0x2a')]=function(_0x284c95,_0x343183){return db[_0xb14e('0x45')][_0xb14e('0x4b')]({'where':{'id':_0x284c95[_0xb14e('0x48')]['id']}})[_0xb14e('0x29')](handleEntityNotFound(_0x343183,null))['then'](removeEntity(_0x343183,null))[_0xb14e('0x4e')](handleError(_0x343183,null));};exports[_0xb14e('0x4f')]=function(_0x488290,_0x2d8521){return db[_0xb14e('0x45')][_0xb14e('0x4f')]()[_0xb14e('0x29')](respondWithResult(_0x2d8521,null))[_0xb14e('0x4e')](handleError(_0x2d8521,null));};function wrapUser(_0xdec137){return function(_0x311322){var _0x59f91d=_0xdec137[_0xb14e('0x50')]({'plain':!![]});_0x59f91d[_0xb14e('0x51')]=[];if(_0x311322){_0x59f91d[_0xb14e('0x52')]=_0x311322[_0xb14e('0x53')];_0x59f91d[_0xb14e('0x54')]=_0x311322;}else{_0x59f91d[_0xb14e('0x52')]=moment(0x0)['format'](_0xb14e('0x55'));_0x59f91d[_0xb14e('0x54')]={};}return _0x59f91d;};}exports['getUsers']=function(_0x109e6e,_0x54908a,_0x4b8b9b){var _0x3d38b9=[];return db[_0xb14e('0x56')][_0xb14e('0x57')]({'where':{'role':[_0xb14e('0x58'),_0xb14e('0x59'),_0xb14e('0x5a')]},'attributes':['id',_0xb14e('0x5b'),'name',_0xb14e('0x5c'),_0xb14e('0x5d'),_0xb14e('0x5e'),_0xb14e('0x5f'),_0xb14e('0x60'),_0xb14e('0x61'),_0xb14e('0x62')],'order':qs[_0xb14e('0x3f')](_0xb14e('0x63')),'include':[{'model':db[_0xb14e('0x64')],'as':'VoiceQueues','attributes':['id',_0xb14e('0x2d'),'type'],'through':{'attributes':[]}}]})[_0xb14e('0x29')](function(_0x2fb4e2){if(_0x2fb4e2){var _0x4f70d2=_0x109e6e[_0xb14e('0x5a')][_0xb14e('0x50')]({'plain':!![]});if(!_0x4f70d2)throw new Error(_0xb14e('0x65'));if(_0x4f70d2[_0xb14e('0x5c')]===_0xb14e('0x5a')){return db['UserProfileSection']['find']({'where':{'name':_0xb14e('0x66'),'userProfileId':_0x4f70d2['userProfileId']},'raw':!![]})['then'](function(_0x3b4385){if(_0x3b4385){if(_0x3b4385['autoAssociation']===0x0){return db[_0xb14e('0x67')][_0xb14e('0x57')]({'where':{'sectionId':_0x3b4385['id']},'raw':!![]})[_0xb14e('0x29')](function(_0x3cb0e0){var _0x28b45e=[];if(_[_0xb14e('0x68')](_0x3cb0e0)){_0x28b45e=_[_0xb14e('0x44')](_0x2fb4e2,function(_0x1a8ee8){if(_0x1a8ee8['role']!==_0xb14e('0x58')){return _0x1a8ee8;}});return _0x28b45e;}else{for(var _0x395ddc=0x0;_0x395ddc<_0x2fb4e2['length'];_0x395ddc++){var _0x4ffe5d=_0x2fb4e2[_0x395ddc];if(_0x4ffe5d[_0xb14e('0x5c')]===_0xb14e('0x58')){var _0x570713=_['find'](_0x3cb0e0,function(_0x4ab8c1){return _0x4ab8c1[_0xb14e('0x69')]===_0x4ffe5d['id'];});if(_0x570713)_0x28b45e[_0xb14e('0x6a')](_0x4ffe5d);}else{_0x28b45e['push'](_0x4ffe5d);}}return _0x28b45e;}});}else{return _0x2fb4e2;}}else{var _0x35eb73=_['filter'](_0x2fb4e2,function(_0x1cf4d1){if(_0x1cf4d1['role']!=='agent'){return _0x1cf4d1;}});return _0x35eb73;}});}else{return _0x2fb4e2;}}})[_0xb14e('0x29')](function(_0x52980e){var _0x753c4e=[];if(_0x52980e){_0x3d38b9=_0x52980e;for(var _0x6b7c53=0x0;_0x6b7c53<_0x52980e[_0xb14e('0x3c')];_0x6b7c53+=0x1){_0x3d38b9[_0x6b7c53][_0xb14e('0x51')]=[];_0x753c4e['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x109e6e['user']['id'],_0x52980e[_0x6b7c53]['id']],'ToId':[_0x109e6e[_0xb14e('0x5a')]['id'],_0x52980e[_0x6b7c53]['id']],'ChatGroupId':null},'attributes':['id',_0xb14e('0x53'),_0xb14e('0x6b'),_0xb14e('0x6c'),_0xb14e('0x6d'),_0xb14e('0x4d')],'order':qs[_0xb14e('0x3f')](_0xb14e('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb14e('0x29')](wrapUser(_0x52980e[_0x6b7c53])));}return BPromise['all'](_0x753c4e);}return[];})[_0xb14e('0x29')](function(_0x5100e5){return{'rows':_0x5100e5,'count':_0x5100e5[_0xb14e('0x3c')]};})[_0xb14e('0x29')](respondWithResult(_0x54908a,null))[_0xb14e('0x4e')](handleError(_0x54908a,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f238dd6..d61ec56 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 _0x6c32=['remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','save'];(function(_0x511ebe,_0x6fdf8){var _0x29c57f=function(_0x3cd997){while(--_0x3cd997){_0x511ebe['push'](_0x511ebe['shift']());}};_0x29c57f(++_0x6fdf8);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x26c3('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x26c3('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26c3('0x2'),'afterUpdate':'update','afterDestroy':_0x26c3('0x3')};function emitEvent(_0x2c29dc){return function(_0x5e8a24,_0x4c2de2,_0x16867a){ChatInternalMessageEvents[_0x26c3('0x4')](_0x2c29dc+':'+_0x5e8a24['id'],_0x5e8a24);ChatInternalMessageEvents[_0x26c3('0x4')](_0x2c29dc,_0x5e8a24);_0x16867a(null);};}for(var e in events){if(events[_0x26c3('0x5')](e)){var event=events[e];ChatInternalMessage[_0x26c3('0x6')](e,emitEvent(event));}}module[_0x26c3('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xbcba=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2472ca,_0x33ebf4){var _0x2b2f1d=function(_0x4b5744){while(--_0x4b5744){_0x2472ca['push'](_0x2472ca['shift']());}};_0x2b2f1d(++_0x33ebf4);}(_0xbcba,0x6d));var _0xabcb=function(_0x1b94a1,_0x206144){_0x1b94a1=_0x1b94a1-0x0;var _0x78ef7e=_0xbcba[_0x1b94a1];return _0x78ef7e;};'use strict';var EventEmitter=require(_0xabcb('0x0'));var ChatInternalMessage=require(_0xabcb('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xabcb('0x2')](0x0);var events={'afterCreate':_0xabcb('0x3'),'afterUpdate':_0xabcb('0x4'),'afterDestroy':_0xabcb('0x5')};function emitEvent(_0x187b3b){return function(_0x3e3b9b,_0x5e10df,_0x4bc9c1){ChatInternalMessageEvents[_0xabcb('0x6')](_0x187b3b+':'+_0x3e3b9b['id'],_0x3e3b9b);ChatInternalMessageEvents[_0xabcb('0x6')](_0x187b3b,_0x3e3b9b);_0x4bc9c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xabcb('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 337f11c..12f7c6e 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 _0xf4eb=['./chatInternalMessage.attributes','exports','define','chat_internal_messages','lodash','bluebird','rimraf','../../config/environment'];(function(_0x23e5a5,_0x4a4809){var _0x3e4ebd=function(_0x3aa5d8){while(--_0x3aa5d8){_0x23e5a5['push'](_0x23e5a5['shift']());}};_0x3e4ebd(++_0x4a4809);}(_0xf4eb,0xec));var _0xbf4e=function(_0x59a5ff,_0x4e2fc7){_0x59a5ff=_0x59a5ff-0x0;var _0x77114a=_0xf4eb[_0x59a5ff];return _0x77114a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('ChatInternalMessage',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x2aade8,_0x3db062){var _0x4e7077=function(_0x3ee77f){while(--_0x3ee77f){_0x2aade8['push'](_0x2aade8['shift']());}};_0x4e7077(++_0x3db062);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xcb91[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1cb9('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 1c2deba..3207006 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 _0x92ae=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x92ae,0x11d));var _0xe92a=function(_0x5d82b2,_0x407f99){_0x5d82b2=_0x5d82b2-0x0;var _0x52483f=_0x92ae[_0x5d82b2];return _0x52483f;};'use strict';var _=require('lodash');var util=require(_0xe92a('0x0'));var moment=require(_0xe92a('0x1'));var BPromise=require(_0xe92a('0x2'));var rs=require(_0xe92a('0x3'));var fs=require('fs');var Redis=require(_0xe92a('0x4'));var db=require(_0xe92a('0x5'))['db'];var utils=require(_0xe92a('0x6'));var logger=require(_0xe92a('0x7'))(_0xe92a('0x8'));var config=require(_0xe92a('0x9'));var jayson=require(_0xe92a('0xa'));var client=jayson['client'][_0xe92a('0xb')]({'port':0x232a});config[_0xe92a('0xc')]=_['defaults'](config[_0xe92a('0xc')],{'host':_0xe92a('0xd'),'port':0x18eb});var socket=require(_0xe92a('0xe'))(new Redis(config['redis']));require(_0xe92a('0xf'))[_0xe92a('0x10')](socket);function respondWithRpcPromise(_0x10452b,_0xebb4cd,_0x322321){return new BPromise(function(_0x3d88ba,_0x5e6c9f){return client[_0xe92a('0x11')](_0x10452b,_0x322321)[_0xe92a('0x12')](function(_0x1f5c87){logger[_0xe92a('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xebb4cd,_0xe92a('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xebb4cd,_0xe92a('0x14'),JSON['stringify'](_0x1f5c87));if(_0x1f5c87[_0xe92a('0x15')]){if(_0x1f5c87['error'][_0xe92a('0x16')]===0x1f4){logger[_0xe92a('0x15')](_0xe92a('0x17'),_0xebb4cd,_0x1f5c87['error']['message']);return _0x5e6c9f(_0x1f5c87[_0xe92a('0x15')][_0xe92a('0x18')]);}logger[_0xe92a('0x15')](_0xe92a('0x17'),_0xebb4cd,_0x1f5c87[_0xe92a('0x15')][_0xe92a('0x18')]);return _0x3d88ba(_0x1f5c87[_0xe92a('0x15')][_0xe92a('0x18')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xebb4cd,_0xe92a('0x14'));_0x3d88ba(_0x1f5c87[_0xe92a('0x19')]['message']);}})[_0xe92a('0x1a')](function(_0x553642){logger[_0xe92a('0x15')](_0xe92a('0x17'),_0xebb4cd,_0x553642);_0x5e6c9f(_0x553642);});});} \ No newline at end of file +var _0x28c6=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment'];(function(_0x502748,_0xc878f7){var _0x522caa=function(_0x731f3f){while(--_0x731f3f){_0x502748['push'](_0x502748['shift']());}};_0x522caa(++_0xc878f7);}(_0x28c6,0x18d));var _0x628c=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x28c6[_0x29e2af];return _0x1ea06a;};'use strict';var _=require(_0x628c('0x0'));var util=require(_0x628c('0x1'));var moment=require(_0x628c('0x2'));var BPromise=require(_0x628c('0x3'));var rs=require(_0x628c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x628c('0x5'))['db'];var utils=require(_0x628c('0x6'));var logger=require(_0x628c('0x7'))('rpc');var config=require(_0x628c('0x8'));var jayson=require(_0x628c('0x9'));var client=jayson[_0x628c('0xa')][_0x628c('0xb')]({'port':0x232a});config[_0x628c('0xc')]=_[_0x628c('0xd')](config[_0x628c('0xc')],{'host':_0x628c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x628c('0xc')]));require(_0x628c('0xf'))[_0x628c('0x10')](socket);function respondWithRpcPromise(_0x10cd95,_0x29fa81,_0x229920){return new BPromise(function(_0x437957,_0x4c9a96){return client['request'](_0x10cd95,_0x229920)[_0x628c('0x11')](function(_0x2838cf){logger[_0x628c('0x12')](_0x628c('0x13'),_0x29fa81,_0x628c('0x14'));logger['debug'](_0x628c('0x15'),_0x29fa81,_0x628c('0x14'),JSON['stringify'](_0x2838cf));if(_0x2838cf['error']){if(_0x2838cf[_0x628c('0x16')]['code']===0x1f4){logger[_0x628c('0x16')](_0x628c('0x13'),_0x29fa81,_0x2838cf['error']['message']);return _0x4c9a96(_0x2838cf['error'][_0x628c('0x17')]);}logger[_0x628c('0x16')](_0x628c('0x13'),_0x29fa81,_0x2838cf[_0x628c('0x16')][_0x628c('0x17')]);return _0x437957(_0x2838cf[_0x628c('0x16')][_0x628c('0x17')]);}else{logger[_0x628c('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x29fa81,_0x628c('0x14'));_0x437957(_0x2838cf['result']['message']);}})[_0x628c('0x18')](function(_0x266dbe){logger[_0x628c('0x16')](_0x628c('0x13'),_0x29fa81,_0x266dbe);_0x4c9a96(_0x266dbe);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 0abfee0..906dcc7 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 _0x5044=['length','chatInternalMessage:','save','update','emit','removeListener'];(function(_0x857986,_0x1ddaa5){var _0x1b8eff=function(_0x5a8e72){while(--_0x5a8e72){_0x857986['push'](_0x857986['shift']());}};_0x1b8eff(++_0x1ddaa5);}(_0x5044,0xc8));var _0x4504=function(_0x67fda8,_0x3a15c0){_0x67fda8=_0x67fda8-0x0;var _0x46569b=_0x5044[_0x67fda8];return _0x46569b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x4504('0x0'),'remove',_0x4504('0x1')];function createListener(_0x55be59,_0x2e8da7){return function(_0x4da79c){_0x2e8da7[_0x4504('0x2')](_0x55be59,_0x4da79c);};}function removeListener(_0x3e3c2d,_0x19f90c){return function(){ChatInternalMessageEvents[_0x4504('0x3')](_0x3e3c2d,_0x19f90c);};}exports['register']=function(_0x10b50f){for(var _0x40195b=0x0,_0x282816=events[_0x4504('0x4')];_0x40195b<_0x282816;_0x40195b++){var _0x3df37b=events[_0x40195b];var _0xbce7c4=createListener(_0x4504('0x5')+_0x3df37b,_0x10b50f);ChatInternalMessageEvents['on'](_0x3df37b,_0xbce7c4);}}; \ No newline at end of file +var _0x7764=['emit','length','./chatInternalMessage.events','save','remove','update'];(function(_0x4ae2a1,_0x453065){var _0x49b5b7=function(_0xdc81b5){while(--_0xdc81b5){_0x4ae2a1['push'](_0x4ae2a1['shift']());}};_0x49b5b7(++_0x453065);}(_0x7764,0xa4));var _0x4776=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x7764[_0x33032e];return _0x13316b;};'use strict';var ChatInternalMessageEvents=require(_0x4776('0x0'));var events=[_0x4776('0x1'),_0x4776('0x2'),_0x4776('0x3')];function createListener(_0x90273,_0x2ab0a9){return function(_0x4638e9){_0x2ab0a9[_0x4776('0x4')](_0x90273,_0x4638e9);};}function removeListener(_0x3b28ba,_0x1f5638){return function(){ChatInternalMessageEvents['removeListener'](_0x3b28ba,_0x1f5638);};}exports['register']=function(_0xc431bf){for(var _0x3eff9c=0x0,_0x52f59e=events[_0x4776('0x5')];_0x3eff9c<_0x52f59e;_0x3eff9c++){var _0x2b61c7=events[_0x3eff9c];var _0x4fcbcc=createListener('chatInternalMessage:'+_0x2b61c7,_0xc431bf);ChatInternalMessageEvents['on'](_0x2b61c7,_0x4fcbcc);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 743ec25..f254e16 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 _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x23ba51,_0x564bb4){var _0x3edb2e=function(_0x462af7){while(--_0x462af7){_0x23ba51['push'](_0x23ba51['shift']());}};_0x3edb2e(++_0x564bb4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x20f0fc,_0x4f8dc8){var _0x4b0bc8=function(_0x386bd8){while(--_0x386bd8){_0x20f0fc['push'](_0x20f0fc['shift']());}};_0x4b0bc8(++_0x4f8dc8);}(_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('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 028ae54..cf39eb0 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 _0xfbeb=['out','BOOLEAN'];(function(_0x5c1b9d,_0x48e237){var _0x970fd6=function(_0x3fdbdd){while(--_0x3fdbdd){_0x5c1b9d['push'](_0x5c1b9d['shift']());}};_0x970fd6(++_0x48e237);}(_0xfbeb,0x1bb));var _0xbfbe=function(_0x141352,_0x5aa338){_0x141352=_0x141352-0x0;var _0x3d8110=_0xfbeb[_0x141352];return _0x3d8110;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbfbe('0x0')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfbe('0x0')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbfbe('0x1')),'defaultValue':_0xbfbe('0x1'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x7907=['ENUM','out','sequelize','medium'];(function(_0x25771b,_0xa2a452){var _0x8ed7ad=function(_0x502463){while(--_0x502463){_0x25771b['push'](_0x25771b['shift']());}};_0x8ed7ad(++_0xa2a452);}(_0x7907,0x1c2));var _0x7790=function(_0x14c496,_0x29db91){_0x14c496=_0x14c496-0x0;var _0x2b5d50=_0x7907[_0x14c496];return _0x2b5d50;};'use strict';var Sequelize=require(_0x7790('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7790('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7790('0x2')]('in','out'),'defaultValue':_0x7790('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 72cb793..b49e996 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 _0xdf98=['attributes','length','nolimit','sort','where','pick','filter','merge','type','options','then','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','find','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SIP/%s','channel','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','debug','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','status','stack','name','index','map','ChatMessage','fieldName','query','keys','filters','intersection','model','fields'];(function(_0xd1ba41,_0x19ba84){var _0x5ce660=function(_0x4317a2){while(--_0x4317a2){_0xd1ba41['push'](_0xd1ba41['shift']());}};_0x5ce660(++_0x19ba84);}(_0xdf98,0x1a8));var _0x8df9=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0xdf98[_0x2fd160];return _0x5c2031;};'use strict';var pdf=require(_0x8df9('0x0'));var emlformat=require(_0x8df9('0x1'));var rimraf=require(_0x8df9('0x2'));var zipdir=require(_0x8df9('0x3'));var jsonpatch=require(_0x8df9('0x4'));var rp=require('request-promise');var moment=require(_0x8df9('0x5'));var BPromise=require(_0x8df9('0x6'));var Mustache=require(_0x8df9('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8df9('0x8'));var csv=require('to-csv');var ejs=require(_0x8df9('0x9'));var fs=require('fs');var _=require(_0x8df9('0xa'));var squel=require('squel');var crypto=require(_0x8df9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8df9('0xc'));var toCsv=require(_0x8df9('0xd'));var querystring=require(_0x8df9('0xe'));var Papa=require(_0x8df9('0xf'));var Redis=require(_0x8df9('0x10'));var authService=require(_0x8df9('0x11'));var qs=require(_0x8df9('0x12'));var as=require(_0x8df9('0x13'));var hardwareService=require(_0x8df9('0x14'));var logger=require('../../config/logger')(_0x8df9('0x15'));var utils=require(_0x8df9('0x16'));var config=require('../../config/environment');var db=require(_0x8df9('0x17'))['db'];config['redis']=_[_0x8df9('0x18')](config[_0x8df9('0x19')],{'host':_0x8df9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8df9('0x19')]));require('./chatMessage.socket')[_0x8df9('0x1b')](socket);var jayson=require(_0x8df9('0x1c'));var client=jayson[_0x8df9('0x1d')][_0x8df9('0x1e')]({'port':0x232c});var client9002=jayson[_0x8df9('0x1d')][_0x8df9('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4135f7,_0x45206e,_0x441746){if(_0x441746){var _0x19585a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19585a[_0x8df9('0x1f')](_0x45206e)){return _0x4135f7;}else{throw new db[(_0x8df9('0x20'))][(_0x8df9('0x21'))]('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 _0x4135f7;}}function respondWithRpcPromise(_0x3747fb,_0x5ba1c1,_0x537895,_0x208f1d){return new BPromise(function(_0x1b4249,_0x5d05f7){var _0x6aac50=_0x208f1d||client;return _0x6aac50[_0x8df9('0x22')](_0x3747fb,_0x537895)['then'](function(_0x1d73e6){logger[_0x8df9('0x23')]('ChatMessage,\x20%s,\x20%s',_0x5ba1c1,'request\x20sent');logger[_0x8df9('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5ba1c1,_0x8df9('0x25'),JSON[_0x8df9('0x26')](_0x1d73e6));if(_0x1d73e6[_0x8df9('0x27')]){if(_0x1d73e6[_0x8df9('0x27')]['code']===0x1f4){logger[_0x8df9('0x27')](_0x8df9('0x28'),_0x5ba1c1,_0x1d73e6[_0x8df9('0x27')][_0x8df9('0x29')]);return _0x5d05f7(_0x1d73e6[_0x8df9('0x27')][_0x8df9('0x29')]);}logger[_0x8df9('0x27')](_0x8df9('0x28'),_0x5ba1c1,_0x1d73e6[_0x8df9('0x27')][_0x8df9('0x29')]);return _0x1b4249(_0x1d73e6[_0x8df9('0x27')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5ba1c1,_0x8df9('0x25'));_0x1b4249(_0x1d73e6[_0x8df9('0x2a')]['message']);}})[_0x8df9('0x2b')](function(_0x1b1e4){logger[_0x8df9('0x27')](_0x8df9('0x28'),_0x5ba1c1,_0x1b1e4);_0x5d05f7(_0x1b1e4);});});}function respondWithStatusCode(_0x47af1c,_0x33b288){_0x33b288=_0x33b288||0xcc;return function(_0x53c285){if(_0x53c285){return _0x47af1c[_0x8df9('0x2c')](_0x33b288);}return _0x47af1c['status'](_0x33b288)[_0x8df9('0x2d')]();};}function respondWithResult(_0x1e3cdd,_0x499715){_0x499715=_0x499715||0xc8;return function(_0x1e8602){if(_0x1e8602){return _0x1e3cdd['status'](_0x499715)[_0x8df9('0x2e')](_0x1e8602);}};}function respondWithFilteredResult(_0x521c0c,_0x32a964){return function(_0x17b9ac){if(_0x17b9ac){var _0x12467d=_0x17b9ac[_0x8df9('0x2f')],_0x57b8f4=_0x32a964[_0x8df9('0x30')],_0x3ee8b4=_0x32a964['offset']+_0x32a964[_0x8df9('0x31')],_0x49066d;if(_0x3ee8b4>=_0x12467d){_0x3ee8b4=_0x12467d;_0x49066d=0xc8;}else{_0x49066d=0xce;}_0x521c0c['status'](_0x49066d);return _0x521c0c['set'](_0x8df9('0x32'),_0x57b8f4+'-'+_0x3ee8b4+'/'+_0x12467d)['json'](_0x17b9ac);}return null;};}function patchUpdates(_0x46b607){return function(_0x2a0dfb){try{jsonpatch[_0x8df9('0x33')](_0x2a0dfb,_0x46b607,!![]);}catch(_0x1927ed){return BPromise[_0x8df9('0x34')](_0x1927ed);}return _0x2a0dfb['save']();};}function saveUpdates(_0x22e13c,_0x1cb8a1){return function(_0x39e451){if(_0x39e451){return _0x39e451[_0x8df9('0x35')](_0x22e13c)['then'](function(_0x3935a1){return _0x3935a1;});}return null;};}function removeEntity(_0x1ddf1a,_0xd81f8d){return function(_0x53993b){if(_0x53993b){return _0x53993b[_0x8df9('0x36')]()['then'](function(){_0x1ddf1a[_0x8df9('0x37')](0xcc)[_0x8df9('0x2d')]();});}};}function handleEntityNotFound(_0x1a4796,_0x887779){return function(_0x6842b6){if(!_0x6842b6){_0x1a4796[_0x8df9('0x2c')](0x194);}return _0x6842b6;};}function handleError(_0x28b09b,_0x429c1f){_0x429c1f=_0x429c1f||0x1f4;return function(_0x1bc223){logger[_0x8df9('0x27')](_0x1bc223[_0x8df9('0x38')]);if(_0x1bc223['name']){delete _0x1bc223[_0x8df9('0x39')];}_0x28b09b['status'](_0x429c1f)['send'](_0x1bc223);};}exports[_0x8df9('0x3a')]=function(_0xb4ef6c,_0x3de019){var _0x126d1f={},_0x4d4088={},_0x566305={'count':0x0,'rows':[]};var _0x4c2b92=_[_0x8df9('0x3b')](db[_0x8df9('0x3c')]['rawAttributes'],function(_0x98094b){return{'name':_0x98094b[_0x8df9('0x3d')],'type':_0x98094b['type']['key']};});_0x4d4088['model']=_[_0x8df9('0x3b')](_0x4c2b92,_0x8df9('0x39'));_0x4d4088[_0x8df9('0x3e')]=_[_0x8df9('0x3f')](_0xb4ef6c[_0x8df9('0x3e')]);_0x4d4088[_0x8df9('0x40')]=_[_0x8df9('0x41')](_0x4d4088['model'],_0x4d4088[_0x8df9('0x3e')]);_0x126d1f['attributes']=_[_0x8df9('0x41')](_0x4d4088[_0x8df9('0x42')],qs['fields'](_0xb4ef6c[_0x8df9('0x3e')][_0x8df9('0x43')]));_0x126d1f[_0x8df9('0x44')]=_0x126d1f['attributes'][_0x8df9('0x45')]?_0x126d1f['attributes']:_0x4d4088['model'];if(!_0xb4ef6c[_0x8df9('0x3e')]['hasOwnProperty'](_0x8df9('0x46'))){_0x126d1f[_0x8df9('0x31')]=qs[_0x8df9('0x31')](_0xb4ef6c['query'][_0x8df9('0x31')]);_0x126d1f[_0x8df9('0x30')]=qs[_0x8df9('0x30')](_0xb4ef6c[_0x8df9('0x3e')][_0x8df9('0x30')]);}_0x126d1f['order']=qs[_0x8df9('0x47')](_0xb4ef6c[_0x8df9('0x3e')][_0x8df9('0x47')]);_0x126d1f[_0x8df9('0x48')]=qs[_0x8df9('0x40')](_[_0x8df9('0x49')](_0xb4ef6c[_0x8df9('0x3e')],_0x4d4088[_0x8df9('0x40')]));if(_0xb4ef6c['query'][_0x8df9('0x4a')]){_0x126d1f[_0x8df9('0x48')]=_[_0x8df9('0x4b')](_0x126d1f[_0x8df9('0x48')],{'$or':_[_0x8df9('0x3b')](_0x4c2b92,function(_0x3c3246){if(_0x3c3246[_0x8df9('0x4c')]!=='VIRTUAL'){var _0x568394={};_0x568394[_0x3c3246[_0x8df9('0x39')]]={'$like':'%'+_0xb4ef6c['query'][_0x8df9('0x4a')]+'%'};return _0x568394;}})});}_0x126d1f=_[_0x8df9('0x4b')]({},_0x126d1f,_0xb4ef6c[_0x8df9('0x4d')]);var _0x13292e={'where':_0x126d1f[_0x8df9('0x48')]};return db[_0x8df9('0x3c')][_0x8df9('0x2f')](_0x13292e)[_0x8df9('0x4e')](function(_0x29854e){_0x566305[_0x8df9('0x2f')]=_0x29854e;if(_0xb4ef6c[_0x8df9('0x3e')]['includeAll']){_0x126d1f[_0x8df9('0x4f')]=[{'all':!![]}];}return db['ChatMessage'][_0x8df9('0x50')](_0x126d1f);})[_0x8df9('0x4e')](function(_0x216079){_0x566305[_0x8df9('0x51')]=_0x216079;return _0x566305;})['then'](respondWithFilteredResult(_0x3de019,_0x126d1f))[_0x8df9('0x2b')](handleError(_0x3de019,null));};exports[_0x8df9('0x52')]=function(_0x56ce55,_0x27b4ff){var _0x521d90={'raw':!![],'where':{'id':_0x56ce55[_0x8df9('0x53')]['id']}},_0x42bc1d={};_0x42bc1d[_0x8df9('0x42')]=_[_0x8df9('0x3f')](db[_0x8df9('0x3c')][_0x8df9('0x54')]);_0x42bc1d['query']=_[_0x8df9('0x3f')](_0x56ce55['query']);_0x42bc1d[_0x8df9('0x40')]=_['intersection'](_0x42bc1d['model'],_0x42bc1d[_0x8df9('0x3e')]);_0x521d90['attributes']=_[_0x8df9('0x41')](_0x42bc1d[_0x8df9('0x42')],qs[_0x8df9('0x43')](_0x56ce55[_0x8df9('0x3e')][_0x8df9('0x43')]));_0x521d90[_0x8df9('0x44')]=_0x521d90[_0x8df9('0x44')][_0x8df9('0x45')]?_0x521d90['attributes']:_0x42bc1d[_0x8df9('0x42')];if(_0x56ce55[_0x8df9('0x3e')][_0x8df9('0x55')]){_0x521d90[_0x8df9('0x4f')]=[{'all':!![]}];}_0x521d90=_[_0x8df9('0x4b')]({},_0x521d90,_0x56ce55['options']);return db[_0x8df9('0x3c')]['find'](_0x521d90)[_0x8df9('0x4e')](handleEntityNotFound(_0x27b4ff,null))[_0x8df9('0x4e')](respondWithResult(_0x27b4ff,null))[_0x8df9('0x2b')](handleError(_0x27b4ff,null));};exports[_0x8df9('0x56')]=function(_0x21cc2e,_0x3e2d0b){return db[_0x8df9('0x3c')][_0x8df9('0x56')](_0x21cc2e['body'],{})[_0x8df9('0x4e')](respondWithResult(_0x3e2d0b,0xc9))[_0x8df9('0x2b')](handleError(_0x3e2d0b,null));};exports[_0x8df9('0x35')]=function(_0x5a4e6e,_0x1ea915){if(_0x5a4e6e[_0x8df9('0x57')]['id']){delete _0x5a4e6e[_0x8df9('0x57')]['id'];}return db[_0x8df9('0x3c')][_0x8df9('0x58')]({'where':{'id':_0x5a4e6e[_0x8df9('0x53')]['id']}})[_0x8df9('0x4e')](handleEntityNotFound(_0x1ea915,null))[_0x8df9('0x4e')](saveUpdates(_0x5a4e6e[_0x8df9('0x57')],null))[_0x8df9('0x4e')](respondWithResult(_0x1ea915,null))[_0x8df9('0x2b')](handleError(_0x1ea915,null));};exports['destroy']=function(_0x208fd9,_0x5182a6){return db[_0x8df9('0x3c')][_0x8df9('0x58')]({'where':{'id':_0x208fd9['params']['id']}})[_0x8df9('0x4e')](handleEntityNotFound(_0x5182a6,null))[_0x8df9('0x4e')](removeEntity(_0x5182a6,null))['catch'](handleError(_0x5182a6,null));};exports['describe']=function(_0x55503a,_0x555688){return db[_0x8df9('0x3c')]['describe']()[_0x8df9('0x4e')](respondWithResult(_0x555688,null))[_0x8df9('0x2b')](handleError(_0x555688,null));};var interaction_log=require(_0x8df9('0x59'))(_0x8df9('0x5a'));exports[_0x8df9('0x5b')]=function(_0x1747d5,_0x325c96,_0x23dd45){var _0x5768b4={'channel':_0x8df9('0x5c')};if(_0x1747d5[_0x8df9('0x57')]['id']){delete _0x1747d5['body']['id'];}_0x1747d5[_0x8df9('0x57')][_0x8df9('0x5d')]=!![];_0x1747d5['body'][_0x8df9('0x5e')]=moment()[_0x8df9('0x5f')](_0x8df9('0x60'));_0x1747d5[_0x8df9('0x57')][_0x8df9('0x61')]=_0x1747d5[_0x8df9('0x57')][_0x8df9('0x61')]||_0x1747d5[_0x8df9('0x62')]['id'];return db[_0x8df9('0x3c')][_0x8df9('0x58')]({'where':{'id':_0x1747d5[_0x8df9('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x8df9('0x63')],'as':_0x8df9('0x64')}]})['then'](handleEntityNotFound(_0x325c96,null))[_0x8df9('0x4e')](saveUpdates(_0x1747d5['body'],null))[_0x8df9('0x4e')](function(_0x19841d){if(_0x19841d){_0x5768b4[_0x8df9('0x29')]=_0x19841d[_0x8df9('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x8df9('0x58')]({'where':{'id':_0x19841d[_0x8df9('0x66')]}});}return null;})[_0x8df9('0x4e')](handleEntityNotFound(_0x325c96,null))['then'](function(_0x2c0f65){if(_0x2c0f65){return _0x2c0f65['update']({'UserId':_0x1747d5[_0x8df9('0x57')][_0x8df9('0x61')],'read1stAt':_[_0x8df9('0x67')](_0x2c0f65[_0x8df9('0x68')])?moment()[_0x8df9('0x5f')](_0x8df9('0x60')):undefined});}return null;})[_0x8df9('0x4e')](function(_0x776463){if(_0x776463){_0x5768b4[_0x8df9('0x69')]=_0x776463['get']({'plain':!![]});interaction_log[_0x8df9('0x23')](_0x8df9('0x6a'),_0x1747d5['user']['id'],_0x1747d5[_0x8df9('0x62')]['name'],_0x1747d5['user'][_0x8df9('0x6b')],_0x5768b4[_0x8df9('0x69')]['id'],_0x1747d5[_0x8df9('0x57')]?JSON['stringify'](_0x1747d5[_0x8df9('0x57')]):_0x8df9('0x6c'));return respondWithRpcPromise(_0x8df9('0x6d'),_0x8df9('0x6e'),_0x5768b4);}return null;})['then'](function(_0x462967){if(_0x462967){if(_0x1747d5['body'][_0x8df9('0x6f')]){_0x5768b4[_0x8df9('0x29')][_0x8df9('0x70')]=util['format']('SIP/%s',_0x1747d5['user'][_0x8df9('0x39')]);_0x5768b4[_0x8df9('0x29')]['channel']=_0x5768b4['channel'];_0x5768b4['message']['event']=_0x8df9('0x5b');return respondWithRpcPromise(_0x8df9('0x71'),_0x8df9('0x71'),{'event':_0x8df9('0x72'),'message':_['merge'](_0x5768b4[_0x8df9('0x29')],JSON[_0x8df9('0x73')](_0x5768b4[_0x8df9('0x69')][_0x8df9('0x74')]))},client9002)['then'](function(){return _0x5768b4;});}return _0x5768b4;}return null;})[_0x8df9('0x4e')](respondWithResult(_0x325c96,null))[_0x8df9('0x2b')](handleError(_0x325c96,null));};var interaction_log=require(_0x8df9('0x59'))(_0x8df9('0x5a'));exports[_0x8df9('0x34')]=function(_0x1af4c3,_0x18136c,_0x2a77ae){var _0x155593={'agent':{},'channel':_0x8df9('0x5c')};if(_0x1af4c3[_0x8df9('0x57')]['id']){delete _0x1af4c3[_0x8df9('0x57')]['id'];}_0x1af4c3['body'][_0x8df9('0x61')]=_0x1af4c3[_0x8df9('0x57')]['UserId']||_0x1af4c3[_0x8df9('0x62')]['id'];_0x155593[_0x8df9('0x75')]['id']=_0x1af4c3[_0x8df9('0x57')][_0x8df9('0x61')];return db[_0x8df9('0x3c')][_0x8df9('0x58')]({'where':{'id':_0x1af4c3['params']['id'],'UserId':null}})[_0x8df9('0x4e')](handleEntityNotFound(_0x18136c,null))[_0x8df9('0x4e')](function(_0x50b59c){if(_0x50b59c){_0x155593[_0x8df9('0x29')]=_0x50b59c[_0x8df9('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x8df9('0x58')]({'where':{'id':_0x50b59c[_0x8df9('0x66')]}});}return null;})[_0x8df9('0x4e')](handleEntityNotFound(_0x18136c,null))['then'](function(_0x209100){if(_0x209100){_0x155593[_0x8df9('0x69')]=_0x209100['get']({'plain':!![]});interaction_log[_0x8df9('0x23')](_0x8df9('0x76'),_0x1af4c3[_0x8df9('0x62')]['id'],_0x1af4c3[_0x8df9('0x62')]['name'],_0x1af4c3[_0x8df9('0x62')]['role'],_0x155593[_0x8df9('0x69')]['id'],_0x1af4c3[_0x8df9('0x57')]?JSON[_0x8df9('0x26')](_0x1af4c3[_0x8df9('0x57')]):_0x8df9('0x6c'));return respondWithRpcPromise('RejectMessage',_0x8df9('0x77'),_0x155593);}return null;})[_0x8df9('0x4e')](function(_0x3697f6){if(_0x3697f6){_0x3697f6[_0x8df9('0x29')][_0x8df9('0x70')]=util[_0x8df9('0x5f')](_0x8df9('0x78'),_0x1af4c3[_0x8df9('0x62')][_0x8df9('0x39')]);_0x3697f6[_0x8df9('0x29')]['channel']=_0x155593[_0x8df9('0x79')];_0x3697f6[_0x8df9('0x29')]['event']=_0x8df9('0x34');respondWithRpcPromise(_0x8df9('0x71'),_0x8df9('0x71'),{'event':_0x8df9('0x7a'),'message':_0x3697f6[_0x8df9('0x29')]},client9002);return _0x155593;}return null;})[_0x8df9('0x4e')](respondWithResult(_0x18136c,null))[_0x8df9('0x2b')](handleError(_0x18136c,null));}; \ No newline at end of file +var _0xf007=['bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','filters','intersection','query','attributes','model','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','show','params','keys','length','find','create','body','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','parse','formData','agent','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SIP/%s','rejectmessage','eml-format','rimraf','request-promise','moment'];(function(_0x2ef95a,_0x4a080d){var _0x1e99ac=function(_0x320996){while(--_0x320996){_0x2ef95a['push'](_0x2ef95a['shift']());}};_0x1e99ac(++_0x4a080d);}(_0xf007,0x79));var _0x7f00=function(_0x3ad1aa,_0x1e5418){_0x3ad1aa=_0x3ad1aa-0x0;var _0x535c08=_0xf007[_0x3ad1aa];return _0x535c08;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7f00('0x0'));var rimraf=require(_0x7f00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f00('0x2'));var moment=require(_0x7f00('0x3'));var BPromise=require(_0x7f00('0x4'));var Mustache=require('mustache');var util=require(_0x7f00('0x5'));var path=require(_0x7f00('0x6'));var sox=require('sox');var csv=require(_0x7f00('0x7'));var ejs=require(_0x7f00('0x8'));var fs=require('fs');var _=require(_0x7f00('0x9'));var squel=require(_0x7f00('0xa'));var crypto=require('crypto');var jsforce=require(_0x7f00('0xb'));var deskjs=require(_0x7f00('0xc'));var toCsv=require(_0x7f00('0x7'));var querystring=require(_0x7f00('0xd'));var Papa=require(_0x7f00('0xe'));var Redis=require(_0x7f00('0xf'));var authService=require(_0x7f00('0x10'));var qs=require(_0x7f00('0x11'));var as=require(_0x7f00('0x12'));var hardwareService=require(_0x7f00('0x13'));var logger=require(_0x7f00('0x14'))('api');var utils=require(_0x7f00('0x15'));var config=require(_0x7f00('0x16'));var db=require('../../mysqldb')['db'];config[_0x7f00('0x17')]=_[_0x7f00('0x18')](config[_0x7f00('0x17')],{'host':_0x7f00('0x19'),'port':0x18eb});var socket=require(_0x7f00('0x1a'))(new Redis(config[_0x7f00('0x17')]));require(_0x7f00('0x1b'))[_0x7f00('0x1c')](socket);var jayson=require(_0x7f00('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x7f00('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x40577d,_0x745a77,_0x25e43b){if(_0x25e43b){var _0x1e6a0e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e6a0e[_0x7f00('0x1f')](_0x745a77)){return _0x40577d;}else{throw new db[(_0x7f00('0x20'))][(_0x7f00('0x21'))](_0x7f00('0x22'));}}else{return _0x40577d;}}function respondWithRpcPromise(_0x371b05,_0x47f867,_0x510d90,_0x169e7c){return new BPromise(function(_0x144d4e,_0x2b37bf){var _0x935dcb=_0x169e7c||client;return _0x935dcb[_0x7f00('0x23')](_0x371b05,_0x510d90)[_0x7f00('0x24')](function(_0x163ea8){logger[_0x7f00('0x25')](_0x7f00('0x26'),_0x47f867,_0x7f00('0x27'));logger[_0x7f00('0x28')](_0x7f00('0x29'),_0x47f867,_0x7f00('0x27'),JSON[_0x7f00('0x2a')](_0x163ea8));if(_0x163ea8[_0x7f00('0x2b')]){if(_0x163ea8[_0x7f00('0x2b')][_0x7f00('0x2c')]===0x1f4){logger[_0x7f00('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x47f867,_0x163ea8['error'][_0x7f00('0x2d')]);return _0x2b37bf(_0x163ea8[_0x7f00('0x2b')]['message']);}logger[_0x7f00('0x2b')](_0x7f00('0x26'),_0x47f867,_0x163ea8[_0x7f00('0x2b')][_0x7f00('0x2d')]);return _0x144d4e(_0x163ea8['error']['message']);}else{logger['info'](_0x7f00('0x26'),_0x47f867,_0x7f00('0x27'));_0x144d4e(_0x163ea8[_0x7f00('0x2e')][_0x7f00('0x2d')]);}})[_0x7f00('0x2f')](function(_0x4dc41c){logger['error'](_0x7f00('0x26'),_0x47f867,_0x4dc41c);_0x2b37bf(_0x4dc41c);});});}function respondWithStatusCode(_0x14c98a,_0x45bc23){_0x45bc23=_0x45bc23||0xcc;return function(_0x3f71e4){if(_0x3f71e4){return _0x14c98a[_0x7f00('0x30')](_0x45bc23);}return _0x14c98a[_0x7f00('0x31')](_0x45bc23)[_0x7f00('0x32')]();};}function respondWithResult(_0x36cb3f,_0x108a59){_0x108a59=_0x108a59||0xc8;return function(_0x1e8189){if(_0x1e8189){return _0x36cb3f[_0x7f00('0x31')](_0x108a59)[_0x7f00('0x33')](_0x1e8189);}};}function respondWithFilteredResult(_0x19559d,_0x424774){return function(_0x494fee){if(_0x494fee){var _0x43f87d=_0x494fee[_0x7f00('0x34')],_0xe49f01=_0x424774[_0x7f00('0x35')],_0x1a28f7=_0x424774[_0x7f00('0x35')]+_0x424774[_0x7f00('0x36')],_0xa167c9;if(_0x1a28f7>=_0x43f87d){_0x1a28f7=_0x43f87d;_0xa167c9=0xc8;}else{_0xa167c9=0xce;}_0x19559d[_0x7f00('0x31')](_0xa167c9);return _0x19559d[_0x7f00('0x37')](_0x7f00('0x38'),_0xe49f01+'-'+_0x1a28f7+'/'+_0x43f87d)[_0x7f00('0x33')](_0x494fee);}return null;};}function patchUpdates(_0x729269){return function(_0x1dd530){try{jsonpatch[_0x7f00('0x39')](_0x1dd530,_0x729269,!![]);}catch(_0x5d0cbb){return BPromise[_0x7f00('0x3a')](_0x5d0cbb);}return _0x1dd530[_0x7f00('0x3b')]();};}function saveUpdates(_0xaee898,_0x1c78fd){return function(_0x321363){if(_0x321363){return _0x321363[_0x7f00('0x3c')](_0xaee898)['then'](function(_0x3e8bf4){return _0x3e8bf4;});}return null;};}function removeEntity(_0x2daabb,_0x43f91a){return function(_0x11e285){if(_0x11e285){return _0x11e285[_0x7f00('0x3d')]()[_0x7f00('0x24')](function(){_0x2daabb[_0x7f00('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd8b3,_0x324475){return function(_0x5ed193){if(!_0x5ed193){_0x1bd8b3[_0x7f00('0x30')](0x194);}return _0x5ed193;};}function handleError(_0x429393,_0x4c495b){_0x4c495b=_0x4c495b||0x1f4;return function(_0x33d2d9){logger[_0x7f00('0x2b')](_0x33d2d9[_0x7f00('0x3e')]);if(_0x33d2d9[_0x7f00('0x3f')]){delete _0x33d2d9['name'];}_0x429393[_0x7f00('0x31')](_0x4c495b)[_0x7f00('0x40')](_0x33d2d9);};}exports[_0x7f00('0x41')]=function(_0x7c9bfe,_0x52b074){var _0x531771={},_0x4c822d={},_0x2d4754={'count':0x0,'rows':[]};var _0x330852=_[_0x7f00('0x42')](db[_0x7f00('0x43')][_0x7f00('0x44')],function(_0x1d45ab){return{'name':_0x1d45ab['fieldName'],'type':_0x1d45ab[_0x7f00('0x45')]['key']};});_0x4c822d['model']=_['map'](_0x330852,_0x7f00('0x3f'));_0x4c822d['query']=_['keys'](_0x7c9bfe['query']);_0x4c822d[_0x7f00('0x46')]=_[_0x7f00('0x47')](_0x4c822d['model'],_0x4c822d[_0x7f00('0x48')]);_0x531771[_0x7f00('0x49')]=_[_0x7f00('0x47')](_0x4c822d[_0x7f00('0x4a')],qs['fields'](_0x7c9bfe['query'][_0x7f00('0x4b')]));_0x531771[_0x7f00('0x49')]=_0x531771[_0x7f00('0x49')]['length']?_0x531771['attributes']:_0x4c822d[_0x7f00('0x4a')];if(!_0x7c9bfe[_0x7f00('0x48')][_0x7f00('0x4c')]('nolimit')){_0x531771[_0x7f00('0x36')]=qs['limit'](_0x7c9bfe[_0x7f00('0x48')]['limit']);_0x531771[_0x7f00('0x35')]=qs[_0x7f00('0x35')](_0x7c9bfe[_0x7f00('0x48')][_0x7f00('0x35')]);}_0x531771['order']=qs[_0x7f00('0x4d')](_0x7c9bfe[_0x7f00('0x48')]['sort']);_0x531771[_0x7f00('0x4e')]=qs[_0x7f00('0x46')](_[_0x7f00('0x4f')](_0x7c9bfe['query'],_0x4c822d[_0x7f00('0x46')]));if(_0x7c9bfe[_0x7f00('0x48')][_0x7f00('0x50')]){_0x531771[_0x7f00('0x4e')]=_[_0x7f00('0x51')](_0x531771[_0x7f00('0x4e')],{'$or':_[_0x7f00('0x42')](_0x330852,function(_0x34073f){if(_0x34073f[_0x7f00('0x45')]!=='VIRTUAL'){var _0x5924c9={};_0x5924c9[_0x34073f[_0x7f00('0x3f')]]={'$like':'%'+_0x7c9bfe['query'][_0x7f00('0x50')]+'%'};return _0x5924c9;}})});}_0x531771=_[_0x7f00('0x51')]({},_0x531771,_0x7c9bfe[_0x7f00('0x52')]);var _0xe53c4d={'where':_0x531771[_0x7f00('0x4e')]};return db[_0x7f00('0x43')][_0x7f00('0x34')](_0xe53c4d)[_0x7f00('0x24')](function(_0x308d4c){_0x2d4754['count']=_0x308d4c;if(_0x7c9bfe[_0x7f00('0x48')][_0x7f00('0x53')]){_0x531771[_0x7f00('0x54')]=[{'all':!![]}];}return db[_0x7f00('0x43')]['findAll'](_0x531771);})[_0x7f00('0x24')](function(_0x3270db){_0x2d4754['rows']=_0x3270db;return _0x2d4754;})[_0x7f00('0x24')](respondWithFilteredResult(_0x52b074,_0x531771))[_0x7f00('0x2f')](handleError(_0x52b074,null));};exports[_0x7f00('0x55')]=function(_0x1de3ed,_0x55020d){var _0x1255c5={'raw':!![],'where':{'id':_0x1de3ed[_0x7f00('0x56')]['id']}},_0x3ccfe6={};_0x3ccfe6[_0x7f00('0x4a')]=_[_0x7f00('0x57')](db[_0x7f00('0x43')]['rawAttributes']);_0x3ccfe6[_0x7f00('0x48')]=_['keys'](_0x1de3ed[_0x7f00('0x48')]);_0x3ccfe6['filters']=_[_0x7f00('0x47')](_0x3ccfe6[_0x7f00('0x4a')],_0x3ccfe6[_0x7f00('0x48')]);_0x1255c5[_0x7f00('0x49')]=_[_0x7f00('0x47')](_0x3ccfe6['model'],qs[_0x7f00('0x4b')](_0x1de3ed[_0x7f00('0x48')]['fields']));_0x1255c5['attributes']=_0x1255c5['attributes'][_0x7f00('0x58')]?_0x1255c5[_0x7f00('0x49')]:_0x3ccfe6[_0x7f00('0x4a')];if(_0x1de3ed[_0x7f00('0x48')]['includeAll']){_0x1255c5[_0x7f00('0x54')]=[{'all':!![]}];}_0x1255c5=_[_0x7f00('0x51')]({},_0x1255c5,_0x1de3ed[_0x7f00('0x52')]);return db[_0x7f00('0x43')][_0x7f00('0x59')](_0x1255c5)['then'](handleEntityNotFound(_0x55020d,null))['then'](respondWithResult(_0x55020d,null))['catch'](handleError(_0x55020d,null));};exports[_0x7f00('0x5a')]=function(_0x224cc0,_0x5c4bff){return db[_0x7f00('0x43')][_0x7f00('0x5a')](_0x224cc0[_0x7f00('0x5b')],{})[_0x7f00('0x24')](respondWithResult(_0x5c4bff,0xc9))['catch'](handleError(_0x5c4bff,null));};exports[_0x7f00('0x3c')]=function(_0x17fa0b,_0x212b92){if(_0x17fa0b[_0x7f00('0x5b')]['id']){delete _0x17fa0b['body']['id'];}return db[_0x7f00('0x43')][_0x7f00('0x59')]({'where':{'id':_0x17fa0b[_0x7f00('0x56')]['id']}})[_0x7f00('0x24')](handleEntityNotFound(_0x212b92,null))[_0x7f00('0x24')](saveUpdates(_0x17fa0b[_0x7f00('0x5b')],null))['then'](respondWithResult(_0x212b92,null))[_0x7f00('0x2f')](handleError(_0x212b92,null));};exports[_0x7f00('0x3d')]=function(_0x3e2a29,_0x4fa720){return db[_0x7f00('0x43')][_0x7f00('0x59')]({'where':{'id':_0x3e2a29[_0x7f00('0x56')]['id']}})['then'](handleEntityNotFound(_0x4fa720,null))[_0x7f00('0x24')](removeEntity(_0x4fa720,null))[_0x7f00('0x2f')](handleError(_0x4fa720,null));};exports[_0x7f00('0x5c')]=function(_0x16a5db,_0x563a7c){return db[_0x7f00('0x43')]['describe']()[_0x7f00('0x24')](respondWithResult(_0x563a7c,null))[_0x7f00('0x2f')](handleError(_0x563a7c,null));};var interaction_log=require(_0x7f00('0x14'))('chat-interactions');exports[_0x7f00('0x5d')]=function(_0x3c880a,_0x492e03,_0x24c8b3){var _0xb2274e={'channel':_0x7f00('0x5e')};if(_0x3c880a[_0x7f00('0x5b')]['id']){delete _0x3c880a['body']['id'];}_0x3c880a[_0x7f00('0x5b')][_0x7f00('0x5f')]=!![];_0x3c880a['body']['readAt']=moment()[_0x7f00('0x60')](_0x7f00('0x61'));_0x3c880a[_0x7f00('0x5b')][_0x7f00('0x62')]=_0x3c880a['body'][_0x7f00('0x62')]||_0x3c880a[_0x7f00('0x63')]['id'];return db[_0x7f00('0x43')][_0x7f00('0x59')]({'where':{'id':_0x3c880a[_0x7f00('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x7f00('0x64')],'as':_0x7f00('0x65')}]})[_0x7f00('0x24')](handleEntityNotFound(_0x492e03,null))[_0x7f00('0x24')](saveUpdates(_0x3c880a['body'],null))[_0x7f00('0x24')](function(_0x3155e2){if(_0x3155e2){_0xb2274e[_0x7f00('0x2d')]=_0x3155e2['get']({'plain':!![]});return db[_0x7f00('0x66')][_0x7f00('0x59')]({'where':{'id':_0x3155e2[_0x7f00('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x492e03,null))[_0x7f00('0x24')](function(_0x50680a){if(_0x50680a){return _0x50680a[_0x7f00('0x3c')]({'UserId':_0x3c880a[_0x7f00('0x5b')][_0x7f00('0x62')],'read1stAt':_[_0x7f00('0x68')](_0x50680a['read1stAt'])?moment()[_0x7f00('0x60')](_0x7f00('0x61')):undefined});}return null;})[_0x7f00('0x24')](function(_0x2e87f1){if(_0x2e87f1){_0xb2274e[_0x7f00('0x69')]=_0x2e87f1['get']({'plain':!![]});interaction_log['info'](_0x7f00('0x6a'),_0x3c880a['user']['id'],_0x3c880a[_0x7f00('0x63')][_0x7f00('0x3f')],_0x3c880a[_0x7f00('0x63')]['role'],_0xb2274e['interaction']['id'],_0x3c880a['body']?JSON[_0x7f00('0x2a')](_0x3c880a[_0x7f00('0x5b')]):_0x7f00('0x6b'));return respondWithRpcPromise(_0x7f00('0x6c'),_0x7f00('0x6d'),_0xb2274e);}return null;})[_0x7f00('0x24')](function(_0x5de100){if(_0x5de100){if(_0x3c880a[_0x7f00('0x5b')][_0x7f00('0x6e')]){_0xb2274e[_0x7f00('0x2d')][_0x7f00('0x6f')]=util[_0x7f00('0x60')]('SIP/%s',_0x3c880a[_0x7f00('0x63')][_0x7f00('0x3f')]);_0xb2274e[_0x7f00('0x2d')][_0x7f00('0x70')]=_0xb2274e[_0x7f00('0x70')];_0xb2274e[_0x7f00('0x2d')][_0x7f00('0x71')]=_0x7f00('0x5d');return respondWithRpcPromise(_0x7f00('0x72'),_0x7f00('0x72'),{'event':_0x7f00('0x73'),'message':_['merge'](_0xb2274e[_0x7f00('0x2d')],JSON[_0x7f00('0x74')](_0xb2274e[_0x7f00('0x69')][_0x7f00('0x75')]))},client9002)[_0x7f00('0x24')](function(){return _0xb2274e;});}return _0xb2274e;}return null;})[_0x7f00('0x24')](respondWithResult(_0x492e03,null))[_0x7f00('0x2f')](handleError(_0x492e03,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x7f00('0x3a')]=function(_0x3bc760,_0x5f477f,_0x14d1ae){var _0x4f417={'agent':{},'channel':_0x7f00('0x5e')};if(_0x3bc760[_0x7f00('0x5b')]['id']){delete _0x3bc760[_0x7f00('0x5b')]['id'];}_0x3bc760['body'][_0x7f00('0x62')]=_0x3bc760[_0x7f00('0x5b')][_0x7f00('0x62')]||_0x3bc760[_0x7f00('0x63')]['id'];_0x4f417[_0x7f00('0x76')]['id']=_0x3bc760[_0x7f00('0x5b')][_0x7f00('0x62')];return db[_0x7f00('0x43')][_0x7f00('0x59')]({'where':{'id':_0x3bc760[_0x7f00('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5f477f,null))[_0x7f00('0x24')](function(_0x5eab79){if(_0x5eab79){_0x4f417[_0x7f00('0x2d')]=_0x5eab79['get']({'plain':!![]});return db['ChatInteraction'][_0x7f00('0x59')]({'where':{'id':_0x5eab79[_0x7f00('0x67')]}});}return null;})[_0x7f00('0x24')](handleEntityNotFound(_0x5f477f,null))[_0x7f00('0x24')](function(_0x546ea5){if(_0x546ea5){_0x4f417[_0x7f00('0x69')]=_0x546ea5[_0x7f00('0x77')]({'plain':!![]});interaction_log['info'](_0x7f00('0x78'),_0x3bc760[_0x7f00('0x63')]['id'],_0x3bc760[_0x7f00('0x63')][_0x7f00('0x3f')],_0x3bc760[_0x7f00('0x63')][_0x7f00('0x79')],_0x4f417['interaction']['id'],_0x3bc760['body']?JSON[_0x7f00('0x2a')](_0x3bc760[_0x7f00('0x5b')]):'null');return respondWithRpcPromise('RejectMessage',_0x7f00('0x7a'),_0x4f417);}return null;})[_0x7f00('0x24')](function(_0x5b6214){if(_0x5b6214){_0x5b6214[_0x7f00('0x2d')]['interface']=util[_0x7f00('0x60')](_0x7f00('0x7b'),_0x3bc760[_0x7f00('0x63')]['name']);_0x5b6214[_0x7f00('0x2d')][_0x7f00('0x70')]=_0x4f417[_0x7f00('0x70')];_0x5b6214[_0x7f00('0x2d')][_0x7f00('0x71')]=_0x7f00('0x3a');respondWithRpcPromise(_0x7f00('0x72'),_0x7f00('0x72'),{'event':_0x7f00('0x7c'),'message':_0x5b6214[_0x7f00('0x2d')]},client9002);return _0x4f417;}return null;})['then'](respondWithResult(_0x5f477f,null))[_0x7f00('0x2f')](handleError(_0x5f477f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 81b98c3..e04a41b 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 _0xa27c=['exports','events','../../mysqldb','setMaxListeners','emit','hook'];(function(_0x25bf42,_0x210398){var _0x3496d3=function(_0xf12fe3){while(--_0xf12fe3){_0x25bf42['push'](_0x25bf42['shift']());}};_0x3496d3(++_0x210398);}(_0xa27c,0xfd));var _0xca27=function(_0x23cb0a,_0x4fe1c0){_0x23cb0a=_0x23cb0a-0x0;var _0x76009a=_0xa27c[_0x23cb0a];return _0x76009a;};'use strict';var EventEmitter=require(_0xca27('0x0'));var ChatMessage=require(_0xca27('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xca27('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44452b){return function(_0x399ed3,_0x3f973c,_0x1771dc){ChatMessageEvents[_0xca27('0x3')](_0x44452b+':'+_0x399ed3['id'],_0x399ed3);ChatMessageEvents[_0xca27('0x3')](_0x44452b,_0x399ed3);_0x1771dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xca27('0x4')](e,emitEvent(event));}}module[_0xca27('0x5')]=ChatMessageEvents; \ No newline at end of file +var _0xaf87=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x59f9bc,_0x5ab447){var _0x165136=function(_0xfc7a9e){while(--_0xfc7a9e){_0x59f9bc['push'](_0x59f9bc['shift']());}};_0x165136(++_0x5ab447);}(_0xaf87,0x150));var _0x7af8=function(_0x5211c9,_0x4e65e3){_0x5211c9=_0x5211c9-0x0;var _0x48f6bb=_0xaf87[_0x5211c9];return _0x48f6bb;};'use strict';var EventEmitter=require(_0x7af8('0x0'));var ChatMessage=require(_0x7af8('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7af8('0x2')](0x0);var events={'afterCreate':_0x7af8('0x3'),'afterUpdate':_0x7af8('0x4'),'afterDestroy':_0x7af8('0x5')};function emitEvent(_0x25157d){return function(_0x46f1d7,_0xbf1ab,_0x1334ea){ChatMessageEvents[_0x7af8('0x6')](_0x25157d+':'+_0x46f1d7['id'],_0x46f1d7);ChatMessageEvents['emit'](_0x25157d,_0x46f1d7);_0x1334ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7af8('0x7')](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 0ebda55..d81e68b 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 _0x7f0a=['update','createdAt','catch','error','utf8mb4_unicode_ci','util','moment','request-promise','path','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then'];(function(_0x258e65,_0x4d35ab){var _0x2a0a6b=function(_0x4a8a6e){while(--_0x4a8a6e){_0x258e65['push'](_0x258e65['shift']());}};_0x2a0a6b(++_0x4d35ab);}(_0x7f0a,0xc9));var _0xa7f0=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7f0a[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require(_0xa7f0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa7f0('0x1'));var BPromise=require('bluebird');var rp=require(_0xa7f0('0x2'));var fs=require('fs');var path=require(_0xa7f0('0x3'));var rimraf=require(_0xa7f0('0x4'));var config=require(_0xa7f0('0x5'));var attributes=require('./chatMessage.attributes');module[_0xa7f0('0x6')]=function(_0x5a979a,_0x36c36c){return _0x5a979a[_0xa7f0('0x7')]('ChatMessage',attributes,{'tableName':_0xa7f0('0x8'),'paranoid':![],'indexes':[{'name':_0xa7f0('0x9'),'fields':[_0xa7f0('0xa')],'type':_0xa7f0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x185a9e,_0x3d62f4,_0x3499db){var _0x2e917a=_0x5a979a[_0xa7f0('0xc')];var _0x2e0bfb=_0x185a9e[_0xa7f0('0xd')]({'plain':!![]});if(_0x2e0bfb[_0xa7f0('0xe')][_0xa7f0('0xf')]()==='in'||_0x2e0bfb['direction'][_0xa7f0('0xf')]()===_0xa7f0('0x10')&&!_0x2e0bfb[_0xa7f0('0x11')]&&!_[_0xa7f0('0x12')](_0x2e0bfb[_0xa7f0('0x13')])){_0x2e917a[_0xa7f0('0x14')][_0xa7f0('0x15')]({'where':{'id':_0x2e0bfb['ChatInteractionId']}})[_0xa7f0('0x16')](function(_0x2fa5f3){if(_0x2fa5f3){_0x2fa5f3[_0xa7f0('0x17')]({'lastMsgAt':_0x2e0bfb[_0xa7f0('0x18')],'lastMsgDirection':_0x2e0bfb[_0xa7f0('0xe')][_0xa7f0('0xf')]()});}})[_0xa7f0('0x19')](function(_0x3d822d){console[_0xa7f0('0x1a')](_0x3d822d);});}_0x3499db();}},'charset':'utf8mb4','collate':_0xa7f0('0x1b')});}; \ No newline at end of file +var _0x1bdd=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','ChatInteractionId','then'];(function(_0x1be70b,_0x2866de){var _0x42ddab=function(_0x5e2c6e){while(--_0x5e2c6e){_0x1be70b['push'](_0x1be70b['shift']());}};_0x42ddab(++_0x2866de);}(_0x1bdd,0x97));var _0xd1bd=function(_0x1e37be,_0x405f43){_0x1e37be=_0x1e37be-0x0;var _0x749eca=_0x1bdd[_0x1e37be];return _0x749eca;};'use strict';var _=require(_0xd1bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd1bd('0x1'));var moment=require(_0xd1bd('0x2'));var BPromise=require(_0xd1bd('0x3'));var rp=require(_0xd1bd('0x4'));var fs=require('fs');var path=require(_0xd1bd('0x5'));var rimraf=require('rimraf');var config=require(_0xd1bd('0x6'));var attributes=require(_0xd1bd('0x7'));module['exports']=function(_0x2c84e0,_0x1eac20){return _0x2c84e0['define'](_0xd1bd('0x8'),attributes,{'tableName':_0xd1bd('0x9'),'paranoid':![],'indexes':[{'name':_0xd1bd('0xa'),'fields':[_0xd1bd('0xb')],'type':_0xd1bd('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4da086,_0x280cdc,_0x10ccce){var _0x644684=_0x2c84e0[_0xd1bd('0xd')];var _0x2d11c9=_0x4da086[_0xd1bd('0xe')]({'plain':!![]});if(_0x2d11c9[_0xd1bd('0xf')][_0xd1bd('0x10')]()==='in'||_0x2d11c9[_0xd1bd('0xf')][_0xd1bd('0x10')]()==='out'&&!_0x2d11c9[_0xd1bd('0x11')]&&!_[_0xd1bd('0x12')](_0x2d11c9[_0xd1bd('0x13')])){_0x644684['ChatInteraction'][_0xd1bd('0x14')]({'where':{'id':_0x2d11c9[_0xd1bd('0x15')]}})[_0xd1bd('0x16')](function(_0x348cdf){if(_0x348cdf){_0x348cdf[_0xd1bd('0x17')]({'lastMsgAt':_0x2d11c9[_0xd1bd('0x18')],'lastMsgDirection':_0x2d11c9[_0xd1bd('0xf')][_0xd1bd('0x10')]()});}})[_0xd1bd('0x19')](function(_0x576ec0){console[_0xd1bd('0x1a')](_0x576ec0);});}_0x10ccce();}},'charset':_0xd1bd('0x1b'),'collate':_0xd1bd('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 77f3a7a..165eeb2 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 _0x23a8=['message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./chatMessage.socket','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x23a8,0x19d));var _0x823a=function(_0xed75dc,_0x26d834){_0xed75dc=_0xed75dc-0x0;var _0x397190=_0x23a8[_0xed75dc];return _0x397190;};'use strict';var _=require(_0x823a('0x0'));var util=require('util');var moment=require(_0x823a('0x1'));var BPromise=require(_0x823a('0x2'));var rs=require(_0x823a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x823a('0x4'));var logger=require(_0x823a('0x5'))('rpc');var config=require(_0x823a('0x6'));var jayson=require(_0x823a('0x7'));var client=jayson['client'][_0x823a('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x823a('0x9')],{'host':_0x823a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x823a('0x9')]));require(_0x823a('0xb'))['register'](socket);function respondWithRpcPromise(_0x49f2c8,_0x1e71fd,_0x20b6bd){return new BPromise(function(_0x4bdb67,_0x1cb2b1){return client[_0x823a('0xc')](_0x49f2c8,_0x20b6bd)['then'](function(_0xb32876){logger[_0x823a('0xd')](_0x823a('0xe'),_0x1e71fd,_0x823a('0xf'));logger[_0x823a('0x10')](_0x823a('0x11'),_0x1e71fd,'request\x20sent',JSON[_0x823a('0x12')](_0xb32876));if(_0xb32876[_0x823a('0x13')]){if(_0xb32876[_0x823a('0x13')][_0x823a('0x14')]===0x1f4){logger[_0x823a('0x13')](_0x823a('0xe'),_0x1e71fd,_0xb32876[_0x823a('0x13')][_0x823a('0x15')]);return _0x1cb2b1(_0xb32876[_0x823a('0x13')]['message']);}logger[_0x823a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1e71fd,_0xb32876['error'][_0x823a('0x15')]);return _0x4bdb67(_0xb32876[_0x823a('0x13')][_0x823a('0x15')]);}else{logger[_0x823a('0xd')]('ChatMessage,\x20%s,\x20%s',_0x1e71fd,_0x823a('0xf'));_0x4bdb67(_0xb32876[_0x823a('0x16')][_0x823a('0x15')]);}})[_0x823a('0x17')](function(_0x5a6d3e){logger[_0x823a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1e71fd,_0x5a6d3e);_0x1cb2b1(_0x5a6d3e);});});}exports[_0x823a('0x18')]=function(_0x4556e6){var _0x1572c1=this;return new Promise(function(_0x408b1a,_0x51cbcf){return db[_0x823a('0x19')][_0x823a('0x1a')](_0x4556e6[_0x823a('0x1b')],{'raw':_0x4556e6['options']?_0x4556e6[_0x823a('0x1c')][_0x823a('0x1d')]===undefined?!![]:![]:!![]})[_0x823a('0x1e')](function(_0x2cfa54){logger[_0x823a('0xd')](_0x823a('0x18'),_0x4556e6);logger[_0x823a('0x10')](_0x823a('0x18'),_0x4556e6,JSON[_0x823a('0x12')](_0x2cfa54));_0x408b1a(_0x2cfa54);})[_0x823a('0x17')](function(_0x13db02){logger[_0x823a('0x13')]('CreateChatMessage',_0x13db02['message'],_0x4556e6);_0x51cbcf(_0x1572c1['error'](0x1f4,_0x13db02[_0x823a('0x15')]));});});}; \ No newline at end of file +var _0xa131=['catch','ChatMessage','create','body','options','CreateChatMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c0707,_0x27265f){var _0x304760=function(_0xe7c743){while(--_0xe7c743){_0x4c0707['push'](_0x4c0707['shift']());}};_0x304760(++_0x27265f);}(_0xa131,0xf4));var _0x1a13=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa131[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require(_0x1a13('0x0'));var moment=require(_0x1a13('0x1'));var BPromise=require(_0x1a13('0x2'));var rs=require(_0x1a13('0x3'));var fs=require('fs');var Redis=require(_0x1a13('0x4'));var db=require(_0x1a13('0x5'))['db'];var utils=require(_0x1a13('0x6'));var logger=require(_0x1a13('0x7'))(_0x1a13('0x8'));var config=require(_0x1a13('0x9'));var jayson=require(_0x1a13('0xa'));var client=jayson['client'][_0x1a13('0xb')]({'port':0x232a});config[_0x1a13('0xc')]=_[_0x1a13('0xd')](config[_0x1a13('0xc')],{'host':_0x1a13('0xe'),'port':0x18eb});var socket=require(_0x1a13('0xf'))(new Redis(config['redis']));require(_0x1a13('0x10'))[_0x1a13('0x11')](socket);function respondWithRpcPromise(_0x23dfbf,_0x276502,_0x3dd4e5){return new BPromise(function(_0x442d56,_0x1dd397){return client['request'](_0x23dfbf,_0x3dd4e5)[_0x1a13('0x12')](function(_0x46696f){logger[_0x1a13('0x13')](_0x1a13('0x14'),_0x276502,_0x1a13('0x15'));logger[_0x1a13('0x16')](_0x1a13('0x17'),_0x276502,_0x1a13('0x15'),JSON[_0x1a13('0x18')](_0x46696f));if(_0x46696f[_0x1a13('0x19')]){if(_0x46696f['error'][_0x1a13('0x1a')]===0x1f4){logger[_0x1a13('0x19')](_0x1a13('0x14'),_0x276502,_0x46696f[_0x1a13('0x19')][_0x1a13('0x1b')]);return _0x1dd397(_0x46696f['error']['message']);}logger['error'](_0x1a13('0x14'),_0x276502,_0x46696f[_0x1a13('0x19')]['message']);return _0x442d56(_0x46696f[_0x1a13('0x19')][_0x1a13('0x1b')]);}else{logger[_0x1a13('0x13')](_0x1a13('0x14'),_0x276502,'request\x20sent');_0x442d56(_0x46696f['result'][_0x1a13('0x1b')]);}})[_0x1a13('0x1c')](function(_0x328af9){logger[_0x1a13('0x19')](_0x1a13('0x14'),_0x276502,_0x328af9);_0x1dd397(_0x328af9);});});}exports['CreateChatMessage']=function(_0xa6ceb4){var _0x5ec2f5=this;return new Promise(function(_0x544942,_0x5c0347){return db[_0x1a13('0x1d')][_0x1a13('0x1e')](_0xa6ceb4[_0x1a13('0x1f')],{'raw':_0xa6ceb4['options']?_0xa6ceb4[_0x1a13('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x1a13('0x12')](function(_0x50be0d){logger[_0x1a13('0x13')](_0x1a13('0x21'),_0xa6ceb4);logger[_0x1a13('0x16')]('CreateChatMessage',_0xa6ceb4,JSON[_0x1a13('0x18')](_0x50be0d));_0x544942(_0x50be0d);})[_0x1a13('0x1c')](function(_0x3a6b09){logger[_0x1a13('0x19')](_0x1a13('0x21'),_0x3a6b09[_0x1a13('0x1b')],_0xa6ceb4);_0x5c0347(_0x5ec2f5[_0x1a13('0x19')](0x1f4,_0x3a6b09[_0x1a13('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 79c17bb..c203063 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 _0x5fab=['emit','removeListener','register','length','./chatMessage.events','save','update'];(function(_0xbd04a4,_0x52b7d2){var _0x24da31=function(_0x23236f){while(--_0x23236f){_0xbd04a4['push'](_0xbd04a4['shift']());}};_0x24da31(++_0x52b7d2);}(_0x5fab,0x177));var _0xb5fa=function(_0x239a99,_0x2eea66){_0x239a99=_0x239a99-0x0;var _0x5e65dc=_0x5fab[_0x239a99];return _0x5e65dc;};'use strict';var ChatMessageEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){ChatMessageEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('chatMessage:'+_0x1aec3e,_0x44df89);ChatMessageEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0x6d38=['removeListener','length','chatMessage:','save','remove','update'];(function(_0x5c4c71,_0x3445f8){var _0x167d6b=function(_0x52069f){while(--_0x52069f){_0x5c4c71['push'](_0x5c4c71['shift']());}};_0x167d6b(++_0x3445f8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x86d3('0x0'),_0x86d3('0x1'),_0x86d3('0x2')];function createListener(_0x52d138,_0x5c0b77){return function(_0xd1c7c){_0x5c0b77['emit'](_0x52d138,_0xd1c7c);};}function removeListener(_0xe9198a,_0x455b9d){return function(){ChatMessageEvents[_0x86d3('0x3')](_0xe9198a,_0x455b9d);};}exports['register']=function(_0x2d8272){for(var _0xfbbc15=0x0,_0x33d4aa=events[_0x86d3('0x4')];_0xfbbc15<_0x33d4aa;_0xfbbc15++){var _0x47e654=events[_0xfbbc15];var _0x552b07=createListener(_0x86d3('0x5')+_0x47e654,_0x2d8272);ChatMessageEvents['on'](_0x47e654,_0x552b07);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index d16cc78..64e4c1b 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 _0x85d3=['tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','post'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x85d3,0x1a9));var _0x385d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x85d3[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x385d('0x0'));var path=require(_0x385d('0x1'));var timeout=require(_0x385d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x385d('0x3'));var interaction=require(_0x385d('0x4'));var config=require(_0x385d('0x5'));var controller=require('./chatMessage.controller');router[_0x385d('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x385d('0x7'),auth['isAuthenticated'](),controller[_0x385d('0x8')]);router['get'](_0x385d('0x9'),auth[_0x385d('0xa')](),controller['show']);router[_0x385d('0xb')]('/',auth['isAuthenticated'](),interaction[_0x385d('0xc')](_0x385d('0xd'),_0x385d('0xe')),controller['create']);router['put'](_0x385d('0x9'),controller[_0x385d('0xf')]);router[_0x385d('0x10')](_0x385d('0x11'),auth[_0x385d('0xa')](),controller[_0x385d('0x12')]);router[_0x385d('0x10')](_0x385d('0x13'),auth[_0x385d('0xa')](),controller['reject']);router[_0x385d('0x14')](_0x385d('0x9'),auth[_0x385d('0xa')](),controller[_0x385d('0x15')]);module[_0x385d('0x16')]=router; \ No newline at end of file +var _0xa434=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','describe','get','show','post','tracked','chat'];(function(_0x57edc1,_0x5bf7d2){var _0xe09a53=function(_0x1cc687){while(--_0x1cc687){_0x57edc1['push'](_0x57edc1['shift']());}};_0xe09a53(++_0x5bf7d2);}(_0xa434,0x1af));var _0x4a43=function(_0x3b76e9,_0x39efb2){_0x3b76e9=_0x3b76e9-0x0;var _0x43489c=_0xa434[_0x3b76e9];return _0x43489c;};'use strict';var multer=require(_0x4a43('0x0'));var util=require(_0x4a43('0x1'));var path=require(_0x4a43('0x2'));var timeout=require(_0x4a43('0x3'));var express=require('express');var router=express[_0x4a43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4a43('0x5'));var config=require(_0x4a43('0x6'));var controller=require(_0x4a43('0x7'));router['get']('/',auth[_0x4a43('0x8')](),controller[_0x4a43('0x9')]);router['get'](_0x4a43('0xa'),auth[_0x4a43('0x8')](),controller[_0x4a43('0xb')]);router[_0x4a43('0xc')]('/:id',auth[_0x4a43('0x8')](),controller[_0x4a43('0xd')]);router[_0x4a43('0xe')]('/',auth[_0x4a43('0x8')](),interaction[_0x4a43('0xf')](_0x4a43('0x10'),'chatmessage:create'),controller[_0x4a43('0x11')]);router[_0x4a43('0x12')]('/:id',controller[_0x4a43('0x13')]);router[_0x4a43('0x12')](_0x4a43('0x14'),auth[_0x4a43('0x8')](),controller[_0x4a43('0x15')]);router[_0x4a43('0x12')](_0x4a43('0x16'),auth['isAuthenticated'](),controller[_0x4a43('0x17')]);router[_0x4a43('0x18')](_0x4a43('0x19'),auth[_0x4a43('0x8')](),controller[_0x4a43('0x1a')]);module[_0x4a43('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index f290afe..9b8eb5c 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 _0xfe3f=['exports','TEXT','medium','sequelize'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xfe3f,0x1e3));var _0xffe3=function(_0x123d33,_0x284725){_0x123d33=_0x123d33-0x0;var _0x458ad8=_0xfe3f[_0x123d33];return _0x458ad8;};'use strict';var Sequelize=require(_0xffe3('0x0'));module[_0xffe3('0x1')]={'body':{'type':Sequelize[_0xffe3('0x2')](_0xffe3('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x2b5d=['medium','exports','TEXT'];(function(_0x5b791d,_0x49cc81){var _0xdd1c36=function(_0x46f98b){while(--_0x46f98b){_0x5b791d['push'](_0x5b791d['shift']());}};_0xdd1c36(++_0x49cc81);}(_0x2b5d,0xe2));var _0xd2b5=function(_0x455253,_0x499581){_0x455253=_0x455253-0x0;var _0x1e5d18=_0x2b5d[_0x455253];return _0x1e5d18;};'use strict';var Sequelize=require('sequelize');module[_0xd2b5('0x0')]={'body':{'type':Sequelize[_0xd2b5('0x1')](_0xd2b5('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 490fea1..b3011aa 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 _0xc440=['save','update','then','destroy','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','filter','count','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','Content-Range','apply','reject'];(function(_0x5f0692,_0x126db5){var _0x132982=function(_0x2fbde9){while(--_0x2fbde9){_0x5f0692['push'](_0x5f0692['shift']());}};_0x132982(++_0x126db5);}(_0xc440,0x1df));var _0x0c44=function(_0x4c6763,_0x3c4c95){_0x4c6763=_0x4c6763-0x0;var _0x5147a=_0xc440[_0x4c6763];return _0x5147a;};'use strict';var pdf=require(_0x0c44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0c44('0x1'));var zipdir=require(_0x0c44('0x2'));var jsonpatch=require(_0x0c44('0x3'));var rp=require('request-promise');var moment=require(_0x0c44('0x4'));var BPromise=require(_0x0c44('0x5'));var Mustache=require(_0x0c44('0x6'));var util=require(_0x0c44('0x7'));var path=require(_0x0c44('0x8'));var sox=require(_0x0c44('0x9'));var csv=require(_0x0c44('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0c44('0xb'));var crypto=require('crypto');var jsforce=require(_0x0c44('0xc'));var deskjs=require(_0x0c44('0xd'));var toCsv=require(_0x0c44('0xa'));var querystring=require(_0x0c44('0xe'));var Papa=require(_0x0c44('0xf'));var Redis=require(_0x0c44('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0c44('0x11'));var as=require(_0x0c44('0x12'));var hardwareService=require(_0x0c44('0x13'));var logger=require('../../config/logger')(_0x0c44('0x14'));var utils=require(_0x0c44('0x15'));var config=require(_0x0c44('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28590e,_0x23a528){_0x23a528=_0x23a528||0xcc;return function(_0xd00acb){if(_0xd00acb){return _0x28590e[_0x0c44('0x17')](_0x23a528);}return _0x28590e[_0x0c44('0x18')](_0x23a528)[_0x0c44('0x19')]();};}function respondWithResult(_0x4acf04,_0x47f4b2){_0x47f4b2=_0x47f4b2||0xc8;return function(_0x41d2ba){if(_0x41d2ba){return _0x4acf04[_0x0c44('0x18')](_0x47f4b2)[_0x0c44('0x1a')](_0x41d2ba);}};}function respondWithFilteredResult(_0x4374a1,_0x7a85b0){return function(_0x4a0091){if(_0x4a0091){var _0x3a635d=_0x4a0091['count'],_0x1674d5=_0x7a85b0[_0x0c44('0x1b')],_0x58626c=_0x7a85b0['offset']+_0x7a85b0['limit'],_0x30c101;if(_0x58626c>=_0x3a635d){_0x58626c=_0x3a635d;_0x30c101=0xc8;}else{_0x30c101=0xce;}_0x4374a1[_0x0c44('0x18')](_0x30c101);return _0x4374a1[_0x0c44('0x1c')](_0x0c44('0x1d'),_0x1674d5+'-'+_0x58626c+'/'+_0x3a635d)[_0x0c44('0x1a')](_0x4a0091);}return null;};}function patchUpdates(_0x1020c8){return function(_0x34f6d5){try{jsonpatch[_0x0c44('0x1e')](_0x34f6d5,_0x1020c8,!![]);}catch(_0x23d7e9){return BPromise[_0x0c44('0x1f')](_0x23d7e9);}return _0x34f6d5[_0x0c44('0x20')]();};}function saveUpdates(_0x244255,_0x575e02){return function(_0x4e046a){if(_0x4e046a){return _0x4e046a[_0x0c44('0x21')](_0x244255)[_0x0c44('0x22')](function(_0x5f3bf1){return _0x5f3bf1;});}return null;};}function removeEntity(_0x547c35,_0x287bae){return function(_0x7b38cd){if(_0x7b38cd){return _0x7b38cd[_0x0c44('0x23')]()[_0x0c44('0x22')](function(){_0x547c35[_0x0c44('0x18')](0xcc)[_0x0c44('0x19')]();});}};}function handleEntityNotFound(_0xf00b98,_0x2eb992){return function(_0x3b550b){if(!_0x3b550b){_0xf00b98[_0x0c44('0x17')](0x194);}return _0x3b550b;};}function handleError(_0x1b95ff,_0x3465be){_0x3465be=_0x3465be||0x1f4;return function(_0x2c2397){logger['error'](_0x2c2397['stack']);if(_0x2c2397[_0x0c44('0x24')]){delete _0x2c2397['name'];}_0x1b95ff[_0x0c44('0x18')](_0x3465be)[_0x0c44('0x25')](_0x2c2397);};}exports[_0x0c44('0x26')]=function(_0x32883b,_0x30dea9){var _0x55cf3d={},_0x3b079f={},_0x2e221c={'count':0x0,'rows':[]};var _0x2f63f4=_[_0x0c44('0x27')](db[_0x0c44('0x28')][_0x0c44('0x29')],function(_0x1d17ff){return{'name':_0x1d17ff[_0x0c44('0x2a')],'type':_0x1d17ff['type']['key']};});_0x3b079f[_0x0c44('0x2b')]=_[_0x0c44('0x27')](_0x2f63f4,_0x0c44('0x24'));_0x3b079f['query']=_[_0x0c44('0x2c')](_0x32883b[_0x0c44('0x2d')]);_0x3b079f[_0x0c44('0x2e')]=_[_0x0c44('0x2f')](_0x3b079f[_0x0c44('0x2b')],_0x3b079f[_0x0c44('0x2d')]);_0x55cf3d[_0x0c44('0x30')]=_[_0x0c44('0x2f')](_0x3b079f[_0x0c44('0x2b')],qs[_0x0c44('0x31')](_0x32883b[_0x0c44('0x2d')]['fields']));_0x55cf3d[_0x0c44('0x30')]=_0x55cf3d[_0x0c44('0x30')][_0x0c44('0x32')]?_0x55cf3d[_0x0c44('0x30')]:_0x3b079f['model'];if(!_0x32883b[_0x0c44('0x2d')]['hasOwnProperty'](_0x0c44('0x33'))){_0x55cf3d['limit']=qs['limit'](_0x32883b[_0x0c44('0x2d')][_0x0c44('0x34')]);_0x55cf3d[_0x0c44('0x1b')]=qs[_0x0c44('0x1b')](_0x32883b[_0x0c44('0x2d')][_0x0c44('0x1b')]);}_0x55cf3d[_0x0c44('0x35')]=qs[_0x0c44('0x36')](_0x32883b[_0x0c44('0x2d')][_0x0c44('0x36')]);_0x55cf3d['where']=qs[_0x0c44('0x2e')](_[_0x0c44('0x37')](_0x32883b[_0x0c44('0x2d')],_0x3b079f[_0x0c44('0x2e')]));if(_0x32883b[_0x0c44('0x2d')]['filter']){_0x55cf3d[_0x0c44('0x38')]=_[_0x0c44('0x39')](_0x55cf3d[_0x0c44('0x38')],{'$or':_[_0x0c44('0x27')](_0x2f63f4,function(_0x322eb3){if(_0x322eb3[_0x0c44('0x3a')]!==_0x0c44('0x3b')){var _0xc8afb={};_0xc8afb[_0x322eb3[_0x0c44('0x24')]]={'$like':'%'+_0x32883b[_0x0c44('0x2d')][_0x0c44('0x3c')]+'%'};return _0xc8afb;}})});}_0x55cf3d=_[_0x0c44('0x39')]({},_0x55cf3d,_0x32883b['options']);var _0x5ac423={'where':_0x55cf3d[_0x0c44('0x38')]};return db['ChatOfflineMessage'][_0x0c44('0x3d')](_0x5ac423)[_0x0c44('0x22')](function(_0x5ddf3b){_0x2e221c[_0x0c44('0x3d')]=_0x5ddf3b;if(_0x32883b[_0x0c44('0x2d')][_0x0c44('0x3e')]){_0x55cf3d[_0x0c44('0x3f')]=[{'all':!![]}];}return db[_0x0c44('0x28')][_0x0c44('0x40')](_0x55cf3d);})[_0x0c44('0x22')](function(_0x3ebb76){_0x2e221c['rows']=_0x3ebb76;return _0x2e221c;})[_0x0c44('0x22')](respondWithFilteredResult(_0x30dea9,_0x55cf3d))[_0x0c44('0x41')](handleError(_0x30dea9,null));};exports[_0x0c44('0x42')]=function(_0x47d3b9,_0x12939d){var _0x5318c8={'raw':!![],'where':{'id':_0x47d3b9['params']['id']}},_0x1a2ddf={};_0x1a2ddf['model']=_[_0x0c44('0x2c')](db['ChatOfflineMessage'][_0x0c44('0x29')]);_0x1a2ddf[_0x0c44('0x2d')]=_['keys'](_0x47d3b9[_0x0c44('0x2d')]);_0x1a2ddf[_0x0c44('0x2e')]=_[_0x0c44('0x2f')](_0x1a2ddf[_0x0c44('0x2b')],_0x1a2ddf[_0x0c44('0x2d')]);_0x5318c8['attributes']=_['intersection'](_0x1a2ddf['model'],qs[_0x0c44('0x31')](_0x47d3b9[_0x0c44('0x2d')]['fields']));_0x5318c8[_0x0c44('0x30')]=_0x5318c8[_0x0c44('0x30')]['length']?_0x5318c8[_0x0c44('0x30')]:_0x1a2ddf[_0x0c44('0x2b')];if(_0x47d3b9['query'][_0x0c44('0x3e')]){_0x5318c8['include']=[{'all':!![]}];}_0x5318c8=_[_0x0c44('0x39')]({},_0x5318c8,_0x47d3b9[_0x0c44('0x43')]);return db[_0x0c44('0x28')][_0x0c44('0x44')](_0x5318c8)[_0x0c44('0x22')](handleEntityNotFound(_0x12939d,null))[_0x0c44('0x22')](respondWithResult(_0x12939d,null))['catch'](handleError(_0x12939d,null));};exports['create']=function(_0x4ac91a,_0x39e06d){return db['ChatOfflineMessage'][_0x0c44('0x45')](_0x4ac91a['body'],{})[_0x0c44('0x22')](respondWithResult(_0x39e06d,0xc9))[_0x0c44('0x41')](handleError(_0x39e06d,null));};exports[_0x0c44('0x21')]=function(_0x598b3c,_0x413f58){if(_0x598b3c[_0x0c44('0x46')]['id']){delete _0x598b3c[_0x0c44('0x46')]['id'];}return db[_0x0c44('0x28')][_0x0c44('0x44')]({'where':{'id':_0x598b3c[_0x0c44('0x47')]['id']}})['then'](handleEntityNotFound(_0x413f58,null))['then'](saveUpdates(_0x598b3c[_0x0c44('0x46')],null))[_0x0c44('0x22')](respondWithResult(_0x413f58,null))['catch'](handleError(_0x413f58,null));};exports[_0x0c44('0x23')]=function(_0x353549,_0x591b2d){return db[_0x0c44('0x28')][_0x0c44('0x44')]({'where':{'id':_0x353549[_0x0c44('0x47')]['id']}})[_0x0c44('0x22')](handleEntityNotFound(_0x591b2d,null))[_0x0c44('0x22')](removeEntity(_0x591b2d,null))[_0x0c44('0x41')](handleError(_0x591b2d,null));};exports[_0x0c44('0x48')]=function(_0x165035,_0x332315){return db['ChatOfflineMessage']['describe']()[_0x0c44('0x22')](respondWithResult(_0x332315,null))[_0x0c44('0x41')](handleError(_0x332315,null));}; \ No newline at end of file +var _0x095e=['util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','map','ChatOfflineMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','length','include','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x23e837,_0x4ce633){var _0x69ea52=function(_0x30ee16){while(--_0x30ee16){_0x23e837['push'](_0x23e837['shift']());}};_0x69ea52(++_0x4ce633);}(_0x095e,0x1ae));var _0xe095=function(_0x41cc76,_0x44c4ec){_0x41cc76=_0x41cc76-0x0;var _0x13d9c8=_0x095e[_0x41cc76];return _0x13d9c8;};'use strict';var pdf=require(_0xe095('0x0'));var emlformat=require(_0xe095('0x1'));var rimraf=require(_0xe095('0x2'));var zipdir=require(_0xe095('0x3'));var jsonpatch=require(_0xe095('0x4'));var rp=require('request-promise');var moment=require(_0xe095('0x5'));var BPromise=require(_0xe095('0x6'));var Mustache=require(_0xe095('0x7'));var util=require(_0xe095('0x8'));var path=require(_0xe095('0x9'));var sox=require(_0xe095('0xa'));var csv=require(_0xe095('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe095('0xc'));var crypto=require('crypto');var jsforce=require(_0xe095('0xd'));var deskjs=require(_0xe095('0xe'));var toCsv=require(_0xe095('0xb'));var querystring=require(_0xe095('0xf'));var Papa=require(_0xe095('0x10'));var Redis=require(_0xe095('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe095('0x12'));var as=require(_0xe095('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe095('0x14'))('api');var utils=require(_0xe095('0x15'));var config=require(_0xe095('0x16'));var db=require(_0xe095('0x17'))['db'];function respondWithStatusCode(_0x547c42,_0x1d1dab){_0x1d1dab=_0x1d1dab||0xcc;return function(_0x445a07){if(_0x445a07){return _0x547c42[_0xe095('0x18')](_0x1d1dab);}return _0x547c42[_0xe095('0x19')](_0x1d1dab)['end']();};}function respondWithResult(_0x1f14af,_0x4630c4){_0x4630c4=_0x4630c4||0xc8;return function(_0x5283d4){if(_0x5283d4){return _0x1f14af[_0xe095('0x19')](_0x4630c4)[_0xe095('0x1a')](_0x5283d4);}};}function respondWithFilteredResult(_0x36bfba,_0x3e9aa5){return function(_0x5be780){if(_0x5be780){var _0x4933d9=_0x5be780[_0xe095('0x1b')],_0x5ccb6c=_0x3e9aa5[_0xe095('0x1c')],_0x27526a=_0x3e9aa5[_0xe095('0x1c')]+_0x3e9aa5[_0xe095('0x1d')],_0x4b0551;if(_0x27526a>=_0x4933d9){_0x27526a=_0x4933d9;_0x4b0551=0xc8;}else{_0x4b0551=0xce;}_0x36bfba[_0xe095('0x19')](_0x4b0551);return _0x36bfba[_0xe095('0x1e')](_0xe095('0x1f'),_0x5ccb6c+'-'+_0x27526a+'/'+_0x4933d9)[_0xe095('0x1a')](_0x5be780);}return null;};}function patchUpdates(_0x5de68c){return function(_0x4b0934){try{jsonpatch['apply'](_0x4b0934,_0x5de68c,!![]);}catch(_0x49d2a4){return BPromise[_0xe095('0x20')](_0x49d2a4);}return _0x4b0934['save']();};}function saveUpdates(_0x1b7103,_0x2e70f0){return function(_0x5b2467){if(_0x5b2467){return _0x5b2467[_0xe095('0x21')](_0x1b7103)[_0xe095('0x22')](function(_0x5c51a7){return _0x5c51a7;});}return null;};}function removeEntity(_0x3d87b7,_0x423445){return function(_0x5bcc82){if(_0x5bcc82){return _0x5bcc82[_0xe095('0x23')]()[_0xe095('0x22')](function(){_0x3d87b7[_0xe095('0x19')](0xcc)[_0xe095('0x24')]();});}};}function handleEntityNotFound(_0x1f0af1,_0x53c389){return function(_0xfb6989){if(!_0xfb6989){_0x1f0af1[_0xe095('0x18')](0x194);}return _0xfb6989;};}function handleError(_0x27d4c1,_0x6c1da7){_0x6c1da7=_0x6c1da7||0x1f4;return function(_0x4a2c49){logger[_0xe095('0x25')](_0x4a2c49[_0xe095('0x26')]);if(_0x4a2c49[_0xe095('0x27')]){delete _0x4a2c49['name'];}_0x27d4c1[_0xe095('0x19')](_0x6c1da7)['send'](_0x4a2c49);};}exports['index']=function(_0x33838a,_0x3a3d90){var _0xe063c5={},_0x39c64b={},_0x3299a5={'count':0x0,'rows':[]};var _0xea506c=_[_0xe095('0x28')](db[_0xe095('0x29')][_0xe095('0x2a')],function(_0x6ed873){return{'name':_0x6ed873[_0xe095('0x2b')],'type':_0x6ed873['type'][_0xe095('0x2c')]};});_0x39c64b[_0xe095('0x2d')]=_['map'](_0xea506c,_0xe095('0x27'));_0x39c64b['query']=_[_0xe095('0x2e')](_0x33838a[_0xe095('0x2f')]);_0x39c64b[_0xe095('0x30')]=_[_0xe095('0x31')](_0x39c64b[_0xe095('0x2d')],_0x39c64b['query']);_0xe063c5[_0xe095('0x32')]=_[_0xe095('0x31')](_0x39c64b[_0xe095('0x2d')],qs[_0xe095('0x33')](_0x33838a[_0xe095('0x2f')][_0xe095('0x33')]));_0xe063c5['attributes']=_0xe063c5['attributes']['length']?_0xe063c5[_0xe095('0x32')]:_0x39c64b[_0xe095('0x2d')];if(!_0x33838a['query']['hasOwnProperty'](_0xe095('0x34'))){_0xe063c5[_0xe095('0x1d')]=qs[_0xe095('0x1d')](_0x33838a[_0xe095('0x2f')][_0xe095('0x1d')]);_0xe063c5[_0xe095('0x1c')]=qs[_0xe095('0x1c')](_0x33838a[_0xe095('0x2f')][_0xe095('0x1c')]);}_0xe063c5[_0xe095('0x35')]=qs[_0xe095('0x36')](_0x33838a[_0xe095('0x2f')][_0xe095('0x36')]);_0xe063c5[_0xe095('0x37')]=qs[_0xe095('0x30')](_[_0xe095('0x38')](_0x33838a[_0xe095('0x2f')],_0x39c64b[_0xe095('0x30')]));if(_0x33838a[_0xe095('0x2f')][_0xe095('0x39')]){_0xe063c5[_0xe095('0x37')]=_[_0xe095('0x3a')](_0xe063c5[_0xe095('0x37')],{'$or':_['map'](_0xea506c,function(_0x36da2c){if(_0x36da2c[_0xe095('0x3b')]!==_0xe095('0x3c')){var _0x4e1987={};_0x4e1987[_0x36da2c['name']]={'$like':'%'+_0x33838a[_0xe095('0x2f')][_0xe095('0x39')]+'%'};return _0x4e1987;}})});}_0xe063c5=_[_0xe095('0x3a')]({},_0xe063c5,_0x33838a[_0xe095('0x3d')]);var _0x4f67a7={'where':_0xe063c5[_0xe095('0x37')]};return db['ChatOfflineMessage'][_0xe095('0x1b')](_0x4f67a7)[_0xe095('0x22')](function(_0x4ba49a){_0x3299a5[_0xe095('0x1b')]=_0x4ba49a;if(_0x33838a['query'][_0xe095('0x3e')]){_0xe063c5['include']=[{'all':!![]}];}return db[_0xe095('0x29')][_0xe095('0x3f')](_0xe063c5);})[_0xe095('0x22')](function(_0x4decf4){_0x3299a5[_0xe095('0x40')]=_0x4decf4;return _0x3299a5;})[_0xe095('0x22')](respondWithFilteredResult(_0x3a3d90,_0xe063c5))['catch'](handleError(_0x3a3d90,null));};exports['show']=function(_0x2d912c,_0x3865af){var _0x447725={'raw':!![],'where':{'id':_0x2d912c[_0xe095('0x41')]['id']}},_0x3e461b={};_0x3e461b['model']=_['keys'](db['ChatOfflineMessage'][_0xe095('0x2a')]);_0x3e461b[_0xe095('0x2f')]=_['keys'](_0x2d912c[_0xe095('0x2f')]);_0x3e461b['filters']=_[_0xe095('0x31')](_0x3e461b['model'],_0x3e461b[_0xe095('0x2f')]);_0x447725[_0xe095('0x32')]=_[_0xe095('0x31')](_0x3e461b[_0xe095('0x2d')],qs['fields'](_0x2d912c['query'][_0xe095('0x33')]));_0x447725[_0xe095('0x32')]=_0x447725[_0xe095('0x32')][_0xe095('0x42')]?_0x447725[_0xe095('0x32')]:_0x3e461b['model'];if(_0x2d912c[_0xe095('0x2f')][_0xe095('0x3e')]){_0x447725[_0xe095('0x43')]=[{'all':!![]}];}_0x447725=_[_0xe095('0x3a')]({},_0x447725,_0x2d912c[_0xe095('0x3d')]);return db['ChatOfflineMessage'][_0xe095('0x44')](_0x447725)['then'](handleEntityNotFound(_0x3865af,null))['then'](respondWithResult(_0x3865af,null))[_0xe095('0x45')](handleError(_0x3865af,null));};exports[_0xe095('0x46')]=function(_0x4b235f,_0x36f280){return db[_0xe095('0x29')][_0xe095('0x46')](_0x4b235f[_0xe095('0x47')],{})[_0xe095('0x22')](respondWithResult(_0x36f280,0xc9))['catch'](handleError(_0x36f280,null));};exports[_0xe095('0x21')]=function(_0x5477bf,_0x1bc1cc){if(_0x5477bf[_0xe095('0x47')]['id']){delete _0x5477bf[_0xe095('0x47')]['id'];}return db[_0xe095('0x29')]['find']({'where':{'id':_0x5477bf[_0xe095('0x41')]['id']}})[_0xe095('0x22')](handleEntityNotFound(_0x1bc1cc,null))[_0xe095('0x22')](saveUpdates(_0x5477bf[_0xe095('0x47')],null))['then'](respondWithResult(_0x1bc1cc,null))[_0xe095('0x45')](handleError(_0x1bc1cc,null));};exports[_0xe095('0x23')]=function(_0x5e7678,_0x430d2e){return db['ChatOfflineMessage'][_0xe095('0x44')]({'where':{'id':_0x5e7678[_0xe095('0x41')]['id']}})[_0xe095('0x22')](handleEntityNotFound(_0x430d2e,null))[_0xe095('0x22')](removeEntity(_0x430d2e,null))[_0xe095('0x45')](handleError(_0x430d2e,null));};exports[_0xe095('0x48')]=function(_0x452af1,_0x522216){return db[_0xe095('0x29')][_0xe095('0x48')]()[_0xe095('0x22')](respondWithResult(_0x522216,null))[_0xe095('0x45')](handleError(_0x522216,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 1ba6c93..c22f599 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 _0x3937=['../../config/logger','api','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3937,0xbf));var _0x7393=function(_0x51de3a,_0x1d44a3){_0x51de3a=_0x51de3a-0x0;var _0x2903da=_0x3937[_0x51de3a];return _0x2903da;};'use strict';var _=require(_0x7393('0x0'));var util=require('util');var logger=require(_0x7393('0x1'))(_0x7393('0x2'));var moment=require('moment');var BPromise=require(_0x7393('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7393('0x4'));var rimraf=require('rimraf');var config=require(_0x7393('0x5'));var attributes=require(_0x7393('0x6'));module[_0x7393('0x7')]=function(_0x1f538f,_0x15eabd){return _0x1f538f[_0x7393('0x8')](_0x7393('0x9'),attributes,{'tableName':_0x7393('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7393('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb7c8=['bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x1c2818,_0x5d839a){var _0x26f175=function(_0x2df737){while(--_0x2df737){_0x1c2818['push'](_0x1c2818['shift']());}};_0x26f175(++_0x5d839a);}(_0xb7c8,0x119));var _0x8b7c=function(_0x31df10,_0x3a02c5){_0x31df10=_0x31df10-0x0;var _0xa80d7=_0xb7c8[_0x31df10];return _0xa80d7;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var moment=require(_0x8b7c('0x3'));var BPromise=require(_0x8b7c('0x4'));var rp=require(_0x8b7c('0x5'));var fs=require('fs');var path=require(_0x8b7c('0x6'));var rimraf=require('rimraf');var config=require(_0x8b7c('0x7'));var attributes=require(_0x8b7c('0x8'));module[_0x8b7c('0x9')]=function(_0x440900,_0x107428){return _0x440900[_0x8b7c('0xa')](_0x8b7c('0xb'),attributes,{'tableName':_0x8b7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b7c('0xd'),'collate':_0x8b7c('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7dd0565..4e403de 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 _0xa5f3=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result'];(function(_0x34f0fb,_0x3323b2){var _0x9b7b2b=function(_0x3cca84){while(--_0x3cca84){_0x34f0fb['push'](_0x34f0fb['shift']());}};_0x9b7b2b(++_0x3323b2);}(_0xa5f3,0x18d));var _0x3a5f=function(_0x5cb90e,_0x1ffa29){_0x5cb90e=_0x5cb90e-0x0;var _0xbd162b=_0xa5f3[_0x5cb90e];return _0xbd162b;};'use strict';var _=require(_0x3a5f('0x0'));var util=require(_0x3a5f('0x1'));var moment=require(_0x3a5f('0x2'));var BPromise=require(_0x3a5f('0x3'));var rs=require(_0x3a5f('0x4'));var fs=require('fs');var Redis=require(_0x3a5f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a5f('0x6'))(_0x3a5f('0x7'));var config=require(_0x3a5f('0x8'));var jayson=require(_0x3a5f('0x9'));var client=jayson['client'][_0x3a5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38aaca,_0x46d460,_0x4b4fc9){return new BPromise(function(_0x534fd6,_0x5562db){return client[_0x3a5f('0xb')](_0x38aaca,_0x4b4fc9)[_0x3a5f('0xc')](function(_0x319067){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x46d460,_0x3a5f('0xd'));logger[_0x3a5f('0xe')](_0x3a5f('0xf'),_0x46d460,_0x3a5f('0xd'),JSON['stringify'](_0x319067));if(_0x319067['error']){if(_0x319067['error']['code']===0x1f4){logger[_0x3a5f('0x10')](_0x3a5f('0x11'),_0x46d460,_0x319067[_0x3a5f('0x10')][_0x3a5f('0x12')]);return _0x5562db(_0x319067[_0x3a5f('0x10')][_0x3a5f('0x12')]);}logger[_0x3a5f('0x10')](_0x3a5f('0x11'),_0x46d460,_0x319067[_0x3a5f('0x10')][_0x3a5f('0x12')]);return _0x534fd6(_0x319067[_0x3a5f('0x10')][_0x3a5f('0x12')]);}else{logger[_0x3a5f('0x13')](_0x3a5f('0x11'),_0x46d460,_0x3a5f('0xd'));_0x534fd6(_0x319067[_0x3a5f('0x14')]['message']);}})[_0x3a5f('0x15')](function(_0x37702d){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x46d460,_0x37702d);_0x5562db(_0x37702d);});});} \ No newline at end of file +var _0x084d=['error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5007e6,_0x1c93f2){var _0x2e6b85=function(_0x4af761){while(--_0x4af761){_0x5007e6['push'](_0x5007e6['shift']());}};_0x2e6b85(++_0x1c93f2);}(_0x084d,0x102));var _0xd084=function(_0x4189db,_0x2a91e5){_0x4189db=_0x4189db-0x0;var _0x7bb46c=_0x084d[_0x4189db];return _0x7bb46c;};'use strict';var _=require('lodash');var util=require(_0xd084('0x0'));var moment=require(_0xd084('0x1'));var BPromise=require(_0xd084('0x2'));var rs=require(_0xd084('0x3'));var fs=require('fs');var Redis=require(_0xd084('0x4'));var db=require(_0xd084('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd084('0x6'))(_0xd084('0x7'));var config=require(_0xd084('0x8'));var jayson=require(_0xd084('0x9'));var client=jayson[_0xd084('0xa')][_0xd084('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ad4a0,_0x35f8cc,_0x440620){return new BPromise(function(_0x2a4389,_0x31c868){return client[_0xd084('0xc')](_0x3ad4a0,_0x440620)[_0xd084('0xd')](function(_0x20b171){logger[_0xd084('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x35f8cc,_0xd084('0xf'));logger[_0xd084('0x10')](_0xd084('0x11'),_0x35f8cc,_0xd084('0xf'),JSON['stringify'](_0x20b171));if(_0x20b171[_0xd084('0x12')]){if(_0x20b171['error']['code']===0x1f4){logger[_0xd084('0x12')](_0xd084('0x13'),_0x35f8cc,_0x20b171[_0xd084('0x12')][_0xd084('0x14')]);return _0x31c868(_0x20b171['error'][_0xd084('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x35f8cc,_0x20b171[_0xd084('0x12')][_0xd084('0x14')]);return _0x2a4389(_0x20b171[_0xd084('0x12')]['message']);}else{logger[_0xd084('0xe')](_0xd084('0x13'),_0x35f8cc,'request\x20sent');_0x2a4389(_0x20b171[_0xd084('0x15')]['message']);}})[_0xd084('0x16')](function(_0x4faee3){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x35f8cc,_0x4faee3);_0x31c868(_0x4faee3);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 49deea8..9e652bd 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 _0x9fa3=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x9fa3,0x114));var _0x39fa=function(_0x5a2c93,_0x3941ec){_0x5a2c93=_0x5a2c93-0x0;var _0x5c1b8c=_0x9fa3[_0x5a2c93];return _0x5c1b8c;};'use strict';var multer=require(_0x39fa('0x0'));var util=require(_0x39fa('0x1'));var path=require(_0x39fa('0x2'));var timeout=require(_0x39fa('0x3'));var express=require(_0x39fa('0x4'));var router=express[_0x39fa('0x5')]();var auth=require(_0x39fa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x39fa('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x39fa('0x8')]('/',auth[_0x39fa('0x9')](),controller['index']);router['get'](_0x39fa('0xa'),auth[_0x39fa('0x9')](),controller[_0x39fa('0xb')]);router[_0x39fa('0x8')](_0x39fa('0xc'),auth[_0x39fa('0x9')](),controller[_0x39fa('0xd')]);router[_0x39fa('0xe')]('/',auth[_0x39fa('0x9')](),controller[_0x39fa('0xf')]);router[_0x39fa('0x10')](_0x39fa('0xc'),auth[_0x39fa('0x9')](),controller[_0x39fa('0x11')]);router['delete'](_0x39fa('0xc'),auth[_0x39fa('0x9')](),controller[_0x39fa('0x12')]);module[_0x39fa('0x13')]=router; \ No newline at end of file +var _0xddae=['describe','/:id','show','create','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x112dbe,_0x460f54){var _0x482d80=function(_0x861b50){while(--_0x861b50){_0x112dbe['push'](_0x112dbe['shift']());}};_0x482d80(++_0x460f54);}(_0xddae,0x180));var _0xedda=function(_0x449e1c,_0x19aa90){_0x449e1c=_0x449e1c-0x0;var _0x28108c=_0xddae[_0x449e1c];return _0x28108c;};'use strict';var multer=require(_0xedda('0x0'));var util=require(_0xedda('0x1'));var path=require('path');var timeout=require(_0xedda('0x2'));var express=require(_0xedda('0x3'));var router=express[_0xedda('0x4')]();var auth=require(_0xedda('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xedda('0x6'));var controller=require(_0xedda('0x7'));router[_0xedda('0x8')]('/',auth[_0xedda('0x9')](),controller[_0xedda('0xa')]);router['get'](_0xedda('0xb'),auth[_0xedda('0x9')](),controller[_0xedda('0xc')]);router[_0xedda('0x8')](_0xedda('0xd'),auth[_0xedda('0x9')](),controller[_0xedda('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xedda('0xf')]);router['put'](_0xedda('0xd'),auth[_0xedda('0x9')](),controller[_0xedda('0x10')]);router[_0xedda('0x11')]('/:id',auth[_0xedda('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 544264e..27c5b4a 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 _0x4b5c=['STRING','ENUM','timeout','mouseOver','sequelize','exports'];(function(_0x5a3a17,_0xb42f18){var _0x447130=function(_0x242740){while(--_0x242740){_0x5a3a17['push'](_0x5a3a17['shift']());}};_0x447130(++_0xb42f18);}(_0x4b5c,0x94));var _0xc4b5=function(_0x12844e,_0x1808fe){_0x12844e=_0x12844e-0x0;var _0x2c7506=_0x4b5c[_0x12844e];return _0x2c7506;};'use strict';var Sequelize=require(_0xc4b5('0x0'));module[_0xc4b5('0x1')]={'name':{'type':Sequelize[_0xc4b5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc4b5('0x3')]('mouseOver',_0xc4b5('0x4')),'defaultValue':_0xc4b5('0x5')},'selector':{'type':Sequelize[_0xc4b5('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x164e=['INTEGER','sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x164e,0x14b));var _0xe164=function(_0x2320e4,_0x40c0e8){_0x2320e4=_0x2320e4-0x0;var _0x581eb6=_0x164e[_0x2320e4];return _0x581eb6;};'use strict';var Sequelize=require(_0xe164('0x0'));module['exports']={'name':{'type':Sequelize[_0xe164('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe164('0x2')](_0xe164('0x3'),_0xe164('0x4')),'defaultValue':_0xe164('0x3')},'selector':{'type':Sequelize[_0xe164('0x1')]},'timeout':{'type':Sequelize[_0xe164('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 652006b..de52f02 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 _0x0713=['update','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body'];(function(_0x56490e,_0x3ffc8f){var _0x1c62af=function(_0x499500){while(--_0x499500){_0x56490e['push'](_0x56490e['shift']());}};_0x1c62af(++_0x3ffc8f);}(_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 Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={'raw':!![],'where':{'id':_0x4d5c4b[_0x3071('0x2d')]['id']}},_0x163604={};_0x163604[_0x3071('0x2e')]=_[_0x3071('0x2f')](db[_0x3071('0x30')][_0x3071('0x31')]);_0x163604[_0x3071('0x32')]=_[_0x3071('0x2f')](_0x4d5c4b[_0x3071('0x32')]);_0x163604['filters']=_['intersection'](_0x163604[_0x3071('0x2e')],_0x163604[_0x3071('0x32')]);_0x28792d[_0x3071('0x33')]=_[_0x3071('0x34')](_0x163604[_0x3071('0x2e')],qs[_0x3071('0x35')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x35')]));_0x28792d['attributes']=_0x28792d['attributes']['length']?_0x28792d[_0x3071('0x33')]:_0x163604[_0x3071('0x2e')];if(_0x4d5c4b['query'][_0x3071('0x36')]){_0x28792d[_0x3071('0x37')]=[{'all':!![]}];}_0x28792d=_[_0x3071('0x38')]({},_0x28792d,_0x4d5c4b[_0x3071('0x39')]);return db['ChatProactiveAction'][_0x3071('0x3a')](_0x28792d)[_0x3071('0x26')](handleEntityNotFound(_0x4fb1ca,null))[_0x3071('0x26')](respondWithResult(_0x4fb1ca,null))[_0x3071('0x3b')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x3c')]=function(_0x2068ce,_0x3c55c){return db[_0x3071('0x30')]['create'](_0x2068ce[_0x3071('0x3d')],{})['then'](respondWithResult(_0x3c55c,0xc9))['catch'](handleError(_0x3c55c,null));};exports[_0x3071('0x3e')]=function(_0xa3a7ae,_0x54d9c3){if(_0xa3a7ae[_0x3071('0x3d')]['id']){delete _0xa3a7ae[_0x3071('0x3d')]['id'];}return db[_0x3071('0x30')][_0x3071('0x3a')]({'where':{'id':_0xa3a7ae[_0x3071('0x2d')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x54d9c3,null))['then'](saveUpdates(_0xa3a7ae[_0x3071('0x3d')],null))[_0x3071('0x26')](respondWithResult(_0x54d9c3,null))['catch'](handleError(_0x54d9c3,null));};exports[_0x3071('0x27')]=function(_0x5b1392,_0x28f855){return db[_0x3071('0x30')]['find']({'where':{'id':_0x5b1392['params']['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x28f855,null))[_0x3071('0x26')](removeEntity(_0x28f855,null))[_0x3071('0x3b')](handleError(_0x28f855,null));}; \ No newline at end of file +var _0x0713=['update','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body'];(function(_0x418423,_0xa694f9){var _0x5a1507=function(_0x541e95){while(--_0x541e95){_0x418423['push'](_0x418423['shift']());}};_0x5a1507(++_0xa694f9);}(_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 Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={'raw':!![],'where':{'id':_0x4d5c4b[_0x3071('0x2d')]['id']}},_0x163604={};_0x163604[_0x3071('0x2e')]=_[_0x3071('0x2f')](db[_0x3071('0x30')][_0x3071('0x31')]);_0x163604[_0x3071('0x32')]=_[_0x3071('0x2f')](_0x4d5c4b[_0x3071('0x32')]);_0x163604['filters']=_['intersection'](_0x163604[_0x3071('0x2e')],_0x163604[_0x3071('0x32')]);_0x28792d[_0x3071('0x33')]=_[_0x3071('0x34')](_0x163604[_0x3071('0x2e')],qs[_0x3071('0x35')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x35')]));_0x28792d['attributes']=_0x28792d['attributes']['length']?_0x28792d[_0x3071('0x33')]:_0x163604[_0x3071('0x2e')];if(_0x4d5c4b['query'][_0x3071('0x36')]){_0x28792d[_0x3071('0x37')]=[{'all':!![]}];}_0x28792d=_[_0x3071('0x38')]({},_0x28792d,_0x4d5c4b[_0x3071('0x39')]);return db['ChatProactiveAction'][_0x3071('0x3a')](_0x28792d)[_0x3071('0x26')](handleEntityNotFound(_0x4fb1ca,null))[_0x3071('0x26')](respondWithResult(_0x4fb1ca,null))[_0x3071('0x3b')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x3c')]=function(_0x2068ce,_0x3c55c){return db[_0x3071('0x30')]['create'](_0x2068ce[_0x3071('0x3d')],{})['then'](respondWithResult(_0x3c55c,0xc9))['catch'](handleError(_0x3c55c,null));};exports[_0x3071('0x3e')]=function(_0xa3a7ae,_0x54d9c3){if(_0xa3a7ae[_0x3071('0x3d')]['id']){delete _0xa3a7ae[_0x3071('0x3d')]['id'];}return db[_0x3071('0x30')][_0x3071('0x3a')]({'where':{'id':_0xa3a7ae[_0x3071('0x2d')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x54d9c3,null))['then'](saveUpdates(_0xa3a7ae[_0x3071('0x3d')],null))[_0x3071('0x26')](respondWithResult(_0x54d9c3,null))['catch'](handleError(_0x54d9c3,null));};exports[_0x3071('0x27')]=function(_0x5b1392,_0x28f855){return db[_0x3071('0x30')]['find']({'where':{'id':_0x5b1392['params']['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x28f855,null))[_0x3071('0x26')](removeEntity(_0x28f855,null))[_0x3071('0x3b')](handleError(_0x28f855,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d81958f..a30684d 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 _0xb0ad=['./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x467e9a,_0x4fa0e9){var _0x3ef369=function(_0x436f52){while(--_0x436f52){_0x467e9a['push'](_0x467e9a['shift']());}};_0x3ef369(++_0x4fa0e9);}(_0xb0ad,0x144));var _0xdb0a=function(_0x3d8a4f,_0x573f2b){_0x3d8a4f=_0x3d8a4f-0x0;var _0x52dfd9=_0xb0ad[_0x3d8a4f];return _0x52dfd9;};'use strict';var _=require('lodash');var util=require(_0xdb0a('0x0'));var logger=require(_0xdb0a('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdb0a('0x2'));var rp=require(_0xdb0a('0x3'));var fs=require('fs');var path=require(_0xdb0a('0x4'));var rimraf=require(_0xdb0a('0x5'));var config=require('../../config/environment');var attributes=require(_0xdb0a('0x6'));module[_0xdb0a('0x7')]=function(_0x375a09,_0x277dd2){return _0x375a09['define'](_0xdb0a('0x8'),attributes,{'tableName':_0xdb0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0583=['../../config/environment','exports','ChatProactiveAction','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x0583,0x99));var _0x3058=function(_0x45775d,_0x4c9975){_0x45775d=_0x45775d-0x0;var _0x57c7c5=_0x0583[_0x45775d];return _0x57c7c5;};'use strict';var _=require('lodash');var util=require(_0x3058('0x0'));var logger=require('../../config/logger')(_0x3058('0x1'));var moment=require(_0x3058('0x2'));var BPromise=require(_0x3058('0x3'));var rp=require(_0x3058('0x4'));var fs=require('fs');var path=require(_0x3058('0x5'));var rimraf=require(_0x3058('0x6'));var config=require(_0x3058('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x3058('0x8')]=function(_0x506050,_0x3d43e0){return _0x506050['define'](_0x3058('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 55654da..3401b5e 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 _0xf19e=['rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x31ef55,_0x1eb6f3){var _0x28df9c=function(_0x51fe99){while(--_0x51fe99){_0x31ef55['push'](_0x31ef55['shift']());}};_0x28df9c(++_0x1eb6f3);}(_0xf19e,0x15a));var _0xef19=function(_0x4c4ed1,_0xa1c563){_0x4c4ed1=_0x4c4ed1-0x0;var _0x1743e4=_0xf19e[_0x4c4ed1];return _0x1743e4;};'use strict';var _=require(_0xef19('0x0'));var util=require(_0xef19('0x1'));var moment=require('moment');var BPromise=require(_0xef19('0x2'));var rs=require(_0xef19('0x3'));var fs=require('fs');var Redis=require(_0xef19('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xef19('0x5'))(_0xef19('0x6'));var config=require(_0xef19('0x7'));var jayson=require(_0xef19('0x8'));var client=jayson[_0xef19('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x156433,_0x2a90e9,_0x3f46c0){return new BPromise(function(_0x608ff0,_0x31c79f){return client[_0xef19('0xa')](_0x156433,_0x3f46c0)[_0xef19('0xb')](function(_0x72191b){logger[_0xef19('0xc')](_0xef19('0xd'),_0x2a90e9,_0xef19('0xe'));logger[_0xef19('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2a90e9,_0xef19('0xe'),JSON[_0xef19('0x10')](_0x72191b));if(_0x72191b[_0xef19('0x11')]){if(_0x72191b[_0xef19('0x11')][_0xef19('0x12')]===0x1f4){logger[_0xef19('0x11')](_0xef19('0xd'),_0x2a90e9,_0x72191b[_0xef19('0x11')][_0xef19('0x13')]);return _0x31c79f(_0x72191b[_0xef19('0x11')][_0xef19('0x13')]);}logger['error'](_0xef19('0xd'),_0x2a90e9,_0x72191b[_0xef19('0x11')][_0xef19('0x13')]);return _0x608ff0(_0x72191b[_0xef19('0x11')]['message']);}else{logger['info'](_0xef19('0xd'),_0x2a90e9,'request\x20sent');_0x608ff0(_0x72191b[_0xef19('0x14')][_0xef19('0x13')]);}})[_0xef19('0x15')](function(_0x3b7cc5){logger[_0xef19('0x11')](_0xef19('0xd'),_0x2a90e9,_0x3b7cc5);_0x31c79f(_0x3b7cc5);});});} \ No newline at end of file +var _0xc485=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0xc485,0x117));var _0x5c48=function(_0x45ae0d,_0x1ea3b9){_0x45ae0d=_0x45ae0d-0x0;var _0x371826=_0xc485[_0x45ae0d];return _0x371826;};'use strict';var _=require(_0x5c48('0x0'));var util=require(_0x5c48('0x1'));var moment=require(_0x5c48('0x2'));var BPromise=require(_0x5c48('0x3'));var rs=require(_0x5c48('0x4'));var fs=require('fs');var Redis=require(_0x5c48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c48('0x6'));var logger=require(_0x5c48('0x7'))(_0x5c48('0x8'));var config=require(_0x5c48('0x9'));var jayson=require(_0x5c48('0xa'));var client=jayson['client'][_0x5c48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x505a48,_0x4bf081,_0x186e17){return new BPromise(function(_0x5ae2c6,_0x551458){return client[_0x5c48('0xc')](_0x505a48,_0x186e17)[_0x5c48('0xd')](function(_0x2cfa6d){logger[_0x5c48('0xe')](_0x5c48('0xf'),_0x4bf081,'request\x20sent');logger[_0x5c48('0x10')](_0x5c48('0x11'),_0x4bf081,'request\x20sent',JSON[_0x5c48('0x12')](_0x2cfa6d));if(_0x2cfa6d['error']){if(_0x2cfa6d[_0x5c48('0x13')][_0x5c48('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4bf081,_0x2cfa6d['error']['message']);return _0x551458(_0x2cfa6d[_0x5c48('0x13')][_0x5c48('0x15')]);}logger['error'](_0x5c48('0xf'),_0x4bf081,_0x2cfa6d[_0x5c48('0x13')][_0x5c48('0x15')]);return _0x5ae2c6(_0x2cfa6d['error']['message']);}else{logger[_0x5c48('0xe')](_0x5c48('0xf'),_0x4bf081,_0x5c48('0x16'));_0x5ae2c6(_0x2cfa6d[_0x5c48('0x17')][_0x5c48('0x15')]);}})[_0x5c48('0x18')](function(_0x19d939){logger[_0x5c48('0x13')](_0x5c48('0xf'),_0x4bf081,_0x19d939);_0x551458(_0x19d939);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6d3418c..26b2dfc 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 _0xb721=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','create'];(function(_0x130532,_0x3c0a6f){var _0x431dbe=function(_0x1c0cf5){while(--_0x1c0cf5){_0x130532['push'](_0x130532['shift']());}};_0x431dbe(++_0x3c0a6f);}(_0xb721,0x169));var _0x1b72=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0xb721[_0x131585];return _0x1fcca2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1b72('0x0'));var express=require(_0x1b72('0x1'));var router=express[_0x1b72('0x2')]();var auth=require(_0x1b72('0x3'));var interaction=require(_0x1b72('0x4'));var config=require(_0x1b72('0x5'));var controller=require(_0x1b72('0x6'));router[_0x1b72('0x7')](_0x1b72('0x8'),auth[_0x1b72('0x9')](),controller['show']);router['post']('/',auth[_0x1b72('0x9')](),controller[_0x1b72('0xa')]);router['put'](_0x1b72('0x8'),auth[_0x1b72('0x9')](),controller['update']);router['delete'](_0x1b72('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b72('0xb')]=router; \ No newline at end of file +var _0x56ea=['get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x429413,_0x15731a){var _0x20703e=function(_0x51b172){while(--_0x51b172){_0x429413['push'](_0x429413['shift']());}};_0x20703e(++_0x15731a);}(_0x56ea,0x12b));var _0xa56e=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x56ea[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0xa56e('0x0'));var util=require(_0xa56e('0x1'));var path=require(_0xa56e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa56e('0x3'));var router=express[_0xa56e('0x4')]();var auth=require(_0xa56e('0x5'));var interaction=require(_0xa56e('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0xa56e('0x7')]('/:id',auth[_0xa56e('0x8')](),controller[_0xa56e('0x9')]);router[_0xa56e('0xa')]('/',auth['isAuthenticated'](),controller[_0xa56e('0xb')]);router['put'](_0xa56e('0xc'),auth['isAuthenticated'](),controller[_0xa56e('0xd')]);router[_0xa56e('0xe')](_0xa56e('0xc'),auth[_0xa56e('0x8')](),controller[_0xa56e('0xf')]);module[_0xa56e('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2947179..2c36d32 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 _0xc586=['roundrobin','sequelize','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xc586,0x1e4));var _0x6c58=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc586[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x6c58('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c58('0x1')],'unique':_0x6c58('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6c58('0x1')]},'timeout':{'type':Sequelize[_0x6c58('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6c58('0x4'),_0x6c58('0x5'),_0x6c58('0x6'))}}; \ No newline at end of file +var _0xd5f3=['INTEGER','ENUM','rrmemory','sequelize','exports','STRING'];(function(_0x2c8374,_0x5814ab){var _0x6c87d9=function(_0x175add){while(--_0x175add){_0x2c8374['push'](_0x2c8374['shift']());}};_0x6c87d9(++_0x5814ab);}(_0xd5f3,0x189));var _0x3d5f=function(_0x101d99,_0x388487){_0x101d99=_0x101d99-0x0;var _0x272097=_0xd5f3[_0x101d99];return _0x272097;};'use strict';var Sequelize=require(_0x3d5f('0x0'));module[_0x3d5f('0x1')]={'name':{'type':Sequelize[_0x3d5f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3d5f('0x2')]},'timeout':{'type':Sequelize[_0x3d5f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d5f('0x4')](_0x3d5f('0x5'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index d67918e..54c418f 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 _0x9261=['value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','get','ChatQueues','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','%s/%s','chatPause','Team','getTeams','addTeams','ids','Agents','online','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union','compact'];(function(_0x2eaae2,_0xc55043){var _0x20ac55=function(_0x4b08ab){while(--_0x4b08ab){_0x2eaae2['push'](_0x2eaae2['shift']());}};_0x20ac55(++_0xc55043);}(_0x9261,0x1de));var _0x1926=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x9261[_0x115d5b];return _0x6cfc50;};'use strict';var pdf=require(_0x1926('0x0'));var emlformat=require(_0x1926('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1926('0x2'));var jsonpatch=require(_0x1926('0x3'));var rp=require(_0x1926('0x4'));var moment=require('moment');var BPromise=require(_0x1926('0x5'));var Mustache=require(_0x1926('0x6'));var util=require(_0x1926('0x7'));var path=require(_0x1926('0x8'));var sox=require(_0x1926('0x9'));var csv=require('to-csv');var ejs=require(_0x1926('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1926('0xb'));var crypto=require(_0x1926('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1926('0xd'));var toCsv=require(_0x1926('0xe'));var querystring=require(_0x1926('0xf'));var Papa=require(_0x1926('0x10'));var Redis=require(_0x1926('0x11'));var authService=require(_0x1926('0x12'));var qs=require(_0x1926('0x13'));var as=require(_0x1926('0x14'));var hardwareService=require(_0x1926('0x15'));var logger=require(_0x1926('0x16'))(_0x1926('0x17'));var utils=require(_0x1926('0x18'));var config=require(_0x1926('0x19'));var db=require(_0x1926('0x1a'))['db'];config[_0x1926('0x1b')]=_[_0x1926('0x1c')](config[_0x1926('0x1b')],{'host':_0x1926('0x1d'),'port':0x18eb});var socket=require(_0x1926('0x1e'))(new Redis(config[_0x1926('0x1b')]));require(_0x1926('0x1f'))[_0x1926('0x20')](socket);var jayson=require(_0x1926('0x21'));var client=jayson[_0x1926('0x22')][_0x1926('0x23')]({'port':0x232a});function checkPasswordPattern(_0x472e41,_0x53f820,_0xe13cde){if(_0xe13cde){var _0x348117=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x348117[_0x1926('0x24')](_0x53f820)){return _0x472e41;}else{throw new db['Sequelize'][(_0x1926('0x25'))](_0x1926('0x26'));}}else{return _0x472e41;}}function respondWithRpcPromise(_0x50da1e,_0x21e214,_0x4552e0,_0xdfa757){return new BPromise(function(_0x2fdac0,_0x1b8d73){var _0x2606ba=_0xdfa757||client;return _0x2606ba[_0x1926('0x27')](_0x50da1e,_0x4552e0)[_0x1926('0x28')](function(_0x1e4b49){logger[_0x1926('0x29')](_0x1926('0x2a'),_0x21e214,_0x1926('0x2b'));logger[_0x1926('0x2c')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x21e214,'request\x20sent',JSON[_0x1926('0x2d')](_0x1e4b49));if(_0x1e4b49[_0x1926('0x2e')]){if(_0x1e4b49[_0x1926('0x2e')][_0x1926('0x2f')]===0x1f4){logger[_0x1926('0x2e')](_0x1926('0x2a'),_0x21e214,_0x1e4b49[_0x1926('0x2e')][_0x1926('0x30')]);return _0x1b8d73(_0x1e4b49[_0x1926('0x2e')][_0x1926('0x30')]);}logger[_0x1926('0x2e')]('ChatQueue,\x20%s,\x20%s',_0x21e214,_0x1e4b49['error']['message']);return _0x2fdac0(_0x1e4b49['error'][_0x1926('0x30')]);}else{logger[_0x1926('0x29')](_0x1926('0x2a'),_0x21e214,_0x1926('0x2b'));_0x2fdac0(_0x1e4b49['result']['message']);}})['catch'](function(_0x3659fa){logger[_0x1926('0x2e')]('ChatQueue,\x20%s,\x20%s',_0x21e214,_0x3659fa);_0x1b8d73(_0x3659fa);});});}function respondWithStatusCode(_0x1c0d63,_0x2649ff){_0x2649ff=_0x2649ff||0xcc;return function(_0x3cb4ee){if(_0x3cb4ee){return _0x1c0d63[_0x1926('0x31')](_0x2649ff);}return _0x1c0d63[_0x1926('0x32')](_0x2649ff)[_0x1926('0x33')]();};}function respondWithResult(_0x267513,_0xd60129){_0xd60129=_0xd60129||0xc8;return function(_0x1c8290){if(_0x1c8290){return _0x267513['status'](_0xd60129)[_0x1926('0x34')](_0x1c8290);}};}function respondWithFilteredResult(_0x42e41e,_0x10fd25){return function(_0x733be2){if(_0x733be2){var _0x486a2e=_0x733be2[_0x1926('0x35')],_0x391915=_0x10fd25[_0x1926('0x36')],_0x47834a=_0x10fd25['offset']+_0x10fd25[_0x1926('0x37')],_0x406631;if(_0x47834a>=_0x486a2e){_0x47834a=_0x486a2e;_0x406631=0xc8;}else{_0x406631=0xce;}_0x42e41e['status'](_0x406631);return _0x42e41e[_0x1926('0x38')](_0x1926('0x39'),_0x391915+'-'+_0x47834a+'/'+_0x486a2e)[_0x1926('0x34')](_0x733be2);}return null;};}function patchUpdates(_0x33d4a4){return function(_0x56f7a8){try{jsonpatch[_0x1926('0x3a')](_0x56f7a8,_0x33d4a4,!![]);}catch(_0x3ed2b3){return BPromise[_0x1926('0x3b')](_0x3ed2b3);}return _0x56f7a8['save']();};}function saveUpdates(_0x9495cd,_0x331481){return function(_0x187b1e){if(_0x187b1e){return _0x187b1e[_0x1926('0x3c')](_0x9495cd)[_0x1926('0x28')](function(_0x5ab830){return _0x5ab830;});}return null;};}function removeEntity(_0x51cdce,_0x2c8d69){return function(_0x48fd4b){if(_0x48fd4b){return _0x48fd4b['destroy']()[_0x1926('0x28')](function(){var _0x4da402=_0x48fd4b[_0x1926('0x3d')]({'plain':!![]});var _0x1960ef=_0x1926('0x3e');return db['UserProfileResource'][_0x1926('0x3f')]({'where':{'type':_0x1960ef,'resourceId':_0x4da402['id']}})[_0x1926('0x28')](function(){return _0x48fd4b;});})['then'](function(){_0x51cdce['status'](0xcc)[_0x1926('0x33')]();});}};}function handleEntityNotFound(_0x3d3f35,_0x222a8d){return function(_0x1de98d){if(!_0x1de98d){_0x3d3f35[_0x1926('0x31')](0x194);}return _0x1de98d;};}function handleError(_0x54575e,_0x1ae6eb){_0x1ae6eb=_0x1ae6eb||0x1f4;return function(_0x199e28){logger[_0x1926('0x2e')](_0x199e28['stack']);if(_0x199e28[_0x1926('0x40')]){delete _0x199e28[_0x1926('0x40')];}_0x54575e[_0x1926('0x32')](_0x1ae6eb)[_0x1926('0x41')](_0x199e28);};}exports[_0x1926('0x42')]=function(_0x285946,_0x3535fc){var _0x436ed7={},_0x47784f={},_0x39925a={'count':0x0,'rows':[]};var _0x40f425=_[_0x1926('0x43')](db[_0x1926('0x44')][_0x1926('0x45')],function(_0x2018ae){return{'name':_0x2018ae[_0x1926('0x46')],'type':_0x2018ae[_0x1926('0x47')]['key']};});_0x47784f[_0x1926('0x48')]=_[_0x1926('0x43')](_0x40f425,'name');_0x47784f[_0x1926('0x49')]=_[_0x1926('0x4a')](_0x285946['query']);_0x47784f[_0x1926('0x4b')]=_[_0x1926('0x4c')](_0x47784f[_0x1926('0x48')],_0x47784f[_0x1926('0x49')]);_0x436ed7[_0x1926('0x4d')]=_['intersection'](_0x47784f[_0x1926('0x48')],qs[_0x1926('0x4e')](_0x285946['query'][_0x1926('0x4e')]));_0x436ed7['attributes']=_0x436ed7[_0x1926('0x4d')]['length']?_0x436ed7[_0x1926('0x4d')]:_0x47784f[_0x1926('0x48')];if(!_0x285946[_0x1926('0x49')][_0x1926('0x4f')](_0x1926('0x50'))){_0x436ed7['limit']=qs[_0x1926('0x37')](_0x285946[_0x1926('0x49')][_0x1926('0x37')]);_0x436ed7[_0x1926('0x36')]=qs[_0x1926('0x36')](_0x285946[_0x1926('0x49')][_0x1926('0x36')]);}_0x436ed7[_0x1926('0x51')]=qs[_0x1926('0x52')](_0x285946['query']['sort']);_0x436ed7[_0x1926('0x53')]=qs['filters'](_[_0x1926('0x54')](_0x285946['query'],_0x47784f[_0x1926('0x4b')]));if(_0x285946[_0x1926('0x49')][_0x1926('0x55')]){_0x436ed7[_0x1926('0x53')]=_['merge'](_0x436ed7[_0x1926('0x53')],{'$or':_[_0x1926('0x43')](_0x40f425,function(_0x5d0623){if(_0x5d0623[_0x1926('0x47')]!==_0x1926('0x56')){var _0x16ed18={};_0x16ed18[_0x5d0623['name']]={'$like':'%'+_0x285946[_0x1926('0x49')]['filter']+'%'};return _0x16ed18;}})});}_0x436ed7=_[_0x1926('0x57')]({},_0x436ed7,_0x285946[_0x1926('0x58')]);var _0x3e987e={'where':_0x436ed7[_0x1926('0x53')]};return db[_0x1926('0x44')]['count'](_0x3e987e)[_0x1926('0x28')](function(_0x1c02d0){_0x39925a[_0x1926('0x35')]=_0x1c02d0;if(_0x285946[_0x1926('0x49')][_0x1926('0x59')]){_0x436ed7['include']=[{'all':!![]}];}return db[_0x1926('0x44')][_0x1926('0x5a')](_0x436ed7);})[_0x1926('0x28')](function(_0x4a0b4d){_0x39925a['rows']=_0x4a0b4d;return _0x39925a;})[_0x1926('0x28')](respondWithFilteredResult(_0x3535fc,_0x436ed7))[_0x1926('0x5b')](handleError(_0x3535fc,null));};exports['show']=function(_0x27570e,_0x1988ae){var _0x46c764={'raw':!![],'where':{'id':_0x27570e[_0x1926('0x5c')]['id']}},_0x53b0a2={};_0x53b0a2[_0x1926('0x48')]=_[_0x1926('0x4a')](db[_0x1926('0x44')]['rawAttributes']);_0x53b0a2[_0x1926('0x49')]=_[_0x1926('0x4a')](_0x27570e[_0x1926('0x49')]);_0x53b0a2[_0x1926('0x4b')]=_['intersection'](_0x53b0a2['model'],_0x53b0a2[_0x1926('0x49')]);_0x46c764[_0x1926('0x4d')]=_[_0x1926('0x4c')](_0x53b0a2[_0x1926('0x48')],qs[_0x1926('0x4e')](_0x27570e[_0x1926('0x49')]['fields']));_0x46c764[_0x1926('0x4d')]=_0x46c764[_0x1926('0x4d')][_0x1926('0x5d')]?_0x46c764[_0x1926('0x4d')]:_0x53b0a2[_0x1926('0x48')];if(_0x27570e['query']['includeAll']){_0x46c764[_0x1926('0x5e')]=[{'all':!![]}];}_0x46c764=_[_0x1926('0x57')]({},_0x46c764,_0x27570e[_0x1926('0x58')]);return db['ChatQueue']['find'](_0x46c764)['then'](handleEntityNotFound(_0x1988ae,null))[_0x1926('0x28')](respondWithResult(_0x1988ae,null))[_0x1926('0x5b')](handleError(_0x1988ae,null));};exports[_0x1926('0x5f')]=function(_0x22c3d8,_0x472ba2){return db[_0x1926('0x44')]['create'](_0x22c3d8[_0x1926('0x60')],{})[_0x1926('0x28')](function(_0x2ede86){var _0x1ffe35=_0x22c3d8[_0x1926('0x61')]['get']({'plain':!![]});if(!_0x1ffe35)throw new Error(_0x1926('0x62'));if(_0x1ffe35[_0x1926('0x63')]===_0x1926('0x61')){var _0x5b71b5=_0x2ede86[_0x1926('0x3d')]({'plain':!![]});var _0x5119ee='ChatQueues';return db[_0x1926('0x64')][_0x1926('0x65')]({'where':{'name':_0x5119ee,'userProfileId':_0x1ffe35[_0x1926('0x66')]},'raw':!![]})[_0x1926('0x28')](function(_0x436fec){if(_0x436fec&&_0x436fec[_0x1926('0x67')]===0x0){return db['UserProfileResource'][_0x1926('0x5f')]({'name':_0x5b71b5[_0x1926('0x40')],'resourceId':_0x5b71b5['id'],'type':_0x436fec['name'],'sectionId':_0x436fec['id']},{})[_0x1926('0x28')](function(){return _0x2ede86;});}else{return _0x2ede86;}})[_0x1926('0x5b')](function(_0x2ea73e){logger[_0x1926('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea73e);throw _0x2ea73e;});}return _0x2ede86;})['then'](respondWithResult(_0x472ba2,0xc9))['catch'](handleError(_0x472ba2,null));};exports[_0x1926('0x3c')]=function(_0x19527b,_0xacf36f){if(_0x19527b[_0x1926('0x60')]['id']){delete _0x19527b['body']['id'];}return db[_0x1926('0x44')][_0x1926('0x65')]({'where':{'id':_0x19527b['params']['id']}})[_0x1926('0x28')](handleEntityNotFound(_0xacf36f,null))[_0x1926('0x28')](saveUpdates(_0x19527b['body'],null))[_0x1926('0x28')](respondWithResult(_0xacf36f,null))[_0x1926('0x5b')](handleError(_0xacf36f,null));};exports[_0x1926('0x3f')]=function(_0x24b871,_0x17ff8f){return db[_0x1926('0x44')]['find']({'where':{'id':_0x24b871[_0x1926('0x5c')]['id']}})[_0x1926('0x28')](handleEntityNotFound(_0x17ff8f,null))[_0x1926('0x28')](removeEntity(_0x17ff8f,null))['catch'](handleError(_0x17ff8f,null));};exports[_0x1926('0x68')]=function(_0x1bca9c,_0x520270){return db[_0x1926('0x44')]['describe']()[_0x1926('0x28')](respondWithResult(_0x520270,null))[_0x1926('0x5b')](handleError(_0x520270,null));};exports[_0x1926('0x69')]=function(_0xbd3fe1,_0x2f10e9,_0x57924f){var _0x3833da={'raw':!![],'where':{}},_0x3775d2={},_0x377eb3;return db[_0x1926('0x44')][_0x1926('0x6a')]({'where':{'id':_0xbd3fe1[_0x1926('0x5c')]['id']}})[_0x1926('0x28')](handleEntityNotFound(_0x2f10e9,null))[_0x1926('0x28')](function(_0x34a61){if(_0x34a61){_0x377eb3=_0x34a61[_0x1926('0x3d')]({'plain':!![]});_0x3775d2['model']=_[_0x1926('0x4a')](db[_0x1926('0x6b')][_0x1926('0x45')]);_0x3775d2[_0x1926('0x49')]=_[_0x1926('0x4a')](_0xbd3fe1['query']);_0x3775d2[_0x1926('0x4b')]=_['intersection'](_0x3775d2[_0x1926('0x48')],_0x3775d2[_0x1926('0x49')]);_0x3833da[_0x1926('0x4d')]=_[_0x1926('0x4c')](_0x3775d2[_0x1926('0x48')],qs[_0x1926('0x4e')](_0xbd3fe1[_0x1926('0x49')][_0x1926('0x4e')]));_0x3833da[_0x1926('0x4d')]=_0x3833da[_0x1926('0x4d')][_0x1926('0x5d')]?_0x3833da['attributes']:_0x3775d2[_0x1926('0x48')];if(!_0xbd3fe1[_0x1926('0x49')]['hasOwnProperty'](_0x1926('0x50'))){_0x3833da[_0x1926('0x37')]=qs['limit'](_0xbd3fe1[_0x1926('0x49')]['limit']);_0x3833da[_0x1926('0x36')]=qs[_0x1926('0x36')](_0xbd3fe1[_0x1926('0x49')][_0x1926('0x36')]);}_0x3833da['order']=qs[_0x1926('0x52')](_0xbd3fe1[_0x1926('0x49')][_0x1926('0x52')]);_0x3833da[_0x1926('0x53')]=qs[_0x1926('0x4b')](_[_0x1926('0x54')](_0xbd3fe1[_0x1926('0x49')],_0x3775d2['filters']));_0x3833da[_0x1926('0x53')][_0x1926('0x6c')]=_0x34a61['id'];if(_0xbd3fe1[_0x1926('0x49')][_0x1926('0x55')]){_0x3833da[_0x1926('0x53')]=_[_0x1926('0x57')](_0x3833da['where'],{'$or':_['map'](_0x3833da[_0x1926('0x4d')],function(_0x52dcec){var _0x49fa2f={};_0x49fa2f[_0x52dcec]={'$like':'%'+_0xbd3fe1[_0x1926('0x49')][_0x1926('0x55')]+'%'};return _0x49fa2f;})});}_0x3833da=_['merge']({},_0x3833da,_0xbd3fe1['options']);return db['UserChatQueue'][_0x1926('0x5a')](_0x3833da);}})[_0x1926('0x28')](function(_0x5d18f0){if(_0x5d18f0){return db[_0x1926('0x6d')][_0x1926('0x6e')]({'where':{'id':_[_0x1926('0x43')](_0x5d18f0,'UserId'),'role':_0x1926('0x6f')},'attributes':['id',_0x1926('0x40'),'chatPause',_0x1926('0x70'),_0x1926('0x71')]});}})[_0x1926('0x28')](function(_0x342c23){if(_0x342c23){return{'count':_0x342c23[_0x1926('0x35')],'rows':_[_0x1926('0x43')](_0x342c23[_0x1926('0x72')],function(_0x406ca3){return{'membername':_0x406ca3['name'],'UserId':_0x406ca3['id'],'queue_name':_0x377eb3[_0x1926('0x40')],'ChatQueueId':_0x377eb3['id'],'interface':util[_0x1926('0x73')](_0x1926('0x74'),'SIP',_0x406ca3[_0x1926('0x40')]),'penalty':0x0,'paused':_0x406ca3[_0x1926('0x75')],'createdAt':_0x406ca3[_0x1926('0x71')],'updatedAt':_0x406ca3[_0x1926('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1926('0x28')](respondWithFilteredResult(_0x2f10e9,_0x3833da))[_0x1926('0x5b')](handleError(_0x2f10e9,null));};exports['getTeams']=function(_0x5481f2,_0x15ee2a,_0x19c46c){var _0x2006b4={};var _0x29fda7={};var _0x10300a;var _0x85a219;return db[_0x1926('0x44')][_0x1926('0x6a')]({'where':{'id':_0x5481f2[_0x1926('0x5c')]['id']}})['then'](handleEntityNotFound(_0x15ee2a,null))['then'](function(_0x33786f){if(_0x33786f){_0x10300a=_0x33786f;_0x29fda7[_0x1926('0x48')]=_[_0x1926('0x4a')](db[_0x1926('0x76')]['rawAttributes']);_0x29fda7[_0x1926('0x49')]=_[_0x1926('0x4a')](_0x5481f2[_0x1926('0x49')]);_0x29fda7[_0x1926('0x4b')]=_['intersection'](_0x29fda7['model'],_0x29fda7[_0x1926('0x49')]);_0x2006b4[_0x1926('0x4d')]=_['intersection'](_0x29fda7[_0x1926('0x48')],qs[_0x1926('0x4e')](_0x5481f2[_0x1926('0x49')][_0x1926('0x4e')]));_0x2006b4[_0x1926('0x4d')]=_0x2006b4[_0x1926('0x4d')][_0x1926('0x5d')]?_0x2006b4[_0x1926('0x4d')]:_0x29fda7[_0x1926('0x48')];_0x2006b4['order']=qs[_0x1926('0x52')](_0x5481f2[_0x1926('0x49')][_0x1926('0x52')]);_0x2006b4['where']=qs['filters'](_[_0x1926('0x54')](_0x5481f2[_0x1926('0x49')],_0x29fda7[_0x1926('0x4b')]));if(_0x5481f2[_0x1926('0x49')]['filter']){_0x2006b4[_0x1926('0x53')]=_[_0x1926('0x57')](_0x2006b4[_0x1926('0x53')],{'$or':_[_0x1926('0x43')](_0x2006b4[_0x1926('0x4d')],function(_0x6c757d){var _0x4798e5={};_0x4798e5[_0x6c757d]={'$like':'%'+_0x5481f2[_0x1926('0x49')][_0x1926('0x55')]+'%'};return _0x4798e5;})});}_0x2006b4=_[_0x1926('0x57')]({},_0x2006b4,_0x5481f2[_0x1926('0x58')]);return _0x10300a[_0x1926('0x77')](_0x2006b4);}})[_0x1926('0x28')](function(_0x47a0b9){if(_0x47a0b9){_0x85a219=_0x47a0b9[_0x1926('0x5d')];if(!_0x5481f2[_0x1926('0x49')][_0x1926('0x4f')](_0x1926('0x50'))){_0x2006b4[_0x1926('0x37')]=qs['limit'](_0x5481f2[_0x1926('0x49')][_0x1926('0x37')]);_0x2006b4[_0x1926('0x36')]=qs[_0x1926('0x36')](_0x5481f2[_0x1926('0x49')][_0x1926('0x36')]);}return _0x10300a['getTeams'](_0x2006b4);}})[_0x1926('0x28')](function(_0x338858){if(_0x338858){return _0x338858?{'count':_0x85a219,'rows':_0x338858}:null;}})[_0x1926('0x28')](respondWithResult(_0x15ee2a,null))[_0x1926('0x5b')](handleError(_0x15ee2a,null));};exports[_0x1926('0x78')]=function(_0x80ce2,_0x34b805,_0x13ab18){var _0x3ba82f=_0x80ce2[_0x1926('0x60')][_0x1926('0x79')];return db['Team'][_0x1926('0x5a')]({'where':{'id':_0x3ba82f},'attributes':['id'],'include':[{'model':db[_0x1926('0x6d')],'as':_0x1926('0x7a'),'attributes':['id',_0x1926('0x40'),_0x1926('0x7b'),'voicePause','interface'],'raw':!![]}]})[_0x1926('0x28')](function(_0x1c62bd){if(_0x1c62bd){var _0x266433=_['flatMap'](_0x1c62bd,function(_0x50a8cd){var _0x4c72b1=_0x50a8cd['get']({'plain':!![]});return _0x4c72b1[_0x1926('0x7a')];});return db[_0x1926('0x44')][_0x1926('0x65')]({'where':{'id':_0x80ce2['params']['id']}})[_0x1926('0x28')](function(_0x190ee5){return db[_0x1926('0x7c')][_0x1926('0x7d')](function(_0x10f7a8){return _0x190ee5[_0x1926('0x78')](_0x3ba82f,{'transaction':_0x10f7a8})[_0x1926('0x28')](function(){return BPromise[_0x1926('0x7e')](_0x266433,function(_0x32160c){return db[_0x1926('0x6b')][_0x1926('0x7f')]({'where':{'UserId':_0x32160c['id'],'ChatQueueId':_0x80ce2[_0x1926('0x5c')]['id']},'transaction':_0x10f7a8});});})[_0x1926('0x28')](function(){_0x266433[_0x1926('0x80')](function(_0x370a27){socket['emit'](_0x1926('0x81'),{'UserId':_0x370a27['id'],'ChatQueueId':_0x190ee5['id']});});});});});}})[_0x1926('0x28')](respondWithStatusCode(_0x34b805,null))[_0x1926('0x5b')](handleError(_0x34b805,null));};exports[_0x1926('0x82')]=function(_0x840645,_0x54a97b,_0x2ebcfb){return db[_0x1926('0x76')]['findAll']({'where':{'id':_0x840645[_0x1926('0x49')][_0x1926('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1926('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54a97b,null))[_0x1926('0x28')](function(_0x39ef32){var _0x21a851=_['map'](_0x39ef32,'id');var _0x1a6b73=[];var _0x303489=[];var _0x5bd997=squel[_0x1926('0x83')]();_0x5bd997[_0x1926('0x84')](_0x1926('0x85'))['from'](_0x1926('0x86'),'tq')[_0x1926('0x87')](_0x1926('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1926('0x53')](_0x1926('0x89'),_0x840645[_0x1926('0x5c')]['id']);for(var _0x37a9e1=0x0;_0x37a9e1<_0x39ef32[_0x1926('0x5d')];_0x37a9e1+=0x1){let _0x4b1561=_0x39ef32[_0x37a9e1];for(var _0x3c1f59=0x0;_0x3c1f59<_0x4b1561['Agents'][_0x1926('0x5d')];_0x3c1f59+=0x1){let _0x24e53f=_0x4b1561[_0x1926('0x7a')][_0x3c1f59];var _0x171dc6=_0x5bd997['clone']();_0x171dc6[_0x1926('0x53')](_0x1926('0x8a'),_0x24e53f['id']);_0x303489[_0x1926('0x8b')](db['sequelize'][_0x1926('0x49')](_0x171dc6[_0x1926('0x8c')](),{'type':db[_0x1926('0x7c')][_0x1926('0x8d')]['SELECT']})[_0x1926('0x28')](function(_0x368c06){if(_0x368c06['length']===0x1){return _0x24e53f['id'];}else{var _0x1beda2=_[_0x1926('0x8e')](_[_0x1926('0x43')](_0x368c06,'TeamId'),function(_0x46142d){return _[_0x1926('0x8f')](_0x21a851,_0x46142d);});if(_0x1beda2){return _0x24e53f['id'];}}}));}}return BPromise['all'](_0x303489)[_0x1926('0x28')](function(_0x31be55){_0x1a6b73=_(_0x1a6b73)[_0x1926('0x90')](_0x31be55)[_0x1926('0x91')]()[_0x1926('0x92')]();return db['ChatQueue'][_0x1926('0x65')]({'where':{'id':_0x840645[_0x1926('0x5c')]['id']}})[_0x1926('0x28')](function(_0x143be1){return db[_0x1926('0x7c')][_0x1926('0x7d')](function(_0x42f63c){return _0x143be1['removeTeams'](_0x840645[_0x1926('0x49')][_0x1926('0x79')],{'transaction':_0x42f63c})['then'](function(){if(!_[_0x1926('0x93')](_0x1a6b73)){return _0x143be1[_0x1926('0x94')](_0x1a6b73,{'transaction':_0x42f63c});}})['then'](function(){_0x1a6b73[_0x1926('0x80')](function(_0x8ed21b){socket[_0x1926('0x95')]('userChatQueue:remove',{'UserId':_0x8ed21b,'ChatQueueId':_0x143be1['id']});});});});});});})[_0x1926('0x28')](respondWithStatusCode(_0x54a97b,null))[_0x1926('0x5b')](handleError(_0x54a97b,null));};exports[_0x1926('0x96')]=function(_0x1cfb64,_0x343e4a,_0x580a16){return db[_0x1926('0x44')]['find']({'where':{'id':_0x1cfb64[_0x1926('0x5c')]['id']}})[_0x1926('0x28')](handleEntityNotFound(_0x343e4a,null))['then'](function(_0x5ad1ff){if(_0x5ad1ff){return _0x5ad1ff[_0x1926('0x96')](_0x1cfb64[_0x1926('0x60')][_0x1926('0x79')],_[_0x1926('0x97')](_0x1cfb64[_0x1926('0x60')],[_0x1926('0x79'),'id'])||{})[_0x1926('0x98')](function(_0xfb7ef0){for(var _0x168b56=0x0;_0x168b56<_0x1cfb64['body'][_0x1926('0x79')][_0x1926('0x5d')];_0x168b56+=0x1){socket[_0x1926('0x95')]('userChatQueue:save',{'UserId':_0x1cfb64[_0x1926('0x60')][_0x1926('0x79')][_0x168b56],'ChatQueueId':_0x1cfb64[_0x1926('0x5c')]['id']});}return _0xfb7ef0;});}})['then'](respondWithResult(_0x343e4a,null))[_0x1926('0x5b')](handleError(_0x343e4a,null));};exports['removeAgents']=function(_0x212b25,_0x76681e,_0x45a949){return db[_0x1926('0x44')]['find']({'where':{'id':_0x212b25[_0x1926('0x5c')]['id']}})[_0x1926('0x28')](handleEntityNotFound(_0x76681e,null))[_0x1926('0x28')](function(_0x4a5536){if(_0x4a5536){return _0x4a5536[_0x1926('0x94')](_0x212b25[_0x1926('0x49')][_0x1926('0x79')])[_0x1926('0x28')](function(){if(_[_0x1926('0x99')](_0x212b25[_0x1926('0x49')]['ids'])){for(var _0x217639=0x0;_0x217639<_0x212b25[_0x1926('0x49')][_0x1926('0x79')]['length'];_0x217639+=0x1){socket[_0x1926('0x95')]('userChatQueue:remove',{'UserId':Number(_0x212b25[_0x1926('0x49')]['ids'][_0x217639]),'ChatQueueId':Number(_0x212b25[_0x1926('0x5c')]['id'])});}}else{socket[_0x1926('0x95')](_0x1926('0x9a'),{'UserId':Number(_0x212b25['query'][_0x1926('0x79')]),'ChatQueueId':Number(_0x212b25[_0x1926('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x76681e,null))['catch'](handleError(_0x76681e,null));};exports[_0x1926('0x9b')]=function(_0x3cf7f0,_0x33f66f,_0x2b6b17){var _0x1abfe7={};var _0x5c9b5b={};var _0x55c205;var _0x28e513;return db['ChatQueue'][_0x1926('0x6a')]({'where':{'id':_0x3cf7f0[_0x1926('0x5c')]['id']}})[_0x1926('0x28')](handleEntityNotFound(_0x33f66f,null))[_0x1926('0x28')](function(_0x1ede0d){if(_0x1ede0d){_0x55c205=_0x1ede0d;_0x5c9b5b[_0x1926('0x48')]=_[_0x1926('0x4a')](db[_0x1926('0x6d')][_0x1926('0x45')]);_0x5c9b5b[_0x1926('0x49')]=_[_0x1926('0x4a')](_0x3cf7f0['query']);_0x5c9b5b[_0x1926('0x4b')]=_['intersection'](_0x5c9b5b[_0x1926('0x48')],_0x5c9b5b[_0x1926('0x49')]);_0x1abfe7[_0x1926('0x4d')]=_[_0x1926('0x4c')](_0x5c9b5b[_0x1926('0x48')],qs[_0x1926('0x4e')](_0x3cf7f0[_0x1926('0x49')][_0x1926('0x4e')]));_0x1abfe7[_0x1926('0x4d')]=_0x1abfe7[_0x1926('0x4d')][_0x1926('0x5d')]?_0x1abfe7['attributes']:_0x5c9b5b[_0x1926('0x48')];_0x1abfe7[_0x1926('0x51')]=qs[_0x1926('0x52')](_0x3cf7f0[_0x1926('0x49')]['sort']);_0x1abfe7['where']=qs[_0x1926('0x4b')](_[_0x1926('0x54')](_0x3cf7f0[_0x1926('0x49')],_0x5c9b5b[_0x1926('0x4b')]));if(_0x3cf7f0[_0x1926('0x49')][_0x1926('0x55')]){_0x1abfe7[_0x1926('0x53')]=_['merge'](_0x1abfe7['where'],{'$or':_[_0x1926('0x43')](_0x1abfe7[_0x1926('0x4d')],function(_0x3541eb){var _0x5d6897={};_0x5d6897[_0x3541eb]={'$like':'%'+_0x3cf7f0[_0x1926('0x49')]['filter']+'%'};return _0x5d6897;})});}_0x1abfe7=_[_0x1926('0x57')]({},_0x1abfe7,_0x3cf7f0[_0x1926('0x58')]);return _0x55c205[_0x1926('0x9b')](_0x1abfe7);}})['then'](function(_0x268942){if(_0x268942){_0x28e513=_0x268942[_0x1926('0x5d')];if(!_0x3cf7f0[_0x1926('0x49')][_0x1926('0x4f')](_0x1926('0x50'))){_0x1abfe7[_0x1926('0x37')]=qs['limit'](_0x3cf7f0[_0x1926('0x49')][_0x1926('0x37')]);_0x1abfe7[_0x1926('0x36')]=qs[_0x1926('0x36')](_0x3cf7f0[_0x1926('0x49')][_0x1926('0x36')]);}return _0x55c205['getAgents'](_0x1abfe7);}})[_0x1926('0x28')](function(_0x536bdb){if(_0x536bdb){return _0x536bdb?{'count':_0x28e513,'rows':_0x536bdb}:null;}})['then'](respondWithResult(_0x33f66f,null))[_0x1926('0x5b')](handleError(_0x33f66f,null));}; \ No newline at end of file +var _0x83d0=['updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','ids','interface','flatMap','Agents','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','test','ValidationError','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','destroy','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','describe','getMembers','findOne','UserChatQueue','order','User','UserId','agent','chatPause'];(function(_0x222e91,_0x3a11f2){var _0x295e95=function(_0x1b55f2){while(--_0x1b55f2){_0x222e91['push'](_0x222e91['shift']());}};_0x295e95(++_0x3a11f2);}(_0x83d0,0xb7));var _0x083d=function(_0x4a2c81,_0x5e439b){_0x4a2c81=_0x4a2c81-0x0;var _0x1a5132=_0x83d0[_0x4a2c81];return _0x1a5132;};'use strict';var pdf=require(_0x083d('0x0'));var emlformat=require(_0x083d('0x1'));var rimraf=require(_0x083d('0x2'));var zipdir=require(_0x083d('0x3'));var jsonpatch=require(_0x083d('0x4'));var rp=require(_0x083d('0x5'));var moment=require('moment');var BPromise=require(_0x083d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x083d('0x7'));var sox=require(_0x083d('0x8'));var csv=require(_0x083d('0x9'));var ejs=require(_0x083d('0xa'));var fs=require('fs');var _=require(_0x083d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x083d('0xc'));var deskjs=require(_0x083d('0xd'));var toCsv=require(_0x083d('0x9'));var querystring=require('querystring');var Papa=require(_0x083d('0xe'));var Redis=require(_0x083d('0xf'));var authService=require(_0x083d('0x10'));var qs=require(_0x083d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x083d('0x12'));var logger=require('../../config/logger')(_0x083d('0x13'));var utils=require(_0x083d('0x14'));var config=require('../../config/environment');var db=require(_0x083d('0x15'))['db'];config[_0x083d('0x16')]=_[_0x083d('0x17')](config[_0x083d('0x16')],{'host':_0x083d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x083d('0x16')]));require(_0x083d('0x19'))['register'](socket);var jayson=require(_0x083d('0x1a'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4169ca,_0x3c95fe,_0x356d8e){if(_0x356d8e){var _0x20ca5f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20ca5f[_0x083d('0x1b')](_0x3c95fe)){return _0x4169ca;}else{throw new db['Sequelize'][(_0x083d('0x1c'))]('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 _0x4169ca;}}function respondWithRpcPromise(_0x206ff5,_0x28893f,_0x24708d,_0xb34759){return new BPromise(function(_0xdfd7de,_0x63c0b6){var _0x269a00=_0xb34759||client;return _0x269a00[_0x083d('0x1d')](_0x206ff5,_0x24708d)[_0x083d('0x1e')](function(_0x2cb79c){logger[_0x083d('0x1f')](_0x083d('0x20'),_0x28893f,'request\x20sent');logger[_0x083d('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x28893f,_0x083d('0x22'),JSON[_0x083d('0x23')](_0x2cb79c));if(_0x2cb79c['error']){if(_0x2cb79c[_0x083d('0x24')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x28893f,_0x2cb79c[_0x083d('0x24')][_0x083d('0x25')]);return _0x63c0b6(_0x2cb79c[_0x083d('0x24')][_0x083d('0x25')]);}logger[_0x083d('0x24')](_0x083d('0x20'),_0x28893f,_0x2cb79c['error'][_0x083d('0x25')]);return _0xdfd7de(_0x2cb79c[_0x083d('0x24')]['message']);}else{logger[_0x083d('0x1f')](_0x083d('0x20'),_0x28893f,_0x083d('0x22'));_0xdfd7de(_0x2cb79c[_0x083d('0x26')][_0x083d('0x25')]);}})[_0x083d('0x27')](function(_0x9bc640){logger[_0x083d('0x24')]('ChatQueue,\x20%s,\x20%s',_0x28893f,_0x9bc640);_0x63c0b6(_0x9bc640);});});}function respondWithStatusCode(_0x6bccbd,_0x50e5ae){_0x50e5ae=_0x50e5ae||0xcc;return function(_0x2252fa){if(_0x2252fa){return _0x6bccbd[_0x083d('0x28')](_0x50e5ae);}return _0x6bccbd[_0x083d('0x29')](_0x50e5ae)[_0x083d('0x2a')]();};}function respondWithResult(_0x3e59d0,_0x13c376){_0x13c376=_0x13c376||0xc8;return function(_0x2b4825){if(_0x2b4825){return _0x3e59d0[_0x083d('0x29')](_0x13c376)[_0x083d('0x2b')](_0x2b4825);}};}function respondWithFilteredResult(_0x3f41a4,_0x2d9202){return function(_0x24c32c){if(_0x24c32c){var _0x4588df=_0x24c32c[_0x083d('0x2c')],_0x2c7223=_0x2d9202[_0x083d('0x2d')],_0x28b90e=_0x2d9202['offset']+_0x2d9202['limit'],_0x563817;if(_0x28b90e>=_0x4588df){_0x28b90e=_0x4588df;_0x563817=0xc8;}else{_0x563817=0xce;}_0x3f41a4[_0x083d('0x29')](_0x563817);return _0x3f41a4['set'](_0x083d('0x2e'),_0x2c7223+'-'+_0x28b90e+'/'+_0x4588df)['json'](_0x24c32c);}return null;};}function patchUpdates(_0x1f1b76){return function(_0x59f1d5){try{jsonpatch[_0x083d('0x2f')](_0x59f1d5,_0x1f1b76,!![]);}catch(_0x46d991){return BPromise[_0x083d('0x30')](_0x46d991);}return _0x59f1d5['save']();};}function saveUpdates(_0x5e5e4e,_0x3563bf){return function(_0x484951){if(_0x484951){return _0x484951[_0x083d('0x31')](_0x5e5e4e)[_0x083d('0x1e')](function(_0x17a3e3){return _0x17a3e3;});}return null;};}function removeEntity(_0x3065c7,_0x4d76c7){return function(_0x44f40e){if(_0x44f40e){return _0x44f40e[_0x083d('0x32')]()[_0x083d('0x1e')](function(){var _0x30f4ad=_0x44f40e['get']({'plain':!![]});var _0x327c0b=_0x083d('0x33');return db[_0x083d('0x34')][_0x083d('0x32')]({'where':{'type':_0x327c0b,'resourceId':_0x30f4ad['id']}})['then'](function(){return _0x44f40e;});})['then'](function(){_0x3065c7[_0x083d('0x29')](0xcc)[_0x083d('0x2a')]();});}};}function handleEntityNotFound(_0x3b0025,_0x19d0d4){return function(_0x1d75ef){if(!_0x1d75ef){_0x3b0025['sendStatus'](0x194);}return _0x1d75ef;};}function handleError(_0x286204,_0xa590a){_0xa590a=_0xa590a||0x1f4;return function(_0x48bafb){logger[_0x083d('0x24')](_0x48bafb['stack']);if(_0x48bafb['name']){delete _0x48bafb[_0x083d('0x35')];}_0x286204[_0x083d('0x29')](_0xa590a)['send'](_0x48bafb);};}exports[_0x083d('0x36')]=function(_0x1b282f,_0x62f457){var _0x594327={},_0x5766d5={},_0x48e297={'count':0x0,'rows':[]};var _0x4b1268=_[_0x083d('0x37')](db[_0x083d('0x38')][_0x083d('0x39')],function(_0x236f7c){return{'name':_0x236f7c['fieldName'],'type':_0x236f7c[_0x083d('0x3a')][_0x083d('0x3b')]};});_0x5766d5['model']=_[_0x083d('0x37')](_0x4b1268,_0x083d('0x35'));_0x5766d5[_0x083d('0x3c')]=_[_0x083d('0x3d')](_0x1b282f[_0x083d('0x3c')]);_0x5766d5[_0x083d('0x3e')]=_[_0x083d('0x3f')](_0x5766d5[_0x083d('0x40')],_0x5766d5['query']);_0x594327[_0x083d('0x41')]=_[_0x083d('0x3f')](_0x5766d5[_0x083d('0x40')],qs[_0x083d('0x42')](_0x1b282f[_0x083d('0x3c')][_0x083d('0x42')]));_0x594327[_0x083d('0x41')]=_0x594327['attributes'][_0x083d('0x43')]?_0x594327[_0x083d('0x41')]:_0x5766d5['model'];if(!_0x1b282f[_0x083d('0x3c')][_0x083d('0x44')](_0x083d('0x45'))){_0x594327[_0x083d('0x46')]=qs[_0x083d('0x46')](_0x1b282f['query'][_0x083d('0x46')]);_0x594327[_0x083d('0x2d')]=qs[_0x083d('0x2d')](_0x1b282f[_0x083d('0x3c')][_0x083d('0x2d')]);}_0x594327['order']=qs[_0x083d('0x47')](_0x1b282f[_0x083d('0x3c')][_0x083d('0x47')]);_0x594327[_0x083d('0x48')]=qs[_0x083d('0x3e')](_[_0x083d('0x49')](_0x1b282f['query'],_0x5766d5[_0x083d('0x3e')]));if(_0x1b282f[_0x083d('0x3c')][_0x083d('0x4a')]){_0x594327[_0x083d('0x48')]=_[_0x083d('0x4b')](_0x594327[_0x083d('0x48')],{'$or':_[_0x083d('0x37')](_0x4b1268,function(_0x5465b9){if(_0x5465b9['type']!=='VIRTUAL'){var _0x1dee34={};_0x1dee34[_0x5465b9['name']]={'$like':'%'+_0x1b282f[_0x083d('0x3c')][_0x083d('0x4a')]+'%'};return _0x1dee34;}})});}_0x594327=_[_0x083d('0x4b')]({},_0x594327,_0x1b282f[_0x083d('0x4c')]);var _0x525dd9={'where':_0x594327[_0x083d('0x48')]};return db[_0x083d('0x38')][_0x083d('0x2c')](_0x525dd9)[_0x083d('0x1e')](function(_0x2a613d){_0x48e297['count']=_0x2a613d;if(_0x1b282f['query']['includeAll']){_0x594327[_0x083d('0x4d')]=[{'all':!![]}];}return db[_0x083d('0x38')][_0x083d('0x4e')](_0x594327);})[_0x083d('0x1e')](function(_0x1200a1){_0x48e297[_0x083d('0x4f')]=_0x1200a1;return _0x48e297;})[_0x083d('0x1e')](respondWithFilteredResult(_0x62f457,_0x594327))[_0x083d('0x27')](handleError(_0x62f457,null));};exports[_0x083d('0x50')]=function(_0x5a8620,_0x4cb4bb){var _0x33f3c8={'raw':!![],'where':{'id':_0x5a8620[_0x083d('0x51')]['id']}},_0x50cfac={};_0x50cfac[_0x083d('0x40')]=_[_0x083d('0x3d')](db[_0x083d('0x38')][_0x083d('0x39')]);_0x50cfac['query']=_[_0x083d('0x3d')](_0x5a8620['query']);_0x50cfac['filters']=_[_0x083d('0x3f')](_0x50cfac[_0x083d('0x40')],_0x50cfac[_0x083d('0x3c')]);_0x33f3c8[_0x083d('0x41')]=_[_0x083d('0x3f')](_0x50cfac[_0x083d('0x40')],qs[_0x083d('0x42')](_0x5a8620['query'][_0x083d('0x42')]));_0x33f3c8[_0x083d('0x41')]=_0x33f3c8[_0x083d('0x41')][_0x083d('0x43')]?_0x33f3c8[_0x083d('0x41')]:_0x50cfac[_0x083d('0x40')];if(_0x5a8620[_0x083d('0x3c')][_0x083d('0x52')]){_0x33f3c8['include']=[{'all':!![]}];}_0x33f3c8=_[_0x083d('0x4b')]({},_0x33f3c8,_0x5a8620[_0x083d('0x4c')]);return db[_0x083d('0x38')][_0x083d('0x53')](_0x33f3c8)[_0x083d('0x1e')](handleEntityNotFound(_0x4cb4bb,null))[_0x083d('0x1e')](respondWithResult(_0x4cb4bb,null))[_0x083d('0x27')](handleError(_0x4cb4bb,null));};exports[_0x083d('0x54')]=function(_0x1d11dd,_0x426946){return db[_0x083d('0x38')][_0x083d('0x54')](_0x1d11dd[_0x083d('0x55')],{})['then'](function(_0x5a0617){var _0x4280ee=_0x1d11dd[_0x083d('0x56')][_0x083d('0x57')]({'plain':!![]});if(!_0x4280ee)throw new Error(_0x083d('0x58'));if(_0x4280ee['role']===_0x083d('0x56')){var _0x14918f=_0x5a0617[_0x083d('0x57')]({'plain':!![]});var _0x3c305e=_0x083d('0x33');return db['UserProfileSection']['find']({'where':{'name':_0x3c305e,'userProfileId':_0x4280ee[_0x083d('0x59')]},'raw':!![]})[_0x083d('0x1e')](function(_0x2427a9){if(_0x2427a9&&_0x2427a9['autoAssociation']===0x0){return db[_0x083d('0x34')][_0x083d('0x54')]({'name':_0x14918f['name'],'resourceId':_0x14918f['id'],'type':_0x2427a9[_0x083d('0x35')],'sectionId':_0x2427a9['id']},{})[_0x083d('0x1e')](function(){return _0x5a0617;});}else{return _0x5a0617;}})['catch'](function(_0x1a6ddb){logger[_0x083d('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a6ddb);throw _0x1a6ddb;});}return _0x5a0617;})[_0x083d('0x1e')](respondWithResult(_0x426946,0xc9))[_0x083d('0x27')](handleError(_0x426946,null));};exports['update']=function(_0x59d099,_0x34fd8d){if(_0x59d099[_0x083d('0x55')]['id']){delete _0x59d099[_0x083d('0x55')]['id'];}return db[_0x083d('0x38')]['find']({'where':{'id':_0x59d099[_0x083d('0x51')]['id']}})[_0x083d('0x1e')](handleEntityNotFound(_0x34fd8d,null))[_0x083d('0x1e')](saveUpdates(_0x59d099['body'],null))[_0x083d('0x1e')](respondWithResult(_0x34fd8d,null))[_0x083d('0x27')](handleError(_0x34fd8d,null));};exports[_0x083d('0x32')]=function(_0x3ac74e,_0x56c903){return db['ChatQueue'][_0x083d('0x53')]({'where':{'id':_0x3ac74e[_0x083d('0x51')]['id']}})['then'](handleEntityNotFound(_0x56c903,null))[_0x083d('0x1e')](removeEntity(_0x56c903,null))[_0x083d('0x27')](handleError(_0x56c903,null));};exports[_0x083d('0x5a')]=function(_0x3fc931,_0x7f378e){return db['ChatQueue'][_0x083d('0x5a')]()[_0x083d('0x1e')](respondWithResult(_0x7f378e,null))[_0x083d('0x27')](handleError(_0x7f378e,null));};exports[_0x083d('0x5b')]=function(_0x8cadd9,_0x1992f5,_0x3d6af8){var _0x26c721={'raw':!![],'where':{}},_0x4e4543={},_0x139c02;return db[_0x083d('0x38')][_0x083d('0x5c')]({'where':{'id':_0x8cadd9['params']['id']}})['then'](handleEntityNotFound(_0x1992f5,null))[_0x083d('0x1e')](function(_0x43298f){if(_0x43298f){_0x139c02=_0x43298f[_0x083d('0x57')]({'plain':!![]});_0x4e4543[_0x083d('0x40')]=_['keys'](db[_0x083d('0x5d')]['rawAttributes']);_0x4e4543['query']=_[_0x083d('0x3d')](_0x8cadd9[_0x083d('0x3c')]);_0x4e4543[_0x083d('0x3e')]=_[_0x083d('0x3f')](_0x4e4543[_0x083d('0x40')],_0x4e4543[_0x083d('0x3c')]);_0x26c721[_0x083d('0x41')]=_[_0x083d('0x3f')](_0x4e4543[_0x083d('0x40')],qs[_0x083d('0x42')](_0x8cadd9[_0x083d('0x3c')]['fields']));_0x26c721[_0x083d('0x41')]=_0x26c721['attributes']['length']?_0x26c721[_0x083d('0x41')]:_0x4e4543[_0x083d('0x40')];if(!_0x8cadd9[_0x083d('0x3c')][_0x083d('0x44')]('nolimit')){_0x26c721['limit']=qs[_0x083d('0x46')](_0x8cadd9[_0x083d('0x3c')][_0x083d('0x46')]);_0x26c721['offset']=qs[_0x083d('0x2d')](_0x8cadd9[_0x083d('0x3c')]['offset']);}_0x26c721[_0x083d('0x5e')]=qs[_0x083d('0x47')](_0x8cadd9[_0x083d('0x3c')][_0x083d('0x47')]);_0x26c721[_0x083d('0x48')]=qs[_0x083d('0x3e')](_['pick'](_0x8cadd9[_0x083d('0x3c')],_0x4e4543['filters']));_0x26c721[_0x083d('0x48')]['ChatQueueId']=_0x43298f['id'];if(_0x8cadd9['query'][_0x083d('0x4a')]){_0x26c721['where']=_[_0x083d('0x4b')](_0x26c721[_0x083d('0x48')],{'$or':_[_0x083d('0x37')](_0x26c721[_0x083d('0x41')],function(_0x495c48){var _0xf30be3={};_0xf30be3[_0x495c48]={'$like':'%'+_0x8cadd9[_0x083d('0x3c')][_0x083d('0x4a')]+'%'};return _0xf30be3;})});}_0x26c721=_[_0x083d('0x4b')]({},_0x26c721,_0x8cadd9[_0x083d('0x4c')]);return db[_0x083d('0x5d')]['findAll'](_0x26c721);}})[_0x083d('0x1e')](function(_0x30c8fa){if(_0x30c8fa){return db[_0x083d('0x5f')]['findAndCountAll']({'where':{'id':_[_0x083d('0x37')](_0x30c8fa,_0x083d('0x60')),'role':_0x083d('0x61')},'attributes':['id',_0x083d('0x35'),_0x083d('0x62'),_0x083d('0x63'),'createdAt']});}})[_0x083d('0x1e')](function(_0x40b1f0){if(_0x40b1f0){return{'count':_0x40b1f0['count'],'rows':_[_0x083d('0x37')](_0x40b1f0[_0x083d('0x4f')],function(_0x3f8522){return{'membername':_0x3f8522['name'],'UserId':_0x3f8522['id'],'queue_name':_0x139c02[_0x083d('0x35')],'ChatQueueId':_0x139c02['id'],'interface':util[_0x083d('0x64')]('%s/%s',_0x083d('0x65'),_0x3f8522['name']),'penalty':0x0,'paused':_0x3f8522[_0x083d('0x62')],'createdAt':_0x3f8522[_0x083d('0x66')],'updatedAt':_0x3f8522[_0x083d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x083d('0x1e')](respondWithFilteredResult(_0x1992f5,_0x26c721))['catch'](handleError(_0x1992f5,null));};exports[_0x083d('0x67')]=function(_0x497e38,_0x3f75a4,_0x1502db){var _0x5cc362={};var _0x7a55={};var _0x3c8e8c;var _0x1dc7e0;return db[_0x083d('0x38')]['findOne']({'where':{'id':_0x497e38['params']['id']}})['then'](handleEntityNotFound(_0x3f75a4,null))[_0x083d('0x1e')](function(_0x5a0283){if(_0x5a0283){_0x3c8e8c=_0x5a0283;_0x7a55[_0x083d('0x40')]=_['keys'](db[_0x083d('0x68')][_0x083d('0x39')]);_0x7a55[_0x083d('0x3c')]=_[_0x083d('0x3d')](_0x497e38[_0x083d('0x3c')]);_0x7a55[_0x083d('0x3e')]=_[_0x083d('0x3f')](_0x7a55[_0x083d('0x40')],_0x7a55['query']);_0x5cc362[_0x083d('0x41')]=_[_0x083d('0x3f')](_0x7a55['model'],qs[_0x083d('0x42')](_0x497e38[_0x083d('0x3c')][_0x083d('0x42')]));_0x5cc362[_0x083d('0x41')]=_0x5cc362[_0x083d('0x41')][_0x083d('0x43')]?_0x5cc362['attributes']:_0x7a55[_0x083d('0x40')];_0x5cc362[_0x083d('0x5e')]=qs['sort'](_0x497e38['query'][_0x083d('0x47')]);_0x5cc362[_0x083d('0x48')]=qs[_0x083d('0x3e')](_[_0x083d('0x49')](_0x497e38['query'],_0x7a55[_0x083d('0x3e')]));if(_0x497e38[_0x083d('0x3c')][_0x083d('0x4a')]){_0x5cc362[_0x083d('0x48')]=_['merge'](_0x5cc362['where'],{'$or':_['map'](_0x5cc362['attributes'],function(_0x3cae5c){var _0x12cf61={};_0x12cf61[_0x3cae5c]={'$like':'%'+_0x497e38[_0x083d('0x3c')][_0x083d('0x4a')]+'%'};return _0x12cf61;})});}_0x5cc362=_[_0x083d('0x4b')]({},_0x5cc362,_0x497e38[_0x083d('0x4c')]);return _0x3c8e8c[_0x083d('0x67')](_0x5cc362);}})[_0x083d('0x1e')](function(_0x5164ea){if(_0x5164ea){_0x1dc7e0=_0x5164ea['length'];if(!_0x497e38[_0x083d('0x3c')][_0x083d('0x44')](_0x083d('0x45'))){_0x5cc362[_0x083d('0x46')]=qs[_0x083d('0x46')](_0x497e38[_0x083d('0x3c')]['limit']);_0x5cc362[_0x083d('0x2d')]=qs[_0x083d('0x2d')](_0x497e38[_0x083d('0x3c')][_0x083d('0x2d')]);}return _0x3c8e8c[_0x083d('0x67')](_0x5cc362);}})[_0x083d('0x1e')](function(_0x1e75d9){if(_0x1e75d9){return _0x1e75d9?{'count':_0x1dc7e0,'rows':_0x1e75d9}:null;}})[_0x083d('0x1e')](respondWithResult(_0x3f75a4,null))[_0x083d('0x27')](handleError(_0x3f75a4,null));};exports[_0x083d('0x69')]=function(_0x451834,_0x599024,_0x4ae132){var _0x28895b=_0x451834['body'][_0x083d('0x6a')];return db[_0x083d('0x68')][_0x083d('0x4e')]({'where':{'id':_0x28895b},'attributes':['id'],'include':[{'model':db[_0x083d('0x5f')],'as':'Agents','attributes':['id','name','online','voicePause',_0x083d('0x6b')],'raw':!![]}]})[_0x083d('0x1e')](function(_0x123b0e){if(_0x123b0e){var _0x44fd26=_[_0x083d('0x6c')](_0x123b0e,function(_0x374d47){var _0x1e4508=_0x374d47['get']({'plain':!![]});return _0x1e4508[_0x083d('0x6d')];});return db['ChatQueue'][_0x083d('0x53')]({'where':{'id':_0x451834[_0x083d('0x51')]['id']}})[_0x083d('0x1e')](function(_0x40cd0){return db['sequelize']['transaction'](function(_0x1cbed9){return _0x40cd0[_0x083d('0x69')](_0x28895b,{'transaction':_0x1cbed9})[_0x083d('0x1e')](function(){return BPromise[_0x083d('0x6e')](_0x44fd26,function(_0x5de006){return db[_0x083d('0x5d')][_0x083d('0x6f')]({'where':{'UserId':_0x5de006['id'],'ChatQueueId':_0x451834[_0x083d('0x51')]['id']},'transaction':_0x1cbed9});});})['then'](function(){_0x44fd26['forEach'](function(_0x2a862d){socket[_0x083d('0x70')](_0x083d('0x71'),{'UserId':_0x2a862d['id'],'ChatQueueId':_0x40cd0['id']});});});});});}})[_0x083d('0x1e')](respondWithStatusCode(_0x599024,null))['catch'](handleError(_0x599024,null));};exports[_0x083d('0x72')]=function(_0x401a60,_0x177536,_0x41fb77){return db[_0x083d('0x68')][_0x083d('0x4e')]({'where':{'id':_0x401a60[_0x083d('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x083d('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x083d('0x1e')](handleEntityNotFound(_0x177536,null))[_0x083d('0x1e')](function(_0x1a0380){var _0x3f105e=_[_0x083d('0x37')](_0x1a0380,'id');var _0x4ff38f=[];var _0x314259=[];var _0xb06fbc=squel[_0x083d('0x73')]();_0xb06fbc[_0x083d('0x74')](_0x083d('0x75'))[_0x083d('0x76')](_0x083d('0x77'),'tq')['join'](_0x083d('0x78'),'ut',_0x083d('0x79'))['where'](_0x083d('0x7a'),_0x401a60[_0x083d('0x51')]['id']);for(var _0x1075c7=0x0;_0x1075c7<_0x1a0380[_0x083d('0x43')];_0x1075c7+=0x1){let _0x19eef3=_0x1a0380[_0x1075c7];for(var _0x552a67=0x0;_0x552a67<_0x19eef3[_0x083d('0x6d')][_0x083d('0x43')];_0x552a67+=0x1){let _0x516150=_0x19eef3[_0x083d('0x6d')][_0x552a67];var _0x592553=_0xb06fbc[_0x083d('0x7b')]();_0x592553[_0x083d('0x48')](_0x083d('0x7c'),_0x516150['id']);_0x314259['push'](db[_0x083d('0x7d')][_0x083d('0x3c')](_0x592553['toString'](),{'type':db[_0x083d('0x7d')][_0x083d('0x7e')][_0x083d('0x7f')]})[_0x083d('0x1e')](function(_0x21bd54){if(_0x21bd54[_0x083d('0x43')]===0x1){return _0x516150['id'];}else{var _0x12c819=_[_0x083d('0x80')](_['map'](_0x21bd54,'TeamId'),function(_0x151dde){return _[_0x083d('0x81')](_0x3f105e,_0x151dde);});if(_0x12c819){return _0x516150['id'];}}}));}}return BPromise[_0x083d('0x82')](_0x314259)['then'](function(_0x4d51fc){_0x4ff38f=_(_0x4ff38f)[_0x083d('0x83')](_0x4d51fc)['compact']()[_0x083d('0x84')]();return db['ChatQueue']['find']({'where':{'id':_0x401a60['params']['id']}})[_0x083d('0x1e')](function(_0x179bf8){return db[_0x083d('0x7d')]['transaction'](function(_0x367d8d){return _0x179bf8[_0x083d('0x72')](_0x401a60['query'][_0x083d('0x6a')],{'transaction':_0x367d8d})['then'](function(){if(!_[_0x083d('0x85')](_0x4ff38f)){return _0x179bf8[_0x083d('0x86')](_0x4ff38f,{'transaction':_0x367d8d});}})[_0x083d('0x1e')](function(){_0x4ff38f['forEach'](function(_0x56a187){socket['emit'](_0x083d('0x87'),{'UserId':_0x56a187,'ChatQueueId':_0x179bf8['id']});});});});});});})[_0x083d('0x1e')](respondWithStatusCode(_0x177536,null))[_0x083d('0x27')](handleError(_0x177536,null));};exports[_0x083d('0x88')]=function(_0x459c72,_0xf18962,_0xde1079){return db[_0x083d('0x38')][_0x083d('0x53')]({'where':{'id':_0x459c72[_0x083d('0x51')]['id']}})['then'](handleEntityNotFound(_0xf18962,null))[_0x083d('0x1e')](function(_0x1e0024){if(_0x1e0024){return _0x1e0024['addAgents'](_0x459c72['body'][_0x083d('0x6a')],_[_0x083d('0x89')](_0x459c72[_0x083d('0x55')],[_0x083d('0x6a'),'id'])||{})[_0x083d('0x8a')](function(_0x316cbc){for(var _0x4a6fb8=0x0;_0x4a6fb8<_0x459c72['body'][_0x083d('0x6a')][_0x083d('0x43')];_0x4a6fb8+=0x1){socket[_0x083d('0x70')]('userChatQueue:save',{'UserId':_0x459c72[_0x083d('0x55')][_0x083d('0x6a')][_0x4a6fb8],'ChatQueueId':_0x459c72[_0x083d('0x51')]['id']});}return _0x316cbc;});}})[_0x083d('0x1e')](respondWithResult(_0xf18962,null))[_0x083d('0x27')](handleError(_0xf18962,null));};exports[_0x083d('0x86')]=function(_0x92715f,_0x543367,_0x1fa4ad){return db[_0x083d('0x38')]['find']({'where':{'id':_0x92715f[_0x083d('0x51')]['id']}})['then'](handleEntityNotFound(_0x543367,null))[_0x083d('0x1e')](function(_0x47f5f3){if(_0x47f5f3){return _0x47f5f3[_0x083d('0x86')](_0x92715f['query'][_0x083d('0x6a')])['then'](function(){if(_[_0x083d('0x8b')](_0x92715f[_0x083d('0x3c')][_0x083d('0x6a')])){for(var _0x2f5646=0x0;_0x2f5646<_0x92715f[_0x083d('0x3c')]['ids'][_0x083d('0x43')];_0x2f5646+=0x1){socket[_0x083d('0x70')]('userChatQueue:remove',{'UserId':Number(_0x92715f[_0x083d('0x3c')][_0x083d('0x6a')][_0x2f5646]),'ChatQueueId':Number(_0x92715f[_0x083d('0x51')]['id'])});}}else{socket['emit'](_0x083d('0x87'),{'UserId':Number(_0x92715f[_0x083d('0x3c')]['ids']),'ChatQueueId':Number(_0x92715f[_0x083d('0x51')]['id'])});}});}})[_0x083d('0x1e')](respondWithStatusCode(_0x543367,null))[_0x083d('0x27')](handleError(_0x543367,null));};exports[_0x083d('0x8c')]=function(_0x2f9741,_0x483122,_0x1b072a){var _0x4a51c4={};var _0x16ee83={};var _0x38e07e;var _0x3b0c46;return db[_0x083d('0x38')]['findOne']({'where':{'id':_0x2f9741[_0x083d('0x51')]['id']}})[_0x083d('0x1e')](handleEntityNotFound(_0x483122,null))[_0x083d('0x1e')](function(_0x7e5351){if(_0x7e5351){_0x38e07e=_0x7e5351;_0x16ee83[_0x083d('0x40')]=_[_0x083d('0x3d')](db[_0x083d('0x5f')][_0x083d('0x39')]);_0x16ee83[_0x083d('0x3c')]=_[_0x083d('0x3d')](_0x2f9741[_0x083d('0x3c')]);_0x16ee83[_0x083d('0x3e')]=_['intersection'](_0x16ee83[_0x083d('0x40')],_0x16ee83[_0x083d('0x3c')]);_0x4a51c4['attributes']=_[_0x083d('0x3f')](_0x16ee83[_0x083d('0x40')],qs['fields'](_0x2f9741[_0x083d('0x3c')][_0x083d('0x42')]));_0x4a51c4[_0x083d('0x41')]=_0x4a51c4['attributes']['length']?_0x4a51c4[_0x083d('0x41')]:_0x16ee83['model'];_0x4a51c4[_0x083d('0x5e')]=qs[_0x083d('0x47')](_0x2f9741['query'][_0x083d('0x47')]);_0x4a51c4[_0x083d('0x48')]=qs[_0x083d('0x3e')](_[_0x083d('0x49')](_0x2f9741[_0x083d('0x3c')],_0x16ee83[_0x083d('0x3e')]));if(_0x2f9741[_0x083d('0x3c')][_0x083d('0x4a')]){_0x4a51c4[_0x083d('0x48')]=_[_0x083d('0x4b')](_0x4a51c4['where'],{'$or':_[_0x083d('0x37')](_0x4a51c4[_0x083d('0x41')],function(_0x15e868){var _0x3958f7={};_0x3958f7[_0x15e868]={'$like':'%'+_0x2f9741[_0x083d('0x3c')][_0x083d('0x4a')]+'%'};return _0x3958f7;})});}_0x4a51c4=_[_0x083d('0x4b')]({},_0x4a51c4,_0x2f9741['options']);return _0x38e07e[_0x083d('0x8c')](_0x4a51c4);}})['then'](function(_0x53c18c){if(_0x53c18c){_0x3b0c46=_0x53c18c[_0x083d('0x43')];if(!_0x2f9741['query'][_0x083d('0x44')](_0x083d('0x45'))){_0x4a51c4[_0x083d('0x46')]=qs[_0x083d('0x46')](_0x2f9741[_0x083d('0x3c')][_0x083d('0x46')]);_0x4a51c4[_0x083d('0x2d')]=qs[_0x083d('0x2d')](_0x2f9741[_0x083d('0x3c')]['offset']);}return _0x38e07e['getAgents'](_0x4a51c4);}})[_0x083d('0x1e')](function(_0x35b5d3){if(_0x35b5d3){return _0x35b5d3?{'count':_0x3b0c46,'rows':_0x35b5d3}:null;}})[_0x083d('0x1e')](respondWithResult(_0x483122,null))[_0x083d('0x27')](handleError(_0x483122,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 5a02580..513fb3c 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 _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x21d8d2,_0x56bc94){var _0x4f6e55=function(_0x1818f1){while(--_0x1818f1){_0x21d8d2['push'](_0x21d8d2['shift']());}};_0x4f6e55(++_0x56bc94);}(_0x0b0e,0x187));var _0xe0b0=function(_0xa7d678,_0x3dfdff){_0xa7d678=_0xa7d678-0x0;var _0x5cc539=_0x0b0e[_0xa7d678];return _0x5cc539;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x42875f,_0x21ed01){var _0x13b646=function(_0x5b178a){while(--_0x5b178a){_0x42875f['push'](_0x42875f['shift']());}};_0x13b646(++_0x21ed01);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a16aa,_0x46f661){_0x4a16aa=_0x4a16aa-0x0;var _0x4e9af4=_0xb10b[_0x4a16aa];return _0x4e9af4;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 2cb0bca..c150410 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 _0x3eaf=['ChatQueue','lodash','../../config/logger','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eaf,0x160));var _0xf3ea=function(_0x4a0459,_0x45b700){_0x4a0459=_0x4a0459-0x0;var _0xdb028=_0x3eaf[_0x4a0459];return _0xdb028;};'use strict';var _=require(_0xf3ea('0x0'));var util=require('util');var logger=require(_0xf3ea('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3ea('0x2'));var rimraf=require(_0xf3ea('0x3'));var config=require(_0xf3ea('0x4'));var attributes=require(_0xf3ea('0x5'));module[_0xf3ea('0x6')]=function(_0x256575,_0xc0a126){return _0x256575[_0xf3ea('0x7')](_0xf3ea('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa829=['../../config/logger','api','bluebird','request-promise','rimraf','./chatQueue.attributes','define','lodash','util'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa829,0x181));var _0x9a82=function(_0x407fc4,_0x1acabc){_0x407fc4=_0x407fc4-0x0;var _0x5144a5=_0xa829[_0x407fc4];return _0x5144a5;};'use strict';var _=require(_0x9a82('0x0'));var util=require(_0x9a82('0x1'));var logger=require(_0x9a82('0x2'))(_0x9a82('0x3'));var moment=require('moment');var BPromise=require(_0x9a82('0x4'));var rp=require(_0x9a82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a82('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a82('0x7'));module['exports']=function(_0x5b9f07,_0x1260f6){return _0x5b9f07[_0x9a82('0x8')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index d1e165a..aaa7dce 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 _0x199c=['attributes','limit','include','map','model','raw','where','info','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','./chatQueue.socket','register','request','then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x61919b,_0x1f5bfd){var _0x1004ce=function(_0x28a301){while(--_0x28a301){_0x61919b['push'](_0x61919b['shift']());}};_0x1004ce(++_0x1f5bfd);}(_0x199c,0x7b));var _0xc199=function(_0x276d4a,_0x4ebdef){_0x276d4a=_0x276d4a-0x0;var _0x4b0e3e=_0x199c[_0x276d4a];return _0x4b0e3e;};'use strict';var _=require(_0xc199('0x0'));var util=require(_0xc199('0x1'));var moment=require(_0xc199('0x2'));var BPromise=require('bluebird');var rs=require(_0xc199('0x3'));var fs=require('fs');var Redis=require(_0xc199('0x4'));var db=require(_0xc199('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc199('0x6'));var config=require(_0xc199('0x7'));var jayson=require(_0xc199('0x8'));var client=jayson[_0xc199('0x9')][_0xc199('0xa')]({'port':0x232a});config[_0xc199('0xb')]=_['defaults'](config[_0xc199('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc199('0xc'))[_0xc199('0xd')](socket);function respondWithRpcPromise(_0xc971a8,_0x4b472c,_0x35f923){return new BPromise(function(_0x44db95,_0x596249){return client[_0xc199('0xe')](_0xc971a8,_0x35f923)[_0xc199('0xf')](function(_0x3b7ec6){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4b472c,'request\x20sent');logger[_0xc199('0x10')](_0xc199('0x11'),_0x4b472c,_0xc199('0x12'),JSON[_0xc199('0x13')](_0x3b7ec6));if(_0x3b7ec6[_0xc199('0x14')]){if(_0x3b7ec6[_0xc199('0x14')][_0xc199('0x15')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4b472c,_0x3b7ec6[_0xc199('0x14')][_0xc199('0x16')]);return _0x596249(_0x3b7ec6[_0xc199('0x14')][_0xc199('0x16')]);}logger[_0xc199('0x14')](_0xc199('0x17'),_0x4b472c,_0x3b7ec6['error'][_0xc199('0x16')]);return _0x44db95(_0x3b7ec6[_0xc199('0x14')][_0xc199('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4b472c,_0xc199('0x12'));_0x44db95(_0x3b7ec6['result']['message']);}})[_0xc199('0x18')](function(_0x488501){logger[_0xc199('0x14')](_0xc199('0x17'),_0x4b472c,_0x488501);_0x596249(_0x488501);});});}exports[_0xc199('0x19')]=function(_0x3f5506){var _0x1478b2=this;return new Promise(function(_0x24d50c,_0x2fb987){return db[_0xc199('0x1a')][_0xc199('0x1b')]({'raw':_0x3f5506['options']?_0x3f5506[_0xc199('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3f5506[_0xc199('0x1c')]?_0x3f5506[_0xc199('0x1c')]['where']||null:null,'attributes':_0x3f5506[_0xc199('0x1c')]?_0x3f5506['options'][_0xc199('0x1d')]||null:null,'limit':_0x3f5506[_0xc199('0x1c')]?_0x3f5506[_0xc199('0x1c')][_0xc199('0x1e')]||null:null,'include':_0x3f5506[_0xc199('0x1c')]?_0x3f5506[_0xc199('0x1c')][_0xc199('0x1f')]?_[_0xc199('0x20')](_0x3f5506['options'][_0xc199('0x1f')],function(_0x2626fc){return{'model':db[_0x2626fc[_0xc199('0x21')]],'as':_0x2626fc['as'],'attributes':_0x2626fc[_0xc199('0x1d')],'include':_0x2626fc[_0xc199('0x1f')]?_[_0xc199('0x20')](_0x2626fc[_0xc199('0x1f')],function(_0x526d72){return{'model':db[_0x526d72[_0xc199('0x21')]],'as':_0x526d72['as'],'attributes':_0x526d72[_0xc199('0x1d')],'include':_0x526d72[_0xc199('0x1f')]?_[_0xc199('0x20')](_0x526d72[_0xc199('0x1f')],function(_0x2dbaaf){return{'model':db[_0x2dbaaf[_0xc199('0x21')]],'as':_0x2dbaaf['as'],'attributes':_0x2dbaaf[_0xc199('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc199('0xf')](function(_0xf16093){logger['info']('GetChatQueue',_0x3f5506);logger[_0xc199('0x10')]('GetChatQueue',_0x3f5506,JSON['stringify'](_0xf16093));_0x24d50c(_0xf16093);})[_0xc199('0x18')](function(_0x5f15e9){logger['error'](_0xc199('0x19'),_0x5f15e9[_0xc199('0x16')],_0x3f5506);_0x2fb987(_0x1478b2[_0xc199('0x14')](0x1f4,_0x5f15e9[_0xc199('0x16')]));});});};exports['ShowChatQueue']=function(_0x42be5d){var _0x59a193=this;return new Promise(function(_0xbd6526,_0x43743d){return db['ChatQueue']['find']({'raw':_0x42be5d[_0xc199('0x1c')]?_0x42be5d[_0xc199('0x1c')][_0xc199('0x22')]===undefined?!![]:![]:!![],'where':_0x42be5d[_0xc199('0x1c')]?_0x42be5d[_0xc199('0x1c')][_0xc199('0x23')]||null:null,'attributes':_0x42be5d['options']?_0x42be5d[_0xc199('0x1c')][_0xc199('0x1d')]||null:null,'include':_0x42be5d[_0xc199('0x1c')]?_0x42be5d[_0xc199('0x1c')]['include']?_['map'](_0x42be5d['options'][_0xc199('0x1f')],function(_0x181abc){return{'model':db[_0x181abc[_0xc199('0x21')]],'as':_0x181abc['as'],'attributes':_0x181abc[_0xc199('0x1d')],'include':_0x181abc['include']?_[_0xc199('0x20')](_0x181abc[_0xc199('0x1f')],function(_0x30b211){return{'model':db[_0x30b211[_0xc199('0x21')]],'as':_0x30b211['as'],'attributes':_0x30b211[_0xc199('0x1d')],'include':_0x30b211['include']?_[_0xc199('0x20')](_0x30b211[_0xc199('0x1f')],function(_0xdc8ac2){return{'model':db[_0xdc8ac2[_0xc199('0x21')]],'as':_0xdc8ac2['as'],'attributes':_0xdc8ac2[_0xc199('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc199('0xf')](function(_0x10a077){logger[_0xc199('0x24')]('ShowChatQueue',_0x42be5d);logger[_0xc199('0x10')](_0xc199('0x25'),_0x42be5d,JSON['stringify'](_0x10a077));_0xbd6526(_0x10a077);})[_0xc199('0x18')](function(_0x5742a9){logger[_0xc199('0x14')](_0xc199('0x25'),_0x5742a9['message'],_0x42be5d);_0x43743d(_0x59a193['error'](0x1f4,_0x5742a9[_0xc199('0x16')]));});});}; \ No newline at end of file +var _0x3ce9=['result','catch','ChatQueue','findAll','options','where','attributes','limit','include','map','model','then','GetChatQueue','ShowChatQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatQueue.socket','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3ce9,0x85));var _0x93ce=function(_0x458b85,_0x2c070f){_0x458b85=_0x458b85-0x0;var _0x5cdc17=_0x3ce9[_0x458b85];return _0x5cdc17;};'use strict';var _=require(_0x93ce('0x0'));var util=require('util');var moment=require(_0x93ce('0x1'));var BPromise=require(_0x93ce('0x2'));var rs=require(_0x93ce('0x3'));var fs=require('fs');var Redis=require(_0x93ce('0x4'));var db=require(_0x93ce('0x5'))['db'];var utils=require(_0x93ce('0x6'));var logger=require('../../config/logger')(_0x93ce('0x7'));var config=require(_0x93ce('0x8'));var jayson=require(_0x93ce('0x9'));var client=jayson[_0x93ce('0xa')][_0x93ce('0xb')]({'port':0x232a});config['redis']=_[_0x93ce('0xc')](config[_0x93ce('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x93ce('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e3e58,_0x5129b4,_0x3ec30c){return new BPromise(function(_0x5a125f,_0x354cad){return client['request'](_0x2e3e58,_0x3ec30c)['then'](function(_0x50240b){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5129b4,_0x93ce('0xf'));logger[_0x93ce('0x10')](_0x93ce('0x11'),_0x5129b4,'request\x20sent',JSON[_0x93ce('0x12')](_0x50240b));if(_0x50240b['error']){if(_0x50240b[_0x93ce('0x13')][_0x93ce('0x14')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5129b4,_0x50240b[_0x93ce('0x13')]['message']);return _0x354cad(_0x50240b[_0x93ce('0x13')]['message']);}logger[_0x93ce('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5129b4,_0x50240b[_0x93ce('0x13')][_0x93ce('0x15')]);return _0x5a125f(_0x50240b[_0x93ce('0x13')][_0x93ce('0x15')]);}else{logger[_0x93ce('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5129b4,_0x93ce('0xf'));_0x5a125f(_0x50240b[_0x93ce('0x17')][_0x93ce('0x15')]);}})[_0x93ce('0x18')](function(_0x2071ac){logger[_0x93ce('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5129b4,_0x2071ac);_0x354cad(_0x2071ac);});});}exports['GetChatQueue']=function(_0x10cdb5){var _0x31d670=this;return new Promise(function(_0x11c534,_0x1b46a4){return db[_0x93ce('0x19')][_0x93ce('0x1a')]({'raw':_0x10cdb5[_0x93ce('0x1b')]?_0x10cdb5[_0x93ce('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x10cdb5[_0x93ce('0x1b')]?_0x10cdb5[_0x93ce('0x1b')][_0x93ce('0x1c')]||null:null,'attributes':_0x10cdb5[_0x93ce('0x1b')]?_0x10cdb5['options'][_0x93ce('0x1d')]||null:null,'limit':_0x10cdb5['options']?_0x10cdb5[_0x93ce('0x1b')][_0x93ce('0x1e')]||null:null,'include':_0x10cdb5['options']?_0x10cdb5[_0x93ce('0x1b')][_0x93ce('0x1f')]?_[_0x93ce('0x20')](_0x10cdb5[_0x93ce('0x1b')][_0x93ce('0x1f')],function(_0x6bf185){return{'model':db[_0x6bf185[_0x93ce('0x21')]],'as':_0x6bf185['as'],'attributes':_0x6bf185[_0x93ce('0x1d')],'include':_0x6bf185['include']?_[_0x93ce('0x20')](_0x6bf185[_0x93ce('0x1f')],function(_0x2dabdc){return{'model':db[_0x2dabdc['model']],'as':_0x2dabdc['as'],'attributes':_0x2dabdc[_0x93ce('0x1d')],'include':_0x2dabdc[_0x93ce('0x1f')]?_[_0x93ce('0x20')](_0x2dabdc[_0x93ce('0x1f')],function(_0x2dc0ff){return{'model':db[_0x2dc0ff['model']],'as':_0x2dc0ff['as'],'attributes':_0x2dc0ff[_0x93ce('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x93ce('0x22')](function(_0x165873){logger['info'](_0x93ce('0x23'),_0x10cdb5);logger[_0x93ce('0x10')](_0x93ce('0x23'),_0x10cdb5,JSON[_0x93ce('0x12')](_0x165873));_0x11c534(_0x165873);})['catch'](function(_0x15c77b){logger[_0x93ce('0x13')](_0x93ce('0x23'),_0x15c77b[_0x93ce('0x15')],_0x10cdb5);_0x1b46a4(_0x31d670[_0x93ce('0x13')](0x1f4,_0x15c77b['message']));});});};exports[_0x93ce('0x24')]=function(_0x578a3f){var _0x38adbc=this;return new Promise(function(_0x2aa769,_0x50e5d0){return db[_0x93ce('0x19')][_0x93ce('0x25')]({'raw':_0x578a3f[_0x93ce('0x1b')]?_0x578a3f[_0x93ce('0x1b')][_0x93ce('0x26')]===undefined?!![]:![]:!![],'where':_0x578a3f[_0x93ce('0x1b')]?_0x578a3f[_0x93ce('0x1b')]['where']||null:null,'attributes':_0x578a3f['options']?_0x578a3f[_0x93ce('0x1b')][_0x93ce('0x1d')]||null:null,'include':_0x578a3f[_0x93ce('0x1b')]?_0x578a3f[_0x93ce('0x1b')][_0x93ce('0x1f')]?_[_0x93ce('0x20')](_0x578a3f[_0x93ce('0x1b')][_0x93ce('0x1f')],function(_0x106a90){return{'model':db[_0x106a90[_0x93ce('0x21')]],'as':_0x106a90['as'],'attributes':_0x106a90[_0x93ce('0x1d')],'include':_0x106a90['include']?_[_0x93ce('0x20')](_0x106a90[_0x93ce('0x1f')],function(_0x55d77e){return{'model':db[_0x55d77e[_0x93ce('0x21')]],'as':_0x55d77e['as'],'attributes':_0x55d77e[_0x93ce('0x1d')],'include':_0x55d77e[_0x93ce('0x1f')]?_[_0x93ce('0x20')](_0x55d77e[_0x93ce('0x1f')],function(_0x523a66){return{'model':db[_0x523a66[_0x93ce('0x21')]],'as':_0x523a66['as'],'attributes':_0x523a66[_0x93ce('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e8c62){logger[_0x93ce('0x16')](_0x93ce('0x24'),_0x578a3f);logger[_0x93ce('0x10')](_0x93ce('0x24'),_0x578a3f,JSON[_0x93ce('0x12')](_0x5e8c62));_0x2aa769(_0x5e8c62);})[_0x93ce('0x18')](function(_0x41ed4a){logger[_0x93ce('0x13')](_0x93ce('0x24'),_0x41ed4a[_0x93ce('0x15')],_0x578a3f);_0x50e5d0(_0x38adbc[_0x93ce('0x13')](0x1f4,_0x41ed4a[_0x93ce('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9be7f27..8c55b29 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x482915,_0x4cac3e){var _0x1d5879=function(_0x22d9c0){while(--_0x22d9c0){_0x482915['push'](_0x482915['shift']());}};_0x1d5879(++_0x4cac3e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34ea22,_0x1270b3){_0x34ea22=_0x34ea22-0x0;var _0x1ca470=_0x0b0e[_0x34ea22];return _0x1ca470;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x1ea6eb,_0x33d3d4){var _0x127200=function(_0x5ef9b8){while(--_0x5ef9b8){_0x1ea6eb['push'](_0x1ea6eb['shift']());}};_0x127200(++_0x33d3d4);}(_0xb10b,0x12a));var _0xbb10=function(_0x129f74,_0x3d64d8){_0x129f74=_0x129f74-0x0;var _0x1cf683=_0xb10b[_0x129f74];return _0x1cf683;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 123bfa3..aa887eb 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 _0xff14=['/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','index','isAuthenticated','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0xff14,0x74));var _0x4ff1=function(_0x140fd6,_0x5d8037){_0x140fd6=_0x140fd6-0x0;var _0x16a6ad=_0xff14[_0x140fd6];return _0x16a6ad;};'use strict';var multer=require(_0x4ff1('0x0'));var util=require(_0x4ff1('0x1'));var path=require(_0x4ff1('0x2'));var timeout=require(_0x4ff1('0x3'));var express=require('express');var router=express[_0x4ff1('0x4')]();var auth=require(_0x4ff1('0x5'));var interaction=require(_0x4ff1('0x6'));var config=require(_0x4ff1('0x7'));var controller=require(_0x4ff1('0x8'));router[_0x4ff1('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ff1('0xa')]);router[_0x4ff1('0x9')]('/describe',auth[_0x4ff1('0xb')](),controller['describe']);router[_0x4ff1('0x9')](_0x4ff1('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4ff1('0xd'),auth[_0x4ff1('0xb')](),controller[_0x4ff1('0xe')]);router['get']('/:id/teams',auth[_0x4ff1('0xb')](),controller[_0x4ff1('0xf')]);router[_0x4ff1('0x9')](_0x4ff1('0x10'),auth['isAuthenticated'](),controller[_0x4ff1('0x11')]);router[_0x4ff1('0x12')]('/',auth[_0x4ff1('0xb')](),controller[_0x4ff1('0x13')]);router['post']('/:id/teams',auth[_0x4ff1('0xb')](),controller['addTeams']);router[_0x4ff1('0x12')](_0x4ff1('0x10'),auth[_0x4ff1('0xb')](),controller[_0x4ff1('0x14')]);router['put'](_0x4ff1('0xc'),auth['isAuthenticated'](),controller[_0x4ff1('0x15')]);router[_0x4ff1('0x16')](_0x4ff1('0xc'),auth[_0x4ff1('0xb')](),controller[_0x4ff1('0x17')]);router[_0x4ff1('0x16')](_0x4ff1('0x18'),auth[_0x4ff1('0xb')](),controller[_0x4ff1('0x19')]);router['delete'](_0x4ff1('0x10'),auth['isAuthenticated'](),controller[_0x4ff1('0x1a')]);module[_0x4ff1('0x1b')]=router; \ No newline at end of file +var _0xb37a=['put','/:id','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/teams','getTeams','/:id/users','post','create','addAgents'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0xb37a,0x1a6));var _0xab37=function(_0x324d0a,_0x56987a){_0x324d0a=_0x324d0a-0x0;var _0x18b0db=_0xb37a[_0x324d0a];return _0x18b0db;};'use strict';var multer=require(_0xab37('0x0'));var util=require(_0xab37('0x1'));var path=require(_0xab37('0x2'));var timeout=require(_0xab37('0x3'));var express=require('express');var router=express[_0xab37('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xab37('0x5'));var config=require(_0xab37('0x6'));var controller=require(_0xab37('0x7'));router[_0xab37('0x8')]('/',auth[_0xab37('0x9')](),controller[_0xab37('0xa')]);router[_0xab37('0x8')](_0xab37('0xb'),auth['isAuthenticated'](),controller[_0xab37('0xc')]);router[_0xab37('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xab37('0xd')]);router['get']('/:id/members',auth[_0xab37('0x9')](),controller['getMembers']);router['get'](_0xab37('0xe'),auth[_0xab37('0x9')](),controller[_0xab37('0xf')]);router[_0xab37('0x8')](_0xab37('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0xab37('0x11')]('/',auth[_0xab37('0x9')](),controller[_0xab37('0x12')]);router[_0xab37('0x11')](_0xab37('0xe'),auth[_0xab37('0x9')](),controller['addTeams']);router['post'](_0xab37('0x10'),auth['isAuthenticated'](),controller[_0xab37('0x13')]);router[_0xab37('0x14')](_0xab37('0x15'),auth[_0xab37('0x9')](),controller['update']);router[_0xab37('0x16')](_0xab37('0x15'),auth[_0xab37('0x9')](),controller['destroy']);router[_0xab37('0x16')]('/:id/teams',auth[_0xab37('0x9')](),controller[_0xab37('0x17')]);router[_0xab37('0x16')](_0xab37('0x10'),auth[_0xab37('0x9')](),controller[_0xab37('0x18')]);module[_0xab37('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 70e2a2a..5341433 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 _0xfbfa=['sequelize','exports','STRING','DATE','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfbfa,0x1a8));var _0xafbf=function(_0x5956ee,_0x54e5ec){_0x5956ee=_0x5956ee-0x0;var _0x269f1f=_0xfbfa[_0x5956ee];return _0x269f1f;};'use strict';var moment=require(_0xafbf('0x0'));var Sequelize=require(_0xafbf('0x1'));module[_0xafbf('0x2')]={'uniqueid':{'type':Sequelize[_0xafbf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xafbf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xafbf('0x4')]},'reason':{'type':Sequelize[_0xafbf('0x3')]}}; \ No newline at end of file +var _0xcbc9=['STRING','DATE','moment','sequelize','exports'];(function(_0x45c3c5,_0xa32cae){var _0x46a691=function(_0x54bf6b){while(--_0x54bf6b){_0x45c3c5['push'](_0x45c3c5['shift']());}};_0x46a691(++_0xa32cae);}(_0xcbc9,0xa2));var _0x9cbc=function(_0x7b341f,_0x11e481){_0x7b341f=_0x7b341f-0x0;var _0x46d0a1=_0xcbc9[_0x7b341f];return _0x46d0a1;};'use strict';var moment=require(_0x9cbc('0x0'));var Sequelize=require(_0x9cbc('0x1'));module[_0x9cbc('0x2')]={'uniqueid':{'type':Sequelize[_0x9cbc('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9cbc('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9cbc('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9cbc('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 344418f..be089af 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 _0x0341=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters'];(function(_0x15df09,_0x57c567){var _0x32239f=function(_0x9842a5){while(--_0x9842a5){_0x15df09['push'](_0x15df09['shift']());}};_0x32239f(++_0x57c567);}(_0x0341,0xf2));var _0x1034=function(_0x2dc868,_0x25c061){_0x2dc868=_0x2dc868-0x0;var _0x1b13dc=_0x0341[_0x2dc868];return _0x1b13dc;};'use strict';var pdf=require(_0x1034('0x0'));var emlformat=require(_0x1034('0x1'));var rimraf=require(_0x1034('0x2'));var zipdir=require(_0x1034('0x3'));var jsonpatch=require(_0x1034('0x4'));var rp=require(_0x1034('0x5'));var moment=require('moment');var BPromise=require(_0x1034('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1034('0x7'));var sox=require(_0x1034('0x8'));var csv=require(_0x1034('0x9'));var ejs=require(_0x1034('0xa'));var fs=require('fs');var _=require(_0x1034('0xb'));var squel=require(_0x1034('0xc'));var crypto=require('crypto');var jsforce=require(_0x1034('0xd'));var deskjs=require(_0x1034('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1034('0xf'));var Papa=require(_0x1034('0x10'));var Redis=require('ioredis');var authService=require(_0x1034('0x11'));var qs=require(_0x1034('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1034('0x13'))(_0x1034('0x14'));var utils=require(_0x1034('0x15'));var config=require('../../config/environment');var db=require(_0x1034('0x16'))['db'];function respondWithStatusCode(_0x5c25af,_0x4f7471){_0x4f7471=_0x4f7471||0xcc;return function(_0x47df53){if(_0x47df53){return _0x5c25af[_0x1034('0x17')](_0x4f7471);}return _0x5c25af[_0x1034('0x18')](_0x4f7471)['end']();};}function respondWithResult(_0x159ef8,_0x4095cf){_0x4095cf=_0x4095cf||0xc8;return function(_0x1e4611){if(_0x1e4611){return _0x159ef8[_0x1034('0x18')](_0x4095cf)['json'](_0x1e4611);}};}function respondWithFilteredResult(_0x301d1e,_0x32a37d){return function(_0x237cb1){if(_0x237cb1){var _0x381685=_0x237cb1[_0x1034('0x19')],_0x3139ce=_0x32a37d[_0x1034('0x1a')],_0x13f5ed=_0x32a37d['offset']+_0x32a37d[_0x1034('0x1b')],_0x139f73;if(_0x13f5ed>=_0x381685){_0x13f5ed=_0x381685;_0x139f73=0xc8;}else{_0x139f73=0xce;}_0x301d1e[_0x1034('0x18')](_0x139f73);return _0x301d1e[_0x1034('0x1c')](_0x1034('0x1d'),_0x3139ce+'-'+_0x13f5ed+'/'+_0x381685)[_0x1034('0x1e')](_0x237cb1);}return null;};}function patchUpdates(_0x2d42d9){return function(_0xc04dcd){try{jsonpatch['apply'](_0xc04dcd,_0x2d42d9,!![]);}catch(_0x6325e2){return BPromise[_0x1034('0x1f')](_0x6325e2);}return _0xc04dcd[_0x1034('0x20')]();};}function saveUpdates(_0x368eb2,_0x188054){return function(_0x42cad4){if(_0x42cad4){return _0x42cad4[_0x1034('0x21')](_0x368eb2)['then'](function(_0x1b8857){return _0x1b8857;});}return null;};}function removeEntity(_0x6ee0c6,_0x2d8088){return function(_0x663890){if(_0x663890){return _0x663890[_0x1034('0x22')]()[_0x1034('0x23')](function(){_0x6ee0c6[_0x1034('0x18')](0xcc)[_0x1034('0x24')]();});}};}function handleEntityNotFound(_0x46c9b6,_0x1bf452){return function(_0x56126e){if(!_0x56126e){_0x46c9b6[_0x1034('0x17')](0x194);}return _0x56126e;};}function handleError(_0x2c22c6,_0x217509){_0x217509=_0x217509||0x1f4;return function(_0x50907a){logger[_0x1034('0x25')](_0x50907a[_0x1034('0x26')]);if(_0x50907a[_0x1034('0x27')]){delete _0x50907a[_0x1034('0x27')];}_0x2c22c6[_0x1034('0x18')](_0x217509)['send'](_0x50907a);};}exports[_0x1034('0x28')]=function(_0x5bfb26,_0x4635bb){var _0x4e6472={},_0xdd5419={},_0x3ae770={'count':0x0,'rows':[]};var _0x381817=_[_0x1034('0x29')](db[_0x1034('0x2a')]['rawAttributes'],function(_0x46936a){return{'name':_0x46936a[_0x1034('0x2b')],'type':_0x46936a[_0x1034('0x2c')][_0x1034('0x2d')]};});_0xdd5419[_0x1034('0x2e')]=_[_0x1034('0x29')](_0x381817,_0x1034('0x27'));_0xdd5419[_0x1034('0x2f')]=_[_0x1034('0x30')](_0x5bfb26[_0x1034('0x2f')]);_0xdd5419[_0x1034('0x31')]=_[_0x1034('0x32')](_0xdd5419[_0x1034('0x2e')],_0xdd5419[_0x1034('0x2f')]);_0x4e6472['attributes']=_['intersection'](_0xdd5419[_0x1034('0x2e')],qs['fields'](_0x5bfb26[_0x1034('0x2f')][_0x1034('0x33')]));_0x4e6472[_0x1034('0x34')]=_0x4e6472[_0x1034('0x34')][_0x1034('0x35')]?_0x4e6472[_0x1034('0x34')]:_0xdd5419[_0x1034('0x2e')];if(!_0x5bfb26['query'][_0x1034('0x36')](_0x1034('0x37'))){_0x4e6472[_0x1034('0x1b')]=qs[_0x1034('0x1b')](_0x5bfb26[_0x1034('0x2f')][_0x1034('0x1b')]);_0x4e6472[_0x1034('0x1a')]=qs[_0x1034('0x1a')](_0x5bfb26[_0x1034('0x2f')][_0x1034('0x1a')]);}_0x4e6472[_0x1034('0x38')]=qs['sort'](_0x5bfb26['query'][_0x1034('0x39')]);_0x4e6472[_0x1034('0x3a')]=qs['filters'](_['pick'](_0x5bfb26[_0x1034('0x2f')],_0xdd5419[_0x1034('0x31')]));if(_0x5bfb26[_0x1034('0x2f')][_0x1034('0x3b')]){_0x4e6472[_0x1034('0x3a')]=_[_0x1034('0x3c')](_0x4e6472[_0x1034('0x3a')],{'$or':_[_0x1034('0x29')](_0x381817,function(_0x432b3f){if(_0x432b3f[_0x1034('0x2c')]!==_0x1034('0x3d')){var _0x5e645e={};_0x5e645e[_0x432b3f['name']]={'$like':'%'+_0x5bfb26['query'][_0x1034('0x3b')]+'%'};return _0x5e645e;}})});}_0x4e6472=_[_0x1034('0x3c')]({},_0x4e6472,_0x5bfb26[_0x1034('0x3e')]);var _0x547f3a={'where':_0x4e6472[_0x1034('0x3a')]};return db['ChatQueueReport']['count'](_0x547f3a)[_0x1034('0x23')](function(_0x53735c){_0x3ae770[_0x1034('0x19')]=_0x53735c;if(_0x5bfb26[_0x1034('0x2f')][_0x1034('0x3f')]){_0x4e6472[_0x1034('0x40')]=[{'all':!![]}];}return db[_0x1034('0x2a')][_0x1034('0x41')](_0x4e6472);})[_0x1034('0x23')](function(_0x5a1890){_0x3ae770[_0x1034('0x42')]=_0x5a1890;return _0x3ae770;})[_0x1034('0x23')](respondWithFilteredResult(_0x4635bb,_0x4e6472))[_0x1034('0x43')](handleError(_0x4635bb,null));};exports['show']=function(_0x54bec4,_0x545bd9){var _0x4117c9={'raw':!![],'where':{'id':_0x54bec4[_0x1034('0x44')]['id']}},_0x38136f={};_0x38136f['model']=_[_0x1034('0x30')](db[_0x1034('0x2a')][_0x1034('0x45')]);_0x38136f[_0x1034('0x2f')]=_['keys'](_0x54bec4[_0x1034('0x2f')]);_0x38136f[_0x1034('0x31')]=_[_0x1034('0x32')](_0x38136f[_0x1034('0x2e')],_0x38136f['query']);_0x4117c9[_0x1034('0x34')]=_[_0x1034('0x32')](_0x38136f[_0x1034('0x2e')],qs[_0x1034('0x33')](_0x54bec4['query'][_0x1034('0x33')]));_0x4117c9[_0x1034('0x34')]=_0x4117c9[_0x1034('0x34')]['length']?_0x4117c9[_0x1034('0x34')]:_0x38136f[_0x1034('0x2e')];if(_0x54bec4[_0x1034('0x2f')][_0x1034('0x3f')]){_0x4117c9[_0x1034('0x40')]=[{'all':!![]}];}_0x4117c9=_[_0x1034('0x3c')]({},_0x4117c9,_0x54bec4[_0x1034('0x3e')]);return db[_0x1034('0x2a')][_0x1034('0x46')](_0x4117c9)[_0x1034('0x23')](handleEntityNotFound(_0x545bd9,null))[_0x1034('0x23')](respondWithResult(_0x545bd9,null))[_0x1034('0x43')](handleError(_0x545bd9,null));};exports[_0x1034('0x47')]=function(_0x4bf57b,_0x5099d6){return db[_0x1034('0x2a')][_0x1034('0x47')](_0x4bf57b[_0x1034('0x48')],{})[_0x1034('0x23')](respondWithResult(_0x5099d6,0xc9))[_0x1034('0x43')](handleError(_0x5099d6,null));};exports[_0x1034('0x21')]=function(_0x296265,_0x3fd06e){if(_0x296265[_0x1034('0x48')]['id']){delete _0x296265[_0x1034('0x48')]['id'];}return db[_0x1034('0x2a')][_0x1034('0x46')]({'where':{'id':_0x296265[_0x1034('0x44')]['id']}})[_0x1034('0x23')](handleEntityNotFound(_0x3fd06e,null))[_0x1034('0x23')](saveUpdates(_0x296265[_0x1034('0x48')],null))[_0x1034('0x23')](respondWithResult(_0x3fd06e,null))['catch'](handleError(_0x3fd06e,null));};exports['destroy']=function(_0x41c1a3,_0x46e86d){return db['ChatQueueReport'][_0x1034('0x46')]({'where':{'id':_0x41c1a3[_0x1034('0x44')]['id']}})[_0x1034('0x23')](handleEntityNotFound(_0x46e86d,null))['then'](removeEntity(_0x46e86d,null))[_0x1034('0x43')](handleError(_0x46e86d,null));};exports['describe']=function(_0x145042,_0x1b2876){return db[_0x1034('0x2a')]['describe']()[_0x1034('0x23')](respondWithResult(_0x1b2876,null))[_0x1034('0x43')](handleError(_0x1b2876,null));}; \ No newline at end of file +var _0xd057=['send','index','ChatQueueReport','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xd057,0x103));var _0x7d05=function(_0x1915e1,_0x4bb557){_0x1915e1=_0x1915e1-0x0;var _0x493685=_0xd057[_0x1915e1];return _0x493685;};'use strict';var pdf=require(_0x7d05('0x0'));var emlformat=require(_0x7d05('0x1'));var rimraf=require(_0x7d05('0x2'));var zipdir=require(_0x7d05('0x3'));var jsonpatch=require(_0x7d05('0x4'));var rp=require('request-promise');var moment=require(_0x7d05('0x5'));var BPromise=require(_0x7d05('0x6'));var Mustache=require('mustache');var util=require(_0x7d05('0x7'));var path=require(_0x7d05('0x8'));var sox=require(_0x7d05('0x9'));var csv=require(_0x7d05('0xa'));var ejs=require(_0x7d05('0xb'));var fs=require('fs');var _=require(_0x7d05('0xc'));var squel=require(_0x7d05('0xd'));var crypto=require(_0x7d05('0xe'));var jsforce=require(_0x7d05('0xf'));var deskjs=require(_0x7d05('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d05('0x11'));var Redis=require(_0x7d05('0x12'));var authService=require(_0x7d05('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7d05('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d05('0x15'))(_0x7d05('0x16'));var utils=require(_0x7d05('0x17'));var config=require(_0x7d05('0x18'));var db=require(_0x7d05('0x19'))['db'];function respondWithStatusCode(_0x2ed92a,_0x3c4c0d){_0x3c4c0d=_0x3c4c0d||0xcc;return function(_0x477a1b){if(_0x477a1b){return _0x2ed92a[_0x7d05('0x1a')](_0x3c4c0d);}return _0x2ed92a[_0x7d05('0x1b')](_0x3c4c0d)[_0x7d05('0x1c')]();};}function respondWithResult(_0x5f2f9f,_0x4557f3){_0x4557f3=_0x4557f3||0xc8;return function(_0x4a610b){if(_0x4a610b){return _0x5f2f9f['status'](_0x4557f3)[_0x7d05('0x1d')](_0x4a610b);}};}function respondWithFilteredResult(_0x25deb4,_0x86d9bf){return function(_0x2d3d47){if(_0x2d3d47){var _0x3033a7=_0x2d3d47['count'],_0x4080d5=_0x86d9bf[_0x7d05('0x1e')],_0x1d4b0f=_0x86d9bf[_0x7d05('0x1e')]+_0x86d9bf['limit'],_0x11acae;if(_0x1d4b0f>=_0x3033a7){_0x1d4b0f=_0x3033a7;_0x11acae=0xc8;}else{_0x11acae=0xce;}_0x25deb4[_0x7d05('0x1b')](_0x11acae);return _0x25deb4[_0x7d05('0x1f')]('Content-Range',_0x4080d5+'-'+_0x1d4b0f+'/'+_0x3033a7)['json'](_0x2d3d47);}return null;};}function patchUpdates(_0xa38511){return function(_0x36ae8c){try{jsonpatch[_0x7d05('0x20')](_0x36ae8c,_0xa38511,!![]);}catch(_0x572dff){return BPromise[_0x7d05('0x21')](_0x572dff);}return _0x36ae8c[_0x7d05('0x22')]();};}function saveUpdates(_0x46c40c,_0x19a649){return function(_0x42ac4c){if(_0x42ac4c){return _0x42ac4c[_0x7d05('0x23')](_0x46c40c)[_0x7d05('0x24')](function(_0x454dd3){return _0x454dd3;});}return null;};}function removeEntity(_0x5b4669,_0xbf8c78){return function(_0xedf1ab){if(_0xedf1ab){return _0xedf1ab[_0x7d05('0x25')]()[_0x7d05('0x24')](function(){_0x5b4669[_0x7d05('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcfab89,_0x3bd961){return function(_0x2e89eb){if(!_0x2e89eb){_0xcfab89[_0x7d05('0x1a')](0x194);}return _0x2e89eb;};}function handleError(_0x2fbe40,_0x82f75d){_0x82f75d=_0x82f75d||0x1f4;return function(_0x597bab){logger[_0x7d05('0x26')](_0x597bab[_0x7d05('0x27')]);if(_0x597bab[_0x7d05('0x28')]){delete _0x597bab[_0x7d05('0x28')];}_0x2fbe40[_0x7d05('0x1b')](_0x82f75d)[_0x7d05('0x29')](_0x597bab);};}exports[_0x7d05('0x2a')]=function(_0x400e5d,_0x1ac1fa){var _0x42a6bc={},_0x1e3da4={},_0x2561d7={'count':0x0,'rows':[]};var _0x555fec=_['map'](db[_0x7d05('0x2b')]['rawAttributes'],function(_0x3c6bc4){return{'name':_0x3c6bc4[_0x7d05('0x2c')],'type':_0x3c6bc4[_0x7d05('0x2d')][_0x7d05('0x2e')]};});_0x1e3da4[_0x7d05('0x2f')]=_['map'](_0x555fec,_0x7d05('0x28'));_0x1e3da4['query']=_[_0x7d05('0x30')](_0x400e5d[_0x7d05('0x31')]);_0x1e3da4['filters']=_[_0x7d05('0x32')](_0x1e3da4[_0x7d05('0x2f')],_0x1e3da4[_0x7d05('0x31')]);_0x42a6bc['attributes']=_[_0x7d05('0x32')](_0x1e3da4['model'],qs[_0x7d05('0x33')](_0x400e5d['query'][_0x7d05('0x33')]));_0x42a6bc[_0x7d05('0x34')]=_0x42a6bc[_0x7d05('0x34')][_0x7d05('0x35')]?_0x42a6bc[_0x7d05('0x34')]:_0x1e3da4['model'];if(!_0x400e5d[_0x7d05('0x31')][_0x7d05('0x36')](_0x7d05('0x37'))){_0x42a6bc[_0x7d05('0x38')]=qs['limit'](_0x400e5d[_0x7d05('0x31')][_0x7d05('0x38')]);_0x42a6bc['offset']=qs[_0x7d05('0x1e')](_0x400e5d[_0x7d05('0x31')][_0x7d05('0x1e')]);}_0x42a6bc[_0x7d05('0x39')]=qs['sort'](_0x400e5d['query'][_0x7d05('0x3a')]);_0x42a6bc['where']=qs[_0x7d05('0x3b')](_[_0x7d05('0x3c')](_0x400e5d['query'],_0x1e3da4[_0x7d05('0x3b')]));if(_0x400e5d['query'][_0x7d05('0x3d')]){_0x42a6bc[_0x7d05('0x3e')]=_[_0x7d05('0x3f')](_0x42a6bc[_0x7d05('0x3e')],{'$or':_['map'](_0x555fec,function(_0x78cafb){if(_0x78cafb[_0x7d05('0x2d')]!=='VIRTUAL'){var _0x576bbe={};_0x576bbe[_0x78cafb[_0x7d05('0x28')]]={'$like':'%'+_0x400e5d[_0x7d05('0x31')][_0x7d05('0x3d')]+'%'};return _0x576bbe;}})});}_0x42a6bc=_[_0x7d05('0x3f')]({},_0x42a6bc,_0x400e5d[_0x7d05('0x40')]);var _0xc60e5d={'where':_0x42a6bc[_0x7d05('0x3e')]};return db[_0x7d05('0x2b')][_0x7d05('0x41')](_0xc60e5d)[_0x7d05('0x24')](function(_0x2dd417){_0x2561d7['count']=_0x2dd417;if(_0x400e5d[_0x7d05('0x31')][_0x7d05('0x42')]){_0x42a6bc['include']=[{'all':!![]}];}return db[_0x7d05('0x2b')][_0x7d05('0x43')](_0x42a6bc);})[_0x7d05('0x24')](function(_0x41a4e2){_0x2561d7[_0x7d05('0x44')]=_0x41a4e2;return _0x2561d7;})[_0x7d05('0x24')](respondWithFilteredResult(_0x1ac1fa,_0x42a6bc))[_0x7d05('0x45')](handleError(_0x1ac1fa,null));};exports[_0x7d05('0x46')]=function(_0x5f42f2,_0x3305a5){var _0x441647={'raw':!![],'where':{'id':_0x5f42f2[_0x7d05('0x47')]['id']}},_0x415a45={};_0x415a45[_0x7d05('0x2f')]=_[_0x7d05('0x30')](db[_0x7d05('0x2b')]['rawAttributes']);_0x415a45[_0x7d05('0x31')]=_[_0x7d05('0x30')](_0x5f42f2[_0x7d05('0x31')]);_0x415a45[_0x7d05('0x3b')]=_[_0x7d05('0x32')](_0x415a45['model'],_0x415a45[_0x7d05('0x31')]);_0x441647['attributes']=_[_0x7d05('0x32')](_0x415a45[_0x7d05('0x2f')],qs['fields'](_0x5f42f2[_0x7d05('0x31')][_0x7d05('0x33')]));_0x441647[_0x7d05('0x34')]=_0x441647[_0x7d05('0x34')][_0x7d05('0x35')]?_0x441647[_0x7d05('0x34')]:_0x415a45[_0x7d05('0x2f')];if(_0x5f42f2[_0x7d05('0x31')][_0x7d05('0x42')]){_0x441647['include']=[{'all':!![]}];}_0x441647=_[_0x7d05('0x3f')]({},_0x441647,_0x5f42f2[_0x7d05('0x40')]);return db[_0x7d05('0x2b')][_0x7d05('0x48')](_0x441647)[_0x7d05('0x24')](handleEntityNotFound(_0x3305a5,null))[_0x7d05('0x24')](respondWithResult(_0x3305a5,null))[_0x7d05('0x45')](handleError(_0x3305a5,null));};exports[_0x7d05('0x49')]=function(_0x4ec518,_0x124929){return db[_0x7d05('0x2b')][_0x7d05('0x49')](_0x4ec518['body'],{})[_0x7d05('0x24')](respondWithResult(_0x124929,0xc9))['catch'](handleError(_0x124929,null));};exports[_0x7d05('0x23')]=function(_0x4c059f,_0x34e722){if(_0x4c059f[_0x7d05('0x4a')]['id']){delete _0x4c059f['body']['id'];}return db[_0x7d05('0x2b')][_0x7d05('0x48')]({'where':{'id':_0x4c059f[_0x7d05('0x47')]['id']}})[_0x7d05('0x24')](handleEntityNotFound(_0x34e722,null))[_0x7d05('0x24')](saveUpdates(_0x4c059f[_0x7d05('0x4a')],null))[_0x7d05('0x24')](respondWithResult(_0x34e722,null))[_0x7d05('0x45')](handleError(_0x34e722,null));};exports['destroy']=function(_0x46dba3,_0x33e9b6){return db[_0x7d05('0x2b')][_0x7d05('0x48')]({'where':{'id':_0x46dba3['params']['id']}})['then'](handleEntityNotFound(_0x33e9b6,null))[_0x7d05('0x24')](removeEntity(_0x33e9b6,null))[_0x7d05('0x45')](handleError(_0x33e9b6,null));};exports['describe']=function(_0x206dbd,_0x1f0942){return db[_0x7d05('0x2b')]['describe']()[_0x7d05('0x24')](respondWithResult(_0x1f0942,null))[_0x7d05('0x45')](handleError(_0x1f0942,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f2c9369..4721841 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 _0xf361=['path','rimraf','./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf361,0x7c));var _0x1f36=function(_0x280d37,_0x150088){_0x280d37=_0x280d37-0x0;var _0x2a2d68=_0xf361[_0x280d37];return _0x2a2d68;};'use strict';var _=require(_0x1f36('0x0'));var util=require(_0x1f36('0x1'));var logger=require(_0x1f36('0x2'))('api');var moment=require(_0x1f36('0x3'));var BPromise=require(_0x1f36('0x4'));var rp=require(_0x1f36('0x5'));var fs=require('fs');var path=require(_0x1f36('0x6'));var rimraf=require(_0x1f36('0x7'));var config=require('../../config/environment');var attributes=require(_0x1f36('0x8'));module['exports']=function(_0x183a64,_0x292950){return _0x183a64[_0x1f36('0x9')](_0x1f36('0xa'),attributes,{'tableName':_0x1f36('0xb'),'paranoid':![],'indexes':[{'name':_0x1f36('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4e6=['rimraf','report_chat_queue','uniqueid','lodash','moment','bluebird','path'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0xe4e6,0x11b));var _0x6e4e=function(_0x7df2d1,_0x5977c9){_0x7df2d1=_0x7df2d1-0x0;var _0x503045=_0xe4e6[_0x7df2d1];return _0x503045;};'use strict';var _=require(_0x6e4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6e4e('0x1'));var BPromise=require(_0x6e4e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e4e('0x3'));var rimraf=require(_0x6e4e('0x4'));var config=require('../../config/environment');var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x1ee603,_0x3c2625){return _0x1ee603['define']('ChatQueueReport',attributes,{'tableName':_0x6e4e('0x5'),'paranoid':![],'indexes':[{'name':_0x6e4e('0x6'),'fields':[_0x6e4e('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index bef1392..2c0f8e6 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 _0x941f=['UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','ChatQueueReport','create','body','options','CreateChatQueueReport','stringify'];(function(_0x2779bd,_0x47766a){var _0x135e6b=function(_0x5d291e){while(--_0x5d291e){_0x2779bd['push'](_0x2779bd['shift']());}};_0x135e6b(++_0x47766a);}(_0x941f,0x15a));var _0xf941=function(_0x34d1db,_0xe312a8){_0x34d1db=_0x34d1db-0x0;var _0x2dc78e=_0x941f[_0x34d1db];return _0x2dc78e;};'use strict';var _=require(_0xf941('0x0'));var util=require(_0xf941('0x1'));var moment=require('moment');var BPromise=require(_0xf941('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf941('0x3'));var db=require(_0xf941('0x4'))['db'];var utils=require(_0xf941('0x5'));var logger=require('../../config/logger')(_0xf941('0x6'));var config=require(_0xf941('0x7'));var jayson=require(_0xf941('0x8'));var client=jayson[_0xf941('0x9')][_0xf941('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f8896,_0x445817,_0x5123ac){return new BPromise(function(_0x53f28e,_0x4997d8){return client[_0xf941('0xb')](_0x3f8896,_0x5123ac)[_0xf941('0xc')](function(_0x4bd1ab){logger[_0xf941('0xd')](_0xf941('0xe'),_0x445817,_0xf941('0xf'));logger[_0xf941('0x10')](_0xf941('0x11'),_0x445817,_0xf941('0xf'),JSON['stringify'](_0x4bd1ab));if(_0x4bd1ab[_0xf941('0x12')]){if(_0x4bd1ab[_0xf941('0x12')][_0xf941('0x13')]===0x1f4){logger['error'](_0xf941('0xe'),_0x445817,_0x4bd1ab[_0xf941('0x12')]['message']);return _0x4997d8(_0x4bd1ab[_0xf941('0x12')]['message']);}logger[_0xf941('0x12')](_0xf941('0xe'),_0x445817,_0x4bd1ab['error']['message']);return _0x53f28e(_0x4bd1ab['error'][_0xf941('0x14')]);}else{logger['info'](_0xf941('0xe'),_0x445817,_0xf941('0xf'));_0x53f28e(_0x4bd1ab['result'][_0xf941('0x14')]);}})[_0xf941('0x15')](function(_0x5740bc){logger[_0xf941('0x12')](_0xf941('0xe'),_0x445817,_0x5740bc);_0x4997d8(_0x5740bc);});});}exports['CreateChatQueueReport']=function(_0x4e5841){var _0x44a50b=this;return new Promise(function(_0x570473,_0x19191c){return db[_0xf941('0x16')][_0xf941('0x17')](_0x4e5841[_0xf941('0x18')],{'raw':_0x4e5841[_0xf941('0x19')]?_0x4e5841['options']['raw']===undefined?!![]:![]:!![]})[_0xf941('0xc')](function(_0x2c0118){logger[_0xf941('0xd')](_0xf941('0x1a'),_0x4e5841);logger[_0xf941('0x10')](_0xf941('0x1a'),_0x4e5841,JSON[_0xf941('0x1b')](_0x2c0118));_0x570473(_0x2c0118);})['catch'](function(_0x3f0412){logger[_0xf941('0x12')]('CreateChatQueueReport',_0x3f0412[_0xf941('0x14')],_0x4e5841);_0x19191c(_0x44a50b['error'](0x1f4,_0x3f0412[_0xf941('0x14')]));});});};exports[_0xf941('0x1c')]=function(_0x3ffab3){var _0x3e7f9e=this;return new Promise(function(_0x3b3bb6,_0x4daf63){return db[_0xf941('0x16')][_0xf941('0x1d')](_0x3ffab3[_0xf941('0x18')],{'raw':_0x3ffab3[_0xf941('0x19')]?_0x3ffab3[_0xf941('0x19')][_0xf941('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ffab3[_0xf941('0x19')]?_0x3ffab3[_0xf941('0x19')][_0xf941('0x1f')]||null:null,'attributes':_0x3ffab3[_0xf941('0x19')]?_0x3ffab3[_0xf941('0x19')][_0xf941('0x20')]||null:null,'limit':_0x3ffab3['options']?_0x3ffab3[_0xf941('0x19')][_0xf941('0x21')]||null:null})[_0xf941('0xc')](function(_0x32d7d2){logger['info'](_0xf941('0x1c'),_0x3ffab3);logger[_0xf941('0x10')](_0xf941('0x1c'),_0x3ffab3,JSON[_0xf941('0x1b')](_0x32d7d2));_0x3b3bb6(_0x32d7d2);})[_0xf941('0x15')](function(_0x4c4538){logger['error'](_0xf941('0x1c'),_0x4c4538[_0xf941('0x14')],_0x3ffab3);_0x4daf63(_0x3e7f9e['error'](0x1f4,_0x4c4538[_0xf941('0x14')]));});});}; \ No newline at end of file +var _0xeab2=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','catch','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','randomstring','../../mysqldb'];(function(_0x1b29b2,_0x3b6b11){var _0x560b68=function(_0x50a4ea){while(--_0x50a4ea){_0x1b29b2['push'](_0x1b29b2['shift']());}};_0x560b68(++_0x3b6b11);}(_0xeab2,0xea));var _0x2eab=function(_0x415603,_0x21320c){_0x415603=_0x415603-0x0;var _0x131e72=_0xeab2[_0x415603];return _0x131e72;};'use strict';var _=require(_0x2eab('0x0'));var util=require(_0x2eab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2eab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2eab('0x3'))['db'];var utils=require(_0x2eab('0x4'));var logger=require(_0x2eab('0x5'))(_0x2eab('0x6'));var config=require(_0x2eab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2eab('0x8')][_0x2eab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58b0f6,_0x476781,_0x44dd0d){return new BPromise(function(_0x57ffef,_0x1e2331){return client[_0x2eab('0xa')](_0x58b0f6,_0x44dd0d)[_0x2eab('0xb')](function(_0x3c8729){logger[_0x2eab('0xc')](_0x2eab('0xd'),_0x476781,_0x2eab('0xe'));logger[_0x2eab('0xf')](_0x2eab('0x10'),_0x476781,'request\x20sent',JSON[_0x2eab('0x11')](_0x3c8729));if(_0x3c8729['error']){if(_0x3c8729['error'][_0x2eab('0x12')]===0x1f4){logger[_0x2eab('0x13')](_0x2eab('0xd'),_0x476781,_0x3c8729['error'][_0x2eab('0x14')]);return _0x1e2331(_0x3c8729[_0x2eab('0x13')][_0x2eab('0x14')]);}logger[_0x2eab('0x13')](_0x2eab('0xd'),_0x476781,_0x3c8729[_0x2eab('0x13')][_0x2eab('0x14')]);return _0x57ffef(_0x3c8729['error'][_0x2eab('0x14')]);}else{logger['info'](_0x2eab('0xd'),_0x476781,_0x2eab('0xe'));_0x57ffef(_0x3c8729[_0x2eab('0x15')][_0x2eab('0x14')]);}})['catch'](function(_0x2f4fb2){logger[_0x2eab('0x13')](_0x2eab('0xd'),_0x476781,_0x2f4fb2);_0x1e2331(_0x2f4fb2);});});}exports['CreateChatQueueReport']=function(_0xc898fd){var _0x4a1a4e=this;return new Promise(function(_0x1765df,_0x10c8cc){return db[_0x2eab('0x16')][_0x2eab('0x17')](_0xc898fd[_0x2eab('0x18')],{'raw':_0xc898fd[_0x2eab('0x19')]?_0xc898fd[_0x2eab('0x19')][_0x2eab('0x1a')]===undefined?!![]:![]:!![]})[_0x2eab('0xb')](function(_0x2953fd){logger[_0x2eab('0xc')](_0x2eab('0x1b'),_0xc898fd);logger[_0x2eab('0xf')](_0x2eab('0x1b'),_0xc898fd,JSON['stringify'](_0x2953fd));_0x1765df(_0x2953fd);})[_0x2eab('0x1c')](function(_0x13a94a){logger['error'](_0x2eab('0x1b'),_0x13a94a[_0x2eab('0x14')],_0xc898fd);_0x10c8cc(_0x4a1a4e['error'](0x1f4,_0x13a94a[_0x2eab('0x14')]));});});};exports[_0x2eab('0x1d')]=function(_0xcafa60){var _0x43aa03=this;return new Promise(function(_0x5b355e,_0xcdd742){return db[_0x2eab('0x16')][_0x2eab('0x1e')](_0xcafa60[_0x2eab('0x18')],{'raw':_0xcafa60[_0x2eab('0x19')]?_0xcafa60[_0x2eab('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcafa60['options']?_0xcafa60['options'][_0x2eab('0x1f')]||null:null,'attributes':_0xcafa60['options']?_0xcafa60[_0x2eab('0x19')][_0x2eab('0x20')]||null:null,'limit':_0xcafa60[_0x2eab('0x19')]?_0xcafa60['options'][_0x2eab('0x21')]||null:null})[_0x2eab('0xb')](function(_0x5f3659){logger[_0x2eab('0xc')](_0x2eab('0x1d'),_0xcafa60);logger['debug'](_0x2eab('0x1d'),_0xcafa60,JSON[_0x2eab('0x11')](_0x5f3659));_0x5b355e(_0x5f3659);})[_0x2eab('0x1c')](function(_0x5ce5c0){logger[_0x2eab('0x13')]('UpdateChatQueueReport',_0x5ce5c0[_0x2eab('0x14')],_0xcafa60);_0xcdd742(_0x43aa03[_0x2eab('0x13')](0x1f4,_0x5ce5c0[_0x2eab('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 97298f4..67e477f 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 _0x6851=['/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0xe2fb73,_0x4d6d75){var _0x40102a=function(_0x5db97){while(--_0x5db97){_0xe2fb73['push'](_0xe2fb73['shift']());}};_0x40102a(++_0x4d6d75);}(_0x6851,0x15e));var _0x1685=function(_0x17dd51,_0x2d09c6){_0x17dd51=_0x17dd51-0x0;var _0x462eb0=_0x6851[_0x17dd51];return _0x462eb0;};'use strict';var multer=require(_0x1685('0x0'));var util=require(_0x1685('0x1'));var path=require('path');var timeout=require(_0x1685('0x2'));var express=require(_0x1685('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1685('0x4'));var config=require(_0x1685('0x5'));var controller=require(_0x1685('0x6'));router[_0x1685('0x7')]('/',auth[_0x1685('0x8')](),controller[_0x1685('0x9')]);router[_0x1685('0x7')](_0x1685('0xa'),auth[_0x1685('0x8')](),controller['describe']);router[_0x1685('0x7')](_0x1685('0xb'),auth[_0x1685('0x8')](),controller[_0x1685('0xc')]);router['post']('/',auth[_0x1685('0x8')](),controller[_0x1685('0xd')]);router[_0x1685('0xe')](_0x1685('0xb'),auth['isAuthenticated'](),controller[_0x1685('0xf')]);router[_0x1685('0x10')](_0x1685('0xb'),auth[_0x1685('0x8')](),controller[_0x1685('0x11')]);module[_0x1685('0x12')]=router; \ No newline at end of file +var _0x4cb6=['describe','/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe'];(function(_0x1a436a,_0x24625e){var _0x276d42=function(_0x195959){while(--_0x195959){_0x1a436a['push'](_0x1a436a['shift']());}};_0x276d42(++_0x24625e);}(_0x4cb6,0x16f));var _0x64cb=function(_0x3cbb9f,_0x492c2e){_0x3cbb9f=_0x3cbb9f-0x0;var _0x1e02ab=_0x4cb6[_0x3cbb9f];return _0x1e02ab;};'use strict';var multer=require(_0x64cb('0x0'));var util=require(_0x64cb('0x1'));var path=require(_0x64cb('0x2'));var timeout=require(_0x64cb('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x64cb('0x4'));var config=require(_0x64cb('0x5'));var controller=require(_0x64cb('0x6'));router['get']('/',auth[_0x64cb('0x7')](),controller[_0x64cb('0x8')]);router[_0x64cb('0x9')](_0x64cb('0xa'),auth[_0x64cb('0x7')](),controller[_0x64cb('0xb')]);router[_0x64cb('0x9')](_0x64cb('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x64cb('0xd')]('/',auth['isAuthenticated'](),controller[_0x64cb('0xe')]);router[_0x64cb('0xf')](_0x64cb('0xc'),auth[_0x64cb('0x7')](),controller['update']);router[_0x64cb('0x10')](_0x64cb('0xc'),auth['isAuthenticated'](),controller[_0x64cb('0x11')]);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 b1e70af..6babfd1 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 _0x51a2=['queue','DATE','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x3015a0,_0x377b3b){var _0x6d5922=function(_0x32100f){while(--_0x32100f){_0x3015a0['push'](_0x3015a0['shift']());}};_0x6d5922(++_0x377b3b);}(_0x51a2,0x1b2));var _0x251a=function(_0x2c1b1c,_0x5e9c8e){_0x2c1b1c=_0x2c1b1c-0x0;var _0x1520fb=_0x51a2[_0x2c1b1c];return _0x1520fb;};'use strict';var moment=require(_0x251a('0x0'));var Sequelize=require(_0x251a('0x1'));module[_0x251a('0x2')]={'uniqueid':{'type':Sequelize[_0x251a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x251a('0x4')](_0x251a('0x5'),_0x251a('0x6'),_0x251a('0x7')),'allowNull':![],'defaultValue':_0x251a('0x7')},'transferredAt':{'type':Sequelize[_0x251a('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa36a=['sequelize','STRING','ENUM','queue','DATE','NOW','moment'];(function(_0x30d68d,_0x436b31){var _0x16a575=function(_0x765d17){while(--_0x765d17){_0x30d68d['push'](_0x30d68d['shift']());}};_0x16a575(++_0x436b31);}(_0xa36a,0x14f));var _0xaa36=function(_0x293458,_0xe61e3d){_0x293458=_0x293458-0x0;var _0x2278a3=_0xa36a[_0x293458];return _0x2278a3;};'use strict';var moment=require(_0xaa36('0x0'));var Sequelize=require(_0xaa36('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xaa36('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaa36('0x3')]('account','agent','queue'),'allowNull':![],'defaultValue':_0xaa36('0x4')},'transferredAt':{'type':Sequelize[_0xaa36('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xaa36('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 798da72..c55423f 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 _0xd4f8=['describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body'];(function(_0x575a71,_0x3bdd2e){var _0x566774=function(_0x1541ad){while(--_0x1541ad){_0x575a71['push'](_0x575a71['shift']());}};_0x566774(++_0x3bdd2e);}(_0xd4f8,0x121));var _0x8d4f=function(_0x446c0c,_0x4416c4){_0x446c0c=_0x446c0c-0x0;var _0x11bf73=_0xd4f8[_0x446c0c];return _0x11bf73;};'use strict';var pdf=require(_0x8d4f('0x0'));var emlformat=require(_0x8d4f('0x1'));var rimraf=require(_0x8d4f('0x2'));var zipdir=require(_0x8d4f('0x3'));var jsonpatch=require(_0x8d4f('0x4'));var rp=require(_0x8d4f('0x5'));var moment=require(_0x8d4f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8d4f('0x7'));var util=require(_0x8d4f('0x8'));var path=require('path');var sox=require(_0x8d4f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8d4f('0xa'));var squel=require(_0x8d4f('0xb'));var crypto=require('crypto');var jsforce=require(_0x8d4f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8d4f('0xd'));var querystring=require('querystring');var Papa=require(_0x8d4f('0xe'));var Redis=require('ioredis');var authService=require(_0x8d4f('0xf'));var qs=require(_0x8d4f('0x10'));var as=require(_0x8d4f('0x11'));var hardwareService=require(_0x8d4f('0x12'));var logger=require(_0x8d4f('0x13'))(_0x8d4f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8d4f('0x15'))['db'];function respondWithStatusCode(_0x4602d3,_0x2c222f){_0x2c222f=_0x2c222f||0xcc;return function(_0x3dd20a){if(_0x3dd20a){return _0x4602d3[_0x8d4f('0x16')](_0x2c222f);}return _0x4602d3[_0x8d4f('0x17')](_0x2c222f)[_0x8d4f('0x18')]();};}function respondWithResult(_0xd0e9f7,_0x988128){_0x988128=_0x988128||0xc8;return function(_0x54d5de){if(_0x54d5de){return _0xd0e9f7[_0x8d4f('0x17')](_0x988128)['json'](_0x54d5de);}};}function respondWithFilteredResult(_0x159972,_0x108a13){return function(_0x14b96a){if(_0x14b96a){var _0x2154e9=_0x14b96a[_0x8d4f('0x19')],_0x4c0308=_0x108a13[_0x8d4f('0x1a')],_0x1ef012=_0x108a13[_0x8d4f('0x1a')]+_0x108a13[_0x8d4f('0x1b')],_0x2298c4;if(_0x1ef012>=_0x2154e9){_0x1ef012=_0x2154e9;_0x2298c4=0xc8;}else{_0x2298c4=0xce;}_0x159972['status'](_0x2298c4);return _0x159972[_0x8d4f('0x1c')](_0x8d4f('0x1d'),_0x4c0308+'-'+_0x1ef012+'/'+_0x2154e9)[_0x8d4f('0x1e')](_0x14b96a);}return null;};}function patchUpdates(_0x26b039){return function(_0x522ec4){try{jsonpatch[_0x8d4f('0x1f')](_0x522ec4,_0x26b039,!![]);}catch(_0x23489d){return BPromise[_0x8d4f('0x20')](_0x23489d);}return _0x522ec4[_0x8d4f('0x21')]();};}function saveUpdates(_0x1d7664,_0x1cb4f6){return function(_0x55b6fd){if(_0x55b6fd){return _0x55b6fd[_0x8d4f('0x22')](_0x1d7664)[_0x8d4f('0x23')](function(_0x360775){return _0x360775;});}return null;};}function removeEntity(_0x346d90,_0x26c2ce){return function(_0x55e598){if(_0x55e598){return _0x55e598[_0x8d4f('0x24')]()[_0x8d4f('0x23')](function(){_0x346d90[_0x8d4f('0x17')](0xcc)[_0x8d4f('0x18')]();});}};}function handleEntityNotFound(_0x1fc106,_0x8f5645){return function(_0x3f3385){if(!_0x3f3385){_0x1fc106['sendStatus'](0x194);}return _0x3f3385;};}function handleError(_0x436e2a,_0x5a845e){_0x5a845e=_0x5a845e||0x1f4;return function(_0xee2c65){logger[_0x8d4f('0x25')](_0xee2c65[_0x8d4f('0x26')]);if(_0xee2c65[_0x8d4f('0x27')]){delete _0xee2c65[_0x8d4f('0x27')];}_0x436e2a[_0x8d4f('0x17')](_0x5a845e)['send'](_0xee2c65);};}exports['index']=function(_0x5181ed,_0x4a040e){var _0x254665={},_0x50f7aa={},_0xf65c7a={'count':0x0,'rows':[]};var _0x1ea97f=_['map'](db[_0x8d4f('0x28')][_0x8d4f('0x29')],function(_0x498fdf){return{'name':_0x498fdf[_0x8d4f('0x2a')],'type':_0x498fdf[_0x8d4f('0x2b')][_0x8d4f('0x2c')]};});_0x50f7aa[_0x8d4f('0x2d')]=_[_0x8d4f('0x2e')](_0x1ea97f,_0x8d4f('0x27'));_0x50f7aa[_0x8d4f('0x2f')]=_[_0x8d4f('0x30')](_0x5181ed[_0x8d4f('0x2f')]);_0x50f7aa[_0x8d4f('0x31')]=_['intersection'](_0x50f7aa[_0x8d4f('0x2d')],_0x50f7aa[_0x8d4f('0x2f')]);_0x254665[_0x8d4f('0x32')]=_[_0x8d4f('0x33')](_0x50f7aa[_0x8d4f('0x2d')],qs[_0x8d4f('0x34')](_0x5181ed[_0x8d4f('0x2f')][_0x8d4f('0x34')]));_0x254665[_0x8d4f('0x32')]=_0x254665[_0x8d4f('0x32')][_0x8d4f('0x35')]?_0x254665['attributes']:_0x50f7aa[_0x8d4f('0x2d')];if(!_0x5181ed['query'][_0x8d4f('0x36')](_0x8d4f('0x37'))){_0x254665[_0x8d4f('0x1b')]=qs[_0x8d4f('0x1b')](_0x5181ed[_0x8d4f('0x2f')][_0x8d4f('0x1b')]);_0x254665[_0x8d4f('0x1a')]=qs[_0x8d4f('0x1a')](_0x5181ed[_0x8d4f('0x2f')]['offset']);}_0x254665['order']=qs[_0x8d4f('0x38')](_0x5181ed[_0x8d4f('0x2f')]['sort']);_0x254665[_0x8d4f('0x39')]=qs['filters'](_['pick'](_0x5181ed['query'],_0x50f7aa[_0x8d4f('0x31')]));if(_0x5181ed['query'][_0x8d4f('0x3a')]){_0x254665[_0x8d4f('0x39')]=_[_0x8d4f('0x3b')](_0x254665[_0x8d4f('0x39')],{'$or':_[_0x8d4f('0x2e')](_0x1ea97f,function(_0x5d01c0){if(_0x5d01c0[_0x8d4f('0x2b')]!==_0x8d4f('0x3c')){var _0x5021d3={};_0x5021d3[_0x5d01c0[_0x8d4f('0x27')]]={'$like':'%'+_0x5181ed[_0x8d4f('0x2f')]['filter']+'%'};return _0x5021d3;}})});}_0x254665=_[_0x8d4f('0x3b')]({},_0x254665,_0x5181ed[_0x8d4f('0x3d')]);var _0xc548eb={'where':_0x254665[_0x8d4f('0x39')]};return db[_0x8d4f('0x28')][_0x8d4f('0x19')](_0xc548eb)['then'](function(_0x4c6902){_0xf65c7a[_0x8d4f('0x19')]=_0x4c6902;if(_0x5181ed[_0x8d4f('0x2f')][_0x8d4f('0x3e')]){_0x254665[_0x8d4f('0x3f')]=[{'all':!![]}];}return db[_0x8d4f('0x28')][_0x8d4f('0x40')](_0x254665);})['then'](function(_0x2060d6){_0xf65c7a['rows']=_0x2060d6;return _0xf65c7a;})[_0x8d4f('0x23')](respondWithFilteredResult(_0x4a040e,_0x254665))[_0x8d4f('0x41')](handleError(_0x4a040e,null));};exports[_0x8d4f('0x42')]=function(_0x13a8a3,_0x33e5ac){var _0x68b1b6={'raw':!![],'where':{'id':_0x13a8a3[_0x8d4f('0x43')]['id']}},_0x41a305={};_0x41a305[_0x8d4f('0x2d')]=_[_0x8d4f('0x30')](db[_0x8d4f('0x28')][_0x8d4f('0x29')]);_0x41a305[_0x8d4f('0x2f')]=_[_0x8d4f('0x30')](_0x13a8a3[_0x8d4f('0x2f')]);_0x41a305['filters']=_[_0x8d4f('0x33')](_0x41a305[_0x8d4f('0x2d')],_0x41a305[_0x8d4f('0x2f')]);_0x68b1b6[_0x8d4f('0x32')]=_[_0x8d4f('0x33')](_0x41a305['model'],qs[_0x8d4f('0x34')](_0x13a8a3[_0x8d4f('0x2f')]['fields']));_0x68b1b6[_0x8d4f('0x32')]=_0x68b1b6['attributes']['length']?_0x68b1b6['attributes']:_0x41a305[_0x8d4f('0x2d')];if(_0x13a8a3[_0x8d4f('0x2f')]['includeAll']){_0x68b1b6[_0x8d4f('0x3f')]=[{'all':!![]}];}_0x68b1b6=_[_0x8d4f('0x3b')]({},_0x68b1b6,_0x13a8a3[_0x8d4f('0x3d')]);return db[_0x8d4f('0x28')][_0x8d4f('0x44')](_0x68b1b6)[_0x8d4f('0x23')](handleEntityNotFound(_0x33e5ac,null))['then'](respondWithResult(_0x33e5ac,null))[_0x8d4f('0x41')](handleError(_0x33e5ac,null));};exports[_0x8d4f('0x45')]=function(_0x4d9a91,_0xe633c1){return db[_0x8d4f('0x28')]['create'](_0x4d9a91[_0x8d4f('0x46')],{})[_0x8d4f('0x23')](respondWithResult(_0xe633c1,0xc9))[_0x8d4f('0x41')](handleError(_0xe633c1,null));};exports['update']=function(_0x4c48ff,_0x1e07ee){if(_0x4c48ff[_0x8d4f('0x46')]['id']){delete _0x4c48ff[_0x8d4f('0x46')]['id'];}return db[_0x8d4f('0x28')][_0x8d4f('0x44')]({'where':{'id':_0x4c48ff[_0x8d4f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e07ee,null))[_0x8d4f('0x23')](saveUpdates(_0x4c48ff[_0x8d4f('0x46')],null))[_0x8d4f('0x23')](respondWithResult(_0x1e07ee,null))[_0x8d4f('0x41')](handleError(_0x1e07ee,null));};exports['destroy']=function(_0x5bf1af,_0x59bb0d){return db['ChatTransferReport']['find']({'where':{'id':_0x5bf1af[_0x8d4f('0x43')]['id']}})[_0x8d4f('0x23')](handleEntityNotFound(_0x59bb0d,null))[_0x8d4f('0x23')](removeEntity(_0x59bb0d,null))[_0x8d4f('0x41')](handleError(_0x59bb0d,null));};exports[_0x8d4f('0x47')]=function(_0x3fd863,_0x303792){return db[_0x8d4f('0x28')][_0x8d4f('0x47')]()['then'](respondWithResult(_0x303792,null))[_0x8d4f('0x41')](handleError(_0x303792,null));}; \ No newline at end of file +var _0xccc9=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','count','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','html-pdf','rimraf','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','filters'];(function(_0x33ab78,_0xe43c54){var _0x2504b8=function(_0x5e0e48){while(--_0x5e0e48){_0x33ab78['push'](_0x33ab78['shift']());}};_0x2504b8(++_0xe43c54);}(_0xccc9,0xf0));var _0x9ccc=function(_0x550cc3,_0x452b54){_0x550cc3=_0x550cc3-0x0;var _0x44670f=_0xccc9[_0x550cc3];return _0x44670f;};'use strict';var pdf=require(_0x9ccc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ccc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9ccc('0x2'));var moment=require(_0x9ccc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9ccc('0x4'));var path=require('path');var sox=require(_0x9ccc('0x5'));var csv=require(_0x9ccc('0x6'));var ejs=require(_0x9ccc('0x7'));var fs=require('fs');var _=require(_0x9ccc('0x8'));var squel=require(_0x9ccc('0x9'));var crypto=require(_0x9ccc('0xa'));var jsforce=require(_0x9ccc('0xb'));var deskjs=require(_0x9ccc('0xc'));var toCsv=require(_0x9ccc('0x6'));var querystring=require(_0x9ccc('0xd'));var Papa=require(_0x9ccc('0xe'));var Redis=require(_0x9ccc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9ccc('0x10'));var as=require(_0x9ccc('0x11'));var hardwareService=require(_0x9ccc('0x12'));var logger=require('../../config/logger')(_0x9ccc('0x13'));var utils=require(_0x9ccc('0x14'));var config=require(_0x9ccc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217be1,_0x23a900){_0x23a900=_0x23a900||0xcc;return function(_0x2fb950){if(_0x2fb950){return _0x217be1[_0x9ccc('0x16')](_0x23a900);}return _0x217be1[_0x9ccc('0x17')](_0x23a900)[_0x9ccc('0x18')]();};}function respondWithResult(_0x4586b3,_0x1164cc){_0x1164cc=_0x1164cc||0xc8;return function(_0x3eceab){if(_0x3eceab){return _0x4586b3[_0x9ccc('0x17')](_0x1164cc)[_0x9ccc('0x19')](_0x3eceab);}};}function respondWithFilteredResult(_0x39418a,_0x88d7fb){return function(_0x271657){if(_0x271657){var _0x5f4d0b=_0x271657['count'],_0x3e720b=_0x88d7fb[_0x9ccc('0x1a')],_0x10d62d=_0x88d7fb[_0x9ccc('0x1a')]+_0x88d7fb[_0x9ccc('0x1b')],_0x3a25ae;if(_0x10d62d>=_0x5f4d0b){_0x10d62d=_0x5f4d0b;_0x3a25ae=0xc8;}else{_0x3a25ae=0xce;}_0x39418a[_0x9ccc('0x17')](_0x3a25ae);return _0x39418a[_0x9ccc('0x1c')](_0x9ccc('0x1d'),_0x3e720b+'-'+_0x10d62d+'/'+_0x5f4d0b)['json'](_0x271657);}return null;};}function patchUpdates(_0x100946){return function(_0x44680d){try{jsonpatch[_0x9ccc('0x1e')](_0x44680d,_0x100946,!![]);}catch(_0x5cb5d6){return BPromise['reject'](_0x5cb5d6);}return _0x44680d['save']();};}function saveUpdates(_0x2cca6c,_0x85a682){return function(_0x9ae1d6){if(_0x9ae1d6){return _0x9ae1d6[_0x9ccc('0x1f')](_0x2cca6c)[_0x9ccc('0x20')](function(_0x3372c3){return _0x3372c3;});}return null;};}function removeEntity(_0x30cf6a,_0x533627){return function(_0x4f4a6c){if(_0x4f4a6c){return _0x4f4a6c['destroy']()[_0x9ccc('0x20')](function(){_0x30cf6a['status'](0xcc)[_0x9ccc('0x18')]();});}};}function handleEntityNotFound(_0x3f2fd4,_0x524b1a){return function(_0x256b24){if(!_0x256b24){_0x3f2fd4[_0x9ccc('0x16')](0x194);}return _0x256b24;};}function handleError(_0x101261,_0x2e7b38){_0x2e7b38=_0x2e7b38||0x1f4;return function(_0x1f4cc8){logger[_0x9ccc('0x21')](_0x1f4cc8['stack']);if(_0x1f4cc8[_0x9ccc('0x22')]){delete _0x1f4cc8['name'];}_0x101261[_0x9ccc('0x17')](_0x2e7b38)['send'](_0x1f4cc8);};}exports[_0x9ccc('0x23')]=function(_0x41025a,_0x4e983d){var _0x403af4={},_0x4ff1a4={},_0x41d194={'count':0x0,'rows':[]};var _0x5a8940=_[_0x9ccc('0x24')](db[_0x9ccc('0x25')][_0x9ccc('0x26')],function(_0x30bca3){return{'name':_0x30bca3[_0x9ccc('0x27')],'type':_0x30bca3[_0x9ccc('0x28')]['key']};});_0x4ff1a4[_0x9ccc('0x29')]=_[_0x9ccc('0x24')](_0x5a8940,'name');_0x4ff1a4[_0x9ccc('0x2a')]=_['keys'](_0x41025a['query']);_0x4ff1a4[_0x9ccc('0x2b')]=_['intersection'](_0x4ff1a4['model'],_0x4ff1a4[_0x9ccc('0x2a')]);_0x403af4[_0x9ccc('0x2c')]=_[_0x9ccc('0x2d')](_0x4ff1a4[_0x9ccc('0x29')],qs['fields'](_0x41025a[_0x9ccc('0x2a')][_0x9ccc('0x2e')]));_0x403af4['attributes']=_0x403af4[_0x9ccc('0x2c')][_0x9ccc('0x2f')]?_0x403af4[_0x9ccc('0x2c')]:_0x4ff1a4[_0x9ccc('0x29')];if(!_0x41025a[_0x9ccc('0x2a')][_0x9ccc('0x30')](_0x9ccc('0x31'))){_0x403af4[_0x9ccc('0x1b')]=qs[_0x9ccc('0x1b')](_0x41025a[_0x9ccc('0x2a')][_0x9ccc('0x1b')]);_0x403af4[_0x9ccc('0x1a')]=qs['offset'](_0x41025a['query'][_0x9ccc('0x1a')]);}_0x403af4[_0x9ccc('0x32')]=qs[_0x9ccc('0x33')](_0x41025a['query'][_0x9ccc('0x33')]);_0x403af4['where']=qs[_0x9ccc('0x2b')](_[_0x9ccc('0x34')](_0x41025a[_0x9ccc('0x2a')],_0x4ff1a4[_0x9ccc('0x2b')]));if(_0x41025a[_0x9ccc('0x2a')]['filter']){_0x403af4[_0x9ccc('0x35')]=_[_0x9ccc('0x36')](_0x403af4[_0x9ccc('0x35')],{'$or':_[_0x9ccc('0x24')](_0x5a8940,function(_0x1b6dfb){if(_0x1b6dfb['type']!=='VIRTUAL'){var _0x5cda82={};_0x5cda82[_0x1b6dfb[_0x9ccc('0x22')]]={'$like':'%'+_0x41025a[_0x9ccc('0x2a')][_0x9ccc('0x37')]+'%'};return _0x5cda82;}})});}_0x403af4=_[_0x9ccc('0x36')]({},_0x403af4,_0x41025a[_0x9ccc('0x38')]);var _0x3922b6={'where':_0x403af4['where']};return db[_0x9ccc('0x25')]['count'](_0x3922b6)['then'](function(_0x260989){_0x41d194[_0x9ccc('0x39')]=_0x260989;if(_0x41025a[_0x9ccc('0x2a')]['includeAll']){_0x403af4[_0x9ccc('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9ccc('0x3b')](_0x403af4);})[_0x9ccc('0x20')](function(_0x4266d2){_0x41d194[_0x9ccc('0x3c')]=_0x4266d2;return _0x41d194;})[_0x9ccc('0x20')](respondWithFilteredResult(_0x4e983d,_0x403af4))[_0x9ccc('0x3d')](handleError(_0x4e983d,null));};exports[_0x9ccc('0x3e')]=function(_0x1bc7ef,_0x2bde60){var _0x59078d={'raw':!![],'where':{'id':_0x1bc7ef[_0x9ccc('0x3f')]['id']}},_0x4299f4={};_0x4299f4['model']=_[_0x9ccc('0x40')](db['ChatTransferReport']['rawAttributes']);_0x4299f4[_0x9ccc('0x2a')]=_[_0x9ccc('0x40')](_0x1bc7ef[_0x9ccc('0x2a')]);_0x4299f4[_0x9ccc('0x2b')]=_[_0x9ccc('0x2d')](_0x4299f4[_0x9ccc('0x29')],_0x4299f4[_0x9ccc('0x2a')]);_0x59078d[_0x9ccc('0x2c')]=_['intersection'](_0x4299f4[_0x9ccc('0x29')],qs[_0x9ccc('0x2e')](_0x1bc7ef[_0x9ccc('0x2a')][_0x9ccc('0x2e')]));_0x59078d[_0x9ccc('0x2c')]=_0x59078d[_0x9ccc('0x2c')]['length']?_0x59078d[_0x9ccc('0x2c')]:_0x4299f4[_0x9ccc('0x29')];if(_0x1bc7ef['query'][_0x9ccc('0x41')]){_0x59078d[_0x9ccc('0x3a')]=[{'all':!![]}];}_0x59078d=_[_0x9ccc('0x36')]({},_0x59078d,_0x1bc7ef[_0x9ccc('0x38')]);return db['ChatTransferReport'][_0x9ccc('0x42')](_0x59078d)[_0x9ccc('0x20')](handleEntityNotFound(_0x2bde60,null))['then'](respondWithResult(_0x2bde60,null))['catch'](handleError(_0x2bde60,null));};exports[_0x9ccc('0x43')]=function(_0x913255,_0x43d5c1){return db['ChatTransferReport'][_0x9ccc('0x43')](_0x913255[_0x9ccc('0x44')],{})[_0x9ccc('0x20')](respondWithResult(_0x43d5c1,0xc9))[_0x9ccc('0x3d')](handleError(_0x43d5c1,null));};exports[_0x9ccc('0x1f')]=function(_0x25631b,_0x2572f4){if(_0x25631b[_0x9ccc('0x44')]['id']){delete _0x25631b['body']['id'];}return db[_0x9ccc('0x25')][_0x9ccc('0x42')]({'where':{'id':_0x25631b[_0x9ccc('0x3f')]['id']}})[_0x9ccc('0x20')](handleEntityNotFound(_0x2572f4,null))[_0x9ccc('0x20')](saveUpdates(_0x25631b[_0x9ccc('0x44')],null))[_0x9ccc('0x20')](respondWithResult(_0x2572f4,null))[_0x9ccc('0x3d')](handleError(_0x2572f4,null));};exports[_0x9ccc('0x45')]=function(_0x5b061f,_0x23fb67){return db[_0x9ccc('0x25')][_0x9ccc('0x42')]({'where':{'id':_0x5b061f[_0x9ccc('0x3f')]['id']}})[_0x9ccc('0x20')](handleEntityNotFound(_0x23fb67,null))[_0x9ccc('0x20')](removeEntity(_0x23fb67,null))[_0x9ccc('0x3d')](handleError(_0x23fb67,null));};exports[_0x9ccc('0x46')]=function(_0x303a63,_0x2a3c76){return db[_0x9ccc('0x25')][_0x9ccc('0x46')]()['then'](respondWithResult(_0x2a3c76,null))['catch'](handleError(_0x2a3c76,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 4d021d3..b90cbce 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 _0x6f5c=['./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x280734,_0x56feee){var _0x22f4e1=function(_0x53cb56){while(--_0x53cb56){_0x280734['push'](_0x280734['shift']());}};_0x22f4e1(++_0x56feee);}(_0x6f5c,0x7a));var _0xc6f5=function(_0x220d8c,_0x59a96a){_0x220d8c=_0x220d8c-0x0;var _0x1f84ba=_0x6f5c[_0x220d8c];return _0x1f84ba;};'use strict';var _=require(_0xc6f5('0x0'));var util=require(_0xc6f5('0x1'));var logger=require(_0xc6f5('0x2'))(_0xc6f5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc6f5('0x4'));var fs=require('fs');var path=require(_0xc6f5('0x5'));var rimraf=require(_0xc6f5('0x6'));var config=require(_0xc6f5('0x7'));var attributes=require(_0xc6f5('0x8'));module['exports']=function(_0x42711d,_0xb1781){return _0x42711d[_0xc6f5('0x9')](_0xc6f5('0xa'),attributes,{'tableName':_0xc6f5('0xb'),'paranoid':![],'indexes':[{'name':_0xc6f5('0xc'),'fields':[_0xc6f5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa30d=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4b0676,_0x2ffff0){var _0x38e7be=function(_0x3bd3a4){while(--_0x3bd3a4){_0x4b0676['push'](_0x4b0676['shift']());}};_0x38e7be(++_0x2ffff0);}(_0xa30d,0x1e9));var _0xda30=function(_0x1a0f9b,_0x53381f){_0x1a0f9b=_0x1a0f9b-0x0;var _0x5dea8f=_0xa30d[_0x1a0f9b];return _0x5dea8f;};'use strict';var _=require(_0xda30('0x0'));var util=require('util');var logger=require(_0xda30('0x1'))('api');var moment=require(_0xda30('0x2'));var BPromise=require(_0xda30('0x3'));var rp=require(_0xda30('0x4'));var fs=require('fs');var path=require(_0xda30('0x5'));var rimraf=require(_0xda30('0x6'));var config=require(_0xda30('0x7'));var attributes=require(_0xda30('0x8'));module[_0xda30('0x9')]=function(_0x4ae145,_0x47f74f){return _0x4ae145[_0xda30('0xa')](_0xda30('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xda30('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8acae3d..ca5e111 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 _0x32b1=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32b1,0xbc));var _0x132b=function(_0x171ecf,_0x55e178){_0x171ecf=_0x171ecf-0x0;var _0x30ddcc=_0x32b1[_0x171ecf];return _0x30ddcc;};'use strict';var _=require(_0x132b('0x0'));var util=require(_0x132b('0x1'));var moment=require('moment');var BPromise=require(_0x132b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x132b('0x3'));var db=require(_0x132b('0x4'))['db'];var utils=require(_0x132b('0x5'));var logger=require('../../config/logger')(_0x132b('0x6'));var config=require('../../config/environment');var jayson=require(_0x132b('0x7'));var client=jayson[_0x132b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce2f0,_0x2a5819,_0x58085b){return new BPromise(function(_0x118dd6,_0x1db8fa){return client['request'](_0x5ce2f0,_0x58085b)[_0x132b('0x9')](function(_0x156b9a){logger[_0x132b('0xa')](_0x132b('0xb'),_0x2a5819,'request\x20sent');logger[_0x132b('0xc')](_0x132b('0xd'),_0x2a5819,'request\x20sent',JSON[_0x132b('0xe')](_0x156b9a));if(_0x156b9a[_0x132b('0xf')]){if(_0x156b9a['error'][_0x132b('0x10')]===0x1f4){logger[_0x132b('0xf')](_0x132b('0xb'),_0x2a5819,_0x156b9a[_0x132b('0xf')][_0x132b('0x11')]);return _0x1db8fa(_0x156b9a[_0x132b('0xf')]['message']);}logger[_0x132b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2a5819,_0x156b9a[_0x132b('0xf')][_0x132b('0x11')]);return _0x118dd6(_0x156b9a[_0x132b('0xf')][_0x132b('0x11')]);}else{logger[_0x132b('0xa')](_0x132b('0xb'),_0x2a5819,_0x132b('0x12'));_0x118dd6(_0x156b9a['result'][_0x132b('0x11')]);}})[_0x132b('0x13')](function(_0x4e8a44){logger[_0x132b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2a5819,_0x4e8a44);_0x1db8fa(_0x4e8a44);});});} \ No newline at end of file +var _0xe007=['ioredis','../../config/logger','rpc','../../config/environment','request','then','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird'];(function(_0xf72888,_0x661b9d){var _0x58ed5f=function(_0x390d52){while(--_0x390d52){_0xf72888['push'](_0xf72888['shift']());}};_0x58ed5f(++_0x661b9d);}(_0xe007,0xe7));var _0x7e00=function(_0x13ccb1,_0x4afdcc){_0x13ccb1=_0x13ccb1-0x0;var _0x4a87ec=_0xe007[_0x13ccb1];return _0x4a87ec;};'use strict';var _=require(_0x7e00('0x0'));var util=require('util');var moment=require(_0x7e00('0x1'));var BPromise=require(_0x7e00('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e00('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e00('0x4'))(_0x7e00('0x5'));var config=require(_0x7e00('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b9f09,_0x52f725,_0x4d4c0a){return new BPromise(function(_0x69dce5,_0x56ca32){return client[_0x7e00('0x7')](_0x5b9f09,_0x4d4c0a)[_0x7e00('0x8')](function(_0x416bb3){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x52f725,'request\x20sent');logger['debug'](_0x7e00('0x9'),_0x52f725,_0x7e00('0xa'),JSON[_0x7e00('0xb')](_0x416bb3));if(_0x416bb3['error']){if(_0x416bb3[_0x7e00('0xc')]['code']===0x1f4){logger['error'](_0x7e00('0xd'),_0x52f725,_0x416bb3[_0x7e00('0xc')][_0x7e00('0xe')]);return _0x56ca32(_0x416bb3[_0x7e00('0xc')][_0x7e00('0xe')]);}logger[_0x7e00('0xc')](_0x7e00('0xd'),_0x52f725,_0x416bb3[_0x7e00('0xc')]['message']);return _0x69dce5(_0x416bb3[_0x7e00('0xc')][_0x7e00('0xe')]);}else{logger[_0x7e00('0xf')](_0x7e00('0xd'),_0x52f725,_0x7e00('0xa'));_0x69dce5(_0x416bb3[_0x7e00('0x10')][_0x7e00('0xe')]);}})[_0x7e00('0x11')](function(_0x26421e){logger[_0x7e00('0xc')](_0x7e00('0xd'),_0x52f725,_0x26421e);_0x56ca32(_0x26421e);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d00318e..ff79836 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 _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1eb4e0,_0x4ebc2d){var _0x18ec21=function(_0x28c9a9){while(--_0x28c9a9){_0x1eb4e0['push'](_0x1eb4e0['shift']());}};_0x18ec21(++_0x4ebc2d);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d9247,_0x2a2022){_0x2d9247=_0x2d9247-0x0;var _0x53a817=_0xb10b[_0x2d9247];return _0x53a817;};'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 _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index a690796..822beb9 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 _0x7b99=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','stringify','input','name','text','email','getDataValue','onlineForm','parse','setDataValue','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:','Your\x20request\x20has\x20not\x20been\x20processed.','#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','Chat','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note'];(function(_0x34b4f6,_0x318afd){var _0x297299=function(_0x34b8c2){while(--_0x34b8c2){_0x34b4f6['push'](_0x34b4f6['shift']());}};_0x297299(++_0x318afd);}(_0x7b99,0x1e9));var _0x97b9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7b99[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x97b9('0x0'));module[_0x97b9('0x1')]={'name':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![],'unique':_0x97b9('0x3')},'description':{'type':Sequelize[_0x97b9('0x2')]},'mapKey':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x4')},'customerAlias':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![],'defaultValue':_0x97b9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![],'defaultValue':_0x97b9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x97b9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x97b9('0x2')]},'animation':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x97b9('0x9')](_0x97b9('0xa'),_0x97b9('0xb')),'defaultValue':_0x97b9('0xa')},'header_online':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0xc')},'offline_chat_button':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x97b9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x97b9('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x97b9('0xf')},'noteTitle':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x10')},'placeholderMessage':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x97b9('0x12')},'closingMessageButton':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x13')},'skipMessageButton':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x14')},'conditionAgreement':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x15')},'ratingType':{'type':Sequelize[_0x97b9('0x9')](_0x97b9('0x16'),'thumb'),'defaultValue':_0x97b9('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x97b9('0x17')]({'items':[{'type':_0x97b9('0x18'),'variable':null,'config':{'placeholder':_0x97b9('0x19'),'type':_0x97b9('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x97b9('0x18'),'props':{'title':_0x97b9('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x97b9('0x1b'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x97b9('0x1c')](_0x97b9('0x1d'))?JSON[_0x97b9('0x1e')](this[_0x97b9('0x1c')](_0x97b9('0x1d'))):{};},'set':function(_0x269323){return this[_0x97b9('0x1f')](_0x97b9('0x1d'),JSON[_0x97b9('0x17')](_0x269323));}},'offlineForm':{'type':Sequelize[_0x97b9('0xe')],'defaultValue':function(){return JSON[_0x97b9('0x17')]({'items':[{'type':_0x97b9('0x18'),'props':{'title':_0x97b9('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x97b9('0x1b'),'type':_0x97b9('0x1b')},'variable':null},{'type':_0x97b9('0x20'),'config':{'placeholder':_0x97b9('0x21')},'props':{'title':_0x97b9('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x97b9('0x1c')]('offlineForm')?JSON[_0x97b9('0x1e')](this[_0x97b9('0x1c')](_0x97b9('0x22'))):{};},'set':function(_0x1a2bb9){return this[_0x97b9('0x1f')](_0x97b9('0x22'),JSON[_0x97b9('0x17')](_0x1a2bb9));}},'token':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':function(){return rs[_0x97b9('0x23')]();}},'autoclose':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x97b9('0x2')]},'forwardOffline':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x97b9('0x2')]},'waitingTitle':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x24')},'waitingMessage':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x97b9('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x97b9('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x97b9('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x97b9('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x97b9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x97b9('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x97b9('0x2')]},'customerAvatar':{'type':Sequelize[_0x97b9('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x97b9('0x2')],'allowNull':![],'defaultValue':_0x97b9('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x97b9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x97b9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x97b9('0x2')],'defaultValue':_0x97b9('0x29')},'systemAvatar':{'type':Sequelize[_0x97b9('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x97b9('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![],'comment':_0x97b9('0x2b'),'set':function(_0x299d8d){if(!_0x299d8d)this['setDataValue'](_0x97b9('0x2c'),null);this[_0x97b9('0x1f')](_0x97b9('0x2d'),_0x299d8d);}}}; \ No newline at end of file +var _0xf36d=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','Comments','Leave\x20your\x20comments','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System'];(function(_0x27a3a8,_0x120124){var _0x3c4b89=function(_0x46e952){while(--_0x46e952){_0x27a3a8['push'](_0x27a3a8['shift']());}};_0x3c4b89(++_0x120124);}(_0xf36d,0x1b3));var _0xdf36=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xf36d[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require(_0xdf36('0x0'));var rs=require(_0xdf36('0x1'));module[_0xdf36('0x2')]={'name':{'type':Sequelize[_0xdf36('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdf36('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x5')},'key':{'type':Sequelize[_0xdf36('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x6')},'customerAlias':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdf36('0x3')],'allowNull':![],'defaultValue':_0xdf36('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdf36('0x3')],'allowNull':![],'defaultValue':_0xdf36('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdf36('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdf36('0x3')]},'animation':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdf36('0xb')](_0xdf36('0xc'),_0xdf36('0xd')),'defaultValue':_0xdf36('0xc')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0xe')},'start_chat_button':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0xf')},'offline_chat_button':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x10')},'header_offline':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x11')},'download_transcript':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x14')},'noteTitle':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x16')},'closingMessage':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xdf36('0x19'),'thumb'),'defaultValue':_0xdf36('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xdf36('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdf36('0x1a')],'defaultValue':function(){return JSON[_0xdf36('0x1b')]({'items':[{'type':_0xdf36('0x1c'),'variable':null,'config':{'placeholder':_0xdf36('0x1d'),'type':_0xdf36('0x1e'),'required':!![]},'props':{'title':_0xdf36('0x1d'),'helpText':''}},{'type':_0xdf36('0x1c'),'props':{'title':_0xdf36('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdf36('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xdf36('0x1f'))?JSON[_0xdf36('0x20')](this[_0xdf36('0x21')](_0xdf36('0x1f'))):{};},'set':function(_0x458c6d){return this['setDataValue'](_0xdf36('0x1f'),JSON[_0xdf36('0x1b')](_0x458c6d));}},'offlineForm':{'type':Sequelize[_0xdf36('0x1a')],'defaultValue':function(){return JSON[_0xdf36('0x1b')]({'items':[{'type':_0xdf36('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xdf36('0x5'),'type':_0xdf36('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xdf36('0x22')},'props':{'title':_0xdf36('0x22'),'helpText':_0xdf36('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xdf36('0x21')]('offlineForm')?JSON[_0xdf36('0x20')](this[_0xdf36('0x21')]('offlineForm')):{};},'set':function(_0x35e060){return this[_0xdf36('0x24')]('offlineForm',JSON[_0xdf36('0x1b')](_0x35e060));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdf36('0x3')]},'forwardOffline':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdf36('0x3')]},'waitingTitle':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x27')},'skipUnmanaged':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x18')},'sendUnmanaged':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdf36('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xdf36('0x1a')],'defaultValue':function(){return _0xdf36('0x28');}},'notificationSound':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xdf36('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x2a')},'verticalAlignment':{'type':Sequelize[_0xdf36('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':_0xdf36('0x2b')},'defaultTitle':{'type':Sequelize[_0xdf36('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdf36('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdf36('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf36('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xdf36('0x2c')},'systemAvatar':{'type':Sequelize[_0xdf36('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdf36('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xdf36('0xa')],'defaultValue':![],'comment':_0xdf36('0x2d'),'set':function(_0x47bd8a){if(!_0x47bd8a)this[_0xdf36('0x24')](_0xdf36('0x2e'),null);this[_0xdf36('0x24')](_0xdf36('0x2f'),_0x47bd8a);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 01b7776..979bbc6 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 _0x2b4a=['verticalAlignment','addApplications','sequelize','ChatApplication','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','filters','intersection','fields','model','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','attributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','addDisposition','ChatWebsiteId','Disposition','pick','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','isNil','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','list','orderBy','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','autoclose','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','Contact','fullname','internal','Tag','Tags','color','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','info','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','replace','alignment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x2b4a[_0x324e86];return _0x592846;};'use strict';var pdf=require(_0xa2b4('0x0'));var emlformat=require(_0xa2b4('0x1'));var rimraf=require(_0xa2b4('0x2'));var zipdir=require(_0xa2b4('0x3'));var jsonpatch=require(_0xa2b4('0x4'));var rp=require(_0xa2b4('0x5'));var moment=require(_0xa2b4('0x6'));var BPromise=require(_0xa2b4('0x7'));var Mustache=require('mustache');var util=require(_0xa2b4('0x8'));var path=require(_0xa2b4('0x9'));var sox=require(_0xa2b4('0xa'));var csv=require(_0xa2b4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa2b4('0xc'));var squel=require(_0xa2b4('0xd'));var crypto=require('crypto');var jsforce=require(_0xa2b4('0xe'));var deskjs=require(_0xa2b4('0xf'));var toCsv=require(_0xa2b4('0xb'));var querystring=require(_0xa2b4('0x10'));var Papa=require(_0xa2b4('0x11'));var Redis=require(_0xa2b4('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa2b4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2b4('0x14'))(_0xa2b4('0x15'));var utils=require(_0xa2b4('0x16'));var config=require(_0xa2b4('0x17'));var db=require(_0xa2b4('0x18'))['db'];config[_0xa2b4('0x19')]=_[_0xa2b4('0x1a')](config[_0xa2b4('0x19')],{'host':_0xa2b4('0x1b'),'port':0x18eb});var socket=require(_0xa2b4('0x1c'))(new Redis(config[_0xa2b4('0x19')]));require(_0xa2b4('0x1d'))[_0xa2b4('0x1e')](socket);var jayson=require(_0xa2b4('0x1f'));var client=jayson['client'][_0xa2b4('0x20')]({'port':0x232c});var client9002=jayson[_0xa2b4('0x21')][_0xa2b4('0x20')]({'port':0x232a});var client9003=jayson[_0xa2b4('0x21')][_0xa2b4('0x20')]({'port':0x232b});function checkPasswordPattern(_0x3ba4b5,_0x529a92,_0x326491){if(_0x326491){var _0x1b7bc3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b7bc3[_0xa2b4('0x22')](_0x529a92)){return _0x3ba4b5;}else{throw new db[(_0xa2b4('0x23'))]['ValidationError'](_0xa2b4('0x24'));}}else{return _0x3ba4b5;}}function respondWithRpcPromise(_0x3083ea,_0x235914,_0x1c13f6,_0x6ed641){return new BPromise(function(_0x5d6ce3,_0x66db7f){var _0x2a6e1e=_0x6ed641||client;return _0x2a6e1e[_0xa2b4('0x25')](_0x3083ea,_0x1c13f6)[_0xa2b4('0x26')](function(_0x4e41f0){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x235914,_0xa2b4('0x27'));logger['debug'](_0xa2b4('0x28'),_0x235914,_0xa2b4('0x27'),JSON[_0xa2b4('0x29')](_0x4e41f0));if(_0x4e41f0[_0xa2b4('0x2a')]){if(_0x4e41f0[_0xa2b4('0x2a')]['code']===0x1f4){logger[_0xa2b4('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x235914,_0x4e41f0['error']['message']);return _0x66db7f(_0x4e41f0[_0xa2b4('0x2a')][_0xa2b4('0x2b')]);}logger[_0xa2b4('0x2a')](_0xa2b4('0x2c'),_0x235914,_0x4e41f0[_0xa2b4('0x2a')]['message']);return _0x5d6ce3(_0x4e41f0[_0xa2b4('0x2a')][_0xa2b4('0x2b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x235914,_0xa2b4('0x27'));_0x5d6ce3(_0x4e41f0[_0xa2b4('0x2d')][_0xa2b4('0x2b')]);}})[_0xa2b4('0x2e')](function(_0x500362){logger[_0xa2b4('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x235914,_0x500362);_0x66db7f(_0x500362);});});}function respondWithStatusCode(_0x5b0e6a,_0x33e0f9){_0x33e0f9=_0x33e0f9||0xcc;return function(_0x5cabc4){if(_0x5cabc4){return _0x5b0e6a[_0xa2b4('0x2f')](_0x33e0f9);}return _0x5b0e6a[_0xa2b4('0x30')](_0x33e0f9)[_0xa2b4('0x31')]();};}function respondWithResult(_0x3eb9e8,_0x46b990){_0x46b990=_0x46b990||0xc8;return function(_0x5bd1cb){if(_0x5bd1cb){return _0x3eb9e8['status'](_0x46b990)[_0xa2b4('0x32')](_0x5bd1cb);}};}function respondWithFilteredResult(_0x1feaae,_0xe0f670){return function(_0x7e2950){if(_0x7e2950){var _0x354ef1=_0x7e2950[_0xa2b4('0x33')],_0x57f92f=_0xe0f670['offset'],_0x22be9f=_0xe0f670['offset']+_0xe0f670[_0xa2b4('0x34')],_0x5ac48e;if(_0x22be9f>=_0x354ef1){_0x22be9f=_0x354ef1;_0x5ac48e=0xc8;}else{_0x5ac48e=0xce;}_0x1feaae[_0xa2b4('0x30')](_0x5ac48e);return _0x1feaae[_0xa2b4('0x35')](_0xa2b4('0x36'),_0x57f92f+'-'+_0x22be9f+'/'+_0x354ef1)[_0xa2b4('0x32')](_0x7e2950);}return null;};}function patchUpdates(_0x568394){return function(_0x148791){try{jsonpatch[_0xa2b4('0x37')](_0x148791,_0x568394,!![]);}catch(_0x154ba9){return BPromise[_0xa2b4('0x38')](_0x154ba9);}return _0x148791[_0xa2b4('0x39')]();};}function saveUpdates(_0x443362,_0x56e764){return function(_0x4ab850){if(_0x4ab850){return _0x4ab850[_0xa2b4('0x3a')](_0x443362)['then'](function(_0x4f44c5){return _0x4f44c5;});}return null;};}function removeEntity(_0x511b83,_0x5e293e){return function(_0x50a1e9){if(_0x50a1e9){return _0x50a1e9[_0xa2b4('0x3b')]()['then'](function(){var _0x4b3267=_0x50a1e9[_0xa2b4('0x3c')]({'plain':!![]});var _0x2d6265=_0xa2b4('0x3d');return db['UserProfileResource'][_0xa2b4('0x3b')]({'where':{'type':_0x2d6265,'resourceId':_0x4b3267['id']}})['then'](function(){return _0x50a1e9;});})[_0xa2b4('0x26')](function(){_0x511b83[_0xa2b4('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cfb47,_0x4945c2){return function(_0x15079d){if(!_0x15079d){_0x5cfb47[_0xa2b4('0x2f')](0x194);}return _0x15079d;};}function handleError(_0x23db33,_0x31b94f){_0x31b94f=_0x31b94f||0x1f4;return function(_0x3bac70){logger[_0xa2b4('0x2a')](_0x3bac70[_0xa2b4('0x3e')]);if(_0x3bac70[_0xa2b4('0x3f')]){delete _0x3bac70[_0xa2b4('0x3f')];}_0x23db33[_0xa2b4('0x30')](_0x31b94f)['send'](_0x3bac70);};}exports[_0xa2b4('0x40')]=function(_0x5a8324,_0x4bc3a0){var _0x474a5f={'include':[{'model':db[_0xa2b4('0x41')],'as':_0xa2b4('0x42')}]},_0x4c1870={},_0x51fd35={'count':0x0,'rows':[]};var _0x418e12=_[_0xa2b4('0x43')](db[_0xa2b4('0x44')][_0xa2b4('0x45')],function(_0x3d417f){return{'name':_0x3d417f['fieldName'],'type':_0x3d417f[_0xa2b4('0x46')][_0xa2b4('0x47')]};});_0x4c1870['model']=_['map'](_0x418e12,_0xa2b4('0x3f'));_0x4c1870[_0xa2b4('0x48')]=_[_0xa2b4('0x49')](_0x5a8324[_0xa2b4('0x48')]);_0x4c1870[_0xa2b4('0x4a')]=_['intersection'](_0x4c1870['model'],_0x4c1870['query']);_0x474a5f['attributes']=_[_0xa2b4('0x4b')](_0x4c1870['model'],qs[_0xa2b4('0x4c')](_0x5a8324[_0xa2b4('0x48')][_0xa2b4('0x4c')]));_0x474a5f['attributes']=_0x474a5f['attributes']['length']?_0x474a5f['attributes']:_0x4c1870[_0xa2b4('0x4d')];if(!_0x5a8324['query'][_0xa2b4('0x4e')](_0xa2b4('0x4f'))){_0x474a5f[_0xa2b4('0x34')]=qs[_0xa2b4('0x34')](_0x5a8324[_0xa2b4('0x48')][_0xa2b4('0x34')]);_0x474a5f['offset']=qs[_0xa2b4('0x50')](_0x5a8324[_0xa2b4('0x48')][_0xa2b4('0x50')]);}_0x474a5f[_0xa2b4('0x51')]=qs[_0xa2b4('0x52')](_0x5a8324[_0xa2b4('0x48')][_0xa2b4('0x52')]);_0x474a5f[_0xa2b4('0x53')]=qs[_0xa2b4('0x4a')](_['pick'](_0x5a8324[_0xa2b4('0x48')],_0x4c1870[_0xa2b4('0x4a')]));if(_0x5a8324['query'][_0xa2b4('0x54')]){_0x474a5f[_0xa2b4('0x53')]=_[_0xa2b4('0x55')](_0x474a5f[_0xa2b4('0x53')],{'$or':_['map'](_0x418e12,function(_0x27c919){if(_0x27c919[_0xa2b4('0x46')]!==_0xa2b4('0x56')){var _0x3f3eaf={};_0x3f3eaf[_0x27c919['name']]={'$like':'%'+_0x5a8324[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0x3f3eaf;}})});}_0x474a5f=_[_0xa2b4('0x55')]({},_0x474a5f,_0x5a8324[_0xa2b4('0x57')]);var _0x4612b9={'where':_0x474a5f[_0xa2b4('0x53')]};return db[_0xa2b4('0x44')]['count'](_0x4612b9)[_0xa2b4('0x26')](function(_0xb93949){_0x51fd35[_0xa2b4('0x33')]=_0xb93949;if(_0x5a8324[_0xa2b4('0x48')]['includeAll']){_0x474a5f[_0xa2b4('0x58')]=[{'all':!![]}];}return db[_0xa2b4('0x44')][_0xa2b4('0x59')](_0x474a5f);})[_0xa2b4('0x26')](function(_0x4d8df1){_0x51fd35[_0xa2b4('0x5a')]=_0x4d8df1;return _0x51fd35;})[_0xa2b4('0x26')](respondWithFilteredResult(_0x4bc3a0,_0x474a5f))[_0xa2b4('0x2e')](handleError(_0x4bc3a0,null));};exports[_0xa2b4('0x5b')]=function(_0x254ba3,_0x1a457e){var _0x2960f2={'raw':![],'where':{'id':_0x254ba3['params']['id']},'include':[{'model':db[_0xa2b4('0x41')],'as':_0xa2b4('0x42')}]},_0x413a4a={};_0x413a4a[_0xa2b4('0x4d')]=_[_0xa2b4('0x49')](db[_0xa2b4('0x44')][_0xa2b4('0x45')]);_0x413a4a['query']=_['keys'](_0x254ba3['query']);_0x413a4a[_0xa2b4('0x4a')]=_[_0xa2b4('0x4b')](_0x413a4a[_0xa2b4('0x4d')],_0x413a4a[_0xa2b4('0x48')]);_0x2960f2[_0xa2b4('0x5c')]=_[_0xa2b4('0x4b')](_0x413a4a[_0xa2b4('0x4d')],qs['fields'](_0x254ba3['query'][_0xa2b4('0x4c')]));_0x2960f2['attributes']=_0x2960f2[_0xa2b4('0x5c')][_0xa2b4('0x5d')]?_0x2960f2[_0xa2b4('0x5c')]:_0x413a4a[_0xa2b4('0x4d')];if(_0x254ba3['query'][_0xa2b4('0x5e')]){_0x2960f2[_0xa2b4('0x58')]=[{'all':!![]}];}_0x2960f2=_[_0xa2b4('0x55')]({},_0x2960f2,_0x254ba3[_0xa2b4('0x57')]);return db[_0xa2b4('0x44')][_0xa2b4('0x5f')](_0x2960f2)[_0xa2b4('0x26')](handleEntityNotFound(_0x1a457e,null))[_0xa2b4('0x26')](respondWithResult(_0x1a457e,null))[_0xa2b4('0x2e')](handleError(_0x1a457e,null));};exports[_0xa2b4('0x60')]=function(_0x15b726,_0x409014){return db[_0xa2b4('0x44')][_0xa2b4('0x60')](_0x15b726[_0xa2b4('0x61')],{})['then'](function(_0x230e91){var _0x3772a1=_0x15b726[_0xa2b4('0x62')][_0xa2b4('0x3c')]({'plain':!![]});if(!_0x3772a1)throw new Error(_0xa2b4('0x63'));if(_0x3772a1[_0xa2b4('0x64')]==='user'){var _0x25b94a=_0x230e91[_0xa2b4('0x3c')]({'plain':!![]});var _0x5911cb=_0xa2b4('0x3d');return db[_0xa2b4('0x65')]['find']({'where':{'name':_0x5911cb,'userProfileId':_0x3772a1[_0xa2b4('0x66')]},'raw':!![]})[_0xa2b4('0x26')](function(_0x48df94){if(_0x48df94&&_0x48df94[_0xa2b4('0x67')]===0x0){return db[_0xa2b4('0x68')][_0xa2b4('0x60')]({'name':_0x25b94a['name'],'resourceId':_0x25b94a['id'],'type':_0x48df94[_0xa2b4('0x3f')],'sectionId':_0x48df94['id']},{})[_0xa2b4('0x26')](function(){return _0x230e91;});}else{return _0x230e91;}})[_0xa2b4('0x2e')](function(_0x4b0b78){logger[_0xa2b4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b0b78);throw _0x4b0b78;});}return _0x230e91;})[_0xa2b4('0x26')](respondWithResult(_0x409014,0xc9))[_0xa2b4('0x2e')](handleError(_0x409014,null));};exports[_0xa2b4('0x3a')]=function(_0x137240,_0x16f6d4){if(_0x137240[_0xa2b4('0x61')]['id']){delete _0x137240[_0xa2b4('0x61')]['id'];}return db[_0xa2b4('0x44')]['find']({'where':{'id':_0x137240[_0xa2b4('0x69')]['id']},'include':[{'model':db[_0xa2b4('0x41')],'as':_0xa2b4('0x42')}]})['then'](handleEntityNotFound(_0x16f6d4,null))[_0xa2b4('0x26')](saveUpdates(_0x137240[_0xa2b4('0x61')],null))[_0xa2b4('0x26')](respondWithResult(_0x16f6d4,null))[_0xa2b4('0x2e')](handleError(_0x16f6d4,null));};exports['destroy']=function(_0x2b4ab3,_0x548a43){return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'where':{'id':_0x2b4ab3[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x548a43,null))[_0xa2b4('0x26')](removeEntity(_0x548a43,null))[_0xa2b4('0x2e')](handleError(_0x548a43,null));};exports['describe']=function(_0x5dd4c6,_0x56cb50){return db['ChatWebsite'][_0xa2b4('0x6a')]()[_0xa2b4('0x26')](respondWithResult(_0x56cb50,null))[_0xa2b4('0x2e')](handleError(_0x56cb50,null));};exports[_0xa2b4('0x6b')]=function(_0x7a2a9d,_0x58ab6f,_0x30c726){if(_0x7a2a9d['body']['id']){delete _0x7a2a9d[_0xa2b4('0x61')]['id'];}return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'where':{'id':_0x7a2a9d[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x58ab6f,null))[_0xa2b4('0x26')](function(_0x5cd1a2){if(_0x5cd1a2){_0x7a2a9d['body'][_0xa2b4('0x6c')]=_0x5cd1a2['id'];return db[_0xa2b4('0x6d')]['create'](_0x7a2a9d[_0xa2b4('0x61')]);}})[_0xa2b4('0x26')](respondWithResult(_0x58ab6f,null))[_0xa2b4('0x2e')](handleError(_0x58ab6f,null));};exports['getDispositions']=function(_0xabb02b,_0x3c3460,_0x23a230){var _0x4b5b79={'raw':![],'where':{}};var _0x2eb4ba={};var _0x4a31c4={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xabb02b[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x3c3460,null))[_0xa2b4('0x26')](function(_0x34eff0){if(_0x34eff0){_0x2eb4ba[_0xa2b4('0x4d')]=_['keys'](db['Disposition']['rawAttributes']);_0x2eb4ba[_0xa2b4('0x48')]=_[_0xa2b4('0x49')](_0xabb02b['query']);_0x2eb4ba[_0xa2b4('0x4a')]=_[_0xa2b4('0x4b')](_0x2eb4ba[_0xa2b4('0x4d')],_0x2eb4ba[_0xa2b4('0x48')]);_0x4b5b79['attributes']=_['intersection'](_0x2eb4ba[_0xa2b4('0x4d')],qs[_0xa2b4('0x4c')](_0xabb02b['query'][_0xa2b4('0x4c')]));_0x4b5b79[_0xa2b4('0x5c')]=_0x4b5b79['attributes']['length']?_0x4b5b79[_0xa2b4('0x5c')]:_0x2eb4ba[_0xa2b4('0x4d')];if(!_0xabb02b[_0xa2b4('0x48')][_0xa2b4('0x4e')](_0xa2b4('0x4f'))){_0x4b5b79[_0xa2b4('0x34')]=qs[_0xa2b4('0x34')](_0xabb02b[_0xa2b4('0x48')][_0xa2b4('0x34')]);_0x4b5b79[_0xa2b4('0x50')]=qs[_0xa2b4('0x50')](_0xabb02b['query'][_0xa2b4('0x50')]);}_0x4b5b79['order']=qs['sort'](_0xabb02b[_0xa2b4('0x48')]['sort']);_0x4b5b79[_0xa2b4('0x53')]=qs[_0xa2b4('0x4a')](_[_0xa2b4('0x6e')](_0xabb02b[_0xa2b4('0x48')],_0x2eb4ba[_0xa2b4('0x4a')]));_0x4b5b79['where'][_0xa2b4('0x6c')]=_0x34eff0['id'];if(_0xabb02b[_0xa2b4('0x48')]['filter']){_0x4b5b79[_0xa2b4('0x53')]=_[_0xa2b4('0x55')](_0x4b5b79[_0xa2b4('0x53')],{'$or':_[_0xa2b4('0x43')](_0x4b5b79[_0xa2b4('0x5c')],function(_0x21c30c){var _0x5a50fe={};_0x5a50fe[_0x21c30c]={'$like':'%'+_0xabb02b[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0x5a50fe;})});}_0x4b5b79=_[_0xa2b4('0x55')]({},_0x4b5b79,_0xabb02b[_0xa2b4('0x57')]);return db['Disposition']['count']({'where':_0x4b5b79[_0xa2b4('0x53')]})['then'](function(_0x224bd6){_0x4a31c4['count']=_0x224bd6;if(_0xabb02b[_0xa2b4('0x48')][_0xa2b4('0x5e')]){_0x4b5b79['include']=[{'all':!![]}];}return db['Disposition'][_0xa2b4('0x59')](_0x4b5b79);})[_0xa2b4('0x26')](function(_0x28f9e0){_0x4a31c4[_0xa2b4('0x5a')]=_0x28f9e0;return _0x4a31c4;});}})[_0xa2b4('0x26')](respondWithFilteredResult(_0x3c3460,_0x4b5b79))[_0xa2b4('0x2e')](handleError(_0x3c3460,null));};exports['removeDispositions']=function(_0xe14ebf,_0x123678,_0xe12cf8){return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'where':{'id':_0xe14ebf[_0xa2b4('0x69')]['id']}})['then'](handleEntityNotFound(_0x123678,null))[_0xa2b4('0x26')](function(_0x1c51e9){if(_0x1c51e9){return _0x1c51e9['removeDispositions'](_0xe14ebf[_0xa2b4('0x48')][_0xa2b4('0x6f')]);}})[_0xa2b4('0x26')](respondWithStatusCode(_0x123678,null))[_0xa2b4('0x2e')](handleError(_0x123678,null));};exports['addAnswer']=function(_0x4ac984,_0x23082b,_0x4c3420){if(_0x4ac984[_0xa2b4('0x61')]['id']){delete _0x4ac984[_0xa2b4('0x61')]['id'];}return db['ChatWebsite'][_0xa2b4('0x5f')]({'where':{'id':_0x4ac984[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x23082b,null))[_0xa2b4('0x26')](function(_0x4e7e4d){if(_0x4e7e4d){_0x4ac984[_0xa2b4('0x61')][_0xa2b4('0x6c')]=_0x4e7e4d['id'];return db[_0xa2b4('0x70')][_0xa2b4('0x60')](_0x4ac984['body']);}})[_0xa2b4('0x26')](respondWithResult(_0x23082b,null))[_0xa2b4('0x2e')](handleError(_0x23082b,null));};exports[_0xa2b4('0x71')]=function(_0x54f5e7,_0x4dcb58,_0x1b7292){var _0x4c2a3d={'raw':![],'where':{}};var _0x4bbcdc={};var _0x3e7344={'count':0x0,'rows':[]};return db[_0xa2b4('0x44')][_0xa2b4('0x72')]({'where':{'id':_0x54f5e7[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x4dcb58,null))[_0xa2b4('0x26')](function(_0x30dbcb){if(_0x30dbcb){_0x4bbcdc[_0xa2b4('0x4d')]=_[_0xa2b4('0x49')](db[_0xa2b4('0x70')][_0xa2b4('0x45')]);_0x4bbcdc[_0xa2b4('0x48')]=_['keys'](_0x54f5e7['query']);_0x4bbcdc[_0xa2b4('0x4a')]=_[_0xa2b4('0x4b')](_0x4bbcdc[_0xa2b4('0x4d')],_0x4bbcdc[_0xa2b4('0x48')]);_0x4c2a3d[_0xa2b4('0x5c')]=_[_0xa2b4('0x4b')](_0x4bbcdc['model'],qs[_0xa2b4('0x4c')](_0x54f5e7[_0xa2b4('0x48')]['fields']));_0x4c2a3d['attributes']=_0x4c2a3d[_0xa2b4('0x5c')]['length']?_0x4c2a3d[_0xa2b4('0x5c')]:_0x4bbcdc[_0xa2b4('0x4d')];if(!_0x54f5e7[_0xa2b4('0x48')]['hasOwnProperty']('nolimit')){_0x4c2a3d['limit']=qs[_0xa2b4('0x34')](_0x54f5e7[_0xa2b4('0x48')][_0xa2b4('0x34')]);_0x4c2a3d[_0xa2b4('0x50')]=qs[_0xa2b4('0x50')](_0x54f5e7[_0xa2b4('0x48')][_0xa2b4('0x50')]);}_0x4c2a3d[_0xa2b4('0x51')]=qs[_0xa2b4('0x52')](_0x54f5e7['query'][_0xa2b4('0x52')]);_0x4c2a3d['where']=qs['filters'](_[_0xa2b4('0x6e')](_0x54f5e7[_0xa2b4('0x48')],_0x4bbcdc[_0xa2b4('0x4a')]));_0x4c2a3d[_0xa2b4('0x53')][_0xa2b4('0x6c')]=_0x30dbcb['id'];if(_0x54f5e7['query'][_0xa2b4('0x54')]){_0x4c2a3d[_0xa2b4('0x53')]=_[_0xa2b4('0x55')](_0x4c2a3d[_0xa2b4('0x53')],{'$or':_[_0xa2b4('0x43')](_0x4c2a3d[_0xa2b4('0x5c')],function(_0x1b5fbf){var _0x54cc34={};_0x54cc34[_0x1b5fbf]={'$like':'%'+_0x54f5e7[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0x54cc34;})});}_0x4c2a3d=_[_0xa2b4('0x55')]({},_0x4c2a3d,_0x54f5e7[_0xa2b4('0x57')]);return db['CannedAnswer']['count']({'where':_0x4c2a3d['where']})['then'](function(_0x553982){_0x3e7344[_0xa2b4('0x33')]=_0x553982;if(_0x54f5e7['query'][_0xa2b4('0x5e')]){_0x4c2a3d[_0xa2b4('0x58')]=[{'all':!![]}];}return db[_0xa2b4('0x70')][_0xa2b4('0x59')](_0x4c2a3d);})['then'](function(_0x452eb7){_0x3e7344[_0xa2b4('0x5a')]=_0x452eb7;return _0x3e7344;});}})[_0xa2b4('0x26')](respondWithFilteredResult(_0x4dcb58,_0x4c2a3d))[_0xa2b4('0x2e')](handleError(_0x4dcb58,null));};exports[_0xa2b4('0x73')]=function(_0x3393bc,_0x3102b5,_0x29342b){return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'where':{'id':_0x3393bc[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x3102b5,null))[_0xa2b4('0x26')](function(_0x4721b4){if(_0x4721b4){return _0x4721b4[_0xa2b4('0x73')](_0x3393bc['query'][_0xa2b4('0x6f')]);}})[_0xa2b4('0x26')](respondWithStatusCode(_0x3102b5,null))['catch'](handleError(_0x3102b5,null));};exports[_0xa2b4('0x74')]=function(_0x22764f,_0x1a03fc,_0x33546f){_0x22764f[_0xa2b4('0x61')]['sitepic']=_0x22764f[_0xa2b4('0x75')][_0xa2b4('0x76')];return db['ChatWebsite'][_0xa2b4('0x5f')]({'where':{'id':_0x22764f[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x1a03fc,null))[_0xa2b4('0x26')](saveUpdates(_0x22764f['body'],null))[_0xa2b4('0x26')](respondWithResult(_0x1a03fc,null))[_0xa2b4('0x2e')](handleError(_0x1a03fc,null));};exports[_0xa2b4('0x77')]=function(_0x200c7f,_0x5b3c5e,_0x116147){_0x200c7f[_0xa2b4('0x61')]['agentAvatar']=_0x200c7f[_0xa2b4('0x75')]['filename'];return db[_0xa2b4('0x44')]['find']({'where':{'id':_0x200c7f[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x5b3c5e,null))[_0xa2b4('0x26')](saveUpdates(_0x200c7f[_0xa2b4('0x61')],null))[_0xa2b4('0x26')](respondWithResult(_0x5b3c5e,null))['catch'](handleError(_0x5b3c5e,null));};exports[_0xa2b4('0x78')]=function(_0xbbe72f,_0x59d910,_0xd4adca){_0xbbe72f[_0xa2b4('0x61')][_0xa2b4('0x79')]=_0xbbe72f[_0xa2b4('0x75')]['filename'];return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'where':{'id':_0xbbe72f[_0xa2b4('0x69')]['id']}})['then'](handleEntityNotFound(_0x59d910,null))[_0xa2b4('0x26')](saveUpdates(_0xbbe72f[_0xa2b4('0x61')],null))[_0xa2b4('0x26')](respondWithResult(_0x59d910,null))[_0xa2b4('0x2e')](handleError(_0x59d910,null));};exports['addSystemAvatar']=function(_0x415404,_0x3ae112,_0x13e220){_0x415404['body'][_0xa2b4('0x7a')]=_0x415404['file'][_0xa2b4('0x76')];return db[_0xa2b4('0x44')]['find']({'where':{'id':_0x415404[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x3ae112,null))[_0xa2b4('0x26')](saveUpdates(_0x415404[_0xa2b4('0x61')],null))[_0xa2b4('0x26')](respondWithResult(_0x3ae112,null))[_0xa2b4('0x2e')](handleError(_0x3ae112,null));};exports[_0xa2b4('0x7b')]=function(_0x38dfbd,_0x5baead,_0x1e6f0e){var _0x3ec77c=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x7e'));var _0x582982={'where':{'id':_0x38dfbd[_0xa2b4('0x69')]['id']},'attributes':['id',_0xa2b4('0x7f')],'raw':!![]};var _0x52e82a=![];return require(_0xa2b4('0x80'))[_0xa2b4('0x81')]()['then'](function(_0x1048c0){if(_0x1048c0){_0x52e82a=_0x1048c0[_0xa2b4('0x82')];}})[_0xa2b4('0x26')](function(){return db['ChatWebsite'][_0xa2b4('0x5f')](_0x582982);})[_0xa2b4('0x26')](handleEntityNotFound(_0x5baead,null))['then'](function(_0x47d71d){if(_0x47d71d){if(!_[_0xa2b4('0x83')](_0x47d71d['sitepic'])){if(fs['existsSync'](path[_0xa2b4('0x7c')](config['root'],'server/files/images/logos/',_0x47d71d[_0xa2b4('0x7f')]))&&_0x52e82a){_0x3ec77c=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],'server/files/images/logos/',_0x47d71d[_0xa2b4('0x7f')]);}}return _0x5baead[_0xa2b4('0x84')](_0x3ec77c);}})['catch'](handleError(_0x5baead,null));};exports[_0xa2b4('0x85')]=function(_0x1f7020,_0x44e801,_0x501909){var _0x502a49=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x86'));var _0xf57ef1={'where':{'id':_0x1f7020[_0xa2b4('0x69')]['id']},'attributes':['id',_0xa2b4('0x87')],'raw':!![]};return db[_0xa2b4('0x44')][_0xa2b4('0x5f')](_0xf57ef1)[_0xa2b4('0x26')](handleEntityNotFound(_0x44e801,null))[_0xa2b4('0x26')](function(_0x19a969){if(_0x19a969){if(!_[_0xa2b4('0x83')](_0x19a969[_0xa2b4('0x87')])){if(fs[_0xa2b4('0x88')](path['join'](config[_0xa2b4('0x7d')],_0xa2b4('0x89'),_0x19a969[_0xa2b4('0x87')]))){_0x502a49=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x89'),_0x19a969[_0xa2b4('0x87')]);}}return _0x44e801['download'](_0x502a49);}})[_0xa2b4('0x2e')](handleError(_0x44e801,null));};exports[_0xa2b4('0x8a')]=function(_0xff46da,_0x538ee6,_0x141d79){var _0x3218c4=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x8b'));var _0x5db49c={'where':{'id':_0xff46da[_0xa2b4('0x69')]['id']},'attributes':['id','customerAvatar',_0xa2b4('0x8c')],'raw':!![]};return db[_0xa2b4('0x44')][_0xa2b4('0x5f')](_0x5db49c)[_0xa2b4('0x26')](handleEntityNotFound(_0x538ee6,null))[_0xa2b4('0x26')](function(_0x5d2615){if(_0x5d2615){if(!_[_0xa2b4('0x83')](_0x5d2615[_0xa2b4('0x79')])){if(fs[_0xa2b4('0x88')](path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x89'),_0x5d2615['customerAvatar']))&&_0x5d2615[_0xa2b4('0x8c')]){_0x3218c4=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x89'),_0x5d2615[_0xa2b4('0x79')]);}}return _0x538ee6[_0xa2b4('0x84')](_0x3218c4);}})[_0xa2b4('0x2e')](handleError(_0x538ee6,null));};exports[_0xa2b4('0x8d')]=function(_0x28c9be,_0x43c43f,_0x227a67){var _0x53f986=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],'server/files/images/avatars/system_avatar.png');var _0x89ab05={'where':{'id':_0x28c9be[_0xa2b4('0x69')]['id']},'attributes':['id',_0xa2b4('0x7a')],'raw':!![]};return db['ChatWebsite']['find'](_0x89ab05)[_0xa2b4('0x26')](handleEntityNotFound(_0x43c43f,null))[_0xa2b4('0x26')](function(_0x11d1a2){if(_0x11d1a2){if(!_[_0xa2b4('0x83')](_0x11d1a2['systemAvatar'])){if(fs[_0xa2b4('0x88')](path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x89'),_0x11d1a2[_0xa2b4('0x7a')]))){_0x53f986=path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0x89'),_0x11d1a2['systemAvatar']);}}return _0x43c43f[_0xa2b4('0x84')](_0x53f986);}})['catch'](handleError(_0x43c43f,null));};exports[_0xa2b4('0x8e')]=function(_0x55ae34,_0x751fb4,_0x2182dc){var _0x639a80=require(_0xa2b4('0x8f'));var _0x13553e=new _0x639a80();var _0xaad6b3=_0x13553e[_0xa2b4('0x90')](_0x55ae34[_0xa2b4('0x91')]['user-agent'])['getResult']();var _0x17d946={'body':_0x55ae34[_0xa2b4('0x61')],'channel':_0xa2b4('0x92')};var _0x4bbd31=[];var _0x17ec03=[];var _0x525341={};var _0x2aa7c1=![];return db[_0xa2b4('0x93')]['describe']()[_0xa2b4('0x26')](function(_0x25833b){if(!_0x25833b){throw new db[(_0xa2b4('0x23'))][(_0xa2b4('0x94'))](_0xa2b4('0x95'));}_0x4bbd31=_[_0xa2b4('0x96')](_[_0xa2b4('0x49')](_0x25833b),[_0xa2b4('0x97'),_0xa2b4('0x98')]);_0x17ec03=_['difference'](_[_0xa2b4('0x49')](_0x25833b),[_0xa2b4('0x97'),_0xa2b4('0x98'),'CompanyId','ListId']);if(_0x55ae34[_0xa2b4('0x61')]['id']){delete _0x55ae34['body']['id'];}if(_[_0xa2b4('0x83')](_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0x99')])){throw new db[(_0xa2b4('0x23'))]['ValidationError'](_0xa2b4('0x9a'));}if(_[_0xa2b4('0x83')](_0x55ae34[_0xa2b4('0x61')]['body'])||_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0x61')]===''){throw new db['Sequelize']['ValidationError'](_0xa2b4('0x9b'));}if(_[_0xa2b4('0x83')](_0x55ae34['body'][_0xa2b4('0x9c')])){throw new db[(_0xa2b4('0x23'))]['ValidationError'](_0xa2b4('0x9d')+_0x17ec03);}if(!_['includes'](_0x17ec03,_0x55ae34['body']['mapKey'])){throw new db[(_0xa2b4('0x23'))][(_0xa2b4('0x94'))](_0xa2b4('0x9e')+_0x17ec03);}_0x525341[_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0x9c')]]=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0x99')];})[_0xa2b4('0x26')](function(){return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'where':{'id':_0x55ae34[_0xa2b4('0x69')]['id']},'include':[{'model':db[_0xa2b4('0x9f')],'as':_0xa2b4('0xa0'),'include':[{'model':db['CmContact'],'as':_0xa2b4('0xa1'),'where':_0x525341,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0xa2b4('0xa2')}]});})[_0xa2b4('0x26')](handleEntityNotFound(_0x751fb4,null))['then'](function(_0x5b64ae){if(_0x5b64ae&&_0x5b64ae[_0xa2b4('0xa0')]){_0x17d946[_0xa2b4('0xa3')]=_0x5b64ae;_0x17d946[_0xa2b4('0xa4')]=_0x5b64ae['Applications'];_0x17d946[_0xa2b4('0xa5')]=_0x5b64ae['List'];_0x17d946[_0xa2b4('0xa4')]=_[_0xa2b4('0xa6')](_0x17d946['applications'],['priority'],['asc']);if(_0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xa2')]){delete _0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xa2')];}if(_0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xa0')]&&_0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xa0')][_0xa2b4('0xa1')][_0xa2b4('0x5d')]){return _0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xa0')][_0xa2b4('0xa1')][0x0];}var _0x917225=_[_0xa2b4('0x1a')](_0x55ae34[_0xa2b4('0x61')],{'firstName':_0x55ae34['body'][_0xa2b4('0x99')],'ListId':_0x5b64ae[_0xa2b4('0xa7')]});_0x917225[_0x55ae34['body']['mapKey']]=_0x55ae34[_0xa2b4('0x61')]['from'];return db[_0xa2b4('0x93')]['create'](_0x917225,{'fields':_0x4bbd31,'raw':!![]});}})['then'](handleEntityNotFound(_0x751fb4,null))['then'](function(_0x36befc){_0x17d946[_0xa2b4('0xa8')]=_0x36befc;var _0x355a12=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xa9')];if(_0x55ae34[_0xa2b4('0x91')]['cf-connecting-ip']){_0x355a12=_0x55ae34['headers'][_0xa2b4('0xaa')];}else if(_0x55ae34[_0xa2b4('0x91')][_0xa2b4('0xab')]){_0x355a12=_[_0xa2b4('0xac')](_0x55ae34[_0xa2b4('0x91')][_0xa2b4('0xab')][_0xa2b4('0xad')](','));}if(_0x36befc){var _0x2dd1ae={'ContactId':_0x36befc['id'],'ChatWebsiteId':_0x55ae34['params']['id'],'from':(_0x36befc[_0xa2b4('0xae')]||'')+'\x20'+(_0x36befc[_0xa2b4('0xaf')]||''),'customerIp':_0x355a12,'customerPort':_0x55ae34[_0xa2b4('0x91')][_0xa2b4('0xb0')]?_0x55ae34[_0xa2b4('0x91')][_0xa2b4('0xb0')]:null,'referer':_0x55ae34['body'][_0xa2b4('0xb1')],'browserName':_0xaad6b3['browser']['name']&&_0xaad6b3[_0xa2b4('0xb2')][_0xa2b4('0xb3')]?util[_0xa2b4('0xb4')](_0xa2b4('0xb5'),_0xaad6b3[_0xa2b4('0xb2')]['name'],_0xaad6b3[_0xa2b4('0xb2')][_0xa2b4('0xb3')]):_0xa2b4('0xb6'),'browserVersion':_0xaad6b3['browser'][_0xa2b4('0xb3')]||_0xa2b4('0xb6'),'osName':util[_0xa2b4('0xb4')]('%s\x20%s',_0xaad6b3['os'][_0xa2b4('0x3f')],_0xaad6b3['os'][_0xa2b4('0xb3')]),'osVersion':_0xaad6b3['os'][_0xa2b4('0xb3')],'deviceModel':_0xaad6b3[_0xa2b4('0xb7')][_0xa2b4('0x4d')]&&_0xaad6b3['device'][_0xa2b4('0xb8')]?util[_0xa2b4('0xb4')]('%s\x20%s\x20%s',_0xaad6b3[_0xa2b4('0xb7')][_0xa2b4('0x4d')],_0xaad6b3[_0xa2b4('0xb7')][_0xa2b4('0xb8')],_0xaad6b3['device'][_0xa2b4('0x46')]):null,'deviceVendor':_0xaad6b3[_0xa2b4('0xb7')][_0xa2b4('0xb8')],'deviceType':_0xaad6b3[_0xa2b4('0xb7')][_0xa2b4('0x46')],'formData':JSON['stringify'](_0x55ae34[_0xa2b4('0x61')])};var _0x4da917={'ChatWebsiteId':_0x55ae34[_0xa2b4('0x69')]['id'],'closed':![]};if(_0x55ae34[_0xa2b4('0x61')]['threadId']){_0x4da917[_0xa2b4('0xb9')]=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xb9')];return db[_0xa2b4('0xba')][_0xa2b4('0x5f')]({'where':_0x4da917})[_0xa2b4('0x26')](function(_0x527977){if(_0x527977){return[_0x527977,![]];}_0x2dd1ae[_0xa2b4('0xb9')]=_0x55ae34[_0xa2b4('0x61')]['threadId'];_0x2dd1ae[_0xa2b4('0xbb')]=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xbb')];return db[_0xa2b4('0xba')][_0xa2b4('0x60')](_0x2dd1ae)[_0xa2b4('0x26')](function(_0x134cd6){return[_0x134cd6,!![]];});});}_0x4da917[_0xa2b4('0xbc')]=_0x36befc['id'];if(_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xbd')]&&_0x55ae34['body']['interaction']['id']){_0x4da917['id']=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xbd')]['id'];return db[_0xa2b4('0xba')]['find']({'where':_0x4da917})['then'](function(_0x213832){if(_0x213832){return[_0x213832,![]];}return db['ChatInteraction'][_0xa2b4('0x60')](_0x2dd1ae)[_0xa2b4('0x26')](function(_0x4a8130){return[_0x4a8130,!![]];});});}return db[_0xa2b4('0xba')][_0xa2b4('0x60')](_0x2dd1ae)[_0xa2b4('0x26')](function(_0x3f1090){return[_0x3f1090,!![]];});}})[_0xa2b4('0xbe')](function(_0x1e1ab4,_0xf6e049){if(_0x1e1ab4){_0x2aa7c1=_0xf6e049;if(!_0xf6e049){var _0x398a57={'from':(_0x17d946['contact'][_0xa2b4('0xae')]||'')+'\x20'+(_0x17d946[_0xa2b4('0xa8')][_0xa2b4('0xaf')]||'')};if(_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xb9')]&&_0x55ae34[_0xa2b4('0x61')]['messageId']&&_0x55ae34['body'][_0xa2b4('0xb9')]!=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xbf')]){_0x398a57['threadId']=_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xbf')];}return _0x1e1ab4[_0xa2b4('0x3a')](_0x398a57);}else{return _0x1e1ab4;}}})['then'](function(_0x1ff63e){_0x17d946[_0xa2b4('0xbd')]=_0x1ff63e[_0xa2b4('0x3c')]({'plain':!![]});_0x17d946['interaction']['created']=_0x2aa7c1;if(_0x17d946['interaction']['created']){if(_0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xc0')]){_0x17d946['applications']['push']({'id':0x0,'priority':_0x17d946['applications'][_0xa2b4('0x5d')]+0x1,'app':_0xa2b4('0xc1'),'appdata':'unmanaged','interval':_0xa2b4('0xc2')});}}return db[_0xa2b4('0xc3')][_0xa2b4('0x60')]({'body':_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0x61')],'ChatWebsiteId':_0x55ae34[_0xa2b4('0x69')]['id'],'ChatInteractionId':_0x1ff63e['id'],'direction':'in','ContactId':_0x17d946[_0xa2b4('0xa8')]['id'],'AttachmentId':_0x55ae34[_0xa2b4('0x61')][_0xa2b4('0xc4')]});})[_0xa2b4('0x26')](function(_0x31a0ca){_0x17d946[_0xa2b4('0x2b')]=_0x31a0ca;if(_0x17d946[_0xa2b4('0xbd')][_0xa2b4('0xc5')]){return db[_0xa2b4('0xc6')][_0xa2b4('0x5f')]({'attributes':['id','name'],'where':{'id':_0x17d946[_0xa2b4('0xbd')][_0xa2b4('0xc5')]}})['then'](function(_0x580d93){if(_0x580d93){_0x17d946[_0xa2b4('0xa4')][_0xa2b4('0xc7')]({'id':0x0,'priority':0x0,'app':_0xa2b4('0xc8'),'appdata':_0x580d93['name']+','+(_0x17d946[_0xa2b4('0xa3')][_0xa2b4('0xc9')]||0xa),'interval':_0xa2b4('0xc2')});_0x17d946[_0xa2b4('0xca')]=!![];}return respondWithRpcPromise('Start',_0xa2b4('0xcb'),_0x17d946);});}return respondWithRpcPromise(_0xa2b4('0xcc'),_0xa2b4('0xcb'),_0x17d946);})[_0xa2b4('0x26')](function(_0x3a4939){respondWithRpcPromise(_0xa2b4('0xcd'),_0xa2b4('0xcd'),{'event':'notify','message':_0x3a4939},client9002);return _0x3a4939;})['then'](respondWithResult(_0x751fb4,null))['catch'](handleError(_0x751fb4,null));};exports[_0xa2b4('0xce')]=function(_0x556ab6,_0x104775,_0x193c8c){var _0x2bb344,_0x999db9,_0x1a3b80;var _0x1da001=[];var _0x54649e=[];var _0x53f76d={};return db[_0xa2b4('0x93')]['describe']()[_0xa2b4('0x26')](function(_0x36f28a){if(!_0x36f28a){throw new db[(_0xa2b4('0x23'))][(_0xa2b4('0x94'))](_0xa2b4('0x95'));}_0x54649e=_[_0xa2b4('0x96')](_['keys'](_0x36f28a),[_0xa2b4('0x97'),_0xa2b4('0x98')]);_0x1da001=_[_0xa2b4('0x96')](_[_0xa2b4('0x49')](_0x36f28a),['createdAt',_0xa2b4('0x98'),_0xa2b4('0xcf'),_0xa2b4('0xa7')]);if(_0x556ab6[_0xa2b4('0x61')]['id']){delete _0x556ab6[_0xa2b4('0x61')]['id'];}if(_[_0xa2b4('0x83')](_0x556ab6[_0xa2b4('0x61')][_0xa2b4('0x99')])){throw _0x104775[_0xa2b4('0x30')](0x1f4)['send'](new db[(_0xa2b4('0x23'))]['ValidationError'](_0xa2b4('0x9a')));}if(_[_0xa2b4('0x83')](_0x556ab6[_0xa2b4('0x61')][_0xa2b4('0x61')])||_0x556ab6[_0xa2b4('0x61')][_0xa2b4('0x61')]===''){throw _0x104775[_0xa2b4('0x30')](0x1f4)[_0xa2b4('0xd0')](new db[(_0xa2b4('0x23'))][(_0xa2b4('0x94'))](_0xa2b4('0x9b')));}if(_['isNil'](_0x556ab6['body'][_0xa2b4('0xd1')])){throw _0x104775[_0xa2b4('0x30')](0x1f4)[_0xa2b4('0xd0')](new db[(_0xa2b4('0x23'))]['ValidationError'](_0xa2b4('0xd2')+_0x1da001));}if(!_[_0xa2b4('0xd3')](_0x1da001,_0x556ab6[_0xa2b4('0x61')]['mapKeyOffline'])){throw _0x104775[_0xa2b4('0x30')](0x1f4)[_0xa2b4('0xd0')](new db['Sequelize'][(_0xa2b4('0x94'))](_0xa2b4('0xd4')+_0x1da001));}_0x53f76d[_0x556ab6[_0xa2b4('0x61')][_0xa2b4('0xd1')]]=_0x556ab6[_0xa2b4('0x61')][_0xa2b4('0x99')];})[_0xa2b4('0x26')](function(){return db['ChatWebsite'][_0xa2b4('0x5f')]({'where':{'id':_0x556ab6[_0xa2b4('0x69')]['id']},'include':[{'model':db[_0xa2b4('0x9f')],'as':_0xa2b4('0xa0')}]});})[_0xa2b4('0x26')](handleEntityNotFound(_0x104775,null))[_0xa2b4('0x26')](function(_0x44556d){if(_0x44556d&&_0x44556d['List']){_0x999db9=_0x44556d;var _0x361e23=_['defaults'](_0x556ab6[_0xa2b4('0x61')],{'firstName':_0x556ab6[_0xa2b4('0x61')]['from'],'phone':_0x556ab6['body'][_0xa2b4('0x99')],'ListId':_0x44556d[_0xa2b4('0xa7')]});_0x361e23[_0x556ab6['body'][_0xa2b4('0xd1')]]=_0x556ab6[_0xa2b4('0x61')]['from'];return db[_0xa2b4('0x93')]['findOrCreate']({'where':_0x53f76d,'defaults':_0x361e23});}})[_0xa2b4('0xbe')](function(_0x10c5de){if(_0x10c5de){_0x1a3b80=_0x10c5de;var _0x675dc3=fs[_0xa2b4('0xd5')](path[_0xa2b4('0x7c')](config[_0xa2b4('0x7d')],_0xa2b4('0xd6')),_0xa2b4('0xd7'));var _0x53d7dc=ejs[_0xa2b4('0xd8')](_0x675dc3,{'body':_[_0xa2b4('0xd9')](_0x556ab6['body'][_0xa2b4('0x61')]),'bodyTitle':_0x999db9[_0xa2b4('0xda')]});return db[_0xa2b4('0xdb')][_0xa2b4('0x60')]({'body':_0x53d7dc,'ContactId':_0x10c5de['id'],'ChatWebsiteId':_0x999db9['id']});}})['then'](function(_0x9a706c){if(_0x9a706c){_0x2bb344=_0x9a706c;return db['MailAccount'][_0xa2b4('0x72')]({'where':{'service':!![]},'include':[{'model':db[_0xa2b4('0xdc')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x4a50e3){if(_0x4a50e3&&_0x4a50e3[_0xa2b4('0xdd')]&&_0x999db9[_0xa2b4('0xde')]){var _0x157bbd={'tls':{'rejectUnauthorized':![]}};if(_0x4a50e3['Smtp'][_0xa2b4('0xdf')]){_0x157bbd[_0xa2b4('0xdf')]=_0x4a50e3[_0xa2b4('0xdd')][_0xa2b4('0xdf')];}else{_0x157bbd['host']=_0x4a50e3[_0xa2b4('0xdd')][_0xa2b4('0xe0')];_0x157bbd[_0xa2b4('0xe1')]=_0x4a50e3[_0xa2b4('0xdd')][_0xa2b4('0xe1')];_0x157bbd[_0xa2b4('0xe2')]=_0x4a50e3[_0xa2b4('0xdd')]['secure'];}if(_0x4a50e3['Smtp'][_0xa2b4('0xe3')]){_0x157bbd['auth']={'user':_0x4a50e3[_0xa2b4('0xdd')][_0xa2b4('0x62')],'pass':_0x4a50e3['Smtp']['pass']};}return respondWithRpcPromise(_0xa2b4('0xe4'),'sendMail',{'account':_0x157bbd,'message':{'from':util[_0xa2b4('0xb4')](_0xa2b4('0xe5'),_0x4a50e3[_0xa2b4('0x3f')],_0x4a50e3[_0xa2b4('0xe6')]||_0x4a50e3['Smtp'][_0xa2b4('0x62')]),'to':_0x999db9[_0xa2b4('0xde')],'subject':_0x999db9[_0xa2b4('0xe7')],'text':_0x2bb344['body']}},client9003)[_0xa2b4('0x26')](function(){return _0x2bb344;})[_0xa2b4('0x2e')](function(_0x36b1e5){console[_0xa2b4('0x2a')](_0x36b1e5);});}})[_0xa2b4('0x26')](function(){if(_0x2bb344){return _0x2bb344;}})['then'](respondWithResult(_0x104775,null))[_0xa2b4('0x2e')](handleError(_0x104775,null));};exports[_0xa2b4('0xe8')]=function(_0x241b72,_0x5c8750,_0x1e9519){return db[_0xa2b4('0xba')][_0xa2b4('0x5f')]({'where':{'id':_0x241b72[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x5c8750,null))['then'](function(_0x358bb3){if(_0x358bb3){return _0x358bb3[_0xa2b4('0xe8')](_0x241b72[_0xa2b4('0x61')][_0xa2b4('0x6f')],_['omit'](_0x241b72[_0xa2b4('0x61')],[_0xa2b4('0x6f'),'id'])||{});}})[_0xa2b4('0x26')](respondWithResult(_0x5c8750,null))[_0xa2b4('0x2e')](handleError(_0x5c8750,null));};exports['getInteractions']=function(_0x596f53,_0x2696d2,_0x5735d5){var _0xdb99c5={'raw':![],'where':{}};var _0x529f86={};var _0x19d66b={'count':0x0,'rows':[]};return db[_0xa2b4('0x44')][_0xa2b4('0x72')]({'where':{'id':_0x596f53[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x2696d2,null))[_0xa2b4('0x26')](function(_0x177783){if(_0x177783){_0x529f86[_0xa2b4('0x4d')]=_[_0xa2b4('0x49')](db[_0xa2b4('0xba')][_0xa2b4('0x45')]);_0x529f86[_0xa2b4('0x48')]=_[_0xa2b4('0x49')](_0x596f53['query']);_0x529f86['filters']=_[_0xa2b4('0x4b')](_0x529f86[_0xa2b4('0x4d')],_0x529f86[_0xa2b4('0x48')]);_0xdb99c5[_0xa2b4('0x5c')]=_[_0xa2b4('0x4b')](_0x529f86[_0xa2b4('0x4d')],qs[_0xa2b4('0x4c')](_0x596f53[_0xa2b4('0x48')][_0xa2b4('0x4c')]));_0xdb99c5['attributes']=_0xdb99c5['attributes'][_0xa2b4('0x5d')]?_0xdb99c5[_0xa2b4('0x5c')]:_0x529f86['model'];if(!_0x596f53[_0xa2b4('0x48')][_0xa2b4('0x4e')]('nolimit')){_0xdb99c5[_0xa2b4('0x34')]=qs[_0xa2b4('0x34')](_0x596f53['query'][_0xa2b4('0x34')]);_0xdb99c5[_0xa2b4('0x50')]=qs[_0xa2b4('0x50')](_0x596f53[_0xa2b4('0x48')]['offset']);}_0xdb99c5[_0xa2b4('0x51')]=qs[_0xa2b4('0x52')](_0x596f53[_0xa2b4('0x48')][_0xa2b4('0x52')]);_0xdb99c5[_0xa2b4('0x53')]=qs['filters'](_[_0xa2b4('0x6e')](_0x596f53['query'],_0x529f86[_0xa2b4('0x4a')]));_0xdb99c5['where']['ChatWebsiteId']=_0x177783['id'];if(_0x596f53[_0xa2b4('0x48')]['filter']){_0xdb99c5['where']=_['merge'](_0xdb99c5[_0xa2b4('0x53')],{'$or':_['map'](_0xdb99c5[_0xa2b4('0x5c')],function(_0x55d4b1){var _0xb5cf40={};_0xb5cf40[_0x55d4b1]={'$like':'%'+_0x596f53[_0xa2b4('0x48')]['filter']+'%'};return _0xb5cf40;})});}_0xdb99c5=_[_0xa2b4('0x55')]({},_0xdb99c5,_0x596f53[_0xa2b4('0x57')]);return db[_0xa2b4('0xba')][_0xa2b4('0x33')]({'where':_0xdb99c5[_0xa2b4('0x53')]})[_0xa2b4('0x26')](function(_0x3d5090){_0x19d66b['count']=_0x3d5090;if(_0x596f53['query'][_0xa2b4('0x5e')]){_0xdb99c5[_0xa2b4('0x58')]=[{'model':db['CmContact'],'as':_0xa2b4('0xe9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xa2b4('0x3f'),_0xa2b4('0xea'),_0xa2b4('0xeb')],'required':![]},{'model':db[_0xa2b4('0xec')],'as':_0xa2b4('0xed'),'attributes':['id',_0xa2b4('0x3f'),_0xa2b4('0xee')],'where':_0x596f53[_0xa2b4('0x48')]['tag']?{'id':_0x596f53[_0xa2b4('0x48')]['tag']}:undefined,'required':_0x596f53['query'][_0xa2b4('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0xa2b4('0x59')](_0xdb99c5);})[_0xa2b4('0x26')](function(_0xf8e247){_0x19d66b['rows']=_0xf8e247;return _0x19d66b;});}})[_0xa2b4('0x26')](respondWithFilteredResult(_0x2696d2,_0xdb99c5))[_0xa2b4('0x2e')](handleError(_0x2696d2,null));};function iftimePromise(_0x4c424d,_0x31dfe6){return respondWithRpcPromise('Command','getSnippet',{'command':_0x31dfe6[_0xa2b4('0xf0')]?util[_0xa2b4('0xb4')](_0xa2b4('0xf1'),_0x4c424d[_0xa2b4('0xf2')],_0x31dfe6[_0xa2b4('0xf0')]):util[_0xa2b4('0xb4')](_0xa2b4('0xf3'),_0x4c424d[_0xa2b4('0xf2')])},client9002)[_0xa2b4('0x26')](function(_0x12f6fc){var _0x14cbc3=_0x12f6fc&&_0x12f6fc[_0xa2b4('0xf4')](_0xa2b4('0xf5'))>=0x0?!![]:![];logger[_0xa2b4('0xf6')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x31dfe6['id'],_0x4c424d['id'],_0x4c424d[_0xa2b4('0xf2')],_0x14cbc3?_0xa2b4('0xf7'):_0xa2b4('0xf8'),_0x31dfe6[_0xa2b4('0xf0')]?_0x31dfe6['timezone']:_0xa2b4('0xf9'));return _0x14cbc3;})[_0xa2b4('0x2e')](function(_0x962516){logger[_0xa2b4('0x2a')](_0xa2b4('0xfa'),_0x31dfe6['id'],_0x4c424d['id'],_0x4c424d[_0xa2b4('0xf2')],util[_0xa2b4('0xfb')](_0x962516,{'showHidden':![],'depth':null}),_0x31dfe6[_0xa2b4('0xf0')]?_0x31dfe6['timezone']:_0xa2b4('0xf9'));return![];});}exports[_0xa2b4('0xfc')]=function(_0x112cb4,_0x400fd7,_0x5e00b5){var _0x60f96a=0x0;var _0x309285=0x0;var _0x4851ef=![];var _0x13bace;var _0x4eee95;return db[_0xa2b4('0x44')]['find']({'where':{'id':_0x112cb4[_0xa2b4('0x69')]['id']},'include':[{'model':db[_0xa2b4('0xfd')],'as':_0xa2b4('0xfd'),'include':[{'model':db[_0xa2b4('0xfd')],'as':_0xa2b4('0xfe'),'attributes':['id',_0xa2b4('0xf2')],'raw':!![]}]}]})[_0xa2b4('0x26')](handleEntityNotFound(_0x400fd7,null))['then'](function(_0x3e17b2){if(_0x3e17b2){_0x13bace=_0x3e17b2;return _0x3e17b2[_0xa2b4('0xff')]({'raw':!![]});}})['then'](function(_0x219abb){if(_0x13bace){if(_0x219abb){_0x4eee95=_0x219abb;}}return require('../../config/license/util')[_0xa2b4('0x81')]();})[_0xa2b4('0x26')](function(_0x7d2336){if(_0x7d2336){_0x309285=_0x7d2336[_0xa2b4('0x100')];_0x4851ef=_0x7d2336[_0xa2b4('0x82')];}})['then'](function(){return db['ChatInteraction'][_0xa2b4('0x33')]({'where':{'closed':![]}});})['then'](function(_0x3bb747){_0x60f96a=_0x3bb747;if(_0x309285&&_0x3bb747>_0x309285){return db[_0xa2b4('0x101')]['findOne']({'where':{'id':0x1}})[_0xa2b4('0x26')](function(_0x29f053){if(_0x29f053){_0x29f053['increment'](_0xa2b4('0x102'));}});}})[_0xa2b4('0x26')](function(){if(_0x13bace[_0xa2b4('0xfd')]&&_0x13bace[_0xa2b4('0xfd')]['Intervals']){var _0x9cd490=[];for(var _0x39074d=0x0;_0x39074d<_0x13bace[_0xa2b4('0xfd')][_0xa2b4('0xfe')][_0xa2b4('0x5d')];_0x39074d++){var _0x5df3f2=_0x13bace[_0xa2b4('0xfd')][_0xa2b4('0xfe')][_0x39074d][_0xa2b4('0x3c')]({'plain':!![]});_0x9cd490['push'](iftimePromise(_0x5df3f2,_0x13bace));}return BPromise[_0xa2b4('0x103')](_0x9cd490)[_0xa2b4('0x26')](function(_0x1b4c72){return _[_0xa2b4('0x104')](_0x1b4c72);});}else{return!![];}})[_0xa2b4('0x26')](function(_0x3e772c){var _0x35ae30=fs[_0xa2b4('0xd5')](path['join'](config[_0xa2b4('0x7d')],_0xa2b4('0x105')),'utf8');var _0x1e4548={'remote':_0x13bace[_0xa2b4('0x106')],'query':querystring[_0xa2b4('0x29')](_[_0xa2b4('0x55')](_0x13bace[_0xa2b4('0x3c')]({'plain':!![]}),{'customerIp':_0x112cb4[_0xa2b4('0x91')][_0xa2b4('0xab')]||_0x112cb4[_0xa2b4('0x91')][_0xa2b4('0x107')]||_0x112cb4[_0xa2b4('0x108')][_0xa2b4('0x109')]||_0x112cb4['ip'],'referer':_0x112cb4[_0xa2b4('0x91')][_0xa2b4('0xb1')],'openedInteractions':_0x60f96a,'maxInteractions':_0x309285,'virtual':_0x4851ef[_0xa2b4('0x100')],'online':_0x3e772c,'custom':_0x4851ef}))[_0xa2b4('0x10a')](/'/g,'\x5c\x27')};_0x400fd7[_0xa2b4('0xd0')](ejs[_0xa2b4('0xd8')](Mustache[_0xa2b4('0xd8')](_0x35ae30,_0x1e4548),{'proactiveActions':_0x4eee95,'alignment':_0x13bace[_0xa2b4('0x10b')],'verticalAlignment':_0x13bace[_0xa2b4('0x10c')]}));})[_0xa2b4('0x2e')](handleError(_0x400fd7,null));};exports[_0xa2b4('0x10d')]=function(_0x272dec,_0x51e688,_0x1a699d){return db[_0xa2b4('0x44')][_0xa2b4('0x72')]({'where':{'id':_0x272dec[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x51e688,null))[_0xa2b4('0x26')](function(_0x6a3029){if(_0x6a3029){return db[_0xa2b4('0x10e')]['transaction'](function(_0x26ac65){return db[_0xa2b4('0x10f')][_0xa2b4('0x3b')]({'where':{'ChatWebsiteId':_0x272dec['params']['id']},'transaction':_0x26ac65})[_0xa2b4('0x26')](function(_0x415784){var _0x22eff6=_[_0xa2b4('0x43')](_0x272dec[_0xa2b4('0x61')],function(_0x4849b2){_0x4849b2['ChatWebsiteId']=_0x272dec['params']['id'];return _0x4849b2;});return db[_0xa2b4('0x10f')][_0xa2b4('0x110')](_0x22eff6,{'transaction':_0x26ac65});});})[_0xa2b4('0x26')](function(){return db[_0xa2b4('0x10f')][_0xa2b4('0x111')]({'where':{'ChatWebsiteId':_0x272dec[_0xa2b4('0x69')]['id']},'order':_0xa2b4('0x112')});});}})[_0xa2b4('0x26')](respondWithResult(_0x51e688,null))[_0xa2b4('0x2e')](handleError(_0x51e688,null));};exports[_0xa2b4('0x113')]=function(_0x57b5e3,_0x41c20d,_0x1068b6){var _0x495a25={};var _0x4ebce8={};var _0x3b4848;var _0x21a293;return db['ChatWebsite'][_0xa2b4('0x72')]({'where':{'id':_0x57b5e3[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x41c20d,null))['then'](function(_0x3f7dc0){if(_0x3f7dc0){_0x3b4848=_0x3f7dc0;_0x4ebce8[_0xa2b4('0x4d')]=_[_0xa2b4('0x49')](db[_0xa2b4('0x10f')][_0xa2b4('0x45')]);_0x4ebce8['query']=_[_0xa2b4('0x49')](_0x57b5e3[_0xa2b4('0x48')]);_0x4ebce8[_0xa2b4('0x4a')]=_[_0xa2b4('0x4b')](_0x4ebce8[_0xa2b4('0x4d')],_0x4ebce8[_0xa2b4('0x48')]);_0x495a25[_0xa2b4('0x5c')]=_[_0xa2b4('0x4b')](_0x4ebce8[_0xa2b4('0x4d')],qs[_0xa2b4('0x4c')](_0x57b5e3[_0xa2b4('0x48')][_0xa2b4('0x4c')]));_0x495a25[_0xa2b4('0x5c')]=_0x495a25[_0xa2b4('0x5c')][_0xa2b4('0x5d')]?_0x495a25[_0xa2b4('0x5c')]:_0x4ebce8[_0xa2b4('0x4d')];_0x495a25[_0xa2b4('0x51')]=qs[_0xa2b4('0x52')](_0x57b5e3[_0xa2b4('0x48')][_0xa2b4('0x52')]);_0x495a25[_0xa2b4('0x53')]=qs['filters'](_[_0xa2b4('0x6e')](_0x57b5e3[_0xa2b4('0x48')],_0x4ebce8[_0xa2b4('0x4a')]));if(_0x57b5e3[_0xa2b4('0x48')]['filter']){_0x495a25[_0xa2b4('0x53')]=_[_0xa2b4('0x55')](_0x495a25[_0xa2b4('0x53')],{'$or':_[_0xa2b4('0x43')](_0x495a25[_0xa2b4('0x5c')],function(_0x317a9c){var _0x14dea7={};_0x14dea7[_0x317a9c]={'$like':'%'+_0x57b5e3[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0x14dea7;})});}_0x495a25=_[_0xa2b4('0x55')]({},_0x495a25,_0x57b5e3['options']);return _0x3b4848[_0xa2b4('0x113')](_0x495a25);}})[_0xa2b4('0x26')](function(_0x412f9d){if(_0x412f9d){_0x21a293=_0x412f9d[_0xa2b4('0x5d')];if(!_0x57b5e3[_0xa2b4('0x48')]['hasOwnProperty'](_0xa2b4('0x4f'))){_0x495a25[_0xa2b4('0x34')]=qs[_0xa2b4('0x34')](_0x57b5e3[_0xa2b4('0x48')][_0xa2b4('0x34')]);_0x495a25[_0xa2b4('0x50')]=qs[_0xa2b4('0x50')](_0x57b5e3['query'][_0xa2b4('0x50')]);}return _0x3b4848['getApplications'](_0x495a25);}})[_0xa2b4('0x26')](function(_0x21d0d7){if(_0x21d0d7){return _0x21d0d7?{'count':_0x21a293,'rows':_0x21d0d7}:null;}})[_0xa2b4('0x26')](respondWithResult(_0x41c20d,null))['catch'](handleError(_0x41c20d,null));};exports[_0xa2b4('0x114')]=function(_0x4fa19d,_0x27b4e0,_0x1c1b94){return db[_0xa2b4('0x115')][_0xa2b4('0x5f')]({'where':{'id':_0x4fa19d[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x27b4e0,null))[_0xa2b4('0x26')](function(_0x17c913){if(_0x17c913){return _0x17c913[_0xa2b4('0x114')](_0x4fa19d[_0xa2b4('0x61')]['ids'],_[_0xa2b4('0x116')](_0x4fa19d[_0xa2b4('0x61')],[_0xa2b4('0x6f'),'id'])||{});}})[_0xa2b4('0x26')](respondWithResult(_0x27b4e0,null))['catch'](handleError(_0x27b4e0,null));};exports[_0xa2b4('0xff')]=function(_0x49a9de,_0x5b9602,_0x484d50){var _0x2f9055={};var _0x46ce84={};var _0x5a7ce4;var _0x5d9b11;return db[_0xa2b4('0x44')][_0xa2b4('0x72')]({'where':{'id':_0x49a9de['params']['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x5b9602,null))['then'](function(_0x3bfb7a){if(_0x3bfb7a){_0x5a7ce4=_0x3bfb7a;_0x46ce84[_0xa2b4('0x4d')]=_[_0xa2b4('0x49')](db[_0xa2b4('0x117')][_0xa2b4('0x45')]);_0x46ce84[_0xa2b4('0x48')]=_[_0xa2b4('0x49')](_0x49a9de[_0xa2b4('0x48')]);_0x46ce84[_0xa2b4('0x4a')]=_[_0xa2b4('0x4b')](_0x46ce84[_0xa2b4('0x4d')],_0x46ce84[_0xa2b4('0x48')]);_0x2f9055[_0xa2b4('0x5c')]=_[_0xa2b4('0x4b')](_0x46ce84[_0xa2b4('0x4d')],qs[_0xa2b4('0x4c')](_0x49a9de[_0xa2b4('0x48')][_0xa2b4('0x4c')]));_0x2f9055[_0xa2b4('0x5c')]=_0x2f9055[_0xa2b4('0x5c')][_0xa2b4('0x5d')]?_0x2f9055[_0xa2b4('0x5c')]:_0x46ce84[_0xa2b4('0x4d')];_0x2f9055[_0xa2b4('0x51')]=qs[_0xa2b4('0x52')](_0x49a9de[_0xa2b4('0x48')]['sort']);_0x2f9055[_0xa2b4('0x53')]=qs[_0xa2b4('0x4a')](_['pick'](_0x49a9de['query'],_0x46ce84[_0xa2b4('0x4a')]));if(_0x49a9de[_0xa2b4('0x48')][_0xa2b4('0x54')]){_0x2f9055['where']=_['merge'](_0x2f9055['where'],{'$or':_[_0xa2b4('0x43')](_0x2f9055[_0xa2b4('0x5c')],function(_0x2ceb08){var _0x395df2={};_0x395df2[_0x2ceb08]={'$like':'%'+_0x49a9de[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0x395df2;})});}_0x2f9055=_[_0xa2b4('0x55')]({},_0x2f9055,_0x49a9de[_0xa2b4('0x57')]);return _0x5a7ce4[_0xa2b4('0xff')](_0x2f9055);}})[_0xa2b4('0x26')](function(_0x4d9d4c){if(_0x4d9d4c){_0x5d9b11=_0x4d9d4c[_0xa2b4('0x5d')];if(!_0x49a9de[_0xa2b4('0x48')][_0xa2b4('0x4e')](_0xa2b4('0x4f'))){_0x2f9055[_0xa2b4('0x34')]=qs[_0xa2b4('0x34')](_0x49a9de[_0xa2b4('0x48')]['limit']);_0x2f9055[_0xa2b4('0x50')]=qs['offset'](_0x49a9de[_0xa2b4('0x48')]['offset']);}return _0x5a7ce4[_0xa2b4('0xff')](_0x2f9055);}})[_0xa2b4('0x26')](function(_0x139231){if(_0x139231){return _0x139231?{'count':_0x5d9b11,'rows':_0x139231}:null;}})['then'](respondWithResult(_0x5b9602,null))[_0xa2b4('0x2e')](handleError(_0x5b9602,null));};exports[_0xa2b4('0x118')]=function(_0x22b91f,_0x25f309,_0xc85ca7){var _0x19e6c4=_0x22b91f[_0xa2b4('0x48')][_0xa2b4('0x119')]===_0xa2b4('0x11a')?_0xa2b4('0x11b'):'onlineForm';return db[_0xa2b4('0x44')][_0xa2b4('0x5f')]({'attributes':['id',_0x19e6c4],'where':{'id':_0x22b91f[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x25f309,null))[_0xa2b4('0x26')](function(_0x56e4e8){if(_0x56e4e8){var _0x4614ea=_0x56e4e8[_0x19e6c4];var _0x46ca90=_0x4614ea&&_0x4614ea['items']?_0x4614ea['items']:[];_0x25f309['send']({'fromKey':_['isNil'](_0x4614ea[_0xa2b4('0x11c')])?undefined:_0x4614ea['fromKey'],'count':_0x46ca90[_0xa2b4('0x5d')],'rows':_0x46ca90});}})['catch'](handleError(_0x25f309,null));};exports[_0xa2b4('0x11d')]=function(_0x5229bf,_0x29dd6a,_0x499b89){var _0x5869c8={'raw':!![],'where':{}};var _0x2ddd55={};var _0x2faedd={'count':0x0,'rows':[]};return db[_0xa2b4('0x44')][_0xa2b4('0x72')]({'where':{'id':_0x5229bf[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x29dd6a,null))[_0xa2b4('0x26')](function(_0x126a21){if(_0x126a21){_0x2ddd55['model']=_[_0xa2b4('0x49')](db[_0xa2b4('0xdb')]['rawAttributes']);_0x2ddd55[_0xa2b4('0x48')]=_[_0xa2b4('0x49')](_0x5229bf[_0xa2b4('0x48')]);_0x2ddd55[_0xa2b4('0x4a')]=_[_0xa2b4('0x4b')](_0x2ddd55[_0xa2b4('0x4d')],_0x2ddd55[_0xa2b4('0x48')]);_0x5869c8[_0xa2b4('0x5c')]=_[_0xa2b4('0x4b')](_0x2ddd55[_0xa2b4('0x4d')],qs['fields'](_0x5229bf['query'][_0xa2b4('0x4c')]));_0x5869c8[_0xa2b4('0x5c')]=_0x5869c8['attributes'][_0xa2b4('0x5d')]?_0x5869c8['attributes']:_0x2ddd55['model'];if(!_0x5229bf['query'][_0xa2b4('0x4e')](_0xa2b4('0x4f'))){_0x5869c8[_0xa2b4('0x34')]=qs[_0xa2b4('0x34')](_0x5229bf[_0xa2b4('0x48')]['limit']);_0x5869c8[_0xa2b4('0x50')]=qs['offset'](_0x5229bf[_0xa2b4('0x48')][_0xa2b4('0x50')]);}_0x5869c8[_0xa2b4('0x51')]=qs['sort'](_0x5229bf[_0xa2b4('0x48')][_0xa2b4('0x52')]);_0x5869c8[_0xa2b4('0x53')]=qs['filters'](_[_0xa2b4('0x6e')](_0x5229bf['query'],_0x2ddd55[_0xa2b4('0x4a')]));_0x5869c8['where']['ChatWebsiteId']=_0x126a21['id'];if(_0x5229bf[_0xa2b4('0x48')][_0xa2b4('0x54')]){_0x5869c8['where']=_[_0xa2b4('0x55')](_0x5869c8['where'],{'$or':_[_0xa2b4('0x43')](_0x5869c8['attributes'],function(_0x23301f){var _0xaeec90={};_0xaeec90[_0x23301f]={'$like':'%'+_0x5229bf[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0xaeec90;})});}_0x5869c8=_[_0xa2b4('0x55')]({},_0x5869c8,_0x5229bf[_0xa2b4('0x57')]);return db[_0xa2b4('0xdb')]['count']({'where':_0x5869c8[_0xa2b4('0x53')]})[_0xa2b4('0x26')](function(_0x2e65de){_0x2faedd[_0xa2b4('0x33')]=_0x2e65de;if(_0x5229bf[_0xa2b4('0x48')][_0xa2b4('0x5e')]){_0x5869c8[_0xa2b4('0x58')]=[{'all':!![]}];}return db[_0xa2b4('0xdb')][_0xa2b4('0x59')](_0x5869c8);})['then'](function(_0x3fbc0a){_0x2faedd[_0xa2b4('0x5a')]=_0x3fbc0a;return _0x2faedd;});}})[_0xa2b4('0x26')](respondWithFilteredResult(_0x29dd6a,_0x5869c8))['catch'](handleError(_0x29dd6a,null));};exports[_0xa2b4('0x11e')]=function(_0x28af86,_0x370436,_0x56b99d){return db[_0xa2b4('0x44')]['find']({'where':{'id':_0x28af86[_0xa2b4('0x69')]['id']}})['then'](handleEntityNotFound(_0x370436,null))[_0xa2b4('0x26')](function(_0x5eb801){if(_0x5eb801){return _0x5eb801[_0xa2b4('0x11e')](_0x28af86[_0xa2b4('0x61')][_0xa2b4('0x6f')],_['omit'](_0x28af86[_0xa2b4('0x61')],['ids','id'])||{})['spread'](function(_0x482031){for(var _0x18741b=0x0;_0x18741b<_0x28af86[_0xa2b4('0x61')][_0xa2b4('0x6f')][_0xa2b4('0x5d')];_0x18741b+=0x1){socket[_0xa2b4('0x11f')](_0xa2b4('0x120'),{'UserId':_0x28af86[_0xa2b4('0x61')][_0xa2b4('0x6f')][_0x18741b],'ChatWebsiteId':_0x28af86[_0xa2b4('0x69')]['id']});}return _0x482031;});}})[_0xa2b4('0x26')](respondWithResult(_0x370436,null))[_0xa2b4('0x2e')](handleError(_0x370436,null));};exports[_0xa2b4('0x121')]=function(_0x36f6ba,_0x4c719e,_0x472c6e){return db[_0xa2b4('0x44')]['find']({'where':{'id':_0x36f6ba[_0xa2b4('0x69')]['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x4c719e,null))[_0xa2b4('0x26')](function(_0x163e10){if(_0x163e10){return _0x163e10[_0xa2b4('0x121')](_0x36f6ba[_0xa2b4('0x48')]['ids'])['then'](function(){if(_[_0xa2b4('0x122')](_0x36f6ba[_0xa2b4('0x48')]['ids'])){for(var _0x695ecf=0x0;_0x695ecf<_0x36f6ba['query'][_0xa2b4('0x6f')]['length'];_0x695ecf+=0x1){socket[_0xa2b4('0x11f')](_0xa2b4('0x123'),{'UserId':Number(_0x36f6ba[_0xa2b4('0x48')][_0xa2b4('0x6f')][_0x695ecf]),'ChatWebsiteId':Number(_0x36f6ba['params']['id'])});}}else{socket['emit'](_0xa2b4('0x123'),{'UserId':Number(_0x36f6ba[_0xa2b4('0x48')]['ids']),'ChatWebsiteId':Number(_0x36f6ba['params']['id'])});}});}})[_0xa2b4('0x26')](respondWithStatusCode(_0x4c719e,null))['catch'](handleError(_0x4c719e,null));};exports['getAgents']=function(_0x5814ba,_0x1ba05c,_0x38bf8c){var _0x3c0e63={};var _0x59f220={};var _0x446cff;var _0x3a89b4;return db['ChatWebsite'][_0xa2b4('0x72')]({'where':{'id':_0x5814ba['params']['id']}})[_0xa2b4('0x26')](handleEntityNotFound(_0x1ba05c,null))[_0xa2b4('0x26')](function(_0x5c71a4){if(_0x5c71a4){_0x446cff=_0x5c71a4;_0x59f220[_0xa2b4('0x4d')]=_[_0xa2b4('0x49')](db[_0xa2b4('0xc6')]['rawAttributes']);_0x59f220['query']=_['keys'](_0x5814ba['query']);_0x59f220[_0xa2b4('0x4a')]=_['intersection'](_0x59f220['model'],_0x59f220[_0xa2b4('0x48')]);_0x3c0e63[_0xa2b4('0x5c')]=_['intersection'](_0x59f220['model'],qs[_0xa2b4('0x4c')](_0x5814ba['query'][_0xa2b4('0x4c')]));_0x3c0e63[_0xa2b4('0x5c')]=_0x3c0e63[_0xa2b4('0x5c')]['length']?_0x3c0e63[_0xa2b4('0x5c')]:_0x59f220['model'];_0x3c0e63['order']=qs[_0xa2b4('0x52')](_0x5814ba[_0xa2b4('0x48')][_0xa2b4('0x52')]);_0x3c0e63[_0xa2b4('0x53')]=qs[_0xa2b4('0x4a')](_[_0xa2b4('0x6e')](_0x5814ba[_0xa2b4('0x48')],_0x59f220[_0xa2b4('0x4a')]));if(_0x5814ba[_0xa2b4('0x48')][_0xa2b4('0x54')]){_0x3c0e63[_0xa2b4('0x53')]=_[_0xa2b4('0x55')](_0x3c0e63[_0xa2b4('0x53')],{'$or':_[_0xa2b4('0x43')](_0x3c0e63['attributes'],function(_0x332df4){var _0x5014d0={};_0x5014d0[_0x332df4]={'$like':'%'+_0x5814ba[_0xa2b4('0x48')][_0xa2b4('0x54')]+'%'};return _0x5014d0;})});}_0x3c0e63=_[_0xa2b4('0x55')]({},_0x3c0e63,_0x5814ba[_0xa2b4('0x57')]);return _0x446cff['getAgents'](_0x3c0e63);}})[_0xa2b4('0x26')](function(_0x499b17){if(_0x499b17){_0x3a89b4=_0x499b17[_0xa2b4('0x5d')];if(!_0x5814ba[_0xa2b4('0x48')][_0xa2b4('0x4e')](_0xa2b4('0x4f'))){_0x3c0e63['limit']=qs[_0xa2b4('0x34')](_0x5814ba[_0xa2b4('0x48')]['limit']);_0x3c0e63[_0xa2b4('0x50')]=qs[_0xa2b4('0x50')](_0x5814ba[_0xa2b4('0x48')][_0xa2b4('0x50')]);}return _0x446cff[_0xa2b4('0x124')](_0x3c0e63);}})[_0xa2b4('0x26')](function(_0x41dfe3){if(_0x41dfe3){return _0x41dfe3?{'count':_0x3a89b4,'rows':_0x41dfe3}:null;}})[_0xa2b4('0x26')](respondWithResult(_0x1ba05c,null))[_0xa2b4('0x2e')](handleError(_0x1ba05c,null));}; \ No newline at end of file +var _0x9091=['query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','count','includeAll','include','findAll','rows','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','customerAvatar','systemAvatar','getLogo','../../config/license/util','getLicense','custom','existsSync','join','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','chat','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','account','applications','list','priority','asc','Applications','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','contact','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','ids','omit','options','Owner','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','replace','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','get','ChatWebsites','UserProfileResource','destroy','stack','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','name'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x9091,0x1ed));var _0x1909=function(_0x408e77,_0x14f063){_0x408e77=_0x408e77-0x0;var _0x5e5b8f=_0x9091[_0x408e77];return _0x5e5b8f;};'use strict';var pdf=require(_0x1909('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1909('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1909('0x2'));var rp=require('request-promise');var moment=require(_0x1909('0x3'));var BPromise=require(_0x1909('0x4'));var Mustache=require(_0x1909('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1909('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1909('0x7'));var squel=require(_0x1909('0x8'));var crypto=require(_0x1909('0x9'));var jsforce=require(_0x1909('0xa'));var deskjs=require(_0x1909('0xb'));var toCsv=require(_0x1909('0x6'));var querystring=require('querystring');var Papa=require(_0x1909('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1909('0xd'));var as=require(_0x1909('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1909('0xf'))(_0x1909('0x10'));var utils=require('../../config/utils');var config=require(_0x1909('0x11'));var db=require('../../mysqldb')['db'];config[_0x1909('0x12')]=_[_0x1909('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1909('0x14'))(new Redis(config[_0x1909('0x12')]));require(_0x1909('0x15'))['register'](socket);var jayson=require(_0x1909('0x16'));var client=jayson[_0x1909('0x17')][_0x1909('0x18')]({'port':0x232c});var client9002=jayson[_0x1909('0x17')][_0x1909('0x18')]({'port':0x232a});var client9003=jayson['client'][_0x1909('0x18')]({'port':0x232b});function checkPasswordPattern(_0x6297fa,_0x1aca4d,_0x1c4df7){if(_0x1c4df7){var _0x1e904e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e904e['test'](_0x1aca4d)){return _0x6297fa;}else{throw new db[(_0x1909('0x19'))][(_0x1909('0x1a'))]('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 _0x6297fa;}}function respondWithRpcPromise(_0x1e50ee,_0x5e7cc5,_0x4582f1,_0x3c4304){return new BPromise(function(_0x2b5ee1,_0xb39d7a){var _0x412fb4=_0x3c4304||client;return _0x412fb4[_0x1909('0x1b')](_0x1e50ee,_0x4582f1)[_0x1909('0x1c')](function(_0x2545ef){logger[_0x1909('0x1d')](_0x1909('0x1e'),_0x5e7cc5,_0x1909('0x1f'));logger[_0x1909('0x20')](_0x1909('0x21'),_0x5e7cc5,_0x1909('0x1f'),JSON['stringify'](_0x2545ef));if(_0x2545ef[_0x1909('0x22')]){if(_0x2545ef[_0x1909('0x22')][_0x1909('0x23')]===0x1f4){logger[_0x1909('0x22')](_0x1909('0x1e'),_0x5e7cc5,_0x2545ef[_0x1909('0x22')][_0x1909('0x24')]);return _0xb39d7a(_0x2545ef['error'][_0x1909('0x24')]);}logger[_0x1909('0x22')](_0x1909('0x1e'),_0x5e7cc5,_0x2545ef['error']['message']);return _0x2b5ee1(_0x2545ef[_0x1909('0x22')][_0x1909('0x24')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5e7cc5,_0x1909('0x1f'));_0x2b5ee1(_0x2545ef[_0x1909('0x25')][_0x1909('0x24')]);}})[_0x1909('0x26')](function(_0x10b697){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5e7cc5,_0x10b697);_0xb39d7a(_0x10b697);});});}function respondWithStatusCode(_0x309ea8,_0x173b14){_0x173b14=_0x173b14||0xcc;return function(_0x2c5277){if(_0x2c5277){return _0x309ea8[_0x1909('0x27')](_0x173b14);}return _0x309ea8[_0x1909('0x28')](_0x173b14)[_0x1909('0x29')]();};}function respondWithResult(_0xaa5af2,_0x5b0fd9){_0x5b0fd9=_0x5b0fd9||0xc8;return function(_0x5c2906){if(_0x5c2906){return _0xaa5af2[_0x1909('0x28')](_0x5b0fd9)['json'](_0x5c2906);}};}function respondWithFilteredResult(_0x307229,_0xa9db8e){return function(_0x190ce5){if(_0x190ce5){var _0x42b85e=_0x190ce5['count'],_0x7585d1=_0xa9db8e[_0x1909('0x2a')],_0x49e19a=_0xa9db8e[_0x1909('0x2a')]+_0xa9db8e[_0x1909('0x2b')],_0x45a6bf;if(_0x49e19a>=_0x42b85e){_0x49e19a=_0x42b85e;_0x45a6bf=0xc8;}else{_0x45a6bf=0xce;}_0x307229[_0x1909('0x28')](_0x45a6bf);return _0x307229[_0x1909('0x2c')](_0x1909('0x2d'),_0x7585d1+'-'+_0x49e19a+'/'+_0x42b85e)[_0x1909('0x2e')](_0x190ce5);}return null;};}function patchUpdates(_0x3af92a){return function(_0x3df140){try{jsonpatch[_0x1909('0x2f')](_0x3df140,_0x3af92a,!![]);}catch(_0x11e56b){return BPromise[_0x1909('0x30')](_0x11e56b);}return _0x3df140[_0x1909('0x31')]();};}function saveUpdates(_0x347f2a,_0x1860c8){return function(_0x5cb960){if(_0x5cb960){return _0x5cb960['update'](_0x347f2a)[_0x1909('0x1c')](function(_0x13d547){return _0x13d547;});}return null;};}function removeEntity(_0x3ab9fb,_0x4754b8){return function(_0x21ed55){if(_0x21ed55){return _0x21ed55['destroy']()['then'](function(){var _0x39a60b=_0x21ed55[_0x1909('0x32')]({'plain':!![]});var _0x4699bc=_0x1909('0x33');return db[_0x1909('0x34')][_0x1909('0x35')]({'where':{'type':_0x4699bc,'resourceId':_0x39a60b['id']}})[_0x1909('0x1c')](function(){return _0x21ed55;});})['then'](function(){_0x3ab9fb[_0x1909('0x28')](0xcc)[_0x1909('0x29')]();});}};}function handleEntityNotFound(_0x4c2635,_0x23687a){return function(_0x91f031){if(!_0x91f031){_0x4c2635[_0x1909('0x27')](0x194);}return _0x91f031;};}function handleError(_0x374cd4,_0x3a8436){_0x3a8436=_0x3a8436||0x1f4;return function(_0x5d5884){logger['error'](_0x5d5884[_0x1909('0x36')]);if(_0x5d5884['name']){delete _0x5d5884['name'];}_0x374cd4[_0x1909('0x28')](_0x3a8436)[_0x1909('0x37')](_0x5d5884);};}exports[_0x1909('0x38')]=function(_0x97df48,_0x29270f){var _0xe461f0={'include':[{'model':db[_0x1909('0x39')],'as':_0x1909('0x3a')}]},_0x275b5f={},_0x30b351={'count':0x0,'rows':[]};var _0x3310b1=_['map'](db[_0x1909('0x3b')][_0x1909('0x3c')],function(_0xa4d526){return{'name':_0xa4d526[_0x1909('0x3d')],'type':_0xa4d526[_0x1909('0x3e')][_0x1909('0x3f')]};});_0x275b5f[_0x1909('0x40')]=_[_0x1909('0x41')](_0x3310b1,_0x1909('0x42'));_0x275b5f[_0x1909('0x43')]=_['keys'](_0x97df48[_0x1909('0x43')]);_0x275b5f['filters']=_['intersection'](_0x275b5f['model'],_0x275b5f[_0x1909('0x43')]);_0xe461f0['attributes']=_[_0x1909('0x44')](_0x275b5f['model'],qs['fields'](_0x97df48[_0x1909('0x43')]['fields']));_0xe461f0[_0x1909('0x45')]=_0xe461f0[_0x1909('0x45')][_0x1909('0x46')]?_0xe461f0[_0x1909('0x45')]:_0x275b5f[_0x1909('0x40')];if(!_0x97df48['query'][_0x1909('0x47')](_0x1909('0x48'))){_0xe461f0[_0x1909('0x2b')]=qs['limit'](_0x97df48['query'][_0x1909('0x2b')]);_0xe461f0[_0x1909('0x2a')]=qs['offset'](_0x97df48[_0x1909('0x43')][_0x1909('0x2a')]);}_0xe461f0[_0x1909('0x49')]=qs[_0x1909('0x4a')](_0x97df48[_0x1909('0x43')][_0x1909('0x4a')]);_0xe461f0[_0x1909('0x4b')]=qs[_0x1909('0x4c')](_['pick'](_0x97df48[_0x1909('0x43')],_0x275b5f[_0x1909('0x4c')]));if(_0x97df48[_0x1909('0x43')][_0x1909('0x4d')]){_0xe461f0[_0x1909('0x4b')]=_[_0x1909('0x4e')](_0xe461f0[_0x1909('0x4b')],{'$or':_['map'](_0x3310b1,function(_0x1a52b7){if(_0x1a52b7['type']!=='VIRTUAL'){var _0x308960={};_0x308960[_0x1a52b7[_0x1909('0x42')]]={'$like':'%'+_0x97df48['query']['filter']+'%'};return _0x308960;}})});}_0xe461f0=_[_0x1909('0x4e')]({},_0xe461f0,_0x97df48['options']);var _0x479be3={'where':_0xe461f0[_0x1909('0x4b')]};return db['ChatWebsite'][_0x1909('0x4f')](_0x479be3)[_0x1909('0x1c')](function(_0x52203b){_0x30b351['count']=_0x52203b;if(_0x97df48[_0x1909('0x43')][_0x1909('0x50')]){_0xe461f0[_0x1909('0x51')]=[{'all':!![]}];}return db[_0x1909('0x3b')][_0x1909('0x52')](_0xe461f0);})[_0x1909('0x1c')](function(_0x48dde3){_0x30b351[_0x1909('0x53')]=_0x48dde3;return _0x30b351;})['then'](respondWithFilteredResult(_0x29270f,_0xe461f0))[_0x1909('0x26')](handleError(_0x29270f,null));};exports[_0x1909('0x54')]=function(_0x396cb0,_0x543373){var _0x5f0d0c={'raw':![],'where':{'id':_0x396cb0[_0x1909('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x813fd4={};_0x813fd4[_0x1909('0x40')]=_[_0x1909('0x56')](db[_0x1909('0x3b')]['rawAttributes']);_0x813fd4['query']=_[_0x1909('0x56')](_0x396cb0[_0x1909('0x43')]);_0x813fd4[_0x1909('0x4c')]=_[_0x1909('0x44')](_0x813fd4[_0x1909('0x40')],_0x813fd4[_0x1909('0x43')]);_0x5f0d0c[_0x1909('0x45')]=_[_0x1909('0x44')](_0x813fd4[_0x1909('0x40')],qs[_0x1909('0x57')](_0x396cb0[_0x1909('0x43')][_0x1909('0x57')]));_0x5f0d0c[_0x1909('0x45')]=_0x5f0d0c[_0x1909('0x45')][_0x1909('0x46')]?_0x5f0d0c['attributes']:_0x813fd4[_0x1909('0x40')];if(_0x396cb0[_0x1909('0x43')][_0x1909('0x50')]){_0x5f0d0c[_0x1909('0x51')]=[{'all':!![]}];}_0x5f0d0c=_[_0x1909('0x4e')]({},_0x5f0d0c,_0x396cb0['options']);return db[_0x1909('0x3b')][_0x1909('0x58')](_0x5f0d0c)[_0x1909('0x1c')](handleEntityNotFound(_0x543373,null))[_0x1909('0x1c')](respondWithResult(_0x543373,null))['catch'](handleError(_0x543373,null));};exports[_0x1909('0x59')]=function(_0x564bc3,_0x3459a0){return db['ChatWebsite']['create'](_0x564bc3[_0x1909('0x5a')],{})[_0x1909('0x1c')](function(_0x484920){var _0x2f43c5=_0x564bc3[_0x1909('0x5b')][_0x1909('0x32')]({'plain':!![]});if(!_0x2f43c5)throw new Error(_0x1909('0x5c'));if(_0x2f43c5[_0x1909('0x5d')]==='user'){var _0x3c2931=_0x484920[_0x1909('0x32')]({'plain':!![]});var _0x130638=_0x1909('0x33');return db[_0x1909('0x5e')][_0x1909('0x58')]({'where':{'name':_0x130638,'userProfileId':_0x2f43c5[_0x1909('0x5f')]},'raw':!![]})[_0x1909('0x1c')](function(_0x224caa){if(_0x224caa&&_0x224caa['autoAssociation']===0x0){return db['UserProfileResource'][_0x1909('0x59')]({'name':_0x3c2931[_0x1909('0x42')],'resourceId':_0x3c2931['id'],'type':_0x224caa[_0x1909('0x42')],'sectionId':_0x224caa['id']},{})[_0x1909('0x1c')](function(){return _0x484920;});}else{return _0x484920;}})['catch'](function(_0x4e2bad){logger[_0x1909('0x22')](_0x1909('0x60'),_0x4e2bad);throw _0x4e2bad;});}return _0x484920;})[_0x1909('0x1c')](respondWithResult(_0x3459a0,0xc9))[_0x1909('0x26')](handleError(_0x3459a0,null));};exports[_0x1909('0x61')]=function(_0x370b28,_0xefef8d){if(_0x370b28[_0x1909('0x5a')]['id']){delete _0x370b28[_0x1909('0x5a')]['id'];}return db[_0x1909('0x3b')]['find']({'where':{'id':_0x370b28['params']['id']},'include':[{'model':db['Pause'],'as':_0x1909('0x3a')}]})[_0x1909('0x1c')](handleEntityNotFound(_0xefef8d,null))[_0x1909('0x1c')](saveUpdates(_0x370b28[_0x1909('0x5a')],null))[_0x1909('0x1c')](respondWithResult(_0xefef8d,null))['catch'](handleError(_0xefef8d,null));};exports[_0x1909('0x35')]=function(_0x2f5e83,_0x12dd5a){return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x2f5e83[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x12dd5a,null))[_0x1909('0x1c')](removeEntity(_0x12dd5a,null))[_0x1909('0x26')](handleError(_0x12dd5a,null));};exports[_0x1909('0x62')]=function(_0xd84d1e,_0x79ab73){return db['ChatWebsite']['describe']()[_0x1909('0x1c')](respondWithResult(_0x79ab73,null))[_0x1909('0x26')](handleError(_0x79ab73,null));};exports['addDisposition']=function(_0x23cbc8,_0x194ecb,_0x5ebd8f){if(_0x23cbc8[_0x1909('0x5a')]['id']){delete _0x23cbc8[_0x1909('0x5a')]['id'];}return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x23cbc8[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x194ecb,null))['then'](function(_0x10bd30){if(_0x10bd30){_0x23cbc8[_0x1909('0x5a')][_0x1909('0x63')]=_0x10bd30['id'];return db[_0x1909('0x64')][_0x1909('0x59')](_0x23cbc8[_0x1909('0x5a')]);}})['then'](respondWithResult(_0x194ecb,null))[_0x1909('0x26')](handleError(_0x194ecb,null));};exports[_0x1909('0x65')]=function(_0x390203,_0x596d4d,_0x348059){var _0x391f25={'raw':![],'where':{}};var _0x3c5075={};var _0x158e0f={'count':0x0,'rows':[]};return db[_0x1909('0x3b')][_0x1909('0x66')]({'where':{'id':_0x390203['params']['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x596d4d,null))[_0x1909('0x1c')](function(_0xc3fa3c){if(_0xc3fa3c){_0x3c5075[_0x1909('0x40')]=_['keys'](db[_0x1909('0x64')]['rawAttributes']);_0x3c5075['query']=_[_0x1909('0x56')](_0x390203['query']);_0x3c5075['filters']=_[_0x1909('0x44')](_0x3c5075['model'],_0x3c5075[_0x1909('0x43')]);_0x391f25[_0x1909('0x45')]=_[_0x1909('0x44')](_0x3c5075['model'],qs['fields'](_0x390203[_0x1909('0x43')][_0x1909('0x57')]));_0x391f25[_0x1909('0x45')]=_0x391f25['attributes'][_0x1909('0x46')]?_0x391f25[_0x1909('0x45')]:_0x3c5075['model'];if(!_0x390203[_0x1909('0x43')][_0x1909('0x47')](_0x1909('0x48'))){_0x391f25[_0x1909('0x2b')]=qs['limit'](_0x390203[_0x1909('0x43')][_0x1909('0x2b')]);_0x391f25[_0x1909('0x2a')]=qs[_0x1909('0x2a')](_0x390203[_0x1909('0x43')][_0x1909('0x2a')]);}_0x391f25[_0x1909('0x49')]=qs[_0x1909('0x4a')](_0x390203[_0x1909('0x43')][_0x1909('0x4a')]);_0x391f25['where']=qs['filters'](_['pick'](_0x390203[_0x1909('0x43')],_0x3c5075[_0x1909('0x4c')]));_0x391f25[_0x1909('0x4b')]['ChatWebsiteId']=_0xc3fa3c['id'];if(_0x390203[_0x1909('0x43')][_0x1909('0x4d')]){_0x391f25['where']=_[_0x1909('0x4e')](_0x391f25[_0x1909('0x4b')],{'$or':_[_0x1909('0x41')](_0x391f25[_0x1909('0x45')],function(_0x29d104){var _0x835d7e={};_0x835d7e[_0x29d104]={'$like':'%'+_0x390203['query'][_0x1909('0x4d')]+'%'};return _0x835d7e;})});}_0x391f25=_[_0x1909('0x4e')]({},_0x391f25,_0x390203['options']);return db[_0x1909('0x64')]['count']({'where':_0x391f25[_0x1909('0x4b')]})[_0x1909('0x1c')](function(_0x534fcd){_0x158e0f[_0x1909('0x4f')]=_0x534fcd;if(_0x390203[_0x1909('0x43')][_0x1909('0x50')]){_0x391f25[_0x1909('0x51')]=[{'all':!![]}];}return db[_0x1909('0x64')]['findAll'](_0x391f25);})[_0x1909('0x1c')](function(_0x9e5d7f){_0x158e0f[_0x1909('0x53')]=_0x9e5d7f;return _0x158e0f;});}})[_0x1909('0x1c')](respondWithFilteredResult(_0x596d4d,_0x391f25))[_0x1909('0x26')](handleError(_0x596d4d,null));};exports['removeDispositions']=function(_0x36588c,_0x4c8bc7,_0x272bd8){return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x36588c[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x4c8bc7,null))[_0x1909('0x1c')](function(_0xa35cf8){if(_0xa35cf8){return _0xa35cf8[_0x1909('0x67')](_0x36588c[_0x1909('0x43')]['ids']);}})[_0x1909('0x1c')](respondWithStatusCode(_0x4c8bc7,null))[_0x1909('0x26')](handleError(_0x4c8bc7,null));};exports[_0x1909('0x68')]=function(_0x5d685a,_0x105718,_0xe500da){if(_0x5d685a[_0x1909('0x5a')]['id']){delete _0x5d685a[_0x1909('0x5a')]['id'];}return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x5d685a[_0x1909('0x55')]['id']}})['then'](handleEntityNotFound(_0x105718,null))[_0x1909('0x1c')](function(_0x2885f9){if(_0x2885f9){_0x5d685a[_0x1909('0x5a')]['ChatWebsiteId']=_0x2885f9['id'];return db[_0x1909('0x69')][_0x1909('0x59')](_0x5d685a[_0x1909('0x5a')]);}})[_0x1909('0x1c')](respondWithResult(_0x105718,null))[_0x1909('0x26')](handleError(_0x105718,null));};exports[_0x1909('0x6a')]=function(_0x267b64,_0x255872,_0x46c321){var _0x5bc39={'raw':![],'where':{}};var _0x50fe53={};var _0x19c735={'count':0x0,'rows':[]};return db[_0x1909('0x3b')][_0x1909('0x66')]({'where':{'id':_0x267b64[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x255872,null))['then'](function(_0x2c7ac6){if(_0x2c7ac6){_0x50fe53['model']=_[_0x1909('0x56')](db[_0x1909('0x69')][_0x1909('0x3c')]);_0x50fe53['query']=_['keys'](_0x267b64[_0x1909('0x43')]);_0x50fe53[_0x1909('0x4c')]=_[_0x1909('0x44')](_0x50fe53[_0x1909('0x40')],_0x50fe53[_0x1909('0x43')]);_0x5bc39[_0x1909('0x45')]=_[_0x1909('0x44')](_0x50fe53[_0x1909('0x40')],qs['fields'](_0x267b64[_0x1909('0x43')][_0x1909('0x57')]));_0x5bc39[_0x1909('0x45')]=_0x5bc39['attributes'][_0x1909('0x46')]?_0x5bc39[_0x1909('0x45')]:_0x50fe53[_0x1909('0x40')];if(!_0x267b64[_0x1909('0x43')]['hasOwnProperty'](_0x1909('0x48'))){_0x5bc39[_0x1909('0x2b')]=qs[_0x1909('0x2b')](_0x267b64[_0x1909('0x43')][_0x1909('0x2b')]);_0x5bc39[_0x1909('0x2a')]=qs[_0x1909('0x2a')](_0x267b64[_0x1909('0x43')][_0x1909('0x2a')]);}_0x5bc39[_0x1909('0x49')]=qs['sort'](_0x267b64[_0x1909('0x43')]['sort']);_0x5bc39[_0x1909('0x4b')]=qs[_0x1909('0x4c')](_[_0x1909('0x6b')](_0x267b64[_0x1909('0x43')],_0x50fe53[_0x1909('0x4c')]));_0x5bc39[_0x1909('0x4b')][_0x1909('0x63')]=_0x2c7ac6['id'];if(_0x267b64[_0x1909('0x43')][_0x1909('0x4d')]){_0x5bc39['where']=_[_0x1909('0x4e')](_0x5bc39[_0x1909('0x4b')],{'$or':_['map'](_0x5bc39[_0x1909('0x45')],function(_0x64578b){var _0x466a9e={};_0x466a9e[_0x64578b]={'$like':'%'+_0x267b64[_0x1909('0x43')][_0x1909('0x4d')]+'%'};return _0x466a9e;})});}_0x5bc39=_[_0x1909('0x4e')]({},_0x5bc39,_0x267b64['options']);return db[_0x1909('0x69')][_0x1909('0x4f')]({'where':_0x5bc39[_0x1909('0x4b')]})[_0x1909('0x1c')](function(_0x3880c2){_0x19c735[_0x1909('0x4f')]=_0x3880c2;if(_0x267b64[_0x1909('0x43')]['includeAll']){_0x5bc39[_0x1909('0x51')]=[{'all':!![]}];}return db[_0x1909('0x69')][_0x1909('0x52')](_0x5bc39);})[_0x1909('0x1c')](function(_0x568383){_0x19c735[_0x1909('0x53')]=_0x568383;return _0x19c735;});}})[_0x1909('0x1c')](respondWithFilteredResult(_0x255872,_0x5bc39))[_0x1909('0x26')](handleError(_0x255872,null));};exports[_0x1909('0x6c')]=function(_0x3521eb,_0x2c8ee2,_0x380a85){return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x3521eb[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x2c8ee2,null))[_0x1909('0x1c')](function(_0x22d986){if(_0x22d986){return _0x22d986[_0x1909('0x6c')](_0x3521eb[_0x1909('0x43')]['ids']);}})[_0x1909('0x1c')](respondWithStatusCode(_0x2c8ee2,null))[_0x1909('0x26')](handleError(_0x2c8ee2,null));};exports[_0x1909('0x6d')]=function(_0x2f099f,_0x132ec6,_0x39af57){_0x2f099f['body'][_0x1909('0x6e')]=_0x2f099f[_0x1909('0x6f')][_0x1909('0x70')];return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x2f099f['params']['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x132ec6,null))[_0x1909('0x1c')](saveUpdates(_0x2f099f[_0x1909('0x5a')],null))[_0x1909('0x1c')](respondWithResult(_0x132ec6,null))[_0x1909('0x26')](handleError(_0x132ec6,null));};exports['addAvatar']=function(_0x270dcf,_0xcf0776,_0x1cb0e8){_0x270dcf['body'][_0x1909('0x71')]=_0x270dcf['file'][_0x1909('0x70')];return db['ChatWebsite'][_0x1909('0x58')]({'where':{'id':_0x270dcf[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0xcf0776,null))[_0x1909('0x1c')](saveUpdates(_0x270dcf[_0x1909('0x5a')],null))[_0x1909('0x1c')](respondWithResult(_0xcf0776,null))['catch'](handleError(_0xcf0776,null));};exports['addCustomerAvatar']=function(_0x4548e1,_0x2e9b0a,_0x3d93a7){_0x4548e1[_0x1909('0x5a')][_0x1909('0x72')]=_0x4548e1['file'][_0x1909('0x70')];return db['ChatWebsite'][_0x1909('0x58')]({'where':{'id':_0x4548e1['params']['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x2e9b0a,null))[_0x1909('0x1c')](saveUpdates(_0x4548e1['body'],null))[_0x1909('0x1c')](respondWithResult(_0x2e9b0a,null))[_0x1909('0x26')](handleError(_0x2e9b0a,null));};exports['addSystemAvatar']=function(_0x5d8b93,_0x40214d,_0x327903){_0x5d8b93[_0x1909('0x5a')][_0x1909('0x73')]=_0x5d8b93[_0x1909('0x6f')][_0x1909('0x70')];return db[_0x1909('0x3b')]['find']({'where':{'id':_0x5d8b93['params']['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x40214d,null))[_0x1909('0x1c')](saveUpdates(_0x5d8b93['body'],null))['then'](respondWithResult(_0x40214d,null))['catch'](handleError(_0x40214d,null));};exports[_0x1909('0x74')]=function(_0x41d335,_0x3003d1,_0x313348){var _0x13e8d3=path['join'](config['root'],'server/files/images/logos/default_logo.png');var _0x54bb48={'where':{'id':_0x41d335[_0x1909('0x55')]['id']},'attributes':['id',_0x1909('0x6e')],'raw':!![]};var _0x5313ae=![];return require(_0x1909('0x75'))[_0x1909('0x76')]()[_0x1909('0x1c')](function(_0x3a3c0e){if(_0x3a3c0e){_0x5313ae=_0x3a3c0e[_0x1909('0x77')];}})[_0x1909('0x1c')](function(){return db[_0x1909('0x3b')]['find'](_0x54bb48);})['then'](handleEntityNotFound(_0x3003d1,null))[_0x1909('0x1c')](function(_0x113c31){if(_0x113c31){if(!_['isNil'](_0x113c31[_0x1909('0x6e')])){if(fs[_0x1909('0x78')](path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0x7b'),_0x113c31[_0x1909('0x6e')]))&&_0x5313ae){_0x13e8d3=path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0x7b'),_0x113c31[_0x1909('0x6e')]);}}return _0x3003d1['download'](_0x13e8d3);}})[_0x1909('0x26')](handleError(_0x3003d1,null));};exports[_0x1909('0x7c')]=function(_0x3a2b3e,_0x250d81,_0x1f3e86){var _0x12d6cb=path['join'](config[_0x1909('0x7a')],_0x1909('0x7d'));var _0x1f2839={'where':{'id':_0x3a2b3e[_0x1909('0x55')]['id']},'attributes':['id',_0x1909('0x71')],'raw':!![]};return db[_0x1909('0x3b')]['find'](_0x1f2839)['then'](handleEntityNotFound(_0x250d81,null))['then'](function(_0x1acbcb){if(_0x1acbcb){if(!_[_0x1909('0x7e')](_0x1acbcb['agentAvatar'])){if(fs[_0x1909('0x78')](path['join'](config['root'],'server/files/images/avatars/',_0x1acbcb[_0x1909('0x71')]))){_0x12d6cb=path[_0x1909('0x79')](config[_0x1909('0x7a')],'server/files/images/avatars/',_0x1acbcb['agentAvatar']);}}return _0x250d81[_0x1909('0x7f')](_0x12d6cb);}})[_0x1909('0x26')](handleError(_0x250d81,null));};exports[_0x1909('0x80')]=function(_0x48f033,_0xd9b2a5,_0xc9e946){var _0x243376=path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0x81'));var _0x547e3d={'where':{'id':_0x48f033[_0x1909('0x55')]['id']},'attributes':['id',_0x1909('0x72'),'showCustomerAvatar'],'raw':!![]};return db[_0x1909('0x3b')]['find'](_0x547e3d)['then'](handleEntityNotFound(_0xd9b2a5,null))[_0x1909('0x1c')](function(_0x6155e3){if(_0x6155e3){if(!_[_0x1909('0x7e')](_0x6155e3['customerAvatar'])){if(fs['existsSync'](path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0x82'),_0x6155e3['customerAvatar']))&&_0x6155e3[_0x1909('0x83')]){_0x243376=path['join'](config[_0x1909('0x7a')],'server/files/images/avatars/',_0x6155e3[_0x1909('0x72')]);}}return _0xd9b2a5[_0x1909('0x7f')](_0x243376);}})[_0x1909('0x26')](handleError(_0xd9b2a5,null));};exports[_0x1909('0x84')]=function(_0x44f16b,_0x4b844b,_0x3f669a){var _0x40f32a=path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0x85'));var _0x4afa06={'where':{'id':_0x44f16b[_0x1909('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1909('0x3b')]['find'](_0x4afa06)[_0x1909('0x1c')](handleEntityNotFound(_0x4b844b,null))['then'](function(_0x312260){if(_0x312260){if(!_[_0x1909('0x7e')](_0x312260[_0x1909('0x73')])){if(fs[_0x1909('0x78')](path[_0x1909('0x79')](config[_0x1909('0x7a')],'server/files/images/avatars/',_0x312260[_0x1909('0x73')]))){_0x40f32a=path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0x82'),_0x312260[_0x1909('0x73')]);}}return _0x4b844b[_0x1909('0x7f')](_0x40f32a);}})[_0x1909('0x26')](handleError(_0x4b844b,null));};exports['notify']=function(_0x16fbfb,_0x3b8fc5,_0xf84a34){var _0x4412e8=require('user-agent-parser');var _0x3bb073=new _0x4412e8();var _0x1240e5=_0x3bb073[_0x1909('0x86')](_0x16fbfb[_0x1909('0x87')][_0x1909('0x88')])[_0x1909('0x89')]();var _0x48d0f5={'body':_0x16fbfb[_0x1909('0x5a')],'channel':_0x1909('0x8a')};var _0x5309a4=[];var _0x4b32b0=[];var _0x334cec={};var _0x1a35f0=![];return db['CmContact']['describe']()[_0x1909('0x1c')](function(_0x3f910f){if(!_0x3f910f){throw new db[(_0x1909('0x19'))][(_0x1909('0x1a'))](_0x1909('0x8b'));}_0x5309a4=_['difference'](_[_0x1909('0x56')](_0x3f910f),['createdAt',_0x1909('0x8c')]);_0x4b32b0=_[_0x1909('0x8d')](_[_0x1909('0x56')](_0x3f910f),[_0x1909('0x8e'),_0x1909('0x8c'),_0x1909('0x8f'),_0x1909('0x90')]);if(_0x16fbfb['body']['id']){delete _0x16fbfb['body']['id'];}if(_[_0x1909('0x7e')](_0x16fbfb[_0x1909('0x5a')][_0x1909('0x91')])){throw new db['Sequelize'][(_0x1909('0x1a'))](_0x1909('0x92'));}if(_[_0x1909('0x7e')](_0x16fbfb[_0x1909('0x5a')]['body'])||_0x16fbfb[_0x1909('0x5a')][_0x1909('0x5a')]===''){throw new db['Sequelize'][(_0x1909('0x1a'))](_0x1909('0x93'));}if(_[_0x1909('0x7e')](_0x16fbfb[_0x1909('0x5a')][_0x1909('0x94')])){throw new db[(_0x1909('0x19'))]['ValidationError'](_0x1909('0x95')+_0x4b32b0);}if(!_[_0x1909('0x96')](_0x4b32b0,_0x16fbfb[_0x1909('0x5a')][_0x1909('0x94')])){throw new db['Sequelize']['ValidationError'](_0x1909('0x97')+_0x4b32b0);}_0x334cec[_0x16fbfb[_0x1909('0x5a')][_0x1909('0x94')]]=_0x16fbfb[_0x1909('0x5a')][_0x1909('0x91')];})[_0x1909('0x1c')](function(){return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x16fbfb['params']['id']},'include':[{'model':db[_0x1909('0x98')],'as':_0x1909('0x99'),'include':[{'model':db[_0x1909('0x9a')],'as':_0x1909('0x9b'),'where':_0x334cec,'limit':0x1,'order':[[_0x1909('0x8c'),_0x1909('0x9c')]]}]},{'model':db[_0x1909('0x9d')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x3b8fc5,null))[_0x1909('0x1c')](function(_0x32d44a){if(_0x32d44a&&_0x32d44a[_0x1909('0x99')]){_0x48d0f5[_0x1909('0x9e')]=_0x32d44a;_0x48d0f5[_0x1909('0x9f')]=_0x32d44a['Applications'];_0x48d0f5[_0x1909('0xa0')]=_0x32d44a[_0x1909('0x99')];_0x48d0f5[_0x1909('0x9f')]=_['orderBy'](_0x48d0f5[_0x1909('0x9f')],[_0x1909('0xa1')],[_0x1909('0xa2')]);if(_0x48d0f5['account'][_0x1909('0xa3')]){delete _0x48d0f5[_0x1909('0x9e')]['Applications'];}if(_0x48d0f5[_0x1909('0x9e')]['List']&&_0x48d0f5[_0x1909('0x9e')][_0x1909('0x99')][_0x1909('0x9b')][_0x1909('0x46')]){return _0x48d0f5[_0x1909('0x9e')]['List']['Contacts'][0x0];}var _0x51426b=_[_0x1909('0x13')](_0x16fbfb['body'],{'firstName':_0x16fbfb[_0x1909('0x5a')][_0x1909('0x91')],'ListId':_0x32d44a['ListId']});_0x51426b[_0x16fbfb['body']['mapKey']]=_0x16fbfb[_0x1909('0x5a')][_0x1909('0x91')];return db[_0x1909('0x9a')]['create'](_0x51426b,{'fields':_0x5309a4,'raw':!![]});}})['then'](handleEntityNotFound(_0x3b8fc5,null))[_0x1909('0x1c')](function(_0x4e9991){_0x48d0f5['contact']=_0x4e9991;var _0x29fe2e=_0x16fbfb['body']['customerIp'];if(_0x16fbfb[_0x1909('0x87')][_0x1909('0xa4')]){_0x29fe2e=_0x16fbfb[_0x1909('0x87')]['cf-connecting-ip'];}else if(_0x16fbfb[_0x1909('0x87')][_0x1909('0xa5')]){_0x29fe2e=_['first'](_0x16fbfb[_0x1909('0x87')][_0x1909('0xa5')][_0x1909('0xa6')](','));}if(_0x4e9991){var _0x5d6c38={'ContactId':_0x4e9991['id'],'ChatWebsiteId':_0x16fbfb['params']['id'],'from':(_0x4e9991['firstName']||'')+'\x20'+(_0x4e9991[_0x1909('0xa7')]||''),'customerIp':_0x29fe2e,'customerPort':_0x16fbfb[_0x1909('0x87')][_0x1909('0xa8')]?_0x16fbfb[_0x1909('0x87')][_0x1909('0xa8')]:null,'referer':_0x16fbfb[_0x1909('0x5a')][_0x1909('0xa9')],'browserName':_0x1240e5[_0x1909('0xaa')][_0x1909('0x42')]&&_0x1240e5['browser'][_0x1909('0xab')]?util[_0x1909('0xac')](_0x1909('0xad'),_0x1240e5['browser']['name'],_0x1240e5['browser'][_0x1909('0xab')]):_0x1909('0xae'),'browserVersion':_0x1240e5[_0x1909('0xaa')]['version']||'unknown','osName':util[_0x1909('0xac')](_0x1909('0xad'),_0x1240e5['os']['name'],_0x1240e5['os'][_0x1909('0xab')]),'osVersion':_0x1240e5['os'][_0x1909('0xab')],'deviceModel':_0x1240e5[_0x1909('0xaf')][_0x1909('0x40')]&&_0x1240e5[_0x1909('0xaf')]['vendor']?util[_0x1909('0xac')](_0x1909('0xb0'),_0x1240e5[_0x1909('0xaf')]['model'],_0x1240e5[_0x1909('0xaf')][_0x1909('0xb1')],_0x1240e5[_0x1909('0xaf')]['type']):null,'deviceVendor':_0x1240e5[_0x1909('0xaf')][_0x1909('0xb1')],'deviceType':_0x1240e5[_0x1909('0xaf')][_0x1909('0x3e')],'formData':JSON['stringify'](_0x16fbfb[_0x1909('0x5a')])};var _0xab4154={'ChatWebsiteId':_0x16fbfb[_0x1909('0x55')]['id'],'closed':![]};if(_0x16fbfb['body'][_0x1909('0xb2')]){_0xab4154[_0x1909('0xb2')]=_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb2')];return db[_0x1909('0xb3')][_0x1909('0x58')]({'where':_0xab4154})[_0x1909('0x1c')](function(_0x3f476a){if(_0x3f476a){return[_0x3f476a,![]];}_0x5d6c38[_0x1909('0xb2')]=_0x16fbfb['body'][_0x1909('0xb2')];_0x5d6c38['externalUrl']=_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb4')];return db[_0x1909('0xb3')][_0x1909('0x59')](_0x5d6c38)[_0x1909('0x1c')](function(_0x363644){return[_0x363644,!![]];});});}_0xab4154['ContactId']=_0x4e9991['id'];if(_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb5')]&&_0x16fbfb['body'][_0x1909('0xb5')]['id']){_0xab4154['id']=_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb5')]['id'];return db['ChatInteraction'][_0x1909('0x58')]({'where':_0xab4154})[_0x1909('0x1c')](function(_0x7e5a59){if(_0x7e5a59){return[_0x7e5a59,![]];}return db[_0x1909('0xb3')]['create'](_0x5d6c38)['then'](function(_0x422bd5){return[_0x422bd5,!![]];});});}return db['ChatInteraction'][_0x1909('0x59')](_0x5d6c38)['then'](function(_0x218848){return[_0x218848,!![]];});}})['spread'](function(_0x26259f,_0x53e968){if(_0x26259f){_0x1a35f0=_0x53e968;if(!_0x53e968){var _0x540365={'from':(_0x48d0f5[_0x1909('0xb6')][_0x1909('0xb7')]||'')+'\x20'+(_0x48d0f5[_0x1909('0xb6')][_0x1909('0xa7')]||'')};if(_0x16fbfb['body'][_0x1909('0xb2')]&&_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb8')]&&_0x16fbfb[_0x1909('0x5a')]['threadId']!=_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb8')]){_0x540365[_0x1909('0xb2')]=_0x16fbfb[_0x1909('0x5a')][_0x1909('0xb8')];}return _0x26259f[_0x1909('0x61')](_0x540365);}else{return _0x26259f;}}})['then'](function(_0x4f3ab3){_0x48d0f5[_0x1909('0xb5')]=_0x4f3ab3[_0x1909('0x32')]({'plain':!![]});_0x48d0f5[_0x1909('0xb5')][_0x1909('0xb9')]=_0x1a35f0;if(_0x48d0f5['interaction'][_0x1909('0xb9')]){if(_0x48d0f5['account'][_0x1909('0xba')]){_0x48d0f5['applications'][_0x1909('0xbb')]({'id':0x0,'priority':_0x48d0f5['applications']['length']+0x1,'app':_0x1909('0xbc'),'appdata':_0x1909('0xbd'),'interval':_0x1909('0xbe')});}}return db['ChatMessage']['create']({'body':_0x16fbfb['body']['body'],'ChatWebsiteId':_0x16fbfb[_0x1909('0x55')]['id'],'ChatInteractionId':_0x4f3ab3['id'],'direction':'in','ContactId':_0x48d0f5[_0x1909('0xb6')]['id'],'AttachmentId':_0x16fbfb[_0x1909('0x5a')][_0x1909('0xbf')]});})[_0x1909('0x1c')](function(_0x45dba2){_0x48d0f5[_0x1909('0x24')]=_0x45dba2;if(_0x48d0f5[_0x1909('0xb5')][_0x1909('0xc0')]){return db[_0x1909('0xc1')][_0x1909('0x58')]({'attributes':['id',_0x1909('0x42')],'where':{'id':_0x48d0f5[_0x1909('0xb5')]['UserId']}})['then'](function(_0x4410aa){if(_0x4410aa){_0x48d0f5[_0x1909('0x9f')][_0x1909('0xc2')]({'id':0x0,'priority':0x0,'app':_0x1909('0xc3'),'appdata':_0x4410aa[_0x1909('0x42')]+','+(_0x48d0f5[_0x1909('0x9e')][_0x1909('0xc4')]||0xa),'interval':_0x1909('0xbe')});_0x48d0f5['forcedOwnership']=!![];}return respondWithRpcPromise(_0x1909('0xc5'),_0x1909('0xc6'),_0x48d0f5);});}return respondWithRpcPromise('Start',_0x1909('0xc6'),_0x48d0f5);})['then'](function(_0x116f8c){respondWithRpcPromise(_0x1909('0xc7'),'EventManager',{'event':_0x1909('0xc8'),'message':_0x116f8c},client9002);return _0x116f8c;})['then'](respondWithResult(_0x3b8fc5,null))[_0x1909('0x26')](handleError(_0x3b8fc5,null));};exports[_0x1909('0xc9')]=function(_0x3798ce,_0x515edd,_0x3c201a){var _0x79d0b8,_0x525185,_0x351186;var _0x5c6859=[];var _0x593fc9=[];var _0x968024={};return db['CmContact'][_0x1909('0x62')]()[_0x1909('0x1c')](function(_0xff06ac){if(!_0xff06ac){throw new db[(_0x1909('0x19'))][(_0x1909('0x1a'))](_0x1909('0x8b'));}_0x593fc9=_[_0x1909('0x8d')](_['keys'](_0xff06ac),[_0x1909('0x8e'),'updatedAt']);_0x5c6859=_[_0x1909('0x8d')](_[_0x1909('0x56')](_0xff06ac),['createdAt',_0x1909('0x8c'),'CompanyId',_0x1909('0x90')]);if(_0x3798ce[_0x1909('0x5a')]['id']){delete _0x3798ce[_0x1909('0x5a')]['id'];}if(_[_0x1909('0x7e')](_0x3798ce['body'][_0x1909('0x91')])){throw _0x515edd[_0x1909('0x28')](0x1f4)['send'](new db[(_0x1909('0x19'))]['ValidationError'](_0x1909('0x92')));}if(_['isNil'](_0x3798ce[_0x1909('0x5a')][_0x1909('0x5a')])||_0x3798ce['body'][_0x1909('0x5a')]===''){throw _0x515edd[_0x1909('0x28')](0x1f4)[_0x1909('0x37')](new db['Sequelize'][(_0x1909('0x1a'))](_0x1909('0x93')));}if(_['isNil'](_0x3798ce[_0x1909('0x5a')][_0x1909('0xca')])){throw _0x515edd[_0x1909('0x28')](0x1f4)['send'](new db['Sequelize'][(_0x1909('0x1a'))](_0x1909('0xcb')+_0x5c6859));}if(!_[_0x1909('0x96')](_0x5c6859,_0x3798ce[_0x1909('0x5a')]['mapKeyOffline'])){throw _0x515edd['status'](0x1f4)[_0x1909('0x37')](new db[(_0x1909('0x19'))]['ValidationError'](_0x1909('0xcc')+_0x5c6859));}_0x968024[_0x3798ce[_0x1909('0x5a')][_0x1909('0xca')]]=_0x3798ce['body'][_0x1909('0x91')];})['then'](function(){return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x3798ce[_0x1909('0x55')]['id']},'include':[{'model':db[_0x1909('0x98')],'as':_0x1909('0x99')}]});})[_0x1909('0x1c')](handleEntityNotFound(_0x515edd,null))[_0x1909('0x1c')](function(_0x4b870a){if(_0x4b870a&&_0x4b870a[_0x1909('0x99')]){_0x525185=_0x4b870a;var _0x2723c7=_[_0x1909('0x13')](_0x3798ce['body'],{'firstName':_0x3798ce[_0x1909('0x5a')][_0x1909('0x91')],'phone':_0x3798ce[_0x1909('0x5a')][_0x1909('0x91')],'ListId':_0x4b870a[_0x1909('0x90')]});_0x2723c7[_0x3798ce['body'][_0x1909('0xca')]]=_0x3798ce['body']['from'];return db['CmContact'][_0x1909('0xcd')]({'where':_0x968024,'defaults':_0x2723c7});}})[_0x1909('0xce')](function(_0x551ce3){if(_0x551ce3){_0x351186=_0x551ce3;var _0x26fcfc=fs[_0x1909('0xcf')](path[_0x1909('0x79')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x1909('0xd0'));var _0x3d60c7=ejs[_0x1909('0xd1')](_0x26fcfc,{'body':_[_0x1909('0xd2')](_0x3798ce[_0x1909('0x5a')][_0x1909('0x5a')]),'bodyTitle':_0x525185[_0x1909('0xd3')]});return db[_0x1909('0xd4')][_0x1909('0x59')]({'body':_0x3d60c7,'ContactId':_0x551ce3['id'],'ChatWebsiteId':_0x525185['id']});}})[_0x1909('0x1c')](function(_0x2503ff){if(_0x2503ff){_0x79d0b8=_0x2503ff;return db[_0x1909('0xd5')][_0x1909('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0x1909('0xd6')],'as':'Smtp','raw':!![]}]});}})[_0x1909('0x1c')](function(_0x19eacd){if(_0x19eacd&&_0x19eacd[_0x1909('0xd7')]&&_0x525185[_0x1909('0xd8')]){var _0x17c94e={'tls':{'rejectUnauthorized':![]}};if(_0x19eacd[_0x1909('0xd7')][_0x1909('0xd9')]){_0x17c94e[_0x1909('0xd9')]=_0x19eacd[_0x1909('0xd7')][_0x1909('0xd9')];}else{_0x17c94e[_0x1909('0xda')]=_0x19eacd[_0x1909('0xd7')]['host'];_0x17c94e[_0x1909('0xdb')]=_0x19eacd['Smtp']['port'];_0x17c94e['secure']=_0x19eacd[_0x1909('0xd7')][_0x1909('0xdc')];}if(_0x19eacd[_0x1909('0xd7')]['authentication']){_0x17c94e['auth']={'user':_0x19eacd[_0x1909('0xd7')][_0x1909('0x5b')],'pass':_0x19eacd['Smtp']['pass']};}return respondWithRpcPromise(_0x1909('0xdd'),'sendMail',{'account':_0x17c94e,'message':{'from':util[_0x1909('0xac')](_0x1909('0xde'),_0x19eacd['name'],_0x19eacd[_0x1909('0xdf')]||_0x19eacd[_0x1909('0xd7')][_0x1909('0x5b')]),'to':_0x525185[_0x1909('0xd8')],'subject':_0x525185[_0x1909('0xe0')],'text':_0x79d0b8[_0x1909('0x5a')]}},client9003)[_0x1909('0x1c')](function(){return _0x79d0b8;})[_0x1909('0x26')](function(_0x2cdd96){console['error'](_0x2cdd96);});}})['then'](function(){if(_0x79d0b8){return _0x79d0b8;}})[_0x1909('0x1c')](respondWithResult(_0x515edd,null))['catch'](handleError(_0x515edd,null));};exports[_0x1909('0xe1')]=function(_0x267f3b,_0x3ad9a1,_0x126c0d){return db[_0x1909('0xb3')][_0x1909('0x58')]({'where':{'id':_0x267f3b[_0x1909('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ad9a1,null))[_0x1909('0x1c')](function(_0x580781){if(_0x580781){return _0x580781[_0x1909('0xe1')](_0x267f3b[_0x1909('0x5a')][_0x1909('0xe2')],_[_0x1909('0xe3')](_0x267f3b[_0x1909('0x5a')],[_0x1909('0xe2'),'id'])||{});}})[_0x1909('0x1c')](respondWithResult(_0x3ad9a1,null))[_0x1909('0x26')](handleError(_0x3ad9a1,null));};exports['getInteractions']=function(_0x16b21e,_0x363fec,_0x47ca4b){var _0x758ddb={'raw':![],'where':{}};var _0x3b9b10={};var _0x6d4cb={'count':0x0,'rows':[]};return db[_0x1909('0x3b')][_0x1909('0x66')]({'where':{'id':_0x16b21e[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x363fec,null))[_0x1909('0x1c')](function(_0x17129a){if(_0x17129a){_0x3b9b10[_0x1909('0x40')]=_[_0x1909('0x56')](db[_0x1909('0xb3')][_0x1909('0x3c')]);_0x3b9b10[_0x1909('0x43')]=_[_0x1909('0x56')](_0x16b21e[_0x1909('0x43')]);_0x3b9b10[_0x1909('0x4c')]=_[_0x1909('0x44')](_0x3b9b10['model'],_0x3b9b10[_0x1909('0x43')]);_0x758ddb[_0x1909('0x45')]=_[_0x1909('0x44')](_0x3b9b10[_0x1909('0x40')],qs[_0x1909('0x57')](_0x16b21e[_0x1909('0x43')][_0x1909('0x57')]));_0x758ddb[_0x1909('0x45')]=_0x758ddb['attributes'][_0x1909('0x46')]?_0x758ddb[_0x1909('0x45')]:_0x3b9b10[_0x1909('0x40')];if(!_0x16b21e['query'][_0x1909('0x47')](_0x1909('0x48'))){_0x758ddb[_0x1909('0x2b')]=qs[_0x1909('0x2b')](_0x16b21e[_0x1909('0x43')][_0x1909('0x2b')]);_0x758ddb[_0x1909('0x2a')]=qs[_0x1909('0x2a')](_0x16b21e['query'][_0x1909('0x2a')]);}_0x758ddb[_0x1909('0x49')]=qs[_0x1909('0x4a')](_0x16b21e[_0x1909('0x43')][_0x1909('0x4a')]);_0x758ddb['where']=qs['filters'](_[_0x1909('0x6b')](_0x16b21e['query'],_0x3b9b10[_0x1909('0x4c')]));_0x758ddb[_0x1909('0x4b')][_0x1909('0x63')]=_0x17129a['id'];if(_0x16b21e[_0x1909('0x43')][_0x1909('0x4d')]){_0x758ddb[_0x1909('0x4b')]=_[_0x1909('0x4e')](_0x758ddb[_0x1909('0x4b')],{'$or':_[_0x1909('0x41')](_0x758ddb[_0x1909('0x45')],function(_0x12dfb1){var _0x101c26={};_0x101c26[_0x12dfb1]={'$like':'%'+_0x16b21e['query'][_0x1909('0x4d')]+'%'};return _0x101c26;})});}_0x758ddb=_[_0x1909('0x4e')]({},_0x758ddb,_0x16b21e[_0x1909('0xe4')]);return db[_0x1909('0xb3')][_0x1909('0x4f')]({'where':_0x758ddb[_0x1909('0x4b')]})['then'](function(_0x453aab){_0x6d4cb[_0x1909('0x4f')]=_0x453aab;if(_0x16b21e['query']['includeAll']){_0x758ddb[_0x1909('0x51')]=[{'model':db[_0x1909('0x9a')],'as':'Contact','required':![]},{'model':db[_0x1909('0xc1')],'as':_0x1909('0xe5'),'attributes':[_0x1909('0x42'),'fullname','internal'],'required':![]},{'model':db[_0x1909('0xe6')],'as':_0x1909('0xe7'),'attributes':['id',_0x1909('0x42'),_0x1909('0xe8')],'where':_0x16b21e['query']['tag']?{'id':_0x16b21e['query'][_0x1909('0xe9')]}:undefined,'required':_0x16b21e['query'][_0x1909('0xe9')]?!![]:![]}];}return db[_0x1909('0xb3')][_0x1909('0x52')](_0x758ddb);})[_0x1909('0x1c')](function(_0x31c2f5){_0x6d4cb[_0x1909('0x53')]=_0x31c2f5;return _0x6d4cb;});}})[_0x1909('0x1c')](respondWithFilteredResult(_0x363fec,_0x758ddb))[_0x1909('0x26')](handleError(_0x363fec,null));};function iftimePromise(_0x57b854,_0x5c6523){return respondWithRpcPromise(_0x1909('0xea'),_0x1909('0xeb'),{'command':_0x5c6523[_0x1909('0xec')]?util[_0x1909('0xac')](_0x1909('0xed'),_0x57b854[_0x1909('0xee')],_0x5c6523['timezone']):util[_0x1909('0xac')]('iftime\x20%s',_0x57b854[_0x1909('0xee')])},client9002)['then'](function(_0x2a93fc){var _0x4df497=_0x2a93fc&&_0x2a93fc[_0x1909('0xef')](_0x1909('0xf0'))>=0x0?!![]:![];logger['info'](_0x1909('0xf1'),_0x5c6523['id'],_0x57b854['id'],_0x57b854[_0x1909('0xee')],_0x4df497?_0x1909('0xf2'):'OFFLINE',_0x5c6523[_0x1909('0xec')]?_0x5c6523[_0x1909('0xec')]:_0x1909('0xf3'));return _0x4df497;})[_0x1909('0x26')](function(_0x5770ca){logger[_0x1909('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5c6523['id'],_0x57b854['id'],_0x57b854[_0x1909('0xee')],util[_0x1909('0xf4')](_0x5770ca,{'showHidden':![],'depth':null}),_0x5c6523['timezone']?_0x5c6523[_0x1909('0xec')]:_0x1909('0xf3'));return![];});}exports[_0x1909('0xeb')]=function(_0x43a1aa,_0x45b5dd,_0x212b80){var _0x1be86b=0x0;var _0x409908=0x0;var _0x5d0f5a=![];var _0x26a692;var _0x21a38b;return db[_0x1909('0x3b')]['find']({'where':{'id':_0x43a1aa[_0x1909('0x55')]['id']},'include':[{'model':db[_0x1909('0xf5')],'as':_0x1909('0xf5'),'include':[{'model':db[_0x1909('0xf5')],'as':_0x1909('0xf6'),'attributes':['id',_0x1909('0xee')],'raw':!![]}]}]})[_0x1909('0x1c')](handleEntityNotFound(_0x45b5dd,null))[_0x1909('0x1c')](function(_0xb7f8d2){if(_0xb7f8d2){_0x26a692=_0xb7f8d2;return _0xb7f8d2['getProactiveActions']({'raw':!![]});}})[_0x1909('0x1c')](function(_0x4a0ea4){if(_0x26a692){if(_0x4a0ea4){_0x21a38b=_0x4a0ea4;}}return require(_0x1909('0x75'))[_0x1909('0x76')]();})['then'](function(_0x1d5b0b){if(_0x1d5b0b){_0x409908=_0x1d5b0b[_0x1909('0xf7')];_0x5d0f5a=_0x1d5b0b['custom'];}})['then'](function(){return db[_0x1909('0xb3')][_0x1909('0x4f')]({'where':{'closed':![]}});})['then'](function(_0x41be6d){_0x1be86b=_0x41be6d;if(_0x409908&&_0x41be6d>_0x409908){return db[_0x1909('0xf8')][_0x1909('0x66')]({'where':{'id':0x1}})[_0x1909('0x1c')](function(_0x1b0c42){if(_0x1b0c42){_0x1b0c42[_0x1909('0xf9')](_0x1909('0xfa'));}});}})[_0x1909('0x1c')](function(){if(_0x26a692['Interval']&&_0x26a692[_0x1909('0xf5')][_0x1909('0xf6')]){var _0x327466=[];for(var _0x45bbcf=0x0;_0x45bbcf<_0x26a692[_0x1909('0xf5')][_0x1909('0xf6')][_0x1909('0x46')];_0x45bbcf++){var _0x277c42=_0x26a692[_0x1909('0xf5')]['Intervals'][_0x45bbcf][_0x1909('0x32')]({'plain':!![]});_0x327466[_0x1909('0xbb')](iftimePromise(_0x277c42,_0x26a692));}return BPromise[_0x1909('0xfb')](_0x327466)[_0x1909('0x1c')](function(_0x399cbe){return _[_0x1909('0xfc')](_0x399cbe);});}else{return!![];}})[_0x1909('0x1c')](function(_0x236ea2){var _0x417fd5=fs['readFileSync'](path[_0x1909('0x79')](config[_0x1909('0x7a')],_0x1909('0xfd')),_0x1909('0xd0'));var _0x22cf75={'remote':_0x26a692[_0x1909('0xfe')],'query':querystring['stringify'](_['merge'](_0x26a692[_0x1909('0x32')]({'plain':!![]}),{'customerIp':_0x43a1aa['headers'][_0x1909('0xa5')]||_0x43a1aa[_0x1909('0x87')][_0x1909('0xff')]||_0x43a1aa[_0x1909('0x100')][_0x1909('0x101')]||_0x43a1aa['ip'],'referer':_0x43a1aa[_0x1909('0x87')][_0x1909('0xa9')],'openedInteractions':_0x1be86b,'maxInteractions':_0x409908,'virtual':_0x5d0f5a[_0x1909('0xf7')],'online':_0x236ea2,'custom':_0x5d0f5a}))[_0x1909('0x102')](/'/g,'\x5c\x27')};_0x45b5dd[_0x1909('0x37')](ejs[_0x1909('0xd1')](Mustache[_0x1909('0xd1')](_0x417fd5,_0x22cf75),{'proactiveActions':_0x21a38b,'alignment':_0x26a692['alignment'],'verticalAlignment':_0x26a692['verticalAlignment']}));})[_0x1909('0x26')](handleError(_0x45b5dd,null));};exports[_0x1909('0x103')]=function(_0x521dbb,_0x4dabd2,_0x3ef911){return db[_0x1909('0x3b')][_0x1909('0x66')]({'where':{'id':_0x521dbb[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x4dabd2,null))['then'](function(_0x1063aa){if(_0x1063aa){return db[_0x1909('0x104')][_0x1909('0x105')](function(_0x53a0e0){return db[_0x1909('0x9d')][_0x1909('0x35')]({'where':{'ChatWebsiteId':_0x521dbb[_0x1909('0x55')]['id']},'transaction':_0x53a0e0})['then'](function(_0x1e577f){var _0x1e9e7b=_['map'](_0x521dbb[_0x1909('0x5a')],function(_0x18b472){_0x18b472['ChatWebsiteId']=_0x521dbb[_0x1909('0x55')]['id'];return _0x18b472;});return db[_0x1909('0x9d')][_0x1909('0x106')](_0x1e9e7b,{'transaction':_0x53a0e0});});})[_0x1909('0x1c')](function(){return db['ChatApplication'][_0x1909('0x107')]({'where':{'ChatWebsiteId':_0x521dbb['params']['id']},'order':_0x1909('0xa1')});});}})[_0x1909('0x1c')](respondWithResult(_0x4dabd2,null))['catch'](handleError(_0x4dabd2,null));};exports[_0x1909('0x108')]=function(_0x129c7d,_0x3967ab,_0x88814d){var _0x37bb2e={};var _0x30d2c1={};var _0x589c1c;var _0x142d36;return db['ChatWebsite'][_0x1909('0x66')]({'where':{'id':_0x129c7d['params']['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x3967ab,null))[_0x1909('0x1c')](function(_0x1c9a70){if(_0x1c9a70){_0x589c1c=_0x1c9a70;_0x30d2c1[_0x1909('0x40')]=_[_0x1909('0x56')](db['ChatApplication'][_0x1909('0x3c')]);_0x30d2c1[_0x1909('0x43')]=_[_0x1909('0x56')](_0x129c7d[_0x1909('0x43')]);_0x30d2c1[_0x1909('0x4c')]=_[_0x1909('0x44')](_0x30d2c1[_0x1909('0x40')],_0x30d2c1[_0x1909('0x43')]);_0x37bb2e[_0x1909('0x45')]=_[_0x1909('0x44')](_0x30d2c1['model'],qs[_0x1909('0x57')](_0x129c7d[_0x1909('0x43')][_0x1909('0x57')]));_0x37bb2e[_0x1909('0x45')]=_0x37bb2e[_0x1909('0x45')][_0x1909('0x46')]?_0x37bb2e[_0x1909('0x45')]:_0x30d2c1[_0x1909('0x40')];_0x37bb2e['order']=qs[_0x1909('0x4a')](_0x129c7d[_0x1909('0x43')][_0x1909('0x4a')]);_0x37bb2e[_0x1909('0x4b')]=qs[_0x1909('0x4c')](_[_0x1909('0x6b')](_0x129c7d['query'],_0x30d2c1[_0x1909('0x4c')]));if(_0x129c7d[_0x1909('0x43')]['filter']){_0x37bb2e[_0x1909('0x4b')]=_[_0x1909('0x4e')](_0x37bb2e[_0x1909('0x4b')],{'$or':_[_0x1909('0x41')](_0x37bb2e[_0x1909('0x45')],function(_0x6de1b1){var _0x1732a0={};_0x1732a0[_0x6de1b1]={'$like':'%'+_0x129c7d[_0x1909('0x43')][_0x1909('0x4d')]+'%'};return _0x1732a0;})});}_0x37bb2e=_[_0x1909('0x4e')]({},_0x37bb2e,_0x129c7d[_0x1909('0xe4')]);return _0x589c1c['getApplications'](_0x37bb2e);}})[_0x1909('0x1c')](function(_0x2be59b){if(_0x2be59b){_0x142d36=_0x2be59b[_0x1909('0x46')];if(!_0x129c7d[_0x1909('0x43')][_0x1909('0x47')]('nolimit')){_0x37bb2e[_0x1909('0x2b')]=qs[_0x1909('0x2b')](_0x129c7d['query'][_0x1909('0x2b')]);_0x37bb2e['offset']=qs['offset'](_0x129c7d[_0x1909('0x43')][_0x1909('0x2a')]);}return _0x589c1c[_0x1909('0x108')](_0x37bb2e);}})[_0x1909('0x1c')](function(_0x28e656){if(_0x28e656){return _0x28e656?{'count':_0x142d36,'rows':_0x28e656}:null;}})['then'](respondWithResult(_0x3967ab,null))[_0x1909('0x26')](handleError(_0x3967ab,null));};exports[_0x1909('0x109')]=function(_0x3f9542,_0x2df2d8,_0x443fd7){return db[_0x1909('0x10a')][_0x1909('0x58')]({'where':{'id':_0x3f9542[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x2df2d8,null))[_0x1909('0x1c')](function(_0x44887d){if(_0x44887d){return _0x44887d[_0x1909('0x109')](_0x3f9542[_0x1909('0x5a')]['ids'],_['omit'](_0x3f9542['body'],['ids','id'])||{});}})[_0x1909('0x1c')](respondWithResult(_0x2df2d8,null))[_0x1909('0x26')](handleError(_0x2df2d8,null));};exports[_0x1909('0x10b')]=function(_0x152745,_0x1f235f,_0x2bc93a){var _0x2d2874={};var _0x25e723={};var _0x37e5a9;var _0x5850a8;return db[_0x1909('0x3b')]['findOne']({'where':{'id':_0x152745['params']['id']}})['then'](handleEntityNotFound(_0x1f235f,null))['then'](function(_0x828b03){if(_0x828b03){_0x37e5a9=_0x828b03;_0x25e723[_0x1909('0x40')]=_['keys'](db['ChatProactiveAction'][_0x1909('0x3c')]);_0x25e723[_0x1909('0x43')]=_['keys'](_0x152745[_0x1909('0x43')]);_0x25e723[_0x1909('0x4c')]=_[_0x1909('0x44')](_0x25e723[_0x1909('0x40')],_0x25e723[_0x1909('0x43')]);_0x2d2874[_0x1909('0x45')]=_[_0x1909('0x44')](_0x25e723[_0x1909('0x40')],qs['fields'](_0x152745[_0x1909('0x43')]['fields']));_0x2d2874[_0x1909('0x45')]=_0x2d2874[_0x1909('0x45')][_0x1909('0x46')]?_0x2d2874[_0x1909('0x45')]:_0x25e723[_0x1909('0x40')];_0x2d2874['order']=qs['sort'](_0x152745[_0x1909('0x43')][_0x1909('0x4a')]);_0x2d2874[_0x1909('0x4b')]=qs['filters'](_[_0x1909('0x6b')](_0x152745[_0x1909('0x43')],_0x25e723[_0x1909('0x4c')]));if(_0x152745['query'][_0x1909('0x4d')]){_0x2d2874[_0x1909('0x4b')]=_['merge'](_0x2d2874[_0x1909('0x4b')],{'$or':_[_0x1909('0x41')](_0x2d2874[_0x1909('0x45')],function(_0x5bc634){var _0x26855e={};_0x26855e[_0x5bc634]={'$like':'%'+_0x152745[_0x1909('0x43')][_0x1909('0x4d')]+'%'};return _0x26855e;})});}_0x2d2874=_[_0x1909('0x4e')]({},_0x2d2874,_0x152745['options']);return _0x37e5a9[_0x1909('0x10b')](_0x2d2874);}})[_0x1909('0x1c')](function(_0x141520){if(_0x141520){_0x5850a8=_0x141520['length'];if(!_0x152745[_0x1909('0x43')][_0x1909('0x47')](_0x1909('0x48'))){_0x2d2874[_0x1909('0x2b')]=qs['limit'](_0x152745[_0x1909('0x43')][_0x1909('0x2b')]);_0x2d2874[_0x1909('0x2a')]=qs[_0x1909('0x2a')](_0x152745[_0x1909('0x43')][_0x1909('0x2a')]);}return _0x37e5a9[_0x1909('0x10b')](_0x2d2874);}})['then'](function(_0x2b22ab){if(_0x2b22ab){return _0x2b22ab?{'count':_0x5850a8,'rows':_0x2b22ab}:null;}})[_0x1909('0x1c')](respondWithResult(_0x1f235f,null))[_0x1909('0x26')](handleError(_0x1f235f,null));};exports['getFields']=function(_0x5b97a4,_0xf4a444,_0x405faf){var _0x7770f4=_0x5b97a4[_0x1909('0x43')][_0x1909('0x10c')]==='false'?_0x1909('0x10d'):_0x1909('0x10e');return db[_0x1909('0x3b')][_0x1909('0x58')]({'attributes':['id',_0x7770f4],'where':{'id':_0x5b97a4[_0x1909('0x55')]['id']}})['then'](handleEntityNotFound(_0xf4a444,null))[_0x1909('0x1c')](function(_0x44f465){if(_0x44f465){var _0xde580e=_0x44f465[_0x7770f4];var _0x4b381f=_0xde580e&&_0xde580e[_0x1909('0x10f')]?_0xde580e[_0x1909('0x10f')]:[];_0xf4a444['send']({'fromKey':_[_0x1909('0x7e')](_0xde580e['fromKey'])?undefined:_0xde580e[_0x1909('0x110')],'count':_0x4b381f['length'],'rows':_0x4b381f});}})[_0x1909('0x26')](handleError(_0xf4a444,null));};exports[_0x1909('0x111')]=function(_0x360715,_0x4b18cf,_0x3509e4){var _0x3acf2e={'raw':!![],'where':{}};var _0x57a4c1={};var _0xdd091b={'count':0x0,'rows':[]};return db[_0x1909('0x3b')][_0x1909('0x66')]({'where':{'id':_0x360715[_0x1909('0x55')]['id']}})['then'](handleEntityNotFound(_0x4b18cf,null))[_0x1909('0x1c')](function(_0x588c45){if(_0x588c45){_0x57a4c1['model']=_[_0x1909('0x56')](db['ChatOfflineMessage'][_0x1909('0x3c')]);_0x57a4c1[_0x1909('0x43')]=_[_0x1909('0x56')](_0x360715['query']);_0x57a4c1['filters']=_['intersection'](_0x57a4c1[_0x1909('0x40')],_0x57a4c1[_0x1909('0x43')]);_0x3acf2e['attributes']=_[_0x1909('0x44')](_0x57a4c1[_0x1909('0x40')],qs[_0x1909('0x57')](_0x360715['query'][_0x1909('0x57')]));_0x3acf2e[_0x1909('0x45')]=_0x3acf2e[_0x1909('0x45')]['length']?_0x3acf2e[_0x1909('0x45')]:_0x57a4c1[_0x1909('0x40')];if(!_0x360715['query'][_0x1909('0x47')](_0x1909('0x48'))){_0x3acf2e[_0x1909('0x2b')]=qs[_0x1909('0x2b')](_0x360715[_0x1909('0x43')][_0x1909('0x2b')]);_0x3acf2e['offset']=qs[_0x1909('0x2a')](_0x360715[_0x1909('0x43')][_0x1909('0x2a')]);}_0x3acf2e['order']=qs[_0x1909('0x4a')](_0x360715[_0x1909('0x43')][_0x1909('0x4a')]);_0x3acf2e[_0x1909('0x4b')]=qs['filters'](_['pick'](_0x360715['query'],_0x57a4c1[_0x1909('0x4c')]));_0x3acf2e['where'][_0x1909('0x63')]=_0x588c45['id'];if(_0x360715[_0x1909('0x43')][_0x1909('0x4d')]){_0x3acf2e[_0x1909('0x4b')]=_['merge'](_0x3acf2e['where'],{'$or':_[_0x1909('0x41')](_0x3acf2e['attributes'],function(_0x21fcb4){var _0xfbdbdd={};_0xfbdbdd[_0x21fcb4]={'$like':'%'+_0x360715[_0x1909('0x43')][_0x1909('0x4d')]+'%'};return _0xfbdbdd;})});}_0x3acf2e=_[_0x1909('0x4e')]({},_0x3acf2e,_0x360715[_0x1909('0xe4')]);return db[_0x1909('0xd4')]['count']({'where':_0x3acf2e[_0x1909('0x4b')]})[_0x1909('0x1c')](function(_0xeff869){_0xdd091b[_0x1909('0x4f')]=_0xeff869;if(_0x360715[_0x1909('0x43')]['includeAll']){_0x3acf2e[_0x1909('0x51')]=[{'all':!![]}];}return db[_0x1909('0xd4')][_0x1909('0x52')](_0x3acf2e);})[_0x1909('0x1c')](function(_0x2f5b4b){_0xdd091b[_0x1909('0x53')]=_0x2f5b4b;return _0xdd091b;});}})[_0x1909('0x1c')](respondWithFilteredResult(_0x4b18cf,_0x3acf2e))[_0x1909('0x26')](handleError(_0x4b18cf,null));};exports['addAgents']=function(_0x365082,_0x14e747,_0x1e5ed6){return db[_0x1909('0x3b')][_0x1909('0x58')]({'where':{'id':_0x365082[_0x1909('0x55')]['id']}})[_0x1909('0x1c')](handleEntityNotFound(_0x14e747,null))[_0x1909('0x1c')](function(_0x31b64b){if(_0x31b64b){return _0x31b64b[_0x1909('0x112')](_0x365082[_0x1909('0x5a')][_0x1909('0xe2')],_[_0x1909('0xe3')](_0x365082[_0x1909('0x5a')],['ids','id'])||{})[_0x1909('0xce')](function(_0x250a46){for(var _0x119a7e=0x0;_0x119a7e<_0x365082[_0x1909('0x5a')]['ids']['length'];_0x119a7e+=0x1){socket[_0x1909('0x113')](_0x1909('0x114'),{'UserId':_0x365082[_0x1909('0x5a')][_0x1909('0xe2')][_0x119a7e],'ChatWebsiteId':_0x365082[_0x1909('0x55')]['id']});}return _0x250a46;});}})[_0x1909('0x1c')](respondWithResult(_0x14e747,null))[_0x1909('0x26')](handleError(_0x14e747,null));};exports['removeAgents']=function(_0x54a142,_0x11a4d3,_0x3a6827){return db[_0x1909('0x3b')]['find']({'where':{'id':_0x54a142[_0x1909('0x55')]['id']}})['then'](handleEntityNotFound(_0x11a4d3,null))[_0x1909('0x1c')](function(_0x4ac424){if(_0x4ac424){return _0x4ac424['removeAgents'](_0x54a142['query'][_0x1909('0xe2')])[_0x1909('0x1c')](function(){if(_[_0x1909('0x115')](_0x54a142[_0x1909('0x43')][_0x1909('0xe2')])){for(var _0x49ea33=0x0;_0x49ea33<_0x54a142[_0x1909('0x43')][_0x1909('0xe2')][_0x1909('0x46')];_0x49ea33+=0x1){socket[_0x1909('0x113')](_0x1909('0x116'),{'UserId':Number(_0x54a142['query'][_0x1909('0xe2')][_0x49ea33]),'ChatWebsiteId':Number(_0x54a142['params']['id'])});}}else{socket[_0x1909('0x113')](_0x1909('0x116'),{'UserId':Number(_0x54a142[_0x1909('0x43')]['ids']),'ChatWebsiteId':Number(_0x54a142[_0x1909('0x55')]['id'])});}});}})[_0x1909('0x1c')](respondWithStatusCode(_0x11a4d3,null))['catch'](handleError(_0x11a4d3,null));};exports[_0x1909('0x117')]=function(_0x31d971,_0x5cedc3,_0x3a8b){var _0x4778fa={};var _0x1013c3={};var _0x46c8e7;var _0x5e7caf;return db[_0x1909('0x3b')][_0x1909('0x66')]({'where':{'id':_0x31d971['params']['id']}})['then'](handleEntityNotFound(_0x5cedc3,null))[_0x1909('0x1c')](function(_0x24be4c){if(_0x24be4c){_0x46c8e7=_0x24be4c;_0x1013c3[_0x1909('0x40')]=_[_0x1909('0x56')](db[_0x1909('0xc1')][_0x1909('0x3c')]);_0x1013c3[_0x1909('0x43')]=_[_0x1909('0x56')](_0x31d971['query']);_0x1013c3['filters']=_[_0x1909('0x44')](_0x1013c3[_0x1909('0x40')],_0x1013c3['query']);_0x4778fa[_0x1909('0x45')]=_['intersection'](_0x1013c3[_0x1909('0x40')],qs[_0x1909('0x57')](_0x31d971[_0x1909('0x43')][_0x1909('0x57')]));_0x4778fa[_0x1909('0x45')]=_0x4778fa[_0x1909('0x45')]['length']?_0x4778fa[_0x1909('0x45')]:_0x1013c3[_0x1909('0x40')];_0x4778fa[_0x1909('0x49')]=qs[_0x1909('0x4a')](_0x31d971[_0x1909('0x43')][_0x1909('0x4a')]);_0x4778fa['where']=qs['filters'](_['pick'](_0x31d971[_0x1909('0x43')],_0x1013c3[_0x1909('0x4c')]));if(_0x31d971[_0x1909('0x43')][_0x1909('0x4d')]){_0x4778fa[_0x1909('0x4b')]=_[_0x1909('0x4e')](_0x4778fa[_0x1909('0x4b')],{'$or':_[_0x1909('0x41')](_0x4778fa[_0x1909('0x45')],function(_0x3de08c){var _0x1a845f={};_0x1a845f[_0x3de08c]={'$like':'%'+_0x31d971[_0x1909('0x43')][_0x1909('0x4d')]+'%'};return _0x1a845f;})});}_0x4778fa=_[_0x1909('0x4e')]({},_0x4778fa,_0x31d971[_0x1909('0xe4')]);return _0x46c8e7['getAgents'](_0x4778fa);}})[_0x1909('0x1c')](function(_0x67721b){if(_0x67721b){_0x5e7caf=_0x67721b[_0x1909('0x46')];if(!_0x31d971[_0x1909('0x43')][_0x1909('0x47')](_0x1909('0x48'))){_0x4778fa['limit']=qs[_0x1909('0x2b')](_0x31d971[_0x1909('0x43')]['limit']);_0x4778fa[_0x1909('0x2a')]=qs[_0x1909('0x2a')](_0x31d971[_0x1909('0x43')]['offset']);}return _0x46c8e7[_0x1909('0x117')](_0x4778fa);}})[_0x1909('0x1c')](function(_0x265bc5){if(_0x265bc5){return _0x265bc5?{'count':_0x5e7caf,'rows':_0x265bc5}:null;}})[_0x1909('0x1c')](respondWithResult(_0x5cedc3,null))[_0x1909('0x26')](handleError(_0x5cedc3,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index cba6890..d56e922 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 _0x1ef3=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1d6122,_0x1c789d){var _0x3e564f=function(_0x169575){while(--_0x169575){_0x1d6122['push'](_0x1d6122['shift']());}};_0x3e564f(++_0x1c789d);}(_0x1ef3,0x69));var _0x31ef=function(_0x3932c3,_0x34344f){_0x3932c3=_0x3932c3-0x0;var _0x21568c=_0x1ef3[_0x3932c3];return _0x21568c;};'use strict';var EventEmitter=require(_0x31ef('0x0'));var ChatWebsite=require(_0x31ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31ef('0x2')](0x0);var events={'afterCreate':_0x31ef('0x3'),'afterUpdate':_0x31ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x311a32){return function(_0x58388a,_0x49ce87,_0x1a8d7f){ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32+':'+_0x58388a['id'],_0x58388a);ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32,_0x58388a);_0x1a8d7f(null);};}for(var e in events){if(events[_0x31ef('0x6')](e)){var event=events[e];ChatWebsite[_0x31ef('0x7')](e,emitEvent(event));}}module[_0x31ef('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x106f=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x106f,0x162));var _0xf106=function(_0x3a8d80,_0x23ef0b){_0x3a8d80=_0x3a8d80-0x0;var _0x34b9bd=_0x106f[_0x3a8d80];return _0x34b9bd;};'use strict';var EventEmitter=require(_0xf106('0x0'));var ChatWebsite=require(_0xf106('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf106('0x2')](0x0);var events={'afterCreate':_0xf106('0x3'),'afterUpdate':'update','afterDestroy':_0xf106('0x4')};function emitEvent(_0x4ab04f){return function(_0x1236af,_0x370f6a,_0x1f2919){ChatWebsiteEvents[_0xf106('0x5')](_0x4ab04f+':'+_0x1236af['id'],_0x1236af);ChatWebsiteEvents[_0xf106('0x5')](_0x4ab04f,_0x1236af);_0x1f2919(null);};}for(var e in events){if(events[_0xf106('0x6')](e)){var event=events[e];ChatWebsite[_0xf106('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index f249743..de2644b 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 _0x5712=['bluebird','request-promise','path','rimraf','../../config/environment','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x5c39ee,_0x31701b){var _0xed7b5e=function(_0x53c49f){while(--_0x53c49f){_0x5c39ee['push'](_0x5c39ee['shift']());}};_0xed7b5e(++_0x31701b);}(_0x5712,0x140));var _0x2571=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5712[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var logger=require(_0x2571('0x2'))(_0x2571('0x3'));var moment=require(_0x2571('0x4'));var BPromise=require(_0x2571('0x5'));var rp=require(_0x2571('0x6'));var fs=require('fs');var path=require(_0x2571('0x7'));var rimraf=require(_0x2571('0x8'));var config=require(_0x2571('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x4713ad,_0x50fc72){return _0x4713ad[_0x2571('0xa')](_0x2571('0xb'),attributes,{'tableName':_0x2571('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x422f=['./chatWebsite.attributes','exports','define','chat_websites','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x422f,0x1c7));var _0xf422=function(_0xab9ce3,_0x124b61){_0xab9ce3=_0xab9ce3-0x0;var _0x3c18b9=_0x422f[_0xab9ce3];return _0x3c18b9;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var logger=require('../../config/logger')(_0xf422('0x1'));var moment=require(_0xf422('0x2'));var BPromise=require('bluebird');var rp=require(_0xf422('0x3'));var fs=require('fs');var path=require(_0xf422('0x4'));var rimraf=require(_0xf422('0x5'));var config=require(_0xf422('0x6'));var attributes=require(_0xf422('0x7'));module[_0xf422('0x8')]=function(_0x3e3e5d,_0x13ed91){return _0x3e3e5d[_0xf422('0x9')]('ChatWebsite',attributes,{'tableName':_0xf422('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index d6d2168..85aa528 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 _0xacf4=['stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x456875,_0xb01971){var _0x343b45=function(_0x450044){while(--_0x450044){_0x456875['push'](_0x456875['shift']());}};_0x343b45(++_0xb01971);}(_0xacf4,0xe7));var _0x4acf=function(_0x5b5242,_0x3efa81){_0x5b5242=_0x5b5242-0x0;var _0x66ffcb=_0xacf4[_0x5b5242];return _0x66ffcb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});config[_0x4acf('0xa')]=_[_0x4acf('0xb')](config[_0x4acf('0xa')],{'host':_0x4acf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4acf('0xd'))['register'](socket);function respondWithRpcPromise(_0x425c8d,_0x2c2cb4,_0x3e9ddd){return new BPromise(function(_0x4ff233,_0x290ca7){return client[_0x4acf('0xe')](_0x425c8d,_0x3e9ddd)['then'](function(_0x5f22d9){logger[_0x4acf('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x2c2cb4,'request\x20sent');logger[_0x4acf('0x10')](_0x4acf('0x11'),_0x2c2cb4,_0x4acf('0x12'),JSON[_0x4acf('0x13')](_0x5f22d9));if(_0x5f22d9[_0x4acf('0x14')]){if(_0x5f22d9[_0x4acf('0x14')][_0x4acf('0x15')]===0x1f4){logger[_0x4acf('0x14')](_0x4acf('0x16'),_0x2c2cb4,_0x5f22d9[_0x4acf('0x14')][_0x4acf('0x17')]);return _0x290ca7(_0x5f22d9['error'][_0x4acf('0x17')]);}logger['error'](_0x4acf('0x16'),_0x2c2cb4,_0x5f22d9[_0x4acf('0x14')][_0x4acf('0x17')]);return _0x4ff233(_0x5f22d9['error']['message']);}else{logger[_0x4acf('0xf')](_0x4acf('0x16'),_0x2c2cb4,_0x4acf('0x12'));_0x4ff233(_0x5f22d9['result'][_0x4acf('0x17')]);}})[_0x4acf('0x18')](function(_0x30d289){logger[_0x4acf('0x14')](_0x4acf('0x16'),_0x2c2cb4,_0x30d289);_0x290ca7(_0x30d289);});});} \ No newline at end of file +var _0x687b=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x263fdd,_0x437bd5){var _0x350d06=function(_0x1ac09c){while(--_0x1ac09c){_0x263fdd['push'](_0x263fdd['shift']());}};_0x350d06(++_0x437bd5);}(_0x687b,0x14a));var _0xb687=function(_0x5f2fea,_0x9fde07){_0x5f2fea=_0x5f2fea-0x0;var _0x198a0c=_0x687b[_0x5f2fea];return _0x198a0c;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});config[_0xb687('0xc')]=_[_0xb687('0xd')](config['redis'],{'host':_0xb687('0xe'),'port':0x18eb});var socket=require(_0xb687('0xf'))(new Redis(config['redis']));require(_0xb687('0x10'))[_0xb687('0x11')](socket);function respondWithRpcPromise(_0x825ad,_0x15dc9a,_0x404fdb){return new BPromise(function(_0x309d84,_0x3e6271){return client[_0xb687('0x12')](_0x825ad,_0x404fdb)[_0xb687('0x13')](function(_0x5103b9){logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));logger[_0xb687('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x15dc9a,'request\x20sent',JSON[_0xb687('0x18')](_0x5103b9));if(_0x5103b9[_0xb687('0x19')]){if(_0x5103b9['error'][_0xb687('0x1a')]===0x1f4){logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x3e6271(_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);}logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x309d84(_0x5103b9[_0xb687('0x19')]['message']);}else{logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));_0x309d84(_0x5103b9['result']['message']);}})[_0xb687('0x1c')](function(_0x3a10ef){logger[_0xb687('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x15dc9a,_0x3a10ef);_0x3e6271(_0x3a10ef);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2628dfe..d16e1ff 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 _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x97c160,_0x45fc51){var _0xe136e2=function(_0x2f5bbe){while(--_0x2f5bbe){_0x97c160['push'](_0x97c160['shift']());}};_0xe136e2(++_0x45fc51);}(_0x7a54,0x106));var _0x47a5=function(_0x2cfed4,_0x3ddd91){_0x2cfed4=_0x2cfed4-0x0;var _0x151ce2=_0x7a54[_0x2cfed4];return _0x151ce2;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5d258e,_0x4141f5){var _0x5eac06=function(_0x199b51){while(--_0x199b51){_0x5d258e['push'](_0x5d258e['shift']());}};_0x5eac06(++_0x4141f5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x305374,_0x394533){_0x305374=_0x305374-0x0;var _0x599932=_0x5f2f[_0x305374];return _0x599932;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index b6c549e..4ffe00a 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 _0xc306=['put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','originalname','single','join','format','now','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','addInteraction','/:id/applications','addApplications','addAgents'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0xc306,0x13a));var _0x6c30=function(_0x1e5eff,_0x322032){_0x1e5eff=_0x1e5eff-0x0;var _0x17e45f=_0xc306[_0x1e5eff];return _0x17e45f;};'use strict';var multer=require('multer');var util=require(_0x6c30('0x0'));var path=require(_0x6c30('0x1'));var timeout=require(_0x6c30('0x2'));var express=require('express');var router=express[_0x6c30('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6c30('0x4'));var config=require(_0x6c30('0x5'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x6c30('0x6')](),controller['index']);router[_0x6c30('0x7')](_0x6c30('0x8'),auth['isAuthenticated'](),controller[_0x6c30('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6c30('0x7')](_0x6c30('0xa'),auth['isAuthenticated'](),controller[_0x6c30('0xb')]);router[_0x6c30('0x7')](_0x6c30('0xc'),auth[_0x6c30('0x6')](),controller[_0x6c30('0xd')]);router[_0x6c30('0x7')](_0x6c30('0xe'),controller['getLogo']);router['get'](_0x6c30('0xf'),controller[_0x6c30('0x10')]);router[_0x6c30('0x7')](_0x6c30('0x11'),controller['getCustomerAvatar']);router[_0x6c30('0x7')](_0x6c30('0x12'),controller[_0x6c30('0x13')]);router[_0x6c30('0x7')](_0x6c30('0x14'),auth[_0x6c30('0x6')](),controller['getInteractions']);router[_0x6c30('0x7')](_0x6c30('0x15'),controller['getSnippet']);router[_0x6c30('0x7')]('/:id/applications',auth[_0x6c30('0x6')](),controller[_0x6c30('0x16')]);router[_0x6c30('0x7')](_0x6c30('0x17'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x6c30('0x7')](_0x6c30('0x18'),controller[_0x6c30('0x19')]);router['get']('/:id/offline_messages',auth[_0x6c30('0x6')](),controller[_0x6c30('0x1a')]);router[_0x6c30('0x7')](_0x6c30('0x1b'),auth[_0x6c30('0x6')](),controller['getAgents']);router['post']('/',auth[_0x6c30('0x6')](),controller[_0x6c30('0x1c')]);router[_0x6c30('0x1d')](_0x6c30('0xa'),auth[_0x6c30('0x6')](),controller[_0x6c30('0x1e')]);router['post']('/:id/canned_answers',auth[_0x6c30('0x6')](),controller[_0x6c30('0x1f')]);var upload=multer({'storage':multer[_0x6c30('0x20')]({'destination':function(_0x24e6b2,_0x3a51f0,_0x38fb48){_0x38fb48(null,path['join'](config[_0x6c30('0x21')],_0x6c30('0x22')));},'filename':function(_0x3d6909,_0x3b7430,_0x40a32b){_0x40a32b(null,util['format'](_0x6c30('0x23'),Date['now'](),_0x3b7430[_0x6c30('0x24')]));}})});router['post'](_0x6c30('0xe'),upload[_0x6c30('0x25')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x6c30('0x20')]({'destination':function(_0x3d4de9,_0x3c2fb7,_0x4238b8){_0x4238b8(null,path[_0x6c30('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4585b1,_0x2cd921,_0x26d1e4){_0x26d1e4(null,util[_0x6c30('0x27')](_0x6c30('0x23'),Date[_0x6c30('0x28')](),_0x2cd921[_0x6c30('0x24')]));}})});router['post'](_0x6c30('0xf'),upload[_0x6c30('0x25')](_0x6c30('0x29')),controller[_0x6c30('0x2a')]);var upload=multer({'storage':multer[_0x6c30('0x20')]({'destination':function(_0x11c114,_0x3a7193,_0x24f5d9){_0x24f5d9(null,path[_0x6c30('0x26')](config[_0x6c30('0x21')],_0x6c30('0x2b')));},'filename':function(_0x7eea69,_0x1c2716,_0xd7dd0b){_0xd7dd0b(null,util[_0x6c30('0x27')](_0x6c30('0x23'),Date[_0x6c30('0x28')](),_0x1c2716[_0x6c30('0x24')]));}})});router[_0x6c30('0x1d')](_0x6c30('0x11'),upload[_0x6c30('0x25')](_0x6c30('0x29')),controller[_0x6c30('0x2c')]);var upload=multer({'storage':multer[_0x6c30('0x20')]({'destination':function(_0x55df76,_0x2afca0,_0x1637ce){_0x1637ce(null,path['join'](config[_0x6c30('0x21')],_0x6c30('0x2b')));},'filename':function(_0x5c5335,_0x410c20,_0xc0fc1f){_0xc0fc1f(null,util[_0x6c30('0x27')]('%s-%s',Date[_0x6c30('0x28')](),_0x410c20[_0x6c30('0x24')]));}})});router[_0x6c30('0x1d')]('/:id/system_avatar',upload[_0x6c30('0x25')](_0x6c30('0x29')),controller[_0x6c30('0x2d')]);router[_0x6c30('0x1d')](_0x6c30('0x2e'),controller['notify']);router['post'](_0x6c30('0x2f'),controller['offline']);router[_0x6c30('0x1d')]('/:id/interactions',auth[_0x6c30('0x6')](),controller[_0x6c30('0x30')]);router['post'](_0x6c30('0x31'),auth['isAuthenticated'](),controller[_0x6c30('0x32')]);router['post'](_0x6c30('0x17'),auth[_0x6c30('0x6')](),controller['addProactiveActions']);router['post'](_0x6c30('0x1b'),auth['isAuthenticated'](),controller[_0x6c30('0x33')]);router[_0x6c30('0x34')](_0x6c30('0x35'),auth[_0x6c30('0x6')](),controller[_0x6c30('0x36')]);router[_0x6c30('0x37')](_0x6c30('0x35'),auth[_0x6c30('0x6')](),controller[_0x6c30('0x38')]);router[_0x6c30('0x37')](_0x6c30('0xa'),auth[_0x6c30('0x6')](),controller[_0x6c30('0x39')]);router['delete']('/:id/canned_answers',auth[_0x6c30('0x6')](),controller[_0x6c30('0x3a')]);router[_0x6c30('0x37')](_0x6c30('0x1b'),auth[_0x6c30('0x6')](),controller[_0x6c30('0x3b')]);module[_0x6c30('0x3c')]=router; \ No newline at end of file +var _0x9f62=['server/files/images/avatars/','format','root','%s-%s','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/interactions','addInteraction','/:id/applications','addApplications','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','diskStorage','join','server/files/images/logos/','now','originalname','single','file','addLogo'];(function(_0x43c75d,_0x512e99){var _0x5134c8=function(_0x47b242){while(--_0x47b242){_0x43c75d['push'](_0x43c75d['shift']());}};_0x5134c8(++_0x512e99);}(_0x9f62,0x1db));var _0x29f6=function(_0x588128,_0xf25996){_0x588128=_0x588128-0x0;var _0x183a9b=_0x9f62[_0x588128];return _0x183a9b;};'use strict';var multer=require(_0x29f6('0x0'));var util=require(_0x29f6('0x1'));var path=require(_0x29f6('0x2'));var timeout=require(_0x29f6('0x3'));var express=require(_0x29f6('0x4'));var router=express['Router']();var auth=require(_0x29f6('0x5'));var interaction=require(_0x29f6('0x6'));var config=require(_0x29f6('0x7'));var controller=require('./chatWebsite.controller');router[_0x29f6('0x8')]('/',auth[_0x29f6('0x9')](),controller[_0x29f6('0xa')]);router[_0x29f6('0x8')](_0x29f6('0xb'),auth[_0x29f6('0x9')](),controller[_0x29f6('0xc')]);router[_0x29f6('0x8')](_0x29f6('0xd'),auth[_0x29f6('0x9')](),controller[_0x29f6('0xe')]);router[_0x29f6('0x8')](_0x29f6('0xf'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x10')]);router[_0x29f6('0x8')](_0x29f6('0x11'),auth['isAuthenticated'](),controller[_0x29f6('0x12')]);router['get'](_0x29f6('0x13'),controller[_0x29f6('0x14')]);router['get'](_0x29f6('0x15'),controller['getAvatar']);router[_0x29f6('0x8')](_0x29f6('0x16'),controller['getCustomerAvatar']);router[_0x29f6('0x8')](_0x29f6('0x17'),controller['getSystemAvatar']);router[_0x29f6('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x29f6('0x18')]);router[_0x29f6('0x8')](_0x29f6('0x19'),controller[_0x29f6('0x1a')]);router[_0x29f6('0x8')]('/:id/applications',auth[_0x29f6('0x9')](),controller[_0x29f6('0x1b')]);router[_0x29f6('0x8')](_0x29f6('0x1c'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x1d')]);router['get'](_0x29f6('0x1e'),controller[_0x29f6('0x1f')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x29f6('0x20')]);router['get']('/:id/users',auth[_0x29f6('0x9')](),controller[_0x29f6('0x21')]);router[_0x29f6('0x22')]('/',auth[_0x29f6('0x9')](),controller[_0x29f6('0x23')]);router[_0x29f6('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x29f6('0x24')]);router[_0x29f6('0x22')]('/:id/canned_answers',auth[_0x29f6('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x29f6('0x25')]({'destination':function(_0x565b39,_0x492d8b,_0x1985ce){_0x1985ce(null,path[_0x29f6('0x26')](config['root'],_0x29f6('0x27')));},'filename':function(_0x5d81a2,_0x496366,_0x323934){_0x323934(null,util['format']('%s-%s',Date[_0x29f6('0x28')](),_0x496366[_0x29f6('0x29')]));}})});router[_0x29f6('0x22')]('/:id/logo',upload[_0x29f6('0x2a')](_0x29f6('0x2b')),controller[_0x29f6('0x2c')]);var upload=multer({'storage':multer[_0x29f6('0x25')]({'destination':function(_0x186dc0,_0x3512e1,_0x107ce5){_0x107ce5(null,path[_0x29f6('0x26')](config['root'],_0x29f6('0x2d')));},'filename':function(_0x496d6f,_0x311784,_0x10b147){_0x10b147(null,util[_0x29f6('0x2e')]('%s-%s',Date[_0x29f6('0x28')](),_0x311784[_0x29f6('0x29')]));}})});router[_0x29f6('0x22')](_0x29f6('0x15'),upload[_0x29f6('0x2a')](_0x29f6('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x29f6('0x25')]({'destination':function(_0x5ae025,_0x1b3816,_0x211f6e){_0x211f6e(null,path['join'](config[_0x29f6('0x2f')],_0x29f6('0x2d')));},'filename':function(_0x4aca79,_0x3c2fd3,_0x3f0a41){_0x3f0a41(null,util[_0x29f6('0x2e')](_0x29f6('0x30'),Date[_0x29f6('0x28')](),_0x3c2fd3['originalname']));}})});router[_0x29f6('0x22')]('/:id/customer_avatar',upload[_0x29f6('0x2a')]('file'),controller[_0x29f6('0x31')]);var upload=multer({'storage':multer[_0x29f6('0x25')]({'destination':function(_0x231363,_0x521ed3,_0x1ecc55){_0x1ecc55(null,path[_0x29f6('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3e6041,_0x1f166b,_0x37d1fa){_0x37d1fa(null,util[_0x29f6('0x2e')]('%s-%s',Date['now'](),_0x1f166b['originalname']));}})});router[_0x29f6('0x22')](_0x29f6('0x17'),upload[_0x29f6('0x2a')](_0x29f6('0x2b')),controller[_0x29f6('0x32')]);router[_0x29f6('0x22')](_0x29f6('0x33'),controller['notify']);router[_0x29f6('0x22')]('/:id/offline',controller['offline']);router['post'](_0x29f6('0x34'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x35')]);router[_0x29f6('0x22')](_0x29f6('0x36'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x37')]);router[_0x29f6('0x22')](_0x29f6('0x1c'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x29f6('0x22')]('/:id/users',auth[_0x29f6('0x9')](),controller['addAgents']);router[_0x29f6('0x38')]('/:id',auth[_0x29f6('0x9')](),controller[_0x29f6('0x39')]);router[_0x29f6('0x3a')](_0x29f6('0xd'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x3b')]);router[_0x29f6('0x3a')](_0x29f6('0xf'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x3c')]);router[_0x29f6('0x3a')](_0x29f6('0x11'),auth[_0x29f6('0x9')](),controller[_0x29f6('0x3d')]);router['delete'](_0x29f6('0x3e'),auth['isAuthenticated'](),controller[_0x29f6('0x3f')]);module[_0x29f6('0x40')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index cfcb23f..de44ff3 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 _0xb115=['exports','STRING','name','sequelize'];(function(_0x2a26da,_0x3dfca3){var _0x59fc7f=function(_0x46c223){while(--_0x46c223){_0x2a26da['push'](_0x2a26da['shift']());}};_0x59fc7f(++_0x3dfca3);}(_0xb115,0xdf));var _0x5b11=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb115[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x5b11('0x0'));module[_0x5b11('0x1')]={'name':{'type':Sequelize[_0x5b11('0x2')],'unique':_0x5b11('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5b11('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5b11('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5b11('0x2')]},'type':{'type':Sequelize[_0x5b11('0x2')]},'street':{'type':Sequelize[_0x5b11('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5b11('0x2')]},'country':{'type':Sequelize[_0x5b11('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x5b11('0x2')]},'sCity':{'type':Sequelize[_0x5b11('0x2')]},'sCountry':{'type':Sequelize[_0x5b11('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x657a=['name','STRING'];(function(_0x4c1edb,_0x50e81f){var _0x356b9e=function(_0x27d1a1){while(--_0x27d1a1){_0x4c1edb['push'](_0x4c1edb['shift']());}};_0x356b9e(++_0x50e81f);}(_0x657a,0x15c));var _0xa657=function(_0x41648f,_0x4a8936){_0x41648f=_0x41648f-0x0;var _0x20340a=_0x657a[_0x41648f];return _0x20340a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa657('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa657('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa657('0x1')]},'type':{'type':Sequelize[_0xa657('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa657('0x1')]},'city':{'type':Sequelize[_0xa657('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa657('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa657('0x1')]},'sStreet':{'type':Sequelize[_0xa657('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa657('0x1')]},'sCountry':{'type':Sequelize[_0xa657('0x1')]},'description':{'type':Sequelize[_0xa657('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index ce9f0d8..438231b 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 _0xf036=['CmCompany','rawAttributes','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','keys','query','model','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','merge','map','includeAll','include','rows','catch','show','params'];(function(_0x4a7ab0,_0xf5f2a7){var _0x5252ee=function(_0x165cda){while(--_0x165cda){_0x4a7ab0['push'](_0x4a7ab0['shift']());}};_0x5252ee(++_0xf5f2a7);}(_0xf036,0x122));var _0x6f03=function(_0x5bd665,_0x4246dd){_0x5bd665=_0x5bd665-0x0;var _0x4fd822=_0xf036[_0x5bd665];return _0x4fd822;};'use strict';var pdf=require(_0x6f03('0x0'));var emlformat=require(_0x6f03('0x1'));var rimraf=require(_0x6f03('0x2'));var zipdir=require(_0x6f03('0x3'));var jsonpatch=require(_0x6f03('0x4'));var rp=require(_0x6f03('0x5'));var moment=require(_0x6f03('0x6'));var BPromise=require(_0x6f03('0x7'));var Mustache=require(_0x6f03('0x8'));var util=require(_0x6f03('0x9'));var path=require(_0x6f03('0xa'));var sox=require(_0x6f03('0xb'));var csv=require(_0x6f03('0xc'));var ejs=require(_0x6f03('0xd'));var fs=require('fs');var _=require(_0x6f03('0xe'));var squel=require(_0x6f03('0xf'));var crypto=require(_0x6f03('0x10'));var jsforce=require(_0x6f03('0x11'));var deskjs=require(_0x6f03('0x12'));var toCsv=require(_0x6f03('0xc'));var querystring=require(_0x6f03('0x13'));var Papa=require(_0x6f03('0x14'));var Redis=require(_0x6f03('0x15'));var authService=require(_0x6f03('0x16'));var qs=require(_0x6f03('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f03('0x18'));var logger=require(_0x6f03('0x19'))(_0x6f03('0x1a'));var utils=require(_0x6f03('0x1b'));var config=require(_0x6f03('0x1c'));var db=require(_0x6f03('0x1d'))['db'];function respondWithStatusCode(_0x145e3d,_0xf4c290){_0xf4c290=_0xf4c290||0xcc;return function(_0x572e23){if(_0x572e23){return _0x145e3d[_0x6f03('0x1e')](_0xf4c290);}return _0x145e3d[_0x6f03('0x1f')](_0xf4c290)[_0x6f03('0x20')]();};}function respondWithResult(_0x4babd7,_0x2216eb){_0x2216eb=_0x2216eb||0xc8;return function(_0x1446c2){if(_0x1446c2){return _0x4babd7[_0x6f03('0x1f')](_0x2216eb)[_0x6f03('0x21')](_0x1446c2);}};}function respondWithFilteredResult(_0x3408d0,_0x4d4ee5){return function(_0x4eda13){if(_0x4eda13){var _0x5cdaf1=_0x4eda13[_0x6f03('0x22')],_0x5c0e68=_0x4d4ee5['offset'],_0x2dd789=_0x4d4ee5[_0x6f03('0x23')]+_0x4d4ee5[_0x6f03('0x24')],_0x1593f1;if(_0x2dd789>=_0x5cdaf1){_0x2dd789=_0x5cdaf1;_0x1593f1=0xc8;}else{_0x1593f1=0xce;}_0x3408d0[_0x6f03('0x1f')](_0x1593f1);return _0x3408d0['set']('Content-Range',_0x5c0e68+'-'+_0x2dd789+'/'+_0x5cdaf1)['json'](_0x4eda13);}return null;};}function patchUpdates(_0x24a4ff){return function(_0x5e9125){try{jsonpatch['apply'](_0x5e9125,_0x24a4ff,!![]);}catch(_0x5559de){return BPromise[_0x6f03('0x25')](_0x5559de);}return _0x5e9125[_0x6f03('0x26')]();};}function saveUpdates(_0x4e0186,_0x44ae39){return function(_0x5e7481){if(_0x5e7481){return _0x5e7481[_0x6f03('0x27')](_0x4e0186)[_0x6f03('0x28')](function(_0x247001){return _0x247001;});}return null;};}function removeEntity(_0x3e9e2f,_0x791702){return function(_0x227c1d){if(_0x227c1d){return _0x227c1d[_0x6f03('0x29')]()[_0x6f03('0x28')](function(){var _0x1df34a=_0x227c1d[_0x6f03('0x2a')]({'plain':!![]});var _0x39b34f='Companies';return db[_0x6f03('0x2b')][_0x6f03('0x29')]({'where':{'type':_0x39b34f,'resourceId':_0x1df34a['id']}})[_0x6f03('0x28')](function(){return _0x227c1d;});})[_0x6f03('0x28')](function(){_0x3e9e2f[_0x6f03('0x1f')](0xcc)[_0x6f03('0x20')]();});}};}function handleEntityNotFound(_0x296557,_0x11a624){return function(_0x4fe0fb){if(!_0x4fe0fb){_0x296557[_0x6f03('0x1e')](0x194);}return _0x4fe0fb;};}function handleError(_0x409958,_0x4be68f){_0x4be68f=_0x4be68f||0x1f4;return function(_0x33852d){logger[_0x6f03('0x2c')](_0x33852d[_0x6f03('0x2d')]);if(_0x33852d[_0x6f03('0x2e')]){delete _0x33852d['name'];}_0x409958['status'](_0x4be68f)[_0x6f03('0x2f')](_0x33852d);};}exports[_0x6f03('0x30')]=function(_0x3d05d6,_0x5c1d5e){var _0x4f49bc={},_0x19dc09={},_0x5bea3c={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x6f03('0x28')](function(_0x352641){_0x19dc09['model']=_[_0x6f03('0x31')](_0x352641);_0x19dc09[_0x6f03('0x32')]=_['keys'](_0x3d05d6[_0x6f03('0x32')]);_0x19dc09['filters']=_['intersection'](_0x19dc09[_0x6f03('0x33')],_0x19dc09[_0x6f03('0x32')]);_0x4f49bc['attributes']=_[_0x6f03('0x34')](_0x19dc09[_0x6f03('0x33')],qs[_0x6f03('0x35')](_0x3d05d6['query'][_0x6f03('0x35')]));_0x4f49bc['attributes']=_0x4f49bc[_0x6f03('0x36')][_0x6f03('0x37')]?_0x4f49bc[_0x6f03('0x36')]:_0x19dc09[_0x6f03('0x33')];if(!_0x3d05d6[_0x6f03('0x32')]['hasOwnProperty']('nolimit')){_0x4f49bc['limit']=qs['limit'](_0x3d05d6[_0x6f03('0x32')][_0x6f03('0x24')]);_0x4f49bc[_0x6f03('0x23')]=qs[_0x6f03('0x23')](_0x3d05d6[_0x6f03('0x32')][_0x6f03('0x23')]);}_0x4f49bc[_0x6f03('0x38')]=qs[_0x6f03('0x39')](_0x3d05d6[_0x6f03('0x32')][_0x6f03('0x39')]);_0x4f49bc[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_[_0x6f03('0x3c')](_0x3d05d6['query'],_0x19dc09['filters']));if(_0x3d05d6[_0x6f03('0x32')][_0x6f03('0x3d')]){_0x4f49bc[_0x6f03('0x3a')]=_[_0x6f03('0x3e')](_0x4f49bc['where'],{'$or':_[_0x6f03('0x3f')](_0x4f49bc[_0x6f03('0x36')],function(_0x17eaf9){var _0x3e0401={};_0x3e0401[_0x17eaf9]={'$like':'%'+_0x3d05d6[_0x6f03('0x32')][_0x6f03('0x3d')]+'%'};return _0x3e0401;})});}_0x4f49bc=_[_0x6f03('0x3e')]({},_0x4f49bc,_0x3d05d6['options']);var _0x559d6c={'where':_0x4f49bc[_0x6f03('0x3a')]};return db['CmCompany'][_0x6f03('0x22')](_0x559d6c)[_0x6f03('0x28')](function(_0x1f20b2){_0x5bea3c[_0x6f03('0x22')]=_0x1f20b2;if(_0x3d05d6['query'][_0x6f03('0x40')]){_0x4f49bc[_0x6f03('0x41')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x4f49bc);})[_0x6f03('0x28')](function(_0x18aaf8){_0x5bea3c[_0x6f03('0x42')]=_0x18aaf8;return _0x5bea3c;})['then'](respondWithFilteredResult(_0x5c1d5e,_0x4f49bc))[_0x6f03('0x43')](handleError(_0x5c1d5e,null));});};exports[_0x6f03('0x44')]=function(_0x52b52c,_0xebfa77){var _0x5e5b66={'raw':![],'where':{'id':_0x52b52c[_0x6f03('0x45')]['id']}},_0xdc47f1={};_0xdc47f1[_0x6f03('0x33')]=_['keys'](db[_0x6f03('0x46')][_0x6f03('0x47')]);_0xdc47f1[_0x6f03('0x32')]=_[_0x6f03('0x31')](_0x52b52c[_0x6f03('0x32')]);_0xdc47f1[_0x6f03('0x3b')]=_['intersection'](_0xdc47f1['model'],_0xdc47f1[_0x6f03('0x32')]);_0x5e5b66['attributes']=_[_0x6f03('0x34')](_0xdc47f1[_0x6f03('0x33')],qs[_0x6f03('0x35')](_0x52b52c[_0x6f03('0x32')]['fields']));_0x5e5b66[_0x6f03('0x36')]=_0x5e5b66['attributes']['length']?_0x5e5b66[_0x6f03('0x36')]:_0xdc47f1[_0x6f03('0x33')];if(_0x52b52c[_0x6f03('0x32')][_0x6f03('0x40')]){_0x5e5b66['include']=[{'all':!![]}];}_0x5e5b66=_[_0x6f03('0x3e')]({},_0x5e5b66,_0x52b52c[_0x6f03('0x48')]);return db[_0x6f03('0x46')][_0x6f03('0x49')](_0x5e5b66)[_0x6f03('0x28')](handleEntityNotFound(_0xebfa77,null))[_0x6f03('0x28')](respondWithResult(_0xebfa77,null))[_0x6f03('0x43')](handleError(_0xebfa77,null));};exports[_0x6f03('0x4a')]=function(_0x66a2f2,_0x32023b){return db[_0x6f03('0x46')][_0x6f03('0x4a')](_0x66a2f2['body'],{})[_0x6f03('0x28')](function(_0x95df87){var _0x7e53bf=_0x66a2f2['user'][_0x6f03('0x2a')]({'plain':!![]});if(!_0x7e53bf)throw new Error(_0x6f03('0x4b'));if(_0x7e53bf[_0x6f03('0x4c')]===_0x6f03('0x4d')){var _0x17b5dc=_0x95df87['get']({'plain':!![]});var _0x5b6e24=_0x6f03('0x4e');return db[_0x6f03('0x4f')][_0x6f03('0x49')]({'where':{'name':_0x5b6e24,'userProfileId':_0x7e53bf['userProfileId']},'raw':!![]})[_0x6f03('0x28')](function(_0x32cd81){if(_0x32cd81&&_0x32cd81['autoAssociation']===0x0){return db[_0x6f03('0x2b')][_0x6f03('0x4a')]({'name':_0x17b5dc[_0x6f03('0x2e')],'resourceId':_0x17b5dc['id'],'type':_0x32cd81[_0x6f03('0x2e')],'sectionId':_0x32cd81['id']},{})['then'](function(){return _0x95df87;});}else{return _0x95df87;}})[_0x6f03('0x43')](function(_0x3caad2){logger[_0x6f03('0x2c')](_0x6f03('0x50'),_0x3caad2);throw _0x3caad2;});}return _0x95df87;})[_0x6f03('0x28')](respondWithResult(_0x32023b,0xc9))[_0x6f03('0x43')](handleError(_0x32023b,null));};exports[_0x6f03('0x27')]=function(_0x10fb07,_0x37926e){if(_0x10fb07[_0x6f03('0x51')]['id']){delete _0x10fb07[_0x6f03('0x51')]['id'];}return db['CmCompany'][_0x6f03('0x49')]({'where':{'id':_0x10fb07[_0x6f03('0x45')]['id']}})[_0x6f03('0x28')](handleEntityNotFound(_0x37926e,null))['then'](saveUpdates(_0x10fb07[_0x6f03('0x51')],null))['then'](respondWithResult(_0x37926e,null))[_0x6f03('0x43')](handleError(_0x37926e,null));};exports[_0x6f03('0x29')]=function(_0x1b684f,_0x1eef4b){return db['CmCompany'][_0x6f03('0x49')]({'where':{'id':_0x1b684f['params']['id']}})[_0x6f03('0x28')](handleEntityNotFound(_0x1eef4b,null))['then'](removeEntity(_0x1eef4b,null))[_0x6f03('0x43')](handleError(_0x1eef4b,null));};exports[_0x6f03('0x52')]=function(_0x3d93ac,_0x5abacd){return db[_0x6f03('0x46')]['describe']()[_0x6f03('0x28')](respondWithResult(_0x5abacd,null))[_0x6f03('0x43')](handleError(_0x5abacd,null));};exports[_0x6f03('0x53')]=function(_0x137e50,_0x4ea62a,_0x1a1704){return db[_0x6f03('0x54')][_0x6f03('0x49')]({'where':{'id':_0x137e50[_0x6f03('0x45')]['id']}})[_0x6f03('0x28')](handleEntityNotFound(_0x4ea62a,null))[_0x6f03('0x28')](function(_0xd7096b){if(_0xd7096b){return _0xd7096b[_0x6f03('0x53')](_0x137e50[_0x6f03('0x51')][_0x6f03('0x55')],_[_0x6f03('0x56')](_0x137e50[_0x6f03('0x51')],['ids','id'])||{});}})[_0x6f03('0x28')](respondWithResult(_0x4ea62a,null))['catch'](handleError(_0x4ea62a,null));};exports[_0x6f03('0x57')]=function(_0x4cdb0b,_0x10bda0,_0x7ff5ed){var _0x4924ad={};var _0x4892ab={};var _0x3102b6;var _0x3933bd;return db[_0x6f03('0x46')][_0x6f03('0x58')]({'where':{'id':_0x4cdb0b['params']['id']}})[_0x6f03('0x28')](handleEntityNotFound(_0x10bda0,null))[_0x6f03('0x28')](function(_0x208b1c){if(_0x208b1c){_0x3102b6=_0x208b1c;_0x4892ab[_0x6f03('0x33')]=_[_0x6f03('0x31')](db[_0x6f03('0x54')][_0x6f03('0x47')]);_0x4892ab[_0x6f03('0x32')]=_[_0x6f03('0x31')](_0x4cdb0b[_0x6f03('0x32')]);_0x4892ab[_0x6f03('0x3b')]=_[_0x6f03('0x34')](_0x4892ab['model'],_0x4892ab[_0x6f03('0x32')]);_0x4924ad[_0x6f03('0x36')]=_[_0x6f03('0x34')](_0x4892ab[_0x6f03('0x33')],qs[_0x6f03('0x35')](_0x4cdb0b[_0x6f03('0x32')]['fields']));_0x4924ad[_0x6f03('0x36')]=_0x4924ad[_0x6f03('0x36')][_0x6f03('0x37')]?_0x4924ad[_0x6f03('0x36')]:_0x4892ab[_0x6f03('0x33')];_0x4924ad[_0x6f03('0x38')]=qs[_0x6f03('0x39')](_0x4cdb0b[_0x6f03('0x32')][_0x6f03('0x39')]);_0x4924ad[_0x6f03('0x3a')]=qs[_0x6f03('0x3b')](_[_0x6f03('0x3c')](_0x4cdb0b[_0x6f03('0x32')],_0x4892ab[_0x6f03('0x3b')]));if(_0x4cdb0b['query']['filter']){_0x4924ad[_0x6f03('0x3a')]=_[_0x6f03('0x3e')](_0x4924ad['where'],{'$or':_[_0x6f03('0x3f')](_0x4924ad[_0x6f03('0x36')],function(_0xec769f){var _0x45834a={};_0x45834a[_0xec769f]={'$like':'%'+_0x4cdb0b[_0x6f03('0x32')][_0x6f03('0x3d')]+'%'};return _0x45834a;})});}_0x4924ad=_[_0x6f03('0x3e')]({},_0x4924ad,_0x4cdb0b[_0x6f03('0x48')]);return _0x3102b6[_0x6f03('0x57')](_0x4924ad);}})[_0x6f03('0x28')](function(_0x13cd61){if(_0x13cd61){_0x3933bd=_0x13cd61['length'];if(!_0x4cdb0b[_0x6f03('0x32')]['hasOwnProperty'](_0x6f03('0x59'))){_0x4924ad[_0x6f03('0x24')]=qs[_0x6f03('0x24')](_0x4cdb0b[_0x6f03('0x32')][_0x6f03('0x24')]);_0x4924ad[_0x6f03('0x23')]=qs[_0x6f03('0x23')](_0x4cdb0b[_0x6f03('0x32')][_0x6f03('0x23')]);}return _0x3102b6[_0x6f03('0x57')](_0x4924ad);}})[_0x6f03('0x28')](function(_0x35941e){if(_0x35941e){return _0x35941e?{'count':_0x3933bd,'rows':_0x35941e}:null;}})['then'](respondWithResult(_0x10bda0,null))[_0x6f03('0x43')](handleError(_0x10bda0,null));}; \ No newline at end of file +var _0xc1c3=['count','offset','limit','set','Content-Range','apply','save','then','destroy','get','Companies','end','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','CmContact','addContacts','ids','omit','getContacts','findOne','map','options','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json'];(function(_0x584a40,_0x4c2069){var _0x360668=function(_0x2d1226){while(--_0x2d1226){_0x584a40['push'](_0x584a40['shift']());}};_0x360668(++_0x4c2069);}(_0xc1c3,0x11b));var _0x3c1c=function(_0x19e977,_0x43c88d){_0x19e977=_0x19e977-0x0;var _0x5da987=_0xc1c3[_0x19e977];return _0x5da987;};'use strict';var pdf=require(_0x3c1c('0x0'));var emlformat=require(_0x3c1c('0x1'));var rimraf=require(_0x3c1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c1c('0x3'));var rp=require('request-promise');var moment=require(_0x3c1c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3c1c('0x5'));var path=require('path');var sox=require(_0x3c1c('0x6'));var csv=require(_0x3c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c1c('0x8'));var squel=require('squel');var crypto=require(_0x3c1c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3c1c('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3c1c('0xb'));var Papa=require('papaparse');var Redis=require(_0x3c1c('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x3c1c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c1c('0xe'));var logger=require(_0x3c1c('0xf'))(_0x3c1c('0x10'));var utils=require(_0x3c1c('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cb414,_0x4d0975){_0x4d0975=_0x4d0975||0xcc;return function(_0x2bc911){if(_0x2bc911){return _0x2cb414[_0x3c1c('0x12')](_0x4d0975);}return _0x2cb414[_0x3c1c('0x13')](_0x4d0975)['end']();};}function respondWithResult(_0x300d9b,_0x2bc409){_0x2bc409=_0x2bc409||0xc8;return function(_0x2fcc5f){if(_0x2fcc5f){return _0x300d9b[_0x3c1c('0x13')](_0x2bc409)[_0x3c1c('0x14')](_0x2fcc5f);}};}function respondWithFilteredResult(_0x5e7330,_0xc8eac){return function(_0x4e62fe){if(_0x4e62fe){var _0x30e23c=_0x4e62fe[_0x3c1c('0x15')],_0x577f10=_0xc8eac['offset'],_0x3fd745=_0xc8eac[_0x3c1c('0x16')]+_0xc8eac[_0x3c1c('0x17')],_0x34c825;if(_0x3fd745>=_0x30e23c){_0x3fd745=_0x30e23c;_0x34c825=0xc8;}else{_0x34c825=0xce;}_0x5e7330[_0x3c1c('0x13')](_0x34c825);return _0x5e7330[_0x3c1c('0x18')](_0x3c1c('0x19'),_0x577f10+'-'+_0x3fd745+'/'+_0x30e23c)[_0x3c1c('0x14')](_0x4e62fe);}return null;};}function patchUpdates(_0x4d634c){return function(_0x590dbb){try{jsonpatch[_0x3c1c('0x1a')](_0x590dbb,_0x4d634c,!![]);}catch(_0x3e3625){return BPromise['reject'](_0x3e3625);}return _0x590dbb[_0x3c1c('0x1b')]();};}function saveUpdates(_0x473bbf,_0x2dcc68){return function(_0x231463){if(_0x231463){return _0x231463['update'](_0x473bbf)[_0x3c1c('0x1c')](function(_0x33b691){return _0x33b691;});}return null;};}function removeEntity(_0xf69325,_0xa64347){return function(_0x1f6035){if(_0x1f6035){return _0x1f6035[_0x3c1c('0x1d')]()['then'](function(){var _0x4d55f9=_0x1f6035[_0x3c1c('0x1e')]({'plain':!![]});var _0x541e7c=_0x3c1c('0x1f');return db['UserProfileResource'][_0x3c1c('0x1d')]({'where':{'type':_0x541e7c,'resourceId':_0x4d55f9['id']}})[_0x3c1c('0x1c')](function(){return _0x1f6035;});})[_0x3c1c('0x1c')](function(){_0xf69325[_0x3c1c('0x13')](0xcc)[_0x3c1c('0x20')]();});}};}function handleEntityNotFound(_0x34b3ad,_0x40a7cf){return function(_0x27e0f8){if(!_0x27e0f8){_0x34b3ad[_0x3c1c('0x12')](0x194);}return _0x27e0f8;};}function handleError(_0x4eee6b,_0x575ffc){_0x575ffc=_0x575ffc||0x1f4;return function(_0x201cb3){logger[_0x3c1c('0x21')](_0x201cb3[_0x3c1c('0x22')]);if(_0x201cb3[_0x3c1c('0x23')]){delete _0x201cb3['name'];}_0x4eee6b[_0x3c1c('0x13')](_0x575ffc)['send'](_0x201cb3);};}exports['index']=function(_0x28b6e1,_0x47bac5){var _0x4715a3={},_0x43909e={},_0x3d09ea={'count':0x0,'rows':[]};return db[_0x3c1c('0x24')][_0x3c1c('0x25')]()['then'](function(_0x445de2){_0x43909e[_0x3c1c('0x26')]=_[_0x3c1c('0x27')](_0x445de2);_0x43909e[_0x3c1c('0x28')]=_[_0x3c1c('0x27')](_0x28b6e1[_0x3c1c('0x28')]);_0x43909e[_0x3c1c('0x29')]=_[_0x3c1c('0x2a')](_0x43909e[_0x3c1c('0x26')],_0x43909e['query']);_0x4715a3[_0x3c1c('0x2b')]=_[_0x3c1c('0x2a')](_0x43909e['model'],qs[_0x3c1c('0x2c')](_0x28b6e1[_0x3c1c('0x28')][_0x3c1c('0x2c')]));_0x4715a3['attributes']=_0x4715a3[_0x3c1c('0x2b')]['length']?_0x4715a3[_0x3c1c('0x2b')]:_0x43909e[_0x3c1c('0x26')];if(!_0x28b6e1[_0x3c1c('0x28')][_0x3c1c('0x2d')](_0x3c1c('0x2e'))){_0x4715a3[_0x3c1c('0x17')]=qs[_0x3c1c('0x17')](_0x28b6e1[_0x3c1c('0x28')][_0x3c1c('0x17')]);_0x4715a3[_0x3c1c('0x16')]=qs[_0x3c1c('0x16')](_0x28b6e1[_0x3c1c('0x28')][_0x3c1c('0x16')]);}_0x4715a3[_0x3c1c('0x2f')]=qs[_0x3c1c('0x30')](_0x28b6e1[_0x3c1c('0x28')][_0x3c1c('0x30')]);_0x4715a3[_0x3c1c('0x31')]=qs[_0x3c1c('0x29')](_[_0x3c1c('0x32')](_0x28b6e1[_0x3c1c('0x28')],_0x43909e[_0x3c1c('0x29')]));if(_0x28b6e1[_0x3c1c('0x28')]['filter']){_0x4715a3[_0x3c1c('0x31')]=_[_0x3c1c('0x33')](_0x4715a3[_0x3c1c('0x31')],{'$or':_['map'](_0x4715a3[_0x3c1c('0x2b')],function(_0x2e38f7){var _0x3aad68={};_0x3aad68[_0x2e38f7]={'$like':'%'+_0x28b6e1['query'][_0x3c1c('0x34')]+'%'};return _0x3aad68;})});}_0x4715a3=_[_0x3c1c('0x33')]({},_0x4715a3,_0x28b6e1['options']);var _0x4b79d9={'where':_0x4715a3[_0x3c1c('0x31')]};return db[_0x3c1c('0x24')][_0x3c1c('0x15')](_0x4b79d9)[_0x3c1c('0x1c')](function(_0x4011a0){_0x3d09ea[_0x3c1c('0x15')]=_0x4011a0;if(_0x28b6e1[_0x3c1c('0x28')]['includeAll']){_0x4715a3[_0x3c1c('0x35')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x4715a3);})['then'](function(_0x16037c){_0x3d09ea[_0x3c1c('0x36')]=_0x16037c;return _0x3d09ea;})[_0x3c1c('0x1c')](respondWithFilteredResult(_0x47bac5,_0x4715a3))[_0x3c1c('0x37')](handleError(_0x47bac5,null));});};exports[_0x3c1c('0x38')]=function(_0xe83e0,_0x458c6c){var _0x4d00b8={'raw':![],'where':{'id':_0xe83e0[_0x3c1c('0x39')]['id']}},_0x1b9223={};_0x1b9223[_0x3c1c('0x26')]=_[_0x3c1c('0x27')](db[_0x3c1c('0x24')][_0x3c1c('0x3a')]);_0x1b9223['query']=_['keys'](_0xe83e0[_0x3c1c('0x28')]);_0x1b9223[_0x3c1c('0x29')]=_[_0x3c1c('0x2a')](_0x1b9223[_0x3c1c('0x26')],_0x1b9223[_0x3c1c('0x28')]);_0x4d00b8[_0x3c1c('0x2b')]=_[_0x3c1c('0x2a')](_0x1b9223[_0x3c1c('0x26')],qs[_0x3c1c('0x2c')](_0xe83e0[_0x3c1c('0x28')][_0x3c1c('0x2c')]));_0x4d00b8[_0x3c1c('0x2b')]=_0x4d00b8[_0x3c1c('0x2b')][_0x3c1c('0x3b')]?_0x4d00b8[_0x3c1c('0x2b')]:_0x1b9223[_0x3c1c('0x26')];if(_0xe83e0[_0x3c1c('0x28')]['includeAll']){_0x4d00b8[_0x3c1c('0x35')]=[{'all':!![]}];}_0x4d00b8=_[_0x3c1c('0x33')]({},_0x4d00b8,_0xe83e0['options']);return db[_0x3c1c('0x24')][_0x3c1c('0x3c')](_0x4d00b8)[_0x3c1c('0x1c')](handleEntityNotFound(_0x458c6c,null))[_0x3c1c('0x1c')](respondWithResult(_0x458c6c,null))['catch'](handleError(_0x458c6c,null));};exports[_0x3c1c('0x3d')]=function(_0x2089bd,_0x15dfe6){return db[_0x3c1c('0x24')][_0x3c1c('0x3d')](_0x2089bd[_0x3c1c('0x3e')],{})[_0x3c1c('0x1c')](function(_0x4f452c){var _0x5bc299=_0x2089bd[_0x3c1c('0x3f')][_0x3c1c('0x1e')]({'plain':!![]});if(!_0x5bc299)throw new Error(_0x3c1c('0x40'));if(_0x5bc299['role']===_0x3c1c('0x3f')){var _0x3a74c6=_0x4f452c[_0x3c1c('0x1e')]({'plain':!![]});var _0x1dd23e='Companies';return db[_0x3c1c('0x41')]['find']({'where':{'name':_0x1dd23e,'userProfileId':_0x5bc299['userProfileId']},'raw':!![]})['then'](function(_0x3c74d3){if(_0x3c74d3&&_0x3c74d3[_0x3c1c('0x42')]===0x0){return db[_0x3c1c('0x43')][_0x3c1c('0x3d')]({'name':_0x3a74c6['name'],'resourceId':_0x3a74c6['id'],'type':_0x3c74d3[_0x3c1c('0x23')],'sectionId':_0x3c74d3['id']},{})[_0x3c1c('0x1c')](function(){return _0x4f452c;});}else{return _0x4f452c;}})[_0x3c1c('0x37')](function(_0xccd49d){logger[_0x3c1c('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xccd49d);throw _0xccd49d;});}return _0x4f452c;})[_0x3c1c('0x1c')](respondWithResult(_0x15dfe6,0xc9))['catch'](handleError(_0x15dfe6,null));};exports['update']=function(_0x4f5971,_0x5929bb){if(_0x4f5971[_0x3c1c('0x3e')]['id']){delete _0x4f5971[_0x3c1c('0x3e')]['id'];}return db[_0x3c1c('0x24')]['find']({'where':{'id':_0x4f5971[_0x3c1c('0x39')]['id']}})[_0x3c1c('0x1c')](handleEntityNotFound(_0x5929bb,null))[_0x3c1c('0x1c')](saveUpdates(_0x4f5971[_0x3c1c('0x3e')],null))[_0x3c1c('0x1c')](respondWithResult(_0x5929bb,null))[_0x3c1c('0x37')](handleError(_0x5929bb,null));};exports[_0x3c1c('0x1d')]=function(_0x7ac4aa,_0x2eec99){return db[_0x3c1c('0x24')][_0x3c1c('0x3c')]({'where':{'id':_0x7ac4aa[_0x3c1c('0x39')]['id']}})[_0x3c1c('0x1c')](handleEntityNotFound(_0x2eec99,null))[_0x3c1c('0x1c')](removeEntity(_0x2eec99,null))[_0x3c1c('0x37')](handleError(_0x2eec99,null));};exports[_0x3c1c('0x25')]=function(_0x2f1ec3,_0x14059e){return db['CmCompany']['describe']()['then'](respondWithResult(_0x14059e,null))[_0x3c1c('0x37')](handleError(_0x14059e,null));};exports['addContacts']=function(_0x24acc6,_0x8bf53a,_0x4c5d15){return db[_0x3c1c('0x44')][_0x3c1c('0x3c')]({'where':{'id':_0x24acc6[_0x3c1c('0x39')]['id']}})[_0x3c1c('0x1c')](handleEntityNotFound(_0x8bf53a,null))['then'](function(_0x482063){if(_0x482063){return _0x482063[_0x3c1c('0x45')](_0x24acc6[_0x3c1c('0x3e')][_0x3c1c('0x46')],_[_0x3c1c('0x47')](_0x24acc6['body'],['ids','id'])||{});}})[_0x3c1c('0x1c')](respondWithResult(_0x8bf53a,null))[_0x3c1c('0x37')](handleError(_0x8bf53a,null));};exports[_0x3c1c('0x48')]=function(_0x22f4d0,_0x3b55c4,_0x4e8211){var _0x488425={};var _0x3d556f={};var _0x384c30;var _0xae7625;return db[_0x3c1c('0x24')][_0x3c1c('0x49')]({'where':{'id':_0x22f4d0[_0x3c1c('0x39')]['id']}})[_0x3c1c('0x1c')](handleEntityNotFound(_0x3b55c4,null))['then'](function(_0x4a15f9){if(_0x4a15f9){_0x384c30=_0x4a15f9;_0x3d556f['model']=_[_0x3c1c('0x27')](db[_0x3c1c('0x44')][_0x3c1c('0x3a')]);_0x3d556f[_0x3c1c('0x28')]=_[_0x3c1c('0x27')](_0x22f4d0['query']);_0x3d556f[_0x3c1c('0x29')]=_['intersection'](_0x3d556f[_0x3c1c('0x26')],_0x3d556f[_0x3c1c('0x28')]);_0x488425[_0x3c1c('0x2b')]=_['intersection'](_0x3d556f[_0x3c1c('0x26')],qs[_0x3c1c('0x2c')](_0x22f4d0[_0x3c1c('0x28')][_0x3c1c('0x2c')]));_0x488425['attributes']=_0x488425[_0x3c1c('0x2b')][_0x3c1c('0x3b')]?_0x488425[_0x3c1c('0x2b')]:_0x3d556f['model'];_0x488425[_0x3c1c('0x2f')]=qs[_0x3c1c('0x30')](_0x22f4d0[_0x3c1c('0x28')]['sort']);_0x488425[_0x3c1c('0x31')]=qs[_0x3c1c('0x29')](_[_0x3c1c('0x32')](_0x22f4d0['query'],_0x3d556f['filters']));if(_0x22f4d0[_0x3c1c('0x28')][_0x3c1c('0x34')]){_0x488425[_0x3c1c('0x31')]=_[_0x3c1c('0x33')](_0x488425[_0x3c1c('0x31')],{'$or':_[_0x3c1c('0x4a')](_0x488425['attributes'],function(_0x4e3429){var _0x45e140={};_0x45e140[_0x4e3429]={'$like':'%'+_0x22f4d0[_0x3c1c('0x28')][_0x3c1c('0x34')]+'%'};return _0x45e140;})});}_0x488425=_[_0x3c1c('0x33')]({},_0x488425,_0x22f4d0[_0x3c1c('0x4b')]);return _0x384c30[_0x3c1c('0x48')](_0x488425);}})[_0x3c1c('0x1c')](function(_0x4be2f2){if(_0x4be2f2){_0xae7625=_0x4be2f2[_0x3c1c('0x3b')];if(!_0x22f4d0[_0x3c1c('0x28')][_0x3c1c('0x2d')](_0x3c1c('0x2e'))){_0x488425['limit']=qs[_0x3c1c('0x17')](_0x22f4d0[_0x3c1c('0x28')]['limit']);_0x488425[_0x3c1c('0x16')]=qs[_0x3c1c('0x16')](_0x22f4d0[_0x3c1c('0x28')][_0x3c1c('0x16')]);}return _0x384c30['getContacts'](_0x488425);}})[_0x3c1c('0x1c')](function(_0x1b91f6){if(_0x1b91f6){return _0x1b91f6?{'count':_0xae7625,'rows':_0x1b91f6}:null;}})[_0x3c1c('0x1c')](respondWithResult(_0x3b55c4,null))[_0x3c1c('0x37')](handleError(_0x3b55c4,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 2283a65..cabd417 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 _0xe5b3=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','util','../../config/logger','api','moment','bluebird'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4200e3,_0xb34e23){_0x4200e3=_0x4200e3-0x0;var _0x26ac37=_0xe5b3[_0x4200e3];return _0x26ac37;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('CmCompany',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x093a=['CmCompany','cm_companies','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x093a,0x16a));var _0xa093=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x093a[_0x4f6f84];return _0x20d989;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'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 0c70f44..5e25ed0 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 _0x5e52=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x57e5fa,_0x579542){var _0x4d8b97=function(_0xfc24f5){while(--_0xfc24f5){_0x57e5fa['push'](_0x57e5fa['shift']());}};_0x4d8b97(++_0x579542);}(_0x5e52,0xd0));var _0x25e5=function(_0x4b9827,_0x25aa8b){_0x4b9827=_0x4b9827-0x0;var _0x25a0ad=_0x5e52[_0x4b9827];return _0x25a0ad;};'use strict';var _=require(_0x25e5('0x0'));var util=require(_0x25e5('0x1'));var moment=require(_0x25e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x25e5('0x3'));var fs=require('fs');var Redis=require(_0x25e5('0x4'));var db=require(_0x25e5('0x5'))['db'];var utils=require(_0x25e5('0x6'));var logger=require(_0x25e5('0x7'))(_0x25e5('0x8'));var config=require(_0x25e5('0x9'));var jayson=require(_0x25e5('0xa'));var client=jayson[_0x25e5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29670b,_0x397faf,_0x5b2167){return new BPromise(function(_0x4b6f96,_0x336c17){return client['request'](_0x29670b,_0x5b2167)['then'](function(_0x49e1f4){logger[_0x25e5('0xc')](_0x25e5('0xd'),_0x397faf,_0x25e5('0xe'));logger[_0x25e5('0xf')](_0x25e5('0x10'),_0x397faf,_0x25e5('0xe'),JSON[_0x25e5('0x11')](_0x49e1f4));if(_0x49e1f4[_0x25e5('0x12')]){if(_0x49e1f4[_0x25e5('0x12')][_0x25e5('0x13')]===0x1f4){logger[_0x25e5('0x12')](_0x25e5('0xd'),_0x397faf,_0x49e1f4[_0x25e5('0x12')][_0x25e5('0x14')]);return _0x336c17(_0x49e1f4[_0x25e5('0x12')][_0x25e5('0x14')]);}logger['error'](_0x25e5('0xd'),_0x397faf,_0x49e1f4['error']['message']);return _0x4b6f96(_0x49e1f4['error']['message']);}else{logger[_0x25e5('0xc')]('CmCompany,\x20%s,\x20%s',_0x397faf,_0x25e5('0xe'));_0x4b6f96(_0x49e1f4[_0x25e5('0x15')][_0x25e5('0x14')]);}})[_0x25e5('0x16')](function(_0x52d8b7){logger[_0x25e5('0x12')](_0x25e5('0xd'),_0x397faf,_0x52d8b7);_0x336c17(_0x52d8b7);});});} \ No newline at end of file +var _0xa2af=['../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x42c33c,_0x2d187d){var _0x4928a2=function(_0x16c404){while(--_0x16c404){_0x42c33c['push'](_0x42c33c['shift']());}};_0x4928a2(++_0x2d187d);}(_0xa2af,0x144));var _0xfa2a=function(_0x889b01,_0x4995f8){_0x889b01=_0x889b01-0x0;var _0x1c865d=_0xa2af[_0x889b01];return _0x1c865d;};'use strict';var _=require(_0xfa2a('0x0'));var util=require('util');var moment=require(_0xfa2a('0x1'));var BPromise=require(_0xfa2a('0x2'));var rs=require(_0xfa2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfa2a('0x5'));var config=require(_0xfa2a('0x6'));var jayson=require(_0xfa2a('0x7'));var client=jayson[_0xfa2a('0x8')][_0xfa2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eec70,_0x5ba7d8,_0x3d7755){return new BPromise(function(_0x2c370a,_0x28b721){return client[_0xfa2a('0xa')](_0x4eec70,_0x3d7755)[_0xfa2a('0xb')](function(_0x56732e){logger['info'](_0xfa2a('0xc'),_0x5ba7d8,_0xfa2a('0xd'));logger[_0xfa2a('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5ba7d8,_0xfa2a('0xd'),JSON[_0xfa2a('0xf')](_0x56732e));if(_0x56732e[_0xfa2a('0x10')]){if(_0x56732e[_0xfa2a('0x10')][_0xfa2a('0x11')]===0x1f4){logger[_0xfa2a('0x10')](_0xfa2a('0xc'),_0x5ba7d8,_0x56732e[_0xfa2a('0x10')][_0xfa2a('0x12')]);return _0x28b721(_0x56732e[_0xfa2a('0x10')][_0xfa2a('0x12')]);}logger[_0xfa2a('0x10')](_0xfa2a('0xc'),_0x5ba7d8,_0x56732e[_0xfa2a('0x10')][_0xfa2a('0x12')]);return _0x2c370a(_0x56732e[_0xfa2a('0x10')][_0xfa2a('0x12')]);}else{logger[_0xfa2a('0x13')](_0xfa2a('0xc'),_0x5ba7d8,_0xfa2a('0xd'));_0x2c370a(_0x56732e[_0xfa2a('0x14')]['message']);}})[_0xfa2a('0x15')](function(_0x4b4b6a){logger[_0xfa2a('0x10')](_0xfa2a('0xc'),_0x5ba7d8,_0x4b4b6a);_0x28b721(_0x4b4b6a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index dc5cc6c..78c9011 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 _0x4c60=['index','/describe','describe','/:id','show','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','get','isAuthenticated'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4c60,0xc1));var _0x04c6=function(_0xcc351f,_0x5cbd76){_0xcc351f=_0xcc351f-0x0;var _0x20ec8b=_0x4c60[_0xcc351f];return _0x20ec8b;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x04c6('0x5')]('/',auth[_0x04c6('0x6')](),controller[_0x04c6('0x7')]);router[_0x04c6('0x5')](_0x04c6('0x8'),auth[_0x04c6('0x6')](),controller[_0x04c6('0x9')]);router['get'](_0x04c6('0xa'),auth[_0x04c6('0x6')](),controller[_0x04c6('0xb')]);router[_0x04c6('0x5')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x04c6('0xc')]('/',auth['isAuthenticated'](),controller[_0x04c6('0xd')]);router[_0x04c6('0xc')]('/:id/contacts',auth[_0x04c6('0x6')](),controller[_0x04c6('0xe')]);router[_0x04c6('0xf')](_0x04c6('0xa'),auth['isAuthenticated'](),controller[_0x04c6('0x10')]);router[_0x04c6('0x11')](_0x04c6('0xa'),auth['isAuthenticated'](),controller[_0x04c6('0x12')]);module[_0x04c6('0x13')]=router; \ No newline at end of file +var _0x2a07=['delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','create','post','/:id/contacts','put','update'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x2a07,0x74));var _0x72a0=function(_0x11008e,_0x3c9be6){_0x11008e=_0x11008e-0x0;var _0x4ae70d=_0x2a07[_0x11008e];return _0x4ae70d;};'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'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0x9')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x9')]('/:id/contacts',auth[_0x72a0('0xa')](),controller[_0x72a0('0x10')]);router['post']('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0x11')]);router[_0x72a0('0x12')](_0x72a0('0x13'),auth[_0x72a0('0xa')](),controller['addContacts']);router[_0x72a0('0x14')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0x15')]);router[_0x72a0('0x16')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 8886e5c..f1c82d0 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 _0xf375=['STRING','INTEGER','UNSIGNED','sequelize','exports'];(function(_0x250c70,_0x56fc70){var _0x1f8d04=function(_0x5af759){while(--_0x5af759){_0x250c70['push'](_0x250c70['shift']());}};_0x1f8d04(++_0x56fc70);}(_0xf375,0xc6));var _0x5f37=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf375[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var Sequelize=require(_0x5f37('0x0'));module[_0x5f37('0x1')]={'firstName':{'type':Sequelize[_0x5f37('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5f37('0x2')]},'street':{'type':Sequelize[_0x5f37('0x2')]},'postalCode':{'type':Sequelize[_0x5f37('0x2')]},'city':{'type':Sequelize[_0x5f37('0x2')]},'country':{'type':Sequelize[_0x5f37('0x2')]},'dateOfBirth':{'type':Sequelize[_0x5f37('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5f37('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5f37('0x2')]},'url':{'type':Sequelize[_0x5f37('0x2')]},'facebook':{'type':Sequelize[_0x5f37('0x2')]},'fb_data':{'type':Sequelize[_0x5f37('0x2')]},'twitter':{'type':Sequelize[_0x5f37('0x2')]},'skype':{'type':Sequelize[_0x5f37('0x2')]},'teams':{'type':Sequelize[_0x5f37('0x2')]},'viber':{'type':Sequelize[_0x5f37('0x2')]},'line':{'type':Sequelize[_0x5f37('0x2')]},'wechat':{'type':Sequelize[_0x5f37('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x5f37('0x3')]},'priority':{'type':Sequelize[_0x5f37('0x3')](0x2)[_0x5f37('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x8bc8=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x201f1b,_0x14ed3c){var _0x437df5=function(_0x7ea38c){while(--_0x7ea38c){_0x201f1b['push'](_0x201f1b['shift']());}};_0x437df5(++_0x14ed3c);}(_0x8bc8,0xac));var _0x88bc=function(_0x265f6d,_0x2a38a5){_0x265f6d=_0x265f6d-0x0;var _0x317995=_0x8bc8[_0x265f6d];return _0x317995;};'use strict';var _=require(_0x88bc('0x0'));var Sequelize=require(_0x88bc('0x1'));module[_0x88bc('0x2')]={'firstName':{'type':Sequelize[_0x88bc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x88bc('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x88bc('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x88bc('0x3')]},'dateOfBirth':{'type':Sequelize[_0x88bc('0x3')]},'description':{'type':Sequelize[_0x88bc('0x4')]},'phone':{'type':Sequelize[_0x88bc('0x3')]},'mobile':{'type':Sequelize[_0x88bc('0x3')]},'fax':{'type':Sequelize[_0x88bc('0x3')]},'email':{'type':Sequelize[_0x88bc('0x3')]},'url':{'type':Sequelize[_0x88bc('0x3')]},'facebook':{'type':Sequelize[_0x88bc('0x3')]},'fb_data':{'type':Sequelize[_0x88bc('0x3')]},'twitter':{'type':Sequelize[_0x88bc('0x3')]},'skype':{'type':Sequelize[_0x88bc('0x3')]},'teams':{'type':Sequelize[_0x88bc('0x3')]},'viber':{'type':Sequelize[_0x88bc('0x3')]},'line':{'type':Sequelize[_0x88bc('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x88bc('0x3')]},'UserId':{'type':Sequelize[_0x88bc('0x5')]},'priority':{'type':Sequelize[_0x88bc('0x5')](0x2)[_0x88bc('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x88bc('0x7')],'defaultValue':Sequelize[_0x88bc('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 56feb0e..686d04f 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 _0x25e4=['FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','duplicates','$or','findOrCreate','spread','show','params','$and','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','options','setTags','ids','getHoppers','include','includeAll','getHopperFinals','ContactId','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','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','File\x20uploaded\x20correctly!','pid','createReadStream','meta','agent','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','field','color','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','buildExpression','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','\x27\x27\x27\x27','split','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','clone','order','DESC','having','user','getLists','map','sequelize','toString','merge','c.lastName','c.mobile','c.fax','c.email','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','push','rows','catch','tags','columnName','findAll','displayName','alias','custom','values','body','from','get','mergeWith','join','info','CmHopper','destroy','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage'];(function(_0x37dd9d,_0x317c54){var _0x33ec83=function(_0x243af0){while(--_0x243af0){_0x37dd9d['push'](_0x37dd9d['shift']());}};_0x33ec83(++_0x317c54);}(_0x25e4,0x135));var _0x425e=function(_0x1663ea,_0x3c503f){_0x1663ea=_0x1663ea-0x0;var _0x4420bd=_0x25e4[_0x1663ea];return _0x4420bd;};'use strict';var pdf=require(_0x425e('0x0'));var emlformat=require(_0x425e('0x1'));var rimraf=require(_0x425e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x425e('0x3'));var rp=require('request-promise');var moment=require(_0x425e('0x4'));var BPromise=require(_0x425e('0x5'));var Mustache=require(_0x425e('0x6'));var util=require(_0x425e('0x7'));var path=require(_0x425e('0x8'));var sox=require(_0x425e('0x9'));var csv=require(_0x425e('0xa'));var ejs=require(_0x425e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x425e('0xc'));var deskjs=require(_0x425e('0xd'));var toCsv=require(_0x425e('0xa'));var querystring=require(_0x425e('0xe'));var Papa=require(_0x425e('0xf'));var Redis=require(_0x425e('0x10'));var authService=require(_0x425e('0x11'));var qs=require(_0x425e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x425e('0x13'))(_0x425e('0x14'));var utils=require(_0x425e('0x15'));var config=require(_0x425e('0x16'));var db=require(_0x425e('0x17'))['db'];config['redis']=_[_0x425e('0x18')](config[_0x425e('0x19')],{'host':_0x425e('0x1a'),'port':0x18eb});var socket=require(_0x425e('0x1b'))(new Redis(config[_0x425e('0x19')]));require('./cmContact.socket')[_0x425e('0x1c')](socket);function respondWithStatusCode(_0x1edddf,_0x4b7a57){_0x4b7a57=_0x4b7a57||0xcc;return function(_0xc89630){if(_0xc89630){return _0x1edddf['sendStatus'](_0x4b7a57);}return _0x1edddf['status'](_0x4b7a57)[_0x425e('0x1d')]();};}function respondWithResult(_0x4cfa8c,_0x3b1499){_0x3b1499=_0x3b1499||0xc8;return function(_0x1de075){if(_0x1de075){return _0x4cfa8c[_0x425e('0x1e')](_0x3b1499)[_0x425e('0x1f')](_0x1de075);}};}function respondWithFilteredResult(_0x100707,_0x33260d){return function(_0x494f93){if(_0x494f93){var _0x463540=_0x494f93[_0x425e('0x20')],_0x421e72=_0x33260d[_0x425e('0x21')],_0x1770fe=_0x33260d[_0x425e('0x21')]+_0x33260d[_0x425e('0x22')],_0x563580;if(_0x1770fe>=_0x463540){_0x1770fe=_0x463540;_0x563580=0xc8;}else{_0x563580=0xce;}_0x100707[_0x425e('0x1e')](_0x563580);return _0x100707[_0x425e('0x23')](_0x425e('0x24'),_0x421e72+'-'+_0x1770fe+'/'+_0x463540)[_0x425e('0x1f')](_0x494f93);}return null;};}function patchUpdates(_0x46679b){return function(_0x431435){try{jsonpatch[_0x425e('0x25')](_0x431435,_0x46679b,!![]);}catch(_0x2fa794){return BPromise[_0x425e('0x26')](_0x2fa794);}return _0x431435[_0x425e('0x27')]();};}function saveUpdates(_0x23bff7,_0x1b2a97){return function(_0xa47968){if(_0xa47968){return _0xa47968['update'](_0x23bff7)['then'](function(_0x12f7a8){return _0x12f7a8;});}return null;};}function removeEntity(_0xfa2fda,_0x13a436){return function(_0x23d26c){if(_0x23d26c){return _0x23d26c['destroy']()[_0x425e('0x28')](function(){_0xfa2fda['status'](0xcc)[_0x425e('0x1d')]();});}};}function handleEntityNotFound(_0x2d310f,_0x5006a0){return function(_0x3089b9){if(!_0x3089b9){_0x2d310f[_0x425e('0x29')](0x194);}return _0x3089b9;};}function handleError(_0x3e6c3f,_0x2f4e7e){_0x2f4e7e=_0x2f4e7e||0x1f4;return function(_0x29be57){logger[_0x425e('0x2a')](_0x29be57[_0x425e('0x2b')]);if(_0x29be57['name']){delete _0x29be57[_0x425e('0x2c')];}_0x3e6c3f['status'](_0x2f4e7e)[_0x425e('0x2d')](_0x29be57);};}exports['index']=function(_0xe91df4,_0x81b580){var _0x2ba466={},_0x227e15={},_0x11e15d={'count':0x0,'rows':[]};return db[_0x425e('0x2e')][_0x425e('0x2f')]()[_0x425e('0x28')](function(_0x12377c){var _0x5408b8=[];for(var _0x549837=0x0;_0x5498370x1){_0x2f6ce8['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x425e('0x6e')](_0x49e025),null);}else{if(qs[_0x425e('0x6f')](_0x49e025)){_0x2f6ce8['or'](_0x425e('0x70'),_0x49e025+'%');_0x2f6ce8['or'](_0x425e('0x71'),_0x49e025+'%');_0x2f6ce8['or'](_0x425e('0x72'),_0x49e025+'%');_0x2f6ce8['or']('c.fax\x20LIKE\x20?',_0x49e025+'%');}else if(qs['isEmail'](_0x49e025)){_0x2f6ce8['or'](_0x425e('0x73'),_0x49e025+'%');}else{_0x2f6ce8['or'](_0x425e('0x74'),'%'+_0x49e025+'%');_0x2f6ce8['or'](_0x425e('0x75'),'%'+_0x49e025+'%');_0x2f6ce8['or'](_0x425e('0x73'),'%'+_0x49e025+'%');}}}}_0x427c70[_0x425e('0x4c')](_0x2f6ce8);_0x427c70[_0x425e('0x76')](_0x425e('0x77'));var _0x547799={'type':db[_0x425e('0x78')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3683e5=_0x427c70[_0x425e('0x79')]()['field'](_0x425e('0x77'));if(_0x2ba466[_0x425e('0x7a')]){_0x2ba466[_0x425e('0x7a')][_0x425e('0x55')](function(_0x21a427){_0x427c70[_0x425e('0x7a')]('c.'+_0x21a427[0x0],_0x21a427[0x1]===_0x425e('0x7b')?![]:!![]);});}if(!_[_0x425e('0x63')](_0x28e041)){_0x427c70[_0x425e('0x7c')](_0x5830b2);_0x3683e5[_0x425e('0x4c')]('t.id\x20IN\x20?',_0x28e041);}BPromise['resolve']()[_0x425e('0x28')](function(){if(!_0x275112)return;return _0xe91df4[_0x425e('0x7d')][_0x425e('0x7e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e0ecf){_0x3683e5[_0x425e('0x4c')]('c.ListId\x20IN\x20?',_[_0x425e('0x7f')](_0x3e0ecf,'id'));_0x427c70[_0x425e('0x4c')](_0x425e('0x65'),_[_0x425e('0x7f')](_0x3e0ecf,'id'));});})[_0x425e('0x28')](function(){db[_0x425e('0x80')][_0x425e('0x3a')](_0x3683e5[_0x425e('0x81')](),_0x547799)['then'](function(_0x2a9f61){_0x11e15d[_0x425e('0x20')]=_0x2a9f61[_0x425e('0x31')];if(_0x11e15d[_0x425e('0x20')]===0x0)return[];return db[_0x425e('0x80')][_0x425e('0x3a')](_0xa6a199['toString'](),_0x547799);})[_0x425e('0x28')](function(_0x44cd0c){_0x5bad9d=_['keyBy'](_0x44cd0c,'id');_0x547799=_[_0x425e('0x82')](_0x547799,{'model':db[_0x425e('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x427c70[_0x425e('0x43')](_0x425e('0x77'));_0x427c70[_0x425e('0x43')]('c.firstName');_0x427c70['field'](_0x425e('0x83'));_0x427c70['field']('c.phone');_0x427c70['field'](_0x425e('0x84'));_0x427c70[_0x425e('0x43')](_0x425e('0x85'));_0x427c70[_0x425e('0x43')](_0x425e('0x86'));_0x427c70[_0x425e('0x43')]('c.ListId');_0x427c70[_0x425e('0x43')](_0x425e('0x87'));_0x427c70[_0x425e('0x43')](_0x425e('0x88'),_0x425e('0x89'));if(_0x2ba466[_0x425e('0x22')])_0x427c70['limit'](_0x2ba466[_0x425e('0x22')]);if(_0x2ba466['offset'])_0x427c70[_0x425e('0x21')](_0x2ba466[_0x425e('0x21')]);return db['sequelize'][_0x425e('0x3a')](_0x427c70[_0x425e('0x81')](),_0x547799);})[_0x425e('0x28')](function(_0x2fcba0){_0x2fcba0[_0x425e('0x55')](function(_0x4cb482){if(_0x4cb482[_0x425e('0x89')]){_0x4cb482[_0x425e('0x8a')]=[];_0x4cb482[_0x425e('0x89')][_0x425e('0x6d')](',')[_0x425e('0x55')](function(_0x2df8b8){_0x4cb482[_0x425e('0x8a')][_0x425e('0x8b')](_0x5bad9d[_0x2df8b8]);});}delete _0x4cb482[_0x425e('0x89')];});_0x11e15d[_0x425e('0x8c')]=_0x2fcba0;return _0x11e15d;})[_0x425e('0x28')](respondWithFilteredResult(_0x81b580,_0x2ba466));})[_0x425e('0x8d')](handleError(_0x81b580,null));});};exports['destroy']=function(_0x4dfe21,_0x419ca8){return db[_0x425e('0x2e')]['find']({'where':{'id':_0x4dfe21['params']['id']}})['then'](handleEntityNotFound(_0x419ca8,null))[_0x425e('0x28')](removeEntity(_0x419ca8,null))['catch'](handleError(_0x419ca8,null));};exports[_0x425e('0x2f')]=function(_0x29f5dd,_0x437935){return db['CmContact'][_0x425e('0x2f')]()[_0x425e('0x28')](function(_0x13942d){delete _0x13942d[_0x425e('0x8e')];for(var _0x5b9511=0x0;_0x5b9511=_0x3884c7){_0x10a51f=_0x3884c7;_0x57a9e7=0xc8;}else{_0x57a9e7=0xce;}_0x475ce1[_0x80bc('0x1d')](_0x57a9e7);return _0x475ce1[_0x80bc('0x23')]('Content-Range',_0x31e508+'-'+_0x10a51f+'/'+_0x3884c7)[_0x80bc('0x1f')](_0x1bc892);}return null;};}function patchUpdates(_0x2233f2){return function(_0x1e9e63){try{jsonpatch[_0x80bc('0x24')](_0x1e9e63,_0x2233f2,!![]);}catch(_0x1a9e9c){return BPromise[_0x80bc('0x25')](_0x1a9e9c);}return _0x1e9e63['save']();};}function saveUpdates(_0x2837fa,_0x4eb9af){return function(_0x36b340){if(_0x36b340){return _0x36b340[_0x80bc('0x26')](_0x2837fa)[_0x80bc('0x27')](function(_0x18c75b){return _0x18c75b;});}return null;};}function removeEntity(_0x28192a,_0x56a6c0){return function(_0xdea041){if(_0xdea041){return _0xdea041[_0x80bc('0x28')]()[_0x80bc('0x27')](function(){_0x28192a[_0x80bc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x213f0e,_0x2c8354){return function(_0x3121ea){if(!_0x3121ea){_0x213f0e[_0x80bc('0x1c')](0x194);}return _0x3121ea;};}function handleError(_0x39692b,_0x2c785f){_0x2c785f=_0x2c785f||0x1f4;return function(_0x1fea84){logger[_0x80bc('0x29')](_0x1fea84[_0x80bc('0x2a')]);if(_0x1fea84[_0x80bc('0x2b')]){delete _0x1fea84[_0x80bc('0x2b')];}_0x39692b[_0x80bc('0x1d')](_0x2c785f)[_0x80bc('0x2c')](_0x1fea84);};}exports['index']=function(_0x365f13,_0x3f3ce7){var _0x4bdfcf={},_0x4fb6e3={},_0x4a63e5={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x80bc('0x27')](function(_0x912c42){var _0x554257=[];for(var _0x38e2fa=0x0;_0x38e2fa0x1){_0x6b1126['or'](_0x80bc('0x64'),qs[_0x80bc('0x65')](_0x40453e),null);}else{if(qs[_0x80bc('0x66')](_0x40453e)){_0x6b1126['or'](_0x80bc('0x67'),_0x40453e+'%');_0x6b1126['or'](_0x80bc('0x68'),_0x40453e+'%');_0x6b1126['or'](_0x80bc('0x69'),_0x40453e+'%');_0x6b1126['or'](_0x80bc('0x6a'),_0x40453e+'%');}else if(qs['isEmail'](_0x40453e)){_0x6b1126['or'](_0x80bc('0x6b'),_0x40453e+'%');}else{_0x6b1126['or'](_0x80bc('0x6c'),'%'+_0x40453e+'%');_0x6b1126['or'](_0x80bc('0x6d'),'%'+_0x40453e+'%');_0x6b1126['or'](_0x80bc('0x6b'),'%'+_0x40453e+'%');}}}}_0x813ed3[_0x80bc('0x47')](_0x6b1126);_0x813ed3['group'](_0x80bc('0x6e'));var _0x17a81f={'type':db[_0x80bc('0x6f')][_0x80bc('0x70')][_0x80bc('0x71')],'raw':!![]};var _0x15d6bd=_0x813ed3[_0x80bc('0x72')]()['field']('c.id');if(_0x4bdfcf[_0x80bc('0x3c')]){_0x4bdfcf[_0x80bc('0x3c')]['forEach'](function(_0x4894d7){_0x813ed3[_0x80bc('0x3c')]('c.'+_0x4894d7[0x0],_0x4894d7[0x1]===_0x80bc('0x73')?![]:!![]);});}if(!_[_0x80bc('0x5b')](_0x48554e)){_0x813ed3['having'](_0x3463bf);_0x15d6bd[_0x80bc('0x47')](_0x80bc('0x74'),_0x48554e);}BPromise[_0x80bc('0x75')]()[_0x80bc('0x27')](function(){if(!_0x36fddd)return;return _0x365f13['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x80bc('0x27')](function(_0x372910){_0x15d6bd[_0x80bc('0x47')](_0x80bc('0x5d'),_[_0x80bc('0x50')](_0x372910,'id'));_0x813ed3[_0x80bc('0x47')](_0x80bc('0x5d'),_[_0x80bc('0x50')](_0x372910,'id'));});})[_0x80bc('0x27')](function(){db[_0x80bc('0x76')][_0x80bc('0x36')](_0x15d6bd[_0x80bc('0x77')](),_0x17a81f)[_0x80bc('0x27')](function(_0xbc2e91){_0x4a63e5[_0x80bc('0x20')]=_0xbc2e91[_0x80bc('0x2e')];if(_0x4a63e5[_0x80bc('0x20')]===0x0)return[];return db[_0x80bc('0x76')][_0x80bc('0x36')](_0x41409c[_0x80bc('0x77')](),_0x17a81f);})[_0x80bc('0x27')](function(_0x3346fd){_0x577938=_[_0x80bc('0x78')](_0x3346fd,'id');_0x17a81f=_[_0x80bc('0x79')](_0x17a81f,{'model':db[_0x80bc('0x7a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x813ed3[_0x80bc('0x3f')](_0x80bc('0x6e'));_0x813ed3['field'](_0x80bc('0x7b'));_0x813ed3[_0x80bc('0x3f')]('c.lastName');_0x813ed3[_0x80bc('0x3f')](_0x80bc('0x7c'));_0x813ed3[_0x80bc('0x3f')]('c.mobile');_0x813ed3['field'](_0x80bc('0x7d'));_0x813ed3[_0x80bc('0x3f')](_0x80bc('0x7e'));_0x813ed3[_0x80bc('0x3f')](_0x80bc('0x7f'));_0x813ed3[_0x80bc('0x3f')](_0x80bc('0x80'));_0x813ed3['field'](_0x80bc('0x81'),_0x80bc('0x82'));if(_0x4bdfcf[_0x80bc('0x22')])_0x813ed3[_0x80bc('0x22')](_0x4bdfcf['limit']);if(_0x4bdfcf['offset'])_0x813ed3[_0x80bc('0x21')](_0x4bdfcf[_0x80bc('0x21')]);return db[_0x80bc('0x76')]['query'](_0x813ed3[_0x80bc('0x77')](),_0x17a81f);})[_0x80bc('0x27')](function(_0x5758be){_0x5758be[_0x80bc('0x5c')](function(_0x5cb6c8){if(_0x5cb6c8[_0x80bc('0x82')]){_0x5cb6c8[_0x80bc('0x83')]=[];_0x5cb6c8['TagIds'][_0x80bc('0x84')](',')[_0x80bc('0x5c')](function(_0xf70aa1){_0x5cb6c8['Tags']['push'](_0x577938[_0xf70aa1]);});}delete _0x5cb6c8['TagIds'];});_0x4a63e5[_0x80bc('0x85')]=_0x5758be;return _0x4a63e5;})[_0x80bc('0x27')](respondWithFilteredResult(_0x3f3ce7,_0x4bdfcf));})['catch'](handleError(_0x3f3ce7,null));});};exports[_0x80bc('0x28')]=function(_0x42e244,_0x190516){return db[_0x80bc('0x7a')]['find']({'where':{'id':_0x42e244['params']['id']}})['then'](handleEntityNotFound(_0x190516,null))[_0x80bc('0x27')](removeEntity(_0x190516,null))['catch'](handleError(_0x190516,null));};exports[_0x80bc('0x86')]=function(_0x33f093,_0x4b1ff6){return db[_0x80bc('0x7a')][_0x80bc('0x86')]()['then'](function(_0x39ff70){delete _0x39ff70['tags'];for(var _0x1518e2=0x0;_0x1518e2{}\s\\|]/g,'-');_0x2ab57c(null,util['format'](_0x5dbf('0x1c'),path[_0x5dbf('0x1d')](_0x358d46[_0x5dbf('0x1a')],path[_0x5dbf('0x1e')](_0x358d46[_0x5dbf('0x1a')])),Date[_0x5dbf('0x1f')](),path['extname'](_0x358d46[_0x5dbf('0x1a')])));}})});router[_0x5dbf('0x13')](_0x5dbf('0x20'),upload[_0x5dbf('0x21')](_0x5dbf('0x22')),controller[_0x5dbf('0x23')]);var upload=multer({'storage':multer[_0x5dbf('0x18')]({'destination':function(_0x20ab1b,_0x42f13b,_0x15a790){_0x15a790(null,path[_0x5dbf('0x24')](config[_0x5dbf('0x25')],_0x5dbf('0x19')));},'filename':function(_0x407741,_0x729d8f,_0x17f135){_0x729d8f[_0x5dbf('0x1a')]=_0x729d8f[_0x5dbf('0x1a')][_0x5dbf('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17f135(null,util[_0x5dbf('0x26')](_0x5dbf('0x1c'),path[_0x5dbf('0x1d')](_0x729d8f[_0x5dbf('0x1a')],path['extname'](_0x729d8f[_0x5dbf('0x1a')])),Date[_0x5dbf('0x1f')](),path[_0x5dbf('0x1e')](_0x729d8f[_0x5dbf('0x1a')])));}})});router[_0x5dbf('0x13')](_0x5dbf('0x27'),upload[_0x5dbf('0x21')](_0x5dbf('0x22')),controller[_0x5dbf('0x28')]);router[_0x5dbf('0x13')](_0x5dbf('0x29'),auth['isAuthenticated'](),controller['import']);router[_0x5dbf('0x2a')](_0x5dbf('0xc'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x2b')]);router[_0x5dbf('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0x5dbf('0x2d')]);module[_0x5dbf('0x2e')]=router; \ No newline at end of file +var _0xa41a=['originalname','extname','/csv','single','file','now','/upload','upload','import','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','describe','isAuthenticated','show','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','replace','%s-%s%s','basename'];(function(_0x2c7bfe,_0x50d1f4){var _0x269182=function(_0x33bc8d){while(--_0x33bc8d){_0x2c7bfe['push'](_0x2c7bfe['shift']());}};_0x269182(++_0x50d1f4);}(_0xa41a,0x6b));var _0xaa41=function(_0x439c51,_0x5794b4){_0x439c51=_0x439c51-0x0;var _0x48fd56=_0xa41a[_0x439c51];return _0x48fd56;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var auth=require(_0xaa41('0x5'));var interaction=require(_0xaa41('0x6'));var config=require(_0xaa41('0x7'));var controller=require(_0xaa41('0x8'));router[_0xaa41('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa41('0xa')]);router[_0xaa41('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0x9')]('/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0xd')]);router[_0xaa41('0x9')](_0xaa41('0xe'),auth[_0xaa41('0xc')](),controller[_0xaa41('0xf')]);router[_0xaa41('0x9')](_0xaa41('0x10'),auth[_0xaa41('0xc')](),controller['getHoppers']);router[_0xaa41('0x9')](_0xaa41('0x11'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xaa41('0x9')]('/:id/hopper_finals',auth[_0xaa41('0xc')](),controller[_0xaa41('0x12')]);router[_0xaa41('0x9')](_0xaa41('0x13'),auth[_0xaa41('0xc')](),controller['getJscriptySessions']);router[_0xaa41('0x14')](_0xaa41('0x15'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x16')]);router[_0xaa41('0x14')]('/',auth[_0xaa41('0xc')](),controller[_0xaa41('0x17')]);router['post'](_0xaa41('0x18'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x19')]);router[_0xaa41('0x14')](_0xaa41('0xe'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x1a')]);var upload=multer({'storage':multer[_0xaa41('0x1b')]({'destination':function(_0x150ddf,_0x4fe1a4,_0x5cd936){_0x5cd936(null,path[_0xaa41('0x1c')](config[_0xaa41('0x1d')],_0xaa41('0x1e')));},'filename':function(_0x54c488,_0x2bf794,_0x1f692b){_0x2bf794['originalname']=_0x2bf794['originalname'][_0xaa41('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f692b(null,util['format'](_0xaa41('0x20'),path[_0xaa41('0x21')](_0x2bf794[_0xaa41('0x22')],path[_0xaa41('0x23')](_0x2bf794[_0xaa41('0x22')])),Date['now'](),path[_0xaa41('0x23')](_0x2bf794[_0xaa41('0x22')])));}})});router[_0xaa41('0x14')](_0xaa41('0x24'),upload[_0xaa41('0x25')](_0xaa41('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16aec5,_0x527cac,_0x493a10){_0x493a10(null,path[_0xaa41('0x1c')](config['root'],'server/files/tmp'));},'filename':function(_0x2d0ac0,_0x9c8c21,_0x392214){_0x9c8c21[_0xaa41('0x22')]=_0x9c8c21[_0xaa41('0x22')][_0xaa41('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x392214(null,util['format'](_0xaa41('0x20'),path[_0xaa41('0x21')](_0x9c8c21[_0xaa41('0x22')],path[_0xaa41('0x23')](_0x9c8c21[_0xaa41('0x22')])),Date[_0xaa41('0x27')](),path[_0xaa41('0x23')](_0x9c8c21[_0xaa41('0x22')])));}})});router['post'](_0xaa41('0x28'),upload['single']('file'),controller[_0xaa41('0x29')]);router[_0xaa41('0x14')]('/upload/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0x2a')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaa41('0x2b')]);router[_0xaa41('0x2c')](_0xaa41('0x2d'),auth[_0xaa41('0xc')](),controller['destroy']);module[_0xaa41('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 7392832..3a814f5 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 _0x3c6f=['parse','values','isArray','setDataValue','stringify','sequelize','lodash','exports','VIRTUAL','alias','STRING','getDataValue','name','TEXT','long','select'];(function(_0x2c43c2,_0x5cd72e){var _0x6176e3=function(_0x1c8002){while(--_0x1c8002){_0x2c43c2['push'](_0x2c43c2['shift']());}};_0x6176e3(++_0x5cd72e);}(_0x3c6f,0x145));var _0xf3c6=function(_0x4c35f0,_0x1f9ad9){_0x4c35f0=_0x4c35f0-0x0;var _0x2d8681=_0x3c6f[_0x4c35f0];return _0x2d8681;};'use strict';var Sequelize=require(_0xf3c6('0x0'));var _=require(_0xf3c6('0x1'));module[_0xf3c6('0x2')]={'name':{'type':Sequelize[_0xf3c6('0x3')],'get':function(_0x185da3){return this['getDataValue'](_0xf3c6('0x4'));}},'alias':{'type':Sequelize[_0xf3c6('0x5')],'allowNull':![],'set':function(_0x26fb67){this['setDataValue'](_0xf3c6('0x4'),_0x26fb67?_0x26fb67:this[_0xf3c6('0x6')](_0xf3c6('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xf3c6('0x8')](_0xf3c6('0x9')),'get':function(){if(this[_0xf3c6('0x6')]('type')===_0xf3c6('0xa')){return JSON[_0xf3c6('0xb')](this[_0xf3c6('0x6')](_0xf3c6('0xc')));}else{return this[_0xf3c6('0x6')](_0xf3c6('0xc'));}},'set':function(_0x375c81){if(Array[_0xf3c6('0xd')](_0x375c81)){this[_0xf3c6('0xe')]('values',JSON[_0xf3c6('0xf')](_0x375c81));}else{this['setDataValue']('values',_0x375c81);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x98e8=['select','parse','values','isArray','stringify','BOOLEAN','lodash','exports','VIRTUAL','setDataValue','alias','TEXT','long','getDataValue','type'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x98e8,0xba));var _0x898e=function(_0x569e07,_0x2548be){_0x569e07=_0x569e07-0x0;var _0xf06dcd=_0x98e8[_0x569e07];return _0xf06dcd;};'use strict';var Sequelize=require('sequelize');var _=require(_0x898e('0x0'));module[_0x898e('0x1')]={'name':{'type':Sequelize[_0x898e('0x2')],'get':function(_0xdc1abc){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5f337d){this[_0x898e('0x3')](_0x898e('0x4'),_0x5f337d?_0x5f337d:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x898e('0x5')](_0x898e('0x6')),'get':function(){if(this[_0x898e('0x7')](_0x898e('0x8'))===_0x898e('0x9')){return JSON[_0x898e('0xa')](this[_0x898e('0x7')](_0x898e('0xb')));}else{return this[_0x898e('0x7')](_0x898e('0xb'));}},'set':function(_0x1aa236){if(Array[_0x898e('0xc')](_0x1aa236)){this[_0x898e('0x3')]('values',JSON[_0x898e('0xd')](_0x1aa236));}else{this['setDataValue'](_0x898e('0xb'),_0x1aa236);}}},'required':{'type':Sequelize[_0x898e('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 54b680a..3f189ed 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 _0xe521=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','stack','name','index','map','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','CmCustomField','includeAll','include','rows','catch','show','rawAttributes','body','find','params','create','sequelize','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x573635,_0x32c407){var _0x29d949=function(_0x1320ca){while(--_0x1320ca){_0x573635['push'](_0x573635['shift']());}};_0x29d949(++_0x32c407);}(_0xe521,0x1a1));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x1e52('0x0'));var emlformat=require(_0x1e52('0x1'));var rimraf=require(_0x1e52('0x2'));var zipdir=require(_0x1e52('0x3'));var jsonpatch=require(_0x1e52('0x4'));var rp=require(_0x1e52('0x5'));var moment=require(_0x1e52('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1e52('0x7'));var util=require('util');var path=require(_0x1e52('0x8'));var sox=require(_0x1e52('0x9'));var csv=require(_0x1e52('0xa'));var ejs=require(_0x1e52('0xb'));var fs=require('fs');var _=require(_0x1e52('0xc'));var squel=require(_0x1e52('0xd'));var crypto=require(_0x1e52('0xe'));var jsforce=require(_0x1e52('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1e52('0xa'));var querystring=require('querystring');var Papa=require(_0x1e52('0x10'));var Redis=require(_0x1e52('0x11'));var authService=require(_0x1e52('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1e52('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e52('0x14'))(_0x1e52('0x15'));var utils=require(_0x1e52('0x16'));var config=require(_0x1e52('0x17'));var db=require(_0x1e52('0x18'))['db'];function respondWithStatusCode(_0x350cc9,_0x33b090){_0x33b090=_0x33b090||0xcc;return function(_0x2e790c){if(_0x2e790c){return _0x350cc9[_0x1e52('0x19')](_0x33b090);}return _0x350cc9[_0x1e52('0x1a')](_0x33b090)[_0x1e52('0x1b')]();};}function respondWithResult(_0x2afa7e,_0x127d31){_0x127d31=_0x127d31||0xc8;return function(_0x217e65){if(_0x217e65){return _0x2afa7e['status'](_0x127d31)[_0x1e52('0x1c')](_0x217e65);}};}function respondWithFilteredResult(_0xbae66,_0x247d4e){return function(_0x2ff784){if(_0x2ff784){var _0x3c99d3=_0x2ff784[_0x1e52('0x1d')],_0x4b60a3=_0x247d4e[_0x1e52('0x1e')],_0x4e2a9f=_0x247d4e['offset']+_0x247d4e[_0x1e52('0x1f')],_0x5bc98c;if(_0x4e2a9f>=_0x3c99d3){_0x4e2a9f=_0x3c99d3;_0x5bc98c=0xc8;}else{_0x5bc98c=0xce;}_0xbae66[_0x1e52('0x1a')](_0x5bc98c);return _0xbae66['set'](_0x1e52('0x20'),_0x4b60a3+'-'+_0x4e2a9f+'/'+_0x3c99d3)[_0x1e52('0x1c')](_0x2ff784);}return null;};}function patchUpdates(_0x280a32){return function(_0x4bf2f1){try{jsonpatch['apply'](_0x4bf2f1,_0x280a32,!![]);}catch(_0x120c9e){return BPromise[_0x1e52('0x21')](_0x120c9e);}return _0x4bf2f1['save']();};}function saveUpdates(_0x2599dc,_0x75b5dc){return function(_0x1860e8){if(_0x1860e8){return _0x1860e8[_0x1e52('0x22')](_0x2599dc)[_0x1e52('0x23')](function(_0x32f404){return _0x32f404;});}return null;};}function removeEntity(_0x52baec,_0x405ae3){return function(_0x45025d){if(_0x45025d){return _0x45025d[_0x1e52('0x24')]()['then'](function(){_0x52baec['status'](0xcc)[_0x1e52('0x1b')]();});}};}function handleEntityNotFound(_0x477082,_0x382505){return function(_0x2de1a8){if(!_0x2de1a8){_0x477082[_0x1e52('0x19')](0x194);}return _0x2de1a8;};}function handleError(_0x1a2865,_0x4bfbe1){_0x4bfbe1=_0x4bfbe1||0x1f4;return function(_0x158d6c){logger['error'](_0x158d6c[_0x1e52('0x25')]);if(_0x158d6c[_0x1e52('0x26')]){delete _0x158d6c[_0x1e52('0x26')];}_0x1a2865[_0x1e52('0x1a')](_0x4bfbe1)['send'](_0x158d6c);};}exports[_0x1e52('0x27')]=function(_0x2bb395,_0x2117a0){var _0xd8aafd={},_0x146d46={},_0x590b75={'count':0x0,'rows':[]};var _0x5b1d83=_[_0x1e52('0x28')](db['CmCustomField']['rawAttributes'],function(_0x121cdc){return{'name':_0x121cdc[_0x1e52('0x29')],'type':_0x121cdc[_0x1e52('0x2a')][_0x1e52('0x2b')]};});_0x146d46[_0x1e52('0x2c')]=_[_0x1e52('0x2d')](_[_0x1e52('0x28')](_0x5b1d83,_0x1e52('0x26')),[_0x1e52('0x26')]);_0x146d46[_0x1e52('0x2e')]=_[_0x1e52('0x2f')](_0x2bb395[_0x1e52('0x2e')]);_0x146d46['filters']=_[_0x1e52('0x30')](_0x146d46[_0x1e52('0x2c')],_0x146d46[_0x1e52('0x2e')]);_0xd8aafd[_0x1e52('0x31')]=_[_0x1e52('0x30')](_0x146d46[_0x1e52('0x2c')],qs[_0x1e52('0x32')](_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x32')]));_0xd8aafd[_0x1e52('0x31')]=_0xd8aafd[_0x1e52('0x31')][_0x1e52('0x33')]?_0xd8aafd[_0x1e52('0x31')]:_0x146d46['model'];if(!_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x34')](_0x1e52('0x35'))){_0xd8aafd[_0x1e52('0x1f')]=qs[_0x1e52('0x1f')](_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x1f')]);_0xd8aafd[_0x1e52('0x1e')]=qs[_0x1e52('0x1e')](_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x1e')]);}_0xd8aafd['order']=qs['sort'](_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x36')]);_0xd8aafd['where']=qs[_0x1e52('0x37')](_[_0x1e52('0x38')](_0x2bb395[_0x1e52('0x2e')],_0x146d46['filters']));if(_0x2bb395[_0x1e52('0x2e')]['filter']){_0xd8aafd[_0x1e52('0x39')]=_[_0x1e52('0x3a')](_0xd8aafd['where'],{'$or':_[_0x1e52('0x28')](_0x5b1d83,function(_0x326d72){if(_0x326d72[_0x1e52('0x2a')]!==_0x1e52('0x3b')){var _0x4d179b={};_0x4d179b[_0x326d72[_0x1e52('0x26')]]={'$like':'%'+_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x3c')]+'%'};return _0x4d179b;}})});}_0xd8aafd=_['merge']({},_0xd8aafd,_0x2bb395[_0x1e52('0x3d')]);var _0x2abde9={'where':_0xd8aafd[_0x1e52('0x39')]};return db[_0x1e52('0x3e')][_0x1e52('0x1d')](_0x2abde9)[_0x1e52('0x23')](function(_0x26f5f2){_0x590b75[_0x1e52('0x1d')]=_0x26f5f2;if(_0x2bb395[_0x1e52('0x2e')][_0x1e52('0x3f')]){_0xd8aafd[_0x1e52('0x40')]=[{'all':!![]}];}return db[_0x1e52('0x3e')]['findAll'](_0xd8aafd);})[_0x1e52('0x23')](function(_0x1794ec){_0x590b75[_0x1e52('0x41')]=_0x1794ec;return _0x590b75;})['then'](respondWithFilteredResult(_0x2117a0,_0xd8aafd))[_0x1e52('0x42')](handleError(_0x2117a0,null));};exports[_0x1e52('0x43')]=function(_0x31676e,_0x408127){var _0x40c219={'raw':!![],'where':{'id':_0x31676e['params']['id']}},_0x533d84={};_0x533d84[_0x1e52('0x2c')]=_[_0x1e52('0x2f')](db[_0x1e52('0x3e')][_0x1e52('0x44')]);_0x533d84['query']=_[_0x1e52('0x2f')](_0x31676e[_0x1e52('0x2e')]);_0x533d84[_0x1e52('0x37')]=_[_0x1e52('0x30')](_0x533d84[_0x1e52('0x2c')],_0x533d84[_0x1e52('0x2e')]);_0x40c219[_0x1e52('0x31')]=_[_0x1e52('0x30')](_0x533d84[_0x1e52('0x2c')],qs[_0x1e52('0x32')](_0x31676e[_0x1e52('0x2e')][_0x1e52('0x32')]));_0x40c219[_0x1e52('0x31')]=_0x40c219['attributes'][_0x1e52('0x33')]?_0x40c219[_0x1e52('0x31')]:_0x533d84[_0x1e52('0x2c')];if(_0x31676e[_0x1e52('0x2e')][_0x1e52('0x3f')]){_0x40c219['include']=[{'all':!![]}];}_0x40c219=_[_0x1e52('0x3a')]({},_0x40c219,_0x31676e[_0x1e52('0x3d')]);return db[_0x1e52('0x3e')]['find'](_0x40c219)[_0x1e52('0x23')](handleEntityNotFound(_0x408127,null))[_0x1e52('0x23')](respondWithResult(_0x408127,null))[_0x1e52('0x42')](handleError(_0x408127,null));};exports[_0x1e52('0x22')]=function(_0x5c8005,_0x29b65f){if(_0x5c8005[_0x1e52('0x45')]['id']){delete _0x5c8005[_0x1e52('0x45')]['id'];}return db[_0x1e52('0x3e')][_0x1e52('0x46')]({'where':{'id':_0x5c8005[_0x1e52('0x47')]['id']}})['then'](handleEntityNotFound(_0x29b65f,null))['then'](saveUpdates(_0x5c8005[_0x1e52('0x45')],null))[_0x1e52('0x23')](respondWithResult(_0x29b65f,null))[_0x1e52('0x42')](handleError(_0x29b65f,null));};exports['destroy']=function(_0x1d9490,_0x31d8c1){return db[_0x1e52('0x3e')]['find']({'where':{'id':_0x1d9490['params']['id']}})['then'](handleEntityNotFound(_0x31d8c1,null))[_0x1e52('0x23')](removeEntity(_0x31d8c1,null))[_0x1e52('0x42')](handleError(_0x31d8c1,null));};exports[_0x1e52('0x48')]=function(_0x2ecfda,_0x53be3e){var _0x2ce81b;return db[_0x1e52('0x49')]['transaction'](function(_0x240a40){return db['CmCustomField'][_0x1e52('0x48')](_0x2ecfda['body'],{'transaction':_0x240a40})['then'](function(_0x4ccbd4){_0x2ce81b=_0x4ccbd4;var _0x2a1590={'type':db['Sequelize'][_0x1e52('0x4a')],'transaction':_0x240a40};switch(_0x2ecfda[_0x1e52('0x45')][_0x1e52('0x2a')]){case _0x1e52('0x4b'):_0x2a1590[_0x1e52('0x2a')]=db[_0x1e52('0x4c')]['TEXT'];break;case _0x1e52('0x4d'):_0x2a1590['type']=db['Sequelize'][_0x1e52('0x4e')];break;case _0x1e52('0x4f'):_0x2a1590['type']=db[_0x1e52('0x4c')][_0x1e52('0x50')];_0x2a1590[_0x1e52('0x51')]=![];break;default:}return db[_0x1e52('0x49')]['queryInterface'][_0x1e52('0x52')]('cm_contacts',util[_0x1e52('0x53')](_0x1e52('0x54'),_0x2ce81b['id']),_0x2a1590);})[_0x1e52('0x23')](function(){return _0x2ce81b;});})[_0x1e52('0x23')](respondWithResult(_0x53be3e,0xc9))[_0x1e52('0x42')](handleError(_0x53be3e,null));}; \ No newline at end of file +var _0xd91a=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','create','sequelize','transaction','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd91a,0x187));var _0xad91=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd91a[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xad91('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xad91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad91('0x2'));var rp=require(_0xad91('0x3'));var moment=require('moment');var BPromise=require(_0xad91('0x4'));var Mustache=require(_0xad91('0x5'));var util=require(_0xad91('0x6'));var path=require(_0xad91('0x7'));var sox=require(_0xad91('0x8'));var csv=require(_0xad91('0x9'));var ejs=require(_0xad91('0xa'));var fs=require('fs');var _=require(_0xad91('0xb'));var squel=require(_0xad91('0xc'));var crypto=require('crypto');var jsforce=require(_0xad91('0xd'));var deskjs=require(_0xad91('0xe'));var toCsv=require(_0xad91('0x9'));var querystring=require(_0xad91('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xad91('0x10'));var qs=require(_0xad91('0x11'));var as=require(_0xad91('0x12'));var hardwareService=require(_0xad91('0x13'));var logger=require(_0xad91('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xad91('0x15'));var db=require(_0xad91('0x16'))['db'];function respondWithStatusCode(_0x3c6493,_0x507e66){_0x507e66=_0x507e66||0xcc;return function(_0x2b6b74){if(_0x2b6b74){return _0x3c6493[_0xad91('0x17')](_0x507e66);}return _0x3c6493[_0xad91('0x18')](_0x507e66)[_0xad91('0x19')]();};}function respondWithResult(_0x3be10a,_0xf398a6){_0xf398a6=_0xf398a6||0xc8;return function(_0x84bfb1){if(_0x84bfb1){return _0x3be10a[_0xad91('0x18')](_0xf398a6)[_0xad91('0x1a')](_0x84bfb1);}};}function respondWithFilteredResult(_0x401b1a,_0x4f4326){return function(_0x254620){if(_0x254620){var _0x2eeae4=_0x254620['count'],_0x53f14f=_0x4f4326[_0xad91('0x1b')],_0x1da886=_0x4f4326['offset']+_0x4f4326['limit'],_0x36bda7;if(_0x1da886>=_0x2eeae4){_0x1da886=_0x2eeae4;_0x36bda7=0xc8;}else{_0x36bda7=0xce;}_0x401b1a['status'](_0x36bda7);return _0x401b1a[_0xad91('0x1c')](_0xad91('0x1d'),_0x53f14f+'-'+_0x1da886+'/'+_0x2eeae4)['json'](_0x254620);}return null;};}function patchUpdates(_0x3f48ff){return function(_0x424ac7){try{jsonpatch[_0xad91('0x1e')](_0x424ac7,_0x3f48ff,!![]);}catch(_0x3b81bb){return BPromise[_0xad91('0x1f')](_0x3b81bb);}return _0x424ac7[_0xad91('0x20')]();};}function saveUpdates(_0x541fea,_0x4a978b){return function(_0x1023e1){if(_0x1023e1){return _0x1023e1[_0xad91('0x21')](_0x541fea)['then'](function(_0xf7d237){return _0xf7d237;});}return null;};}function removeEntity(_0x114713,_0x286978){return function(_0x3a9203){if(_0x3a9203){return _0x3a9203[_0xad91('0x22')]()[_0xad91('0x23')](function(){_0x114713[_0xad91('0x18')](0xcc)[_0xad91('0x19')]();});}};}function handleEntityNotFound(_0x155fb1,_0x409420){return function(_0x537447){if(!_0x537447){_0x155fb1[_0xad91('0x17')](0x194);}return _0x537447;};}function handleError(_0x4d2f6e,_0x3f3d9f){_0x3f3d9f=_0x3f3d9f||0x1f4;return function(_0x260946){logger[_0xad91('0x24')](_0x260946[_0xad91('0x25')]);if(_0x260946[_0xad91('0x26')]){delete _0x260946[_0xad91('0x26')];}_0x4d2f6e[_0xad91('0x18')](_0x3f3d9f)[_0xad91('0x27')](_0x260946);};}exports[_0xad91('0x28')]=function(_0x574dde,_0x4dc5d5){var _0x48c55f={},_0x4668fa={},_0x4971f5={'count':0x0,'rows':[]};var _0x316587=_[_0xad91('0x29')](db[_0xad91('0x2a')][_0xad91('0x2b')],function(_0x228cfd){return{'name':_0x228cfd[_0xad91('0x2c')],'type':_0x228cfd[_0xad91('0x2d')][_0xad91('0x2e')]};});_0x4668fa[_0xad91('0x2f')]=_['differenceBy'](_['map'](_0x316587,_0xad91('0x26')),['name']);_0x4668fa[_0xad91('0x30')]=_[_0xad91('0x31')](_0x574dde[_0xad91('0x30')]);_0x4668fa[_0xad91('0x32')]=_[_0xad91('0x33')](_0x4668fa[_0xad91('0x2f')],_0x4668fa[_0xad91('0x30')]);_0x48c55f[_0xad91('0x34')]=_[_0xad91('0x33')](_0x4668fa['model'],qs['fields'](_0x574dde[_0xad91('0x30')][_0xad91('0x35')]));_0x48c55f[_0xad91('0x34')]=_0x48c55f['attributes']['length']?_0x48c55f[_0xad91('0x34')]:_0x4668fa['model'];if(!_0x574dde[_0xad91('0x30')][_0xad91('0x36')](_0xad91('0x37'))){_0x48c55f[_0xad91('0x38')]=qs['limit'](_0x574dde[_0xad91('0x30')][_0xad91('0x38')]);_0x48c55f[_0xad91('0x1b')]=qs['offset'](_0x574dde['query'][_0xad91('0x1b')]);}_0x48c55f[_0xad91('0x39')]=qs['sort'](_0x574dde[_0xad91('0x30')][_0xad91('0x3a')]);_0x48c55f[_0xad91('0x3b')]=qs[_0xad91('0x32')](_[_0xad91('0x3c')](_0x574dde['query'],_0x4668fa[_0xad91('0x32')]));if(_0x574dde[_0xad91('0x30')][_0xad91('0x3d')]){_0x48c55f[_0xad91('0x3b')]=_[_0xad91('0x3e')](_0x48c55f[_0xad91('0x3b')],{'$or':_['map'](_0x316587,function(_0x2af21e){if(_0x2af21e['type']!==_0xad91('0x3f')){var _0x47cbd3={};_0x47cbd3[_0x2af21e[_0xad91('0x26')]]={'$like':'%'+_0x574dde[_0xad91('0x30')][_0xad91('0x3d')]+'%'};return _0x47cbd3;}})});}_0x48c55f=_[_0xad91('0x3e')]({},_0x48c55f,_0x574dde[_0xad91('0x40')]);var _0x3c7658={'where':_0x48c55f['where']};return db[_0xad91('0x2a')]['count'](_0x3c7658)[_0xad91('0x23')](function(_0x7220e1){_0x4971f5['count']=_0x7220e1;if(_0x574dde[_0xad91('0x30')]['includeAll']){_0x48c55f[_0xad91('0x41')]=[{'all':!![]}];}return db[_0xad91('0x2a')][_0xad91('0x42')](_0x48c55f);})[_0xad91('0x23')](function(_0x4986f2){_0x4971f5[_0xad91('0x43')]=_0x4986f2;return _0x4971f5;})[_0xad91('0x23')](respondWithFilteredResult(_0x4dc5d5,_0x48c55f))[_0xad91('0x44')](handleError(_0x4dc5d5,null));};exports[_0xad91('0x45')]=function(_0x5c0693,_0x454e0b){var _0x44ec2d={'raw':!![],'where':{'id':_0x5c0693[_0xad91('0x46')]['id']}},_0x4f2b22={};_0x4f2b22[_0xad91('0x2f')]=_['keys'](db[_0xad91('0x2a')][_0xad91('0x2b')]);_0x4f2b22[_0xad91('0x30')]=_['keys'](_0x5c0693['query']);_0x4f2b22[_0xad91('0x32')]=_[_0xad91('0x33')](_0x4f2b22[_0xad91('0x2f')],_0x4f2b22[_0xad91('0x30')]);_0x44ec2d[_0xad91('0x34')]=_['intersection'](_0x4f2b22[_0xad91('0x2f')],qs[_0xad91('0x35')](_0x5c0693['query'][_0xad91('0x35')]));_0x44ec2d[_0xad91('0x34')]=_0x44ec2d['attributes'][_0xad91('0x47')]?_0x44ec2d[_0xad91('0x34')]:_0x4f2b22[_0xad91('0x2f')];if(_0x5c0693[_0xad91('0x30')][_0xad91('0x48')]){_0x44ec2d[_0xad91('0x41')]=[{'all':!![]}];}_0x44ec2d=_[_0xad91('0x3e')]({},_0x44ec2d,_0x5c0693[_0xad91('0x40')]);return db[_0xad91('0x2a')][_0xad91('0x49')](_0x44ec2d)[_0xad91('0x23')](handleEntityNotFound(_0x454e0b,null))[_0xad91('0x23')](respondWithResult(_0x454e0b,null))[_0xad91('0x44')](handleError(_0x454e0b,null));};exports[_0xad91('0x21')]=function(_0x5ae08f,_0x10434a){if(_0x5ae08f[_0xad91('0x4a')]['id']){delete _0x5ae08f[_0xad91('0x4a')]['id'];}return db[_0xad91('0x2a')][_0xad91('0x49')]({'where':{'id':_0x5ae08f[_0xad91('0x46')]['id']}})['then'](handleEntityNotFound(_0x10434a,null))[_0xad91('0x23')](saveUpdates(_0x5ae08f[_0xad91('0x4a')],null))[_0xad91('0x23')](respondWithResult(_0x10434a,null))[_0xad91('0x44')](handleError(_0x10434a,null));};exports['destroy']=function(_0x1cf675,_0x5447a8){return db[_0xad91('0x2a')][_0xad91('0x49')]({'where':{'id':_0x1cf675[_0xad91('0x46')]['id']}})[_0xad91('0x23')](handleEntityNotFound(_0x5447a8,null))[_0xad91('0x23')](removeEntity(_0x5447a8,null))[_0xad91('0x44')](handleError(_0x5447a8,null));};exports[_0xad91('0x4b')]=function(_0x34f367,_0x4da407){var _0x23f3a6;return db[_0xad91('0x4c')][_0xad91('0x4d')](function(_0x2a2f9f){return db[_0xad91('0x2a')][_0xad91('0x4b')](_0x34f367[_0xad91('0x4a')],{'transaction':_0x2a2f9f})[_0xad91('0x23')](function(_0x525710){_0x23f3a6=_0x525710;var _0x374b54={'type':db['Sequelize'][_0xad91('0x4e')],'transaction':_0x2a2f9f};switch(_0x34f367[_0xad91('0x4a')][_0xad91('0x2d')]){case _0xad91('0x4f'):_0x374b54[_0xad91('0x2d')]=db[_0xad91('0x50')][_0xad91('0x4e')];break;case'number':_0x374b54['type']=db[_0xad91('0x50')][_0xad91('0x51')];break;case _0xad91('0x52'):_0x374b54[_0xad91('0x2d')]=db['Sequelize'][_0xad91('0x53')];_0x374b54[_0xad91('0x54')]=![];break;default:}return db[_0xad91('0x4c')][_0xad91('0x55')][_0xad91('0x56')](_0xad91('0x57'),util['format'](_0xad91('0x58'),_0x23f3a6['id']),_0x374b54);})[_0xad91('0x23')](function(){return _0x23f3a6;});})[_0xad91('0x23')](respondWithResult(_0x4da407,0xc9))[_0xad91('0x44')](handleError(_0x4da407,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d982003..18e433a 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 _0xfe8d=['CmCustomField','lodash','../../config/logger','moment','request-promise','./cmCustomField.attributes','exports','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfe8d,0x1e1));var _0xdfe8=function(_0x518ff0,_0x5e158d){_0x518ff0=_0x518ff0-0x0;var _0x148ce2=_0xfe8d[_0x518ff0];return _0x148ce2;};'use strict';var _=require(_0xdfe8('0x0'));var util=require('util');var logger=require(_0xdfe8('0x1'))('api');var moment=require(_0xdfe8('0x2'));var BPromise=require('bluebird');var rp=require(_0xdfe8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdfe8('0x4'));module[_0xdfe8('0x5')]=function(_0x105aaf,_0xf2fb32){return _0x105aaf[_0xdfe8('0x6')](_0xdfe8('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5c0=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xc5c0,0x6c));var _0x0c5c=function(_0x33abec,_0x58114e){_0x33abec=_0x33abec-0x0;var _0x205c90=_0xc5c0[_0x33abec];return _0x205c90;};'use strict';var _=require(_0x0c5c('0x0'));var util=require(_0x0c5c('0x1'));var logger=require(_0x0c5c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0c5c('0x3'));var rp=require(_0x0c5c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c5c('0x5'));var config=require(_0x0c5c('0x6'));var attributes=require(_0x0c5c('0x7'));module[_0x0c5c('0x8')]=function(_0x3c684c,_0x3da336){return _0x3c684c[_0x0c5c('0x9')]('CmCustomField',attributes,{'tableName':_0x0c5c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index f8b4297..5aa2bba 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 _0xc978=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_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')]('CmCustomField,\x20%s,\x20%s',_0x41a511,_0xe3be1);_0x26ff40(_0xe3be1);});});} \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x116574,_0xda33d9){var _0x3fa50f=function(_0x35a459){while(--_0x35a459){_0x116574['push'](_0x116574['shift']());}};_0x3fa50f(++_0xda33d9);}(_0x9f62,0x154));var _0x29f6=function(_0x1883ce,_0x5444c5){_0x1883ce=_0x1883ce-0x0;var _0x3de3a5=_0x9f62[_0x1883ce];return _0x3de3a5;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('CmCustomField,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 75be701..46b3fe6 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 _0xf960=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','path','express'];(function(_0x1eb09b,_0x223430){var _0x2d3bc9=function(_0x2e06f6){while(--_0x2e06f6){_0x1eb09b['push'](_0x1eb09b['shift']());}};_0x2d3bc9(++_0x223430);}(_0xf960,0x193));var _0x0f96=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0xf960[_0x543242];return _0x4c99b6;};'use strict';var multer=require(_0x0f96('0x0'));var util=require('util');var path=require(_0x0f96('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f96('0x2'));var router=express[_0x0f96('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0f96('0x4'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x0f96('0x5')]('/',auth[_0x0f96('0x6')](),controller[_0x0f96('0x7')]);router[_0x0f96('0x5')](_0x0f96('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0f96('0x9')]('/',auth[_0x0f96('0x6')](),controller[_0x0f96('0xa')]);router[_0x0f96('0xb')](_0x0f96('0x8'),auth[_0x0f96('0x6')](),controller['update']);router[_0x0f96('0xc')]('/:id',auth[_0x0f96('0x6')](),controller['destroy']);module[_0x0f96('0xd')]=router; \ No newline at end of file +var _0x2cc1=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','put'];(function(_0xec79f6,_0x410a69){var _0x4b1e2d=function(_0x1ea462){while(--_0x1ea462){_0xec79f6['push'](_0xec79f6['shift']());}};_0x4b1e2d(++_0x410a69);}(_0x2cc1,0xf4));var _0x12cc=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0x2cc1[_0x47643e];return _0x2aa5db;};'use strict';var multer=require(_0x12cc('0x0'));var util=require(_0x12cc('0x1'));var path=require(_0x12cc('0x2'));var timeout=require(_0x12cc('0x3'));var express=require(_0x12cc('0x4'));var router=express[_0x12cc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x12cc('0x6'));var config=require(_0x12cc('0x7'));var controller=require(_0x12cc('0x8'));router[_0x12cc('0x9')]('/',auth['isAuthenticated'](),controller[_0x12cc('0xa')]);router[_0x12cc('0x9')](_0x12cc('0xb'),auth[_0x12cc('0xc')](),controller[_0x12cc('0xd')]);router[_0x12cc('0xe')]('/',auth[_0x12cc('0xc')](),controller['create']);router[_0x12cc('0xf')]('/:id',auth[_0x12cc('0xc')](),controller[_0x12cc('0x10')]);router[_0x12cc('0x11')]('/:id',auth[_0x12cc('0xc')](),controller[_0x12cc('0x12')]);module[_0x12cc('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 3401bbe..f18e201 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 _0x8bcc=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x1eb2cf,_0x31ed58){var _0x2a75a6=function(_0x1bd7b4){while(--_0x1bd7b4){_0x1eb2cf['push'](_0x1eb2cf['shift']());}};_0x2a75a6(++_0x31ed58);}(_0x8bcc,0xaa));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xc8bc('0x0'));var Sequelize=require(_0xc8bc('0x1'));module[_0xc8bc('0x2')]={'phone':{'type':Sequelize[_0xc8bc('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc8bc('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc8bc('0x5')],'defaultValue':moment()[_0xc8bc('0x6')](_0xc8bc('0x7'))},'countbusyretry':{'type':Sequelize[_0xc8bc('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc8bc('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc8bc('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc8bc('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc8bc('0x5')]},'priority':{'type':Sequelize[_0xc8bc('0x8')](0x2)[_0xc8bc('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc8bc('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc8bc('0x8')],'unique':_0xc8bc('0xa')},'ListId':{'type':Sequelize[_0xc8bc('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xc8bc('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xc8bc('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xc8bc('0x8')]}}; \ No newline at end of file +var _0xb9d5=['BOOLEAN','contactListQueue','sequelize','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9d5,0xb6));var _0x5b9d=function(_0x10cbc1,_0x4608ec){_0x10cbc1=_0x10cbc1-0x0;var _0xa7b4a1=_0xb9d5[_0x10cbc1];return _0xa7b4a1;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b9d('0x0'));module[_0x5b9d('0x1')]={'phone':{'type':Sequelize[_0x5b9d('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5b9d('0x3')](_0x5b9d('0x4'))},'countbusyretry':{'type':Sequelize[_0x5b9d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5b9d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5b9d('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5b9d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5b9d('0x6')]},'priority':{'type':Sequelize[_0x5b9d('0x5')](0x2)[_0x5b9d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5b9d('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5b9d('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5b9d('0x9')},'UserId':{'type':Sequelize[_0x5b9d('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x5b9d('0x5')],'unique':_0x5b9d('0x9')},'CampaignId':{'type':Sequelize[_0x5b9d('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 841b79d..d68af8b 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 _0xca15=['sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','save','then','end','name','map','CmHopper','rawAttributes','fieldName','type','model','query','filters','concat','$or','$gte','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','params','keys','include','options','catch','create','body','update','find','describe','destroy','VoiceQueue','VoiceQueueId','CampaignId','omit','dataValues','updatedAt','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getOpenContacts','preview','isNumber','error','entity\x20not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x3c5ad6,_0x47b7bf){var _0x3154f2=function(_0x3a24de){while(--_0x3a24de){_0x3c5ad6['push'](_0x3c5ad6['shift']());}};_0x3154f2(++_0x47b7bf);}(_0xca15,0x83));var _0x5ca1=function(_0x9c4974,_0x37bab9){_0x9c4974=_0x9c4974-0x0;var _0x32f95e=_0xca15[_0x9c4974];return _0x32f95e;};'use strict';var pdf=require(_0x5ca1('0x0'));var emlformat=require(_0x5ca1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5ca1('0x2'));var jsonpatch=require(_0x5ca1('0x3'));var rp=require(_0x5ca1('0x4'));var moment=require(_0x5ca1('0x5'));var BPromise=require(_0x5ca1('0x6'));var Mustache=require(_0x5ca1('0x7'));var util=require(_0x5ca1('0x8'));var path=require(_0x5ca1('0x9'));var sox=require(_0x5ca1('0xa'));var csv=require('to-csv');var ejs=require(_0x5ca1('0xb'));var fs=require('fs');var _=require(_0x5ca1('0xc'));var squel=require(_0x5ca1('0xd'));var crypto=require(_0x5ca1('0xe'));var jsforce=require(_0x5ca1('0xf'));var deskjs=require(_0x5ca1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5ca1('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ca1('0x12'));var qs=require(_0x5ca1('0x13'));var as=require(_0x5ca1('0x14'));var hardwareService=require(_0x5ca1('0x15'));var logger=require(_0x5ca1('0x16'))('api');var utils=require(_0x5ca1('0x17'));var config=require(_0x5ca1('0x18'));var db=require(_0x5ca1('0x19'))['db'];function respondWithStatusCode(_0x52dba0,_0x53775b){_0x53775b=_0x53775b||0xcc;return function(_0x10634e){if(_0x10634e){return _0x52dba0[_0x5ca1('0x1a')](_0x53775b);}return _0x52dba0[_0x5ca1('0x1b')](_0x53775b)['end']();};}function respondWithResult(_0x9ef895,_0x1ef0ef){_0x1ef0ef=_0x1ef0ef||0xc8;return function(_0x883aba){if(_0x883aba){return _0x9ef895[_0x5ca1('0x1b')](_0x1ef0ef)[_0x5ca1('0x1c')](_0x883aba);}};}function respondWithFilteredResult(_0x11f4b8,_0x5926d7){return function(_0x4b9f85){if(_0x4b9f85){var _0x4f9512=_0x4b9f85['count'],_0x501d93=_0x5926d7[_0x5ca1('0x1d')],_0x47d5cb=_0x5926d7[_0x5ca1('0x1d')]+_0x5926d7[_0x5ca1('0x1e')],_0x367f48;if(_0x47d5cb>=_0x4f9512){_0x47d5cb=_0x4f9512;_0x367f48=0xc8;}else{_0x367f48=0xce;}_0x11f4b8[_0x5ca1('0x1b')](_0x367f48);return _0x11f4b8['set']('Content-Range',_0x501d93+'-'+_0x47d5cb+'/'+_0x4f9512)[_0x5ca1('0x1c')](_0x4b9f85);}return null;};}function patchUpdates(_0x5218a9){return function(_0x2ab93a){try{jsonpatch[_0x5ca1('0x1f')](_0x2ab93a,_0x5218a9,!![]);}catch(_0x5f056e){return BPromise['reject'](_0x5f056e);}return _0x2ab93a[_0x5ca1('0x20')]();};}function saveUpdates(_0x4100ce,_0x19b466){return function(_0x857191){if(_0x857191){return _0x857191['update'](_0x4100ce)[_0x5ca1('0x21')](function(_0x950275){return _0x950275;});}return null;};}function removeEntity(_0x3c2053,_0x4a865b){return function(_0xfae644){if(_0xfae644){return _0xfae644['destroy']()[_0x5ca1('0x21')](function(){_0x3c2053[_0x5ca1('0x1b')](0xcc)[_0x5ca1('0x22')]();});}};}function handleEntityNotFound(_0x55ee09,_0x31e7c0){return function(_0x3813da){if(!_0x3813da){_0x55ee09[_0x5ca1('0x1a')](0x194);}return _0x3813da;};}function handleError(_0x44dfc7,_0x3dd3d6){_0x3dd3d6=_0x3dd3d6||0x1f4;return function(_0x2bf3a7){logger['error'](_0x2bf3a7['stack']);if(_0x2bf3a7[_0x5ca1('0x23')]){delete _0x2bf3a7['name'];}_0x44dfc7[_0x5ca1('0x1b')](_0x3dd3d6)['send'](_0x2bf3a7);};}exports['index']=function(_0x3aab57,_0x567b21){var _0x318e69={},_0x2abc0d={},_0x2393a0={'count':0x0,'rows':[]};var _0x3423be=_[_0x5ca1('0x24')](db[_0x5ca1('0x25')][_0x5ca1('0x26')],function(_0x44f0f9){return{'name':_0x44f0f9[_0x5ca1('0x27')],'type':_0x44f0f9[_0x5ca1('0x28')]['key']};});_0x2abc0d[_0x5ca1('0x29')]=_[_0x5ca1('0x24')](_0x3423be,_0x5ca1('0x23'));_0x2abc0d['query']=_['keys'](_0x3aab57[_0x5ca1('0x2a')]);_0x2abc0d[_0x5ca1('0x2b')]=_['intersection'](_0x2abc0d[_0x5ca1('0x29')],_0x2abc0d[_0x5ca1('0x2a')]);_0x2abc0d[_0x5ca1('0x2b')]=_[_0x5ca1('0x2c')](_0x2abc0d[_0x5ca1('0x2b')],['$and',_0x5ca1('0x2d'),'$gt',_0x5ca1('0x2e'),'$lt','$lte','$ne','$eq','$not',_0x5ca1('0x2f'),_0x5ca1('0x30'),_0x5ca1('0x31'),_0x5ca1('0x32'),_0x5ca1('0x33'),_0x5ca1('0x34'),_0x5ca1('0x35'),_0x5ca1('0x36'),'$like',_0x5ca1('0x37'),'$contains',_0x5ca1('0x38'),_0x5ca1('0x39')]);_0x318e69[_0x5ca1('0x3a')]=_[_0x5ca1('0x3b')](_0x2abc0d[_0x5ca1('0x29')],qs['fields'](_0x3aab57[_0x5ca1('0x2a')][_0x5ca1('0x3c')]));_0x318e69[_0x5ca1('0x3a')]=_0x318e69[_0x5ca1('0x3a')][_0x5ca1('0x3d')]?_0x318e69[_0x5ca1('0x3a')]:_0x2abc0d[_0x5ca1('0x29')];if(!_0x3aab57['query']['hasOwnProperty'](_0x5ca1('0x3e'))){_0x318e69[_0x5ca1('0x1e')]=qs[_0x5ca1('0x1e')](_0x3aab57['query'][_0x5ca1('0x1e')]);_0x318e69[_0x5ca1('0x1d')]=qs['offset'](_0x3aab57[_0x5ca1('0x2a')][_0x5ca1('0x1d')]);}_0x318e69[_0x5ca1('0x3f')]=qs[_0x5ca1('0x40')](_0x3aab57[_0x5ca1('0x2a')][_0x5ca1('0x40')]);_0x318e69[_0x5ca1('0x41')]=qs[_0x5ca1('0x2b')](_['pick'](_0x3aab57[_0x5ca1('0x2a')],_0x2abc0d['filters']));if(_0x3aab57[_0x5ca1('0x2a')][_0x5ca1('0x42')]){_0x318e69[_0x5ca1('0x41')]=_[_0x5ca1('0x43')](_0x318e69[_0x5ca1('0x41')],{'$or':_[_0x5ca1('0x24')](_0x3423be,function(_0x242f84){if(_0x242f84['type']!==_0x5ca1('0x44')){var _0xee98b9={};_0xee98b9[_0x242f84[_0x5ca1('0x23')]]={'$like':'%'+_0x3aab57[_0x5ca1('0x2a')][_0x5ca1('0x42')]+'%'};return _0xee98b9;}})});}_0x318e69=_[_0x5ca1('0x43')]({},_0x318e69,_0x3aab57['options']);var _0x293284={'where':_0x318e69[_0x5ca1('0x41')]};return db[_0x5ca1('0x25')][_0x5ca1('0x45')](_0x293284)['then'](function(_0xa78740){_0x2393a0[_0x5ca1('0x45')]=_0xa78740;if(_0x3aab57[_0x5ca1('0x2a')][_0x5ca1('0x46')]){_0x318e69['include']=[{'all':!![]}];}return db['CmHopper'][_0x5ca1('0x47')](_0x318e69);})['then'](function(_0x3de8f2){_0x2393a0[_0x5ca1('0x48')]=_0x3de8f2;return _0x2393a0;})[_0x5ca1('0x21')](respondWithFilteredResult(_0x567b21,_0x318e69))['catch'](handleError(_0x567b21,null));};exports[_0x5ca1('0x49')]=function(_0x46e2bf,_0x4ef7c8){var _0x531a5e={'raw':!![],'where':{'id':_0x46e2bf[_0x5ca1('0x4a')]['id']}},_0x4d903d={};_0x4d903d[_0x5ca1('0x29')]=_[_0x5ca1('0x4b')](db[_0x5ca1('0x25')][_0x5ca1('0x26')]);_0x4d903d[_0x5ca1('0x2a')]=_['keys'](_0x46e2bf['query']);_0x4d903d[_0x5ca1('0x2b')]=_[_0x5ca1('0x3b')](_0x4d903d['model'],_0x4d903d['query']);_0x531a5e[_0x5ca1('0x3a')]=_[_0x5ca1('0x3b')](_0x4d903d['model'],qs['fields'](_0x46e2bf['query'][_0x5ca1('0x3c')]));_0x531a5e[_0x5ca1('0x3a')]=_0x531a5e[_0x5ca1('0x3a')][_0x5ca1('0x3d')]?_0x531a5e[_0x5ca1('0x3a')]:_0x4d903d[_0x5ca1('0x29')];if(_0x46e2bf[_0x5ca1('0x2a')][_0x5ca1('0x46')]){_0x531a5e[_0x5ca1('0x4c')]=[{'all':!![]}];}_0x531a5e=_['merge']({},_0x531a5e,_0x46e2bf[_0x5ca1('0x4d')]);return db[_0x5ca1('0x25')]['find'](_0x531a5e)[_0x5ca1('0x21')](handleEntityNotFound(_0x4ef7c8,null))['then'](respondWithResult(_0x4ef7c8,null))[_0x5ca1('0x4e')](handleError(_0x4ef7c8,null));};exports[_0x5ca1('0x4f')]=function(_0x56f0f1,_0x438880){return db[_0x5ca1('0x25')][_0x5ca1('0x4f')](_0x56f0f1[_0x5ca1('0x50')],{})[_0x5ca1('0x21')](respondWithResult(_0x438880,0xc9))[_0x5ca1('0x4e')](handleError(_0x438880,null));};exports[_0x5ca1('0x51')]=function(_0x53e083,_0x511dee){if(_0x53e083[_0x5ca1('0x50')]['id']){delete _0x53e083[_0x5ca1('0x50')]['id'];}return db[_0x5ca1('0x25')][_0x5ca1('0x52')]({'where':{'id':_0x53e083[_0x5ca1('0x4a')]['id']}})[_0x5ca1('0x21')](handleEntityNotFound(_0x511dee,null))[_0x5ca1('0x21')](saveUpdates(_0x53e083[_0x5ca1('0x50')],null))[_0x5ca1('0x21')](respondWithResult(_0x511dee,null))['catch'](handleError(_0x511dee,null));};exports[_0x5ca1('0x53')]=function(_0x1ba922,_0x4e38ae){return db['CmHopper'][_0x5ca1('0x53')]()[_0x5ca1('0x21')](respondWithResult(_0x4e38ae,null))['catch'](handleError(_0x4e38ae,null));};exports['destroy']=function(_0x592c19,_0x23d61e){var _0x1c5f2c;return db['CmHopper']['find']({'where':{'id':_0x592c19['params']['id']}})['then'](handleEntityNotFound(_0x23d61e,null))[_0x5ca1('0x21')](function(_0x403a3a){if(_0x403a3a){return _0x403a3a[_0x5ca1('0x54')]()[_0x5ca1('0x21')](function(_0x266f60){return _0x266f60;});}})[_0x5ca1('0x21')](function(_0x19be13){_0x1c5f2c=_0x19be13;if(_0x19be13){if(_0x19be13['VoiceQueueId']||_0x19be13['CampaignId']){return db[_0x19be13['VoiceQueueId']?_0x5ca1('0x55'):'Campaign'][_0x5ca1('0x52')]({'where':{'id':_0x19be13[_0x5ca1('0x56')]?_0x19be13['VoiceQueueId']:_0x19be13[_0x5ca1('0x57')]},'attributes':['id',_0x5ca1('0x23')],'raw':!![]});}}})[_0x5ca1('0x21')](function(_0x488a8d){var _0x3b555b={};if(_0x488a8d){_['merge'](_0x3b555b,_[_0x5ca1('0x58')](_0x1c5f2c[_0x5ca1('0x59')],['createdAt',_0x5ca1('0x5a'),'id']));_0x3b555b['state']=0x15;_0x3b555b[_0x5ca1('0x5b')]=_0x5ca1('0x5c');_0x3b555b[_0x5ca1('0x5d')]=_0x488a8d[_0x5ca1('0x23')];_0x3b555b[_0x5ca1('0x5e')]=_0x592c19[_0x5ca1('0x5f')][_0x5ca1('0x23')];_0x3b555b['UserId']=_0x592c19[_0x5ca1('0x5f')]['id'];_0x3b555b['deleted']=!![];_0x3b555b[_0x5ca1('0x60')]=moment()[_0x5ca1('0x61')](_0x5ca1('0x62'));_0x3b555b[_0x5ca1('0x63')]=_0x1c5f2c[_0x5ca1('0x64')];_0x3b555b[_0x5ca1('0x65')]=_0x1c5f2c[_0x5ca1('0x56')]?_0x5ca1('0x66'):_0x5ca1('0x67');return db[_0x5ca1('0x68')][_0x5ca1('0x52')]({'where':{'id':_0x3b555b[_0x5ca1('0x69')]},'attributes':[_0x5ca1('0x6a'),_0x5ca1('0x6b')]})[_0x5ca1('0x21')](function(_0xabf903){if(!_[_0x5ca1('0x6c')](_0x23d61e)&&!_[_0x5ca1('0x6c')](_0xabf903[_0x5ca1('0x6a')])){_0x3b555b[_0x5ca1('0x6d')]=_0xabf903[_0x5ca1('0x6a')];if(!_[_0x5ca1('0x6c')](_0xabf903['lastName'])){_0x3b555b[_0x5ca1('0x6d')]+='\x20'+_0xabf903['lastName'];}}})[_0x5ca1('0x6e')](function(){return db[_0x5ca1('0x6f')][_0x5ca1('0x4f')](_0x3b555b);});}})[_0x5ca1('0x21')](function(){return _0x23d61e['status'](0xcc)['end']();})[_0x5ca1('0x4e')](handleError(_0x23d61e,null));};exports[_0x5ca1('0x70')]=function(_0x175359,_0x315bbf,_0x211718){var _0x234c2c=[];return db[_0x5ca1('0x68')][_0x5ca1('0x53')]()[_0x5ca1('0x21')](function(_0x29c652){_0x234c2c=_[_0x5ca1('0x4b')](_0x29c652);return _0x175359[_0x5ca1('0x5f')][_0x5ca1('0x71')]({'where':{'type':_0x5ca1('0x72'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x5ca1('0x73')],'raw':!![]});})[_0x5ca1('0x21')](function(_0x12db63){if(_0x12db63&&_0x12db63[_0x5ca1('0x3d')]){return db[_0x5ca1('0x74')]['transaction'](function(_0x1be1f0){var _0xe65809={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5ca1('0x61')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5ca1('0x24')](_0x12db63,'id')},'$or':[{'UserId':null},{'UserId':_0x175359['user']['id']}]};var _0xda06c9=[];if(_0x175359[_0x5ca1('0x50')]['direction']&&_0x175359[_0x5ca1('0x50')][_0x5ca1('0x75')]===_0x5ca1('0x76')){if(!_[_0x5ca1('0x77')](_0x175359[_0x5ca1('0x50')]['hopperIds'])){_0xe65809['id']={'$in':_0x175359[_0x5ca1('0x50')][_0x5ca1('0x78')]};}_0xda06c9=[['priority',_0x5ca1('0x79')],['scheduledAt',_0x12db63[0x0][_0x5ca1('0x73')]==='ASC'?_0x5ca1('0x7a'):_0x5ca1('0x79')],db[_0x5ca1('0x74')][_0x5ca1('0x7b')](_0x5ca1('0x7c')),['id',_0x5ca1('0x7a')]];}else{if(!_[_0x5ca1('0x77')](_0x175359[_0x5ca1('0x50')][_0x5ca1('0x78')])){_0xe65809['id']={'$notIn':_0x175359['body'][_0x5ca1('0x78')]};}_0xda06c9=[[_0x5ca1('0x7d'),_0x5ca1('0x7a')],['scheduledAt',_0x12db63[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x5ca1('0x7b')](_0x5ca1('0x7e')),['id',_0x5ca1('0x79')]];}return db[_0x5ca1('0x25')]['findOne']({'attributes':['id',_0x5ca1('0x7f')],'where':_0xe65809,'order':_0xda06c9,'transaction':_0x1be1f0,'lock':_0x1be1f0[_0x5ca1('0x80')][_0x5ca1('0x81')],'include':[{'model':db[_0x5ca1('0x68')],'as':_0x5ca1('0x82'),'attributes':_0x234c2c,'include':[{'model':db[_0x5ca1('0x83')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x5ca1('0x84')],'as':_0x5ca1('0x85'),'attributes':['id',_0x5ca1('0x23')]},{'model':db['VoiceQueue'],'as':_0x5ca1('0x86'),'attributes':['id','name',_0x5ca1('0x87')]}]})['then'](function(_0x35a7e5){if(_0x35a7e5){return _0x35a7e5[_0x5ca1('0x51')]({'UserId':_0x175359[_0x5ca1('0x5f')]['id']},{'transaction':_0x1be1f0});}});});}})['then'](handleEntityNotFound(_0x315bbf,null))[_0x5ca1('0x21')](respondWithResult(_0x315bbf,null))[_0x5ca1('0x4e')](handleError(_0x315bbf,null));};exports[_0x5ca1('0x88')]=function(_0x527cdf,_0x5ca527,_0x3a1638){return _0x527cdf[_0x5ca1('0x5f')][_0x5ca1('0x71')]({'where':{'type':_0x5ca1('0x72'),'dialActive':!![],'dialMethod':_0x5ca1('0x89')},'attributes':['id'],'raw':!![]})[_0x5ca1('0x21')](function(_0x276c4e){if(_0x276c4e&&_0x276c4e['length']){return db[_0x5ca1('0x25')][_0x5ca1('0x45')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5ca1('0x61')](_0x5ca1('0x62'))},'VoiceQueueId':{'$in':_[_0x5ca1('0x24')](_0x276c4e,'id')},'$or':[{'UserId':null},{'UserId':_0x527cdf[_0x5ca1('0x5f')]['id']}]}});}return 0x0;})[_0x5ca1('0x21')](function(_0x379837){if(!_[_0x5ca1('0x6c')](_0x379837)&&_[_0x5ca1('0x8a')](_0x379837)){return _0x5ca527[_0x5ca1('0x1b')](0xc8)[_0x5ca1('0x1c')]({'contacts':_0x379837});}else{logger[_0x5ca1('0x8b')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5ca1('0x88'),0x194,_0x5ca1('0x8c'));_0x5ca527[_0x5ca1('0x1a')](0x194);}})[_0x5ca1('0x4e')](handleError(_0x5ca527,null));}; \ No newline at end of file +var _0xfe30=['fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','name','index','CmHopper','rawAttributes','type','key','model','map','query','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','options','create','body','describe','find','VoiceQueueId','CampaignId','VoiceQueue','Campaign','createdAt','updatedAt','state','deleted','campaign','membername','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x1e5068,_0x2e70fa){var _0x4b4c3a=function(_0x3e5ed5){while(--_0x3e5ed5){_0x1e5068['push'](_0x1e5068['shift']());}};_0x4b4c3a(++_0x2e70fa);}(_0xfe30,0x1bb));var _0x0fe3=function(_0x49e0a4,_0x1a55e4){_0x49e0a4=_0x49e0a4-0x0;var _0x41ef3d=_0xfe30[_0x49e0a4];return _0x41ef3d;};'use strict';var pdf=require(_0x0fe3('0x0'));var emlformat=require(_0x0fe3('0x1'));var rimraf=require(_0x0fe3('0x2'));var zipdir=require(_0x0fe3('0x3'));var jsonpatch=require(_0x0fe3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0fe3('0x5'));var Mustache=require('mustache');var util=require(_0x0fe3('0x6'));var path=require(_0x0fe3('0x7'));var sox=require(_0x0fe3('0x8'));var csv=require('to-csv');var ejs=require(_0x0fe3('0x9'));var fs=require('fs');var _=require(_0x0fe3('0xa'));var squel=require(_0x0fe3('0xb'));var crypto=require(_0x0fe3('0xc'));var jsforce=require(_0x0fe3('0xd'));var deskjs=require(_0x0fe3('0xe'));var toCsv=require(_0x0fe3('0xf'));var querystring=require(_0x0fe3('0x10'));var Papa=require(_0x0fe3('0x11'));var Redis=require(_0x0fe3('0x12'));var authService=require(_0x0fe3('0x13'));var qs=require(_0x0fe3('0x14'));var as=require(_0x0fe3('0x15'));var hardwareService=require(_0x0fe3('0x16'));var logger=require(_0x0fe3('0x17'))(_0x0fe3('0x18'));var utils=require(_0x0fe3('0x19'));var config=require(_0x0fe3('0x1a'));var db=require(_0x0fe3('0x1b'))['db'];function respondWithStatusCode(_0x35edd9,_0x20be6c){_0x20be6c=_0x20be6c||0xcc;return function(_0x429f50){if(_0x429f50){return _0x35edd9[_0x0fe3('0x1c')](_0x20be6c);}return _0x35edd9[_0x0fe3('0x1d')](_0x20be6c)[_0x0fe3('0x1e')]();};}function respondWithResult(_0x1abece,_0x3961fd){_0x3961fd=_0x3961fd||0xc8;return function(_0x4235d4){if(_0x4235d4){return _0x1abece['status'](_0x3961fd)['json'](_0x4235d4);}};}function respondWithFilteredResult(_0x28c281,_0x273eb6){return function(_0x23efc5){if(_0x23efc5){var _0x10e84e=_0x23efc5[_0x0fe3('0x1f')],_0x115e7b=_0x273eb6['offset'],_0x34bff0=_0x273eb6[_0x0fe3('0x20')]+_0x273eb6[_0x0fe3('0x21')],_0x37387b;if(_0x34bff0>=_0x10e84e){_0x34bff0=_0x10e84e;_0x37387b=0xc8;}else{_0x37387b=0xce;}_0x28c281[_0x0fe3('0x1d')](_0x37387b);return _0x28c281[_0x0fe3('0x22')](_0x0fe3('0x23'),_0x115e7b+'-'+_0x34bff0+'/'+_0x10e84e)[_0x0fe3('0x24')](_0x23efc5);}return null;};}function patchUpdates(_0x17875d){return function(_0x52b169){try{jsonpatch['apply'](_0x52b169,_0x17875d,!![]);}catch(_0x356328){return BPromise[_0x0fe3('0x25')](_0x356328);}return _0x52b169[_0x0fe3('0x26')]();};}function saveUpdates(_0x141645,_0x53886f){return function(_0x5288f8){if(_0x5288f8){return _0x5288f8[_0x0fe3('0x27')](_0x141645)[_0x0fe3('0x28')](function(_0x3fc368){return _0x3fc368;});}return null;};}function removeEntity(_0x2fc74f,_0x211f00){return function(_0x4480fb){if(_0x4480fb){return _0x4480fb[_0x0fe3('0x29')]()['then'](function(){_0x2fc74f[_0x0fe3('0x1d')](0xcc)[_0x0fe3('0x1e')]();});}};}function handleEntityNotFound(_0x57308e,_0x289712){return function(_0x44f213){if(!_0x44f213){_0x57308e['sendStatus'](0x194);}return _0x44f213;};}function handleError(_0xe77f2,_0x20ed0a){_0x20ed0a=_0x20ed0a||0x1f4;return function(_0x566e1d){logger['error'](_0x566e1d['stack']);if(_0x566e1d['name']){delete _0x566e1d[_0x0fe3('0x2a')];}_0xe77f2['status'](_0x20ed0a)['send'](_0x566e1d);};}exports[_0x0fe3('0x2b')]=function(_0x5e8941,_0x2b62f3){var _0x5837fa={},_0x2f9555={},_0x5d89e1={'count':0x0,'rows':[]};var _0x33130f=_['map'](db[_0x0fe3('0x2c')][_0x0fe3('0x2d')],function(_0x35629c){return{'name':_0x35629c['fieldName'],'type':_0x35629c[_0x0fe3('0x2e')][_0x0fe3('0x2f')]};});_0x2f9555[_0x0fe3('0x30')]=_[_0x0fe3('0x31')](_0x33130f,_0x0fe3('0x2a'));_0x2f9555['query']=_['keys'](_0x5e8941[_0x0fe3('0x32')]);_0x2f9555[_0x0fe3('0x33')]=_['intersection'](_0x2f9555[_0x0fe3('0x30')],_0x2f9555[_0x0fe3('0x32')]);_0x2f9555[_0x0fe3('0x33')]=_[_0x0fe3('0x34')](_0x2f9555['filters'],[_0x0fe3('0x35'),_0x0fe3('0x36'),'$gt',_0x0fe3('0x37'),_0x0fe3('0x38'),_0x0fe3('0x39'),_0x0fe3('0x3a'),_0x0fe3('0x3b'),_0x0fe3('0x3c'),_0x0fe3('0x3d'),_0x0fe3('0x3e'),_0x0fe3('0x3f'),'$notIn','$like',_0x0fe3('0x40'),_0x0fe3('0x41'),_0x0fe3('0x42'),_0x0fe3('0x43'),_0x0fe3('0x44'),_0x0fe3('0x45'),_0x0fe3('0x46'),'$any']);_0x5837fa[_0x0fe3('0x47')]=_[_0x0fe3('0x48')](_0x2f9555[_0x0fe3('0x30')],qs[_0x0fe3('0x49')](_0x5e8941['query'][_0x0fe3('0x49')]));_0x5837fa[_0x0fe3('0x47')]=_0x5837fa[_0x0fe3('0x47')][_0x0fe3('0x4a')]?_0x5837fa[_0x0fe3('0x47')]:_0x2f9555[_0x0fe3('0x30')];if(!_0x5e8941[_0x0fe3('0x32')][_0x0fe3('0x4b')]('nolimit')){_0x5837fa['limit']=qs[_0x0fe3('0x21')](_0x5e8941[_0x0fe3('0x32')][_0x0fe3('0x21')]);_0x5837fa[_0x0fe3('0x20')]=qs[_0x0fe3('0x20')](_0x5e8941[_0x0fe3('0x32')][_0x0fe3('0x20')]);}_0x5837fa[_0x0fe3('0x4c')]=qs['sort'](_0x5e8941['query'][_0x0fe3('0x4d')]);_0x5837fa[_0x0fe3('0x4e')]=qs[_0x0fe3('0x33')](_['pick'](_0x5e8941['query'],_0x2f9555[_0x0fe3('0x33')]));if(_0x5e8941['query'][_0x0fe3('0x4f')]){_0x5837fa['where']=_[_0x0fe3('0x50')](_0x5837fa['where'],{'$or':_[_0x0fe3('0x31')](_0x33130f,function(_0x3d9887){if(_0x3d9887[_0x0fe3('0x2e')]!==_0x0fe3('0x51')){var _0x20161c={};_0x20161c[_0x3d9887[_0x0fe3('0x2a')]]={'$like':'%'+_0x5e8941['query'][_0x0fe3('0x4f')]+'%'};return _0x20161c;}})});}_0x5837fa=_[_0x0fe3('0x50')]({},_0x5837fa,_0x5e8941['options']);var _0x103711={'where':_0x5837fa[_0x0fe3('0x4e')]};return db[_0x0fe3('0x2c')][_0x0fe3('0x1f')](_0x103711)[_0x0fe3('0x28')](function(_0x211c33){_0x5d89e1[_0x0fe3('0x1f')]=_0x211c33;if(_0x5e8941['query'][_0x0fe3('0x52')]){_0x5837fa[_0x0fe3('0x53')]=[{'all':!![]}];}return db[_0x0fe3('0x2c')]['findAll'](_0x5837fa);})[_0x0fe3('0x28')](function(_0x114a6e){_0x5d89e1[_0x0fe3('0x54')]=_0x114a6e;return _0x5d89e1;})[_0x0fe3('0x28')](respondWithFilteredResult(_0x2b62f3,_0x5837fa))[_0x0fe3('0x55')](handleError(_0x2b62f3,null));};exports[_0x0fe3('0x56')]=function(_0x32f9a1,_0x48fa6a){var _0x53bdd9={'raw':!![],'where':{'id':_0x32f9a1[_0x0fe3('0x57')]['id']}},_0x28cb4b={};_0x28cb4b[_0x0fe3('0x30')]=_['keys'](db[_0x0fe3('0x2c')][_0x0fe3('0x2d')]);_0x28cb4b[_0x0fe3('0x32')]=_[_0x0fe3('0x58')](_0x32f9a1['query']);_0x28cb4b['filters']=_[_0x0fe3('0x48')](_0x28cb4b[_0x0fe3('0x30')],_0x28cb4b[_0x0fe3('0x32')]);_0x53bdd9[_0x0fe3('0x47')]=_[_0x0fe3('0x48')](_0x28cb4b['model'],qs[_0x0fe3('0x49')](_0x32f9a1[_0x0fe3('0x32')][_0x0fe3('0x49')]));_0x53bdd9[_0x0fe3('0x47')]=_0x53bdd9['attributes'][_0x0fe3('0x4a')]?_0x53bdd9[_0x0fe3('0x47')]:_0x28cb4b['model'];if(_0x32f9a1['query'][_0x0fe3('0x52')]){_0x53bdd9['include']=[{'all':!![]}];}_0x53bdd9=_[_0x0fe3('0x50')]({},_0x53bdd9,_0x32f9a1[_0x0fe3('0x59')]);return db[_0x0fe3('0x2c')]['find'](_0x53bdd9)[_0x0fe3('0x28')](handleEntityNotFound(_0x48fa6a,null))[_0x0fe3('0x28')](respondWithResult(_0x48fa6a,null))[_0x0fe3('0x55')](handleError(_0x48fa6a,null));};exports[_0x0fe3('0x5a')]=function(_0x5bbc46,_0x128ad0){return db[_0x0fe3('0x2c')][_0x0fe3('0x5a')](_0x5bbc46[_0x0fe3('0x5b')],{})[_0x0fe3('0x28')](respondWithResult(_0x128ad0,0xc9))[_0x0fe3('0x55')](handleError(_0x128ad0,null));};exports[_0x0fe3('0x27')]=function(_0x9372f,_0xebd984){if(_0x9372f[_0x0fe3('0x5b')]['id']){delete _0x9372f[_0x0fe3('0x5b')]['id'];}return db[_0x0fe3('0x2c')]['find']({'where':{'id':_0x9372f[_0x0fe3('0x57')]['id']}})['then'](handleEntityNotFound(_0xebd984,null))[_0x0fe3('0x28')](saveUpdates(_0x9372f['body'],null))[_0x0fe3('0x28')](respondWithResult(_0xebd984,null))[_0x0fe3('0x55')](handleError(_0xebd984,null));};exports['describe']=function(_0x44ce56,_0x3dc34a){return db[_0x0fe3('0x2c')][_0x0fe3('0x5c')]()[_0x0fe3('0x28')](respondWithResult(_0x3dc34a,null))['catch'](handleError(_0x3dc34a,null));};exports['destroy']=function(_0x863cab,_0x1efe24){var _0x27a1a8;return db[_0x0fe3('0x2c')][_0x0fe3('0x5d')]({'where':{'id':_0x863cab['params']['id']}})[_0x0fe3('0x28')](handleEntityNotFound(_0x1efe24,null))[_0x0fe3('0x28')](function(_0x5d1039){if(_0x5d1039){return _0x5d1039['destroy']()['then'](function(_0x1e2621){return _0x1e2621;});}})['then'](function(_0x32ddb9){_0x27a1a8=_0x32ddb9;if(_0x32ddb9){if(_0x32ddb9[_0x0fe3('0x5e')]||_0x32ddb9[_0x0fe3('0x5f')]){return db[_0x32ddb9['VoiceQueueId']?_0x0fe3('0x60'):_0x0fe3('0x61')][_0x0fe3('0x5d')]({'where':{'id':_0x32ddb9[_0x0fe3('0x5e')]?_0x32ddb9[_0x0fe3('0x5e')]:_0x32ddb9['CampaignId']},'attributes':['id',_0x0fe3('0x2a')],'raw':!![]});}}})[_0x0fe3('0x28')](function(_0x503d30){var _0x184724={};if(_0x503d30){_[_0x0fe3('0x50')](_0x184724,_['omit'](_0x27a1a8['dataValues'],[_0x0fe3('0x62'),_0x0fe3('0x63'),'id']));_0x184724[_0x0fe3('0x64')]=0x15;_0x184724['statedesc']=_0x0fe3('0x65');_0x184724[_0x0fe3('0x66')]=_0x503d30[_0x0fe3('0x2a')];_0x184724[_0x0fe3('0x67')]=_0x863cab[_0x0fe3('0x68')]['name'];_0x184724['UserId']=_0x863cab[_0x0fe3('0x68')]['id'];_0x184724[_0x0fe3('0x65')]=!![];_0x184724[_0x0fe3('0x69')]=moment()['format'](_0x0fe3('0x6a'));_0x184724[_0x0fe3('0x6b')]=_0x27a1a8[_0x0fe3('0x6c')];_0x184724['campaigntype']=_0x27a1a8[_0x0fe3('0x5e')]?_0x0fe3('0x6d'):_0x0fe3('0x6e');return db[_0x0fe3('0x6f')][_0x0fe3('0x5d')]({'where':{'id':_0x184724[_0x0fe3('0x70')]},'attributes':[_0x0fe3('0x71'),_0x0fe3('0x72')]})['then'](function(_0x2c2688){if(!_['isNil'](_0x1efe24)&&!_['isNil'](_0x2c2688[_0x0fe3('0x71')])){_0x184724['calleridname']=_0x2c2688[_0x0fe3('0x71')];if(!_[_0x0fe3('0x73')](_0x2c2688[_0x0fe3('0x72')])){_0x184724[_0x0fe3('0x74')]+='\x20'+_0x2c2688[_0x0fe3('0x72')];}}})['finally'](function(){return db[_0x0fe3('0x75')]['create'](_0x184724);});}})['then'](function(){return _0x1efe24[_0x0fe3('0x1d')](0xcc)['end']();})[_0x0fe3('0x55')](handleError(_0x1efe24,null));};exports['getPreview']=function(_0x59434a,_0xcc105e,_0x17d7c8){var _0x3f5e53=[];return db[_0x0fe3('0x6f')][_0x0fe3('0x5c')]()[_0x0fe3('0x28')](function(_0x4bc305){_0x3f5e53=_[_0x0fe3('0x58')](_0x4bc305);return _0x59434a['user'][_0x0fe3('0x76')]({'where':{'type':_0x0fe3('0x77'),'dialActive':!![],'dialMethod':_0x0fe3('0x78')},'attributes':['id',_0x0fe3('0x79')],'raw':!![]});})[_0x0fe3('0x28')](function(_0x2b35bd){if(_0x2b35bd&&_0x2b35bd[_0x0fe3('0x4a')]){return db[_0x0fe3('0x7a')][_0x0fe3('0x7b')](function(_0x2a8b60){var _0x177424={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0fe3('0x6a'))},'VoiceQueueId':{'$in':_[_0x0fe3('0x31')](_0x2b35bd,'id')},'$or':[{'UserId':null},{'UserId':_0x59434a[_0x0fe3('0x68')]['id']}]};var _0x2d9222=[];if(_0x59434a[_0x0fe3('0x5b')][_0x0fe3('0x7c')]&&_0x59434a['body'][_0x0fe3('0x7c')]===_0x0fe3('0x7d')){if(!_[_0x0fe3('0x7e')](_0x59434a[_0x0fe3('0x5b')][_0x0fe3('0x7f')])){_0x177424['id']={'$in':_0x59434a['body']['hopperIds']};}_0x2d9222=[[_0x0fe3('0x80'),'ASC'],[_0x0fe3('0x81'),_0x2b35bd[0x0][_0x0fe3('0x79')]===_0x0fe3('0x82')?'DESC':_0x0fe3('0x82')],db[_0x0fe3('0x7a')][_0x0fe3('0x83')](_0x0fe3('0x84')),['id',_0x0fe3('0x85')]];}else{if(!_[_0x0fe3('0x7e')](_0x59434a[_0x0fe3('0x5b')][_0x0fe3('0x7f')])){_0x177424['id']={'$notIn':_0x59434a[_0x0fe3('0x5b')][_0x0fe3('0x7f')]};}_0x2d9222=[[_0x0fe3('0x80'),_0x0fe3('0x85')],[_0x0fe3('0x81'),_0x2b35bd[0x0][_0x0fe3('0x79')]],db['sequelize'][_0x0fe3('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x0fe3('0x82')]];}return db[_0x0fe3('0x2c')][_0x0fe3('0x86')]({'attributes':['id',_0x0fe3('0x87')],'where':_0x177424,'order':_0x2d9222,'transaction':_0x2a8b60,'lock':_0x2a8b60[_0x0fe3('0x88')][_0x0fe3('0x89')],'include':[{'model':db['CmContact'],'as':_0x0fe3('0x8a'),'attributes':_0x3f5e53,'include':[{'model':db[_0x0fe3('0x8b')],'as':_0x0fe3('0x8c'),'attributes':['id','name']}]},{'model':db[_0x0fe3('0x8d')],'as':_0x0fe3('0x8e'),'attributes':['id','name']},{'model':db[_0x0fe3('0x60')],'as':_0x0fe3('0x8f'),'attributes':['id',_0x0fe3('0x2a'),_0x0fe3('0x90')]}]})[_0x0fe3('0x28')](function(_0x2ba6c7){if(_0x2ba6c7){return _0x2ba6c7[_0x0fe3('0x27')]({'UserId':_0x59434a[_0x0fe3('0x68')]['id']},{'transaction':_0x2a8b60});}});});}})[_0x0fe3('0x28')](handleEntityNotFound(_0xcc105e,null))[_0x0fe3('0x28')](respondWithResult(_0xcc105e,null))[_0x0fe3('0x55')](handleError(_0xcc105e,null));};exports[_0x0fe3('0x91')]=function(_0x28d3db,_0xd0fa40,_0x494473){return _0x28d3db[_0x0fe3('0x68')][_0x0fe3('0x76')]({'where':{'type':_0x0fe3('0x77'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x0fe3('0x28')](function(_0x2ee9aa){if(_0x2ee9aa&&_0x2ee9aa['length']){return db[_0x0fe3('0x2c')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0fe3('0x6a'))},'VoiceQueueId':{'$in':_[_0x0fe3('0x31')](_0x2ee9aa,'id')},'$or':[{'UserId':null},{'UserId':_0x28d3db[_0x0fe3('0x68')]['id']}]}});}return 0x0;})[_0x0fe3('0x28')](function(_0x533a26){if(!_[_0x0fe3('0x73')](_0x533a26)&&_['isNumber'](_0x533a26)){return _0xd0fa40['status'](0xc8)[_0x0fe3('0x24')]({'contacts':_0x533a26});}else{logger[_0x0fe3('0x92')](_0x0fe3('0x93'),_0x0fe3('0x91'),0x194,_0x0fe3('0x94'));_0xd0fa40[_0x0fe3('0x1c')](0x194);}})['catch'](handleError(_0xd0fa40,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8f89163..02e8031 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 _0x11cd=['./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5f3c22,_0x32dafe){var _0xaf80f=function(_0x2dc78a){while(--_0x2dc78a){_0x5f3c22['push'](_0x5f3c22['shift']());}};_0xaf80f(++_0x32dafe);}(_0x11cd,0x103));var _0xd11c=function(_0x2f700e,_0x47deae){_0x2f700e=_0x2f700e-0x0;var _0x3649f8=_0x11cd[_0x2f700e];return _0x3649f8;};'use strict';var _=require(_0xd11c('0x0'));var util=require('util');var logger=require(_0xd11c('0x1'))(_0xd11c('0x2'));var moment=require('moment');var BPromise=require(_0xd11c('0x3'));var rp=require(_0xd11c('0x4'));var fs=require('fs');var path=require(_0xd11c('0x5'));var rimraf=require(_0xd11c('0x6'));var config=require('../../config/environment');var attributes=require(_0xd11c('0x7'));module['exports']=function(_0x2a6142,_0x1c7f79){return _0x2a6142[_0xd11c('0x8')](_0xd11c('0x9'),attributes,{'tableName':_0xd11c('0xa'),'paranoid':![],'indexes':[{'name':_0xd11c('0xb'),'fields':[_0xd11c('0xb')]},{'name':_0xd11c('0xc'),'fields':[_0xd11c('0xc')]},{'name':_0xd11c('0xd'),'fields':[_0xd11c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf19b=['request-promise','path','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger'];(function(_0x473db8,_0x477567){var _0x4fa123=function(_0x104f11){while(--_0x104f11){_0x473db8['push'](_0x473db8['shift']());}};_0x4fa123(++_0x477567);}(_0xf19b,0xa3));var _0xbf19=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf19b[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xbf19('0x0'));var util=require('util');var logger=require(_0xbf19('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf19('0x2'));var fs=require('fs');var path=require(_0xbf19('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf19('0x4'));module['exports']=function(_0x594ae5,_0x41e162){return _0x594ae5[_0xbf19('0x5')](_0xbf19('0x6'),attributes,{'tableName':_0xbf19('0x7'),'paranoid':![],'indexes':[{'name':_0xbf19('0x8'),'fields':[_0xbf19('0x8')]},{'name':_0xbf19('0x9'),'fields':[_0xbf19('0x9')]},{'name':_0xbf19('0xa'),'fields':[_0xbf19('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 5660f15..2394dde 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 _0xbe08=['options','where','attributes','limit','include','model','map','stringify','catch','ShowCmHopper','CmHopper','find','raw','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','length','all','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','update','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetCmHopper','findAll'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0xbe08,0x180));var _0x8be0=function(_0x262bd9,_0x2c345d){_0x262bd9=_0x262bd9-0x0;var _0x1c4690=_0xbe08[_0x262bd9];return _0x1c4690;};'use strict';var _=require('lodash');var util=require(_0x8be0('0x0'));var moment=require('moment');var BPromise=require(_0x8be0('0x1'));var rs=require(_0x8be0('0x2'));var fs=require('fs');var Redis=require(_0x8be0('0x3'));var db=require(_0x8be0('0x4'))['db'];var utils=require(_0x8be0('0x5'));var logger=require(_0x8be0('0x6'))(_0x8be0('0x7'));var config=require(_0x8be0('0x8'));var jayson=require(_0x8be0('0x9'));var client=jayson[_0x8be0('0xa')][_0x8be0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x297952,_0x46bcf4,_0x23effb){return new BPromise(function(_0x2dfbc2,_0xdcc321){return client[_0x8be0('0xc')](_0x297952,_0x23effb)[_0x8be0('0xd')](function(_0x13f48c){logger[_0x8be0('0xe')](_0x8be0('0xf'),_0x46bcf4,_0x8be0('0x10'));logger[_0x8be0('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x46bcf4,_0x8be0('0x10'),JSON['stringify'](_0x13f48c));if(_0x13f48c[_0x8be0('0x12')]){if(_0x13f48c[_0x8be0('0x12')][_0x8be0('0x13')]===0x1f4){logger['error'](_0x8be0('0xf'),_0x46bcf4,_0x13f48c[_0x8be0('0x12')][_0x8be0('0x14')]);return _0xdcc321(_0x13f48c[_0x8be0('0x12')]['message']);}logger[_0x8be0('0x12')](_0x8be0('0xf'),_0x46bcf4,_0x13f48c[_0x8be0('0x12')][_0x8be0('0x14')]);return _0x2dfbc2(_0x13f48c['error'][_0x8be0('0x14')]);}else{logger[_0x8be0('0xe')](_0x8be0('0xf'),_0x46bcf4,_0x8be0('0x10'));_0x2dfbc2(_0x13f48c[_0x8be0('0x15')][_0x8be0('0x14')]);}})['catch'](function(_0x2ba6be){logger[_0x8be0('0x12')](_0x8be0('0xf'),_0x46bcf4,_0x2ba6be);_0xdcc321(_0x2ba6be);});});}exports[_0x8be0('0x16')]=function(_0x4d5762){var _0x3f94dc=this;return new Promise(function(_0x43940e,_0x1d27ea){return db['CmHopper'][_0x8be0('0x17')]({'raw':_0x4d5762[_0x8be0('0x18')]?_0x4d5762[_0x8be0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d5762[_0x8be0('0x18')]?_0x4d5762['options'][_0x8be0('0x19')]||null:null,'attributes':_0x4d5762[_0x8be0('0x18')]?_0x4d5762[_0x8be0('0x18')][_0x8be0('0x1a')]||null:null,'limit':_0x4d5762[_0x8be0('0x18')]?_0x4d5762[_0x8be0('0x18')][_0x8be0('0x1b')]||null:null,'include':_0x4d5762[_0x8be0('0x18')]?_0x4d5762[_0x8be0('0x18')][_0x8be0('0x1c')]?_['map'](_0x4d5762['options'][_0x8be0('0x1c')],function(_0x4f90dd){return{'model':db[_0x4f90dd[_0x8be0('0x1d')]],'as':_0x4f90dd['as'],'attributes':_0x4f90dd[_0x8be0('0x1a')],'include':_0x4f90dd[_0x8be0('0x1c')]?_['map'](_0x4f90dd[_0x8be0('0x1c')],function(_0x198603){return{'model':db[_0x198603['model']],'as':_0x198603['as'],'attributes':_0x198603[_0x8be0('0x1a')],'include':_0x198603[_0x8be0('0x1c')]?_[_0x8be0('0x1e')](_0x198603[_0x8be0('0x1c')],function(_0xe939e7){return{'model':db[_0xe939e7['model']],'as':_0xe939e7['as'],'attributes':_0xe939e7[_0x8be0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8be0('0xd')](function(_0x5e8755){logger[_0x8be0('0xe')]('GetCmHopper',_0x4d5762);logger['debug']('GetCmHopper',_0x4d5762,JSON[_0x8be0('0x1f')](_0x5e8755));_0x43940e(_0x5e8755);})[_0x8be0('0x20')](function(_0x4dab6e){logger[_0x8be0('0x12')](_0x8be0('0x16'),_0x4dab6e[_0x8be0('0x14')],_0x4d5762);_0x1d27ea(_0x3f94dc[_0x8be0('0x12')](0x1f4,_0x4dab6e[_0x8be0('0x14')]));});});};exports[_0x8be0('0x21')]=function(_0x3dccbe){var _0x1cb85c=this;return new Promise(function(_0x48d71c,_0x7b1fd0){return db[_0x8be0('0x22')][_0x8be0('0x23')]({'raw':_0x3dccbe[_0x8be0('0x18')]?_0x3dccbe[_0x8be0('0x18')][_0x8be0('0x24')]===undefined?!![]:![]:!![],'where':_0x3dccbe[_0x8be0('0x18')]?_0x3dccbe[_0x8be0('0x18')]['where']||null:null,'attributes':_0x3dccbe['options']?_0x3dccbe['options'][_0x8be0('0x1a')]||null:null,'include':_0x3dccbe['options']?_0x3dccbe['options'][_0x8be0('0x1c')]?_[_0x8be0('0x1e')](_0x3dccbe[_0x8be0('0x18')][_0x8be0('0x1c')],function(_0x181ac3){return{'model':db[_0x181ac3['model']],'as':_0x181ac3['as'],'attributes':_0x181ac3[_0x8be0('0x1a')],'include':_0x181ac3[_0x8be0('0x1c')]?_[_0x8be0('0x1e')](_0x181ac3[_0x8be0('0x1c')],function(_0x38bdee){return{'model':db[_0x38bdee[_0x8be0('0x1d')]],'as':_0x38bdee['as'],'attributes':_0x38bdee[_0x8be0('0x1a')],'include':_0x38bdee[_0x8be0('0x1c')]?_[_0x8be0('0x1e')](_0x38bdee['include'],function(_0x17b10b){return{'model':db[_0x17b10b[_0x8be0('0x1d')]],'as':_0x17b10b['as'],'attributes':_0x17b10b['attributes']};}):[]};}):[]};}):[]:[]})[_0x8be0('0xd')](function(_0x1ce7ad){logger['info'](_0x8be0('0x21'),_0x3dccbe);logger[_0x8be0('0x11')](_0x8be0('0x21'),_0x3dccbe,JSON['stringify'](_0x1ce7ad));_0x48d71c(_0x1ce7ad);})['catch'](function(_0x138892){logger['error'](_0x8be0('0x21'),_0x138892[_0x8be0('0x14')],_0x3dccbe);_0x7b1fd0(_0x1cb85c[_0x8be0('0x12')](0x1f4,_0x138892[_0x8be0('0x14')]));});});};exports[_0x8be0('0x25')]=function(_0x51d66c){var _0x1d6607=this;return new Promise(function(_0x1a8922,_0x3f62b8){return db[_0x8be0('0x22')][_0x8be0('0x26')](_0x51d66c[_0x8be0('0x27')],{'raw':_0x51d66c[_0x8be0('0x18')]?_0x51d66c['options'][_0x8be0('0x24')]===undefined?!![]:![]:!![]})[_0x8be0('0xd')](function(_0x2fdab0){logger[_0x8be0('0xe')]('CreateCmHopper',_0x51d66c);logger['debug'](_0x8be0('0x25'),_0x51d66c,JSON[_0x8be0('0x1f')](_0x2fdab0));_0x1a8922(_0x2fdab0);})[_0x8be0('0x20')](function(_0x493325){logger[_0x8be0('0x12')](_0x8be0('0x25'),_0x493325[_0x8be0('0x14')],_0x51d66c);_0x3f62b8(_0x1d6607[_0x8be0('0x12')](0x1f4,_0x493325['message']));});});};exports[_0x8be0('0x28')]=function(_0x49819a){var _0x4fd35b=this;return new Promise(function(_0x4f23b9,_0xda9277){return db[_0x8be0('0x22')]['update'](_0x49819a[_0x8be0('0x27')],{'raw':_0x49819a[_0x8be0('0x18')]?_0x49819a[_0x8be0('0x18')][_0x8be0('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49819a[_0x8be0('0x18')]?_0x49819a['options'][_0x8be0('0x19')]||null:null,'attributes':_0x49819a[_0x8be0('0x18')]?_0x49819a[_0x8be0('0x18')][_0x8be0('0x1a')]||null:null,'limit':_0x49819a['options']?_0x49819a[_0x8be0('0x18')]['limit']||null:null})['then'](function(_0x1951a3){logger['info'](_0x8be0('0x28'),_0x49819a);logger[_0x8be0('0x11')](_0x8be0('0x28'),_0x49819a,JSON['stringify'](_0x1951a3));_0x4f23b9(_0x1951a3);})['catch'](function(_0x37115f){logger[_0x8be0('0x12')](_0x8be0('0x28'),_0x37115f[_0x8be0('0x14')],_0x49819a);_0xda9277(_0x4fd35b[_0x8be0('0x12')](0x1f4,_0x37115f[_0x8be0('0x14')]));});});};exports[_0x8be0('0x29')]=function(_0x21c93f){var _0x441ebc=this;return new Promise(function(_0x406eb5,_0x25deb8){return db[_0x8be0('0x22')][_0x8be0('0x2a')]({'where':_0x21c93f[_0x8be0('0x18')]?_0x21c93f[_0x8be0('0x18')][_0x8be0('0x19')]||null:null})[_0x8be0('0xd')](function(_0x301fb5){logger[_0x8be0('0xe')](_0x8be0('0x29'),_0x21c93f);logger[_0x8be0('0x11')]('DestroyCmHopper',_0x21c93f,JSON['stringify'](_0x301fb5));_0x406eb5(_0x301fb5);})[_0x8be0('0x20')](function(_0x1e7b6a){logger['error'](_0x8be0('0x29'),_0x1e7b6a[_0x8be0('0x14')],_0x21c93f);_0x25deb8(_0x441ebc[_0x8be0('0x12')](0x1f4,_0x1e7b6a[_0x8be0('0x14')]));});});};exports[_0x8be0('0x2b')]=function(_0xdb9f21){var _0x10ee73=this;return new Promise(function(_0x90bb3b,_0x5dffaa){return db[_0x8be0('0x2c')][_0x8be0('0x2d')]()[_0x8be0('0xd')](function(_0x4b5343){return db[_0x8be0('0x2e')][_0x8be0('0x2f')](function(_0x2f82c6){return db[_0x8be0('0x22')]['findAll']({'where':_0xdb9f21[_0x8be0('0x18')]?_0xdb9f21[_0x8be0('0x18')]['where']||null:null,'attributes':_0xdb9f21[_0x8be0('0x18')]?_0xdb9f21[_0x8be0('0x18')]['attributes']||null:null,'limit':_0xdb9f21['options']?_0xdb9f21['options'][_0x8be0('0x1b')]||null:null,'order':_0xdb9f21['options']?_0xdb9f21[_0x8be0('0x18')][_0x8be0('0x30')]||null:null,'transaction':_0x2f82c6,'lock':_0x2f82c6[_0x8be0('0x31')][_0x8be0('0x32')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_['keys'](_0x4b5343)}]})['then'](function(_0x36f855){var _0x3ff280=[];for(var _0x52c709=0x0;_0x52c709<_0x36f855[_0x8be0('0x33')];_0x52c709+=0x1){_0x3ff280['push'](_0x36f855[_0x52c709]['update'](_0xdb9f21[_0x8be0('0x27')],{'transaction':_0x2f82c6}));}return BPromise[_0x8be0('0x34')](_0x3ff280);});})['then'](function(_0x1a2547){logger[_0x8be0('0xe')](_0x8be0('0x2b'),_0xdb9f21);logger['debug'](_0x8be0('0x2b'),_0xdb9f21,JSON[_0x8be0('0x1f')](_0x1a2547));_0x90bb3b(_0x1a2547);})[_0x8be0('0x20')](function(_0x440a1f){logger[_0x8be0('0x12')](_0x8be0('0x2b'),_0x440a1f['message'],_0xdb9f21);_0x5dffaa(_0x10ee73['error'](0x1f4,_0x440a1f['message']));});});});};exports['MoveContactManagedDialer']=function(_0x17d458){var _0x3b9029=this;return new Promise(function(_0x1f3694,_0x1b768f){return db['sequelize'][_0x8be0('0x2f')](function(_0x345696){return db[_0x8be0('0x35')][_0x8be0('0x26')](_0x17d458[_0x8be0('0x27')],{'raw':_0x17d458[_0x8be0('0x18')]?_0x17d458[_0x8be0('0x18')][_0x8be0('0x24')]===undefined?!![]:![]:!![],'transaction':_0x345696})[_0x8be0('0xd')](function(){return db[_0x8be0('0x22')][_0x8be0('0x2a')]({'where':_0x17d458[_0x8be0('0x18')]?_0x17d458[_0x8be0('0x18')][_0x8be0('0x19')]||null:null,'transaction':_0x345696});});})[_0x8be0('0xd')](function(_0x5b81b3){logger['info'](_0x8be0('0x36'),_0x17d458);logger[_0x8be0('0x11')](_0x8be0('0x36'),_0x17d458,JSON[_0x8be0('0x1f')](_0x5b81b3));_0x1f3694(_0x5b81b3);})[_0x8be0('0x20')](function(_0xfb2adc){logger['error'](_0x8be0('0x36'),_0xfb2adc[_0x8be0('0x14')],_0x17d458);_0x1b768f(_0x3b9029['error'](0x1f4,_0xfb2adc[_0x8be0('0x14')]));});});};exports[_0x8be0('0x37')]=function(_0x7705f5){var _0x1b0cd4=this;return new Promise(function(_0x230a8f,_0x185f6f){return db['CmHopper'][_0x8be0('0x17')]({'raw':_0x7705f5[_0x8be0('0x18')]?_0x7705f5[_0x8be0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x7705f5[_0x8be0('0x18')]?_0x7705f5[_0x8be0('0x18')][_0x8be0('0x19')]||null:null,'attributes':[[db[_0x8be0('0x2e')]['fn'](_0x8be0('0x38'),db['sequelize']['fn']('IF',db['sequelize'][_0x8be0('0x39')](_0x8be0('0x3a')+util[_0x8be0('0x3b')](_0x8be0('0x3c'),moment()['format'](_0x8be0('0x3d')))+_0x8be0('0x3e')))),_0x8be0('0x3f')]]})[_0x8be0('0xd')](function(_0x21ab2c){logger[_0x8be0('0xe')](_0x8be0('0x37'),_0x7705f5);logger[_0x8be0('0x11')](_0x8be0('0x37'),_0x7705f5,JSON['stringify'](_0x21ab2c));_0x230a8f(_0x21ab2c);})[_0x8be0('0x20')](function(_0x34522b){logger[_0x8be0('0x12')](_0x8be0('0x37'),_0x34522b[_0x8be0('0x14')],_0x7705f5);_0x185f6f(_0x1b0cd4[_0x8be0('0x12')](0x1f4,_0x34522b['message']));});});};exports[_0x8be0('0x40')]=function(_0xe904c7){var _0x571655=this;return new Promise(function(_0xff2e73,_0x4f44a7){return db[_0x8be0('0x2c')]['describe']()[_0x8be0('0xd')](function(_0xed691f){return db[_0x8be0('0x2e')][_0x8be0('0x2f')](function(_0x432b55){return db['CmHopper'][_0x8be0('0x17')]({'where':_0xe904c7[_0x8be0('0x18')]?_0xe904c7[_0x8be0('0x18')]['where']||null:null,'attributes':_0xe904c7[_0x8be0('0x18')]?_0xe904c7[_0x8be0('0x18')]['attributes']||null:null,'limit':0x1,'order':_0xe904c7['options']?_0xe904c7[_0x8be0('0x18')][_0x8be0('0x30')]||null:null,'group':db['CmHopper'][_0x8be0('0x41')],'transaction':_0x432b55,'lock':_0x432b55['LOCK']['UPDATE'],'include':_0xe904c7['options']?_0xe904c7[_0x8be0('0x18')][_0x8be0('0x1c')]?_[_0x8be0('0x1e')](_0xe904c7['options'][_0x8be0('0x1c')],function(_0x44d0bf){return{'model':db[_0x44d0bf[_0x8be0('0x1d')]],'as':_0x44d0bf['as'],'attributes':_0x44d0bf[_0x8be0('0x1a')],'include':_0x44d0bf['include']?_['map'](_0x44d0bf[_0x8be0('0x1c')],function(_0x4632db){return{'model':db[_0x4632db[_0x8be0('0x1d')]],'as':_0x4632db['as'],'attributes':_0x4632db[_0x8be0('0x1a')],'include':_0x4632db['include']?_[_0x8be0('0x1e')](_0x4632db[_0x8be0('0x1c')],function(_0x570d85){return{'model':db[_0x570d85[_0x8be0('0x1d')]],'as':_0x570d85['as'],'attributes':_0x570d85[_0x8be0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8be0('0xd')](function(_0x166cfb){var _0x563e0f=[];for(var _0x82f48c=0x0;_0x82f48c<_0x166cfb[_0x8be0('0x33')];_0x82f48c+=0x1){_0x563e0f[_0x8be0('0x42')](_0x166cfb[_0x82f48c][_0x8be0('0x43')](_0xe904c7[_0x8be0('0x27')],{'transaction':_0x432b55}));}return BPromise['all'](_0x563e0f);});})[_0x8be0('0xd')](function(_0x42de4b){logger[_0x8be0('0xe')](_0x8be0('0x40'),_0xe904c7);logger['debug']('GetContactRecallMe',_0xe904c7,JSON[_0x8be0('0x1f')](_0x42de4b));_0xff2e73(_0x42de4b);})[_0x8be0('0x20')](function(_0x24f21a){logger[_0x8be0('0x12')](_0x8be0('0x40'),_0x24f21a[_0x8be0('0x14')],_0xe904c7);_0x4f44a7(_0x571655[_0x8be0('0x12')](0x1f4,_0x24f21a[_0x8be0('0x14')]));});});});}; \ No newline at end of file +var _0xbfc5=['raw','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','transaction','findAll','order','LOCK','UPDATE','CmContact','Contact','length','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','where','attributes','limit','include','model','map','ShowCmHopper','find','CreateCmHopper','body'];(function(_0x41ad44,_0xc7a53c){var _0x1b86c3=function(_0x3fd10c){while(--_0x3fd10c){_0x41ad44['push'](_0x41ad44['shift']());}};_0x1b86c3(++_0xc7a53c);}(_0xbfc5,0x16e));var _0x5bfc=function(_0xd707b9,_0x24ab69){_0xd707b9=_0xd707b9-0x0;var _0xf81c9e=_0xbfc5[_0xd707b9];return _0xf81c9e;};'use strict';var _=require(_0x5bfc('0x0'));var util=require(_0x5bfc('0x1'));var moment=require(_0x5bfc('0x2'));var BPromise=require('bluebird');var rs=require(_0x5bfc('0x3'));var fs=require('fs');var Redis=require(_0x5bfc('0x4'));var db=require(_0x5bfc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bfc('0x6'))(_0x5bfc('0x7'));var config=require(_0x5bfc('0x8'));var jayson=require(_0x5bfc('0x9'));var client=jayson[_0x5bfc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ad98b,_0x4fe4f5,_0x43c10c){return new BPromise(function(_0x3c60a2,_0x13369b){return client[_0x5bfc('0xb')](_0x4ad98b,_0x43c10c)[_0x5bfc('0xc')](function(_0x256c98){logger[_0x5bfc('0xd')](_0x5bfc('0xe'),_0x4fe4f5,_0x5bfc('0xf'));logger[_0x5bfc('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4fe4f5,_0x5bfc('0xf'),JSON[_0x5bfc('0x11')](_0x256c98));if(_0x256c98[_0x5bfc('0x12')]){if(_0x256c98['error'][_0x5bfc('0x13')]===0x1f4){logger[_0x5bfc('0x12')](_0x5bfc('0xe'),_0x4fe4f5,_0x256c98['error']['message']);return _0x13369b(_0x256c98[_0x5bfc('0x12')][_0x5bfc('0x14')]);}logger[_0x5bfc('0x12')]('CmHopper,\x20%s,\x20%s',_0x4fe4f5,_0x256c98[_0x5bfc('0x12')]['message']);return _0x3c60a2(_0x256c98[_0x5bfc('0x12')][_0x5bfc('0x14')]);}else{logger[_0x5bfc('0xd')](_0x5bfc('0xe'),_0x4fe4f5,'request\x20sent');_0x3c60a2(_0x256c98[_0x5bfc('0x15')][_0x5bfc('0x14')]);}})[_0x5bfc('0x16')](function(_0x154bfe){logger[_0x5bfc('0x12')](_0x5bfc('0xe'),_0x4fe4f5,_0x154bfe);_0x13369b(_0x154bfe);});});}exports[_0x5bfc('0x17')]=function(_0x4dc0e2){var _0x43ed61=this;return new Promise(function(_0x462d35,_0x3cf13f){return db[_0x5bfc('0x18')]['findAll']({'raw':_0x4dc0e2[_0x5bfc('0x19')]?_0x4dc0e2[_0x5bfc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4dc0e2[_0x5bfc('0x19')]?_0x4dc0e2[_0x5bfc('0x19')][_0x5bfc('0x1a')]||null:null,'attributes':_0x4dc0e2[_0x5bfc('0x19')]?_0x4dc0e2['options'][_0x5bfc('0x1b')]||null:null,'limit':_0x4dc0e2['options']?_0x4dc0e2[_0x5bfc('0x19')][_0x5bfc('0x1c')]||null:null,'include':_0x4dc0e2[_0x5bfc('0x19')]?_0x4dc0e2['options'][_0x5bfc('0x1d')]?_['map'](_0x4dc0e2[_0x5bfc('0x19')]['include'],function(_0x58f627){return{'model':db[_0x58f627[_0x5bfc('0x1e')]],'as':_0x58f627['as'],'attributes':_0x58f627[_0x5bfc('0x1b')],'include':_0x58f627[_0x5bfc('0x1d')]?_[_0x5bfc('0x1f')](_0x58f627[_0x5bfc('0x1d')],function(_0x30d64d){return{'model':db[_0x30d64d['model']],'as':_0x30d64d['as'],'attributes':_0x30d64d[_0x5bfc('0x1b')],'include':_0x30d64d['include']?_['map'](_0x30d64d[_0x5bfc('0x1d')],function(_0x11886d){return{'model':db[_0x11886d[_0x5bfc('0x1e')]],'as':_0x11886d['as'],'attributes':_0x11886d[_0x5bfc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5bfc('0xc')](function(_0x44b26d){logger[_0x5bfc('0xd')]('GetCmHopper',_0x4dc0e2);logger[_0x5bfc('0x10')](_0x5bfc('0x17'),_0x4dc0e2,JSON[_0x5bfc('0x11')](_0x44b26d));_0x462d35(_0x44b26d);})['catch'](function(_0xac31ae){logger[_0x5bfc('0x12')]('GetCmHopper',_0xac31ae[_0x5bfc('0x14')],_0x4dc0e2);_0x3cf13f(_0x43ed61[_0x5bfc('0x12')](0x1f4,_0xac31ae['message']));});});};exports[_0x5bfc('0x20')]=function(_0x547a2f){var _0x331cd1=this;return new Promise(function(_0x10f2cb,_0x4467e4){return db[_0x5bfc('0x18')][_0x5bfc('0x21')]({'raw':_0x547a2f[_0x5bfc('0x19')]?_0x547a2f[_0x5bfc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x547a2f[_0x5bfc('0x19')]?_0x547a2f['options'][_0x5bfc('0x1a')]||null:null,'attributes':_0x547a2f[_0x5bfc('0x19')]?_0x547a2f[_0x5bfc('0x19')][_0x5bfc('0x1b')]||null:null,'include':_0x547a2f[_0x5bfc('0x19')]?_0x547a2f['options'][_0x5bfc('0x1d')]?_[_0x5bfc('0x1f')](_0x547a2f[_0x5bfc('0x19')][_0x5bfc('0x1d')],function(_0x169711){return{'model':db[_0x169711[_0x5bfc('0x1e')]],'as':_0x169711['as'],'attributes':_0x169711[_0x5bfc('0x1b')],'include':_0x169711[_0x5bfc('0x1d')]?_[_0x5bfc('0x1f')](_0x169711[_0x5bfc('0x1d')],function(_0x54940b){return{'model':db[_0x54940b[_0x5bfc('0x1e')]],'as':_0x54940b['as'],'attributes':_0x54940b[_0x5bfc('0x1b')],'include':_0x54940b[_0x5bfc('0x1d')]?_['map'](_0x54940b[_0x5bfc('0x1d')],function(_0x2e8573){return{'model':db[_0x2e8573[_0x5bfc('0x1e')]],'as':_0x2e8573['as'],'attributes':_0x2e8573[_0x5bfc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5bfc('0xc')](function(_0x462388){logger['info'](_0x5bfc('0x20'),_0x547a2f);logger['debug']('ShowCmHopper',_0x547a2f,JSON[_0x5bfc('0x11')](_0x462388));_0x10f2cb(_0x462388);})[_0x5bfc('0x16')](function(_0x547b6d){logger[_0x5bfc('0x12')](_0x5bfc('0x20'),_0x547b6d[_0x5bfc('0x14')],_0x547a2f);_0x4467e4(_0x331cd1['error'](0x1f4,_0x547b6d[_0x5bfc('0x14')]));});});};exports[_0x5bfc('0x22')]=function(_0x2ae7f0){var _0x428027=this;return new Promise(function(_0x41193c,_0x4dfa93){return db[_0x5bfc('0x18')]['create'](_0x2ae7f0[_0x5bfc('0x23')],{'raw':_0x2ae7f0['options']?_0x2ae7f0[_0x5bfc('0x19')][_0x5bfc('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0xdf9e6f){logger[_0x5bfc('0xd')](_0x5bfc('0x22'),_0x2ae7f0);logger[_0x5bfc('0x10')]('CreateCmHopper',_0x2ae7f0,JSON[_0x5bfc('0x11')](_0xdf9e6f));_0x41193c(_0xdf9e6f);})[_0x5bfc('0x16')](function(_0x46c818){logger[_0x5bfc('0x12')]('CreateCmHopper',_0x46c818['message'],_0x2ae7f0);_0x4dfa93(_0x428027[_0x5bfc('0x12')](0x1f4,_0x46c818[_0x5bfc('0x14')]));});});};exports[_0x5bfc('0x25')]=function(_0x49803b){var _0x449dc4=this;return new Promise(function(_0x5dd84b,_0x8e6837){return db[_0x5bfc('0x18')][_0x5bfc('0x26')](_0x49803b[_0x5bfc('0x23')],{'raw':_0x49803b[_0x5bfc('0x19')]?_0x49803b[_0x5bfc('0x19')][_0x5bfc('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49803b[_0x5bfc('0x19')]?_0x49803b['options'][_0x5bfc('0x1a')]||null:null,'attributes':_0x49803b[_0x5bfc('0x19')]?_0x49803b['options'][_0x5bfc('0x1b')]||null:null,'limit':_0x49803b[_0x5bfc('0x19')]?_0x49803b[_0x5bfc('0x19')][_0x5bfc('0x1c')]||null:null})[_0x5bfc('0xc')](function(_0x25008a){logger['info'](_0x5bfc('0x25'),_0x49803b);logger[_0x5bfc('0x10')]('UpdateCmHopper',_0x49803b,JSON[_0x5bfc('0x11')](_0x25008a));_0x5dd84b(_0x25008a);})[_0x5bfc('0x16')](function(_0x1b1666){logger[_0x5bfc('0x12')](_0x5bfc('0x25'),_0x1b1666[_0x5bfc('0x14')],_0x49803b);_0x8e6837(_0x449dc4[_0x5bfc('0x12')](0x1f4,_0x1b1666['message']));});});};exports[_0x5bfc('0x27')]=function(_0x4a1003){var _0x55cb20=this;return new Promise(function(_0x2d236c,_0x24c2d1){return db[_0x5bfc('0x18')][_0x5bfc('0x28')]({'where':_0x4a1003[_0x5bfc('0x19')]?_0x4a1003[_0x5bfc('0x19')][_0x5bfc('0x1a')]||null:null})[_0x5bfc('0xc')](function(_0x101106){logger[_0x5bfc('0xd')](_0x5bfc('0x27'),_0x4a1003);logger[_0x5bfc('0x10')](_0x5bfc('0x27'),_0x4a1003,JSON['stringify'](_0x101106));_0x2d236c(_0x101106);})['catch'](function(_0x4e672d){logger[_0x5bfc('0x12')](_0x5bfc('0x27'),_0x4e672d[_0x5bfc('0x14')],_0x4a1003);_0x24c2d1(_0x55cb20[_0x5bfc('0x12')](0x1f4,_0x4e672d[_0x5bfc('0x14')]));});});};exports[_0x5bfc('0x29')]=function(_0x80ad67){var _0x47bf05=this;return new Promise(function(_0x5edf8c,_0x18efb8){return db['CmContact'][_0x5bfc('0x2a')]()['then'](function(_0x28120d){return db['sequelize'][_0x5bfc('0x2b')](function(_0x36cd29){return db[_0x5bfc('0x18')][_0x5bfc('0x2c')]({'where':_0x80ad67[_0x5bfc('0x19')]?_0x80ad67[_0x5bfc('0x19')][_0x5bfc('0x1a')]||null:null,'attributes':_0x80ad67[_0x5bfc('0x19')]?_0x80ad67[_0x5bfc('0x19')][_0x5bfc('0x1b')]||null:null,'limit':_0x80ad67[_0x5bfc('0x19')]?_0x80ad67[_0x5bfc('0x19')][_0x5bfc('0x1c')]||null:null,'order':_0x80ad67['options']?_0x80ad67[_0x5bfc('0x19')][_0x5bfc('0x2d')]||null:null,'transaction':_0x36cd29,'lock':_0x36cd29[_0x5bfc('0x2e')][_0x5bfc('0x2f')],'include':[{'model':db[_0x5bfc('0x30')],'as':_0x5bfc('0x31'),'attributes':_['keys'](_0x28120d)}]})[_0x5bfc('0xc')](function(_0xc5c347){var _0xb44876=[];for(var _0x1d7582=0x0;_0x1d7582<_0xc5c347[_0x5bfc('0x32')];_0x1d7582+=0x1){_0xb44876[_0x5bfc('0x33')](_0xc5c347[_0x1d7582][_0x5bfc('0x26')](_0x80ad67['body'],{'transaction':_0x36cd29}));}return BPromise[_0x5bfc('0x34')](_0xb44876);});})[_0x5bfc('0xc')](function(_0x3569a6){logger[_0x5bfc('0xd')](_0x5bfc('0x29'),_0x80ad67);logger[_0x5bfc('0x10')](_0x5bfc('0x29'),_0x80ad67,JSON[_0x5bfc('0x11')](_0x3569a6));_0x5edf8c(_0x3569a6);})['catch'](function(_0x5741ac){logger['error']('GetContactDialer',_0x5741ac[_0x5bfc('0x14')],_0x80ad67);_0x18efb8(_0x47bf05[_0x5bfc('0x12')](0x1f4,_0x5741ac['message']));});});});};exports[_0x5bfc('0x35')]=function(_0x5b0759){var _0x9d0bad=this;return new Promise(function(_0x9ff827,_0xac620b){return db[_0x5bfc('0x36')][_0x5bfc('0x2b')](function(_0x50fac1){return db[_0x5bfc('0x37')][_0x5bfc('0x38')](_0x5b0759[_0x5bfc('0x23')],{'raw':_0x5b0759[_0x5bfc('0x19')]?_0x5b0759[_0x5bfc('0x19')][_0x5bfc('0x24')]===undefined?!![]:![]:!![],'transaction':_0x50fac1})[_0x5bfc('0xc')](function(){return db['CmHopper'][_0x5bfc('0x28')]({'where':_0x5b0759[_0x5bfc('0x19')]?_0x5b0759[_0x5bfc('0x19')][_0x5bfc('0x1a')]||null:null,'transaction':_0x50fac1});});})['then'](function(_0x3e1988){logger[_0x5bfc('0xd')](_0x5bfc('0x35'),_0x5b0759);logger[_0x5bfc('0x10')]('MoveContactManagedDialer',_0x5b0759,JSON[_0x5bfc('0x11')](_0x3e1988));_0x9ff827(_0x3e1988);})[_0x5bfc('0x16')](function(_0x397fe1){logger[_0x5bfc('0x12')](_0x5bfc('0x35'),_0x397fe1[_0x5bfc('0x14')],_0x5b0759);_0xac620b(_0x9d0bad[_0x5bfc('0x12')](0x1f4,_0x397fe1[_0x5bfc('0x14')]));});});};exports[_0x5bfc('0x39')]=function(_0x5c1773){var _0x43b1e5=this;return new Promise(function(_0x3da72b,_0xba9535){return db['CmHopper'][_0x5bfc('0x2c')]({'raw':_0x5c1773[_0x5bfc('0x19')]?_0x5c1773[_0x5bfc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5c1773[_0x5bfc('0x19')]?_0x5c1773[_0x5bfc('0x19')][_0x5bfc('0x1a')]||null:null,'attributes':[[db[_0x5bfc('0x36')]['fn'](_0x5bfc('0x3a'),db['sequelize']['fn']('IF',db[_0x5bfc('0x36')][_0x5bfc('0x3b')](_0x5bfc('0x3c')+util[_0x5bfc('0x3d')](_0x5bfc('0x3e'),moment()[_0x5bfc('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x5bfc('0x3f')))),_0x5bfc('0x40')]]})[_0x5bfc('0xc')](function(_0x135af1){logger['info'](_0x5bfc('0x39'),_0x5c1773);logger[_0x5bfc('0x10')]('CountReScheduled',_0x5c1773,JSON['stringify'](_0x135af1));_0x3da72b(_0x135af1);})[_0x5bfc('0x16')](function(_0x2b074e){logger[_0x5bfc('0x12')](_0x5bfc('0x39'),_0x2b074e[_0x5bfc('0x14')],_0x5c1773);_0xba9535(_0x43b1e5[_0x5bfc('0x12')](0x1f4,_0x2b074e['message']));});});};exports[_0x5bfc('0x41')]=function(_0x440248){var _0x2bf664=this;return new Promise(function(_0x14c054,_0xf13d6e){return db['CmContact'][_0x5bfc('0x2a')]()[_0x5bfc('0xc')](function(_0x2e1199){return db['sequelize'][_0x5bfc('0x2b')](function(_0x13cd22){return db[_0x5bfc('0x18')]['findAll']({'where':_0x440248[_0x5bfc('0x19')]?_0x440248[_0x5bfc('0x19')]['where']||null:null,'attributes':_0x440248[_0x5bfc('0x19')]?_0x440248[_0x5bfc('0x19')][_0x5bfc('0x1b')]||null:null,'limit':0x1,'order':_0x440248[_0x5bfc('0x19')]?_0x440248[_0x5bfc('0x19')][_0x5bfc('0x2d')]||null:null,'group':db[_0x5bfc('0x18')][_0x5bfc('0x42')],'transaction':_0x13cd22,'lock':_0x13cd22[_0x5bfc('0x2e')][_0x5bfc('0x2f')],'include':_0x440248['options']?_0x440248[_0x5bfc('0x19')][_0x5bfc('0x1d')]?_[_0x5bfc('0x1f')](_0x440248[_0x5bfc('0x19')][_0x5bfc('0x1d')],function(_0x18b35f){return{'model':db[_0x18b35f[_0x5bfc('0x1e')]],'as':_0x18b35f['as'],'attributes':_0x18b35f[_0x5bfc('0x1b')],'include':_0x18b35f[_0x5bfc('0x1d')]?_[_0x5bfc('0x1f')](_0x18b35f['include'],function(_0x3a0bcd){return{'model':db[_0x3a0bcd[_0x5bfc('0x1e')]],'as':_0x3a0bcd['as'],'attributes':_0x3a0bcd[_0x5bfc('0x1b')],'include':_0x3a0bcd[_0x5bfc('0x1d')]?_[_0x5bfc('0x1f')](_0x3a0bcd[_0x5bfc('0x1d')],function(_0x596471){return{'model':db[_0x596471[_0x5bfc('0x1e')]],'as':_0x596471['as'],'attributes':_0x596471['attributes']};}):[]};}):[]};}):[]:[]})[_0x5bfc('0xc')](function(_0x2cbea1){var _0x225450=[];for(var _0x486b5f=0x0;_0x486b5f<_0x2cbea1[_0x5bfc('0x32')];_0x486b5f+=0x1){_0x225450[_0x5bfc('0x33')](_0x2cbea1[_0x486b5f][_0x5bfc('0x26')](_0x440248[_0x5bfc('0x23')],{'transaction':_0x13cd22}));}return BPromise[_0x5bfc('0x34')](_0x225450);});})[_0x5bfc('0xc')](function(_0x6ca45d){logger[_0x5bfc('0xd')]('GetContactRecallMe',_0x440248);logger[_0x5bfc('0x10')](_0x5bfc('0x41'),_0x440248,JSON[_0x5bfc('0x11')](_0x6ca45d));_0x14c054(_0x6ca45d);})[_0x5bfc('0x16')](function(_0x32264c){logger['error'](_0x5bfc('0x41'),_0x32264c[_0x5bfc('0x14')],_0x440248);_0xf13d6e(_0x2bf664[_0x5bfc('0x12')](0x1f4,_0x32264c[_0x5bfc('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c2182b6..4bf4b5b 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 _0xf987=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','describe','getOpenContacts','/:id','post','create','/preview','getPreview','put','update','delete','destroy','exports','multer','path'];(function(_0x16d7a6,_0x4dac64){var _0x397bc1=function(_0x60f652){while(--_0x60f652){_0x16d7a6['push'](_0x16d7a6['shift']());}};_0x397bc1(++_0x4dac64);}(_0xf987,0x11c));var _0x7f98=function(_0x397e70,_0x4ab94a){_0x397e70=_0x397e70-0x0;var _0x512fbb=_0xf987[_0x397e70];return _0x512fbb;};'use strict';var multer=require(_0x7f98('0x0'));var util=require('util');var path=require(_0x7f98('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f98('0x2')]();var auth=require(_0x7f98('0x3'));var interaction=require(_0x7f98('0x4'));var config=require(_0x7f98('0x5'));var controller=require(_0x7f98('0x6'));router['get']('/',auth[_0x7f98('0x7')](),controller[_0x7f98('0x8')]);router[_0x7f98('0x9')]('/describe',auth[_0x7f98('0x7')](),controller[_0x7f98('0xa')]);router[_0x7f98('0x9')]('/opencontacts',auth[_0x7f98('0x7')](),controller[_0x7f98('0xb')]);router[_0x7f98('0x9')](_0x7f98('0xc'),auth[_0x7f98('0x7')](),controller['show']);router[_0x7f98('0xd')]('/',auth[_0x7f98('0x7')](),controller[_0x7f98('0xe')]);router[_0x7f98('0xd')](_0x7f98('0xf'),auth[_0x7f98('0x7')](),controller[_0x7f98('0x10')]);router[_0x7f98('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7f98('0x12')]);router[_0x7f98('0x13')](_0x7f98('0xc'),auth['isAuthenticated'](),controller[_0x7f98('0x14')]);module[_0x7f98('0x15')]=router; \ No newline at end of file +var _0x1e45=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','getPreview','put','update','destroy','exports','multer','util'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x1e45,0x1c0));var _0x51e4=function(_0x58bf27,_0x194127){_0x58bf27=_0x58bf27-0x0;var _0x1e82b8=_0x1e45[_0x58bf27];return _0x1e82b8;};'use strict';var multer=require(_0x51e4('0x0'));var util=require(_0x51e4('0x1'));var path=require(_0x51e4('0x2'));var timeout=require(_0x51e4('0x3'));var express=require(_0x51e4('0x4'));var router=express[_0x51e4('0x5')]();var auth=require(_0x51e4('0x6'));var interaction=require(_0x51e4('0x7'));var config=require('../../config/environment');var controller=require(_0x51e4('0x8'));router['get']('/',auth[_0x51e4('0x9')](),controller[_0x51e4('0xa')]);router[_0x51e4('0xb')](_0x51e4('0xc'),auth[_0x51e4('0x9')](),controller[_0x51e4('0xd')]);router[_0x51e4('0xb')](_0x51e4('0xe'),auth[_0x51e4('0x9')](),controller[_0x51e4('0xf')]);router[_0x51e4('0xb')](_0x51e4('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x51e4('0x11')]('/',auth[_0x51e4('0x9')](),controller[_0x51e4('0x12')]);router[_0x51e4('0x11')](_0x51e4('0x13'),auth['isAuthenticated'](),controller[_0x51e4('0x14')]);router[_0x51e4('0x15')](_0x51e4('0x10'),auth[_0x51e4('0x9')](),controller[_0x51e4('0x16')]);router['delete'](_0x51e4('0x10'),auth[_0x51e4('0x9')](),controller[_0x51e4('0x17')]);module[_0x51e4('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index b2a849c..c8652ec 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 _0x0c10=['moment','exports','contactListQueue'];(function(_0x2b3de8,_0x2659cf){var _0x26b1fb=function(_0x5e897c){while(--_0x5e897c){_0x2b3de8['push'](_0x2b3de8['shift']());}};_0x26b1fb(++_0x2659cf);}(_0x0c10,0xa5));var _0x00c1=function(_0x18a313,_0x54020e){_0x18a313=_0x18a313-0x0;var _0x44ac80=_0x0c10[_0x18a313];return _0x44ac80;};'use strict';var moment=require(_0x00c1('0x0'));var Sequelize=require('sequelize');module[_0x00c1('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x00c1('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x00c1('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x641e=['contactListQueue','INTEGER','moment','sequelize','exports','STRING'];(function(_0x3bac3d,_0x338f17){var _0x90fbe9=function(_0x498e04){while(--_0x498e04){_0x3bac3d['push'](_0x3bac3d['shift']());}};_0x90fbe9(++_0x338f17);}(_0x641e,0x1d0));var _0xe641=function(_0x5e3bb0,_0x480edf){_0x5e3bb0=_0x5e3bb0-0x0;var _0xd84d74=_0x641e[_0x5e3bb0];return _0xd84d74;};'use strict';var moment=require(_0xe641('0x0'));var Sequelize=require(_0xe641('0x1'));module[_0xe641('0x2')]={'phone':{'type':Sequelize[_0xe641('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe641('0x4')},'ListId':{'type':Sequelize[_0xe641('0x5')],'unique':_0xe641('0x4')},'VoiceQueueId':{'type':Sequelize[_0xe641('0x5')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2b7776c..bb11b70 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 _0x1619=['jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','options','includeAll','findAll','catch','show','params','intersection','include','find','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1619,0x189));var _0x9161=function(_0x1277b8,_0x189a58){_0x1277b8=_0x1277b8-0x0;var _0x4bc1ad=_0x1619[_0x1277b8];return _0x4bc1ad;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9161('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9161('0x1'));var rp=require(_0x9161('0x2'));var moment=require(_0x9161('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9161('0x4'));var util=require('util');var path=require(_0x9161('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9161('0x6'));var fs=require('fs');var _=require(_0x9161('0x7'));var squel=require('squel');var crypto=require(_0x9161('0x8'));var jsforce=require(_0x9161('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x9161('0xa'));var querystring=require('querystring');var Papa=require(_0x9161('0xb'));var Redis=require('ioredis');var authService=require(_0x9161('0xc'));var qs=require(_0x9161('0xd'));var as=require(_0x9161('0xe'));var hardwareService=require(_0x9161('0xf'));var logger=require(_0x9161('0x10'))(_0x9161('0x11'));var utils=require(_0x9161('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52f17c,_0x4b955d){_0x4b955d=_0x4b955d||0xcc;return function(_0x19a636){if(_0x19a636){return _0x52f17c['sendStatus'](_0x4b955d);}return _0x52f17c[_0x9161('0x13')](_0x4b955d)[_0x9161('0x14')]();};}function respondWithResult(_0x2ad36d,_0x308d04){_0x308d04=_0x308d04||0xc8;return function(_0x1ddcbc){if(_0x1ddcbc){return _0x2ad36d[_0x9161('0x13')](_0x308d04)[_0x9161('0x15')](_0x1ddcbc);}};}function respondWithFilteredResult(_0xc3768a,_0x4e46f5){return function(_0x147ba9){if(_0x147ba9){var _0x36677d=_0x147ba9[_0x9161('0x16')],_0x3ec5c5=_0x4e46f5[_0x9161('0x17')],_0x5bf2be=_0x4e46f5['offset']+_0x4e46f5[_0x9161('0x18')],_0x2057da;if(_0x5bf2be>=_0x36677d){_0x5bf2be=_0x36677d;_0x2057da=0xc8;}else{_0x2057da=0xce;}_0xc3768a[_0x9161('0x13')](_0x2057da);return _0xc3768a['set'](_0x9161('0x19'),_0x3ec5c5+'-'+_0x5bf2be+'/'+_0x36677d)[_0x9161('0x15')](_0x147ba9);}return null;};}function patchUpdates(_0x1b89f3){return function(_0x2fdefc){try{jsonpatch[_0x9161('0x1a')](_0x2fdefc,_0x1b89f3,!![]);}catch(_0x170356){return BPromise[_0x9161('0x1b')](_0x170356);}return _0x2fdefc['save']();};}function saveUpdates(_0x73d1cc,_0x53b67e){return function(_0x1f137c){if(_0x1f137c){return _0x1f137c[_0x9161('0x1c')](_0x73d1cc)[_0x9161('0x1d')](function(_0x56b77a){return _0x56b77a;});}return null;};}function removeEntity(_0x510863,_0x50041f){return function(_0x27265b){if(_0x27265b){return _0x27265b[_0x9161('0x1e')]()['then'](function(){_0x510863['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b4eed,_0x20fa48){return function(_0x41a5f8){if(!_0x41a5f8){_0x5b4eed[_0x9161('0x1f')](0x194);}return _0x41a5f8;};}function handleError(_0x2ffeb4,_0x255b08){_0x255b08=_0x255b08||0x1f4;return function(_0xa3384f){logger[_0x9161('0x20')](_0xa3384f['stack']);if(_0xa3384f[_0x9161('0x21')]){delete _0xa3384f[_0x9161('0x21')];}_0x2ffeb4[_0x9161('0x13')](_0x255b08)[_0x9161('0x22')](_0xa3384f);};}exports[_0x9161('0x23')]=function(_0x664892,_0x3102f7){var _0xabd4f7={},_0x588ea6={},_0x1ae0df={'count':0x0,'rows':[]};var _0x37418f=_['map'](db[_0x9161('0x24')][_0x9161('0x25')],function(_0x522a04){return{'name':_0x522a04[_0x9161('0x26')],'type':_0x522a04[_0x9161('0x27')][_0x9161('0x28')]};});_0x588ea6[_0x9161('0x29')]=_[_0x9161('0x2a')](_0x37418f,_0x9161('0x21'));_0x588ea6['query']=_[_0x9161('0x2b')](_0x664892[_0x9161('0x2c')]);_0x588ea6[_0x9161('0x2d')]=_['intersection'](_0x588ea6[_0x9161('0x29')],_0x588ea6[_0x9161('0x2c')]);_0xabd4f7[_0x9161('0x2e')]=_['intersection'](_0x588ea6[_0x9161('0x29')],qs[_0x9161('0x2f')](_0x664892[_0x9161('0x2c')][_0x9161('0x2f')]));_0xabd4f7[_0x9161('0x2e')]=_0xabd4f7[_0x9161('0x2e')][_0x9161('0x30')]?_0xabd4f7[_0x9161('0x2e')]:_0x588ea6[_0x9161('0x29')];if(!_0x664892[_0x9161('0x2c')][_0x9161('0x31')](_0x9161('0x32'))){_0xabd4f7[_0x9161('0x18')]=qs[_0x9161('0x18')](_0x664892[_0x9161('0x2c')][_0x9161('0x18')]);_0xabd4f7[_0x9161('0x17')]=qs[_0x9161('0x17')](_0x664892[_0x9161('0x2c')][_0x9161('0x17')]);}_0xabd4f7[_0x9161('0x33')]=qs[_0x9161('0x34')](_0x664892['query']['sort']);_0xabd4f7['where']=qs[_0x9161('0x2d')](_[_0x9161('0x35')](_0x664892[_0x9161('0x2c')],_0x588ea6[_0x9161('0x2d')]));if(_0x664892[_0x9161('0x2c')]['filter']){_0xabd4f7[_0x9161('0x36')]=_['merge'](_0xabd4f7[_0x9161('0x36')],{'$or':_[_0x9161('0x2a')](_0x37418f,function(_0x1f6ec1){if(_0x1f6ec1['type']!==_0x9161('0x37')){var _0xa613fe={};_0xa613fe[_0x1f6ec1['name']]={'$like':'%'+_0x664892[_0x9161('0x2c')]['filter']+'%'};return _0xa613fe;}})});}_0xabd4f7=_['merge']({},_0xabd4f7,_0x664892[_0x9161('0x38')]);var _0x4a3b3a={'where':_0xabd4f7[_0x9161('0x36')]};return db[_0x9161('0x24')]['count'](_0x4a3b3a)['then'](function(_0x20cff9){_0x1ae0df[_0x9161('0x16')]=_0x20cff9;if(_0x664892['query'][_0x9161('0x39')]){_0xabd4f7['include']=[{'all':!![]}];}return db[_0x9161('0x24')][_0x9161('0x3a')](_0xabd4f7);})[_0x9161('0x1d')](function(_0x3d7881){_0x1ae0df['rows']=_0x3d7881;return _0x1ae0df;})['then'](respondWithFilteredResult(_0x3102f7,_0xabd4f7))[_0x9161('0x3b')](handleError(_0x3102f7,null));};exports[_0x9161('0x3c')]=function(_0x4dc23d,_0x482c27){var _0x10fd72={'raw':!![],'where':{'id':_0x4dc23d[_0x9161('0x3d')]['id']}},_0x23da69={};_0x23da69[_0x9161('0x29')]=_[_0x9161('0x2b')](db[_0x9161('0x24')][_0x9161('0x25')]);_0x23da69[_0x9161('0x2c')]=_[_0x9161('0x2b')](_0x4dc23d[_0x9161('0x2c')]);_0x23da69[_0x9161('0x2d')]=_[_0x9161('0x3e')](_0x23da69[_0x9161('0x29')],_0x23da69[_0x9161('0x2c')]);_0x10fd72[_0x9161('0x2e')]=_[_0x9161('0x3e')](_0x23da69['model'],qs[_0x9161('0x2f')](_0x4dc23d['query'][_0x9161('0x2f')]));_0x10fd72['attributes']=_0x10fd72[_0x9161('0x2e')][_0x9161('0x30')]?_0x10fd72[_0x9161('0x2e')]:_0x23da69[_0x9161('0x29')];if(_0x4dc23d[_0x9161('0x2c')]['includeAll']){_0x10fd72[_0x9161('0x3f')]=[{'all':!![]}];}_0x10fd72=_['merge']({},_0x10fd72,_0x4dc23d[_0x9161('0x38')]);return db[_0x9161('0x24')][_0x9161('0x40')](_0x10fd72)[_0x9161('0x1d')](handleEntityNotFound(_0x482c27,null))[_0x9161('0x1d')](respondWithResult(_0x482c27,null))[_0x9161('0x3b')](handleError(_0x482c27,null));};exports[_0x9161('0x1c')]=function(_0xf7d7d2,_0x25d514){if(_0xf7d7d2[_0x9161('0x41')]['id']){delete _0xf7d7d2[_0x9161('0x41')]['id'];}return db[_0x9161('0x24')][_0x9161('0x40')]({'where':{'id':_0xf7d7d2['params']['id']}})[_0x9161('0x1d')](handleEntityNotFound(_0x25d514,null))[_0x9161('0x1d')](saveUpdates(_0xf7d7d2[_0x9161('0x41')],null))[_0x9161('0x1d')](respondWithResult(_0x25d514,null))[_0x9161('0x3b')](handleError(_0x25d514,null));};exports[_0x9161('0x1e')]=function(_0x43db88,_0x3a9492){return db[_0x9161('0x24')]['find']({'where':{'id':_0x43db88['params']['id']}})[_0x9161('0x1d')](handleEntityNotFound(_0x3a9492,null))[_0x9161('0x1d')](removeEntity(_0x3a9492,null))[_0x9161('0x3b')](handleError(_0x3a9492,null));};exports[_0x9161('0x42')]=function(_0x3e135d,_0x20e96d){return db[_0x9161('0x24')][_0x9161('0x42')]()[_0x9161('0x1d')](respondWithResult(_0x20e96d,null))[_0x9161('0x3b')](handleError(_0x20e96d,null));}; \ No newline at end of file +var _0x70e3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','key','model','query','keys','filters'];(function(_0x39be73,_0x31a022){var _0x14b572=function(_0x3ec15d){while(--_0x3ec15d){_0x39be73['push'](_0x39be73['shift']());}};_0x14b572(++_0x31a022);}(_0x70e3,0x9d));var _0x370e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x70e3[_0x934425];return _0x31d596;};'use strict';var pdf=require(_0x370e('0x0'));var emlformat=require(_0x370e('0x1'));var rimraf=require(_0x370e('0x2'));var zipdir=require(_0x370e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x370e('0x4'));var moment=require(_0x370e('0x5'));var BPromise=require(_0x370e('0x6'));var Mustache=require('mustache');var util=require(_0x370e('0x7'));var path=require(_0x370e('0x8'));var sox=require(_0x370e('0x9'));var csv=require(_0x370e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x370e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x370e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x370e('0xd'));var Papa=require('papaparse');var Redis=require(_0x370e('0xe'));var authService=require(_0x370e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x370e('0x10'));var logger=require(_0x370e('0x11'))(_0x370e('0x12'));var utils=require(_0x370e('0x13'));var config=require(_0x370e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x146d53,_0x17115f){_0x17115f=_0x17115f||0xcc;return function(_0x26f9f6){if(_0x26f9f6){return _0x146d53[_0x370e('0x15')](_0x17115f);}return _0x146d53[_0x370e('0x16')](_0x17115f)[_0x370e('0x17')]();};}function respondWithResult(_0x3afd5d,_0x8b678d){_0x8b678d=_0x8b678d||0xc8;return function(_0x42ba1c){if(_0x42ba1c){return _0x3afd5d[_0x370e('0x16')](_0x8b678d)[_0x370e('0x18')](_0x42ba1c);}};}function respondWithFilteredResult(_0x5f0330,_0x49c2dd){return function(_0x5e43fb){if(_0x5e43fb){var _0x32e9d7=_0x5e43fb[_0x370e('0x19')],_0x44a6a1=_0x49c2dd[_0x370e('0x1a')],_0xa88c46=_0x49c2dd['offset']+_0x49c2dd[_0x370e('0x1b')],_0x3435d5;if(_0xa88c46>=_0x32e9d7){_0xa88c46=_0x32e9d7;_0x3435d5=0xc8;}else{_0x3435d5=0xce;}_0x5f0330[_0x370e('0x16')](_0x3435d5);return _0x5f0330['set'](_0x370e('0x1c'),_0x44a6a1+'-'+_0xa88c46+'/'+_0x32e9d7)[_0x370e('0x18')](_0x5e43fb);}return null;};}function patchUpdates(_0x54a1cf){return function(_0x41f617){try{jsonpatch[_0x370e('0x1d')](_0x41f617,_0x54a1cf,!![]);}catch(_0x20f14a){return BPromise['reject'](_0x20f14a);}return _0x41f617[_0x370e('0x1e')]();};}function saveUpdates(_0x1c6049,_0xb7887c){return function(_0x4eb5e4){if(_0x4eb5e4){return _0x4eb5e4[_0x370e('0x1f')](_0x1c6049)[_0x370e('0x20')](function(_0x56dae0){return _0x56dae0;});}return null;};}function removeEntity(_0x43ad14,_0x1edda5){return function(_0x4fc0d3){if(_0x4fc0d3){return _0x4fc0d3[_0x370e('0x21')]()[_0x370e('0x20')](function(){_0x43ad14[_0x370e('0x16')](0xcc)[_0x370e('0x17')]();});}};}function handleEntityNotFound(_0x130ebd,_0x18c058){return function(_0x4f23ec){if(!_0x4f23ec){_0x130ebd[_0x370e('0x15')](0x194);}return _0x4f23ec;};}function handleError(_0x288ace,_0x2accb7){_0x2accb7=_0x2accb7||0x1f4;return function(_0x4ddce8){logger[_0x370e('0x22')](_0x4ddce8[_0x370e('0x23')]);if(_0x4ddce8[_0x370e('0x24')]){delete _0x4ddce8['name'];}_0x288ace[_0x370e('0x16')](_0x2accb7)[_0x370e('0x25')](_0x4ddce8);};}exports[_0x370e('0x26')]=function(_0x409fda,_0x421433){var _0xcaf758={},_0x3e9660={},_0x5db007={'count':0x0,'rows':[]};var _0xf30d43=_[_0x370e('0x27')](db[_0x370e('0x28')][_0x370e('0x29')],function(_0x3fd78e){return{'name':_0x3fd78e['fieldName'],'type':_0x3fd78e['type'][_0x370e('0x2a')]};});_0x3e9660[_0x370e('0x2b')]=_[_0x370e('0x27')](_0xf30d43,'name');_0x3e9660[_0x370e('0x2c')]=_[_0x370e('0x2d')](_0x409fda[_0x370e('0x2c')]);_0x3e9660[_0x370e('0x2e')]=_[_0x370e('0x2f')](_0x3e9660[_0x370e('0x2b')],_0x3e9660[_0x370e('0x2c')]);_0xcaf758['attributes']=_['intersection'](_0x3e9660[_0x370e('0x2b')],qs[_0x370e('0x30')](_0x409fda[_0x370e('0x2c')][_0x370e('0x30')]));_0xcaf758['attributes']=_0xcaf758[_0x370e('0x31')][_0x370e('0x32')]?_0xcaf758[_0x370e('0x31')]:_0x3e9660[_0x370e('0x2b')];if(!_0x409fda['query'][_0x370e('0x33')](_0x370e('0x34'))){_0xcaf758[_0x370e('0x1b')]=qs[_0x370e('0x1b')](_0x409fda[_0x370e('0x2c')][_0x370e('0x1b')]);_0xcaf758['offset']=qs[_0x370e('0x1a')](_0x409fda[_0x370e('0x2c')]['offset']);}_0xcaf758['order']=qs['sort'](_0x409fda[_0x370e('0x2c')]['sort']);_0xcaf758['where']=qs[_0x370e('0x2e')](_['pick'](_0x409fda[_0x370e('0x2c')],_0x3e9660[_0x370e('0x2e')]));if(_0x409fda[_0x370e('0x2c')][_0x370e('0x35')]){_0xcaf758[_0x370e('0x36')]=_[_0x370e('0x37')](_0xcaf758[_0x370e('0x36')],{'$or':_['map'](_0xf30d43,function(_0x90db50){if(_0x90db50[_0x370e('0x38')]!==_0x370e('0x39')){var _0x21ff0b={};_0x21ff0b[_0x90db50['name']]={'$like':'%'+_0x409fda['query'][_0x370e('0x35')]+'%'};return _0x21ff0b;}})});}_0xcaf758=_[_0x370e('0x37')]({},_0xcaf758,_0x409fda['options']);var _0x3254b2={'where':_0xcaf758['where']};return db['CmHopperBlack'][_0x370e('0x19')](_0x3254b2)[_0x370e('0x20')](function(_0x4b8257){_0x5db007[_0x370e('0x19')]=_0x4b8257;if(_0x409fda[_0x370e('0x2c')][_0x370e('0x3a')]){_0xcaf758[_0x370e('0x3b')]=[{'all':!![]}];}return db[_0x370e('0x28')][_0x370e('0x3c')](_0xcaf758);})[_0x370e('0x20')](function(_0x16c901){_0x5db007[_0x370e('0x3d')]=_0x16c901;return _0x5db007;})[_0x370e('0x20')](respondWithFilteredResult(_0x421433,_0xcaf758))[_0x370e('0x3e')](handleError(_0x421433,null));};exports['show']=function(_0xe3b1c3,_0x484967){var _0x2ded9e={'raw':!![],'where':{'id':_0xe3b1c3[_0x370e('0x3f')]['id']}},_0x476ad0={};_0x476ad0[_0x370e('0x2b')]=_[_0x370e('0x2d')](db[_0x370e('0x28')][_0x370e('0x29')]);_0x476ad0[_0x370e('0x2c')]=_[_0x370e('0x2d')](_0xe3b1c3[_0x370e('0x2c')]);_0x476ad0[_0x370e('0x2e')]=_[_0x370e('0x2f')](_0x476ad0['model'],_0x476ad0[_0x370e('0x2c')]);_0x2ded9e['attributes']=_[_0x370e('0x2f')](_0x476ad0[_0x370e('0x2b')],qs[_0x370e('0x30')](_0xe3b1c3[_0x370e('0x2c')][_0x370e('0x30')]));_0x2ded9e[_0x370e('0x31')]=_0x2ded9e[_0x370e('0x31')][_0x370e('0x32')]?_0x2ded9e['attributes']:_0x476ad0[_0x370e('0x2b')];if(_0xe3b1c3[_0x370e('0x2c')][_0x370e('0x3a')]){_0x2ded9e[_0x370e('0x3b')]=[{'all':!![]}];}_0x2ded9e=_[_0x370e('0x37')]({},_0x2ded9e,_0xe3b1c3[_0x370e('0x40')]);return db[_0x370e('0x28')][_0x370e('0x41')](_0x2ded9e)[_0x370e('0x20')](handleEntityNotFound(_0x484967,null))['then'](respondWithResult(_0x484967,null))['catch'](handleError(_0x484967,null));};exports[_0x370e('0x1f')]=function(_0x2de783,_0x491311){if(_0x2de783[_0x370e('0x42')]['id']){delete _0x2de783[_0x370e('0x42')]['id'];}return db[_0x370e('0x28')][_0x370e('0x41')]({'where':{'id':_0x2de783[_0x370e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x491311,null))[_0x370e('0x20')](saveUpdates(_0x2de783[_0x370e('0x42')],null))[_0x370e('0x20')](respondWithResult(_0x491311,null))[_0x370e('0x3e')](handleError(_0x491311,null));};exports[_0x370e('0x21')]=function(_0x57a437,_0x379e72){return db[_0x370e('0x28')]['find']({'where':{'id':_0x57a437['params']['id']}})[_0x370e('0x20')](handleEntityNotFound(_0x379e72,null))[_0x370e('0x20')](removeEntity(_0x379e72,null))[_0x370e('0x3e')](handleError(_0x379e72,null));};exports[_0x370e('0x43')]=function(_0xa2f839,_0x22e787){return db['CmHopperBlack'][_0x370e('0x43')]()[_0x370e('0x20')](respondWithResult(_0x22e787,null))[_0x370e('0x3e')](handleError(_0x22e787,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 73610c1..d06cd46 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 _0xe3e4=['cm_hopper_black','lodash','../../config/logger','moment','path','rimraf','define','CmHopperBlack'];(function(_0x5c43e1,_0x4c1705){var _0x397fa7=function(_0x4485e8){while(--_0x4485e8){_0x5c43e1['push'](_0x5c43e1['shift']());}};_0x397fa7(++_0x4c1705);}(_0xe3e4,0x91));var _0x4e3e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe3e4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4e3e('0x0'));var util=require('util');var logger=require(_0x4e3e('0x1'))('api');var moment=require(_0x4e3e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e3e('0x3'));var rimraf=require(_0x4e3e('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x595777,_0x128890){return _0x595777[_0x4e3e('0x5')](_0x4e3e('0x6'),attributes,{'tableName':_0x4e3e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5df=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa5df,0x15b));var _0xfa5d=function(_0x392053,_0x49ba22){_0x392053=_0x392053-0x0;var _0xd856ca=_0xa5df[_0x392053];return _0xd856ca;};'use strict';var _=require(_0xfa5d('0x0'));var util=require(_0xfa5d('0x1'));var logger=require(_0xfa5d('0x2'))(_0xfa5d('0x3'));var moment=require('moment');var BPromise=require(_0xfa5d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa5d('0x5'));var rimraf=require(_0xfa5d('0x6'));var config=require(_0xfa5d('0x7'));var attributes=require(_0xfa5d('0x8'));module[_0xfa5d('0x9')]=function(_0x189d96,_0x39daef){return _0x189d96['define'](_0xfa5d('0xa'),attributes,{'tableName':_0xfa5d('0xb'),'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 03fcc79..8d7eb41 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 _0x5961=['error','code','message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5f1f8a,_0x1d34b9){var _0xadc769=function(_0x33726d){while(--_0x33726d){_0x5f1f8a['push'](_0x5f1f8a['shift']());}};_0xadc769(++_0x1d34b9);}(_0x5961,0x1e9));var _0x1596=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0x5961[_0x564821];return _0x2b604d;};'use strict';var _=require(_0x1596('0x0'));var util=require(_0x1596('0x1'));var moment=require(_0x1596('0x2'));var BPromise=require(_0x1596('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1596('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1596('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1596('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1596('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5294b5,_0x2fac57,_0x1975ae){return new BPromise(function(_0x126547,_0x596dfe){return client[_0x1596('0x8')](_0x5294b5,_0x1975ae)[_0x1596('0x9')](function(_0x37a183){logger[_0x1596('0xa')](_0x1596('0xb'),_0x2fac57,'request\x20sent');logger[_0x1596('0xc')](_0x1596('0xd'),_0x2fac57,_0x1596('0xe'),JSON['stringify'](_0x37a183));if(_0x37a183[_0x1596('0xf')]){if(_0x37a183[_0x1596('0xf')][_0x1596('0x10')]===0x1f4){logger[_0x1596('0xf')](_0x1596('0xb'),_0x2fac57,_0x37a183[_0x1596('0xf')][_0x1596('0x11')]);return _0x596dfe(_0x37a183[_0x1596('0xf')][_0x1596('0x11')]);}logger[_0x1596('0xf')](_0x1596('0xb'),_0x2fac57,_0x37a183['error'][_0x1596('0x11')]);return _0x126547(_0x37a183[_0x1596('0xf')][_0x1596('0x11')]);}else{logger[_0x1596('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x2fac57,'request\x20sent');_0x126547(_0x37a183[_0x1596('0x12')]['message']);}})[_0x1596('0x13')](function(_0x235f71){logger[_0x1596('0xf')](_0x1596('0xb'),_0x2fac57,_0x235f71);_0x596dfe(_0x235f71);});});}exports['GetCmHopperBlack']=function(_0x54fdc4){var _0x5972d6=this;return new Promise(function(_0x3b6f8d,_0x48119f){return db[_0x1596('0x14')][_0x1596('0x15')]({'raw':_0x54fdc4[_0x1596('0x16')]?_0x54fdc4[_0x1596('0x16')][_0x1596('0x17')]===undefined?!![]:![]:!![],'where':_0x54fdc4[_0x1596('0x16')]?_0x54fdc4['options'][_0x1596('0x18')]||null:null,'attributes':_0x54fdc4[_0x1596('0x16')]?_0x54fdc4['options'][_0x1596('0x19')]||null:null,'limit':_0x54fdc4['options']?_0x54fdc4[_0x1596('0x16')][_0x1596('0x1a')]||null:null,'include':_0x54fdc4[_0x1596('0x16')]?_0x54fdc4[_0x1596('0x16')][_0x1596('0x1b')]?_[_0x1596('0x1c')](_0x54fdc4[_0x1596('0x16')][_0x1596('0x1b')],function(_0x4bbad4){return{'model':db[_0x4bbad4[_0x1596('0x1d')]],'as':_0x4bbad4['as'],'attributes':_0x4bbad4[_0x1596('0x19')],'include':_0x4bbad4['include']?_['map'](_0x4bbad4['include'],function(_0x4e7f93){return{'model':db[_0x4e7f93['model']],'as':_0x4e7f93['as'],'attributes':_0x4e7f93['attributes'],'include':_0x4e7f93['include']?_['map'](_0x4e7f93['include'],function(_0x4a45fb){return{'model':db[_0x4a45fb[_0x1596('0x1d')]],'as':_0x4a45fb['as'],'attributes':_0x4a45fb[_0x1596('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1596('0x9')](function(_0x548099){logger['info']('GetCmHopperBlack',_0x54fdc4);logger[_0x1596('0xc')](_0x1596('0x1e'),_0x54fdc4,JSON[_0x1596('0x1f')](_0x548099));_0x3b6f8d(_0x548099);})[_0x1596('0x13')](function(_0x4827a0){logger[_0x1596('0xf')]('GetCmHopperBlack',_0x4827a0[_0x1596('0x11')],_0x54fdc4);_0x48119f(_0x5972d6['error'](0x1f4,_0x4827a0[_0x1596('0x11')]));});});};exports[_0x1596('0x20')]=function(_0x16194a){var _0x20fd4c=this;return new Promise(function(_0x256cc2,_0x3b7206){return db[_0x1596('0x14')][_0x1596('0x21')](_0x16194a[_0x1596('0x22')],{'raw':_0x16194a[_0x1596('0x16')]?_0x16194a[_0x1596('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16194a[_0x1596('0x16')]?_0x16194a[_0x1596('0x16')][_0x1596('0x18')]||null:null,'attributes':_0x16194a['options']?_0x16194a[_0x1596('0x16')]['attributes']||null:null,'limit':_0x16194a[_0x1596('0x16')]?_0x16194a[_0x1596('0x16')][_0x1596('0x1a')]||null:null})['then'](function(_0x458d59){logger[_0x1596('0xa')]('UpdateCmHopperBlack',_0x16194a);logger[_0x1596('0xc')](_0x1596('0x20'),_0x16194a,JSON[_0x1596('0x1f')](_0x458d59));_0x256cc2(_0x458d59);})[_0x1596('0x13')](function(_0x20ebe6){logger[_0x1596('0xf')](_0x1596('0x20'),_0x20ebe6[_0x1596('0x11')],_0x16194a);_0x3b7206(_0x20fd4c[_0x1596('0xf')](0x1f4,_0x20ebe6['message']));});});};exports[_0x1596('0x23')]=function(_0x121ff7){var _0x191602=this;return new Promise(function(_0x22bb61,_0x8405ec){return db[_0x1596('0x14')]['destroy']({'where':_0x121ff7[_0x1596('0x16')]?_0x121ff7[_0x1596('0x16')][_0x1596('0x18')]||null:null})[_0x1596('0x9')](function(_0x5656dd){logger[_0x1596('0xa')]('DestroyCmHopperBlack',_0x121ff7);logger[_0x1596('0xc')](_0x1596('0x23'),_0x121ff7,JSON[_0x1596('0x1f')](_0x5656dd));_0x22bb61(_0x5656dd);})[_0x1596('0x13')](function(_0x721615){logger[_0x1596('0xf')](_0x1596('0x23'),_0x721615[_0x1596('0x11')],_0x121ff7);_0x8405ec(_0x191602[_0x1596('0xf')](0x1f4,_0x721615['message']));});});}; \ No newline at end of file +var _0x351a=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','include','model','map','GetCmHopperBlack','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','where','lodash'];(function(_0x948acc,_0x565435){var _0x1c2e4b=function(_0x571f87){while(--_0x571f87){_0x948acc['push'](_0x948acc['shift']());}};_0x1c2e4b(++_0x565435);}(_0x351a,0xfb));var _0xa351=function(_0x5143d4,_0x15d2a6){_0x5143d4=_0x5143d4-0x0;var _0x15ea27=_0x351a[_0x5143d4];return _0x15ea27;};'use strict';var _=require(_0xa351('0x0'));var util=require(_0xa351('0x1'));var moment=require(_0xa351('0x2'));var BPromise=require(_0xa351('0x3'));var rs=require(_0xa351('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa351('0x5'))['db'];var utils=require(_0xa351('0x6'));var logger=require(_0xa351('0x7'))(_0xa351('0x8'));var config=require('../../config/environment');var jayson=require(_0xa351('0x9'));var client=jayson[_0xa351('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeed6a7,_0x1bbf06,_0x27b50e){return new BPromise(function(_0x11eb01,_0x131642){return client[_0xa351('0xb')](_0xeed6a7,_0x27b50e)[_0xa351('0xc')](function(_0x16af65){logger[_0xa351('0xd')](_0xa351('0xe'),_0x1bbf06,_0xa351('0xf'));logger['debug'](_0xa351('0x10'),_0x1bbf06,'request\x20sent',JSON[_0xa351('0x11')](_0x16af65));if(_0x16af65['error']){if(_0x16af65[_0xa351('0x12')][_0xa351('0x13')]===0x1f4){logger[_0xa351('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x1bbf06,_0x16af65[_0xa351('0x12')][_0xa351('0x14')]);return _0x131642(_0x16af65[_0xa351('0x12')][_0xa351('0x14')]);}logger[_0xa351('0x12')](_0xa351('0xe'),_0x1bbf06,_0x16af65[_0xa351('0x12')]['message']);return _0x11eb01(_0x16af65[_0xa351('0x12')][_0xa351('0x14')]);}else{logger['info'](_0xa351('0xe'),_0x1bbf06,_0xa351('0xf'));_0x11eb01(_0x16af65[_0xa351('0x15')][_0xa351('0x14')]);}})[_0xa351('0x16')](function(_0x59c295){logger[_0xa351('0x12')](_0xa351('0xe'),_0x1bbf06,_0x59c295);_0x131642(_0x59c295);});});}exports['GetCmHopperBlack']=function(_0x1d783c){var _0x1552a6=this;return new Promise(function(_0x441e1a,_0x28af43){return db['CmHopperBlack']['findAll']({'raw':_0x1d783c[_0xa351('0x17')]?_0x1d783c[_0xa351('0x17')][_0xa351('0x18')]===undefined?!![]:![]:!![],'where':_0x1d783c[_0xa351('0x17')]?_0x1d783c['options']['where']||null:null,'attributes':_0x1d783c[_0xa351('0x17')]?_0x1d783c[_0xa351('0x17')][_0xa351('0x19')]||null:null,'limit':_0x1d783c[_0xa351('0x17')]?_0x1d783c[_0xa351('0x17')]['limit']||null:null,'include':_0x1d783c[_0xa351('0x17')]?_0x1d783c['options'][_0xa351('0x1a')]?_['map'](_0x1d783c[_0xa351('0x17')][_0xa351('0x1a')],function(_0x49019a){return{'model':db[_0x49019a[_0xa351('0x1b')]],'as':_0x49019a['as'],'attributes':_0x49019a[_0xa351('0x19')],'include':_0x49019a[_0xa351('0x1a')]?_[_0xa351('0x1c')](_0x49019a[_0xa351('0x1a')],function(_0x256a09){return{'model':db[_0x256a09['model']],'as':_0x256a09['as'],'attributes':_0x256a09[_0xa351('0x19')],'include':_0x256a09[_0xa351('0x1a')]?_[_0xa351('0x1c')](_0x256a09[_0xa351('0x1a')],function(_0x92edb1){return{'model':db[_0x92edb1[_0xa351('0x1b')]],'as':_0x92edb1['as'],'attributes':_0x92edb1[_0xa351('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa351('0xc')](function(_0x45993d){logger[_0xa351('0xd')](_0xa351('0x1d'),_0x1d783c);logger[_0xa351('0x1e')](_0xa351('0x1d'),_0x1d783c,JSON[_0xa351('0x11')](_0x45993d));_0x441e1a(_0x45993d);})[_0xa351('0x16')](function(_0x1a34c5){logger[_0xa351('0x12')](_0xa351('0x1d'),_0x1a34c5[_0xa351('0x14')],_0x1d783c);_0x28af43(_0x1552a6[_0xa351('0x12')](0x1f4,_0x1a34c5[_0xa351('0x14')]));});});};exports[_0xa351('0x1f')]=function(_0x23b35c){var _0x4c73e0=this;return new Promise(function(_0x388160,_0x9a12de){return db['CmHopperBlack'][_0xa351('0x20')](_0x23b35c[_0xa351('0x21')],{'raw':_0x23b35c[_0xa351('0x17')]?_0x23b35c[_0xa351('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b35c[_0xa351('0x17')]?_0x23b35c[_0xa351('0x17')]['where']||null:null,'attributes':_0x23b35c[_0xa351('0x17')]?_0x23b35c['options'][_0xa351('0x19')]||null:null,'limit':_0x23b35c[_0xa351('0x17')]?_0x23b35c[_0xa351('0x17')]['limit']||null:null})['then'](function(_0x44e5a7){logger[_0xa351('0xd')]('UpdateCmHopperBlack',_0x23b35c);logger[_0xa351('0x1e')]('UpdateCmHopperBlack',_0x23b35c,JSON[_0xa351('0x11')](_0x44e5a7));_0x388160(_0x44e5a7);})['catch'](function(_0xcd0bd4){logger[_0xa351('0x12')](_0xa351('0x1f'),_0xcd0bd4[_0xa351('0x14')],_0x23b35c);_0x9a12de(_0x4c73e0[_0xa351('0x12')](0x1f4,_0xcd0bd4[_0xa351('0x14')]));});});};exports[_0xa351('0x22')]=function(_0x293c43){var _0x5ac137=this;return new Promise(function(_0x4b77b5,_0x501fd9){return db['CmHopperBlack']['destroy']({'where':_0x293c43[_0xa351('0x17')]?_0x293c43[_0xa351('0x17')][_0xa351('0x23')]||null:null})[_0xa351('0xc')](function(_0x121176){logger[_0xa351('0xd')](_0xa351('0x22'),_0x293c43);logger[_0xa351('0x1e')](_0xa351('0x22'),_0x293c43,JSON[_0xa351('0x11')](_0x121176));_0x4b77b5(_0x121176);})[_0xa351('0x16')](function(_0x46c1f4){logger[_0xa351('0x12')](_0xa351('0x22'),_0x46c1f4[_0xa351('0x14')],_0x293c43);_0x501fd9(_0x5ac137[_0xa351('0x12')](0x1f4,_0x46c1f4[_0xa351('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index d96c90b..cccfb4b 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 _0x008c=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','put'];(function(_0x56180b,_0x22e582){var _0x2f4b78=function(_0x1ea3de){while(--_0x1ea3de){_0x56180b['push'](_0x56180b['shift']());}};_0x2f4b78(++_0x22e582);}(_0x008c,0x188));var _0xc008=function(_0xf2ee56,_0x565642){_0xf2ee56=_0xf2ee56-0x0;var _0x2b9bc9=_0x008c[_0xf2ee56];return _0x2b9bc9;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0xf')](_0xc008('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xe'),auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0xe14d=['index','describe','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x4cfc0f,_0xe1ba14){var _0x1d2916=function(_0x515cd1){while(--_0x515cd1){_0x4cfc0f['push'](_0x4cfc0f['shift']());}};_0x1d2916(++_0xe1ba14);}(_0xe14d,0x1ee));var _0xde14=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xe14d[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var auth=require(_0xde14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde14('0x6'));var controller=require(_0xde14('0x7'));router[_0xde14('0x8')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xde14('0xb')]);router[_0xde14('0x8')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0xe')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller['update']);router[_0xde14('0xf')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0x10')]);module[_0xde14('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index fe55c87..8e132e4 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 _0x7144=['endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7144,0x77));var _0x4714=function(_0x35d8f7,_0x45e06f){_0x35d8f7=_0x35d8f7-0x0;var _0x1bbf85=_0x7144[_0x35d8f7];return _0x1bbf85;};'use strict';var Sequelize=require(_0x4714('0x0'));var moment=require(_0x4714('0x1'));module[_0x4714('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x4714('0x3')]},'scheduledat':{'type':Sequelize[_0x4714('0x4')]},'countbusyretry':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4714('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4714('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4714('0x3')]},'starttime':{'type':Sequelize[_0x4714('0x4')]},'responsetime':{'type':Sequelize[_0x4714('0x4')]},'answertime':{'type':Sequelize[_0x4714('0x4')]},'droptime':{'type':Sequelize[_0x4714('0x4')]},'endtime':{'type':Sequelize[_0x4714('0x4')]},'ringtime':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4714('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4714('0x3')]},'campaign':{'type':Sequelize[_0x4714('0x3')]},'campaigntype':{'type':Sequelize[_0x4714('0x3')]},'membername':{'type':Sequelize[_0x4714('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x4714('0x4')],'set':function(_0x14226c){var _0x35a1ab=this[_0x4714('0x6')](_0x4714('0x7'));if(_0x35a1ab&&_0x14226c){this[_0x4714('0x8')](_0x4714('0x9'),moment(_0x14226c)[_0x4714('0xa')](moment(_0x35a1ab),_0x4714('0xb')));}return this[_0x4714('0x8')](_0x4714('0xc'),_0x14226c);}},'amd':{'type':Sequelize[_0x4714('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4714('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x4714('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x4714('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x4714('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4714('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4714('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x4714('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4714('0x4')]}}; \ No newline at end of file +var _0x5d3f=['followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x1cdc5c,_0x2c2db1){var _0x1b9743=function(_0x2cf5d9){while(--_0x2cf5d9){_0x1cdc5c['push'](_0x1cdc5c['shift']());}};_0x1b9743(++_0x2c2db1);}(_0x5d3f,0x18d));var _0xf5d3=function(_0x5eed38,_0x1fe1dc){_0x5eed38=_0x5eed38-0x0;var _0x4a8c7c=_0x5d3f[_0x5eed38];return _0x4a8c7c;};'use strict';var Sequelize=require(_0xf5d3('0x0'));var moment=require(_0xf5d3('0x1'));module[_0xf5d3('0x2')]={'state':{'type':Sequelize[_0xf5d3('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xf5d3('0x4')]},'scheduledat':{'type':Sequelize[_0xf5d3('0x5')]},'countbusyretry':{'type':Sequelize[_0xf5d3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf5d3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf5d3('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xf5d3('0x4')]},'calleridnum':{'type':Sequelize[_0xf5d3('0x4')]},'calleridname':{'type':Sequelize[_0xf5d3('0x4')]},'starttime':{'type':Sequelize[_0xf5d3('0x5')]},'responsetime':{'type':Sequelize[_0xf5d3('0x5')]},'answertime':{'type':Sequelize[_0xf5d3('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf5d3('0x5')]},'ringtime':{'type':Sequelize[_0xf5d3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf5d3('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf5d3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf5d3('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xf5d3('0x4')]},'campaigntype':{'type':Sequelize[_0xf5d3('0x4')]},'membername':{'type':Sequelize[_0xf5d3('0x4')]},'reason':{'type':Sequelize[_0xf5d3('0x4')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xf5d3('0x5')],'set':function(_0x4edaf2){var _0x1c5385=this[_0xf5d3('0x6')](_0xf5d3('0x7'));if(_0x1c5385&&_0x4edaf2){this[_0xf5d3('0x8')](_0xf5d3('0x9'),moment(_0x4edaf2)[_0xf5d3('0xa')](moment(_0x1c5385),_0xf5d3('0xb')));}return this[_0xf5d3('0x8')](_0xf5d3('0xc'),_0x4edaf2);}},'amd':{'type':Sequelize[_0xf5d3('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf5d3('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf5d3('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf5d3('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf5d3('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xf5d3('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf5d3('0x5')]},'recallme':{'type':Sequelize[_0xf5d3('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf5d3('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index be1e39d..9389193 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 _0x097e=['CmHopperFinal','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','keys','intersection','include','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`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','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','createdAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','group','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x516762,_0x48bc38){var _0x4f23f5=function(_0x554ef5){while(--_0x554ef5){_0x516762['push'](_0x516762['shift']());}};_0x4f23f5(++_0x48bc38);}(_0x097e,0x154));var _0xe097=function(_0x2f5750,_0x29a0af){_0x2f5750=_0x2f5750-0x0;var _0x3c4f9e=_0x097e[_0x2f5750];return _0x3c4f9e;};'use strict';var pdf=require(_0xe097('0x0'));var emlformat=require(_0xe097('0x1'));var rimraf=require(_0xe097('0x2'));var zipdir=require(_0xe097('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe097('0x4'));var Mustache=require(_0xe097('0x5'));var util=require(_0xe097('0x6'));var path=require(_0xe097('0x7'));var sox=require(_0xe097('0x8'));var csv=require(_0xe097('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe097('0xa'));var squel=require('squel');var crypto=require(_0xe097('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe097('0x9'));var querystring=require(_0xe097('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe097('0xd'));var qs=require(_0xe097('0xe'));var as=require(_0xe097('0xf'));var hardwareService=require(_0xe097('0x10'));var logger=require('../../config/logger')(_0xe097('0x11'));var utils=require('../../config/utils');var config=require(_0xe097('0x12'));var db=require(_0xe097('0x13'))['db'];function respondWithStatusCode(_0x373b52,_0x1a9c5f){_0x1a9c5f=_0x1a9c5f||0xcc;return function(_0x5c8720){if(_0x5c8720){return _0x373b52[_0xe097('0x14')](_0x1a9c5f);}return _0x373b52[_0xe097('0x15')](_0x1a9c5f)[_0xe097('0x16')]();};}function respondWithResult(_0x1c0a24,_0x129073){_0x129073=_0x129073||0xc8;return function(_0x4b7595){if(_0x4b7595){return _0x1c0a24[_0xe097('0x15')](_0x129073)[_0xe097('0x17')](_0x4b7595);}};}function respondWithFilteredResult(_0x1bc7a5,_0x677fcf){return function(_0x46ad44){if(_0x46ad44){var _0x5bafa8=_0x46ad44[_0xe097('0x18')],_0xdc425d=_0x677fcf[_0xe097('0x19')],_0x2b67fc=_0x677fcf[_0xe097('0x19')]+_0x677fcf['limit'],_0x2569ab;if(_0x2b67fc>=_0x5bafa8){_0x2b67fc=_0x5bafa8;_0x2569ab=0xc8;}else{_0x2569ab=0xce;}_0x1bc7a5[_0xe097('0x15')](_0x2569ab);return _0x1bc7a5[_0xe097('0x1a')]('Content-Range',_0xdc425d+'-'+_0x2b67fc+'/'+_0x5bafa8)['json'](_0x46ad44);}return null;};}function patchUpdates(_0x43709a){return function(_0xcd2edc){try{jsonpatch[_0xe097('0x1b')](_0xcd2edc,_0x43709a,!![]);}catch(_0x4730fd){return BPromise[_0xe097('0x1c')](_0x4730fd);}return _0xcd2edc[_0xe097('0x1d')]();};}function saveUpdates(_0x43b1d0,_0x9ce1b6){return function(_0xef4daa){if(_0xef4daa){return _0xef4daa[_0xe097('0x1e')](_0x43b1d0)[_0xe097('0x1f')](function(_0x513fa3){return _0x513fa3;});}return null;};}function removeEntity(_0x1e6013,_0x3b31f6){return function(_0x1e5ebf){if(_0x1e5ebf){return _0x1e5ebf['destroy']()['then'](function(){_0x1e6013[_0xe097('0x15')](0xcc)[_0xe097('0x16')]();});}};}function handleEntityNotFound(_0x173b67,_0x5861b5){return function(_0x114998){if(!_0x114998){_0x173b67[_0xe097('0x14')](0x194);}return _0x114998;};}function handleError(_0x476a98,_0x214945){_0x214945=_0x214945||0x1f4;return function(_0x57472f){logger[_0xe097('0x20')](_0x57472f[_0xe097('0x21')]);if(_0x57472f[_0xe097('0x22')]){delete _0x57472f['name'];}_0x476a98[_0xe097('0x15')](_0x214945)[_0xe097('0x23')](_0x57472f);};}exports[_0xe097('0x24')]=function(_0x35185e,_0x447c61){var _0x234d54={},_0x162474={},_0x1c5a98={'count':0x0,'rows':[]};var _0x2dc41e=_[_0xe097('0x25')](db[_0xe097('0x26')][_0xe097('0x27')],function(_0x5b173d){return{'name':_0x5b173d[_0xe097('0x28')],'type':_0x5b173d[_0xe097('0x29')]['key']};});_0x162474[_0xe097('0x2a')]=_[_0xe097('0x25')](_0x2dc41e,_0xe097('0x22'));_0x162474[_0xe097('0x2b')]=_['keys'](_0x35185e[_0xe097('0x2b')]);_0x162474[_0xe097('0x2c')]=_['intersection'](_0x162474[_0xe097('0x2a')],_0x162474[_0xe097('0x2b')]);_0x234d54[_0xe097('0x2d')]=_['intersection'](_0x162474['model'],qs['fields'](_0x35185e[_0xe097('0x2b')][_0xe097('0x2e')]));_0x234d54[_0xe097('0x2d')]=_0x234d54[_0xe097('0x2d')][_0xe097('0x2f')]?_0x234d54['attributes']:_0x162474[_0xe097('0x2a')];if(!_0x35185e[_0xe097('0x2b')][_0xe097('0x30')](_0xe097('0x31'))){_0x234d54[_0xe097('0x32')]=qs[_0xe097('0x32')](_0x35185e[_0xe097('0x2b')][_0xe097('0x32')]);_0x234d54['offset']=qs[_0xe097('0x19')](_0x35185e[_0xe097('0x2b')][_0xe097('0x19')]);}_0x234d54[_0xe097('0x33')]=qs[_0xe097('0x34')](_0x35185e[_0xe097('0x2b')][_0xe097('0x34')]);_0x234d54['where']=qs['filters'](_[_0xe097('0x35')](_0x35185e[_0xe097('0x2b')],_0x162474[_0xe097('0x2c')]));if(_0x35185e[_0xe097('0x2b')][_0xe097('0x36')]){_0x234d54[_0xe097('0x37')]=_[_0xe097('0x38')](_0x234d54[_0xe097('0x37')],{'$or':_[_0xe097('0x25')](_0x2dc41e,function(_0xca6cd1){if(_0xca6cd1['type']!=='VIRTUAL'){var _0x25ed07={};_0x25ed07[_0xca6cd1[_0xe097('0x22')]]={'$like':'%'+_0x35185e[_0xe097('0x2b')][_0xe097('0x36')]+'%'};return _0x25ed07;}})});}_0x234d54=_[_0xe097('0x38')]({},_0x234d54,_0x35185e[_0xe097('0x39')]);var _0x3615fd={'where':_0x234d54[_0xe097('0x37')]};return db[_0xe097('0x26')][_0xe097('0x18')](_0x3615fd)[_0xe097('0x1f')](function(_0x4b2670){_0x1c5a98[_0xe097('0x18')]=_0x4b2670;if(_0x35185e[_0xe097('0x2b')][_0xe097('0x3a')]){_0x234d54['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xe097('0x3b')](_0x234d54);})['then'](function(_0xac8d93){_0x1c5a98['rows']=_0xac8d93;return _0x1c5a98;})['then'](respondWithFilteredResult(_0x447c61,_0x234d54))[_0xe097('0x3c')](handleError(_0x447c61,null));};exports[_0xe097('0x3d')]=function(_0x5949b8,_0x4d0761){var _0x168b08={'raw':!![],'where':{'id':_0x5949b8[_0xe097('0x3e')]['id']}},_0xc437a9={};_0xc437a9[_0xe097('0x2a')]=_[_0xe097('0x3f')](db[_0xe097('0x26')][_0xe097('0x27')]);_0xc437a9[_0xe097('0x2b')]=_[_0xe097('0x3f')](_0x5949b8[_0xe097('0x2b')]);_0xc437a9['filters']=_[_0xe097('0x40')](_0xc437a9[_0xe097('0x2a')],_0xc437a9['query']);_0x168b08[_0xe097('0x2d')]=_[_0xe097('0x40')](_0xc437a9[_0xe097('0x2a')],qs[_0xe097('0x2e')](_0x5949b8[_0xe097('0x2b')]['fields']));_0x168b08[_0xe097('0x2d')]=_0x168b08[_0xe097('0x2d')]['length']?_0x168b08[_0xe097('0x2d')]:_0xc437a9[_0xe097('0x2a')];if(_0x5949b8['query']['includeAll']){_0x168b08[_0xe097('0x41')]=[{'all':!![]}];}_0x168b08=_[_0xe097('0x38')]({},_0x168b08,_0x5949b8[_0xe097('0x39')]);return db[_0xe097('0x26')][_0xe097('0x42')](_0x168b08)[_0xe097('0x1f')](handleEntityNotFound(_0x4d0761,null))['then'](respondWithResult(_0x4d0761,null))['catch'](handleError(_0x4d0761,null));};exports[_0xe097('0x43')]=function(_0x4c23df,_0x1fe783){return db[_0xe097('0x26')][_0xe097('0x43')]()[_0xe097('0x1f')](respondWithResult(_0x1fe783,null))[_0xe097('0x3c')](handleError(_0x1fe783,null));};exports[_0xe097('0x1e')]=function(_0x43cc77,_0x15bd85){if(_0x43cc77[_0xe097('0x44')][_0xe097('0x45')]){delete _0x43cc77[_0xe097('0x44')][_0xe097('0x45')];}return db[_0xe097('0x26')][_0xe097('0x42')]({'where':{'uniqueid':_0x43cc77[_0xe097('0x3e')]['id']}})['then'](handleEntityNotFound(_0x15bd85,null))['then'](saveUpdates(_0x43cc77[_0xe097('0x44')],null))[_0xe097('0x1f')](respondWithResult(_0x15bd85,null))[_0xe097('0x3c')](handleError(_0x15bd85,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x3986ee,_0x8dc02,_0x2b237e){return db[_0xe097('0x26')][_0xe097('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x3986ee[_0xe097('0x3e')]['id']},'attributes':[[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db['sequelize']['fn']('IF',db[_0xe097('0x46')]['literal'](_0xe097('0x48')))),_0xe097('0x49')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x4b')))),_0xe097('0x4c')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x4d')))),_0xe097('0x4e')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db['sequelize']['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x4f')))),'congestionContacts'],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db['sequelize']['literal'](_0xe097('0x50')))),'dropContacts'],[db[_0xe097('0x46')]['fn']('COUNT',db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x51')))),'abandonedContacts'],[db[_0xe097('0x46')]['fn']('COUNT',db[_0xe097('0x46')]['fn']('IF',db['sequelize'][_0xe097('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xe097('0x52')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db['sequelize'][_0xe097('0x4a')](_0xe097('0x53')))),_0xe097('0x54')]]})[_0xe097('0x1f')](handleEntityNotFound(_0x8dc02,null))[_0xe097('0x1f')](respondWithResult(_0x8dc02,null))['catch'](handleError(_0x8dc02,null));};exports[_0xe097('0x55')]=function(_0x3eac42,_0x1de1b2,_0x58d88c){return db[_0xe097('0x26')][_0xe097('0x3b')]({'raw':![],'where':{'CampaignId':_0x3eac42[_0xe097('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db['sequelize']['literal'](_0xe097('0x48')))),'noSuchContacts'],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db['sequelize']['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x4b')))),_0xe097('0x4c')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xe097('0x4e')],[db['sequelize']['fn'](_0xe097('0x47'),db['sequelize']['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x4f')))),_0xe097('0x56')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db['sequelize']['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x50')))),_0xe097('0x57')],[db['sequelize']['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')]['literal'](_0xe097('0x51')))),_0xe097('0x58')],[db[_0xe097('0x46')]['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x59')))),_0xe097('0x52')],[db['sequelize']['fn'](_0xe097('0x47'),db[_0xe097('0x46')]['fn']('IF',db[_0xe097('0x46')][_0xe097('0x4a')](_0xe097('0x53')))),_0xe097('0x54')]]})[_0xe097('0x1f')](handleEntityNotFound(_0x1de1b2,null))[_0xe097('0x1f')](respondWithResult(_0x1de1b2,null))[_0xe097('0x3c')](handleError(_0x1de1b2,null));};exports[_0xe097('0x5a')]=function(_0x53dc83,_0x5cf2dc,_0x2d7a41){return db[_0xe097('0x5b')][_0xe097('0x42')]({'where':{'id':_0x53dc83[_0xe097('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5cf2dc,null))[_0xe097('0x1f')](function(_0x11ec02){var _0x386fab;if(_0x11ec02){_0x386fab=squel[_0xe097('0x5c')]()[_0xe097('0x5d')](_0xe097('0x5e'))[_0xe097('0x5f')](['phone',_0xe097('0x60'),_0xe097('0x61'),_0xe097('0x62'),_0xe097('0x63'),'createdAt',_0xe097('0x64')],squel['select']()[_0xe097('0x65')](_0xe097('0x66'),_0xe097('0x67'))[_0xe097('0x65')](_0xe097('0x68'),_0xe097('0x60'))[_0xe097('0x65')](_0xe097('0x69'),'ContactId')[_0xe097('0x65')]('ANY_VALUE(ListId)',_0xe097('0x62'))[_0xe097('0x65')](_0xe097('0x6a'),_0xe097('0x63'))['field'](_0xe097('0x68'),_0xe097('0x6b'))['field'](_0xe097('0x68'),_0xe097('0x64'))[_0xe097('0x6c')](_0xe097('0x6d'))[_0xe097('0x37')](_0xe097('0x6e'),_0x53dc83[_0xe097('0x3e')]['id']['toString']())[_0xe097('0x37')](_0xe097('0x6f'),_0x53dc83['body']['state'][_0xe097('0x70')]())['where'](_0xe097('0x71'))[_0xe097('0x37')](_0xe097('0x72'),squel[_0xe097('0x73')]()[_0xe097('0x65')](_0xe097('0x67'))['from'](_0xe097('0x5e'))[_0xe097('0x37')](_0xe097('0x6e'),_0x53dc83[_0xe097('0x3e')]['id'][_0xe097('0x70')]()))[_0xe097('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe097('0x73')]()[_0xe097('0x65')](_0xe097('0x74'))['from'](_0xe097('0x6d'))['where'](_0xe097('0x6e'),_0x53dc83['params']['id'][_0xe097('0x70')]())[_0xe097('0x37')](_0xe097('0x75')))[_0xe097('0x76')](_0xe097('0x61')))['toString']();return db[_0xe097('0x46')][_0xe097('0x2b')](_0x386fab);}return[];})[_0xe097('0x1f')](respondWithResult(_0x5cf2dc,null))['catch'](handleError(_0x5cf2dc,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1f785a,_0xb1f04a,_0x1c60f6){return db[_0xe097('0x77')][_0xe097('0x42')]({'where':{'id':_0x1f785a[_0xe097('0x3e')]['id']}})[_0xe097('0x1f')](handleEntityNotFound(_0xb1f04a,null))['then'](function(_0x4d2299){var _0x41bd6c;if(_0x4d2299){_0x41bd6c=squel[_0xe097('0x5c')]()[_0xe097('0x5d')]('cm_hopper')['fromQuery']([_0xe097('0x67'),_0xe097('0x60'),_0xe097('0x61'),'ListId',_0xe097('0x78'),_0xe097('0x6b'),_0xe097('0x64')],squel[_0xe097('0x73')]()[_0xe097('0x65')](_0xe097('0x66'),_0xe097('0x67'))[_0xe097('0x65')]('NOW()',_0xe097('0x60'))['field'](_0xe097('0x69'),'ContactId')[_0xe097('0x65')](_0xe097('0x79'),_0xe097('0x62'))[_0xe097('0x65')](_0xe097('0x7a'),'CampaignId')[_0xe097('0x65')](_0xe097('0x68'),_0xe097('0x6b'))[_0xe097('0x65')](_0xe097('0x68'),'updatedAt')[_0xe097('0x6c')](_0xe097('0x6d'))[_0xe097('0x37')](_0xe097('0x7b'),_0x1f785a[_0xe097('0x3e')]['id'][_0xe097('0x70')]())['where'](_0xe097('0x6f'),_0x1f785a['body']['state'][_0xe097('0x70')]())['where'](_0xe097('0x71'))[_0xe097('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xe097('0x65')](_0xe097('0x67'))[_0xe097('0x6c')]('cm_hopper')[_0xe097('0x37')]('CampaignId\x20=\x20?',_0x1f785a[_0xe097('0x3e')]['id']['toString']()))['where'](_0xe097('0x72'),squel['select']()[_0xe097('0x65')]('calleridnum')['from'](_0xe097('0x6d'))[_0xe097('0x37')](_0xe097('0x7b'),_0x1f785a[_0xe097('0x3e')]['id'][_0xe097('0x70')]())[_0xe097('0x37')](_0xe097('0x75')))[_0xe097('0x76')](_0xe097('0x61')))[_0xe097('0x70')]();return db[_0xe097('0x46')][_0xe097('0x2b')](_0x41bd6c);}return[];})[_0xe097('0x1f')](respondWithResult(_0xb1f04a,null))[_0xe097('0x3c')](handleError(_0xb1f04a,null));};exports[_0xe097('0x7c')]=function(_0x1c585f,_0x387707,_0x34700e){return db[_0xe097('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x1c585f['body'][_0xe097('0x63')],'CampaignId':_0x1c585f[_0xe097('0x44')][_0xe097('0x78')],'ContactId':_0x1c585f[_0xe097('0x44')][_0xe097('0x61')]}})[_0xe097('0x1f')](handleEntityNotFound(_0x387707,null))['then'](function(_0x35adc3){if(_0x35adc3){return _0x35adc3;}return null;})[_0xe097('0x1f')](respondWithResult(_0x387707,null))[_0xe097('0x3c')](handleError(_0x387707,null));}; \ No newline at end of file +var _0xe234=['ContactId','ListId','VoiceQueueId','createdAt','select','ANY_VALUE(calleridnum)','field','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','state\x20=\x204','findOne','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','reject','then','sendStatus','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','length','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe234,0x191));var _0x4e23=function(_0x4459b0,_0x8b25c8){_0x4459b0=_0x4459b0-0x0;var _0x18f47f=_0xe234[_0x4459b0];return _0x18f47f;};'use strict';var pdf=require(_0x4e23('0x0'));var emlformat=require(_0x4e23('0x1'));var rimraf=require(_0x4e23('0x2'));var zipdir=require(_0x4e23('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e23('0x4'));var BPromise=require(_0x4e23('0x5'));var Mustache=require('mustache');var util=require(_0x4e23('0x6'));var path=require(_0x4e23('0x7'));var sox=require(_0x4e23('0x8'));var csv=require(_0x4e23('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4e23('0xa'));var squel=require('squel');var crypto=require(_0x4e23('0xb'));var jsforce=require(_0x4e23('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4e23('0x9'));var querystring=require(_0x4e23('0xd'));var Papa=require(_0x4e23('0xe'));var Redis=require(_0x4e23('0xf'));var authService=require(_0x4e23('0x10'));var qs=require(_0x4e23('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e23('0x12'));var logger=require(_0x4e23('0x13'))(_0x4e23('0x14'));var utils=require(_0x4e23('0x15'));var config=require('../../config/environment');var db=require(_0x4e23('0x16'))['db'];function respondWithStatusCode(_0xc9770c,_0x1c3783){_0x1c3783=_0x1c3783||0xcc;return function(_0x434b4d){if(_0x434b4d){return _0xc9770c['sendStatus'](_0x1c3783);}return _0xc9770c[_0x4e23('0x17')](_0x1c3783)[_0x4e23('0x18')]();};}function respondWithResult(_0x214dd4,_0x5c6a8f){_0x5c6a8f=_0x5c6a8f||0xc8;return function(_0x5358cb){if(_0x5358cb){return _0x214dd4[_0x4e23('0x17')](_0x5c6a8f)['json'](_0x5358cb);}};}function respondWithFilteredResult(_0xfb1771,_0x11e57d){return function(_0x20a823){if(_0x20a823){var _0x41038a=_0x20a823[_0x4e23('0x19')],_0x1a4de6=_0x11e57d[_0x4e23('0x1a')],_0x19a631=_0x11e57d[_0x4e23('0x1a')]+_0x11e57d[_0x4e23('0x1b')],_0x5294f4;if(_0x19a631>=_0x41038a){_0x19a631=_0x41038a;_0x5294f4=0xc8;}else{_0x5294f4=0xce;}_0xfb1771[_0x4e23('0x17')](_0x5294f4);return _0xfb1771[_0x4e23('0x1c')]('Content-Range',_0x1a4de6+'-'+_0x19a631+'/'+_0x41038a)['json'](_0x20a823);}return null;};}function patchUpdates(_0x2dd51b){return function(_0x562d0d){try{jsonpatch['apply'](_0x562d0d,_0x2dd51b,!![]);}catch(_0x1aa128){return BPromise[_0x4e23('0x1d')](_0x1aa128);}return _0x562d0d['save']();};}function saveUpdates(_0x3cfdec,_0x1aa3b3){return function(_0x53517c){if(_0x53517c){return _0x53517c['update'](_0x3cfdec)[_0x4e23('0x1e')](function(_0x40596c){return _0x40596c;});}return null;};}function removeEntity(_0x14ac4a,_0x14b944){return function(_0xa4fb0f){if(_0xa4fb0f){return _0xa4fb0f['destroy']()[_0x4e23('0x1e')](function(){_0x14ac4a['status'](0xcc)[_0x4e23('0x18')]();});}};}function handleEntityNotFound(_0x25b118,_0x2951aa){return function(_0x2cdc13){if(!_0x2cdc13){_0x25b118[_0x4e23('0x1f')](0x194);}return _0x2cdc13;};}function handleError(_0x15b29e,_0xaf6d54){_0xaf6d54=_0xaf6d54||0x1f4;return function(_0x34b855){logger[_0x4e23('0x20')](_0x34b855[_0x4e23('0x21')]);if(_0x34b855[_0x4e23('0x22')]){delete _0x34b855['name'];}_0x15b29e['status'](_0xaf6d54)[_0x4e23('0x23')](_0x34b855);};}exports[_0x4e23('0x24')]=function(_0x3bd0c3,_0x36b0f9){var _0x16ac3d={},_0x5a727a={},_0x422e48={'count':0x0,'rows':[]};var _0x4babfd=_[_0x4e23('0x25')](db[_0x4e23('0x26')][_0x4e23('0x27')],function(_0x383a00){return{'name':_0x383a00['fieldName'],'type':_0x383a00[_0x4e23('0x28')][_0x4e23('0x29')]};});_0x5a727a[_0x4e23('0x2a')]=_[_0x4e23('0x25')](_0x4babfd,_0x4e23('0x22'));_0x5a727a[_0x4e23('0x2b')]=_[_0x4e23('0x2c')](_0x3bd0c3[_0x4e23('0x2b')]);_0x5a727a[_0x4e23('0x2d')]=_[_0x4e23('0x2e')](_0x5a727a[_0x4e23('0x2a')],_0x5a727a[_0x4e23('0x2b')]);_0x16ac3d[_0x4e23('0x2f')]=_[_0x4e23('0x2e')](_0x5a727a['model'],qs[_0x4e23('0x30')](_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x30')]));_0x16ac3d[_0x4e23('0x2f')]=_0x16ac3d[_0x4e23('0x2f')]['length']?_0x16ac3d[_0x4e23('0x2f')]:_0x5a727a[_0x4e23('0x2a')];if(!_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x31')](_0x4e23('0x32'))){_0x16ac3d[_0x4e23('0x1b')]=qs[_0x4e23('0x1b')](_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x1b')]);_0x16ac3d[_0x4e23('0x1a')]=qs['offset'](_0x3bd0c3['query']['offset']);}_0x16ac3d['order']=qs['sort'](_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x33')]);_0x16ac3d[_0x4e23('0x34')]=qs['filters'](_[_0x4e23('0x35')](_0x3bd0c3['query'],_0x5a727a['filters']));if(_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x36')]){_0x16ac3d['where']=_['merge'](_0x16ac3d['where'],{'$or':_[_0x4e23('0x25')](_0x4babfd,function(_0x2f475f){if(_0x2f475f[_0x4e23('0x28')]!==_0x4e23('0x37')){var _0x4297ca={};_0x4297ca[_0x2f475f[_0x4e23('0x22')]]={'$like':'%'+_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x36')]+'%'};return _0x4297ca;}})});}_0x16ac3d=_[_0x4e23('0x38')]({},_0x16ac3d,_0x3bd0c3['options']);var _0x5137df={'where':_0x16ac3d[_0x4e23('0x34')]};return db['CmHopperFinal'][_0x4e23('0x19')](_0x5137df)[_0x4e23('0x1e')](function(_0x4adc3a){_0x422e48[_0x4e23('0x19')]=_0x4adc3a;if(_0x3bd0c3[_0x4e23('0x2b')][_0x4e23('0x39')]){_0x16ac3d[_0x4e23('0x3a')]=[{'all':!![]}];}return db[_0x4e23('0x26')]['findAll'](_0x16ac3d);})[_0x4e23('0x1e')](function(_0x1b5a3d){_0x422e48[_0x4e23('0x3b')]=_0x1b5a3d;return _0x422e48;})[_0x4e23('0x1e')](respondWithFilteredResult(_0x36b0f9,_0x16ac3d))[_0x4e23('0x3c')](handleError(_0x36b0f9,null));};exports[_0x4e23('0x3d')]=function(_0x23414c,_0x232928){var _0xb9ea2c={'raw':!![],'where':{'id':_0x23414c[_0x4e23('0x3e')]['id']}},_0x5db9ef={};_0x5db9ef[_0x4e23('0x2a')]=_[_0x4e23('0x2c')](db[_0x4e23('0x26')][_0x4e23('0x27')]);_0x5db9ef[_0x4e23('0x2b')]=_['keys'](_0x23414c[_0x4e23('0x2b')]);_0x5db9ef[_0x4e23('0x2d')]=_[_0x4e23('0x2e')](_0x5db9ef[_0x4e23('0x2a')],_0x5db9ef[_0x4e23('0x2b')]);_0xb9ea2c['attributes']=_[_0x4e23('0x2e')](_0x5db9ef['model'],qs['fields'](_0x23414c[_0x4e23('0x2b')]['fields']));_0xb9ea2c['attributes']=_0xb9ea2c[_0x4e23('0x2f')][_0x4e23('0x3f')]?_0xb9ea2c[_0x4e23('0x2f')]:_0x5db9ef[_0x4e23('0x2a')];if(_0x23414c['query'][_0x4e23('0x39')]){_0xb9ea2c['include']=[{'all':!![]}];}_0xb9ea2c=_['merge']({},_0xb9ea2c,_0x23414c['options']);return db['CmHopperFinal'][_0x4e23('0x40')](_0xb9ea2c)[_0x4e23('0x1e')](handleEntityNotFound(_0x232928,null))['then'](respondWithResult(_0x232928,null))['catch'](handleError(_0x232928,null));};exports['describe']=function(_0x363389,_0x24b54d){return db['CmHopperFinal'][_0x4e23('0x41')]()[_0x4e23('0x1e')](respondWithResult(_0x24b54d,null))[_0x4e23('0x3c')](handleError(_0x24b54d,null));};exports['update']=function(_0x5b63e4,_0x99d25d){if(_0x5b63e4['body']['uniqueid']){delete _0x5b63e4[_0x4e23('0x42')][_0x4e23('0x43')];}return db[_0x4e23('0x26')][_0x4e23('0x40')]({'where':{'uniqueid':_0x5b63e4[_0x4e23('0x3e')]['id']}})[_0x4e23('0x1e')](handleEntityNotFound(_0x99d25d,null))[_0x4e23('0x1e')](saveUpdates(_0x5b63e4[_0x4e23('0x42')],null))['then'](respondWithResult(_0x99d25d,null))[_0x4e23('0x3c')](handleError(_0x99d25d,null));};exports[_0x4e23('0x44')]=function(_0x52aa7f,_0x1d1723,_0x2ecb53){return db[_0x4e23('0x26')][_0x4e23('0x45')]({'raw':![],'where':{'VoiceQueueId':_0x52aa7f[_0x4e23('0x3e')]['id']},'attributes':[[db['sequelize']['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')](_0x4e23('0x49')))),_0x4e23('0x4a')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')]('`state`\x20=\x203,\x201,\x20null'))),_0x4e23('0x4b')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db['sequelize'][_0x4e23('0x48')](_0x4e23('0x4c')))),_0x4e23('0x4d')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db['sequelize']['literal'](_0x4e23('0x4e')))),'congestionContacts'],[db[_0x4e23('0x47')]['fn']('COUNT',db[_0x4e23('0x47')]['fn']('IF',db['sequelize'][_0x4e23('0x48')](_0x4e23('0x4f')))),_0x4e23('0x50')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db['sequelize']['literal'](_0x4e23('0x51')))),'abandonedContacts'],[db[_0x4e23('0x47')]['fn']('COUNT',db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')](_0x4e23('0x52')))),_0x4e23('0x53')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')](_0x4e23('0x54')))),_0x4e23('0x55')]]})[_0x4e23('0x1e')](handleEntityNotFound(_0x1d1723,null))['then'](respondWithResult(_0x1d1723,null))[_0x4e23('0x3c')](handleError(_0x1d1723,null));};exports[_0x4e23('0x56')]=function(_0x3e8123,_0x4b4a45,_0x2c9dbd){return db['CmHopperFinal'][_0x4e23('0x45')]({'raw':![],'where':{'CampaignId':_0x3e8123[_0x4e23('0x3e')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')](_0x4e23('0x49')))),_0x4e23('0x4a')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db['sequelize'][_0x4e23('0x48')](_0x4e23('0x57')))),_0x4e23('0x4b')],[db['sequelize']['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')]('`state`\x20=\x205,\x201,\x20null'))),_0x4e23('0x4d')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')](_0x4e23('0x4e')))),_0x4e23('0x58')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db['sequelize'][_0x4e23('0x48')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4e23('0x50')],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4e23('0x51')))),'abandonedContacts'],[db[_0x4e23('0x47')]['fn'](_0x4e23('0x46'),db[_0x4e23('0x47')]['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')](_0x4e23('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x4e23('0x46'),db['sequelize']['fn']('IF',db[_0x4e23('0x47')][_0x4e23('0x48')]('`state`\x20=\x2019,\x201,\x20null'))),_0x4e23('0x55')]]})[_0x4e23('0x1e')](handleEntityNotFound(_0x4b4a45,null))['then'](respondWithResult(_0x4b4a45,null))[_0x4e23('0x3c')](handleError(_0x4b4a45,null));};exports[_0x4e23('0x59')]=function(_0x41419d,_0x39711d,_0xf2337a){return db['VoiceQueue']['find']({'where':{'id':_0x41419d[_0x4e23('0x3e')]['id']}})['then'](handleEntityNotFound(_0x39711d,null))[_0x4e23('0x1e')](function(_0x1f7a38){var _0x1d0a40;if(_0x1f7a38){_0x1d0a40=squel[_0x4e23('0x5a')]()[_0x4e23('0x5b')]('cm_hopper')[_0x4e23('0x5c')]([_0x4e23('0x5d'),_0x4e23('0x5e'),_0x4e23('0x5f'),_0x4e23('0x60'),_0x4e23('0x61'),_0x4e23('0x62'),'updatedAt'],squel[_0x4e23('0x63')]()['field'](_0x4e23('0x64'),'phone')[_0x4e23('0x65')]('NOW()',_0x4e23('0x5e'))[_0x4e23('0x65')](_0x4e23('0x66'),_0x4e23('0x5f'))[_0x4e23('0x65')]('ANY_VALUE(ListId)','ListId')[_0x4e23('0x65')](_0x4e23('0x67'),_0x4e23('0x61'))[_0x4e23('0x65')](_0x4e23('0x68'),_0x4e23('0x62'))['field'](_0x4e23('0x68'),_0x4e23('0x69'))[_0x4e23('0x6a')](_0x4e23('0x6b'))[_0x4e23('0x34')](_0x4e23('0x6c'),_0x41419d['params']['id']['toString']())[_0x4e23('0x34')]('state\x20=\x20?',_0x41419d[_0x4e23('0x42')][_0x4e23('0x6d')]['toString']())[_0x4e23('0x34')](_0x4e23('0x6e'))[_0x4e23('0x34')](_0x4e23('0x6f'),squel[_0x4e23('0x63')]()[_0x4e23('0x65')](_0x4e23('0x5d'))['from']('cm_hopper')['where'](_0x4e23('0x6c'),_0x41419d[_0x4e23('0x3e')]['id'][_0x4e23('0x70')]()))[_0x4e23('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4e23('0x63')]()[_0x4e23('0x65')](_0x4e23('0x71'))[_0x4e23('0x6a')](_0x4e23('0x6b'))['where']('VoiceQueueId\x20=\x20?',_0x41419d[_0x4e23('0x3e')]['id'][_0x4e23('0x70')]())['where']('state\x20=\x204'))[_0x4e23('0x72')](_0x4e23('0x5f')))[_0x4e23('0x70')]();return db[_0x4e23('0x47')][_0x4e23('0x2b')](_0x1d0a40);}return[];})[_0x4e23('0x1e')](respondWithResult(_0x39711d,null))[_0x4e23('0x3c')](handleError(_0x39711d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2c1c03,_0x3133c8,_0x1eb239){return db[_0x4e23('0x73')][_0x4e23('0x40')]({'where':{'id':_0x2c1c03[_0x4e23('0x3e')]['id']}})[_0x4e23('0x1e')](handleEntityNotFound(_0x3133c8,null))[_0x4e23('0x1e')](function(_0xbc38c1){var _0x413847;if(_0xbc38c1){_0x413847=squel['insert']()[_0x4e23('0x5b')](_0x4e23('0x74'))[_0x4e23('0x5c')]([_0x4e23('0x5d'),_0x4e23('0x5e'),_0x4e23('0x5f'),_0x4e23('0x60'),_0x4e23('0x75'),_0x4e23('0x62'),'updatedAt'],squel['select']()[_0x4e23('0x65')](_0x4e23('0x64'),'phone')[_0x4e23('0x65')](_0x4e23('0x68'),'scheduledAt')[_0x4e23('0x65')](_0x4e23('0x66'),_0x4e23('0x5f'))['field'](_0x4e23('0x76'),_0x4e23('0x60'))[_0x4e23('0x65')](_0x4e23('0x77'),_0x4e23('0x75'))[_0x4e23('0x65')]('NOW()',_0x4e23('0x62'))['field'](_0x4e23('0x68'),_0x4e23('0x69'))[_0x4e23('0x6a')](_0x4e23('0x6b'))['where'](_0x4e23('0x78'),_0x2c1c03['params']['id']['toString']())[_0x4e23('0x34')](_0x4e23('0x79'),_0x2c1c03[_0x4e23('0x42')][_0x4e23('0x6d')][_0x4e23('0x70')]())['where'](_0x4e23('0x6e'))['where'](_0x4e23('0x6f'),squel[_0x4e23('0x63')]()[_0x4e23('0x65')](_0x4e23('0x5d'))[_0x4e23('0x6a')](_0x4e23('0x74'))[_0x4e23('0x34')](_0x4e23('0x78'),_0x2c1c03['params']['id'][_0x4e23('0x70')]()))[_0x4e23('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4e23('0x63')]()[_0x4e23('0x65')](_0x4e23('0x71'))[_0x4e23('0x6a')](_0x4e23('0x6b'))[_0x4e23('0x34')](_0x4e23('0x78'),_0x2c1c03[_0x4e23('0x3e')]['id']['toString']())[_0x4e23('0x34')](_0x4e23('0x7a')))[_0x4e23('0x72')](_0x4e23('0x5f')))[_0x4e23('0x70')]();return db['sequelize'][_0x4e23('0x2b')](_0x413847);}return[];})[_0x4e23('0x1e')](respondWithResult(_0x3133c8,null))[_0x4e23('0x3c')](handleError(_0x3133c8,null));};exports['checkContactHopper']=function(_0x38d4c2,_0x2c9fea,_0x2cada8){return db['CmHopper'][_0x4e23('0x7b')]({'where':{'VoiceQueueId':_0x38d4c2[_0x4e23('0x42')][_0x4e23('0x61')],'CampaignId':_0x38d4c2[_0x4e23('0x42')]['CampaignId'],'ContactId':_0x38d4c2[_0x4e23('0x42')][_0x4e23('0x5f')]}})[_0x4e23('0x1e')](handleEntityNotFound(_0x2c9fea,null))[_0x4e23('0x1e')](function(_0x37cb04){if(_0x37cb04){return _0x37cb04;}return null;})[_0x4e23('0x1e')](respondWithResult(_0x2c9fea,null))[_0x4e23('0x3c')](handleError(_0x2c9fea,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4e3b2b2..db5e9bd 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 _0x0921=['bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment'];(function(_0x5e9693,_0x1eb992){var _0x5163e8=function(_0x1cc6a5){while(--_0x1cc6a5){_0x5e9693['push'](_0x5e9693['shift']());}};_0x5163e8(++_0x1eb992);}(_0x0921,0x6c));var _0x1092=function(_0x1391a8,_0x4e2f7f){_0x1391a8=_0x1391a8-0x0;var _0x1e3519=_0x0921[_0x1391a8];return _0x1e3519;};'use strict';var _=require('lodash');var util=require(_0x1092('0x0'));var logger=require(_0x1092('0x1'))(_0x1092('0x2'));var moment=require(_0x1092('0x3'));var BPromise=require(_0x1092('0x4'));var rp=require(_0x1092('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1092('0x6'));var config=require(_0x1092('0x7'));var attributes=require(_0x1092('0x8'));module[_0x1092('0x9')]=function(_0x34f6d3,_0x14bcf4){return _0x34f6d3[_0x1092('0xa')]('CmHopperFinal',attributes,{'tableName':_0x1092('0xb'),'paranoid':![],'indexes':[{'name':_0x1092('0xc'),'fields':['calleridnum']},{'name':_0x1092('0xd'),'fields':[_0x1092('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf06b=['calleridnum','uniqueid','lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define','cm_hopper_final'];(function(_0x38d713,_0x444131){var _0x234453=function(_0x265144){while(--_0x265144){_0x38d713['push'](_0x38d713['shift']());}};_0x234453(++_0x444131);}(_0xf06b,0x157));var _0xbf06=function(_0x43121c,_0x78aefa){_0x43121c=_0x43121c-0x0;var _0x16c2e6=_0xf06b[_0x43121c];return _0x16c2e6;};'use strict';var _=require(_0xbf06('0x0'));var util=require('util');var logger=require(_0xbf06('0x1'))(_0xbf06('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf06('0x3'));var rimraf=require(_0xbf06('0x4'));var config=require(_0xbf06('0x5'));var attributes=require('./cmHopperFinal.attributes');module[_0xbf06('0x6')]=function(_0x290e16,_0x3bd716){return _0x290e16[_0xbf06('0x7')]('CmHopperFinal',attributes,{'tableName':_0xbf06('0x8'),'paranoid':![],'indexes':[{'name':_0xbf06('0x9'),'fields':[_0xbf06('0x9')]},{'name':_0xbf06('0xa'),'fields':[_0xbf06('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 6f21aa8..9d4f16b 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 _0x08f5=['request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','debug','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x262eec,_0x59796c){var _0x5c1664=function(_0x31f6d9){while(--_0x31f6d9){_0x262eec['push'](_0x262eec['shift']());}};_0x5c1664(++_0x59796c);}(_0x08f5,0x197));var _0x508f=function(_0x34c027,_0x123688){_0x34c027=_0x34c027-0x0;var _0x47bff0=_0x08f5[_0x34c027];return _0x47bff0;};'use strict';var _=require(_0x508f('0x0'));var util=require(_0x508f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x508f('0x2'));var fs=require('fs');var Redis=require(_0x508f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x508f('0x4'))(_0x508f('0x5'));var config=require(_0x508f('0x6'));var jayson=require(_0x508f('0x7'));var client=jayson['client'][_0x508f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e170d,_0x79174a,_0x267a46){return new BPromise(function(_0x4b98f7,_0x479e99){return client[_0x508f('0x9')](_0x4e170d,_0x267a46)[_0x508f('0xa')](function(_0x52cc94){logger[_0x508f('0xb')](_0x508f('0xc'),_0x79174a,'request\x20sent');logger['debug'](_0x508f('0xd'),_0x79174a,_0x508f('0xe'),JSON[_0x508f('0xf')](_0x52cc94));if(_0x52cc94['error']){if(_0x52cc94[_0x508f('0x10')]['code']===0x1f4){logger[_0x508f('0x10')](_0x508f('0xc'),_0x79174a,_0x52cc94['error'][_0x508f('0x11')]);return _0x479e99(_0x52cc94[_0x508f('0x10')][_0x508f('0x11')]);}logger[_0x508f('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x79174a,_0x52cc94[_0x508f('0x10')][_0x508f('0x11')]);return _0x4b98f7(_0x52cc94[_0x508f('0x10')]['message']);}else{logger[_0x508f('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x79174a,_0x508f('0xe'));_0x4b98f7(_0x52cc94['result'][_0x508f('0x11')]);}})['catch'](function(_0x295edd){logger[_0x508f('0x10')](_0x508f('0xc'),_0x79174a,_0x295edd);_0x479e99(_0x295edd);});});}exports['CreateCmHopperFinal']=function(_0x556d59){var _0x3d0ea2=this;return new Promise(function(_0x40c876,_0x3e580f){return db[_0x508f('0x12')][_0x508f('0x13')](_0x556d59[_0x508f('0x14')],{'raw':_0x556d59[_0x508f('0x15')]?_0x556d59[_0x508f('0x15')][_0x508f('0x16')]===undefined?!![]:![]:!![]})[_0x508f('0xa')](function(_0x306fa1){logger['info'](_0x508f('0x17'),_0x556d59);logger[_0x508f('0x18')](_0x508f('0x17'),_0x556d59,JSON[_0x508f('0xf')](_0x306fa1));_0x40c876(_0x306fa1);})[_0x508f('0x19')](function(_0x3927b2){logger[_0x508f('0x10')]('CreateCmHopperFinal',_0x3927b2[_0x508f('0x11')],_0x556d59);_0x3e580f(_0x3d0ea2[_0x508f('0x10')](0x1f4,_0x3927b2['message']));});});}; \ No newline at end of file +var _0x89b1=['lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperFinal','create','body','options','raw'];(function(_0xf78f06,_0x2594d1){var _0x499556=function(_0x3ef3d4){while(--_0x3ef3d4){_0xf78f06['push'](_0xf78f06['shift']());}};_0x499556(++_0x2594d1);}(_0x89b1,0x122));var _0x189b=function(_0x2567b0,_0x5e0908){_0x2567b0=_0x2567b0-0x0;var _0x40d85c=_0x89b1[_0x2567b0];return _0x40d85c;};'use strict';var _=require(_0x189b('0x0'));var util=require(_0x189b('0x1'));var moment=require('moment');var BPromise=require(_0x189b('0x2'));var rs=require(_0x189b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x189b('0x4'));var logger=require(_0x189b('0x5'))(_0x189b('0x6'));var config=require(_0x189b('0x7'));var jayson=require(_0x189b('0x8'));var client=jayson[_0x189b('0x9')][_0x189b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504c13,_0x39ca6f,_0xc4c678){return new BPromise(function(_0x4aedae,_0x171c74){return client[_0x189b('0xb')](_0x504c13,_0xc4c678)[_0x189b('0xc')](function(_0x3b251f){logger[_0x189b('0xd')](_0x189b('0xe'),_0x39ca6f,'request\x20sent');logger[_0x189b('0xf')](_0x189b('0x10'),_0x39ca6f,_0x189b('0x11'),JSON[_0x189b('0x12')](_0x3b251f));if(_0x3b251f[_0x189b('0x13')]){if(_0x3b251f[_0x189b('0x13')][_0x189b('0x14')]===0x1f4){logger[_0x189b('0x13')](_0x189b('0xe'),_0x39ca6f,_0x3b251f['error'][_0x189b('0x15')]);return _0x171c74(_0x3b251f[_0x189b('0x13')][_0x189b('0x15')]);}logger['error'](_0x189b('0xe'),_0x39ca6f,_0x3b251f['error'][_0x189b('0x15')]);return _0x4aedae(_0x3b251f[_0x189b('0x13')]['message']);}else{logger[_0x189b('0xd')]('CmHopperFinal,\x20%s,\x20%s',_0x39ca6f,_0x189b('0x11'));_0x4aedae(_0x3b251f[_0x189b('0x16')][_0x189b('0x15')]);}})[_0x189b('0x17')](function(_0x23c3f3){logger['error'](_0x189b('0xe'),_0x39ca6f,_0x23c3f3);_0x171c74(_0x23c3f3);});});}exports[_0x189b('0x18')]=function(_0x30b18b){var _0x2efc21=this;return new Promise(function(_0x32e52c,_0x5b5c69){return db['CmHopperFinal'][_0x189b('0x19')](_0x30b18b[_0x189b('0x1a')],{'raw':_0x30b18b['options']?_0x30b18b[_0x189b('0x1b')][_0x189b('0x1c')]===undefined?!![]:![]:!![]})[_0x189b('0xc')](function(_0x97ede){logger['info'](_0x189b('0x18'),_0x30b18b);logger[_0x189b('0xf')](_0x189b('0x18'),_0x30b18b,JSON[_0x189b('0x12')](_0x97ede));_0x32e52c(_0x97ede);})[_0x189b('0x17')](function(_0x25732e){logger[_0x189b('0x13')](_0x189b('0x18'),_0x25732e[_0x189b('0x15')],_0x30b18b);_0x5b5c69(_0x2efc21['error'](0x1f4,_0x25732e[_0x189b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index a747f7a..4feca5f 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 _0x8d16=['/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0xc1690b,_0x204bc3){var _0x197367=function(_0x395211){while(--_0x395211){_0xc1690b['push'](_0xc1690b['shift']());}};_0x197367(++_0x204bc3);}(_0x8d16,0x11e));var _0x68d1=function(_0x2b5fa7,_0x1b475e){_0x2b5fa7=_0x2b5fa7-0x0;var _0x53fa13=_0x8d16[_0x2b5fa7];return _0x53fa13;};'use strict';var multer=require(_0x68d1('0x0'));var util=require(_0x68d1('0x1'));var path=require(_0x68d1('0x2'));var timeout=require(_0x68d1('0x3'));var express=require(_0x68d1('0x4'));var router=express[_0x68d1('0x5')]();var auth=require(_0x68d1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68d1('0x7'));var controller=require(_0x68d1('0x8'));router[_0x68d1('0x9')]('/',auth[_0x68d1('0xa')](),controller['index']);router[_0x68d1('0x9')](_0x68d1('0xb'),auth[_0x68d1('0xa')](),controller[_0x68d1('0xc')]);router[_0x68d1('0x9')](_0x68d1('0xd'),auth[_0x68d1('0xa')](),controller[_0x68d1('0xe')]);router[_0x68d1('0x9')](_0x68d1('0xf'),auth[_0x68d1('0xa')](),controller[_0x68d1('0x10')]);router[_0x68d1('0x9')](_0x68d1('0x11'),auth[_0x68d1('0xa')](),controller[_0x68d1('0x12')]);router[_0x68d1('0x13')](_0x68d1('0x14'),auth[_0x68d1('0xa')](),controller[_0x68d1('0x15')]);router[_0x68d1('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x68d1('0xa')](),controller[_0x68d1('0x16')]);router[_0x68d1('0x13')](_0x68d1('0x17'),auth[_0x68d1('0xa')](),controller[_0x68d1('0x18')]);router[_0x68d1('0x19')](_0x68d1('0xd'),auth[_0x68d1('0xa')](),controller[_0x68d1('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x7a94=['moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a94,0x84));var _0x47a9=function(_0x1b4560,_0x218f36){_0x1b4560=_0x1b4560-0x0;var _0xdbf640=_0x7a94[_0x1b4560];return _0xdbf640;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x47a9('0x0'));var router=express[_0x47a9('0x1')]();var auth=require(_0x47a9('0x2'));var interaction=require(_0x47a9('0x3'));var config=require(_0x47a9('0x4'));var controller=require(_0x47a9('0x5'));router['get']('/',auth[_0x47a9('0x6')](),controller[_0x47a9('0x7')]);router[_0x47a9('0x8')](_0x47a9('0x9'),auth['isAuthenticated'](),controller[_0x47a9('0xa')]);router['get'](_0x47a9('0xb'),auth[_0x47a9('0x6')](),controller[_0x47a9('0xc')]);router[_0x47a9('0x8')](_0x47a9('0xd'),auth[_0x47a9('0x6')](),controller[_0x47a9('0xe')]);router['get'](_0x47a9('0xf'),auth[_0x47a9('0x6')](),controller[_0x47a9('0x10')]);router[_0x47a9('0x11')]('/voice/queue/moveContacts/:id',auth[_0x47a9('0x6')](),controller[_0x47a9('0x12')]);router[_0x47a9('0x11')](_0x47a9('0x13'),auth[_0x47a9('0x6')](),controller[_0x47a9('0x14')]);router[_0x47a9('0x11')]('/checkContactHopper',auth[_0x47a9('0x6')](),controller[_0x47a9('0x15')]);router[_0x47a9('0x16')]('/:id',auth[_0x47a9('0x6')](),controller[_0x47a9('0x17')]);module[_0x47a9('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index fe78d17..ffded89 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 _0x12f5=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x37e43f,_0x445e57){var _0x32d0fc=function(_0x257cef){while(--_0x257cef){_0x37e43f['push'](_0x37e43f['shift']());}};_0x32d0fc(++_0x445e57);}(_0x12f5,0x163));var _0x512f=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x12f5[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require('sequelize');module[_0x512f('0x0')]={'state':{'type':Sequelize[_0x512f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x512f('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x512f('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x512f('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x512f('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x512f('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x512f('0x2')]},'starttime':{'type':Sequelize[_0x512f('0x3')]},'responsetime':{'type':Sequelize[_0x512f('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x512f('0x3')]},'endtime':{'type':Sequelize[_0x512f('0x3')]},'ringtime':{'type':Sequelize[_0x512f('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x512f('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x512f('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x512f('0x2')]},'campaign':{'type':Sequelize[_0x512f('0x2')]},'campaigntype':{'type':Sequelize[_0x512f('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x512f('0x2')]},'amd':{'type':Sequelize[_0x512f('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x512f('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x512f('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x512f('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x512f('0x3')]},'edited':{'type':Sequelize[_0x512f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3596=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x72bec6,_0x201a2b){var _0x3e5eac=function(_0x4c9b4e){while(--_0x4c9b4e){_0x72bec6['push'](_0x72bec6['shift']());}};_0x3e5eac(++_0x201a2b);}(_0x3596,0x106));var _0x6359=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x3596[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x6359('0x0'));module[_0x6359('0x1')]={'state':{'type':Sequelize[_0x6359('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6359('0x3')]},'scheduledat':{'type':Sequelize[_0x6359('0x4')]},'countbusyretry':{'type':Sequelize[_0x6359('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6359('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6359('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6359('0x3')]},'calleridnum':{'type':Sequelize[_0x6359('0x3')]},'calleridname':{'type':Sequelize[_0x6359('0x3')]},'starttime':{'type':Sequelize[_0x6359('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6359('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6359('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6359('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6359('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6359('0x3')]},'membername':{'type':Sequelize[_0x6359('0x3')]},'reason':{'type':Sequelize[_0x6359('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x6359('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6359('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6359('0x4')]},'recallme':{'type':Sequelize[_0x6359('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6359('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index d97ffea..969e05c 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 _0xfe44=['offset','limit','set','reject','save','update','destroy','then','error','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','uniqueid','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x21a7ec,_0x450563){var _0x391fbf=function(_0x2abbd3){while(--_0x2abbd3){_0x21a7ec['push'](_0x21a7ec['shift']());}};_0x391fbf(++_0x450563);}(_0xfe44,0x77));var _0x4fe4=function(_0x21f671,_0x5e9b9e){_0x21f671=_0x21f671-0x0;var _0x4fa888=_0xfe44[_0x21f671];return _0x4fa888;};'use strict';var pdf=require(_0x4fe4('0x0'));var emlformat=require(_0x4fe4('0x1'));var rimraf=require(_0x4fe4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fe4('0x3'));var rp=require('request-promise');var moment=require(_0x4fe4('0x4'));var BPromise=require(_0x4fe4('0x5'));var Mustache=require(_0x4fe4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4fe4('0x7'));var csv=require('to-csv');var ejs=require(_0x4fe4('0x8'));var fs=require('fs');var _=require(_0x4fe4('0x9'));var squel=require('squel');var crypto=require(_0x4fe4('0xa'));var jsforce=require(_0x4fe4('0xb'));var deskjs=require(_0x4fe4('0xc'));var toCsv=require(_0x4fe4('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4fe4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4fe4('0xf'));var as=require(_0x4fe4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fe4('0x11'))(_0x4fe4('0x12'));var utils=require(_0x4fe4('0x13'));var config=require(_0x4fe4('0x14'));var db=require(_0x4fe4('0x15'))['db'];function respondWithStatusCode(_0x21d3fd,_0x207e16){_0x207e16=_0x207e16||0xcc;return function(_0x31dc82){if(_0x31dc82){return _0x21d3fd[_0x4fe4('0x16')](_0x207e16);}return _0x21d3fd[_0x4fe4('0x17')](_0x207e16)[_0x4fe4('0x18')]();};}function respondWithResult(_0x212407,_0x2e1963){_0x2e1963=_0x2e1963||0xc8;return function(_0x5cbf2f){if(_0x5cbf2f){return _0x212407[_0x4fe4('0x17')](_0x2e1963)[_0x4fe4('0x19')](_0x5cbf2f);}};}function respondWithFilteredResult(_0x94c403,_0x55cb5a){return function(_0x13fc15){if(_0x13fc15){var _0x1b1465=_0x13fc15[_0x4fe4('0x1a')],_0x5f4e9d=_0x55cb5a[_0x4fe4('0x1b')],_0x3ac33e=_0x55cb5a['offset']+_0x55cb5a[_0x4fe4('0x1c')],_0x1a178f;if(_0x3ac33e>=_0x1b1465){_0x3ac33e=_0x1b1465;_0x1a178f=0xc8;}else{_0x1a178f=0xce;}_0x94c403[_0x4fe4('0x17')](_0x1a178f);return _0x94c403[_0x4fe4('0x1d')]('Content-Range',_0x5f4e9d+'-'+_0x3ac33e+'/'+_0x1b1465)[_0x4fe4('0x19')](_0x13fc15);}return null;};}function patchUpdates(_0x24e6a5){return function(_0xdfd893){try{jsonpatch['apply'](_0xdfd893,_0x24e6a5,!![]);}catch(_0x4298ad){return BPromise[_0x4fe4('0x1e')](_0x4298ad);}return _0xdfd893[_0x4fe4('0x1f')]();};}function saveUpdates(_0x55e3ef,_0x4f003a){return function(_0x514d2b){if(_0x514d2b){return _0x514d2b[_0x4fe4('0x20')](_0x55e3ef)['then'](function(_0x1300a1){return _0x1300a1;});}return null;};}function removeEntity(_0x3d018a,_0x3ffd27){return function(_0x4188bd){if(_0x4188bd){return _0x4188bd[_0x4fe4('0x21')]()[_0x4fe4('0x22')](function(){_0x3d018a[_0x4fe4('0x17')](0xcc)[_0x4fe4('0x18')]();});}};}function handleEntityNotFound(_0x2aba4f,_0x16e793){return function(_0x4cf44f){if(!_0x4cf44f){_0x2aba4f[_0x4fe4('0x16')](0x194);}return _0x4cf44f;};}function handleError(_0xacbc20,_0x2be8cf){_0x2be8cf=_0x2be8cf||0x1f4;return function(_0x2621fc){logger[_0x4fe4('0x23')](_0x2621fc['stack']);if(_0x2621fc[_0x4fe4('0x24')]){delete _0x2621fc[_0x4fe4('0x24')];}_0xacbc20[_0x4fe4('0x17')](_0x2be8cf)[_0x4fe4('0x25')](_0x2621fc);};}exports[_0x4fe4('0x26')]=function(_0xac7fc4,_0xe9c43a){var _0x2c6f77={},_0x53b408={},_0x276579={'count':0x0,'rows':[]};var _0x117db2=_[_0x4fe4('0x27')](db[_0x4fe4('0x28')][_0x4fe4('0x29')],function(_0x25cc11){return{'name':_0x25cc11['fieldName'],'type':_0x25cc11[_0x4fe4('0x2a')][_0x4fe4('0x2b')]};});_0x53b408[_0x4fe4('0x2c')]=_[_0x4fe4('0x27')](_0x117db2,_0x4fe4('0x24'));_0x53b408[_0x4fe4('0x2d')]=_['keys'](_0xac7fc4[_0x4fe4('0x2d')]);_0x53b408['filters']=_['intersection'](_0x53b408['model'],_0x53b408[_0x4fe4('0x2d')]);_0x2c6f77[_0x4fe4('0x2e')]=_[_0x4fe4('0x2f')](_0x53b408[_0x4fe4('0x2c')],qs[_0x4fe4('0x30')](_0xac7fc4[_0x4fe4('0x2d')][_0x4fe4('0x30')]));_0x2c6f77[_0x4fe4('0x2e')]=_0x2c6f77[_0x4fe4('0x2e')][_0x4fe4('0x31')]?_0x2c6f77[_0x4fe4('0x2e')]:_0x53b408[_0x4fe4('0x2c')];if(!_0xac7fc4['query'][_0x4fe4('0x32')](_0x4fe4('0x33'))){_0x2c6f77[_0x4fe4('0x1c')]=qs['limit'](_0xac7fc4[_0x4fe4('0x2d')][_0x4fe4('0x1c')]);_0x2c6f77['offset']=qs[_0x4fe4('0x1b')](_0xac7fc4[_0x4fe4('0x2d')]['offset']);}_0x2c6f77['order']=qs[_0x4fe4('0x34')](_0xac7fc4['query'][_0x4fe4('0x34')]);_0x2c6f77[_0x4fe4('0x35')]=qs[_0x4fe4('0x36')](_[_0x4fe4('0x37')](_0xac7fc4[_0x4fe4('0x2d')],_0x53b408[_0x4fe4('0x36')]));if(_0xac7fc4[_0x4fe4('0x2d')][_0x4fe4('0x38')]){_0x2c6f77[_0x4fe4('0x35')]=_['merge'](_0x2c6f77[_0x4fe4('0x35')],{'$or':_[_0x4fe4('0x27')](_0x117db2,function(_0x87e4d8){if(_0x87e4d8[_0x4fe4('0x2a')]!==_0x4fe4('0x39')){var _0x29f3d3={};_0x29f3d3[_0x87e4d8['name']]={'$like':'%'+_0xac7fc4[_0x4fe4('0x2d')][_0x4fe4('0x38')]+'%'};return _0x29f3d3;}})});}_0x2c6f77=_[_0x4fe4('0x3a')]({},_0x2c6f77,_0xac7fc4[_0x4fe4('0x3b')]);var _0x38ce10={'where':_0x2c6f77[_0x4fe4('0x35')]};return db['CmHopperHistory']['count'](_0x38ce10)[_0x4fe4('0x22')](function(_0x15e6ce){_0x276579[_0x4fe4('0x1a')]=_0x15e6ce;if(_0xac7fc4[_0x4fe4('0x2d')][_0x4fe4('0x3c')]){_0x2c6f77[_0x4fe4('0x3d')]=[{'all':!![]}];}return db[_0x4fe4('0x28')][_0x4fe4('0x3e')](_0x2c6f77);})[_0x4fe4('0x22')](function(_0x384056){_0x276579[_0x4fe4('0x3f')]=_0x384056;return _0x276579;})['then'](respondWithFilteredResult(_0xe9c43a,_0x2c6f77))[_0x4fe4('0x40')](handleError(_0xe9c43a,null));};exports[_0x4fe4('0x41')]=function(_0xce6edd,_0xff1c67){var _0x572ebd={'raw':!![],'where':{'id':_0xce6edd[_0x4fe4('0x42')]['id']}},_0x4c943a={};_0x4c943a[_0x4fe4('0x2c')]=_[_0x4fe4('0x43')](db[_0x4fe4('0x28')][_0x4fe4('0x29')]);_0x4c943a[_0x4fe4('0x2d')]=_[_0x4fe4('0x43')](_0xce6edd['query']);_0x4c943a['filters']=_[_0x4fe4('0x2f')](_0x4c943a[_0x4fe4('0x2c')],_0x4c943a[_0x4fe4('0x2d')]);_0x572ebd[_0x4fe4('0x2e')]=_[_0x4fe4('0x2f')](_0x4c943a[_0x4fe4('0x2c')],qs[_0x4fe4('0x30')](_0xce6edd[_0x4fe4('0x2d')][_0x4fe4('0x30')]));_0x572ebd[_0x4fe4('0x2e')]=_0x572ebd[_0x4fe4('0x2e')]['length']?_0x572ebd[_0x4fe4('0x2e')]:_0x4c943a['model'];if(_0xce6edd[_0x4fe4('0x2d')][_0x4fe4('0x3c')]){_0x572ebd[_0x4fe4('0x3d')]=[{'all':!![]}];}_0x572ebd=_['merge']({},_0x572ebd,_0xce6edd[_0x4fe4('0x3b')]);return db[_0x4fe4('0x28')][_0x4fe4('0x44')](_0x572ebd)[_0x4fe4('0x22')](handleEntityNotFound(_0xff1c67,null))['then'](respondWithResult(_0xff1c67,null))[_0x4fe4('0x40')](handleError(_0xff1c67,null));};exports[_0x4fe4('0x45')]=function(_0x49ed85,_0xa3a8aa){return db[_0x4fe4('0x28')][_0x4fe4('0x45')](_0x49ed85[_0x4fe4('0x46')],{})[_0x4fe4('0x22')](respondWithResult(_0xa3a8aa,0xc9))[_0x4fe4('0x40')](handleError(_0xa3a8aa,null));};exports[_0x4fe4('0x47')]=function(_0x3f147e,_0x5efcee){return db[_0x4fe4('0x28')][_0x4fe4('0x47')]()[_0x4fe4('0x22')](respondWithResult(_0x5efcee,null))[_0x4fe4('0x40')](handleError(_0x5efcee,null));};exports['update']=function(_0x36eef7,_0x2dd9a7){if(_0x36eef7[_0x4fe4('0x46')][_0x4fe4('0x48')]){delete _0x36eef7[_0x4fe4('0x46')][_0x4fe4('0x48')];}return db[_0x4fe4('0x28')][_0x4fe4('0x44')]({'where':{'uniqueid':_0x36eef7[_0x4fe4('0x42')]['id']}})['then'](handleEntityNotFound(_0x2dd9a7,null))[_0x4fe4('0x22')](saveUpdates(_0x36eef7[_0x4fe4('0x46')],null))[_0x4fe4('0x22')](respondWithResult(_0x2dd9a7,null))[_0x4fe4('0x40')](handleError(_0x2dd9a7,null));}; \ No newline at end of file +var _0x040d=['body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','params','keys','find','create'];(function(_0x1d9307,_0x342625){var _0x390409=function(_0x421370){while(--_0x421370){_0x1d9307['push'](_0x1d9307['shift']());}};_0x390409(++_0x342625);}(_0x040d,0x1b3));var _0xd040=function(_0x104b35,_0x13f218){_0x104b35=_0x104b35-0x0;var _0x55584d=_0x040d[_0x104b35];return _0x55584d;};'use strict';var pdf=require(_0xd040('0x0'));var emlformat=require(_0xd040('0x1'));var rimraf=require(_0xd040('0x2'));var zipdir=require(_0xd040('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd040('0x4'));var moment=require(_0xd040('0x5'));var BPromise=require(_0xd040('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd040('0x7'));var csv=require(_0xd040('0x8'));var ejs=require(_0xd040('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd040('0xa'));var crypto=require(_0xd040('0xb'));var jsforce=require(_0xd040('0xc'));var deskjs=require(_0xd040('0xd'));var toCsv=require(_0xd040('0x8'));var querystring=require(_0xd040('0xe'));var Papa=require(_0xd040('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd040('0x10'));var as=require(_0xd040('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd040('0x12'));var utils=require(_0xd040('0x13'));var config=require(_0xd040('0x14'));var db=require(_0xd040('0x15'))['db'];function respondWithStatusCode(_0x334f7b,_0x28e96c){_0x28e96c=_0x28e96c||0xcc;return function(_0x56d3b1){if(_0x56d3b1){return _0x334f7b[_0xd040('0x16')](_0x28e96c);}return _0x334f7b[_0xd040('0x17')](_0x28e96c)[_0xd040('0x18')]();};}function respondWithResult(_0x29a86a,_0x4501a5){_0x4501a5=_0x4501a5||0xc8;return function(_0xc5d34){if(_0xc5d34){return _0x29a86a[_0xd040('0x17')](_0x4501a5)[_0xd040('0x19')](_0xc5d34);}};}function respondWithFilteredResult(_0x31e8de,_0x5729ba){return function(_0x51b5ce){if(_0x51b5ce){var _0x28d3a7=_0x51b5ce['count'],_0x382eb5=_0x5729ba[_0xd040('0x1a')],_0x4bdea1=_0x5729ba['offset']+_0x5729ba['limit'],_0x457256;if(_0x4bdea1>=_0x28d3a7){_0x4bdea1=_0x28d3a7;_0x457256=0xc8;}else{_0x457256=0xce;}_0x31e8de[_0xd040('0x17')](_0x457256);return _0x31e8de[_0xd040('0x1b')](_0xd040('0x1c'),_0x382eb5+'-'+_0x4bdea1+'/'+_0x28d3a7)['json'](_0x51b5ce);}return null;};}function patchUpdates(_0x38b9d6){return function(_0x63a3f7){try{jsonpatch[_0xd040('0x1d')](_0x63a3f7,_0x38b9d6,!![]);}catch(_0x1a94a4){return BPromise['reject'](_0x1a94a4);}return _0x63a3f7['save']();};}function saveUpdates(_0x142db5,_0x957bb6){return function(_0x4d1ee9){if(_0x4d1ee9){return _0x4d1ee9[_0xd040('0x1e')](_0x142db5)[_0xd040('0x1f')](function(_0x46c615){return _0x46c615;});}return null;};}function removeEntity(_0x10e157,_0x3636f3){return function(_0x357a18){if(_0x357a18){return _0x357a18[_0xd040('0x20')]()[_0xd040('0x1f')](function(){_0x10e157['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a44e4,_0x28e7eb){return function(_0x2e5e6d){if(!_0x2e5e6d){_0x3a44e4[_0xd040('0x16')](0x194);}return _0x2e5e6d;};}function handleError(_0x1e505a,_0x248469){_0x248469=_0x248469||0x1f4;return function(_0x48d686){logger[_0xd040('0x21')](_0x48d686[_0xd040('0x22')]);if(_0x48d686[_0xd040('0x23')]){delete _0x48d686['name'];}_0x1e505a[_0xd040('0x17')](_0x248469)[_0xd040('0x24')](_0x48d686);};}exports['index']=function(_0x1bc3da,_0x5bae36){var _0x5e0b54={},_0x4d0e60={},_0x1ba078={'count':0x0,'rows':[]};var _0x5b59b4=_[_0xd040('0x25')](db[_0xd040('0x26')][_0xd040('0x27')],function(_0xbf6554){return{'name':_0xbf6554[_0xd040('0x28')],'type':_0xbf6554[_0xd040('0x29')][_0xd040('0x2a')]};});_0x4d0e60['model']=_[_0xd040('0x25')](_0x5b59b4,_0xd040('0x23'));_0x4d0e60[_0xd040('0x2b')]=_['keys'](_0x1bc3da[_0xd040('0x2b')]);_0x4d0e60[_0xd040('0x2c')]=_['intersection'](_0x4d0e60[_0xd040('0x2d')],_0x4d0e60[_0xd040('0x2b')]);_0x5e0b54['attributes']=_[_0xd040('0x2e')](_0x4d0e60['model'],qs['fields'](_0x1bc3da[_0xd040('0x2b')][_0xd040('0x2f')]));_0x5e0b54[_0xd040('0x30')]=_0x5e0b54[_0xd040('0x30')][_0xd040('0x31')]?_0x5e0b54[_0xd040('0x30')]:_0x4d0e60['model'];if(!_0x1bc3da['query'][_0xd040('0x32')](_0xd040('0x33'))){_0x5e0b54[_0xd040('0x34')]=qs['limit'](_0x1bc3da[_0xd040('0x2b')][_0xd040('0x34')]);_0x5e0b54['offset']=qs['offset'](_0x1bc3da['query'][_0xd040('0x1a')]);}_0x5e0b54[_0xd040('0x35')]=qs['sort'](_0x1bc3da['query']['sort']);_0x5e0b54[_0xd040('0x36')]=qs[_0xd040('0x2c')](_[_0xd040('0x37')](_0x1bc3da['query'],_0x4d0e60[_0xd040('0x2c')]));if(_0x1bc3da[_0xd040('0x2b')][_0xd040('0x38')]){_0x5e0b54[_0xd040('0x36')]=_['merge'](_0x5e0b54[_0xd040('0x36')],{'$or':_['map'](_0x5b59b4,function(_0x3def39){if(_0x3def39['type']!==_0xd040('0x39')){var _0x2d50da={};_0x2d50da[_0x3def39['name']]={'$like':'%'+_0x1bc3da[_0xd040('0x2b')]['filter']+'%'};return _0x2d50da;}})});}_0x5e0b54=_[_0xd040('0x3a')]({},_0x5e0b54,_0x1bc3da[_0xd040('0x3b')]);var _0x4b101a={'where':_0x5e0b54[_0xd040('0x36')]};return db[_0xd040('0x26')][_0xd040('0x3c')](_0x4b101a)['then'](function(_0xc6173f){_0x1ba078[_0xd040('0x3c')]=_0xc6173f;if(_0x1bc3da[_0xd040('0x2b')][_0xd040('0x3d')]){_0x5e0b54['include']=[{'all':!![]}];}return db[_0xd040('0x26')][_0xd040('0x3e')](_0x5e0b54);})[_0xd040('0x1f')](function(_0x4a9a15){_0x1ba078[_0xd040('0x3f')]=_0x4a9a15;return _0x1ba078;})[_0xd040('0x1f')](respondWithFilteredResult(_0x5bae36,_0x5e0b54))[_0xd040('0x40')](handleError(_0x5bae36,null));};exports['show']=function(_0x36d0e9,_0x1a9ffd){var _0x2f83fb={'raw':!![],'where':{'id':_0x36d0e9[_0xd040('0x41')]['id']}},_0x458c41={};_0x458c41['model']=_['keys'](db[_0xd040('0x26')][_0xd040('0x27')]);_0x458c41[_0xd040('0x2b')]=_[_0xd040('0x42')](_0x36d0e9[_0xd040('0x2b')]);_0x458c41[_0xd040('0x2c')]=_['intersection'](_0x458c41['model'],_0x458c41['query']);_0x2f83fb[_0xd040('0x30')]=_[_0xd040('0x2e')](_0x458c41[_0xd040('0x2d')],qs['fields'](_0x36d0e9['query']['fields']));_0x2f83fb[_0xd040('0x30')]=_0x2f83fb[_0xd040('0x30')][_0xd040('0x31')]?_0x2f83fb['attributes']:_0x458c41['model'];if(_0x36d0e9[_0xd040('0x2b')][_0xd040('0x3d')]){_0x2f83fb['include']=[{'all':!![]}];}_0x2f83fb=_[_0xd040('0x3a')]({},_0x2f83fb,_0x36d0e9[_0xd040('0x3b')]);return db[_0xd040('0x26')][_0xd040('0x43')](_0x2f83fb)[_0xd040('0x1f')](handleEntityNotFound(_0x1a9ffd,null))[_0xd040('0x1f')](respondWithResult(_0x1a9ffd,null))[_0xd040('0x40')](handleError(_0x1a9ffd,null));};exports[_0xd040('0x44')]=function(_0x410077,_0x50ca34){return db[_0xd040('0x26')]['create'](_0x410077[_0xd040('0x45')],{})[_0xd040('0x1f')](respondWithResult(_0x50ca34,0xc9))[_0xd040('0x40')](handleError(_0x50ca34,null));};exports[_0xd040('0x46')]=function(_0x52c676,_0x1c20ef){return db[_0xd040('0x26')][_0xd040('0x46')]()[_0xd040('0x1f')](respondWithResult(_0x1c20ef,null))[_0xd040('0x40')](handleError(_0x1c20ef,null));};exports['update']=function(_0xaf0061,_0x4ebdaf){if(_0xaf0061[_0xd040('0x45')][_0xd040('0x47')]){delete _0xaf0061['body']['uniqueid'];}return db[_0xd040('0x26')][_0xd040('0x43')]({'where':{'uniqueid':_0xaf0061['params']['id']}})[_0xd040('0x1f')](handleEntityNotFound(_0x4ebdaf,null))[_0xd040('0x1f')](saveUpdates(_0xaf0061[_0xd040('0x45')],null))['then'](respondWithResult(_0x4ebdaf,null))[_0xd040('0x40')](handleError(_0x4ebdaf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index bda35e7..bfe40c7 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 _0x13dd=['cm_hopper_history','endtime','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x199bdd,_0x5f09e2){var _0x5c4f2f=function(_0xac4ba8){while(--_0xac4ba8){_0x199bdd['push'](_0x199bdd['shift']());}};_0x5c4f2f(++_0x5f09e2);}(_0x13dd,0x188));var _0xd13d=function(_0x393a34,_0x2486b3){_0x393a34=_0x393a34-0x0;var _0x7ad02c=_0x13dd[_0x393a34];return _0x7ad02c;};'use strict';var _=require('lodash');var util=require(_0xd13d('0x0'));var logger=require(_0xd13d('0x1'))('api');var moment=require(_0xd13d('0x2'));var BPromise=require(_0xd13d('0x3'));var rp=require(_0xd13d('0x4'));var fs=require('fs');var path=require(_0xd13d('0x5'));var rimraf=require('rimraf');var config=require(_0xd13d('0x6'));var attributes=require(_0xd13d('0x7'));module[_0xd13d('0x8')]=function(_0x22efb4,_0x1dd3cd){return _0x22efb4[_0xd13d('0x9')](_0xd13d('0xa'),attributes,{'tableName':_0xd13d('0xb'),'paranoid':![],'indexes':[{'name':_0xd13d('0xc'),'fields':[_0xd13d('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x54cb=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment'];(function(_0x51e453,_0xa3da96){var _0x4addc8=function(_0x10dce9){while(--_0x10dce9){_0x51e453['push'](_0x51e453['shift']());}};_0x4addc8(++_0xa3da96);}(_0x54cb,0x1af));var _0xb54c=function(_0x127518,_0x90fc85){_0x127518=_0x127518-0x0;var _0x2b03db=_0x54cb[_0x127518];return _0x2b03db;};'use strict';var _=require(_0xb54c('0x0'));var util=require(_0xb54c('0x1'));var logger=require('../../config/logger')(_0xb54c('0x2'));var moment=require(_0xb54c('0x3'));var BPromise=require(_0xb54c('0x4'));var rp=require(_0xb54c('0x5'));var fs=require('fs');var path=require(_0xb54c('0x6'));var rimraf=require(_0xb54c('0x7'));var config=require(_0xb54c('0x8'));var attributes=require(_0xb54c('0x9'));module[_0xb54c('0xa')]=function(_0x1c3d63,_0x37bf57){return _0x1c3d63[_0xb54c('0xb')]('CmHopperHistory',attributes,{'tableName':_0xb54c('0xc'),'paranoid':![],'indexes':[{'name':_0xb54c('0xd'),'fields':[_0xb54c('0xd')]},{'name':_0xb54c('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d344374..80c9185 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 _0x5eb8=['raw','then','CreateCmHopperHistory','stringify','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperHistory','create','body','options'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x5eb8,0xb0));var _0x85eb=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x5eb8[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateCmHopperHistory']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateCmHopperHistory',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});};exports[_0x85eb('0x1d')]=function(_0x1426c8){var _0x3f7a4d=this;return new Promise(function(_0x28b87d,_0x312b3e){return db[_0x85eb('0x15')]['findAll']({'raw':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')]['where']||null:null,'attributes':[[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')][_0x85eb('0x20')]('id')),_0x85eb('0x21')],[db[_0x85eb('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x24')))),_0x85eb('0x25')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x27')))),_0x85eb('0x28')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x29')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x340745){logger[_0x85eb('0xd')](_0x85eb('0x1d'),_0x1426c8);logger[_0x85eb('0x10')](_0x85eb('0x1d'),_0x1426c8,JSON[_0x85eb('0x1c')](_0x340745));_0x28b87d(_0x340745);})[_0x85eb('0x14')](function(_0x35f092){logger[_0x85eb('0x12')](_0x85eb('0x1d'),_0x35f092[_0x85eb('0x13')],_0x1426c8);_0x312b3e(_0x3f7a4d[_0x85eb('0x12')](0x1f4,_0x35f092[_0x85eb('0x13')]));});});};exports[_0x85eb('0x2a')]=function(_0x4b69a7){var _0x4361e2=this;return new Promise(function(_0x3dfe74,_0x58f091){return db['CmHopperHistory'][_0x85eb('0x2b')]({'raw':_0x4b69a7[_0x85eb('0x18')]?_0x4b69a7['options'][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4b69a7['options']?_0x4b69a7[_0x85eb('0x18')]['where']||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x85eb('0x2e')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x85eb('0x22')))),_0x85eb('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x30')))),_0x85eb('0x31')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x32')))),_0x85eb('0x33')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x36')))),_0x85eb('0x37')],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x38')))),_0x85eb('0x39')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x3a')))),_0x85eb('0x3b')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x3c')))),_0x85eb('0x3d')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x3e')))),_0x85eb('0x3f')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x85eb('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x40')))),'outboundReCallsDay']],'group':['campaign']})[_0x85eb('0x1a')](function(_0x249511){logger[_0x85eb('0xd')](_0x85eb('0x2a'),_0x4b69a7);logger[_0x85eb('0x10')]('GetVoiceQueueHopperHistory',_0x4b69a7,JSON[_0x85eb('0x1c')](_0x249511));_0x3dfe74(_0x249511);})[_0x85eb('0x14')](function(_0x270bb2){logger[_0x85eb('0x12')](_0x85eb('0x2a'),_0x270bb2['message'],_0x4b69a7);_0x58f091(_0x4361e2[_0x85eb('0x12')](0x1f4,_0x270bb2['message']));});});};exports[_0x85eb('0x41')]=function(_0x40d846){var _0x4ee529=this;return new Promise(function(_0x341ddb,_0xd04f24){return db[_0x85eb('0x15')][_0x85eb('0x2b')]({'raw':_0x40d846[_0x85eb('0x18')]?_0x40d846[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x40d846[_0x85eb('0x18')]?_0x40d846['options'][_0x85eb('0x42')]||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize'][_0x85eb('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85eb('0x2c')]})[_0x85eb('0x1a')](function(_0x1d3204){logger[_0x85eb('0xd')](_0x85eb('0x41'),_0x40d846);logger[_0x85eb('0x10')](_0x85eb('0x41'),_0x40d846,JSON[_0x85eb('0x1c')](_0x1d3204));_0x341ddb(_0x1d3204);})[_0x85eb('0x14')](function(_0x13cc2a){logger[_0x85eb('0x12')]('GetCampaignHopperHistory',_0x13cc2a[_0x85eb('0x13')],_0x40d846);_0xd04f24(_0x4ee529[_0x85eb('0x12')](0x1f4,_0x13cc2a[_0x85eb('0x13')]));});});}; \ No newline at end of file +var _0x80ed=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay'];(function(_0x45435c,_0x2525e4){var _0x2b7d13=function(_0x457ac6){while(--_0x457ac6){_0x45435c['push'](_0x45435c['shift']());}};_0x2b7d13(++_0x2525e4);}(_0x80ed,0x11c));var _0xd80e=function(_0x38fe43,_0x8b9046){_0x38fe43=_0x38fe43-0x0;var _0x12a7f3=_0x80ed[_0x38fe43];return _0x12a7f3;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c361,_0x411b3a,_0x438f7d){return new BPromise(function(_0x3b4f35,_0x1bacd3){return client[_0xd80e('0xb')](_0x51c361,_0x438f7d)[_0xd80e('0xc')](function(_0x3063ff){logger[_0xd80e('0xd')](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));logger['debug'](_0xd80e('0x10'),_0x411b3a,_0xd80e('0xf'),JSON[_0xd80e('0x11')](_0x3063ff));if(_0x3063ff[_0xd80e('0x12')]){if(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x13')]===0x1f4){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')]['message']);return _0x1bacd3(_0x3063ff['error']['message']);}logger['error'](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);return _0x3b4f35(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);}else{logger['info'](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));_0x3b4f35(_0x3063ff[_0xd80e('0x15')][_0xd80e('0x14')]);}})[_0xd80e('0x16')](function(_0xc25d82){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0xc25d82);_0x1bacd3(_0xc25d82);});});}exports['CreateCmHopperHistory']=function(_0x21ceec){var _0x1cc576=this;return new Promise(function(_0x3b543d,_0x34e239){return db['CmHopperHistory'][_0xd80e('0x17')](_0x21ceec[_0xd80e('0x18')],{'raw':_0x21ceec[_0xd80e('0x19')]?_0x21ceec['options'][_0xd80e('0x1a')]===undefined?!![]:![]:!![]})[_0xd80e('0xc')](function(_0x2765ea){logger[_0xd80e('0xd')](_0xd80e('0x1b'),_0x21ceec);logger['debug']('CreateCmHopperHistory',_0x21ceec,JSON[_0xd80e('0x11')](_0x2765ea));_0x3b543d(_0x2765ea);})[_0xd80e('0x16')](function(_0x3b39bf){logger[_0xd80e('0x12')](_0xd80e('0x1b'),_0x3b39bf[_0xd80e('0x14')],_0x21ceec);_0x34e239(_0x1cc576[_0xd80e('0x12')](0x1f4,_0x3b39bf['message']));});});};exports[_0xd80e('0x1c')]=function(_0x57d70){var _0x170109=this;return new Promise(function(_0x5b0d6d,_0x635ce0){return db[_0xd80e('0x1d')][_0xd80e('0x1e')]({'raw':_0x57d70['options']?_0x57d70['options']['raw']===undefined?!![]:![]:!![],'where':_0x57d70[_0xd80e('0x19')]?_0x57d70['options'][_0xd80e('0x1f')]||null:null,'attributes':[[db[_0xd80e('0x20')]['fn']('COUNT',db[_0xd80e('0x20')][_0xd80e('0x21')]('id')),_0xd80e('0x22')],[db[_0xd80e('0x20')]['fn']('COUNT',db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x24')))),_0xd80e('0x25')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db['sequelize']['literal'](_0xd80e('0x27')))),_0xd80e('0x28')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xd80e('0x29')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x2a'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x2b')))),_0xd80e('0x2c')],[db['sequelize']['fn']('AVG',db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x2d')))),_0xd80e('0x2e')]]})[_0xd80e('0xc')](function(_0x17b8c7){logger[_0xd80e('0xd')](_0xd80e('0x1c'),_0x57d70);logger[_0xd80e('0x2f')]('AvgHandleTime',_0x57d70,JSON[_0xd80e('0x11')](_0x17b8c7));_0x5b0d6d(_0x17b8c7);})['catch'](function(_0x22d371){logger[_0xd80e('0x12')](_0xd80e('0x1c'),_0x22d371[_0xd80e('0x14')],_0x57d70);_0x635ce0(_0x170109['error'](0x1f4,_0x22d371[_0xd80e('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3275fa){var _0x4f15a9=this;return new Promise(function(_0xfb551a,_0x3da220){return db['CmHopperHistory'][_0xd80e('0x1e')]({'raw':_0x3275fa[_0xd80e('0x19')]?_0x3275fa[_0xd80e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3275fa[_0xd80e('0x19')]?_0x3275fa[_0xd80e('0x19')][_0xd80e('0x1f')]||null:null,'attributes':[[_0xd80e('0x30'),_0xd80e('0x31')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db['sequelize']['fn']('IF',db[_0xd80e('0x20')]['literal'](_0xd80e('0x32')))),'outboundNoAnswerCallsDay'],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db['sequelize']['fn']('IF',db['sequelize'][_0xd80e('0x23')](_0xd80e('0x24')))),_0xd80e('0x33')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x34')))),_0xd80e('0x35')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x36')))),'outboundCongestionCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xd80e('0x20')]['fn']('IF',db['sequelize'][_0xd80e('0x23')](_0xd80e('0x37')))),_0xd80e('0x38')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd80e('0x39')],[db['sequelize']['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x3a')))),'outboundUnknownCallsDay'],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db['sequelize'][_0xd80e('0x23')](_0xd80e('0x3b')))),_0xd80e('0x3c')],[db['sequelize']['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')](_0xd80e('0x3d')))),_0xd80e('0x3e')],[db['sequelize']['fn']('COUNT',db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')][_0xd80e('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0xd80e('0x3f')],[db['sequelize']['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db['sequelize'][_0xd80e('0x23')](_0xd80e('0x40')))),_0xd80e('0x41')],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db[_0xd80e('0x20')]['literal'](_0xd80e('0x42')))),_0xd80e('0x43')]],'group':[_0xd80e('0x30')]})['then'](function(_0x52ab04){logger[_0xd80e('0xd')](_0xd80e('0x44'),_0x3275fa);logger[_0xd80e('0x2f')](_0xd80e('0x44'),_0x3275fa,JSON[_0xd80e('0x11')](_0x52ab04));_0xfb551a(_0x52ab04);})[_0xd80e('0x16')](function(_0x53b2b8){logger[_0xd80e('0x12')]('GetVoiceQueueHopperHistory',_0x53b2b8[_0xd80e('0x14')],_0x3275fa);_0x3da220(_0x4f15a9['error'](0x1f4,_0x53b2b8[_0xd80e('0x14')]));});});};exports[_0xd80e('0x45')]=function(_0x40a535){var _0xd4284d=this;return new Promise(function(_0x915fcf,_0x11a21a){return db['CmHopperHistory'][_0xd80e('0x1e')]({'raw':_0x40a535['options']?_0x40a535[_0xd80e('0x19')][_0xd80e('0x1a')]===undefined?!![]:![]:!![],'where':_0x40a535['options']?_0x40a535['options'][_0xd80e('0x1f')]||null:null,'attributes':[[_0xd80e('0x30'),_0xd80e('0x31')],[db['sequelize']['fn']('COUNT',db[_0xd80e('0x20')][_0xd80e('0x21')]('id')),'ivrTotalCallsDays'],[db[_0xd80e('0x20')]['fn'](_0xd80e('0x26'),db[_0xd80e('0x20')]['fn']('IF',db['sequelize'][_0xd80e('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xd80e('0x46')]],'group':[_0xd80e('0x30')]})[_0xd80e('0xc')](function(_0x29ce58){logger['info'](_0xd80e('0x45'),_0x40a535);logger['debug'](_0xd80e('0x45'),_0x40a535,JSON['stringify'](_0x29ce58));_0x915fcf(_0x29ce58);})[_0xd80e('0x16')](function(_0x321a22){logger[_0xd80e('0x12')](_0xd80e('0x45'),_0x321a22['message'],_0x40a535);_0x11a21a(_0xd4284d[_0xd80e('0x12')](0x1f4,_0x321a22[_0xd80e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 78ca252..2ec545a 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 _0xd57e=['isAuthenticated','index','describe','/:id','post','put','update','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x593ffc,_0x5613db){var _0x438cbb=function(_0x12488c){while(--_0x12488c){_0x593ffc['push'](_0x593ffc['shift']());}};_0x438cbb(++_0x5613db);}(_0xd57e,0xa1));var _0xed57=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0xd57e[_0x547ff4];return _0xe41057;};'use strict';var multer=require(_0xed57('0x0'));var util=require(_0xed57('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xed57('0x2'));var router=express[_0xed57('0x3')]();var auth=require(_0xed57('0x4'));var interaction=require(_0xed57('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0xed57('0x6')]('/',auth[_0xed57('0x7')](),controller[_0xed57('0x8')]);router['get']('/describe',auth[_0xed57('0x7')](),controller[_0xed57('0x9')]);router[_0xed57('0x6')](_0xed57('0xa'),auth[_0xed57('0x7')](),controller['show']);router[_0xed57('0xb')]('/',auth[_0xed57('0x7')](),controller['create']);router[_0xed57('0xc')](_0xed57('0xa'),auth[_0xed57('0x7')](),controller[_0xed57('0xd')]);module['exports']=router; \ No newline at end of file +var _0xe35c=['describe','show','post','create','put','/:id','update','multer','util','path','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe'];(function(_0x2f2cb8,_0x417d38){var _0x5a7add=function(_0xc1da1d){while(--_0xc1da1d){_0x2f2cb8['push'](_0x2f2cb8['shift']());}};_0x5a7add(++_0x417d38);}(_0xe35c,0x15b));var _0xce35=function(_0x1e0522,_0x2a41fa){_0x1e0522=_0x1e0522-0x0;var _0x2608cf=_0xe35c[_0x1e0522];return _0x2608cf;};'use strict';var multer=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var path=require(_0xce35('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xce35('0x3'));var interaction=require(_0xce35('0x4'));var config=require('../../config/environment');var controller=require(_0xce35('0x5'));router[_0xce35('0x6')]('/',auth[_0xce35('0x7')](),controller[_0xce35('0x8')]);router[_0xce35('0x6')](_0xce35('0x9'),auth['isAuthenticated'](),controller[_0xce35('0xa')]);router['get']('/:id',auth[_0xce35('0x7')](),controller[_0xce35('0xb')]);router[_0xce35('0xc')]('/',auth[_0xce35('0x7')](),controller[_0xce35('0xd')]);router[_0xce35('0xe')](_0xce35('0xf'),auth[_0xce35('0x7')](),controller[_0xce35('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index d90c5bf..5fe02c4 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 _0xcf9c=['STRING','name','sequelize','exports'];(function(_0x3d0965,_0x1fc3d9){var _0x4dc9a9=function(_0x599e1e){while(--_0x599e1e){_0x3d0965['push'](_0x3d0965['shift']());}};_0x4dc9a9(++_0x1fc3d9);}(_0xcf9c,0x1ca));var _0xccf9=function(_0x4ad329,_0x4c5eee){_0x4ad329=_0x4ad329-0x0;var _0xfe2bf2=_0xcf9c[_0x4ad329];return _0xfe2bf2;};'use strict';var Sequelize=require(_0xccf9('0x0'));module[_0xccf9('0x1')]={'name':{'type':Sequelize[_0xccf9('0x2')],'unique':_0xccf9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xccf9('0x2')]},'dialPrefix':{'type':Sequelize[_0xccf9('0x2')]}}; \ No newline at end of file +var _0x0485=['STRING','exports'];(function(_0x589a73,_0x2a1f7e){var _0x5b07d2=function(_0x19f301){while(--_0x19f301){_0x589a73['push'](_0x589a73['shift']());}};_0x5b07d2(++_0x2a1f7e);}(_0x0485,0x77));var _0x5048=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0485[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module[_0x5048('0x0')]={'name':{'type':Sequelize[_0x5048('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5048('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d1fa624..7ab9385 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 _0x78ca=['rows','catch','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','params','pick','ListId','removeDispositions','addContacts','tags','join','isArray','push','each','CmContact','omit','ids','success','dataValues','errors','message','getContacts','concat','cf_%d','order','raw','CmCustomField','CustomFields','writeFileSync','format','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','type','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','nolimit','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','CmList','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x26a827,_0x4d2e89){var _0x7096c9=function(_0x34f705){while(--_0x34f705){_0x26a827['push'](_0x26a827['shift']());}};_0x7096c9(++_0x4d2e89);}(_0x78ca,0xdf));var _0xa78c=function(_0xfe9ebe,_0x35951a){_0xfe9ebe=_0xfe9ebe-0x0;var _0x2b24ca=_0x78ca[_0xfe9ebe];return _0x2b24ca;};'use strict';var pdf=require(_0xa78c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa78c('0x1'));var jsonpatch=require(_0xa78c('0x2'));var rp=require(_0xa78c('0x3'));var moment=require(_0xa78c('0x4'));var BPromise=require(_0xa78c('0x5'));var Mustache=require(_0xa78c('0x6'));var util=require(_0xa78c('0x7'));var path=require(_0xa78c('0x8'));var sox=require(_0xa78c('0x9'));var csv=require(_0xa78c('0xa'));var ejs=require(_0xa78c('0xb'));var fs=require('fs');var _=require(_0xa78c('0xc'));var squel=require(_0xa78c('0xd'));var crypto=require('crypto');var jsforce=require(_0xa78c('0xe'));var deskjs=require(_0xa78c('0xf'));var toCsv=require(_0xa78c('0xa'));var querystring=require(_0xa78c('0x10'));var Papa=require(_0xa78c('0x11'));var Redis=require(_0xa78c('0x12'));var authService=require(_0xa78c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa78c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa78c('0x15'))(_0xa78c('0x16'));var utils=require('../../config/utils');var config=require(_0xa78c('0x17'));var db=require(_0xa78c('0x18'))['db'];config[_0xa78c('0x19')]=_[_0xa78c('0x1a')](config[_0xa78c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa78c('0x1b'))(new Redis(config[_0xa78c('0x19')]));require(_0xa78c('0x1c'))[_0xa78c('0x1d')](socket);function respondWithStatusCode(_0x49cf92,_0x463970){_0x463970=_0x463970||0xcc;return function(_0x39078a){if(_0x39078a){return _0x49cf92[_0xa78c('0x1e')](_0x463970);}return _0x49cf92[_0xa78c('0x1f')](_0x463970)[_0xa78c('0x20')]();};}function respondWithResult(_0x259fe9,_0x2650f9){_0x2650f9=_0x2650f9||0xc8;return function(_0x2099a6){if(_0x2099a6){return _0x259fe9[_0xa78c('0x1f')](_0x2650f9)[_0xa78c('0x21')](_0x2099a6);}};}function respondWithFilteredResult(_0x254cb2,_0x324cc5){return function(_0x4e6bf6){if(_0x4e6bf6){var _0x20c795=_0x4e6bf6[_0xa78c('0x22')],_0x44ca68=_0x324cc5[_0xa78c('0x23')],_0x237936=_0x324cc5[_0xa78c('0x23')]+_0x324cc5[_0xa78c('0x24')],_0x2bc5db;if(_0x237936>=_0x20c795){_0x237936=_0x20c795;_0x2bc5db=0xc8;}else{_0x2bc5db=0xce;}_0x254cb2['status'](_0x2bc5db);return _0x254cb2[_0xa78c('0x25')]('Content-Range',_0x44ca68+'-'+_0x237936+'/'+_0x20c795)[_0xa78c('0x21')](_0x4e6bf6);}return null;};}function patchUpdates(_0x3b200b){return function(_0x3b2569){try{jsonpatch[_0xa78c('0x26')](_0x3b2569,_0x3b200b,!![]);}catch(_0x396b2b){return BPromise['reject'](_0x396b2b);}return _0x3b2569[_0xa78c('0x27')]();};}function saveUpdates(_0x5c1d9c,_0x19d555){return function(_0x44ede9){if(_0x44ede9){return _0x44ede9[_0xa78c('0x28')](_0x5c1d9c)[_0xa78c('0x29')](function(_0x2885b4){return _0x2885b4;});}return null;};}function removeEntity(_0x5b8b62,_0x40fdb0){return function(_0x13fe78){if(_0x13fe78){return _0x13fe78[_0xa78c('0x2a')]()['then'](function(){var _0x3f5d68=_0x13fe78[_0xa78c('0x2b')]({'plain':!![]});var _0x378a75='Lists';return db[_0xa78c('0x2c')][_0xa78c('0x2a')]({'where':{'type':_0x378a75,'resourceId':_0x3f5d68['id']}})['then'](function(){return _0x13fe78;});})[_0xa78c('0x29')](function(){_0x5b8b62[_0xa78c('0x1f')](0xcc)[_0xa78c('0x20')]();});}};}function handleEntityNotFound(_0xed2f64,_0x5cad42){return function(_0x540a47){if(!_0x540a47){_0xed2f64[_0xa78c('0x1e')](0x194);}return _0x540a47;};}function handleError(_0x57261a,_0x25b9ac){_0x25b9ac=_0x25b9ac||0x1f4;return function(_0x2d4c7a){logger[_0xa78c('0x2d')](_0x2d4c7a['stack']);if(_0x2d4c7a[_0xa78c('0x2e')]){delete _0x2d4c7a['name'];}_0x57261a[_0xa78c('0x1f')](_0x25b9ac)[_0xa78c('0x2f')](_0x2d4c7a);};}exports[_0xa78c('0x30')]=function(_0x361f22,_0xab63ee){var _0x155ba9={},_0x5d08ee={},_0xefddd9={'count':0x0,'rows':[]};var _0x3b77bb=_['map'](db[_0xa78c('0x31')][_0xa78c('0x32')],function(_0x1340e9){return{'name':_0x1340e9[_0xa78c('0x33')],'type':_0x1340e9['type'][_0xa78c('0x34')]};});_0x5d08ee[_0xa78c('0x35')]=_[_0xa78c('0x36')](_0x3b77bb,_0xa78c('0x2e'));_0x5d08ee[_0xa78c('0x37')]=_[_0xa78c('0x38')](_0x361f22[_0xa78c('0x37')]);_0x5d08ee[_0xa78c('0x39')]=_[_0xa78c('0x3a')](_0x5d08ee['model'],_0x5d08ee[_0xa78c('0x37')]);_0x155ba9[_0xa78c('0x3b')]=_[_0xa78c('0x3a')](_0x5d08ee[_0xa78c('0x35')],qs[_0xa78c('0x3c')](_0x361f22['query'][_0xa78c('0x3c')]));_0x155ba9['attributes']=_0x155ba9[_0xa78c('0x3b')][_0xa78c('0x3d')]?_0x155ba9[_0xa78c('0x3b')]:_0x5d08ee[_0xa78c('0x35')];if(!_0x361f22[_0xa78c('0x37')][_0xa78c('0x3e')]('nolimit')){_0x155ba9[_0xa78c('0x24')]=qs[_0xa78c('0x24')](_0x361f22[_0xa78c('0x37')][_0xa78c('0x24')]);_0x155ba9[_0xa78c('0x23')]=qs[_0xa78c('0x23')](_0x361f22[_0xa78c('0x37')][_0xa78c('0x23')]);}_0x155ba9['order']=qs[_0xa78c('0x3f')](_0x361f22[_0xa78c('0x37')][_0xa78c('0x3f')]);_0x155ba9[_0xa78c('0x40')]=qs[_0xa78c('0x39')](_['pick'](_0x361f22['query'],_0x5d08ee['filters']));if(_0x361f22[_0xa78c('0x37')][_0xa78c('0x41')]){_0x155ba9['where']=_[_0xa78c('0x42')](_0x155ba9[_0xa78c('0x40')],{'$or':_[_0xa78c('0x36')](_0x3b77bb,function(_0x59e79f){if(_0x59e79f['type']!==_0xa78c('0x43')){var _0x29c486={};_0x29c486[_0x59e79f[_0xa78c('0x2e')]]={'$like':'%'+_0x361f22[_0xa78c('0x37')][_0xa78c('0x41')]+'%'};return _0x29c486;}})});}_0x155ba9=_[_0xa78c('0x42')]({},_0x155ba9,_0x361f22['options']);var _0x31a249={'where':_0x155ba9[_0xa78c('0x40')]};return db[_0xa78c('0x31')][_0xa78c('0x22')](_0x31a249)['then'](function(_0x27a016){_0xefddd9[_0xa78c('0x22')]=_0x27a016;if(_0x361f22[_0xa78c('0x37')][_0xa78c('0x44')]){_0x155ba9[_0xa78c('0x45')]=[{'all':!![]}];}return db['CmList'][_0xa78c('0x46')](_0x155ba9);})['then'](function(_0x55bfdf){_0xefddd9[_0xa78c('0x47')]=_0x55bfdf;return _0xefddd9;})[_0xa78c('0x29')](respondWithFilteredResult(_0xab63ee,_0x155ba9))[_0xa78c('0x48')](handleError(_0xab63ee,null));};exports['show']=function(_0x59ebe4,_0x39304c){var _0xf71e3b={'raw':![],'where':{'id':_0x59ebe4['params']['id']}},_0x1797c9={};_0x1797c9[_0xa78c('0x35')]=_[_0xa78c('0x38')](db[_0xa78c('0x31')]['rawAttributes']);_0x1797c9[_0xa78c('0x37')]=_['keys'](_0x59ebe4['query']);_0x1797c9[_0xa78c('0x39')]=_['intersection'](_0x1797c9[_0xa78c('0x35')],_0x1797c9[_0xa78c('0x37')]);_0xf71e3b['attributes']=_[_0xa78c('0x3a')](_0x1797c9['model'],qs[_0xa78c('0x3c')](_0x59ebe4['query'][_0xa78c('0x3c')]));_0xf71e3b['attributes']=_0xf71e3b[_0xa78c('0x3b')][_0xa78c('0x3d')]?_0xf71e3b[_0xa78c('0x3b')]:_0x1797c9[_0xa78c('0x35')];if(_0x59ebe4[_0xa78c('0x37')][_0xa78c('0x44')]){_0xf71e3b[_0xa78c('0x45')]=[{'all':!![]}];}_0xf71e3b=_[_0xa78c('0x42')]({},_0xf71e3b,_0x59ebe4[_0xa78c('0x49')]);return db[_0xa78c('0x31')][_0xa78c('0x4a')](_0xf71e3b)[_0xa78c('0x29')](handleEntityNotFound(_0x39304c,null))[_0xa78c('0x29')](respondWithResult(_0x39304c,null))[_0xa78c('0x48')](handleError(_0x39304c,null));};exports['create']=function(_0x3429c3,_0x5c0396){return db['CmList']['create'](_0x3429c3[_0xa78c('0x4b')],{})['then'](function(_0x40d39b){var _0x3f9658=_0x3429c3[_0xa78c('0x4c')][_0xa78c('0x2b')]({'plain':!![]});if(!_0x3f9658)throw new Error(_0xa78c('0x4d'));if(_0x3f9658[_0xa78c('0x4e')]==='user'){var _0x3a5306=_0x40d39b[_0xa78c('0x2b')]({'plain':!![]});var _0x44996=_0xa78c('0x4f');return db[_0xa78c('0x50')][_0xa78c('0x4a')]({'where':{'name':_0x44996,'userProfileId':_0x3f9658[_0xa78c('0x51')]},'raw':!![]})[_0xa78c('0x29')](function(_0x1f3334){if(_0x1f3334&&_0x1f3334[_0xa78c('0x52')]===0x0){return db[_0xa78c('0x2c')][_0xa78c('0x53')]({'name':_0x3a5306[_0xa78c('0x2e')],'resourceId':_0x3a5306['id'],'type':_0x1f3334[_0xa78c('0x2e')],'sectionId':_0x1f3334['id']},{})[_0xa78c('0x29')](function(){return _0x40d39b;});}else{return _0x40d39b;}})[_0xa78c('0x48')](function(_0x1622d0){logger[_0xa78c('0x2d')](_0xa78c('0x54'),_0x1622d0);throw _0x1622d0;});}return _0x40d39b;})[_0xa78c('0x29')](respondWithResult(_0x5c0396,0xc9))[_0xa78c('0x48')](handleError(_0x5c0396,null));};exports[_0xa78c('0x28')]=function(_0x294358,_0xe6c150){if(_0x294358['body']['id']){delete _0x294358['body']['id'];}return db[_0xa78c('0x31')][_0xa78c('0x4a')]({'where':{'id':_0x294358['params']['id']}})['then'](handleEntityNotFound(_0xe6c150,null))[_0xa78c('0x29')](saveUpdates(_0x294358['body'],null))[_0xa78c('0x29')](respondWithResult(_0xe6c150,null))[_0xa78c('0x48')](handleError(_0xe6c150,null));};exports[_0xa78c('0x2a')]=function(_0x50ecfb,_0x5ad4d0){return db[_0xa78c('0x31')]['find']({'where':{'id':_0x50ecfb['params']['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0x5ad4d0,null))[_0xa78c('0x29')](removeEntity(_0x5ad4d0,null))[_0xa78c('0x48')](handleError(_0x5ad4d0,null));};exports[_0xa78c('0x55')]=function(_0x3cda00,_0x22d4c3){return db[_0xa78c('0x31')][_0xa78c('0x55')]()[_0xa78c('0x29')](respondWithResult(_0x22d4c3,null))['catch'](handleError(_0x22d4c3,null));};exports[_0xa78c('0x56')]=function(_0x330841,_0x3b8013,_0x5a2490){if(_0x330841[_0xa78c('0x4b')]['id']){delete _0x330841[_0xa78c('0x4b')]['id'];}return db[_0xa78c('0x31')][_0xa78c('0x4a')]({'where':{'id':_0x330841['params']['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0x3b8013,null))['then'](function(_0x187ed0){if(_0x187ed0){_0x330841[_0xa78c('0x4b')]['ListId']=_0x187ed0['id'];return db[_0xa78c('0x57')][_0xa78c('0x53')](_0x330841[_0xa78c('0x4b')]);}})[_0xa78c('0x29')](respondWithResult(_0x3b8013,null))['catch'](handleError(_0x3b8013,null));};exports[_0xa78c('0x58')]=function(_0x78e09e,_0x1e17ba,_0x457501){var _0x19c15a={'raw':![],'where':{}};var _0x56a6fc={};var _0x2bf448={'count':0x0,'rows':[]};return db[_0xa78c('0x31')][_0xa78c('0x59')]({'where':{'id':_0x78e09e[_0xa78c('0x5a')]['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0x1e17ba,null))[_0xa78c('0x29')](function(_0x441d0f){if(_0x441d0f){_0x56a6fc[_0xa78c('0x35')]=_[_0xa78c('0x38')](db[_0xa78c('0x57')][_0xa78c('0x32')]);_0x56a6fc[_0xa78c('0x37')]=_[_0xa78c('0x38')](_0x78e09e['query']);_0x56a6fc[_0xa78c('0x39')]=_[_0xa78c('0x3a')](_0x56a6fc[_0xa78c('0x35')],_0x56a6fc['query']);_0x19c15a[_0xa78c('0x3b')]=_[_0xa78c('0x3a')](_0x56a6fc[_0xa78c('0x35')],qs[_0xa78c('0x3c')](_0x78e09e['query'][_0xa78c('0x3c')]));_0x19c15a[_0xa78c('0x3b')]=_0x19c15a['attributes']['length']?_0x19c15a[_0xa78c('0x3b')]:_0x56a6fc[_0xa78c('0x35')];if(!_0x78e09e[_0xa78c('0x37')]['hasOwnProperty']('nolimit')){_0x19c15a[_0xa78c('0x24')]=qs[_0xa78c('0x24')](_0x78e09e[_0xa78c('0x37')][_0xa78c('0x24')]);_0x19c15a[_0xa78c('0x23')]=qs['offset'](_0x78e09e['query'][_0xa78c('0x23')]);}_0x19c15a['order']=qs[_0xa78c('0x3f')](_0x78e09e[_0xa78c('0x37')][_0xa78c('0x3f')]);_0x19c15a[_0xa78c('0x40')]=qs[_0xa78c('0x39')](_[_0xa78c('0x5b')](_0x78e09e[_0xa78c('0x37')],_0x56a6fc[_0xa78c('0x39')]));_0x19c15a[_0xa78c('0x40')][_0xa78c('0x5c')]=_0x441d0f['id'];if(_0x78e09e[_0xa78c('0x37')][_0xa78c('0x41')]){_0x19c15a[_0xa78c('0x40')]=_[_0xa78c('0x42')](_0x19c15a[_0xa78c('0x40')],{'$or':_[_0xa78c('0x36')](_0x19c15a[_0xa78c('0x3b')],function(_0x510bfc){var _0x169bc6={};_0x169bc6[_0x510bfc]={'$like':'%'+_0x78e09e[_0xa78c('0x37')][_0xa78c('0x41')]+'%'};return _0x169bc6;})});}_0x19c15a=_[_0xa78c('0x42')]({},_0x19c15a,_0x78e09e[_0xa78c('0x49')]);return db[_0xa78c('0x57')]['count']({'where':_0x19c15a[_0xa78c('0x40')]})[_0xa78c('0x29')](function(_0x2f1184){_0x2bf448[_0xa78c('0x22')]=_0x2f1184;if(_0x78e09e[_0xa78c('0x37')]['includeAll']){_0x19c15a[_0xa78c('0x45')]=[{'all':!![]}];}return db[_0xa78c('0x57')][_0xa78c('0x46')](_0x19c15a);})['then'](function(_0x20d89e){_0x2bf448['rows']=_0x20d89e;return _0x2bf448;});}})[_0xa78c('0x29')](respondWithFilteredResult(_0x1e17ba,_0x19c15a))[_0xa78c('0x48')](handleError(_0x1e17ba,null));};exports[_0xa78c('0x5d')]=function(_0x4639b3,_0x26cb1e,_0x34d4a4){return db['CmList']['find']({'where':{'id':_0x4639b3[_0xa78c('0x5a')]['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0x26cb1e,null))[_0xa78c('0x29')](function(_0x4752ef){if(_0x4752ef){return _0x4752ef[_0xa78c('0x5d')](_0x4639b3[_0xa78c('0x37')]['ids']);}})[_0xa78c('0x29')](respondWithStatusCode(_0x26cb1e,null))['catch'](handleError(_0x26cb1e,null));};exports[_0xa78c('0x5e')]=function(_0x356d2b,_0x5cee60,_0x15a36a){return db['CmList'][_0xa78c('0x4a')]({'where':{'id':_0x356d2b[_0xa78c('0x5a')]['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0x5cee60,null))[_0xa78c('0x29')](function(_0x308e25){if(_0x308e25){var _0x19c913=[];var _0xa40962={'success':[],'errors':[]};return db['CmContact'][_0xa78c('0x55')]()['then'](function(_0x1945bc){if(_0x356d2b['body'][_0xa78c('0x5f')]&&_['isArray'](_0x356d2b['body']['tags'])){if(_0x356d2b['body'][_0xa78c('0x5f')][_0xa78c('0x3d')]){_0x356d2b[_0xa78c('0x4b')]['tags']=_0x356d2b[_0xa78c('0x4b')][_0xa78c('0x5f')][_0xa78c('0x60')](';')+';';}else{_0x356d2b[_0xa78c('0x4b')][_0xa78c('0x5f')]=null;}}else{_0x356d2b[_0xa78c('0x4b')][_0xa78c('0x5f')]=null;}if(_0x356d2b[_0xa78c('0x4b')]&&_[_0xa78c('0x61')](_0x356d2b['body'])){for(var _0x45ea1e=0x0;_0x45ea1e<_0x356d2b['body'][_0xa78c('0x3d')];_0x45ea1e+=0x1){_0x356d2b['body'][_0x45ea1e][_0xa78c('0x5c')]=_0x356d2b[_0xa78c('0x5a')]['id'];_0x19c913[_0xa78c('0x62')](_0x356d2b[_0xa78c('0x4b')][_0x45ea1e]);}return BPromise[_0xa78c('0x63')](_0x19c913,function(_0x1a58ee){return db[_0xa78c('0x64')]['create'](_[_0xa78c('0x65')](_0x1a58ee,[_0xa78c('0x66'),'id'])||{},{'fields':_[_0xa78c('0x38')](_0x1945bc),'raw':!![]})[_0xa78c('0x29')](function(_0x38312b){_0xa40962[_0xa78c('0x67')][_0xa78c('0x62')](_0x38312b[_0xa78c('0x68')]);})['catch'](function(_0x50743d){_0xa40962[_0xa78c('0x69')][_0xa78c('0x62')]({'data':_0x1a58ee,'error':_0x50743d[_0xa78c('0x6a')]});});})[_0xa78c('0x29')](function(_0x2d0ca2){return _0xa40962;})[_0xa78c('0x48')](function(_0x1db5f5){return _0x1db5f5;});}else{_0x5cee60['status'](0x190)[_0xa78c('0x21')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xa78c('0x29')](respondWithResult(_0x5cee60,null))[_0xa78c('0x48')](handleError(_0x5cee60,null));};exports[_0xa78c('0x6b')]=function(_0x130c79,_0x416d06,_0x420ec0){var _0x2d2ba1;return db[_0xa78c('0x31')][_0xa78c('0x4a')]({'where':{'id':_0x130c79[_0xa78c('0x5a')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xa78c('0x29')](handleEntityNotFound(_0x416d06,null))['then'](function(_0x3ffa6b){if(_0x3ffa6b){_0x2d2ba1=_0x3ffa6b;return db[_0xa78c('0x64')]['rawAttributes'];}})[_0xa78c('0x29')](function(_0x261076){if(_0x261076){var _0x59e74a={};var _0x3a7dc5={};_0x3a7dc5['model']=_[_0xa78c('0x6c')](_[_0xa78c('0x38')](_0x261076),_[_0xa78c('0x36')](_0x2d2ba1['CustomFields'],function(_0x2c5a7b){return util['format'](_0xa78c('0x6d'),_0x2c5a7b['id']);}));_0x3a7dc5['query']=_['keys'](_0x130c79[_0xa78c('0x37')]);_0x3a7dc5['filters']=_[_0xa78c('0x3a')](_0x3a7dc5['model'],_0x3a7dc5[_0xa78c('0x37')]);_0x59e74a[_0xa78c('0x3b')]=_[_0xa78c('0x3a')](_0x3a7dc5[_0xa78c('0x35')],qs['fields'](_0x130c79['query'][_0xa78c('0x3c')]));_0x59e74a['attributes']=_0x59e74a[_0xa78c('0x3b')][_0xa78c('0x3d')]?_0x59e74a['attributes']:_0x3a7dc5[_0xa78c('0x35')];if(!_0x130c79[_0xa78c('0x37')][_0xa78c('0x3e')]('nolimit')){_0x59e74a['limit']=qs[_0xa78c('0x24')](_0x130c79[_0xa78c('0x37')][_0xa78c('0x24')]);_0x59e74a[_0xa78c('0x23')]=qs[_0xa78c('0x23')](_0x130c79[_0xa78c('0x37')][_0xa78c('0x23')]);}_0x59e74a[_0xa78c('0x6e')]=qs[_0xa78c('0x3f')](_0x130c79[_0xa78c('0x37')][_0xa78c('0x3f')]);_0x59e74a[_0xa78c('0x40')]=qs[_0xa78c('0x39')](_['pick'](_0x130c79[_0xa78c('0x37')],_0x3a7dc5[_0xa78c('0x39')]));_0x59e74a[_0xa78c('0x6f')]=!![];if(_0x130c79['query'][_0xa78c('0x41')]){_0x59e74a[_0xa78c('0x40')]=_[_0xa78c('0x42')](_0x59e74a[_0xa78c('0x40')],{'$or':_['map'](_0x59e74a['attributes'],function(_0x4e1b85){var _0x1cc6cf={};_0x1cc6cf[_0x4e1b85]={'$like':'%'+_0x130c79[_0xa78c('0x37')][_0xa78c('0x41')]+'%'};return _0x1cc6cf;})});}_0x59e74a=_[_0xa78c('0x42')]({},_0x59e74a,_0x130c79[_0xa78c('0x49')]);return _0x2d2ba1[_0xa78c('0x6b')](_0x59e74a);}})['then'](respondWithResult(_0x416d06,null))[_0xa78c('0x48')](handleError(_0x416d06,null));};exports['getContactsCsv']=function(_0x190688,_0x3c250d,_0x1ab434){var _0x12e9f1;return db[_0xa78c('0x31')][_0xa78c('0x4a')]({'where':{'id':_0x190688[_0xa78c('0x5a')]['id']},'include':[{'model':db[_0xa78c('0x70')],'as':_0xa78c('0x71')}]})[_0xa78c('0x29')](handleEntityNotFound(_0x3c250d,null))[_0xa78c('0x29')](function(_0x35e577){if(_0x35e577){_0x12e9f1=_0x35e577;return db['CmContact'][_0xa78c('0x32')];}})['then'](function(_0x2faa15){if(_0x2faa15){var _0x22132c={};var _0x4c6fcd={};_0x4c6fcd['model']=_[_0xa78c('0x6c')](_[_0xa78c('0x38')](_0x2faa15),_[_0xa78c('0x36')](_0x12e9f1[_0xa78c('0x71')],function(_0x3b84b6){return util['format'](_0xa78c('0x6d'),_0x3b84b6['id']);}));_0x4c6fcd[_0xa78c('0x37')]=_[_0xa78c('0x38')](_0x190688[_0xa78c('0x37')]);_0x4c6fcd[_0xa78c('0x39')]=_[_0xa78c('0x3a')](_0x4c6fcd[_0xa78c('0x35')],_0x4c6fcd[_0xa78c('0x37')]);_0x22132c['attributes']=_[_0xa78c('0x3a')](_0x4c6fcd[_0xa78c('0x35')],qs['fields'](_0x190688[_0xa78c('0x37')][_0xa78c('0x3c')]));_0x22132c[_0xa78c('0x3b')]=_0x22132c[_0xa78c('0x3b')][_0xa78c('0x3d')]?_0x22132c[_0xa78c('0x3b')]:_0x4c6fcd[_0xa78c('0x35')];if(!_0x190688[_0xa78c('0x37')][_0xa78c('0x3e')]('nolimit')){_0x22132c['limit']=qs['limit'](_0x190688[_0xa78c('0x37')][_0xa78c('0x24')]);_0x22132c[_0xa78c('0x23')]=qs[_0xa78c('0x23')](_0x190688[_0xa78c('0x37')][_0xa78c('0x23')]);}_0x22132c[_0xa78c('0x6e')]=qs[_0xa78c('0x3f')](_0x190688[_0xa78c('0x37')][_0xa78c('0x3f')]);_0x22132c[_0xa78c('0x40')]=qs[_0xa78c('0x39')](_[_0xa78c('0x5b')](_0x190688[_0xa78c('0x37')],_0x4c6fcd[_0xa78c('0x39')]));_0x22132c['raw']=!![];if(_0x190688[_0xa78c('0x37')]['filter']){_0x22132c[_0xa78c('0x40')]=_['merge'](_0x22132c[_0xa78c('0x40')],{'$or':_[_0xa78c('0x36')](_0x22132c[_0xa78c('0x3b')],function(_0x3879c6){var _0x207f0a={};_0x207f0a[_0x3879c6]={'$like':'%'+_0x190688[_0xa78c('0x37')][_0xa78c('0x41')]+'%'};return _0x207f0a;})});}_0x22132c=_['merge']({},_0x22132c,_0x190688[_0xa78c('0x49')]);return _0x12e9f1['getContacts'](_0x22132c);}})[_0xa78c('0x29')](function(_0x8f3dee){if(!_['isEmpty'](_0x8f3dee)){var _0x23e5ff=toCsv(_0x8f3dee);var _0x5beb9a=Date['now']();fs[_0xa78c('0x72')](util[_0xa78c('0x73')](_0xa78c('0x74'),_0x12e9f1['id'],_0x5beb9a),_0x23e5ff);_0x3c250d['setHeader'](_0xa78c('0x75'),_0xa78c('0x76')+util[_0xa78c('0x73')](_0xa78c('0x77'),_0x12e9f1['id'],_0x5beb9a));_0x3c250d[_0xa78c('0x78')]('Content-type','text/csv');return _0x3c250d[_0xa78c('0x79')](util[_0xa78c('0x73')](_0xa78c('0x74'),_0x12e9f1['id'],_0x5beb9a));}else{return _0x3c250d['sendStatus'](0xcc);}})[_0xa78c('0x48')](handleError(_0x3c250d,null));};exports[_0xa78c('0x7a')]=function(_0x1623cc,_0x215bd6,_0x333eaf){var _0x1ea8ca;delete _0x1623cc[_0xa78c('0x4b')]['id'];return db['CmList'][_0xa78c('0x59')]({'where':{'id':_0x1623cc[_0xa78c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x215bd6,null))[_0xa78c('0x29')](function(_0x590bf9){if(_0x590bf9){return db[_0xa78c('0x7b')][_0xa78c('0x7c')](function(_0xff78af){return db['CmCustomField'][_0xa78c('0x53')](_0x1623cc[_0xa78c('0x4b')],{'transaction':_0xff78af})['then'](function(_0x5bc9d8){_0x1ea8ca=_0x5bc9d8;return _0x590bf9[_0xa78c('0x7d')](_0x5bc9d8,{'transaction':_0xff78af});})['then'](function(){var _0x895d58={'type':db['Sequelize'][_0xa78c('0x7e')],'transaction':_0xff78af};switch(_0x1623cc[_0xa78c('0x4b')][_0xa78c('0x7f')]){case _0xa78c('0x80'):_0x895d58['type']=db[_0xa78c('0x81')][_0xa78c('0x7e')];break;case _0xa78c('0x82'):_0x895d58[_0xa78c('0x7f')]=db['Sequelize'][_0xa78c('0x83')];break;case _0xa78c('0x84'):_0x895d58[_0xa78c('0x7f')]=db[_0xa78c('0x81')][_0xa78c('0x85')];_0x895d58[_0xa78c('0x86')]=![];break;default:}return db[_0xa78c('0x7b')][_0xa78c('0x87')][_0xa78c('0x88')]('cm_contacts',util[_0xa78c('0x73')]('cf_%s',_0x1ea8ca['id']),_0x895d58);})[_0xa78c('0x29')](function(){return _0x1ea8ca;});});}})['then'](respondWithResult(_0x215bd6,null))[_0xa78c('0x48')](handleError(_0x215bd6,null));};exports[_0xa78c('0x89')]=function(_0x1c16b8,_0xbbf5c4,_0x2195f7){var _0x4e87b1={};var _0x32c531={};var _0x933bde;var _0x34f038;return db[_0xa78c('0x31')][_0xa78c('0x59')]({'where':{'id':_0x1c16b8[_0xa78c('0x5a')]['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0xbbf5c4,null))['then'](function(_0x1b07c7){if(_0x1b07c7){_0x933bde=_0x1b07c7;_0x32c531['model']=_[_0xa78c('0x38')](db[_0xa78c('0x70')]['rawAttributes']);_0x32c531[_0xa78c('0x37')]=_['keys'](_0x1c16b8[_0xa78c('0x37')]);_0x32c531['filters']=_[_0xa78c('0x3a')](_0x32c531['model'],_0x32c531['query']);_0x4e87b1[_0xa78c('0x3b')]=_['intersection'](_0x32c531[_0xa78c('0x35')],qs['fields'](_0x1c16b8[_0xa78c('0x37')]['fields']));_0x4e87b1['attributes']=_0x4e87b1['attributes'][_0xa78c('0x3d')]?_0x4e87b1[_0xa78c('0x3b')]:_0x32c531['model'];_0x4e87b1['order']=qs['sort'](_0x1c16b8['query']['sort']);_0x4e87b1[_0xa78c('0x40')]=qs[_0xa78c('0x39')](_['pick'](_0x1c16b8[_0xa78c('0x37')],_0x32c531['filters']));_0x4e87b1[_0xa78c('0x40')]=_[_0xa78c('0x42')](_0x4e87b1[_0xa78c('0x40')],{'$or':[{'ListId':_0x1b07c7['id']},{'ListId':null}]});if(_0x1c16b8[_0xa78c('0x37')][_0xa78c('0x41')]){_0x4e87b1[_0xa78c('0x40')]=_[_0xa78c('0x42')](_0x4e87b1[_0xa78c('0x40')],{'$or':_[_0xa78c('0x36')](_0x4e87b1[_0xa78c('0x3b')],function(_0x47c6c8){var _0x45bd14={};_0x45bd14[_0x47c6c8]={'$like':'%'+_0x1c16b8[_0xa78c('0x37')][_0xa78c('0x41')]+'%'};return _0x45bd14;})});}_0x4e87b1=_['merge']({},_0x4e87b1,_0x1c16b8['options']);return db['CmCustomField']['findAndCountAll'](_0x4e87b1);}})[_0xa78c('0x29')](respondWithResult(_0xbbf5c4,null))[_0xa78c('0x48')](handleError(_0xbbf5c4,null));};exports[_0xa78c('0x8a')]=function(_0x7fdbdf,_0x42a996,_0x3a7ecb){return db['CmList'][_0xa78c('0x4a')]({'where':{'id':_0x7fdbdf[_0xa78c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x42a996,null))['then'](function(_0x191327){if(_0x191327){return _0x191327[_0xa78c('0x8a')](_0x7fdbdf[_0xa78c('0x4b')][_0xa78c('0x66')],_[_0xa78c('0x65')](_0x7fdbdf[_0xa78c('0x4b')],[_0xa78c('0x66'),'id'])||{})[_0xa78c('0x8b')](function(_0x2306b6){for(var _0x56e814=0x0;_0x56e814<_0x7fdbdf['body']['ids'][_0xa78c('0x3d')];_0x56e814+=0x1){socket[_0xa78c('0x8c')](_0xa78c('0x8d'),{'UserId':_0x7fdbdf[_0xa78c('0x4b')][_0xa78c('0x66')][_0x56e814],'CmListId':_0x7fdbdf[_0xa78c('0x5a')]['id']});}return _0x2306b6;});}})['then'](respondWithResult(_0x42a996,null))['catch'](handleError(_0x42a996,null));};exports[_0xa78c('0x8e')]=function(_0x3e475b,_0x41a552,_0x46e84e){return db['CmList']['find']({'where':{'id':_0x3e475b[_0xa78c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x41a552,null))['then'](function(_0x55d1fc){if(_0x55d1fc){return _0x55d1fc[_0xa78c('0x8e')](_0x3e475b[_0xa78c('0x37')][_0xa78c('0x66')])['then'](function(){if(_['isArray'](_0x3e475b[_0xa78c('0x37')][_0xa78c('0x66')])){for(var _0x309a54=0x0;_0x309a54<_0x3e475b[_0xa78c('0x37')]['ids'][_0xa78c('0x3d')];_0x309a54+=0x1){socket[_0xa78c('0x8c')](_0xa78c('0x8f'),{'UserId':Number(_0x3e475b[_0xa78c('0x37')][_0xa78c('0x66')][_0x309a54]),'CmListId':Number(_0x3e475b[_0xa78c('0x5a')]['id'])});}}else{socket[_0xa78c('0x8c')](_0xa78c('0x8f'),{'UserId':Number(_0x3e475b[_0xa78c('0x37')][_0xa78c('0x66')]),'CmListId':Number(_0x3e475b[_0xa78c('0x5a')]['id'])});}});}})[_0xa78c('0x29')](respondWithStatusCode(_0x41a552,null))['catch'](handleError(_0x41a552,null));};exports['getAgents']=function(_0x3c8c40,_0x1b3315,_0x45245a){var _0x3c9241={};var _0x4f4b95={};var _0x5b5d8c;var _0x3e836d;return db['CmList'][_0xa78c('0x59')]({'where':{'id':_0x3c8c40['params']['id']}})[_0xa78c('0x29')](handleEntityNotFound(_0x1b3315,null))[_0xa78c('0x29')](function(_0x2d068b){if(_0x2d068b){_0x5b5d8c=_0x2d068b;_0x4f4b95[_0xa78c('0x35')]=_[_0xa78c('0x38')](db[_0xa78c('0x90')]['rawAttributes']);_0x4f4b95['query']=_[_0xa78c('0x38')](_0x3c8c40[_0xa78c('0x37')]);_0x4f4b95[_0xa78c('0x39')]=_[_0xa78c('0x3a')](_0x4f4b95['model'],_0x4f4b95[_0xa78c('0x37')]);_0x3c9241[_0xa78c('0x3b')]=_[_0xa78c('0x3a')](_0x4f4b95['model'],qs[_0xa78c('0x3c')](_0x3c8c40[_0xa78c('0x37')][_0xa78c('0x3c')]));_0x3c9241['attributes']=_0x3c9241[_0xa78c('0x3b')][_0xa78c('0x3d')]?_0x3c9241[_0xa78c('0x3b')]:_0x4f4b95[_0xa78c('0x35')];_0x3c9241['order']=qs[_0xa78c('0x3f')](_0x3c8c40['query']['sort']);_0x3c9241[_0xa78c('0x40')]=qs[_0xa78c('0x39')](_['pick'](_0x3c8c40[_0xa78c('0x37')],_0x4f4b95[_0xa78c('0x39')]));if(_0x3c8c40[_0xa78c('0x37')][_0xa78c('0x41')]){_0x3c9241['where']=_[_0xa78c('0x42')](_0x3c9241[_0xa78c('0x40')],{'$or':_[_0xa78c('0x36')](_0x3c9241['attributes'],function(_0xc4348){var _0x29f8de={};_0x29f8de[_0xc4348]={'$like':'%'+_0x3c8c40[_0xa78c('0x37')][_0xa78c('0x41')]+'%'};return _0x29f8de;})});}_0x3c9241=_[_0xa78c('0x42')]({},_0x3c9241,_0x3c8c40['options']);return _0x5b5d8c[_0xa78c('0x91')](_0x3c9241);}})[_0xa78c('0x29')](function(_0x1216ec){if(_0x1216ec){_0x3e836d=_0x1216ec[_0xa78c('0x3d')];if(!_0x3c8c40[_0xa78c('0x37')]['hasOwnProperty'](_0xa78c('0x92'))){_0x3c9241[_0xa78c('0x24')]=qs[_0xa78c('0x24')](_0x3c8c40['query']['limit']);_0x3c9241[_0xa78c('0x23')]=qs['offset'](_0x3c8c40[_0xa78c('0x37')][_0xa78c('0x23')]);}return _0x5b5d8c[_0xa78c('0x91')](_0x3c9241);}})[_0xa78c('0x29')](function(_0x20497d){if(_0x20497d){return _0x20497d?{'count':_0x3e836d,'rows':_0x20497d}:null;}})['then'](respondWithResult(_0x1b3315,null))[_0xa78c('0x48')](handleError(_0x1b3315,null));}; \ No newline at end of file +var _0x6322=['addCustomField','sequelize','transaction','text','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','Lists','UserProfileResource','destroy','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','sort','removeDispositions','addContacts','CmContact','tags','isArray','join','push','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','isEmpty','now','writeFileSync','format','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','/tmp/list_%d_%s.csv'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x6322,0x1dc));var _0x2632=function(_0x1add7b,_0x420b84){_0x1add7b=_0x1add7b-0x0;var _0x45ef0a=_0x6322[_0x1add7b];return _0x45ef0a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2632('0x0'));var rimraf=require(_0x2632('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2632('0x2'));var rp=require(_0x2632('0x3'));var moment=require(_0x2632('0x4'));var BPromise=require(_0x2632('0x5'));var Mustache=require(_0x2632('0x6'));var util=require('util');var path=require(_0x2632('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2632('0x8'));var fs=require('fs');var _=require(_0x2632('0x9'));var squel=require('squel');var crypto=require(_0x2632('0xa'));var jsforce=require(_0x2632('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2632('0xc'));var Redis=require('ioredis');var authService=require(_0x2632('0xd'));var qs=require(_0x2632('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2632('0xf'));var logger=require(_0x2632('0x10'))(_0x2632('0x11'));var utils=require('../../config/utils');var config=require(_0x2632('0x12'));var db=require(_0x2632('0x13'))['db'];config[_0x2632('0x14')]=_[_0x2632('0x15')](config['redis'],{'host':_0x2632('0x16'),'port':0x18eb});var socket=require(_0x2632('0x17'))(new Redis(config[_0x2632('0x14')]));require(_0x2632('0x18'))[_0x2632('0x19')](socket);function respondWithStatusCode(_0x301077,_0x29a9a0){_0x29a9a0=_0x29a9a0||0xcc;return function(_0x526641){if(_0x526641){return _0x301077[_0x2632('0x1a')](_0x29a9a0);}return _0x301077[_0x2632('0x1b')](_0x29a9a0)[_0x2632('0x1c')]();};}function respondWithResult(_0x2414dc,_0xabe083){_0xabe083=_0xabe083||0xc8;return function(_0x2d372e){if(_0x2d372e){return _0x2414dc['status'](_0xabe083)['json'](_0x2d372e);}};}function respondWithFilteredResult(_0x39a10a,_0x26bec4){return function(_0x20bab7){if(_0x20bab7){var _0x14161a=_0x20bab7['count'],_0x1114ab=_0x26bec4[_0x2632('0x1d')],_0x26aaa2=_0x26bec4[_0x2632('0x1d')]+_0x26bec4[_0x2632('0x1e')],_0xd61c50;if(_0x26aaa2>=_0x14161a){_0x26aaa2=_0x14161a;_0xd61c50=0xc8;}else{_0xd61c50=0xce;}_0x39a10a[_0x2632('0x1b')](_0xd61c50);return _0x39a10a[_0x2632('0x1f')](_0x2632('0x20'),_0x1114ab+'-'+_0x26aaa2+'/'+_0x14161a)[_0x2632('0x21')](_0x20bab7);}return null;};}function patchUpdates(_0x34852e){return function(_0x56504e){try{jsonpatch[_0x2632('0x22')](_0x56504e,_0x34852e,!![]);}catch(_0xb661a6){return BPromise[_0x2632('0x23')](_0xb661a6);}return _0x56504e[_0x2632('0x24')]();};}function saveUpdates(_0x595a98,_0x5c019f){return function(_0x1b5862){if(_0x1b5862){return _0x1b5862[_0x2632('0x25')](_0x595a98)[_0x2632('0x26')](function(_0x374c65){return _0x374c65;});}return null;};}function removeEntity(_0x5c0a67,_0x31a15e){return function(_0x4a3074){if(_0x4a3074){return _0x4a3074['destroy']()[_0x2632('0x26')](function(){var _0x10352c=_0x4a3074['get']({'plain':!![]});var _0x3d153f=_0x2632('0x27');return db[_0x2632('0x28')][_0x2632('0x29')]({'where':{'type':_0x3d153f,'resourceId':_0x10352c['id']}})[_0x2632('0x26')](function(){return _0x4a3074;});})[_0x2632('0x26')](function(){_0x5c0a67[_0x2632('0x1b')](0xcc)[_0x2632('0x1c')]();});}};}function handleEntityNotFound(_0x650b05,_0x491674){return function(_0x550bc9){if(!_0x550bc9){_0x650b05['sendStatus'](0x194);}return _0x550bc9;};}function handleError(_0x33c513,_0x4c7cfd){_0x4c7cfd=_0x4c7cfd||0x1f4;return function(_0x3ed629){logger[_0x2632('0x2a')](_0x3ed629[_0x2632('0x2b')]);if(_0x3ed629[_0x2632('0x2c')]){delete _0x3ed629[_0x2632('0x2c')];}_0x33c513[_0x2632('0x1b')](_0x4c7cfd)[_0x2632('0x2d')](_0x3ed629);};}exports[_0x2632('0x2e')]=function(_0x573779,_0x250779){var _0x287449={},_0x134a10={},_0x31eeb5={'count':0x0,'rows':[]};var _0x5b332a=_[_0x2632('0x2f')](db[_0x2632('0x30')][_0x2632('0x31')],function(_0x5b1ab3){return{'name':_0x5b1ab3[_0x2632('0x32')],'type':_0x5b1ab3['type'][_0x2632('0x33')]};});_0x134a10['model']=_[_0x2632('0x2f')](_0x5b332a,_0x2632('0x2c'));_0x134a10['query']=_[_0x2632('0x34')](_0x573779[_0x2632('0x35')]);_0x134a10['filters']=_['intersection'](_0x134a10[_0x2632('0x36')],_0x134a10[_0x2632('0x35')]);_0x287449[_0x2632('0x37')]=_[_0x2632('0x38')](_0x134a10[_0x2632('0x36')],qs[_0x2632('0x39')](_0x573779[_0x2632('0x35')][_0x2632('0x39')]));_0x287449[_0x2632('0x37')]=_0x287449['attributes'][_0x2632('0x3a')]?_0x287449[_0x2632('0x37')]:_0x134a10[_0x2632('0x36')];if(!_0x573779[_0x2632('0x35')][_0x2632('0x3b')](_0x2632('0x3c'))){_0x287449['limit']=qs[_0x2632('0x1e')](_0x573779[_0x2632('0x35')][_0x2632('0x1e')]);_0x287449[_0x2632('0x1d')]=qs[_0x2632('0x1d')](_0x573779[_0x2632('0x35')][_0x2632('0x1d')]);}_0x287449[_0x2632('0x3d')]=qs['sort'](_0x573779['query']['sort']);_0x287449[_0x2632('0x3e')]=qs[_0x2632('0x3f')](_[_0x2632('0x40')](_0x573779[_0x2632('0x35')],_0x134a10['filters']));if(_0x573779[_0x2632('0x35')][_0x2632('0x41')]){_0x287449[_0x2632('0x3e')]=_[_0x2632('0x42')](_0x287449[_0x2632('0x3e')],{'$or':_[_0x2632('0x2f')](_0x5b332a,function(_0x488910){if(_0x488910[_0x2632('0x43')]!=='VIRTUAL'){var _0x23b44a={};_0x23b44a[_0x488910[_0x2632('0x2c')]]={'$like':'%'+_0x573779[_0x2632('0x35')][_0x2632('0x41')]+'%'};return _0x23b44a;}})});}_0x287449=_[_0x2632('0x42')]({},_0x287449,_0x573779['options']);var _0xe2e88b={'where':_0x287449[_0x2632('0x3e')]};return db[_0x2632('0x30')][_0x2632('0x44')](_0xe2e88b)[_0x2632('0x26')](function(_0x23fbb5){_0x31eeb5[_0x2632('0x44')]=_0x23fbb5;if(_0x573779['query'][_0x2632('0x45')]){_0x287449[_0x2632('0x46')]=[{'all':!![]}];}return db[_0x2632('0x30')][_0x2632('0x47')](_0x287449);})[_0x2632('0x26')](function(_0x406862){_0x31eeb5[_0x2632('0x48')]=_0x406862;return _0x31eeb5;})[_0x2632('0x26')](respondWithFilteredResult(_0x250779,_0x287449))[_0x2632('0x49')](handleError(_0x250779,null));};exports[_0x2632('0x4a')]=function(_0x4edc0a,_0x28434c){var _0x5a706b={'raw':![],'where':{'id':_0x4edc0a['params']['id']}},_0x12397c={};_0x12397c[_0x2632('0x36')]=_[_0x2632('0x34')](db[_0x2632('0x30')][_0x2632('0x31')]);_0x12397c[_0x2632('0x35')]=_[_0x2632('0x34')](_0x4edc0a[_0x2632('0x35')]);_0x12397c[_0x2632('0x3f')]=_[_0x2632('0x38')](_0x12397c[_0x2632('0x36')],_0x12397c[_0x2632('0x35')]);_0x5a706b[_0x2632('0x37')]=_[_0x2632('0x38')](_0x12397c['model'],qs[_0x2632('0x39')](_0x4edc0a[_0x2632('0x35')][_0x2632('0x39')]));_0x5a706b['attributes']=_0x5a706b[_0x2632('0x37')][_0x2632('0x3a')]?_0x5a706b[_0x2632('0x37')]:_0x12397c[_0x2632('0x36')];if(_0x4edc0a[_0x2632('0x35')][_0x2632('0x45')]){_0x5a706b[_0x2632('0x46')]=[{'all':!![]}];}_0x5a706b=_[_0x2632('0x42')]({},_0x5a706b,_0x4edc0a[_0x2632('0x4b')]);return db['CmList'][_0x2632('0x4c')](_0x5a706b)[_0x2632('0x26')](handleEntityNotFound(_0x28434c,null))[_0x2632('0x26')](respondWithResult(_0x28434c,null))[_0x2632('0x49')](handleError(_0x28434c,null));};exports[_0x2632('0x4d')]=function(_0x3b975a,_0x471b16){return db[_0x2632('0x30')][_0x2632('0x4d')](_0x3b975a[_0x2632('0x4e')],{})['then'](function(_0x2519a1){var _0x2d14bf=_0x3b975a[_0x2632('0x4f')]['get']({'plain':!![]});if(!_0x2d14bf)throw new Error(_0x2632('0x50'));if(_0x2d14bf[_0x2632('0x51')]===_0x2632('0x4f')){var _0x5ccd07=_0x2519a1[_0x2632('0x52')]({'plain':!![]});var _0x524eab=_0x2632('0x27');return db[_0x2632('0x53')][_0x2632('0x4c')]({'where':{'name':_0x524eab,'userProfileId':_0x2d14bf[_0x2632('0x54')]},'raw':!![]})[_0x2632('0x26')](function(_0x19fb12){if(_0x19fb12&&_0x19fb12[_0x2632('0x55')]===0x0){return db[_0x2632('0x28')][_0x2632('0x4d')]({'name':_0x5ccd07[_0x2632('0x2c')],'resourceId':_0x5ccd07['id'],'type':_0x19fb12[_0x2632('0x2c')],'sectionId':_0x19fb12['id']},{})[_0x2632('0x26')](function(){return _0x2519a1;});}else{return _0x2519a1;}})[_0x2632('0x49')](function(_0x531313){logger['error'](_0x2632('0x56'),_0x531313);throw _0x531313;});}return _0x2519a1;})[_0x2632('0x26')](respondWithResult(_0x471b16,0xc9))['catch'](handleError(_0x471b16,null));};exports[_0x2632('0x25')]=function(_0x57d2bc,_0x1f0605){if(_0x57d2bc[_0x2632('0x4e')]['id']){delete _0x57d2bc[_0x2632('0x4e')]['id'];}return db[_0x2632('0x30')]['find']({'where':{'id':_0x57d2bc['params']['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x1f0605,null))[_0x2632('0x26')](saveUpdates(_0x57d2bc[_0x2632('0x4e')],null))[_0x2632('0x26')](respondWithResult(_0x1f0605,null))[_0x2632('0x49')](handleError(_0x1f0605,null));};exports[_0x2632('0x29')]=function(_0x1ae256,_0x49c2fc){return db[_0x2632('0x30')]['find']({'where':{'id':_0x1ae256[_0x2632('0x57')]['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x49c2fc,null))[_0x2632('0x26')](removeEntity(_0x49c2fc,null))['catch'](handleError(_0x49c2fc,null));};exports[_0x2632('0x58')]=function(_0x46c200,_0x35c481){return db['CmList'][_0x2632('0x58')]()['then'](respondWithResult(_0x35c481,null))['catch'](handleError(_0x35c481,null));};exports[_0x2632('0x59')]=function(_0x3fde0f,_0xfbcf1,_0x3a39f5){if(_0x3fde0f[_0x2632('0x4e')]['id']){delete _0x3fde0f[_0x2632('0x4e')]['id'];}return db[_0x2632('0x30')][_0x2632('0x4c')]({'where':{'id':_0x3fde0f['params']['id']}})['then'](handleEntityNotFound(_0xfbcf1,null))['then'](function(_0x459eac){if(_0x459eac){_0x3fde0f[_0x2632('0x4e')][_0x2632('0x5a')]=_0x459eac['id'];return db[_0x2632('0x5b')][_0x2632('0x4d')](_0x3fde0f[_0x2632('0x4e')]);}})[_0x2632('0x26')](respondWithResult(_0xfbcf1,null))[_0x2632('0x49')](handleError(_0xfbcf1,null));};exports[_0x2632('0x5c')]=function(_0x37dc25,_0xf0d7a1,_0x47721e){var _0x41c879={'raw':![],'where':{}};var _0x5f1166={};var _0x117e79={'count':0x0,'rows':[]};return db[_0x2632('0x30')][_0x2632('0x5d')]({'where':{'id':_0x37dc25[_0x2632('0x57')]['id']}})[_0x2632('0x26')](handleEntityNotFound(_0xf0d7a1,null))[_0x2632('0x26')](function(_0x34749d){if(_0x34749d){_0x5f1166[_0x2632('0x36')]=_[_0x2632('0x34')](db[_0x2632('0x5b')]['rawAttributes']);_0x5f1166[_0x2632('0x35')]=_[_0x2632('0x34')](_0x37dc25[_0x2632('0x35')]);_0x5f1166[_0x2632('0x3f')]=_[_0x2632('0x38')](_0x5f1166[_0x2632('0x36')],_0x5f1166[_0x2632('0x35')]);_0x41c879['attributes']=_[_0x2632('0x38')](_0x5f1166[_0x2632('0x36')],qs[_0x2632('0x39')](_0x37dc25[_0x2632('0x35')][_0x2632('0x39')]));_0x41c879[_0x2632('0x37')]=_0x41c879[_0x2632('0x37')]['length']?_0x41c879[_0x2632('0x37')]:_0x5f1166[_0x2632('0x36')];if(!_0x37dc25[_0x2632('0x35')]['hasOwnProperty'](_0x2632('0x3c'))){_0x41c879[_0x2632('0x1e')]=qs[_0x2632('0x1e')](_0x37dc25[_0x2632('0x35')][_0x2632('0x1e')]);_0x41c879['offset']=qs['offset'](_0x37dc25['query'][_0x2632('0x1d')]);}_0x41c879[_0x2632('0x3d')]=qs['sort'](_0x37dc25[_0x2632('0x35')][_0x2632('0x5e')]);_0x41c879[_0x2632('0x3e')]=qs[_0x2632('0x3f')](_[_0x2632('0x40')](_0x37dc25[_0x2632('0x35')],_0x5f1166['filters']));_0x41c879['where'][_0x2632('0x5a')]=_0x34749d['id'];if(_0x37dc25['query']['filter']){_0x41c879[_0x2632('0x3e')]=_[_0x2632('0x42')](_0x41c879[_0x2632('0x3e')],{'$or':_[_0x2632('0x2f')](_0x41c879[_0x2632('0x37')],function(_0x204e3d){var _0x1de084={};_0x1de084[_0x204e3d]={'$like':'%'+_0x37dc25[_0x2632('0x35')]['filter']+'%'};return _0x1de084;})});}_0x41c879=_[_0x2632('0x42')]({},_0x41c879,_0x37dc25['options']);return db[_0x2632('0x5b')][_0x2632('0x44')]({'where':_0x41c879[_0x2632('0x3e')]})[_0x2632('0x26')](function(_0x5cd26d){_0x117e79[_0x2632('0x44')]=_0x5cd26d;if(_0x37dc25[_0x2632('0x35')][_0x2632('0x45')]){_0x41c879[_0x2632('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x2632('0x47')](_0x41c879);})[_0x2632('0x26')](function(_0x301c9a){_0x117e79[_0x2632('0x48')]=_0x301c9a;return _0x117e79;});}})[_0x2632('0x26')](respondWithFilteredResult(_0xf0d7a1,_0x41c879))[_0x2632('0x49')](handleError(_0xf0d7a1,null));};exports[_0x2632('0x5f')]=function(_0x179a01,_0x3e0c07,_0x3885fe){return db[_0x2632('0x30')][_0x2632('0x4c')]({'where':{'id':_0x179a01['params']['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x3e0c07,null))[_0x2632('0x26')](function(_0x1f25ef){if(_0x1f25ef){return _0x1f25ef[_0x2632('0x5f')](_0x179a01[_0x2632('0x35')]['ids']);}})[_0x2632('0x26')](respondWithStatusCode(_0x3e0c07,null))['catch'](handleError(_0x3e0c07,null));};exports[_0x2632('0x60')]=function(_0x324a4e,_0x3916fa,_0x4f0336){return db[_0x2632('0x30')][_0x2632('0x4c')]({'where':{'id':_0x324a4e['params']['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x3916fa,null))['then'](function(_0x3bd776){if(_0x3bd776){var _0x499de9=[];var _0x41ea85={'success':[],'errors':[]};return db[_0x2632('0x61')]['describe']()['then'](function(_0x132dbd){if(_0x324a4e['body'][_0x2632('0x62')]&&_[_0x2632('0x63')](_0x324a4e[_0x2632('0x4e')][_0x2632('0x62')])){if(_0x324a4e[_0x2632('0x4e')][_0x2632('0x62')][_0x2632('0x3a')]){_0x324a4e['body'][_0x2632('0x62')]=_0x324a4e[_0x2632('0x4e')]['tags'][_0x2632('0x64')](';')+';';}else{_0x324a4e[_0x2632('0x4e')][_0x2632('0x62')]=null;}}else{_0x324a4e[_0x2632('0x4e')][_0x2632('0x62')]=null;}if(_0x324a4e[_0x2632('0x4e')]&&_[_0x2632('0x63')](_0x324a4e[_0x2632('0x4e')])){for(var _0x4b24f2=0x0;_0x4b24f2<_0x324a4e[_0x2632('0x4e')][_0x2632('0x3a')];_0x4b24f2+=0x1){_0x324a4e[_0x2632('0x4e')][_0x4b24f2]['ListId']=_0x324a4e[_0x2632('0x57')]['id'];_0x499de9[_0x2632('0x65')](_0x324a4e[_0x2632('0x4e')][_0x4b24f2]);}return BPromise['each'](_0x499de9,function(_0x22e141){return db['CmContact'][_0x2632('0x4d')](_['omit'](_0x22e141,[_0x2632('0x66'),'id'])||{},{'fields':_['keys'](_0x132dbd),'raw':!![]})[_0x2632('0x26')](function(_0x5a5def){_0x41ea85[_0x2632('0x67')][_0x2632('0x65')](_0x5a5def[_0x2632('0x68')]);})[_0x2632('0x49')](function(_0x369be3){_0x41ea85['errors'][_0x2632('0x65')]({'data':_0x22e141,'error':_0x369be3[_0x2632('0x69')]});});})['then'](function(_0x4796dd){return _0x41ea85;})['catch'](function(_0x7114d6){return _0x7114d6;});}else{_0x3916fa[_0x2632('0x1b')](0x190)[_0x2632('0x21')]({'message':_0x2632('0x6a')});}});}})['then'](respondWithResult(_0x3916fa,null))[_0x2632('0x49')](handleError(_0x3916fa,null));};exports[_0x2632('0x6b')]=function(_0xff723b,_0x1d4961,_0x23d9a3){var _0x9a1d73;return db[_0x2632('0x30')][_0x2632('0x4c')]({'where':{'id':_0xff723b[_0x2632('0x57')]['id']},'include':[{'model':db[_0x2632('0x6c')],'as':_0x2632('0x6d')}]})[_0x2632('0x26')](handleEntityNotFound(_0x1d4961,null))[_0x2632('0x26')](function(_0x4021d0){if(_0x4021d0){_0x9a1d73=_0x4021d0;return db[_0x2632('0x61')][_0x2632('0x31')];}})[_0x2632('0x26')](function(_0x2808a1){if(_0x2808a1){var _0x2ade99={};var _0x541a23={};_0x541a23[_0x2632('0x36')]=_[_0x2632('0x6e')](_[_0x2632('0x34')](_0x2808a1),_[_0x2632('0x2f')](_0x9a1d73['CustomFields'],function(_0xe03d80){return util['format'](_0x2632('0x6f'),_0xe03d80['id']);}));_0x541a23[_0x2632('0x35')]=_['keys'](_0xff723b[_0x2632('0x35')]);_0x541a23[_0x2632('0x3f')]=_['intersection'](_0x541a23[_0x2632('0x36')],_0x541a23[_0x2632('0x35')]);_0x2ade99[_0x2632('0x37')]=_[_0x2632('0x38')](_0x541a23['model'],qs[_0x2632('0x39')](_0xff723b[_0x2632('0x35')]['fields']));_0x2ade99[_0x2632('0x37')]=_0x2ade99[_0x2632('0x37')]['length']?_0x2ade99[_0x2632('0x37')]:_0x541a23[_0x2632('0x36')];if(!_0xff723b['query'][_0x2632('0x3b')](_0x2632('0x3c'))){_0x2ade99['limit']=qs[_0x2632('0x1e')](_0xff723b['query'][_0x2632('0x1e')]);_0x2ade99[_0x2632('0x1d')]=qs[_0x2632('0x1d')](_0xff723b[_0x2632('0x35')]['offset']);}_0x2ade99[_0x2632('0x3d')]=qs[_0x2632('0x5e')](_0xff723b['query']['sort']);_0x2ade99[_0x2632('0x3e')]=qs[_0x2632('0x3f')](_[_0x2632('0x40')](_0xff723b[_0x2632('0x35')],_0x541a23[_0x2632('0x3f')]));_0x2ade99['raw']=!![];if(_0xff723b[_0x2632('0x35')][_0x2632('0x41')]){_0x2ade99[_0x2632('0x3e')]=_[_0x2632('0x42')](_0x2ade99[_0x2632('0x3e')],{'$or':_[_0x2632('0x2f')](_0x2ade99['attributes'],function(_0x37f4ae){var _0x540486={};_0x540486[_0x37f4ae]={'$like':'%'+_0xff723b[_0x2632('0x35')]['filter']+'%'};return _0x540486;})});}_0x2ade99=_[_0x2632('0x42')]({},_0x2ade99,_0xff723b[_0x2632('0x4b')]);return _0x9a1d73[_0x2632('0x6b')](_0x2ade99);}})['then'](respondWithResult(_0x1d4961,null))[_0x2632('0x49')](handleError(_0x1d4961,null));};exports['getContactsCsv']=function(_0x55c022,_0x7d9a40,_0x53aa54){var _0x34871f;return db['CmList'][_0x2632('0x4c')]({'where':{'id':_0x55c022[_0x2632('0x57')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x2632('0x26')](handleEntityNotFound(_0x7d9a40,null))[_0x2632('0x26')](function(_0x3d3dfd){if(_0x3d3dfd){_0x34871f=_0x3d3dfd;return db[_0x2632('0x61')][_0x2632('0x31')];}})[_0x2632('0x26')](function(_0x1cd4cc){if(_0x1cd4cc){var _0x54d70e={};var _0x39157a={};_0x39157a[_0x2632('0x36')]=_[_0x2632('0x6e')](_[_0x2632('0x34')](_0x1cd4cc),_[_0x2632('0x2f')](_0x34871f[_0x2632('0x6d')],function(_0x7ddf43){return util['format'](_0x2632('0x6f'),_0x7ddf43['id']);}));_0x39157a[_0x2632('0x35')]=_['keys'](_0x55c022['query']);_0x39157a[_0x2632('0x3f')]=_[_0x2632('0x38')](_0x39157a[_0x2632('0x36')],_0x39157a[_0x2632('0x35')]);_0x54d70e[_0x2632('0x37')]=_[_0x2632('0x38')](_0x39157a['model'],qs[_0x2632('0x39')](_0x55c022['query']['fields']));_0x54d70e[_0x2632('0x37')]=_0x54d70e[_0x2632('0x37')]['length']?_0x54d70e[_0x2632('0x37')]:_0x39157a[_0x2632('0x36')];if(!_0x55c022['query'][_0x2632('0x3b')]('nolimit')){_0x54d70e['limit']=qs[_0x2632('0x1e')](_0x55c022[_0x2632('0x35')][_0x2632('0x1e')]);_0x54d70e['offset']=qs['offset'](_0x55c022[_0x2632('0x35')]['offset']);}_0x54d70e['order']=qs[_0x2632('0x5e')](_0x55c022['query']['sort']);_0x54d70e[_0x2632('0x3e')]=qs[_0x2632('0x3f')](_['pick'](_0x55c022['query'],_0x39157a[_0x2632('0x3f')]));_0x54d70e[_0x2632('0x70')]=!![];if(_0x55c022['query'][_0x2632('0x41')]){_0x54d70e[_0x2632('0x3e')]=_[_0x2632('0x42')](_0x54d70e[_0x2632('0x3e')],{'$or':_[_0x2632('0x2f')](_0x54d70e[_0x2632('0x37')],function(_0x5e7963){var _0x504d6={};_0x504d6[_0x5e7963]={'$like':'%'+_0x55c022[_0x2632('0x35')][_0x2632('0x41')]+'%'};return _0x504d6;})});}_0x54d70e=_[_0x2632('0x42')]({},_0x54d70e,_0x55c022[_0x2632('0x4b')]);return _0x34871f[_0x2632('0x6b')](_0x54d70e);}})[_0x2632('0x26')](function(_0x3b8551){if(!_[_0x2632('0x71')](_0x3b8551)){var _0x14068d=toCsv(_0x3b8551);var _0x42e360=Date[_0x2632('0x72')]();fs[_0x2632('0x73')](util[_0x2632('0x74')]('/tmp/list_%d_%s.csv',_0x34871f['id'],_0x42e360),_0x14068d);_0x7d9a40['setHeader'](_0x2632('0x75'),_0x2632('0x76')+util['format'](_0x2632('0x77'),_0x34871f['id'],_0x42e360));_0x7d9a40[_0x2632('0x78')](_0x2632('0x79'),_0x2632('0x7a'));return _0x7d9a40['download'](util[_0x2632('0x74')](_0x2632('0x7b'),_0x34871f['id'],_0x42e360));}else{return _0x7d9a40['sendStatus'](0xcc);}})[_0x2632('0x49')](handleError(_0x7d9a40,null));};exports[_0x2632('0x7c')]=function(_0x3231b9,_0x47278e,_0x27cfa7){var _0x4f6aec;delete _0x3231b9[_0x2632('0x4e')]['id'];return db['CmList']['findOne']({'where':{'id':_0x3231b9[_0x2632('0x57')]['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x47278e,null))[_0x2632('0x26')](function(_0x2be52c){if(_0x2be52c){return db[_0x2632('0x7d')][_0x2632('0x7e')](function(_0x2c0e03){return db['CmCustomField'][_0x2632('0x4d')](_0x3231b9[_0x2632('0x4e')],{'transaction':_0x2c0e03})[_0x2632('0x26')](function(_0x1d5ace){_0x4f6aec=_0x1d5ace;return _0x2be52c['addCustomFields'](_0x1d5ace,{'transaction':_0x2c0e03});})['then'](function(){var _0x3e19e1={'type':db['Sequelize']['TEXT'],'transaction':_0x2c0e03};switch(_0x3231b9[_0x2632('0x4e')]['type']){case _0x2632('0x7f'):_0x3e19e1[_0x2632('0x43')]=db[_0x2632('0x80')][_0x2632('0x81')];break;case _0x2632('0x82'):_0x3e19e1['type']=db[_0x2632('0x80')][_0x2632('0x83')];break;case _0x2632('0x84'):_0x3e19e1['type']=db[_0x2632('0x80')][_0x2632('0x85')];_0x3e19e1[_0x2632('0x86')]=![];break;default:}return db[_0x2632('0x7d')][_0x2632('0x87')][_0x2632('0x88')](_0x2632('0x89'),util['format'](_0x2632('0x8a'),_0x4f6aec['id']),_0x3e19e1);})['then'](function(){return _0x4f6aec;});});}})[_0x2632('0x26')](respondWithResult(_0x47278e,null))[_0x2632('0x49')](handleError(_0x47278e,null));};exports[_0x2632('0x8b')]=function(_0x1b3c58,_0x350d36,_0x49958c){var _0x116fa6={};var _0x36e6a8={};var _0x22446c;var _0x5a37a5;return db['CmList'][_0x2632('0x5d')]({'where':{'id':_0x1b3c58['params']['id']}})['then'](handleEntityNotFound(_0x350d36,null))[_0x2632('0x26')](function(_0x326708){if(_0x326708){_0x22446c=_0x326708;_0x36e6a8['model']=_[_0x2632('0x34')](db[_0x2632('0x6c')][_0x2632('0x31')]);_0x36e6a8[_0x2632('0x35')]=_[_0x2632('0x34')](_0x1b3c58['query']);_0x36e6a8[_0x2632('0x3f')]=_[_0x2632('0x38')](_0x36e6a8[_0x2632('0x36')],_0x36e6a8['query']);_0x116fa6[_0x2632('0x37')]=_['intersection'](_0x36e6a8['model'],qs[_0x2632('0x39')](_0x1b3c58[_0x2632('0x35')][_0x2632('0x39')]));_0x116fa6[_0x2632('0x37')]=_0x116fa6['attributes'][_0x2632('0x3a')]?_0x116fa6[_0x2632('0x37')]:_0x36e6a8[_0x2632('0x36')];_0x116fa6[_0x2632('0x3d')]=qs['sort'](_0x1b3c58[_0x2632('0x35')]['sort']);_0x116fa6[_0x2632('0x3e')]=qs[_0x2632('0x3f')](_[_0x2632('0x40')](_0x1b3c58['query'],_0x36e6a8[_0x2632('0x3f')]));_0x116fa6['where']=_[_0x2632('0x42')](_0x116fa6[_0x2632('0x3e')],{'$or':[{'ListId':_0x326708['id']},{'ListId':null}]});if(_0x1b3c58[_0x2632('0x35')]['filter']){_0x116fa6['where']=_[_0x2632('0x42')](_0x116fa6[_0x2632('0x3e')],{'$or':_[_0x2632('0x2f')](_0x116fa6[_0x2632('0x37')],function(_0x1525bd){var _0x1f83f7={};_0x1f83f7[_0x1525bd]={'$like':'%'+_0x1b3c58[_0x2632('0x35')][_0x2632('0x41')]+'%'};return _0x1f83f7;})});}_0x116fa6=_[_0x2632('0x42')]({},_0x116fa6,_0x1b3c58['options']);return db[_0x2632('0x6c')][_0x2632('0x8c')](_0x116fa6);}})[_0x2632('0x26')](respondWithResult(_0x350d36,null))['catch'](handleError(_0x350d36,null));};exports['addAgents']=function(_0x2b6c5b,_0x29d2cd,_0x21ca6a){return db[_0x2632('0x30')]['find']({'where':{'id':_0x2b6c5b[_0x2632('0x57')]['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x29d2cd,null))[_0x2632('0x26')](function(_0x303840){if(_0x303840){return _0x303840[_0x2632('0x8d')](_0x2b6c5b[_0x2632('0x4e')][_0x2632('0x66')],_[_0x2632('0x8e')](_0x2b6c5b['body'],[_0x2632('0x66'),'id'])||{})[_0x2632('0x8f')](function(_0x4a6f79){for(var _0x218757=0x0;_0x218757<_0x2b6c5b[_0x2632('0x4e')][_0x2632('0x66')]['length'];_0x218757+=0x1){socket[_0x2632('0x90')](_0x2632('0x91'),{'UserId':_0x2b6c5b[_0x2632('0x4e')][_0x2632('0x66')][_0x218757],'CmListId':_0x2b6c5b['params']['id']});}return _0x4a6f79;});}})[_0x2632('0x26')](respondWithResult(_0x29d2cd,null))[_0x2632('0x49')](handleError(_0x29d2cd,null));};exports[_0x2632('0x92')]=function(_0x5399c1,_0x31565e,_0x4cc7b1){return db[_0x2632('0x30')]['find']({'where':{'id':_0x5399c1[_0x2632('0x57')]['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x31565e,null))[_0x2632('0x26')](function(_0x2e595e){if(_0x2e595e){return _0x2e595e['removeAgents'](_0x5399c1[_0x2632('0x35')][_0x2632('0x66')])[_0x2632('0x26')](function(){if(_[_0x2632('0x63')](_0x5399c1[_0x2632('0x35')][_0x2632('0x66')])){for(var _0x3ea06f=0x0;_0x3ea06f<_0x5399c1[_0x2632('0x35')][_0x2632('0x66')]['length'];_0x3ea06f+=0x1){socket[_0x2632('0x90')](_0x2632('0x93'),{'UserId':Number(_0x5399c1[_0x2632('0x35')][_0x2632('0x66')][_0x3ea06f]),'CmListId':Number(_0x5399c1[_0x2632('0x57')]['id'])});}}else{socket[_0x2632('0x90')]('userCmList:remove',{'UserId':Number(_0x5399c1['query'][_0x2632('0x66')]),'CmListId':Number(_0x5399c1['params']['id'])});}});}})[_0x2632('0x26')](respondWithStatusCode(_0x31565e,null))[_0x2632('0x49')](handleError(_0x31565e,null));};exports['getAgents']=function(_0x3e22fb,_0x4b8b78,_0x3fbf7f){var _0x4c107d={};var _0x32df43={};var _0x3f74f6;var _0x4ca1f0;return db[_0x2632('0x30')][_0x2632('0x5d')]({'where':{'id':_0x3e22fb[_0x2632('0x57')]['id']}})[_0x2632('0x26')](handleEntityNotFound(_0x4b8b78,null))[_0x2632('0x26')](function(_0x4c9fc0){if(_0x4c9fc0){_0x3f74f6=_0x4c9fc0;_0x32df43[_0x2632('0x36')]=_[_0x2632('0x34')](db[_0x2632('0x94')][_0x2632('0x31')]);_0x32df43['query']=_['keys'](_0x3e22fb[_0x2632('0x35')]);_0x32df43[_0x2632('0x3f')]=_[_0x2632('0x38')](_0x32df43[_0x2632('0x36')],_0x32df43['query']);_0x4c107d['attributes']=_[_0x2632('0x38')](_0x32df43[_0x2632('0x36')],qs[_0x2632('0x39')](_0x3e22fb[_0x2632('0x35')]['fields']));_0x4c107d['attributes']=_0x4c107d['attributes'][_0x2632('0x3a')]?_0x4c107d[_0x2632('0x37')]:_0x32df43[_0x2632('0x36')];_0x4c107d[_0x2632('0x3d')]=qs[_0x2632('0x5e')](_0x3e22fb[_0x2632('0x35')][_0x2632('0x5e')]);_0x4c107d['where']=qs[_0x2632('0x3f')](_[_0x2632('0x40')](_0x3e22fb['query'],_0x32df43[_0x2632('0x3f')]));if(_0x3e22fb['query'][_0x2632('0x41')]){_0x4c107d[_0x2632('0x3e')]=_[_0x2632('0x42')](_0x4c107d[_0x2632('0x3e')],{'$or':_[_0x2632('0x2f')](_0x4c107d[_0x2632('0x37')],function(_0x58f8b7){var _0x3889f9={};_0x3889f9[_0x58f8b7]={'$like':'%'+_0x3e22fb[_0x2632('0x35')][_0x2632('0x41')]+'%'};return _0x3889f9;})});}_0x4c107d=_[_0x2632('0x42')]({},_0x4c107d,_0x3e22fb[_0x2632('0x4b')]);return _0x3f74f6[_0x2632('0x95')](_0x4c107d);}})[_0x2632('0x26')](function(_0x51ccc5){if(_0x51ccc5){_0x4ca1f0=_0x51ccc5['length'];if(!_0x3e22fb[_0x2632('0x35')][_0x2632('0x3b')](_0x2632('0x3c'))){_0x4c107d[_0x2632('0x1e')]=qs[_0x2632('0x1e')](_0x3e22fb['query']['limit']);_0x4c107d[_0x2632('0x1d')]=qs[_0x2632('0x1d')](_0x3e22fb[_0x2632('0x35')][_0x2632('0x1d')]);}return _0x3f74f6['getAgents'](_0x4c107d);}})['then'](function(_0xebe415){if(_0xebe415){return _0xebe415?{'count':_0x4ca1f0,'rows':_0xebe415}:null;}})[_0x2632('0x26')](respondWithResult(_0x4b8b78,null))['catch'](handleError(_0x4b8b78,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3dd64df..aa417dd 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 _0x4514=['setMaxListeners','update','remove','emit','hook','exports','CmList'];(function(_0x349947,_0x4726a6){var _0x43e18a=function(_0x345c2b){while(--_0x345c2b){_0x349947['push'](_0x349947['shift']());}};_0x43e18a(++_0x4726a6);}(_0x4514,0x92));var _0x4451=function(_0x400a94,_0x31b06f){_0x400a94=_0x400a94-0x0;var _0x17739a=_0x4514[_0x400a94];return _0x17739a;};'use strict';var EventEmitter=require('events');var CmList=require('../../mysqldb')['db'][_0x4451('0x0')];var CmListEvents=new EventEmitter();CmListEvents[_0x4451('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4451('0x2'),'afterDestroy':_0x4451('0x3')};function emitEvent(_0xfa006f){return function(_0xc36af0,_0x34cc91,_0x13e602){CmListEvents[_0x4451('0x4')](_0xfa006f+':'+_0xc36af0['id'],_0xc36af0);CmListEvents[_0x4451('0x4')](_0xfa006f,_0xc36af0);_0x13e602(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x4451('0x5')](e,emitEvent(event));}}module[_0x4451('0x6')]=CmListEvents; \ No newline at end of file +var _0x7587=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x136148,_0x43721a){var _0x42b5be=function(_0x261621){while(--_0x261621){_0x136148['push'](_0x136148['shift']());}};_0x42b5be(++_0x43721a);}(_0x7587,0x65));var _0x7758=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x7587[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require(_0x7758('0x0'));var CmList=require(_0x7758('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x7758('0x2')](0x0);var events={'afterCreate':_0x7758('0x3'),'afterUpdate':_0x7758('0x4'),'afterDestroy':_0x7758('0x5')};function emitEvent(_0x42f346){return function(_0x1e068a,_0x3f75cb,_0x515168){CmListEvents[_0x7758('0x6')](_0x42f346+':'+_0x1e068a['id'],_0x1e068a);CmListEvents[_0x7758('0x6')](_0x42f346,_0x1e068a);_0x515168(null);};}for(var e in events){if(events[_0x7758('0x7')](e)){var event=events[e];CmList[_0x7758('0x8')](e,emitEvent(event));}}module[_0x7758('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 069e89a..9ef1c6d 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 _0x9c78=['moment','path','rimraf','exports','CmList','cm_lists','lodash','api'];(function(_0x250e49,_0x80ddb0){var _0x19b0ff=function(_0x212fe9){while(--_0x212fe9){_0x250e49['push'](_0x250e49['shift']());}};_0x19b0ff(++_0x80ddb0);}(_0x9c78,0xd6));var _0x89c7=function(_0x3ec418,_0xbbeb18){_0x3ec418=_0x3ec418-0x0;var _0x53cc9a=_0x9c78[_0x3ec418];return _0x53cc9a;};'use strict';var _=require(_0x89c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x89c7('0x1'));var moment=require(_0x89c7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x89c7('0x3'));var rimraf=require(_0x89c7('0x4'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0x89c7('0x5')]=function(_0x211338,_0x3e8289){return _0x211338['define'](_0x89c7('0x6'),attributes,{'tableName':_0x89c7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x972f=['moment','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','../../config/logger','api'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0x972f,0x1d0));var _0xf972=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x972f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf972('0x0'));var util=require(_0xf972('0x1'));var logger=require(_0xf972('0x2'))(_0xf972('0x3'));var moment=require(_0xf972('0x4'));var BPromise=require('bluebird');var rp=require(_0xf972('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf972('0x6'));var config=require(_0xf972('0x7'));var attributes=require(_0xf972('0x8'));module[_0xf972('0x9')]=function(_0x7e535b,_0x52a4ff){return _0x7e535b[_0xf972('0xa')](_0xf972('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4b69ca7..d542289 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 _0xa378=['then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa378,0x15b));var _0x8a37=function(_0x18072a,_0x1c157b){_0x18072a=_0x18072a-0x0;var _0x524174=_0xa378[_0x18072a];return _0x524174;};'use strict';var _=require(_0x8a37('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a37('0x1'));var rs=require(_0x8a37('0x2'));var fs=require('fs');var Redis=require(_0x8a37('0x3'));var db=require(_0x8a37('0x4'))['db'];var utils=require(_0x8a37('0x5'));var logger=require(_0x8a37('0x6'))(_0x8a37('0x7'));var config=require(_0x8a37('0x8'));var jayson=require(_0x8a37('0x9'));var client=jayson[_0x8a37('0xa')]['http']({'port':0x232a});config[_0x8a37('0xb')]=_[_0x8a37('0xc')](config[_0x8a37('0xb')],{'host':_0x8a37('0xd'),'port':0x18eb});var socket=require(_0x8a37('0xe'))(new Redis(config[_0x8a37('0xb')]));require(_0x8a37('0xf'))[_0x8a37('0x10')](socket);function respondWithRpcPromise(_0x4ffc37,_0x431478,_0x530204){return new BPromise(function(_0xd056eb,_0x4554f7){return client['request'](_0x4ffc37,_0x530204)[_0x8a37('0x11')](function(_0x1fb6e8){logger['info'](_0x8a37('0x12'),_0x431478,_0x8a37('0x13'));logger[_0x8a37('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x431478,_0x8a37('0x13'),JSON[_0x8a37('0x15')](_0x1fb6e8));if(_0x1fb6e8['error']){if(_0x1fb6e8[_0x8a37('0x16')]['code']===0x1f4){logger[_0x8a37('0x16')](_0x8a37('0x12'),_0x431478,_0x1fb6e8[_0x8a37('0x16')][_0x8a37('0x17')]);return _0x4554f7(_0x1fb6e8[_0x8a37('0x16')]['message']);}logger['error'](_0x8a37('0x12'),_0x431478,_0x1fb6e8[_0x8a37('0x16')]['message']);return _0xd056eb(_0x1fb6e8[_0x8a37('0x16')][_0x8a37('0x17')]);}else{logger[_0x8a37('0x18')]('CmList,\x20%s,\x20%s',_0x431478,'request\x20sent');_0xd056eb(_0x1fb6e8['result']['message']);}})[_0x8a37('0x19')](function(_0x32f0d5){logger[_0x8a37('0x16')](_0x8a37('0x12'),_0x431478,_0x32f0d5);_0x4554f7(_0x32f0d5);});});} \ No newline at end of file +var _0x0aaa=['rpc','../../config/environment','redis','defaults','localhost','./cmList.socket','register','request','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x0aaa,0xae));var _0xa0aa=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x0aaa[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xa0aa('0x0'));var util=require(_0xa0aa('0x1'));var moment=require(_0xa0aa('0x2'));var BPromise=require(_0xa0aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0aa('0x4'));var db=require(_0xa0aa('0x5'))['db'];var utils=require(_0xa0aa('0x6'));var logger=require(_0xa0aa('0x7'))(_0xa0aa('0x8'));var config=require(_0xa0aa('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa0aa('0xa')]=_[_0xa0aa('0xb')](config['redis'],{'host':_0xa0aa('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa0aa('0xd'))[_0xa0aa('0xe')](socket);function respondWithRpcPromise(_0x5b87b5,_0x6f81c1,_0x35a359){return new BPromise(function(_0x4389f1,_0x553d51){return client[_0xa0aa('0xf')](_0x5b87b5,_0x35a359)['then'](function(_0x30207d){logger['info'](_0xa0aa('0x10'),_0x6f81c1,_0xa0aa('0x11'));logger[_0xa0aa('0x12')](_0xa0aa('0x13'),_0x6f81c1,_0xa0aa('0x11'),JSON['stringify'](_0x30207d));if(_0x30207d[_0xa0aa('0x14')]){if(_0x30207d[_0xa0aa('0x14')][_0xa0aa('0x15')]===0x1f4){logger[_0xa0aa('0x14')](_0xa0aa('0x10'),_0x6f81c1,_0x30207d[_0xa0aa('0x14')][_0xa0aa('0x16')]);return _0x553d51(_0x30207d['error'][_0xa0aa('0x16')]);}logger[_0xa0aa('0x14')]('CmList,\x20%s,\x20%s',_0x6f81c1,_0x30207d[_0xa0aa('0x14')][_0xa0aa('0x16')]);return _0x4389f1(_0x30207d[_0xa0aa('0x14')][_0xa0aa('0x16')]);}else{logger[_0xa0aa('0x17')](_0xa0aa('0x10'),_0x6f81c1,_0xa0aa('0x11'));_0x4389f1(_0x30207d[_0xa0aa('0x18')][_0xa0aa('0x16')]);}})[_0xa0aa('0x19')](function(_0x4999be){logger[_0xa0aa('0x14')](_0xa0aa('0x10'),_0x6f81c1,_0x4999be);_0x553d51(_0x4999be);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f5c3013..45c8aaf 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 _0xf693=['cmList:','save','remove','update','emit','removeListener','register','length'];(function(_0x8ba846,_0x47c7b6){var _0x4d661b=function(_0x223bfa){while(--_0x223bfa){_0x8ba846['push'](_0x8ba846['shift']());}};_0x4d661b(++_0x47c7b6);}(_0xf693,0x181));var _0x3f69=function(_0xcc6c68,_0x28d05f){_0xcc6c68=_0xcc6c68-0x0;var _0x269f9b=_0xf693[_0xcc6c68];return _0x269f9b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3f69('0x0'),_0x3f69('0x1'),_0x3f69('0x2')];function createListener(_0x250a1d,_0x339d06){return function(_0x3dcdd6){_0x339d06[_0x3f69('0x3')](_0x250a1d,_0x3dcdd6);};}function removeListener(_0x527646,_0xf2fdd8){return function(){CmListEvents[_0x3f69('0x4')](_0x527646,_0xf2fdd8);};}exports[_0x3f69('0x5')]=function(_0x489d4d){for(var _0x3e4c37=0x0,_0x45461a=events[_0x3f69('0x6')];_0x3e4c37<_0x45461a;_0x3e4c37++){var _0x32544e=events[_0x3e4c37];var _0x1ac268=createListener(_0x3f69('0x7')+_0x32544e,_0x489d4d);CmListEvents['on'](_0x32544e,_0x1ac268);}}; \ No newline at end of file +var _0xff16=['cmList:','./cmList.events','save','update','emit','removeListener','length'];(function(_0x31e1bf,_0x49dd99){var _0x45e4b9=function(_0x19b432){while(--_0x19b432){_0x31e1bf['push'](_0x31e1bf['shift']());}};_0x45e4b9(++_0x49dd99);}(_0xff16,0x7f));var _0x6ff1=function(_0x5669da,_0x40063a){_0x5669da=_0x5669da-0x0;var _0x363b9a=_0xff16[_0x5669da];return _0x363b9a;};'use strict';var CmListEvents=require(_0x6ff1('0x0'));var events=[_0x6ff1('0x1'),'remove',_0x6ff1('0x2')];function createListener(_0x230cff,_0x41e506){return function(_0x25cf5a){_0x41e506[_0x6ff1('0x3')](_0x230cff,_0x25cf5a);};}function removeListener(_0x3f53b2,_0x3e4c94){return function(){CmListEvents[_0x6ff1('0x4')](_0x3f53b2,_0x3e4c94);};}exports['register']=function(_0x153a91){for(var _0x4f8f24=0x0,_0x133524=events[_0x6ff1('0x5')];_0x4f8f24<_0x133524;_0x4f8f24++){var _0x2333b1=events[_0x4f8f24];var _0xbea21f=createListener(_0x6ff1('0x6')+_0x2333b1,_0x153a91);CmListEvents['on'](_0x2333b1,_0xbea21f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index bbf7a52..c0c3905 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 _0x41ef=['getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','create','post','/:id/dispositions','addContacts','addCustomField','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/describe','describe','/:id','getDispositions','/:id/contacts'];(function(_0x20ceaf,_0x537409){var _0x13f9a9=function(_0x2716d6){while(--_0x2716d6){_0x20ceaf['push'](_0x20ceaf['shift']());}};_0x13f9a9(++_0x537409);}(_0x41ef,0x129));var _0xf41e=function(_0x363968,_0x122f44){_0x363968=_0x363968-0x0;var _0x5ab2c9=_0x41ef[_0x363968];return _0x5ab2c9;};'use strict';var multer=require(_0xf41e('0x0'));var util=require(_0xf41e('0x1'));var path=require('path');var timeout=require(_0xf41e('0x2'));var express=require(_0xf41e('0x3'));var router=express[_0xf41e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf41e('0x5'));var controller=require('./cmList.controller');router[_0xf41e('0x6')]('/',auth[_0xf41e('0x7')](),controller['index']);router[_0xf41e('0x6')](_0xf41e('0x8'),auth[_0xf41e('0x7')](),controller[_0xf41e('0x9')]);router[_0xf41e('0x6')](_0xf41e('0xa'),auth[_0xf41e('0x7')](),controller['show']);router[_0xf41e('0x6')]('/:id/dispositions',auth[_0xf41e('0x7')](),controller[_0xf41e('0xb')]);router['get'](_0xf41e('0xc'),auth[_0xf41e('0x7')](),controller[_0xf41e('0xd')]);router['get'](_0xf41e('0xe'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xf41e('0x6')](_0xf41e('0xf'),auth[_0xf41e('0x7')](),controller[_0xf41e('0x10')]);router[_0xf41e('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xf41e('0x11')]);router['post']('/',auth[_0xf41e('0x7')](),controller[_0xf41e('0x12')]);router[_0xf41e('0x13')](_0xf41e('0x14'),auth[_0xf41e('0x7')](),controller['addDisposition']);router[_0xf41e('0x13')]('/:id/contacts',auth[_0xf41e('0x7')](),controller[_0xf41e('0x15')]);router[_0xf41e('0x13')](_0xf41e('0xf'),auth['isAuthenticated'](),controller[_0xf41e('0x16')]);router[_0xf41e('0x13')](_0xf41e('0x17'),auth[_0xf41e('0x7')](),controller[_0xf41e('0x18')]);router[_0xf41e('0x19')](_0xf41e('0xa'),auth[_0xf41e('0x7')](),controller['update']);router[_0xf41e('0x1a')](_0xf41e('0xa'),auth[_0xf41e('0x7')](),controller[_0xf41e('0x1b')]);router[_0xf41e('0x1a')]('/:id/dispositions',auth[_0xf41e('0x7')](),controller[_0xf41e('0x1c')]);router['delete'](_0xf41e('0x17'),auth['isAuthenticated'](),controller[_0xf41e('0x1d')]);module[_0xf41e('0x1e')]=router; \ No newline at end of file +var _0x330c=['delete','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','/:id','getDispositions','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','/:id/fields','addAgents','put'];(function(_0x561a4f,_0x52f5ad){var _0x49b1a5=function(_0x43b562){while(--_0x43b562){_0x561a4f['push'](_0x561a4f['shift']());}};_0x49b1a5(++_0x52f5ad);}(_0x330c,0x1c4));var _0xc330=function(_0x1cbc47,_0x58b1e4){_0x1cbc47=_0x1cbc47-0x0;var _0x2759ff=_0x330c[_0x1cbc47];return _0x2759ff;};'use strict';var multer=require('multer');var util=require(_0xc330('0x0'));var path=require(_0xc330('0x1'));var timeout=require(_0xc330('0x2'));var express=require(_0xc330('0x3'));var router=express[_0xc330('0x4')]();var auth=require(_0xc330('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc330('0x6'));var controller=require(_0xc330('0x7'));router[_0xc330('0x8')]('/',auth[_0xc330('0x9')](),controller['index']);router[_0xc330('0x8')](_0xc330('0xa'),auth[_0xc330('0x9')](),controller['describe']);router[_0xc330('0x8')](_0xc330('0xb'),auth[_0xc330('0x9')](),controller['show']);router[_0xc330('0x8')]('/:id/dispositions',auth[_0xc330('0x9')](),controller[_0xc330('0xc')]);router['get'](_0xc330('0xd'),auth['isAuthenticated'](),controller[_0xc330('0xe')]);router[_0xc330('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xc330('0xf')]);router[_0xc330('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc330('0x10')]);router['get'](_0xc330('0x11'),auth[_0xc330('0x9')](),controller['getAgents']);router[_0xc330('0x12')]('/',auth[_0xc330('0x9')](),controller[_0xc330('0x13')]);router[_0xc330('0x12')](_0xc330('0x14'),auth[_0xc330('0x9')](),controller['addDisposition']);router[_0xc330('0x12')](_0xc330('0xd'),auth[_0xc330('0x9')](),controller['addContacts']);router['post'](_0xc330('0x15'),auth[_0xc330('0x9')](),controller['addCustomField']);router[_0xc330('0x12')](_0xc330('0x11'),auth[_0xc330('0x9')](),controller[_0xc330('0x16')]);router[_0xc330('0x17')](_0xc330('0xb'),auth[_0xc330('0x9')](),controller['update']);router[_0xc330('0x18')](_0xc330('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xc330('0x14'),auth[_0xc330('0x9')](),controller[_0xc330('0x19')]);router[_0xc330('0x18')](_0xc330('0x11'),auth[_0xc330('0x9')](),controller[_0xc330('0x1a')]);module[_0xc330('0x1b')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 25196f7..33f7d69 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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x1900f1,_0x5bc0ad){var _0x26c734=function(_0x28e59f){while(--_0x28e59f){_0x1900f1['push'](_0x1900f1['shift']());}};_0x26c734(++_0x5bc0ad);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x551056,_0x3ea029){var _0x3070f4=function(_0x4e0e25){while(--_0x4e0e25){_0x551056['push'](_0x551056['shift']());}};_0x3070f4(++_0x3ea029);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index a883911..5d1b8b4 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 _0xbb05=['../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','find','params','catch','Condition','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0xbb05,0xa5));var _0x5bb0=function(_0xad704b,_0x2e253d){_0xad704b=_0xad704b-0x0;var _0x1c885f=_0xbb05[_0xad704b];return _0x1c885f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5bb0('0x0'));var rimraf=require(_0x5bb0('0x1'));var zipdir=require(_0x5bb0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bb0('0x3'));var moment=require(_0x5bb0('0x4'));var BPromise=require(_0x5bb0('0x5'));var Mustache=require(_0x5bb0('0x6'));var util=require(_0x5bb0('0x7'));var path=require(_0x5bb0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5bb0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5bb0('0xa'));var crypto=require('crypto');var jsforce=require(_0x5bb0('0xb'));var deskjs=require(_0x5bb0('0xc'));var toCsv=require(_0x5bb0('0xd'));var querystring=require(_0x5bb0('0xe'));var Papa=require(_0x5bb0('0xf'));var Redis=require(_0x5bb0('0x10'));var authService=require(_0x5bb0('0x11'));var qs=require(_0x5bb0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bb0('0x13'));var logger=require(_0x5bb0('0x14'))('api');var utils=require(_0x5bb0('0x15'));var config=require(_0x5bb0('0x16'));var db=require(_0x5bb0('0x17'))['db'];function respondWithStatusCode(_0x3e01e9,_0x494c0e){_0x494c0e=_0x494c0e||0xcc;return function(_0x375bb8){if(_0x375bb8){return _0x3e01e9['sendStatus'](_0x494c0e);}return _0x3e01e9[_0x5bb0('0x18')](_0x494c0e)[_0x5bb0('0x19')]();};}function respondWithResult(_0x3eb7ff,_0x41d1fd){_0x41d1fd=_0x41d1fd||0xc8;return function(_0x5752e2){if(_0x5752e2){return _0x3eb7ff['status'](_0x41d1fd)[_0x5bb0('0x1a')](_0x5752e2);}};}function respondWithFilteredResult(_0x15bccf,_0x29f080){return function(_0x2cab51){if(_0x2cab51){var _0x2c7e67=_0x2cab51[_0x5bb0('0x1b')],_0x48f6fc=_0x29f080[_0x5bb0('0x1c')],_0x49d517=_0x29f080[_0x5bb0('0x1c')]+_0x29f080[_0x5bb0('0x1d')],_0x3f8832;if(_0x49d517>=_0x2c7e67){_0x49d517=_0x2c7e67;_0x3f8832=0xc8;}else{_0x3f8832=0xce;}_0x15bccf[_0x5bb0('0x18')](_0x3f8832);return _0x15bccf[_0x5bb0('0x1e')](_0x5bb0('0x1f'),_0x48f6fc+'-'+_0x49d517+'/'+_0x2c7e67)[_0x5bb0('0x1a')](_0x2cab51);}return null;};}function patchUpdates(_0x47550c){return function(_0x3ee54d){try{jsonpatch['apply'](_0x3ee54d,_0x47550c,!![]);}catch(_0x4aafb1){return BPromise[_0x5bb0('0x20')](_0x4aafb1);}return _0x3ee54d[_0x5bb0('0x21')]();};}function saveUpdates(_0x1daea8,_0x2bb5d6){return function(_0x4cad87){if(_0x4cad87){return _0x4cad87[_0x5bb0('0x22')](_0x1daea8)['then'](function(_0x1b7df0){return _0x1b7df0;});}return null;};}function removeEntity(_0x524c3c,_0x42f11d){return function(_0x16e496){if(_0x16e496){return _0x16e496[_0x5bb0('0x23')]()[_0x5bb0('0x24')](function(){_0x524c3c['status'](0xcc)[_0x5bb0('0x19')]();});}};}function handleEntityNotFound(_0x5be651,_0x420642){return function(_0x398cb3){if(!_0x398cb3){_0x5be651[_0x5bb0('0x25')](0x194);}return _0x398cb3;};}function handleError(_0x6bb3e5,_0x528286){_0x528286=_0x528286||0x1f4;return function(_0x36e10e){logger[_0x5bb0('0x26')](_0x36e10e[_0x5bb0('0x27')]);if(_0x36e10e[_0x5bb0('0x28')]){delete _0x36e10e[_0x5bb0('0x28')];}_0x6bb3e5[_0x5bb0('0x18')](_0x528286)[_0x5bb0('0x29')](_0x36e10e);};}exports[_0x5bb0('0x22')]=function(_0x740591,_0xdfd2e8){if(_0x740591['body']['id']){delete _0x740591[_0x5bb0('0x2a')]['id'];}return db['Condition'][_0x5bb0('0x2b')]({'where':{'id':_0x740591[_0x5bb0('0x2c')]['id']}})[_0x5bb0('0x24')](handleEntityNotFound(_0xdfd2e8,null))['then'](saveUpdates(_0x740591[_0x5bb0('0x2a')],null))['then'](respondWithResult(_0xdfd2e8,null))[_0x5bb0('0x2d')](handleError(_0xdfd2e8,null));};exports[_0x5bb0('0x23')]=function(_0x5eec2c,_0x144499){return db[_0x5bb0('0x2e')][_0x5bb0('0x2b')]({'where':{'id':_0x5eec2c[_0x5bb0('0x2c')]['id']}})[_0x5bb0('0x24')](handleEntityNotFound(_0x144499,null))[_0x5bb0('0x24')](removeEntity(_0x144499,null))['catch'](handleError(_0x144499,null));}; \ No newline at end of file +var _0xa857=['reject','save','update','then','destroy','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply'];(function(_0x1e98af,_0x3943db){var _0x9d1f49=function(_0x313d79){while(--_0x313d79){_0x1e98af['push'](_0x1e98af['shift']());}};_0x9d1f49(++_0x3943db);}(_0xa857,0x147));var _0x7a85=function(_0x3d21d4,_0xafba9f){_0x3d21d4=_0x3d21d4-0x0;var _0x22f14f=_0xa857[_0x3d21d4];return _0x22f14f;};'use strict';var pdf=require(_0x7a85('0x0'));var emlformat=require(_0x7a85('0x1'));var rimraf=require(_0x7a85('0x2'));var zipdir=require(_0x7a85('0x3'));var jsonpatch=require(_0x7a85('0x4'));var rp=require(_0x7a85('0x5'));var moment=require(_0x7a85('0x6'));var BPromise=require(_0x7a85('0x7'));var Mustache=require(_0x7a85('0x8'));var util=require(_0x7a85('0x9'));var path=require(_0x7a85('0xa'));var sox=require('sox');var csv=require(_0x7a85('0xb'));var ejs=require(_0x7a85('0xc'));var fs=require('fs');var _=require(_0x7a85('0xd'));var squel=require('squel');var crypto=require(_0x7a85('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a85('0xb'));var querystring=require(_0x7a85('0xf'));var Papa=require(_0x7a85('0x10'));var Redis=require(_0x7a85('0x11'));var authService=require(_0x7a85('0x12'));var qs=require(_0x7a85('0x13'));var as=require(_0x7a85('0x14'));var hardwareService=require(_0x7a85('0x15'));var logger=require(_0x7a85('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7a85('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcdb7,_0x13be39){_0x13be39=_0x13be39||0xcc;return function(_0x329faf){if(_0x329faf){return _0x3bcdb7[_0x7a85('0x18')](_0x13be39);}return _0x3bcdb7[_0x7a85('0x19')](_0x13be39)[_0x7a85('0x1a')]();};}function respondWithResult(_0x2bcb87,_0x3fe42b){_0x3fe42b=_0x3fe42b||0xc8;return function(_0x58c601){if(_0x58c601){return _0x2bcb87[_0x7a85('0x19')](_0x3fe42b)[_0x7a85('0x1b')](_0x58c601);}};}function respondWithFilteredResult(_0x1b6a33,_0x3fe035){return function(_0x75d15f){if(_0x75d15f){var _0x3c08cb=_0x75d15f['count'],_0x4c3461=_0x3fe035[_0x7a85('0x1c')],_0x446781=_0x3fe035[_0x7a85('0x1c')]+_0x3fe035[_0x7a85('0x1d')],_0x2feca6;if(_0x446781>=_0x3c08cb){_0x446781=_0x3c08cb;_0x2feca6=0xc8;}else{_0x2feca6=0xce;}_0x1b6a33['status'](_0x2feca6);return _0x1b6a33[_0x7a85('0x1e')](_0x7a85('0x1f'),_0x4c3461+'-'+_0x446781+'/'+_0x3c08cb)['json'](_0x75d15f);}return null;};}function patchUpdates(_0x58b013){return function(_0xac09c6){try{jsonpatch[_0x7a85('0x20')](_0xac09c6,_0x58b013,!![]);}catch(_0x5acf33){return BPromise[_0x7a85('0x21')](_0x5acf33);}return _0xac09c6[_0x7a85('0x22')]();};}function saveUpdates(_0x588b21,_0xb8ba2f){return function(_0x7f97e2){if(_0x7f97e2){return _0x7f97e2[_0x7a85('0x23')](_0x588b21)[_0x7a85('0x24')](function(_0x32aeb6){return _0x32aeb6;});}return null;};}function removeEntity(_0x4f086d,_0x587e78){return function(_0x33c5d2){if(_0x33c5d2){return _0x33c5d2[_0x7a85('0x25')]()['then'](function(){_0x4f086d[_0x7a85('0x19')](0xcc)[_0x7a85('0x1a')]();});}};}function handleEntityNotFound(_0x1e9fc9,_0x5534c7){return function(_0x3b7d29){if(!_0x3b7d29){_0x1e9fc9[_0x7a85('0x18')](0x194);}return _0x3b7d29;};}function handleError(_0x76fb87,_0xb5bab0){_0xb5bab0=_0xb5bab0||0x1f4;return function(_0x39231f){logger['error'](_0x39231f['stack']);if(_0x39231f[_0x7a85('0x26')]){delete _0x39231f[_0x7a85('0x26')];}_0x76fb87['status'](_0xb5bab0)[_0x7a85('0x27')](_0x39231f);};}exports[_0x7a85('0x23')]=function(_0x35038e,_0x16a7b5){if(_0x35038e[_0x7a85('0x28')]['id']){delete _0x35038e[_0x7a85('0x28')]['id'];}return db[_0x7a85('0x29')][_0x7a85('0x2a')]({'where':{'id':_0x35038e[_0x7a85('0x2b')]['id']}})['then'](handleEntityNotFound(_0x16a7b5,null))[_0x7a85('0x24')](saveUpdates(_0x35038e[_0x7a85('0x28')],null))[_0x7a85('0x24')](respondWithResult(_0x16a7b5,null))[_0x7a85('0x2c')](handleError(_0x16a7b5,null));};exports[_0x7a85('0x25')]=function(_0x4eb36a,_0x502f29){return db[_0x7a85('0x29')][_0x7a85('0x2a')]({'where':{'id':_0x4eb36a[_0x7a85('0x2b')]['id']}})[_0x7a85('0x24')](handleEntityNotFound(_0x502f29,null))['then'](removeEntity(_0x502f29,null))[_0x7a85('0x2c')](handleError(_0x502f29,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 91c4100..15c374c 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 _0x9e47=['tools_conditions','lodash','util','../../config/logger','api','bluebird','path','./condition.attributes','exports'];(function(_0x28b9fa,_0x25f40a){var _0x1beb5d=function(_0x56dc14){while(--_0x56dc14){_0x28b9fa['push'](_0x28b9fa['shift']());}};_0x1beb5d(++_0x25f40a);}(_0x9e47,0x157));var _0x79e4=function(_0x465949,_0x302f44){_0x465949=_0x465949-0x0;var _0x4723e3=_0x9e47[_0x465949];return _0x4723e3;};'use strict';var _=require(_0x79e4('0x0'));var util=require(_0x79e4('0x1'));var logger=require(_0x79e4('0x2'))(_0x79e4('0x3'));var moment=require('moment');var BPromise=require(_0x79e4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x79e4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79e4('0x6'));module[_0x79e4('0x7')]=function(_0x36b0bd,_0x2db0d1){return _0x36b0bd['define']('Condition',attributes,{'tableName':_0x79e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a66=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','moment'];(function(_0x20730e,_0x41f95c){var _0x1c26ce=function(_0x45ad41){while(--_0x45ad41){_0x20730e['push'](_0x20730e['shift']());}};_0x1c26ce(++_0x41f95c);}(_0x4a66,0x88));var _0x64a6=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x4a66[_0x207811];return _0x170d56;};'use strict';var _=require(_0x64a6('0x0'));var util=require('util');var logger=require(_0x64a6('0x1'))(_0x64a6('0x2'));var moment=require(_0x64a6('0x3'));var BPromise=require(_0x64a6('0x4'));var rp=require(_0x64a6('0x5'));var fs=require('fs');var path=require(_0x64a6('0x6'));var rimraf=require(_0x64a6('0x7'));var config=require(_0x64a6('0x8'));var attributes=require(_0x64a6('0x9'));module[_0x64a6('0xa')]=function(_0x4aaef8,_0x2e8f2a){return _0x4aaef8[_0x64a6('0xb')](_0x64a6('0xc'),attributes,{'tableName':_0x64a6('0xd'),'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 9303b74..8893b3a 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 _0xa31a=['error','code','Condition,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x204bea,_0x3e0fbc){var _0x1c5021=function(_0x465478){while(--_0x465478){_0x204bea['push'](_0x204bea['shift']());}};_0x1c5021(++_0x3e0fbc);}(_0xa31a,0x9f));var _0xaa31=function(_0xa771a3,_0x46d253){_0xa771a3=_0xa771a3-0x0;var _0x437f62=_0xa31a[_0xa771a3];return _0x437f62;};'use strict';var _=require(_0xaa31('0x0'));var util=require(_0xaa31('0x1'));var moment=require(_0xaa31('0x2'));var BPromise=require(_0xaa31('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa31('0x4'));var db=require(_0xaa31('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa31('0x6'))(_0xaa31('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa31('0x8'));var client=jayson[_0xaa31('0x9')][_0xaa31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2356f8,_0x521c76,_0x20eae5){return new BPromise(function(_0x48c8a7,_0x5a68ee){return client[_0xaa31('0xb')](_0x2356f8,_0x20eae5)[_0xaa31('0xc')](function(_0x4813d7){logger[_0xaa31('0xd')]('Condition,\x20%s,\x20%s',_0x521c76,_0xaa31('0xe'));logger[_0xaa31('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x521c76,'request\x20sent',JSON[_0xaa31('0x10')](_0x4813d7));if(_0x4813d7[_0xaa31('0x11')]){if(_0x4813d7[_0xaa31('0x11')][_0xaa31('0x12')]===0x1f4){logger['error'](_0xaa31('0x13'),_0x521c76,_0x4813d7['error'][_0xaa31('0x14')]);return _0x5a68ee(_0x4813d7[_0xaa31('0x11')][_0xaa31('0x14')]);}logger[_0xaa31('0x11')](_0xaa31('0x13'),_0x521c76,_0x4813d7[_0xaa31('0x11')][_0xaa31('0x14')]);return _0x48c8a7(_0x4813d7[_0xaa31('0x11')][_0xaa31('0x14')]);}else{logger[_0xaa31('0xd')](_0xaa31('0x13'),_0x521c76,'request\x20sent');_0x48c8a7(_0x4813d7['result'][_0xaa31('0x14')]);}})[_0xaa31('0x15')](function(_0x4d3537){logger['error'](_0xaa31('0x13'),_0x521c76,_0x4d3537);_0x5a68ee(_0x4d3537);});});} \ No newline at end of file +var _0x3198=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x3198,0x145));var _0x8319=function(_0x546c46,_0x31fdca){_0x546c46=_0x546c46-0x0;var _0x3d00be=_0x3198[_0x546c46];return _0x3d00be;};'use strict';var _=require(_0x8319('0x0'));var util=require(_0x8319('0x1'));var moment=require(_0x8319('0x2'));var BPromise=require(_0x8319('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8319('0x4'));var db=require(_0x8319('0x5'))['db'];var utils=require(_0x8319('0x6'));var logger=require('../../config/logger')(_0x8319('0x7'));var config=require(_0x8319('0x8'));var jayson=require(_0x8319('0x9'));var client=jayson[_0x8319('0xa')][_0x8319('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26cc0f,_0x284063,_0x486f17){return new BPromise(function(_0x2ee1b2,_0x5b0cd5){return client[_0x8319('0xc')](_0x26cc0f,_0x486f17)['then'](function(_0x52e53a){logger[_0x8319('0xd')](_0x8319('0xe'),_0x284063,'request\x20sent');logger['debug'](_0x8319('0xf'),_0x284063,_0x8319('0x10'),JSON[_0x8319('0x11')](_0x52e53a));if(_0x52e53a[_0x8319('0x12')]){if(_0x52e53a[_0x8319('0x12')][_0x8319('0x13')]===0x1f4){logger[_0x8319('0x12')](_0x8319('0xe'),_0x284063,_0x52e53a['error'][_0x8319('0x14')]);return _0x5b0cd5(_0x52e53a[_0x8319('0x12')]['message']);}logger[_0x8319('0x12')](_0x8319('0xe'),_0x284063,_0x52e53a[_0x8319('0x12')][_0x8319('0x14')]);return _0x2ee1b2(_0x52e53a[_0x8319('0x12')][_0x8319('0x14')]);}else{logger['info'](_0x8319('0xe'),_0x284063,'request\x20sent');_0x2ee1b2(_0x52e53a[_0x8319('0x15')][_0x8319('0x14')]);}})['catch'](function(_0x48d693){logger[_0x8319('0x12')](_0x8319('0xe'),_0x284063,_0x48d693);_0x5b0cd5(_0x48d693);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 3877faf..0783d00 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 _0x1eb5=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x125232,_0x590dec){var _0x17c0da=function(_0x2c0adc){while(--_0x2c0adc){_0x125232['push'](_0x125232['shift']());}};_0x17c0da(++_0x590dec);}(_0x1eb5,0xa5));var _0x51eb=function(_0x292a10,_0x5726b2){_0x292a10=_0x292a10-0x0;var _0x9cfc9d=_0x1eb5[_0x292a10];return _0x9cfc9d;};'use strict';var multer=require('multer');var util=require(_0x51eb('0x0'));var path=require(_0x51eb('0x1'));var timeout=require('connect-timeout');var express=require(_0x51eb('0x2'));var router=express[_0x51eb('0x3')]();var auth=require(_0x51eb('0x4'));var interaction=require(_0x51eb('0x5'));var config=require(_0x51eb('0x6'));var controller=require(_0x51eb('0x7'));router[_0x51eb('0x8')](_0x51eb('0x9'),auth[_0x51eb('0xa')](),controller[_0x51eb('0xb')]);router[_0x51eb('0xc')](_0x51eb('0x9'),auth[_0x51eb('0xa')](),controller[_0x51eb('0xd')]);module[_0x51eb('0xe')]=router; \ No newline at end of file +var _0x6960=['./condition.controller','/:id','isAuthenticated','update','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6960,0x66));var _0x0696=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6960[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x0696('0x0'));var util=require('util');var path=require(_0x0696('0x1'));var timeout=require(_0x0696('0x2'));var express=require(_0x0696('0x3'));var router=express[_0x0696('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0696('0x5'));var controller=require(_0x0696('0x6'));router['put'](_0x0696('0x7'),auth[_0x0696('0x8')](),controller[_0x0696('0x9')]);router['delete'](_0x0696('0x7'),auth[_0x0696('0x8')](),controller[_0x0696('0xa')]);module[_0x0696('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index a05d636..ce669d5 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 _0x68f5=['sequelize','exports','STRING'];(function(_0x276d4f,_0x1f1c4d){var _0xbaaf15=function(_0x158bad){while(--_0x158bad){_0x276d4f['push'](_0x276d4f['shift']());}};_0xbaaf15(++_0x1f1c4d);}(_0x68f5,0x11a));var _0x568f=function(_0x39c747,_0x297706){_0x39c747=_0x39c747-0x0;var _0x523e66=_0x68f5[_0x39c747];return _0x523e66;};'use strict';var Sequelize=require(_0x568f('0x0'));module[_0x568f('0x1')]={'name':{'type':Sequelize[_0x568f('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x568f('0x2')]}}; \ No newline at end of file +var _0xc507=['exports','STRING','name','sequelize'];(function(_0x4c2f2d,_0x56d966){var _0x299294=function(_0x17c13c){while(--_0x17c13c){_0x4c2f2d['push'](_0x4c2f2d['shift']());}};_0x299294(++_0x56d966);}(_0xc507,0x73));var _0x7c50=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xc507[_0x36436d];return _0x34615d;};'use strict';var Sequelize=require(_0x7c50('0x0'));module[_0x7c50('0x1')]={'name':{'type':Sequelize[_0x7c50('0x2')],'allowNull':![],'unique':_0x7c50('0x3')},'description':{'type':Sequelize[_0x7c50('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 91f4661..0b244c7 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 _0x634d=['index','Dashboard','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','updatedAt','role','autoAssociation','iframe','attrs','https://','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','then','get','destroy','error','stack','name','send'];(function(_0x29cfdd,_0x4c68e6){var _0x385b55=function(_0xc544e6){while(--_0xc544e6){_0x29cfdd['push'](_0x29cfdd['shift']());}};_0x385b55(++_0x4c68e6);}(_0x634d,0x120));var _0xd634=function(_0x5b8219,_0xa6d7e7){_0x5b8219=_0x5b8219-0x0;var _0x384a9d=_0x634d[_0x5b8219];return _0x384a9d;};'use strict';var pdf=require(_0xd634('0x0'));var emlformat=require(_0xd634('0x1'));var rimraf=require(_0xd634('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd634('0x3'));var BPromise=require(_0xd634('0x4'));var Mustache=require(_0xd634('0x5'));var util=require('util');var path=require(_0xd634('0x6'));var sox=require(_0xd634('0x7'));var csv=require('to-csv');var ejs=require(_0xd634('0x8'));var fs=require('fs');var _=require(_0xd634('0x9'));var squel=require(_0xd634('0xa'));var crypto=require(_0xd634('0xb'));var jsforce=require(_0xd634('0xc'));var deskjs=require(_0xd634('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd634('0xe'));var Papa=require(_0xd634('0xf'));var Redis=require('ioredis');var authService=require(_0xd634('0x10'));var qs=require(_0xd634('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd634('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd634('0x13'));var db=require(_0xd634('0x14'))['db'];config[_0xd634('0x15')]=_['defaults'](config['redis'],{'host':_0xd634('0x16'),'port':0x18eb});var socket=require(_0xd634('0x17'))(new Redis(config[_0xd634('0x15')]));require('./dashboard.socket')[_0xd634('0x18')](socket);function respondWithStatusCode(_0x176396,_0x3c1964){_0x3c1964=_0x3c1964||0xcc;return function(_0xc355ec){if(_0xc355ec){return _0x176396[_0xd634('0x19')](_0x3c1964);}return _0x176396[_0xd634('0x1a')](_0x3c1964)[_0xd634('0x1b')]();};}function respondWithResult(_0x3adafe,_0x3a5fdd){_0x3a5fdd=_0x3a5fdd||0xc8;return function(_0x4bf557){if(_0x4bf557){return _0x3adafe[_0xd634('0x1a')](_0x3a5fdd)[_0xd634('0x1c')](_0x4bf557);}};}function respondWithFilteredResult(_0x863d6f,_0x18eda6){return function(_0x21acb4){if(_0x21acb4){var _0x271fa2=_0x21acb4[_0xd634('0x1d')],_0x1a9696=_0x18eda6['offset'],_0x16ee0a=_0x18eda6[_0xd634('0x1e')]+_0x18eda6[_0xd634('0x1f')],_0x17c604;if(_0x16ee0a>=_0x271fa2){_0x16ee0a=_0x271fa2;_0x17c604=0xc8;}else{_0x17c604=0xce;}_0x863d6f[_0xd634('0x1a')](_0x17c604);return _0x863d6f[_0xd634('0x20')](_0xd634('0x21'),_0x1a9696+'-'+_0x16ee0a+'/'+_0x271fa2)[_0xd634('0x1c')](_0x21acb4);}return null;};}function patchUpdates(_0x1e7e6c){return function(_0x2738bd){try{jsonpatch[_0xd634('0x22')](_0x2738bd,_0x1e7e6c,!![]);}catch(_0x36f903){return BPromise['reject'](_0x36f903);}return _0x2738bd['save']();};}function saveUpdates(_0x2c1bf2,_0x350725){return function(_0x413d49){if(_0x413d49){return _0x413d49['update'](_0x2c1bf2)[_0xd634('0x23')](function(_0x2da53f){return _0x2da53f;});}return null;};}function removeEntity(_0x55b212,_0x51509c){return function(_0x34fdae){if(_0x34fdae){return _0x34fdae['destroy']()['then'](function(){var _0x225c91=_0x34fdae[_0xd634('0x24')]({'plain':!![]});var _0x464fea='CustomDashboards';return db['UserProfileResource'][_0xd634('0x25')]({'where':{'type':_0x464fea,'resourceId':_0x225c91['id']}})['then'](function(){return _0x34fdae;});})[_0xd634('0x23')](function(){_0x55b212[_0xd634('0x1a')](0xcc)[_0xd634('0x1b')]();});}};}function handleEntityNotFound(_0x2a3b86,_0x29182d){return function(_0x232b0c){if(!_0x232b0c){_0x2a3b86[_0xd634('0x19')](0x194);}return _0x232b0c;};}function handleError(_0x244c65,_0x427c03){_0x427c03=_0x427c03||0x1f4;return function(_0x2489af){logger[_0xd634('0x26')](_0x2489af[_0xd634('0x27')]);if(_0x2489af[_0xd634('0x28')]){delete _0x2489af[_0xd634('0x28')];}_0x244c65[_0xd634('0x1a')](_0x427c03)[_0xd634('0x29')](_0x2489af);};}exports[_0xd634('0x2a')]=function(_0x11c2a5,_0x45f176){var _0x45b049={},_0x2b9831={},_0x5a59cd={'count':0x0,'rows':[]};var _0x3c10a7=_['map'](db[_0xd634('0x2b')]['rawAttributes'],function(_0x15ce96){return{'name':_0x15ce96[_0xd634('0x2c')],'type':_0x15ce96[_0xd634('0x2d')]['key']};});_0x2b9831[_0xd634('0x2e')]=_[_0xd634('0x2f')](_0x3c10a7,_0xd634('0x28'));_0x2b9831[_0xd634('0x30')]=_['keys'](_0x11c2a5[_0xd634('0x30')]);_0x2b9831[_0xd634('0x31')]=_[_0xd634('0x32')](_0x2b9831[_0xd634('0x2e')],_0x2b9831[_0xd634('0x30')]);_0x45b049[_0xd634('0x33')]=_[_0xd634('0x32')](_0x2b9831[_0xd634('0x2e')],qs['fields'](_0x11c2a5[_0xd634('0x30')][_0xd634('0x34')]));_0x45b049['attributes']=_0x45b049['attributes']['length']?_0x45b049[_0xd634('0x33')]:_0x2b9831[_0xd634('0x2e')];if(!_0x11c2a5[_0xd634('0x30')][_0xd634('0x35')](_0xd634('0x36'))){_0x45b049[_0xd634('0x1f')]=qs['limit'](_0x11c2a5[_0xd634('0x30')][_0xd634('0x1f')]);_0x45b049[_0xd634('0x1e')]=qs[_0xd634('0x1e')](_0x11c2a5[_0xd634('0x30')][_0xd634('0x1e')]);}_0x45b049[_0xd634('0x37')]=qs[_0xd634('0x38')](_0x11c2a5['query'][_0xd634('0x38')]);_0x45b049['where']=qs[_0xd634('0x31')](_[_0xd634('0x39')](_0x11c2a5[_0xd634('0x30')],_0x2b9831[_0xd634('0x31')]));if(_0x11c2a5[_0xd634('0x30')][_0xd634('0x3a')]){_0x45b049[_0xd634('0x3b')]=_['merge'](_0x45b049[_0xd634('0x3b')],{'$or':_['map'](_0x3c10a7,function(_0x35e926){if(_0x35e926[_0xd634('0x2d')]!==_0xd634('0x3c')){var _0x25a50d={};_0x25a50d[_0x35e926[_0xd634('0x28')]]={'$like':'%'+_0x11c2a5[_0xd634('0x30')]['filter']+'%'};return _0x25a50d;}})});}_0x45b049=_[_0xd634('0x3d')]({},_0x45b049,_0x11c2a5[_0xd634('0x3e')]);var _0x35826d={'where':_0x45b049[_0xd634('0x3b')]};return db[_0xd634('0x2b')][_0xd634('0x1d')](_0x35826d)['then'](function(_0xc816c0){_0x5a59cd[_0xd634('0x1d')]=_0xc816c0;if(_0x11c2a5[_0xd634('0x30')][_0xd634('0x3f')]){_0x45b049[_0xd634('0x40')]=[{'all':!![]}];}return db[_0xd634('0x2b')][_0xd634('0x41')](_0x45b049);})[_0xd634('0x23')](function(_0x2fad18){_0x5a59cd[_0xd634('0x42')]=_0x2fad18;return _0x5a59cd;})[_0xd634('0x23')](respondWithFilteredResult(_0x45f176,_0x45b049))['catch'](handleError(_0x45f176,null));};exports['show']=function(_0x5ede0d,_0x5e40e5){var _0x19e5d2={'raw':![],'where':{'id':_0x5ede0d[_0xd634('0x43')]['id']}},_0x1f813b={};_0x1f813b['model']=_[_0xd634('0x44')](db[_0xd634('0x2b')][_0xd634('0x45')]);_0x1f813b[_0xd634('0x30')]=_[_0xd634('0x44')](_0x5ede0d[_0xd634('0x30')]);_0x1f813b[_0xd634('0x31')]=_[_0xd634('0x32')](_0x1f813b[_0xd634('0x2e')],_0x1f813b[_0xd634('0x30')]);_0x19e5d2[_0xd634('0x33')]=_[_0xd634('0x32')](_0x1f813b[_0xd634('0x2e')],qs[_0xd634('0x34')](_0x5ede0d[_0xd634('0x30')][_0xd634('0x34')]));_0x19e5d2['attributes']=_0x19e5d2[_0xd634('0x33')]['length']?_0x19e5d2[_0xd634('0x33')]:_0x1f813b[_0xd634('0x2e')];if(_0x5ede0d[_0xd634('0x30')][_0xd634('0x3f')]){_0x19e5d2[_0xd634('0x40')]=[{'all':!![]}];}_0x19e5d2=_[_0xd634('0x3d')]({},_0x19e5d2,_0x5ede0d[_0xd634('0x3e')]);return db[_0xd634('0x2b')][_0xd634('0x46')](_0x19e5d2)[_0xd634('0x23')](handleEntityNotFound(_0x5e40e5,null))[_0xd634('0x23')](respondWithResult(_0x5e40e5,null))[_0xd634('0x47')](handleError(_0x5e40e5,null));};exports[_0xd634('0x48')]=function(_0x472a04,_0x1e0f4f){return db[_0xd634('0x2b')][_0xd634('0x48')](_0x472a04[_0xd634('0x49')],{})[_0xd634('0x23')](function(_0x317cdd){var _0x36bbed=_0x472a04[_0xd634('0x4a')][_0xd634('0x24')]({'plain':!![]});if(!_0x36bbed)throw new Error(_0xd634('0x4b'));if(_0x36bbed['role']===_0xd634('0x4a')){var _0x56cf2=_0x317cdd[_0xd634('0x24')]({'plain':!![]});var _0x165ef4=_0xd634('0x4c');return db['UserProfileSection'][_0xd634('0x46')]({'where':{'name':_0x165ef4,'userProfileId':_0x36bbed[_0xd634('0x4d')]},'raw':!![]})[_0xd634('0x23')](function(_0xd22c8c){if(_0xd22c8c&&_0xd22c8c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x56cf2[_0xd634('0x28')],'resourceId':_0x56cf2['id'],'type':_0xd22c8c[_0xd634('0x28')],'sectionId':_0xd22c8c['id']},{})[_0xd634('0x23')](function(){return _0x317cdd;});}else{return _0x317cdd;}})['catch'](function(_0x10fe16){logger[_0xd634('0x26')](_0xd634('0x4e'),_0x10fe16);throw _0x10fe16;});}return _0x317cdd;})[_0xd634('0x23')](respondWithResult(_0x1e0f4f,0xc9))['catch'](handleError(_0x1e0f4f,null));};exports['clone']=function(_0x604290,_0x407d39){var _0x27f033={'where':{'id':_0x604290[_0xd634('0x43')]['id']}},_0x39b188={};_0x39b188['model']=_[_0xd634('0x44')](db[_0xd634('0x2b')][_0xd634('0x45')]);_0x27f033['attributes']=_[_0xd634('0x32')](_0x39b188[_0xd634('0x2e')],qs[_0xd634('0x34')](_0x604290['query']['fields']));_0x27f033[_0xd634('0x33')]=_0x27f033[_0xd634('0x33')][_0xd634('0x4f')]?_0x27f033[_0xd634('0x33')]:_0x39b188[_0xd634('0x2e')];if(_0x604290[_0xd634('0x30')][_0xd634('0x3f')]){_0x27f033[_0xd634('0x40')]=[{'all':!![]}];}_0x27f033=_[_0xd634('0x3d')]({},_0x27f033,_0x604290[_0xd634('0x3e')]);return db['Dashboard']['find'](_0x27f033)[_0xd634('0x23')](handleEntityNotFound(_0x407d39,null))[_0xd634('0x23')](function(_0x1af022){if(_0x1af022){var _0x233987=_0x1af022['get']({'plain':!![]});_0x233987=qs['omit'](_0x233987,['id','createdAt',_0xd634('0x50')]);_0x604290[_0xd634('0x49')]=_['omit'](_0x604290[_0xd634('0x49')],['id','createdAt',_0xd634('0x50')]);return db['Dashboard'][_0xd634('0x48')](_['merge'](_0x233987,_0x604290[_0xd634('0x49')]),{'include':_0x604290[_0xd634('0x30')][_0xd634('0x3f')]?[{'all':!![]}]:undefined})[_0xd634('0x23')](function(_0x280ae7){var _0x10b08f=_0x604290[_0xd634('0x4a')][_0xd634('0x24')]({'plain':!![]});if(!_0x10b08f)throw new Error(_0xd634('0x4b'));if(_0x10b08f[_0xd634('0x51')]==='user'){var _0x2d8f56=_0x280ae7['get']({'plain':!![]});var _0x278679=_0xd634('0x4c');return db['UserProfileSection'][_0xd634('0x46')]({'where':{'name':_0x278679,'userProfileId':_0x10b08f[_0xd634('0x4d')]},'raw':!![]})[_0xd634('0x23')](function(_0x3738f0){if(_0x3738f0&&_0x3738f0[_0xd634('0x52')]===0x0){return db['UserProfileResource'][_0xd634('0x48')]({'name':_0x2d8f56[_0xd634('0x28')],'resourceId':_0x2d8f56['id'],'type':_0x3738f0[_0xd634('0x28')],'sectionId':_0x3738f0['id']},{})[_0xd634('0x23')](function(){return _0x280ae7;});}else{return _0x280ae7;}})[_0xd634('0x47')](function(_0x2e6068){logger[_0xd634('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e6068);throw _0x2e6068;});}return _0x280ae7;});}})[_0xd634('0x23')](respondWithResult(_0x407d39,0xc9))['catch'](handleError(_0x407d39,null));};exports['update']=function(_0x5e96ce,_0x231151){if(_0x5e96ce[_0xd634('0x49')]['id']){delete _0x5e96ce[_0xd634('0x49')]['id'];}return db['Dashboard'][_0xd634('0x46')]({'where':{'id':_0x5e96ce[_0xd634('0x43')]['id']}})[_0xd634('0x23')](handleEntityNotFound(_0x231151,null))[_0xd634('0x23')](saveUpdates(_0x5e96ce[_0xd634('0x49')],null))[_0xd634('0x23')](respondWithResult(_0x231151,null))[_0xd634('0x47')](handleError(_0x231151,null));};exports[_0xd634('0x25')]=function(_0x538585,_0xf37f26){return db[_0xd634('0x2b')][_0xd634('0x46')]({'where':{'id':_0x538585[_0xd634('0x43')]['id']}})['then'](handleEntityNotFound(_0xf37f26,null))['then'](removeEntity(_0xf37f26,null))[_0xd634('0x47')](handleError(_0xf37f26,null));};function widgetAttributes(_0x251c03){try{switch(_0x251c03[_0xd634('0x2d')]){case _0xd634('0x53'):return[{'name':'attrUrl','value':_0x251c03['attrUrl']||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03[_0xd634('0x54')][0x0]['value']:undefined)||_0xd634('0x55')}];case'custom':return[{'name':'attrPath','value':_0x251c03[_0xd634('0x56')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03['attrs'][0x0][_0xd634('0x57')]:undefined)||''}];case _0xd634('0x58'):return[{'name':'attrHourFormat','value':_0x251c03['attrHourFormat']||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03[_0xd634('0x54')][0x0][_0xd634('0x57')]:undefined)||_0xd634('0x59')},{'name':_0xd634('0x5a'),'value':_0x251c03[_0xd634('0x5a')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x1]?_0x251c03[_0xd634('0x54')][0x1]['value']:undefined)||_0xd634('0x5b')},{'name':_0xd634('0x5c'),'value':_0x251c03['attrFontSize']||(_0x251c03['attrs']&&_0x251c03[_0xd634('0x54')][0x2]?_0x251c03[_0xd634('0x54')][0x2][_0xd634('0x57')]:undefined)||0xc}];case _0xd634('0x5d'):return[{'name':'attrMetric','value':_0x251c03['attrMetric']||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03['attrs'][0x0][_0xd634('0x57')]:undefined)||_0xd634('0x5e')},{'name':_0xd634('0x5f'),'value':_0x251c03[_0xd634('0x5f')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03['attrs'][0x1]?_0x251c03[_0xd634('0x54')][0x1][_0xd634('0x57')]:undefined)||[]},{'name':_0xd634('0x5c'),'value':_0x251c03[_0xd634('0x5c')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x2]?_0x251c03[_0xd634('0x54')][0x2][_0xd634('0x57')]:undefined)||0x14}];case _0xd634('0x60'):case _0xd634('0x61'):return[{'name':_0xd634('0x62'),'value':_0x251c03['attrSerie1']||(_0x251c03['attrs']&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03[_0xd634('0x54')][0x0][_0xd634('0x57')]:undefined)||'total'},{'name':_0xd634('0x63'),'value':_0x251c03[_0xd634('0x63')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x1]?_0x251c03['attrs'][0x1]['value']:undefined)||null},{'name':_0xd634('0x64'),'value':_0x251c03[_0xd634('0x64')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x2]?_0x251c03[_0xd634('0x54')][0x2]['value']:undefined)||null},{'name':_0xd634('0x5f'),'value':_0x251c03[_0xd634('0x5f')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03['attrs'][0x3]?_0x251c03[_0xd634('0x54')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x251c03[_0xd634('0x65')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03[_0xd634('0x54')][0x0][_0xd634('0x2d')]:undefined)||null,'value':_0x251c03[_0xd634('0x66')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x0]?_0x251c03[_0xd634('0x54')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x251c03[_0xd634('0x67')]||(_0x251c03[_0xd634('0x54')]&&_0x251c03[_0xd634('0x54')][0x1]?_0x251c03[_0xd634('0x54')][0x1][_0xd634('0x57')]:undefined)||0x0}];default:return[];}}catch(_0x35147c){logger[_0xd634('0x26')](_0xd634('0x68'),JSON[_0xd634('0x69')](_0x35147c));return[];}}exports[_0xd634('0x6a')]=function(_0x262e4a,_0x1b4a97,_0x37126f){if(_0x262e4a[_0xd634('0x49')]['id']){delete _0x262e4a[_0xd634('0x49')]['id'];}return db[_0xd634('0x2b')][_0xd634('0x46')]({'where':{'id':_0x262e4a[_0xd634('0x43')]['id']}})[_0xd634('0x23')](handleEntityNotFound(_0x1b4a97,null))[_0xd634('0x23')](function(_0x37f30b){if(_0x37f30b){_0x262e4a['body']['DashboardId']=_0x37f30b['id'];_0x262e4a['body']['attrs']=widgetAttributes(_0x262e4a[_0xd634('0x49')]);return db[_0xd634('0x6b')][_0xd634('0x48')](_0x262e4a[_0xd634('0x49')]);}})['then'](respondWithResult(_0x1b4a97,null))[_0xd634('0x47')](handleError(_0x1b4a97,null));};exports[_0xd634('0x6c')]=function(_0x5431c7,_0x58ca40,_0x30a479){var _0x2d9a75={};var _0x22cf37={};var _0x1bbedd;var _0x223d46;return db['Dashboard'][_0xd634('0x6d')]({'where':{'id':_0x5431c7['params']['id']}})[_0xd634('0x23')](handleEntityNotFound(_0x58ca40,null))[_0xd634('0x23')](function(_0x248823){if(_0x248823){_0x1bbedd=_0x248823;_0x22cf37['model']=_[_0xd634('0x44')](db[_0xd634('0x6b')][_0xd634('0x45')]);_0x22cf37['query']=_[_0xd634('0x44')](_0x5431c7[_0xd634('0x30')]);_0x22cf37['filters']=_[_0xd634('0x32')](_0x22cf37['model'],_0x22cf37[_0xd634('0x30')]);_0x2d9a75[_0xd634('0x33')]=_[_0xd634('0x32')](_0x22cf37[_0xd634('0x2e')],qs['fields'](_0x5431c7[_0xd634('0x30')]['fields']));_0x2d9a75['attributes']=_0x2d9a75['attributes'][_0xd634('0x4f')]?_0x2d9a75['attributes']:_0x22cf37[_0xd634('0x2e')];_0x2d9a75[_0xd634('0x37')]=qs[_0xd634('0x38')](_0x5431c7[_0xd634('0x30')][_0xd634('0x38')]);_0x2d9a75[_0xd634('0x3b')]=qs[_0xd634('0x31')](_['pick'](_0x5431c7[_0xd634('0x30')],_0x22cf37[_0xd634('0x31')]));if(_0x5431c7[_0xd634('0x30')][_0xd634('0x3a')]){_0x2d9a75[_0xd634('0x3b')]=_[_0xd634('0x3d')](_0x2d9a75[_0xd634('0x3b')],{'$or':_[_0xd634('0x2f')](_0x2d9a75['attributes'],function(_0x4572f0){var _0x232626={};_0x232626[_0x4572f0]={'$like':'%'+_0x5431c7[_0xd634('0x30')][_0xd634('0x3a')]+'%'};return _0x232626;})});}_0x2d9a75=_[_0xd634('0x3d')]({},_0x2d9a75,_0x5431c7[_0xd634('0x3e')]);return _0x1bbedd[_0xd634('0x6c')](_0x2d9a75);}})[_0xd634('0x23')](function(_0x4187e5){if(_0x4187e5){_0x223d46=_0x4187e5[_0xd634('0x4f')];if(!_0x5431c7[_0xd634('0x30')][_0xd634('0x35')](_0xd634('0x36'))){_0x2d9a75[_0xd634('0x1f')]=qs[_0xd634('0x1f')](_0x5431c7[_0xd634('0x30')][_0xd634('0x1f')]);_0x2d9a75[_0xd634('0x1e')]=qs[_0xd634('0x1e')](_0x5431c7[_0xd634('0x30')][_0xd634('0x1e')]);}return _0x1bbedd[_0xd634('0x6c')](_0x2d9a75);}})[_0xd634('0x23')](function(_0x3cae64){if(_0x3cae64){return _0x3cae64?{'count':_0x223d46,'rows':_0x3cae64}:null;}})['then'](respondWithResult(_0x58ca40,null))['catch'](handleError(_0x58ca40,null));}; \ No newline at end of file +var _0x8c38=['attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','getItems','findOne','DashboardItem','order','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','Dashboard','findAll','catch','show','params','keys','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','createdAt','updatedAt','omit','user','role','UserProfileSection','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2'];(function(_0x1a6905,_0x56adc4){var _0x4ef252=function(_0x2d14f9){while(--_0x2d14f9){_0x1a6905['push'](_0x1a6905['shift']());}};_0x4ef252(++_0x56adc4);}(_0x8c38,0x83));var _0x88c3=function(_0x11f118,_0x2855b5){_0x11f118=_0x11f118-0x0;var _0x3d117a=_0x8c38[_0x11f118];return _0x3d117a;};'use strict';var pdf=require(_0x88c3('0x0'));var emlformat=require(_0x88c3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x88c3('0x2'));var jsonpatch=require(_0x88c3('0x3'));var rp=require(_0x88c3('0x4'));var moment=require(_0x88c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x88c3('0x6'));var util=require(_0x88c3('0x7'));var path=require(_0x88c3('0x8'));var sox=require(_0x88c3('0x9'));var csv=require(_0x88c3('0xa'));var ejs=require(_0x88c3('0xb'));var fs=require('fs');var _=require(_0x88c3('0xc'));var squel=require(_0x88c3('0xd'));var crypto=require('crypto');var jsforce=require(_0x88c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x88c3('0xa'));var querystring=require('querystring');var Papa=require(_0x88c3('0xf'));var Redis=require('ioredis');var authService=require(_0x88c3('0x10'));var qs=require(_0x88c3('0x11'));var as=require(_0x88c3('0x12'));var hardwareService=require(_0x88c3('0x13'));var logger=require('../../config/logger')(_0x88c3('0x14'));var utils=require(_0x88c3('0x15'));var config=require(_0x88c3('0x16'));var db=require('../../mysqldb')['db'];config[_0x88c3('0x17')]=_['defaults'](config['redis'],{'host':_0x88c3('0x18'),'port':0x18eb});var socket=require(_0x88c3('0x19'))(new Redis(config[_0x88c3('0x17')]));require(_0x88c3('0x1a'))[_0x88c3('0x1b')](socket);function respondWithStatusCode(_0x524f2a,_0x3620e3){_0x3620e3=_0x3620e3||0xcc;return function(_0x3a282c){if(_0x3a282c){return _0x524f2a[_0x88c3('0x1c')](_0x3620e3);}return _0x524f2a[_0x88c3('0x1d')](_0x3620e3)['end']();};}function respondWithResult(_0x3128ac,_0x5e105f){_0x5e105f=_0x5e105f||0xc8;return function(_0x3a8345){if(_0x3a8345){return _0x3128ac[_0x88c3('0x1d')](_0x5e105f)[_0x88c3('0x1e')](_0x3a8345);}};}function respondWithFilteredResult(_0x17ea73,_0x53debd){return function(_0x4c6749){if(_0x4c6749){var _0x3b8d75=_0x4c6749[_0x88c3('0x1f')],_0x16ee57=_0x53debd[_0x88c3('0x20')],_0x2ecca1=_0x53debd[_0x88c3('0x20')]+_0x53debd[_0x88c3('0x21')],_0x594394;if(_0x2ecca1>=_0x3b8d75){_0x2ecca1=_0x3b8d75;_0x594394=0xc8;}else{_0x594394=0xce;}_0x17ea73['status'](_0x594394);return _0x17ea73['set'](_0x88c3('0x22'),_0x16ee57+'-'+_0x2ecca1+'/'+_0x3b8d75)['json'](_0x4c6749);}return null;};}function patchUpdates(_0x5302d1){return function(_0x2c5cb3){try{jsonpatch[_0x88c3('0x23')](_0x2c5cb3,_0x5302d1,!![]);}catch(_0x3666a2){return BPromise[_0x88c3('0x24')](_0x3666a2);}return _0x2c5cb3[_0x88c3('0x25')]();};}function saveUpdates(_0x3e01cc,_0x226077){return function(_0x43a933){if(_0x43a933){return _0x43a933[_0x88c3('0x26')](_0x3e01cc)[_0x88c3('0x27')](function(_0x173a97){return _0x173a97;});}return null;};}function removeEntity(_0x24b867,_0x5aa804){return function(_0x2988cd){if(_0x2988cd){return _0x2988cd['destroy']()[_0x88c3('0x27')](function(){var _0xde936d=_0x2988cd[_0x88c3('0x28')]({'plain':!![]});var _0x5ef07f=_0x88c3('0x29');return db[_0x88c3('0x2a')][_0x88c3('0x2b')]({'where':{'type':_0x5ef07f,'resourceId':_0xde936d['id']}})[_0x88c3('0x27')](function(){return _0x2988cd;});})[_0x88c3('0x27')](function(){_0x24b867[_0x88c3('0x1d')](0xcc)[_0x88c3('0x2c')]();});}};}function handleEntityNotFound(_0x454372,_0x193e2d){return function(_0x2072ce){if(!_0x2072ce){_0x454372[_0x88c3('0x1c')](0x194);}return _0x2072ce;};}function handleError(_0x2607ec,_0x3d8c32){_0x3d8c32=_0x3d8c32||0x1f4;return function(_0x50aefc){logger[_0x88c3('0x2d')](_0x50aefc[_0x88c3('0x2e')]);if(_0x50aefc[_0x88c3('0x2f')]){delete _0x50aefc[_0x88c3('0x2f')];}_0x2607ec[_0x88c3('0x1d')](_0x3d8c32)[_0x88c3('0x30')](_0x50aefc);};}exports[_0x88c3('0x31')]=function(_0x5337e8,_0x1d5341){var _0x17abfe={},_0xd00aa7={},_0x5a76f5={'count':0x0,'rows':[]};var _0x48cf6e=_[_0x88c3('0x32')](db['Dashboard'][_0x88c3('0x33')],function(_0x39e4ec){return{'name':_0x39e4ec[_0x88c3('0x34')],'type':_0x39e4ec['type'][_0x88c3('0x35')]};});_0xd00aa7[_0x88c3('0x36')]=_['map'](_0x48cf6e,_0x88c3('0x2f'));_0xd00aa7[_0x88c3('0x37')]=_['keys'](_0x5337e8[_0x88c3('0x37')]);_0xd00aa7['filters']=_['intersection'](_0xd00aa7[_0x88c3('0x36')],_0xd00aa7[_0x88c3('0x37')]);_0x17abfe['attributes']=_['intersection'](_0xd00aa7[_0x88c3('0x36')],qs[_0x88c3('0x38')](_0x5337e8[_0x88c3('0x37')]['fields']));_0x17abfe[_0x88c3('0x39')]=_0x17abfe[_0x88c3('0x39')][_0x88c3('0x3a')]?_0x17abfe[_0x88c3('0x39')]:_0xd00aa7[_0x88c3('0x36')];if(!_0x5337e8[_0x88c3('0x37')][_0x88c3('0x3b')](_0x88c3('0x3c'))){_0x17abfe['limit']=qs[_0x88c3('0x21')](_0x5337e8[_0x88c3('0x37')][_0x88c3('0x21')]);_0x17abfe[_0x88c3('0x20')]=qs[_0x88c3('0x20')](_0x5337e8[_0x88c3('0x37')][_0x88c3('0x20')]);}_0x17abfe['order']=qs[_0x88c3('0x3d')](_0x5337e8[_0x88c3('0x37')][_0x88c3('0x3d')]);_0x17abfe['where']=qs[_0x88c3('0x3e')](_[_0x88c3('0x3f')](_0x5337e8[_0x88c3('0x37')],_0xd00aa7[_0x88c3('0x3e')]));if(_0x5337e8[_0x88c3('0x37')][_0x88c3('0x40')]){_0x17abfe[_0x88c3('0x41')]=_['merge'](_0x17abfe[_0x88c3('0x41')],{'$or':_[_0x88c3('0x32')](_0x48cf6e,function(_0x1a9ad6){if(_0x1a9ad6['type']!==_0x88c3('0x42')){var _0xec35d3={};_0xec35d3[_0x1a9ad6[_0x88c3('0x2f')]]={'$like':'%'+_0x5337e8[_0x88c3('0x37')]['filter']+'%'};return _0xec35d3;}})});}_0x17abfe=_['merge']({},_0x17abfe,_0x5337e8[_0x88c3('0x43')]);var _0x510c86={'where':_0x17abfe[_0x88c3('0x41')]};return db['Dashboard'][_0x88c3('0x1f')](_0x510c86)['then'](function(_0x4c8a19){_0x5a76f5[_0x88c3('0x1f')]=_0x4c8a19;if(_0x5337e8[_0x88c3('0x37')][_0x88c3('0x44')]){_0x17abfe[_0x88c3('0x45')]=[{'all':!![]}];}return db[_0x88c3('0x46')][_0x88c3('0x47')](_0x17abfe);})[_0x88c3('0x27')](function(_0x48620d){_0x5a76f5['rows']=_0x48620d;return _0x5a76f5;})[_0x88c3('0x27')](respondWithFilteredResult(_0x1d5341,_0x17abfe))[_0x88c3('0x48')](handleError(_0x1d5341,null));};exports[_0x88c3('0x49')]=function(_0x1beb18,_0xe02aee){var _0x5e7977={'raw':![],'where':{'id':_0x1beb18[_0x88c3('0x4a')]['id']}},_0xe22bd5={};_0xe22bd5[_0x88c3('0x36')]=_[_0x88c3('0x4b')](db[_0x88c3('0x46')][_0x88c3('0x33')]);_0xe22bd5['query']=_[_0x88c3('0x4b')](_0x1beb18[_0x88c3('0x37')]);_0xe22bd5[_0x88c3('0x3e')]=_[_0x88c3('0x4c')](_0xe22bd5['model'],_0xe22bd5[_0x88c3('0x37')]);_0x5e7977['attributes']=_[_0x88c3('0x4c')](_0xe22bd5[_0x88c3('0x36')],qs['fields'](_0x1beb18[_0x88c3('0x37')][_0x88c3('0x38')]));_0x5e7977[_0x88c3('0x39')]=_0x5e7977[_0x88c3('0x39')][_0x88c3('0x3a')]?_0x5e7977[_0x88c3('0x39')]:_0xe22bd5[_0x88c3('0x36')];if(_0x1beb18['query'][_0x88c3('0x44')]){_0x5e7977['include']=[{'all':!![]}];}_0x5e7977=_['merge']({},_0x5e7977,_0x1beb18[_0x88c3('0x43')]);return db[_0x88c3('0x46')][_0x88c3('0x4d')](_0x5e7977)[_0x88c3('0x27')](handleEntityNotFound(_0xe02aee,null))[_0x88c3('0x27')](respondWithResult(_0xe02aee,null))[_0x88c3('0x48')](handleError(_0xe02aee,null));};exports['create']=function(_0x38afd2,_0x5d0973){return db[_0x88c3('0x46')][_0x88c3('0x4e')](_0x38afd2[_0x88c3('0x4f')],{})['then'](function(_0x44683b){var _0x134a5b=_0x38afd2['user'][_0x88c3('0x28')]({'plain':!![]});if(!_0x134a5b)throw new Error(_0x88c3('0x50'));if(_0x134a5b['role']==='user'){var _0x178dd2=_0x44683b[_0x88c3('0x28')]({'plain':!![]});var _0x48b099='CustomDashboards';return db['UserProfileSection'][_0x88c3('0x4d')]({'where':{'name':_0x48b099,'userProfileId':_0x134a5b[_0x88c3('0x51')]},'raw':!![]})[_0x88c3('0x27')](function(_0x3d16cf){if(_0x3d16cf&&_0x3d16cf[_0x88c3('0x52')]===0x0){return db[_0x88c3('0x2a')][_0x88c3('0x4e')]({'name':_0x178dd2[_0x88c3('0x2f')],'resourceId':_0x178dd2['id'],'type':_0x3d16cf[_0x88c3('0x2f')],'sectionId':_0x3d16cf['id']},{})[_0x88c3('0x27')](function(){return _0x44683b;});}else{return _0x44683b;}})[_0x88c3('0x48')](function(_0x43759f){logger['error'](_0x88c3('0x53'),_0x43759f);throw _0x43759f;});}return _0x44683b;})['then'](respondWithResult(_0x5d0973,0xc9))[_0x88c3('0x48')](handleError(_0x5d0973,null));};exports[_0x88c3('0x54')]=function(_0x1f553d,_0x70e5e2){var _0x1a6aaa={'where':{'id':_0x1f553d['params']['id']}},_0x174307={};_0x174307[_0x88c3('0x36')]=_[_0x88c3('0x4b')](db[_0x88c3('0x46')][_0x88c3('0x33')]);_0x1a6aaa['attributes']=_[_0x88c3('0x4c')](_0x174307[_0x88c3('0x36')],qs['fields'](_0x1f553d[_0x88c3('0x37')]['fields']));_0x1a6aaa[_0x88c3('0x39')]=_0x1a6aaa[_0x88c3('0x39')][_0x88c3('0x3a')]?_0x1a6aaa['attributes']:_0x174307[_0x88c3('0x36')];if(_0x1f553d[_0x88c3('0x37')]['includeAll']){_0x1a6aaa[_0x88c3('0x45')]=[{'all':!![]}];}_0x1a6aaa=_[_0x88c3('0x55')]({},_0x1a6aaa,_0x1f553d[_0x88c3('0x43')]);return db[_0x88c3('0x46')][_0x88c3('0x4d')](_0x1a6aaa)[_0x88c3('0x27')](handleEntityNotFound(_0x70e5e2,null))[_0x88c3('0x27')](function(_0xbb0994){if(_0xbb0994){var _0x151cec=_0xbb0994[_0x88c3('0x28')]({'plain':!![]});_0x151cec=qs['omit'](_0x151cec,['id',_0x88c3('0x56'),_0x88c3('0x57')]);_0x1f553d['body']=_[_0x88c3('0x58')](_0x1f553d[_0x88c3('0x4f')],['id',_0x88c3('0x56'),'updatedAt']);return db[_0x88c3('0x46')][_0x88c3('0x4e')](_[_0x88c3('0x55')](_0x151cec,_0x1f553d[_0x88c3('0x4f')]),{'include':_0x1f553d[_0x88c3('0x37')][_0x88c3('0x44')]?[{'all':!![]}]:undefined})[_0x88c3('0x27')](function(_0x1c0d2e){var _0x425f05=_0x1f553d[_0x88c3('0x59')][_0x88c3('0x28')]({'plain':!![]});if(!_0x425f05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x425f05[_0x88c3('0x5a')]===_0x88c3('0x59')){var _0x1707d5=_0x1c0d2e[_0x88c3('0x28')]({'plain':!![]});var _0x302b1f='CustomDashboards';return db[_0x88c3('0x5b')][_0x88c3('0x4d')]({'where':{'name':_0x302b1f,'userProfileId':_0x425f05['userProfileId']},'raw':!![]})[_0x88c3('0x27')](function(_0x199b93){if(_0x199b93&&_0x199b93[_0x88c3('0x52')]===0x0){return db[_0x88c3('0x2a')][_0x88c3('0x4e')]({'name':_0x1707d5['name'],'resourceId':_0x1707d5['id'],'type':_0x199b93[_0x88c3('0x2f')],'sectionId':_0x199b93['id']},{})['then'](function(){return _0x1c0d2e;});}else{return _0x1c0d2e;}})['catch'](function(_0x174136){logger[_0x88c3('0x2d')](_0x88c3('0x53'),_0x174136);throw _0x174136;});}return _0x1c0d2e;});}})[_0x88c3('0x27')](respondWithResult(_0x70e5e2,0xc9))[_0x88c3('0x48')](handleError(_0x70e5e2,null));};exports[_0x88c3('0x26')]=function(_0x5e07ae,_0x18580b){if(_0x5e07ae[_0x88c3('0x4f')]['id']){delete _0x5e07ae['body']['id'];}return db[_0x88c3('0x46')]['find']({'where':{'id':_0x5e07ae[_0x88c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x18580b,null))[_0x88c3('0x27')](saveUpdates(_0x5e07ae[_0x88c3('0x4f')],null))['then'](respondWithResult(_0x18580b,null))[_0x88c3('0x48')](handleError(_0x18580b,null));};exports[_0x88c3('0x2b')]=function(_0x1b5a7c,_0x2ff031){return db[_0x88c3('0x46')][_0x88c3('0x4d')]({'where':{'id':_0x1b5a7c[_0x88c3('0x4a')]['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0x2ff031,null))[_0x88c3('0x27')](removeEntity(_0x2ff031,null))[_0x88c3('0x48')](handleError(_0x2ff031,null));};function widgetAttributes(_0xe04a22){try{switch(_0xe04a22[_0x88c3('0x5c')]){case _0x88c3('0x5d'):return[{'name':_0x88c3('0x5e'),'value':_0xe04a22[_0x88c3('0x5e')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x0]?_0xe04a22[_0x88c3('0x5f')][0x0][_0x88c3('0x60')]:undefined)||_0x88c3('0x61')}];case _0x88c3('0x62'):return[{'name':_0x88c3('0x63'),'value':_0xe04a22['attrPath']||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22['attrs'][0x0]?_0xe04a22[_0x88c3('0x5f')][0x0][_0x88c3('0x60')]:undefined)||''}];case _0x88c3('0x64'):return[{'name':'attrHourFormat','value':_0xe04a22[_0x88c3('0x65')]||(_0xe04a22['attrs']&&_0xe04a22['attrs'][0x0]?_0xe04a22['attrs'][0x0][_0x88c3('0x60')]:undefined)||_0x88c3('0x66')},{'name':_0x88c3('0x67'),'value':_0xe04a22[_0x88c3('0x67')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22['attrs'][0x1]?_0xe04a22[_0x88c3('0x5f')][0x1][_0x88c3('0x60')]:undefined)||'0.00'},{'name':_0x88c3('0x68'),'value':_0xe04a22['attrFontSize']||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x2]?_0xe04a22['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x88c3('0x69'),'value':_0xe04a22['attrMetric']||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x0]?_0xe04a22[_0x88c3('0x5f')][0x0][_0x88c3('0x60')]:undefined)||_0x88c3('0x6a')},{'name':'attrVoiceQueues','value':_0xe04a22[_0x88c3('0x6b')]||(_0xe04a22['attrs']&&_0xe04a22[_0x88c3('0x5f')][0x1]?_0xe04a22['attrs'][0x1][_0x88c3('0x60')]:undefined)||[]},{'name':_0x88c3('0x68'),'value':_0xe04a22[_0x88c3('0x68')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x2]?_0xe04a22[_0x88c3('0x5f')][0x2][_0x88c3('0x60')]:undefined)||0x14}];case'multibar-chart':case _0x88c3('0x6c'):return[{'name':'attrSerie1','value':_0xe04a22[_0x88c3('0x6d')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22['attrs'][0x0]?_0xe04a22['attrs'][0x0][_0x88c3('0x60')]:undefined)||'total'},{'name':_0x88c3('0x6e'),'value':_0xe04a22[_0x88c3('0x6e')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x1]?_0xe04a22[_0x88c3('0x5f')][0x1][_0x88c3('0x60')]:undefined)||null},{'name':_0x88c3('0x6f'),'value':_0xe04a22['attrSerie3']||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x2]?_0xe04a22['attrs'][0x2]['value']:undefined)||null},{'name':_0x88c3('0x6b'),'value':_0xe04a22['attrVoiceQueues']||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x3]?_0xe04a22[_0x88c3('0x5f')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x88c3('0x70'),'type':_0xe04a22[_0x88c3('0x71')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x0]?_0xe04a22[_0x88c3('0x5f')][0x0][_0x88c3('0x5c')]:undefined)||null,'value':_0xe04a22[_0x88c3('0x70')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x0]?_0xe04a22[_0x88c3('0x5f')][0x0][_0x88c3('0x60')]:undefined)||null},{'name':_0x88c3('0x72'),'value':_0xe04a22[_0x88c3('0x72')]||(_0xe04a22[_0x88c3('0x5f')]&&_0xe04a22[_0x88c3('0x5f')][0x1]?_0xe04a22[_0x88c3('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x380f2f){logger[_0x88c3('0x2d')](_0x88c3('0x73'),JSON['stringify'](_0x380f2f));return[];}}exports[_0x88c3('0x74')]=function(_0x527f6d,_0x1b4e29,_0x1f0308){if(_0x527f6d[_0x88c3('0x4f')]['id']){delete _0x527f6d[_0x88c3('0x4f')]['id'];}return db[_0x88c3('0x46')][_0x88c3('0x4d')]({'where':{'id':_0x527f6d['params']['id']}})['then'](handleEntityNotFound(_0x1b4e29,null))['then'](function(_0x3531e5){if(_0x3531e5){_0x527f6d[_0x88c3('0x4f')]['DashboardId']=_0x3531e5['id'];_0x527f6d[_0x88c3('0x4f')]['attrs']=widgetAttributes(_0x527f6d[_0x88c3('0x4f')]);return db['DashboardItem']['create'](_0x527f6d[_0x88c3('0x4f')]);}})[_0x88c3('0x27')](respondWithResult(_0x1b4e29,null))['catch'](handleError(_0x1b4e29,null));};exports[_0x88c3('0x75')]=function(_0xb19f8e,_0xc8b351,_0x40d8ca){var _0x531814={};var _0x416bc9={};var _0x1d23db;var _0x1dc8b0;return db[_0x88c3('0x46')][_0x88c3('0x76')]({'where':{'id':_0xb19f8e[_0x88c3('0x4a')]['id']}})[_0x88c3('0x27')](handleEntityNotFound(_0xc8b351,null))[_0x88c3('0x27')](function(_0x450478){if(_0x450478){_0x1d23db=_0x450478;_0x416bc9[_0x88c3('0x36')]=_[_0x88c3('0x4b')](db[_0x88c3('0x77')][_0x88c3('0x33')]);_0x416bc9[_0x88c3('0x37')]=_[_0x88c3('0x4b')](_0xb19f8e['query']);_0x416bc9[_0x88c3('0x3e')]=_[_0x88c3('0x4c')](_0x416bc9[_0x88c3('0x36')],_0x416bc9['query']);_0x531814[_0x88c3('0x39')]=_[_0x88c3('0x4c')](_0x416bc9['model'],qs['fields'](_0xb19f8e['query']['fields']));_0x531814['attributes']=_0x531814[_0x88c3('0x39')][_0x88c3('0x3a')]?_0x531814[_0x88c3('0x39')]:_0x416bc9['model'];_0x531814[_0x88c3('0x78')]=qs[_0x88c3('0x3d')](_0xb19f8e['query'][_0x88c3('0x3d')]);_0x531814[_0x88c3('0x41')]=qs[_0x88c3('0x3e')](_['pick'](_0xb19f8e[_0x88c3('0x37')],_0x416bc9[_0x88c3('0x3e')]));if(_0xb19f8e['query'][_0x88c3('0x40')]){_0x531814[_0x88c3('0x41')]=_[_0x88c3('0x55')](_0x531814[_0x88c3('0x41')],{'$or':_[_0x88c3('0x32')](_0x531814[_0x88c3('0x39')],function(_0x2ada4c){var _0x1f85e0={};_0x1f85e0[_0x2ada4c]={'$like':'%'+_0xb19f8e[_0x88c3('0x37')]['filter']+'%'};return _0x1f85e0;})});}_0x531814=_[_0x88c3('0x55')]({},_0x531814,_0xb19f8e[_0x88c3('0x43')]);return _0x1d23db[_0x88c3('0x75')](_0x531814);}})['then'](function(_0x35132a){if(_0x35132a){_0x1dc8b0=_0x35132a[_0x88c3('0x3a')];if(!_0xb19f8e[_0x88c3('0x37')][_0x88c3('0x3b')]('nolimit')){_0x531814[_0x88c3('0x21')]=qs[_0x88c3('0x21')](_0xb19f8e[_0x88c3('0x37')][_0x88c3('0x21')]);_0x531814[_0x88c3('0x20')]=qs[_0x88c3('0x20')](_0xb19f8e[_0x88c3('0x37')]['offset']);}return _0x1d23db[_0x88c3('0x75')](_0x531814);}})[_0x88c3('0x27')](function(_0x10c6b5){if(_0x10c6b5){return _0x10c6b5?{'count':_0x1dc8b0,'rows':_0x10c6b5}:null;}})['then'](respondWithResult(_0xc8b351,null))['catch'](handleError(_0xc8b351,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index d7b2a02..4663000 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 _0xac6f=['Dashboard','save','remove','emit','hook','events','../../mysqldb'];(function(_0x47588e,_0x2f64e7){var _0x2b8248=function(_0x406465){while(--_0x406465){_0x47588e['push'](_0x47588e['shift']());}};_0x2b8248(++_0x2f64e7);}(_0xac6f,0x19b));var _0xfac6=function(_0x423f6a,_0x2b2377){_0x423f6a=_0x423f6a-0x0;var _0x174dba=_0xac6f[_0x423f6a];return _0x174dba;};'use strict';var EventEmitter=require(_0xfac6('0x0'));var Dashboard=require(_0xfac6('0x1'))['db'][_0xfac6('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfac6('0x3'),'afterUpdate':'update','afterDestroy':_0xfac6('0x4')};function emitEvent(_0x33e79c){return function(_0x21a33a,_0x16bb94,_0x33a3cb){DashboardEvents[_0xfac6('0x5')](_0x33e79c+':'+_0x21a33a['id'],_0x21a33a);DashboardEvents['emit'](_0x33e79c,_0x21a33a);_0x33a3cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xfac6('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xc190=['remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x56dcbc,_0x37a4d2){var _0x5853fe=function(_0x4459ef){while(--_0x4459ef){_0x56dcbc['push'](_0x56dcbc['shift']());}};_0x5853fe(++_0x37a4d2);}(_0xc190,0x148));var _0x0c19=function(_0x2c2b26,_0x29e6d4){_0x2c2b26=_0x2c2b26-0x0;var _0x35b7e4=_0xc190[_0x2c2b26];return _0x35b7e4;};'use strict';var EventEmitter=require(_0x0c19('0x0'));var Dashboard=require(_0x0c19('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0c19('0x2')};function emitEvent(_0x572220){return function(_0x4e5cc8,_0x186f04,_0x399a49){DashboardEvents['emit'](_0x572220+':'+_0x4e5cc8['id'],_0x4e5cc8);DashboardEvents[_0x0c19('0x3')](_0x572220,_0x4e5cc8);_0x399a49(null);};}for(var e in events){if(events[_0x0c19('0x4')](e)){var event=events[e];Dashboard[_0x0c19('0x5')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 26f51e8..83c97f8 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 _0x990d=['./dashboard.attributes','Dashboard','dashboards','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x285c18,_0x22bccb){var _0xbde690=function(_0x3d096f){while(--_0x3d096f){_0x285c18['push'](_0x285c18['shift']());}};_0xbde690(++_0x22bccb);}(_0x990d,0x186));var _0xd990=function(_0x2bbe84,_0x27e011){_0x2bbe84=_0x2bbe84-0x0;var _0x5467bd=_0x990d[_0x2bbe84];return _0x5467bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd990('0x0'))(_0xd990('0x1'));var moment=require(_0xd990('0x2'));var BPromise=require(_0xd990('0x3'));var rp=require(_0xd990('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd990('0x5'));var attributes=require(_0xd990('0x6'));module['exports']=function(_0x173c61,_0x4a1463){return _0x173c61['define'](_0xd990('0x7'),attributes,{'tableName':_0xd990('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc424=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','api','bluebird','request-promise','path'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc424,0xc7));var _0x4c42=function(_0x3be099,_0x1a28f5){_0x3be099=_0x3be099-0x0;var _0x4a67ea=_0xc424[_0x3be099];return _0x4a67ea;};'use strict';var _=require(_0x4c42('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4c42('0x1'));var moment=require('moment');var BPromise=require(_0x4c42('0x2'));var rp=require(_0x4c42('0x3'));var fs=require('fs');var path=require(_0x4c42('0x4'));var rimraf=require(_0x4c42('0x5'));var config=require(_0x4c42('0x6'));var attributes=require(_0x4c42('0x7'));module[_0x4c42('0x8')]=function(_0x9eefb8,_0x5467d7){return _0x9eefb8[_0x4c42('0x9')](_0x4c42('0xa'),attributes,{'tableName':_0x4c42('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 d963d36..2ff0057 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 _0xd481=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','request','info'];(function(_0xe247f6,_0x317a18){var _0x34cd8d=function(_0x249cf9){while(--_0x249cf9){_0xe247f6['push'](_0xe247f6['shift']());}};_0x34cd8d(++_0x317a18);}(_0xd481,0x197));var _0x1d48=function(_0xff0338,_0x468c81){_0xff0338=_0xff0338-0x0;var _0x3b8de3=_0xd481[_0xff0338];return _0x3b8de3;};'use strict';var _=require('lodash');var util=require(_0x1d48('0x0'));var moment=require(_0x1d48('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d48('0x2'));var fs=require('fs');var Redis=require(_0x1d48('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d48('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1d48('0x5'));var client=jayson[_0x1d48('0x6')][_0x1d48('0x7')]({'port':0x232a});config[_0x1d48('0x8')]=_[_0x1d48('0x9')](config['redis'],{'host':_0x1d48('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x349f55,_0xb38ab7,_0x387bb2){return new BPromise(function(_0x4d8a92,_0x3053aa){return client[_0x1d48('0xb')](_0x349f55,_0x387bb2)['then'](function(_0x56562c){logger[_0x1d48('0xc')](_0x1d48('0xd'),_0xb38ab7,_0x1d48('0xe'));logger[_0x1d48('0xf')](_0x1d48('0x10'),_0xb38ab7,_0x1d48('0xe'),JSON['stringify'](_0x56562c));if(_0x56562c[_0x1d48('0x11')]){if(_0x56562c[_0x1d48('0x11')]['code']===0x1f4){logger[_0x1d48('0x11')](_0x1d48('0xd'),_0xb38ab7,_0x56562c[_0x1d48('0x11')]['message']);return _0x3053aa(_0x56562c[_0x1d48('0x11')]['message']);}logger[_0x1d48('0x11')](_0x1d48('0xd'),_0xb38ab7,_0x56562c[_0x1d48('0x11')]['message']);return _0x4d8a92(_0x56562c[_0x1d48('0x11')][_0x1d48('0x12')]);}else{logger['info'](_0x1d48('0xd'),_0xb38ab7,_0x1d48('0xe'));_0x4d8a92(_0x56562c[_0x1d48('0x13')][_0x1d48('0x12')]);}})[_0x1d48('0x14')](function(_0x34b34a){logger[_0x1d48('0x11')]('Dashboard,\x20%s,\x20%s',_0xb38ab7,_0x34b34a);_0x3053aa(_0x34b34a);});});} \ No newline at end of file +var _0xe5e5=['./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xefebd8,_0x1d95b9){var _0x1b08e3=function(_0x17fcff){while(--_0x17fcff){_0xefebd8['push'](_0xefebd8['shift']());}};_0x1b08e3(++_0x1d95b9);}(_0xe5e5,0x7c));var _0x5e5e=function(_0x3ca002,_0x2f26f4){_0x3ca002=_0x3ca002-0x0;var _0x71b966=_0xe5e5[_0x3ca002];return _0x71b966;};'use strict';var _=require(_0x5e5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e5e('0x1'));var rs=require(_0x5e5e('0x2'));var fs=require('fs');var Redis=require(_0x5e5e('0x3'));var db=require(_0x5e5e('0x4'))['db'];var utils=require(_0x5e5e('0x5'));var logger=require(_0x5e5e('0x6'))(_0x5e5e('0x7'));var config=require(_0x5e5e('0x8'));var jayson=require(_0x5e5e('0x9'));var client=jayson[_0x5e5e('0xa')][_0x5e5e('0xb')]({'port':0x232a});config[_0x5e5e('0xc')]=_[_0x5e5e('0xd')](config['redis'],{'host':_0x5e5e('0xe'),'port':0x18eb});var socket=require(_0x5e5e('0xf'))(new Redis(config[_0x5e5e('0xc')]));require(_0x5e5e('0x10'))['register'](socket);function respondWithRpcPromise(_0x1fb15e,_0x32d40e,_0x3c5bf3){return new BPromise(function(_0x3ce3a1,_0x43a3f5){return client['request'](_0x1fb15e,_0x3c5bf3)[_0x5e5e('0x11')](function(_0x314843){logger[_0x5e5e('0x12')](_0x5e5e('0x13'),_0x32d40e,_0x5e5e('0x14'));logger['debug'](_0x5e5e('0x15'),_0x32d40e,_0x5e5e('0x14'),JSON[_0x5e5e('0x16')](_0x314843));if(_0x314843[_0x5e5e('0x17')]){if(_0x314843[_0x5e5e('0x17')][_0x5e5e('0x18')]===0x1f4){logger[_0x5e5e('0x17')](_0x5e5e('0x13'),_0x32d40e,_0x314843[_0x5e5e('0x17')][_0x5e5e('0x19')]);return _0x43a3f5(_0x314843[_0x5e5e('0x17')][_0x5e5e('0x19')]);}logger[_0x5e5e('0x17')](_0x5e5e('0x13'),_0x32d40e,_0x314843['error']['message']);return _0x3ce3a1(_0x314843[_0x5e5e('0x17')][_0x5e5e('0x19')]);}else{logger[_0x5e5e('0x12')](_0x5e5e('0x13'),_0x32d40e,_0x5e5e('0x14'));_0x3ce3a1(_0x314843[_0x5e5e('0x1a')]['message']);}})[_0x5e5e('0x1b')](function(_0x408187){logger[_0x5e5e('0x17')](_0x5e5e('0x13'),_0x32d40e,_0x408187);_0x43a3f5(_0x408187);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 66e4d62..56367df 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 _0x06b5=['update','removeListener','register','length','dashboard:','save','remove'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0x06b5,0xc9));var _0x506b=function(_0x1bb950,_0x453e89){_0x1bb950=_0x1bb950-0x0;var _0x2bef7b=_0x06b5[_0x1bb950];return _0x2bef7b;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x506b('0x0'),_0x506b('0x1'),_0x506b('0x2')];function createListener(_0x53ab5c,_0x2e6226){return function(_0x518249){_0x2e6226['emit'](_0x53ab5c,_0x518249);};}function removeListener(_0x46f311,_0x3aeaa7){return function(){DashboardEvents[_0x506b('0x3')](_0x46f311,_0x3aeaa7);};}exports[_0x506b('0x4')]=function(_0x9b6627){for(var _0x2b09a9=0x0,_0x591254=events[_0x506b('0x5')];_0x2b09a9<_0x591254;_0x2b09a9++){var _0x3f7adf=events[_0x2b09a9];var _0x2bb1ca=createListener(_0x506b('0x6')+_0x3f7adf,_0x9b6627);DashboardEvents['on'](_0x3f7adf,_0x2bb1ca);}}; \ No newline at end of file +var _0xcf8c=['removeListener','register','length','dashboard:','save','remove','update','emit'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xcf8c,0x1a4));var _0xccf8=function(_0x387dc0,_0x246d75){_0x387dc0=_0x387dc0-0x0;var _0x21be11=_0xcf8c[_0x387dc0];return _0x21be11;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xccf8('0x0'),_0xccf8('0x1'),_0xccf8('0x2')];function createListener(_0x5c69b6,_0x4ac1e1){return function(_0x393073){_0x4ac1e1[_0xccf8('0x3')](_0x5c69b6,_0x393073);};}function removeListener(_0x2b47e2,_0x43cb18){return function(){DashboardEvents[_0xccf8('0x4')](_0x2b47e2,_0x43cb18);};}exports[_0xccf8('0x5')]=function(_0x53183){for(var _0x4f6ad8=0x0,_0x1c9e02=events[_0xccf8('0x6')];_0x4f6ad8<_0x1c9e02;_0x4f6ad8++){var _0x313168=events[_0x4f6ad8];var _0x480c49=createListener(_0xccf8('0x7')+_0x313168,_0x53183);DashboardEvents['on'](_0x313168,_0x480c49);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 5d7609f..1540913 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 _0x70e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/items','isAuthenticated','getItems','post','/:id/clone','clone','addItem','put','/:id','update','multer'];(function(_0x7bedac,_0x348875){var _0x725e21=function(_0x2b88d3){while(--_0x2b88d3){_0x7bedac['push'](_0x7bedac['shift']());}};_0x725e21(++_0x348875);}(_0x70e0,0x17b));var _0x070e=function(_0xd609f6,_0x1de9c1){_0xd609f6=_0xd609f6-0x0;var _0x481350=_0x70e0[_0xd609f6];return _0x481350;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./dashboard.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth[_0x070e('0xb')](),controller['create']);router['post'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0xd')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0x12'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);router['delete']('/:id',auth[_0x070e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','express','Router'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xe706,0xa3));var _0x6e70=function(_0x447af3,_0x381c44){_0x447af3=_0x447af3-0x0;var _0x202e95=_0xe706[_0x447af3];return _0x202e95;};'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('0x10')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x10')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['post']('/:id/items',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index d0d1ff7..544e8e7 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 _0x2a3b=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','exports','STRING','TEXT','long','parse','getDataValue'];(function(_0x13ba6c,_0x216f21){var _0x15580d=function(_0x551477){while(--_0x551477){_0x13ba6c['push'](_0x13ba6c['shift']());}};_0x15580d(++_0x216f21);}(_0x2a3b,0xd8));var _0xb2a3=function(_0x29ea73,_0xbdd474){_0x29ea73=_0x29ea73-0x0;var _0xd4d6d8=_0x2a3b[_0x29ea73];return _0xd4d6d8;};'use strict';var Sequelize=require(_0xb2a3('0x0'));var squel=require(_0xb2a3('0x1'));var _=require('lodash');module[_0xb2a3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb2a3('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb2a3('0x4')](_0xb2a3('0x5')),'get':function(){try{return JSON[_0xb2a3('0x6')](this[_0xb2a3('0x7')](_0xb2a3('0x8')));}catch(_0x4bad1d){return[];}},'set':function(_0x8891c6){try{this[_0xb2a3('0x9')](_0xb2a3('0x8'),JSON[_0xb2a3('0xa')](_0x8891c6));}catch(_0x35c7aa){this[_0xb2a3('0x9')](_0xb2a3('0x8'),JSON[_0xb2a3('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0xb2a3('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb2a3('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb2a3('0xb')]},'col':{'type':Sequelize[_0xb2a3('0xb')]},'background':{'type':Sequelize[_0xb2a3('0x3')],'allowNull':![],'defaultValue':_0xb2a3('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb2a3('0x3')],'allowNull':![],'defaultValue':_0xb2a3('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb2a3('0x3')]}}; \ No newline at end of file +var _0x74b3=['exports','STRING','TEXT','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','lodash'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x74b3,0x15d));var _0x374b=function(_0x9f6122,_0x4c3406){_0x9f6122=_0x9f6122-0x0;var _0xb1c12b=_0x74b3[_0x9f6122];return _0xb1c12b;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x374b('0x0'));module[_0x374b('0x1')]={'title':{'type':Sequelize[_0x374b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x374b('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x374b('0x3')]('long'),'get':function(){try{return JSON[_0x374b('0x4')](this['getDataValue'](_0x374b('0x5')));}catch(_0x36eb1a){return[];}},'set':function(_0x577e19){try{this[_0x374b('0x6')](_0x374b('0x5'),JSON[_0x374b('0x7')](_0x577e19));}catch(_0x517155){this[_0x374b('0x6')](_0x374b('0x5'),JSON[_0x374b('0x7')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x374b('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x374b('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x374b('0x2')],'allowNull':![],'defaultValue':_0x374b('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x374b('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x374b('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 0e884de..2b6e1e4 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 _0x1dd3=['HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','attrRefresh','stringify','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','attributes','fields','length','model','includeAll','include','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat'];(function(_0x2a6ec9,_0xaecea3){var _0xe55478=function(_0x582b10){while(--_0x582b10){_0x2a6ec9['push'](_0x2a6ec9['shift']());}};_0xe55478(++_0xaecea3);}(_0x1dd3,0x17e));var _0x31dd=function(_0x3ad6bd,_0x4aef2c){_0x3ad6bd=_0x3ad6bd-0x0;var _0x27f188=_0x1dd3[_0x3ad6bd];return _0x27f188;};'use strict';var pdf=require(_0x31dd('0x0'));var emlformat=require(_0x31dd('0x1'));var rimraf=require(_0x31dd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31dd('0x3'));var rp=require(_0x31dd('0x4'));var moment=require(_0x31dd('0x5'));var BPromise=require(_0x31dd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x31dd('0x7'));var sox=require('sox');var csv=require(_0x31dd('0x8'));var ejs=require(_0x31dd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x31dd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x31dd('0xb'));var toCsv=require('to-csv');var querystring=require(_0x31dd('0xc'));var Papa=require('papaparse');var Redis=require(_0x31dd('0xd'));var authService=require(_0x31dd('0xe'));var qs=require(_0x31dd('0xf'));var as=require(_0x31dd('0x10'));var hardwareService=require(_0x31dd('0x11'));var logger=require(_0x31dd('0x12'))('api');var utils=require(_0x31dd('0x13'));var config=require('../../config/environment');var db=require(_0x31dd('0x14'))['db'];config[_0x31dd('0x15')]=_[_0x31dd('0x16')](config[_0x31dd('0x15')],{'host':_0x31dd('0x17'),'port':0x18eb});var socket=require(_0x31dd('0x18'))(new Redis(config[_0x31dd('0x15')]));require(_0x31dd('0x19'))[_0x31dd('0x1a')](socket);function respondWithStatusCode(_0x20e12d,_0x2faa00){_0x2faa00=_0x2faa00||0xcc;return function(_0x3b7260){if(_0x3b7260){return _0x20e12d['sendStatus'](_0x2faa00);}return _0x20e12d[_0x31dd('0x1b')](_0x2faa00)[_0x31dd('0x1c')]();};}function respondWithResult(_0x27403c,_0x32636f){_0x32636f=_0x32636f||0xc8;return function(_0x11a784){if(_0x11a784){return _0x27403c[_0x31dd('0x1b')](_0x32636f)[_0x31dd('0x1d')](_0x11a784);}};}function respondWithFilteredResult(_0x14c1b2,_0x3924c3){return function(_0x319b7b){if(_0x319b7b){var _0x478658=_0x319b7b[_0x31dd('0x1e')],_0x22a5ae=_0x3924c3[_0x31dd('0x1f')],_0x1b15cb=_0x3924c3[_0x31dd('0x1f')]+_0x3924c3[_0x31dd('0x20')],_0x432053;if(_0x1b15cb>=_0x478658){_0x1b15cb=_0x478658;_0x432053=0xc8;}else{_0x432053=0xce;}_0x14c1b2['status'](_0x432053);return _0x14c1b2[_0x31dd('0x21')](_0x31dd('0x22'),_0x22a5ae+'-'+_0x1b15cb+'/'+_0x478658)[_0x31dd('0x1d')](_0x319b7b);}return null;};}function patchUpdates(_0x3fa2d2){return function(_0x481b12){try{jsonpatch[_0x31dd('0x23')](_0x481b12,_0x3fa2d2,!![]);}catch(_0x23ce07){return BPromise[_0x31dd('0x24')](_0x23ce07);}return _0x481b12[_0x31dd('0x25')]();};}function saveUpdates(_0x3adfb7,_0x45d2b7){return function(_0x338f70){if(_0x338f70){return _0x338f70[_0x31dd('0x26')](_0x3adfb7)[_0x31dd('0x27')](function(_0x23e4b7){return _0x23e4b7;});}return null;};}function removeEntity(_0x202650,_0x5648d7){return function(_0x48263f){if(_0x48263f){return _0x48263f[_0x31dd('0x28')]()[_0x31dd('0x27')](function(){_0x202650['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51473b,_0x44afa6){return function(_0x53ee7e){if(!_0x53ee7e){_0x51473b[_0x31dd('0x29')](0x194);}return _0x53ee7e;};}function handleError(_0xb7634f,_0x16e13c){_0x16e13c=_0x16e13c||0x1f4;return function(_0x27b696){logger[_0x31dd('0x2a')](_0x27b696[_0x31dd('0x2b')]);if(_0x27b696[_0x31dd('0x2c')]){delete _0x27b696[_0x31dd('0x2c')];}_0xb7634f[_0x31dd('0x1b')](_0x16e13c)[_0x31dd('0x2d')](_0x27b696);};}exports[_0x31dd('0x2e')]=function(_0x59cd7e,_0x46b67a){var _0xd1f417={'raw':![],'where':{'id':_0x59cd7e[_0x31dd('0x2f')]['id']}},_0x138e52={};_0x138e52['model']=_[_0x31dd('0x30')](db['DashboardItem'][_0x31dd('0x31')]);_0x138e52[_0x31dd('0x32')]=_[_0x31dd('0x30')](_0x59cd7e['query']);_0x138e52[_0x31dd('0x33')]=_[_0x31dd('0x34')](_0x138e52['model'],_0x138e52['query']);_0xd1f417[_0x31dd('0x35')]=_['intersection'](_0x138e52['model'],qs[_0x31dd('0x36')](_0x59cd7e[_0x31dd('0x32')][_0x31dd('0x36')]));_0xd1f417[_0x31dd('0x35')]=_0xd1f417[_0x31dd('0x35')][_0x31dd('0x37')]?_0xd1f417[_0x31dd('0x35')]:_0x138e52[_0x31dd('0x38')];if(_0x59cd7e[_0x31dd('0x32')][_0x31dd('0x39')]){_0xd1f417[_0x31dd('0x3a')]=[{'all':!![]}];}_0xd1f417=_[_0x31dd('0x3b')]({},_0xd1f417,_0x59cd7e[_0x31dd('0x3c')]);return db[_0x31dd('0x3d')][_0x31dd('0x3e')](_0xd1f417)[_0x31dd('0x27')](handleEntityNotFound(_0x46b67a,null))[_0x31dd('0x27')](respondWithResult(_0x46b67a,null))[_0x31dd('0x3f')](handleError(_0x46b67a,null));};exports[_0x31dd('0x28')]=function(_0x3ff8d6,_0x59519d){return db[_0x31dd('0x3d')][_0x31dd('0x3e')]({'where':{'id':_0x3ff8d6['params']['id']}})['then'](handleEntityNotFound(_0x59519d,null))[_0x31dd('0x27')](removeEntity(_0x59519d,null))[_0x31dd('0x3f')](handleError(_0x59519d,null));};function widgetAttributes(_0x205e30){try{switch(_0x205e30[_0x31dd('0x40')]){case _0x31dd('0x41'):return[{'name':_0x31dd('0x42'),'value':_0x205e30[_0x31dd('0x42')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0][_0x31dd('0x44')]:undefined)||'https://'}];case _0x31dd('0x45'):return[{'name':_0x31dd('0x46'),'value':_0x205e30[_0x31dd('0x46')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0][_0x31dd('0x44')]:undefined)||''}];case _0x31dd('0x47'):return[{'name':'attrHourFormat','value':_0x205e30[_0x31dd('0x48')]||(_0x205e30['attrs']&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0]['value']:undefined)||_0x31dd('0x49')},{'name':_0x31dd('0x4a'),'value':_0x205e30[_0x31dd('0x4a')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x1]?_0x205e30[_0x31dd('0x43')][0x1][_0x31dd('0x44')]:undefined)||_0x31dd('0x4b')},{'name':'attrFontSize','value':_0x205e30[_0x31dd('0x4c')]||(_0x205e30['attrs']&&_0x205e30[_0x31dd('0x43')][0x2]?_0x205e30[_0x31dd('0x43')][0x2]['value']:undefined)||0xc}];case _0x31dd('0x4d'):return[{'name':_0x31dd('0x4e'),'value':_0x205e30[_0x31dd('0x4e')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0][_0x31dd('0x44')]:undefined)||_0x31dd('0x4f')},{'name':'attrVoiceQueues','value':_0x205e30['attrVoiceQueues']||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x1]?_0x205e30[_0x31dd('0x43')][0x1][_0x31dd('0x44')]:undefined)||[]},{'name':_0x31dd('0x4c'),'value':_0x205e30['attrFontSize']||(_0x205e30[_0x31dd('0x43')]&&_0x205e30['attrs'][0x2]?_0x205e30['attrs'][0x2][_0x31dd('0x44')]:undefined)||0x14}];case _0x31dd('0x50'):case'pie-chart':return[{'name':_0x31dd('0x51'),'value':_0x205e30[_0x31dd('0x51')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0]['value']:undefined)||_0x31dd('0x4f')},{'name':_0x31dd('0x52'),'value':_0x205e30['attrSerie2']||(_0x205e30['attrs']&&_0x205e30[_0x31dd('0x43')][0x1]?_0x205e30[_0x31dd('0x43')][0x1][_0x31dd('0x44')]:undefined)||null},{'name':_0x31dd('0x53'),'value':_0x205e30['attrSerie3']||(_0x205e30['attrs']&&_0x205e30[_0x31dd('0x43')][0x2]?_0x205e30[_0x31dd('0x43')][0x2][_0x31dd('0x44')]:undefined)||null},{'name':_0x31dd('0x54'),'value':_0x205e30[_0x31dd('0x54')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x3]?_0x205e30[_0x31dd('0x43')][0x3]['value']:undefined)||[]}];case _0x31dd('0x55'):return[{'name':'attrReport','type':_0x205e30['reportType']||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0][_0x31dd('0x40')]:undefined)||null,'value':_0x205e30[_0x31dd('0x56')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x0]?_0x205e30[_0x31dd('0x43')][0x0][_0x31dd('0x44')]:undefined)||null},{'name':_0x31dd('0x57'),'value':_0x205e30[_0x31dd('0x57')]||(_0x205e30[_0x31dd('0x43')]&&_0x205e30[_0x31dd('0x43')][0x1]?_0x205e30[_0x31dd('0x43')][0x1][_0x31dd('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x1de0a4){logger[_0x31dd('0x2a')]('widgetAttributes:\x20%s',JSON[_0x31dd('0x58')](_0x1de0a4));return[];}}exports[_0x31dd('0x59')]=function(_0x4eeff5,_0x5a636e){if(_0x4eeff5[_0x31dd('0x5a')]){_0x4eeff5[_0x31dd('0x5a')][_0x31dd('0x43')]=widgetAttributes(_0x4eeff5['body']);}return db[_0x31dd('0x3d')][_0x31dd('0x59')](_0x4eeff5['body'],{})['then'](respondWithResult(_0x5a636e,0xc9))['catch'](handleError(_0x5a636e,null));};exports['update']=function(_0x5987e8,_0x314887){if(_0x5987e8[_0x31dd('0x5a')]['id']){delete _0x5987e8[_0x31dd('0x5a')]['id'];}_0x5987e8[_0x31dd('0x5a')]['attrs']=widgetAttributes(_0x5987e8[_0x31dd('0x5a')]);return db[_0x31dd('0x3d')]['find']({'where':{'id':_0x5987e8['params']['id']}})[_0x31dd('0x27')](handleEntityNotFound(_0x314887,null))[_0x31dd('0x27')](saveUpdates(_0x5987e8['body'],null))[_0x31dd('0x27')](respondWithResult(_0x314887,null))[_0x31dd('0x3f')](handleError(_0x314887,null));}; \ No newline at end of file +var _0x23da=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','count','offset','limit','apply','reject','save','then','end','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','catch','update','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x40e6d9,_0x4eb34d){var _0x5e88ad=function(_0x3df056){while(--_0x3df056){_0x40e6d9['push'](_0x40e6d9['shift']());}};_0x5e88ad(++_0x4eb34d);}(_0x23da,0x1a5));var _0xa23d=function(_0xb30d91,_0x52ed58){_0xb30d91=_0xb30d91-0x0;var _0x4e280a=_0x23da[_0xb30d91];return _0x4e280a;};'use strict';var pdf=require(_0xa23d('0x0'));var emlformat=require(_0xa23d('0x1'));var rimraf=require(_0xa23d('0x2'));var zipdir=require(_0xa23d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa23d('0x4'));var BPromise=require(_0xa23d('0x5'));var Mustache=require(_0xa23d('0x6'));var util=require(_0xa23d('0x7'));var path=require(_0xa23d('0x8'));var sox=require(_0xa23d('0x9'));var csv=require('to-csv');var ejs=require(_0xa23d('0xa'));var fs=require('fs');var _=require(_0xa23d('0xb'));var squel=require(_0xa23d('0xc'));var crypto=require(_0xa23d('0xd'));var jsforce=require(_0xa23d('0xe'));var deskjs=require(_0xa23d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa23d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa23d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa23d('0x12'));var logger=require('../../config/logger')(_0xa23d('0x13'));var utils=require(_0xa23d('0x14'));var config=require(_0xa23d('0x15'));var db=require(_0xa23d('0x16'))['db'];config[_0xa23d('0x17')]=_[_0xa23d('0x18')](config[_0xa23d('0x17')],{'host':_0xa23d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa23d('0x17')]));require('./dashboardItem.socket')[_0xa23d('0x1a')](socket);function respondWithStatusCode(_0x501f74,_0x1d66f2){_0x1d66f2=_0x1d66f2||0xcc;return function(_0x58735c){if(_0x58735c){return _0x501f74[_0xa23d('0x1b')](_0x1d66f2);}return _0x501f74[_0xa23d('0x1c')](_0x1d66f2)['end']();};}function respondWithResult(_0x2392c1,_0x427374){_0x427374=_0x427374||0xc8;return function(_0x374a0c){if(_0x374a0c){return _0x2392c1[_0xa23d('0x1c')](_0x427374)['json'](_0x374a0c);}};}function respondWithFilteredResult(_0xd48682,_0x157831){return function(_0x283fd5){if(_0x283fd5){var _0x41e6d4=_0x283fd5[_0xa23d('0x1d')],_0x14c093=_0x157831[_0xa23d('0x1e')],_0x3d8c7d=_0x157831[_0xa23d('0x1e')]+_0x157831[_0xa23d('0x1f')],_0x39f22c;if(_0x3d8c7d>=_0x41e6d4){_0x3d8c7d=_0x41e6d4;_0x39f22c=0xc8;}else{_0x39f22c=0xce;}_0xd48682[_0xa23d('0x1c')](_0x39f22c);return _0xd48682['set']('Content-Range',_0x14c093+'-'+_0x3d8c7d+'/'+_0x41e6d4)['json'](_0x283fd5);}return null;};}function patchUpdates(_0x3d7d51){return function(_0x3f3152){try{jsonpatch[_0xa23d('0x20')](_0x3f3152,_0x3d7d51,!![]);}catch(_0x27a451){return BPromise[_0xa23d('0x21')](_0x27a451);}return _0x3f3152[_0xa23d('0x22')]();};}function saveUpdates(_0x52f487,_0x463574){return function(_0xf3bce4){if(_0xf3bce4){return _0xf3bce4['update'](_0x52f487)[_0xa23d('0x23')](function(_0x343513){return _0x343513;});}return null;};}function removeEntity(_0x5dd91b,_0x3af57a){return function(_0x58f3a4){if(_0x58f3a4){return _0x58f3a4['destroy']()[_0xa23d('0x23')](function(){_0x5dd91b[_0xa23d('0x1c')](0xcc)[_0xa23d('0x24')]();});}};}function handleEntityNotFound(_0x5f35fd,_0x244d01){return function(_0x5df6b5){if(!_0x5df6b5){_0x5f35fd[_0xa23d('0x1b')](0x194);}return _0x5df6b5;};}function handleError(_0x23030c,_0x5cd700){_0x5cd700=_0x5cd700||0x1f4;return function(_0x1f2271){logger[_0xa23d('0x25')](_0x1f2271[_0xa23d('0x26')]);if(_0x1f2271[_0xa23d('0x27')]){delete _0x1f2271[_0xa23d('0x27')];}_0x23030c[_0xa23d('0x1c')](_0x5cd700)[_0xa23d('0x28')](_0x1f2271);};}exports[_0xa23d('0x29')]=function(_0x12427b,_0xcb6dce){var _0x535a8c={'raw':![],'where':{'id':_0x12427b[_0xa23d('0x2a')]['id']}},_0x105ff={};_0x105ff['model']=_[_0xa23d('0x2b')](db[_0xa23d('0x2c')][_0xa23d('0x2d')]);_0x105ff[_0xa23d('0x2e')]=_[_0xa23d('0x2b')](_0x12427b[_0xa23d('0x2e')]);_0x105ff[_0xa23d('0x2f')]=_[_0xa23d('0x30')](_0x105ff[_0xa23d('0x31')],_0x105ff[_0xa23d('0x2e')]);_0x535a8c[_0xa23d('0x32')]=_[_0xa23d('0x30')](_0x105ff[_0xa23d('0x31')],qs[_0xa23d('0x33')](_0x12427b[_0xa23d('0x2e')]['fields']));_0x535a8c[_0xa23d('0x32')]=_0x535a8c[_0xa23d('0x32')][_0xa23d('0x34')]?_0x535a8c[_0xa23d('0x32')]:_0x105ff[_0xa23d('0x31')];if(_0x12427b['query'][_0xa23d('0x35')]){_0x535a8c[_0xa23d('0x36')]=[{'all':!![]}];}_0x535a8c=_[_0xa23d('0x37')]({},_0x535a8c,_0x12427b[_0xa23d('0x38')]);return db[_0xa23d('0x2c')][_0xa23d('0x39')](_0x535a8c)[_0xa23d('0x23')](handleEntityNotFound(_0xcb6dce,null))['then'](respondWithResult(_0xcb6dce,null))['catch'](handleError(_0xcb6dce,null));};exports['destroy']=function(_0x1e7f56,_0x400b92){return db[_0xa23d('0x2c')]['find']({'where':{'id':_0x1e7f56[_0xa23d('0x2a')]['id']}})[_0xa23d('0x23')](handleEntityNotFound(_0x400b92,null))[_0xa23d('0x23')](removeEntity(_0x400b92,null))['catch'](handleError(_0x400b92,null));};function widgetAttributes(_0x459839){try{switch(_0x459839[_0xa23d('0x3a')]){case'iframe':return[{'name':_0xa23d('0x3b'),'value':_0x459839[_0xa23d('0x3b')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839[_0xa23d('0x3c')][0x0][_0xa23d('0x3d')]:undefined)||_0xa23d('0x3e')}];case _0xa23d('0x3f'):return[{'name':'attrPath','value':_0x459839[_0xa23d('0x40')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839['attrs'][0x0][_0xa23d('0x3d')]:undefined)||''}];case _0xa23d('0x41'):return[{'name':_0xa23d('0x42'),'value':_0x459839[_0xa23d('0x42')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839[_0xa23d('0x3c')][0x0][_0xa23d('0x3d')]:undefined)||_0xa23d('0x43')},{'name':'attrTimezone','value':_0x459839[_0xa23d('0x44')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x1]?_0x459839[_0xa23d('0x3c')][0x1]['value']:undefined)||_0xa23d('0x45')},{'name':'attrFontSize','value':_0x459839[_0xa23d('0x46')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839['attrs'][0x2]?_0x459839[_0xa23d('0x3c')][0x2][_0xa23d('0x3d')]:undefined)||0xc}];case _0xa23d('0x47'):return[{'name':_0xa23d('0x48'),'value':_0x459839[_0xa23d('0x48')]||(_0x459839['attrs']&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839[_0xa23d('0x3c')][0x0][_0xa23d('0x3d')]:undefined)||_0xa23d('0x49')},{'name':_0xa23d('0x4a'),'value':_0x459839[_0xa23d('0x4a')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x1]?_0x459839[_0xa23d('0x3c')][0x1][_0xa23d('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0x459839[_0xa23d('0x46')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839['attrs'][0x2]?_0x459839[_0xa23d('0x3c')][0x2][_0xa23d('0x3d')]:undefined)||0x14}];case _0xa23d('0x4b'):case _0xa23d('0x4c'):return[{'name':_0xa23d('0x4d'),'value':_0x459839[_0xa23d('0x4d')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839[_0xa23d('0x3c')][0x0][_0xa23d('0x3d')]:undefined)||'total'},{'name':_0xa23d('0x4e'),'value':_0x459839['attrSerie2']||(_0x459839['attrs']&&_0x459839[_0xa23d('0x3c')][0x1]?_0x459839['attrs'][0x1][_0xa23d('0x3d')]:undefined)||null},{'name':'attrSerie3','value':_0x459839[_0xa23d('0x4f')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839['attrs'][0x2]?_0x459839[_0xa23d('0x3c')][0x2]['value']:undefined)||null},{'name':_0xa23d('0x4a'),'value':_0x459839[_0xa23d('0x4a')]||(_0x459839['attrs']&&_0x459839['attrs'][0x3]?_0x459839[_0xa23d('0x3c')][0x3][_0xa23d('0x3d')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x459839['reportType']||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839['attrs'][0x0]['type']:undefined)||null,'value':_0x459839[_0xa23d('0x50')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x0]?_0x459839[_0xa23d('0x3c')][0x0][_0xa23d('0x3d')]:undefined)||null},{'name':_0xa23d('0x51'),'value':_0x459839[_0xa23d('0x51')]||(_0x459839[_0xa23d('0x3c')]&&_0x459839[_0xa23d('0x3c')][0x1]?_0x459839[_0xa23d('0x3c')][0x1][_0xa23d('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x4b940b){logger[_0xa23d('0x25')](_0xa23d('0x52'),JSON['stringify'](_0x4b940b));return[];}}exports[_0xa23d('0x53')]=function(_0x214986,_0x2c9b71){if(_0x214986[_0xa23d('0x54')]){_0x214986[_0xa23d('0x54')][_0xa23d('0x3c')]=widgetAttributes(_0x214986[_0xa23d('0x54')]);}return db[_0xa23d('0x2c')][_0xa23d('0x53')](_0x214986[_0xa23d('0x54')],{})[_0xa23d('0x23')](respondWithResult(_0x2c9b71,0xc9))[_0xa23d('0x55')](handleError(_0x2c9b71,null));};exports[_0xa23d('0x56')]=function(_0x25dff3,_0x3c5915){if(_0x25dff3['body']['id']){delete _0x25dff3[_0xa23d('0x54')]['id'];}_0x25dff3['body'][_0xa23d('0x3c')]=widgetAttributes(_0x25dff3[_0xa23d('0x54')]);return db['DashboardItem'][_0xa23d('0x39')]({'where':{'id':_0x25dff3[_0xa23d('0x2a')]['id']}})[_0xa23d('0x23')](handleEntityNotFound(_0x3c5915,null))[_0xa23d('0x23')](saveUpdates(_0x25dff3[_0xa23d('0x54')],null))['then'](respondWithResult(_0x3c5915,null))['catch'](handleError(_0x3c5915,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 65b2763..4ed1128 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 _0x2ff8=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x467c87,_0x35878c){var _0x1af25d=function(_0x22ec4f){while(--_0x22ec4f){_0x467c87['push'](_0x467c87['shift']());}};_0x1af25d(++_0x35878c);}(_0x2ff8,0x1b0));var _0x82ff=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x2ff8[_0x5c9307];return _0x373e29;};'use strict';var EventEmitter=require(_0x82ff('0x0'));var DashboardItem=require(_0x82ff('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x82ff('0x2')](0x0);var events={'afterCreate':_0x82ff('0x3'),'afterUpdate':_0x82ff('0x4'),'afterDestroy':_0x82ff('0x5')};function emitEvent(_0x30ef8d){return function(_0x3f5c5a,_0x42e913,_0x2423c0){DashboardItemEvents[_0x82ff('0x6')](_0x30ef8d+':'+_0x3f5c5a['id'],_0x3f5c5a);DashboardItemEvents['emit'](_0x30ef8d,_0x3f5c5a);_0x2423c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x82ff('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x69d1=['events','../../mysqldb','DashboardItem','save','remove','emit','hasOwnProperty','hook'];(function(_0x31908d,_0x120abe){var _0x4f71c7=function(_0x1b444d){while(--_0x1b444d){_0x31908d['push'](_0x31908d['shift']());}};_0x4f71c7(++_0x120abe);}(_0x69d1,0x98));var _0x169d=function(_0x2f5ee4,_0x584180){_0x2f5ee4=_0x2f5ee4-0x0;var _0x4ec263=_0x69d1[_0x2f5ee4];return _0x4ec263;};'use strict';var EventEmitter=require(_0x169d('0x0'));var DashboardItem=require(_0x169d('0x1'))['db'][_0x169d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x169d('0x3'),'afterUpdate':'update','afterDestroy':_0x169d('0x4')};function emitEvent(_0x210a11){return function(_0x4dae91,_0x1be232,_0x987896){DashboardItemEvents[_0x169d('0x5')](_0x210a11+':'+_0x4dae91['id'],_0x4dae91);DashboardItemEvents[_0x169d('0x5')](_0x210a11,_0x4dae91);_0x987896(null);};}for(var e in events){if(events[_0x169d('0x6')](e)){var event=events[e];DashboardItem[_0x169d('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 58a7581..8b045c8 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 _0x9f92=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9f92,0xdc));var _0x29f9=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0x9f92[_0x33ac75];return _0x34d5f2;};'use strict';var _=require(_0x29f9('0x0'));var util=require(_0x29f9('0x1'));var logger=require(_0x29f9('0x2'))('api');var moment=require(_0x29f9('0x3'));var BPromise=require(_0x29f9('0x4'));var rp=require(_0x29f9('0x5'));var fs=require('fs');var path=require(_0x29f9('0x6'));var rimraf=require(_0x29f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x29f9('0x8'));module[_0x29f9('0x9')]=function(_0x5d74f2,_0x27e985){return _0x5d74f2[_0x29f9('0xa')](_0x29f9('0xb'),attributes,{'tableName':_0x29f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4669=['request-promise','path','../../config/environment','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4669,0x17a));var _0x9466=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x4669[_0x190ff6];return _0x5356d2;};'use strict';var _=require(_0x9466('0x0'));var util=require(_0x9466('0x1'));var logger=require(_0x9466('0x2'))(_0x9466('0x3'));var moment=require(_0x9466('0x4'));var BPromise=require(_0x9466('0x5'));var rp=require(_0x9466('0x6'));var fs=require('fs');var path=require(_0x9466('0x7'));var rimraf=require('rimraf');var config=require(_0x9466('0x8'));var attributes=require(_0x9466('0x9'));module[_0x9466('0xa')]=function(_0x39f203,_0x46ba70){return _0x39f203['define']('DashboardItem',attributes,{'tableName':_0x9466('0xb'),'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 bf0edc2..3d898bb 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 _0xc44f=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info'];(function(_0x391b19,_0x214efa){var _0x4789ff=function(_0x7fffe5){while(--_0x7fffe5){_0x391b19['push'](_0x391b19['shift']());}};_0x4789ff(++_0x214efa);}(_0xc44f,0x117));var _0xfc44=function(_0x4cbae6,_0x1e86b1){_0x4cbae6=_0x4cbae6-0x0;var _0x53d792=_0xc44f[_0x4cbae6];return _0x53d792;};'use strict';var _=require(_0xfc44('0x0'));var util=require(_0xfc44('0x1'));var moment=require(_0xfc44('0x2'));var BPromise=require(_0xfc44('0x3'));var rs=require(_0xfc44('0x4'));var fs=require('fs');var Redis=require(_0xfc44('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc44('0x6'));var logger=require(_0xfc44('0x7'))(_0xfc44('0x8'));var config=require(_0xfc44('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc44('0xa')]({'port':0x232a});config[_0xfc44('0xb')]=_['defaults'](config[_0xfc44('0xb')],{'host':_0xfc44('0xc'),'port':0x18eb});var socket=require(_0xfc44('0xd'))(new Redis(config[_0xfc44('0xb')]));require(_0xfc44('0xe'))['register'](socket);function respondWithRpcPromise(_0x4d17f1,_0x4644fe,_0x2be331){return new BPromise(function(_0x3cf4c7,_0x55d89f){return client[_0xfc44('0xf')](_0x4d17f1,_0x2be331)[_0xfc44('0x10')](function(_0x23a347){logger[_0xfc44('0x11')](_0xfc44('0x12'),_0x4644fe,_0xfc44('0x13'));logger[_0xfc44('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4644fe,_0xfc44('0x13'),JSON[_0xfc44('0x15')](_0x23a347));if(_0x23a347[_0xfc44('0x16')]){if(_0x23a347['error'][_0xfc44('0x17')]===0x1f4){logger[_0xfc44('0x16')](_0xfc44('0x12'),_0x4644fe,_0x23a347['error'][_0xfc44('0x18')]);return _0x55d89f(_0x23a347[_0xfc44('0x16')]['message']);}logger[_0xfc44('0x16')](_0xfc44('0x12'),_0x4644fe,_0x23a347['error']['message']);return _0x3cf4c7(_0x23a347[_0xfc44('0x16')][_0xfc44('0x18')]);}else{logger[_0xfc44('0x11')](_0xfc44('0x12'),_0x4644fe,_0xfc44('0x13'));_0x3cf4c7(_0x23a347[_0xfc44('0x19')][_0xfc44('0x18')]);}})[_0xfc44('0x1a')](function(_0x3f1eb0){logger[_0xfc44('0x16')]('DashboardItem,\x20%s,\x20%s',_0x4644fe,_0x3f1eb0);_0x55d89f(_0x3f1eb0);});});} \ No newline at end of file +var _0xc3a4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','info','request\x20sent','debug','stringify','error','message','DashboardItem,\x20%s,\x20%s','result','lodash','util','moment','randomstring'];(function(_0x455d61,_0x3caec8){var _0x1356cc=function(_0x4b3d50){while(--_0x4b3d50){_0x455d61['push'](_0x455d61['shift']());}};_0x1356cc(++_0x3caec8);}(_0xc3a4,0x1c8));var _0x4c3a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc3a4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4c3a('0x0'));var util=require(_0x4c3a('0x1'));var moment=require(_0x4c3a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c3a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c3a('0x4'))['db'];var utils=require(_0x4c3a('0x5'));var logger=require(_0x4c3a('0x6'))(_0x4c3a('0x7'));var config=require(_0x4c3a('0x8'));var jayson=require(_0x4c3a('0x9'));var client=jayson[_0x4c3a('0xa')][_0x4c3a('0xb')]({'port':0x232a});config[_0x4c3a('0xc')]=_[_0x4c3a('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c3a('0xc')]));require(_0x4c3a('0xe'))['register'](socket);function respondWithRpcPromise(_0x4b935e,_0x27be46,_0x565060){return new BPromise(function(_0x462300,_0x2d7dde){return client['request'](_0x4b935e,_0x565060)['then'](function(_0x35b471){logger[_0x4c3a('0xf')]('DashboardItem,\x20%s,\x20%s',_0x27be46,_0x4c3a('0x10'));logger[_0x4c3a('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x27be46,_0x4c3a('0x10'),JSON[_0x4c3a('0x12')](_0x35b471));if(_0x35b471[_0x4c3a('0x13')]){if(_0x35b471[_0x4c3a('0x13')]['code']===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x27be46,_0x35b471['error']['message']);return _0x2d7dde(_0x35b471['error'][_0x4c3a('0x14')]);}logger[_0x4c3a('0x13')](_0x4c3a('0x15'),_0x27be46,_0x35b471[_0x4c3a('0x13')][_0x4c3a('0x14')]);return _0x462300(_0x35b471[_0x4c3a('0x13')]['message']);}else{logger[_0x4c3a('0xf')](_0x4c3a('0x15'),_0x27be46,_0x4c3a('0x10'));_0x462300(_0x35b471[_0x4c3a('0x16')][_0x4c3a('0x14')]);}})['catch'](function(_0x577bac){logger['error'](_0x4c3a('0x15'),_0x27be46,_0x577bac);_0x2d7dde(_0x577bac);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 8cc626f..7dbf733 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 _0x1e0c=['length','dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener','register'];(function(_0x515c31,_0x2999fb){var _0x5d96e8=function(_0x576bcf){while(--_0x576bcf){_0x515c31['push'](_0x515c31['shift']());}};_0x5d96e8(++_0x2999fb);}(_0x1e0c,0x16a));var _0xc1e0=function(_0x1ec18f,_0x1b2392){_0x1ec18f=_0x1ec18f-0x0;var _0x2b1755=_0x1e0c[_0x1ec18f];return _0x2b1755;};'use strict';var DashboardItemEvents=require(_0xc1e0('0x0'));var events=['save',_0xc1e0('0x1'),_0xc1e0('0x2')];function createListener(_0x15fb9a,_0x3042c4){return function(_0xd720b3){_0x3042c4[_0xc1e0('0x3')](_0x15fb9a,_0xd720b3);};}function removeListener(_0x2ebfa1,_0x5cf014){return function(){DashboardItemEvents[_0xc1e0('0x4')](_0x2ebfa1,_0x5cf014);};}exports[_0xc1e0('0x5')]=function(_0x4c0aaf){for(var _0x182250=0x0,_0x418e20=events[_0xc1e0('0x6')];_0x182250<_0x418e20;_0x182250++){var _0x49806d=events[_0x182250];var _0x48745c=createListener(_0xc1e0('0x7')+_0x49806d,_0x4c0aaf);DashboardItemEvents['on'](_0x49806d,_0x48745c);}}; \ No newline at end of file +var _0x971e=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0x1b4eca,_0x1113ef){var _0xfa870f=function(_0x4e081c){while(--_0x4e081c){_0x1b4eca['push'](_0x1b4eca['shift']());}};_0xfa870f(++_0x1113ef);}(_0x971e,0xf9));var _0xe971=function(_0x5298e7,_0x20f266){_0x5298e7=_0x5298e7-0x0;var _0x103e14=_0x971e[_0x5298e7];return _0x103e14;};'use strict';var DashboardItemEvents=require(_0xe971('0x0'));var events=[_0xe971('0x1'),_0xe971('0x2'),_0xe971('0x3')];function createListener(_0x289c42,_0x304b99){return function(_0x114143){_0x304b99[_0xe971('0x4')](_0x289c42,_0x114143);};}function removeListener(_0x179de7,_0x779b05){return function(){DashboardItemEvents[_0xe971('0x5')](_0x179de7,_0x779b05);};}exports[_0xe971('0x6')]=function(_0x2e54b1){for(var _0x2cec62=0x0,_0x990bfa=events['length'];_0x2cec62<_0x990bfa;_0x2cec62++){var _0x484f2b=events[_0x2cec62];var _0x54321e=createListener(_0xe971('0x7')+_0x484f2b,_0x2e54b1);DashboardItemEvents['on'](_0x484f2b,_0x54321e);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 05e642f..1674eb8 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 _0xc4aa=['connect-timeout','express','Router','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x1b62d4,_0x5c5364){var _0xf5006d=function(_0x14493e){while(--_0x14493e){_0x1b62d4['push'](_0x1b62d4['shift']());}};_0xf5006d(++_0x5c5364);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0xb')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xc')]);router['put']('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router[_0xac4a('0xe')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);module[_0xac4a('0x10')]=router; \ No newline at end of file +var _0x7217=['post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./dashboardItem.controller','get','/:id','isAuthenticated','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')](_0x7721('0x8'),auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0xb')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')](_0x7721('0x8'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0x8'),auth[_0x7721('0x9')](),controller['destroy']);module[_0x7721('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9b922b4..2a58896 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 _0x1fa5=['exports'];(function(_0xe69bf1,_0x487cbc){var _0x1259d1=function(_0x5e610d){while(--_0x5e610d){_0xe69bf1['push'](_0xe69bf1['shift']());}};_0x1259d1(++_0x487cbc);}(_0x1fa5,0x11c));var _0x51fa=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x1fa5[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x51fa('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1994=['exports'];(function(_0x4ab80f,_0x5ab227){var _0x4a5699=function(_0x2c6eba){while(--_0x2c6eba){_0x4ab80f['push'](_0x4ab80f['shift']());}};_0x4a5699(++_0x5ab227);}(_0x1994,0x1e5));var _0x4199=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1994[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x4199('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e96ecf0..fc2c0c0 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 _0x8d0e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','index','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','Disposition','includeAll','catch','show','params','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','rimraf'];(function(_0x3a93d5,_0x7f9e49){var _0x12c0b1=function(_0x4bfd89){while(--_0x4bfd89){_0x3a93d5['push'](_0x3a93d5['shift']());}};_0x12c0b1(++_0x7f9e49);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x351e37,_0x4e30c0){_0x351e37=_0x351e37-0x0;var _0x176bec=_0x8d0e[_0x351e37];return _0x176bec;};'use strict';var pdf=require(_0xe8d0('0x0'));var emlformat=require(_0xe8d0('0x1'));var rimraf=require(_0xe8d0('0x2'));var zipdir=require(_0xe8d0('0x3'));var jsonpatch=require(_0xe8d0('0x4'));var rp=require(_0xe8d0('0x5'));var moment=require(_0xe8d0('0x6'));var BPromise=require(_0xe8d0('0x7'));var Mustache=require(_0xe8d0('0x8'));var util=require('util');var path=require(_0xe8d0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe8d0('0xa'));var fs=require('fs');var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var db=require(_0xe8d0('0x19'))['db'];function respondWithStatusCode(_0x41de69,_0x5934b2){_0x5934b2=_0x5934b2||0xcc;return function(_0x38fac0){if(_0x38fac0){return _0x41de69[_0xe8d0('0x1a')](_0x5934b2);}return _0x41de69['status'](_0x5934b2)[_0xe8d0('0x1b')]();};}function respondWithResult(_0x4cbd26,_0x59b4b7){_0x59b4b7=_0x59b4b7||0xc8;return function(_0x90a1ea){if(_0x90a1ea){return _0x4cbd26[_0xe8d0('0x1c')](_0x59b4b7)[_0xe8d0('0x1d')](_0x90a1ea);}};}function respondWithFilteredResult(_0x291b49,_0x15d3a1){return function(_0x7151c6){if(_0x7151c6){var _0x52818a=_0x7151c6[_0xe8d0('0x1e')],_0x6ccffa=_0x15d3a1[_0xe8d0('0x1f')],_0x49554d=_0x15d3a1['offset']+_0x15d3a1['limit'],_0x6d932b;if(_0x49554d>=_0x52818a){_0x49554d=_0x52818a;_0x6d932b=0xc8;}else{_0x6d932b=0xce;}_0x291b49['status'](_0x6d932b);return _0x291b49[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x6ccffa+'-'+_0x49554d+'/'+_0x52818a)[_0xe8d0('0x1d')](_0x7151c6);}return null;};}function patchUpdates(_0x44bbe4){return function(_0x83177b){try{jsonpatch['apply'](_0x83177b,_0x44bbe4,!![]);}catch(_0x105861){return BPromise[_0xe8d0('0x22')](_0x105861);}return _0x83177b['save']();};}function saveUpdates(_0x5ce284,_0x554402){return function(_0x384a60){if(_0x384a60){return _0x384a60[_0xe8d0('0x23')](_0x5ce284)[_0xe8d0('0x24')](function(_0x1fbfe8){return _0x1fbfe8;});}return null;};}function removeEntity(_0x25f764,_0x23a945){return function(_0x1bd25c){if(_0x1bd25c){return _0x1bd25c[_0xe8d0('0x25')]()[_0xe8d0('0x24')](function(){var _0x5ab4e7=_0x1bd25c[_0xe8d0('0x26')]({'plain':!![]});var _0x9f747='Dispositions';return db[_0xe8d0('0x27')][_0xe8d0('0x25')]({'where':{'type':_0x9f747,'resourceId':_0x5ab4e7['id']}})[_0xe8d0('0x24')](function(){return _0x1bd25c;});})[_0xe8d0('0x24')](function(){_0x25f764[_0xe8d0('0x1c')](0xcc)[_0xe8d0('0x1b')]();});}};}function handleEntityNotFound(_0x31519b,_0x32f0c1){return function(_0xfa3527){if(!_0xfa3527){_0x31519b[_0xe8d0('0x1a')](0x194);}return _0xfa3527;};}function handleError(_0x264de4,_0x539548){_0x539548=_0x539548||0x1f4;return function(_0x24982c){logger[_0xe8d0('0x28')](_0x24982c[_0xe8d0('0x29')]);if(_0x24982c['name']){delete _0x24982c[_0xe8d0('0x2a')];}_0x264de4[_0xe8d0('0x1c')](_0x539548)['send'](_0x24982c);};}exports[_0xe8d0('0x2b')]=function(_0x3ffcb7,_0x11fcf2){var _0x9eec0e={},_0x3cf3d6={},_0x495064={'count':0x0,'rows':[]};var _0x3cc292=_['map'](db['Disposition']['rawAttributes'],function(_0x547a2b){return{'name':_0x547a2b[_0xe8d0('0x2c')],'type':_0x547a2b[_0xe8d0('0x2d')]['key']};});_0x3cf3d6['model']=_[_0xe8d0('0x2e')](_0x3cc292,'name');_0x3cf3d6[_0xe8d0('0x2f')]=_[_0xe8d0('0x30')](_0x3ffcb7[_0xe8d0('0x2f')]);_0x3cf3d6[_0xe8d0('0x31')]=_[_0xe8d0('0x32')](_0x3cf3d6['model'],_0x3cf3d6[_0xe8d0('0x2f')]);_0x9eec0e[_0xe8d0('0x33')]=_[_0xe8d0('0x32')](_0x3cf3d6[_0xe8d0('0x34')],qs['fields'](_0x3ffcb7[_0xe8d0('0x2f')][_0xe8d0('0x35')]));_0x9eec0e['attributes']=_0x9eec0e[_0xe8d0('0x33')]['length']?_0x9eec0e[_0xe8d0('0x33')]:_0x3cf3d6['model'];if(!_0x3ffcb7[_0xe8d0('0x2f')]['hasOwnProperty'](_0xe8d0('0x36'))){_0x9eec0e[_0xe8d0('0x37')]=qs[_0xe8d0('0x37')](_0x3ffcb7[_0xe8d0('0x2f')]['limit']);_0x9eec0e[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x3ffcb7[_0xe8d0('0x2f')]['offset']);}_0x9eec0e[_0xe8d0('0x38')]=qs[_0xe8d0('0x39')](_0x3ffcb7[_0xe8d0('0x2f')][_0xe8d0('0x39')]);_0x9eec0e[_0xe8d0('0x3a')]=qs['filters'](_[_0xe8d0('0x3b')](_0x3ffcb7[_0xe8d0('0x2f')],_0x3cf3d6[_0xe8d0('0x31')]));if(_0x3ffcb7[_0xe8d0('0x2f')][_0xe8d0('0x3c')]){_0x9eec0e[_0xe8d0('0x3a')]=_[_0xe8d0('0x3d')](_0x9eec0e[_0xe8d0('0x3a')],{'$or':_['map'](_0x3cc292,function(_0x5dff14){if(_0x5dff14[_0xe8d0('0x2d')]!==_0xe8d0('0x3e')){var _0x45e2dc={};_0x45e2dc[_0x5dff14[_0xe8d0('0x2a')]]={'$like':'%'+_0x3ffcb7[_0xe8d0('0x2f')]['filter']+'%'};return _0x45e2dc;}})});}_0x9eec0e=_[_0xe8d0('0x3d')]({},_0x9eec0e,_0x3ffcb7['options']);var _0x2da076={'where':_0x9eec0e[_0xe8d0('0x3a')]};return db[_0xe8d0('0x3f')]['count'](_0x2da076)[_0xe8d0('0x24')](function(_0x3551a0){_0x495064[_0xe8d0('0x1e')]=_0x3551a0;if(_0x3ffcb7[_0xe8d0('0x2f')][_0xe8d0('0x40')]){_0x9eec0e['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x9eec0e);})['then'](function(_0x14ffb6){_0x495064['rows']=_0x14ffb6;return _0x495064;})[_0xe8d0('0x24')](respondWithFilteredResult(_0x11fcf2,_0x9eec0e))[_0xe8d0('0x41')](handleError(_0x11fcf2,null));};exports[_0xe8d0('0x42')]=function(_0x3130d6,_0x2fd21e){var _0x1156da={'raw':!![],'where':{'id':_0x3130d6[_0xe8d0('0x43')]['id']}},_0x1b41c7={};_0x1b41c7['model']=_[_0xe8d0('0x30')](db[_0xe8d0('0x3f')]['rawAttributes']);_0x1b41c7['query']=_[_0xe8d0('0x30')](_0x3130d6[_0xe8d0('0x2f')]);_0x1b41c7[_0xe8d0('0x31')]=_['intersection'](_0x1b41c7[_0xe8d0('0x34')],_0x1b41c7[_0xe8d0('0x2f')]);_0x1156da['attributes']=_[_0xe8d0('0x32')](_0x1b41c7[_0xe8d0('0x34')],qs['fields'](_0x3130d6[_0xe8d0('0x2f')][_0xe8d0('0x35')]));_0x1156da[_0xe8d0('0x33')]=_0x1156da[_0xe8d0('0x33')][_0xe8d0('0x44')]?_0x1156da[_0xe8d0('0x33')]:_0x1b41c7[_0xe8d0('0x34')];if(_0x3130d6[_0xe8d0('0x2f')]['includeAll']){_0x1156da[_0xe8d0('0x45')]=[{'all':!![]}];}_0x1156da=_[_0xe8d0('0x3d')]({},_0x1156da,_0x3130d6[_0xe8d0('0x46')]);return db[_0xe8d0('0x3f')][_0xe8d0('0x47')](_0x1156da)[_0xe8d0('0x24')](handleEntityNotFound(_0x2fd21e,null))[_0xe8d0('0x24')](respondWithResult(_0x2fd21e,null))[_0xe8d0('0x41')](handleError(_0x2fd21e,null));};exports[_0xe8d0('0x48')]=function(_0x2e2c05,_0x361e3d){return db[_0xe8d0('0x3f')]['create'](_0x2e2c05[_0xe8d0('0x49')],{})[_0xe8d0('0x24')](function(_0x14b1ea){var _0xad7d94=_0x2e2c05[_0xe8d0('0x4a')][_0xe8d0('0x26')]({'plain':!![]});if(!_0xad7d94)throw new Error(_0xe8d0('0x4b'));if(_0xad7d94['role']===_0xe8d0('0x4a')){var _0x424764=_0x14b1ea[_0xe8d0('0x26')]({'plain':!![]});var _0x205933='Dispositions';return db[_0xe8d0('0x4c')]['find']({'where':{'name':_0x205933,'userProfileId':_0xad7d94[_0xe8d0('0x4d')]},'raw':!![]})[_0xe8d0('0x24')](function(_0x2e9c6d){if(_0x2e9c6d&&_0x2e9c6d[_0xe8d0('0x4e')]===0x0){return db[_0xe8d0('0x27')][_0xe8d0('0x48')]({'name':_0x424764[_0xe8d0('0x2a')],'resourceId':_0x424764['id'],'type':_0x2e9c6d['name'],'sectionId':_0x2e9c6d['id']},{})[_0xe8d0('0x24')](function(){return _0x14b1ea;});}else{return _0x14b1ea;}})['catch'](function(_0x581a34){logger[_0xe8d0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x581a34);throw _0x581a34;});}return _0x14b1ea;})[_0xe8d0('0x24')](respondWithResult(_0x361e3d,0xc9))['catch'](handleError(_0x361e3d,null));};exports[_0xe8d0('0x23')]=function(_0x28494c,_0x13713c){if(_0x28494c[_0xe8d0('0x49')]['id']){delete _0x28494c['body']['id'];}return db[_0xe8d0('0x3f')][_0xe8d0('0x47')]({'where':{'id':_0x28494c[_0xe8d0('0x43')]['id']}})[_0xe8d0('0x24')](handleEntityNotFound(_0x13713c,null))[_0xe8d0('0x24')](saveUpdates(_0x28494c['body'],null))[_0xe8d0('0x24')](respondWithResult(_0x13713c,null))[_0xe8d0('0x41')](handleError(_0x13713c,null));};exports[_0xe8d0('0x25')]=function(_0x587d3b,_0x2f4d43){return db['Disposition']['find']({'where':{'id':_0x587d3b[_0xe8d0('0x43')]['id']}})[_0xe8d0('0x24')](handleEntityNotFound(_0x2f4d43,null))['then'](removeEntity(_0x2f4d43,null))[_0xe8d0('0x41')](handleError(_0x2f4d43,null));}; \ No newline at end of file +var _0xe015=['mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','count','rows','show','params','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','request-promise','bluebird'];(function(_0x487cbd,_0x342d12){var _0x5021f6=function(_0x4c4647){while(--_0x4c4647){_0x487cbd['push'](_0x487cbd['shift']());}};_0x5021f6(++_0x342d12);}(_0xe015,0x13b));var _0x5e01=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe015[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0x5e01('0x0'));var emlformat=require(_0x5e01('0x1'));var rimraf=require(_0x5e01('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5e01('0x3'));var moment=require('moment');var BPromise=require(_0x5e01('0x4'));var Mustache=require(_0x5e01('0x5'));var util=require(_0x5e01('0x6'));var path=require(_0x5e01('0x7'));var sox=require('sox');var csv=require(_0x5e01('0x8'));var ejs=require(_0x5e01('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e01('0xa'));var jsforce=require(_0x5e01('0xb'));var deskjs=require(_0x5e01('0xc'));var toCsv=require(_0x5e01('0x8'));var querystring=require(_0x5e01('0xd'));var Papa=require(_0x5e01('0xe'));var Redis=require('ioredis');var authService=require(_0x5e01('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5e01('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e01('0x11'))(_0x5e01('0x12'));var utils=require('../../config/utils');var config=require(_0x5e01('0x13'));var db=require(_0x5e01('0x14'))['db'];function respondWithStatusCode(_0x4a4f01,_0x560ae2){_0x560ae2=_0x560ae2||0xcc;return function(_0x3d0b04){if(_0x3d0b04){return _0x4a4f01[_0x5e01('0x15')](_0x560ae2);}return _0x4a4f01[_0x5e01('0x16')](_0x560ae2)[_0x5e01('0x17')]();};}function respondWithResult(_0x3ecf64,_0x16bc8f){_0x16bc8f=_0x16bc8f||0xc8;return function(_0x4bd426){if(_0x4bd426){return _0x3ecf64[_0x5e01('0x16')](_0x16bc8f)['json'](_0x4bd426);}};}function respondWithFilteredResult(_0x4ab9b2,_0x1df2e0){return function(_0x2dd70c){if(_0x2dd70c){var _0x494b8a=_0x2dd70c['count'],_0x27c6e7=_0x1df2e0[_0x5e01('0x18')],_0x5a532d=_0x1df2e0['offset']+_0x1df2e0[_0x5e01('0x19')],_0x4fb33e;if(_0x5a532d>=_0x494b8a){_0x5a532d=_0x494b8a;_0x4fb33e=0xc8;}else{_0x4fb33e=0xce;}_0x4ab9b2['status'](_0x4fb33e);return _0x4ab9b2['set'](_0x5e01('0x1a'),_0x27c6e7+'-'+_0x5a532d+'/'+_0x494b8a)[_0x5e01('0x1b')](_0x2dd70c);}return null;};}function patchUpdates(_0x4fa1c7){return function(_0xce3f3f){try{jsonpatch[_0x5e01('0x1c')](_0xce3f3f,_0x4fa1c7,!![]);}catch(_0x36b4a7){return BPromise[_0x5e01('0x1d')](_0x36b4a7);}return _0xce3f3f[_0x5e01('0x1e')]();};}function saveUpdates(_0x35eb4e,_0x173410){return function(_0x153eb1){if(_0x153eb1){return _0x153eb1['update'](_0x35eb4e)[_0x5e01('0x1f')](function(_0x208586){return _0x208586;});}return null;};}function removeEntity(_0x4b28ca,_0xf6fe3f){return function(_0x306cff){if(_0x306cff){return _0x306cff[_0x5e01('0x20')]()[_0x5e01('0x1f')](function(){var _0x1d99fd=_0x306cff[_0x5e01('0x21')]({'plain':!![]});var _0x5efff9=_0x5e01('0x22');return db[_0x5e01('0x23')][_0x5e01('0x20')]({'where':{'type':_0x5efff9,'resourceId':_0x1d99fd['id']}})[_0x5e01('0x1f')](function(){return _0x306cff;});})['then'](function(){_0x4b28ca[_0x5e01('0x16')](0xcc)[_0x5e01('0x17')]();});}};}function handleEntityNotFound(_0x31eb7f,_0x4f94d0){return function(_0x3df641){if(!_0x3df641){_0x31eb7f[_0x5e01('0x15')](0x194);}return _0x3df641;};}function handleError(_0x12a19a,_0x28344a){_0x28344a=_0x28344a||0x1f4;return function(_0x58dc6f){logger['error'](_0x58dc6f[_0x5e01('0x24')]);if(_0x58dc6f['name']){delete _0x58dc6f[_0x5e01('0x25')];}_0x12a19a[_0x5e01('0x16')](_0x28344a)[_0x5e01('0x26')](_0x58dc6f);};}exports[_0x5e01('0x27')]=function(_0x592a61,_0x531f0a){var _0x4a4a9f={},_0x51a98d={},_0x350ab4={'count':0x0,'rows':[]};var _0x5cd28e=_[_0x5e01('0x28')](db[_0x5e01('0x29')][_0x5e01('0x2a')],function(_0x494da9){return{'name':_0x494da9[_0x5e01('0x2b')],'type':_0x494da9[_0x5e01('0x2c')][_0x5e01('0x2d')]};});_0x51a98d[_0x5e01('0x2e')]=_['map'](_0x5cd28e,'name');_0x51a98d[_0x5e01('0x2f')]=_[_0x5e01('0x30')](_0x592a61[_0x5e01('0x2f')]);_0x51a98d[_0x5e01('0x31')]=_[_0x5e01('0x32')](_0x51a98d[_0x5e01('0x2e')],_0x51a98d[_0x5e01('0x2f')]);_0x4a4a9f[_0x5e01('0x33')]=_[_0x5e01('0x32')](_0x51a98d[_0x5e01('0x2e')],qs[_0x5e01('0x34')](_0x592a61[_0x5e01('0x2f')]['fields']));_0x4a4a9f[_0x5e01('0x33')]=_0x4a4a9f[_0x5e01('0x33')][_0x5e01('0x35')]?_0x4a4a9f['attributes']:_0x51a98d[_0x5e01('0x2e')];if(!_0x592a61[_0x5e01('0x2f')]['hasOwnProperty'](_0x5e01('0x36'))){_0x4a4a9f[_0x5e01('0x19')]=qs[_0x5e01('0x19')](_0x592a61['query'][_0x5e01('0x19')]);_0x4a4a9f[_0x5e01('0x18')]=qs[_0x5e01('0x18')](_0x592a61[_0x5e01('0x2f')][_0x5e01('0x18')]);}_0x4a4a9f[_0x5e01('0x37')]=qs[_0x5e01('0x38')](_0x592a61[_0x5e01('0x2f')][_0x5e01('0x38')]);_0x4a4a9f[_0x5e01('0x39')]=qs[_0x5e01('0x31')](_[_0x5e01('0x3a')](_0x592a61[_0x5e01('0x2f')],_0x51a98d[_0x5e01('0x31')]));if(_0x592a61[_0x5e01('0x2f')]['filter']){_0x4a4a9f[_0x5e01('0x39')]=_['merge'](_0x4a4a9f['where'],{'$or':_[_0x5e01('0x28')](_0x5cd28e,function(_0x2a62af){if(_0x2a62af[_0x5e01('0x2c')]!==_0x5e01('0x3b')){var _0x1003cd={};_0x1003cd[_0x2a62af['name']]={'$like':'%'+_0x592a61[_0x5e01('0x2f')][_0x5e01('0x3c')]+'%'};return _0x1003cd;}})});}_0x4a4a9f=_['merge']({},_0x4a4a9f,_0x592a61[_0x5e01('0x3d')]);var _0x28b0fd={'where':_0x4a4a9f[_0x5e01('0x39')]};return db['Disposition'][_0x5e01('0x3e')](_0x28b0fd)[_0x5e01('0x1f')](function(_0x503c8c){_0x350ab4[_0x5e01('0x3e')]=_0x503c8c;if(_0x592a61[_0x5e01('0x2f')]['includeAll']){_0x4a4a9f['include']=[{'all':!![]}];}return db[_0x5e01('0x29')]['findAll'](_0x4a4a9f);})[_0x5e01('0x1f')](function(_0x1b1d35){_0x350ab4[_0x5e01('0x3f')]=_0x1b1d35;return _0x350ab4;})[_0x5e01('0x1f')](respondWithFilteredResult(_0x531f0a,_0x4a4a9f))['catch'](handleError(_0x531f0a,null));};exports[_0x5e01('0x40')]=function(_0xb93846,_0x23275f){var _0x44a5e4={'raw':!![],'where':{'id':_0xb93846[_0x5e01('0x41')]['id']}},_0x3791e8={};_0x3791e8[_0x5e01('0x2e')]=_['keys'](db[_0x5e01('0x29')][_0x5e01('0x2a')]);_0x3791e8[_0x5e01('0x2f')]=_[_0x5e01('0x30')](_0xb93846[_0x5e01('0x2f')]);_0x3791e8['filters']=_[_0x5e01('0x32')](_0x3791e8[_0x5e01('0x2e')],_0x3791e8[_0x5e01('0x2f')]);_0x44a5e4[_0x5e01('0x33')]=_[_0x5e01('0x32')](_0x3791e8[_0x5e01('0x2e')],qs[_0x5e01('0x34')](_0xb93846['query'][_0x5e01('0x34')]));_0x44a5e4['attributes']=_0x44a5e4[_0x5e01('0x33')][_0x5e01('0x35')]?_0x44a5e4[_0x5e01('0x33')]:_0x3791e8[_0x5e01('0x2e')];if(_0xb93846[_0x5e01('0x2f')][_0x5e01('0x42')]){_0x44a5e4['include']=[{'all':!![]}];}_0x44a5e4=_[_0x5e01('0x43')]({},_0x44a5e4,_0xb93846['options']);return db[_0x5e01('0x29')][_0x5e01('0x44')](_0x44a5e4)[_0x5e01('0x1f')](handleEntityNotFound(_0x23275f,null))[_0x5e01('0x1f')](respondWithResult(_0x23275f,null))[_0x5e01('0x45')](handleError(_0x23275f,null));};exports[_0x5e01('0x46')]=function(_0x555204,_0x5cf1e4){return db[_0x5e01('0x29')][_0x5e01('0x46')](_0x555204[_0x5e01('0x47')],{})[_0x5e01('0x1f')](function(_0x3d5bfb){var _0x389520=_0x555204[_0x5e01('0x48')][_0x5e01('0x21')]({'plain':!![]});if(!_0x389520)throw new Error(_0x5e01('0x49'));if(_0x389520[_0x5e01('0x4a')]===_0x5e01('0x48')){var _0x5cd7ec=_0x3d5bfb[_0x5e01('0x21')]({'plain':!![]});var _0x426ab8=_0x5e01('0x22');return db['UserProfileSection'][_0x5e01('0x44')]({'where':{'name':_0x426ab8,'userProfileId':_0x389520[_0x5e01('0x4b')]},'raw':!![]})[_0x5e01('0x1f')](function(_0xa8ff1b){if(_0xa8ff1b&&_0xa8ff1b[_0x5e01('0x4c')]===0x0){return db['UserProfileResource'][_0x5e01('0x46')]({'name':_0x5cd7ec['name'],'resourceId':_0x5cd7ec['id'],'type':_0xa8ff1b[_0x5e01('0x25')],'sectionId':_0xa8ff1b['id']},{})[_0x5e01('0x1f')](function(){return _0x3d5bfb;});}else{return _0x3d5bfb;}})[_0x5e01('0x45')](function(_0x4c368c){logger[_0x5e01('0x4d')](_0x5e01('0x4e'),_0x4c368c);throw _0x4c368c;});}return _0x3d5bfb;})[_0x5e01('0x1f')](respondWithResult(_0x5cf1e4,0xc9))[_0x5e01('0x45')](handleError(_0x5cf1e4,null));};exports[_0x5e01('0x4f')]=function(_0x4f7784,_0x2b4ba9){if(_0x4f7784[_0x5e01('0x47')]['id']){delete _0x4f7784[_0x5e01('0x47')]['id'];}return db[_0x5e01('0x29')][_0x5e01('0x44')]({'where':{'id':_0x4f7784[_0x5e01('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b4ba9,null))[_0x5e01('0x1f')](saveUpdates(_0x4f7784['body'],null))[_0x5e01('0x1f')](respondWithResult(_0x2b4ba9,null))[_0x5e01('0x45')](handleError(_0x2b4ba9,null));};exports[_0x5e01('0x20')]=function(_0x5012cb,_0x222a13){return db[_0x5e01('0x29')]['find']({'where':{'id':_0x5012cb[_0x5e01('0x41')]['id']}})['then'](handleEntityNotFound(_0x222a13,null))[_0x5e01('0x1f')](removeEntity(_0x222a13,null))[_0x5e01('0x45')](handleError(_0x222a13,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3925868..7f54bb3 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 _0x335c=['../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f1a37,_0x14ba3e){var _0x437841=function(_0x57e4ab){while(--_0x57e4ab){_0x3f1a37['push'](_0x3f1a37['shift']());}};_0x437841(++_0x14ba3e);}(_0x335c,0x1dd));var _0xc335=function(_0x156e2a,_0x5c2d06){_0x156e2a=_0x156e2a-0x0;var _0x239cea=_0x335c[_0x156e2a];return _0x239cea;};'use strict';var _=require(_0xc335('0x0'));var util=require(_0xc335('0x1'));var logger=require(_0xc335('0x2'))(_0xc335('0x3'));var moment=require(_0xc335('0x4'));var BPromise=require(_0xc335('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc335('0x6'));var attributes=require(_0xc335('0x7'));module[_0xc335('0x8')]=function(_0x5e4be3,_0x3658f7){return _0x5e4be3[_0xc335('0x9')](_0xc335('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xc335('0xb'),'fields':[_0xc335('0xc'),_0xc335('0xd')]},{'unique':!![],'name':_0xc335('0xe'),'fields':[_0xc335('0xc'),_0xc335('0xf')]},{'unique':!![],'name':_0xc335('0x10'),'fields':[_0xc335('0xc'),_0xc335('0x11')]},{'unique':!![],'name':_0xc335('0x12'),'fields':['name',_0xc335('0x13')]},{'unique':!![],'name':'name_fax','fields':['name',_0xc335('0x14')]},{'unique':!![],'name':_0xc335('0x15'),'fields':[_0xc335('0xc'),_0xc335('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['MailAccountId','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','lodash','util','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId'];(function(_0x165546,_0xd3b158){var _0x2be60c=function(_0x25a4cb){while(--_0x25a4cb){_0x165546['push'](_0x165546['shift']());}};_0x2be60c(++_0xd3b158);}(_0xb7e7,0x109));var _0x7b7e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xb7e7[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x7b7e('0x0'));var util=require(_0x7b7e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b7e('0x2'));var rimraf=require(_0x7b7e('0x3'));var config=require(_0x7b7e('0x4'));var attributes=require(_0x7b7e('0x5'));module[_0x7b7e('0x6')]=function(_0x4552ee,_0x168afb){return _0x4552ee[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':_0x7b7e('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7b7e('0xa'),'fields':[_0x7b7e('0xb'),_0x7b7e('0xc')]},{'unique':!![],'name':_0x7b7e('0xd'),'fields':['name',_0x7b7e('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0x7b7e('0xb'),_0x7b7e('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0x7b7e('0xb'),_0x7b7e('0x10')]},{'unique':!![],'name':_0x7b7e('0x11'),'fields':[_0x7b7e('0xb'),_0x7b7e('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x7b7e('0xb'),_0x7b7e('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 0934970..95ff6ac 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 _0xddbf=['request\x20sent','debug','Disposition,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xc5123c,_0xd896d0){var _0x163540=function(_0x75bd2c){while(--_0x75bd2c){_0xc5123c['push'](_0xc5123c['shift']());}};_0x163540(++_0xd896d0);}(_0xddbf,0x1d5));var _0xfddb=function(_0x3ba27f,_0x308ae4){_0x3ba27f=_0x3ba27f-0x0;var _0x3511d9=_0xddbf[_0x3ba27f];return _0x3511d9;};'use strict';var _=require('lodash');var util=require(_0xfddb('0x0'));var moment=require(_0xfddb('0x1'));var BPromise=require(_0xfddb('0x2'));var rs=require(_0xfddb('0x3'));var fs=require('fs');var Redis=require(_0xfddb('0x4'));var db=require(_0xfddb('0x5'))['db'];var utils=require(_0xfddb('0x6'));var logger=require(_0xfddb('0x7'))(_0xfddb('0x8'));var config=require(_0xfddb('0x9'));var jayson=require(_0xfddb('0xa'));var client=jayson[_0xfddb('0xb')][_0xfddb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59f32f,_0x56ba35,_0x30b8e5){return new BPromise(function(_0x285b3f,_0x53864a){return client[_0xfddb('0xd')](_0x59f32f,_0x30b8e5)[_0xfddb('0xe')](function(_0xf40bf1){logger['info']('Disposition,\x20%s,\x20%s',_0x56ba35,_0xfddb('0xf'));logger[_0xfddb('0x10')]('Disposition,\x20%s,\x20%s,\x20%s',_0x56ba35,_0xfddb('0xf'),JSON['stringify'](_0xf40bf1));if(_0xf40bf1['error']){if(_0xf40bf1['error']['code']===0x1f4){logger['error'](_0xfddb('0x11'),_0x56ba35,_0xf40bf1[_0xfddb('0x12')][_0xfddb('0x13')]);return _0x53864a(_0xf40bf1['error'][_0xfddb('0x13')]);}logger[_0xfddb('0x12')](_0xfddb('0x11'),_0x56ba35,_0xf40bf1[_0xfddb('0x12')][_0xfddb('0x13')]);return _0x285b3f(_0xf40bf1[_0xfddb('0x12')]['message']);}else{logger['info'](_0xfddb('0x11'),_0x56ba35,_0xfddb('0xf'));_0x285b3f(_0xf40bf1[_0xfddb('0x14')][_0xfddb('0x13')]);}})[_0xfddb('0x15')](function(_0x1a6a18){logger['error']('Disposition,\x20%s,\x20%s',_0x56ba35,_0x1a6a18);_0x53864a(_0x1a6a18);});});} \ No newline at end of file +var _0xedbc=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xedbc,0x1d0));var _0xcedb=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xedbc[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xcedb('0x0'));var util=require(_0xcedb('0x1'));var moment=require(_0xcedb('0x2'));var BPromise=require(_0xcedb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcedb('0x4'));var db=require(_0xcedb('0x5'))['db'];var utils=require(_0xcedb('0x6'));var logger=require(_0xcedb('0x7'))(_0xcedb('0x8'));var config=require(_0xcedb('0x9'));var jayson=require(_0xcedb('0xa'));var client=jayson['client'][_0xcedb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10b396,_0x59e1e0,_0x1aa32){return new BPromise(function(_0x51e540,_0x2ac735){return client[_0xcedb('0xc')](_0x10b396,_0x1aa32)[_0xcedb('0xd')](function(_0x510048){logger[_0xcedb('0xe')](_0xcedb('0xf'),_0x59e1e0,_0xcedb('0x10'));logger['debug'](_0xcedb('0x11'),_0x59e1e0,_0xcedb('0x10'),JSON[_0xcedb('0x12')](_0x510048));if(_0x510048['error']){if(_0x510048[_0xcedb('0x13')]['code']===0x1f4){logger[_0xcedb('0x13')]('Disposition,\x20%s,\x20%s',_0x59e1e0,_0x510048[_0xcedb('0x13')][_0xcedb('0x14')]);return _0x2ac735(_0x510048[_0xcedb('0x13')]['message']);}logger[_0xcedb('0x13')](_0xcedb('0xf'),_0x59e1e0,_0x510048[_0xcedb('0x13')][_0xcedb('0x14')]);return _0x51e540(_0x510048[_0xcedb('0x13')]['message']);}else{logger[_0xcedb('0xe')]('Disposition,\x20%s,\x20%s',_0x59e1e0,'request\x20sent');_0x51e540(_0x510048['result']['message']);}})[_0xcedb('0x15')](function(_0x21ab38){logger[_0xcedb('0x13')](_0xcedb('0xf'),_0x59e1e0,_0x21ab38);_0x2ac735(_0x21ab38);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 2a714ba..5dd901f 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 _0x09d2=['./disposition.controller','isAuthenticated','index','get','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41981b,_0x302953){var _0x21c7df=function(_0x6556f9){while(--_0x6556f9){_0x41981b['push'](_0x41981b['shift']());}};_0x21c7df(++_0x302953);}(_0x09d2,0x1d2));var _0x209d=function(_0x515853,_0x4d3a40){_0x515853=_0x515853-0x0;var _0xd19f34=_0x09d2[_0x515853];return _0xd19f34;};'use strict';var multer=require(_0x209d('0x0'));var util=require(_0x209d('0x1'));var path=require(_0x209d('0x2'));var timeout=require(_0x209d('0x3'));var express=require(_0x209d('0x4'));var router=express[_0x209d('0x5')]();var auth=require(_0x209d('0x6'));var interaction=require(_0x209d('0x7'));var config=require(_0x209d('0x8'));var controller=require(_0x209d('0x9'));router['get']('/',auth[_0x209d('0xa')](),controller[_0x209d('0xb')]);router[_0x209d('0xc')](_0x209d('0xd'),auth[_0x209d('0xa')](),controller['show']);router['post']('/',auth[_0x209d('0xa')](),controller[_0x209d('0xe')]);router[_0x209d('0xf')]('/:id',auth[_0x209d('0xa')](),controller['update']);router[_0x209d('0x10')](_0x209d('0xd'),auth[_0x209d('0xa')](),controller[_0x209d('0x11')]);module[_0x209d('0x12')]=router; \ No newline at end of file +var _0x3646=['isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x29734d,_0x56d2a7){var _0x548bd4=function(_0x2efadd){while(--_0x2efadd){_0x29734d['push'](_0x29734d['shift']());}};_0x548bd4(++_0x56d2a7);}(_0x3646,0x15f));var _0x6364=function(_0x525fa8,_0x6510f6){_0x525fa8=_0x525fa8-0x0;var _0x3affb=_0x3646[_0x525fa8];return _0x3affb;};'use strict';var multer=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var path=require(_0x6364('0x2'));var timeout=require(_0x6364('0x3'));var express=require('express');var router=express[_0x6364('0x4')]();var auth=require(_0x6364('0x5'));var interaction=require(_0x6364('0x6'));var config=require(_0x6364('0x7'));var controller=require(_0x6364('0x8'));router[_0x6364('0x9')]('/',auth[_0x6364('0xa')](),controller[_0x6364('0xb')]);router[_0x6364('0x9')](_0x6364('0xc'),auth[_0x6364('0xa')](),controller['show']);router[_0x6364('0xd')]('/',auth[_0x6364('0xa')](),controller[_0x6364('0xe')]);router[_0x6364('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6364('0x10')](_0x6364('0xc'),auth[_0x6364('0xa')](),controller[_0x6364('0x11')]);module[_0x6364('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 8b4d477..d77d7a2 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 _0x7d5f=['v17,v27,v29','INTEGER','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','14400','7200','12000'];(function(_0x59fdba,_0xd5590c){var _0x232e5f=function(_0x383959){while(--_0x383959){_0x59fdba['push'](_0x59fdba['shift']());}};_0x232e5f(++_0xd5590c);}(_0x7d5f,0x8e));var _0xf7d5=function(_0x1f6cb9,_0x2f330e){_0x1f6cb9=_0x1f6cb9-0x0;var _0xa94d56=_0x7d5f[_0x1f6cb9];return _0xa94d56;};'use strict';var Sequelize=require(_0xf7d5('0x0'));module['exports']={'name':{'type':Sequelize[_0xf7d5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf7d5('0x1')]},'ecm':{'type':Sequelize[_0xf7d5('0x2')]('yes','no'),'defaultValue':_0xf7d5('0x3')},'headerinfo':{'type':Sequelize[_0xf7d5('0x1')],'defaultValue':_0xf7d5('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xf7d5('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xf7d5('0x6'),_0xf7d5('0x7'),'7200',_0xf7d5('0x8'),'12000',_0xf7d5('0x9')),'defaultValue':_0xf7d5('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0xf7d5('0x6'),_0xf7d5('0x7'),_0xf7d5('0xa'),_0xf7d5('0x8'),_0xf7d5('0xb'),_0xf7d5('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xf7d5('0x1')],'defaultValue':_0xf7d5('0xc')},'gateway':{'type':Sequelize[_0xf7d5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf7d5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf7d5('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf7d5('0x2')]('SIP','IAX','DADHI',_0xf7d5('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf7d5('0xf')],'defaultValue':function(){return _0xf7d5('0x10');}},'notificationSound':{'type':Sequelize[_0xf7d5('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf7d5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf7d5('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf7d5('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf7d5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf7d5('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xf7d5('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x43ca70){if(!_0x43ca70)this[_0xf7d5('0x13')](_0xf7d5('0x14'),null);this['setDataValue'](_0xf7d5('0x15'),_0x43ca70);}}}; \ No newline at end of file +var _0xd1d8=['9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes','localstationid','2400','4800','7200'];(function(_0x3afe85,_0x373f90){var _0x365620=function(_0x5f12de){while(--_0x5f12de){_0x3afe85['push'](_0x3afe85['shift']());}};_0x365620(++_0x373f90);}(_0xd1d8,0x92));var _0x8d1d=function(_0x9ac2cb,_0x1b0500){_0x9ac2cb=_0x9ac2cb-0x0;var _0x217bf3=_0xd1d8[_0x9ac2cb];return _0x217bf3;};'use strict';var Sequelize=require('sequelize');module[_0x8d1d('0x0')]={'name':{'type':Sequelize[_0x8d1d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8d1d('0x1')]},'ecm':{'type':Sequelize[_0x8d1d('0x2')](_0x8d1d('0x3'),'no'),'defaultValue':_0x8d1d('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x8d1d('0x1')],'unique':_0x8d1d('0x4')},'minrate':{'type':Sequelize[_0x8d1d('0x2')](_0x8d1d('0x5'),_0x8d1d('0x6'),_0x8d1d('0x7'),_0x8d1d('0x8'),_0x8d1d('0x9'),_0x8d1d('0xa')),'defaultValue':_0x8d1d('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0x8d1d('0x5'),'4800',_0x8d1d('0x7'),_0x8d1d('0x8'),_0x8d1d('0x9'),_0x8d1d('0xa')),'defaultValue':_0x8d1d('0xa')},'modem':{'type':Sequelize[_0x8d1d('0x1')],'defaultValue':_0x8d1d('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8d1d('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8d1d('0x2')](_0x8d1d('0xd'),_0x8d1d('0xe'),'DADHI',_0x8d1d('0xf')),'defaultValue':_0x8d1d('0xd')},'key':{'type':Sequelize[_0x8d1d('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8d1d('0x10')],'defaultValue':function(){return _0x8d1d('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8d1d('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8d1d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8d1d('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8d1d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d1d('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8d1d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d1d('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8d1d('0x12')],'defaultValue':![],'comment':_0x8d1d('0x13'),'set':function(_0x5e4636){if(!_0x5e4636)this[_0x8d1d('0x14')](_0x8d1d('0x15'),null);this[_0x8d1d('0x14')]('mandatoryDisposition',_0x5e4636);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 1d30a10..867fa51 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 _0x2ef3=['bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','client','http','test','Sequelize','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','set','apply','update','get','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','minrate','modem','t38timeout','/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','transaction','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3f8c89,_0x249f96){var _0x1f3c90=function(_0x40a4e0){while(--_0x40a4e0){_0x3f8c89['push'](_0x3f8c89['shift']());}};_0x1f3c90(++_0x249f96);}(_0x2ef3,0xba));var _0x32ef=function(_0x161682,_0x1e4671){_0x161682=_0x161682-0x0;var _0x3642e3=_0x2ef3[_0x161682];return _0x3642e3;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x32ef('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232c});var client9002=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x57aff1,_0x55bf0b,_0x531e30){if(_0x531e30){var _0x13db1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13db1a[_0x32ef('0x1f')](_0x55bf0b)){return _0x57aff1;}else{throw new db[(_0x32ef('0x20'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x57aff1;}}function respondWithRpcPromise(_0x1eb468,_0x1a9476,_0x286bfb,_0x57863c){return new BPromise(function(_0xbe37f6,_0x33e230){var _0x4f4c98=_0x57863c||client;return _0x4f4c98[_0x32ef('0x21')](_0x1eb468,_0x286bfb)[_0x32ef('0x22')](function(_0x26aff3){logger[_0x32ef('0x23')](_0x32ef('0x24'),_0x1a9476,_0x32ef('0x25'));logger['debug'](_0x32ef('0x26'),_0x1a9476,'request\x20sent',JSON[_0x32ef('0x27')](_0x26aff3));if(_0x26aff3[_0x32ef('0x28')]){if(_0x26aff3['error'][_0x32ef('0x29')]===0x1f4){logger[_0x32ef('0x28')](_0x32ef('0x24'),_0x1a9476,_0x26aff3['error']['message']);return _0x33e230(_0x26aff3[_0x32ef('0x28')][_0x32ef('0x2a')]);}logger[_0x32ef('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1a9476,_0x26aff3['error'][_0x32ef('0x2a')]);return _0xbe37f6(_0x26aff3['error']['message']);}else{logger[_0x32ef('0x23')](_0x32ef('0x24'),_0x1a9476,_0x32ef('0x25'));_0xbe37f6(_0x26aff3[_0x32ef('0x2b')][_0x32ef('0x2a')]);}})[_0x32ef('0x2c')](function(_0x1874ea){logger[_0x32ef('0x28')](_0x32ef('0x24'),_0x1a9476,_0x1874ea);_0x33e230(_0x1874ea);});});}function respondWithStatusCode(_0x2f52d7,_0x1335e2){_0x1335e2=_0x1335e2||0xcc;return function(_0xba4b3f){if(_0xba4b3f){return _0x2f52d7['sendStatus'](_0x1335e2);}return _0x2f52d7[_0x32ef('0x2d')](_0x1335e2)[_0x32ef('0x2e')]();};}function respondWithResult(_0x5a04cd,_0x12de1a){_0x12de1a=_0x12de1a||0xc8;return function(_0x3c569d){if(_0x3c569d){return _0x5a04cd[_0x32ef('0x2d')](_0x12de1a)[_0x32ef('0x2f')](_0x3c569d);}};}function respondWithFilteredResult(_0x50a95b,_0x10e38c){return function(_0x22bf86){if(_0x22bf86){var _0x31dbc3=_0x22bf86[_0x32ef('0x30')],_0x2ac686=_0x10e38c['offset'],_0x1b668a=_0x10e38c[_0x32ef('0x31')]+_0x10e38c['limit'],_0x1a6ed2;if(_0x1b668a>=_0x31dbc3){_0x1b668a=_0x31dbc3;_0x1a6ed2=0xc8;}else{_0x1a6ed2=0xce;}_0x50a95b[_0x32ef('0x2d')](_0x1a6ed2);return _0x50a95b[_0x32ef('0x32')]('Content-Range',_0x2ac686+'-'+_0x1b668a+'/'+_0x31dbc3)[_0x32ef('0x2f')](_0x22bf86);}return null;};}function patchUpdates(_0x17e4d1){return function(_0x3b00ad){try{jsonpatch[_0x32ef('0x33')](_0x3b00ad,_0x17e4d1,!![]);}catch(_0x120f30){return BPromise['reject'](_0x120f30);}return _0x3b00ad['save']();};}function saveUpdates(_0x2a5eb5,_0x5dadf7){return function(_0x643dc4){if(_0x643dc4){return _0x643dc4[_0x32ef('0x34')](_0x2a5eb5)[_0x32ef('0x22')](function(_0x390670){return _0x390670;});}return null;};}function removeEntity(_0x389583,_0x22fa1a){return function(_0x566b56){if(_0x566b56){return _0x566b56['destroy']()['then'](function(){var _0x2261a6=_0x566b56[_0x32ef('0x35')]({'plain':!![]});var _0x136b02='FaxAccounts';return db['UserProfileResource'][_0x32ef('0x36')]({'where':{'type':_0x136b02,'resourceId':_0x2261a6['id']}})[_0x32ef('0x22')](function(){return _0x566b56;});})[_0x32ef('0x22')](function(){_0x389583['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcbdec8,_0x21706f){return function(_0x3ed1b0){if(!_0x3ed1b0){_0xcbdec8[_0x32ef('0x37')](0x194);}return _0x3ed1b0;};}function handleError(_0x3a7c49,_0x211c79){_0x211c79=_0x211c79||0x1f4;return function(_0x3223d5){logger[_0x32ef('0x28')](_0x3223d5[_0x32ef('0x38')]);if(_0x3223d5['name']){delete _0x3223d5[_0x32ef('0x39')];}_0x3a7c49[_0x32ef('0x2d')](_0x211c79)[_0x32ef('0x3a')](_0x3223d5);};}exports['index']=function(_0x365125,_0x17e489){var _0x879e33={'include':[{'model':db[_0x32ef('0x3b')],'as':_0x32ef('0x3c')}]},_0x393a89={},_0x1faf72={'count':0x0,'rows':[]};var _0x1cebed=_[_0x32ef('0x3d')](db[_0x32ef('0x3e')][_0x32ef('0x3f')],function(_0x4615b4){return{'name':_0x4615b4['fieldName'],'type':_0x4615b4[_0x32ef('0x40')][_0x32ef('0x41')]};});_0x393a89[_0x32ef('0x42')]=_[_0x32ef('0x3d')](_0x1cebed,_0x32ef('0x39'));_0x393a89[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x365125['query']);_0x393a89['filters']=_[_0x32ef('0x45')](_0x393a89[_0x32ef('0x42')],_0x393a89[_0x32ef('0x43')]);_0x879e33[_0x32ef('0x46')]=_['intersection'](_0x393a89[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x365125['query'][_0x32ef('0x47')]));_0x879e33['attributes']=_0x879e33[_0x32ef('0x46')][_0x32ef('0x48')]?_0x879e33[_0x32ef('0x46')]:_0x393a89[_0x32ef('0x42')];if(!_0x365125[_0x32ef('0x43')][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x879e33[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x365125[_0x32ef('0x43')]['limit']);_0x879e33[_0x32ef('0x31')]=qs['offset'](_0x365125[_0x32ef('0x43')][_0x32ef('0x31')]);}_0x879e33[_0x32ef('0x4c')]=qs['sort'](_0x365125[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x879e33[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x365125[_0x32ef('0x43')],_0x393a89[_0x32ef('0x4f')]));if(_0x365125['query']['filter']){_0x879e33[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x879e33[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x1cebed,function(_0x209361){if(_0x209361[_0x32ef('0x40')]!==_0x32ef('0x52')){var _0x115fa3={};_0x115fa3[_0x209361[_0x32ef('0x39')]]={'$like':'%'+_0x365125[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x115fa3;}})});}_0x879e33=_[_0x32ef('0x51')]({},_0x879e33,_0x365125[_0x32ef('0x54')]);var _0x4c2534={'where':_0x879e33[_0x32ef('0x4e')]};return db[_0x32ef('0x3e')][_0x32ef('0x30')](_0x4c2534)[_0x32ef('0x22')](function(_0x1cc9f3){_0x1faf72[_0x32ef('0x30')]=_0x1cc9f3;if(_0x365125[_0x32ef('0x43')][_0x32ef('0x55')]){_0x879e33[_0x32ef('0x56')]=[{'all':!![]}];}return db[_0x32ef('0x3e')][_0x32ef('0x57')](_0x879e33);})[_0x32ef('0x22')](function(_0x272377){_0x1faf72[_0x32ef('0x58')]=_0x272377;return _0x1faf72;})[_0x32ef('0x22')](respondWithFilteredResult(_0x17e489,_0x879e33))[_0x32ef('0x2c')](handleError(_0x17e489,null));};exports[_0x32ef('0x59')]=function(_0x2c1b44,_0x4e0d6b){var _0x515ac9={'raw':![],'where':{'id':_0x2c1b44[_0x32ef('0x5a')]['id']},'include':[{'model':db[_0x32ef('0x3b')],'as':_0x32ef('0x3c')}]},_0x179c2f={};_0x179c2f[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x3e')][_0x32ef('0x3f')]);_0x179c2f[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x2c1b44[_0x32ef('0x43')]);_0x179c2f['filters']=_[_0x32ef('0x45')](_0x179c2f[_0x32ef('0x42')],_0x179c2f[_0x32ef('0x43')]);_0x515ac9[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x179c2f[_0x32ef('0x42')],qs['fields'](_0x2c1b44[_0x32ef('0x43')][_0x32ef('0x47')]));_0x515ac9[_0x32ef('0x46')]=_0x515ac9['attributes'][_0x32ef('0x48')]?_0x515ac9['attributes']:_0x179c2f[_0x32ef('0x42')];if(_0x2c1b44[_0x32ef('0x43')]['includeAll']){_0x515ac9[_0x32ef('0x56')]=[{'all':!![]}];}_0x515ac9=_['merge']({},_0x515ac9,_0x2c1b44[_0x32ef('0x54')]);return db[_0x32ef('0x3e')][_0x32ef('0x5b')](_0x515ac9)[_0x32ef('0x22')](handleEntityNotFound(_0x4e0d6b,null))[_0x32ef('0x22')](respondWithResult(_0x4e0d6b,null))[_0x32ef('0x2c')](handleError(_0x4e0d6b,null));};exports[_0x32ef('0x5c')]=function(_0x56260f,_0x56cc75){return db[_0x32ef('0x3e')]['create'](_0x56260f['body'],{})[_0x32ef('0x22')](function(_0x89d0b3){var _0x2ef0f8=_0x56260f[_0x32ef('0x5d')][_0x32ef('0x35')]({'plain':!![]});if(!_0x2ef0f8)throw new Error(_0x32ef('0x5e'));if(_0x2ef0f8[_0x32ef('0x5f')]===_0x32ef('0x5d')){var _0x2b2cd4=_0x89d0b3[_0x32ef('0x35')]({'plain':!![]});var _0x4c125c='FaxAccounts';return db[_0x32ef('0x60')][_0x32ef('0x5b')]({'where':{'name':_0x4c125c,'userProfileId':_0x2ef0f8['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x12e1ef){if(_0x12e1ef&&_0x12e1ef[_0x32ef('0x61')]===0x0){return db['UserProfileResource'][_0x32ef('0x5c')]({'name':_0x2b2cd4[_0x32ef('0x39')],'resourceId':_0x2b2cd4['id'],'type':_0x12e1ef[_0x32ef('0x39')],'sectionId':_0x12e1ef['id']},{})['then'](function(){return _0x89d0b3;});}else{return _0x89d0b3;}})['catch'](function(_0x13ea1a){logger['error'](_0x32ef('0x62'),_0x13ea1a);throw _0x13ea1a;});}return _0x89d0b3;})['then'](respondWithResult(_0x56cc75,0xc9))['catch'](handleError(_0x56cc75,null));};exports[_0x32ef('0x34')]=function(_0x208989,_0x10cb37){if(_0x208989['body']['id']){delete _0x208989[_0x32ef('0x63')]['id'];}return db[_0x32ef('0x3e')][_0x32ef('0x5b')]({'where':{'id':_0x208989['params']['id']},'include':[{'model':db[_0x32ef('0x3b')],'as':_0x32ef('0x3c')}]})['then'](handleEntityNotFound(_0x10cb37,null))['then'](saveUpdates(_0x208989[_0x32ef('0x63')],null))[_0x32ef('0x22')](respondWithResult(_0x10cb37,null))[_0x32ef('0x2c')](handleError(_0x10cb37,null));};exports[_0x32ef('0x36')]=function(_0x4c4df8,_0x40700e){return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0x4c4df8[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x40700e,null))[_0x32ef('0x22')](removeEntity(_0x40700e,null))[_0x32ef('0x2c')](handleError(_0x40700e,null));};exports[_0x32ef('0x64')]=function(_0x1dc755,_0x3ff282){return db[_0x32ef('0x3e')]['describe']()[_0x32ef('0x22')](respondWithResult(_0x3ff282,null))[_0x32ef('0x2c')](handleError(_0x3ff282,null));};exports[_0x32ef('0x65')]=function(_0x1c629d,_0x79ae28,_0x5ad75c){if(_0x1c629d['body']['id']){delete _0x1c629d[_0x32ef('0x63')]['id'];}return db[_0x32ef('0x3e')][_0x32ef('0x5b')]({'where':{'id':_0x1c629d[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x79ae28,null))['then'](function(_0x3372d9){if(_0x3372d9){_0x1c629d['body'][_0x32ef('0x66')]=_0x3372d9['id'];return db[_0x32ef('0x67')]['create'](_0x1c629d['body']);}})[_0x32ef('0x22')](respondWithResult(_0x79ae28,null))[_0x32ef('0x2c')](handleError(_0x79ae28,null));};exports[_0x32ef('0x68')]=function(_0x5b378b,_0x52b63b,_0x3b4a8e){var _0x5edd29={'raw':![],'where':{}};var _0x7d2c3a={};var _0x416e62={'count':0x0,'rows':[]};return db['FaxAccount'][_0x32ef('0x69')]({'where':{'id':_0x5b378b[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x52b63b,null))[_0x32ef('0x22')](function(_0x9df27c){if(_0x9df27c){_0x7d2c3a[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x67')][_0x32ef('0x3f')]);_0x7d2c3a[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x5b378b[_0x32ef('0x43')]);_0x7d2c3a['filters']=_['intersection'](_0x7d2c3a[_0x32ef('0x42')],_0x7d2c3a[_0x32ef('0x43')]);_0x5edd29['attributes']=_[_0x32ef('0x45')](_0x7d2c3a['model'],qs[_0x32ef('0x47')](_0x5b378b[_0x32ef('0x43')][_0x32ef('0x47')]));_0x5edd29['attributes']=_0x5edd29[_0x32ef('0x46')]['length']?_0x5edd29[_0x32ef('0x46')]:_0x7d2c3a[_0x32ef('0x42')];if(!_0x5b378b['query']['hasOwnProperty'](_0x32ef('0x4a'))){_0x5edd29['limit']=qs[_0x32ef('0x4b')](_0x5b378b['query'][_0x32ef('0x4b')]);_0x5edd29[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x5b378b['query']['offset']);}_0x5edd29['order']=qs[_0x32ef('0x4d')](_0x5b378b['query'][_0x32ef('0x4d')]);_0x5edd29[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x5b378b[_0x32ef('0x43')],_0x7d2c3a[_0x32ef('0x4f')]));_0x5edd29['where'][_0x32ef('0x66')]=_0x9df27c['id'];if(_0x5b378b['query']['filter']){_0x5edd29[_0x32ef('0x4e')]=_['merge'](_0x5edd29[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x5edd29['attributes'],function(_0x232b40){var _0x282805={};_0x282805[_0x232b40]={'$like':'%'+_0x5b378b[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x282805;})});}_0x5edd29=_[_0x32ef('0x51')]({},_0x5edd29,_0x5b378b[_0x32ef('0x54')]);return db['Disposition']['count']({'where':_0x5edd29[_0x32ef('0x4e')]})['then'](function(_0x41bbe1){_0x416e62[_0x32ef('0x30')]=_0x41bbe1;if(_0x5b378b[_0x32ef('0x43')][_0x32ef('0x55')]){_0x5edd29[_0x32ef('0x56')]=[{'all':!![]}];}return db[_0x32ef('0x67')]['findAll'](_0x5edd29);})[_0x32ef('0x22')](function(_0x146f8c){_0x416e62[_0x32ef('0x58')]=_0x146f8c;return _0x416e62;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x52b63b,_0x5edd29))[_0x32ef('0x2c')](handleError(_0x52b63b,null));};exports['removeDispositions']=function(_0x4b7e72,_0x27e4b4,_0x904a4f){return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0x4b7e72[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x27e4b4,null))[_0x32ef('0x22')](function(_0xc3664d){if(_0xc3664d){return _0xc3664d[_0x32ef('0x6a')](_0x4b7e72[_0x32ef('0x43')][_0x32ef('0x6b')]);}})[_0x32ef('0x22')](respondWithStatusCode(_0x27e4b4,null))['catch'](handleError(_0x27e4b4,null));};exports[_0x32ef('0x6c')]=function(_0xefbbf2,_0x4e5819,_0x35653b){if(_0xefbbf2['body']['id']){delete _0xefbbf2[_0x32ef('0x63')]['id'];}return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0xefbbf2[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x4e5819,null))[_0x32ef('0x22')](function(_0x49dc18){if(_0x49dc18){_0xefbbf2[_0x32ef('0x63')][_0x32ef('0x66')]=_0x49dc18['id'];return db[_0x32ef('0x6d')]['create'](_0xefbbf2['body']);}})['then'](respondWithResult(_0x4e5819,null))[_0x32ef('0x2c')](handleError(_0x4e5819,null));};exports[_0x32ef('0x6e')]=function(_0x1ec12d,_0x34fd2b,_0x3cc90c){var _0x5a1696={'raw':![],'where':{}};var _0x2678e3={};var _0x5b3deb={'count':0x0,'rows':[]};return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x1ec12d[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x34fd2b,null))[_0x32ef('0x22')](function(_0x42d2d4){if(_0x42d2d4){_0x2678e3[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x6d')]['rawAttributes']);_0x2678e3[_0x32ef('0x43')]=_['keys'](_0x1ec12d[_0x32ef('0x43')]);_0x2678e3[_0x32ef('0x4f')]=_['intersection'](_0x2678e3['model'],_0x2678e3[_0x32ef('0x43')]);_0x5a1696[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x2678e3[_0x32ef('0x42')],qs['fields'](_0x1ec12d[_0x32ef('0x43')]['fields']));_0x5a1696['attributes']=_0x5a1696[_0x32ef('0x46')]['length']?_0x5a1696[_0x32ef('0x46')]:_0x2678e3[_0x32ef('0x42')];if(!_0x1ec12d[_0x32ef('0x43')]['hasOwnProperty']('nolimit')){_0x5a1696[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x1ec12d[_0x32ef('0x43')][_0x32ef('0x4b')]);_0x5a1696[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x1ec12d[_0x32ef('0x43')]['offset']);}_0x5a1696[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x1ec12d[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x5a1696['where']=qs['filters'](_[_0x32ef('0x50')](_0x1ec12d['query'],_0x2678e3[_0x32ef('0x4f')]));_0x5a1696[_0x32ef('0x4e')]['FaxAccountId']=_0x42d2d4['id'];if(_0x1ec12d['query']['filter']){_0x5a1696[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x5a1696[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x5a1696['attributes'],function(_0x1f0f95){var _0xe52b7f={};_0xe52b7f[_0x1f0f95]={'$like':'%'+_0x1ec12d[_0x32ef('0x43')]['filter']+'%'};return _0xe52b7f;})});}_0x5a1696=_[_0x32ef('0x51')]({},_0x5a1696,_0x1ec12d['options']);return db[_0x32ef('0x6d')][_0x32ef('0x30')]({'where':_0x5a1696['where']})['then'](function(_0x2d6a9a){_0x5b3deb[_0x32ef('0x30')]=_0x2d6a9a;if(_0x1ec12d[_0x32ef('0x43')][_0x32ef('0x55')]){_0x5a1696[_0x32ef('0x56')]=[{'all':!![]}];}return db[_0x32ef('0x6d')][_0x32ef('0x57')](_0x5a1696);})[_0x32ef('0x22')](function(_0x1fb039){_0x5b3deb['rows']=_0x1fb039;return _0x5b3deb;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x34fd2b,_0x5a1696))['catch'](handleError(_0x34fd2b,null));};exports[_0x32ef('0x6f')]=function(_0x7e47b9,_0x1d9d57,_0x18cf5d){return db[_0x32ef('0x3e')]['find']({'where':{'id':_0x7e47b9[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x1d9d57,null))[_0x32ef('0x22')](function(_0x39d17d){if(_0x39d17d){return _0x39d17d[_0x32ef('0x6f')](_0x7e47b9[_0x32ef('0x43')][_0x32ef('0x6b')]);}})[_0x32ef('0x22')](respondWithStatusCode(_0x1d9d57,null))[_0x32ef('0x2c')](handleError(_0x1d9d57,null));};exports['addInteraction']=function(_0x53dc9b,_0x4fb09e,_0x2e01fa){return db[_0x32ef('0x70')]['find']({'where':{'id':_0x53dc9b[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4fb09e,null))[_0x32ef('0x22')](function(_0x5c0d8d){if(_0x5c0d8d){return _0x5c0d8d['addInteraction'](_0x53dc9b[_0x32ef('0x63')][_0x32ef('0x6b')],_[_0x32ef('0x71')](_0x53dc9b[_0x32ef('0x63')],[_0x32ef('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x4fb09e,null))[_0x32ef('0x2c')](handleError(_0x4fb09e,null));};exports['getInteractions']=function(_0x458239,_0x5e936a,_0x5cded8){var _0x4e9c64={'raw':![],'where':{}};var _0x5ef161={};var _0x512390={'count':0x0,'rows':[]};return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x458239['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x5e936a,null))[_0x32ef('0x22')](function(_0x206bd1){if(_0x206bd1){_0x5ef161[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x70')]['rawAttributes']);_0x5ef161[_0x32ef('0x43')]=_['keys'](_0x458239[_0x32ef('0x43')]);_0x5ef161[_0x32ef('0x4f')]=_['intersection'](_0x5ef161[_0x32ef('0x42')],_0x5ef161['query']);_0x4e9c64[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x5ef161[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x458239['query'][_0x32ef('0x47')]));_0x4e9c64[_0x32ef('0x46')]=_0x4e9c64[_0x32ef('0x46')][_0x32ef('0x48')]?_0x4e9c64['attributes']:_0x5ef161[_0x32ef('0x42')];if(!_0x458239['query'][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x4e9c64[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x458239[_0x32ef('0x43')][_0x32ef('0x4b')]);_0x4e9c64['offset']=qs[_0x32ef('0x31')](_0x458239['query']['offset']);}_0x4e9c64[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x458239[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x4e9c64['where']=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x458239[_0x32ef('0x43')],_0x5ef161[_0x32ef('0x4f')]));_0x4e9c64['where']['FaxAccountId']=_0x206bd1['id'];if(_0x458239['query'][_0x32ef('0x53')]){_0x4e9c64[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x4e9c64[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x4e9c64[_0x32ef('0x46')],function(_0xb612){var _0x42c3dc={};_0x42c3dc[_0xb612]={'$like':'%'+_0x458239[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x42c3dc;})});}_0x4e9c64=_[_0x32ef('0x51')]({},_0x4e9c64,_0x458239['options']);return db[_0x32ef('0x70')][_0x32ef('0x30')]({'where':_0x4e9c64[_0x32ef('0x4e')]})[_0x32ef('0x22')](function(_0x766edf){_0x512390[_0x32ef('0x30')]=_0x766edf;if(_0x458239['query'][_0x32ef('0x55')]){_0x4e9c64[_0x32ef('0x56')]=[{'model':db[_0x32ef('0x72')],'as':_0x32ef('0x73'),'required':![]},{'model':db[_0x32ef('0x74')],'as':_0x32ef('0x75'),'attributes':[_0x32ef('0x39'),_0x32ef('0x76'),_0x32ef('0x77')],'required':![]},{'model':db[_0x32ef('0x78')],'as':_0x32ef('0x79'),'attributes':['id',_0x32ef('0x39'),_0x32ef('0x7a')],'where':_0x458239[_0x32ef('0x43')]['tag']?{'id':_0x458239[_0x32ef('0x43')][_0x32ef('0x7b')]}:undefined,'required':_0x458239[_0x32ef('0x43')]['tag']?!![]:![]}];}return db[_0x32ef('0x70')]['findAll'](_0x4e9c64);})[_0x32ef('0x22')](function(_0x3e0917){_0x512390[_0x32ef('0x58')]=_0x3e0917;return _0x512390;});}})['then'](respondWithFilteredResult(_0x5e936a,_0x4e9c64))[_0x32ef('0x2c')](handleError(_0x5e936a,null));};exports['addApplications']=function(_0x5f0d27,_0x252e86,_0x5b753c){return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x5f0d27[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x252e86,null))[_0x32ef('0x22')](function(_0x264075){if(_0x264075){return db[_0x32ef('0x7c')]['transaction'](function(_0x493ae9){return db[_0x32ef('0x7d')]['destroy']({'where':{'FaxAccountId':_0x5f0d27[_0x32ef('0x5a')]['id']},'transaction':_0x493ae9})[_0x32ef('0x22')](function(_0x515a9f){var _0x447ede=_[_0x32ef('0x3d')](_0x5f0d27['body'],function(_0x1200c9){_0x1200c9[_0x32ef('0x66')]=_0x5f0d27[_0x32ef('0x5a')]['id'];return _0x1200c9;});return db[_0x32ef('0x7d')][_0x32ef('0x7e')](_0x447ede,{'transaction':_0x493ae9});});})['then'](function(){return db[_0x32ef('0x7d')][_0x32ef('0x7f')]({'where':{'FaxAccountId':_0x5f0d27['params']['id']},'order':_0x32ef('0x80')});});}})[_0x32ef('0x22')](respondWithResult(_0x252e86,null))[_0x32ef('0x2c')](handleError(_0x252e86,null));};exports[_0x32ef('0x81')]=function(_0x2971a8,_0x522c22,_0x739633){var _0x39bc0f={};var _0x547c0d={};var _0xb41a01;var _0x20785c;return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x2971a8[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x522c22,null))[_0x32ef('0x22')](function(_0x482c46){if(_0x482c46){_0xb41a01=_0x482c46;_0x547c0d['model']=_[_0x32ef('0x44')](db[_0x32ef('0x7d')][_0x32ef('0x3f')]);_0x547c0d['query']=_[_0x32ef('0x44')](_0x2971a8[_0x32ef('0x43')]);_0x547c0d['filters']=_[_0x32ef('0x45')](_0x547c0d[_0x32ef('0x42')],_0x547c0d['query']);_0x39bc0f['attributes']=_[_0x32ef('0x45')](_0x547c0d[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x2971a8['query']['fields']));_0x39bc0f['attributes']=_0x39bc0f[_0x32ef('0x46')][_0x32ef('0x48')]?_0x39bc0f[_0x32ef('0x46')]:_0x547c0d['model'];_0x39bc0f[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x2971a8[_0x32ef('0x43')]['sort']);_0x39bc0f[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_['pick'](_0x2971a8['query'],_0x547c0d[_0x32ef('0x4f')]));if(_0x2971a8['query'][_0x32ef('0x53')]){_0x39bc0f[_0x32ef('0x4e')]=_['merge'](_0x39bc0f['where'],{'$or':_[_0x32ef('0x3d')](_0x39bc0f['attributes'],function(_0xc0584b){var _0x37aa4e={};_0x37aa4e[_0xc0584b]={'$like':'%'+_0x2971a8[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x37aa4e;})});}_0x39bc0f=_[_0x32ef('0x51')]({},_0x39bc0f,_0x2971a8[_0x32ef('0x54')]);return _0xb41a01[_0x32ef('0x81')](_0x39bc0f);}})[_0x32ef('0x22')](function(_0x1bc4a7){if(_0x1bc4a7){_0x20785c=_0x1bc4a7[_0x32ef('0x48')];if(!_0x2971a8['query']['hasOwnProperty'](_0x32ef('0x4a'))){_0x39bc0f[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x2971a8[_0x32ef('0x43')][_0x32ef('0x4b')]);_0x39bc0f[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x2971a8[_0x32ef('0x43')][_0x32ef('0x31')]);}return _0xb41a01[_0x32ef('0x81')](_0x39bc0f);}})['then'](function(_0x41ad21){if(_0x41ad21){return _0x41ad21?{'count':_0x20785c,'rows':_0x41ad21}:null;}})[_0x32ef('0x22')](respondWithResult(_0x522c22,null))[_0x32ef('0x2c')](handleError(_0x522c22,null));};function Extension(_0xe3be2f,_0x3307e2,_0x1eca38,_0x439fe1){this[_0x32ef('0x82')]=_0x32ef('0x83');this[_0x32ef('0x84')]=_0xe3be2f[_0x32ef('0x85')];this[_0x32ef('0x86')]=_0x439fe1;this[_0x32ef('0x40')]='system';this[_0x32ef('0x87')]=_0x32ef('0x88');this[_0x32ef('0x66')]=_0xe3be2f['id'];this[_0x32ef('0x80')]=_0x3307e2;this[_0x32ef('0x89')]=_0x1eca38;}function createExtensionsReciveFax(_0xe331ee){var _0x1e4332=0x1;var _0x1b0e4b=[];_0x1b0e4b[_0x32ef('0x8a')](new Extension(_0xe331ee,_0x1e4332,'',_0x32ef('0x8b')));_0x1e4332+=0x1;_0x1b0e4b['push'](new Extension(_0xe331ee,_0x1e4332,_0x32ef('0x8c'),_0x32ef('0x8d')));_0x1e4332+=0x1;for(var _0x176d96 in _0xe331ee){if(_0xe331ee[_0x32ef('0x49')](_0x176d96)&&(_0x176d96==='ecm'||_0x176d96===_0x32ef('0x85')||_0x176d96===_0x32ef('0x8e')||_0x176d96==='faxdetect'||_0x176d96==='headerinfo'||_0x176d96==='maxrate'||_0x176d96===_0x32ef('0x8f')||_0x176d96===_0x32ef('0x90')||_0x176d96===_0x32ef('0x91'))){_0x1b0e4b[_0x32ef('0x8a')](new Extension(_0xe331ee,_0x1e4332,'FAXOPT('+_0x176d96+')='+_0xe331ee[_0x176d96],'Set'));_0x1e4332+=0x1;}}_0x1b0e4b[_0x32ef('0x8a')](new Extension(_0xe331ee,_0x1e4332,'6','Wait'));_0x1e4332+=0x1;_0x1b0e4b['push'](new Extension(_0xe331ee,_0x1e4332,_0x32ef('0x92'),_0x32ef('0x93')));_0x1e4332=0x0;return _0x1b0e4b;}exports[_0x32ef('0x94')]=function(_0x5a352f,_0x5f397c,_0x5216f2){var _0x142a87;return db[_0x32ef('0x7c')][_0x32ef('0x95')](function(_0x248d53){return db[_0x32ef('0x3e')][_0x32ef('0x5c')](_0x5a352f[_0x32ef('0x63')],{'transaction':_0x248d53})[_0x32ef('0x22')](function(_0x228330){_0x142a87=_0x228330['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x142a87),{'transaction':_0x248d53});});})[_0x32ef('0x22')](function(){return _0x142a87;})[_0x32ef('0x22')](respondWithResult(_0x5f397c,null))['catch'](handleError(_0x5f397c,null));};exports['updateAccountApplications']=function(_0x21e1f0,_0x478be3,_0x29c30e){var _0x40e8d7;return db[_0x32ef('0x7c')][_0x32ef('0x95')](function(_0x507b96){return db[_0x32ef('0x3e')][_0x32ef('0x34')](_0x21e1f0[_0x32ef('0x63')],{'where':{'id':_0x21e1f0[_0x32ef('0x63')]['id']},'transaction':_0x507b96})['then'](function(_0x3f32f2){return db[_0x32ef('0x96')]['destroy']({'where':{'FaxAccountId':_0x21e1f0['body']['id']},'transaction':_0x507b96})[_0x32ef('0x22')](function(_0x2207fc){return db[_0x32ef('0x96')][_0x32ef('0x7e')](createExtensionsReciveFax(_[_0x32ef('0x71')](_0x21e1f0[_0x32ef('0x63')],[_0x32ef('0x97'),'key',_0x32ef('0x98'),_0x32ef('0x99'),_0x32ef('0x9a'),_0x32ef('0x9b')])),{'transaction':_0x507b96});});});})['then'](function(){return db['FaxAccount'][_0x32ef('0x9c')](_0x21e1f0['body']['id']);})[_0x32ef('0x22')](respondWithResult(_0x478be3,null))[_0x32ef('0x2c')](handleError(_0x478be3,null));};exports[_0x32ef('0x9d')]=function(_0x183c07,_0x92ce66,_0x1d743f){var _0x1a9ea5={'raw':!![],'where':{}};var _0x37c47b={};var _0x4a4b8b={'count':0x0,'rows':[]};return db[_0x32ef('0x3e')]['findOne']({'where':{'id':_0x183c07[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x92ce66,null))['then'](function(_0x5890aa){if(_0x5890aa){_0x37c47b[_0x32ef('0x42')]=_['keys'](db[_0x32ef('0x9e')]['rawAttributes']);_0x37c47b[_0x32ef('0x43')]=_['keys'](_0x183c07[_0x32ef('0x43')]);_0x37c47b[_0x32ef('0x4f')]=_['intersection'](_0x37c47b[_0x32ef('0x42')],_0x37c47b['query']);_0x1a9ea5[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x37c47b[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x183c07[_0x32ef('0x43')]['fields']));_0x1a9ea5[_0x32ef('0x46')]=_0x1a9ea5[_0x32ef('0x46')][_0x32ef('0x48')]?_0x1a9ea5[_0x32ef('0x46')]:_0x37c47b[_0x32ef('0x42')];if(!_0x183c07[_0x32ef('0x43')][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x1a9ea5['limit']=qs[_0x32ef('0x4b')](_0x183c07['query'][_0x32ef('0x4b')]);_0x1a9ea5[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x183c07['query']['offset']);}_0x1a9ea5[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x183c07[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x1a9ea5[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x183c07[_0x32ef('0x43')],_0x37c47b[_0x32ef('0x4f')]));_0x1a9ea5[_0x32ef('0x4e')][_0x32ef('0x66')]=_0x5890aa['id'];if(_0x183c07['query'][_0x32ef('0x53')]){_0x1a9ea5[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x1a9ea5[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x1a9ea5[_0x32ef('0x46')],function(_0x2c5417){var _0x14ac0a={};_0x14ac0a[_0x2c5417]={'$like':'%'+_0x183c07[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x14ac0a;})});}if(_0x183c07['query'][_0x32ef('0x9f')]){var _0x1e4a05=_0x183c07[_0x32ef('0x43')][_0x32ef('0x9f')][_0x32ef('0xa0')](',');var _0x4f233c={};_0x4f233c[_0x1e4a05[0x0]]={'$gte':moment(_0x1e4a05[0x1])[_0x32ef('0xa1')](_0x32ef('0xa2'))};_0x1a9ea5[_0x32ef('0x4e')]=_['merge'](_0x1a9ea5['where'],_0x4f233c);}_0x1a9ea5=_[_0x32ef('0x51')]({},_0x1a9ea5,_0x183c07['options']);return db[_0x32ef('0x9e')]['count']({'where':_0x1a9ea5[_0x32ef('0x4e')]})[_0x32ef('0x22')](function(_0x2e5d0b){_0x4a4b8b[_0x32ef('0x30')]=_0x2e5d0b;if(_0x183c07[_0x32ef('0x43')]['includeAll']){_0x1a9ea5[_0x32ef('0x56')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1a9ea5);})['then'](function(_0x1d4130){_0x4a4b8b[_0x32ef('0x58')]=_0x1d4130;return _0x4a4b8b;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x92ce66,_0x1a9ea5))[_0x32ef('0x2c')](handleError(_0x92ce66,null));};exports[_0x32ef('0x3a')]=function(_0x5d58bd,_0x43655c,_0x560233){var _0x16da73,_0x2a884f={},_0x1f5ffe;if(_0x5d58bd[_0x32ef('0x63')]['to']){_0x1f5ffe=_0x5d58bd['body']['to'][0x0];}return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0x5d58bd[_0x32ef('0x5a')]['id']},'include':[{'model':db[_0x32ef('0xa3')],'as':_0x32ef('0xa4'),'include':[{'model':db[_0x32ef('0x72')],'as':'Contacts','where':{'fax':_0x1f5ffe},'limit':0x1,'order':[['updatedAt',_0x32ef('0xa5')]]}]}]})['then'](handleEntityNotFound(_0x43655c,null))['then'](function(_0x9345fe){_0x16da73=_0x9345fe;if(_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')]&&_0x5d58bd[_0x32ef('0x63')]['attachments'][_0x32ef('0x48')]){for(var _0x26c4e6=0x0;_0x26c4e6<_0x5d58bd['body']['attachments']['length'];_0x26c4e6+=0x1){_0x5d58bd[_0x32ef('0x63')]['attachments'][_0x26c4e6]={'filename':_0x5d58bd[_0x32ef('0x63')]['attachments'][_0x26c4e6][_0x32ef('0x39')],'id':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][_0x26c4e6]['id'],'path':path[_0x32ef('0xa7')](config[_0x32ef('0xa8')],_0x32ef('0xa9'),_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][_0x26c4e6]['basename'])};}}return respondWithRpcPromise(_0x32ef('0xaa'),'CheckAfterSend',{'FaxAccountId':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x5a')]['id'])?undefined:_0x5d58bd[_0x32ef('0x5a')]['id'],'path':_['isNil'](_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0][_0x32ef('0x8')])?undefined:_0x5d58bd[_0x32ef('0x63')]['attachments'][0x0][_0x32ef('0x8')],'fax':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x63')]['to'][0x0])?undefined:_0x5d58bd[_0x32ef('0x63')]['to'][0x0]},client9002);})[_0x32ef('0x22')](function(){if(_0x16da73){if(_['isNil'](_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xac')])){_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xac')]=util['format'](_0x32ef('0xad'),_0x16da73['name'],_0x16da73[_0x32ef('0xae')]);}if(_0x16da73[_0x32ef('0xa4')]){if(_0x16da73['List'][_0x32ef('0xaf')][_0x32ef('0x48')]){return _0x16da73[_0x32ef('0xa4')][_0x32ef('0xaf')][0x0];}else{return db[_0x32ef('0x72')][_0x32ef('0x5c')](_[_0x32ef('0x19')](_0x5d58bd['body'],{'firstName':_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'phone':_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'fax':_0x5d58bd['body']['to'][0x0],'ListId':_0x16da73[_0x32ef('0x9b')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0xc7f0af){if(_0xc7f0af){return db[_0x32ef('0x70')][_0x32ef('0x5b')]({'where':{'ContactId':_0xc7f0af['id'],'closed':![],'FaxAccountId':_0x16da73['id']}})[_0x32ef('0x22')](function(_0x3f3526){if(_0x3f3526){return[_0x3f3526,![]];}return db[_0x32ef('0x70')][_0x32ef('0x5c')]({'UserId':_0x5d58bd[_0x32ef('0x5d')]['id'],'ContactId':_0xc7f0af['id'],'FaxAccountId':_0x16da73['id'],'fax':_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'firstMsgDirection':_0x32ef('0xb0'),'Messages':[_['merge'](_0x5d58bd['body'],{'read':![],'body':_0x5d58bd[_0x32ef('0x63')]['attachments'][0x0][_0x32ef('0xb1')],'FaxAccountId':_0x16da73['id'],'UserId':_0x5d58bd[_0x32ef('0x5d')]['id'],'ContactId':_0xc7f0af['id'],'AttachmentId':_0x5d58bd['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x32ef('0x9e')],'as':'Messages'}]})[_0x32ef('0x22')](function(_0x5b8da7){return[_0x5b8da7,!![]];});});}else{throw new Error(_0x32ef('0xb2'));}})[_0x32ef('0xb3')](function(_0x5d1471,_0x3e4b69){if(_0x3e4b69){return _0x5d1471;}return db[_0x32ef('0x9e')][_0x32ef('0x5c')]({'direction':'out','read':![],'body':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0]['filename'],'FaxAccountId':_0x16da73['id'],'FaxInteractionId':_0x5d1471['id'],'UserId':_0x5d58bd[_0x32ef('0x5d')]['id'],'ContactId':_0x5d1471[_0x32ef('0xb4')],'AttachmentId':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0]['id']})['then'](function(_0x5036cf){_0x5d1471[_0x32ef('0xb5')][_0x32ef('0xb6')]=[];_0x5d1471[_0x32ef('0xb5')]['Messages'][_0x32ef('0x8a')](_0x5036cf[_0x32ef('0xb5')]);return _0x5d1471;});})[_0x32ef('0x22')](function(_0x503b79){respondWithRpcPromise(_0x32ef('0xb7'),_0x32ef('0xb7'),{'FaxAccountId':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x5a')]['id'])?undefined:_0x5d58bd['params']['id'],'path':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0][_0x32ef('0x8')])?undefined:_0x5d58bd[_0x32ef('0x63')]['attachments'][0x0][_0x32ef('0x8')],'fax':_[_0x32ef('0xab')](_0x5d58bd['body']['to'][0x0])?undefined:_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'AttachmentId':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0]['id']},client9002)[_0x32ef('0x22')](function(_0x19813f){logger[_0x32ef('0x23')](_0x32ef('0xb8'),_0x19813f);})[_0x32ef('0x2c')](function(_0x466890){logger[_0x32ef('0x23')](_0x32ef('0xb8'),_0x466890);});return _0x503b79;})[_0x32ef('0x22')](respondWithResult(_0x43655c,null))[_0x32ef('0x2c')](handleError(_0x43655c,null));};exports[_0x32ef('0xb9')]=function(_0x27e4df,_0xfcb9fd,_0x44eeb5){return db[_0x32ef('0x3e')][_0x32ef('0x5b')]({'where':{'id':_0x27e4df['params']['id']}})['then'](handleEntityNotFound(_0xfcb9fd,null))[_0x32ef('0x22')](function(_0x137bbb){if(_0x137bbb){return _0x137bbb[_0x32ef('0xb9')](_0x27e4df[_0x32ef('0x63')][_0x32ef('0x6b')],_[_0x32ef('0x71')](_0x27e4df['body'],['ids','id'])||{})[_0x32ef('0xb3')](function(_0x504cc2){for(var _0x2f7c05=0x0;_0x2f7c05<_0x27e4df[_0x32ef('0x63')][_0x32ef('0x6b')]['length'];_0x2f7c05+=0x1){socket[_0x32ef('0xba')](_0x32ef('0xbb'),{'UserId':_0x27e4df[_0x32ef('0x63')]['ids'][_0x2f7c05],'FaxAccountId':_0x27e4df[_0x32ef('0x5a')]['id']});}return _0x504cc2;});}})['then'](respondWithResult(_0xfcb9fd,null))[_0x32ef('0x2c')](handleError(_0xfcb9fd,null));};exports[_0x32ef('0xbc')]=function(_0x49e8b6,_0x5f1d3f,_0x3c422a){return db[_0x32ef('0x3e')]['find']({'where':{'id':_0x49e8b6[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5f1d3f,null))[_0x32ef('0x22')](function(_0x50bba9){if(_0x50bba9){return _0x50bba9[_0x32ef('0xbc')](_0x49e8b6['query'][_0x32ef('0x6b')])[_0x32ef('0x22')](function(){if(_[_0x32ef('0xbd')](_0x49e8b6['query'][_0x32ef('0x6b')])){for(var _0x4b3c9d=0x0;_0x4b3c9d<_0x49e8b6[_0x32ef('0x43')]['ids'][_0x32ef('0x48')];_0x4b3c9d+=0x1){socket['emit'](_0x32ef('0xbe'),{'UserId':Number(_0x49e8b6[_0x32ef('0x43')]['ids'][_0x4b3c9d]),'FaxAccountId':Number(_0x49e8b6[_0x32ef('0x5a')]['id'])});}}else{socket['emit'](_0x32ef('0xbe'),{'UserId':Number(_0x49e8b6[_0x32ef('0x43')][_0x32ef('0x6b')]),'FaxAccountId':Number(_0x49e8b6[_0x32ef('0x5a')]['id'])});}});}})[_0x32ef('0x22')](respondWithStatusCode(_0x5f1d3f,null))[_0x32ef('0x2c')](handleError(_0x5f1d3f,null));};exports[_0x32ef('0xbf')]=function(_0x5de210,_0x42b669,_0x4bfc2a){var _0x47a574={};var _0x4740d7={};var _0x3df194;var _0x2b1d5d;return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x5de210['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x42b669,null))[_0x32ef('0x22')](function(_0x27eedf){if(_0x27eedf){_0x3df194=_0x27eedf;_0x4740d7[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x74')][_0x32ef('0x3f')]);_0x4740d7[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x5de210[_0x32ef('0x43')]);_0x4740d7[_0x32ef('0x4f')]=_[_0x32ef('0x45')](_0x4740d7[_0x32ef('0x42')],_0x4740d7[_0x32ef('0x43')]);_0x47a574[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x4740d7[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x5de210[_0x32ef('0x43')]['fields']));_0x47a574[_0x32ef('0x46')]=_0x47a574[_0x32ef('0x46')][_0x32ef('0x48')]?_0x47a574[_0x32ef('0x46')]:_0x4740d7[_0x32ef('0x42')];_0x47a574['order']=qs['sort'](_0x5de210[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x47a574[_0x32ef('0x4e')]=qs['filters'](_[_0x32ef('0x50')](_0x5de210[_0x32ef('0x43')],_0x4740d7[_0x32ef('0x4f')]));if(_0x5de210[_0x32ef('0x43')][_0x32ef('0x53')]){_0x47a574[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x47a574[_0x32ef('0x4e')],{'$or':_['map'](_0x47a574[_0x32ef('0x46')],function(_0x3cc3f3){var _0x53f09b={};_0x53f09b[_0x3cc3f3]={'$like':'%'+_0x5de210[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x53f09b;})});}_0x47a574=_[_0x32ef('0x51')]({},_0x47a574,_0x5de210['options']);return _0x3df194['getAgents'](_0x47a574);}})[_0x32ef('0x22')](function(_0x3246d8){if(_0x3246d8){_0x2b1d5d=_0x3246d8[_0x32ef('0x48')];if(!_0x5de210[_0x32ef('0x43')][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x47a574['limit']=qs[_0x32ef('0x4b')](_0x5de210[_0x32ef('0x43')]['limit']);_0x47a574[_0x32ef('0x31')]=qs['offset'](_0x5de210[_0x32ef('0x43')][_0x32ef('0x31')]);}return _0x3df194[_0x32ef('0xbf')](_0x47a574);}})[_0x32ef('0x22')](function(_0x527c1f){if(_0x527c1f){return _0x527c1f?{'count':_0x2b1d5d,'rows':_0x527c1f}:null;}})[_0x32ef('0x22')](respondWithResult(_0x42b669,null))[_0x32ef('0x2c')](handleError(_0x42b669,null));}; \ No newline at end of file +var _0xadb5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','FaxAccounts','UserProfileResource','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','FaxAccount','includeAll','show','params','mandatoryDispositionPause','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','update','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','filter','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','include','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','faxdetect','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','sequelize','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','format','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x319270,_0xe789b2){var _0x3ccdc7=function(_0x2dcb88){while(--_0x2dcb88){_0x319270['push'](_0x319270['shift']());}};_0x3ccdc7(++_0xe789b2);}(_0xadb5,0xad));var _0x5adb=function(_0x5af0ec,_0x9cca0c){_0x5af0ec=_0x5af0ec-0x0;var _0x2106e8=_0xadb5[_0x5af0ec];return _0x2106e8;};'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 as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];config['redis']=_[_0x5adb('0x18')](config['redis'],{'host':_0x5adb('0x19'),'port':0x18eb});var socket=require(_0x5adb('0x1a'))(new Redis(config[_0x5adb('0x1b')]));require('./faxAccount.socket')[_0x5adb('0x1c')](socket);var jayson=require(_0x5adb('0x1d'));var client=jayson[_0x5adb('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x5adb('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x367d82,_0x42a482,_0x30614e){if(_0x30614e){var _0x304784=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x304784[_0x5adb('0x1f')](_0x42a482)){return _0x367d82;}else{throw new db[(_0x5adb('0x20'))][(_0x5adb('0x21'))](_0x5adb('0x22'));}}else{return _0x367d82;}}function respondWithRpcPromise(_0xb953a6,_0x529b65,_0x3fff62,_0x5de028){return new BPromise(function(_0x1d9e86,_0x558f76){var _0x3ef465=_0x5de028||client;return _0x3ef465['request'](_0xb953a6,_0x3fff62)['then'](function(_0x1fbaa5){logger[_0x5adb('0x23')](_0x5adb('0x24'),_0x529b65,_0x5adb('0x25'));logger[_0x5adb('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x529b65,_0x5adb('0x25'),JSON['stringify'](_0x1fbaa5));if(_0x1fbaa5['error']){if(_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x28')]===0x1f4){logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x29')]);return _0x558f76(_0x1fbaa5[_0x5adb('0x27')]['message']);}logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x29')]);return _0x1d9e86(_0x1fbaa5[_0x5adb('0x27')]['message']);}else{logger[_0x5adb('0x23')](_0x5adb('0x24'),_0x529b65,'request\x20sent');_0x1d9e86(_0x1fbaa5[_0x5adb('0x2a')][_0x5adb('0x29')]);}})[_0x5adb('0x2b')](function(_0x55b40a){logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x55b40a);_0x558f76(_0x55b40a);});});}function respondWithStatusCode(_0x3a4fca,_0x2c64a3){_0x2c64a3=_0x2c64a3||0xcc;return function(_0x36459b){if(_0x36459b){return _0x3a4fca[_0x5adb('0x2c')](_0x2c64a3);}return _0x3a4fca['status'](_0x2c64a3)['end']();};}function respondWithResult(_0x5d457e,_0x39bddd){_0x39bddd=_0x39bddd||0xc8;return function(_0x1eac55){if(_0x1eac55){return _0x5d457e[_0x5adb('0x2d')](_0x39bddd)[_0x5adb('0x2e')](_0x1eac55);}};}function respondWithFilteredResult(_0x137a5c,_0x4de310){return function(_0x11ec2a){if(_0x11ec2a){var _0x34b793=_0x11ec2a[_0x5adb('0x2f')],_0x372da1=_0x4de310[_0x5adb('0x30')],_0x3b1fed=_0x4de310[_0x5adb('0x30')]+_0x4de310[_0x5adb('0x31')],_0x450169;if(_0x3b1fed>=_0x34b793){_0x3b1fed=_0x34b793;_0x450169=0xc8;}else{_0x450169=0xce;}_0x137a5c[_0x5adb('0x2d')](_0x450169);return _0x137a5c['set'](_0x5adb('0x32'),_0x372da1+'-'+_0x3b1fed+'/'+_0x34b793)['json'](_0x11ec2a);}return null;};}function patchUpdates(_0x12424d){return function(_0x20cde6){try{jsonpatch['apply'](_0x20cde6,_0x12424d,!![]);}catch(_0x226390){return BPromise[_0x5adb('0x33')](_0x226390);}return _0x20cde6[_0x5adb('0x34')]();};}function saveUpdates(_0x4a3661,_0x173789){return function(_0x14cf00){if(_0x14cf00){return _0x14cf00['update'](_0x4a3661)['then'](function(_0x1ed9ea){return _0x1ed9ea;});}return null;};}function removeEntity(_0x49dd03,_0x663ea0){return function(_0x222568){if(_0x222568){return _0x222568[_0x5adb('0x35')]()[_0x5adb('0x36')](function(){var _0x9bdece=_0x222568['get']({'plain':!![]});var _0x2f7abe=_0x5adb('0x37');return db[_0x5adb('0x38')]['destroy']({'where':{'type':_0x2f7abe,'resourceId':_0x9bdece['id']}})['then'](function(){return _0x222568;});})[_0x5adb('0x36')](function(){_0x49dd03[_0x5adb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2355bc,_0x4a4260){return function(_0x199d3b){if(!_0x199d3b){_0x2355bc['sendStatus'](0x194);}return _0x199d3b;};}function handleError(_0x11cb37,_0x4d052f){_0x4d052f=_0x4d052f||0x1f4;return function(_0x1d9681){logger[_0x5adb('0x27')](_0x1d9681['stack']);if(_0x1d9681[_0x5adb('0x39')]){delete _0x1d9681['name'];}_0x11cb37[_0x5adb('0x2d')](_0x4d052f)[_0x5adb('0x3a')](_0x1d9681);};}exports[_0x5adb('0x3b')]=function(_0x50edd1,_0x425dc7){var _0x2b3b0b={'include':[{'model':db[_0x5adb('0x3c')],'as':'mandatoryDispositionPause'}]},_0xcdaf8e={},_0x132803={'count':0x0,'rows':[]};var _0x50fe99=_['map'](db['FaxAccount'][_0x5adb('0x3d')],function(_0x2fbe14){return{'name':_0x2fbe14[_0x5adb('0x3e')],'type':_0x2fbe14[_0x5adb('0x3f')][_0x5adb('0x40')]};});_0xcdaf8e[_0x5adb('0x41')]=_[_0x5adb('0x42')](_0x50fe99,_0x5adb('0x39'));_0xcdaf8e['query']=_['keys'](_0x50edd1[_0x5adb('0x43')]);_0xcdaf8e['filters']=_[_0x5adb('0x44')](_0xcdaf8e[_0x5adb('0x41')],_0xcdaf8e[_0x5adb('0x43')]);_0x2b3b0b[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0xcdaf8e['model'],qs[_0x5adb('0x46')](_0x50edd1[_0x5adb('0x43')]['fields']));_0x2b3b0b[_0x5adb('0x45')]=_0x2b3b0b[_0x5adb('0x45')]['length']?_0x2b3b0b[_0x5adb('0x45')]:_0xcdaf8e[_0x5adb('0x41')];if(!_0x50edd1[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x2b3b0b[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x50edd1['query']['limit']);_0x2b3b0b[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x50edd1[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x2b3b0b['order']=qs['sort'](_0x50edd1[_0x5adb('0x43')][_0x5adb('0x49')]);_0x2b3b0b[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x50edd1['query'],_0xcdaf8e[_0x5adb('0x4b')]));if(_0x50edd1[_0x5adb('0x43')]['filter']){_0x2b3b0b[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x2b3b0b[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x50fe99,function(_0x186bd2){if(_0x186bd2[_0x5adb('0x3f')]!==_0x5adb('0x4e')){var _0x54252={};_0x54252[_0x186bd2['name']]={'$like':'%'+_0x50edd1[_0x5adb('0x43')]['filter']+'%'};return _0x54252;}})});}_0x2b3b0b=_['merge']({},_0x2b3b0b,_0x50edd1['options']);var _0x3cd211={'where':_0x2b3b0b[_0x5adb('0x4a')]};return db[_0x5adb('0x4f')]['count'](_0x3cd211)[_0x5adb('0x36')](function(_0x5cbab5){_0x132803[_0x5adb('0x2f')]=_0x5cbab5;if(_0x50edd1[_0x5adb('0x43')][_0x5adb('0x50')]){_0x2b3b0b['include']=[{'all':!![]}];}return db[_0x5adb('0x4f')]['findAll'](_0x2b3b0b);})[_0x5adb('0x36')](function(_0x6dc067){_0x132803['rows']=_0x6dc067;return _0x132803;})[_0x5adb('0x36')](respondWithFilteredResult(_0x425dc7,_0x2b3b0b))[_0x5adb('0x2b')](handleError(_0x425dc7,null));};exports[_0x5adb('0x51')]=function(_0x101008,_0x372734){var _0x4cb36c={'raw':![],'where':{'id':_0x101008[_0x5adb('0x52')]['id']},'include':[{'model':db[_0x5adb('0x3c')],'as':_0x5adb('0x53')}]},_0x36b847={};_0x36b847['model']=_[_0x5adb('0x54')](db[_0x5adb('0x4f')][_0x5adb('0x3d')]);_0x36b847['query']=_[_0x5adb('0x54')](_0x101008[_0x5adb('0x43')]);_0x36b847[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x36b847['model'],_0x36b847[_0x5adb('0x43')]);_0x4cb36c[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x36b847[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x101008['query'][_0x5adb('0x46')]));_0x4cb36c['attributes']=_0x4cb36c[_0x5adb('0x45')]['length']?_0x4cb36c[_0x5adb('0x45')]:_0x36b847[_0x5adb('0x41')];if(_0x101008[_0x5adb('0x43')][_0x5adb('0x50')]){_0x4cb36c['include']=[{'all':!![]}];}_0x4cb36c=_[_0x5adb('0x4d')]({},_0x4cb36c,_0x101008[_0x5adb('0x55')]);return db[_0x5adb('0x4f')]['find'](_0x4cb36c)['then'](handleEntityNotFound(_0x372734,null))['then'](respondWithResult(_0x372734,null))[_0x5adb('0x2b')](handleError(_0x372734,null));};exports[_0x5adb('0x56')]=function(_0xa5ecc0,_0x12a146){return db[_0x5adb('0x4f')][_0x5adb('0x56')](_0xa5ecc0[_0x5adb('0x57')],{})[_0x5adb('0x36')](function(_0xc880af){var _0x380d76=_0xa5ecc0[_0x5adb('0x58')][_0x5adb('0x59')]({'plain':!![]});if(!_0x380d76)throw new Error(_0x5adb('0x5a'));if(_0x380d76['role']==='user'){var _0x3d55c2=_0xc880af[_0x5adb('0x59')]({'plain':!![]});var _0x43cde9=_0x5adb('0x37');return db['UserProfileSection'][_0x5adb('0x5b')]({'where':{'name':_0x43cde9,'userProfileId':_0x380d76[_0x5adb('0x5c')]},'raw':!![]})['then'](function(_0x5cb50e){if(_0x5cb50e&&_0x5cb50e[_0x5adb('0x5d')]===0x0){return db[_0x5adb('0x38')]['create']({'name':_0x3d55c2[_0x5adb('0x39')],'resourceId':_0x3d55c2['id'],'type':_0x5cb50e[_0x5adb('0x39')],'sectionId':_0x5cb50e['id']},{})[_0x5adb('0x36')](function(){return _0xc880af;});}else{return _0xc880af;}})[_0x5adb('0x2b')](function(_0x330290){logger[_0x5adb('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x330290);throw _0x330290;});}return _0xc880af;})[_0x5adb('0x36')](respondWithResult(_0x12a146,0xc9))[_0x5adb('0x2b')](handleError(_0x12a146,null));};exports[_0x5adb('0x5e')]=function(_0x4c8eed,_0xcd71d2){if(_0x4c8eed[_0x5adb('0x57')]['id']){delete _0x4c8eed[_0x5adb('0x57')]['id'];}return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x4c8eed['params']['id']},'include':[{'model':db[_0x5adb('0x3c')],'as':_0x5adb('0x53')}]})[_0x5adb('0x36')](handleEntityNotFound(_0xcd71d2,null))['then'](saveUpdates(_0x4c8eed[_0x5adb('0x57')],null))[_0x5adb('0x36')](respondWithResult(_0xcd71d2,null))['catch'](handleError(_0xcd71d2,null));};exports[_0x5adb('0x35')]=function(_0x432a3e,_0x248739){return db[_0x5adb('0x4f')]['find']({'where':{'id':_0x432a3e[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x248739,null))[_0x5adb('0x36')](removeEntity(_0x248739,null))[_0x5adb('0x2b')](handleError(_0x248739,null));};exports['describe']=function(_0x53a4bc,_0x304512){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x304512,null))[_0x5adb('0x2b')](handleError(_0x304512,null));};exports[_0x5adb('0x5f')]=function(_0x48bb5c,_0x395350,_0x91e023){if(_0x48bb5c[_0x5adb('0x57')]['id']){delete _0x48bb5c[_0x5adb('0x57')]['id'];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x48bb5c[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x395350,null))['then'](function(_0x4b9e80){if(_0x4b9e80){_0x48bb5c['body'][_0x5adb('0x60')]=_0x4b9e80['id'];return db[_0x5adb('0x61')][_0x5adb('0x56')](_0x48bb5c[_0x5adb('0x57')]);}})[_0x5adb('0x36')](respondWithResult(_0x395350,null))[_0x5adb('0x2b')](handleError(_0x395350,null));};exports[_0x5adb('0x62')]=function(_0x25f761,_0x58455b,_0x5e55c2){var _0x1fc73b={'raw':![],'where':{}};var _0x56df90={};var _0x114ee4={'count':0x0,'rows':[]};return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x25f761[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x58455b,null))[_0x5adb('0x36')](function(_0x338aee){if(_0x338aee){_0x56df90[_0x5adb('0x41')]=_['keys'](db[_0x5adb('0x61')][_0x5adb('0x3d')]);_0x56df90[_0x5adb('0x43')]=_['keys'](_0x25f761[_0x5adb('0x43')]);_0x56df90[_0x5adb('0x4b')]=_['intersection'](_0x56df90[_0x5adb('0x41')],_0x56df90['query']);_0x1fc73b[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x56df90['model'],qs[_0x5adb('0x46')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x46')]));_0x1fc73b[_0x5adb('0x45')]=_0x1fc73b[_0x5adb('0x45')][_0x5adb('0x64')]?_0x1fc73b[_0x5adb('0x45')]:_0x56df90[_0x5adb('0x41')];if(!_0x25f761['query'][_0x5adb('0x47')](_0x5adb('0x48'))){_0x1fc73b[_0x5adb('0x31')]=qs['limit'](_0x25f761['query'][_0x5adb('0x31')]);_0x1fc73b['offset']=qs[_0x5adb('0x30')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x1fc73b['order']=qs[_0x5adb('0x49')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x49')]);_0x1fc73b[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_['pick'](_0x25f761[_0x5adb('0x43')],_0x56df90[_0x5adb('0x4b')]));_0x1fc73b[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x338aee['id'];if(_0x25f761['query'][_0x5adb('0x65')]){_0x1fc73b[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x1fc73b[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x1fc73b[_0x5adb('0x45')],function(_0x1aae66){var _0x569644={};_0x569644[_0x1aae66]={'$like':'%'+_0x25f761[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0x569644;})});}_0x1fc73b=_['merge']({},_0x1fc73b,_0x25f761[_0x5adb('0x55')]);return db[_0x5adb('0x61')]['count']({'where':_0x1fc73b[_0x5adb('0x4a')]})['then'](function(_0x372354){_0x114ee4[_0x5adb('0x2f')]=_0x372354;if(_0x25f761['query'][_0x5adb('0x50')]){_0x1fc73b['include']=[{'all':!![]}];}return db[_0x5adb('0x61')][_0x5adb('0x66')](_0x1fc73b);})[_0x5adb('0x36')](function(_0x3a4a28){_0x114ee4[_0x5adb('0x67')]=_0x3a4a28;return _0x114ee4;});}})['then'](respondWithFilteredResult(_0x58455b,_0x1fc73b))[_0x5adb('0x2b')](handleError(_0x58455b,null));};exports[_0x5adb('0x68')]=function(_0x3f33c0,_0x1c8988,_0x47c631){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x3f33c0[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x1c8988,null))[_0x5adb('0x36')](function(_0x277668){if(_0x277668){return _0x277668[_0x5adb('0x68')](_0x3f33c0[_0x5adb('0x43')]['ids']);}})[_0x5adb('0x36')](respondWithStatusCode(_0x1c8988,null))[_0x5adb('0x2b')](handleError(_0x1c8988,null));};exports[_0x5adb('0x69')]=function(_0x43b3a8,_0x55a9e8,_0x450f90){if(_0x43b3a8[_0x5adb('0x57')]['id']){delete _0x43b3a8[_0x5adb('0x57')]['id'];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x43b3a8[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x55a9e8,null))[_0x5adb('0x36')](function(_0x1f753e){if(_0x1f753e){_0x43b3a8['body'][_0x5adb('0x60')]=_0x1f753e['id'];return db[_0x5adb('0x6a')]['create'](_0x43b3a8[_0x5adb('0x57')]);}})[_0x5adb('0x36')](respondWithResult(_0x55a9e8,null))[_0x5adb('0x2b')](handleError(_0x55a9e8,null));};exports[_0x5adb('0x6b')]=function(_0x200221,_0x1bbc2e,_0x450516){var _0x350bb1={'raw':![],'where':{}};var _0x57f557={};var _0x11d9ce={'count':0x0,'rows':[]};return db[_0x5adb('0x4f')]['findOne']({'where':{'id':_0x200221[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x1bbc2e,null))[_0x5adb('0x36')](function(_0x4a0752){if(_0x4a0752){_0x57f557['model']=_[_0x5adb('0x54')](db[_0x5adb('0x6a')][_0x5adb('0x3d')]);_0x57f557['query']=_[_0x5adb('0x54')](_0x200221[_0x5adb('0x43')]);_0x57f557[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x57f557[_0x5adb('0x41')],_0x57f557[_0x5adb('0x43')]);_0x350bb1[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x57f557[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x200221[_0x5adb('0x43')][_0x5adb('0x46')]));_0x350bb1['attributes']=_0x350bb1['attributes'][_0x5adb('0x64')]?_0x350bb1[_0x5adb('0x45')]:_0x57f557['model'];if(!_0x200221[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x350bb1[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x200221[_0x5adb('0x43')][_0x5adb('0x31')]);_0x350bb1[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x200221['query'][_0x5adb('0x30')]);}_0x350bb1[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x200221['query'][_0x5adb('0x49')]);_0x350bb1[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x200221[_0x5adb('0x43')],_0x57f557[_0x5adb('0x4b')]));_0x350bb1['where'][_0x5adb('0x60')]=_0x4a0752['id'];if(_0x200221[_0x5adb('0x43')][_0x5adb('0x65')]){_0x350bb1[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x350bb1[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x350bb1[_0x5adb('0x45')],function(_0x24664c){var _0x388218={};_0x388218[_0x24664c]={'$like':'%'+_0x200221['query'][_0x5adb('0x65')]+'%'};return _0x388218;})});}_0x350bb1=_['merge']({},_0x350bb1,_0x200221[_0x5adb('0x55')]);return db[_0x5adb('0x6a')][_0x5adb('0x2f')]({'where':_0x350bb1[_0x5adb('0x4a')]})[_0x5adb('0x36')](function(_0x5c7b1b){_0x11d9ce['count']=_0x5c7b1b;if(_0x200221[_0x5adb('0x43')][_0x5adb('0x50')]){_0x350bb1[_0x5adb('0x6d')]=[{'all':!![]}];}return db[_0x5adb('0x6a')][_0x5adb('0x66')](_0x350bb1);})[_0x5adb('0x36')](function(_0x55dfac){_0x11d9ce['rows']=_0x55dfac;return _0x11d9ce;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x1bbc2e,_0x350bb1))[_0x5adb('0x2b')](handleError(_0x1bbc2e,null));};exports[_0x5adb('0x6e')]=function(_0x4f5721,_0x542626,_0x227c17){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x4f5721[_0x5adb('0x52')]['id']}})['then'](handleEntityNotFound(_0x542626,null))['then'](function(_0x43b91c){if(_0x43b91c){return _0x43b91c['removeAnswers'](_0x4f5721['query'][_0x5adb('0x6f')]);}})[_0x5adb('0x36')](respondWithStatusCode(_0x542626,null))[_0x5adb('0x2b')](handleError(_0x542626,null));};exports[_0x5adb('0x70')]=function(_0xbfd441,_0x133ea9,_0xa51ffc){return db[_0x5adb('0x71')][_0x5adb('0x5b')]({'where':{'id':_0xbfd441[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x133ea9,null))[_0x5adb('0x36')](function(_0x2808e4){if(_0x2808e4){return _0x2808e4['addInteraction'](_0xbfd441[_0x5adb('0x57')]['ids'],_[_0x5adb('0x72')](_0xbfd441[_0x5adb('0x57')],[_0x5adb('0x6f'),'id'])||{});}})[_0x5adb('0x36')](respondWithResult(_0x133ea9,null))[_0x5adb('0x2b')](handleError(_0x133ea9,null));};exports[_0x5adb('0x73')]=function(_0xfb8035,_0x364bda,_0x2ebfad){var _0x36a8f0={'raw':![],'where':{}};var _0x41fa3c={};var _0x18fc00={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5adb('0x63')]({'where':{'id':_0xfb8035[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x364bda,null))[_0x5adb('0x36')](function(_0x1da6bc){if(_0x1da6bc){_0x41fa3c[_0x5adb('0x41')]=_[_0x5adb('0x54')](db[_0x5adb('0x71')]['rawAttributes']);_0x41fa3c[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0xfb8035[_0x5adb('0x43')]);_0x41fa3c['filters']=_[_0x5adb('0x44')](_0x41fa3c['model'],_0x41fa3c[_0x5adb('0x43')]);_0x36a8f0['attributes']=_['intersection'](_0x41fa3c[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x46')]));_0x36a8f0[_0x5adb('0x45')]=_0x36a8f0[_0x5adb('0x45')][_0x5adb('0x64')]?_0x36a8f0[_0x5adb('0x45')]:_0x41fa3c[_0x5adb('0x41')];if(!_0xfb8035[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x36a8f0['limit']=qs[_0x5adb('0x31')](_0xfb8035['query'][_0x5adb('0x31')]);_0x36a8f0[_0x5adb('0x30')]=qs['offset'](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x36a8f0['order']=qs['sort'](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x49')]);_0x36a8f0[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0xfb8035[_0x5adb('0x43')],_0x41fa3c['filters']));_0x36a8f0[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x1da6bc['id'];if(_0xfb8035[_0x5adb('0x43')][_0x5adb('0x65')]){_0x36a8f0[_0x5adb('0x4a')]=_['merge'](_0x36a8f0['where'],{'$or':_[_0x5adb('0x42')](_0x36a8f0[_0x5adb('0x45')],function(_0x23d3dc){var _0xaf0b4={};_0xaf0b4[_0x23d3dc]={'$like':'%'+_0xfb8035[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0xaf0b4;})});}_0x36a8f0=_[_0x5adb('0x4d')]({},_0x36a8f0,_0xfb8035[_0x5adb('0x55')]);return db[_0x5adb('0x71')]['count']({'where':_0x36a8f0[_0x5adb('0x4a')]})[_0x5adb('0x36')](function(_0x4a3a90){_0x18fc00['count']=_0x4a3a90;if(_0xfb8035['query'][_0x5adb('0x50')]){_0x36a8f0[_0x5adb('0x6d')]=[{'model':db[_0x5adb('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5adb('0x75'),'attributes':[_0x5adb('0x39'),_0x5adb('0x76'),_0x5adb('0x77')],'required':![]},{'model':db[_0x5adb('0x78')],'as':_0x5adb('0x79'),'attributes':['id','name','color'],'where':_0xfb8035[_0x5adb('0x43')]['tag']?{'id':_0xfb8035[_0x5adb('0x43')][_0x5adb('0x7a')]}:undefined,'required':_0xfb8035['query'][_0x5adb('0x7a')]?!![]:![]}];}return db[_0x5adb('0x71')][_0x5adb('0x66')](_0x36a8f0);})[_0x5adb('0x36')](function(_0x57a42f){_0x18fc00[_0x5adb('0x67')]=_0x57a42f;return _0x18fc00;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x364bda,_0x36a8f0))[_0x5adb('0x2b')](handleError(_0x364bda,null));};exports[_0x5adb('0x7b')]=function(_0x4ec5bd,_0xb4a84b,_0x559938){return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x4ec5bd[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0xb4a84b,null))[_0x5adb('0x36')](function(_0x190c08){if(_0x190c08){return db['sequelize'][_0x5adb('0x7c')](function(_0x49e908){return db[_0x5adb('0x7d')][_0x5adb('0x35')]({'where':{'FaxAccountId':_0x4ec5bd['params']['id']},'transaction':_0x49e908})[_0x5adb('0x36')](function(_0x52e44f){var _0x5a517a=_['map'](_0x4ec5bd[_0x5adb('0x57')],function(_0x5b7830){_0x5b7830['FaxAccountId']=_0x4ec5bd[_0x5adb('0x52')]['id'];return _0x5b7830;});return db[_0x5adb('0x7d')][_0x5adb('0x7e')](_0x5a517a,{'transaction':_0x49e908});});})[_0x5adb('0x36')](function(){return db[_0x5adb('0x7d')][_0x5adb('0x7f')]({'where':{'FaxAccountId':_0x4ec5bd[_0x5adb('0x52')]['id']},'order':'priority'});});}})[_0x5adb('0x36')](respondWithResult(_0xb4a84b,null))[_0x5adb('0x2b')](handleError(_0xb4a84b,null));};exports['getApplications']=function(_0x249dcb,_0x350ef9,_0x2c2416){var _0x232a1e={};var _0x39762c={};var _0x18c47f;var _0x3a88ab;return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x249dcb[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x350ef9,null))[_0x5adb('0x36')](function(_0x4871b1){if(_0x4871b1){_0x18c47f=_0x4871b1;_0x39762c['model']=_[_0x5adb('0x54')](db[_0x5adb('0x7d')][_0x5adb('0x3d')]);_0x39762c[_0x5adb('0x43')]=_['keys'](_0x249dcb[_0x5adb('0x43')]);_0x39762c[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x39762c[_0x5adb('0x41')],_0x39762c[_0x5adb('0x43')]);_0x232a1e['attributes']=_['intersection'](_0x39762c[_0x5adb('0x41')],qs['fields'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x46')]));_0x232a1e[_0x5adb('0x45')]=_0x232a1e[_0x5adb('0x45')][_0x5adb('0x64')]?_0x232a1e[_0x5adb('0x45')]:_0x39762c['model'];_0x232a1e[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x49')]);_0x232a1e[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x249dcb['query'],_0x39762c['filters']));if(_0x249dcb['query'][_0x5adb('0x65')]){_0x232a1e['where']=_[_0x5adb('0x4d')](_0x232a1e['where'],{'$or':_['map'](_0x232a1e[_0x5adb('0x45')],function(_0x340434){var _0x5e74dc={};_0x5e74dc[_0x340434]={'$like':'%'+_0x249dcb['query'][_0x5adb('0x65')]+'%'};return _0x5e74dc;})});}_0x232a1e=_[_0x5adb('0x4d')]({},_0x232a1e,_0x249dcb[_0x5adb('0x55')]);return _0x18c47f['getApplications'](_0x232a1e);}})[_0x5adb('0x36')](function(_0x57f0ea){if(_0x57f0ea){_0x3a88ab=_0x57f0ea['length'];if(!_0x249dcb[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x232a1e['limit']=qs['limit'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x31')]);_0x232a1e['offset']=qs['offset'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x30')]);}return _0x18c47f['getApplications'](_0x232a1e);}})[_0x5adb('0x36')](function(_0x550969){if(_0x550969){return _0x550969?{'count':_0x3a88ab,'rows':_0x550969}:null;}})[_0x5adb('0x36')](respondWithResult(_0x350ef9,null))['catch'](handleError(_0x350ef9,null));};function Extension(_0x530690,_0x2b87d3,_0x305176,_0xa4b83f){this[_0x5adb('0x80')]='from-voip-provider';this[_0x5adb('0x81')]=_0x530690[_0x5adb('0x82')];this[_0x5adb('0x83')]=_0xa4b83f;this['type']=_0x5adb('0x84');this[_0x5adb('0x85')]=_0x5adb('0x86');this[_0x5adb('0x60')]=_0x530690['id'];this['priority']=_0x2b87d3;this[_0x5adb('0x87')]=_0x305176;}function createExtensionsReciveFax(_0x1ff2e6){var _0x3bbe7c=0x1;var _0x4e79ff=[];_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,'','Answer'));_0x3bbe7c+=0x1;_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x89'),_0x5adb('0x8a')));_0x3bbe7c+=0x1;for(var _0x6a7622 in _0x1ff2e6){if(_0x1ff2e6[_0x5adb('0x47')](_0x6a7622)&&(_0x6a7622==='ecm'||_0x6a7622==='localstationid'||_0x6a7622==='gateway'||_0x6a7622===_0x5adb('0x8b')||_0x6a7622==='headerinfo'||_0x6a7622==='maxrate'||_0x6a7622===_0x5adb('0x8c')||_0x6a7622===_0x5adb('0x8d')||_0x6a7622===_0x5adb('0x8e'))){_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x8f')+_0x6a7622+')='+_0x1ff2e6[_0x6a7622],_0x5adb('0x8a')));_0x3bbe7c+=0x1;}}_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,'6',_0x5adb('0x90')));_0x3bbe7c+=0x1;_0x4e79ff['push'](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x91'),_0x5adb('0x92')));_0x3bbe7c=0x0;return _0x4e79ff;}exports['addAccountApplications']=function(_0x1946c6,_0x4f198d,_0x5ead13){var _0x19a72c;return db['sequelize'][_0x5adb('0x7c')](function(_0x2accf0){return db[_0x5adb('0x4f')][_0x5adb('0x56')](_0x1946c6[_0x5adb('0x57')],{'transaction':_0x2accf0})[_0x5adb('0x36')](function(_0x7b0fdc){_0x19a72c=_0x7b0fdc[_0x5adb('0x59')]({'plain':!![]});return db['VoiceExtension'][_0x5adb('0x7e')](createExtensionsReciveFax(_0x19a72c),{'transaction':_0x2accf0});});})['then'](function(){return _0x19a72c;})[_0x5adb('0x36')](respondWithResult(_0x4f198d,null))['catch'](handleError(_0x4f198d,null));};exports[_0x5adb('0x93')]=function(_0x50357d,_0x102a27,_0x2eebb1){var _0x123e79;return db[_0x5adb('0x94')][_0x5adb('0x7c')](function(_0x3f21df){return db[_0x5adb('0x4f')][_0x5adb('0x5e')](_0x50357d[_0x5adb('0x57')],{'where':{'id':_0x50357d[_0x5adb('0x57')]['id']},'transaction':_0x3f21df})[_0x5adb('0x36')](function(_0x3bdfda){return db[_0x5adb('0x95')]['destroy']({'where':{'FaxAccountId':_0x50357d[_0x5adb('0x57')]['id']},'transaction':_0x3f21df})['then'](function(_0x1eb7dc){return db[_0x5adb('0x95')][_0x5adb('0x7e')](createExtensionsReciveFax(_['omit'](_0x50357d['body'],['tech','key',_0x5adb('0x96'),_0x5adb('0x97'),_0x5adb('0x98'),_0x5adb('0x99')])),{'transaction':_0x3f21df});});});})[_0x5adb('0x36')](function(){return db[_0x5adb('0x4f')][_0x5adb('0x9a')](_0x50357d[_0x5adb('0x57')]['id']);})[_0x5adb('0x36')](respondWithResult(_0x102a27,null))['catch'](handleError(_0x102a27,null));};exports[_0x5adb('0x9b')]=function(_0x197b7f,_0x171fb9,_0x17801d){var _0x1ba4ba={'raw':!![],'where':{}};var _0x246a15={};var _0x4acbb0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x197b7f[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x171fb9,null))[_0x5adb('0x36')](function(_0x2b753d){if(_0x2b753d){_0x246a15[_0x5adb('0x41')]=_['keys'](db[_0x5adb('0x9c')][_0x5adb('0x3d')]);_0x246a15[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0x197b7f[_0x5adb('0x43')]);_0x246a15[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x246a15[_0x5adb('0x41')],_0x246a15[_0x5adb('0x43')]);_0x1ba4ba[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x246a15[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x197b7f['query'][_0x5adb('0x46')]));_0x1ba4ba['attributes']=_0x1ba4ba[_0x5adb('0x45')][_0x5adb('0x64')]?_0x1ba4ba[_0x5adb('0x45')]:_0x246a15[_0x5adb('0x41')];if(!_0x197b7f[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x1ba4ba[_0x5adb('0x31')]=qs['limit'](_0x197b7f[_0x5adb('0x43')]['limit']);_0x1ba4ba['offset']=qs[_0x5adb('0x30')](_0x197b7f[_0x5adb('0x43')]['offset']);}_0x1ba4ba[_0x5adb('0x6c')]=qs['sort'](_0x197b7f[_0x5adb('0x43')][_0x5adb('0x49')]);_0x1ba4ba['where']=qs[_0x5adb('0x4b')](_['pick'](_0x197b7f[_0x5adb('0x43')],_0x246a15[_0x5adb('0x4b')]));_0x1ba4ba[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x2b753d['id'];if(_0x197b7f[_0x5adb('0x43')]['filter']){_0x1ba4ba['where']=_[_0x5adb('0x4d')](_0x1ba4ba[_0x5adb('0x4a')],{'$or':_['map'](_0x1ba4ba[_0x5adb('0x45')],function(_0x22437e){var _0x1e8e68={};_0x1e8e68[_0x22437e]={'$like':'%'+_0x197b7f[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0x1e8e68;})});}if(_0x197b7f[_0x5adb('0x43')][_0x5adb('0x9d')]){var _0x80220d=_0x197b7f['query'][_0x5adb('0x9d')][_0x5adb('0x9e')](',');var _0x287a1d={};_0x287a1d[_0x80220d[0x0]]={'$gte':moment(_0x80220d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1ba4ba[_0x5adb('0x4a')]=_['merge'](_0x1ba4ba['where'],_0x287a1d);}_0x1ba4ba=_[_0x5adb('0x4d')]({},_0x1ba4ba,_0x197b7f[_0x5adb('0x55')]);return db[_0x5adb('0x9c')][_0x5adb('0x2f')]({'where':_0x1ba4ba['where']})[_0x5adb('0x36')](function(_0x3ca38d){_0x4acbb0['count']=_0x3ca38d;if(_0x197b7f[_0x5adb('0x43')][_0x5adb('0x50')]){_0x1ba4ba['include']=[{'all':!![]}];}return db[_0x5adb('0x9c')][_0x5adb('0x66')](_0x1ba4ba);})[_0x5adb('0x36')](function(_0x4b0530){_0x4acbb0[_0x5adb('0x67')]=_0x4b0530;return _0x4acbb0;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x171fb9,_0x1ba4ba))['catch'](handleError(_0x171fb9,null));};exports[_0x5adb('0x3a')]=function(_0x1c9bfe,_0x4723aa,_0x36d4c9){var _0x252b37,_0x478f87={},_0x5a8edb;if(_0x1c9bfe[_0x5adb('0x57')]['to']){_0x5a8edb=_0x1c9bfe[_0x5adb('0x57')]['to'][0x0];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x1c9bfe[_0x5adb('0x52')]['id']},'include':[{'model':db[_0x5adb('0x9f')],'as':_0x5adb('0xa0'),'include':[{'model':db['CmContact'],'as':_0x5adb('0xa1'),'where':{'fax':_0x5a8edb},'limit':0x1,'order':[[_0x5adb('0x97'),_0x5adb('0xa2')]]}]}]})[_0x5adb('0x36')](handleEntityNotFound(_0x4723aa,null))[_0x5adb('0x36')](function(_0x5eda03){_0x252b37=_0x5eda03;if(_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')]&&_0x1c9bfe['body']['attachments'][_0x5adb('0x64')]){for(var _0x31a85c=0x0;_0x31a85c<_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][_0x5adb('0x64')];_0x31a85c+=0x1){_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]={'filename':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][_0x31a85c]['name'],'id':_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]['id'],'path':path[_0x5adb('0xa4')](config[_0x5adb('0xa5')],_0x5adb('0xa6'),_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]['basename'])};}}return respondWithRpcPromise(_0x5adb('0xa7'),_0x5adb('0xa7'),{'FaxAccountId':_[_0x5adb('0xa8')](_0x1c9bfe['params']['id'])?undefined:_0x1c9bfe[_0x5adb('0x52')]['id'],'path':_['isNil'](_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')])?undefined:_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')],'fax':_[_0x5adb('0xa8')](_0x1c9bfe['body']['to'][0x0])?undefined:_0x1c9bfe[_0x5adb('0x57')]['to'][0x0]},client9002);})[_0x5adb('0x36')](function(){if(_0x252b37){if(_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')]['from'])){_0x1c9bfe['body']['from']=util[_0x5adb('0xaa')](_0x5adb('0xab'),_0x252b37[_0x5adb('0x39')],_0x252b37['fax']);}if(_0x252b37[_0x5adb('0xa0')]){if(_0x252b37[_0x5adb('0xa0')][_0x5adb('0xa1')][_0x5adb('0x64')]){return _0x252b37[_0x5adb('0xa0')][_0x5adb('0xa1')][0x0];}else{return db['CmContact']['create'](_[_0x5adb('0x18')](_0x1c9bfe['body'],{'firstName':_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'phone':_0x1c9bfe['body']['to'][0x0],'fax':_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'ListId':_0x252b37[_0x5adb('0x99')]}));}}else{throw new Error(_0x5adb('0xac'));}}else{throw new Error(_0x5adb('0xad'));}})[_0x5adb('0x36')](function(_0x2251b4){if(_0x2251b4){return db[_0x5adb('0x71')][_0x5adb('0x5b')]({'where':{'ContactId':_0x2251b4['id'],'closed':![],'FaxAccountId':_0x252b37['id']}})[_0x5adb('0x36')](function(_0x2060d2){if(_0x2060d2){return[_0x2060d2,![]];}return db[_0x5adb('0x71')][_0x5adb('0x56')]({'UserId':_0x1c9bfe[_0x5adb('0x58')]['id'],'ContactId':_0x2251b4['id'],'FaxAccountId':_0x252b37['id'],'fax':_0x1c9bfe['body']['to'][0x0],'firstMsgDirection':_0x5adb('0xae'),'Messages':[_[_0x5adb('0x4d')](_0x1c9bfe[_0x5adb('0x57')],{'read':![],'body':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0][_0x5adb('0xaf')],'FaxAccountId':_0x252b37['id'],'UserId':_0x1c9bfe['user']['id'],'ContactId':_0x2251b4['id'],'AttachmentId':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x5adb('0x9c')],'as':_0x5adb('0xb0')}]})[_0x5adb('0x36')](function(_0x1d3ca0){return[_0x1d3ca0,!![]];});});}else{throw new Error(_0x5adb('0xb1'));}})[_0x5adb('0xb2')](function(_0x49d94e,_0x1ac519){if(_0x1ac519){return _0x49d94e;}return db[_0x5adb('0x9c')]['create']({'direction':_0x5adb('0xae'),'read':![],'body':_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xaf')],'FaxAccountId':_0x252b37['id'],'FaxInteractionId':_0x49d94e['id'],'UserId':_0x1c9bfe[_0x5adb('0x58')]['id'],'ContactId':_0x49d94e[_0x5adb('0xb3')],'AttachmentId':_0x1c9bfe[_0x5adb('0x57')]['attachments'][0x0]['id']})['then'](function(_0x55144f){_0x49d94e[_0x5adb('0xb4')][_0x5adb('0xb0')]=[];_0x49d94e[_0x5adb('0xb4')]['Messages']['push'](_0x55144f[_0x5adb('0xb4')]);return _0x49d94e;});})[_0x5adb('0x36')](function(_0x3ec484){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x52')]['id'])?undefined:_0x1c9bfe[_0x5adb('0x52')]['id'],'path':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0]['path'])?undefined:_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')],'fax':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')]['to'][0x0])?undefined:_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'AttachmentId':_0x1c9bfe['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x326d04){logger[_0x5adb('0x23')](_0x5adb('0xb5'),_0x326d04);})['catch'](function(_0x762500){logger[_0x5adb('0x23')](_0x5adb('0xb5'),_0x762500);});return _0x3ec484;})[_0x5adb('0x36')](respondWithResult(_0x4723aa,null))[_0x5adb('0x2b')](handleError(_0x4723aa,null));};exports[_0x5adb('0xb6')]=function(_0x166372,_0x152dfe,_0x5f5594){return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x166372[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x152dfe,null))[_0x5adb('0x36')](function(_0x3e78e9){if(_0x3e78e9){return _0x3e78e9[_0x5adb('0xb6')](_0x166372[_0x5adb('0x57')]['ids'],_[_0x5adb('0x72')](_0x166372['body'],[_0x5adb('0x6f'),'id'])||{})['spread'](function(_0x5b80ed){for(var _0x5d1cb0=0x0;_0x5d1cb0<_0x166372['body'][_0x5adb('0x6f')][_0x5adb('0x64')];_0x5d1cb0+=0x1){socket[_0x5adb('0xb7')](_0x5adb('0xb8'),{'UserId':_0x166372[_0x5adb('0x57')]['ids'][_0x5d1cb0],'FaxAccountId':_0x166372[_0x5adb('0x52')]['id']});}return _0x5b80ed;});}})[_0x5adb('0x36')](respondWithResult(_0x152dfe,null))[_0x5adb('0x2b')](handleError(_0x152dfe,null));};exports[_0x5adb('0xb9')]=function(_0xa3233c,_0x542329,_0x562cce){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0xa3233c['params']['id']}})['then'](handleEntityNotFound(_0x542329,null))['then'](function(_0x4a1cd2){if(_0x4a1cd2){return _0x4a1cd2[_0x5adb('0xb9')](_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')])[_0x5adb('0x36')](function(){if(_['isArray'](_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')])){for(var _0x3d40a0=0x0;_0x3d40a0<_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')]['length'];_0x3d40a0+=0x1){socket['emit'](_0x5adb('0xba'),{'UserId':Number(_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')][_0x3d40a0]),'FaxAccountId':Number(_0xa3233c[_0x5adb('0x52')]['id'])});}}else{socket[_0x5adb('0xb7')](_0x5adb('0xba'),{'UserId':Number(_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')]),'FaxAccountId':Number(_0xa3233c[_0x5adb('0x52')]['id'])});}});}})[_0x5adb('0x36')](respondWithStatusCode(_0x542329,null))[_0x5adb('0x2b')](handleError(_0x542329,null));};exports['getAgents']=function(_0x3b0d9a,_0x5b194d,_0x26e5fd){var _0x14881a={};var _0x5b93c7={};var _0x4229d3;var _0x32b27b;return db[_0x5adb('0x4f')]['findOne']({'where':{'id':_0x3b0d9a['params']['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x5b194d,null))[_0x5adb('0x36')](function(_0x4dc1d5){if(_0x4dc1d5){_0x4229d3=_0x4dc1d5;_0x5b93c7['model']=_['keys'](db[_0x5adb('0xbb')][_0x5adb('0x3d')]);_0x5b93c7[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0x3b0d9a[_0x5adb('0x43')]);_0x5b93c7[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x5b93c7[_0x5adb('0x41')],_0x5b93c7[_0x5adb('0x43')]);_0x14881a[_0x5adb('0x45')]=_['intersection'](_0x5b93c7['model'],qs[_0x5adb('0x46')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x46')]));_0x14881a[_0x5adb('0x45')]=_0x14881a[_0x5adb('0x45')]['length']?_0x14881a[_0x5adb('0x45')]:_0x5b93c7[_0x5adb('0x41')];_0x14881a[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x3b0d9a['query'][_0x5adb('0x49')]);_0x14881a['where']=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x3b0d9a[_0x5adb('0x43')],_0x5b93c7['filters']));if(_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x65')]){_0x14881a[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x14881a['where'],{'$or':_['map'](_0x14881a[_0x5adb('0x45')],function(_0x477983){var _0x3e793e={};_0x3e793e[_0x477983]={'$like':'%'+_0x3b0d9a[_0x5adb('0x43')]['filter']+'%'};return _0x3e793e;})});}_0x14881a=_[_0x5adb('0x4d')]({},_0x14881a,_0x3b0d9a[_0x5adb('0x55')]);return _0x4229d3[_0x5adb('0xbc')](_0x14881a);}})[_0x5adb('0x36')](function(_0x5b8f5d){if(_0x5b8f5d){_0x32b27b=_0x5b8f5d['length'];if(!_0x3b0d9a['query'][_0x5adb('0x47')](_0x5adb('0x48'))){_0x14881a[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x31')]);_0x14881a[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x30')]);}return _0x4229d3[_0x5adb('0xbc')](_0x14881a);}})[_0x5adb('0x36')](function(_0x1bf854){if(_0x1bf854){return _0x1bf854?{'count':_0x32b27b,'rows':_0x1bf854}:null;}})[_0x5adb('0x36')](respondWithResult(_0x5b194d,null))[_0x5adb('0x2b')](handleError(_0x5b194d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index bc4e234..cffe03c 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 _0xff19=['remove','emit','hasOwnProperty','exports','../../mysqldb','FaxAccount','setMaxListeners','update'];(function(_0x4d13f5,_0x51c746){var _0x47164c=function(_0x33821a){while(--_0x33821a){_0x4d13f5['push'](_0x4d13f5['shift']());}};_0x47164c(++_0x51c746);}(_0xff19,0x164));var _0x9ff1=function(_0x47cb02,_0x5b21fa){_0x47cb02=_0x47cb02-0x0;var _0x18a522=_0xff19[_0x47cb02];return _0x18a522;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x9ff1('0x0'))['db'][_0x9ff1('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9ff1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9ff1('0x3'),'afterDestroy':_0x9ff1('0x4')};function emitEvent(_0x132ff5){return function(_0x592676,_0x11e7b6,_0x2fc268){FaxAccountEvents['emit'](_0x132ff5+':'+_0x592676['id'],_0x592676);FaxAccountEvents[_0x9ff1('0x5')](_0x132ff5,_0x592676);_0x2fc268(null);};}for(var e in events){if(events[_0x9ff1('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x9ff1('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x3249=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5b2079,_0x495e12){var _0x25fa83=function(_0x3dab00){while(--_0x3dab00){_0x5b2079['push'](_0x5b2079['shift']());}};_0x25fa83(++_0x495e12);}(_0x3249,0x11a));var _0x9324=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x3249[_0x485b5a];return _0xd2b34d;};'use strict';var EventEmitter=require(_0x9324('0x0'));var FaxAccount=require(_0x9324('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9324('0x2')](0x0);var events={'afterCreate':_0x9324('0x3'),'afterUpdate':_0x9324('0x4'),'afterDestroy':_0x9324('0x5')};function emitEvent(_0x30c31a){return function(_0x468fa7,_0x38e03e,_0x3a4690){FaxAccountEvents['emit'](_0x30c31a+':'+_0x468fa7['id'],_0x468fa7);FaxAccountEvents[_0x9324('0x6')](_0x30c31a,_0x468fa7);_0x3a4690(null);};}for(var e in events){if(events[_0x9324('0x7')](e)){var event=events[e];FaxAccount[_0x9324('0x8')](e,emitEvent(event));}}module[_0x9324('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 90eac16..dcc3e0d 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 _0x3079=['lodash','../../config/logger','moment','bluebird','path','./faxAccount.attributes','exports','FaxAccount','fax_accounts'];(function(_0x314408,_0x4b1016){var _0x30dda0=function(_0x464e1c){while(--_0x464e1c){_0x314408['push'](_0x314408['shift']());}};_0x30dda0(++_0x4b1016);}(_0x3079,0x183));var _0x9307=function(_0x108b66,_0x46f926){_0x108b66=_0x108b66-0x0;var _0x3e3e81=_0x3079[_0x108b66];return _0x3e3e81;};'use strict';var _=require(_0x9307('0x0'));var util=require('util');var logger=require(_0x9307('0x1'))('api');var moment=require(_0x9307('0x2'));var BPromise=require(_0x9307('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9307('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9307('0x5'));module[_0x9307('0x6')]=function(_0x4578f6,_0x29b72a){return _0x4578f6['define'](_0x9307('0x7'),attributes,{'tableName':_0x9307('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a2c=['define','FaxAccount','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x445435,_0x50d870){var _0x22f0ab=function(_0x316411){while(--_0x316411){_0x445435['push'](_0x445435['shift']());}};_0x22f0ab(++_0x50d870);}(_0x0a2c,0x86));var _0xc0a2=function(_0x49d46c,_0x35ebb9){_0x49d46c=_0x49d46c-0x0;var _0x37ad1b=_0x0a2c[_0x49d46c];return _0x37ad1b;};'use strict';var _=require('lodash');var util=require(_0xc0a2('0x0'));var logger=require(_0xc0a2('0x1'))('api');var moment=require(_0xc0a2('0x2'));var BPromise=require(_0xc0a2('0x3'));var rp=require(_0xc0a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a2('0x5'));var config=require(_0xc0a2('0x6'));var attributes=require(_0xc0a2('0x7'));module[_0xc0a2('0x8')]=function(_0x5ee2f2,_0x17e495){return _0x5ee2f2[_0xc0a2('0x9')](_0xc0a2('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 63254a6..110618d 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 _0x6bf2=['CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','UserId','User','name','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x6bf2,0x1e6));var _0x26bf=function(_0x399be4,_0x6a6e9d){_0x399be4=_0x399be4-0x0;var _0x450b58=_0x6bf2[_0x399be4];return _0x450b58;};'use strict';var _=require(_0x26bf('0x0'));var util=require('util');var moment=require(_0x26bf('0x1'));var BPromise=require(_0x26bf('0x2'));var rs=require(_0x26bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26bf('0x4'))['db'];var utils=require(_0x26bf('0x5'));var logger=require(_0x26bf('0x6'))(_0x26bf('0x7'));var config=require(_0x26bf('0x8'));var jayson=require(_0x26bf('0x9'));var client=jayson['client'][_0x26bf('0xa')]({'port':0x232c});config[_0x26bf('0xb')]=_['defaults'](config[_0x26bf('0xb')],{'host':_0x26bf('0xc'),'port':0x18eb});var socket=require(_0x26bf('0xd'))(new Redis(config[_0x26bf('0xb')]));require(_0x26bf('0xe'))[_0x26bf('0xf')](socket);function respondWithRpcPromise(_0x52c5c3,_0x3b1822,_0x333bdb){return new BPromise(function(_0x57b282,_0x533a44){return client[_0x26bf('0x10')](_0x52c5c3,_0x333bdb)[_0x26bf('0x11')](function(_0xbfa13f){logger[_0x26bf('0x12')]('FaxAccount,\x20%s,\x20%s',_0x3b1822,'request\x20sent');logger['debug'](_0x26bf('0x13'),_0x3b1822,_0x26bf('0x14'),JSON['stringify'](_0xbfa13f));if(_0xbfa13f['error']){if(_0xbfa13f[_0x26bf('0x15')][_0x26bf('0x16')]===0x1f4){logger[_0x26bf('0x15')]('FaxAccount,\x20%s,\x20%s',_0x3b1822,_0xbfa13f[_0x26bf('0x15')][_0x26bf('0x17')]);return _0x533a44(_0xbfa13f['error'][_0x26bf('0x17')]);}logger[_0x26bf('0x15')](_0x26bf('0x18'),_0x3b1822,_0xbfa13f[_0x26bf('0x15')][_0x26bf('0x17')]);return _0x57b282(_0xbfa13f[_0x26bf('0x15')]['message']);}else{logger[_0x26bf('0x12')]('FaxAccount,\x20%s,\x20%s',_0x3b1822,'request\x20sent');_0x57b282(_0xbfa13f[_0x26bf('0x19')][_0x26bf('0x17')]);}})[_0x26bf('0x1a')](function(_0x4633be){logger[_0x26bf('0x15')](_0x26bf('0x18'),_0x3b1822,_0x4633be);_0x533a44(_0x4633be);});});}exports[_0x26bf('0x1b')]=function(_0x5a428c){var _0x1c327a=this;return new Promise(function(_0x570e2d,_0x890954){return db[_0x26bf('0x1c')][_0x26bf('0x1d')]({'raw':_0x5a428c[_0x26bf('0x1e')]?_0x5a428c[_0x26bf('0x1e')][_0x26bf('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a428c['options']?_0x5a428c[_0x26bf('0x1e')][_0x26bf('0x20')]||null:null,'attributes':_0x5a428c[_0x26bf('0x1e')]?_0x5a428c['options'][_0x26bf('0x21')]||null:null,'limit':_0x5a428c[_0x26bf('0x1e')]?_0x5a428c[_0x26bf('0x1e')][_0x26bf('0x22')]||null:null,'include':_0x5a428c['options']?_0x5a428c[_0x26bf('0x1e')][_0x26bf('0x23')]?_['map'](_0x5a428c[_0x26bf('0x1e')][_0x26bf('0x23')],function(_0x10a1c9){return{'model':db[_0x10a1c9['model']],'as':_0x10a1c9['as'],'attributes':_0x10a1c9[_0x26bf('0x21')],'include':_0x10a1c9[_0x26bf('0x23')]?_[_0x26bf('0x24')](_0x10a1c9[_0x26bf('0x23')],function(_0x2f5264){return{'model':db[_0x2f5264[_0x26bf('0x25')]],'as':_0x2f5264['as'],'attributes':_0x2f5264[_0x26bf('0x21')],'include':_0x2f5264[_0x26bf('0x23')]?_[_0x26bf('0x24')](_0x2f5264[_0x26bf('0x23')],function(_0x46d374){return{'model':db[_0x46d374[_0x26bf('0x25')]],'as':_0x46d374['as'],'attributes':_0x46d374[_0x26bf('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21d99d){logger['info'](_0x26bf('0x1b'),_0x5a428c);logger[_0x26bf('0x26')](_0x26bf('0x1b'),_0x5a428c,JSON[_0x26bf('0x27')](_0x21d99d));_0x570e2d(_0x21d99d);})[_0x26bf('0x1a')](function(_0x5d490e){logger[_0x26bf('0x15')](_0x26bf('0x1b'),_0x5d490e[_0x26bf('0x17')],_0x5a428c);_0x890954(_0x1c327a[_0x26bf('0x15')](0x1f4,_0x5d490e['message']));});});};exports[_0x26bf('0x28')]=function(_0xe5a0e7,_0x1da0c1,_0x195113){var _0x59422d=this;return new Promise(function(_0x2b519f,_0x36243e){var _0x60bcee={'body':_0xe5a0e7[_0x26bf('0x29')],'channel':_0x26bf('0x2a')};var _0x513917=[];var _0x56f216=[];var _0xd8f1af={};return db[_0x26bf('0x2b')][_0x26bf('0x2c')]()[_0x26bf('0x11')](function(_0x2660d6){if(!_0x2660d6){throw new db['Sequelize'][(_0x26bf('0x2d'))](_0x26bf('0x2e'));}_0x513917=_['difference'](_[_0x26bf('0x2f')](_0x2660d6),[_0x26bf('0x30'),'updatedAt']);_0x56f216=_['difference'](_[_0x26bf('0x2f')](_0x2660d6),[_0x26bf('0x30'),_0x26bf('0x31'),_0x26bf('0x32'),_0x26bf('0x33')]);if(_0xe5a0e7[_0x26bf('0x29')]['id']){delete _0xe5a0e7[_0x26bf('0x29')]['id'];}if(_['isNil'](_0xe5a0e7[_0x26bf('0x29')][_0x26bf('0x34')])){throw new db['Sequelize'][(_0x26bf('0x2d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0xe5a0e7[_0x26bf('0x29')][_0x26bf('0x29')])||_0xe5a0e7['body'][_0x26bf('0x29')]===''){throw new db[(_0x26bf('0x35'))]['ValidationError'](_0x26bf('0x36'));}if(_['isNil'](_0xe5a0e7[_0x26bf('0x29')][_0x26bf('0x37')])){throw new db[(_0x26bf('0x35'))][(_0x26bf('0x2d'))](_0x26bf('0x38')+_0x56f216);}if(!_[_0x26bf('0x39')](_0x56f216,_0xe5a0e7['body'][_0x26bf('0x37')])){throw new db[(_0x26bf('0x35'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x56f216);}_0xd8f1af[_0xe5a0e7['body'][_0x26bf('0x37')]]=_0xe5a0e7[_0x26bf('0x29')]['from'];})['then'](function(){return db['FaxAccount'][_0x26bf('0x3a')]({'where':{'id':_0xe5a0e7[_0x26bf('0x3b')]['id']},'include':[{'model':db[_0x26bf('0x3c')],'as':_0x26bf('0x3d'),'include':[{'model':db['CmContact'],'as':_0x26bf('0x3e'),'where':_0xd8f1af,'limit':0x1,'order':[[_0x26bf('0x31'),_0x26bf('0x3f')]]}]},{'model':db[_0x26bf('0x40')],'as':_0x26bf('0x41')}]});})[_0x26bf('0x11')](function(_0x4e8f22){if(_0x4e8f22&&_0x4e8f22['List']){var _0x3ae118=_0x4e8f22[_0x26bf('0x42')]({'plain':!![]});_0x60bcee[_0x26bf('0x3b')]=_0x3ae118;_0x60bcee[_0x26bf('0x43')]=_0x3ae118[_0x26bf('0x41')];_0x60bcee[_0x26bf('0x44')]=_0x3ae118[_0x26bf('0x3d')];_0x60bcee[_0x26bf('0x43')]=_['orderBy'](_0x60bcee[_0x26bf('0x43')],[_0x26bf('0x45')],[_0x26bf('0x46')]);if(_0x60bcee['account']['Applications']){delete _0x60bcee[_0x26bf('0x3b')][_0x26bf('0x41')];}if(_0x60bcee['account'][_0x26bf('0x3d')]&&_0x60bcee[_0x26bf('0x3b')][_0x26bf('0x3d')][_0x26bf('0x3e')][_0x26bf('0x47')]){return _0x60bcee[_0x26bf('0x3b')][_0x26bf('0x3d')][_0x26bf('0x3e')][0x0];}var _0x46134a=_['defaults'](_0xe5a0e7['body'],{'firstName':_0xe5a0e7['body'][_0x26bf('0x34')],'ListId':_0x3ae118[_0x26bf('0x33')]});_0x46134a[_0xe5a0e7[_0x26bf('0x29')][_0x26bf('0x37')]]=_0xe5a0e7[_0x26bf('0x29')]['from'];return db[_0x26bf('0x2b')][_0x26bf('0x48')](_0x46134a,{'fields':_0x513917,'raw':!![]});}})['then'](function(_0x396758){_0x60bcee[_0x26bf('0x49')]=_0x396758;if(_0x396758){var _0x26ff57={'ContactId':_0x396758['id'],'FaxAccountId':_0xe5a0e7['account']['id'],'fax':_0x396758['fax']};return db[_0x26bf('0x4a')][_0x26bf('0x3a')]({'where':{'ContactId':_0x396758['id'],'closed':![],'FaxAccountId':_0xe5a0e7[_0x26bf('0x3b')]['id']}})[_0x26bf('0x11')](function(_0x2a8548){if(_0x2a8548){return[_0x2a8548,![]];}return db['FaxInteraction'][_0x26bf('0x48')](_0x26ff57)[_0x26bf('0x11')](function(_0x4cc307){return[_0x4cc307,!![]];});});}else{throw new Error(_0x26bf('0x4b'));}})[_0x26bf('0x4c')](function(_0x4d189a,_0x211343){var _0x3e77d3=_0x4d189a[_0x26bf('0x42')]({'plain':!![]});if(_0x211343){if(_0x60bcee[_0x26bf('0x3b')][_0x26bf('0x4d')]){_0x60bcee[_0x26bf('0x43')][_0x26bf('0x4e')]({'id':0x0,'priority':_0x60bcee[_0x26bf('0x43')][_0x26bf('0x47')]+0x1,'app':_0x26bf('0x4f'),'appdata':'unmanaged','interval':_0x26bf('0x50')});}_0x3e77d3['created']=!![];}else{_0x3e77d3[_0x26bf('0x51')]=![];}_0x60bcee['interaction']=_0x3e77d3;return db[_0x26bf('0x52')]['create']({'body':_0xe5a0e7[_0x26bf('0x29')][_0x26bf('0x29')],'FaxAccountId':_0xe5a0e7['account']['id'],'FaxInteractionId':_0x4d189a['id'],'direction':'in','ContactId':_0x4d189a[_0x26bf('0x53')],'AttachmentId':_0xe5a0e7['body'][_0x26bf('0x54')]});})[_0x26bf('0x11')](function(_0x5f127d){_0x60bcee[_0x26bf('0x17')]=_0x5f127d;if(_0x60bcee['interaction'][_0x26bf('0x55')]){return db[_0x26bf('0x56')][_0x26bf('0x3a')]({'attributes':['id',_0x26bf('0x57')],'where':{'id':_0x60bcee['interaction']['UserId']}})[_0x26bf('0x11')](function(_0x2c955e){if(_0x2c955e){_0x60bcee[_0x26bf('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2c955e[_0x26bf('0x57')]+','+(_0x60bcee[_0x26bf('0x3b')][_0x26bf('0x58')]||0xa),'interval':_0x26bf('0x50')});}return respondWithRpcPromise('Start',_0x26bf('0x59'),_0x60bcee);});}return respondWithRpcPromise(_0x26bf('0x5a'),_0x26bf('0x59'),_0x60bcee);})[_0x26bf('0x11')](function(_0x4f5902){_0x2b519f(_0x4f5902);})['catch'](function(_0x4fdabe){_0x36243e(_0x59422d[_0x26bf('0x15')](0x1f4,_0x4fdabe[_0x26bf('0x17')]));});});}; \ No newline at end of file +var _0xc89b=['body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','create','contact','Contact\x20not\x20found','spread','autoclose','push','length','created','interaction','FaxMessage','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','findAll','raw','options','where','limit','map','attributes','include','model','NotifyFaxAccount','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','ListId'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xc89b,0x7d));var _0xbc89=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc89b[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xbc89('0x0'));var util=require('util');var moment=require(_0xbc89('0x1'));var BPromise=require(_0xbc89('0x2'));var rs=require(_0xbc89('0x3'));var fs=require('fs');var Redis=require(_0xbc89('0x4'));var db=require(_0xbc89('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc89('0x6'))('rpc');var config=require(_0xbc89('0x7'));var jayson=require(_0xbc89('0x8'));var client=jayson[_0xbc89('0x9')]['http']({'port':0x232c});config[_0xbc89('0xa')]=_[_0xbc89('0xb')](config[_0xbc89('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc89('0xa')]));require(_0xbc89('0xc'))['register'](socket);function respondWithRpcPromise(_0x10361c,_0x1343aa,_0x26675b){return new BPromise(function(_0x503d35,_0x3b480a){return client['request'](_0x10361c,_0x26675b)[_0xbc89('0xd')](function(_0x35fe2f){logger[_0xbc89('0xe')](_0xbc89('0xf'),_0x1343aa,_0xbc89('0x10'));logger['debug'](_0xbc89('0x11'),_0x1343aa,_0xbc89('0x10'),JSON[_0xbc89('0x12')](_0x35fe2f));if(_0x35fe2f[_0xbc89('0x13')]){if(_0x35fe2f[_0xbc89('0x13')][_0xbc89('0x14')]===0x1f4){logger[_0xbc89('0x13')](_0xbc89('0xf'),_0x1343aa,_0x35fe2f[_0xbc89('0x13')]['message']);return _0x3b480a(_0x35fe2f[_0xbc89('0x13')]['message']);}logger[_0xbc89('0x13')](_0xbc89('0xf'),_0x1343aa,_0x35fe2f[_0xbc89('0x13')][_0xbc89('0x15')]);return _0x503d35(_0x35fe2f[_0xbc89('0x13')][_0xbc89('0x15')]);}else{logger[_0xbc89('0xe')](_0xbc89('0xf'),_0x1343aa,_0xbc89('0x10'));_0x503d35(_0x35fe2f[_0xbc89('0x16')][_0xbc89('0x15')]);}})['catch'](function(_0x2b75e3){logger['error'](_0xbc89('0xf'),_0x1343aa,_0x2b75e3);_0x3b480a(_0x2b75e3);});});}exports[_0xbc89('0x17')]=function(_0x4266d6){var _0x8f3b94=this;return new Promise(function(_0x1de774,_0x361e3a){return db['FaxAccount'][_0xbc89('0x18')]({'raw':_0x4266d6['options']?_0x4266d6['options'][_0xbc89('0x19')]===undefined?!![]:![]:!![],'where':_0x4266d6[_0xbc89('0x1a')]?_0x4266d6[_0xbc89('0x1a')][_0xbc89('0x1b')]||null:null,'attributes':_0x4266d6[_0xbc89('0x1a')]?_0x4266d6[_0xbc89('0x1a')]['attributes']||null:null,'limit':_0x4266d6['options']?_0x4266d6[_0xbc89('0x1a')][_0xbc89('0x1c')]||null:null,'include':_0x4266d6[_0xbc89('0x1a')]?_0x4266d6[_0xbc89('0x1a')]['include']?_[_0xbc89('0x1d')](_0x4266d6[_0xbc89('0x1a')]['include'],function(_0x1b33d3){return{'model':db[_0x1b33d3['model']],'as':_0x1b33d3['as'],'attributes':_0x1b33d3[_0xbc89('0x1e')],'include':_0x1b33d3['include']?_[_0xbc89('0x1d')](_0x1b33d3[_0xbc89('0x1f')],function(_0x23a22e){return{'model':db[_0x23a22e[_0xbc89('0x20')]],'as':_0x23a22e['as'],'attributes':_0x23a22e[_0xbc89('0x1e')],'include':_0x23a22e['include']?_[_0xbc89('0x1d')](_0x23a22e[_0xbc89('0x1f')],function(_0x4786a4){return{'model':db[_0x4786a4[_0xbc89('0x20')]],'as':_0x4786a4['as'],'attributes':_0x4786a4[_0xbc89('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc89('0xd')](function(_0x48d35d){logger[_0xbc89('0xe')](_0xbc89('0x17'),_0x4266d6);logger['debug'](_0xbc89('0x17'),_0x4266d6,JSON['stringify'](_0x48d35d));_0x1de774(_0x48d35d);})['catch'](function(_0x213faf){logger[_0xbc89('0x13')](_0xbc89('0x17'),_0x213faf[_0xbc89('0x15')],_0x4266d6);_0x361e3a(_0x8f3b94[_0xbc89('0x13')](0x1f4,_0x213faf['message']));});});};exports[_0xbc89('0x21')]=function(_0x5e1ccb,_0x36ed8f,_0x154019){var _0x458413=this;return new Promise(function(_0x243f89,_0x4d3059){var _0x1be698={'body':_0x5e1ccb['body'],'channel':'fax'};var _0x438717=[];var _0xa8f12=[];var _0x17a8f2={};return db[_0xbc89('0x22')]['describe']()[_0xbc89('0xd')](function(_0x3b3cda){if(!_0x3b3cda){throw new db[(_0xbc89('0x23'))][(_0xbc89('0x24'))](_0xbc89('0x25'));}_0x438717=_['difference'](_[_0xbc89('0x26')](_0x3b3cda),[_0xbc89('0x27'),'updatedAt']);_0xa8f12=_[_0xbc89('0x28')](_[_0xbc89('0x26')](_0x3b3cda),[_0xbc89('0x27'),_0xbc89('0x29'),'CompanyId',_0xbc89('0x2a')]);if(_0x5e1ccb[_0xbc89('0x2b')]['id']){delete _0x5e1ccb['body']['id'];}if(_[_0xbc89('0x2c')](_0x5e1ccb['body']['from'])){throw new db[(_0xbc89('0x23'))][(_0xbc89('0x24'))](_0xbc89('0x2d'));}if(_[_0xbc89('0x2c')](_0x5e1ccb[_0xbc89('0x2b')]['body'])||_0x5e1ccb['body'][_0xbc89('0x2b')]===''){throw new db[(_0xbc89('0x23'))]['ValidationError'](_0xbc89('0x2e'));}if(_[_0xbc89('0x2c')](_0x5e1ccb[_0xbc89('0x2b')][_0xbc89('0x2f')])){throw new db[(_0xbc89('0x23'))][(_0xbc89('0x24'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xa8f12);}if(!_['includes'](_0xa8f12,_0x5e1ccb['body'][_0xbc89('0x2f')])){throw new db[(_0xbc89('0x23'))][(_0xbc89('0x24'))](_0xbc89('0x30')+_0xa8f12);}_0x17a8f2[_0x5e1ccb[_0xbc89('0x2b')][_0xbc89('0x2f')]]=_0x5e1ccb[_0xbc89('0x2b')][_0xbc89('0x31')];})[_0xbc89('0xd')](function(){return db[_0xbc89('0x32')][_0xbc89('0x33')]({'where':{'id':_0x5e1ccb[_0xbc89('0x34')]['id']},'include':[{'model':db[_0xbc89('0x35')],'as':_0xbc89('0x36'),'include':[{'model':db[_0xbc89('0x22')],'as':_0xbc89('0x37'),'where':_0x17a8f2,'limit':0x1,'order':[[_0xbc89('0x29'),_0xbc89('0x38')]]}]},{'model':db[_0xbc89('0x39')],'as':_0xbc89('0x3a')}]});})[_0xbc89('0xd')](function(_0x2969bd){if(_0x2969bd&&_0x2969bd[_0xbc89('0x36')]){var _0x3bfc20=_0x2969bd['get']({'plain':!![]});_0x1be698[_0xbc89('0x34')]=_0x3bfc20;_0x1be698[_0xbc89('0x3b')]=_0x3bfc20['Applications'];_0x1be698[_0xbc89('0x3c')]=_0x3bfc20['List'];_0x1be698['applications']=_[_0xbc89('0x3d')](_0x1be698[_0xbc89('0x3b')],[_0xbc89('0x3e')],[_0xbc89('0x3f')]);if(_0x1be698['account'][_0xbc89('0x3a')]){delete _0x1be698[_0xbc89('0x34')][_0xbc89('0x3a')];}if(_0x1be698['account'][_0xbc89('0x36')]&&_0x1be698['account'][_0xbc89('0x36')]['Contacts']['length']){return _0x1be698[_0xbc89('0x34')][_0xbc89('0x36')][_0xbc89('0x37')][0x0];}var _0x192415=_[_0xbc89('0xb')](_0x5e1ccb['body'],{'firstName':_0x5e1ccb['body']['from'],'ListId':_0x3bfc20['ListId']});_0x192415[_0x5e1ccb[_0xbc89('0x2b')][_0xbc89('0x2f')]]=_0x5e1ccb[_0xbc89('0x2b')][_0xbc89('0x31')];return db['CmContact'][_0xbc89('0x40')](_0x192415,{'fields':_0x438717,'raw':!![]});}})[_0xbc89('0xd')](function(_0x24371d){_0x1be698[_0xbc89('0x41')]=_0x24371d;if(_0x24371d){var _0x27eb6e={'ContactId':_0x24371d['id'],'FaxAccountId':_0x5e1ccb[_0xbc89('0x34')]['id'],'fax':_0x24371d['fax']};return db['FaxInteraction'][_0xbc89('0x33')]({'where':{'ContactId':_0x24371d['id'],'closed':![],'FaxAccountId':_0x5e1ccb[_0xbc89('0x34')]['id']}})[_0xbc89('0xd')](function(_0x2da8a3){if(_0x2da8a3){return[_0x2da8a3,![]];}return db['FaxInteraction'][_0xbc89('0x40')](_0x27eb6e)[_0xbc89('0xd')](function(_0x28fc47){return[_0x28fc47,!![]];});});}else{throw new Error(_0xbc89('0x42'));}})[_0xbc89('0x43')](function(_0x2487c9,_0x122a2c){var _0x24fc3b=_0x2487c9['get']({'plain':!![]});if(_0x122a2c){if(_0x1be698[_0xbc89('0x34')][_0xbc89('0x44')]){_0x1be698[_0xbc89('0x3b')][_0xbc89('0x45')]({'id':0x0,'priority':_0x1be698[_0xbc89('0x3b')][_0xbc89('0x46')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x24fc3b[_0xbc89('0x47')]=!![];}else{_0x24fc3b[_0xbc89('0x47')]=![];}_0x1be698[_0xbc89('0x48')]=_0x24fc3b;return db[_0xbc89('0x49')][_0xbc89('0x40')]({'body':_0x5e1ccb['body'][_0xbc89('0x2b')],'FaxAccountId':_0x5e1ccb['account']['id'],'FaxInteractionId':_0x2487c9['id'],'direction':'in','ContactId':_0x2487c9['ContactId'],'AttachmentId':_0x5e1ccb[_0xbc89('0x2b')][_0xbc89('0x4a')]});})[_0xbc89('0xd')](function(_0x44431e){_0x1be698[_0xbc89('0x15')]=_0x44431e;if(_0x1be698[_0xbc89('0x48')][_0xbc89('0x4b')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1be698[_0xbc89('0x48')][_0xbc89('0x4b')]}})['then'](function(_0x78989a){if(_0x78989a){_0x1be698[_0xbc89('0x3b')][_0xbc89('0x4c')]({'id':0x0,'priority':0x0,'app':_0xbc89('0x4d'),'appdata':_0x78989a[_0xbc89('0x4e')]+','+(_0x1be698[_0xbc89('0x34')][_0xbc89('0x4f')]||0xa),'interval':_0xbc89('0x50')});}return respondWithRpcPromise(_0xbc89('0x51'),_0xbc89('0x52'),_0x1be698);});}return respondWithRpcPromise(_0xbc89('0x51'),_0xbc89('0x52'),_0x1be698);})[_0xbc89('0xd')](function(_0x36c339){_0x243f89(_0x36c339);})[_0xbc89('0x53')](function(_0x3ef689){_0x4d3059(_0x458413[_0xbc89('0x13')](0x1f4,_0x3ef689['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9a51010..f8beb42 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 _0x8e3f=['remove','register','faxAccount:','./faxAccount.events','save'];(function(_0x55e77d,_0x59df1c){var _0x3f271e=function(_0x542491){while(--_0x542491){_0x55e77d['push'](_0x55e77d['shift']());}};_0x3f271e(++_0x59df1c);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var FaxAccountEvents=require(_0xf8e3('0x0'));var events=[_0xf8e3('0x1'),_0xf8e3('0x2'),'update'];function createListener(_0x3f3440,_0x292de5){return function(_0x3b07a5){_0x292de5['emit'](_0x3f3440,_0x3b07a5);};}function removeListener(_0x15d6ea,_0x41bc05){return function(){FaxAccountEvents['removeListener'](_0x15d6ea,_0x41bc05);};}exports[_0xf8e3('0x3')]=function(_0xb21f8d){for(var _0x2621c5=0x0,_0x1ee9f3=events['length'];_0x2621c5<_0x1ee9f3;_0x2621c5++){var _0x4504dd=events[_0x2621c5];var _0x2e39b7=createListener(_0xf8e3('0x4')+_0x4504dd,_0xb21f8d);FaxAccountEvents['on'](_0x4504dd,_0x2e39b7);}}; \ No newline at end of file +var _0x8e3f=['remove','register','faxAccount:','./faxAccount.events','save'];(function(_0x4cba86,_0x51a278){var _0x268f75=function(_0xfe8f4e){while(--_0xfe8f4e){_0x4cba86['push'](_0x4cba86['shift']());}};_0x268f75(++_0x51a278);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var FaxAccountEvents=require(_0xf8e3('0x0'));var events=[_0xf8e3('0x1'),_0xf8e3('0x2'),'update'];function createListener(_0x3f3440,_0x292de5){return function(_0x3b07a5){_0x292de5['emit'](_0x3f3440,_0x3b07a5);};}function removeListener(_0x15d6ea,_0x41bc05){return function(){FaxAccountEvents['removeListener'](_0x15d6ea,_0x41bc05);};}exports[_0xf8e3('0x3')]=function(_0xb21f8d){for(var _0x2621c5=0x0,_0x1ee9f3=events['length'];_0x2621c5<_0x1ee9f3;_0x2621c5++){var _0x4504dd=events[_0x2621c5];var _0x2e39b7=createListener(_0xf8e3('0x4')+_0x4504dd,_0xb21f8d);FaxAccountEvents['on'](_0x4504dd,_0x2e39b7);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f1fdb6f..6fef135 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 _0x7ec4=['getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x5902f1,_0x5115a2){var _0x193a13=function(_0x8021a4){while(--_0x8021a4){_0x5902f1['push'](_0x5902f1['shift']());}};_0x193a13(++_0x5115a2);}(_0x7ec4,0x1dc));var _0x47ec=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7ec4[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x47ec('0x0'));var util=require('util');var path=require(_0x47ec('0x1'));var timeout=require(_0x47ec('0x2'));var express=require(_0x47ec('0x3'));var router=express[_0x47ec('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x47ec('0x5'));var controller=require('./faxAccount.controller');router[_0x47ec('0x6')]('/',auth[_0x47ec('0x7')](),controller[_0x47ec('0x8')]);router[_0x47ec('0x6')](_0x47ec('0x9'),auth['isAuthenticated'](),controller[_0x47ec('0xa')]);router['get'](_0x47ec('0xb'),auth[_0x47ec('0x7')](),controller[_0x47ec('0xc')]);router[_0x47ec('0x6')](_0x47ec('0xd'),auth[_0x47ec('0x7')](),controller[_0x47ec('0xe')]);router[_0x47ec('0x6')](_0x47ec('0xf'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x10')]);router[_0x47ec('0x6')](_0x47ec('0x11'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x12')]);router[_0x47ec('0x6')](_0x47ec('0x13'),auth['isAuthenticated'](),controller[_0x47ec('0x14')]);router[_0x47ec('0x6')](_0x47ec('0x15'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x16')]);router[_0x47ec('0x6')](_0x47ec('0x17'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x18')]);router[_0x47ec('0x19')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x47ec('0xd'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x1a')]);router[_0x47ec('0x19')](_0x47ec('0xf'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x1b')]);router[_0x47ec('0x19')](_0x47ec('0x11'),auth[_0x47ec('0x7')](),controller['addInteraction']);router[_0x47ec('0x19')](_0x47ec('0x13'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x1c')]);router[_0x47ec('0x19')](_0x47ec('0x1d'),auth[_0x47ec('0x7')](),controller['addAccountApplications']);router['post'](_0x47ec('0x1e'),auth['isAuthenticated'](),controller[_0x47ec('0x1f')]);router['post'](_0x47ec('0x20'),auth['isAuthenticated'](),controller['send']);router[_0x47ec('0x19')](_0x47ec('0x17'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x21')]);router[_0x47ec('0x22')](_0x47ec('0xb'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x23')]);router[_0x47ec('0x24')](_0x47ec('0xb'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x25')]);router['delete'](_0x47ec('0xd'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x26')]);router[_0x47ec('0x24')](_0x47ec('0xf'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x27')]);router['delete'](_0x47ec('0x17'),auth[_0x47ec('0x7')](),controller[_0x47ec('0x28')]);module['exports']=router; \ No newline at end of file +var _0xcd68=['addAnswer','addInteraction','addApplications','/addaccountapplications','updateAccountApplications','send','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/users','post','create','/:id/dispositions'];(function(_0x245965,_0x35556f){var _0x2cd9c0=function(_0x401d3b){while(--_0x401d3b){_0x245965['push'](_0x245965['shift']());}};_0x2cd9c0(++_0x35556f);}(_0xcd68,0x1d5));var _0x8cd6=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xcd68[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require(_0x8cd6('0x0'));var util=require(_0x8cd6('0x1'));var path=require(_0x8cd6('0x2'));var timeout=require(_0x8cd6('0x3'));var express=require(_0x8cd6('0x4'));var router=express['Router']();var auth=require(_0x8cd6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8cd6('0x6'));var controller=require(_0x8cd6('0x7'));router[_0x8cd6('0x8')]('/',auth[_0x8cd6('0x9')](),controller['index']);router[_0x8cd6('0x8')](_0x8cd6('0xa'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0xb')]);router[_0x8cd6('0x8')](_0x8cd6('0xc'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0xd')]);router[_0x8cd6('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8cd6('0xe')]);router[_0x8cd6('0x8')](_0x8cd6('0xf'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x10')]);router['get'](_0x8cd6('0x11'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x12')]);router[_0x8cd6('0x8')](_0x8cd6('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8cd6('0x8')]('/:id/messages',auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x14')]);router[_0x8cd6('0x8')](_0x8cd6('0x15'),auth[_0x8cd6('0x9')](),controller['getAgents']);router[_0x8cd6('0x16')]('/',auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x17')]);router[_0x8cd6('0x16')](_0x8cd6('0x18'),auth[_0x8cd6('0x9')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x19')]);router[_0x8cd6('0x16')]('/:id/interactions',auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x1a')]);router['post'](_0x8cd6('0x13'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x1b')]);router[_0x8cd6('0x16')](_0x8cd6('0x1c'),auth[_0x8cd6('0x9')](),controller['addAccountApplications']);router[_0x8cd6('0x16')]('/updateaccountapplications',auth['isAuthenticated'](),controller[_0x8cd6('0x1d')]);router['post']('/:id/send',auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x1e')]);router[_0x8cd6('0x16')](_0x8cd6('0x15'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x1f')]);router[_0x8cd6('0x20')](_0x8cd6('0xc'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x21')]);router[_0x8cd6('0x22')](_0x8cd6('0xc'),auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x23')]);router['delete'](_0x8cd6('0x18'),auth[_0x8cd6('0x9')](),controller['removeDispositions']);router[_0x8cd6('0x22')](_0x8cd6('0xf'),auth[_0x8cd6('0x9')](),controller['removeAnswers']);router[_0x8cd6('0x22')]('/:id/users',auth[_0x8cd6('0x9')](),controller[_0x8cd6('0x24')]);module[_0x8cd6('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 442756d..ce8b594 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 _0x1472=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0x1472,0x166));var _0x2147=function(_0x33925b,_0x95cfc6){_0x33925b=_0x33925b-0x0;var _0x375e21=_0x1472[_0x33925b];return _0x375e21;};'use strict';var Sequelize=require(_0x2147('0x0'));module[_0x2147('0x1')]={'priority':{'type':Sequelize[_0x2147('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2147('0x3')],'allowNull':![],'defaultValue':_0x2147('0x4')},'appdata':{'type':Sequelize[_0x2147('0x5')]()},'description':{'type':Sequelize[_0x2147('0x3')]},'interval':{'type':Sequelize[_0x2147('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdcde=['exports','STRING','noop','TEXT','sequelize'];(function(_0x16209a,_0x1ddc1b){var _0x2f42b3=function(_0x522c6c){while(--_0x522c6c){_0x16209a['push'](_0x16209a['shift']());}};_0x2f42b3(++_0x1ddc1b);}(_0xdcde,0x1d0));var _0xedcd=function(_0x576d6a,_0x1cde72){_0x576d6a=_0x576d6a-0x0;var _0x16fdbf=_0xdcde[_0x576d6a];return _0x16fdbf;};'use strict';var Sequelize=require(_0xedcd('0x0'));module[_0xedcd('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xedcd('0x2')],'allowNull':![],'defaultValue':_0xedcd('0x3')},'appdata':{'type':Sequelize[_0xedcd('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b82b07f..a43dbd3 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 _0x43f3=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','rows','params','keys','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','query'];(function(_0x4570ff,_0x419691){var _0x3e0d16=function(_0x448eba){while(--_0x448eba){_0x4570ff['push'](_0x4570ff['shift']());}};_0x3e0d16(++_0x419691);}(_0x43f3,0xab));var _0x343f=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x43f3[_0x3430aa];return _0x2ac5c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x343f('0x0'));var rimraf=require(_0x343f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x343f('0x2'));var rp=require('request-promise');var moment=require(_0x343f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x343f('0x4'));var util=require(_0x343f('0x5'));var path=require(_0x343f('0x6'));var sox=require('sox');var csv=require(_0x343f('0x7'));var ejs=require(_0x343f('0x8'));var fs=require('fs');var _=require(_0x343f('0x9'));var squel=require(_0x343f('0xa'));var crypto=require(_0x343f('0xb'));var jsforce=require(_0x343f('0xc'));var deskjs=require(_0x343f('0xd'));var toCsv=require(_0x343f('0x7'));var querystring=require(_0x343f('0xe'));var Papa=require(_0x343f('0xf'));var Redis=require(_0x343f('0x10'));var authService=require(_0x343f('0x11'));var qs=require(_0x343f('0x12'));var as=require(_0x343f('0x13'));var hardwareService=require(_0x343f('0x14'));var logger=require(_0x343f('0x15'))(_0x343f('0x16'));var utils=require(_0x343f('0x17'));var config=require(_0x343f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cea52,_0x524b21){_0x524b21=_0x524b21||0xcc;return function(_0x47dd74){if(_0x47dd74){return _0x1cea52[_0x343f('0x19')](_0x524b21);}return _0x1cea52[_0x343f('0x1a')](_0x524b21)['end']();};}function respondWithResult(_0x4cea1f,_0x3dbbd3){_0x3dbbd3=_0x3dbbd3||0xc8;return function(_0x552c07){if(_0x552c07){return _0x4cea1f[_0x343f('0x1a')](_0x3dbbd3)['json'](_0x552c07);}};}function respondWithFilteredResult(_0x274800,_0x950400){return function(_0x1c399c){if(_0x1c399c){var _0x45ddab=_0x1c399c[_0x343f('0x1b')],_0x189d1b=_0x950400[_0x343f('0x1c')],_0x50ccfe=_0x950400[_0x343f('0x1c')]+_0x950400[_0x343f('0x1d')],_0x4ae9ef;if(_0x50ccfe>=_0x45ddab){_0x50ccfe=_0x45ddab;_0x4ae9ef=0xc8;}else{_0x4ae9ef=0xce;}_0x274800[_0x343f('0x1a')](_0x4ae9ef);return _0x274800[_0x343f('0x1e')]('Content-Range',_0x189d1b+'-'+_0x50ccfe+'/'+_0x45ddab)[_0x343f('0x1f')](_0x1c399c);}return null;};}function patchUpdates(_0x39fc86){return function(_0x1103da){try{jsonpatch[_0x343f('0x20')](_0x1103da,_0x39fc86,!![]);}catch(_0x29b804){return BPromise[_0x343f('0x21')](_0x29b804);}return _0x1103da[_0x343f('0x22')]();};}function saveUpdates(_0x32e3e8,_0x48ff0){return function(_0x3a0352){if(_0x3a0352){return _0x3a0352[_0x343f('0x23')](_0x32e3e8)[_0x343f('0x24')](function(_0x2f9eb8){return _0x2f9eb8;});}return null;};}function removeEntity(_0x5e678c,_0x3128fd){return function(_0x577f87){if(_0x577f87){return _0x577f87[_0x343f('0x25')]()[_0x343f('0x24')](function(){_0x5e678c[_0x343f('0x1a')](0xcc)[_0x343f('0x26')]();});}};}function handleEntityNotFound(_0x489eaa,_0x40c9ae){return function(_0x78a79e){if(!_0x78a79e){_0x489eaa[_0x343f('0x19')](0x194);}return _0x78a79e;};}function handleError(_0x7a78c9,_0xa486bd){_0xa486bd=_0xa486bd||0x1f4;return function(_0x2ef4c3){logger[_0x343f('0x27')](_0x2ef4c3[_0x343f('0x28')]);if(_0x2ef4c3[_0x343f('0x29')]){delete _0x2ef4c3[_0x343f('0x29')];}_0x7a78c9[_0x343f('0x1a')](_0xa486bd)[_0x343f('0x2a')](_0x2ef4c3);};}exports[_0x343f('0x2b')]=function(_0x2db28b,_0x4f42c2){var _0x39f161={},_0x3b647d={},_0x1c8dd6={'count':0x0,'rows':[]};var _0x5a2a5d=_[_0x343f('0x2c')](db[_0x343f('0x2d')][_0x343f('0x2e')],function(_0x1b2023){return{'name':_0x1b2023[_0x343f('0x2f')],'type':_0x1b2023['type'][_0x343f('0x30')]};});_0x3b647d[_0x343f('0x31')]=_['map'](_0x5a2a5d,'name');_0x3b647d['query']=_['keys'](_0x2db28b[_0x343f('0x32')]);_0x3b647d[_0x343f('0x33')]=_['intersection'](_0x3b647d[_0x343f('0x31')],_0x3b647d[_0x343f('0x32')]);_0x39f161['attributes']=_[_0x343f('0x34')](_0x3b647d['model'],qs[_0x343f('0x35')](_0x2db28b[_0x343f('0x32')][_0x343f('0x35')]));_0x39f161[_0x343f('0x36')]=_0x39f161['attributes'][_0x343f('0x37')]?_0x39f161['attributes']:_0x3b647d[_0x343f('0x31')];if(!_0x2db28b[_0x343f('0x32')][_0x343f('0x38')](_0x343f('0x39'))){_0x39f161[_0x343f('0x1d')]=qs[_0x343f('0x1d')](_0x2db28b[_0x343f('0x32')][_0x343f('0x1d')]);_0x39f161[_0x343f('0x1c')]=qs['offset'](_0x2db28b['query'][_0x343f('0x1c')]);}_0x39f161[_0x343f('0x3a')]=qs[_0x343f('0x3b')](_0x2db28b[_0x343f('0x32')][_0x343f('0x3b')]);_0x39f161[_0x343f('0x3c')]=qs['filters'](_[_0x343f('0x3d')](_0x2db28b[_0x343f('0x32')],_0x3b647d['filters']));if(_0x2db28b[_0x343f('0x32')]['filter']){_0x39f161[_0x343f('0x3c')]=_['merge'](_0x39f161[_0x343f('0x3c')],{'$or':_[_0x343f('0x2c')](_0x5a2a5d,function(_0x1bd60b){if(_0x1bd60b['type']!==_0x343f('0x3e')){var _0x54438c={};_0x54438c[_0x1bd60b[_0x343f('0x29')]]={'$like':'%'+_0x2db28b[_0x343f('0x32')]['filter']+'%'};return _0x54438c;}})});}_0x39f161=_[_0x343f('0x3f')]({},_0x39f161,_0x2db28b[_0x343f('0x40')]);var _0x339b96={'where':_0x39f161['where']};return db[_0x343f('0x2d')]['count'](_0x339b96)[_0x343f('0x24')](function(_0x48e84c){_0x1c8dd6[_0x343f('0x1b')]=_0x48e84c;if(_0x2db28b['query'][_0x343f('0x41')]){_0x39f161[_0x343f('0x42')]=[{'all':!![]}];}return db[_0x343f('0x2d')]['findAll'](_0x39f161);})[_0x343f('0x24')](function(_0x5377c4){_0x1c8dd6[_0x343f('0x43')]=_0x5377c4;return _0x1c8dd6;})[_0x343f('0x24')](respondWithFilteredResult(_0x4f42c2,_0x39f161))['catch'](handleError(_0x4f42c2,null));};exports['show']=function(_0x53086f,_0x40bd7b){var _0x216e27={'raw':!![],'where':{'id':_0x53086f[_0x343f('0x44')]['id']}},_0x261f8b={};_0x261f8b['model']=_[_0x343f('0x45')](db[_0x343f('0x2d')][_0x343f('0x2e')]);_0x261f8b[_0x343f('0x32')]=_[_0x343f('0x45')](_0x53086f[_0x343f('0x32')]);_0x261f8b[_0x343f('0x33')]=_[_0x343f('0x34')](_0x261f8b['model'],_0x261f8b[_0x343f('0x32')]);_0x216e27[_0x343f('0x36')]=_[_0x343f('0x34')](_0x261f8b[_0x343f('0x31')],qs['fields'](_0x53086f['query'][_0x343f('0x35')]));_0x216e27['attributes']=_0x216e27['attributes'][_0x343f('0x37')]?_0x216e27[_0x343f('0x36')]:_0x261f8b[_0x343f('0x31')];if(_0x53086f[_0x343f('0x32')]['includeAll']){_0x216e27['include']=[{'all':!![]}];}_0x216e27=_[_0x343f('0x3f')]({},_0x216e27,_0x53086f[_0x343f('0x40')]);return db[_0x343f('0x2d')][_0x343f('0x46')](_0x216e27)[_0x343f('0x24')](handleEntityNotFound(_0x40bd7b,null))[_0x343f('0x24')](respondWithResult(_0x40bd7b,null))[_0x343f('0x47')](handleError(_0x40bd7b,null));};exports[_0x343f('0x48')]=function(_0x21d3c8,_0x4cf0e6){return db['FaxApplication'][_0x343f('0x48')](_0x21d3c8[_0x343f('0x49')],{})[_0x343f('0x24')](respondWithResult(_0x4cf0e6,0xc9))['catch'](handleError(_0x4cf0e6,null));};exports['update']=function(_0x4ac436,_0xb3cdff){if(_0x4ac436[_0x343f('0x49')]['id']){delete _0x4ac436[_0x343f('0x49')]['id'];}return db[_0x343f('0x2d')][_0x343f('0x46')]({'where':{'id':_0x4ac436[_0x343f('0x44')]['id']}})[_0x343f('0x24')](handleEntityNotFound(_0xb3cdff,null))['then'](saveUpdates(_0x4ac436[_0x343f('0x49')],null))[_0x343f('0x24')](respondWithResult(_0xb3cdff,null))[_0x343f('0x47')](handleError(_0xb3cdff,null));};exports[_0x343f('0x25')]=function(_0x1f07e0,_0x5ef7ba){return db[_0x343f('0x2d')]['find']({'where':{'id':_0x1f07e0[_0x343f('0x44')]['id']}})[_0x343f('0x24')](handleEntityNotFound(_0x5ef7ba,null))[_0x343f('0x24')](removeEntity(_0x5ef7ba,null))[_0x343f('0x47')](handleError(_0x5ef7ba,null));}; \ No newline at end of file +var _0x4f99=['path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','destroy','then','error','map','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','FaxApplication','count','include','findAll','catch','rawAttributes','includeAll','find','create','body','update','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4f99,0x157));var _0x94f9=function(_0xbeaf8f,_0xdd4f35){_0xbeaf8f=_0xbeaf8f-0x0;var _0x7a444d=_0x4f99[_0xbeaf8f];return _0x7a444d;};'use strict';var pdf=require(_0x94f9('0x0'));var emlformat=require(_0x94f9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x94f9('0x2'));var jsonpatch=require(_0x94f9('0x3'));var rp=require(_0x94f9('0x4'));var moment=require('moment');var BPromise=require(_0x94f9('0x5'));var Mustache=require(_0x94f9('0x6'));var util=require('util');var path=require(_0x94f9('0x7'));var sox=require(_0x94f9('0x8'));var csv=require(_0x94f9('0x9'));var ejs=require(_0x94f9('0xa'));var fs=require('fs');var _=require(_0x94f9('0xb'));var squel=require('squel');var crypto=require(_0x94f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x94f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x94f9('0xe'));var Papa=require('papaparse');var Redis=require(_0x94f9('0xf'));var authService=require(_0x94f9('0x10'));var qs=require(_0x94f9('0x11'));var as=require(_0x94f9('0x12'));var hardwareService=require(_0x94f9('0x13'));var logger=require(_0x94f9('0x14'))(_0x94f9('0x15'));var utils=require('../../config/utils');var config=require(_0x94f9('0x16'));var db=require(_0x94f9('0x17'))['db'];function respondWithStatusCode(_0x3b4754,_0x7ec6db){_0x7ec6db=_0x7ec6db||0xcc;return function(_0x1320e2){if(_0x1320e2){return _0x3b4754[_0x94f9('0x18')](_0x7ec6db);}return _0x3b4754[_0x94f9('0x19')](_0x7ec6db)[_0x94f9('0x1a')]();};}function respondWithResult(_0x1ada35,_0x13aa55){_0x13aa55=_0x13aa55||0xc8;return function(_0x25e664){if(_0x25e664){return _0x1ada35[_0x94f9('0x19')](_0x13aa55)[_0x94f9('0x1b')](_0x25e664);}};}function respondWithFilteredResult(_0x1f4c94,_0x3791c0){return function(_0x53a842){if(_0x53a842){var _0x262645=_0x53a842['count'],_0x1b2cde=_0x3791c0[_0x94f9('0x1c')],_0x2f4232=_0x3791c0[_0x94f9('0x1c')]+_0x3791c0['limit'],_0x5217d4;if(_0x2f4232>=_0x262645){_0x2f4232=_0x262645;_0x5217d4=0xc8;}else{_0x5217d4=0xce;}_0x1f4c94[_0x94f9('0x19')](_0x5217d4);return _0x1f4c94['set'](_0x94f9('0x1d'),_0x1b2cde+'-'+_0x2f4232+'/'+_0x262645)[_0x94f9('0x1b')](_0x53a842);}return null;};}function patchUpdates(_0x5c732e){return function(_0x255219){try{jsonpatch[_0x94f9('0x1e')](_0x255219,_0x5c732e,!![]);}catch(_0x176de9){return BPromise[_0x94f9('0x1f')](_0x176de9);}return _0x255219[_0x94f9('0x20')]();};}function saveUpdates(_0x255afc,_0x4b9051){return function(_0x23a85a){if(_0x23a85a){return _0x23a85a['update'](_0x255afc)['then'](function(_0x396600){return _0x396600;});}return null;};}function removeEntity(_0xd604ee,_0x59f2e8){return function(_0x8dca1c){if(_0x8dca1c){return _0x8dca1c[_0x94f9('0x21')]()[_0x94f9('0x22')](function(){_0xd604ee[_0x94f9('0x19')](0xcc)[_0x94f9('0x1a')]();});}};}function handleEntityNotFound(_0x18bbfb,_0x4e1eba){return function(_0x35851e){if(!_0x35851e){_0x18bbfb[_0x94f9('0x18')](0x194);}return _0x35851e;};}function handleError(_0x16f655,_0x267216){_0x267216=_0x267216||0x1f4;return function(_0x3d6603){logger[_0x94f9('0x23')](_0x3d6603['stack']);if(_0x3d6603['name']){delete _0x3d6603['name'];}_0x16f655[_0x94f9('0x19')](_0x267216)['send'](_0x3d6603);};}exports['index']=function(_0x497c96,_0x3caaaf){var _0x165cb8={},_0x142609={},_0x3d78bf={'count':0x0,'rows':[]};var _0x24525d=_[_0x94f9('0x24')](db['FaxApplication']['rawAttributes'],function(_0x9d9981){return{'name':_0x9d9981[_0x94f9('0x25')],'type':_0x9d9981['type'][_0x94f9('0x26')]};});_0x142609[_0x94f9('0x27')]=_[_0x94f9('0x24')](_0x24525d,_0x94f9('0x28'));_0x142609[_0x94f9('0x29')]=_[_0x94f9('0x2a')](_0x497c96[_0x94f9('0x29')]);_0x142609['filters']=_[_0x94f9('0x2b')](_0x142609['model'],_0x142609[_0x94f9('0x29')]);_0x165cb8[_0x94f9('0x2c')]=_[_0x94f9('0x2b')](_0x142609[_0x94f9('0x27')],qs[_0x94f9('0x2d')](_0x497c96[_0x94f9('0x29')][_0x94f9('0x2d')]));_0x165cb8[_0x94f9('0x2c')]=_0x165cb8['attributes'][_0x94f9('0x2e')]?_0x165cb8['attributes']:_0x142609[_0x94f9('0x27')];if(!_0x497c96[_0x94f9('0x29')][_0x94f9('0x2f')](_0x94f9('0x30'))){_0x165cb8['limit']=qs[_0x94f9('0x31')](_0x497c96[_0x94f9('0x29')]['limit']);_0x165cb8[_0x94f9('0x1c')]=qs[_0x94f9('0x1c')](_0x497c96[_0x94f9('0x29')][_0x94f9('0x1c')]);}_0x165cb8[_0x94f9('0x32')]=qs[_0x94f9('0x33')](_0x497c96[_0x94f9('0x29')][_0x94f9('0x33')]);_0x165cb8[_0x94f9('0x34')]=qs['filters'](_['pick'](_0x497c96['query'],_0x142609[_0x94f9('0x35')]));if(_0x497c96[_0x94f9('0x29')][_0x94f9('0x36')]){_0x165cb8['where']=_[_0x94f9('0x37')](_0x165cb8[_0x94f9('0x34')],{'$or':_[_0x94f9('0x24')](_0x24525d,function(_0x5393a1){if(_0x5393a1['type']!==_0x94f9('0x38')){var _0x3b5cad={};_0x3b5cad[_0x5393a1[_0x94f9('0x28')]]={'$like':'%'+_0x497c96['query'][_0x94f9('0x36')]+'%'};return _0x3b5cad;}})});}_0x165cb8=_[_0x94f9('0x37')]({},_0x165cb8,_0x497c96[_0x94f9('0x39')]);var _0x470812={'where':_0x165cb8['where']};return db[_0x94f9('0x3a')][_0x94f9('0x3b')](_0x470812)[_0x94f9('0x22')](function(_0x2d8f99){_0x3d78bf[_0x94f9('0x3b')]=_0x2d8f99;if(_0x497c96[_0x94f9('0x29')]['includeAll']){_0x165cb8[_0x94f9('0x3c')]=[{'all':!![]}];}return db[_0x94f9('0x3a')][_0x94f9('0x3d')](_0x165cb8);})['then'](function(_0x407b81){_0x3d78bf['rows']=_0x407b81;return _0x3d78bf;})['then'](respondWithFilteredResult(_0x3caaaf,_0x165cb8))[_0x94f9('0x3e')](handleError(_0x3caaaf,null));};exports['show']=function(_0x179f0b,_0x210ace){var _0x1f146f={'raw':!![],'where':{'id':_0x179f0b['params']['id']}},_0x5c0544={};_0x5c0544[_0x94f9('0x27')]=_[_0x94f9('0x2a')](db[_0x94f9('0x3a')][_0x94f9('0x3f')]);_0x5c0544[_0x94f9('0x29')]=_[_0x94f9('0x2a')](_0x179f0b[_0x94f9('0x29')]);_0x5c0544[_0x94f9('0x35')]=_['intersection'](_0x5c0544[_0x94f9('0x27')],_0x5c0544['query']);_0x1f146f['attributes']=_[_0x94f9('0x2b')](_0x5c0544[_0x94f9('0x27')],qs['fields'](_0x179f0b[_0x94f9('0x29')][_0x94f9('0x2d')]));_0x1f146f[_0x94f9('0x2c')]=_0x1f146f['attributes'][_0x94f9('0x2e')]?_0x1f146f[_0x94f9('0x2c')]:_0x5c0544[_0x94f9('0x27')];if(_0x179f0b[_0x94f9('0x29')][_0x94f9('0x40')]){_0x1f146f[_0x94f9('0x3c')]=[{'all':!![]}];}_0x1f146f=_[_0x94f9('0x37')]({},_0x1f146f,_0x179f0b[_0x94f9('0x39')]);return db['FaxApplication'][_0x94f9('0x41')](_0x1f146f)[_0x94f9('0x22')](handleEntityNotFound(_0x210ace,null))[_0x94f9('0x22')](respondWithResult(_0x210ace,null))[_0x94f9('0x3e')](handleError(_0x210ace,null));};exports[_0x94f9('0x42')]=function(_0x214639,_0x1519d8){return db['FaxApplication'][_0x94f9('0x42')](_0x214639[_0x94f9('0x43')],{})['then'](respondWithResult(_0x1519d8,0xc9))['catch'](handleError(_0x1519d8,null));};exports[_0x94f9('0x44')]=function(_0x389d68,_0x6c938b){if(_0x389d68[_0x94f9('0x43')]['id']){delete _0x389d68[_0x94f9('0x43')]['id'];}return db[_0x94f9('0x3a')][_0x94f9('0x41')]({'where':{'id':_0x389d68[_0x94f9('0x45')]['id']}})[_0x94f9('0x22')](handleEntityNotFound(_0x6c938b,null))[_0x94f9('0x22')](saveUpdates(_0x389d68[_0x94f9('0x43')],null))[_0x94f9('0x22')](respondWithResult(_0x6c938b,null))[_0x94f9('0x3e')](handleError(_0x6c938b,null));};exports['destroy']=function(_0x2d3676,_0x37ed34){return db[_0x94f9('0x3a')][_0x94f9('0x41')]({'where':{'id':_0x2d3676[_0x94f9('0x45')]['id']}})[_0x94f9('0x22')](handleEntityNotFound(_0x37ed34,null))['then'](removeEntity(_0x37ed34,null))['catch'](handleError(_0x37ed34,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2eaf99d..2532491 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 _0xb7f2=['exports','FaxApplication','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0x46684a,_0x17e251){var _0x35a12a=function(_0x17c3ae){while(--_0x17c3ae){_0x46684a['push'](_0x46684a['shift']());}};_0x35a12a(++_0x17e251);}(_0xb7f2,0xed));var _0x2b7f=function(_0x5cdc50,_0x23c8d5){_0x5cdc50=_0x5cdc50-0x0;var _0x25ba02=_0xb7f2[_0x5cdc50];return _0x25ba02;};'use strict';var _=require('lodash');var util=require(_0x2b7f('0x0'));var logger=require(_0x2b7f('0x1'))(_0x2b7f('0x2'));var moment=require(_0x2b7f('0x3'));var BPromise=require(_0x2b7f('0x4'));var rp=require(_0x2b7f('0x5'));var fs=require('fs');var path=require(_0x2b7f('0x6'));var rimraf=require(_0x2b7f('0x7'));var config=require(_0x2b7f('0x8'));var attributes=require(_0x2b7f('0x9'));module[_0x2b7f('0xa')]=function(_0xaa08e6,_0x37cd7b){return _0xaa08e6['define'](_0x2b7f('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b7f('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xde3b=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0xde3b,0x87));var _0xbde3=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xde3b[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xbde3('0x0'));var util=require(_0xbde3('0x1'));var logger=require(_0xbde3('0x2'))(_0xbde3('0x3'));var moment=require('moment');var BPromise=require(_0xbde3('0x4'));var rp=require(_0xbde3('0x5'));var fs=require('fs');var path=require(_0xbde3('0x6'));var rimraf=require(_0xbde3('0x7'));var config=require(_0xbde3('0x8'));var attributes=require(_0xbde3('0x9'));module[_0xbde3('0xa')]=function(_0x229ebc,_0x2c1643){return _0x229ebc[_0xbde3('0xb')](_0xbde3('0xc'),attributes,{'tableName':_0xbde3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbde3('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 4ee0260..6d9fe78 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 _0x7aa9=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','body','options','raw','attributes','limit','debug','UpdateFaxApplication','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x493ca0,_0x36e43e){var _0x304979=function(_0x15a8e1){while(--_0x15a8e1){_0x493ca0['push'](_0x493ca0['shift']());}};_0x304979(++_0x36e43e);}(_0x7aa9,0x150));var _0x97aa=function(_0x492bfc,_0x57e49a){_0x492bfc=_0x492bfc-0x0;var _0x44af9b=_0x7aa9[_0x492bfc];return _0x44af9b;};'use strict';var _=require(_0x97aa('0x0'));var util=require('util');var moment=require(_0x97aa('0x1'));var BPromise=require(_0x97aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97aa('0x3'))['db'];var utils=require(_0x97aa('0x4'));var logger=require(_0x97aa('0x5'))(_0x97aa('0x6'));var config=require(_0x97aa('0x7'));var jayson=require(_0x97aa('0x8'));var client=jayson[_0x97aa('0x9')][_0x97aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x211824,_0x3b2d7c,_0x5b8b92){return new BPromise(function(_0x5125f0,_0x387f89){return client[_0x97aa('0xb')](_0x211824,_0x5b8b92)[_0x97aa('0xc')](function(_0x995f1d){logger[_0x97aa('0xd')](_0x97aa('0xe'),_0x3b2d7c,_0x97aa('0xf'));logger['debug'](_0x97aa('0x10'),_0x3b2d7c,_0x97aa('0xf'),JSON[_0x97aa('0x11')](_0x995f1d));if(_0x995f1d[_0x97aa('0x12')]){if(_0x995f1d[_0x97aa('0x12')][_0x97aa('0x13')]===0x1f4){logger[_0x97aa('0x12')](_0x97aa('0xe'),_0x3b2d7c,_0x995f1d['error'][_0x97aa('0x14')]);return _0x387f89(_0x995f1d[_0x97aa('0x12')][_0x97aa('0x14')]);}logger[_0x97aa('0x12')](_0x97aa('0xe'),_0x3b2d7c,_0x995f1d[_0x97aa('0x12')]['message']);return _0x5125f0(_0x995f1d['error'][_0x97aa('0x14')]);}else{logger[_0x97aa('0xd')](_0x97aa('0xe'),_0x3b2d7c,_0x97aa('0xf'));_0x5125f0(_0x995f1d[_0x97aa('0x15')][_0x97aa('0x14')]);}})[_0x97aa('0x16')](function(_0x255e2b){logger[_0x97aa('0x12')]('FaxApplication,\x20%s,\x20%s',_0x3b2d7c,_0x255e2b);_0x387f89(_0x255e2b);});});}exports['UpdateFaxApplication']=function(_0x1b36b8){var _0x5d71ac=this;return new Promise(function(_0x271a88,_0x2c43ce){return db[_0x97aa('0x17')][_0x97aa('0x18')](_0x1b36b8[_0x97aa('0x19')],{'raw':_0x1b36b8['options']?_0x1b36b8[_0x97aa('0x1a')][_0x97aa('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b36b8['options']?_0x1b36b8[_0x97aa('0x1a')]['where']||null:null,'attributes':_0x1b36b8[_0x97aa('0x1a')]?_0x1b36b8[_0x97aa('0x1a')][_0x97aa('0x1c')]||null:null,'limit':_0x1b36b8[_0x97aa('0x1a')]?_0x1b36b8[_0x97aa('0x1a')][_0x97aa('0x1d')]||null:null})[_0x97aa('0xc')](function(_0x159c34){logger[_0x97aa('0xd')]('UpdateFaxApplication',_0x1b36b8);logger[_0x97aa('0x1e')]('UpdateFaxApplication',_0x1b36b8,JSON[_0x97aa('0x11')](_0x159c34));_0x271a88(_0x159c34);})[_0x97aa('0x16')](function(_0x303725){logger[_0x97aa('0x12')](_0x97aa('0x1f'),_0x303725[_0x97aa('0x14')],_0x1b36b8);_0x2c43ce(_0x5d71ac[_0x97aa('0x12')](0x1f4,_0x303725[_0x97aa('0x14')]));});});}; \ No newline at end of file +var _0x9d2a=['FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FaxApplication','update','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x1c80a0,_0x15d89e){var _0x56783b=function(_0x2d3984){while(--_0x2d3984){_0x1c80a0['push'](_0x1c80a0['shift']());}};_0x56783b(++_0x15d89e);}(_0x9d2a,0xcb));var _0xa9d2=function(_0x237513,_0x78a989){_0x237513=_0x237513-0x0;var _0x28be7a=_0x9d2a[_0x237513];return _0x28be7a;};'use strict';var _=require(_0xa9d2('0x0'));var util=require(_0xa9d2('0x1'));var moment=require(_0xa9d2('0x2'));var BPromise=require(_0xa9d2('0x3'));var rs=require(_0xa9d2('0x4'));var fs=require('fs');var Redis=require(_0xa9d2('0x5'));var db=require(_0xa9d2('0x6'))['db'];var utils=require(_0xa9d2('0x7'));var logger=require(_0xa9d2('0x8'))(_0xa9d2('0x9'));var config=require(_0xa9d2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa9d2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x503189,_0x17bfe1,_0x41045c){return new BPromise(function(_0x4eeba9,_0x1a4c39){return client[_0xa9d2('0xc')](_0x503189,_0x41045c)[_0xa9d2('0xd')](function(_0x4e0596){logger['info'](_0xa9d2('0xe'),_0x17bfe1,'request\x20sent');logger[_0xa9d2('0xf')](_0xa9d2('0x10'),_0x17bfe1,_0xa9d2('0x11'),JSON[_0xa9d2('0x12')](_0x4e0596));if(_0x4e0596[_0xa9d2('0x13')]){if(_0x4e0596[_0xa9d2('0x13')][_0xa9d2('0x14')]===0x1f4){logger[_0xa9d2('0x13')](_0xa9d2('0xe'),_0x17bfe1,_0x4e0596[_0xa9d2('0x13')][_0xa9d2('0x15')]);return _0x1a4c39(_0x4e0596[_0xa9d2('0x13')][_0xa9d2('0x15')]);}logger['error'](_0xa9d2('0xe'),_0x17bfe1,_0x4e0596['error'][_0xa9d2('0x15')]);return _0x4eeba9(_0x4e0596[_0xa9d2('0x13')][_0xa9d2('0x15')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x17bfe1,_0xa9d2('0x11'));_0x4eeba9(_0x4e0596['result'][_0xa9d2('0x15')]);}})[_0xa9d2('0x16')](function(_0x3cd6fa){logger[_0xa9d2('0x13')](_0xa9d2('0xe'),_0x17bfe1,_0x3cd6fa);_0x1a4c39(_0x3cd6fa);});});}exports['UpdateFaxApplication']=function(_0x319229){var _0x39b916=this;return new Promise(function(_0x2fe381,_0x4143ee){return db[_0xa9d2('0x17')][_0xa9d2('0x18')](_0x319229['body'],{'raw':_0x319229[_0xa9d2('0x19')]?_0x319229['options'][_0xa9d2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x319229[_0xa9d2('0x19')]?_0x319229[_0xa9d2('0x19')][_0xa9d2('0x1b')]||null:null,'attributes':_0x319229[_0xa9d2('0x19')]?_0x319229[_0xa9d2('0x19')][_0xa9d2('0x1c')]||null:null,'limit':_0x319229[_0xa9d2('0x19')]?_0x319229['options'][_0xa9d2('0x1d')]||null:null})['then'](function(_0x44caef){logger['info'](_0xa9d2('0x1e'),_0x319229);logger[_0xa9d2('0xf')](_0xa9d2('0x1e'),_0x319229,JSON[_0xa9d2('0x12')](_0x44caef));_0x2fe381(_0x44caef);})[_0xa9d2('0x16')](function(_0x523893){logger[_0xa9d2('0x13')](_0xa9d2('0x1e'),_0x523893[_0xa9d2('0x15')],_0x319229);_0x4143ee(_0x39b916['error'](0x1f4,_0x523893['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index cb10931..259d81c 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 _0x5496=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxApplication.controller','get','/:id','show','post','isAuthenticated','put','update','delete','exports','multer'];(function(_0x531cb1,_0x28a048){var _0x117c81=function(_0x1a4aaa){while(--_0x1a4aaa){_0x531cb1['push'](_0x531cb1['shift']());}};_0x117c81(++_0x28a048);}(_0x5496,0x175));var _0x6549=function(_0x22db3d,_0x12d5cb){_0x22db3d=_0x22db3d-0x0;var _0x20dca1=_0x5496[_0x22db3d];return _0x20dca1;};'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('0xb')]('/',auth[_0x6549('0xc')](),controller['create']);router[_0x6549('0xd')](_0x6549('0x9'),auth[_0x6549('0xc')](),controller[_0x6549('0xe')]);router[_0x6549('0xf')](_0x6549('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x6549('0x10')]=router; \ No newline at end of file +var _0xeec6=['get','index','isAuthenticated','show','post','put','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0xeec6,0x1c2));var _0x6eec=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0xeec6[_0x56138f];return _0x1acaf7;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var auth=require(_0x6eec('0x5'));var interaction=require(_0x6eec('0x6'));var config=require(_0x6eec('0x7'));var controller=require(_0x6eec('0x8'));router[_0x6eec('0x9')]('/',auth['isAuthenticated'](),controller[_0x6eec('0xa')]);router[_0x6eec('0x9')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xc')]);router[_0x6eec('0xd')]('/',auth[_0x6eec('0xb')](),controller['create']);router[_0x6eec('0xe')](_0x6eec('0xf'),auth[_0x6eec('0xb')](),controller['update']);router['delete']('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 88e47a9..896b2fa 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 _0xd8df=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0xf3b124,_0x5bd998){var _0x16aa63=function(_0x25a72b){while(--_0x25a72b){_0xf3b124['push'](_0xf3b124['shift']());}};_0x16aa63(++_0x5bd998);}(_0xd8df,0xff));var _0xfd8d=function(_0x4b9ace,_0x29282d){_0x4b9ace=_0x4b9ace-0x0;var _0x11cc9f=_0xd8df[_0x4b9ace];return _0x11cc9f;};'use strict';var Sequelize=require('sequelize');module[_0xfd8d('0x0')]={'closed':{'type':Sequelize[_0xfd8d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfd8d('0x2')]},'disposition':{'type':Sequelize[_0xfd8d('0x3')]},'note':{'type':Sequelize[_0xfd8d('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xfd8d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xfd8d('0x4')]('in',_0xfd8d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfd8d('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfd8d('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x3e06=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x1479dc,_0xa30dfc){var _0x50abf9=function(_0x21efda){while(--_0x21efda){_0x1479dc['push'](_0x1479dc['shift']());}};_0x50abf9(++_0xa30dfc);}(_0x3e06,0x16e));var _0x63e0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3e06[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x63e0('0x0'));module[_0x63e0('0x1')]={'closed':{'type':Sequelize[_0x63e0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x63e0('0x3')]},'note':{'type':Sequelize[_0x63e0('0x3')]},'read1stAt':{'type':Sequelize[_0x63e0('0x4')]},'fax':{'type':Sequelize[_0x63e0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x63e0('0x5')]('in',_0x63e0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x63e0('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 b2d9dcc..a677a75 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 _0xa801=['keys','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','removeTags','download','unix','join','root','files','attachments','tmp','createdAt','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','Users','TagIds','forEach','Tags','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','offset','order','sort','where','select','field','color','from','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','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','user','getFaxAccounts','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa801,0x1cb));var _0x1a80=function(_0x5c77d9,_0x4747ac){_0x5c77d9=_0x5c77d9-0x0;var _0x168a68=_0xa801[_0x5c77d9];return _0x168a68;};'use strict';var pdf=require(_0x1a80('0x0'));var emlformat=require(_0x1a80('0x1'));var rimraf=require(_0x1a80('0x2'));var zipdir=require(_0x1a80('0x3'));var jsonpatch=require(_0x1a80('0x4'));var rp=require(_0x1a80('0x5'));var moment=require(_0x1a80('0x6'));var BPromise=require(_0x1a80('0x7'));var Mustache=require(_0x1a80('0x8'));var util=require(_0x1a80('0x9'));var path=require(_0x1a80('0xa'));var sox=require('sox');var csv=require(_0x1a80('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1a80('0xc'));var squel=require(_0x1a80('0xd'));var crypto=require('crypto');var jsforce=require(_0x1a80('0xe'));var deskjs=require(_0x1a80('0xf'));var toCsv=require(_0x1a80('0xb'));var querystring=require(_0x1a80('0x10'));var Papa=require(_0x1a80('0x11'));var Redis=require(_0x1a80('0x12'));var authService=require(_0x1a80('0x13'));var qs=require(_0x1a80('0x14'));var as=require(_0x1a80('0x15'));var hardwareService=require(_0x1a80('0x16'));var logger=require(_0x1a80('0x17'))(_0x1a80('0x18'));var utils=require(_0x1a80('0x19'));var config=require(_0x1a80('0x1a'));var db=require(_0x1a80('0x1b'))['db'];config[_0x1a80('0x1c')]=_[_0x1a80('0x1d')](config[_0x1a80('0x1c')],{'host':_0x1a80('0x1e'),'port':0x18eb});var socket=require(_0x1a80('0x1f'))(new Redis(config['redis']));require(_0x1a80('0x20'))['register'](socket);function respondWithStatusCode(_0x1f399f,_0x3cbfe0){_0x3cbfe0=_0x3cbfe0||0xcc;return function(_0x24ffe2){if(_0x24ffe2){return _0x1f399f[_0x1a80('0x21')](_0x3cbfe0);}return _0x1f399f[_0x1a80('0x22')](_0x3cbfe0)[_0x1a80('0x23')]();};}function respondWithResult(_0x11c06c,_0x4555cf){_0x4555cf=_0x4555cf||0xc8;return function(_0x528e4d){if(_0x528e4d){return _0x11c06c[_0x1a80('0x22')](_0x4555cf)['json'](_0x528e4d);}};}function respondWithFilteredResult(_0xd0706e,_0x3cab89){return function(_0x2f06bf){if(_0x2f06bf){var _0x11e93a=_0x2f06bf[_0x1a80('0x24')],_0x3b75da=_0x3cab89['offset'],_0x180143=_0x3cab89['offset']+_0x3cab89[_0x1a80('0x25')],_0x1be41e;if(_0x180143>=_0x11e93a){_0x180143=_0x11e93a;_0x1be41e=0xc8;}else{_0x1be41e=0xce;}_0xd0706e['status'](_0x1be41e);return _0xd0706e[_0x1a80('0x26')](_0x1a80('0x27'),_0x3b75da+'-'+_0x180143+'/'+_0x11e93a)[_0x1a80('0x28')](_0x2f06bf);}return null;};}function patchUpdates(_0x66642c){return function(_0x47a876){try{jsonpatch[_0x1a80('0x29')](_0x47a876,_0x66642c,!![]);}catch(_0x56a4e3){return BPromise[_0x1a80('0x2a')](_0x56a4e3);}return _0x47a876[_0x1a80('0x2b')]();};}function saveUpdates(_0x2ce76b,_0x198375){return function(_0x29778f){if(_0x29778f){return _0x29778f[_0x1a80('0x2c')](_0x2ce76b)[_0x1a80('0x2d')](function(_0x482da0){return _0x482da0;});}return null;};}function removeEntity(_0x297f33,_0x121335){return function(_0x541f1d){if(_0x541f1d){return _0x541f1d[_0x1a80('0x2e')]()[_0x1a80('0x2d')](function(){_0x297f33[_0x1a80('0x22')](0xcc)[_0x1a80('0x23')]();});}};}function handleEntityNotFound(_0x22938f,_0x53c9fb){return function(_0x58b9e8){if(!_0x58b9e8){_0x22938f[_0x1a80('0x21')](0x194);}return _0x58b9e8;};}function handleError(_0x39f3a4,_0x23d3d5){_0x23d3d5=_0x23d3d5||0x1f4;return function(_0x353806){logger[_0x1a80('0x2f')](_0x353806[_0x1a80('0x30')]);if(_0x353806[_0x1a80('0x31')]){delete _0x353806[_0x1a80('0x31')];}_0x39f3a4[_0x1a80('0x22')](_0x23d3d5)[_0x1a80('0x32')](_0x353806);};}function getInteractionUsers(_0x5a54b4,_0x54b101){return new BPromise(function(_0x15573f,_0x460aea){try{if(_0x54b101[_0x5a54b4['id']]){_0x5a54b4[_0x1a80('0x33')]=_['map'](_0x54b101[_0x5a54b4['id']],function(_0x4ee9e2){return{'id':_0x4ee9e2['id']};});}}catch(_0x3d8a29){_0x460aea(_0x3d8a29);}_0x15573f(_0x5a54b4);});}function getInteractionTags(_0x40a610,_0x9dc870){return new BPromise(function(_0x81631c,_0x573260){try{if(_0x40a610[_0x1a80('0x34')]){_0x40a610['Tags']=[];_0x40a610[_0x1a80('0x34')]['split'](',')[_0x1a80('0x35')](function(_0x51acac){_0x40a610[_0x1a80('0x36')][_0x1a80('0x37')](_0x9dc870[_0x51acac]);});}delete _0x40a610[_0x1a80('0x34')];}catch(_0xad7c3e){_0x573260(_0xad7c3e);}_0x81631c(_0x40a610);});}function updateFaxInteraction(_0x35978c,_0x1e03ec,_0x42757c){return new BPromise(function(_0x24f200,_0x5ad483){return getInteractionUsers(_0x35978c,_0x42757c)[_0x1a80('0x2d')](function(_0x45fcec){return getInteractionTags(_0x45fcec,_0x1e03ec);})[_0x1a80('0x2d')](function(_0x301e0d){_0x24f200(_0x301e0d);})[_0x1a80('0x38')](function(_0x1e9ab8){_0x5ad483(_0x1e9ab8);});});}exports[_0x1a80('0x39')]=function(_0x57b1f,_0x19608b){var _0x40e3b2={},_0x100111={},_0x71969b={'count':0x0,'rows':[]};var _0x11f065=_['map'](db[_0x1a80('0x3a')][_0x1a80('0x3b')],function(_0x1155c3){return{'name':_0x1155c3[_0x1a80('0x3c')],'type':_0x1155c3[_0x1a80('0x3d')][_0x1a80('0x3e')]};});_0x100111[_0x1a80('0x3f')]=_[_0x1a80('0x40')](_0x11f065,_0x1a80('0x31'));_0x100111['query']=_['keys'](_0x57b1f[_0x1a80('0x41')]);_0x100111[_0x1a80('0x42')]=_[_0x1a80('0x43')](_0x100111[_0x1a80('0x3f')],_0x100111[_0x1a80('0x41')]);_0x40e3b2['attributes']=_[_0x1a80('0x43')](_0x100111[_0x1a80('0x3f')],qs['fields'](_0x57b1f[_0x1a80('0x41')][_0x1a80('0x44')]));_0x40e3b2[_0x1a80('0x45')]=_0x40e3b2['attributes']['length']?_0x40e3b2[_0x1a80('0x45')]:_0x100111['model'];if(!_0x57b1f['query'][_0x1a80('0x46')]('nolimit')){_0x40e3b2['limit']=qs[_0x1a80('0x25')](_0x57b1f[_0x1a80('0x41')]['limit']);_0x40e3b2['offset']=qs[_0x1a80('0x47')](_0x57b1f[_0x1a80('0x41')][_0x1a80('0x47')]);}_0x40e3b2[_0x1a80('0x48')]=qs[_0x1a80('0x49')](_0x57b1f[_0x1a80('0x41')][_0x1a80('0x49')]);_0x40e3b2[_0x1a80('0x4a')]=qs[_0x1a80('0x42')](_['pick'](_0x57b1f['query'],_0x100111[_0x1a80('0x42')]));var _0x522b93=[];var _0x2aac51=squel[_0x1a80('0x4b')]()[_0x1a80('0x4c')]('id')[_0x1a80('0x4c')](_0x1a80('0x31'))[_0x1a80('0x4c')](_0x1a80('0x4d'))[_0x1a80('0x4e')]('tools_tags');var _0x46151f=squel[_0x1a80('0x4b')]()[_0x1a80('0x4c')](_0x1a80('0x4f'))['field'](_0x1a80('0x50'))['from'](_0x1a80('0x51'),'ui')[_0x1a80('0x52')](_0x1a80('0x53'),'u',_0x1a80('0x54'));var _0x453e42=squel['select']()[_0x1a80('0x4e')](_0x1a80('0x55'),'i')[_0x1a80('0x52')](_0x1a80('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1a80('0x52')](_0x1a80('0x53'),'o',_0x1a80('0x57'))[_0x1a80('0x52')](_0x1a80('0x58'),'a',_0x1a80('0x59'))[_0x1a80('0x52')](_0x1a80('0x5a'),'me',_0x1a80('0x5b'))[_0x1a80('0x52')](_0x1a80('0x5c'),'it',_0x1a80('0x5d'))[_0x1a80('0x52')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x67cfcf=squel['expr']();var _0x24e76c=[];var _0x187541=squel[_0x1a80('0x5e')]();var _0x46d0ab;if(_0x57b1f[_0x1a80('0x41')][_0x1a80('0x5f')]){_0x46d0ab=as['parseSearch'](_0x57b1f['query']['search']);var _0x54031a=_0x46d0ab[_0x1a80('0x60')];for(var _0x2b030f=0x0;_0x2b030f<_0x46d0ab[_0x1a80('0x61')][_0x1a80('0x62')];_0x2b030f++){var _0x2e8d2e=_0x46d0ab['conditions'][_0x2b030f];var _0x10afc7='i';var _0x3d8087=_[_0x1a80('0x63')](_0x11f065,[_0x1a80('0x31'),_0x2e8d2e[_0x1a80('0x4c')]]);if(!_0x3d8087){switch(_0x2e8d2e['field']){case _0x1a80('0x64'):if(_0x2e8d2e[_0x1a80('0x65')]==0x1){_0x453e42[_0x1a80('0x66')]('`'+_0x2e8d2e['field']+_0x1a80('0x67'));}else{_0x453e42[_0x1a80('0x66')]('`'+_0x2e8d2e['field']+'`\x20>\x200');}break;case _0x1a80('0x68'):if(_0x2e8d2e[_0x1a80('0x69')]==='$substring'){if(_0x2e8d2e['value']['split']('\x20')[_0x1a80('0x62')]>0x1){_0x67cfcf[_0x54031a](_0x1a80('0x6a'),qs[_0x1a80('0x6b')](_0x2e8d2e['value']),null);}else{var _0x4a90e5='%'+_0x2e8d2e[_0x1a80('0x65')]+'%';_0x67cfcf[_0x54031a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4a90e5,_0x4a90e5,_0x4a90e5);}}else{_0x3d8087=_['find'](_0x11f065,[_0x1a80('0x31'),_0x1a80('0x6c')]);_0x2e8d2e[_0x1a80('0x4c')]=_0x1a80('0x6c');_0x36e4cd=as[_0x1a80('0x6d')](_0x10afc7,_0x3d8087[_0x1a80('0x3d')],_0x2e8d2e);_0x67cfcf[_0x54031a](_0x36e4cd[_0x1a80('0x6e')],_0x36e4cd[_0x1a80('0x65')][_0x1a80('0x6f')],_0x36e4cd[_0x1a80('0x65')]['end']);}break;case'Tag':var _0x2006d4=_0x2e8d2e['value'][_0x1a80('0x70')](',')[_0x1a80('0x40')](function(_0x1b4993){return Number(_0x1b4993);});_0x2006d4[_0x1a80('0x35')](function(_0x3cf489){_0x187541['or'](_0x1a80('0x71'),'%,'+_0x3cf489+',%');});_0x24e76c=_['union'](_0x24e76c,_0x2006d4);break;case _0x1a80('0x72'):if(_0x2e8d2e[_0x1a80('0x69')]===_0x1a80('0x73')){_0x67cfcf[_0x54031a](_0x1a80('0x74'),'%'+_0x2e8d2e[_0x1a80('0x65')]+'%',null);}else{_0x3d8087=_[_0x1a80('0x63')](_0x11f065,[_0x1a80('0x31'),_0x1a80('0x75')]);_0x2e8d2e['field']='UserId';_0x36e4cd=as[_0x1a80('0x6d')](_0x10afc7,_0x3d8087[_0x1a80('0x3d')],_0x2e8d2e);_0x67cfcf[_0x54031a](_0x36e4cd[_0x1a80('0x6e')],_0x36e4cd['value']['start'],_0x36e4cd['value'][_0x1a80('0x23')]);}break;case _0x1a80('0x76'):_0x36e4cd=as[_0x1a80('0x6d')]('me',null,_0x2e8d2e);_0x67cfcf[_0x54031a](_0x36e4cd[_0x1a80('0x6e')],_0x36e4cd[_0x1a80('0x65')]['start'],_0x36e4cd['value'][_0x1a80('0x23')]);break;}}else{var _0x36e4cd=as[_0x1a80('0x6d')](_0x10afc7,_0x3d8087[_0x1a80('0x3d')],_0x2e8d2e);_0x67cfcf[_0x54031a](_0x36e4cd['text'],_0x36e4cd[_0x1a80('0x65')][_0x1a80('0x6f')],_0x36e4cd['value']['end']);}}}else{var _0x1a9721=_(_0x57b1f[_0x1a80('0x41')])['keys']()['map'](function(_0x2154df){return _[_0x1a80('0x77')](_0x11f065,['name',_0x2154df])?_0x2154df:undefined;})[_0x1a80('0x78')]()[_0x1a80('0x65')]();if(!_[_0x1a80('0x79')](_0x1a9721)){_0x1a9721[_0x1a80('0x35')](function(_0x586bd7){if(_0x586bd7==='FaxAccountId'){_0x453e42[_0x1a80('0x4a')](_0x1a80('0x7a'),[][_0x1a80('0x7b')](_0x57b1f['query'][_0x586bd7]));}else if(_0x586bd7==='createdAt'){var _0x2dda31=JSON['parse'](_0x57b1f[_0x1a80('0x41')][_0x586bd7])['$gte'];var _0x45718e=JSON[_0x1a80('0x7c')](_0x57b1f[_0x1a80('0x41')][_0x586bd7])[_0x1a80('0x7d')];_0x453e42['where'](_0x1a80('0x7e'),_0x2dda31,_0x45718e);}else{if(_0x57b1f['query'][_0x586bd7]===_0x1a80('0x7f')){_0x453e42[_0x1a80('0x4a')]('i.'+_0x586bd7+'\x20IS\x20NULL');}else{_0x453e42[_0x1a80('0x4a')]('i.'+_0x586bd7+_0x1a80('0x80'),_0x57b1f['query'][_0x586bd7]);}}});}if(_0x57b1f[_0x1a80('0x41')][_0x1a80('0x81')]){if(_0x57b1f['query'][_0x1a80('0x81')]==0x1){_0x453e42[_0x1a80('0x66')]('`unreadMessages`\x20=\x200');}else{_0x453e42[_0x1a80('0x66')](_0x1a80('0x82'));}}if(_0x57b1f[_0x1a80('0x41')][_0x1a80('0x83')]){_0x24e76c=_['isArray'](_0x57b1f['query'][_0x1a80('0x83')])?_0x57b1f['query'][_0x1a80('0x83')]:new Array(_0x57b1f[_0x1a80('0x41')][_0x1a80('0x83')]);_0x24e76c[_0x1a80('0x35')](function(_0xac9177){_0x187541['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xac9177+',%');});}if(_0x57b1f[_0x1a80('0x41')][_0x1a80('0x84')]){var _0x5196e5=_0x57b1f[_0x1a80('0x41')][_0x1a80('0x84')][_0x1a80('0x85')]('\x5c','\x5c\x5c')[_0x1a80('0x85')]('\x27\x27',_0x1a80('0x86'));if(qs[_0x1a80('0x87')](_0x5196e5)){_0x67cfcf['or'](_0x1a80('0x88'),_0x5196e5+'%')['or'](_0x1a80('0x89'),_0x5196e5+'%');}_0x67cfcf['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5196e5+'%');}}_0x453e42[_0x1a80('0x4a')](_0x67cfcf);_0x453e42[_0x1a80('0x8a')](_0x1a80('0x8b'));var _0x3e1394={'type':db[_0x1a80('0x8c')][_0x1a80('0x8d')][_0x1a80('0x8e')],'raw':!![]};var _0x37089b=_0x453e42[_0x1a80('0x8f')]();_0x37089b['field'](_0x1a80('0x8b'));_0x37089b[_0x1a80('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1a80('0x64'));if(_0x40e3b2[_0x1a80('0x48')]){_0x40e3b2[_0x1a80('0x48')][_0x1a80('0x35')](function(_0x12d465){_0x453e42[_0x1a80('0x48')]('i.'+_0x12d465[0x0],_0x12d465[0x1]===_0x1a80('0x90')?![]:!![]);});}if(!_[_0x1a80('0x79')](_0x24e76c)){_0x453e42[_0x1a80('0x66')](_0x187541);_0x37089b[_0x1a80('0x4a')]('t.id\x20IN\x20?',_0x24e76c);}BPromise['resolve']()[_0x1a80('0x2d')](function(){if(!_0x46d0ab)return;return _0x57b1f[_0x1a80('0x91')][_0x1a80('0x92')]({'attributes':['id'],'raw':!![]})[_0x1a80('0x2d')](function(_0x861342){_0x37089b['where'](_0x1a80('0x7a'),_[_0x1a80('0x40')](_0x861342,'id'));_0x453e42[_0x1a80('0x4a')](_0x1a80('0x7a'),_[_0x1a80('0x40')](_0x861342,'id'));});})[_0x1a80('0x2d')](function(){db[_0x1a80('0x93')][_0x1a80('0x41')](_0x37089b[_0x1a80('0x94')](),_0x3e1394)[_0x1a80('0x2d')](function(_0x22c945){_0x71969b[_0x1a80('0x24')]=_0x22c945[_0x1a80('0x62')];if(_0x71969b[_0x1a80('0x24')]===0x0)return[];return db[_0x1a80('0x93')][_0x1a80('0x41')](_0x2aac51[_0x1a80('0x94')](),_0x3e1394)[_0x1a80('0x2d')](function(_0x1605fb){_0x522b93=_['keyBy'](_0x1605fb,'id');_0x3e1394=_[_0x1a80('0x95')](_0x3e1394,{'model':db[_0x1a80('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x453e42[_0x1a80('0x4c')](_0x1a80('0x96'),_0x1a80('0x64'));_0x453e42[_0x1a80('0x4c')](_0x1a80('0x97'),_0x1a80('0x98'));_0x453e42[_0x1a80('0x4c')](_0x1a80('0x99'),_0x1a80('0x9a'));_0x453e42[_0x1a80('0x4c')]('i.*');_0x453e42[_0x1a80('0x4c')](_0x1a80('0x9b'),'Contact.firstName');_0x453e42[_0x1a80('0x4c')](_0x1a80('0x9c'),_0x1a80('0x9d'));_0x453e42[_0x1a80('0x4c')](_0x1a80('0x9e'),'Contact.email');_0x453e42[_0x1a80('0x4c')](_0x1a80('0x9f'),'Contact.phone');_0x453e42['field'](_0x1a80('0xa0'),_0x1a80('0xa1'));_0x453e42[_0x1a80('0x4c')]('c.fax',_0x1a80('0xa2'));_0x453e42[_0x1a80('0x4c')](_0x1a80('0xa3'),_0x1a80('0x34'));_0x453e42[_0x1a80('0x25')](_0x40e3b2['limit']);_0x453e42[_0x1a80('0x47')](_0x40e3b2[_0x1a80('0x47')]);return db[_0x1a80('0x93')][_0x1a80('0x41')](_0x453e42[_0x1a80('0x94')](),_0x3e1394);})[_0x1a80('0x2d')](function(_0x614c1a){_0x46151f[_0x1a80('0x4a')](_0x1a80('0xa4'),_[_0x1a80('0x40')](_0x614c1a,'id'));return db[_0x1a80('0x93')][_0x1a80('0x41')](_0x46151f[_0x1a80('0x94')](),_0x3e1394)[_0x1a80('0x2d')](function(_0x4dfb00){var _0x4cf146=_[_0x1a80('0xa5')](_0x4dfb00,_0x1a80('0xa6'));var _0x2b3f88=[];_0x614c1a['forEach'](function(_0x317bf3){_0x2b3f88[_0x1a80('0x37')](updateFaxInteraction(_0x317bf3,_0x522b93,_0x4cf146));});return BPromise[_0x1a80('0xa7')](_0x2b3f88);});});})['then'](function(_0x40f4b5){_0x71969b[_0x1a80('0xa8')]=_0x40f4b5;return _0x71969b;})[_0x1a80('0x2d')](respondWithFilteredResult(_0x19608b,_0x40e3b2));})['catch'](handleError(_0x19608b,null));};exports[_0x1a80('0xa9')]=function(_0x1ee185,_0x3a9960){var _0x375aa6={'raw':![],'where':{'id':_0x1ee185[_0x1a80('0xaa')]['id']}},_0x5a0cce={};_0x5a0cce[_0x1a80('0x3f')]=_[_0x1a80('0xab')](db['FaxInteraction'][_0x1a80('0x3b')]);_0x5a0cce[_0x1a80('0x41')]=_[_0x1a80('0xab')](_0x1ee185[_0x1a80('0x41')]);_0x5a0cce[_0x1a80('0x42')]=_[_0x1a80('0x43')](_0x5a0cce[_0x1a80('0x3f')],_0x5a0cce['query']);_0x375aa6[_0x1a80('0x45')]=_[_0x1a80('0x43')](_0x5a0cce[_0x1a80('0x3f')],qs[_0x1a80('0x44')](_0x1ee185['query']['fields']));_0x375aa6['attributes']=_0x375aa6[_0x1a80('0x45')][_0x1a80('0x62')]?_0x375aa6[_0x1a80('0x45')]:_0x5a0cce[_0x1a80('0x3f')];if(_0x1ee185[_0x1a80('0x41')][_0x1a80('0xac')]){_0x375aa6[_0x1a80('0xad')]=[{'all':!![]}];}_0x375aa6=_['merge']({},_0x375aa6,_0x1ee185[_0x1a80('0xae')]);return db[_0x1a80('0x3a')][_0x1a80('0x63')](_0x375aa6)[_0x1a80('0x2d')](handleEntityNotFound(_0x3a9960,null))[_0x1a80('0x2d')](respondWithResult(_0x3a9960,null))['catch'](handleError(_0x3a9960,null));};exports[_0x1a80('0xaf')]=function(_0x36826d,_0x41c7f5){return db[_0x1a80('0x3a')][_0x1a80('0xaf')](_0x36826d[_0x1a80('0x76')],{})[_0x1a80('0x2d')](respondWithResult(_0x41c7f5,0xc9))[_0x1a80('0x38')](handleError(_0x41c7f5,null));};exports['update']=function(_0x118476,_0x1172b7){if(_0x118476['body']['id']){delete _0x118476[_0x1a80('0x76')]['id'];}return db[_0x1a80('0x3a')][_0x1a80('0x63')]({'where':{'id':_0x118476['params']['id']}})[_0x1a80('0x2d')](handleEntityNotFound(_0x1172b7,null))[_0x1a80('0x2d')](saveUpdates(_0x118476['body'],null))[_0x1a80('0x2d')](respondWithResult(_0x1172b7,null))[_0x1a80('0x38')](handleError(_0x1172b7,null));};exports[_0x1a80('0x2e')]=function(_0x1586a5,_0x4367f3){return db[_0x1a80('0x3a')]['find']({'where':{'id':_0x1586a5[_0x1a80('0xaa')]['id']}})['then'](handleEntityNotFound(_0x4367f3,null))['then'](removeEntity(_0x4367f3,null))['catch'](handleError(_0x4367f3,null));};exports[_0x1a80('0xb0')]=function(_0x4fbdab,_0x268f91){return db[_0x1a80('0x3a')]['describe']()['then'](respondWithResult(_0x268f91,null))[_0x1a80('0x38')](handleError(_0x268f91,null));};exports[_0x1a80('0xb1')]=function(_0x2fb5ed,_0x1e4903,_0x51b6b9){return db[_0x1a80('0xb2')][_0x1a80('0x63')]({'where':{'id':_0x2fb5ed[_0x1a80('0xaa')]['id']}})['then'](handleEntityNotFound(_0x1e4903,null))['then'](function(_0xed2219){if(_0xed2219){return _0xed2219[_0x1a80('0xb1')](_0x2fb5ed[_0x1a80('0x76')][_0x1a80('0xb3')],_[_0x1a80('0xb4')](_0x2fb5ed[_0x1a80('0x76')],[_0x1a80('0xb3'),'id'])||{});}})[_0x1a80('0x2d')](respondWithResult(_0x1e4903,null))[_0x1a80('0x38')](handleError(_0x1e4903,null));};exports[_0x1a80('0xb5')]=function(_0x456512,_0x491c79,_0x49496a){var _0x2c3f42={'raw':![],'where':{}};var _0x41bde5={};var _0x5744af={'count':0x0,'rows':[]};return db[_0x1a80('0x3a')][_0x1a80('0xb6')]({'where':{'id':_0x456512[_0x1a80('0xaa')]['id']}})[_0x1a80('0x2d')](handleEntityNotFound(_0x491c79,null))[_0x1a80('0x2d')](function(_0x41d0e1){if(_0x41d0e1){_0x41bde5[_0x1a80('0x3f')]=_[_0x1a80('0xab')](db[_0x1a80('0xb2')][_0x1a80('0x3b')]);_0x41bde5['query']=_['keys'](_0x456512['query']);_0x41bde5[_0x1a80('0x42')]=_[_0x1a80('0x43')](_0x41bde5[_0x1a80('0x3f')],_0x41bde5['query']);_0x2c3f42[_0x1a80('0x45')]=_[_0x1a80('0x43')](_0x41bde5['model'],qs[_0x1a80('0x44')](_0x456512['query'][_0x1a80('0x44')]));_0x2c3f42[_0x1a80('0x45')]=_0x2c3f42[_0x1a80('0x45')][_0x1a80('0x62')]?_0x2c3f42[_0x1a80('0x45')]:_0x41bde5[_0x1a80('0x3f')];if(!_0x456512[_0x1a80('0x41')]['hasOwnProperty'](_0x1a80('0xb7'))){_0x2c3f42[_0x1a80('0x25')]=qs[_0x1a80('0x25')](_0x456512[_0x1a80('0x41')][_0x1a80('0x25')]);_0x2c3f42['offset']=qs[_0x1a80('0x47')](_0x456512[_0x1a80('0x41')][_0x1a80('0x47')]);}_0x2c3f42[_0x1a80('0x48')]=qs[_0x1a80('0x49')](_0x456512[_0x1a80('0x41')]['sort']);_0x2c3f42['where']=qs[_0x1a80('0x42')](_['pick'](_0x456512[_0x1a80('0x41')],_0x41bde5['filters']));_0x2c3f42['where']['FaxInteractionId']=_0x41d0e1['id'];if(_0x456512[_0x1a80('0x41')][_0x1a80('0x84')]){_0x2c3f42[_0x1a80('0x4a')]=_[_0x1a80('0x95')](_0x2c3f42[_0x1a80('0x4a')],{'$or':_['map'](_0x2c3f42[_0x1a80('0x45')],function(_0x644fc){var _0x5d82d6={};_0x5d82d6[_0x644fc]={'$like':'%'+_0x456512[_0x1a80('0x41')][_0x1a80('0x84')]+'%'};return _0x5d82d6;})});}if(_0x456512['query']['$gte']){var _0x409f50=_0x456512['query'][_0x1a80('0xb8')][_0x1a80('0x70')](',');var _0x49c27c={};_0x49c27c[_0x409f50[0x0]]={'$gte':moment(_0x409f50[0x1])[_0x1a80('0xb9')](_0x1a80('0xba'))};_0x2c3f42[_0x1a80('0x4a')]=_[_0x1a80('0x95')](_0x2c3f42['where'],_0x49c27c);}_0x2c3f42=_[_0x1a80('0x95')]({},_0x2c3f42,_0x456512[_0x1a80('0xae')]);return db[_0x1a80('0xb2')][_0x1a80('0x24')]({'where':_0x2c3f42[_0x1a80('0x4a')]})[_0x1a80('0x2d')](function(_0xd5090){_0x5744af[_0x1a80('0x24')]=_0xd5090;if(_0x456512[_0x1a80('0x41')][_0x1a80('0xac')]){_0x2c3f42[_0x1a80('0xad')]=[{'all':!![]}];}return db[_0x1a80('0xb2')][_0x1a80('0xbb')](_0x2c3f42);})[_0x1a80('0x2d')](function(_0x4036ee){_0x5744af[_0x1a80('0xa8')]=_0x4036ee;return _0x5744af;});}})[_0x1a80('0x2d')](respondWithFilteredResult(_0x491c79,_0x2c3f42))[_0x1a80('0x38')](handleError(_0x491c79,null));};exports[_0x1a80('0xbc')]=function(_0x27c831,_0x2541af,_0x5144b1){return db[_0x1a80('0x3a')][_0x1a80('0x63')]({'where':{'id':_0x27c831['params']['id']}})[_0x1a80('0x2d')](handleEntityNotFound(_0x2541af,null))[_0x1a80('0x2d')](function(_0x277179){if(_0x277179){return _0x277179[_0x1a80('0xbd')](_0x27c831[_0x1a80('0x76')][_0x1a80('0xb3')],_['omit'](_0x27c831[_0x1a80('0x76')],[_0x1a80('0xb3'),'id'])||{})[_0x1a80('0xbe')](function(){return db['Tag'][_0x1a80('0xbb')]({'attributes':['id','name',_0x1a80('0x4d')],'where':{'id':_0x27c831['body'][_0x1a80('0xb3')]}});})[_0x1a80('0x2d')](function(_0x610558){socket['emit']('faxInteractionTags:save',{'id':Number(_0x27c831[_0x1a80('0xaa')]['id']),'tags':_0x610558||[]});return{'id':Number(_0x27c831[_0x1a80('0xaa')]['id']),'tags':_0x610558||[]};});}})[_0x1a80('0x2d')](respondWithResult(_0x2541af,null))[_0x1a80('0x38')](handleError(_0x2541af,null));};exports[_0x1a80('0xbf')]=function(_0x125628,_0x36eace,_0x417398){return db[_0x1a80('0x3a')][_0x1a80('0x63')]({'where':{'id':_0x125628['params']['id']}})[_0x1a80('0x2d')](handleEntityNotFound(_0x36eace,null))[_0x1a80('0x2d')](function(_0x20bfc6){if(_0x20bfc6){return _0x20bfc6[_0x1a80('0xbf')](_0x125628[_0x1a80('0x41')][_0x1a80('0xb3')]);}})[_0x1a80('0x2d')](respondWithStatusCode(_0x36eace,null))['catch'](handleError(_0x36eace,null));};exports[_0x1a80('0xc0')]=function(_0x44ba91,_0x1f2cf5){var _0x323c00=moment()[_0x1a80('0xc1')]()[_0x1a80('0x94')]();var _0x4fa1aa=path[_0x1a80('0xc2')](config[_0x1a80('0xc3')],'server',_0x1a80('0xc4'),_0x1a80('0xc5'));var _0x56285d=path['join'](config[_0x1a80('0xc3')],'server',_0x1a80('0xc4'),_0x1a80('0xc6'));var _0x42c734=path['join'](_0x56285d,_0x323c00);var _0x1727f1=util[_0x1a80('0xb9')]('interaction-%s.zip',_0x323c00);var _0x199594=path['join'](_0x56285d,_0x1727f1);var _0x21e4c8=![];return db[_0x1a80('0x3a')][_0x1a80('0x63')]({'where':{'id':_0x44ba91[_0x1a80('0xaa')]['id']}})[_0x1a80('0x2d')](handleEntityNotFound(_0x1f2cf5,null))[_0x1a80('0x2d')](function(_0x172ec0){if(_0x172ec0){return _0x172ec0[_0x1a80('0xb5')]({'attributes':['id',_0x1a80('0x76'),_0x1a80('0xc7')],'include':[{'model':db[_0x1a80('0xc8')],'as':'Attachment'}]});}return[];})['then'](function(_0x2436cc){_0x21e4c8=_0x2436cc['length'];if(_0x2436cc[_0x1a80('0x62')]){fs[_0x1a80('0xc9')](_0x42c734);for(var _0x292ab1=0x0;_0x292ab1<_0x2436cc['length'];_0x292ab1++){var _0x167535=_0x2436cc[_0x292ab1];var _0x4c0ee6=_0x167535[_0x1a80('0xc8')];if(_0x4c0ee6){var _0x89942d=path[_0x1a80('0xc2')](_0x4fa1aa,_0x4c0ee6[_0x1a80('0xca')]);if(fs[_0x1a80('0xcb')](_0x89942d)){fs[_0x1a80('0xcc')](_0x89942d)[_0x1a80('0xcd')](fs[_0x1a80('0xce')](path[_0x1a80('0xc2')](_0x42c734,_0x4c0ee6[_0x1a80('0xca')])));}}}}})[_0x1a80('0x2d')](function(){if(_0x21e4c8){return new BPromise(function(_0x485daf,_0x5ec6e3){zipdir(_0x42c734,{'saveTo':_0x199594},function(_0x5915a7,_0x19585d){if(_0x5915a7)return _0x5ec6e3(_0x5915a7);return _0x485daf(_0x19585d);});});}})[_0x1a80('0x2d')](function(){if(_0x21e4c8){return new BPromise(function(_0x11e437,_0x399572){rimraf(_0x42c734,function(_0x34d2a5){if(_0x34d2a5)_0x399572(_0x34d2a5);return _0x11e437();});});}})[_0x1a80('0x2d')](function(){if(_0x21e4c8){return _0x1f2cf5[_0x1a80('0xc0')](_0x199594,_0x1727f1,function(_0x5f459e){if(_0x5f459e){console[_0x1a80('0xcf')](_0x1a80('0xd0'),_0x5f459e);}else{fs[_0x1a80('0xd1')](_0x199594);}});}else{return _0x1f2cf5['sendStatus'](0xc8);}})['catch'](handleError(_0x1f2cf5,null));}; \ No newline at end of file +var _0x1aad=['i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','isEmpty','t.id\x20IN\x20?','getFaxAccounts','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','rawAttributes','include','options','create','params','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','tmp','interaction-%s.zip','mkdirSync','basename','existsSync','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','limit','Content-Range','apply','reject','update','then','stack','name','Users','map','Tags','TagIds','split','forEach','push','catch','index','FaxInteraction','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','select','field','color','tools_tags','u.id','from','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric'];(function(_0xe44bce,_0x388218){var _0x182775=function(_0x29b288){while(--_0x29b288){_0xe44bce['push'](_0xe44bce['shift']());}};_0x182775(++_0x388218);}(_0x1aad,0x1cc));var _0xd1aa=function(_0x4cf6d2,_0x22e6d3){_0x4cf6d2=_0x4cf6d2-0x0;var _0x4146b4=_0x1aad[_0x4cf6d2];return _0x4146b4;};'use strict';var pdf=require(_0xd1aa('0x0'));var emlformat=require(_0xd1aa('0x1'));var rimraf=require(_0xd1aa('0x2'));var zipdir=require(_0xd1aa('0x3'));var jsonpatch=require(_0xd1aa('0x4'));var rp=require(_0xd1aa('0x5'));var moment=require(_0xd1aa('0x6'));var BPromise=require(_0xd1aa('0x7'));var Mustache=require('mustache');var util=require(_0xd1aa('0x8'));var path=require(_0xd1aa('0x9'));var sox=require(_0xd1aa('0xa'));var csv=require(_0xd1aa('0xb'));var ejs=require(_0xd1aa('0xc'));var fs=require('fs');var _=require(_0xd1aa('0xd'));var squel=require('squel');var crypto=require(_0xd1aa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd1aa('0xf'));var toCsv=require(_0xd1aa('0xb'));var querystring=require(_0xd1aa('0x10'));var Papa=require(_0xd1aa('0x11'));var Redis=require(_0xd1aa('0x12'));var authService=require(_0xd1aa('0x13'));var qs=require(_0xd1aa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd1aa('0x15'));var utils=require(_0xd1aa('0x16'));var config=require('../../config/environment');var db=require(_0xd1aa('0x17'))['db'];config[_0xd1aa('0x18')]=_[_0xd1aa('0x19')](config['redis'],{'host':_0xd1aa('0x1a'),'port':0x18eb});var socket=require(_0xd1aa('0x1b'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xd1aa('0x1c')](socket);function respondWithStatusCode(_0x268719,_0xfc6dcd){_0xfc6dcd=_0xfc6dcd||0xcc;return function(_0x25f7d0){if(_0x25f7d0){return _0x268719[_0xd1aa('0x1d')](_0xfc6dcd);}return _0x268719[_0xd1aa('0x1e')](_0xfc6dcd)['end']();};}function respondWithResult(_0xf5e815,_0x407d21){_0x407d21=_0x407d21||0xc8;return function(_0x3d46c3){if(_0x3d46c3){return _0xf5e815[_0xd1aa('0x1e')](_0x407d21)[_0xd1aa('0x1f')](_0x3d46c3);}};}function respondWithFilteredResult(_0x24190c,_0x351d2d){return function(_0xbea422){if(_0xbea422){var _0x53ebcc=_0xbea422[_0xd1aa('0x20')],_0x48a329=_0x351d2d['offset'],_0x3521f7=_0x351d2d['offset']+_0x351d2d[_0xd1aa('0x21')],_0x59fd37;if(_0x3521f7>=_0x53ebcc){_0x3521f7=_0x53ebcc;_0x59fd37=0xc8;}else{_0x59fd37=0xce;}_0x24190c[_0xd1aa('0x1e')](_0x59fd37);return _0x24190c['set'](_0xd1aa('0x22'),_0x48a329+'-'+_0x3521f7+'/'+_0x53ebcc)[_0xd1aa('0x1f')](_0xbea422);}return null;};}function patchUpdates(_0x3cd680){return function(_0x317509){try{jsonpatch[_0xd1aa('0x23')](_0x317509,_0x3cd680,!![]);}catch(_0x49f3a2){return BPromise[_0xd1aa('0x24')](_0x49f3a2);}return _0x317509['save']();};}function saveUpdates(_0x551f71,_0x159843){return function(_0xdac35d){if(_0xdac35d){return _0xdac35d[_0xd1aa('0x25')](_0x551f71)['then'](function(_0x646795){return _0x646795;});}return null;};}function removeEntity(_0x41fde3,_0x5644c0){return function(_0x256f0d){if(_0x256f0d){return _0x256f0d['destroy']()[_0xd1aa('0x26')](function(){_0x41fde3[_0xd1aa('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x447246,_0x17efcf){return function(_0x4752d1){if(!_0x4752d1){_0x447246['sendStatus'](0x194);}return _0x4752d1;};}function handleError(_0x8de30,_0x498ba5){_0x498ba5=_0x498ba5||0x1f4;return function(_0x16f599){logger['error'](_0x16f599[_0xd1aa('0x27')]);if(_0x16f599[_0xd1aa('0x28')]){delete _0x16f599[_0xd1aa('0x28')];}_0x8de30[_0xd1aa('0x1e')](_0x498ba5)['send'](_0x16f599);};}function getInteractionUsers(_0x3e7d7b,_0xa790b9){return new BPromise(function(_0x1acbcf,_0x35a31e){try{if(_0xa790b9[_0x3e7d7b['id']]){_0x3e7d7b[_0xd1aa('0x29')]=_[_0xd1aa('0x2a')](_0xa790b9[_0x3e7d7b['id']],function(_0xa35805){return{'id':_0xa35805['id']};});}}catch(_0x3ca569){_0x35a31e(_0x3ca569);}_0x1acbcf(_0x3e7d7b);});}function getInteractionTags(_0x4d8144,_0x545562){return new BPromise(function(_0x3e5429,_0x45428c){try{if(_0x4d8144['TagIds']){_0x4d8144[_0xd1aa('0x2b')]=[];_0x4d8144[_0xd1aa('0x2c')][_0xd1aa('0x2d')](',')[_0xd1aa('0x2e')](function(_0x4de12c){_0x4d8144['Tags'][_0xd1aa('0x2f')](_0x545562[_0x4de12c]);});}delete _0x4d8144[_0xd1aa('0x2c')];}catch(_0x4fec3b){_0x45428c(_0x4fec3b);}_0x3e5429(_0x4d8144);});}function updateFaxInteraction(_0xcbe43d,_0x328991,_0x1d4250){return new BPromise(function(_0x5134c0,_0xd331ae){return getInteractionUsers(_0xcbe43d,_0x1d4250)[_0xd1aa('0x26')](function(_0x3e5b26){return getInteractionTags(_0x3e5b26,_0x328991);})['then'](function(_0x5b5e1f){_0x5134c0(_0x5b5e1f);})[_0xd1aa('0x30')](function(_0x42e281){_0xd331ae(_0x42e281);});});}exports[_0xd1aa('0x31')]=function(_0x4bd24b,_0x189f11){var _0x1e8616={},_0x51ff83={},_0x427f8e={'count':0x0,'rows':[]};var _0x32bf5d=_['map'](db[_0xd1aa('0x32')]['rawAttributes'],function(_0x4e90c5){return{'name':_0x4e90c5[_0xd1aa('0x33')],'type':_0x4e90c5[_0xd1aa('0x34')]['key']};});_0x51ff83['model']=_[_0xd1aa('0x2a')](_0x32bf5d,'name');_0x51ff83[_0xd1aa('0x35')]=_[_0xd1aa('0x36')](_0x4bd24b['query']);_0x51ff83[_0xd1aa('0x37')]=_[_0xd1aa('0x38')](_0x51ff83[_0xd1aa('0x39')],_0x51ff83[_0xd1aa('0x35')]);_0x1e8616[_0xd1aa('0x3a')]=_['intersection'](_0x51ff83['model'],qs[_0xd1aa('0x3b')](_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x3b')]));_0x1e8616[_0xd1aa('0x3a')]=_0x1e8616[_0xd1aa('0x3a')][_0xd1aa('0x3c')]?_0x1e8616[_0xd1aa('0x3a')]:_0x51ff83[_0xd1aa('0x39')];if(!_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x3d')]('nolimit')){_0x1e8616[_0xd1aa('0x21')]=qs['limit'](_0x4bd24b[_0xd1aa('0x35')]['limit']);_0x1e8616[_0xd1aa('0x3e')]=qs[_0xd1aa('0x3e')](_0x4bd24b['query']['offset']);}_0x1e8616[_0xd1aa('0x3f')]=qs[_0xd1aa('0x40')](_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x40')]);_0x1e8616[_0xd1aa('0x41')]=qs[_0xd1aa('0x37')](_[_0xd1aa('0x42')](_0x4bd24b[_0xd1aa('0x35')],_0x51ff83['filters']));var _0x4b802b=[];var _0x42f3da=squel[_0xd1aa('0x43')]()[_0xd1aa('0x44')]('id')['field'](_0xd1aa('0x28'))['field'](_0xd1aa('0x45'))['from'](_0xd1aa('0x46'));var _0x55fdf6=squel[_0xd1aa('0x43')]()['field'](_0xd1aa('0x47'))['field']('ui.FaxInteractionId')[_0xd1aa('0x48')](_0xd1aa('0x49'),'ui')['left_join'](_0xd1aa('0x4a'),'u',_0xd1aa('0x4b'));var _0x48df92=squel['select']()['from'](_0xd1aa('0x4c'),'i')[_0xd1aa('0x4d')]('cm_contacts','c',_0xd1aa('0x4e'))[_0xd1aa('0x4d')](_0xd1aa('0x4a'),'o',_0xd1aa('0x4f'))[_0xd1aa('0x4d')](_0xd1aa('0x50'),'a','a.id\x20=\x20i.FaxAccountId')[_0xd1aa('0x4d')](_0xd1aa('0x51'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xd1aa('0x4d')]('fax_interaction_has_tags','it',_0xd1aa('0x52'))['left_join'](_0xd1aa('0x46'),'t',_0xd1aa('0x53'));var _0x418c7b=squel[_0xd1aa('0x54')]();var _0x2164f7=[];var _0x6a4fd8=squel[_0xd1aa('0x54')]();var _0x207324;if(_0x4bd24b[_0xd1aa('0x35')]['search']){_0x207324=as[_0xd1aa('0x55')](_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x56')]);var _0x3a6469=_0x207324[_0xd1aa('0x57')];for(var _0x37e5e6=0x0;_0x37e5e6<_0x207324[_0xd1aa('0x58')]['length'];_0x37e5e6++){var _0x2e790e=_0x207324[_0xd1aa('0x58')][_0x37e5e6];var _0x23b247='i';var _0x4df20c=_[_0xd1aa('0x59')](_0x32bf5d,[_0xd1aa('0x28'),_0x2e790e['field']]);if(!_0x4df20c){switch(_0x2e790e['field']){case _0xd1aa('0x5a'):if(_0x2e790e[_0xd1aa('0x5b')]==0x1){_0x48df92[_0xd1aa('0x5c')]('`'+_0x2e790e[_0xd1aa('0x44')]+_0xd1aa('0x5d'));}else{_0x48df92[_0xd1aa('0x5c')]('`'+_0x2e790e[_0xd1aa('0x44')]+_0xd1aa('0x5e'));}break;case _0xd1aa('0x5f'):if(_0x2e790e[_0xd1aa('0x60')]===_0xd1aa('0x61')){if(_0x2e790e[_0xd1aa('0x5b')]['split']('\x20')[_0xd1aa('0x3c')]>0x1){_0x418c7b[_0x3a6469]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd1aa('0x62')](_0x2e790e[_0xd1aa('0x5b')]),null);}else{var _0x49129a='%'+_0x2e790e[_0xd1aa('0x5b')]+'%';_0x418c7b[_0x3a6469](_0xd1aa('0x63'),_0x49129a,_0x49129a,_0x49129a);}}else{_0x4df20c=_[_0xd1aa('0x59')](_0x32bf5d,['name','ContactId']);_0x2e790e[_0xd1aa('0x44')]='ContactId';_0x4d9d0f=as[_0xd1aa('0x64')](_0x23b247,_0x4df20c['type'],_0x2e790e);_0x418c7b[_0x3a6469](_0x4d9d0f[_0xd1aa('0x65')],_0x4d9d0f[_0xd1aa('0x5b')][_0xd1aa('0x66')],_0x4d9d0f['value'][_0xd1aa('0x67')]);}break;case _0xd1aa('0x68'):var _0x48f647=_0x2e790e[_0xd1aa('0x5b')][_0xd1aa('0x2d')](',')[_0xd1aa('0x2a')](function(_0x5ace24){return Number(_0x5ace24);});_0x48f647[_0xd1aa('0x2e')](function(_0x158ba8){_0x6a4fd8['or'](_0xd1aa('0x69'),'%,'+_0x158ba8+',%');});_0x2164f7=_[_0xd1aa('0x6a')](_0x2164f7,_0x48f647);break;case'User':if(_0x2e790e[_0xd1aa('0x60')]===_0xd1aa('0x61')){_0x418c7b[_0x3a6469](_0xd1aa('0x6b'),'%'+_0x2e790e[_0xd1aa('0x5b')]+'%',null);}else{_0x4df20c=_[_0xd1aa('0x59')](_0x32bf5d,[_0xd1aa('0x28'),'UserId']);_0x2e790e[_0xd1aa('0x44')]='UserId';_0x4d9d0f=as[_0xd1aa('0x64')](_0x23b247,_0x4df20c[_0xd1aa('0x34')],_0x2e790e);_0x418c7b[_0x3a6469](_0x4d9d0f[_0xd1aa('0x65')],_0x4d9d0f['value']['start'],_0x4d9d0f[_0xd1aa('0x5b')][_0xd1aa('0x67')]);}break;case _0xd1aa('0x6c'):_0x4d9d0f=as['buildExpression']('me',null,_0x2e790e);_0x418c7b[_0x3a6469](_0x4d9d0f[_0xd1aa('0x65')],_0x4d9d0f[_0xd1aa('0x5b')]['start'],_0x4d9d0f['value'][_0xd1aa('0x67')]);break;}}else{var _0x4d9d0f=as['buildExpression'](_0x23b247,_0x4df20c[_0xd1aa('0x34')],_0x2e790e);_0x418c7b[_0x3a6469](_0x4d9d0f['text'],_0x4d9d0f['value']['start'],_0x4d9d0f[_0xd1aa('0x5b')]['end']);}}}else{var _0x497439=_(_0x4bd24b['query'])[_0xd1aa('0x36')]()['map'](function(_0x5965dc){return _['some'](_0x32bf5d,[_0xd1aa('0x28'),_0x5965dc])?_0x5965dc:undefined;})['compact']()[_0xd1aa('0x5b')]();if(!_['isEmpty'](_0x497439)){_0x497439[_0xd1aa('0x2e')](function(_0x5da95f){if(_0x5da95f===_0xd1aa('0x6d')){_0x48df92['where'](_0xd1aa('0x6e'),[][_0xd1aa('0x6f')](_0x4bd24b[_0xd1aa('0x35')][_0x5da95f]));}else if(_0x5da95f===_0xd1aa('0x70')){var _0xaf8912=JSON[_0xd1aa('0x71')](_0x4bd24b[_0xd1aa('0x35')][_0x5da95f])[_0xd1aa('0x72')];var _0x5a168a=JSON[_0xd1aa('0x71')](_0x4bd24b[_0xd1aa('0x35')][_0x5da95f])[_0xd1aa('0x73')];_0x48df92[_0xd1aa('0x41')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xaf8912,_0x5a168a);}else{if(_0x4bd24b['query'][_0x5da95f]===_0xd1aa('0x74')){_0x48df92[_0xd1aa('0x41')]('i.'+_0x5da95f+'\x20IS\x20NULL');}else{_0x48df92['where']('i.'+_0x5da95f+'\x20=\x20?',_0x4bd24b[_0xd1aa('0x35')][_0x5da95f]);}}});}if(_0x4bd24b[_0xd1aa('0x35')]['read']){if(_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x75')]==0x1){_0x48df92[_0xd1aa('0x5c')](_0xd1aa('0x76'));}else{_0x48df92[_0xd1aa('0x5c')]('`unreadMessages`\x20>\x200');}}if(_0x4bd24b['query'][_0xd1aa('0x77')]){_0x2164f7=_[_0xd1aa('0x78')](_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x77')])?_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x77')]:new Array(_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x77')]);_0x2164f7[_0xd1aa('0x2e')](function(_0x1d16a2){_0x6a4fd8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1d16a2+',%');});}if(_0x4bd24b[_0xd1aa('0x35')][_0xd1aa('0x79')]){var _0x40e51b=_0x4bd24b['query'][_0xd1aa('0x79')][_0xd1aa('0x7a')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xd1aa('0x7b'));if(qs[_0xd1aa('0x7c')](_0x40e51b)){_0x418c7b['or'](_0xd1aa('0x7d'),_0x40e51b+'%')['or']('i.fax\x20LIKE\x20?',_0x40e51b+'%');}_0x418c7b['or'](_0xd1aa('0x7e'),_0x40e51b+'%');}}_0x48df92['where'](_0x418c7b);_0x48df92[_0xd1aa('0x7f')](_0xd1aa('0x80'));var _0x1036e7={'type':db['Sequelize'][_0xd1aa('0x81')][_0xd1aa('0x82')],'raw':!![]};var _0x28e6c3=_0x48df92['clone']();_0x28e6c3['field']('i.id');_0x28e6c3['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd1aa('0x5a'));if(_0x1e8616[_0xd1aa('0x3f')]){_0x1e8616[_0xd1aa('0x3f')]['forEach'](function(_0x3873f4){_0x48df92['order']('i.'+_0x3873f4[0x0],_0x3873f4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xd1aa('0x83')](_0x2164f7)){_0x48df92[_0xd1aa('0x5c')](_0x6a4fd8);_0x28e6c3[_0xd1aa('0x41')](_0xd1aa('0x84'),_0x2164f7);}BPromise['resolve']()[_0xd1aa('0x26')](function(){if(!_0x207324)return;return _0x4bd24b['user'][_0xd1aa('0x85')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d0c4f){_0x28e6c3[_0xd1aa('0x41')](_0xd1aa('0x6e'),_['map'](_0x1d0c4f,'id'));_0x48df92['where']('i.FaxAccountId\x20IN\x20?',_[_0xd1aa('0x2a')](_0x1d0c4f,'id'));});})['then'](function(){db[_0xd1aa('0x86')][_0xd1aa('0x35')](_0x28e6c3[_0xd1aa('0x87')](),_0x1036e7)[_0xd1aa('0x26')](function(_0x18019c){_0x427f8e[_0xd1aa('0x20')]=_0x18019c['length'];if(_0x427f8e[_0xd1aa('0x20')]===0x0)return[];return db['sequelize']['query'](_0x42f3da[_0xd1aa('0x87')](),_0x1036e7)[_0xd1aa('0x26')](function(_0x3aaca8){_0x4b802b=_[_0xd1aa('0x88')](_0x3aaca8,'id');_0x1036e7=_[_0xd1aa('0x89')](_0x1036e7,{'model':db[_0xd1aa('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x48df92[_0xd1aa('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd1aa('0x5a'));_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x8a'),'Account.key');_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x8b'),_0xd1aa('0x8c'));_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x8d'));_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x8e'),_0xd1aa('0x8f'));_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x90'),_0xd1aa('0x91'));_0x48df92['field']('c.email',_0xd1aa('0x92'));_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x93'),_0xd1aa('0x94'));_0x48df92[_0xd1aa('0x44')](_0xd1aa('0x95'),_0xd1aa('0x96'));_0x48df92[_0xd1aa('0x44')]('c.fax',_0xd1aa('0x97'));_0x48df92[_0xd1aa('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd1aa('0x2c'));_0x48df92[_0xd1aa('0x21')](_0x1e8616['limit']);_0x48df92['offset'](_0x1e8616[_0xd1aa('0x3e')]);return db[_0xd1aa('0x86')][_0xd1aa('0x35')](_0x48df92[_0xd1aa('0x87')](),_0x1036e7);})[_0xd1aa('0x26')](function(_0x3360c4){_0x55fdf6[_0xd1aa('0x41')](_0xd1aa('0x98'),_[_0xd1aa('0x2a')](_0x3360c4,'id'));return db['sequelize'][_0xd1aa('0x35')](_0x55fdf6[_0xd1aa('0x87')](),_0x1036e7)['then'](function(_0x3fbec0){var _0xf40bdb=_[_0xd1aa('0x99')](_0x3fbec0,_0xd1aa('0x9a'));var _0x443031=[];_0x3360c4[_0xd1aa('0x2e')](function(_0x50c706){_0x443031['push'](updateFaxInteraction(_0x50c706,_0x4b802b,_0xf40bdb));});return BPromise[_0xd1aa('0x9b')](_0x443031);});});})['then'](function(_0x4a51a2){_0x427f8e[_0xd1aa('0x9c')]=_0x4a51a2;return _0x427f8e;})['then'](respondWithFilteredResult(_0x189f11,_0x1e8616));})[_0xd1aa('0x30')](handleError(_0x189f11,null));};exports[_0xd1aa('0x9d')]=function(_0x21bca5,_0x2145eb){var _0xe5781e={'raw':![],'where':{'id':_0x21bca5['params']['id']}},_0x2d050a={};_0x2d050a['model']=_[_0xd1aa('0x36')](db['FaxInteraction'][_0xd1aa('0x9e')]);_0x2d050a[_0xd1aa('0x35')]=_['keys'](_0x21bca5[_0xd1aa('0x35')]);_0x2d050a[_0xd1aa('0x37')]=_['intersection'](_0x2d050a[_0xd1aa('0x39')],_0x2d050a[_0xd1aa('0x35')]);_0xe5781e[_0xd1aa('0x3a')]=_[_0xd1aa('0x38')](_0x2d050a[_0xd1aa('0x39')],qs[_0xd1aa('0x3b')](_0x21bca5['query'][_0xd1aa('0x3b')]));_0xe5781e[_0xd1aa('0x3a')]=_0xe5781e[_0xd1aa('0x3a')]['length']?_0xe5781e[_0xd1aa('0x3a')]:_0x2d050a[_0xd1aa('0x39')];if(_0x21bca5[_0xd1aa('0x35')]['includeAll']){_0xe5781e[_0xd1aa('0x9f')]=[{'all':!![]}];}_0xe5781e=_[_0xd1aa('0x89')]({},_0xe5781e,_0x21bca5[_0xd1aa('0xa0')]);return db['FaxInteraction'][_0xd1aa('0x59')](_0xe5781e)[_0xd1aa('0x26')](handleEntityNotFound(_0x2145eb,null))[_0xd1aa('0x26')](respondWithResult(_0x2145eb,null))[_0xd1aa('0x30')](handleError(_0x2145eb,null));};exports[_0xd1aa('0xa1')]=function(_0x2cc3ee,_0x167418){return db['FaxInteraction'][_0xd1aa('0xa1')](_0x2cc3ee[_0xd1aa('0x6c')],{})[_0xd1aa('0x26')](respondWithResult(_0x167418,0xc9))['catch'](handleError(_0x167418,null));};exports[_0xd1aa('0x25')]=function(_0x38bc2c,_0x1f36b5){if(_0x38bc2c['body']['id']){delete _0x38bc2c[_0xd1aa('0x6c')]['id'];}return db[_0xd1aa('0x32')][_0xd1aa('0x59')]({'where':{'id':_0x38bc2c[_0xd1aa('0xa2')]['id']}})[_0xd1aa('0x26')](handleEntityNotFound(_0x1f36b5,null))[_0xd1aa('0x26')](saveUpdates(_0x38bc2c[_0xd1aa('0x6c')],null))[_0xd1aa('0x26')](respondWithResult(_0x1f36b5,null))['catch'](handleError(_0x1f36b5,null));};exports[_0xd1aa('0xa3')]=function(_0x5da32b,_0x14e74f){return db[_0xd1aa('0x32')][_0xd1aa('0x59')]({'where':{'id':_0x5da32b[_0xd1aa('0xa2')]['id']}})[_0xd1aa('0x26')](handleEntityNotFound(_0x14e74f,null))['then'](removeEntity(_0x14e74f,null))[_0xd1aa('0x30')](handleError(_0x14e74f,null));};exports[_0xd1aa('0xa4')]=function(_0x392e0b,_0x53abcd){return db['FaxInteraction'][_0xd1aa('0xa4')]()[_0xd1aa('0x26')](respondWithResult(_0x53abcd,null))['catch'](handleError(_0x53abcd,null));};exports[_0xd1aa('0xa5')]=function(_0x5405d4,_0x322414,_0x3f5455){return db[_0xd1aa('0xa6')][_0xd1aa('0x59')]({'where':{'id':_0x5405d4[_0xd1aa('0xa2')]['id']}})[_0xd1aa('0x26')](handleEntityNotFound(_0x322414,null))[_0xd1aa('0x26')](function(_0x4d03a9){if(_0x4d03a9){return _0x4d03a9[_0xd1aa('0xa5')](_0x5405d4[_0xd1aa('0x6c')][_0xd1aa('0xa7')],_[_0xd1aa('0xa8')](_0x5405d4[_0xd1aa('0x6c')],[_0xd1aa('0xa7'),'id'])||{});}})[_0xd1aa('0x26')](respondWithResult(_0x322414,null))[_0xd1aa('0x30')](handleError(_0x322414,null));};exports[_0xd1aa('0xa9')]=function(_0x32c9bd,_0x25fbee,_0x84225d){var _0x2b566e={'raw':![],'where':{}};var _0x320b32={};var _0x44caaa={'count':0x0,'rows':[]};return db[_0xd1aa('0x32')]['findOne']({'where':{'id':_0x32c9bd[_0xd1aa('0xa2')]['id']}})[_0xd1aa('0x26')](handleEntityNotFound(_0x25fbee,null))[_0xd1aa('0x26')](function(_0x27f906){if(_0x27f906){_0x320b32[_0xd1aa('0x39')]=_['keys'](db['FaxMessage'][_0xd1aa('0x9e')]);_0x320b32['query']=_[_0xd1aa('0x36')](_0x32c9bd[_0xd1aa('0x35')]);_0x320b32[_0xd1aa('0x37')]=_[_0xd1aa('0x38')](_0x320b32[_0xd1aa('0x39')],_0x320b32[_0xd1aa('0x35')]);_0x2b566e['attributes']=_[_0xd1aa('0x38')](_0x320b32[_0xd1aa('0x39')],qs['fields'](_0x32c9bd[_0xd1aa('0x35')]['fields']));_0x2b566e[_0xd1aa('0x3a')]=_0x2b566e[_0xd1aa('0x3a')]['length']?_0x2b566e[_0xd1aa('0x3a')]:_0x320b32[_0xd1aa('0x39')];if(!_0x32c9bd[_0xd1aa('0x35')]['hasOwnProperty'](_0xd1aa('0xaa'))){_0x2b566e[_0xd1aa('0x21')]=qs[_0xd1aa('0x21')](_0x32c9bd[_0xd1aa('0x35')][_0xd1aa('0x21')]);_0x2b566e['offset']=qs[_0xd1aa('0x3e')](_0x32c9bd[_0xd1aa('0x35')]['offset']);}_0x2b566e[_0xd1aa('0x3f')]=qs[_0xd1aa('0x40')](_0x32c9bd[_0xd1aa('0x35')][_0xd1aa('0x40')]);_0x2b566e[_0xd1aa('0x41')]=qs['filters'](_[_0xd1aa('0x42')](_0x32c9bd[_0xd1aa('0x35')],_0x320b32[_0xd1aa('0x37')]));_0x2b566e[_0xd1aa('0x41')]['FaxInteractionId']=_0x27f906['id'];if(_0x32c9bd[_0xd1aa('0x35')][_0xd1aa('0x79')]){_0x2b566e[_0xd1aa('0x41')]=_[_0xd1aa('0x89')](_0x2b566e['where'],{'$or':_[_0xd1aa('0x2a')](_0x2b566e[_0xd1aa('0x3a')],function(_0x73ed7d){var _0x509d91={};_0x509d91[_0x73ed7d]={'$like':'%'+_0x32c9bd[_0xd1aa('0x35')][_0xd1aa('0x79')]+'%'};return _0x509d91;})});}if(_0x32c9bd[_0xd1aa('0x35')][_0xd1aa('0x72')]){var _0x505118=_0x32c9bd['query'][_0xd1aa('0x72')][_0xd1aa('0x2d')](',');var _0x572be0={};_0x572be0[_0x505118[0x0]]={'$gte':moment(_0x505118[0x1])[_0xd1aa('0xab')](_0xd1aa('0xac'))};_0x2b566e[_0xd1aa('0x41')]=_[_0xd1aa('0x89')](_0x2b566e[_0xd1aa('0x41')],_0x572be0);}_0x2b566e=_[_0xd1aa('0x89')]({},_0x2b566e,_0x32c9bd['options']);return db[_0xd1aa('0xa6')]['count']({'where':_0x2b566e[_0xd1aa('0x41')]})[_0xd1aa('0x26')](function(_0x2a0793){_0x44caaa[_0xd1aa('0x20')]=_0x2a0793;if(_0x32c9bd[_0xd1aa('0x35')][_0xd1aa('0xad')]){_0x2b566e[_0xd1aa('0x9f')]=[{'all':!![]}];}return db['FaxMessage'][_0xd1aa('0xae')](_0x2b566e);})[_0xd1aa('0x26')](function(_0x43808a){_0x44caaa[_0xd1aa('0x9c')]=_0x43808a;return _0x44caaa;});}})[_0xd1aa('0x26')](respondWithFilteredResult(_0x25fbee,_0x2b566e))[_0xd1aa('0x30')](handleError(_0x25fbee,null));};exports[_0xd1aa('0xaf')]=function(_0x3051b1,_0x58b978,_0x3a5222){return db['FaxInteraction']['find']({'where':{'id':_0x3051b1[_0xd1aa('0xa2')]['id']}})['then'](handleEntityNotFound(_0x58b978,null))['then'](function(_0x354ba9){if(_0x354ba9){return _0x354ba9[_0xd1aa('0xb0')](_0x3051b1[_0xd1aa('0x6c')]['ids'],_[_0xd1aa('0xa8')](_0x3051b1[_0xd1aa('0x6c')],[_0xd1aa('0xa7'),'id'])||{})[_0xd1aa('0xb1')](function(){return db['Tag']['findAll']({'attributes':['id',_0xd1aa('0x28'),'color'],'where':{'id':_0x3051b1['body'][_0xd1aa('0xa7')]}});})[_0xd1aa('0x26')](function(_0x442fc9){socket[_0xd1aa('0xb2')](_0xd1aa('0xb3'),{'id':Number(_0x3051b1[_0xd1aa('0xa2')]['id']),'tags':_0x442fc9||[]});return{'id':Number(_0x3051b1[_0xd1aa('0xa2')]['id']),'tags':_0x442fc9||[]};});}})['then'](respondWithResult(_0x58b978,null))[_0xd1aa('0x30')](handleError(_0x58b978,null));};exports[_0xd1aa('0xb4')]=function(_0x53d577,_0xf2a26b,_0x426304){return db[_0xd1aa('0x32')][_0xd1aa('0x59')]({'where':{'id':_0x53d577[_0xd1aa('0xa2')]['id']}})[_0xd1aa('0x26')](handleEntityNotFound(_0xf2a26b,null))[_0xd1aa('0x26')](function(_0x2a3d80){if(_0x2a3d80){return _0x2a3d80[_0xd1aa('0xb4')](_0x53d577[_0xd1aa('0x35')]['ids']);}})[_0xd1aa('0x26')](respondWithStatusCode(_0xf2a26b,null))[_0xd1aa('0x30')](handleError(_0xf2a26b,null));};exports[_0xd1aa('0xb5')]=function(_0x3bb73e,_0x5ac83a){var _0x3954d3=moment()[_0xd1aa('0xb6')]()['toString']();var _0xcf6410=path[_0xd1aa('0xb7')](config[_0xd1aa('0xb8')],_0xd1aa('0xb9'),_0xd1aa('0xba'),_0xd1aa('0xbb'));var _0x417b11=path['join'](config['root'],_0xd1aa('0xb9'),'files',_0xd1aa('0xbc'));var _0x5c589d=path[_0xd1aa('0xb7')](_0x417b11,_0x3954d3);var _0x40278a=util[_0xd1aa('0xab')](_0xd1aa('0xbd'),_0x3954d3);var _0x15d8f1=path[_0xd1aa('0xb7')](_0x417b11,_0x40278a);var _0x5177b2=![];return db[_0xd1aa('0x32')][_0xd1aa('0x59')]({'where':{'id':_0x3bb73e['params']['id']}})['then'](handleEntityNotFound(_0x5ac83a,null))[_0xd1aa('0x26')](function(_0x51cc20){if(_0x51cc20){return _0x51cc20[_0xd1aa('0xa9')]({'attributes':['id','body',_0xd1aa('0x70')],'include':[{'model':db['Attachment'],'as':'Attachment'}]});}return[];})[_0xd1aa('0x26')](function(_0xe6747b){_0x5177b2=_0xe6747b['length'];if(_0xe6747b[_0xd1aa('0x3c')]){fs[_0xd1aa('0xbe')](_0x5c589d);for(var _0x152ca1=0x0;_0x152ca1<_0xe6747b[_0xd1aa('0x3c')];_0x152ca1++){var _0x39ee28=_0xe6747b[_0x152ca1];var _0x1edc08=_0x39ee28['Attachment'];if(_0x1edc08){var _0x3087bd=path[_0xd1aa('0xb7')](_0xcf6410,_0x1edc08[_0xd1aa('0xbf')]);if(fs[_0xd1aa('0xc0')](_0x3087bd)){fs['createReadStream'](_0x3087bd)['pipe'](fs['createWriteStream'](path['join'](_0x5c589d,_0x1edc08[_0xd1aa('0xbf')])));}}}}})['then'](function(){if(_0x5177b2){return new BPromise(function(_0x5a8041,_0x486d28){zipdir(_0x5c589d,{'saveTo':_0x15d8f1},function(_0x52ebdf,_0x47dd78){if(_0x52ebdf)return _0x486d28(_0x52ebdf);return _0x5a8041(_0x47dd78);});});}})[_0xd1aa('0x26')](function(){if(_0x5177b2){return new BPromise(function(_0x5b0a4c,_0x2475bd){rimraf(_0x5c589d,function(_0x2496e9){if(_0x2496e9)_0x2475bd(_0x2496e9);return _0x5b0a4c();});});}})[_0xd1aa('0x26')](function(){if(_0x5177b2){return _0x5ac83a[_0xd1aa('0xb5')](_0x15d8f1,_0x40278a,function(_0x490766){if(_0x490766){console['log'](_0xd1aa('0xc1'),_0x490766);}else{fs[_0xd1aa('0xc2')](_0x15d8f1);}});}else{return _0x5ac83a[_0xd1aa('0x1d')](0xc8);}})[_0xd1aa('0x30')](handleError(_0x5ac83a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 49738ad..e9bfdae 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 _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x3ca9b8,_0x469fee){var _0x1fffb8=function(_0x474edd){while(--_0x474edd){_0x3ca9b8['push'](_0x3ca9b8['shift']());}};_0x1fffb8(++_0x469fee);}(_0xadb5,0xad));var _0x5adb=function(_0xf0ca7,_0x5b6383){_0xf0ca7=_0xf0ca7-0x0;var _0x20b961=_0xadb5[_0xf0ca7];return _0x20b961;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x1ca4c6,_0x29a9f5){var _0x236b63=function(_0x102642){while(--_0x102642){_0x1ca4c6['push'](_0x1ca4c6['shift']());}};_0x236b63(++_0x29a9f5);}(_0xadb5,0xad));var _0x5adb=function(_0x55e7f3,_0x4b2dab){_0x55e7f3=_0x55e7f3-0x0;var _0x473250=_0xadb5[_0x55e7f3];return _0x473250;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 4134dd5..5edbac9 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 _0x48ff=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x2ea0e6,_0x3fd0d4){var _0x1c6266=function(_0x58c5a9){while(--_0x58c5a9){_0x2ea0e6['push'](_0x2ea0e6['shift']());}};_0x1c6266(++_0x3fd0d4);}(_0x48ff,0xa9));var _0xf48f=function(_0x286438,_0x3e3ae6){_0x286438=_0x286438-0x0;var _0x15a5d8=_0x48ff[_0x286438];return _0x15a5d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf48f('0x0'))(_0xf48f('0x1'));var moment=require(_0xf48f('0x2'));var BPromise=require(_0xf48f('0x3'));var rp=require(_0xf48f('0x4'));var fs=require('fs');var path=require(_0xf48f('0x5'));var rimraf=require(_0xf48f('0x6'));var config=require(_0xf48f('0x7'));var attributes=require(_0xf48f('0x8'));module[_0xf48f('0x9')]=function(_0x59c355,_0x441263){return _0x59c355[_0xf48f('0xa')](_0xf48f('0xb'),attributes,{'tableName':_0xf48f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fba6e,_0x3a8828,_0x49219d){if(_0x3fba6e[_0xf48f('0xd')](_0xf48f('0xe'))){_0x3fba6e[_0xf48f('0xf')]=moment()[_0xf48f('0x10')](_0xf48f('0x11'));}_0x49219d(null,_0x3fba6e);}}});}; \ No newline at end of file +var _0x8a13=['exports','FaxInteraction','fax_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x2b0bed,_0x29272e){var _0x34abc7=function(_0x47b234){while(--_0x47b234){_0x2b0bed['push'](_0x2b0bed['shift']());}};_0x34abc7(++_0x29272e);}(_0x8a13,0xd7));var _0x38a1=function(_0x302ebe,_0x4f4943){_0x302ebe=_0x302ebe-0x0;var _0x3c7926=_0x8a13[_0x302ebe];return _0x3c7926;};'use strict';var _=require(_0x38a1('0x0'));var util=require(_0x38a1('0x1'));var logger=require(_0x38a1('0x2'))(_0x38a1('0x3'));var moment=require(_0x38a1('0x4'));var BPromise=require(_0x38a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x38a1('0x6'));var config=require(_0x38a1('0x7'));var attributes=require(_0x38a1('0x8'));module[_0x38a1('0x9')]=function(_0x57e3d7,_0x2613c6){return _0x57e3d7['define'](_0x38a1('0xa'),attributes,{'tableName':_0x38a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13cb44,_0x28ef4a,_0x2cdbeb){if(_0x13cb44['changed'](_0x38a1('0xc'))){_0x13cb44['closedAt']=moment()['format'](_0x38a1('0xd'));}_0x2cdbeb(null,_0x13cb44);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index acc68df..404adf3 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 _0xe682=['FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','debug','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0xe682,0xc1));var _0x2e68=function(_0x1dd0b6,_0x5c4f29){_0x1dd0b6=_0x1dd0b6-0x0;var _0x294238=_0xe682[_0x1dd0b6];return _0x294238;};'use strict';var _=require(_0x2e68('0x0'));var util=require(_0x2e68('0x1'));var moment=require(_0x2e68('0x2'));var BPromise=require(_0x2e68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e68('0x4'))['db'];var utils=require(_0x2e68('0x5'));var logger=require(_0x2e68('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2e68('0x7'));var client=jayson[_0x2e68('0x8')][_0x2e68('0x9')]({'port':0x232a});config[_0x2e68('0xa')]=_[_0x2e68('0xb')](config[_0x2e68('0xa')],{'host':_0x2e68('0xc'),'port':0x18eb});var socket=require(_0x2e68('0xd'))(new Redis(config[_0x2e68('0xa')]));require(_0x2e68('0xe'))[_0x2e68('0xf')](socket);function respondWithRpcPromise(_0x4d0a1c,_0x20b6c2,_0x3bb965){return new BPromise(function(_0x2f7c67,_0x124a51){return client[_0x2e68('0x10')](_0x4d0a1c,_0x3bb965)[_0x2e68('0x11')](function(_0x4b6448){logger['info'](_0x2e68('0x12'),_0x20b6c2,_0x2e68('0x13'));logger['debug'](_0x2e68('0x14'),_0x20b6c2,_0x2e68('0x13'),JSON[_0x2e68('0x15')](_0x4b6448));if(_0x4b6448['error']){if(_0x4b6448[_0x2e68('0x16')]['code']===0x1f4){logger[_0x2e68('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x20b6c2,_0x4b6448['error'][_0x2e68('0x17')]);return _0x124a51(_0x4b6448['error'][_0x2e68('0x17')]);}logger[_0x2e68('0x16')](_0x2e68('0x12'),_0x20b6c2,_0x4b6448[_0x2e68('0x16')][_0x2e68('0x17')]);return _0x2f7c67(_0x4b6448[_0x2e68('0x16')]['message']);}else{logger[_0x2e68('0x18')](_0x2e68('0x12'),_0x20b6c2,_0x2e68('0x13'));_0x2f7c67(_0x4b6448[_0x2e68('0x19')][_0x2e68('0x17')]);}})[_0x2e68('0x1a')](function(_0x5d0d81){logger[_0x2e68('0x16')](_0x2e68('0x12'),_0x20b6c2,_0x5d0d81);_0x124a51(_0x5d0d81);});});}exports['UpdateFaxInteraction']=function(_0x347967){var _0x12c8bb=this;return new Promise(function(_0x4d8aed,_0x86ecd8){return db[_0x2e68('0x1b')][_0x2e68('0x1c')](_0x347967[_0x2e68('0x1d')],{'raw':_0x347967[_0x2e68('0x1e')]?_0x347967[_0x2e68('0x1e')][_0x2e68('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x347967[_0x2e68('0x1e')]?_0x347967[_0x2e68('0x1e')][_0x2e68('0x20')]||null:null,'attributes':_0x347967[_0x2e68('0x1e')]?_0x347967[_0x2e68('0x1e')][_0x2e68('0x21')]||null:null,'limit':_0x347967['options']?_0x347967[_0x2e68('0x1e')][_0x2e68('0x22')]||null:null})[_0x2e68('0x11')](function(_0x5ad0cb){logger['info'](_0x2e68('0x23'),_0x347967);logger[_0x2e68('0x24')](_0x2e68('0x23'),_0x347967,JSON['stringify'](_0x5ad0cb));_0x4d8aed(_0x5ad0cb);})[_0x2e68('0x1a')](function(_0x5f1f4c){logger[_0x2e68('0x16')](_0x2e68('0x23'),_0x5f1f4c[_0x2e68('0x17')],_0x347967);_0x86ecd8(_0x12c8bb[_0x2e68('0x16')](0x1f4,_0x5f1f4c[_0x2e68('0x17')]));});});};exports[_0x2e68('0x25')]=function(_0xa1c5a8){return new Promise(function(_0x70a750,_0x59a8d0){return db[_0x2e68('0x1b')][_0x2e68('0x26')]({'where':_0xa1c5a8[_0x2e68('0x1e')]?_0xa1c5a8[_0x2e68('0x1e')][_0x2e68('0x20')]||null:null})[_0x2e68('0x11')](function(_0xa4bc94){if(_0xa4bc94){return _0xa4bc94[_0x2e68('0x27')](_0xa1c5a8[_0x2e68('0x1d')][_0x2e68('0x28')],_[_0x2e68('0x29')](_0xa1c5a8[_0x2e68('0x1d')],[_0x2e68('0x28'),'id'])||{});}})[_0x2e68('0x2a')](function(_0xbebffe){logger[_0x2e68('0x18')](_0x2e68('0x2b'),_0xa1c5a8);logger['debug']('AddTags',_0xa1c5a8,JSON['stringify'](_0xbebffe));_0x70a750(_0xbebffe);})['catch'](function(_0x325364){logger[_0x2e68('0x16')](_0x2e68('0x2b'),_0x325364['message'],_0xa1c5a8);_0x59a8d0(_this[_0x2e68('0x16')](0x1f4,_0x325364[_0x2e68('0x17')]));});});}; \ No newline at end of file +var _0x8be1=['redis','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxInteraction','update','body','options','limit','UpdateFaxInteraction','find','where','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x1151ba,_0x479620){var _0x1596df=function(_0x572459){while(--_0x572459){_0x1151ba['push'](_0x1151ba['shift']());}};_0x1596df(++_0x479620);}(_0x8be1,0x1d3));var _0x18be=function(_0x4700e8,_0x1f296a){_0x4700e8=_0x4700e8-0x0;var _0x378a3e=_0x8be1[_0x4700e8];return _0x378a3e;};'use strict';var _=require(_0x18be('0x0'));var util=require(_0x18be('0x1'));var moment=require(_0x18be('0x2'));var BPromise=require(_0x18be('0x3'));var rs=require(_0x18be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18be('0x5'))['db'];var utils=require(_0x18be('0x6'));var logger=require(_0x18be('0x7'))('rpc');var config=require(_0x18be('0x8'));var jayson=require(_0x18be('0x9'));var client=jayson[_0x18be('0xa')][_0x18be('0xb')]({'port':0x232a});config['redis']=_[_0x18be('0xc')](config[_0x18be('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x18be('0xe'))(new Redis(config[_0x18be('0xd')]));require('./faxInteraction.socket')[_0x18be('0xf')](socket);function respondWithRpcPromise(_0x4fb82b,_0x56b061,_0x933c6b){return new BPromise(function(_0x3e2950,_0x4b7a74){return client[_0x18be('0x10')](_0x4fb82b,_0x933c6b)[_0x18be('0x11')](function(_0x5fda0b){logger[_0x18be('0x12')](_0x18be('0x13'),_0x56b061,_0x18be('0x14'));logger[_0x18be('0x15')](_0x18be('0x16'),_0x56b061,_0x18be('0x14'),JSON[_0x18be('0x17')](_0x5fda0b));if(_0x5fda0b[_0x18be('0x18')]){if(_0x5fda0b[_0x18be('0x18')][_0x18be('0x19')]===0x1f4){logger[_0x18be('0x18')](_0x18be('0x13'),_0x56b061,_0x5fda0b[_0x18be('0x18')][_0x18be('0x1a')]);return _0x4b7a74(_0x5fda0b[_0x18be('0x18')]['message']);}logger['error'](_0x18be('0x13'),_0x56b061,_0x5fda0b[_0x18be('0x18')][_0x18be('0x1a')]);return _0x3e2950(_0x5fda0b['error']['message']);}else{logger['info'](_0x18be('0x13'),_0x56b061,_0x18be('0x14'));_0x3e2950(_0x5fda0b[_0x18be('0x1b')]['message']);}})[_0x18be('0x1c')](function(_0x47bc44){logger[_0x18be('0x18')](_0x18be('0x13'),_0x56b061,_0x47bc44);_0x4b7a74(_0x47bc44);});});}exports['UpdateFaxInteraction']=function(_0x43aa25){var _0x4f38e9=this;return new Promise(function(_0x4a9bed,_0x3d20b6){return db[_0x18be('0x1d')][_0x18be('0x1e')](_0x43aa25[_0x18be('0x1f')],{'raw':_0x43aa25[_0x18be('0x20')]?_0x43aa25['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43aa25[_0x18be('0x20')]?_0x43aa25[_0x18be('0x20')]['where']||null:null,'attributes':_0x43aa25[_0x18be('0x20')]?_0x43aa25[_0x18be('0x20')]['attributes']||null:null,'limit':_0x43aa25[_0x18be('0x20')]?_0x43aa25[_0x18be('0x20')][_0x18be('0x21')]||null:null})['then'](function(_0x5e6648){logger[_0x18be('0x12')](_0x18be('0x22'),_0x43aa25);logger[_0x18be('0x15')](_0x18be('0x22'),_0x43aa25,JSON[_0x18be('0x17')](_0x5e6648));_0x4a9bed(_0x5e6648);})['catch'](function(_0x595561){logger[_0x18be('0x18')]('UpdateFaxInteraction',_0x595561['message'],_0x43aa25);_0x3d20b6(_0x4f38e9['error'](0x1f4,_0x595561[_0x18be('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2623a7){return new Promise(function(_0x306791,_0x454818){return db[_0x18be('0x1d')][_0x18be('0x23')]({'where':_0x2623a7[_0x18be('0x20')]?_0x2623a7[_0x18be('0x20')][_0x18be('0x24')]||null:null})[_0x18be('0x11')](function(_0x50575a){if(_0x50575a){return _0x50575a['addTags'](_0x2623a7[_0x18be('0x1f')][_0x18be('0x25')],_['omit'](_0x2623a7[_0x18be('0x1f')],[_0x18be('0x25'),'id'])||{});}})[_0x18be('0x26')](function(_0x2fbf4b){logger[_0x18be('0x12')](_0x18be('0x27'),_0x2623a7);logger['debug'](_0x18be('0x27'),_0x2623a7,JSON[_0x18be('0x17')](_0x2fbf4b));_0x306791(_0x2fbf4b);})['catch'](function(_0x1007f2){logger[_0x18be('0x18')](_0x18be('0x27'),_0x1007f2[_0x18be('0x1a')],_0x2623a7);_0x454818(_this[_0x18be('0x18')](0x1f4,_0x1007f2[_0x18be('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a43d1ec..d9406f9 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 _0x05f5=['remove','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x5c966a,_0x16f5e4){var _0x40b670=function(_0x504054){while(--_0x504054){_0x5c966a['push'](_0x5c966a['shift']());}};_0x40b670(++_0x16f5e4);}(_0x05f5,0x1e6));var _0x505f=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x05f5[_0xdf3db6];return _0x4b7a65;};'use strict';var FaxInteractionEvents=require(_0x505f('0x0'));var events=[_0x505f('0x1'),_0x505f('0x2'),'update'];function createListener(_0x6a6790,_0x49837d){return function(_0x3202e9){_0x49837d[_0x505f('0x3')](_0x6a6790,_0x3202e9);};}function removeListener(_0x2a8fb1,_0x341252){return function(){FaxInteractionEvents[_0x505f('0x4')](_0x2a8fb1,_0x341252);};}exports[_0x505f('0x5')]=function(_0x4fc38a){for(var _0x474bcc=0x0,_0xaa4a0f=events[_0x505f('0x6')];_0x474bcc<_0xaa4a0f;_0x474bcc++){var _0x5ad56e=events[_0x474bcc];var _0x427a0a=createListener(_0x505f('0x7')+_0x5ad56e,_0x4fc38a);FaxInteractionEvents['on'](_0x5ad56e,_0x427a0a);}}; \ No newline at end of file +var _0x3c14=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x17208d,_0x1e060e){var _0x2880e9=function(_0x5c5f83){while(--_0x5c5f83){_0x17208d['push'](_0x17208d['shift']());}};_0x2880e9(++_0x1e060e);}(_0x3c14,0x1a9));var _0x43c1=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x3c14[_0x3b5049];return _0x12454e;};'use strict';var FaxInteractionEvents=require(_0x43c1('0x0'));var events=['save',_0x43c1('0x1'),'update'];function createListener(_0x1c1e7d,_0x41688b){return function(_0x1d2f7f){_0x41688b[_0x43c1('0x2')](_0x1c1e7d,_0x1d2f7f);};}function removeListener(_0x431ea6,_0x5070c4){return function(){FaxInteractionEvents[_0x43c1('0x3')](_0x431ea6,_0x5070c4);};}exports[_0x43c1('0x4')]=function(_0x4a32a6){for(var _0x1349eb=0x0,_0x5d32d3=events[_0x43c1('0x5')];_0x1349eb<_0x5d32d3;_0x1349eb++){var _0x56def8=events[_0x1349eb];var _0x4f538b=createListener(_0x43c1('0x6')+_0x56def8,_0x4a32a6);FaxInteractionEvents['on'](_0x56def8,_0x4f538b);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 720c021..ff7eb98 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 _0x301d=['update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','put'];(function(_0x5e21af,_0x3fe3b9){var _0xf4385d=function(_0x31831e){while(--_0x31831e){_0x5e21af['push'](_0x5e21af['shift']());}};_0xf4385d(++_0x3fe3b9);}(_0x301d,0xe6));var _0xd301=function(_0x4b9546,_0x23cac5){_0x4b9546=_0x4b9546-0x0;var _0x58889e=_0x301d[_0x4b9546];return _0x58889e;};'use strict';var multer=require(_0xd301('0x0'));var util=require(_0xd301('0x1'));var path=require(_0xd301('0x2'));var timeout=require(_0xd301('0x3'));var express=require(_0xd301('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd301('0x5'));var config=require(_0xd301('0x6'));var controller=require(_0xd301('0x7'));router[_0xd301('0x8')]('/',auth[_0xd301('0x9')](),controller[_0xd301('0xa')]);router['get'](_0xd301('0xb'),auth[_0xd301('0x9')](),controller[_0xd301('0xc')]);router[_0xd301('0x8')](_0xd301('0xd'),auth['isAuthenticated'](),controller[_0xd301('0xe')]);router[_0xd301('0x8')](_0xd301('0xf'),auth['isAuthenticated'](),controller[_0xd301('0x10')]);router[_0xd301('0x8')]('/:id/download',auth[_0xd301('0x9')](),controller[_0xd301('0x11')]);router[_0xd301('0x12')]('/',auth[_0xd301('0x9')](),controller[_0xd301('0x13')]);router[_0xd301('0x12')](_0xd301('0xf'),auth[_0xd301('0x9')](),controller[_0xd301('0x14')]);router[_0xd301('0x12')](_0xd301('0x15'),auth['isAuthenticated'](),interaction[_0xd301('0x16')](_0xd301('0x17'),'faxinteraction:addtags'),controller[_0xd301('0x18')]);router[_0xd301('0x19')](_0xd301('0xd'),auth[_0xd301('0x9')](),interaction['tracked'](_0xd301('0x17'),'faxinteraction:update'),controller[_0xd301('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0xd301('0x16')](_0xd301('0x17'),_0xd301('0x1b')),controller[_0xd301('0x1c')]);router[_0xd301('0x1d')](_0xd301('0x15'),auth[_0xd301('0x9')](),controller[_0xd301('0x1e')]);module[_0xd301('0x1f')]=router; \ No newline at end of file +var _0x45c8=['Router','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','faxinteraction:addtags','addTags','put','fax','delete','faxinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45c8,0xef));var _0x845c=function(_0x144422,_0x1e928b){_0x144422=_0x144422-0x0;var _0x422b3b=_0x45c8[_0x144422];return _0x422b3b;};'use strict';var multer=require(_0x845c('0x0'));var util=require('util');var path=require(_0x845c('0x1'));var timeout=require(_0x845c('0x2'));var express=require(_0x845c('0x3'));var router=express[_0x845c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x845c('0x5')]('/',auth[_0x845c('0x6')](),controller[_0x845c('0x7')]);router['get'](_0x845c('0x8'),auth['isAuthenticated'](),controller[_0x845c('0x9')]);router[_0x845c('0x5')](_0x845c('0xa'),auth[_0x845c('0x6')](),controller[_0x845c('0xb')]);router[_0x845c('0x5')](_0x845c('0xc'),auth[_0x845c('0x6')](),controller[_0x845c('0xd')]);router[_0x845c('0x5')]('/:id/download',auth['isAuthenticated'](),controller[_0x845c('0xe')]);router[_0x845c('0xf')]('/',auth['isAuthenticated'](),controller[_0x845c('0x10')]);router[_0x845c('0xf')](_0x845c('0xc'),auth[_0x845c('0x6')](),controller[_0x845c('0x11')]);router[_0x845c('0xf')]('/:id/tags',auth[_0x845c('0x6')](),interaction[_0x845c('0x12')]('fax',_0x845c('0x13')),controller[_0x845c('0x14')]);router[_0x845c('0x15')](_0x845c('0xa'),auth[_0x845c('0x6')](),interaction[_0x845c('0x12')](_0x845c('0x16'),'faxinteraction:update'),controller['update']);router[_0x845c('0x17')](_0x845c('0xa'),auth[_0x845c('0x6')](),interaction['tracked'](_0x845c('0x16'),_0x845c('0x18')),controller[_0x845c('0x19')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x845c('0x1a')]);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 ec0e2da..033bba1 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 _0x7ff2=['out','TEXT','DATE','exports','BOOLEAN'];(function(_0x11c838,_0x29af31){var _0x581d01=function(_0x183994){while(--_0x183994){_0x11c838['push'](_0x11c838['shift']());}};_0x581d01(++_0x29af31);}(_0x7ff2,0xe9));var _0x27ff=function(_0x32618e,_0x1018c9){_0x32618e=_0x32618e-0x0;var _0x45a181=_0x7ff2[_0x32618e];return _0x45a181;};'use strict';var Sequelize=require('sequelize');module[_0x27ff('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x27ff('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x27ff('0x2')),'defaultValue':_0x27ff('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x27ff('0x3')],'defaultValue':null},'readAt':{'type':Sequelize[_0x27ff('0x4')]}}; \ No newline at end of file +var _0x2f65=['exports','TEXT','out','DATE','sequelize'];(function(_0x5ec09b,_0x12d654){var _0x5a8482=function(_0x3e250f){while(--_0x3e250f){_0x5ec09b['push'](_0x5ec09b['shift']());}};_0x5a8482(++_0x12d654);}(_0x2f65,0x112));var _0x52f6=function(_0x7119ca,_0x32e3d8){_0x7119ca=_0x7119ca-0x0;var _0x522567=_0x2f65[_0x7119ca];return _0x522567;};'use strict';var Sequelize=require(_0x52f6('0x0'));module[_0x52f6('0x1')]={'body':{'type':Sequelize[_0x52f6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x52f6('0x3')),'defaultValue':_0x52f6('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x52f6('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x52f6('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a951bbd..4c039df 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 _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','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/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x9dbc96,_0x168b7e){var _0x500fa0=function(_0x2c9097){while(--_0x2c9097){_0x9dbc96['push'](_0x9dbc96['shift']());}};_0x500fa0(++_0x168b7e);}(_0xb10b,0x12a));var _0xbb10=function(_0x3efe9b,_0x5b41a8){_0x3efe9b=_0x3efe9b-0x0;var _0x132073=_0xb10b[_0x3efe9b];return _0x132073;};'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 as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));}; \ No newline at end of file +var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 069e862..d820f4f 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x4f43b8,_0x553ffc){var _0x5d7a96=function(_0xf8b925){while(--_0xf8b925){_0x4f43b8['push'](_0x4f43b8['shift']());}};_0x5d7a96(++_0x553ffc);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x24afdd,_0xa21613){_0x24afdd=_0x24afdd-0x0;var _0x710268=_0xe14b[_0x24afdd];return _0x710268;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var FaxMessage=require(_0xbe14('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){FaxMessageEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);FaxMessageEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];FaxMessage[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3452bcb..64c4276 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 _0x2d7a=['get','direction','toLowerCase','out','secret','isNil','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','body','FULLTEXT'];(function(_0x3662b4,_0x503b4d){var _0x50928c=function(_0x15db69){while(--_0x15db69){_0x3662b4['push'](_0x3662b4['shift']());}};_0x50928c(++_0x503b4d);}(_0x2d7a,0x101));var _0xa2d7=function(_0x5f15c3,_0x5657e1){_0x5f15c3=_0x5f15c3-0x0;var _0x48405e=_0x2d7a[_0x5f15c3];return _0x48405e;};'use strict';var _=require(_0xa2d7('0x0'));var util=require(_0xa2d7('0x1'));var logger=require(_0xa2d7('0x2'))(_0xa2d7('0x3'));var moment=require('moment');var BPromise=require(_0xa2d7('0x4'));var rp=require(_0xa2d7('0x5'));var fs=require('fs');var path=require(_0xa2d7('0x6'));var rimraf=require(_0xa2d7('0x7'));var config=require(_0xa2d7('0x8'));var attributes=require(_0xa2d7('0x9'));module['exports']=function(_0x1eabf8,_0x396ca0){return _0x1eabf8[_0xa2d7('0xa')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xa2d7('0xb')],'type':_0xa2d7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbef61e,_0x3def29,_0x3a0abe){var _0xc2d0fd=_0x1eabf8['models'];var _0x1b0dbf=_0xbef61e[_0xa2d7('0xd')]({'plain':!![]});if(_0x1b0dbf[_0xa2d7('0xe')]['toLowerCase']()==='in'||_0x1b0dbf[_0xa2d7('0xe')][_0xa2d7('0xf')]()===_0xa2d7('0x10')&&!_0x1b0dbf[_0xa2d7('0x11')]&&!_[_0xa2d7('0x12')](_0x1b0dbf['UserId'])){_0xc2d0fd[_0xa2d7('0x13')]['findOne']({'where':{'id':_0x1b0dbf[_0xa2d7('0x14')]}})[_0xa2d7('0x15')](function(_0x15a977){if(_0x15a977){_0x15a977[_0xa2d7('0x16')]({'lastMsgAt':_0x1b0dbf[_0xa2d7('0x17')],'lastMsgDirection':_0x1b0dbf[_0xa2d7('0xe')]['toLowerCase']()});}})[_0xa2d7('0x18')](function(_0xe001c4){console[_0xa2d7('0x19')](_0xe001c4);});}_0x3a0abe();}},'charset':'utf8mb4','collate':_0xa2d7('0x1a')});}; \ No newline at end of file +var _0x5dc5=['toLowerCase','out','secret','UserId','FaxInteraction','FaxInteractionId','then','update','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction'];(function(_0x5b3946,_0x23053c){var _0x2bd577=function(_0x406e40){while(--_0x406e40){_0x5b3946['push'](_0x5b3946['shift']());}};_0x2bd577(++_0x23053c);}(_0x5dc5,0x75));var _0x55dc=function(_0x3650ad,_0x8a2ac){_0x3650ad=_0x3650ad-0x0;var _0x1a6af6=_0x5dc5[_0x3650ad];return _0x1a6af6;};'use strict';var _=require(_0x55dc('0x0'));var util=require(_0x55dc('0x1'));var logger=require(_0x55dc('0x2'))(_0x55dc('0x3'));var moment=require(_0x55dc('0x4'));var BPromise=require(_0x55dc('0x5'));var rp=require(_0x55dc('0x6'));var fs=require('fs');var path=require(_0x55dc('0x7'));var rimraf=require('rimraf');var config=require(_0x55dc('0x8'));var attributes=require(_0x55dc('0x9'));module[_0x55dc('0xa')]=function(_0x21c11c,_0x35a966){return _0x21c11c['define'](_0x55dc('0xb'),attributes,{'tableName':_0x55dc('0xc'),'paranoid':![],'indexes':[{'name':_0x55dc('0xd'),'fields':['body'],'type':_0x55dc('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5336f1,_0x232c58,_0x385080){var _0x2e6509=_0x21c11c[_0x55dc('0xf')];var _0xd44c5f=_0x5336f1[_0x55dc('0x10')]({'plain':!![]});if(_0xd44c5f[_0x55dc('0x11')]['toLowerCase']()==='in'||_0xd44c5f[_0x55dc('0x11')][_0x55dc('0x12')]()===_0x55dc('0x13')&&!_0xd44c5f[_0x55dc('0x14')]&&!_['isNil'](_0xd44c5f[_0x55dc('0x15')])){_0x2e6509[_0x55dc('0x16')]['findOne']({'where':{'id':_0xd44c5f[_0x55dc('0x17')]}})[_0x55dc('0x18')](function(_0x4ebad8){if(_0x4ebad8){_0x4ebad8[_0x55dc('0x19')]({'lastMsgAt':_0xd44c5f['createdAt'],'lastMsgDirection':_0xd44c5f[_0x55dc('0x11')][_0x55dc('0x12')]()});}})[_0x55dc('0x1a')](function(_0x1fb8f6){console['error'](_0x1fb8f6);});}_0x385080();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 85fa3ab..a0c7f59 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 _0x4f20=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxMessage.socket','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','stringify','catch','update','where','attributes','UpdateFaxMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4f20,0x86));var _0x04f2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4f20[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x04f2('0x0'));var moment=require(_0x04f2('0x1'));var BPromise=require(_0x04f2('0x2'));var rs=require(_0x04f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04f2('0x4'))['db'];var utils=require(_0x04f2('0x5'));var logger=require(_0x04f2('0x6'))(_0x04f2('0x7'));var config=require(_0x04f2('0x8'));var jayson=require(_0x04f2('0x9'));var client=jayson['client'][_0x04f2('0xa')]({'port':0x232a});config[_0x04f2('0xb')]=_[_0x04f2('0xc')](config['redis'],{'host':_0x04f2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x04f2('0xe'))[_0x04f2('0xf')](socket);function respondWithRpcPromise(_0x484b1f,_0x151a95,_0x141f28){return new BPromise(function(_0x2ac330,_0x40b09d){return client[_0x04f2('0x10')](_0x484b1f,_0x141f28)['then'](function(_0x2fcae1){logger['info'](_0x04f2('0x11'),_0x151a95,_0x04f2('0x12'));logger[_0x04f2('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x151a95,'request\x20sent',JSON['stringify'](_0x2fcae1));if(_0x2fcae1[_0x04f2('0x14')]){if(_0x2fcae1[_0x04f2('0x14')]['code']===0x1f4){logger[_0x04f2('0x14')](_0x04f2('0x11'),_0x151a95,_0x2fcae1['error'][_0x04f2('0x15')]);return _0x40b09d(_0x2fcae1[_0x04f2('0x14')][_0x04f2('0x15')]);}logger['error'](_0x04f2('0x11'),_0x151a95,_0x2fcae1['error'][_0x04f2('0x15')]);return _0x2ac330(_0x2fcae1['error'][_0x04f2('0x15')]);}else{logger['info'](_0x04f2('0x11'),_0x151a95,_0x04f2('0x12'));_0x2ac330(_0x2fcae1['result'][_0x04f2('0x15')]);}})['catch'](function(_0x40ad9e){logger[_0x04f2('0x14')](_0x04f2('0x11'),_0x151a95,_0x40ad9e);_0x40b09d(_0x40ad9e);});});}exports[_0x04f2('0x16')]=function(_0x2165e1){var _0x4325a5=this;return new Promise(function(_0x10577d,_0x24789d){return db[_0x04f2('0x17')][_0x04f2('0x18')](_0x2165e1[_0x04f2('0x19')],{'raw':_0x2165e1[_0x04f2('0x1a')]?_0x2165e1['options'][_0x04f2('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x585b4f){logger[_0x04f2('0x1c')](_0x04f2('0x16'),_0x2165e1);logger['debug'](_0x04f2('0x16'),_0x2165e1,JSON[_0x04f2('0x1d')](_0x585b4f));_0x10577d(_0x585b4f);})[_0x04f2('0x1e')](function(_0x29a37d){logger[_0x04f2('0x14')](_0x04f2('0x16'),_0x29a37d[_0x04f2('0x15')],_0x2165e1);_0x24789d(_0x4325a5[_0x04f2('0x14')](0x1f4,_0x29a37d[_0x04f2('0x15')]));});});};exports['UpdateFaxMessage']=function(_0x250dce){var _0x1df065=this;return new Promise(function(_0x1f6411,_0x40a5cf){return db[_0x04f2('0x17')][_0x04f2('0x1f')](_0x250dce[_0x04f2('0x19')],{'raw':_0x250dce[_0x04f2('0x1a')]?_0x250dce[_0x04f2('0x1a')][_0x04f2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250dce[_0x04f2('0x1a')]?_0x250dce[_0x04f2('0x1a')][_0x04f2('0x20')]||null:null,'attributes':_0x250dce['options']?_0x250dce[_0x04f2('0x1a')][_0x04f2('0x21')]||null:null,'limit':_0x250dce[_0x04f2('0x1a')]?_0x250dce['options']['limit']||null:null})['then'](function(_0x379f76){logger[_0x04f2('0x1c')](_0x04f2('0x22'),_0x250dce);logger[_0x04f2('0x13')](_0x04f2('0x22'),_0x250dce,JSON[_0x04f2('0x1d')](_0x379f76));_0x1f6411(_0x379f76);})[_0x04f2('0x1e')](function(_0x5c599f){logger[_0x04f2('0x14')](_0x04f2('0x22'),_0x5c599f[_0x04f2('0x15')],_0x250dce);_0x40a5cf(_0x1df065[_0x04f2('0x14')](0x1f4,_0x5c599f[_0x04f2('0x15')]));});});}; \ No newline at end of file +var _0x6f58=['create','options','raw','then','CreateFaxMessage','UpdateFaxMessage','update','body','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxMessage'];(function(_0x1b08d4,_0x8a710c){var _0x9aef3e=function(_0x4da607){while(--_0x4da607){_0x1b08d4['push'](_0x1b08d4['shift']());}};_0x9aef3e(++_0x8a710c);}(_0x6f58,0x1ec));var _0x86f5=function(_0x1524b9,_0xdaa4fa){_0x1524b9=_0x1524b9-0x0;var _0x36f228=_0x6f58[_0x1524b9];return _0x36f228;};'use strict';var _=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var moment=require(_0x86f5('0x2'));var BPromise=require(_0x86f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86f5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x86f5('0x5'));var config=require('../../config/environment');var jayson=require(_0x86f5('0x6'));var client=jayson[_0x86f5('0x7')][_0x86f5('0x8')]({'port':0x232a});config[_0x86f5('0x9')]=_['defaults'](config['redis'],{'host':_0x86f5('0xa'),'port':0x18eb});var socket=require(_0x86f5('0xb'))(new Redis(config[_0x86f5('0x9')]));require(_0x86f5('0xc'))[_0x86f5('0xd')](socket);function respondWithRpcPromise(_0x32765b,_0x518231,_0x4ce5c0){return new BPromise(function(_0x5aff0b,_0x49f821){return client['request'](_0x32765b,_0x4ce5c0)['then'](function(_0x287808){logger[_0x86f5('0xe')](_0x86f5('0xf'),_0x518231,_0x86f5('0x10'));logger[_0x86f5('0x11')](_0x86f5('0x12'),_0x518231,'request\x20sent',JSON[_0x86f5('0x13')](_0x287808));if(_0x287808[_0x86f5('0x14')]){if(_0x287808[_0x86f5('0x14')][_0x86f5('0x15')]===0x1f4){logger[_0x86f5('0x14')](_0x86f5('0xf'),_0x518231,_0x287808[_0x86f5('0x14')][_0x86f5('0x16')]);return _0x49f821(_0x287808[_0x86f5('0x14')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x518231,_0x287808['error'][_0x86f5('0x16')]);return _0x5aff0b(_0x287808[_0x86f5('0x14')][_0x86f5('0x16')]);}else{logger[_0x86f5('0xe')](_0x86f5('0xf'),_0x518231,_0x86f5('0x10'));_0x5aff0b(_0x287808[_0x86f5('0x17')][_0x86f5('0x16')]);}})[_0x86f5('0x18')](function(_0x3d155a){logger[_0x86f5('0x14')](_0x86f5('0xf'),_0x518231,_0x3d155a);_0x49f821(_0x3d155a);});});}exports['CreateFaxMessage']=function(_0x2e09f1){var _0x2e3977=this;return new Promise(function(_0x2d2dfc,_0xa0a07b){return db[_0x86f5('0x19')][_0x86f5('0x1a')](_0x2e09f1['body'],{'raw':_0x2e09f1[_0x86f5('0x1b')]?_0x2e09f1['options'][_0x86f5('0x1c')]===undefined?!![]:![]:!![]})[_0x86f5('0x1d')](function(_0x1fedd9){logger[_0x86f5('0xe')](_0x86f5('0x1e'),_0x2e09f1);logger[_0x86f5('0x11')](_0x86f5('0x1e'),_0x2e09f1,JSON['stringify'](_0x1fedd9));_0x2d2dfc(_0x1fedd9);})[_0x86f5('0x18')](function(_0xec1ad5){logger[_0x86f5('0x14')](_0x86f5('0x1e'),_0xec1ad5[_0x86f5('0x16')],_0x2e09f1);_0xa0a07b(_0x2e3977[_0x86f5('0x14')](0x1f4,_0xec1ad5['message']));});});};exports[_0x86f5('0x1f')]=function(_0x67fd8f){var _0x11c40d=this;return new Promise(function(_0x36c9b0,_0xca209e){return db[_0x86f5('0x19')][_0x86f5('0x20')](_0x67fd8f[_0x86f5('0x21')],{'raw':_0x67fd8f[_0x86f5('0x1b')]?_0x67fd8f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x67fd8f['options']?_0x67fd8f[_0x86f5('0x1b')][_0x86f5('0x22')]||null:null,'attributes':_0x67fd8f[_0x86f5('0x1b')]?_0x67fd8f[_0x86f5('0x1b')][_0x86f5('0x23')]||null:null,'limit':_0x67fd8f['options']?_0x67fd8f[_0x86f5('0x1b')][_0x86f5('0x24')]||null:null})['then'](function(_0x3679bd){logger[_0x86f5('0xe')](_0x86f5('0x1f'),_0x67fd8f);logger[_0x86f5('0x11')]('UpdateFaxMessage',_0x67fd8f,JSON[_0x86f5('0x13')](_0x3679bd));_0x36c9b0(_0x3679bd);})[_0x86f5('0x18')](function(_0x3e414b){logger[_0x86f5('0x14')](_0x86f5('0x1f'),_0x3e414b['message'],_0x67fd8f);_0xca209e(_0x11c40d[_0x86f5('0x14')](0x1f4,_0x3e414b[_0x86f5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 0989bea..a5c62b4 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 _0xa9e0=['register','length','faxMessage:','./faxMessage.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(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 6ccc1c4..56f16c6 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 _0x2297=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0x2297,0x101));var _0x7229=function(_0x569002,_0x2a7255){_0x569002=_0x569002-0x0;var _0x16e745=_0x2297[_0x569002];return _0x16e745;};'use strict';var multer=require(_0x7229('0x0'));var util=require('util');var path=require(_0x7229('0x1'));var timeout=require(_0x7229('0x2'));var express=require(_0x7229('0x3'));var router=express[_0x7229('0x4')]();var auth=require(_0x7229('0x5'));var interaction=require(_0x7229('0x6'));var config=require(_0x7229('0x7'));var controller=require(_0x7229('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7229('0x9')]);router[_0x7229('0xa')](_0x7229('0xb'),auth[_0x7229('0xc')](),controller[_0x7229('0xd')]);router['get'](_0x7229('0xe'),auth[_0x7229('0xc')](),controller[_0x7229('0xf')]);router[_0x7229('0xa')]('/:id/download',auth[_0x7229('0xc')](),controller[_0x7229('0x10')]);router[_0x7229('0x11')]('/',auth[_0x7229('0xc')](),interaction[_0x7229('0x12')](_0x7229('0x13'),_0x7229('0x14')),controller[_0x7229('0x15')]);router[_0x7229('0x16')](_0x7229('0xe'),auth[_0x7229('0xc')](),controller['update']);router[_0x7229('0x16')](_0x7229('0x17'),auth[_0x7229('0xc')](),controller['accept']);router['put'](_0x7229('0x18'),auth[_0x7229('0xc')](),controller[_0x7229('0x19')]);router[_0x7229('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x7229('0x1b')]);module[_0x7229('0x1c')]=router; \ No newline at end of file +var _0x98c3=['reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','/:id','isAuthenticated','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','/:id/reject'];(function(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0x98c3,0xab));var _0x398c=function(_0x3cdf93,_0x4a7e87){_0x3cdf93=_0x3cdf93-0x0;var _0x4f4f45=_0x98c3[_0x3cdf93];return _0x4f4f45;};'use strict';var multer=require(_0x398c('0x0'));var util=require(_0x398c('0x1'));var path=require(_0x398c('0x2'));var timeout=require(_0x398c('0x3'));var express=require(_0x398c('0x4'));var router=express[_0x398c('0x5')]();var auth=require(_0x398c('0x6'));var interaction=require(_0x398c('0x7'));var config=require(_0x398c('0x8'));var controller=require(_0x398c('0x9'));router[_0x398c('0xa')]('/',auth['isAuthenticated'](),controller[_0x398c('0xb')]);router['get'](_0x398c('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x398c('0xa')](_0x398c('0xd'),auth[_0x398c('0xe')](),controller['show']);router[_0x398c('0xa')](_0x398c('0xf'),auth[_0x398c('0xe')](),controller[_0x398c('0x10')]);router[_0x398c('0x11')]('/',auth[_0x398c('0xe')](),interaction[_0x398c('0x12')](_0x398c('0x13'),'faxmessage:create'),controller[_0x398c('0x14')]);router[_0x398c('0x15')](_0x398c('0xd'),auth['isAuthenticated'](),controller[_0x398c('0x16')]);router[_0x398c('0x15')](_0x398c('0x17'),auth[_0x398c('0xe')](),controller['accept']);router[_0x398c('0x15')](_0x398c('0x18'),auth[_0x398c('0xe')](),controller[_0x398c('0x19')]);router[_0x398c('0x1a')]('/:id',auth[_0x398c('0xe')](),controller[_0x398c('0x1b')]);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 a852cf6..7397ff8 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 _0x2b34=['exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x5d75ff,_0x5bc7ac){var _0x1c1894=function(_0x1fcade){while(--_0x1fcade){_0x5d75ff['push'](_0x5d75ff['shift']());}};_0x1c1894(++_0x5bc7ac);}(_0x2b34,0xa7));var _0x42b3=function(_0x462774,_0x4953d2){_0x462774=_0x462774-0x0;var _0x280503=_0x2b34[_0x462774];return _0x280503;};'use strict';var Sequelize=require(_0x42b3('0x0'));module[_0x42b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x42b3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x42b3('0x3')]},'timeout':{'type':Sequelize[_0x42b3('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x42b3('0x5'),_0x42b3('0x6'),_0x42b3('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7188=['name','STRING','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0x2e0e10,_0x56d88d){var _0x45853b=function(_0x4aadeb){while(--_0x4aadeb){_0x2e0e10['push'](_0x2e0e10['shift']());}};_0x45853b(++_0x56d88d);}(_0x7188,0x172));var _0x8718=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x7188[_0x173452];return _0xee3fd0;};'use strict';var Sequelize=require('sequelize');module[_0x8718('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8718('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8718('0x2')]},'timeout':{'type':Sequelize[_0x8718('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8718('0x4')](_0x8718('0x5'),_0x8718('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8718('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index f69e49c..a79dff6 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 _0x6b20=['nolimit','order','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserFaxQueue','sort','map','User','UserId','agent','faxPause','updatedAt','SIP','Team','pick','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','userFaxQueue:save','select','tq.TeamId','team_has_fax_queues','join','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','value','transaction','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','omit','spread','emit','isArray','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0x6b20,0xd1));var _0x06b2=function(_0x1d3199,_0x32bf00){_0x1d3199=_0x1d3199-0x0;var _0x330196=_0x6b20[_0x1d3199];return _0x330196;};'use strict';var pdf=require(_0x06b2('0x0'));var emlformat=require(_0x06b2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x06b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06b2('0x3'));var moment=require(_0x06b2('0x4'));var BPromise=require(_0x06b2('0x5'));var Mustache=require('mustache');var util=require(_0x06b2('0x6'));var path=require(_0x06b2('0x7'));var sox=require(_0x06b2('0x8'));var csv=require(_0x06b2('0x9'));var ejs=require(_0x06b2('0xa'));var fs=require('fs');var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x9'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var db=require(_0x06b2('0x15'))['db'];config[_0x06b2('0x16')]=_[_0x06b2('0x17')](config[_0x06b2('0x16')],{'host':_0x06b2('0x18'),'port':0x18eb});var socket=require(_0x06b2('0x19'))(new Redis(config[_0x06b2('0x16')]));require(_0x06b2('0x1a'))[_0x06b2('0x1b')](socket);function respondWithStatusCode(_0x2822e9,_0x26faee){_0x26faee=_0x26faee||0xcc;return function(_0x544de8){if(_0x544de8){return _0x2822e9[_0x06b2('0x1c')](_0x26faee);}return _0x2822e9[_0x06b2('0x1d')](_0x26faee)[_0x06b2('0x1e')]();};}function respondWithResult(_0x3830e9,_0xef0466){_0xef0466=_0xef0466||0xc8;return function(_0x45d5c5){if(_0x45d5c5){return _0x3830e9['status'](_0xef0466)[_0x06b2('0x1f')](_0x45d5c5);}};}function respondWithFilteredResult(_0x3f2a53,_0x525945){return function(_0x1e16d1){if(_0x1e16d1){var _0x594b48=_0x1e16d1[_0x06b2('0x20')],_0x4c9cae=_0x525945[_0x06b2('0x21')],_0x192270=_0x525945['offset']+_0x525945[_0x06b2('0x22')],_0x1b4ab0;if(_0x192270>=_0x594b48){_0x192270=_0x594b48;_0x1b4ab0=0xc8;}else{_0x1b4ab0=0xce;}_0x3f2a53[_0x06b2('0x1d')](_0x1b4ab0);return _0x3f2a53[_0x06b2('0x23')](_0x06b2('0x24'),_0x4c9cae+'-'+_0x192270+'/'+_0x594b48)[_0x06b2('0x1f')](_0x1e16d1);}return null;};}function patchUpdates(_0x368ad8){return function(_0x268e7d){try{jsonpatch['apply'](_0x268e7d,_0x368ad8,!![]);}catch(_0x18c9a9){return BPromise[_0x06b2('0x25')](_0x18c9a9);}return _0x268e7d[_0x06b2('0x26')]();};}function saveUpdates(_0x208384,_0x4e2a4c){return function(_0x4fa84f){if(_0x4fa84f){return _0x4fa84f[_0x06b2('0x27')](_0x208384)[_0x06b2('0x28')](function(_0x4fc95f){return _0x4fc95f;});}return null;};}function removeEntity(_0x39659f,_0x5e40f2){return function(_0x3d58c6){if(_0x3d58c6){return _0x3d58c6[_0x06b2('0x29')]()[_0x06b2('0x28')](function(){var _0x593d3a=_0x3d58c6[_0x06b2('0x2a')]({'plain':!![]});var _0x306ce=_0x06b2('0x2b');return db[_0x06b2('0x2c')][_0x06b2('0x29')]({'where':{'type':_0x306ce,'resourceId':_0x593d3a['id']}})['then'](function(){return _0x3d58c6;});})[_0x06b2('0x28')](function(){_0x39659f[_0x06b2('0x1d')](0xcc)[_0x06b2('0x1e')]();});}};}function handleEntityNotFound(_0x1a99c1,_0x1976ac){return function(_0x3e7cd4){if(!_0x3e7cd4){_0x1a99c1['sendStatus'](0x194);}return _0x3e7cd4;};}function handleError(_0x44a95e,_0x2a3228){_0x2a3228=_0x2a3228||0x1f4;return function(_0x2720fa){logger[_0x06b2('0x2d')](_0x2720fa[_0x06b2('0x2e')]);if(_0x2720fa[_0x06b2('0x2f')]){delete _0x2720fa[_0x06b2('0x2f')];}_0x44a95e['status'](_0x2a3228)[_0x06b2('0x30')](_0x2720fa);};}exports[_0x06b2('0x31')]=function(_0x1637c2,_0x15a78b){var _0x1cc725={},_0x37d391={},_0x401551={'count':0x0,'rows':[]};var _0x2c03e4=_['map'](db[_0x06b2('0x32')][_0x06b2('0x33')],function(_0x259e3d){return{'name':_0x259e3d[_0x06b2('0x34')],'type':_0x259e3d[_0x06b2('0x35')][_0x06b2('0x36')]};});_0x37d391[_0x06b2('0x37')]=_['map'](_0x2c03e4,'name');_0x37d391[_0x06b2('0x38')]=_[_0x06b2('0x39')](_0x1637c2[_0x06b2('0x38')]);_0x37d391['filters']=_[_0x06b2('0x3a')](_0x37d391[_0x06b2('0x37')],_0x37d391[_0x06b2('0x38')]);_0x1cc725[_0x06b2('0x3b')]=_[_0x06b2('0x3a')](_0x37d391[_0x06b2('0x37')],qs['fields'](_0x1637c2[_0x06b2('0x38')][_0x06b2('0x3c')]));_0x1cc725[_0x06b2('0x3b')]=_0x1cc725['attributes'][_0x06b2('0x3d')]?_0x1cc725[_0x06b2('0x3b')]:_0x37d391['model'];if(!_0x1637c2[_0x06b2('0x38')][_0x06b2('0x3e')](_0x06b2('0x3f'))){_0x1cc725[_0x06b2('0x22')]=qs[_0x06b2('0x22')](_0x1637c2[_0x06b2('0x38')][_0x06b2('0x22')]);_0x1cc725[_0x06b2('0x21')]=qs[_0x06b2('0x21')](_0x1637c2[_0x06b2('0x38')][_0x06b2('0x21')]);}_0x1cc725[_0x06b2('0x40')]=qs['sort'](_0x1637c2[_0x06b2('0x38')]['sort']);_0x1cc725['where']=qs[_0x06b2('0x41')](_['pick'](_0x1637c2[_0x06b2('0x38')],_0x37d391['filters']));if(_0x1637c2[_0x06b2('0x38')][_0x06b2('0x42')]){_0x1cc725[_0x06b2('0x43')]=_[_0x06b2('0x44')](_0x1cc725[_0x06b2('0x43')],{'$or':_['map'](_0x2c03e4,function(_0x404eab){if(_0x404eab[_0x06b2('0x35')]!==_0x06b2('0x45')){var _0xadcd78={};_0xadcd78[_0x404eab[_0x06b2('0x2f')]]={'$like':'%'+_0x1637c2[_0x06b2('0x38')]['filter']+'%'};return _0xadcd78;}})});}_0x1cc725=_[_0x06b2('0x44')]({},_0x1cc725,_0x1637c2[_0x06b2('0x46')]);var _0x53b409={'where':_0x1cc725['where']};return db[_0x06b2('0x32')][_0x06b2('0x20')](_0x53b409)[_0x06b2('0x28')](function(_0x3a8452){_0x401551[_0x06b2('0x20')]=_0x3a8452;if(_0x1637c2[_0x06b2('0x38')][_0x06b2('0x47')]){_0x1cc725[_0x06b2('0x48')]=[{'all':!![]}];}return db[_0x06b2('0x32')][_0x06b2('0x49')](_0x1cc725);})[_0x06b2('0x28')](function(_0xf9b9e){_0x401551[_0x06b2('0x4a')]=_0xf9b9e;return _0x401551;})[_0x06b2('0x28')](respondWithFilteredResult(_0x15a78b,_0x1cc725))[_0x06b2('0x4b')](handleError(_0x15a78b,null));};exports[_0x06b2('0x4c')]=function(_0x36ef08,_0xc68724){var _0x38fb0e={'raw':!![],'where':{'id':_0x36ef08[_0x06b2('0x4d')]['id']}},_0x5f27cb={};_0x5f27cb[_0x06b2('0x37')]=_[_0x06b2('0x39')](db[_0x06b2('0x32')]['rawAttributes']);_0x5f27cb[_0x06b2('0x38')]=_[_0x06b2('0x39')](_0x36ef08['query']);_0x5f27cb[_0x06b2('0x41')]=_[_0x06b2('0x3a')](_0x5f27cb['model'],_0x5f27cb[_0x06b2('0x38')]);_0x38fb0e[_0x06b2('0x3b')]=_['intersection'](_0x5f27cb['model'],qs['fields'](_0x36ef08[_0x06b2('0x38')][_0x06b2('0x3c')]));_0x38fb0e[_0x06b2('0x3b')]=_0x38fb0e[_0x06b2('0x3b')][_0x06b2('0x3d')]?_0x38fb0e['attributes']:_0x5f27cb['model'];if(_0x36ef08[_0x06b2('0x38')][_0x06b2('0x47')]){_0x38fb0e[_0x06b2('0x48')]=[{'all':!![]}];}_0x38fb0e=_[_0x06b2('0x44')]({},_0x38fb0e,_0x36ef08[_0x06b2('0x46')]);return db[_0x06b2('0x32')]['find'](_0x38fb0e)[_0x06b2('0x28')](handleEntityNotFound(_0xc68724,null))[_0x06b2('0x28')](respondWithResult(_0xc68724,null))[_0x06b2('0x4b')](handleError(_0xc68724,null));};exports[_0x06b2('0x4e')]=function(_0x146c5c,_0x36a74a){return db['FaxQueue'][_0x06b2('0x4e')](_0x146c5c[_0x06b2('0x4f')],{})[_0x06b2('0x28')](function(_0x46920d){var _0x487341=_0x146c5c[_0x06b2('0x50')][_0x06b2('0x2a')]({'plain':!![]});if(!_0x487341)throw new Error(_0x06b2('0x51'));if(_0x487341[_0x06b2('0x52')]==='user'){var _0x346f04=_0x46920d[_0x06b2('0x2a')]({'plain':!![]});var _0x36329e=_0x06b2('0x2b');return db[_0x06b2('0x53')][_0x06b2('0x54')]({'where':{'name':_0x36329e,'userProfileId':_0x487341[_0x06b2('0x55')]},'raw':!![]})[_0x06b2('0x28')](function(_0x568091){if(_0x568091&&_0x568091[_0x06b2('0x56')]===0x0){return db[_0x06b2('0x2c')][_0x06b2('0x4e')]({'name':_0x346f04[_0x06b2('0x2f')],'resourceId':_0x346f04['id'],'type':_0x568091[_0x06b2('0x2f')],'sectionId':_0x568091['id']},{})[_0x06b2('0x28')](function(){return _0x46920d;});}else{return _0x46920d;}})['catch'](function(_0x5db1cc){logger[_0x06b2('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5db1cc);throw _0x5db1cc;});}return _0x46920d;})['then'](respondWithResult(_0x36a74a,0xc9))[_0x06b2('0x4b')](handleError(_0x36a74a,null));};exports['update']=function(_0x2dac1c,_0x3b8c83){if(_0x2dac1c[_0x06b2('0x4f')]['id']){delete _0x2dac1c[_0x06b2('0x4f')]['id'];}return db[_0x06b2('0x32')][_0x06b2('0x54')]({'where':{'id':_0x2dac1c[_0x06b2('0x4d')]['id']}})[_0x06b2('0x28')](handleEntityNotFound(_0x3b8c83,null))[_0x06b2('0x28')](saveUpdates(_0x2dac1c[_0x06b2('0x4f')],null))['then'](respondWithResult(_0x3b8c83,null))['catch'](handleError(_0x3b8c83,null));};exports[_0x06b2('0x29')]=function(_0x46e4b9,_0x4ec38d){return db[_0x06b2('0x32')][_0x06b2('0x54')]({'where':{'id':_0x46e4b9[_0x06b2('0x4d')]['id']}})[_0x06b2('0x28')](handleEntityNotFound(_0x4ec38d,null))['then'](removeEntity(_0x4ec38d,null))['catch'](handleError(_0x4ec38d,null));};exports['describe']=function(_0xf058,_0x594dbe){return db['FaxQueue'][_0x06b2('0x57')]()[_0x06b2('0x28')](respondWithResult(_0x594dbe,null))[_0x06b2('0x4b')](handleError(_0x594dbe,null));};exports[_0x06b2('0x58')]=function(_0x2b2de5,_0x388d8b,_0x513650){var _0x119096={'raw':!![],'where':{}},_0x1cd62a={},_0x5b9293;return db[_0x06b2('0x32')][_0x06b2('0x59')]({'where':{'id':_0x2b2de5[_0x06b2('0x4d')]['id']}})[_0x06b2('0x28')](handleEntityNotFound(_0x388d8b,null))[_0x06b2('0x28')](function(_0x22f805){if(_0x22f805){_0x5b9293=_0x22f805[_0x06b2('0x2a')]({'plain':!![]});_0x1cd62a[_0x06b2('0x37')]=_[_0x06b2('0x39')](db[_0x06b2('0x5a')][_0x06b2('0x33')]);_0x1cd62a[_0x06b2('0x38')]=_['keys'](_0x2b2de5[_0x06b2('0x38')]);_0x1cd62a[_0x06b2('0x41')]=_['intersection'](_0x1cd62a[_0x06b2('0x37')],_0x1cd62a[_0x06b2('0x38')]);_0x119096[_0x06b2('0x3b')]=_[_0x06b2('0x3a')](_0x1cd62a['model'],qs[_0x06b2('0x3c')](_0x2b2de5[_0x06b2('0x38')][_0x06b2('0x3c')]));_0x119096['attributes']=_0x119096[_0x06b2('0x3b')][_0x06b2('0x3d')]?_0x119096[_0x06b2('0x3b')]:_0x1cd62a[_0x06b2('0x37')];if(!_0x2b2de5[_0x06b2('0x38')][_0x06b2('0x3e')](_0x06b2('0x3f'))){_0x119096[_0x06b2('0x22')]=qs[_0x06b2('0x22')](_0x2b2de5['query']['limit']);_0x119096['offset']=qs['offset'](_0x2b2de5[_0x06b2('0x38')]['offset']);}_0x119096[_0x06b2('0x40')]=qs[_0x06b2('0x5b')](_0x2b2de5[_0x06b2('0x38')][_0x06b2('0x5b')]);_0x119096[_0x06b2('0x43')]=qs[_0x06b2('0x41')](_['pick'](_0x2b2de5['query'],_0x1cd62a[_0x06b2('0x41')]));_0x119096[_0x06b2('0x43')]['FaxQueueId']=_0x22f805['id'];if(_0x2b2de5[_0x06b2('0x38')][_0x06b2('0x42')]){_0x119096[_0x06b2('0x43')]=_[_0x06b2('0x44')](_0x119096[_0x06b2('0x43')],{'$or':_[_0x06b2('0x5c')](_0x119096['attributes'],function(_0xac591a){var _0x52de0b={};_0x52de0b[_0xac591a]={'$like':'%'+_0x2b2de5[_0x06b2('0x38')][_0x06b2('0x42')]+'%'};return _0x52de0b;})});}_0x119096=_[_0x06b2('0x44')]({},_0x119096,_0x2b2de5['options']);return db[_0x06b2('0x5a')][_0x06b2('0x49')](_0x119096);}})[_0x06b2('0x28')](function(_0x4cc763){if(_0x4cc763){return db[_0x06b2('0x5d')]['findAndCountAll']({'where':{'id':_[_0x06b2('0x5c')](_0x4cc763,_0x06b2('0x5e')),'role':_0x06b2('0x5f')},'attributes':['id',_0x06b2('0x2f'),_0x06b2('0x60'),_0x06b2('0x61'),'createdAt']});}})[_0x06b2('0x28')](function(_0x711305){if(_0x711305){return{'count':_0x711305[_0x06b2('0x20')],'rows':_[_0x06b2('0x5c')](_0x711305['rows'],function(_0x10f7ff){return{'membername':_0x10f7ff[_0x06b2('0x2f')],'UserId':_0x10f7ff['id'],'queue_name':_0x5b9293[_0x06b2('0x2f')],'FaxQueueId':_0x5b9293['id'],'interface':util['format']('%s/%s',_0x06b2('0x62'),_0x10f7ff['name']),'penalty':0x0,'paused':_0x10f7ff[_0x06b2('0x60')],'createdAt':_0x10f7ff['createdAt'],'updatedAt':_0x10f7ff['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x06b2('0x28')](respondWithFilteredResult(_0x388d8b,_0x119096))[_0x06b2('0x4b')](handleError(_0x388d8b,null));};exports['getTeams']=function(_0x181ca6,_0x15f107,_0x206d66){var _0x305c36={};var _0x2cf618={};var _0x3542b4;var _0x44ad45;return db[_0x06b2('0x32')][_0x06b2('0x59')]({'where':{'id':_0x181ca6[_0x06b2('0x4d')]['id']}})[_0x06b2('0x28')](handleEntityNotFound(_0x15f107,null))['then'](function(_0x8fdc8f){if(_0x8fdc8f){_0x3542b4=_0x8fdc8f;_0x2cf618['model']=_['keys'](db[_0x06b2('0x63')][_0x06b2('0x33')]);_0x2cf618['query']=_[_0x06b2('0x39')](_0x181ca6[_0x06b2('0x38')]);_0x2cf618[_0x06b2('0x41')]=_['intersection'](_0x2cf618[_0x06b2('0x37')],_0x2cf618[_0x06b2('0x38')]);_0x305c36['attributes']=_['intersection'](_0x2cf618['model'],qs['fields'](_0x181ca6[_0x06b2('0x38')]['fields']));_0x305c36[_0x06b2('0x3b')]=_0x305c36[_0x06b2('0x3b')][_0x06b2('0x3d')]?_0x305c36[_0x06b2('0x3b')]:_0x2cf618[_0x06b2('0x37')];_0x305c36[_0x06b2('0x40')]=qs[_0x06b2('0x5b')](_0x181ca6[_0x06b2('0x38')][_0x06b2('0x5b')]);_0x305c36[_0x06b2('0x43')]=qs[_0x06b2('0x41')](_[_0x06b2('0x64')](_0x181ca6[_0x06b2('0x38')],_0x2cf618['filters']));if(_0x181ca6['query'][_0x06b2('0x42')]){_0x305c36[_0x06b2('0x43')]=_[_0x06b2('0x44')](_0x305c36[_0x06b2('0x43')],{'$or':_[_0x06b2('0x5c')](_0x305c36[_0x06b2('0x3b')],function(_0x4af991){var _0x576add={};_0x576add[_0x4af991]={'$like':'%'+_0x181ca6[_0x06b2('0x38')][_0x06b2('0x42')]+'%'};return _0x576add;})});}_0x305c36=_[_0x06b2('0x44')]({},_0x305c36,_0x181ca6[_0x06b2('0x46')]);return _0x3542b4[_0x06b2('0x65')](_0x305c36);}})['then'](function(_0x13d01b){if(_0x13d01b){_0x44ad45=_0x13d01b['length'];if(!_0x181ca6['query'][_0x06b2('0x3e')](_0x06b2('0x3f'))){_0x305c36['limit']=qs['limit'](_0x181ca6[_0x06b2('0x38')][_0x06b2('0x22')]);_0x305c36['offset']=qs['offset'](_0x181ca6['query']['offset']);}return _0x3542b4[_0x06b2('0x65')](_0x305c36);}})[_0x06b2('0x28')](function(_0x1bcb96){if(_0x1bcb96){return _0x1bcb96?{'count':_0x44ad45,'rows':_0x1bcb96}:null;}})[_0x06b2('0x28')](respondWithResult(_0x15f107,null))[_0x06b2('0x4b')](handleError(_0x15f107,null));};exports[_0x06b2('0x66')]=function(_0x23fd76,_0x10e6ef,_0x23696d){var _0x39131e=_0x23fd76[_0x06b2('0x4f')][_0x06b2('0x67')];return db[_0x06b2('0x63')][_0x06b2('0x49')]({'where':{'id':_0x39131e},'attributes':['id'],'include':[{'model':db[_0x06b2('0x5d')],'as':_0x06b2('0x68'),'attributes':['id',_0x06b2('0x2f'),_0x06b2('0x69'),_0x06b2('0x6a'),_0x06b2('0x6b')],'raw':!![]}]})[_0x06b2('0x28')](function(_0x7ddad4){if(_0x7ddad4){var _0x5d96ef=_[_0x06b2('0x6c')](_0x7ddad4,function(_0x41734d){var _0xe302e0=_0x41734d[_0x06b2('0x2a')]({'plain':!![]});return _0xe302e0[_0x06b2('0x68')];});return db[_0x06b2('0x32')]['find']({'where':{'id':_0x23fd76[_0x06b2('0x4d')]['id']}})[_0x06b2('0x28')](function(_0x2dc957){return db[_0x06b2('0x6d')]['transaction'](function(_0x13d0b9){return _0x2dc957[_0x06b2('0x66')](_0x39131e,{'transaction':_0x13d0b9})['then'](function(){return BPromise['each'](_0x5d96ef,function(_0x144dc8){return db[_0x06b2('0x5a')][_0x06b2('0x6e')]({'where':{'UserId':_0x144dc8['id'],'FaxQueueId':_0x23fd76[_0x06b2('0x4d')]['id']},'transaction':_0x13d0b9});});})[_0x06b2('0x28')](function(){_0x5d96ef[_0x06b2('0x6f')](function(_0x1f5ad9){socket['emit'](_0x06b2('0x70'),{'UserId':_0x1f5ad9['id'],'FaxQueueId':_0x2dc957['id']});});});});});}})[_0x06b2('0x28')](respondWithStatusCode(_0x10e6ef,null))[_0x06b2('0x4b')](handleError(_0x10e6ef,null));};exports['removeTeams']=function(_0x2e7003,_0x3835b9,_0x5afcbb){return db[_0x06b2('0x63')][_0x06b2('0x49')]({'where':{'id':_0x2e7003['query'][_0x06b2('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x06b2('0x68'),'attributes':['id'],'raw':!![]}]})[_0x06b2('0x28')](handleEntityNotFound(_0x3835b9,null))['then'](function(_0x3c87fd){var _0x4f52b7=_[_0x06b2('0x5c')](_0x3c87fd,'id');var _0x26c08d=[];var _0x59acb9=[];var _0x2da4ee=squel[_0x06b2('0x71')]();_0x2da4ee['field'](_0x06b2('0x72'))['from'](_0x06b2('0x73'),'tq')[_0x06b2('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x06b2('0x43')](_0x06b2('0x75'),_0x2e7003[_0x06b2('0x4d')]['id']);for(var _0x270235=0x0;_0x270235<_0x3c87fd[_0x06b2('0x3d')];_0x270235+=0x1){let _0x3ef258=_0x3c87fd[_0x270235];for(var _0x2d9173=0x0;_0x2d9173<_0x3ef258['Agents']['length'];_0x2d9173+=0x1){let _0x2e5545=_0x3ef258[_0x06b2('0x68')][_0x2d9173];var _0xa66c9d=_0x2da4ee['clone']();_0xa66c9d['where'](_0x06b2('0x76'),_0x2e5545['id']);_0x59acb9[_0x06b2('0x77')](db[_0x06b2('0x6d')][_0x06b2('0x38')](_0xa66c9d['toString'](),{'type':db['sequelize'][_0x06b2('0x78')][_0x06b2('0x79')]})[_0x06b2('0x28')](function(_0x438683){if(_0x438683[_0x06b2('0x3d')]===0x1){return _0x2e5545['id'];}else{var _0x3bb224=_['every'](_[_0x06b2('0x5c')](_0x438683,_0x06b2('0x7a')),function(_0x4434b7){return _['includes'](_0x4f52b7,_0x4434b7);});if(_0x3bb224){return _0x2e5545['id'];}}}));}}return BPromise[_0x06b2('0x7b')](_0x59acb9)[_0x06b2('0x28')](function(_0x4b7fcf){_0x26c08d=_(_0x26c08d)[_0x06b2('0x7c')](_0x4b7fcf)['compact']()[_0x06b2('0x7d')]();return db['FaxQueue'][_0x06b2('0x54')]({'where':{'id':_0x2e7003[_0x06b2('0x4d')]['id']}})['then'](function(_0x27dccd){return db['sequelize'][_0x06b2('0x7e')](function(_0x5e0ba2){return _0x27dccd[_0x06b2('0x7f')](_0x2e7003[_0x06b2('0x38')][_0x06b2('0x67')],{'transaction':_0x5e0ba2})[_0x06b2('0x28')](function(){if(!_[_0x06b2('0x80')](_0x26c08d)){return _0x27dccd[_0x06b2('0x81')](_0x26c08d,{'transaction':_0x5e0ba2});}})[_0x06b2('0x28')](function(){_0x26c08d[_0x06b2('0x6f')](function(_0x4d9356){socket['emit'](_0x06b2('0x82'),{'UserId':_0x4d9356,'FaxQueueId':_0x27dccd['id']});});});});});});})[_0x06b2('0x28')](respondWithStatusCode(_0x3835b9,null))[_0x06b2('0x4b')](handleError(_0x3835b9,null));};exports['addAgents']=function(_0x184dac,_0x267a6d,_0x37e24c){return db[_0x06b2('0x32')]['find']({'where':{'id':_0x184dac['params']['id']}})[_0x06b2('0x28')](handleEntityNotFound(_0x267a6d,null))[_0x06b2('0x28')](function(_0x4c96f2){if(_0x4c96f2){return _0x4c96f2['addAgents'](_0x184dac[_0x06b2('0x4f')][_0x06b2('0x67')],_[_0x06b2('0x83')](_0x184dac[_0x06b2('0x4f')],[_0x06b2('0x67'),'id'])||{})[_0x06b2('0x84')](function(_0x8290f7){for(var _0x4e4622=0x0;_0x4e4622<_0x184dac[_0x06b2('0x4f')]['ids'][_0x06b2('0x3d')];_0x4e4622+=0x1){socket[_0x06b2('0x85')](_0x06b2('0x70'),{'UserId':_0x184dac[_0x06b2('0x4f')]['ids'][_0x4e4622],'FaxQueueId':_0x184dac[_0x06b2('0x4d')]['id']});}return _0x8290f7;});}})['then'](respondWithResult(_0x267a6d,null))[_0x06b2('0x4b')](handleError(_0x267a6d,null));};exports[_0x06b2('0x81')]=function(_0x2afe72,_0x1c8c4f,_0x385196){return db[_0x06b2('0x32')][_0x06b2('0x54')]({'where':{'id':_0x2afe72['params']['id']}})['then'](handleEntityNotFound(_0x1c8c4f,null))['then'](function(_0x4e39d7){if(_0x4e39d7){return _0x4e39d7[_0x06b2('0x81')](_0x2afe72['query'][_0x06b2('0x67')])[_0x06b2('0x28')](function(){if(_[_0x06b2('0x86')](_0x2afe72[_0x06b2('0x38')]['ids'])){for(var _0x4bf38c=0x0;_0x4bf38c<_0x2afe72[_0x06b2('0x38')][_0x06b2('0x67')][_0x06b2('0x3d')];_0x4bf38c+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x2afe72[_0x06b2('0x38')][_0x06b2('0x67')][_0x4bf38c]),'FaxQueueId':Number(_0x2afe72['params']['id'])});}}else{socket[_0x06b2('0x85')](_0x06b2('0x82'),{'UserId':Number(_0x2afe72[_0x06b2('0x38')][_0x06b2('0x67')]),'FaxQueueId':Number(_0x2afe72[_0x06b2('0x4d')]['id'])});}});}})[_0x06b2('0x28')](respondWithStatusCode(_0x1c8c4f,null))[_0x06b2('0x4b')](handleError(_0x1c8c4f,null));};exports[_0x06b2('0x87')]=function(_0x2d7a37,_0x270c0d,_0x4b1465){var _0x32c6f2={};var _0x12a3ae={};var _0x531e29;var _0x100b5d;return db[_0x06b2('0x32')][_0x06b2('0x59')]({'where':{'id':_0x2d7a37[_0x06b2('0x4d')]['id']}})[_0x06b2('0x28')](handleEntityNotFound(_0x270c0d,null))[_0x06b2('0x28')](function(_0x4cca27){if(_0x4cca27){_0x531e29=_0x4cca27;_0x12a3ae[_0x06b2('0x37')]=_['keys'](db[_0x06b2('0x5d')][_0x06b2('0x33')]);_0x12a3ae['query']=_[_0x06b2('0x39')](_0x2d7a37['query']);_0x12a3ae[_0x06b2('0x41')]=_[_0x06b2('0x3a')](_0x12a3ae[_0x06b2('0x37')],_0x12a3ae['query']);_0x32c6f2[_0x06b2('0x3b')]=_['intersection'](_0x12a3ae[_0x06b2('0x37')],qs['fields'](_0x2d7a37[_0x06b2('0x38')]['fields']));_0x32c6f2[_0x06b2('0x3b')]=_0x32c6f2['attributes'][_0x06b2('0x3d')]?_0x32c6f2[_0x06b2('0x3b')]:_0x12a3ae['model'];_0x32c6f2[_0x06b2('0x40')]=qs[_0x06b2('0x5b')](_0x2d7a37[_0x06b2('0x38')][_0x06b2('0x5b')]);_0x32c6f2['where']=qs[_0x06b2('0x41')](_[_0x06b2('0x64')](_0x2d7a37[_0x06b2('0x38')],_0x12a3ae[_0x06b2('0x41')]));if(_0x2d7a37['query'][_0x06b2('0x42')]){_0x32c6f2['where']=_[_0x06b2('0x44')](_0x32c6f2['where'],{'$or':_['map'](_0x32c6f2[_0x06b2('0x3b')],function(_0x3cf76e){var _0x120069={};_0x120069[_0x3cf76e]={'$like':'%'+_0x2d7a37[_0x06b2('0x38')]['filter']+'%'};return _0x120069;})});}_0x32c6f2=_[_0x06b2('0x44')]({},_0x32c6f2,_0x2d7a37[_0x06b2('0x46')]);return _0x531e29[_0x06b2('0x87')](_0x32c6f2);}})[_0x06b2('0x28')](function(_0x21e56e){if(_0x21e56e){_0x100b5d=_0x21e56e[_0x06b2('0x3d')];if(!_0x2d7a37[_0x06b2('0x38')][_0x06b2('0x3e')](_0x06b2('0x3f'))){_0x32c6f2[_0x06b2('0x22')]=qs[_0x06b2('0x22')](_0x2d7a37[_0x06b2('0x38')][_0x06b2('0x22')]);_0x32c6f2[_0x06b2('0x21')]=qs[_0x06b2('0x21')](_0x2d7a37[_0x06b2('0x38')][_0x06b2('0x21')]);}return _0x531e29[_0x06b2('0x87')](_0x32c6f2);}})[_0x06b2('0x28')](function(_0x2e6e4f){if(_0x2e6e4f){return _0x2e6e4f?{'count':_0x100b5d,'rows':_0x2e6e4f}:null;}})[_0x06b2('0x28')](respondWithResult(_0x270c0d,null))[_0x06b2('0x4b')](handleError(_0x270c0d,null));}; \ No newline at end of file +var _0x2fc9=['UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','forEach','userFaxQueue:save','Team','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','end','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','params','describe','getMembers','findOne'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x2fc9,0xc2));var _0x92fc=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x2fc9[_0xf73c09];return _0xa8923c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x92fc('0x0'));var rimraf=require(_0x92fc('0x1'));var zipdir=require(_0x92fc('0x2'));var jsonpatch=require(_0x92fc('0x3'));var rp=require(_0x92fc('0x4'));var moment=require(_0x92fc('0x5'));var BPromise=require(_0x92fc('0x6'));var Mustache=require(_0x92fc('0x7'));var util=require(_0x92fc('0x8'));var path=require(_0x92fc('0x9'));var sox=require(_0x92fc('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x92fc('0xb'));var crypto=require(_0x92fc('0xc'));var jsforce=require(_0x92fc('0xd'));var deskjs=require(_0x92fc('0xe'));var toCsv=require(_0x92fc('0xf'));var querystring=require(_0x92fc('0x10'));var Papa=require(_0x92fc('0x11'));var Redis=require('ioredis');var authService=require(_0x92fc('0x12'));var qs=require(_0x92fc('0x13'));var as=require(_0x92fc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92fc('0x15'))(_0x92fc('0x16'));var utils=require(_0x92fc('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x92fc('0x18')]=_[_0x92fc('0x19')](config['redis'],{'host':_0x92fc('0x1a'),'port':0x18eb});var socket=require(_0x92fc('0x1b'))(new Redis(config[_0x92fc('0x18')]));require(_0x92fc('0x1c'))[_0x92fc('0x1d')](socket);function respondWithStatusCode(_0x5a2ecc,_0x4007c8){_0x4007c8=_0x4007c8||0xcc;return function(_0x145a52){if(_0x145a52){return _0x5a2ecc[_0x92fc('0x1e')](_0x4007c8);}return _0x5a2ecc[_0x92fc('0x1f')](_0x4007c8)['end']();};}function respondWithResult(_0x4c45f3,_0x111f42){_0x111f42=_0x111f42||0xc8;return function(_0x6de681){if(_0x6de681){return _0x4c45f3['status'](_0x111f42)[_0x92fc('0x20')](_0x6de681);}};}function respondWithFilteredResult(_0x1eb0ec,_0x90f874){return function(_0x586f3e){if(_0x586f3e){var _0x2b0229=_0x586f3e[_0x92fc('0x21')],_0x346ee8=_0x90f874[_0x92fc('0x22')],_0x3a1071=_0x90f874[_0x92fc('0x22')]+_0x90f874[_0x92fc('0x23')],_0x2602f7;if(_0x3a1071>=_0x2b0229){_0x3a1071=_0x2b0229;_0x2602f7=0xc8;}else{_0x2602f7=0xce;}_0x1eb0ec['status'](_0x2602f7);return _0x1eb0ec[_0x92fc('0x24')]('Content-Range',_0x346ee8+'-'+_0x3a1071+'/'+_0x2b0229)[_0x92fc('0x20')](_0x586f3e);}return null;};}function patchUpdates(_0x2cc51d){return function(_0xc0057f){try{jsonpatch[_0x92fc('0x25')](_0xc0057f,_0x2cc51d,!![]);}catch(_0x35d40e){return BPromise[_0x92fc('0x26')](_0x35d40e);}return _0xc0057f[_0x92fc('0x27')]();};}function saveUpdates(_0x5d5c29,_0x22763f){return function(_0x1ffa73){if(_0x1ffa73){return _0x1ffa73[_0x92fc('0x28')](_0x5d5c29)['then'](function(_0x29e986){return _0x29e986;});}return null;};}function removeEntity(_0x442576,_0x3d06d5){return function(_0x56d955){if(_0x56d955){return _0x56d955[_0x92fc('0x29')]()[_0x92fc('0x2a')](function(){var _0x360a83=_0x56d955[_0x92fc('0x2b')]({'plain':!![]});var _0x131546=_0x92fc('0x2c');return db[_0x92fc('0x2d')][_0x92fc('0x29')]({'where':{'type':_0x131546,'resourceId':_0x360a83['id']}})[_0x92fc('0x2a')](function(){return _0x56d955;});})[_0x92fc('0x2a')](function(){_0x442576[_0x92fc('0x1f')](0xcc)[_0x92fc('0x2e')]();});}};}function handleEntityNotFound(_0x215e98,_0x4ef103){return function(_0x373851){if(!_0x373851){_0x215e98[_0x92fc('0x1e')](0x194);}return _0x373851;};}function handleError(_0x217cf3,_0x391c71){_0x391c71=_0x391c71||0x1f4;return function(_0x7cb643){logger[_0x92fc('0x2f')](_0x7cb643[_0x92fc('0x30')]);if(_0x7cb643['name']){delete _0x7cb643[_0x92fc('0x31')];}_0x217cf3[_0x92fc('0x1f')](_0x391c71)[_0x92fc('0x32')](_0x7cb643);};}exports['index']=function(_0x620ff,_0x1607ab){var _0x416dfe={},_0x265b38={},_0x44e0cb={'count':0x0,'rows':[]};var _0x583353=_[_0x92fc('0x33')](db[_0x92fc('0x34')][_0x92fc('0x35')],function(_0x58410f){return{'name':_0x58410f[_0x92fc('0x36')],'type':_0x58410f[_0x92fc('0x37')][_0x92fc('0x38')]};});_0x265b38[_0x92fc('0x39')]=_[_0x92fc('0x33')](_0x583353,'name');_0x265b38[_0x92fc('0x3a')]=_[_0x92fc('0x3b')](_0x620ff[_0x92fc('0x3a')]);_0x265b38[_0x92fc('0x3c')]=_['intersection'](_0x265b38[_0x92fc('0x39')],_0x265b38['query']);_0x416dfe['attributes']=_[_0x92fc('0x3d')](_0x265b38[_0x92fc('0x39')],qs[_0x92fc('0x3e')](_0x620ff[_0x92fc('0x3a')][_0x92fc('0x3e')]));_0x416dfe['attributes']=_0x416dfe[_0x92fc('0x3f')][_0x92fc('0x40')]?_0x416dfe[_0x92fc('0x3f')]:_0x265b38[_0x92fc('0x39')];if(!_0x620ff['query'][_0x92fc('0x41')](_0x92fc('0x42'))){_0x416dfe[_0x92fc('0x23')]=qs[_0x92fc('0x23')](_0x620ff[_0x92fc('0x3a')][_0x92fc('0x23')]);_0x416dfe[_0x92fc('0x22')]=qs['offset'](_0x620ff['query']['offset']);}_0x416dfe[_0x92fc('0x43')]=qs[_0x92fc('0x44')](_0x620ff[_0x92fc('0x3a')]['sort']);_0x416dfe[_0x92fc('0x45')]=qs[_0x92fc('0x3c')](_[_0x92fc('0x46')](_0x620ff[_0x92fc('0x3a')],_0x265b38['filters']));if(_0x620ff[_0x92fc('0x3a')][_0x92fc('0x47')]){_0x416dfe['where']=_['merge'](_0x416dfe['where'],{'$or':_[_0x92fc('0x33')](_0x583353,function(_0x2e0e82){if(_0x2e0e82[_0x92fc('0x37')]!=='VIRTUAL'){var _0x1d9a1d={};_0x1d9a1d[_0x2e0e82['name']]={'$like':'%'+_0x620ff[_0x92fc('0x3a')][_0x92fc('0x47')]+'%'};return _0x1d9a1d;}})});}_0x416dfe=_[_0x92fc('0x48')]({},_0x416dfe,_0x620ff[_0x92fc('0x49')]);var _0x57e56b={'where':_0x416dfe[_0x92fc('0x45')]};return db[_0x92fc('0x34')][_0x92fc('0x21')](_0x57e56b)[_0x92fc('0x2a')](function(_0x5831f4){_0x44e0cb[_0x92fc('0x21')]=_0x5831f4;if(_0x620ff['query'][_0x92fc('0x4a')]){_0x416dfe[_0x92fc('0x4b')]=[{'all':!![]}];}return db['FaxQueue'][_0x92fc('0x4c')](_0x416dfe);})[_0x92fc('0x2a')](function(_0x394bc4){_0x44e0cb[_0x92fc('0x4d')]=_0x394bc4;return _0x44e0cb;})[_0x92fc('0x2a')](respondWithFilteredResult(_0x1607ab,_0x416dfe))[_0x92fc('0x4e')](handleError(_0x1607ab,null));};exports[_0x92fc('0x4f')]=function(_0x156bda,_0x4bf144){var _0x2c93f0={'raw':!![],'where':{'id':_0x156bda['params']['id']}},_0xecf38c={};_0xecf38c[_0x92fc('0x39')]=_[_0x92fc('0x3b')](db[_0x92fc('0x34')][_0x92fc('0x35')]);_0xecf38c[_0x92fc('0x3a')]=_[_0x92fc('0x3b')](_0x156bda['query']);_0xecf38c['filters']=_[_0x92fc('0x3d')](_0xecf38c[_0x92fc('0x39')],_0xecf38c[_0x92fc('0x3a')]);_0x2c93f0[_0x92fc('0x3f')]=_[_0x92fc('0x3d')](_0xecf38c[_0x92fc('0x39')],qs[_0x92fc('0x3e')](_0x156bda['query'][_0x92fc('0x3e')]));_0x2c93f0[_0x92fc('0x3f')]=_0x2c93f0[_0x92fc('0x3f')][_0x92fc('0x40')]?_0x2c93f0['attributes']:_0xecf38c[_0x92fc('0x39')];if(_0x156bda[_0x92fc('0x3a')][_0x92fc('0x4a')]){_0x2c93f0[_0x92fc('0x4b')]=[{'all':!![]}];}_0x2c93f0=_['merge']({},_0x2c93f0,_0x156bda['options']);return db[_0x92fc('0x34')]['find'](_0x2c93f0)[_0x92fc('0x2a')](handleEntityNotFound(_0x4bf144,null))[_0x92fc('0x2a')](respondWithResult(_0x4bf144,null))[_0x92fc('0x4e')](handleError(_0x4bf144,null));};exports[_0x92fc('0x50')]=function(_0xd6b09d,_0xa2ce94){return db[_0x92fc('0x34')]['create'](_0xd6b09d[_0x92fc('0x51')],{})[_0x92fc('0x2a')](function(_0x538565){var _0x28ad1c=_0xd6b09d['user'][_0x92fc('0x2b')]({'plain':!![]});if(!_0x28ad1c)throw new Error(_0x92fc('0x52'));if(_0x28ad1c['role']==='user'){var _0x2cbfc4=_0x538565[_0x92fc('0x2b')]({'plain':!![]});var _0x3481b4=_0x92fc('0x2c');return db['UserProfileSection'][_0x92fc('0x53')]({'where':{'name':_0x3481b4,'userProfileId':_0x28ad1c[_0x92fc('0x54')]},'raw':!![]})[_0x92fc('0x2a')](function(_0x2e64d2){if(_0x2e64d2&&_0x2e64d2[_0x92fc('0x55')]===0x0){return db[_0x92fc('0x2d')]['create']({'name':_0x2cbfc4['name'],'resourceId':_0x2cbfc4['id'],'type':_0x2e64d2['name'],'sectionId':_0x2e64d2['id']},{})[_0x92fc('0x2a')](function(){return _0x538565;});}else{return _0x538565;}})[_0x92fc('0x4e')](function(_0x4dfb60){logger[_0x92fc('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dfb60);throw _0x4dfb60;});}return _0x538565;})['then'](respondWithResult(_0xa2ce94,0xc9))[_0x92fc('0x4e')](handleError(_0xa2ce94,null));};exports[_0x92fc('0x28')]=function(_0x24e0da,_0xbfe12){if(_0x24e0da[_0x92fc('0x51')]['id']){delete _0x24e0da[_0x92fc('0x51')]['id'];}return db[_0x92fc('0x34')][_0x92fc('0x53')]({'where':{'id':_0x24e0da[_0x92fc('0x56')]['id']}})['then'](handleEntityNotFound(_0xbfe12,null))['then'](saveUpdates(_0x24e0da[_0x92fc('0x51')],null))[_0x92fc('0x2a')](respondWithResult(_0xbfe12,null))[_0x92fc('0x4e')](handleError(_0xbfe12,null));};exports['destroy']=function(_0x3829b2,_0x5e5b77){return db[_0x92fc('0x34')][_0x92fc('0x53')]({'where':{'id':_0x3829b2[_0x92fc('0x56')]['id']}})['then'](handleEntityNotFound(_0x5e5b77,null))['then'](removeEntity(_0x5e5b77,null))['catch'](handleError(_0x5e5b77,null));};exports[_0x92fc('0x57')]=function(_0x5bfad0,_0x345807){return db[_0x92fc('0x34')]['describe']()[_0x92fc('0x2a')](respondWithResult(_0x345807,null))[_0x92fc('0x4e')](handleError(_0x345807,null));};exports[_0x92fc('0x58')]=function(_0x35ca7e,_0x3a6a38,_0x181dc4){var _0x34d9cc={'raw':!![],'where':{}},_0x448797={},_0x7b57c4;return db[_0x92fc('0x34')][_0x92fc('0x59')]({'where':{'id':_0x35ca7e[_0x92fc('0x56')]['id']}})[_0x92fc('0x2a')](handleEntityNotFound(_0x3a6a38,null))['then'](function(_0x3ef611){if(_0x3ef611){_0x7b57c4=_0x3ef611['get']({'plain':!![]});_0x448797[_0x92fc('0x39')]=_['keys'](db['UserFaxQueue'][_0x92fc('0x35')]);_0x448797['query']=_[_0x92fc('0x3b')](_0x35ca7e['query']);_0x448797['filters']=_[_0x92fc('0x3d')](_0x448797[_0x92fc('0x39')],_0x448797[_0x92fc('0x3a')]);_0x34d9cc[_0x92fc('0x3f')]=_[_0x92fc('0x3d')](_0x448797[_0x92fc('0x39')],qs[_0x92fc('0x3e')](_0x35ca7e[_0x92fc('0x3a')]['fields']));_0x34d9cc['attributes']=_0x34d9cc[_0x92fc('0x3f')][_0x92fc('0x40')]?_0x34d9cc[_0x92fc('0x3f')]:_0x448797[_0x92fc('0x39')];if(!_0x35ca7e[_0x92fc('0x3a')][_0x92fc('0x41')](_0x92fc('0x42'))){_0x34d9cc['limit']=qs['limit'](_0x35ca7e[_0x92fc('0x3a')][_0x92fc('0x23')]);_0x34d9cc[_0x92fc('0x22')]=qs[_0x92fc('0x22')](_0x35ca7e[_0x92fc('0x3a')][_0x92fc('0x22')]);}_0x34d9cc[_0x92fc('0x43')]=qs[_0x92fc('0x44')](_0x35ca7e[_0x92fc('0x3a')][_0x92fc('0x44')]);_0x34d9cc[_0x92fc('0x45')]=qs[_0x92fc('0x3c')](_[_0x92fc('0x46')](_0x35ca7e[_0x92fc('0x3a')],_0x448797['filters']));_0x34d9cc[_0x92fc('0x45')]['FaxQueueId']=_0x3ef611['id'];if(_0x35ca7e['query'][_0x92fc('0x47')]){_0x34d9cc[_0x92fc('0x45')]=_[_0x92fc('0x48')](_0x34d9cc[_0x92fc('0x45')],{'$or':_[_0x92fc('0x33')](_0x34d9cc[_0x92fc('0x3f')],function(_0x5148a0){var _0xdf6a47={};_0xdf6a47[_0x5148a0]={'$like':'%'+_0x35ca7e['query'][_0x92fc('0x47')]+'%'};return _0xdf6a47;})});}_0x34d9cc=_[_0x92fc('0x48')]({},_0x34d9cc,_0x35ca7e[_0x92fc('0x49')]);return db[_0x92fc('0x5a')][_0x92fc('0x4c')](_0x34d9cc);}})[_0x92fc('0x2a')](function(_0x4fc7a5){if(_0x4fc7a5){return db[_0x92fc('0x5b')][_0x92fc('0x5c')]({'where':{'id':_[_0x92fc('0x33')](_0x4fc7a5,_0x92fc('0x5d')),'role':_0x92fc('0x5e')},'attributes':['id','name',_0x92fc('0x5f'),_0x92fc('0x60'),_0x92fc('0x61')]});}})[_0x92fc('0x2a')](function(_0x4149bb){if(_0x4149bb){return{'count':_0x4149bb[_0x92fc('0x21')],'rows':_[_0x92fc('0x33')](_0x4149bb['rows'],function(_0x33376e){return{'membername':_0x33376e['name'],'UserId':_0x33376e['id'],'queue_name':_0x7b57c4[_0x92fc('0x31')],'FaxQueueId':_0x7b57c4['id'],'interface':util[_0x92fc('0x62')](_0x92fc('0x63'),'SIP',_0x33376e[_0x92fc('0x31')]),'penalty':0x0,'paused':_0x33376e[_0x92fc('0x5f')],'createdAt':_0x33376e[_0x92fc('0x61')],'updatedAt':_0x33376e[_0x92fc('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a6a38,_0x34d9cc))['catch'](handleError(_0x3a6a38,null));};exports['getTeams']=function(_0x38a2c1,_0x2cdd48,_0x377750){var _0x18950a={};var _0x42af25={};var _0x3639a7;var _0x3ea483;return db[_0x92fc('0x34')][_0x92fc('0x59')]({'where':{'id':_0x38a2c1[_0x92fc('0x56')]['id']}})['then'](handleEntityNotFound(_0x2cdd48,null))[_0x92fc('0x2a')](function(_0x15a94d){if(_0x15a94d){_0x3639a7=_0x15a94d;_0x42af25[_0x92fc('0x39')]=_[_0x92fc('0x3b')](db['Team'][_0x92fc('0x35')]);_0x42af25[_0x92fc('0x3a')]=_[_0x92fc('0x3b')](_0x38a2c1['query']);_0x42af25['filters']=_[_0x92fc('0x3d')](_0x42af25[_0x92fc('0x39')],_0x42af25[_0x92fc('0x3a')]);_0x18950a[_0x92fc('0x3f')]=_[_0x92fc('0x3d')](_0x42af25[_0x92fc('0x39')],qs[_0x92fc('0x3e')](_0x38a2c1[_0x92fc('0x3a')]['fields']));_0x18950a[_0x92fc('0x3f')]=_0x18950a[_0x92fc('0x3f')][_0x92fc('0x40')]?_0x18950a[_0x92fc('0x3f')]:_0x42af25[_0x92fc('0x39')];_0x18950a[_0x92fc('0x43')]=qs[_0x92fc('0x44')](_0x38a2c1[_0x92fc('0x3a')]['sort']);_0x18950a[_0x92fc('0x45')]=qs['filters'](_['pick'](_0x38a2c1[_0x92fc('0x3a')],_0x42af25[_0x92fc('0x3c')]));if(_0x38a2c1[_0x92fc('0x3a')]['filter']){_0x18950a[_0x92fc('0x45')]=_['merge'](_0x18950a[_0x92fc('0x45')],{'$or':_[_0x92fc('0x33')](_0x18950a[_0x92fc('0x3f')],function(_0x38e893){var _0x3b7437={};_0x3b7437[_0x38e893]={'$like':'%'+_0x38a2c1[_0x92fc('0x3a')][_0x92fc('0x47')]+'%'};return _0x3b7437;})});}_0x18950a=_[_0x92fc('0x48')]({},_0x18950a,_0x38a2c1['options']);return _0x3639a7[_0x92fc('0x64')](_0x18950a);}})[_0x92fc('0x2a')](function(_0x22030b){if(_0x22030b){_0x3ea483=_0x22030b['length'];if(!_0x38a2c1[_0x92fc('0x3a')][_0x92fc('0x41')](_0x92fc('0x42'))){_0x18950a[_0x92fc('0x23')]=qs['limit'](_0x38a2c1[_0x92fc('0x3a')]['limit']);_0x18950a['offset']=qs['offset'](_0x38a2c1[_0x92fc('0x3a')][_0x92fc('0x22')]);}return _0x3639a7['getTeams'](_0x18950a);}})[_0x92fc('0x2a')](function(_0x4bdf7a){if(_0x4bdf7a){return _0x4bdf7a?{'count':_0x3ea483,'rows':_0x4bdf7a}:null;}})[_0x92fc('0x2a')](respondWithResult(_0x2cdd48,null))[_0x92fc('0x4e')](handleError(_0x2cdd48,null));};exports[_0x92fc('0x65')]=function(_0x223488,_0x363fc1,_0x4c841b){var _0x572aa0=_0x223488[_0x92fc('0x51')][_0x92fc('0x66')];return db['Team']['findAll']({'where':{'id':_0x572aa0},'attributes':['id'],'include':[{'model':db[_0x92fc('0x5b')],'as':'Agents','attributes':['id',_0x92fc('0x31'),_0x92fc('0x67'),_0x92fc('0x68'),_0x92fc('0x69')],'raw':!![]}]})[_0x92fc('0x2a')](function(_0x440a08){if(_0x440a08){var _0x17f48f=_[_0x92fc('0x6a')](_0x440a08,function(_0xc8f664){var _0x45d647=_0xc8f664[_0x92fc('0x2b')]({'plain':!![]});return _0x45d647[_0x92fc('0x6b')];});return db[_0x92fc('0x34')]['find']({'where':{'id':_0x223488['params']['id']}})['then'](function(_0x48ee76){return db[_0x92fc('0x6c')][_0x92fc('0x6d')](function(_0x30a674){return _0x48ee76[_0x92fc('0x65')](_0x572aa0,{'transaction':_0x30a674})[_0x92fc('0x2a')](function(){return BPromise['each'](_0x17f48f,function(_0x4bc8b0){return db[_0x92fc('0x5a')]['findOrCreate']({'where':{'UserId':_0x4bc8b0['id'],'FaxQueueId':_0x223488[_0x92fc('0x56')]['id']},'transaction':_0x30a674});});})['then'](function(){_0x17f48f[_0x92fc('0x6e')](function(_0x518001){socket['emit'](_0x92fc('0x6f'),{'UserId':_0x518001['id'],'FaxQueueId':_0x48ee76['id']});});});});});}})[_0x92fc('0x2a')](respondWithStatusCode(_0x363fc1,null))[_0x92fc('0x4e')](handleError(_0x363fc1,null));};exports['removeTeams']=function(_0x2f2c1d,_0x2d6b31,_0x38c259){return db[_0x92fc('0x70')][_0x92fc('0x4c')]({'where':{'id':_0x2f2c1d['query'][_0x92fc('0x66')]},'attributes':['id'],'include':[{'model':db[_0x92fc('0x5b')],'as':_0x92fc('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d6b31,null))[_0x92fc('0x2a')](function(_0x42c0a0){var _0x179a4b=_[_0x92fc('0x33')](_0x42c0a0,'id');var _0x43e967=[];var _0x213b56=[];var _0x44a23f=squel[_0x92fc('0x71')]();_0x44a23f[_0x92fc('0x72')](_0x92fc('0x73'))[_0x92fc('0x74')]('team_has_fax_queues','tq')[_0x92fc('0x75')](_0x92fc('0x76'),'ut',_0x92fc('0x77'))[_0x92fc('0x45')](_0x92fc('0x78'),_0x2f2c1d[_0x92fc('0x56')]['id']);for(var _0x399076=0x0;_0x399076<_0x42c0a0[_0x92fc('0x40')];_0x399076+=0x1){let _0x1835aa=_0x42c0a0[_0x399076];for(var _0x2f8e4b=0x0;_0x2f8e4b<_0x1835aa['Agents'][_0x92fc('0x40')];_0x2f8e4b+=0x1){let _0x1e996e=_0x1835aa[_0x92fc('0x6b')][_0x2f8e4b];var _0x2152da=_0x44a23f[_0x92fc('0x79')]();_0x2152da['where'](_0x92fc('0x7a'),_0x1e996e['id']);_0x213b56[_0x92fc('0x7b')](db['sequelize']['query'](_0x2152da[_0x92fc('0x7c')](),{'type':db[_0x92fc('0x6c')][_0x92fc('0x7d')][_0x92fc('0x7e')]})[_0x92fc('0x2a')](function(_0x23b24e){if(_0x23b24e[_0x92fc('0x40')]===0x1){return _0x1e996e['id'];}else{var _0x1c2ffb=_['every'](_[_0x92fc('0x33')](_0x23b24e,_0x92fc('0x7f')),function(_0x20e987){return _['includes'](_0x179a4b,_0x20e987);});if(_0x1c2ffb){return _0x1e996e['id'];}}}));}}return BPromise[_0x92fc('0x80')](_0x213b56)[_0x92fc('0x2a')](function(_0x947713){_0x43e967=_(_0x43e967)[_0x92fc('0x81')](_0x947713)[_0x92fc('0x82')]()[_0x92fc('0x83')]();return db[_0x92fc('0x34')]['find']({'where':{'id':_0x2f2c1d[_0x92fc('0x56')]['id']}})[_0x92fc('0x2a')](function(_0x2dde01){return db[_0x92fc('0x6c')][_0x92fc('0x6d')](function(_0x5debd1){return _0x2dde01[_0x92fc('0x84')](_0x2f2c1d[_0x92fc('0x3a')][_0x92fc('0x66')],{'transaction':_0x5debd1})[_0x92fc('0x2a')](function(){if(!_[_0x92fc('0x85')](_0x43e967)){return _0x2dde01[_0x92fc('0x86')](_0x43e967,{'transaction':_0x5debd1});}})[_0x92fc('0x2a')](function(){_0x43e967[_0x92fc('0x6e')](function(_0x282813){socket[_0x92fc('0x87')](_0x92fc('0x88'),{'UserId':_0x282813,'FaxQueueId':_0x2dde01['id']});});});});});});})[_0x92fc('0x2a')](respondWithStatusCode(_0x2d6b31,null))[_0x92fc('0x4e')](handleError(_0x2d6b31,null));};exports[_0x92fc('0x89')]=function(_0x2069c7,_0x5c068f,_0x42cf66){return db[_0x92fc('0x34')]['find']({'where':{'id':_0x2069c7[_0x92fc('0x56')]['id']}})['then'](handleEntityNotFound(_0x5c068f,null))['then'](function(_0x23fdcb){if(_0x23fdcb){return _0x23fdcb[_0x92fc('0x89')](_0x2069c7[_0x92fc('0x51')][_0x92fc('0x66')],_[_0x92fc('0x8a')](_0x2069c7[_0x92fc('0x51')],[_0x92fc('0x66'),'id'])||{})[_0x92fc('0x8b')](function(_0x13981b){for(var _0x5c2f85=0x0;_0x5c2f85<_0x2069c7[_0x92fc('0x51')]['ids'][_0x92fc('0x40')];_0x5c2f85+=0x1){socket[_0x92fc('0x87')](_0x92fc('0x6f'),{'UserId':_0x2069c7[_0x92fc('0x51')][_0x92fc('0x66')][_0x5c2f85],'FaxQueueId':_0x2069c7[_0x92fc('0x56')]['id']});}return _0x13981b;});}})['then'](respondWithResult(_0x5c068f,null))['catch'](handleError(_0x5c068f,null));};exports[_0x92fc('0x86')]=function(_0x152057,_0x44e412,_0x5cbe7a){return db[_0x92fc('0x34')][_0x92fc('0x53')]({'where':{'id':_0x152057['params']['id']}})[_0x92fc('0x2a')](handleEntityNotFound(_0x44e412,null))[_0x92fc('0x2a')](function(_0x4cbc68){if(_0x4cbc68){return _0x4cbc68[_0x92fc('0x86')](_0x152057[_0x92fc('0x3a')][_0x92fc('0x66')])['then'](function(){if(_[_0x92fc('0x8c')](_0x152057['query'][_0x92fc('0x66')])){for(var _0x2a9ddc=0x0;_0x2a9ddc<_0x152057['query'][_0x92fc('0x66')][_0x92fc('0x40')];_0x2a9ddc+=0x1){socket['emit'](_0x92fc('0x88'),{'UserId':Number(_0x152057['query'][_0x92fc('0x66')][_0x2a9ddc]),'FaxQueueId':Number(_0x152057[_0x92fc('0x56')]['id'])});}}else{socket['emit'](_0x92fc('0x88'),{'UserId':Number(_0x152057['query'][_0x92fc('0x66')]),'FaxQueueId':Number(_0x152057[_0x92fc('0x56')]['id'])});}});}})[_0x92fc('0x2a')](respondWithStatusCode(_0x44e412,null))[_0x92fc('0x4e')](handleError(_0x44e412,null));};exports[_0x92fc('0x8d')]=function(_0x56cd33,_0x27d9e9,_0x55d490){var _0x20f8ed={};var _0x55ec86={};var _0x4403a9;var _0x39a0ac;return db[_0x92fc('0x34')][_0x92fc('0x59')]({'where':{'id':_0x56cd33[_0x92fc('0x56')]['id']}})[_0x92fc('0x2a')](handleEntityNotFound(_0x27d9e9,null))['then'](function(_0x3d3ed3){if(_0x3d3ed3){_0x4403a9=_0x3d3ed3;_0x55ec86[_0x92fc('0x39')]=_['keys'](db[_0x92fc('0x5b')][_0x92fc('0x35')]);_0x55ec86[_0x92fc('0x3a')]=_[_0x92fc('0x3b')](_0x56cd33['query']);_0x55ec86[_0x92fc('0x3c')]=_['intersection'](_0x55ec86[_0x92fc('0x39')],_0x55ec86[_0x92fc('0x3a')]);_0x20f8ed['attributes']=_[_0x92fc('0x3d')](_0x55ec86[_0x92fc('0x39')],qs[_0x92fc('0x3e')](_0x56cd33['query'][_0x92fc('0x3e')]));_0x20f8ed[_0x92fc('0x3f')]=_0x20f8ed['attributes'][_0x92fc('0x40')]?_0x20f8ed[_0x92fc('0x3f')]:_0x55ec86['model'];_0x20f8ed['order']=qs[_0x92fc('0x44')](_0x56cd33[_0x92fc('0x3a')][_0x92fc('0x44')]);_0x20f8ed[_0x92fc('0x45')]=qs[_0x92fc('0x3c')](_[_0x92fc('0x46')](_0x56cd33[_0x92fc('0x3a')],_0x55ec86[_0x92fc('0x3c')]));if(_0x56cd33[_0x92fc('0x3a')]['filter']){_0x20f8ed[_0x92fc('0x45')]=_[_0x92fc('0x48')](_0x20f8ed['where'],{'$or':_[_0x92fc('0x33')](_0x20f8ed[_0x92fc('0x3f')],function(_0x7cad49){var _0x562df5={};_0x562df5[_0x7cad49]={'$like':'%'+_0x56cd33[_0x92fc('0x3a')]['filter']+'%'};return _0x562df5;})});}_0x20f8ed=_[_0x92fc('0x48')]({},_0x20f8ed,_0x56cd33[_0x92fc('0x49')]);return _0x4403a9['getAgents'](_0x20f8ed);}})[_0x92fc('0x2a')](function(_0x1cb9eb){if(_0x1cb9eb){_0x39a0ac=_0x1cb9eb[_0x92fc('0x40')];if(!_0x56cd33['query'][_0x92fc('0x41')](_0x92fc('0x42'))){_0x20f8ed['limit']=qs[_0x92fc('0x23')](_0x56cd33[_0x92fc('0x3a')][_0x92fc('0x23')]);_0x20f8ed['offset']=qs[_0x92fc('0x22')](_0x56cd33['query'][_0x92fc('0x22')]);}return _0x4403a9[_0x92fc('0x8d')](_0x20f8ed);}})[_0x92fc('0x2a')](function(_0x62abeb){if(_0x62abeb){return _0x62abeb?{'count':_0x39a0ac,'rows':_0x62abeb}:null;}})[_0x92fc('0x2a')](respondWithResult(_0x27d9e9,null))[_0x92fc('0x4e')](handleError(_0x27d9e9,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ee75f8a..d72dc68 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 _0xb744=['emit','hook','exports','events','FaxQueue','save','update'];(function(_0x10535f,_0xca8897){var _0x420c64=function(_0x979673){while(--_0x979673){_0x10535f['push'](_0x10535f['shift']());}};_0x420c64(++_0xca8897);}(_0xb744,0x6c));var _0x4b74=function(_0x5f368a,_0x2a4ef5){_0x5f368a=_0x5f368a-0x0;var _0x5402c5=_0xb744[_0x5f368a];return _0x5402c5;};'use strict';var EventEmitter=require(_0x4b74('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x4b74('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b74('0x2'),'afterUpdate':_0x4b74('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1df1f1){return function(_0x2d29f0,_0x34f796,_0x35e6b6){FaxQueueEvents[_0x4b74('0x4')](_0x1df1f1+':'+_0x2d29f0['id'],_0x2d29f0);FaxQueueEvents[_0x4b74('0x4')](_0x1df1f1,_0x2d29f0);_0x35e6b6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x4b74('0x5')](e,emitEvent(event));}}module[_0x4b74('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0xed82=['events','../../mysqldb','FaxQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x26498e,_0x547f3d){var _0x467b04=function(_0x305d08){while(--_0x305d08){_0x26498e['push'](_0x26498e['shift']());}};_0x467b04(++_0x547f3d);}(_0xed82,0xea));var _0x2ed8=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xed82[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0x2ed8('0x0'));var FaxQueue=require(_0x2ed8('0x1'))['db'][_0x2ed8('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2ed8('0x3')](0x0);var events={'afterCreate':_0x2ed8('0x4'),'afterUpdate':'update','afterDestroy':_0x2ed8('0x5')};function emitEvent(_0x114d62){return function(_0x50629a,_0x420f87,_0x5ba0e8){FaxQueueEvents['emit'](_0x114d62+':'+_0x50629a['id'],_0x50629a);FaxQueueEvents[_0x2ed8('0x6')](_0x114d62,_0x50629a);_0x5ba0e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x2ed8('0x7')](e,emitEvent(event));}}module[_0x2ed8('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index bdae82f..c23c1c7 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 _0xbf63=['define','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','exports'];(function(_0x4d0899,_0x208802){var _0x5142de=function(_0x272e14){while(--_0x272e14){_0x4d0899['push'](_0x4d0899['shift']());}};_0x5142de(++_0x208802);}(_0xbf63,0x13b));var _0x3bf6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbf63[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3bf6('0x0'));var util=require(_0x3bf6('0x1'));var logger=require('../../config/logger')(_0x3bf6('0x2'));var moment=require(_0x3bf6('0x3'));var BPromise=require(_0x3bf6('0x4'));var rp=require(_0x3bf6('0x5'));var fs=require('fs');var path=require(_0x3bf6('0x6'));var rimraf=require('rimraf');var config=require(_0x3bf6('0x7'));var attributes=require(_0x3bf6('0x8'));module[_0x3bf6('0x9')]=function(_0x26befd,_0x5adcdc){return _0x26befd[_0x3bf6('0xa')](_0x3bf6('0xb'),attributes,{'tableName':_0x3bf6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa924=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','fax_queues','lodash'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa924,0x1cb));var _0x4a92=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xa924[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x4a92('0x0'));var util=require('util');var logger=require(_0x4a92('0x1'))(_0x4a92('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4a92('0x3'));var fs=require('fs');var path=require(_0x4a92('0x4'));var rimraf=require(_0x4a92('0x5'));var config=require(_0x4a92('0x6'));var attributes=require('./faxQueue.attributes');module[_0x4a92('0x7')]=function(_0x18ef09,_0x453f2d){return _0x18ef09[_0x4a92('0x8')]('FaxQueue',attributes,{'tableName':_0x4a92('0x9'),'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 981d4da..928be0e 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 _0x2129=['error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','limit','include','map','model','attributes','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5187ad,_0x40b75f){var _0x2d791c=function(_0x4ae79d){while(--_0x4ae79d){_0x5187ad['push'](_0x5187ad['shift']());}};_0x2d791c(++_0x40b75f);}(_0x2129,0x1d4));var _0x9212=function(_0x6126f1,_0x2953b4){_0x6126f1=_0x6126f1-0x0;var _0x5ac83f=_0x2129[_0x6126f1];return _0x5ac83f;};'use strict';var _=require('lodash');var util=require(_0x9212('0x0'));var moment=require(_0x9212('0x1'));var BPromise=require(_0x9212('0x2'));var rs=require(_0x9212('0x3'));var fs=require('fs');var Redis=require(_0x9212('0x4'));var db=require(_0x9212('0x5'))['db'];var utils=require(_0x9212('0x6'));var logger=require(_0x9212('0x7'))('rpc');var config=require(_0x9212('0x8'));var jayson=require(_0x9212('0x9'));var client=jayson[_0x9212('0xa')]['http']({'port':0x232a});config[_0x9212('0xb')]=_[_0x9212('0xc')](config[_0x9212('0xb')],{'host':_0x9212('0xd'),'port':0x18eb});var socket=require(_0x9212('0xe'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x9212('0xf')](socket);function respondWithRpcPromise(_0x3dcf65,_0x3bad99,_0x26083b){return new BPromise(function(_0x59342b,_0x16fac7){return client[_0x9212('0x10')](_0x3dcf65,_0x26083b)[_0x9212('0x11')](function(_0x3eef2b){logger[_0x9212('0x12')](_0x9212('0x13'),_0x3bad99,_0x9212('0x14'));logger[_0x9212('0x15')](_0x9212('0x16'),_0x3bad99,_0x9212('0x14'),JSON[_0x9212('0x17')](_0x3eef2b));if(_0x3eef2b['error']){if(_0x3eef2b[_0x9212('0x18')][_0x9212('0x19')]===0x1f4){logger[_0x9212('0x18')]('FaxQueue,\x20%s,\x20%s',_0x3bad99,_0x3eef2b[_0x9212('0x18')]['message']);return _0x16fac7(_0x3eef2b[_0x9212('0x18')][_0x9212('0x1a')]);}logger[_0x9212('0x18')](_0x9212('0x13'),_0x3bad99,_0x3eef2b[_0x9212('0x18')][_0x9212('0x1a')]);return _0x59342b(_0x3eef2b[_0x9212('0x18')]['message']);}else{logger['info'](_0x9212('0x13'),_0x3bad99,_0x9212('0x14'));_0x59342b(_0x3eef2b[_0x9212('0x1b')][_0x9212('0x1a')]);}})[_0x9212('0x1c')](function(_0x43c526){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3bad99,_0x43c526);_0x16fac7(_0x43c526);});});}exports[_0x9212('0x1d')]=function(_0xd630ba){var _0x10ecdc=this;return new Promise(function(_0x3bd8f1,_0x2fb796){return db[_0x9212('0x1e')]['findAll']({'raw':_0xd630ba[_0x9212('0x1f')]?_0xd630ba[_0x9212('0x1f')][_0x9212('0x20')]===undefined?!![]:![]:!![],'where':_0xd630ba[_0x9212('0x1f')]?_0xd630ba['options'][_0x9212('0x21')]||null:null,'attributes':_0xd630ba[_0x9212('0x1f')]?_0xd630ba[_0x9212('0x1f')]['attributes']||null:null,'limit':_0xd630ba['options']?_0xd630ba['options'][_0x9212('0x22')]||null:null,'include':_0xd630ba[_0x9212('0x1f')]?_0xd630ba[_0x9212('0x1f')][_0x9212('0x23')]?_[_0x9212('0x24')](_0xd630ba[_0x9212('0x1f')][_0x9212('0x23')],function(_0x57d0d8){return{'model':db[_0x57d0d8[_0x9212('0x25')]],'as':_0x57d0d8['as'],'attributes':_0x57d0d8['attributes'],'include':_0x57d0d8['include']?_[_0x9212('0x24')](_0x57d0d8[_0x9212('0x23')],function(_0x527e70){return{'model':db[_0x527e70[_0x9212('0x25')]],'as':_0x527e70['as'],'attributes':_0x527e70['attributes'],'include':_0x527e70[_0x9212('0x23')]?_[_0x9212('0x24')](_0x527e70[_0x9212('0x23')],function(_0x110e25){return{'model':db[_0x110e25[_0x9212('0x25')]],'as':_0x110e25['as'],'attributes':_0x110e25[_0x9212('0x26')]};}):[]};}):[]};}):[]:[]})[_0x9212('0x11')](function(_0xa0fafe){logger[_0x9212('0x12')]('GetFaxQueue',_0xd630ba);logger['debug'](_0x9212('0x1d'),_0xd630ba,JSON[_0x9212('0x17')](_0xa0fafe));_0x3bd8f1(_0xa0fafe);})['catch'](function(_0x4d16d4){logger[_0x9212('0x18')](_0x9212('0x1d'),_0x4d16d4[_0x9212('0x1a')],_0xd630ba);_0x2fb796(_0x10ecdc[_0x9212('0x18')](0x1f4,_0x4d16d4[_0x9212('0x1a')]));});});};exports[_0x9212('0x27')]=function(_0x24daa2){var _0x372490=this;return new Promise(function(_0x341257,_0x81adb6){return db[_0x9212('0x1e')][_0x9212('0x28')]({'raw':_0x24daa2['options']?_0x24daa2[_0x9212('0x1f')][_0x9212('0x20')]===undefined?!![]:![]:!![],'where':_0x24daa2[_0x9212('0x1f')]?_0x24daa2[_0x9212('0x1f')][_0x9212('0x21')]||null:null,'attributes':_0x24daa2['options']?_0x24daa2[_0x9212('0x1f')][_0x9212('0x26')]||null:null,'include':_0x24daa2[_0x9212('0x1f')]?_0x24daa2[_0x9212('0x1f')][_0x9212('0x23')]?_['map'](_0x24daa2[_0x9212('0x1f')]['include'],function(_0x47fd64){return{'model':db[_0x47fd64[_0x9212('0x25')]],'as':_0x47fd64['as'],'attributes':_0x47fd64[_0x9212('0x26')],'include':_0x47fd64['include']?_['map'](_0x47fd64['include'],function(_0x4a2738){return{'model':db[_0x4a2738[_0x9212('0x25')]],'as':_0x4a2738['as'],'attributes':_0x4a2738['attributes'],'include':_0x4a2738[_0x9212('0x23')]?_[_0x9212('0x24')](_0x4a2738[_0x9212('0x23')],function(_0x5bd429){return{'model':db[_0x5bd429[_0x9212('0x25')]],'as':_0x5bd429['as'],'attributes':_0x5bd429[_0x9212('0x26')]};}):[]};}):[]};}):[]:[]})[_0x9212('0x11')](function(_0x103f17){logger[_0x9212('0x12')]('ShowFaxQueue',_0x24daa2);logger['debug'](_0x9212('0x27'),_0x24daa2,JSON[_0x9212('0x17')](_0x103f17));_0x341257(_0x103f17);})[_0x9212('0x1c')](function(_0x46acb8){logger['error'](_0x9212('0x27'),_0x46acb8[_0x9212('0x1a')],_0x24daa2);_0x81adb6(_0x372490['error'](0x1f4,_0x46acb8[_0x9212('0x1a')]));});});}; \ No newline at end of file +var _0x29ce=['FaxQueue,\x20%s,\x20%s,\x20%s','error','code','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','map','include','model','attributes','then','stringify','ShowFaxQueue','find','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','info','request\x20sent','debug'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x29ce,0x109));var _0xe29c=function(_0x5e64f4,_0x5901bb){_0x5e64f4=_0x5e64f4-0x0;var _0x2173f1=_0x29ce[_0x5e64f4];return _0x2173f1;};'use strict';var _=require('lodash');var util=require(_0xe29c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe29c('0x1'));var db=require(_0xe29c('0x2'))['db'];var utils=require(_0xe29c('0x3'));var logger=require(_0xe29c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe29c('0x5'));var client=jayson[_0xe29c('0x6')][_0xe29c('0x7')]({'port':0x232a});config[_0xe29c('0x8')]=_['defaults'](config[_0xe29c('0x8')],{'host':_0xe29c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe29c('0x8')]));require(_0xe29c('0xa'))[_0xe29c('0xb')](socket);function respondWithRpcPromise(_0x48b5e6,_0x31c102,_0x1f3cad){return new BPromise(function(_0x3bc2e1,_0x16ed91){return client['request'](_0x48b5e6,_0x1f3cad)['then'](function(_0x16cf6b){logger[_0xe29c('0xc')]('FaxQueue,\x20%s,\x20%s',_0x31c102,_0xe29c('0xd'));logger[_0xe29c('0xe')](_0xe29c('0xf'),_0x31c102,_0xe29c('0xd'),JSON['stringify'](_0x16cf6b));if(_0x16cf6b[_0xe29c('0x10')]){if(_0x16cf6b[_0xe29c('0x10')][_0xe29c('0x11')]===0x1f4){logger[_0xe29c('0x10')](_0xe29c('0x12'),_0x31c102,_0x16cf6b[_0xe29c('0x10')][_0xe29c('0x13')]);return _0x16ed91(_0x16cf6b['error']['message']);}logger[_0xe29c('0x10')](_0xe29c('0x12'),_0x31c102,_0x16cf6b[_0xe29c('0x10')][_0xe29c('0x13')]);return _0x3bc2e1(_0x16cf6b[_0xe29c('0x10')]['message']);}else{logger[_0xe29c('0xc')]('FaxQueue,\x20%s,\x20%s',_0x31c102,_0xe29c('0xd'));_0x3bc2e1(_0x16cf6b['result'][_0xe29c('0x13')]);}})[_0xe29c('0x14')](function(_0x112c8c){logger[_0xe29c('0x10')](_0xe29c('0x12'),_0x31c102,_0x112c8c);_0x16ed91(_0x112c8c);});});}exports[_0xe29c('0x15')]=function(_0xe1a185){var _0x29f8b3=this;return new Promise(function(_0x5786a9,_0x20ed1f){return db[_0xe29c('0x16')][_0xe29c('0x17')]({'raw':_0xe1a185[_0xe29c('0x18')]?_0xe1a185['options'][_0xe29c('0x19')]===undefined?!![]:![]:!![],'where':_0xe1a185[_0xe29c('0x18')]?_0xe1a185['options'][_0xe29c('0x1a')]||null:null,'attributes':_0xe1a185[_0xe29c('0x18')]?_0xe1a185[_0xe29c('0x18')]['attributes']||null:null,'limit':_0xe1a185[_0xe29c('0x18')]?_0xe1a185[_0xe29c('0x18')]['limit']||null:null,'include':_0xe1a185[_0xe29c('0x18')]?_0xe1a185[_0xe29c('0x18')]['include']?_[_0xe29c('0x1b')](_0xe1a185[_0xe29c('0x18')][_0xe29c('0x1c')],function(_0x1bac82){return{'model':db[_0x1bac82[_0xe29c('0x1d')]],'as':_0x1bac82['as'],'attributes':_0x1bac82[_0xe29c('0x1e')],'include':_0x1bac82[_0xe29c('0x1c')]?_['map'](_0x1bac82[_0xe29c('0x1c')],function(_0x467b87){return{'model':db[_0x467b87[_0xe29c('0x1d')]],'as':_0x467b87['as'],'attributes':_0x467b87['attributes'],'include':_0x467b87[_0xe29c('0x1c')]?_['map'](_0x467b87[_0xe29c('0x1c')],function(_0x3fbcdb){return{'model':db[_0x3fbcdb[_0xe29c('0x1d')]],'as':_0x3fbcdb['as'],'attributes':_0x3fbcdb[_0xe29c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe29c('0x1f')](function(_0xc83068){logger[_0xe29c('0xc')]('GetFaxQueue',_0xe1a185);logger['debug'](_0xe29c('0x15'),_0xe1a185,JSON[_0xe29c('0x20')](_0xc83068));_0x5786a9(_0xc83068);})['catch'](function(_0x1225af){logger[_0xe29c('0x10')](_0xe29c('0x15'),_0x1225af['message'],_0xe1a185);_0x20ed1f(_0x29f8b3[_0xe29c('0x10')](0x1f4,_0x1225af['message']));});});};exports[_0xe29c('0x21')]=function(_0x7fa796){var _0x4b4dea=this;return new Promise(function(_0x3f4f3e,_0x3b8a20){return db[_0xe29c('0x16')][_0xe29c('0x22')]({'raw':_0x7fa796[_0xe29c('0x18')]?_0x7fa796[_0xe29c('0x18')][_0xe29c('0x19')]===undefined?!![]:![]:!![],'where':_0x7fa796['options']?_0x7fa796[_0xe29c('0x18')]['where']||null:null,'attributes':_0x7fa796[_0xe29c('0x18')]?_0x7fa796[_0xe29c('0x18')]['attributes']||null:null,'include':_0x7fa796[_0xe29c('0x18')]?_0x7fa796['options'][_0xe29c('0x1c')]?_[_0xe29c('0x1b')](_0x7fa796['options'][_0xe29c('0x1c')],function(_0x23af6f){return{'model':db[_0x23af6f['model']],'as':_0x23af6f['as'],'attributes':_0x23af6f['attributes'],'include':_0x23af6f[_0xe29c('0x1c')]?_[_0xe29c('0x1b')](_0x23af6f[_0xe29c('0x1c')],function(_0x1e58eb){return{'model':db[_0x1e58eb[_0xe29c('0x1d')]],'as':_0x1e58eb['as'],'attributes':_0x1e58eb[_0xe29c('0x1e')],'include':_0x1e58eb[_0xe29c('0x1c')]?_['map'](_0x1e58eb[_0xe29c('0x1c')],function(_0x48d213){return{'model':db[_0x48d213['model']],'as':_0x48d213['as'],'attributes':_0x48d213[_0xe29c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe29c('0x1f')](function(_0x3a2dab){logger[_0xe29c('0xc')](_0xe29c('0x21'),_0x7fa796);logger[_0xe29c('0xe')](_0xe29c('0x21'),_0x7fa796,JSON[_0xe29c('0x20')](_0x3a2dab));_0x3f4f3e(_0x3a2dab);})['catch'](function(_0xc4c855){logger['error'](_0xe29c('0x21'),_0xc4c855['message'],_0x7fa796);_0x3b8a20(_0x4b4dea[_0xe29c('0x10')](0x1f4,_0xc4c855['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 5f40f81..4f1558c 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 _0x6016=['update','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x3bb39d,_0x30c89d){var _0x33d01a=function(_0x19eed2){while(--_0x19eed2){_0x3bb39d['push'](_0x3bb39d['shift']());}};_0x33d01a(++_0x30c89d);}(_0x6016,0x124));var _0x6601=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x6016[_0x3ec122];return _0x4ecf41;};'use strict';var FaxQueueEvents=require(_0x6601('0x0'));var events=[_0x6601('0x1'),'remove',_0x6601('0x2')];function createListener(_0xd03873,_0x4d5230){return function(_0x186404){_0x4d5230['emit'](_0xd03873,_0x186404);};}function removeListener(_0x32819c,_0x215cb9){return function(){FaxQueueEvents['removeListener'](_0x32819c,_0x215cb9);};}exports[_0x6601('0x3')]=function(_0x245ead){for(var _0x1737bf=0x0,_0x8e908b=events[_0x6601('0x4')];_0x1737bf<_0x8e908b;_0x1737bf++){var _0x6651a0=events[_0x1737bf];var _0x1b98e9=createListener(_0x6601('0x5')+_0x6651a0,_0x245ead);FaxQueueEvents['on'](_0x6651a0,_0x1b98e9);}}; \ No newline at end of file +var _0x2548=['emit','register','length','remove','update'];(function(_0x993c64,_0x58f353){var _0xc6a5b0=function(_0x61a520){while(--_0x61a520){_0x993c64['push'](_0x993c64['shift']());}};_0xc6a5b0(++_0x58f353);}(_0x2548,0x71));var _0x8254=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2548[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x8254('0x0'),_0x8254('0x1')];function createListener(_0x3662b6,_0x4b56ec){return function(_0x47a82a){_0x4b56ec[_0x8254('0x2')](_0x3662b6,_0x47a82a);};}function removeListener(_0x26b32a,_0x3ddc62){return function(){FaxQueueEvents['removeListener'](_0x26b32a,_0x3ddc62);};}exports[_0x8254('0x3')]=function(_0x441c0b){for(var _0x5ad892=0x0,_0x3abdbc=events[_0x8254('0x4')];_0x5ad892<_0x3abdbc;_0x5ad892++){var _0x5d4d59=events[_0x5ad892];var _0x3e0284=createListener('faxQueue:'+_0x5d4d59,_0x441c0b);FaxQueueEvents['on'](_0x5d4d59,_0x3e0284);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 729c5b4..dc9b2e5 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 _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xb10b,0x12a));var _0xbb10=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0xb10b[_0x19e928];return _0x4e941f;};'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('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x0b0e,0x187));var _0xe0b0=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b0e[_0xfae23b];return _0x200640;};'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['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getMembers']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x8')](_0xe0b0('0x11'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')]('/:id/teams',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);router[_0xe0b0('0x13')](_0xe0b0('0x11'),auth[_0xe0b0('0x9')](),controller['addAgents']);router[_0xe0b0('0x16')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x17')]);router['delete'](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0x18')]);router[_0xe0b0('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe0b0('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe0b0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 27e3998..f4a6697 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 _0x9932=['sequelize','exports','STRING','DATE','moment'];(function(_0x267751,_0x472642){var _0x56dbb9=function(_0x1ffd14){while(--_0x1ffd14){_0x267751['push'](_0x267751['shift']());}};_0x56dbb9(++_0x472642);}(_0x9932,0x1a8));var _0x2993=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x9932[_0x1dfa63];return _0x26f2a9;};'use strict';var moment=require(_0x2993('0x0'));var Sequelize=require(_0x2993('0x1'));module[_0x2993('0x2')]={'uniqueid':{'type':Sequelize[_0x2993('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2993('0x3')]},'joinAt':{'type':Sequelize[_0x2993('0x4')]},'leaveAt':{'type':Sequelize[_0x2993('0x4')]},'acceptAt':{'type':Sequelize[_0x2993('0x4')]},'exitAt':{'type':Sequelize[_0x2993('0x4')]},'reason':{'type':Sequelize[_0x2993('0x3')]}}; \ No newline at end of file +var _0x1063=['DATE','moment','sequelize','STRING'];(function(_0x49ed67,_0x5d5d06){var _0x2f0e59=function(_0x3a49ac){while(--_0x3a49ac){_0x49ed67['push'](_0x49ed67['shift']());}};_0x2f0e59(++_0x5d5d06);}(_0x1063,0x101));var _0x3106=function(_0x272523,_0x28422e){_0x272523=_0x272523-0x0;var _0x5c3ac7=_0x1063[_0x272523];return _0x5c3ac7;};'use strict';var moment=require(_0x3106('0x0'));var Sequelize=require(_0x3106('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3106('0x2')]},'joinAt':{'type':Sequelize[_0x3106('0x3')]},'leaveAt':{'type':Sequelize[_0x3106('0x3')]},'acceptAt':{'type':Sequelize[_0x3106('0x3')]},'exitAt':{'type':Sequelize[_0x3106('0x3')]},'reason':{'type':Sequelize[_0x3106('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7418e4e..9dcf379 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 _0x566c=['model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','keys','rawAttributes','length','include','options','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','set','reject','save','update','then','status','error','stack','name','send','index','map','FaxQueueReport','fieldName','type'];(function(_0x37e1bb,_0x89bd2a){var _0x14f4e0=function(_0x1ff47d){while(--_0x1ff47d){_0x37e1bb['push'](_0x37e1bb['shift']());}};_0x14f4e0(++_0x89bd2a);}(_0x566c,0x6e));var _0xc566=function(_0x451b61,_0x13fc78){_0x451b61=_0x451b61-0x0;var _0x31f21d=_0x566c[_0x451b61];return _0x31f21d;};'use strict';var pdf=require(_0xc566('0x0'));var emlformat=require(_0xc566('0x1'));var rimraf=require(_0xc566('0x2'));var zipdir=require(_0xc566('0x3'));var jsonpatch=require(_0xc566('0x4'));var rp=require(_0xc566('0x5'));var moment=require(_0xc566('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc566('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc566('0x8'));var csv=require(_0xc566('0x9'));var ejs=require(_0xc566('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc566('0xb'));var crypto=require(_0xc566('0xc'));var jsforce=require(_0xc566('0xd'));var deskjs=require(_0xc566('0xe'));var toCsv=require(_0xc566('0x9'));var querystring=require(_0xc566('0xf'));var Papa=require(_0xc566('0x10'));var Redis=require(_0xc566('0x11'));var authService=require(_0xc566('0x12'));var qs=require(_0xc566('0x13'));var as=require(_0xc566('0x14'));var hardwareService=require(_0xc566('0x15'));var logger=require(_0xc566('0x16'))(_0xc566('0x17'));var utils=require(_0xc566('0x18'));var config=require(_0xc566('0x19'));var db=require(_0xc566('0x1a'))['db'];function respondWithStatusCode(_0x366a31,_0x525797){_0x525797=_0x525797||0xcc;return function(_0x4f4c7f){if(_0x4f4c7f){return _0x366a31[_0xc566('0x1b')](_0x525797);}return _0x366a31['status'](_0x525797)[_0xc566('0x1c')]();};}function respondWithResult(_0x1bbf6f,_0x51b7ba){_0x51b7ba=_0x51b7ba||0xc8;return function(_0x58747c){if(_0x58747c){return _0x1bbf6f['status'](_0x51b7ba)[_0xc566('0x1d')](_0x58747c);}};}function respondWithFilteredResult(_0x4aed79,_0x2207d3){return function(_0x190ad5){if(_0x190ad5){var _0x4ce58e=_0x190ad5[_0xc566('0x1e')],_0x38477b=_0x2207d3['offset'],_0x333c5b=_0x2207d3[_0xc566('0x1f')]+_0x2207d3[_0xc566('0x20')],_0x323927;if(_0x333c5b>=_0x4ce58e){_0x333c5b=_0x4ce58e;_0x323927=0xc8;}else{_0x323927=0xce;}_0x4aed79['status'](_0x323927);return _0x4aed79[_0xc566('0x21')]('Content-Range',_0x38477b+'-'+_0x333c5b+'/'+_0x4ce58e)[_0xc566('0x1d')](_0x190ad5);}return null;};}function patchUpdates(_0x237612){return function(_0x45cb1a){try{jsonpatch['apply'](_0x45cb1a,_0x237612,!![]);}catch(_0x5e0ba2){return BPromise[_0xc566('0x22')](_0x5e0ba2);}return _0x45cb1a[_0xc566('0x23')]();};}function saveUpdates(_0x1d46b2,_0x2cf37d){return function(_0x5a1d93){if(_0x5a1d93){return _0x5a1d93[_0xc566('0x24')](_0x1d46b2)[_0xc566('0x25')](function(_0x1222db){return _0x1222db;});}return null;};}function removeEntity(_0x11152c,_0x23f746){return function(_0x162a1a){if(_0x162a1a){return _0x162a1a['destroy']()[_0xc566('0x25')](function(){_0x11152c[_0xc566('0x26')](0xcc)[_0xc566('0x1c')]();});}};}function handleEntityNotFound(_0x4f3728,_0x1761c0){return function(_0x3e994a){if(!_0x3e994a){_0x4f3728[_0xc566('0x1b')](0x194);}return _0x3e994a;};}function handleError(_0xe2ba19,_0x264a97){_0x264a97=_0x264a97||0x1f4;return function(_0x2b77dc){logger[_0xc566('0x27')](_0x2b77dc[_0xc566('0x28')]);if(_0x2b77dc[_0xc566('0x29')]){delete _0x2b77dc['name'];}_0xe2ba19[_0xc566('0x26')](_0x264a97)[_0xc566('0x2a')](_0x2b77dc);};}exports[_0xc566('0x2b')]=function(_0x517c78,_0x3bc9f4){var _0x4f8a90={},_0x115b25={},_0xd6058b={'count':0x0,'rows':[]};var _0x29187f=_[_0xc566('0x2c')](db[_0xc566('0x2d')]['rawAttributes'],function(_0x34341c){return{'name':_0x34341c[_0xc566('0x2e')],'type':_0x34341c[_0xc566('0x2f')]['key']};});_0x115b25[_0xc566('0x30')]=_[_0xc566('0x2c')](_0x29187f,_0xc566('0x29'));_0x115b25[_0xc566('0x31')]=_['keys'](_0x517c78[_0xc566('0x31')]);_0x115b25['filters']=_[_0xc566('0x32')](_0x115b25['model'],_0x115b25[_0xc566('0x31')]);_0x4f8a90['attributes']=_[_0xc566('0x32')](_0x115b25['model'],qs[_0xc566('0x33')](_0x517c78[_0xc566('0x31')][_0xc566('0x33')]));_0x4f8a90[_0xc566('0x34')]=_0x4f8a90[_0xc566('0x34')]['length']?_0x4f8a90[_0xc566('0x34')]:_0x115b25[_0xc566('0x30')];if(!_0x517c78[_0xc566('0x31')][_0xc566('0x35')](_0xc566('0x36'))){_0x4f8a90[_0xc566('0x20')]=qs['limit'](_0x517c78[_0xc566('0x31')]['limit']);_0x4f8a90[_0xc566('0x1f')]=qs[_0xc566('0x1f')](_0x517c78[_0xc566('0x31')][_0xc566('0x1f')]);}_0x4f8a90[_0xc566('0x37')]=qs[_0xc566('0x38')](_0x517c78['query'][_0xc566('0x38')]);_0x4f8a90[_0xc566('0x39')]=qs[_0xc566('0x3a')](_[_0xc566('0x3b')](_0x517c78[_0xc566('0x31')],_0x115b25[_0xc566('0x3a')]));if(_0x517c78[_0xc566('0x31')][_0xc566('0x3c')]){_0x4f8a90[_0xc566('0x39')]=_[_0xc566('0x3d')](_0x4f8a90['where'],{'$or':_['map'](_0x29187f,function(_0x381375){if(_0x381375[_0xc566('0x2f')]!==_0xc566('0x3e')){var _0x24599d={};_0x24599d[_0x381375[_0xc566('0x29')]]={'$like':'%'+_0x517c78[_0xc566('0x31')]['filter']+'%'};return _0x24599d;}})});}_0x4f8a90=_[_0xc566('0x3d')]({},_0x4f8a90,_0x517c78['options']);var _0x4d633b={'where':_0x4f8a90['where']};return db[_0xc566('0x2d')][_0xc566('0x1e')](_0x4d633b)[_0xc566('0x25')](function(_0x13832c){_0xd6058b[_0xc566('0x1e')]=_0x13832c;if(_0x517c78['query'][_0xc566('0x3f')]){_0x4f8a90['include']=[{'all':!![]}];}return db[_0xc566('0x2d')][_0xc566('0x40')](_0x4f8a90);})['then'](function(_0x118fc1){_0xd6058b[_0xc566('0x41')]=_0x118fc1;return _0xd6058b;})[_0xc566('0x25')](respondWithFilteredResult(_0x3bc9f4,_0x4f8a90))['catch'](handleError(_0x3bc9f4,null));};exports[_0xc566('0x42')]=function(_0x42ba82,_0x20c555){var _0x106a65={'raw':!![],'where':{'id':_0x42ba82['params']['id']}},_0x135734={};_0x135734[_0xc566('0x30')]=_[_0xc566('0x43')](db[_0xc566('0x2d')][_0xc566('0x44')]);_0x135734[_0xc566('0x31')]=_[_0xc566('0x43')](_0x42ba82['query']);_0x135734[_0xc566('0x3a')]=_[_0xc566('0x32')](_0x135734[_0xc566('0x30')],_0x135734['query']);_0x106a65[_0xc566('0x34')]=_['intersection'](_0x135734['model'],qs[_0xc566('0x33')](_0x42ba82[_0xc566('0x31')][_0xc566('0x33')]));_0x106a65['attributes']=_0x106a65[_0xc566('0x34')][_0xc566('0x45')]?_0x106a65[_0xc566('0x34')]:_0x135734[_0xc566('0x30')];if(_0x42ba82[_0xc566('0x31')][_0xc566('0x3f')]){_0x106a65[_0xc566('0x46')]=[{'all':!![]}];}_0x106a65=_['merge']({},_0x106a65,_0x42ba82[_0xc566('0x47')]);return db[_0xc566('0x2d')][_0xc566('0x48')](_0x106a65)[_0xc566('0x25')](handleEntityNotFound(_0x20c555,null))[_0xc566('0x25')](respondWithResult(_0x20c555,null))[_0xc566('0x49')](handleError(_0x20c555,null));};exports[_0xc566('0x4a')]=function(_0x51cb9c,_0x10aa50){return db[_0xc566('0x2d')][_0xc566('0x4a')](_0x51cb9c[_0xc566('0x4b')],{})[_0xc566('0x25')](respondWithResult(_0x10aa50,0xc9))['catch'](handleError(_0x10aa50,null));};exports['update']=function(_0x5de68f,_0x5cbc51){if(_0x5de68f[_0xc566('0x4b')]['id']){delete _0x5de68f['body']['id'];}return db[_0xc566('0x2d')]['find']({'where':{'id':_0x5de68f[_0xc566('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5cbc51,null))[_0xc566('0x25')](saveUpdates(_0x5de68f[_0xc566('0x4b')],null))[_0xc566('0x25')](respondWithResult(_0x5cbc51,null))['catch'](handleError(_0x5cbc51,null));};exports[_0xc566('0x4d')]=function(_0x34639e,_0x33f37d){return db[_0xc566('0x2d')]['find']({'where':{'id':_0x34639e['params']['id']}})[_0xc566('0x25')](handleEntityNotFound(_0x33f37d,null))['then'](removeEntity(_0x33f37d,null))['catch'](handleError(_0x33f37d,null));};exports[_0xc566('0x4e')]=function(_0x3e5b89,_0x3af5cb){return db[_0xc566('0x2d')]['describe']()[_0xc566('0x25')](respondWithResult(_0x3af5cb,null))[_0xc566('0x49')](handleError(_0x3af5cb,null));}; \ No newline at end of file +var _0xde18=['rows','catch','params','rawAttributes','length','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','end','status','count','offset','limit','set','json','reject','then','destroy','sendStatus','error','stack','send','map','FaxQueueReport','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xde18,0x164));var _0x8de1=function(_0x2967fe,_0x355857){_0x2967fe=_0x2967fe-0x0;var _0x215577=_0xde18[_0x2967fe];return _0x215577;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8de1('0x0'));var zipdir=require(_0x8de1('0x1'));var jsonpatch=require(_0x8de1('0x2'));var rp=require(_0x8de1('0x3'));var moment=require(_0x8de1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8de1('0x5'));var util=require(_0x8de1('0x6'));var path=require(_0x8de1('0x7'));var sox=require(_0x8de1('0x8'));var csv=require('to-csv');var ejs=require(_0x8de1('0x9'));var fs=require('fs');var _=require(_0x8de1('0xa'));var squel=require('squel');var crypto=require(_0x8de1('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8de1('0xc'));var querystring=require(_0x8de1('0xd'));var Papa=require('papaparse');var Redis=require(_0x8de1('0xe'));var authService=require(_0x8de1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8de1('0x10'));var hardwareService=require(_0x8de1('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8de1('0x12'));var config=require('../../config/environment');var db=require(_0x8de1('0x13'))['db'];function respondWithStatusCode(_0x23bd88,_0x13be85){_0x13be85=_0x13be85||0xcc;return function(_0x1890a9){if(_0x1890a9){return _0x23bd88['sendStatus'](_0x13be85);}return _0x23bd88['status'](_0x13be85)[_0x8de1('0x14')]();};}function respondWithResult(_0x41b18e,_0x4d59d2){_0x4d59d2=_0x4d59d2||0xc8;return function(_0x5ce546){if(_0x5ce546){return _0x41b18e[_0x8de1('0x15')](_0x4d59d2)['json'](_0x5ce546);}};}function respondWithFilteredResult(_0x2e5e13,_0x3489af){return function(_0x53a332){if(_0x53a332){var _0x553354=_0x53a332[_0x8de1('0x16')],_0x58a4e5=_0x3489af[_0x8de1('0x17')],_0x285230=_0x3489af[_0x8de1('0x17')]+_0x3489af[_0x8de1('0x18')],_0x2b31a2;if(_0x285230>=_0x553354){_0x285230=_0x553354;_0x2b31a2=0xc8;}else{_0x2b31a2=0xce;}_0x2e5e13[_0x8de1('0x15')](_0x2b31a2);return _0x2e5e13[_0x8de1('0x19')]('Content-Range',_0x58a4e5+'-'+_0x285230+'/'+_0x553354)[_0x8de1('0x1a')](_0x53a332);}return null;};}function patchUpdates(_0x589f08){return function(_0x70960e){try{jsonpatch['apply'](_0x70960e,_0x589f08,!![]);}catch(_0x3d9ce3){return BPromise[_0x8de1('0x1b')](_0x3d9ce3);}return _0x70960e['save']();};}function saveUpdates(_0x166ce7,_0x4ce983){return function(_0x196ca8){if(_0x196ca8){return _0x196ca8['update'](_0x166ce7)[_0x8de1('0x1c')](function(_0x2868ee){return _0x2868ee;});}return null;};}function removeEntity(_0x3eeb81,_0x1a7e36){return function(_0x47f591){if(_0x47f591){return _0x47f591[_0x8de1('0x1d')]()[_0x8de1('0x1c')](function(){_0x3eeb81['status'](0xcc)[_0x8de1('0x14')]();});}};}function handleEntityNotFound(_0xec50bc,_0x21e220){return function(_0x5ce17e){if(!_0x5ce17e){_0xec50bc[_0x8de1('0x1e')](0x194);}return _0x5ce17e;};}function handleError(_0x1c0880,_0x42c290){_0x42c290=_0x42c290||0x1f4;return function(_0x20d155){logger[_0x8de1('0x1f')](_0x20d155[_0x8de1('0x20')]);if(_0x20d155['name']){delete _0x20d155['name'];}_0x1c0880[_0x8de1('0x15')](_0x42c290)[_0x8de1('0x21')](_0x20d155);};}exports['index']=function(_0x91035,_0xe8f85e){var _0x55e9aa={},_0x40d8f5={},_0x857bd6={'count':0x0,'rows':[]};var _0x2ecf03=_[_0x8de1('0x22')](db[_0x8de1('0x23')]['rawAttributes'],function(_0x45dab4){return{'name':_0x45dab4[_0x8de1('0x24')],'type':_0x45dab4[_0x8de1('0x25')][_0x8de1('0x26')]};});_0x40d8f5['model']=_['map'](_0x2ecf03,_0x8de1('0x27'));_0x40d8f5[_0x8de1('0x28')]=_[_0x8de1('0x29')](_0x91035[_0x8de1('0x28')]);_0x40d8f5[_0x8de1('0x2a')]=_[_0x8de1('0x2b')](_0x40d8f5['model'],_0x40d8f5['query']);_0x55e9aa[_0x8de1('0x2c')]=_['intersection'](_0x40d8f5[_0x8de1('0x2d')],qs[_0x8de1('0x2e')](_0x91035['query'][_0x8de1('0x2e')]));_0x55e9aa[_0x8de1('0x2c')]=_0x55e9aa[_0x8de1('0x2c')]['length']?_0x55e9aa['attributes']:_0x40d8f5[_0x8de1('0x2d')];if(!_0x91035[_0x8de1('0x28')][_0x8de1('0x2f')](_0x8de1('0x30'))){_0x55e9aa[_0x8de1('0x18')]=qs[_0x8de1('0x18')](_0x91035[_0x8de1('0x28')]['limit']);_0x55e9aa[_0x8de1('0x17')]=qs[_0x8de1('0x17')](_0x91035[_0x8de1('0x28')][_0x8de1('0x17')]);}_0x55e9aa['order']=qs[_0x8de1('0x31')](_0x91035[_0x8de1('0x28')][_0x8de1('0x31')]);_0x55e9aa[_0x8de1('0x32')]=qs['filters'](_[_0x8de1('0x33')](_0x91035[_0x8de1('0x28')],_0x40d8f5[_0x8de1('0x2a')]));if(_0x91035[_0x8de1('0x28')][_0x8de1('0x34')]){_0x55e9aa[_0x8de1('0x32')]=_[_0x8de1('0x35')](_0x55e9aa[_0x8de1('0x32')],{'$or':_['map'](_0x2ecf03,function(_0x18faa8){if(_0x18faa8[_0x8de1('0x25')]!==_0x8de1('0x36')){var _0x377c72={};_0x377c72[_0x18faa8[_0x8de1('0x27')]]={'$like':'%'+_0x91035[_0x8de1('0x28')][_0x8de1('0x34')]+'%'};return _0x377c72;}})});}_0x55e9aa=_[_0x8de1('0x35')]({},_0x55e9aa,_0x91035[_0x8de1('0x37')]);var _0x123ede={'where':_0x55e9aa[_0x8de1('0x32')]};return db[_0x8de1('0x23')]['count'](_0x123ede)['then'](function(_0x4bedee){_0x857bd6[_0x8de1('0x16')]=_0x4bedee;if(_0x91035[_0x8de1('0x28')][_0x8de1('0x38')]){_0x55e9aa['include']=[{'all':!![]}];}return db[_0x8de1('0x23')][_0x8de1('0x39')](_0x55e9aa);})[_0x8de1('0x1c')](function(_0x2b0c9d){_0x857bd6[_0x8de1('0x3a')]=_0x2b0c9d;return _0x857bd6;})[_0x8de1('0x1c')](respondWithFilteredResult(_0xe8f85e,_0x55e9aa))[_0x8de1('0x3b')](handleError(_0xe8f85e,null));};exports['show']=function(_0x30406c,_0x4e8998){var _0x334585={'raw':!![],'where':{'id':_0x30406c[_0x8de1('0x3c')]['id']}},_0x3e2ec8={};_0x3e2ec8[_0x8de1('0x2d')]=_[_0x8de1('0x29')](db[_0x8de1('0x23')][_0x8de1('0x3d')]);_0x3e2ec8['query']=_['keys'](_0x30406c[_0x8de1('0x28')]);_0x3e2ec8[_0x8de1('0x2a')]=_[_0x8de1('0x2b')](_0x3e2ec8[_0x8de1('0x2d')],_0x3e2ec8['query']);_0x334585[_0x8de1('0x2c')]=_['intersection'](_0x3e2ec8[_0x8de1('0x2d')],qs['fields'](_0x30406c['query'][_0x8de1('0x2e')]));_0x334585[_0x8de1('0x2c')]=_0x334585['attributes'][_0x8de1('0x3e')]?_0x334585['attributes']:_0x3e2ec8[_0x8de1('0x2d')];if(_0x30406c['query'][_0x8de1('0x38')]){_0x334585[_0x8de1('0x3f')]=[{'all':!![]}];}_0x334585=_['merge']({},_0x334585,_0x30406c[_0x8de1('0x37')]);return db[_0x8de1('0x23')][_0x8de1('0x40')](_0x334585)['then'](handleEntityNotFound(_0x4e8998,null))[_0x8de1('0x1c')](respondWithResult(_0x4e8998,null))[_0x8de1('0x3b')](handleError(_0x4e8998,null));};exports['create']=function(_0x14e69c,_0x57ca63){return db[_0x8de1('0x23')][_0x8de1('0x41')](_0x14e69c[_0x8de1('0x42')],{})[_0x8de1('0x1c')](respondWithResult(_0x57ca63,0xc9))[_0x8de1('0x3b')](handleError(_0x57ca63,null));};exports[_0x8de1('0x43')]=function(_0x5c0faf,_0x22734d){if(_0x5c0faf[_0x8de1('0x42')]['id']){delete _0x5c0faf[_0x8de1('0x42')]['id'];}return db['FaxQueueReport'][_0x8de1('0x40')]({'where':{'id':_0x5c0faf[_0x8de1('0x3c')]['id']}})[_0x8de1('0x1c')](handleEntityNotFound(_0x22734d,null))[_0x8de1('0x1c')](saveUpdates(_0x5c0faf[_0x8de1('0x42')],null))[_0x8de1('0x1c')](respondWithResult(_0x22734d,null))['catch'](handleError(_0x22734d,null));};exports[_0x8de1('0x1d')]=function(_0x497455,_0x2a8bc1){return db[_0x8de1('0x23')][_0x8de1('0x40')]({'where':{'id':_0x497455[_0x8de1('0x3c')]['id']}})[_0x8de1('0x1c')](handleEntityNotFound(_0x2a8bc1,null))[_0x8de1('0x1c')](removeEntity(_0x2a8bc1,null))['catch'](handleError(_0x2a8bc1,null));};exports[_0x8de1('0x44')]=function(_0x4e18c4,_0x11f31e){return db[_0x8de1('0x23')][_0x8de1('0x44')]()[_0x8de1('0x1c')](respondWithResult(_0x11f31e,null))[_0x8de1('0x3b')](handleError(_0x11f31e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 68ed7f8..ca062b5 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 _0xdf3c=['./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e6f6b,_0x55c2de){var _0x3e69e5=function(_0x4b93a1){while(--_0x4b93a1){_0x5e6f6b['push'](_0x5e6f6b['shift']());}};_0x3e69e5(++_0x55c2de);}(_0xdf3c,0x179));var _0xcdf3=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xdf3c[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xcdf3('0x0'));var moment=require(_0xcdf3('0x1'));var BPromise=require(_0xcdf3('0x2'));var rp=require(_0xcdf3('0x3'));var fs=require('fs');var path=require(_0xcdf3('0x4'));var rimraf=require(_0xcdf3('0x5'));var config=require(_0xcdf3('0x6'));var attributes=require(_0xcdf3('0x7'));module[_0xcdf3('0x8')]=function(_0x33d687,_0x68a00){return _0x33d687[_0xcdf3('0x9')]('FaxQueueReport',attributes,{'tableName':_0xcdf3('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcdf3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08e1=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxQueueReport.attributes','FaxQueueReport','report_fax_queue','uniqueid'];(function(_0x2a9322,_0x2d86fa){var _0x25497a=function(_0x4957f5){while(--_0x4957f5){_0x2a9322['push'](_0x2a9322['shift']());}};_0x25497a(++_0x2d86fa);}(_0x08e1,0x134));var _0x108e=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0x08e1[_0x3fa296];return _0x10b19f;};'use strict';var _=require('lodash');var util=require(_0x108e('0x0'));var logger=require(_0x108e('0x1'))(_0x108e('0x2'));var moment=require(_0x108e('0x3'));var BPromise=require(_0x108e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x108e('0x5'));var rimraf=require('rimraf');var config=require(_0x108e('0x6'));var attributes=require(_0x108e('0x7'));module['exports']=function(_0x113c15,_0x3d0ce3){return _0x113c15['define'](_0x108e('0x8'),attributes,{'tableName':_0x108e('0x9'),'paranoid':![],'indexes':[{'name':_0x108e('0xa'),'fields':[_0x108e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 2ac25b9..68318e8 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 _0x98a8=['CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x191b2d,_0x49d743){var _0xe5c0a0=function(_0x4a3f06){while(--_0x4a3f06){_0x191b2d['push'](_0x191b2d['shift']());}};_0xe5c0a0(++_0x49d743);}(_0x98a8,0x14a));var _0x898a=function(_0xcc4d8d,_0x3776a4){_0xcc4d8d=_0xcc4d8d-0x0;var _0x124da3=_0x98a8[_0xcc4d8d];return _0x124da3;};'use strict';var _=require(_0x898a('0x0'));var util=require('util');var moment=require(_0x898a('0x1'));var BPromise=require(_0x898a('0x2'));var rs=require(_0x898a('0x3'));var fs=require('fs');var Redis=require(_0x898a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x898a('0x5'));var logger=require(_0x898a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x898a('0x7'));var client=jayson[_0x898a('0x8')][_0x898a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238892,_0x161f0e,_0x531c8b){return new BPromise(function(_0x4036c4,_0x4c4a77){return client[_0x898a('0xa')](_0x238892,_0x531c8b)[_0x898a('0xb')](function(_0x1198ac){logger[_0x898a('0xc')](_0x898a('0xd'),_0x161f0e,_0x898a('0xe'));logger[_0x898a('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x161f0e,'request\x20sent',JSON[_0x898a('0x10')](_0x1198ac));if(_0x1198ac['error']){if(_0x1198ac[_0x898a('0x11')][_0x898a('0x12')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x161f0e,_0x1198ac[_0x898a('0x11')][_0x898a('0x13')]);return _0x4c4a77(_0x1198ac[_0x898a('0x11')][_0x898a('0x13')]);}logger[_0x898a('0x11')](_0x898a('0xd'),_0x161f0e,_0x1198ac[_0x898a('0x11')][_0x898a('0x13')]);return _0x4036c4(_0x1198ac[_0x898a('0x11')][_0x898a('0x13')]);}else{logger[_0x898a('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x161f0e,_0x898a('0xe'));_0x4036c4(_0x1198ac[_0x898a('0x14')][_0x898a('0x13')]);}})[_0x898a('0x15')](function(_0x4ca04e){logger[_0x898a('0x11')](_0x898a('0xd'),_0x161f0e,_0x4ca04e);_0x4c4a77(_0x4ca04e);});});}exports[_0x898a('0x16')]=function(_0x53e0c5){var _0x55c051=this;return new Promise(function(_0x473950,_0x86abb0){return db['FaxQueueReport'][_0x898a('0x17')](_0x53e0c5[_0x898a('0x18')],{'raw':_0x53e0c5['options']?_0x53e0c5[_0x898a('0x19')][_0x898a('0x1a')]===undefined?!![]:![]:!![]})[_0x898a('0xb')](function(_0x6965a6){logger[_0x898a('0xc')](_0x898a('0x16'),_0x53e0c5);logger[_0x898a('0xf')](_0x898a('0x16'),_0x53e0c5,JSON[_0x898a('0x10')](_0x6965a6));_0x473950(_0x6965a6);})['catch'](function(_0x143c3e){logger[_0x898a('0x11')](_0x898a('0x16'),_0x143c3e[_0x898a('0x13')],_0x53e0c5);_0x86abb0(_0x55c051['error'](0x1f4,_0x143c3e[_0x898a('0x13')]));});});};exports[_0x898a('0x1b')]=function(_0x5a1638){var _0x21092c=this;return new Promise(function(_0x37cf7c,_0x285fce){return db['FaxQueueReport'][_0x898a('0x1c')](_0x5a1638['body'],{'raw':_0x5a1638[_0x898a('0x19')]?_0x5a1638[_0x898a('0x19')][_0x898a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1638[_0x898a('0x19')]?_0x5a1638['options'][_0x898a('0x1d')]||null:null,'attributes':_0x5a1638[_0x898a('0x19')]?_0x5a1638['options'][_0x898a('0x1e')]||null:null,'limit':_0x5a1638[_0x898a('0x19')]?_0x5a1638[_0x898a('0x19')][_0x898a('0x1f')]||null:null})['then'](function(_0x57e692){logger[_0x898a('0xc')](_0x898a('0x1b'),_0x5a1638);logger[_0x898a('0xf')](_0x898a('0x1b'),_0x5a1638,JSON['stringify'](_0x57e692));_0x37cf7c(_0x57e692);})[_0x898a('0x15')](function(_0x197021){logger[_0x898a('0x11')]('UpdateFaxQueueReport',_0x197021[_0x898a('0x13')],_0x5a1638);_0x285fce(_0x21092c[_0x898a('0x11')](0x1f4,_0x197021[_0x898a('0x13')]));});});}; \ No newline at end of file +var _0x2ceb=['then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x9b5bb2,_0x5db315){var _0x2e1e92=function(_0x5621c9){while(--_0x5621c9){_0x9b5bb2['push'](_0x9b5bb2['shift']());}};_0x2e1e92(++_0x5db315);}(_0x2ceb,0x12d));var _0xb2ce=function(_0x2a9c67,_0x192ba3){_0x2a9c67=_0x2a9c67-0x0;var _0x5bf7ea=_0x2ceb[_0x2a9c67];return _0x5bf7ea;};'use strict';var _=require(_0xb2ce('0x0'));var util=require('util');var moment=require(_0xb2ce('0x1'));var BPromise=require(_0xb2ce('0x2'));var rs=require(_0xb2ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2ce('0x4'));var logger=require(_0xb2ce('0x5'))(_0xb2ce('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb2ce('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29d421,_0x5380a6,_0x24aa07){return new BPromise(function(_0x4a205e,_0x34d649){return client[_0xb2ce('0x8')](_0x29d421,_0x24aa07)[_0xb2ce('0x9')](function(_0x1f51ca){logger['info'](_0xb2ce('0xa'),_0x5380a6,_0xb2ce('0xb'));logger[_0xb2ce('0xc')](_0xb2ce('0xd'),_0x5380a6,_0xb2ce('0xb'),JSON[_0xb2ce('0xe')](_0x1f51ca));if(_0x1f51ca[_0xb2ce('0xf')]){if(_0x1f51ca[_0xb2ce('0xf')][_0xb2ce('0x10')]===0x1f4){logger[_0xb2ce('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x5380a6,_0x1f51ca[_0xb2ce('0xf')][_0xb2ce('0x11')]);return _0x34d649(_0x1f51ca[_0xb2ce('0xf')][_0xb2ce('0x11')]);}logger['error'](_0xb2ce('0xa'),_0x5380a6,_0x1f51ca[_0xb2ce('0xf')][_0xb2ce('0x11')]);return _0x4a205e(_0x1f51ca['error'][_0xb2ce('0x11')]);}else{logger[_0xb2ce('0x12')](_0xb2ce('0xa'),_0x5380a6,_0xb2ce('0xb'));_0x4a205e(_0x1f51ca[_0xb2ce('0x13')]['message']);}})[_0xb2ce('0x14')](function(_0x2a7fea){logger[_0xb2ce('0xf')](_0xb2ce('0xa'),_0x5380a6,_0x2a7fea);_0x34d649(_0x2a7fea);});});}exports[_0xb2ce('0x15')]=function(_0x20de3d){var _0x166d84=this;return new Promise(function(_0x4eae70,_0x37a547){return db[_0xb2ce('0x16')][_0xb2ce('0x17')](_0x20de3d[_0xb2ce('0x18')],{'raw':_0x20de3d[_0xb2ce('0x19')]?_0x20de3d[_0xb2ce('0x19')][_0xb2ce('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x216b02){logger[_0xb2ce('0x12')](_0xb2ce('0x15'),_0x20de3d);logger[_0xb2ce('0xc')]('CreateFaxQueueReport',_0x20de3d,JSON['stringify'](_0x216b02));_0x4eae70(_0x216b02);})[_0xb2ce('0x14')](function(_0x3a9b7d){logger[_0xb2ce('0xf')]('CreateFaxQueueReport',_0x3a9b7d['message'],_0x20de3d);_0x37a547(_0x166d84[_0xb2ce('0xf')](0x1f4,_0x3a9b7d[_0xb2ce('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x3f8ff0){var _0x376851=this;return new Promise(function(_0x95f9a3,_0x30603d){return db[_0xb2ce('0x16')]['update'](_0x3f8ff0[_0xb2ce('0x18')],{'raw':_0x3f8ff0['options']?_0x3f8ff0[_0xb2ce('0x19')][_0xb2ce('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8ff0[_0xb2ce('0x19')]?_0x3f8ff0[_0xb2ce('0x19')][_0xb2ce('0x1b')]||null:null,'attributes':_0x3f8ff0[_0xb2ce('0x19')]?_0x3f8ff0[_0xb2ce('0x19')][_0xb2ce('0x1c')]||null:null,'limit':_0x3f8ff0['options']?_0x3f8ff0[_0xb2ce('0x19')][_0xb2ce('0x1d')]||null:null})['then'](function(_0xcfc429){logger['info'](_0xb2ce('0x1e'),_0x3f8ff0);logger[_0xb2ce('0xc')]('UpdateFaxQueueReport',_0x3f8ff0,JSON['stringify'](_0xcfc429));_0x95f9a3(_0xcfc429);})['catch'](function(_0xd8649b){logger[_0xb2ce('0xf')]('UpdateFaxQueueReport',_0xd8649b['message'],_0x3f8ff0);_0x30603d(_0x376851[_0xb2ce('0xf')](0x1f4,_0xd8649b[_0xb2ce('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 392d273..35c6d03 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 _0xa469=['delete','exports','multer','util','path','connect-timeout','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update'];(function(_0x10cbb8,_0x1c1d23){var _0x5a3dda=function(_0x265f95){while(--_0x265f95){_0x10cbb8['push'](_0x10cbb8['shift']());}};_0x5a3dda(++_0x1c1d23);}(_0xa469,0x145));var _0x9a46=function(_0x57eb27,_0x18373e){_0x57eb27=_0x57eb27-0x0;var _0x45003f=_0xa469[_0x57eb27];return _0x45003f;};'use strict';var multer=require(_0x9a46('0x0'));var util=require(_0x9a46('0x1'));var path=require(_0x9a46('0x2'));var timeout=require(_0x9a46('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a46('0x4'));var controller=require(_0x9a46('0x5'));router[_0x9a46('0x6')]('/',auth[_0x9a46('0x7')](),controller[_0x9a46('0x8')]);router['get'](_0x9a46('0x9'),auth[_0x9a46('0x7')](),controller[_0x9a46('0xa')]);router['get']('/:id',auth[_0x9a46('0x7')](),controller[_0x9a46('0xb')]);router[_0x9a46('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9a46('0xd'),auth['isAuthenticated'](),controller[_0x9a46('0xe')]);router[_0x9a46('0xf')](_0x9a46('0xd'),auth[_0x9a46('0x7')](),controller['destroy']);module[_0x9a46('0x10')]=router; \ No newline at end of file +var _0x215f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','exports','multer','util','path','express'];(function(_0x224834,_0x4055ff){var _0x376e50=function(_0x15ee6c){while(--_0x15ee6c){_0x224834['push'](_0x224834['shift']());}};_0x376e50(++_0x4055ff);}(_0x215f,0x18c));var _0xf215=function(_0x214f37,_0xbafbcf){_0x214f37=_0x214f37-0x0;var _0x4de583=_0x215f[_0x214f37];return _0x4de583;};'use strict';var multer=require(_0xf215('0x0'));var util=require(_0xf215('0x1'));var path=require(_0xf215('0x2'));var timeout=require('connect-timeout');var express=require(_0xf215('0x3'));var router=express[_0xf215('0x4')]();var auth=require(_0xf215('0x5'));var interaction=require(_0xf215('0x6'));var config=require(_0xf215('0x7'));var controller=require(_0xf215('0x8'));router[_0xf215('0x9')]('/',auth[_0xf215('0xa')](),controller[_0xf215('0xb')]);router['get'](_0xf215('0xc'),auth[_0xf215('0xa')](),controller[_0xf215('0xd')]);router[_0xf215('0x9')](_0xf215('0xe'),auth[_0xf215('0xa')](),controller[_0xf215('0xf')]);router[_0xf215('0x10')]('/',auth[_0xf215('0xa')](),controller[_0xf215('0x11')]);router['put'](_0xf215('0xe'),auth[_0xf215('0xa')](),controller[_0xf215('0x12')]);router['delete'](_0xf215('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xf215('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 86b1aba..ba5b691 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 _0x9f9b=['DATE','NOW','moment','sequelize','STRING','ENUM','account'];(function(_0x24c55d,_0x35e9f0){var _0x3776ba=function(_0x45c5e0){while(--_0x45c5e0){_0x24c55d['push'](_0x24c55d['shift']());}};_0x3776ba(++_0x35e9f0);}(_0x9f9b,0x105));var _0xb9f9=function(_0x2a4692,_0x5db910){_0x2a4692=_0x2a4692-0x0;var _0x370e6b=_0x9f9b[_0x2a4692];return _0x370e6b;};'use strict';var moment=require(_0xb9f9('0x0'));var Sequelize=require(_0xb9f9('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb9f9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb9f9('0x3')](_0xb9f9('0x4'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb9f9('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xb9f9('0x6')]}}; \ No newline at end of file +var _0x41b8=['queue','DATE','NOW','moment','sequelize','exports','ENUM','agent'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x41b8,0x11b));var _0x841b=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x41b8[_0x4b1032];return _0x5a1d55;};'use strict';var moment=require(_0x841b('0x0'));var Sequelize=require(_0x841b('0x1'));module[_0x841b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x841b('0x3')]('account',_0x841b('0x4'),'queue'),'allowNull':![],'defaultValue':_0x841b('0x5')},'transferredAt':{'type':Sequelize[_0x841b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x841b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index c711060..ca6250f 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 _0x4317=['model','attributes','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','keys','rawAttributes','length','includeAll','create','body','catch','update','find','params','destroy','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','index','FaxTransferReport','fieldName','type','map','query','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4317,0x69));var _0x7431=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4317[_0x465028];return _0xb783d4;};'use strict';var pdf=require(_0x7431('0x0'));var emlformat=require(_0x7431('0x1'));var rimraf=require(_0x7431('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7431('0x3'));var moment=require(_0x7431('0x4'));var BPromise=require(_0x7431('0x5'));var Mustache=require(_0x7431('0x6'));var util=require(_0x7431('0x7'));var path=require(_0x7431('0x8'));var sox=require(_0x7431('0x9'));var csv=require(_0x7431('0xa'));var ejs=require(_0x7431('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7431('0xc'));var crypto=require(_0x7431('0xd'));var jsforce=require(_0x7431('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7431('0xa'));var querystring=require(_0x7431('0xf'));var Papa=require(_0x7431('0x10'));var Redis=require(_0x7431('0x11'));var authService=require(_0x7431('0x12'));var qs=require(_0x7431('0x13'));var as=require(_0x7431('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7431('0x15'))(_0x7431('0x16'));var utils=require(_0x7431('0x17'));var config=require(_0x7431('0x18'));var db=require(_0x7431('0x19'))['db'];function respondWithStatusCode(_0x1d2ae6,_0x108672){_0x108672=_0x108672||0xcc;return function(_0x262e84){if(_0x262e84){return _0x1d2ae6[_0x7431('0x1a')](_0x108672);}return _0x1d2ae6[_0x7431('0x1b')](_0x108672)[_0x7431('0x1c')]();};}function respondWithResult(_0x469907,_0x1987e8){_0x1987e8=_0x1987e8||0xc8;return function(_0x201f12){if(_0x201f12){return _0x469907[_0x7431('0x1b')](_0x1987e8)[_0x7431('0x1d')](_0x201f12);}};}function respondWithFilteredResult(_0x4a484d,_0x408126){return function(_0x5c37dc){if(_0x5c37dc){var _0x496e77=_0x5c37dc[_0x7431('0x1e')],_0x4b778d=_0x408126[_0x7431('0x1f')],_0x5670e7=_0x408126[_0x7431('0x1f')]+_0x408126['limit'],_0x35ccd0;if(_0x5670e7>=_0x496e77){_0x5670e7=_0x496e77;_0x35ccd0=0xc8;}else{_0x35ccd0=0xce;}_0x4a484d[_0x7431('0x1b')](_0x35ccd0);return _0x4a484d[_0x7431('0x20')](_0x7431('0x21'),_0x4b778d+'-'+_0x5670e7+'/'+_0x496e77)[_0x7431('0x1d')](_0x5c37dc);}return null;};}function patchUpdates(_0xf064cf){return function(_0x4ef595){try{jsonpatch[_0x7431('0x22')](_0x4ef595,_0xf064cf,!![]);}catch(_0x59da26){return BPromise[_0x7431('0x23')](_0x59da26);}return _0x4ef595[_0x7431('0x24')]();};}function saveUpdates(_0x59c465,_0x29bee8){return function(_0xa60c09){if(_0xa60c09){return _0xa60c09['update'](_0x59c465)[_0x7431('0x25')](function(_0x4450e8){return _0x4450e8;});}return null;};}function removeEntity(_0x2c733b,_0x5b027b){return function(_0x230a24){if(_0x230a24){return _0x230a24['destroy']()['then'](function(){_0x2c733b['status'](0xcc)[_0x7431('0x1c')]();});}};}function handleEntityNotFound(_0x2a4247,_0x5405a4){return function(_0x4d7d96){if(!_0x4d7d96){_0x2a4247[_0x7431('0x1a')](0x194);}return _0x4d7d96;};}function handleError(_0x4c5889,_0x19ca57){_0x19ca57=_0x19ca57||0x1f4;return function(_0x317cc8){logger[_0x7431('0x26')](_0x317cc8[_0x7431('0x27')]);if(_0x317cc8[_0x7431('0x28')]){delete _0x317cc8[_0x7431('0x28')];}_0x4c5889['status'](_0x19ca57)['send'](_0x317cc8);};}exports[_0x7431('0x29')]=function(_0x2e4efd,_0x14fe0f){var _0x474cd0={},_0x42abbe={},_0x47ee7d={'count':0x0,'rows':[]};var _0x274f45=_['map'](db[_0x7431('0x2a')]['rawAttributes'],function(_0x6cd9d2){return{'name':_0x6cd9d2[_0x7431('0x2b')],'type':_0x6cd9d2[_0x7431('0x2c')]['key']};});_0x42abbe['model']=_[_0x7431('0x2d')](_0x274f45,_0x7431('0x28'));_0x42abbe[_0x7431('0x2e')]=_['keys'](_0x2e4efd['query']);_0x42abbe[_0x7431('0x2f')]=_[_0x7431('0x30')](_0x42abbe[_0x7431('0x31')],_0x42abbe[_0x7431('0x2e')]);_0x474cd0[_0x7431('0x32')]=_[_0x7431('0x30')](_0x42abbe[_0x7431('0x31')],qs[_0x7431('0x33')](_0x2e4efd[_0x7431('0x2e')][_0x7431('0x33')]));_0x474cd0['attributes']=_0x474cd0[_0x7431('0x32')]['length']?_0x474cd0[_0x7431('0x32')]:_0x42abbe['model'];if(!_0x2e4efd[_0x7431('0x2e')]['hasOwnProperty'](_0x7431('0x34'))){_0x474cd0['limit']=qs[_0x7431('0x35')](_0x2e4efd[_0x7431('0x2e')][_0x7431('0x35')]);_0x474cd0[_0x7431('0x1f')]=qs[_0x7431('0x1f')](_0x2e4efd[_0x7431('0x2e')][_0x7431('0x1f')]);}_0x474cd0[_0x7431('0x36')]=qs[_0x7431('0x37')](_0x2e4efd[_0x7431('0x2e')][_0x7431('0x37')]);_0x474cd0[_0x7431('0x38')]=qs[_0x7431('0x2f')](_[_0x7431('0x39')](_0x2e4efd[_0x7431('0x2e')],_0x42abbe[_0x7431('0x2f')]));if(_0x2e4efd[_0x7431('0x2e')][_0x7431('0x3a')]){_0x474cd0[_0x7431('0x38')]=_['merge'](_0x474cd0[_0x7431('0x38')],{'$or':_[_0x7431('0x2d')](_0x274f45,function(_0x1cd2f2){if(_0x1cd2f2[_0x7431('0x2c')]!==_0x7431('0x3b')){var _0x2de881={};_0x2de881[_0x1cd2f2[_0x7431('0x28')]]={'$like':'%'+_0x2e4efd[_0x7431('0x2e')][_0x7431('0x3a')]+'%'};return _0x2de881;}})});}_0x474cd0=_[_0x7431('0x3c')]({},_0x474cd0,_0x2e4efd[_0x7431('0x3d')]);var _0x5f3e61={'where':_0x474cd0['where']};return db[_0x7431('0x2a')][_0x7431('0x1e')](_0x5f3e61)[_0x7431('0x25')](function(_0x43e88a){_0x47ee7d[_0x7431('0x1e')]=_0x43e88a;if(_0x2e4efd[_0x7431('0x2e')]['includeAll']){_0x474cd0[_0x7431('0x3e')]=[{'all':!![]}];}return db[_0x7431('0x2a')][_0x7431('0x3f')](_0x474cd0);})['then'](function(_0x1e34ad){_0x47ee7d[_0x7431('0x40')]=_0x1e34ad;return _0x47ee7d;})[_0x7431('0x25')](respondWithFilteredResult(_0x14fe0f,_0x474cd0))['catch'](handleError(_0x14fe0f,null));};exports['show']=function(_0x431af0,_0x5ec645){var _0x467914={'raw':!![],'where':{'id':_0x431af0['params']['id']}},_0x52445b={};_0x52445b[_0x7431('0x31')]=_[_0x7431('0x41')](db[_0x7431('0x2a')][_0x7431('0x42')]);_0x52445b[_0x7431('0x2e')]=_[_0x7431('0x41')](_0x431af0[_0x7431('0x2e')]);_0x52445b[_0x7431('0x2f')]=_[_0x7431('0x30')](_0x52445b[_0x7431('0x31')],_0x52445b['query']);_0x467914[_0x7431('0x32')]=_[_0x7431('0x30')](_0x52445b['model'],qs['fields'](_0x431af0[_0x7431('0x2e')]['fields']));_0x467914[_0x7431('0x32')]=_0x467914[_0x7431('0x32')][_0x7431('0x43')]?_0x467914[_0x7431('0x32')]:_0x52445b[_0x7431('0x31')];if(_0x431af0[_0x7431('0x2e')][_0x7431('0x44')]){_0x467914['include']=[{'all':!![]}];}_0x467914=_['merge']({},_0x467914,_0x431af0['options']);return db['FaxTransferReport']['find'](_0x467914)[_0x7431('0x25')](handleEntityNotFound(_0x5ec645,null))[_0x7431('0x25')](respondWithResult(_0x5ec645,null))['catch'](handleError(_0x5ec645,null));};exports[_0x7431('0x45')]=function(_0x5a6a7a,_0x22ff94){return db[_0x7431('0x2a')]['create'](_0x5a6a7a[_0x7431('0x46')],{})[_0x7431('0x25')](respondWithResult(_0x22ff94,0xc9))[_0x7431('0x47')](handleError(_0x22ff94,null));};exports[_0x7431('0x48')]=function(_0x4f4457,_0x326454){if(_0x4f4457[_0x7431('0x46')]['id']){delete _0x4f4457[_0x7431('0x46')]['id'];}return db[_0x7431('0x2a')][_0x7431('0x49')]({'where':{'id':_0x4f4457[_0x7431('0x4a')]['id']}})[_0x7431('0x25')](handleEntityNotFound(_0x326454,null))[_0x7431('0x25')](saveUpdates(_0x4f4457[_0x7431('0x46')],null))[_0x7431('0x25')](respondWithResult(_0x326454,null))[_0x7431('0x47')](handleError(_0x326454,null));};exports[_0x7431('0x4b')]=function(_0x342b0b,_0x50082d){return db[_0x7431('0x2a')]['find']({'where':{'id':_0x342b0b[_0x7431('0x4a')]['id']}})[_0x7431('0x25')](handleEntityNotFound(_0x50082d,null))[_0x7431('0x25')](removeEntity(_0x50082d,null))[_0x7431('0x47')](handleError(_0x50082d,null));};exports[_0x7431('0x4c')]=function(_0x5ac0ce,_0x2390f9){return db[_0x7431('0x2a')][_0x7431('0x4c')]()['then'](respondWithResult(_0x2390f9,null))['catch'](handleError(_0x2390f9,null));}; \ No newline at end of file +var _0x5578=['../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','FaxTransferReport','rawAttributes','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','params','find','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x5578,0x79));var _0x8557=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0x5578[_0x18f64a];return _0x44687f;};'use strict';var pdf=require(_0x8557('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8557('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8557('0x2'));var rp=require(_0x8557('0x3'));var moment=require(_0x8557('0x4'));var BPromise=require(_0x8557('0x5'));var Mustache=require('mustache');var util=require(_0x8557('0x6'));var path=require(_0x8557('0x7'));var sox=require(_0x8557('0x8'));var csv=require(_0x8557('0x9'));var ejs=require(_0x8557('0xa'));var fs=require('fs');var _=require(_0x8557('0xb'));var squel=require(_0x8557('0xc'));var crypto=require(_0x8557('0xd'));var jsforce=require(_0x8557('0xe'));var deskjs=require(_0x8557('0xf'));var toCsv=require(_0x8557('0x9'));var querystring=require(_0x8557('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8557('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8557('0x12'));var hardwareService=require(_0x8557('0x13'));var logger=require(_0x8557('0x14'))(_0x8557('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8557('0x16'))['db'];function respondWithStatusCode(_0x401554,_0x221f39){_0x221f39=_0x221f39||0xcc;return function(_0x501b56){if(_0x501b56){return _0x401554[_0x8557('0x17')](_0x221f39);}return _0x401554[_0x8557('0x18')](_0x221f39)['end']();};}function respondWithResult(_0x266670,_0x2d52bb){_0x2d52bb=_0x2d52bb||0xc8;return function(_0x3e7a0c){if(_0x3e7a0c){return _0x266670[_0x8557('0x18')](_0x2d52bb)[_0x8557('0x19')](_0x3e7a0c);}};}function respondWithFilteredResult(_0x3b4931,_0x5202ff){return function(_0x367a10){if(_0x367a10){var _0x1ed670=_0x367a10[_0x8557('0x1a')],_0x4ade6f=_0x5202ff[_0x8557('0x1b')],_0x2edc4f=_0x5202ff[_0x8557('0x1b')]+_0x5202ff[_0x8557('0x1c')],_0x56500e;if(_0x2edc4f>=_0x1ed670){_0x2edc4f=_0x1ed670;_0x56500e=0xc8;}else{_0x56500e=0xce;}_0x3b4931[_0x8557('0x18')](_0x56500e);return _0x3b4931[_0x8557('0x1d')](_0x8557('0x1e'),_0x4ade6f+'-'+_0x2edc4f+'/'+_0x1ed670)['json'](_0x367a10);}return null;};}function patchUpdates(_0x3eadf8){return function(_0x15d0d5){try{jsonpatch['apply'](_0x15d0d5,_0x3eadf8,!![]);}catch(_0x51b260){return BPromise[_0x8557('0x1f')](_0x51b260);}return _0x15d0d5['save']();};}function saveUpdates(_0x2b2521,_0xa9152d){return function(_0xfdb253){if(_0xfdb253){return _0xfdb253[_0x8557('0x20')](_0x2b2521)[_0x8557('0x21')](function(_0x213918){return _0x213918;});}return null;};}function removeEntity(_0x3f5992,_0x44741c){return function(_0x4d0179){if(_0x4d0179){return _0x4d0179[_0x8557('0x22')]()[_0x8557('0x21')](function(){_0x3f5992[_0x8557('0x18')](0xcc)[_0x8557('0x23')]();});}};}function handleEntityNotFound(_0x8d2f42,_0x5353ee){return function(_0x36a673){if(!_0x36a673){_0x8d2f42[_0x8557('0x17')](0x194);}return _0x36a673;};}function handleError(_0x43cc1e,_0x31f9f2){_0x31f9f2=_0x31f9f2||0x1f4;return function(_0x1f9a07){logger[_0x8557('0x24')](_0x1f9a07[_0x8557('0x25')]);if(_0x1f9a07[_0x8557('0x26')]){delete _0x1f9a07['name'];}_0x43cc1e[_0x8557('0x18')](_0x31f9f2)[_0x8557('0x27')](_0x1f9a07);};}exports[_0x8557('0x28')]=function(_0x214b63,_0x1cbea0){var _0x2cb431={},_0x1792ba={},_0x41a6d2={'count':0x0,'rows':[]};var _0x229f7d=_['map'](db[_0x8557('0x29')][_0x8557('0x2a')],function(_0x3c323b){return{'name':_0x3c323b['fieldName'],'type':_0x3c323b[_0x8557('0x2b')][_0x8557('0x2c')]};});_0x1792ba[_0x8557('0x2d')]=_[_0x8557('0x2e')](_0x229f7d,_0x8557('0x26'));_0x1792ba['query']=_[_0x8557('0x2f')](_0x214b63[_0x8557('0x30')]);_0x1792ba['filters']=_[_0x8557('0x31')](_0x1792ba[_0x8557('0x2d')],_0x1792ba[_0x8557('0x30')]);_0x2cb431['attributes']=_[_0x8557('0x31')](_0x1792ba[_0x8557('0x2d')],qs[_0x8557('0x32')](_0x214b63[_0x8557('0x30')]['fields']));_0x2cb431[_0x8557('0x33')]=_0x2cb431[_0x8557('0x33')][_0x8557('0x34')]?_0x2cb431[_0x8557('0x33')]:_0x1792ba[_0x8557('0x2d')];if(!_0x214b63[_0x8557('0x30')][_0x8557('0x35')](_0x8557('0x36'))){_0x2cb431['limit']=qs[_0x8557('0x1c')](_0x214b63[_0x8557('0x30')][_0x8557('0x1c')]);_0x2cb431[_0x8557('0x1b')]=qs[_0x8557('0x1b')](_0x214b63['query'][_0x8557('0x1b')]);}_0x2cb431['order']=qs[_0x8557('0x37')](_0x214b63[_0x8557('0x30')][_0x8557('0x37')]);_0x2cb431[_0x8557('0x38')]=qs[_0x8557('0x39')](_[_0x8557('0x3a')](_0x214b63['query'],_0x1792ba[_0x8557('0x39')]));if(_0x214b63[_0x8557('0x30')][_0x8557('0x3b')]){_0x2cb431[_0x8557('0x38')]=_[_0x8557('0x3c')](_0x2cb431['where'],{'$or':_[_0x8557('0x2e')](_0x229f7d,function(_0x24a32e){if(_0x24a32e[_0x8557('0x2b')]!==_0x8557('0x3d')){var _0x39b08b={};_0x39b08b[_0x24a32e['name']]={'$like':'%'+_0x214b63[_0x8557('0x30')][_0x8557('0x3b')]+'%'};return _0x39b08b;}})});}_0x2cb431=_[_0x8557('0x3c')]({},_0x2cb431,_0x214b63[_0x8557('0x3e')]);var _0x1de305={'where':_0x2cb431['where']};return db[_0x8557('0x29')]['count'](_0x1de305)[_0x8557('0x21')](function(_0x22c656){_0x41a6d2[_0x8557('0x1a')]=_0x22c656;if(_0x214b63[_0x8557('0x30')]['includeAll']){_0x2cb431[_0x8557('0x3f')]=[{'all':!![]}];}return db[_0x8557('0x29')]['findAll'](_0x2cb431);})[_0x8557('0x21')](function(_0xe8edcd){_0x41a6d2['rows']=_0xe8edcd;return _0x41a6d2;})['then'](respondWithFilteredResult(_0x1cbea0,_0x2cb431))[_0x8557('0x40')](handleError(_0x1cbea0,null));};exports['show']=function(_0x293424,_0x32c7b5){var _0x3e60b7={'raw':!![],'where':{'id':_0x293424[_0x8557('0x41')]['id']}},_0x4a778b={};_0x4a778b['model']=_['keys'](db[_0x8557('0x29')]['rawAttributes']);_0x4a778b['query']=_[_0x8557('0x2f')](_0x293424['query']);_0x4a778b[_0x8557('0x39')]=_['intersection'](_0x4a778b[_0x8557('0x2d')],_0x4a778b[_0x8557('0x30')]);_0x3e60b7[_0x8557('0x33')]=_[_0x8557('0x31')](_0x4a778b[_0x8557('0x2d')],qs[_0x8557('0x32')](_0x293424[_0x8557('0x30')]['fields']));_0x3e60b7['attributes']=_0x3e60b7[_0x8557('0x33')][_0x8557('0x34')]?_0x3e60b7[_0x8557('0x33')]:_0x4a778b['model'];if(_0x293424[_0x8557('0x30')]['includeAll']){_0x3e60b7[_0x8557('0x3f')]=[{'all':!![]}];}_0x3e60b7=_['merge']({},_0x3e60b7,_0x293424[_0x8557('0x3e')]);return db['FaxTransferReport'][_0x8557('0x42')](_0x3e60b7)[_0x8557('0x21')](handleEntityNotFound(_0x32c7b5,null))['then'](respondWithResult(_0x32c7b5,null))['catch'](handleError(_0x32c7b5,null));};exports[_0x8557('0x43')]=function(_0x180e93,_0x569260){return db[_0x8557('0x29')][_0x8557('0x43')](_0x180e93[_0x8557('0x44')],{})['then'](respondWithResult(_0x569260,0xc9))[_0x8557('0x40')](handleError(_0x569260,null));};exports[_0x8557('0x20')]=function(_0xd5f8c6,_0x464987){if(_0xd5f8c6[_0x8557('0x44')]['id']){delete _0xd5f8c6['body']['id'];}return db[_0x8557('0x29')][_0x8557('0x42')]({'where':{'id':_0xd5f8c6['params']['id']}})[_0x8557('0x21')](handleEntityNotFound(_0x464987,null))['then'](saveUpdates(_0xd5f8c6[_0x8557('0x44')],null))[_0x8557('0x21')](respondWithResult(_0x464987,null))[_0x8557('0x40')](handleError(_0x464987,null));};exports['destroy']=function(_0x382b8d,_0x36ae2d){return db['FaxTransferReport']['find']({'where':{'id':_0x382b8d[_0x8557('0x41')]['id']}})[_0x8557('0x21')](handleEntityNotFound(_0x36ae2d,null))[_0x8557('0x21')](removeEntity(_0x36ae2d,null))['catch'](handleError(_0x36ae2d,null));};exports[_0x8557('0x45')]=function(_0x3647b2,_0x54de84){return db[_0x8557('0x29')]['describe']()['then'](respondWithResult(_0x54de84,null))[_0x8557('0x40')](handleError(_0x54de84,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d39f3e1..2a171bc 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 _0xb728=['api','bluebird','request-promise','path','../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x396df0,_0x16526e){var _0x35bba6=function(_0x219ee9){while(--_0x219ee9){_0x396df0['push'](_0x396df0['shift']());}};_0x35bba6(++_0x16526e);}(_0xb728,0x11d));var _0x8b72=function(_0x155f23,_0x580a3a){_0x155f23=_0x155f23-0x0;var _0x5c18d7=_0xb728[_0x155f23];return _0x5c18d7;};'use strict';var _=require(_0x8b72('0x0'));var util=require(_0x8b72('0x1'));var logger=require(_0x8b72('0x2'))(_0x8b72('0x3'));var moment=require('moment');var BPromise=require(_0x8b72('0x4'));var rp=require(_0x8b72('0x5'));var fs=require('fs');var path=require(_0x8b72('0x6'));var rimraf=require('rimraf');var config=require(_0x8b72('0x7'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x3ffb3a,_0x457776){return _0x3ffb3a[_0x8b72('0x8')](_0x8b72('0x9'),attributes,{'tableName':_0x8b72('0xa'),'paranoid':![],'indexes':[{'name':_0x8b72('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc063=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xc063,0xb6));var _0x3c06=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xc063[_0x404957];return _0x4e0365;};'use strict';var _=require(_0x3c06('0x0'));var util=require(_0x3c06('0x1'));var logger=require(_0x3c06('0x2'))(_0x3c06('0x3'));var moment=require('moment');var BPromise=require(_0x3c06('0x4'));var rp=require(_0x3c06('0x5'));var fs=require('fs');var path=require(_0x3c06('0x6'));var rimraf=require(_0x3c06('0x7'));var config=require(_0x3c06('0x8'));var attributes=require(_0x3c06('0x9'));module[_0x3c06('0xa')]=function(_0x1df708,_0x1027b1){return _0x1df708['define'](_0x3c06('0xb'),attributes,{'tableName':_0x3c06('0xc'),'paranoid':![],'indexes':[{'name':_0x3c06('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index e3f7e7c..5d471f2 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 _0x7142=['result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5a6950,_0x4ef6b1){var _0x13613a=function(_0x48f434){while(--_0x48f434){_0x5a6950['push'](_0x5a6950['shift']());}};_0x13613a(++_0x4ef6b1);}(_0x7142,0x132));var _0x2714=function(_0x48ec86,_0x245530){_0x48ec86=_0x48ec86-0x0;var _0x44325d=_0x7142[_0x48ec86];return _0x44325d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2714('0x0'));var rs=require(_0x2714('0x1'));var fs=require('fs');var Redis=require(_0x2714('0x2'));var db=require(_0x2714('0x3'))['db'];var utils=require(_0x2714('0x4'));var logger=require(_0x2714('0x5'))(_0x2714('0x6'));var config=require('../../config/environment');var jayson=require(_0x2714('0x7'));var client=jayson[_0x2714('0x8')][_0x2714('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a3c3a,_0x3324fa,_0x3af89e){return new BPromise(function(_0x3aa59f,_0x40419c){return client[_0x2714('0xa')](_0x2a3c3a,_0x3af89e)['then'](function(_0x462cf7){logger['info'](_0x2714('0xb'),_0x3324fa,'request\x20sent');logger[_0x2714('0xc')](_0x2714('0xd'),_0x3324fa,'request\x20sent',JSON[_0x2714('0xe')](_0x462cf7));if(_0x462cf7[_0x2714('0xf')]){if(_0x462cf7[_0x2714('0xf')]['code']===0x1f4){logger[_0x2714('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x3324fa,_0x462cf7['error'][_0x2714('0x10')]);return _0x40419c(_0x462cf7[_0x2714('0xf')][_0x2714('0x10')]);}logger['error'](_0x2714('0xb'),_0x3324fa,_0x462cf7[_0x2714('0xf')][_0x2714('0x10')]);return _0x3aa59f(_0x462cf7[_0x2714('0xf')][_0x2714('0x10')]);}else{logger['info'](_0x2714('0xb'),_0x3324fa,'request\x20sent');_0x3aa59f(_0x462cf7[_0x2714('0x11')][_0x2714('0x10')]);}})[_0x2714('0x12')](function(_0x50b49b){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x3324fa,_0x50b49b);_0x40419c(_0x50b49b);});});} \ No newline at end of file +var _0x4ede=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird'];(function(_0x3652cb,_0x54a079){var _0x570f8c=function(_0xd4a90){while(--_0xd4a90){_0x3652cb['push'](_0x3652cb['shift']());}};_0x570f8c(++_0x54a079);}(_0x4ede,0xfa));var _0xe4ed=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4ede[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe4ed('0x0'));var util=require(_0xe4ed('0x1'));var moment=require('moment');var BPromise=require(_0xe4ed('0x2'));var rs=require(_0xe4ed('0x3'));var fs=require('fs');var Redis=require(_0xe4ed('0x4'));var db=require(_0xe4ed('0x5'))['db'];var utils=require(_0xe4ed('0x6'));var logger=require(_0xe4ed('0x7'))(_0xe4ed('0x8'));var config=require(_0xe4ed('0x9'));var jayson=require(_0xe4ed('0xa'));var client=jayson['client'][_0xe4ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e2f57,_0x56a05b,_0x5ac638){return new BPromise(function(_0x1a29e6,_0x214acd){return client[_0xe4ed('0xc')](_0x5e2f57,_0x5ac638)[_0xe4ed('0xd')](function(_0x3b447a){logger['info'](_0xe4ed('0xe'),_0x56a05b,_0xe4ed('0xf'));logger[_0xe4ed('0x10')](_0xe4ed('0x11'),_0x56a05b,_0xe4ed('0xf'),JSON[_0xe4ed('0x12')](_0x3b447a));if(_0x3b447a[_0xe4ed('0x13')]){if(_0x3b447a[_0xe4ed('0x13')]['code']===0x1f4){logger[_0xe4ed('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x56a05b,_0x3b447a['error']['message']);return _0x214acd(_0x3b447a[_0xe4ed('0x13')][_0xe4ed('0x14')]);}logger[_0xe4ed('0x13')](_0xe4ed('0xe'),_0x56a05b,_0x3b447a[_0xe4ed('0x13')]['message']);return _0x1a29e6(_0x3b447a[_0xe4ed('0x13')][_0xe4ed('0x14')]);}else{logger[_0xe4ed('0x15')](_0xe4ed('0xe'),_0x56a05b,_0xe4ed('0xf'));_0x1a29e6(_0x3b447a['result'][_0xe4ed('0x14')]);}})[_0xe4ed('0x16')](function(_0x50c2d4){logger[_0xe4ed('0x13')](_0xe4ed('0xe'),_0x56a05b,_0x50c2d4);_0x214acd(_0x50c2d4);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 74780ff..d8e0340 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 _0x195b=['create','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post'];(function(_0x4f9939,_0x56fa3b){var _0x5e8326=function(_0x46752d){while(--_0x46752d){_0x4f9939['push'](_0x4f9939['shift']());}};_0x5e8326(++_0x56fa3b);}(_0x195b,0xdd));var _0xb195=function(_0x53ebaa,_0x38d1bd){_0x53ebaa=_0x53ebaa-0x0;var _0x45a715=_0x195b[_0x53ebaa];return _0x45a715;};'use strict';var multer=require(_0xb195('0x0'));var util=require(_0xb195('0x1'));var path=require('path');var timeout=require(_0xb195('0x2'));var express=require(_0xb195('0x3'));var router=express[_0xb195('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb195('0x5'));var controller=require('./faxTransferReport.controller');router[_0xb195('0x6')]('/',auth['isAuthenticated'](),controller[_0xb195('0x7')]);router[_0xb195('0x6')](_0xb195('0x8'),auth[_0xb195('0x9')](),controller[_0xb195('0xa')]);router[_0xb195('0x6')]('/:id',auth[_0xb195('0x9')](),controller[_0xb195('0xb')]);router[_0xb195('0xc')]('/',auth['isAuthenticated'](),controller[_0xb195('0xd')]);router['put'](_0xb195('0xe'),auth[_0xb195('0x9')](),controller[_0xb195('0xf')]);router[_0xb195('0x10')](_0xb195('0xe'),auth[_0xb195('0x9')](),controller['destroy']);module[_0xb195('0x11')]=router; \ No newline at end of file +var _0xfbf4=['post','create','put','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/:id','show'];(function(_0x48f29b,_0x474d55){var _0x50f9e7=function(_0x5aaf09){while(--_0x5aaf09){_0x48f29b['push'](_0x48f29b['shift']());}};_0x50f9e7(++_0x474d55);}(_0xfbf4,0x1b6));var _0x4fbf=function(_0x428fa3,_0x2bfd49){_0x428fa3=_0x428fa3-0x0;var _0x5bba51=_0xfbf4[_0x428fa3];return _0x5bba51;};'use strict';var multer=require(_0x4fbf('0x0'));var util=require('util');var path=require(_0x4fbf('0x1'));var timeout=require(_0x4fbf('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4fbf('0x3'));var interaction=require(_0x4fbf('0x4'));var config=require(_0x4fbf('0x5'));var controller=require(_0x4fbf('0x6'));router['get']('/',auth[_0x4fbf('0x7')](),controller[_0x4fbf('0x8')]);router[_0x4fbf('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4fbf('0x9')](_0x4fbf('0xa'),auth[_0x4fbf('0x7')](),controller[_0x4fbf('0xb')]);router[_0x4fbf('0xc')]('/',auth[_0x4fbf('0x7')](),controller[_0x4fbf('0xd')]);router[_0x4fbf('0xe')](_0x4fbf('0xa'),auth[_0x4fbf('0x7')](),controller['update']);router[_0x4fbf('0xf')](_0x4fbf('0xa'),auth[_0x4fbf('0x7')](),controller[_0x4fbf('0x10')]);module[_0x4fbf('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 057e201..d2ddd36 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 _0x3c17=['path','express','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','delete','destroy','multer'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3c17,0x1a1));var _0x73c1=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x3c17[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x73c1('0x0'));var util=require('util');var path=require(_0x73c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x73c1('0x2'));var router=express[_0x73c1('0x3')]();var auth=require(_0x73c1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x73c1('0x5'));var controller=require(_0x73c1('0x6'));router[_0x73c1('0x7')]('/',auth[_0x73c1('0x8')](),controller['index']);router[_0x73c1('0x7')]('/:id',auth[_0x73c1('0x8')](),controller[_0x73c1('0x9')]);router[_0x73c1('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x73c1('0xa')]);router[_0x73c1('0x7')](_0x73c1('0xb'),auth[_0x73c1('0x8')](),controller[_0x73c1('0xc')]);router[_0x73c1('0xd')]('/',auth[_0x73c1('0x8')](),controller['create']);router['post'](_0x73c1('0xe'),auth[_0x73c1('0x8')](),controller[_0x73c1('0xf')]);router[_0x73c1('0x10')]('/:id',auth[_0x73c1('0x8')](),controller['update']);router[_0x73c1('0x11')]('/:id',auth[_0x73c1('0x8')](),controller[_0x73c1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x99c9=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller'];(function(_0x1a4f40,_0x408bea){var _0x1e475a=function(_0xe9f35c){while(--_0xe9f35c){_0x1a4f40['push'](_0x1a4f40['shift']());}};_0x1e475a(++_0x408bea);}(_0x99c9,0x13c));var _0x999c=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x99c9[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var path=require(_0x999c('0x2'));var timeout=require(_0x999c('0x3'));var express=require(_0x999c('0x4'));var router=express[_0x999c('0x5')]();var auth=require(_0x999c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x999c('0x7'));var controller=require(_0x999c('0x8'));router[_0x999c('0x9')]('/',auth[_0x999c('0xa')](),controller[_0x999c('0xb')]);router[_0x999c('0x9')](_0x999c('0xc'),auth[_0x999c('0xa')](),controller[_0x999c('0xd')]);router[_0x999c('0x9')](_0x999c('0xe'),auth[_0x999c('0xa')](),controller[_0x999c('0xf')]);router[_0x999c('0x9')]('/:id/fields',auth[_0x999c('0xa')](),controller[_0x999c('0x10')]);router['post']('/',auth[_0x999c('0xa')](),controller[_0x999c('0x11')]);router[_0x999c('0x12')](_0x999c('0xe'),auth[_0x999c('0xa')](),controller[_0x999c('0x13')]);router[_0x999c('0x14')](_0x999c('0xc'),auth[_0x999c('0xa')](),controller[_0x999c('0x15')]);router[_0x999c('0x16')](_0x999c('0xc'),auth['isAuthenticated'](),controller[_0x999c('0x17')]);module[_0x999c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e55d80e..7607a7b 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 _0xb247=['basic','integrationTab','STRING'];(function(_0x365366,_0x186bc4){var _0x5f4aba=function(_0x3da9d8){while(--_0x3da9d8){_0x365366['push'](_0x365366['shift']());}};_0x5f4aba(++_0x186bc4);}(_0xb247,0x185));var _0x7b24=function(_0x47bc58,_0x1e1998){_0x47bc58=_0x47bc58-0x0;var _0x4a0860=_0xb247[_0x47bc58];return _0x4a0860;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7b24('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x7b24('0x1')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x7b24('0x0')]},'consumerSecret':{'type':Sequelize[_0x7b24('0x0')]},'token':{'type':Sequelize[_0x7b24('0x0')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7b24('0x0')]},'type':{'type':Sequelize['ENUM'](_0x7b24('0x2'),'newTab'),'defaultValue':_0x7b24('0x2')}}; \ No newline at end of file +var _0x737d=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x43e190,_0x32f785){var _0x22a556=function(_0x5dd73b){while(--_0x5dd73b){_0x43e190['push'](_0x43e190['shift']());}};_0x22a556(++_0x32f785);}(_0x737d,0x18d));var _0xd737=function(_0x58d669,_0x59a243){_0x58d669=_0x58d669-0x0;var _0x25d5f4=_0x737d[_0x58d669];return _0x25d5f4;};'use strict';var Sequelize=require(_0xd737('0x0'));module[_0xd737('0x1')]={'name':{'type':Sequelize[_0xd737('0x2')]},'description':{'type':Sequelize[_0xd737('0x2')]},'username':{'type':Sequelize[_0xd737('0x2')]},'remoteUri':{'type':Sequelize[_0xd737('0x2')]},'authType':{'type':Sequelize[_0xd737('0x3')](_0xd737('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd737('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xd737('0x2')]},'serverUrl':{'type':Sequelize[_0xd737('0x2')]},'type':{'type':Sequelize[_0xd737('0x3')](_0xd737('0x5'),_0xd737('0x6')),'defaultValue':_0xd737('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 5c3b225..470a4c8 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 _0xb926=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','options','includeAll','findAll','rows','show','params','DeskAccount','length','include','find','create','body','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','priority','authType','username','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','password','toString','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials'];(function(_0x49029c,_0x1289a9){var _0x457b08=function(_0x3b3d1f){while(--_0x3b3d1f){_0x49029c['push'](_0x49029c['shift']());}};_0x457b08(++_0x1289a9);}(_0xb926,0x83));var _0x6b92=function(_0x5acfec,_0x22f0ec){_0x5acfec=_0x5acfec-0x0;var _0x3c4b93=_0xb926[_0x5acfec];return _0x3c4b93;};'use strict';var pdf=require(_0x6b92('0x0'));var emlformat=require(_0x6b92('0x1'));var rimraf=require(_0x6b92('0x2'));var zipdir=require(_0x6b92('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b92('0x4'));var moment=require(_0x6b92('0x5'));var BPromise=require(_0x6b92('0x6'));var Mustache=require(_0x6b92('0x7'));var util=require(_0x6b92('0x8'));var path=require('path');var sox=require(_0x6b92('0x9'));var csv=require(_0x6b92('0xa'));var ejs=require(_0x6b92('0xb'));var fs=require('fs');var _=require(_0x6b92('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b92('0xd'));var deskjs=require(_0x6b92('0xe'));var toCsv=require(_0x6b92('0xa'));var querystring=require('querystring');var Papa=require(_0x6b92('0xf'));var Redis=require(_0x6b92('0x10'));var authService=require(_0x6b92('0x11'));var qs=require(_0x6b92('0x12'));var as=require(_0x6b92('0x13'));var hardwareService=require(_0x6b92('0x14'));var logger=require(_0x6b92('0x15'))(_0x6b92('0x16'));var utils=require(_0x6b92('0x17'));var config=require(_0x6b92('0x18'));var db=require(_0x6b92('0x19'))['db'];var integrations=require(_0x6b92('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0x6b92('0x1b')][_0x6b92('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x35396f,_0x1e71fe,_0x16c2ef){if(_0x16c2ef){var _0x1accf9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1accf9['test'](_0x1e71fe)){return _0x35396f;}else{throw new db[(_0x6b92('0x1d'))][(_0x6b92('0x1e'))](_0x6b92('0x1f'));}}else{return _0x35396f;}}function respondWithRpcPromise(_0x1ac4c2,_0x1dc1ad,_0x2a0eb3,_0x57d398){return new BPromise(function(_0x849034,_0x57d5f6){var _0x1feb5f=_0x57d398||client;return _0x1feb5f[_0x6b92('0x20')](_0x1ac4c2,_0x2a0eb3)['then'](function(_0x211c50){logger[_0x6b92('0x21')](_0x6b92('0x22'),_0x1dc1ad,_0x6b92('0x23'));logger[_0x6b92('0x24')](_0x6b92('0x25'),_0x1dc1ad,'request\x20sent',JSON[_0x6b92('0x26')](_0x211c50));if(_0x211c50['error']){if(_0x211c50[_0x6b92('0x27')][_0x6b92('0x28')]===0x1f4){logger[_0x6b92('0x27')](_0x6b92('0x22'),_0x1dc1ad,_0x211c50['error'][_0x6b92('0x29')]);return _0x57d5f6(_0x211c50[_0x6b92('0x27')][_0x6b92('0x29')]);}logger[_0x6b92('0x27')](_0x6b92('0x22'),_0x1dc1ad,_0x211c50[_0x6b92('0x27')][_0x6b92('0x29')]);return _0x849034(_0x211c50[_0x6b92('0x27')][_0x6b92('0x29')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x1dc1ad,_0x6b92('0x23'));_0x849034(_0x211c50[_0x6b92('0x2a')]['message']);}})[_0x6b92('0x2b')](function(_0x33389f){logger['error'](_0x6b92('0x22'),_0x1dc1ad,_0x33389f);_0x57d5f6(_0x33389f);});});}function respondWithStatusCode(_0x13a057,_0x600ebf){_0x600ebf=_0x600ebf||0xcc;return function(_0x446003){if(_0x446003){return _0x13a057[_0x6b92('0x2c')](_0x600ebf);}return _0x13a057['status'](_0x600ebf)['end']();};}function respondWithResult(_0x3451e2,_0x5dd0a0){_0x5dd0a0=_0x5dd0a0||0xc8;return function(_0x87a553){if(_0x87a553){return _0x3451e2[_0x6b92('0x2d')](_0x5dd0a0)['json'](_0x87a553);}};}function respondWithFilteredResult(_0x2b6ca2,_0x54a085){return function(_0x4cae22){if(_0x4cae22){var _0x5707c8=_0x4cae22[_0x6b92('0x2e')],_0x23c431=_0x54a085[_0x6b92('0x2f')],_0x487937=_0x54a085[_0x6b92('0x2f')]+_0x54a085[_0x6b92('0x30')],_0x2987cd;if(_0x487937>=_0x5707c8){_0x487937=_0x5707c8;_0x2987cd=0xc8;}else{_0x2987cd=0xce;}_0x2b6ca2[_0x6b92('0x2d')](_0x2987cd);return _0x2b6ca2[_0x6b92('0x31')](_0x6b92('0x32'),_0x23c431+'-'+_0x487937+'/'+_0x5707c8)['json'](_0x4cae22);}return null;};}function patchUpdates(_0x2df5f4){return function(_0x52d759){try{jsonpatch[_0x6b92('0x33')](_0x52d759,_0x2df5f4,!![]);}catch(_0x4373de){return BPromise[_0x6b92('0x34')](_0x4373de);}return _0x52d759[_0x6b92('0x35')]();};}function saveUpdates(_0x271751,_0x15ecbc){return function(_0x45a207){if(_0x45a207){return _0x45a207[_0x6b92('0x36')](_0x271751)[_0x6b92('0x37')](function(_0x1d979b){return _0x1d979b;});}return null;};}function removeEntity(_0xb8e077,_0xb4902b){return function(_0x49136b){if(_0x49136b){return _0x49136b[_0x6b92('0x38')]()['then'](function(){_0xb8e077[_0x6b92('0x2d')](0xcc)[_0x6b92('0x39')]();});}};}function handleEntityNotFound(_0x1d5ad4,_0x28df2d){return function(_0x56d0c){if(!_0x56d0c){_0x1d5ad4[_0x6b92('0x2c')](0x194);}return _0x56d0c;};}function handleError(_0x4c1926,_0x4765d8){_0x4765d8=_0x4765d8||0x1f4;return function(_0x5dc2d6){logger['error'](_0x5dc2d6['stack']);if(_0x5dc2d6[_0x6b92('0x3a')]){delete _0x5dc2d6[_0x6b92('0x3a')];}_0x4c1926[_0x6b92('0x2d')](_0x4765d8)[_0x6b92('0x3b')](_0x5dc2d6);};}exports[_0x6b92('0x3c')]=function(_0x4a4c95,_0x24940a){var _0x55e791={},_0x58ff4c={},_0x5a8a84={'count':0x0,'rows':[]};var _0x8a6e5c=_['map'](db['DeskAccount'][_0x6b92('0x3d')],function(_0xde2f1e){return{'name':_0xde2f1e['fieldName'],'type':_0xde2f1e['type']['key']};});_0x58ff4c[_0x6b92('0x3e')]=_['map'](_0x8a6e5c,_0x6b92('0x3a'));_0x58ff4c[_0x6b92('0x3f')]=_[_0x6b92('0x40')](_0x4a4c95[_0x6b92('0x3f')]);_0x58ff4c[_0x6b92('0x41')]=_[_0x6b92('0x42')](_0x58ff4c[_0x6b92('0x3e')],_0x58ff4c['query']);_0x55e791[_0x6b92('0x43')]=_[_0x6b92('0x42')](_0x58ff4c[_0x6b92('0x3e')],qs[_0x6b92('0x44')](_0x4a4c95['query'][_0x6b92('0x44')]));_0x55e791[_0x6b92('0x43')]=_0x55e791[_0x6b92('0x43')]['length']?_0x55e791[_0x6b92('0x43')]:_0x58ff4c[_0x6b92('0x3e')];if(!_0x4a4c95['query'][_0x6b92('0x45')](_0x6b92('0x46'))){_0x55e791['limit']=qs[_0x6b92('0x30')](_0x4a4c95['query']['limit']);_0x55e791[_0x6b92('0x2f')]=qs[_0x6b92('0x2f')](_0x4a4c95[_0x6b92('0x3f')][_0x6b92('0x2f')]);}_0x55e791[_0x6b92('0x47')]=qs['sort'](_0x4a4c95[_0x6b92('0x3f')][_0x6b92('0x48')]);_0x55e791['where']=qs[_0x6b92('0x41')](_[_0x6b92('0x49')](_0x4a4c95['query'],_0x58ff4c[_0x6b92('0x41')]));if(_0x4a4c95[_0x6b92('0x3f')][_0x6b92('0x4a')]){_0x55e791[_0x6b92('0x4b')]=_[_0x6b92('0x4c')](_0x55e791[_0x6b92('0x4b')],{'$or':_[_0x6b92('0x4d')](_0x8a6e5c,function(_0x30f7f3){if(_0x30f7f3[_0x6b92('0x4e')]!=='VIRTUAL'){var _0x171dc1={};_0x171dc1[_0x30f7f3[_0x6b92('0x3a')]]={'$like':'%'+_0x4a4c95[_0x6b92('0x3f')][_0x6b92('0x4a')]+'%'};return _0x171dc1;}})});}_0x55e791=_[_0x6b92('0x4c')]({},_0x55e791,_0x4a4c95[_0x6b92('0x4f')]);var _0x263777={'where':_0x55e791[_0x6b92('0x4b')]};return db['DeskAccount'][_0x6b92('0x2e')](_0x263777)[_0x6b92('0x37')](function(_0x2e293a){_0x5a8a84[_0x6b92('0x2e')]=_0x2e293a;if(_0x4a4c95[_0x6b92('0x3f')][_0x6b92('0x50')]){_0x55e791['include']=[{'all':!![]}];}return db['DeskAccount'][_0x6b92('0x51')](_0x55e791);})[_0x6b92('0x37')](function(_0x437341){_0x5a8a84[_0x6b92('0x52')]=_0x437341;return _0x5a8a84;})['then'](respondWithFilteredResult(_0x24940a,_0x55e791))[_0x6b92('0x2b')](handleError(_0x24940a,null));};exports[_0x6b92('0x53')]=function(_0x13797f,_0x49ecf4){var _0x25ca85={'raw':![],'where':{'id':_0x13797f[_0x6b92('0x54')]['id']}},_0x564afb={};_0x564afb[_0x6b92('0x3e')]=_[_0x6b92('0x40')](db[_0x6b92('0x55')][_0x6b92('0x3d')]);_0x564afb[_0x6b92('0x3f')]=_[_0x6b92('0x40')](_0x13797f['query']);_0x564afb[_0x6b92('0x41')]=_['intersection'](_0x564afb[_0x6b92('0x3e')],_0x564afb['query']);_0x25ca85[_0x6b92('0x43')]=_[_0x6b92('0x42')](_0x564afb[_0x6b92('0x3e')],qs[_0x6b92('0x44')](_0x13797f[_0x6b92('0x3f')][_0x6b92('0x44')]));_0x25ca85[_0x6b92('0x43')]=_0x25ca85[_0x6b92('0x43')][_0x6b92('0x56')]?_0x25ca85[_0x6b92('0x43')]:_0x564afb[_0x6b92('0x3e')];if(_0x13797f[_0x6b92('0x3f')][_0x6b92('0x50')]){_0x25ca85[_0x6b92('0x57')]=[{'all':!![]}];}_0x25ca85=_['merge']({},_0x25ca85,_0x13797f[_0x6b92('0x4f')]);return db['DeskAccount'][_0x6b92('0x58')](_0x25ca85)[_0x6b92('0x37')](handleEntityNotFound(_0x49ecf4,null))['then'](respondWithResult(_0x49ecf4,null))[_0x6b92('0x2b')](handleError(_0x49ecf4,null));};exports[_0x6b92('0x59')]=function(_0x50e050,_0x33a384){return db[_0x6b92('0x55')][_0x6b92('0x59')](_0x50e050[_0x6b92('0x5a')],{})[_0x6b92('0x37')](respondWithResult(_0x33a384,0xc9))['catch'](handleError(_0x33a384,null));};exports[_0x6b92('0x36')]=function(_0x315682,_0x44dd41){if(_0x315682[_0x6b92('0x5a')]['id']){delete _0x315682['body']['id'];}return db['DeskAccount']['find']({'where':{'id':_0x315682[_0x6b92('0x54')]['id']}})[_0x6b92('0x37')](handleEntityNotFound(_0x44dd41,null))[_0x6b92('0x37')](saveUpdates(_0x315682[_0x6b92('0x5a')],null))['then'](respondWithResult(_0x44dd41,null))[_0x6b92('0x2b')](handleError(_0x44dd41,null));};exports['destroy']=function(_0x2787c0,_0xf8d1ad){return db[_0x6b92('0x55')]['find']({'where':{'id':_0x2787c0[_0x6b92('0x54')]['id']}})[_0x6b92('0x37')](handleEntityNotFound(_0xf8d1ad,null))[_0x6b92('0x37')](removeEntity(_0xf8d1ad,null))['catch'](handleError(_0xf8d1ad,null));};exports[_0x6b92('0x5b')]=function(_0x4d196f,_0x27fc6c,_0xf6d3d0){var _0x17549f={};var _0x529d1b={};var _0x2dd8f0;var _0x3d3557;return db[_0x6b92('0x55')]['findOne']({'where':{'id':_0x4d196f[_0x6b92('0x54')]['id']}})[_0x6b92('0x37')](handleEntityNotFound(_0x27fc6c,null))['then'](function(_0xce8cc2){if(_0xce8cc2){_0x2dd8f0=_0xce8cc2;_0x529d1b[_0x6b92('0x3e')]=_[_0x6b92('0x40')](db[_0x6b92('0x5c')][_0x6b92('0x3d')]);_0x529d1b[_0x6b92('0x3f')]=_[_0x6b92('0x40')](_0x4d196f[_0x6b92('0x3f')]);_0x529d1b['filters']=_[_0x6b92('0x42')](_0x529d1b[_0x6b92('0x3e')],_0x529d1b[_0x6b92('0x3f')]);_0x17549f[_0x6b92('0x43')]=_[_0x6b92('0x42')](_0x529d1b['model'],qs[_0x6b92('0x44')](_0x4d196f['query'][_0x6b92('0x44')]));_0x17549f[_0x6b92('0x43')]=_0x17549f['attributes'][_0x6b92('0x56')]?_0x17549f[_0x6b92('0x43')]:_0x529d1b['model'];_0x17549f[_0x6b92('0x47')]=qs[_0x6b92('0x48')](_0x4d196f['query'][_0x6b92('0x48')]);_0x17549f[_0x6b92('0x4b')]=qs[_0x6b92('0x41')](_[_0x6b92('0x49')](_0x4d196f[_0x6b92('0x3f')],_0x529d1b[_0x6b92('0x41')]));if(_0x4d196f['query']['filter']){_0x17549f[_0x6b92('0x4b')]=_[_0x6b92('0x4c')](_0x17549f['where'],{'$or':_['map'](_0x17549f[_0x6b92('0x43')],function(_0xe6a35){var _0x5ac700={};_0x5ac700[_0xe6a35]={'$like':'%'+_0x4d196f[_0x6b92('0x3f')][_0x6b92('0x4a')]+'%'};return _0x5ac700;})});}_0x17549f=_['merge']({},_0x17549f,_0x4d196f['options']);return _0x2dd8f0['getConfigurations'](_0x17549f);}})[_0x6b92('0x37')](function(_0x2b1a56){if(_0x2b1a56){_0x3d3557=_0x2b1a56[_0x6b92('0x56')];if(!_0x4d196f[_0x6b92('0x3f')][_0x6b92('0x45')](_0x6b92('0x46'))){_0x17549f['limit']=qs['limit'](_0x4d196f[_0x6b92('0x3f')]['limit']);_0x17549f[_0x6b92('0x2f')]=qs['offset'](_0x4d196f[_0x6b92('0x3f')]['offset']);}return _0x2dd8f0['getConfigurations'](_0x17549f);}})[_0x6b92('0x37')](function(_0x416b5f){if(_0x416b5f){return _0x416b5f?{'count':_0x3d3557,'rows':_0x416b5f}:null;}})[_0x6b92('0x37')](respondWithResult(_0x27fc6c,null))[_0x6b92('0x2b')](handleError(_0x27fc6c,null));};exports[_0x6b92('0x5d')]=function(_0x4173db,_0x257d43,_0x4effd8){if(_0x4173db[_0x6b92('0x5a')]['id']){delete _0x4173db[_0x6b92('0x5a')]['id'];}return db[_0x6b92('0x55')][_0x6b92('0x5e')]({'where':{'id':_0x4173db['params']['id']}})[_0x6b92('0x37')](handleEntityNotFound(_0x257d43,null))[_0x6b92('0x37')](function(_0x2dd588){if(_0x2dd588){_0x4173db[_0x6b92('0x5a')][_0x6b92('0x5f')]=_0x2dd588['id'];_0x4173db[_0x6b92('0x5a')][_0x6b92('0x60')]=integrations[_0x6b92('0x61')](_0x4173db['body'][_0x6b92('0x62')],_0x4173db[_0x6b92('0x5a')][_0x6b92('0x4e')]);_0x4173db[_0x6b92('0x5a')]['Descriptions']=integrations[_0x6b92('0x63')](_0x4173db['body']['channel'],_0x4173db[_0x6b92('0x5a')][_0x6b92('0x4e')]);return db[_0x6b92('0x5c')]['create'](_0x4173db['body'],{'include':[{'model':db[_0x6b92('0x64')],'as':'Subjects'},{'model':db[_0x6b92('0x64')],'as':'Descriptions'}]});}return null;})[_0x6b92('0x37')](respondWithResult(_0x257d43,null))['catch'](handleError(_0x257d43,null));};exports['getFields']=function(_0x4065e1,_0x5a7b68,_0x2bd3cf){var _0x2dd633=[{'name':_0x6b92('0x65'),'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 _0x319638='';return db['DeskAccount']['findOne']({'where':{'id':_0x4065e1[_0x6b92('0x54')]['id']},'attributes':['id','remoteUri',_0x6b92('0x66'),_0x6b92('0x67'),'password',_0x6b92('0x68'),_0x6b92('0x69'),_0x6b92('0x6a'),_0x6b92('0x6b')]})[_0x6b92('0x37')](handleEntityNotFound(_0x5a7b68,null))[_0x6b92('0x37')](function(_0x1860ea){if(_0x1860ea){_0x319638=_0x1860ea[_0x6b92('0x6c')];var _0x470031=_0x319638[_0x6b92('0x6d')](-0x1);if(_0x470031==='/'){_0x319638=_0x319638[_0x6b92('0x6e')](0x0,_0x319638[_0x6b92('0x6f')](_0x470031));}var _0x495fd1={'method':'GET','uri':util[_0x6b92('0x70')](_0x6b92('0x71'),_0x319638),'headers':{'Content-Type':_0x6b92('0x72'),'Accept':'application/json'},'json':!![]};if(_0x1860ea[_0x6b92('0x66')]===_0x6b92('0x73')){_0x495fd1[_0x6b92('0x74')][_0x6b92('0x75')]=util[_0x6b92('0x70')](_0x6b92('0x76'),new Buffer(util[_0x6b92('0x70')]('%s:%s',_0x1860ea[_0x6b92('0x67')],_0x1860ea[_0x6b92('0x77')]))[_0x6b92('0x78')]('base64'));}return rp(_0x495fd1)[_0x6b92('0x37')](function(_0x5b353f){return _0x2dd633[_0x6b92('0x79')](_[_0x6b92('0x4d')](_0x5b353f[_0x6b92('0x7a')][_0x6b92('0x7b')],function(_0x340feb){return{'id':_0x340feb['name'],'name':_0x340feb[_0x6b92('0x3a')],'type':_0x340feb[_0x6b92('0x4e')],'active':_0x340feb[_0x6b92('0x7c')],'label':_0x340feb[_0x6b92('0x7d')],'custom':!![]};}));});}})[_0x6b92('0x37')](function(_0x51d73b){return{'count':_0x51d73b[_0x6b92('0x56')],'rows':_0x51d73b};})[_0x6b92('0x37')](respondWithResult(_0x5a7b68,null))[_0x6b92('0x2b')](function(_0x263fd3){var _0x5d5815=_0x4065e1[_0x6b92('0x3f')][_0x6b92('0x7e')]?0x1f4:_0x263fd3[_0x6b92('0x7f')]||0x1f4;logger[_0x6b92('0x27')](_0x6b92('0x80'),_0x6b92('0x81'),_0x5d5815,JSON[_0x6b92('0x26')](_0x263fd3));delete _0x263fd3[_0x6b92('0x3a')];if(_0x5d5815===0x191){_0x5d5815=0x190;}_0x5a7b68[_0x6b92('0x2d')](_0x5d5815)[_0x6b92('0x3b')](_0x4065e1['query'][_0x6b92('0x7e')]?{'message':_0x6b92('0x82'),'statusCode':_0x263fd3[_0x6b92('0x7f')]}:_0x263fd3);});}; \ No newline at end of file +var _0xd490=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','info','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','stack','name','send','index','map','DeskAccount','fieldName','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','intersection','include','create','body','find','destroy','findOne','DeskConfiguration','rawAttributes','length','sort','getConfigurations','addConfiguration','AccountId','channel','DeskField','Subjects','Descriptions','getFields','priority','authType','username','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','path'];(function(_0x39fb4d,_0x3df193){var _0x1ac599=function(_0x49c1a5){while(--_0x49c1a5){_0x39fb4d['push'](_0x39fb4d['shift']());}};_0x1ac599(++_0x3df193);}(_0xd490,0x17f));var _0x0d49=function(_0x507be4,_0x273eb5){_0x507be4=_0x507be4-0x0;var _0x5c1bc9=_0xd490[_0x507be4];return _0x5c1bc9;};'use strict';var pdf=require(_0x0d49('0x0'));var emlformat=require(_0x0d49('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0d49('0x2'));var jsonpatch=require(_0x0d49('0x3'));var rp=require('request-promise');var moment=require(_0x0d49('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d49('0x5'));var path=require(_0x0d49('0x6'));var sox=require(_0x0d49('0x7'));var csv=require(_0x0d49('0x8'));var ejs=require(_0x0d49('0x9'));var fs=require('fs');var _=require(_0x0d49('0xa'));var squel=require(_0x0d49('0xb'));var crypto=require(_0x0d49('0xc'));var jsforce=require(_0x0d49('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0d49('0x8'));var querystring=require(_0x0d49('0xe'));var Papa=require(_0x0d49('0xf'));var Redis=require(_0x0d49('0x10'));var authService=require(_0x0d49('0x11'));var qs=require(_0x0d49('0x12'));var as=require(_0x0d49('0x13'));var hardwareService=require(_0x0d49('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0d49('0x15'));var db=require(_0x0d49('0x16'))['db'];var integrations=require(_0x0d49('0x17'));var jayson=require(_0x0d49('0x18'));var client=jayson[_0x0d49('0x19')][_0x0d49('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4b65e3,_0x427540,_0x46d7af){if(_0x46d7af){var _0x5c7532=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c7532[_0x0d49('0x1b')](_0x427540)){return _0x4b65e3;}else{throw new db[(_0x0d49('0x1c'))][(_0x0d49('0x1d'))]('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 _0x4b65e3;}}function respondWithRpcPromise(_0x30e79a,_0x3a2807,_0x55f3fe,_0x54b97b){return new BPromise(function(_0x39fff5,_0x55847d){var _0x1d8229=_0x54b97b||client;return _0x1d8229[_0x0d49('0x1e')](_0x30e79a,_0x55f3fe)[_0x0d49('0x1f')](function(_0x2e7b6b){logger['info'](_0x0d49('0x20'),_0x3a2807,_0x0d49('0x21'));logger[_0x0d49('0x22')](_0x0d49('0x23'),_0x3a2807,_0x0d49('0x21'),JSON['stringify'](_0x2e7b6b));if(_0x2e7b6b['error']){if(_0x2e7b6b['error'][_0x0d49('0x24')]===0x1f4){logger[_0x0d49('0x25')](_0x0d49('0x20'),_0x3a2807,_0x2e7b6b['error'][_0x0d49('0x26')]);return _0x55847d(_0x2e7b6b[_0x0d49('0x25')][_0x0d49('0x26')]);}logger[_0x0d49('0x25')]('DeskAccount,\x20%s,\x20%s',_0x3a2807,_0x2e7b6b[_0x0d49('0x25')]['message']);return _0x39fff5(_0x2e7b6b[_0x0d49('0x25')][_0x0d49('0x26')]);}else{logger[_0x0d49('0x27')]('DeskAccount,\x20%s,\x20%s',_0x3a2807,_0x0d49('0x21'));_0x39fff5(_0x2e7b6b['result'][_0x0d49('0x26')]);}})['catch'](function(_0x246855){logger['error'](_0x0d49('0x20'),_0x3a2807,_0x246855);_0x55847d(_0x246855);});});}function respondWithStatusCode(_0x4dec15,_0x282d3a){_0x282d3a=_0x282d3a||0xcc;return function(_0xd78b2d){if(_0xd78b2d){return _0x4dec15[_0x0d49('0x28')](_0x282d3a);}return _0x4dec15[_0x0d49('0x29')](_0x282d3a)[_0x0d49('0x2a')]();};}function respondWithResult(_0x54f8e7,_0x1282c3){_0x1282c3=_0x1282c3||0xc8;return function(_0x1b8157){if(_0x1b8157){return _0x54f8e7[_0x0d49('0x29')](_0x1282c3)[_0x0d49('0x2b')](_0x1b8157);}};}function respondWithFilteredResult(_0x19f532,_0x44b87e){return function(_0x1ac2be){if(_0x1ac2be){var _0x1281ac=_0x1ac2be[_0x0d49('0x2c')],_0x5af06a=_0x44b87e[_0x0d49('0x2d')],_0x48da9b=_0x44b87e[_0x0d49('0x2d')]+_0x44b87e[_0x0d49('0x2e')],_0x3d515c;if(_0x48da9b>=_0x1281ac){_0x48da9b=_0x1281ac;_0x3d515c=0xc8;}else{_0x3d515c=0xce;}_0x19f532[_0x0d49('0x29')](_0x3d515c);return _0x19f532['set'](_0x0d49('0x2f'),_0x5af06a+'-'+_0x48da9b+'/'+_0x1281ac)[_0x0d49('0x2b')](_0x1ac2be);}return null;};}function patchUpdates(_0x579e18){return function(_0x37f03c){try{jsonpatch[_0x0d49('0x30')](_0x37f03c,_0x579e18,!![]);}catch(_0x3ebecd){return BPromise['reject'](_0x3ebecd);}return _0x37f03c['save']();};}function saveUpdates(_0xf305f8,_0x485da2){return function(_0x1e1152){if(_0x1e1152){return _0x1e1152[_0x0d49('0x31')](_0xf305f8)['then'](function(_0x2ce0ca){return _0x2ce0ca;});}return null;};}function removeEntity(_0x141fd6,_0x193afb){return function(_0x3e8987){if(_0x3e8987){return _0x3e8987['destroy']()[_0x0d49('0x1f')](function(){_0x141fd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47d055,_0x402f4e){return function(_0x28572b){if(!_0x28572b){_0x47d055[_0x0d49('0x28')](0x194);}return _0x28572b;};}function handleError(_0x1bec94,_0x333435){_0x333435=_0x333435||0x1f4;return function(_0x234615){logger[_0x0d49('0x25')](_0x234615[_0x0d49('0x32')]);if(_0x234615[_0x0d49('0x33')]){delete _0x234615[_0x0d49('0x33')];}_0x1bec94['status'](_0x333435)[_0x0d49('0x34')](_0x234615);};}exports[_0x0d49('0x35')]=function(_0x3f66f0,_0x2ec846){var _0x59c5cd={},_0x3015b6={},_0x1c63a8={'count':0x0,'rows':[]};var _0x25aef5=_[_0x0d49('0x36')](db[_0x0d49('0x37')]['rawAttributes'],function(_0x2379c5){return{'name':_0x2379c5[_0x0d49('0x38')],'type':_0x2379c5[_0x0d49('0x39')][_0x0d49('0x3a')]};});_0x3015b6['model']=_['map'](_0x25aef5,'name');_0x3015b6[_0x0d49('0x3b')]=_[_0x0d49('0x3c')](_0x3f66f0[_0x0d49('0x3b')]);_0x3015b6['filters']=_['intersection'](_0x3015b6[_0x0d49('0x3d')],_0x3015b6['query']);_0x59c5cd[_0x0d49('0x3e')]=_['intersection'](_0x3015b6[_0x0d49('0x3d')],qs[_0x0d49('0x3f')](_0x3f66f0[_0x0d49('0x3b')][_0x0d49('0x3f')]));_0x59c5cd[_0x0d49('0x3e')]=_0x59c5cd[_0x0d49('0x3e')]['length']?_0x59c5cd[_0x0d49('0x3e')]:_0x3015b6[_0x0d49('0x3d')];if(!_0x3f66f0['query'][_0x0d49('0x40')](_0x0d49('0x41'))){_0x59c5cd[_0x0d49('0x2e')]=qs[_0x0d49('0x2e')](_0x3f66f0[_0x0d49('0x3b')]['limit']);_0x59c5cd[_0x0d49('0x2d')]=qs[_0x0d49('0x2d')](_0x3f66f0[_0x0d49('0x3b')][_0x0d49('0x2d')]);}_0x59c5cd[_0x0d49('0x42')]=qs['sort'](_0x3f66f0[_0x0d49('0x3b')]['sort']);_0x59c5cd[_0x0d49('0x43')]=qs[_0x0d49('0x44')](_[_0x0d49('0x45')](_0x3f66f0[_0x0d49('0x3b')],_0x3015b6['filters']));if(_0x3f66f0[_0x0d49('0x3b')][_0x0d49('0x46')]){_0x59c5cd[_0x0d49('0x43')]=_['merge'](_0x59c5cd['where'],{'$or':_[_0x0d49('0x36')](_0x25aef5,function(_0x1fd5b0){if(_0x1fd5b0[_0x0d49('0x39')]!==_0x0d49('0x47')){var _0x9c994c={};_0x9c994c[_0x1fd5b0[_0x0d49('0x33')]]={'$like':'%'+_0x3f66f0[_0x0d49('0x3b')][_0x0d49('0x46')]+'%'};return _0x9c994c;}})});}_0x59c5cd=_[_0x0d49('0x48')]({},_0x59c5cd,_0x3f66f0[_0x0d49('0x49')]);var _0x4519e7={'where':_0x59c5cd[_0x0d49('0x43')]};return db['DeskAccount'][_0x0d49('0x2c')](_0x4519e7)[_0x0d49('0x1f')](function(_0x128c78){_0x1c63a8[_0x0d49('0x2c')]=_0x128c78;if(_0x3f66f0[_0x0d49('0x3b')][_0x0d49('0x4a')]){_0x59c5cd['include']=[{'all':!![]}];}return db[_0x0d49('0x37')][_0x0d49('0x4b')](_0x59c5cd);})[_0x0d49('0x1f')](function(_0x4ebb47){_0x1c63a8[_0x0d49('0x4c')]=_0x4ebb47;return _0x1c63a8;})[_0x0d49('0x1f')](respondWithFilteredResult(_0x2ec846,_0x59c5cd))[_0x0d49('0x4d')](handleError(_0x2ec846,null));};exports[_0x0d49('0x4e')]=function(_0x198089,_0xd76a1e){var _0x19e7f0={'raw':![],'where':{'id':_0x198089[_0x0d49('0x4f')]['id']}},_0x55c841={};_0x55c841['model']=_[_0x0d49('0x3c')](db[_0x0d49('0x37')]['rawAttributes']);_0x55c841[_0x0d49('0x3b')]=_[_0x0d49('0x3c')](_0x198089['query']);_0x55c841[_0x0d49('0x44')]=_[_0x0d49('0x50')](_0x55c841[_0x0d49('0x3d')],_0x55c841[_0x0d49('0x3b')]);_0x19e7f0['attributes']=_[_0x0d49('0x50')](_0x55c841[_0x0d49('0x3d')],qs['fields'](_0x198089[_0x0d49('0x3b')][_0x0d49('0x3f')]));_0x19e7f0[_0x0d49('0x3e')]=_0x19e7f0['attributes']['length']?_0x19e7f0[_0x0d49('0x3e')]:_0x55c841[_0x0d49('0x3d')];if(_0x198089[_0x0d49('0x3b')][_0x0d49('0x4a')]){_0x19e7f0[_0x0d49('0x51')]=[{'all':!![]}];}_0x19e7f0=_[_0x0d49('0x48')]({},_0x19e7f0,_0x198089[_0x0d49('0x49')]);return db[_0x0d49('0x37')]['find'](_0x19e7f0)[_0x0d49('0x1f')](handleEntityNotFound(_0xd76a1e,null))['then'](respondWithResult(_0xd76a1e,null))[_0x0d49('0x4d')](handleError(_0xd76a1e,null));};exports['create']=function(_0x2fa4fb,_0x3aab1c){return db[_0x0d49('0x37')][_0x0d49('0x52')](_0x2fa4fb[_0x0d49('0x53')],{})['then'](respondWithResult(_0x3aab1c,0xc9))['catch'](handleError(_0x3aab1c,null));};exports[_0x0d49('0x31')]=function(_0x5a65cc,_0x4bea0d){if(_0x5a65cc[_0x0d49('0x53')]['id']){delete _0x5a65cc[_0x0d49('0x53')]['id'];}return db[_0x0d49('0x37')][_0x0d49('0x54')]({'where':{'id':_0x5a65cc[_0x0d49('0x4f')]['id']}})[_0x0d49('0x1f')](handleEntityNotFound(_0x4bea0d,null))[_0x0d49('0x1f')](saveUpdates(_0x5a65cc[_0x0d49('0x53')],null))[_0x0d49('0x1f')](respondWithResult(_0x4bea0d,null))[_0x0d49('0x4d')](handleError(_0x4bea0d,null));};exports[_0x0d49('0x55')]=function(_0x1124fd,_0x27f7b8){return db['DeskAccount'][_0x0d49('0x54')]({'where':{'id':_0x1124fd[_0x0d49('0x4f')]['id']}})[_0x0d49('0x1f')](handleEntityNotFound(_0x27f7b8,null))['then'](removeEntity(_0x27f7b8,null))[_0x0d49('0x4d')](handleError(_0x27f7b8,null));};exports['getConfigurations']=function(_0xbbd0a2,_0xb57a1d,_0x4dac69){var _0x138397={};var _0x2d9913={};var _0x450bdb;var _0x49b178;return db['DeskAccount'][_0x0d49('0x56')]({'where':{'id':_0xbbd0a2[_0x0d49('0x4f')]['id']}})['then'](handleEntityNotFound(_0xb57a1d,null))[_0x0d49('0x1f')](function(_0x346cc8){if(_0x346cc8){_0x450bdb=_0x346cc8;_0x2d9913[_0x0d49('0x3d')]=_[_0x0d49('0x3c')](db[_0x0d49('0x57')][_0x0d49('0x58')]);_0x2d9913[_0x0d49('0x3b')]=_[_0x0d49('0x3c')](_0xbbd0a2['query']);_0x2d9913['filters']=_['intersection'](_0x2d9913['model'],_0x2d9913[_0x0d49('0x3b')]);_0x138397['attributes']=_[_0x0d49('0x50')](_0x2d9913[_0x0d49('0x3d')],qs[_0x0d49('0x3f')](_0xbbd0a2[_0x0d49('0x3b')][_0x0d49('0x3f')]));_0x138397[_0x0d49('0x3e')]=_0x138397[_0x0d49('0x3e')][_0x0d49('0x59')]?_0x138397[_0x0d49('0x3e')]:_0x2d9913[_0x0d49('0x3d')];_0x138397[_0x0d49('0x42')]=qs[_0x0d49('0x5a')](_0xbbd0a2[_0x0d49('0x3b')][_0x0d49('0x5a')]);_0x138397[_0x0d49('0x43')]=qs[_0x0d49('0x44')](_[_0x0d49('0x45')](_0xbbd0a2[_0x0d49('0x3b')],_0x2d9913[_0x0d49('0x44')]));if(_0xbbd0a2[_0x0d49('0x3b')][_0x0d49('0x46')]){_0x138397[_0x0d49('0x43')]=_[_0x0d49('0x48')](_0x138397['where'],{'$or':_[_0x0d49('0x36')](_0x138397['attributes'],function(_0x15918b){var _0x5df6e2={};_0x5df6e2[_0x15918b]={'$like':'%'+_0xbbd0a2[_0x0d49('0x3b')]['filter']+'%'};return _0x5df6e2;})});}_0x138397=_[_0x0d49('0x48')]({},_0x138397,_0xbbd0a2[_0x0d49('0x49')]);return _0x450bdb[_0x0d49('0x5b')](_0x138397);}})[_0x0d49('0x1f')](function(_0x53ddec){if(_0x53ddec){_0x49b178=_0x53ddec[_0x0d49('0x59')];if(!_0xbbd0a2['query'][_0x0d49('0x40')](_0x0d49('0x41'))){_0x138397[_0x0d49('0x2e')]=qs[_0x0d49('0x2e')](_0xbbd0a2[_0x0d49('0x3b')]['limit']);_0x138397[_0x0d49('0x2d')]=qs['offset'](_0xbbd0a2[_0x0d49('0x3b')][_0x0d49('0x2d')]);}return _0x450bdb['getConfigurations'](_0x138397);}})['then'](function(_0x3a15aa){if(_0x3a15aa){return _0x3a15aa?{'count':_0x49b178,'rows':_0x3a15aa}:null;}})[_0x0d49('0x1f')](respondWithResult(_0xb57a1d,null))[_0x0d49('0x4d')](handleError(_0xb57a1d,null));};exports[_0x0d49('0x5c')]=function(_0x5ba020,_0x5f0e86,_0x576b20){if(_0x5ba020[_0x0d49('0x53')]['id']){delete _0x5ba020[_0x0d49('0x53')]['id'];}return db[_0x0d49('0x37')][_0x0d49('0x56')]({'where':{'id':_0x5ba020[_0x0d49('0x4f')]['id']}})[_0x0d49('0x1f')](handleEntityNotFound(_0x5f0e86,null))[_0x0d49('0x1f')](function(_0x41cf37){if(_0x41cf37){_0x5ba020[_0x0d49('0x53')][_0x0d49('0x5d')]=_0x41cf37['id'];_0x5ba020[_0x0d49('0x53')]['Subjects']=integrations['getSubjects'](_0x5ba020['body'][_0x0d49('0x5e')],_0x5ba020[_0x0d49('0x53')][_0x0d49('0x39')]);_0x5ba020[_0x0d49('0x53')]['Descriptions']=integrations['getDescriptions'](_0x5ba020['body'][_0x0d49('0x5e')],_0x5ba020[_0x0d49('0x53')][_0x0d49('0x39')]);return db[_0x0d49('0x57')][_0x0d49('0x52')](_0x5ba020[_0x0d49('0x53')],{'include':[{'model':db[_0x0d49('0x5f')],'as':_0x0d49('0x60')},{'model':db[_0x0d49('0x5f')],'as':_0x0d49('0x61')}]});}return null;})[_0x0d49('0x1f')](respondWithResult(_0x5f0e86,null))[_0x0d49('0x4d')](handleError(_0x5f0e86,null));};exports[_0x0d49('0x62')]=function(_0x3295b0,_0x16ac17,_0x67a883){var _0x559869=[{'name':_0x0d49('0x63'),'label':_0x0d49('0x63'),'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 _0x11407a='';return db[_0x0d49('0x37')][_0x0d49('0x56')]({'where':{'id':_0x3295b0[_0x0d49('0x4f')]['id']},'attributes':['id','remoteUri',_0x0d49('0x64'),_0x0d49('0x65'),'password',_0x0d49('0x66'),_0x0d49('0x67'),_0x0d49('0x68'),_0x0d49('0x69')]})[_0x0d49('0x1f')](handleEntityNotFound(_0x16ac17,null))[_0x0d49('0x1f')](function(_0x1871a9){if(_0x1871a9){_0x11407a=_0x1871a9[_0x0d49('0x6a')];var _0x1c6dd3=_0x11407a[_0x0d49('0x6b')](-0x1);if(_0x1c6dd3==='/'){_0x11407a=_0x11407a['substring'](0x0,_0x11407a[_0x0d49('0x6c')](_0x1c6dd3));}var _0x4111ea={'method':_0x0d49('0x6d'),'uri':util[_0x0d49('0x6e')](_0x0d49('0x6f'),_0x11407a),'headers':{'Content-Type':'application/json','Accept':_0x0d49('0x70')},'json':!![]};if(_0x1871a9[_0x0d49('0x64')]===_0x0d49('0x71')){_0x4111ea[_0x0d49('0x72')][_0x0d49('0x73')]=util[_0x0d49('0x6e')](_0x0d49('0x74'),new Buffer(util[_0x0d49('0x6e')](_0x0d49('0x75'),_0x1871a9['username'],_0x1871a9[_0x0d49('0x76')]))[_0x0d49('0x77')](_0x0d49('0x78')));}return rp(_0x4111ea)[_0x0d49('0x1f')](function(_0x2607db){return _0x559869[_0x0d49('0x79')](_[_0x0d49('0x36')](_0x2607db[_0x0d49('0x7a')][_0x0d49('0x7b')],function(_0x83ae15){return{'id':_0x83ae15[_0x0d49('0x33')],'name':_0x83ae15['name'],'type':_0x83ae15[_0x0d49('0x39')],'active':_0x83ae15[_0x0d49('0x7c')],'label':_0x83ae15[_0x0d49('0x7d')],'custom':!![]};}));});}})['then'](function(_0x1bb5ac){return{'count':_0x1bb5ac[_0x0d49('0x59')],'rows':_0x1bb5ac};})['then'](respondWithResult(_0x16ac17,null))['catch'](function(_0x38a16d){var _0x2a39eb=_0x3295b0[_0x0d49('0x3b')][_0x0d49('0x1b')]?0x1f4:_0x38a16d['statusCode']||0x1f4;logger[_0x0d49('0x25')](_0x0d49('0x7e'),_0x0d49('0x62'),_0x2a39eb,JSON[_0x0d49('0x7f')](_0x38a16d));delete _0x38a16d[_0x0d49('0x33')];if(_0x2a39eb===0x191){_0x2a39eb=0x190;}_0x16ac17[_0x0d49('0x29')](_0x2a39eb)[_0x0d49('0x34')](_0x3295b0['query'][_0x0d49('0x1b')]?{'message':_0x0d49('0x80'),'statusCode':_0x38a16d[_0x0d49('0x81')]}:_0x38a16d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 70b436a..fff97a6 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 _0x37e8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','../../config/logger'];(function(_0x552408,_0x53e708){var _0xb370a6=function(_0x20e3cf){while(--_0x20e3cf){_0x552408['push'](_0x552408['shift']());}};_0xb370a6(++_0x53e708);}(_0x37e8,0x80));var _0x837e=function(_0x3d3dfc,_0x48ccc7){_0x3d3dfc=_0x3d3dfc-0x0;var _0xf39e57=_0x37e8[_0x3d3dfc];return _0xf39e57;};'use strict';var _=require(_0x837e('0x0'));var util=require('util');var logger=require(_0x837e('0x1'))(_0x837e('0x2'));var moment=require(_0x837e('0x3'));var BPromise=require(_0x837e('0x4'));var rp=require(_0x837e('0x5'));var fs=require('fs');var path=require(_0x837e('0x6'));var rimraf=require(_0x837e('0x7'));var config=require(_0x837e('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x837e('0x9'));module[_0x837e('0xa')]=function(_0x1844a0,_0x1ca34c){return _0x1844a0['define'](_0x837e('0xb'),attributes,{'tableName':_0x837e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x894a=['bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','api'];(function(_0x56f251,_0x5edb55){var _0x528d00=function(_0x44a2a2){while(--_0x44a2a2){_0x56f251['push'](_0x56f251['shift']());}};_0x528d00(++_0x5edb55);}(_0x894a,0x18b));var _0xa894=function(_0x451b46,_0x5954c7){_0x451b46=_0x451b46-0x0;var _0x49bf23=_0x894a[_0x451b46];return _0x49bf23;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa894('0x0'));var moment=require('moment');var BPromise=require(_0xa894('0x1'));var rp=require(_0xa894('0x2'));var fs=require('fs');var path=require(_0xa894('0x3'));var rimraf=require('rimraf');var config=require(_0xa894('0x4'));var attributes=require(_0xa894('0x5'));var integrations=require(_0xa894('0x6'));module[_0xa894('0x7')]=function(_0x29c179,_0x516bb2){return _0x29c179[_0xa894('0x8')](_0xa894('0x9'),attributes,{'tableName':_0xa894('0xa'),'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 506b7f1..b52e63b 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 _0x9f0b=['stringify','DeskAccount','find','raw','ShowDeskAccount','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','GetDeskAccount','options','where','attributes','limit','include','map','model'];(function(_0x2d0f95,_0x4cb586){var _0x1eb4a3=function(_0x3b0da){while(--_0x3b0da){_0x2d0f95['push'](_0x2d0f95['shift']());}};_0x1eb4a3(++_0x4cb586);}(_0x9f0b,0x7e));var _0xb9f0=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x9f0b[_0x277fa3];return _0x2e4520;};'use strict';var _=require('lodash');var util=require(_0xb9f0('0x0'));var moment=require(_0xb9f0('0x1'));var BPromise=require(_0xb9f0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9f0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9f0('0x4'))(_0xb9f0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb9f0('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5169d1,_0x11f719,_0x47f04a){return new BPromise(function(_0x56f915,_0x2c3564){return client['request'](_0x5169d1,_0x47f04a)[_0xb9f0('0x7')](function(_0x2adfb4){logger[_0xb9f0('0x8')](_0xb9f0('0x9'),_0x11f719,_0xb9f0('0xa'));logger[_0xb9f0('0xb')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x11f719,_0xb9f0('0xa'),JSON['stringify'](_0x2adfb4));if(_0x2adfb4['error']){if(_0x2adfb4['error'][_0xb9f0('0xc')]===0x1f4){logger[_0xb9f0('0xd')](_0xb9f0('0x9'),_0x11f719,_0x2adfb4[_0xb9f0('0xd')][_0xb9f0('0xe')]);return _0x2c3564(_0x2adfb4[_0xb9f0('0xd')][_0xb9f0('0xe')]);}logger[_0xb9f0('0xd')]('DeskAccount,\x20%s,\x20%s',_0x11f719,_0x2adfb4[_0xb9f0('0xd')]['message']);return _0x56f915(_0x2adfb4[_0xb9f0('0xd')][_0xb9f0('0xe')]);}else{logger[_0xb9f0('0x8')]('DeskAccount,\x20%s,\x20%s',_0x11f719,_0xb9f0('0xa'));_0x56f915(_0x2adfb4[_0xb9f0('0xf')][_0xb9f0('0xe')]);}})['catch'](function(_0x2bcd2a){logger[_0xb9f0('0xd')]('DeskAccount,\x20%s,\x20%s',_0x11f719,_0x2bcd2a);_0x2c3564(_0x2bcd2a);});});}exports[_0xb9f0('0x10')]=function(_0x553e07){var _0x8af322=this;return new Promise(function(_0x1d3e52,_0x3d6107){return db['DeskAccount']['findAll']({'raw':_0x553e07[_0xb9f0('0x11')]?_0x553e07['options']['raw']===undefined?!![]:![]:!![],'where':_0x553e07[_0xb9f0('0x11')]?_0x553e07['options'][_0xb9f0('0x12')]||null:null,'attributes':_0x553e07['options']?_0x553e07[_0xb9f0('0x11')][_0xb9f0('0x13')]||null:null,'limit':_0x553e07['options']?_0x553e07[_0xb9f0('0x11')][_0xb9f0('0x14')]||null:null,'include':_0x553e07[_0xb9f0('0x11')]?_0x553e07[_0xb9f0('0x11')][_0xb9f0('0x15')]?_[_0xb9f0('0x16')](_0x553e07[_0xb9f0('0x11')]['include'],function(_0x100bdd){return{'model':db[_0x100bdd[_0xb9f0('0x17')]],'as':_0x100bdd['as'],'attributes':_0x100bdd['attributes'],'include':_0x100bdd[_0xb9f0('0x15')]?_[_0xb9f0('0x16')](_0x100bdd[_0xb9f0('0x15')],function(_0x4c86bd){return{'model':db[_0x4c86bd[_0xb9f0('0x17')]],'as':_0x4c86bd['as'],'attributes':_0x4c86bd[_0xb9f0('0x13')],'include':_0x4c86bd[_0xb9f0('0x15')]?_[_0xb9f0('0x16')](_0x4c86bd['include'],function(_0x3cf59f){return{'model':db[_0x3cf59f[_0xb9f0('0x17')]],'as':_0x3cf59f['as'],'attributes':_0x3cf59f[_0xb9f0('0x13')]};}):[]};}):[]};}):[]:[]})[_0xb9f0('0x7')](function(_0x3073e2){logger[_0xb9f0('0x8')](_0xb9f0('0x10'),_0x553e07);logger[_0xb9f0('0xb')]('GetDeskAccount',_0x553e07,JSON[_0xb9f0('0x18')](_0x3073e2));_0x1d3e52(_0x3073e2);})['catch'](function(_0x5c4bfd){logger['error'](_0xb9f0('0x10'),_0x5c4bfd['message'],_0x553e07);_0x3d6107(_0x8af322[_0xb9f0('0xd')](0x1f4,_0x5c4bfd['message']));});});};exports['ShowDeskAccount']=function(_0x39c4e7){var _0x49ebff=this;return new Promise(function(_0x3ff9af,_0x1cc6e9){return db[_0xb9f0('0x19')][_0xb9f0('0x1a')]({'raw':_0x39c4e7[_0xb9f0('0x11')]?_0x39c4e7['options'][_0xb9f0('0x1b')]===undefined?!![]:![]:!![],'where':_0x39c4e7[_0xb9f0('0x11')]?_0x39c4e7['options'][_0xb9f0('0x12')]||null:null,'attributes':_0x39c4e7[_0xb9f0('0x11')]?_0x39c4e7[_0xb9f0('0x11')][_0xb9f0('0x13')]||null:null,'include':_0x39c4e7['options']?_0x39c4e7[_0xb9f0('0x11')][_0xb9f0('0x15')]?_[_0xb9f0('0x16')](_0x39c4e7[_0xb9f0('0x11')][_0xb9f0('0x15')],function(_0x2a8638){return{'model':db[_0x2a8638[_0xb9f0('0x17')]],'as':_0x2a8638['as'],'attributes':_0x2a8638['attributes'],'include':_0x2a8638['include']?_[_0xb9f0('0x16')](_0x2a8638['include'],function(_0x202fe8){return{'model':db[_0x202fe8[_0xb9f0('0x17')]],'as':_0x202fe8['as'],'attributes':_0x202fe8[_0xb9f0('0x13')],'include':_0x202fe8['include']?_['map'](_0x202fe8[_0xb9f0('0x15')],function(_0xfcbe35){return{'model':db[_0xfcbe35[_0xb9f0('0x17')]],'as':_0xfcbe35['as'],'attributes':_0xfcbe35[_0xb9f0('0x13')]};}):[]};}):[]};}):[]:[]})[_0xb9f0('0x7')](function(_0x585f04){logger[_0xb9f0('0x8')](_0xb9f0('0x1c'),_0x39c4e7);logger['debug'](_0xb9f0('0x1c'),_0x39c4e7,JSON[_0xb9f0('0x18')](_0x585f04));_0x3ff9af(_0x585f04);})[_0xb9f0('0x1d')](function(_0x2f8954){logger[_0xb9f0('0xd')](_0xb9f0('0x1c'),_0x2f8954[_0xb9f0('0xe')],_0x39c4e7);_0x1cc6e9(_0x49ebff[_0xb9f0('0xd')](0x1f4,_0x2f8954[_0xb9f0('0xe')]));});});}; \ No newline at end of file +var _0xa70c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','DeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetDeskAccount','ShowDeskAccount','find','lodash','moment','randomstring'];(function(_0x5b2fe7,_0x2f928e){var _0x1c99b1=function(_0x394eda){while(--_0x394eda){_0x5b2fe7['push'](_0x5b2fe7['shift']());}};_0x1c99b1(++_0x2f928e);}(_0xa70c,0xeb));var _0xca70=function(_0x50bd84,_0x1be88b){_0x50bd84=_0x50bd84-0x0;var _0x4fd95d=_0xa70c[_0x50bd84];return _0x4fd95d;};'use strict';var _=require(_0xca70('0x0'));var util=require('util');var moment=require(_0xca70('0x1'));var BPromise=require('bluebird');var rs=require(_0xca70('0x2'));var fs=require('fs');var Redis=require(_0xca70('0x3'));var db=require(_0xca70('0x4'))['db'];var utils=require(_0xca70('0x5'));var logger=require(_0xca70('0x6'))(_0xca70('0x7'));var config=require(_0xca70('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca70('0x9')][_0xca70('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a66a,_0x1b0723,_0x9b7829){return new BPromise(function(_0x57e508,_0x14a081){return client[_0xca70('0xb')](_0x12a66a,_0x9b7829)[_0xca70('0xc')](function(_0x4c6057){logger['info']('DeskAccount,\x20%s,\x20%s',_0x1b0723,_0xca70('0xd'));logger[_0xca70('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1b0723,'request\x20sent',JSON[_0xca70('0xf')](_0x4c6057));if(_0x4c6057[_0xca70('0x10')]){if(_0x4c6057[_0xca70('0x10')][_0xca70('0x11')]===0x1f4){logger[_0xca70('0x10')](_0xca70('0x12'),_0x1b0723,_0x4c6057[_0xca70('0x10')][_0xca70('0x13')]);return _0x14a081(_0x4c6057['error']['message']);}logger[_0xca70('0x10')](_0xca70('0x12'),_0x1b0723,_0x4c6057[_0xca70('0x10')][_0xca70('0x13')]);return _0x57e508(_0x4c6057[_0xca70('0x10')]['message']);}else{logger[_0xca70('0x14')](_0xca70('0x12'),_0x1b0723,_0xca70('0xd'));_0x57e508(_0x4c6057['result'][_0xca70('0x13')]);}})['catch'](function(_0x3b2d63){logger[_0xca70('0x10')]('DeskAccount,\x20%s,\x20%s',_0x1b0723,_0x3b2d63);_0x14a081(_0x3b2d63);});});}exports['GetDeskAccount']=function(_0x470509){var _0x338e88=this;return new Promise(function(_0x233204,_0xf48318){return db[_0xca70('0x15')][_0xca70('0x16')]({'raw':_0x470509['options']?_0x470509[_0xca70('0x17')][_0xca70('0x18')]===undefined?!![]:![]:!![],'where':_0x470509[_0xca70('0x17')]?_0x470509['options'][_0xca70('0x19')]||null:null,'attributes':_0x470509[_0xca70('0x17')]?_0x470509[_0xca70('0x17')][_0xca70('0x1a')]||null:null,'limit':_0x470509[_0xca70('0x17')]?_0x470509[_0xca70('0x17')][_0xca70('0x1b')]||null:null,'include':_0x470509[_0xca70('0x17')]?_0x470509[_0xca70('0x17')][_0xca70('0x1c')]?_['map'](_0x470509['options'][_0xca70('0x1c')],function(_0x3ee78e){return{'model':db[_0x3ee78e[_0xca70('0x1d')]],'as':_0x3ee78e['as'],'attributes':_0x3ee78e[_0xca70('0x1a')],'include':_0x3ee78e['include']?_[_0xca70('0x1e')](_0x3ee78e[_0xca70('0x1c')],function(_0x1d54c1){return{'model':db[_0x1d54c1[_0xca70('0x1d')]],'as':_0x1d54c1['as'],'attributes':_0x1d54c1['attributes'],'include':_0x1d54c1['include']?_[_0xca70('0x1e')](_0x1d54c1[_0xca70('0x1c')],function(_0x3c0357){return{'model':db[_0x3c0357['model']],'as':_0x3c0357['as'],'attributes':_0x3c0357['attributes']};}):[]};}):[]};}):[]:[]})[_0xca70('0xc')](function(_0x5dc721){logger[_0xca70('0x14')](_0xca70('0x1f'),_0x470509);logger['debug']('GetDeskAccount',_0x470509,JSON[_0xca70('0xf')](_0x5dc721));_0x233204(_0x5dc721);})['catch'](function(_0x281f01){logger[_0xca70('0x10')](_0xca70('0x1f'),_0x281f01[_0xca70('0x13')],_0x470509);_0xf48318(_0x338e88[_0xca70('0x10')](0x1f4,_0x281f01[_0xca70('0x13')]));});});};exports[_0xca70('0x20')]=function(_0x4b65fa){var _0x295337=this;return new Promise(function(_0xf59e32,_0xa03471){return db[_0xca70('0x15')][_0xca70('0x21')]({'raw':_0x4b65fa[_0xca70('0x17')]?_0x4b65fa[_0xca70('0x17')][_0xca70('0x18')]===undefined?!![]:![]:!![],'where':_0x4b65fa[_0xca70('0x17')]?_0x4b65fa['options'][_0xca70('0x19')]||null:null,'attributes':_0x4b65fa[_0xca70('0x17')]?_0x4b65fa[_0xca70('0x17')][_0xca70('0x1a')]||null:null,'include':_0x4b65fa['options']?_0x4b65fa[_0xca70('0x17')][_0xca70('0x1c')]?_[_0xca70('0x1e')](_0x4b65fa[_0xca70('0x17')][_0xca70('0x1c')],function(_0x1ccb2f){return{'model':db[_0x1ccb2f[_0xca70('0x1d')]],'as':_0x1ccb2f['as'],'attributes':_0x1ccb2f[_0xca70('0x1a')],'include':_0x1ccb2f[_0xca70('0x1c')]?_['map'](_0x1ccb2f[_0xca70('0x1c')],function(_0x33debb){return{'model':db[_0x33debb[_0xca70('0x1d')]],'as':_0x33debb['as'],'attributes':_0x33debb[_0xca70('0x1a')],'include':_0x33debb[_0xca70('0x1c')]?_[_0xca70('0x1e')](_0x33debb[_0xca70('0x1c')],function(_0x37f40d){return{'model':db[_0x37f40d[_0xca70('0x1d')]],'as':_0x37f40d['as'],'attributes':_0x37f40d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b68e1){logger[_0xca70('0x14')](_0xca70('0x20'),_0x4b65fa);logger[_0xca70('0xe')](_0xca70('0x20'),_0x4b65fa,JSON[_0xca70('0xf')](_0x5b68e1));_0xf59e32(_0x5b68e1);})['catch'](function(_0x38ec3b){logger[_0xca70('0x10')](_0xca70('0x20'),_0x38ec3b['message'],_0x4b65fa);_0xa03471(_0x295337['error'](0x1f4,_0x38ec3b[_0xca70('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3266488..c31146f 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 _0x47c5=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4152fb,_0x382ecb){var _0x53b04d=function(_0x500c33){while(--_0x500c33){_0x4152fb['push'](_0x4152fb['shift']());}};_0x53b04d(++_0x382ecb);}(_0x47c5,0x165));var _0x547c=function(_0x136cbb,_0x2a97f9){_0x136cbb=_0x136cbb-0x0;var _0x333a69=_0x47c5[_0x136cbb];return _0x333a69;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x547c('0x6'));var config=require(_0x547c('0x7'));var controller=require('./intDeskConfiguration.controller');router[_0x547c('0x8')]('/',auth[_0x547c('0x9')](),controller['index']);router[_0x547c('0x8')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0xb')]);router[_0x547c('0x8')](_0x547c('0xc'),auth[_0x547c('0x9')](),controller[_0x547c('0xd')]);router[_0x547c('0x8')](_0x547c('0xe'),auth[_0x547c('0x9')](),controller[_0x547c('0xf')]);router[_0x547c('0x8')](_0x547c('0x10'),auth[_0x547c('0x9')](),controller[_0x547c('0x11')]);router[_0x547c('0x8')]('/:id/tags',auth[_0x547c('0x9')](),controller[_0x547c('0x12')]);router['post']('/',auth[_0x547c('0x9')](),controller[_0x547c('0x13')]);router[_0x547c('0x14')](_0x547c('0x15'),auth[_0x547c('0x9')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0x18')]);router[_0x547c('0x19')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0x1a')]);module[_0x547c('0x1b')]=router; \ No newline at end of file +var _0xc274=['get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','put','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated'];(function(_0x3c120e,_0x5cf2d6){var _0x5a1234=function(_0x5aa06b){while(--_0x5aa06b){_0x3c120e['push'](_0x3c120e['shift']());}};_0x5a1234(++_0x5cf2d6);}(_0xc274,0x151));var _0x4c27=function(_0x34a874,_0x628169){_0x34a874=_0x34a874-0x0;var _0x2dfd0f=_0xc274[_0x34a874];return _0x2dfd0f;};'use strict';var multer=require('multer');var util=require(_0x4c27('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c27('0x1'));var router=express[_0x4c27('0x2')]();var auth=require(_0x4c27('0x3'));var interaction=require(_0x4c27('0x4'));var config=require(_0x4c27('0x5'));var controller=require(_0x4c27('0x6'));router['get']('/',auth[_0x4c27('0x7')](),controller['index']);router[_0x4c27('0x8')](_0x4c27('0x9'),auth[_0x4c27('0x7')](),controller['show']);router['get'](_0x4c27('0xa'),auth['isAuthenticated'](),controller[_0x4c27('0xb')]);router[_0x4c27('0x8')](_0x4c27('0xc'),auth[_0x4c27('0x7')](),controller[_0x4c27('0xd')]);router['get'](_0x4c27('0xe'),auth[_0x4c27('0x7')](),controller[_0x4c27('0xf')]);router[_0x4c27('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0x4c27('0x10')]);router[_0x4c27('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c27('0x11')](_0x4c27('0x12'),auth[_0x4c27('0x7')](),controller['setTags']);router[_0x4c27('0x13')](_0x4c27('0x9'),auth[_0x4c27('0x7')](),controller['update']);router[_0x4c27('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4c27('0x15')]);module[_0x4c27('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b1d3d15..b1b7dbe 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 _0x0ce9=['sequelize','exports','STRING'];(function(_0x2bc927,_0x33312d){var _0x3389a4=function(_0x19f484){while(--_0x19f484){_0x2bc927['push'](_0x2bc927['shift']());}};_0x3389a4(++_0x33312d);}(_0x0ce9,0x156));var _0x90ce=function(_0x5e5f52,_0x52ffe5){_0x5e5f52=_0x5e5f52-0x0;var _0x31ad0e=_0x0ce9[_0x5e5f52];return _0x31ad0e;};'use strict';var Sequelize=require(_0x90ce('0x0'));module[_0x90ce('0x1')]={'name':{'type':Sequelize[_0x90ce('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb9d1=['sequelize','STRING'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0xb9d1,0xc6));var _0x1b9d=function(_0x1fba7b,_0x519912){_0x1fba7b=_0x1fba7b-0x0;var _0x4e5077=_0xb9d1[_0x1fba7b];return _0x4e5077;};'use strict';var Sequelize=require(_0x1b9d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1b9d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b50487e..d983e1e 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 _0x1294=['setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','getFields','DeskField','order','nolimit','getSubjects','getDescriptions','findOne','getTags','Tag'];(function(_0x4a5878,_0x280648){var _0x44b592=function(_0x1562f1){while(--_0x1562f1){_0x4a5878['push'](_0x4a5878['shift']());}};_0x44b592(++_0x280648);}(_0x1294,0x65));var _0x4129=function(_0x5fc4f9,_0x75415d){_0x5fc4f9=_0x5fc4f9-0x0;var _0x3d82ab=_0x1294[_0x5fc4f9];return _0x3d82ab;};'use strict';var pdf=require(_0x4129('0x0'));var emlformat=require(_0x4129('0x1'));var rimraf=require(_0x4129('0x2'));var zipdir=require(_0x4129('0x3'));var jsonpatch=require(_0x4129('0x4'));var rp=require(_0x4129('0x5'));var moment=require('moment');var BPromise=require(_0x4129('0x6'));var Mustache=require(_0x4129('0x7'));var util=require(_0x4129('0x8'));var path=require(_0x4129('0x9'));var sox=require('sox');var csv=require(_0x4129('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4129('0xb'));var squel=require(_0x4129('0xc'));var crypto=require(_0x4129('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4129('0xe'));var toCsv=require(_0x4129('0xa'));var querystring=require(_0x4129('0xf'));var Papa=require('papaparse');var Redis=require(_0x4129('0x10'));var authService=require(_0x4129('0x11'));var qs=require(_0x4129('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4129('0x13'));var logger=require(_0x4129('0x14'))(_0x4129('0x15'));var utils=require(_0x4129('0x16'));var config=require(_0x4129('0x17'));var db=require(_0x4129('0x18'))['db'];var jayson=require(_0x4129('0x19'));var client=jayson[_0x4129('0x1a')][_0x4129('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2ddfb9,_0x5839e1,_0x8b196e){if(_0x8b196e){var _0x5e01cf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e01cf[_0x4129('0x1c')](_0x5839e1)){return _0x2ddfb9;}else{throw new db['Sequelize'][(_0x4129('0x1d'))](_0x4129('0x1e'));}}else{return _0x2ddfb9;}}function respondWithRpcPromise(_0x1a4938,_0x4c2fa4,_0x312e43,_0x27840c){return new BPromise(function(_0xbbc7a2,_0x461695){var _0x6517ff=_0x27840c||client;return _0x6517ff[_0x4129('0x1f')](_0x1a4938,_0x312e43)[_0x4129('0x20')](function(_0x135aab){logger[_0x4129('0x21')](_0x4129('0x22'),_0x4c2fa4,_0x4129('0x23'));logger[_0x4129('0x24')](_0x4129('0x25'),_0x4c2fa4,_0x4129('0x23'),JSON['stringify'](_0x135aab));if(_0x135aab[_0x4129('0x26')]){if(_0x135aab['error'][_0x4129('0x27')]===0x1f4){logger[_0x4129('0x26')](_0x4129('0x22'),_0x4c2fa4,_0x135aab[_0x4129('0x26')][_0x4129('0x28')]);return _0x461695(_0x135aab[_0x4129('0x26')][_0x4129('0x28')]);}logger[_0x4129('0x26')](_0x4129('0x22'),_0x4c2fa4,_0x135aab[_0x4129('0x26')]['message']);return _0xbbc7a2(_0x135aab[_0x4129('0x26')][_0x4129('0x28')]);}else{logger['info'](_0x4129('0x22'),_0x4c2fa4,_0x4129('0x23'));_0xbbc7a2(_0x135aab[_0x4129('0x29')][_0x4129('0x28')]);}})[_0x4129('0x2a')](function(_0x91f466){logger[_0x4129('0x26')](_0x4129('0x22'),_0x4c2fa4,_0x91f466);_0x461695(_0x91f466);});});}function respondWithStatusCode(_0x291b85,_0x22df85){_0x22df85=_0x22df85||0xcc;return function(_0x38f3a9){if(_0x38f3a9){return _0x291b85['sendStatus'](_0x22df85);}return _0x291b85[_0x4129('0x2b')](_0x22df85)[_0x4129('0x2c')]();};}function respondWithResult(_0x53d422,_0xe22bf8){_0xe22bf8=_0xe22bf8||0xc8;return function(_0x1a93b7){if(_0x1a93b7){return _0x53d422[_0x4129('0x2b')](_0xe22bf8)[_0x4129('0x2d')](_0x1a93b7);}};}function respondWithFilteredResult(_0x472dac,_0x302a71){return function(_0x47f6b3){if(_0x47f6b3){var _0xc1db2e=_0x47f6b3[_0x4129('0x2e')],_0x467194=_0x302a71['offset'],_0x5d9551=_0x302a71[_0x4129('0x2f')]+_0x302a71['limit'],_0x4c4e32;if(_0x5d9551>=_0xc1db2e){_0x5d9551=_0xc1db2e;_0x4c4e32=0xc8;}else{_0x4c4e32=0xce;}_0x472dac[_0x4129('0x2b')](_0x4c4e32);return _0x472dac[_0x4129('0x30')](_0x4129('0x31'),_0x467194+'-'+_0x5d9551+'/'+_0xc1db2e)[_0x4129('0x2d')](_0x47f6b3);}return null;};}function patchUpdates(_0x53621a){return function(_0xc5fb4f){try{jsonpatch[_0x4129('0x32')](_0xc5fb4f,_0x53621a,!![]);}catch(_0x1354be){return BPromise['reject'](_0x1354be);}return _0xc5fb4f[_0x4129('0x33')]();};}function saveUpdates(_0x20851e,_0x4e116e){return function(_0xcf836a){if(_0xcf836a){return _0xcf836a[_0x4129('0x34')](_0x20851e)[_0x4129('0x20')](function(_0x233fe9){return _0x233fe9;});}return null;};}function removeEntity(_0x4fd94f,_0x329384){return function(_0x4d898d){if(_0x4d898d){return _0x4d898d['destroy']()[_0x4129('0x20')](function(){_0x4fd94f[_0x4129('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44714d,_0x3074bc){return function(_0x5348c2){if(!_0x5348c2){_0x44714d[_0x4129('0x35')](0x194);}return _0x5348c2;};}function handleError(_0x2a0a1d,_0x477377){_0x477377=_0x477377||0x1f4;return function(_0x1adc78){logger[_0x4129('0x26')](_0x1adc78[_0x4129('0x36')]);if(_0x1adc78['name']){delete _0x1adc78[_0x4129('0x37')];}_0x2a0a1d[_0x4129('0x2b')](_0x477377)[_0x4129('0x38')](_0x1adc78);};}exports[_0x4129('0x39')]=function(_0x37f06d,_0x5329de){var _0x99a381={},_0x252cf8={},_0x2cb619={'count':0x0,'rows':[]};var _0x4157a4=_['map'](db[_0x4129('0x3a')][_0x4129('0x3b')],function(_0x4918a0){return{'name':_0x4918a0[_0x4129('0x3c')],'type':_0x4918a0[_0x4129('0x3d')][_0x4129('0x3e')]};});_0x252cf8[_0x4129('0x3f')]=_[_0x4129('0x40')](_0x4157a4,'name');_0x252cf8[_0x4129('0x41')]=_[_0x4129('0x42')](_0x37f06d[_0x4129('0x41')]);_0x252cf8[_0x4129('0x43')]=_[_0x4129('0x44')](_0x252cf8[_0x4129('0x3f')],_0x252cf8['query']);_0x99a381[_0x4129('0x45')]=_[_0x4129('0x44')](_0x252cf8[_0x4129('0x3f')],qs[_0x4129('0x46')](_0x37f06d[_0x4129('0x41')][_0x4129('0x46')]));_0x99a381['attributes']=_0x99a381['attributes'][_0x4129('0x47')]?_0x99a381[_0x4129('0x45')]:_0x252cf8[_0x4129('0x3f')];if(!_0x37f06d['query'][_0x4129('0x48')]('nolimit')){_0x99a381[_0x4129('0x49')]=qs[_0x4129('0x49')](_0x37f06d[_0x4129('0x41')][_0x4129('0x49')]);_0x99a381['offset']=qs['offset'](_0x37f06d[_0x4129('0x41')][_0x4129('0x2f')]);}_0x99a381['order']=qs['sort'](_0x37f06d[_0x4129('0x41')][_0x4129('0x4a')]);_0x99a381['where']=qs[_0x4129('0x43')](_[_0x4129('0x4b')](_0x37f06d[_0x4129('0x41')],_0x252cf8[_0x4129('0x43')]));if(_0x37f06d[_0x4129('0x41')][_0x4129('0x4c')]){_0x99a381[_0x4129('0x4d')]=_[_0x4129('0x4e')](_0x99a381['where'],{'$or':_[_0x4129('0x40')](_0x4157a4,function(_0x56e464){if(_0x56e464['type']!==_0x4129('0x4f')){var _0x5f02bc={};_0x5f02bc[_0x56e464[_0x4129('0x37')]]={'$like':'%'+_0x37f06d[_0x4129('0x41')][_0x4129('0x4c')]+'%'};return _0x5f02bc;}})});}_0x99a381=_[_0x4129('0x4e')]({},_0x99a381,_0x37f06d[_0x4129('0x50')]);var _0x38441e={'where':_0x99a381[_0x4129('0x4d')]};return db[_0x4129('0x3a')][_0x4129('0x2e')](_0x38441e)[_0x4129('0x20')](function(_0x3368a3){_0x2cb619['count']=_0x3368a3;if(_0x37f06d['query'][_0x4129('0x51')]){_0x99a381[_0x4129('0x52')]=[{'all':!![]}];}return db[_0x4129('0x3a')][_0x4129('0x53')](_0x99a381);})['then'](function(_0x2110cb){_0x2cb619[_0x4129('0x54')]=_0x2110cb;return _0x2cb619;})[_0x4129('0x20')](respondWithFilteredResult(_0x5329de,_0x99a381))[_0x4129('0x2a')](handleError(_0x5329de,null));};exports[_0x4129('0x55')]=function(_0x4b9256,_0x3146a1){var _0x4e4786={'raw':![],'where':{'id':_0x4b9256[_0x4129('0x56')]['id']}},_0x327558={};_0x327558[_0x4129('0x3f')]=_['keys'](db['DeskConfiguration'][_0x4129('0x3b')]);_0x327558[_0x4129('0x41')]=_[_0x4129('0x42')](_0x4b9256[_0x4129('0x41')]);_0x327558[_0x4129('0x43')]=_[_0x4129('0x44')](_0x327558[_0x4129('0x3f')],_0x327558[_0x4129('0x41')]);_0x4e4786[_0x4129('0x45')]=_[_0x4129('0x44')](_0x327558[_0x4129('0x3f')],qs['fields'](_0x4b9256[_0x4129('0x41')][_0x4129('0x46')]));_0x4e4786[_0x4129('0x45')]=_0x4e4786[_0x4129('0x45')][_0x4129('0x47')]?_0x4e4786[_0x4129('0x45')]:_0x327558[_0x4129('0x3f')];if(_0x4b9256[_0x4129('0x41')]['includeAll']){_0x4e4786[_0x4129('0x52')]=[{'all':!![]}];}_0x4e4786=_['merge']({},_0x4e4786,_0x4b9256[_0x4129('0x50')]);return db[_0x4129('0x3a')]['find'](_0x4e4786)[_0x4129('0x20')](handleEntityNotFound(_0x3146a1,null))[_0x4129('0x20')](respondWithResult(_0x3146a1,null))[_0x4129('0x2a')](handleError(_0x3146a1,null));};exports[_0x4129('0x57')]=function(_0x3d575c,_0x5cf392){return db[_0x4129('0x3a')]['create'](_0x3d575c[_0x4129('0x58')],{})[_0x4129('0x20')](respondWithResult(_0x5cf392,0xc9))[_0x4129('0x2a')](handleError(_0x5cf392,null));};exports[_0x4129('0x34')]=function(_0x474a46,_0x550b78){if(_0x474a46[_0x4129('0x58')]['id']){delete _0x474a46[_0x4129('0x58')]['id'];}return db[_0x4129('0x3a')][_0x4129('0x59')]({'where':{'id':_0x474a46[_0x4129('0x56')]['id']}})[_0x4129('0x20')](handleEntityNotFound(_0x550b78,null))[_0x4129('0x20')](saveUpdates(_0x474a46[_0x4129('0x58')],null))['then'](respondWithResult(_0x550b78,null))[_0x4129('0x2a')](handleError(_0x550b78,null));};exports['destroy']=function(_0x5d97d7,_0x3b9fcd){return db['DeskConfiguration'][_0x4129('0x59')]({'where':{'id':_0x5d97d7[_0x4129('0x56')]['id']}})[_0x4129('0x20')](handleEntityNotFound(_0x3b9fcd,null))[_0x4129('0x20')](removeEntity(_0x3b9fcd,null))[_0x4129('0x2a')](handleError(_0x3b9fcd,null));};exports[_0x4129('0x5a')]=function(_0x1d5392,_0x5b2062,_0x20ccbd){var _0x3c9884={};var _0x3a74df={};var _0x39a76a;var _0xeae7a4;return db[_0x4129('0x3a')]['findOne']({'where':{'id':_0x1d5392[_0x4129('0x56')]['id']}})['then'](handleEntityNotFound(_0x5b2062,null))[_0x4129('0x20')](function(_0x356d22){if(_0x356d22){_0x39a76a=_0x356d22;_0x3a74df[_0x4129('0x3f')]=_[_0x4129('0x42')](db[_0x4129('0x5b')]['rawAttributes']);_0x3a74df['query']=_[_0x4129('0x42')](_0x1d5392[_0x4129('0x41')]);_0x3a74df['filters']=_[_0x4129('0x44')](_0x3a74df[_0x4129('0x3f')],_0x3a74df[_0x4129('0x41')]);_0x3c9884['attributes']=_['intersection'](_0x3a74df[_0x4129('0x3f')],qs[_0x4129('0x46')](_0x1d5392[_0x4129('0x41')][_0x4129('0x46')]));_0x3c9884[_0x4129('0x45')]=_0x3c9884['attributes']['length']?_0x3c9884[_0x4129('0x45')]:_0x3a74df[_0x4129('0x3f')];_0x3c9884[_0x4129('0x5c')]=qs[_0x4129('0x4a')](_0x1d5392[_0x4129('0x41')][_0x4129('0x4a')]);_0x3c9884['where']=qs[_0x4129('0x43')](_[_0x4129('0x4b')](_0x1d5392[_0x4129('0x41')],_0x3a74df['filters']));if(_0x1d5392[_0x4129('0x41')][_0x4129('0x4c')]){_0x3c9884[_0x4129('0x4d')]=_[_0x4129('0x4e')](_0x3c9884[_0x4129('0x4d')],{'$or':_[_0x4129('0x40')](_0x3c9884[_0x4129('0x45')],function(_0x46eb3b){var _0x30439c={};_0x30439c[_0x46eb3b]={'$like':'%'+_0x1d5392[_0x4129('0x41')][_0x4129('0x4c')]+'%'};return _0x30439c;})});}_0x3c9884=_['merge']({},_0x3c9884,_0x1d5392['options']);return _0x39a76a[_0x4129('0x5a')](_0x3c9884);}})[_0x4129('0x20')](function(_0x139643){if(_0x139643){_0xeae7a4=_0x139643[_0x4129('0x47')];if(!_0x1d5392[_0x4129('0x41')][_0x4129('0x48')](_0x4129('0x5d'))){_0x3c9884[_0x4129('0x49')]=qs['limit'](_0x1d5392[_0x4129('0x41')][_0x4129('0x49')]);_0x3c9884[_0x4129('0x2f')]=qs[_0x4129('0x2f')](_0x1d5392[_0x4129('0x41')][_0x4129('0x2f')]);}return _0x39a76a[_0x4129('0x5a')](_0x3c9884);}})[_0x4129('0x20')](function(_0x1ca068){if(_0x1ca068){return _0x1ca068?{'count':_0xeae7a4,'rows':_0x1ca068}:null;}})[_0x4129('0x20')](respondWithResult(_0x5b2062,null))[_0x4129('0x2a')](handleError(_0x5b2062,null));};exports[_0x4129('0x5e')]=function(_0x36f228,_0x318e39,_0x530d44){var _0x2d8e34={};var _0xe5d4ae={};var _0x535038;var _0x3799c3;return db['DeskConfiguration']['findOne']({'where':{'id':_0x36f228['params']['id']}})[_0x4129('0x20')](handleEntityNotFound(_0x318e39,null))[_0x4129('0x20')](function(_0x239c92){if(_0x239c92){_0x535038=_0x239c92;_0xe5d4ae[_0x4129('0x3f')]=_[_0x4129('0x42')](db[_0x4129('0x5b')][_0x4129('0x3b')]);_0xe5d4ae[_0x4129('0x41')]=_[_0x4129('0x42')](_0x36f228[_0x4129('0x41')]);_0xe5d4ae['filters']=_['intersection'](_0xe5d4ae[_0x4129('0x3f')],_0xe5d4ae[_0x4129('0x41')]);_0x2d8e34[_0x4129('0x45')]=_['intersection'](_0xe5d4ae['model'],qs['fields'](_0x36f228[_0x4129('0x41')][_0x4129('0x46')]));_0x2d8e34[_0x4129('0x45')]=_0x2d8e34['attributes'][_0x4129('0x47')]?_0x2d8e34['attributes']:_0xe5d4ae['model'];_0x2d8e34['order']=qs[_0x4129('0x4a')](_0x36f228[_0x4129('0x41')][_0x4129('0x4a')]);_0x2d8e34[_0x4129('0x4d')]=qs['filters'](_[_0x4129('0x4b')](_0x36f228['query'],_0xe5d4ae[_0x4129('0x43')]));if(_0x36f228[_0x4129('0x41')][_0x4129('0x4c')]){_0x2d8e34[_0x4129('0x4d')]=_[_0x4129('0x4e')](_0x2d8e34[_0x4129('0x4d')],{'$or':_[_0x4129('0x40')](_0x2d8e34['attributes'],function(_0x269518){var _0x26c594={};_0x26c594[_0x269518]={'$like':'%'+_0x36f228['query'][_0x4129('0x4c')]+'%'};return _0x26c594;})});}_0x2d8e34=_['merge']({},_0x2d8e34,_0x36f228[_0x4129('0x50')]);return _0x535038[_0x4129('0x5e')](_0x2d8e34);}})[_0x4129('0x20')](function(_0x51beb5){if(_0x51beb5){_0x3799c3=_0x51beb5[_0x4129('0x47')];if(!_0x36f228[_0x4129('0x41')]['hasOwnProperty'](_0x4129('0x5d'))){_0x2d8e34[_0x4129('0x49')]=qs['limit'](_0x36f228[_0x4129('0x41')][_0x4129('0x49')]);_0x2d8e34['offset']=qs[_0x4129('0x2f')](_0x36f228[_0x4129('0x41')]['offset']);}return _0x535038[_0x4129('0x5e')](_0x2d8e34);}})[_0x4129('0x20')](function(_0x104a61){if(_0x104a61){return _0x104a61?{'count':_0x3799c3,'rows':_0x104a61}:null;}})[_0x4129('0x20')](respondWithResult(_0x318e39,null))[_0x4129('0x2a')](handleError(_0x318e39,null));};exports[_0x4129('0x5f')]=function(_0x1e2161,_0x50d6d7,_0x434f9c){var _0x1c5133={};var _0x46c715={};var _0x884ef3;var _0xa298bc;return db[_0x4129('0x3a')][_0x4129('0x60')]({'where':{'id':_0x1e2161['params']['id']}})[_0x4129('0x20')](handleEntityNotFound(_0x50d6d7,null))['then'](function(_0x5458bb){if(_0x5458bb){_0x884ef3=_0x5458bb;_0x46c715[_0x4129('0x3f')]=_[_0x4129('0x42')](db['DeskField'][_0x4129('0x3b')]);_0x46c715[_0x4129('0x41')]=_[_0x4129('0x42')](_0x1e2161[_0x4129('0x41')]);_0x46c715[_0x4129('0x43')]=_['intersection'](_0x46c715[_0x4129('0x3f')],_0x46c715[_0x4129('0x41')]);_0x1c5133[_0x4129('0x45')]=_[_0x4129('0x44')](_0x46c715[_0x4129('0x3f')],qs['fields'](_0x1e2161['query']['fields']));_0x1c5133[_0x4129('0x45')]=_0x1c5133['attributes'][_0x4129('0x47')]?_0x1c5133['attributes']:_0x46c715[_0x4129('0x3f')];_0x1c5133[_0x4129('0x5c')]=qs[_0x4129('0x4a')](_0x1e2161['query'][_0x4129('0x4a')]);_0x1c5133[_0x4129('0x4d')]=qs[_0x4129('0x43')](_[_0x4129('0x4b')](_0x1e2161[_0x4129('0x41')],_0x46c715[_0x4129('0x43')]));if(_0x1e2161[_0x4129('0x41')][_0x4129('0x4c')]){_0x1c5133['where']=_['merge'](_0x1c5133[_0x4129('0x4d')],{'$or':_[_0x4129('0x40')](_0x1c5133[_0x4129('0x45')],function(_0x5a50f3){var _0x17a2f7={};_0x17a2f7[_0x5a50f3]={'$like':'%'+_0x1e2161['query']['filter']+'%'};return _0x17a2f7;})});}_0x1c5133=_[_0x4129('0x4e')]({},_0x1c5133,_0x1e2161[_0x4129('0x50')]);return _0x884ef3[_0x4129('0x5f')](_0x1c5133);}})[_0x4129('0x20')](function(_0x3bf419){if(_0x3bf419){_0xa298bc=_0x3bf419[_0x4129('0x47')];if(!_0x1e2161[_0x4129('0x41')][_0x4129('0x48')]('nolimit')){_0x1c5133[_0x4129('0x49')]=qs[_0x4129('0x49')](_0x1e2161[_0x4129('0x41')][_0x4129('0x49')]);_0x1c5133['offset']=qs[_0x4129('0x2f')](_0x1e2161[_0x4129('0x41')]['offset']);}return _0x884ef3[_0x4129('0x5f')](_0x1c5133);}})[_0x4129('0x20')](function(_0x3c2419){if(_0x3c2419){return _0x3c2419?{'count':_0xa298bc,'rows':_0x3c2419}:null;}})[_0x4129('0x20')](respondWithResult(_0x50d6d7,null))['catch'](handleError(_0x50d6d7,null));};exports[_0x4129('0x61')]=function(_0x4b5220,_0x59f99a,_0x133fc3){var _0x48a104={};var _0x320526={};var _0x4ef089;var _0x28b3b0;return db[_0x4129('0x3a')][_0x4129('0x60')]({'where':{'id':_0x4b5220['params']['id']}})[_0x4129('0x20')](handleEntityNotFound(_0x59f99a,null))[_0x4129('0x20')](function(_0x27b1a4){if(_0x27b1a4){_0x4ef089=_0x27b1a4;_0x320526[_0x4129('0x3f')]=_[_0x4129('0x42')](db[_0x4129('0x62')]['rawAttributes']);_0x320526[_0x4129('0x41')]=_[_0x4129('0x42')](_0x4b5220[_0x4129('0x41')]);_0x320526[_0x4129('0x43')]=_[_0x4129('0x44')](_0x320526[_0x4129('0x3f')],_0x320526[_0x4129('0x41')]);_0x48a104['attributes']=_[_0x4129('0x44')](_0x320526[_0x4129('0x3f')],qs[_0x4129('0x46')](_0x4b5220[_0x4129('0x41')][_0x4129('0x46')]));_0x48a104[_0x4129('0x45')]=_0x48a104[_0x4129('0x45')]['length']?_0x48a104[_0x4129('0x45')]:_0x320526[_0x4129('0x3f')];_0x48a104[_0x4129('0x5c')]=qs[_0x4129('0x4a')](_0x4b5220['query'][_0x4129('0x4a')]);_0x48a104[_0x4129('0x4d')]=qs[_0x4129('0x43')](_['pick'](_0x4b5220[_0x4129('0x41')],_0x320526['filters']));if(_0x4b5220['query'][_0x4129('0x4c')]){_0x48a104[_0x4129('0x4d')]=_[_0x4129('0x4e')](_0x48a104[_0x4129('0x4d')],{'$or':_[_0x4129('0x40')](_0x48a104[_0x4129('0x45')],function(_0x412d1){var _0x2e8013={};_0x2e8013[_0x412d1]={'$like':'%'+_0x4b5220[_0x4129('0x41')][_0x4129('0x4c')]+'%'};return _0x2e8013;})});}_0x48a104=_[_0x4129('0x4e')]({},_0x48a104,_0x4b5220[_0x4129('0x50')]);return _0x4ef089['getTags'](_0x48a104);}})[_0x4129('0x20')](function(_0x3ad40b){if(_0x3ad40b){_0x28b3b0=_0x3ad40b[_0x4129('0x47')];if(!_0x4b5220['query']['hasOwnProperty'](_0x4129('0x5d'))){_0x48a104[_0x4129('0x49')]=qs[_0x4129('0x49')](_0x4b5220[_0x4129('0x41')][_0x4129('0x49')]);_0x48a104['offset']=qs[_0x4129('0x2f')](_0x4b5220[_0x4129('0x41')][_0x4129('0x2f')]);}return _0x4ef089[_0x4129('0x61')](_0x48a104);}})[_0x4129('0x20')](function(_0x1b00e3){if(_0x1b00e3){return _0x1b00e3?{'count':_0x28b3b0,'rows':_0x1b00e3}:null;}})[_0x4129('0x20')](respondWithResult(_0x59f99a,null))[_0x4129('0x2a')](handleError(_0x59f99a,null));};exports[_0x4129('0x63')]=function(_0x4948c8,_0x375c3a,_0x2d350b){if(_0x4948c8[_0x4129('0x58')]['id']){delete _0x4948c8[_0x4129('0x58')]['id'];}return db[_0x4129('0x3a')][_0x4129('0x60')]({'where':{'id':_0x4948c8[_0x4129('0x56')]['id']}})[_0x4129('0x20')](handleEntityNotFound(_0x375c3a,null))[_0x4129('0x20')](function(_0x111396){if(_0x111396){return _0x111396[_0x4129('0x63')](_0x4948c8[_0x4129('0x58')]['ids']||[]);}return null;})['then'](respondWithResult(_0x375c3a,null))[_0x4129('0x2a')](handleError(_0x375c3a,null));}; \ No newline at end of file +var _0x6c47=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','Content-Range','reject','update','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','show','params','find','create','body','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6c47,0x9e));var _0x76c4=function(_0x59fa41,_0x3b0d15){_0x59fa41=_0x59fa41-0x0;var _0xaa1d87=_0x6c47[_0x59fa41];return _0xaa1d87;};'use strict';var pdf=require(_0x76c4('0x0'));var emlformat=require(_0x76c4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x76c4('0x2'));var jsonpatch=require(_0x76c4('0x3'));var rp=require(_0x76c4('0x4'));var moment=require(_0x76c4('0x5'));var BPromise=require(_0x76c4('0x6'));var Mustache=require(_0x76c4('0x7'));var util=require(_0x76c4('0x8'));var path=require('path');var sox=require(_0x76c4('0x9'));var csv=require(_0x76c4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x76c4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x76c4('0xc'));var Papa=require(_0x76c4('0xd'));var Redis=require(_0x76c4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x76c4('0xf'));var hardwareService=require(_0x76c4('0x10'));var logger=require('../../config/logger')(_0x76c4('0x11'));var utils=require(_0x76c4('0x12'));var config=require(_0x76c4('0x13'));var db=require(_0x76c4('0x14'))['db'];var jayson=require(_0x76c4('0x15'));var client=jayson[_0x76c4('0x16')][_0x76c4('0x17')]({'port':0x232a});function checkPasswordPattern(_0x43fcda,_0x307e85,_0x3a8e54){if(_0x3a8e54){var _0x4df8c2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4df8c2[_0x76c4('0x18')](_0x307e85)){return _0x43fcda;}else{throw new db[(_0x76c4('0x19'))]['ValidationError'](_0x76c4('0x1a'));}}else{return _0x43fcda;}}function respondWithRpcPromise(_0xc38d1a,_0xdcf0f7,_0x2834eb,_0x2f4812){return new BPromise(function(_0x211df6,_0x520d18){var _0x3a78b8=_0x2f4812||client;return _0x3a78b8[_0x76c4('0x1b')](_0xc38d1a,_0x2834eb)[_0x76c4('0x1c')](function(_0x4fc13c){logger[_0x76c4('0x1d')](_0x76c4('0x1e'),_0xdcf0f7,_0x76c4('0x1f'));logger[_0x76c4('0x20')](_0x76c4('0x21'),_0xdcf0f7,_0x76c4('0x1f'),JSON[_0x76c4('0x22')](_0x4fc13c));if(_0x4fc13c[_0x76c4('0x23')]){if(_0x4fc13c[_0x76c4('0x23')][_0x76c4('0x24')]===0x1f4){logger[_0x76c4('0x23')](_0x76c4('0x1e'),_0xdcf0f7,_0x4fc13c[_0x76c4('0x23')][_0x76c4('0x25')]);return _0x520d18(_0x4fc13c[_0x76c4('0x23')][_0x76c4('0x25')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xdcf0f7,_0x4fc13c[_0x76c4('0x23')]['message']);return _0x211df6(_0x4fc13c['error']['message']);}else{logger['info'](_0x76c4('0x1e'),_0xdcf0f7,_0x76c4('0x1f'));_0x211df6(_0x4fc13c['result'][_0x76c4('0x25')]);}})[_0x76c4('0x26')](function(_0x42f5bc){logger[_0x76c4('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0xdcf0f7,_0x42f5bc);_0x520d18(_0x42f5bc);});});}function respondWithStatusCode(_0x5776a1,_0x507d9c){_0x507d9c=_0x507d9c||0xcc;return function(_0x57a1a7){if(_0x57a1a7){return _0x5776a1[_0x76c4('0x27')](_0x507d9c);}return _0x5776a1[_0x76c4('0x28')](_0x507d9c)[_0x76c4('0x29')]();};}function respondWithResult(_0x518393,_0x45e6aa){_0x45e6aa=_0x45e6aa||0xc8;return function(_0x48618b){if(_0x48618b){return _0x518393[_0x76c4('0x28')](_0x45e6aa)[_0x76c4('0x2a')](_0x48618b);}};}function respondWithFilteredResult(_0x324dd8,_0x365323){return function(_0x2391c5){if(_0x2391c5){var _0x5030ce=_0x2391c5['count'],_0xf4d2ab=_0x365323[_0x76c4('0x2b')],_0x45d24d=_0x365323[_0x76c4('0x2b')]+_0x365323['limit'],_0x5f1b93;if(_0x45d24d>=_0x5030ce){_0x45d24d=_0x5030ce;_0x5f1b93=0xc8;}else{_0x5f1b93=0xce;}_0x324dd8[_0x76c4('0x28')](_0x5f1b93);return _0x324dd8['set'](_0x76c4('0x2c'),_0xf4d2ab+'-'+_0x45d24d+'/'+_0x5030ce)[_0x76c4('0x2a')](_0x2391c5);}return null;};}function patchUpdates(_0x57b2a0){return function(_0x5b7da2){try{jsonpatch['apply'](_0x5b7da2,_0x57b2a0,!![]);}catch(_0x5155bf){return BPromise[_0x76c4('0x2d')](_0x5155bf);}return _0x5b7da2['save']();};}function saveUpdates(_0x45f126,_0xdcdb01){return function(_0x7d6d74){if(_0x7d6d74){return _0x7d6d74[_0x76c4('0x2e')](_0x45f126)[_0x76c4('0x1c')](function(_0x5ace2b){return _0x5ace2b;});}return null;};}function removeEntity(_0x2e1647,_0x2107af){return function(_0x5c8281){if(_0x5c8281){return _0x5c8281[_0x76c4('0x2f')]()[_0x76c4('0x1c')](function(){_0x2e1647['status'](0xcc)[_0x76c4('0x29')]();});}};}function handleEntityNotFound(_0x507f55,_0x2f4265){return function(_0x50324b){if(!_0x50324b){_0x507f55[_0x76c4('0x27')](0x194);}return _0x50324b;};}function handleError(_0x12f3ad,_0x209327){_0x209327=_0x209327||0x1f4;return function(_0x250d85){logger[_0x76c4('0x23')](_0x250d85[_0x76c4('0x30')]);if(_0x250d85['name']){delete _0x250d85[_0x76c4('0x31')];}_0x12f3ad[_0x76c4('0x28')](_0x209327)[_0x76c4('0x32')](_0x250d85);};}exports[_0x76c4('0x33')]=function(_0x33f538,_0x223f0e){var _0x141cb5={},_0x58b444={},_0x9ada4={'count':0x0,'rows':[]};var _0x2881e3=_[_0x76c4('0x34')](db[_0x76c4('0x35')][_0x76c4('0x36')],function(_0x1b1aa3){return{'name':_0x1b1aa3[_0x76c4('0x37')],'type':_0x1b1aa3[_0x76c4('0x38')]['key']};});_0x58b444['model']=_['map'](_0x2881e3,_0x76c4('0x31'));_0x58b444[_0x76c4('0x39')]=_[_0x76c4('0x3a')](_0x33f538[_0x76c4('0x39')]);_0x58b444['filters']=_[_0x76c4('0x3b')](_0x58b444['model'],_0x58b444[_0x76c4('0x39')]);_0x141cb5['attributes']=_[_0x76c4('0x3b')](_0x58b444[_0x76c4('0x3c')],qs['fields'](_0x33f538[_0x76c4('0x39')][_0x76c4('0x3d')]));_0x141cb5[_0x76c4('0x3e')]=_0x141cb5[_0x76c4('0x3e')][_0x76c4('0x3f')]?_0x141cb5[_0x76c4('0x3e')]:_0x58b444['model'];if(!_0x33f538[_0x76c4('0x39')][_0x76c4('0x40')](_0x76c4('0x41'))){_0x141cb5[_0x76c4('0x42')]=qs[_0x76c4('0x42')](_0x33f538[_0x76c4('0x39')][_0x76c4('0x42')]);_0x141cb5['offset']=qs[_0x76c4('0x2b')](_0x33f538[_0x76c4('0x39')][_0x76c4('0x2b')]);}_0x141cb5['order']=qs[_0x76c4('0x43')](_0x33f538[_0x76c4('0x39')][_0x76c4('0x43')]);_0x141cb5[_0x76c4('0x44')]=qs[_0x76c4('0x45')](_[_0x76c4('0x46')](_0x33f538[_0x76c4('0x39')],_0x58b444[_0x76c4('0x45')]));if(_0x33f538[_0x76c4('0x39')][_0x76c4('0x47')]){_0x141cb5[_0x76c4('0x44')]=_[_0x76c4('0x48')](_0x141cb5[_0x76c4('0x44')],{'$or':_[_0x76c4('0x34')](_0x2881e3,function(_0x58a166){if(_0x58a166['type']!=='VIRTUAL'){var _0x579c77={};_0x579c77[_0x58a166[_0x76c4('0x31')]]={'$like':'%'+_0x33f538[_0x76c4('0x39')][_0x76c4('0x47')]+'%'};return _0x579c77;}})});}_0x141cb5=_[_0x76c4('0x48')]({},_0x141cb5,_0x33f538[_0x76c4('0x49')]);var _0x78b243={'where':_0x141cb5['where']};return db[_0x76c4('0x35')]['count'](_0x78b243)[_0x76c4('0x1c')](function(_0x17e40d){_0x9ada4[_0x76c4('0x4a')]=_0x17e40d;if(_0x33f538['query'][_0x76c4('0x4b')]){_0x141cb5[_0x76c4('0x4c')]=[{'all':!![]}];}return db[_0x76c4('0x35')][_0x76c4('0x4d')](_0x141cb5);})[_0x76c4('0x1c')](function(_0x3fe346){_0x9ada4['rows']=_0x3fe346;return _0x9ada4;})[_0x76c4('0x1c')](respondWithFilteredResult(_0x223f0e,_0x141cb5))[_0x76c4('0x26')](handleError(_0x223f0e,null));};exports[_0x76c4('0x4e')]=function(_0x4ffc5e,_0x2d8548){var _0xcd526e={'raw':![],'where':{'id':_0x4ffc5e[_0x76c4('0x4f')]['id']}},_0x4c404a={};_0x4c404a[_0x76c4('0x3c')]=_[_0x76c4('0x3a')](db[_0x76c4('0x35')][_0x76c4('0x36')]);_0x4c404a['query']=_[_0x76c4('0x3a')](_0x4ffc5e['query']);_0x4c404a[_0x76c4('0x45')]=_[_0x76c4('0x3b')](_0x4c404a[_0x76c4('0x3c')],_0x4c404a[_0x76c4('0x39')]);_0xcd526e[_0x76c4('0x3e')]=_[_0x76c4('0x3b')](_0x4c404a[_0x76c4('0x3c')],qs[_0x76c4('0x3d')](_0x4ffc5e[_0x76c4('0x39')][_0x76c4('0x3d')]));_0xcd526e[_0x76c4('0x3e')]=_0xcd526e['attributes']['length']?_0xcd526e[_0x76c4('0x3e')]:_0x4c404a[_0x76c4('0x3c')];if(_0x4ffc5e[_0x76c4('0x39')][_0x76c4('0x4b')]){_0xcd526e['include']=[{'all':!![]}];}_0xcd526e=_['merge']({},_0xcd526e,_0x4ffc5e['options']);return db[_0x76c4('0x35')][_0x76c4('0x50')](_0xcd526e)[_0x76c4('0x1c')](handleEntityNotFound(_0x2d8548,null))['then'](respondWithResult(_0x2d8548,null))[_0x76c4('0x26')](handleError(_0x2d8548,null));};exports[_0x76c4('0x51')]=function(_0x472369,_0x33624e){return db[_0x76c4('0x35')]['create'](_0x472369['body'],{})[_0x76c4('0x1c')](respondWithResult(_0x33624e,0xc9))[_0x76c4('0x26')](handleError(_0x33624e,null));};exports['update']=function(_0x5c8909,_0x40c6f4){if(_0x5c8909['body']['id']){delete _0x5c8909[_0x76c4('0x52')]['id'];}return db[_0x76c4('0x35')][_0x76c4('0x50')]({'where':{'id':_0x5c8909[_0x76c4('0x4f')]['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x40c6f4,null))['then'](saveUpdates(_0x5c8909[_0x76c4('0x52')],null))[_0x76c4('0x1c')](respondWithResult(_0x40c6f4,null))[_0x76c4('0x26')](handleError(_0x40c6f4,null));};exports[_0x76c4('0x2f')]=function(_0xf40006,_0x28a91c){return db[_0x76c4('0x35')][_0x76c4('0x50')]({'where':{'id':_0xf40006[_0x76c4('0x4f')]['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x28a91c,null))['then'](removeEntity(_0x28a91c,null))[_0x76c4('0x26')](handleError(_0x28a91c,null));};exports[_0x76c4('0x53')]=function(_0x2ff1ec,_0x260bab,_0x40afbe){var _0x2e62d4={};var _0x400430={};var _0x59da41;var _0x3015b4;return db['DeskConfiguration'][_0x76c4('0x54')]({'where':{'id':_0x2ff1ec['params']['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x260bab,null))[_0x76c4('0x1c')](function(_0x3b2514){if(_0x3b2514){_0x59da41=_0x3b2514;_0x400430[_0x76c4('0x3c')]=_[_0x76c4('0x3a')](db[_0x76c4('0x55')][_0x76c4('0x36')]);_0x400430[_0x76c4('0x39')]=_[_0x76c4('0x3a')](_0x2ff1ec[_0x76c4('0x39')]);_0x400430[_0x76c4('0x45')]=_[_0x76c4('0x3b')](_0x400430[_0x76c4('0x3c')],_0x400430['query']);_0x2e62d4[_0x76c4('0x3e')]=_[_0x76c4('0x3b')](_0x400430[_0x76c4('0x3c')],qs[_0x76c4('0x3d')](_0x2ff1ec[_0x76c4('0x39')][_0x76c4('0x3d')]));_0x2e62d4['attributes']=_0x2e62d4['attributes']['length']?_0x2e62d4[_0x76c4('0x3e')]:_0x400430[_0x76c4('0x3c')];_0x2e62d4[_0x76c4('0x56')]=qs[_0x76c4('0x43')](_0x2ff1ec['query'][_0x76c4('0x43')]);_0x2e62d4[_0x76c4('0x44')]=qs[_0x76c4('0x45')](_[_0x76c4('0x46')](_0x2ff1ec['query'],_0x400430[_0x76c4('0x45')]));if(_0x2ff1ec[_0x76c4('0x39')][_0x76c4('0x47')]){_0x2e62d4[_0x76c4('0x44')]=_[_0x76c4('0x48')](_0x2e62d4[_0x76c4('0x44')],{'$or':_[_0x76c4('0x34')](_0x2e62d4[_0x76c4('0x3e')],function(_0x3e45d2){var _0x4bdc7b={};_0x4bdc7b[_0x3e45d2]={'$like':'%'+_0x2ff1ec[_0x76c4('0x39')]['filter']+'%'};return _0x4bdc7b;})});}_0x2e62d4=_[_0x76c4('0x48')]({},_0x2e62d4,_0x2ff1ec[_0x76c4('0x49')]);return _0x59da41[_0x76c4('0x53')](_0x2e62d4);}})[_0x76c4('0x1c')](function(_0x81b134){if(_0x81b134){_0x3015b4=_0x81b134[_0x76c4('0x3f')];if(!_0x2ff1ec['query'][_0x76c4('0x40')](_0x76c4('0x41'))){_0x2e62d4[_0x76c4('0x42')]=qs['limit'](_0x2ff1ec['query'][_0x76c4('0x42')]);_0x2e62d4[_0x76c4('0x2b')]=qs[_0x76c4('0x2b')](_0x2ff1ec[_0x76c4('0x39')][_0x76c4('0x2b')]);}return _0x59da41['getFields'](_0x2e62d4);}})['then'](function(_0x27093d){if(_0x27093d){return _0x27093d?{'count':_0x3015b4,'rows':_0x27093d}:null;}})['then'](respondWithResult(_0x260bab,null))['catch'](handleError(_0x260bab,null));};exports[_0x76c4('0x57')]=function(_0x2671b5,_0x5cc160,_0x4f881e){var _0x3d095c={};var _0x507611={};var _0x991f4d;var _0x437adc;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2671b5[_0x76c4('0x4f')]['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x5cc160,null))[_0x76c4('0x1c')](function(_0x2b4581){if(_0x2b4581){_0x991f4d=_0x2b4581;_0x507611[_0x76c4('0x3c')]=_[_0x76c4('0x3a')](db['DeskField'][_0x76c4('0x36')]);_0x507611[_0x76c4('0x39')]=_['keys'](_0x2671b5[_0x76c4('0x39')]);_0x507611[_0x76c4('0x45')]=_[_0x76c4('0x3b')](_0x507611[_0x76c4('0x3c')],_0x507611[_0x76c4('0x39')]);_0x3d095c[_0x76c4('0x3e')]=_['intersection'](_0x507611[_0x76c4('0x3c')],qs[_0x76c4('0x3d')](_0x2671b5['query'][_0x76c4('0x3d')]));_0x3d095c['attributes']=_0x3d095c[_0x76c4('0x3e')][_0x76c4('0x3f')]?_0x3d095c['attributes']:_0x507611[_0x76c4('0x3c')];_0x3d095c[_0x76c4('0x56')]=qs[_0x76c4('0x43')](_0x2671b5[_0x76c4('0x39')][_0x76c4('0x43')]);_0x3d095c[_0x76c4('0x44')]=qs['filters'](_[_0x76c4('0x46')](_0x2671b5[_0x76c4('0x39')],_0x507611['filters']));if(_0x2671b5[_0x76c4('0x39')][_0x76c4('0x47')]){_0x3d095c[_0x76c4('0x44')]=_[_0x76c4('0x48')](_0x3d095c[_0x76c4('0x44')],{'$or':_['map'](_0x3d095c[_0x76c4('0x3e')],function(_0x351616){var _0x36bb0e={};_0x36bb0e[_0x351616]={'$like':'%'+_0x2671b5['query']['filter']+'%'};return _0x36bb0e;})});}_0x3d095c=_['merge']({},_0x3d095c,_0x2671b5[_0x76c4('0x49')]);return _0x991f4d[_0x76c4('0x57')](_0x3d095c);}})[_0x76c4('0x1c')](function(_0xce149c){if(_0xce149c){_0x437adc=_0xce149c[_0x76c4('0x3f')];if(!_0x2671b5[_0x76c4('0x39')][_0x76c4('0x40')](_0x76c4('0x41'))){_0x3d095c['limit']=qs[_0x76c4('0x42')](_0x2671b5['query']['limit']);_0x3d095c[_0x76c4('0x2b')]=qs[_0x76c4('0x2b')](_0x2671b5['query'][_0x76c4('0x2b')]);}return _0x991f4d[_0x76c4('0x57')](_0x3d095c);}})['then'](function(_0x2cbb41){if(_0x2cbb41){return _0x2cbb41?{'count':_0x437adc,'rows':_0x2cbb41}:null;}})[_0x76c4('0x1c')](respondWithResult(_0x5cc160,null))['catch'](handleError(_0x5cc160,null));};exports[_0x76c4('0x58')]=function(_0x229200,_0x49bc52,_0x5d8874){var _0xc2ee3f={};var _0x42e541={};var _0x13eb00;var _0xd8d11f;return db[_0x76c4('0x35')][_0x76c4('0x54')]({'where':{'id':_0x229200[_0x76c4('0x4f')]['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x49bc52,null))[_0x76c4('0x1c')](function(_0x32257c){if(_0x32257c){_0x13eb00=_0x32257c;_0x42e541['model']=_[_0x76c4('0x3a')](db[_0x76c4('0x55')][_0x76c4('0x36')]);_0x42e541[_0x76c4('0x39')]=_['keys'](_0x229200['query']);_0x42e541[_0x76c4('0x45')]=_['intersection'](_0x42e541[_0x76c4('0x3c')],_0x42e541[_0x76c4('0x39')]);_0xc2ee3f[_0x76c4('0x3e')]=_[_0x76c4('0x3b')](_0x42e541[_0x76c4('0x3c')],qs[_0x76c4('0x3d')](_0x229200[_0x76c4('0x39')][_0x76c4('0x3d')]));_0xc2ee3f[_0x76c4('0x3e')]=_0xc2ee3f[_0x76c4('0x3e')][_0x76c4('0x3f')]?_0xc2ee3f['attributes']:_0x42e541['model'];_0xc2ee3f[_0x76c4('0x56')]=qs[_0x76c4('0x43')](_0x229200[_0x76c4('0x39')][_0x76c4('0x43')]);_0xc2ee3f['where']=qs[_0x76c4('0x45')](_['pick'](_0x229200[_0x76c4('0x39')],_0x42e541[_0x76c4('0x45')]));if(_0x229200[_0x76c4('0x39')][_0x76c4('0x47')]){_0xc2ee3f[_0x76c4('0x44')]=_[_0x76c4('0x48')](_0xc2ee3f[_0x76c4('0x44')],{'$or':_[_0x76c4('0x34')](_0xc2ee3f[_0x76c4('0x3e')],function(_0xe9d9a3){var _0x1b6107={};_0x1b6107[_0xe9d9a3]={'$like':'%'+_0x229200[_0x76c4('0x39')][_0x76c4('0x47')]+'%'};return _0x1b6107;})});}_0xc2ee3f=_['merge']({},_0xc2ee3f,_0x229200['options']);return _0x13eb00[_0x76c4('0x58')](_0xc2ee3f);}})[_0x76c4('0x1c')](function(_0x4f273c){if(_0x4f273c){_0xd8d11f=_0x4f273c[_0x76c4('0x3f')];if(!_0x229200[_0x76c4('0x39')]['hasOwnProperty'](_0x76c4('0x41'))){_0xc2ee3f['limit']=qs['limit'](_0x229200[_0x76c4('0x39')][_0x76c4('0x42')]);_0xc2ee3f[_0x76c4('0x2b')]=qs['offset'](_0x229200[_0x76c4('0x39')]['offset']);}return _0x13eb00[_0x76c4('0x58')](_0xc2ee3f);}})['then'](function(_0x3da3c9){if(_0x3da3c9){return _0x3da3c9?{'count':_0xd8d11f,'rows':_0x3da3c9}:null;}})[_0x76c4('0x1c')](respondWithResult(_0x49bc52,null))[_0x76c4('0x26')](handleError(_0x49bc52,null));};exports[_0x76c4('0x59')]=function(_0x52b487,_0x125c97,_0x9e371){var _0xe0ebcb={};var _0x14296a={};var _0x5950a6;var _0x314b0e;return db[_0x76c4('0x35')][_0x76c4('0x54')]({'where':{'id':_0x52b487[_0x76c4('0x4f')]['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x125c97,null))['then'](function(_0x2be7f2){if(_0x2be7f2){_0x5950a6=_0x2be7f2;_0x14296a['model']=_[_0x76c4('0x3a')](db[_0x76c4('0x5a')][_0x76c4('0x36')]);_0x14296a['query']=_[_0x76c4('0x3a')](_0x52b487[_0x76c4('0x39')]);_0x14296a[_0x76c4('0x45')]=_[_0x76c4('0x3b')](_0x14296a[_0x76c4('0x3c')],_0x14296a[_0x76c4('0x39')]);_0xe0ebcb[_0x76c4('0x3e')]=_['intersection'](_0x14296a[_0x76c4('0x3c')],qs[_0x76c4('0x3d')](_0x52b487[_0x76c4('0x39')][_0x76c4('0x3d')]));_0xe0ebcb[_0x76c4('0x3e')]=_0xe0ebcb['attributes'][_0x76c4('0x3f')]?_0xe0ebcb['attributes']:_0x14296a[_0x76c4('0x3c')];_0xe0ebcb[_0x76c4('0x56')]=qs[_0x76c4('0x43')](_0x52b487[_0x76c4('0x39')][_0x76c4('0x43')]);_0xe0ebcb[_0x76c4('0x44')]=qs[_0x76c4('0x45')](_[_0x76c4('0x46')](_0x52b487[_0x76c4('0x39')],_0x14296a['filters']));if(_0x52b487[_0x76c4('0x39')]['filter']){_0xe0ebcb[_0x76c4('0x44')]=_['merge'](_0xe0ebcb[_0x76c4('0x44')],{'$or':_[_0x76c4('0x34')](_0xe0ebcb['attributes'],function(_0x30113c){var _0x421a78={};_0x421a78[_0x30113c]={'$like':'%'+_0x52b487[_0x76c4('0x39')][_0x76c4('0x47')]+'%'};return _0x421a78;})});}_0xe0ebcb=_[_0x76c4('0x48')]({},_0xe0ebcb,_0x52b487[_0x76c4('0x49')]);return _0x5950a6[_0x76c4('0x59')](_0xe0ebcb);}})[_0x76c4('0x1c')](function(_0x1ec51c){if(_0x1ec51c){_0x314b0e=_0x1ec51c[_0x76c4('0x3f')];if(!_0x52b487['query']['hasOwnProperty'](_0x76c4('0x41'))){_0xe0ebcb['limit']=qs[_0x76c4('0x42')](_0x52b487[_0x76c4('0x39')][_0x76c4('0x42')]);_0xe0ebcb['offset']=qs['offset'](_0x52b487[_0x76c4('0x39')][_0x76c4('0x2b')]);}return _0x5950a6[_0x76c4('0x59')](_0xe0ebcb);}})[_0x76c4('0x1c')](function(_0x49c0a3){if(_0x49c0a3){return _0x49c0a3?{'count':_0x314b0e,'rows':_0x49c0a3}:null;}})['then'](respondWithResult(_0x125c97,null))[_0x76c4('0x26')](handleError(_0x125c97,null));};exports[_0x76c4('0x5b')]=function(_0x151087,_0x231dd0,_0x3a71c2){if(_0x151087['body']['id']){delete _0x151087[_0x76c4('0x52')]['id'];}return db['DeskConfiguration'][_0x76c4('0x54')]({'where':{'id':_0x151087[_0x76c4('0x4f')]['id']}})[_0x76c4('0x1c')](handleEntityNotFound(_0x231dd0,null))['then'](function(_0x3ac986){if(_0x3ac986){return _0x3ac986[_0x76c4('0x5b')](_0x151087[_0x76c4('0x52')][_0x76c4('0x5c')]||[]);}return null;})[_0x76c4('0x1c')](respondWithResult(_0x231dd0,null))['catch'](handleError(_0x231dd0,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c0d0907..49b36df 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 _0x7391=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x175091,_0x256ec4){var _0x3787a1=function(_0x4d6826){while(--_0x4d6826){_0x175091['push'](_0x175091['shift']());}};_0x3787a1(++_0x256ec4);}(_0x7391,0x12e));var _0x1739=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x7391[_0x1b745b];return _0x120a9d;};'use strict';var _=require(_0x1739('0x0'));var util=require(_0x1739('0x1'));var logger=require(_0x1739('0x2'))('api');var moment=require(_0x1739('0x3'));var BPromise=require(_0x1739('0x4'));var rp=require(_0x1739('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1739('0x6'));var config=require(_0x1739('0x7'));var attributes=require(_0x1739('0x8'));module[_0x1739('0x9')]=function(_0x1136ad,_0x232063){return _0x1136ad['define'](_0x1739('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd14e=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','moment','bluebird'];(function(_0x2107eb,_0xbf9db5){var _0x492de2=function(_0x441fa2){while(--_0x441fa2){_0x2107eb['push'](_0x2107eb['shift']());}};_0x492de2(++_0xbf9db5);}(_0xd14e,0x75));var _0xed14=function(_0x17360e,_0x374a5a){_0x17360e=_0x17360e-0x0;var _0x54688e=_0xd14e[_0x17360e];return _0x54688e;};'use strict';var _=require(_0xed14('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xed14('0x1'));var BPromise=require(_0xed14('0x2'));var rp=require(_0xed14('0x3'));var fs=require('fs');var path=require(_0xed14('0x4'));var rimraf=require(_0xed14('0x5'));var config=require(_0xed14('0x6'));var attributes=require(_0xed14('0x7'));module[_0xed14('0x8')]=function(_0x2a699b,_0xe0cddb){return _0x2a699b[_0xed14('0x9')](_0xed14('0xa'),attributes,{'tableName':_0xed14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 543eabf..a70981e 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 _0xa62c=['request','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47114a,_0x71efc1){var _0x54e470=function(_0x1ad8e5){while(--_0x1ad8e5){_0x47114a['push'](_0x47114a['shift']());}};_0x54e470(++_0x71efc1);}(_0xa62c,0x70));var _0xca62=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0xa62c[_0x2e655a];return _0x26f13b;};'use strict';var _=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var moment=require(_0xca62('0x2'));var BPromise=require(_0xca62('0x3'));var rs=require(_0xca62('0x4'));var fs=require('fs');var Redis=require(_0xca62('0x5'));var db=require(_0xca62('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca62('0x7'))(_0xca62('0x8'));var config=require(_0xca62('0x9'));var jayson=require(_0xca62('0xa'));var client=jayson[_0xca62('0xb')][_0xca62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x310378,_0x4584ab,_0x5da9b9){return new BPromise(function(_0x2160c4,_0xd7f11b){return client[_0xca62('0xd')](_0x310378,_0x5da9b9)['then'](function(_0x29fce7){logger[_0xca62('0xe')](_0xca62('0xf'),_0x4584ab,'request\x20sent');logger[_0xca62('0x10')](_0xca62('0x11'),_0x4584ab,_0xca62('0x12'),JSON[_0xca62('0x13')](_0x29fce7));if(_0x29fce7[_0xca62('0x14')]){if(_0x29fce7[_0xca62('0x14')][_0xca62('0x15')]===0x1f4){logger[_0xca62('0x14')](_0xca62('0xf'),_0x4584ab,_0x29fce7['error'][_0xca62('0x16')]);return _0xd7f11b(_0x29fce7[_0xca62('0x14')][_0xca62('0x16')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4584ab,_0x29fce7['error'][_0xca62('0x16')]);return _0x2160c4(_0x29fce7['error'][_0xca62('0x16')]);}else{logger[_0xca62('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x4584ab,'request\x20sent');_0x2160c4(_0x29fce7[_0xca62('0x17')][_0xca62('0x16')]);}})[_0xca62('0x18')](function(_0x5512c2){logger[_0xca62('0x14')](_0xca62('0xf'),_0x4584ab,_0x5512c2);_0xd7f11b(_0x5512c2);});});} \ No newline at end of file +var _0x2083=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring'];(function(_0x51f258,_0x337b5e){var _0x4029d2=function(_0xfee394){while(--_0xfee394){_0x51f258['push'](_0x51f258['shift']());}};_0x4029d2(++_0x337b5e);}(_0x2083,0x137));var _0x3208=function(_0x1aaa57,_0x3b0b60){_0x1aaa57=_0x1aaa57-0x0;var _0x1e33ec=_0x2083[_0x1aaa57];return _0x1e33ec;};'use strict';var _=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));var moment=require('moment');var BPromise=require(_0x3208('0x2'));var rs=require(_0x3208('0x3'));var fs=require('fs');var Redis=require(_0x3208('0x4'));var db=require(_0x3208('0x5'))['db'];var utils=require(_0x3208('0x6'));var logger=require(_0x3208('0x7'))(_0x3208('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3208('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d837d,_0x3d4b9d,_0x17972f){return new BPromise(function(_0x564ff6,_0x165e5e){return client[_0x3208('0xa')](_0x3d837d,_0x17972f)[_0x3208('0xb')](function(_0x4c45f4){logger['info'](_0x3208('0xc'),_0x3d4b9d,_0x3208('0xd'));logger[_0x3208('0xe')](_0x3208('0xf'),_0x3d4b9d,'request\x20sent',JSON['stringify'](_0x4c45f4));if(_0x4c45f4[_0x3208('0x10')]){if(_0x4c45f4[_0x3208('0x10')][_0x3208('0x11')]===0x1f4){logger[_0x3208('0x10')](_0x3208('0xc'),_0x3d4b9d,_0x4c45f4[_0x3208('0x10')][_0x3208('0x12')]);return _0x165e5e(_0x4c45f4[_0x3208('0x10')][_0x3208('0x12')]);}logger[_0x3208('0x10')](_0x3208('0xc'),_0x3d4b9d,_0x4c45f4[_0x3208('0x10')][_0x3208('0x12')]);return _0x564ff6(_0x4c45f4[_0x3208('0x10')]['message']);}else{logger[_0x3208('0x13')](_0x3208('0xc'),_0x3d4b9d,_0x3208('0xd'));_0x564ff6(_0x4c45f4[_0x3208('0x14')][_0x3208('0x12')]);}})['catch'](function(_0x244d19){logger[_0x3208('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3d4b9d,_0x244d19);_0x165e5e(_0x244d19);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 941ade0..bc234d5 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 _0xce21=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xce21,0x1e3));var _0x1ce2=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0xce21[_0x1562a2];return _0x39a636;};'use strict';var multer=require(_0x1ce2('0x0'));var util=require(_0x1ce2('0x1'));var path=require(_0x1ce2('0x2'));var timeout=require(_0x1ce2('0x3'));var express=require(_0x1ce2('0x4'));var router=express[_0x1ce2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1ce2('0x6'));var config=require(_0x1ce2('0x7'));var controller=require('./intDeskField.controller');router[_0x1ce2('0x8')]('/',auth[_0x1ce2('0x9')](),controller[_0x1ce2('0xa')]);router[_0x1ce2('0x8')](_0x1ce2('0xb'),auth[_0x1ce2('0x9')](),controller[_0x1ce2('0xc')]);router[_0x1ce2('0xd')]('/',auth[_0x1ce2('0x9')](),controller[_0x1ce2('0xe')]);router[_0x1ce2('0xf')](_0x1ce2('0xb'),auth[_0x1ce2('0x9')](),controller[_0x1ce2('0x10')]);router['delete'](_0x1ce2('0xb'),auth[_0x1ce2('0x9')](),controller[_0x1ce2('0x11')]);module[_0x1ce2('0x12')]=router; \ No newline at end of file +var _0xfa02=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x3f0c41,_0x13ed17){var _0x16b224=function(_0xd9b577){while(--_0xd9b577){_0x3f0c41['push'](_0x3f0c41['shift']());}};_0x16b224(++_0x13ed17);}(_0xfa02,0xef));var _0x2fa0=function(_0x3d3acb,_0xc9fb78){_0x3d3acb=_0x3d3acb-0x0;var _0xf5aff=_0xfa02[_0x3d3acb];return _0xf5aff;};'use strict';var multer=require(_0x2fa0('0x0'));var util=require('util');var path=require(_0x2fa0('0x1'));var timeout=require('connect-timeout');var express=require(_0x2fa0('0x2'));var router=express[_0x2fa0('0x3')]();var auth=require(_0x2fa0('0x4'));var interaction=require(_0x2fa0('0x5'));var config=require(_0x2fa0('0x6'));var controller=require(_0x2fa0('0x7'));router[_0x2fa0('0x8')]('/',auth[_0x2fa0('0x9')](),controller[_0x2fa0('0xa')]);router[_0x2fa0('0x8')](_0x2fa0('0xb'),auth[_0x2fa0('0x9')](),controller[_0x2fa0('0xc')]);router[_0x2fa0('0xd')]('/',auth[_0x2fa0('0x9')](),controller[_0x2fa0('0xe')]);router['put'](_0x2fa0('0xb'),auth[_0x2fa0('0x9')](),controller[_0x2fa0('0xf')]);router[_0x2fa0('0x10')](_0x2fa0('0xb'),auth[_0x2fa0('0x9')](),controller[_0x2fa0('0x11')]);module[_0x2fa0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 1818808..862feae 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 _0x3eea=['customVariable','BOOLEAN','sequelize','ENUM','string','keyValue','STRING','variable'];(function(_0x2e5471,_0x356fa3){var _0x4b2835=function(_0x52452d){while(--_0x52452d){_0x2e5471['push'](_0x2e5471['shift']());}};_0x4b2835(++_0x356fa3);}(_0x3eea,0x1ba));var _0xa3ee=function(_0x56fca1,_0x278ff3){_0x56fca1=_0x56fca1-0x0;var _0x2df14e=_0x3eea[_0x56fca1];return _0x2df14e;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'type':{'type':Sequelize[_0xa3ee('0x1')](_0xa3ee('0x2'),'variable','customVariable',_0xa3ee('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa3ee('0x4')]},'key':{'type':Sequelize[_0xa3ee('0x4')]},'keyType':{'type':Sequelize[_0xa3ee('0x1')](_0xa3ee('0x2'),_0xa3ee('0x5'),_0xa3ee('0x6'))},'keyContent':{'type':Sequelize[_0xa3ee('0x4')]},'idField':{'type':Sequelize[_0xa3ee('0x4')]},'nameField':{'type':Sequelize[_0xa3ee('0x4')]},'customField':{'type':Sequelize[_0xa3ee('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa3ee('0x4')]}}; \ No newline at end of file +var _0x0673=['customVariable','keyValue','string','STRING','variable','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0673,0x9d));var _0x3067=function(_0x28057a,_0x577869){_0x28057a=_0x28057a-0x0;var _0x20486c=_0x0673[_0x28057a];return _0x20486c;};'use strict';var Sequelize=require(_0x3067('0x0'));module[_0x3067('0x1')]={'type':{'type':Sequelize[_0x3067('0x2')]('string','variable',_0x3067('0x3'),_0x3067('0x4')),'defaultValue':_0x3067('0x5')},'content':{'type':Sequelize[_0x3067('0x6')]},'key':{'type':Sequelize[_0x3067('0x6')]},'keyType':{'type':Sequelize[_0x3067('0x2')]('string',_0x3067('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x3067('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3067('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index bb34ecc..891dd1c 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 _0xb0b9=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2042d6,_0x3a48dd){var _0xcd5a33=function(_0x1cce98){while(--_0x1cce98){_0x2042d6['push'](_0x2042d6['shift']());}};_0xcd5a33(++_0x3a48dd);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3eeaa2,_0x508ac9){_0x3eeaa2=_0x3eeaa2-0x0;var _0x493d83=_0xb0b9[_0x3eeaa2];return _0x493d83;};'use strict';var pdf=require(_0x9b0b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b0b('0x1'));var jsonpatch=require(_0x9b0b('0x2'));var rp=require(_0x9b0b('0x3'));var moment=require(_0x9b0b('0x4'));var BPromise=require(_0x9b0b('0x5'));var Mustache=require(_0x9b0b('0x6'));var util=require(_0x9b0b('0x7'));var path=require(_0x9b0b('0x8'));var sox=require(_0x9b0b('0x9'));var csv=require(_0x9b0b('0xa'));var ejs=require(_0x9b0b('0xb'));var fs=require('fs');var _=require(_0x9b0b('0xc'));var squel=require(_0x9b0b('0xd'));var crypto=require(_0x9b0b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b0b('0xa'));var querystring=require(_0x9b0b('0xf'));var Papa=require(_0x9b0b('0x10'));var Redis=require(_0x9b0b('0x11'));var authService=require(_0x9b0b('0x12'));var qs=require(_0x9b0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b0b('0x14'));var logger=require(_0x9b0b('0x15'))(_0x9b0b('0x16'));var utils=require(_0x9b0b('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39d1f3,_0x4b3ed5){_0x4b3ed5=_0x4b3ed5||0xcc;return function(_0x283336){if(_0x283336){return _0x39d1f3['sendStatus'](_0x4b3ed5);}return _0x39d1f3[_0x9b0b('0x18')](_0x4b3ed5)[_0x9b0b('0x19')]();};}function respondWithResult(_0x5d9ffb,_0x5974af){_0x5974af=_0x5974af||0xc8;return function(_0x5f0555){if(_0x5f0555){return _0x5d9ffb[_0x9b0b('0x18')](_0x5974af)[_0x9b0b('0x1a')](_0x5f0555);}};}function respondWithFilteredResult(_0x53f97c,_0x248ff9){return function(_0x377736){if(_0x377736){var _0x297b07=_0x377736[_0x9b0b('0x1b')],_0x1e92c1=_0x248ff9[_0x9b0b('0x1c')],_0x4665d8=_0x248ff9[_0x9b0b('0x1c')]+_0x248ff9[_0x9b0b('0x1d')],_0x12f1b9;if(_0x4665d8>=_0x297b07){_0x4665d8=_0x297b07;_0x12f1b9=0xc8;}else{_0x12f1b9=0xce;}_0x53f97c[_0x9b0b('0x18')](_0x12f1b9);return _0x53f97c[_0x9b0b('0x1e')](_0x9b0b('0x1f'),_0x1e92c1+'-'+_0x4665d8+'/'+_0x297b07)[_0x9b0b('0x1a')](_0x377736);}return null;};}function patchUpdates(_0x51277a){return function(_0x155301){try{jsonpatch[_0x9b0b('0x20')](_0x155301,_0x51277a,!![]);}catch(_0x7cf37c){return BPromise['reject'](_0x7cf37c);}return _0x155301[_0x9b0b('0x21')]();};}function saveUpdates(_0x20df69,_0x4067d3){return function(_0x565d35){if(_0x565d35){return _0x565d35[_0x9b0b('0x22')](_0x20df69)[_0x9b0b('0x23')](function(_0x27b8e3){return _0x27b8e3;});}return null;};}function removeEntity(_0x16c8f9,_0x4fe0a2){return function(_0x30bfe8){if(_0x30bfe8){return _0x30bfe8[_0x9b0b('0x24')]()['then'](function(){_0x16c8f9[_0x9b0b('0x18')](0xcc)[_0x9b0b('0x19')]();});}};}function handleEntityNotFound(_0x3f433c,_0x16b413){return function(_0xbf0f87){if(!_0xbf0f87){_0x3f433c[_0x9b0b('0x25')](0x194);}return _0xbf0f87;};}function handleError(_0x17d333,_0x322a0b){_0x322a0b=_0x322a0b||0x1f4;return function(_0x1067be){logger['error'](_0x1067be[_0x9b0b('0x26')]);if(_0x1067be[_0x9b0b('0x27')]){delete _0x1067be[_0x9b0b('0x27')];}_0x17d333[_0x9b0b('0x18')](_0x322a0b)['send'](_0x1067be);};}exports[_0x9b0b('0x28')]=function(_0xb31c25,_0x5c9ec3){var _0x2841fc={},_0x1e25fb={},_0x1a31ba={'count':0x0,'rows':[]};var _0x47a135=_[_0x9b0b('0x29')](db[_0x9b0b('0x2a')][_0x9b0b('0x2b')],function(_0x5507e1){return{'name':_0x5507e1[_0x9b0b('0x2c')],'type':_0x5507e1[_0x9b0b('0x2d')][_0x9b0b('0x2e')]};});_0x1e25fb[_0x9b0b('0x2f')]=_['map'](_0x47a135,_0x9b0b('0x27'));_0x1e25fb[_0x9b0b('0x30')]=_['keys'](_0xb31c25[_0x9b0b('0x30')]);_0x1e25fb[_0x9b0b('0x31')]=_[_0x9b0b('0x32')](_0x1e25fb[_0x9b0b('0x2f')],_0x1e25fb[_0x9b0b('0x30')]);_0x2841fc[_0x9b0b('0x33')]=_[_0x9b0b('0x32')](_0x1e25fb[_0x9b0b('0x2f')],qs['fields'](_0xb31c25['query'][_0x9b0b('0x34')]));_0x2841fc['attributes']=_0x2841fc[_0x9b0b('0x33')]['length']?_0x2841fc['attributes']:_0x1e25fb['model'];if(!_0xb31c25[_0x9b0b('0x30')][_0x9b0b('0x35')](_0x9b0b('0x36'))){_0x2841fc[_0x9b0b('0x1d')]=qs[_0x9b0b('0x1d')](_0xb31c25[_0x9b0b('0x30')][_0x9b0b('0x1d')]);_0x2841fc[_0x9b0b('0x1c')]=qs[_0x9b0b('0x1c')](_0xb31c25[_0x9b0b('0x30')][_0x9b0b('0x1c')]);}_0x2841fc[_0x9b0b('0x37')]=qs[_0x9b0b('0x38')](_0xb31c25['query'][_0x9b0b('0x38')]);_0x2841fc[_0x9b0b('0x39')]=qs[_0x9b0b('0x31')](_[_0x9b0b('0x3a')](_0xb31c25[_0x9b0b('0x30')],_0x1e25fb[_0x9b0b('0x31')]));if(_0xb31c25[_0x9b0b('0x30')][_0x9b0b('0x3b')]){_0x2841fc[_0x9b0b('0x39')]=_[_0x9b0b('0x3c')](_0x2841fc[_0x9b0b('0x39')],{'$or':_[_0x9b0b('0x29')](_0x47a135,function(_0x97d73a){if(_0x97d73a['type']!=='VIRTUAL'){var _0x12a5c4={};_0x12a5c4[_0x97d73a[_0x9b0b('0x27')]]={'$like':'%'+_0xb31c25[_0x9b0b('0x30')][_0x9b0b('0x3b')]+'%'};return _0x12a5c4;}})});}_0x2841fc=_[_0x9b0b('0x3c')]({},_0x2841fc,_0xb31c25['options']);var _0x117f22={'where':_0x2841fc[_0x9b0b('0x39')]};return db[_0x9b0b('0x2a')][_0x9b0b('0x1b')](_0x117f22)['then'](function(_0x5ac75f){_0x1a31ba[_0x9b0b('0x1b')]=_0x5ac75f;if(_0xb31c25['query'][_0x9b0b('0x3d')]){_0x2841fc[_0x9b0b('0x3e')]=[{'all':!![]}];}return db[_0x9b0b('0x2a')][_0x9b0b('0x3f')](_0x2841fc);})[_0x9b0b('0x23')](function(_0xe007e9){_0x1a31ba[_0x9b0b('0x40')]=_0xe007e9;return _0x1a31ba;})[_0x9b0b('0x23')](respondWithFilteredResult(_0x5c9ec3,_0x2841fc))[_0x9b0b('0x41')](handleError(_0x5c9ec3,null));};exports[_0x9b0b('0x42')]=function(_0x1ae7f9,_0x33c539){var _0x4049ad={'raw':!![],'where':{'id':_0x1ae7f9[_0x9b0b('0x43')]['id']}},_0x2ec986={};_0x2ec986['model']=_['keys'](db['DeskField'][_0x9b0b('0x2b')]);_0x2ec986[_0x9b0b('0x30')]=_[_0x9b0b('0x44')](_0x1ae7f9[_0x9b0b('0x30')]);_0x2ec986[_0x9b0b('0x31')]=_['intersection'](_0x2ec986['model'],_0x2ec986[_0x9b0b('0x30')]);_0x4049ad[_0x9b0b('0x33')]=_[_0x9b0b('0x32')](_0x2ec986[_0x9b0b('0x2f')],qs['fields'](_0x1ae7f9[_0x9b0b('0x30')][_0x9b0b('0x34')]));_0x4049ad[_0x9b0b('0x33')]=_0x4049ad[_0x9b0b('0x33')][_0x9b0b('0x45')]?_0x4049ad['attributes']:_0x2ec986[_0x9b0b('0x2f')];if(_0x1ae7f9[_0x9b0b('0x30')][_0x9b0b('0x3d')]){_0x4049ad[_0x9b0b('0x3e')]=[{'all':!![]}];}_0x4049ad=_[_0x9b0b('0x3c')]({},_0x4049ad,_0x1ae7f9[_0x9b0b('0x46')]);return db[_0x9b0b('0x2a')][_0x9b0b('0x47')](_0x4049ad)['then'](handleEntityNotFound(_0x33c539,null))['then'](respondWithResult(_0x33c539,null))['catch'](handleError(_0x33c539,null));};exports[_0x9b0b('0x48')]=function(_0x2da2e4,_0x2d5615){return db[_0x9b0b('0x2a')][_0x9b0b('0x48')](_0x2da2e4[_0x9b0b('0x49')],{})[_0x9b0b('0x23')](respondWithResult(_0x2d5615,0xc9))[_0x9b0b('0x41')](handleError(_0x2d5615,null));};exports[_0x9b0b('0x22')]=function(_0x1f2108,_0x1c83e1){if(_0x1f2108['body']['id']){delete _0x1f2108[_0x9b0b('0x49')]['id'];}return db[_0x9b0b('0x2a')]['find']({'where':{'id':_0x1f2108['params']['id']}})[_0x9b0b('0x23')](handleEntityNotFound(_0x1c83e1,null))[_0x9b0b('0x23')](saveUpdates(_0x1f2108[_0x9b0b('0x49')],null))[_0x9b0b('0x23')](respondWithResult(_0x1c83e1,null))['catch'](handleError(_0x1c83e1,null));};exports[_0x9b0b('0x24')]=function(_0x348444,_0x3eeb0c){return db[_0x9b0b('0x2a')][_0x9b0b('0x47')]({'where':{'id':_0x348444[_0x9b0b('0x43')]['id']}})[_0x9b0b('0x23')](handleEntityNotFound(_0x3eeb0c,null))[_0x9b0b('0x23')](removeEntity(_0x3eeb0c,null))[_0x9b0b('0x41')](handleError(_0x3eeb0c,null));}; \ No newline at end of file +var _0x08d9=['../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','show','params','DeskField','find','create','catch','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x5f5d51,_0x2dd229){var _0x4b4b87=function(_0x32cdf4){while(--_0x32cdf4){_0x5f5d51['push'](_0x5f5d51['shift']());}};_0x4b4b87(++_0x2dd229);}(_0x08d9,0xc2));var _0x908d=function(_0x3df477,_0x785e2c){_0x3df477=_0x3df477-0x0;var _0x5c75e6=_0x08d9[_0x3df477];return _0x5c75e6;};'use strict';var pdf=require(_0x908d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x908d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x908d('0x2'));var rp=require(_0x908d('0x3'));var moment=require(_0x908d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x908d('0x5'));var path=require(_0x908d('0x6'));var sox=require(_0x908d('0x7'));var csv=require(_0x908d('0x8'));var ejs=require(_0x908d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x908d('0xa'));var crypto=require(_0x908d('0xb'));var jsforce=require(_0x908d('0xc'));var deskjs=require(_0x908d('0xd'));var toCsv=require(_0x908d('0x8'));var querystring=require(_0x908d('0xe'));var Papa=require(_0x908d('0xf'));var Redis=require(_0x908d('0x10'));var authService=require(_0x908d('0x11'));var qs=require(_0x908d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x908d('0x13'));var logger=require(_0x908d('0x14'))(_0x908d('0x15'));var utils=require(_0x908d('0x16'));var config=require(_0x908d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a29ae,_0x588cc3){_0x588cc3=_0x588cc3||0xcc;return function(_0x3213df){if(_0x3213df){return _0x4a29ae[_0x908d('0x18')](_0x588cc3);}return _0x4a29ae[_0x908d('0x19')](_0x588cc3)[_0x908d('0x1a')]();};}function respondWithResult(_0x2e1a77,_0x3c1149){_0x3c1149=_0x3c1149||0xc8;return function(_0x9dbb7f){if(_0x9dbb7f){return _0x2e1a77['status'](_0x3c1149)['json'](_0x9dbb7f);}};}function respondWithFilteredResult(_0x3e1c4f,_0x207ac1){return function(_0x178809){if(_0x178809){var _0x3cddfa=_0x178809[_0x908d('0x1b')],_0x5d7f40=_0x207ac1[_0x908d('0x1c')],_0x4c56f2=_0x207ac1[_0x908d('0x1c')]+_0x207ac1['limit'],_0x16895a;if(_0x4c56f2>=_0x3cddfa){_0x4c56f2=_0x3cddfa;_0x16895a=0xc8;}else{_0x16895a=0xce;}_0x3e1c4f[_0x908d('0x19')](_0x16895a);return _0x3e1c4f[_0x908d('0x1d')](_0x908d('0x1e'),_0x5d7f40+'-'+_0x4c56f2+'/'+_0x3cddfa)[_0x908d('0x1f')](_0x178809);}return null;};}function patchUpdates(_0x209ffd){return function(_0x1c3d3c){try{jsonpatch[_0x908d('0x20')](_0x1c3d3c,_0x209ffd,!![]);}catch(_0x578bed){return BPromise[_0x908d('0x21')](_0x578bed);}return _0x1c3d3c[_0x908d('0x22')]();};}function saveUpdates(_0x46dd69,_0x48ef83){return function(_0x37a7b8){if(_0x37a7b8){return _0x37a7b8[_0x908d('0x23')](_0x46dd69)[_0x908d('0x24')](function(_0x38d3d7){return _0x38d3d7;});}return null;};}function removeEntity(_0x3969d7,_0x53d9bb){return function(_0x3a06c7){if(_0x3a06c7){return _0x3a06c7['destroy']()[_0x908d('0x24')](function(){_0x3969d7[_0x908d('0x19')](0xcc)[_0x908d('0x1a')]();});}};}function handleEntityNotFound(_0x307b47,_0x43492b){return function(_0x423806){if(!_0x423806){_0x307b47[_0x908d('0x18')](0x194);}return _0x423806;};}function handleError(_0x3c68e0,_0x509105){_0x509105=_0x509105||0x1f4;return function(_0x408880){logger[_0x908d('0x25')](_0x408880[_0x908d('0x26')]);if(_0x408880[_0x908d('0x27')]){delete _0x408880[_0x908d('0x27')];}_0x3c68e0['status'](_0x509105)['send'](_0x408880);};}exports[_0x908d('0x28')]=function(_0x389559,_0x41ca76){var _0x40e8bc={},_0x35e70d={},_0x51590b={'count':0x0,'rows':[]};var _0x3c4157=_[_0x908d('0x29')](db['DeskField'][_0x908d('0x2a')],function(_0x40b418){return{'name':_0x40b418[_0x908d('0x2b')],'type':_0x40b418[_0x908d('0x2c')][_0x908d('0x2d')]};});_0x35e70d[_0x908d('0x2e')]=_[_0x908d('0x29')](_0x3c4157,_0x908d('0x27'));_0x35e70d[_0x908d('0x2f')]=_[_0x908d('0x30')](_0x389559[_0x908d('0x2f')]);_0x35e70d['filters']=_[_0x908d('0x31')](_0x35e70d[_0x908d('0x2e')],_0x35e70d[_0x908d('0x2f')]);_0x40e8bc[_0x908d('0x32')]=_['intersection'](_0x35e70d[_0x908d('0x2e')],qs[_0x908d('0x33')](_0x389559[_0x908d('0x2f')][_0x908d('0x33')]));_0x40e8bc[_0x908d('0x32')]=_0x40e8bc[_0x908d('0x32')][_0x908d('0x34')]?_0x40e8bc[_0x908d('0x32')]:_0x35e70d[_0x908d('0x2e')];if(!_0x389559[_0x908d('0x2f')][_0x908d('0x35')]('nolimit')){_0x40e8bc['limit']=qs[_0x908d('0x36')](_0x389559[_0x908d('0x2f')]['limit']);_0x40e8bc['offset']=qs[_0x908d('0x1c')](_0x389559[_0x908d('0x2f')][_0x908d('0x1c')]);}_0x40e8bc[_0x908d('0x37')]=qs[_0x908d('0x38')](_0x389559['query'][_0x908d('0x38')]);_0x40e8bc[_0x908d('0x39')]=qs[_0x908d('0x3a')](_[_0x908d('0x3b')](_0x389559[_0x908d('0x2f')],_0x35e70d['filters']));if(_0x389559['query'][_0x908d('0x3c')]){_0x40e8bc['where']=_[_0x908d('0x3d')](_0x40e8bc[_0x908d('0x39')],{'$or':_[_0x908d('0x29')](_0x3c4157,function(_0x302897){if(_0x302897[_0x908d('0x2c')]!==_0x908d('0x3e')){var _0x1ddfbf={};_0x1ddfbf[_0x302897[_0x908d('0x27')]]={'$like':'%'+_0x389559['query']['filter']+'%'};return _0x1ddfbf;}})});}_0x40e8bc=_[_0x908d('0x3d')]({},_0x40e8bc,_0x389559[_0x908d('0x3f')]);var _0x297366={'where':_0x40e8bc['where']};return db['DeskField']['count'](_0x297366)[_0x908d('0x24')](function(_0x54982f){_0x51590b[_0x908d('0x1b')]=_0x54982f;if(_0x389559[_0x908d('0x2f')][_0x908d('0x40')]){_0x40e8bc['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x40e8bc);})[_0x908d('0x24')](function(_0x136115){_0x51590b['rows']=_0x136115;return _0x51590b;})[_0x908d('0x24')](respondWithFilteredResult(_0x41ca76,_0x40e8bc))['catch'](handleError(_0x41ca76,null));};exports[_0x908d('0x41')]=function(_0x13b5d7,_0x1dd43f){var _0x5bf839={'raw':!![],'where':{'id':_0x13b5d7[_0x908d('0x42')]['id']}},_0x24dc93={};_0x24dc93[_0x908d('0x2e')]=_[_0x908d('0x30')](db['DeskField'][_0x908d('0x2a')]);_0x24dc93[_0x908d('0x2f')]=_[_0x908d('0x30')](_0x13b5d7[_0x908d('0x2f')]);_0x24dc93[_0x908d('0x3a')]=_['intersection'](_0x24dc93[_0x908d('0x2e')],_0x24dc93[_0x908d('0x2f')]);_0x5bf839[_0x908d('0x32')]=_[_0x908d('0x31')](_0x24dc93[_0x908d('0x2e')],qs[_0x908d('0x33')](_0x13b5d7['query']['fields']));_0x5bf839[_0x908d('0x32')]=_0x5bf839['attributes'][_0x908d('0x34')]?_0x5bf839[_0x908d('0x32')]:_0x24dc93['model'];if(_0x13b5d7[_0x908d('0x2f')][_0x908d('0x40')]){_0x5bf839['include']=[{'all':!![]}];}_0x5bf839=_[_0x908d('0x3d')]({},_0x5bf839,_0x13b5d7[_0x908d('0x3f')]);return db[_0x908d('0x43')][_0x908d('0x44')](_0x5bf839)['then'](handleEntityNotFound(_0x1dd43f,null))[_0x908d('0x24')](respondWithResult(_0x1dd43f,null))['catch'](handleError(_0x1dd43f,null));};exports[_0x908d('0x45')]=function(_0x2fe8a4,_0x500247){return db[_0x908d('0x43')]['create'](_0x2fe8a4['body'],{})[_0x908d('0x24')](respondWithResult(_0x500247,0xc9))[_0x908d('0x46')](handleError(_0x500247,null));};exports[_0x908d('0x23')]=function(_0x3cffc4,_0x4e498c){if(_0x3cffc4['body']['id']){delete _0x3cffc4['body']['id'];}return db[_0x908d('0x43')][_0x908d('0x44')]({'where':{'id':_0x3cffc4[_0x908d('0x42')]['id']}})[_0x908d('0x24')](handleEntityNotFound(_0x4e498c,null))[_0x908d('0x24')](saveUpdates(_0x3cffc4[_0x908d('0x47')],null))[_0x908d('0x24')](respondWithResult(_0x4e498c,null))[_0x908d('0x46')](handleError(_0x4e498c,null));};exports['destroy']=function(_0x2c7ba3,_0x5c4105){return db[_0x908d('0x43')][_0x908d('0x44')]({'where':{'id':_0x2c7ba3[_0x908d('0x42')]['id']}})[_0x908d('0x24')](handleEntityNotFound(_0x5c4105,null))['then'](removeEntity(_0x5c4105,null))['catch'](handleError(_0x5c4105,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 2dd22fb..c37b845 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 _0x28c5=['FieldId','util','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x28c5,0x12d));var _0x528c=function(_0xaa20f0,_0x46d342){_0xaa20f0=_0xaa20f0-0x0;var _0xc2bb46=_0x28c5[_0xaa20f0];return _0xc2bb46;};'use strict';var _=require('lodash');var util=require(_0x528c('0x0'));var logger=require('../../config/logger')(_0x528c('0x1'));var moment=require(_0x528c('0x2'));var BPromise=require(_0x528c('0x3'));var rp=require(_0x528c('0x4'));var fs=require('fs');var path=require(_0x528c('0x5'));var rimraf=require(_0x528c('0x6'));var config=require('../../config/environment');var attributes=require(_0x528c('0x7'));module[_0x528c('0x8')]=function(_0x3f2f5b,_0x2dab33){return _0x3f2f5b[_0x528c('0x9')](_0x528c('0xa'),attributes,{'tableName':_0x528c('0xb'),'paranoid':![],'indexes':[{'name':_0x528c('0xc'),'fields':[_0x528c('0xd'),_0x528c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x76a5=['DeskField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x19f519,_0x238183){var _0x2c8406=function(_0x37d253){while(--_0x37d253){_0x19f519['push'](_0x19f519['shift']());}};_0x2c8406(++_0x238183);}(_0x76a5,0xf2));var _0x576a=function(_0x2d2d37,_0x5778a6){_0x2d2d37=_0x2d2d37-0x0;var _0x55bbce=_0x76a5[_0x2d2d37];return _0x55bbce;};'use strict';var _=require('lodash');var util=require(_0x576a('0x0'));var logger=require(_0x576a('0x1'))(_0x576a('0x2'));var moment=require(_0x576a('0x3'));var BPromise=require(_0x576a('0x4'));var rp=require(_0x576a('0x5'));var fs=require('fs');var path=require(_0x576a('0x6'));var rimraf=require(_0x576a('0x7'));var config=require(_0x576a('0x8'));var attributes=require('./intDeskField.attributes');module[_0x576a('0x9')]=function(_0x4ce43f,_0xb4917f){return _0x4ce43f['define'](_0x576a('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x576a('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 1980a1e..b174113 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 _0x763c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x763c,0xbb));var _0xc763=function(_0x390c56,_0x313393){_0x390c56=_0x390c56-0x0;var _0x280691=_0x763c[_0x390c56];return _0x280691;};'use strict';var _=require('lodash');var util=require(_0xc763('0x0'));var moment=require(_0xc763('0x1'));var BPromise=require(_0xc763('0x2'));var rs=require(_0xc763('0x3'));var fs=require('fs');var Redis=require(_0xc763('0x4'));var db=require(_0xc763('0x5'))['db'];var utils=require(_0xc763('0x6'));var logger=require(_0xc763('0x7'))(_0xc763('0x8'));var config=require('../../config/environment');var jayson=require(_0xc763('0x9'));var client=jayson[_0xc763('0xa')][_0xc763('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x329595,_0x35aa7f,_0x4459f2){return new BPromise(function(_0x2810b4,_0x8e82fd){return client[_0xc763('0xc')](_0x329595,_0x4459f2)[_0xc763('0xd')](function(_0xe5dac9){logger[_0xc763('0xe')](_0xc763('0xf'),_0x35aa7f,'request\x20sent');logger[_0xc763('0x10')](_0xc763('0x11'),_0x35aa7f,'request\x20sent',JSON[_0xc763('0x12')](_0xe5dac9));if(_0xe5dac9['error']){if(_0xe5dac9['error'][_0xc763('0x13')]===0x1f4){logger['error'](_0xc763('0xf'),_0x35aa7f,_0xe5dac9[_0xc763('0x14')][_0xc763('0x15')]);return _0x8e82fd(_0xe5dac9[_0xc763('0x14')][_0xc763('0x15')]);}logger[_0xc763('0x14')]('DeskField,\x20%s,\x20%s',_0x35aa7f,_0xe5dac9[_0xc763('0x14')][_0xc763('0x15')]);return _0x2810b4(_0xe5dac9[_0xc763('0x14')]['message']);}else{logger[_0xc763('0xe')]('DeskField,\x20%s,\x20%s',_0x35aa7f,_0xc763('0x16'));_0x2810b4(_0xe5dac9[_0xc763('0x17')]['message']);}})['catch'](function(_0x195bed){logger['error']('DeskField,\x20%s,\x20%s',_0x35aa7f,_0x195bed);_0x8e82fd(_0x195bed);});});} \ No newline at end of file +var _0x7fb3=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x54ff,_0x3487a8){var _0x4b1789=function(_0x1d0506){while(--_0x1d0506){_0x54ff['push'](_0x54ff['shift']());}};_0x4b1789(++_0x3487a8);}(_0x7fb3,0xa5));var _0x37fb=function(_0x4ccbe2,_0x11eacf){_0x4ccbe2=_0x4ccbe2-0x0;var _0x134525=_0x7fb3[_0x4ccbe2];return _0x134525;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x37fb('0x2'));var fs=require('fs');var Redis=require(_0x37fb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x37fb('0x4'));var logger=require(_0x37fb('0x5'))(_0x37fb('0x6'));var config=require(_0x37fb('0x7'));var jayson=require(_0x37fb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6e08c2,_0x32186f,_0x280642){return new BPromise(function(_0x54a448,_0x528c40){return client[_0x37fb('0x9')](_0x6e08c2,_0x280642)[_0x37fb('0xa')](function(_0xabaa98){logger[_0x37fb('0xb')]('DeskField,\x20%s,\x20%s',_0x32186f,'request\x20sent');logger[_0x37fb('0xc')](_0x37fb('0xd'),_0x32186f,_0x37fb('0xe'),JSON['stringify'](_0xabaa98));if(_0xabaa98[_0x37fb('0xf')]){if(_0xabaa98[_0x37fb('0xf')][_0x37fb('0x10')]===0x1f4){logger['error'](_0x37fb('0x11'),_0x32186f,_0xabaa98[_0x37fb('0xf')][_0x37fb('0x12')]);return _0x528c40(_0xabaa98['error']['message']);}logger[_0x37fb('0xf')](_0x37fb('0x11'),_0x32186f,_0xabaa98['error'][_0x37fb('0x12')]);return _0x54a448(_0xabaa98[_0x37fb('0xf')][_0x37fb('0x12')]);}else{logger[_0x37fb('0xb')](_0x37fb('0x11'),_0x32186f,_0x37fb('0xe'));_0x54a448(_0xabaa98[_0x37fb('0x13')][_0x37fb('0x12')]);}})[_0x37fb('0x14')](function(_0x4c71b7){logger[_0x37fb('0xf')](_0x37fb('0x11'),_0x32186f,_0x4c71b7);_0x528c40(_0x4c71b7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c5ddaff..4ef89aa 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 _0x774a=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x774a,0x89));var _0xa774=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x774a[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xa774('0x0'));var util=require(_0xa774('0x1'));var path=require(_0xa774('0x2'));var timeout=require(_0xa774('0x3'));var express=require(_0xa774('0x4'));var router=express[_0xa774('0x5')]();var auth=require(_0xa774('0x6'));var interaction=require(_0xa774('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xa774('0x8')]('/',auth[_0xa774('0x9')](),controller[_0xa774('0xa')]);router[_0xa774('0x8')](_0xa774('0xb'),auth['isAuthenticated'](),controller[_0xa774('0xc')]);router['get'](_0xa774('0xd'),auth[_0xa774('0x9')](),controller[_0xa774('0xe')]);router['get'](_0xa774('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xa774('0x10')]('/',auth['isAuthenticated'](),controller[_0xa774('0x11')]);router[_0xa774('0x10')]('/:id/configurations',auth[_0xa774('0x9')](),controller[_0xa774('0x12')]);router[_0xa774('0x13')]('/:id',auth[_0xa774('0x9')](),controller[_0xa774('0x14')]);router[_0xa774('0x15')](_0xa774('0xb'),auth[_0xa774('0x9')](),controller[_0xa774('0x16')]);module[_0xa774('0x17')]=router; \ No newline at end of file +var _0x2a5a=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x2a5a,0x9b));var _0xa2a5=function(_0x2730a2,_0x4ff147){_0x2730a2=_0x2730a2-0x0;var _0x119917=_0x2a5a[_0x2730a2];return _0x119917;};'use strict';var multer=require(_0xa2a5('0x0'));var util=require('util');var path=require(_0xa2a5('0x1'));var timeout=require(_0xa2a5('0x2'));var express=require(_0xa2a5('0x3'));var router=express[_0xa2a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa2a5('0x5'));var config=require('../../config/environment');var controller=require(_0xa2a5('0x6'));router[_0xa2a5('0x7')]('/',auth[_0xa2a5('0x8')](),controller[_0xa2a5('0x9')]);router[_0xa2a5('0x7')](_0xa2a5('0xa'),auth['isAuthenticated'](),controller[_0xa2a5('0xb')]);router[_0xa2a5('0x7')](_0xa2a5('0xc'),auth[_0xa2a5('0x8')](),controller[_0xa2a5('0xd')]);router['get'](_0xa2a5('0xe'),auth['isAuthenticated'](),controller[_0xa2a5('0xf')]);router['post']('/',auth[_0xa2a5('0x8')](),controller[_0xa2a5('0x10')]);router[_0xa2a5('0x11')](_0xa2a5('0xc'),auth[_0xa2a5('0x8')](),controller[_0xa2a5('0x12')]);router[_0xa2a5('0x13')](_0xa2a5('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xa2a5('0x14')](_0xa2a5('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xa2a5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a6f8938..7c68bc4 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 _0x2f56=['exports','STRING','sequelize'];(function(_0x274b96,_0x1e8bd9){var _0x2601a1=function(_0x192283){while(--_0x192283){_0x274b96['push'](_0x274b96['shift']());}};_0x2601a1(++_0x1e8bd9);}(_0x2f56,0x119));var _0x62f5=function(_0x3e25a1,_0x1ffe27){_0x3e25a1=_0x3e25a1-0x0;var _0xf6cca4=_0x2f56[_0x3e25a1];return _0xf6cca4;};'use strict';var Sequelize=require(_0x62f5('0x0'));module[_0x62f5('0x1')]={'name':{'type':Sequelize[_0x62f5('0x2')]},'username':{'type':Sequelize[_0x62f5('0x2')]},'password':{'type':Sequelize[_0x62f5('0x2')]},'remoteUri':{'type':Sequelize[_0x62f5('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x62f5('0x2')]},'clientSecret':{'type':Sequelize[_0x62f5('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2dc9=['exports','STRING'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2dc9,0x11c));var _0x92dc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2dc9[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x92dc('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x92dc('0x1')]},'password':{'type':Sequelize[_0x92dc('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x92dc('0x1')]},'clientId':{'type':Sequelize[_0x92dc('0x1')]},'clientSecret':{'type':Sequelize[_0x92dc('0x1')]},'serverUrl':{'type':Sequelize[_0x92dc('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c585946..d3ffb38 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 _0x7a54=['clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','tenantId','/oauth2/token','Bearer\x20','4.0','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','set','Content-Range','apply','destroy','sendStatus','name','index','map','Dynamics365Account','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','update','Dynamics365Configuration','getConfigurations','addConfiguration','findOne','AccountId','channel','type','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri'];(function(_0x143246,_0x5e6367){var _0xa79c3=function(_0x5c298e){while(--_0x5c298e){_0x143246['push'](_0x143246['shift']());}};_0xa79c3(++_0x5e6367);}(_0x7a54,0x106));var _0x47a5=function(_0x199f3f,_0x2d2ab2){_0x199f3f=_0x199f3f-0x0;var _0x23bdf3=_0x7a54[_0x199f3f];return _0x23bdf3;};'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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];var integrations=require(_0x47a5('0x15'));var jayson=require(_0x47a5('0x16'));var client=jayson[_0x47a5('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x44bd3e,_0x221b54,_0x1cf309){if(_0x1cf309){var _0x711793=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x711793[_0x47a5('0x18')](_0x221b54)){return _0x44bd3e;}else{throw new db[(_0x47a5('0x19'))][(_0x47a5('0x1a'))](_0x47a5('0x1b'));}}else{return _0x44bd3e;}}function respondWithRpcPromise(_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return new BPromise(function(_0x2a2cbb,_0x1ef44c){var _0x574af6=_0x3b001e||client;return _0x574af6['request'](_0x4e99a8,_0x11faf5)[_0x47a5('0x1c')](function(_0x4b966e){logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));logger[_0x47a5('0x1f')](_0x47a5('0x20'),_0x362359,_0x47a5('0x1e'),JSON[_0x47a5('0x21')](_0x4b966e));if(_0x4b966e[_0x47a5('0x22')]){if(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x23')]===0x1f4){logger['error'](_0x47a5('0x1d'),_0x362359,_0x4b966e[_0x47a5('0x22')]['message']);return _0x1ef44c(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}logger[_0x47a5('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x362359,_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);return _0x2a2cbb(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}else{logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));_0x2a2cbb(_0x4b966e['result'][_0x47a5('0x24')]);}})[_0x47a5('0x25')](function(_0x4437f1){logger[_0x47a5('0x22')](_0x47a5('0x1d'),_0x362359,_0x4437f1);_0x1ef44c(_0x4437f1);});});}function respondWithStatusCode(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xcc;return function(_0x136745){if(_0x136745){return _0x50bf17['sendStatus'](_0x53078a);}return _0x50bf17[_0x47a5('0x26')](_0x53078a)['end']();};}function respondWithResult(_0x23cb77,_0x378208){_0x378208=_0x378208||0xc8;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x26')](_0x378208)[_0x47a5('0x27')](_0x36ad34);}};}function respondWithFilteredResult(_0x3ba0b7,_0x24b162){return function(_0x136b14){if(_0x136b14){var _0x16631f=_0x136b14[_0x47a5('0x28')],_0x361bfa=_0x24b162['offset'],_0x1127f8=_0x24b162[_0x47a5('0x29')]+_0x24b162['limit'],_0x11a4fa;if(_0x1127f8>=_0x16631f){_0x1127f8=_0x16631f;_0x11a4fa=0xc8;}else{_0x11a4fa=0xce;}_0x3ba0b7[_0x47a5('0x26')](_0x11a4fa);return _0x3ba0b7[_0x47a5('0x2a')](_0x47a5('0x2b'),_0x361bfa+'-'+_0x1127f8+'/'+_0x16631f)['json'](_0x136b14);}return null;};}function patchUpdates(_0x256650){return function(_0x625952){try{jsonpatch[_0x47a5('0x2c')](_0x625952,_0x256650,!![]);}catch(_0x1f1c68){return BPromise['reject'](_0x1f1c68);}return _0x625952['save']();};}function saveUpdates(_0x6f9a12,_0xfb5ddb){return function(_0x5bd7eb){if(_0x5bd7eb){return _0x5bd7eb['update'](_0x6f9a12)[_0x47a5('0x1c')](function(_0x51544e){return _0x51544e;});}return null;};}function removeEntity(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x2d')]()[_0x47a5('0x1c')](function(){_0x57bff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34,_0x5910bb){return function(_0x403028){if(!_0x403028){_0x274e34[_0x47a5('0x2e')](0x194);}return _0x403028;};}function handleError(_0xf269a8,_0x52749b){_0x52749b=_0x52749b||0x1f4;return function(_0x18f7e9){logger['error'](_0x18f7e9['stack']);if(_0x18f7e9[_0x47a5('0x2f')]){delete _0x18f7e9['name'];}_0xf269a8[_0x47a5('0x26')](_0x52749b)['send'](_0x18f7e9);};}exports[_0x47a5('0x30')]=function(_0x3534cb,_0x38c8d4){var _0x199698={},_0x36add5={},_0xed6320={'count':0x0,'rows':[]};var _0xee582c=_[_0x47a5('0x31')](db[_0x47a5('0x32')]['rawAttributes'],function(_0x396a9a){return{'name':_0x396a9a[_0x47a5('0x33')],'type':_0x396a9a['type'][_0x47a5('0x34')]};});_0x36add5[_0x47a5('0x35')]=_[_0x47a5('0x31')](_0xee582c,'name');_0x36add5[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x3534cb['query']);_0x36add5[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x36add5['model'],_0x36add5['query']);_0x199698['attributes']=_[_0x47a5('0x39')](_0x36add5['model'],qs[_0x47a5('0x3a')](_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3a')]));_0x199698[_0x47a5('0x3b')]=_0x199698[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x199698[_0x47a5('0x3b')]:_0x36add5[_0x47a5('0x35')];if(!_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x199698[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x3534cb['query'][_0x47a5('0x3f')]);_0x199698[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x3534cb[_0x47a5('0x36')]['offset']);}_0x199698[_0x47a5('0x40')]=qs['sort'](_0x3534cb['query']['sort']);_0x199698['where']=qs[_0x47a5('0x38')](_['pick'](_0x3534cb[_0x47a5('0x36')],_0x36add5[_0x47a5('0x38')]));if(_0x3534cb[_0x47a5('0x36')]['filter']){_0x199698[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x199698['where'],{'$or':_['map'](_0xee582c,function(_0xbe21d9){if(_0xbe21d9['type']!==_0x47a5('0x43')){var _0x4703b2={};_0x4703b2[_0xbe21d9[_0x47a5('0x2f')]]={'$like':'%'+_0x3534cb[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x4703b2;}})});}_0x199698=_[_0x47a5('0x42')]({},_0x199698,_0x3534cb[_0x47a5('0x45')]);var _0x17cc42={'where':_0x199698[_0x47a5('0x41')]};return db[_0x47a5('0x32')][_0x47a5('0x28')](_0x17cc42)[_0x47a5('0x1c')](function(_0xe28d76){_0xed6320[_0x47a5('0x28')]=_0xe28d76;if(_0x3534cb[_0x47a5('0x36')][_0x47a5('0x46')]){_0x199698['include']=[{'all':!![]}];}return db[_0x47a5('0x32')][_0x47a5('0x47')](_0x199698);})['then'](function(_0x52b3a8){_0xed6320[_0x47a5('0x48')]=_0x52b3a8;return _0xed6320;})['then'](respondWithFilteredResult(_0x38c8d4,_0x199698))[_0x47a5('0x25')](handleError(_0x38c8d4,null));};exports[_0x47a5('0x49')]=function(_0x54c35f,_0x4f62d3){var _0x3d85cc={'raw':![],'where':{'id':_0x54c35f[_0x47a5('0x4a')]['id']}},_0x52d409={};_0x52d409[_0x47a5('0x35')]=_[_0x47a5('0x37')](db[_0x47a5('0x32')][_0x47a5('0x4b')]);_0x52d409[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x54c35f['query']);_0x52d409['filters']=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],_0x52d409[_0x47a5('0x36')]);_0x3d85cc[_0x47a5('0x3b')]=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x54c35f['query'][_0x47a5('0x3a')]));_0x3d85cc[_0x47a5('0x3b')]=_0x3d85cc[_0x47a5('0x3b')]['length']?_0x3d85cc[_0x47a5('0x3b')]:_0x52d409['model'];if(_0x54c35f[_0x47a5('0x36')][_0x47a5('0x46')]){_0x3d85cc[_0x47a5('0x4c')]=[{'all':!![]}];}_0x3d85cc=_[_0x47a5('0x42')]({},_0x3d85cc,_0x54c35f['options']);return db[_0x47a5('0x32')][_0x47a5('0x4d')](_0x3d85cc)[_0x47a5('0x1c')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x1c')](respondWithResult(_0x4f62d3,null))[_0x47a5('0x25')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x4e')]=function(_0x24e9f4,_0x481089){return db[_0x47a5('0x32')][_0x47a5('0x4e')](_0x24e9f4[_0x47a5('0x4f')],{})[_0x47a5('0x1c')](respondWithResult(_0x481089,0xc9))[_0x47a5('0x25')](handleError(_0x481089,null));};exports[_0x47a5('0x50')]=function(_0x572233,_0x1ad6a9){if(_0x572233[_0x47a5('0x4f')]['id']){delete _0x572233[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x572233[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x1ad6a9,null))['then'](saveUpdates(_0x572233['body'],null))[_0x47a5('0x1c')](respondWithResult(_0x1ad6a9,null))[_0x47a5('0x25')](handleError(_0x1ad6a9,null));};exports['destroy']=function(_0x4cf792,_0x6d6b2b){return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x4cf792['params']['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x1c')](removeEntity(_0x6d6b2b,null))[_0x47a5('0x25')](handleError(_0x6d6b2b,null));};exports['getConfigurations']=function(_0x1b958b,_0x72fe,_0x4b706a){var _0x5b6127={};var _0x16b4fd={};var _0x30d482;var _0x867da0;return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x1b958b[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x72fe,null))[_0x47a5('0x1c')](function(_0x5a33b8){if(_0x5a33b8){_0x30d482=_0x5a33b8;_0x16b4fd[_0x47a5('0x35')]=_['keys'](db[_0x47a5('0x51')][_0x47a5('0x4b')]);_0x16b4fd[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x1b958b[_0x47a5('0x36')]);_0x16b4fd['filters']=_[_0x47a5('0x39')](_0x16b4fd['model'],_0x16b4fd['query']);_0x5b6127['attributes']=_['intersection'](_0x16b4fd[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x1b958b[_0x47a5('0x36')]['fields']));_0x5b6127['attributes']=_0x5b6127[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x5b6127[_0x47a5('0x3b')]:_0x16b4fd[_0x47a5('0x35')];_0x5b6127[_0x47a5('0x40')]=qs['sort'](_0x1b958b[_0x47a5('0x36')]['sort']);_0x5b6127[_0x47a5('0x41')]=qs[_0x47a5('0x38')](_['pick'](_0x1b958b[_0x47a5('0x36')],_0x16b4fd[_0x47a5('0x38')]));if(_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]){_0x5b6127[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x5b6127[_0x47a5('0x41')],{'$or':_[_0x47a5('0x31')](_0x5b6127['attributes'],function(_0x2dcc3b){var _0x2a3a57={};_0x2a3a57[_0x2dcc3b]={'$like':'%'+_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x2a3a57;})});}_0x5b6127=_[_0x47a5('0x42')]({},_0x5b6127,_0x1b958b['options']);return _0x30d482[_0x47a5('0x52')](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x1224bc){if(_0x1224bc){_0x867da0=_0x1224bc[_0x47a5('0x3c')];if(!_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x5b6127[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3f')]);_0x5b6127[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x29')]);}return _0x30d482['getConfigurations'](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x284fb8){if(_0x284fb8){return _0x284fb8?{'count':_0x867da0,'rows':_0x284fb8}:null;}})[_0x47a5('0x1c')](respondWithResult(_0x72fe,null))['catch'](handleError(_0x72fe,null));};exports[_0x47a5('0x53')]=function(_0x2e46af,_0x36c67,_0x26f1ac){if(_0x2e46af['body']['id']){delete _0x2e46af[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x54')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x7c1190){if(_0x7c1190){_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x55')]=_0x7c1190['id'];_0x2e46af['body']['Subjects']=integrations['getSubjects'](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);_0x2e46af['body'][_0x47a5('0x58')]=integrations[_0x47a5('0x59')](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);return db[_0x47a5('0x51')][_0x47a5('0x4e')](_0x2e46af[_0x47a5('0x4f')],{'include':[{'model':db[_0x47a5('0x5a')],'as':_0x47a5('0x5b')},{'model':db[_0x47a5('0x5a')],'as':'Descriptions'}]});}return null;})[_0x47a5('0x1c')](respondWithResult(_0x36c67,null))['catch'](handleError(_0x36c67,null));};exports[_0x47a5('0x5c')]=function(_0x2ac30f,_0x281e5f,_0x12fec9){var _0x40e584=_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x5d')];var _0x448981=_0x40e584===_0x47a5('0x5e')?_0x47a5('0x5f'):_0x47a5('0x60');var _0x1f07ac='';var _0x8f0035='';var _0x2d434c='';var _0x441d64='';var _0x4de126='';var _0x48eb77='';var _0x5ccc89='';var _0x4d09a4='';var _0x490e28=[_0x47a5('0x61'),'description',_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),_0x47a5('0x65'),_0x47a5('0x66'),_0x47a5('0x67'),_0x47a5('0x68'),_0x47a5('0x69')];var _0x2e9a96=[_0x47a5('0x6a'),_0x47a5('0x6b'),'actualserviceunits',_0x47a5('0x6c'),_0x47a5('0x6d'),_0x47a5('0x6e'),'contractdetailidname',_0x47a5('0x6f'),_0x47a5('0x70'),_0x47a5('0x71'),'createdbyname',_0x47a5('0x72'),'createdon','createdonbehalfbyname',_0x47a5('0x73'),_0x47a5('0x74'),_0x47a5('0x75'),_0x47a5('0x76'),_0x47a5('0x77'),_0x47a5('0x78'),'entityimage_timestamp','entityimage_url',_0x47a5('0x79'),'exchangerate',_0x47a5('0x7a'),_0x47a5('0x7b'),_0x47a5('0x7c'),_0x47a5('0x7d'),'kbarticleidname',_0x47a5('0x7e'),'masteridname','modifiedbyexternalpartyname',_0x47a5('0x7f'),_0x47a5('0x80'),'modifiedbyyominame',_0x47a5('0x81'),_0x47a5('0x82'),_0x47a5('0x83'),'msdyn_incidenttypename',_0x47a5('0x84'),'numberofchildincidents',_0x47a5('0x85'),_0x47a5('0x86'),_0x47a5('0x87'),'owneridtype',_0x47a5('0x88'),_0x47a5('0x89'),_0x47a5('0x8a'),'primarycontactidyominame',_0x47a5('0x8b'),'productidname',_0x47a5('0x8c'),'resolveby',_0x47a5('0x8d'),_0x47a5('0x8e'),_0x47a5('0x8f'),_0x47a5('0x90'),'sentimentvalue',_0x47a5('0x91'),_0x47a5('0x92'),_0x47a5('0x93'),_0x47a5('0x94'),_0x47a5('0x95'),'subjectidname','ticketnumber',_0x47a5('0x96'),'transactioncurrencyidname',_0x47a5('0x97'),_0x47a5('0x98'),_0x47a5('0x99')];var _0x5018e9=_0x490e28[_0x47a5('0x9a')](_0x2e9a96);return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x2ac30f[_0x47a5('0x4a')]['id']},'attributes':['id',_0x47a5('0x9b'),_0x47a5('0x9c'),_0x47a5('0x9d'),'tenantId','clientId',_0x47a5('0x9e')]})[_0x47a5('0x1c')](handleEntityNotFound(_0x281e5f,null))['then'](function(_0x27d422){if(_0x27d422){_0x4d09a4=_0x27d422[_0x47a5('0x9d')];var _0x5a0901=_0x4d09a4[_0x47a5('0x9f')](-0x1);if(_0x5a0901==='/'){_0x4d09a4=_0x4d09a4[_0x47a5('0xa0')](0x0,_0x4d09a4[_0x47a5('0xa1')](_0x5a0901));}_0x5ccc89=util['format'](_0x47a5('0xa2'),_0x4d09a4);var _0x59b4a5={'method':_0x47a5('0xa3'),'uri':'https://login.microsoftonline.com/'+_0x27d422[_0x47a5('0xa4')]+_0x47a5('0xa5'),'form':{'client_id':_0x27d422['clientId'],'resource':_0x4d09a4,'username':_0x27d422[_0x47a5('0x9b')],'password':_0x27d422['password'],'grant_type':_0x47a5('0x9c'),'client_secret':_0x27d422[_0x47a5('0x9e')]},'json':!![]};return rp(_0x59b4a5);}})[_0x47a5('0x1c')](function(_0x2be771){_0x48eb77=_0x2be771['access_token'];var _0x3eb5c1={'method':'GET','uri':encodeURI(_0x5ccc89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x448981+'\x27'),'headers':{'Authorization':_0x47a5('0xa6')+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3eb5c1);})[_0x47a5('0x1c')](function(_0x96fb22){var _0x380c8b=_0x96fb22['value'][0x0];var _0x1522a6=_0x380c8b[_0x47a5('0xa8')];var _0x241e1d={'method':_0x47a5('0xa9'),'uri':_0x5ccc89+'EntityDefinitions('+_0x1522a6+_0x47a5('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x241e1d);})[_0x47a5('0x1c')](function(_0x3f93f0){_0x1f07ac=_0x3f93f0;_0x8f0035=_0x1f07ac[_0x47a5('0xab')];_0x8f0035=_[_0x47a5('0xac')](_0x8f0035,function(_0x3ec264){return!_0x5018e9[_0x47a5('0xad')](_0x3ec264[_0x47a5('0xae')]);});var _0x11eaf7=[];var _0x583746=[];_0x8f0035[_0x47a5('0xaf')](function(_0x18f8b2){if(_0x18f8b2['@odata.type']){var _0x2fd46f=_0x18f8b2[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x18f8b2['@odata.type']['lastIndexOf']('.')+0x1);if(_0x2fd46f===_0x47a5('0xb1')){_0x11eaf7[_0x47a5('0xb2')](getSelectList(_0x5ccc89,_0x40e584,_0x583746,_0x1f07ac['MetadataId'],_0x18f8b2['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x11eaf7);})[_0x47a5('0x1c')](function(_0x54eab1){_0x2d434c=_0x54eab1[0x0];var _0x29e384=[];var _0x269ff6=[];_0x8f0035['forEach'](function(_0x16097e){if(!_[_0x47a5('0xb4')](_0x16097e[_0x47a5('0xb0')])){var _0x70c8a6=_0x16097e[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x16097e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x70c8a6==='BooleanAttributeMetadata'){_0x29e384[_0x47a5('0xb2')](getBooleanList(_0x5ccc89,_0x40e584,_0x269ff6,_0x1f07ac[_0x47a5('0xa8')],_0x16097e['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x29e384);})[_0x47a5('0x1c')](function(_0x32ca1c){_0x441d64=_0x32ca1c[0x0];var _0x1752ce=[];var _0xcdbfd7=[];_0x8f0035['forEach'](function(_0x3e7750){if(_0x3e7750['@odata.type']){var _0x4eb534=_0x3e7750['@odata.type'][_0x47a5('0xa0')](_0x3e7750['@odata.type'][_0x47a5('0xa1')]('.')+0x1);if(_0x4eb534===_0x47a5('0xb5')||_0x4eb534===_0x47a5('0xb6')||_0x4eb534==='BigIntAttributeMetadata'||_0x4eb534===_0x47a5('0xb7')||_0x4eb534===_0x47a5('0xb8')||_0x4eb534===_0x47a5('0xb9')||_0x4eb534===_0x47a5('0xba')||_0x4eb534===_0x47a5('0xbb')||_0x4eb534==='StateAttributeMetadata'||_0x4eb534===_0x47a5('0xbc')){_0x1752ce[_0x47a5('0xb2')](getInputList(_0x5ccc89,_0x40e584,_0x4eb534,_0xcdbfd7,_0x1f07ac['MetadataId'],_0x3e7750[_0x47a5('0xa8')],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x1752ce);})[_0x47a5('0x1c')](function(_0x1f937a){_0x4de126=_0x1f937a[0x0];var _0x3c117a=_0x2d434c[_0x47a5('0x9a')](_0x441d64)['concat'](_0x4de126);var _0x6a8174={'count':_0x3c117a[_0x47a5('0x3c')],'rows':_0x3c117a};return _0x6a8174;})['then'](respondWithResult(_0x281e5f,null))[_0x47a5('0x25')](function(_0x9769b5){console[_0x47a5('0xbd')](_0x47a5('0xbe')+_0x9769b5);var _0x4ce0ac=_0x2ac30f['query']['test']?0x1f4:_0x9769b5['statusCode']||0x1f4;logger[_0x47a5('0x22')](_0x9769b5[_0x47a5('0xbf')]);delete _0x9769b5[_0x47a5('0x2f')];if(_0x4ce0ac===0x191){_0x4ce0ac=0x190;}_0x281e5f[_0x47a5('0x26')](_0x4ce0ac)[_0x47a5('0xc0')](_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x18')]?{'message':_0x47a5('0xc1'),'statusCode':_0x9769b5['statusCode']}:_0x9769b5);});};function getSelectList(_0x272b10,_0x24e39a,_0x2eef05,_0x399528,_0x47be87,_0x5ef411){var _0x3770ae={'method':'GET','uri':_0x272b10+'EntityDefinitions('+_0x399528+_0x47a5('0xc2')+_0x47be87+_0x47a5('0xc3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x47a5('0xa6')+_0x5ef411,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3770ae)[_0x47a5('0x1c')](function(_0x48835f){var _0x740bdf=[];var _0xee23c7=_0x48835f['OptionSet'][_0x47a5('0xc4')];_0xee23c7[_0x47a5('0xaf')](function(_0x10ee87){_0x740bdf[_0x47a5('0xb2')]({'name':_0x10ee87[_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':String(_0x10ee87[_0x47a5('0xc7')])});});var _0x54a55e={'id':_0x24e39a+'_'+_0x48835f[_0x47a5('0xae')],'name':_0x48835f[_0x47a5('0xc8')][_0x47a5('0xc6')][_0x47a5('0xc5')],'custom':![],'options':_0x740bdf};_0x2eef05['push'](_0x54a55e);return _0x2eef05;});}function getBooleanList(_0x3d93ad,_0x281674,_0x151540,_0x27baad,_0x34b7c9,_0x30df79){var _0x31b8b1={'method':_0x47a5('0xa9'),'uri':_0x3d93ad+_0x47a5('0xc9')+_0x27baad+_0x47a5('0xc2')+_0x34b7c9+_0x47a5('0xca'),'headers':{'Authorization':_0x47a5('0xa6')+_0x30df79,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31b8b1)[_0x47a5('0x1c')](function(_0x3ec683){var _0x591bde=[];_0x591bde[_0x47a5('0xb2')]({'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xcc')][_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':_0x47a5('0xcd')},{'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xce')][_0x47a5('0xc5')][_0x47a5('0xc6')][_0x47a5('0xc5')],'value':_0x47a5('0xcf')});var _0x5e4387={'id':_0x281674+'_'+_0x3ec683['LogicalName'],'name':_0x3ec683[_0x47a5('0xc8')]['UserLocalizedLabel'][_0x47a5('0xc5')],'custom':![],'options':_0x591bde};_0x151540['push'](_0x5e4387);return _0x151540;});}function getInputList(_0x12572f,_0x8b4354,_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b){var _0xaca12c={'method':'GET','uri':_0x12572f+'EntityDefinitions('+_0x49cb8c+_0x47a5('0xc2')+_0x220557+_0x47a5('0xd0')+_0x134c1a+_0x47a5('0xd1'),'headers':{'Authorization':_0x47a5('0xa6')+_0x11f07b,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0xaca12c)[_0x47a5('0x1c')](function(_0x1c0323){var _0xe662d7={'id':_0x8b4354+'_'+_0x1c0323['LogicalName'],'name':_0x1c0323[_0x47a5('0xc8')]['UserLocalizedLabel']?_0x1c0323[_0x47a5('0xc8')][_0x47a5('0xc6')]['Label']:_0x1c0323['LogicalName'],'custom':![],'options':[]};_0x2bc7ae[_0x47a5('0xb2')](_0xe662d7);return _0x2bc7ae;});} \ No newline at end of file +var _0x7a54=['clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','tenantId','/oauth2/token','Bearer\x20','4.0','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','set','Content-Range','apply','destroy','sendStatus','name','index','map','Dynamics365Account','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','update','Dynamics365Configuration','getConfigurations','addConfiguration','findOne','AccountId','channel','type','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri'];(function(_0x3b1938,_0x478513){var _0x169e09=function(_0xd568d2){while(--_0xd568d2){_0x3b1938['push'](_0x3b1938['shift']());}};_0x169e09(++_0x478513);}(_0x7a54,0x106));var _0x47a5=function(_0x4d9f12,_0x43b959){_0x4d9f12=_0x4d9f12-0x0;var _0x3d3606=_0x7a54[_0x4d9f12];return _0x3d3606;};'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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];var integrations=require(_0x47a5('0x15'));var jayson=require(_0x47a5('0x16'));var client=jayson[_0x47a5('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x44bd3e,_0x221b54,_0x1cf309){if(_0x1cf309){var _0x711793=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x711793[_0x47a5('0x18')](_0x221b54)){return _0x44bd3e;}else{throw new db[(_0x47a5('0x19'))][(_0x47a5('0x1a'))](_0x47a5('0x1b'));}}else{return _0x44bd3e;}}function respondWithRpcPromise(_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return new BPromise(function(_0x2a2cbb,_0x1ef44c){var _0x574af6=_0x3b001e||client;return _0x574af6['request'](_0x4e99a8,_0x11faf5)[_0x47a5('0x1c')](function(_0x4b966e){logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));logger[_0x47a5('0x1f')](_0x47a5('0x20'),_0x362359,_0x47a5('0x1e'),JSON[_0x47a5('0x21')](_0x4b966e));if(_0x4b966e[_0x47a5('0x22')]){if(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x23')]===0x1f4){logger['error'](_0x47a5('0x1d'),_0x362359,_0x4b966e[_0x47a5('0x22')]['message']);return _0x1ef44c(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}logger[_0x47a5('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x362359,_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);return _0x2a2cbb(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}else{logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));_0x2a2cbb(_0x4b966e['result'][_0x47a5('0x24')]);}})[_0x47a5('0x25')](function(_0x4437f1){logger[_0x47a5('0x22')](_0x47a5('0x1d'),_0x362359,_0x4437f1);_0x1ef44c(_0x4437f1);});});}function respondWithStatusCode(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xcc;return function(_0x136745){if(_0x136745){return _0x50bf17['sendStatus'](_0x53078a);}return _0x50bf17[_0x47a5('0x26')](_0x53078a)['end']();};}function respondWithResult(_0x23cb77,_0x378208){_0x378208=_0x378208||0xc8;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x26')](_0x378208)[_0x47a5('0x27')](_0x36ad34);}};}function respondWithFilteredResult(_0x3ba0b7,_0x24b162){return function(_0x136b14){if(_0x136b14){var _0x16631f=_0x136b14[_0x47a5('0x28')],_0x361bfa=_0x24b162['offset'],_0x1127f8=_0x24b162[_0x47a5('0x29')]+_0x24b162['limit'],_0x11a4fa;if(_0x1127f8>=_0x16631f){_0x1127f8=_0x16631f;_0x11a4fa=0xc8;}else{_0x11a4fa=0xce;}_0x3ba0b7[_0x47a5('0x26')](_0x11a4fa);return _0x3ba0b7[_0x47a5('0x2a')](_0x47a5('0x2b'),_0x361bfa+'-'+_0x1127f8+'/'+_0x16631f)['json'](_0x136b14);}return null;};}function patchUpdates(_0x256650){return function(_0x625952){try{jsonpatch[_0x47a5('0x2c')](_0x625952,_0x256650,!![]);}catch(_0x1f1c68){return BPromise['reject'](_0x1f1c68);}return _0x625952['save']();};}function saveUpdates(_0x6f9a12,_0xfb5ddb){return function(_0x5bd7eb){if(_0x5bd7eb){return _0x5bd7eb['update'](_0x6f9a12)[_0x47a5('0x1c')](function(_0x51544e){return _0x51544e;});}return null;};}function removeEntity(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x2d')]()[_0x47a5('0x1c')](function(){_0x57bff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34,_0x5910bb){return function(_0x403028){if(!_0x403028){_0x274e34[_0x47a5('0x2e')](0x194);}return _0x403028;};}function handleError(_0xf269a8,_0x52749b){_0x52749b=_0x52749b||0x1f4;return function(_0x18f7e9){logger['error'](_0x18f7e9['stack']);if(_0x18f7e9[_0x47a5('0x2f')]){delete _0x18f7e9['name'];}_0xf269a8[_0x47a5('0x26')](_0x52749b)['send'](_0x18f7e9);};}exports[_0x47a5('0x30')]=function(_0x3534cb,_0x38c8d4){var _0x199698={},_0x36add5={},_0xed6320={'count':0x0,'rows':[]};var _0xee582c=_[_0x47a5('0x31')](db[_0x47a5('0x32')]['rawAttributes'],function(_0x396a9a){return{'name':_0x396a9a[_0x47a5('0x33')],'type':_0x396a9a['type'][_0x47a5('0x34')]};});_0x36add5[_0x47a5('0x35')]=_[_0x47a5('0x31')](_0xee582c,'name');_0x36add5[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x3534cb['query']);_0x36add5[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x36add5['model'],_0x36add5['query']);_0x199698['attributes']=_[_0x47a5('0x39')](_0x36add5['model'],qs[_0x47a5('0x3a')](_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3a')]));_0x199698[_0x47a5('0x3b')]=_0x199698[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x199698[_0x47a5('0x3b')]:_0x36add5[_0x47a5('0x35')];if(!_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x199698[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x3534cb['query'][_0x47a5('0x3f')]);_0x199698[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x3534cb[_0x47a5('0x36')]['offset']);}_0x199698[_0x47a5('0x40')]=qs['sort'](_0x3534cb['query']['sort']);_0x199698['where']=qs[_0x47a5('0x38')](_['pick'](_0x3534cb[_0x47a5('0x36')],_0x36add5[_0x47a5('0x38')]));if(_0x3534cb[_0x47a5('0x36')]['filter']){_0x199698[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x199698['where'],{'$or':_['map'](_0xee582c,function(_0xbe21d9){if(_0xbe21d9['type']!==_0x47a5('0x43')){var _0x4703b2={};_0x4703b2[_0xbe21d9[_0x47a5('0x2f')]]={'$like':'%'+_0x3534cb[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x4703b2;}})});}_0x199698=_[_0x47a5('0x42')]({},_0x199698,_0x3534cb[_0x47a5('0x45')]);var _0x17cc42={'where':_0x199698[_0x47a5('0x41')]};return db[_0x47a5('0x32')][_0x47a5('0x28')](_0x17cc42)[_0x47a5('0x1c')](function(_0xe28d76){_0xed6320[_0x47a5('0x28')]=_0xe28d76;if(_0x3534cb[_0x47a5('0x36')][_0x47a5('0x46')]){_0x199698['include']=[{'all':!![]}];}return db[_0x47a5('0x32')][_0x47a5('0x47')](_0x199698);})['then'](function(_0x52b3a8){_0xed6320[_0x47a5('0x48')]=_0x52b3a8;return _0xed6320;})['then'](respondWithFilteredResult(_0x38c8d4,_0x199698))[_0x47a5('0x25')](handleError(_0x38c8d4,null));};exports[_0x47a5('0x49')]=function(_0x54c35f,_0x4f62d3){var _0x3d85cc={'raw':![],'where':{'id':_0x54c35f[_0x47a5('0x4a')]['id']}},_0x52d409={};_0x52d409[_0x47a5('0x35')]=_[_0x47a5('0x37')](db[_0x47a5('0x32')][_0x47a5('0x4b')]);_0x52d409[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x54c35f['query']);_0x52d409['filters']=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],_0x52d409[_0x47a5('0x36')]);_0x3d85cc[_0x47a5('0x3b')]=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x54c35f['query'][_0x47a5('0x3a')]));_0x3d85cc[_0x47a5('0x3b')]=_0x3d85cc[_0x47a5('0x3b')]['length']?_0x3d85cc[_0x47a5('0x3b')]:_0x52d409['model'];if(_0x54c35f[_0x47a5('0x36')][_0x47a5('0x46')]){_0x3d85cc[_0x47a5('0x4c')]=[{'all':!![]}];}_0x3d85cc=_[_0x47a5('0x42')]({},_0x3d85cc,_0x54c35f['options']);return db[_0x47a5('0x32')][_0x47a5('0x4d')](_0x3d85cc)[_0x47a5('0x1c')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x1c')](respondWithResult(_0x4f62d3,null))[_0x47a5('0x25')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x4e')]=function(_0x24e9f4,_0x481089){return db[_0x47a5('0x32')][_0x47a5('0x4e')](_0x24e9f4[_0x47a5('0x4f')],{})[_0x47a5('0x1c')](respondWithResult(_0x481089,0xc9))[_0x47a5('0x25')](handleError(_0x481089,null));};exports[_0x47a5('0x50')]=function(_0x572233,_0x1ad6a9){if(_0x572233[_0x47a5('0x4f')]['id']){delete _0x572233[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x572233[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x1ad6a9,null))['then'](saveUpdates(_0x572233['body'],null))[_0x47a5('0x1c')](respondWithResult(_0x1ad6a9,null))[_0x47a5('0x25')](handleError(_0x1ad6a9,null));};exports['destroy']=function(_0x4cf792,_0x6d6b2b){return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x4cf792['params']['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x1c')](removeEntity(_0x6d6b2b,null))[_0x47a5('0x25')](handleError(_0x6d6b2b,null));};exports['getConfigurations']=function(_0x1b958b,_0x72fe,_0x4b706a){var _0x5b6127={};var _0x16b4fd={};var _0x30d482;var _0x867da0;return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x1b958b[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x72fe,null))[_0x47a5('0x1c')](function(_0x5a33b8){if(_0x5a33b8){_0x30d482=_0x5a33b8;_0x16b4fd[_0x47a5('0x35')]=_['keys'](db[_0x47a5('0x51')][_0x47a5('0x4b')]);_0x16b4fd[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x1b958b[_0x47a5('0x36')]);_0x16b4fd['filters']=_[_0x47a5('0x39')](_0x16b4fd['model'],_0x16b4fd['query']);_0x5b6127['attributes']=_['intersection'](_0x16b4fd[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x1b958b[_0x47a5('0x36')]['fields']));_0x5b6127['attributes']=_0x5b6127[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x5b6127[_0x47a5('0x3b')]:_0x16b4fd[_0x47a5('0x35')];_0x5b6127[_0x47a5('0x40')]=qs['sort'](_0x1b958b[_0x47a5('0x36')]['sort']);_0x5b6127[_0x47a5('0x41')]=qs[_0x47a5('0x38')](_['pick'](_0x1b958b[_0x47a5('0x36')],_0x16b4fd[_0x47a5('0x38')]));if(_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]){_0x5b6127[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x5b6127[_0x47a5('0x41')],{'$or':_[_0x47a5('0x31')](_0x5b6127['attributes'],function(_0x2dcc3b){var _0x2a3a57={};_0x2a3a57[_0x2dcc3b]={'$like':'%'+_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x2a3a57;})});}_0x5b6127=_[_0x47a5('0x42')]({},_0x5b6127,_0x1b958b['options']);return _0x30d482[_0x47a5('0x52')](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x1224bc){if(_0x1224bc){_0x867da0=_0x1224bc[_0x47a5('0x3c')];if(!_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x5b6127[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3f')]);_0x5b6127[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x29')]);}return _0x30d482['getConfigurations'](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x284fb8){if(_0x284fb8){return _0x284fb8?{'count':_0x867da0,'rows':_0x284fb8}:null;}})[_0x47a5('0x1c')](respondWithResult(_0x72fe,null))['catch'](handleError(_0x72fe,null));};exports[_0x47a5('0x53')]=function(_0x2e46af,_0x36c67,_0x26f1ac){if(_0x2e46af['body']['id']){delete _0x2e46af[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x54')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x7c1190){if(_0x7c1190){_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x55')]=_0x7c1190['id'];_0x2e46af['body']['Subjects']=integrations['getSubjects'](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);_0x2e46af['body'][_0x47a5('0x58')]=integrations[_0x47a5('0x59')](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);return db[_0x47a5('0x51')][_0x47a5('0x4e')](_0x2e46af[_0x47a5('0x4f')],{'include':[{'model':db[_0x47a5('0x5a')],'as':_0x47a5('0x5b')},{'model':db[_0x47a5('0x5a')],'as':'Descriptions'}]});}return null;})[_0x47a5('0x1c')](respondWithResult(_0x36c67,null))['catch'](handleError(_0x36c67,null));};exports[_0x47a5('0x5c')]=function(_0x2ac30f,_0x281e5f,_0x12fec9){var _0x40e584=_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x5d')];var _0x448981=_0x40e584===_0x47a5('0x5e')?_0x47a5('0x5f'):_0x47a5('0x60');var _0x1f07ac='';var _0x8f0035='';var _0x2d434c='';var _0x441d64='';var _0x4de126='';var _0x48eb77='';var _0x5ccc89='';var _0x4d09a4='';var _0x490e28=[_0x47a5('0x61'),'description',_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),_0x47a5('0x65'),_0x47a5('0x66'),_0x47a5('0x67'),_0x47a5('0x68'),_0x47a5('0x69')];var _0x2e9a96=[_0x47a5('0x6a'),_0x47a5('0x6b'),'actualserviceunits',_0x47a5('0x6c'),_0x47a5('0x6d'),_0x47a5('0x6e'),'contractdetailidname',_0x47a5('0x6f'),_0x47a5('0x70'),_0x47a5('0x71'),'createdbyname',_0x47a5('0x72'),'createdon','createdonbehalfbyname',_0x47a5('0x73'),_0x47a5('0x74'),_0x47a5('0x75'),_0x47a5('0x76'),_0x47a5('0x77'),_0x47a5('0x78'),'entityimage_timestamp','entityimage_url',_0x47a5('0x79'),'exchangerate',_0x47a5('0x7a'),_0x47a5('0x7b'),_0x47a5('0x7c'),_0x47a5('0x7d'),'kbarticleidname',_0x47a5('0x7e'),'masteridname','modifiedbyexternalpartyname',_0x47a5('0x7f'),_0x47a5('0x80'),'modifiedbyyominame',_0x47a5('0x81'),_0x47a5('0x82'),_0x47a5('0x83'),'msdyn_incidenttypename',_0x47a5('0x84'),'numberofchildincidents',_0x47a5('0x85'),_0x47a5('0x86'),_0x47a5('0x87'),'owneridtype',_0x47a5('0x88'),_0x47a5('0x89'),_0x47a5('0x8a'),'primarycontactidyominame',_0x47a5('0x8b'),'productidname',_0x47a5('0x8c'),'resolveby',_0x47a5('0x8d'),_0x47a5('0x8e'),_0x47a5('0x8f'),_0x47a5('0x90'),'sentimentvalue',_0x47a5('0x91'),_0x47a5('0x92'),_0x47a5('0x93'),_0x47a5('0x94'),_0x47a5('0x95'),'subjectidname','ticketnumber',_0x47a5('0x96'),'transactioncurrencyidname',_0x47a5('0x97'),_0x47a5('0x98'),_0x47a5('0x99')];var _0x5018e9=_0x490e28[_0x47a5('0x9a')](_0x2e9a96);return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x2ac30f[_0x47a5('0x4a')]['id']},'attributes':['id',_0x47a5('0x9b'),_0x47a5('0x9c'),_0x47a5('0x9d'),'tenantId','clientId',_0x47a5('0x9e')]})[_0x47a5('0x1c')](handleEntityNotFound(_0x281e5f,null))['then'](function(_0x27d422){if(_0x27d422){_0x4d09a4=_0x27d422[_0x47a5('0x9d')];var _0x5a0901=_0x4d09a4[_0x47a5('0x9f')](-0x1);if(_0x5a0901==='/'){_0x4d09a4=_0x4d09a4[_0x47a5('0xa0')](0x0,_0x4d09a4[_0x47a5('0xa1')](_0x5a0901));}_0x5ccc89=util['format'](_0x47a5('0xa2'),_0x4d09a4);var _0x59b4a5={'method':_0x47a5('0xa3'),'uri':'https://login.microsoftonline.com/'+_0x27d422[_0x47a5('0xa4')]+_0x47a5('0xa5'),'form':{'client_id':_0x27d422['clientId'],'resource':_0x4d09a4,'username':_0x27d422[_0x47a5('0x9b')],'password':_0x27d422['password'],'grant_type':_0x47a5('0x9c'),'client_secret':_0x27d422[_0x47a5('0x9e')]},'json':!![]};return rp(_0x59b4a5);}})[_0x47a5('0x1c')](function(_0x2be771){_0x48eb77=_0x2be771['access_token'];var _0x3eb5c1={'method':'GET','uri':encodeURI(_0x5ccc89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x448981+'\x27'),'headers':{'Authorization':_0x47a5('0xa6')+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3eb5c1);})[_0x47a5('0x1c')](function(_0x96fb22){var _0x380c8b=_0x96fb22['value'][0x0];var _0x1522a6=_0x380c8b[_0x47a5('0xa8')];var _0x241e1d={'method':_0x47a5('0xa9'),'uri':_0x5ccc89+'EntityDefinitions('+_0x1522a6+_0x47a5('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x241e1d);})[_0x47a5('0x1c')](function(_0x3f93f0){_0x1f07ac=_0x3f93f0;_0x8f0035=_0x1f07ac[_0x47a5('0xab')];_0x8f0035=_[_0x47a5('0xac')](_0x8f0035,function(_0x3ec264){return!_0x5018e9[_0x47a5('0xad')](_0x3ec264[_0x47a5('0xae')]);});var _0x11eaf7=[];var _0x583746=[];_0x8f0035[_0x47a5('0xaf')](function(_0x18f8b2){if(_0x18f8b2['@odata.type']){var _0x2fd46f=_0x18f8b2[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x18f8b2['@odata.type']['lastIndexOf']('.')+0x1);if(_0x2fd46f===_0x47a5('0xb1')){_0x11eaf7[_0x47a5('0xb2')](getSelectList(_0x5ccc89,_0x40e584,_0x583746,_0x1f07ac['MetadataId'],_0x18f8b2['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x11eaf7);})[_0x47a5('0x1c')](function(_0x54eab1){_0x2d434c=_0x54eab1[0x0];var _0x29e384=[];var _0x269ff6=[];_0x8f0035['forEach'](function(_0x16097e){if(!_[_0x47a5('0xb4')](_0x16097e[_0x47a5('0xb0')])){var _0x70c8a6=_0x16097e[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x16097e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x70c8a6==='BooleanAttributeMetadata'){_0x29e384[_0x47a5('0xb2')](getBooleanList(_0x5ccc89,_0x40e584,_0x269ff6,_0x1f07ac[_0x47a5('0xa8')],_0x16097e['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x29e384);})[_0x47a5('0x1c')](function(_0x32ca1c){_0x441d64=_0x32ca1c[0x0];var _0x1752ce=[];var _0xcdbfd7=[];_0x8f0035['forEach'](function(_0x3e7750){if(_0x3e7750['@odata.type']){var _0x4eb534=_0x3e7750['@odata.type'][_0x47a5('0xa0')](_0x3e7750['@odata.type'][_0x47a5('0xa1')]('.')+0x1);if(_0x4eb534===_0x47a5('0xb5')||_0x4eb534===_0x47a5('0xb6')||_0x4eb534==='BigIntAttributeMetadata'||_0x4eb534===_0x47a5('0xb7')||_0x4eb534===_0x47a5('0xb8')||_0x4eb534===_0x47a5('0xb9')||_0x4eb534===_0x47a5('0xba')||_0x4eb534===_0x47a5('0xbb')||_0x4eb534==='StateAttributeMetadata'||_0x4eb534===_0x47a5('0xbc')){_0x1752ce[_0x47a5('0xb2')](getInputList(_0x5ccc89,_0x40e584,_0x4eb534,_0xcdbfd7,_0x1f07ac['MetadataId'],_0x3e7750[_0x47a5('0xa8')],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x1752ce);})[_0x47a5('0x1c')](function(_0x1f937a){_0x4de126=_0x1f937a[0x0];var _0x3c117a=_0x2d434c[_0x47a5('0x9a')](_0x441d64)['concat'](_0x4de126);var _0x6a8174={'count':_0x3c117a[_0x47a5('0x3c')],'rows':_0x3c117a};return _0x6a8174;})['then'](respondWithResult(_0x281e5f,null))[_0x47a5('0x25')](function(_0x9769b5){console[_0x47a5('0xbd')](_0x47a5('0xbe')+_0x9769b5);var _0x4ce0ac=_0x2ac30f['query']['test']?0x1f4:_0x9769b5['statusCode']||0x1f4;logger[_0x47a5('0x22')](_0x9769b5[_0x47a5('0xbf')]);delete _0x9769b5[_0x47a5('0x2f')];if(_0x4ce0ac===0x191){_0x4ce0ac=0x190;}_0x281e5f[_0x47a5('0x26')](_0x4ce0ac)[_0x47a5('0xc0')](_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x18')]?{'message':_0x47a5('0xc1'),'statusCode':_0x9769b5['statusCode']}:_0x9769b5);});};function getSelectList(_0x272b10,_0x24e39a,_0x2eef05,_0x399528,_0x47be87,_0x5ef411){var _0x3770ae={'method':'GET','uri':_0x272b10+'EntityDefinitions('+_0x399528+_0x47a5('0xc2')+_0x47be87+_0x47a5('0xc3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x47a5('0xa6')+_0x5ef411,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3770ae)[_0x47a5('0x1c')](function(_0x48835f){var _0x740bdf=[];var _0xee23c7=_0x48835f['OptionSet'][_0x47a5('0xc4')];_0xee23c7[_0x47a5('0xaf')](function(_0x10ee87){_0x740bdf[_0x47a5('0xb2')]({'name':_0x10ee87[_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':String(_0x10ee87[_0x47a5('0xc7')])});});var _0x54a55e={'id':_0x24e39a+'_'+_0x48835f[_0x47a5('0xae')],'name':_0x48835f[_0x47a5('0xc8')][_0x47a5('0xc6')][_0x47a5('0xc5')],'custom':![],'options':_0x740bdf};_0x2eef05['push'](_0x54a55e);return _0x2eef05;});}function getBooleanList(_0x3d93ad,_0x281674,_0x151540,_0x27baad,_0x34b7c9,_0x30df79){var _0x31b8b1={'method':_0x47a5('0xa9'),'uri':_0x3d93ad+_0x47a5('0xc9')+_0x27baad+_0x47a5('0xc2')+_0x34b7c9+_0x47a5('0xca'),'headers':{'Authorization':_0x47a5('0xa6')+_0x30df79,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31b8b1)[_0x47a5('0x1c')](function(_0x3ec683){var _0x591bde=[];_0x591bde[_0x47a5('0xb2')]({'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xcc')][_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':_0x47a5('0xcd')},{'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xce')][_0x47a5('0xc5')][_0x47a5('0xc6')][_0x47a5('0xc5')],'value':_0x47a5('0xcf')});var _0x5e4387={'id':_0x281674+'_'+_0x3ec683['LogicalName'],'name':_0x3ec683[_0x47a5('0xc8')]['UserLocalizedLabel'][_0x47a5('0xc5')],'custom':![],'options':_0x591bde};_0x151540['push'](_0x5e4387);return _0x151540;});}function getInputList(_0x12572f,_0x8b4354,_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b){var _0xaca12c={'method':'GET','uri':_0x12572f+'EntityDefinitions('+_0x49cb8c+_0x47a5('0xc2')+_0x220557+_0x47a5('0xd0')+_0x134c1a+_0x47a5('0xd1'),'headers':{'Authorization':_0x47a5('0xa6')+_0x11f07b,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0xaca12c)[_0x47a5('0x1c')](function(_0x1c0323){var _0xe662d7={'id':_0x8b4354+'_'+_0x1c0323['LogicalName'],'name':_0x1c0323[_0x47a5('0xc8')]['UserLocalizedLabel']?_0x1c0323[_0x47a5('0xc8')][_0x47a5('0xc6')]['Label']:_0x1c0323['LogicalName'],'custom':![],'options':[]};_0x2bc7ae[_0x47a5('0xb2')](_0xe662d7);return _0x2bc7ae;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 55ed2a6..1fdcd9e 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 _0xa905=['api','bluebird','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger'];(function(_0x80ef1,_0x25a347){var _0x4e4ed5=function(_0x395852){while(--_0x395852){_0x80ef1['push'](_0x80ef1['shift']());}};_0x4e4ed5(++_0x25a347);}(_0xa905,0x1aa));var _0x5a90=function(_0x216c45,_0x40692b){_0x216c45=_0x216c45-0x0;var _0x3b96ce=_0xa905[_0x216c45];return _0x3b96ce;};'use strict';var _=require(_0x5a90('0x0'));var util=require(_0x5a90('0x1'));var logger=require(_0x5a90('0x2'))(_0x5a90('0x3'));var moment=require('moment');var BPromise=require(_0x5a90('0x4'));var rp=require(_0x5a90('0x5'));var fs=require('fs');var path=require(_0x5a90('0x6'));var rimraf=require('rimraf');var config=require(_0x5a90('0x7'));var attributes=require(_0x5a90('0x8'));var integrations=require(_0x5a90('0x9'));module[_0x5a90('0xa')]=function(_0x744a14,_0x100061){return _0x744a14['define'](_0x5a90('0xb'),attributes,{'tableName':_0x5a90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3af1=['request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','exports','int_dynamics365_accounts','../../config/logger','api','moment','bluebird'];(function(_0x106b85,_0x3763b5){var _0x1d1788=function(_0xf921e7){while(--_0xf921e7){_0x106b85['push'](_0x106b85['shift']());}};_0x1d1788(++_0x3763b5);}(_0x3af1,0x6a));var _0x13af=function(_0x2187b3,_0x3071db){_0x2187b3=_0x2187b3-0x0;var _0x152005=_0x3af1[_0x2187b3];return _0x152005;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13af('0x0'))(_0x13af('0x1'));var moment=require(_0x13af('0x2'));var BPromise=require(_0x13af('0x3'));var rp=require(_0x13af('0x4'));var fs=require('fs');var path=require(_0x13af('0x5'));var rimraf=require(_0x13af('0x6'));var config=require(_0x13af('0x7'));var attributes=require(_0x13af('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x13af('0x9')]=function(_0x19687c,_0x1d904b){return _0x19687c['define']('Dynamics365Account',attributes,{'tableName':_0x13af('0xa'),'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 d563ada..92ac88b 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 _0xb073=['../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','include','model','map','ShowDynamics365Account','find','then','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2b4b83,_0x3378a4){var _0x5ab8de=function(_0x3b55cf){while(--_0x3b55cf){_0x2b4b83['push'](_0x2b4b83['shift']());}};_0x5ab8de(++_0x3378a4);}(_0xb073,0x187));var _0x3b07=function(_0x332a69,_0x53893){_0x332a69=_0x332a69-0x0;var _0x394cae=_0xb073[_0x332a69];return _0x394cae;};'use strict';var _=require('lodash');var util=require(_0x3b07('0x0'));var moment=require('moment');var BPromise=require(_0x3b07('0x1'));var rs=require(_0x3b07('0x2'));var fs=require('fs');var Redis=require(_0x3b07('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b07('0x4'));var logger=require(_0x3b07('0x5'))(_0x3b07('0x6'));var config=require('../../config/environment');var jayson=require(_0x3b07('0x7'));var client=jayson[_0x3b07('0x8')][_0x3b07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c1ac2,_0x46ac51,_0x3f8b8f){return new BPromise(function(_0x1a2d1,_0x27e133){return client['request'](_0x2c1ac2,_0x3f8b8f)['then'](function(_0x230c37){logger[_0x3b07('0xa')](_0x3b07('0xb'),_0x46ac51,_0x3b07('0xc'));logger[_0x3b07('0xd')](_0x3b07('0xe'),_0x46ac51,_0x3b07('0xc'),JSON[_0x3b07('0xf')](_0x230c37));if(_0x230c37[_0x3b07('0x10')]){if(_0x230c37[_0x3b07('0x10')][_0x3b07('0x11')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x46ac51,_0x230c37[_0x3b07('0x10')][_0x3b07('0x12')]);return _0x27e133(_0x230c37[_0x3b07('0x10')]['message']);}logger[_0x3b07('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x46ac51,_0x230c37[_0x3b07('0x10')][_0x3b07('0x12')]);return _0x1a2d1(_0x230c37[_0x3b07('0x10')][_0x3b07('0x12')]);}else{logger[_0x3b07('0xa')](_0x3b07('0xb'),_0x46ac51,_0x3b07('0xc'));_0x1a2d1(_0x230c37[_0x3b07('0x13')][_0x3b07('0x12')]);}})[_0x3b07('0x14')](function(_0x4f38b2){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x46ac51,_0x4f38b2);_0x27e133(_0x4f38b2);});});}exports[_0x3b07('0x15')]=function(_0x227afa){var _0x4d28a0=this;return new Promise(function(_0x56a531,_0x47eb66){return db[_0x3b07('0x16')]['findAll']({'raw':_0x227afa[_0x3b07('0x17')]?_0x227afa[_0x3b07('0x17')][_0x3b07('0x18')]===undefined?!![]:![]:!![],'where':_0x227afa[_0x3b07('0x17')]?_0x227afa[_0x3b07('0x17')][_0x3b07('0x19')]||null:null,'attributes':_0x227afa[_0x3b07('0x17')]?_0x227afa[_0x3b07('0x17')][_0x3b07('0x1a')]||null:null,'limit':_0x227afa[_0x3b07('0x17')]?_0x227afa[_0x3b07('0x17')]['limit']||null:null,'include':_0x227afa[_0x3b07('0x17')]?_0x227afa['options'][_0x3b07('0x1b')]?_['map'](_0x227afa[_0x3b07('0x17')]['include'],function(_0x39dd6d){return{'model':db[_0x39dd6d[_0x3b07('0x1c')]],'as':_0x39dd6d['as'],'attributes':_0x39dd6d[_0x3b07('0x1a')],'include':_0x39dd6d['include']?_[_0x3b07('0x1d')](_0x39dd6d['include'],function(_0x248e4e){return{'model':db[_0x248e4e['model']],'as':_0x248e4e['as'],'attributes':_0x248e4e[_0x3b07('0x1a')],'include':_0x248e4e[_0x3b07('0x1b')]?_[_0x3b07('0x1d')](_0x248e4e[_0x3b07('0x1b')],function(_0x10e691){return{'model':db[_0x10e691[_0x3b07('0x1c')]],'as':_0x10e691['as'],'attributes':_0x10e691[_0x3b07('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3c96){logger[_0x3b07('0xa')](_0x3b07('0x15'),_0x227afa);logger[_0x3b07('0xd')](_0x3b07('0x15'),_0x227afa,JSON[_0x3b07('0xf')](_0x2b3c96));_0x56a531(_0x2b3c96);})['catch'](function(_0x583a23){logger['error']('GetDynamics365Account',_0x583a23[_0x3b07('0x12')],_0x227afa);_0x47eb66(_0x4d28a0[_0x3b07('0x10')](0x1f4,_0x583a23[_0x3b07('0x12')]));});});};exports[_0x3b07('0x1e')]=function(_0xe5fdc7){var _0x4491f2=this;return new Promise(function(_0x517866,_0x5f1726){return db[_0x3b07('0x16')][_0x3b07('0x1f')]({'raw':_0xe5fdc7[_0x3b07('0x17')]?_0xe5fdc7['options'][_0x3b07('0x18')]===undefined?!![]:![]:!![],'where':_0xe5fdc7[_0x3b07('0x17')]?_0xe5fdc7[_0x3b07('0x17')][_0x3b07('0x19')]||null:null,'attributes':_0xe5fdc7['options']?_0xe5fdc7[_0x3b07('0x17')][_0x3b07('0x1a')]||null:null,'include':_0xe5fdc7[_0x3b07('0x17')]?_0xe5fdc7[_0x3b07('0x17')]['include']?_[_0x3b07('0x1d')](_0xe5fdc7[_0x3b07('0x17')][_0x3b07('0x1b')],function(_0x242b93){return{'model':db[_0x242b93[_0x3b07('0x1c')]],'as':_0x242b93['as'],'attributes':_0x242b93[_0x3b07('0x1a')],'include':_0x242b93[_0x3b07('0x1b')]?_[_0x3b07('0x1d')](_0x242b93[_0x3b07('0x1b')],function(_0x50ee77){return{'model':db[_0x50ee77[_0x3b07('0x1c')]],'as':_0x50ee77['as'],'attributes':_0x50ee77[_0x3b07('0x1a')],'include':_0x50ee77[_0x3b07('0x1b')]?_['map'](_0x50ee77['include'],function(_0x2dcebd){return{'model':db[_0x2dcebd[_0x3b07('0x1c')]],'as':_0x2dcebd['as'],'attributes':_0x2dcebd[_0x3b07('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3b07('0x20')](function(_0x537ffe){logger[_0x3b07('0xa')](_0x3b07('0x1e'),_0xe5fdc7);logger[_0x3b07('0xd')]('ShowDynamics365Account',_0xe5fdc7,JSON[_0x3b07('0xf')](_0x537ffe));_0x517866(_0x537ffe);})['catch'](function(_0x2ae8c6){logger[_0x3b07('0x10')](_0x3b07('0x1e'),_0x2ae8c6[_0x3b07('0x12')],_0xe5fdc7);_0x5f1726(_0x4491f2[_0x3b07('0x10')](0x1f4,_0x2ae8c6[_0x3b07('0x12')]));});});}; \ No newline at end of file +var _0x9c48=['http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','raw','limit','include','model','attributes','map','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x1e2dc6,_0x374ee1){var _0x4ee341=function(_0xfde108){while(--_0xfde108){_0x1e2dc6['push'](_0x1e2dc6['shift']());}};_0x4ee341(++_0x374ee1);}(_0x9c48,0xa1));var _0x89c4=function(_0x5047a1,_0x1bd26d){_0x5047a1=_0x5047a1-0x0;var _0x51d17b=_0x9c48[_0x5047a1];return _0x51d17b;};'use strict';var _=require(_0x89c4('0x0'));var util=require(_0x89c4('0x1'));var moment=require(_0x89c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x89c4('0x3'));var fs=require('fs');var Redis=require(_0x89c4('0x4'));var db=require(_0x89c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x89c4('0x6'));var config=require(_0x89c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x89c4('0x8')][_0x89c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d0303,_0x213a86,_0x30cdf1){return new BPromise(function(_0x7faf5,_0x26ab92){return client[_0x89c4('0xa')](_0x1d0303,_0x30cdf1)[_0x89c4('0xb')](function(_0xad4f2c){logger[_0x89c4('0xc')](_0x89c4('0xd'),_0x213a86,_0x89c4('0xe'));logger[_0x89c4('0xf')](_0x89c4('0x10'),_0x213a86,_0x89c4('0xe'),JSON[_0x89c4('0x11')](_0xad4f2c));if(_0xad4f2c[_0x89c4('0x12')]){if(_0xad4f2c[_0x89c4('0x12')][_0x89c4('0x13')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x213a86,_0xad4f2c['error'][_0x89c4('0x14')]);return _0x26ab92(_0xad4f2c[_0x89c4('0x12')][_0x89c4('0x14')]);}logger[_0x89c4('0x12')](_0x89c4('0xd'),_0x213a86,_0xad4f2c[_0x89c4('0x12')][_0x89c4('0x14')]);return _0x7faf5(_0xad4f2c['error'][_0x89c4('0x14')]);}else{logger[_0x89c4('0xc')](_0x89c4('0xd'),_0x213a86,_0x89c4('0xe'));_0x7faf5(_0xad4f2c['result'][_0x89c4('0x14')]);}})[_0x89c4('0x15')](function(_0xae1ed7){logger['error'](_0x89c4('0xd'),_0x213a86,_0xae1ed7);_0x26ab92(_0xae1ed7);});});}exports['GetDynamics365Account']=function(_0x29342c){var _0x477a19=this;return new Promise(function(_0x574f49,_0x456cf2){return db['Dynamics365Account']['findAll']({'raw':_0x29342c[_0x89c4('0x16')]?_0x29342c[_0x89c4('0x16')][_0x89c4('0x17')]===undefined?!![]:![]:!![],'where':_0x29342c['options']?_0x29342c[_0x89c4('0x16')]['where']||null:null,'attributes':_0x29342c[_0x89c4('0x16')]?_0x29342c[_0x89c4('0x16')]['attributes']||null:null,'limit':_0x29342c[_0x89c4('0x16')]?_0x29342c[_0x89c4('0x16')][_0x89c4('0x18')]||null:null,'include':_0x29342c[_0x89c4('0x16')]?_0x29342c[_0x89c4('0x16')][_0x89c4('0x19')]?_['map'](_0x29342c[_0x89c4('0x16')][_0x89c4('0x19')],function(_0x59e8ee){return{'model':db[_0x59e8ee[_0x89c4('0x1a')]],'as':_0x59e8ee['as'],'attributes':_0x59e8ee[_0x89c4('0x1b')],'include':_0x59e8ee[_0x89c4('0x19')]?_[_0x89c4('0x1c')](_0x59e8ee[_0x89c4('0x19')],function(_0xa739bd){return{'model':db[_0xa739bd['model']],'as':_0xa739bd['as'],'attributes':_0xa739bd[_0x89c4('0x1b')],'include':_0xa739bd[_0x89c4('0x19')]?_[_0x89c4('0x1c')](_0xa739bd[_0x89c4('0x19')],function(_0x17c9f9){return{'model':db[_0x17c9f9[_0x89c4('0x1a')]],'as':_0x17c9f9['as'],'attributes':_0x17c9f9[_0x89c4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x89c4('0xb')](function(_0x256b9f){logger[_0x89c4('0xc')](_0x89c4('0x1d'),_0x29342c);logger[_0x89c4('0xf')](_0x89c4('0x1d'),_0x29342c,JSON[_0x89c4('0x11')](_0x256b9f));_0x574f49(_0x256b9f);})['catch'](function(_0x5e9b35){logger[_0x89c4('0x12')]('GetDynamics365Account',_0x5e9b35[_0x89c4('0x14')],_0x29342c);_0x456cf2(_0x477a19[_0x89c4('0x12')](0x1f4,_0x5e9b35[_0x89c4('0x14')]));});});};exports[_0x89c4('0x1e')]=function(_0x2c732a){var _0x24f61e=this;return new Promise(function(_0x35c1fb,_0x107222){return db[_0x89c4('0x1f')][_0x89c4('0x20')]({'raw':_0x2c732a[_0x89c4('0x16')]?_0x2c732a['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c732a['options']?_0x2c732a[_0x89c4('0x16')][_0x89c4('0x21')]||null:null,'attributes':_0x2c732a[_0x89c4('0x16')]?_0x2c732a[_0x89c4('0x16')][_0x89c4('0x1b')]||null:null,'include':_0x2c732a[_0x89c4('0x16')]?_0x2c732a[_0x89c4('0x16')][_0x89c4('0x19')]?_[_0x89c4('0x1c')](_0x2c732a[_0x89c4('0x16')][_0x89c4('0x19')],function(_0x7ed242){return{'model':db[_0x7ed242['model']],'as':_0x7ed242['as'],'attributes':_0x7ed242[_0x89c4('0x1b')],'include':_0x7ed242['include']?_['map'](_0x7ed242[_0x89c4('0x19')],function(_0x2f92b0){return{'model':db[_0x2f92b0[_0x89c4('0x1a')]],'as':_0x2f92b0['as'],'attributes':_0x2f92b0[_0x89c4('0x1b')],'include':_0x2f92b0[_0x89c4('0x19')]?_['map'](_0x2f92b0[_0x89c4('0x19')],function(_0x140680){return{'model':db[_0x140680[_0x89c4('0x1a')]],'as':_0x140680['as'],'attributes':_0x140680['attributes']};}):[]};}):[]};}):[]:[]})[_0x89c4('0xb')](function(_0x483239){logger[_0x89c4('0xc')](_0x89c4('0x1e'),_0x2c732a);logger[_0x89c4('0xf')](_0x89c4('0x1e'),_0x2c732a,JSON[_0x89c4('0x11')](_0x483239));_0x35c1fb(_0x483239);})[_0x89c4('0x15')](function(_0x941071){logger[_0x89c4('0x12')](_0x89c4('0x1e'),_0x941071[_0x89c4('0x14')],_0x2c732a);_0x107222(_0x24f61e[_0x89c4('0x12')](0x1f4,_0x941071[_0x89c4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 84b4c5c..f81fec5 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 _0x22ff=['index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','path','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x2e2362,_0x4bc1cf){var _0x1fb8ae=function(_0x2fe453){while(--_0x2fe453){_0x2e2362['push'](_0x2e2362['shift']());}};_0x1fb8ae(++_0x4bc1cf);}(_0x22ff,0xab));var _0xf22f=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0x22ff[_0x5111a9];return _0x59a15a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf22f('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf22f('0x1')]();var auth=require(_0xf22f('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf22f('0x3'));var controller=require(_0xf22f('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xf22f('0x5')]);router[_0xf22f('0x6')](_0xf22f('0x7'),auth[_0xf22f('0x8')](),controller[_0xf22f('0x9')]);router[_0xf22f('0x6')](_0xf22f('0xa'),auth[_0xf22f('0x8')](),controller[_0xf22f('0xb')]);router['get'](_0xf22f('0xc'),auth['isAuthenticated'](),controller[_0xf22f('0xd')]);router[_0xf22f('0x6')](_0xf22f('0xe'),auth[_0xf22f('0x8')](),controller[_0xf22f('0xf')]);router[_0xf22f('0x10')]('/',auth[_0xf22f('0x8')](),controller[_0xf22f('0x11')]);router[_0xf22f('0x12')](_0xf22f('0x7'),auth[_0xf22f('0x8')](),controller[_0xf22f('0x13')]);router[_0xf22f('0x14')]('/:id',auth[_0xf22f('0x8')](),controller[_0xf22f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4277=['get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x4277,0x1da));var _0x7427=function(_0x4a60d8,_0x1340b7){_0x4a60d8=_0x4a60d8-0x0;var _0x1c6ed5=_0x4277[_0x4a60d8];return _0x1c6ed5;};'use strict';var multer=require(_0x7427('0x0'));var util=require('util');var path=require(_0x7427('0x1'));var timeout=require(_0x7427('0x2'));var express=require(_0x7427('0x3'));var router=express[_0x7427('0x4')]();var auth=require(_0x7427('0x5'));var interaction=require(_0x7427('0x6'));var config=require(_0x7427('0x7'));var controller=require(_0x7427('0x8'));router[_0x7427('0x9')]('/',auth['isAuthenticated'](),controller[_0x7427('0xa')]);router[_0x7427('0x9')](_0x7427('0xb'),auth[_0x7427('0xc')](),controller[_0x7427('0xd')]);router[_0x7427('0x9')]('/:id/fields',auth[_0x7427('0xc')](),controller[_0x7427('0xe')]);router[_0x7427('0x9')](_0x7427('0xf'),auth[_0x7427('0xc')](),controller['getSubjects']);router[_0x7427('0x9')](_0x7427('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x7427('0x11')]('/',auth[_0x7427('0xc')](),controller[_0x7427('0x12')]);router[_0x7427('0x13')](_0x7427('0xb'),auth['isAuthenticated'](),controller[_0x7427('0x14')]);router[_0x7427('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7427('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 4dd91fb..f4c3e3e 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 _0xd62d=['STRING','ENUM','incident','phonecall','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd62d,0x13a));var _0xdd62=function(_0x37977e,_0x2086e5){_0x37977e=_0x37977e-0x0;var _0x2503d0=_0xd62d[_0x37977e];return _0x2503d0;};'use strict';var Sequelize=require('sequelize');module[_0xdd62('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdd62('0x1')]},'ticketType':{'type':Sequelize[_0xdd62('0x2')](_0xdd62('0x3'),_0xdd62('0x4')),'defaultValue':_0xdd62('0x3')}}; \ No newline at end of file +var _0xa8a9=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa8a9,0xe4));var _0x9a8a=function(_0x52ef9c,_0x3f3768){_0x52ef9c=_0x52ef9c-0x0;var _0x1ec842=_0xa8a9[_0x52ef9c];return _0x1ec842;};'use strict';var Sequelize=require(_0x9a8a('0x0'));module[_0x9a8a('0x1')]={'name':{'type':Sequelize[_0x9a8a('0x2')]},'description':{'type':Sequelize[_0x9a8a('0x2')]},'ticketType':{'type':Sequelize[_0x9a8a('0x3')](_0x9a8a('0x4'),_0x9a8a('0x5')),'defaultValue':_0x9a8a('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8c1d939..773306e 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 _0x4bb5=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','apply','save','then','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','intersection','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','options','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x4bb5,0x16b));var _0x54bb=function(_0x2e7ac3,_0x26c2ef){_0x2e7ac3=_0x2e7ac3-0x0;var _0x59e8bc=_0x4bb5[_0x2e7ac3];return _0x59e8bc;};'use strict';var pdf=require(_0x54bb('0x0'));var emlformat=require(_0x54bb('0x1'));var rimraf=require(_0x54bb('0x2'));var zipdir=require(_0x54bb('0x3'));var jsonpatch=require(_0x54bb('0x4'));var rp=require(_0x54bb('0x5'));var moment=require(_0x54bb('0x6'));var BPromise=require(_0x54bb('0x7'));var Mustache=require(_0x54bb('0x8'));var util=require(_0x54bb('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x54bb('0xa'));var fs=require('fs');var _=require(_0x54bb('0xb'));var squel=require(_0x54bb('0xc'));var crypto=require(_0x54bb('0xd'));var jsforce=require(_0x54bb('0xe'));var deskjs=require(_0x54bb('0xf'));var toCsv=require(_0x54bb('0x10'));var querystring=require(_0x54bb('0x11'));var Papa=require(_0x54bb('0x12'));var Redis=require(_0x54bb('0x13'));var authService=require(_0x54bb('0x14'));var qs=require(_0x54bb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54bb('0x16'));var logger=require(_0x54bb('0x17'))(_0x54bb('0x18'));var utils=require(_0x54bb('0x19'));var config=require('../../config/environment');var db=require(_0x54bb('0x1a'))['db'];var jayson=require(_0x54bb('0x1b'));var client=jayson[_0x54bb('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x26afa7,_0x2f174b,_0x5930c4){if(_0x5930c4){var _0x33e8b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33e8b7[_0x54bb('0x1d')](_0x2f174b)){return _0x26afa7;}else{throw new db[(_0x54bb('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x26afa7;}}function respondWithRpcPromise(_0x27e457,_0x59abeb,_0x5d5d8e,_0xc0c19b){return new BPromise(function(_0x2e1616,_0x2b07ef){var _0x38ad05=_0xc0c19b||client;return _0x38ad05[_0x54bb('0x1f')](_0x27e457,_0x5d5d8e)['then'](function(_0x1e5f28){logger['info'](_0x54bb('0x20'),_0x59abeb,_0x54bb('0x21'));logger['debug'](_0x54bb('0x22'),_0x59abeb,_0x54bb('0x21'),JSON[_0x54bb('0x23')](_0x1e5f28));if(_0x1e5f28[_0x54bb('0x24')]){if(_0x1e5f28[_0x54bb('0x24')][_0x54bb('0x25')]===0x1f4){logger[_0x54bb('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x59abeb,_0x1e5f28[_0x54bb('0x24')]['message']);return _0x2b07ef(_0x1e5f28[_0x54bb('0x24')][_0x54bb('0x26')]);}logger['error'](_0x54bb('0x20'),_0x59abeb,_0x1e5f28['error'][_0x54bb('0x26')]);return _0x2e1616(_0x1e5f28[_0x54bb('0x24')][_0x54bb('0x26')]);}else{logger[_0x54bb('0x27')]('Dynamics365Configuration,\x20%s,\x20%s',_0x59abeb,_0x54bb('0x21'));_0x2e1616(_0x1e5f28[_0x54bb('0x28')][_0x54bb('0x26')]);}})['catch'](function(_0x1588ad){logger[_0x54bb('0x24')](_0x54bb('0x20'),_0x59abeb,_0x1588ad);_0x2b07ef(_0x1588ad);});});}function respondWithStatusCode(_0x162e51,_0x277abe){_0x277abe=_0x277abe||0xcc;return function(_0x4da77b){if(_0x4da77b){return _0x162e51[_0x54bb('0x29')](_0x277abe);}return _0x162e51[_0x54bb('0x2a')](_0x277abe)[_0x54bb('0x2b')]();};}function respondWithResult(_0x7cb073,_0x29b641){_0x29b641=_0x29b641||0xc8;return function(_0x39e2d4){if(_0x39e2d4){return _0x7cb073['status'](_0x29b641)[_0x54bb('0x2c')](_0x39e2d4);}};}function respondWithFilteredResult(_0x33ce40,_0x4c8292){return function(_0x2199cf){if(_0x2199cf){var _0x121254=_0x2199cf[_0x54bb('0x2d')],_0xadef31=_0x4c8292['offset'],_0x58cd05=_0x4c8292[_0x54bb('0x2e')]+_0x4c8292[_0x54bb('0x2f')],_0x147774;if(_0x58cd05>=_0x121254){_0x58cd05=_0x121254;_0x147774=0xc8;}else{_0x147774=0xce;}_0x33ce40[_0x54bb('0x2a')](_0x147774);return _0x33ce40['set']('Content-Range',_0xadef31+'-'+_0x58cd05+'/'+_0x121254)['json'](_0x2199cf);}return null;};}function patchUpdates(_0x4bfeca){return function(_0x3498d0){try{jsonpatch[_0x54bb('0x30')](_0x3498d0,_0x4bfeca,!![]);}catch(_0x2dd5a7){return BPromise['reject'](_0x2dd5a7);}return _0x3498d0[_0x54bb('0x31')]();};}function saveUpdates(_0x554fea,_0x59d526){return function(_0x4f8ac2){if(_0x4f8ac2){return _0x4f8ac2['update'](_0x554fea)[_0x54bb('0x32')](function(_0x40d4a0){return _0x40d4a0;});}return null;};}function removeEntity(_0x474ce9,_0x4e672a){return function(_0x39c860){if(_0x39c860){return _0x39c860[_0x54bb('0x33')]()[_0x54bb('0x32')](function(){_0x474ce9[_0x54bb('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e9d5,_0x181ff5){return function(_0x585fab){if(!_0x585fab){_0x44e9d5['sendStatus'](0x194);}return _0x585fab;};}function handleError(_0x31f5ac,_0x5a2e49){_0x5a2e49=_0x5a2e49||0x1f4;return function(_0x215891){logger[_0x54bb('0x24')](_0x215891[_0x54bb('0x34')]);if(_0x215891[_0x54bb('0x35')]){delete _0x215891[_0x54bb('0x35')];}_0x31f5ac['status'](_0x5a2e49)[_0x54bb('0x36')](_0x215891);};}exports[_0x54bb('0x37')]=function(_0x45deae,_0x4fbc03){var _0x4d6130={},_0x3ccd4c={},_0x4ac5df={'count':0x0,'rows':[]};var _0x37a6d8=_[_0x54bb('0x38')](db[_0x54bb('0x39')][_0x54bb('0x3a')],function(_0x1c9668){return{'name':_0x1c9668[_0x54bb('0x3b')],'type':_0x1c9668['type'][_0x54bb('0x3c')]};});_0x3ccd4c[_0x54bb('0x3d')]=_[_0x54bb('0x38')](_0x37a6d8,_0x54bb('0x35'));_0x3ccd4c['query']=_['keys'](_0x45deae['query']);_0x3ccd4c['filters']=_[_0x54bb('0x3e')](_0x3ccd4c[_0x54bb('0x3d')],_0x3ccd4c[_0x54bb('0x3f')]);_0x4d6130[_0x54bb('0x40')]=_[_0x54bb('0x3e')](_0x3ccd4c[_0x54bb('0x3d')],qs[_0x54bb('0x41')](_0x45deae[_0x54bb('0x3f')][_0x54bb('0x41')]));_0x4d6130[_0x54bb('0x40')]=_0x4d6130[_0x54bb('0x40')][_0x54bb('0x42')]?_0x4d6130[_0x54bb('0x40')]:_0x3ccd4c[_0x54bb('0x3d')];if(!_0x45deae['query']['hasOwnProperty'](_0x54bb('0x43'))){_0x4d6130[_0x54bb('0x2f')]=qs['limit'](_0x45deae['query'][_0x54bb('0x2f')]);_0x4d6130[_0x54bb('0x2e')]=qs['offset'](_0x45deae[_0x54bb('0x3f')][_0x54bb('0x2e')]);}_0x4d6130[_0x54bb('0x44')]=qs['sort'](_0x45deae[_0x54bb('0x3f')][_0x54bb('0x45')]);_0x4d6130['where']=qs[_0x54bb('0x46')](_[_0x54bb('0x47')](_0x45deae[_0x54bb('0x3f')],_0x3ccd4c[_0x54bb('0x46')]));if(_0x45deae[_0x54bb('0x3f')][_0x54bb('0x48')]){_0x4d6130[_0x54bb('0x49')]=_[_0x54bb('0x4a')](_0x4d6130[_0x54bb('0x49')],{'$or':_['map'](_0x37a6d8,function(_0x432b95){if(_0x432b95[_0x54bb('0x4b')]!==_0x54bb('0x4c')){var _0x57554a={};_0x57554a[_0x432b95['name']]={'$like':'%'+_0x45deae[_0x54bb('0x3f')][_0x54bb('0x48')]+'%'};return _0x57554a;}})});}_0x4d6130=_[_0x54bb('0x4a')]({},_0x4d6130,_0x45deae['options']);var _0xeaad85={'where':_0x4d6130[_0x54bb('0x49')]};return db[_0x54bb('0x39')][_0x54bb('0x2d')](_0xeaad85)[_0x54bb('0x32')](function(_0x483f08){_0x4ac5df[_0x54bb('0x2d')]=_0x483f08;if(_0x45deae['query'][_0x54bb('0x4d')]){_0x4d6130[_0x54bb('0x4e')]=[{'all':!![]}];}return db[_0x54bb('0x39')][_0x54bb('0x4f')](_0x4d6130);})['then'](function(_0x5cb82c){_0x4ac5df[_0x54bb('0x50')]=_0x5cb82c;return _0x4ac5df;})[_0x54bb('0x32')](respondWithFilteredResult(_0x4fbc03,_0x4d6130))[_0x54bb('0x51')](handleError(_0x4fbc03,null));};exports[_0x54bb('0x52')]=function(_0x1caad8,_0x20b40b){var _0x412214={'raw':![],'where':{'id':_0x1caad8[_0x54bb('0x53')]['id']}},_0x19c3db={};_0x19c3db['model']=_[_0x54bb('0x54')](db[_0x54bb('0x39')]['rawAttributes']);_0x19c3db[_0x54bb('0x3f')]=_[_0x54bb('0x54')](_0x1caad8[_0x54bb('0x3f')]);_0x19c3db['filters']=_['intersection'](_0x19c3db[_0x54bb('0x3d')],_0x19c3db[_0x54bb('0x3f')]);_0x412214[_0x54bb('0x40')]=_[_0x54bb('0x3e')](_0x19c3db['model'],qs[_0x54bb('0x41')](_0x1caad8[_0x54bb('0x3f')][_0x54bb('0x41')]));_0x412214['attributes']=_0x412214[_0x54bb('0x40')][_0x54bb('0x42')]?_0x412214[_0x54bb('0x40')]:_0x19c3db['model'];if(_0x1caad8[_0x54bb('0x3f')][_0x54bb('0x4d')]){_0x412214['include']=[{'all':!![]}];}_0x412214=_[_0x54bb('0x4a')]({},_0x412214,_0x1caad8['options']);return db['Dynamics365Configuration'][_0x54bb('0x55')](_0x412214)[_0x54bb('0x32')](handleEntityNotFound(_0x20b40b,null))[_0x54bb('0x32')](respondWithResult(_0x20b40b,null))[_0x54bb('0x51')](handleError(_0x20b40b,null));};exports['create']=function(_0x5ea3da,_0x2c7c59){return db['Dynamics365Configuration'][_0x54bb('0x56')](_0x5ea3da[_0x54bb('0x57')],{})[_0x54bb('0x32')](respondWithResult(_0x2c7c59,0xc9))[_0x54bb('0x51')](handleError(_0x2c7c59,null));};exports[_0x54bb('0x58')]=function(_0x4ecd74,_0x49890f){if(_0x4ecd74[_0x54bb('0x57')]['id']){delete _0x4ecd74[_0x54bb('0x57')]['id'];}return db[_0x54bb('0x39')]['find']({'where':{'id':_0x4ecd74[_0x54bb('0x53')]['id']}})[_0x54bb('0x32')](handleEntityNotFound(_0x49890f,null))[_0x54bb('0x32')](saveUpdates(_0x4ecd74['body'],null))[_0x54bb('0x32')](respondWithResult(_0x49890f,null))[_0x54bb('0x51')](handleError(_0x49890f,null));};exports[_0x54bb('0x33')]=function(_0x3efd1e,_0xa9372){return db[_0x54bb('0x39')][_0x54bb('0x55')]({'where':{'id':_0x3efd1e['params']['id']}})[_0x54bb('0x32')](handleEntityNotFound(_0xa9372,null))[_0x54bb('0x32')](removeEntity(_0xa9372,null))['catch'](handleError(_0xa9372,null));};exports[_0x54bb('0x59')]=function(_0x4f2964,_0x8ba552,_0x509c04){var _0x53bfb8={};var _0x16e0a3={};var _0x324055;var _0x8867eb;return db[_0x54bb('0x39')][_0x54bb('0x5a')]({'where':{'id':_0x4f2964['params']['id']}})[_0x54bb('0x32')](handleEntityNotFound(_0x8ba552,null))['then'](function(_0x4890a8){if(_0x4890a8){_0x324055=_0x4890a8;_0x16e0a3[_0x54bb('0x3d')]=_['keys'](db[_0x54bb('0x5b')][_0x54bb('0x3a')]);_0x16e0a3[_0x54bb('0x3f')]=_[_0x54bb('0x54')](_0x4f2964[_0x54bb('0x3f')]);_0x16e0a3[_0x54bb('0x46')]=_[_0x54bb('0x3e')](_0x16e0a3[_0x54bb('0x3d')],_0x16e0a3['query']);_0x53bfb8[_0x54bb('0x40')]=_[_0x54bb('0x3e')](_0x16e0a3[_0x54bb('0x3d')],qs[_0x54bb('0x41')](_0x4f2964[_0x54bb('0x3f')]['fields']));_0x53bfb8[_0x54bb('0x40')]=_0x53bfb8[_0x54bb('0x40')]['length']?_0x53bfb8[_0x54bb('0x40')]:_0x16e0a3[_0x54bb('0x3d')];_0x53bfb8[_0x54bb('0x44')]=qs[_0x54bb('0x45')](_0x4f2964[_0x54bb('0x3f')][_0x54bb('0x45')]);_0x53bfb8[_0x54bb('0x49')]=qs[_0x54bb('0x46')](_[_0x54bb('0x47')](_0x4f2964[_0x54bb('0x3f')],_0x16e0a3[_0x54bb('0x46')]));if(_0x4f2964['query'][_0x54bb('0x48')]){_0x53bfb8[_0x54bb('0x49')]=_['merge'](_0x53bfb8[_0x54bb('0x49')],{'$or':_[_0x54bb('0x38')](_0x53bfb8[_0x54bb('0x40')],function(_0x31470e){var _0x12c52f={};_0x12c52f[_0x31470e]={'$like':'%'+_0x4f2964['query'][_0x54bb('0x48')]+'%'};return _0x12c52f;})});}_0x53bfb8=_['merge']({},_0x53bfb8,_0x4f2964['options']);return _0x324055[_0x54bb('0x59')](_0x53bfb8);}})['then'](function(_0x19fb83){if(_0x19fb83){_0x8867eb=_0x19fb83[_0x54bb('0x42')];if(!_0x4f2964['query'][_0x54bb('0x5c')](_0x54bb('0x43'))){_0x53bfb8[_0x54bb('0x2f')]=qs['limit'](_0x4f2964[_0x54bb('0x3f')][_0x54bb('0x2f')]);_0x53bfb8['offset']=qs[_0x54bb('0x2e')](_0x4f2964[_0x54bb('0x3f')][_0x54bb('0x2e')]);}return _0x324055[_0x54bb('0x59')](_0x53bfb8);}})[_0x54bb('0x32')](function(_0x20ec05){if(_0x20ec05){return _0x20ec05?{'count':_0x8867eb,'rows':_0x20ec05}:null;}})['then'](respondWithResult(_0x8ba552,null))['catch'](handleError(_0x8ba552,null));};exports[_0x54bb('0x5d')]=function(_0x45abfb,_0x35dddd,_0x2d370a){var _0x4c60f3={};var _0x1fa951={};var _0x4c6beb;var _0x306839;return db[_0x54bb('0x39')][_0x54bb('0x5a')]({'where':{'id':_0x45abfb[_0x54bb('0x53')]['id']}})['then'](handleEntityNotFound(_0x35dddd,null))[_0x54bb('0x32')](function(_0x94aef5){if(_0x94aef5){_0x4c6beb=_0x94aef5;_0x1fa951[_0x54bb('0x3d')]=_['keys'](db['Dynamics365Field'][_0x54bb('0x3a')]);_0x1fa951[_0x54bb('0x3f')]=_[_0x54bb('0x54')](_0x45abfb[_0x54bb('0x3f')]);_0x1fa951[_0x54bb('0x46')]=_[_0x54bb('0x3e')](_0x1fa951[_0x54bb('0x3d')],_0x1fa951[_0x54bb('0x3f')]);_0x4c60f3[_0x54bb('0x40')]=_[_0x54bb('0x3e')](_0x1fa951[_0x54bb('0x3d')],qs['fields'](_0x45abfb[_0x54bb('0x3f')][_0x54bb('0x41')]));_0x4c60f3[_0x54bb('0x40')]=_0x4c60f3[_0x54bb('0x40')][_0x54bb('0x42')]?_0x4c60f3[_0x54bb('0x40')]:_0x1fa951[_0x54bb('0x3d')];_0x4c60f3[_0x54bb('0x44')]=qs[_0x54bb('0x45')](_0x45abfb[_0x54bb('0x3f')][_0x54bb('0x45')]);_0x4c60f3[_0x54bb('0x49')]=qs[_0x54bb('0x46')](_[_0x54bb('0x47')](_0x45abfb[_0x54bb('0x3f')],_0x1fa951['filters']));if(_0x45abfb[_0x54bb('0x3f')][_0x54bb('0x48')]){_0x4c60f3[_0x54bb('0x49')]=_[_0x54bb('0x4a')](_0x4c60f3[_0x54bb('0x49')],{'$or':_[_0x54bb('0x38')](_0x4c60f3[_0x54bb('0x40')],function(_0xe8df0){var _0x16fce3={};_0x16fce3[_0xe8df0]={'$like':'%'+_0x45abfb['query'][_0x54bb('0x48')]+'%'};return _0x16fce3;})});}_0x4c60f3=_[_0x54bb('0x4a')]({},_0x4c60f3,_0x45abfb[_0x54bb('0x5e')]);return _0x4c6beb[_0x54bb('0x5d')](_0x4c60f3);}})['then'](function(_0x52e46a){if(_0x52e46a){_0x306839=_0x52e46a['length'];if(!_0x45abfb['query'][_0x54bb('0x5c')]('nolimit')){_0x4c60f3['limit']=qs['limit'](_0x45abfb[_0x54bb('0x3f')][_0x54bb('0x2f')]);_0x4c60f3['offset']=qs['offset'](_0x45abfb[_0x54bb('0x3f')][_0x54bb('0x2e')]);}return _0x4c6beb[_0x54bb('0x5d')](_0x4c60f3);}})['then'](function(_0xb02bb){if(_0xb02bb){return _0xb02bb?{'count':_0x306839,'rows':_0xb02bb}:null;}})[_0x54bb('0x32')](respondWithResult(_0x35dddd,null))[_0x54bb('0x51')](handleError(_0x35dddd,null));};exports[_0x54bb('0x5f')]=function(_0x3aa54c,_0x24bb6b,_0x3ad18b){var _0x192452={};var _0x2e14ed={};var _0x378edd;var _0x3af6e3;return db[_0x54bb('0x39')][_0x54bb('0x5a')]({'where':{'id':_0x3aa54c[_0x54bb('0x53')]['id']}})[_0x54bb('0x32')](handleEntityNotFound(_0x24bb6b,null))[_0x54bb('0x32')](function(_0x5ee572){if(_0x5ee572){_0x378edd=_0x5ee572;_0x2e14ed[_0x54bb('0x3d')]=_[_0x54bb('0x54')](db[_0x54bb('0x5b')][_0x54bb('0x3a')]);_0x2e14ed['query']=_[_0x54bb('0x54')](_0x3aa54c[_0x54bb('0x3f')]);_0x2e14ed['filters']=_[_0x54bb('0x3e')](_0x2e14ed[_0x54bb('0x3d')],_0x2e14ed['query']);_0x192452[_0x54bb('0x40')]=_[_0x54bb('0x3e')](_0x2e14ed[_0x54bb('0x3d')],qs[_0x54bb('0x41')](_0x3aa54c[_0x54bb('0x3f')]['fields']));_0x192452[_0x54bb('0x40')]=_0x192452[_0x54bb('0x40')]['length']?_0x192452[_0x54bb('0x40')]:_0x2e14ed[_0x54bb('0x3d')];_0x192452[_0x54bb('0x44')]=qs[_0x54bb('0x45')](_0x3aa54c[_0x54bb('0x3f')][_0x54bb('0x45')]);_0x192452[_0x54bb('0x49')]=qs['filters'](_['pick'](_0x3aa54c[_0x54bb('0x3f')],_0x2e14ed[_0x54bb('0x46')]));if(_0x3aa54c['query'][_0x54bb('0x48')]){_0x192452[_0x54bb('0x49')]=_[_0x54bb('0x4a')](_0x192452[_0x54bb('0x49')],{'$or':_[_0x54bb('0x38')](_0x192452[_0x54bb('0x40')],function(_0x51cfc4){var _0x2d90d={};_0x2d90d[_0x51cfc4]={'$like':'%'+_0x3aa54c['query'][_0x54bb('0x48')]+'%'};return _0x2d90d;})});}_0x192452=_[_0x54bb('0x4a')]({},_0x192452,_0x3aa54c['options']);return _0x378edd['getDescriptions'](_0x192452);}})[_0x54bb('0x32')](function(_0x3f3276){if(_0x3f3276){_0x3af6e3=_0x3f3276[_0x54bb('0x42')];if(!_0x3aa54c[_0x54bb('0x3f')]['hasOwnProperty'](_0x54bb('0x43'))){_0x192452[_0x54bb('0x2f')]=qs[_0x54bb('0x2f')](_0x3aa54c[_0x54bb('0x3f')][_0x54bb('0x2f')]);_0x192452['offset']=qs[_0x54bb('0x2e')](_0x3aa54c[_0x54bb('0x3f')][_0x54bb('0x2e')]);}return _0x378edd['getDescriptions'](_0x192452);}})[_0x54bb('0x32')](function(_0x1fda88){if(_0x1fda88){return _0x1fda88?{'count':_0x3af6e3,'rows':_0x1fda88}:null;}})['then'](respondWithResult(_0x24bb6b,null))['catch'](handleError(_0x24bb6b,null));}; \ No newline at end of file +var _0x8471=['save','update','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','Dynamics365Configuration','findAll','rows','show','params','intersection','find','create','body','getFields','findOne','Dynamics365Field','order','sort','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x34ca94,_0x3e5520){var _0x410b9d=function(_0x2c03d1){while(--_0x2c03d1){_0x34ca94['push'](_0x34ca94['shift']());}};_0x410b9d(++_0x3e5520);}(_0x8471,0x13a));var _0x1847=function(_0x51f647,_0x343299){_0x51f647=_0x51f647-0x0;var _0xca0407=_0x8471[_0x51f647];return _0xca0407;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1847('0x0'));var rimraf=require(_0x1847('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1847('0x2'));var rp=require(_0x1847('0x3'));var moment=require('moment');var BPromise=require(_0x1847('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1847('0x5'));var sox=require(_0x1847('0x6'));var csv=require(_0x1847('0x7'));var ejs=require(_0x1847('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1847('0x9'));var crypto=require(_0x1847('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1847('0xb'));var toCsv=require(_0x1847('0x7'));var querystring=require('querystring');var Papa=require(_0x1847('0xc'));var Redis=require(_0x1847('0xd'));var authService=require(_0x1847('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1847('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1847('0x10'))(_0x1847('0x11'));var utils=require(_0x1847('0x12'));var config=require(_0x1847('0x13'));var db=require(_0x1847('0x14'))['db'];var jayson=require(_0x1847('0x15'));var client=jayson['client'][_0x1847('0x16')]({'port':0x232a});function checkPasswordPattern(_0x5658d6,_0x12e327,_0x13343b){if(_0x13343b){var _0x1af97b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1af97b[_0x1847('0x17')](_0x12e327)){return _0x5658d6;}else{throw new db[(_0x1847('0x18'))][(_0x1847('0x19'))](_0x1847('0x1a'));}}else{return _0x5658d6;}}function respondWithRpcPromise(_0x52be49,_0xf6a99d,_0x1bfac4,_0x1cb79e){return new BPromise(function(_0x3ff238,_0x3d5b53){var _0xafd90d=_0x1cb79e||client;return _0xafd90d['request'](_0x52be49,_0x1bfac4)[_0x1847('0x1b')](function(_0x26aab8){logger[_0x1847('0x1c')](_0x1847('0x1d'),_0xf6a99d,_0x1847('0x1e'));logger['debug'](_0x1847('0x1f'),_0xf6a99d,_0x1847('0x1e'),JSON[_0x1847('0x20')](_0x26aab8));if(_0x26aab8[_0x1847('0x21')]){if(_0x26aab8[_0x1847('0x21')]['code']===0x1f4){logger[_0x1847('0x21')](_0x1847('0x1d'),_0xf6a99d,_0x26aab8[_0x1847('0x21')][_0x1847('0x22')]);return _0x3d5b53(_0x26aab8[_0x1847('0x21')]['message']);}logger[_0x1847('0x21')](_0x1847('0x1d'),_0xf6a99d,_0x26aab8[_0x1847('0x21')][_0x1847('0x22')]);return _0x3ff238(_0x26aab8[_0x1847('0x21')]['message']);}else{logger[_0x1847('0x1c')](_0x1847('0x1d'),_0xf6a99d,_0x1847('0x1e'));_0x3ff238(_0x26aab8[_0x1847('0x23')][_0x1847('0x22')]);}})[_0x1847('0x24')](function(_0x46ebce){logger[_0x1847('0x21')](_0x1847('0x1d'),_0xf6a99d,_0x46ebce);_0x3d5b53(_0x46ebce);});});}function respondWithStatusCode(_0x2904c7,_0x56bfd0){_0x56bfd0=_0x56bfd0||0xcc;return function(_0x3caf14){if(_0x3caf14){return _0x2904c7['sendStatus'](_0x56bfd0);}return _0x2904c7['status'](_0x56bfd0)[_0x1847('0x25')]();};}function respondWithResult(_0x5b9d94,_0x1875f0){_0x1875f0=_0x1875f0||0xc8;return function(_0x45014e){if(_0x45014e){return _0x5b9d94[_0x1847('0x26')](_0x1875f0)[_0x1847('0x27')](_0x45014e);}};}function respondWithFilteredResult(_0x2afdef,_0x3909df){return function(_0x1398b7){if(_0x1398b7){var _0x44cfb4=_0x1398b7[_0x1847('0x28')],_0xa52044=_0x3909df[_0x1847('0x29')],_0xe5686b=_0x3909df[_0x1847('0x29')]+_0x3909df[_0x1847('0x2a')],_0x42fb76;if(_0xe5686b>=_0x44cfb4){_0xe5686b=_0x44cfb4;_0x42fb76=0xc8;}else{_0x42fb76=0xce;}_0x2afdef['status'](_0x42fb76);return _0x2afdef['set'](_0x1847('0x2b'),_0xa52044+'-'+_0xe5686b+'/'+_0x44cfb4)[_0x1847('0x27')](_0x1398b7);}return null;};}function patchUpdates(_0x518e3e){return function(_0x40b5d9){try{jsonpatch[_0x1847('0x2c')](_0x40b5d9,_0x518e3e,!![]);}catch(_0x3b6842){return BPromise[_0x1847('0x2d')](_0x3b6842);}return _0x40b5d9[_0x1847('0x2e')]();};}function saveUpdates(_0x4eaefc,_0x486d19){return function(_0x1c384f){if(_0x1c384f){return _0x1c384f[_0x1847('0x2f')](_0x4eaefc)[_0x1847('0x1b')](function(_0x42c570){return _0x42c570;});}return null;};}function removeEntity(_0x4b133a,_0x33018e){return function(_0xad874d){if(_0xad874d){return _0xad874d[_0x1847('0x30')]()['then'](function(){_0x4b133a[_0x1847('0x26')](0xcc)[_0x1847('0x25')]();});}};}function handleEntityNotFound(_0x400022,_0x465286){return function(_0x825b8b){if(!_0x825b8b){_0x400022[_0x1847('0x31')](0x194);}return _0x825b8b;};}function handleError(_0x193aaa,_0x3bdff5){_0x3bdff5=_0x3bdff5||0x1f4;return function(_0x43172a){logger[_0x1847('0x21')](_0x43172a[_0x1847('0x32')]);if(_0x43172a[_0x1847('0x33')]){delete _0x43172a[_0x1847('0x33')];}_0x193aaa['status'](_0x3bdff5)[_0x1847('0x34')](_0x43172a);};}exports['index']=function(_0xcb53e1,_0x1ffa5f){var _0x63371e={},_0x2be5be={},_0x51fbd2={'count':0x0,'rows':[]};var _0x59bed9=_['map'](db['Dynamics365Configuration'][_0x1847('0x35')],function(_0x19cd7f){return{'name':_0x19cd7f[_0x1847('0x36')],'type':_0x19cd7f[_0x1847('0x37')][_0x1847('0x38')]};});_0x2be5be['model']=_[_0x1847('0x39')](_0x59bed9,_0x1847('0x33'));_0x2be5be[_0x1847('0x3a')]=_[_0x1847('0x3b')](_0xcb53e1[_0x1847('0x3a')]);_0x2be5be[_0x1847('0x3c')]=_['intersection'](_0x2be5be[_0x1847('0x3d')],_0x2be5be[_0x1847('0x3a')]);_0x63371e[_0x1847('0x3e')]=_['intersection'](_0x2be5be[_0x1847('0x3d')],qs[_0x1847('0x3f')](_0xcb53e1[_0x1847('0x3a')][_0x1847('0x3f')]));_0x63371e[_0x1847('0x3e')]=_0x63371e[_0x1847('0x3e')][_0x1847('0x40')]?_0x63371e['attributes']:_0x2be5be[_0x1847('0x3d')];if(!_0xcb53e1[_0x1847('0x3a')][_0x1847('0x41')](_0x1847('0x42'))){_0x63371e[_0x1847('0x2a')]=qs[_0x1847('0x2a')](_0xcb53e1['query'][_0x1847('0x2a')]);_0x63371e['offset']=qs['offset'](_0xcb53e1[_0x1847('0x3a')]['offset']);}_0x63371e['order']=qs['sort'](_0xcb53e1[_0x1847('0x3a')]['sort']);_0x63371e[_0x1847('0x43')]=qs['filters'](_[_0x1847('0x44')](_0xcb53e1[_0x1847('0x3a')],_0x2be5be[_0x1847('0x3c')]));if(_0xcb53e1[_0x1847('0x3a')][_0x1847('0x45')]){_0x63371e[_0x1847('0x43')]=_[_0x1847('0x46')](_0x63371e[_0x1847('0x43')],{'$or':_[_0x1847('0x39')](_0x59bed9,function(_0xb21398){if(_0xb21398['type']!=='VIRTUAL'){var _0x56d43c={};_0x56d43c[_0xb21398[_0x1847('0x33')]]={'$like':'%'+_0xcb53e1['query']['filter']+'%'};return _0x56d43c;}})});}_0x63371e=_[_0x1847('0x46')]({},_0x63371e,_0xcb53e1[_0x1847('0x47')]);var _0x48212a={'where':_0x63371e[_0x1847('0x43')]};return db['Dynamics365Configuration'][_0x1847('0x28')](_0x48212a)[_0x1847('0x1b')](function(_0x215fb9){_0x51fbd2['count']=_0x215fb9;if(_0xcb53e1[_0x1847('0x3a')][_0x1847('0x48')]){_0x63371e[_0x1847('0x49')]=[{'all':!![]}];}return db[_0x1847('0x4a')][_0x1847('0x4b')](_0x63371e);})[_0x1847('0x1b')](function(_0x21ba18){_0x51fbd2[_0x1847('0x4c')]=_0x21ba18;return _0x51fbd2;})[_0x1847('0x1b')](respondWithFilteredResult(_0x1ffa5f,_0x63371e))['catch'](handleError(_0x1ffa5f,null));};exports[_0x1847('0x4d')]=function(_0x3df8d4,_0x335f6c){var _0x4fa3e8={'raw':![],'where':{'id':_0x3df8d4[_0x1847('0x4e')]['id']}},_0x1b9004={};_0x1b9004[_0x1847('0x3d')]=_[_0x1847('0x3b')](db[_0x1847('0x4a')]['rawAttributes']);_0x1b9004[_0x1847('0x3a')]=_[_0x1847('0x3b')](_0x3df8d4['query']);_0x1b9004['filters']=_[_0x1847('0x4f')](_0x1b9004[_0x1847('0x3d')],_0x1b9004[_0x1847('0x3a')]);_0x4fa3e8['attributes']=_[_0x1847('0x4f')](_0x1b9004['model'],qs['fields'](_0x3df8d4[_0x1847('0x3a')][_0x1847('0x3f')]));_0x4fa3e8[_0x1847('0x3e')]=_0x4fa3e8[_0x1847('0x3e')][_0x1847('0x40')]?_0x4fa3e8[_0x1847('0x3e')]:_0x1b9004[_0x1847('0x3d')];if(_0x3df8d4[_0x1847('0x3a')]['includeAll']){_0x4fa3e8[_0x1847('0x49')]=[{'all':!![]}];}_0x4fa3e8=_[_0x1847('0x46')]({},_0x4fa3e8,_0x3df8d4['options']);return db['Dynamics365Configuration'][_0x1847('0x50')](_0x4fa3e8)['then'](handleEntityNotFound(_0x335f6c,null))[_0x1847('0x1b')](respondWithResult(_0x335f6c,null))[_0x1847('0x24')](handleError(_0x335f6c,null));};exports[_0x1847('0x51')]=function(_0xc4bc87,_0x594898){return db[_0x1847('0x4a')][_0x1847('0x51')](_0xc4bc87[_0x1847('0x52')],{})['then'](respondWithResult(_0x594898,0xc9))[_0x1847('0x24')](handleError(_0x594898,null));};exports[_0x1847('0x2f')]=function(_0x1e6eab,_0x292175){if(_0x1e6eab[_0x1847('0x52')]['id']){delete _0x1e6eab['body']['id'];}return db[_0x1847('0x4a')]['find']({'where':{'id':_0x1e6eab[_0x1847('0x4e')]['id']}})['then'](handleEntityNotFound(_0x292175,null))['then'](saveUpdates(_0x1e6eab[_0x1847('0x52')],null))['then'](respondWithResult(_0x292175,null))[_0x1847('0x24')](handleError(_0x292175,null));};exports[_0x1847('0x30')]=function(_0x55df3f,_0x6891f8){return db[_0x1847('0x4a')][_0x1847('0x50')]({'where':{'id':_0x55df3f[_0x1847('0x4e')]['id']}})[_0x1847('0x1b')](handleEntityNotFound(_0x6891f8,null))[_0x1847('0x1b')](removeEntity(_0x6891f8,null))[_0x1847('0x24')](handleError(_0x6891f8,null));};exports[_0x1847('0x53')]=function(_0xc47cb6,_0x4f6033,_0x1b33b9){var _0x101c95={};var _0x4f9a9d={};var _0xa34261;var _0x134fdd;return db[_0x1847('0x4a')][_0x1847('0x54')]({'where':{'id':_0xc47cb6[_0x1847('0x4e')]['id']}})[_0x1847('0x1b')](handleEntityNotFound(_0x4f6033,null))[_0x1847('0x1b')](function(_0x580d74){if(_0x580d74){_0xa34261=_0x580d74;_0x4f9a9d['model']=_[_0x1847('0x3b')](db[_0x1847('0x55')][_0x1847('0x35')]);_0x4f9a9d['query']=_[_0x1847('0x3b')](_0xc47cb6[_0x1847('0x3a')]);_0x4f9a9d['filters']=_[_0x1847('0x4f')](_0x4f9a9d[_0x1847('0x3d')],_0x4f9a9d[_0x1847('0x3a')]);_0x101c95['attributes']=_[_0x1847('0x4f')](_0x4f9a9d[_0x1847('0x3d')],qs[_0x1847('0x3f')](_0xc47cb6[_0x1847('0x3a')][_0x1847('0x3f')]));_0x101c95[_0x1847('0x3e')]=_0x101c95[_0x1847('0x3e')][_0x1847('0x40')]?_0x101c95[_0x1847('0x3e')]:_0x4f9a9d[_0x1847('0x3d')];_0x101c95[_0x1847('0x56')]=qs[_0x1847('0x57')](_0xc47cb6['query']['sort']);_0x101c95[_0x1847('0x43')]=qs[_0x1847('0x3c')](_['pick'](_0xc47cb6['query'],_0x4f9a9d['filters']));if(_0xc47cb6[_0x1847('0x3a')][_0x1847('0x45')]){_0x101c95[_0x1847('0x43')]=_['merge'](_0x101c95[_0x1847('0x43')],{'$or':_[_0x1847('0x39')](_0x101c95['attributes'],function(_0x34be06){var _0x5dc618={};_0x5dc618[_0x34be06]={'$like':'%'+_0xc47cb6[_0x1847('0x3a')][_0x1847('0x45')]+'%'};return _0x5dc618;})});}_0x101c95=_[_0x1847('0x46')]({},_0x101c95,_0xc47cb6['options']);return _0xa34261[_0x1847('0x53')](_0x101c95);}})['then'](function(_0x50e9ea){if(_0x50e9ea){_0x134fdd=_0x50e9ea['length'];if(!_0xc47cb6[_0x1847('0x3a')][_0x1847('0x41')](_0x1847('0x42'))){_0x101c95[_0x1847('0x2a')]=qs['limit'](_0xc47cb6[_0x1847('0x3a')][_0x1847('0x2a')]);_0x101c95[_0x1847('0x29')]=qs['offset'](_0xc47cb6[_0x1847('0x3a')][_0x1847('0x29')]);}return _0xa34261[_0x1847('0x53')](_0x101c95);}})[_0x1847('0x1b')](function(_0x54dd66){if(_0x54dd66){return _0x54dd66?{'count':_0x134fdd,'rows':_0x54dd66}:null;}})[_0x1847('0x1b')](respondWithResult(_0x4f6033,null))[_0x1847('0x24')](handleError(_0x4f6033,null));};exports[_0x1847('0x58')]=function(_0x554df7,_0x2f9347,_0x18ff44){var _0x4d8ffa={};var _0x12c98f={};var _0x1bd798;var _0x23ed19;return db['Dynamics365Configuration'][_0x1847('0x54')]({'where':{'id':_0x554df7['params']['id']}})[_0x1847('0x1b')](handleEntityNotFound(_0x2f9347,null))[_0x1847('0x1b')](function(_0x54f1fd){if(_0x54f1fd){_0x1bd798=_0x54f1fd;_0x12c98f[_0x1847('0x3d')]=_[_0x1847('0x3b')](db[_0x1847('0x55')][_0x1847('0x35')]);_0x12c98f[_0x1847('0x3a')]=_[_0x1847('0x3b')](_0x554df7[_0x1847('0x3a')]);_0x12c98f['filters']=_[_0x1847('0x4f')](_0x12c98f[_0x1847('0x3d')],_0x12c98f['query']);_0x4d8ffa[_0x1847('0x3e')]=_[_0x1847('0x4f')](_0x12c98f[_0x1847('0x3d')],qs[_0x1847('0x3f')](_0x554df7[_0x1847('0x3a')][_0x1847('0x3f')]));_0x4d8ffa[_0x1847('0x3e')]=_0x4d8ffa[_0x1847('0x3e')]['length']?_0x4d8ffa['attributes']:_0x12c98f[_0x1847('0x3d')];_0x4d8ffa[_0x1847('0x56')]=qs['sort'](_0x554df7[_0x1847('0x3a')][_0x1847('0x57')]);_0x4d8ffa[_0x1847('0x43')]=qs['filters'](_[_0x1847('0x44')](_0x554df7[_0x1847('0x3a')],_0x12c98f['filters']));if(_0x554df7[_0x1847('0x3a')][_0x1847('0x45')]){_0x4d8ffa[_0x1847('0x43')]=_[_0x1847('0x46')](_0x4d8ffa['where'],{'$or':_[_0x1847('0x39')](_0x4d8ffa[_0x1847('0x3e')],function(_0x23fb22){var _0x58720f={};_0x58720f[_0x23fb22]={'$like':'%'+_0x554df7['query']['filter']+'%'};return _0x58720f;})});}_0x4d8ffa=_['merge']({},_0x4d8ffa,_0x554df7[_0x1847('0x47')]);return _0x1bd798['getSubjects'](_0x4d8ffa);}})[_0x1847('0x1b')](function(_0x19d038){if(_0x19d038){_0x23ed19=_0x19d038['length'];if(!_0x554df7[_0x1847('0x3a')][_0x1847('0x41')](_0x1847('0x42'))){_0x4d8ffa[_0x1847('0x2a')]=qs[_0x1847('0x2a')](_0x554df7['query'][_0x1847('0x2a')]);_0x4d8ffa[_0x1847('0x29')]=qs['offset'](_0x554df7['query'][_0x1847('0x29')]);}return _0x1bd798[_0x1847('0x58')](_0x4d8ffa);}})[_0x1847('0x1b')](function(_0x116093){if(_0x116093){return _0x116093?{'count':_0x23ed19,'rows':_0x116093}:null;}})['then'](respondWithResult(_0x2f9347,null))[_0x1847('0x24')](handleError(_0x2f9347,null));};exports['getDescriptions']=function(_0x287256,_0x4a1e93,_0x13a4ff){var _0x33a3a5={};var _0x2f3da7={};var _0x2f89bc;var _0xd399;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x287256['params']['id']}})['then'](handleEntityNotFound(_0x4a1e93,null))[_0x1847('0x1b')](function(_0x4ca50a){if(_0x4ca50a){_0x2f89bc=_0x4ca50a;_0x2f3da7['model']=_[_0x1847('0x3b')](db[_0x1847('0x55')]['rawAttributes']);_0x2f3da7[_0x1847('0x3a')]=_[_0x1847('0x3b')](_0x287256[_0x1847('0x3a')]);_0x2f3da7[_0x1847('0x3c')]=_[_0x1847('0x4f')](_0x2f3da7[_0x1847('0x3d')],_0x2f3da7[_0x1847('0x3a')]);_0x33a3a5[_0x1847('0x3e')]=_[_0x1847('0x4f')](_0x2f3da7[_0x1847('0x3d')],qs['fields'](_0x287256[_0x1847('0x3a')][_0x1847('0x3f')]));_0x33a3a5[_0x1847('0x3e')]=_0x33a3a5[_0x1847('0x3e')][_0x1847('0x40')]?_0x33a3a5[_0x1847('0x3e')]:_0x2f3da7[_0x1847('0x3d')];_0x33a3a5['order']=qs[_0x1847('0x57')](_0x287256[_0x1847('0x3a')][_0x1847('0x57')]);_0x33a3a5[_0x1847('0x43')]=qs[_0x1847('0x3c')](_[_0x1847('0x44')](_0x287256[_0x1847('0x3a')],_0x2f3da7[_0x1847('0x3c')]));if(_0x287256[_0x1847('0x3a')][_0x1847('0x45')]){_0x33a3a5[_0x1847('0x43')]=_[_0x1847('0x46')](_0x33a3a5[_0x1847('0x43')],{'$or':_[_0x1847('0x39')](_0x33a3a5[_0x1847('0x3e')],function(_0x202ff5){var _0x2d3ba2={};_0x2d3ba2[_0x202ff5]={'$like':'%'+_0x287256[_0x1847('0x3a')]['filter']+'%'};return _0x2d3ba2;})});}_0x33a3a5=_[_0x1847('0x46')]({},_0x33a3a5,_0x287256['options']);return _0x2f89bc[_0x1847('0x59')](_0x33a3a5);}})['then'](function(_0x4da2bf){if(_0x4da2bf){_0xd399=_0x4da2bf[_0x1847('0x40')];if(!_0x287256['query']['hasOwnProperty']('nolimit')){_0x33a3a5['limit']=qs[_0x1847('0x2a')](_0x287256[_0x1847('0x3a')]['limit']);_0x33a3a5['offset']=qs[_0x1847('0x29')](_0x287256[_0x1847('0x3a')][_0x1847('0x29')]);}return _0x2f89bc[_0x1847('0x59')](_0x33a3a5);}})['then'](function(_0x1e181f){if(_0x1e181f){return _0x1e181f?{'count':_0xd399,'rows':_0x1e181f}:null;}})[_0x1847('0x1b')](respondWithResult(_0x4a1e93,null))[_0x1847('0x24')](handleError(_0x4a1e93,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 74cf778..08882d7 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 _0xbc69=['Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf','./intDynamics365Configuration.attributes','exports','define'];(function(_0x2f358a,_0x511452){var _0x55c853=function(_0x1300ad){while(--_0x1300ad){_0x2f358a['push'](_0x2f358a['shift']());}};_0x55c853(++_0x511452);}(_0xbc69,0x178));var _0x9bc6=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbc69[_0x279d37];return _0x530173;};'use strict';var _=require(_0x9bc6('0x0'));var util=require('util');var logger=require(_0x9bc6('0x1'))(_0x9bc6('0x2'));var moment=require(_0x9bc6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bc6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bc6('0x5'));var config=require('../../config/environment');var attributes=require(_0x9bc6('0x6'));module[_0x9bc6('0x7')]=function(_0x1e4ce2,_0x326364){return _0x1e4ce2[_0x9bc6('0x8')](_0x9bc6('0x9'),attributes,{'tableName':_0x9bc6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc1d=['bluebird','request-promise','path','rimraf','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xcc1d,0x67));var _0xdcc1=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0xcc1d[_0x581960];return _0x4ee892;};'use strict';var _=require(_0xdcc1('0x0'));var util=require(_0xdcc1('0x1'));var logger=require(_0xdcc1('0x2'))(_0xdcc1('0x3'));var moment=require(_0xdcc1('0x4'));var BPromise=require(_0xdcc1('0x5'));var rp=require(_0xdcc1('0x6'));var fs=require('fs');var path=require(_0xdcc1('0x7'));var rimraf=require(_0xdcc1('0x8'));var config=require('../../config/environment');var attributes=require('./intDynamics365Configuration.attributes');module[_0xdcc1('0x9')]=function(_0x440818,_0x36f459){return _0x440818['define'](_0xdcc1('0xa'),attributes,{'tableName':_0xdcc1('0xb'),'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 5398f93..6cbd25c 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 _0x6200=['rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x41328e,_0x5d82f8){var _0x584d57=function(_0x416e8b){while(--_0x416e8b){_0x41328e['push'](_0x41328e['shift']());}};_0x584d57(++_0x5d82f8);}(_0x6200,0x196));var _0x0620=function(_0x19da32,_0x25c744){_0x19da32=_0x19da32-0x0;var _0xfc20be=_0x6200[_0x19da32];return _0xfc20be;};'use strict';var _=require(_0x0620('0x0'));var util=require(_0x0620('0x1'));var moment=require(_0x0620('0x2'));var BPromise=require(_0x0620('0x3'));var rs=require(_0x0620('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0620('0x5'))['db'];var utils=require(_0x0620('0x6'));var logger=require(_0x0620('0x7'))(_0x0620('0x8'));var config=require(_0x0620('0x9'));var jayson=require(_0x0620('0xa'));var client=jayson['client'][_0x0620('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fa81b,_0x4d6d98,_0x1a5dad){return new BPromise(function(_0x2e24ea,_0x243713){return client[_0x0620('0xc')](_0x3fa81b,_0x1a5dad)[_0x0620('0xd')](function(_0x4ee8a8){logger['info'](_0x0620('0xe'),_0x4d6d98,_0x0620('0xf'));logger[_0x0620('0x10')](_0x0620('0x11'),_0x4d6d98,'request\x20sent',JSON[_0x0620('0x12')](_0x4ee8a8));if(_0x4ee8a8[_0x0620('0x13')]){if(_0x4ee8a8[_0x0620('0x13')][_0x0620('0x14')]===0x1f4){logger[_0x0620('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4d6d98,_0x4ee8a8[_0x0620('0x13')]['message']);return _0x243713(_0x4ee8a8[_0x0620('0x13')]['message']);}logger[_0x0620('0x13')](_0x0620('0xe'),_0x4d6d98,_0x4ee8a8[_0x0620('0x13')]['message']);return _0x2e24ea(_0x4ee8a8[_0x0620('0x13')][_0x0620('0x15')]);}else{logger['info'](_0x0620('0xe'),_0x4d6d98,'request\x20sent');_0x2e24ea(_0x4ee8a8['result']['message']);}})[_0x0620('0x16')](function(_0x215d28){logger[_0x0620('0x13')](_0x0620('0xe'),_0x4d6d98,_0x215d28);_0x243713(_0x215d28);});});} \ No newline at end of file +var _0x6984=['lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4529b8,_0x43a13c){var _0x3412dc=function(_0xe64929){while(--_0xe64929){_0x4529b8['push'](_0x4529b8['shift']());}};_0x3412dc(++_0x43a13c);}(_0x6984,0x1a4));var _0x4698=function(_0x499caf,_0x34744f){_0x499caf=_0x499caf-0x0;var _0x47b9bb=_0x6984[_0x499caf];return _0x47b9bb;};'use strict';var _=require(_0x4698('0x0'));var util=require('util');var moment=require(_0x4698('0x1'));var BPromise=require(_0x4698('0x2'));var rs=require(_0x4698('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4698('0x4'));var logger=require(_0x4698('0x5'))(_0x4698('0x6'));var config=require(_0x4698('0x7'));var jayson=require(_0x4698('0x8'));var client=jayson['client'][_0x4698('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44a97f,_0x2793b9,_0x5bda7f){return new BPromise(function(_0x13d93f,_0x490a89){return client[_0x4698('0xa')](_0x44a97f,_0x5bda7f)[_0x4698('0xb')](function(_0x422d1b){logger[_0x4698('0xc')](_0x4698('0xd'),_0x2793b9,_0x4698('0xe'));logger[_0x4698('0xf')](_0x4698('0x10'),_0x2793b9,_0x4698('0xe'),JSON[_0x4698('0x11')](_0x422d1b));if(_0x422d1b[_0x4698('0x12')]){if(_0x422d1b['error']['code']===0x1f4){logger[_0x4698('0x12')](_0x4698('0xd'),_0x2793b9,_0x422d1b['error'][_0x4698('0x13')]);return _0x490a89(_0x422d1b[_0x4698('0x12')][_0x4698('0x13')]);}logger[_0x4698('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2793b9,_0x422d1b['error'][_0x4698('0x13')]);return _0x13d93f(_0x422d1b['error'][_0x4698('0x13')]);}else{logger[_0x4698('0xc')](_0x4698('0xd'),_0x2793b9,_0x4698('0xe'));_0x13d93f(_0x422d1b[_0x4698('0x14')][_0x4698('0x13')]);}})['catch'](function(_0x2dc477){logger['error'](_0x4698('0xd'),_0x2793b9,_0x2dc477);_0x490a89(_0x2dc477);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 7b2683d..b318555 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 _0xe14d=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports'];(function(_0x497844,_0x40738d){var _0x20c1ca=function(_0x3d981b){while(--_0x3d981b){_0x497844['push'](_0x497844['shift']());}};_0x20c1ca(++_0x40738d);}(_0xe14d,0x1ee));var _0xde14=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xe14d[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var auth=require(_0xde14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde14('0x6'));var controller=require(_0xde14('0x7'));router[_0xde14('0x8')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xde14('0xb')]);router[_0xde14('0xc')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0xe')](_0xde14('0xf'),auth[_0xde14('0x9')](),controller[_0xde14('0x10')]);router['delete'](_0xde14('0xf'),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);module[_0xde14('0x12')]=router; \ No newline at end of file +var _0x1d2d=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./intDynamics365Field.controller'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x5d012c,_0x5aad68){_0x5d012c=_0x5d012c-0x0;var _0x36461d=_0x1d2d[_0x5d012c];return _0x36461d;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var auth=require(_0xd1d2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1d2('0x6'));router[_0xd1d2('0x7')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x9')]);router[_0xd1d2('0x7')](_0xd1d2('0xa'),auth['isAuthenticated'](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0xc')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0xe')](_0xd1d2('0xa'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')](_0xd1d2('0xa'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x11')]);module[_0xd1d2('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 366fe14..eff74cb 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 _0x9756=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x11ed90,_0x419625){var _0x43c6ec=function(_0x1a8288){while(--_0x1a8288){_0x11ed90['push'](_0x11ed90['shift']());}};_0x43c6ec(++_0x419625);}(_0x9756,0x108));var _0x6975=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x9756[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x6975('0x0'));module[_0x6975('0x1')]={'type':{'type':Sequelize[_0x6975('0x2')](_0x6975('0x3'),'variable',_0x6975('0x4'),_0x6975('0x5')),'defaultValue':_0x6975('0x3')},'content':{'type':Sequelize[_0x6975('0x6')]},'key':{'type':Sequelize[_0x6975('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x6975('0x3'),_0x6975('0x7'),_0x6975('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6975('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6975('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc298=['keyValue','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x2509f1,_0x5c9f8c){var _0x410842=function(_0x1b1eeb){while(--_0x1b1eeb){_0x2509f1['push'](_0x2509f1['shift']());}};_0x410842(++_0x5c9f8c);}(_0xc298,0x143));var _0x8c29=function(_0x1dbb88,_0x54422c){_0x1dbb88=_0x1dbb88-0x0;var _0x501fb0=_0xc298[_0x1dbb88];return _0x501fb0;};'use strict';var Sequelize=require('sequelize');module[_0x8c29('0x0')]={'type':{'type':Sequelize[_0x8c29('0x1')](_0x8c29('0x2'),_0x8c29('0x3'),_0x8c29('0x4'),_0x8c29('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8c29('0x6')]},'key':{'type':Sequelize[_0x8c29('0x6')]},'keyType':{'type':Sequelize[_0x8c29('0x1')](_0x8c29('0x2'),_0x8c29('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8c29('0x6')]},'idField':{'type':Sequelize[_0x8c29('0x6')]},'nameField':{'type':Sequelize[_0x8c29('0x6')]},'customField':{'type':Sequelize[_0x8c29('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c29('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5772669..c7cd2a9 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 _0xc0d7=['ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','name','send','index','map','Dynamics365Field','type','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge','filter','include','findAll','catch','show','params','keys','length','includeAll','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x332e61,_0x2d60a8){var _0x2abe8d=function(_0x782a1b){while(--_0x782a1b){_0x332e61['push'](_0x332e61['shift']());}};_0x2abe8d(++_0x2d60a8);}(_0xc0d7,0x7f));var _0x7c0d=function(_0xed010d,_0x45711b){_0xed010d=_0xed010d-0x0;var _0x2e63fd=_0xc0d7[_0xed010d];return _0x2e63fd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c0d('0x0'));var jsonpatch=require(_0x7c0d('0x1'));var rp=require(_0x7c0d('0x2'));var moment=require(_0x7c0d('0x3'));var BPromise=require(_0x7c0d('0x4'));var Mustache=require(_0x7c0d('0x5'));var util=require(_0x7c0d('0x6'));var path=require(_0x7c0d('0x7'));var sox=require(_0x7c0d('0x8'));var csv=require('to-csv');var ejs=require(_0x7c0d('0x9'));var fs=require('fs');var _=require(_0x7c0d('0xa'));var squel=require(_0x7c0d('0xb'));var crypto=require(_0x7c0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7c0d('0xd'));var toCsv=require(_0x7c0d('0xe'));var querystring=require(_0x7c0d('0xf'));var Papa=require(_0x7c0d('0x10'));var Redis=require('ioredis');var authService=require(_0x7c0d('0x11'));var qs=require(_0x7c0d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c0d('0x13'))(_0x7c0d('0x14'));var utils=require('../../config/utils');var config=require(_0x7c0d('0x15'));var db=require(_0x7c0d('0x16'))['db'];function respondWithStatusCode(_0x31b829,_0x198dde){_0x198dde=_0x198dde||0xcc;return function(_0x41236d){if(_0x41236d){return _0x31b829[_0x7c0d('0x17')](_0x198dde);}return _0x31b829['status'](_0x198dde)[_0x7c0d('0x18')]();};}function respondWithResult(_0x3d2a6b,_0x2ee593){_0x2ee593=_0x2ee593||0xc8;return function(_0x25c4a8){if(_0x25c4a8){return _0x3d2a6b[_0x7c0d('0x19')](_0x2ee593)[_0x7c0d('0x1a')](_0x25c4a8);}};}function respondWithFilteredResult(_0x9c965b,_0x13f301){return function(_0x4a5fb4){if(_0x4a5fb4){var _0x340937=_0x4a5fb4[_0x7c0d('0x1b')],_0x4e9850=_0x13f301[_0x7c0d('0x1c')],_0x20bf75=_0x13f301[_0x7c0d('0x1c')]+_0x13f301[_0x7c0d('0x1d')],_0x571480;if(_0x20bf75>=_0x340937){_0x20bf75=_0x340937;_0x571480=0xc8;}else{_0x571480=0xce;}_0x9c965b[_0x7c0d('0x19')](_0x571480);return _0x9c965b[_0x7c0d('0x1e')](_0x7c0d('0x1f'),_0x4e9850+'-'+_0x20bf75+'/'+_0x340937)[_0x7c0d('0x1a')](_0x4a5fb4);}return null;};}function patchUpdates(_0x34f2ef){return function(_0xf0657e){try{jsonpatch[_0x7c0d('0x20')](_0xf0657e,_0x34f2ef,!![]);}catch(_0x2e3f30){return BPromise[_0x7c0d('0x21')](_0x2e3f30);}return _0xf0657e[_0x7c0d('0x22')]();};}function saveUpdates(_0x407f52,_0x12e19a){return function(_0x2f0ac0){if(_0x2f0ac0){return _0x2f0ac0[_0x7c0d('0x23')](_0x407f52)[_0x7c0d('0x24')](function(_0x5b6329){return _0x5b6329;});}return null;};}function removeEntity(_0x58f715,_0x5dae80){return function(_0x54b14f){if(_0x54b14f){return _0x54b14f['destroy']()[_0x7c0d('0x24')](function(){_0x58f715[_0x7c0d('0x19')](0xcc)[_0x7c0d('0x18')]();});}};}function handleEntityNotFound(_0x2f657e,_0x1ef191){return function(_0x2a92ce){if(!_0x2a92ce){_0x2f657e[_0x7c0d('0x17')](0x194);}return _0x2a92ce;};}function handleError(_0x5b4b2b,_0x42467f){_0x42467f=_0x42467f||0x1f4;return function(_0xb7d5e4){logger['error'](_0xb7d5e4['stack']);if(_0xb7d5e4[_0x7c0d('0x25')]){delete _0xb7d5e4['name'];}_0x5b4b2b[_0x7c0d('0x19')](_0x42467f)[_0x7c0d('0x26')](_0xb7d5e4);};}exports[_0x7c0d('0x27')]=function(_0x34309,_0x4625d0){var _0x5ea868={},_0x27fc36={},_0x197530={'count':0x0,'rows':[]};var _0x36a264=_[_0x7c0d('0x28')](db[_0x7c0d('0x29')]['rawAttributes'],function(_0x2b261){return{'name':_0x2b261['fieldName'],'type':_0x2b261[_0x7c0d('0x2a')][_0x7c0d('0x2b')]};});_0x27fc36[_0x7c0d('0x2c')]=_[_0x7c0d('0x28')](_0x36a264,_0x7c0d('0x25'));_0x27fc36[_0x7c0d('0x2d')]=_['keys'](_0x34309[_0x7c0d('0x2d')]);_0x27fc36['filters']=_[_0x7c0d('0x2e')](_0x27fc36[_0x7c0d('0x2c')],_0x27fc36['query']);_0x5ea868['attributes']=_[_0x7c0d('0x2e')](_0x27fc36['model'],qs[_0x7c0d('0x2f')](_0x34309[_0x7c0d('0x2d')]['fields']));_0x5ea868['attributes']=_0x5ea868['attributes']['length']?_0x5ea868[_0x7c0d('0x30')]:_0x27fc36['model'];if(!_0x34309[_0x7c0d('0x2d')][_0x7c0d('0x31')]('nolimit')){_0x5ea868[_0x7c0d('0x1d')]=qs[_0x7c0d('0x1d')](_0x34309[_0x7c0d('0x2d')][_0x7c0d('0x1d')]);_0x5ea868['offset']=qs[_0x7c0d('0x1c')](_0x34309[_0x7c0d('0x2d')][_0x7c0d('0x1c')]);}_0x5ea868[_0x7c0d('0x32')]=qs[_0x7c0d('0x33')](_0x34309[_0x7c0d('0x2d')][_0x7c0d('0x33')]);_0x5ea868[_0x7c0d('0x34')]=qs[_0x7c0d('0x35')](_[_0x7c0d('0x36')](_0x34309['query'],_0x27fc36[_0x7c0d('0x35')]));if(_0x34309[_0x7c0d('0x2d')]['filter']){_0x5ea868[_0x7c0d('0x34')]=_[_0x7c0d('0x37')](_0x5ea868[_0x7c0d('0x34')],{'$or':_[_0x7c0d('0x28')](_0x36a264,function(_0x304606){if(_0x304606[_0x7c0d('0x2a')]!=='VIRTUAL'){var _0x2c8520={};_0x2c8520[_0x304606[_0x7c0d('0x25')]]={'$like':'%'+_0x34309[_0x7c0d('0x2d')][_0x7c0d('0x38')]+'%'};return _0x2c8520;}})});}_0x5ea868=_[_0x7c0d('0x37')]({},_0x5ea868,_0x34309['options']);var _0x5ccc68={'where':_0x5ea868[_0x7c0d('0x34')]};return db[_0x7c0d('0x29')]['count'](_0x5ccc68)[_0x7c0d('0x24')](function(_0x4c87d8){_0x197530[_0x7c0d('0x1b')]=_0x4c87d8;if(_0x34309[_0x7c0d('0x2d')]['includeAll']){_0x5ea868[_0x7c0d('0x39')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x7c0d('0x3a')](_0x5ea868);})[_0x7c0d('0x24')](function(_0x5f5ba2){_0x197530['rows']=_0x5f5ba2;return _0x197530;})['then'](respondWithFilteredResult(_0x4625d0,_0x5ea868))[_0x7c0d('0x3b')](handleError(_0x4625d0,null));};exports[_0x7c0d('0x3c')]=function(_0x1ff57c,_0x1a08e6){var _0x5dc200={'raw':!![],'where':{'id':_0x1ff57c[_0x7c0d('0x3d')]['id']}},_0x5de55c={};_0x5de55c['model']=_['keys'](db[_0x7c0d('0x29')]['rawAttributes']);_0x5de55c[_0x7c0d('0x2d')]=_[_0x7c0d('0x3e')](_0x1ff57c['query']);_0x5de55c[_0x7c0d('0x35')]=_[_0x7c0d('0x2e')](_0x5de55c[_0x7c0d('0x2c')],_0x5de55c[_0x7c0d('0x2d')]);_0x5dc200[_0x7c0d('0x30')]=_['intersection'](_0x5de55c[_0x7c0d('0x2c')],qs[_0x7c0d('0x2f')](_0x1ff57c['query'][_0x7c0d('0x2f')]));_0x5dc200[_0x7c0d('0x30')]=_0x5dc200[_0x7c0d('0x30')][_0x7c0d('0x3f')]?_0x5dc200['attributes']:_0x5de55c[_0x7c0d('0x2c')];if(_0x1ff57c[_0x7c0d('0x2d')][_0x7c0d('0x40')]){_0x5dc200[_0x7c0d('0x39')]=[{'all':!![]}];}_0x5dc200=_[_0x7c0d('0x37')]({},_0x5dc200,_0x1ff57c['options']);return db[_0x7c0d('0x29')]['find'](_0x5dc200)[_0x7c0d('0x24')](handleEntityNotFound(_0x1a08e6,null))['then'](respondWithResult(_0x1a08e6,null))[_0x7c0d('0x3b')](handleError(_0x1a08e6,null));};exports[_0x7c0d('0x41')]=function(_0x2db55b,_0x1d8451){return db[_0x7c0d('0x29')]['create'](_0x2db55b[_0x7c0d('0x42')],{})['then'](respondWithResult(_0x1d8451,0xc9))[_0x7c0d('0x3b')](handleError(_0x1d8451,null));};exports[_0x7c0d('0x23')]=function(_0x32bb12,_0x4fe5fd){if(_0x32bb12[_0x7c0d('0x42')]['id']){delete _0x32bb12['body']['id'];}return db['Dynamics365Field'][_0x7c0d('0x43')]({'where':{'id':_0x32bb12[_0x7c0d('0x3d')]['id']}})[_0x7c0d('0x24')](handleEntityNotFound(_0x4fe5fd,null))['then'](saveUpdates(_0x32bb12[_0x7c0d('0x42')],null))[_0x7c0d('0x24')](respondWithResult(_0x4fe5fd,null))[_0x7c0d('0x3b')](handleError(_0x4fe5fd,null));};exports['destroy']=function(_0x17ffea,_0x1d95d9){return db[_0x7c0d('0x29')][_0x7c0d('0x43')]({'where':{'id':_0x17ffea[_0x7c0d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1d95d9,null))['then'](removeEntity(_0x1d95d9,null))[_0x7c0d('0x3b')](handleError(_0x1d95d9,null));}; \ No newline at end of file +var _0x4975=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','Dynamics365Field','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x4975,0x86));var _0x5497=function(_0xa9efc,_0x23df3e){_0xa9efc=_0xa9efc-0x0;var _0x40cfa6=_0x4975[_0xa9efc];return _0x40cfa6;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc250bb,_0x1b23df){_0x1b23df=_0x1b23df||0xcc;return function(_0x1bb794){if(_0x1bb794){return _0xc250bb[_0x5497('0x18')](_0x1b23df);}return _0xc250bb[_0x5497('0x19')](_0x1b23df)[_0x5497('0x1a')]();};}function respondWithResult(_0x1f7169,_0xaca97d){_0xaca97d=_0xaca97d||0xc8;return function(_0x363a5b){if(_0x363a5b){return _0x1f7169[_0x5497('0x19')](_0xaca97d)['json'](_0x363a5b);}};}function respondWithFilteredResult(_0x11b0a9,_0x4fb8e9){return function(_0x4237a9){if(_0x4237a9){var _0x2bfd8a=_0x4237a9[_0x5497('0x1b')],_0x19e5f3=_0x4fb8e9[_0x5497('0x1c')],_0x3ce50b=_0x4fb8e9['offset']+_0x4fb8e9['limit'],_0x37c18e;if(_0x3ce50b>=_0x2bfd8a){_0x3ce50b=_0x2bfd8a;_0x37c18e=0xc8;}else{_0x37c18e=0xce;}_0x11b0a9[_0x5497('0x19')](_0x37c18e);return _0x11b0a9[_0x5497('0x1d')](_0x5497('0x1e'),_0x19e5f3+'-'+_0x3ce50b+'/'+_0x2bfd8a)['json'](_0x4237a9);}return null;};}function patchUpdates(_0xbf1ba7){return function(_0xcbd71d){try{jsonpatch[_0x5497('0x1f')](_0xcbd71d,_0xbf1ba7,!![]);}catch(_0x43da2c){return BPromise[_0x5497('0x20')](_0x43da2c);}return _0xcbd71d[_0x5497('0x21')]();};}function saveUpdates(_0x16d378,_0x10226f){return function(_0x2e3960){if(_0x2e3960){return _0x2e3960[_0x5497('0x22')](_0x16d378)[_0x5497('0x23')](function(_0x52c049){return _0x52c049;});}return null;};}function removeEntity(_0x720767,_0x4d1b27){return function(_0x19200a){if(_0x19200a){return _0x19200a[_0x5497('0x24')]()[_0x5497('0x23')](function(){_0x720767[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(!_0x54043a){_0x3b2fbc[_0x5497('0x18')](0x194);}return _0x54043a;};}function handleError(_0x34b97f,_0x24482a){_0x24482a=_0x24482a||0x1f4;return function(_0x281155){logger['error'](_0x281155[_0x5497('0x25')]);if(_0x281155['name']){delete _0x281155[_0x5497('0x26')];}_0x34b97f[_0x5497('0x19')](_0x24482a)[_0x5497('0x27')](_0x281155);};}exports[_0x5497('0x28')]=function(_0x163a30,_0x31cd01){var _0x48b835={},_0x4af5f4={},_0x5406e2={'count':0x0,'rows':[]};var _0x583d06=_['map'](db[_0x5497('0x29')]['rawAttributes'],function(_0x5e9356){return{'name':_0x5e9356[_0x5497('0x2a')],'type':_0x5e9356[_0x5497('0x2b')][_0x5497('0x2c')]};});_0x4af5f4['model']=_['map'](_0x583d06,'name');_0x4af5f4[_0x5497('0x2d')]=_[_0x5497('0x2e')](_0x163a30[_0x5497('0x2d')]);_0x4af5f4['filters']=_['intersection'](_0x4af5f4['model'],_0x4af5f4[_0x5497('0x2d')]);_0x48b835['attributes']=_[_0x5497('0x2f')](_0x4af5f4[_0x5497('0x30')],qs[_0x5497('0x31')](_0x163a30['query'][_0x5497('0x31')]));_0x48b835[_0x5497('0x32')]=_0x48b835['attributes'][_0x5497('0x33')]?_0x48b835[_0x5497('0x32')]:_0x4af5f4[_0x5497('0x30')];if(!_0x163a30['query'][_0x5497('0x34')](_0x5497('0x35'))){_0x48b835[_0x5497('0x36')]=qs[_0x5497('0x36')](_0x163a30[_0x5497('0x2d')]['limit']);_0x48b835[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x163a30['query'][_0x5497('0x1c')]);}_0x48b835[_0x5497('0x37')]=qs[_0x5497('0x38')](_0x163a30[_0x5497('0x2d')][_0x5497('0x38')]);_0x48b835[_0x5497('0x39')]=qs['filters'](_[_0x5497('0x3a')](_0x163a30['query'],_0x4af5f4[_0x5497('0x3b')]));if(_0x163a30[_0x5497('0x2d')][_0x5497('0x3c')]){_0x48b835['where']=_['merge'](_0x48b835[_0x5497('0x39')],{'$or':_[_0x5497('0x3d')](_0x583d06,function(_0x326d48){if(_0x326d48[_0x5497('0x2b')]!==_0x5497('0x3e')){var _0xc8a689={};_0xc8a689[_0x326d48['name']]={'$like':'%'+_0x163a30[_0x5497('0x2d')][_0x5497('0x3c')]+'%'};return _0xc8a689;}})});}_0x48b835=_[_0x5497('0x3f')]({},_0x48b835,_0x163a30[_0x5497('0x40')]);var _0x275aa7={'where':_0x48b835[_0x5497('0x39')]};return db[_0x5497('0x29')][_0x5497('0x1b')](_0x275aa7)[_0x5497('0x23')](function(_0x544065){_0x5406e2[_0x5497('0x1b')]=_0x544065;if(_0x163a30[_0x5497('0x2d')][_0x5497('0x41')]){_0x48b835[_0x5497('0x42')]=[{'all':!![]}];}return db[_0x5497('0x29')][_0x5497('0x43')](_0x48b835);})[_0x5497('0x23')](function(_0x59ed13){_0x5406e2[_0x5497('0x44')]=_0x59ed13;return _0x5406e2;})[_0x5497('0x23')](respondWithFilteredResult(_0x31cd01,_0x48b835))[_0x5497('0x45')](handleError(_0x31cd01,null));};exports[_0x5497('0x46')]=function(_0x1b251b,_0x125526){var _0x114471={'raw':!![],'where':{'id':_0x1b251b[_0x5497('0x47')]['id']}},_0x547437={};_0x547437[_0x5497('0x30')]=_[_0x5497('0x2e')](db[_0x5497('0x29')][_0x5497('0x48')]);_0x547437[_0x5497('0x2d')]=_[_0x5497('0x2e')](_0x1b251b[_0x5497('0x2d')]);_0x547437[_0x5497('0x3b')]=_[_0x5497('0x2f')](_0x547437['model'],_0x547437[_0x5497('0x2d')]);_0x114471['attributes']=_[_0x5497('0x2f')](_0x547437[_0x5497('0x30')],qs[_0x5497('0x31')](_0x1b251b[_0x5497('0x2d')][_0x5497('0x31')]));_0x114471['attributes']=_0x114471[_0x5497('0x32')][_0x5497('0x33')]?_0x114471['attributes']:_0x547437[_0x5497('0x30')];if(_0x1b251b['query'][_0x5497('0x41')]){_0x114471['include']=[{'all':!![]}];}_0x114471=_[_0x5497('0x3f')]({},_0x114471,_0x1b251b[_0x5497('0x40')]);return db[_0x5497('0x29')][_0x5497('0x49')](_0x114471)[_0x5497('0x23')](handleEntityNotFound(_0x125526,null))['then'](respondWithResult(_0x125526,null))['catch'](handleError(_0x125526,null));};exports['create']=function(_0x55f654,_0x3cbe4b){return db[_0x5497('0x29')][_0x5497('0x4a')](_0x55f654[_0x5497('0x4b')],{})[_0x5497('0x23')](respondWithResult(_0x3cbe4b,0xc9))[_0x5497('0x45')](handleError(_0x3cbe4b,null));};exports[_0x5497('0x22')]=function(_0x466287,_0x2626bf){if(_0x466287['body']['id']){delete _0x466287[_0x5497('0x4b')]['id'];}return db[_0x5497('0x29')][_0x5497('0x49')]({'where':{'id':_0x466287['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x2626bf,null))['then'](saveUpdates(_0x466287[_0x5497('0x4b')],null))[_0x5497('0x23')](respondWithResult(_0x2626bf,null))[_0x5497('0x45')](handleError(_0x2626bf,null));};exports['destroy']=function(_0x43bebe,_0x356d61){return db['Dynamics365Field'][_0x5497('0x49')]({'where':{'id':_0x43bebe['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x356d61,null))['then'](removeEntity(_0x356d61,null))[_0x5497('0x45')](handleError(_0x356d61,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8bcf776..8d7d2b1 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 _0xd249=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xd249,0x18f));var _0x9d24=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0xd249[_0x350182];return _0x4a0892;};'use strict';var _=require(_0x9d24('0x0'));var util=require(_0x9d24('0x1'));var logger=require(_0x9d24('0x2'))(_0x9d24('0x3'));var moment=require(_0x9d24('0x4'));var BPromise=require(_0x9d24('0x5'));var rp=require(_0x9d24('0x6'));var fs=require('fs');var path=require(_0x9d24('0x7'));var rimraf=require(_0x9d24('0x8'));var config=require(_0x9d24('0x9'));var attributes=require(_0x9d24('0xa'));module[_0x9d24('0xb')]=function(_0x175fb2,_0x2f56b1){return _0x175fb2[_0x9d24('0xc')](_0x9d24('0xd'),attributes,{'tableName':_0x9d24('0xe'),'paranoid':![],'indexes':[{'name':_0x9d24('0xf'),'fields':[_0x9d24('0x10'),_0x9d24('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x73b5=['int_dynamics365_fields','FieldId','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x254fed,_0x30cf21){var _0x480085=function(_0xe7f346){while(--_0xe7f346){_0x254fed['push'](_0x254fed['shift']());}};_0x480085(++_0x30cf21);}(_0x73b5,0x17b));var _0x573b=function(_0xf41d45,_0x54be4d){_0xf41d45=_0xf41d45-0x0;var _0x2bda98=_0x73b5[_0xf41d45];return _0x2bda98;};'use strict';var _=require(_0x573b('0x0'));var util=require(_0x573b('0x1'));var logger=require(_0x573b('0x2'))('api');var moment=require(_0x573b('0x3'));var BPromise=require(_0x573b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x573b('0x5'));var config=require(_0x573b('0x6'));var attributes=require(_0x573b('0x7'));module[_0x573b('0x8')]=function(_0x6782dc,_0x26a10c){return _0x6782dc[_0x573b('0x9')](_0x573b('0xa'),attributes,{'tableName':_0x573b('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x573b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 8a1cd76..8e7a02e 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 _0x0960=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','bluebird','randomstring'];(function(_0x27e321,_0x222eb5){var _0x19ac6c=function(_0x4cb61a){while(--_0x4cb61a){_0x27e321['push'](_0x27e321['shift']());}};_0x19ac6c(++_0x222eb5);}(_0x0960,0xc2));var _0x0096=function(_0x35a426,_0x54ad52){_0x35a426=_0x35a426-0x0;var _0x2b1c42=_0x0960[_0x35a426];return _0x2b1c42;};'use strict';var _=require(_0x0096('0x0'));var util=require(_0x0096('0x1'));var moment=require('moment');var BPromise=require(_0x0096('0x2'));var rs=require(_0x0096('0x3'));var fs=require('fs');var Redis=require(_0x0096('0x4'));var db=require(_0x0096('0x5'))['db'];var utils=require(_0x0096('0x6'));var logger=require(_0x0096('0x7'))(_0x0096('0x8'));var config=require(_0x0096('0x9'));var jayson=require(_0x0096('0xa'));var client=jayson[_0x0096('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x81cc41,_0x57390a,_0x1d35f1){return new BPromise(function(_0x44e168,_0x407f3a){return client['request'](_0x81cc41,_0x1d35f1)[_0x0096('0xc')](function(_0x3e97ce){logger[_0x0096('0xd')](_0x0096('0xe'),_0x57390a,'request\x20sent');logger[_0x0096('0xf')](_0x0096('0x10'),_0x57390a,'request\x20sent',JSON[_0x0096('0x11')](_0x3e97ce));if(_0x3e97ce['error']){if(_0x3e97ce[_0x0096('0x12')]['code']===0x1f4){logger[_0x0096('0x12')](_0x0096('0xe'),_0x57390a,_0x3e97ce['error'][_0x0096('0x13')]);return _0x407f3a(_0x3e97ce[_0x0096('0x12')]['message']);}logger['error'](_0x0096('0xe'),_0x57390a,_0x3e97ce[_0x0096('0x12')][_0x0096('0x13')]);return _0x44e168(_0x3e97ce[_0x0096('0x12')][_0x0096('0x13')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x57390a,_0x0096('0x14'));_0x44e168(_0x3e97ce['result']['message']);}})[_0x0096('0x15')](function(_0x37f0e4){logger['error'](_0x0096('0xe'),_0x57390a,_0x37f0e4);_0x407f3a(_0x37f0e4);});});} \ No newline at end of file +var _0xb242=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0xc8a7bb,_0x480fa5){var _0x54c632=function(_0x4a953a){while(--_0x4a953a){_0xc8a7bb['push'](_0xc8a7bb['shift']());}};_0x54c632(++_0x480fa5);}(_0xb242,0x1f3));var _0x2b24=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xb242[_0x2de0a7];return _0x429437;};'use strict';var _=require('lodash');var util=require(_0x2b24('0x0'));var moment=require(_0x2b24('0x1'));var BPromise=require(_0x2b24('0x2'));var rs=require(_0x2b24('0x3'));var fs=require('fs');var Redis=require(_0x2b24('0x4'));var db=require(_0x2b24('0x5'))['db'];var utils=require(_0x2b24('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b24('0x7'));var jayson=require(_0x2b24('0x8'));var client=jayson['client'][_0x2b24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477e45,_0x179d9a,_0x53345b){return new BPromise(function(_0x475271,_0x56c14a){return client[_0x2b24('0xa')](_0x477e45,_0x53345b)[_0x2b24('0xb')](function(_0x529939){logger[_0x2b24('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x179d9a,_0x2b24('0xd'));logger[_0x2b24('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x179d9a,'request\x20sent',JSON[_0x2b24('0xf')](_0x529939));if(_0x529939['error']){if(_0x529939[_0x2b24('0x10')][_0x2b24('0x11')]===0x1f4){logger[_0x2b24('0x10')](_0x2b24('0x12'),_0x179d9a,_0x529939['error']['message']);return _0x56c14a(_0x529939[_0x2b24('0x10')][_0x2b24('0x13')]);}logger[_0x2b24('0x10')](_0x2b24('0x12'),_0x179d9a,_0x529939[_0x2b24('0x10')]['message']);return _0x475271(_0x529939[_0x2b24('0x10')][_0x2b24('0x13')]);}else{logger['info'](_0x2b24('0x12'),_0x179d9a,_0x2b24('0xd'));_0x475271(_0x529939['result'][_0x2b24('0x13')]);}})[_0x2b24('0x14')](function(_0x2fdc73){logger[_0x2b24('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x179d9a,_0x2fdc73);_0x56c14a(_0x2fdc73);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 88be3b3..279ad7d 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 _0x3648=['path','express','Router','./intFreshdeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3648,0x178));var _0x8364=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3648[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8364('0x0'));var util=require(_0x8364('0x1'));var path=require(_0x8364('0x2'));var timeout=require('connect-timeout');var express=require(_0x8364('0x3'));var router=express[_0x8364('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8364('0x5'));router[_0x8364('0x6')]('/',auth['isAuthenticated'](),controller[_0x8364('0x7')]);router[_0x8364('0x6')]('/:id',auth[_0x8364('0x8')](),controller['show']);router[_0x8364('0x6')](_0x8364('0x9'),auth[_0x8364('0x8')](),controller[_0x8364('0xa')]);router[_0x8364('0x6')](_0x8364('0xb'),auth['isAuthenticated'](),controller[_0x8364('0xc')]);router['post']('/',auth[_0x8364('0x8')](),controller['create']);router[_0x8364('0xd')](_0x8364('0x9'),auth[_0x8364('0x8')](),controller[_0x8364('0xe')]);router[_0x8364('0xf')](_0x8364('0x10'),auth[_0x8364('0x8')](),controller[_0x8364('0x11')]);router[_0x8364('0x12')]('/:id',auth[_0x8364('0x8')](),controller[_0x8364('0x13')]);module[_0x8364('0x14')]=router; \ No newline at end of file +var _0x98e8=['../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x92354d,_0xcbd1ac){var _0x57f449=function(_0x19658f){while(--_0x19658f){_0x92354d['push'](_0x92354d['shift']());}};_0x57f449(++_0xcbd1ac);}(_0x98e8,0x74));var _0x898e=function(_0x222e7d,_0x65d70d){_0x222e7d=_0x222e7d-0x0;var _0x47d1b2=_0x98e8[_0x222e7d];return _0x47d1b2;};'use strict';var multer=require(_0x898e('0x0'));var util=require('util');var path=require(_0x898e('0x1'));var timeout=require(_0x898e('0x2'));var express=require('express');var router=express[_0x898e('0x3')]();var auth=require(_0x898e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x898e('0x5'));router[_0x898e('0x6')]('/',auth[_0x898e('0x7')](),controller[_0x898e('0x8')]);router[_0x898e('0x6')](_0x898e('0x9'),auth['isAuthenticated'](),controller[_0x898e('0xa')]);router[_0x898e('0x6')](_0x898e('0xb'),auth[_0x898e('0x7')](),controller[_0x898e('0xc')]);router['get'](_0x898e('0xd'),auth['isAuthenticated'](),controller[_0x898e('0xe')]);router[_0x898e('0xf')]('/',auth[_0x898e('0x7')](),controller['create']);router[_0x898e('0xf')](_0x898e('0xb'),auth[_0x898e('0x7')](),controller[_0x898e('0x10')]);router[_0x898e('0x11')]('/:id',auth[_0x898e('0x7')](),controller['update']);router[_0x898e('0x12')](_0x898e('0x9'),auth['isAuthenticated'](),controller[_0x898e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 2042763..4c413d6 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 _0xdf4d=['STRING','username','remoteUri','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdf4d,0xcb));var _0xddf4=function(_0x4fee1b,_0x51afe3){_0x4fee1b=_0x4fee1b-0x0;var _0xa70fb5=_0xdf4d[_0x4fee1b];return _0xa70fb5;};'use strict';var Sequelize=require('sequelize');module[_0xddf4('0x0')]={'name':{'type':Sequelize[_0xddf4('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xddf4('0x1')],'unique':_0xddf4('0x2')},'apiKey':{'type':Sequelize[_0xddf4('0x1')]},'remoteUri':{'type':Sequelize[_0xddf4('0x1')],'unique':_0xddf4('0x3')},'serverUrl':{'type':Sequelize[_0xddf4('0x1')]}}; \ No newline at end of file +var _0xfe39=['sequelize','exports','STRING'];(function(_0x3cdfdb,_0x40545d){var _0x57d4d8=function(_0x3e7f86){while(--_0x3e7f86){_0x3cdfdb['push'](_0x3cdfdb['shift']());}};_0x57d4d8(++_0x40545d);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfe39[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x9fe3('0x0'));module[_0x9fe3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9fe3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x9fe3('0x2')]},'remoteUri':{'type':Sequelize[_0x9fe3('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 56a84d2..0be4cc1 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 _0x0c70=['getConfigurations','findOne','FreshdeskConfiguration','keys','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','toString','base64','requester','subject','description','priority','group','ticket_type','includes','custom_dropdown','label','default','choices','test','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','find','create','body','update'];(function(_0x3d067e,_0x32d8a0){var _0x5e66d9=function(_0x37411a){while(--_0x37411a){_0x3d067e['push'](_0x3d067e['shift']());}};_0x5e66d9(++_0x32d8a0);}(_0x0c70,0x11a));var _0x00c7=function(_0x53c81a,_0xfe65a1){_0x53c81a=_0x53c81a-0x0;var _0x29ad48=_0x0c70[_0x53c81a];return _0x29ad48;};'use strict';var pdf=require(_0x00c7('0x0'));var emlformat=require(_0x00c7('0x1'));var rimraf=require(_0x00c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00c7('0x3'));var rp=require(_0x00c7('0x4'));var moment=require(_0x00c7('0x5'));var BPromise=require(_0x00c7('0x6'));var Mustache=require(_0x00c7('0x7'));var util=require('util');var path=require(_0x00c7('0x8'));var sox=require(_0x00c7('0x9'));var csv=require(_0x00c7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x00c7('0xb'));var squel=require(_0x00c7('0xc'));var crypto=require(_0x00c7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x00c7('0xe'));var toCsv=require(_0x00c7('0xa'));var querystring=require(_0x00c7('0xf'));var Papa=require('papaparse');var Redis=require(_0x00c7('0x10'));var authService=require(_0x00c7('0x11'));var qs=require(_0x00c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00c7('0x13'));var logger=require(_0x00c7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x00c7('0x15'));var db=require(_0x00c7('0x16'))['db'];var integrations=require(_0x00c7('0x17'));var jayson=require(_0x00c7('0x18'));var client=jayson['client'][_0x00c7('0x19')]({'port':0x232a});function checkPasswordPattern(_0xe4f731,_0x29e80c,_0x254ff5){if(_0x254ff5){var _0x3f2121=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f2121['test'](_0x29e80c)){return _0xe4f731;}else{throw new db['Sequelize'][(_0x00c7('0x1a'))](_0x00c7('0x1b'));}}else{return _0xe4f731;}}function respondWithRpcPromise(_0x416e2b,_0x5a41ff,_0x36c144,_0x3a38d4){return new BPromise(function(_0x2f368d,_0x996804){var _0x3a9b6b=_0x3a38d4||client;return _0x3a9b6b['request'](_0x416e2b,_0x36c144)['then'](function(_0x2ad65d){logger[_0x00c7('0x1c')](_0x00c7('0x1d'),_0x5a41ff,_0x00c7('0x1e'));logger[_0x00c7('0x1f')](_0x00c7('0x20'),_0x5a41ff,_0x00c7('0x1e'),JSON[_0x00c7('0x21')](_0x2ad65d));if(_0x2ad65d[_0x00c7('0x22')]){if(_0x2ad65d['error'][_0x00c7('0x23')]===0x1f4){logger[_0x00c7('0x22')](_0x00c7('0x1d'),_0x5a41ff,_0x2ad65d[_0x00c7('0x22')][_0x00c7('0x24')]);return _0x996804(_0x2ad65d[_0x00c7('0x22')][_0x00c7('0x24')]);}logger[_0x00c7('0x22')](_0x00c7('0x1d'),_0x5a41ff,_0x2ad65d[_0x00c7('0x22')][_0x00c7('0x24')]);return _0x2f368d(_0x2ad65d[_0x00c7('0x22')][_0x00c7('0x24')]);}else{logger['info'](_0x00c7('0x1d'),_0x5a41ff,'request\x20sent');_0x2f368d(_0x2ad65d[_0x00c7('0x25')][_0x00c7('0x24')]);}})[_0x00c7('0x26')](function(_0x591169){logger[_0x00c7('0x22')](_0x00c7('0x1d'),_0x5a41ff,_0x591169);_0x996804(_0x591169);});});}function respondWithStatusCode(_0x2cb996,_0x25d162){_0x25d162=_0x25d162||0xcc;return function(_0x120a49){if(_0x120a49){return _0x2cb996['sendStatus'](_0x25d162);}return _0x2cb996[_0x00c7('0x27')](_0x25d162)[_0x00c7('0x28')]();};}function respondWithResult(_0x5d3f7a,_0x7efcc4){_0x7efcc4=_0x7efcc4||0xc8;return function(_0x1e74fd){if(_0x1e74fd){return _0x5d3f7a[_0x00c7('0x27')](_0x7efcc4)[_0x00c7('0x29')](_0x1e74fd);}};}function respondWithFilteredResult(_0x598a49,_0x174ae0){return function(_0x3378ff){if(_0x3378ff){var _0x2c278b=_0x3378ff[_0x00c7('0x2a')],_0x5dfc35=_0x174ae0[_0x00c7('0x2b')],_0x4a1c4e=_0x174ae0[_0x00c7('0x2b')]+_0x174ae0[_0x00c7('0x2c')],_0x51876d;if(_0x4a1c4e>=_0x2c278b){_0x4a1c4e=_0x2c278b;_0x51876d=0xc8;}else{_0x51876d=0xce;}_0x598a49[_0x00c7('0x27')](_0x51876d);return _0x598a49[_0x00c7('0x2d')](_0x00c7('0x2e'),_0x5dfc35+'-'+_0x4a1c4e+'/'+_0x2c278b)['json'](_0x3378ff);}return null;};}function patchUpdates(_0x219784){return function(_0x5610e8){try{jsonpatch[_0x00c7('0x2f')](_0x5610e8,_0x219784,!![]);}catch(_0x2db435){return BPromise[_0x00c7('0x30')](_0x2db435);}return _0x5610e8[_0x00c7('0x31')]();};}function saveUpdates(_0x13d933,_0x292599){return function(_0x4c0701){if(_0x4c0701){return _0x4c0701['update'](_0x13d933)['then'](function(_0x26bd16){return _0x26bd16;});}return null;};}function removeEntity(_0x37b1cb,_0x1f3433){return function(_0x389910){if(_0x389910){return _0x389910[_0x00c7('0x32')]()[_0x00c7('0x33')](function(){_0x37b1cb[_0x00c7('0x27')](0xcc)[_0x00c7('0x28')]();});}};}function handleEntityNotFound(_0x18b015,_0x825e99){return function(_0x13c19b){if(!_0x13c19b){_0x18b015[_0x00c7('0x34')](0x194);}return _0x13c19b;};}function handleError(_0x51c346,_0x188798){_0x188798=_0x188798||0x1f4;return function(_0xc44e4b){logger[_0x00c7('0x22')](_0xc44e4b[_0x00c7('0x35')]);if(_0xc44e4b['name']){delete _0xc44e4b[_0x00c7('0x36')];}_0x51c346[_0x00c7('0x27')](_0x188798)[_0x00c7('0x37')](_0xc44e4b);};}exports[_0x00c7('0x38')]=function(_0x31899c,_0x2df0dd){var _0x528859={},_0x4b204b={},_0xb56a87={'count':0x0,'rows':[]};var _0x192320=_[_0x00c7('0x39')](db[_0x00c7('0x3a')][_0x00c7('0x3b')],function(_0x60b407){return{'name':_0x60b407['fieldName'],'type':_0x60b407[_0x00c7('0x3c')][_0x00c7('0x3d')]};});_0x4b204b['model']=_[_0x00c7('0x39')](_0x192320,_0x00c7('0x36'));_0x4b204b[_0x00c7('0x3e')]=_['keys'](_0x31899c[_0x00c7('0x3e')]);_0x4b204b[_0x00c7('0x3f')]=_[_0x00c7('0x40')](_0x4b204b[_0x00c7('0x41')],_0x4b204b[_0x00c7('0x3e')]);_0x528859[_0x00c7('0x42')]=_[_0x00c7('0x40')](_0x4b204b['model'],qs['fields'](_0x31899c[_0x00c7('0x3e')]['fields']));_0x528859['attributes']=_0x528859['attributes'][_0x00c7('0x43')]?_0x528859[_0x00c7('0x42')]:_0x4b204b[_0x00c7('0x41')];if(!_0x31899c[_0x00c7('0x3e')][_0x00c7('0x44')]('nolimit')){_0x528859[_0x00c7('0x2c')]=qs[_0x00c7('0x2c')](_0x31899c[_0x00c7('0x3e')]['limit']);_0x528859[_0x00c7('0x2b')]=qs[_0x00c7('0x2b')](_0x31899c['query'][_0x00c7('0x2b')]);}_0x528859[_0x00c7('0x45')]=qs[_0x00c7('0x46')](_0x31899c[_0x00c7('0x3e')]['sort']);_0x528859[_0x00c7('0x47')]=qs['filters'](_[_0x00c7('0x48')](_0x31899c[_0x00c7('0x3e')],_0x4b204b[_0x00c7('0x3f')]));if(_0x31899c[_0x00c7('0x3e')][_0x00c7('0x49')]){_0x528859[_0x00c7('0x47')]=_[_0x00c7('0x4a')](_0x528859['where'],{'$or':_[_0x00c7('0x39')](_0x192320,function(_0x25c2ac){if(_0x25c2ac[_0x00c7('0x3c')]!==_0x00c7('0x4b')){var _0xbad845={};_0xbad845[_0x25c2ac[_0x00c7('0x36')]]={'$like':'%'+_0x31899c[_0x00c7('0x3e')][_0x00c7('0x49')]+'%'};return _0xbad845;}})});}_0x528859=_[_0x00c7('0x4a')]({},_0x528859,_0x31899c[_0x00c7('0x4c')]);var _0x3029ef={'where':_0x528859[_0x00c7('0x47')]};return db[_0x00c7('0x3a')][_0x00c7('0x2a')](_0x3029ef)[_0x00c7('0x33')](function(_0x2f98fc){_0xb56a87[_0x00c7('0x2a')]=_0x2f98fc;if(_0x31899c[_0x00c7('0x3e')][_0x00c7('0x4d')]){_0x528859['include']=[{'all':!![]}];}return db[_0x00c7('0x3a')][_0x00c7('0x4e')](_0x528859);})[_0x00c7('0x33')](function(_0x12d927){_0xb56a87[_0x00c7('0x4f')]=_0x12d927;return _0xb56a87;})[_0x00c7('0x33')](respondWithFilteredResult(_0x2df0dd,_0x528859))['catch'](handleError(_0x2df0dd,null));};exports[_0x00c7('0x50')]=function(_0x4765e3,_0x510fc4){var _0x5bb9c7={'raw':![],'where':{'id':_0x4765e3[_0x00c7('0x51')]['id']}},_0x3bd77b={};_0x3bd77b['model']=_['keys'](db[_0x00c7('0x3a')][_0x00c7('0x3b')]);_0x3bd77b[_0x00c7('0x3e')]=_['keys'](_0x4765e3[_0x00c7('0x3e')]);_0x3bd77b['filters']=_[_0x00c7('0x40')](_0x3bd77b[_0x00c7('0x41')],_0x3bd77b[_0x00c7('0x3e')]);_0x5bb9c7[_0x00c7('0x42')]=_[_0x00c7('0x40')](_0x3bd77b[_0x00c7('0x41')],qs[_0x00c7('0x52')](_0x4765e3[_0x00c7('0x3e')][_0x00c7('0x52')]));_0x5bb9c7[_0x00c7('0x42')]=_0x5bb9c7['attributes'][_0x00c7('0x43')]?_0x5bb9c7[_0x00c7('0x42')]:_0x3bd77b[_0x00c7('0x41')];if(_0x4765e3[_0x00c7('0x3e')]['includeAll']){_0x5bb9c7['include']=[{'all':!![]}];}_0x5bb9c7=_[_0x00c7('0x4a')]({},_0x5bb9c7,_0x4765e3[_0x00c7('0x4c')]);return db[_0x00c7('0x3a')][_0x00c7('0x53')](_0x5bb9c7)[_0x00c7('0x33')](handleEntityNotFound(_0x510fc4,null))[_0x00c7('0x33')](respondWithResult(_0x510fc4,null))[_0x00c7('0x26')](handleError(_0x510fc4,null));};exports[_0x00c7('0x54')]=function(_0x35d654,_0x4d5851){return db[_0x00c7('0x3a')]['create'](_0x35d654[_0x00c7('0x55')],{})[_0x00c7('0x33')](respondWithResult(_0x4d5851,0xc9))['catch'](handleError(_0x4d5851,null));};exports[_0x00c7('0x56')]=function(_0x141053,_0x593ad2){if(_0x141053[_0x00c7('0x55')]['id']){delete _0x141053[_0x00c7('0x55')]['id'];}return db[_0x00c7('0x3a')][_0x00c7('0x53')]({'where':{'id':_0x141053['params']['id']}})[_0x00c7('0x33')](handleEntityNotFound(_0x593ad2,null))['then'](saveUpdates(_0x141053[_0x00c7('0x55')],null))[_0x00c7('0x33')](respondWithResult(_0x593ad2,null))[_0x00c7('0x26')](handleError(_0x593ad2,null));};exports['destroy']=function(_0x357a12,_0x123169){return db[_0x00c7('0x3a')][_0x00c7('0x53')]({'where':{'id':_0x357a12[_0x00c7('0x51')]['id']}})['then'](handleEntityNotFound(_0x123169,null))[_0x00c7('0x33')](removeEntity(_0x123169,null))['catch'](handleError(_0x123169,null));};exports[_0x00c7('0x57')]=function(_0xec1acd,_0x559853,_0x59c293){var _0x4ae82a={};var _0x4e3f48={};var _0x15a7a8;var _0x50290b;return db['FreshdeskAccount'][_0x00c7('0x58')]({'where':{'id':_0xec1acd[_0x00c7('0x51')]['id']}})[_0x00c7('0x33')](handleEntityNotFound(_0x559853,null))[_0x00c7('0x33')](function(_0x10efcf){if(_0x10efcf){_0x15a7a8=_0x10efcf;_0x4e3f48[_0x00c7('0x41')]=_['keys'](db[_0x00c7('0x59')]['rawAttributes']);_0x4e3f48[_0x00c7('0x3e')]=_[_0x00c7('0x5a')](_0xec1acd[_0x00c7('0x3e')]);_0x4e3f48[_0x00c7('0x3f')]=_['intersection'](_0x4e3f48[_0x00c7('0x41')],_0x4e3f48[_0x00c7('0x3e')]);_0x4ae82a['attributes']=_['intersection'](_0x4e3f48['model'],qs['fields'](_0xec1acd[_0x00c7('0x3e')][_0x00c7('0x52')]));_0x4ae82a[_0x00c7('0x42')]=_0x4ae82a[_0x00c7('0x42')][_0x00c7('0x43')]?_0x4ae82a[_0x00c7('0x42')]:_0x4e3f48['model'];_0x4ae82a['order']=qs[_0x00c7('0x46')](_0xec1acd['query'][_0x00c7('0x46')]);_0x4ae82a['where']=qs[_0x00c7('0x3f')](_[_0x00c7('0x48')](_0xec1acd['query'],_0x4e3f48[_0x00c7('0x3f')]));if(_0xec1acd[_0x00c7('0x3e')]['filter']){_0x4ae82a[_0x00c7('0x47')]=_[_0x00c7('0x4a')](_0x4ae82a[_0x00c7('0x47')],{'$or':_['map'](_0x4ae82a[_0x00c7('0x42')],function(_0x1513c5){var _0x26f596={};_0x26f596[_0x1513c5]={'$like':'%'+_0xec1acd[_0x00c7('0x3e')][_0x00c7('0x49')]+'%'};return _0x26f596;})});}_0x4ae82a=_[_0x00c7('0x4a')]({},_0x4ae82a,_0xec1acd[_0x00c7('0x4c')]);return _0x15a7a8[_0x00c7('0x57')](_0x4ae82a);}})['then'](function(_0x4701b0){if(_0x4701b0){_0x50290b=_0x4701b0['length'];if(!_0xec1acd[_0x00c7('0x3e')][_0x00c7('0x44')]('nolimit')){_0x4ae82a[_0x00c7('0x2c')]=qs[_0x00c7('0x2c')](_0xec1acd[_0x00c7('0x3e')][_0x00c7('0x2c')]);_0x4ae82a[_0x00c7('0x2b')]=qs[_0x00c7('0x2b')](_0xec1acd['query']['offset']);}return _0x15a7a8[_0x00c7('0x57')](_0x4ae82a);}})[_0x00c7('0x33')](function(_0x2d0c7a){if(_0x2d0c7a){return _0x2d0c7a?{'count':_0x50290b,'rows':_0x2d0c7a}:null;}})['then'](respondWithResult(_0x559853,null))['catch'](handleError(_0x559853,null));};exports['addConfiguration']=function(_0x308660,_0x551c2b,_0x5cf415){if(_0x308660[_0x00c7('0x55')]['id']){delete _0x308660[_0x00c7('0x55')]['id'];}return db[_0x00c7('0x3a')][_0x00c7('0x58')]({'where':{'id':_0x308660[_0x00c7('0x51')]['id']}})['then'](handleEntityNotFound(_0x551c2b,null))['then'](function(_0x2e98c0){if(_0x2e98c0){_0x308660['body']['AccountId']=_0x2e98c0['id'];_0x308660[_0x00c7('0x55')][_0x00c7('0x5b')]=integrations[_0x00c7('0x5c')](_0x308660[_0x00c7('0x55')][_0x00c7('0x5d')],_0x308660['body'][_0x00c7('0x3c')]);_0x308660[_0x00c7('0x55')][_0x00c7('0x5e')]=integrations[_0x00c7('0x5f')](_0x308660[_0x00c7('0x55')]['channel'],_0x308660[_0x00c7('0x55')][_0x00c7('0x3c')]);return db[_0x00c7('0x59')][_0x00c7('0x54')](_0x308660[_0x00c7('0x55')],{'include':[{'model':db['FreshdeskField'],'as':_0x00c7('0x5b')},{'model':db[_0x00c7('0x60')],'as':'Descriptions'}]});}return null;})[_0x00c7('0x33')](respondWithResult(_0x551c2b,null))[_0x00c7('0x26')](handleError(_0x551c2b,null));};exports['getFields']=function(_0x560313,_0x49703b,_0x5b3a36){var _0x132aff='';return db[_0x00c7('0x3a')][_0x00c7('0x58')]({'where':{'id':_0x560313[_0x00c7('0x51')]['id']},'attributes':['id','remoteUri',_0x00c7('0x61')]})[_0x00c7('0x33')](handleEntityNotFound(_0x49703b,null))[_0x00c7('0x33')](function(_0xaf5c8b){if(_0xaf5c8b){_0x132aff=_0xaf5c8b[_0x00c7('0x62')];var _0x5e6cb1=_0x132aff[_0x00c7('0x63')](-0x1);if(_0x5e6cb1==='/'){_0x132aff=_0x132aff[_0x00c7('0x64')](0x0,_0x132aff[_0x00c7('0x65')](_0x5e6cb1));}return rp({'method':_0x00c7('0x66'),'uri':util[_0x00c7('0x67')](_0x00c7('0x68'),_0x132aff,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x00c7('0x67')](_0x00c7('0x69'),new Buffer(util[_0x00c7('0x67')]('%s:X',_0xaf5c8b['apiKey']))[_0x00c7('0x6a')](_0x00c7('0x6b')))},'json':!![]});}})[_0x00c7('0x33')](function(_0x1d90ba){if(_0x1d90ba){var _0x217ad7=[_0x00c7('0x6c'),_0x00c7('0x6d'),'agent',_0x00c7('0x6e'),_0x00c7('0x27'),_0x00c7('0x6f'),_0x00c7('0x70'),'source',_0x00c7('0x71'),'group','company'];_['remove'](_0x1d90ba,function(_0x247b93){return _0x217ad7[_0x00c7('0x72')](_0x247b93[_0x00c7('0x36')])||!_0x247b93['default']&&_0x247b93[_0x00c7('0x3c')]!=='custom_text'&&_0x247b93['type']!==_0x00c7('0x73');});return{'count':_0x1d90ba['length'],'rows':_[_0x00c7('0x39')](_0x1d90ba,function(_0x30a487){return{'id':_0x30a487[_0x00c7('0x36')],'name':_0x30a487[_0x00c7('0x74')],'custom':!_0x30a487[_0x00c7('0x75')],'options':_0x30a487[_0x00c7('0x76')]?_[_0x00c7('0x39')](_0x30a487[_0x00c7('0x76')],function(_0x11394a){return{'name':_['capitalize'](_0x11394a),'value':_0x11394a};}):[]};})};}})['then'](respondWithResult(_0x49703b,null))[_0x00c7('0x26')](function(_0x740c5){var _0x5c929c=_0x560313['query'][_0x00c7('0x77')]?0x1f4:_0x740c5[_0x00c7('0x78')]||0x1f4;logger[_0x00c7('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x00c7('0x79'),_0x5c929c,JSON['stringify'](_0x740c5));delete _0x740c5['name'];if(_0x5c929c===0x191){_0x5c929c=0x190;}_0x49703b[_0x00c7('0x27')](_0x5c929c)[_0x00c7('0x37')](_0x560313[_0x00c7('0x3e')]['test']?{'message':_0x00c7('0x7a'),'statusCode':_0x740c5['statusCode']}:_0x740c5);});}; \ No newline at end of file +var _0x973a=['Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','includes','default','custom_text','custom_dropdown','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','status','end','json','count','offset','limit','Content-Range','save','destroy','sendStatus','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','length','find','body','update','getConfigurations','findOne','FreshdeskConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','channel'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x973a,0x187));var _0xa973=function(_0xb9911d,_0x2987e6){_0xb9911d=_0xb9911d-0x0;var _0x5e1777=_0x973a[_0xb9911d];return _0x5e1777;};'use strict';var pdf=require(_0xa973('0x0'));var emlformat=require(_0xa973('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa973('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa973('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa973('0x4'));var sox=require('sox');var csv=require(_0xa973('0x5'));var ejs=require(_0xa973('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa973('0x7'));var crypto=require(_0xa973('0x8'));var jsforce=require(_0xa973('0x9'));var deskjs=require(_0xa973('0xa'));var toCsv=require(_0xa973('0x5'));var querystring=require('querystring');var Papa=require(_0xa973('0xb'));var Redis=require(_0xa973('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xa973('0xd'));var as=require(_0xa973('0xe'));var hardwareService=require(_0xa973('0xf'));var logger=require(_0xa973('0x10'))(_0xa973('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa973('0x12'))['db'];var integrations=require(_0xa973('0x13'));var jayson=require('jayson/promise');var client=jayson[_0xa973('0x14')][_0xa973('0x15')]({'port':0x232a});function checkPasswordPattern(_0x1e89e0,_0x3ef494,_0x4a3664){if(_0x4a3664){var _0x260cd8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x260cd8[_0xa973('0x16')](_0x3ef494)){return _0x1e89e0;}else{throw new db[(_0xa973('0x17'))]['ValidationError'](_0xa973('0x18'));}}else{return _0x1e89e0;}}function respondWithRpcPromise(_0x3bfd06,_0x17556a,_0x241d73,_0x58bd71){return new BPromise(function(_0xdf7a88,_0x31896b){var _0x5d6e2b=_0x58bd71||client;return _0x5d6e2b['request'](_0x3bfd06,_0x241d73)[_0xa973('0x19')](function(_0x1271bf){logger['info'](_0xa973('0x1a'),_0x17556a,_0xa973('0x1b'));logger[_0xa973('0x1c')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x17556a,_0xa973('0x1b'),JSON['stringify'](_0x1271bf));if(_0x1271bf[_0xa973('0x1d')]){if(_0x1271bf[_0xa973('0x1d')][_0xa973('0x1e')]===0x1f4){logger[_0xa973('0x1d')](_0xa973('0x1a'),_0x17556a,_0x1271bf[_0xa973('0x1d')][_0xa973('0x1f')]);return _0x31896b(_0x1271bf[_0xa973('0x1d')][_0xa973('0x1f')]);}logger[_0xa973('0x1d')](_0xa973('0x1a'),_0x17556a,_0x1271bf[_0xa973('0x1d')][_0xa973('0x1f')]);return _0xdf7a88(_0x1271bf['error'][_0xa973('0x1f')]);}else{logger[_0xa973('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x17556a,_0xa973('0x1b'));_0xdf7a88(_0x1271bf['result'][_0xa973('0x1f')]);}})[_0xa973('0x21')](function(_0x2cc99){logger[_0xa973('0x1d')](_0xa973('0x1a'),_0x17556a,_0x2cc99);_0x31896b(_0x2cc99);});});}function respondWithStatusCode(_0x451f88,_0x41ac7e){_0x41ac7e=_0x41ac7e||0xcc;return function(_0x10a589){if(_0x10a589){return _0x451f88['sendStatus'](_0x41ac7e);}return _0x451f88[_0xa973('0x22')](_0x41ac7e)[_0xa973('0x23')]();};}function respondWithResult(_0xec3922,_0x81e820){_0x81e820=_0x81e820||0xc8;return function(_0x46f6b5){if(_0x46f6b5){return _0xec3922[_0xa973('0x22')](_0x81e820)[_0xa973('0x24')](_0x46f6b5);}};}function respondWithFilteredResult(_0x3e1322,_0x31d0ea){return function(_0x472ba0){if(_0x472ba0){var _0x4869af=_0x472ba0[_0xa973('0x25')],_0x4e0419=_0x31d0ea[_0xa973('0x26')],_0x9e6fb1=_0x31d0ea[_0xa973('0x26')]+_0x31d0ea[_0xa973('0x27')],_0x3b580c;if(_0x9e6fb1>=_0x4869af){_0x9e6fb1=_0x4869af;_0x3b580c=0xc8;}else{_0x3b580c=0xce;}_0x3e1322[_0xa973('0x22')](_0x3b580c);return _0x3e1322['set'](_0xa973('0x28'),_0x4e0419+'-'+_0x9e6fb1+'/'+_0x4869af)['json'](_0x472ba0);}return null;};}function patchUpdates(_0x1cf9c4){return function(_0x558d66){try{jsonpatch['apply'](_0x558d66,_0x1cf9c4,!![]);}catch(_0x3395d0){return BPromise['reject'](_0x3395d0);}return _0x558d66[_0xa973('0x29')]();};}function saveUpdates(_0x5b76de,_0x58aa06){return function(_0x1e2156){if(_0x1e2156){return _0x1e2156['update'](_0x5b76de)[_0xa973('0x19')](function(_0x4359f1){return _0x4359f1;});}return null;};}function removeEntity(_0x3aff61,_0x1aadf0){return function(_0x1a0151){if(_0x1a0151){return _0x1a0151[_0xa973('0x2a')]()[_0xa973('0x19')](function(){_0x3aff61[_0xa973('0x22')](0xcc)[_0xa973('0x23')]();});}};}function handleEntityNotFound(_0x239f15,_0x248bda){return function(_0x2fdccd){if(!_0x2fdccd){_0x239f15[_0xa973('0x2b')](0x194);}return _0x2fdccd;};}function handleError(_0x20572b,_0x572672){_0x572672=_0x572672||0x1f4;return function(_0x76a20a){logger['error'](_0x76a20a['stack']);if(_0x76a20a[_0xa973('0x2c')]){delete _0x76a20a[_0xa973('0x2c')];}_0x20572b[_0xa973('0x22')](_0x572672)[_0xa973('0x2d')](_0x76a20a);};}exports[_0xa973('0x2e')]=function(_0x3845de,_0x307429){var _0x2db737={},_0x7f3626={},_0x9cc3f4={'count':0x0,'rows':[]};var _0x435858=_[_0xa973('0x2f')](db[_0xa973('0x30')][_0xa973('0x31')],function(_0x1fda1d){return{'name':_0x1fda1d[_0xa973('0x32')],'type':_0x1fda1d[_0xa973('0x33')][_0xa973('0x34')]};});_0x7f3626[_0xa973('0x35')]=_[_0xa973('0x2f')](_0x435858,'name');_0x7f3626[_0xa973('0x36')]=_[_0xa973('0x37')](_0x3845de[_0xa973('0x36')]);_0x7f3626[_0xa973('0x38')]=_[_0xa973('0x39')](_0x7f3626['model'],_0x7f3626[_0xa973('0x36')]);_0x2db737['attributes']=_['intersection'](_0x7f3626[_0xa973('0x35')],qs['fields'](_0x3845de[_0xa973('0x36')][_0xa973('0x3a')]));_0x2db737['attributes']=_0x2db737[_0xa973('0x3b')]['length']?_0x2db737[_0xa973('0x3b')]:_0x7f3626['model'];if(!_0x3845de['query'][_0xa973('0x3c')]('nolimit')){_0x2db737[_0xa973('0x27')]=qs[_0xa973('0x27')](_0x3845de[_0xa973('0x36')][_0xa973('0x27')]);_0x2db737[_0xa973('0x26')]=qs[_0xa973('0x26')](_0x3845de[_0xa973('0x36')]['offset']);}_0x2db737[_0xa973('0x3d')]=qs['sort'](_0x3845de[_0xa973('0x36')][_0xa973('0x3e')]);_0x2db737[_0xa973('0x3f')]=qs[_0xa973('0x38')](_['pick'](_0x3845de[_0xa973('0x36')],_0x7f3626['filters']));if(_0x3845de[_0xa973('0x36')][_0xa973('0x40')]){_0x2db737[_0xa973('0x3f')]=_[_0xa973('0x41')](_0x2db737[_0xa973('0x3f')],{'$or':_[_0xa973('0x2f')](_0x435858,function(_0x81e92a){if(_0x81e92a[_0xa973('0x33')]!=='VIRTUAL'){var _0x71b528={};_0x71b528[_0x81e92a[_0xa973('0x2c')]]={'$like':'%'+_0x3845de[_0xa973('0x36')][_0xa973('0x40')]+'%'};return _0x71b528;}})});}_0x2db737=_['merge']({},_0x2db737,_0x3845de[_0xa973('0x42')]);var _0x1132fb={'where':_0x2db737[_0xa973('0x3f')]};return db[_0xa973('0x30')][_0xa973('0x25')](_0x1132fb)['then'](function(_0x1eb14d){_0x9cc3f4[_0xa973('0x25')]=_0x1eb14d;if(_0x3845de['query'][_0xa973('0x43')]){_0x2db737[_0xa973('0x44')]=[{'all':!![]}];}return db[_0xa973('0x30')]['findAll'](_0x2db737);})[_0xa973('0x19')](function(_0x2a4c91){_0x9cc3f4[_0xa973('0x45')]=_0x2a4c91;return _0x9cc3f4;})[_0xa973('0x19')](respondWithFilteredResult(_0x307429,_0x2db737))[_0xa973('0x21')](handleError(_0x307429,null));};exports[_0xa973('0x46')]=function(_0x483cd3,_0x72164){var _0x3afead={'raw':![],'where':{'id':_0x483cd3[_0xa973('0x47')]['id']}},_0x4c9a4b={};_0x4c9a4b[_0xa973('0x35')]=_['keys'](db[_0xa973('0x30')][_0xa973('0x31')]);_0x4c9a4b['query']=_[_0xa973('0x37')](_0x483cd3['query']);_0x4c9a4b[_0xa973('0x38')]=_[_0xa973('0x39')](_0x4c9a4b[_0xa973('0x35')],_0x4c9a4b[_0xa973('0x36')]);_0x3afead['attributes']=_[_0xa973('0x39')](_0x4c9a4b[_0xa973('0x35')],qs[_0xa973('0x3a')](_0x483cd3[_0xa973('0x36')][_0xa973('0x3a')]));_0x3afead[_0xa973('0x3b')]=_0x3afead[_0xa973('0x3b')][_0xa973('0x48')]?_0x3afead[_0xa973('0x3b')]:_0x4c9a4b['model'];if(_0x483cd3[_0xa973('0x36')][_0xa973('0x43')]){_0x3afead[_0xa973('0x44')]=[{'all':!![]}];}_0x3afead=_[_0xa973('0x41')]({},_0x3afead,_0x483cd3[_0xa973('0x42')]);return db[_0xa973('0x30')][_0xa973('0x49')](_0x3afead)[_0xa973('0x19')](handleEntityNotFound(_0x72164,null))[_0xa973('0x19')](respondWithResult(_0x72164,null))[_0xa973('0x21')](handleError(_0x72164,null));};exports['create']=function(_0x2eb134,_0x3ee50d){return db[_0xa973('0x30')]['create'](_0x2eb134[_0xa973('0x4a')],{})['then'](respondWithResult(_0x3ee50d,0xc9))[_0xa973('0x21')](handleError(_0x3ee50d,null));};exports[_0xa973('0x4b')]=function(_0x32b174,_0x54b566){if(_0x32b174[_0xa973('0x4a')]['id']){delete _0x32b174['body']['id'];}return db['FreshdeskAccount'][_0xa973('0x49')]({'where':{'id':_0x32b174[_0xa973('0x47')]['id']}})[_0xa973('0x19')](handleEntityNotFound(_0x54b566,null))[_0xa973('0x19')](saveUpdates(_0x32b174[_0xa973('0x4a')],null))[_0xa973('0x19')](respondWithResult(_0x54b566,null))[_0xa973('0x21')](handleError(_0x54b566,null));};exports[_0xa973('0x2a')]=function(_0x30a212,_0x3a7eb8){return db[_0xa973('0x30')][_0xa973('0x49')]({'where':{'id':_0x30a212[_0xa973('0x47')]['id']}})[_0xa973('0x19')](handleEntityNotFound(_0x3a7eb8,null))[_0xa973('0x19')](removeEntity(_0x3a7eb8,null))[_0xa973('0x21')](handleError(_0x3a7eb8,null));};exports[_0xa973('0x4c')]=function(_0x2a44c1,_0x4a3c36,_0x560632){var _0x1916f8={};var _0x519ad0={};var _0x5e79dc;var _0x5a72a0;return db[_0xa973('0x30')][_0xa973('0x4d')]({'where':{'id':_0x2a44c1[_0xa973('0x47')]['id']}})[_0xa973('0x19')](handleEntityNotFound(_0x4a3c36,null))[_0xa973('0x19')](function(_0x72c49a){if(_0x72c49a){_0x5e79dc=_0x72c49a;_0x519ad0[_0xa973('0x35')]=_[_0xa973('0x37')](db[_0xa973('0x4e')]['rawAttributes']);_0x519ad0[_0xa973('0x36')]=_['keys'](_0x2a44c1[_0xa973('0x36')]);_0x519ad0[_0xa973('0x38')]=_['intersection'](_0x519ad0[_0xa973('0x35')],_0x519ad0[_0xa973('0x36')]);_0x1916f8[_0xa973('0x3b')]=_[_0xa973('0x39')](_0x519ad0['model'],qs[_0xa973('0x3a')](_0x2a44c1[_0xa973('0x36')][_0xa973('0x3a')]));_0x1916f8[_0xa973('0x3b')]=_0x1916f8[_0xa973('0x3b')]['length']?_0x1916f8['attributes']:_0x519ad0['model'];_0x1916f8[_0xa973('0x3d')]=qs[_0xa973('0x3e')](_0x2a44c1[_0xa973('0x36')][_0xa973('0x3e')]);_0x1916f8[_0xa973('0x3f')]=qs[_0xa973('0x38')](_[_0xa973('0x4f')](_0x2a44c1['query'],_0x519ad0['filters']));if(_0x2a44c1['query']['filter']){_0x1916f8['where']=_[_0xa973('0x41')](_0x1916f8[_0xa973('0x3f')],{'$or':_[_0xa973('0x2f')](_0x1916f8[_0xa973('0x3b')],function(_0xb76da4){var _0x4129a0={};_0x4129a0[_0xb76da4]={'$like':'%'+_0x2a44c1['query'][_0xa973('0x40')]+'%'};return _0x4129a0;})});}_0x1916f8=_[_0xa973('0x41')]({},_0x1916f8,_0x2a44c1[_0xa973('0x42')]);return _0x5e79dc[_0xa973('0x4c')](_0x1916f8);}})[_0xa973('0x19')](function(_0x4d757f){if(_0x4d757f){_0x5a72a0=_0x4d757f[_0xa973('0x48')];if(!_0x2a44c1[_0xa973('0x36')][_0xa973('0x3c')](_0xa973('0x50'))){_0x1916f8[_0xa973('0x27')]=qs[_0xa973('0x27')](_0x2a44c1['query'][_0xa973('0x27')]);_0x1916f8[_0xa973('0x26')]=qs[_0xa973('0x26')](_0x2a44c1[_0xa973('0x36')][_0xa973('0x26')]);}return _0x5e79dc['getConfigurations'](_0x1916f8);}})['then'](function(_0x266a16){if(_0x266a16){return _0x266a16?{'count':_0x5a72a0,'rows':_0x266a16}:null;}})[_0xa973('0x19')](respondWithResult(_0x4a3c36,null))[_0xa973('0x21')](handleError(_0x4a3c36,null));};exports[_0xa973('0x51')]=function(_0x560eb0,_0x25b0a6,_0x4f8049){if(_0x560eb0[_0xa973('0x4a')]['id']){delete _0x560eb0['body']['id'];}return db[_0xa973('0x30')][_0xa973('0x4d')]({'where':{'id':_0x560eb0[_0xa973('0x47')]['id']}})['then'](handleEntityNotFound(_0x25b0a6,null))[_0xa973('0x19')](function(_0x289170){if(_0x289170){_0x560eb0['body']['AccountId']=_0x289170['id'];_0x560eb0[_0xa973('0x4a')][_0xa973('0x52')]=integrations[_0xa973('0x53')](_0x560eb0[_0xa973('0x4a')][_0xa973('0x54')],_0x560eb0['body']['type']);_0x560eb0[_0xa973('0x4a')][_0xa973('0x55')]=integrations[_0xa973('0x56')](_0x560eb0[_0xa973('0x4a')][_0xa973('0x54')],_0x560eb0[_0xa973('0x4a')][_0xa973('0x33')]);return db[_0xa973('0x4e')]['create'](_0x560eb0[_0xa973('0x4a')],{'include':[{'model':db[_0xa973('0x57')],'as':_0xa973('0x52')},{'model':db[_0xa973('0x57')],'as':'Descriptions'}]});}return null;})[_0xa973('0x19')](respondWithResult(_0x25b0a6,null))[_0xa973('0x21')](handleError(_0x25b0a6,null));};exports[_0xa973('0x58')]=function(_0x3f98c8,_0x87bb76,_0x38db24){var _0x580ba1='';return db['FreshdeskAccount'][_0xa973('0x4d')]({'where':{'id':_0x3f98c8[_0xa973('0x47')]['id']},'attributes':['id',_0xa973('0x59'),_0xa973('0x5a')]})[_0xa973('0x19')](handleEntityNotFound(_0x87bb76,null))['then'](function(_0xd57a93){if(_0xd57a93){_0x580ba1=_0xd57a93[_0xa973('0x59')];var _0x2d7f79=_0x580ba1[_0xa973('0x5b')](-0x1);if(_0x2d7f79==='/'){_0x580ba1=_0x580ba1[_0xa973('0x5c')](0x0,_0x580ba1['lastIndexOf'](_0x2d7f79));}return rp({'method':_0xa973('0x5d'),'uri':util[_0xa973('0x5e')](_0xa973('0x5f'),_0x580ba1,_0xa973('0x60')),'headers':{'Authorization':util['format'](_0xa973('0x61'),new Buffer(util[_0xa973('0x5e')](_0xa973('0x62'),_0xd57a93[_0xa973('0x5a')]))[_0xa973('0x63')](_0xa973('0x64')))},'json':!![]});}})[_0xa973('0x19')](function(_0x1365aa){if(_0x1365aa){var _0x17cab6=[_0xa973('0x65'),_0xa973('0x66'),_0xa973('0x67'),_0xa973('0x68'),_0xa973('0x22'),_0xa973('0x69'),_0xa973('0x6a'),_0xa973('0x6b'),_0xa973('0x6c'),_0xa973('0x6a'),'company'];_['remove'](_0x1365aa,function(_0xd39773){return _0x17cab6[_0xa973('0x6d')](_0xd39773[_0xa973('0x2c')])||!_0xd39773[_0xa973('0x6e')]&&_0xd39773[_0xa973('0x33')]!==_0xa973('0x6f')&&_0xd39773[_0xa973('0x33')]!==_0xa973('0x70');});return{'count':_0x1365aa[_0xa973('0x48')],'rows':_[_0xa973('0x2f')](_0x1365aa,function(_0x37ebb9){return{'id':_0x37ebb9[_0xa973('0x2c')],'name':_0x37ebb9['label'],'custom':!_0x37ebb9[_0xa973('0x6e')],'options':_0x37ebb9['choices']?_[_0xa973('0x2f')](_0x37ebb9[_0xa973('0x71')],function(_0x23a615){return{'name':_[_0xa973('0x72')](_0x23a615),'value':_0x23a615};}):[]};})};}})['then'](respondWithResult(_0x87bb76,null))[_0xa973('0x21')](function(_0x5e8523){var _0xdad2c8=_0x3f98c8[_0xa973('0x36')]['test']?0x1f4:_0x5e8523[_0xa973('0x73')]||0x1f4;logger[_0xa973('0x1d')](_0xa973('0x74'),_0xa973('0x58'),_0xdad2c8,JSON[_0xa973('0x75')](_0x5e8523));delete _0x5e8523[_0xa973('0x2c')];if(_0xdad2c8===0x191){_0xdad2c8=0x190;}_0x87bb76[_0xa973('0x22')](_0xdad2c8)[_0xa973('0x2d')](_0x3f98c8[_0xa973('0x36')][_0xa973('0x16')]?{'message':_0xa973('0x76'),'statusCode':_0x5e8523[_0xa973('0x73')]}:_0x5e8523);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5ea5f82..db1e0a6 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 _0x0b68=['path','../../config/environment','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x90dfbc,_0x95b9a9){var _0x47f28b=function(_0x310fac){while(--_0x310fac){_0x90dfbc['push'](_0x90dfbc['shift']());}};_0x47f28b(++_0x95b9a9);}(_0x0b68,0xae));var _0x80b6=function(_0x311363,_0x45ae31){_0x311363=_0x311363-0x0;var _0x5cfa66=_0x0b68[_0x311363];return _0x5cfa66;};'use strict';var _=require(_0x80b6('0x0'));var util=require(_0x80b6('0x1'));var logger=require(_0x80b6('0x2'))(_0x80b6('0x3'));var moment=require(_0x80b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x80b6('0x5'));var fs=require('fs');var path=require(_0x80b6('0x6'));var rimraf=require('rimraf');var config=require(_0x80b6('0x7'));var attributes=require(_0x80b6('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x35c38a,_0x259849){return _0x35c38a[_0x80b6('0x9')](_0x80b6('0xa'),attributes,{'tableName':_0x80b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0690=['FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x5255f1,_0x350069){var _0x41b7c2=function(_0x249fa0){while(--_0x249fa0){_0x5255f1['push'](_0x5255f1['shift']());}};_0x41b7c2(++_0x350069);}(_0x0690,0xaa));var _0x0069=function(_0x56fc4f,_0xd1f6a){_0x56fc4f=_0x56fc4f-0x0;var _0x5d0c0b=_0x0690[_0x56fc4f];return _0x5d0c0b;};'use strict';var _=require(_0x0069('0x0'));var util=require('util');var logger=require(_0x0069('0x1'))(_0x0069('0x2'));var moment=require(_0x0069('0x3'));var BPromise=require(_0x0069('0x4'));var rp=require(_0x0069('0x5'));var fs=require('fs');var path=require(_0x0069('0x6'));var rimraf=require(_0x0069('0x7'));var config=require(_0x0069('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0069('0x9'));module[_0x0069('0xa')]=function(_0xcc8afc,_0x514ea2){return _0xcc8afc[_0x0069('0xb')](_0x0069('0xc'),attributes,{'tableName':_0x0069('0xd'),'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 c997e6e..8c72982 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 _0x928d=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','moment','randomstring'];(function(_0x584513,_0x37c6c9){var _0xe4a14e=function(_0x4aadc0){while(--_0x4aadc0){_0x584513['push'](_0x584513['shift']());}};_0xe4a14e(++_0x37c6c9);}(_0x928d,0x1aa));var _0xd928=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x928d[_0x432682];return _0x463d05;};'use strict';var _=require(_0xd928('0x0'));var util=require('util');var moment=require(_0xd928('0x1'));var BPromise=require('bluebird');var rs=require(_0xd928('0x2'));var fs=require('fs');var Redis=require(_0xd928('0x3'));var db=require(_0xd928('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd928('0x5'))(_0xd928('0x6'));var config=require(_0xd928('0x7'));var jayson=require(_0xd928('0x8'));var client=jayson[_0xd928('0x9')][_0xd928('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6a6fd6,_0x3d7f87,_0x5e3e81){return new BPromise(function(_0x45955b,_0x191212){return client['request'](_0x6a6fd6,_0x5e3e81)[_0xd928('0xb')](function(_0x4dabf9){logger[_0xd928('0xc')](_0xd928('0xd'),_0x3d7f87,'request\x20sent');logger[_0xd928('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3d7f87,_0xd928('0xf'),JSON[_0xd928('0x10')](_0x4dabf9));if(_0x4dabf9[_0xd928('0x11')]){if(_0x4dabf9['error']['code']===0x1f4){logger[_0xd928('0x11')](_0xd928('0xd'),_0x3d7f87,_0x4dabf9[_0xd928('0x11')]['message']);return _0x191212(_0x4dabf9['error'][_0xd928('0x12')]);}logger[_0xd928('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x3d7f87,_0x4dabf9[_0xd928('0x11')][_0xd928('0x12')]);return _0x45955b(_0x4dabf9[_0xd928('0x11')][_0xd928('0x12')]);}else{logger[_0xd928('0xc')](_0xd928('0xd'),_0x3d7f87,_0xd928('0xf'));_0x45955b(_0x4dabf9[_0xd928('0x13')][_0xd928('0x12')]);}})[_0xd928('0x14')](function(_0x2faf23){logger[_0xd928('0x11')](_0xd928('0xd'),_0x3d7f87,_0x2faf23);_0x191212(_0x2faf23);});});}exports['GetFreshdeskAccount']=function(_0x2270af){var _0x4c4714=this;return new Promise(function(_0x207df9,_0x2ba5f9){return db['FreshdeskAccount']['findAll']({'raw':_0x2270af['options']?_0x2270af[_0xd928('0x15')][_0xd928('0x16')]===undefined?!![]:![]:!![],'where':_0x2270af[_0xd928('0x15')]?_0x2270af[_0xd928('0x15')][_0xd928('0x17')]||null:null,'attributes':_0x2270af[_0xd928('0x15')]?_0x2270af[_0xd928('0x15')][_0xd928('0x18')]||null:null,'limit':_0x2270af[_0xd928('0x15')]?_0x2270af['options'][_0xd928('0x19')]||null:null,'include':_0x2270af[_0xd928('0x15')]?_0x2270af[_0xd928('0x15')][_0xd928('0x1a')]?_[_0xd928('0x1b')](_0x2270af['options'][_0xd928('0x1a')],function(_0x30913a){return{'model':db[_0x30913a[_0xd928('0x1c')]],'as':_0x30913a['as'],'attributes':_0x30913a[_0xd928('0x18')],'include':_0x30913a[_0xd928('0x1a')]?_[_0xd928('0x1b')](_0x30913a[_0xd928('0x1a')],function(_0x56512e){return{'model':db[_0x56512e['model']],'as':_0x56512e['as'],'attributes':_0x56512e['attributes'],'include':_0x56512e[_0xd928('0x1a')]?_[_0xd928('0x1b')](_0x56512e[_0xd928('0x1a')],function(_0x18426d){return{'model':db[_0x18426d[_0xd928('0x1c')]],'as':_0x18426d['as'],'attributes':_0x18426d[_0xd928('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd928('0xb')](function(_0x58cc39){logger[_0xd928('0xc')]('GetFreshdeskAccount',_0x2270af);logger[_0xd928('0xe')](_0xd928('0x1d'),_0x2270af,JSON[_0xd928('0x10')](_0x58cc39));_0x207df9(_0x58cc39);})[_0xd928('0x14')](function(_0x4ecb37){logger['error'](_0xd928('0x1d'),_0x4ecb37[_0xd928('0x12')],_0x2270af);_0x2ba5f9(_0x4c4714[_0xd928('0x11')](0x1f4,_0x4ecb37[_0xd928('0x12')]));});});};exports[_0xd928('0x1e')]=function(_0x385446){var _0x6fe555=this;return new Promise(function(_0x38bd30,_0x52ab51){return db[_0xd928('0x1f')][_0xd928('0x20')]({'raw':_0x385446['options']?_0x385446[_0xd928('0x15')][_0xd928('0x16')]===undefined?!![]:![]:!![],'where':_0x385446[_0xd928('0x15')]?_0x385446[_0xd928('0x15')][_0xd928('0x17')]||null:null,'attributes':_0x385446[_0xd928('0x15')]?_0x385446[_0xd928('0x15')][_0xd928('0x18')]||null:null,'include':_0x385446[_0xd928('0x15')]?_0x385446[_0xd928('0x15')]['include']?_[_0xd928('0x1b')](_0x385446[_0xd928('0x15')]['include'],function(_0x49cc01){return{'model':db[_0x49cc01[_0xd928('0x1c')]],'as':_0x49cc01['as'],'attributes':_0x49cc01[_0xd928('0x18')],'include':_0x49cc01[_0xd928('0x1a')]?_[_0xd928('0x1b')](_0x49cc01[_0xd928('0x1a')],function(_0x316039){return{'model':db[_0x316039[_0xd928('0x1c')]],'as':_0x316039['as'],'attributes':_0x316039['attributes'],'include':_0x316039[_0xd928('0x1a')]?_['map'](_0x316039['include'],function(_0x809737){return{'model':db[_0x809737[_0xd928('0x1c')]],'as':_0x809737['as'],'attributes':_0x809737[_0xd928('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd928('0xb')](function(_0x1b5c49){logger[_0xd928('0xc')](_0xd928('0x1e'),_0x385446);logger['debug'](_0xd928('0x1e'),_0x385446,JSON[_0xd928('0x10')](_0x1b5c49));_0x38bd30(_0x1b5c49);})[_0xd928('0x14')](function(_0x481078){logger[_0xd928('0x11')](_0xd928('0x1e'),_0x481078[_0xd928('0x12')],_0x385446);_0x52ab51(_0x6fe555['error'](0x1f4,_0x481078[_0xd928('0x12')]));});});}; \ No newline at end of file +var _0x9444=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','info','result','findAll','options','raw','attributes','include','model','then','GetFreshdeskAccount','catch','FreshdeskAccount','find','map','ShowFreshdeskAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','debug'];(function(_0x123509,_0x172990){var _0x1957df=function(_0x57fa16){while(--_0x57fa16){_0x123509['push'](_0x123509['shift']());}};_0x1957df(++_0x172990);}(_0x9444,0xe1));var _0x4944=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x9444[_0x460fd7];return _0x44d1c2;};'use strict';var _=require('lodash');var util=require(_0x4944('0x0'));var moment=require(_0x4944('0x1'));var BPromise=require(_0x4944('0x2'));var rs=require(_0x4944('0x3'));var fs=require('fs');var Redis=require(_0x4944('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4944('0x5'));var logger=require(_0x4944('0x6'))(_0x4944('0x7'));var config=require(_0x4944('0x8'));var jayson=require(_0x4944('0x9'));var client=jayson[_0x4944('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b213a,_0x23c329,_0xdc988){return new BPromise(function(_0x3f9509,_0x3a540c){return client[_0x4944('0xb')](_0x5b213a,_0xdc988)['then'](function(_0x264d93){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x23c329,'request\x20sent');logger[_0x4944('0xc')](_0x4944('0xd'),_0x23c329,_0x4944('0xe'),JSON[_0x4944('0xf')](_0x264d93));if(_0x264d93[_0x4944('0x10')]){if(_0x264d93[_0x4944('0x10')]['code']===0x1f4){logger[_0x4944('0x10')](_0x4944('0x11'),_0x23c329,_0x264d93[_0x4944('0x10')][_0x4944('0x12')]);return _0x3a540c(_0x264d93[_0x4944('0x10')][_0x4944('0x12')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x23c329,_0x264d93['error']['message']);return _0x3f9509(_0x264d93[_0x4944('0x10')][_0x4944('0x12')]);}else{logger[_0x4944('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x23c329,_0x4944('0xe'));_0x3f9509(_0x264d93[_0x4944('0x14')]['message']);}})['catch'](function(_0xd71c58){logger[_0x4944('0x10')](_0x4944('0x11'),_0x23c329,_0xd71c58);_0x3a540c(_0xd71c58);});});}exports['GetFreshdeskAccount']=function(_0x4d8833){var _0x2cba6e=this;return new Promise(function(_0x348ad6,_0x5254ac){return db['FreshdeskAccount'][_0x4944('0x15')]({'raw':_0x4d8833['options']?_0x4d8833[_0x4944('0x16')][_0x4944('0x17')]===undefined?!![]:![]:!![],'where':_0x4d8833[_0x4944('0x16')]?_0x4d8833[_0x4944('0x16')]['where']||null:null,'attributes':_0x4d8833[_0x4944('0x16')]?_0x4d8833['options'][_0x4944('0x18')]||null:null,'limit':_0x4d8833[_0x4944('0x16')]?_0x4d8833[_0x4944('0x16')]['limit']||null:null,'include':_0x4d8833[_0x4944('0x16')]?_0x4d8833[_0x4944('0x16')]['include']?_['map'](_0x4d8833[_0x4944('0x16')][_0x4944('0x19')],function(_0x2b9aad){return{'model':db[_0x2b9aad[_0x4944('0x1a')]],'as':_0x2b9aad['as'],'attributes':_0x2b9aad[_0x4944('0x18')],'include':_0x2b9aad[_0x4944('0x19')]?_['map'](_0x2b9aad['include'],function(_0x2fed87){return{'model':db[_0x2fed87[_0x4944('0x1a')]],'as':_0x2fed87['as'],'attributes':_0x2fed87['attributes'],'include':_0x2fed87[_0x4944('0x19')]?_['map'](_0x2fed87['include'],function(_0x25548e){return{'model':db[_0x25548e[_0x4944('0x1a')]],'as':_0x25548e['as'],'attributes':_0x25548e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4944('0x1b')](function(_0x247670){logger[_0x4944('0x13')]('GetFreshdeskAccount',_0x4d8833);logger[_0x4944('0xc')](_0x4944('0x1c'),_0x4d8833,JSON[_0x4944('0xf')](_0x247670));_0x348ad6(_0x247670);})[_0x4944('0x1d')](function(_0x32dab5){logger[_0x4944('0x10')]('GetFreshdeskAccount',_0x32dab5[_0x4944('0x12')],_0x4d8833);_0x5254ac(_0x2cba6e['error'](0x1f4,_0x32dab5[_0x4944('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x424e22){var _0x2e590e=this;return new Promise(function(_0x13efd8,_0x48a9c5){return db[_0x4944('0x1e')][_0x4944('0x1f')]({'raw':_0x424e22[_0x4944('0x16')]?_0x424e22[_0x4944('0x16')][_0x4944('0x17')]===undefined?!![]:![]:!![],'where':_0x424e22[_0x4944('0x16')]?_0x424e22[_0x4944('0x16')]['where']||null:null,'attributes':_0x424e22[_0x4944('0x16')]?_0x424e22[_0x4944('0x16')][_0x4944('0x18')]||null:null,'include':_0x424e22[_0x4944('0x16')]?_0x424e22['options'][_0x4944('0x19')]?_['map'](_0x424e22[_0x4944('0x16')][_0x4944('0x19')],function(_0x577ded){return{'model':db[_0x577ded['model']],'as':_0x577ded['as'],'attributes':_0x577ded[_0x4944('0x18')],'include':_0x577ded[_0x4944('0x19')]?_[_0x4944('0x20')](_0x577ded['include'],function(_0x1f18a6){return{'model':db[_0x1f18a6[_0x4944('0x1a')]],'as':_0x1f18a6['as'],'attributes':_0x1f18a6[_0x4944('0x18')],'include':_0x1f18a6[_0x4944('0x19')]?_['map'](_0x1f18a6[_0x4944('0x19')],function(_0x55a873){return{'model':db[_0x55a873[_0x4944('0x1a')]],'as':_0x55a873['as'],'attributes':_0x55a873[_0x4944('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4944('0x1b')](function(_0x6f73ee){logger['info'](_0x4944('0x21'),_0x424e22);logger['debug'](_0x4944('0x21'),_0x424e22,JSON['stringify'](_0x6f73ee));_0x13efd8(_0x6f73ee);})[_0x4944('0x1d')](function(_0x29a5a0){logger[_0x4944('0x10')]('ShowFreshdeskAccount',_0x29a5a0[_0x4944('0x12')],_0x424e22);_0x48a9c5(_0x2e590e['error'](0x1f4,_0x29a5a0[_0x4944('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 803074c..8173bd0 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 _0xcf27=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','put','delete','destroy'];(function(_0x44594d,_0x44470c){var _0x1bff66=function(_0x45a4b9){while(--_0x45a4b9){_0x44594d['push'](_0x44594d['shift']());}};_0x1bff66(++_0x44470c);}(_0xcf27,0x165));var _0x7cf2=function(_0x12b7ea,_0x2a0ae7){_0x12b7ea=_0x12b7ea-0x0;var _0x3c6650=_0xcf27[_0x12b7ea];return _0x3c6650;};'use strict';var multer=require(_0x7cf2('0x0'));var util=require('util');var path=require(_0x7cf2('0x1'));var timeout=require(_0x7cf2('0x2'));var express=require(_0x7cf2('0x3'));var router=express[_0x7cf2('0x4')]();var auth=require(_0x7cf2('0x5'));var interaction=require(_0x7cf2('0x6'));var config=require(_0x7cf2('0x7'));var controller=require(_0x7cf2('0x8'));router[_0x7cf2('0x9')]('/',auth[_0x7cf2('0xa')](),controller[_0x7cf2('0xb')]);router['get'](_0x7cf2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7cf2('0x9')]('/:id/fields',auth[_0x7cf2('0xa')](),controller[_0x7cf2('0xd')]);router[_0x7cf2('0x9')](_0x7cf2('0xe'),auth[_0x7cf2('0xa')](),controller[_0x7cf2('0xf')]);router[_0x7cf2('0x9')](_0x7cf2('0x10'),auth[_0x7cf2('0xa')](),controller['getDescriptions']);router[_0x7cf2('0x9')]('/:id/tags',auth[_0x7cf2('0xa')](),controller['getTags']);router['post']('/',auth[_0x7cf2('0xa')](),controller['create']);router['post'](_0x7cf2('0x11'),auth[_0x7cf2('0xa')](),controller['setTags']);router[_0x7cf2('0x12')](_0x7cf2('0xc'),auth[_0x7cf2('0xa')](),controller['update']);router[_0x7cf2('0x13')]('/:id',auth[_0x7cf2('0xa')](),controller[_0x7cf2('0x14')]);module['exports']=router; \ No newline at end of file +var _0x412f=['/:id/descriptions','getDescriptions','getTags','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x93bb37,_0x5a6236){var _0x50e764=function(_0x132ac8){while(--_0x132ac8){_0x93bb37['push'](_0x93bb37['shift']());}};_0x50e764(++_0x5a6236);}(_0x412f,0xe1));var _0xf412=function(_0x1216b1,_0x5b3c87){_0x1216b1=_0x1216b1-0x0;var _0x477c24=_0x412f[_0x1216b1];return _0x477c24;};'use strict';var multer=require(_0xf412('0x0'));var util=require(_0xf412('0x1'));var path=require('path');var timeout=require(_0xf412('0x2'));var express=require(_0xf412('0x3'));var router=express['Router']();var auth=require(_0xf412('0x4'));var interaction=require(_0xf412('0x5'));var config=require('../../config/environment');var controller=require(_0xf412('0x6'));router['get']('/',auth[_0xf412('0x7')](),controller['index']);router[_0xf412('0x8')](_0xf412('0x9'),auth[_0xf412('0x7')](),controller[_0xf412('0xa')]);router['get'](_0xf412('0xb'),auth['isAuthenticated'](),controller[_0xf412('0xc')]);router[_0xf412('0x8')](_0xf412('0xd'),auth['isAuthenticated'](),controller[_0xf412('0xe')]);router[_0xf412('0x8')](_0xf412('0xf'),auth['isAuthenticated'](),controller[_0xf412('0x10')]);router[_0xf412('0x8')]('/:id/tags',auth[_0xf412('0x7')](),controller[_0xf412('0x11')]);router[_0xf412('0x12')]('/',auth[_0xf412('0x7')](),controller['create']);router[_0xf412('0x12')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xf412('0x13')](_0xf412('0x9'),auth[_0xf412('0x7')](),controller[_0xf412('0x14')]);router[_0xf412('0x15')]('/:id',auth[_0xf412('0x7')](),controller[_0xf412('0x16')]);module[_0xf412('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0826875..84a3034 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 _0x522a=['STRING','sequelize'];(function(_0x535ba0,_0x5ee0d7){var _0x699013=function(_0x55e738){while(--_0x55e738){_0x535ba0['push'](_0x535ba0['shift']());}};_0x699013(++_0x5ee0d7);}(_0x522a,0x15b));var _0xa522=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0x522a[_0xcdac34];return _0x269d23;};'use strict';var Sequelize=require(_0xa522('0x0'));module['exports']={'name':{'type':Sequelize[_0xa522('0x1')]},'description':{'type':Sequelize[_0xa522('0x1')]}}; \ No newline at end of file +var _0x3f35=['STRING','sequelize','exports'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x3f35,0x1e4));var _0x53f3=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x3f35[_0x166d93];return _0xba708;};'use strict';var Sequelize=require(_0x53f3('0x0'));module[_0x53f3('0x1')]={'name':{'type':Sequelize[_0x53f3('0x2')]},'description':{'type':Sequelize[_0x53f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 6e7dee2..18d918b 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 _0xbcf4=['find','getFields','findOne','nolimit','getSubjects','getDescriptions','FreshdeskField','hasOwnProperty','getTags','Tag','pick','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','count','offset','set','save','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','key','model','query','filters','attributes','intersection','fields','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','create','body'];(function(_0x1e6b48,_0x4f0eab){var _0x2be510=function(_0x58059c){while(--_0x58059c){_0x1e6b48['push'](_0x1e6b48['shift']());}};_0x2be510(++_0x4f0eab);}(_0xbcf4,0x1d9));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4bcf('0x0'));var emlformat=require(_0x4bcf('0x1'));var rimraf=require(_0x4bcf('0x2'));var zipdir=require(_0x4bcf('0x3'));var jsonpatch=require(_0x4bcf('0x4'));var rp=require(_0x4bcf('0x5'));var moment=require(_0x4bcf('0x6'));var BPromise=require(_0x4bcf('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4bcf('0x8'));var ejs=require(_0x4bcf('0x9'));var fs=require('fs');var _=require(_0x4bcf('0xa'));var squel=require(_0x4bcf('0xb'));var crypto=require(_0x4bcf('0xc'));var jsforce=require(_0x4bcf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4bcf('0xe'));var Papa=require(_0x4bcf('0xf'));var Redis=require(_0x4bcf('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4bcf('0x11'));var hardwareService=require(_0x4bcf('0x12'));var logger=require(_0x4bcf('0x13'))(_0x4bcf('0x14'));var utils=require(_0x4bcf('0x15'));var config=require('../../config/environment');var db=require(_0x4bcf('0x16'))['db'];var jayson=require(_0x4bcf('0x17'));var client=jayson[_0x4bcf('0x18')][_0x4bcf('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5b8e19,_0x17502e,_0x2c0435){if(_0x2c0435){var _0x5ec7fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ec7fb[_0x4bcf('0x1a')](_0x17502e)){return _0x5b8e19;}else{throw new db[(_0x4bcf('0x1b'))]['ValidationError'](_0x4bcf('0x1c'));}}else{return _0x5b8e19;}}function respondWithRpcPromise(_0x6808cf,_0x113b3f,_0x38b214,_0x1229f7){return new BPromise(function(_0x3470b7,_0x27e818){var _0xcd3e08=_0x1229f7||client;return _0xcd3e08['request'](_0x6808cf,_0x38b214)[_0x4bcf('0x1d')](function(_0x5ef963){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x113b3f,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x113b3f,_0x4bcf('0x1e'),JSON['stringify'](_0x5ef963));if(_0x5ef963[_0x4bcf('0x1f')]){if(_0x5ef963[_0x4bcf('0x1f')][_0x4bcf('0x20')]===0x1f4){logger[_0x4bcf('0x1f')](_0x4bcf('0x21'),_0x113b3f,_0x5ef963['error'][_0x4bcf('0x22')]);return _0x27e818(_0x5ef963[_0x4bcf('0x1f')][_0x4bcf('0x22')]);}logger['error'](_0x4bcf('0x21'),_0x113b3f,_0x5ef963[_0x4bcf('0x1f')][_0x4bcf('0x22')]);return _0x3470b7(_0x5ef963[_0x4bcf('0x1f')][_0x4bcf('0x22')]);}else{logger[_0x4bcf('0x23')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x113b3f,'request\x20sent');_0x3470b7(_0x5ef963[_0x4bcf('0x24')]['message']);}})['catch'](function(_0x39c39b){logger[_0x4bcf('0x1f')](_0x4bcf('0x21'),_0x113b3f,_0x39c39b);_0x27e818(_0x39c39b);});});}function respondWithStatusCode(_0x17ae68,_0xbecbe2){_0xbecbe2=_0xbecbe2||0xcc;return function(_0x20a95a){if(_0x20a95a){return _0x17ae68[_0x4bcf('0x25')](_0xbecbe2);}return _0x17ae68[_0x4bcf('0x26')](_0xbecbe2)[_0x4bcf('0x27')]();};}function respondWithResult(_0x28d65d,_0x2816c6){_0x2816c6=_0x2816c6||0xc8;return function(_0x2a66e2){if(_0x2a66e2){return _0x28d65d['status'](_0x2816c6)[_0x4bcf('0x28')](_0x2a66e2);}};}function respondWithFilteredResult(_0x53c1c9,_0xb7f351){return function(_0x143aae){if(_0x143aae){var _0x2963e3=_0x143aae[_0x4bcf('0x29')],_0xcc3c1b=_0xb7f351['offset'],_0x3c5c01=_0xb7f351[_0x4bcf('0x2a')]+_0xb7f351['limit'],_0x319ab3;if(_0x3c5c01>=_0x2963e3){_0x3c5c01=_0x2963e3;_0x319ab3=0xc8;}else{_0x319ab3=0xce;}_0x53c1c9[_0x4bcf('0x26')](_0x319ab3);return _0x53c1c9[_0x4bcf('0x2b')]('Content-Range',_0xcc3c1b+'-'+_0x3c5c01+'/'+_0x2963e3)[_0x4bcf('0x28')](_0x143aae);}return null;};}function patchUpdates(_0x460460){return function(_0x1f4db2){try{jsonpatch['apply'](_0x1f4db2,_0x460460,!![]);}catch(_0x234a96){return BPromise['reject'](_0x234a96);}return _0x1f4db2[_0x4bcf('0x2c')]();};}function saveUpdates(_0xe52db7,_0x139d14){return function(_0x368f01){if(_0x368f01){return _0x368f01[_0x4bcf('0x2d')](_0xe52db7)[_0x4bcf('0x1d')](function(_0x21a960){return _0x21a960;});}return null;};}function removeEntity(_0x458ac0,_0x2dd492){return function(_0x593c4c){if(_0x593c4c){return _0x593c4c[_0x4bcf('0x2e')]()[_0x4bcf('0x1d')](function(){_0x458ac0[_0x4bcf('0x26')](0xcc)[_0x4bcf('0x27')]();});}};}function handleEntityNotFound(_0x56382d,_0x14190f){return function(_0x39d9ec){if(!_0x39d9ec){_0x56382d[_0x4bcf('0x25')](0x194);}return _0x39d9ec;};}function handleError(_0xc2f31e,_0x20f510){_0x20f510=_0x20f510||0x1f4;return function(_0x47fb41){logger[_0x4bcf('0x1f')](_0x47fb41[_0x4bcf('0x2f')]);if(_0x47fb41['name']){delete _0x47fb41[_0x4bcf('0x30')];}_0xc2f31e['status'](_0x20f510)[_0x4bcf('0x31')](_0x47fb41);};}exports[_0x4bcf('0x32')]=function(_0x4fbf8c,_0x49f5eb){var _0x4abef2={},_0x13ec61={},_0x57674f={'count':0x0,'rows':[]};var _0x43384c=_[_0x4bcf('0x33')](db[_0x4bcf('0x34')]['rawAttributes'],function(_0x509289){return{'name':_0x509289['fieldName'],'type':_0x509289['type'][_0x4bcf('0x35')]};});_0x13ec61[_0x4bcf('0x36')]=_[_0x4bcf('0x33')](_0x43384c,_0x4bcf('0x30'));_0x13ec61[_0x4bcf('0x37')]=_['keys'](_0x4fbf8c['query']);_0x13ec61[_0x4bcf('0x38')]=_['intersection'](_0x13ec61[_0x4bcf('0x36')],_0x13ec61[_0x4bcf('0x37')]);_0x4abef2[_0x4bcf('0x39')]=_[_0x4bcf('0x3a')](_0x13ec61[_0x4bcf('0x36')],qs[_0x4bcf('0x3b')](_0x4fbf8c[_0x4bcf('0x37')]['fields']));_0x4abef2['attributes']=_0x4abef2[_0x4bcf('0x39')]['length']?_0x4abef2[_0x4bcf('0x39')]:_0x13ec61[_0x4bcf('0x36')];if(!_0x4fbf8c[_0x4bcf('0x37')]['hasOwnProperty']('nolimit')){_0x4abef2['limit']=qs[_0x4bcf('0x3c')](_0x4fbf8c[_0x4bcf('0x37')][_0x4bcf('0x3c')]);_0x4abef2[_0x4bcf('0x2a')]=qs[_0x4bcf('0x2a')](_0x4fbf8c['query'][_0x4bcf('0x2a')]);}_0x4abef2[_0x4bcf('0x3d')]=qs[_0x4bcf('0x3e')](_0x4fbf8c[_0x4bcf('0x37')]['sort']);_0x4abef2[_0x4bcf('0x3f')]=qs['filters'](_['pick'](_0x4fbf8c[_0x4bcf('0x37')],_0x13ec61[_0x4bcf('0x38')]));if(_0x4fbf8c[_0x4bcf('0x37')][_0x4bcf('0x40')]){_0x4abef2[_0x4bcf('0x3f')]=_[_0x4bcf('0x41')](_0x4abef2[_0x4bcf('0x3f')],{'$or':_['map'](_0x43384c,function(_0x1bd7ac){if(_0x1bd7ac['type']!==_0x4bcf('0x42')){var _0xd13ef8={};_0xd13ef8[_0x1bd7ac[_0x4bcf('0x30')]]={'$like':'%'+_0x4fbf8c[_0x4bcf('0x37')][_0x4bcf('0x40')]+'%'};return _0xd13ef8;}})});}_0x4abef2=_['merge']({},_0x4abef2,_0x4fbf8c[_0x4bcf('0x43')]);var _0x361377={'where':_0x4abef2['where']};return db[_0x4bcf('0x34')]['count'](_0x361377)[_0x4bcf('0x1d')](function(_0x1b6db9){_0x57674f[_0x4bcf('0x29')]=_0x1b6db9;if(_0x4fbf8c['query'][_0x4bcf('0x44')]){_0x4abef2[_0x4bcf('0x45')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x4bcf('0x46')](_0x4abef2);})[_0x4bcf('0x1d')](function(_0x29df82){_0x57674f['rows']=_0x29df82;return _0x57674f;})[_0x4bcf('0x1d')](respondWithFilteredResult(_0x49f5eb,_0x4abef2))[_0x4bcf('0x47')](handleError(_0x49f5eb,null));};exports[_0x4bcf('0x48')]=function(_0x3cc662,_0x3048aa){var _0x3b1bb7={'raw':![],'where':{'id':_0x3cc662[_0x4bcf('0x49')]['id']}},_0x5a13e3={};_0x5a13e3[_0x4bcf('0x36')]=_[_0x4bcf('0x4a')](db[_0x4bcf('0x34')][_0x4bcf('0x4b')]);_0x5a13e3['query']=_[_0x4bcf('0x4a')](_0x3cc662[_0x4bcf('0x37')]);_0x5a13e3[_0x4bcf('0x38')]=_[_0x4bcf('0x3a')](_0x5a13e3[_0x4bcf('0x36')],_0x5a13e3[_0x4bcf('0x37')]);_0x3b1bb7['attributes']=_[_0x4bcf('0x3a')](_0x5a13e3['model'],qs[_0x4bcf('0x3b')](_0x3cc662[_0x4bcf('0x37')]['fields']));_0x3b1bb7[_0x4bcf('0x39')]=_0x3b1bb7[_0x4bcf('0x39')][_0x4bcf('0x4c')]?_0x3b1bb7['attributes']:_0x5a13e3[_0x4bcf('0x36')];if(_0x3cc662[_0x4bcf('0x37')][_0x4bcf('0x44')]){_0x3b1bb7[_0x4bcf('0x45')]=[{'all':!![]}];}_0x3b1bb7=_['merge']({},_0x3b1bb7,_0x3cc662['options']);return db[_0x4bcf('0x34')]['find'](_0x3b1bb7)['then'](handleEntityNotFound(_0x3048aa,null))[_0x4bcf('0x1d')](respondWithResult(_0x3048aa,null))[_0x4bcf('0x47')](handleError(_0x3048aa,null));};exports[_0x4bcf('0x4d')]=function(_0x29b099,_0x4e9541){return db[_0x4bcf('0x34')]['create'](_0x29b099['body'],{})['then'](respondWithResult(_0x4e9541,0xc9))[_0x4bcf('0x47')](handleError(_0x4e9541,null));};exports[_0x4bcf('0x2d')]=function(_0x41b4d4,_0x5c1d83){if(_0x41b4d4[_0x4bcf('0x4e')]['id']){delete _0x41b4d4[_0x4bcf('0x4e')]['id'];}return db[_0x4bcf('0x34')][_0x4bcf('0x4f')]({'where':{'id':_0x41b4d4[_0x4bcf('0x49')]['id']}})[_0x4bcf('0x1d')](handleEntityNotFound(_0x5c1d83,null))['then'](saveUpdates(_0x41b4d4[_0x4bcf('0x4e')],null))[_0x4bcf('0x1d')](respondWithResult(_0x5c1d83,null))[_0x4bcf('0x47')](handleError(_0x5c1d83,null));};exports[_0x4bcf('0x2e')]=function(_0x2db086,_0x3881f9){return db['FreshdeskConfiguration'][_0x4bcf('0x4f')]({'where':{'id':_0x2db086[_0x4bcf('0x49')]['id']}})[_0x4bcf('0x1d')](handleEntityNotFound(_0x3881f9,null))[_0x4bcf('0x1d')](removeEntity(_0x3881f9,null))[_0x4bcf('0x47')](handleError(_0x3881f9,null));};exports[_0x4bcf('0x50')]=function(_0x513c64,_0x31c1ee,_0xfa4b13){var _0x1dee70={};var _0x426253={};var _0x4fadbd;var _0x1344b9;return db[_0x4bcf('0x34')][_0x4bcf('0x51')]({'where':{'id':_0x513c64[_0x4bcf('0x49')]['id']}})[_0x4bcf('0x1d')](handleEntityNotFound(_0x31c1ee,null))[_0x4bcf('0x1d')](function(_0x2b3006){if(_0x2b3006){_0x4fadbd=_0x2b3006;_0x426253[_0x4bcf('0x36')]=_['keys'](db['FreshdeskField'][_0x4bcf('0x4b')]);_0x426253['query']=_[_0x4bcf('0x4a')](_0x513c64['query']);_0x426253[_0x4bcf('0x38')]=_['intersection'](_0x426253['model'],_0x426253[_0x4bcf('0x37')]);_0x1dee70[_0x4bcf('0x39')]=_['intersection'](_0x426253['model'],qs[_0x4bcf('0x3b')](_0x513c64[_0x4bcf('0x37')][_0x4bcf('0x3b')]));_0x1dee70[_0x4bcf('0x39')]=_0x1dee70[_0x4bcf('0x39')]['length']?_0x1dee70[_0x4bcf('0x39')]:_0x426253[_0x4bcf('0x36')];_0x1dee70['order']=qs[_0x4bcf('0x3e')](_0x513c64[_0x4bcf('0x37')][_0x4bcf('0x3e')]);_0x1dee70[_0x4bcf('0x3f')]=qs[_0x4bcf('0x38')](_['pick'](_0x513c64[_0x4bcf('0x37')],_0x426253['filters']));if(_0x513c64[_0x4bcf('0x37')][_0x4bcf('0x40')]){_0x1dee70[_0x4bcf('0x3f')]=_[_0x4bcf('0x41')](_0x1dee70['where'],{'$or':_['map'](_0x1dee70[_0x4bcf('0x39')],function(_0x3871b1){var _0x1f661d={};_0x1f661d[_0x3871b1]={'$like':'%'+_0x513c64[_0x4bcf('0x37')][_0x4bcf('0x40')]+'%'};return _0x1f661d;})});}_0x1dee70=_[_0x4bcf('0x41')]({},_0x1dee70,_0x513c64[_0x4bcf('0x43')]);return _0x4fadbd[_0x4bcf('0x50')](_0x1dee70);}})[_0x4bcf('0x1d')](function(_0x3995b8){if(_0x3995b8){_0x1344b9=_0x3995b8[_0x4bcf('0x4c')];if(!_0x513c64[_0x4bcf('0x37')]['hasOwnProperty'](_0x4bcf('0x52'))){_0x1dee70[_0x4bcf('0x3c')]=qs['limit'](_0x513c64[_0x4bcf('0x37')][_0x4bcf('0x3c')]);_0x1dee70['offset']=qs[_0x4bcf('0x2a')](_0x513c64[_0x4bcf('0x37')][_0x4bcf('0x2a')]);}return _0x4fadbd[_0x4bcf('0x50')](_0x1dee70);}})['then'](function(_0x5f35f4){if(_0x5f35f4){return _0x5f35f4?{'count':_0x1344b9,'rows':_0x5f35f4}:null;}})[_0x4bcf('0x1d')](respondWithResult(_0x31c1ee,null))['catch'](handleError(_0x31c1ee,null));};exports[_0x4bcf('0x53')]=function(_0x554017,_0x8fc695,_0x14b7ec){var _0x3707e8={};var _0xd5e007={};var _0x167edd;var _0x1da235;return db[_0x4bcf('0x34')]['findOne']({'where':{'id':_0x554017[_0x4bcf('0x49')]['id']}})['then'](handleEntityNotFound(_0x8fc695,null))[_0x4bcf('0x1d')](function(_0x4a6c21){if(_0x4a6c21){_0x167edd=_0x4a6c21;_0xd5e007[_0x4bcf('0x36')]=_[_0x4bcf('0x4a')](db['FreshdeskField'][_0x4bcf('0x4b')]);_0xd5e007[_0x4bcf('0x37')]=_[_0x4bcf('0x4a')](_0x554017[_0x4bcf('0x37')]);_0xd5e007[_0x4bcf('0x38')]=_['intersection'](_0xd5e007['model'],_0xd5e007[_0x4bcf('0x37')]);_0x3707e8[_0x4bcf('0x39')]=_[_0x4bcf('0x3a')](_0xd5e007[_0x4bcf('0x36')],qs['fields'](_0x554017[_0x4bcf('0x37')][_0x4bcf('0x3b')]));_0x3707e8[_0x4bcf('0x39')]=_0x3707e8[_0x4bcf('0x39')][_0x4bcf('0x4c')]?_0x3707e8['attributes']:_0xd5e007[_0x4bcf('0x36')];_0x3707e8[_0x4bcf('0x3d')]=qs[_0x4bcf('0x3e')](_0x554017[_0x4bcf('0x37')]['sort']);_0x3707e8[_0x4bcf('0x3f')]=qs[_0x4bcf('0x38')](_['pick'](_0x554017[_0x4bcf('0x37')],_0xd5e007[_0x4bcf('0x38')]));if(_0x554017[_0x4bcf('0x37')][_0x4bcf('0x40')]){_0x3707e8[_0x4bcf('0x3f')]=_[_0x4bcf('0x41')](_0x3707e8[_0x4bcf('0x3f')],{'$or':_[_0x4bcf('0x33')](_0x3707e8[_0x4bcf('0x39')],function(_0x51cc6d){var _0x181e5a={};_0x181e5a[_0x51cc6d]={'$like':'%'+_0x554017[_0x4bcf('0x37')][_0x4bcf('0x40')]+'%'};return _0x181e5a;})});}_0x3707e8=_[_0x4bcf('0x41')]({},_0x3707e8,_0x554017[_0x4bcf('0x43')]);return _0x167edd['getSubjects'](_0x3707e8);}})['then'](function(_0x146e09){if(_0x146e09){_0x1da235=_0x146e09[_0x4bcf('0x4c')];if(!_0x554017[_0x4bcf('0x37')]['hasOwnProperty']('nolimit')){_0x3707e8[_0x4bcf('0x3c')]=qs[_0x4bcf('0x3c')](_0x554017[_0x4bcf('0x37')][_0x4bcf('0x3c')]);_0x3707e8[_0x4bcf('0x2a')]=qs[_0x4bcf('0x2a')](_0x554017[_0x4bcf('0x37')][_0x4bcf('0x2a')]);}return _0x167edd[_0x4bcf('0x53')](_0x3707e8);}})[_0x4bcf('0x1d')](function(_0x1c6b87){if(_0x1c6b87){return _0x1c6b87?{'count':_0x1da235,'rows':_0x1c6b87}:null;}})['then'](respondWithResult(_0x8fc695,null))['catch'](handleError(_0x8fc695,null));};exports[_0x4bcf('0x54')]=function(_0x32494f,_0x5e1980,_0x38ee0e){var _0x18e433={};var _0x4165bf={};var _0x3e0082;var _0x45c4d5;return db[_0x4bcf('0x34')][_0x4bcf('0x51')]({'where':{'id':_0x32494f[_0x4bcf('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e1980,null))[_0x4bcf('0x1d')](function(_0x29ab47){if(_0x29ab47){_0x3e0082=_0x29ab47;_0x4165bf[_0x4bcf('0x36')]=_[_0x4bcf('0x4a')](db[_0x4bcf('0x55')][_0x4bcf('0x4b')]);_0x4165bf[_0x4bcf('0x37')]=_[_0x4bcf('0x4a')](_0x32494f[_0x4bcf('0x37')]);_0x4165bf[_0x4bcf('0x38')]=_[_0x4bcf('0x3a')](_0x4165bf['model'],_0x4165bf['query']);_0x18e433['attributes']=_[_0x4bcf('0x3a')](_0x4165bf['model'],qs['fields'](_0x32494f[_0x4bcf('0x37')]['fields']));_0x18e433[_0x4bcf('0x39')]=_0x18e433['attributes'][_0x4bcf('0x4c')]?_0x18e433[_0x4bcf('0x39')]:_0x4165bf[_0x4bcf('0x36')];_0x18e433[_0x4bcf('0x3d')]=qs[_0x4bcf('0x3e')](_0x32494f[_0x4bcf('0x37')][_0x4bcf('0x3e')]);_0x18e433[_0x4bcf('0x3f')]=qs['filters'](_['pick'](_0x32494f[_0x4bcf('0x37')],_0x4165bf[_0x4bcf('0x38')]));if(_0x32494f[_0x4bcf('0x37')]['filter']){_0x18e433[_0x4bcf('0x3f')]=_[_0x4bcf('0x41')](_0x18e433[_0x4bcf('0x3f')],{'$or':_[_0x4bcf('0x33')](_0x18e433[_0x4bcf('0x39')],function(_0x255457){var _0x3d0a91={};_0x3d0a91[_0x255457]={'$like':'%'+_0x32494f[_0x4bcf('0x37')][_0x4bcf('0x40')]+'%'};return _0x3d0a91;})});}_0x18e433=_[_0x4bcf('0x41')]({},_0x18e433,_0x32494f[_0x4bcf('0x43')]);return _0x3e0082['getDescriptions'](_0x18e433);}})['then'](function(_0x4c21df){if(_0x4c21df){_0x45c4d5=_0x4c21df['length'];if(!_0x32494f[_0x4bcf('0x37')][_0x4bcf('0x56')](_0x4bcf('0x52'))){_0x18e433[_0x4bcf('0x3c')]=qs['limit'](_0x32494f[_0x4bcf('0x37')]['limit']);_0x18e433[_0x4bcf('0x2a')]=qs['offset'](_0x32494f['query'][_0x4bcf('0x2a')]);}return _0x3e0082[_0x4bcf('0x54')](_0x18e433);}})[_0x4bcf('0x1d')](function(_0x319d95){if(_0x319d95){return _0x319d95?{'count':_0x45c4d5,'rows':_0x319d95}:null;}})[_0x4bcf('0x1d')](respondWithResult(_0x5e1980,null))[_0x4bcf('0x47')](handleError(_0x5e1980,null));};exports[_0x4bcf('0x57')]=function(_0x34b008,_0x1b0328,_0x4bf756){var _0x351f7a={};var _0x1150d7={};var _0x4da434;var _0x550539;return db[_0x4bcf('0x34')][_0x4bcf('0x51')]({'where':{'id':_0x34b008[_0x4bcf('0x49')]['id']}})[_0x4bcf('0x1d')](handleEntityNotFound(_0x1b0328,null))['then'](function(_0x11bb29){if(_0x11bb29){_0x4da434=_0x11bb29;_0x1150d7['model']=_[_0x4bcf('0x4a')](db[_0x4bcf('0x58')][_0x4bcf('0x4b')]);_0x1150d7[_0x4bcf('0x37')]=_['keys'](_0x34b008[_0x4bcf('0x37')]);_0x1150d7['filters']=_[_0x4bcf('0x3a')](_0x1150d7[_0x4bcf('0x36')],_0x1150d7['query']);_0x351f7a[_0x4bcf('0x39')]=_['intersection'](_0x1150d7[_0x4bcf('0x36')],qs[_0x4bcf('0x3b')](_0x34b008[_0x4bcf('0x37')][_0x4bcf('0x3b')]));_0x351f7a['attributes']=_0x351f7a['attributes'][_0x4bcf('0x4c')]?_0x351f7a[_0x4bcf('0x39')]:_0x1150d7['model'];_0x351f7a[_0x4bcf('0x3d')]=qs['sort'](_0x34b008[_0x4bcf('0x37')][_0x4bcf('0x3e')]);_0x351f7a['where']=qs['filters'](_[_0x4bcf('0x59')](_0x34b008[_0x4bcf('0x37')],_0x1150d7['filters']));if(_0x34b008[_0x4bcf('0x37')]['filter']){_0x351f7a[_0x4bcf('0x3f')]=_[_0x4bcf('0x41')](_0x351f7a[_0x4bcf('0x3f')],{'$or':_[_0x4bcf('0x33')](_0x351f7a[_0x4bcf('0x39')],function(_0x5c7736){var _0x274b8f={};_0x274b8f[_0x5c7736]={'$like':'%'+_0x34b008['query'][_0x4bcf('0x40')]+'%'};return _0x274b8f;})});}_0x351f7a=_['merge']({},_0x351f7a,_0x34b008['options']);return _0x4da434[_0x4bcf('0x57')](_0x351f7a);}})[_0x4bcf('0x1d')](function(_0x33f6ce){if(_0x33f6ce){_0x550539=_0x33f6ce[_0x4bcf('0x4c')];if(!_0x34b008[_0x4bcf('0x37')][_0x4bcf('0x56')](_0x4bcf('0x52'))){_0x351f7a['limit']=qs['limit'](_0x34b008[_0x4bcf('0x37')][_0x4bcf('0x3c')]);_0x351f7a[_0x4bcf('0x2a')]=qs[_0x4bcf('0x2a')](_0x34b008[_0x4bcf('0x37')][_0x4bcf('0x2a')]);}return _0x4da434[_0x4bcf('0x57')](_0x351f7a);}})[_0x4bcf('0x1d')](function(_0x26c915){if(_0x26c915){return _0x26c915?{'count':_0x550539,'rows':_0x26c915}:null;}})[_0x4bcf('0x1d')](respondWithResult(_0x1b0328,null))[_0x4bcf('0x47')](handleError(_0x1b0328,null));};exports[_0x4bcf('0x5a')]=function(_0x1f7514,_0x29e85a,_0x1bf5d0){if(_0x1f7514[_0x4bcf('0x4e')]['id']){delete _0x1f7514[_0x4bcf('0x4e')]['id'];}return db[_0x4bcf('0x34')][_0x4bcf('0x51')]({'where':{'id':_0x1f7514['params']['id']}})[_0x4bcf('0x1d')](handleEntityNotFound(_0x29e85a,null))[_0x4bcf('0x1d')](function(_0x4c3979){if(_0x4c3979){return _0x4c3979[_0x4bcf('0x5a')](_0x1f7514['body'][_0x4bcf('0x5b')]||[]);}return null;})[_0x4bcf('0x1d')](respondWithResult(_0x29e85a,null))[_0x4bcf('0x47')](handleError(_0x29e85a,null));}; \ No newline at end of file +var _0x0c87=['error','code','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','create','body','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','setTags','ids','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x569d57,_0x36dc9b){var _0x5dd608=function(_0x5b6095){while(--_0x5b6095){_0x569d57['push'](_0x569d57['shift']());}};_0x5dd608(++_0x36dc9b);}(_0x0c87,0x1d5));var _0x70c8=function(_0x3dd43f,_0x780409){_0x3dd43f=_0x3dd43f-0x0;var _0x31e65e=_0x0c87[_0x3dd43f];return _0x31e65e;};'use strict';var pdf=require(_0x70c8('0x0'));var emlformat=require(_0x70c8('0x1'));var rimraf=require(_0x70c8('0x2'));var zipdir=require(_0x70c8('0x3'));var jsonpatch=require(_0x70c8('0x4'));var rp=require(_0x70c8('0x5'));var moment=require(_0x70c8('0x6'));var BPromise=require(_0x70c8('0x7'));var Mustache=require(_0x70c8('0x8'));var util=require('util');var path=require(_0x70c8('0x9'));var sox=require(_0x70c8('0xa'));var csv=require('to-csv');var ejs=require(_0x70c8('0xb'));var fs=require('fs');var _=require(_0x70c8('0xc'));var squel=require(_0x70c8('0xd'));var crypto=require(_0x70c8('0xe'));var jsforce=require(_0x70c8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x70c8('0x10'));var querystring=require(_0x70c8('0x11'));var Papa=require(_0x70c8('0x12'));var Redis=require(_0x70c8('0x13'));var authService=require(_0x70c8('0x14'));var qs=require(_0x70c8('0x15'));var as=require(_0x70c8('0x16'));var hardwareService=require(_0x70c8('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x70c8('0x18'));var config=require(_0x70c8('0x19'));var db=require(_0x70c8('0x1a'))['db'];var jayson=require(_0x70c8('0x1b'));var client=jayson[_0x70c8('0x1c')][_0x70c8('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x522653,_0x1b2f9d,_0x56cd22){if(_0x56cd22){var _0x30a584=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30a584[_0x70c8('0x1e')](_0x1b2f9d)){return _0x522653;}else{throw new db[(_0x70c8('0x1f'))][(_0x70c8('0x20'))](_0x70c8('0x21'));}}else{return _0x522653;}}function respondWithRpcPromise(_0x571342,_0x3a4d6c,_0x372c20,_0x12dfef){return new BPromise(function(_0x3d7a12,_0xdf3598){var _0x4c785d=_0x12dfef||client;return _0x4c785d[_0x70c8('0x22')](_0x571342,_0x372c20)[_0x70c8('0x23')](function(_0x11b298){logger[_0x70c8('0x24')](_0x70c8('0x25'),_0x3a4d6c,_0x70c8('0x26'));logger[_0x70c8('0x27')](_0x70c8('0x28'),_0x3a4d6c,_0x70c8('0x26'),JSON['stringify'](_0x11b298));if(_0x11b298['error']){if(_0x11b298[_0x70c8('0x29')][_0x70c8('0x2a')]===0x1f4){logger[_0x70c8('0x29')](_0x70c8('0x25'),_0x3a4d6c,_0x11b298[_0x70c8('0x29')][_0x70c8('0x2b')]);return _0xdf3598(_0x11b298[_0x70c8('0x29')][_0x70c8('0x2b')]);}logger[_0x70c8('0x29')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a4d6c,_0x11b298[_0x70c8('0x29')][_0x70c8('0x2b')]);return _0x3d7a12(_0x11b298[_0x70c8('0x29')]['message']);}else{logger[_0x70c8('0x24')](_0x70c8('0x25'),_0x3a4d6c,_0x70c8('0x26'));_0x3d7a12(_0x11b298[_0x70c8('0x2c')][_0x70c8('0x2b')]);}})[_0x70c8('0x2d')](function(_0x54274d){logger['error'](_0x70c8('0x25'),_0x3a4d6c,_0x54274d);_0xdf3598(_0x54274d);});});}function respondWithStatusCode(_0x550009,_0x41a168){_0x41a168=_0x41a168||0xcc;return function(_0xd0da8b){if(_0xd0da8b){return _0x550009[_0x70c8('0x2e')](_0x41a168);}return _0x550009[_0x70c8('0x2f')](_0x41a168)[_0x70c8('0x30')]();};}function respondWithResult(_0x502cc7,_0x14f0c3){_0x14f0c3=_0x14f0c3||0xc8;return function(_0x371e6f){if(_0x371e6f){return _0x502cc7['status'](_0x14f0c3)[_0x70c8('0x31')](_0x371e6f);}};}function respondWithFilteredResult(_0xa55821,_0x53783d){return function(_0x2c23df){if(_0x2c23df){var _0x3e9d15=_0x2c23df['count'],_0x31f0cc=_0x53783d['offset'],_0x124f35=_0x53783d[_0x70c8('0x32')]+_0x53783d['limit'],_0x4d0cb5;if(_0x124f35>=_0x3e9d15){_0x124f35=_0x3e9d15;_0x4d0cb5=0xc8;}else{_0x4d0cb5=0xce;}_0xa55821[_0x70c8('0x2f')](_0x4d0cb5);return _0xa55821[_0x70c8('0x33')](_0x70c8('0x34'),_0x31f0cc+'-'+_0x124f35+'/'+_0x3e9d15)[_0x70c8('0x31')](_0x2c23df);}return null;};}function patchUpdates(_0x6f1a47){return function(_0x43930d){try{jsonpatch[_0x70c8('0x35')](_0x43930d,_0x6f1a47,!![]);}catch(_0xbfa6b5){return BPromise[_0x70c8('0x36')](_0xbfa6b5);}return _0x43930d['save']();};}function saveUpdates(_0xd6625,_0x133b5f){return function(_0x439a80){if(_0x439a80){return _0x439a80[_0x70c8('0x37')](_0xd6625)[_0x70c8('0x23')](function(_0x24d936){return _0x24d936;});}return null;};}function removeEntity(_0x176aae,_0x31e955){return function(_0x314e8b){if(_0x314e8b){return _0x314e8b['destroy']()[_0x70c8('0x23')](function(){_0x176aae[_0x70c8('0x2f')](0xcc)[_0x70c8('0x30')]();});}};}function handleEntityNotFound(_0x379a59,_0x2c0f8b){return function(_0x1e682c){if(!_0x1e682c){_0x379a59[_0x70c8('0x2e')](0x194);}return _0x1e682c;};}function handleError(_0x3dfc34,_0x56875f){_0x56875f=_0x56875f||0x1f4;return function(_0x50f233){logger[_0x70c8('0x29')](_0x50f233[_0x70c8('0x38')]);if(_0x50f233[_0x70c8('0x39')]){delete _0x50f233['name'];}_0x3dfc34['status'](_0x56875f)['send'](_0x50f233);};}exports[_0x70c8('0x3a')]=function(_0x540a6c,_0x465a35){var _0x3f8c19={},_0x23637c={},_0x39b64c={'count':0x0,'rows':[]};var _0x4a4117=_['map'](db[_0x70c8('0x3b')][_0x70c8('0x3c')],function(_0x4ad4d0){return{'name':_0x4ad4d0[_0x70c8('0x3d')],'type':_0x4ad4d0[_0x70c8('0x3e')][_0x70c8('0x3f')]};});_0x23637c['model']=_[_0x70c8('0x40')](_0x4a4117,'name');_0x23637c[_0x70c8('0x41')]=_[_0x70c8('0x42')](_0x540a6c[_0x70c8('0x41')]);_0x23637c['filters']=_[_0x70c8('0x43')](_0x23637c[_0x70c8('0x44')],_0x23637c['query']);_0x3f8c19['attributes']=_[_0x70c8('0x43')](_0x23637c[_0x70c8('0x44')],qs[_0x70c8('0x45')](_0x540a6c['query'][_0x70c8('0x45')]));_0x3f8c19[_0x70c8('0x46')]=_0x3f8c19[_0x70c8('0x46')][_0x70c8('0x47')]?_0x3f8c19['attributes']:_0x23637c[_0x70c8('0x44')];if(!_0x540a6c[_0x70c8('0x41')][_0x70c8('0x48')](_0x70c8('0x49'))){_0x3f8c19[_0x70c8('0x4a')]=qs['limit'](_0x540a6c[_0x70c8('0x41')]['limit']);_0x3f8c19[_0x70c8('0x32')]=qs[_0x70c8('0x32')](_0x540a6c[_0x70c8('0x41')]['offset']);}_0x3f8c19[_0x70c8('0x4b')]=qs[_0x70c8('0x4c')](_0x540a6c[_0x70c8('0x41')][_0x70c8('0x4c')]);_0x3f8c19['where']=qs[_0x70c8('0x4d')](_[_0x70c8('0x4e')](_0x540a6c[_0x70c8('0x41')],_0x23637c[_0x70c8('0x4d')]));if(_0x540a6c[_0x70c8('0x41')][_0x70c8('0x4f')]){_0x3f8c19[_0x70c8('0x50')]=_[_0x70c8('0x51')](_0x3f8c19[_0x70c8('0x50')],{'$or':_[_0x70c8('0x40')](_0x4a4117,function(_0x49d3f9){if(_0x49d3f9[_0x70c8('0x3e')]!==_0x70c8('0x52')){var _0x38f19e={};_0x38f19e[_0x49d3f9['name']]={'$like':'%'+_0x540a6c[_0x70c8('0x41')][_0x70c8('0x4f')]+'%'};return _0x38f19e;}})});}_0x3f8c19=_[_0x70c8('0x51')]({},_0x3f8c19,_0x540a6c[_0x70c8('0x53')]);var _0x5b51d7={'where':_0x3f8c19[_0x70c8('0x50')]};return db[_0x70c8('0x3b')][_0x70c8('0x54')](_0x5b51d7)['then'](function(_0x1bffd7){_0x39b64c[_0x70c8('0x54')]=_0x1bffd7;if(_0x540a6c[_0x70c8('0x41')][_0x70c8('0x55')]){_0x3f8c19[_0x70c8('0x56')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x70c8('0x57')](_0x3f8c19);})[_0x70c8('0x23')](function(_0x3bcf0c){_0x39b64c[_0x70c8('0x58')]=_0x3bcf0c;return _0x39b64c;})['then'](respondWithFilteredResult(_0x465a35,_0x3f8c19))[_0x70c8('0x2d')](handleError(_0x465a35,null));};exports[_0x70c8('0x59')]=function(_0x1af6a4,_0x3fd106){var _0x408f2c={'raw':![],'where':{'id':_0x1af6a4[_0x70c8('0x5a')]['id']}},_0x34a0dd={};_0x34a0dd[_0x70c8('0x44')]=_[_0x70c8('0x42')](db[_0x70c8('0x3b')][_0x70c8('0x3c')]);_0x34a0dd['query']=_[_0x70c8('0x42')](_0x1af6a4[_0x70c8('0x41')]);_0x34a0dd[_0x70c8('0x4d')]=_[_0x70c8('0x43')](_0x34a0dd['model'],_0x34a0dd[_0x70c8('0x41')]);_0x408f2c[_0x70c8('0x46')]=_[_0x70c8('0x43')](_0x34a0dd[_0x70c8('0x44')],qs[_0x70c8('0x45')](_0x1af6a4['query'][_0x70c8('0x45')]));_0x408f2c[_0x70c8('0x46')]=_0x408f2c[_0x70c8('0x46')][_0x70c8('0x47')]?_0x408f2c[_0x70c8('0x46')]:_0x34a0dd[_0x70c8('0x44')];if(_0x1af6a4[_0x70c8('0x41')][_0x70c8('0x55')]){_0x408f2c[_0x70c8('0x56')]=[{'all':!![]}];}_0x408f2c=_[_0x70c8('0x51')]({},_0x408f2c,_0x1af6a4[_0x70c8('0x53')]);return db[_0x70c8('0x3b')][_0x70c8('0x5b')](_0x408f2c)[_0x70c8('0x23')](handleEntityNotFound(_0x3fd106,null))[_0x70c8('0x23')](respondWithResult(_0x3fd106,null))[_0x70c8('0x2d')](handleError(_0x3fd106,null));};exports[_0x70c8('0x5c')]=function(_0x5b1e70,_0x221715){return db['FreshdeskConfiguration'][_0x70c8('0x5c')](_0x5b1e70[_0x70c8('0x5d')],{})[_0x70c8('0x23')](respondWithResult(_0x221715,0xc9))[_0x70c8('0x2d')](handleError(_0x221715,null));};exports[_0x70c8('0x37')]=function(_0x26b56c,_0x3e13d8){if(_0x26b56c[_0x70c8('0x5d')]['id']){delete _0x26b56c[_0x70c8('0x5d')]['id'];}return db[_0x70c8('0x3b')][_0x70c8('0x5b')]({'where':{'id':_0x26b56c[_0x70c8('0x5a')]['id']}})[_0x70c8('0x23')](handleEntityNotFound(_0x3e13d8,null))[_0x70c8('0x23')](saveUpdates(_0x26b56c['body'],null))['then'](respondWithResult(_0x3e13d8,null))[_0x70c8('0x2d')](handleError(_0x3e13d8,null));};exports['destroy']=function(_0x1029b8,_0x1cfaca){return db[_0x70c8('0x3b')][_0x70c8('0x5b')]({'where':{'id':_0x1029b8[_0x70c8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1cfaca,null))['then'](removeEntity(_0x1cfaca,null))[_0x70c8('0x2d')](handleError(_0x1cfaca,null));};exports['getFields']=function(_0x1f9f95,_0x4bc4f2,_0x5a678b){var _0x47d7c8={};var _0x49d160={};var _0x1fb9ff;var _0xf1676;return db[_0x70c8('0x3b')][_0x70c8('0x5e')]({'where':{'id':_0x1f9f95[_0x70c8('0x5a')]['id']}})[_0x70c8('0x23')](handleEntityNotFound(_0x4bc4f2,null))[_0x70c8('0x23')](function(_0x5ef224){if(_0x5ef224){_0x1fb9ff=_0x5ef224;_0x49d160['model']=_[_0x70c8('0x42')](db[_0x70c8('0x5f')]['rawAttributes']);_0x49d160[_0x70c8('0x41')]=_[_0x70c8('0x42')](_0x1f9f95['query']);_0x49d160[_0x70c8('0x4d')]=_[_0x70c8('0x43')](_0x49d160[_0x70c8('0x44')],_0x49d160[_0x70c8('0x41')]);_0x47d7c8[_0x70c8('0x46')]=_['intersection'](_0x49d160[_0x70c8('0x44')],qs[_0x70c8('0x45')](_0x1f9f95[_0x70c8('0x41')][_0x70c8('0x45')]));_0x47d7c8[_0x70c8('0x46')]=_0x47d7c8[_0x70c8('0x46')][_0x70c8('0x47')]?_0x47d7c8[_0x70c8('0x46')]:_0x49d160[_0x70c8('0x44')];_0x47d7c8['order']=qs[_0x70c8('0x4c')](_0x1f9f95[_0x70c8('0x41')][_0x70c8('0x4c')]);_0x47d7c8[_0x70c8('0x50')]=qs['filters'](_[_0x70c8('0x4e')](_0x1f9f95[_0x70c8('0x41')],_0x49d160[_0x70c8('0x4d')]));if(_0x1f9f95['query'][_0x70c8('0x4f')]){_0x47d7c8[_0x70c8('0x50')]=_[_0x70c8('0x51')](_0x47d7c8[_0x70c8('0x50')],{'$or':_[_0x70c8('0x40')](_0x47d7c8['attributes'],function(_0x35e45a){var _0x5f154c={};_0x5f154c[_0x35e45a]={'$like':'%'+_0x1f9f95[_0x70c8('0x41')][_0x70c8('0x4f')]+'%'};return _0x5f154c;})});}_0x47d7c8=_[_0x70c8('0x51')]({},_0x47d7c8,_0x1f9f95[_0x70c8('0x53')]);return _0x1fb9ff[_0x70c8('0x60')](_0x47d7c8);}})[_0x70c8('0x23')](function(_0x142a6e){if(_0x142a6e){_0xf1676=_0x142a6e['length'];if(!_0x1f9f95[_0x70c8('0x41')]['hasOwnProperty'](_0x70c8('0x49'))){_0x47d7c8[_0x70c8('0x4a')]=qs[_0x70c8('0x4a')](_0x1f9f95[_0x70c8('0x41')]['limit']);_0x47d7c8['offset']=qs[_0x70c8('0x32')](_0x1f9f95[_0x70c8('0x41')][_0x70c8('0x32')]);}return _0x1fb9ff[_0x70c8('0x60')](_0x47d7c8);}})[_0x70c8('0x23')](function(_0x289d8a){if(_0x289d8a){return _0x289d8a?{'count':_0xf1676,'rows':_0x289d8a}:null;}})['then'](respondWithResult(_0x4bc4f2,null))[_0x70c8('0x2d')](handleError(_0x4bc4f2,null));};exports[_0x70c8('0x61')]=function(_0x1eb1d1,_0x4303e5,_0xedb653){var _0x15dc50={};var _0x434260={};var _0x1612c5;var _0xc0e23b;return db[_0x70c8('0x3b')]['findOne']({'where':{'id':_0x1eb1d1[_0x70c8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4303e5,null))[_0x70c8('0x23')](function(_0x423e73){if(_0x423e73){_0x1612c5=_0x423e73;_0x434260[_0x70c8('0x44')]=_['keys'](db[_0x70c8('0x5f')][_0x70c8('0x3c')]);_0x434260[_0x70c8('0x41')]=_['keys'](_0x1eb1d1[_0x70c8('0x41')]);_0x434260[_0x70c8('0x4d')]=_[_0x70c8('0x43')](_0x434260[_0x70c8('0x44')],_0x434260[_0x70c8('0x41')]);_0x15dc50[_0x70c8('0x46')]=_[_0x70c8('0x43')](_0x434260[_0x70c8('0x44')],qs['fields'](_0x1eb1d1[_0x70c8('0x41')][_0x70c8('0x45')]));_0x15dc50[_0x70c8('0x46')]=_0x15dc50['attributes'][_0x70c8('0x47')]?_0x15dc50[_0x70c8('0x46')]:_0x434260['model'];_0x15dc50[_0x70c8('0x4b')]=qs[_0x70c8('0x4c')](_0x1eb1d1[_0x70c8('0x41')]['sort']);_0x15dc50['where']=qs[_0x70c8('0x4d')](_[_0x70c8('0x4e')](_0x1eb1d1['query'],_0x434260[_0x70c8('0x4d')]));if(_0x1eb1d1[_0x70c8('0x41')][_0x70c8('0x4f')]){_0x15dc50[_0x70c8('0x50')]=_[_0x70c8('0x51')](_0x15dc50[_0x70c8('0x50')],{'$or':_[_0x70c8('0x40')](_0x15dc50['attributes'],function(_0x2769cd){var _0x23f467={};_0x23f467[_0x2769cd]={'$like':'%'+_0x1eb1d1[_0x70c8('0x41')][_0x70c8('0x4f')]+'%'};return _0x23f467;})});}_0x15dc50=_[_0x70c8('0x51')]({},_0x15dc50,_0x1eb1d1['options']);return _0x1612c5[_0x70c8('0x61')](_0x15dc50);}})['then'](function(_0x51d957){if(_0x51d957){_0xc0e23b=_0x51d957[_0x70c8('0x47')];if(!_0x1eb1d1[_0x70c8('0x41')]['hasOwnProperty']('nolimit')){_0x15dc50[_0x70c8('0x4a')]=qs['limit'](_0x1eb1d1[_0x70c8('0x41')][_0x70c8('0x4a')]);_0x15dc50[_0x70c8('0x32')]=qs[_0x70c8('0x32')](_0x1eb1d1[_0x70c8('0x41')]['offset']);}return _0x1612c5[_0x70c8('0x61')](_0x15dc50);}})[_0x70c8('0x23')](function(_0x5d5319){if(_0x5d5319){return _0x5d5319?{'count':_0xc0e23b,'rows':_0x5d5319}:null;}})[_0x70c8('0x23')](respondWithResult(_0x4303e5,null))[_0x70c8('0x2d')](handleError(_0x4303e5,null));};exports[_0x70c8('0x62')]=function(_0x588882,_0x10bbec,_0x575e88){var _0x44e28b={};var _0x2bf216={};var _0x4875af;var _0xf98f51;return db[_0x70c8('0x3b')][_0x70c8('0x5e')]({'where':{'id':_0x588882[_0x70c8('0x5a')]['id']}})[_0x70c8('0x23')](handleEntityNotFound(_0x10bbec,null))[_0x70c8('0x23')](function(_0x28392b){if(_0x28392b){_0x4875af=_0x28392b;_0x2bf216['model']=_[_0x70c8('0x42')](db['FreshdeskField']['rawAttributes']);_0x2bf216[_0x70c8('0x41')]=_[_0x70c8('0x42')](_0x588882[_0x70c8('0x41')]);_0x2bf216[_0x70c8('0x4d')]=_[_0x70c8('0x43')](_0x2bf216[_0x70c8('0x44')],_0x2bf216[_0x70c8('0x41')]);_0x44e28b[_0x70c8('0x46')]=_[_0x70c8('0x43')](_0x2bf216[_0x70c8('0x44')],qs[_0x70c8('0x45')](_0x588882['query']['fields']));_0x44e28b['attributes']=_0x44e28b[_0x70c8('0x46')][_0x70c8('0x47')]?_0x44e28b[_0x70c8('0x46')]:_0x2bf216[_0x70c8('0x44')];_0x44e28b[_0x70c8('0x4b')]=qs[_0x70c8('0x4c')](_0x588882[_0x70c8('0x41')][_0x70c8('0x4c')]);_0x44e28b[_0x70c8('0x50')]=qs[_0x70c8('0x4d')](_[_0x70c8('0x4e')](_0x588882[_0x70c8('0x41')],_0x2bf216[_0x70c8('0x4d')]));if(_0x588882[_0x70c8('0x41')][_0x70c8('0x4f')]){_0x44e28b[_0x70c8('0x50')]=_[_0x70c8('0x51')](_0x44e28b['where'],{'$or':_[_0x70c8('0x40')](_0x44e28b[_0x70c8('0x46')],function(_0x5b8f47){var _0x255e60={};_0x255e60[_0x5b8f47]={'$like':'%'+_0x588882[_0x70c8('0x41')][_0x70c8('0x4f')]+'%'};return _0x255e60;})});}_0x44e28b=_[_0x70c8('0x51')]({},_0x44e28b,_0x588882['options']);return _0x4875af[_0x70c8('0x62')](_0x44e28b);}})[_0x70c8('0x23')](function(_0x3f8dea){if(_0x3f8dea){_0xf98f51=_0x3f8dea[_0x70c8('0x47')];if(!_0x588882[_0x70c8('0x41')]['hasOwnProperty'](_0x70c8('0x49'))){_0x44e28b[_0x70c8('0x4a')]=qs[_0x70c8('0x4a')](_0x588882[_0x70c8('0x41')][_0x70c8('0x4a')]);_0x44e28b[_0x70c8('0x32')]=qs[_0x70c8('0x32')](_0x588882[_0x70c8('0x41')][_0x70c8('0x32')]);}return _0x4875af[_0x70c8('0x62')](_0x44e28b);}})[_0x70c8('0x23')](function(_0x4cc2a5){if(_0x4cc2a5){return _0x4cc2a5?{'count':_0xf98f51,'rows':_0x4cc2a5}:null;}})['then'](respondWithResult(_0x10bbec,null))[_0x70c8('0x2d')](handleError(_0x10bbec,null));};exports['getTags']=function(_0x36224c,_0x4d7ef5,_0x57b5d7){var _0x5a6de8={};var _0x238c60={};var _0xef163f;var _0x23de72;return db['FreshdeskConfiguration'][_0x70c8('0x5e')]({'where':{'id':_0x36224c[_0x70c8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d7ef5,null))[_0x70c8('0x23')](function(_0x1b8c60){if(_0x1b8c60){_0xef163f=_0x1b8c60;_0x238c60['model']=_['keys'](db['Tag'][_0x70c8('0x3c')]);_0x238c60['query']=_['keys'](_0x36224c['query']);_0x238c60[_0x70c8('0x4d')]=_[_0x70c8('0x43')](_0x238c60[_0x70c8('0x44')],_0x238c60[_0x70c8('0x41')]);_0x5a6de8['attributes']=_[_0x70c8('0x43')](_0x238c60[_0x70c8('0x44')],qs[_0x70c8('0x45')](_0x36224c[_0x70c8('0x41')]['fields']));_0x5a6de8['attributes']=_0x5a6de8[_0x70c8('0x46')]['length']?_0x5a6de8['attributes']:_0x238c60['model'];_0x5a6de8[_0x70c8('0x4b')]=qs['sort'](_0x36224c[_0x70c8('0x41')]['sort']);_0x5a6de8[_0x70c8('0x50')]=qs[_0x70c8('0x4d')](_['pick'](_0x36224c[_0x70c8('0x41')],_0x238c60[_0x70c8('0x4d')]));if(_0x36224c['query'][_0x70c8('0x4f')]){_0x5a6de8['where']=_[_0x70c8('0x51')](_0x5a6de8[_0x70c8('0x50')],{'$or':_['map'](_0x5a6de8[_0x70c8('0x46')],function(_0x36dd56){var _0x70c794={};_0x70c794[_0x36dd56]={'$like':'%'+_0x36224c[_0x70c8('0x41')][_0x70c8('0x4f')]+'%'};return _0x70c794;})});}_0x5a6de8=_[_0x70c8('0x51')]({},_0x5a6de8,_0x36224c[_0x70c8('0x53')]);return _0xef163f[_0x70c8('0x63')](_0x5a6de8);}})['then'](function(_0x47812d){if(_0x47812d){_0x23de72=_0x47812d[_0x70c8('0x47')];if(!_0x36224c['query']['hasOwnProperty'](_0x70c8('0x49'))){_0x5a6de8[_0x70c8('0x4a')]=qs[_0x70c8('0x4a')](_0x36224c[_0x70c8('0x41')][_0x70c8('0x4a')]);_0x5a6de8[_0x70c8('0x32')]=qs[_0x70c8('0x32')](_0x36224c[_0x70c8('0x41')][_0x70c8('0x32')]);}return _0xef163f[_0x70c8('0x63')](_0x5a6de8);}})[_0x70c8('0x23')](function(_0x4c406e){if(_0x4c406e){return _0x4c406e?{'count':_0x23de72,'rows':_0x4c406e}:null;}})['then'](respondWithResult(_0x4d7ef5,null))['catch'](handleError(_0x4d7ef5,null));};exports['setTags']=function(_0x1c9099,_0x4df238,_0x305221){if(_0x1c9099['body']['id']){delete _0x1c9099[_0x70c8('0x5d')]['id'];}return db['FreshdeskConfiguration'][_0x70c8('0x5e')]({'where':{'id':_0x1c9099['params']['id']}})[_0x70c8('0x23')](handleEntityNotFound(_0x4df238,null))[_0x70c8('0x23')](function(_0x3e3f97){if(_0x3e3f97){return _0x3e3f97[_0x70c8('0x64')](_0x1c9099[_0x70c8('0x5d')][_0x70c8('0x65')]||[]);}return null;})[_0x70c8('0x23')](respondWithResult(_0x4df238,null))['catch'](handleError(_0x4df238,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 14a6ba2..02c5ca0 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 _0xe572=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash'];(function(_0x45bfbc,_0x1ff15e){var _0x407018=function(_0x22f0f0){while(--_0x22f0f0){_0x45bfbc['push'](_0x45bfbc['shift']());}};_0x407018(++_0x1ff15e);}(_0xe572,0x149));var _0x2e57=function(_0xfd7af4,_0x2d072a){_0xfd7af4=_0xfd7af4-0x0;var _0x4c855a=_0xe572[_0xfd7af4];return _0x4c855a;};'use strict';var _=require(_0x2e57('0x0'));var util=require('util');var logger=require(_0x2e57('0x1'))(_0x2e57('0x2'));var moment=require(_0x2e57('0x3'));var BPromise=require(_0x2e57('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e57('0x5'));var config=require(_0x2e57('0x6'));var attributes=require(_0x2e57('0x7'));module[_0x2e57('0x8')]=function(_0x29a0d8,_0x31e4d0){return _0x29a0d8[_0x2e57('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x2e57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f2=['exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x31f2,0xcf));var _0x231f=function(_0x517c08,_0x41eb91){_0x517c08=_0x517c08-0x0;var _0x592ecb=_0x31f2[_0x517c08];return _0x592ecb;};'use strict';var _=require(_0x231f('0x0'));var util=require('util');var logger=require(_0x231f('0x1'))(_0x231f('0x2'));var moment=require(_0x231f('0x3'));var BPromise=require(_0x231f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x231f('0x5'));var rimraf=require(_0x231f('0x6'));var config=require(_0x231f('0x7'));var attributes=require(_0x231f('0x8'));module[_0x231f('0x9')]=function(_0x2c3a7b,_0x168fa9){return _0x2c3a7b['define'](_0x231f('0xa'),attributes,{'tableName':_0x231f('0xb'),'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 da8614b..4f3ba9d 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 _0x7054=['client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7054,0xdd));var _0x4705=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x7054[_0x764874];return _0x29f9d5;};'use strict';var _=require(_0x4705('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4705('0x1'));var rs=require(_0x4705('0x2'));var fs=require('fs');var Redis=require(_0x4705('0x3'));var db=require(_0x4705('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4705('0x5'))(_0x4705('0x6'));var config=require(_0x4705('0x7'));var jayson=require(_0x4705('0x8'));var client=jayson[_0x4705('0x9')][_0x4705('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3056ab,_0x5d3c5a,_0x49c79d){return new BPromise(function(_0x16cc31,_0x4bcd2d){return client[_0x4705('0xb')](_0x3056ab,_0x49c79d)[_0x4705('0xc')](function(_0x1017ec){logger[_0x4705('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5d3c5a,_0x4705('0xe'));logger[_0x4705('0xf')](_0x4705('0x10'),_0x5d3c5a,_0x4705('0xe'),JSON[_0x4705('0x11')](_0x1017ec));if(_0x1017ec[_0x4705('0x12')]){if(_0x1017ec['error'][_0x4705('0x13')]===0x1f4){logger[_0x4705('0x12')](_0x4705('0x14'),_0x5d3c5a,_0x1017ec[_0x4705('0x12')][_0x4705('0x15')]);return _0x4bcd2d(_0x1017ec['error']['message']);}logger[_0x4705('0x12')](_0x4705('0x14'),_0x5d3c5a,_0x1017ec[_0x4705('0x12')][_0x4705('0x15')]);return _0x16cc31(_0x1017ec[_0x4705('0x12')][_0x4705('0x15')]);}else{logger[_0x4705('0xd')](_0x4705('0x14'),_0x5d3c5a,'request\x20sent');_0x16cc31(_0x1017ec[_0x4705('0x16')][_0x4705('0x15')]);}})['catch'](function(_0x5a4652){logger[_0x4705('0x12')](_0x4705('0x14'),_0x5d3c5a,_0x5a4652);_0x4bcd2d(_0x5a4652);});});} \ No newline at end of file +var _0x6738=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x4d977f,_0x32e191){var _0xd036e7=function(_0x56f2b7){while(--_0x56f2b7){_0x4d977f['push'](_0x4d977f['shift']());}};_0xd036e7(++_0x32e191);}(_0x6738,0x6d));var _0x8673=function(_0x11d1dd,_0x300476){_0x11d1dd=_0x11d1dd-0x0;var _0x43377b=_0x6738[_0x11d1dd];return _0x43377b;};'use strict';var _=require(_0x8673('0x0'));var util=require(_0x8673('0x1'));var moment=require(_0x8673('0x2'));var BPromise=require(_0x8673('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8673('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8673('0x5'));var logger=require('../../config/logger')(_0x8673('0x6'));var config=require(_0x8673('0x7'));var jayson=require(_0x8673('0x8'));var client=jayson[_0x8673('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174dd8,_0x1bd765,_0x1bfba1){return new BPromise(function(_0x1a1d8a,_0xeeda1c){return client[_0x8673('0xa')](_0x174dd8,_0x1bfba1)[_0x8673('0xb')](function(_0x1e448a){logger[_0x8673('0xc')](_0x8673('0xd'),_0x1bd765,_0x8673('0xe'));logger[_0x8673('0xf')](_0x8673('0x10'),_0x1bd765,_0x8673('0xe'),JSON[_0x8673('0x11')](_0x1e448a));if(_0x1e448a[_0x8673('0x12')]){if(_0x1e448a['error'][_0x8673('0x13')]===0x1f4){logger[_0x8673('0x12')](_0x8673('0xd'),_0x1bd765,_0x1e448a[_0x8673('0x12')][_0x8673('0x14')]);return _0xeeda1c(_0x1e448a['error'][_0x8673('0x14')]);}logger[_0x8673('0x12')](_0x8673('0xd'),_0x1bd765,_0x1e448a[_0x8673('0x12')][_0x8673('0x14')]);return _0x1a1d8a(_0x1e448a[_0x8673('0x12')][_0x8673('0x14')]);}else{logger[_0x8673('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1bd765,_0x8673('0xe'));_0x1a1d8a(_0x1e448a['result']['message']);}})[_0x8673('0x15')](function(_0x401ea5){logger[_0x8673('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1bd765,_0x401ea5);_0xeeda1c(_0x401ea5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e4a4b78..d3fc65f 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 _0xedd9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xedd9,0xfc));var _0x9edd=function(_0x11c780,_0x30248f){_0x11c780=_0x11c780-0x0;var _0x55e66d=_0xedd9[_0x11c780];return _0x55e66d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router[_0x9edd('0xd')]('/:id',auth[_0x9edd('0x9')](),controller['update']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);module[_0x9edd('0x11')]=router; \ No newline at end of file +var _0xcb91=['post','create','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0xcb91[_0x556634];return _0x4429fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0xa')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xb')]);router['put']('/:id',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xc')]);router[_0x1cb9('0xd')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller['destroy']);module[_0x1cb9('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index be40f2f..ade05ec 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 _0x289c=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0x3128b3,_0x4e8233){var _0x469a38=function(_0x1c62d6){while(--_0x1c62d6){_0x3128b3['push'](_0x3128b3['shift']());}};_0x469a38(++_0x4e8233);}(_0x289c,0x110));var _0xc289=function(_0xb099fc,_0x4db70b){_0xb099fc=_0xb099fc-0x0;var _0x163e8a=_0x289c[_0xb099fc];return _0x163e8a;};'use strict';var Sequelize=require(_0xc289('0x0'));module[_0xc289('0x1')]={'type':{'type':Sequelize[_0xc289('0x2')](_0xc289('0x3'),'variable',_0xc289('0x4'),_0xc289('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc289('0x6')]},'key':{'type':Sequelize[_0xc289('0x6')]},'keyType':{'type':Sequelize[_0xc289('0x2')]('string',_0xc289('0x7'),_0xc289('0x4'))},'keyContent':{'type':Sequelize[_0xc289('0x6')]},'idField':{'type':Sequelize[_0xc289('0x6')]},'nameField':{'type':Sequelize[_0xc289('0x6')]},'customField':{'type':Sequelize[_0xc289('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc289('0x6')]}}; \ No newline at end of file +var _0x77f2=['STRING','BOOLEAN','exports','string','variable'];(function(_0x4d57e0,_0x2dfe83){var _0xa7b4b2=function(_0x2a55c8){while(--_0x2a55c8){_0x4d57e0['push'](_0x4d57e0['shift']());}};_0xa7b4b2(++_0x2dfe83);}(_0x77f2,0x188));var _0x277f=function(_0x3c1ca2,_0x3428ae){_0x3c1ca2=_0x3c1ca2-0x0;var _0x310c01=_0x77f2[_0x3c1ca2];return _0x310c01;};'use strict';var Sequelize=require('sequelize');module[_0x277f('0x0')]={'type':{'type':Sequelize['ENUM'](_0x277f('0x1'),_0x277f('0x2'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x277f('0x3')]},'key':{'type':Sequelize[_0x277f('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x277f('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x277f('0x3')]},'nameField':{'type':Sequelize[_0x277f('0x3')]},'customField':{'type':Sequelize[_0x277f('0x4')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f9fdd1d..e127c99 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 _0x85c8=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','FreshdeskField','includeAll','findAll','catch','show','params','include','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','key','keys','query','intersection'];(function(_0x4d9a4f,_0x4a0304){var _0x4cbd27=function(_0x4ef4f5){while(--_0x4ef4f5){_0x4d9a4f['push'](_0x4d9a4f['shift']());}};_0x4cbd27(++_0x4a0304);}(_0x85c8,0x1d0));var _0x885c=function(_0x4bdee3,_0x55b920){_0x4bdee3=_0x4bdee3-0x0;var _0x2686af=_0x85c8[_0x4bdee3];return _0x2686af;};'use strict';var pdf=require(_0x885c('0x0'));var emlformat=require(_0x885c('0x1'));var rimraf=require(_0x885c('0x2'));var zipdir=require(_0x885c('0x3'));var jsonpatch=require(_0x885c('0x4'));var rp=require(_0x885c('0x5'));var moment=require('moment');var BPromise=require(_0x885c('0x6'));var Mustache=require(_0x885c('0x7'));var util=require('util');var path=require(_0x885c('0x8'));var sox=require(_0x885c('0x9'));var csv=require(_0x885c('0xa'));var ejs=require(_0x885c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x885c('0xc'));var crypto=require(_0x885c('0xd'));var jsforce=require(_0x885c('0xe'));var deskjs=require(_0x885c('0xf'));var toCsv=require(_0x885c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x885c('0x10'));var authService=require(_0x885c('0x11'));var qs=require(_0x885c('0x12'));var as=require(_0x885c('0x13'));var hardwareService=require(_0x885c('0x14'));var logger=require('../../config/logger')(_0x885c('0x15'));var utils=require(_0x885c('0x16'));var config=require(_0x885c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55e038,_0x184c9a){_0x184c9a=_0x184c9a||0xcc;return function(_0x8aeed6){if(_0x8aeed6){return _0x55e038[_0x885c('0x18')](_0x184c9a);}return _0x55e038[_0x885c('0x19')](_0x184c9a)[_0x885c('0x1a')]();};}function respondWithResult(_0x46c570,_0x6efd75){_0x6efd75=_0x6efd75||0xc8;return function(_0x346023){if(_0x346023){return _0x46c570['status'](_0x6efd75)['json'](_0x346023);}};}function respondWithFilteredResult(_0x46edb9,_0x4e13ef){return function(_0x3af83f){if(_0x3af83f){var _0x5d8010=_0x3af83f[_0x885c('0x1b')],_0x3f8d12=_0x4e13ef[_0x885c('0x1c')],_0x45c2d6=_0x4e13ef[_0x885c('0x1c')]+_0x4e13ef['limit'],_0xaae551;if(_0x45c2d6>=_0x5d8010){_0x45c2d6=_0x5d8010;_0xaae551=0xc8;}else{_0xaae551=0xce;}_0x46edb9[_0x885c('0x19')](_0xaae551);return _0x46edb9[_0x885c('0x1d')](_0x885c('0x1e'),_0x3f8d12+'-'+_0x45c2d6+'/'+_0x5d8010)[_0x885c('0x1f')](_0x3af83f);}return null;};}function patchUpdates(_0x9391bf){return function(_0x48d20d){try{jsonpatch[_0x885c('0x20')](_0x48d20d,_0x9391bf,!![]);}catch(_0x7d753c){return BPromise[_0x885c('0x21')](_0x7d753c);}return _0x48d20d[_0x885c('0x22')]();};}function saveUpdates(_0x4bdade,_0x3131c2){return function(_0x875c80){if(_0x875c80){return _0x875c80[_0x885c('0x23')](_0x4bdade)['then'](function(_0x18429f){return _0x18429f;});}return null;};}function removeEntity(_0x86f75a,_0x5e3bf4){return function(_0x28adfb){if(_0x28adfb){return _0x28adfb['destroy']()[_0x885c('0x24')](function(){_0x86f75a[_0x885c('0x19')](0xcc)[_0x885c('0x1a')]();});}};}function handleEntityNotFound(_0x2c2b62,_0x8bef5f){return function(_0x25b89e){if(!_0x25b89e){_0x2c2b62[_0x885c('0x18')](0x194);}return _0x25b89e;};}function handleError(_0x1e1ed5,_0x50f430){_0x50f430=_0x50f430||0x1f4;return function(_0x279837){logger['error'](_0x279837[_0x885c('0x25')]);if(_0x279837[_0x885c('0x26')]){delete _0x279837[_0x885c('0x26')];}_0x1e1ed5[_0x885c('0x19')](_0x50f430)['send'](_0x279837);};}exports[_0x885c('0x27')]=function(_0x4bd298,_0xc4f55d){var _0x5f17a0={},_0x42604b={},_0x4395d2={'count':0x0,'rows':[]};var _0x41017b=_[_0x885c('0x28')](db['FreshdeskField'][_0x885c('0x29')],function(_0x286e62){return{'name':_0x286e62[_0x885c('0x2a')],'type':_0x286e62['type'][_0x885c('0x2b')]};});_0x42604b['model']=_['map'](_0x41017b,_0x885c('0x26'));_0x42604b['query']=_[_0x885c('0x2c')](_0x4bd298[_0x885c('0x2d')]);_0x42604b['filters']=_[_0x885c('0x2e')](_0x42604b[_0x885c('0x2f')],_0x42604b[_0x885c('0x2d')]);_0x5f17a0[_0x885c('0x30')]=_[_0x885c('0x2e')](_0x42604b[_0x885c('0x2f')],qs[_0x885c('0x31')](_0x4bd298[_0x885c('0x2d')][_0x885c('0x31')]));_0x5f17a0[_0x885c('0x30')]=_0x5f17a0[_0x885c('0x30')][_0x885c('0x32')]?_0x5f17a0[_0x885c('0x30')]:_0x42604b[_0x885c('0x2f')];if(!_0x4bd298[_0x885c('0x2d')][_0x885c('0x33')](_0x885c('0x34'))){_0x5f17a0[_0x885c('0x35')]=qs[_0x885c('0x35')](_0x4bd298[_0x885c('0x2d')][_0x885c('0x35')]);_0x5f17a0[_0x885c('0x1c')]=qs[_0x885c('0x1c')](_0x4bd298[_0x885c('0x2d')][_0x885c('0x1c')]);}_0x5f17a0[_0x885c('0x36')]=qs[_0x885c('0x37')](_0x4bd298['query'][_0x885c('0x37')]);_0x5f17a0[_0x885c('0x38')]=qs[_0x885c('0x39')](_[_0x885c('0x3a')](_0x4bd298[_0x885c('0x2d')],_0x42604b[_0x885c('0x39')]));if(_0x4bd298[_0x885c('0x2d')][_0x885c('0x3b')]){_0x5f17a0[_0x885c('0x38')]=_[_0x885c('0x3c')](_0x5f17a0[_0x885c('0x38')],{'$or':_[_0x885c('0x28')](_0x41017b,function(_0x40ba75){if(_0x40ba75['type']!==_0x885c('0x3d')){var _0x45b53e={};_0x45b53e[_0x40ba75['name']]={'$like':'%'+_0x4bd298[_0x885c('0x2d')][_0x885c('0x3b')]+'%'};return _0x45b53e;}})});}_0x5f17a0=_[_0x885c('0x3c')]({},_0x5f17a0,_0x4bd298['options']);var _0x11507c={'where':_0x5f17a0['where']};return db[_0x885c('0x3e')][_0x885c('0x1b')](_0x11507c)[_0x885c('0x24')](function(_0x46d496){_0x4395d2[_0x885c('0x1b')]=_0x46d496;if(_0x4bd298[_0x885c('0x2d')][_0x885c('0x3f')]){_0x5f17a0['include']=[{'all':!![]}];}return db[_0x885c('0x3e')][_0x885c('0x40')](_0x5f17a0);})['then'](function(_0x36dc3f){_0x4395d2['rows']=_0x36dc3f;return _0x4395d2;})['then'](respondWithFilteredResult(_0xc4f55d,_0x5f17a0))[_0x885c('0x41')](handleError(_0xc4f55d,null));};exports[_0x885c('0x42')]=function(_0x53fa53,_0x2d39d7){var _0x8c593d={'raw':!![],'where':{'id':_0x53fa53[_0x885c('0x43')]['id']}},_0x23bc3b={};_0x23bc3b['model']=_[_0x885c('0x2c')](db[_0x885c('0x3e')][_0x885c('0x29')]);_0x23bc3b['query']=_['keys'](_0x53fa53[_0x885c('0x2d')]);_0x23bc3b['filters']=_[_0x885c('0x2e')](_0x23bc3b[_0x885c('0x2f')],_0x23bc3b['query']);_0x8c593d[_0x885c('0x30')]=_[_0x885c('0x2e')](_0x23bc3b['model'],qs['fields'](_0x53fa53['query']['fields']));_0x8c593d['attributes']=_0x8c593d[_0x885c('0x30')]['length']?_0x8c593d[_0x885c('0x30')]:_0x23bc3b[_0x885c('0x2f')];if(_0x53fa53[_0x885c('0x2d')][_0x885c('0x3f')]){_0x8c593d[_0x885c('0x44')]=[{'all':!![]}];}_0x8c593d=_[_0x885c('0x3c')]({},_0x8c593d,_0x53fa53['options']);return db['FreshdeskField'][_0x885c('0x45')](_0x8c593d)[_0x885c('0x24')](handleEntityNotFound(_0x2d39d7,null))[_0x885c('0x24')](respondWithResult(_0x2d39d7,null))[_0x885c('0x41')](handleError(_0x2d39d7,null));};exports[_0x885c('0x46')]=function(_0x565bc8,_0x3c5705){return db['FreshdeskField'][_0x885c('0x46')](_0x565bc8['body'],{})[_0x885c('0x24')](respondWithResult(_0x3c5705,0xc9))[_0x885c('0x41')](handleError(_0x3c5705,null));};exports[_0x885c('0x23')]=function(_0x52bbe4,_0x14b1c3){if(_0x52bbe4[_0x885c('0x47')]['id']){delete _0x52bbe4[_0x885c('0x47')]['id'];}return db[_0x885c('0x3e')][_0x885c('0x45')]({'where':{'id':_0x52bbe4[_0x885c('0x43')]['id']}})[_0x885c('0x24')](handleEntityNotFound(_0x14b1c3,null))[_0x885c('0x24')](saveUpdates(_0x52bbe4[_0x885c('0x47')],null))[_0x885c('0x24')](respondWithResult(_0x14b1c3,null))[_0x885c('0x41')](handleError(_0x14b1c3,null));};exports[_0x885c('0x48')]=function(_0x1f8d75,_0x5e85c9){return db['FreshdeskField'][_0x885c('0x45')]({'where':{'id':_0x1f8d75[_0x885c('0x43')]['id']}})[_0x885c('0x24')](handleEntityNotFound(_0x5e85c9,null))[_0x885c('0x24')](removeEntity(_0x5e85c9,null))[_0x885c('0x41')](handleError(_0x5e85c9,null));}; \ No newline at end of file +var _0x215e=['apply','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x4f3d8f,_0x1aa4ef){var _0x2818b7=function(_0x599d99){while(--_0x599d99){_0x4f3d8f['push'](_0x4f3d8f['shift']());}};_0x2818b7(++_0x1aa4ef);}(_0x215e,0x6f));var _0xe215=function(_0x1df471,_0x385d1c){_0x1df471=_0x1df471-0x0;var _0x27b89d=_0x215e[_0x1df471];return _0x27b89d;};'use strict';var pdf=require(_0xe215('0x0'));var emlformat=require(_0xe215('0x1'));var rimraf=require(_0xe215('0x2'));var zipdir=require(_0xe215('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe215('0x4'));var moment=require(_0xe215('0x5'));var BPromise=require(_0xe215('0x6'));var Mustache=require(_0xe215('0x7'));var util=require(_0xe215('0x8'));var path=require('path');var sox=require(_0xe215('0x9'));var csv=require(_0xe215('0xa'));var ejs=require(_0xe215('0xb'));var fs=require('fs');var _=require(_0xe215('0xc'));var squel=require(_0xe215('0xd'));var crypto=require(_0xe215('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe215('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe215('0x10'));var Papa=require(_0xe215('0x11'));var Redis=require(_0xe215('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe215('0x13'));var as=require(_0xe215('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe215('0x15'))(_0xe215('0x16'));var utils=require('../../config/utils');var config=require(_0xe215('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53f702,_0x54fc7e){_0x54fc7e=_0x54fc7e||0xcc;return function(_0x17e524){if(_0x17e524){return _0x53f702[_0xe215('0x18')](_0x54fc7e);}return _0x53f702[_0xe215('0x19')](_0x54fc7e)[_0xe215('0x1a')]();};}function respondWithResult(_0x571474,_0x4e9937){_0x4e9937=_0x4e9937||0xc8;return function(_0x146cb6){if(_0x146cb6){return _0x571474['status'](_0x4e9937)[_0xe215('0x1b')](_0x146cb6);}};}function respondWithFilteredResult(_0x4aa1c4,_0x598a2e){return function(_0x5de0c9){if(_0x5de0c9){var _0x490687=_0x5de0c9[_0xe215('0x1c')],_0x17f3bc=_0x598a2e['offset'],_0x5e7832=_0x598a2e[_0xe215('0x1d')]+_0x598a2e[_0xe215('0x1e')],_0x4d1c79;if(_0x5e7832>=_0x490687){_0x5e7832=_0x490687;_0x4d1c79=0xc8;}else{_0x4d1c79=0xce;}_0x4aa1c4[_0xe215('0x19')](_0x4d1c79);return _0x4aa1c4[_0xe215('0x1f')](_0xe215('0x20'),_0x17f3bc+'-'+_0x5e7832+'/'+_0x490687)['json'](_0x5de0c9);}return null;};}function patchUpdates(_0x2b5837){return function(_0xf92037){try{jsonpatch[_0xe215('0x21')](_0xf92037,_0x2b5837,!![]);}catch(_0x434001){return BPromise['reject'](_0x434001);}return _0xf92037[_0xe215('0x22')]();};}function saveUpdates(_0x6022ae,_0x3e241a){return function(_0x2d1401){if(_0x2d1401){return _0x2d1401['update'](_0x6022ae)[_0xe215('0x23')](function(_0xb18967){return _0xb18967;});}return null;};}function removeEntity(_0x5e6ba5,_0xd6bb1a){return function(_0x36979e){if(_0x36979e){return _0x36979e[_0xe215('0x24')]()[_0xe215('0x23')](function(){_0x5e6ba5[_0xe215('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34c151,_0x4c4f23){return function(_0x4473fe){if(!_0x4473fe){_0x34c151[_0xe215('0x18')](0x194);}return _0x4473fe;};}function handleError(_0x4ea3b7,_0x1e6215){_0x1e6215=_0x1e6215||0x1f4;return function(_0x527263){logger[_0xe215('0x25')](_0x527263[_0xe215('0x26')]);if(_0x527263[_0xe215('0x27')]){delete _0x527263[_0xe215('0x27')];}_0x4ea3b7[_0xe215('0x19')](_0x1e6215)[_0xe215('0x28')](_0x527263);};}exports[_0xe215('0x29')]=function(_0x20bb52,_0x46b489){var _0x2c0282={},_0x37c3d7={},_0x5ba20f={'count':0x0,'rows':[]};var _0x109861=_[_0xe215('0x2a')](db[_0xe215('0x2b')][_0xe215('0x2c')],function(_0x3d5e5e){return{'name':_0x3d5e5e[_0xe215('0x2d')],'type':_0x3d5e5e[_0xe215('0x2e')]['key']};});_0x37c3d7[_0xe215('0x2f')]=_[_0xe215('0x2a')](_0x109861,_0xe215('0x27'));_0x37c3d7[_0xe215('0x30')]=_[_0xe215('0x31')](_0x20bb52[_0xe215('0x30')]);_0x37c3d7[_0xe215('0x32')]=_['intersection'](_0x37c3d7[_0xe215('0x2f')],_0x37c3d7[_0xe215('0x30')]);_0x2c0282[_0xe215('0x33')]=_[_0xe215('0x34')](_0x37c3d7['model'],qs[_0xe215('0x35')](_0x20bb52[_0xe215('0x30')]['fields']));_0x2c0282['attributes']=_0x2c0282[_0xe215('0x33')][_0xe215('0x36')]?_0x2c0282[_0xe215('0x33')]:_0x37c3d7[_0xe215('0x2f')];if(!_0x20bb52[_0xe215('0x30')]['hasOwnProperty']('nolimit')){_0x2c0282[_0xe215('0x1e')]=qs[_0xe215('0x1e')](_0x20bb52[_0xe215('0x30')][_0xe215('0x1e')]);_0x2c0282[_0xe215('0x1d')]=qs[_0xe215('0x1d')](_0x20bb52['query'][_0xe215('0x1d')]);}_0x2c0282[_0xe215('0x37')]=qs['sort'](_0x20bb52['query'][_0xe215('0x38')]);_0x2c0282[_0xe215('0x39')]=qs[_0xe215('0x32')](_['pick'](_0x20bb52[_0xe215('0x30')],_0x37c3d7['filters']));if(_0x20bb52[_0xe215('0x30')][_0xe215('0x3a')]){_0x2c0282['where']=_[_0xe215('0x3b')](_0x2c0282[_0xe215('0x39')],{'$or':_[_0xe215('0x2a')](_0x109861,function(_0x6b500){if(_0x6b500[_0xe215('0x2e')]!=='VIRTUAL'){var _0x189989={};_0x189989[_0x6b500[_0xe215('0x27')]]={'$like':'%'+_0x20bb52[_0xe215('0x30')][_0xe215('0x3a')]+'%'};return _0x189989;}})});}_0x2c0282=_[_0xe215('0x3b')]({},_0x2c0282,_0x20bb52[_0xe215('0x3c')]);var _0x4ec44f={'where':_0x2c0282[_0xe215('0x39')]};return db['FreshdeskField']['count'](_0x4ec44f)[_0xe215('0x23')](function(_0x2bb152){_0x5ba20f['count']=_0x2bb152;if(_0x20bb52[_0xe215('0x30')][_0xe215('0x3d')]){_0x2c0282[_0xe215('0x3e')]=[{'all':!![]}];}return db[_0xe215('0x2b')][_0xe215('0x3f')](_0x2c0282);})[_0xe215('0x23')](function(_0x13f946){_0x5ba20f[_0xe215('0x40')]=_0x13f946;return _0x5ba20f;})[_0xe215('0x23')](respondWithFilteredResult(_0x46b489,_0x2c0282))[_0xe215('0x41')](handleError(_0x46b489,null));};exports[_0xe215('0x42')]=function(_0x18a331,_0x51d466){var _0x29df4e={'raw':!![],'where':{'id':_0x18a331['params']['id']}},_0x41c73a={};_0x41c73a['model']=_[_0xe215('0x31')](db['FreshdeskField'][_0xe215('0x2c')]);_0x41c73a[_0xe215('0x30')]=_[_0xe215('0x31')](_0x18a331[_0xe215('0x30')]);_0x41c73a[_0xe215('0x32')]=_['intersection'](_0x41c73a[_0xe215('0x2f')],_0x41c73a['query']);_0x29df4e[_0xe215('0x33')]=_[_0xe215('0x34')](_0x41c73a[_0xe215('0x2f')],qs[_0xe215('0x35')](_0x18a331[_0xe215('0x30')]['fields']));_0x29df4e[_0xe215('0x33')]=_0x29df4e['attributes'][_0xe215('0x36')]?_0x29df4e['attributes']:_0x41c73a[_0xe215('0x2f')];if(_0x18a331[_0xe215('0x30')][_0xe215('0x3d')]){_0x29df4e[_0xe215('0x3e')]=[{'all':!![]}];}_0x29df4e=_[_0xe215('0x3b')]({},_0x29df4e,_0x18a331[_0xe215('0x3c')]);return db[_0xe215('0x2b')][_0xe215('0x43')](_0x29df4e)[_0xe215('0x23')](handleEntityNotFound(_0x51d466,null))[_0xe215('0x23')](respondWithResult(_0x51d466,null))[_0xe215('0x41')](handleError(_0x51d466,null));};exports[_0xe215('0x44')]=function(_0x521bfd,_0x15b915){return db['FreshdeskField'][_0xe215('0x44')](_0x521bfd['body'],{})[_0xe215('0x23')](respondWithResult(_0x15b915,0xc9))[_0xe215('0x41')](handleError(_0x15b915,null));};exports[_0xe215('0x45')]=function(_0xd90798,_0x48a749){if(_0xd90798[_0xe215('0x46')]['id']){delete _0xd90798[_0xe215('0x46')]['id'];}return db[_0xe215('0x2b')][_0xe215('0x43')]({'where':{'id':_0xd90798[_0xe215('0x47')]['id']}})[_0xe215('0x23')](handleEntityNotFound(_0x48a749,null))[_0xe215('0x23')](saveUpdates(_0xd90798[_0xe215('0x46')],null))[_0xe215('0x23')](respondWithResult(_0x48a749,null))[_0xe215('0x41')](handleError(_0x48a749,null));};exports['destroy']=function(_0x1048bb,_0x4f90a8){return db[_0xe215('0x2b')][_0xe215('0x43')]({'where':{'id':_0x1048bb[_0xe215('0x47')]['id']}})[_0xe215('0x23')](handleEntityNotFound(_0x4f90a8,null))['then'](removeEntity(_0x4f90a8,null))[_0xe215('0x41')](handleError(_0x4f90a8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f6a4ce6..923bd2e 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 _0xa737=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','define'];(function(_0x262aba,_0x341d0b){var _0x35674f=function(_0x1bdf3a){while(--_0x1bdf3a){_0x262aba['push'](_0x262aba['shift']());}};_0x35674f(++_0x341d0b);}(_0xa737,0xf5));var _0x7a73=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xa737[_0x265aa2];return _0x447a3a;};'use strict';var _=require(_0x7a73('0x0'));var util=require(_0x7a73('0x1'));var logger=require(_0x7a73('0x2'))(_0x7a73('0x3'));var moment=require(_0x7a73('0x4'));var BPromise=require(_0x7a73('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a73('0x6'));var rimraf=require('rimraf');var config=require(_0x7a73('0x7'));var attributes=require(_0x7a73('0x8'));module['exports']=function(_0x2876f1,_0x25161b){return _0x2876f1[_0x7a73('0x9')](_0x7a73('0xa'),attributes,{'tableName':_0x7a73('0xb'),'paranoid':![],'indexes':[{'name':_0x7a73('0xc'),'fields':[_0x7a73('0xd'),_0x7a73('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x571a=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2bd12f,_0x55e974){var _0x470ff0=function(_0x3a0713){while(--_0x3a0713){_0x2bd12f['push'](_0x2bd12f['shift']());}};_0x470ff0(++_0x55e974);}(_0x571a,0x96));var _0xa571=function(_0xb80c2f,_0x5b14a1){_0xb80c2f=_0xb80c2f-0x0;var _0x318397=_0x571a[_0xb80c2f];return _0x318397;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa571('0x0'))(_0xa571('0x1'));var moment=require(_0xa571('0x2'));var BPromise=require(_0xa571('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa571('0x4'));var config=require(_0xa571('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0xa571('0x6')]=function(_0x130941,_0x53f062){return _0x130941[_0xa571('0x7')](_0xa571('0x8'),attributes,{'tableName':_0xa571('0x9'),'paranoid':![],'indexes':[{'name':_0xa571('0xa'),'fields':['idField',_0xa571('0xb')],'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 65e99be..70ed92b 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1b49c5,_0x36da4b){var _0x27c11c=function(_0x35046b){while(--_0x35046b){_0x1b49c5['push'](_0x1b49c5['shift']());}};_0x27c11c(++_0x36da4b);}(_0xb10b,0x12a));var _0xbb10=function(_0x3cd025,_0x1e2adf){_0x3cd025=_0x3cd025-0x0;var _0xaa86eb=_0xb10b[_0x3cd025];return _0xaa86eb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x3785d6,_0x2f3261){_0x3785d6=_0x3785d6-0x0;var _0x4d1aad=_0x7a54[_0x3785d6];return _0x4d1aad;};'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')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 88e5e79..c95becb 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 _0x91d9=['express','../../components/auth/service','./intSalesforceAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','create','post','put','update','delete','destroy','util'];(function(_0x28eb09,_0x2f6107){var _0x309225=function(_0x180368){while(--_0x180368){_0x28eb09['push'](_0x28eb09['shift']());}};_0x309225(++_0x2f6107);}(_0x91d9,0x1ec));var _0x991d=function(_0x542db6,_0x56bcc7){_0x542db6=_0x542db6-0x0;var _0x1d122d=_0x91d9[_0x542db6];return _0x1d122d;};'use strict';var multer=require('multer');var util=require(_0x991d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x991d('0x1'));var router=express['Router']();var auth=require(_0x991d('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x991d('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x991d('0x4')]);router[_0x991d('0x5')](_0x991d('0x6'),auth[_0x991d('0x7')](),controller[_0x991d('0x8')]);router['get'](_0x991d('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x991d('0xa'),auth[_0x991d('0x7')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x991d('0xb')]);router[_0x991d('0xc')](_0x991d('0x9'),auth[_0x991d('0x7')](),controller['addConfiguration']);router[_0x991d('0xd')](_0x991d('0x6'),auth[_0x991d('0x7')](),controller[_0x991d('0xe')]);router[_0x991d('0xf')]('/:id',auth[_0x991d('0x7')](),controller[_0x991d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5b7f=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller'];(function(_0x1e6cf5,_0x3d9d7c){var _0x1d1515=function(_0x398970){while(--_0x398970){_0x1e6cf5['push'](_0x1e6cf5['shift']());}};_0x1d1515(++_0x3d9d7c);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x151097,_0x4b54cd){_0x151097=_0x151097-0x0;var _0x1e354a=_0x5b7f[_0x151097];return _0x1e354a;};'use strict';var multer=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var path=require(_0xf5b7('0x2'));var timeout=require(_0xf5b7('0x3'));var express=require(_0xf5b7('0x4'));var router=express[_0xf5b7('0x5')]();var auth=require(_0xf5b7('0x6'));var interaction=require(_0xf5b7('0x7'));var config=require(_0xf5b7('0x8'));var controller=require(_0xf5b7('0x9'));router[_0xf5b7('0xa')]('/',auth[_0xf5b7('0xb')](),controller[_0xf5b7('0xc')]);router[_0xf5b7('0xa')](_0xf5b7('0xd'),auth[_0xf5b7('0xb')](),controller[_0xf5b7('0xe')]);router[_0xf5b7('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf5b7('0xa')](_0xf5b7('0xf'),auth[_0xf5b7('0xb')](),controller[_0xf5b7('0x10')]);router[_0xf5b7('0x11')]('/',auth[_0xf5b7('0xb')](),controller[_0xf5b7('0x12')]);router[_0xf5b7('0x11')](_0xf5b7('0x13'),auth[_0xf5b7('0xb')](),controller[_0xf5b7('0x14')]);router[_0xf5b7('0x15')]('/:id',auth[_0xf5b7('0xb')](),controller[_0xf5b7('0x16')]);router[_0xf5b7('0x17')](_0xf5b7('0xd'),auth[_0xf5b7('0xb')](),controller['destroy']);module[_0xf5b7('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 6a2a84f..2930c7b 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 _0x4975=['username','integrationTab','sequelize','STRING'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0x4975,0x86));var _0x5497=function(_0x48d93f,_0x429a19){_0x48d93f=_0x48d93f-0x0;var _0x3e0e2a=_0x4975[_0x48d93f];return _0x3e0e2a;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'name':{'type':Sequelize[_0x5497('0x1')]},'description':{'type':Sequelize[_0x5497('0x1')]},'username':{'type':Sequelize[_0x5497('0x1')],'unique':_0x5497('0x2')},'remoteUri':{'type':Sequelize[_0x5497('0x1')]},'password':{'type':Sequelize[_0x5497('0x1')]},'clientId':{'type':Sequelize[_0x5497('0x1')]},'clientSecret':{'type':Sequelize[_0x5497('0x1')]},'securityToken':{'type':Sequelize[_0x5497('0x1')]},'serverUrl':{'type':Sequelize[_0x5497('0x1')]},'type':{'type':Sequelize['ENUM'](_0x5497('0x3'),'newTab'),'defaultValue':_0x5497('0x3')}}; \ No newline at end of file +var _0x1cb9=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x595815,_0x1f1f25){var _0xf15fec=function(_0x3550da){while(--_0x3550da){_0x595815['push'](_0x595815['shift']());}};_0xf15fec(++_0x1f1f25);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4204aa,_0x440e54){_0x4204aa=_0x4204aa-0x0;var _0x5d6067=_0x1cb9[_0x4204aa];return _0x5d6067;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')]},'description':{'type':Sequelize[_0x91cb('0x1')]},'username':{'type':Sequelize[_0x91cb('0x1')],'unique':_0x91cb('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x91cb('0x1')]},'clientId':{'type':Sequelize[_0x91cb('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x91cb('0x1')]},'serverUrl':{'type':Sequelize[_0x91cb('0x1')]},'type':{'type':Sequelize[_0x91cb('0x3')](_0x91cb('0x4'),_0x91cb('0x5')),'defaultValue':_0x91cb('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f7b0f96..082566b 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 _0x1967=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','keys','intersection','model','fields','attributes','length','query','hasOwnProperty','order','sort','filters','pick','VIRTUAL','filter','options','where','includeAll','show','params','include','merge','find','create','body','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','login','concat','securityToken','ticketType','describe','CallDurationInSeconds','IsArchived','Priority','Status','isNil','Case','Type','Origin','Reason','SuppliedCompany','custom','includes','picklistValues','value','boolean','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end'];(function(_0x201143,_0x2fc248){var _0x47246e=function(_0x513d6f){while(--_0x513d6f){_0x201143['push'](_0x201143['shift']());}};_0x47246e(++_0x2fc248);}(_0x1967,0x173));var _0x7196=function(_0x17356f,_0x3dcbb8){_0x17356f=_0x17356f-0x0;var _0x5ab368=_0x1967[_0x17356f];return _0x5ab368;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];var integrations=require(_0x7196('0x1a'));var jayson=require(_0x7196('0x1b'));var client=jayson[_0x7196('0x1c')][_0x7196('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x154101,_0x4e8c4c,_0x26a1ef){if(_0x26a1ef){var _0x3feccd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3feccd[_0x7196('0x1e')](_0x4e8c4c)){return _0x154101;}else{throw new db[(_0x7196('0x1f'))]['ValidationError'](_0x7196('0x20'));}}else{return _0x154101;}}function respondWithRpcPromise(_0x539414,_0xe32933,_0x2590a6,_0xf7e97){return new BPromise(function(_0x3ed1ad,_0x12dce7){var _0x2e3e0e=_0xf7e97||client;return _0x2e3e0e[_0x7196('0x21')](_0x539414,_0x2590a6)[_0x7196('0x22')](function(_0x3e4e69){logger[_0x7196('0x23')](_0x7196('0x24'),_0xe32933,'request\x20sent');logger['debug'](_0x7196('0x25'),_0xe32933,_0x7196('0x26'),JSON[_0x7196('0x27')](_0x3e4e69));if(_0x3e4e69['error']){if(_0x3e4e69[_0x7196('0x28')]['code']===0x1f4){logger['error'](_0x7196('0x24'),_0xe32933,_0x3e4e69[_0x7196('0x28')][_0x7196('0x29')]);return _0x12dce7(_0x3e4e69['error']['message']);}logger[_0x7196('0x28')](_0x7196('0x24'),_0xe32933,_0x3e4e69['error'][_0x7196('0x29')]);return _0x3ed1ad(_0x3e4e69[_0x7196('0x28')][_0x7196('0x29')]);}else{logger[_0x7196('0x23')](_0x7196('0x24'),_0xe32933,'request\x20sent');_0x3ed1ad(_0x3e4e69[_0x7196('0x2a')]['message']);}})[_0x7196('0x2b')](function(_0x1b1f4b){logger[_0x7196('0x28')](_0x7196('0x24'),_0xe32933,_0x1b1f4b);_0x12dce7(_0x1b1f4b);});});}function respondWithStatusCode(_0x70aa65,_0x43f6a2){_0x43f6a2=_0x43f6a2||0xcc;return function(_0x530ab5){if(_0x530ab5){return _0x70aa65['sendStatus'](_0x43f6a2);}return _0x70aa65[_0x7196('0x2c')](_0x43f6a2)[_0x7196('0x2d')]();};}function respondWithResult(_0x184c09,_0x4e878f){_0x4e878f=_0x4e878f||0xc8;return function(_0x5aa538){if(_0x5aa538){return _0x184c09[_0x7196('0x2c')](_0x4e878f)[_0x7196('0x2e')](_0x5aa538);}};}function respondWithFilteredResult(_0x675e64,_0x4c6006){return function(_0x35eef9){if(_0x35eef9){var _0x4ecea1=_0x35eef9[_0x7196('0x2f')],_0x4fd339=_0x4c6006[_0x7196('0x30')],_0x59d79d=_0x4c6006['offset']+_0x4c6006[_0x7196('0x31')],_0x30151f;if(_0x59d79d>=_0x4ecea1){_0x59d79d=_0x4ecea1;_0x30151f=0xc8;}else{_0x30151f=0xce;}_0x675e64[_0x7196('0x2c')](_0x30151f);return _0x675e64[_0x7196('0x32')](_0x7196('0x33'),_0x4fd339+'-'+_0x59d79d+'/'+_0x4ecea1)['json'](_0x35eef9);}return null;};}function patchUpdates(_0x39710d){return function(_0x429160){try{jsonpatch[_0x7196('0x34')](_0x429160,_0x39710d,!![]);}catch(_0x651d7e){return BPromise[_0x7196('0x35')](_0x651d7e);}return _0x429160[_0x7196('0x36')]();};}function saveUpdates(_0x15c5f0,_0x3465aa){return function(_0x354175){if(_0x354175){return _0x354175[_0x7196('0x37')](_0x15c5f0)[_0x7196('0x22')](function(_0x54e46b){return _0x54e46b;});}return null;};}function removeEntity(_0xdf8aa,_0x4fbe57){return function(_0x2452f6){if(_0x2452f6){return _0x2452f6['destroy']()[_0x7196('0x22')](function(){_0xdf8aa[_0x7196('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x628e7d,_0x2bcadd){return function(_0x4531d7){if(!_0x4531d7){_0x628e7d[_0x7196('0x38')](0x194);}return _0x4531d7;};}function handleError(_0x7547cf,_0x4a8580){_0x4a8580=_0x4a8580||0x1f4;return function(_0x10b8c2){logger[_0x7196('0x28')](_0x10b8c2[_0x7196('0x39')]);if(_0x10b8c2[_0x7196('0x3a')]){delete _0x10b8c2[_0x7196('0x3a')];}_0x7547cf[_0x7196('0x2c')](_0x4a8580)['send'](_0x10b8c2);};}exports[_0x7196('0x3b')]=function(_0xe04e44,_0x191df2){var _0x4f6b27={},_0x33831a={},_0x75530e={'count':0x0,'rows':[]};var _0xd72bd9=_[_0x7196('0x3c')](db[_0x7196('0x3d')][_0x7196('0x3e')],function(_0x938e49){return{'name':_0x938e49[_0x7196('0x3f')],'type':_0x938e49[_0x7196('0x40')][_0x7196('0x41')]};});_0x33831a['model']=_[_0x7196('0x3c')](_0xd72bd9,_0x7196('0x3a'));_0x33831a['query']=_[_0x7196('0x42')](_0xe04e44['query']);_0x33831a['filters']=_[_0x7196('0x43')](_0x33831a[_0x7196('0x44')],_0x33831a['query']);_0x4f6b27['attributes']=_[_0x7196('0x43')](_0x33831a[_0x7196('0x44')],qs[_0x7196('0x45')](_0xe04e44['query'][_0x7196('0x45')]));_0x4f6b27[_0x7196('0x46')]=_0x4f6b27[_0x7196('0x46')][_0x7196('0x47')]?_0x4f6b27[_0x7196('0x46')]:_0x33831a[_0x7196('0x44')];if(!_0xe04e44[_0x7196('0x48')][_0x7196('0x49')]('nolimit')){_0x4f6b27[_0x7196('0x31')]=qs[_0x7196('0x31')](_0xe04e44['query'][_0x7196('0x31')]);_0x4f6b27[_0x7196('0x30')]=qs['offset'](_0xe04e44[_0x7196('0x48')][_0x7196('0x30')]);}_0x4f6b27[_0x7196('0x4a')]=qs['sort'](_0xe04e44[_0x7196('0x48')][_0x7196('0x4b')]);_0x4f6b27['where']=qs[_0x7196('0x4c')](_[_0x7196('0x4d')](_0xe04e44['query'],_0x33831a[_0x7196('0x4c')]));if(_0xe04e44['query']['filter']){_0x4f6b27['where']=_['merge'](_0x4f6b27['where'],{'$or':_[_0x7196('0x3c')](_0xd72bd9,function(_0x590857){if(_0x590857[_0x7196('0x40')]!==_0x7196('0x4e')){var _0x780275={};_0x780275[_0x590857[_0x7196('0x3a')]]={'$like':'%'+_0xe04e44['query'][_0x7196('0x4f')]+'%'};return _0x780275;}})});}_0x4f6b27=_['merge']({},_0x4f6b27,_0xe04e44[_0x7196('0x50')]);var _0x1703fc={'where':_0x4f6b27[_0x7196('0x51')]};return db['SalesforceAccount'][_0x7196('0x2f')](_0x1703fc)[_0x7196('0x22')](function(_0x1b5c68){_0x75530e['count']=_0x1b5c68;if(_0xe04e44['query'][_0x7196('0x52')]){_0x4f6b27['include']=[{'all':!![]}];}return db[_0x7196('0x3d')]['findAll'](_0x4f6b27);})['then'](function(_0x14b489){_0x75530e['rows']=_0x14b489;return _0x75530e;})['then'](respondWithFilteredResult(_0x191df2,_0x4f6b27))['catch'](handleError(_0x191df2,null));};exports[_0x7196('0x53')]=function(_0x5052ee,_0x48e3b5){var _0x28591e={'raw':![],'where':{'id':_0x5052ee[_0x7196('0x54')]['id']}},_0x182c8b={};_0x182c8b[_0x7196('0x44')]=_['keys'](db[_0x7196('0x3d')]['rawAttributes']);_0x182c8b[_0x7196('0x48')]=_[_0x7196('0x42')](_0x5052ee['query']);_0x182c8b[_0x7196('0x4c')]=_[_0x7196('0x43')](_0x182c8b[_0x7196('0x44')],_0x182c8b['query']);_0x28591e[_0x7196('0x46')]=_['intersection'](_0x182c8b[_0x7196('0x44')],qs[_0x7196('0x45')](_0x5052ee[_0x7196('0x48')][_0x7196('0x45')]));_0x28591e[_0x7196('0x46')]=_0x28591e[_0x7196('0x46')][_0x7196('0x47')]?_0x28591e[_0x7196('0x46')]:_0x182c8b['model'];if(_0x5052ee['query'][_0x7196('0x52')]){_0x28591e[_0x7196('0x55')]=[{'all':!![]}];}_0x28591e=_[_0x7196('0x56')]({},_0x28591e,_0x5052ee[_0x7196('0x50')]);return db['SalesforceAccount'][_0x7196('0x57')](_0x28591e)[_0x7196('0x22')](handleEntityNotFound(_0x48e3b5,null))[_0x7196('0x22')](respondWithResult(_0x48e3b5,null))[_0x7196('0x2b')](handleError(_0x48e3b5,null));};exports[_0x7196('0x58')]=function(_0x3177c2,_0x7bc89f){return db[_0x7196('0x3d')][_0x7196('0x58')](_0x3177c2[_0x7196('0x59')],{})[_0x7196('0x22')](respondWithResult(_0x7bc89f,0xc9))['catch'](handleError(_0x7bc89f,null));};exports[_0x7196('0x37')]=function(_0x6b65c1,_0x10ee13){if(_0x6b65c1['body']['id']){delete _0x6b65c1[_0x7196('0x59')]['id'];}return db['SalesforceAccount'][_0x7196('0x57')]({'where':{'id':_0x6b65c1[_0x7196('0x54')]['id']}})[_0x7196('0x22')](handleEntityNotFound(_0x10ee13,null))[_0x7196('0x22')](saveUpdates(_0x6b65c1[_0x7196('0x59')],null))['then'](respondWithResult(_0x10ee13,null))[_0x7196('0x2b')](handleError(_0x10ee13,null));};exports['destroy']=function(_0x4be36d,_0x5b9824){return db[_0x7196('0x3d')][_0x7196('0x57')]({'where':{'id':_0x4be36d[_0x7196('0x54')]['id']}})[_0x7196('0x22')](handleEntityNotFound(_0x5b9824,null))[_0x7196('0x22')](removeEntity(_0x5b9824,null))[_0x7196('0x2b')](handleError(_0x5b9824,null));};exports[_0x7196('0x5a')]=function(_0x560ddb,_0x293467,_0x14dc43){var _0x2d14f4={};var _0x2e5c9c={};var _0x196f12;var _0x5ef1eb;return db['SalesforceAccount'][_0x7196('0x5b')]({'where':{'id':_0x560ddb[_0x7196('0x54')]['id']}})[_0x7196('0x22')](handleEntityNotFound(_0x293467,null))[_0x7196('0x22')](function(_0x14cb38){if(_0x14cb38){_0x196f12=_0x14cb38;_0x2e5c9c[_0x7196('0x44')]=_[_0x7196('0x42')](db[_0x7196('0x5c')][_0x7196('0x3e')]);_0x2e5c9c[_0x7196('0x48')]=_[_0x7196('0x42')](_0x560ddb['query']);_0x2e5c9c[_0x7196('0x4c')]=_[_0x7196('0x43')](_0x2e5c9c[_0x7196('0x44')],_0x2e5c9c[_0x7196('0x48')]);_0x2d14f4['attributes']=_[_0x7196('0x43')](_0x2e5c9c[_0x7196('0x44')],qs[_0x7196('0x45')](_0x560ddb[_0x7196('0x48')][_0x7196('0x45')]));_0x2d14f4[_0x7196('0x46')]=_0x2d14f4[_0x7196('0x46')]['length']?_0x2d14f4[_0x7196('0x46')]:_0x2e5c9c[_0x7196('0x44')];_0x2d14f4[_0x7196('0x4a')]=qs[_0x7196('0x4b')](_0x560ddb['query'][_0x7196('0x4b')]);_0x2d14f4[_0x7196('0x51')]=qs[_0x7196('0x4c')](_[_0x7196('0x4d')](_0x560ddb[_0x7196('0x48')],_0x2e5c9c[_0x7196('0x4c')]));if(_0x560ddb[_0x7196('0x48')]['filter']){_0x2d14f4['where']=_['merge'](_0x2d14f4[_0x7196('0x51')],{'$or':_['map'](_0x2d14f4[_0x7196('0x46')],function(_0x432a38){var _0x22511c={};_0x22511c[_0x432a38]={'$like':'%'+_0x560ddb[_0x7196('0x48')][_0x7196('0x4f')]+'%'};return _0x22511c;})});}_0x2d14f4=_[_0x7196('0x56')]({},_0x2d14f4,_0x560ddb[_0x7196('0x50')]);return _0x196f12[_0x7196('0x5a')](_0x2d14f4);}})[_0x7196('0x22')](function(_0x52ab69){if(_0x52ab69){_0x5ef1eb=_0x52ab69['length'];if(!_0x560ddb[_0x7196('0x48')][_0x7196('0x49')](_0x7196('0x5d'))){_0x2d14f4[_0x7196('0x31')]=qs[_0x7196('0x31')](_0x560ddb[_0x7196('0x48')][_0x7196('0x31')]);_0x2d14f4[_0x7196('0x30')]=qs['offset'](_0x560ddb['query'][_0x7196('0x30')]);}return _0x196f12['getConfigurations'](_0x2d14f4);}})[_0x7196('0x22')](function(_0x52f532){if(_0x52f532){return _0x52f532?{'count':_0x5ef1eb,'rows':_0x52f532}:null;}})[_0x7196('0x22')](respondWithResult(_0x293467,null))[_0x7196('0x2b')](handleError(_0x293467,null));};exports[_0x7196('0x5e')]=function(_0x267903,_0x5ab6ae,_0x5a786a){if(_0x267903[_0x7196('0x59')]['id']){delete _0x267903['body']['id'];}return db[_0x7196('0x3d')][_0x7196('0x5b')]({'where':{'id':_0x267903[_0x7196('0x54')]['id']}})[_0x7196('0x22')](handleEntityNotFound(_0x5ab6ae,null))[_0x7196('0x22')](function(_0x1af971){if(_0x1af971){_0x267903['body'][_0x7196('0x5f')]=_0x1af971['id'];_0x267903[_0x7196('0x59')][_0x7196('0x60')]=integrations[_0x7196('0x61')](_0x267903[_0x7196('0x59')][_0x7196('0x62')],_0x267903[_0x7196('0x59')][_0x7196('0x40')]);_0x267903[_0x7196('0x59')][_0x7196('0x63')]=integrations[_0x7196('0x64')](_0x267903[_0x7196('0x59')]['channel'],_0x267903[_0x7196('0x59')][_0x7196('0x40')]);return db['SalesforceConfiguration']['create'](_0x267903[_0x7196('0x59')],{'include':[{'model':db[_0x7196('0x65')],'as':_0x7196('0x60')},{'model':db['SalesforceField'],'as':_0x7196('0x63')}]});}return null;})['then'](respondWithResult(_0x5ab6ae,null))[_0x7196('0x2b')](handleError(_0x5ab6ae,null));};exports[_0x7196('0x66')]=function(_0x4bcf73,_0x1b3d4a,_0x59f5ac){var _0x50d1f1;var _0x379bdb='';var _0x29b7c4=_0x7196('0x67');return db['SalesforceAccount'][_0x7196('0x5b')]({'where':{'id':_0x4bcf73['params']['id']},'attributes':['id',_0x7196('0x68'),_0x7196('0x69'),_0x7196('0x6a'),_0x7196('0x6b'),_0x7196('0x6c'),'securityToken']})[_0x7196('0x22')](handleEntityNotFound(_0x1b3d4a,null))[_0x7196('0x22')](function(_0xc9c0a6){if(_0xc9c0a6){_0x379bdb=_0xc9c0a6[_0x7196('0x68')];var _0xc44ef5=_0x379bdb[_0x7196('0x6d')](-0x1);if(_0xc44ef5==='/'){_0x379bdb=_0x379bdb[_0x7196('0x6e')](0x0,_0x379bdb[_0x7196('0x6f')](_0xc44ef5));}_0x50d1f1=new jsforce['Connection']({'oauth2':{'loginUrl':_0x379bdb,'clientId':_0xc9c0a6[_0x7196('0x69')],'clientSecret':_0xc9c0a6[_0x7196('0x6a')]}});return _0x50d1f1[_0x7196('0x70')](_0xc9c0a6[_0x7196('0x6b')],_0xc9c0a6['password'][_0x7196('0x71')](_0xc9c0a6[_0x7196('0x72')]));}})['then'](function(_0x2e4807){if(_0x2e4807){if(!_['isNil'](_0x4bcf73[_0x7196('0x48')]['ticketType'])){_0x29b7c4=_0x4bcf73[_0x7196('0x48')][_0x7196('0x73')];}return _0x50d1f1['sobject'](_0x29b7c4)[_0x7196('0x74')]();}})[_0x7196('0x22')](function(_0x2c2c53){var _0x4d5ea0=['CallDisposition',_0x7196('0x75'),'CallObject','CallType',_0x7196('0x76'),_0x7196('0x77'),_0x7196('0x78'),'Type'];if(!_[_0x7196('0x79')](_0x4bcf73[_0x7196('0x48')][_0x7196('0x73')])&&_0x4bcf73[_0x7196('0x48')][_0x7196('0x73')]===_0x7196('0x7a')){_0x4d5ea0=[_0x7196('0x7b'),_0x7196('0x7c'),_0x7196('0x7d'),_0x7196('0x78'),_0x7196('0x77'),'IsEscalated','SuppliedName',_0x7196('0x7e')];}if(_0x2c2c53){_['remove'](_0x2c2c53['fields'],function(_0x2bfdc4){return _0x2bfdc4[_0x7196('0x7f')]===![]&&!_0x4d5ea0[_0x7196('0x80')](_0x2bfdc4[_0x7196('0x3a')]);});return{'count':_0x2c2c53['fields']['length'],'rows':_[_0x7196('0x3c')](_0x2c2c53[_0x7196('0x45')],function(_0x1eea71){return{'id':_0x1eea71[_0x7196('0x3a')],'name':_0x1eea71['label'],'custom':_0x1eea71[_0x7196('0x7f')],'options':_0x1eea71['picklistValues']['length']>0x0?_[_0x7196('0x3c')](_0x1eea71[_0x7196('0x81')],function(_0x1e14da){return{'name':_0x1e14da['label'],'value':_0x1e14da[_0x7196('0x82')]};}):_0x1eea71[_0x7196('0x40')]==_0x7196('0x83')?[{'name':_0x7196('0x84'),'value':_0x7196('0x85')},{'name':_0x7196('0x86'),'value':_0x7196('0x87')}]:[]};})};}})[_0x7196('0x22')](respondWithResult(_0x1b3d4a,null))['catch'](function(_0x9bd2ea){var _0x2479b9=_0x4bcf73[_0x7196('0x48')][_0x7196('0x1e')]?0x1f4:_0x9bd2ea[_0x7196('0x88')]||0x1f4;logger['error'](_0x7196('0x89'),_0x7196('0x66'),_0x2479b9,JSON[_0x7196('0x27')](_0x9bd2ea));delete _0x9bd2ea['name'];if(_0x2479b9===0x191){_0x2479b9=0x190;}_0x1b3d4a[_0x7196('0x2c')](_0x2479b9)['send'](_0x4bcf73['query'][_0x7196('0x1e')]?{'message':_0x7196('0x8a'),'statusCode':_0x9bd2ea['statusCode']}:_0x9bd2ea);});}; \ No newline at end of file +var _0x4975=['Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','type','channel','SalesforceField','Descriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','lastIndexOf','login','isNil','ticketType','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Case','Origin','IsEscalated','remove','custom','includes','label','picklistValues','value','boolean','True','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x3b67cf,_0xc25939){var _0x28d29e=function(_0x4e6bc3){while(--_0x4e6bc3){_0x3b67cf['push'](_0x3b67cf['shift']());}};_0x28d29e(++_0xc25939);}(_0x4975,0x86));var _0x5497=function(_0x46d0b0,_0x32acb9){_0x46d0b0=_0x46d0b0-0x0;var _0x4243e6=_0x4975[_0x46d0b0];return _0x4243e6;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x5497('0x18'));var jayson=require(_0x5497('0x19'));var client=jayson[_0x5497('0x1a')][_0x5497('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x747dc7,_0x365144,_0x1f7169){if(_0x1f7169){var _0xaca97d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xaca97d[_0x5497('0x1c')](_0x365144)){return _0x747dc7;}else{throw new db[(_0x5497('0x1d'))]['ValidationError'](_0x5497('0x1e'));}}else{return _0x747dc7;}}function respondWithRpcPromise(_0x4fb8e9,_0x4237a9,_0x2bfd8a,_0x19e5f3){return new BPromise(function(_0x3ce50b,_0x37c18e){var _0x4073e6=_0x19e5f3||client;return _0x4073e6[_0x5497('0x1f')](_0x4fb8e9,_0x2bfd8a)['then'](function(_0x56a788){logger[_0x5497('0x20')](_0x5497('0x21'),_0x4237a9,_0x5497('0x22'));logger['debug'](_0x5497('0x23'),_0x4237a9,_0x5497('0x22'),JSON[_0x5497('0x24')](_0x56a788));if(_0x56a788[_0x5497('0x25')]){if(_0x56a788[_0x5497('0x25')][_0x5497('0x26')]===0x1f4){logger[_0x5497('0x25')](_0x5497('0x21'),_0x4237a9,_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);return _0x37c18e(_0x56a788[_0x5497('0x25')]['message']);}logger[_0x5497('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x4237a9,_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);return _0x3ce50b(_0x56a788[_0x5497('0x25')][_0x5497('0x27')]);}else{logger[_0x5497('0x20')](_0x5497('0x21'),_0x4237a9,'request\x20sent');_0x3ce50b(_0x56a788['result'][_0x5497('0x27')]);}})[_0x5497('0x28')](function(_0x24482a){logger[_0x5497('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x4237a9,_0x24482a);_0x37c18e(_0x24482a);});});}function respondWithStatusCode(_0x13b7a4,_0x57268c){_0x57268c=_0x57268c||0xcc;return function(_0x1f3198){if(_0x1f3198){return _0x13b7a4[_0x5497('0x29')](_0x57268c);}return _0x13b7a4[_0x5497('0x2a')](_0x57268c)[_0x5497('0x2b')]();};}function respondWithResult(_0x163a30,_0x31cd01){_0x31cd01=_0x31cd01||0xc8;return function(_0x48b835){if(_0x48b835){return _0x163a30[_0x5497('0x2a')](_0x31cd01)['json'](_0x48b835);}};}function respondWithFilteredResult(_0x583d06,_0x498f15){return function(_0x39a2b7){if(_0x39a2b7){var _0x48d146=_0x39a2b7[_0x5497('0x2c')],_0x5e9356=_0x498f15['offset'],_0xc3465=_0x498f15['offset']+_0x498f15['limit'],_0xb14593;if(_0xc3465>=_0x48d146){_0xc3465=_0x48d146;_0xb14593=0xc8;}else{_0xb14593=0xce;}_0x583d06[_0x5497('0x2a')](_0xb14593);return _0x583d06[_0x5497('0x2d')](_0x5497('0x2e'),_0x5e9356+'-'+_0xc3465+'/'+_0x48d146)['json'](_0x39a2b7);}return null;};}function patchUpdates(_0x489f71){return function(_0x594866){try{jsonpatch[_0x5497('0x2f')](_0x594866,_0x489f71,!![]);}catch(_0x572460){return BPromise[_0x5497('0x30')](_0x572460);}return _0x594866[_0x5497('0x31')]();};}function saveUpdates(_0x77c575,_0x4d05c4){return function(_0x1d208f){if(_0x1d208f){return _0x1d208f[_0x5497('0x32')](_0x77c575)['then'](function(_0xce7cb2){return _0xce7cb2;});}return null;};}function removeEntity(_0xce2e81,_0x331dfc){return function(_0x489fbd){if(_0x489fbd){return _0x489fbd[_0x5497('0x33')]()[_0x5497('0x34')](function(){_0xce2e81[_0x5497('0x2a')](0xcc)[_0x5497('0x2b')]();});}};}function handleEntityNotFound(_0x412f5b,_0x4a6459){return function(_0x386845){if(!_0x386845){_0x412f5b[_0x5497('0x29')](0x194);}return _0x386845;};}function handleError(_0x558a70,_0x1ffc9b){_0x1ffc9b=_0x1ffc9b||0x1f4;return function(_0x44299b){logger[_0x5497('0x25')](_0x44299b[_0x5497('0x35')]);if(_0x44299b[_0x5497('0x36')]){delete _0x44299b[_0x5497('0x36')];}_0x558a70['status'](_0x1ffc9b)[_0x5497('0x37')](_0x44299b);};}exports['index']=function(_0x7880e4,_0x212199){var _0x2751f5={},_0x5ab18c={},_0x4ec5f7={'count':0x0,'rows':[]};var _0x396a9f=_[_0x5497('0x38')](db[_0x5497('0x39')][_0x5497('0x3a')],function(_0x43d15f){return{'name':_0x43d15f[_0x5497('0x3b')],'type':_0x43d15f['type'][_0x5497('0x3c')]};});_0x5ab18c[_0x5497('0x3d')]=_[_0x5497('0x38')](_0x396a9f,_0x5497('0x36'));_0x5ab18c[_0x5497('0x3e')]=_[_0x5497('0x3f')](_0x7880e4[_0x5497('0x3e')]);_0x5ab18c[_0x5497('0x40')]=_[_0x5497('0x41')](_0x5ab18c['model'],_0x5ab18c[_0x5497('0x3e')]);_0x2751f5[_0x5497('0x42')]=_[_0x5497('0x41')](_0x5ab18c[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x43')]));_0x2751f5['attributes']=_0x2751f5[_0x5497('0x42')][_0x5497('0x44')]?_0x2751f5[_0x5497('0x42')]:_0x5ab18c[_0x5497('0x3d')];if(!_0x7880e4[_0x5497('0x3e')][_0x5497('0x45')](_0x5497('0x46'))){_0x2751f5['limit']=qs[_0x5497('0x47')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x47')]);_0x2751f5[_0x5497('0x48')]=qs[_0x5497('0x48')](_0x7880e4[_0x5497('0x3e')][_0x5497('0x48')]);}_0x2751f5[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x7880e4[_0x5497('0x3e')]['sort']);_0x2751f5[_0x5497('0x4b')]=qs['filters'](_[_0x5497('0x4c')](_0x7880e4[_0x5497('0x3e')],_0x5ab18c[_0x5497('0x40')]));if(_0x7880e4[_0x5497('0x3e')][_0x5497('0x4d')]){_0x2751f5['where']=_[_0x5497('0x4e')](_0x2751f5[_0x5497('0x4b')],{'$or':_['map'](_0x396a9f,function(_0x4d9a8d){if(_0x4d9a8d['type']!==_0x5497('0x4f')){var _0x4aa6b8={};_0x4aa6b8[_0x4d9a8d[_0x5497('0x36')]]={'$like':'%'+_0x7880e4[_0x5497('0x3e')][_0x5497('0x4d')]+'%'};return _0x4aa6b8;}})});}_0x2751f5=_[_0x5497('0x4e')]({},_0x2751f5,_0x7880e4[_0x5497('0x50')]);var _0x5bf06d={'where':_0x2751f5['where']};return db['SalesforceAccount']['count'](_0x5bf06d)[_0x5497('0x34')](function(_0x43c430){_0x4ec5f7[_0x5497('0x2c')]=_0x43c430;if(_0x7880e4[_0x5497('0x3e')][_0x5497('0x51')]){_0x2751f5[_0x5497('0x52')]=[{'all':!![]}];}return db[_0x5497('0x39')][_0x5497('0x53')](_0x2751f5);})[_0x5497('0x34')](function(_0x57350a){_0x4ec5f7[_0x5497('0x54')]=_0x57350a;return _0x4ec5f7;})[_0x5497('0x34')](respondWithFilteredResult(_0x212199,_0x2751f5))[_0x5497('0x28')](handleError(_0x212199,null));};exports['show']=function(_0x3e4da2,_0x530475){var _0x12ffbc={'raw':![],'where':{'id':_0x3e4da2[_0x5497('0x55')]['id']}},_0x31f1ba={};_0x31f1ba['model']=_[_0x5497('0x3f')](db[_0x5497('0x39')]['rawAttributes']);_0x31f1ba[_0x5497('0x3e')]=_['keys'](_0x3e4da2[_0x5497('0x3e')]);_0x31f1ba['filters']=_[_0x5497('0x41')](_0x31f1ba[_0x5497('0x3d')],_0x31f1ba[_0x5497('0x3e')]);_0x12ffbc[_0x5497('0x42')]=_[_0x5497('0x41')](_0x31f1ba[_0x5497('0x3d')],qs[_0x5497('0x43')](_0x3e4da2[_0x5497('0x3e')]['fields']));_0x12ffbc[_0x5497('0x42')]=_0x12ffbc['attributes']['length']?_0x12ffbc[_0x5497('0x42')]:_0x31f1ba[_0x5497('0x3d')];if(_0x3e4da2['query'][_0x5497('0x51')]){_0x12ffbc[_0x5497('0x52')]=[{'all':!![]}];}_0x12ffbc=_[_0x5497('0x4e')]({},_0x12ffbc,_0x3e4da2[_0x5497('0x50')]);return db['SalesforceAccount'][_0x5497('0x56')](_0x12ffbc)['then'](handleEntityNotFound(_0x530475,null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x28')](handleError(_0x530475,null));};exports[_0x5497('0x57')]=function(_0x2f7ec8,_0x49c85a){return db['SalesforceAccount'][_0x5497('0x57')](_0x2f7ec8['body'],{})[_0x5497('0x34')](respondWithResult(_0x49c85a,0xc9))['catch'](handleError(_0x49c85a,null));};exports[_0x5497('0x32')]=function(_0x5b9e57,_0xb1eac0){if(_0x5b9e57[_0x5497('0x58')]['id']){delete _0x5b9e57['body']['id'];}return db[_0x5497('0x39')]['find']({'where':{'id':_0x5b9e57['params']['id']}})[_0x5497('0x34')](handleEntityNotFound(_0xb1eac0,null))[_0x5497('0x34')](saveUpdates(_0x5b9e57['body'],null))[_0x5497('0x34')](respondWithResult(_0xb1eac0,null))[_0x5497('0x28')](handleError(_0xb1eac0,null));};exports[_0x5497('0x33')]=function(_0x28b2a3,_0x3fca40){return db[_0x5497('0x39')]['find']({'where':{'id':_0x28b2a3[_0x5497('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fca40,null))['then'](removeEntity(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};exports[_0x5497('0x59')]=function(_0x37e0b9,_0x23fd59,_0x544085){var _0x53eafd={};var _0x528fb4={};var _0x5f0243;var _0x5a676d;return db[_0x5497('0x39')][_0x5497('0x5a')]({'where':{'id':_0x37e0b9[_0x5497('0x55')]['id']}})[_0x5497('0x34')](handleEntityNotFound(_0x23fd59,null))[_0x5497('0x34')](function(_0x573f93){if(_0x573f93){_0x5f0243=_0x573f93;_0x528fb4[_0x5497('0x3d')]=_[_0x5497('0x3f')](db[_0x5497('0x5b')][_0x5497('0x3a')]);_0x528fb4['query']=_[_0x5497('0x3f')](_0x37e0b9[_0x5497('0x3e')]);_0x528fb4[_0x5497('0x40')]=_[_0x5497('0x41')](_0x528fb4['model'],_0x528fb4[_0x5497('0x3e')]);_0x53eafd[_0x5497('0x42')]=_[_0x5497('0x41')](_0x528fb4['model'],qs[_0x5497('0x43')](_0x37e0b9['query']['fields']));_0x53eafd['attributes']=_0x53eafd[_0x5497('0x42')][_0x5497('0x44')]?_0x53eafd[_0x5497('0x42')]:_0x528fb4['model'];_0x53eafd[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4a')]);_0x53eafd['where']=qs[_0x5497('0x40')](_[_0x5497('0x4c')](_0x37e0b9[_0x5497('0x3e')],_0x528fb4['filters']));if(_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4d')]){_0x53eafd[_0x5497('0x4b')]=_[_0x5497('0x4e')](_0x53eafd[_0x5497('0x4b')],{'$or':_[_0x5497('0x38')](_0x53eafd[_0x5497('0x42')],function(_0x4b4cfe){var _0x2c2651={};_0x2c2651[_0x4b4cfe]={'$like':'%'+_0x37e0b9[_0x5497('0x3e')][_0x5497('0x4d')]+'%'};return _0x2c2651;})});}_0x53eafd=_[_0x5497('0x4e')]({},_0x53eafd,_0x37e0b9['options']);return _0x5f0243['getConfigurations'](_0x53eafd);}})['then'](function(_0x305d5b){if(_0x305d5b){_0x5a676d=_0x305d5b[_0x5497('0x44')];if(!_0x37e0b9[_0x5497('0x3e')]['hasOwnProperty'](_0x5497('0x46'))){_0x53eafd[_0x5497('0x47')]=qs[_0x5497('0x47')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x47')]);_0x53eafd[_0x5497('0x48')]=qs[_0x5497('0x48')](_0x37e0b9[_0x5497('0x3e')][_0x5497('0x48')]);}return _0x5f0243[_0x5497('0x59')](_0x53eafd);}})[_0x5497('0x34')](function(_0x5a8b3a){if(_0x5a8b3a){return _0x5a8b3a?{'count':_0x5a676d,'rows':_0x5a8b3a}:null;}})[_0x5497('0x34')](respondWithResult(_0x23fd59,null))[_0x5497('0x28')](handleError(_0x23fd59,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){if(_0x4ef195[_0x5497('0x58')]['id']){delete _0x4ef195[_0x5497('0x58')]['id'];}return db['SalesforceAccount'][_0x5497('0x5a')]({'where':{'id':_0x4ef195[_0x5497('0x55')]['id']}})[_0x5497('0x34')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x34')](function(_0x535dba){if(_0x535dba){_0x4ef195[_0x5497('0x58')][_0x5497('0x5d')]=_0x535dba['id'];_0x4ef195[_0x5497('0x58')]['Subjects']=integrations[_0x5497('0x5e')](_0x4ef195[_0x5497('0x58')]['channel'],_0x4ef195[_0x5497('0x58')][_0x5497('0x5f')]);_0x4ef195[_0x5497('0x58')]['Descriptions']=integrations['getDescriptions'](_0x4ef195[_0x5497('0x58')][_0x5497('0x60')],_0x4ef195[_0x5497('0x58')][_0x5497('0x5f')]);return db[_0x5497('0x5b')][_0x5497('0x57')](_0x4ef195[_0x5497('0x58')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x5497('0x61')],'as':_0x5497('0x62')}]});}return null;})['then'](respondWithResult(_0x5794ff,null))[_0x5497('0x28')](handleError(_0x5794ff,null));};exports[_0x5497('0x63')]=function(_0x7415ba,_0x510078,_0xd55539){var _0x3e1e7f;var _0x50356d='';var _0x338957=_0x5497('0x64');return db[_0x5497('0x39')][_0x5497('0x5a')]({'where':{'id':_0x7415ba[_0x5497('0x55')]['id']},'attributes':['id','remoteUri',_0x5497('0x65'),_0x5497('0x66'),_0x5497('0x67'),_0x5497('0x68'),_0x5497('0x69')]})['then'](handleEntityNotFound(_0x510078,null))[_0x5497('0x34')](function(_0xe6996a){if(_0xe6996a){_0x50356d=_0xe6996a[_0x5497('0x6a')];var _0x9e3f4=_0x50356d['slice'](-0x1);if(_0x9e3f4==='/'){_0x50356d=_0x50356d[_0x5497('0x6b')](0x0,_0x50356d[_0x5497('0x6c')](_0x9e3f4));}_0x3e1e7f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x50356d,'clientId':_0xe6996a[_0x5497('0x65')],'clientSecret':_0xe6996a[_0x5497('0x66')]}});return _0x3e1e7f[_0x5497('0x6d')](_0xe6996a[_0x5497('0x67')],_0xe6996a['password']['concat'](_0xe6996a['securityToken']));}})['then'](function(_0x594761){if(_0x594761){if(!_[_0x5497('0x6e')](_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')])){_0x338957=_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')];}return _0x3e1e7f['sobject'](_0x338957)['describe']();}})[_0x5497('0x34')](function(_0x3971dc){var _0x29a2a8=[_0x5497('0x70'),_0x5497('0x71'),_0x5497('0x72'),_0x5497('0x73'),_0x5497('0x74'),_0x5497('0x75'),_0x5497('0x76'),'Type'];if(!_[_0x5497('0x6e')](_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')])&&_0x7415ba[_0x5497('0x3e')][_0x5497('0x6f')]===_0x5497('0x77')){_0x29a2a8=['Type',_0x5497('0x78'),'Reason',_0x5497('0x76'),_0x5497('0x75'),_0x5497('0x79'),'SuppliedName','SuppliedCompany'];}if(_0x3971dc){_[_0x5497('0x7a')](_0x3971dc[_0x5497('0x43')],function(_0x953b31){return _0x953b31[_0x5497('0x7b')]===![]&&!_0x29a2a8[_0x5497('0x7c')](_0x953b31[_0x5497('0x36')]);});return{'count':_0x3971dc[_0x5497('0x43')][_0x5497('0x44')],'rows':_['map'](_0x3971dc['fields'],function(_0x492372){return{'id':_0x492372[_0x5497('0x36')],'name':_0x492372[_0x5497('0x7d')],'custom':_0x492372[_0x5497('0x7b')],'options':_0x492372[_0x5497('0x7e')]['length']>0x0?_['map'](_0x492372[_0x5497('0x7e')],function(_0xf38193){return{'name':_0xf38193['label'],'value':_0xf38193[_0x5497('0x7f')]};}):_0x492372[_0x5497('0x5f')]==_0x5497('0x80')?[{'name':_0x5497('0x81'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})['then'](respondWithResult(_0x510078,null))['catch'](function(_0x497295){var _0x579355=_0x7415ba[_0x5497('0x3e')]['test']?0x1f4:_0x497295[_0x5497('0x82')]||0x1f4;logger[_0x5497('0x25')](_0x5497('0x83'),_0x5497('0x63'),_0x579355,JSON[_0x5497('0x24')](_0x497295));delete _0x497295[_0x5497('0x36')];if(_0x579355===0x191){_0x579355=0x190;}_0x510078['status'](_0x579355)[_0x5497('0x37')](_0x7415ba['query'][_0x5497('0x1c')]?{'message':_0x5497('0x84'),'statusCode':_0x497295[_0x5497('0x82')]}:_0x497295);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e936085..5b1a03e 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 _0xef51=['request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','../../config/logger','api','moment','bluebird'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xef51,0x64));var _0x1ef5=function(_0x5665b7,_0x634f29){_0x5665b7=_0x5665b7-0x0;var _0x21418c=_0xef51[_0x5665b7];return _0x21418c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1ef5('0x0'))(_0x1ef5('0x1'));var moment=require(_0x1ef5('0x2'));var BPromise=require(_0x1ef5('0x3'));var rp=require(_0x1ef5('0x4'));var fs=require('fs');var path=require(_0x1ef5('0x5'));var rimraf=require(_0x1ef5('0x6'));var config=require(_0x1ef5('0x7'));var attributes=require(_0x1ef5('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x1ef5('0x9')]=function(_0x53b144,_0x49d9bf){return _0x53b144[_0x1ef5('0xa')](_0x1ef5('0xb'),attributes,{'tableName':_0x1ef5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18ff=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0xecafcb,_0x13bf81){var _0x52a099=function(_0x5a0aae){while(--_0x5a0aae){_0xecafcb['push'](_0xecafcb['shift']());}};_0x52a099(++_0x13bf81);}(_0x18ff,0xf3));var _0xf18f=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x18ff[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xf18f('0x0'));var util=require(_0xf18f('0x1'));var logger=require(_0xf18f('0x2'))(_0xf18f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf18f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf18f('0x5'));var config=require(_0xf18f('0x6'));var attributes=require(_0xf18f('0x7'));var integrations=require(_0xf18f('0x8'));module['exports']=function(_0x331e39,_0xe48976){return _0x331e39[_0xf18f('0x9')](_0xf18f('0xa'),attributes,{'tableName':_0xf18f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index ff95210..3ecffef 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 _0xa902=['include','map','model','ShowSalesforceAccount','SalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xa902,0x8d));var _0x2a90=function(_0x25c637,_0x8f9def){_0x25c637=_0x25c637-0x0;var _0x4135d7=_0xa902[_0x25c637];return _0x4135d7;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['SalesforceAccount'][_0x2a90('0x18')]({'raw':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1c')]||null:null,'limit':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')]['limit']||null:null,'include':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x5c3e4b['options'][_0x2a90('0x1d')],function(_0xd033d){return{'model':db[_0xd033d['model']],'as':_0xd033d['as'],'attributes':_0xd033d[_0x2a90('0x1c')],'include':_0xd033d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0xd033d[_0x2a90('0x1d')],function(_0x2a212c){return{'model':db[_0x2a212c[_0x2a90('0x1f')]],'as':_0x2a212c['as'],'attributes':_0x2a212c[_0x2a90('0x1c')],'include':_0x2a212c[_0x2a90('0x1d')]?_['map'](_0x2a212c[_0x2a90('0x1d')],function(_0x17f978){return{'model':db[_0x17f978[_0x2a90('0x1f')]],'as':_0x17f978['as'],'attributes':_0x17f978[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x5208d8){logger['info'](_0x2a90('0x17'),_0x5c3e4b);logger['debug']('GetSalesforceAccount',_0x5c3e4b,JSON['stringify'](_0x5208d8));_0x1d9a28(_0x5208d8);})[_0x2a90('0x16')](function(_0x3c78f5){logger['error']('GetSalesforceAccount',_0x3c78f5[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3c78f5[_0x2a90('0x14')]));});});};exports[_0x2a90('0x20')]=function(_0x3b580f){var _0x27b6b6=this;return new Promise(function(_0xf18d11,_0x11586c){return db[_0x2a90('0x21')]['find']({'raw':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b580f['options']?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')]['attributes']||null:null,'include':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')],function(_0x4d4149){return{'model':db[_0x4d4149[_0x2a90('0x1f')]],'as':_0x4d4149['as'],'attributes':_0x4d4149[_0x2a90('0x1c')],'include':_0x4d4149[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x4d4149['include'],function(_0x1bab1d){return{'model':db[_0x1bab1d[_0x2a90('0x1f')]],'as':_0x1bab1d['as'],'attributes':_0x1bab1d['attributes'],'include':_0x1bab1d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x1bab1d['include'],function(_0x5073a4){return{'model':db[_0x5073a4[_0x2a90('0x1f')]],'as':_0x5073a4['as'],'attributes':_0x5073a4[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x4cd36c){logger[_0x2a90('0xd')]('ShowSalesforceAccount',_0x3b580f);logger[_0x2a90('0xf')]('ShowSalesforceAccount',_0x3b580f,JSON[_0x2a90('0x12')](_0x4cd36c));_0xf18d11(_0x4cd36c);})['catch'](function(_0x5322dc){logger[_0x2a90('0x13')]('ShowSalesforceAccount',_0x5322dc[_0x2a90('0x14')],_0x3b580f);_0x11586c(_0x27b6b6[_0x2a90('0x13')](0x1f4,_0x5322dc[_0x2a90('0x14')]));});});}; \ No newline at end of file +var _0xedd9=['attributes','limit','map','include','model','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xedd9,0xfc));var _0x9edd=function(_0x12f594,_0x2ad1a6){_0x12f594=_0x12f594-0x0;var _0x467996=_0xedd9[_0x12f594];return _0x467996;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}exports[_0x9edd('0x17')]=function(_0x40ba32){var _0x4d8f33=this;return new Promise(function(_0x43dc70,_0x5d879c){return db[_0x9edd('0x18')][_0x9edd('0x19')]({'raw':_0x40ba32['options']?_0x40ba32['options'][_0x9edd('0x1a')]===undefined?!![]:![]:!![],'where':_0x40ba32['options']?_0x40ba32[_0x9edd('0x1b')]['where']||null:null,'attributes':_0x40ba32['options']?_0x40ba32[_0x9edd('0x1b')][_0x9edd('0x1c')]||null:null,'limit':_0x40ba32['options']?_0x40ba32['options'][_0x9edd('0x1d')]||null:null,'include':_0x40ba32[_0x9edd('0x1b')]?_0x40ba32[_0x9edd('0x1b')]['include']?_[_0x9edd('0x1e')](_0x40ba32[_0x9edd('0x1b')][_0x9edd('0x1f')],function(_0x2ca65f){return{'model':db[_0x2ca65f[_0x9edd('0x20')]],'as':_0x2ca65f['as'],'attributes':_0x2ca65f['attributes'],'include':_0x2ca65f[_0x9edd('0x1f')]?_[_0x9edd('0x1e')](_0x2ca65f[_0x9edd('0x1f')],function(_0x2f9f86){return{'model':db[_0x2f9f86[_0x9edd('0x20')]],'as':_0x2f9f86['as'],'attributes':_0x2f9f86['attributes'],'include':_0x2f9f86['include']?_[_0x9edd('0x1e')](_0x2f9f86[_0x9edd('0x1f')],function(_0x8d67aa){return{'model':db[_0x8d67aa[_0x9edd('0x20')]],'as':_0x8d67aa['as'],'attributes':_0x8d67aa[_0x9edd('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57a2cc){logger[_0x9edd('0xe')](_0x9edd('0x17'),_0x40ba32);logger[_0x9edd('0x10')]('GetSalesforceAccount',_0x40ba32,JSON[_0x9edd('0x11')](_0x57a2cc));_0x43dc70(_0x57a2cc);})[_0x9edd('0x16')](function(_0x2ae8dd){logger[_0x9edd('0x12')]('GetSalesforceAccount',_0x2ae8dd[_0x9edd('0x15')],_0x40ba32);_0x5d879c(_0x4d8f33[_0x9edd('0x12')](0x1f4,_0x2ae8dd[_0x9edd('0x15')]));});});};exports[_0x9edd('0x21')]=function(_0xbbf08f){var _0x42e664=this;return new Promise(function(_0x209aba,_0x1fba7b){return db[_0x9edd('0x18')][_0x9edd('0x22')]({'raw':_0xbbf08f[_0x9edd('0x1b')]?_0xbbf08f[_0x9edd('0x1b')][_0x9edd('0x1a')]===undefined?!![]:![]:!![],'where':_0xbbf08f[_0x9edd('0x1b')]?_0xbbf08f[_0x9edd('0x1b')]['where']||null:null,'attributes':_0xbbf08f[_0x9edd('0x1b')]?_0xbbf08f[_0x9edd('0x1b')][_0x9edd('0x1c')]||null:null,'include':_0xbbf08f['options']?_0xbbf08f[_0x9edd('0x1b')][_0x9edd('0x1f')]?_[_0x9edd('0x1e')](_0xbbf08f[_0x9edd('0x1b')][_0x9edd('0x1f')],function(_0x2bc4ed){return{'model':db[_0x2bc4ed[_0x9edd('0x20')]],'as':_0x2bc4ed['as'],'attributes':_0x2bc4ed[_0x9edd('0x1c')],'include':_0x2bc4ed[_0x9edd('0x1f')]?_[_0x9edd('0x1e')](_0x2bc4ed[_0x9edd('0x1f')],function(_0x42c1d9){return{'model':db[_0x42c1d9[_0x9edd('0x20')]],'as':_0x42c1d9['as'],'attributes':_0x42c1d9[_0x9edd('0x1c')],'include':_0x42c1d9['include']?_[_0x9edd('0x1e')](_0x42c1d9['include'],function(_0x968303){return{'model':db[_0x968303[_0x9edd('0x20')]],'as':_0x968303['as'],'attributes':_0x968303[_0x9edd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9edd('0xd')](function(_0x16770e){logger['info'](_0x9edd('0x21'),_0xbbf08f);logger[_0x9edd('0x10')](_0x9edd('0x21'),_0xbbf08f,JSON[_0x9edd('0x11')](_0x16770e));_0x209aba(_0x16770e);})[_0x9edd('0x16')](function(_0x337e6c){logger[_0x9edd('0x12')](_0x9edd('0x21'),_0x337e6c[_0x9edd('0x15')],_0xbbf08f);_0x1fba7b(_0x42e664[_0x9edd('0x12')](0x1f4,_0x337e6c['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 6fa0f11..b3f6b88 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 _0x606c=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/fields','/:id/subjects'];(function(_0x470bbf,_0x41491d){var _0x1c7d6f=function(_0x360aa4){while(--_0x360aa4){_0x470bbf['push'](_0x470bbf['shift']());}};_0x1c7d6f(++_0x41491d);}(_0x606c,0x160));var _0xc606=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0x606c[_0xc8a11];return _0x55a500;};'use strict';var multer=require('multer');var util=require(_0xc606('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc606('0x1')]();var auth=require(_0xc606('0x2'));var interaction=require(_0xc606('0x3'));var config=require(_0xc606('0x4'));var controller=require('./intSalesforceConfiguration.controller');router[_0xc606('0x5')]('/',auth[_0xc606('0x6')](),controller['index']);router['get']('/:id',auth[_0xc606('0x6')](),controller['show']);router[_0xc606('0x5')](_0xc606('0x7'),auth[_0xc606('0x6')](),controller['getFields']);router[_0xc606('0x5')](_0xc606('0x8'),auth['isAuthenticated'](),controller[_0xc606('0x9')]);router[_0xc606('0x5')](_0xc606('0xa'),auth[_0xc606('0x6')](),controller[_0xc606('0xb')]);router[_0xc606('0xc')]('/',auth[_0xc606('0x6')](),controller[_0xc606('0xd')]);router[_0xc606('0xe')](_0xc606('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xc606('0x10')](_0xc606('0xf'),auth[_0xc606('0x6')](),controller[_0xc606('0x11')]);module[_0xc606('0x12')]=router; \ No newline at end of file +var _0x95a2=['create','put','update','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/fields','getFields','/:id/descriptions','getDescriptions','post'];(function(_0x3d0c0a,_0x569519){var _0x338e0e=function(_0x50f9aa){while(--_0x50f9aa){_0x3d0c0a['push'](_0x3d0c0a['shift']());}};_0x338e0e(++_0x569519);}(_0x95a2,0x191));var _0x295a=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0x95a2[_0x250f95];return _0x4ada97;};'use strict';var multer=require(_0x295a('0x0'));var util=require(_0x295a('0x1'));var path=require(_0x295a('0x2'));var timeout=require(_0x295a('0x3'));var express=require('express');var router=express[_0x295a('0x4')]();var auth=require(_0x295a('0x5'));var interaction=require(_0x295a('0x6'));var config=require(_0x295a('0x7'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0x295a('0x8')](),controller[_0x295a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x295a('0xa')]);router[_0x295a('0xb')](_0x295a('0xc'),auth[_0x295a('0x8')](),controller[_0x295a('0xd')]);router[_0x295a('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x295a('0xb')](_0x295a('0xe'),auth[_0x295a('0x8')](),controller[_0x295a('0xf')]);router[_0x295a('0x10')]('/',auth[_0x295a('0x8')](),controller[_0x295a('0x11')]);router[_0x295a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x295a('0x13')]);router['delete'](_0x295a('0x14'),auth[_0x295a('0x8')](),controller[_0x295a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index daf917a..e9b63e2 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 _0x0f0d=['contact','exports','STRING','Task','ENUM','lead','contact_lead','nothing'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f0d,0x111));var _0xd0f0=function(_0xafcf00,_0x4429a3){_0xafcf00=_0xafcf00-0x0;var _0x513af4=_0x0f0d[_0xafcf00];return _0x513af4;};'use strict';var Sequelize=require('sequelize');module[_0xd0f0('0x0')]={'name':{'type':Sequelize[_0xd0f0('0x1')]},'description':{'type':Sequelize[_0xd0f0('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xd0f0('0x2'),'Case'),'defaultValue':_0xd0f0('0x2')},'moduleSearch':{'type':Sequelize[_0xd0f0('0x3')]('contact_lead','contact',_0xd0f0('0x4')),'defaultValue':_0xd0f0('0x5')},'moduleCreate':{'type':Sequelize[_0xd0f0('0x3')](_0xd0f0('0x6'),_0xd0f0('0x7'),_0xd0f0('0x4')),'defaultValue':'lead'}}; \ No newline at end of file +var _0x46c2=['ENUM','Task','Case','contact_lead','contact','lead','STRING'];(function(_0x48022c,_0x312852){var _0x541424=function(_0x133cc3){while(--_0x133cc3){_0x48022c['push'](_0x48022c['shift']());}};_0x541424(++_0x312852);}(_0x46c2,0xe6));var _0x246c=function(_0x5520fe,_0x4769ce){_0x5520fe=_0x5520fe-0x0;var _0x61c4ce=_0x46c2[_0x5520fe];return _0x61c4ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x246c('0x0')]},'description':{'type':Sequelize[_0x246c('0x0')]},'ticketType':{'type':Sequelize[_0x246c('0x1')](_0x246c('0x2'),_0x246c('0x3')),'defaultValue':_0x246c('0x2')},'moduleSearch':{'type':Sequelize[_0x246c('0x1')](_0x246c('0x4'),_0x246c('0x5'),_0x246c('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x246c('0x5'),_0x246c('0x6')),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 338ee98..150f58b 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 _0x34b5=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SalesforceConfiguration'];(function(_0x2f7da4,_0x15afc0){var _0x1e737e=function(_0xeabd4a){while(--_0xeabd4a){_0x2f7da4['push'](_0x2f7da4['shift']());}};_0x1e737e(++_0x15afc0);}(_0x34b5,0xe8));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x534b('0x0'));var emlformat=require(_0x534b('0x1'));var rimraf=require(_0x534b('0x2'));var zipdir=require(_0x534b('0x3'));var jsonpatch=require(_0x534b('0x4'));var rp=require(_0x534b('0x5'));var moment=require('moment');var BPromise=require(_0x534b('0x6'));var Mustache=require(_0x534b('0x7'));var util=require(_0x534b('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x534b('0x9'));var fs=require('fs');var _=require(_0x534b('0xa'));var squel=require('squel');var crypto=require(_0x534b('0xb'));var jsforce=require(_0x534b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x534b('0xd'));var querystring=require('querystring');var Papa=require(_0x534b('0xe'));var Redis=require(_0x534b('0xf'));var authService=require(_0x534b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x534b('0x11'));var logger=require(_0x534b('0x12'))(_0x534b('0x13'));var utils=require(_0x534b('0x14'));var config=require(_0x534b('0x15'));var db=require(_0x534b('0x16'))['db'];var jayson=require(_0x534b('0x17'));var client=jayson[_0x534b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x270ef1,_0x2f4f10,_0x388c80){if(_0x388c80){var _0x50edcb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50edcb[_0x534b('0x19')](_0x2f4f10)){return _0x270ef1;}else{throw new db[(_0x534b('0x1a'))][(_0x534b('0x1b'))](_0x534b('0x1c'));}}else{return _0x270ef1;}}function respondWithRpcPromise(_0x39a53e,_0x1c323e,_0x5e3a5f,_0x5c0ea4){return new BPromise(function(_0xa982e5,_0x50c7b9){var _0x47f858=_0x5c0ea4||client;return _0x47f858['request'](_0x39a53e,_0x5e3a5f)[_0x534b('0x1d')](function(_0x3b624e){logger[_0x534b('0x1e')](_0x534b('0x1f'),_0x1c323e,_0x534b('0x20'));logger[_0x534b('0x21')](_0x534b('0x22'),_0x1c323e,_0x534b('0x20'),JSON[_0x534b('0x23')](_0x3b624e));if(_0x3b624e[_0x534b('0x24')]){if(_0x3b624e[_0x534b('0x24')][_0x534b('0x25')]===0x1f4){logger[_0x534b('0x24')](_0x534b('0x1f'),_0x1c323e,_0x3b624e[_0x534b('0x24')][_0x534b('0x26')]);return _0x50c7b9(_0x3b624e[_0x534b('0x24')][_0x534b('0x26')]);}logger[_0x534b('0x24')](_0x534b('0x1f'),_0x1c323e,_0x3b624e[_0x534b('0x24')]['message']);return _0xa982e5(_0x3b624e[_0x534b('0x24')]['message']);}else{logger[_0x534b('0x1e')](_0x534b('0x1f'),_0x1c323e,_0x534b('0x20'));_0xa982e5(_0x3b624e[_0x534b('0x27')][_0x534b('0x26')]);}})['catch'](function(_0x28500b){logger['error'](_0x534b('0x1f'),_0x1c323e,_0x28500b);_0x50c7b9(_0x28500b);});});}function respondWithStatusCode(_0x57c8d0,_0x437559){_0x437559=_0x437559||0xcc;return function(_0x5bcf10){if(_0x5bcf10){return _0x57c8d0[_0x534b('0x28')](_0x437559);}return _0x57c8d0[_0x534b('0x29')](_0x437559)[_0x534b('0x2a')]();};}function respondWithResult(_0x472b0d,_0x3ace8f){_0x3ace8f=_0x3ace8f||0xc8;return function(_0x247825){if(_0x247825){return _0x472b0d[_0x534b('0x29')](_0x3ace8f)['json'](_0x247825);}};}function respondWithFilteredResult(_0xe37422,_0x21ecb7){return function(_0x2fbcc2){if(_0x2fbcc2){var _0xe31cd4=_0x2fbcc2[_0x534b('0x2b')],_0x2171cf=_0x21ecb7[_0x534b('0x2c')],_0x5602b6=_0x21ecb7[_0x534b('0x2c')]+_0x21ecb7['limit'],_0x14b8c7;if(_0x5602b6>=_0xe31cd4){_0x5602b6=_0xe31cd4;_0x14b8c7=0xc8;}else{_0x14b8c7=0xce;}_0xe37422[_0x534b('0x29')](_0x14b8c7);return _0xe37422[_0x534b('0x2d')](_0x534b('0x2e'),_0x2171cf+'-'+_0x5602b6+'/'+_0xe31cd4)[_0x534b('0x2f')](_0x2fbcc2);}return null;};}function patchUpdates(_0x3c10fa){return function(_0x4cb1a0){try{jsonpatch[_0x534b('0x30')](_0x4cb1a0,_0x3c10fa,!![]);}catch(_0x27e17e){return BPromise[_0x534b('0x31')](_0x27e17e);}return _0x4cb1a0[_0x534b('0x32')]();};}function saveUpdates(_0xeb2fa9,_0x230ab0){return function(_0x362317){if(_0x362317){return _0x362317[_0x534b('0x33')](_0xeb2fa9)[_0x534b('0x1d')](function(_0x25ae1b){return _0x25ae1b;});}return null;};}function removeEntity(_0x1f98fa,_0x5e4362){return function(_0x4dbb6c){if(_0x4dbb6c){return _0x4dbb6c[_0x534b('0x34')]()['then'](function(){_0x1f98fa[_0x534b('0x29')](0xcc)[_0x534b('0x2a')]();});}};}function handleEntityNotFound(_0xcfbc21,_0xe4d657){return function(_0x511706){if(!_0x511706){_0xcfbc21[_0x534b('0x28')](0x194);}return _0x511706;};}function handleError(_0x26e1f9,_0x2da044){_0x2da044=_0x2da044||0x1f4;return function(_0x2fee35){logger[_0x534b('0x24')](_0x2fee35[_0x534b('0x35')]);if(_0x2fee35[_0x534b('0x36')]){delete _0x2fee35[_0x534b('0x36')];}_0x26e1f9[_0x534b('0x29')](_0x2da044)[_0x534b('0x37')](_0x2fee35);};}exports[_0x534b('0x38')]=function(_0x5806d4,_0x15c82d){var _0x3e5223={},_0x11e8cb={},_0x47149f={'count':0x0,'rows':[]};var _0x4a6439=_[_0x534b('0x39')](db[_0x534b('0x3a')][_0x534b('0x3b')],function(_0x439bf0){return{'name':_0x439bf0[_0x534b('0x3c')],'type':_0x439bf0[_0x534b('0x3d')][_0x534b('0x3e')]};});_0x11e8cb[_0x534b('0x3f')]=_[_0x534b('0x39')](_0x4a6439,_0x534b('0x36'));_0x11e8cb[_0x534b('0x40')]=_[_0x534b('0x41')](_0x5806d4[_0x534b('0x40')]);_0x11e8cb['filters']=_[_0x534b('0x42')](_0x11e8cb[_0x534b('0x3f')],_0x11e8cb[_0x534b('0x40')]);_0x3e5223[_0x534b('0x43')]=_[_0x534b('0x42')](_0x11e8cb[_0x534b('0x3f')],qs['fields'](_0x5806d4[_0x534b('0x40')]['fields']));_0x3e5223[_0x534b('0x43')]=_0x3e5223[_0x534b('0x43')][_0x534b('0x44')]?_0x3e5223[_0x534b('0x43')]:_0x11e8cb[_0x534b('0x3f')];if(!_0x5806d4[_0x534b('0x40')]['hasOwnProperty'](_0x534b('0x45'))){_0x3e5223[_0x534b('0x46')]=qs[_0x534b('0x46')](_0x5806d4[_0x534b('0x40')][_0x534b('0x46')]);_0x3e5223[_0x534b('0x2c')]=qs[_0x534b('0x2c')](_0x5806d4[_0x534b('0x40')]['offset']);}_0x3e5223[_0x534b('0x47')]=qs[_0x534b('0x48')](_0x5806d4[_0x534b('0x40')]['sort']);_0x3e5223[_0x534b('0x49')]=qs[_0x534b('0x4a')](_[_0x534b('0x4b')](_0x5806d4[_0x534b('0x40')],_0x11e8cb[_0x534b('0x4a')]));if(_0x5806d4[_0x534b('0x40')][_0x534b('0x4c')]){_0x3e5223['where']=_[_0x534b('0x4d')](_0x3e5223[_0x534b('0x49')],{'$or':_['map'](_0x4a6439,function(_0x19bc34){if(_0x19bc34['type']!==_0x534b('0x4e')){var _0x202b6d={};_0x202b6d[_0x19bc34[_0x534b('0x36')]]={'$like':'%'+_0x5806d4[_0x534b('0x40')][_0x534b('0x4c')]+'%'};return _0x202b6d;}})});}_0x3e5223=_['merge']({},_0x3e5223,_0x5806d4[_0x534b('0x4f')]);var _0x3dd92d={'where':_0x3e5223[_0x534b('0x49')]};return db[_0x534b('0x3a')][_0x534b('0x2b')](_0x3dd92d)['then'](function(_0xa17c12){_0x47149f['count']=_0xa17c12;if(_0x5806d4[_0x534b('0x40')][_0x534b('0x50')]){_0x3e5223[_0x534b('0x51')]=[{'all':!![]}];}return db[_0x534b('0x3a')][_0x534b('0x52')](_0x3e5223);})[_0x534b('0x1d')](function(_0x153cd0){_0x47149f[_0x534b('0x53')]=_0x153cd0;return _0x47149f;})[_0x534b('0x1d')](respondWithFilteredResult(_0x15c82d,_0x3e5223))[_0x534b('0x54')](handleError(_0x15c82d,null));};exports[_0x534b('0x55')]=function(_0xa91247,_0x7ea6a){var _0x3460f1={'raw':![],'where':{'id':_0xa91247[_0x534b('0x56')]['id']}},_0x2eb0e8={};_0x2eb0e8[_0x534b('0x3f')]=_[_0x534b('0x41')](db[_0x534b('0x3a')]['rawAttributes']);_0x2eb0e8[_0x534b('0x40')]=_[_0x534b('0x41')](_0xa91247[_0x534b('0x40')]);_0x2eb0e8[_0x534b('0x4a')]=_[_0x534b('0x42')](_0x2eb0e8[_0x534b('0x3f')],_0x2eb0e8[_0x534b('0x40')]);_0x3460f1[_0x534b('0x43')]=_[_0x534b('0x42')](_0x2eb0e8[_0x534b('0x3f')],qs['fields'](_0xa91247[_0x534b('0x40')][_0x534b('0x57')]));_0x3460f1['attributes']=_0x3460f1['attributes']['length']?_0x3460f1[_0x534b('0x43')]:_0x2eb0e8[_0x534b('0x3f')];if(_0xa91247[_0x534b('0x40')]['includeAll']){_0x3460f1[_0x534b('0x51')]=[{'all':!![]}];}_0x3460f1=_[_0x534b('0x4d')]({},_0x3460f1,_0xa91247[_0x534b('0x4f')]);return db['SalesforceConfiguration'][_0x534b('0x58')](_0x3460f1)[_0x534b('0x1d')](handleEntityNotFound(_0x7ea6a,null))[_0x534b('0x1d')](respondWithResult(_0x7ea6a,null))['catch'](handleError(_0x7ea6a,null));};exports[_0x534b('0x59')]=function(_0x33d342,_0x15bb73){return db[_0x534b('0x3a')]['create'](_0x33d342['body'],{})['then'](respondWithResult(_0x15bb73,0xc9))['catch'](handleError(_0x15bb73,null));};exports['update']=function(_0x4646b7,_0x23318d){if(_0x4646b7[_0x534b('0x5a')]['id']){delete _0x4646b7['body']['id'];}return db[_0x534b('0x3a')][_0x534b('0x58')]({'where':{'id':_0x4646b7[_0x534b('0x56')]['id']}})[_0x534b('0x1d')](handleEntityNotFound(_0x23318d,null))[_0x534b('0x1d')](saveUpdates(_0x4646b7['body'],null))[_0x534b('0x1d')](respondWithResult(_0x23318d,null))[_0x534b('0x54')](handleError(_0x23318d,null));};exports[_0x534b('0x34')]=function(_0x5c54b3,_0x33f9bd){return db[_0x534b('0x3a')][_0x534b('0x58')]({'where':{'id':_0x5c54b3[_0x534b('0x56')]['id']}})[_0x534b('0x1d')](handleEntityNotFound(_0x33f9bd,null))[_0x534b('0x1d')](removeEntity(_0x33f9bd,null))[_0x534b('0x54')](handleError(_0x33f9bd,null));};exports[_0x534b('0x5b')]=function(_0x2bee7e,_0xe36a68,_0x4bd0ca){var _0x3fc9a1={};var _0x145df8={};var _0x18df3e;var _0x271b6f;return db[_0x534b('0x3a')][_0x534b('0x5c')]({'where':{'id':_0x2bee7e[_0x534b('0x56')]['id']}})['then'](handleEntityNotFound(_0xe36a68,null))[_0x534b('0x1d')](function(_0xad2df3){if(_0xad2df3){_0x18df3e=_0xad2df3;_0x145df8[_0x534b('0x3f')]=_[_0x534b('0x41')](db[_0x534b('0x5d')][_0x534b('0x3b')]);_0x145df8['query']=_[_0x534b('0x41')](_0x2bee7e['query']);_0x145df8[_0x534b('0x4a')]=_[_0x534b('0x42')](_0x145df8[_0x534b('0x3f')],_0x145df8[_0x534b('0x40')]);_0x3fc9a1[_0x534b('0x43')]=_[_0x534b('0x42')](_0x145df8['model'],qs[_0x534b('0x57')](_0x2bee7e[_0x534b('0x40')]['fields']));_0x3fc9a1[_0x534b('0x43')]=_0x3fc9a1['attributes']['length']?_0x3fc9a1[_0x534b('0x43')]:_0x145df8['model'];_0x3fc9a1[_0x534b('0x47')]=qs[_0x534b('0x48')](_0x2bee7e[_0x534b('0x40')][_0x534b('0x48')]);_0x3fc9a1['where']=qs[_0x534b('0x4a')](_['pick'](_0x2bee7e[_0x534b('0x40')],_0x145df8[_0x534b('0x4a')]));if(_0x2bee7e[_0x534b('0x40')][_0x534b('0x4c')]){_0x3fc9a1[_0x534b('0x49')]=_[_0x534b('0x4d')](_0x3fc9a1['where'],{'$or':_[_0x534b('0x39')](_0x3fc9a1['attributes'],function(_0xf83a7){var _0x40ae8c={};_0x40ae8c[_0xf83a7]={'$like':'%'+_0x2bee7e['query'][_0x534b('0x4c')]+'%'};return _0x40ae8c;})});}_0x3fc9a1=_[_0x534b('0x4d')]({},_0x3fc9a1,_0x2bee7e['options']);return _0x18df3e['getFields'](_0x3fc9a1);}})[_0x534b('0x1d')](function(_0x5768e0){if(_0x5768e0){_0x271b6f=_0x5768e0[_0x534b('0x44')];if(!_0x2bee7e[_0x534b('0x40')][_0x534b('0x5e')](_0x534b('0x45'))){_0x3fc9a1['limit']=qs['limit'](_0x2bee7e[_0x534b('0x40')][_0x534b('0x46')]);_0x3fc9a1[_0x534b('0x2c')]=qs[_0x534b('0x2c')](_0x2bee7e['query'][_0x534b('0x2c')]);}return _0x18df3e[_0x534b('0x5b')](_0x3fc9a1);}})[_0x534b('0x1d')](function(_0x2a6027){if(_0x2a6027){return _0x2a6027?{'count':_0x271b6f,'rows':_0x2a6027}:null;}})['then'](respondWithResult(_0xe36a68,null))['catch'](handleError(_0xe36a68,null));};exports[_0x534b('0x5f')]=function(_0x2c4c33,_0x14610d,_0x58370e){var _0x1f503d={};var _0x543cf7={};var _0x2c0e87;var _0x18b418;return db[_0x534b('0x3a')][_0x534b('0x5c')]({'where':{'id':_0x2c4c33[_0x534b('0x56')]['id']}})[_0x534b('0x1d')](handleEntityNotFound(_0x14610d,null))[_0x534b('0x1d')](function(_0x20d98a){if(_0x20d98a){_0x2c0e87=_0x20d98a;_0x543cf7['model']=_[_0x534b('0x41')](db[_0x534b('0x5d')]['rawAttributes']);_0x543cf7[_0x534b('0x40')]=_[_0x534b('0x41')](_0x2c4c33[_0x534b('0x40')]);_0x543cf7[_0x534b('0x4a')]=_[_0x534b('0x42')](_0x543cf7['model'],_0x543cf7[_0x534b('0x40')]);_0x1f503d[_0x534b('0x43')]=_['intersection'](_0x543cf7[_0x534b('0x3f')],qs[_0x534b('0x57')](_0x2c4c33[_0x534b('0x40')][_0x534b('0x57')]));_0x1f503d['attributes']=_0x1f503d[_0x534b('0x43')][_0x534b('0x44')]?_0x1f503d['attributes']:_0x543cf7[_0x534b('0x3f')];_0x1f503d['order']=qs[_0x534b('0x48')](_0x2c4c33['query'][_0x534b('0x48')]);_0x1f503d['where']=qs[_0x534b('0x4a')](_[_0x534b('0x4b')](_0x2c4c33['query'],_0x543cf7['filters']));if(_0x2c4c33['query'][_0x534b('0x4c')]){_0x1f503d[_0x534b('0x49')]=_[_0x534b('0x4d')](_0x1f503d['where'],{'$or':_[_0x534b('0x39')](_0x1f503d[_0x534b('0x43')],function(_0x19c328){var _0x24ffa2={};_0x24ffa2[_0x19c328]={'$like':'%'+_0x2c4c33[_0x534b('0x40')]['filter']+'%'};return _0x24ffa2;})});}_0x1f503d=_[_0x534b('0x4d')]({},_0x1f503d,_0x2c4c33[_0x534b('0x4f')]);return _0x2c0e87[_0x534b('0x5f')](_0x1f503d);}})['then'](function(_0x59e1f4){if(_0x59e1f4){_0x18b418=_0x59e1f4['length'];if(!_0x2c4c33[_0x534b('0x40')][_0x534b('0x5e')](_0x534b('0x45'))){_0x1f503d['limit']=qs[_0x534b('0x46')](_0x2c4c33['query']['limit']);_0x1f503d[_0x534b('0x2c')]=qs['offset'](_0x2c4c33[_0x534b('0x40')][_0x534b('0x2c')]);}return _0x2c0e87[_0x534b('0x5f')](_0x1f503d);}})[_0x534b('0x1d')](function(_0x1b267d){if(_0x1b267d){return _0x1b267d?{'count':_0x18b418,'rows':_0x1b267d}:null;}})['then'](respondWithResult(_0x14610d,null))[_0x534b('0x54')](handleError(_0x14610d,null));};exports[_0x534b('0x60')]=function(_0x1e9c66,_0x3c8297,_0xa4325){var _0x18ee89={};var _0x49af61={};var _0x20f87a;var _0x3d4b71;return db[_0x534b('0x3a')][_0x534b('0x5c')]({'where':{'id':_0x1e9c66['params']['id']}})[_0x534b('0x1d')](handleEntityNotFound(_0x3c8297,null))[_0x534b('0x1d')](function(_0x7709e3){if(_0x7709e3){_0x20f87a=_0x7709e3;_0x49af61[_0x534b('0x3f')]=_[_0x534b('0x41')](db['SalesforceField'][_0x534b('0x3b')]);_0x49af61[_0x534b('0x40')]=_[_0x534b('0x41')](_0x1e9c66[_0x534b('0x40')]);_0x49af61[_0x534b('0x4a')]=_[_0x534b('0x42')](_0x49af61[_0x534b('0x3f')],_0x49af61[_0x534b('0x40')]);_0x18ee89[_0x534b('0x43')]=_[_0x534b('0x42')](_0x49af61['model'],qs[_0x534b('0x57')](_0x1e9c66[_0x534b('0x40')][_0x534b('0x57')]));_0x18ee89['attributes']=_0x18ee89['attributes'][_0x534b('0x44')]?_0x18ee89[_0x534b('0x43')]:_0x49af61[_0x534b('0x3f')];_0x18ee89[_0x534b('0x47')]=qs[_0x534b('0x48')](_0x1e9c66[_0x534b('0x40')][_0x534b('0x48')]);_0x18ee89[_0x534b('0x49')]=qs[_0x534b('0x4a')](_[_0x534b('0x4b')](_0x1e9c66[_0x534b('0x40')],_0x49af61[_0x534b('0x4a')]));if(_0x1e9c66[_0x534b('0x40')][_0x534b('0x4c')]){_0x18ee89[_0x534b('0x49')]=_['merge'](_0x18ee89['where'],{'$or':_[_0x534b('0x39')](_0x18ee89[_0x534b('0x43')],function(_0x4a2d89){var _0x2145f7={};_0x2145f7[_0x4a2d89]={'$like':'%'+_0x1e9c66[_0x534b('0x40')][_0x534b('0x4c')]+'%'};return _0x2145f7;})});}_0x18ee89=_[_0x534b('0x4d')]({},_0x18ee89,_0x1e9c66[_0x534b('0x4f')]);return _0x20f87a['getDescriptions'](_0x18ee89);}})[_0x534b('0x1d')](function(_0x367513){if(_0x367513){_0x3d4b71=_0x367513['length'];if(!_0x1e9c66['query']['hasOwnProperty'](_0x534b('0x45'))){_0x18ee89['limit']=qs['limit'](_0x1e9c66[_0x534b('0x40')][_0x534b('0x46')]);_0x18ee89[_0x534b('0x2c')]=qs[_0x534b('0x2c')](_0x1e9c66[_0x534b('0x40')]['offset']);}return _0x20f87a[_0x534b('0x60')](_0x18ee89);}})['then'](function(_0x4390cd){if(_0x4390cd){return _0x4390cd?{'count':_0x3d4b71,'rows':_0x4390cd}:null;}})[_0x534b('0x1d')](respondWithResult(_0x3c8297,null))['catch'](handleError(_0x3c8297,null));}; \ No newline at end of file +var _0x7641=['lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','reject','save','destroy','stack','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','length','include','find','create','update','body','params','getFields','findOne','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs'];(function(_0x4be2dd,_0x405a42){var _0x150a62=function(_0x21ab82){while(--_0x21ab82){_0x4be2dd['push'](_0x4be2dd['shift']());}};_0x150a62(++_0x405a42);}(_0x7641,0x1bb));var _0x1764=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7641[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x1764('0x0'));var emlformat=require(_0x1764('0x1'));var rimraf=require(_0x1764('0x2'));var zipdir=require(_0x1764('0x3'));var jsonpatch=require(_0x1764('0x4'));var rp=require(_0x1764('0x5'));var moment=require(_0x1764('0x6'));var BPromise=require(_0x1764('0x7'));var Mustache=require(_0x1764('0x8'));var util=require(_0x1764('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x1764('0xa'));var ejs=require(_0x1764('0xb'));var fs=require('fs');var _=require(_0x1764('0xc'));var squel=require('squel');var crypto=require(_0x1764('0xd'));var jsforce=require(_0x1764('0xe'));var deskjs=require(_0x1764('0xf'));var toCsv=require(_0x1764('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1764('0x10'));var authService=require(_0x1764('0x11'));var qs=require(_0x1764('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1764('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1764('0x14'));var db=require(_0x1764('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1764('0x16')][_0x1764('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3bb561,_0xaf5721,_0x800137){if(_0x800137){var _0x1020cf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1020cf[_0x1764('0x18')](_0xaf5721)){return _0x3bb561;}else{throw new db[(_0x1764('0x19'))]['ValidationError'](_0x1764('0x1a'));}}else{return _0x3bb561;}}function respondWithRpcPromise(_0xecbbcf,_0x307f35,_0x1f7608,_0x498d93){return new BPromise(function(_0xefabc,_0x305c1a){var _0x4d08ba=_0x498d93||client;return _0x4d08ba[_0x1764('0x1b')](_0xecbbcf,_0x1f7608)[_0x1764('0x1c')](function(_0x15ed7a){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x307f35,_0x1764('0x1d'));logger[_0x1764('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x307f35,_0x1764('0x1d'),JSON[_0x1764('0x1f')](_0x15ed7a));if(_0x15ed7a[_0x1764('0x20')]){if(_0x15ed7a[_0x1764('0x20')][_0x1764('0x21')]===0x1f4){logger[_0x1764('0x20')](_0x1764('0x22'),_0x307f35,_0x15ed7a[_0x1764('0x20')][_0x1764('0x23')]);return _0x305c1a(_0x15ed7a['error'][_0x1764('0x23')]);}logger[_0x1764('0x20')](_0x1764('0x22'),_0x307f35,_0x15ed7a[_0x1764('0x20')][_0x1764('0x23')]);return _0xefabc(_0x15ed7a[_0x1764('0x20')]['message']);}else{logger[_0x1764('0x24')](_0x1764('0x22'),_0x307f35,_0x1764('0x1d'));_0xefabc(_0x15ed7a[_0x1764('0x25')]['message']);}})[_0x1764('0x26')](function(_0x2b31fe){logger[_0x1764('0x20')](_0x1764('0x22'),_0x307f35,_0x2b31fe);_0x305c1a(_0x2b31fe);});});}function respondWithStatusCode(_0x314485,_0x8ee41e){_0x8ee41e=_0x8ee41e||0xcc;return function(_0x5cda25){if(_0x5cda25){return _0x314485[_0x1764('0x27')](_0x8ee41e);}return _0x314485[_0x1764('0x28')](_0x8ee41e)[_0x1764('0x29')]();};}function respondWithResult(_0x318b17,_0x1f2828){_0x1f2828=_0x1f2828||0xc8;return function(_0x40e62b){if(_0x40e62b){return _0x318b17[_0x1764('0x28')](_0x1f2828)[_0x1764('0x2a')](_0x40e62b);}};}function respondWithFilteredResult(_0x1bb32c,_0x38c454){return function(_0x49a25a){if(_0x49a25a){var _0x25eb44=_0x49a25a['count'],_0x289250=_0x38c454[_0x1764('0x2b')],_0x3c17f3=_0x38c454['offset']+_0x38c454[_0x1764('0x2c')],_0x5f416c;if(_0x3c17f3>=_0x25eb44){_0x3c17f3=_0x25eb44;_0x5f416c=0xc8;}else{_0x5f416c=0xce;}_0x1bb32c[_0x1764('0x28')](_0x5f416c);return _0x1bb32c[_0x1764('0x2d')]('Content-Range',_0x289250+'-'+_0x3c17f3+'/'+_0x25eb44)[_0x1764('0x2a')](_0x49a25a);}return null;};}function patchUpdates(_0x2a54ec){return function(_0x4544bf){try{jsonpatch['apply'](_0x4544bf,_0x2a54ec,!![]);}catch(_0x2f46fc){return BPromise[_0x1764('0x2e')](_0x2f46fc);}return _0x4544bf[_0x1764('0x2f')]();};}function saveUpdates(_0x2464ad,_0x319bb9){return function(_0x2c3929){if(_0x2c3929){return _0x2c3929['update'](_0x2464ad)[_0x1764('0x1c')](function(_0x26ef72){return _0x26ef72;});}return null;};}function removeEntity(_0x2e2153,_0x8a80c4){return function(_0x5c391b){if(_0x5c391b){return _0x5c391b[_0x1764('0x30')]()[_0x1764('0x1c')](function(){_0x2e2153[_0x1764('0x28')](0xcc)[_0x1764('0x29')]();});}};}function handleEntityNotFound(_0x14f45d,_0x243ce1){return function(_0x454666){if(!_0x454666){_0x14f45d[_0x1764('0x27')](0x194);}return _0x454666;};}function handleError(_0x14bd5a,_0x399b07){_0x399b07=_0x399b07||0x1f4;return function(_0x638971){logger[_0x1764('0x20')](_0x638971[_0x1764('0x31')]);if(_0x638971[_0x1764('0x32')]){delete _0x638971[_0x1764('0x32')];}_0x14bd5a[_0x1764('0x28')](_0x399b07)['send'](_0x638971);};}exports[_0x1764('0x33')]=function(_0x5d00ff,_0x314b36){var _0x2cea2e={},_0xb971c2={},_0x4c287a={'count':0x0,'rows':[]};var _0x140d24=_['map'](db[_0x1764('0x34')][_0x1764('0x35')],function(_0x341a27){return{'name':_0x341a27[_0x1764('0x36')],'type':_0x341a27[_0x1764('0x37')][_0x1764('0x38')]};});_0xb971c2[_0x1764('0x39')]=_[_0x1764('0x3a')](_0x140d24,'name');_0xb971c2[_0x1764('0x3b')]=_[_0x1764('0x3c')](_0x5d00ff[_0x1764('0x3b')]);_0xb971c2['filters']=_[_0x1764('0x3d')](_0xb971c2[_0x1764('0x39')],_0xb971c2[_0x1764('0x3b')]);_0x2cea2e[_0x1764('0x3e')]=_['intersection'](_0xb971c2[_0x1764('0x39')],qs['fields'](_0x5d00ff['query'][_0x1764('0x3f')]));_0x2cea2e[_0x1764('0x3e')]=_0x2cea2e[_0x1764('0x3e')]['length']?_0x2cea2e[_0x1764('0x3e')]:_0xb971c2[_0x1764('0x39')];if(!_0x5d00ff[_0x1764('0x3b')]['hasOwnProperty'](_0x1764('0x40'))){_0x2cea2e['limit']=qs['limit'](_0x5d00ff[_0x1764('0x3b')][_0x1764('0x2c')]);_0x2cea2e[_0x1764('0x2b')]=qs[_0x1764('0x2b')](_0x5d00ff[_0x1764('0x3b')][_0x1764('0x2b')]);}_0x2cea2e[_0x1764('0x41')]=qs[_0x1764('0x42')](_0x5d00ff[_0x1764('0x3b')]['sort']);_0x2cea2e['where']=qs[_0x1764('0x43')](_[_0x1764('0x44')](_0x5d00ff['query'],_0xb971c2[_0x1764('0x43')]));if(_0x5d00ff['query'][_0x1764('0x45')]){_0x2cea2e[_0x1764('0x46')]=_[_0x1764('0x47')](_0x2cea2e['where'],{'$or':_[_0x1764('0x3a')](_0x140d24,function(_0x165312){if(_0x165312['type']!==_0x1764('0x48')){var _0x231fca={};_0x231fca[_0x165312['name']]={'$like':'%'+_0x5d00ff[_0x1764('0x3b')][_0x1764('0x45')]+'%'};return _0x231fca;}})});}_0x2cea2e=_['merge']({},_0x2cea2e,_0x5d00ff[_0x1764('0x49')]);var _0xa153e7={'where':_0x2cea2e[_0x1764('0x46')]};return db[_0x1764('0x34')][_0x1764('0x4a')](_0xa153e7)['then'](function(_0x3572a2){_0x4c287a[_0x1764('0x4a')]=_0x3572a2;if(_0x5d00ff[_0x1764('0x3b')][_0x1764('0x4b')]){_0x2cea2e['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x1764('0x4c')](_0x2cea2e);})[_0x1764('0x1c')](function(_0x215cdd){_0x4c287a[_0x1764('0x4d')]=_0x215cdd;return _0x4c287a;})[_0x1764('0x1c')](respondWithFilteredResult(_0x314b36,_0x2cea2e))[_0x1764('0x26')](handleError(_0x314b36,null));};exports['show']=function(_0x16c2b0,_0x5240dc){var _0x4d4a3f={'raw':![],'where':{'id':_0x16c2b0['params']['id']}},_0x4b871f={};_0x4b871f[_0x1764('0x39')]=_[_0x1764('0x3c')](db[_0x1764('0x34')][_0x1764('0x35')]);_0x4b871f[_0x1764('0x3b')]=_[_0x1764('0x3c')](_0x16c2b0['query']);_0x4b871f[_0x1764('0x43')]=_[_0x1764('0x3d')](_0x4b871f[_0x1764('0x39')],_0x4b871f[_0x1764('0x3b')]);_0x4d4a3f['attributes']=_[_0x1764('0x3d')](_0x4b871f[_0x1764('0x39')],qs[_0x1764('0x3f')](_0x16c2b0['query'][_0x1764('0x3f')]));_0x4d4a3f[_0x1764('0x3e')]=_0x4d4a3f['attributes'][_0x1764('0x4e')]?_0x4d4a3f[_0x1764('0x3e')]:_0x4b871f[_0x1764('0x39')];if(_0x16c2b0['query'][_0x1764('0x4b')]){_0x4d4a3f[_0x1764('0x4f')]=[{'all':!![]}];}_0x4d4a3f=_['merge']({},_0x4d4a3f,_0x16c2b0[_0x1764('0x49')]);return db['SalesforceConfiguration'][_0x1764('0x50')](_0x4d4a3f)[_0x1764('0x1c')](handleEntityNotFound(_0x5240dc,null))[_0x1764('0x1c')](respondWithResult(_0x5240dc,null))[_0x1764('0x26')](handleError(_0x5240dc,null));};exports[_0x1764('0x51')]=function(_0x1c1cce,_0x4ec85e){return db['SalesforceConfiguration'][_0x1764('0x51')](_0x1c1cce['body'],{})[_0x1764('0x1c')](respondWithResult(_0x4ec85e,0xc9))['catch'](handleError(_0x4ec85e,null));};exports[_0x1764('0x52')]=function(_0x142f56,_0x1a22dc){if(_0x142f56[_0x1764('0x53')]['id']){delete _0x142f56[_0x1764('0x53')]['id'];}return db[_0x1764('0x34')][_0x1764('0x50')]({'where':{'id':_0x142f56[_0x1764('0x54')]['id']}})[_0x1764('0x1c')](handleEntityNotFound(_0x1a22dc,null))[_0x1764('0x1c')](saveUpdates(_0x142f56[_0x1764('0x53')],null))['then'](respondWithResult(_0x1a22dc,null))[_0x1764('0x26')](handleError(_0x1a22dc,null));};exports[_0x1764('0x30')]=function(_0x4f8f0e,_0x354704){return db[_0x1764('0x34')]['find']({'where':{'id':_0x4f8f0e['params']['id']}})['then'](handleEntityNotFound(_0x354704,null))[_0x1764('0x1c')](removeEntity(_0x354704,null))['catch'](handleError(_0x354704,null));};exports[_0x1764('0x55')]=function(_0x50ee3a,_0x4bfdd6,_0x128a69){var _0x45b781={};var _0x1cdcbb={};var _0x574b59;var _0x28a96a;return db[_0x1764('0x34')][_0x1764('0x56')]({'where':{'id':_0x50ee3a[_0x1764('0x54')]['id']}})[_0x1764('0x1c')](handleEntityNotFound(_0x4bfdd6,null))['then'](function(_0x572e9a){if(_0x572e9a){_0x574b59=_0x572e9a;_0x1cdcbb[_0x1764('0x39')]=_[_0x1764('0x3c')](db['SalesforceField']['rawAttributes']);_0x1cdcbb[_0x1764('0x3b')]=_[_0x1764('0x3c')](_0x50ee3a['query']);_0x1cdcbb[_0x1764('0x43')]=_[_0x1764('0x3d')](_0x1cdcbb[_0x1764('0x39')],_0x1cdcbb['query']);_0x45b781[_0x1764('0x3e')]=_[_0x1764('0x3d')](_0x1cdcbb['model'],qs['fields'](_0x50ee3a[_0x1764('0x3b')][_0x1764('0x3f')]));_0x45b781[_0x1764('0x3e')]=_0x45b781[_0x1764('0x3e')]['length']?_0x45b781[_0x1764('0x3e')]:_0x1cdcbb[_0x1764('0x39')];_0x45b781[_0x1764('0x41')]=qs[_0x1764('0x42')](_0x50ee3a[_0x1764('0x3b')][_0x1764('0x42')]);_0x45b781[_0x1764('0x46')]=qs[_0x1764('0x43')](_['pick'](_0x50ee3a[_0x1764('0x3b')],_0x1cdcbb['filters']));if(_0x50ee3a[_0x1764('0x3b')]['filter']){_0x45b781['where']=_[_0x1764('0x47')](_0x45b781[_0x1764('0x46')],{'$or':_[_0x1764('0x3a')](_0x45b781[_0x1764('0x3e')],function(_0x1f0d2e){var _0x52c1d0={};_0x52c1d0[_0x1f0d2e]={'$like':'%'+_0x50ee3a['query'][_0x1764('0x45')]+'%'};return _0x52c1d0;})});}_0x45b781=_[_0x1764('0x47')]({},_0x45b781,_0x50ee3a['options']);return _0x574b59[_0x1764('0x55')](_0x45b781);}})['then'](function(_0x1553d7){if(_0x1553d7){_0x28a96a=_0x1553d7[_0x1764('0x4e')];if(!_0x50ee3a[_0x1764('0x3b')][_0x1764('0x57')](_0x1764('0x40'))){_0x45b781['limit']=qs[_0x1764('0x2c')](_0x50ee3a['query'][_0x1764('0x2c')]);_0x45b781['offset']=qs[_0x1764('0x2b')](_0x50ee3a[_0x1764('0x3b')][_0x1764('0x2b')]);}return _0x574b59[_0x1764('0x55')](_0x45b781);}})['then'](function(_0x37d4fa){if(_0x37d4fa){return _0x37d4fa?{'count':_0x28a96a,'rows':_0x37d4fa}:null;}})['then'](respondWithResult(_0x4bfdd6,null))['catch'](handleError(_0x4bfdd6,null));};exports[_0x1764('0x58')]=function(_0x393cfc,_0x286ea8,_0x46dfc5){var _0x5987cf={};var _0x4430a4={};var _0x5ce294;var _0x5ddbc3;return db[_0x1764('0x34')][_0x1764('0x56')]({'where':{'id':_0x393cfc[_0x1764('0x54')]['id']}})[_0x1764('0x1c')](handleEntityNotFound(_0x286ea8,null))['then'](function(_0x2bb735){if(_0x2bb735){_0x5ce294=_0x2bb735;_0x4430a4['model']=_['keys'](db[_0x1764('0x59')][_0x1764('0x35')]);_0x4430a4[_0x1764('0x3b')]=_[_0x1764('0x3c')](_0x393cfc[_0x1764('0x3b')]);_0x4430a4['filters']=_[_0x1764('0x3d')](_0x4430a4['model'],_0x4430a4[_0x1764('0x3b')]);_0x5987cf['attributes']=_[_0x1764('0x3d')](_0x4430a4['model'],qs[_0x1764('0x3f')](_0x393cfc[_0x1764('0x3b')]['fields']));_0x5987cf['attributes']=_0x5987cf[_0x1764('0x3e')][_0x1764('0x4e')]?_0x5987cf[_0x1764('0x3e')]:_0x4430a4[_0x1764('0x39')];_0x5987cf[_0x1764('0x41')]=qs[_0x1764('0x42')](_0x393cfc[_0x1764('0x3b')]['sort']);_0x5987cf[_0x1764('0x46')]=qs[_0x1764('0x43')](_[_0x1764('0x44')](_0x393cfc[_0x1764('0x3b')],_0x4430a4[_0x1764('0x43')]));if(_0x393cfc[_0x1764('0x3b')]['filter']){_0x5987cf[_0x1764('0x46')]=_[_0x1764('0x47')](_0x5987cf['where'],{'$or':_['map'](_0x5987cf['attributes'],function(_0x1291ba){var _0x15ad9c={};_0x15ad9c[_0x1291ba]={'$like':'%'+_0x393cfc[_0x1764('0x3b')][_0x1764('0x45')]+'%'};return _0x15ad9c;})});}_0x5987cf=_[_0x1764('0x47')]({},_0x5987cf,_0x393cfc['options']);return _0x5ce294[_0x1764('0x58')](_0x5987cf);}})[_0x1764('0x1c')](function(_0x27dcd4){if(_0x27dcd4){_0x5ddbc3=_0x27dcd4[_0x1764('0x4e')];if(!_0x393cfc[_0x1764('0x3b')]['hasOwnProperty'](_0x1764('0x40'))){_0x5987cf[_0x1764('0x2c')]=qs[_0x1764('0x2c')](_0x393cfc['query']['limit']);_0x5987cf[_0x1764('0x2b')]=qs['offset'](_0x393cfc['query'][_0x1764('0x2b')]);}return _0x5ce294[_0x1764('0x58')](_0x5987cf);}})[_0x1764('0x1c')](function(_0x1db354){if(_0x1db354){return _0x1db354?{'count':_0x5ddbc3,'rows':_0x1db354}:null;}})[_0x1764('0x1c')](respondWithResult(_0x286ea8,null))[_0x1764('0x26')](handleError(_0x286ea8,null));};exports[_0x1764('0x5a')]=function(_0x4acf99,_0xf8def,_0x207f4f){var _0x34bf39={};var _0x3c849a={};var _0x4c107f;var _0x1aaf39;return db['SalesforceConfiguration'][_0x1764('0x56')]({'where':{'id':_0x4acf99[_0x1764('0x54')]['id']}})['then'](handleEntityNotFound(_0xf8def,null))[_0x1764('0x1c')](function(_0x47b6ec){if(_0x47b6ec){_0x4c107f=_0x47b6ec;_0x3c849a[_0x1764('0x39')]=_[_0x1764('0x3c')](db[_0x1764('0x59')][_0x1764('0x35')]);_0x3c849a[_0x1764('0x3b')]=_[_0x1764('0x3c')](_0x4acf99['query']);_0x3c849a['filters']=_[_0x1764('0x3d')](_0x3c849a[_0x1764('0x39')],_0x3c849a[_0x1764('0x3b')]);_0x34bf39[_0x1764('0x3e')]=_['intersection'](_0x3c849a[_0x1764('0x39')],qs[_0x1764('0x3f')](_0x4acf99['query']['fields']));_0x34bf39[_0x1764('0x3e')]=_0x34bf39[_0x1764('0x3e')][_0x1764('0x4e')]?_0x34bf39[_0x1764('0x3e')]:_0x3c849a[_0x1764('0x39')];_0x34bf39[_0x1764('0x41')]=qs[_0x1764('0x42')](_0x4acf99[_0x1764('0x3b')][_0x1764('0x42')]);_0x34bf39[_0x1764('0x46')]=qs[_0x1764('0x43')](_[_0x1764('0x44')](_0x4acf99[_0x1764('0x3b')],_0x3c849a[_0x1764('0x43')]));if(_0x4acf99[_0x1764('0x3b')][_0x1764('0x45')]){_0x34bf39[_0x1764('0x46')]=_[_0x1764('0x47')](_0x34bf39[_0x1764('0x46')],{'$or':_[_0x1764('0x3a')](_0x34bf39[_0x1764('0x3e')],function(_0x525de6){var _0x485fc6={};_0x485fc6[_0x525de6]={'$like':'%'+_0x4acf99[_0x1764('0x3b')][_0x1764('0x45')]+'%'};return _0x485fc6;})});}_0x34bf39=_[_0x1764('0x47')]({},_0x34bf39,_0x4acf99['options']);return _0x4c107f[_0x1764('0x5a')](_0x34bf39);}})['then'](function(_0x37a548){if(_0x37a548){_0x1aaf39=_0x37a548[_0x1764('0x4e')];if(!_0x4acf99[_0x1764('0x3b')][_0x1764('0x57')](_0x1764('0x40'))){_0x34bf39[_0x1764('0x2c')]=qs['limit'](_0x4acf99[_0x1764('0x3b')]['limit']);_0x34bf39[_0x1764('0x2b')]=qs[_0x1764('0x2b')](_0x4acf99['query'][_0x1764('0x2b')]);}return _0x4c107f[_0x1764('0x5a')](_0x34bf39);}})[_0x1764('0x1c')](function(_0x528562){if(_0x528562){return _0x528562?{'count':_0x1aaf39,'rows':_0x528562}:null;}})['then'](respondWithResult(_0xf8def,null))['catch'](handleError(_0xf8def,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index f004fa0..b5ab2d0 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 _0x5a5e=['bluebird','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','api','moment'];(function(_0x52410f,_0x57f9c8){var _0x6cb67a=function(_0x383391){while(--_0x383391){_0x52410f['push'](_0x52410f['shift']());}};_0x6cb67a(++_0x57f9c8);}(_0x5a5e,0x139));var _0xe5a5=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x5a5e[_0x52085a];return _0x5afc1a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe5a5('0x0'));var moment=require(_0xe5a5('0x1'));var BPromise=require(_0xe5a5('0x2'));var rp=require(_0xe5a5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5a5('0x4'));var config=require(_0xe5a5('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xe5a5('0x6')]=function(_0x5bbeea,_0x30b0bf){return _0x5bbeea[_0xe5a5('0x7')](_0xe5a5('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60d9=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2b392d,_0x4efd7f){var _0x494945=function(_0x3d27df){while(--_0x3d27df){_0x2b392d['push'](_0x2b392d['shift']());}};_0x494945(++_0x4efd7f);}(_0x60d9,0xb9));var _0x960d=function(_0x2583d1,_0x173961){_0x2583d1=_0x2583d1-0x0;var _0x19ea81=_0x60d9[_0x2583d1];return _0x19ea81;};'use strict';var _=require(_0x960d('0x0'));var util=require(_0x960d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x960d('0x2'));var BPromise=require(_0x960d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x960d('0x4'));var rimraf=require(_0x960d('0x5'));var config=require(_0x960d('0x6'));var attributes=require(_0x960d('0x7'));module[_0x960d('0x8')]=function(_0x1151cb,_0x40eb44){return _0x1151cb[_0x960d('0x9')](_0x960d('0xa'),attributes,{'tableName':_0x960d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index a19688c..e8d6554 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 _0xf9c8=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0xf9c8,0x8d));var _0x8f9c=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xf9c8[_0x919445];return _0x511b3e;};'use strict';var _=require(_0x8f9c('0x0'));var util=require(_0x8f9c('0x1'));var moment=require(_0x8f9c('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f9c('0x3'));var fs=require('fs');var Redis=require(_0x8f9c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f9c('0x5'));var logger=require(_0x8f9c('0x6'))(_0x8f9c('0x7'));var config=require(_0x8f9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8f9c('0x9')][_0x8f9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fa762,_0x1bfeb8,_0x389df1){return new BPromise(function(_0x34c397,_0x140770){return client['request'](_0x2fa762,_0x389df1)[_0x8f9c('0xb')](function(_0x5f1bef){logger[_0x8f9c('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1bfeb8,_0x8f9c('0xd'));logger[_0x8f9c('0xe')](_0x8f9c('0xf'),_0x1bfeb8,_0x8f9c('0xd'),JSON[_0x8f9c('0x10')](_0x5f1bef));if(_0x5f1bef[_0x8f9c('0x11')]){if(_0x5f1bef[_0x8f9c('0x11')][_0x8f9c('0x12')]===0x1f4){logger['error'](_0x8f9c('0x13'),_0x1bfeb8,_0x5f1bef['error'][_0x8f9c('0x14')]);return _0x140770(_0x5f1bef['error'][_0x8f9c('0x14')]);}logger[_0x8f9c('0x11')](_0x8f9c('0x13'),_0x1bfeb8,_0x5f1bef[_0x8f9c('0x11')][_0x8f9c('0x14')]);return _0x34c397(_0x5f1bef['error'][_0x8f9c('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x1bfeb8,_0x8f9c('0xd'));_0x34c397(_0x5f1bef[_0x8f9c('0x15')][_0x8f9c('0x14')]);}})['catch'](function(_0x276fb3){logger[_0x8f9c('0x11')](_0x8f9c('0x13'),_0x1bfeb8,_0x276fb3);_0x140770(_0x276fb3);});});} \ No newline at end of file +var _0xd532=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1ec0d3,_0x18a21e){var _0x5ec7c6=function(_0x35027d){while(--_0x35027d){_0x1ec0d3['push'](_0x1ec0d3['shift']());}};_0x5ec7c6(++_0x18a21e);}(_0xd532,0x140));var _0x2d53=function(_0x40cc64,_0x1c905f){_0x40cc64=_0x40cc64-0x0;var _0x2a6403=_0xd532[_0x40cc64];return _0x2a6403;};'use strict';var _=require(_0x2d53('0x0'));var util=require(_0x2d53('0x1'));var moment=require(_0x2d53('0x2'));var BPromise=require(_0x2d53('0x3'));var rs=require(_0x2d53('0x4'));var fs=require('fs');var Redis=require(_0x2d53('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d53('0x6'));var logger=require(_0x2d53('0x7'))(_0x2d53('0x8'));var config=require(_0x2d53('0x9'));var jayson=require(_0x2d53('0xa'));var client=jayson[_0x2d53('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fe946,_0x2bd580,_0x52d188){return new BPromise(function(_0x52c5e6,_0x571319){return client[_0x2d53('0xc')](_0x4fe946,_0x52d188)['then'](function(_0x32f87d){logger[_0x2d53('0xd')](_0x2d53('0xe'),_0x2bd580,_0x2d53('0xf'));logger[_0x2d53('0x10')](_0x2d53('0x11'),_0x2bd580,_0x2d53('0xf'),JSON[_0x2d53('0x12')](_0x32f87d));if(_0x32f87d[_0x2d53('0x13')]){if(_0x32f87d['error'][_0x2d53('0x14')]===0x1f4){logger[_0x2d53('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2bd580,_0x32f87d['error'][_0x2d53('0x15')]);return _0x571319(_0x32f87d[_0x2d53('0x13')][_0x2d53('0x15')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2bd580,_0x32f87d[_0x2d53('0x13')][_0x2d53('0x15')]);return _0x52c5e6(_0x32f87d['error'][_0x2d53('0x15')]);}else{logger[_0x2d53('0xd')](_0x2d53('0xe'),_0x2bd580,_0x2d53('0xf'));_0x52c5e6(_0x32f87d[_0x2d53('0x16')][_0x2d53('0x15')]);}})[_0x2d53('0x17')](function(_0x5cb95b){logger[_0x2d53('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2bd580,_0x5cb95b);_0x571319(_0x5cb95b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f9a8b9c..42b9910 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 _0x5d58=['../../components/auth/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','update','destroy','exports','Router'];(function(_0x506e59,_0x3a72ae){var _0x46a7af=function(_0x3bc27a){while(--_0x3bc27a){_0x506e59['push'](_0x506e59['shift']());}};_0x46a7af(++_0x3a72ae);}(_0x5d58,0x187));var _0x85d5=function(_0x14ba6b,_0x6a84e9){_0x14ba6b=_0x14ba6b-0x0;var _0x2827e8=_0x5d58[_0x14ba6b];return _0x2827e8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var auth=require(_0x85d5('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x85d5('0x2'));var controller=require(_0x85d5('0x3'));router['get']('/',auth[_0x85d5('0x4')](),controller[_0x85d5('0x5')]);router[_0x85d5('0x6')](_0x85d5('0x7'),auth['isAuthenticated'](),controller[_0x85d5('0x8')]);router[_0x85d5('0x9')]('/',auth['isAuthenticated'](),controller[_0x85d5('0xa')]);router['put'](_0x85d5('0x7'),auth[_0x85d5('0x4')](),controller[_0x85d5('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x85d5('0xc')]);module[_0x85d5('0xd')]=router; \ No newline at end of file +var _0xfdbd=['isAuthenticated','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','post'];(function(_0x26eca6,_0x4f2cfb){var _0x2fbf7e=function(_0x24b6e0){while(--_0x24b6e0){_0x26eca6['push'](_0x26eca6['shift']());}};_0x2fbf7e(++_0x4f2cfb);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1f6691,_0x3a3d46){_0x1f6691=_0x1f6691-0x0;var _0xf786b6=_0xfdbd[_0x1f6691];return _0xf786b6;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var auth=require(_0xdfdb('0x6'));var interaction=require(_0xdfdb('0x7'));var config=require(_0xdfdb('0x8'));var controller=require('./intSalesforceField.controller');router[_0xdfdb('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfdb('0xa')]);router[_0xdfdb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdfdb('0xb')]('/',auth[_0xdfdb('0xc')](),controller['create']);router[_0xdfdb('0xd')](_0xdfdb('0xe'),auth[_0xdfdb('0xc')](),controller[_0xdfdb('0xf')]);router[_0xdfdb('0x10')](_0xdfdb('0xe'),auth[_0xdfdb('0xc')](),controller['destroy']);module[_0xdfdb('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7407443..f921df9 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 _0xd54d=['ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x4fa359,_0x2b01ea){var _0x15ca2b=function(_0x43cb91){while(--_0x43cb91){_0x4fa359['push'](_0x4fa359['shift']());}};_0x15ca2b(++_0x2b01ea);}(_0xd54d,0xf7));var _0xdd54=function(_0x34e9b5,_0x2d1584){_0x34e9b5=_0x34e9b5-0x0;var _0xb5f1ec=_0xd54d[_0x34e9b5];return _0xb5f1ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xdd54('0x0'),_0xdd54('0x1'),_0xdd54('0x2')),'defaultValue':_0xdd54('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdd54('0x4')]},'keyType':{'type':Sequelize[_0xdd54('0x5')]('string',_0xdd54('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0xdd54('0x4')]},'idField':{'type':Sequelize[_0xdd54('0x4')]},'variableName':{'type':Sequelize[_0xdd54('0x4')]}}; \ No newline at end of file +var _0xe217=['sequelize','exports','string','variable','customVariable','STRING','ENUM'];(function(_0x5bbc72,_0xb66af7){var _0x48b5bd=function(_0x336d8e){while(--_0x336d8e){_0x5bbc72['push'](_0x5bbc72['shift']());}};_0x48b5bd(++_0xb66af7);}(_0xe217,0x165));var _0x7e21=function(_0x2f9142,_0x378cce){_0x2f9142=_0x2f9142-0x0;var _0x369173=_0xe217[_0x2f9142];return _0x369173;};'use strict';var Sequelize=require(_0x7e21('0x0'));module[_0x7e21('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7e21('0x2'),_0x7e21('0x3'),_0x7e21('0x4'),'keyValue'),'defaultValue':_0x7e21('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7e21('0x5')]},'keyType':{'type':Sequelize[_0x7e21('0x6')](_0x7e21('0x2'),_0x7e21('0x3'),_0x7e21('0x4'))},'keyContent':{'type':Sequelize[_0x7e21('0x5')]},'idField':{'type':Sequelize[_0x7e21('0x5')]},'variableName':{'type':Sequelize[_0x7e21('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 7f4c0da..257e856 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 _0xdb28=['json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status'];(function(_0x53361f,_0x3b2cb6){var _0x279237=function(_0x317757){while(--_0x317757){_0x53361f['push'](_0x53361f['shift']());}};_0x279237(++_0x3b2cb6);}(_0xdb28,0x106));var _0x8db2=function(_0x35a029,_0x1961b9){_0x35a029=_0x35a029-0x0;var _0x308505=_0xdb28[_0x35a029];return _0x308505;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]));if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['SalesforceField'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['SalesforceField'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));}; \ No newline at end of file +var _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x4eb6d0,_0x529f11){var _0xe481a4=function(_0x295890){while(--_0x295890){_0x4eb6d0['push'](_0x4eb6d0['shift']());}};_0xe481a4(++_0x529f11);}(_0x0b0e,0x187));var _0xe0b0=function(_0xdfc87d,_0x28e1a5){_0xdfc87d=_0xdfc87d-0x0;var _0x4e2a5e=_0x0b0e[_0xdfc87d];return _0x4e2a5e;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c4df768..fb92c57 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 _0x5bd0=['FieldId','lodash','../../config/logger','moment','path','rimraf','../../config/environment','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x5bd0,0x175));var _0x05bd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5bd0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x05bd('0x0'));var util=require('util');var logger=require(_0x05bd('0x1'))('api');var moment=require(_0x05bd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x05bd('0x3'));var rimraf=require(_0x05bd('0x4'));var config=require(_0x05bd('0x5'));var attributes=require('./intSalesforceField.attributes');module[_0x05bd('0x6')]=function(_0x366675,_0x5a55c4){return _0x366675['define'](_0x05bd('0x7'),attributes,{'tableName':_0x05bd('0x8'),'paranoid':![],'indexes':[{'name':_0x05bd('0x9'),'fields':[_0x05bd('0xa'),_0x05bd('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35aa=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path'];(function(_0x148b1a,_0x576583){var _0x626397=function(_0x121887){while(--_0x121887){_0x148b1a['push'](_0x148b1a['shift']());}};_0x626397(++_0x576583);}(_0x35aa,0xbe));var _0xa35a=function(_0x4dbc76,_0x9a8d25){_0x4dbc76=_0x4dbc76-0x0;var _0x3f3d8f=_0x35aa[_0x4dbc76];return _0x3f3d8f;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var logger=require(_0xa35a('0x1'))(_0xa35a('0x2'));var moment=require(_0xa35a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa35a('0x4'));var fs=require('fs');var path=require(_0xa35a('0x5'));var rimraf=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var attributes=require(_0xa35a('0x8'));module[_0xa35a('0x9')]=function(_0x449cfe,_0x10917d){return _0x449cfe['define'](_0xa35a('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xa35a('0xb'),'fields':[_0xa35a('0xc'),_0xa35a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 0edb4ec..864f265 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 _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x193905,_0x5a1269){var _0x56f7c1=function(_0x504eae){while(--_0x504eae){_0x193905['push'](_0x193905['shift']());}};_0x56f7c1(++_0x5a1269);}(_0x153f,0x15b));var _0xf153=function(_0x1602e1,_0x3dc719){_0x1602e1=_0x1602e1-0x0;var _0x985ec4=_0x153f[_0x1602e1];return _0x985ec4;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});} \ No newline at end of file +var _0x91a7=['message','SalesforceField,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x2a37db,_0x1e1049){var _0x3c655e=function(_0x1cba21){while(--_0x1cba21){_0x2a37db['push'](_0x2a37db['shift']());}};_0x3c655e(++_0x1e1049);}(_0x91a7,0xe7));var _0x791a=function(_0x3fae63,_0x204716){_0x3fae63=_0x3fae63-0x0;var _0x518420=_0x91a7[_0x3fae63];return _0x518420;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('SalesforceField,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('SalesforceField,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index c2ee0cf..0669de9 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 _0x1c5b=['/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x10bead,_0x192426){var _0x1f0a31=function(_0x73f138){while(--_0x73f138){_0x10bead['push'](_0x10bead['shift']());}};_0x1f0a31(++_0x192426);}(_0x1c5b,0x184));var _0xb1c5=function(_0x7cb429,_0x5c6964){_0x7cb429=_0x7cb429-0x0;var _0x3355de=_0x1c5b[_0x7cb429];return _0x3355de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb1c5('0x0'));var timeout=require(_0xb1c5('0x1'));var express=require(_0xb1c5('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb1c5('0x3'));var config=require('../../config/environment');var controller=require(_0xb1c5('0x4'));router[_0xb1c5('0x5')]('/',auth[_0xb1c5('0x6')](),controller[_0xb1c5('0x7')]);router['get'](_0xb1c5('0x8'),auth[_0xb1c5('0x6')](),controller[_0xb1c5('0x9')]);router[_0xb1c5('0x5')](_0xb1c5('0xa'),auth['isAuthenticated'](),controller[_0xb1c5('0xb')]);router['get'](_0xb1c5('0xc'),auth['isAuthenticated'](),controller[_0xb1c5('0xd')]);router[_0xb1c5('0xe')]('/',auth[_0xb1c5('0x6')](),controller['create']);router['post'](_0xb1c5('0xa'),auth['isAuthenticated'](),controller[_0xb1c5('0xf')]);router['put'](_0xb1c5('0x8'),auth[_0xb1c5('0x6')](),controller[_0xb1c5('0x10')]);router[_0xb1c5('0x11')](_0xb1c5('0x8'),auth[_0xb1c5('0x6')](),controller[_0xb1c5('0x12')]);module[_0xb1c5('0x13')]=router; \ No newline at end of file +var _0xf181=['/:id/configurations','/:id/fields','post','create','addConfiguration','put','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','/:id','get'];(function(_0x3dbcff,_0x532e31){var _0x12d4fd=function(_0xd72166){while(--_0xd72166){_0x3dbcff['push'](_0x3dbcff['shift']());}};_0x12d4fd(++_0x532e31);}(_0xf181,0x6c));var _0x1f18=function(_0x42304a,_0x14be94){_0x42304a=_0x42304a-0x0;var _0x159335=_0xf181[_0x42304a];return _0x159335;};'use strict';var multer=require(_0x1f18('0x0'));var util=require(_0x1f18('0x1'));var path=require(_0x1f18('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f18('0x3')]();var auth=require(_0x1f18('0x4'));var interaction=require(_0x1f18('0x5'));var config=require(_0x1f18('0x6'));var controller=require(_0x1f18('0x7'));router['get']('/',auth[_0x1f18('0x8')](),controller[_0x1f18('0x9')]);router['get'](_0x1f18('0xa'),auth[_0x1f18('0x8')](),controller['show']);router[_0x1f18('0xb')](_0x1f18('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1f18('0xb')](_0x1f18('0xd'),auth[_0x1f18('0x8')](),controller['getFields']);router[_0x1f18('0xe')]('/',auth[_0x1f18('0x8')](),controller[_0x1f18('0xf')]);router[_0x1f18('0xe')](_0x1f18('0xc'),auth['isAuthenticated'](),controller[_0x1f18('0x10')]);router[_0x1f18('0x11')](_0x1f18('0xa'),auth[_0x1f18('0x8')](),controller['update']);router[_0x1f18('0x12')](_0x1f18('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1f18('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index efa2b56..b8761a5 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 _0xe4c6=['STRING','sequelize','exports'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xe4c6,0x103));var _0x6e4c=function(_0x5e9e46,_0x111005){_0x5e9e46=_0x5e9e46-0x0;var _0x1b4c54=_0xe4c6[_0x5e9e46];return _0x1b4c54;};'use strict';var Sequelize=require(_0x6e4c('0x0'));module[_0x6e4c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e4c('0x2')]},'username':{'type':Sequelize[_0x6e4c('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6e4c('0x2')]},'email':{'type':Sequelize[_0x6e4c('0x2')]},'remoteUri':{'type':Sequelize[_0x6e4c('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6e4c('0x2')]}}; \ No newline at end of file +var _0x2c71=['username','remoteUri','STRING'];(function(_0x271cf2,_0x29a7e3){var _0x58a017=function(_0x40783e){while(--_0x40783e){_0x271cf2['push'](_0x271cf2['shift']());}};_0x58a017(++_0x29a7e3);}(_0x2c71,0x119));var _0x12c7=function(_0x2f0d37,_0x587fab){_0x2f0d37=_0x2f0d37-0x0;var _0x508da9=_0x2c71[_0x2f0d37];return _0x508da9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x12c7('0x0')]},'description':{'type':Sequelize[_0x12c7('0x0')]},'username':{'type':Sequelize[_0x12c7('0x0')],'unique':_0x12c7('0x1')},'password':{'type':Sequelize[_0x12c7('0x0')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x12c7('0x0')],'unique':_0x12c7('0x2')},'serverUrl':{'type':Sequelize[_0x12c7('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5edf724..2962693 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 _0xb571=['destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','create','body','update','find','getConfigurations','findOne','ServicenowConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowField','made_sla','hold_reason','knowledge','notify','incident_state','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','opened_by','sys_created_on','impact','work_notes_list','priority','sys_domain_path','time_worked','expected_start','business_duration','work_end','resolved_at','approval_set','subcategory','short_description','close_code','correlation_display','delivery_task','work_start','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','reassignment_count','assigned_to','sla_due','due_date','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','log','incident\x20table\x20objects','forEach','internalType','label','push','all','assign','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject'];(function(_0xac53d2,_0x121075){var _0x2e5759=function(_0x382b9e){while(--_0x382b9e){_0xac53d2['push'](_0xac53d2['shift']());}};_0x2e5759(++_0x121075);}(_0xb571,0x1e9));var _0x1b57=function(_0x4141f2,_0x3cd5a1){_0x4141f2=_0x4141f2-0x0;var _0x5e9f7f=_0xb571[_0x4141f2];return _0x5e9f7f;};'use strict';var pdf=require(_0x1b57('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1b57('0x1'));var zipdir=require(_0x1b57('0x2'));var jsonpatch=require(_0x1b57('0x3'));var rp=require(_0x1b57('0x4'));var moment=require(_0x1b57('0x5'));var BPromise=require(_0x1b57('0x6'));var Mustache=require(_0x1b57('0x7'));var util=require(_0x1b57('0x8'));var path=require(_0x1b57('0x9'));var sox=require(_0x1b57('0xa'));var csv=require(_0x1b57('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1b57('0xc'));var squel=require(_0x1b57('0xd'));var crypto=require('crypto');var jsforce=require(_0x1b57('0xe'));var deskjs=require(_0x1b57('0xf'));var toCsv=require(_0x1b57('0xb'));var querystring=require(_0x1b57('0x10'));var Papa=require(_0x1b57('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b57('0x12'));var as=require(_0x1b57('0x13'));var hardwareService=require(_0x1b57('0x14'));var logger=require(_0x1b57('0x15'))('api');var utils=require(_0x1b57('0x16'));var config=require('../../config/environment');var db=require(_0x1b57('0x17'))['db'];var integrations=require(_0x1b57('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x1b57('0x19')][_0x1b57('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2a1213,_0x57f49c,_0x1a1520){if(_0x1a1520){var _0x21b38b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21b38b[_0x1b57('0x1b')](_0x57f49c)){return _0x2a1213;}else{throw new db[(_0x1b57('0x1c'))][(_0x1b57('0x1d'))](_0x1b57('0x1e'));}}else{return _0x2a1213;}}function respondWithRpcPromise(_0x2f92e4,_0x4b0da8,_0x34ff16,_0x2be080){return new BPromise(function(_0x57979,_0x3b61bc){var _0x168695=_0x2be080||client;return _0x168695['request'](_0x2f92e4,_0x34ff16)[_0x1b57('0x1f')](function(_0x52a889){logger[_0x1b57('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x4b0da8,'request\x20sent');logger[_0x1b57('0x21')](_0x1b57('0x22'),_0x4b0da8,_0x1b57('0x23'),JSON[_0x1b57('0x24')](_0x52a889));if(_0x52a889[_0x1b57('0x25')]){if(_0x52a889['error'][_0x1b57('0x26')]===0x1f4){logger[_0x1b57('0x25')](_0x1b57('0x27'),_0x4b0da8,_0x52a889[_0x1b57('0x25')][_0x1b57('0x28')]);return _0x3b61bc(_0x52a889[_0x1b57('0x25')]['message']);}logger[_0x1b57('0x25')](_0x1b57('0x27'),_0x4b0da8,_0x52a889[_0x1b57('0x25')]['message']);return _0x57979(_0x52a889[_0x1b57('0x25')][_0x1b57('0x28')]);}else{logger['info'](_0x1b57('0x27'),_0x4b0da8,_0x1b57('0x23'));_0x57979(_0x52a889[_0x1b57('0x29')][_0x1b57('0x28')]);}})[_0x1b57('0x2a')](function(_0xe93b36){logger[_0x1b57('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x4b0da8,_0xe93b36);_0x3b61bc(_0xe93b36);});});}function respondWithStatusCode(_0x2cccf7,_0x16f1cb){_0x16f1cb=_0x16f1cb||0xcc;return function(_0x34fafe){if(_0x34fafe){return _0x2cccf7[_0x1b57('0x2b')](_0x16f1cb);}return _0x2cccf7[_0x1b57('0x2c')](_0x16f1cb)[_0x1b57('0x2d')]();};}function respondWithResult(_0x47aaa3,_0x4acce9){_0x4acce9=_0x4acce9||0xc8;return function(_0x352d1d){if(_0x352d1d){return _0x47aaa3[_0x1b57('0x2c')](_0x4acce9)[_0x1b57('0x2e')](_0x352d1d);}};}function respondWithFilteredResult(_0x30c852,_0x294138){return function(_0x3db6a8){if(_0x3db6a8){var _0x4b5f2c=_0x3db6a8['count'],_0x4d04a=_0x294138[_0x1b57('0x2f')],_0xccbe53=_0x294138[_0x1b57('0x2f')]+_0x294138[_0x1b57('0x30')],_0x151eea;if(_0xccbe53>=_0x4b5f2c){_0xccbe53=_0x4b5f2c;_0x151eea=0xc8;}else{_0x151eea=0xce;}_0x30c852[_0x1b57('0x2c')](_0x151eea);return _0x30c852['set'](_0x1b57('0x31'),_0x4d04a+'-'+_0xccbe53+'/'+_0x4b5f2c)['json'](_0x3db6a8);}return null;};}function patchUpdates(_0x5d6818){return function(_0x538894){try{jsonpatch['apply'](_0x538894,_0x5d6818,!![]);}catch(_0x259643){return BPromise[_0x1b57('0x32')](_0x259643);}return _0x538894['save']();};}function saveUpdates(_0x582e26,_0x2deb6){return function(_0x3a700c){if(_0x3a700c){return _0x3a700c['update'](_0x582e26)[_0x1b57('0x1f')](function(_0x2d6d8d){return _0x2d6d8d;});}return null;};}function removeEntity(_0x2bec16,_0x20830a){return function(_0x153d53){if(_0x153d53){return _0x153d53[_0x1b57('0x33')]()[_0x1b57('0x1f')](function(){_0x2bec16[_0x1b57('0x2c')](0xcc)[_0x1b57('0x2d')]();});}};}function handleEntityNotFound(_0x1a9ae1,_0x52900b){return function(_0x4c8eb9){if(!_0x4c8eb9){_0x1a9ae1['sendStatus'](0x194);}return _0x4c8eb9;};}function handleError(_0x45f6f4,_0x2df6e8){_0x2df6e8=_0x2df6e8||0x1f4;return function(_0xaf219){logger[_0x1b57('0x25')](_0xaf219[_0x1b57('0x34')]);if(_0xaf219[_0x1b57('0x35')]){delete _0xaf219['name'];}_0x45f6f4[_0x1b57('0x2c')](_0x2df6e8)[_0x1b57('0x36')](_0xaf219);};}exports[_0x1b57('0x37')]=function(_0x43b4ef,_0x5adc55){var _0x533a5f={},_0x5c8ad4={},_0x521f67={'count':0x0,'rows':[]};var _0x2a4030=_[_0x1b57('0x38')](db[_0x1b57('0x39')][_0x1b57('0x3a')],function(_0x330813){return{'name':_0x330813['fieldName'],'type':_0x330813[_0x1b57('0x3b')][_0x1b57('0x3c')]};});_0x5c8ad4[_0x1b57('0x3d')]=_[_0x1b57('0x38')](_0x2a4030,_0x1b57('0x35'));_0x5c8ad4[_0x1b57('0x3e')]=_[_0x1b57('0x3f')](_0x43b4ef[_0x1b57('0x3e')]);_0x5c8ad4[_0x1b57('0x40')]=_[_0x1b57('0x41')](_0x5c8ad4['model'],_0x5c8ad4['query']);_0x533a5f['attributes']=_['intersection'](_0x5c8ad4['model'],qs[_0x1b57('0x42')](_0x43b4ef['query'][_0x1b57('0x42')]));_0x533a5f[_0x1b57('0x43')]=_0x533a5f['attributes'][_0x1b57('0x44')]?_0x533a5f[_0x1b57('0x43')]:_0x5c8ad4[_0x1b57('0x3d')];if(!_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x45')](_0x1b57('0x46'))){_0x533a5f['limit']=qs[_0x1b57('0x30')](_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x30')]);_0x533a5f['offset']=qs[_0x1b57('0x2f')](_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x2f')]);}_0x533a5f[_0x1b57('0x47')]=qs[_0x1b57('0x48')](_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x48')]);_0x533a5f[_0x1b57('0x49')]=qs[_0x1b57('0x40')](_[_0x1b57('0x4a')](_0x43b4ef['query'],_0x5c8ad4['filters']));if(_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x4b')]){_0x533a5f['where']=_[_0x1b57('0x4c')](_0x533a5f[_0x1b57('0x49')],{'$or':_[_0x1b57('0x38')](_0x2a4030,function(_0x3a8d95){if(_0x3a8d95[_0x1b57('0x3b')]!==_0x1b57('0x4d')){var _0x10bcd1={};_0x10bcd1[_0x3a8d95[_0x1b57('0x35')]]={'$like':'%'+_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x4b')]+'%'};return _0x10bcd1;}})});}_0x533a5f=_['merge']({},_0x533a5f,_0x43b4ef[_0x1b57('0x4e')]);var _0x44ae51={'where':_0x533a5f['where']};return db[_0x1b57('0x39')][_0x1b57('0x4f')](_0x44ae51)[_0x1b57('0x1f')](function(_0xbe3a5f){_0x521f67[_0x1b57('0x4f')]=_0xbe3a5f;if(_0x43b4ef[_0x1b57('0x3e')][_0x1b57('0x50')]){_0x533a5f[_0x1b57('0x51')]=[{'all':!![]}];}return db[_0x1b57('0x39')][_0x1b57('0x52')](_0x533a5f);})['then'](function(_0xc75912){_0x521f67[_0x1b57('0x53')]=_0xc75912;return _0x521f67;})[_0x1b57('0x1f')](respondWithFilteredResult(_0x5adc55,_0x533a5f))[_0x1b57('0x2a')](handleError(_0x5adc55,null));};exports['show']=function(_0x8bd4d2,_0x4ce820){var _0xba2ab7={'raw':![],'where':{'id':_0x8bd4d2[_0x1b57('0x54')]['id']}},_0x279b79={};_0x279b79[_0x1b57('0x3d')]=_[_0x1b57('0x3f')](db[_0x1b57('0x39')][_0x1b57('0x3a')]);_0x279b79[_0x1b57('0x3e')]=_[_0x1b57('0x3f')](_0x8bd4d2[_0x1b57('0x3e')]);_0x279b79[_0x1b57('0x40')]=_[_0x1b57('0x41')](_0x279b79['model'],_0x279b79[_0x1b57('0x3e')]);_0xba2ab7[_0x1b57('0x43')]=_[_0x1b57('0x41')](_0x279b79['model'],qs[_0x1b57('0x42')](_0x8bd4d2[_0x1b57('0x3e')]['fields']));_0xba2ab7['attributes']=_0xba2ab7[_0x1b57('0x43')]['length']?_0xba2ab7[_0x1b57('0x43')]:_0x279b79[_0x1b57('0x3d')];if(_0x8bd4d2[_0x1b57('0x3e')]['includeAll']){_0xba2ab7[_0x1b57('0x51')]=[{'all':!![]}];}_0xba2ab7=_['merge']({},_0xba2ab7,_0x8bd4d2['options']);return db[_0x1b57('0x39')]['find'](_0xba2ab7)[_0x1b57('0x1f')](handleEntityNotFound(_0x4ce820,null))[_0x1b57('0x1f')](respondWithResult(_0x4ce820,null))['catch'](handleError(_0x4ce820,null));};exports['create']=function(_0x4693a5,_0x259bd6){return db[_0x1b57('0x39')][_0x1b57('0x55')](_0x4693a5[_0x1b57('0x56')],{})[_0x1b57('0x1f')](respondWithResult(_0x259bd6,0xc9))[_0x1b57('0x2a')](handleError(_0x259bd6,null));};exports[_0x1b57('0x57')]=function(_0x59adf1,_0x4be8b9){if(_0x59adf1[_0x1b57('0x56')]['id']){delete _0x59adf1[_0x1b57('0x56')]['id'];}return db['ServicenowAccount'][_0x1b57('0x58')]({'where':{'id':_0x59adf1['params']['id']}})['then'](handleEntityNotFound(_0x4be8b9,null))[_0x1b57('0x1f')](saveUpdates(_0x59adf1[_0x1b57('0x56')],null))[_0x1b57('0x1f')](respondWithResult(_0x4be8b9,null))['catch'](handleError(_0x4be8b9,null));};exports[_0x1b57('0x33')]=function(_0x25be48,_0x2657e9){return db[_0x1b57('0x39')]['find']({'where':{'id':_0x25be48[_0x1b57('0x54')]['id']}})[_0x1b57('0x1f')](handleEntityNotFound(_0x2657e9,null))['then'](removeEntity(_0x2657e9,null))[_0x1b57('0x2a')](handleError(_0x2657e9,null));};exports[_0x1b57('0x59')]=function(_0x4b8944,_0x8bf831,_0x4015e7){var _0xc90ba3={};var _0x9ef759={};var _0x21ae22;var _0x2f3d5a;return db[_0x1b57('0x39')][_0x1b57('0x5a')]({'where':{'id':_0x4b8944['params']['id']}})[_0x1b57('0x1f')](handleEntityNotFound(_0x8bf831,null))[_0x1b57('0x1f')](function(_0x31dcd8){if(_0x31dcd8){_0x21ae22=_0x31dcd8;_0x9ef759[_0x1b57('0x3d')]=_[_0x1b57('0x3f')](db[_0x1b57('0x5b')]['rawAttributes']);_0x9ef759[_0x1b57('0x3e')]=_[_0x1b57('0x3f')](_0x4b8944[_0x1b57('0x3e')]);_0x9ef759['filters']=_[_0x1b57('0x41')](_0x9ef759['model'],_0x9ef759[_0x1b57('0x3e')]);_0xc90ba3[_0x1b57('0x43')]=_[_0x1b57('0x41')](_0x9ef759[_0x1b57('0x3d')],qs[_0x1b57('0x42')](_0x4b8944[_0x1b57('0x3e')][_0x1b57('0x42')]));_0xc90ba3[_0x1b57('0x43')]=_0xc90ba3['attributes']['length']?_0xc90ba3[_0x1b57('0x43')]:_0x9ef759[_0x1b57('0x3d')];_0xc90ba3[_0x1b57('0x47')]=qs['sort'](_0x4b8944['query'][_0x1b57('0x48')]);_0xc90ba3['where']=qs[_0x1b57('0x40')](_[_0x1b57('0x4a')](_0x4b8944['query'],_0x9ef759['filters']));if(_0x4b8944[_0x1b57('0x3e')][_0x1b57('0x4b')]){_0xc90ba3[_0x1b57('0x49')]=_[_0x1b57('0x4c')](_0xc90ba3['where'],{'$or':_[_0x1b57('0x38')](_0xc90ba3[_0x1b57('0x43')],function(_0x15323d){var _0x5df2f6={};_0x5df2f6[_0x15323d]={'$like':'%'+_0x4b8944['query'][_0x1b57('0x4b')]+'%'};return _0x5df2f6;})});}_0xc90ba3=_['merge']({},_0xc90ba3,_0x4b8944[_0x1b57('0x4e')]);return _0x21ae22[_0x1b57('0x59')](_0xc90ba3);}})['then'](function(_0x443999){if(_0x443999){_0x2f3d5a=_0x443999[_0x1b57('0x44')];if(!_0x4b8944['query'][_0x1b57('0x45')](_0x1b57('0x46'))){_0xc90ba3[_0x1b57('0x30')]=qs['limit'](_0x4b8944['query']['limit']);_0xc90ba3[_0x1b57('0x2f')]=qs[_0x1b57('0x2f')](_0x4b8944[_0x1b57('0x3e')][_0x1b57('0x2f')]);}return _0x21ae22[_0x1b57('0x59')](_0xc90ba3);}})[_0x1b57('0x1f')](function(_0x2921a1){if(_0x2921a1){return _0x2921a1?{'count':_0x2f3d5a,'rows':_0x2921a1}:null;}})['then'](respondWithResult(_0x8bf831,null))[_0x1b57('0x2a')](handleError(_0x8bf831,null));};exports['addConfiguration']=function(_0x4454a2,_0xf343d1,_0x5d5f75){if(_0x4454a2[_0x1b57('0x56')]['id']){delete _0x4454a2[_0x1b57('0x56')]['id'];}return db[_0x1b57('0x39')][_0x1b57('0x5a')]({'where':{'id':_0x4454a2[_0x1b57('0x54')]['id']}})[_0x1b57('0x1f')](handleEntityNotFound(_0xf343d1,null))[_0x1b57('0x1f')](function(_0x182cac){if(_0x182cac){_0x4454a2['body']['AccountId']=_0x182cac['id'];_0x4454a2[_0x1b57('0x56')][_0x1b57('0x5c')]=integrations[_0x1b57('0x5d')](_0x4454a2['body'][_0x1b57('0x5e')],_0x4454a2['body'][_0x1b57('0x3b')]);_0x4454a2['body'][_0x1b57('0x5f')]=integrations['getDescriptions'](_0x4454a2[_0x1b57('0x56')][_0x1b57('0x5e')],_0x4454a2[_0x1b57('0x56')][_0x1b57('0x3b')]);return db['ServicenowConfiguration'][_0x1b57('0x55')](_0x4454a2[_0x1b57('0x56')],{'include':[{'model':db[_0x1b57('0x60')],'as':_0x1b57('0x5c')},{'model':db[_0x1b57('0x60')],'as':_0x1b57('0x5f')}]});}return null;})[_0x1b57('0x1f')](respondWithResult(_0xf343d1,null))[_0x1b57('0x2a')](handleError(_0xf343d1,null));};exports['getFields']=function(_0x344420,_0x4bdf65,_0x53d938){var _0x1a1c7e=[_0x1b57('0x61'),_0x1b57('0x62'),_0x1b57('0x63'),'subcategory','close_code',_0x1b57('0x64'),_0x1b57('0x65'),'severity',_0x1b57('0x66')];var _0x36b18e=[_0x1b57('0x67'),'made_sla',_0x1b57('0x68'),'watch_list',_0x1b57('0x69'),_0x1b57('0x6a'),_0x1b57('0x6b'),_0x1b57('0x62'),_0x1b57('0x6c'),'number',_0x1b57('0x6d'),'sys_updated_by',_0x1b57('0x6e'),'user_input',_0x1b57('0x6f'),'sys_domain','state','sys_created_by','knowledge',_0x1b57('0x47'),'calendar_stc','closed_at','cmdb_ci','delivery_plan',_0x1b57('0x70'),'active',_0x1b57('0x71'),'business_service',_0x1b57('0x72'),_0x1b57('0x73'),'rfc',_0x1b57('0x74'),_0x1b57('0x75'),'opened_at',_0x1b57('0x76'),'group_list',_0x1b57('0x77'),'reopened_time',_0x1b57('0x78'),'caller_id',_0x1b57('0x79'),_0x1b57('0x7a'),'work_notes',_0x1b57('0x7b'),_0x1b57('0x7c'),_0x1b57('0x7d'),_0x1b57('0x7e'),_0x1b57('0x7f'),'assignment_group','business_stc',_0x1b57('0x80'),_0x1b57('0x81'),'calendar_duration',_0x1b57('0x64'),_0x1b57('0x82'),_0x1b57('0x83'),_0x1b57('0x84'),_0x1b57('0x85'),_0x1b57('0x86'),_0x1b57('0x87'),'contact_type',_0x1b57('0x88'),_0x1b57('0x65'),'urgency',_0x1b57('0x89'),_0x1b57('0x8a'),_0x1b57('0x8b'),'activity_due',_0x1b57('0x8c'),'severity','comments',_0x1b57('0x8d'),'approval','comments_and_work_notes',_0x1b57('0x8e'),'sys_mod_count','reopen_count',_0x1b57('0x8f'),_0x1b57('0x90'),_0x1b57('0x91'),_0x1b57('0x92'),_0x1b57('0x93'),_0x1b57('0x66')];var _0xaca91d='';var _0x4ebe19='';var _0x1c5d64=[];var _0x31a6b6='';var _0x4c727c='';var _0x5a1543=[];var _0xd67637='';var _0x5ed4af='';var _0x112a88={};var _0x13842b='';return db[_0x1b57('0x39')]['findOne']({'where':{'id':_0x344420[_0x1b57('0x54')]['id']},'attributes':['id',_0x1b57('0x94'),_0x1b57('0x95'),_0x1b57('0x96'),_0x1b57('0x97'),_0x1b57('0x98')]})[_0x1b57('0x1f')](handleEntityNotFound(_0x4bdf65,null))['then'](function(_0x685890){if(_0x685890){_0x13842b=_0x685890['remoteUri'];var _0x57f4ab=_0x13842b[_0x1b57('0x99')](-0x1);if(_0x57f4ab==='/'){_0x13842b=_0x13842b[_0x1b57('0x9a')](0x0,_0x13842b[_0x1b57('0x9b')](_0x57f4ab));}_0x5ed4af=util[_0x1b57('0x9c')](_0x1b57('0x9d'),_0x13842b);_0xd67637=util[_0x1b57('0x9c')](_0x1b57('0x9e'),_0x13842b);_0x112a88={'user':_0x685890['username'],'pass':_0x685890[_0x1b57('0x95')]};var _0x56ad03={'method':_0x1b57('0x9f'),'uri':_0x5ed4af+'incident?sysparm_display_value=all','auth':_0x112a88,'json':!![]};return rp(_0x56ad03);}})[_0x1b57('0x1f')](function(_0x2619e7){if(_0x2619e7[_0x1b57('0x29')]['length']>0x0){_0xaca91d=_0x2619e7[_0x1b57('0x29')];}console[_0x1b57('0xa0')](_0x1b57('0xa1'),_0xaca91d);_0x5a1543=[];_0x4ebe19=Object['assign']([],_0xaca91d);_['remove'](_0x4ebe19,function(_0x322eb8){return!_0x1a1c7e['includes'](_0x322eb8[_0x1b57('0x35')]);});_0x4ebe19[_0x1b57('0xa2')](function(_0x1afe42){var _0x10065d=createFieldObject(_0xd67637,_0x112a88,_0x1afe42[_0x1b57('0xa3')],_0x1afe42['name'],_0x1afe42[_0x1b57('0xa4')],![]);_0x5a1543[_0x1b57('0xa5')](_0x10065d);});return Promise[_0x1b57('0xa6')](_0x5a1543);})['then'](function(_0x43518d){_0x1c5d64=_0x43518d;_0x31a6b6=Object[_0x1b57('0xa7')]([],_0xaca91d);console[_0x1b57('0xa0')](_0x1b57('0xa8'),_0xaca91d);_[_0x1b57('0xa9')](_0x31a6b6,function(_0x32e507){return _0x36b18e[_0x1b57('0xaa')](_0x32e507[_0x1b57('0x35')]);});console[_0x1b57('0xa0')](_0x1b57('0xab'),_0x31a6b6);_0x5a1543=[];_0x31a6b6[_0x1b57('0xa2')](function(_0x5f2651){var _0x3de47a=createFieldObject(_0xd67637,_0x112a88,_0x5f2651[_0x1b57('0xa3')],_0x5f2651[_0x1b57('0x35')],_0x5f2651[_0x1b57('0xa4')],!![]);_0x5a1543[_0x1b57('0xa5')](_0x3de47a);});return Promise[_0x1b57('0xa6')](_0x5a1543);})[_0x1b57('0x1f')](function(_0x12655b){_0x4c727c=_0x12655b;var _0x51136e=_0x1c5d64['concat'](_0x4c727c);return{'count':_0x51136e[_0x1b57('0x44')],'rows':_0x51136e};})['then'](respondWithResult(_0x4bdf65,null))['catch'](function(_0x2002ce){console[_0x1b57('0xa0')](_0x1b57('0xac')+_0x2002ce);var _0x44e52e=_0x344420['query'][_0x1b57('0x1b')]?0x1f4:_0x2002ce[_0x1b57('0xad')]||0x1f4;logger[_0x1b57('0x25')](_0x2002ce['stack']);delete _0x2002ce[_0x1b57('0x35')];if(_0x44e52e===0x191){_0x44e52e=0x190;}_0x4bdf65['status'](_0x44e52e)[_0x1b57('0x36')](_0x344420[_0x1b57('0x3e')][_0x1b57('0x1b')]?{'message':_0x1b57('0xae'),'statusCode':_0x2002ce['statusCode']}:_0x2002ce);});};function createFieldObject(_0xfd6ce7,_0x2ba364,_0x321577,_0x629b19,_0x3157a6,_0x41877e){return new Promise(function(_0x36e27c,_0x18ea7c){var _0x4c346c={'id':_0x629b19,'name':_0x3157a6,'custom':_0x41877e};if(_0x321577==='boolean'){_0x4c346c[_0x1b57('0x4e')]=[{'name':_0x1b57('0xaf'),'value':_0x1b57('0xb0')},{'name':_0x1b57('0xb1'),'value':_0x1b57('0xb2')}];_0x36e27c(_0x4c346c);}else{var _0x3272a6={'method':_0x1b57('0x9f'),'uri':_0xfd6ce7+_0x1b57('0xb3')+_0x629b19,'auth':_0x2ba364,'json':!![]};return rp(_0x3272a6)[_0x1b57('0x1f')](function(_0x607e9a){var _0x47e657=[];if(_0x607e9a[_0x1b57('0x29')]['length']>0x0){_0x607e9a[_0x1b57('0x29')]['forEach'](function(_0x122d86){if(_0x122d86['inactive']==='false'){var _0x5559a3={'name':_0x122d86['label'],'value':_0x122d86['value']};_0x47e657['push'](_0x5559a3);}});}_0x4c346c['options']=_0x47e657;if(_0x4c346c['options'][_0x1b57('0x44')]>0x0){_0x36e27c(_0x4c346c);}else{if(_0x41877e==![]){_0x36e27c();}else{_0x36e27c(_0x4c346c);}}});}});} \ No newline at end of file +var _0xa74d=['show','include','find','create','body','update','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','location','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','forEach','internalType','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','push','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','count','offset','Content-Range','json','apply','reject','save','destroy','sendStatus','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','findAll','rows'];(function(_0x5737f3,_0x500566){var _0x1cd571=function(_0x4d6be5){while(--_0x4d6be5){_0x5737f3['push'](_0x5737f3['shift']());}};_0x1cd571(++_0x500566);}(_0xa74d,0x74));var _0xda74=function(_0x28d038,_0x225ecf){_0x28d038=_0x28d038-0x0;var _0x5e46b2=_0xa74d[_0x28d038];return _0x5e46b2;};'use strict';var pdf=require(_0xda74('0x0'));var emlformat=require(_0xda74('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xda74('0x2'));var rp=require(_0xda74('0x3'));var moment=require(_0xda74('0x4'));var BPromise=require(_0xda74('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xda74('0x6'));var sox=require(_0xda74('0x7'));var csv=require(_0xda74('0x8'));var ejs=require(_0xda74('0x9'));var fs=require('fs');var _=require(_0xda74('0xa'));var squel=require(_0xda74('0xb'));var crypto=require(_0xda74('0xc'));var jsforce=require(_0xda74('0xd'));var deskjs=require(_0xda74('0xe'));var toCsv=require(_0xda74('0x8'));var querystring=require(_0xda74('0xf'));var Papa=require(_0xda74('0x10'));var Redis=require(_0xda74('0x11'));var authService=require(_0xda74('0x12'));var qs=require(_0xda74('0x13'));var as=require(_0xda74('0x14'));var hardwareService=require(_0xda74('0x15'));var logger=require(_0xda74('0x16'))(_0xda74('0x17'));var utils=require(_0xda74('0x18'));var config=require(_0xda74('0x19'));var db=require(_0xda74('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xda74('0x1b')][_0xda74('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x924b8b,_0x32415d,_0x108479){if(_0x108479){var _0x14081b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14081b[_0xda74('0x1d')](_0x32415d)){return _0x924b8b;}else{throw new db[(_0xda74('0x1e'))][(_0xda74('0x1f'))](_0xda74('0x20'));}}else{return _0x924b8b;}}function respondWithRpcPromise(_0x23c64b,_0x506fcd,_0x1d70e8,_0x17a731){return new BPromise(function(_0x588769,_0x670f8e){var _0x509e04=_0x17a731||client;return _0x509e04[_0xda74('0x21')](_0x23c64b,_0x1d70e8)['then'](function(_0x4e3bb8){logger[_0xda74('0x22')](_0xda74('0x23'),_0x506fcd,_0xda74('0x24'));logger[_0xda74('0x25')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x506fcd,_0xda74('0x24'),JSON[_0xda74('0x26')](_0x4e3bb8));if(_0x4e3bb8['error']){if(_0x4e3bb8[_0xda74('0x27')][_0xda74('0x28')]===0x1f4){logger[_0xda74('0x27')](_0xda74('0x23'),_0x506fcd,_0x4e3bb8['error']['message']);return _0x670f8e(_0x4e3bb8[_0xda74('0x27')]['message']);}logger[_0xda74('0x27')](_0xda74('0x23'),_0x506fcd,_0x4e3bb8[_0xda74('0x27')][_0xda74('0x29')]);return _0x588769(_0x4e3bb8[_0xda74('0x27')][_0xda74('0x29')]);}else{logger[_0xda74('0x22')](_0xda74('0x23'),_0x506fcd,'request\x20sent');_0x588769(_0x4e3bb8[_0xda74('0x2a')][_0xda74('0x29')]);}})[_0xda74('0x2b')](function(_0x59fada){logger['error'](_0xda74('0x23'),_0x506fcd,_0x59fada);_0x670f8e(_0x59fada);});});}function respondWithStatusCode(_0x28d7c6,_0xb8fd57){_0xb8fd57=_0xb8fd57||0xcc;return function(_0x3eea71){if(_0x3eea71){return _0x28d7c6['sendStatus'](_0xb8fd57);}return _0x28d7c6[_0xda74('0x2c')](_0xb8fd57)[_0xda74('0x2d')]();};}function respondWithResult(_0x1a7885,_0x4a13f8){_0x4a13f8=_0x4a13f8||0xc8;return function(_0x28dc8e){if(_0x28dc8e){return _0x1a7885[_0xda74('0x2c')](_0x4a13f8)['json'](_0x28dc8e);}};}function respondWithFilteredResult(_0x34a51b,_0x1114a4){return function(_0x581b3c){if(_0x581b3c){var _0x18c06e=_0x581b3c[_0xda74('0x2e')],_0x5ac2a9=_0x1114a4[_0xda74('0x2f')],_0x5b432=_0x1114a4[_0xda74('0x2f')]+_0x1114a4['limit'],_0x2fe95d;if(_0x5b432>=_0x18c06e){_0x5b432=_0x18c06e;_0x2fe95d=0xc8;}else{_0x2fe95d=0xce;}_0x34a51b[_0xda74('0x2c')](_0x2fe95d);return _0x34a51b['set'](_0xda74('0x30'),_0x5ac2a9+'-'+_0x5b432+'/'+_0x18c06e)[_0xda74('0x31')](_0x581b3c);}return null;};}function patchUpdates(_0x29bd01){return function(_0x5bf9fb){try{jsonpatch[_0xda74('0x32')](_0x5bf9fb,_0x29bd01,!![]);}catch(_0x491715){return BPromise[_0xda74('0x33')](_0x491715);}return _0x5bf9fb[_0xda74('0x34')]();};}function saveUpdates(_0x48cf30,_0x24145a){return function(_0x57b550){if(_0x57b550){return _0x57b550['update'](_0x48cf30)['then'](function(_0x2932b7){return _0x2932b7;});}return null;};}function removeEntity(_0x4834b8,_0x22d76a){return function(_0x269f0f){if(_0x269f0f){return _0x269f0f[_0xda74('0x35')]()['then'](function(){_0x4834b8[_0xda74('0x2c')](0xcc)[_0xda74('0x2d')]();});}};}function handleEntityNotFound(_0x48a04c,_0x425a7c){return function(_0x13cf26){if(!_0x13cf26){_0x48a04c[_0xda74('0x36')](0x194);}return _0x13cf26;};}function handleError(_0x358310,_0x369e73){_0x369e73=_0x369e73||0x1f4;return function(_0x1e4412){logger['error'](_0x1e4412[_0xda74('0x37')]);if(_0x1e4412['name']){delete _0x1e4412[_0xda74('0x38')];}_0x358310[_0xda74('0x2c')](_0x369e73)[_0xda74('0x39')](_0x1e4412);};}exports[_0xda74('0x3a')]=function(_0x21bb56,_0x25547c){var _0x1ea6ea={},_0x16b230={},_0x15d7b8={'count':0x0,'rows':[]};var _0x5211d4=_['map'](db[_0xda74('0x3b')][_0xda74('0x3c')],function(_0x8468fd){return{'name':_0x8468fd[_0xda74('0x3d')],'type':_0x8468fd[_0xda74('0x3e')][_0xda74('0x3f')]};});_0x16b230[_0xda74('0x40')]=_[_0xda74('0x41')](_0x5211d4,_0xda74('0x38'));_0x16b230[_0xda74('0x42')]=_[_0xda74('0x43')](_0x21bb56[_0xda74('0x42')]);_0x16b230['filters']=_['intersection'](_0x16b230[_0xda74('0x40')],_0x16b230[_0xda74('0x42')]);_0x1ea6ea[_0xda74('0x44')]=_[_0xda74('0x45')](_0x16b230['model'],qs[_0xda74('0x46')](_0x21bb56[_0xda74('0x42')][_0xda74('0x46')]));_0x1ea6ea['attributes']=_0x1ea6ea[_0xda74('0x44')][_0xda74('0x47')]?_0x1ea6ea['attributes']:_0x16b230[_0xda74('0x40')];if(!_0x21bb56[_0xda74('0x42')][_0xda74('0x48')]('nolimit')){_0x1ea6ea['limit']=qs['limit'](_0x21bb56[_0xda74('0x42')][_0xda74('0x49')]);_0x1ea6ea[_0xda74('0x2f')]=qs[_0xda74('0x2f')](_0x21bb56['query'][_0xda74('0x2f')]);}_0x1ea6ea[_0xda74('0x4a')]=qs[_0xda74('0x4b')](_0x21bb56[_0xda74('0x42')]['sort']);_0x1ea6ea['where']=qs[_0xda74('0x4c')](_[_0xda74('0x4d')](_0x21bb56[_0xda74('0x42')],_0x16b230[_0xda74('0x4c')]));if(_0x21bb56[_0xda74('0x42')][_0xda74('0x4e')]){_0x1ea6ea[_0xda74('0x4f')]=_[_0xda74('0x50')](_0x1ea6ea['where'],{'$or':_[_0xda74('0x41')](_0x5211d4,function(_0x2b5aa5){if(_0x2b5aa5['type']!==_0xda74('0x51')){var _0x148196={};_0x148196[_0x2b5aa5[_0xda74('0x38')]]={'$like':'%'+_0x21bb56[_0xda74('0x42')][_0xda74('0x4e')]+'%'};return _0x148196;}})});}_0x1ea6ea=_[_0xda74('0x50')]({},_0x1ea6ea,_0x21bb56[_0xda74('0x52')]);var _0x5d17e9={'where':_0x1ea6ea[_0xda74('0x4f')]};return db[_0xda74('0x3b')][_0xda74('0x2e')](_0x5d17e9)[_0xda74('0x53')](function(_0x55c5b5){_0x15d7b8[_0xda74('0x2e')]=_0x55c5b5;if(_0x21bb56['query']['includeAll']){_0x1ea6ea['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xda74('0x54')](_0x1ea6ea);})[_0xda74('0x53')](function(_0x3a276e){_0x15d7b8[_0xda74('0x55')]=_0x3a276e;return _0x15d7b8;})[_0xda74('0x53')](respondWithFilteredResult(_0x25547c,_0x1ea6ea))['catch'](handleError(_0x25547c,null));};exports[_0xda74('0x56')]=function(_0x161ceb,_0x4e89ac){var _0x144914={'raw':![],'where':{'id':_0x161ceb['params']['id']}},_0x566aff={};_0x566aff['model']=_[_0xda74('0x43')](db[_0xda74('0x3b')][_0xda74('0x3c')]);_0x566aff[_0xda74('0x42')]=_[_0xda74('0x43')](_0x161ceb[_0xda74('0x42')]);_0x566aff[_0xda74('0x4c')]=_[_0xda74('0x45')](_0x566aff[_0xda74('0x40')],_0x566aff['query']);_0x144914[_0xda74('0x44')]=_[_0xda74('0x45')](_0x566aff[_0xda74('0x40')],qs[_0xda74('0x46')](_0x161ceb[_0xda74('0x42')]['fields']));_0x144914[_0xda74('0x44')]=_0x144914[_0xda74('0x44')]['length']?_0x144914[_0xda74('0x44')]:_0x566aff['model'];if(_0x161ceb[_0xda74('0x42')]['includeAll']){_0x144914[_0xda74('0x57')]=[{'all':!![]}];}_0x144914=_[_0xda74('0x50')]({},_0x144914,_0x161ceb[_0xda74('0x52')]);return db[_0xda74('0x3b')][_0xda74('0x58')](_0x144914)['then'](handleEntityNotFound(_0x4e89ac,null))[_0xda74('0x53')](respondWithResult(_0x4e89ac,null))[_0xda74('0x2b')](handleError(_0x4e89ac,null));};exports[_0xda74('0x59')]=function(_0x345a87,_0x1f553f){return db[_0xda74('0x3b')]['create'](_0x345a87[_0xda74('0x5a')],{})[_0xda74('0x53')](respondWithResult(_0x1f553f,0xc9))['catch'](handleError(_0x1f553f,null));};exports[_0xda74('0x5b')]=function(_0x4fef2b,_0x33722d){if(_0x4fef2b[_0xda74('0x5a')]['id']){delete _0x4fef2b[_0xda74('0x5a')]['id'];}return db[_0xda74('0x3b')][_0xda74('0x58')]({'where':{'id':_0x4fef2b['params']['id']}})[_0xda74('0x53')](handleEntityNotFound(_0x33722d,null))[_0xda74('0x53')](saveUpdates(_0x4fef2b['body'],null))[_0xda74('0x53')](respondWithResult(_0x33722d,null))['catch'](handleError(_0x33722d,null));};exports[_0xda74('0x35')]=function(_0xbe615f,_0x17fb83){return db['ServicenowAccount'][_0xda74('0x58')]({'where':{'id':_0xbe615f[_0xda74('0x5c')]['id']}})[_0xda74('0x53')](handleEntityNotFound(_0x17fb83,null))['then'](removeEntity(_0x17fb83,null))[_0xda74('0x2b')](handleError(_0x17fb83,null));};exports[_0xda74('0x5d')]=function(_0x12354e,_0x4393af,_0x1d5fa6){var _0x3e543a={};var _0x2cf0b8={};var _0x27a199;var _0x3aa8d4;return db[_0xda74('0x3b')][_0xda74('0x5e')]({'where':{'id':_0x12354e['params']['id']}})[_0xda74('0x53')](handleEntityNotFound(_0x4393af,null))[_0xda74('0x53')](function(_0xfd0f2f){if(_0xfd0f2f){_0x27a199=_0xfd0f2f;_0x2cf0b8['model']=_[_0xda74('0x43')](db[_0xda74('0x5f')][_0xda74('0x3c')]);_0x2cf0b8[_0xda74('0x42')]=_[_0xda74('0x43')](_0x12354e[_0xda74('0x42')]);_0x2cf0b8[_0xda74('0x4c')]=_['intersection'](_0x2cf0b8[_0xda74('0x40')],_0x2cf0b8[_0xda74('0x42')]);_0x3e543a['attributes']=_[_0xda74('0x45')](_0x2cf0b8[_0xda74('0x40')],qs['fields'](_0x12354e[_0xda74('0x42')]['fields']));_0x3e543a[_0xda74('0x44')]=_0x3e543a['attributes'][_0xda74('0x47')]?_0x3e543a[_0xda74('0x44')]:_0x2cf0b8[_0xda74('0x40')];_0x3e543a[_0xda74('0x4a')]=qs[_0xda74('0x4b')](_0x12354e[_0xda74('0x42')]['sort']);_0x3e543a[_0xda74('0x4f')]=qs[_0xda74('0x4c')](_[_0xda74('0x4d')](_0x12354e[_0xda74('0x42')],_0x2cf0b8['filters']));if(_0x12354e['query']['filter']){_0x3e543a[_0xda74('0x4f')]=_['merge'](_0x3e543a['where'],{'$or':_['map'](_0x3e543a[_0xda74('0x44')],function(_0x500ee5){var _0x4be657={};_0x4be657[_0x500ee5]={'$like':'%'+_0x12354e[_0xda74('0x42')][_0xda74('0x4e')]+'%'};return _0x4be657;})});}_0x3e543a=_[_0xda74('0x50')]({},_0x3e543a,_0x12354e[_0xda74('0x52')]);return _0x27a199[_0xda74('0x5d')](_0x3e543a);}})[_0xda74('0x53')](function(_0x27752c){if(_0x27752c){_0x3aa8d4=_0x27752c[_0xda74('0x47')];if(!_0x12354e[_0xda74('0x42')][_0xda74('0x48')]('nolimit')){_0x3e543a[_0xda74('0x49')]=qs[_0xda74('0x49')](_0x12354e[_0xda74('0x42')][_0xda74('0x49')]);_0x3e543a[_0xda74('0x2f')]=qs[_0xda74('0x2f')](_0x12354e[_0xda74('0x42')][_0xda74('0x2f')]);}return _0x27a199[_0xda74('0x5d')](_0x3e543a);}})[_0xda74('0x53')](function(_0x2be46a){if(_0x2be46a){return _0x2be46a?{'count':_0x3aa8d4,'rows':_0x2be46a}:null;}})[_0xda74('0x53')](respondWithResult(_0x4393af,null))[_0xda74('0x2b')](handleError(_0x4393af,null));};exports[_0xda74('0x60')]=function(_0x248459,_0x382067,_0x1152ec){if(_0x248459['body']['id']){delete _0x248459[_0xda74('0x5a')]['id'];}return db[_0xda74('0x3b')][_0xda74('0x5e')]({'where':{'id':_0x248459[_0xda74('0x5c')]['id']}})['then'](handleEntityNotFound(_0x382067,null))[_0xda74('0x53')](function(_0x3cd05d){if(_0x3cd05d){_0x248459[_0xda74('0x5a')][_0xda74('0x61')]=_0x3cd05d['id'];_0x248459[_0xda74('0x5a')][_0xda74('0x62')]=integrations[_0xda74('0x63')](_0x248459[_0xda74('0x5a')][_0xda74('0x64')],_0x248459['body'][_0xda74('0x3e')]);_0x248459[_0xda74('0x5a')][_0xda74('0x65')]=integrations[_0xda74('0x66')](_0x248459[_0xda74('0x5a')]['channel'],_0x248459[_0xda74('0x5a')][_0xda74('0x3e')]);return db[_0xda74('0x5f')]['create'](_0x248459['body'],{'include':[{'model':db[_0xda74('0x67')],'as':_0xda74('0x62')},{'model':db[_0xda74('0x67')],'as':_0xda74('0x65')}]});}return null;})[_0xda74('0x53')](respondWithResult(_0x382067,null))[_0xda74('0x2b')](handleError(_0x382067,null));};exports['getFields']=function(_0x5b93b7,_0x58aff8,_0x53127b){var _0x3db53f=[_0xda74('0x68'),_0xda74('0x69'),_0xda74('0x6a'),_0xda74('0x6b'),_0xda74('0x6c'),_0xda74('0x6d'),'incident_state','severity',_0xda74('0x6e')];var _0x2e2c33=['parent',_0xda74('0x68'),_0xda74('0x6f'),_0xda74('0x70'),'upon_reject',_0xda74('0x71'),_0xda74('0x72'),_0xda74('0x69'),_0xda74('0x73'),_0xda74('0x74'),'resolved_by',_0xda74('0x75'),_0xda74('0x76'),_0xda74('0x77'),'sys_created_on',_0xda74('0x78'),_0xda74('0x79'),_0xda74('0x7a'),'knowledge','order',_0xda74('0x7b'),_0xda74('0x7c'),_0xda74('0x7d'),_0xda74('0x7e'),_0xda74('0x7f'),'active',_0xda74('0x80'),_0xda74('0x81'),_0xda74('0x82'),'sys_domain_path',_0xda74('0x83'),'time_worked',_0xda74('0x84'),'opened_at',_0xda74('0x85'),_0xda74('0x86'),_0xda74('0x87'),_0xda74('0x88'),_0xda74('0x89'),'caller_id',_0xda74('0x8a'),'subcategory',_0xda74('0x8b'),_0xda74('0x8c'),'close_code',_0xda74('0x8d'),_0xda74('0x8e'),'work_start','assignment_group',_0xda74('0x8f'),_0xda74('0x90'),_0xda74('0x91'),_0xda74('0x92'),_0xda74('0x6d'),'sys_class_name',_0xda74('0x93'),_0xda74('0x94'),_0xda74('0x95'),_0xda74('0x96'),_0xda74('0x97'),'contact_type',_0xda74('0x98'),_0xda74('0x99'),'urgency','problem_id',_0xda74('0x9a'),_0xda74('0x9b'),_0xda74('0x9c'),_0xda74('0x9d'),_0xda74('0x9e'),_0xda74('0x9f'),_0xda74('0xa0'),_0xda74('0xa1'),'comments_and_work_notes','due_date',_0xda74('0xa2'),'reopen_count',_0xda74('0xa3'),_0xda74('0xa4'),_0xda74('0xa5'),'correlation_id',_0xda74('0xa6'),_0xda74('0x6e')];var _0x2fbfc0='';var _0xd2c960='';var _0xd1036a=[];var _0x5d0a2c='';var _0x1a7921='';var _0x3d9107=[];var _0x20d84a='';var _0xbf3234='';var _0x833e6c={};var _0x4b4e00='';return db[_0xda74('0x3b')][_0xda74('0x5e')]({'where':{'id':_0x5b93b7[_0xda74('0x5c')]['id']},'attributes':['id','username',_0xda74('0xa7'),_0xda74('0xa8'),'remoteUri',_0xda74('0xa9')]})[_0xda74('0x53')](handleEntityNotFound(_0x58aff8,null))[_0xda74('0x53')](function(_0x457297){if(_0x457297){_0x4b4e00=_0x457297[_0xda74('0xaa')];var _0x9fd4ed=_0x4b4e00[_0xda74('0xab')](-0x1);if(_0x9fd4ed==='/'){_0x4b4e00=_0x4b4e00[_0xda74('0xac')](0x0,_0x4b4e00[_0xda74('0xad')](_0x9fd4ed));}_0xbf3234=util[_0xda74('0xae')]('%s/api/now/doc/table/schema/',_0x4b4e00);_0x20d84a=util[_0xda74('0xae')](_0xda74('0xaf'),_0x4b4e00);_0x833e6c={'user':_0x457297['username'],'pass':_0x457297[_0xda74('0xa7')]};var _0x262f40={'method':_0xda74('0xb0'),'uri':_0xbf3234+_0xda74('0xb1'),'auth':_0x833e6c,'json':!![]};return rp(_0x262f40);}})[_0xda74('0x53')](function(_0x2b011b){if(_0x2b011b['result'][_0xda74('0x47')]>0x0){_0x2fbfc0=_0x2b011b[_0xda74('0x2a')];}console[_0xda74('0xb2')](_0xda74('0xb3'),_0x2fbfc0);_0x3d9107=[];_0xd2c960=Object[_0xda74('0xb4')]([],_0x2fbfc0);_[_0xda74('0xb5')](_0xd2c960,function(_0x523d4e){return!_0x3db53f['includes'](_0x523d4e[_0xda74('0x38')]);});_0xd2c960[_0xda74('0xb6')](function(_0x270fc8){var _0x41eb26=createFieldObject(_0x20d84a,_0x833e6c,_0x270fc8[_0xda74('0xb7')],_0x270fc8[_0xda74('0x38')],_0x270fc8['label'],![]);_0x3d9107['push'](_0x41eb26);});return Promise[_0xda74('0xb8')](_0x3d9107);})[_0xda74('0x53')](function(_0x3315b4){_0xd1036a=_0x3315b4;_0x5d0a2c=Object[_0xda74('0xb4')]([],_0x2fbfc0);console['log'](_0xda74('0xb9'),_0x2fbfc0);_[_0xda74('0xb5')](_0x5d0a2c,function(_0x52c955){return _0x2e2c33[_0xda74('0xba')](_0x52c955[_0xda74('0x38')]);});console[_0xda74('0xb2')](_0xda74('0xbb'),_0x5d0a2c);_0x3d9107=[];_0x5d0a2c[_0xda74('0xb6')](function(_0x1b52da){var _0x351725=createFieldObject(_0x20d84a,_0x833e6c,_0x1b52da[_0xda74('0xb7')],_0x1b52da[_0xda74('0x38')],_0x1b52da[_0xda74('0xbc')],!![]);_0x3d9107['push'](_0x351725);});return Promise[_0xda74('0xb8')](_0x3d9107);})[_0xda74('0x53')](function(_0x1ed7f5){_0x1a7921=_0x1ed7f5;var _0x11ac9c=_0xd1036a[_0xda74('0xbd')](_0x1a7921);return{'count':_0x11ac9c[_0xda74('0x47')],'rows':_0x11ac9c};})['then'](respondWithResult(_0x58aff8,null))[_0xda74('0x2b')](function(_0x43e8c5){console['log'](_0xda74('0xbe')+_0x43e8c5);var _0x544efe=_0x5b93b7[_0xda74('0x42')][_0xda74('0x1d')]?0x1f4:_0x43e8c5[_0xda74('0xbf')]||0x1f4;logger[_0xda74('0x27')](_0x43e8c5[_0xda74('0x37')]);delete _0x43e8c5[_0xda74('0x38')];if(_0x544efe===0x191){_0x544efe=0x190;}_0x58aff8[_0xda74('0x2c')](_0x544efe)[_0xda74('0x39')](_0x5b93b7['query'][_0xda74('0x1d')]?{'message':_0xda74('0xc0'),'statusCode':_0x43e8c5[_0xda74('0xbf')]}:_0x43e8c5);});};function createFieldObject(_0xcb1fa2,_0x4a62d3,_0x4e9c9a,_0xed7684,_0x12471c,_0x47c946){return new Promise(function(_0x1f0d0b,_0x56ee8e){var _0x5681b7={'id':_0xed7684,'name':_0x12471c,'custom':_0x47c946};if(_0x4e9c9a===_0xda74('0xc1')){_0x5681b7[_0xda74('0x52')]=[{'name':_0xda74('0xc2'),'value':_0xda74('0xc3')},{'name':_0xda74('0xc4'),'value':'false'}];_0x1f0d0b(_0x5681b7);}else{var _0x25ab4c={'method':_0xda74('0xb0'),'uri':_0xcb1fa2+_0xda74('0xc5')+_0xed7684,'auth':_0x4a62d3,'json':!![]};return rp(_0x25ab4c)[_0xda74('0x53')](function(_0x3fcd78){var _0x47e6d2=[];if(_0x3fcd78[_0xda74('0x2a')]['length']>0x0){_0x3fcd78[_0xda74('0x2a')]['forEach'](function(_0x551384){if(_0x551384[_0xda74('0xc6')]===_0xda74('0xc7')){var _0x1a9151={'name':_0x551384['label'],'value':_0x551384[_0xda74('0xc8')]};_0x47e6d2[_0xda74('0xc9')](_0x1a9151);}});}_0x5681b7['options']=_0x47e6d2;if(_0x5681b7['options'][_0xda74('0x47')]>0x0){_0x1f0d0b(_0x5681b7);}else{if(_0x47c946==![]){_0x1f0d0b();}else{_0x1f0d0b(_0x5681b7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 368e923..0e53541 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 _0x50a6=['define','ServicenowAccount','lodash','util','moment','request-promise','path','rimraf','./intServicenowAccount.attributes'];(function(_0x19bc82,_0x2ab968){var _0x42463b=function(_0x27e3df){while(--_0x27e3df){_0x19bc82['push'](_0x19bc82['shift']());}};_0x42463b(++_0x2ab968);}(_0x50a6,0xa4));var _0x650a=function(_0x59080e,_0x2c3518){_0x59080e=_0x59080e-0x0;var _0x4f86a9=_0x50a6[_0x59080e];return _0x4f86a9;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2d486d,_0x2d1bb4){return _0x2d486d[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0bb=['request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','moment'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0xd0bb[_0x3fc287];return _0x33af9f;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var logger=require(_0xbd0b('0x2'))('api');var moment=require(_0xbd0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0b('0x4'));var fs=require('fs');var path=require(_0xbd0b('0x5'));var rimraf=require('rimraf');var config=require(_0xbd0b('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xbd0b('0x7'));module[_0xbd0b('0x8')]=function(_0x158b5c,_0x37c205){return _0x158b5c[_0xbd0b('0x9')]('ServicenowAccount',attributes,{'tableName':_0xbd0b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 6a945da..c3e6a18 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 _0x661d=['info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','model','include','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x661d,0x126));var _0xd661=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x661d[_0xd336fa];return _0x3370b1;};'use strict';var _=require(_0xd661('0x0'));var util=require(_0xd661('0x1'));var moment=require(_0xd661('0x2'));var BPromise=require(_0xd661('0x3'));var rs=require(_0xd661('0x4'));var fs=require('fs');var Redis=require(_0xd661('0x5'));var db=require(_0xd661('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd661('0x7'));var config=require('../../config/environment');var jayson=require(_0xd661('0x8'));var client=jayson[_0xd661('0x9')][_0xd661('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df753,_0x23d138,_0x1eb6ce){return new BPromise(function(_0x47b5c8,_0x5f1bce){return client['request'](_0x2df753,_0x1eb6ce)[_0xd661('0xb')](function(_0x495be4){logger[_0xd661('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x23d138,'request\x20sent');logger[_0xd661('0xd')](_0xd661('0xe'),_0x23d138,'request\x20sent',JSON[_0xd661('0xf')](_0x495be4));if(_0x495be4['error']){if(_0x495be4[_0xd661('0x10')]['code']===0x1f4){logger['error'](_0xd661('0x11'),_0x23d138,_0x495be4[_0xd661('0x10')][_0xd661('0x12')]);return _0x5f1bce(_0x495be4[_0xd661('0x10')]['message']);}logger['error'](_0xd661('0x11'),_0x23d138,_0x495be4['error'][_0xd661('0x12')]);return _0x47b5c8(_0x495be4[_0xd661('0x10')][_0xd661('0x12')]);}else{logger[_0xd661('0xc')](_0xd661('0x11'),_0x23d138,_0xd661('0x13'));_0x47b5c8(_0x495be4['result']['message']);}})[_0xd661('0x14')](function(_0x4ebea8){logger[_0xd661('0x10')](_0xd661('0x11'),_0x23d138,_0x4ebea8);_0x5f1bce(_0x4ebea8);});});}exports[_0xd661('0x15')]=function(_0x354220){var _0x2acf19=this;return new Promise(function(_0x1877de,_0x45198c){return db[_0xd661('0x16')][_0xd661('0x17')]({'raw':_0x354220[_0xd661('0x18')]?_0x354220[_0xd661('0x18')][_0xd661('0x19')]===undefined?!![]:![]:!![],'where':_0x354220[_0xd661('0x18')]?_0x354220['options'][_0xd661('0x1a')]||null:null,'attributes':_0x354220['options']?_0x354220[_0xd661('0x18')][_0xd661('0x1b')]||null:null,'limit':_0x354220[_0xd661('0x18')]?_0x354220[_0xd661('0x18')][_0xd661('0x1c')]||null:null,'include':_0x354220[_0xd661('0x18')]?_0x354220[_0xd661('0x18')]['include']?_[_0xd661('0x1d')](_0x354220[_0xd661('0x18')]['include'],function(_0x2a293d){return{'model':db[_0x2a293d[_0xd661('0x1e')]],'as':_0x2a293d['as'],'attributes':_0x2a293d[_0xd661('0x1b')],'include':_0x2a293d[_0xd661('0x1f')]?_[_0xd661('0x1d')](_0x2a293d[_0xd661('0x1f')],function(_0x16056c){return{'model':db[_0x16056c[_0xd661('0x1e')]],'as':_0x16056c['as'],'attributes':_0x16056c[_0xd661('0x1b')],'include':_0x16056c[_0xd661('0x1f')]?_[_0xd661('0x1d')](_0x16056c[_0xd661('0x1f')],function(_0x343260){return{'model':db[_0x343260['model']],'as':_0x343260['as'],'attributes':_0x343260[_0xd661('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd661('0xb')](function(_0x4cce5f){logger[_0xd661('0xc')](_0xd661('0x15'),_0x354220);logger[_0xd661('0xd')](_0xd661('0x15'),_0x354220,JSON[_0xd661('0xf')](_0x4cce5f));_0x1877de(_0x4cce5f);})['catch'](function(_0x488b7e){logger[_0xd661('0x10')]('GetServicenowAccount',_0x488b7e['message'],_0x354220);_0x45198c(_0x2acf19[_0xd661('0x10')](0x1f4,_0x488b7e['message']));});});};exports['ShowServicenowAccount']=function(_0x18b6fa){var _0x1c0bab=this;return new Promise(function(_0x13095b,_0x17477e){return db['ServicenowAccount'][_0xd661('0x20')]({'raw':_0x18b6fa[_0xd661('0x18')]?_0x18b6fa[_0xd661('0x18')][_0xd661('0x19')]===undefined?!![]:![]:!![],'where':_0x18b6fa['options']?_0x18b6fa[_0xd661('0x18')][_0xd661('0x1a')]||null:null,'attributes':_0x18b6fa['options']?_0x18b6fa[_0xd661('0x18')]['attributes']||null:null,'include':_0x18b6fa[_0xd661('0x18')]?_0x18b6fa[_0xd661('0x18')][_0xd661('0x1f')]?_[_0xd661('0x1d')](_0x18b6fa[_0xd661('0x18')][_0xd661('0x1f')],function(_0x9bbc21){return{'model':db[_0x9bbc21[_0xd661('0x1e')]],'as':_0x9bbc21['as'],'attributes':_0x9bbc21[_0xd661('0x1b')],'include':_0x9bbc21['include']?_[_0xd661('0x1d')](_0x9bbc21['include'],function(_0x4b88e3){return{'model':db[_0x4b88e3[_0xd661('0x1e')]],'as':_0x4b88e3['as'],'attributes':_0x4b88e3[_0xd661('0x1b')],'include':_0x4b88e3[_0xd661('0x1f')]?_[_0xd661('0x1d')](_0x4b88e3[_0xd661('0x1f')],function(_0x376262){return{'model':db[_0x376262[_0xd661('0x1e')]],'as':_0x376262['as'],'attributes':_0x376262[_0xd661('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd661('0xb')](function(_0xb3aa9){logger[_0xd661('0xc')]('ShowServicenowAccount',_0x18b6fa);logger['debug'](_0xd661('0x21'),_0x18b6fa,JSON[_0xd661('0xf')](_0xb3aa9));_0x13095b(_0xb3aa9);})[_0xd661('0x14')](function(_0x40311c){logger['error'](_0xd661('0x21'),_0x40311c[_0xd661('0x12')],_0x18b6fa);_0x17477e(_0x1c0bab[_0xd661('0x10')](0x1f4,_0x40311c['message']));});});}; \ No newline at end of file +var _0x5042=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowServicenowAccount','lodash','util','moment','../../mysqldb','client','http','request','then','info'];(function(_0x31a850,_0xc22ded){var _0x4b3825=function(_0x520053){while(--_0x520053){_0x31a850['push'](_0x31a850['shift']());}};_0x4b3825(++_0xc22ded);}(_0x5042,0x123));var _0x2504=function(_0x5405b0,_0x4e027f){_0x5405b0=_0x5405b0-0x0;var _0x219cba=_0x5042[_0x5405b0];return _0x219cba;};'use strict';var _=require(_0x2504('0x0'));var util=require(_0x2504('0x1'));var moment=require(_0x2504('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2504('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2504('0x4')][_0x2504('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x126e5c,_0xd48e3b,_0x887104){return new BPromise(function(_0x110737,_0x41fb08){return client[_0x2504('0x6')](_0x126e5c,_0x887104)[_0x2504('0x7')](function(_0x41dd50){logger[_0x2504('0x8')](_0x2504('0x9'),_0xd48e3b,_0x2504('0xa'));logger[_0x2504('0xb')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xd48e3b,_0x2504('0xa'),JSON['stringify'](_0x41dd50));if(_0x41dd50[_0x2504('0xc')]){if(_0x41dd50[_0x2504('0xc')][_0x2504('0xd')]===0x1f4){logger['error'](_0x2504('0x9'),_0xd48e3b,_0x41dd50['error'][_0x2504('0xe')]);return _0x41fb08(_0x41dd50[_0x2504('0xc')][_0x2504('0xe')]);}logger[_0x2504('0xc')](_0x2504('0x9'),_0xd48e3b,_0x41dd50[_0x2504('0xc')][_0x2504('0xe')]);return _0x110737(_0x41dd50[_0x2504('0xc')][_0x2504('0xe')]);}else{logger[_0x2504('0x8')](_0x2504('0x9'),_0xd48e3b,_0x2504('0xa'));_0x110737(_0x41dd50[_0x2504('0xf')][_0x2504('0xe')]);}})[_0x2504('0x10')](function(_0x4fc795){logger['error'](_0x2504('0x9'),_0xd48e3b,_0x4fc795);_0x41fb08(_0x4fc795);});});}exports[_0x2504('0x11')]=function(_0x26ea45){var _0x2c3b62=this;return new Promise(function(_0x5c91ea,_0x5d97a1){return db[_0x2504('0x12')][_0x2504('0x13')]({'raw':_0x26ea45[_0x2504('0x14')]?_0x26ea45[_0x2504('0x14')][_0x2504('0x15')]===undefined?!![]:![]:!![],'where':_0x26ea45[_0x2504('0x14')]?_0x26ea45[_0x2504('0x14')][_0x2504('0x16')]||null:null,'attributes':_0x26ea45[_0x2504('0x14')]?_0x26ea45[_0x2504('0x14')][_0x2504('0x17')]||null:null,'limit':_0x26ea45['options']?_0x26ea45[_0x2504('0x14')][_0x2504('0x18')]||null:null,'include':_0x26ea45[_0x2504('0x14')]?_0x26ea45[_0x2504('0x14')][_0x2504('0x19')]?_['map'](_0x26ea45[_0x2504('0x14')][_0x2504('0x19')],function(_0x484a25){return{'model':db[_0x484a25[_0x2504('0x1a')]],'as':_0x484a25['as'],'attributes':_0x484a25[_0x2504('0x17')],'include':_0x484a25['include']?_['map'](_0x484a25[_0x2504('0x19')],function(_0x56cdd2){return{'model':db[_0x56cdd2['model']],'as':_0x56cdd2['as'],'attributes':_0x56cdd2[_0x2504('0x17')],'include':_0x56cdd2[_0x2504('0x19')]?_[_0x2504('0x1b')](_0x56cdd2['include'],function(_0x59a8fa){return{'model':db[_0x59a8fa[_0x2504('0x1a')]],'as':_0x59a8fa['as'],'attributes':_0x59a8fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x2504('0x7')](function(_0x5006ed){logger[_0x2504('0x8')]('GetServicenowAccount',_0x26ea45);logger['debug'](_0x2504('0x11'),_0x26ea45,JSON[_0x2504('0x1c')](_0x5006ed));_0x5c91ea(_0x5006ed);})['catch'](function(_0x30364a){logger[_0x2504('0xc')](_0x2504('0x11'),_0x30364a['message'],_0x26ea45);_0x5d97a1(_0x2c3b62[_0x2504('0xc')](0x1f4,_0x30364a['message']));});});};exports[_0x2504('0x1d')]=function(_0x215625){var _0x100e4d=this;return new Promise(function(_0x523ad3,_0x7decd5){return db[_0x2504('0x12')]['find']({'raw':_0x215625[_0x2504('0x14')]?_0x215625[_0x2504('0x14')][_0x2504('0x15')]===undefined?!![]:![]:!![],'where':_0x215625[_0x2504('0x14')]?_0x215625[_0x2504('0x14')]['where']||null:null,'attributes':_0x215625[_0x2504('0x14')]?_0x215625[_0x2504('0x14')][_0x2504('0x17')]||null:null,'include':_0x215625[_0x2504('0x14')]?_0x215625['options'][_0x2504('0x19')]?_[_0x2504('0x1b')](_0x215625[_0x2504('0x14')][_0x2504('0x19')],function(_0x21dd2b){return{'model':db[_0x21dd2b[_0x2504('0x1a')]],'as':_0x21dd2b['as'],'attributes':_0x21dd2b[_0x2504('0x17')],'include':_0x21dd2b[_0x2504('0x19')]?_[_0x2504('0x1b')](_0x21dd2b[_0x2504('0x19')],function(_0x49e76e){return{'model':db[_0x49e76e[_0x2504('0x1a')]],'as':_0x49e76e['as'],'attributes':_0x49e76e[_0x2504('0x17')],'include':_0x49e76e[_0x2504('0x19')]?_[_0x2504('0x1b')](_0x49e76e[_0x2504('0x19')],function(_0x4cf24c){return{'model':db[_0x4cf24c[_0x2504('0x1a')]],'as':_0x4cf24c['as'],'attributes':_0x4cf24c['attributes']};}):[]};}):[]};}):[]:[]})[_0x2504('0x7')](function(_0x142371){logger[_0x2504('0x8')](_0x2504('0x1d'),_0x215625);logger[_0x2504('0xb')]('ShowServicenowAccount',_0x215625,JSON[_0x2504('0x1c')](_0x142371));_0x523ad3(_0x142371);})[_0x2504('0x10')](function(_0x3205a1){logger[_0x2504('0xc')](_0x2504('0x1d'),_0x3205a1[_0x2504('0xe')],_0x215625);_0x7decd5(_0x100e4d['error'](0x1f4,_0x3205a1['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 49bec1b..59e1caf 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 _0xb1fd=['index','get','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x40e2cf,_0x5a856b){var _0x3c1ba7=function(_0x36f5db){while(--_0x36f5db){_0x40e2cf['push'](_0x40e2cf['shift']());}};_0x3c1ba7(++_0x5a856b);}(_0xb1fd,0x13a));var _0xdb1f=function(_0x36f5eb,_0x202624){_0x36f5eb=_0x36f5eb-0x0;var _0x2fd3fb=_0xb1fd[_0x36f5eb];return _0x2fd3fb;};'use strict';var multer=require(_0xdb1f('0x0'));var util=require('util');var path=require(_0xdb1f('0x1'));var timeout=require(_0xdb1f('0x2'));var express=require(_0xdb1f('0x3'));var router=express[_0xdb1f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb1f('0x5'));var config=require(_0xdb1f('0x6'));var controller=require(_0xdb1f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xdb1f('0x8')]);router[_0xdb1f('0x9')](_0xdb1f('0xa'),auth['isAuthenticated'](),controller[_0xdb1f('0xb')]);router[_0xdb1f('0x9')]('/:id/fields',auth[_0xdb1f('0xc')](),controller[_0xdb1f('0xd')]);router['get'](_0xdb1f('0xe'),auth[_0xdb1f('0xc')](),controller[_0xdb1f('0xf')]);router[_0xdb1f('0x9')](_0xdb1f('0x10'),auth[_0xdb1f('0xc')](),controller[_0xdb1f('0x11')]);router['post']('/',auth[_0xdb1f('0xc')](),controller[_0xdb1f('0x12')]);router[_0xdb1f('0x13')]('/:id',auth[_0xdb1f('0xc')](),controller[_0xdb1f('0x14')]);router[_0xdb1f('0x15')](_0xdb1f('0xa'),auth[_0xdb1f('0xc')](),controller['destroy']);module[_0xdb1f('0x16')]=router; \ No newline at end of file +var _0x95b1=['index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','get'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x95b1,0xc3));var _0x195b=function(_0x3470b9,_0x4c34ff){_0x3470b9=_0x3470b9-0x0;var _0x483062=_0x95b1[_0x3470b9];return _0x483062;};'use strict';var multer=require(_0x195b('0x0'));var util=require('util');var path=require(_0x195b('0x1'));var timeout=require(_0x195b('0x2'));var express=require(_0x195b('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('./intServicenowConfiguration.controller');router[_0x195b('0x4')]('/',auth['isAuthenticated'](),controller[_0x195b('0x5')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x195b('0x6')]);router['get'](_0x195b('0x7'),auth[_0x195b('0x8')](),controller[_0x195b('0x9')]);router[_0x195b('0x4')](_0x195b('0xa'),auth[_0x195b('0x8')](),controller[_0x195b('0xb')]);router[_0x195b('0x4')](_0x195b('0xc'),auth[_0x195b('0x8')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x195b('0xd')]);router[_0x195b('0xe')](_0x195b('0xf'),auth[_0x195b('0x8')](),controller[_0x195b('0x10')]);router[_0x195b('0x11')](_0x195b('0xf'),auth[_0x195b('0x8')](),controller[_0x195b('0x12')]);module[_0x195b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index f3fece7..0484358 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 _0x8c57=['exports','STRING'];(function(_0x456954,_0x504ecd){var _0x52216a=function(_0xae14bf){while(--_0xae14bf){_0x456954['push'](_0x456954['shift']());}};_0x52216a(++_0x504ecd);}(_0x8c57,0xfa));var _0x78c5=function(_0x7fd971,_0x3d089a){_0x7fd971=_0x7fd971-0x0;var _0x111328=_0x8c57[_0x7fd971];return _0x111328;};'use strict';var Sequelize=require('sequelize');module[_0x78c5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x78c5('0x1')]}}; \ No newline at end of file +var _0xa57f=['STRING','sequelize','exports'];(function(_0x341c4a,_0x3deb30){var _0x4def59=function(_0x359b18){while(--_0x359b18){_0x341c4a['push'](_0x341c4a['shift']());}};_0x4def59(++_0x3deb30);}(_0xa57f,0x70));var _0xfa57=function(_0xa788ad,_0x3098f5){_0xa788ad=_0xa788ad-0x0;var _0x2977b4=_0xa57f[_0xa788ad];return _0x2977b4;};'use strict';var Sequelize=require(_0xfa57('0x0'));module[_0xfa57('0x1')]={'name':{'type':Sequelize[_0xfa57('0x2')]},'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 2072770..07e2943 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 _0x97bd=['limit','order','sort','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','ServicenowField','where','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x99d9cf,_0x284a75){var _0x447758=function(_0x29c196){while(--_0x29c196){_0x99d9cf['push'](_0x99d9cf['shift']());}};_0x447758(++_0x284a75);}(_0x97bd,0x1c9));var _0xd97b=function(_0x1fcada,_0x2d737e){_0x1fcada=_0x1fcada-0x0;var _0x52584d=_0x97bd[_0x1fcada];return _0x52584d;};'use strict';var pdf=require(_0xd97b('0x0'));var emlformat=require(_0xd97b('0x1'));var rimraf=require(_0xd97b('0x2'));var zipdir=require(_0xd97b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd97b('0x4'));var moment=require(_0xd97b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd97b('0x6'));var util=require(_0xd97b('0x7'));var path=require(_0xd97b('0x8'));var sox=require(_0xd97b('0x9'));var csv=require(_0xd97b('0xa'));var ejs=require(_0xd97b('0xb'));var fs=require('fs');var _=require(_0xd97b('0xc'));var squel=require('squel');var crypto=require(_0xd97b('0xd'));var jsforce=require(_0xd97b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd97b('0xf'));var Papa=require(_0xd97b('0x10'));var Redis=require(_0xd97b('0x11'));var authService=require(_0xd97b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd97b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd97b('0x14'));var utils=require('../../config/utils');var config=require(_0xd97b('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd97b('0x16'));var client=jayson[_0xd97b('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5efebb,_0x4b8419,_0x26650e){if(_0x26650e){var _0x40ed8f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40ed8f['test'](_0x4b8419)){return _0x5efebb;}else{throw new db[(_0xd97b('0x18'))][(_0xd97b('0x19'))](_0xd97b('0x1a'));}}else{return _0x5efebb;}}function respondWithRpcPromise(_0x1edcca,_0x4d3f48,_0x5766ae,_0x4de30f){return new BPromise(function(_0x4a48e7,_0x12ad4e){var _0x4b47a3=_0x4de30f||client;return _0x4b47a3['request'](_0x1edcca,_0x5766ae)[_0xd97b('0x1b')](function(_0x1f3c66){logger[_0xd97b('0x1c')](_0xd97b('0x1d'),_0x4d3f48,_0xd97b('0x1e'));logger['debug'](_0xd97b('0x1f'),_0x4d3f48,_0xd97b('0x1e'),JSON['stringify'](_0x1f3c66));if(_0x1f3c66[_0xd97b('0x20')]){if(_0x1f3c66[_0xd97b('0x20')][_0xd97b('0x21')]===0x1f4){logger[_0xd97b('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d3f48,_0x1f3c66[_0xd97b('0x20')][_0xd97b('0x22')]);return _0x12ad4e(_0x1f3c66[_0xd97b('0x20')][_0xd97b('0x22')]);}logger[_0xd97b('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d3f48,_0x1f3c66[_0xd97b('0x20')]['message']);return _0x4a48e7(_0x1f3c66[_0xd97b('0x20')][_0xd97b('0x22')]);}else{logger[_0xd97b('0x1c')](_0xd97b('0x1d'),_0x4d3f48,_0xd97b('0x1e'));_0x4a48e7(_0x1f3c66[_0xd97b('0x23')]['message']);}})['catch'](function(_0x5e63c7){logger[_0xd97b('0x20')](_0xd97b('0x1d'),_0x4d3f48,_0x5e63c7);_0x12ad4e(_0x5e63c7);});});}function respondWithStatusCode(_0xab3546,_0x4671d1){_0x4671d1=_0x4671d1||0xcc;return function(_0x208ecd){if(_0x208ecd){return _0xab3546[_0xd97b('0x24')](_0x4671d1);}return _0xab3546[_0xd97b('0x25')](_0x4671d1)['end']();};}function respondWithResult(_0x52d94b,_0x185f2d){_0x185f2d=_0x185f2d||0xc8;return function(_0x49e1a3){if(_0x49e1a3){return _0x52d94b[_0xd97b('0x25')](_0x185f2d)[_0xd97b('0x26')](_0x49e1a3);}};}function respondWithFilteredResult(_0x2f52ad,_0x3575b7){return function(_0x17d1d1){if(_0x17d1d1){var _0x2f0a8d=_0x17d1d1[_0xd97b('0x27')],_0x46edb1=_0x3575b7['offset'],_0x1859a6=_0x3575b7[_0xd97b('0x28')]+_0x3575b7['limit'],_0x5a3ba2;if(_0x1859a6>=_0x2f0a8d){_0x1859a6=_0x2f0a8d;_0x5a3ba2=0xc8;}else{_0x5a3ba2=0xce;}_0x2f52ad[_0xd97b('0x25')](_0x5a3ba2);return _0x2f52ad[_0xd97b('0x29')]('Content-Range',_0x46edb1+'-'+_0x1859a6+'/'+_0x2f0a8d)[_0xd97b('0x26')](_0x17d1d1);}return null;};}function patchUpdates(_0x289734){return function(_0x25ae68){try{jsonpatch[_0xd97b('0x2a')](_0x25ae68,_0x289734,!![]);}catch(_0x46c96b){return BPromise[_0xd97b('0x2b')](_0x46c96b);}return _0x25ae68[_0xd97b('0x2c')]();};}function saveUpdates(_0x492c71,_0x3def2b){return function(_0x30648e){if(_0x30648e){return _0x30648e[_0xd97b('0x2d')](_0x492c71)[_0xd97b('0x1b')](function(_0x32c179){return _0x32c179;});}return null;};}function removeEntity(_0x225da3,_0x525241){return function(_0xd98b22){if(_0xd98b22){return _0xd98b22[_0xd97b('0x2e')]()['then'](function(){_0x225da3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b472,_0x405f75){return function(_0x35d764){if(!_0x35d764){_0x32b472['sendStatus'](0x194);}return _0x35d764;};}function handleError(_0xdd615e,_0x77445b){_0x77445b=_0x77445b||0x1f4;return function(_0x525f96){logger[_0xd97b('0x20')](_0x525f96[_0xd97b('0x2f')]);if(_0x525f96[_0xd97b('0x30')]){delete _0x525f96['name'];}_0xdd615e[_0xd97b('0x25')](_0x77445b)['send'](_0x525f96);};}exports[_0xd97b('0x31')]=function(_0x7521ac,_0xe1b20d){var _0x24ac51={},_0x5e4e0e={},_0x5c7a95={'count':0x0,'rows':[]};var _0x19f2b2=_[_0xd97b('0x32')](db[_0xd97b('0x33')][_0xd97b('0x34')],function(_0x53b586){return{'name':_0x53b586[_0xd97b('0x35')],'type':_0x53b586[_0xd97b('0x36')]['key']};});_0x5e4e0e[_0xd97b('0x37')]=_['map'](_0x19f2b2,_0xd97b('0x30'));_0x5e4e0e['query']=_[_0xd97b('0x38')](_0x7521ac['query']);_0x5e4e0e[_0xd97b('0x39')]=_['intersection'](_0x5e4e0e['model'],_0x5e4e0e[_0xd97b('0x3a')]);_0x24ac51[_0xd97b('0x3b')]=_[_0xd97b('0x3c')](_0x5e4e0e[_0xd97b('0x37')],qs['fields'](_0x7521ac[_0xd97b('0x3a')][_0xd97b('0x3d')]));_0x24ac51['attributes']=_0x24ac51['attributes'][_0xd97b('0x3e')]?_0x24ac51[_0xd97b('0x3b')]:_0x5e4e0e[_0xd97b('0x37')];if(!_0x7521ac['query'][_0xd97b('0x3f')](_0xd97b('0x40'))){_0x24ac51[_0xd97b('0x41')]=qs[_0xd97b('0x41')](_0x7521ac[_0xd97b('0x3a')][_0xd97b('0x41')]);_0x24ac51[_0xd97b('0x28')]=qs[_0xd97b('0x28')](_0x7521ac[_0xd97b('0x3a')]['offset']);}_0x24ac51[_0xd97b('0x42')]=qs[_0xd97b('0x43')](_0x7521ac[_0xd97b('0x3a')][_0xd97b('0x43')]);_0x24ac51['where']=qs[_0xd97b('0x39')](_[_0xd97b('0x44')](_0x7521ac[_0xd97b('0x3a')],_0x5e4e0e[_0xd97b('0x39')]));if(_0x7521ac[_0xd97b('0x3a')][_0xd97b('0x45')]){_0x24ac51['where']=_[_0xd97b('0x46')](_0x24ac51['where'],{'$or':_[_0xd97b('0x32')](_0x19f2b2,function(_0x36bec0){if(_0x36bec0[_0xd97b('0x36')]!=='VIRTUAL'){var _0x37e37e={};_0x37e37e[_0x36bec0[_0xd97b('0x30')]]={'$like':'%'+_0x7521ac['query'][_0xd97b('0x45')]+'%'};return _0x37e37e;}})});}_0x24ac51=_[_0xd97b('0x46')]({},_0x24ac51,_0x7521ac[_0xd97b('0x47')]);var _0x2b3cd3={'where':_0x24ac51['where']};return db[_0xd97b('0x33')][_0xd97b('0x27')](_0x2b3cd3)['then'](function(_0x3dc426){_0x5c7a95[_0xd97b('0x27')]=_0x3dc426;if(_0x7521ac[_0xd97b('0x3a')][_0xd97b('0x48')]){_0x24ac51[_0xd97b('0x49')]=[{'all':!![]}];}return db[_0xd97b('0x33')][_0xd97b('0x4a')](_0x24ac51);})['then'](function(_0x53797c){_0x5c7a95['rows']=_0x53797c;return _0x5c7a95;})[_0xd97b('0x1b')](respondWithFilteredResult(_0xe1b20d,_0x24ac51))[_0xd97b('0x4b')](handleError(_0xe1b20d,null));};exports[_0xd97b('0x4c')]=function(_0x5b3ead,_0x307479){var _0x1495f6={'raw':![],'where':{'id':_0x5b3ead[_0xd97b('0x4d')]['id']}},_0x26977b={};_0x26977b[_0xd97b('0x37')]=_[_0xd97b('0x38')](db[_0xd97b('0x33')][_0xd97b('0x34')]);_0x26977b[_0xd97b('0x3a')]=_['keys'](_0x5b3ead['query']);_0x26977b[_0xd97b('0x39')]=_[_0xd97b('0x3c')](_0x26977b[_0xd97b('0x37')],_0x26977b[_0xd97b('0x3a')]);_0x1495f6[_0xd97b('0x3b')]=_[_0xd97b('0x3c')](_0x26977b[_0xd97b('0x37')],qs[_0xd97b('0x3d')](_0x5b3ead[_0xd97b('0x3a')][_0xd97b('0x3d')]));_0x1495f6[_0xd97b('0x3b')]=_0x1495f6[_0xd97b('0x3b')][_0xd97b('0x3e')]?_0x1495f6[_0xd97b('0x3b')]:_0x26977b[_0xd97b('0x37')];if(_0x5b3ead[_0xd97b('0x3a')][_0xd97b('0x48')]){_0x1495f6[_0xd97b('0x49')]=[{'all':!![]}];}_0x1495f6=_['merge']({},_0x1495f6,_0x5b3ead[_0xd97b('0x47')]);return db['ServicenowConfiguration'][_0xd97b('0x4e')](_0x1495f6)['then'](handleEntityNotFound(_0x307479,null))[_0xd97b('0x1b')](respondWithResult(_0x307479,null))[_0xd97b('0x4b')](handleError(_0x307479,null));};exports['create']=function(_0x5971c1,_0x2255e1){return db['ServicenowConfiguration'][_0xd97b('0x4f')](_0x5971c1[_0xd97b('0x50')],{})[_0xd97b('0x1b')](respondWithResult(_0x2255e1,0xc9))[_0xd97b('0x4b')](handleError(_0x2255e1,null));};exports[_0xd97b('0x2d')]=function(_0x50380d,_0x1110e0){if(_0x50380d[_0xd97b('0x50')]['id']){delete _0x50380d[_0xd97b('0x50')]['id'];}return db[_0xd97b('0x33')][_0xd97b('0x4e')]({'where':{'id':_0x50380d[_0xd97b('0x4d')]['id']}})[_0xd97b('0x1b')](handleEntityNotFound(_0x1110e0,null))[_0xd97b('0x1b')](saveUpdates(_0x50380d[_0xd97b('0x50')],null))[_0xd97b('0x1b')](respondWithResult(_0x1110e0,null))[_0xd97b('0x4b')](handleError(_0x1110e0,null));};exports[_0xd97b('0x2e')]=function(_0x3c4890,_0x1475dc){return db[_0xd97b('0x33')]['find']({'where':{'id':_0x3c4890[_0xd97b('0x4d')]['id']}})[_0xd97b('0x1b')](handleEntityNotFound(_0x1475dc,null))['then'](removeEntity(_0x1475dc,null))['catch'](handleError(_0x1475dc,null));};exports[_0xd97b('0x51')]=function(_0x5a6e54,_0x38a393,_0x3eeed3){var _0x42db34={};var _0x273ea2={};var _0x2c919f;var _0x2a7231;return db[_0xd97b('0x33')][_0xd97b('0x52')]({'where':{'id':_0x5a6e54[_0xd97b('0x4d')]['id']}})[_0xd97b('0x1b')](handleEntityNotFound(_0x38a393,null))[_0xd97b('0x1b')](function(_0x104122){if(_0x104122){_0x2c919f=_0x104122;_0x273ea2[_0xd97b('0x37')]=_['keys'](db[_0xd97b('0x53')][_0xd97b('0x34')]);_0x273ea2['query']=_['keys'](_0x5a6e54[_0xd97b('0x3a')]);_0x273ea2['filters']=_['intersection'](_0x273ea2[_0xd97b('0x37')],_0x273ea2[_0xd97b('0x3a')]);_0x42db34[_0xd97b('0x3b')]=_[_0xd97b('0x3c')](_0x273ea2[_0xd97b('0x37')],qs[_0xd97b('0x3d')](_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x3d')]));_0x42db34[_0xd97b('0x3b')]=_0x42db34[_0xd97b('0x3b')][_0xd97b('0x3e')]?_0x42db34[_0xd97b('0x3b')]:_0x273ea2[_0xd97b('0x37')];_0x42db34[_0xd97b('0x42')]=qs['sort'](_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x43')]);_0x42db34[_0xd97b('0x54')]=qs[_0xd97b('0x39')](_[_0xd97b('0x44')](_0x5a6e54[_0xd97b('0x3a')],_0x273ea2[_0xd97b('0x39')]));if(_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x45')]){_0x42db34[_0xd97b('0x54')]=_[_0xd97b('0x46')](_0x42db34[_0xd97b('0x54')],{'$or':_[_0xd97b('0x32')](_0x42db34[_0xd97b('0x3b')],function(_0x4718ba){var _0x247e6f={};_0x247e6f[_0x4718ba]={'$like':'%'+_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x45')]+'%'};return _0x247e6f;})});}_0x42db34=_[_0xd97b('0x46')]({},_0x42db34,_0x5a6e54['options']);return _0x2c919f[_0xd97b('0x51')](_0x42db34);}})[_0xd97b('0x1b')](function(_0x252e78){if(_0x252e78){_0x2a7231=_0x252e78[_0xd97b('0x3e')];if(!_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x3f')](_0xd97b('0x40'))){_0x42db34[_0xd97b('0x41')]=qs[_0xd97b('0x41')](_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x41')]);_0x42db34[_0xd97b('0x28')]=qs[_0xd97b('0x28')](_0x5a6e54[_0xd97b('0x3a')][_0xd97b('0x28')]);}return _0x2c919f['getFields'](_0x42db34);}})[_0xd97b('0x1b')](function(_0x401a34){if(_0x401a34){return _0x401a34?{'count':_0x2a7231,'rows':_0x401a34}:null;}})['then'](respondWithResult(_0x38a393,null))[_0xd97b('0x4b')](handleError(_0x38a393,null));};exports[_0xd97b('0x55')]=function(_0x41bc26,_0x49c56d,_0x144969){var _0x52da57={};var _0x23f3f7={};var _0x304419;var _0xca615a;return db[_0xd97b('0x33')][_0xd97b('0x52')]({'where':{'id':_0x41bc26[_0xd97b('0x4d')]['id']}})[_0xd97b('0x1b')](handleEntityNotFound(_0x49c56d,null))['then'](function(_0x57b6f7){if(_0x57b6f7){_0x304419=_0x57b6f7;_0x23f3f7[_0xd97b('0x37')]=_[_0xd97b('0x38')](db[_0xd97b('0x53')][_0xd97b('0x34')]);_0x23f3f7[_0xd97b('0x3a')]=_[_0xd97b('0x38')](_0x41bc26[_0xd97b('0x3a')]);_0x23f3f7[_0xd97b('0x39')]=_[_0xd97b('0x3c')](_0x23f3f7['model'],_0x23f3f7[_0xd97b('0x3a')]);_0x52da57[_0xd97b('0x3b')]=_[_0xd97b('0x3c')](_0x23f3f7[_0xd97b('0x37')],qs[_0xd97b('0x3d')](_0x41bc26['query']['fields']));_0x52da57[_0xd97b('0x3b')]=_0x52da57[_0xd97b('0x3b')][_0xd97b('0x3e')]?_0x52da57['attributes']:_0x23f3f7[_0xd97b('0x37')];_0x52da57[_0xd97b('0x42')]=qs[_0xd97b('0x43')](_0x41bc26[_0xd97b('0x3a')][_0xd97b('0x43')]);_0x52da57[_0xd97b('0x54')]=qs[_0xd97b('0x39')](_['pick'](_0x41bc26[_0xd97b('0x3a')],_0x23f3f7[_0xd97b('0x39')]));if(_0x41bc26['query'][_0xd97b('0x45')]){_0x52da57[_0xd97b('0x54')]=_[_0xd97b('0x46')](_0x52da57['where'],{'$or':_[_0xd97b('0x32')](_0x52da57[_0xd97b('0x3b')],function(_0x460e8c){var _0x1cf19a={};_0x1cf19a[_0x460e8c]={'$like':'%'+_0x41bc26[_0xd97b('0x3a')][_0xd97b('0x45')]+'%'};return _0x1cf19a;})});}_0x52da57=_[_0xd97b('0x46')]({},_0x52da57,_0x41bc26['options']);return _0x304419[_0xd97b('0x55')](_0x52da57);}})[_0xd97b('0x1b')](function(_0x247266){if(_0x247266){_0xca615a=_0x247266[_0xd97b('0x3e')];if(!_0x41bc26[_0xd97b('0x3a')]['hasOwnProperty'](_0xd97b('0x40'))){_0x52da57[_0xd97b('0x41')]=qs['limit'](_0x41bc26[_0xd97b('0x3a')][_0xd97b('0x41')]);_0x52da57[_0xd97b('0x28')]=qs[_0xd97b('0x28')](_0x41bc26[_0xd97b('0x3a')][_0xd97b('0x28')]);}return _0x304419[_0xd97b('0x55')](_0x52da57);}})['then'](function(_0x30f7a3){if(_0x30f7a3){return _0x30f7a3?{'count':_0xca615a,'rows':_0x30f7a3}:null;}})[_0xd97b('0x1b')](respondWithResult(_0x49c56d,null))[_0xd97b('0x4b')](handleError(_0x49c56d,null));};exports[_0xd97b('0x56')]=function(_0x1bb921,_0x5edf08,_0x2fd916){var _0x2b3794={};var _0x3d466f={};var _0xa85c3c;var _0x305d45;return db[_0xd97b('0x33')]['findOne']({'where':{'id':_0x1bb921[_0xd97b('0x4d')]['id']}})[_0xd97b('0x1b')](handleEntityNotFound(_0x5edf08,null))['then'](function(_0xfeb340){if(_0xfeb340){_0xa85c3c=_0xfeb340;_0x3d466f[_0xd97b('0x37')]=_['keys'](db[_0xd97b('0x53')]['rawAttributes']);_0x3d466f[_0xd97b('0x3a')]=_[_0xd97b('0x38')](_0x1bb921[_0xd97b('0x3a')]);_0x3d466f[_0xd97b('0x39')]=_[_0xd97b('0x3c')](_0x3d466f['model'],_0x3d466f['query']);_0x2b3794['attributes']=_[_0xd97b('0x3c')](_0x3d466f[_0xd97b('0x37')],qs[_0xd97b('0x3d')](_0x1bb921['query'][_0xd97b('0x3d')]));_0x2b3794['attributes']=_0x2b3794['attributes']['length']?_0x2b3794['attributes']:_0x3d466f[_0xd97b('0x37')];_0x2b3794[_0xd97b('0x42')]=qs[_0xd97b('0x43')](_0x1bb921[_0xd97b('0x3a')]['sort']);_0x2b3794[_0xd97b('0x54')]=qs[_0xd97b('0x39')](_[_0xd97b('0x44')](_0x1bb921['query'],_0x3d466f[_0xd97b('0x39')]));if(_0x1bb921['query']['filter']){_0x2b3794['where']=_[_0xd97b('0x46')](_0x2b3794[_0xd97b('0x54')],{'$or':_[_0xd97b('0x32')](_0x2b3794[_0xd97b('0x3b')],function(_0x388f8b){var _0x29db76={};_0x29db76[_0x388f8b]={'$like':'%'+_0x1bb921[_0xd97b('0x3a')]['filter']+'%'};return _0x29db76;})});}_0x2b3794=_[_0xd97b('0x46')]({},_0x2b3794,_0x1bb921[_0xd97b('0x47')]);return _0xa85c3c[_0xd97b('0x56')](_0x2b3794);}})['then'](function(_0x33cc21){if(_0x33cc21){_0x305d45=_0x33cc21[_0xd97b('0x3e')];if(!_0x1bb921['query'][_0xd97b('0x3f')](_0xd97b('0x40'))){_0x2b3794['limit']=qs[_0xd97b('0x41')](_0x1bb921[_0xd97b('0x3a')]['limit']);_0x2b3794[_0xd97b('0x28')]=qs[_0xd97b('0x28')](_0x1bb921[_0xd97b('0x3a')][_0xd97b('0x28')]);}return _0xa85c3c[_0xd97b('0x56')](_0x2b3794);}})[_0xd97b('0x1b')](function(_0x1d52f8){if(_0x1d52f8){return _0x1d52f8?{'count':_0x305d45,'rows':_0x1d52f8}:null;}})['then'](respondWithResult(_0x5edf08,null))[_0xd97b('0x4b')](handleError(_0x5edf08,null));}; \ No newline at end of file +var _0x26e4=['map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','destroy','getFields','ServicenowField','getSubjects','pick','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','status','stack','name','send','index'];(function(_0x3cdc0e,_0x23e3de){var _0x2d9894=function(_0xadcf87){while(--_0xadcf87){_0x3cdc0e['push'](_0x3cdc0e['shift']());}};_0x2d9894(++_0x23e3de);}(_0x26e4,0x13b));var _0x426e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x26e4[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x426e('0x0'));var emlformat=require(_0x426e('0x1'));var rimraf=require(_0x426e('0x2'));var zipdir=require(_0x426e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x426e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x426e('0x5'));var util=require(_0x426e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x426e('0x7'));var fs=require('fs');var _=require(_0x426e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x426e('0x9'));var toCsv=require(_0x426e('0xa'));var querystring=require(_0x426e('0xb'));var Papa=require(_0x426e('0xc'));var Redis=require(_0x426e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x426e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x426e('0xf'));var logger=require('../../config/logger')(_0x426e('0x10'));var utils=require(_0x426e('0x11'));var config=require(_0x426e('0x12'));var db=require(_0x426e('0x13'))['db'];var jayson=require(_0x426e('0x14'));var client=jayson[_0x426e('0x15')][_0x426e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x2f5c4c,_0x3b1538,_0x5b8394){if(_0x5b8394){var _0xf79c3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf79c3b[_0x426e('0x17')](_0x3b1538)){return _0x2f5c4c;}else{throw new db[(_0x426e('0x18'))][(_0x426e('0x19'))](_0x426e('0x1a'));}}else{return _0x2f5c4c;}}function respondWithRpcPromise(_0x5a646e,_0x6f2fc9,_0x2d79be,_0x2199b1){return new BPromise(function(_0x44bb4a,_0x50741d){var _0x393931=_0x2199b1||client;return _0x393931[_0x426e('0x1b')](_0x5a646e,_0x2d79be)['then'](function(_0x16f688){logger[_0x426e('0x1c')](_0x426e('0x1d'),_0x6f2fc9,_0x426e('0x1e'));logger['debug'](_0x426e('0x1f'),_0x6f2fc9,'request\x20sent',JSON[_0x426e('0x20')](_0x16f688));if(_0x16f688['error']){if(_0x16f688[_0x426e('0x21')]['code']===0x1f4){logger[_0x426e('0x21')](_0x426e('0x1d'),_0x6f2fc9,_0x16f688[_0x426e('0x21')][_0x426e('0x22')]);return _0x50741d(_0x16f688[_0x426e('0x21')][_0x426e('0x22')]);}logger['error'](_0x426e('0x1d'),_0x6f2fc9,_0x16f688[_0x426e('0x21')][_0x426e('0x22')]);return _0x44bb4a(_0x16f688[_0x426e('0x21')][_0x426e('0x22')]);}else{logger[_0x426e('0x1c')](_0x426e('0x1d'),_0x6f2fc9,'request\x20sent');_0x44bb4a(_0x16f688['result'][_0x426e('0x22')]);}})[_0x426e('0x23')](function(_0x168beb){logger[_0x426e('0x21')]('ServicenowConfiguration,\x20%s,\x20%s',_0x6f2fc9,_0x168beb);_0x50741d(_0x168beb);});});}function respondWithStatusCode(_0x108676,_0x5c585f){_0x5c585f=_0x5c585f||0xcc;return function(_0x454bac){if(_0x454bac){return _0x108676[_0x426e('0x24')](_0x5c585f);}return _0x108676['status'](_0x5c585f)[_0x426e('0x25')]();};}function respondWithResult(_0x5e9c30,_0x239460){_0x239460=_0x239460||0xc8;return function(_0x1f3e9f){if(_0x1f3e9f){return _0x5e9c30['status'](_0x239460)[_0x426e('0x26')](_0x1f3e9f);}};}function respondWithFilteredResult(_0x430bc3,_0x511f92){return function(_0x330ca3){if(_0x330ca3){var _0xac94ea=_0x330ca3[_0x426e('0x27')],_0x2a8938=_0x511f92[_0x426e('0x28')],_0x1b6bfb=_0x511f92['offset']+_0x511f92[_0x426e('0x29')],_0x2e4989;if(_0x1b6bfb>=_0xac94ea){_0x1b6bfb=_0xac94ea;_0x2e4989=0xc8;}else{_0x2e4989=0xce;}_0x430bc3['status'](_0x2e4989);return _0x430bc3['set'](_0x426e('0x2a'),_0x2a8938+'-'+_0x1b6bfb+'/'+_0xac94ea)[_0x426e('0x26')](_0x330ca3);}return null;};}function patchUpdates(_0x3218b6){return function(_0x1ab87e){try{jsonpatch[_0x426e('0x2b')](_0x1ab87e,_0x3218b6,!![]);}catch(_0x302137){return BPromise[_0x426e('0x2c')](_0x302137);}return _0x1ab87e[_0x426e('0x2d')]();};}function saveUpdates(_0x2c327b,_0x41773f){return function(_0x11d235){if(_0x11d235){return _0x11d235[_0x426e('0x2e')](_0x2c327b)[_0x426e('0x2f')](function(_0x55a8e1){return _0x55a8e1;});}return null;};}function removeEntity(_0x35ec03,_0x22f9e9){return function(_0x12d94e){if(_0x12d94e){return _0x12d94e['destroy']()[_0x426e('0x2f')](function(){_0x35ec03[_0x426e('0x30')](0xcc)[_0x426e('0x25')]();});}};}function handleEntityNotFound(_0x379ccf,_0x46bd4a){return function(_0x549b07){if(!_0x549b07){_0x379ccf[_0x426e('0x24')](0x194);}return _0x549b07;};}function handleError(_0x3c5010,_0x53cfb5){_0x53cfb5=_0x53cfb5||0x1f4;return function(_0xd15f0c){logger[_0x426e('0x21')](_0xd15f0c[_0x426e('0x31')]);if(_0xd15f0c[_0x426e('0x32')]){delete _0xd15f0c[_0x426e('0x32')];}_0x3c5010[_0x426e('0x30')](_0x53cfb5)[_0x426e('0x33')](_0xd15f0c);};}exports[_0x426e('0x34')]=function(_0x1007ea,_0x5b5fdb){var _0x4d9e7c={},_0x1fb537={},_0x188841={'count':0x0,'rows':[]};var _0x2c5f93=_[_0x426e('0x35')](db[_0x426e('0x36')][_0x426e('0x37')],function(_0x4cd525){return{'name':_0x4cd525[_0x426e('0x38')],'type':_0x4cd525['type'][_0x426e('0x39')]};});_0x1fb537[_0x426e('0x3a')]=_['map'](_0x2c5f93,_0x426e('0x32'));_0x1fb537[_0x426e('0x3b')]=_[_0x426e('0x3c')](_0x1007ea[_0x426e('0x3b')]);_0x1fb537[_0x426e('0x3d')]=_[_0x426e('0x3e')](_0x1fb537[_0x426e('0x3a')],_0x1fb537[_0x426e('0x3b')]);_0x4d9e7c[_0x426e('0x3f')]=_[_0x426e('0x3e')](_0x1fb537['model'],qs[_0x426e('0x40')](_0x1007ea[_0x426e('0x3b')][_0x426e('0x40')]));_0x4d9e7c[_0x426e('0x3f')]=_0x4d9e7c['attributes'][_0x426e('0x41')]?_0x4d9e7c[_0x426e('0x3f')]:_0x1fb537[_0x426e('0x3a')];if(!_0x1007ea['query'][_0x426e('0x42')](_0x426e('0x43'))){_0x4d9e7c['limit']=qs[_0x426e('0x29')](_0x1007ea[_0x426e('0x3b')][_0x426e('0x29')]);_0x4d9e7c['offset']=qs[_0x426e('0x28')](_0x1007ea[_0x426e('0x3b')][_0x426e('0x28')]);}_0x4d9e7c[_0x426e('0x44')]=qs['sort'](_0x1007ea[_0x426e('0x3b')][_0x426e('0x45')]);_0x4d9e7c[_0x426e('0x46')]=qs[_0x426e('0x3d')](_['pick'](_0x1007ea['query'],_0x1fb537[_0x426e('0x3d')]));if(_0x1007ea[_0x426e('0x3b')][_0x426e('0x47')]){_0x4d9e7c[_0x426e('0x46')]=_['merge'](_0x4d9e7c[_0x426e('0x46')],{'$or':_[_0x426e('0x35')](_0x2c5f93,function(_0x10fcd7){if(_0x10fcd7[_0x426e('0x48')]!==_0x426e('0x49')){var _0x3f4b7d={};_0x3f4b7d[_0x10fcd7[_0x426e('0x32')]]={'$like':'%'+_0x1007ea[_0x426e('0x3b')]['filter']+'%'};return _0x3f4b7d;}})});}_0x4d9e7c=_['merge']({},_0x4d9e7c,_0x1007ea[_0x426e('0x4a')]);var _0x518dc1={'where':_0x4d9e7c[_0x426e('0x46')]};return db[_0x426e('0x36')]['count'](_0x518dc1)[_0x426e('0x2f')](function(_0x29a103){_0x188841[_0x426e('0x27')]=_0x29a103;if(_0x1007ea[_0x426e('0x3b')][_0x426e('0x4b')]){_0x4d9e7c[_0x426e('0x4c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x426e('0x4d')](_0x4d9e7c);})[_0x426e('0x2f')](function(_0x5843da){_0x188841[_0x426e('0x4e')]=_0x5843da;return _0x188841;})[_0x426e('0x2f')](respondWithFilteredResult(_0x5b5fdb,_0x4d9e7c))['catch'](handleError(_0x5b5fdb,null));};exports[_0x426e('0x4f')]=function(_0x24d411,_0x3b65cb){var _0x53fc1e={'raw':![],'where':{'id':_0x24d411[_0x426e('0x50')]['id']}},_0x26f225={};_0x26f225[_0x426e('0x3a')]=_[_0x426e('0x3c')](db[_0x426e('0x36')][_0x426e('0x37')]);_0x26f225[_0x426e('0x3b')]=_[_0x426e('0x3c')](_0x24d411[_0x426e('0x3b')]);_0x26f225[_0x426e('0x3d')]=_[_0x426e('0x3e')](_0x26f225[_0x426e('0x3a')],_0x26f225[_0x426e('0x3b')]);_0x53fc1e[_0x426e('0x3f')]=_[_0x426e('0x3e')](_0x26f225[_0x426e('0x3a')],qs[_0x426e('0x40')](_0x24d411[_0x426e('0x3b')][_0x426e('0x40')]));_0x53fc1e[_0x426e('0x3f')]=_0x53fc1e[_0x426e('0x3f')]['length']?_0x53fc1e[_0x426e('0x3f')]:_0x26f225[_0x426e('0x3a')];if(_0x24d411[_0x426e('0x3b')]['includeAll']){_0x53fc1e[_0x426e('0x4c')]=[{'all':!![]}];}_0x53fc1e=_[_0x426e('0x51')]({},_0x53fc1e,_0x24d411[_0x426e('0x4a')]);return db['ServicenowConfiguration'][_0x426e('0x52')](_0x53fc1e)[_0x426e('0x2f')](handleEntityNotFound(_0x3b65cb,null))['then'](respondWithResult(_0x3b65cb,null))[_0x426e('0x23')](handleError(_0x3b65cb,null));};exports[_0x426e('0x53')]=function(_0x24d0f7,_0x322c44){return db[_0x426e('0x36')][_0x426e('0x53')](_0x24d0f7['body'],{})[_0x426e('0x2f')](respondWithResult(_0x322c44,0xc9))[_0x426e('0x23')](handleError(_0x322c44,null));};exports['update']=function(_0x366bf4,_0x4e3837){if(_0x366bf4[_0x426e('0x54')]['id']){delete _0x366bf4[_0x426e('0x54')]['id'];}return db['ServicenowConfiguration'][_0x426e('0x52')]({'where':{'id':_0x366bf4[_0x426e('0x50')]['id']}})[_0x426e('0x2f')](handleEntityNotFound(_0x4e3837,null))['then'](saveUpdates(_0x366bf4[_0x426e('0x54')],null))[_0x426e('0x2f')](respondWithResult(_0x4e3837,null))[_0x426e('0x23')](handleError(_0x4e3837,null));};exports[_0x426e('0x55')]=function(_0x47ca7d,_0x2f4ec9){return db[_0x426e('0x36')][_0x426e('0x52')]({'where':{'id':_0x47ca7d[_0x426e('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f4ec9,null))[_0x426e('0x2f')](removeEntity(_0x2f4ec9,null))[_0x426e('0x23')](handleError(_0x2f4ec9,null));};exports[_0x426e('0x56')]=function(_0x33ebaf,_0x27ac95,_0x38f39a){var _0x348190={};var _0x495faf={};var _0x1392e2;var _0x5402a7;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x33ebaf[_0x426e('0x50')]['id']}})[_0x426e('0x2f')](handleEntityNotFound(_0x27ac95,null))['then'](function(_0x8ddabe){if(_0x8ddabe){_0x1392e2=_0x8ddabe;_0x495faf[_0x426e('0x3a')]=_[_0x426e('0x3c')](db[_0x426e('0x57')][_0x426e('0x37')]);_0x495faf[_0x426e('0x3b')]=_[_0x426e('0x3c')](_0x33ebaf[_0x426e('0x3b')]);_0x495faf[_0x426e('0x3d')]=_['intersection'](_0x495faf[_0x426e('0x3a')],_0x495faf['query']);_0x348190[_0x426e('0x3f')]=_[_0x426e('0x3e')](_0x495faf[_0x426e('0x3a')],qs[_0x426e('0x40')](_0x33ebaf['query']['fields']));_0x348190[_0x426e('0x3f')]=_0x348190[_0x426e('0x3f')][_0x426e('0x41')]?_0x348190[_0x426e('0x3f')]:_0x495faf[_0x426e('0x3a')];_0x348190['order']=qs[_0x426e('0x45')](_0x33ebaf[_0x426e('0x3b')][_0x426e('0x45')]);_0x348190[_0x426e('0x46')]=qs[_0x426e('0x3d')](_['pick'](_0x33ebaf[_0x426e('0x3b')],_0x495faf[_0x426e('0x3d')]));if(_0x33ebaf[_0x426e('0x3b')][_0x426e('0x47')]){_0x348190[_0x426e('0x46')]=_['merge'](_0x348190[_0x426e('0x46')],{'$or':_[_0x426e('0x35')](_0x348190['attributes'],function(_0xf91b36){var _0xbb6aba={};_0xbb6aba[_0xf91b36]={'$like':'%'+_0x33ebaf[_0x426e('0x3b')][_0x426e('0x47')]+'%'};return _0xbb6aba;})});}_0x348190=_[_0x426e('0x51')]({},_0x348190,_0x33ebaf[_0x426e('0x4a')]);return _0x1392e2[_0x426e('0x56')](_0x348190);}})[_0x426e('0x2f')](function(_0x94f252){if(_0x94f252){_0x5402a7=_0x94f252[_0x426e('0x41')];if(!_0x33ebaf[_0x426e('0x3b')][_0x426e('0x42')]('nolimit')){_0x348190['limit']=qs[_0x426e('0x29')](_0x33ebaf['query'][_0x426e('0x29')]);_0x348190[_0x426e('0x28')]=qs['offset'](_0x33ebaf['query']['offset']);}return _0x1392e2[_0x426e('0x56')](_0x348190);}})[_0x426e('0x2f')](function(_0x3d25ba){if(_0x3d25ba){return _0x3d25ba?{'count':_0x5402a7,'rows':_0x3d25ba}:null;}})[_0x426e('0x2f')](respondWithResult(_0x27ac95,null))[_0x426e('0x23')](handleError(_0x27ac95,null));};exports[_0x426e('0x58')]=function(_0x2a3818,_0x31532a,_0x481dba){var _0x1fa8a6={};var _0x22bd02={};var _0x173fb8;var _0x5f067a;return db[_0x426e('0x36')]['findOne']({'where':{'id':_0x2a3818[_0x426e('0x50')]['id']}})[_0x426e('0x2f')](handleEntityNotFound(_0x31532a,null))[_0x426e('0x2f')](function(_0x40de3a){if(_0x40de3a){_0x173fb8=_0x40de3a;_0x22bd02[_0x426e('0x3a')]=_[_0x426e('0x3c')](db[_0x426e('0x57')]['rawAttributes']);_0x22bd02[_0x426e('0x3b')]=_[_0x426e('0x3c')](_0x2a3818[_0x426e('0x3b')]);_0x22bd02[_0x426e('0x3d')]=_[_0x426e('0x3e')](_0x22bd02['model'],_0x22bd02['query']);_0x1fa8a6['attributes']=_['intersection'](_0x22bd02[_0x426e('0x3a')],qs[_0x426e('0x40')](_0x2a3818[_0x426e('0x3b')][_0x426e('0x40')]));_0x1fa8a6[_0x426e('0x3f')]=_0x1fa8a6['attributes'][_0x426e('0x41')]?_0x1fa8a6[_0x426e('0x3f')]:_0x22bd02[_0x426e('0x3a')];_0x1fa8a6['order']=qs[_0x426e('0x45')](_0x2a3818[_0x426e('0x3b')][_0x426e('0x45')]);_0x1fa8a6[_0x426e('0x46')]=qs[_0x426e('0x3d')](_[_0x426e('0x59')](_0x2a3818[_0x426e('0x3b')],_0x22bd02[_0x426e('0x3d')]));if(_0x2a3818[_0x426e('0x3b')][_0x426e('0x47')]){_0x1fa8a6[_0x426e('0x46')]=_[_0x426e('0x51')](_0x1fa8a6[_0x426e('0x46')],{'$or':_[_0x426e('0x35')](_0x1fa8a6[_0x426e('0x3f')],function(_0x1a9053){var _0x228db9={};_0x228db9[_0x1a9053]={'$like':'%'+_0x2a3818[_0x426e('0x3b')][_0x426e('0x47')]+'%'};return _0x228db9;})});}_0x1fa8a6=_['merge']({},_0x1fa8a6,_0x2a3818[_0x426e('0x4a')]);return _0x173fb8[_0x426e('0x58')](_0x1fa8a6);}})[_0x426e('0x2f')](function(_0xc0355b){if(_0xc0355b){_0x5f067a=_0xc0355b[_0x426e('0x41')];if(!_0x2a3818['query']['hasOwnProperty'](_0x426e('0x43'))){_0x1fa8a6[_0x426e('0x29')]=qs[_0x426e('0x29')](_0x2a3818['query']['limit']);_0x1fa8a6[_0x426e('0x28')]=qs['offset'](_0x2a3818[_0x426e('0x3b')][_0x426e('0x28')]);}return _0x173fb8[_0x426e('0x58')](_0x1fa8a6);}})[_0x426e('0x2f')](function(_0x286b41){if(_0x286b41){return _0x286b41?{'count':_0x5f067a,'rows':_0x286b41}:null;}})[_0x426e('0x2f')](respondWithResult(_0x31532a,null))['catch'](handleError(_0x31532a,null));};exports[_0x426e('0x5a')]=function(_0x980c33,_0x34444b,_0x36b5ca){var _0x55498e={};var _0x2341e5={};var _0x369081;var _0x2b88cb;return db[_0x426e('0x36')][_0x426e('0x5b')]({'where':{'id':_0x980c33[_0x426e('0x50')]['id']}})[_0x426e('0x2f')](handleEntityNotFound(_0x34444b,null))['then'](function(_0x374ac0){if(_0x374ac0){_0x369081=_0x374ac0;_0x2341e5[_0x426e('0x3a')]=_[_0x426e('0x3c')](db[_0x426e('0x57')]['rawAttributes']);_0x2341e5[_0x426e('0x3b')]=_[_0x426e('0x3c')](_0x980c33[_0x426e('0x3b')]);_0x2341e5[_0x426e('0x3d')]=_['intersection'](_0x2341e5[_0x426e('0x3a')],_0x2341e5[_0x426e('0x3b')]);_0x55498e[_0x426e('0x3f')]=_[_0x426e('0x3e')](_0x2341e5[_0x426e('0x3a')],qs[_0x426e('0x40')](_0x980c33[_0x426e('0x3b')]['fields']));_0x55498e[_0x426e('0x3f')]=_0x55498e[_0x426e('0x3f')][_0x426e('0x41')]?_0x55498e[_0x426e('0x3f')]:_0x2341e5[_0x426e('0x3a')];_0x55498e['order']=qs[_0x426e('0x45')](_0x980c33[_0x426e('0x3b')][_0x426e('0x45')]);_0x55498e[_0x426e('0x46')]=qs[_0x426e('0x3d')](_['pick'](_0x980c33[_0x426e('0x3b')],_0x2341e5[_0x426e('0x3d')]));if(_0x980c33['query']['filter']){_0x55498e[_0x426e('0x46')]=_['merge'](_0x55498e[_0x426e('0x46')],{'$or':_[_0x426e('0x35')](_0x55498e['attributes'],function(_0x4ef285){var _0x543025={};_0x543025[_0x4ef285]={'$like':'%'+_0x980c33[_0x426e('0x3b')][_0x426e('0x47')]+'%'};return _0x543025;})});}_0x55498e=_['merge']({},_0x55498e,_0x980c33[_0x426e('0x4a')]);return _0x369081[_0x426e('0x5a')](_0x55498e);}})['then'](function(_0xdc8149){if(_0xdc8149){_0x2b88cb=_0xdc8149[_0x426e('0x41')];if(!_0x980c33['query'][_0x426e('0x42')]('nolimit')){_0x55498e['limit']=qs[_0x426e('0x29')](_0x980c33[_0x426e('0x3b')]['limit']);_0x55498e[_0x426e('0x28')]=qs[_0x426e('0x28')](_0x980c33[_0x426e('0x3b')][_0x426e('0x28')]);}return _0x369081[_0x426e('0x5a')](_0x55498e);}})[_0x426e('0x2f')](function(_0x53e974){if(_0x53e974){return _0x53e974?{'count':_0x2b88cb,'rows':_0x53e974}:null;}})[_0x426e('0x2f')](respondWithResult(_0x34444b,null))['catch'](handleError(_0x34444b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index cf935ce..c86e0d0 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 _0xb039=['bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb039,0x120));var _0x9b03=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0xb039[_0x4884a7];return _0x56b60e;};'use strict';var _=require('lodash');var util=require(_0x9b03('0x0'));var logger=require(_0x9b03('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9b03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b03('0x3'));var rimraf=require('rimraf');var config=require(_0x9b03('0x4'));var attributes=require(_0x9b03('0x5'));module[_0x9b03('0x6')]=function(_0x3757b5,_0x5a41e2){return _0x3757b5[_0x9b03('0x7')](_0x9b03('0x8'),attributes,{'tableName':_0x9b03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dda=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment'];(function(_0x9cc583,_0x362bc2){var _0xa1d4d6=function(_0x1035f0){while(--_0x1035f0){_0x9cc583['push'](_0x9cc583['shift']());}};_0xa1d4d6(++_0x362bc2);}(_0x5dda,0xed));var _0xa5dd=function(_0x2df559,_0xeeea86){_0x2df559=_0x2df559-0x0;var _0x2efb05=_0x5dda[_0x2df559];return _0x2efb05;};'use strict';var _=require(_0xa5dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa5dd('0x1'));var moment=require(_0xa5dd('0x2'));var BPromise=require(_0xa5dd('0x3'));var rp=require(_0xa5dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5dd('0x5'));var config=require(_0xa5dd('0x6'));var attributes=require(_0xa5dd('0x7'));module[_0xa5dd('0x8')]=function(_0x5c4d56,_0x30b474){return _0x5c4d56[_0xa5dd('0x9')](_0xa5dd('0xa'),attributes,{'tableName':_0xa5dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 3323c82..b58dc43 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 _0xa236=['jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x524db3,_0x5dc6ca){var _0x412e22=function(_0x313563){while(--_0x313563){_0x524db3['push'](_0x524db3['shift']());}};_0x412e22(++_0x5dc6ca);}(_0xa236,0x16e));var _0x6a23=function(_0x458583,_0x56c737){_0x458583=_0x458583-0x0;var _0x53ef78=_0xa236[_0x458583];return _0x53ef78;};'use strict';var _=require(_0x6a23('0x0'));var util=require('util');var moment=require(_0x6a23('0x1'));var BPromise=require(_0x6a23('0x2'));var rs=require(_0x6a23('0x3'));var fs=require('fs');var Redis=require(_0x6a23('0x4'));var db=require(_0x6a23('0x5'))['db'];var utils=require(_0x6a23('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6a23('0x7'));var jayson=require(_0x6a23('0x8'));var client=jayson[_0x6a23('0x9')][_0x6a23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54bfab,_0xfd2d69,_0x2a627d){return new BPromise(function(_0x28029b,_0x452154){return client['request'](_0x54bfab,_0x2a627d)[_0x6a23('0xb')](function(_0x4071f8){logger[_0x6a23('0xc')](_0x6a23('0xd'),_0xfd2d69,_0x6a23('0xe'));logger[_0x6a23('0xf')](_0x6a23('0x10'),_0xfd2d69,_0x6a23('0xe'),JSON['stringify'](_0x4071f8));if(_0x4071f8[_0x6a23('0x11')]){if(_0x4071f8[_0x6a23('0x11')][_0x6a23('0x12')]===0x1f4){logger[_0x6a23('0x11')](_0x6a23('0xd'),_0xfd2d69,_0x4071f8[_0x6a23('0x11')][_0x6a23('0x13')]);return _0x452154(_0x4071f8['error']['message']);}logger[_0x6a23('0x11')](_0x6a23('0xd'),_0xfd2d69,_0x4071f8[_0x6a23('0x11')]['message']);return _0x28029b(_0x4071f8['error']['message']);}else{logger[_0x6a23('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0xfd2d69,_0x6a23('0xe'));_0x28029b(_0x4071f8[_0x6a23('0x14')][_0x6a23('0x13')]);}})[_0x6a23('0x15')](function(_0x159670){logger[_0x6a23('0x11')](_0x6a23('0xd'),_0xfd2d69,_0x159670);_0x452154(_0x159670);});});} \ No newline at end of file +var _0xc2dc=['info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x51c78e,_0x1cb06e){var _0x28f118=function(_0x2d4d61){while(--_0x2d4d61){_0x51c78e['push'](_0x51c78e['shift']());}};_0x28f118(++_0x1cb06e);}(_0xc2dc,0x1e5));var _0xcc2d=function(_0x1ba19c,_0x3975e2){_0x1ba19c=_0x1ba19c-0x0;var _0x4e069b=_0xc2dc[_0x1ba19c];return _0x4e069b;};'use strict';var _=require(_0xcc2d('0x0'));var util=require(_0xcc2d('0x1'));var moment=require(_0xcc2d('0x2'));var BPromise=require(_0xcc2d('0x3'));var rs=require(_0xcc2d('0x4'));var fs=require('fs');var Redis=require(_0xcc2d('0x5'));var db=require(_0xcc2d('0x6'))['db'];var utils=require(_0xcc2d('0x7'));var logger=require(_0xcc2d('0x8'))(_0xcc2d('0x9'));var config=require(_0xcc2d('0xa'));var jayson=require(_0xcc2d('0xb'));var client=jayson[_0xcc2d('0xc')][_0xcc2d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x534323,_0x18745f,_0x23d255){return new BPromise(function(_0x573018,_0x2e2a20){return client[_0xcc2d('0xe')](_0x534323,_0x23d255)['then'](function(_0x55451e){logger[_0xcc2d('0xf')](_0xcc2d('0x10'),_0x18745f,'request\x20sent');logger[_0xcc2d('0x11')](_0xcc2d('0x12'),_0x18745f,_0xcc2d('0x13'),JSON[_0xcc2d('0x14')](_0x55451e));if(_0x55451e[_0xcc2d('0x15')]){if(_0x55451e['error'][_0xcc2d('0x16')]===0x1f4){logger['error'](_0xcc2d('0x10'),_0x18745f,_0x55451e[_0xcc2d('0x15')][_0xcc2d('0x17')]);return _0x2e2a20(_0x55451e['error'][_0xcc2d('0x17')]);}logger[_0xcc2d('0x15')](_0xcc2d('0x10'),_0x18745f,_0x55451e[_0xcc2d('0x15')][_0xcc2d('0x17')]);return _0x573018(_0x55451e[_0xcc2d('0x15')][_0xcc2d('0x17')]);}else{logger['info'](_0xcc2d('0x10'),_0x18745f,_0xcc2d('0x13'));_0x573018(_0x55451e[_0xcc2d('0x18')]['message']);}})['catch'](function(_0x106f1a){logger[_0xcc2d('0x15')](_0xcc2d('0x10'),_0x18745f,_0x106f1a);_0x2e2a20(_0x106f1a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7cc0ca4..4ed7aae 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 _0x7d42=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d42,0x149));var _0x27d4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7d42[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x27d4('0x0'));var util=require(_0x27d4('0x1'));var path=require(_0x27d4('0x2'));var timeout=require(_0x27d4('0x3'));var express=require(_0x27d4('0x4'));var router=express[_0x27d4('0x5')]();var auth=require(_0x27d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x27d4('0x7'));var controller=require(_0x27d4('0x8'));router[_0x27d4('0x9')]('/',auth[_0x27d4('0xa')](),controller[_0x27d4('0xb')]);router[_0x27d4('0x9')](_0x27d4('0xc'),auth[_0x27d4('0xa')](),controller[_0x27d4('0xd')]);router[_0x27d4('0xe')]('/',auth['isAuthenticated'](),controller[_0x27d4('0xf')]);router['put'](_0x27d4('0xc'),auth[_0x27d4('0xa')](),controller[_0x27d4('0x10')]);router[_0x27d4('0x11')]('/:id',auth[_0x27d4('0xa')](),controller['destroy']);module[_0x27d4('0x12')]=router; \ No newline at end of file +var _0xc4b3=['/:id','update','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put'];(function(_0x59420a,_0x2a786d){var _0x281b73=function(_0x5e6454){while(--_0x5e6454){_0x59420a['push'](_0x59420a['shift']());}};_0x281b73(++_0x2a786d);}(_0xc4b3,0x9c));var _0x3c4b=function(_0xac222b,_0x1c98b7){_0xac222b=_0xac222b-0x0;var _0x2f3e79=_0xc4b3[_0xac222b];return _0x2f3e79;};'use strict';var multer=require('multer');var util=require(_0x3c4b('0x0'));var path=require('path');var timeout=require(_0x3c4b('0x1'));var express=require(_0x3c4b('0x2'));var router=express[_0x3c4b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3c4b('0x4'));var config=require(_0x3c4b('0x5'));var controller=require('./intServicenowField.controller');router[_0x3c4b('0x6')]('/',auth[_0x3c4b('0x7')](),controller[_0x3c4b('0x8')]);router['get']('/:id',auth[_0x3c4b('0x7')](),controller[_0x3c4b('0x9')]);router['post']('/',auth[_0x3c4b('0x7')](),controller[_0x3c4b('0xa')]);router[_0x3c4b('0xb')](_0x3c4b('0xc'),auth['isAuthenticated'](),controller[_0x3c4b('0xd')]);router['delete'](_0x3c4b('0xc'),auth[_0x3c4b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ec6cdd1..734a16e 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 _0xbeae=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x15db33,_0x24d75c){var _0xaa18ae=function(_0x2525d2){while(--_0x2525d2){_0x15db33['push'](_0x15db33['shift']());}};_0xaa18ae(++_0x24d75c);}(_0xbeae,0x1cd));var _0xebea=function(_0x5f49bc,_0x548555){_0x5f49bc=_0x5f49bc-0x0;var _0x44bbb9=_0xbeae[_0x5f49bc];return _0x44bbb9;};'use strict';var Sequelize=require(_0xebea('0x0'));module[_0xebea('0x1')]={'type':{'type':Sequelize['ENUM'](_0xebea('0x2'),_0xebea('0x3'),_0xebea('0x4'),_0xebea('0x5')),'defaultValue':_0xebea('0x2')},'content':{'type':Sequelize[_0xebea('0x6')]},'key':{'type':Sequelize[_0xebea('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xebea('0x2'),_0xebea('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xebea('0x6')]},'idField':{'type':Sequelize[_0xebea('0x6')]},'nameField':{'type':Sequelize[_0xebea('0x6')]},'customField':{'type':Sequelize[_0xebea('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xebea('0x6')]}}; \ No newline at end of file +var _0x79d3=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x570c8a,_0x4a11cc){var _0x25dc12=function(_0x4585d9){while(--_0x4585d9){_0x570c8a['push'](_0x570c8a['shift']());}};_0x25dc12(++_0x4a11cc);}(_0x79d3,0x179));var _0x379d=function(_0x32f3bc,_0x2b5218){_0x32f3bc=_0x32f3bc-0x0;var _0x3f8cc2=_0x79d3[_0x32f3bc];return _0x3f8cc2;};'use strict';var Sequelize=require(_0x379d('0x0'));module[_0x379d('0x1')]={'type':{'type':Sequelize[_0x379d('0x2')](_0x379d('0x3'),_0x379d('0x4'),_0x379d('0x5'),'keyValue'),'defaultValue':_0x379d('0x3')},'content':{'type':Sequelize[_0x379d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x379d('0x3'),_0x379d('0x4'),_0x379d('0x5'))},'keyContent':{'type':Sequelize[_0x379d('0x6')]},'idField':{'type':Sequelize[_0x379d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x379d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x379d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index da280df..1136ff2 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 _0x8db5=['find','catch','create','body','destroy','html-pdf','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','reject','save','update','then','error','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','pick','where','VIRTUAL','filter','options','ServicenowField','includeAll','show','params','rawAttributes','merge'];(function(_0x396642,_0x3b090d){var _0x2fb353=function(_0x21ffe2){while(--_0x21ffe2){_0x396642['push'](_0x396642['shift']());}};_0x2fb353(++_0x3b090d);}(_0x8db5,0xc5));var _0x58db=function(_0x2ba00c,_0x10f136){_0x2ba00c=_0x2ba00c-0x0;var _0x4a4853=_0x8db5[_0x2ba00c];return _0x4a4853;};'use strict';var pdf=require(_0x58db('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x58db('0x1'));var zipdir=require(_0x58db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x58db('0x3'));var Mustache=require(_0x58db('0x4'));var util=require(_0x58db('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x58db('0x6'));var ejs=require(_0x58db('0x7'));var fs=require('fs');var _=require(_0x58db('0x8'));var squel=require(_0x58db('0x9'));var crypto=require(_0x58db('0xa'));var jsforce=require(_0x58db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x58db('0x6'));var querystring=require(_0x58db('0xc'));var Papa=require('papaparse');var Redis=require(_0x58db('0xd'));var authService=require(_0x58db('0xe'));var qs=require(_0x58db('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58db('0x10'))('api');var utils=require(_0x58db('0x11'));var config=require(_0x58db('0x12'));var db=require(_0x58db('0x13'))['db'];function respondWithStatusCode(_0x5862c7,_0x9a974a){_0x9a974a=_0x9a974a||0xcc;return function(_0x2c1d00){if(_0x2c1d00){return _0x5862c7[_0x58db('0x14')](_0x9a974a);}return _0x5862c7[_0x58db('0x15')](_0x9a974a)[_0x58db('0x16')]();};}function respondWithResult(_0x295bc2,_0x58cc0b){_0x58cc0b=_0x58cc0b||0xc8;return function(_0x19b642){if(_0x19b642){return _0x295bc2['status'](_0x58cc0b)[_0x58db('0x17')](_0x19b642);}};}function respondWithFilteredResult(_0x2b407d,_0x1ce8c4){return function(_0x3d281a){if(_0x3d281a){var _0x1deee9=_0x3d281a[_0x58db('0x18')],_0x5928bd=_0x1ce8c4['offset'],_0x153581=_0x1ce8c4['offset']+_0x1ce8c4[_0x58db('0x19')],_0x293608;if(_0x153581>=_0x1deee9){_0x153581=_0x1deee9;_0x293608=0xc8;}else{_0x293608=0xce;}_0x2b407d[_0x58db('0x15')](_0x293608);return _0x2b407d['set'](_0x58db('0x1a'),_0x5928bd+'-'+_0x153581+'/'+_0x1deee9)[_0x58db('0x17')](_0x3d281a);}return null;};}function patchUpdates(_0x4e5de8){return function(_0x3b2491){try{jsonpatch['apply'](_0x3b2491,_0x4e5de8,!![]);}catch(_0x1c94a1){return BPromise[_0x58db('0x1b')](_0x1c94a1);}return _0x3b2491[_0x58db('0x1c')]();};}function saveUpdates(_0x2c738f,_0x57fee1){return function(_0x133c88){if(_0x133c88){return _0x133c88[_0x58db('0x1d')](_0x2c738f)[_0x58db('0x1e')](function(_0x306af2){return _0x306af2;});}return null;};}function removeEntity(_0x2a2178,_0x391b65){return function(_0x3d7e83){if(_0x3d7e83){return _0x3d7e83['destroy']()[_0x58db('0x1e')](function(){_0x2a2178[_0x58db('0x15')](0xcc)[_0x58db('0x16')]();});}};}function handleEntityNotFound(_0x1ef1d9,_0x3d8fa3){return function(_0x24f9ef){if(!_0x24f9ef){_0x1ef1d9[_0x58db('0x14')](0x194);}return _0x24f9ef;};}function handleError(_0x34a333,_0x3c473a){_0x3c473a=_0x3c473a||0x1f4;return function(_0x407c07){logger[_0x58db('0x1f')](_0x407c07['stack']);if(_0x407c07[_0x58db('0x20')]){delete _0x407c07[_0x58db('0x20')];}_0x34a333[_0x58db('0x15')](_0x3c473a)['send'](_0x407c07);};}exports[_0x58db('0x21')]=function(_0x3f126b,_0x2e0667){var _0x46f448={},_0x54eec0={},_0x15318b={'count':0x0,'rows':[]};var _0x3a85ea=_[_0x58db('0x22')](db['ServicenowField']['rawAttributes'],function(_0x4d9434){return{'name':_0x4d9434[_0x58db('0x23')],'type':_0x4d9434[_0x58db('0x24')]['key']};});_0x54eec0[_0x58db('0x25')]=_[_0x58db('0x22')](_0x3a85ea,'name');_0x54eec0[_0x58db('0x26')]=_[_0x58db('0x27')](_0x3f126b[_0x58db('0x26')]);_0x54eec0[_0x58db('0x28')]=_[_0x58db('0x29')](_0x54eec0[_0x58db('0x25')],_0x54eec0[_0x58db('0x26')]);_0x46f448[_0x58db('0x2a')]=_[_0x58db('0x29')](_0x54eec0[_0x58db('0x25')],qs[_0x58db('0x2b')](_0x3f126b[_0x58db('0x26')][_0x58db('0x2b')]));_0x46f448[_0x58db('0x2a')]=_0x46f448[_0x58db('0x2a')][_0x58db('0x2c')]?_0x46f448['attributes']:_0x54eec0['model'];if(!_0x3f126b['query']['hasOwnProperty'](_0x58db('0x2d'))){_0x46f448['limit']=qs[_0x58db('0x19')](_0x3f126b[_0x58db('0x26')][_0x58db('0x19')]);_0x46f448['offset']=qs[_0x58db('0x2e')](_0x3f126b['query'][_0x58db('0x2e')]);}_0x46f448['order']=qs['sort'](_0x3f126b[_0x58db('0x26')][_0x58db('0x2f')]);_0x46f448['where']=qs[_0x58db('0x28')](_[_0x58db('0x30')](_0x3f126b['query'],_0x54eec0[_0x58db('0x28')]));if(_0x3f126b[_0x58db('0x26')]['filter']){_0x46f448[_0x58db('0x31')]=_['merge'](_0x46f448[_0x58db('0x31')],{'$or':_[_0x58db('0x22')](_0x3a85ea,function(_0x219cfb){if(_0x219cfb[_0x58db('0x24')]!==_0x58db('0x32')){var _0x38ba84={};_0x38ba84[_0x219cfb[_0x58db('0x20')]]={'$like':'%'+_0x3f126b['query'][_0x58db('0x33')]+'%'};return _0x38ba84;}})});}_0x46f448=_['merge']({},_0x46f448,_0x3f126b[_0x58db('0x34')]);var _0xb4f532={'where':_0x46f448['where']};return db[_0x58db('0x35')][_0x58db('0x18')](_0xb4f532)['then'](function(_0x433812){_0x15318b[_0x58db('0x18')]=_0x433812;if(_0x3f126b[_0x58db('0x26')][_0x58db('0x36')]){_0x46f448['include']=[{'all':!![]}];}return db[_0x58db('0x35')]['findAll'](_0x46f448);})[_0x58db('0x1e')](function(_0x747a1e){_0x15318b['rows']=_0x747a1e;return _0x15318b;})[_0x58db('0x1e')](respondWithFilteredResult(_0x2e0667,_0x46f448))['catch'](handleError(_0x2e0667,null));};exports[_0x58db('0x37')]=function(_0x59c5a1,_0x222f44){var _0x188d0b={'raw':!![],'where':{'id':_0x59c5a1[_0x58db('0x38')]['id']}},_0x35373e={};_0x35373e[_0x58db('0x25')]=_[_0x58db('0x27')](db[_0x58db('0x35')][_0x58db('0x39')]);_0x35373e[_0x58db('0x26')]=_[_0x58db('0x27')](_0x59c5a1[_0x58db('0x26')]);_0x35373e[_0x58db('0x28')]=_['intersection'](_0x35373e[_0x58db('0x25')],_0x35373e[_0x58db('0x26')]);_0x188d0b[_0x58db('0x2a')]=_[_0x58db('0x29')](_0x35373e[_0x58db('0x25')],qs['fields'](_0x59c5a1[_0x58db('0x26')][_0x58db('0x2b')]));_0x188d0b[_0x58db('0x2a')]=_0x188d0b[_0x58db('0x2a')][_0x58db('0x2c')]?_0x188d0b['attributes']:_0x35373e[_0x58db('0x25')];if(_0x59c5a1[_0x58db('0x26')]['includeAll']){_0x188d0b['include']=[{'all':!![]}];}_0x188d0b=_[_0x58db('0x3a')]({},_0x188d0b,_0x59c5a1[_0x58db('0x34')]);return db[_0x58db('0x35')][_0x58db('0x3b')](_0x188d0b)[_0x58db('0x1e')](handleEntityNotFound(_0x222f44,null))[_0x58db('0x1e')](respondWithResult(_0x222f44,null))[_0x58db('0x3c')](handleError(_0x222f44,null));};exports[_0x58db('0x3d')]=function(_0x3aff64,_0x6b3c03){return db[_0x58db('0x35')][_0x58db('0x3d')](_0x3aff64[_0x58db('0x3e')],{})[_0x58db('0x1e')](respondWithResult(_0x6b3c03,0xc9))[_0x58db('0x3c')](handleError(_0x6b3c03,null));};exports[_0x58db('0x1d')]=function(_0x23283f,_0x543d75){if(_0x23283f[_0x58db('0x3e')]['id']){delete _0x23283f[_0x58db('0x3e')]['id'];}return db['ServicenowField'][_0x58db('0x3b')]({'where':{'id':_0x23283f[_0x58db('0x38')]['id']}})[_0x58db('0x1e')](handleEntityNotFound(_0x543d75,null))[_0x58db('0x1e')](saveUpdates(_0x23283f[_0x58db('0x3e')],null))['then'](respondWithResult(_0x543d75,null))[_0x58db('0x3c')](handleError(_0x543d75,null));};exports[_0x58db('0x3f')]=function(_0x1aaed3,_0x469e62){return db['ServicenowField'][_0x58db('0x3b')]({'where':{'id':_0x1aaed3['params']['id']}})[_0x58db('0x1e')](handleEntityNotFound(_0x469e62,null))['then'](removeEntity(_0x469e62,null))[_0x58db('0x3c')](handleError(_0x469e62,null));}; \ No newline at end of file +var _0xc82e=['reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','catch','params','ServicenowField','keys','includeAll','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xc82e,0x139));var _0xec82=function(_0x19b9f9,_0x53cf2e){_0x19b9f9=_0x19b9f9-0x0;var _0xdb7424=_0xc82e[_0x19b9f9];return _0xdb7424;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xec82('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec82('0x1'));var rp=require(_0xec82('0x2'));var moment=require(_0xec82('0x3'));var BPromise=require(_0xec82('0x4'));var Mustache=require('mustache');var util=require(_0xec82('0x5'));var path=require(_0xec82('0x6'));var sox=require('sox');var csv=require(_0xec82('0x7'));var ejs=require(_0xec82('0x8'));var fs=require('fs');var _=require(_0xec82('0x9'));var squel=require(_0xec82('0xa'));var crypto=require(_0xec82('0xb'));var jsforce=require(_0xec82('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xec82('0x7'));var querystring=require(_0xec82('0xd'));var Papa=require(_0xec82('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec82('0xf'));var as=require(_0xec82('0x10'));var hardwareService=require(_0xec82('0x11'));var logger=require('../../config/logger')(_0xec82('0x12'));var utils=require(_0xec82('0x13'));var config=require(_0xec82('0x14'));var db=require(_0xec82('0x15'))['db'];function respondWithStatusCode(_0x2c8f01,_0x3b53b4){_0x3b53b4=_0x3b53b4||0xcc;return function(_0x43e057){if(_0x43e057){return _0x2c8f01[_0xec82('0x16')](_0x3b53b4);}return _0x2c8f01[_0xec82('0x17')](_0x3b53b4)[_0xec82('0x18')]();};}function respondWithResult(_0x2df5a0,_0x2e14fa){_0x2e14fa=_0x2e14fa||0xc8;return function(_0x25579a){if(_0x25579a){return _0x2df5a0['status'](_0x2e14fa)[_0xec82('0x19')](_0x25579a);}};}function respondWithFilteredResult(_0x12be67,_0x1026e6){return function(_0x68fb86){if(_0x68fb86){var _0xdc9a3c=_0x68fb86[_0xec82('0x1a')],_0x42e73f=_0x1026e6[_0xec82('0x1b')],_0x6a61fe=_0x1026e6[_0xec82('0x1b')]+_0x1026e6[_0xec82('0x1c')],_0x45d2e3;if(_0x6a61fe>=_0xdc9a3c){_0x6a61fe=_0xdc9a3c;_0x45d2e3=0xc8;}else{_0x45d2e3=0xce;}_0x12be67['status'](_0x45d2e3);return _0x12be67[_0xec82('0x1d')](_0xec82('0x1e'),_0x42e73f+'-'+_0x6a61fe+'/'+_0xdc9a3c)[_0xec82('0x19')](_0x68fb86);}return null;};}function patchUpdates(_0x1d3ed9){return function(_0x1823ff){try{jsonpatch[_0xec82('0x1f')](_0x1823ff,_0x1d3ed9,!![]);}catch(_0x2aedb3){return BPromise[_0xec82('0x20')](_0x2aedb3);}return _0x1823ff['save']();};}function saveUpdates(_0x977e64,_0x26e618){return function(_0x5917af){if(_0x5917af){return _0x5917af['update'](_0x977e64)[_0xec82('0x21')](function(_0x18b568){return _0x18b568;});}return null;};}function removeEntity(_0x4305c0,_0x82615e){return function(_0x4a4771){if(_0x4a4771){return _0x4a4771[_0xec82('0x22')]()[_0xec82('0x21')](function(){_0x4305c0[_0xec82('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x677d5e,_0x9c1563){return function(_0x354428){if(!_0x354428){_0x677d5e[_0xec82('0x16')](0x194);}return _0x354428;};}function handleError(_0x1ca0d5,_0x9888d5){_0x9888d5=_0x9888d5||0x1f4;return function(_0xc8e8ef){logger[_0xec82('0x23')](_0xc8e8ef['stack']);if(_0xc8e8ef[_0xec82('0x24')]){delete _0xc8e8ef[_0xec82('0x24')];}_0x1ca0d5[_0xec82('0x17')](_0x9888d5)[_0xec82('0x25')](_0xc8e8ef);};}exports[_0xec82('0x26')]=function(_0x18b0ca,_0x32bc5e){var _0x45f3a8={},_0x29c108={},_0x15c2a2={'count':0x0,'rows':[]};var _0x4c1a9e=_[_0xec82('0x27')](db['ServicenowField'][_0xec82('0x28')],function(_0x1e77b6){return{'name':_0x1e77b6[_0xec82('0x29')],'type':_0x1e77b6[_0xec82('0x2a')][_0xec82('0x2b')]};});_0x29c108[_0xec82('0x2c')]=_[_0xec82('0x27')](_0x4c1a9e,'name');_0x29c108['query']=_['keys'](_0x18b0ca[_0xec82('0x2d')]);_0x29c108[_0xec82('0x2e')]=_[_0xec82('0x2f')](_0x29c108[_0xec82('0x2c')],_0x29c108[_0xec82('0x2d')]);_0x45f3a8[_0xec82('0x30')]=_['intersection'](_0x29c108[_0xec82('0x2c')],qs[_0xec82('0x31')](_0x18b0ca['query'][_0xec82('0x31')]));_0x45f3a8[_0xec82('0x30')]=_0x45f3a8[_0xec82('0x30')][_0xec82('0x32')]?_0x45f3a8['attributes']:_0x29c108['model'];if(!_0x18b0ca[_0xec82('0x2d')]['hasOwnProperty'](_0xec82('0x33'))){_0x45f3a8[_0xec82('0x1c')]=qs[_0xec82('0x1c')](_0x18b0ca[_0xec82('0x2d')][_0xec82('0x1c')]);_0x45f3a8['offset']=qs[_0xec82('0x1b')](_0x18b0ca['query'][_0xec82('0x1b')]);}_0x45f3a8[_0xec82('0x34')]=qs['sort'](_0x18b0ca[_0xec82('0x2d')]['sort']);_0x45f3a8[_0xec82('0x35')]=qs['filters'](_[_0xec82('0x36')](_0x18b0ca[_0xec82('0x2d')],_0x29c108[_0xec82('0x2e')]));if(_0x18b0ca['query'][_0xec82('0x37')]){_0x45f3a8[_0xec82('0x35')]=_[_0xec82('0x38')](_0x45f3a8[_0xec82('0x35')],{'$or':_[_0xec82('0x27')](_0x4c1a9e,function(_0x2e0ccf){if(_0x2e0ccf[_0xec82('0x2a')]!=='VIRTUAL'){var _0x1db28c={};_0x1db28c[_0x2e0ccf[_0xec82('0x24')]]={'$like':'%'+_0x18b0ca[_0xec82('0x2d')]['filter']+'%'};return _0x1db28c;}})});}_0x45f3a8=_[_0xec82('0x38')]({},_0x45f3a8,_0x18b0ca[_0xec82('0x39')]);var _0x12e5f8={'where':_0x45f3a8[_0xec82('0x35')]};return db['ServicenowField'][_0xec82('0x1a')](_0x12e5f8)[_0xec82('0x21')](function(_0x28f122){_0x15c2a2[_0xec82('0x1a')]=_0x28f122;if(_0x18b0ca[_0xec82('0x2d')]['includeAll']){_0x45f3a8[_0xec82('0x3a')]=[{'all':!![]}];}return db['ServicenowField'][_0xec82('0x3b')](_0x45f3a8);})[_0xec82('0x21')](function(_0x21f564){_0x15c2a2[_0xec82('0x3c')]=_0x21f564;return _0x15c2a2;})[_0xec82('0x21')](respondWithFilteredResult(_0x32bc5e,_0x45f3a8))[_0xec82('0x3d')](handleError(_0x32bc5e,null));};exports['show']=function(_0x30ca87,_0x454d45){var _0x2be6de={'raw':!![],'where':{'id':_0x30ca87[_0xec82('0x3e')]['id']}},_0x3defbb={};_0x3defbb['model']=_['keys'](db[_0xec82('0x3f')]['rawAttributes']);_0x3defbb[_0xec82('0x2d')]=_[_0xec82('0x40')](_0x30ca87[_0xec82('0x2d')]);_0x3defbb[_0xec82('0x2e')]=_['intersection'](_0x3defbb[_0xec82('0x2c')],_0x3defbb['query']);_0x2be6de[_0xec82('0x30')]=_[_0xec82('0x2f')](_0x3defbb[_0xec82('0x2c')],qs['fields'](_0x30ca87['query'][_0xec82('0x31')]));_0x2be6de[_0xec82('0x30')]=_0x2be6de[_0xec82('0x30')]['length']?_0x2be6de[_0xec82('0x30')]:_0x3defbb['model'];if(_0x30ca87[_0xec82('0x2d')][_0xec82('0x41')]){_0x2be6de[_0xec82('0x3a')]=[{'all':!![]}];}_0x2be6de=_['merge']({},_0x2be6de,_0x30ca87[_0xec82('0x39')]);return db[_0xec82('0x3f')][_0xec82('0x42')](_0x2be6de)['then'](handleEntityNotFound(_0x454d45,null))[_0xec82('0x21')](respondWithResult(_0x454d45,null))[_0xec82('0x3d')](handleError(_0x454d45,null));};exports['create']=function(_0x3be05,_0x226a54){return db[_0xec82('0x3f')][_0xec82('0x43')](_0x3be05['body'],{})[_0xec82('0x21')](respondWithResult(_0x226a54,0xc9))[_0xec82('0x3d')](handleError(_0x226a54,null));};exports['update']=function(_0x273f68,_0x30be23){if(_0x273f68[_0xec82('0x44')]['id']){delete _0x273f68[_0xec82('0x44')]['id'];}return db[_0xec82('0x3f')]['find']({'where':{'id':_0x273f68[_0xec82('0x3e')]['id']}})[_0xec82('0x21')](handleEntityNotFound(_0x30be23,null))[_0xec82('0x21')](saveUpdates(_0x273f68[_0xec82('0x44')],null))['then'](respondWithResult(_0x30be23,null))[_0xec82('0x3d')](handleError(_0x30be23,null));};exports['destroy']=function(_0x2315ce,_0x1284d9){return db[_0xec82('0x3f')][_0xec82('0x42')]({'where':{'id':_0x2315ce[_0xec82('0x3e')]['id']}})[_0xec82('0x21')](handleEntityNotFound(_0x1284d9,null))['then'](removeEntity(_0x1284d9,null))[_0xec82('0x3d')](handleError(_0x1284d9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e69172f..e7c260d 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 _0x3d38=['path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x3d38,0xab));var _0x83d3=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0x3d38[_0x1d5458];return _0x9bf6f;};'use strict';var _=require(_0x83d3('0x0'));var util=require(_0x83d3('0x1'));var logger=require(_0x83d3('0x2'))('api');var moment=require(_0x83d3('0x3'));var BPromise=require('bluebird');var rp=require(_0x83d3('0x4'));var fs=require('fs');var path=require(_0x83d3('0x5'));var rimraf=require(_0x83d3('0x6'));var config=require(_0x83d3('0x7'));var attributes=require(_0x83d3('0x8'));module[_0x83d3('0x9')]=function(_0x4990e9,_0x1af317){return _0x4990e9[_0x83d3('0xa')](_0x83d3('0xb'),attributes,{'tableName':_0x83d3('0xc'),'paranoid':![],'indexes':[{'name':_0x83d3('0xd'),'fields':[_0x83d3('0xe'),_0x83d3('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa46b=['rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa46b,0xc4));var _0xba46=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa46b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xba46('0x0'));var util=require(_0xba46('0x1'));var logger=require(_0xba46('0x2'))(_0xba46('0x3'));var moment=require(_0xba46('0x4'));var BPromise=require(_0xba46('0x5'));var rp=require(_0xba46('0x6'));var fs=require('fs');var path=require(_0xba46('0x7'));var rimraf=require(_0xba46('0x8'));var config=require(_0xba46('0x9'));var attributes=require('./intServicenowField.attributes');module[_0xba46('0xa')]=function(_0x2c22f1,_0xadfb4){return _0x2c22f1[_0xba46('0xb')](_0xba46('0xc'),attributes,{'tableName':_0xba46('0xd'),'paranoid':![],'indexes':[{'name':_0xba46('0xe'),'fields':[_0xba46('0xf'),_0xba46('0x10')],'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 813c9d0..e71c1ff 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 _0x94ec=['jayson/promise','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x94ec,0x1ac));var _0xc94e=function(_0x34fcfd,_0x44c71b){_0x34fcfd=_0x34fcfd-0x0;var _0xb7a27f=_0x94ec[_0x34fcfd];return _0xb7a27f;};'use strict';var _=require(_0xc94e('0x0'));var util=require(_0xc94e('0x1'));var moment=require(_0xc94e('0x2'));var BPromise=require(_0xc94e('0x3'));var rs=require(_0xc94e('0x4'));var fs=require('fs');var Redis=require(_0xc94e('0x5'));var db=require(_0xc94e('0x6'))['db'];var utils=require(_0xc94e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc94e('0x8'));var jayson=require(_0xc94e('0x9'));var client=jayson['client'][_0xc94e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x121472,_0x18dbda,_0x125f16){return new BPromise(function(_0x566f45,_0x18a308){return client[_0xc94e('0xb')](_0x121472,_0x125f16)['then'](function(_0x49a192){logger[_0xc94e('0xc')]('ServicenowField,\x20%s,\x20%s',_0x18dbda,_0xc94e('0xd'));logger[_0xc94e('0xe')](_0xc94e('0xf'),_0x18dbda,_0xc94e('0xd'),JSON[_0xc94e('0x10')](_0x49a192));if(_0x49a192[_0xc94e('0x11')]){if(_0x49a192[_0xc94e('0x11')][_0xc94e('0x12')]===0x1f4){logger['error'](_0xc94e('0x13'),_0x18dbda,_0x49a192[_0xc94e('0x11')][_0xc94e('0x14')]);return _0x18a308(_0x49a192[_0xc94e('0x11')][_0xc94e('0x14')]);}logger['error'](_0xc94e('0x13'),_0x18dbda,_0x49a192[_0xc94e('0x11')]['message']);return _0x566f45(_0x49a192[_0xc94e('0x11')][_0xc94e('0x14')]);}else{logger[_0xc94e('0xc')]('ServicenowField,\x20%s,\x20%s',_0x18dbda,_0xc94e('0xd'));_0x566f45(_0x49a192[_0xc94e('0x15')][_0xc94e('0x14')]);}})[_0xc94e('0x16')](function(_0x1aec53){logger['error'](_0xc94e('0x13'),_0x18dbda,_0x1aec53);_0x18a308(_0x1aec53);});});} \ No newline at end of file +var _0xdf39=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0xdf39,0xb5));var _0x9df3=function(_0x37431a,_0x4dc491){_0x37431a=_0x37431a-0x0;var _0x5e57e0=_0xdf39[_0x37431a];return _0x5e57e0;};'use strict';var _=require('lodash');var util=require(_0x9df3('0x0'));var moment=require(_0x9df3('0x1'));var BPromise=require(_0x9df3('0x2'));var rs=require(_0x9df3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9df3('0x4'))['db'];var utils=require(_0x9df3('0x5'));var logger=require(_0x9df3('0x6'))(_0x9df3('0x7'));var config=require('../../config/environment');var jayson=require(_0x9df3('0x8'));var client=jayson[_0x9df3('0x9')][_0x9df3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143a13,_0x12533c,_0x8f3da3){return new BPromise(function(_0x27ed4a,_0x2436ed){return client[_0x9df3('0xb')](_0x143a13,_0x8f3da3)[_0x9df3('0xc')](function(_0x37a275){logger['info'](_0x9df3('0xd'),_0x12533c,_0x9df3('0xe'));logger[_0x9df3('0xf')](_0x9df3('0x10'),_0x12533c,_0x9df3('0xe'),JSON[_0x9df3('0x11')](_0x37a275));if(_0x37a275[_0x9df3('0x12')]){if(_0x37a275[_0x9df3('0x12')][_0x9df3('0x13')]===0x1f4){logger[_0x9df3('0x12')](_0x9df3('0xd'),_0x12533c,_0x37a275[_0x9df3('0x12')][_0x9df3('0x14')]);return _0x2436ed(_0x37a275['error']['message']);}logger[_0x9df3('0x12')](_0x9df3('0xd'),_0x12533c,_0x37a275[_0x9df3('0x12')]['message']);return _0x27ed4a(_0x37a275[_0x9df3('0x12')]['message']);}else{logger[_0x9df3('0x15')]('ServicenowField,\x20%s,\x20%s',_0x12533c,'request\x20sent');_0x27ed4a(_0x37a275['result'][_0x9df3('0x14')]);}})[_0x9df3('0x16')](function(_0x6263ef){logger[_0x9df3('0x12')](_0x9df3('0xd'),_0x12533c,_0x6263ef);_0x2436ed(_0x6263ef);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 51ead80..839bc39 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 _0x1b1f=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','/:id/configurations','getConfigurations','get','getFields','post','create','put'];(function(_0x297ab1,_0x37bb03){var _0x58d04c=function(_0x3c299c){while(--_0x3c299c){_0x297ab1['push'](_0x297ab1['shift']());}};_0x58d04c(++_0x37bb03);}(_0x1b1f,0x16b));var _0xf1b1=function(_0x107550,_0x4710e1){_0x107550=_0x107550-0x0;var _0xbdb3d2=_0x1b1f[_0x107550];return _0xbdb3d2;};'use strict';var multer=require(_0xf1b1('0x0'));var util=require(_0xf1b1('0x1'));var path=require(_0xf1b1('0x2'));var timeout=require(_0xf1b1('0x3'));var express=require('express');var router=express[_0xf1b1('0x4')]();var auth=require(_0xf1b1('0x5'));var interaction=require(_0xf1b1('0x6'));var config=require(_0xf1b1('0x7'));var controller=require('./intSugarcrmAccount.controller');router['get']('/',auth[_0xf1b1('0x8')](),controller['index']);router['get'](_0xf1b1('0x9'),auth[_0xf1b1('0x8')](),controller['show']);router['get'](_0xf1b1('0xa'),auth['isAuthenticated'](),controller[_0xf1b1('0xb')]);router[_0xf1b1('0xc')]('/:id/fields',auth[_0xf1b1('0x8')](),controller[_0xf1b1('0xd')]);router[_0xf1b1('0xe')]('/',auth['isAuthenticated'](),controller[_0xf1b1('0xf')]);router[_0xf1b1('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xf1b1('0x10')](_0xf1b1('0x9'),auth[_0xf1b1('0x8')](),controller[_0xf1b1('0x11')]);router[_0xf1b1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf1b1('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6609=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util'];(function(_0x4b3db9,_0x42656c){var _0x461336=function(_0x2975ff){while(--_0x2975ff){_0x4b3db9['push'](_0x4b3db9['shift']());}};_0x461336(++_0x42656c);}(_0x6609,0x17e));var _0x9660=function(_0x3d2c64,_0x27fdec){_0x3d2c64=_0x3d2c64-0x0;var _0x4fa22a=_0x6609[_0x3d2c64];return _0x4fa22a;};'use strict';var multer=require(_0x9660('0x0'));var util=require(_0x9660('0x1'));var path=require(_0x9660('0x2'));var timeout=require(_0x9660('0x3'));var express=require(_0x9660('0x4'));var router=express[_0x9660('0x5')]();var auth=require(_0x9660('0x6'));var interaction=require(_0x9660('0x7'));var config=require(_0x9660('0x8'));var controller=require(_0x9660('0x9'));router[_0x9660('0xa')]('/',auth[_0x9660('0xb')](),controller[_0x9660('0xc')]);router[_0x9660('0xa')](_0x9660('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9660('0xa')](_0x9660('0xe'),auth[_0x9660('0xb')](),controller['getConfigurations']);router[_0x9660('0xa')](_0x9660('0xf'),auth[_0x9660('0xb')](),controller[_0x9660('0x10')]);router[_0x9660('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9660('0x11')](_0x9660('0xe'),auth[_0x9660('0xb')](),controller[_0x9660('0x12')]);router[_0x9660('0x13')](_0x9660('0xd'),auth[_0x9660('0xb')](),controller[_0x9660('0x14')]);router[_0x9660('0x15')](_0x9660('0xd'),auth[_0x9660('0xb')](),controller[_0x9660('0x16')]);module[_0x9660('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 5791732..d64fd2e 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 _0xfd52=['sequelize','STRING','username'];(function(_0x47853b,_0x21856b){var _0x4deb01=function(_0x4faeec){while(--_0x4faeec){_0x47853b['push'](_0x47853b['shift']());}};_0x4deb01(++_0x21856b);}(_0xfd52,0xc0));var _0x2fd5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfd52[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x2fd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x2fd5('0x1')]},'description':{'type':Sequelize[_0x2fd5('0x1')]},'username':{'type':Sequelize[_0x2fd5('0x1')],'unique':_0x2fd5('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2fd5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2fd5('0x1')]}}; \ No newline at end of file +var _0x03fd=['username','sequelize','exports','STRING'];(function(_0xcde17c,_0x944b9){var _0x127096=function(_0x4167c2){while(--_0x4167c2){_0xcde17c['push'](_0xcde17c['shift']());}};_0x127096(++_0x944b9);}(_0x03fd,0x7d));var _0xd03f=function(_0x16d125,_0x597054){_0x16d125=_0x16d125-0x0;var _0x47e562=_0x03fd[_0x16d125];return _0x47e562;};'use strict';var Sequelize=require(_0xd03f('0x0'));module[_0xd03f('0x1')]={'name':{'type':Sequelize[_0xd03f('0x2')]},'description':{'type':Sequelize[_0xd03f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd03f('0x3')},'password':{'type':Sequelize[_0xd03f('0x2')]},'remoteUri':{'type':Sequelize[_0xd03f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd03f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 20a5543..9eafd8f 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 _0x8ba4=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','count','include','SugarcrmAccount','findAll','rows','show','params','includeAll','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','length','addConfiguration','AccountId','channel','Descriptions','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','values','includes','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1448b7,_0x75cf49){var _0x6078b2=function(_0x284ff7){while(--_0x284ff7){_0x1448b7['push'](_0x1448b7['shift']());}};_0x6078b2(++_0x75cf49);}(_0x8ba4,0xdc));var _0x48ba=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x8ba4[_0x25fa5c];return _0x1bade2;};'use strict';var pdf=require(_0x48ba('0x0'));var emlformat=require(_0x48ba('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x48ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48ba('0x3'));var moment=require(_0x48ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x48ba('0x5'));var util=require(_0x48ba('0x6'));var path=require(_0x48ba('0x7'));var sox=require(_0x48ba('0x8'));var csv=require(_0x48ba('0x9'));var ejs=require(_0x48ba('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x48ba('0xb'));var crypto=require(_0x48ba('0xc'));var jsforce=require(_0x48ba('0xd'));var deskjs=require(_0x48ba('0xe'));var toCsv=require(_0x48ba('0x9'));var querystring=require('querystring');var Papa=require(_0x48ba('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x48ba('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48ba('0x11'));var logger=require(_0x48ba('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x48ba('0x13'));var db=require(_0x48ba('0x14'))['db'];var integrations=require(_0x48ba('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x48ba('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x5ec907,_0x26fafb,_0x379ed4){if(_0x379ed4){var _0x280f09=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x280f09['test'](_0x26fafb)){return _0x5ec907;}else{throw new db[(_0x48ba('0x17'))][(_0x48ba('0x18'))](_0x48ba('0x19'));}}else{return _0x5ec907;}}function respondWithRpcPromise(_0x524d5d,_0x575a9a,_0x57ec00,_0x5a7e78){return new BPromise(function(_0x3635a9,_0x527ae2){var _0x32c17b=_0x5a7e78||client;return _0x32c17b['request'](_0x524d5d,_0x57ec00)[_0x48ba('0x1a')](function(_0x45bb6b){logger[_0x48ba('0x1b')](_0x48ba('0x1c'),_0x575a9a,_0x48ba('0x1d'));logger[_0x48ba('0x1e')](_0x48ba('0x1f'),_0x575a9a,_0x48ba('0x1d'),JSON[_0x48ba('0x20')](_0x45bb6b));if(_0x45bb6b[_0x48ba('0x21')]){if(_0x45bb6b[_0x48ba('0x21')][_0x48ba('0x22')]===0x1f4){logger[_0x48ba('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x575a9a,_0x45bb6b[_0x48ba('0x21')][_0x48ba('0x23')]);return _0x527ae2(_0x45bb6b[_0x48ba('0x21')][_0x48ba('0x23')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x575a9a,_0x45bb6b['error'][_0x48ba('0x23')]);return _0x3635a9(_0x45bb6b['error'][_0x48ba('0x23')]);}else{logger[_0x48ba('0x1b')](_0x48ba('0x1c'),_0x575a9a,_0x48ba('0x1d'));_0x3635a9(_0x45bb6b[_0x48ba('0x24')]['message']);}})[_0x48ba('0x25')](function(_0x4600fd){logger[_0x48ba('0x21')](_0x48ba('0x1c'),_0x575a9a,_0x4600fd);_0x527ae2(_0x4600fd);});});}function respondWithStatusCode(_0x2d4191,_0x556bb0){_0x556bb0=_0x556bb0||0xcc;return function(_0x9ac25e){if(_0x9ac25e){return _0x2d4191[_0x48ba('0x26')](_0x556bb0);}return _0x2d4191[_0x48ba('0x27')](_0x556bb0)[_0x48ba('0x28')]();};}function respondWithResult(_0x372b6e,_0xbdf007){_0xbdf007=_0xbdf007||0xc8;return function(_0x527606){if(_0x527606){return _0x372b6e['status'](_0xbdf007)[_0x48ba('0x29')](_0x527606);}};}function respondWithFilteredResult(_0x1ad9d8,_0x180812){return function(_0x338dfa){if(_0x338dfa){var _0x13bdad=_0x338dfa['count'],_0x234b61=_0x180812[_0x48ba('0x2a')],_0x4f6e11=_0x180812[_0x48ba('0x2a')]+_0x180812[_0x48ba('0x2b')],_0x2a03df;if(_0x4f6e11>=_0x13bdad){_0x4f6e11=_0x13bdad;_0x2a03df=0xc8;}else{_0x2a03df=0xce;}_0x1ad9d8[_0x48ba('0x27')](_0x2a03df);return _0x1ad9d8[_0x48ba('0x2c')](_0x48ba('0x2d'),_0x234b61+'-'+_0x4f6e11+'/'+_0x13bdad)[_0x48ba('0x29')](_0x338dfa);}return null;};}function patchUpdates(_0x5826c7){return function(_0x53ff61){try{jsonpatch[_0x48ba('0x2e')](_0x53ff61,_0x5826c7,!![]);}catch(_0x1bc9d0){return BPromise['reject'](_0x1bc9d0);}return _0x53ff61[_0x48ba('0x2f')]();};}function saveUpdates(_0x3f2bf6,_0x38796e){return function(_0x10993f){if(_0x10993f){return _0x10993f[_0x48ba('0x30')](_0x3f2bf6)[_0x48ba('0x1a')](function(_0x2b1f89){return _0x2b1f89;});}return null;};}function removeEntity(_0x382a9d,_0x45c90b){return function(_0x395743){if(_0x395743){return _0x395743[_0x48ba('0x31')]()[_0x48ba('0x1a')](function(){_0x382a9d[_0x48ba('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2391f8,_0x3f6793){return function(_0x16592a){if(!_0x16592a){_0x2391f8[_0x48ba('0x26')](0x194);}return _0x16592a;};}function handleError(_0x122ba5,_0x1f74d6){_0x1f74d6=_0x1f74d6||0x1f4;return function(_0x598ddc){logger[_0x48ba('0x21')](_0x598ddc[_0x48ba('0x32')]);if(_0x598ddc[_0x48ba('0x33')]){delete _0x598ddc[_0x48ba('0x33')];}_0x122ba5[_0x48ba('0x27')](_0x1f74d6)[_0x48ba('0x34')](_0x598ddc);};}exports[_0x48ba('0x35')]=function(_0x3a1855,_0x4cb74d){var _0x426400={},_0x49c424={},_0xb26d44={'count':0x0,'rows':[]};var _0x2949b9=_[_0x48ba('0x36')](db['SugarcrmAccount'][_0x48ba('0x37')],function(_0x8ea4d){return{'name':_0x8ea4d[_0x48ba('0x38')],'type':_0x8ea4d[_0x48ba('0x39')][_0x48ba('0x3a')]};});_0x49c424['model']=_[_0x48ba('0x36')](_0x2949b9,_0x48ba('0x33'));_0x49c424[_0x48ba('0x3b')]=_[_0x48ba('0x3c')](_0x3a1855[_0x48ba('0x3b')]);_0x49c424[_0x48ba('0x3d')]=_[_0x48ba('0x3e')](_0x49c424[_0x48ba('0x3f')],_0x49c424[_0x48ba('0x3b')]);_0x426400[_0x48ba('0x40')]=_[_0x48ba('0x3e')](_0x49c424[_0x48ba('0x3f')],qs[_0x48ba('0x41')](_0x3a1855[_0x48ba('0x3b')][_0x48ba('0x41')]));_0x426400[_0x48ba('0x40')]=_0x426400[_0x48ba('0x40')]['length']?_0x426400[_0x48ba('0x40')]:_0x49c424['model'];if(!_0x3a1855[_0x48ba('0x3b')][_0x48ba('0x42')](_0x48ba('0x43'))){_0x426400[_0x48ba('0x2b')]=qs['limit'](_0x3a1855[_0x48ba('0x3b')][_0x48ba('0x2b')]);_0x426400[_0x48ba('0x2a')]=qs[_0x48ba('0x2a')](_0x3a1855['query'][_0x48ba('0x2a')]);}_0x426400[_0x48ba('0x44')]=qs[_0x48ba('0x45')](_0x3a1855[_0x48ba('0x3b')]['sort']);_0x426400[_0x48ba('0x46')]=qs[_0x48ba('0x3d')](_[_0x48ba('0x47')](_0x3a1855['query'],_0x49c424[_0x48ba('0x3d')]));if(_0x3a1855[_0x48ba('0x3b')]['filter']){_0x426400['where']=_['merge'](_0x426400[_0x48ba('0x46')],{'$or':_['map'](_0x2949b9,function(_0x5a9c88){if(_0x5a9c88[_0x48ba('0x39')]!==_0x48ba('0x48')){var _0x49a72c={};_0x49a72c[_0x5a9c88['name']]={'$like':'%'+_0x3a1855[_0x48ba('0x3b')][_0x48ba('0x49')]+'%'};return _0x49a72c;}})});}_0x426400=_[_0x48ba('0x4a')]({},_0x426400,_0x3a1855['options']);var _0x4fd3d={'where':_0x426400[_0x48ba('0x46')]};return db['SugarcrmAccount'][_0x48ba('0x4b')](_0x4fd3d)[_0x48ba('0x1a')](function(_0x122cc6){_0xb26d44['count']=_0x122cc6;if(_0x3a1855['query']['includeAll']){_0x426400[_0x48ba('0x4c')]=[{'all':!![]}];}return db[_0x48ba('0x4d')][_0x48ba('0x4e')](_0x426400);})['then'](function(_0x4a7227){_0xb26d44[_0x48ba('0x4f')]=_0x4a7227;return _0xb26d44;})[_0x48ba('0x1a')](respondWithFilteredResult(_0x4cb74d,_0x426400))[_0x48ba('0x25')](handleError(_0x4cb74d,null));};exports[_0x48ba('0x50')]=function(_0x443613,_0x2da222){var _0x25bd27={'raw':![],'where':{'id':_0x443613[_0x48ba('0x51')]['id']}},_0x4ae40b={};_0x4ae40b[_0x48ba('0x3f')]=_[_0x48ba('0x3c')](db[_0x48ba('0x4d')][_0x48ba('0x37')]);_0x4ae40b['query']=_[_0x48ba('0x3c')](_0x443613[_0x48ba('0x3b')]);_0x4ae40b['filters']=_['intersection'](_0x4ae40b[_0x48ba('0x3f')],_0x4ae40b[_0x48ba('0x3b')]);_0x25bd27[_0x48ba('0x40')]=_[_0x48ba('0x3e')](_0x4ae40b[_0x48ba('0x3f')],qs[_0x48ba('0x41')](_0x443613['query'][_0x48ba('0x41')]));_0x25bd27['attributes']=_0x25bd27['attributes']['length']?_0x25bd27['attributes']:_0x4ae40b[_0x48ba('0x3f')];if(_0x443613[_0x48ba('0x3b')][_0x48ba('0x52')]){_0x25bd27['include']=[{'all':!![]}];}_0x25bd27=_[_0x48ba('0x4a')]({},_0x25bd27,_0x443613[_0x48ba('0x53')]);return db[_0x48ba('0x4d')][_0x48ba('0x54')](_0x25bd27)[_0x48ba('0x1a')](handleEntityNotFound(_0x2da222,null))[_0x48ba('0x1a')](respondWithResult(_0x2da222,null))[_0x48ba('0x25')](handleError(_0x2da222,null));};exports['create']=function(_0x13ec15,_0x22cb53){return db[_0x48ba('0x4d')][_0x48ba('0x55')](_0x13ec15[_0x48ba('0x56')],{})[_0x48ba('0x1a')](respondWithResult(_0x22cb53,0xc9))[_0x48ba('0x25')](handleError(_0x22cb53,null));};exports['update']=function(_0x33cac9,_0x3d48d5){if(_0x33cac9['body']['id']){delete _0x33cac9[_0x48ba('0x56')]['id'];}return db[_0x48ba('0x4d')][_0x48ba('0x54')]({'where':{'id':_0x33cac9[_0x48ba('0x51')]['id']}})[_0x48ba('0x1a')](handleEntityNotFound(_0x3d48d5,null))[_0x48ba('0x1a')](saveUpdates(_0x33cac9[_0x48ba('0x56')],null))['then'](respondWithResult(_0x3d48d5,null))['catch'](handleError(_0x3d48d5,null));};exports['destroy']=function(_0x1111c3,_0x20955e){return db[_0x48ba('0x4d')]['find']({'where':{'id':_0x1111c3[_0x48ba('0x51')]['id']}})[_0x48ba('0x1a')](handleEntityNotFound(_0x20955e,null))[_0x48ba('0x1a')](removeEntity(_0x20955e,null))[_0x48ba('0x25')](handleError(_0x20955e,null));};exports[_0x48ba('0x57')]=function(_0x104aae,_0x27c733,_0x310c72){var _0x1232d8={};var _0x404449={};var _0x2ed14e;var _0x3ffd53;return db[_0x48ba('0x4d')][_0x48ba('0x58')]({'where':{'id':_0x104aae[_0x48ba('0x51')]['id']}})[_0x48ba('0x1a')](handleEntityNotFound(_0x27c733,null))[_0x48ba('0x1a')](function(_0x5ade1d){if(_0x5ade1d){_0x2ed14e=_0x5ade1d;_0x404449['model']=_['keys'](db[_0x48ba('0x59')][_0x48ba('0x37')]);_0x404449['query']=_['keys'](_0x104aae[_0x48ba('0x3b')]);_0x404449[_0x48ba('0x3d')]=_['intersection'](_0x404449[_0x48ba('0x3f')],_0x404449[_0x48ba('0x3b')]);_0x1232d8[_0x48ba('0x40')]=_[_0x48ba('0x3e')](_0x404449[_0x48ba('0x3f')],qs['fields'](_0x104aae['query'][_0x48ba('0x41')]));_0x1232d8[_0x48ba('0x40')]=_0x1232d8[_0x48ba('0x40')][_0x48ba('0x5a')]?_0x1232d8[_0x48ba('0x40')]:_0x404449[_0x48ba('0x3f')];_0x1232d8['order']=qs[_0x48ba('0x45')](_0x104aae[_0x48ba('0x3b')]['sort']);_0x1232d8[_0x48ba('0x46')]=qs[_0x48ba('0x3d')](_[_0x48ba('0x47')](_0x104aae['query'],_0x404449[_0x48ba('0x3d')]));if(_0x104aae[_0x48ba('0x3b')][_0x48ba('0x49')]){_0x1232d8[_0x48ba('0x46')]=_[_0x48ba('0x4a')](_0x1232d8['where'],{'$or':_[_0x48ba('0x36')](_0x1232d8[_0x48ba('0x40')],function(_0x232328){var _0x249ef9={};_0x249ef9[_0x232328]={'$like':'%'+_0x104aae[_0x48ba('0x3b')][_0x48ba('0x49')]+'%'};return _0x249ef9;})});}_0x1232d8=_['merge']({},_0x1232d8,_0x104aae[_0x48ba('0x53')]);return _0x2ed14e[_0x48ba('0x57')](_0x1232d8);}})[_0x48ba('0x1a')](function(_0x2e0bd0){if(_0x2e0bd0){_0x3ffd53=_0x2e0bd0[_0x48ba('0x5a')];if(!_0x104aae[_0x48ba('0x3b')][_0x48ba('0x42')](_0x48ba('0x43'))){_0x1232d8[_0x48ba('0x2b')]=qs[_0x48ba('0x2b')](_0x104aae[_0x48ba('0x3b')][_0x48ba('0x2b')]);_0x1232d8[_0x48ba('0x2a')]=qs[_0x48ba('0x2a')](_0x104aae[_0x48ba('0x3b')]['offset']);}return _0x2ed14e[_0x48ba('0x57')](_0x1232d8);}})['then'](function(_0x159920){if(_0x159920){return _0x159920?{'count':_0x3ffd53,'rows':_0x159920}:null;}})['then'](respondWithResult(_0x27c733,null))['catch'](handleError(_0x27c733,null));};exports[_0x48ba('0x5b')]=function(_0x4c67b9,_0x553350,_0x3fd27e){if(_0x4c67b9[_0x48ba('0x56')]['id']){delete _0x4c67b9['body']['id'];}return db[_0x48ba('0x4d')][_0x48ba('0x58')]({'where':{'id':_0x4c67b9[_0x48ba('0x51')]['id']}})[_0x48ba('0x1a')](handleEntityNotFound(_0x553350,null))[_0x48ba('0x1a')](function(_0x17ef31){if(_0x17ef31){_0x4c67b9[_0x48ba('0x56')][_0x48ba('0x5c')]=_0x17ef31['id'];_0x4c67b9['body']['Subjects']=integrations['getSubjects'](_0x4c67b9[_0x48ba('0x56')][_0x48ba('0x5d')],_0x4c67b9[_0x48ba('0x56')]['type']);_0x4c67b9['body'][_0x48ba('0x5e')]=integrations['getDescriptions'](_0x4c67b9[_0x48ba('0x56')][_0x48ba('0x5d')],_0x4c67b9[_0x48ba('0x56')][_0x48ba('0x39')]);return db[_0x48ba('0x59')][_0x48ba('0x55')](_0x4c67b9[_0x48ba('0x56')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x48ba('0x5e')}]});}return null;})[_0x48ba('0x1a')](respondWithResult(_0x553350,null))[_0x48ba('0x25')](handleError(_0x553350,null));};exports['getFields']=function(_0x272cd2,_0x3f4b39,_0x3027ee){var _0x29d810='';var _0x59fc3f=['id',_0x48ba('0x33'),'assigned_user_id',_0x48ba('0x5f'),_0x48ba('0x60'),_0x48ba('0x61'),_0x48ba('0x62'),_0x48ba('0x63'),_0x48ba('0x64'),_0x48ba('0x65'),_0x48ba('0x66'),'direction'];return db['SugarcrmAccount'][_0x48ba('0x58')]({'where':{'id':_0x272cd2['params']['id']},'attributes':['id',_0x48ba('0x67'),'password','remoteUri']})['then'](handleEntityNotFound(_0x3f4b39,null))[_0x48ba('0x1a')](function(_0x450d7a){if(_0x450d7a){_0x29d810=_0x450d7a[_0x48ba('0x68')];var _0xfb7649=_0x29d810[_0x48ba('0x69')](-0x1);if(_0xfb7649==='/'){_0x29d810=_0x29d810[_0x48ba('0x6a')](0x0,_0x29d810[_0x48ba('0x6b')](_0xfb7649));}return rp({'method':_0x48ba('0x6c'),'uri':util[_0x48ba('0x6d')](_0x48ba('0x6e'),_0x29d810,_0x48ba('0x6f')),'json':!![],'form':{'method':'login','input_type':_0x48ba('0x70'),'response_type':'JSON','rest_data':JSON[_0x48ba('0x20')]({'user_auth':{'user_name':_0x450d7a[_0x48ba('0x67')],'password':_0x450d7a[_0x48ba('0x71')],'encryption':_0x48ba('0x72')},'application':_0x48ba('0x73')})}});}})[_0x48ba('0x1a')](function(_0x23a754){if(_0x23a754&&_0x23a754['name']!=='Invalid\x20Login'&&_0x23a754[_0x48ba('0x33')]!==_0x48ba('0x74')){return rp({'method':'POST','uri':util[_0x48ba('0x6d')]('%s%s',_0x29d810,_0x48ba('0x6f')),'json':!![],'form':{'method':_0x48ba('0x75'),'input_type':_0x48ba('0x70'),'response_type':_0x48ba('0x70'),'rest_data':JSON['stringify']({'session':_0x23a754['id'],'module_name':'Calls'})}})[_0x48ba('0x1a')](function(_0x29aa90){if(_0x29aa90){var _0xbc4dc4=_[_0x48ba('0x76')](_0x29aa90['module_fields']);_['remove'](_0xbc4dc4,function(_0x82b5f6){return _0x59fc3f[_0x48ba('0x77')](_0x82b5f6[_0x48ba('0x33')]);});return{'count':_0xbc4dc4[_0x48ba('0x5a')],'rows':_['map'](_0xbc4dc4,function(_0x312293){return{'id':_0x312293[_0x48ba('0x33')],'name':_0x312293[_0x48ba('0x78')],'custom':_['endsWith'](_0x312293['name'],'_c')?!![]:![],'options':_0x312293[_0x48ba('0x53')]?_[_0x48ba('0x36')](_[_0x48ba('0x76')](_0x312293[_0x48ba('0x53')]),function(_0x329d24){return{'name':_0x329d24['value'],'value':_0x329d24['name']};}):[]};})};}})[_0x48ba('0x1a')](respondWithResult(_0x3f4b39,null))[_0x48ba('0x25')](function(_0x455643){var _0x4ac3d1=_0x272cd2[_0x48ba('0x3b')][_0x48ba('0x79')]?0x1f4:_0x455643[_0x48ba('0x7a')]||0x1f4;logger['error'](_0x48ba('0x7b'),'getFields',_0x4ac3d1,JSON[_0x48ba('0x20')](_0x455643));delete _0x455643[_0x48ba('0x33')];if(_0x4ac3d1===0x191){_0x4ac3d1=0x190;}_0x3f4b39[_0x48ba('0x27')](_0x4ac3d1)['send'](_0x272cd2['query'][_0x48ba('0x79')]?{'message':_0x48ba('0x7c'),'statusCode':_0x455643[_0x48ba('0x7a')]}:_0x455643);});}else{var _0x2bc68e=0x1f4;_0x3f4b39[_0x48ba('0x27')](_0x2bc68e)[_0x48ba('0x34')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x11fa=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x1691b3,_0x543c75){var _0x1c2a2e=function(_0x5b0b7d){while(--_0x5b0b7d){_0x1691b3['push'](_0x1691b3['shift']());}};_0x1c2a2e(++_0x543c75);}(_0x11fa,0x170));var _0xa11f=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x11fa[_0x1203f];return _0x365f0a;};'use strict';var pdf=require(_0xa11f('0x0'));var emlformat=require(_0xa11f('0x1'));var rimraf=require(_0xa11f('0x2'));var zipdir=require(_0xa11f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa11f('0x4'));var moment=require(_0xa11f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa11f('0x6'));var util=require('util');var path=require(_0xa11f('0x7'));var sox=require('sox');var csv=require(_0xa11f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa11f('0x9'));var crypto=require(_0xa11f('0xa'));var jsforce=require(_0xa11f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa11f('0xc'));var Papa=require(_0xa11f('0xd'));var Redis=require(_0xa11f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa11f('0xf'));var as=require(_0xa11f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa11f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xa11f('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa11f('0x13'));var jayson=require(_0xa11f('0x14'));var client=jayson[_0xa11f('0x15')][_0xa11f('0x16')]({'port':0x232a});function checkPasswordPattern(_0x175f2d,_0x5bd54a,_0x2930bf){if(_0x2930bf){var _0x13315b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13315b[_0xa11f('0x17')](_0x5bd54a)){return _0x175f2d;}else{throw new db['Sequelize'][(_0xa11f('0x18'))]('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 _0x175f2d;}}function respondWithRpcPromise(_0x2b78dc,_0x3f3c7a,_0x43430e,_0x485c77){return new BPromise(function(_0x303f64,_0x331b6f){var _0x2af39e=_0x485c77||client;return _0x2af39e[_0xa11f('0x19')](_0x2b78dc,_0x43430e)[_0xa11f('0x1a')](function(_0x2463b5){logger[_0xa11f('0x1b')]('SugarcrmAccount,\x20%s,\x20%s',_0x3f3c7a,'request\x20sent');logger[_0xa11f('0x1c')](_0xa11f('0x1d'),_0x3f3c7a,'request\x20sent',JSON['stringify'](_0x2463b5));if(_0x2463b5[_0xa11f('0x1e')]){if(_0x2463b5[_0xa11f('0x1e')][_0xa11f('0x1f')]===0x1f4){logger['error'](_0xa11f('0x20'),_0x3f3c7a,_0x2463b5[_0xa11f('0x1e')]['message']);return _0x331b6f(_0x2463b5[_0xa11f('0x1e')][_0xa11f('0x21')]);}logger[_0xa11f('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x3f3c7a,_0x2463b5['error'][_0xa11f('0x21')]);return _0x303f64(_0x2463b5[_0xa11f('0x1e')][_0xa11f('0x21')]);}else{logger[_0xa11f('0x1b')](_0xa11f('0x20'),_0x3f3c7a,_0xa11f('0x22'));_0x303f64(_0x2463b5[_0xa11f('0x23')][_0xa11f('0x21')]);}})[_0xa11f('0x24')](function(_0x116ebd){logger[_0xa11f('0x1e')](_0xa11f('0x20'),_0x3f3c7a,_0x116ebd);_0x331b6f(_0x116ebd);});});}function respondWithStatusCode(_0x49bbb8,_0x3a73c7){_0x3a73c7=_0x3a73c7||0xcc;return function(_0x207246){if(_0x207246){return _0x49bbb8[_0xa11f('0x25')](_0x3a73c7);}return _0x49bbb8[_0xa11f('0x26')](_0x3a73c7)[_0xa11f('0x27')]();};}function respondWithResult(_0x563320,_0x4434e3){_0x4434e3=_0x4434e3||0xc8;return function(_0x5a40c2){if(_0x5a40c2){return _0x563320[_0xa11f('0x26')](_0x4434e3)[_0xa11f('0x28')](_0x5a40c2);}};}function respondWithFilteredResult(_0x3174a0,_0x440989){return function(_0xdd532d){if(_0xdd532d){var _0x4abc26=_0xdd532d[_0xa11f('0x29')],_0x4dd283=_0x440989['offset'],_0xde649e=_0x440989[_0xa11f('0x2a')]+_0x440989[_0xa11f('0x2b')],_0x717805;if(_0xde649e>=_0x4abc26){_0xde649e=_0x4abc26;_0x717805=0xc8;}else{_0x717805=0xce;}_0x3174a0[_0xa11f('0x26')](_0x717805);return _0x3174a0[_0xa11f('0x2c')](_0xa11f('0x2d'),_0x4dd283+'-'+_0xde649e+'/'+_0x4abc26)['json'](_0xdd532d);}return null;};}function patchUpdates(_0x24b667){return function(_0x5eb506){try{jsonpatch[_0xa11f('0x2e')](_0x5eb506,_0x24b667,!![]);}catch(_0x485cb4){return BPromise[_0xa11f('0x2f')](_0x485cb4);}return _0x5eb506[_0xa11f('0x30')]();};}function saveUpdates(_0x3a7932,_0x183477){return function(_0x5e76be){if(_0x5e76be){return _0x5e76be[_0xa11f('0x31')](_0x3a7932)['then'](function(_0x2685cd){return _0x2685cd;});}return null;};}function removeEntity(_0xefe1f,_0xc08eb2){return function(_0x442732){if(_0x442732){return _0x442732[_0xa11f('0x32')]()[_0xa11f('0x1a')](function(){_0xefe1f['status'](0xcc)[_0xa11f('0x27')]();});}};}function handleEntityNotFound(_0xfc5f51,_0x29162d){return function(_0x14c44f){if(!_0x14c44f){_0xfc5f51[_0xa11f('0x25')](0x194);}return _0x14c44f;};}function handleError(_0x4b423a,_0x25f686){_0x25f686=_0x25f686||0x1f4;return function(_0x435c46){logger['error'](_0x435c46[_0xa11f('0x33')]);if(_0x435c46[_0xa11f('0x34')]){delete _0x435c46[_0xa11f('0x34')];}_0x4b423a[_0xa11f('0x26')](_0x25f686)[_0xa11f('0x35')](_0x435c46);};}exports[_0xa11f('0x36')]=function(_0x426f96,_0x224de7){var _0xbaa775={},_0x5305c9={},_0x51d3e2={'count':0x0,'rows':[]};var _0x16b546=_[_0xa11f('0x37')](db[_0xa11f('0x38')][_0xa11f('0x39')],function(_0x150fbf){return{'name':_0x150fbf['fieldName'],'type':_0x150fbf[_0xa11f('0x3a')][_0xa11f('0x3b')]};});_0x5305c9[_0xa11f('0x3c')]=_[_0xa11f('0x37')](_0x16b546,_0xa11f('0x34'));_0x5305c9[_0xa11f('0x3d')]=_[_0xa11f('0x3e')](_0x426f96[_0xa11f('0x3d')]);_0x5305c9[_0xa11f('0x3f')]=_['intersection'](_0x5305c9['model'],_0x5305c9[_0xa11f('0x3d')]);_0xbaa775[_0xa11f('0x40')]=_[_0xa11f('0x41')](_0x5305c9['model'],qs[_0xa11f('0x42')](_0x426f96[_0xa11f('0x3d')][_0xa11f('0x42')]));_0xbaa775[_0xa11f('0x40')]=_0xbaa775[_0xa11f('0x40')][_0xa11f('0x43')]?_0xbaa775['attributes']:_0x5305c9[_0xa11f('0x3c')];if(!_0x426f96[_0xa11f('0x3d')][_0xa11f('0x44')](_0xa11f('0x45'))){_0xbaa775[_0xa11f('0x2b')]=qs[_0xa11f('0x2b')](_0x426f96[_0xa11f('0x3d')][_0xa11f('0x2b')]);_0xbaa775[_0xa11f('0x2a')]=qs[_0xa11f('0x2a')](_0x426f96[_0xa11f('0x3d')][_0xa11f('0x2a')]);}_0xbaa775[_0xa11f('0x46')]=qs[_0xa11f('0x47')](_0x426f96[_0xa11f('0x3d')][_0xa11f('0x47')]);_0xbaa775[_0xa11f('0x48')]=qs['filters'](_[_0xa11f('0x49')](_0x426f96['query'],_0x5305c9[_0xa11f('0x3f')]));if(_0x426f96['query'][_0xa11f('0x4a')]){_0xbaa775['where']=_[_0xa11f('0x4b')](_0xbaa775[_0xa11f('0x48')],{'$or':_['map'](_0x16b546,function(_0x2c0804){if(_0x2c0804[_0xa11f('0x3a')]!=='VIRTUAL'){var _0x71a50a={};_0x71a50a[_0x2c0804[_0xa11f('0x34')]]={'$like':'%'+_0x426f96[_0xa11f('0x3d')][_0xa11f('0x4a')]+'%'};return _0x71a50a;}})});}_0xbaa775=_['merge']({},_0xbaa775,_0x426f96[_0xa11f('0x4c')]);var _0x51a5f6={'where':_0xbaa775['where']};return db['SugarcrmAccount'][_0xa11f('0x29')](_0x51a5f6)['then'](function(_0x970e0e){_0x51d3e2[_0xa11f('0x29')]=_0x970e0e;if(_0x426f96[_0xa11f('0x3d')][_0xa11f('0x4d')]){_0xbaa775[_0xa11f('0x4e')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xa11f('0x4f')](_0xbaa775);})[_0xa11f('0x1a')](function(_0x417c0e){_0x51d3e2[_0xa11f('0x50')]=_0x417c0e;return _0x51d3e2;})[_0xa11f('0x1a')](respondWithFilteredResult(_0x224de7,_0xbaa775))[_0xa11f('0x24')](handleError(_0x224de7,null));};exports[_0xa11f('0x51')]=function(_0x5bf3c5,_0x1d8aab){var _0x45485b={'raw':![],'where':{'id':_0x5bf3c5[_0xa11f('0x52')]['id']}},_0x3a1a69={};_0x3a1a69[_0xa11f('0x3c')]=_[_0xa11f('0x3e')](db[_0xa11f('0x38')]['rawAttributes']);_0x3a1a69[_0xa11f('0x3d')]=_[_0xa11f('0x3e')](_0x5bf3c5[_0xa11f('0x3d')]);_0x3a1a69[_0xa11f('0x3f')]=_[_0xa11f('0x41')](_0x3a1a69[_0xa11f('0x3c')],_0x3a1a69[_0xa11f('0x3d')]);_0x45485b[_0xa11f('0x40')]=_['intersection'](_0x3a1a69[_0xa11f('0x3c')],qs['fields'](_0x5bf3c5[_0xa11f('0x3d')][_0xa11f('0x42')]));_0x45485b[_0xa11f('0x40')]=_0x45485b[_0xa11f('0x40')][_0xa11f('0x43')]?_0x45485b['attributes']:_0x3a1a69[_0xa11f('0x3c')];if(_0x5bf3c5['query'][_0xa11f('0x4d')]){_0x45485b[_0xa11f('0x4e')]=[{'all':!![]}];}_0x45485b=_[_0xa11f('0x4b')]({},_0x45485b,_0x5bf3c5[_0xa11f('0x4c')]);return db[_0xa11f('0x38')][_0xa11f('0x53')](_0x45485b)[_0xa11f('0x1a')](handleEntityNotFound(_0x1d8aab,null))[_0xa11f('0x1a')](respondWithResult(_0x1d8aab,null))[_0xa11f('0x24')](handleError(_0x1d8aab,null));};exports[_0xa11f('0x54')]=function(_0x2a08e5,_0x26d86c){return db['SugarcrmAccount'][_0xa11f('0x54')](_0x2a08e5[_0xa11f('0x55')],{})[_0xa11f('0x1a')](respondWithResult(_0x26d86c,0xc9))[_0xa11f('0x24')](handleError(_0x26d86c,null));};exports[_0xa11f('0x31')]=function(_0x466708,_0x653c88){if(_0x466708[_0xa11f('0x55')]['id']){delete _0x466708[_0xa11f('0x55')]['id'];}return db[_0xa11f('0x38')][_0xa11f('0x53')]({'where':{'id':_0x466708['params']['id']}})[_0xa11f('0x1a')](handleEntityNotFound(_0x653c88,null))[_0xa11f('0x1a')](saveUpdates(_0x466708['body'],null))['then'](respondWithResult(_0x653c88,null))[_0xa11f('0x24')](handleError(_0x653c88,null));};exports[_0xa11f('0x32')]=function(_0x21fa89,_0x3062b9){return db[_0xa11f('0x38')][_0xa11f('0x53')]({'where':{'id':_0x21fa89[_0xa11f('0x52')]['id']}})[_0xa11f('0x1a')](handleEntityNotFound(_0x3062b9,null))[_0xa11f('0x1a')](removeEntity(_0x3062b9,null))['catch'](handleError(_0x3062b9,null));};exports['getConfigurations']=function(_0x23cb0c,_0x351c42,_0x1f588b){var _0x3f4088={};var _0x1d550d={};var _0x125484;var _0xffbd27;return db[_0xa11f('0x38')][_0xa11f('0x56')]({'where':{'id':_0x23cb0c[_0xa11f('0x52')]['id']}})[_0xa11f('0x1a')](handleEntityNotFound(_0x351c42,null))['then'](function(_0x1bf94b){if(_0x1bf94b){_0x125484=_0x1bf94b;_0x1d550d[_0xa11f('0x3c')]=_['keys'](db[_0xa11f('0x57')][_0xa11f('0x39')]);_0x1d550d[_0xa11f('0x3d')]=_[_0xa11f('0x3e')](_0x23cb0c['query']);_0x1d550d[_0xa11f('0x3f')]=_[_0xa11f('0x41')](_0x1d550d[_0xa11f('0x3c')],_0x1d550d['query']);_0x3f4088[_0xa11f('0x40')]=_[_0xa11f('0x41')](_0x1d550d[_0xa11f('0x3c')],qs['fields'](_0x23cb0c[_0xa11f('0x3d')][_0xa11f('0x42')]));_0x3f4088[_0xa11f('0x40')]=_0x3f4088[_0xa11f('0x40')][_0xa11f('0x43')]?_0x3f4088[_0xa11f('0x40')]:_0x1d550d[_0xa11f('0x3c')];_0x3f4088[_0xa11f('0x46')]=qs[_0xa11f('0x47')](_0x23cb0c['query'][_0xa11f('0x47')]);_0x3f4088[_0xa11f('0x48')]=qs['filters'](_[_0xa11f('0x49')](_0x23cb0c[_0xa11f('0x3d')],_0x1d550d[_0xa11f('0x3f')]));if(_0x23cb0c[_0xa11f('0x3d')]['filter']){_0x3f4088['where']=_['merge'](_0x3f4088[_0xa11f('0x48')],{'$or':_[_0xa11f('0x37')](_0x3f4088['attributes'],function(_0x45ea66){var _0x5d2f35={};_0x5d2f35[_0x45ea66]={'$like':'%'+_0x23cb0c[_0xa11f('0x3d')][_0xa11f('0x4a')]+'%'};return _0x5d2f35;})});}_0x3f4088=_['merge']({},_0x3f4088,_0x23cb0c[_0xa11f('0x4c')]);return _0x125484['getConfigurations'](_0x3f4088);}})[_0xa11f('0x1a')](function(_0x29ae51){if(_0x29ae51){_0xffbd27=_0x29ae51[_0xa11f('0x43')];if(!_0x23cb0c[_0xa11f('0x3d')][_0xa11f('0x44')](_0xa11f('0x45'))){_0x3f4088[_0xa11f('0x2b')]=qs[_0xa11f('0x2b')](_0x23cb0c[_0xa11f('0x3d')][_0xa11f('0x2b')]);_0x3f4088[_0xa11f('0x2a')]=qs['offset'](_0x23cb0c[_0xa11f('0x3d')]['offset']);}return _0x125484[_0xa11f('0x58')](_0x3f4088);}})[_0xa11f('0x1a')](function(_0x3f057b){if(_0x3f057b){return _0x3f057b?{'count':_0xffbd27,'rows':_0x3f057b}:null;}})['then'](respondWithResult(_0x351c42,null))[_0xa11f('0x24')](handleError(_0x351c42,null));};exports[_0xa11f('0x59')]=function(_0x3af579,_0x318ad9,_0x3b05c6){if(_0x3af579['body']['id']){delete _0x3af579[_0xa11f('0x55')]['id'];}return db[_0xa11f('0x38')]['findOne']({'where':{'id':_0x3af579['params']['id']}})[_0xa11f('0x1a')](handleEntityNotFound(_0x318ad9,null))['then'](function(_0x247982){if(_0x247982){_0x3af579[_0xa11f('0x55')]['AccountId']=_0x247982['id'];_0x3af579[_0xa11f('0x55')][_0xa11f('0x5a')]=integrations['getSubjects'](_0x3af579[_0xa11f('0x55')][_0xa11f('0x5b')],_0x3af579[_0xa11f('0x55')]['type']);_0x3af579[_0xa11f('0x55')][_0xa11f('0x5c')]=integrations[_0xa11f('0x5d')](_0x3af579[_0xa11f('0x55')][_0xa11f('0x5b')],_0x3af579[_0xa11f('0x55')][_0xa11f('0x3a')]);return db['SugarcrmConfiguration'][_0xa11f('0x54')](_0x3af579[_0xa11f('0x55')],{'include':[{'model':db[_0xa11f('0x5e')],'as':_0xa11f('0x5a')},{'model':db[_0xa11f('0x5e')],'as':_0xa11f('0x5c')}]});}return null;})[_0xa11f('0x1a')](respondWithResult(_0x318ad9,null))[_0xa11f('0x24')](handleError(_0x318ad9,null));};exports[_0xa11f('0x5f')]=function(_0x3c125e,_0x2e317d,_0xcbadee){var _0x15eec2='';var _0x4c6717=['id',_0xa11f('0x34'),_0xa11f('0x60'),_0xa11f('0x61'),'description',_0xa11f('0x62'),_0xa11f('0x63'),'duration_minutes',_0xa11f('0x64'),_0xa11f('0x65'),'parent_name',_0xa11f('0x66')];return db['SugarcrmAccount'][_0xa11f('0x56')]({'where':{'id':_0x3c125e['params']['id']},'attributes':['id',_0xa11f('0x67'),_0xa11f('0x68'),_0xa11f('0x69')]})[_0xa11f('0x1a')](handleEntityNotFound(_0x2e317d,null))[_0xa11f('0x1a')](function(_0x4bf481){if(_0x4bf481){_0x15eec2=_0x4bf481[_0xa11f('0x69')];var _0x37fb14=_0x15eec2['slice'](-0x1);if(_0x37fb14==='/'){_0x15eec2=_0x15eec2[_0xa11f('0x6a')](0x0,_0x15eec2[_0xa11f('0x6b')](_0x37fb14));}return rp({'method':_0xa11f('0x6c'),'uri':util[_0xa11f('0x6d')](_0xa11f('0x6e'),_0x15eec2,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa11f('0x6f'),'input_type':_0xa11f('0x70'),'response_type':_0xa11f('0x70'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4bf481[_0xa11f('0x67')],'password':_0x4bf481[_0xa11f('0x68')],'encryption':_0xa11f('0x71')},'application':_0xa11f('0x72')})}});}})['then'](function(_0x4acea9){if(_0x4acea9&&_0x4acea9[_0xa11f('0x34')]!=='Invalid\x20Login'&&_0x4acea9[_0xa11f('0x34')]!=='Password\x20Expired'){return rp({'method':_0xa11f('0x6c'),'uri':util[_0xa11f('0x6d')](_0xa11f('0x6e'),_0x15eec2,_0xa11f('0x73')),'json':!![],'form':{'method':_0xa11f('0x74'),'input_type':_0xa11f('0x70'),'response_type':_0xa11f('0x70'),'rest_data':JSON['stringify']({'session':_0x4acea9['id'],'module_name':_0xa11f('0x75')})}})[_0xa11f('0x1a')](function(_0x3098fe){if(_0x3098fe){var _0x36b6cf=_[_0xa11f('0x76')](_0x3098fe[_0xa11f('0x77')]);_[_0xa11f('0x78')](_0x36b6cf,function(_0x5a248b){return _0x4c6717[_0xa11f('0x79')](_0x5a248b['name']);});return{'count':_0x36b6cf[_0xa11f('0x43')],'rows':_[_0xa11f('0x37')](_0x36b6cf,function(_0x46188b){return{'id':_0x46188b[_0xa11f('0x34')],'name':_0x46188b[_0xa11f('0x7a')],'custom':_[_0xa11f('0x7b')](_0x46188b[_0xa11f('0x34')],'_c')?!![]:![],'options':_0x46188b[_0xa11f('0x4c')]?_[_0xa11f('0x37')](_[_0xa11f('0x76')](_0x46188b['options']),function(_0x9f9745){return{'name':_0x9f9745[_0xa11f('0x7c')],'value':_0x9f9745['name']};}):[]};})};}})[_0xa11f('0x1a')](respondWithResult(_0x2e317d,null))[_0xa11f('0x24')](function(_0x4a83d0){var _0x1ec8e6=_0x3c125e[_0xa11f('0x3d')]['test']?0x1f4:_0x4a83d0['statusCode']||0x1f4;logger[_0xa11f('0x1e')]('getFields,\x20%s,\x20%s,\x20%s',_0xa11f('0x5f'),_0x1ec8e6,JSON[_0xa11f('0x7d')](_0x4a83d0));delete _0x4a83d0['name'];if(_0x1ec8e6===0x191){_0x1ec8e6=0x190;}_0x2e317d[_0xa11f('0x26')](_0x1ec8e6)[_0xa11f('0x35')](_0x3c125e['query'][_0xa11f('0x17')]?{'message':_0xa11f('0x7e'),'statusCode':_0x4a83d0[_0xa11f('0x7f')]}:_0x4a83d0);});}else{var _0x243540=0x1f4;_0x2e317d[_0xa11f('0x26')](_0x243540)[_0xa11f('0x35')]({'message':_0xa11f('0x7e'),'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 964ebac..5a8867e 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 _0x7427=['int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x440570,_0x2f3707){var _0x178dab=function(_0x931144){while(--_0x931144){_0x440570['push'](_0x440570['shift']());}};_0x178dab(++_0x2f3707);}(_0x7427,0xb7));var _0x7742=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x7427[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x7742('0x0'));var util=require(_0x7742('0x1'));var logger=require(_0x7742('0x2'))('api');var moment=require(_0x7742('0x3'));var BPromise=require(_0x7742('0x4'));var rp=require(_0x7742('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7742('0x6'));var config=require(_0x7742('0x7'));var attributes=require(_0x7742('0x8'));var integrations=require(_0x7742('0x9'));module[_0x7742('0xa')]=function(_0xebbdae,_0x22b052){return _0xebbdae[_0x7742('0xb')]('SugarcrmAccount',attributes,{'tableName':_0x7742('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0053=['int_sugarcrm_accounts','util','../../config/logger','api','moment','request-promise','rimraf','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount'];(function(_0x3f9062,_0x4b1b04){var _0x1959b8=function(_0x10e8db){while(--_0x10e8db){_0x3f9062['push'](_0x3f9062['shift']());}};_0x1959b8(++_0x4b1b04);}(_0x0053,0x14b));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3005('0x0'));var logger=require(_0x3005('0x1'))(_0x3005('0x2'));var moment=require(_0x3005('0x3'));var BPromise=require('bluebird');var rp=require(_0x3005('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3005('0x5'));var config=require('../../config/environment');var attributes=require(_0x3005('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3005('0x7')]=function(_0x3c6aa2,_0xacb443){return _0x3c6aa2[_0x3005('0x8')](_0x3005('0x9'),attributes,{'tableName':_0x3005('0xa'),'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 450ae43..86d4d8a 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 _0x0682=['../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowSugarcrmAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x356972,_0x4e1243){var _0x39163d=function(_0x3a9143){while(--_0x3a9143){_0x356972['push'](_0x356972['shift']());}};_0x39163d(++_0x4e1243);}(_0x0682,0x10f));var _0x2068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0682[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2068('0x0'));var util=require(_0x2068('0x1'));var moment=require(_0x2068('0x2'));var BPromise=require('bluebird');var rs=require(_0x2068('0x3'));var fs=require('fs');var Redis=require(_0x2068('0x4'));var db=require(_0x2068('0x5'))['db'];var utils=require(_0x2068('0x6'));var logger=require(_0x2068('0x7'))(_0x2068('0x8'));var config=require(_0x2068('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2068('0xa')][_0x2068('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48c0a2,_0x3d0b93,_0x5e4311){return new BPromise(function(_0x477082,_0x496059){return client[_0x2068('0xc')](_0x48c0a2,_0x5e4311)[_0x2068('0xd')](function(_0x2f40fb){logger[_0x2068('0xe')](_0x2068('0xf'),_0x3d0b93,_0x2068('0x10'));logger[_0x2068('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3d0b93,_0x2068('0x10'),JSON[_0x2068('0x12')](_0x2f40fb));if(_0x2f40fb[_0x2068('0x13')]){if(_0x2f40fb[_0x2068('0x13')]['code']===0x1f4){logger['error'](_0x2068('0xf'),_0x3d0b93,_0x2f40fb[_0x2068('0x13')][_0x2068('0x14')]);return _0x496059(_0x2f40fb[_0x2068('0x13')][_0x2068('0x14')]);}logger[_0x2068('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x3d0b93,_0x2f40fb['error'][_0x2068('0x14')]);return _0x477082(_0x2f40fb[_0x2068('0x13')]['message']);}else{logger[_0x2068('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x3d0b93,_0x2068('0x10'));_0x477082(_0x2f40fb[_0x2068('0x15')]['message']);}})['catch'](function(_0x24498f){logger[_0x2068('0x13')](_0x2068('0xf'),_0x3d0b93,_0x24498f);_0x496059(_0x24498f);});});}exports[_0x2068('0x16')]=function(_0x433429){var _0x44298a=this;return new Promise(function(_0x17a9a1,_0x1feb28){return db[_0x2068('0x17')][_0x2068('0x18')]({'raw':_0x433429[_0x2068('0x19')]?_0x433429['options'][_0x2068('0x1a')]===undefined?!![]:![]:!![],'where':_0x433429['options']?_0x433429[_0x2068('0x19')][_0x2068('0x1b')]||null:null,'attributes':_0x433429[_0x2068('0x19')]?_0x433429[_0x2068('0x19')][_0x2068('0x1c')]||null:null,'limit':_0x433429[_0x2068('0x19')]?_0x433429[_0x2068('0x19')]['limit']||null:null,'include':_0x433429['options']?_0x433429['options'][_0x2068('0x1d')]?_['map'](_0x433429[_0x2068('0x19')][_0x2068('0x1d')],function(_0x143d1c){return{'model':db[_0x143d1c['model']],'as':_0x143d1c['as'],'attributes':_0x143d1c[_0x2068('0x1c')],'include':_0x143d1c[_0x2068('0x1d')]?_[_0x2068('0x1e')](_0x143d1c[_0x2068('0x1d')],function(_0x24fb3a){return{'model':db[_0x24fb3a['model']],'as':_0x24fb3a['as'],'attributes':_0x24fb3a[_0x2068('0x1c')],'include':_0x24fb3a[_0x2068('0x1d')]?_[_0x2068('0x1e')](_0x24fb3a[_0x2068('0x1d')],function(_0x73fcbb){return{'model':db[_0x73fcbb[_0x2068('0x1f')]],'as':_0x73fcbb['as'],'attributes':_0x73fcbb[_0x2068('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3964a6){logger[_0x2068('0xe')]('GetSugarcrmAccount',_0x433429);logger[_0x2068('0x11')](_0x2068('0x16'),_0x433429,JSON['stringify'](_0x3964a6));_0x17a9a1(_0x3964a6);})[_0x2068('0x20')](function(_0x2c1bfa){logger[_0x2068('0x13')](_0x2068('0x16'),_0x2c1bfa[_0x2068('0x14')],_0x433429);_0x1feb28(_0x44298a[_0x2068('0x13')](0x1f4,_0x2c1bfa['message']));});});};exports[_0x2068('0x21')]=function(_0x2ff3da){var _0x4d1cbe=this;return new Promise(function(_0x157ce1,_0x319e1d){return db['SugarcrmAccount'][_0x2068('0x22')]({'raw':_0x2ff3da[_0x2068('0x19')]?_0x2ff3da[_0x2068('0x19')][_0x2068('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ff3da[_0x2068('0x19')]?_0x2ff3da[_0x2068('0x19')]['where']||null:null,'attributes':_0x2ff3da[_0x2068('0x19')]?_0x2ff3da['options'][_0x2068('0x1c')]||null:null,'include':_0x2ff3da[_0x2068('0x19')]?_0x2ff3da[_0x2068('0x19')][_0x2068('0x1d')]?_[_0x2068('0x1e')](_0x2ff3da[_0x2068('0x19')][_0x2068('0x1d')],function(_0x4f1095){return{'model':db[_0x4f1095[_0x2068('0x1f')]],'as':_0x4f1095['as'],'attributes':_0x4f1095[_0x2068('0x1c')],'include':_0x4f1095['include']?_[_0x2068('0x1e')](_0x4f1095[_0x2068('0x1d')],function(_0x323baa){return{'model':db[_0x323baa['model']],'as':_0x323baa['as'],'attributes':_0x323baa[_0x2068('0x1c')],'include':_0x323baa[_0x2068('0x1d')]?_['map'](_0x323baa[_0x2068('0x1d')],function(_0x5b0fb7){return{'model':db[_0x5b0fb7[_0x2068('0x1f')]],'as':_0x5b0fb7['as'],'attributes':_0x5b0fb7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2068('0xd')](function(_0x103de5){logger[_0x2068('0xe')]('ShowSugarcrmAccount',_0x2ff3da);logger[_0x2068('0x11')](_0x2068('0x21'),_0x2ff3da,JSON['stringify'](_0x103de5));_0x157ce1(_0x103de5);})[_0x2068('0x20')](function(_0x4a7e05){logger['error']('ShowSugarcrmAccount',_0x4a7e05[_0x2068('0x14')],_0x2ff3da);_0x319e1d(_0x4d1cbe['error'](0x1f4,_0x4a7e05[_0x2068('0x14')]));});});}; \ No newline at end of file +var _0x793f=['SugarcrmAccount,\x20%s,\x20%s','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x793f,0x1d6));var _0xf793=function(_0x3c60fc,_0x593ef5){_0x3c60fc=_0x3c60fc-0x0;var _0x495fd2=_0x793f[_0x3c60fc];return _0x495fd2;};'use strict';var _=require(_0xf793('0x0'));var util=require('util');var moment=require(_0xf793('0x1'));var BPromise=require(_0xf793('0x2'));var rs=require(_0xf793('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf793('0x4'))['db'];var utils=require(_0xf793('0x5'));var logger=require(_0xf793('0x6'))(_0xf793('0x7'));var config=require(_0xf793('0x8'));var jayson=require(_0xf793('0x9'));var client=jayson['client'][_0xf793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30fcad,_0x316da2,_0x5faaef){return new BPromise(function(_0x1fff29,_0x1b008b){return client['request'](_0x30fcad,_0x5faaef)[_0xf793('0xb')](function(_0x666e76){logger[_0xf793('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x316da2,_0xf793('0xd'));logger[_0xf793('0xe')](_0xf793('0xf'),_0x316da2,_0xf793('0xd'),JSON[_0xf793('0x10')](_0x666e76));if(_0x666e76[_0xf793('0x11')]){if(_0x666e76['error'][_0xf793('0x12')]===0x1f4){logger[_0xf793('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x316da2,_0x666e76[_0xf793('0x11')]['message']);return _0x1b008b(_0x666e76['error'][_0xf793('0x13')]);}logger[_0xf793('0x11')](_0xf793('0x14'),_0x316da2,_0x666e76[_0xf793('0x11')][_0xf793('0x13')]);return _0x1fff29(_0x666e76[_0xf793('0x11')][_0xf793('0x13')]);}else{logger['info'](_0xf793('0x14'),_0x316da2,_0xf793('0xd'));_0x1fff29(_0x666e76[_0xf793('0x15')]['message']);}})[_0xf793('0x16')](function(_0xd233b7){logger['error'](_0xf793('0x14'),_0x316da2,_0xd233b7);_0x1b008b(_0xd233b7);});});}exports[_0xf793('0x17')]=function(_0x3ddafd){var _0x385f6e=this;return new Promise(function(_0x265cf3,_0x5a5b77){return db[_0xf793('0x18')]['findAll']({'raw':_0x3ddafd[_0xf793('0x19')]?_0x3ddafd[_0xf793('0x19')][_0xf793('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ddafd[_0xf793('0x19')]?_0x3ddafd[_0xf793('0x19')][_0xf793('0x1b')]||null:null,'attributes':_0x3ddafd[_0xf793('0x19')]?_0x3ddafd[_0xf793('0x19')][_0xf793('0x1c')]||null:null,'limit':_0x3ddafd['options']?_0x3ddafd['options'][_0xf793('0x1d')]||null:null,'include':_0x3ddafd[_0xf793('0x19')]?_0x3ddafd[_0xf793('0x19')]['include']?_[_0xf793('0x1e')](_0x3ddafd[_0xf793('0x19')][_0xf793('0x1f')],function(_0x12ab38){return{'model':db[_0x12ab38[_0xf793('0x20')]],'as':_0x12ab38['as'],'attributes':_0x12ab38['attributes'],'include':_0x12ab38[_0xf793('0x1f')]?_[_0xf793('0x1e')](_0x12ab38[_0xf793('0x1f')],function(_0xffc66c){return{'model':db[_0xffc66c[_0xf793('0x20')]],'as':_0xffc66c['as'],'attributes':_0xffc66c[_0xf793('0x1c')],'include':_0xffc66c['include']?_[_0xf793('0x1e')](_0xffc66c['include'],function(_0x37b73f){return{'model':db[_0x37b73f['model']],'as':_0x37b73f['as'],'attributes':_0x37b73f[_0xf793('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf793('0xb')](function(_0x4aaddc){logger[_0xf793('0xc')](_0xf793('0x17'),_0x3ddafd);logger[_0xf793('0xe')](_0xf793('0x17'),_0x3ddafd,JSON[_0xf793('0x10')](_0x4aaddc));_0x265cf3(_0x4aaddc);})['catch'](function(_0x2383a2){logger[_0xf793('0x11')](_0xf793('0x17'),_0x2383a2[_0xf793('0x13')],_0x3ddafd);_0x5a5b77(_0x385f6e[_0xf793('0x11')](0x1f4,_0x2383a2[_0xf793('0x13')]));});});};exports[_0xf793('0x21')]=function(_0x59ff3d){var _0x4059b2=this;return new Promise(function(_0x39a375,_0x37976e){return db[_0xf793('0x18')][_0xf793('0x22')]({'raw':_0x59ff3d[_0xf793('0x19')]?_0x59ff3d[_0xf793('0x19')][_0xf793('0x1a')]===undefined?!![]:![]:!![],'where':_0x59ff3d[_0xf793('0x19')]?_0x59ff3d[_0xf793('0x19')][_0xf793('0x1b')]||null:null,'attributes':_0x59ff3d[_0xf793('0x19')]?_0x59ff3d[_0xf793('0x19')]['attributes']||null:null,'include':_0x59ff3d[_0xf793('0x19')]?_0x59ff3d[_0xf793('0x19')][_0xf793('0x1f')]?_['map'](_0x59ff3d['options'][_0xf793('0x1f')],function(_0x43573a){return{'model':db[_0x43573a[_0xf793('0x20')]],'as':_0x43573a['as'],'attributes':_0x43573a[_0xf793('0x1c')],'include':_0x43573a['include']?_[_0xf793('0x1e')](_0x43573a[_0xf793('0x1f')],function(_0x889fa4){return{'model':db[_0x889fa4[_0xf793('0x20')]],'as':_0x889fa4['as'],'attributes':_0x889fa4[_0xf793('0x1c')],'include':_0x889fa4[_0xf793('0x1f')]?_['map'](_0x889fa4[_0xf793('0x1f')],function(_0x17bcd4){return{'model':db[_0x17bcd4[_0xf793('0x20')]],'as':_0x17bcd4['as'],'attributes':_0x17bcd4[_0xf793('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf793('0xb')](function(_0x53a4c2){logger[_0xf793('0xc')]('ShowSugarcrmAccount',_0x59ff3d);logger[_0xf793('0xe')]('ShowSugarcrmAccount',_0x59ff3d,JSON[_0xf793('0x10')](_0x53a4c2));_0x39a375(_0x53a4c2);})['catch'](function(_0x4b47ee){logger[_0xf793('0x11')](_0xf793('0x21'),_0x4b47ee['message'],_0x59ff3d);_0x37976e(_0x4059b2[_0xf793('0x11')](0x1f4,_0x4b47ee[_0xf793('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e466b7b..13ce384 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 _0x2108=['exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','update','delete','destroy'];(function(_0xcd07c,_0x8f566c){var _0xb99e27=function(_0x2d19d2){while(--_0x2d19d2){_0xcd07c['push'](_0xcd07c['shift']());}};_0xb99e27(++_0x8f566c);}(_0x2108,0x1b9));var _0x8210=function(_0x58a90e,_0x1d15b5){_0x58a90e=_0x58a90e-0x0;var _0x39d48d=_0x2108[_0x58a90e];return _0x39d48d;};'use strict';var multer=require(_0x8210('0x0'));var util=require(_0x8210('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8210('0x2')]();var auth=require(_0x8210('0x3'));var interaction=require(_0x8210('0x4'));var config=require(_0x8210('0x5'));var controller=require(_0x8210('0x6'));router[_0x8210('0x7')]('/',auth[_0x8210('0x8')](),controller['index']);router[_0x8210('0x7')](_0x8210('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8210('0x7')](_0x8210('0xa'),auth[_0x8210('0x8')](),controller[_0x8210('0xb')]);router['get'](_0x8210('0xc'),auth[_0x8210('0x8')](),controller['getSubjects']);router[_0x8210('0x7')](_0x8210('0xd'),auth[_0x8210('0x8')](),controller['getDescriptions']);router[_0x8210('0xe')]('/',auth[_0x8210('0x8')](),controller[_0x8210('0xf')]);router['put'](_0x8210('0x9'),auth[_0x8210('0x8')](),controller[_0x8210('0x10')]);router[_0x8210('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8210('0x12')]);module[_0x8210('0x13')]=router; \ No newline at end of file +var _0x4bd8=['getDescriptions','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','/:id/descriptions'];(function(_0x3a55fd,_0x502578){var _0x47ec50=function(_0x2b799e){while(--_0x2b799e){_0x3a55fd['push'](_0x3a55fd['shift']());}};_0x47ec50(++_0x502578);}(_0x4bd8,0xd7));var _0x84bd=function(_0x379396,_0x2a010e){_0x379396=_0x379396-0x0;var _0x35b218=_0x4bd8[_0x379396];return _0x35b218;};'use strict';var multer=require(_0x84bd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x84bd('0x1'));var express=require(_0x84bd('0x2'));var router=express[_0x84bd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x84bd('0x4'));var config=require(_0x84bd('0x5'));var controller=require(_0x84bd('0x6'));router[_0x84bd('0x7')]('/',auth['isAuthenticated'](),controller[_0x84bd('0x8')]);router[_0x84bd('0x7')](_0x84bd('0x9'),auth['isAuthenticated'](),controller[_0x84bd('0xa')]);router[_0x84bd('0x7')]('/:id/fields',auth[_0x84bd('0xb')](),controller[_0x84bd('0xc')]);router['get'](_0x84bd('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x84bd('0x7')](_0x84bd('0xe'),auth[_0x84bd('0xb')](),controller[_0x84bd('0xf')]);router[_0x84bd('0x10')]('/',auth[_0x84bd('0xb')](),controller[_0x84bd('0x11')]);router[_0x84bd('0x12')]('/:id',auth[_0x84bd('0xb')](),controller[_0x84bd('0x13')]);router[_0x84bd('0x14')](_0x84bd('0x9'),auth[_0x84bd('0xb')](),controller[_0x84bd('0x15')]);module[_0x84bd('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 54e3e91..c545df9 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 _0xb5c7=['STRING','exports'];(function(_0x388a48,_0x51a18f){var _0x6bf646=function(_0x3ad5e3){while(--_0x3ad5e3){_0x388a48['push'](_0x388a48['shift']());}};_0x6bf646(++_0x51a18f);}(_0xb5c7,0x9b));var _0x7b5c=function(_0x1ae7f6,_0x1c810f){_0x1ae7f6=_0x1ae7f6-0x0;var _0x201bb9=_0xb5c7[_0x1ae7f6];return _0x201bb9;};'use strict';var Sequelize=require('sequelize');module[_0x7b5c('0x0')]={'name':{'type':Sequelize[_0x7b5c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x11d5=['exports','STRING'];(function(_0xc55505,_0x5e6a42){var _0x427f93=function(_0x350ce0){while(--_0x350ce0){_0xc55505['push'](_0xc55505['shift']());}};_0x427f93(++_0x5e6a42);}(_0x11d5,0x15a));var _0x511d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x11d5[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x511d('0x0')]={'name':{'type':Sequelize[_0x511d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 3bf5dc7..0903247 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 _0x8888=['where','filter','merge','VIRTUAL','options','count','include','SugarcrmConfiguration','findAll','rows','show','params','keys','rawAttributes','create','body','find','destroy','getFields','findOne','SugarcrmField','sort','pick','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','limit','set','Content-Range','apply','reject','save','update','end','sendStatus','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order'];(function(_0x3ee84d,_0x2b8436){var _0x2838f9=function(_0x250b82){while(--_0x250b82){_0x3ee84d['push'](_0x3ee84d['shift']());}};_0x2838f9(++_0x2b8436);}(_0x8888,0x7c));var _0x8888=function(_0x5bea96,_0x6e3171){_0x5bea96=_0x5bea96-0x0;var _0x273863=_0x8888[_0x5bea96];return _0x273863;};'use strict';var pdf=require(_0x8888('0x0'));var emlformat=require(_0x8888('0x1'));var rimraf=require(_0x8888('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8888('0x3'));var moment=require(_0x8888('0x4'));var BPromise=require(_0x8888('0x5'));var Mustache=require(_0x8888('0x6'));var util=require(_0x8888('0x7'));var path=require(_0x8888('0x8'));var sox=require(_0x8888('0x9'));var csv=require('to-csv');var ejs=require(_0x8888('0xa'));var fs=require('fs');var _=require(_0x8888('0xb'));var squel=require(_0x8888('0xc'));var crypto=require('crypto');var jsforce=require(_0x8888('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8888('0xe'));var querystring=require(_0x8888('0xf'));var Papa=require(_0x8888('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8888('0x11'));var as=require(_0x8888('0x12'));var hardwareService=require(_0x8888('0x13'));var logger=require(_0x8888('0x14'))(_0x8888('0x15'));var utils=require(_0x8888('0x16'));var config=require(_0x8888('0x17'));var db=require(_0x8888('0x18'))['db'];var jayson=require(_0x8888('0x19'));var client=jayson[_0x8888('0x1a')][_0x8888('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1c9773,_0x2d063b,_0x4cb396){if(_0x4cb396){var _0x2d27df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d27df[_0x8888('0x1c')](_0x2d063b)){return _0x1c9773;}else{throw new db[(_0x8888('0x1d'))][(_0x8888('0x1e'))](_0x8888('0x1f'));}}else{return _0x1c9773;}}function respondWithRpcPromise(_0x2f6fe7,_0x511ea1,_0x1c2b86,_0x9f5385){return new BPromise(function(_0x312113,_0x342ac0){var _0x2b36dd=_0x9f5385||client;return _0x2b36dd[_0x8888('0x20')](_0x2f6fe7,_0x1c2b86)[_0x8888('0x21')](function(_0x3e8c10){logger[_0x8888('0x22')](_0x8888('0x23'),_0x511ea1,_0x8888('0x24'));logger[_0x8888('0x25')](_0x8888('0x26'),_0x511ea1,'request\x20sent',JSON[_0x8888('0x27')](_0x3e8c10));if(_0x3e8c10['error']){if(_0x3e8c10[_0x8888('0x28')][_0x8888('0x29')]===0x1f4){logger[_0x8888('0x28')](_0x8888('0x23'),_0x511ea1,_0x3e8c10[_0x8888('0x28')][_0x8888('0x2a')]);return _0x342ac0(_0x3e8c10[_0x8888('0x28')][_0x8888('0x2a')]);}logger[_0x8888('0x28')](_0x8888('0x23'),_0x511ea1,_0x3e8c10['error'][_0x8888('0x2a')]);return _0x312113(_0x3e8c10['error'][_0x8888('0x2a')]);}else{logger[_0x8888('0x22')](_0x8888('0x23'),_0x511ea1,_0x8888('0x24'));_0x312113(_0x3e8c10[_0x8888('0x2b')][_0x8888('0x2a')]);}})[_0x8888('0x2c')](function(_0x47ffb9){logger[_0x8888('0x28')](_0x8888('0x23'),_0x511ea1,_0x47ffb9);_0x342ac0(_0x47ffb9);});});}function respondWithStatusCode(_0x4600d5,_0x14f1da){_0x14f1da=_0x14f1da||0xcc;return function(_0x3e4d87){if(_0x3e4d87){return _0x4600d5['sendStatus'](_0x14f1da);}return _0x4600d5[_0x8888('0x2d')](_0x14f1da)['end']();};}function respondWithResult(_0xbcb8e2,_0x4f2fee){_0x4f2fee=_0x4f2fee||0xc8;return function(_0x1f04c7){if(_0x1f04c7){return _0xbcb8e2[_0x8888('0x2d')](_0x4f2fee)[_0x8888('0x2e')](_0x1f04c7);}};}function respondWithFilteredResult(_0x5e162f,_0x5abc6e){return function(_0x5df51f){if(_0x5df51f){var _0x103fef=_0x5df51f['count'],_0x56ce78=_0x5abc6e['offset'],_0x118f10=_0x5abc6e['offset']+_0x5abc6e[_0x8888('0x2f')],_0x31e5c5;if(_0x118f10>=_0x103fef){_0x118f10=_0x103fef;_0x31e5c5=0xc8;}else{_0x31e5c5=0xce;}_0x5e162f['status'](_0x31e5c5);return _0x5e162f[_0x8888('0x30')](_0x8888('0x31'),_0x56ce78+'-'+_0x118f10+'/'+_0x103fef)[_0x8888('0x2e')](_0x5df51f);}return null;};}function patchUpdates(_0x2af4a6){return function(_0x285502){try{jsonpatch[_0x8888('0x32')](_0x285502,_0x2af4a6,!![]);}catch(_0x43d3f1){return BPromise[_0x8888('0x33')](_0x43d3f1);}return _0x285502[_0x8888('0x34')]();};}function saveUpdates(_0x42b1b2,_0x4c27c8){return function(_0x501980){if(_0x501980){return _0x501980[_0x8888('0x35')](_0x42b1b2)[_0x8888('0x21')](function(_0x5a11b8){return _0x5a11b8;});}return null;};}function removeEntity(_0x20f850,_0x4ec309){return function(_0x2bd2eb){if(_0x2bd2eb){return _0x2bd2eb['destroy']()[_0x8888('0x21')](function(){_0x20f850[_0x8888('0x2d')](0xcc)[_0x8888('0x36')]();});}};}function handleEntityNotFound(_0x13937c,_0x44769a){return function(_0x366b50){if(!_0x366b50){_0x13937c[_0x8888('0x37')](0x194);}return _0x366b50;};}function handleError(_0x2feda5,_0x315ea7){_0x315ea7=_0x315ea7||0x1f4;return function(_0x3021e9){logger[_0x8888('0x28')](_0x3021e9['stack']);if(_0x3021e9['name']){delete _0x3021e9[_0x8888('0x38')];}_0x2feda5['status'](_0x315ea7)[_0x8888('0x39')](_0x3021e9);};}exports['index']=function(_0x294249,_0x280fc9){var _0x4c6646={},_0x410f03={},_0x194837={'count':0x0,'rows':[]};var _0x4f0f55=_['map'](db['SugarcrmConfiguration']['rawAttributes'],function(_0x1dbbd5){return{'name':_0x1dbbd5[_0x8888('0x3a')],'type':_0x1dbbd5[_0x8888('0x3b')][_0x8888('0x3c')]};});_0x410f03[_0x8888('0x3d')]=_[_0x8888('0x3e')](_0x4f0f55,'name');_0x410f03[_0x8888('0x3f')]=_['keys'](_0x294249['query']);_0x410f03[_0x8888('0x40')]=_[_0x8888('0x41')](_0x410f03[_0x8888('0x3d')],_0x410f03['query']);_0x4c6646[_0x8888('0x42')]=_[_0x8888('0x41')](_0x410f03[_0x8888('0x3d')],qs[_0x8888('0x43')](_0x294249[_0x8888('0x3f')][_0x8888('0x43')]));_0x4c6646['attributes']=_0x4c6646[_0x8888('0x42')][_0x8888('0x44')]?_0x4c6646[_0x8888('0x42')]:_0x410f03['model'];if(!_0x294249[_0x8888('0x3f')][_0x8888('0x45')]('nolimit')){_0x4c6646[_0x8888('0x2f')]=qs['limit'](_0x294249[_0x8888('0x3f')]['limit']);_0x4c6646['offset']=qs['offset'](_0x294249['query'][_0x8888('0x46')]);}_0x4c6646[_0x8888('0x47')]=qs['sort'](_0x294249[_0x8888('0x3f')]['sort']);_0x4c6646[_0x8888('0x48')]=qs[_0x8888('0x40')](_['pick'](_0x294249[_0x8888('0x3f')],_0x410f03[_0x8888('0x40')]));if(_0x294249[_0x8888('0x3f')][_0x8888('0x49')]){_0x4c6646[_0x8888('0x48')]=_[_0x8888('0x4a')](_0x4c6646['where'],{'$or':_[_0x8888('0x3e')](_0x4f0f55,function(_0x438251){if(_0x438251[_0x8888('0x3b')]!==_0x8888('0x4b')){var _0x5f0069={};_0x5f0069[_0x438251[_0x8888('0x38')]]={'$like':'%'+_0x294249['query'][_0x8888('0x49')]+'%'};return _0x5f0069;}})});}_0x4c6646=_['merge']({},_0x4c6646,_0x294249[_0x8888('0x4c')]);var _0x4cd9f4={'where':_0x4c6646[_0x8888('0x48')]};return db['SugarcrmConfiguration'][_0x8888('0x4d')](_0x4cd9f4)[_0x8888('0x21')](function(_0x333a7b){_0x194837[_0x8888('0x4d')]=_0x333a7b;if(_0x294249['query']['includeAll']){_0x4c6646[_0x8888('0x4e')]=[{'all':!![]}];}return db[_0x8888('0x4f')][_0x8888('0x50')](_0x4c6646);})[_0x8888('0x21')](function(_0x2c0dd2){_0x194837[_0x8888('0x51')]=_0x2c0dd2;return _0x194837;})[_0x8888('0x21')](respondWithFilteredResult(_0x280fc9,_0x4c6646))[_0x8888('0x2c')](handleError(_0x280fc9,null));};exports[_0x8888('0x52')]=function(_0x3c559b,_0x1d7cd0){var _0x4be938={'raw':![],'where':{'id':_0x3c559b[_0x8888('0x53')]['id']}},_0x3cbc25={};_0x3cbc25[_0x8888('0x3d')]=_[_0x8888('0x54')](db['SugarcrmConfiguration'][_0x8888('0x55')]);_0x3cbc25[_0x8888('0x3f')]=_[_0x8888('0x54')](_0x3c559b['query']);_0x3cbc25[_0x8888('0x40')]=_[_0x8888('0x41')](_0x3cbc25[_0x8888('0x3d')],_0x3cbc25[_0x8888('0x3f')]);_0x4be938[_0x8888('0x42')]=_['intersection'](_0x3cbc25[_0x8888('0x3d')],qs[_0x8888('0x43')](_0x3c559b[_0x8888('0x3f')][_0x8888('0x43')]));_0x4be938[_0x8888('0x42')]=_0x4be938[_0x8888('0x42')][_0x8888('0x44')]?_0x4be938['attributes']:_0x3cbc25[_0x8888('0x3d')];if(_0x3c559b['query']['includeAll']){_0x4be938[_0x8888('0x4e')]=[{'all':!![]}];}_0x4be938=_[_0x8888('0x4a')]({},_0x4be938,_0x3c559b[_0x8888('0x4c')]);return db[_0x8888('0x4f')]['find'](_0x4be938)['then'](handleEntityNotFound(_0x1d7cd0,null))['then'](respondWithResult(_0x1d7cd0,null))['catch'](handleError(_0x1d7cd0,null));};exports[_0x8888('0x56')]=function(_0xff6197,_0x506917){return db[_0x8888('0x4f')][_0x8888('0x56')](_0xff6197['body'],{})[_0x8888('0x21')](respondWithResult(_0x506917,0xc9))['catch'](handleError(_0x506917,null));};exports[_0x8888('0x35')]=function(_0x4981ce,_0x1f07f9){if(_0x4981ce[_0x8888('0x57')]['id']){delete _0x4981ce[_0x8888('0x57')]['id'];}return db['SugarcrmConfiguration'][_0x8888('0x58')]({'where':{'id':_0x4981ce[_0x8888('0x53')]['id']}})[_0x8888('0x21')](handleEntityNotFound(_0x1f07f9,null))[_0x8888('0x21')](saveUpdates(_0x4981ce[_0x8888('0x57')],null))[_0x8888('0x21')](respondWithResult(_0x1f07f9,null))['catch'](handleError(_0x1f07f9,null));};exports[_0x8888('0x59')]=function(_0x14b27b,_0x1fbef4){return db[_0x8888('0x4f')]['find']({'where':{'id':_0x14b27b[_0x8888('0x53')]['id']}})[_0x8888('0x21')](handleEntityNotFound(_0x1fbef4,null))[_0x8888('0x21')](removeEntity(_0x1fbef4,null))['catch'](handleError(_0x1fbef4,null));};exports[_0x8888('0x5a')]=function(_0x1a8bff,_0x13523e,_0x1993f1){var _0x4c277c={};var _0x15c0e8={};var _0x2d2efa;var _0x5eadc;return db[_0x8888('0x4f')][_0x8888('0x5b')]({'where':{'id':_0x1a8bff[_0x8888('0x53')]['id']}})[_0x8888('0x21')](handleEntityNotFound(_0x13523e,null))[_0x8888('0x21')](function(_0x242a92){if(_0x242a92){_0x2d2efa=_0x242a92;_0x15c0e8['model']=_[_0x8888('0x54')](db[_0x8888('0x5c')][_0x8888('0x55')]);_0x15c0e8[_0x8888('0x3f')]=_[_0x8888('0x54')](_0x1a8bff['query']);_0x15c0e8[_0x8888('0x40')]=_[_0x8888('0x41')](_0x15c0e8[_0x8888('0x3d')],_0x15c0e8[_0x8888('0x3f')]);_0x4c277c[_0x8888('0x42')]=_[_0x8888('0x41')](_0x15c0e8[_0x8888('0x3d')],qs[_0x8888('0x43')](_0x1a8bff['query'][_0x8888('0x43')]));_0x4c277c[_0x8888('0x42')]=_0x4c277c[_0x8888('0x42')][_0x8888('0x44')]?_0x4c277c[_0x8888('0x42')]:_0x15c0e8[_0x8888('0x3d')];_0x4c277c[_0x8888('0x47')]=qs[_0x8888('0x5d')](_0x1a8bff['query']['sort']);_0x4c277c[_0x8888('0x48')]=qs['filters'](_[_0x8888('0x5e')](_0x1a8bff[_0x8888('0x3f')],_0x15c0e8[_0x8888('0x40')]));if(_0x1a8bff['query'][_0x8888('0x49')]){_0x4c277c[_0x8888('0x48')]=_[_0x8888('0x4a')](_0x4c277c[_0x8888('0x48')],{'$or':_[_0x8888('0x3e')](_0x4c277c[_0x8888('0x42')],function(_0x1129f8){var _0x69857b={};_0x69857b[_0x1129f8]={'$like':'%'+_0x1a8bff[_0x8888('0x3f')][_0x8888('0x49')]+'%'};return _0x69857b;})});}_0x4c277c=_[_0x8888('0x4a')]({},_0x4c277c,_0x1a8bff[_0x8888('0x4c')]);return _0x2d2efa[_0x8888('0x5a')](_0x4c277c);}})[_0x8888('0x21')](function(_0x4172cb){if(_0x4172cb){_0x5eadc=_0x4172cb['length'];if(!_0x1a8bff[_0x8888('0x3f')][_0x8888('0x45')](_0x8888('0x5f'))){_0x4c277c[_0x8888('0x2f')]=qs['limit'](_0x1a8bff[_0x8888('0x3f')][_0x8888('0x2f')]);_0x4c277c[_0x8888('0x46')]=qs[_0x8888('0x46')](_0x1a8bff[_0x8888('0x3f')][_0x8888('0x46')]);}return _0x2d2efa['getFields'](_0x4c277c);}})[_0x8888('0x21')](function(_0x2f6a47){if(_0x2f6a47){return _0x2f6a47?{'count':_0x5eadc,'rows':_0x2f6a47}:null;}})[_0x8888('0x21')](respondWithResult(_0x13523e,null))[_0x8888('0x2c')](handleError(_0x13523e,null));};exports[_0x8888('0x60')]=function(_0x5154c3,_0x820842,_0x39b79d){var _0x205515={};var _0x1b998f={};var _0x557d17;var _0x14b266;return db[_0x8888('0x4f')]['findOne']({'where':{'id':_0x5154c3[_0x8888('0x53')]['id']}})['then'](handleEntityNotFound(_0x820842,null))[_0x8888('0x21')](function(_0x31bdf2){if(_0x31bdf2){_0x557d17=_0x31bdf2;_0x1b998f[_0x8888('0x3d')]=_['keys'](db['SugarcrmField'][_0x8888('0x55')]);_0x1b998f[_0x8888('0x3f')]=_['keys'](_0x5154c3[_0x8888('0x3f')]);_0x1b998f[_0x8888('0x40')]=_[_0x8888('0x41')](_0x1b998f[_0x8888('0x3d')],_0x1b998f['query']);_0x205515[_0x8888('0x42')]=_['intersection'](_0x1b998f[_0x8888('0x3d')],qs[_0x8888('0x43')](_0x5154c3[_0x8888('0x3f')][_0x8888('0x43')]));_0x205515[_0x8888('0x42')]=_0x205515[_0x8888('0x42')]['length']?_0x205515[_0x8888('0x42')]:_0x1b998f[_0x8888('0x3d')];_0x205515[_0x8888('0x47')]=qs[_0x8888('0x5d')](_0x5154c3[_0x8888('0x3f')][_0x8888('0x5d')]);_0x205515['where']=qs[_0x8888('0x40')](_[_0x8888('0x5e')](_0x5154c3[_0x8888('0x3f')],_0x1b998f[_0x8888('0x40')]));if(_0x5154c3['query'][_0x8888('0x49')]){_0x205515[_0x8888('0x48')]=_[_0x8888('0x4a')](_0x205515[_0x8888('0x48')],{'$or':_[_0x8888('0x3e')](_0x205515['attributes'],function(_0x4b737b){var _0x469397={};_0x469397[_0x4b737b]={'$like':'%'+_0x5154c3[_0x8888('0x3f')][_0x8888('0x49')]+'%'};return _0x469397;})});}_0x205515=_[_0x8888('0x4a')]({},_0x205515,_0x5154c3['options']);return _0x557d17[_0x8888('0x60')](_0x205515);}})['then'](function(_0x226de0){if(_0x226de0){_0x14b266=_0x226de0['length'];if(!_0x5154c3[_0x8888('0x3f')]['hasOwnProperty'](_0x8888('0x5f'))){_0x205515[_0x8888('0x2f')]=qs[_0x8888('0x2f')](_0x5154c3[_0x8888('0x3f')]['limit']);_0x205515[_0x8888('0x46')]=qs[_0x8888('0x46')](_0x5154c3['query'][_0x8888('0x46')]);}return _0x557d17['getSubjects'](_0x205515);}})[_0x8888('0x21')](function(_0x3bf290){if(_0x3bf290){return _0x3bf290?{'count':_0x14b266,'rows':_0x3bf290}:null;}})['then'](respondWithResult(_0x820842,null))[_0x8888('0x2c')](handleError(_0x820842,null));};exports[_0x8888('0x61')]=function(_0x28f7d6,_0x1d06ea,_0xe1337c){var _0x1520a3={};var _0x1475e7={};var _0x572279;var _0x2231b7;return db[_0x8888('0x4f')][_0x8888('0x5b')]({'where':{'id':_0x28f7d6[_0x8888('0x53')]['id']}})['then'](handleEntityNotFound(_0x1d06ea,null))['then'](function(_0x4884b3){if(_0x4884b3){_0x572279=_0x4884b3;_0x1475e7[_0x8888('0x3d')]=_[_0x8888('0x54')](db['SugarcrmField'][_0x8888('0x55')]);_0x1475e7[_0x8888('0x3f')]=_[_0x8888('0x54')](_0x28f7d6[_0x8888('0x3f')]);_0x1475e7[_0x8888('0x40')]=_[_0x8888('0x41')](_0x1475e7[_0x8888('0x3d')],_0x1475e7['query']);_0x1520a3['attributes']=_[_0x8888('0x41')](_0x1475e7[_0x8888('0x3d')],qs[_0x8888('0x43')](_0x28f7d6['query'][_0x8888('0x43')]));_0x1520a3['attributes']=_0x1520a3[_0x8888('0x42')][_0x8888('0x44')]?_0x1520a3[_0x8888('0x42')]:_0x1475e7[_0x8888('0x3d')];_0x1520a3['order']=qs[_0x8888('0x5d')](_0x28f7d6[_0x8888('0x3f')][_0x8888('0x5d')]);_0x1520a3[_0x8888('0x48')]=qs[_0x8888('0x40')](_['pick'](_0x28f7d6[_0x8888('0x3f')],_0x1475e7['filters']));if(_0x28f7d6[_0x8888('0x3f')][_0x8888('0x49')]){_0x1520a3[_0x8888('0x48')]=_['merge'](_0x1520a3[_0x8888('0x48')],{'$or':_[_0x8888('0x3e')](_0x1520a3[_0x8888('0x42')],function(_0x5a201d){var _0x261439={};_0x261439[_0x5a201d]={'$like':'%'+_0x28f7d6[_0x8888('0x3f')][_0x8888('0x49')]+'%'};return _0x261439;})});}_0x1520a3=_[_0x8888('0x4a')]({},_0x1520a3,_0x28f7d6[_0x8888('0x4c')]);return _0x572279[_0x8888('0x61')](_0x1520a3);}})[_0x8888('0x21')](function(_0x2ce63d){if(_0x2ce63d){_0x2231b7=_0x2ce63d[_0x8888('0x44')];if(!_0x28f7d6[_0x8888('0x3f')][_0x8888('0x45')](_0x8888('0x5f'))){_0x1520a3[_0x8888('0x2f')]=qs['limit'](_0x28f7d6[_0x8888('0x3f')][_0x8888('0x2f')]);_0x1520a3[_0x8888('0x46')]=qs['offset'](_0x28f7d6[_0x8888('0x3f')]['offset']);}return _0x572279['getDescriptions'](_0x1520a3);}})['then'](function(_0x65f149){if(_0x65f149){return _0x65f149?{'count':_0x2231b7,'rows':_0x65f149}:null;}})[_0x8888('0x21')](respondWithResult(_0x1d06ea,null))[_0x8888('0x2c')](handleError(_0x1d06ea,null));}; \ No newline at end of file +var _0x2161=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','destroy','stack','send','SugarcrmConfiguration','rawAttributes','fieldName','type','map','name','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','count','includeAll','include','findAll','rows','create','body','getFields','findOne','params','nolimit','getSubjects','getDescriptions','SugarcrmField','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x2161,0x1a7));var _0x1216=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x2161[_0x5c1345];return _0x1c070d;};'use strict';var pdf=require(_0x1216('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1216('0x1'));var zipdir=require(_0x1216('0x2'));var jsonpatch=require(_0x1216('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1216('0x4'));var Mustache=require(_0x1216('0x5'));var util=require(_0x1216('0x6'));var path=require(_0x1216('0x7'));var sox=require(_0x1216('0x8'));var csv=require('to-csv');var ejs=require(_0x1216('0x9'));var fs=require('fs');var _=require(_0x1216('0xa'));var squel=require(_0x1216('0xb'));var crypto=require('crypto');var jsforce=require(_0x1216('0xc'));var deskjs=require(_0x1216('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1216('0xe'));var Papa=require(_0x1216('0xf'));var Redis=require(_0x1216('0x10'));var authService=require(_0x1216('0x11'));var qs=require(_0x1216('0x12'));var as=require(_0x1216('0x13'));var hardwareService=require(_0x1216('0x14'));var logger=require(_0x1216('0x15'))(_0x1216('0x16'));var utils=require('../../config/utils');var config=require(_0x1216('0x17'));var db=require(_0x1216('0x18'))['db'];var jayson=require(_0x1216('0x19'));var client=jayson[_0x1216('0x1a')][_0x1216('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2f3eb2,_0x2b798f,_0x142f2f){if(_0x142f2f){var _0x3dd671=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3dd671[_0x1216('0x1c')](_0x2b798f)){return _0x2f3eb2;}else{throw new db[(_0x1216('0x1d'))]['ValidationError'](_0x1216('0x1e'));}}else{return _0x2f3eb2;}}function respondWithRpcPromise(_0x3e9404,_0x49edb3,_0x7f1ee1,_0x3aaef3){return new BPromise(function(_0x18aad0,_0x5d6848){var _0x333612=_0x3aaef3||client;return _0x333612['request'](_0x3e9404,_0x7f1ee1)[_0x1216('0x1f')](function(_0x1c24e7){logger[_0x1216('0x20')](_0x1216('0x21'),_0x49edb3,_0x1216('0x22'));logger[_0x1216('0x23')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x49edb3,_0x1216('0x22'),JSON[_0x1216('0x24')](_0x1c24e7));if(_0x1c24e7['error']){if(_0x1c24e7[_0x1216('0x25')][_0x1216('0x26')]===0x1f4){logger[_0x1216('0x25')](_0x1216('0x21'),_0x49edb3,_0x1c24e7[_0x1216('0x25')][_0x1216('0x27')]);return _0x5d6848(_0x1c24e7['error'][_0x1216('0x27')]);}logger[_0x1216('0x25')](_0x1216('0x21'),_0x49edb3,_0x1c24e7[_0x1216('0x25')][_0x1216('0x27')]);return _0x18aad0(_0x1c24e7[_0x1216('0x25')]['message']);}else{logger[_0x1216('0x20')](_0x1216('0x21'),_0x49edb3,_0x1216('0x22'));_0x18aad0(_0x1c24e7[_0x1216('0x28')][_0x1216('0x27')]);}})[_0x1216('0x29')](function(_0x240f33){logger['error'](_0x1216('0x21'),_0x49edb3,_0x240f33);_0x5d6848(_0x240f33);});});}function respondWithStatusCode(_0x825fe1,_0x31289b){_0x31289b=_0x31289b||0xcc;return function(_0x5c6bd0){if(_0x5c6bd0){return _0x825fe1[_0x1216('0x2a')](_0x31289b);}return _0x825fe1[_0x1216('0x2b')](_0x31289b)[_0x1216('0x2c')]();};}function respondWithResult(_0x534014,_0x363873){_0x363873=_0x363873||0xc8;return function(_0x511100){if(_0x511100){return _0x534014[_0x1216('0x2b')](_0x363873)[_0x1216('0x2d')](_0x511100);}};}function respondWithFilteredResult(_0x185ee0,_0x42bf41){return function(_0x2b9683){if(_0x2b9683){var _0x48451a=_0x2b9683['count'],_0x3031a9=_0x42bf41['offset'],_0x4855ed=_0x42bf41[_0x1216('0x2e')]+_0x42bf41[_0x1216('0x2f')],_0x414120;if(_0x4855ed>=_0x48451a){_0x4855ed=_0x48451a;_0x414120=0xc8;}else{_0x414120=0xce;}_0x185ee0[_0x1216('0x2b')](_0x414120);return _0x185ee0[_0x1216('0x30')](_0x1216('0x31'),_0x3031a9+'-'+_0x4855ed+'/'+_0x48451a)[_0x1216('0x2d')](_0x2b9683);}return null;};}function patchUpdates(_0x31ff38){return function(_0x4534f4){try{jsonpatch['apply'](_0x4534f4,_0x31ff38,!![]);}catch(_0x2b5141){return BPromise['reject'](_0x2b5141);}return _0x4534f4[_0x1216('0x32')]();};}function saveUpdates(_0x173b29,_0x2cfd46){return function(_0x2127b3){if(_0x2127b3){return _0x2127b3[_0x1216('0x33')](_0x173b29)[_0x1216('0x1f')](function(_0x595b52){return _0x595b52;});}return null;};}function removeEntity(_0x5599a0,_0x1b0863){return function(_0x4313ce){if(_0x4313ce){return _0x4313ce[_0x1216('0x34')]()['then'](function(){_0x5599a0[_0x1216('0x2b')](0xcc)[_0x1216('0x2c')]();});}};}function handleEntityNotFound(_0x34fa39,_0x3dad22){return function(_0x3d0d0d){if(!_0x3d0d0d){_0x34fa39[_0x1216('0x2a')](0x194);}return _0x3d0d0d;};}function handleError(_0x46e6df,_0x3ba4be){_0x3ba4be=_0x3ba4be||0x1f4;return function(_0x310400){logger[_0x1216('0x25')](_0x310400[_0x1216('0x35')]);if(_0x310400['name']){delete _0x310400['name'];}_0x46e6df[_0x1216('0x2b')](_0x3ba4be)[_0x1216('0x36')](_0x310400);};}exports['index']=function(_0x520688,_0x4c1f4e){var _0x1d80a6={},_0x19e404={},_0x3a4573={'count':0x0,'rows':[]};var _0x1b2655=_['map'](db[_0x1216('0x37')][_0x1216('0x38')],function(_0x50b952){return{'name':_0x50b952[_0x1216('0x39')],'type':_0x50b952[_0x1216('0x3a')]['key']};});_0x19e404['model']=_[_0x1216('0x3b')](_0x1b2655,_0x1216('0x3c'));_0x19e404[_0x1216('0x3d')]=_[_0x1216('0x3e')](_0x520688[_0x1216('0x3d')]);_0x19e404['filters']=_['intersection'](_0x19e404[_0x1216('0x3f')],_0x19e404[_0x1216('0x3d')]);_0x1d80a6[_0x1216('0x40')]=_[_0x1216('0x41')](_0x19e404[_0x1216('0x3f')],qs[_0x1216('0x42')](_0x520688[_0x1216('0x3d')][_0x1216('0x42')]));_0x1d80a6[_0x1216('0x40')]=_0x1d80a6[_0x1216('0x40')][_0x1216('0x43')]?_0x1d80a6[_0x1216('0x40')]:_0x19e404[_0x1216('0x3f')];if(!_0x520688[_0x1216('0x3d')][_0x1216('0x44')]('nolimit')){_0x1d80a6[_0x1216('0x2f')]=qs['limit'](_0x520688['query']['limit']);_0x1d80a6[_0x1216('0x2e')]=qs['offset'](_0x520688[_0x1216('0x3d')][_0x1216('0x2e')]);}_0x1d80a6[_0x1216('0x45')]=qs[_0x1216('0x46')](_0x520688[_0x1216('0x3d')][_0x1216('0x46')]);_0x1d80a6[_0x1216('0x47')]=qs[_0x1216('0x48')](_[_0x1216('0x49')](_0x520688[_0x1216('0x3d')],_0x19e404['filters']));if(_0x520688['query']['filter']){_0x1d80a6['where']=_[_0x1216('0x4a')](_0x1d80a6[_0x1216('0x47')],{'$or':_[_0x1216('0x3b')](_0x1b2655,function(_0x1f8f28){if(_0x1f8f28['type']!=='VIRTUAL'){var _0x39d69c={};_0x39d69c[_0x1f8f28[_0x1216('0x3c')]]={'$like':'%'+_0x520688['query'][_0x1216('0x4b')]+'%'};return _0x39d69c;}})});}_0x1d80a6=_[_0x1216('0x4a')]({},_0x1d80a6,_0x520688[_0x1216('0x4c')]);var _0x547a5e={'where':_0x1d80a6[_0x1216('0x47')]};return db[_0x1216('0x37')][_0x1216('0x4d')](_0x547a5e)[_0x1216('0x1f')](function(_0x27f205){_0x3a4573[_0x1216('0x4d')]=_0x27f205;if(_0x520688[_0x1216('0x3d')][_0x1216('0x4e')]){_0x1d80a6[_0x1216('0x4f')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1216('0x50')](_0x1d80a6);})[_0x1216('0x1f')](function(_0x58f44c){_0x3a4573[_0x1216('0x51')]=_0x58f44c;return _0x3a4573;})[_0x1216('0x1f')](respondWithFilteredResult(_0x4c1f4e,_0x1d80a6))[_0x1216('0x29')](handleError(_0x4c1f4e,null));};exports['show']=function(_0x4346aa,_0x209d32){var _0x12b841={'raw':![],'where':{'id':_0x4346aa['params']['id']}},_0x4d3091={};_0x4d3091[_0x1216('0x3f')]=_[_0x1216('0x3e')](db[_0x1216('0x37')][_0x1216('0x38')]);_0x4d3091['query']=_[_0x1216('0x3e')](_0x4346aa[_0x1216('0x3d')]);_0x4d3091['filters']=_[_0x1216('0x41')](_0x4d3091[_0x1216('0x3f')],_0x4d3091[_0x1216('0x3d')]);_0x12b841[_0x1216('0x40')]=_[_0x1216('0x41')](_0x4d3091[_0x1216('0x3f')],qs['fields'](_0x4346aa[_0x1216('0x3d')][_0x1216('0x42')]));_0x12b841[_0x1216('0x40')]=_0x12b841['attributes'][_0x1216('0x43')]?_0x12b841[_0x1216('0x40')]:_0x4d3091[_0x1216('0x3f')];if(_0x4346aa['query']['includeAll']){_0x12b841[_0x1216('0x4f')]=[{'all':!![]}];}_0x12b841=_[_0x1216('0x4a')]({},_0x12b841,_0x4346aa['options']);return db['SugarcrmConfiguration']['find'](_0x12b841)[_0x1216('0x1f')](handleEntityNotFound(_0x209d32,null))[_0x1216('0x1f')](respondWithResult(_0x209d32,null))['catch'](handleError(_0x209d32,null));};exports[_0x1216('0x52')]=function(_0x5d2be7,_0x468c74){return db[_0x1216('0x37')][_0x1216('0x52')](_0x5d2be7[_0x1216('0x53')],{})[_0x1216('0x1f')](respondWithResult(_0x468c74,0xc9))[_0x1216('0x29')](handleError(_0x468c74,null));};exports['update']=function(_0x137309,_0x313136){if(_0x137309[_0x1216('0x53')]['id']){delete _0x137309['body']['id'];}return db[_0x1216('0x37')]['find']({'where':{'id':_0x137309['params']['id']}})['then'](handleEntityNotFound(_0x313136,null))['then'](saveUpdates(_0x137309[_0x1216('0x53')],null))[_0x1216('0x1f')](respondWithResult(_0x313136,null))['catch'](handleError(_0x313136,null));};exports[_0x1216('0x34')]=function(_0x52c879,_0x23c26e){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x52c879['params']['id']}})[_0x1216('0x1f')](handleEntityNotFound(_0x23c26e,null))['then'](removeEntity(_0x23c26e,null))[_0x1216('0x29')](handleError(_0x23c26e,null));};exports[_0x1216('0x54')]=function(_0xe7db8c,_0x22f094,_0x46f764){var _0x279426={};var _0xae485d={};var _0x2b6dbe;var _0x3d3b40;return db[_0x1216('0x37')][_0x1216('0x55')]({'where':{'id':_0xe7db8c[_0x1216('0x56')]['id']}})[_0x1216('0x1f')](handleEntityNotFound(_0x22f094,null))[_0x1216('0x1f')](function(_0x1db5ab){if(_0x1db5ab){_0x2b6dbe=_0x1db5ab;_0xae485d[_0x1216('0x3f')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0xae485d[_0x1216('0x3d')]=_[_0x1216('0x3e')](_0xe7db8c[_0x1216('0x3d')]);_0xae485d[_0x1216('0x48')]=_['intersection'](_0xae485d[_0x1216('0x3f')],_0xae485d[_0x1216('0x3d')]);_0x279426[_0x1216('0x40')]=_['intersection'](_0xae485d[_0x1216('0x3f')],qs[_0x1216('0x42')](_0xe7db8c[_0x1216('0x3d')][_0x1216('0x42')]));_0x279426[_0x1216('0x40')]=_0x279426[_0x1216('0x40')][_0x1216('0x43')]?_0x279426[_0x1216('0x40')]:_0xae485d[_0x1216('0x3f')];_0x279426[_0x1216('0x45')]=qs[_0x1216('0x46')](_0xe7db8c['query'][_0x1216('0x46')]);_0x279426['where']=qs[_0x1216('0x48')](_['pick'](_0xe7db8c['query'],_0xae485d['filters']));if(_0xe7db8c[_0x1216('0x3d')][_0x1216('0x4b')]){_0x279426[_0x1216('0x47')]=_[_0x1216('0x4a')](_0x279426[_0x1216('0x47')],{'$or':_[_0x1216('0x3b')](_0x279426[_0x1216('0x40')],function(_0x4fdec0){var _0x501384={};_0x501384[_0x4fdec0]={'$like':'%'+_0xe7db8c[_0x1216('0x3d')]['filter']+'%'};return _0x501384;})});}_0x279426=_[_0x1216('0x4a')]({},_0x279426,_0xe7db8c[_0x1216('0x4c')]);return _0x2b6dbe['getFields'](_0x279426);}})[_0x1216('0x1f')](function(_0x4b61bf){if(_0x4b61bf){_0x3d3b40=_0x4b61bf[_0x1216('0x43')];if(!_0xe7db8c[_0x1216('0x3d')]['hasOwnProperty'](_0x1216('0x57'))){_0x279426[_0x1216('0x2f')]=qs['limit'](_0xe7db8c[_0x1216('0x3d')][_0x1216('0x2f')]);_0x279426[_0x1216('0x2e')]=qs[_0x1216('0x2e')](_0xe7db8c['query']['offset']);}return _0x2b6dbe['getFields'](_0x279426);}})['then'](function(_0x34e66c){if(_0x34e66c){return _0x34e66c?{'count':_0x3d3b40,'rows':_0x34e66c}:null;}})[_0x1216('0x1f')](respondWithResult(_0x22f094,null))[_0x1216('0x29')](handleError(_0x22f094,null));};exports[_0x1216('0x58')]=function(_0x3591cd,_0x49bf03,_0x20c1f3){var _0x3af666={};var _0x266287={};var _0x51c5d5;var _0x39cad1;return db[_0x1216('0x37')][_0x1216('0x55')]({'where':{'id':_0x3591cd[_0x1216('0x56')]['id']}})['then'](handleEntityNotFound(_0x49bf03,null))[_0x1216('0x1f')](function(_0x2ba28f){if(_0x2ba28f){_0x51c5d5=_0x2ba28f;_0x266287['model']=_[_0x1216('0x3e')](db['SugarcrmField'][_0x1216('0x38')]);_0x266287['query']=_['keys'](_0x3591cd[_0x1216('0x3d')]);_0x266287['filters']=_['intersection'](_0x266287[_0x1216('0x3f')],_0x266287[_0x1216('0x3d')]);_0x3af666[_0x1216('0x40')]=_[_0x1216('0x41')](_0x266287[_0x1216('0x3f')],qs['fields'](_0x3591cd[_0x1216('0x3d')][_0x1216('0x42')]));_0x3af666[_0x1216('0x40')]=_0x3af666[_0x1216('0x40')][_0x1216('0x43')]?_0x3af666[_0x1216('0x40')]:_0x266287[_0x1216('0x3f')];_0x3af666[_0x1216('0x45')]=qs[_0x1216('0x46')](_0x3591cd[_0x1216('0x3d')][_0x1216('0x46')]);_0x3af666[_0x1216('0x47')]=qs[_0x1216('0x48')](_[_0x1216('0x49')](_0x3591cd['query'],_0x266287[_0x1216('0x48')]));if(_0x3591cd[_0x1216('0x3d')][_0x1216('0x4b')]){_0x3af666['where']=_['merge'](_0x3af666[_0x1216('0x47')],{'$or':_[_0x1216('0x3b')](_0x3af666[_0x1216('0x40')],function(_0x30c9ce){var _0x667238={};_0x667238[_0x30c9ce]={'$like':'%'+_0x3591cd[_0x1216('0x3d')][_0x1216('0x4b')]+'%'};return _0x667238;})});}_0x3af666=_['merge']({},_0x3af666,_0x3591cd['options']);return _0x51c5d5[_0x1216('0x58')](_0x3af666);}})['then'](function(_0x314901){if(_0x314901){_0x39cad1=_0x314901[_0x1216('0x43')];if(!_0x3591cd[_0x1216('0x3d')][_0x1216('0x44')](_0x1216('0x57'))){_0x3af666[_0x1216('0x2f')]=qs[_0x1216('0x2f')](_0x3591cd[_0x1216('0x3d')][_0x1216('0x2f')]);_0x3af666[_0x1216('0x2e')]=qs[_0x1216('0x2e')](_0x3591cd[_0x1216('0x3d')]['offset']);}return _0x51c5d5[_0x1216('0x58')](_0x3af666);}})['then'](function(_0x14da3d){if(_0x14da3d){return _0x14da3d?{'count':_0x39cad1,'rows':_0x14da3d}:null;}})[_0x1216('0x1f')](respondWithResult(_0x49bf03,null))['catch'](handleError(_0x49bf03,null));};exports[_0x1216('0x59')]=function(_0x49ed3f,_0x2056ef,_0x1c0a69){var _0x339ec0={};var _0x19f522={};var _0x542b35;var _0x413c89;return db[_0x1216('0x37')]['findOne']({'where':{'id':_0x49ed3f[_0x1216('0x56')]['id']}})['then'](handleEntityNotFound(_0x2056ef,null))['then'](function(_0x20904c){if(_0x20904c){_0x542b35=_0x20904c;_0x19f522[_0x1216('0x3f')]=_['keys'](db[_0x1216('0x5a')]['rawAttributes']);_0x19f522[_0x1216('0x3d')]=_[_0x1216('0x3e')](_0x49ed3f[_0x1216('0x3d')]);_0x19f522[_0x1216('0x48')]=_[_0x1216('0x41')](_0x19f522[_0x1216('0x3f')],_0x19f522[_0x1216('0x3d')]);_0x339ec0[_0x1216('0x40')]=_['intersection'](_0x19f522[_0x1216('0x3f')],qs[_0x1216('0x42')](_0x49ed3f[_0x1216('0x3d')][_0x1216('0x42')]));_0x339ec0[_0x1216('0x40')]=_0x339ec0[_0x1216('0x40')][_0x1216('0x43')]?_0x339ec0[_0x1216('0x40')]:_0x19f522[_0x1216('0x3f')];_0x339ec0['order']=qs[_0x1216('0x46')](_0x49ed3f[_0x1216('0x3d')][_0x1216('0x46')]);_0x339ec0[_0x1216('0x47')]=qs[_0x1216('0x48')](_[_0x1216('0x49')](_0x49ed3f['query'],_0x19f522[_0x1216('0x48')]));if(_0x49ed3f[_0x1216('0x3d')][_0x1216('0x4b')]){_0x339ec0['where']=_[_0x1216('0x4a')](_0x339ec0[_0x1216('0x47')],{'$or':_[_0x1216('0x3b')](_0x339ec0[_0x1216('0x40')],function(_0x2dfd73){var _0x46b484={};_0x46b484[_0x2dfd73]={'$like':'%'+_0x49ed3f[_0x1216('0x3d')][_0x1216('0x4b')]+'%'};return _0x46b484;})});}_0x339ec0=_[_0x1216('0x4a')]({},_0x339ec0,_0x49ed3f['options']);return _0x542b35['getDescriptions'](_0x339ec0);}})[_0x1216('0x1f')](function(_0x4b5bc2){if(_0x4b5bc2){_0x413c89=_0x4b5bc2['length'];if(!_0x49ed3f['query'][_0x1216('0x44')]('nolimit')){_0x339ec0['limit']=qs[_0x1216('0x2f')](_0x49ed3f['query']['limit']);_0x339ec0[_0x1216('0x2e')]=qs[_0x1216('0x2e')](_0x49ed3f['query'][_0x1216('0x2e')]);}return _0x542b35[_0x1216('0x59')](_0x339ec0);}})['then'](function(_0x51e2b8){if(_0x51e2b8){return _0x51e2b8?{'count':_0x413c89,'rows':_0x51e2b8}:null;}})[_0x1216('0x1f')](respondWithResult(_0x2056ef,null))[_0x1216('0x29')](handleError(_0x2056ef,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 750a047..f4d77dd 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 _0xadd7=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x5659c0,_0x5f2532){var _0x36e3c0=function(_0x247a5f){while(--_0x247a5f){_0x5659c0['push'](_0x5659c0['shift']());}};_0x36e3c0(++_0x5f2532);}(_0xadd7,0x196));var _0x7add=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xadd7[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7add('0x0'));var util=require(_0x7add('0x1'));var logger=require(_0x7add('0x2'))(_0x7add('0x3'));var moment=require('moment');var BPromise=require(_0x7add('0x4'));var rp=require(_0x7add('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7add('0x6'));var config=require(_0x7add('0x7'));var attributes=require(_0x7add('0x8'));module[_0x7add('0x9')]=function(_0x2df862,_0x125c76){return _0x2df862[_0x7add('0xa')](_0x7add('0xb'),attributes,{'tableName':_0x7add('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f41=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SugarcrmConfiguration'];(function(_0x24e320,_0x32bd95){var _0x5dfb42=function(_0x3bdc69){while(--_0x3bdc69){_0x24e320['push'](_0x24e320['shift']());}};_0x5dfb42(++_0x32bd95);}(_0x2f41,0x134));var _0x12f4=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x2f41[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0x12f4('0x0'));var util=require('util');var logger=require(_0x12f4('0x1'))(_0x12f4('0x2'));var moment=require(_0x12f4('0x3'));var BPromise=require(_0x12f4('0x4'));var rp=require(_0x12f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12f4('0x6'));var config=require(_0x12f4('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x12f4('0x8')]=function(_0x132b2e,_0x3a0e62){return _0x132b2e[_0x12f4('0x9')](_0x12f4('0xa'),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 d848eb6..2da1aed 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 _0x7813=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x7813,0x1c0));var _0x3781=function(_0x4e7c2,_0x3b3347){_0x4e7c2=_0x4e7c2-0x0;var _0x84bb35=_0x7813[_0x4e7c2];return _0x84bb35;};'use strict';var _=require(_0x3781('0x0'));var util=require(_0x3781('0x1'));var moment=require('moment');var BPromise=require(_0x3781('0x2'));var rs=require(_0x3781('0x3'));var fs=require('fs');var Redis=require(_0x3781('0x4'));var db=require(_0x3781('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3781('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3781('0x7'));var client=jayson[_0x3781('0x8')][_0x3781('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x272e7c,_0x465777,_0x1c15fb){return new BPromise(function(_0x7858c,_0x2064de){return client[_0x3781('0xa')](_0x272e7c,_0x1c15fb)[_0x3781('0xb')](function(_0x247212){logger[_0x3781('0xc')](_0x3781('0xd'),_0x465777,_0x3781('0xe'));logger[_0x3781('0xf')](_0x3781('0x10'),_0x465777,_0x3781('0xe'),JSON[_0x3781('0x11')](_0x247212));if(_0x247212[_0x3781('0x12')]){if(_0x247212['error'][_0x3781('0x13')]===0x1f4){logger[_0x3781('0x12')](_0x3781('0xd'),_0x465777,_0x247212[_0x3781('0x12')]['message']);return _0x2064de(_0x247212['error']['message']);}logger[_0x3781('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x465777,_0x247212[_0x3781('0x12')][_0x3781('0x14')]);return _0x7858c(_0x247212[_0x3781('0x12')][_0x3781('0x14')]);}else{logger[_0x3781('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x465777,_0x3781('0xe'));_0x7858c(_0x247212[_0x3781('0x15')]['message']);}})[_0x3781('0x16')](function(_0x769729){logger[_0x3781('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x465777,_0x769729);_0x2064de(_0x769729);});});} \ No newline at end of file +var _0x4772=['moment','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x59c93e,_0x16b91c){var _0x487f72=function(_0xf5344d){while(--_0xf5344d){_0x59c93e['push'](_0x59c93e['shift']());}};_0x487f72(++_0x16b91c);}(_0x4772,0x1a4));var _0x2477=function(_0x5e0c9e,_0x4e85b1){_0x5e0c9e=_0x5e0c9e-0x0;var _0x15b55d=_0x4772[_0x5e0c9e];return _0x15b55d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2477('0x0'));var BPromise=require('bluebird');var rs=require(_0x2477('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2477('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x2477('0x3'));var jayson=require(_0x2477('0x4'));var client=jayson['client'][_0x2477('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x25bb95,_0x57c391,_0x32cf9c){return new BPromise(function(_0x13b0b4,_0x37b71a){return client[_0x2477('0x6')](_0x25bb95,_0x32cf9c)['then'](function(_0x1d54e2){logger[_0x2477('0x7')](_0x2477('0x8'),_0x57c391,_0x2477('0x9'));logger[_0x2477('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x57c391,'request\x20sent',JSON['stringify'](_0x1d54e2));if(_0x1d54e2['error']){if(_0x1d54e2[_0x2477('0xb')][_0x2477('0xc')]===0x1f4){logger[_0x2477('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x57c391,_0x1d54e2[_0x2477('0xb')][_0x2477('0xd')]);return _0x37b71a(_0x1d54e2[_0x2477('0xb')][_0x2477('0xd')]);}logger['error'](_0x2477('0x8'),_0x57c391,_0x1d54e2['error'][_0x2477('0xd')]);return _0x13b0b4(_0x1d54e2[_0x2477('0xb')][_0x2477('0xd')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x57c391,'request\x20sent');_0x13b0b4(_0x1d54e2[_0x2477('0xe')][_0x2477('0xd')]);}})['catch'](function(_0x221aff){logger['error'](_0x2477('0x8'),_0x57c391,_0x221aff);_0x37b71a(_0x221aff);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b28f39a..b4e13c7 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 _0x0282=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x15f3a7,_0x362598){var _0x50fb96=function(_0x130bad){while(--_0x130bad){_0x15f3a7['push'](_0x15f3a7['shift']());}};_0x50fb96(++_0x362598);}(_0x0282,0x1d0));var _0x2028=function(_0x67ad48,_0x19f1e5){_0x67ad48=_0x67ad48-0x0;var _0x419404=_0x0282[_0x67ad48];return _0x419404;};'use strict';var multer=require(_0x2028('0x0'));var util=require(_0x2028('0x1'));var path=require(_0x2028('0x2'));var timeout=require(_0x2028('0x3'));var express=require('express');var router=express[_0x2028('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2028('0x5'));var config=require('../../config/environment');var controller=require(_0x2028('0x6'));router[_0x2028('0x7')]('/',auth[_0x2028('0x8')](),controller['index']);router[_0x2028('0x7')](_0x2028('0x9'),auth[_0x2028('0x8')](),controller[_0x2028('0xa')]);router[_0x2028('0xb')]('/',auth[_0x2028('0x8')](),controller[_0x2028('0xc')]);router['put']('/:id',auth[_0x2028('0x8')](),controller[_0x2028('0xd')]);router[_0x2028('0xe')](_0x2028('0x9'),auth['isAuthenticated'](),controller[_0x2028('0xf')]);module[_0x2028('0x10')]=router; \ No newline at end of file +var _0x3f44=['get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x35c993,_0x5e8fe1){var _0x3824dd=function(_0x568725){while(--_0x568725){_0x35c993['push'](_0x35c993['shift']());}};_0x3824dd(++_0x5e8fe1);}(_0x3f44,0xc7));var _0x43f4=function(_0x33ca08,_0x1c07bd){_0x33ca08=_0x33ca08-0x0;var _0x57bc01=_0x3f44[_0x33ca08];return _0x57bc01;};'use strict';var multer=require(_0x43f4('0x0'));var util=require(_0x43f4('0x1'));var path=require(_0x43f4('0x2'));var timeout=require(_0x43f4('0x3'));var express=require('express');var router=express[_0x43f4('0x4')]();var auth=require(_0x43f4('0x5'));var interaction=require(_0x43f4('0x6'));var config=require(_0x43f4('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x43f4('0x8')](),controller[_0x43f4('0x9')]);router[_0x43f4('0xa')](_0x43f4('0xb'),auth[_0x43f4('0x8')](),controller[_0x43f4('0xc')]);router[_0x43f4('0xd')]('/',auth[_0x43f4('0x8')](),controller[_0x43f4('0xe')]);router[_0x43f4('0xf')](_0x43f4('0xb'),auth['isAuthenticated'](),controller[_0x43f4('0x10')]);router['delete'](_0x43f4('0xb'),auth[_0x43f4('0x8')](),controller[_0x43f4('0x11')]);module[_0x43f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index affb1a3..9db7336 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 _0x28e3=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x4959db,_0xa43144){var _0x2fec07=function(_0x1d8482){while(--_0x1d8482){_0x4959db['push'](_0x4959db['shift']());}};_0x2fec07(++_0xa43144);}(_0x28e3,0x106));var _0x328e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x28e3[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x328e('0x0'));module[_0x328e('0x1')]={'type':{'type':Sequelize[_0x328e('0x2')](_0x328e('0x3'),'variable',_0x328e('0x4'),_0x328e('0x5')),'defaultValue':_0x328e('0x3')},'content':{'type':Sequelize[_0x328e('0x6')]},'key':{'type':Sequelize[_0x328e('0x6')]},'keyType':{'type':Sequelize[_0x328e('0x2')](_0x328e('0x3'),_0x328e('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x328e('0x6')]},'customField':{'type':Sequelize[_0x328e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x328e('0x6')]}}; \ No newline at end of file +var _0x1c88=['string','variable','STRING','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x3f9029,_0x5c86a6){var _0xd3b70d=function(_0x48e47b){while(--_0x48e47b){_0x3f9029['push'](_0x3f9029['shift']());}};_0xd3b70d(++_0x5c86a6);}(_0x1c88,0x1a9));var _0x81c8=function(_0xab8668,_0x5204ac){_0xab8668=_0xab8668-0x0;var _0x571c10=_0x1c88[_0xab8668];return _0x571c10;};'use strict';var Sequelize=require(_0x81c8('0x0'));module['exports']={'type':{'type':Sequelize[_0x81c8('0x1')](_0x81c8('0x2'),_0x81c8('0x3'),'customVariable','keyValue'),'defaultValue':_0x81c8('0x2')},'content':{'type':Sequelize[_0x81c8('0x4')]},'key':{'type':Sequelize[_0x81c8('0x4')]},'keyType':{'type':Sequelize[_0x81c8('0x1')](_0x81c8('0x2'),_0x81c8('0x3'),_0x81c8('0x5'))},'keyContent':{'type':Sequelize[_0x81c8('0x4')]},'idField':{'type':Sequelize[_0x81c8('0x4')]},'nameField':{'type':Sequelize[_0x81c8('0x4')]},'customField':{'type':Sequelize[_0x81c8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x81c8('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 63a8987..e558b05 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 _0xbd6e=['set','apply','update','then','destroy','error','name','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','SugarcrmField','includeAll','include','findAll','rows','options','catch','create','body','find','params','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xbd6e,0x68));var _0xebd6=function(_0x42bebb,_0x27e30e){_0x42bebb=_0x42bebb-0x0;var _0x5840ac=_0xbd6e[_0x42bebb];return _0x5840ac;};'use strict';var pdf=require(_0xebd6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xebd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebd6('0x2'));var rp=require(_0xebd6('0x3'));var moment=require(_0xebd6('0x4'));var BPromise=require(_0xebd6('0x5'));var Mustache=require(_0xebd6('0x6'));var util=require(_0xebd6('0x7'));var path=require(_0xebd6('0x8'));var sox=require(_0xebd6('0x9'));var csv=require(_0xebd6('0xa'));var ejs=require(_0xebd6('0xb'));var fs=require('fs');var _=require(_0xebd6('0xc'));var squel=require(_0xebd6('0xd'));var crypto=require('crypto');var jsforce=require(_0xebd6('0xe'));var deskjs=require(_0xebd6('0xf'));var toCsv=require(_0xebd6('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xebd6('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xebd6('0x11'))(_0xebd6('0x12'));var utils=require(_0xebd6('0x13'));var config=require(_0xebd6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd422a2,_0x5a740e){_0x5a740e=_0x5a740e||0xcc;return function(_0x51311d){if(_0x51311d){return _0xd422a2[_0xebd6('0x15')](_0x5a740e);}return _0xd422a2['status'](_0x5a740e)[_0xebd6('0x16')]();};}function respondWithResult(_0x37be3f,_0x2d0c86){_0x2d0c86=_0x2d0c86||0xc8;return function(_0x36c166){if(_0x36c166){return _0x37be3f['status'](_0x2d0c86)[_0xebd6('0x17')](_0x36c166);}};}function respondWithFilteredResult(_0x2e8671,_0x30e967){return function(_0x28c0ac){if(_0x28c0ac){var _0x37e182=_0x28c0ac[_0xebd6('0x18')],_0x529bda=_0x30e967[_0xebd6('0x19')],_0x1d8ef1=_0x30e967[_0xebd6('0x19')]+_0x30e967[_0xebd6('0x1a')],_0x7b60b;if(_0x1d8ef1>=_0x37e182){_0x1d8ef1=_0x37e182;_0x7b60b=0xc8;}else{_0x7b60b=0xce;}_0x2e8671[_0xebd6('0x1b')](_0x7b60b);return _0x2e8671[_0xebd6('0x1c')]('Content-Range',_0x529bda+'-'+_0x1d8ef1+'/'+_0x37e182)[_0xebd6('0x17')](_0x28c0ac);}return null;};}function patchUpdates(_0xbcd74c){return function(_0x2a60ff){try{jsonpatch[_0xebd6('0x1d')](_0x2a60ff,_0xbcd74c,!![]);}catch(_0x497545){return BPromise['reject'](_0x497545);}return _0x2a60ff['save']();};}function saveUpdates(_0x5e285e,_0x16c6b2){return function(_0x4da9fc){if(_0x4da9fc){return _0x4da9fc[_0xebd6('0x1e')](_0x5e285e)[_0xebd6('0x1f')](function(_0xa69d5){return _0xa69d5;});}return null;};}function removeEntity(_0x40369e,_0x235e54){return function(_0x29bdb3){if(_0x29bdb3){return _0x29bdb3[_0xebd6('0x20')]()[_0xebd6('0x1f')](function(){_0x40369e[_0xebd6('0x1b')](0xcc)[_0xebd6('0x16')]();});}};}function handleEntityNotFound(_0x13d26f,_0xe90583){return function(_0x766225){if(!_0x766225){_0x13d26f[_0xebd6('0x15')](0x194);}return _0x766225;};}function handleError(_0x43e2bf,_0x66cc5c){_0x66cc5c=_0x66cc5c||0x1f4;return function(_0x2c85be){logger[_0xebd6('0x21')](_0x2c85be['stack']);if(_0x2c85be[_0xebd6('0x22')]){delete _0x2c85be['name'];}_0x43e2bf[_0xebd6('0x1b')](_0x66cc5c)['send'](_0x2c85be);};}exports['index']=function(_0x794213,_0x511343){var _0x1483a7={},_0xfa529d={},_0xa0ec6d={'count':0x0,'rows':[]};var _0x195e6c=_[_0xebd6('0x23')](db['SugarcrmField'][_0xebd6('0x24')],function(_0x54e603){return{'name':_0x54e603[_0xebd6('0x25')],'type':_0x54e603[_0xebd6('0x26')]['key']};});_0xfa529d[_0xebd6('0x27')]=_[_0xebd6('0x23')](_0x195e6c,_0xebd6('0x22'));_0xfa529d[_0xebd6('0x28')]=_[_0xebd6('0x29')](_0x794213[_0xebd6('0x28')]);_0xfa529d[_0xebd6('0x2a')]=_['intersection'](_0xfa529d[_0xebd6('0x27')],_0xfa529d[_0xebd6('0x28')]);_0x1483a7[_0xebd6('0x2b')]=_[_0xebd6('0x2c')](_0xfa529d['model'],qs['fields'](_0x794213[_0xebd6('0x28')][_0xebd6('0x2d')]));_0x1483a7[_0xebd6('0x2b')]=_0x1483a7['attributes'][_0xebd6('0x2e')]?_0x1483a7[_0xebd6('0x2b')]:_0xfa529d[_0xebd6('0x27')];if(!_0x794213['query'][_0xebd6('0x2f')](_0xebd6('0x30'))){_0x1483a7['limit']=qs[_0xebd6('0x1a')](_0x794213[_0xebd6('0x28')][_0xebd6('0x1a')]);_0x1483a7[_0xebd6('0x19')]=qs[_0xebd6('0x19')](_0x794213[_0xebd6('0x28')][_0xebd6('0x19')]);}_0x1483a7[_0xebd6('0x31')]=qs[_0xebd6('0x32')](_0x794213[_0xebd6('0x28')][_0xebd6('0x32')]);_0x1483a7[_0xebd6('0x33')]=qs['filters'](_['pick'](_0x794213['query'],_0xfa529d[_0xebd6('0x2a')]));if(_0x794213[_0xebd6('0x28')]['filter']){_0x1483a7[_0xebd6('0x33')]=_['merge'](_0x1483a7[_0xebd6('0x33')],{'$or':_[_0xebd6('0x23')](_0x195e6c,function(_0x43084a){if(_0x43084a[_0xebd6('0x26')]!==_0xebd6('0x34')){var _0x2d3278={};_0x2d3278[_0x43084a[_0xebd6('0x22')]]={'$like':'%'+_0x794213[_0xebd6('0x28')][_0xebd6('0x35')]+'%'};return _0x2d3278;}})});}_0x1483a7=_[_0xebd6('0x36')]({},_0x1483a7,_0x794213['options']);var _0x29f023={'where':_0x1483a7[_0xebd6('0x33')]};return db[_0xebd6('0x37')]['count'](_0x29f023)['then'](function(_0x1bbabe){_0xa0ec6d[_0xebd6('0x18')]=_0x1bbabe;if(_0x794213['query'][_0xebd6('0x38')]){_0x1483a7[_0xebd6('0x39')]=[{'all':!![]}];}return db['SugarcrmField'][_0xebd6('0x3a')](_0x1483a7);})[_0xebd6('0x1f')](function(_0x34dddf){_0xa0ec6d[_0xebd6('0x3b')]=_0x34dddf;return _0xa0ec6d;})[_0xebd6('0x1f')](respondWithFilteredResult(_0x511343,_0x1483a7))['catch'](handleError(_0x511343,null));};exports['show']=function(_0x406d13,_0x5d0660){var _0x2d074b={'raw':!![],'where':{'id':_0x406d13['params']['id']}},_0x161863={};_0x161863[_0xebd6('0x27')]=_[_0xebd6('0x29')](db[_0xebd6('0x37')]['rawAttributes']);_0x161863[_0xebd6('0x28')]=_[_0xebd6('0x29')](_0x406d13[_0xebd6('0x28')]);_0x161863['filters']=_[_0xebd6('0x2c')](_0x161863[_0xebd6('0x27')],_0x161863[_0xebd6('0x28')]);_0x2d074b[_0xebd6('0x2b')]=_[_0xebd6('0x2c')](_0x161863['model'],qs[_0xebd6('0x2d')](_0x406d13[_0xebd6('0x28')][_0xebd6('0x2d')]));_0x2d074b['attributes']=_0x2d074b[_0xebd6('0x2b')][_0xebd6('0x2e')]?_0x2d074b[_0xebd6('0x2b')]:_0x161863[_0xebd6('0x27')];if(_0x406d13[_0xebd6('0x28')][_0xebd6('0x38')]){_0x2d074b[_0xebd6('0x39')]=[{'all':!![]}];}_0x2d074b=_['merge']({},_0x2d074b,_0x406d13[_0xebd6('0x3c')]);return db[_0xebd6('0x37')]['find'](_0x2d074b)[_0xebd6('0x1f')](handleEntityNotFound(_0x5d0660,null))['then'](respondWithResult(_0x5d0660,null))[_0xebd6('0x3d')](handleError(_0x5d0660,null));};exports[_0xebd6('0x3e')]=function(_0x4c5b29,_0xb47313){return db[_0xebd6('0x37')][_0xebd6('0x3e')](_0x4c5b29['body'],{})[_0xebd6('0x1f')](respondWithResult(_0xb47313,0xc9))[_0xebd6('0x3d')](handleError(_0xb47313,null));};exports[_0xebd6('0x1e')]=function(_0x9cc2d9,_0x5f3e43){if(_0x9cc2d9[_0xebd6('0x3f')]['id']){delete _0x9cc2d9[_0xebd6('0x3f')]['id'];}return db[_0xebd6('0x37')][_0xebd6('0x40')]({'where':{'id':_0x9cc2d9[_0xebd6('0x41')]['id']}})[_0xebd6('0x1f')](handleEntityNotFound(_0x5f3e43,null))[_0xebd6('0x1f')](saveUpdates(_0x9cc2d9['body'],null))[_0xebd6('0x1f')](respondWithResult(_0x5f3e43,null))[_0xebd6('0x3d')](handleError(_0x5f3e43,null));};exports[_0xebd6('0x20')]=function(_0x17b9f6,_0x55b401){return db['SugarcrmField'][_0xebd6('0x40')]({'where':{'id':_0x17b9f6['params']['id']}})['then'](handleEntityNotFound(_0x55b401,null))[_0xebd6('0x1f')](removeEntity(_0x55b401,null))[_0xebd6('0x3d')](handleError(_0x55b401,null));}; \ No newline at end of file +var _0x10f7=['findAll','rows','show','keys','find','catch','create','body','update','params','destroy','html-pdf','eml-format','zip-dir','request-promise','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','reject','save','then','sendStatus','stack','name','send','index','map','SugarcrmField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll'];(function(_0x2e0967,_0x3fd097){var _0x180b59=function(_0x1048f2){while(--_0x1048f2){_0x2e0967['push'](_0x2e0967['shift']());}};_0x180b59(++_0x3fd097);}(_0x10f7,0x16e));var _0x710f=function(_0x51eba5,_0x50cb8a){_0x51eba5=_0x51eba5-0x0;var _0x2b6a81=_0x10f7[_0x51eba5];return _0x2b6a81;};'use strict';var pdf=require(_0x710f('0x0'));var emlformat=require(_0x710f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x710f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x710f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x710f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x710f('0x5'));var ejs=require(_0x710f('0x6'));var fs=require('fs');var _=require(_0x710f('0x7'));var squel=require(_0x710f('0x8'));var crypto=require(_0x710f('0x9'));var jsforce=require(_0x710f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x710f('0x5'));var querystring=require(_0x710f('0xb'));var Papa=require(_0x710f('0xc'));var Redis=require(_0x710f('0xd'));var authService=require(_0x710f('0xe'));var qs=require(_0x710f('0xf'));var as=require(_0x710f('0x10'));var hardwareService=require(_0x710f('0x11'));var logger=require('../../config/logger')(_0x710f('0x12'));var utils=require(_0x710f('0x13'));var config=require(_0x710f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x156875,_0x59909a){_0x59909a=_0x59909a||0xcc;return function(_0x214699){if(_0x214699){return _0x156875['sendStatus'](_0x59909a);}return _0x156875[_0x710f('0x15')](_0x59909a)[_0x710f('0x16')]();};}function respondWithResult(_0x4c0e48,_0x549b93){_0x549b93=_0x549b93||0xc8;return function(_0x610903){if(_0x610903){return _0x4c0e48[_0x710f('0x15')](_0x549b93)[_0x710f('0x17')](_0x610903);}};}function respondWithFilteredResult(_0x349e38,_0x2d0d5b){return function(_0x5a8448){if(_0x5a8448){var _0x32445d=_0x5a8448['count'],_0x5ea30f=_0x2d0d5b[_0x710f('0x18')],_0x19163e=_0x2d0d5b['offset']+_0x2d0d5b[_0x710f('0x19')],_0x37c687;if(_0x19163e>=_0x32445d){_0x19163e=_0x32445d;_0x37c687=0xc8;}else{_0x37c687=0xce;}_0x349e38[_0x710f('0x15')](_0x37c687);return _0x349e38[_0x710f('0x1a')](_0x710f('0x1b'),_0x5ea30f+'-'+_0x19163e+'/'+_0x32445d)[_0x710f('0x17')](_0x5a8448);}return null;};}function patchUpdates(_0x4453bd){return function(_0x1558c8){try{jsonpatch['apply'](_0x1558c8,_0x4453bd,!![]);}catch(_0x3ccc95){return BPromise[_0x710f('0x1c')](_0x3ccc95);}return _0x1558c8[_0x710f('0x1d')]();};}function saveUpdates(_0x4bea4b,_0x5b5396){return function(_0x34a121){if(_0x34a121){return _0x34a121['update'](_0x4bea4b)[_0x710f('0x1e')](function(_0x50de8e){return _0x50de8e;});}return null;};}function removeEntity(_0x566acc,_0x2c55d6){return function(_0x334941){if(_0x334941){return _0x334941['destroy']()[_0x710f('0x1e')](function(){_0x566acc[_0x710f('0x15')](0xcc)[_0x710f('0x16')]();});}};}function handleEntityNotFound(_0x7e036d,_0x9569c6){return function(_0x433df6){if(!_0x433df6){_0x7e036d[_0x710f('0x1f')](0x194);}return _0x433df6;};}function handleError(_0x503726,_0x51340d){_0x51340d=_0x51340d||0x1f4;return function(_0x70d85e){logger['error'](_0x70d85e[_0x710f('0x20')]);if(_0x70d85e[_0x710f('0x21')]){delete _0x70d85e[_0x710f('0x21')];}_0x503726[_0x710f('0x15')](_0x51340d)[_0x710f('0x22')](_0x70d85e);};}exports[_0x710f('0x23')]=function(_0xba90fe,_0x5741b6){var _0x314d94={},_0x526e20={},_0x485001={'count':0x0,'rows':[]};var _0xa33a99=_[_0x710f('0x24')](db[_0x710f('0x25')][_0x710f('0x26')],function(_0x41774d){return{'name':_0x41774d['fieldName'],'type':_0x41774d[_0x710f('0x27')][_0x710f('0x28')]};});_0x526e20[_0x710f('0x29')]=_[_0x710f('0x24')](_0xa33a99,_0x710f('0x21'));_0x526e20[_0x710f('0x2a')]=_['keys'](_0xba90fe['query']);_0x526e20[_0x710f('0x2b')]=_[_0x710f('0x2c')](_0x526e20[_0x710f('0x29')],_0x526e20[_0x710f('0x2a')]);_0x314d94[_0x710f('0x2d')]=_['intersection'](_0x526e20[_0x710f('0x29')],qs[_0x710f('0x2e')](_0xba90fe['query']['fields']));_0x314d94[_0x710f('0x2d')]=_0x314d94[_0x710f('0x2d')][_0x710f('0x2f')]?_0x314d94[_0x710f('0x2d')]:_0x526e20['model'];if(!_0xba90fe['query'][_0x710f('0x30')](_0x710f('0x31'))){_0x314d94[_0x710f('0x19')]=qs[_0x710f('0x19')](_0xba90fe['query']['limit']);_0x314d94['offset']=qs[_0x710f('0x18')](_0xba90fe[_0x710f('0x2a')][_0x710f('0x18')]);}_0x314d94[_0x710f('0x32')]=qs[_0x710f('0x33')](_0xba90fe[_0x710f('0x2a')][_0x710f('0x33')]);_0x314d94[_0x710f('0x34')]=qs['filters'](_[_0x710f('0x35')](_0xba90fe[_0x710f('0x2a')],_0x526e20[_0x710f('0x2b')]));if(_0xba90fe[_0x710f('0x2a')][_0x710f('0x36')]){_0x314d94['where']=_[_0x710f('0x37')](_0x314d94[_0x710f('0x34')],{'$or':_[_0x710f('0x24')](_0xa33a99,function(_0x1efe38){if(_0x1efe38[_0x710f('0x27')]!==_0x710f('0x38')){var _0x55c31c={};_0x55c31c[_0x1efe38['name']]={'$like':'%'+_0xba90fe[_0x710f('0x2a')]['filter']+'%'};return _0x55c31c;}})});}_0x314d94=_[_0x710f('0x37')]({},_0x314d94,_0xba90fe[_0x710f('0x39')]);var _0x39dd38={'where':_0x314d94['where']};return db[_0x710f('0x25')][_0x710f('0x3a')](_0x39dd38)[_0x710f('0x1e')](function(_0x12a015){_0x485001[_0x710f('0x3a')]=_0x12a015;if(_0xba90fe['query'][_0x710f('0x3b')]){_0x314d94['include']=[{'all':!![]}];}return db[_0x710f('0x25')][_0x710f('0x3c')](_0x314d94);})[_0x710f('0x1e')](function(_0x29d397){_0x485001[_0x710f('0x3d')]=_0x29d397;return _0x485001;})[_0x710f('0x1e')](respondWithFilteredResult(_0x5741b6,_0x314d94))['catch'](handleError(_0x5741b6,null));};exports[_0x710f('0x3e')]=function(_0x13ec28,_0x210b1c){var _0x58f443={'raw':!![],'where':{'id':_0x13ec28['params']['id']}},_0x222376={};_0x222376[_0x710f('0x29')]=_[_0x710f('0x3f')](db[_0x710f('0x25')][_0x710f('0x26')]);_0x222376[_0x710f('0x2a')]=_[_0x710f('0x3f')](_0x13ec28[_0x710f('0x2a')]);_0x222376[_0x710f('0x2b')]=_['intersection'](_0x222376[_0x710f('0x29')],_0x222376[_0x710f('0x2a')]);_0x58f443[_0x710f('0x2d')]=_[_0x710f('0x2c')](_0x222376[_0x710f('0x29')],qs[_0x710f('0x2e')](_0x13ec28[_0x710f('0x2a')][_0x710f('0x2e')]));_0x58f443[_0x710f('0x2d')]=_0x58f443[_0x710f('0x2d')][_0x710f('0x2f')]?_0x58f443[_0x710f('0x2d')]:_0x222376[_0x710f('0x29')];if(_0x13ec28['query'][_0x710f('0x3b')]){_0x58f443['include']=[{'all':!![]}];}_0x58f443=_[_0x710f('0x37')]({},_0x58f443,_0x13ec28[_0x710f('0x39')]);return db['SugarcrmField'][_0x710f('0x40')](_0x58f443)['then'](handleEntityNotFound(_0x210b1c,null))[_0x710f('0x1e')](respondWithResult(_0x210b1c,null))[_0x710f('0x41')](handleError(_0x210b1c,null));};exports[_0x710f('0x42')]=function(_0x3bd6e6,_0x383114){return db['SugarcrmField']['create'](_0x3bd6e6[_0x710f('0x43')],{})['then'](respondWithResult(_0x383114,0xc9))[_0x710f('0x41')](handleError(_0x383114,null));};exports[_0x710f('0x44')]=function(_0x3e432e,_0x165667){if(_0x3e432e[_0x710f('0x43')]['id']){delete _0x3e432e['body']['id'];}return db[_0x710f('0x25')][_0x710f('0x40')]({'where':{'id':_0x3e432e[_0x710f('0x45')]['id']}})['then'](handleEntityNotFound(_0x165667,null))[_0x710f('0x1e')](saveUpdates(_0x3e432e[_0x710f('0x43')],null))['then'](respondWithResult(_0x165667,null))[_0x710f('0x41')](handleError(_0x165667,null));};exports[_0x710f('0x46')]=function(_0xbd3a09,_0x15bf2e){return db['SugarcrmField']['find']({'where':{'id':_0xbd3a09[_0x710f('0x45')]['id']}})[_0x710f('0x1e')](handleEntityNotFound(_0x15bf2e,null))['then'](removeEntity(_0x15bf2e,null))[_0x710f('0x41')](handleError(_0x15bf2e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4784576..bb7883b 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 _0xadd3=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0xadd3,0x72));var _0x3add=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xadd3[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x3add('0x0'));var util=require(_0x3add('0x1'));var logger=require(_0x3add('0x2'))(_0x3add('0x3'));var moment=require('moment');var BPromise=require(_0x3add('0x4'));var rp=require(_0x3add('0x5'));var fs=require('fs');var path=require(_0x3add('0x6'));var rimraf=require(_0x3add('0x7'));var config=require(_0x3add('0x8'));var attributes=require(_0x3add('0x9'));module[_0x3add('0xa')]=function(_0x53bb41,_0x45c023){return _0x53bb41[_0x3add('0xb')]('SugarcrmField',attributes,{'tableName':_0x3add('0xc'),'paranoid':![],'indexes':[{'name':_0x3add('0xd'),'fields':['idField',_0x3add('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7c8=['bluebird','path','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x1c9da9,_0x3b8877){var _0x43442c=function(_0x60d1b0){while(--_0x60d1b0){_0x1c9da9['push'](_0x1c9da9['shift']());}};_0x43442c(++_0x3b8877);}(_0xa7c8,0xb1));var _0x8a7c=function(_0x3cfe1b,_0x3fef14){_0x3cfe1b=_0x3cfe1b-0x0;var _0x3fe201=_0xa7c8[_0x3cfe1b];return _0x3fe201;};'use strict';var _=require(_0x8a7c('0x0'));var util=require(_0x8a7c('0x1'));var logger=require(_0x8a7c('0x2'))(_0x8a7c('0x3'));var moment=require(_0x8a7c('0x4'));var BPromise=require(_0x8a7c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a7c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a7c('0x7'));module[_0x8a7c('0x8')]=function(_0x59eb09,_0x52ca2b){return _0x59eb09[_0x8a7c('0x9')](_0x8a7c('0xa'),attributes,{'tableName':_0x8a7c('0xb'),'paranoid':![],'indexes':[{'name':_0x8a7c('0xc'),'fields':['idField',_0x8a7c('0xd')],'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 e793d6a..c7fa54a 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x1d8d70,_0x22b82d){var _0x5e241f=function(_0x2845b7){while(--_0x2845b7){_0x1d8d70['push'](_0x1d8d70['shift']());}};_0x5e241f(++_0x22b82d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x4fc2,0x111));var _0x24fc=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x4fc2[_0x3c38c7];return _0x4aa4b1;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 64797e4..bc797d2 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 _0x987a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy'];(function(_0x166b76,_0x5dc873){var _0x98a50e=function(_0x2d263f){while(--_0x2d263f){_0x166b76['push'](_0x166b76['shift']());}};_0x98a50e(++_0x5dc873);}(_0x987a,0x199));var _0xa987=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x987a[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0xa987('0x0'));var util=require(_0xa987('0x1'));var path=require(_0xa987('0x2'));var timeout=require(_0xa987('0x3'));var express=require(_0xa987('0x4'));var router=express[_0xa987('0x5')]();var auth=require(_0xa987('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa987('0x7'));router[_0xa987('0x8')]('/',auth[_0xa987('0x9')](),controller[_0xa987('0xa')]);router[_0xa987('0x8')]('/:id',auth[_0xa987('0x9')](),controller[_0xa987('0xb')]);router[_0xa987('0x8')](_0xa987('0xc'),auth[_0xa987('0x9')](),controller[_0xa987('0xd')]);router[_0xa987('0x8')](_0xa987('0xe'),auth[_0xa987('0x9')](),controller[_0xa987('0xf')]);router[_0xa987('0x10')]('/',auth[_0xa987('0x9')](),controller[_0xa987('0x11')]);router['post'](_0xa987('0xc'),auth[_0xa987('0x9')](),controller['addConfiguration']);router[_0xa987('0x12')](_0xa987('0x13'),auth['isAuthenticated'](),controller[_0xa987('0x14')]);router[_0xa987('0x15')](_0xa987('0x13'),auth[_0xa987('0x9')](),controller[_0xa987('0x16')]);module[_0xa987('0x17')]=router; \ No newline at end of file +var _0x4a1f=['post','create','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4a1f,0xf0));var _0xf4a1=function(_0x4a2707,_0x56a7aa){_0x4a2707=_0x4a2707-0x0;var _0x2eb468=_0x4a1f[_0x4a2707];return _0x2eb468;};'use strict';var multer=require(_0xf4a1('0x0'));var util=require(_0xf4a1('0x1'));var path=require('path');var timeout=require(_0xf4a1('0x2'));var express=require(_0xf4a1('0x3'));var router=express['Router']();var auth=require(_0xf4a1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0xf4a1('0x5')]('/',auth[_0xf4a1('0x6')](),controller['index']);router[_0xf4a1('0x5')](_0xf4a1('0x7'),auth[_0xf4a1('0x6')](),controller[_0xf4a1('0x8')]);router[_0xf4a1('0x5')](_0xf4a1('0x9'),auth[_0xf4a1('0x6')](),controller[_0xf4a1('0xa')]);router['get'](_0xf4a1('0xb'),auth[_0xf4a1('0x6')](),controller['getFields']);router[_0xf4a1('0xc')]('/',auth[_0xf4a1('0x6')](),controller[_0xf4a1('0xd')]);router['post'](_0xf4a1('0x9'),auth[_0xf4a1('0x6')](),controller[_0xf4a1('0xe')]);router['put'](_0xf4a1('0x7'),auth[_0xf4a1('0x6')](),controller['update']);router[_0xf4a1('0xf')](_0xf4a1('0x7'),auth[_0xf4a1('0x6')](),controller[_0xf4a1('0x10')]);module[_0xf4a1('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a37f8b5..a6e829a 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 _0x424f=['HelpDesk','STRING'];(function(_0x429338,_0x63fe3a){var _0xfd8fff=function(_0x48ebc2){while(--_0x48ebc2){_0x429338['push'](_0x429338['shift']());}};_0xfd8fff(++_0x63fe3a);}(_0x424f,0x135));var _0xf424=function(_0x367ef6,_0x2bfca6){_0x367ef6=_0x367ef6-0x0;var _0x59d715=_0x424f[_0x367ef6];return _0x59d715;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf424('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf424('0x1')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf424('0x0')]},'accessKey':{'type':Sequelize[_0xf424('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x094b=['STRING','sequelize','exports'];(function(_0x39fd7e,_0x17607d){var _0x1d5746=function(_0x11791a){while(--_0x11791a){_0x39fd7e['push'](_0x39fd7e['shift']());}};_0x1d5746(++_0x17607d);}(_0x094b,0x14e));var _0xb094=function(_0x531c43,_0x374118){_0x531c43=_0x531c43-0x0;var _0x5b46e9=_0x094b[_0x531c43];return _0x5b46e9;};'use strict';var Sequelize=require(_0xb094('0x0'));module[_0xb094('0x1')]={'name':{'type':Sequelize[_0xb094('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb094('0x2')]},'username':{'type':Sequelize[_0xb094('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb094('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb094('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb094('0x2')]},'accessKey':{'type':Sequelize[_0xb094('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 280f67c..e194f7b 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 _0x3e4d=['mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','update','destroy','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','show','params','keys','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','format','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference','remove','includes','editable','startsWith','cf_','picklistValues','label','value','statusCode','Wrong\x20credentials','html-pdf','rimraf','moment','bluebird'];(function(_0x4564d0,_0x140f13){var _0x54589b=function(_0x21a034){while(--_0x21a034){_0x4564d0['push'](_0x4564d0['shift']());}};_0x54589b(++_0x140f13);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x486801,_0x558502){_0x486801=_0x486801-0x0;var _0x3667e1=_0x3e4d[_0x486801];return _0x3667e1;};'use strict';var pdf=require(_0xd3e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd3e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd3e4('0x2'));var BPromise=require(_0xd3e4('0x3'));var Mustache=require(_0xd3e4('0x4'));var util=require('util');var path=require(_0xd3e4('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd3e4('0x6'));var fs=require('fs');var _=require(_0xd3e4('0x7'));var squel=require(_0xd3e4('0x8'));var crypto=require(_0xd3e4('0x9'));var jsforce=require(_0xd3e4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd3e4('0xb'));var querystring=require(_0xd3e4('0xc'));var Papa=require(_0xd3e4('0xd'));var Redis=require('ioredis');var authService=require(_0xd3e4('0xe'));var qs=require(_0xd3e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e4('0x10'))(_0xd3e4('0x11'));var utils=require(_0xd3e4('0x12'));var config=require(_0xd3e4('0x13'));var db=require(_0xd3e4('0x14'))['db'];var integrations=require(_0xd3e4('0x15'));var jayson=require(_0xd3e4('0x16'));var client=jayson['client'][_0xd3e4('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3d4799,_0x27f3a7,_0x4f15ef){if(_0x4f15ef){var _0x49c058=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49c058[_0xd3e4('0x18')](_0x27f3a7)){return _0x3d4799;}else{throw new db['Sequelize'][(_0xd3e4('0x19'))](_0xd3e4('0x1a'));}}else{return _0x3d4799;}}function respondWithRpcPromise(_0x586db9,_0x2dbbc5,_0x17081f,_0x4d5136){return new BPromise(function(_0x4fae0a,_0x5acc91){var _0x353f84=_0x4d5136||client;return _0x353f84[_0xd3e4('0x1b')](_0x586db9,_0x17081f)[_0xd3e4('0x1c')](function(_0x157658){logger[_0xd3e4('0x1d')]('VtigerAccount,\x20%s,\x20%s',_0x2dbbc5,_0xd3e4('0x1e'));logger[_0xd3e4('0x1f')](_0xd3e4('0x20'),_0x2dbbc5,'request\x20sent',JSON[_0xd3e4('0x21')](_0x157658));if(_0x157658[_0xd3e4('0x22')]){if(_0x157658[_0xd3e4('0x22')]['code']===0x1f4){logger[_0xd3e4('0x22')](_0xd3e4('0x23'),_0x2dbbc5,_0x157658[_0xd3e4('0x22')][_0xd3e4('0x24')]);return _0x5acc91(_0x157658[_0xd3e4('0x22')][_0xd3e4('0x24')]);}logger[_0xd3e4('0x22')](_0xd3e4('0x23'),_0x2dbbc5,_0x157658[_0xd3e4('0x22')][_0xd3e4('0x24')]);return _0x4fae0a(_0x157658['error'][_0xd3e4('0x24')]);}else{logger['info'](_0xd3e4('0x23'),_0x2dbbc5,_0xd3e4('0x1e'));_0x4fae0a(_0x157658[_0xd3e4('0x25')][_0xd3e4('0x24')]);}})[_0xd3e4('0x26')](function(_0x128efb){logger[_0xd3e4('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x2dbbc5,_0x128efb);_0x5acc91(_0x128efb);});});}function respondWithStatusCode(_0x512ab8,_0x81b1f5){_0x81b1f5=_0x81b1f5||0xcc;return function(_0x239763){if(_0x239763){return _0x512ab8[_0xd3e4('0x27')](_0x81b1f5);}return _0x512ab8[_0xd3e4('0x28')](_0x81b1f5)[_0xd3e4('0x29')]();};}function respondWithResult(_0x3017a1,_0x462586){_0x462586=_0x462586||0xc8;return function(_0x520383){if(_0x520383){return _0x3017a1['status'](_0x462586)['json'](_0x520383);}};}function respondWithFilteredResult(_0x1df754,_0x5e96fc){return function(_0x46dada){if(_0x46dada){var _0x387ea6=_0x46dada[_0xd3e4('0x2a')],_0x59b895=_0x5e96fc[_0xd3e4('0x2b')],_0x250e70=_0x5e96fc[_0xd3e4('0x2b')]+_0x5e96fc[_0xd3e4('0x2c')],_0xef4209;if(_0x250e70>=_0x387ea6){_0x250e70=_0x387ea6;_0xef4209=0xc8;}else{_0xef4209=0xce;}_0x1df754[_0xd3e4('0x28')](_0xef4209);return _0x1df754[_0xd3e4('0x2d')](_0xd3e4('0x2e'),_0x59b895+'-'+_0x250e70+'/'+_0x387ea6)[_0xd3e4('0x2f')](_0x46dada);}return null;};}function patchUpdates(_0x5548ef){return function(_0x267e88){try{jsonpatch['apply'](_0x267e88,_0x5548ef,!![]);}catch(_0x3fe00d){return BPromise['reject'](_0x3fe00d);}return _0x267e88['save']();};}function saveUpdates(_0x57446a,_0x2c6cce){return function(_0x30a324){if(_0x30a324){return _0x30a324[_0xd3e4('0x30')](_0x57446a)['then'](function(_0x354772){return _0x354772;});}return null;};}function removeEntity(_0x356063,_0x1ca7f4){return function(_0x2f5fc2){if(_0x2f5fc2){return _0x2f5fc2[_0xd3e4('0x31')]()[_0xd3e4('0x1c')](function(){_0x356063['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bc38,_0x479d00){return function(_0x85379e){if(!_0x85379e){_0x18bc38[_0xd3e4('0x27')](0x194);}return _0x85379e;};}function handleError(_0x42d363,_0x58c9b1){_0x58c9b1=_0x58c9b1||0x1f4;return function(_0x11e6b8){logger['error'](_0x11e6b8[_0xd3e4('0x32')]);if(_0x11e6b8[_0xd3e4('0x33')]){delete _0x11e6b8[_0xd3e4('0x33')];}_0x42d363[_0xd3e4('0x28')](_0x58c9b1)['send'](_0x11e6b8);};}exports[_0xd3e4('0x34')]=function(_0x52acbe,_0xf070fe){var _0x202a4e={},_0x1d4898={},_0x5cd56b={'count':0x0,'rows':[]};var _0xda654e=_[_0xd3e4('0x35')](db[_0xd3e4('0x36')][_0xd3e4('0x37')],function(_0xd2c61e){return{'name':_0xd2c61e[_0xd3e4('0x38')],'type':_0xd2c61e[_0xd3e4('0x39')][_0xd3e4('0x3a')]};});_0x1d4898[_0xd3e4('0x3b')]=_[_0xd3e4('0x35')](_0xda654e,_0xd3e4('0x33'));_0x1d4898[_0xd3e4('0x3c')]=_['keys'](_0x52acbe[_0xd3e4('0x3c')]);_0x1d4898[_0xd3e4('0x3d')]=_[_0xd3e4('0x3e')](_0x1d4898[_0xd3e4('0x3b')],_0x1d4898[_0xd3e4('0x3c')]);_0x202a4e[_0xd3e4('0x3f')]=_[_0xd3e4('0x3e')](_0x1d4898[_0xd3e4('0x3b')],qs[_0xd3e4('0x40')](_0x52acbe['query'][_0xd3e4('0x40')]));_0x202a4e['attributes']=_0x202a4e['attributes'][_0xd3e4('0x41')]?_0x202a4e['attributes']:_0x1d4898[_0xd3e4('0x3b')];if(!_0x52acbe['query'][_0xd3e4('0x42')](_0xd3e4('0x43'))){_0x202a4e[_0xd3e4('0x2c')]=qs[_0xd3e4('0x2c')](_0x52acbe[_0xd3e4('0x3c')][_0xd3e4('0x2c')]);_0x202a4e[_0xd3e4('0x2b')]=qs['offset'](_0x52acbe['query']['offset']);}_0x202a4e[_0xd3e4('0x44')]=qs[_0xd3e4('0x45')](_0x52acbe[_0xd3e4('0x3c')][_0xd3e4('0x45')]);_0x202a4e[_0xd3e4('0x46')]=qs[_0xd3e4('0x3d')](_[_0xd3e4('0x47')](_0x52acbe[_0xd3e4('0x3c')],_0x1d4898[_0xd3e4('0x3d')]));if(_0x52acbe[_0xd3e4('0x3c')]['filter']){_0x202a4e[_0xd3e4('0x46')]=_[_0xd3e4('0x48')](_0x202a4e[_0xd3e4('0x46')],{'$or':_[_0xd3e4('0x35')](_0xda654e,function(_0x1d4cb7){if(_0x1d4cb7[_0xd3e4('0x39')]!==_0xd3e4('0x49')){var _0x3d26a9={};_0x3d26a9[_0x1d4cb7[_0xd3e4('0x33')]]={'$like':'%'+_0x52acbe[_0xd3e4('0x3c')][_0xd3e4('0x4a')]+'%'};return _0x3d26a9;}})});}_0x202a4e=_[_0xd3e4('0x48')]({},_0x202a4e,_0x52acbe['options']);var _0x41dbf4={'where':_0x202a4e[_0xd3e4('0x46')]};return db[_0xd3e4('0x36')]['count'](_0x41dbf4)[_0xd3e4('0x1c')](function(_0x515728){_0x5cd56b[_0xd3e4('0x2a')]=_0x515728;if(_0x52acbe[_0xd3e4('0x3c')][_0xd3e4('0x4b')]){_0x202a4e[_0xd3e4('0x4c')]=[{'all':!![]}];}return db[_0xd3e4('0x36')]['findAll'](_0x202a4e);})[_0xd3e4('0x1c')](function(_0x1ef11b){_0x5cd56b['rows']=_0x1ef11b;return _0x5cd56b;})[_0xd3e4('0x1c')](respondWithFilteredResult(_0xf070fe,_0x202a4e))[_0xd3e4('0x26')](handleError(_0xf070fe,null));};exports[_0xd3e4('0x4d')]=function(_0x55d726,_0x26b7b3){var _0xbbd6ea={'raw':![],'where':{'id':_0x55d726[_0xd3e4('0x4e')]['id']}},_0x36f31a={};_0x36f31a[_0xd3e4('0x3b')]=_[_0xd3e4('0x4f')](db[_0xd3e4('0x36')]['rawAttributes']);_0x36f31a[_0xd3e4('0x3c')]=_[_0xd3e4('0x4f')](_0x55d726[_0xd3e4('0x3c')]);_0x36f31a[_0xd3e4('0x3d')]=_['intersection'](_0x36f31a[_0xd3e4('0x3b')],_0x36f31a[_0xd3e4('0x3c')]);_0xbbd6ea['attributes']=_['intersection'](_0x36f31a[_0xd3e4('0x3b')],qs[_0xd3e4('0x40')](_0x55d726[_0xd3e4('0x3c')][_0xd3e4('0x40')]));_0xbbd6ea['attributes']=_0xbbd6ea[_0xd3e4('0x3f')][_0xd3e4('0x41')]?_0xbbd6ea[_0xd3e4('0x3f')]:_0x36f31a['model'];if(_0x55d726[_0xd3e4('0x3c')][_0xd3e4('0x4b')]){_0xbbd6ea[_0xd3e4('0x4c')]=[{'all':!![]}];}_0xbbd6ea=_[_0xd3e4('0x48')]({},_0xbbd6ea,_0x55d726[_0xd3e4('0x50')]);return db['VtigerAccount'][_0xd3e4('0x51')](_0xbbd6ea)[_0xd3e4('0x1c')](handleEntityNotFound(_0x26b7b3,null))[_0xd3e4('0x1c')](respondWithResult(_0x26b7b3,null))[_0xd3e4('0x26')](handleError(_0x26b7b3,null));};exports['create']=function(_0x4fdcfa,_0x5e8843){return db[_0xd3e4('0x36')][_0xd3e4('0x52')](_0x4fdcfa[_0xd3e4('0x53')],{})['then'](respondWithResult(_0x5e8843,0xc9))['catch'](handleError(_0x5e8843,null));};exports[_0xd3e4('0x30')]=function(_0x17b237,_0x37d179){if(_0x17b237[_0xd3e4('0x53')]['id']){delete _0x17b237[_0xd3e4('0x53')]['id'];}return db[_0xd3e4('0x36')]['find']({'where':{'id':_0x17b237[_0xd3e4('0x4e')]['id']}})[_0xd3e4('0x1c')](handleEntityNotFound(_0x37d179,null))['then'](saveUpdates(_0x17b237[_0xd3e4('0x53')],null))['then'](respondWithResult(_0x37d179,null))['catch'](handleError(_0x37d179,null));};exports[_0xd3e4('0x31')]=function(_0xb01c29,_0x141a17){return db[_0xd3e4('0x36')][_0xd3e4('0x51')]({'where':{'id':_0xb01c29[_0xd3e4('0x4e')]['id']}})[_0xd3e4('0x1c')](handleEntityNotFound(_0x141a17,null))[_0xd3e4('0x1c')](removeEntity(_0x141a17,null))[_0xd3e4('0x26')](handleError(_0x141a17,null));};exports[_0xd3e4('0x54')]=function(_0x209743,_0x31ae08,_0x3197f3){var _0x38a285={};var _0x10eb0c={};var _0x85d67;var _0x390ff4;return db[_0xd3e4('0x36')][_0xd3e4('0x55')]({'where':{'id':_0x209743[_0xd3e4('0x4e')]['id']}})[_0xd3e4('0x1c')](handleEntityNotFound(_0x31ae08,null))[_0xd3e4('0x1c')](function(_0x5ecab7){if(_0x5ecab7){_0x85d67=_0x5ecab7;_0x10eb0c[_0xd3e4('0x3b')]=_[_0xd3e4('0x4f')](db[_0xd3e4('0x56')]['rawAttributes']);_0x10eb0c[_0xd3e4('0x3c')]=_['keys'](_0x209743['query']);_0x10eb0c[_0xd3e4('0x3d')]=_[_0xd3e4('0x3e')](_0x10eb0c[_0xd3e4('0x3b')],_0x10eb0c['query']);_0x38a285[_0xd3e4('0x3f')]=_['intersection'](_0x10eb0c[_0xd3e4('0x3b')],qs[_0xd3e4('0x40')](_0x209743[_0xd3e4('0x3c')]['fields']));_0x38a285[_0xd3e4('0x3f')]=_0x38a285[_0xd3e4('0x3f')][_0xd3e4('0x41')]?_0x38a285[_0xd3e4('0x3f')]:_0x10eb0c[_0xd3e4('0x3b')];_0x38a285[_0xd3e4('0x44')]=qs[_0xd3e4('0x45')](_0x209743[_0xd3e4('0x3c')][_0xd3e4('0x45')]);_0x38a285['where']=qs[_0xd3e4('0x3d')](_[_0xd3e4('0x47')](_0x209743[_0xd3e4('0x3c')],_0x10eb0c[_0xd3e4('0x3d')]));if(_0x209743['query'][_0xd3e4('0x4a')]){_0x38a285[_0xd3e4('0x46')]=_[_0xd3e4('0x48')](_0x38a285[_0xd3e4('0x46')],{'$or':_[_0xd3e4('0x35')](_0x38a285[_0xd3e4('0x3f')],function(_0x166d7b){var _0x310eec={};_0x310eec[_0x166d7b]={'$like':'%'+_0x209743[_0xd3e4('0x3c')]['filter']+'%'};return _0x310eec;})});}_0x38a285=_[_0xd3e4('0x48')]({},_0x38a285,_0x209743[_0xd3e4('0x50')]);return _0x85d67[_0xd3e4('0x54')](_0x38a285);}})['then'](function(_0x18baf0){if(_0x18baf0){_0x390ff4=_0x18baf0[_0xd3e4('0x41')];if(!_0x209743[_0xd3e4('0x3c')]['hasOwnProperty']('nolimit')){_0x38a285[_0xd3e4('0x2c')]=qs['limit'](_0x209743['query'][_0xd3e4('0x2c')]);_0x38a285[_0xd3e4('0x2b')]=qs[_0xd3e4('0x2b')](_0x209743[_0xd3e4('0x3c')][_0xd3e4('0x2b')]);}return _0x85d67[_0xd3e4('0x54')](_0x38a285);}})['then'](function(_0xcbc38a){if(_0xcbc38a){return _0xcbc38a?{'count':_0x390ff4,'rows':_0xcbc38a}:null;}})['then'](respondWithResult(_0x31ae08,null))[_0xd3e4('0x26')](handleError(_0x31ae08,null));};exports['addConfiguration']=function(_0x33b4be,_0x67e72b,_0x5f5460){if(_0x33b4be[_0xd3e4('0x53')]['id']){delete _0x33b4be[_0xd3e4('0x53')]['id'];}return db[_0xd3e4('0x36')]['findOne']({'where':{'id':_0x33b4be['params']['id']}})[_0xd3e4('0x1c')](handleEntityNotFound(_0x67e72b,null))[_0xd3e4('0x1c')](function(_0x1c44e3){if(_0x1c44e3){_0x33b4be[_0xd3e4('0x53')][_0xd3e4('0x57')]=_0x1c44e3['id'];_0x33b4be[_0xd3e4('0x53')][_0xd3e4('0x58')]=integrations['getSubjects'](_0x33b4be[_0xd3e4('0x53')]['channel'],_0x33b4be[_0xd3e4('0x53')][_0xd3e4('0x39')]);_0x33b4be[_0xd3e4('0x53')][_0xd3e4('0x59')]=integrations[_0xd3e4('0x5a')](_0x33b4be['body'][_0xd3e4('0x5b')],_0x33b4be[_0xd3e4('0x53')][_0xd3e4('0x39')]);return db['VtigerConfiguration'][_0xd3e4('0x52')](_0x33b4be[_0xd3e4('0x53')],{'include':[{'model':db['VtigerField'],'as':_0xd3e4('0x58')},{'model':db[_0xd3e4('0x5c')],'as':_0xd3e4('0x59')}]});}return null;})['then'](respondWithResult(_0x67e72b,null))['catch'](handleError(_0x67e72b,null));};var md5=require('md5');exports[_0xd3e4('0x5d')]=function(_0x3d36dc,_0x358505,_0x41cb22){var _0x9be4b=null;var _0x1f0952=null;var _0x59351d=null;var _0x4a0806=null;var _0x36c499='';return db[_0xd3e4('0x36')][_0xd3e4('0x55')]({'where':{'id':_0x3d36dc[_0xd3e4('0x4e')]['id']},'attributes':['id',_0xd3e4('0x33'),_0xd3e4('0x5e'),_0xd3e4('0x5f'),_0xd3e4('0x60'),'remoteUri',_0xd3e4('0x61'),'accessKey']})[_0xd3e4('0x1c')](handleEntityNotFound(_0x358505,null))['then'](function(_0x2d3955){if(_0x2d3955){_0x9be4b=_0x2d3955[_0xd3e4('0x5e')];_0x1f0952=_0x2d3955[_0xd3e4('0x62')];_0x59351d=_0x2d3955[_0xd3e4('0x60')];_0x36c499=_0x2d3955[_0xd3e4('0x63')];var _0x1ed713=_0x36c499[_0xd3e4('0x64')](-0x1);if(_0x1ed713==='/'){_0x36c499=_0x36c499[_0xd3e4('0x65')](0x0,_0x36c499['lastIndexOf'](_0x1ed713));}_0x4a0806=util[_0xd3e4('0x66')]('%s/webservice.php',_0x36c499);var _0x250389={'method':_0xd3e4('0x67'),'uri':_0x4a0806,'qs':{'operation':_0xd3e4('0x68'),'username':_0x2d3955['username']},'json':!![]};return rp(_0x250389);}})[_0xd3e4('0x1c')](function(_0x58b041){if(_0x58b041[_0xd3e4('0x69')]){var _0x4f335b={'method':_0xd3e4('0x6a'),'uri':_0x4a0806,'form':{'operation':_0xd3e4('0x6b'),'username':_0x9be4b,'accessKey':md5(_0x58b041[_0xd3e4('0x25')][_0xd3e4('0x6c')]+_0x1f0952)},'json':!![]};return rp(_0x4f335b);}})[_0xd3e4('0x1c')](function(_0x40843d){if(_0x40843d['success']){var _0x5cea50={'method':_0xd3e4('0x67'),'uri':_0x4a0806,'qs':{'operation':_0xd3e4('0x6d'),'username':_0x9be4b,'sessionName':_0x40843d[_0xd3e4('0x25')][_0xd3e4('0x6e')],'elementType':_0x59351d},'json':!![]};return rp(_0x5cea50);}})[_0xd3e4('0x1c')](function(_0x3e046b){if(_0x3e046b[_0xd3e4('0x69')]){var _0x11e932=[_0xd3e4('0x6f'),_0xd3e4('0x70'),'owner'];_[_0xd3e4('0x71')](_0x3e046b['result'][_0xd3e4('0x40')],function(_0x58ca17){return _0x11e932[_0xd3e4('0x72')](_0x58ca17[_0xd3e4('0x39')]['name']);});_[_0xd3e4('0x71')](_0x3e046b[_0xd3e4('0x25')]['fields'],function(_0x4eb729){return _0x4eb729[_0xd3e4('0x73')]==='false';});return{'count':_0x3e046b[_0xd3e4('0x25')][_0xd3e4('0x40')]['length'],'rows':_[_0xd3e4('0x35')](_0x3e046b[_0xd3e4('0x25')][_0xd3e4('0x40')],function(_0x1eeb3a){return{'id':_0x1eeb3a[_0xd3e4('0x33')],'name':_0x1eeb3a['label'],'custom':_[_0xd3e4('0x74')](_0x1eeb3a[_0xd3e4('0x33')],_0xd3e4('0x75'))?!![]:![],'options':_0x1eeb3a[_0xd3e4('0x39')]['name']==='picklist'&&_0x1eeb3a[_0xd3e4('0x39')][_0xd3e4('0x76')]['length']>0x0?_[_0xd3e4('0x35')](_0x1eeb3a['type'][_0xd3e4('0x76')],function(_0x58c266){return{'name':_0x58c266[_0xd3e4('0x77')],'value':_0x58c266[_0xd3e4('0x78')]};}):[]};})};}})[_0xd3e4('0x1c')](respondWithResult(_0x358505,null))[_0xd3e4('0x26')](function(_0x4eb1c2){console['log']('vTiger\x20error:\x20'+_0x4eb1c2);var _0x245d55=_0x3d36dc[_0xd3e4('0x3c')][_0xd3e4('0x18')]?0x1f4:_0x4eb1c2[_0xd3e4('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x245d55,JSON[_0xd3e4('0x21')](_0x4eb1c2));delete _0x4eb1c2[_0xd3e4('0x33')];if(_0x245d55===0x191){_0x245d55=0x190;}_0x358505[_0xd3e4('0x28')](_0x245d55)['send'](_0x3d36dc[_0xd3e4('0x3c')][_0xd3e4('0x18')]?{'message':_0xd3e4('0x7a'),'statusCode':_0x4eb1c2['statusCode']}:_0x4eb1c2);});}; \ No newline at end of file +var _0x0124=['options','count','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','destroy','getConfigurations','VtigerConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','reference','remove','includes','editable','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../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','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','set','Content-Range','save','update','end','stack','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge'];(function(_0x349faa,_0x5a7f30){var _0x160e7e=function(_0x313663){while(--_0x313663){_0x349faa['push'](_0x349faa['shift']());}};_0x160e7e(++_0x5a7f30);}(_0x0124,0x1b4));var _0x4012=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x0124[_0x1098db];return _0x14f090;};'use strict';var pdf=require(_0x4012('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4012('0x1'));var zipdir=require(_0x4012('0x2'));var jsonpatch=require(_0x4012('0x3'));var rp=require(_0x4012('0x4'));var moment=require('moment');var BPromise=require(_0x4012('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4012('0x6'));var sox=require(_0x4012('0x7'));var csv=require('to-csv');var ejs=require(_0x4012('0x8'));var fs=require('fs');var _=require(_0x4012('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4012('0xa'));var deskjs=require(_0x4012('0xb'));var toCsv=require(_0x4012('0xc'));var querystring=require('querystring');var Papa=require(_0x4012('0xd'));var Redis=require(_0x4012('0xe'));var authService=require(_0x4012('0xf'));var qs=require(_0x4012('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4012('0x11'));var logger=require(_0x4012('0x12'))('api');var utils=require(_0x4012('0x13'));var config=require(_0x4012('0x14'));var db=require(_0x4012('0x15'))['db'];var integrations=require(_0x4012('0x16'));var jayson=require(_0x4012('0x17'));var client=jayson[_0x4012('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x385ad5,_0x1d86b9,_0x59c9f5){if(_0x59c9f5){var _0x4d5bb3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d5bb3[_0x4012('0x19')](_0x1d86b9)){return _0x385ad5;}else{throw new db['Sequelize']['ValidationError'](_0x4012('0x1a'));}}else{return _0x385ad5;}}function respondWithRpcPromise(_0x13f90d,_0x2bec4f,_0x422298,_0x20308e){return new BPromise(function(_0x40492a,_0x31d455){var _0x4a4500=_0x20308e||client;return _0x4a4500[_0x4012('0x1b')](_0x13f90d,_0x422298)[_0x4012('0x1c')](function(_0x5be369){logger['info'](_0x4012('0x1d'),_0x2bec4f,_0x4012('0x1e'));logger['debug'](_0x4012('0x1f'),_0x2bec4f,'request\x20sent',JSON[_0x4012('0x20')](_0x5be369));if(_0x5be369[_0x4012('0x21')]){if(_0x5be369['error'][_0x4012('0x22')]===0x1f4){logger[_0x4012('0x21')](_0x4012('0x1d'),_0x2bec4f,_0x5be369[_0x4012('0x21')]['message']);return _0x31d455(_0x5be369[_0x4012('0x21')][_0x4012('0x23')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x2bec4f,_0x5be369['error']['message']);return _0x40492a(_0x5be369[_0x4012('0x21')][_0x4012('0x23')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x2bec4f,_0x4012('0x1e'));_0x40492a(_0x5be369[_0x4012('0x24')][_0x4012('0x23')]);}})['catch'](function(_0x23be0b){logger[_0x4012('0x21')](_0x4012('0x1d'),_0x2bec4f,_0x23be0b);_0x31d455(_0x23be0b);});});}function respondWithStatusCode(_0x225f35,_0x2b43c7){_0x2b43c7=_0x2b43c7||0xcc;return function(_0x5a129e){if(_0x5a129e){return _0x225f35[_0x4012('0x25')](_0x2b43c7);}return _0x225f35[_0x4012('0x26')](_0x2b43c7)['end']();};}function respondWithResult(_0x5a20e8,_0x1539fe){_0x1539fe=_0x1539fe||0xc8;return function(_0x21364a){if(_0x21364a){return _0x5a20e8['status'](_0x1539fe)[_0x4012('0x27')](_0x21364a);}};}function respondWithFilteredResult(_0xe9eab6,_0x85744){return function(_0x48c62e){if(_0x48c62e){var _0x2043c0=_0x48c62e['count'],_0x54e09f=_0x85744[_0x4012('0x28')],_0x305f11=_0x85744[_0x4012('0x28')]+_0x85744[_0x4012('0x29')],_0x5a5fca;if(_0x305f11>=_0x2043c0){_0x305f11=_0x2043c0;_0x5a5fca=0xc8;}else{_0x5a5fca=0xce;}_0xe9eab6['status'](_0x5a5fca);return _0xe9eab6[_0x4012('0x2a')](_0x4012('0x2b'),_0x54e09f+'-'+_0x305f11+'/'+_0x2043c0)['json'](_0x48c62e);}return null;};}function patchUpdates(_0x467104){return function(_0x16a3f3){try{jsonpatch['apply'](_0x16a3f3,_0x467104,!![]);}catch(_0x273c9e){return BPromise['reject'](_0x273c9e);}return _0x16a3f3[_0x4012('0x2c')]();};}function saveUpdates(_0x58ce71,_0x58a4c9){return function(_0x16c2d6){if(_0x16c2d6){return _0x16c2d6[_0x4012('0x2d')](_0x58ce71)[_0x4012('0x1c')](function(_0x55611a){return _0x55611a;});}return null;};}function removeEntity(_0x400846,_0xf9ba57){return function(_0x4d96dc){if(_0x4d96dc){return _0x4d96dc['destroy']()[_0x4012('0x1c')](function(){_0x400846['status'](0xcc)[_0x4012('0x2e')]();});}};}function handleEntityNotFound(_0x8b58d5,_0x297dbf){return function(_0x239946){if(!_0x239946){_0x8b58d5['sendStatus'](0x194);}return _0x239946;};}function handleError(_0x4fbaa6,_0x4aa17b){_0x4aa17b=_0x4aa17b||0x1f4;return function(_0x42d191){logger[_0x4012('0x21')](_0x42d191[_0x4012('0x2f')]);if(_0x42d191['name']){delete _0x42d191['name'];}_0x4fbaa6['status'](_0x4aa17b)[_0x4012('0x30')](_0x42d191);};}exports[_0x4012('0x31')]=function(_0x454f95,_0x3aab57){var _0x309b07={},_0x571c8c={},_0x3f4642={'count':0x0,'rows':[]};var _0x344d5f=_[_0x4012('0x32')](db[_0x4012('0x33')][_0x4012('0x34')],function(_0x12475d){return{'name':_0x12475d[_0x4012('0x35')],'type':_0x12475d['type'][_0x4012('0x36')]};});_0x571c8c[_0x4012('0x37')]=_[_0x4012('0x32')](_0x344d5f,_0x4012('0x38'));_0x571c8c[_0x4012('0x39')]=_['keys'](_0x454f95[_0x4012('0x39')]);_0x571c8c[_0x4012('0x3a')]=_[_0x4012('0x3b')](_0x571c8c[_0x4012('0x37')],_0x571c8c[_0x4012('0x39')]);_0x309b07[_0x4012('0x3c')]=_['intersection'](_0x571c8c[_0x4012('0x37')],qs[_0x4012('0x3d')](_0x454f95['query'][_0x4012('0x3d')]));_0x309b07['attributes']=_0x309b07[_0x4012('0x3c')]['length']?_0x309b07[_0x4012('0x3c')]:_0x571c8c['model'];if(!_0x454f95[_0x4012('0x39')][_0x4012('0x3e')](_0x4012('0x3f'))){_0x309b07[_0x4012('0x29')]=qs['limit'](_0x454f95[_0x4012('0x39')][_0x4012('0x29')]);_0x309b07[_0x4012('0x28')]=qs['offset'](_0x454f95[_0x4012('0x39')][_0x4012('0x28')]);}_0x309b07[_0x4012('0x40')]=qs[_0x4012('0x41')](_0x454f95[_0x4012('0x39')]['sort']);_0x309b07['where']=qs[_0x4012('0x3a')](_[_0x4012('0x42')](_0x454f95['query'],_0x571c8c[_0x4012('0x3a')]));if(_0x454f95[_0x4012('0x39')][_0x4012('0x43')]){_0x309b07[_0x4012('0x44')]=_['merge'](_0x309b07['where'],{'$or':_[_0x4012('0x32')](_0x344d5f,function(_0x3aa962){if(_0x3aa962[_0x4012('0x45')]!==_0x4012('0x46')){var _0x11afc8={};_0x11afc8[_0x3aa962[_0x4012('0x38')]]={'$like':'%'+_0x454f95[_0x4012('0x39')][_0x4012('0x43')]+'%'};return _0x11afc8;}})});}_0x309b07=_[_0x4012('0x47')]({},_0x309b07,_0x454f95[_0x4012('0x48')]);var _0x209ccf={'where':_0x309b07['where']};return db[_0x4012('0x33')]['count'](_0x209ccf)['then'](function(_0x4db0d4){_0x3f4642[_0x4012('0x49')]=_0x4db0d4;if(_0x454f95[_0x4012('0x39')][_0x4012('0x4a')]){_0x309b07[_0x4012('0x4b')]=[{'all':!![]}];}return db[_0x4012('0x33')][_0x4012('0x4c')](_0x309b07);})[_0x4012('0x1c')](function(_0x3e1303){_0x3f4642[_0x4012('0x4d')]=_0x3e1303;return _0x3f4642;})[_0x4012('0x1c')](respondWithFilteredResult(_0x3aab57,_0x309b07))[_0x4012('0x4e')](handleError(_0x3aab57,null));};exports['show']=function(_0x301c3f,_0xb821e){var _0x2395cc={'raw':![],'where':{'id':_0x301c3f[_0x4012('0x4f')]['id']}},_0x265136={};_0x265136[_0x4012('0x37')]=_[_0x4012('0x50')](db['VtigerAccount'][_0x4012('0x34')]);_0x265136[_0x4012('0x39')]=_['keys'](_0x301c3f['query']);_0x265136[_0x4012('0x3a')]=_['intersection'](_0x265136['model'],_0x265136[_0x4012('0x39')]);_0x2395cc[_0x4012('0x3c')]=_['intersection'](_0x265136[_0x4012('0x37')],qs[_0x4012('0x3d')](_0x301c3f[_0x4012('0x39')][_0x4012('0x3d')]));_0x2395cc[_0x4012('0x3c')]=_0x2395cc[_0x4012('0x3c')][_0x4012('0x51')]?_0x2395cc[_0x4012('0x3c')]:_0x265136[_0x4012('0x37')];if(_0x301c3f[_0x4012('0x39')][_0x4012('0x4a')]){_0x2395cc[_0x4012('0x4b')]=[{'all':!![]}];}_0x2395cc=_[_0x4012('0x47')]({},_0x2395cc,_0x301c3f['options']);return db[_0x4012('0x33')][_0x4012('0x52')](_0x2395cc)[_0x4012('0x1c')](handleEntityNotFound(_0xb821e,null))[_0x4012('0x1c')](respondWithResult(_0xb821e,null))['catch'](handleError(_0xb821e,null));};exports[_0x4012('0x53')]=function(_0x56c649,_0x15c0d){return db[_0x4012('0x33')][_0x4012('0x53')](_0x56c649[_0x4012('0x54')],{})['then'](respondWithResult(_0x15c0d,0xc9))[_0x4012('0x4e')](handleError(_0x15c0d,null));};exports[_0x4012('0x2d')]=function(_0x1f95ec,_0x4a0f66){if(_0x1f95ec[_0x4012('0x54')]['id']){delete _0x1f95ec[_0x4012('0x54')]['id'];}return db[_0x4012('0x33')][_0x4012('0x52')]({'where':{'id':_0x1f95ec[_0x4012('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a0f66,null))[_0x4012('0x1c')](saveUpdates(_0x1f95ec[_0x4012('0x54')],null))[_0x4012('0x1c')](respondWithResult(_0x4a0f66,null))[_0x4012('0x4e')](handleError(_0x4a0f66,null));};exports[_0x4012('0x55')]=function(_0x26575d,_0x4c7632){return db[_0x4012('0x33')][_0x4012('0x52')]({'where':{'id':_0x26575d[_0x4012('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4c7632,null))[_0x4012('0x1c')](removeEntity(_0x4c7632,null))[_0x4012('0x4e')](handleError(_0x4c7632,null));};exports[_0x4012('0x56')]=function(_0x496e2d,_0x6ff7c2,_0x251919){var _0x174187={};var _0x5dfd03={};var _0x16cae3;var _0x2804fd;return db[_0x4012('0x33')]['findOne']({'where':{'id':_0x496e2d['params']['id']}})[_0x4012('0x1c')](handleEntityNotFound(_0x6ff7c2,null))[_0x4012('0x1c')](function(_0x4f9eae){if(_0x4f9eae){_0x16cae3=_0x4f9eae;_0x5dfd03['model']=_[_0x4012('0x50')](db[_0x4012('0x57')][_0x4012('0x34')]);_0x5dfd03[_0x4012('0x39')]=_[_0x4012('0x50')](_0x496e2d[_0x4012('0x39')]);_0x5dfd03[_0x4012('0x3a')]=_[_0x4012('0x3b')](_0x5dfd03[_0x4012('0x37')],_0x5dfd03[_0x4012('0x39')]);_0x174187[_0x4012('0x3c')]=_[_0x4012('0x3b')](_0x5dfd03['model'],qs['fields'](_0x496e2d[_0x4012('0x39')][_0x4012('0x3d')]));_0x174187[_0x4012('0x3c')]=_0x174187[_0x4012('0x3c')][_0x4012('0x51')]?_0x174187['attributes']:_0x5dfd03[_0x4012('0x37')];_0x174187['order']=qs['sort'](_0x496e2d['query'][_0x4012('0x41')]);_0x174187[_0x4012('0x44')]=qs[_0x4012('0x3a')](_[_0x4012('0x42')](_0x496e2d['query'],_0x5dfd03[_0x4012('0x3a')]));if(_0x496e2d[_0x4012('0x39')][_0x4012('0x43')]){_0x174187[_0x4012('0x44')]=_[_0x4012('0x47')](_0x174187[_0x4012('0x44')],{'$or':_[_0x4012('0x32')](_0x174187['attributes'],function(_0x5cc92d){var _0x5d5c8e={};_0x5d5c8e[_0x5cc92d]={'$like':'%'+_0x496e2d[_0x4012('0x39')][_0x4012('0x43')]+'%'};return _0x5d5c8e;})});}_0x174187=_[_0x4012('0x47')]({},_0x174187,_0x496e2d[_0x4012('0x48')]);return _0x16cae3[_0x4012('0x56')](_0x174187);}})[_0x4012('0x1c')](function(_0x2672da){if(_0x2672da){_0x2804fd=_0x2672da[_0x4012('0x51')];if(!_0x496e2d[_0x4012('0x39')]['hasOwnProperty'](_0x4012('0x3f'))){_0x174187[_0x4012('0x29')]=qs['limit'](_0x496e2d[_0x4012('0x39')][_0x4012('0x29')]);_0x174187['offset']=qs['offset'](_0x496e2d[_0x4012('0x39')][_0x4012('0x28')]);}return _0x16cae3['getConfigurations'](_0x174187);}})[_0x4012('0x1c')](function(_0x987310){if(_0x987310){return _0x987310?{'count':_0x2804fd,'rows':_0x987310}:null;}})[_0x4012('0x1c')](respondWithResult(_0x6ff7c2,null))['catch'](handleError(_0x6ff7c2,null));};exports['addConfiguration']=function(_0x28e81e,_0x4eff2d,_0x215d6e){if(_0x28e81e[_0x4012('0x54')]['id']){delete _0x28e81e[_0x4012('0x54')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x28e81e['params']['id']}})[_0x4012('0x1c')](handleEntityNotFound(_0x4eff2d,null))[_0x4012('0x1c')](function(_0x555607){if(_0x555607){_0x28e81e[_0x4012('0x54')][_0x4012('0x58')]=_0x555607['id'];_0x28e81e[_0x4012('0x54')][_0x4012('0x59')]=integrations['getSubjects'](_0x28e81e['body'][_0x4012('0x5a')],_0x28e81e['body'][_0x4012('0x45')]);_0x28e81e['body'][_0x4012('0x5b')]=integrations[_0x4012('0x5c')](_0x28e81e[_0x4012('0x54')]['channel'],_0x28e81e['body'][_0x4012('0x45')]);return db[_0x4012('0x57')][_0x4012('0x53')](_0x28e81e[_0x4012('0x54')],{'include':[{'model':db['VtigerField'],'as':_0x4012('0x59')},{'model':db[_0x4012('0x5d')],'as':_0x4012('0x5b')}]});}return null;})[_0x4012('0x1c')](respondWithResult(_0x4eff2d,null))[_0x4012('0x4e')](handleError(_0x4eff2d,null));};var md5=require(_0x4012('0x5e'));exports['getFields']=function(_0x4f348d,_0x186d0c,_0x3c7d73){var _0x3bf38e=null;var _0x603f2e=null;var _0x82d126=null;var _0x3cc67a=null;var _0x215a80='';return db['VtigerAccount'][_0x4012('0x5f')]({'where':{'id':_0x4f348d['params']['id']},'attributes':['id',_0x4012('0x38'),_0x4012('0x60'),_0x4012('0x61'),_0x4012('0x62'),_0x4012('0x63'),_0x4012('0x64'),_0x4012('0x65')]})[_0x4012('0x1c')](handleEntityNotFound(_0x186d0c,null))['then'](function(_0x2878b4){if(_0x2878b4){_0x3bf38e=_0x2878b4[_0x4012('0x60')];_0x603f2e=_0x2878b4[_0x4012('0x65')];_0x82d126=_0x2878b4[_0x4012('0x62')];_0x215a80=_0x2878b4[_0x4012('0x63')];var _0x33ed50=_0x215a80[_0x4012('0x66')](-0x1);if(_0x33ed50==='/'){_0x215a80=_0x215a80[_0x4012('0x67')](0x0,_0x215a80[_0x4012('0x68')](_0x33ed50));}_0x3cc67a=util[_0x4012('0x69')](_0x4012('0x6a'),_0x215a80);var _0x1a9c95={'method':_0x4012('0x6b'),'uri':_0x3cc67a,'qs':{'operation':_0x4012('0x6c'),'username':_0x2878b4[_0x4012('0x60')]},'json':!![]};return rp(_0x1a9c95);}})[_0x4012('0x1c')](function(_0xaa6ffb){if(_0xaa6ffb['success']){var _0x4675cd={'method':_0x4012('0x6d'),'uri':_0x3cc67a,'form':{'operation':_0x4012('0x6e'),'username':_0x3bf38e,'accessKey':md5(_0xaa6ffb[_0x4012('0x24')][_0x4012('0x6f')]+_0x603f2e)},'json':!![]};return rp(_0x4675cd);}})[_0x4012('0x1c')](function(_0x490c5d){if(_0x490c5d[_0x4012('0x70')]){var _0x54bd74={'method':_0x4012('0x6b'),'uri':_0x3cc67a,'qs':{'operation':'describe','username':_0x3bf38e,'sessionName':_0x490c5d[_0x4012('0x24')]['sessionName'],'elementType':_0x82d126},'json':!![]};return rp(_0x54bd74);}})[_0x4012('0x1c')](function(_0x267e00){if(_0x267e00['success']){var _0x443b32=['autogenerated',_0x4012('0x71'),'owner'];_[_0x4012('0x72')](_0x267e00[_0x4012('0x24')][_0x4012('0x3d')],function(_0x5836a3){return _0x443b32[_0x4012('0x73')](_0x5836a3['type'][_0x4012('0x38')]);});_[_0x4012('0x72')](_0x267e00[_0x4012('0x24')][_0x4012('0x3d')],function(_0x3ad7f0){return _0x3ad7f0[_0x4012('0x74')]==='false';});return{'count':_0x267e00['result'][_0x4012('0x3d')][_0x4012('0x51')],'rows':_[_0x4012('0x32')](_0x267e00['result'][_0x4012('0x3d')],function(_0x38ac43){return{'id':_0x38ac43[_0x4012('0x38')],'name':_0x38ac43['label'],'custom':_['startsWith'](_0x38ac43[_0x4012('0x38')],_0x4012('0x75'))?!![]:![],'options':_0x38ac43['type']['name']===_0x4012('0x76')&&_0x38ac43[_0x4012('0x45')][_0x4012('0x77')][_0x4012('0x51')]>0x0?_[_0x4012('0x32')](_0x38ac43[_0x4012('0x45')][_0x4012('0x77')],function(_0x56cc99){return{'name':_0x56cc99[_0x4012('0x78')],'value':_0x56cc99[_0x4012('0x79')]};}):[]};})};}})[_0x4012('0x1c')](respondWithResult(_0x186d0c,null))[_0x4012('0x4e')](function(_0x3aa615){console['log'](_0x4012('0x7a')+_0x3aa615);var _0x4b82de=_0x4f348d[_0x4012('0x39')]['test']?0x1f4:_0x3aa615[_0x4012('0x7b')]||0x1f4;logger[_0x4012('0x21')](_0x4012('0x7c'),_0x4012('0x7d'),_0x4b82de,JSON[_0x4012('0x20')](_0x3aa615));delete _0x3aa615['name'];if(_0x4b82de===0x191){_0x4b82de=0x190;}_0x186d0c[_0x4012('0x26')](_0x4b82de)[_0x4012('0x30')](_0x4f348d[_0x4012('0x39')][_0x4012('0x19')]?{'message':_0x4012('0x7e'),'statusCode':_0x3aa615[_0x4012('0x7b')]}:_0x3aa615);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index fdba029..be90d6d 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 _0xba6b=['../../config/logger','api','moment','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','util'];(function(_0x3510ed,_0x572f66){var _0xf50cd3=function(_0xde287d){while(--_0xde287d){_0x3510ed['push'](_0x3510ed['shift']());}};_0xf50cd3(++_0x572f66);}(_0xba6b,0x199));var _0xbba6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xba6b[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xbba6('0x0'));var logger=require(_0xbba6('0x1'))(_0xbba6('0x2'));var moment=require(_0xbba6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbba6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbba6('0x5'));var integrations=require(_0xbba6('0x6'));module[_0xbba6('0x7')]=function(_0x159b79,_0x127bc2){return _0x159b79['define'](_0xbba6('0x8'),attributes,{'tableName':_0xbba6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc73=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xcc73,0x1ce));var _0x3cc7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcc73[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x3cc7('0x0'));var util=require(_0x3cc7('0x1'));var logger=require(_0x3cc7('0x2'))(_0x3cc7('0x3'));var moment=require('moment');var BPromise=require(_0x3cc7('0x4'));var rp=require(_0x3cc7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cc7('0x6'));var config=require(_0x3cc7('0x7'));var attributes=require(_0x3cc7('0x8'));var integrations=require(_0x3cc7('0x9'));module['exports']=function(_0x4e7d2e,_0x4a18df){return _0x4e7d2e[_0x3cc7('0xa')](_0x3cc7('0xb'),attributes,{'tableName':_0x3cc7('0xc'),'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 80242e2..e38dec7 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 _0x94dd=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','findAll','options','where','attributes','include','map','model','GetVtigerAccount','ShowVtigerAccount','find','raw'];(function(_0x5d4efd,_0xfe1a95){var _0x62a9c3=function(_0x19ca82){while(--_0x19ca82){_0x5d4efd['push'](_0x5d4efd['shift']());}};_0x62a9c3(++_0xfe1a95);}(_0x94dd,0xe8));var _0xd94d=function(_0x44981f,_0x24433e){_0x44981f=_0x44981f-0x0;var _0x2b6aa8=_0x94dd[_0x44981f];return _0x2b6aa8;};'use strict';var _=require('lodash');var util=require(_0xd94d('0x0'));var moment=require('moment');var BPromise=require(_0xd94d('0x1'));var rs=require(_0xd94d('0x2'));var fs=require('fs');var Redis=require(_0xd94d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd94d('0x4'));var logger=require(_0xd94d('0x5'))(_0xd94d('0x6'));var config=require('../../config/environment');var jayson=require(_0xd94d('0x7'));var client=jayson[_0xd94d('0x8')][_0xd94d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ac52b,_0x313b07,_0xd376d5){return new BPromise(function(_0x1148b4,_0x10a2f){return client[_0xd94d('0xa')](_0x3ac52b,_0xd376d5)[_0xd94d('0xb')](function(_0x56fd98){logger[_0xd94d('0xc')](_0xd94d('0xd'),_0x313b07,'request\x20sent');logger[_0xd94d('0xe')](_0xd94d('0xf'),_0x313b07,_0xd94d('0x10'),JSON[_0xd94d('0x11')](_0x56fd98));if(_0x56fd98[_0xd94d('0x12')]){if(_0x56fd98['error']['code']===0x1f4){logger[_0xd94d('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x313b07,_0x56fd98[_0xd94d('0x12')]['message']);return _0x10a2f(_0x56fd98['error'][_0xd94d('0x13')]);}logger[_0xd94d('0x12')](_0xd94d('0xd'),_0x313b07,_0x56fd98[_0xd94d('0x12')][_0xd94d('0x13')]);return _0x1148b4(_0x56fd98[_0xd94d('0x12')][_0xd94d('0x13')]);}else{logger['info'](_0xd94d('0xd'),_0x313b07,'request\x20sent');_0x1148b4(_0x56fd98[_0xd94d('0x14')]['message']);}})['catch'](function(_0x57cf8d){logger[_0xd94d('0x12')](_0xd94d('0xd'),_0x313b07,_0x57cf8d);_0x10a2f(_0x57cf8d);});});}exports['GetVtigerAccount']=function(_0x436813){var _0x3feaf3=this;return new Promise(function(_0x5c9a70,_0x182f92){return db['VtigerAccount'][_0xd94d('0x15')]({'raw':_0x436813[_0xd94d('0x16')]?_0x436813[_0xd94d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x436813['options']?_0x436813['options'][_0xd94d('0x17')]||null:null,'attributes':_0x436813['options']?_0x436813[_0xd94d('0x16')][_0xd94d('0x18')]||null:null,'limit':_0x436813[_0xd94d('0x16')]?_0x436813[_0xd94d('0x16')]['limit']||null:null,'include':_0x436813[_0xd94d('0x16')]?_0x436813[_0xd94d('0x16')][_0xd94d('0x19')]?_[_0xd94d('0x1a')](_0x436813[_0xd94d('0x16')][_0xd94d('0x19')],function(_0x305a07){return{'model':db[_0x305a07['model']],'as':_0x305a07['as'],'attributes':_0x305a07['attributes'],'include':_0x305a07[_0xd94d('0x19')]?_['map'](_0x305a07['include'],function(_0x45a1d4){return{'model':db[_0x45a1d4[_0xd94d('0x1b')]],'as':_0x45a1d4['as'],'attributes':_0x45a1d4[_0xd94d('0x18')],'include':_0x45a1d4[_0xd94d('0x19')]?_[_0xd94d('0x1a')](_0x45a1d4['include'],function(_0x5971d4){return{'model':db[_0x5971d4[_0xd94d('0x1b')]],'as':_0x5971d4['as'],'attributes':_0x5971d4[_0xd94d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd94d('0xb')](function(_0x277bf6){logger['info'](_0xd94d('0x1c'),_0x436813);logger[_0xd94d('0xe')]('GetVtigerAccount',_0x436813,JSON[_0xd94d('0x11')](_0x277bf6));_0x5c9a70(_0x277bf6);})['catch'](function(_0x34a19f){logger[_0xd94d('0x12')](_0xd94d('0x1c'),_0x34a19f[_0xd94d('0x13')],_0x436813);_0x182f92(_0x3feaf3[_0xd94d('0x12')](0x1f4,_0x34a19f[_0xd94d('0x13')]));});});};exports[_0xd94d('0x1d')]=function(_0x2505e6){var _0x45daaa=this;return new Promise(function(_0x4d72f9,_0x7f0bbe){return db['VtigerAccount'][_0xd94d('0x1e')]({'raw':_0x2505e6[_0xd94d('0x16')]?_0x2505e6[_0xd94d('0x16')][_0xd94d('0x1f')]===undefined?!![]:![]:!![],'where':_0x2505e6[_0xd94d('0x16')]?_0x2505e6[_0xd94d('0x16')]['where']||null:null,'attributes':_0x2505e6[_0xd94d('0x16')]?_0x2505e6[_0xd94d('0x16')][_0xd94d('0x18')]||null:null,'include':_0x2505e6['options']?_0x2505e6['options']['include']?_[_0xd94d('0x1a')](_0x2505e6[_0xd94d('0x16')][_0xd94d('0x19')],function(_0xecaf60){return{'model':db[_0xecaf60[_0xd94d('0x1b')]],'as':_0xecaf60['as'],'attributes':_0xecaf60[_0xd94d('0x18')],'include':_0xecaf60[_0xd94d('0x19')]?_[_0xd94d('0x1a')](_0xecaf60[_0xd94d('0x19')],function(_0x5e2007){return{'model':db[_0x5e2007[_0xd94d('0x1b')]],'as':_0x5e2007['as'],'attributes':_0x5e2007['attributes'],'include':_0x5e2007[_0xd94d('0x19')]?_[_0xd94d('0x1a')](_0x5e2007[_0xd94d('0x19')],function(_0x43f16c){return{'model':db[_0x43f16c[_0xd94d('0x1b')]],'as':_0x43f16c['as'],'attributes':_0x43f16c[_0xd94d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd94d('0xb')](function(_0x1e697a){logger[_0xd94d('0xc')]('ShowVtigerAccount',_0x2505e6);logger[_0xd94d('0xe')](_0xd94d('0x1d'),_0x2505e6,JSON[_0xd94d('0x11')](_0x1e697a));_0x4d72f9(_0x1e697a);})[_0xd94d('0x20')](function(_0x27ee5f){logger['error'](_0xd94d('0x1d'),_0x27ee5f['message'],_0x2505e6);_0x7f0bbe(_0x45daaa[_0xd94d('0x12')](0x1f4,_0x27ee5f[_0xd94d('0x13')]));});});}; \ No newline at end of file +var _0x52fc=['options','raw','where','map','include','attributes','stringify','find','model','ShowVtigerAccount','debug','randomstring','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetVtigerAccount','VtigerAccount','findAll'];(function(_0x247570,_0x30c60f){var _0x4f74c9=function(_0x2e62bf){while(--_0x2e62bf){_0x247570['push'](_0x247570['shift']());}};_0x4f74c9(++_0x30c60f);}(_0x52fc,0x119));var _0xc52f=function(_0x519737,_0x15bd88){_0x519737=_0x519737-0x0;var _0x536f9f=_0x52fc[_0x519737];return _0x536f9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc52f('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc52f('0x1'));var config=require('../../config/environment');var jayson=require(_0xc52f('0x2'));var client=jayson[_0xc52f('0x3')][_0xc52f('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x187010,_0xa160dd,_0x39a969){return new BPromise(function(_0x4b4dc9,_0x5a6d56){return client['request'](_0x187010,_0x39a969)[_0xc52f('0x5')](function(_0x58ee8d){logger[_0xc52f('0x6')](_0xc52f('0x7'),_0xa160dd,_0xc52f('0x8'));logger['debug'](_0xc52f('0x9'),_0xa160dd,_0xc52f('0x8'),JSON['stringify'](_0x58ee8d));if(_0x58ee8d[_0xc52f('0xa')]){if(_0x58ee8d[_0xc52f('0xa')]['code']===0x1f4){logger[_0xc52f('0xa')](_0xc52f('0x7'),_0xa160dd,_0x58ee8d[_0xc52f('0xa')][_0xc52f('0xb')]);return _0x5a6d56(_0x58ee8d[_0xc52f('0xa')]['message']);}logger[_0xc52f('0xa')](_0xc52f('0x7'),_0xa160dd,_0x58ee8d[_0xc52f('0xa')]['message']);return _0x4b4dc9(_0x58ee8d[_0xc52f('0xa')][_0xc52f('0xb')]);}else{logger[_0xc52f('0x6')](_0xc52f('0x7'),_0xa160dd,_0xc52f('0x8'));_0x4b4dc9(_0x58ee8d['result']['message']);}})[_0xc52f('0xc')](function(_0x38d30a){logger['error'](_0xc52f('0x7'),_0xa160dd,_0x38d30a);_0x5a6d56(_0x38d30a);});});}exports[_0xc52f('0xd')]=function(_0xc3d9){var _0x576dad=this;return new Promise(function(_0x1fb8ac,_0x4e3052){return db[_0xc52f('0xe')][_0xc52f('0xf')]({'raw':_0xc3d9[_0xc52f('0x10')]?_0xc3d9[_0xc52f('0x10')][_0xc52f('0x11')]===undefined?!![]:![]:!![],'where':_0xc3d9['options']?_0xc3d9['options'][_0xc52f('0x12')]||null:null,'attributes':_0xc3d9['options']?_0xc3d9[_0xc52f('0x10')]['attributes']||null:null,'limit':_0xc3d9['options']?_0xc3d9[_0xc52f('0x10')]['limit']||null:null,'include':_0xc3d9[_0xc52f('0x10')]?_0xc3d9[_0xc52f('0x10')]['include']?_[_0xc52f('0x13')](_0xc3d9[_0xc52f('0x10')][_0xc52f('0x14')],function(_0x6726fc){return{'model':db[_0x6726fc['model']],'as':_0x6726fc['as'],'attributes':_0x6726fc['attributes'],'include':_0x6726fc['include']?_[_0xc52f('0x13')](_0x6726fc[_0xc52f('0x14')],function(_0x485d08){return{'model':db[_0x485d08['model']],'as':_0x485d08['as'],'attributes':_0x485d08[_0xc52f('0x15')],'include':_0x485d08[_0xc52f('0x14')]?_[_0xc52f('0x13')](_0x485d08[_0xc52f('0x14')],function(_0x54a26f){return{'model':db[_0x54a26f['model']],'as':_0x54a26f['as'],'attributes':_0x54a26f['attributes']};}):[]};}):[]};}):[]:[]})[_0xc52f('0x5')](function(_0x3db18b){logger[_0xc52f('0x6')]('GetVtigerAccount',_0xc3d9);logger['debug']('GetVtigerAccount',_0xc3d9,JSON[_0xc52f('0x16')](_0x3db18b));_0x1fb8ac(_0x3db18b);})[_0xc52f('0xc')](function(_0x4c395f){logger[_0xc52f('0xa')](_0xc52f('0xd'),_0x4c395f[_0xc52f('0xb')],_0xc3d9);_0x4e3052(_0x576dad[_0xc52f('0xa')](0x1f4,_0x4c395f[_0xc52f('0xb')]));});});};exports['ShowVtigerAccount']=function(_0xf8d02c){var _0x2a0c6d=this;return new Promise(function(_0x2a2743,_0x1434af){return db[_0xc52f('0xe')][_0xc52f('0x17')]({'raw':_0xf8d02c[_0xc52f('0x10')]?_0xf8d02c[_0xc52f('0x10')][_0xc52f('0x11')]===undefined?!![]:![]:!![],'where':_0xf8d02c[_0xc52f('0x10')]?_0xf8d02c[_0xc52f('0x10')][_0xc52f('0x12')]||null:null,'attributes':_0xf8d02c['options']?_0xf8d02c[_0xc52f('0x10')][_0xc52f('0x15')]||null:null,'include':_0xf8d02c['options']?_0xf8d02c[_0xc52f('0x10')][_0xc52f('0x14')]?_[_0xc52f('0x13')](_0xf8d02c['options'][_0xc52f('0x14')],function(_0x58cef9){return{'model':db[_0x58cef9[_0xc52f('0x18')]],'as':_0x58cef9['as'],'attributes':_0x58cef9[_0xc52f('0x15')],'include':_0x58cef9['include']?_['map'](_0x58cef9[_0xc52f('0x14')],function(_0x5787a7){return{'model':db[_0x5787a7['model']],'as':_0x5787a7['as'],'attributes':_0x5787a7[_0xc52f('0x15')],'include':_0x5787a7[_0xc52f('0x14')]?_[_0xc52f('0x13')](_0x5787a7[_0xc52f('0x14')],function(_0x10321d){return{'model':db[_0x10321d['model']],'as':_0x10321d['as'],'attributes':_0x10321d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ec6dc){logger['info'](_0xc52f('0x19'),_0xf8d02c);logger[_0xc52f('0x1a')](_0xc52f('0x19'),_0xf8d02c,JSON[_0xc52f('0x16')](_0x4ec6dc));_0x2a2743(_0x4ec6dc);})[_0xc52f('0xc')](function(_0x4b10fb){logger['error'](_0xc52f('0x19'),_0x4b10fb[_0xc52f('0xb')],_0xf8d02c);_0x1434af(_0x2a0c6d[_0xc52f('0xa')](0x1f4,_0x4b10fb['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index bf35328..fe125f9 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 _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3c56aa,_0x27f7c8){var _0x221a0e=function(_0x3c9f8c){while(--_0x3c9f8c){_0x3c56aa['push'](_0x3c56aa['shift']());}};_0x221a0e(++_0x27f7c8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2bb452,_0x2dbbc0){_0x2bb452=_0x2bb452-0x0;var _0x5f50a6=_0xb10b[_0x2bb452];return _0x5f50a6;};'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('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 727bc5a..a99e6e8 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 _0xce53=['STRING','sequelize','exports'];(function(_0x37563b,_0x568e14){var _0x5b49d1=function(_0x45c0af){while(--_0x45c0af){_0x37563b['push'](_0x37563b['shift']());}};_0x5b49d1(++_0x568e14);}(_0xce53,0x172));var _0x3ce5=function(_0x4ba432,_0x3b5cb5){_0x4ba432=_0x4ba432-0x0;var _0x559330=_0xce53[_0x4ba432];return _0x559330;};'use strict';var Sequelize=require(_0x3ce5('0x0'));module[_0x3ce5('0x1')]={'name':{'type':Sequelize[_0x3ce5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2f88=['STRING','exports'];(function(_0x46c2c3,_0x1f6380){var _0x307b04=function(_0x59daa1){while(--_0x59daa1){_0x46c2c3['push'](_0x46c2c3['shift']());}};_0x307b04(++_0x1f6380);}(_0x2f88,0x18d));var _0x82f8=function(_0x48f7bf,_0x5be612){_0x48f7bf=_0x48f7bf-0x0;var _0x5b6a0c=_0x2f88[_0x48f7bf];return _0x5b6a0c;};'use strict';var Sequelize=require('sequelize');module[_0x82f8('0x0')]={'name':{'type':Sequelize[_0x82f8('0x1')]},'description':{'type':Sequelize[_0x82f8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a5b3a52..caf7f7b 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 _0x1590=['keys','rawAttributes','include','create','body','find','getFields','findOne','VtigerField','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','VtigerConfiguration','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','findAll','catch','show','params'];(function(_0x4c6fc0,_0x30925a){var _0x5d1ebc=function(_0x5f21d5){while(--_0x5f21d5){_0x4c6fc0['push'](_0x4c6fc0['shift']());}};_0x5d1ebc(++_0x30925a);}(_0x1590,0x183));var _0x0159=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1590[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0159('0x0'));var jsonpatch=require(_0x0159('0x1'));var rp=require(_0x0159('0x2'));var moment=require(_0x0159('0x3'));var BPromise=require(_0x0159('0x4'));var Mustache=require(_0x0159('0x5'));var util=require(_0x0159('0x6'));var path=require(_0x0159('0x7'));var sox=require(_0x0159('0x8'));var csv=require(_0x0159('0x9'));var ejs=require(_0x0159('0xa'));var fs=require('fs');var _=require(_0x0159('0xb'));var squel=require(_0x0159('0xc'));var crypto=require('crypto');var jsforce=require(_0x0159('0xd'));var deskjs=require(_0x0159('0xe'));var toCsv=require(_0x0159('0x9'));var querystring=require(_0x0159('0xf'));var Papa=require(_0x0159('0x10'));var Redis=require(_0x0159('0x11'));var authService=require(_0x0159('0x12'));var qs=require(_0x0159('0x13'));var as=require(_0x0159('0x14'));var hardwareService=require(_0x0159('0x15'));var logger=require(_0x0159('0x16'))(_0x0159('0x17'));var utils=require(_0x0159('0x18'));var config=require(_0x0159('0x19'));var db=require(_0x0159('0x1a'))['db'];var jayson=require(_0x0159('0x1b'));var client=jayson['client'][_0x0159('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1a9228,_0x5f1916,_0x1def67){if(_0x1def67){var _0x1566e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1566e4['test'](_0x5f1916)){return _0x1a9228;}else{throw new db['Sequelize'][(_0x0159('0x1d'))](_0x0159('0x1e'));}}else{return _0x1a9228;}}function respondWithRpcPromise(_0x2ab290,_0x1f6d80,_0x204deb,_0x11ac22){return new BPromise(function(_0x349df6,_0xf77c74){var _0x24536f=_0x11ac22||client;return _0x24536f[_0x0159('0x1f')](_0x2ab290,_0x204deb)['then'](function(_0x2dc129){logger[_0x0159('0x20')](_0x0159('0x21'),_0x1f6d80,_0x0159('0x22'));logger['debug'](_0x0159('0x23'),_0x1f6d80,'request\x20sent',JSON[_0x0159('0x24')](_0x2dc129));if(_0x2dc129['error']){if(_0x2dc129[_0x0159('0x25')][_0x0159('0x26')]===0x1f4){logger[_0x0159('0x25')](_0x0159('0x21'),_0x1f6d80,_0x2dc129[_0x0159('0x25')]['message']);return _0xf77c74(_0x2dc129[_0x0159('0x25')][_0x0159('0x27')]);}logger[_0x0159('0x25')](_0x0159('0x21'),_0x1f6d80,_0x2dc129[_0x0159('0x25')][_0x0159('0x27')]);return _0x349df6(_0x2dc129[_0x0159('0x25')]['message']);}else{logger[_0x0159('0x20')](_0x0159('0x21'),_0x1f6d80,_0x0159('0x22'));_0x349df6(_0x2dc129['result'][_0x0159('0x27')]);}})['catch'](function(_0x377a8b){logger[_0x0159('0x25')](_0x0159('0x21'),_0x1f6d80,_0x377a8b);_0xf77c74(_0x377a8b);});});}function respondWithStatusCode(_0x32f8c2,_0x56788e){_0x56788e=_0x56788e||0xcc;return function(_0x158bca){if(_0x158bca){return _0x32f8c2[_0x0159('0x28')](_0x56788e);}return _0x32f8c2[_0x0159('0x29')](_0x56788e)[_0x0159('0x2a')]();};}function respondWithResult(_0x55f662,_0xb599aa){_0xb599aa=_0xb599aa||0xc8;return function(_0x4c49eb){if(_0x4c49eb){return _0x55f662['status'](_0xb599aa)[_0x0159('0x2b')](_0x4c49eb);}};}function respondWithFilteredResult(_0xc9b338,_0x8bfd2c){return function(_0x53c7a5){if(_0x53c7a5){var _0x1f0dc5=_0x53c7a5['count'],_0x1ff767=_0x8bfd2c[_0x0159('0x2c')],_0x1e81f8=_0x8bfd2c[_0x0159('0x2c')]+_0x8bfd2c[_0x0159('0x2d')],_0xb6d49f;if(_0x1e81f8>=_0x1f0dc5){_0x1e81f8=_0x1f0dc5;_0xb6d49f=0xc8;}else{_0xb6d49f=0xce;}_0xc9b338['status'](_0xb6d49f);return _0xc9b338[_0x0159('0x2e')]('Content-Range',_0x1ff767+'-'+_0x1e81f8+'/'+_0x1f0dc5)[_0x0159('0x2b')](_0x53c7a5);}return null;};}function patchUpdates(_0x4c9751){return function(_0x1d6766){try{jsonpatch[_0x0159('0x2f')](_0x1d6766,_0x4c9751,!![]);}catch(_0x174f32){return BPromise[_0x0159('0x30')](_0x174f32);}return _0x1d6766[_0x0159('0x31')]();};}function saveUpdates(_0x2cc648,_0x1d85c6){return function(_0x4843f0){if(_0x4843f0){return _0x4843f0[_0x0159('0x32')](_0x2cc648)[_0x0159('0x33')](function(_0x456b74){return _0x456b74;});}return null;};}function removeEntity(_0x1d7d07,_0x3eae3a){return function(_0x59e413){if(_0x59e413){return _0x59e413[_0x0159('0x34')]()[_0x0159('0x33')](function(){_0x1d7d07['status'](0xcc)[_0x0159('0x2a')]();});}};}function handleEntityNotFound(_0x375328,_0x21c6ad){return function(_0x8f3ba8){if(!_0x8f3ba8){_0x375328[_0x0159('0x28')](0x194);}return _0x8f3ba8;};}function handleError(_0x2a8288,_0x23d1bb){_0x23d1bb=_0x23d1bb||0x1f4;return function(_0x5e4d81){logger[_0x0159('0x25')](_0x5e4d81[_0x0159('0x35')]);if(_0x5e4d81['name']){delete _0x5e4d81[_0x0159('0x36')];}_0x2a8288[_0x0159('0x29')](_0x23d1bb)[_0x0159('0x37')](_0x5e4d81);};}exports['index']=function(_0x24a348,_0x1940d0){var _0x307961={},_0xa15603={},_0x3a3061={'count':0x0,'rows':[]};var _0xc5d0c5=_['map'](db[_0x0159('0x38')]['rawAttributes'],function(_0x40c1f1){return{'name':_0x40c1f1['fieldName'],'type':_0x40c1f1[_0x0159('0x39')][_0x0159('0x3a')]};});_0xa15603['model']=_[_0x0159('0x3b')](_0xc5d0c5,'name');_0xa15603[_0x0159('0x3c')]=_['keys'](_0x24a348[_0x0159('0x3c')]);_0xa15603['filters']=_[_0x0159('0x3d')](_0xa15603[_0x0159('0x3e')],_0xa15603['query']);_0x307961[_0x0159('0x3f')]=_[_0x0159('0x3d')](_0xa15603[_0x0159('0x3e')],qs[_0x0159('0x40')](_0x24a348['query']['fields']));_0x307961['attributes']=_0x307961['attributes'][_0x0159('0x41')]?_0x307961[_0x0159('0x3f')]:_0xa15603['model'];if(!_0x24a348[_0x0159('0x3c')][_0x0159('0x42')](_0x0159('0x43'))){_0x307961[_0x0159('0x2d')]=qs[_0x0159('0x2d')](_0x24a348['query'][_0x0159('0x2d')]);_0x307961[_0x0159('0x2c')]=qs[_0x0159('0x2c')](_0x24a348['query'][_0x0159('0x2c')]);}_0x307961[_0x0159('0x44')]=qs[_0x0159('0x45')](_0x24a348['query'][_0x0159('0x45')]);_0x307961[_0x0159('0x46')]=qs['filters'](_[_0x0159('0x47')](_0x24a348[_0x0159('0x3c')],_0xa15603[_0x0159('0x48')]));if(_0x24a348[_0x0159('0x3c')][_0x0159('0x49')]){_0x307961['where']=_[_0x0159('0x4a')](_0x307961[_0x0159('0x46')],{'$or':_[_0x0159('0x3b')](_0xc5d0c5,function(_0x5032de){if(_0x5032de['type']!==_0x0159('0x4b')){var _0x3c7cbd={};_0x3c7cbd[_0x5032de[_0x0159('0x36')]]={'$like':'%'+_0x24a348[_0x0159('0x3c')]['filter']+'%'};return _0x3c7cbd;}})});}_0x307961=_[_0x0159('0x4a')]({},_0x307961,_0x24a348[_0x0159('0x4c')]);var _0x37227d={'where':_0x307961[_0x0159('0x46')]};return db[_0x0159('0x38')][_0x0159('0x4d')](_0x37227d)['then'](function(_0x740643){_0x3a3061[_0x0159('0x4d')]=_0x740643;if(_0x24a348['query'][_0x0159('0x4e')]){_0x307961['include']=[{'all':!![]}];}return db[_0x0159('0x38')][_0x0159('0x4f')](_0x307961);})[_0x0159('0x33')](function(_0x2d59a3){_0x3a3061['rows']=_0x2d59a3;return _0x3a3061;})[_0x0159('0x33')](respondWithFilteredResult(_0x1940d0,_0x307961))[_0x0159('0x50')](handleError(_0x1940d0,null));};exports[_0x0159('0x51')]=function(_0xb8f28f,_0x571d4d){var _0x59edeb={'raw':![],'where':{'id':_0xb8f28f[_0x0159('0x52')]['id']}},_0x26bac5={};_0x26bac5['model']=_[_0x0159('0x53')](db[_0x0159('0x38')][_0x0159('0x54')]);_0x26bac5[_0x0159('0x3c')]=_['keys'](_0xb8f28f[_0x0159('0x3c')]);_0x26bac5[_0x0159('0x48')]=_[_0x0159('0x3d')](_0x26bac5[_0x0159('0x3e')],_0x26bac5[_0x0159('0x3c')]);_0x59edeb['attributes']=_['intersection'](_0x26bac5[_0x0159('0x3e')],qs[_0x0159('0x40')](_0xb8f28f['query']['fields']));_0x59edeb[_0x0159('0x3f')]=_0x59edeb[_0x0159('0x3f')]['length']?_0x59edeb[_0x0159('0x3f')]:_0x26bac5[_0x0159('0x3e')];if(_0xb8f28f[_0x0159('0x3c')]['includeAll']){_0x59edeb[_0x0159('0x55')]=[{'all':!![]}];}_0x59edeb=_[_0x0159('0x4a')]({},_0x59edeb,_0xb8f28f['options']);return db['VtigerConfiguration']['find'](_0x59edeb)['then'](handleEntityNotFound(_0x571d4d,null))['then'](respondWithResult(_0x571d4d,null))[_0x0159('0x50')](handleError(_0x571d4d,null));};exports[_0x0159('0x56')]=function(_0x5f2f6b,_0x4b954d){return db['VtigerConfiguration'][_0x0159('0x56')](_0x5f2f6b[_0x0159('0x57')],{})[_0x0159('0x33')](respondWithResult(_0x4b954d,0xc9))['catch'](handleError(_0x4b954d,null));};exports[_0x0159('0x32')]=function(_0x4e1fa8,_0x137604){if(_0x4e1fa8[_0x0159('0x57')]['id']){delete _0x4e1fa8['body']['id'];}return db[_0x0159('0x38')][_0x0159('0x58')]({'where':{'id':_0x4e1fa8[_0x0159('0x52')]['id']}})[_0x0159('0x33')](handleEntityNotFound(_0x137604,null))[_0x0159('0x33')](saveUpdates(_0x4e1fa8[_0x0159('0x57')],null))[_0x0159('0x33')](respondWithResult(_0x137604,null))[_0x0159('0x50')](handleError(_0x137604,null));};exports[_0x0159('0x34')]=function(_0x3717e5,_0x5772a7){return db[_0x0159('0x38')]['find']({'where':{'id':_0x3717e5[_0x0159('0x52')]['id']}})[_0x0159('0x33')](handleEntityNotFound(_0x5772a7,null))[_0x0159('0x33')](removeEntity(_0x5772a7,null))[_0x0159('0x50')](handleError(_0x5772a7,null));};exports[_0x0159('0x59')]=function(_0x5ec90f,_0x2029e9,_0x1d8ecf){var _0x57f00c={};var _0x2bc1d2={};var _0x50c12e;var _0xfc315d;return db[_0x0159('0x38')][_0x0159('0x5a')]({'where':{'id':_0x5ec90f[_0x0159('0x52')]['id']}})[_0x0159('0x33')](handleEntityNotFound(_0x2029e9,null))[_0x0159('0x33')](function(_0x36c153){if(_0x36c153){_0x50c12e=_0x36c153;_0x2bc1d2[_0x0159('0x3e')]=_[_0x0159('0x53')](db[_0x0159('0x5b')][_0x0159('0x54')]);_0x2bc1d2[_0x0159('0x3c')]=_[_0x0159('0x53')](_0x5ec90f[_0x0159('0x3c')]);_0x2bc1d2[_0x0159('0x48')]=_[_0x0159('0x3d')](_0x2bc1d2[_0x0159('0x3e')],_0x2bc1d2[_0x0159('0x3c')]);_0x57f00c[_0x0159('0x3f')]=_[_0x0159('0x3d')](_0x2bc1d2[_0x0159('0x3e')],qs['fields'](_0x5ec90f['query']['fields']));_0x57f00c[_0x0159('0x3f')]=_0x57f00c[_0x0159('0x3f')][_0x0159('0x41')]?_0x57f00c[_0x0159('0x3f')]:_0x2bc1d2['model'];_0x57f00c[_0x0159('0x44')]=qs[_0x0159('0x45')](_0x5ec90f[_0x0159('0x3c')][_0x0159('0x45')]);_0x57f00c['where']=qs[_0x0159('0x48')](_[_0x0159('0x47')](_0x5ec90f[_0x0159('0x3c')],_0x2bc1d2[_0x0159('0x48')]));if(_0x5ec90f[_0x0159('0x3c')][_0x0159('0x49')]){_0x57f00c[_0x0159('0x46')]=_[_0x0159('0x4a')](_0x57f00c['where'],{'$or':_[_0x0159('0x3b')](_0x57f00c['attributes'],function(_0x4e771b){var _0x22ef66={};_0x22ef66[_0x4e771b]={'$like':'%'+_0x5ec90f[_0x0159('0x3c')][_0x0159('0x49')]+'%'};return _0x22ef66;})});}_0x57f00c=_[_0x0159('0x4a')]({},_0x57f00c,_0x5ec90f[_0x0159('0x4c')]);return _0x50c12e[_0x0159('0x59')](_0x57f00c);}})[_0x0159('0x33')](function(_0x5919ea){if(_0x5919ea){_0xfc315d=_0x5919ea['length'];if(!_0x5ec90f[_0x0159('0x3c')][_0x0159('0x42')]('nolimit')){_0x57f00c[_0x0159('0x2d')]=qs['limit'](_0x5ec90f[_0x0159('0x3c')][_0x0159('0x2d')]);_0x57f00c[_0x0159('0x2c')]=qs[_0x0159('0x2c')](_0x5ec90f[_0x0159('0x3c')]['offset']);}return _0x50c12e[_0x0159('0x59')](_0x57f00c);}})[_0x0159('0x33')](function(_0x46616b){if(_0x46616b){return _0x46616b?{'count':_0xfc315d,'rows':_0x46616b}:null;}})[_0x0159('0x33')](respondWithResult(_0x2029e9,null))[_0x0159('0x50')](handleError(_0x2029e9,null));};exports[_0x0159('0x5c')]=function(_0x34fab0,_0x1cb1ac,_0x3b067e){var _0x5f1f17={};var _0x20572d={};var _0xecd9b9;var _0x18e81a;return db[_0x0159('0x38')][_0x0159('0x5a')]({'where':{'id':_0x34fab0[_0x0159('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cb1ac,null))[_0x0159('0x33')](function(_0x4bfa40){if(_0x4bfa40){_0xecd9b9=_0x4bfa40;_0x20572d[_0x0159('0x3e')]=_[_0x0159('0x53')](db[_0x0159('0x5b')][_0x0159('0x54')]);_0x20572d[_0x0159('0x3c')]=_[_0x0159('0x53')](_0x34fab0[_0x0159('0x3c')]);_0x20572d['filters']=_[_0x0159('0x3d')](_0x20572d['model'],_0x20572d[_0x0159('0x3c')]);_0x5f1f17[_0x0159('0x3f')]=_[_0x0159('0x3d')](_0x20572d[_0x0159('0x3e')],qs['fields'](_0x34fab0[_0x0159('0x3c')][_0x0159('0x40')]));_0x5f1f17[_0x0159('0x3f')]=_0x5f1f17['attributes'][_0x0159('0x41')]?_0x5f1f17['attributes']:_0x20572d['model'];_0x5f1f17[_0x0159('0x44')]=qs[_0x0159('0x45')](_0x34fab0[_0x0159('0x3c')][_0x0159('0x45')]);_0x5f1f17[_0x0159('0x46')]=qs[_0x0159('0x48')](_[_0x0159('0x47')](_0x34fab0[_0x0159('0x3c')],_0x20572d[_0x0159('0x48')]));if(_0x34fab0[_0x0159('0x3c')][_0x0159('0x49')]){_0x5f1f17[_0x0159('0x46')]=_[_0x0159('0x4a')](_0x5f1f17[_0x0159('0x46')],{'$or':_['map'](_0x5f1f17['attributes'],function(_0x9305e6){var _0x123f8d={};_0x123f8d[_0x9305e6]={'$like':'%'+_0x34fab0['query']['filter']+'%'};return _0x123f8d;})});}_0x5f1f17=_['merge']({},_0x5f1f17,_0x34fab0[_0x0159('0x4c')]);return _0xecd9b9[_0x0159('0x5c')](_0x5f1f17);}})[_0x0159('0x33')](function(_0x3b1a17){if(_0x3b1a17){_0x18e81a=_0x3b1a17[_0x0159('0x41')];if(!_0x34fab0[_0x0159('0x3c')][_0x0159('0x42')]('nolimit')){_0x5f1f17[_0x0159('0x2d')]=qs[_0x0159('0x2d')](_0x34fab0[_0x0159('0x3c')][_0x0159('0x2d')]);_0x5f1f17[_0x0159('0x2c')]=qs['offset'](_0x34fab0[_0x0159('0x3c')][_0x0159('0x2c')]);}return _0xecd9b9[_0x0159('0x5c')](_0x5f1f17);}})[_0x0159('0x33')](function(_0x373056){if(_0x373056){return _0x373056?{'count':_0x18e81a,'rows':_0x373056}:null;}})[_0x0159('0x33')](respondWithResult(_0x1cb1ac,null))['catch'](handleError(_0x1cb1ac,null));};exports[_0x0159('0x5d')]=function(_0x59115c,_0x2cd345,_0xb326b1){var _0x5404d5={};var _0x191eb8={};var _0xbe6ec9;var _0x42db44;return db[_0x0159('0x38')][_0x0159('0x5a')]({'where':{'id':_0x59115c[_0x0159('0x52')]['id']}})[_0x0159('0x33')](handleEntityNotFound(_0x2cd345,null))[_0x0159('0x33')](function(_0xb3a453){if(_0xb3a453){_0xbe6ec9=_0xb3a453;_0x191eb8['model']=_[_0x0159('0x53')](db[_0x0159('0x5b')][_0x0159('0x54')]);_0x191eb8[_0x0159('0x3c')]=_[_0x0159('0x53')](_0x59115c['query']);_0x191eb8['filters']=_[_0x0159('0x3d')](_0x191eb8[_0x0159('0x3e')],_0x191eb8[_0x0159('0x3c')]);_0x5404d5['attributes']=_[_0x0159('0x3d')](_0x191eb8[_0x0159('0x3e')],qs[_0x0159('0x40')](_0x59115c[_0x0159('0x3c')][_0x0159('0x40')]));_0x5404d5[_0x0159('0x3f')]=_0x5404d5['attributes'][_0x0159('0x41')]?_0x5404d5[_0x0159('0x3f')]:_0x191eb8[_0x0159('0x3e')];_0x5404d5[_0x0159('0x44')]=qs[_0x0159('0x45')](_0x59115c[_0x0159('0x3c')][_0x0159('0x45')]);_0x5404d5[_0x0159('0x46')]=qs['filters'](_['pick'](_0x59115c[_0x0159('0x3c')],_0x191eb8[_0x0159('0x48')]));if(_0x59115c['query'][_0x0159('0x49')]){_0x5404d5['where']=_[_0x0159('0x4a')](_0x5404d5[_0x0159('0x46')],{'$or':_[_0x0159('0x3b')](_0x5404d5[_0x0159('0x3f')],function(_0x1307e4){var _0x11f432={};_0x11f432[_0x1307e4]={'$like':'%'+_0x59115c[_0x0159('0x3c')][_0x0159('0x49')]+'%'};return _0x11f432;})});}_0x5404d5=_[_0x0159('0x4a')]({},_0x5404d5,_0x59115c[_0x0159('0x4c')]);return _0xbe6ec9[_0x0159('0x5d')](_0x5404d5);}})[_0x0159('0x33')](function(_0x2b54a7){if(_0x2b54a7){_0x42db44=_0x2b54a7['length'];if(!_0x59115c[_0x0159('0x3c')][_0x0159('0x42')](_0x0159('0x43'))){_0x5404d5[_0x0159('0x2d')]=qs[_0x0159('0x2d')](_0x59115c['query'][_0x0159('0x2d')]);_0x5404d5[_0x0159('0x2c')]=qs[_0x0159('0x2c')](_0x59115c[_0x0159('0x3c')][_0x0159('0x2c')]);}return _0xbe6ec9['getDescriptions'](_0x5404d5);}})[_0x0159('0x33')](function(_0x13cdc6){if(_0x13cdc6){return _0x13cdc6?{'count':_0x42db44,'rows':_0x13cdc6}:null;}})['then'](respondWithResult(_0x2cd345,null))[_0x0159('0x50')](handleError(_0x2cd345,null));}; \ No newline at end of file +var _0xfba8=['request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','keys','find','create','body','update','params','findOne','VtigerField','hasOwnProperty','getFields','merge','getSubjects','getDescriptions','html-pdf','eml-format'];(function(_0xa7b31e,_0x23de30){var _0x26e5c8=function(_0x3b516f){while(--_0x3b516f){_0xa7b31e['push'](_0xa7b31e['shift']());}};_0x26e5c8(++_0x23de30);}(_0xfba8,0x118));var _0x8fba=function(_0x29dc57,_0xb52885){_0x29dc57=_0x29dc57-0x0;var _0x5e2019=_0xfba8[_0x29dc57];return _0x5e2019;};'use strict';var pdf=require(_0x8fba('0x0'));var emlformat=require(_0x8fba('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8fba('0x2'));var moment=require(_0x8fba('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8fba('0x4'));var util=require(_0x8fba('0x5'));var path=require('path');var sox=require(_0x8fba('0x6'));var csv=require(_0x8fba('0x7'));var ejs=require(_0x8fba('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8fba('0x9'));var crypto=require(_0x8fba('0xa'));var jsforce=require(_0x8fba('0xb'));var deskjs=require(_0x8fba('0xc'));var toCsv=require(_0x8fba('0x7'));var querystring=require(_0x8fba('0xd'));var Papa=require(_0x8fba('0xe'));var Redis=require(_0x8fba('0xf'));var authService=require(_0x8fba('0x10'));var qs=require(_0x8fba('0x11'));var as=require(_0x8fba('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8fba('0x13'));var utils=require(_0x8fba('0x14'));var config=require(_0x8fba('0x15'));var db=require(_0x8fba('0x16'))['db'];var jayson=require(_0x8fba('0x17'));var client=jayson[_0x8fba('0x18')][_0x8fba('0x19')]({'port':0x232a});function checkPasswordPattern(_0x54a70e,_0x16f7d4,_0x9cc151){if(_0x9cc151){var _0x192a4e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x192a4e[_0x8fba('0x1a')](_0x16f7d4)){return _0x54a70e;}else{throw new db[(_0x8fba('0x1b'))][(_0x8fba('0x1c'))](_0x8fba('0x1d'));}}else{return _0x54a70e;}}function respondWithRpcPromise(_0x129f13,_0x5a4b44,_0x50145f,_0x102f6c){return new BPromise(function(_0x3ae632,_0x3f7bec){var _0xa90ccb=_0x102f6c||client;return _0xa90ccb[_0x8fba('0x1e')](_0x129f13,_0x50145f)[_0x8fba('0x1f')](function(_0x545d21){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5a4b44,_0x8fba('0x20'));logger['debug'](_0x8fba('0x21'),_0x5a4b44,_0x8fba('0x20'),JSON[_0x8fba('0x22')](_0x545d21));if(_0x545d21[_0x8fba('0x23')]){if(_0x545d21[_0x8fba('0x23')][_0x8fba('0x24')]===0x1f4){logger[_0x8fba('0x23')](_0x8fba('0x25'),_0x5a4b44,_0x545d21['error'][_0x8fba('0x26')]);return _0x3f7bec(_0x545d21[_0x8fba('0x23')]['message']);}logger[_0x8fba('0x23')](_0x8fba('0x25'),_0x5a4b44,_0x545d21[_0x8fba('0x23')][_0x8fba('0x26')]);return _0x3ae632(_0x545d21[_0x8fba('0x23')][_0x8fba('0x26')]);}else{logger[_0x8fba('0x27')](_0x8fba('0x25'),_0x5a4b44,'request\x20sent');_0x3ae632(_0x545d21[_0x8fba('0x28')][_0x8fba('0x26')]);}})[_0x8fba('0x29')](function(_0x504185){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x5a4b44,_0x504185);_0x3f7bec(_0x504185);});});}function respondWithStatusCode(_0x431d41,_0x256a86){_0x256a86=_0x256a86||0xcc;return function(_0x28a125){if(_0x28a125){return _0x431d41[_0x8fba('0x2a')](_0x256a86);}return _0x431d41[_0x8fba('0x2b')](_0x256a86)[_0x8fba('0x2c')]();};}function respondWithResult(_0xb3fac9,_0x196bb5){_0x196bb5=_0x196bb5||0xc8;return function(_0x1dcc3c){if(_0x1dcc3c){return _0xb3fac9[_0x8fba('0x2b')](_0x196bb5)[_0x8fba('0x2d')](_0x1dcc3c);}};}function respondWithFilteredResult(_0x4aed9e,_0x4b900e){return function(_0x217126){if(_0x217126){var _0x2f977f=_0x217126[_0x8fba('0x2e')],_0x525e5c=_0x4b900e[_0x8fba('0x2f')],_0x43a4b3=_0x4b900e['offset']+_0x4b900e[_0x8fba('0x30')],_0x2e8b43;if(_0x43a4b3>=_0x2f977f){_0x43a4b3=_0x2f977f;_0x2e8b43=0xc8;}else{_0x2e8b43=0xce;}_0x4aed9e[_0x8fba('0x2b')](_0x2e8b43);return _0x4aed9e[_0x8fba('0x31')]('Content-Range',_0x525e5c+'-'+_0x43a4b3+'/'+_0x2f977f)[_0x8fba('0x2d')](_0x217126);}return null;};}function patchUpdates(_0x597b5f){return function(_0x5e628d){try{jsonpatch[_0x8fba('0x32')](_0x5e628d,_0x597b5f,!![]);}catch(_0x3d9578){return BPromise[_0x8fba('0x33')](_0x3d9578);}return _0x5e628d[_0x8fba('0x34')]();};}function saveUpdates(_0x209d14,_0x1e302c){return function(_0x23344d){if(_0x23344d){return _0x23344d['update'](_0x209d14)['then'](function(_0x571fcf){return _0x571fcf;});}return null;};}function removeEntity(_0x4dfb5f,_0x173447){return function(_0x19194e){if(_0x19194e){return _0x19194e[_0x8fba('0x35')]()[_0x8fba('0x1f')](function(){_0x4dfb5f[_0x8fba('0x2b')](0xcc)[_0x8fba('0x2c')]();});}};}function handleEntityNotFound(_0x507a83,_0x44229d){return function(_0x125ae0){if(!_0x125ae0){_0x507a83[_0x8fba('0x2a')](0x194);}return _0x125ae0;};}function handleError(_0x3cdb05,_0x158c6a){_0x158c6a=_0x158c6a||0x1f4;return function(_0x2e71ba){logger[_0x8fba('0x23')](_0x2e71ba[_0x8fba('0x36')]);if(_0x2e71ba[_0x8fba('0x37')]){delete _0x2e71ba[_0x8fba('0x37')];}_0x3cdb05[_0x8fba('0x2b')](_0x158c6a)[_0x8fba('0x38')](_0x2e71ba);};}exports['index']=function(_0x417637,_0x1bee75){var _0x4d76a7={},_0x283fa0={},_0x12fec0={'count':0x0,'rows':[]};var _0x2ded52=_[_0x8fba('0x39')](db[_0x8fba('0x3a')][_0x8fba('0x3b')],function(_0x15ee39){return{'name':_0x15ee39[_0x8fba('0x3c')],'type':_0x15ee39[_0x8fba('0x3d')]['key']};});_0x283fa0[_0x8fba('0x3e')]=_['map'](_0x2ded52,_0x8fba('0x37'));_0x283fa0[_0x8fba('0x3f')]=_['keys'](_0x417637[_0x8fba('0x3f')]);_0x283fa0[_0x8fba('0x40')]=_[_0x8fba('0x41')](_0x283fa0['model'],_0x283fa0['query']);_0x4d76a7[_0x8fba('0x42')]=_[_0x8fba('0x41')](_0x283fa0[_0x8fba('0x3e')],qs[_0x8fba('0x43')](_0x417637[_0x8fba('0x3f')][_0x8fba('0x43')]));_0x4d76a7[_0x8fba('0x42')]=_0x4d76a7['attributes'][_0x8fba('0x44')]?_0x4d76a7[_0x8fba('0x42')]:_0x283fa0[_0x8fba('0x3e')];if(!_0x417637[_0x8fba('0x3f')]['hasOwnProperty'](_0x8fba('0x45'))){_0x4d76a7[_0x8fba('0x30')]=qs['limit'](_0x417637[_0x8fba('0x3f')][_0x8fba('0x30')]);_0x4d76a7[_0x8fba('0x2f')]=qs['offset'](_0x417637[_0x8fba('0x3f')]['offset']);}_0x4d76a7[_0x8fba('0x46')]=qs[_0x8fba('0x47')](_0x417637[_0x8fba('0x3f')]['sort']);_0x4d76a7[_0x8fba('0x48')]=qs[_0x8fba('0x40')](_[_0x8fba('0x49')](_0x417637['query'],_0x283fa0[_0x8fba('0x40')]));if(_0x417637['query'][_0x8fba('0x4a')]){_0x4d76a7['where']=_['merge'](_0x4d76a7[_0x8fba('0x48')],{'$or':_['map'](_0x2ded52,function(_0x298a69){if(_0x298a69['type']!==_0x8fba('0x4b')){var _0x475e10={};_0x475e10[_0x298a69[_0x8fba('0x37')]]={'$like':'%'+_0x417637[_0x8fba('0x3f')][_0x8fba('0x4a')]+'%'};return _0x475e10;}})});}_0x4d76a7=_['merge']({},_0x4d76a7,_0x417637[_0x8fba('0x4c')]);var _0x5b5f6a={'where':_0x4d76a7[_0x8fba('0x48')]};return db[_0x8fba('0x3a')]['count'](_0x5b5f6a)[_0x8fba('0x1f')](function(_0x4e023a){_0x12fec0['count']=_0x4e023a;if(_0x417637[_0x8fba('0x3f')][_0x8fba('0x4d')]){_0x4d76a7[_0x8fba('0x4e')]=[{'all':!![]}];}return db[_0x8fba('0x3a')]['findAll'](_0x4d76a7);})[_0x8fba('0x1f')](function(_0x4c3b96){_0x12fec0[_0x8fba('0x4f')]=_0x4c3b96;return _0x12fec0;})[_0x8fba('0x1f')](respondWithFilteredResult(_0x1bee75,_0x4d76a7))['catch'](handleError(_0x1bee75,null));};exports[_0x8fba('0x50')]=function(_0x1c2dd1,_0x442121){var _0x4632a3={'raw':![],'where':{'id':_0x1c2dd1['params']['id']}},_0x265ba4={};_0x265ba4['model']=_[_0x8fba('0x51')](db['VtigerConfiguration'][_0x8fba('0x3b')]);_0x265ba4['query']=_[_0x8fba('0x51')](_0x1c2dd1[_0x8fba('0x3f')]);_0x265ba4[_0x8fba('0x40')]=_[_0x8fba('0x41')](_0x265ba4[_0x8fba('0x3e')],_0x265ba4[_0x8fba('0x3f')]);_0x4632a3[_0x8fba('0x42')]=_[_0x8fba('0x41')](_0x265ba4['model'],qs[_0x8fba('0x43')](_0x1c2dd1[_0x8fba('0x3f')][_0x8fba('0x43')]));_0x4632a3[_0x8fba('0x42')]=_0x4632a3[_0x8fba('0x42')][_0x8fba('0x44')]?_0x4632a3[_0x8fba('0x42')]:_0x265ba4[_0x8fba('0x3e')];if(_0x1c2dd1[_0x8fba('0x3f')][_0x8fba('0x4d')]){_0x4632a3['include']=[{'all':!![]}];}_0x4632a3=_['merge']({},_0x4632a3,_0x1c2dd1['options']);return db['VtigerConfiguration'][_0x8fba('0x52')](_0x4632a3)['then'](handleEntityNotFound(_0x442121,null))['then'](respondWithResult(_0x442121,null))['catch'](handleError(_0x442121,null));};exports[_0x8fba('0x53')]=function(_0x3b17fe,_0x5d9ab2){return db['VtigerConfiguration'][_0x8fba('0x53')](_0x3b17fe[_0x8fba('0x54')],{})[_0x8fba('0x1f')](respondWithResult(_0x5d9ab2,0xc9))[_0x8fba('0x29')](handleError(_0x5d9ab2,null));};exports[_0x8fba('0x55')]=function(_0x4aff3b,_0x339861){if(_0x4aff3b[_0x8fba('0x54')]['id']){delete _0x4aff3b[_0x8fba('0x54')]['id'];}return db[_0x8fba('0x3a')][_0x8fba('0x52')]({'where':{'id':_0x4aff3b[_0x8fba('0x56')]['id']}})[_0x8fba('0x1f')](handleEntityNotFound(_0x339861,null))[_0x8fba('0x1f')](saveUpdates(_0x4aff3b[_0x8fba('0x54')],null))[_0x8fba('0x1f')](respondWithResult(_0x339861,null))['catch'](handleError(_0x339861,null));};exports[_0x8fba('0x35')]=function(_0xc5107d,_0x46fa8d){return db[_0x8fba('0x3a')][_0x8fba('0x52')]({'where':{'id':_0xc5107d[_0x8fba('0x56')]['id']}})['then'](handleEntityNotFound(_0x46fa8d,null))[_0x8fba('0x1f')](removeEntity(_0x46fa8d,null))['catch'](handleError(_0x46fa8d,null));};exports['getFields']=function(_0x183a72,_0x3cea41,_0x287364){var _0x2ad0de={};var _0x559c27={};var _0x35408a;var _0x5f243f;return db[_0x8fba('0x3a')][_0x8fba('0x57')]({'where':{'id':_0x183a72[_0x8fba('0x56')]['id']}})['then'](handleEntityNotFound(_0x3cea41,null))['then'](function(_0x351701){if(_0x351701){_0x35408a=_0x351701;_0x559c27[_0x8fba('0x3e')]=_[_0x8fba('0x51')](db[_0x8fba('0x58')][_0x8fba('0x3b')]);_0x559c27['query']=_[_0x8fba('0x51')](_0x183a72[_0x8fba('0x3f')]);_0x559c27[_0x8fba('0x40')]=_['intersection'](_0x559c27[_0x8fba('0x3e')],_0x559c27['query']);_0x2ad0de[_0x8fba('0x42')]=_[_0x8fba('0x41')](_0x559c27['model'],qs[_0x8fba('0x43')](_0x183a72['query'][_0x8fba('0x43')]));_0x2ad0de[_0x8fba('0x42')]=_0x2ad0de[_0x8fba('0x42')][_0x8fba('0x44')]?_0x2ad0de[_0x8fba('0x42')]:_0x559c27[_0x8fba('0x3e')];_0x2ad0de[_0x8fba('0x46')]=qs[_0x8fba('0x47')](_0x183a72[_0x8fba('0x3f')]['sort']);_0x2ad0de[_0x8fba('0x48')]=qs[_0x8fba('0x40')](_[_0x8fba('0x49')](_0x183a72[_0x8fba('0x3f')],_0x559c27[_0x8fba('0x40')]));if(_0x183a72[_0x8fba('0x3f')][_0x8fba('0x4a')]){_0x2ad0de['where']=_['merge'](_0x2ad0de[_0x8fba('0x48')],{'$or':_[_0x8fba('0x39')](_0x2ad0de[_0x8fba('0x42')],function(_0x3b3640){var _0x17362c={};_0x17362c[_0x3b3640]={'$like':'%'+_0x183a72[_0x8fba('0x3f')][_0x8fba('0x4a')]+'%'};return _0x17362c;})});}_0x2ad0de=_['merge']({},_0x2ad0de,_0x183a72['options']);return _0x35408a['getFields'](_0x2ad0de);}})[_0x8fba('0x1f')](function(_0x1c384e){if(_0x1c384e){_0x5f243f=_0x1c384e[_0x8fba('0x44')];if(!_0x183a72[_0x8fba('0x3f')][_0x8fba('0x59')]('nolimit')){_0x2ad0de[_0x8fba('0x30')]=qs['limit'](_0x183a72['query']['limit']);_0x2ad0de[_0x8fba('0x2f')]=qs[_0x8fba('0x2f')](_0x183a72[_0x8fba('0x3f')][_0x8fba('0x2f')]);}return _0x35408a[_0x8fba('0x5a')](_0x2ad0de);}})[_0x8fba('0x1f')](function(_0x1c134b){if(_0x1c134b){return _0x1c134b?{'count':_0x5f243f,'rows':_0x1c134b}:null;}})['then'](respondWithResult(_0x3cea41,null))[_0x8fba('0x29')](handleError(_0x3cea41,null));};exports['getSubjects']=function(_0x274531,_0x544ca7,_0x4b9491){var _0x42cd5a={};var _0x6f0356={};var _0x4dfce0;var _0xedbe3f;return db[_0x8fba('0x3a')][_0x8fba('0x57')]({'where':{'id':_0x274531['params']['id']}})['then'](handleEntityNotFound(_0x544ca7,null))[_0x8fba('0x1f')](function(_0x1e85c3){if(_0x1e85c3){_0x4dfce0=_0x1e85c3;_0x6f0356[_0x8fba('0x3e')]=_[_0x8fba('0x51')](db[_0x8fba('0x58')]['rawAttributes']);_0x6f0356[_0x8fba('0x3f')]=_[_0x8fba('0x51')](_0x274531[_0x8fba('0x3f')]);_0x6f0356[_0x8fba('0x40')]=_[_0x8fba('0x41')](_0x6f0356[_0x8fba('0x3e')],_0x6f0356[_0x8fba('0x3f')]);_0x42cd5a['attributes']=_[_0x8fba('0x41')](_0x6f0356[_0x8fba('0x3e')],qs[_0x8fba('0x43')](_0x274531['query'][_0x8fba('0x43')]));_0x42cd5a['attributes']=_0x42cd5a[_0x8fba('0x42')][_0x8fba('0x44')]?_0x42cd5a['attributes']:_0x6f0356['model'];_0x42cd5a[_0x8fba('0x46')]=qs[_0x8fba('0x47')](_0x274531['query'][_0x8fba('0x47')]);_0x42cd5a[_0x8fba('0x48')]=qs[_0x8fba('0x40')](_[_0x8fba('0x49')](_0x274531[_0x8fba('0x3f')],_0x6f0356['filters']));if(_0x274531[_0x8fba('0x3f')][_0x8fba('0x4a')]){_0x42cd5a[_0x8fba('0x48')]=_[_0x8fba('0x5b')](_0x42cd5a[_0x8fba('0x48')],{'$or':_[_0x8fba('0x39')](_0x42cd5a[_0x8fba('0x42')],function(_0x4bf789){var _0x102fad={};_0x102fad[_0x4bf789]={'$like':'%'+_0x274531['query'][_0x8fba('0x4a')]+'%'};return _0x102fad;})});}_0x42cd5a=_[_0x8fba('0x5b')]({},_0x42cd5a,_0x274531[_0x8fba('0x4c')]);return _0x4dfce0[_0x8fba('0x5c')](_0x42cd5a);}})[_0x8fba('0x1f')](function(_0x3c0faa){if(_0x3c0faa){_0xedbe3f=_0x3c0faa[_0x8fba('0x44')];if(!_0x274531[_0x8fba('0x3f')][_0x8fba('0x59')](_0x8fba('0x45'))){_0x42cd5a[_0x8fba('0x30')]=qs[_0x8fba('0x30')](_0x274531[_0x8fba('0x3f')][_0x8fba('0x30')]);_0x42cd5a[_0x8fba('0x2f')]=qs['offset'](_0x274531[_0x8fba('0x3f')][_0x8fba('0x2f')]);}return _0x4dfce0[_0x8fba('0x5c')](_0x42cd5a);}})[_0x8fba('0x1f')](function(_0x11c001){if(_0x11c001){return _0x11c001?{'count':_0xedbe3f,'rows':_0x11c001}:null;}})['then'](respondWithResult(_0x544ca7,null))[_0x8fba('0x29')](handleError(_0x544ca7,null));};exports[_0x8fba('0x5d')]=function(_0x4f1f16,_0x56ccbb,_0x11c872){var _0x21d228={};var _0x6f6fe8={};var _0xf57871;var _0x258f10;return db['VtigerConfiguration'][_0x8fba('0x57')]({'where':{'id':_0x4f1f16['params']['id']}})[_0x8fba('0x1f')](handleEntityNotFound(_0x56ccbb,null))[_0x8fba('0x1f')](function(_0x2394ec){if(_0x2394ec){_0xf57871=_0x2394ec;_0x6f6fe8['model']=_[_0x8fba('0x51')](db[_0x8fba('0x58')][_0x8fba('0x3b')]);_0x6f6fe8[_0x8fba('0x3f')]=_['keys'](_0x4f1f16['query']);_0x6f6fe8['filters']=_['intersection'](_0x6f6fe8[_0x8fba('0x3e')],_0x6f6fe8[_0x8fba('0x3f')]);_0x21d228[_0x8fba('0x42')]=_[_0x8fba('0x41')](_0x6f6fe8[_0x8fba('0x3e')],qs[_0x8fba('0x43')](_0x4f1f16[_0x8fba('0x3f')]['fields']));_0x21d228[_0x8fba('0x42')]=_0x21d228[_0x8fba('0x42')]['length']?_0x21d228['attributes']:_0x6f6fe8[_0x8fba('0x3e')];_0x21d228['order']=qs[_0x8fba('0x47')](_0x4f1f16['query'][_0x8fba('0x47')]);_0x21d228[_0x8fba('0x48')]=qs[_0x8fba('0x40')](_[_0x8fba('0x49')](_0x4f1f16[_0x8fba('0x3f')],_0x6f6fe8[_0x8fba('0x40')]));if(_0x4f1f16['query'][_0x8fba('0x4a')]){_0x21d228['where']=_[_0x8fba('0x5b')](_0x21d228[_0x8fba('0x48')],{'$or':_['map'](_0x21d228['attributes'],function(_0x2a3bd3){var _0x1cef0c={};_0x1cef0c[_0x2a3bd3]={'$like':'%'+_0x4f1f16['query'][_0x8fba('0x4a')]+'%'};return _0x1cef0c;})});}_0x21d228=_[_0x8fba('0x5b')]({},_0x21d228,_0x4f1f16[_0x8fba('0x4c')]);return _0xf57871[_0x8fba('0x5d')](_0x21d228);}})['then'](function(_0x174d1d){if(_0x174d1d){_0x258f10=_0x174d1d[_0x8fba('0x44')];if(!_0x4f1f16['query']['hasOwnProperty']('nolimit')){_0x21d228[_0x8fba('0x30')]=qs['limit'](_0x4f1f16[_0x8fba('0x3f')]['limit']);_0x21d228[_0x8fba('0x2f')]=qs[_0x8fba('0x2f')](_0x4f1f16[_0x8fba('0x3f')]['offset']);}return _0xf57871['getDescriptions'](_0x21d228);}})[_0x8fba('0x1f')](function(_0xc22239){if(_0xc22239){return _0xc22239?{'count':_0x258f10,'rows':_0xc22239}:null;}})['then'](respondWithResult(_0x56ccbb,null))[_0x8fba('0x29')](handleError(_0x56ccbb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4b6afbf..936c2b0 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 _0xa187=['int_vtiger_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x1b71a3,_0x145eb3){var _0x4af9a6=function(_0x1aed4b){while(--_0x1aed4b){_0x1b71a3['push'](_0x1b71a3['shift']());}};_0x4af9a6(++_0x145eb3);}(_0xa187,0xcd));var _0x7a18=function(_0x27ab8c,_0x42376a){_0x27ab8c=_0x27ab8c-0x0;var _0x1e65dc=_0xa187[_0x27ab8c];return _0x1e65dc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a18('0x0'))(_0x7a18('0x1'));var moment=require(_0x7a18('0x2'));var BPromise=require(_0x7a18('0x3'));var rp=require(_0x7a18('0x4'));var fs=require('fs');var path=require(_0x7a18('0x5'));var rimraf=require(_0x7a18('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a18('0x7'));module[_0x7a18('0x8')]=function(_0x1c45f6,_0x293a4f){return _0x1c45f6[_0x7a18('0x9')](_0x7a18('0xa'),attributes,{'tableName':_0x7a18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8239=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VtigerConfiguration','lodash'];(function(_0x523d6f,_0x3ed418){var _0x101254=function(_0x204803){while(--_0x204803){_0x523d6f['push'](_0x523d6f['shift']());}};_0x101254(++_0x3ed418);}(_0x8239,0x137));var _0x9823=function(_0x4bffd6,_0x3ddd7f){_0x4bffd6=_0x4bffd6-0x0;var _0x467e44=_0x8239[_0x4bffd6];return _0x467e44;};'use strict';var _=require(_0x9823('0x0'));var util=require(_0x9823('0x1'));var logger=require(_0x9823('0x2'))(_0x9823('0x3'));var moment=require(_0x9823('0x4'));var BPromise=require('bluebird');var rp=require(_0x9823('0x5'));var fs=require('fs');var path=require(_0x9823('0x6'));var rimraf=require(_0x9823('0x7'));var config=require(_0x9823('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x9823('0x9')]=function(_0x4ebfaf,_0xaa151e){return _0x4ebfaf[_0x9823('0xa')](_0x9823('0xb'),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 6eba1d4..569dd09 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 _0xe890=['error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify'];(function(_0x4913a8,_0x5a8cbd){var _0x50a4de=function(_0x31892e){while(--_0x31892e){_0x4913a8['push'](_0x4913a8['shift']());}};_0x50a4de(++_0x5a8cbd);}(_0xe890,0xc3));var _0x0e89=function(_0x40296f,_0x500a45){_0x40296f=_0x40296f-0x0;var _0x46e552=_0xe890[_0x40296f];return _0x46e552;};'use strict';var _=require(_0x0e89('0x0'));var util=require('util');var moment=require(_0x0e89('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e89('0x2'));var fs=require('fs');var Redis=require(_0x0e89('0x3'));var db=require(_0x0e89('0x4'))['db'];var utils=require(_0x0e89('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0e89('0x6'));var jayson=require(_0x0e89('0x7'));var client=jayson[_0x0e89('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2657b6,_0x2a737d,_0x56a58c){return new BPromise(function(_0x3b7489,_0x478e33){return client[_0x0e89('0x9')](_0x2657b6,_0x56a58c)[_0x0e89('0xa')](function(_0x109ebc){logger[_0x0e89('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a737d,_0x0e89('0xc'));logger[_0x0e89('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2a737d,'request\x20sent',JSON[_0x0e89('0xe')](_0x109ebc));if(_0x109ebc[_0x0e89('0xf')]){if(_0x109ebc[_0x0e89('0xf')][_0x0e89('0x10')]===0x1f4){logger[_0x0e89('0xf')](_0x0e89('0x11'),_0x2a737d,_0x109ebc[_0x0e89('0xf')][_0x0e89('0x12')]);return _0x478e33(_0x109ebc[_0x0e89('0xf')][_0x0e89('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2a737d,_0x109ebc[_0x0e89('0xf')]['message']);return _0x3b7489(_0x109ebc[_0x0e89('0xf')][_0x0e89('0x12')]);}else{logger[_0x0e89('0xb')](_0x0e89('0x11'),_0x2a737d,_0x0e89('0xc'));_0x3b7489(_0x109ebc[_0x0e89('0x13')]['message']);}})[_0x0e89('0x14')](function(_0x5f1215){logger[_0x0e89('0xf')](_0x0e89('0x11'),_0x2a737d,_0x5f1215);_0x478e33(_0x5f1215);});});} \ No newline at end of file +var _0x8cd9=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3e2b17,_0xd2b01a){var _0x24080a=function(_0x4669d9){while(--_0x4669d9){_0x3e2b17['push'](_0x3e2b17['shift']());}};_0x24080a(++_0xd2b01a);}(_0x8cd9,0xaf));var _0x98cd=function(_0xec0027,_0x364207){_0xec0027=_0xec0027-0x0;var _0x493a30=_0x8cd9[_0xec0027];return _0x493a30;};'use strict';var _=require(_0x98cd('0x0'));var util=require(_0x98cd('0x1'));var moment=require(_0x98cd('0x2'));var BPromise=require(_0x98cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98cd('0x4'));var db=require(_0x98cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x98cd('0x6'))(_0x98cd('0x7'));var config=require(_0x98cd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x98cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428678,_0x1d04ba,_0x117471){return new BPromise(function(_0x29ff36,_0x8fe677){return client[_0x98cd('0xa')](_0x428678,_0x117471)[_0x98cd('0xb')](function(_0x2a4a8c){logger[_0x98cd('0xc')](_0x98cd('0xd'),_0x1d04ba,_0x98cd('0xe'));logger[_0x98cd('0xf')](_0x98cd('0x10'),_0x1d04ba,_0x98cd('0xe'),JSON[_0x98cd('0x11')](_0x2a4a8c));if(_0x2a4a8c['error']){if(_0x2a4a8c['error'][_0x98cd('0x12')]===0x1f4){logger['error'](_0x98cd('0xd'),_0x1d04ba,_0x2a4a8c['error'][_0x98cd('0x13')]);return _0x8fe677(_0x2a4a8c[_0x98cd('0x14')][_0x98cd('0x13')]);}logger[_0x98cd('0x14')](_0x98cd('0xd'),_0x1d04ba,_0x2a4a8c[_0x98cd('0x14')][_0x98cd('0x13')]);return _0x29ff36(_0x2a4a8c[_0x98cd('0x14')][_0x98cd('0x13')]);}else{logger[_0x98cd('0xc')](_0x98cd('0xd'),_0x1d04ba,'request\x20sent');_0x29ff36(_0x2a4a8c[_0x98cd('0x15')][_0x98cd('0x13')]);}})[_0x98cd('0x16')](function(_0x5717ab){logger[_0x98cd('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d04ba,_0x5717ab);_0x8fe677(_0x5717ab);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 4984ac2..cd1adea 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 _0x6ada=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','delete','/:id'];(function(_0x26feb2,_0x5ad32d){var _0x1d26ec=function(_0xbf96cd){while(--_0xbf96cd){_0x26feb2['push'](_0x26feb2['shift']());}};_0x1d26ec(++_0x5ad32d);}(_0x6ada,0x199));var _0xa6ad=function(_0xd4c2eb,_0x32636e){_0xd4c2eb=_0xd4c2eb-0x0;var _0x1140d9=_0x6ada[_0xd4c2eb];return _0x1140d9;};'use strict';var multer=require(_0xa6ad('0x0'));var util=require('util');var path=require(_0xa6ad('0x1'));var timeout=require(_0xa6ad('0x2'));var express=require(_0xa6ad('0x3'));var router=express[_0xa6ad('0x4')]();var auth=require(_0xa6ad('0x5'));var interaction=require(_0xa6ad('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0xa6ad('0x7')]('/',auth[_0xa6ad('0x8')](),controller[_0xa6ad('0x9')]);router[_0xa6ad('0x7')]('/:id',auth[_0xa6ad('0x8')](),controller[_0xa6ad('0xa')]);router[_0xa6ad('0xb')]('/',auth[_0xa6ad('0x8')](),controller[_0xa6ad('0xc')]);router[_0xa6ad('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa6ad('0xe')](_0xa6ad('0xf'),auth[_0xa6ad('0x8')](),controller['destroy']);module[_0xa6ad('0x10')]=router; \ No newline at end of file +var _0x08f1=['/:id','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','isAuthenticated','create','put'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x08f1,0x12f));var _0x108f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x08f1[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x108f('0x0'));var util=require(_0x108f('0x1'));var path=require(_0x108f('0x2'));var timeout=require(_0x108f('0x3'));var express=require(_0x108f('0x4'));var router=express['Router']();var auth=require(_0x108f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x108f('0x6'));var controller=require('./intVtigerField.controller');router[_0x108f('0x7')]('/',auth['isAuthenticated'](),controller[_0x108f('0x8')]);router[_0x108f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x108f('0x9')](),controller[_0x108f('0xa')]);router[_0x108f('0xb')](_0x108f('0xc'),auth[_0x108f('0x9')](),controller['update']);router[_0x108f('0xd')](_0x108f('0xc'),auth[_0x108f('0x9')](),controller['destroy']);module[_0x108f('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e8d9216..f5d3100 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 _0x89b2=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x262757,_0x1574c4){var _0x338832=function(_0x2d9825){while(--_0x2d9825){_0x262757['push'](_0x262757['shift']());}};_0x338832(++_0x1574c4);}(_0x89b2,0xc6));var _0x289b=function(_0x44073b,_0x53116c){_0x44073b=_0x44073b-0x0;var _0x3757d4=_0x89b2[_0x44073b];return _0x3757d4;};'use strict';var Sequelize=require(_0x289b('0x0'));module[_0x289b('0x1')]={'type':{'type':Sequelize[_0x289b('0x2')](_0x289b('0x3'),_0x289b('0x4'),_0x289b('0x5'),_0x289b('0x6')),'defaultValue':_0x289b('0x3')},'content':{'type':Sequelize[_0x289b('0x7')]},'key':{'type':Sequelize[_0x289b('0x7')]},'keyType':{'type':Sequelize[_0x289b('0x2')](_0x289b('0x3'),'variable',_0x289b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x289b('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2263=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0x2263,0x6e));var _0x3226=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0x2263[_0x4cc03b];return _0xf0358c;};'use strict';var Sequelize=require(_0x3226('0x0'));module[_0x3226('0x1')]={'type':{'type':Sequelize[_0x3226('0x2')](_0x3226('0x3'),_0x3226('0x4'),_0x3226('0x5'),_0x3226('0x6')),'defaultValue':_0x3226('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3226('0x7')]},'keyType':{'type':Sequelize[_0x3226('0x2')](_0x3226('0x3'),_0x3226('0x4'),_0x3226('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3226('0x7')]},'nameField':{'type':Sequelize[_0x3226('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 400ed4b..c13a808 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 _0xba91=['zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','name','send','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xba91,0xda));var _0x1ba9=function(_0x5bf0b1,_0x6d22a){_0x5bf0b1=_0x5bf0b1-0x0;var _0x12495b=_0xba91[_0x5bf0b1];return _0x12495b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1ba9('0x0'));var zipdir=require(_0x1ba9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ba9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ba9('0x3'));var path=require(_0x1ba9('0x4'));var sox=require(_0x1ba9('0x5'));var csv=require(_0x1ba9('0x6'));var ejs=require(_0x1ba9('0x7'));var fs=require('fs');var _=require(_0x1ba9('0x8'));var squel=require(_0x1ba9('0x9'));var crypto=require(_0x1ba9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1ba9('0xb'));var toCsv=require(_0x1ba9('0x6'));var querystring=require(_0x1ba9('0xc'));var Papa=require(_0x1ba9('0xd'));var Redis=require(_0x1ba9('0xe'));var authService=require(_0x1ba9('0xf'));var qs=require(_0x1ba9('0x10'));var as=require(_0x1ba9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ba9('0x12'))('api');var utils=require(_0x1ba9('0x13'));var config=require(_0x1ba9('0x14'));var db=require(_0x1ba9('0x15'))['db'];function respondWithStatusCode(_0x3570dc,_0x5bb368){_0x5bb368=_0x5bb368||0xcc;return function(_0x24ae81){if(_0x24ae81){return _0x3570dc[_0x1ba9('0x16')](_0x5bb368);}return _0x3570dc[_0x1ba9('0x17')](_0x5bb368)['end']();};}function respondWithResult(_0x51454e,_0xc54373){_0xc54373=_0xc54373||0xc8;return function(_0x5dabe9){if(_0x5dabe9){return _0x51454e[_0x1ba9('0x17')](_0xc54373)[_0x1ba9('0x18')](_0x5dabe9);}};}function respondWithFilteredResult(_0x532d0b,_0x34e31e){return function(_0x521ce9){if(_0x521ce9){var _0x8c560a=_0x521ce9[_0x1ba9('0x19')],_0x1d4848=_0x34e31e[_0x1ba9('0x1a')],_0x4515f3=_0x34e31e['offset']+_0x34e31e[_0x1ba9('0x1b')],_0x3ac9c7;if(_0x4515f3>=_0x8c560a){_0x4515f3=_0x8c560a;_0x3ac9c7=0xc8;}else{_0x3ac9c7=0xce;}_0x532d0b[_0x1ba9('0x17')](_0x3ac9c7);return _0x532d0b[_0x1ba9('0x1c')](_0x1ba9('0x1d'),_0x1d4848+'-'+_0x4515f3+'/'+_0x8c560a)[_0x1ba9('0x18')](_0x521ce9);}return null;};}function patchUpdates(_0x4693b5){return function(_0x31f622){try{jsonpatch['apply'](_0x31f622,_0x4693b5,!![]);}catch(_0x4e57e7){return BPromise[_0x1ba9('0x1e')](_0x4e57e7);}return _0x31f622[_0x1ba9('0x1f')]();};}function saveUpdates(_0x54943b,_0x219b2d){return function(_0x5d852a){if(_0x5d852a){return _0x5d852a[_0x1ba9('0x20')](_0x54943b)['then'](function(_0x556fde){return _0x556fde;});}return null;};}function removeEntity(_0x237426,_0x5f09d7){return function(_0x4a739d){if(_0x4a739d){return _0x4a739d[_0x1ba9('0x21')]()[_0x1ba9('0x22')](function(){_0x237426[_0x1ba9('0x17')](0xcc)[_0x1ba9('0x23')]();});}};}function handleEntityNotFound(_0x391ab4,_0x3df1e9){return function(_0x57de07){if(!_0x57de07){_0x391ab4[_0x1ba9('0x16')](0x194);}return _0x57de07;};}function handleError(_0x71a6a9,_0x4afe01){_0x4afe01=_0x4afe01||0x1f4;return function(_0x3f74e0){logger[_0x1ba9('0x24')](_0x3f74e0['stack']);if(_0x3f74e0[_0x1ba9('0x25')]){delete _0x3f74e0['name'];}_0x71a6a9[_0x1ba9('0x17')](_0x4afe01)[_0x1ba9('0x26')](_0x3f74e0);};}exports['index']=function(_0x3ce261,_0x994211){var _0x54cc79={},_0x3d5b39={},_0x2aab44={'count':0x0,'rows':[]};var _0x3c4d15=_[_0x1ba9('0x27')](db[_0x1ba9('0x28')][_0x1ba9('0x29')],function(_0x9d81bf){return{'name':_0x9d81bf[_0x1ba9('0x2a')],'type':_0x9d81bf[_0x1ba9('0x2b')][_0x1ba9('0x2c')]};});_0x3d5b39['model']=_[_0x1ba9('0x27')](_0x3c4d15,'name');_0x3d5b39[_0x1ba9('0x2d')]=_[_0x1ba9('0x2e')](_0x3ce261['query']);_0x3d5b39[_0x1ba9('0x2f')]=_[_0x1ba9('0x30')](_0x3d5b39['model'],_0x3d5b39[_0x1ba9('0x2d')]);_0x54cc79[_0x1ba9('0x31')]=_['intersection'](_0x3d5b39[_0x1ba9('0x32')],qs[_0x1ba9('0x33')](_0x3ce261['query'][_0x1ba9('0x33')]));_0x54cc79[_0x1ba9('0x31')]=_0x54cc79['attributes'][_0x1ba9('0x34')]?_0x54cc79[_0x1ba9('0x31')]:_0x3d5b39['model'];if(!_0x3ce261[_0x1ba9('0x2d')][_0x1ba9('0x35')](_0x1ba9('0x36'))){_0x54cc79[_0x1ba9('0x1b')]=qs[_0x1ba9('0x1b')](_0x3ce261[_0x1ba9('0x2d')][_0x1ba9('0x1b')]);_0x54cc79[_0x1ba9('0x1a')]=qs[_0x1ba9('0x1a')](_0x3ce261['query']['offset']);}_0x54cc79[_0x1ba9('0x37')]=qs['sort'](_0x3ce261[_0x1ba9('0x2d')][_0x1ba9('0x38')]);_0x54cc79['where']=qs['filters'](_[_0x1ba9('0x39')](_0x3ce261['query'],_0x3d5b39[_0x1ba9('0x2f')]));if(_0x3ce261[_0x1ba9('0x2d')]['filter']){_0x54cc79[_0x1ba9('0x3a')]=_['merge'](_0x54cc79[_0x1ba9('0x3a')],{'$or':_[_0x1ba9('0x27')](_0x3c4d15,function(_0x2b4d34){if(_0x2b4d34[_0x1ba9('0x2b')]!==_0x1ba9('0x3b')){var _0x275412={};_0x275412[_0x2b4d34[_0x1ba9('0x25')]]={'$like':'%'+_0x3ce261[_0x1ba9('0x2d')][_0x1ba9('0x3c')]+'%'};return _0x275412;}})});}_0x54cc79=_[_0x1ba9('0x3d')]({},_0x54cc79,_0x3ce261[_0x1ba9('0x3e')]);var _0x16c624={'where':_0x54cc79[_0x1ba9('0x3a')]};return db[_0x1ba9('0x28')]['count'](_0x16c624)['then'](function(_0x2f94a3){_0x2aab44[_0x1ba9('0x19')]=_0x2f94a3;if(_0x3ce261[_0x1ba9('0x2d')][_0x1ba9('0x3f')]){_0x54cc79[_0x1ba9('0x40')]=[{'all':!![]}];}return db[_0x1ba9('0x28')][_0x1ba9('0x41')](_0x54cc79);})[_0x1ba9('0x22')](function(_0x133b18){_0x2aab44[_0x1ba9('0x42')]=_0x133b18;return _0x2aab44;})[_0x1ba9('0x22')](respondWithFilteredResult(_0x994211,_0x54cc79))[_0x1ba9('0x43')](handleError(_0x994211,null));};exports[_0x1ba9('0x44')]=function(_0x4b6d63,_0x32529b){var _0x16f5a8={'raw':!![],'where':{'id':_0x4b6d63[_0x1ba9('0x45')]['id']}},_0x437a7d={};_0x437a7d[_0x1ba9('0x32')]=_['keys'](db['VtigerField'][_0x1ba9('0x29')]);_0x437a7d[_0x1ba9('0x2d')]=_[_0x1ba9('0x2e')](_0x4b6d63[_0x1ba9('0x2d')]);_0x437a7d['filters']=_[_0x1ba9('0x30')](_0x437a7d[_0x1ba9('0x32')],_0x437a7d[_0x1ba9('0x2d')]);_0x16f5a8['attributes']=_[_0x1ba9('0x30')](_0x437a7d[_0x1ba9('0x32')],qs[_0x1ba9('0x33')](_0x4b6d63[_0x1ba9('0x2d')][_0x1ba9('0x33')]));_0x16f5a8[_0x1ba9('0x31')]=_0x16f5a8[_0x1ba9('0x31')][_0x1ba9('0x34')]?_0x16f5a8['attributes']:_0x437a7d['model'];if(_0x4b6d63[_0x1ba9('0x2d')][_0x1ba9('0x3f')]){_0x16f5a8[_0x1ba9('0x40')]=[{'all':!![]}];}_0x16f5a8=_[_0x1ba9('0x3d')]({},_0x16f5a8,_0x4b6d63['options']);return db['VtigerField'][_0x1ba9('0x46')](_0x16f5a8)[_0x1ba9('0x22')](handleEntityNotFound(_0x32529b,null))[_0x1ba9('0x22')](respondWithResult(_0x32529b,null))[_0x1ba9('0x43')](handleError(_0x32529b,null));};exports[_0x1ba9('0x47')]=function(_0x85ef2e,_0x2b01d8){return db['VtigerField'][_0x1ba9('0x47')](_0x85ef2e[_0x1ba9('0x48')],{})['then'](respondWithResult(_0x2b01d8,0xc9))['catch'](handleError(_0x2b01d8,null));};exports[_0x1ba9('0x20')]=function(_0xc27784,_0x330d8b){if(_0xc27784['body']['id']){delete _0xc27784[_0x1ba9('0x48')]['id'];}return db[_0x1ba9('0x28')][_0x1ba9('0x46')]({'where':{'id':_0xc27784[_0x1ba9('0x45')]['id']}})['then'](handleEntityNotFound(_0x330d8b,null))[_0x1ba9('0x22')](saveUpdates(_0xc27784[_0x1ba9('0x48')],null))[_0x1ba9('0x22')](respondWithResult(_0x330d8b,null))[_0x1ba9('0x43')](handleError(_0x330d8b,null));};exports[_0x1ba9('0x21')]=function(_0x364a29,_0x58ab99){return db[_0x1ba9('0x28')][_0x1ba9('0x46')]({'where':{'id':_0x364a29[_0x1ba9('0x45')]['id']}})[_0x1ba9('0x22')](handleEntityNotFound(_0x58ab99,null))[_0x1ba9('0x22')](removeEntity(_0x58ab99,null))[_0x1ba9('0x43')](handleError(_0x58ab99,null));}; \ No newline at end of file +var _0xd290=['set','Content-Range','reject','update','then','destroy','error','name','send','VtigerField','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','length','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','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','count','offset','limit'];(function(_0x6a5f0c,_0x5b7f72){var _0x40e47e=function(_0x5854d4){while(--_0x5854d4){_0x6a5f0c['push'](_0x6a5f0c['shift']());}};_0x40e47e(++_0x5b7f72);}(_0xd290,0x69));var _0x0d29=function(_0xa82a65,_0x1102c5){_0xa82a65=_0xa82a65-0x0;var _0x8100dd=_0xd290[_0xa82a65];return _0x8100dd;};'use strict';var pdf=require(_0x0d29('0x0'));var emlformat=require(_0x0d29('0x1'));var rimraf=require(_0x0d29('0x2'));var zipdir=require(_0x0d29('0x3'));var jsonpatch=require(_0x0d29('0x4'));var rp=require(_0x0d29('0x5'));var moment=require(_0x0d29('0x6'));var BPromise=require(_0x0d29('0x7'));var Mustache=require(_0x0d29('0x8'));var util=require('util');var path=require('path');var sox=require(_0x0d29('0x9'));var csv=require('to-csv');var ejs=require(_0x0d29('0xa'));var fs=require('fs');var _=require(_0x0d29('0xb'));var squel=require(_0x0d29('0xc'));var crypto=require(_0x0d29('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0d29('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0d29('0xf'));var Papa=require(_0x0d29('0x10'));var Redis=require(_0x0d29('0x11'));var authService=require(_0x0d29('0x12'));var qs=require(_0x0d29('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d29('0x14'));var logger=require(_0x0d29('0x15'))(_0x0d29('0x16'));var utils=require('../../config/utils');var config=require(_0x0d29('0x17'));var db=require(_0x0d29('0x18'))['db'];function respondWithStatusCode(_0x32d7fa,_0x2966ce){_0x2966ce=_0x2966ce||0xcc;return function(_0x216018){if(_0x216018){return _0x32d7fa[_0x0d29('0x19')](_0x2966ce);}return _0x32d7fa[_0x0d29('0x1a')](_0x2966ce)[_0x0d29('0x1b')]();};}function respondWithResult(_0x1a0f9c,_0x80d480){_0x80d480=_0x80d480||0xc8;return function(_0x8a4328){if(_0x8a4328){return _0x1a0f9c[_0x0d29('0x1a')](_0x80d480)['json'](_0x8a4328);}};}function respondWithFilteredResult(_0x13e043,_0x1ba555){return function(_0x9b3fe5){if(_0x9b3fe5){var _0x34a674=_0x9b3fe5[_0x0d29('0x1c')],_0xfb80b7=_0x1ba555[_0x0d29('0x1d')],_0x3c24d4=_0x1ba555[_0x0d29('0x1d')]+_0x1ba555[_0x0d29('0x1e')],_0x4cd596;if(_0x3c24d4>=_0x34a674){_0x3c24d4=_0x34a674;_0x4cd596=0xc8;}else{_0x4cd596=0xce;}_0x13e043['status'](_0x4cd596);return _0x13e043[_0x0d29('0x1f')](_0x0d29('0x20'),_0xfb80b7+'-'+_0x3c24d4+'/'+_0x34a674)['json'](_0x9b3fe5);}return null;};}function patchUpdates(_0x2f65f7){return function(_0x2521a0){try{jsonpatch['apply'](_0x2521a0,_0x2f65f7,!![]);}catch(_0x3068d6){return BPromise[_0x0d29('0x21')](_0x3068d6);}return _0x2521a0['save']();};}function saveUpdates(_0x45065d,_0xbc11ed){return function(_0x53da95){if(_0x53da95){return _0x53da95[_0x0d29('0x22')](_0x45065d)[_0x0d29('0x23')](function(_0x6057e7){return _0x6057e7;});}return null;};}function removeEntity(_0x23ff55,_0x1e577e){return function(_0xc5e183){if(_0xc5e183){return _0xc5e183[_0x0d29('0x24')]()['then'](function(){_0x23ff55[_0x0d29('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a89b1,_0x2ea808){return function(_0x3be717){if(!_0x3be717){_0x5a89b1[_0x0d29('0x19')](0x194);}return _0x3be717;};}function handleError(_0x24900f,_0x41d958){_0x41d958=_0x41d958||0x1f4;return function(_0x29493f){logger[_0x0d29('0x25')](_0x29493f['stack']);if(_0x29493f[_0x0d29('0x26')]){delete _0x29493f[_0x0d29('0x26')];}_0x24900f['status'](_0x41d958)[_0x0d29('0x27')](_0x29493f);};}exports['index']=function(_0x20f051,_0x2be126){var _0x237625={},_0x594a22={},_0x3f32f8={'count':0x0,'rows':[]};var _0x1a43be=_['map'](db[_0x0d29('0x28')]['rawAttributes'],function(_0xdd3129){return{'name':_0xdd3129['fieldName'],'type':_0xdd3129[_0x0d29('0x29')][_0x0d29('0x2a')]};});_0x594a22['model']=_[_0x0d29('0x2b')](_0x1a43be,_0x0d29('0x26'));_0x594a22[_0x0d29('0x2c')]=_[_0x0d29('0x2d')](_0x20f051['query']);_0x594a22[_0x0d29('0x2e')]=_[_0x0d29('0x2f')](_0x594a22['model'],_0x594a22[_0x0d29('0x2c')]);_0x237625[_0x0d29('0x30')]=_['intersection'](_0x594a22[_0x0d29('0x31')],qs[_0x0d29('0x32')](_0x20f051[_0x0d29('0x2c')][_0x0d29('0x32')]));_0x237625[_0x0d29('0x30')]=_0x237625[_0x0d29('0x30')]['length']?_0x237625[_0x0d29('0x30')]:_0x594a22[_0x0d29('0x31')];if(!_0x20f051['query'][_0x0d29('0x33')](_0x0d29('0x34'))){_0x237625[_0x0d29('0x1e')]=qs['limit'](_0x20f051[_0x0d29('0x2c')][_0x0d29('0x1e')]);_0x237625[_0x0d29('0x1d')]=qs[_0x0d29('0x1d')](_0x20f051[_0x0d29('0x2c')][_0x0d29('0x1d')]);}_0x237625['order']=qs[_0x0d29('0x35')](_0x20f051[_0x0d29('0x2c')][_0x0d29('0x35')]);_0x237625[_0x0d29('0x36')]=qs[_0x0d29('0x2e')](_['pick'](_0x20f051[_0x0d29('0x2c')],_0x594a22[_0x0d29('0x2e')]));if(_0x20f051['query'][_0x0d29('0x37')]){_0x237625[_0x0d29('0x36')]=_[_0x0d29('0x38')](_0x237625['where'],{'$or':_['map'](_0x1a43be,function(_0x14ef1a){if(_0x14ef1a[_0x0d29('0x29')]!==_0x0d29('0x39')){var _0x23d611={};_0x23d611[_0x14ef1a[_0x0d29('0x26')]]={'$like':'%'+_0x20f051[_0x0d29('0x2c')]['filter']+'%'};return _0x23d611;}})});}_0x237625=_['merge']({},_0x237625,_0x20f051['options']);var _0x3aaf8f={'where':_0x237625[_0x0d29('0x36')]};return db[_0x0d29('0x28')][_0x0d29('0x1c')](_0x3aaf8f)[_0x0d29('0x23')](function(_0x48b376){_0x3f32f8['count']=_0x48b376;if(_0x20f051[_0x0d29('0x2c')][_0x0d29('0x3a')]){_0x237625[_0x0d29('0x3b')]=[{'all':!![]}];}return db[_0x0d29('0x28')]['findAll'](_0x237625);})[_0x0d29('0x23')](function(_0x1869c2){_0x3f32f8[_0x0d29('0x3c')]=_0x1869c2;return _0x3f32f8;})['then'](respondWithFilteredResult(_0x2be126,_0x237625))[_0x0d29('0x3d')](handleError(_0x2be126,null));};exports['show']=function(_0x446edd,_0x3e68ed){var _0x45da5c={'raw':!![],'where':{'id':_0x446edd[_0x0d29('0x3e')]['id']}},_0x1c677b={};_0x1c677b[_0x0d29('0x31')]=_[_0x0d29('0x2d')](db['VtigerField']['rawAttributes']);_0x1c677b[_0x0d29('0x2c')]=_[_0x0d29('0x2d')](_0x446edd[_0x0d29('0x2c')]);_0x1c677b[_0x0d29('0x2e')]=_[_0x0d29('0x2f')](_0x1c677b['model'],_0x1c677b[_0x0d29('0x2c')]);_0x45da5c['attributes']=_[_0x0d29('0x2f')](_0x1c677b[_0x0d29('0x31')],qs[_0x0d29('0x32')](_0x446edd['query'][_0x0d29('0x32')]));_0x45da5c[_0x0d29('0x30')]=_0x45da5c['attributes'][_0x0d29('0x3f')]?_0x45da5c[_0x0d29('0x30')]:_0x1c677b[_0x0d29('0x31')];if(_0x446edd['query']['includeAll']){_0x45da5c['include']=[{'all':!![]}];}_0x45da5c=_[_0x0d29('0x38')]({},_0x45da5c,_0x446edd[_0x0d29('0x40')]);return db[_0x0d29('0x28')][_0x0d29('0x41')](_0x45da5c)[_0x0d29('0x23')](handleEntityNotFound(_0x3e68ed,null))['then'](respondWithResult(_0x3e68ed,null))[_0x0d29('0x3d')](handleError(_0x3e68ed,null));};exports[_0x0d29('0x42')]=function(_0x1f8d2f,_0x204348){return db[_0x0d29('0x28')]['create'](_0x1f8d2f['body'],{})['then'](respondWithResult(_0x204348,0xc9))[_0x0d29('0x3d')](handleError(_0x204348,null));};exports[_0x0d29('0x22')]=function(_0x5b5877,_0x5d685f){if(_0x5b5877[_0x0d29('0x43')]['id']){delete _0x5b5877[_0x0d29('0x43')]['id'];}return db[_0x0d29('0x28')]['find']({'where':{'id':_0x5b5877[_0x0d29('0x3e')]['id']}})[_0x0d29('0x23')](handleEntityNotFound(_0x5d685f,null))[_0x0d29('0x23')](saveUpdates(_0x5b5877[_0x0d29('0x43')],null))[_0x0d29('0x23')](respondWithResult(_0x5d685f,null))[_0x0d29('0x3d')](handleError(_0x5d685f,null));};exports[_0x0d29('0x24')]=function(_0x17f442,_0xc0ea14){return db['VtigerField']['find']({'where':{'id':_0x17f442[_0x0d29('0x3e')]['id']}})[_0x0d29('0x23')](handleEntityNotFound(_0xc0ea14,null))['then'](removeEntity(_0xc0ea14,null))[_0x0d29('0x3d')](handleError(_0xc0ea14,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 74cc8ae..5da187f 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 _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x5d1ec3,_0x695e81){var _0x5118bb=function(_0xf056e5){while(--_0xf056e5){_0x5d1ec3['push'](_0x5d1ec3['shift']());}};_0x5118bb(++_0x695e81);}(_0x7a54,0x106));var _0x47a5=function(_0x43ee10,_0x399f54){_0x43ee10=_0x43ee10-0x0;var _0x460f92=_0x7a54[_0x43ee10];return _0x460f92;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x50892b,_0xa1a4d4){var _0x2f7ee5=function(_0x5a8118){while(--_0x5a8118){_0x50892b['push'](_0x50892b['shift']());}};_0x2f7ee5(++_0xa1a4d4);}(_0x7a54,0x106));var _0x47a5=function(_0x4ac8bd,_0x3a2d07){_0x4ac8bd=_0x4ac8bd-0x0;var _0x44a614=_0x7a54[_0x4ac8bd];return _0x44a614;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'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 2465a27..5b417fa 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 _0x486e=['VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1cdc4f,_0x166734){var _0xec678=function(_0x50e95f){while(--_0x50e95f){_0x1cdc4f['push'](_0x1cdc4f['shift']());}};_0xec678(++_0x166734);}(_0x486e,0xb2));var _0xe486=function(_0x3dfea7,_0x34923a){_0x3dfea7=_0x3dfea7-0x0;var _0x30facb=_0x486e[_0x3dfea7];return _0x30facb;};'use strict';var _=require(_0xe486('0x0'));var util=require(_0xe486('0x1'));var moment=require('moment');var BPromise=require(_0xe486('0x2'));var rs=require(_0xe486('0x3'));var fs=require('fs');var Redis=require(_0xe486('0x4'));var db=require(_0xe486('0x5'))['db'];var utils=require(_0xe486('0x6'));var logger=require(_0xe486('0x7'))(_0xe486('0x8'));var config=require(_0xe486('0x9'));var jayson=require(_0xe486('0xa'));var client=jayson[_0xe486('0xb')][_0xe486('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fac5d,_0x2d0712,_0xea849d){return new BPromise(function(_0x8a85c7,_0x2114a5){return client[_0xe486('0xd')](_0x4fac5d,_0xea849d)[_0xe486('0xe')](function(_0x42c4b3){logger[_0xe486('0xf')]('VtigerField,\x20%s,\x20%s',_0x2d0712,'request\x20sent');logger[_0xe486('0x10')](_0xe486('0x11'),_0x2d0712,_0xe486('0x12'),JSON[_0xe486('0x13')](_0x42c4b3));if(_0x42c4b3[_0xe486('0x14')]){if(_0x42c4b3[_0xe486('0x14')][_0xe486('0x15')]===0x1f4){logger[_0xe486('0x14')](_0xe486('0x16'),_0x2d0712,_0x42c4b3['error']['message']);return _0x2114a5(_0x42c4b3[_0xe486('0x14')][_0xe486('0x17')]);}logger[_0xe486('0x14')]('VtigerField,\x20%s,\x20%s',_0x2d0712,_0x42c4b3['error'][_0xe486('0x17')]);return _0x8a85c7(_0x42c4b3['error'][_0xe486('0x17')]);}else{logger[_0xe486('0xf')](_0xe486('0x16'),_0x2d0712,_0xe486('0x12'));_0x8a85c7(_0x42c4b3['result']['message']);}})[_0xe486('0x18')](function(_0x21fca9){logger['error'](_0xe486('0x16'),_0x2d0712,_0x21fca9);_0x2114a5(_0x21fca9);});});} \ No newline at end of file +var _0xdf79=['stringify','error','code','VtigerField,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdf79,0xa7));var _0x9df7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf79[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9df7('0x0'));var BPromise=require(_0x9df7('0x1'));var rs=require(_0x9df7('0x2'));var fs=require('fs');var Redis=require(_0x9df7('0x3'));var db=require(_0x9df7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9df7('0x5'));var client=jayson[_0x9df7('0x6')][_0x9df7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x39f3c2,_0x5cf73b,_0x21d177){return new BPromise(function(_0x4cc7d5,_0x1663c8){return client['request'](_0x39f3c2,_0x21d177)[_0x9df7('0x8')](function(_0x1d86ed){logger[_0x9df7('0x9')]('VtigerField,\x20%s,\x20%s',_0x5cf73b,_0x9df7('0xa'));logger[_0x9df7('0xb')](_0x9df7('0xc'),_0x5cf73b,'request\x20sent',JSON[_0x9df7('0xd')](_0x1d86ed));if(_0x1d86ed[_0x9df7('0xe')]){if(_0x1d86ed[_0x9df7('0xe')][_0x9df7('0xf')]===0x1f4){logger[_0x9df7('0xe')](_0x9df7('0x10'),_0x5cf73b,_0x1d86ed[_0x9df7('0xe')][_0x9df7('0x11')]);return _0x1663c8(_0x1d86ed[_0x9df7('0xe')][_0x9df7('0x11')]);}logger[_0x9df7('0xe')](_0x9df7('0x10'),_0x5cf73b,_0x1d86ed['error']['message']);return _0x4cc7d5(_0x1d86ed[_0x9df7('0xe')][_0x9df7('0x11')]);}else{logger[_0x9df7('0x9')]('VtigerField,\x20%s,\x20%s',_0x5cf73b,_0x9df7('0xa'));_0x4cc7d5(_0x1d86ed['result']['message']);}})['catch'](function(_0x47241b){logger[_0x9df7('0xe')](_0x9df7('0x10'),_0x5cf73b,_0x47241b);_0x1663c8(_0x47241b);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 99baa11..201ea7b 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 _0x52f2=['./intZendeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x335e96,_0x390d53){var _0x25d5c8=function(_0x4338b3){while(--_0x4338b3){_0x335e96['push'](_0x335e96['shift']());}};_0x25d5c8(++_0x390d53);}(_0x52f2,0x133));var _0x252f=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x52f2[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x252f('0x0'));var util=require('util');var path=require(_0x252f('0x1'));var timeout=require(_0x252f('0x2'));var express=require(_0x252f('0x3'));var router=express[_0x252f('0x4')]();var auth=require(_0x252f('0x5'));var interaction=require(_0x252f('0x6'));var config=require(_0x252f('0x7'));var controller=require(_0x252f('0x8'));router['get']('/',auth[_0x252f('0x9')](),controller[_0x252f('0xa')]);router[_0x252f('0xb')](_0x252f('0xc'),auth[_0x252f('0x9')](),controller['show']);router[_0x252f('0xb')](_0x252f('0xd'),auth[_0x252f('0x9')](),controller[_0x252f('0xe')]);router[_0x252f('0xb')](_0x252f('0xf'),auth[_0x252f('0x9')](),controller[_0x252f('0x10')]);router[_0x252f('0x11')]('/',auth[_0x252f('0x9')](),controller['create']);router[_0x252f('0x11')](_0x252f('0xd'),auth[_0x252f('0x9')](),controller[_0x252f('0x12')]);router['put'](_0x252f('0xc'),auth[_0x252f('0x9')](),controller[_0x252f('0x13')]);router['delete'](_0x252f('0xc'),auth[_0x252f('0x9')](),controller['destroy']);module[_0x252f('0x14')]=router; \ No newline at end of file +var _0x7642=['util','path','connect-timeout','express','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x226979,_0xdeaa9b){var _0x3f57b6=function(_0x1ee1e5){while(--_0x1ee1e5){_0x226979['push'](_0x226979['shift']());}};_0x3f57b6(++_0xdeaa9b);}(_0x7642,0x19d));var _0x2764=function(_0x33b0ae,_0x24bea5){_0x33b0ae=_0x33b0ae-0x0;var _0x1b7367=_0x7642[_0x33b0ae];return _0x1b7367;};'use strict';var multer=require(_0x2764('0x0'));var util=require(_0x2764('0x1'));var path=require(_0x2764('0x2'));var timeout=require(_0x2764('0x3'));var express=require(_0x2764('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2764('0x5'));var controller=require(_0x2764('0x6'));router[_0x2764('0x7')]('/',auth[_0x2764('0x8')](),controller['index']);router[_0x2764('0x7')](_0x2764('0x9'),auth[_0x2764('0x8')](),controller[_0x2764('0xa')]);router['get'](_0x2764('0xb'),auth[_0x2764('0x8')](),controller[_0x2764('0xc')]);router[_0x2764('0x7')](_0x2764('0xd'),auth['isAuthenticated'](),controller[_0x2764('0xe')]);router[_0x2764('0xf')]('/',auth['isAuthenticated'](),controller[_0x2764('0x10')]);router[_0x2764('0xf')](_0x2764('0xb'),auth[_0x2764('0x8')](),controller[_0x2764('0x11')]);router[_0x2764('0x12')](_0x2764('0x9'),auth[_0x2764('0x8')](),controller[_0x2764('0x13')]);router[_0x2764('0x14')](_0x2764('0x9'),auth[_0x2764('0x8')](),controller[_0x2764('0x15')]);module[_0x2764('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 2cc10ed..0c3f735 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 _0x36f4=['integrationTab','sequelize','exports','STRING','ENUM','password','token'];(function(_0x40acca,_0x497442){var _0x3b0ce3=function(_0x3adea4){while(--_0x3adea4){_0x40acca['push'](_0x40acca['shift']());}};_0x3b0ce3(++_0x497442);}(_0x36f4,0x197));var _0x436f=function(_0x3ac8e6,_0x2c55a9){_0x3ac8e6=_0x3ac8e6-0x0;var _0x58c819=_0x36f4[_0x3ac8e6];return _0x58c819;};'use strict';var Sequelize=require(_0x436f('0x0'));module[_0x436f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x436f('0x2')]},'username':{'type':Sequelize[_0x436f('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x436f('0x2')]},'token':{'type':Sequelize[_0x436f('0x2')]},'remoteUri':{'type':Sequelize[_0x436f('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x436f('0x3')](_0x436f('0x4'),_0x436f('0x5')),'defaultValue':_0x436f('0x4')},'serverUrl':{'type':Sequelize[_0x436f('0x2')]},'type':{'type':Sequelize[_0x436f('0x3')](_0x436f('0x6'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xb9f0=['STRING','username','ENUM','password','integrationTab','sequelize','exports'];(function(_0x1b9db6,_0x227be9){var _0x704616=function(_0x167be8){while(--_0x167be8){_0x1b9db6['push'](_0x1b9db6['shift']());}};_0x704616(++_0x227be9);}(_0xb9f0,0xc2));var _0x0b9f=function(_0x47d060,_0x4a2b1d){_0x47d060=_0x47d060-0x0;var _0xb2d051=_0xb9f0[_0x47d060];return _0xb2d051;};'use strict';var Sequelize=require(_0x0b9f('0x0'));module[_0x0b9f('0x1')]={'name':{'type':Sequelize[_0x0b9f('0x2')]},'description':{'type':Sequelize[_0x0b9f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x0b9f('0x3')},'password':{'type':Sequelize[_0x0b9f('0x2')]},'token':{'type':Sequelize[_0x0b9f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x0b9f('0x4')](_0x0b9f('0x5'),'token'),'defaultValue':_0x0b9f('0x5')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x0b9f('0x6'),'newTab'),'defaultValue':_0x0b9f('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 14b69ae..5806e03 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 _0x616e=['Subjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','Basic\x20%s','%s:%s','toString','base64','headers','%s/token:%s','Unknown\x20authentication\x20type','group','assignee','includes','position','title','system_field_options','custom_field_options','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','then','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','filter','merge','options','include','findAll','rows','params','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','hasOwnProperty','addConfiguration','AccountId'];(function(_0x34986b,_0x56fb4a){var _0x28a0d1=function(_0x2c1e2a){while(--_0x2c1e2a){_0x34986b['push'](_0x34986b['shift']());}};_0x28a0d1(++_0x56fb4a);}(_0x616e,0x115));var _0xe616=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x616e[_0xdea41a];return _0x15d0d8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe616('0x0'));var rimraf=require(_0xe616('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe616('0x2'));var rp=require(_0xe616('0x3'));var moment=require(_0xe616('0x4'));var BPromise=require(_0xe616('0x5'));var Mustache=require('mustache');var util=require(_0xe616('0x6'));var path=require(_0xe616('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe616('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe616('0x9'));var crypto=require(_0xe616('0xa'));var jsforce=require(_0xe616('0xb'));var deskjs=require(_0xe616('0xc'));var toCsv=require(_0xe616('0xd'));var querystring=require(_0xe616('0xe'));var Papa=require(_0xe616('0xf'));var Redis=require(_0xe616('0x10'));var authService=require(_0xe616('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe616('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe616('0x13'))(_0xe616('0x14'));var utils=require(_0xe616('0x15'));var config=require(_0xe616('0x16'));var db=require(_0xe616('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe616('0x18'));var client=jayson[_0xe616('0x19')][_0xe616('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1cd0e0,_0x190c71,_0x3c3a19){if(_0x3c3a19){var _0x4616b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4616b2[_0xe616('0x1b')](_0x190c71)){return _0x1cd0e0;}else{throw new db[(_0xe616('0x1c'))][(_0xe616('0x1d'))]('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 _0x1cd0e0;}}function respondWithRpcPromise(_0x588641,_0x51b2cd,_0x1b1f27,_0x2aecc4){return new BPromise(function(_0x875a3b,_0x412579){var _0xb5b623=_0x2aecc4||client;return _0xb5b623['request'](_0x588641,_0x1b1f27)['then'](function(_0xc08413){logger['info'](_0xe616('0x1e'),_0x51b2cd,_0xe616('0x1f'));logger['debug'](_0xe616('0x20'),_0x51b2cd,_0xe616('0x1f'),JSON['stringify'](_0xc08413));if(_0xc08413[_0xe616('0x21')]){if(_0xc08413[_0xe616('0x21')][_0xe616('0x22')]===0x1f4){logger[_0xe616('0x21')](_0xe616('0x1e'),_0x51b2cd,_0xc08413[_0xe616('0x21')][_0xe616('0x23')]);return _0x412579(_0xc08413[_0xe616('0x21')][_0xe616('0x23')]);}logger['error'](_0xe616('0x1e'),_0x51b2cd,_0xc08413['error'][_0xe616('0x23')]);return _0x875a3b(_0xc08413[_0xe616('0x21')][_0xe616('0x23')]);}else{logger['info'](_0xe616('0x1e'),_0x51b2cd,_0xe616('0x1f'));_0x875a3b(_0xc08413[_0xe616('0x24')][_0xe616('0x23')]);}})[_0xe616('0x25')](function(_0x2aea9c){logger['error'](_0xe616('0x1e'),_0x51b2cd,_0x2aea9c);_0x412579(_0x2aea9c);});});}function respondWithStatusCode(_0x39480d,_0xf52535){_0xf52535=_0xf52535||0xcc;return function(_0x4d5432){if(_0x4d5432){return _0x39480d[_0xe616('0x26')](_0xf52535);}return _0x39480d[_0xe616('0x27')](_0xf52535)[_0xe616('0x28')]();};}function respondWithResult(_0x199691,_0x29321e){_0x29321e=_0x29321e||0xc8;return function(_0x54e114){if(_0x54e114){return _0x199691['status'](_0x29321e)[_0xe616('0x29')](_0x54e114);}};}function respondWithFilteredResult(_0x45b5da,_0x48b367){return function(_0x404fdc){if(_0x404fdc){var _0x4275d8=_0x404fdc[_0xe616('0x2a')],_0x6a4cd1=_0x48b367[_0xe616('0x2b')],_0xcd3810=_0x48b367[_0xe616('0x2b')]+_0x48b367['limit'],_0x42c2bc;if(_0xcd3810>=_0x4275d8){_0xcd3810=_0x4275d8;_0x42c2bc=0xc8;}else{_0x42c2bc=0xce;}_0x45b5da['status'](_0x42c2bc);return _0x45b5da[_0xe616('0x2c')]('Content-Range',_0x6a4cd1+'-'+_0xcd3810+'/'+_0x4275d8)[_0xe616('0x29')](_0x404fdc);}return null;};}function patchUpdates(_0x40388b){return function(_0x456dda){try{jsonpatch[_0xe616('0x2d')](_0x456dda,_0x40388b,!![]);}catch(_0xb3b07b){return BPromise[_0xe616('0x2e')](_0xb3b07b);}return _0x456dda[_0xe616('0x2f')]();};}function saveUpdates(_0x56261b,_0x5f0999){return function(_0x5ccb2f){if(_0x5ccb2f){return _0x5ccb2f['update'](_0x56261b)['then'](function(_0x51417c){return _0x51417c;});}return null;};}function removeEntity(_0x5eeede,_0x2f3e40){return function(_0x5a0918){if(_0x5a0918){return _0x5a0918[_0xe616('0x30')]()[_0xe616('0x31')](function(){_0x5eeede[_0xe616('0x27')](0xcc)[_0xe616('0x28')]();});}};}function handleEntityNotFound(_0x1cfad7,_0x3fcd93){return function(_0x33a832){if(!_0x33a832){_0x1cfad7[_0xe616('0x26')](0x194);}return _0x33a832;};}function handleError(_0x26f7b8,_0x19cdb0){_0x19cdb0=_0x19cdb0||0x1f4;return function(_0x13b102){logger[_0xe616('0x21')](_0x13b102[_0xe616('0x32')]);if(_0x13b102['name']){delete _0x13b102[_0xe616('0x33')];}_0x26f7b8[_0xe616('0x27')](_0x19cdb0)[_0xe616('0x34')](_0x13b102);};}exports[_0xe616('0x35')]=function(_0xab3f29,_0x1b3374){var _0x18df0c={},_0x5b582a={},_0x5e6bdb={'count':0x0,'rows':[]};var _0xacb688=_[_0xe616('0x36')](db[_0xe616('0x37')][_0xe616('0x38')],function(_0x5546a4){return{'name':_0x5546a4['fieldName'],'type':_0x5546a4[_0xe616('0x39')][_0xe616('0x3a')]};});_0x5b582a[_0xe616('0x3b')]=_[_0xe616('0x36')](_0xacb688,_0xe616('0x33'));_0x5b582a[_0xe616('0x3c')]=_[_0xe616('0x3d')](_0xab3f29[_0xe616('0x3c')]);_0x5b582a[_0xe616('0x3e')]=_[_0xe616('0x3f')](_0x5b582a[_0xe616('0x3b')],_0x5b582a[_0xe616('0x3c')]);_0x18df0c['attributes']=_[_0xe616('0x3f')](_0x5b582a['model'],qs[_0xe616('0x40')](_0xab3f29['query'][_0xe616('0x40')]));_0x18df0c[_0xe616('0x41')]=_0x18df0c[_0xe616('0x41')][_0xe616('0x42')]?_0x18df0c[_0xe616('0x41')]:_0x5b582a[_0xe616('0x3b')];if(!_0xab3f29[_0xe616('0x3c')]['hasOwnProperty'](_0xe616('0x43'))){_0x18df0c[_0xe616('0x44')]=qs[_0xe616('0x44')](_0xab3f29[_0xe616('0x3c')][_0xe616('0x44')]);_0x18df0c[_0xe616('0x2b')]=qs[_0xe616('0x2b')](_0xab3f29['query'][_0xe616('0x2b')]);}_0x18df0c['order']=qs['sort'](_0xab3f29[_0xe616('0x3c')][_0xe616('0x45')]);_0x18df0c[_0xe616('0x46')]=qs['filters'](_[_0xe616('0x47')](_0xab3f29[_0xe616('0x3c')],_0x5b582a[_0xe616('0x3e')]));if(_0xab3f29['query'][_0xe616('0x48')]){_0x18df0c[_0xe616('0x46')]=_['merge'](_0x18df0c['where'],{'$or':_[_0xe616('0x36')](_0xacb688,function(_0x894a92){if(_0x894a92[_0xe616('0x39')]!=='VIRTUAL'){var _0x36e881={};_0x36e881[_0x894a92[_0xe616('0x33')]]={'$like':'%'+_0xab3f29['query'][_0xe616('0x48')]+'%'};return _0x36e881;}})});}_0x18df0c=_[_0xe616('0x49')]({},_0x18df0c,_0xab3f29[_0xe616('0x4a')]);var _0x202a8d={'where':_0x18df0c[_0xe616('0x46')]};return db[_0xe616('0x37')][_0xe616('0x2a')](_0x202a8d)[_0xe616('0x31')](function(_0x193b12){_0x5e6bdb[_0xe616('0x2a')]=_0x193b12;if(_0xab3f29[_0xe616('0x3c')]['includeAll']){_0x18df0c[_0xe616('0x4b')]=[{'all':!![]}];}return db[_0xe616('0x37')][_0xe616('0x4c')](_0x18df0c);})['then'](function(_0x93ca25){_0x5e6bdb[_0xe616('0x4d')]=_0x93ca25;return _0x5e6bdb;})['then'](respondWithFilteredResult(_0x1b3374,_0x18df0c))['catch'](handleError(_0x1b3374,null));};exports['show']=function(_0x5871b9,_0x4c7533){var _0x154c34={'raw':![],'where':{'id':_0x5871b9[_0xe616('0x4e')]['id']}},_0x4b1917={};_0x4b1917[_0xe616('0x3b')]=_[_0xe616('0x3d')](db[_0xe616('0x37')][_0xe616('0x38')]);_0x4b1917[_0xe616('0x3c')]=_[_0xe616('0x3d')](_0x5871b9[_0xe616('0x3c')]);_0x4b1917['filters']=_['intersection'](_0x4b1917[_0xe616('0x3b')],_0x4b1917[_0xe616('0x3c')]);_0x154c34[_0xe616('0x41')]=_['intersection'](_0x4b1917[_0xe616('0x3b')],qs['fields'](_0x5871b9[_0xe616('0x3c')]['fields']));_0x154c34[_0xe616('0x41')]=_0x154c34['attributes'][_0xe616('0x42')]?_0x154c34[_0xe616('0x41')]:_0x4b1917[_0xe616('0x3b')];if(_0x5871b9[_0xe616('0x3c')]['includeAll']){_0x154c34[_0xe616('0x4b')]=[{'all':!![]}];}_0x154c34=_['merge']({},_0x154c34,_0x5871b9[_0xe616('0x4a')]);return db[_0xe616('0x37')]['find'](_0x154c34)[_0xe616('0x31')](handleEntityNotFound(_0x4c7533,null))['then'](respondWithResult(_0x4c7533,null))[_0xe616('0x25')](handleError(_0x4c7533,null));};exports[_0xe616('0x4f')]=function(_0x50341f,_0x305614){return db['ZendeskAccount'][_0xe616('0x4f')](_0x50341f[_0xe616('0x50')],{})[_0xe616('0x31')](respondWithResult(_0x305614,0xc9))[_0xe616('0x25')](handleError(_0x305614,null));};exports['update']=function(_0x26f5ab,_0x2b9dc5){if(_0x26f5ab[_0xe616('0x50')]['id']){delete _0x26f5ab[_0xe616('0x50')]['id'];}return db['ZendeskAccount'][_0xe616('0x51')]({'where':{'id':_0x26f5ab[_0xe616('0x4e')]['id']}})[_0xe616('0x31')](handleEntityNotFound(_0x2b9dc5,null))[_0xe616('0x31')](saveUpdates(_0x26f5ab[_0xe616('0x50')],null))[_0xe616('0x31')](respondWithResult(_0x2b9dc5,null))[_0xe616('0x25')](handleError(_0x2b9dc5,null));};exports[_0xe616('0x30')]=function(_0x424932,_0x28c28f){return db[_0xe616('0x37')][_0xe616('0x51')]({'where':{'id':_0x424932[_0xe616('0x4e')]['id']}})[_0xe616('0x31')](handleEntityNotFound(_0x28c28f,null))['then'](removeEntity(_0x28c28f,null))[_0xe616('0x25')](handleError(_0x28c28f,null));};exports[_0xe616('0x52')]=function(_0x3e4ccc,_0x508c3a,_0xf16e50){var _0xef551b={};var _0x959d5c={};var _0x58bc4d;var _0x282177;return db['ZendeskAccount'][_0xe616('0x53')]({'where':{'id':_0x3e4ccc[_0xe616('0x4e')]['id']}})[_0xe616('0x31')](handleEntityNotFound(_0x508c3a,null))[_0xe616('0x31')](function(_0x431e78){if(_0x431e78){_0x58bc4d=_0x431e78;_0x959d5c[_0xe616('0x3b')]=_[_0xe616('0x3d')](db[_0xe616('0x54')][_0xe616('0x38')]);_0x959d5c[_0xe616('0x3c')]=_['keys'](_0x3e4ccc[_0xe616('0x3c')]);_0x959d5c[_0xe616('0x3e')]=_[_0xe616('0x3f')](_0x959d5c[_0xe616('0x3b')],_0x959d5c[_0xe616('0x3c')]);_0xef551b[_0xe616('0x41')]=_[_0xe616('0x3f')](_0x959d5c[_0xe616('0x3b')],qs[_0xe616('0x40')](_0x3e4ccc[_0xe616('0x3c')][_0xe616('0x40')]));_0xef551b[_0xe616('0x41')]=_0xef551b[_0xe616('0x41')][_0xe616('0x42')]?_0xef551b[_0xe616('0x41')]:_0x959d5c[_0xe616('0x3b')];_0xef551b[_0xe616('0x55')]=qs[_0xe616('0x45')](_0x3e4ccc[_0xe616('0x3c')][_0xe616('0x45')]);_0xef551b[_0xe616('0x46')]=qs[_0xe616('0x3e')](_[_0xe616('0x47')](_0x3e4ccc[_0xe616('0x3c')],_0x959d5c[_0xe616('0x3e')]));if(_0x3e4ccc[_0xe616('0x3c')][_0xe616('0x48')]){_0xef551b[_0xe616('0x46')]=_[_0xe616('0x49')](_0xef551b[_0xe616('0x46')],{'$or':_[_0xe616('0x36')](_0xef551b['attributes'],function(_0x5c90f2){var _0x767e64={};_0x767e64[_0x5c90f2]={'$like':'%'+_0x3e4ccc[_0xe616('0x3c')]['filter']+'%'};return _0x767e64;})});}_0xef551b=_['merge']({},_0xef551b,_0x3e4ccc[_0xe616('0x4a')]);return _0x58bc4d[_0xe616('0x52')](_0xef551b);}})[_0xe616('0x31')](function(_0x1ceb68){if(_0x1ceb68){_0x282177=_0x1ceb68[_0xe616('0x42')];if(!_0x3e4ccc[_0xe616('0x3c')][_0xe616('0x56')]('nolimit')){_0xef551b[_0xe616('0x44')]=qs[_0xe616('0x44')](_0x3e4ccc[_0xe616('0x3c')][_0xe616('0x44')]);_0xef551b['offset']=qs[_0xe616('0x2b')](_0x3e4ccc[_0xe616('0x3c')][_0xe616('0x2b')]);}return _0x58bc4d[_0xe616('0x52')](_0xef551b);}})['then'](function(_0x2c69a6){if(_0x2c69a6){return _0x2c69a6?{'count':_0x282177,'rows':_0x2c69a6}:null;}})[_0xe616('0x31')](respondWithResult(_0x508c3a,null))[_0xe616('0x25')](handleError(_0x508c3a,null));};exports[_0xe616('0x57')]=function(_0x563f08,_0x242fa1,_0x1b231e){if(_0x563f08[_0xe616('0x50')]['id']){delete _0x563f08[_0xe616('0x50')]['id'];}return db[_0xe616('0x37')][_0xe616('0x53')]({'where':{'id':_0x563f08[_0xe616('0x4e')]['id']}})[_0xe616('0x31')](handleEntityNotFound(_0x242fa1,null))[_0xe616('0x31')](function(_0x402ffb){if(_0x402ffb){_0x563f08['body'][_0xe616('0x58')]=_0x402ffb['id'];_0x563f08[_0xe616('0x50')][_0xe616('0x59')]=integrations['getSubjects'](_0x563f08[_0xe616('0x50')][_0xe616('0x5a')],_0x563f08[_0xe616('0x50')]['type']);_0x563f08[_0xe616('0x50')]['Descriptions']=integrations['getDescriptions'](_0x563f08[_0xe616('0x50')]['channel'],_0x563f08[_0xe616('0x50')][_0xe616('0x39')]);return db[_0xe616('0x54')][_0xe616('0x4f')](_0x563f08[_0xe616('0x50')],{'include':[{'model':db['ZendeskField'],'as':_0xe616('0x59')},{'model':db[_0xe616('0x5b')],'as':_0xe616('0x5c')}]});}return null;})[_0xe616('0x31')](respondWithResult(_0x242fa1,null))['catch'](handleError(_0x242fa1,null));};exports[_0xe616('0x5d')]=function(_0x45e582,_0x595081,_0x3b2be4){var _0x5a64e5='';return db['ZendeskAccount'][_0xe616('0x53')]({'where':{'id':_0x45e582[_0xe616('0x4e')]['id']},'attributes':['id',_0xe616('0x5e'),_0xe616('0x5f'),_0xe616('0x60'),'authType',_0xe616('0x61')]})[_0xe616('0x31')](handleEntityNotFound(_0x595081,null))[_0xe616('0x31')](function(_0x5d53b0){if(_0x5d53b0){_0x5a64e5=_0x5d53b0[_0xe616('0x61')];var _0x58ba8c=_0x5a64e5[_0xe616('0x62')](-0x1);if(_0x58ba8c==='/'){_0x5a64e5=_0x5a64e5['substring'](0x0,_0x5a64e5[_0xe616('0x63')](_0x58ba8c));}var _0x1eabd0={'method':_0xe616('0x64'),'uri':util[_0xe616('0x65')](_0xe616('0x66'),_0x5a64e5,_0xe616('0x67')),'json':!![]};switch(_0x5d53b0[_0xe616('0x68')]){case _0xe616('0x5f'):_0x1eabd0['headers']={'Authorization':util['format'](_0xe616('0x69'),new Buffer(util[_0xe616('0x65')](_0xe616('0x6a'),_0x5d53b0['username'],_0x5d53b0[_0xe616('0x5f')]))[_0xe616('0x6b')](_0xe616('0x6c')))};break;case _0xe616('0x60'):_0x1eabd0[_0xe616('0x6d')]={'Authorization':util[_0xe616('0x65')](_0xe616('0x69'),new Buffer(util['format'](_0xe616('0x6e'),_0x5d53b0[_0xe616('0x5e')],_0x5d53b0['token']))[_0xe616('0x6b')]('base64'))};break;default:throw new db['Sequelize']['ValidationError'](_0xe616('0x6f'));}return rp(_0x1eabd0);}})[_0xe616('0x31')](function(_0x56db4e){if(_0x56db4e){var _0x5ef6fe=['subject','description',_0xe616('0x70'),_0xe616('0x71')];_['remove'](_0x56db4e[_0xe616('0x67')],function(_0x22c352){return _0x5ef6fe[_0xe616('0x72')](_0x22c352[_0xe616('0x39')]);});return{'count':_0x56db4e[_0xe616('0x67')][_0xe616('0x42')],'rows':_['map'](_0x56db4e[_0xe616('0x67')],function(_0x40117f){return{'id':_0x40117f['id'],'name':_0x40117f[_0xe616('0x73')]>0x7?_0x40117f[_0xe616('0x74')]:_0x40117f[_0xe616('0x39')],'custom':_0x40117f[_0xe616('0x73')]>0x7?!![]:![],'options':_0x40117f[_0xe616('0x75')]?_0x40117f[_0xe616('0x75')]:_0x40117f[_0xe616('0x76')]?_0x40117f[_0xe616('0x76')]:[]};})};}})[_0xe616('0x31')](respondWithResult(_0x595081,null))[_0xe616('0x25')](function(_0x22ce7c){var _0x45f399=_0x45e582['query'][_0xe616('0x1b')]?0x1f4:_0x22ce7c[_0xe616('0x77')]||0x1f4;logger[_0xe616('0x21')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x45f399,JSON[_0xe616('0x78')](_0x22ce7c));delete _0x22ce7c[_0xe616('0x33')];if(_0x45f399===0x191){_0x45f399=0x190;}_0x595081[_0xe616('0x27')](_0x45f399)[_0xe616('0x34')](_0x45e582[_0xe616('0x3c')][_0xe616('0x1b')]?{'message':_0xe616('0x79'),'statusCode':_0x22ce7c['statusCode']}:_0x22ce7c);});}; \ No newline at end of file +var _0x5465=['../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','jayson/promise','client','http','test','Sequelize','request','then','info','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','destroy','stack','name','ZendeskAccount','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','length','create','body','update','find','getConfigurations','findOne','ZendeskConfiguration','order','nolimit','addConfiguration','AccountId','getSubjects','getDescriptions','ZendeskField','Descriptions','getFields','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','password','base64','%s/token:%s','token','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x37d8ae,_0x17e484){var _0x4de500=function(_0x538a36){while(--_0x538a36){_0x37d8ae['push'](_0x37d8ae['shift']());}};_0x4de500(++_0x17e484);}(_0x5465,0x15d));var _0x5546=function(_0x5f17c4,_0x22645b){_0x5f17c4=_0x5f17c4-0x0;var _0x6ec0c2=_0x5465[_0x5f17c4];return _0x6ec0c2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5546('0x0'));var rimraf=require(_0x5546('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5546('0x2'));var moment=require(_0x5546('0x3'));var BPromise=require(_0x5546('0x4'));var Mustache=require(_0x5546('0x5'));var util=require(_0x5546('0x6'));var path=require(_0x5546('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5546('0x8'));var fs=require('fs');var _=require(_0x5546('0x9'));var squel=require(_0x5546('0xa'));var crypto=require(_0x5546('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5546('0xc'));var toCsv=require(_0x5546('0xd'));var querystring=require(_0x5546('0xe'));var Papa=require(_0x5546('0xf'));var Redis=require('ioredis');var authService=require(_0x5546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5546('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5546('0x12'))(_0x5546('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5546('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x5546('0x15'));var client=jayson[_0x5546('0x16')][_0x5546('0x17')]({'port':0x232a});function checkPasswordPattern(_0x31f30a,_0x455cfe,_0xf7b9dd){if(_0xf7b9dd){var _0x18b4d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18b4d0[_0x5546('0x18')](_0x455cfe)){return _0x31f30a;}else{throw new db[(_0x5546('0x19'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x31f30a;}}function respondWithRpcPromise(_0xda47e2,_0x55f509,_0x4824fe,_0x5a0eb7){return new BPromise(function(_0x54848c,_0x34cf2c){var _0x39796d=_0x5a0eb7||client;return _0x39796d[_0x5546('0x1a')](_0xda47e2,_0x4824fe)[_0x5546('0x1b')](function(_0x53ffa1){logger[_0x5546('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x55f509,_0x5546('0x1d'));logger['debug'](_0x5546('0x1e'),_0x55f509,_0x5546('0x1d'),JSON['stringify'](_0x53ffa1));if(_0x53ffa1[_0x5546('0x1f')]){if(_0x53ffa1[_0x5546('0x1f')][_0x5546('0x20')]===0x1f4){logger[_0x5546('0x1f')](_0x5546('0x21'),_0x55f509,_0x53ffa1[_0x5546('0x1f')][_0x5546('0x22')]);return _0x34cf2c(_0x53ffa1[_0x5546('0x1f')]['message']);}logger[_0x5546('0x1f')](_0x5546('0x21'),_0x55f509,_0x53ffa1[_0x5546('0x1f')]['message']);return _0x54848c(_0x53ffa1[_0x5546('0x1f')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x55f509,_0x5546('0x1d'));_0x54848c(_0x53ffa1['result'][_0x5546('0x22')]);}})[_0x5546('0x23')](function(_0x34cce1){logger['error'](_0x5546('0x21'),_0x55f509,_0x34cce1);_0x34cf2c(_0x34cce1);});});}function respondWithStatusCode(_0x328fe1,_0x4a0f7d){_0x4a0f7d=_0x4a0f7d||0xcc;return function(_0x186bb3){if(_0x186bb3){return _0x328fe1[_0x5546('0x24')](_0x4a0f7d);}return _0x328fe1['status'](_0x4a0f7d)[_0x5546('0x25')]();};}function respondWithResult(_0x1d520a,_0x2537b1){_0x2537b1=_0x2537b1||0xc8;return function(_0x23c47a){if(_0x23c47a){return _0x1d520a[_0x5546('0x26')](_0x2537b1)[_0x5546('0x27')](_0x23c47a);}};}function respondWithFilteredResult(_0x44ffd6,_0x397bbc){return function(_0x476a0e){if(_0x476a0e){var _0x402a9f=_0x476a0e[_0x5546('0x28')],_0xde5115=_0x397bbc[_0x5546('0x29')],_0x4fa8b2=_0x397bbc[_0x5546('0x29')]+_0x397bbc[_0x5546('0x2a')],_0x2803e3;if(_0x4fa8b2>=_0x402a9f){_0x4fa8b2=_0x402a9f;_0x2803e3=0xc8;}else{_0x2803e3=0xce;}_0x44ffd6[_0x5546('0x26')](_0x2803e3);return _0x44ffd6[_0x5546('0x2b')](_0x5546('0x2c'),_0xde5115+'-'+_0x4fa8b2+'/'+_0x402a9f)[_0x5546('0x27')](_0x476a0e);}return null;};}function patchUpdates(_0x475adc){return function(_0x4bf790){try{jsonpatch['apply'](_0x4bf790,_0x475adc,!![]);}catch(_0x349a07){return BPromise[_0x5546('0x2d')](_0x349a07);}return _0x4bf790['save']();};}function saveUpdates(_0x13bcec,_0x2c6641){return function(_0x3950dc){if(_0x3950dc){return _0x3950dc['update'](_0x13bcec)[_0x5546('0x1b')](function(_0x4892fb){return _0x4892fb;});}return null;};}function removeEntity(_0x4a833e,_0x485efe){return function(_0x5e8818){if(_0x5e8818){return _0x5e8818[_0x5546('0x2e')]()['then'](function(){_0x4a833e['status'](0xcc)[_0x5546('0x25')]();});}};}function handleEntityNotFound(_0xecc49e,_0x1698d3){return function(_0xea1935){if(!_0xea1935){_0xecc49e[_0x5546('0x24')](0x194);}return _0xea1935;};}function handleError(_0x2865bd,_0x1d1997){_0x1d1997=_0x1d1997||0x1f4;return function(_0x3822ae){logger[_0x5546('0x1f')](_0x3822ae[_0x5546('0x2f')]);if(_0x3822ae['name']){delete _0x3822ae[_0x5546('0x30')];}_0x2865bd['status'](_0x1d1997)['send'](_0x3822ae);};}exports['index']=function(_0xe192db,_0x244c0f){var _0x2ac688={},_0x6a11da={},_0x3cfa04={'count':0x0,'rows':[]};var _0x592e36=_['map'](db[_0x5546('0x31')][_0x5546('0x32')],function(_0x353eb3){return{'name':_0x353eb3[_0x5546('0x33')],'type':_0x353eb3[_0x5546('0x34')]['key']};});_0x6a11da[_0x5546('0x35')]=_[_0x5546('0x36')](_0x592e36,'name');_0x6a11da[_0x5546('0x37')]=_[_0x5546('0x38')](_0xe192db['query']);_0x6a11da['filters']=_[_0x5546('0x39')](_0x6a11da[_0x5546('0x35')],_0x6a11da[_0x5546('0x37')]);_0x2ac688[_0x5546('0x3a')]=_[_0x5546('0x39')](_0x6a11da['model'],qs[_0x5546('0x3b')](_0xe192db[_0x5546('0x37')][_0x5546('0x3b')]));_0x2ac688[_0x5546('0x3a')]=_0x2ac688['attributes']['length']?_0x2ac688['attributes']:_0x6a11da[_0x5546('0x35')];if(!_0xe192db[_0x5546('0x37')][_0x5546('0x3c')]('nolimit')){_0x2ac688[_0x5546('0x2a')]=qs[_0x5546('0x2a')](_0xe192db[_0x5546('0x37')]['limit']);_0x2ac688['offset']=qs[_0x5546('0x29')](_0xe192db[_0x5546('0x37')][_0x5546('0x29')]);}_0x2ac688['order']=qs[_0x5546('0x3d')](_0xe192db['query']['sort']);_0x2ac688[_0x5546('0x3e')]=qs[_0x5546('0x3f')](_[_0x5546('0x40')](_0xe192db[_0x5546('0x37')],_0x6a11da[_0x5546('0x3f')]));if(_0xe192db[_0x5546('0x37')][_0x5546('0x41')]){_0x2ac688[_0x5546('0x3e')]=_[_0x5546('0x42')](_0x2ac688['where'],{'$or':_[_0x5546('0x36')](_0x592e36,function(_0xca58cc){if(_0xca58cc['type']!==_0x5546('0x43')){var _0x34cccc={};_0x34cccc[_0xca58cc[_0x5546('0x30')]]={'$like':'%'+_0xe192db[_0x5546('0x37')][_0x5546('0x41')]+'%'};return _0x34cccc;}})});}_0x2ac688=_[_0x5546('0x42')]({},_0x2ac688,_0xe192db[_0x5546('0x44')]);var _0x4e41eb={'where':_0x2ac688[_0x5546('0x3e')]};return db['ZendeskAccount'][_0x5546('0x28')](_0x4e41eb)[_0x5546('0x1b')](function(_0x17531e){_0x3cfa04[_0x5546('0x28')]=_0x17531e;if(_0xe192db[_0x5546('0x37')]['includeAll']){_0x2ac688[_0x5546('0x45')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x5546('0x46')](_0x2ac688);})[_0x5546('0x1b')](function(_0x4e3ec3){_0x3cfa04['rows']=_0x4e3ec3;return _0x3cfa04;})[_0x5546('0x1b')](respondWithFilteredResult(_0x244c0f,_0x2ac688))[_0x5546('0x23')](handleError(_0x244c0f,null));};exports[_0x5546('0x47')]=function(_0x3e8d60,_0x4b326e){var _0x2e301e={'raw':![],'where':{'id':_0x3e8d60[_0x5546('0x48')]['id']}},_0x57e926={};_0x57e926[_0x5546('0x35')]=_[_0x5546('0x38')](db[_0x5546('0x31')][_0x5546('0x32')]);_0x57e926[_0x5546('0x37')]=_[_0x5546('0x38')](_0x3e8d60[_0x5546('0x37')]);_0x57e926[_0x5546('0x3f')]=_[_0x5546('0x39')](_0x57e926[_0x5546('0x35')],_0x57e926[_0x5546('0x37')]);_0x2e301e[_0x5546('0x3a')]=_[_0x5546('0x39')](_0x57e926[_0x5546('0x35')],qs[_0x5546('0x3b')](_0x3e8d60['query']['fields']));_0x2e301e[_0x5546('0x3a')]=_0x2e301e[_0x5546('0x3a')][_0x5546('0x49')]?_0x2e301e[_0x5546('0x3a')]:_0x57e926[_0x5546('0x35')];if(_0x3e8d60['query']['includeAll']){_0x2e301e['include']=[{'all':!![]}];}_0x2e301e=_[_0x5546('0x42')]({},_0x2e301e,_0x3e8d60[_0x5546('0x44')]);return db[_0x5546('0x31')]['find'](_0x2e301e)[_0x5546('0x1b')](handleEntityNotFound(_0x4b326e,null))['then'](respondWithResult(_0x4b326e,null))['catch'](handleError(_0x4b326e,null));};exports[_0x5546('0x4a')]=function(_0x59d90d,_0x72070c){return db['ZendeskAccount'][_0x5546('0x4a')](_0x59d90d[_0x5546('0x4b')],{})[_0x5546('0x1b')](respondWithResult(_0x72070c,0xc9))[_0x5546('0x23')](handleError(_0x72070c,null));};exports[_0x5546('0x4c')]=function(_0x1c96eb,_0x3baa68){if(_0x1c96eb[_0x5546('0x4b')]['id']){delete _0x1c96eb[_0x5546('0x4b')]['id'];}return db[_0x5546('0x31')]['find']({'where':{'id':_0x1c96eb[_0x5546('0x48')]['id']}})[_0x5546('0x1b')](handleEntityNotFound(_0x3baa68,null))['then'](saveUpdates(_0x1c96eb[_0x5546('0x4b')],null))[_0x5546('0x1b')](respondWithResult(_0x3baa68,null))[_0x5546('0x23')](handleError(_0x3baa68,null));};exports[_0x5546('0x2e')]=function(_0x26fd0a,_0x1061e4){return db['ZendeskAccount'][_0x5546('0x4d')]({'where':{'id':_0x26fd0a[_0x5546('0x48')]['id']}})[_0x5546('0x1b')](handleEntityNotFound(_0x1061e4,null))[_0x5546('0x1b')](removeEntity(_0x1061e4,null))[_0x5546('0x23')](handleError(_0x1061e4,null));};exports[_0x5546('0x4e')]=function(_0x3b89f5,_0x1334c4,_0x582dc6){var _0x54aeba={};var _0x3764f3={};var _0x3d5b6a;var _0xabd33a;return db[_0x5546('0x31')][_0x5546('0x4f')]({'where':{'id':_0x3b89f5[_0x5546('0x48')]['id']}})[_0x5546('0x1b')](handleEntityNotFound(_0x1334c4,null))[_0x5546('0x1b')](function(_0x34aeea){if(_0x34aeea){_0x3d5b6a=_0x34aeea;_0x3764f3[_0x5546('0x35')]=_[_0x5546('0x38')](db[_0x5546('0x50')][_0x5546('0x32')]);_0x3764f3['query']=_[_0x5546('0x38')](_0x3b89f5['query']);_0x3764f3['filters']=_['intersection'](_0x3764f3[_0x5546('0x35')],_0x3764f3[_0x5546('0x37')]);_0x54aeba[_0x5546('0x3a')]=_[_0x5546('0x39')](_0x3764f3[_0x5546('0x35')],qs[_0x5546('0x3b')](_0x3b89f5[_0x5546('0x37')][_0x5546('0x3b')]));_0x54aeba[_0x5546('0x3a')]=_0x54aeba[_0x5546('0x3a')][_0x5546('0x49')]?_0x54aeba[_0x5546('0x3a')]:_0x3764f3[_0x5546('0x35')];_0x54aeba[_0x5546('0x51')]=qs[_0x5546('0x3d')](_0x3b89f5[_0x5546('0x37')][_0x5546('0x3d')]);_0x54aeba[_0x5546('0x3e')]=qs[_0x5546('0x3f')](_[_0x5546('0x40')](_0x3b89f5[_0x5546('0x37')],_0x3764f3[_0x5546('0x3f')]));if(_0x3b89f5[_0x5546('0x37')][_0x5546('0x41')]){_0x54aeba[_0x5546('0x3e')]=_[_0x5546('0x42')](_0x54aeba['where'],{'$or':_[_0x5546('0x36')](_0x54aeba[_0x5546('0x3a')],function(_0x1d1ec6){var _0x4d6597={};_0x4d6597[_0x1d1ec6]={'$like':'%'+_0x3b89f5[_0x5546('0x37')][_0x5546('0x41')]+'%'};return _0x4d6597;})});}_0x54aeba=_['merge']({},_0x54aeba,_0x3b89f5[_0x5546('0x44')]);return _0x3d5b6a[_0x5546('0x4e')](_0x54aeba);}})['then'](function(_0x477c8b){if(_0x477c8b){_0xabd33a=_0x477c8b[_0x5546('0x49')];if(!_0x3b89f5['query'][_0x5546('0x3c')](_0x5546('0x52'))){_0x54aeba['limit']=qs[_0x5546('0x2a')](_0x3b89f5[_0x5546('0x37')][_0x5546('0x2a')]);_0x54aeba[_0x5546('0x29')]=qs[_0x5546('0x29')](_0x3b89f5[_0x5546('0x37')][_0x5546('0x29')]);}return _0x3d5b6a[_0x5546('0x4e')](_0x54aeba);}})[_0x5546('0x1b')](function(_0x477500){if(_0x477500){return _0x477500?{'count':_0xabd33a,'rows':_0x477500}:null;}})[_0x5546('0x1b')](respondWithResult(_0x1334c4,null))['catch'](handleError(_0x1334c4,null));};exports[_0x5546('0x53')]=function(_0x3a28b1,_0x3c78a8,_0x2df28d){if(_0x3a28b1[_0x5546('0x4b')]['id']){delete _0x3a28b1[_0x5546('0x4b')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x3a28b1[_0x5546('0x48')]['id']}})[_0x5546('0x1b')](handleEntityNotFound(_0x3c78a8,null))['then'](function(_0x11d3d5){if(_0x11d3d5){_0x3a28b1[_0x5546('0x4b')][_0x5546('0x54')]=_0x11d3d5['id'];_0x3a28b1[_0x5546('0x4b')]['Subjects']=integrations[_0x5546('0x55')](_0x3a28b1[_0x5546('0x4b')]['channel'],_0x3a28b1[_0x5546('0x4b')][_0x5546('0x34')]);_0x3a28b1[_0x5546('0x4b')]['Descriptions']=integrations[_0x5546('0x56')](_0x3a28b1[_0x5546('0x4b')]['channel'],_0x3a28b1['body'][_0x5546('0x34')]);return db[_0x5546('0x50')][_0x5546('0x4a')](_0x3a28b1['body'],{'include':[{'model':db[_0x5546('0x57')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x5546('0x58')}]});}return null;})[_0x5546('0x1b')](respondWithResult(_0x3c78a8,null))[_0x5546('0x23')](handleError(_0x3c78a8,null));};exports[_0x5546('0x59')]=function(_0x28fad2,_0x30aeaf,_0x52f77e){var _0x53c944='';return db['ZendeskAccount'][_0x5546('0x4f')]({'where':{'id':_0x28fad2[_0x5546('0x48')]['id']},'attributes':['id','username','password','token',_0x5546('0x5a'),_0x5546('0x5b')]})[_0x5546('0x1b')](handleEntityNotFound(_0x30aeaf,null))[_0x5546('0x1b')](function(_0xabb0e4){if(_0xabb0e4){_0x53c944=_0xabb0e4[_0x5546('0x5b')];var _0x12d67b=_0x53c944[_0x5546('0x5c')](-0x1);if(_0x12d67b==='/'){_0x53c944=_0x53c944[_0x5546('0x5d')](0x0,_0x53c944[_0x5546('0x5e')](_0x12d67b));}var _0x4c218f={'method':_0x5546('0x5f'),'uri':util[_0x5546('0x60')](_0x5546('0x61'),_0x53c944,_0x5546('0x62')),'json':!![]};switch(_0xabb0e4[_0x5546('0x5a')]){case'password':_0x4c218f[_0x5546('0x63')]={'Authorization':util[_0x5546('0x60')](_0x5546('0x64'),new Buffer(util[_0x5546('0x60')](_0x5546('0x65'),_0xabb0e4[_0x5546('0x66')],_0xabb0e4[_0x5546('0x67')]))['toString'](_0x5546('0x68')))};break;case'token':_0x4c218f[_0x5546('0x63')]={'Authorization':util[_0x5546('0x60')](_0x5546('0x64'),new Buffer(util['format'](_0x5546('0x69'),_0xabb0e4[_0x5546('0x66')],_0xabb0e4[_0x5546('0x6a')]))['toString'](_0x5546('0x68')))};break;default:throw new db['Sequelize'][(_0x5546('0x6b'))](_0x5546('0x6c'));}return rp(_0x4c218f);}})[_0x5546('0x1b')](function(_0x1ba229){if(_0x1ba229){var _0xa25a85=[_0x5546('0x6d'),_0x5546('0x6e'),_0x5546('0x6f'),_0x5546('0x70')];_[_0x5546('0x71')](_0x1ba229[_0x5546('0x62')],function(_0x380ff1){return _0xa25a85[_0x5546('0x72')](_0x380ff1[_0x5546('0x34')]);});return{'count':_0x1ba229[_0x5546('0x62')][_0x5546('0x49')],'rows':_[_0x5546('0x36')](_0x1ba229[_0x5546('0x62')],function(_0x3e5986){return{'id':_0x3e5986['id'],'name':_0x3e5986[_0x5546('0x73')]>0x7?_0x3e5986['title']:_0x3e5986[_0x5546('0x34')],'custom':_0x3e5986[_0x5546('0x73')]>0x7?!![]:![],'options':_0x3e5986[_0x5546('0x74')]?_0x3e5986[_0x5546('0x74')]:_0x3e5986[_0x5546('0x75')]?_0x3e5986[_0x5546('0x75')]:[]};})};}})[_0x5546('0x1b')](respondWithResult(_0x30aeaf,null))[_0x5546('0x23')](function(_0x32c141){var _0x481b0d=_0x28fad2[_0x5546('0x37')][_0x5546('0x18')]?0x1f4:_0x32c141[_0x5546('0x76')]||0x1f4;logger[_0x5546('0x1f')](_0x5546('0x77'),_0x5546('0x59'),_0x481b0d,JSON['stringify'](_0x32c141));delete _0x32c141[_0x5546('0x30')];if(_0x481b0d===0x191){_0x481b0d=0x190;}_0x30aeaf[_0x5546('0x26')](_0x481b0d)[_0x5546('0x78')](_0x28fad2[_0x5546('0x37')][_0x5546('0x18')]?{'message':_0x5546('0x79'),'statusCode':_0x32c141[_0x5546('0x76')]}:_0x32c141);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4e19907..9bae69f 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 _0x9744=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x45e45d,_0x54d7f6){var _0x1e0581=function(_0x27a9f4){while(--_0x27a9f4){_0x45e45d['push'](_0x45e45d['shift']());}};_0x1e0581(++_0x54d7f6);}(_0x9744,0x143));var _0x4974=function(_0x5942c0,_0x1ac5a8){_0x5942c0=_0x5942c0-0x0;var _0x433257=_0x9744[_0x5942c0];return _0x433257;};'use strict';var _=require(_0x4974('0x0'));var util=require(_0x4974('0x1'));var logger=require(_0x4974('0x2'))(_0x4974('0x3'));var moment=require(_0x4974('0x4'));var BPromise=require(_0x4974('0x5'));var rp=require(_0x4974('0x6'));var fs=require('fs');var path=require(_0x4974('0x7'));var rimraf=require(_0x4974('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4974('0x9')]=function(_0x10f55a,_0x5f1485){return _0x10f55a[_0x4974('0xa')](_0x4974('0xb'),attributes,{'tableName':_0x4974('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59c4=['rimraf','./intZendeskAccount.attributes','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x423161,_0x2f21b0){var _0x280d7d=function(_0x31adde){while(--_0x31adde){_0x423161['push'](_0x423161['shift']());}};_0x280d7d(++_0x2f21b0);}(_0x59c4,0x10d));var _0x459c=function(_0x16f475,_0x3dad5e){_0x16f475=_0x16f475-0x0;var _0x1b8fc5=_0x59c4[_0x16f475];return _0x1b8fc5;};'use strict';var _=require(_0x459c('0x0'));var util=require('util');var logger=require(_0x459c('0x1'))(_0x459c('0x2'));var moment=require(_0x459c('0x3'));var BPromise=require(_0x459c('0x4'));var rp=require(_0x459c('0x5'));var fs=require('fs');var path=require(_0x459c('0x6'));var rimraf=require(_0x459c('0x7'));var config=require('../../config/environment');var attributes=require(_0x459c('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x560f11,_0x5e5845){return _0x560f11[_0x459c('0x9')](_0x459c('0xa'),attributes,{'tableName':_0x459c('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 e55781e..1dc562a 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 _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xcb91[_0x5ce3c8];return _0xa76867;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file +var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xcb91[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 83138de..6c3b1c3 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 _0x81f2=['Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1d0f74,_0x46bc6c){var _0x5ef5eb=function(_0x27c8e8){while(--_0x27c8e8){_0x1d0f74['push'](_0x1d0f74['shift']());}};_0x5ef5eb(++_0x46bc6c);}(_0x81f2,0x10e));var _0x281f=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x81f2[_0x1c6089];return _0x4d97c1;};'use strict';var multer=require(_0x281f('0x0'));var util=require(_0x281f('0x1'));var path=require(_0x281f('0x2'));var timeout=require(_0x281f('0x3'));var express=require(_0x281f('0x4'));var router=express[_0x281f('0x5')]();var auth=require(_0x281f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x281f('0x7'));var controller=require(_0x281f('0x8'));router[_0x281f('0x9')]('/',auth[_0x281f('0xa')](),controller[_0x281f('0xb')]);router[_0x281f('0x9')](_0x281f('0xc'),auth['isAuthenticated'](),controller[_0x281f('0xd')]);router[_0x281f('0x9')](_0x281f('0xe'),auth[_0x281f('0xa')](),controller['getFields']);router[_0x281f('0x9')](_0x281f('0xf'),auth[_0x281f('0xa')](),controller['getSubjects']);router[_0x281f('0x9')]('/:id/descriptions',auth[_0x281f('0xa')](),controller['getDescriptions']);router[_0x281f('0x9')](_0x281f('0x10'),auth[_0x281f('0xa')](),controller[_0x281f('0x11')]);router[_0x281f('0x12')]('/',auth[_0x281f('0xa')](),controller[_0x281f('0x13')]);router[_0x281f('0x12')](_0x281f('0x10'),auth[_0x281f('0xa')](),controller[_0x281f('0x14')]);router[_0x281f('0x15')](_0x281f('0xc'),auth[_0x281f('0xa')](),controller[_0x281f('0x16')]);router[_0x281f('0x17')](_0x281f('0xc'),auth[_0x281f('0xa')](),controller[_0x281f('0x18')]);module['exports']=router; \ No newline at end of file +var _0x7a22=['/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index'];(function(_0x5609a6,_0x3b4833){var _0x8a8362=function(_0x2934f3){while(--_0x2934f3){_0x5609a6['push'](_0x5609a6['shift']());}};_0x8a8362(++_0x3b4833);}(_0x7a22,0xab));var _0x27a2=function(_0x1e6167,_0x4b514c){_0x1e6167=_0x1e6167-0x0;var _0x20eab0=_0x7a22[_0x1e6167];return _0x20eab0;};'use strict';var multer=require(_0x27a2('0x0'));var util=require('util');var path=require(_0x27a2('0x1'));var timeout=require(_0x27a2('0x2'));var express=require('express');var router=express[_0x27a2('0x3')]();var auth=require(_0x27a2('0x4'));var interaction=require(_0x27a2('0x5'));var config=require(_0x27a2('0x6'));var controller=require(_0x27a2('0x7'));router[_0x27a2('0x8')]('/',auth[_0x27a2('0x9')](),controller[_0x27a2('0xa')]);router['get'](_0x27a2('0xb'),auth[_0x27a2('0x9')](),controller[_0x27a2('0xc')]);router[_0x27a2('0x8')](_0x27a2('0xd'),auth[_0x27a2('0x9')](),controller[_0x27a2('0xe')]);router['get']('/:id/subjects',auth[_0x27a2('0x9')](),controller['getSubjects']);router[_0x27a2('0x8')](_0x27a2('0xf'),auth['isAuthenticated'](),controller[_0x27a2('0x10')]);router['get'](_0x27a2('0x11'),auth[_0x27a2('0x9')](),controller[_0x27a2('0x12')]);router['post']('/',auth[_0x27a2('0x9')](),controller[_0x27a2('0x13')]);router[_0x27a2('0x14')](_0x27a2('0x11'),auth['isAuthenticated'](),controller[_0x27a2('0x15')]);router[_0x27a2('0x16')](_0x27a2('0xb'),auth[_0x27a2('0x9')](),controller[_0x27a2('0x17')]);router[_0x27a2('0x18')](_0x27a2('0xb'),auth[_0x27a2('0x9')](),controller[_0x27a2('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 68f6f9e..7514db3 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 _0x6f98=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f98,0xa0));var _0x86f9=function(_0x58d0a4,_0x222f74){_0x58d0a4=_0x58d0a4-0x0;var _0x539bcc=_0x6f98[_0x58d0a4];return _0x539bcc;};'use strict';var Sequelize=require(_0x86f9('0x0'));module[_0x86f9('0x1')]={'name':{'type':Sequelize[_0x86f9('0x2')]},'description':{'type':Sequelize[_0x86f9('0x2')]}}; \ No newline at end of file +var _0x4852=['sequelize','STRING'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0x4852,0xae));var _0x2485=function(_0x1d48bb,_0x16064e){_0x1d48bb=_0x1d48bb-0x0;var _0x377fac=_0x4852[_0x1d48bb];return _0x377fac;};'use strict';var Sequelize=require(_0x2485('0x0'));module['exports']={'name':{'type':Sequelize[_0x2485('0x1')]},'description':{'type':Sequelize[_0x2485('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b5ba6f6..be961d2 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 _0x5fc3=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','http','test','Sequelize','request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','ZendeskConfiguration','includeAll','findAll','params','include','find','create','body','getFields','findOne','rawAttributes','pick','getSubjects','ZendeskField','getDescriptions','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x118ea9,_0x290a20){var _0x508b56=function(_0x309ae8){while(--_0x309ae8){_0x118ea9['push'](_0x118ea9['shift']());}};_0x508b56(++_0x290a20);}(_0x5fc3,0xa8));var _0x35fc=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x5fc3[_0x9d1e6b];return _0x2b3070;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var as=require(_0x35fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x14'))(_0x35fc('0x15'));var utils=require('../../config/utils');var config=require(_0x35fc('0x16'));var db=require(_0x35fc('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x35fc('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5d462a,_0x397738,_0x22055e){if(_0x22055e){var _0x2a6ad2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a6ad2[_0x35fc('0x19')](_0x397738)){return _0x5d462a;}else{throw new db[(_0x35fc('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d462a;}}function respondWithRpcPromise(_0x5eac0f,_0x558364,_0x398b67,_0x229d56){return new BPromise(function(_0x53b898,_0x154958){var _0x227a49=_0x229d56||client;return _0x227a49[_0x35fc('0x1b')](_0x5eac0f,_0x398b67)['then'](function(_0x26ba54){logger[_0x35fc('0x1c')]('ZendeskConfiguration,\x20%s,\x20%s',_0x558364,_0x35fc('0x1d'));logger[_0x35fc('0x1e')](_0x35fc('0x1f'),_0x558364,'request\x20sent',JSON[_0x35fc('0x20')](_0x26ba54));if(_0x26ba54[_0x35fc('0x21')]){if(_0x26ba54[_0x35fc('0x21')]['code']===0x1f4){logger[_0x35fc('0x21')](_0x35fc('0x22'),_0x558364,_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);return _0x154958(_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);}logger[_0x35fc('0x21')](_0x35fc('0x22'),_0x558364,_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);return _0x53b898(_0x26ba54['error'][_0x35fc('0x23')]);}else{logger[_0x35fc('0x1c')](_0x35fc('0x22'),_0x558364,_0x35fc('0x1d'));_0x53b898(_0x26ba54[_0x35fc('0x24')]['message']);}})[_0x35fc('0x25')](function(_0x4c587a){logger['error'](_0x35fc('0x22'),_0x558364,_0x4c587a);_0x154958(_0x4c587a);});});}function respondWithStatusCode(_0x5a93df,_0x3d4a98){_0x3d4a98=_0x3d4a98||0xcc;return function(_0x51cfec){if(_0x51cfec){return _0x5a93df[_0x35fc('0x26')](_0x3d4a98);}return _0x5a93df['status'](_0x3d4a98)[_0x35fc('0x27')]();};}function respondWithResult(_0xdfab9f,_0x5cb986){_0x5cb986=_0x5cb986||0xc8;return function(_0x519264){if(_0x519264){return _0xdfab9f[_0x35fc('0x28')](_0x5cb986)['json'](_0x519264);}};}function respondWithFilteredResult(_0x274208,_0x1a5d92){return function(_0x57001c){if(_0x57001c){var _0x26b7cb=_0x57001c[_0x35fc('0x29')],_0x645eac=_0x1a5d92[_0x35fc('0x2a')],_0x383837=_0x1a5d92[_0x35fc('0x2a')]+_0x1a5d92[_0x35fc('0x2b')],_0x9f3c8a;if(_0x383837>=_0x26b7cb){_0x383837=_0x26b7cb;_0x9f3c8a=0xc8;}else{_0x9f3c8a=0xce;}_0x274208['status'](_0x9f3c8a);return _0x274208[_0x35fc('0x2c')](_0x35fc('0x2d'),_0x645eac+'-'+_0x383837+'/'+_0x26b7cb)[_0x35fc('0x2e')](_0x57001c);}return null;};}function patchUpdates(_0x52acc5){return function(_0xe79f52){try{jsonpatch[_0x35fc('0x2f')](_0xe79f52,_0x52acc5,!![]);}catch(_0x3822a8){return BPromise[_0x35fc('0x30')](_0x3822a8);}return _0xe79f52[_0x35fc('0x31')]();};}function saveUpdates(_0x103181,_0x222ddb){return function(_0x37b435){if(_0x37b435){return _0x37b435[_0x35fc('0x32')](_0x103181)[_0x35fc('0x33')](function(_0x57072d){return _0x57072d;});}return null;};}function removeEntity(_0x5e0313,_0x114bc1){return function(_0x4af5fe){if(_0x4af5fe){return _0x4af5fe[_0x35fc('0x34')]()[_0x35fc('0x33')](function(){_0x5e0313[_0x35fc('0x28')](0xcc)[_0x35fc('0x27')]();});}};}function handleEntityNotFound(_0x271ba9,_0x12e78f){return function(_0x4e43b4){if(!_0x4e43b4){_0x271ba9[_0x35fc('0x26')](0x194);}return _0x4e43b4;};}function handleError(_0x330a14,_0x46b9ef){_0x46b9ef=_0x46b9ef||0x1f4;return function(_0x4441d8){logger[_0x35fc('0x21')](_0x4441d8[_0x35fc('0x35')]);if(_0x4441d8['name']){delete _0x4441d8[_0x35fc('0x36')];}_0x330a14[_0x35fc('0x28')](_0x46b9ef)[_0x35fc('0x37')](_0x4441d8);};}exports['index']=function(_0x2c657d,_0x48d223){var _0x2ecb2e={},_0x33a377={},_0x266a11={'count':0x0,'rows':[]};var _0x2e00e3=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x20f5fe){return{'name':_0x20f5fe['fieldName'],'type':_0x20f5fe[_0x35fc('0x38')]['key']};});_0x33a377[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x2e00e3,_0x35fc('0x36'));_0x33a377[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x2c657d[_0x35fc('0x3b')]);_0x33a377[_0x35fc('0x3d')]=_['intersection'](_0x33a377[_0x35fc('0x39')],_0x33a377[_0x35fc('0x3b')]);_0x2ecb2e['attributes']=_[_0x35fc('0x3e')](_0x33a377[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x2ecb2e[_0x35fc('0x40')]=_0x2ecb2e['attributes'][_0x35fc('0x41')]?_0x2ecb2e[_0x35fc('0x40')]:_0x33a377[_0x35fc('0x39')];if(!_0x2c657d['query'][_0x35fc('0x42')](_0x35fc('0x43'))){_0x2ecb2e['limit']=qs[_0x35fc('0x2b')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x2ecb2e[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x2a')]);}_0x2ecb2e[_0x35fc('0x44')]=qs['sort'](_0x2c657d['query'][_0x35fc('0x45')]);_0x2ecb2e[_0x35fc('0x46')]=qs['filters'](_['pick'](_0x2c657d['query'],_0x33a377[_0x35fc('0x3d')]));if(_0x2c657d[_0x35fc('0x3b')]['filter']){_0x2ecb2e[_0x35fc('0x46')]=_[_0x35fc('0x47')](_0x2ecb2e[_0x35fc('0x46')],{'$or':_[_0x35fc('0x3a')](_0x2e00e3,function(_0x5c52be){if(_0x5c52be['type']!=='VIRTUAL'){var _0x539157={};_0x539157[_0x5c52be['name']]={'$like':'%'+_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x539157;}})});}_0x2ecb2e=_['merge']({},_0x2ecb2e,_0x2c657d[_0x35fc('0x49')]);var _0x56cf1f={'where':_0x2ecb2e[_0x35fc('0x46')]};return db[_0x35fc('0x4a')][_0x35fc('0x29')](_0x56cf1f)[_0x35fc('0x33')](function(_0x16f7c8){_0x266a11['count']=_0x16f7c8;if(_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x4b')]){_0x2ecb2e['include']=[{'all':!![]}];}return db[_0x35fc('0x4a')][_0x35fc('0x4c')](_0x2ecb2e);})[_0x35fc('0x33')](function(_0x211746){_0x266a11['rows']=_0x211746;return _0x266a11;})[_0x35fc('0x33')](respondWithFilteredResult(_0x48d223,_0x2ecb2e))['catch'](handleError(_0x48d223,null));};exports['show']=function(_0x1b6160,_0x9db7e8){var _0x18dc78={'raw':![],'where':{'id':_0x1b6160[_0x35fc('0x4d')]['id']}},_0xca8aef={};_0xca8aef[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x4a')]['rawAttributes']);_0xca8aef[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x1b6160[_0x35fc('0x3b')]);_0xca8aef[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0xca8aef[_0x35fc('0x39')],_0xca8aef[_0x35fc('0x3b')]);_0x18dc78[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0xca8aef[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x1b6160[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x18dc78[_0x35fc('0x40')]=_0x18dc78['attributes']['length']?_0x18dc78[_0x35fc('0x40')]:_0xca8aef[_0x35fc('0x39')];if(_0x1b6160[_0x35fc('0x3b')][_0x35fc('0x4b')]){_0x18dc78[_0x35fc('0x4e')]=[{'all':!![]}];}_0x18dc78=_[_0x35fc('0x47')]({},_0x18dc78,_0x1b6160['options']);return db['ZendeskConfiguration'][_0x35fc('0x4f')](_0x18dc78)[_0x35fc('0x33')](handleEntityNotFound(_0x9db7e8,null))[_0x35fc('0x33')](respondWithResult(_0x9db7e8,null))[_0x35fc('0x25')](handleError(_0x9db7e8,null));};exports['create']=function(_0x467980,_0x13281f){return db['ZendeskConfiguration'][_0x35fc('0x50')](_0x467980[_0x35fc('0x51')],{})['then'](respondWithResult(_0x13281f,0xc9))[_0x35fc('0x25')](handleError(_0x13281f,null));};exports[_0x35fc('0x32')]=function(_0x26118e,_0x18f18b){if(_0x26118e['body']['id']){delete _0x26118e['body']['id'];}return db['ZendeskConfiguration'][_0x35fc('0x4f')]({'where':{'id':_0x26118e[_0x35fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18f18b,null))[_0x35fc('0x33')](saveUpdates(_0x26118e[_0x35fc('0x51')],null))[_0x35fc('0x33')](respondWithResult(_0x18f18b,null))[_0x35fc('0x25')](handleError(_0x18f18b,null));};exports[_0x35fc('0x34')]=function(_0x538be0,_0x2d9d45){return db[_0x35fc('0x4a')][_0x35fc('0x4f')]({'where':{'id':_0x538be0['params']['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x2d9d45,null))[_0x35fc('0x33')](removeEntity(_0x2d9d45,null))['catch'](handleError(_0x2d9d45,null));};exports[_0x35fc('0x52')]=function(_0x164c7b,_0x1c46b1,_0x1c4c33){var _0x314666={};var _0x41453b={};var _0x8501d1;var _0x998fd9;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x164c7b[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x1c46b1,null))['then'](function(_0x243871){if(_0x243871){_0x8501d1=_0x243871;_0x41453b['model']=_['keys'](db['ZendeskField'][_0x35fc('0x54')]);_0x41453b[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x164c7b[_0x35fc('0x3b')]);_0x41453b[_0x35fc('0x3d')]=_['intersection'](_0x41453b['model'],_0x41453b['query']);_0x314666['attributes']=_['intersection'](_0x41453b[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x314666['attributes']=_0x314666[_0x35fc('0x40')][_0x35fc('0x41')]?_0x314666[_0x35fc('0x40')]:_0x41453b[_0x35fc('0x39')];_0x314666[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x314666[_0x35fc('0x46')]=qs['filters'](_[_0x35fc('0x55')](_0x164c7b['query'],_0x41453b[_0x35fc('0x3d')]));if(_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x314666[_0x35fc('0x46')]=_['merge'](_0x314666[_0x35fc('0x46')],{'$or':_['map'](_0x314666['attributes'],function(_0x5f1d4a){var _0x10dd1a={};_0x10dd1a[_0x5f1d4a]={'$like':'%'+_0x164c7b['query'][_0x35fc('0x48')]+'%'};return _0x10dd1a;})});}_0x314666=_['merge']({},_0x314666,_0x164c7b[_0x35fc('0x49')]);return _0x8501d1['getFields'](_0x314666);}})[_0x35fc('0x33')](function(_0x455b84){if(_0x455b84){_0x998fd9=_0x455b84[_0x35fc('0x41')];if(!_0x164c7b[_0x35fc('0x3b')]['hasOwnProperty'](_0x35fc('0x43'))){_0x314666[_0x35fc('0x2b')]=qs[_0x35fc('0x2b')](_0x164c7b['query'][_0x35fc('0x2b')]);_0x314666[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x8501d1[_0x35fc('0x52')](_0x314666);}})[_0x35fc('0x33')](function(_0x4464d5){if(_0x4464d5){return _0x4464d5?{'count':_0x998fd9,'rows':_0x4464d5}:null;}})['then'](respondWithResult(_0x1c46b1,null))[_0x35fc('0x25')](handleError(_0x1c46b1,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d,_0x1c88d8){var _0x1b76f0={};var _0x586729={};var _0x4d09d4;var _0x3969d3;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x2600d2[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x4a926d,null))[_0x35fc('0x33')](function(_0x1932c9){if(_0x1932c9){_0x4d09d4=_0x1932c9;_0x586729[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x57')][_0x35fc('0x54')]);_0x586729[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x2600d2[_0x35fc('0x3b')]);_0x586729[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0x586729[_0x35fc('0x39')],_0x586729[_0x35fc('0x3b')]);_0x1b76f0[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x586729[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x2600d2['query'][_0x35fc('0x3f')]));_0x1b76f0['attributes']=_0x1b76f0[_0x35fc('0x40')][_0x35fc('0x41')]?_0x1b76f0[_0x35fc('0x40')]:_0x586729[_0x35fc('0x39')];_0x1b76f0[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x1b76f0[_0x35fc('0x46')]=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x2600d2['query'],_0x586729[_0x35fc('0x3d')]));if(_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x1b76f0[_0x35fc('0x46')]=_[_0x35fc('0x47')](_0x1b76f0[_0x35fc('0x46')],{'$or':_['map'](_0x1b76f0[_0x35fc('0x40')],function(_0x3353e0){var _0x277514={};_0x277514[_0x3353e0]={'$like':'%'+_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x277514;})});}_0x1b76f0=_[_0x35fc('0x47')]({},_0x1b76f0,_0x2600d2[_0x35fc('0x49')]);return _0x4d09d4[_0x35fc('0x56')](_0x1b76f0);}})[_0x35fc('0x33')](function(_0x5f23d8){if(_0x5f23d8){_0x3969d3=_0x5f23d8[_0x35fc('0x41')];if(!_0x2600d2['query'][_0x35fc('0x42')](_0x35fc('0x43'))){_0x1b76f0['limit']=qs[_0x35fc('0x2b')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x1b76f0[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x4d09d4[_0x35fc('0x56')](_0x1b76f0);}})[_0x35fc('0x33')](function(_0x5806bf){if(_0x5806bf){return _0x5806bf?{'count':_0x3969d3,'rows':_0x5806bf}:null;}})['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports['getDescriptions']=function(_0x160a6f,_0x23cf84,_0x8fc410){var _0x1f5cbc={};var _0x35ef53={};var _0x4f535a;var _0x226fdf;return db[_0x35fc('0x4a')][_0x35fc('0x53')]({'where':{'id':_0x160a6f[_0x35fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23cf84,null))[_0x35fc('0x33')](function(_0x3ddd21){if(_0x3ddd21){_0x4f535a=_0x3ddd21;_0x35ef53[_0x35fc('0x39')]=_['keys'](db[_0x35fc('0x57')][_0x35fc('0x54')]);_0x35ef53[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x160a6f[_0x35fc('0x3b')]);_0x35ef53[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0x35ef53[_0x35fc('0x39')],_0x35ef53['query']);_0x1f5cbc[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x35ef53[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x1f5cbc['attributes']=_0x1f5cbc[_0x35fc('0x40')]['length']?_0x1f5cbc['attributes']:_0x35ef53[_0x35fc('0x39')];_0x1f5cbc['order']=qs[_0x35fc('0x45')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x1f5cbc['where']=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x160a6f[_0x35fc('0x3b')],_0x35ef53[_0x35fc('0x3d')]));if(_0x160a6f[_0x35fc('0x3b')]['filter']){_0x1f5cbc['where']=_['merge'](_0x1f5cbc[_0x35fc('0x46')],{'$or':_['map'](_0x1f5cbc[_0x35fc('0x40')],function(_0x1824c2){var _0x391321={};_0x391321[_0x1824c2]={'$like':'%'+_0x160a6f[_0x35fc('0x3b')]['filter']+'%'};return _0x391321;})});}_0x1f5cbc=_[_0x35fc('0x47')]({},_0x1f5cbc,_0x160a6f[_0x35fc('0x49')]);return _0x4f535a[_0x35fc('0x58')](_0x1f5cbc);}})['then'](function(_0x128286){if(_0x128286){_0x226fdf=_0x128286[_0x35fc('0x41')];if(!_0x160a6f[_0x35fc('0x3b')]['hasOwnProperty']('nolimit')){_0x1f5cbc['limit']=qs[_0x35fc('0x2b')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x1f5cbc[_0x35fc('0x2a')]=qs['offset'](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x4f535a['getDescriptions'](_0x1f5cbc);}})['then'](function(_0x143c94){if(_0x143c94){return _0x143c94?{'count':_0x226fdf,'rows':_0x143c94}:null;}})[_0x35fc('0x33')](respondWithResult(_0x23cf84,null))[_0x35fc('0x25')](handleError(_0x23cf84,null));};exports['getTags']=function(_0x4dd05f,_0x134e60,_0x432ba4){var _0x4d5204={};var _0x3439de={};var _0x163edb;var _0x1d96c9;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x4dd05f[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x134e60,null))[_0x35fc('0x33')](function(_0x4fd676){if(_0x4fd676){_0x163edb=_0x4fd676;_0x3439de[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x59')]['rawAttributes']);_0x3439de[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x4dd05f[_0x35fc('0x3b')]);_0x3439de['filters']=_[_0x35fc('0x3e')](_0x3439de[_0x35fc('0x39')],_0x3439de['query']);_0x4d5204[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x3439de[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x4d5204[_0x35fc('0x40')]=_0x4d5204[_0x35fc('0x40')][_0x35fc('0x41')]?_0x4d5204['attributes']:_0x3439de[_0x35fc('0x39')];_0x4d5204[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x4dd05f[_0x35fc('0x3b')]['sort']);_0x4d5204[_0x35fc('0x46')]=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x4dd05f[_0x35fc('0x3b')],_0x3439de[_0x35fc('0x3d')]));if(_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x4d5204[_0x35fc('0x46')]=_['merge'](_0x4d5204['where'],{'$or':_[_0x35fc('0x3a')](_0x4d5204[_0x35fc('0x40')],function(_0x961ee9){var _0x4ebf4a={};_0x4ebf4a[_0x961ee9]={'$like':'%'+_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x4ebf4a;})});}_0x4d5204=_[_0x35fc('0x47')]({},_0x4d5204,_0x4dd05f[_0x35fc('0x49')]);return _0x163edb['getTags'](_0x4d5204);}})['then'](function(_0x379650){if(_0x379650){_0x1d96c9=_0x379650['length'];if(!_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x42')]('nolimit')){_0x4d5204['limit']=qs[_0x35fc('0x2b')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x4d5204['offset']=qs[_0x35fc('0x2a')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x163edb['getTags'](_0x4d5204);}})[_0x35fc('0x33')](function(_0x32cbd){if(_0x32cbd){return _0x32cbd?{'count':_0x1d96c9,'rows':_0x32cbd}:null;}})[_0x35fc('0x33')](respondWithResult(_0x134e60,null))[_0x35fc('0x25')](handleError(_0x134e60,null));};exports['setTags']=function(_0x451cb8,_0x347e06,_0x6f8054){if(_0x451cb8[_0x35fc('0x51')]['id']){delete _0x451cb8[_0x35fc('0x51')]['id'];}return db[_0x35fc('0x4a')]['findOne']({'where':{'id':_0x451cb8[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x347e06,null))['then'](function(_0x4c3253){if(_0x4c3253){return _0x4c3253[_0x35fc('0x5a')](_0x451cb8['body'][_0x35fc('0x5b')]||[]);}return null;})[_0x35fc('0x33')](respondWithResult(_0x347e06,null))[_0x35fc('0x25')](handleError(_0x347e06,null));}; \ No newline at end of file +var _0x7217=['rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZendeskField','getSubjects','hasOwnProperty','getDescriptions','findOne','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZendeskConfiguration','includeAll','rows','show'];(function(_0x3ce937,_0x568d7d){var _0x41d2fa=function(_0x19a409){while(--_0x19a409){_0x3ce937['push'](_0x3ce937['shift']());}};_0x41d2fa(++_0x568d7d);}(_0x7217,0x19e));var _0x7721=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7217[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZendeskConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZendeskConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));};exports['getTags']=function(_0x2005d1,_0x13dc8a,_0x58f7b1){var _0x5b76e3={};var _0x2dbb6d={};var _0x1b68a7;var _0x606b4b;return db[_0x7721('0x4d')][_0x7721('0x5f')]({'where':{'id':_0x2005d1[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x13dc8a,null))[_0x7721('0x38')](function(_0x59de30){if(_0x59de30){_0x1b68a7=_0x59de30;_0x2dbb6d[_0x7721('0x3f')]=_[_0x7721('0x52')](db[_0x7721('0x60')][_0x7721('0x51')]);_0x2dbb6d[_0x7721('0x40')]=_[_0x7721('0x52')](_0x2005d1[_0x7721('0x40')]);_0x2dbb6d['filters']=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],_0x2dbb6d['query']);_0x5b76e3[_0x7721('0x43')]=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x2005d1[_0x7721('0x40')][_0x7721('0x42')]));_0x5b76e3[_0x7721('0x43')]=_0x5b76e3[_0x7721('0x43')][_0x7721('0x44')]?_0x5b76e3[_0x7721('0x43')]:_0x2dbb6d['model'];_0x5b76e3[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x2005d1[_0x7721('0x40')][_0x7721('0x47')]);_0x5b76e3[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x2005d1[_0x7721('0x40')],_0x2dbb6d[_0x7721('0x41')]));if(_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]){_0x5b76e3[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5b76e3[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x5b76e3[_0x7721('0x43')],function(_0xea9824){var _0x1fb651={};_0x1fb651[_0xea9824]={'$like':'%'+_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1fb651;})});}_0x5b76e3=_['merge']({},_0x5b76e3,_0x2005d1[_0x7721('0x55')]);return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x2af5f5){if(_0x2af5f5){_0x606b4b=_0x2af5f5[_0x7721('0x44')];if(!_0x2005d1[_0x7721('0x40')][_0x7721('0x5d')]('nolimit')){_0x5b76e3['limit']=qs['limit'](_0x2005d1['query'][_0x7721('0x31')]);_0x5b76e3[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x2005d1[_0x7721('0x40')][_0x7721('0x30')]);}return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x501a11){if(_0x501a11){return _0x501a11?{'count':_0x606b4b,'rows':_0x501a11}:null;}})[_0x7721('0x38')](respondWithResult(_0x13dc8a,null))[_0x7721('0x2b')](handleError(_0x13dc8a,null));};exports[_0x7721('0x61')]=function(_0x11d5a7,_0xf061eb,_0x2b0c22){if(_0x11d5a7['body']['id']){delete _0x11d5a7[_0x7721('0x58')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x11d5a7[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0xf061eb,null))[_0x7721('0x38')](function(_0x357b78){if(_0x357b78){return _0x357b78[_0x7721('0x61')](_0x11d5a7['body'][_0x7721('0x62')]||[]);}return null;})[_0x7721('0x38')](respondWithResult(_0xf061eb,null))[_0x7721('0x2b')](handleError(_0xf061eb,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index b36fe08..d2422ae 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 _0x808c=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x49b343,_0x89e908){var _0x44621b=function(_0x5a4fec){while(--_0x5a4fec){_0x49b343['push'](_0x49b343['shift']());}};_0x44621b(++_0x89e908);}(_0x808c,0x103));var _0xc808=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x808c[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');var util=require(_0xc808('0x0'));var logger=require(_0xc808('0x1'))(_0xc808('0x2'));var moment=require(_0xc808('0x3'));var BPromise=require(_0xc808('0x4'));var rp=require(_0xc808('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc808('0x6'));var config=require(_0xc808('0x7'));var attributes=require(_0xc808('0x8'));module[_0xc808('0x9')]=function(_0x4029fc,_0x398ce8){return _0x4029fc['define'](_0xc808('0xa'),attributes,{'tableName':_0xc808('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51c4=['ZendeskConfiguration','lodash','api','moment','bluebird','./intZendeskConfiguration.attributes','exports','define'];(function(_0x342ae8,_0x2ed7a2){var _0x2d19d7=function(_0x374adc){while(--_0x374adc){_0x342ae8['push'](_0x342ae8['shift']());}};_0x2d19d7(++_0x2ed7a2);}(_0x51c4,0x199));var _0x451c=function(_0x4f16fe,_0x1f55dc){_0x4f16fe=_0x4f16fe-0x0;var _0x35a025=_0x51c4[_0x4f16fe];return _0x35a025;};'use strict';var _=require(_0x451c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x451c('0x1'));var moment=require(_0x451c('0x2'));var BPromise=require(_0x451c('0x3'));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(_0x451c('0x4'));module[_0x451c('0x5')]=function(_0x1b1ef9,_0x36a52a){return _0x1b1ef9[_0x451c('0x6')](_0x451c('0x7'),attributes,{'tableName':'int_zendesk_configurations','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 9b0af13..f1a339f 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 _0xdc67=['request','then','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x802010,_0x19c131){var _0x2c39c8=function(_0x458259){while(--_0x458259){_0x802010['push'](_0x802010['shift']());}};_0x2c39c8(++_0x19c131);}(_0xdc67,0x88));var _0x7dc6=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xdc67[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x7dc6('0x0'));var util=require(_0x7dc6('0x1'));var moment=require(_0x7dc6('0x2'));var BPromise=require(_0x7dc6('0x3'));var rs=require(_0x7dc6('0x4'));var fs=require('fs');var Redis=require(_0x7dc6('0x5'));var db=require(_0x7dc6('0x6'))['db'];var utils=require(_0x7dc6('0x7'));var logger=require(_0x7dc6('0x8'))(_0x7dc6('0x9'));var config=require(_0x7dc6('0xa'));var jayson=require(_0x7dc6('0xb'));var client=jayson[_0x7dc6('0xc')][_0x7dc6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3024fa,_0x231b33,_0x4f8d35){return new BPromise(function(_0x5cf977,_0x419b9e){return client[_0x7dc6('0xe')](_0x3024fa,_0x4f8d35)[_0x7dc6('0xf')](function(_0x152867){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x231b33,'request\x20sent');logger['debug'](_0x7dc6('0x10'),_0x231b33,_0x7dc6('0x11'),JSON['stringify'](_0x152867));if(_0x152867['error']){if(_0x152867['error'][_0x7dc6('0x12')]===0x1f4){logger[_0x7dc6('0x13')](_0x7dc6('0x14'),_0x231b33,_0x152867[_0x7dc6('0x13')]['message']);return _0x419b9e(_0x152867[_0x7dc6('0x13')][_0x7dc6('0x15')]);}logger[_0x7dc6('0x13')](_0x7dc6('0x14'),_0x231b33,_0x152867[_0x7dc6('0x13')][_0x7dc6('0x15')]);return _0x5cf977(_0x152867[_0x7dc6('0x13')][_0x7dc6('0x15')]);}else{logger[_0x7dc6('0x16')]('ZendeskConfiguration,\x20%s,\x20%s',_0x231b33,'request\x20sent');_0x5cf977(_0x152867[_0x7dc6('0x17')][_0x7dc6('0x15')]);}})[_0x7dc6('0x18')](function(_0x278ec3){logger[_0x7dc6('0x13')](_0x7dc6('0x14'),_0x231b33,_0x278ec3);_0x419b9e(_0x278ec3);});});} \ No newline at end of file +var _0x9f86=['rpc','../../config/environment','jayson/promise','client','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39e4a1,_0x4edcc5){var _0x55b30e=function(_0x5efd8e){while(--_0x5efd8e){_0x39e4a1['push'](_0x39e4a1['shift']());}};_0x55b30e(++_0x4edcc5);}(_0x9f86,0x6b));var _0x69f8=function(_0x5105e8,_0x44a2e0){_0x5105e8=_0x5105e8-0x0;var _0x53bbf5=_0x9f86[_0x5105e8];return _0x53bbf5;};'use strict';var _=require(_0x69f8('0x0'));var util=require('util');var moment=require(_0x69f8('0x1'));var BPromise=require(_0x69f8('0x2'));var rs=require(_0x69f8('0x3'));var fs=require('fs');var Redis=require(_0x69f8('0x4'));var db=require(_0x69f8('0x5'))['db'];var utils=require(_0x69f8('0x6'));var logger=require(_0x69f8('0x7'))(_0x69f8('0x8'));var config=require(_0x69f8('0x9'));var jayson=require(_0x69f8('0xa'));var client=jayson[_0x69f8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31cb7e,_0x10c67a,_0x138383){return new BPromise(function(_0xe2f937,_0x4e63a9){return client[_0x69f8('0xc')](_0x31cb7e,_0x138383)['then'](function(_0x4f587c){logger[_0x69f8('0xd')](_0x69f8('0xe'),_0x10c67a,_0x69f8('0xf'));logger['debug'](_0x69f8('0x10'),_0x10c67a,_0x69f8('0xf'),JSON[_0x69f8('0x11')](_0x4f587c));if(_0x4f587c[_0x69f8('0x12')]){if(_0x4f587c['error'][_0x69f8('0x13')]===0x1f4){logger[_0x69f8('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x10c67a,_0x4f587c[_0x69f8('0x12')][_0x69f8('0x14')]);return _0x4e63a9(_0x4f587c[_0x69f8('0x12')][_0x69f8('0x14')]);}logger['error'](_0x69f8('0xe'),_0x10c67a,_0x4f587c[_0x69f8('0x12')][_0x69f8('0x14')]);return _0xe2f937(_0x4f587c['error'][_0x69f8('0x14')]);}else{logger['info'](_0x69f8('0xe'),_0x10c67a,_0x69f8('0xf'));_0xe2f937(_0x4f587c[_0x69f8('0x15')]['message']);}})[_0x69f8('0x16')](function(_0x48417c){logger[_0x69f8('0x12')](_0x69f8('0xe'),_0x10c67a,_0x48417c);_0x4e63a9(_0x48417c);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ac73138..a0ad502 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 _0xabcb=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xabcb,0xf9));var _0xbabc=function(_0x23b8b6,_0x4708b2){_0x23b8b6=_0x23b8b6-0x0;var _0x2e7806=_0xabcb[_0x23b8b6];return _0x2e7806;};'use strict';var multer=require('multer');var util=require(_0xbabc('0x0'));var path=require(_0xbabc('0x1'));var timeout=require(_0xbabc('0x2'));var express=require(_0xbabc('0x3'));var router=express[_0xbabc('0x4')]();var auth=require(_0xbabc('0x5'));var interaction=require(_0xbabc('0x6'));var config=require(_0xbabc('0x7'));var controller=require(_0xbabc('0x8'));router[_0xbabc('0x9')]('/',auth[_0xbabc('0xa')](),controller[_0xbabc('0xb')]);router[_0xbabc('0x9')](_0xbabc('0xc'),auth[_0xbabc('0xa')](),controller[_0xbabc('0xd')]);router[_0xbabc('0xe')]('/',auth[_0xbabc('0xa')](),controller[_0xbabc('0xf')]);router[_0xbabc('0x10')]('/:id',auth[_0xbabc('0xa')](),controller[_0xbabc('0x11')]);router[_0xbabc('0x12')]('/:id',auth[_0xbabc('0xa')](),controller[_0xbabc('0x13')]);module[_0xbabc('0x14')]=router; \ No newline at end of file +var _0xc94e=['connect-timeout','express','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','post','put','/:id','update','delete','exports','multer','path'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0xc94e,0x76));var _0xec94=function(_0x199155,_0x697e57){_0x199155=_0x199155-0x0;var _0x4361aa=_0xc94e[_0x199155];return _0x4361aa;};'use strict';var multer=require(_0xec94('0x0'));var util=require('util');var path=require(_0xec94('0x1'));var timeout=require(_0xec94('0x2'));var express=require(_0xec94('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec94('0x4'));var controller=require(_0xec94('0x5'));router['get']('/',auth[_0xec94('0x6')](),controller[_0xec94('0x7')]);router[_0xec94('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xec94('0x9')]('/',auth[_0xec94('0x6')](),controller['create']);router[_0xec94('0xa')](_0xec94('0xb'),auth['isAuthenticated'](),controller[_0xec94('0xc')]);router[_0xec94('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xec94('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 700cbeb..bf60d07 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 _0x2b37=['customVariable','keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x1702b8,_0x28c7da){var _0x50028a=function(_0x4135b1){while(--_0x4135b1){_0x1702b8['push'](_0x1702b8['shift']());}};_0x50028a(++_0x28c7da);}(_0x2b37,0x12b));var _0x72b3=function(_0x3349ab,_0x109526){_0x3349ab=_0x3349ab-0x0;var _0x164a1e=_0x2b37[_0x3349ab];return _0x164a1e;};'use strict';var Sequelize=require(_0x72b3('0x0'));module[_0x72b3('0x1')]={'type':{'type':Sequelize[_0x72b3('0x2')](_0x72b3('0x3'),_0x72b3('0x4'),_0x72b3('0x5'),_0x72b3('0x6')),'defaultValue':_0x72b3('0x3')},'content':{'type':Sequelize[_0x72b3('0x7')]},'key':{'type':Sequelize[_0x72b3('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x72b3('0x3'),_0x72b3('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x72b3('0x7')]},'idField':{'type':Sequelize[_0x72b3('0x7')]},'nameField':{'type':Sequelize[_0x72b3('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x72b3('0x7')]}}; \ No newline at end of file +var _0x746f=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x746f,0x9c));var _0xf746=function(_0x18c760,_0x55ad8c){_0x18c760=_0x18c760-0x0;var _0x1ebea3=_0x746f[_0x18c760];return _0x1ebea3;};'use strict';var Sequelize=require(_0xf746('0x0'));module[_0xf746('0x1')]={'type':{'type':Sequelize[_0xf746('0x2')](_0xf746('0x3'),_0xf746('0x4'),_0xf746('0x5'),_0xf746('0x6')),'defaultValue':_0xf746('0x3')},'content':{'type':Sequelize[_0xf746('0x7')]},'key':{'type':Sequelize[_0xf746('0x7')]},'keyType':{'type':Sequelize[_0xf746('0x2')](_0xf746('0x3'),_0xf746('0x4'),_0xf746('0x5'))},'keyContent':{'type':Sequelize[_0xf746('0x7')]},'idField':{'type':Sequelize[_0xf746('0x7')]},'nameField':{'type':Sequelize[_0xf746('0x7')]},'customField':{'type':Sequelize[_0xf746('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf746('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 79250bb..69344d7 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 _0xc202=['bluebird','path','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','save','destroy','error','name','send','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x23c682,_0x599369){var _0x1fceed=function(_0x4bbb84){while(--_0x4bbb84){_0x23c682['push'](_0x23c682['shift']());}};_0x1fceed(++_0x599369);}(_0xc202,0x1eb));var _0x2c20=function(_0x1cb03c,_0x5b1ceb){_0x1cb03c=_0x1cb03c-0x0;var _0x1772dd=_0xc202[_0x1cb03c];return _0x1772dd;};'use strict';var pdf=require(_0x2c20('0x0'));var emlformat=require(_0x2c20('0x1'));var rimraf=require(_0x2c20('0x2'));var zipdir=require(_0x2c20('0x3'));var jsonpatch=require(_0x2c20('0x4'));var rp=require(_0x2c20('0x5'));var moment=require('moment');var BPromise=require(_0x2c20('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2c20('0x7'));var sox=require('sox');var csv=require(_0x2c20('0x8'));var ejs=require(_0x2c20('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2c20('0xa'));var crypto=require(_0x2c20('0xb'));var jsforce=require(_0x2c20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c20('0xd'));var Papa=require('papaparse');var Redis=require(_0x2c20('0xe'));var authService=require(_0x2c20('0xf'));var qs=require(_0x2c20('0x10'));var as=require(_0x2c20('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c20('0x12'))(_0x2c20('0x13'));var utils=require(_0x2c20('0x14'));var config=require('../../config/environment');var db=require(_0x2c20('0x15'))['db'];function respondWithStatusCode(_0x117b4b,_0x51a67e){_0x51a67e=_0x51a67e||0xcc;return function(_0xef0cb2){if(_0xef0cb2){return _0x117b4b[_0x2c20('0x16')](_0x51a67e);}return _0x117b4b['status'](_0x51a67e)[_0x2c20('0x17')]();};}function respondWithResult(_0x337966,_0x1d6749){_0x1d6749=_0x1d6749||0xc8;return function(_0x3fcf94){if(_0x3fcf94){return _0x337966[_0x2c20('0x18')](_0x1d6749)[_0x2c20('0x19')](_0x3fcf94);}};}function respondWithFilteredResult(_0x50de62,_0x4a1b76){return function(_0x27e99e){if(_0x27e99e){var _0x2c94b4=_0x27e99e[_0x2c20('0x1a')],_0x1e179e=_0x4a1b76[_0x2c20('0x1b')],_0x9c62a4=_0x4a1b76[_0x2c20('0x1b')]+_0x4a1b76['limit'],_0x176bc2;if(_0x9c62a4>=_0x2c94b4){_0x9c62a4=_0x2c94b4;_0x176bc2=0xc8;}else{_0x176bc2=0xce;}_0x50de62[_0x2c20('0x18')](_0x176bc2);return _0x50de62[_0x2c20('0x1c')]('Content-Range',_0x1e179e+'-'+_0x9c62a4+'/'+_0x2c94b4)[_0x2c20('0x19')](_0x27e99e);}return null;};}function patchUpdates(_0x4eddc1){return function(_0x39092e){try{jsonpatch[_0x2c20('0x1d')](_0x39092e,_0x4eddc1,!![]);}catch(_0x27a009){return BPromise['reject'](_0x27a009);}return _0x39092e[_0x2c20('0x1e')]();};}function saveUpdates(_0x42efb4,_0x5edb57){return function(_0x1e3b35){if(_0x1e3b35){return _0x1e3b35['update'](_0x42efb4)['then'](function(_0x825125){return _0x825125;});}return null;};}function removeEntity(_0x21b3f3,_0x44d57d){return function(_0x149331){if(_0x149331){return _0x149331[_0x2c20('0x1f')]()['then'](function(){_0x21b3f3[_0x2c20('0x18')](0xcc)[_0x2c20('0x17')]();});}};}function handleEntityNotFound(_0x454ad2,_0x16630f){return function(_0x55f5f3){if(!_0x55f5f3){_0x454ad2[_0x2c20('0x16')](0x194);}return _0x55f5f3;};}function handleError(_0x3d7d91,_0x4aed28){_0x4aed28=_0x4aed28||0x1f4;return function(_0x583b0a){logger[_0x2c20('0x20')](_0x583b0a['stack']);if(_0x583b0a[_0x2c20('0x21')]){delete _0x583b0a[_0x2c20('0x21')];}_0x3d7d91[_0x2c20('0x18')](_0x4aed28)[_0x2c20('0x22')](_0x583b0a);};}exports['index']=function(_0x28cd3a,_0x3113de){var _0x2fd5f9={},_0x4d0a2c={},_0x21011c={'count':0x0,'rows':[]};var _0xc0e01d=_[_0x2c20('0x23')](db[_0x2c20('0x24')][_0x2c20('0x25')],function(_0xa226cd){return{'name':_0xa226cd[_0x2c20('0x26')],'type':_0xa226cd['type'][_0x2c20('0x27')]};});_0x4d0a2c[_0x2c20('0x28')]=_[_0x2c20('0x23')](_0xc0e01d,_0x2c20('0x21'));_0x4d0a2c[_0x2c20('0x29')]=_[_0x2c20('0x2a')](_0x28cd3a[_0x2c20('0x29')]);_0x4d0a2c[_0x2c20('0x2b')]=_[_0x2c20('0x2c')](_0x4d0a2c[_0x2c20('0x28')],_0x4d0a2c['query']);_0x2fd5f9[_0x2c20('0x2d')]=_[_0x2c20('0x2c')](_0x4d0a2c[_0x2c20('0x28')],qs[_0x2c20('0x2e')](_0x28cd3a[_0x2c20('0x29')][_0x2c20('0x2e')]));_0x2fd5f9[_0x2c20('0x2d')]=_0x2fd5f9['attributes'][_0x2c20('0x2f')]?_0x2fd5f9['attributes']:_0x4d0a2c[_0x2c20('0x28')];if(!_0x28cd3a[_0x2c20('0x29')][_0x2c20('0x30')](_0x2c20('0x31'))){_0x2fd5f9[_0x2c20('0x32')]=qs[_0x2c20('0x32')](_0x28cd3a['query'][_0x2c20('0x32')]);_0x2fd5f9['offset']=qs['offset'](_0x28cd3a[_0x2c20('0x29')][_0x2c20('0x1b')]);}_0x2fd5f9[_0x2c20('0x33')]=qs[_0x2c20('0x34')](_0x28cd3a[_0x2c20('0x29')][_0x2c20('0x34')]);_0x2fd5f9[_0x2c20('0x35')]=qs[_0x2c20('0x2b')](_[_0x2c20('0x36')](_0x28cd3a['query'],_0x4d0a2c[_0x2c20('0x2b')]));if(_0x28cd3a['query'][_0x2c20('0x37')]){_0x2fd5f9[_0x2c20('0x35')]=_[_0x2c20('0x38')](_0x2fd5f9['where'],{'$or':_[_0x2c20('0x23')](_0xc0e01d,function(_0x978204){if(_0x978204['type']!==_0x2c20('0x39')){var _0x32f66={};_0x32f66[_0x978204[_0x2c20('0x21')]]={'$like':'%'+_0x28cd3a[_0x2c20('0x29')]['filter']+'%'};return _0x32f66;}})});}_0x2fd5f9=_[_0x2c20('0x38')]({},_0x2fd5f9,_0x28cd3a[_0x2c20('0x3a')]);var _0x491451={'where':_0x2fd5f9['where']};return db[_0x2c20('0x24')][_0x2c20('0x1a')](_0x491451)[_0x2c20('0x3b')](function(_0x4624f2){_0x21011c[_0x2c20('0x1a')]=_0x4624f2;if(_0x28cd3a[_0x2c20('0x29')][_0x2c20('0x3c')]){_0x2fd5f9['include']=[{'all':!![]}];}return db['ZendeskField'][_0x2c20('0x3d')](_0x2fd5f9);})['then'](function(_0x3f1a7a){_0x21011c[_0x2c20('0x3e')]=_0x3f1a7a;return _0x21011c;})[_0x2c20('0x3b')](respondWithFilteredResult(_0x3113de,_0x2fd5f9))[_0x2c20('0x3f')](handleError(_0x3113de,null));};exports[_0x2c20('0x40')]=function(_0x168f04,_0x2fcb9d){var _0x33e917={'raw':!![],'where':{'id':_0x168f04[_0x2c20('0x41')]['id']}},_0x1ae485={};_0x1ae485['model']=_['keys'](db[_0x2c20('0x24')]['rawAttributes']);_0x1ae485['query']=_[_0x2c20('0x2a')](_0x168f04[_0x2c20('0x29')]);_0x1ae485[_0x2c20('0x2b')]=_[_0x2c20('0x2c')](_0x1ae485[_0x2c20('0x28')],_0x1ae485[_0x2c20('0x29')]);_0x33e917[_0x2c20('0x2d')]=_[_0x2c20('0x2c')](_0x1ae485['model'],qs[_0x2c20('0x2e')](_0x168f04[_0x2c20('0x29')][_0x2c20('0x2e')]));_0x33e917[_0x2c20('0x2d')]=_0x33e917[_0x2c20('0x2d')][_0x2c20('0x2f')]?_0x33e917[_0x2c20('0x2d')]:_0x1ae485['model'];if(_0x168f04[_0x2c20('0x29')][_0x2c20('0x3c')]){_0x33e917[_0x2c20('0x42')]=[{'all':!![]}];}_0x33e917=_['merge']({},_0x33e917,_0x168f04[_0x2c20('0x3a')]);return db['ZendeskField'][_0x2c20('0x43')](_0x33e917)[_0x2c20('0x3b')](handleEntityNotFound(_0x2fcb9d,null))['then'](respondWithResult(_0x2fcb9d,null))['catch'](handleError(_0x2fcb9d,null));};exports['create']=function(_0x35acf4,_0x22d570){return db[_0x2c20('0x24')][_0x2c20('0x44')](_0x35acf4['body'],{})[_0x2c20('0x3b')](respondWithResult(_0x22d570,0xc9))['catch'](handleError(_0x22d570,null));};exports[_0x2c20('0x45')]=function(_0x32b71d,_0x384bc8){if(_0x32b71d['body']['id']){delete _0x32b71d[_0x2c20('0x46')]['id'];}return db[_0x2c20('0x24')][_0x2c20('0x43')]({'where':{'id':_0x32b71d[_0x2c20('0x41')]['id']}})[_0x2c20('0x3b')](handleEntityNotFound(_0x384bc8,null))[_0x2c20('0x3b')](saveUpdates(_0x32b71d['body'],null))[_0x2c20('0x3b')](respondWithResult(_0x384bc8,null))['catch'](handleError(_0x384bc8,null));};exports['destroy']=function(_0x23d128,_0x28777e){return db[_0x2c20('0x24')]['find']({'where':{'id':_0x23d128[_0x2c20('0x41')]['id']}})[_0x2c20('0x3b')](handleEntityNotFound(_0x28777e,null))[_0x2c20('0x3b')](removeEntity(_0x28777e,null))[_0x2c20('0x3f')](handleError(_0x28777e,null));}; \ No newline at end of file +var _0xb569=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','options','ZendeskField','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','crypto','jsforce'];(function(_0x191c44,_0x20a896){var _0x1086cd=function(_0x2e2cac){while(--_0x2e2cac){_0x191c44['push'](_0x191c44['shift']());}};_0x1086cd(++_0x20a896);}(_0xb569,0xc4));var _0x9b56=function(_0x578a5a,_0x1e97aa){_0x578a5a=_0x578a5a-0x0;var _0x748db5=_0xb569[_0x578a5a];return _0x748db5;};'use strict';var pdf=require(_0x9b56('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9b56('0x1'));var zipdir=require(_0x9b56('0x2'));var jsonpatch=require(_0x9b56('0x3'));var rp=require(_0x9b56('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b56('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9b56('0x6'));var csv=require(_0x9b56('0x7'));var ejs=require(_0x9b56('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b56('0x9'));var jsforce=require(_0x9b56('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9b56('0x7'));var querystring=require(_0x9b56('0xb'));var Papa=require(_0x9b56('0xc'));var Redis=require(_0x9b56('0xd'));var authService=require(_0x9b56('0xe'));var qs=require(_0x9b56('0xf'));var as=require(_0x9b56('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b56('0x11'))('api');var utils=require(_0x9b56('0x12'));var config=require(_0x9b56('0x13'));var db=require(_0x9b56('0x14'))['db'];function respondWithStatusCode(_0x114ea9,_0x521a7b){_0x521a7b=_0x521a7b||0xcc;return function(_0x252800){if(_0x252800){return _0x114ea9[_0x9b56('0x15')](_0x521a7b);}return _0x114ea9[_0x9b56('0x16')](_0x521a7b)[_0x9b56('0x17')]();};}function respondWithResult(_0x5e7972,_0x5e6807){_0x5e6807=_0x5e6807||0xc8;return function(_0x3cd714){if(_0x3cd714){return _0x5e7972[_0x9b56('0x16')](_0x5e6807)[_0x9b56('0x18')](_0x3cd714);}};}function respondWithFilteredResult(_0x9f09d5,_0x47e311){return function(_0x1109aa){if(_0x1109aa){var _0x222d4b=_0x1109aa[_0x9b56('0x19')],_0x502c03=_0x47e311[_0x9b56('0x1a')],_0x7cf0e5=_0x47e311[_0x9b56('0x1a')]+_0x47e311[_0x9b56('0x1b')],_0x631407;if(_0x7cf0e5>=_0x222d4b){_0x7cf0e5=_0x222d4b;_0x631407=0xc8;}else{_0x631407=0xce;}_0x9f09d5[_0x9b56('0x16')](_0x631407);return _0x9f09d5['set'](_0x9b56('0x1c'),_0x502c03+'-'+_0x7cf0e5+'/'+_0x222d4b)['json'](_0x1109aa);}return null;};}function patchUpdates(_0xec8d66){return function(_0x19d782){try{jsonpatch[_0x9b56('0x1d')](_0x19d782,_0xec8d66,!![]);}catch(_0x146599){return BPromise[_0x9b56('0x1e')](_0x146599);}return _0x19d782[_0x9b56('0x1f')]();};}function saveUpdates(_0x5ab8ad,_0x287b24){return function(_0x690faa){if(_0x690faa){return _0x690faa[_0x9b56('0x20')](_0x5ab8ad)[_0x9b56('0x21')](function(_0xf3dfbb){return _0xf3dfbb;});}return null;};}function removeEntity(_0x1c2590,_0x5ba30f){return function(_0x5b0741){if(_0x5b0741){return _0x5b0741[_0x9b56('0x22')]()[_0x9b56('0x21')](function(){_0x1c2590[_0x9b56('0x16')](0xcc)[_0x9b56('0x17')]();});}};}function handleEntityNotFound(_0x39ae7d,_0x36c3fb){return function(_0x2dcea5){if(!_0x2dcea5){_0x39ae7d['sendStatus'](0x194);}return _0x2dcea5;};}function handleError(_0x210b63,_0x2d4576){_0x2d4576=_0x2d4576||0x1f4;return function(_0x5deb88){logger[_0x9b56('0x23')](_0x5deb88[_0x9b56('0x24')]);if(_0x5deb88[_0x9b56('0x25')]){delete _0x5deb88['name'];}_0x210b63[_0x9b56('0x16')](_0x2d4576)[_0x9b56('0x26')](_0x5deb88);};}exports[_0x9b56('0x27')]=function(_0x2ba4f5,_0x1bff75){var _0x146b08={},_0x4456e0={},_0x1fac07={'count':0x0,'rows':[]};var _0x3c4116=_['map'](db['ZendeskField']['rawAttributes'],function(_0x1c07e4){return{'name':_0x1c07e4[_0x9b56('0x28')],'type':_0x1c07e4[_0x9b56('0x29')][_0x9b56('0x2a')]};});_0x4456e0[_0x9b56('0x2b')]=_['map'](_0x3c4116,_0x9b56('0x25'));_0x4456e0[_0x9b56('0x2c')]=_[_0x9b56('0x2d')](_0x2ba4f5[_0x9b56('0x2c')]);_0x4456e0['filters']=_[_0x9b56('0x2e')](_0x4456e0[_0x9b56('0x2b')],_0x4456e0[_0x9b56('0x2c')]);_0x146b08[_0x9b56('0x2f')]=_['intersection'](_0x4456e0[_0x9b56('0x2b')],qs['fields'](_0x2ba4f5[_0x9b56('0x2c')]['fields']));_0x146b08['attributes']=_0x146b08[_0x9b56('0x2f')][_0x9b56('0x30')]?_0x146b08[_0x9b56('0x2f')]:_0x4456e0[_0x9b56('0x2b')];if(!_0x2ba4f5[_0x9b56('0x2c')][_0x9b56('0x31')]('nolimit')){_0x146b08[_0x9b56('0x1b')]=qs[_0x9b56('0x1b')](_0x2ba4f5[_0x9b56('0x2c')][_0x9b56('0x1b')]);_0x146b08[_0x9b56('0x1a')]=qs[_0x9b56('0x1a')](_0x2ba4f5[_0x9b56('0x2c')][_0x9b56('0x1a')]);}_0x146b08['order']=qs[_0x9b56('0x32')](_0x2ba4f5[_0x9b56('0x2c')][_0x9b56('0x32')]);_0x146b08[_0x9b56('0x33')]=qs['filters'](_[_0x9b56('0x34')](_0x2ba4f5[_0x9b56('0x2c')],_0x4456e0[_0x9b56('0x35')]));if(_0x2ba4f5[_0x9b56('0x2c')][_0x9b56('0x36')]){_0x146b08['where']=_[_0x9b56('0x37')](_0x146b08['where'],{'$or':_[_0x9b56('0x38')](_0x3c4116,function(_0x3d550e){if(_0x3d550e[_0x9b56('0x29')]!=='VIRTUAL'){var _0x55cd47={};_0x55cd47[_0x3d550e[_0x9b56('0x25')]]={'$like':'%'+_0x2ba4f5['query'][_0x9b56('0x36')]+'%'};return _0x55cd47;}})});}_0x146b08=_[_0x9b56('0x37')]({},_0x146b08,_0x2ba4f5[_0x9b56('0x39')]);var _0xeb6374={'where':_0x146b08['where']};return db[_0x9b56('0x3a')][_0x9b56('0x19')](_0xeb6374)[_0x9b56('0x21')](function(_0x4b0650){_0x1fac07['count']=_0x4b0650;if(_0x2ba4f5[_0x9b56('0x2c')][_0x9b56('0x3b')]){_0x146b08['include']=[{'all':!![]}];}return db[_0x9b56('0x3a')][_0x9b56('0x3c')](_0x146b08);})['then'](function(_0x2110ba){_0x1fac07['rows']=_0x2110ba;return _0x1fac07;})['then'](respondWithFilteredResult(_0x1bff75,_0x146b08))[_0x9b56('0x3d')](handleError(_0x1bff75,null));};exports[_0x9b56('0x3e')]=function(_0x56d863,_0x1fcec8){var _0x3d8a51={'raw':!![],'where':{'id':_0x56d863[_0x9b56('0x3f')]['id']}},_0x242a5b={};_0x242a5b['model']=_[_0x9b56('0x2d')](db[_0x9b56('0x3a')][_0x9b56('0x40')]);_0x242a5b[_0x9b56('0x2c')]=_[_0x9b56('0x2d')](_0x56d863[_0x9b56('0x2c')]);_0x242a5b[_0x9b56('0x35')]=_['intersection'](_0x242a5b[_0x9b56('0x2b')],_0x242a5b[_0x9b56('0x2c')]);_0x3d8a51[_0x9b56('0x2f')]=_[_0x9b56('0x2e')](_0x242a5b[_0x9b56('0x2b')],qs['fields'](_0x56d863[_0x9b56('0x2c')][_0x9b56('0x41')]));_0x3d8a51[_0x9b56('0x2f')]=_0x3d8a51[_0x9b56('0x2f')][_0x9b56('0x30')]?_0x3d8a51[_0x9b56('0x2f')]:_0x242a5b['model'];if(_0x56d863[_0x9b56('0x2c')][_0x9b56('0x3b')]){_0x3d8a51['include']=[{'all':!![]}];}_0x3d8a51=_[_0x9b56('0x37')]({},_0x3d8a51,_0x56d863['options']);return db[_0x9b56('0x3a')][_0x9b56('0x42')](_0x3d8a51)[_0x9b56('0x21')](handleEntityNotFound(_0x1fcec8,null))[_0x9b56('0x21')](respondWithResult(_0x1fcec8,null))['catch'](handleError(_0x1fcec8,null));};exports[_0x9b56('0x43')]=function(_0x27b002,_0x1804db){return db['ZendeskField'][_0x9b56('0x43')](_0x27b002['body'],{})['then'](respondWithResult(_0x1804db,0xc9))[_0x9b56('0x3d')](handleError(_0x1804db,null));};exports['update']=function(_0x299367,_0x484a8a){if(_0x299367['body']['id']){delete _0x299367[_0x9b56('0x44')]['id'];}return db[_0x9b56('0x3a')][_0x9b56('0x42')]({'where':{'id':_0x299367[_0x9b56('0x3f')]['id']}})['then'](handleEntityNotFound(_0x484a8a,null))[_0x9b56('0x21')](saveUpdates(_0x299367[_0x9b56('0x44')],null))[_0x9b56('0x21')](respondWithResult(_0x484a8a,null))[_0x9b56('0x3d')](handleError(_0x484a8a,null));};exports[_0x9b56('0x22')]=function(_0x7baa40,_0x21e52b){return db[_0x9b56('0x3a')][_0x9b56('0x42')]({'where':{'id':_0x7baa40[_0x9b56('0x3f')]['id']}})['then'](handleEntityNotFound(_0x21e52b,null))[_0x9b56('0x21')](removeEntity(_0x21e52b,null))['catch'](handleError(_0x21e52b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 3f6450a..9dd75f0 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 _0xbc8b=['api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','FieldId','util'];(function(_0x2f03a0,_0x24bf56){var _0x3c231f=function(_0x45ccbc){while(--_0x45ccbc){_0x2f03a0['push'](_0x2f03a0['shift']());}};_0x3c231f(++_0x24bf56);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0xbc8b[_0x4d521e];return _0x3beb42;};'use strict';var _=require('lodash');var util=require(_0xbbc8('0x0'));var logger=require('../../config/logger')(_0xbbc8('0x1'));var moment=require(_0xbbc8('0x2'));var BPromise=require(_0xbbc8('0x3'));var rp=require(_0xbbc8('0x4'));var fs=require('fs');var path=require(_0xbbc8('0x5'));var rimraf=require(_0xbbc8('0x6'));var config=require('../../config/environment');var attributes=require(_0xbbc8('0x7'));module[_0xbbc8('0x8')]=function(_0x15cdc6,_0x21f15a){return _0x15cdc6[_0xbbc8('0x9')]('ZendeskField',attributes,{'tableName':_0xbbc8('0xa'),'paranoid':![],'indexes':[{'name':_0xbbc8('0xb'),'fields':['idField',_0xbbc8('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc686=['int_zendesk_fields','zendesk_unique_index','FieldId','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc686,0x148));var _0x6c68=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc686[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6c68('0x0'))('api');var moment=require(_0x6c68('0x1'));var BPromise=require('bluebird');var rp=require(_0x6c68('0x2'));var fs=require('fs');var path=require(_0x6c68('0x3'));var rimraf=require(_0x6c68('0x4'));var config=require(_0x6c68('0x5'));var attributes=require(_0x6c68('0x6'));module[_0x6c68('0x7')]=function(_0x1c1b02,_0x2d5dda){return _0x1c1b02[_0x6c68('0x8')](_0x6c68('0x9'),attributes,{'tableName':_0x6c68('0xa'),'paranoid':![],'indexes':[{'name':_0x6c68('0xb'),'fields':['idField',_0x6c68('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 c6fe717..546708e 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 _0x8ba6=['request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x434f82,_0x47d21a){var _0x439855=function(_0x137095){while(--_0x137095){_0x434f82['push'](_0x434f82['shift']());}};_0x439855(++_0x47d21a);}(_0x8ba6,0xc3));var _0x68ba=function(_0x270526,_0x40d838){_0x270526=_0x270526-0x0;var _0x164803=_0x8ba6[_0x270526];return _0x164803;};'use strict';var _=require('lodash');var util=require(_0x68ba('0x0'));var moment=require(_0x68ba('0x1'));var BPromise=require(_0x68ba('0x2'));var rs=require(_0x68ba('0x3'));var fs=require('fs');var Redis=require(_0x68ba('0x4'));var db=require(_0x68ba('0x5'))['db'];var utils=require(_0x68ba('0x6'));var logger=require(_0x68ba('0x7'))(_0x68ba('0x8'));var config=require(_0x68ba('0x9'));var jayson=require(_0x68ba('0xa'));var client=jayson['client'][_0x68ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x521483,_0x4283d6,_0x587503){return new BPromise(function(_0x51bdf1,_0x1eee6b){return client[_0x68ba('0xc')](_0x521483,_0x587503)['then'](function(_0x3d347f){logger[_0x68ba('0xd')](_0x68ba('0xe'),_0x4283d6,'request\x20sent');logger[_0x68ba('0xf')](_0x68ba('0x10'),_0x4283d6,_0x68ba('0x11'),JSON[_0x68ba('0x12')](_0x3d347f));if(_0x3d347f[_0x68ba('0x13')]){if(_0x3d347f['error'][_0x68ba('0x14')]===0x1f4){logger[_0x68ba('0x13')](_0x68ba('0xe'),_0x4283d6,_0x3d347f[_0x68ba('0x13')]['message']);return _0x1eee6b(_0x3d347f['error'][_0x68ba('0x15')]);}logger['error'](_0x68ba('0xe'),_0x4283d6,_0x3d347f[_0x68ba('0x13')]['message']);return _0x51bdf1(_0x3d347f[_0x68ba('0x13')][_0x68ba('0x15')]);}else{logger[_0x68ba('0xd')]('ZendeskField,\x20%s,\x20%s',_0x4283d6,_0x68ba('0x11'));_0x51bdf1(_0x3d347f[_0x68ba('0x16')]['message']);}})['catch'](function(_0x3e03fb){logger['error'](_0x68ba('0xe'),_0x4283d6,_0x3e03fb);_0x1eee6b(_0x3e03fb);});});} \ No newline at end of file +var _0x04f1=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x128241,_0x277491){var _0x27cbc5=function(_0x3074d5){while(--_0x3074d5){_0x128241['push'](_0x128241['shift']());}};_0x27cbc5(++_0x277491);}(_0x04f1,0x14b));var _0x104f=function(_0x51cf48,_0x57dbe0){_0x51cf48=_0x51cf48-0x0;var _0x46cfeb=_0x04f1[_0x51cf48];return _0x46cfeb;};'use strict';var _=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var moment=require(_0x104f('0x2'));var BPromise=require(_0x104f('0x3'));var rs=require(_0x104f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x104f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x104f('0x6'))(_0x104f('0x7'));var config=require(_0x104f('0x8'));var jayson=require(_0x104f('0x9'));var client=jayson[_0x104f('0xa')][_0x104f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e5759,_0x165a17,_0x30d753){return new BPromise(function(_0x2a9e8f,_0x15581c){return client[_0x104f('0xc')](_0x5e5759,_0x30d753)[_0x104f('0xd')](function(_0x5822ad){logger[_0x104f('0xe')]('ZendeskField,\x20%s,\x20%s',_0x165a17,_0x104f('0xf'));logger[_0x104f('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x165a17,'request\x20sent',JSON[_0x104f('0x11')](_0x5822ad));if(_0x5822ad[_0x104f('0x12')]){if(_0x5822ad[_0x104f('0x12')][_0x104f('0x13')]===0x1f4){logger[_0x104f('0x12')](_0x104f('0x14'),_0x165a17,_0x5822ad[_0x104f('0x12')][_0x104f('0x15')]);return _0x15581c(_0x5822ad[_0x104f('0x12')][_0x104f('0x15')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x165a17,_0x5822ad[_0x104f('0x12')][_0x104f('0x15')]);return _0x2a9e8f(_0x5822ad[_0x104f('0x12')]['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x165a17,_0x104f('0xf'));_0x2a9e8f(_0x5822ad[_0x104f('0x16')][_0x104f('0x15')]);}})[_0x104f('0x17')](function(_0x3641dc){logger['error'](_0x104f('0x14'),_0x165a17,_0x3641dc);_0x15581c(_0x3641dc);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 95d41ef..d23bb95 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 _0xe3fa=['show','/:id/configurations','getConfigurations','get','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xe3fa,0x165));var _0xae3f=function(_0x1e9ee9,_0x27fa48){_0x1e9ee9=_0x1e9ee9-0x0;var _0x15227c=_0xe3fa[_0x1e9ee9];return _0x15227c;};'use strict';var multer=require(_0xae3f('0x0'));var util=require(_0xae3f('0x1'));var path=require(_0xae3f('0x2'));var timeout=require(_0xae3f('0x3'));var express=require(_0xae3f('0x4'));var router=express[_0xae3f('0x5')]();var auth=require(_0xae3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae3f('0x7'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xae3f('0x8')](),controller[_0xae3f('0x9')]);router['get'](_0xae3f('0xa'),auth[_0xae3f('0x8')](),controller[_0xae3f('0xb')]);router['get'](_0xae3f('0xc'),auth[_0xae3f('0x8')](),controller[_0xae3f('0xd')]);router[_0xae3f('0xe')](_0xae3f('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xae3f('0x10')]('/',auth[_0xae3f('0x8')](),controller['create']);router[_0xae3f('0x10')](_0xae3f('0xc'),auth[_0xae3f('0x8')](),controller[_0xae3f('0x11')]);router[_0xae3f('0x12')](_0xae3f('0xa'),auth[_0xae3f('0x8')](),controller[_0xae3f('0x13')]);router[_0xae3f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xae3f('0x15')]);module[_0xae3f('0x16')]=router; \ No newline at end of file +var _0x956f=['../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','put','destroy','exports','multer','util','express','Router'];(function(_0xf7bce0,_0x744869){var _0x4058ef=function(_0x175a62){while(--_0x175a62){_0xf7bce0['push'](_0xf7bce0['shift']());}};_0x4058ef(++_0x744869);}(_0x956f,0x1b5));var _0xf956=function(_0x499c7f,_0x2d8184){_0x499c7f=_0x499c7f-0x0;var _0x433bee=_0x956f[_0x499c7f];return _0x433bee;};'use strict';var multer=require(_0xf956('0x0'));var util=require(_0xf956('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf956('0x2'));var router=express[_0xf956('0x3')]();var auth=require(_0xf956('0x4'));var interaction=require(_0xf956('0x5'));var config=require('../../config/environment');var controller=require(_0xf956('0x6'));router[_0xf956('0x7')]('/',auth['isAuthenticated'](),controller[_0xf956('0x8')]);router[_0xf956('0x7')](_0xf956('0x9'),auth['isAuthenticated'](),controller[_0xf956('0xa')]);router[_0xf956('0x7')](_0xf956('0xb'),auth[_0xf956('0xc')](),controller[_0xf956('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xf956('0xe')]);router[_0xf956('0xf')]('/',auth[_0xf956('0xc')](),controller[_0xf956('0x10')]);router[_0xf956('0xf')]('/:id/configurations',auth[_0xf956('0xc')](),controller[_0xf956('0x11')]);router[_0xf956('0x12')]('/:id',auth[_0xf956('0xc')](),controller['update']);router['delete'](_0xf956('0x9'),auth[_0xf956('0xc')](),controller[_0xf956('0x13')]);module[_0xf956('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 910ef32..0f9ef9b 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 _0x2119=['exports','STRING','sequelize'];(function(_0x8e7de7,_0x5b0e81){var _0x3e9b1c=function(_0x5ca9f4){while(--_0x5ca9f4){_0x8e7de7['push'](_0x8e7de7['shift']());}};_0x3e9b1c(++_0x5b0e81);}(_0x2119,0x1c4));var _0x9211=function(_0x5322cc,_0x584916){_0x5322cc=_0x5322cc-0x0;var _0x298d45=_0x2119[_0x5322cc];return _0x298d45;};'use strict';var Sequelize=require(_0x9211('0x0'));module[_0x9211('0x1')]={'name':{'type':Sequelize[_0x9211('0x2')]},'description':{'type':Sequelize[_0x9211('0x2')]},'host':{'type':Sequelize[_0x9211('0x2')]},'zone':{'type':Sequelize[_0x9211('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x9211('0x2')]},'serverUrl':{'type':Sequelize[_0x9211('0x2')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa529=['exports','STRING'];(function(_0x527b5a,_0x186c96){var _0x53d72e=function(_0x466910){while(--_0x466910){_0x527b5a['push'](_0x527b5a['shift']());}};_0x53d72e(++_0x186c96);}(_0xa529,0x8a));var _0x9a52=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa529[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x9a52('0x0')]={'name':{'type':Sequelize[_0x9a52('0x1')]},'description':{'type':Sequelize[_0x9a52('0x1')]},'host':{'type':Sequelize[_0x9a52('0x1')]},'zone':{'type':Sequelize[_0x9a52('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x9a52('0x1')]},'serverUrl':{'type':Sequelize[_0x9a52('0x1')]},'code':{'type':Sequelize[_0x9a52('0x1')]},'refreshToken':{'type':Sequelize[_0x9a52('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 44b65c3..2094192 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 _0xa3ea=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','length','model','nolimit','sort','where','filter','merge','options','ZohoAccount','includeAll','include','findAll','rows','catch','fields','create','body','find','getConfigurations','findOne','params','ZohoConfiguration','order','hasOwnProperty','AccountId','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','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','papaparse','ioredis'];(function(_0x5270ff,_0x26dead){var _0x1bf368=function(_0x391100){while(--_0x391100){_0x5270ff['push'](_0x5270ff['shift']());}};_0x1bf368(++_0x26dead);}(_0xa3ea,0x77));var _0xaa3e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa3ea[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0xaa3e('0x0'));var emlformat=require(_0xaa3e('0x1'));var rimraf=require(_0xaa3e('0x2'));var zipdir=require(_0xaa3e('0x3'));var jsonpatch=require(_0xaa3e('0x4'));var rp=require(_0xaa3e('0x5'));var moment=require(_0xaa3e('0x6'));var BPromise=require(_0xaa3e('0x7'));var Mustache=require(_0xaa3e('0x8'));var util=require(_0xaa3e('0x9'));var path=require('path');var sox=require(_0xaa3e('0xa'));var csv=require(_0xaa3e('0xb'));var ejs=require(_0xaa3e('0xc'));var fs=require('fs');var _=require(_0xaa3e('0xd'));var squel=require(_0xaa3e('0xe'));var crypto=require(_0xaa3e('0xf'));var jsforce=require(_0xaa3e('0x10'));var deskjs=require(_0xaa3e('0x11'));var toCsv=require(_0xaa3e('0xb'));var querystring=require('querystring');var Papa=require(_0xaa3e('0x12'));var Redis=require(_0xaa3e('0x13'));var authService=require(_0xaa3e('0x14'));var qs=require(_0xaa3e('0x15'));var as=require(_0xaa3e('0x16'));var hardwareService=require(_0xaa3e('0x17'));var logger=require('../../config/logger')(_0xaa3e('0x18'));var utils=require(_0xaa3e('0x19'));var config=require(_0xaa3e('0x1a'));var db=require(_0xaa3e('0x1b'))['db'];var integrations=require(_0xaa3e('0x1c'));var jayson=require(_0xaa3e('0x1d'));var client=jayson['client'][_0xaa3e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x31c558,_0x26a6c1,_0x32ea35){if(_0x32ea35){var _0x1f754e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f754e[_0xaa3e('0x1f')](_0x26a6c1)){return _0x31c558;}else{throw new db['Sequelize'][(_0xaa3e('0x20'))](_0xaa3e('0x21'));}}else{return _0x31c558;}}function respondWithRpcPromise(_0x5b45a6,_0x92a309,_0x3744f7,_0x268eb5){return new BPromise(function(_0x1d5855,_0x5b9592){var _0xeefecc=_0x268eb5||client;return _0xeefecc[_0xaa3e('0x22')](_0x5b45a6,_0x3744f7)[_0xaa3e('0x23')](function(_0x27a2d0){logger['info'](_0xaa3e('0x24'),_0x92a309,_0xaa3e('0x25'));logger['debug'](_0xaa3e('0x26'),_0x92a309,_0xaa3e('0x25'),JSON['stringify'](_0x27a2d0));if(_0x27a2d0[_0xaa3e('0x27')]){if(_0x27a2d0[_0xaa3e('0x27')][_0xaa3e('0x28')]===0x1f4){logger[_0xaa3e('0x27')](_0xaa3e('0x24'),_0x92a309,_0x27a2d0['error'][_0xaa3e('0x29')]);return _0x5b9592(_0x27a2d0[_0xaa3e('0x27')][_0xaa3e('0x29')]);}logger[_0xaa3e('0x27')]('ZohoAccount,\x20%s,\x20%s',_0x92a309,_0x27a2d0[_0xaa3e('0x27')][_0xaa3e('0x29')]);return _0x1d5855(_0x27a2d0[_0xaa3e('0x27')][_0xaa3e('0x29')]);}else{logger['info'](_0xaa3e('0x24'),_0x92a309,_0xaa3e('0x25'));_0x1d5855(_0x27a2d0[_0xaa3e('0x2a')][_0xaa3e('0x29')]);}})['catch'](function(_0x2e368d){logger[_0xaa3e('0x27')](_0xaa3e('0x24'),_0x92a309,_0x2e368d);_0x5b9592(_0x2e368d);});});}function respondWithStatusCode(_0x1d17f6,_0x40cd94){_0x40cd94=_0x40cd94||0xcc;return function(_0x17f9f1){if(_0x17f9f1){return _0x1d17f6[_0xaa3e('0x2b')](_0x40cd94);}return _0x1d17f6[_0xaa3e('0x2c')](_0x40cd94)['end']();};}function respondWithResult(_0x47f927,_0x1f5098){_0x1f5098=_0x1f5098||0xc8;return function(_0x39fb57){if(_0x39fb57){return _0x47f927[_0xaa3e('0x2c')](_0x1f5098)[_0xaa3e('0x2d')](_0x39fb57);}};}function respondWithFilteredResult(_0x8051b0,_0x39ada6){return function(_0x27a032){if(_0x27a032){var _0x27e3ef=_0x27a032[_0xaa3e('0x2e')],_0x35bcff=_0x39ada6[_0xaa3e('0x2f')],_0x30b341=_0x39ada6[_0xaa3e('0x2f')]+_0x39ada6[_0xaa3e('0x30')],_0xb21989;if(_0x30b341>=_0x27e3ef){_0x30b341=_0x27e3ef;_0xb21989=0xc8;}else{_0xb21989=0xce;}_0x8051b0[_0xaa3e('0x2c')](_0xb21989);return _0x8051b0[_0xaa3e('0x31')](_0xaa3e('0x32'),_0x35bcff+'-'+_0x30b341+'/'+_0x27e3ef)[_0xaa3e('0x2d')](_0x27a032);}return null;};}function patchUpdates(_0x30696f){return function(_0x2226a8){try{jsonpatch['apply'](_0x2226a8,_0x30696f,!![]);}catch(_0x3c19f3){return BPromise[_0xaa3e('0x33')](_0x3c19f3);}return _0x2226a8[_0xaa3e('0x34')]();};}function saveUpdates(_0x41235f,_0x541361){return function(_0x3b3b81){if(_0x3b3b81){return _0x3b3b81[_0xaa3e('0x35')](_0x41235f)[_0xaa3e('0x23')](function(_0xd27ebf){return _0xd27ebf;});}return null;};}function removeEntity(_0x448d33,_0x543d2c){return function(_0x52d23d){if(_0x52d23d){return _0x52d23d[_0xaa3e('0x36')]()[_0xaa3e('0x23')](function(){_0x448d33[_0xaa3e('0x2c')](0xcc)[_0xaa3e('0x37')]();});}};}function handleEntityNotFound(_0x584408,_0xc86921){return function(_0x320379){if(!_0x320379){_0x584408['sendStatus'](0x194);}return _0x320379;};}function handleError(_0x32a5d1,_0x5db126){_0x5db126=_0x5db126||0x1f4;return function(_0x3c56de){logger[_0xaa3e('0x27')](_0x3c56de[_0xaa3e('0x38')]);if(_0x3c56de[_0xaa3e('0x39')]){delete _0x3c56de[_0xaa3e('0x39')];}_0x32a5d1['status'](_0x5db126)[_0xaa3e('0x3a')](_0x3c56de);};}exports[_0xaa3e('0x3b')]=function(_0x395419,_0x1196df){var _0xda04d7={},_0x553553={},_0x172de3={'count':0x0,'rows':[]};var _0x117fab=_[_0xaa3e('0x3c')](db['ZohoAccount'][_0xaa3e('0x3d')],function(_0xad2f54){return{'name':_0xad2f54[_0xaa3e('0x3e')],'type':_0xad2f54[_0xaa3e('0x3f')][_0xaa3e('0x40')]};});_0x553553['model']=_['map'](_0x117fab,_0xaa3e('0x39'));_0x553553[_0xaa3e('0x41')]=_[_0xaa3e('0x42')](_0x395419['query']);_0x553553[_0xaa3e('0x43')]=_[_0xaa3e('0x44')](_0x553553['model'],_0x553553['query']);_0xda04d7[_0xaa3e('0x45')]=_[_0xaa3e('0x44')](_0x553553['model'],qs['fields'](_0x395419['query']['fields']));_0xda04d7[_0xaa3e('0x45')]=_0xda04d7[_0xaa3e('0x45')][_0xaa3e('0x46')]?_0xda04d7['attributes']:_0x553553[_0xaa3e('0x47')];if(!_0x395419[_0xaa3e('0x41')]['hasOwnProperty'](_0xaa3e('0x48'))){_0xda04d7[_0xaa3e('0x30')]=qs[_0xaa3e('0x30')](_0x395419['query'][_0xaa3e('0x30')]);_0xda04d7[_0xaa3e('0x2f')]=qs[_0xaa3e('0x2f')](_0x395419[_0xaa3e('0x41')][_0xaa3e('0x2f')]);}_0xda04d7['order']=qs[_0xaa3e('0x49')](_0x395419[_0xaa3e('0x41')][_0xaa3e('0x49')]);_0xda04d7[_0xaa3e('0x4a')]=qs[_0xaa3e('0x43')](_['pick'](_0x395419['query'],_0x553553[_0xaa3e('0x43')]));if(_0x395419[_0xaa3e('0x41')][_0xaa3e('0x4b')]){_0xda04d7['where']=_[_0xaa3e('0x4c')](_0xda04d7[_0xaa3e('0x4a')],{'$or':_[_0xaa3e('0x3c')](_0x117fab,function(_0xc60591){if(_0xc60591[_0xaa3e('0x3f')]!=='VIRTUAL'){var _0x5e202d={};_0x5e202d[_0xc60591['name']]={'$like':'%'+_0x395419['query']['filter']+'%'};return _0x5e202d;}})});}_0xda04d7=_[_0xaa3e('0x4c')]({},_0xda04d7,_0x395419[_0xaa3e('0x4d')]);var _0x17c556={'where':_0xda04d7['where']};return db[_0xaa3e('0x4e')][_0xaa3e('0x2e')](_0x17c556)[_0xaa3e('0x23')](function(_0x4fb8dd){_0x172de3[_0xaa3e('0x2e')]=_0x4fb8dd;if(_0x395419[_0xaa3e('0x41')][_0xaa3e('0x4f')]){_0xda04d7[_0xaa3e('0x50')]=[{'all':!![]}];}return db[_0xaa3e('0x4e')][_0xaa3e('0x51')](_0xda04d7);})[_0xaa3e('0x23')](function(_0x20e142){_0x172de3[_0xaa3e('0x52')]=_0x20e142;return _0x172de3;})['then'](respondWithFilteredResult(_0x1196df,_0xda04d7))[_0xaa3e('0x53')](handleError(_0x1196df,null));};exports['show']=function(_0xcd2cfb,_0x2cb274){var _0x4bb52e={'raw':![],'where':{'id':_0xcd2cfb['params']['id']}},_0x5233c8={};_0x5233c8[_0xaa3e('0x47')]=_['keys'](db['ZohoAccount'][_0xaa3e('0x3d')]);_0x5233c8[_0xaa3e('0x41')]=_['keys'](_0xcd2cfb[_0xaa3e('0x41')]);_0x5233c8[_0xaa3e('0x43')]=_[_0xaa3e('0x44')](_0x5233c8[_0xaa3e('0x47')],_0x5233c8['query']);_0x4bb52e[_0xaa3e('0x45')]=_[_0xaa3e('0x44')](_0x5233c8['model'],qs['fields'](_0xcd2cfb[_0xaa3e('0x41')][_0xaa3e('0x54')]));_0x4bb52e[_0xaa3e('0x45')]=_0x4bb52e[_0xaa3e('0x45')][_0xaa3e('0x46')]?_0x4bb52e[_0xaa3e('0x45')]:_0x5233c8[_0xaa3e('0x47')];if(_0xcd2cfb[_0xaa3e('0x41')][_0xaa3e('0x4f')]){_0x4bb52e[_0xaa3e('0x50')]=[{'all':!![]}];}_0x4bb52e=_[_0xaa3e('0x4c')]({},_0x4bb52e,_0xcd2cfb[_0xaa3e('0x4d')]);return db[_0xaa3e('0x4e')]['find'](_0x4bb52e)[_0xaa3e('0x23')](handleEntityNotFound(_0x2cb274,null))[_0xaa3e('0x23')](respondWithResult(_0x2cb274,null))['catch'](handleError(_0x2cb274,null));};exports['create']=function(_0x140fa7,_0x4da86f){return db[_0xaa3e('0x4e')][_0xaa3e('0x55')](_0x140fa7[_0xaa3e('0x56')],{})[_0xaa3e('0x23')](respondWithResult(_0x4da86f,0xc9))[_0xaa3e('0x53')](handleError(_0x4da86f,null));};exports[_0xaa3e('0x35')]=function(_0x4524fa,_0x5101de){if(_0x4524fa[_0xaa3e('0x56')]['id']){delete _0x4524fa[_0xaa3e('0x56')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x4524fa['params']['id']}})['then'](handleEntityNotFound(_0x5101de,null))[_0xaa3e('0x23')](saveUpdates(_0x4524fa[_0xaa3e('0x56')],null))[_0xaa3e('0x23')](respondWithResult(_0x5101de,null))[_0xaa3e('0x53')](handleError(_0x5101de,null));};exports[_0xaa3e('0x36')]=function(_0x474fd1,_0x59df58){return db[_0xaa3e('0x4e')][_0xaa3e('0x57')]({'where':{'id':_0x474fd1['params']['id']}})[_0xaa3e('0x23')](handleEntityNotFound(_0x59df58,null))[_0xaa3e('0x23')](removeEntity(_0x59df58,null))[_0xaa3e('0x53')](handleError(_0x59df58,null));};exports[_0xaa3e('0x58')]=function(_0x304d98,_0x502e3e,_0x30f0a4){var _0x371795={};var _0xab2450={};var _0x43ae41;var _0xe99330;return db[_0xaa3e('0x4e')][_0xaa3e('0x59')]({'where':{'id':_0x304d98[_0xaa3e('0x5a')]['id']}})[_0xaa3e('0x23')](handleEntityNotFound(_0x502e3e,null))['then'](function(_0x4794cf){if(_0x4794cf){_0x43ae41=_0x4794cf;_0xab2450[_0xaa3e('0x47')]=_['keys'](db[_0xaa3e('0x5b')][_0xaa3e('0x3d')]);_0xab2450['query']=_[_0xaa3e('0x42')](_0x304d98[_0xaa3e('0x41')]);_0xab2450[_0xaa3e('0x43')]=_[_0xaa3e('0x44')](_0xab2450[_0xaa3e('0x47')],_0xab2450['query']);_0x371795[_0xaa3e('0x45')]=_['intersection'](_0xab2450[_0xaa3e('0x47')],qs[_0xaa3e('0x54')](_0x304d98[_0xaa3e('0x41')]['fields']));_0x371795[_0xaa3e('0x45')]=_0x371795[_0xaa3e('0x45')]['length']?_0x371795[_0xaa3e('0x45')]:_0xab2450['model'];_0x371795[_0xaa3e('0x5c')]=qs[_0xaa3e('0x49')](_0x304d98[_0xaa3e('0x41')]['sort']);_0x371795[_0xaa3e('0x4a')]=qs[_0xaa3e('0x43')](_['pick'](_0x304d98[_0xaa3e('0x41')],_0xab2450[_0xaa3e('0x43')]));if(_0x304d98[_0xaa3e('0x41')][_0xaa3e('0x4b')]){_0x371795[_0xaa3e('0x4a')]=_[_0xaa3e('0x4c')](_0x371795[_0xaa3e('0x4a')],{'$or':_['map'](_0x371795[_0xaa3e('0x45')],function(_0x45bb01){var _0x87c860={};_0x87c860[_0x45bb01]={'$like':'%'+_0x304d98[_0xaa3e('0x41')][_0xaa3e('0x4b')]+'%'};return _0x87c860;})});}_0x371795=_[_0xaa3e('0x4c')]({},_0x371795,_0x304d98['options']);return _0x43ae41[_0xaa3e('0x58')](_0x371795);}})['then'](function(_0x38ef5f){if(_0x38ef5f){_0xe99330=_0x38ef5f['length'];if(!_0x304d98[_0xaa3e('0x41')][_0xaa3e('0x5d')]('nolimit')){_0x371795[_0xaa3e('0x30')]=qs['limit'](_0x304d98[_0xaa3e('0x41')][_0xaa3e('0x30')]);_0x371795[_0xaa3e('0x2f')]=qs[_0xaa3e('0x2f')](_0x304d98[_0xaa3e('0x41')][_0xaa3e('0x2f')]);}return _0x43ae41[_0xaa3e('0x58')](_0x371795);}})['then'](function(_0x4fa3c8){if(_0x4fa3c8){return _0x4fa3c8?{'count':_0xe99330,'rows':_0x4fa3c8}:null;}})[_0xaa3e('0x23')](respondWithResult(_0x502e3e,null))[_0xaa3e('0x53')](handleError(_0x502e3e,null));};exports['addConfiguration']=function(_0x53ca88,_0x257c47,_0x36a89f){if(_0x53ca88[_0xaa3e('0x56')]['id']){delete _0x53ca88['body']['id'];}return db[_0xaa3e('0x4e')][_0xaa3e('0x59')]({'where':{'id':_0x53ca88['params']['id']}})['then'](handleEntityNotFound(_0x257c47,null))[_0xaa3e('0x23')](function(_0x1c1368){if(_0x1c1368){_0x53ca88['body'][_0xaa3e('0x5e')]=_0x1c1368['id'];_0x53ca88[_0xaa3e('0x56')]['Subjects']=integrations['getSubjects'](_0x53ca88[_0xaa3e('0x56')][_0xaa3e('0x5f')],_0x53ca88[_0xaa3e('0x56')][_0xaa3e('0x3f')]);_0x53ca88[_0xaa3e('0x56')][_0xaa3e('0x60')]=integrations[_0xaa3e('0x61')](_0x53ca88[_0xaa3e('0x56')][_0xaa3e('0x5f')],_0x53ca88['body'][_0xaa3e('0x3f')]);return db['ZohoConfiguration'][_0xaa3e('0x55')](_0x53ca88['body'],{'include':[{'model':db[_0xaa3e('0x62')],'as':'Subjects'},{'model':db[_0xaa3e('0x62')],'as':_0xaa3e('0x60')}]});}return null;})['then'](respondWithResult(_0x257c47,null))[_0xaa3e('0x53')](handleError(_0x257c47,null));};function getAccessToken(_0x53247a){return new Promise(function(_0x401eff,_0x399206){var _0x1fa75e;switch(_0x53247a[_0xaa3e('0x63')]){case'US':_0x1fa75e=_0xaa3e('0x64');break;case'AU':_0x1fa75e=_0xaa3e('0x65');break;case'EU':_0x1fa75e=_0xaa3e('0x66');break;case'IN':_0x1fa75e=_0xaa3e('0x67');break;case'CN':_0x1fa75e='https://accounts.zoho.com.cn';break;default:_0x1fa75e=_0xaa3e('0x66');break;}var _0x2a1899={'method':'POST','uri':_0x1fa75e+_0xaa3e('0x68'),'qs':{'refresh_token':_0x53247a[_0xaa3e('0x69')],'client_id':_0x53247a[_0xaa3e('0x6a')],'client_secret':_0x53247a[_0xaa3e('0x6b')],'grant_type':_0xaa3e('0x6c')},'json':!![]};return rp(_0x2a1899)[_0xaa3e('0x23')](function(_0x2b7eb1){if(_0x2b7eb1[_0xaa3e('0x6d')]){_0x401eff(_0x2b7eb1['access_token']);}else{_0x399206(_0xaa3e('0x6e'));}})['catch'](function(_0x976b23){_0x399206(_0x976b23);});});}exports[_0xaa3e('0x6f')]=function(_0x3453ba,_0x1bae09,_0x3632fb){var _0x95f783,_0x113a72,_0x31b9de,_0x528d15,_0x2e7fed;return db[_0xaa3e('0x4e')][_0xaa3e('0x59')]({'where':{'id':_0x3453ba[_0xaa3e('0x5a')]['id']},'attributes':['id',_0xaa3e('0x70'),_0xaa3e('0x63'),_0xaa3e('0x6a'),_0xaa3e('0x6b'),_0xaa3e('0x71'),_0xaa3e('0x28'),'refreshToken']})[_0xaa3e('0x23')](handleEntityNotFound(_0x1bae09,null))[_0xaa3e('0x23')](function(_0x46c78b){_0x2e7fed=_0x46c78b;_0x95f783=_0x2e7fed['host'];_0x113a72=_0x95f783===_0xaa3e('0x72')?'eu':_0xaa3e('0x73');_0x31b9de=_0x2e7fed['serverUrl'];var _0x22ad98=_0x31b9de[_0xaa3e('0x74')](-0x1);if(_0x22ad98==='/'||_0x22ad98==='\x5c'||_0x22ad98===':'){_0x31b9de=_0x31b9de[_0xaa3e('0x75')](0x0,_0x31b9de['lastIndexOf'](_0x22ad98));}if(!_0x2e7fed[_0xaa3e('0x69')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x2e7fed);})['then'](function(_0x23b3ac){if(_0x23b3ac){return rp({'method':'GET','uri':util[_0xaa3e('0x76')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x113a72),'qs':{'module':_0xaa3e('0x77')},'headers':{'Authorization':_0xaa3e('0x78')+_0x23b3ac},'json':!![]});}})[_0xaa3e('0x23')](function(_0x14cdb3){if(_0x14cdb3){if(_0x14cdb3['response']&&_0x14cdb3[_0xaa3e('0x79')]['error']){throw new Error(_0x14cdb3[_0xaa3e('0x79')][_0xaa3e('0x27')][_0xaa3e('0x29')]);}var _0x313d99=[];var _0x484257=[];var _0xcd0c0b=[_0xaa3e('0x7a'),_0xaa3e('0x7b'),_0xaa3e('0x7c'),_0xaa3e('0x7d'),'Call_Duration',_0xaa3e('0x7e'),'Call_Start_Time',_0xaa3e('0x7f')];_0x484257=_[_0xaa3e('0x80')](_0x14cdb3['fields'],function(_0x1ad125){return _0xcd0c0b[_0xaa3e('0x81')](_0x1ad125[_0xaa3e('0x82')]);});for(var _0x381d39=0x0;_0x381d39<_0x484257['length'];_0x381d39++){if(_0x484257[_0x381d39][_0xaa3e('0x83')]===![]){_0x313d99[_0xaa3e('0x84')]({'id':_0x484257[_0x381d39]['id'],'name':_0x484257[_0x381d39][_0xaa3e('0x85')],'custom':_0x484257[_0x381d39][_0xaa3e('0x86')],'options':_0x484257[_0x381d39]['data_type']==='picklist'&&_0x484257[_0x381d39][_0xaa3e('0x87')][_0xaa3e('0x46')]>-0x1?_[_0xaa3e('0x3c')](_0x484257[_0x381d39][_0xaa3e('0x87')],function(_0x449b81){return{'name':_0x449b81,'value':_0x449b81};}):[]});}}return{'count':_0x313d99[_0xaa3e('0x46')],'rows':_0x313d99};}else{return{'count':0x0,'rows':[]};}})[_0xaa3e('0x23')](respondWithResult(_0x1bae09,null))[_0xaa3e('0x53')](function(_0x3d8bec){var _0x5123b2=_0x3453ba[_0xaa3e('0x41')]['test']?0x1f4:_0x3d8bec[_0xaa3e('0x88')]||0x1f4;logger['error'](_0xaa3e('0x89'),'getFields',_0x5123b2,JSON[_0xaa3e('0x8a')](_0x3d8bec));delete _0x3d8bec['name'];if(_0x5123b2===0x191){_0x5123b2=0x190;}_0x1bae09[_0xaa3e('0x2c')](_0x5123b2)[_0xaa3e('0x3a')](_0x3453ba[_0xaa3e('0x41')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3d8bec['statusCode']}:_0x3d8bec);});}; \ No newline at end of file +var _0x028a=['ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','apply','save','update','destroy','end','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','create','body','find','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','Descriptions','channel'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x028a,0x1c0));var _0xa028=function(_0x134e81,_0x16b70f){_0x134e81=_0x134e81-0x0;var _0x1cee27=_0x028a[_0x134e81];return _0x1cee27;};'use strict';var pdf=require(_0xa028('0x0'));var emlformat=require(_0xa028('0x1'));var rimraf=require(_0xa028('0x2'));var zipdir=require(_0xa028('0x3'));var jsonpatch=require(_0xa028('0x4'));var rp=require(_0xa028('0x5'));var moment=require('moment');var BPromise=require(_0xa028('0x6'));var Mustache=require(_0xa028('0x7'));var util=require('util');var path=require(_0xa028('0x8'));var sox=require(_0xa028('0x9'));var csv=require('to-csv');var ejs=require(_0xa028('0xa'));var fs=require('fs');var _=require(_0xa028('0xb'));var squel=require(_0xa028('0xc'));var crypto=require(_0xa028('0xd'));var jsforce=require(_0xa028('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa028('0xf'));var querystring=require(_0xa028('0x10'));var Papa=require(_0xa028('0x11'));var Redis=require('ioredis');var authService=require(_0xa028('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa028('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa028('0x14'))(_0xa028('0x15'));var utils=require('../../config/utils');var config=require(_0xa028('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa028('0x17'));var client=jayson[_0xa028('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x36e50f,_0x29afb6,_0x3c2ded){if(_0x3c2ded){var _0x1dd72f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1dd72f['test'](_0x29afb6)){return _0x36e50f;}else{throw new db[(_0xa028('0x19'))][(_0xa028('0x1a'))](_0xa028('0x1b'));}}else{return _0x36e50f;}}function respondWithRpcPromise(_0x588cce,_0x1904c9,_0x32b6f1,_0xb1db4b){return new BPromise(function(_0x129f8a,_0x450835){var _0x464dde=_0xb1db4b||client;return _0x464dde[_0xa028('0x1c')](_0x588cce,_0x32b6f1)['then'](function(_0x1c988e){logger[_0xa028('0x1d')](_0xa028('0x1e'),_0x1904c9,_0xa028('0x1f'));logger['debug'](_0xa028('0x20'),_0x1904c9,_0xa028('0x1f'),JSON[_0xa028('0x21')](_0x1c988e));if(_0x1c988e[_0xa028('0x22')]){if(_0x1c988e[_0xa028('0x22')]['code']===0x1f4){logger[_0xa028('0x22')](_0xa028('0x1e'),_0x1904c9,_0x1c988e['error'][_0xa028('0x23')]);return _0x450835(_0x1c988e[_0xa028('0x22')]['message']);}logger[_0xa028('0x22')](_0xa028('0x1e'),_0x1904c9,_0x1c988e['error']['message']);return _0x129f8a(_0x1c988e[_0xa028('0x22')]['message']);}else{logger[_0xa028('0x1d')](_0xa028('0x1e'),_0x1904c9,_0xa028('0x1f'));_0x129f8a(_0x1c988e[_0xa028('0x24')]['message']);}})[_0xa028('0x25')](function(_0xf4773){logger[_0xa028('0x22')](_0xa028('0x1e'),_0x1904c9,_0xf4773);_0x450835(_0xf4773);});});}function respondWithStatusCode(_0x18bd42,_0x5cd3c3){_0x5cd3c3=_0x5cd3c3||0xcc;return function(_0x28e643){if(_0x28e643){return _0x18bd42[_0xa028('0x26')](_0x5cd3c3);}return _0x18bd42[_0xa028('0x27')](_0x5cd3c3)['end']();};}function respondWithResult(_0x1fa532,_0x5580ce){_0x5580ce=_0x5580ce||0xc8;return function(_0x2fc304){if(_0x2fc304){return _0x1fa532[_0xa028('0x27')](_0x5580ce)[_0xa028('0x28')](_0x2fc304);}};}function respondWithFilteredResult(_0x4ca8f8,_0x18d19b){return function(_0x5cfc6b){if(_0x5cfc6b){var _0x320fdd=_0x5cfc6b[_0xa028('0x29')],_0x344800=_0x18d19b[_0xa028('0x2a')],_0x49235f=_0x18d19b[_0xa028('0x2a')]+_0x18d19b[_0xa028('0x2b')],_0x5d36d5;if(_0x49235f>=_0x320fdd){_0x49235f=_0x320fdd;_0x5d36d5=0xc8;}else{_0x5d36d5=0xce;}_0x4ca8f8[_0xa028('0x27')](_0x5d36d5);return _0x4ca8f8['set']('Content-Range',_0x344800+'-'+_0x49235f+'/'+_0x320fdd)['json'](_0x5cfc6b);}return null;};}function patchUpdates(_0x43d39b){return function(_0x2c70ec){try{jsonpatch[_0xa028('0x2c')](_0x2c70ec,_0x43d39b,!![]);}catch(_0x41ecef){return BPromise['reject'](_0x41ecef);}return _0x2c70ec[_0xa028('0x2d')]();};}function saveUpdates(_0x4881e6,_0x21a625){return function(_0xce9590){if(_0xce9590){return _0xce9590[_0xa028('0x2e')](_0x4881e6)['then'](function(_0xa281ae){return _0xa281ae;});}return null;};}function removeEntity(_0x55f47f,_0x1fa3d1){return function(_0x12e81f){if(_0x12e81f){return _0x12e81f[_0xa028('0x2f')]()['then'](function(){_0x55f47f[_0xa028('0x27')](0xcc)[_0xa028('0x30')]();});}};}function handleEntityNotFound(_0x2240ac,_0x53ae1b){return function(_0x29bc0a){if(!_0x29bc0a){_0x2240ac[_0xa028('0x26')](0x194);}return _0x29bc0a;};}function handleError(_0x2cb49a,_0x93323a){_0x93323a=_0x93323a||0x1f4;return function(_0x5d53dc){logger[_0xa028('0x22')](_0x5d53dc['stack']);if(_0x5d53dc['name']){delete _0x5d53dc[_0xa028('0x31')];}_0x2cb49a[_0xa028('0x27')](_0x93323a)[_0xa028('0x32')](_0x5d53dc);};}exports[_0xa028('0x33')]=function(_0x424287,_0x35b709){var _0x35cc6d={},_0x6c17b3={},_0x543909={'count':0x0,'rows':[]};var _0x5859f7=_[_0xa028('0x34')](db[_0xa028('0x35')][_0xa028('0x36')],function(_0x5ee136){return{'name':_0x5ee136[_0xa028('0x37')],'type':_0x5ee136[_0xa028('0x38')]['key']};});_0x6c17b3[_0xa028('0x39')]=_[_0xa028('0x34')](_0x5859f7,'name');_0x6c17b3[_0xa028('0x3a')]=_[_0xa028('0x3b')](_0x424287[_0xa028('0x3a')]);_0x6c17b3['filters']=_['intersection'](_0x6c17b3[_0xa028('0x39')],_0x6c17b3[_0xa028('0x3a')]);_0x35cc6d[_0xa028('0x3c')]=_[_0xa028('0x3d')](_0x6c17b3[_0xa028('0x39')],qs['fields'](_0x424287[_0xa028('0x3a')][_0xa028('0x3e')]));_0x35cc6d[_0xa028('0x3c')]=_0x35cc6d[_0xa028('0x3c')][_0xa028('0x3f')]?_0x35cc6d[_0xa028('0x3c')]:_0x6c17b3[_0xa028('0x39')];if(!_0x424287['query']['hasOwnProperty'](_0xa028('0x40'))){_0x35cc6d[_0xa028('0x2b')]=qs[_0xa028('0x2b')](_0x424287['query'][_0xa028('0x2b')]);_0x35cc6d[_0xa028('0x2a')]=qs[_0xa028('0x2a')](_0x424287[_0xa028('0x3a')][_0xa028('0x2a')]);}_0x35cc6d['order']=qs['sort'](_0x424287['query'][_0xa028('0x41')]);_0x35cc6d['where']=qs[_0xa028('0x42')](_[_0xa028('0x43')](_0x424287[_0xa028('0x3a')],_0x6c17b3[_0xa028('0x42')]));if(_0x424287[_0xa028('0x3a')][_0xa028('0x44')]){_0x35cc6d['where']=_[_0xa028('0x45')](_0x35cc6d[_0xa028('0x46')],{'$or':_['map'](_0x5859f7,function(_0x527e39){if(_0x527e39['type']!==_0xa028('0x47')){var _0x50b6d0={};_0x50b6d0[_0x527e39['name']]={'$like':'%'+_0x424287[_0xa028('0x3a')][_0xa028('0x44')]+'%'};return _0x50b6d0;}})});}_0x35cc6d=_['merge']({},_0x35cc6d,_0x424287[_0xa028('0x48')]);var _0x6aa8a4={'where':_0x35cc6d[_0xa028('0x46')]};return db[_0xa028('0x35')][_0xa028('0x29')](_0x6aa8a4)[_0xa028('0x49')](function(_0x512d04){_0x543909[_0xa028('0x29')]=_0x512d04;if(_0x424287[_0xa028('0x3a')][_0xa028('0x4a')]){_0x35cc6d[_0xa028('0x4b')]=[{'all':!![]}];}return db['ZohoAccount'][_0xa028('0x4c')](_0x35cc6d);})[_0xa028('0x49')](function(_0x1f2fa5){_0x543909[_0xa028('0x4d')]=_0x1f2fa5;return _0x543909;})['then'](respondWithFilteredResult(_0x35b709,_0x35cc6d))['catch'](handleError(_0x35b709,null));};exports[_0xa028('0x4e')]=function(_0x46fa25,_0x3b2bf1){var _0x38ccce={'raw':![],'where':{'id':_0x46fa25[_0xa028('0x4f')]['id']}},_0x1f7c56={};_0x1f7c56[_0xa028('0x39')]=_[_0xa028('0x3b')](db[_0xa028('0x35')][_0xa028('0x36')]);_0x1f7c56['query']=_[_0xa028('0x3b')](_0x46fa25[_0xa028('0x3a')]);_0x1f7c56[_0xa028('0x42')]=_['intersection'](_0x1f7c56['model'],_0x1f7c56[_0xa028('0x3a')]);_0x38ccce['attributes']=_[_0xa028('0x3d')](_0x1f7c56[_0xa028('0x39')],qs[_0xa028('0x3e')](_0x46fa25[_0xa028('0x3a')][_0xa028('0x3e')]));_0x38ccce[_0xa028('0x3c')]=_0x38ccce['attributes'][_0xa028('0x3f')]?_0x38ccce[_0xa028('0x3c')]:_0x1f7c56['model'];if(_0x46fa25[_0xa028('0x3a')][_0xa028('0x4a')]){_0x38ccce[_0xa028('0x4b')]=[{'all':!![]}];}_0x38ccce=_[_0xa028('0x45')]({},_0x38ccce,_0x46fa25[_0xa028('0x48')]);return db[_0xa028('0x35')]['find'](_0x38ccce)[_0xa028('0x49')](handleEntityNotFound(_0x3b2bf1,null))[_0xa028('0x49')](respondWithResult(_0x3b2bf1,null))['catch'](handleError(_0x3b2bf1,null));};exports['create']=function(_0x819cd5,_0x2a99e2){return db[_0xa028('0x35')][_0xa028('0x50')](_0x819cd5[_0xa028('0x51')],{})['then'](respondWithResult(_0x2a99e2,0xc9))[_0xa028('0x25')](handleError(_0x2a99e2,null));};exports[_0xa028('0x2e')]=function(_0x353718,_0x56845f){if(_0x353718[_0xa028('0x51')]['id']){delete _0x353718[_0xa028('0x51')]['id'];}return db[_0xa028('0x35')]['find']({'where':{'id':_0x353718[_0xa028('0x4f')]['id']}})['then'](handleEntityNotFound(_0x56845f,null))[_0xa028('0x49')](saveUpdates(_0x353718[_0xa028('0x51')],null))[_0xa028('0x49')](respondWithResult(_0x56845f,null))[_0xa028('0x25')](handleError(_0x56845f,null));};exports[_0xa028('0x2f')]=function(_0x53d8d6,_0x5b4ce1){return db[_0xa028('0x35')][_0xa028('0x52')]({'where':{'id':_0x53d8d6[_0xa028('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b4ce1,null))[_0xa028('0x49')](removeEntity(_0x5b4ce1,null))[_0xa028('0x25')](handleError(_0x5b4ce1,null));};exports[_0xa028('0x53')]=function(_0x3c24ad,_0x230ec4,_0x3b1205){var _0x36a745={};var _0x2a982c={};var _0x1112ca;var _0x9f51b4;return db[_0xa028('0x35')][_0xa028('0x54')]({'where':{'id':_0x3c24ad[_0xa028('0x4f')]['id']}})[_0xa028('0x49')](handleEntityNotFound(_0x230ec4,null))[_0xa028('0x49')](function(_0x64e294){if(_0x64e294){_0x1112ca=_0x64e294;_0x2a982c[_0xa028('0x39')]=_['keys'](db[_0xa028('0x55')][_0xa028('0x36')]);_0x2a982c[_0xa028('0x3a')]=_[_0xa028('0x3b')](_0x3c24ad[_0xa028('0x3a')]);_0x2a982c['filters']=_[_0xa028('0x3d')](_0x2a982c['model'],_0x2a982c[_0xa028('0x3a')]);_0x36a745[_0xa028('0x3c')]=_[_0xa028('0x3d')](_0x2a982c[_0xa028('0x39')],qs[_0xa028('0x3e')](_0x3c24ad[_0xa028('0x3a')][_0xa028('0x3e')]));_0x36a745[_0xa028('0x3c')]=_0x36a745[_0xa028('0x3c')][_0xa028('0x3f')]?_0x36a745[_0xa028('0x3c')]:_0x2a982c[_0xa028('0x39')];_0x36a745['order']=qs['sort'](_0x3c24ad['query']['sort']);_0x36a745['where']=qs[_0xa028('0x42')](_[_0xa028('0x43')](_0x3c24ad[_0xa028('0x3a')],_0x2a982c['filters']));if(_0x3c24ad[_0xa028('0x3a')]['filter']){_0x36a745['where']=_[_0xa028('0x45')](_0x36a745[_0xa028('0x46')],{'$or':_['map'](_0x36a745['attributes'],function(_0x3ccd94){var _0x4c5854={};_0x4c5854[_0x3ccd94]={'$like':'%'+_0x3c24ad[_0xa028('0x3a')][_0xa028('0x44')]+'%'};return _0x4c5854;})});}_0x36a745=_[_0xa028('0x45')]({},_0x36a745,_0x3c24ad[_0xa028('0x48')]);return _0x1112ca['getConfigurations'](_0x36a745);}})[_0xa028('0x49')](function(_0x16da5f){if(_0x16da5f){_0x9f51b4=_0x16da5f['length'];if(!_0x3c24ad[_0xa028('0x3a')][_0xa028('0x56')](_0xa028('0x40'))){_0x36a745[_0xa028('0x2b')]=qs['limit'](_0x3c24ad[_0xa028('0x3a')][_0xa028('0x2b')]);_0x36a745['offset']=qs[_0xa028('0x2a')](_0x3c24ad['query'][_0xa028('0x2a')]);}return _0x1112ca[_0xa028('0x53')](_0x36a745);}})['then'](function(_0x2bf4e1){if(_0x2bf4e1){return _0x2bf4e1?{'count':_0x9f51b4,'rows':_0x2bf4e1}:null;}})['then'](respondWithResult(_0x230ec4,null))[_0xa028('0x25')](handleError(_0x230ec4,null));};exports[_0xa028('0x57')]=function(_0x458bc2,_0x299ed6,_0xf26afd){if(_0x458bc2[_0xa028('0x51')]['id']){delete _0x458bc2[_0xa028('0x51')]['id'];}return db[_0xa028('0x35')]['findOne']({'where':{'id':_0x458bc2['params']['id']}})[_0xa028('0x49')](handleEntityNotFound(_0x299ed6,null))[_0xa028('0x49')](function(_0x177771){if(_0x177771){_0x458bc2['body'][_0xa028('0x58')]=_0x177771['id'];_0x458bc2[_0xa028('0x51')][_0xa028('0x59')]=integrations['getSubjects'](_0x458bc2[_0xa028('0x51')]['channel'],_0x458bc2[_0xa028('0x51')][_0xa028('0x38')]);_0x458bc2[_0xa028('0x51')][_0xa028('0x5a')]=integrations['getDescriptions'](_0x458bc2['body'][_0xa028('0x5b')],_0x458bc2['body'][_0xa028('0x38')]);return db['ZohoConfiguration'][_0xa028('0x50')](_0x458bc2[_0xa028('0x51')],{'include':[{'model':db[_0xa028('0x5c')],'as':'Subjects'},{'model':db[_0xa028('0x5c')],'as':_0xa028('0x5a')}]});}return null;})['then'](respondWithResult(_0x299ed6,null))[_0xa028('0x25')](handleError(_0x299ed6,null));};function getAccessToken(_0x510180){return new Promise(function(_0x1a0b35,_0x1b0db0){var _0x53fd88;switch(_0x510180[_0xa028('0x5d')]){case'US':_0x53fd88=_0xa028('0x5e');break;case'AU':_0x53fd88=_0xa028('0x5f');break;case'EU':_0x53fd88=_0xa028('0x60');break;case'IN':_0x53fd88=_0xa028('0x61');break;case'CN':_0x53fd88=_0xa028('0x62');break;default:_0x53fd88='https://accounts.zoho.eu';break;}var _0x6fefc3={'method':_0xa028('0x63'),'uri':_0x53fd88+_0xa028('0x64'),'qs':{'refresh_token':_0x510180[_0xa028('0x65')],'client_id':_0x510180[_0xa028('0x66')],'client_secret':_0x510180[_0xa028('0x67')],'grant_type':_0xa028('0x68')},'json':!![]};return rp(_0x6fefc3)[_0xa028('0x49')](function(_0x583991){if(_0x583991[_0xa028('0x69')]){_0x1a0b35(_0x583991[_0xa028('0x69')]);}else{_0x1b0db0(_0xa028('0x6a'));}})[_0xa028('0x25')](function(_0x700e93){_0x1b0db0(_0x700e93);});});}exports[_0xa028('0x6b')]=function(_0x367e40,_0x3b8281,_0x3ddb84){var _0x23e45a,_0x69fa7,_0x51c6fb,_0x4e5a97,_0x2578ad;return db[_0xa028('0x35')][_0xa028('0x54')]({'where':{'id':_0x367e40[_0xa028('0x4f')]['id']},'attributes':['id',_0xa028('0x6c'),'zone',_0xa028('0x66'),_0xa028('0x67'),_0xa028('0x6d'),_0xa028('0x6e'),_0xa028('0x65')]})['then'](handleEntityNotFound(_0x3b8281,null))[_0xa028('0x49')](function(_0x215145){_0x2578ad=_0x215145;_0x23e45a=_0x2578ad[_0xa028('0x6c')];_0x69fa7=_0x23e45a==='zoho.eu'?'eu':_0xa028('0x6f');_0x51c6fb=_0x2578ad[_0xa028('0x6d')];var _0x234e1b=_0x51c6fb[_0xa028('0x70')](-0x1);if(_0x234e1b==='/'||_0x234e1b==='\x5c'||_0x234e1b===':'){_0x51c6fb=_0x51c6fb[_0xa028('0x71')](0x0,_0x51c6fb[_0xa028('0x72')](_0x234e1b));}if(!_0x2578ad['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x2578ad);})['then'](function(_0x588408){if(_0x588408){return rp({'method':_0xa028('0x73'),'uri':util[_0xa028('0x74')](_0xa028('0x75'),_0x69fa7),'qs':{'module':'Calls'},'headers':{'Authorization':_0xa028('0x76')+_0x588408},'json':!![]});}})[_0xa028('0x49')](function(_0xa3460){if(_0xa3460){if(_0xa3460['response']&&_0xa3460[_0xa028('0x77')][_0xa028('0x22')]){throw new Error(_0xa3460[_0xa028('0x77')]['error'][_0xa028('0x23')]);}var _0x1611dc=[];var _0x525f7c=[];var _0x41eb86=['Owner',_0xa028('0x78'),_0xa028('0x79'),_0xa028('0x7a'),_0xa028('0x7b'),_0xa028('0x7c'),'Call_Start_Time',_0xa028('0x7d')];_0x525f7c=_[_0xa028('0x7e')](_0xa3460[_0xa028('0x3e')],function(_0x3ba54f){return _0x41eb86['includes'](_0x3ba54f[_0xa028('0x7f')]);});for(var _0x26495c=0x0;_0x26495c<_0x525f7c[_0xa028('0x3f')];_0x26495c++){if(_0x525f7c[_0x26495c]['system_mandatory']===![]){_0x1611dc['push']({'id':_0x525f7c[_0x26495c]['id'],'name':_0x525f7c[_0x26495c][_0xa028('0x80')],'custom':_0x525f7c[_0x26495c][_0xa028('0x81')],'options':_0x525f7c[_0x26495c][_0xa028('0x82')]==='picklist'&&_0x525f7c[_0x26495c]['pick_list_values'][_0xa028('0x3f')]>-0x1?_[_0xa028('0x34')](_0x525f7c[_0x26495c][_0xa028('0x83')],function(_0x2fef53){return{'name':_0x2fef53,'value':_0x2fef53};}):[]});}}return{'count':_0x1611dc[_0xa028('0x3f')],'rows':_0x1611dc};}else{return{'count':0x0,'rows':[]};}})[_0xa028('0x49')](respondWithResult(_0x3b8281,null))[_0xa028('0x25')](function(_0x23b4b4){var _0x362ba5=_0x367e40['query'][_0xa028('0x84')]?0x1f4:_0x23b4b4[_0xa028('0x85')]||0x1f4;logger[_0xa028('0x22')](_0xa028('0x86'),_0xa028('0x6b'),_0x362ba5,JSON[_0xa028('0x21')](_0x23b4b4));delete _0x23b4b4[_0xa028('0x31')];if(_0x362ba5===0x191){_0x362ba5=0x190;}_0x3b8281[_0xa028('0x27')](_0x362ba5)[_0xa028('0x32')](_0x367e40[_0xa028('0x3a')][_0xa028('0x84')]?{'message':'Wrong\x20credentials','statusCode':_0x23b4b4[_0xa028('0x85')]}:_0x23b4b4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f3702e9..dfb44d1 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 _0x066e=['code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','application/x-www-form-urlencoded','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','serverUrl','https://accounts.zoho.com.cn','authorization_code','then','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret'];(function(_0x58febe,_0x5d9d33){var _0x9e6d42=function(_0x296072){while(--_0x296072){_0x58febe['push'](_0x58febe['shift']());}};_0x9e6d42(++_0x5d9d33);}(_0x066e,0xb5));var _0xe066=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x066e[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xe066('0x0'));var util=require(_0xe066('0x1'));var logger=require(_0xe066('0x2'))('api');var moment=require(_0xe066('0x3'));var BPromise=require(_0xe066('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe066('0x5'));var rimraf=require('rimraf');var config=require(_0xe066('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe066('0x7')]=function(_0x14dec5,_0x133734){return _0x14dec5['define'](_0xe066('0x8'),attributes,{'tableName':_0xe066('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xc73407,_0x4bdb9e,_0x71ed2d){if(_0xc73407[_0xe066('0xa')](_0xe066('0xb'))||_0xc73407[_0xe066('0xa')]('serverUrl')||_0xc73407['changed'](_0xe066('0xc'))||_0xc73407[_0xe066('0xa')](_0xe066('0xd'))||_0xc73407['changed'](_0xe066('0xe'))||_0xc73407[_0xe066('0xa')](_0xe066('0xf'))){var _0x223b71,_0x44993d;_0x223b71=_0xc73407['serverUrl'];var _0x453885=_0x223b71[_0xe066('0x10')](-0x1);if(_0x453885==='/'||_0x453885==='\x5c'||_0x453885===':'){_0x223b71=_0x223b71[_0xe066('0x11')](0x0,_0x223b71[_0xe066('0x12')](_0x453885));}switch(_0xc73407[_0xe066('0xb')]){case'US':_0x44993d=_0xe066('0x13');break;case'AU':_0x44993d=_0xe066('0x14');break;case'IN':_0x44993d=_0xe066('0x15');break;case'CN':_0x44993d='https://accounts.zoho.com.cn';break;default:_0x44993d='https://accounts.zoho.eu';break;}var _0x20a8ca={'method':_0xe066('0x16'),'uri':_0x44993d+_0xe066('0x17'),'form':{'grant_type':'authorization_code','client_id':_0xc73407[_0xe066('0xc')],'client_secret':_0xc73407['clientSecret'],'redirect_uri':_0xc73407['serverUrl'],'code':_0xc73407['code']},'headers':{'Content-Type':_0xe066('0x18')}};return rp(_0x20a8ca)['then'](function(_0x165dd3){var _0x3b6ee3=JSON['parse'](_0x165dd3);if(_0x3b6ee3['refresh_token']){_0xc73407[_0xe066('0x19')]=_0x3b6ee3[_0xe066('0x1a')];logger[_0xe066('0x1b')](util[_0xe066('0x1c')](_0xe066('0x1d'),_0xc73407[_0xe066('0x1e')],_0xc73407['id']));}else{logger[_0xe066('0x1f')](util[_0xe066('0x1c')](_0xe066('0x20'),_0xc73407[_0xe066('0x1e')],_0xc73407['id']),util[_0xe066('0x21')](_0x3b6ee3,{'showHidden':![],'depth':null}));}return _0x71ed2d(null,_0x4bdb9e);})[_0xe066('0x22')](function(_0x42bf03){logger[_0xe066('0x1f')](util[_0xe066('0x1c')](_0xe066('0x20'),_0xc73407[_0xe066('0x1e')],_0xc73407['id']),util[_0xe066('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x71ed2d(_0x42bf03);});}else{return _0x71ed2d(null,_0x4bdb9e);}},'beforeUpdate':function(_0x28432e,_0x3c1d6c,_0x49c848){if(_0x28432e[_0xe066('0xa')](_0xe066('0xb'))||_0x28432e[_0xe066('0xa')](_0xe066('0x23'))||_0x28432e[_0xe066('0xa')](_0xe066('0xc'))||_0x28432e[_0xe066('0xa')](_0xe066('0xd'))||_0x28432e['changed'](_0xe066('0xe'))||_0x28432e[_0xe066('0xa')](_0xe066('0xf'))){var _0x2722ef,_0x3a4272;_0x2722ef=_0x28432e[_0xe066('0x23')];var _0x2f055f=_0x2722ef[_0xe066('0x10')](-0x1);if(_0x2f055f==='/'||_0x2f055f==='\x5c'||_0x2f055f===':'){_0x2722ef=_0x2722ef['substring'](0x0,_0x2722ef[_0xe066('0x12')](_0x2f055f));}switch(_0x28432e[_0xe066('0xb')]){case'US':_0x3a4272=_0xe066('0x13');break;case'AU':_0x3a4272=_0xe066('0x14');break;case'IN':_0x3a4272=_0xe066('0x15');break;case'CN':_0x3a4272=_0xe066('0x24');break;default:_0x3a4272='https://accounts.zoho.eu';break;}var _0x5e5db8={'method':'POST','uri':_0x3a4272+'/oauth/v2/token','form':{'grant_type':_0xe066('0x25'),'client_id':_0x28432e[_0xe066('0xc')],'client_secret':_0x28432e[_0xe066('0xd')],'redirect_uri':_0x28432e['serverUrl'],'code':_0x28432e[_0xe066('0xe')]},'headers':{'Content-Type':_0xe066('0x18')}};return rp(_0x5e5db8)[_0xe066('0x26')](function(_0x53a5cd){var _0x290d5d=JSON['parse'](_0x53a5cd);if(_0x290d5d[_0xe066('0x1a')]){_0x28432e['refreshToken']=_0x290d5d[_0xe066('0x1a')];logger[_0xe066('0x1b')](util[_0xe066('0x1c')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x28432e['name'],_0x28432e['id']));}else{logger['error'](util[_0xe066('0x1c')](_0xe066('0x20'),_0x28432e['name'],_0x28432e['id']),util['inspect'](_0x290d5d,{'showHidden':![],'depth':null}));}return _0x49c848(null,_0x3c1d6c);})[_0xe066('0x22')](function(_0x127ce0){logger[_0xe066('0x1f')](util['format'](_0xe066('0x20'),_0x28432e[_0xe066('0x1e')],_0x28432e['id']),util[_0xe066('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x49c848(_0x127ce0);});}else{return _0x49c848(null,_0x3c1d6c);}}}});}; \ No newline at end of file +var _0x0568=['parse','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','slice','https://accounts.zoho.com.cn'];(function(_0x18bb22,_0xecc036){var _0x5abdaf=function(_0x5e0e83){while(--_0x5e0e83){_0x18bb22['push'](_0x18bb22['shift']());}};_0x5abdaf(++_0xecc036);}(_0x0568,0x172));var _0x8056=function(_0x362147,_0x23bca0){_0x362147=_0x362147-0x0;var _0x18feae=_0x0568[_0x362147];return _0x18feae;};'use strict';var _=require(_0x8056('0x0'));var util=require(_0x8056('0x1'));var logger=require('../../config/logger')(_0x8056('0x2'));var moment=require(_0x8056('0x3'));var BPromise=require(_0x8056('0x4'));var rp=require(_0x8056('0x5'));var fs=require('fs');var path=require(_0x8056('0x6'));var rimraf=require(_0x8056('0x7'));var config=require(_0x8056('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x36beb2,_0x2378ca){return _0x36beb2[_0x8056('0x9')](_0x8056('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa796b3,_0x472f7b,_0x1b783d){if(_0xa796b3[_0x8056('0xb')](_0x8056('0xc'))||_0xa796b3[_0x8056('0xb')](_0x8056('0xd'))||_0xa796b3[_0x8056('0xb')](_0x8056('0xe'))||_0xa796b3[_0x8056('0xb')](_0x8056('0xf'))||_0xa796b3[_0x8056('0xb')](_0x8056('0x10'))||_0xa796b3[_0x8056('0xb')](_0x8056('0x11'))){var _0x3b2f5a,_0x266b79;_0x3b2f5a=_0xa796b3[_0x8056('0xd')];var _0x4c1162=_0x3b2f5a['slice'](-0x1);if(_0x4c1162==='/'||_0x4c1162==='\x5c'||_0x4c1162===':'){_0x3b2f5a=_0x3b2f5a[_0x8056('0x12')](0x0,_0x3b2f5a[_0x8056('0x13')](_0x4c1162));}switch(_0xa796b3['zone']){case'US':_0x266b79='https://accounts.zoho.com';break;case'AU':_0x266b79=_0x8056('0x14');break;case'IN':_0x266b79=_0x8056('0x15');break;case'CN':_0x266b79='https://accounts.zoho.com.cn';break;default:_0x266b79=_0x8056('0x16');break;}var _0x1791ab={'method':_0x8056('0x17'),'uri':_0x266b79+_0x8056('0x18'),'form':{'grant_type':_0x8056('0x19'),'client_id':_0xa796b3[_0x8056('0xe')],'client_secret':_0xa796b3[_0x8056('0xf')],'redirect_uri':_0xa796b3['serverUrl'],'code':_0xa796b3['code']},'headers':{'Content-Type':_0x8056('0x1a')}};return rp(_0x1791ab)[_0x8056('0x1b')](function(_0x3e7a9c){var _0x3255a2=JSON['parse'](_0x3e7a9c);if(_0x3255a2[_0x8056('0x1c')]){_0xa796b3[_0x8056('0x1d')]=_0x3255a2['refresh_token'];logger[_0x8056('0x1e')](util[_0x8056('0x1f')](_0x8056('0x20'),_0xa796b3[_0x8056('0x21')],_0xa796b3['id']));}else{logger[_0x8056('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xa796b3['name'],_0xa796b3['id']),util['inspect'](_0x3255a2,{'showHidden':![],'depth':null}));}return _0x1b783d(null,_0x472f7b);})[_0x8056('0x23')](function(_0x529e1d){logger[_0x8056('0x22')](util['format'](_0x8056('0x24'),_0xa796b3['name'],_0xa796b3['id']),util[_0x8056('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1b783d(_0x529e1d);});}else{return _0x1b783d(null,_0x472f7b);}},'beforeUpdate':function(_0x51eac4,_0x57ff17,_0xddd247){if(_0x51eac4['changed'](_0x8056('0xc'))||_0x51eac4[_0x8056('0xb')]('serverUrl')||_0x51eac4[_0x8056('0xb')](_0x8056('0xe'))||_0x51eac4['changed']('clientSecret')||_0x51eac4[_0x8056('0xb')](_0x8056('0x10'))||_0x51eac4[_0x8056('0xb')](_0x8056('0x11'))){var _0x48df36,_0x556b8f;_0x48df36=_0x51eac4[_0x8056('0xd')];var _0x3094d5=_0x48df36[_0x8056('0x26')](-0x1);if(_0x3094d5==='/'||_0x3094d5==='\x5c'||_0x3094d5===':'){_0x48df36=_0x48df36[_0x8056('0x12')](0x0,_0x48df36[_0x8056('0x13')](_0x3094d5));}switch(_0x51eac4[_0x8056('0xc')]){case'US':_0x556b8f='https://accounts.zoho.com';break;case'AU':_0x556b8f=_0x8056('0x14');break;case'IN':_0x556b8f='https://accounts.zoho.in';break;case'CN':_0x556b8f=_0x8056('0x27');break;default:_0x556b8f='https://accounts.zoho.eu';break;}var _0x4bba88={'method':_0x8056('0x17'),'uri':_0x556b8f+'/oauth/v2/token','form':{'grant_type':_0x8056('0x19'),'client_id':_0x51eac4[_0x8056('0xe')],'client_secret':_0x51eac4['clientSecret'],'redirect_uri':_0x51eac4[_0x8056('0xd')],'code':_0x51eac4[_0x8056('0x10')]},'headers':{'Content-Type':_0x8056('0x1a')}};return rp(_0x4bba88)[_0x8056('0x1b')](function(_0x367b2b){var _0x42626c=JSON[_0x8056('0x28')](_0x367b2b);if(_0x42626c[_0x8056('0x1c')]){_0x51eac4[_0x8056('0x1d')]=_0x42626c[_0x8056('0x1c')];logger[_0x8056('0x1e')](util['format'](_0x8056('0x20'),_0x51eac4[_0x8056('0x21')],_0x51eac4['id']));}else{logger[_0x8056('0x22')](util[_0x8056('0x1f')](_0x8056('0x24'),_0x51eac4[_0x8056('0x21')],_0x51eac4['id']),util['inspect'](_0x42626c,{'showHidden':![],'depth':null}));}return _0xddd247(null,_0x57ff17);})[_0x8056('0x23')](function(_0x3ba2ff){logger['error'](util['format'](_0x8056('0x24'),_0x51eac4[_0x8056('0x21')],_0x51eac4['id']),util[_0x8056('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0xddd247(_0x3ba2ff);});}else{return _0xddd247(null,_0x57ff17);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index e814cfc..8d664e7 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 _0xcc58=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','attributes','limit','include','map','model','stringify','find','raw','where','ShowZohoAccount','lodash','bluebird','randomstring','ioredis'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xcc58,0xab));var _0x8cc5=function(_0x42f097,_0x27df2c){_0x42f097=_0x42f097-0x0;var _0x402b9=_0xcc58[_0x42f097];return _0x402b9;};'use strict';var _=require(_0x8cc5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cc5('0x1'));var rs=require(_0x8cc5('0x2'));var fs=require('fs');var Redis=require(_0x8cc5('0x3'));var db=require(_0x8cc5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8cc5('0x5'));var config=require(_0x8cc5('0x6'));var jayson=require(_0x8cc5('0x7'));var client=jayson[_0x8cc5('0x8')][_0x8cc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32a4be,_0x4bd82c,_0x237c3f){return new BPromise(function(_0x38d64d,_0x41824c){return client[_0x8cc5('0xa')](_0x32a4be,_0x237c3f)[_0x8cc5('0xb')](function(_0x1c4dea){logger['info'](_0x8cc5('0xc'),_0x4bd82c,_0x8cc5('0xd'));logger[_0x8cc5('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4bd82c,_0x8cc5('0xd'),JSON['stringify'](_0x1c4dea));if(_0x1c4dea[_0x8cc5('0xf')]){if(_0x1c4dea['error'][_0x8cc5('0x10')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4bd82c,_0x1c4dea[_0x8cc5('0xf')]['message']);return _0x41824c(_0x1c4dea[_0x8cc5('0xf')][_0x8cc5('0x11')]);}logger['error'](_0x8cc5('0xc'),_0x4bd82c,_0x1c4dea[_0x8cc5('0xf')][_0x8cc5('0x11')]);return _0x38d64d(_0x1c4dea[_0x8cc5('0xf')][_0x8cc5('0x11')]);}else{logger[_0x8cc5('0x12')](_0x8cc5('0xc'),_0x4bd82c,'request\x20sent');_0x38d64d(_0x1c4dea[_0x8cc5('0x13')][_0x8cc5('0x11')]);}})[_0x8cc5('0x14')](function(_0x26b316){logger[_0x8cc5('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x4bd82c,_0x26b316);_0x41824c(_0x26b316);});});}exports[_0x8cc5('0x15')]=function(_0x170ae9){var _0x5e3ef7=this;return new Promise(function(_0x34032a,_0xf06152){return db[_0x8cc5('0x16')][_0x8cc5('0x17')]({'raw':_0x170ae9[_0x8cc5('0x18')]?_0x170ae9[_0x8cc5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x170ae9[_0x8cc5('0x18')]?_0x170ae9[_0x8cc5('0x18')]['where']||null:null,'attributes':_0x170ae9[_0x8cc5('0x18')]?_0x170ae9[_0x8cc5('0x18')][_0x8cc5('0x19')]||null:null,'limit':_0x170ae9[_0x8cc5('0x18')]?_0x170ae9['options'][_0x8cc5('0x1a')]||null:null,'include':_0x170ae9['options']?_0x170ae9[_0x8cc5('0x18')][_0x8cc5('0x1b')]?_[_0x8cc5('0x1c')](_0x170ae9[_0x8cc5('0x18')][_0x8cc5('0x1b')],function(_0x2246f6){return{'model':db[_0x2246f6['model']],'as':_0x2246f6['as'],'attributes':_0x2246f6['attributes'],'include':_0x2246f6[_0x8cc5('0x1b')]?_[_0x8cc5('0x1c')](_0x2246f6[_0x8cc5('0x1b')],function(_0x2b19da){return{'model':db[_0x2b19da['model']],'as':_0x2b19da['as'],'attributes':_0x2b19da[_0x8cc5('0x19')],'include':_0x2b19da['include']?_[_0x8cc5('0x1c')](_0x2b19da['include'],function(_0x3d5d9c){return{'model':db[_0x3d5d9c[_0x8cc5('0x1d')]],'as':_0x3d5d9c['as'],'attributes':_0x3d5d9c[_0x8cc5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8cc5('0xb')](function(_0x43d48e){logger[_0x8cc5('0x12')](_0x8cc5('0x15'),_0x170ae9);logger[_0x8cc5('0xe')]('GetZohoAccount',_0x170ae9,JSON[_0x8cc5('0x1e')](_0x43d48e));_0x34032a(_0x43d48e);})[_0x8cc5('0x14')](function(_0x1e8da5){logger[_0x8cc5('0xf')](_0x8cc5('0x15'),_0x1e8da5[_0x8cc5('0x11')],_0x170ae9);_0xf06152(_0x5e3ef7[_0x8cc5('0xf')](0x1f4,_0x1e8da5[_0x8cc5('0x11')]));});});};exports['ShowZohoAccount']=function(_0x119623){var _0x2f1186=this;return new Promise(function(_0x24116a,_0x1ca307){return db[_0x8cc5('0x16')][_0x8cc5('0x1f')]({'raw':_0x119623['options']?_0x119623[_0x8cc5('0x18')][_0x8cc5('0x20')]===undefined?!![]:![]:!![],'where':_0x119623[_0x8cc5('0x18')]?_0x119623[_0x8cc5('0x18')][_0x8cc5('0x21')]||null:null,'attributes':_0x119623[_0x8cc5('0x18')]?_0x119623[_0x8cc5('0x18')][_0x8cc5('0x19')]||null:null,'include':_0x119623['options']?_0x119623[_0x8cc5('0x18')][_0x8cc5('0x1b')]?_[_0x8cc5('0x1c')](_0x119623[_0x8cc5('0x18')][_0x8cc5('0x1b')],function(_0x4d3008){return{'model':db[_0x4d3008['model']],'as':_0x4d3008['as'],'attributes':_0x4d3008[_0x8cc5('0x19')],'include':_0x4d3008[_0x8cc5('0x1b')]?_[_0x8cc5('0x1c')](_0x4d3008[_0x8cc5('0x1b')],function(_0x12e65c){return{'model':db[_0x12e65c[_0x8cc5('0x1d')]],'as':_0x12e65c['as'],'attributes':_0x12e65c[_0x8cc5('0x19')],'include':_0x12e65c['include']?_[_0x8cc5('0x1c')](_0x12e65c[_0x8cc5('0x1b')],function(_0x35b333){return{'model':db[_0x35b333[_0x8cc5('0x1d')]],'as':_0x35b333['as'],'attributes':_0x35b333[_0x8cc5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8cc5('0xb')](function(_0x112c35){logger[_0x8cc5('0x12')](_0x8cc5('0x22'),_0x119623);logger[_0x8cc5('0xe')](_0x8cc5('0x22'),_0x119623,JSON[_0x8cc5('0x1e')](_0x112c35));_0x24116a(_0x112c35);})['catch'](function(_0xb2b86b){logger[_0x8cc5('0xf')](_0x8cc5('0x22'),_0xb2b86b[_0x8cc5('0x11')],_0x119623);_0x1ca307(_0x2f1186['error'](0x1f4,_0xb2b86b[_0x8cc5('0x11')]));});});}; \ No newline at end of file +var _0x4ab2=['ZohoAccount','findAll','options','where','attributes','include','model','map','then','ShowZohoAccount','find','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZohoAccount'];(function(_0x46785e,_0x2772e1){var _0x5a5c52=function(_0x403a93){while(--_0x403a93){_0x46785e['push'](_0x46785e['shift']());}};_0x5a5c52(++_0x2772e1);}(_0x4ab2,0xbb));var _0x24ab=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x4ab2[_0x346737];return _0x1ade2e;};'use strict';var _=require('lodash');var util=require(_0x24ab('0x0'));var moment=require(_0x24ab('0x1'));var BPromise=require(_0x24ab('0x2'));var rs=require(_0x24ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24ab('0x4'))['db'];var utils=require(_0x24ab('0x5'));var logger=require(_0x24ab('0x6'))(_0x24ab('0x7'));var config=require(_0x24ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24ab('0x9')][_0x24ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2232bb,_0x4114fc,_0x46679f){return new BPromise(function(_0x3068da,_0x4b3cbe){return client['request'](_0x2232bb,_0x46679f)['then'](function(_0xf16eca){logger['info'](_0x24ab('0xb'),_0x4114fc,_0x24ab('0xc'));logger[_0x24ab('0xd')](_0x24ab('0xe'),_0x4114fc,_0x24ab('0xc'),JSON[_0x24ab('0xf')](_0xf16eca));if(_0xf16eca[_0x24ab('0x10')]){if(_0xf16eca[_0x24ab('0x10')][_0x24ab('0x11')]===0x1f4){logger[_0x24ab('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x4114fc,_0xf16eca[_0x24ab('0x10')][_0x24ab('0x12')]);return _0x4b3cbe(_0xf16eca[_0x24ab('0x10')]['message']);}logger[_0x24ab('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x4114fc,_0xf16eca[_0x24ab('0x10')][_0x24ab('0x12')]);return _0x3068da(_0xf16eca[_0x24ab('0x10')][_0x24ab('0x12')]);}else{logger[_0x24ab('0x13')](_0x24ab('0xb'),_0x4114fc,'request\x20sent');_0x3068da(_0xf16eca[_0x24ab('0x14')][_0x24ab('0x12')]);}})[_0x24ab('0x15')](function(_0xd804a0){logger[_0x24ab('0x10')](_0x24ab('0xb'),_0x4114fc,_0xd804a0);_0x4b3cbe(_0xd804a0);});});}exports[_0x24ab('0x16')]=function(_0x2ed3f0){var _0x51223b=this;return new Promise(function(_0x3f231b,_0x1782a0){return db[_0x24ab('0x17')][_0x24ab('0x18')]({'raw':_0x2ed3f0[_0x24ab('0x19')]?_0x2ed3f0[_0x24ab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2ed3f0[_0x24ab('0x19')]?_0x2ed3f0[_0x24ab('0x19')][_0x24ab('0x1a')]||null:null,'attributes':_0x2ed3f0[_0x24ab('0x19')]?_0x2ed3f0[_0x24ab('0x19')][_0x24ab('0x1b')]||null:null,'limit':_0x2ed3f0[_0x24ab('0x19')]?_0x2ed3f0['options']['limit']||null:null,'include':_0x2ed3f0[_0x24ab('0x19')]?_0x2ed3f0[_0x24ab('0x19')][_0x24ab('0x1c')]?_['map'](_0x2ed3f0[_0x24ab('0x19')]['include'],function(_0x276bf3){return{'model':db[_0x276bf3[_0x24ab('0x1d')]],'as':_0x276bf3['as'],'attributes':_0x276bf3['attributes'],'include':_0x276bf3[_0x24ab('0x1c')]?_[_0x24ab('0x1e')](_0x276bf3[_0x24ab('0x1c')],function(_0x309cf2){return{'model':db[_0x309cf2['model']],'as':_0x309cf2['as'],'attributes':_0x309cf2['attributes'],'include':_0x309cf2[_0x24ab('0x1c')]?_['map'](_0x309cf2[_0x24ab('0x1c')],function(_0x7b3a96){return{'model':db[_0x7b3a96[_0x24ab('0x1d')]],'as':_0x7b3a96['as'],'attributes':_0x7b3a96[_0x24ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x24ab('0x1f')](function(_0x56b4d6){logger[_0x24ab('0x13')](_0x24ab('0x16'),_0x2ed3f0);logger[_0x24ab('0xd')](_0x24ab('0x16'),_0x2ed3f0,JSON[_0x24ab('0xf')](_0x56b4d6));_0x3f231b(_0x56b4d6);})['catch'](function(_0x46e952){logger[_0x24ab('0x10')]('GetZohoAccount',_0x46e952['message'],_0x2ed3f0);_0x1782a0(_0x51223b[_0x24ab('0x10')](0x1f4,_0x46e952['message']));});});};exports[_0x24ab('0x20')]=function(_0x424f54){var _0x1a16fc=this;return new Promise(function(_0x32462f,_0x47cee0){return db[_0x24ab('0x17')][_0x24ab('0x21')]({'raw':_0x424f54['options']?_0x424f54[_0x24ab('0x19')][_0x24ab('0x22')]===undefined?!![]:![]:!![],'where':_0x424f54[_0x24ab('0x19')]?_0x424f54[_0x24ab('0x19')][_0x24ab('0x1a')]||null:null,'attributes':_0x424f54['options']?_0x424f54[_0x24ab('0x19')][_0x24ab('0x1b')]||null:null,'include':_0x424f54[_0x24ab('0x19')]?_0x424f54['options']['include']?_[_0x24ab('0x1e')](_0x424f54[_0x24ab('0x19')][_0x24ab('0x1c')],function(_0x4dd6d7){return{'model':db[_0x4dd6d7['model']],'as':_0x4dd6d7['as'],'attributes':_0x4dd6d7[_0x24ab('0x1b')],'include':_0x4dd6d7[_0x24ab('0x1c')]?_['map'](_0x4dd6d7[_0x24ab('0x1c')],function(_0x41898b){return{'model':db[_0x41898b['model']],'as':_0x41898b['as'],'attributes':_0x41898b['attributes'],'include':_0x41898b[_0x24ab('0x1c')]?_[_0x24ab('0x1e')](_0x41898b['include'],function(_0x95fa13){return{'model':db[_0x95fa13['model']],'as':_0x95fa13['as'],'attributes':_0x95fa13[_0x24ab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ac54){logger['info']('ShowZohoAccount',_0x424f54);logger[_0x24ab('0xd')](_0x24ab('0x20'),_0x424f54,JSON[_0x24ab('0xf')](_0x40ac54));_0x32462f(_0x40ac54);})[_0x24ab('0x15')](function(_0x2fc077){logger[_0x24ab('0x10')](_0x24ab('0x20'),_0x2fc077[_0x24ab('0x12')],_0x424f54);_0x47cee0(_0x1a16fc[_0x24ab('0x10')](0x1f4,_0x2fc077['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index e24e058..df6b2c3 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 _0x6728=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util'];(function(_0x35d862,_0xf7791a){var _0x70c749=function(_0x26fe7f){while(--_0x26fe7f){_0x35d862['push'](_0x35d862['shift']());}};_0x70c749(++_0xf7791a);}(_0x6728,0x1a2));var _0x8672=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x6728[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x8672('0x0'));var util=require(_0x8672('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x8672('0x2'));var interaction=require(_0x8672('0x3'));var config=require(_0x8672('0x4'));var controller=require(_0x8672('0x5'));router['get']('/',auth[_0x8672('0x6')](),controller[_0x8672('0x7')]);router[_0x8672('0x8')](_0x8672('0x9'),auth[_0x8672('0x6')](),controller[_0x8672('0xa')]);router[_0x8672('0x8')]('/:id/fields',auth[_0x8672('0x6')](),controller[_0x8672('0xb')]);router[_0x8672('0x8')](_0x8672('0xc'),auth[_0x8672('0x6')](),controller[_0x8672('0xd')]);router[_0x8672('0x8')](_0x8672('0xe'),auth['isAuthenticated'](),controller[_0x8672('0xf')]);router[_0x8672('0x10')]('/',auth[_0x8672('0x6')](),controller['create']);router[_0x8672('0x11')](_0x8672('0x9'),auth[_0x8672('0x6')](),controller['update']);router[_0x8672('0x12')](_0x8672('0x9'),auth[_0x8672('0x6')](),controller[_0x8672('0x13')]);module[_0x8672('0x14')]=router; \ No newline at end of file +var _0x108a=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','create','put'];(function(_0x4b27c5,_0x1e5793){var _0x85268f=function(_0x13bec8){while(--_0x13bec8){_0x4b27c5['push'](_0x4b27c5['shift']());}};_0x85268f(++_0x1e5793);}(_0x108a,0x138));var _0xa108=function(_0x305cfa,_0xf167d3){_0x305cfa=_0x305cfa-0x0;var _0xa91d33=_0x108a[_0x305cfa];return _0xa91d33;};'use strict';var multer=require(_0xa108('0x0'));var util=require(_0xa108('0x1'));var path=require(_0xa108('0x2'));var timeout=require(_0xa108('0x3'));var express=require(_0xa108('0x4'));var router=express[_0xa108('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa108('0x6'));var controller=require(_0xa108('0x7'));router['get']('/',auth[_0xa108('0x8')](),controller[_0xa108('0x9')]);router[_0xa108('0xa')](_0xa108('0xb'),auth[_0xa108('0x8')](),controller['show']);router[_0xa108('0xa')](_0xa108('0xc'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0xa108('0xd'),auth[_0xa108('0x8')](),controller[_0xa108('0xe')]);router[_0xa108('0xa')]('/:id/descriptions',auth[_0xa108('0x8')](),controller[_0xa108('0xf')]);router['post']('/',auth[_0xa108('0x8')](),controller[_0xa108('0x10')]);router[_0xa108('0x11')](_0xa108('0xb'),auth[_0xa108('0x8')](),controller[_0xa108('0x12')]);router[_0xa108('0x13')](_0xa108('0xb'),auth['isAuthenticated'](),controller[_0xa108('0x14')]);module[_0xa108('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 fe1763a..7a4a9e1 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 _0x05b9=['sequelize','exports','STRING','ENUM','Leads','Contacts'];(function(_0x472906,_0x59b41c){var _0x4a4f64=function(_0x44a21d){while(--_0x44a21d){_0x472906['push'](_0x472906['shift']());}};_0x4a4f64(++_0x59b41c);}(_0x05b9,0x1b6));var _0x905b=function(_0x25ac32,_0x216a7d){_0x25ac32=_0x25ac32-0x0;var _0x34359c=_0x05b9[_0x25ac32];return _0x34359c;};'use strict';var Sequelize=require(_0x905b('0x0'));module[_0x905b('0x1')]={'name':{'type':Sequelize[_0x905b('0x2')]},'moduleCreate':{'type':Sequelize[_0x905b('0x3')](_0x905b('0x4'),_0x905b('0x5')),'defaultValue':'Leads'},'description':{'type':Sequelize[_0x905b('0x2')]}}; \ No newline at end of file +var _0x2776=['exports','STRING','Leads','sequelize'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2776,0x12f));var _0x6277=function(_0x9e1faa,_0x425b76){_0x9e1faa=_0x9e1faa-0x0;var _0xdc2c21=_0x2776[_0x9e1faa];return _0xdc2c21;};'use strict';var Sequelize=require(_0x6277('0x0'));module[_0x6277('0x1')]={'name':{'type':Sequelize[_0x6277('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x6277('0x3'),'Contacts'),'defaultValue':'Leads'},'description':{'type':Sequelize[_0x6277('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b53c6a9..12f191e 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 _0x34e8=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','find','body','getFields','findOne','ZohoField','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf'];(function(_0x44db1f,_0x28676d){var _0x3a364f=function(_0x2f8a1b){while(--_0x2f8a1b){_0x44db1f['push'](_0x44db1f['shift']());}};_0x3a364f(++_0x28676d);}(_0x34e8,0x12c));var _0x834e=function(_0x406d35,_0x46da38){_0x406d35=_0x406d35-0x0;var _0x180ed7=_0x34e8[_0x406d35];return _0x180ed7;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x834e('0x1d')][_0x834e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x58a27e,_0x23848e,_0x2d95f2){if(_0x2d95f2){var _0x28e659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28e659[_0x834e('0x1f')](_0x23848e)){return _0x58a27e;}else{throw new db['Sequelize'][(_0x834e('0x20'))](_0x834e('0x21'));}}else{return _0x58a27e;}}function respondWithRpcPromise(_0x57274a,_0x316205,_0x4a9cdc,_0x38a8cd){return new BPromise(function(_0x36d443,_0x478afe){var _0x43ac41=_0x38a8cd||client;return _0x43ac41[_0x834e('0x22')](_0x57274a,_0x4a9cdc)[_0x834e('0x23')](function(_0x50b3f6){logger[_0x834e('0x24')](_0x834e('0x25'),_0x316205,_0x834e('0x26'));logger[_0x834e('0x27')](_0x834e('0x28'),_0x316205,_0x834e('0x26'),JSON[_0x834e('0x29')](_0x50b3f6));if(_0x50b3f6['error']){if(_0x50b3f6[_0x834e('0x2a')][_0x834e('0x2b')]===0x1f4){logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6['error'][_0x834e('0x2c')]);return _0x478afe(_0x50b3f6[_0x834e('0x2a')]['message']);}logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6[_0x834e('0x2a')]['message']);return _0x36d443(_0x50b3f6['error'][_0x834e('0x2c')]);}else{logger[_0x834e('0x24')]('ZohoConfiguration,\x20%s,\x20%s',_0x316205,_0x834e('0x26'));_0x36d443(_0x50b3f6[_0x834e('0x2d')]['message']);}})[_0x834e('0x2e')](function(_0x2e1983){logger[_0x834e('0x2a')]('ZohoConfiguration,\x20%s,\x20%s',_0x316205,_0x2e1983);_0x478afe(_0x2e1983);});});}function respondWithStatusCode(_0x24fcf7,_0x3e310f){_0x3e310f=_0x3e310f||0xcc;return function(_0x5e1cc5){if(_0x5e1cc5){return _0x24fcf7['sendStatus'](_0x3e310f);}return _0x24fcf7[_0x834e('0x2f')](_0x3e310f)['end']();};}function respondWithResult(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0xc8;return function(_0x3db026){if(_0x3db026){return _0x2826ec[_0x834e('0x2f')](_0x3f1b0b)[_0x834e('0x30')](_0x3db026);}};}function respondWithFilteredResult(_0x130cc5,_0x491919){return function(_0x510780){if(_0x510780){var _0x4dc64a=_0x510780[_0x834e('0x31')],_0x58c1d7=_0x491919['offset'],_0x2c7a8d=_0x491919[_0x834e('0x32')]+_0x491919[_0x834e('0x33')],_0x567cea;if(_0x2c7a8d>=_0x4dc64a){_0x2c7a8d=_0x4dc64a;_0x567cea=0xc8;}else{_0x567cea=0xce;}_0x130cc5[_0x834e('0x2f')](_0x567cea);return _0x130cc5[_0x834e('0x34')](_0x834e('0x35'),_0x58c1d7+'-'+_0x2c7a8d+'/'+_0x4dc64a)[_0x834e('0x30')](_0x510780);}return null;};}function patchUpdates(_0x3d149d){return function(_0xfaf716){try{jsonpatch[_0x834e('0x36')](_0xfaf716,_0x3d149d,!![]);}catch(_0x493289){return BPromise[_0x834e('0x37')](_0x493289);}return _0xfaf716['save']();};}function saveUpdates(_0x2c75c2,_0x3787b0){return function(_0x9ab921){if(_0x9ab921){return _0x9ab921[_0x834e('0x38')](_0x2c75c2)[_0x834e('0x23')](function(_0x4689c2){return _0x4689c2;});}return null;};}function removeEntity(_0x4696a1,_0x38cd29){return function(_0x358c31){if(_0x358c31){return _0x358c31[_0x834e('0x39')]()['then'](function(){_0x4696a1[_0x834e('0x2f')](0xcc)[_0x834e('0x3a')]();});}};}function handleEntityNotFound(_0x24a9df,_0xaf01f4){return function(_0x595cc0){if(!_0x595cc0){_0x24a9df[_0x834e('0x3b')](0x194);}return _0x595cc0;};}function handleError(_0x379d60,_0x4b12f5){_0x4b12f5=_0x4b12f5||0x1f4;return function(_0x496533){logger['error'](_0x496533[_0x834e('0x3c')]);if(_0x496533[_0x834e('0x3d')]){delete _0x496533[_0x834e('0x3d')];}_0x379d60[_0x834e('0x2f')](_0x4b12f5)[_0x834e('0x3e')](_0x496533);};}exports[_0x834e('0x3f')]=function(_0x4c2ef6,_0x2c2d94){var _0x513f36={},_0xe103fe={},_0x6a3ac={'count':0x0,'rows':[]};var _0x47abed=_[_0x834e('0x40')](db[_0x834e('0x41')]['rawAttributes'],function(_0x481f70){return{'name':_0x481f70[_0x834e('0x42')],'type':_0x481f70[_0x834e('0x43')][_0x834e('0x44')]};});_0xe103fe[_0x834e('0x45')]=_[_0x834e('0x40')](_0x47abed,'name');_0xe103fe[_0x834e('0x46')]=_['keys'](_0x4c2ef6['query']);_0xe103fe[_0x834e('0x47')]=_['intersection'](_0xe103fe[_0x834e('0x45')],_0xe103fe[_0x834e('0x46')]);_0x513f36[_0x834e('0x48')]=_[_0x834e('0x49')](_0xe103fe[_0x834e('0x45')],qs['fields'](_0x4c2ef6[_0x834e('0x46')][_0x834e('0x4a')]));_0x513f36[_0x834e('0x48')]=_0x513f36['attributes'][_0x834e('0x4b')]?_0x513f36[_0x834e('0x48')]:_0xe103fe['model'];if(!_0x4c2ef6[_0x834e('0x46')]['hasOwnProperty'](_0x834e('0x4c'))){_0x513f36[_0x834e('0x33')]=qs['limit'](_0x4c2ef6['query'][_0x834e('0x33')]);_0x513f36[_0x834e('0x32')]=qs[_0x834e('0x32')](_0x4c2ef6[_0x834e('0x46')][_0x834e('0x32')]);}_0x513f36[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x4c2ef6['query'][_0x834e('0x4e')]);_0x513f36['where']=qs[_0x834e('0x47')](_['pick'](_0x4c2ef6[_0x834e('0x46')],_0xe103fe['filters']));if(_0x4c2ef6[_0x834e('0x46')][_0x834e('0x4f')]){_0x513f36['where']=_[_0x834e('0x50')](_0x513f36[_0x834e('0x51')],{'$or':_[_0x834e('0x40')](_0x47abed,function(_0xd55cc3){if(_0xd55cc3[_0x834e('0x43')]!==_0x834e('0x52')){var _0xfa28da={};_0xfa28da[_0xd55cc3[_0x834e('0x3d')]]={'$like':'%'+_0x4c2ef6[_0x834e('0x46')][_0x834e('0x4f')]+'%'};return _0xfa28da;}})});}_0x513f36=_['merge']({},_0x513f36,_0x4c2ef6[_0x834e('0x53')]);var _0x6fff27={'where':_0x513f36['where']};return db[_0x834e('0x41')][_0x834e('0x31')](_0x6fff27)[_0x834e('0x23')](function(_0x2112d5){_0x6a3ac[_0x834e('0x31')]=_0x2112d5;if(_0x4c2ef6[_0x834e('0x46')]['includeAll']){_0x513f36['include']=[{'all':!![]}];}return db[_0x834e('0x41')][_0x834e('0x54')](_0x513f36);})[_0x834e('0x23')](function(_0x40ff5a){_0x6a3ac[_0x834e('0x55')]=_0x40ff5a;return _0x6a3ac;})[_0x834e('0x23')](respondWithFilteredResult(_0x2c2d94,_0x513f36))[_0x834e('0x2e')](handleError(_0x2c2d94,null));};exports[_0x834e('0x56')]=function(_0x1419eb,_0x390c45){var _0xf02f0d={'raw':![],'where':{'id':_0x1419eb[_0x834e('0x57')]['id']}},_0x385435={};_0x385435[_0x834e('0x45')]=_[_0x834e('0x58')](db[_0x834e('0x41')][_0x834e('0x59')]);_0x385435[_0x834e('0x46')]=_[_0x834e('0x58')](_0x1419eb[_0x834e('0x46')]);_0x385435['filters']=_[_0x834e('0x49')](_0x385435[_0x834e('0x45')],_0x385435['query']);_0xf02f0d[_0x834e('0x48')]=_[_0x834e('0x49')](_0x385435['model'],qs[_0x834e('0x4a')](_0x1419eb[_0x834e('0x46')][_0x834e('0x4a')]));_0xf02f0d[_0x834e('0x48')]=_0xf02f0d[_0x834e('0x48')][_0x834e('0x4b')]?_0xf02f0d[_0x834e('0x48')]:_0x385435['model'];if(_0x1419eb[_0x834e('0x46')][_0x834e('0x5a')]){_0xf02f0d[_0x834e('0x5b')]=[{'all':!![]}];}_0xf02f0d=_[_0x834e('0x50')]({},_0xf02f0d,_0x1419eb[_0x834e('0x53')]);return db[_0x834e('0x41')][_0x834e('0x5c')](_0xf02f0d)[_0x834e('0x23')](handleEntityNotFound(_0x390c45,null))['then'](respondWithResult(_0x390c45,null))[_0x834e('0x2e')](handleError(_0x390c45,null));};exports['create']=function(_0x2f4bde,_0x53a9ee){return db[_0x834e('0x41')]['create'](_0x2f4bde['body'],{})[_0x834e('0x23')](respondWithResult(_0x53a9ee,0xc9))[_0x834e('0x2e')](handleError(_0x53a9ee,null));};exports['update']=function(_0x5be43d,_0x2c8155){if(_0x5be43d[_0x834e('0x5d')]['id']){delete _0x5be43d[_0x834e('0x5d')]['id'];}return db[_0x834e('0x41')][_0x834e('0x5c')]({'where':{'id':_0x5be43d[_0x834e('0x57')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x2c8155,null))[_0x834e('0x23')](saveUpdates(_0x5be43d['body'],null))[_0x834e('0x23')](respondWithResult(_0x2c8155,null))[_0x834e('0x2e')](handleError(_0x2c8155,null));};exports['destroy']=function(_0x281342,_0x4e2b22){return db[_0x834e('0x41')][_0x834e('0x5c')]({'where':{'id':_0x281342['params']['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x4e2b22,null))[_0x834e('0x23')](removeEntity(_0x4e2b22,null))[_0x834e('0x2e')](handleError(_0x4e2b22,null));};exports[_0x834e('0x5e')]=function(_0x5a2924,_0xe35ded,_0x438f75){var _0x1dfd5f={};var _0x5925ef={};var _0x246b8e;var _0x1fcae9;return db[_0x834e('0x41')][_0x834e('0x5f')]({'where':{'id':_0x5a2924[_0x834e('0x57')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0xe35ded,null))[_0x834e('0x23')](function(_0x1def00){if(_0x1def00){_0x246b8e=_0x1def00;_0x5925ef[_0x834e('0x45')]=_[_0x834e('0x58')](db[_0x834e('0x60')][_0x834e('0x59')]);_0x5925ef[_0x834e('0x46')]=_[_0x834e('0x58')](_0x5a2924[_0x834e('0x46')]);_0x5925ef[_0x834e('0x47')]=_[_0x834e('0x49')](_0x5925ef[_0x834e('0x45')],_0x5925ef[_0x834e('0x46')]);_0x1dfd5f[_0x834e('0x48')]=_[_0x834e('0x49')](_0x5925ef[_0x834e('0x45')],qs['fields'](_0x5a2924[_0x834e('0x46')][_0x834e('0x4a')]));_0x1dfd5f[_0x834e('0x48')]=_0x1dfd5f[_0x834e('0x48')]['length']?_0x1dfd5f[_0x834e('0x48')]:_0x5925ef['model'];_0x1dfd5f['order']=qs[_0x834e('0x4e')](_0x5a2924[_0x834e('0x46')][_0x834e('0x4e')]);_0x1dfd5f[_0x834e('0x51')]=qs[_0x834e('0x47')](_[_0x834e('0x61')](_0x5a2924[_0x834e('0x46')],_0x5925ef[_0x834e('0x47')]));if(_0x5a2924['query'][_0x834e('0x4f')]){_0x1dfd5f['where']=_[_0x834e('0x50')](_0x1dfd5f[_0x834e('0x51')],{'$or':_['map'](_0x1dfd5f['attributes'],function(_0x4a4def){var _0x82f2a7={};_0x82f2a7[_0x4a4def]={'$like':'%'+_0x5a2924[_0x834e('0x46')][_0x834e('0x4f')]+'%'};return _0x82f2a7;})});}_0x1dfd5f=_[_0x834e('0x50')]({},_0x1dfd5f,_0x5a2924['options']);return _0x246b8e[_0x834e('0x5e')](_0x1dfd5f);}})[_0x834e('0x23')](function(_0x2df64f){if(_0x2df64f){_0x1fcae9=_0x2df64f[_0x834e('0x4b')];if(!_0x5a2924[_0x834e('0x46')][_0x834e('0x62')](_0x834e('0x4c'))){_0x1dfd5f[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x5a2924[_0x834e('0x46')]['limit']);_0x1dfd5f[_0x834e('0x32')]=qs[_0x834e('0x32')](_0x5a2924[_0x834e('0x46')][_0x834e('0x32')]);}return _0x246b8e['getFields'](_0x1dfd5f);}})[_0x834e('0x23')](function(_0x4ac5f2){if(_0x4ac5f2){return _0x4ac5f2?{'count':_0x1fcae9,'rows':_0x4ac5f2}:null;}})['then'](respondWithResult(_0xe35ded,null))['catch'](handleError(_0xe35ded,null));};exports[_0x834e('0x63')]=function(_0x332d8f,_0x514aac,_0x2645df){var _0x1b200d={};var _0x4d4477={};var _0x353246;var _0x18ccb2;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x332d8f[_0x834e('0x57')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x514aac,null))[_0x834e('0x23')](function(_0x44c909){if(_0x44c909){_0x353246=_0x44c909;_0x4d4477[_0x834e('0x45')]=_['keys'](db[_0x834e('0x60')]['rawAttributes']);_0x4d4477[_0x834e('0x46')]=_[_0x834e('0x58')](_0x332d8f[_0x834e('0x46')]);_0x4d4477['filters']=_[_0x834e('0x49')](_0x4d4477[_0x834e('0x45')],_0x4d4477['query']);_0x1b200d[_0x834e('0x48')]=_[_0x834e('0x49')](_0x4d4477[_0x834e('0x45')],qs['fields'](_0x332d8f[_0x834e('0x46')][_0x834e('0x4a')]));_0x1b200d[_0x834e('0x48')]=_0x1b200d[_0x834e('0x48')][_0x834e('0x4b')]?_0x1b200d[_0x834e('0x48')]:_0x4d4477[_0x834e('0x45')];_0x1b200d[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x332d8f[_0x834e('0x46')]['sort']);_0x1b200d['where']=qs['filters'](_[_0x834e('0x61')](_0x332d8f[_0x834e('0x46')],_0x4d4477[_0x834e('0x47')]));if(_0x332d8f[_0x834e('0x46')][_0x834e('0x4f')]){_0x1b200d['where']=_['merge'](_0x1b200d[_0x834e('0x51')],{'$or':_[_0x834e('0x40')](_0x1b200d[_0x834e('0x48')],function(_0x18ddac){var _0x40a705={};_0x40a705[_0x18ddac]={'$like':'%'+_0x332d8f['query'][_0x834e('0x4f')]+'%'};return _0x40a705;})});}_0x1b200d=_[_0x834e('0x50')]({},_0x1b200d,_0x332d8f[_0x834e('0x53')]);return _0x353246['getSubjects'](_0x1b200d);}})[_0x834e('0x23')](function(_0x18fde1){if(_0x18fde1){_0x18ccb2=_0x18fde1[_0x834e('0x4b')];if(!_0x332d8f[_0x834e('0x46')][_0x834e('0x62')]('nolimit')){_0x1b200d['limit']=qs[_0x834e('0x33')](_0x332d8f[_0x834e('0x46')]['limit']);_0x1b200d[_0x834e('0x32')]=qs['offset'](_0x332d8f[_0x834e('0x46')][_0x834e('0x32')]);}return _0x353246[_0x834e('0x63')](_0x1b200d);}})['then'](function(_0x155c0f){if(_0x155c0f){return _0x155c0f?{'count':_0x18ccb2,'rows':_0x155c0f}:null;}})['then'](respondWithResult(_0x514aac,null))['catch'](handleError(_0x514aac,null));};exports['getDescriptions']=function(_0x6735e6,_0x4627ac,_0x1d7bab){var _0x1d76c6={};var _0x3b18d0={};var _0x2dad55;var _0x3aa388;return db[_0x834e('0x41')][_0x834e('0x5f')]({'where':{'id':_0x6735e6['params']['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x4627ac,null))['then'](function(_0x11a9f7){if(_0x11a9f7){_0x2dad55=_0x11a9f7;_0x3b18d0[_0x834e('0x45')]=_[_0x834e('0x58')](db[_0x834e('0x60')][_0x834e('0x59')]);_0x3b18d0[_0x834e('0x46')]=_['keys'](_0x6735e6['query']);_0x3b18d0[_0x834e('0x47')]=_[_0x834e('0x49')](_0x3b18d0['model'],_0x3b18d0[_0x834e('0x46')]);_0x1d76c6[_0x834e('0x48')]=_[_0x834e('0x49')](_0x3b18d0[_0x834e('0x45')],qs[_0x834e('0x4a')](_0x6735e6['query'][_0x834e('0x4a')]));_0x1d76c6[_0x834e('0x48')]=_0x1d76c6['attributes']['length']?_0x1d76c6['attributes']:_0x3b18d0[_0x834e('0x45')];_0x1d76c6[_0x834e('0x4d')]=qs['sort'](_0x6735e6[_0x834e('0x46')][_0x834e('0x4e')]);_0x1d76c6['where']=qs[_0x834e('0x47')](_['pick'](_0x6735e6['query'],_0x3b18d0[_0x834e('0x47')]));if(_0x6735e6[_0x834e('0x46')][_0x834e('0x4f')]){_0x1d76c6[_0x834e('0x51')]=_['merge'](_0x1d76c6[_0x834e('0x51')],{'$or':_[_0x834e('0x40')](_0x1d76c6[_0x834e('0x48')],function(_0x1b0b41){var _0x46aabf={};_0x46aabf[_0x1b0b41]={'$like':'%'+_0x6735e6[_0x834e('0x46')][_0x834e('0x4f')]+'%'};return _0x46aabf;})});}_0x1d76c6=_[_0x834e('0x50')]({},_0x1d76c6,_0x6735e6[_0x834e('0x53')]);return _0x2dad55[_0x834e('0x64')](_0x1d76c6);}})[_0x834e('0x23')](function(_0x261e3d){if(_0x261e3d){_0x3aa388=_0x261e3d[_0x834e('0x4b')];if(!_0x6735e6[_0x834e('0x46')][_0x834e('0x62')](_0x834e('0x4c'))){_0x1d76c6[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x6735e6[_0x834e('0x46')][_0x834e('0x33')]);_0x1d76c6[_0x834e('0x32')]=qs[_0x834e('0x32')](_0x6735e6['query'][_0x834e('0x32')]);}return _0x2dad55[_0x834e('0x64')](_0x1d76c6);}})[_0x834e('0x23')](function(_0x2dab75){if(_0x2dab75){return _0x2dab75?{'count':_0x3aa388,'rows':_0x2dab75}:null;}})[_0x834e('0x23')](respondWithResult(_0x4627ac,null))[_0x834e('0x2e')](handleError(_0x4627ac,null));}; \ No newline at end of file +var _0x9957=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x256734,_0x351d69){var _0x5e7c75=function(_0x8c0ebf){while(--_0x8c0ebf){_0x256734['push'](_0x256734['shift']());}};_0x5e7c75(++_0x351d69);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 8727d39..17799a0 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 _0xf86e=['api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0xf86e,0x99));var _0xef86=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xf86e[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xef86('0x0'));var util=require(_0xef86('0x1'));var logger=require(_0xef86('0x2'))(_0xef86('0x3'));var moment=require('moment');var BPromise=require(_0xef86('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef86('0x5'));var rimraf=require(_0xef86('0x6'));var config=require(_0xef86('0x7'));var attributes=require(_0xef86('0x8'));module[_0xef86('0x9')]=function(_0x5910e8,_0x393a40){return _0x5910e8['define'](_0xef86('0xa'),attributes,{'tableName':_0xef86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdda5=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations','lodash','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdda5,0xf8));var _0x5dda=function(_0x222c79,_0x597a08){_0x222c79=_0x222c79-0x0;var _0x2dcb8=_0xdda5[_0x222c79];return _0x2dcb8;};'use strict';var _=require(_0x5dda('0x0'));var util=require(_0x5dda('0x1'));var logger=require(_0x5dda('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5dda('0x3'));var rp=require(_0x5dda('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dda('0x5'));var config=require(_0x5dda('0x6'));var attributes=require(_0x5dda('0x7'));module['exports']=function(_0x2d5359,_0x583711){return _0x2d5359[_0x5dda('0x8')]('ZohoConfiguration',attributes,{'tableName':_0x5dda('0x9'),'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 0faeb22..f08d352 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 _0x4e2a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0xcf6bc5,_0x10428d){var _0x375219=function(_0x37ad74){while(--_0x37ad74){_0xcf6bc5['push'](_0xcf6bc5['shift']());}};_0x375219(++_0x10428d);}(_0x4e2a,0x1e4));var _0xa4e2=function(_0x3cdee3,_0x5ec544){_0x3cdee3=_0x3cdee3-0x0;var _0x22e710=_0x4e2a[_0x3cdee3];return _0x22e710;};'use strict';var _=require(_0xa4e2('0x0'));var util=require(_0xa4e2('0x1'));var moment=require(_0xa4e2('0x2'));var BPromise=require(_0xa4e2('0x3'));var rs=require(_0xa4e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4e2('0x5'))['db'];var utils=require(_0xa4e2('0x6'));var logger=require(_0xa4e2('0x7'))(_0xa4e2('0x8'));var config=require(_0xa4e2('0x9'));var jayson=require(_0xa4e2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59451e,_0x529fee,_0x5051d4){return new BPromise(function(_0x1ac04d,_0x22ea69){return client[_0xa4e2('0xb')](_0x59451e,_0x5051d4)[_0xa4e2('0xc')](function(_0x295083){logger[_0xa4e2('0xd')](_0xa4e2('0xe'),_0x529fee,_0xa4e2('0xf'));logger[_0xa4e2('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x529fee,'request\x20sent',JSON[_0xa4e2('0x11')](_0x295083));if(_0x295083[_0xa4e2('0x12')]){if(_0x295083[_0xa4e2('0x12')]['code']===0x1f4){logger[_0xa4e2('0x12')](_0xa4e2('0xe'),_0x529fee,_0x295083[_0xa4e2('0x12')]['message']);return _0x22ea69(_0x295083['error'][_0xa4e2('0x13')]);}logger[_0xa4e2('0x12')](_0xa4e2('0xe'),_0x529fee,_0x295083[_0xa4e2('0x12')][_0xa4e2('0x13')]);return _0x1ac04d(_0x295083[_0xa4e2('0x12')][_0xa4e2('0x13')]);}else{logger[_0xa4e2('0xd')](_0xa4e2('0xe'),_0x529fee,_0xa4e2('0xf'));_0x1ac04d(_0x295083[_0xa4e2('0x14')][_0xa4e2('0x13')]);}})[_0xa4e2('0x15')](function(_0x1cf25){logger[_0xa4e2('0x12')](_0xa4e2('0xe'),_0x529fee,_0x1cf25);_0x22ea69(_0x1cf25);});});} \ No newline at end of file +var _0x5365=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10bc64,_0x56e086){var _0x4f8bea=function(_0xe75781){while(--_0xe75781){_0x10bc64['push'](_0x10bc64['shift']());}};_0x4f8bea(++_0x56e086);}(_0x5365,0xec));var _0x5536=function(_0x4729e5,_0x15db1c){_0x4729e5=_0x4729e5-0x0;var _0x2df9c6=_0x5365[_0x4729e5];return _0x2df9c6;};'use strict';var _=require(_0x5536('0x0'));var util=require(_0x5536('0x1'));var moment=require('moment');var BPromise=require(_0x5536('0x2'));var rs=require(_0x5536('0x3'));var fs=require('fs');var Redis=require(_0x5536('0x4'));var db=require(_0x5536('0x5'))['db'];var utils=require(_0x5536('0x6'));var logger=require(_0x5536('0x7'))(_0x5536('0x8'));var config=require(_0x5536('0x9'));var jayson=require(_0x5536('0xa'));var client=jayson[_0x5536('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c4e5a,_0x1f9dca,_0x345da3){return new BPromise(function(_0x405b19,_0x433a10){return client[_0x5536('0xc')](_0x2c4e5a,_0x345da3)[_0x5536('0xd')](function(_0x383d8c){logger[_0x5536('0xe')](_0x5536('0xf'),_0x1f9dca,_0x5536('0x10'));logger[_0x5536('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1f9dca,'request\x20sent',JSON['stringify'](_0x383d8c));if(_0x383d8c['error']){if(_0x383d8c[_0x5536('0x12')][_0x5536('0x13')]===0x1f4){logger[_0x5536('0x12')](_0x5536('0xf'),_0x1f9dca,_0x383d8c[_0x5536('0x12')][_0x5536('0x14')]);return _0x433a10(_0x383d8c[_0x5536('0x12')][_0x5536('0x14')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x1f9dca,_0x383d8c[_0x5536('0x12')][_0x5536('0x14')]);return _0x405b19(_0x383d8c['error'][_0x5536('0x14')]);}else{logger['info'](_0x5536('0xf'),_0x1f9dca,_0x5536('0x10'));_0x405b19(_0x383d8c[_0x5536('0x15')][_0x5536('0x14')]);}})['catch'](function(_0x397a39){logger[_0x5536('0x12')](_0x5536('0xf'),_0x1f9dca,_0x397a39);_0x433a10(_0x397a39);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 46dce0b..b0b36e7 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 _0x01d9=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4fa738,_0x2a491c){var _0x55bf55=function(_0x185d53){while(--_0x185d53){_0x4fa738['push'](_0x4fa738['shift']());}};_0x55bf55(++_0x2a491c);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0xd')]('/',auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0xf')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xb'),auth['isAuthenticated'](),controller[_0x901d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb78e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb78e,0x1c9));var _0xeb78=function(_0x2907b7,_0x43fda4){_0x2907b7=_0x2907b7-0x0;var _0x1cf503=_0xb78e[_0x2907b7];return _0x1cf503;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require('path');var timeout=require(_0xeb78('0x2'));var express=require(_0xeb78('0x3'));var router=express[_0xeb78('0x4')]();var auth=require(_0xeb78('0x5'));var interaction=require(_0xeb78('0x6'));var config=require(_0xeb78('0x7'));var controller=require(_0xeb78('0x8'));router[_0xeb78('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb78('0xa')]);router[_0xeb78('0x9')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0xd')]);router[_0xeb78('0xe')]('/',auth[_0xeb78('0xc')](),controller['create']);router[_0xeb78('0xf')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')](_0xeb78('0xb'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x12')]);module[_0xeb78('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 52a9f98..8f341af 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 _0xf2cf=['customVariable','keyValue','STRING','variable','BOOLEAN','exports','ENUM','string'];(function(_0x1ff5e4,_0xc39784){var _0x453e42=function(_0x1a9a84){while(--_0x1a9a84){_0x1ff5e4['push'](_0x1ff5e4['shift']());}};_0x453e42(++_0xc39784);}(_0xf2cf,0xf5));var _0xff2c=function(_0x52f57d,_0x1067a3){_0x52f57d=_0x52f57d-0x0;var _0x419b2b=_0xf2cf[_0x52f57d];return _0x419b2b;};'use strict';var Sequelize=require('sequelize');module[_0xff2c('0x0')]={'type':{'type':Sequelize[_0xff2c('0x1')](_0xff2c('0x2'),'variable',_0xff2c('0x3'),_0xff2c('0x4')),'defaultValue':_0xff2c('0x2')},'content':{'type':Sequelize[_0xff2c('0x5')]},'key':{'type':Sequelize[_0xff2c('0x5')]},'keyType':{'type':Sequelize[_0xff2c('0x1')]('string',_0xff2c('0x6'),_0xff2c('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xff2c('0x5')]},'nameField':{'type':Sequelize[_0xff2c('0x5')]},'customField':{'type':Sequelize[_0xff2c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xff2c('0x5')]}}; \ No newline at end of file +var _0xa663=['exports','string','variable','customVariable','ENUM','STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa663,0xc7));var _0x3a66=function(_0x34ac64,_0x23f246){_0x34ac64=_0x34ac64-0x0;var _0xae8ae9=_0xa663[_0x34ac64];return _0xae8ae9;};'use strict';var Sequelize=require(_0x3a66('0x0'));module[_0x3a66('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3a66('0x2'),_0x3a66('0x3'),_0x3a66('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3a66('0x5')](_0x3a66('0x2'),'variable',_0x3a66('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3a66('0x6')]},'nameField':{'type':Sequelize[_0x3a66('0x6')]},'customField':{'type':Sequelize[_0x3a66('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a66('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 1a9b581..571b87c 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 _0xfb87=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','error','name','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x1cca03,_0xb26831){var _0x11ac32=function(_0x526a7a){while(--_0x526a7a){_0x1cca03['push'](_0x1cca03['shift']());}};_0x11ac32(++_0xb26831);}(_0xfb87,0xc9));var _0x7fb8=function(_0xc4f2a6,_0x1378c0){_0xc4f2a6=_0xc4f2a6-0x0;var _0x5d6ab1=_0xfb87[_0xc4f2a6];return _0x5d6ab1;};'use strict';var pdf=require(_0x7fb8('0x0'));var emlformat=require(_0x7fb8('0x1'));var rimraf=require(_0x7fb8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fb8('0x3'));var rp=require(_0x7fb8('0x4'));var moment=require(_0x7fb8('0x5'));var BPromise=require(_0x7fb8('0x6'));var Mustache=require(_0x7fb8('0x7'));var util=require('util');var path=require(_0x7fb8('0x8'));var sox=require(_0x7fb8('0x9'));var csv=require('to-csv');var ejs=require(_0x7fb8('0xa'));var fs=require('fs');var _=require(_0x7fb8('0xb'));var squel=require(_0x7fb8('0xc'));var crypto=require(_0x7fb8('0xd'));var jsforce=require(_0x7fb8('0xe'));var deskjs=require(_0x7fb8('0xf'));var toCsv=require(_0x7fb8('0x10'));var querystring=require(_0x7fb8('0x11'));var Papa=require(_0x7fb8('0x12'));var Redis=require(_0x7fb8('0x13'));var authService=require(_0x7fb8('0x14'));var qs=require(_0x7fb8('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fb8('0x16'));var logger=require('../../config/logger')(_0x7fb8('0x17'));var utils=require('../../config/utils');var config=require(_0x7fb8('0x18'));var db=require(_0x7fb8('0x19'))['db'];function respondWithStatusCode(_0x1ac2a2,_0x2cd21a){_0x2cd21a=_0x2cd21a||0xcc;return function(_0x3fe52f){if(_0x3fe52f){return _0x1ac2a2[_0x7fb8('0x1a')](_0x2cd21a);}return _0x1ac2a2[_0x7fb8('0x1b')](_0x2cd21a)[_0x7fb8('0x1c')]();};}function respondWithResult(_0x4e351d,_0x2f22e3){_0x2f22e3=_0x2f22e3||0xc8;return function(_0x534a5d){if(_0x534a5d){return _0x4e351d[_0x7fb8('0x1b')](_0x2f22e3)[_0x7fb8('0x1d')](_0x534a5d);}};}function respondWithFilteredResult(_0x22452b,_0x566aed){return function(_0x8f2ce1){if(_0x8f2ce1){var _0x4ec487=_0x8f2ce1[_0x7fb8('0x1e')],_0x1924f9=_0x566aed[_0x7fb8('0x1f')],_0x5df262=_0x566aed[_0x7fb8('0x1f')]+_0x566aed[_0x7fb8('0x20')],_0x3c77ff;if(_0x5df262>=_0x4ec487){_0x5df262=_0x4ec487;_0x3c77ff=0xc8;}else{_0x3c77ff=0xce;}_0x22452b['status'](_0x3c77ff);return _0x22452b[_0x7fb8('0x21')](_0x7fb8('0x22'),_0x1924f9+'-'+_0x5df262+'/'+_0x4ec487)['json'](_0x8f2ce1);}return null;};}function patchUpdates(_0x219fc1){return function(_0x1e5a04){try{jsonpatch[_0x7fb8('0x23')](_0x1e5a04,_0x219fc1,!![]);}catch(_0x372040){return BPromise[_0x7fb8('0x24')](_0x372040);}return _0x1e5a04[_0x7fb8('0x25')]();};}function saveUpdates(_0x191671,_0x512107){return function(_0x781eba){if(_0x781eba){return _0x781eba['update'](_0x191671)['then'](function(_0x442c03){return _0x442c03;});}return null;};}function removeEntity(_0x1d271f,_0x240f42){return function(_0x12340e){if(_0x12340e){return _0x12340e[_0x7fb8('0x26')]()[_0x7fb8('0x27')](function(){_0x1d271f['status'](0xcc)[_0x7fb8('0x1c')]();});}};}function handleEntityNotFound(_0x2a3033,_0x27758c){return function(_0x4383c0){if(!_0x4383c0){_0x2a3033[_0x7fb8('0x1a')](0x194);}return _0x4383c0;};}function handleError(_0x4ef6b0,_0x2e215a){_0x2e215a=_0x2e215a||0x1f4;return function(_0x585f43){logger[_0x7fb8('0x28')](_0x585f43['stack']);if(_0x585f43[_0x7fb8('0x29')]){delete _0x585f43[_0x7fb8('0x29')];}_0x4ef6b0[_0x7fb8('0x1b')](_0x2e215a)['send'](_0x585f43);};}exports[_0x7fb8('0x2a')]=function(_0x1189db,_0x26d790){var _0xf8fc6b={},_0x19444d={},_0x492f6a={'count':0x0,'rows':[]};var _0x3b943f=_[_0x7fb8('0x2b')](db[_0x7fb8('0x2c')][_0x7fb8('0x2d')],function(_0x4955b1){return{'name':_0x4955b1[_0x7fb8('0x2e')],'type':_0x4955b1[_0x7fb8('0x2f')][_0x7fb8('0x30')]};});_0x19444d['model']=_[_0x7fb8('0x2b')](_0x3b943f,'name');_0x19444d[_0x7fb8('0x31')]=_[_0x7fb8('0x32')](_0x1189db[_0x7fb8('0x31')]);_0x19444d[_0x7fb8('0x33')]=_['intersection'](_0x19444d[_0x7fb8('0x34')],_0x19444d['query']);_0xf8fc6b[_0x7fb8('0x35')]=_[_0x7fb8('0x36')](_0x19444d[_0x7fb8('0x34')],qs[_0x7fb8('0x37')](_0x1189db[_0x7fb8('0x31')][_0x7fb8('0x37')]));_0xf8fc6b[_0x7fb8('0x35')]=_0xf8fc6b[_0x7fb8('0x35')][_0x7fb8('0x38')]?_0xf8fc6b['attributes']:_0x19444d[_0x7fb8('0x34')];if(!_0x1189db[_0x7fb8('0x31')][_0x7fb8('0x39')]('nolimit')){_0xf8fc6b[_0x7fb8('0x20')]=qs[_0x7fb8('0x20')](_0x1189db['query']['limit']);_0xf8fc6b[_0x7fb8('0x1f')]=qs[_0x7fb8('0x1f')](_0x1189db[_0x7fb8('0x31')][_0x7fb8('0x1f')]);}_0xf8fc6b[_0x7fb8('0x3a')]=qs['sort'](_0x1189db[_0x7fb8('0x31')][_0x7fb8('0x3b')]);_0xf8fc6b[_0x7fb8('0x3c')]=qs[_0x7fb8('0x33')](_['pick'](_0x1189db[_0x7fb8('0x31')],_0x19444d[_0x7fb8('0x33')]));if(_0x1189db[_0x7fb8('0x31')][_0x7fb8('0x3d')]){_0xf8fc6b[_0x7fb8('0x3c')]=_[_0x7fb8('0x3e')](_0xf8fc6b[_0x7fb8('0x3c')],{'$or':_[_0x7fb8('0x2b')](_0x3b943f,function(_0x285808){if(_0x285808['type']!=='VIRTUAL'){var _0x6e41a6={};_0x6e41a6[_0x285808[_0x7fb8('0x29')]]={'$like':'%'+_0x1189db[_0x7fb8('0x31')][_0x7fb8('0x3d')]+'%'};return _0x6e41a6;}})});}_0xf8fc6b=_[_0x7fb8('0x3e')]({},_0xf8fc6b,_0x1189db[_0x7fb8('0x3f')]);var _0x328a63={'where':_0xf8fc6b[_0x7fb8('0x3c')]};return db['ZohoField'][_0x7fb8('0x1e')](_0x328a63)[_0x7fb8('0x27')](function(_0x9276d9){_0x492f6a[_0x7fb8('0x1e')]=_0x9276d9;if(_0x1189db['query'][_0x7fb8('0x40')]){_0xf8fc6b[_0x7fb8('0x41')]=[{'all':!![]}];}return db[_0x7fb8('0x2c')][_0x7fb8('0x42')](_0xf8fc6b);})['then'](function(_0x516c14){_0x492f6a['rows']=_0x516c14;return _0x492f6a;})[_0x7fb8('0x27')](respondWithFilteredResult(_0x26d790,_0xf8fc6b))[_0x7fb8('0x43')](handleError(_0x26d790,null));};exports['show']=function(_0x30c070,_0x567890){var _0x3a6584={'raw':!![],'where':{'id':_0x30c070[_0x7fb8('0x44')]['id']}},_0x5d3fd4={};_0x5d3fd4[_0x7fb8('0x34')]=_[_0x7fb8('0x32')](db[_0x7fb8('0x2c')][_0x7fb8('0x2d')]);_0x5d3fd4[_0x7fb8('0x31')]=_['keys'](_0x30c070['query']);_0x5d3fd4[_0x7fb8('0x33')]=_[_0x7fb8('0x36')](_0x5d3fd4['model'],_0x5d3fd4[_0x7fb8('0x31')]);_0x3a6584[_0x7fb8('0x35')]=_[_0x7fb8('0x36')](_0x5d3fd4[_0x7fb8('0x34')],qs['fields'](_0x30c070['query'][_0x7fb8('0x37')]));_0x3a6584[_0x7fb8('0x35')]=_0x3a6584['attributes'][_0x7fb8('0x38')]?_0x3a6584['attributes']:_0x5d3fd4[_0x7fb8('0x34')];if(_0x30c070[_0x7fb8('0x31')][_0x7fb8('0x40')]){_0x3a6584[_0x7fb8('0x41')]=[{'all':!![]}];}_0x3a6584=_[_0x7fb8('0x3e')]({},_0x3a6584,_0x30c070[_0x7fb8('0x3f')]);return db[_0x7fb8('0x2c')][_0x7fb8('0x45')](_0x3a6584)[_0x7fb8('0x27')](handleEntityNotFound(_0x567890,null))[_0x7fb8('0x27')](respondWithResult(_0x567890,null))[_0x7fb8('0x43')](handleError(_0x567890,null));};exports[_0x7fb8('0x46')]=function(_0x13b9c7,_0x5d1de9){return db[_0x7fb8('0x2c')][_0x7fb8('0x46')](_0x13b9c7[_0x7fb8('0x47')],{})[_0x7fb8('0x27')](respondWithResult(_0x5d1de9,0xc9))['catch'](handleError(_0x5d1de9,null));};exports['update']=function(_0x5c6e05,_0x3ea159){if(_0x5c6e05['body']['id']){delete _0x5c6e05['body']['id'];}return db['ZohoField'][_0x7fb8('0x45')]({'where':{'id':_0x5c6e05[_0x7fb8('0x44')]['id']}})[_0x7fb8('0x27')](handleEntityNotFound(_0x3ea159,null))[_0x7fb8('0x27')](saveUpdates(_0x5c6e05['body'],null))[_0x7fb8('0x27')](respondWithResult(_0x3ea159,null))['catch'](handleError(_0x3ea159,null));};exports[_0x7fb8('0x26')]=function(_0x2600d2,_0x31a88e){return db['ZohoField'][_0x7fb8('0x45')]({'where':{'id':_0x2600d2[_0x7fb8('0x44')]['id']}})[_0x7fb8('0x27')](handleEntityNotFound(_0x31a88e,null))[_0x7fb8('0x27')](removeEntity(_0x31a88e,null))[_0x7fb8('0x43')](handleError(_0x31a88e,null));}; \ No newline at end of file +var _0xd60d=['save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','ZohoField','findAll','catch','show','params','rawAttributes','length','includeAll','include','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x220a1c,_0xd5aead){var _0xb459b4=function(_0xfcac){while(--_0xfcac){_0x220a1c['push'](_0x220a1c['shift']());}};_0xb459b4(++_0xd5aead);}(_0xd60d,0x108));var _0xdd60=function(_0x476cfe,_0x584e78){_0x476cfe=_0x476cfe-0x0;var _0xa8debb=_0xd60d[_0x476cfe];return _0xa8debb;};'use strict';var pdf=require(_0xdd60('0x0'));var emlformat=require(_0xdd60('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdd60('0x2'));var jsonpatch=require(_0xdd60('0x3'));var rp=require(_0xdd60('0x4'));var moment=require(_0xdd60('0x5'));var BPromise=require(_0xdd60('0x6'));var Mustache=require(_0xdd60('0x7'));var util=require('util');var path=require('path');var sox=require(_0xdd60('0x8'));var csv=require(_0xdd60('0x9'));var ejs=require(_0xdd60('0xa'));var fs=require('fs');var _=require(_0xdd60('0xb'));var squel=require(_0xdd60('0xc'));var crypto=require(_0xdd60('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdd60('0xe'));var toCsv=require(_0xdd60('0x9'));var querystring=require(_0xdd60('0xf'));var Papa=require(_0xdd60('0x10'));var Redis=require(_0xdd60('0x11'));var authService=require(_0xdd60('0x12'));var qs=require(_0xdd60('0x13'));var as=require(_0xdd60('0x14'));var hardwareService=require(_0xdd60('0x15'));var logger=require(_0xdd60('0x16'))('api');var utils=require(_0xdd60('0x17'));var config=require(_0xdd60('0x18'));var db=require(_0xdd60('0x19'))['db'];function respondWithStatusCode(_0x17dbc1,_0x33fb47){_0x33fb47=_0x33fb47||0xcc;return function(_0x4df762){if(_0x4df762){return _0x17dbc1[_0xdd60('0x1a')](_0x33fb47);}return _0x17dbc1[_0xdd60('0x1b')](_0x33fb47)[_0xdd60('0x1c')]();};}function respondWithResult(_0x1f2c55,_0x503129){_0x503129=_0x503129||0xc8;return function(_0x4ad0d3){if(_0x4ad0d3){return _0x1f2c55[_0xdd60('0x1b')](_0x503129)[_0xdd60('0x1d')](_0x4ad0d3);}};}function respondWithFilteredResult(_0x51b5f7,_0x59c940){return function(_0x44abff){if(_0x44abff){var _0x22c5b5=_0x44abff[_0xdd60('0x1e')],_0x20313f=_0x59c940[_0xdd60('0x1f')],_0x2468a6=_0x59c940[_0xdd60('0x1f')]+_0x59c940[_0xdd60('0x20')],_0x5ea9e6;if(_0x2468a6>=_0x22c5b5){_0x2468a6=_0x22c5b5;_0x5ea9e6=0xc8;}else{_0x5ea9e6=0xce;}_0x51b5f7[_0xdd60('0x1b')](_0x5ea9e6);return _0x51b5f7[_0xdd60('0x21')](_0xdd60('0x22'),_0x20313f+'-'+_0x2468a6+'/'+_0x22c5b5)['json'](_0x44abff);}return null;};}function patchUpdates(_0x34ee64){return function(_0xf4217){try{jsonpatch[_0xdd60('0x23')](_0xf4217,_0x34ee64,!![]);}catch(_0x3e433a){return BPromise['reject'](_0x3e433a);}return _0xf4217[_0xdd60('0x24')]();};}function saveUpdates(_0x17c6a0,_0x61a2a8){return function(_0x3f4a1f){if(_0x3f4a1f){return _0x3f4a1f[_0xdd60('0x25')](_0x17c6a0)[_0xdd60('0x26')](function(_0x4b62ca){return _0x4b62ca;});}return null;};}function removeEntity(_0x5fe9aa,_0x41f9f5){return function(_0x4fb37a){if(_0x4fb37a){return _0x4fb37a[_0xdd60('0x27')]()['then'](function(){_0x5fe9aa[_0xdd60('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453e9e,_0x58f170){return function(_0x173299){if(!_0x173299){_0x453e9e['sendStatus'](0x194);}return _0x173299;};}function handleError(_0x2cfdf9,_0x360d54){_0x360d54=_0x360d54||0x1f4;return function(_0x239717){logger[_0xdd60('0x28')](_0x239717[_0xdd60('0x29')]);if(_0x239717[_0xdd60('0x2a')]){delete _0x239717[_0xdd60('0x2a')];}_0x2cfdf9['status'](_0x360d54)[_0xdd60('0x2b')](_0x239717);};}exports[_0xdd60('0x2c')]=function(_0x445071,_0x2823f4){var _0x55c267={},_0x14ce7e={},_0x109dd8={'count':0x0,'rows':[]};var _0x12a691=_[_0xdd60('0x2d')](db['ZohoField']['rawAttributes'],function(_0x3abc0d){return{'name':_0x3abc0d[_0xdd60('0x2e')],'type':_0x3abc0d[_0xdd60('0x2f')][_0xdd60('0x30')]};});_0x14ce7e[_0xdd60('0x31')]=_[_0xdd60('0x2d')](_0x12a691,_0xdd60('0x2a'));_0x14ce7e[_0xdd60('0x32')]=_[_0xdd60('0x33')](_0x445071['query']);_0x14ce7e[_0xdd60('0x34')]=_[_0xdd60('0x35')](_0x14ce7e[_0xdd60('0x31')],_0x14ce7e['query']);_0x55c267[_0xdd60('0x36')]=_[_0xdd60('0x35')](_0x14ce7e[_0xdd60('0x31')],qs[_0xdd60('0x37')](_0x445071[_0xdd60('0x32')]['fields']));_0x55c267[_0xdd60('0x36')]=_0x55c267[_0xdd60('0x36')]['length']?_0x55c267[_0xdd60('0x36')]:_0x14ce7e[_0xdd60('0x31')];if(!_0x445071[_0xdd60('0x32')][_0xdd60('0x38')]('nolimit')){_0x55c267['limit']=qs[_0xdd60('0x20')](_0x445071[_0xdd60('0x32')][_0xdd60('0x20')]);_0x55c267['offset']=qs[_0xdd60('0x1f')](_0x445071[_0xdd60('0x32')][_0xdd60('0x1f')]);}_0x55c267[_0xdd60('0x39')]=qs[_0xdd60('0x3a')](_0x445071[_0xdd60('0x32')][_0xdd60('0x3a')]);_0x55c267[_0xdd60('0x3b')]=qs[_0xdd60('0x34')](_['pick'](_0x445071['query'],_0x14ce7e[_0xdd60('0x34')]));if(_0x445071['query'][_0xdd60('0x3c')]){_0x55c267[_0xdd60('0x3b')]=_[_0xdd60('0x3d')](_0x55c267[_0xdd60('0x3b')],{'$or':_['map'](_0x12a691,function(_0x4faf39){if(_0x4faf39[_0xdd60('0x2f')]!==_0xdd60('0x3e')){var _0x14d65f={};_0x14d65f[_0x4faf39['name']]={'$like':'%'+_0x445071['query']['filter']+'%'};return _0x14d65f;}})});}_0x55c267=_[_0xdd60('0x3d')]({},_0x55c267,_0x445071[_0xdd60('0x3f')]);var _0x33a82a={'where':_0x55c267[_0xdd60('0x3b')]};return db[_0xdd60('0x40')]['count'](_0x33a82a)[_0xdd60('0x26')](function(_0x1b234b){_0x109dd8[_0xdd60('0x1e')]=_0x1b234b;if(_0x445071[_0xdd60('0x32')]['includeAll']){_0x55c267['include']=[{'all':!![]}];}return db[_0xdd60('0x40')][_0xdd60('0x41')](_0x55c267);})[_0xdd60('0x26')](function(_0x1c4ade){_0x109dd8['rows']=_0x1c4ade;return _0x109dd8;})[_0xdd60('0x26')](respondWithFilteredResult(_0x2823f4,_0x55c267))[_0xdd60('0x42')](handleError(_0x2823f4,null));};exports[_0xdd60('0x43')]=function(_0x15fd47,_0x21ca74){var _0x2619e7={'raw':!![],'where':{'id':_0x15fd47[_0xdd60('0x44')]['id']}},_0x467c24={};_0x467c24[_0xdd60('0x31')]=_[_0xdd60('0x33')](db[_0xdd60('0x40')][_0xdd60('0x45')]);_0x467c24[_0xdd60('0x32')]=_[_0xdd60('0x33')](_0x15fd47[_0xdd60('0x32')]);_0x467c24['filters']=_[_0xdd60('0x35')](_0x467c24[_0xdd60('0x31')],_0x467c24['query']);_0x2619e7['attributes']=_['intersection'](_0x467c24['model'],qs['fields'](_0x15fd47[_0xdd60('0x32')]['fields']));_0x2619e7[_0xdd60('0x36')]=_0x2619e7[_0xdd60('0x36')][_0xdd60('0x46')]?_0x2619e7[_0xdd60('0x36')]:_0x467c24['model'];if(_0x15fd47['query'][_0xdd60('0x47')]){_0x2619e7[_0xdd60('0x48')]=[{'all':!![]}];}_0x2619e7=_['merge']({},_0x2619e7,_0x15fd47[_0xdd60('0x3f')]);return db[_0xdd60('0x40')]['find'](_0x2619e7)[_0xdd60('0x26')](handleEntityNotFound(_0x21ca74,null))['then'](respondWithResult(_0x21ca74,null))['catch'](handleError(_0x21ca74,null));};exports['create']=function(_0x48d2a0,_0x4473d2){return db[_0xdd60('0x40')]['create'](_0x48d2a0[_0xdd60('0x49')],{})['then'](respondWithResult(_0x4473d2,0xc9))[_0xdd60('0x42')](handleError(_0x4473d2,null));};exports['update']=function(_0x4a3439,_0x2dec60){if(_0x4a3439[_0xdd60('0x49')]['id']){delete _0x4a3439[_0xdd60('0x49')]['id'];}return db[_0xdd60('0x40')][_0xdd60('0x4a')]({'where':{'id':_0x4a3439[_0xdd60('0x44')]['id']}})[_0xdd60('0x26')](handleEntityNotFound(_0x2dec60,null))[_0xdd60('0x26')](saveUpdates(_0x4a3439['body'],null))[_0xdd60('0x26')](respondWithResult(_0x2dec60,null))[_0xdd60('0x42')](handleError(_0x2dec60,null));};exports[_0xdd60('0x27')]=function(_0x5bd075,_0x2982bb){return db[_0xdd60('0x40')]['find']({'where':{'id':_0x5bd075[_0xdd60('0x44')]['id']}})[_0xdd60('0x26')](handleEntityNotFound(_0x2982bb,null))[_0xdd60('0x26')](removeEntity(_0x2982bb,null))[_0xdd60('0x42')](handleError(_0x2982bb,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0b7ec2e..07b0eb1 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 _0x507b=['./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x507b,0xe3));var _0xb507=function(_0x1c448a,_0x2f464d){_0x1c448a=_0x1c448a-0x0;var _0x29e6e3=_0x507b[_0x1c448a];return _0x29e6e3;};'use strict';var _=require('lodash');var util=require(_0xb507('0x0'));var logger=require(_0xb507('0x1'))(_0xb507('0x2'));var moment=require(_0xb507('0x3'));var BPromise=require('bluebird');var rp=require(_0xb507('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb507('0x5'));var config=require(_0xb507('0x6'));var attributes=require(_0xb507('0x7'));module[_0xb507('0x8')]=function(_0x179eda,_0x206fad){return _0x179eda['define'](_0xb507('0x9'),attributes,{'tableName':_0xb507('0xa'),'paranoid':![],'indexes':[{'name':_0xb507('0xb'),'fields':['idField',_0xb507('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd312=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x230a76,_0x21f647){var _0x1fd385=function(_0x101984){while(--_0x101984){_0x230a76['push'](_0x230a76['shift']());}};_0x1fd385(++_0x21f647);}(_0xd312,0x6a));var _0x2d31=function(_0x2a41f6,_0xc91ac1){_0x2a41f6=_0x2a41f6-0x0;var _0x1c1810=_0xd312[_0x2a41f6];return _0x1c1810;};'use strict';var _=require(_0x2d31('0x0'));var util=require('util');var logger=require(_0x2d31('0x1'))(_0x2d31('0x2'));var moment=require(_0x2d31('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d31('0x4'));var fs=require('fs');var path=require(_0x2d31('0x5'));var rimraf=require(_0x2d31('0x6'));var config=require(_0x2d31('0x7'));var attributes=require(_0x2d31('0x8'));module[_0x2d31('0x9')]=function(_0x3aef71,_0x5f68b6){return _0x3aef71[_0x2d31('0xa')]('ZohoField',attributes,{'tableName':_0x2d31('0xb'),'paranoid':![],'indexes':[{'name':_0x2d31('0xc'),'fields':[_0x2d31('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 26800a4..088c1f9 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result'];(function(_0x4dcdfc,_0x11374f){var _0x25d086=function(_0x4e1141){while(--_0x4e1141){_0x4dcdfc['push'](_0x4dcdfc['shift']());}};_0x25d086(++_0x11374f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0xf3cd[_0x4a1ec0];return _0x49ab91;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('ZohoField,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('ZohoField,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0x17ba=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e8a1b,_0x3847b0){var _0x54cce1=function(_0x19ecd3){while(--_0x19ecd3){_0x4e8a1b['push'](_0x4e8a1b['shift']());}};_0x54cce1(++_0x3847b0);}(_0x17ba,0xab));var _0xa17b=function(_0x4a00fd,_0x5d82a1){_0x4a00fd=_0x4a00fd-0x0;var _0x362738=_0x17ba[_0x4a00fd];return _0x362738;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('ZohoField,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('ZohoField,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 36ef8d8..69ef3c7 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 _0x6c18=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0xea2450,_0x5b33d4){var _0x10ad5a=function(_0x5b39bc){while(--_0x5b39bc){_0xea2450['push'](_0xea2450['shift']());}};_0x10ad5a(++_0x5b33d4);}(_0x6c18,0xd8));var _0x86c1=function(_0x1247c8,_0x5cae15){_0x1247c8=_0x1247c8-0x0;var _0x5c62e5=_0x6c18[_0x1247c8];return _0x5c62e5;};'use strict';var multer=require(_0x86c1('0x0'));var util=require(_0x86c1('0x1'));var path=require(_0x86c1('0x2'));var timeout=require(_0x86c1('0x3'));var express=require(_0x86c1('0x4'));var router=express[_0x86c1('0x5')]();var auth=require(_0x86c1('0x6'));var interaction=require(_0x86c1('0x7'));var config=require(_0x86c1('0x8'));module[_0x86c1('0x9')]=router; \ No newline at end of file +var _0xb1ce=['express','Router','../../components/auth/service','exports','multer','util','path','connect-timeout'];(function(_0x33e7c3,_0x19930c){var _0xc43789=function(_0x4dd02b){while(--_0x4dd02b){_0x33e7c3['push'](_0x33e7c3['shift']());}};_0xc43789(++_0x19930c);}(_0xb1ce,0x12c));var _0xeb1c=function(_0x16d5e9,_0x44e7e4){_0x16d5e9=_0x16d5e9-0x0;var _0x49e1b6=_0xb1ce[_0x16d5e9];return _0x49e1b6;};'use strict';var multer=require(_0xeb1c('0x0'));var util=require(_0xeb1c('0x1'));var path=require(_0xeb1c('0x2'));var timeout=require(_0xeb1c('0x3'));var express=require(_0xeb1c('0x4'));var router=express[_0xeb1c('0x5')]();var auth=require(_0xeb1c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xeb1c('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 9ec354a..d381950 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 _0xda75=['exports','unique_name_and_version','STRING','app.js','BOOLEAN','state'];(function(_0x1346ed,_0x5b168c){var _0x422a9a=function(_0x4d72b7){while(--_0x4d72b7){_0x1346ed['push'](_0x1346ed['shift']());}};_0x422a9a(++_0x5b168c);}(_0xda75,0xae));var _0x5da7=function(_0x39d0d5,_0xcd43b4){_0x39d0d5=_0x39d0d5-0x0;var _0x4e4d18=_0xda75[_0x39d0d5];return _0x4e4d18;};'use strict';var Sequelize=require('sequelize');module[_0x5da7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5da7('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x5da7('0x2')],'defaultValue':_0x5da7('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x5da7('0x2')]},'type':{'type':Sequelize[_0x5da7('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x5da7('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x5da7('0x2')]},'logo':{'type':Sequelize[_0x5da7('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x5da7('0x5')},'description':{'type':Sequelize[_0x5da7('0x2')]},'title':{'type':Sequelize[_0x5da7('0x2')]},'remoteUri':{'type':Sequelize[_0x5da7('0x2')]},'link':{'type':Sequelize[_0x5da7('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5d2b=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x28018c,_0x110680){var _0x2a262b=function(_0x172e15){while(--_0x172e15){_0x28018c['push'](_0x28018c['shift']());}};_0x2a262b(++_0x110680);}(_0x5d2b,0xb5));var _0xb5d2=function(_0x5d25bc,_0x238b66){_0x5d25bc=_0x5d25bc-0x0;var _0x3c1390=_0x5d2b[_0x5d25bc];return _0x3c1390;};'use strict';var Sequelize=require(_0xb5d2('0x0'));module[_0xb5d2('0x1')]={'name':{'type':Sequelize[_0xb5d2('0x2')],'allowNull':![],'unique':_0xb5d2('0x3')},'version':{'type':Sequelize[_0xb5d2('0x2')],'allowNull':![],'unique':_0xb5d2('0x3')},'main':{'type':Sequelize[_0xb5d2('0x2')],'defaultValue':_0xb5d2('0x4')},'filename':{'type':Sequelize[_0xb5d2('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xb5d2('0x5')]},'active':{'type':Sequelize[_0xb5d2('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xb5d2('0x2')]},'logo':{'type':Sequelize[_0xb5d2('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xb5d2('0x7')},'description':{'type':Sequelize[_0xb5d2('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb5d2('0x2')]},'link':{'type':Sequelize[_0xb5d2('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 9db97cd..ae96ee4 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 _0xb7cc=['ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','model','options','find','catch','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x12a600,_0x4aa209){var _0x236c37=function(_0x54f71b){while(--_0x54f71b){_0x12a600['push'](_0x12a600['shift']());}};_0x236c37(++_0x4aa209);}(_0xb7cc,0x83));var _0xcb7c=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xb7cc[_0x32b542];return _0x554d54;};'use strict';var pdf=require(_0xcb7c('0x0'));var emlformat=require(_0xcb7c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcb7c('0x2'));var rp=require(_0xcb7c('0x3'));var moment=require(_0xcb7c('0x4'));var BPromise=require(_0xcb7c('0x5'));var Mustache=require(_0xcb7c('0x6'));var util=require(_0xcb7c('0x7'));var path=require(_0xcb7c('0x8'));var sox=require(_0xcb7c('0x9'));var csv=require(_0xcb7c('0xa'));var ejs=require(_0xcb7c('0xb'));var fs=require('fs');var _=require(_0xcb7c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcb7c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcb7c('0xe'));var Papa=require(_0xcb7c('0xf'));var Redis=require(_0xcb7c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcb7c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb7c('0x12'))(_0xcb7c('0x13'));var utils=require('../../config/utils');var config=require(_0xcb7c('0x14'));var db=require(_0xcb7c('0x15'))['db'];function respondWithStatusCode(_0x150f6a,_0x3dc4ac){_0x3dc4ac=_0x3dc4ac||0xcc;return function(_0x31404c){if(_0x31404c){return _0x150f6a[_0xcb7c('0x16')](_0x3dc4ac);}return _0x150f6a[_0xcb7c('0x17')](_0x3dc4ac)[_0xcb7c('0x18')]();};}function respondWithResult(_0x465eb0,_0x19ce59){_0x19ce59=_0x19ce59||0xc8;return function(_0x1ca655){if(_0x1ca655){return _0x465eb0[_0xcb7c('0x17')](_0x19ce59)['json'](_0x1ca655);}};}function respondWithFilteredResult(_0xc27c4f,_0x2a22bd){return function(_0x325675){if(_0x325675){var _0x2d1384=_0x325675[_0xcb7c('0x19')],_0xc76ecf=_0x2a22bd[_0xcb7c('0x1a')],_0x591935=_0x2a22bd[_0xcb7c('0x1a')]+_0x2a22bd['limit'],_0x597a16;if(_0x591935>=_0x2d1384){_0x591935=_0x2d1384;_0x597a16=0xc8;}else{_0x597a16=0xce;}_0xc27c4f['status'](_0x597a16);return _0xc27c4f[_0xcb7c('0x1b')](_0xcb7c('0x1c'),_0xc76ecf+'-'+_0x591935+'/'+_0x2d1384)[_0xcb7c('0x1d')](_0x325675);}return null;};}function patchUpdates(_0x101e14){return function(_0x18f594){try{jsonpatch['apply'](_0x18f594,_0x101e14,!![]);}catch(_0x1d053a){return BPromise[_0xcb7c('0x1e')](_0x1d053a);}return _0x18f594[_0xcb7c('0x1f')]();};}function saveUpdates(_0x59aee4,_0x4943e1){return function(_0x206374){if(_0x206374){return _0x206374[_0xcb7c('0x20')](_0x59aee4)[_0xcb7c('0x21')](function(_0x21dfea){return _0x21dfea;});}return null;};}function removeEntity(_0x4fe6f9,_0x590a68){return function(_0x43c1ff){if(_0x43c1ff){return _0x43c1ff[_0xcb7c('0x22')]()[_0xcb7c('0x21')](function(){_0x4fe6f9[_0xcb7c('0x17')](0xcc)[_0xcb7c('0x18')]();});}};}function handleEntityNotFound(_0xe6b5ea,_0x295d82){return function(_0x3318ee){if(!_0x3318ee){_0xe6b5ea[_0xcb7c('0x16')](0x194);}return _0x3318ee;};}function handleError(_0x12e80d,_0x15ddf2){_0x15ddf2=_0x15ddf2||0x1f4;return function(_0x3d0aea){logger[_0xcb7c('0x23')](_0x3d0aea[_0xcb7c('0x24')]);if(_0x3d0aea[_0xcb7c('0x25')]){delete _0x3d0aea['name'];}_0x12e80d[_0xcb7c('0x17')](_0x15ddf2)[_0xcb7c('0x26')](_0x3d0aea);};}exports[_0xcb7c('0x27')]=function(_0x58eeca,_0xbc5954){var _0x199fd2={},_0x30d41e={},_0x525d91={'count':0x0,'rows':[]};var _0x53f594=_['map'](db[_0xcb7c('0x28')][_0xcb7c('0x29')],function(_0x4e1050){return{'name':_0x4e1050[_0xcb7c('0x2a')],'type':_0x4e1050[_0xcb7c('0x2b')]['key']};});_0x30d41e['model']=_[_0xcb7c('0x2c')](_0x53f594,_0xcb7c('0x25'));_0x30d41e[_0xcb7c('0x2d')]=_[_0xcb7c('0x2e')](_0x58eeca[_0xcb7c('0x2d')]);_0x30d41e[_0xcb7c('0x2f')]=_['intersection'](_0x30d41e['model'],_0x30d41e[_0xcb7c('0x2d')]);_0x199fd2['attributes']=_[_0xcb7c('0x30')](_0x30d41e['model'],qs[_0xcb7c('0x31')](_0x58eeca[_0xcb7c('0x2d')][_0xcb7c('0x31')]));_0x199fd2[_0xcb7c('0x32')]=_0x199fd2[_0xcb7c('0x32')]['length']?_0x199fd2[_0xcb7c('0x32')]:_0x30d41e['model'];if(!_0x58eeca[_0xcb7c('0x2d')][_0xcb7c('0x33')]('nolimit')){_0x199fd2['limit']=qs[_0xcb7c('0x34')](_0x58eeca[_0xcb7c('0x2d')][_0xcb7c('0x34')]);_0x199fd2[_0xcb7c('0x1a')]=qs['offset'](_0x58eeca[_0xcb7c('0x2d')]['offset']);}_0x199fd2['order']=qs[_0xcb7c('0x35')](_0x58eeca[_0xcb7c('0x2d')]['sort']);_0x199fd2[_0xcb7c('0x36')]=qs[_0xcb7c('0x2f')](_[_0xcb7c('0x37')](_0x58eeca[_0xcb7c('0x2d')],_0x30d41e[_0xcb7c('0x2f')]));if(_0x58eeca[_0xcb7c('0x2d')][_0xcb7c('0x38')]){_0x199fd2[_0xcb7c('0x36')]=_[_0xcb7c('0x39')](_0x199fd2['where'],{'$or':_['map'](_0x53f594,function(_0x40589d){if(_0x40589d[_0xcb7c('0x2b')]!==_0xcb7c('0x3a')){var _0x5ccbff={};_0x5ccbff[_0x40589d['name']]={'$like':'%'+_0x58eeca['query'][_0xcb7c('0x38')]+'%'};return _0x5ccbff;}})});}_0x199fd2=_['merge']({},_0x199fd2,_0x58eeca['options']);var _0x2ff545={'where':_0x199fd2[_0xcb7c('0x36')]};return db[_0xcb7c('0x28')]['count'](_0x2ff545)[_0xcb7c('0x21')](function(_0xfc3275){_0x525d91[_0xcb7c('0x19')]=_0xfc3275;if(_0x58eeca[_0xcb7c('0x2d')][_0xcb7c('0x3b')]){_0x199fd2[_0xcb7c('0x3c')]=[{'all':!![]}];}return db[_0xcb7c('0x28')][_0xcb7c('0x3d')](_0x199fd2);})['then'](function(_0x38bbb4){_0x525d91[_0xcb7c('0x3e')]=_0x38bbb4;return _0x525d91;})[_0xcb7c('0x21')](respondWithFilteredResult(_0xbc5954,_0x199fd2))['catch'](handleError(_0xbc5954,null));};exports[_0xcb7c('0x3f')]=function(_0x12248e,_0x2a534d){var _0x46e79e={'raw':![],'where':{'id':_0x12248e[_0xcb7c('0x40')]['id']}},_0x72265b={};_0x72265b[_0xcb7c('0x41')]=_[_0xcb7c('0x2e')](db['Integration'][_0xcb7c('0x29')]);_0x72265b['query']=_['keys'](_0x12248e[_0xcb7c('0x2d')]);_0x72265b['filters']=_[_0xcb7c('0x30')](_0x72265b[_0xcb7c('0x41')],_0x72265b[_0xcb7c('0x2d')]);_0x46e79e['attributes']=_[_0xcb7c('0x30')](_0x72265b['model'],qs[_0xcb7c('0x31')](_0x12248e[_0xcb7c('0x2d')][_0xcb7c('0x31')]));_0x46e79e[_0xcb7c('0x32')]=_0x46e79e[_0xcb7c('0x32')]['length']?_0x46e79e[_0xcb7c('0x32')]:_0x72265b['model'];if(_0x12248e['query']['includeAll']){_0x46e79e['include']=[{'all':!![]}];}_0x46e79e=_[_0xcb7c('0x39')]({},_0x46e79e,_0x12248e[_0xcb7c('0x42')]);return db[_0xcb7c('0x28')][_0xcb7c('0x43')](_0x46e79e)[_0xcb7c('0x21')](handleEntityNotFound(_0x2a534d,null))[_0xcb7c('0x21')](respondWithResult(_0x2a534d,null))[_0xcb7c('0x44')](handleError(_0x2a534d,null));};exports[_0xcb7c('0x45')]=function(_0x2ee63f,_0x545958){return db['Integration'][_0xcb7c('0x45')](_0x2ee63f['body'],{})['then'](respondWithResult(_0x545958,0xc9))[_0xcb7c('0x44')](handleError(_0x545958,null));};exports['update']=function(_0x24958c,_0x12b481){if(_0x24958c[_0xcb7c('0x46')]['id']){delete _0x24958c[_0xcb7c('0x46')]['id'];}return db[_0xcb7c('0x28')][_0xcb7c('0x43')]({'where':{'id':_0x24958c[_0xcb7c('0x40')]['id']}})[_0xcb7c('0x21')](handleEntityNotFound(_0x12b481,null))['then'](saveUpdates(_0x24958c[_0xcb7c('0x46')],null))['then'](respondWithResult(_0x12b481,null))['catch'](handleError(_0x12b481,null));};exports[_0xcb7c('0x22')]=function(_0x2a7f6e,_0xed0391){return db[_0xcb7c('0x28')]['find']({'where':{'id':_0x2a7f6e[_0xcb7c('0x40')]['id']}})[_0xcb7c('0x21')](handleEntityNotFound(_0xed0391,null))[_0xcb7c('0x21')](removeEntity(_0xed0391,null))[_0xcb7c('0x44')](handleError(_0xed0391,null));}; \ No newline at end of file +var _0xbfa7=['merge','type','VIRTUAL','filter','options','Integration','count','findAll','then','rows','catch','show','params','keys','includeAll','create','update','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','set','json','apply','save','destroy','error','name','send','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where'];(function(_0x4bf3a7,_0x5d756b){var _0x58c9cc=function(_0x13c6c9){while(--_0x13c6c9){_0x4bf3a7['push'](_0x4bf3a7['shift']());}};_0x58c9cc(++_0x5d756b);}(_0xbfa7,0x127));var _0x7bfa=function(_0x506cb8,_0x37378c){_0x506cb8=_0x506cb8-0x0;var _0x14d743=_0xbfa7[_0x506cb8];return _0x14d743;};'use strict';var pdf=require(_0x7bfa('0x0'));var emlformat=require(_0x7bfa('0x1'));var rimraf=require(_0x7bfa('0x2'));var zipdir=require(_0x7bfa('0x3'));var jsonpatch=require(_0x7bfa('0x4'));var rp=require(_0x7bfa('0x5'));var moment=require(_0x7bfa('0x6'));var BPromise=require(_0x7bfa('0x7'));var Mustache=require('mustache');var util=require(_0x7bfa('0x8'));var path=require(_0x7bfa('0x9'));var sox=require('sox');var csv=require(_0x7bfa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7bfa('0xb'));var squel=require(_0x7bfa('0xc'));var crypto=require(_0x7bfa('0xd'));var jsforce=require(_0x7bfa('0xe'));var deskjs=require(_0x7bfa('0xf'));var toCsv=require(_0x7bfa('0xa'));var querystring=require(_0x7bfa('0x10'));var Papa=require(_0x7bfa('0x11'));var Redis=require(_0x7bfa('0x12'));var authService=require(_0x7bfa('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7bfa('0x14'));var logger=require(_0x7bfa('0x15'))(_0x7bfa('0x16'));var utils=require(_0x7bfa('0x17'));var config=require('../../config/environment');var db=require(_0x7bfa('0x18'))['db'];function respondWithStatusCode(_0x4ad88e,_0xe1a47f){_0xe1a47f=_0xe1a47f||0xcc;return function(_0x1b18a5){if(_0x1b18a5){return _0x4ad88e['sendStatus'](_0xe1a47f);}return _0x4ad88e[_0x7bfa('0x19')](_0xe1a47f)['end']();};}function respondWithResult(_0x596731,_0x380a13){_0x380a13=_0x380a13||0xc8;return function(_0x3f80fe){if(_0x3f80fe){return _0x596731['status'](_0x380a13)['json'](_0x3f80fe);}};}function respondWithFilteredResult(_0x43dbb4,_0x192820){return function(_0x474405){if(_0x474405){var _0x4b0628=_0x474405['count'],_0x5177d4=_0x192820[_0x7bfa('0x1a')],_0x2a5716=_0x192820[_0x7bfa('0x1a')]+_0x192820['limit'],_0x3904cb;if(_0x2a5716>=_0x4b0628){_0x2a5716=_0x4b0628;_0x3904cb=0xc8;}else{_0x3904cb=0xce;}_0x43dbb4[_0x7bfa('0x19')](_0x3904cb);return _0x43dbb4[_0x7bfa('0x1b')]('Content-Range',_0x5177d4+'-'+_0x2a5716+'/'+_0x4b0628)[_0x7bfa('0x1c')](_0x474405);}return null;};}function patchUpdates(_0x5ba4ca){return function(_0x107616){try{jsonpatch[_0x7bfa('0x1d')](_0x107616,_0x5ba4ca,!![]);}catch(_0x1c8bff){return BPromise['reject'](_0x1c8bff);}return _0x107616[_0x7bfa('0x1e')]();};}function saveUpdates(_0x5083e7,_0x4434d1){return function(_0x2fd6be){if(_0x2fd6be){return _0x2fd6be['update'](_0x5083e7)['then'](function(_0x58f3a3){return _0x58f3a3;});}return null;};}function removeEntity(_0x37476b,_0x1d5045){return function(_0x16d256){if(_0x16d256){return _0x16d256[_0x7bfa('0x1f')]()['then'](function(){_0x37476b[_0x7bfa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e879f,_0x17e1e2){return function(_0x156e23){if(!_0x156e23){_0x5e879f['sendStatus'](0x194);}return _0x156e23;};}function handleError(_0x353e72,_0x572824){_0x572824=_0x572824||0x1f4;return function(_0x2f7164){logger[_0x7bfa('0x20')](_0x2f7164['stack']);if(_0x2f7164[_0x7bfa('0x21')]){delete _0x2f7164[_0x7bfa('0x21')];}_0x353e72[_0x7bfa('0x19')](_0x572824)[_0x7bfa('0x22')](_0x2f7164);};}exports['index']=function(_0x479efa,_0xe789bb){var _0x52da7e={},_0x26c601={},_0x3c11cc={'count':0x0,'rows':[]};var _0x19560e=_[_0x7bfa('0x23')](db['Integration'][_0x7bfa('0x24')],function(_0x278d92){return{'name':_0x278d92['fieldName'],'type':_0x278d92['type'][_0x7bfa('0x25')]};});_0x26c601[_0x7bfa('0x26')]=_[_0x7bfa('0x23')](_0x19560e,_0x7bfa('0x21'));_0x26c601[_0x7bfa('0x27')]=_['keys'](_0x479efa[_0x7bfa('0x27')]);_0x26c601[_0x7bfa('0x28')]=_[_0x7bfa('0x29')](_0x26c601[_0x7bfa('0x26')],_0x26c601[_0x7bfa('0x27')]);_0x52da7e[_0x7bfa('0x2a')]=_[_0x7bfa('0x29')](_0x26c601[_0x7bfa('0x26')],qs[_0x7bfa('0x2b')](_0x479efa[_0x7bfa('0x27')][_0x7bfa('0x2b')]));_0x52da7e[_0x7bfa('0x2a')]=_0x52da7e['attributes'][_0x7bfa('0x2c')]?_0x52da7e['attributes']:_0x26c601['model'];if(!_0x479efa[_0x7bfa('0x27')]['hasOwnProperty'](_0x7bfa('0x2d'))){_0x52da7e[_0x7bfa('0x2e')]=qs[_0x7bfa('0x2e')](_0x479efa[_0x7bfa('0x27')][_0x7bfa('0x2e')]);_0x52da7e['offset']=qs[_0x7bfa('0x1a')](_0x479efa[_0x7bfa('0x27')][_0x7bfa('0x1a')]);}_0x52da7e[_0x7bfa('0x2f')]=qs[_0x7bfa('0x30')](_0x479efa[_0x7bfa('0x27')][_0x7bfa('0x30')]);_0x52da7e[_0x7bfa('0x31')]=qs[_0x7bfa('0x28')](_['pick'](_0x479efa['query'],_0x26c601['filters']));if(_0x479efa[_0x7bfa('0x27')]['filter']){_0x52da7e[_0x7bfa('0x31')]=_[_0x7bfa('0x32')](_0x52da7e[_0x7bfa('0x31')],{'$or':_[_0x7bfa('0x23')](_0x19560e,function(_0x257eac){if(_0x257eac[_0x7bfa('0x33')]!==_0x7bfa('0x34')){var _0x28c933={};_0x28c933[_0x257eac[_0x7bfa('0x21')]]={'$like':'%'+_0x479efa[_0x7bfa('0x27')][_0x7bfa('0x35')]+'%'};return _0x28c933;}})});}_0x52da7e=_[_0x7bfa('0x32')]({},_0x52da7e,_0x479efa[_0x7bfa('0x36')]);var _0x354be2={'where':_0x52da7e[_0x7bfa('0x31')]};return db[_0x7bfa('0x37')][_0x7bfa('0x38')](_0x354be2)['then'](function(_0x5218c7){_0x3c11cc[_0x7bfa('0x38')]=_0x5218c7;if(_0x479efa['query']['includeAll']){_0x52da7e['include']=[{'all':!![]}];}return db['Integration'][_0x7bfa('0x39')](_0x52da7e);})[_0x7bfa('0x3a')](function(_0x236cf3){_0x3c11cc[_0x7bfa('0x3b')]=_0x236cf3;return _0x3c11cc;})['then'](respondWithFilteredResult(_0xe789bb,_0x52da7e))[_0x7bfa('0x3c')](handleError(_0xe789bb,null));};exports[_0x7bfa('0x3d')]=function(_0x291f3d,_0x10d9e0){var _0x44ef36={'raw':![],'where':{'id':_0x291f3d[_0x7bfa('0x3e')]['id']}},_0x2c0388={};_0x2c0388[_0x7bfa('0x26')]=_[_0x7bfa('0x3f')](db['Integration'][_0x7bfa('0x24')]);_0x2c0388[_0x7bfa('0x27')]=_[_0x7bfa('0x3f')](_0x291f3d[_0x7bfa('0x27')]);_0x2c0388[_0x7bfa('0x28')]=_[_0x7bfa('0x29')](_0x2c0388['model'],_0x2c0388['query']);_0x44ef36['attributes']=_[_0x7bfa('0x29')](_0x2c0388['model'],qs[_0x7bfa('0x2b')](_0x291f3d['query'][_0x7bfa('0x2b')]));_0x44ef36['attributes']=_0x44ef36['attributes'][_0x7bfa('0x2c')]?_0x44ef36['attributes']:_0x2c0388['model'];if(_0x291f3d['query'][_0x7bfa('0x40')]){_0x44ef36['include']=[{'all':!![]}];}_0x44ef36=_[_0x7bfa('0x32')]({},_0x44ef36,_0x291f3d[_0x7bfa('0x36')]);return db[_0x7bfa('0x37')]['find'](_0x44ef36)[_0x7bfa('0x3a')](handleEntityNotFound(_0x10d9e0,null))[_0x7bfa('0x3a')](respondWithResult(_0x10d9e0,null))[_0x7bfa('0x3c')](handleError(_0x10d9e0,null));};exports[_0x7bfa('0x41')]=function(_0x4a4619,_0x4a3110){return db[_0x7bfa('0x37')]['create'](_0x4a4619['body'],{})[_0x7bfa('0x3a')](respondWithResult(_0x4a3110,0xc9))[_0x7bfa('0x3c')](handleError(_0x4a3110,null));};exports[_0x7bfa('0x42')]=function(_0x2abdeb,_0xd742d2){if(_0x2abdeb[_0x7bfa('0x43')]['id']){delete _0x2abdeb[_0x7bfa('0x43')]['id'];}return db[_0x7bfa('0x37')]['find']({'where':{'id':_0x2abdeb[_0x7bfa('0x3e')]['id']}})[_0x7bfa('0x3a')](handleEntityNotFound(_0xd742d2,null))['then'](saveUpdates(_0x2abdeb[_0x7bfa('0x43')],null))['then'](respondWithResult(_0xd742d2,null))[_0x7bfa('0x3c')](handleError(_0xd742d2,null));};exports[_0x7bfa('0x1f')]=function(_0x5e5f10,_0x4df147){return db[_0x7bfa('0x37')][_0x7bfa('0x44')]({'where':{'id':_0x5e5f10[_0x7bfa('0x3e')]['id']}})[_0x7bfa('0x3a')](handleEntityNotFound(_0x4df147,null))[_0x7bfa('0x3a')](removeEntity(_0x4df147,null))['catch'](handleError(_0x4df147,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index f94e469..4a3e062 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 _0x54b6=['path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4f35f4,_0x51a8c3){var _0x2e9a70=function(_0x110aca){while(--_0x110aca){_0x4f35f4['push'](_0x4f35f4['shift']());}};_0x2e9a70(++_0x51a8c3);}(_0x54b6,0x13b));var _0x654b=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x54b6[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x654b('0x0'));var util=require(_0x654b('0x1'));var logger=require(_0x654b('0x2'))(_0x654b('0x3'));var moment=require(_0x654b('0x4'));var BPromise=require(_0x654b('0x5'));var rp=require(_0x654b('0x6'));var fs=require('fs');var path=require(_0x654b('0x7'));var rimraf=require(_0x654b('0x8'));var config=require('../../config/environment');var attributes=require(_0x654b('0x9'));module[_0x654b('0xa')]=function(_0xde7b73,_0x385555){return _0xde7b73[_0x654b('0xb')](_0x654b('0xc'),attributes,{'tableName':_0x654b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbf4=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42152e,_0x509b93){var _0x57bb09=function(_0x164609){while(--_0x164609){_0x42152e['push'](_0x42152e['shift']());}};_0x57bb09(++_0x509b93);}(_0xcbf4,0x89));var _0x4cbf=function(_0x5591bf,_0x9ab837){_0x5591bf=_0x5591bf-0x0;var _0x13e6cc=_0xcbf4[_0x5591bf];return _0x13e6cc;};'use strict';var _=require(_0x4cbf('0x0'));var util=require(_0x4cbf('0x1'));var logger=require(_0x4cbf('0x2'))(_0x4cbf('0x3'));var moment=require(_0x4cbf('0x4'));var BPromise=require(_0x4cbf('0x5'));var rp=require(_0x4cbf('0x6'));var fs=require('fs');var path=require(_0x4cbf('0x7'));var rimraf=require(_0x4cbf('0x8'));var config=require(_0x4cbf('0x9'));var attributes=require('./integration.attributes');module[_0x4cbf('0xa')]=function(_0x5eb9a8,_0x36db05){return _0x5eb9a8[_0x4cbf('0xb')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 63ce597..f4e578a 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 _0xd0e7=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5d2a0c,_0x1d66ae){var _0x3ec319=function(_0xf41064){while(--_0xf41064){_0x5d2a0c['push'](_0x5d2a0c['shift']());}};_0x3ec319(++_0x1d66ae);}(_0xd0e7,0x10d));var _0x7d0e=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xd0e7[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var moment=require(_0x7d0e('0x2'));var BPromise=require(_0x7d0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d0e('0x4'));var db=require(_0x7d0e('0x5'))['db'];var utils=require(_0x7d0e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d0e('0x7'));var jayson=require(_0x7d0e('0x8'));var client=jayson[_0x7d0e('0x9')][_0x7d0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17303e,_0x3559be,_0x5f20b6){return new BPromise(function(_0x16b3dd,_0x302ce7){return client[_0x7d0e('0xb')](_0x17303e,_0x5f20b6)[_0x7d0e('0xc')](function(_0x286113){logger[_0x7d0e('0xd')]('Integration,\x20%s,\x20%s',_0x3559be,_0x7d0e('0xe'));logger[_0x7d0e('0xf')](_0x7d0e('0x10'),_0x3559be,'request\x20sent',JSON[_0x7d0e('0x11')](_0x286113));if(_0x286113[_0x7d0e('0x12')]){if(_0x286113['error'][_0x7d0e('0x13')]===0x1f4){logger[_0x7d0e('0x12')](_0x7d0e('0x14'),_0x3559be,_0x286113[_0x7d0e('0x12')][_0x7d0e('0x15')]);return _0x302ce7(_0x286113[_0x7d0e('0x12')][_0x7d0e('0x15')]);}logger[_0x7d0e('0x12')]('Integration,\x20%s,\x20%s',_0x3559be,_0x286113[_0x7d0e('0x12')][_0x7d0e('0x15')]);return _0x16b3dd(_0x286113[_0x7d0e('0x12')][_0x7d0e('0x15')]);}else{logger[_0x7d0e('0xd')]('Integration,\x20%s,\x20%s',_0x3559be,_0x7d0e('0xe'));_0x16b3dd(_0x286113[_0x7d0e('0x16')][_0x7d0e('0x15')]);}})['catch'](function(_0xc09a9d){logger[_0x7d0e('0x12')](_0x7d0e('0x14'),_0x3559be,_0xc09a9d);_0x302ce7(_0xc09a9d);});});} \ No newline at end of file +var _0xc4a1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x243470,_0x522fdb){_0x243470=_0x243470-0x0;var _0x1282f3=_0xc4a1[_0x243470];return _0x1282f3;};'use strict';var _=require(_0x1c4a('0x0'));var util=require('util');var moment=require(_0x1c4a('0x1'));var BPromise=require(_0x1c4a('0x2'));var rs=require(_0x1c4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c4a('0x4'))['db'];var utils=require(_0x1c4a('0x5'));var logger=require(_0x1c4a('0x6'))(_0x1c4a('0x7'));var config=require(_0x1c4a('0x8'));var jayson=require(_0x1c4a('0x9'));var client=jayson[_0x1c4a('0xa')][_0x1c4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46e47d,_0x420058,_0x2f84b0){return new BPromise(function(_0xef9b92,_0x456e39){return client['request'](_0x46e47d,_0x2f84b0)[_0x1c4a('0xc')](function(_0x4272ec){logger['info'](_0x1c4a('0xd'),_0x420058,'request\x20sent');logger['debug'](_0x1c4a('0xe'),_0x420058,_0x1c4a('0xf'),JSON['stringify'](_0x4272ec));if(_0x4272ec[_0x1c4a('0x10')]){if(_0x4272ec[_0x1c4a('0x10')]['code']===0x1f4){logger['error'](_0x1c4a('0xd'),_0x420058,_0x4272ec[_0x1c4a('0x10')]['message']);return _0x456e39(_0x4272ec['error'][_0x1c4a('0x11')]);}logger[_0x1c4a('0x10')](_0x1c4a('0xd'),_0x420058,_0x4272ec[_0x1c4a('0x10')][_0x1c4a('0x11')]);return _0xef9b92(_0x4272ec[_0x1c4a('0x10')][_0x1c4a('0x11')]);}else{logger[_0x1c4a('0x12')](_0x1c4a('0xd'),_0x420058,_0x1c4a('0xf'));_0xef9b92(_0x4272ec['result'][_0x1c4a('0x11')]);}})[_0x1c4a('0x13')](function(_0x1b1358){logger[_0x1c4a('0x10')]('Integration,\x20%s,\x20%s',_0x420058,_0x1b1358);_0x456e39(_0x1b1358);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index c171529..43a6cfe 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 _0x0712=['update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x323591,_0x518650){var _0x423982=function(_0x1b7a15){while(--_0x1b7a15){_0x323591['push'](_0x323591['shift']());}};_0x423982(++_0x518650);}(_0x0712,0x147));var _0x2071=function(_0x37cf10,_0x4fda60){_0x37cf10=_0x37cf10-0x0;var _0x9e9c52=_0x0712[_0x37cf10];return _0x9e9c52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2071('0x0'));var timeout=require(_0x2071('0x1'));var express=require('express');var router=express[_0x2071('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x2071('0x3'));var config=require(_0x2071('0x4'));var controller=require(_0x2071('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x2071('0x6')]);router[_0x2071('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x2071('0x8')]);router[_0x2071('0x7')](_0x2071('0x9'),auth[_0x2071('0xa')](),controller[_0x2071('0xb')]);router[_0x2071('0xc')]('/',auth[_0x2071('0xa')](),controller[_0x2071('0xd')]);router[_0x2071('0xe')]('/:id',auth[_0x2071('0xa')](),controller[_0x2071('0xf')]);router[_0x2071('0x10')](_0x2071('0x9'),auth[_0x2071('0xa')](),controller[_0x2071('0x11')]);module[_0x2071('0x12')]=router; \ No newline at end of file +var _0x5fb0=['/:id','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','show','create','put'];(function(_0x586ba0,_0x3c033e){var _0x1e010a=function(_0x22cfae){while(--_0x22cfae){_0x586ba0['push'](_0x586ba0['shift']());}};_0x1e010a(++_0x3c033e);}(_0x5fb0,0x134));var _0x05fb=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x5fb0[_0x36d25e];return _0x4b95b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x05fb('0x0'));var timeout=require(_0x05fb('0x1'));var express=require(_0x05fb('0x2'));var router=express['Router']();var auth=require(_0x05fb('0x3'));var interaction=require(_0x05fb('0x4'));var config=require('../../config/environment');var controller=require(_0x05fb('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x05fb('0x6')](_0x05fb('0x7'),auth[_0x05fb('0x8')](),controller['describe']);router[_0x05fb('0x6')]('/:id',auth[_0x05fb('0x8')](),controller[_0x05fb('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x05fb('0xa')]);router[_0x05fb('0xb')](_0x05fb('0xc'),auth[_0x05fb('0x8')](),controller['update']);router[_0x05fb('0xd')](_0x05fb('0xc'),auth[_0x05fb('0x8')](),controller[_0x05fb('0xe')]);module[_0x05fb('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e08bfd2..65b6ea3 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 _0x1eb5=['SENT','SENDING','RECEIVED','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x1eb5,0x159));var _0x51eb=function(_0x40d9db,_0x5d31ae){_0x40d9db=_0x40d9db-0x0;var _0xa2dbed=_0x1eb5[_0x40d9db];return _0xa2dbed;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x51eb('0x0')]},'eventChannel':{'type':Sequelize[_0x51eb('0x0')]},'exitStatus':{'type':Sequelize[_0x51eb('0x0')]},'ticketId':{'type':Sequelize[_0x51eb('0x0')]},'integrationId':{'type':Sequelize[_0x51eb('0x1')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x51eb('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x51eb('0x0')]},'queue':{'type':Sequelize[_0x51eb('0x0')]},'interface':{'type':Sequelize[_0x51eb('0x0')]},'membername':{'type':Sequelize[_0x51eb('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x51eb('0x1')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x51eb('0x2')]},'talktime':{'type':Sequelize[_0x51eb('0x1')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x51eb('0x1')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x51eb('0x2')]},'agentdump':{'type':Sequelize[_0x51eb('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x51eb('0x0')]},'channel':{'type':Sequelize[_0x51eb('0x0')]},'channelstate':{'type':Sequelize[_0x51eb('0x1')]},'channelstatedesc':{'type':Sequelize[_0x51eb('0x0')]},'connectedlinenum':{'type':Sequelize[_0x51eb('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x51eb('0x0')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x51eb('0x0')]},'priority':{'type':Sequelize[_0x51eb('0x0')]},'destchannel':{'type':Sequelize[_0x51eb('0x0')]},'destchannelstate':{'type':Sequelize[_0x51eb('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x51eb('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x51eb('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x51eb('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x51eb('0x0')]},'destlanguage':{'type':Sequelize[_0x51eb('0x0')]},'destaccountcode':{'type':Sequelize[_0x51eb('0x0')]},'destcontext':{'type':Sequelize[_0x51eb('0x0')]},'destexten':{'type':Sequelize[_0x51eb('0x0')]},'destpriority':{'type':Sequelize[_0x51eb('0x0')]},'destuniqueid':{'type':Sequelize[_0x51eb('0x0')]},'messageId':{'type':Sequelize[_0x51eb('0x0')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x51eb('0x0')]},'from':{'type':Sequelize[_0x51eb('0x0')]},'to':{'type':Sequelize[_0x51eb('0x0')]},'cc':{'type':Sequelize[_0x51eb('0x0')]},'attachment':{'type':Sequelize[_0x51eb('0x4')]},'html':{'type':Sequelize[_0x51eb('0x4')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x51eb('0x5')](_0x51eb('0x6'),_0x51eb('0x7'),_0x51eb('0x8'),'FAILED')},'url':{'type':Sequelize[_0x51eb('0x0')]},'app':{'type':Sequelize[_0x51eb('0x0')]},'appdata':{'type':Sequelize[_0x51eb('0x0')]},'projectId':{'type':Sequelize[_0x51eb('0x1')]}}; \ No newline at end of file +var _0x7644=['TEXT','ENUM','SENT','FAILED','sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7644,0x67));var _0x4764=function(_0x53bb0c,_0x540f55){_0x53bb0c=_0x53bb0c-0x0;var _0x5f2962=_0x7644[_0x53bb0c];return _0x5f2962;};'use strict';var Sequelize=require(_0x4764('0x0'));module['exports']={'integration':{'type':Sequelize[_0x4764('0x1')]},'eventChannel':{'type':Sequelize[_0x4764('0x1')]},'exitStatus':{'type':Sequelize[_0x4764('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4764('0x1')]},'uniqueid':{'type':Sequelize[_0x4764('0x1')]},'calleridnum':{'type':Sequelize[_0x4764('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4764('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x4764('0x2')]},'agentconnectAt':{'type':Sequelize[_0x4764('0x2')]},'holdtime':{'type':Sequelize[_0x4764('0x3')]},'agentcomplete':{'type':Sequelize[_0x4764('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4764('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4764('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4764('0x3')]},'reason':{'type':Sequelize[_0x4764('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x4764('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4764('0x2')]},'agentdump':{'type':Sequelize[_0x4764('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4764('0x2')]},'lastevent':{'type':Sequelize[_0x4764('0x1')]},'channel':{'type':Sequelize[_0x4764('0x1')]},'channelstate':{'type':Sequelize[_0x4764('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4764('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4764('0x1')]},'connectedlinename':{'type':Sequelize[_0x4764('0x1')]},'language':{'type':Sequelize[_0x4764('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4764('0x1')]},'exten':{'type':Sequelize[_0x4764('0x1')]},'priority':{'type':Sequelize[_0x4764('0x1')]},'destchannel':{'type':Sequelize[_0x4764('0x1')]},'destchannelstate':{'type':Sequelize[_0x4764('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x4764('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4764('0x1')]},'destcalleridname':{'type':Sequelize[_0x4764('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4764('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4764('0x1')]},'destlanguage':{'type':Sequelize[_0x4764('0x1')]},'destaccountcode':{'type':Sequelize[_0x4764('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x4764('0x1')]},'destpriority':{'type':Sequelize[_0x4764('0x1')]},'destuniqueid':{'type':Sequelize[_0x4764('0x1')]},'messageId':{'type':Sequelize[_0x4764('0x1')]},'inReplyTo':{'type':Sequelize[_0x4764('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x4764('0x1')]},'to':{'type':Sequelize[_0x4764('0x1')]},'cc':{'type':Sequelize[_0x4764('0x1')]},'attachment':{'type':Sequelize[_0x4764('0x5')]},'html':{'type':Sequelize[_0x4764('0x5')]},'text':{'type':Sequelize[_0x4764('0x5')]},'status':{'type':Sequelize[_0x4764('0x6')](_0x4764('0x7'),'SENDING','RECEIVED',_0x4764('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x4764('0x1')]},'appdata':{'type':Sequelize[_0x4764('0x1')]},'projectId':{'type':Sequelize[_0x4764('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c1fa4f9..c0724cb 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 _0x68b3=['filter','merge','type','count','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick'];(function(_0x425486,_0x543ed2){var _0x48b595=function(_0x3de0a4){while(--_0x3de0a4){_0x425486['push'](_0x425486['shift']());}};_0x48b595(++_0x543ed2);}(_0x68b3,0x1d8));var _0x368b=function(_0x42e734,_0x2d009c){_0x42e734=_0x42e734-0x0;var _0x2e8656=_0x68b3[_0x42e734];return _0x2e8656;};'use strict';var pdf=require(_0x368b('0x0'));var emlformat=require(_0x368b('0x1'));var rimraf=require(_0x368b('0x2'));var zipdir=require(_0x368b('0x3'));var jsonpatch=require(_0x368b('0x4'));var rp=require('request-promise');var moment=require(_0x368b('0x5'));var BPromise=require(_0x368b('0x6'));var Mustache=require(_0x368b('0x7'));var util=require(_0x368b('0x8'));var path=require('path');var sox=require(_0x368b('0x9'));var csv=require(_0x368b('0xa'));var ejs=require(_0x368b('0xb'));var fs=require('fs');var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0xa'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var db=require(_0x368b('0x19'))['db'];function respondWithStatusCode(_0x847dcb,_0x514dc7){_0x514dc7=_0x514dc7||0xcc;return function(_0x109a90){if(_0x109a90){return _0x847dcb[_0x368b('0x1a')](_0x514dc7);}return _0x847dcb[_0x368b('0x1b')](_0x514dc7)[_0x368b('0x1c')]();};}function respondWithResult(_0xdd5d13,_0x4fffe5){_0x4fffe5=_0x4fffe5||0xc8;return function(_0x2b326c){if(_0x2b326c){return _0xdd5d13[_0x368b('0x1b')](_0x4fffe5)['json'](_0x2b326c);}};}function respondWithFilteredResult(_0x1c5e5b,_0x2aabb9){return function(_0x30c245){if(_0x30c245){var _0x515350=_0x30c245['count'],_0x220cd5=_0x2aabb9[_0x368b('0x1d')],_0x392376=_0x2aabb9[_0x368b('0x1d')]+_0x2aabb9[_0x368b('0x1e')],_0x1f1029;if(_0x392376>=_0x515350){_0x392376=_0x515350;_0x1f1029=0xc8;}else{_0x1f1029=0xce;}_0x1c5e5b['status'](_0x1f1029);return _0x1c5e5b['set'](_0x368b('0x1f'),_0x220cd5+'-'+_0x392376+'/'+_0x515350)[_0x368b('0x20')](_0x30c245);}return null;};}function patchUpdates(_0x2c3cec){return function(_0x1e632a){try{jsonpatch[_0x368b('0x21')](_0x1e632a,_0x2c3cec,!![]);}catch(_0x4b8fb7){return BPromise[_0x368b('0x22')](_0x4b8fb7);}return _0x1e632a[_0x368b('0x23')]();};}function saveUpdates(_0x2e74ca,_0x1c927f){return function(_0x23da8f){if(_0x23da8f){return _0x23da8f[_0x368b('0x24')](_0x2e74ca)[_0x368b('0x25')](function(_0x1d8066){return _0x1d8066;});}return null;};}function removeEntity(_0x508e48,_0x13e750){return function(_0x2f08d9){if(_0x2f08d9){return _0x2f08d9[_0x368b('0x26')]()[_0x368b('0x25')](function(){_0x508e48[_0x368b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x286641,_0x1ca429){return function(_0x3a22bd){if(!_0x3a22bd){_0x286641[_0x368b('0x1a')](0x194);}return _0x3a22bd;};}function handleError(_0x77a269,_0x85515f){_0x85515f=_0x85515f||0x1f4;return function(_0x430e16){logger[_0x368b('0x27')](_0x430e16[_0x368b('0x28')]);if(_0x430e16[_0x368b('0x29')]){delete _0x430e16[_0x368b('0x29')];}_0x77a269[_0x368b('0x1b')](_0x85515f)[_0x368b('0x2a')](_0x430e16);};}exports[_0x368b('0x2b')]=function(_0x4636f4,_0x23a83a){var _0x5dc5fa={},_0x9f192e={},_0x39ef94={'count':0x0,'rows':[]};var _0x1e0e46=_[_0x368b('0x2c')](db[_0x368b('0x2d')][_0x368b('0x2e')],function(_0x3c80b5){return{'name':_0x3c80b5['fieldName'],'type':_0x3c80b5['type'][_0x368b('0x2f')]};});_0x9f192e[_0x368b('0x30')]=_[_0x368b('0x2c')](_0x1e0e46,_0x368b('0x29'));_0x9f192e['query']=_[_0x368b('0x31')](_0x4636f4[_0x368b('0x32')]);_0x9f192e[_0x368b('0x33')]=_[_0x368b('0x34')](_0x9f192e[_0x368b('0x30')],_0x9f192e['query']);_0x5dc5fa[_0x368b('0x35')]=_[_0x368b('0x34')](_0x9f192e[_0x368b('0x30')],qs[_0x368b('0x36')](_0x4636f4['query']['fields']));_0x5dc5fa['attributes']=_0x5dc5fa[_0x368b('0x35')][_0x368b('0x37')]?_0x5dc5fa[_0x368b('0x35')]:_0x9f192e[_0x368b('0x30')];if(!_0x4636f4[_0x368b('0x32')]['hasOwnProperty'](_0x368b('0x38'))){_0x5dc5fa[_0x368b('0x1e')]=qs['limit'](_0x4636f4[_0x368b('0x32')][_0x368b('0x1e')]);_0x5dc5fa['offset']=qs[_0x368b('0x1d')](_0x4636f4[_0x368b('0x32')]['offset']);}_0x5dc5fa[_0x368b('0x39')]=qs['sort'](_0x4636f4['query']['sort']);_0x5dc5fa[_0x368b('0x3a')]=qs[_0x368b('0x33')](_[_0x368b('0x3b')](_0x4636f4[_0x368b('0x32')],_0x9f192e[_0x368b('0x33')]));if(_0x4636f4[_0x368b('0x32')][_0x368b('0x3c')]){_0x5dc5fa[_0x368b('0x3a')]=_[_0x368b('0x3d')](_0x5dc5fa[_0x368b('0x3a')],{'$or':_['map'](_0x1e0e46,function(_0x204c52){if(_0x204c52[_0x368b('0x3e')]!=='VIRTUAL'){var _0x221210={};_0x221210[_0x204c52[_0x368b('0x29')]]={'$like':'%'+_0x4636f4[_0x368b('0x32')][_0x368b('0x3c')]+'%'};return _0x221210;}})});}_0x5dc5fa=_[_0x368b('0x3d')]({},_0x5dc5fa,_0x4636f4['options']);var _0x24b993={'where':_0x5dc5fa[_0x368b('0x3a')]};return db[_0x368b('0x2d')][_0x368b('0x3f')](_0x24b993)['then'](function(_0x579cb3){_0x39ef94[_0x368b('0x3f')]=_0x579cb3;if(_0x4636f4[_0x368b('0x32')][_0x368b('0x40')]){_0x5dc5fa[_0x368b('0x41')]=[{'all':!![]}];}return db[_0x368b('0x2d')][_0x368b('0x42')](_0x5dc5fa);})[_0x368b('0x25')](function(_0xaa348d){_0x39ef94[_0x368b('0x43')]=_0xaa348d;return _0x39ef94;})[_0x368b('0x25')](respondWithFilteredResult(_0x23a83a,_0x5dc5fa))['catch'](handleError(_0x23a83a,null));};exports[_0x368b('0x44')]=function(_0x179e46,_0x5a3ff1){var _0x25e713={'raw':![],'where':{'id':_0x179e46[_0x368b('0x45')]['id']}},_0x1ea901={};_0x1ea901[_0x368b('0x30')]=_['keys'](db[_0x368b('0x2d')][_0x368b('0x2e')]);_0x1ea901['query']=_[_0x368b('0x31')](_0x179e46[_0x368b('0x32')]);_0x1ea901[_0x368b('0x33')]=_['intersection'](_0x1ea901[_0x368b('0x30')],_0x1ea901[_0x368b('0x32')]);_0x25e713[_0x368b('0x35')]=_['intersection'](_0x1ea901['model'],qs[_0x368b('0x36')](_0x179e46[_0x368b('0x32')]['fields']));_0x25e713[_0x368b('0x35')]=_0x25e713[_0x368b('0x35')][_0x368b('0x37')]?_0x25e713[_0x368b('0x35')]:_0x1ea901[_0x368b('0x30')];if(_0x179e46[_0x368b('0x32')][_0x368b('0x40')]){_0x25e713[_0x368b('0x41')]=[{'all':!![]}];}_0x25e713=_[_0x368b('0x3d')]({},_0x25e713,_0x179e46[_0x368b('0x46')]);return db[_0x368b('0x2d')][_0x368b('0x47')](_0x25e713)[_0x368b('0x25')](handleEntityNotFound(_0x5a3ff1,null))['then'](respondWithResult(_0x5a3ff1,null))[_0x368b('0x48')](handleError(_0x5a3ff1,null));};exports[_0x368b('0x49')]=function(_0xe79f4c,_0xf95817){return db[_0x368b('0x2d')]['create'](_0xe79f4c['body'],{})[_0x368b('0x25')](respondWithResult(_0xf95817,0xc9))[_0x368b('0x48')](handleError(_0xf95817,null));};exports[_0x368b('0x24')]=function(_0x5a9d70,_0x378510){if(_0x5a9d70[_0x368b('0x4a')]['id']){delete _0x5a9d70[_0x368b('0x4a')]['id'];}return db[_0x368b('0x2d')][_0x368b('0x47')]({'where':{'id':_0x5a9d70[_0x368b('0x45')]['id']}})[_0x368b('0x25')](handleEntityNotFound(_0x378510,null))[_0x368b('0x25')](saveUpdates(_0x5a9d70[_0x368b('0x4a')],null))[_0x368b('0x25')](respondWithResult(_0x378510,null))['catch'](handleError(_0x378510,null));};exports[_0x368b('0x26')]=function(_0x582640,_0x1a4370){return db['IntegrationReport'][_0x368b('0x47')]({'where':{'id':_0x582640['params']['id']}})[_0x368b('0x25')](handleEntityNotFound(_0x1a4370,null))[_0x368b('0x25')](removeEntity(_0x1a4370,null))[_0x368b('0x48')](handleError(_0x1a4370,null));};exports[_0x368b('0x4b')]=function(_0x49b78c,_0x360281){return db[_0x368b('0x2d')][_0x368b('0x4b')]()[_0x368b('0x25')](respondWithResult(_0x360281,null))[_0x368b('0x48')](handleError(_0x360281,null));}; \ No newline at end of file +var _0xfff0=['include','findAll','rows','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','status','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','IntegrationReport','includeAll'];(function(_0x1aefff,_0x4046e7){var _0x7ee76a=function(_0x6b30af){while(--_0x6b30af){_0x1aefff['push'](_0x1aefff['shift']());}};_0x7ee76a(++_0x4046e7);}(_0xfff0,0x139));var _0x0fff=function(_0x2fd85f,_0x4f07c1){_0x2fd85f=_0x2fd85f-0x0;var _0x4bd78d=_0xfff0[_0x2fd85f];return _0x4bd78d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fff('0x0'));var rimraf=require(_0x0fff('0x1'));var zipdir=require(_0x0fff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fff('0x3'));var moment=require(_0x0fff('0x4'));var BPromise=require(_0x0fff('0x5'));var Mustache=require('mustache');var util=require(_0x0fff('0x6'));var path=require(_0x0fff('0x7'));var sox=require('sox');var csv=require(_0x0fff('0x8'));var ejs=require(_0x0fff('0x9'));var fs=require('fs');var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var db=require(_0x0fff('0x17'))['db'];function respondWithStatusCode(_0x411ffc,_0x13f768){_0x13f768=_0x13f768||0xcc;return function(_0x5abecd){if(_0x5abecd){return _0x411ffc[_0x0fff('0x18')](_0x13f768);}return _0x411ffc['status'](_0x13f768)[_0x0fff('0x19')]();};}function respondWithResult(_0x431efa,_0x38fc82){_0x38fc82=_0x38fc82||0xc8;return function(_0x2c0322){if(_0x2c0322){return _0x431efa['status'](_0x38fc82)['json'](_0x2c0322);}};}function respondWithFilteredResult(_0x1daf30,_0x50a9e4){return function(_0x5636fd){if(_0x5636fd){var _0x51ceea=_0x5636fd[_0x0fff('0x1a')],_0x1fb430=_0x50a9e4[_0x0fff('0x1b')],_0x41e2e7=_0x50a9e4['offset']+_0x50a9e4['limit'],_0x5eab2e;if(_0x41e2e7>=_0x51ceea){_0x41e2e7=_0x51ceea;_0x5eab2e=0xc8;}else{_0x5eab2e=0xce;}_0x1daf30['status'](_0x5eab2e);return _0x1daf30[_0x0fff('0x1c')](_0x0fff('0x1d'),_0x1fb430+'-'+_0x41e2e7+'/'+_0x51ceea)[_0x0fff('0x1e')](_0x5636fd);}return null;};}function patchUpdates(_0x3762dc){return function(_0x253de9){try{jsonpatch[_0x0fff('0x1f')](_0x253de9,_0x3762dc,!![]);}catch(_0x4c88ae){return BPromise[_0x0fff('0x20')](_0x4c88ae);}return _0x253de9[_0x0fff('0x21')]();};}function saveUpdates(_0x48e6f9,_0x49d211){return function(_0x5e27df){if(_0x5e27df){return _0x5e27df[_0x0fff('0x22')](_0x48e6f9)[_0x0fff('0x23')](function(_0x1f97c5){return _0x1f97c5;});}return null;};}function removeEntity(_0x3c4f8f,_0x502393){return function(_0x155132){if(_0x155132){return _0x155132[_0x0fff('0x24')]()[_0x0fff('0x23')](function(){_0x3c4f8f[_0x0fff('0x25')](0xcc)[_0x0fff('0x19')]();});}};}function handleEntityNotFound(_0x17fba6,_0x580b8e){return function(_0x6a116c){if(!_0x6a116c){_0x17fba6[_0x0fff('0x18')](0x194);}return _0x6a116c;};}function handleError(_0x37e090,_0x24cd18){_0x24cd18=_0x24cd18||0x1f4;return function(_0x11ac00){logger[_0x0fff('0x26')](_0x11ac00['stack']);if(_0x11ac00[_0x0fff('0x27')]){delete _0x11ac00[_0x0fff('0x27')];}_0x37e090[_0x0fff('0x25')](_0x24cd18)[_0x0fff('0x28')](_0x11ac00);};}exports[_0x0fff('0x29')]=function(_0x12d699,_0x27bd76){var _0x3e6fef={},_0x44e54a={},_0xc32a61={'count':0x0,'rows':[]};var _0x40651c=_[_0x0fff('0x2a')](db['IntegrationReport'][_0x0fff('0x2b')],function(_0x2d1800){return{'name':_0x2d1800[_0x0fff('0x2c')],'type':_0x2d1800[_0x0fff('0x2d')][_0x0fff('0x2e')]};});_0x44e54a[_0x0fff('0x2f')]=_['map'](_0x40651c,_0x0fff('0x27'));_0x44e54a[_0x0fff('0x30')]=_[_0x0fff('0x31')](_0x12d699['query']);_0x44e54a[_0x0fff('0x32')]=_[_0x0fff('0x33')](_0x44e54a['model'],_0x44e54a[_0x0fff('0x30')]);_0x3e6fef[_0x0fff('0x34')]=_[_0x0fff('0x33')](_0x44e54a[_0x0fff('0x2f')],qs[_0x0fff('0x35')](_0x12d699[_0x0fff('0x30')][_0x0fff('0x35')]));_0x3e6fef[_0x0fff('0x34')]=_0x3e6fef[_0x0fff('0x34')][_0x0fff('0x36')]?_0x3e6fef['attributes']:_0x44e54a[_0x0fff('0x2f')];if(!_0x12d699[_0x0fff('0x30')][_0x0fff('0x37')](_0x0fff('0x38'))){_0x3e6fef[_0x0fff('0x39')]=qs['limit'](_0x12d699['query'][_0x0fff('0x39')]);_0x3e6fef[_0x0fff('0x1b')]=qs[_0x0fff('0x1b')](_0x12d699[_0x0fff('0x30')]['offset']);}_0x3e6fef[_0x0fff('0x3a')]=qs[_0x0fff('0x3b')](_0x12d699[_0x0fff('0x30')][_0x0fff('0x3b')]);_0x3e6fef['where']=qs[_0x0fff('0x32')](_[_0x0fff('0x3c')](_0x12d699[_0x0fff('0x30')],_0x44e54a[_0x0fff('0x32')]));if(_0x12d699[_0x0fff('0x30')][_0x0fff('0x3d')]){_0x3e6fef[_0x0fff('0x3e')]=_[_0x0fff('0x3f')](_0x3e6fef[_0x0fff('0x3e')],{'$or':_[_0x0fff('0x2a')](_0x40651c,function(_0x30595c){if(_0x30595c[_0x0fff('0x2d')]!=='VIRTUAL'){var _0x114e9a={};_0x114e9a[_0x30595c[_0x0fff('0x27')]]={'$like':'%'+_0x12d699[_0x0fff('0x30')][_0x0fff('0x3d')]+'%'};return _0x114e9a;}})});}_0x3e6fef=_[_0x0fff('0x3f')]({},_0x3e6fef,_0x12d699[_0x0fff('0x40')]);var _0x4bf286={'where':_0x3e6fef[_0x0fff('0x3e')]};return db[_0x0fff('0x41')][_0x0fff('0x1a')](_0x4bf286)[_0x0fff('0x23')](function(_0x1e7128){_0xc32a61[_0x0fff('0x1a')]=_0x1e7128;if(_0x12d699[_0x0fff('0x30')][_0x0fff('0x42')]){_0x3e6fef[_0x0fff('0x43')]=[{'all':!![]}];}return db['IntegrationReport'][_0x0fff('0x44')](_0x3e6fef);})['then'](function(_0x28a8b7){_0xc32a61[_0x0fff('0x45')]=_0x28a8b7;return _0xc32a61;})[_0x0fff('0x23')](respondWithFilteredResult(_0x27bd76,_0x3e6fef))['catch'](handleError(_0x27bd76,null));};exports['show']=function(_0x91411b,_0x9470f){var _0x311348={'raw':![],'where':{'id':_0x91411b['params']['id']}},_0x4f18dd={};_0x4f18dd[_0x0fff('0x2f')]=_['keys'](db[_0x0fff('0x41')][_0x0fff('0x2b')]);_0x4f18dd[_0x0fff('0x30')]=_[_0x0fff('0x31')](_0x91411b[_0x0fff('0x30')]);_0x4f18dd[_0x0fff('0x32')]=_['intersection'](_0x4f18dd[_0x0fff('0x2f')],_0x4f18dd[_0x0fff('0x30')]);_0x311348[_0x0fff('0x34')]=_[_0x0fff('0x33')](_0x4f18dd[_0x0fff('0x2f')],qs[_0x0fff('0x35')](_0x91411b[_0x0fff('0x30')]['fields']));_0x311348[_0x0fff('0x34')]=_0x311348[_0x0fff('0x34')][_0x0fff('0x36')]?_0x311348['attributes']:_0x4f18dd[_0x0fff('0x2f')];if(_0x91411b[_0x0fff('0x30')][_0x0fff('0x42')]){_0x311348[_0x0fff('0x43')]=[{'all':!![]}];}_0x311348=_[_0x0fff('0x3f')]({},_0x311348,_0x91411b[_0x0fff('0x40')]);return db[_0x0fff('0x41')][_0x0fff('0x46')](_0x311348)[_0x0fff('0x23')](handleEntityNotFound(_0x9470f,null))[_0x0fff('0x23')](respondWithResult(_0x9470f,null))[_0x0fff('0x47')](handleError(_0x9470f,null));};exports['create']=function(_0x3f97b6,_0x1ad309){return db['IntegrationReport'][_0x0fff('0x48')](_0x3f97b6[_0x0fff('0x49')],{})[_0x0fff('0x23')](respondWithResult(_0x1ad309,0xc9))['catch'](handleError(_0x1ad309,null));};exports['update']=function(_0x2a0b10,_0x497704){if(_0x2a0b10['body']['id']){delete _0x2a0b10[_0x0fff('0x49')]['id'];}return db[_0x0fff('0x41')][_0x0fff('0x46')]({'where':{'id':_0x2a0b10[_0x0fff('0x4a')]['id']}})[_0x0fff('0x23')](handleEntityNotFound(_0x497704,null))[_0x0fff('0x23')](saveUpdates(_0x2a0b10['body'],null))[_0x0fff('0x23')](respondWithResult(_0x497704,null))[_0x0fff('0x47')](handleError(_0x497704,null));};exports[_0x0fff('0x24')]=function(_0x32568a,_0x30c4d6){return db[_0x0fff('0x41')]['find']({'where':{'id':_0x32568a[_0x0fff('0x4a')]['id']}})[_0x0fff('0x23')](handleEntityNotFound(_0x30c4d6,null))['then'](removeEntity(_0x30c4d6,null))[_0x0fff('0x47')](handleError(_0x30c4d6,null));};exports['describe']=function(_0x5f1943,_0x5aa5d3){return db[_0x0fff('0x41')][_0x0fff('0x4b')]()[_0x0fff('0x23')](respondWithResult(_0x5aa5d3,null))[_0x0fff('0x47')](handleError(_0x5aa5d3,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 7d131cb..8fc4114 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 _0x8836=['lodash','../../config/logger','moment','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0x1d34dc,_0x3db614){var _0x300c26=function(_0x125af5){while(--_0x125af5){_0x1d34dc['push'](_0x1d34dc['shift']());}};_0x300c26(++_0x3db614);}(_0x8836,0x1c3));var _0x6883=function(_0x3428a0,_0x39a2d8){_0x3428a0=_0x3428a0-0x0;var _0x44f11d=_0x8836[_0x3428a0];return _0x44f11d;};'use strict';var _=require(_0x6883('0x0'));var util=require('util');var logger=require(_0x6883('0x1'))('api');var moment=require(_0x6883('0x2'));var BPromise=require('bluebird');var rp=require(_0x6883('0x3'));var fs=require('fs');var path=require(_0x6883('0x4'));var rimraf=require('rimraf');var config=require(_0x6883('0x5'));var attributes=require(_0x6883('0x6'));module[_0x6883('0x7')]=function(_0x5729a1,_0x512a4c){return _0x5729a1[_0x6883('0x8')](_0x6883('0x9'),attributes,{'tableName':_0x6883('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c70=['report_integration','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x41f879,_0x12001b){var _0x4700c6=function(_0x9013d9){while(--_0x9013d9){_0x41f879['push'](_0x41f879['shift']());}};_0x4700c6(++_0x12001b);}(_0x0c70,0x1eb));var _0x00c7=function(_0x2e1966,_0x51a6c2){_0x2e1966=_0x2e1966-0x0;var _0x1bb514=_0x0c70[_0x2e1966];return _0x1bb514;};'use strict';var _=require('lodash');var util=require(_0x00c7('0x0'));var logger=require(_0x00c7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x00c7('0x2'));var rp=require(_0x00c7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00c7('0x4'));var config=require(_0x00c7('0x5'));var attributes=require(_0x00c7('0x6'));module[_0x00c7('0x7')]=function(_0x404982,_0x499bf6){return _0x404982[_0x00c7('0x8')]('IntegrationReport',attributes,{'tableName':_0x00c7('0x9'),'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 88c6b76..419b63e 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 _0x5eb8=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x55e0f7,_0x3076b2){var _0x20e6cb=function(_0x5540f8){while(--_0x5540f8){_0x55e0f7['push'](_0x55e0f7['shift']());}};_0x20e6cb(++_0x3076b2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3b4455,_0x3e4395){_0x3b4455=_0x3b4455-0x0;var _0x34dd09=_0x5eb8[_0x3b4455];return _0x34dd09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});} \ No newline at end of file +var _0xac4a=['IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xac4a,0x13f));var _0xaac4=function(_0xdf1dd3,_0x3b33b5){_0xdf1dd3=_0xdf1dd3-0x0;var _0x144ad0=_0xac4a[_0xdf1dd3];return _0x144ad0;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('IntegrationReport,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b26ba21..b0a0da1 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 _0x34e8=['./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3b9e10,_0x115140){var _0x484168=function(_0x308c02){while(--_0x308c02){_0x3b9e10['push'](_0x3b9e10['shift']());}};_0x484168(++_0x115140);}(_0x34e8,0x12c));var _0x834e=function(_0x250064,_0x529747){_0x250064=_0x250064-0x0;var _0x1de0ad=_0x34e8[_0x250064];return _0x1de0ad;};'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')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0xe')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);router['put'](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['update']);router[_0x834e('0x14')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller[_0x834e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x55ca=['/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','create','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x55ca,0x126));var _0xa55c=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x55ca[_0x1e06f1];return _0x34f77e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0x6')]('/:id/sub_intervals',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0xd')](_0xa55c('0x10'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('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 976ed2d..76543b6 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 _0x544c=['sequelize','exports','STRING'];(function(_0x4855fa,_0x490cf3){var _0x4b7a91=function(_0x456ec7){while(--_0x456ec7){_0x4855fa['push'](_0x4855fa['shift']());}};_0x4b7a91(++_0x490cf3);}(_0x544c,0xd8));var _0xc544=function(_0x2a27de,_0x4aaa18){_0x2a27de=_0x2a27de-0x0;var _0x4335d=_0x544c[_0x2a27de];return _0x4335d;};'use strict';var Sequelize=require(_0xc544('0x0'));module[_0xc544('0x1')]={'name':{'type':Sequelize[_0xc544('0x2')]},'description':{'type':Sequelize[_0xc544('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x5c36=['sequelize','STRING'];(function(_0xad8a57,_0xd0efb5){var _0x35e788=function(_0x51da1c){while(--_0x51da1c){_0xad8a57['push'](_0xad8a57['shift']());}};_0x35e788(++_0xd0efb5);}(_0x5c36,0x1c2));var _0x65c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c36[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x65c3('0x0'));module['exports']={'name':{'type':Sequelize[_0x65c3('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x65c3('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7591c69..49b6889 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 _0x55ca=['pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addInterval','IntervalId','getIntervals','findOne','order','options','addIntervals','sequelize','transaction','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','end','sendStatus','error','name','send','Interval','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2efa64,_0x35e968){var _0x422b57=function(_0x2f5fa9){while(--_0x2f5fa9){_0x2efa64['push'](_0x2efa64['shift']());}};_0x422b57(++_0x35e968);}(_0x55ca,0x126));var _0xa55c=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0x55ca[_0x380016];return _0x5c7ac0;};'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 as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var db=require(_0xa55c('0x16'))['db'];var extensions=require(_0xa55c('0x17'));function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=_0x3ccf65[_0xa55c('0x1a')],_0x25934f=_0x4e0b2f[_0xa55c('0x1b')],_0x31e10d=_0x4e0b2f[_0xa55c('0x1b')]+_0x4e0b2f[_0xa55c('0x1c')],_0x1c4cfd;if(_0x31e10d>=_0x3dcf4f){_0x31e10d=_0x3dcf4f;_0x1c4cfd=0xc8;}else{_0x1c4cfd=0xce;}_0x247e77['status'](_0x1c4cfd);return _0x247e77[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x25934f+'-'+_0x31e10d+'/'+_0x3dcf4f)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x358b61){return function(_0x23a1ae){try{jsonpatch[_0xa55c('0x1f')](_0x23a1ae,_0x358b61,!![]);}catch(_0x4c0daf){return BPromise['reject'](_0x4c0daf);}return _0x23a1ae[_0xa55c('0x20')]();};}function saveUpdates(_0x3776ac,_0xade4c4){return function(_0x4cfe10){if(_0x4cfe10){return _0x4cfe10[_0xa55c('0x21')](_0x3776ac)[_0xa55c('0x22')](function(_0x54945a){return _0x54945a;});}return null;};}function removeEntity(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x23')]()[_0xa55c('0x22')](function(){var _0x49ed04=_0x940f28[_0xa55c('0x24')]({'plain':!![]});var _0x504c24='Intervals';return db['UserProfileResource'][_0xa55c('0x23')]({'where':{'type':_0x504c24,'resourceId':_0x49ed04['id']}})['then'](function(){return _0x940f28;});})[_0xa55c('0x22')](function(){_0x187a87[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0xf0e574,_0x2313a9){return function(_0x170ba4){if(!_0x170ba4){_0xf0e574[_0xa55c('0x26')](0x194);}return _0x170ba4;};}function handleError(_0x11e7f7,_0x192df2){_0x192df2=_0x192df2||0x1f4;return function(_0x3cd152){logger[_0xa55c('0x27')](_0x3cd152['stack']);if(_0x3cd152[_0xa55c('0x28')]){delete _0x3cd152[_0xa55c('0x28')];}_0x11e7f7[_0xa55c('0x18')](_0x192df2)[_0xa55c('0x29')](_0x3cd152);};}exports['index']=function(_0x1377b0,_0x22f6b6){var _0x1b8388={},_0x201941={},_0x45ee8d={'count':0x0,'rows':[]};var _0x3c3cb5=_['map'](db[_0xa55c('0x2a')]['rawAttributes'],function(_0x35c9c2){return{'name':_0x35c9c2[_0xa55c('0x2b')],'type':_0x35c9c2[_0xa55c('0x2c')][_0xa55c('0x2d')]};});_0x201941['model']=_[_0xa55c('0x2e')](_0x3c3cb5,_0xa55c('0x28'));_0x201941[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x1377b0[_0xa55c('0x2f')]);_0x201941[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x201941[_0xa55c('0x33')],_0x201941[_0xa55c('0x2f')]);_0x1b8388[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x201941['model'],qs['fields'](_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x1b8388['attributes']=_0x1b8388[_0xa55c('0x34')][_0xa55c('0x36')]?_0x1b8388[_0xa55c('0x34')]:_0x201941[_0xa55c('0x33')];if(!_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x37')](_0xa55c('0x38'))){_0x1b8388[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x1377b0['query']['limit']);_0x1b8388['offset']=qs[_0xa55c('0x1b')](_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x1b')]);}_0x1b8388['order']=qs[_0xa55c('0x39')](_0x1377b0['query'][_0xa55c('0x39')]);_0x1b8388['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x3a')](_0x1377b0[_0xa55c('0x2f')],_0x201941['filters']));if(_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x3b')]){_0x1b8388['where']=_[_0xa55c('0x3c')](_0x1b8388[_0xa55c('0x3d')],{'$or':_['map'](_0x3c3cb5,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2c')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x28')]]={'$like':'%'+_0x1377b0['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1b8388=_['merge']({},_0x1b8388,_0x1377b0['options']);var _0x3b3308={'where':_0x1b8388[_0xa55c('0x3d')]};return db[_0xa55c('0x2a')][_0xa55c('0x1a')](_0x3b3308)[_0xa55c('0x22')](function(_0x56d17c){_0x45ee8d[_0xa55c('0x1a')]=_0x56d17c;if(_0x1377b0[_0xa55c('0x2f')][_0xa55c('0x3e')]){_0x1b8388[_0xa55c('0x3f')]=[{'all':!![]}];}return db[_0xa55c('0x2a')][_0xa55c('0x40')](_0x1b8388);})['then'](function(_0x386e34){_0x45ee8d['rows']=_0x386e34;return _0x45ee8d;})['then'](respondWithFilteredResult(_0x22f6b6,_0x1b8388))[_0xa55c('0x41')](handleError(_0x22f6b6,null));};exports[_0xa55c('0x42')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':!![],'where':{'id':_0x496920[_0xa55c('0x43')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x33')]=_[_0xa55c('0x30')](db['Interval'][_0xa55c('0x44')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x33')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x35')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x34')]['length']?_0x508bd3[_0xa55c('0x34')]:_0x5f25f7[_0xa55c('0x33')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3f')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3c')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x2a')][_0xa55c('0x45')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x22')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x41')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x2a')][_0xa55c('0x46')](_0x46f839['body'],{})[_0xa55c('0x22')](function(_0x58a7ea){var _0x2157d6=_0x46f839[_0xa55c('0x47')][_0xa55c('0x24')]({'plain':!![]});if(!_0x2157d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2157d6[_0xa55c('0x48')]===_0xa55c('0x47')){var _0x574fe9=_0x58a7ea[_0xa55c('0x24')]({'plain':!![]});var _0x34de95=_0xa55c('0x49');return db[_0xa55c('0x4a')][_0xa55c('0x45')]({'where':{'name':_0x34de95,'userProfileId':_0x2157d6[_0xa55c('0x4b')]},'raw':!![]})[_0xa55c('0x22')](function(_0x129626){if(_0x129626&&_0x129626[_0xa55c('0x4c')]===0x0){return db[_0xa55c('0x4d')]['create']({'name':_0x574fe9[_0xa55c('0x28')],'resourceId':_0x574fe9['id'],'type':_0x129626[_0xa55c('0x28')],'sectionId':_0x129626['id']},{})[_0xa55c('0x22')](function(){return _0x58a7ea;});}else{return _0x58a7ea;}})['catch'](function(_0x4c3095){logger[_0xa55c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c3095);throw _0x4c3095;});}return _0x58a7ea;})[_0xa55c('0x22')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x21')]=function(_0x228df4,_0x181802){if(_0x228df4[_0xa55c('0x4e')]['id']){delete _0x228df4[_0xa55c('0x4e')]['id'];}return db['Interval'][_0xa55c('0x45')]({'where':{'id':_0x228df4[_0xa55c('0x43')]['id']}})['then'](handleEntityNotFound(_0x181802,null))[_0xa55c('0x22')](saveUpdates(_0x228df4[_0xa55c('0x4e')],null))[_0xa55c('0x22')](respondWithResult(_0x181802,null))[_0xa55c('0x41')](handleError(_0x181802,null));};exports['destroy']=function(_0x4def35,_0x267965){return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x4def35[_0xa55c('0x43')]['id']}})['then'](handleEntityNotFound(_0x267965,null))[_0xa55c('0x22')](removeEntity(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x4f')]=function(_0x437ced,_0x20593d,_0x2ccfb1){if(_0x437ced[_0xa55c('0x4e')]['id']){delete _0x437ced['body']['id'];}return db[_0xa55c('0x2a')]['find']({'where':{'id':_0x437ced[_0xa55c('0x43')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x20593d,null))[_0xa55c('0x22')](function(_0x1e1c5b){if(_0x1e1c5b){_0x437ced[_0xa55c('0x4e')][_0xa55c('0x50')]=_0x1e1c5b['id'];return db[_0xa55c('0x2a')]['create'](_0x437ced[_0xa55c('0x4e')]);}})[_0xa55c('0x22')](respondWithResult(_0x20593d,null))[_0xa55c('0x41')](handleError(_0x20593d,null));};exports[_0xa55c('0x51')]=function(_0x3fa00f,_0x5ba2b0,_0xa72718){var _0x3cd40d={};var _0x28bac4={};var _0x20e53c;var _0x3cbb63;return db['Interval'][_0xa55c('0x52')]({'where':{'id':_0x3fa00f[_0xa55c('0x43')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x5ba2b0,null))[_0xa55c('0x22')](function(_0x3ba56d){if(_0x3ba56d){_0x20e53c=_0x3ba56d;_0x28bac4['model']=_[_0xa55c('0x30')](db['Interval'][_0xa55c('0x44')]);_0x28bac4['query']=_[_0xa55c('0x30')](_0x3fa00f['query']);_0x28bac4[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x28bac4[_0xa55c('0x33')],_0x28bac4[_0xa55c('0x2f')]);_0x3cd40d[_0xa55c('0x34')]=_[_0xa55c('0x32')](_0x28bac4[_0xa55c('0x33')],qs[_0xa55c('0x35')](_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x35')]));_0x3cd40d['attributes']=_0x3cd40d[_0xa55c('0x34')][_0xa55c('0x36')]?_0x3cd40d['attributes']:_0x28bac4[_0xa55c('0x33')];_0x3cd40d[_0xa55c('0x53')]=qs[_0xa55c('0x39')](_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x39')]);_0x3cd40d[_0xa55c('0x3d')]=qs[_0xa55c('0x31')](_[_0xa55c('0x3a')](_0x3fa00f['query'],_0x28bac4[_0xa55c('0x31')]));if(_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x3b')]){_0x3cd40d[_0xa55c('0x3d')]=_[_0xa55c('0x3c')](_0x3cd40d[_0xa55c('0x3d')],{'$or':_[_0xa55c('0x2e')](_0x3cd40d[_0xa55c('0x34')],function(_0x25d5a1){var _0x4a08ca={};_0x4a08ca[_0x25d5a1]={'$like':'%'+_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x3b')]+'%'};return _0x4a08ca;})});}_0x3cd40d=_[_0xa55c('0x3c')]({},_0x3cd40d,_0x3fa00f[_0xa55c('0x54')]);return _0x20e53c[_0xa55c('0x51')](_0x3cd40d);}})[_0xa55c('0x22')](function(_0x3ea755){if(_0x3ea755){_0x3cbb63=_0x3ea755[_0xa55c('0x36')];if(!_0x3fa00f[_0xa55c('0x2f')][_0xa55c('0x37')](_0xa55c('0x38'))){_0x3cd40d['limit']=qs[_0xa55c('0x1c')](_0x3fa00f['query'][_0xa55c('0x1c')]);_0x3cd40d[_0xa55c('0x1b')]=qs[_0xa55c('0x1b')](_0x3fa00f['query']['offset']);}return _0x20e53c[_0xa55c('0x51')](_0x3cd40d);}})[_0xa55c('0x22')](function(_0x23c84c){if(_0x23c84c){return _0x23c84c?{'count':_0x3cbb63,'rows':_0x23c84c}:null;}})[_0xa55c('0x22')](respondWithResult(_0x5ba2b0,null))['catch'](handleError(_0x5ba2b0,null));};exports[_0xa55c('0x55')]=function(_0xd02251,_0x8ea1c6,_0x3a9910){return db[_0xa55c('0x2a')]['findOne']({'where':{'id':_0xd02251['params']['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x8ea1c6,null))[_0xa55c('0x22')](function(_0x3f9d0a){if(_0x3f9d0a){return db[_0xa55c('0x56')][_0xa55c('0x57')](function(_0x4b2032){return db[_0xa55c('0x2a')][_0xa55c('0x23')]({'where':{'IntervalId':_0xd02251['params']['id']},'transaction':_0x4b2032})[_0xa55c('0x22')](function(_0x1ab28b){var _0xa340fb=_['map'](_0xd02251[_0xa55c('0x4e')],function(_0x3ff604){delete _0x3ff604['id'];_0x3ff604[_0xa55c('0x50')]=_0xd02251[_0xa55c('0x43')]['id'];return _0x3ff604;});return db[_0xa55c('0x2a')]['bulkCreate'](_0xa340fb,{'transaction':_0x4b2032});});})[_0xa55c('0x22')](function(){return db[_0xa55c('0x2a')]['findAll']({'where':{'IntervalId':_0xd02251['params']['id']}});});}})[_0xa55c('0x22')](respondWithResult(_0x8ea1c6,null))['catch'](handleError(_0x8ea1c6,null));}; \ No newline at end of file +var _0x70e0=['findAll','rows','catch','show','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','findOne','order','hasOwnProperty','addIntervals','transaction','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','offset','limit','set','apply','update','destroy','then','get','Intervals','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','intersection','query','attributes','fields','length','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','Interval','count'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x70e0,0x17b));var _0x070e=function(_0x43c9e1,_0x3ee4f2){_0x43c9e1=_0x43c9e1-0x0;var _0xe612f7=_0x70e0[_0x43c9e1];return _0xe612f7;};'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 Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=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'];var extensions=require(_0x070e('0x16'));function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x17')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x18')](_0x4a33d2)[_0x070e('0x19')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=_0x373d86['count'],_0x180897=_0x5d3a38[_0x070e('0x1a')],_0x19d9da=_0x5d3a38[_0x070e('0x1a')]+_0x5d3a38[_0x070e('0x1b')],_0x5bc71e;if(_0x19d9da>=_0xeae1a5){_0x19d9da=_0xeae1a5;_0x5bc71e=0xc8;}else{_0x5bc71e=0xce;}_0x51d14d[_0x070e('0x18')](_0x5bc71e);return _0x51d14d[_0x070e('0x1c')]('Content-Range',_0x180897+'-'+_0x19d9da+'/'+_0xeae1a5)[_0x070e('0x19')](_0x373d86);}return null;};}function patchUpdates(_0x168dc6){return function(_0x1ad3de){try{jsonpatch[_0x070e('0x1d')](_0x1ad3de,_0x168dc6,!![]);}catch(_0x259893){return BPromise['reject'](_0x259893);}return _0x1ad3de['save']();};}function saveUpdates(_0x4e958f,_0x9907cf){return function(_0x3004f0){if(_0x3004f0){return _0x3004f0[_0x070e('0x1e')](_0x4e958f)['then'](function(_0x5b184){return _0x5b184;});}return null;};}function removeEntity(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x1f')]()[_0x070e('0x20')](function(){var _0x28a1c3=_0x3f6985[_0x070e('0x21')]({'plain':!![]});var _0xe405e=_0x070e('0x22');return db['UserProfileResource'][_0x070e('0x1f')]({'where':{'type':_0xe405e,'resourceId':_0x28a1c3['id']}})[_0x070e('0x20')](function(){return _0x3f6985;});})[_0x070e('0x20')](function(){_0x5dc5d2['status'](0xcc)[_0x070e('0x17')]();});}};}function handleEntityNotFound(_0x5f3e9d,_0x4a2dbd){return function(_0x2ccbd7){if(!_0x2ccbd7){_0x5f3e9d[_0x070e('0x23')](0x194);}return _0x2ccbd7;};}function handleError(_0x41deb1,_0x1743cc){_0x1743cc=_0x1743cc||0x1f4;return function(_0x4763c6){logger['error'](_0x4763c6[_0x070e('0x24')]);if(_0x4763c6[_0x070e('0x25')]){delete _0x4763c6[_0x070e('0x25')];}_0x41deb1[_0x070e('0x18')](_0x1743cc)[_0x070e('0x26')](_0x4763c6);};}exports[_0x070e('0x27')]=function(_0x1a1892,_0x26373b){var _0x5e8326={},_0x282344={},_0x351641={'count':0x0,'rows':[]};var _0x3a16d0=_['map'](db['Interval'][_0x070e('0x28')],function(_0x46065c){return{'name':_0x46065c[_0x070e('0x29')],'type':_0x46065c['type'][_0x070e('0x2a')]};});_0x282344[_0x070e('0x2b')]=_[_0x070e('0x2c')](_0x3a16d0,_0x070e('0x25'));_0x282344['query']=_['keys'](_0x1a1892['query']);_0x282344['filters']=_[_0x070e('0x2d')](_0x282344['model'],_0x282344[_0x070e('0x2e')]);_0x5e8326[_0x070e('0x2f')]=_['intersection'](_0x282344['model'],qs[_0x070e('0x30')](_0x1a1892[_0x070e('0x2e')]['fields']));_0x5e8326['attributes']=_0x5e8326[_0x070e('0x2f')][_0x070e('0x31')]?_0x5e8326[_0x070e('0x2f')]:_0x282344[_0x070e('0x2b')];if(!_0x1a1892[_0x070e('0x2e')]['hasOwnProperty']('nolimit')){_0x5e8326[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1b')]);_0x5e8326[_0x070e('0x1a')]=qs['offset'](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1a')]);}_0x5e8326['order']=qs[_0x070e('0x32')](_0x1a1892[_0x070e('0x2e')]['sort']);_0x5e8326['where']=qs['filters'](_[_0x070e('0x33')](_0x1a1892[_0x070e('0x2e')],_0x282344[_0x070e('0x34')]));if(_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]){_0x5e8326['where']=_[_0x070e('0x36')](_0x5e8326[_0x070e('0x37')],{'$or':_[_0x070e('0x2c')](_0x3a16d0,function(_0x487276){if(_0x487276[_0x070e('0x38')]!==_0x070e('0x39')){var _0x165c16={};_0x165c16[_0x487276['name']]={'$like':'%'+_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x165c16;}})});}_0x5e8326=_['merge']({},_0x5e8326,_0x1a1892[_0x070e('0x3a')]);var _0x5d689b={'where':_0x5e8326[_0x070e('0x37')]};return db[_0x070e('0x3b')][_0x070e('0x3c')](_0x5d689b)[_0x070e('0x20')](function(_0xd03404){_0x351641['count']=_0xd03404;if(_0x1a1892[_0x070e('0x2e')]['includeAll']){_0x5e8326['include']=[{'all':!![]}];}return db[_0x070e('0x3b')][_0x070e('0x3d')](_0x5e8326);})[_0x070e('0x20')](function(_0x4d52ff){_0x351641[_0x070e('0x3e')]=_0x4d52ff;return _0x351641;})[_0x070e('0x20')](respondWithFilteredResult(_0x26373b,_0x5e8326))[_0x070e('0x3f')](handleError(_0x26373b,null));};exports[_0x070e('0x40')]=function(_0x4a4ee3,_0x13e4e0){var _0x5851ab={'raw':!![],'where':{'id':_0x4a4ee3['params']['id']}},_0x544b53={};_0x544b53[_0x070e('0x2b')]=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x544b53[_0x070e('0x2e')]=_['keys'](_0x4a4ee3[_0x070e('0x2e')]);_0x544b53['filters']=_[_0x070e('0x2d')](_0x544b53[_0x070e('0x2b')],_0x544b53[_0x070e('0x2e')]);_0x5851ab['attributes']=_['intersection'](_0x544b53[_0x070e('0x2b')],qs['fields'](_0x4a4ee3[_0x070e('0x2e')][_0x070e('0x30')]));_0x5851ab[_0x070e('0x2f')]=_0x5851ab['attributes'][_0x070e('0x31')]?_0x5851ab[_0x070e('0x2f')]:_0x544b53['model'];if(_0x4a4ee3['query'][_0x070e('0x42')]){_0x5851ab[_0x070e('0x43')]=[{'all':!![]}];}_0x5851ab=_[_0x070e('0x36')]({},_0x5851ab,_0x4a4ee3[_0x070e('0x3a')]);return db[_0x070e('0x3b')]['find'](_0x5851ab)[_0x070e('0x20')](handleEntityNotFound(_0x13e4e0,null))[_0x070e('0x20')](respondWithResult(_0x13e4e0,null))[_0x070e('0x3f')](handleError(_0x13e4e0,null));};exports[_0x070e('0x44')]=function(_0x79eaa0,_0xcd1c61){return db[_0x070e('0x3b')][_0x070e('0x44')](_0x79eaa0[_0x070e('0x45')],{})[_0x070e('0x20')](function(_0x210c4d){var _0x3be553=_0x79eaa0[_0x070e('0x46')][_0x070e('0x21')]({'plain':!![]});if(!_0x3be553)throw new Error(_0x070e('0x47'));if(_0x3be553['role']===_0x070e('0x46')){var _0xa7a41b=_0x210c4d[_0x070e('0x21')]({'plain':!![]});var _0x249e3f=_0x070e('0x22');return db[_0x070e('0x48')][_0x070e('0x49')]({'where':{'name':_0x249e3f,'userProfileId':_0x3be553[_0x070e('0x4a')]},'raw':!![]})[_0x070e('0x20')](function(_0x5744c5){if(_0x5744c5&&_0x5744c5[_0x070e('0x4b')]===0x0){return db['UserProfileResource'][_0x070e('0x44')]({'name':_0xa7a41b[_0x070e('0x25')],'resourceId':_0xa7a41b['id'],'type':_0x5744c5['name'],'sectionId':_0x5744c5['id']},{})[_0x070e('0x20')](function(){return _0x210c4d;});}else{return _0x210c4d;}})[_0x070e('0x3f')](function(_0x25466f){logger[_0x070e('0x4c')](_0x070e('0x4d'),_0x25466f);throw _0x25466f;});}return _0x210c4d;})[_0x070e('0x20')](respondWithResult(_0xcd1c61,0xc9))[_0x070e('0x3f')](handleError(_0xcd1c61,null));};exports['update']=function(_0x296978,_0x5bacbd){if(_0x296978['body']['id']){delete _0x296978[_0x070e('0x45')]['id'];}return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x296978[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x5bacbd,null))[_0x070e('0x20')](saveUpdates(_0x296978[_0x070e('0x45')],null))[_0x070e('0x20')](respondWithResult(_0x5bacbd,null))['catch'](handleError(_0x5bacbd,null));};exports[_0x070e('0x1f')]=function(_0x51d27d,_0x564d82){return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x51d27d['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x564d82,null))[_0x070e('0x20')](removeEntity(_0x564d82,null))[_0x070e('0x3f')](handleError(_0x564d82,null));};exports[_0x070e('0x4f')]=function(_0x1aacfc,_0x382ce3,_0x1b36cd){if(_0x1aacfc['body']['id']){delete _0x1aacfc['body']['id'];}return db['Interval'][_0x070e('0x49')]({'where':{'id':_0x1aacfc[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x382ce3,null))[_0x070e('0x20')](function(_0x5ac0b5){if(_0x5ac0b5){_0x1aacfc[_0x070e('0x45')]['IntervalId']=_0x5ac0b5['id'];return db[_0x070e('0x3b')][_0x070e('0x44')](_0x1aacfc[_0x070e('0x45')]);}})[_0x070e('0x20')](respondWithResult(_0x382ce3,null))[_0x070e('0x3f')](handleError(_0x382ce3,null));};exports[_0x070e('0x50')]=function(_0x5561ed,_0x20ff87,_0x18e8d0){var _0x8aaf00={};var _0x533431={};var _0x1d7873;var _0x1da803;return db['Interval'][_0x070e('0x51')]({'where':{'id':_0x5561ed['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x20ff87,null))['then'](function(_0x4cb86f){if(_0x4cb86f){_0x1d7873=_0x4cb86f;_0x533431['model']=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x533431[_0x070e('0x2e')]=_[_0x070e('0x41')](_0x5561ed[_0x070e('0x2e')]);_0x533431['filters']=_[_0x070e('0x2d')](_0x533431['model'],_0x533431[_0x070e('0x2e')]);_0x8aaf00['attributes']=_[_0x070e('0x2d')](_0x533431[_0x070e('0x2b')],qs['fields'](_0x5561ed[_0x070e('0x2e')]['fields']));_0x8aaf00[_0x070e('0x2f')]=_0x8aaf00[_0x070e('0x2f')][_0x070e('0x31')]?_0x8aaf00[_0x070e('0x2f')]:_0x533431[_0x070e('0x2b')];_0x8aaf00[_0x070e('0x52')]=qs[_0x070e('0x32')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x32')]);_0x8aaf00[_0x070e('0x37')]=qs[_0x070e('0x34')](_[_0x070e('0x33')](_0x5561ed[_0x070e('0x2e')],_0x533431[_0x070e('0x34')]));if(_0x5561ed['query'][_0x070e('0x35')]){_0x8aaf00[_0x070e('0x37')]=_[_0x070e('0x36')](_0x8aaf00[_0x070e('0x37')],{'$or':_['map'](_0x8aaf00[_0x070e('0x2f')],function(_0x4e8e58){var _0x398f54={};_0x398f54[_0x4e8e58]={'$like':'%'+_0x5561ed[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x398f54;})});}_0x8aaf00=_[_0x070e('0x36')]({},_0x8aaf00,_0x5561ed['options']);return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x240ec9){if(_0x240ec9){_0x1da803=_0x240ec9[_0x070e('0x31')];if(!_0x5561ed['query'][_0x070e('0x53')]('nolimit')){_0x8aaf00[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1b')]);_0x8aaf00[_0x070e('0x1a')]=qs['offset'](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1a')]);}return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x5591dd){if(_0x5591dd){return _0x5591dd?{'count':_0x1da803,'rows':_0x5591dd}:null;}})[_0x070e('0x20')](respondWithResult(_0x20ff87,null))['catch'](handleError(_0x20ff87,null));};exports[_0x070e('0x54')]=function(_0x44e465,_0x1214d2,_0x57585e){return db[_0x070e('0x3b')]['findOne']({'where':{'id':_0x44e465[_0x070e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1214d2,null))[_0x070e('0x20')](function(_0x17b28c){if(_0x17b28c){return db['sequelize'][_0x070e('0x55')](function(_0x53f9a8){return db[_0x070e('0x3b')][_0x070e('0x1f')]({'where':{'IntervalId':_0x44e465['params']['id']},'transaction':_0x53f9a8})['then'](function(_0x29ee66){var _0x3022cd=_[_0x070e('0x2c')](_0x44e465[_0x070e('0x45')],function(_0x25f1d0){delete _0x25f1d0['id'];_0x25f1d0[_0x070e('0x56')]=_0x44e465[_0x070e('0x4e')]['id'];return _0x25f1d0;});return db[_0x070e('0x3b')][_0x070e('0x57')](_0x3022cd,{'transaction':_0x53f9a8});});})[_0x070e('0x20')](function(){return db[_0x070e('0x3b')][_0x070e('0x3d')]({'where':{'IntervalId':_0x44e465[_0x070e('0x4e')]['id']}});});}})['then'](respondWithResult(_0x1214d2,null))[_0x070e('0x3f')](handleError(_0x1214d2,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 4fa0ad7..59ca0f2 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 _0x038d=['./interval.attributes','define','tools_intervals','rewrite','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1c0781,_0x4a19f1){var _0x1f577e=function(_0x396577){while(--_0x396577){_0x1c0781['push'](_0x1c0781['shift']());}};_0x1f577e(++_0x4a19f1);}(_0x038d,0xae));var _0xd038=function(_0x42325a,_0x16b786){_0x42325a=_0x42325a-0x0;var _0x3dc60d=_0x038d[_0x42325a];return _0x3dc60d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd038('0x0'))(_0xd038('0x1'));var moment=require(_0xd038('0x2'));var BPromise=require(_0xd038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd038('0x4'));var config=require(_0xd038('0x5'));var attributes=require(_0xd038('0x6'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x5d549e,_0x457b2f){return _0x5d549e[_0xd038('0x7')]('Interval',attributes,{'tableName':_0xd038('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd847cf,_0x4db8b3){extensions[_0xd038('0x9')](_0x5d549e,_0xd847cf);},'afterBulkCreate':function(_0x23703d,_0x274b19,_0x45998c){_0x45998c();extensions['rewrite'](_0x5d549e,_0x23703d[0x0]);},'afterUpdate':function(_0x4cf965,_0x8e0569){extensions[_0xd038('0x9')](_0x5d549e,_0x4cf965);},'afterDestroy':function(_0x595934,_0x30c21f){extensions[_0xd038('0x9')](_0x5d549e,_0x595934);}}});}; \ No newline at end of file +var _0x8aef=['Interval','tools_intervals','rewrite','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./interval.attributes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8aef,0x189));var _0xf8ae=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x8aef[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xf8ae('0x0'));var util=require('util');var logger=require(_0xf8ae('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf8ae('0x2'));var fs=require('fs');var path=require(_0xf8ae('0x3'));var rimraf=require(_0xf8ae('0x4'));var config=require(_0xf8ae('0x5'));var attributes=require(_0xf8ae('0x6'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x4f8e7a,_0x87c6e5){return _0x4f8e7a['define'](_0xf8ae('0x7'),attributes,{'tableName':_0xf8ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x741527,_0x37bf4d){extensions['rewrite'](_0x4f8e7a,_0x741527);},'afterBulkCreate':function(_0x457dea,_0x3ca405,_0x32ae24){_0x32ae24();extensions['rewrite'](_0x4f8e7a,_0x457dea[0x0]);},'afterUpdate':function(_0x53683d,_0x59e3df){extensions[_0xf8ae('0x9')](_0x4f8e7a,_0x53683d);},'afterDestroy':function(_0xf57ceb,_0x3609f7){extensions[_0xf8ae('0x9')](_0x4f8e7a,_0xf57ceb);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c4ee62e..f9376b2 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 _0x5fe4=['request\x20sent','error','message','result','catch','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowInterval','find','util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','debug'];(function(_0x45c4ec,_0x4702c1){var _0x553e97=function(_0x3b9bbc){while(--_0x3b9bbc){_0x45c4ec['push'](_0x45c4ec['shift']());}};_0x553e97(++_0x4702c1);}(_0x5fe4,0xd3));var _0x45fe=function(_0x40a0e5,_0x57e428){_0x40a0e5=_0x40a0e5-0x0;var _0x2db48a=_0x5fe4[_0x40a0e5];return _0x2db48a;};'use strict';var _=require('lodash');var util=require(_0x45fe('0x0'));var moment=require(_0x45fe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45fe('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x45fe('0x3'))(_0x45fe('0x4'));var config=require('../../config/environment');var jayson=require(_0x45fe('0x5'));var client=jayson[_0x45fe('0x6')][_0x45fe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4c37,_0x256196,_0x378411){return new BPromise(function(_0x1fe87e,_0x633ff1){return client[_0x45fe('0x8')](_0x2f4c37,_0x378411)[_0x45fe('0x9')](function(_0x41e716){logger[_0x45fe('0xa')](_0x45fe('0xb'),_0x256196,'request\x20sent');logger[_0x45fe('0xc')]('Interval,\x20%s,\x20%s,\x20%s',_0x256196,_0x45fe('0xd'),JSON['stringify'](_0x41e716));if(_0x41e716[_0x45fe('0xe')]){if(_0x41e716[_0x45fe('0xe')]['code']===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x256196,_0x41e716[_0x45fe('0xe')][_0x45fe('0xf')]);return _0x633ff1(_0x41e716[_0x45fe('0xe')]['message']);}logger[_0x45fe('0xe')](_0x45fe('0xb'),_0x256196,_0x41e716[_0x45fe('0xe')][_0x45fe('0xf')]);return _0x1fe87e(_0x41e716[_0x45fe('0xe')]['message']);}else{logger[_0x45fe('0xa')](_0x45fe('0xb'),_0x256196,'request\x20sent');_0x1fe87e(_0x41e716[_0x45fe('0x10')]['message']);}})[_0x45fe('0x11')](function(_0x433901){logger[_0x45fe('0xe')]('Interval,\x20%s,\x20%s',_0x256196,_0x433901);_0x633ff1(_0x433901);});});}exports[_0x45fe('0x12')]=function(_0x50306c){var _0x48f859=this;return new Promise(function(_0x316092,_0x45e826){return db[_0x45fe('0x13')][_0x45fe('0x14')]({'raw':_0x50306c[_0x45fe('0x15')]?_0x50306c['options'][_0x45fe('0x16')]===undefined?!![]:![]:!![],'where':_0x50306c[_0x45fe('0x15')]?_0x50306c[_0x45fe('0x15')][_0x45fe('0x17')]||null:null,'attributes':_0x50306c[_0x45fe('0x15')]?_0x50306c[_0x45fe('0x15')][_0x45fe('0x18')]||null:null,'limit':_0x50306c[_0x45fe('0x15')]?_0x50306c[_0x45fe('0x15')][_0x45fe('0x19')]||null:null,'include':_0x50306c[_0x45fe('0x15')]?_0x50306c[_0x45fe('0x15')][_0x45fe('0x1a')]?_[_0x45fe('0x1b')](_0x50306c[_0x45fe('0x15')][_0x45fe('0x1a')],function(_0x43f136){return{'model':db[_0x43f136[_0x45fe('0x1c')]],'as':_0x43f136['as'],'attributes':_0x43f136[_0x45fe('0x18')],'include':_0x43f136[_0x45fe('0x1a')]?_[_0x45fe('0x1b')](_0x43f136[_0x45fe('0x1a')],function(_0x3033eb){return{'model':db[_0x3033eb[_0x45fe('0x1c')]],'as':_0x3033eb['as'],'attributes':_0x3033eb[_0x45fe('0x18')],'include':_0x3033eb[_0x45fe('0x1a')]?_[_0x45fe('0x1b')](_0x3033eb[_0x45fe('0x1a')],function(_0x5f26ec){return{'model':db[_0x5f26ec['model']],'as':_0x5f26ec['as'],'attributes':_0x5f26ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x45fe('0x9')](function(_0x3c157b){logger[_0x45fe('0xa')](_0x45fe('0x12'),_0x50306c);logger[_0x45fe('0xc')](_0x45fe('0x12'),_0x50306c,JSON[_0x45fe('0x1d')](_0x3c157b));_0x316092(_0x3c157b);})[_0x45fe('0x11')](function(_0x3de8d9){logger['error'](_0x45fe('0x12'),_0x3de8d9[_0x45fe('0xf')],_0x50306c);_0x45e826(_0x48f859[_0x45fe('0xe')](0x1f4,_0x3de8d9[_0x45fe('0xf')]));});});};exports[_0x45fe('0x1e')]=function(_0x588660){var _0x26f081=this;return new Promise(function(_0x503565,_0x512b3e){return db[_0x45fe('0x13')][_0x45fe('0x1f')]({'raw':_0x588660[_0x45fe('0x15')]?_0x588660[_0x45fe('0x15')][_0x45fe('0x16')]===undefined?!![]:![]:!![],'where':_0x588660[_0x45fe('0x15')]?_0x588660[_0x45fe('0x15')]['where']||null:null,'attributes':_0x588660[_0x45fe('0x15')]?_0x588660[_0x45fe('0x15')][_0x45fe('0x18')]||null:null,'include':_0x588660[_0x45fe('0x15')]?_0x588660['options'][_0x45fe('0x1a')]?_[_0x45fe('0x1b')](_0x588660[_0x45fe('0x15')]['include'],function(_0x143589){return{'model':db[_0x143589[_0x45fe('0x1c')]],'as':_0x143589['as'],'attributes':_0x143589[_0x45fe('0x18')],'include':_0x143589[_0x45fe('0x1a')]?_[_0x45fe('0x1b')](_0x143589[_0x45fe('0x1a')],function(_0x44ce29){return{'model':db[_0x44ce29[_0x45fe('0x1c')]],'as':_0x44ce29['as'],'attributes':_0x44ce29[_0x45fe('0x18')],'include':_0x44ce29[_0x45fe('0x1a')]?_[_0x45fe('0x1b')](_0x44ce29[_0x45fe('0x1a')],function(_0x47d6a8){return{'model':db[_0x47d6a8['model']],'as':_0x47d6a8['as'],'attributes':_0x47d6a8[_0x45fe('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3df96b){logger['info'](_0x45fe('0x1e'),_0x588660);logger[_0x45fe('0xc')](_0x45fe('0x1e'),_0x588660,JSON['stringify'](_0x3df96b));_0x503565(_0x3df96b);})[_0x45fe('0x11')](function(_0x292913){logger[_0x45fe('0xe')]('ShowInterval',_0x292913[_0x45fe('0xf')],_0x588660);_0x512b3e(_0x26f081['error'](0x1f4,_0x292913['message']));});});}; \ No newline at end of file +var _0xa547=['error','code','message','request\x20sent','catch','Interval','findAll','options','raw','where','attributes','limit','include','model','map','GetInterval','find','ShowInterval','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Interval,\x20%s,\x20%s','debug','stringify'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xa547,0x1bf));var _0x7a54=function(_0x5a2a15,_0x14dbd7){_0x5a2a15=_0x5a2a15-0x0;var _0x1b3dcd=_0xa547[_0x5a2a15];return _0x1b3dcd;};'use strict';var _=require(_0x7a54('0x0'));var util=require('util');var moment=require(_0x7a54('0x1'));var BPromise=require(_0x7a54('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a54('0x3'));var db=require(_0x7a54('0x4'))['db'];var utils=require(_0x7a54('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7a54('0x6'));var jayson=require(_0x7a54('0x7'));var client=jayson[_0x7a54('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee205,_0x5e0423,_0x1e43a4){return new BPromise(function(_0x2cf4af,_0x2a3aec){return client[_0x7a54('0x9')](_0x5ee205,_0x1e43a4)[_0x7a54('0xa')](function(_0x2b6cf2){logger[_0x7a54('0xb')](_0x7a54('0xc'),_0x5e0423,'request\x20sent');logger[_0x7a54('0xd')]('Interval,\x20%s,\x20%s,\x20%s',_0x5e0423,'request\x20sent',JSON[_0x7a54('0xe')](_0x2b6cf2));if(_0x2b6cf2['error']){if(_0x2b6cf2[_0x7a54('0xf')][_0x7a54('0x10')]===0x1f4){logger[_0x7a54('0xf')](_0x7a54('0xc'),_0x5e0423,_0x2b6cf2[_0x7a54('0xf')][_0x7a54('0x11')]);return _0x2a3aec(_0x2b6cf2[_0x7a54('0xf')][_0x7a54('0x11')]);}logger[_0x7a54('0xf')]('Interval,\x20%s,\x20%s',_0x5e0423,_0x2b6cf2[_0x7a54('0xf')]['message']);return _0x2cf4af(_0x2b6cf2[_0x7a54('0xf')][_0x7a54('0x11')]);}else{logger['info'](_0x7a54('0xc'),_0x5e0423,_0x7a54('0x12'));_0x2cf4af(_0x2b6cf2['result'][_0x7a54('0x11')]);}})[_0x7a54('0x13')](function(_0x5d4ae3){logger[_0x7a54('0xf')](_0x7a54('0xc'),_0x5e0423,_0x5d4ae3);_0x2a3aec(_0x5d4ae3);});});}exports['GetInterval']=function(_0x12f6d9){var _0x280571=this;return new Promise(function(_0x3bf353,_0x3a3641){return db[_0x7a54('0x14')][_0x7a54('0x15')]({'raw':_0x12f6d9[_0x7a54('0x16')]?_0x12f6d9['options'][_0x7a54('0x17')]===undefined?!![]:![]:!![],'where':_0x12f6d9['options']?_0x12f6d9[_0x7a54('0x16')][_0x7a54('0x18')]||null:null,'attributes':_0x12f6d9[_0x7a54('0x16')]?_0x12f6d9[_0x7a54('0x16')][_0x7a54('0x19')]||null:null,'limit':_0x12f6d9[_0x7a54('0x16')]?_0x12f6d9['options'][_0x7a54('0x1a')]||null:null,'include':_0x12f6d9['options']?_0x12f6d9[_0x7a54('0x16')]['include']?_['map'](_0x12f6d9[_0x7a54('0x16')][_0x7a54('0x1b')],function(_0x5b3a4f){return{'model':db[_0x5b3a4f[_0x7a54('0x1c')]],'as':_0x5b3a4f['as'],'attributes':_0x5b3a4f['attributes'],'include':_0x5b3a4f[_0x7a54('0x1b')]?_[_0x7a54('0x1d')](_0x5b3a4f[_0x7a54('0x1b')],function(_0x4edb7b){return{'model':db[_0x4edb7b[_0x7a54('0x1c')]],'as':_0x4edb7b['as'],'attributes':_0x4edb7b[_0x7a54('0x19')],'include':_0x4edb7b['include']?_[_0x7a54('0x1d')](_0x4edb7b[_0x7a54('0x1b')],function(_0x498d32){return{'model':db[_0x498d32['model']],'as':_0x498d32['as'],'attributes':_0x498d32[_0x7a54('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7a54('0xa')](function(_0x3e5999){logger[_0x7a54('0xb')](_0x7a54('0x1e'),_0x12f6d9);logger[_0x7a54('0xd')](_0x7a54('0x1e'),_0x12f6d9,JSON[_0x7a54('0xe')](_0x3e5999));_0x3bf353(_0x3e5999);})[_0x7a54('0x13')](function(_0x352f78){logger[_0x7a54('0xf')](_0x7a54('0x1e'),_0x352f78[_0x7a54('0x11')],_0x12f6d9);_0x3a3641(_0x280571['error'](0x1f4,_0x352f78[_0x7a54('0x11')]));});});};exports['ShowInterval']=function(_0x389342){var _0x4294a0=this;return new Promise(function(_0x39403a,_0x30a9f6){return db[_0x7a54('0x14')][_0x7a54('0x1f')]({'raw':_0x389342['options']?_0x389342[_0x7a54('0x16')][_0x7a54('0x17')]===undefined?!![]:![]:!![],'where':_0x389342['options']?_0x389342[_0x7a54('0x16')][_0x7a54('0x18')]||null:null,'attributes':_0x389342[_0x7a54('0x16')]?_0x389342['options'][_0x7a54('0x19')]||null:null,'include':_0x389342[_0x7a54('0x16')]?_0x389342[_0x7a54('0x16')]['include']?_[_0x7a54('0x1d')](_0x389342[_0x7a54('0x16')]['include'],function(_0x23fc3e){return{'model':db[_0x23fc3e[_0x7a54('0x1c')]],'as':_0x23fc3e['as'],'attributes':_0x23fc3e['attributes'],'include':_0x23fc3e['include']?_[_0x7a54('0x1d')](_0x23fc3e['include'],function(_0xb4ece5){return{'model':db[_0xb4ece5[_0x7a54('0x1c')]],'as':_0xb4ece5['as'],'attributes':_0xb4ece5['attributes'],'include':_0xb4ece5[_0x7a54('0x1b')]?_['map'](_0xb4ece5[_0x7a54('0x1b')],function(_0x89c74){return{'model':db[_0x89c74[_0x7a54('0x1c')]],'as':_0x89c74['as'],'attributes':_0x89c74['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a54('0xa')](function(_0x24ae84){logger['info'](_0x7a54('0x20'),_0x389342);logger[_0x7a54('0xd')](_0x7a54('0x20'),_0x389342,JSON[_0x7a54('0xe')](_0x24ae84));_0x39403a(_0x24ae84);})[_0x7a54('0x13')](function(_0x3f43fa){logger['error'](_0x7a54('0x20'),_0x3f43fa[_0x7a54('0x11')],_0x389342);_0x30a9f6(_0x4294a0[_0x7a54('0xf')](0x1f4,_0x3f43fa[_0x7a54('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 312bccd..66f8831 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 _0x48db=['../../components/auth/service','./jira.controller','send','exports','express','Router'];(function(_0x5a05ff,_0x2ffd5a){var _0x214e9f=function(_0x317aa7){while(--_0x317aa7){_0x5a05ff['push'](_0x5a05ff['shift']());}};_0x214e9f(++_0x2ffd5a);}(_0x48db,0x1e4));var _0xb48d=function(_0x3a696b,_0x39cc69){_0x3a696b=_0x3a696b-0x0;var _0x70218d=_0x48db[_0x3a696b];return _0x70218d;};'use strict';var express=require(_0xb48d('0x0'));var router=express[_0xb48d('0x1')]();var auth=require(_0xb48d('0x2'));var controller=require(_0xb48d('0x3'));router['post']('/',auth['isAuthenticated'](),controller[_0xb48d('0x4')]);module[_0xb48d('0x5')]=router; \ No newline at end of file +var _0x0700=['post','isAuthenticated','send','express','Router','../../components/auth/service','./jira.controller'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0x0700,0x81));var _0x0070=function(_0x2eccbf,_0x5a5060){_0x2eccbf=_0x2eccbf-0x0;var _0x510572=_0x0700[_0x2eccbf];return _0x510572;};'use strict';var express=require(_0x0070('0x0'));var router=express[_0x0070('0x1')]();var auth=require(_0x0070('0x2'));var controller=require(_0x0070('0x3'));router[_0x0070('0x4')]('/',auth[_0x0070('0x5')](),controller[_0x0070('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index ca3adf2..14d15e1 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 _0x51d2=['remoteAddress','socket','connection','bluebird','https','api','support','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','utf8','end','status','statusCode','json','error','api.jira','write','openIssue','body','headers','x-forwarded-for'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x51d2,0x1a7));var _0x251d=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0x51d2[_0x4e0359];return _0x450f0a;};'use strict';var BPromise=require(_0x251d('0x0'));var https=require(_0x251d('0x1'));var logger=require('../../config/logger')(_0x251d('0x2'));var USERNAME=_0x251d('0x3');var PASSWORD=_0x251d('0x4');function openIssue(_0x37044a,_0x110956){var _0x475f87={'fields':{'project':{'key':_0x37044a['key']||_0x251d('0x5')},'summary':(_0x37044a[_0x251d('0x6')]||'Report')+_0x251d('0x7')+_0x37044a['ip'],'description':_0x37044a[_0x251d('0x8')]||JSON[_0x251d('0x9')](_0x37044a),'issuetype':{'name':_0x37044a[_0x251d('0xa')]||'Bug'}}};_0x475f87[_0x251d('0xb')][_0x251d('0xc')]=_0x37044a['email'];_0x475f87[_0x251d('0xb')][_0x251d('0xd')]=_0x37044a['oldToken'];_0x475f87[_0x251d('0xb')][_0x251d('0xe')]=_0x37044a[_0x251d('0xf')];_0x475f87[_0x251d('0xb')]['customfield_11503']=_0x37044a[_0x251d('0x10')];_0x475f87['fields'][_0x251d('0x11')]=_0x37044a[_0x251d('0x12')];_0x475f87[_0x251d('0xb')][_0x251d('0x13')]=_0x37044a['ip'];var _0x37482d={'host':_0x251d('0x14'),'port':0x1bb,'path':_0x251d('0x15'),'method':_0x251d('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x251d('0x17'),'Authorization':_0x251d('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x251d('0x19')](_0x251d('0x1a'))}};var _0x107c84=JSON[_0x251d('0x9')](_0x475f87);var _0x525a7b=https['request'](_0x37482d,function(_0x4850a2){_0x4850a2['setEncoding'](_0x251d('0x1b'));var _0x14f0e9='';_0x4850a2['on']('data',function(_0x55bdb5){_0x14f0e9+=_0x55bdb5;});_0x4850a2['on'](_0x251d('0x1c'),function(){if(_0x110956){return _0x110956[_0x251d('0x1d')](_0x4850a2[_0x251d('0x1e')])[_0x251d('0x1f')](JSON['parse'](_0x14f0e9));}});});_0x525a7b['on'](_0x251d('0x20'),function(_0x2b3a98){if(_0x110956){return _0x110956[_0x251d('0x1d')](0x1f4)[_0x251d('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x251d('0x21')}]});}});_0x525a7b[_0x251d('0x22')](_0x107c84);_0x525a7b[_0x251d('0x1c')]();}exports[_0x251d('0x23')]=openIssue;exports['send']=function(_0x638b6e,_0x14ae8f){_0x638b6e[_0x251d('0x24')]['ip']=_0x638b6e[_0x251d('0x25')][_0x251d('0x26')]||_0x638b6e['connection'][_0x251d('0x27')]||_0x638b6e[_0x251d('0x28')][_0x251d('0x27')]||_0x638b6e[_0x251d('0x29')][_0x251d('0x28')][_0x251d('0x27')];return openIssue(_0x638b6e[_0x251d('0x24')],_0x14ae8f);}; \ No newline at end of file +var _0x237a=['POST','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','oldToken','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x237a,0x6d));var _0xa237=function(_0x3b63ba,_0x43c3b7){_0x3b63ba=_0x3b63ba-0x0;var _0x3b6e6c=_0x237a[_0x3b63ba];return _0x3b6e6c;};'use strict';var BPromise=require(_0xa237('0x0'));var https=require(_0xa237('0x1'));var logger=require('../../config/logger')(_0xa237('0x2'));var USERNAME=_0xa237('0x3');var PASSWORD=_0xa237('0x4');function openIssue(_0x5aad87,_0x40978e){var _0x5c5194={'fields':{'project':{'key':_0x5aad87[_0xa237('0x5')]||_0xa237('0x6')},'summary':(_0x5aad87[_0xa237('0x7')]||_0xa237('0x8'))+_0xa237('0x9')+_0x5aad87['ip'],'description':_0x5aad87[_0xa237('0xa')]||JSON[_0xa237('0xb')](_0x5aad87),'issuetype':{'name':_0x5aad87['issuetype']||_0xa237('0xc')}}};_0x5c5194[_0xa237('0xd')][_0xa237('0xe')]=_0x5aad87[_0xa237('0xf')];_0x5c5194[_0xa237('0xd')]['customfield_11501']=_0x5aad87[_0xa237('0x10')];_0x5c5194[_0xa237('0xd')]['customfield_11502']=_0x5aad87[_0xa237('0x11')];_0x5c5194[_0xa237('0xd')]['customfield_11503']=_0x5aad87[_0xa237('0x12')];_0x5c5194[_0xa237('0xd')][_0xa237('0x13')]=_0x5aad87[_0xa237('0x14')];_0x5c5194[_0xa237('0xd')][_0xa237('0x15')]=_0x5aad87['ip'];var _0x3eb30c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xa237('0x16'),'method':_0xa237('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xa237('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xa237('0x19')](_0xa237('0x1a'))}};var _0x5753ac=JSON['stringify'](_0x5c5194);var _0x3efdb2=https[_0xa237('0x1b')](_0x3eb30c,function(_0x1732f1){_0x1732f1[_0xa237('0x1c')](_0xa237('0x1d'));var _0x5ca7cf='';_0x1732f1['on'](_0xa237('0x1e'),function(_0xd2c597){_0x5ca7cf+=_0xd2c597;});_0x1732f1['on'](_0xa237('0x1f'),function(){if(_0x40978e){return _0x40978e['status'](_0x1732f1[_0xa237('0x20')])[_0xa237('0x21')](JSON[_0xa237('0x22')](_0x5ca7cf));}});});_0x3efdb2['on']('error',function(_0x345d3e){if(_0x40978e){return _0x40978e['status'](0x1f4)[_0xa237('0x21')]({'errors':[{'message':_0xa237('0x23'),'type':'api.jira'}]});}});_0x3efdb2['write'](_0x5753ac);_0x3efdb2[_0xa237('0x1f')]();}exports[_0xa237('0x24')]=openIssue;exports[_0xa237('0x25')]=function(_0x213c33,_0x21927a){_0x213c33[_0xa237('0x26')]['ip']=_0x213c33[_0xa237('0x27')][_0xa237('0x28')]||_0x213c33['connection'][_0xa237('0x29')]||_0x213c33[_0xa237('0x2a')][_0xa237('0x29')]||_0x213c33[_0xa237('0x2b')][_0xa237('0x2a')]['remoteAddress'];return openIssue(_0x213c33['body'],_0x21927a);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f5bb41f..842b39a 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 _0xdcef=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x389fe0,_0x1fc58b){var _0x4acba4=function(_0x50c49b){while(--_0x50c49b){_0x389fe0['push'](_0x389fe0['shift']());}};_0x4acba4(++_0x1fc58b);}(_0xdcef,0x1ce));var _0xfdce=function(_0x1735ba,_0x399009){_0x1735ba=_0x1735ba-0x0;var _0x36eebd=_0xdcef[_0x1735ba];return _0x36eebd;};'use strict';var multer=require(_0xfdce('0x0'));var util=require(_0xfdce('0x1'));var path=require('path');var timeout=require(_0xfdce('0x2'));var express=require(_0xfdce('0x3'));var router=express['Router']();var auth=require(_0xfdce('0x4'));var interaction=require(_0xfdce('0x5'));var config=require(_0xfdce('0x6'));var controller=require(_0xfdce('0x7'));router[_0xfdce('0x8')]('/',auth[_0xfdce('0x9')](),controller[_0xfdce('0xa')]);router[_0xfdce('0x8')](_0xfdce('0xb'),auth['isAuthenticated'](),controller[_0xfdce('0xc')]);router[_0xfdce('0x8')](_0xfdce('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xfdce('0xe')]('/',auth[_0xfdce('0x9')](),controller[_0xfdce('0xf')]);router[_0xfdce('0x10')](_0xfdce('0xd'),auth[_0xfdce('0x9')](),controller[_0xfdce('0x11')]);router[_0xfdce('0x12')](_0xfdce('0xd'),auth[_0xfdce('0x9')](),controller[_0xfdce('0x13')]);module[_0xfdce('0x14')]=router; \ No newline at end of file +var _0x8cb9=['update','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','index','get','/describe','isAuthenticated','show','post','create','put','/:id'];(function(_0x10a986,_0x39afd3){var _0x248294=function(_0x4f8f9f){while(--_0x4f8f9f){_0x10a986['push'](_0x10a986['shift']());}};_0x248294(++_0x39afd3);}(_0x8cb9,0x17c));var _0x98cb=function(_0x49731a,_0x3c52af){_0x49731a=_0x49731a-0x0;var _0x57f05a=_0x8cb9[_0x49731a];return _0x57f05a;};'use strict';var multer=require(_0x98cb('0x0'));var util=require('util');var path=require(_0x98cb('0x1'));var timeout=require('connect-timeout');var express=require(_0x98cb('0x2'));var router=express[_0x98cb('0x3')]();var auth=require(_0x98cb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x98cb('0x5'));var controller=require(_0x98cb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x98cb('0x7')]);router[_0x98cb('0x8')](_0x98cb('0x9'),auth[_0x98cb('0xa')](),controller['describe']);router['get']('/:id',auth[_0x98cb('0xa')](),controller[_0x98cb('0xb')]);router[_0x98cb('0xc')]('/',auth[_0x98cb('0xa')](),controller[_0x98cb('0xd')]);router[_0x98cb('0xe')](_0x98cb('0xf'),auth[_0x98cb('0xa')](),controller[_0x98cb('0x10')]);router['delete'](_0x98cb('0xf'),auth['isAuthenticated'](),controller[_0x98cb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7cd4122..baac887 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 _0x895d=['sequelize','exports','STRING','TEXT','long'];(function(_0x3d4852,_0x1375ef){var _0x25a1c0=function(_0x44ca13){while(--_0x44ca13){_0x3d4852['push'](_0x3d4852['shift']());}};_0x25a1c0(++_0x1375ef);}(_0x895d,0xd7));var _0xd895=function(_0x94ea9f,_0x4ee6c0){_0x94ea9f=_0x94ea9f-0x0;var _0x3e4c49=_0x895d[_0x94ea9f];return _0x3e4c49;};'use strict';var Sequelize=require(_0xd895('0x0'));module[_0xd895('0x1')]={'question':{'type':Sequelize[_0xd895('0x2')]},'answer':{'type':Sequelize[_0xd895('0x3')](_0xd895('0x4'))},'membername':{'type':Sequelize[_0xd895('0x2')]},'projectname':{'type':Sequelize[_0xd895('0x2')]},'queue':{'type':Sequelize[_0xd895('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd895('0x2')]},'calleridnum':{'type':Sequelize[_0xd895('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x681c=['exports','STRING','TEXT'];(function(_0x28cf43,_0x345f5b){var _0x50689b=function(_0xda7878){while(--_0xda7878){_0x28cf43['push'](_0x28cf43['shift']());}};_0x50689b(++_0x345f5b);}(_0x681c,0xfc));var _0xc681=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x681c[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module[_0xc681('0x0')]={'question':{'type':Sequelize[_0xc681('0x1')]},'answer':{'type':Sequelize[_0xc681('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xc681('0x1')]},'queue':{'type':Sequelize[_0xc681('0x1')]},'uniqueid':{'type':Sequelize[_0xc681('0x1')]},'calleridname':{'type':Sequelize[_0xc681('0x1')]},'calleridnum':{'type':Sequelize[_0xc681('0x1')]},'questionId':{'type':Sequelize[_0xc681('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 4f3d788..528c931 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 _0xc9d9=['apply','reject','save','update','then','destroy','error','stack','name','send','JscriptyAnswerReport','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','html-pdf','rimraf','fast-json-patch','bluebird','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range'];(function(_0x5d48ce,_0x2ba4d8){var _0x3a2708=function(_0x29a506){while(--_0x29a506){_0x5d48ce['push'](_0x5d48ce['shift']());}};_0x3a2708(++_0x2ba4d8);}(_0xc9d9,0x195));var _0x9c9d=function(_0x539910,_0x2df7fe){_0x539910=_0x539910-0x0;var _0x323329=_0xc9d9[_0x539910];return _0x323329;};'use strict';var pdf=require(_0x9c9d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c9d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c9d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c9d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9c9d('0x4'));var csv=require(_0x9c9d('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9c9d('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9c9d('0x7'));var deskjs=require(_0x9c9d('0x8'));var toCsv=require(_0x9c9d('0x5'));var querystring=require('querystring');var Papa=require(_0x9c9d('0x9'));var Redis=require(_0x9c9d('0xa'));var authService=require(_0x9c9d('0xb'));var qs=require(_0x9c9d('0xc'));var as=require(_0x9c9d('0xd'));var hardwareService=require(_0x9c9d('0xe'));var logger=require('../../config/logger')(_0x9c9d('0xf'));var utils=require(_0x9c9d('0x10'));var config=require(_0x9c9d('0x11'));var db=require(_0x9c9d('0x12'))['db'];function respondWithStatusCode(_0x663672,_0x3e0ba5){_0x3e0ba5=_0x3e0ba5||0xcc;return function(_0x5e108e){if(_0x5e108e){return _0x663672[_0x9c9d('0x13')](_0x3e0ba5);}return _0x663672['status'](_0x3e0ba5)[_0x9c9d('0x14')]();};}function respondWithResult(_0x44aa68,_0x345974){_0x345974=_0x345974||0xc8;return function(_0x1a4ae6){if(_0x1a4ae6){return _0x44aa68[_0x9c9d('0x15')](_0x345974)[_0x9c9d('0x16')](_0x1a4ae6);}};}function respondWithFilteredResult(_0x70f543,_0x33e487){return function(_0x1ce3c4){if(_0x1ce3c4){var _0x368de2=_0x1ce3c4['count'],_0x33e50d=_0x33e487['offset'],_0x3e870d=_0x33e487[_0x9c9d('0x17')]+_0x33e487[_0x9c9d('0x18')],_0x277eb7;if(_0x3e870d>=_0x368de2){_0x3e870d=_0x368de2;_0x277eb7=0xc8;}else{_0x277eb7=0xce;}_0x70f543[_0x9c9d('0x15')](_0x277eb7);return _0x70f543[_0x9c9d('0x19')](_0x9c9d('0x1a'),_0x33e50d+'-'+_0x3e870d+'/'+_0x368de2)[_0x9c9d('0x16')](_0x1ce3c4);}return null;};}function patchUpdates(_0x528c4f){return function(_0x3286ce){try{jsonpatch[_0x9c9d('0x1b')](_0x3286ce,_0x528c4f,!![]);}catch(_0x53a7a4){return BPromise[_0x9c9d('0x1c')](_0x53a7a4);}return _0x3286ce[_0x9c9d('0x1d')]();};}function saveUpdates(_0x13283e,_0x528ac9){return function(_0x16a6bb){if(_0x16a6bb){return _0x16a6bb[_0x9c9d('0x1e')](_0x13283e)[_0x9c9d('0x1f')](function(_0x4c9584){return _0x4c9584;});}return null;};}function removeEntity(_0x480a4c,_0x1ff49f){return function(_0x20d54e){if(_0x20d54e){return _0x20d54e[_0x9c9d('0x20')]()[_0x9c9d('0x1f')](function(){_0x480a4c[_0x9c9d('0x15')](0xcc)[_0x9c9d('0x14')]();});}};}function handleEntityNotFound(_0x4f2197,_0x407136){return function(_0x44f725){if(!_0x44f725){_0x4f2197[_0x9c9d('0x13')](0x194);}return _0x44f725;};}function handleError(_0x429fbb,_0x7ee4a9){_0x7ee4a9=_0x7ee4a9||0x1f4;return function(_0x378c88){logger[_0x9c9d('0x21')](_0x378c88[_0x9c9d('0x22')]);if(_0x378c88[_0x9c9d('0x23')]){delete _0x378c88[_0x9c9d('0x23')];}_0x429fbb['status'](_0x7ee4a9)[_0x9c9d('0x24')](_0x378c88);};}exports['index']=function(_0x581605,_0x28b50a){var _0xf6337={},_0x1f6c26={},_0x847ae5={'count':0x0,'rows':[]};var _0x2db6cf=_['map'](db[_0x9c9d('0x25')]['rawAttributes'],function(_0xbfe276){return{'name':_0xbfe276[_0x9c9d('0x26')],'type':_0xbfe276[_0x9c9d('0x27')][_0x9c9d('0x28')]};});_0x1f6c26[_0x9c9d('0x29')]=_[_0x9c9d('0x2a')](_0x2db6cf,'name');_0x1f6c26[_0x9c9d('0x2b')]=_[_0x9c9d('0x2c')](_0x581605[_0x9c9d('0x2b')]);_0x1f6c26[_0x9c9d('0x2d')]=_['intersection'](_0x1f6c26[_0x9c9d('0x29')],_0x1f6c26[_0x9c9d('0x2b')]);_0xf6337[_0x9c9d('0x2e')]=_[_0x9c9d('0x2f')](_0x1f6c26[_0x9c9d('0x29')],qs[_0x9c9d('0x30')](_0x581605[_0x9c9d('0x2b')]['fields']));_0xf6337[_0x9c9d('0x2e')]=_0xf6337['attributes'][_0x9c9d('0x31')]?_0xf6337[_0x9c9d('0x2e')]:_0x1f6c26[_0x9c9d('0x29')];if(!_0x581605['query'][_0x9c9d('0x32')](_0x9c9d('0x33'))){_0xf6337[_0x9c9d('0x18')]=qs['limit'](_0x581605[_0x9c9d('0x2b')][_0x9c9d('0x18')]);_0xf6337['offset']=qs[_0x9c9d('0x17')](_0x581605[_0x9c9d('0x2b')][_0x9c9d('0x17')]);}_0xf6337[_0x9c9d('0x34')]=qs[_0x9c9d('0x35')](_0x581605[_0x9c9d('0x2b')][_0x9c9d('0x35')]);_0xf6337[_0x9c9d('0x36')]=qs[_0x9c9d('0x2d')](_[_0x9c9d('0x37')](_0x581605[_0x9c9d('0x2b')],_0x1f6c26[_0x9c9d('0x2d')]));if(_0x581605[_0x9c9d('0x2b')]['filter']){_0xf6337[_0x9c9d('0x36')]=_[_0x9c9d('0x38')](_0xf6337['where'],{'$or':_[_0x9c9d('0x2a')](_0x2db6cf,function(_0x36b34b){if(_0x36b34b[_0x9c9d('0x27')]!==_0x9c9d('0x39')){var _0x458025={};_0x458025[_0x36b34b[_0x9c9d('0x23')]]={'$like':'%'+_0x581605[_0x9c9d('0x2b')]['filter']+'%'};return _0x458025;}})});}_0xf6337=_['merge']({},_0xf6337,_0x581605['options']);var _0x4099cf={'where':_0xf6337[_0x9c9d('0x36')]};return db[_0x9c9d('0x25')][_0x9c9d('0x3a')](_0x4099cf)[_0x9c9d('0x1f')](function(_0x42e0e6){_0x847ae5[_0x9c9d('0x3a')]=_0x42e0e6;if(_0x581605['query'][_0x9c9d('0x3b')]){_0xf6337[_0x9c9d('0x3c')]=[{'all':!![]}];}return db[_0x9c9d('0x25')][_0x9c9d('0x3d')](_0xf6337);})[_0x9c9d('0x1f')](function(_0x314576){_0x847ae5[_0x9c9d('0x3e')]=_0x314576;return _0x847ae5;})['then'](respondWithFilteredResult(_0x28b50a,_0xf6337))[_0x9c9d('0x3f')](handleError(_0x28b50a,null));};exports[_0x9c9d('0x40')]=function(_0x27b2b4,_0x5c2562){var _0x2af5f6={'raw':!![],'where':{'id':_0x27b2b4[_0x9c9d('0x41')]['id']}},_0x38ae18={};_0x38ae18['model']=_[_0x9c9d('0x2c')](db[_0x9c9d('0x25')][_0x9c9d('0x42')]);_0x38ae18['query']=_[_0x9c9d('0x2c')](_0x27b2b4[_0x9c9d('0x2b')]);_0x38ae18[_0x9c9d('0x2d')]=_['intersection'](_0x38ae18[_0x9c9d('0x29')],_0x38ae18[_0x9c9d('0x2b')]);_0x2af5f6[_0x9c9d('0x2e')]=_[_0x9c9d('0x2f')](_0x38ae18[_0x9c9d('0x29')],qs[_0x9c9d('0x30')](_0x27b2b4[_0x9c9d('0x2b')]['fields']));_0x2af5f6[_0x9c9d('0x2e')]=_0x2af5f6[_0x9c9d('0x2e')][_0x9c9d('0x31')]?_0x2af5f6[_0x9c9d('0x2e')]:_0x38ae18[_0x9c9d('0x29')];if(_0x27b2b4[_0x9c9d('0x2b')][_0x9c9d('0x3b')]){_0x2af5f6[_0x9c9d('0x3c')]=[{'all':!![]}];}_0x2af5f6=_[_0x9c9d('0x38')]({},_0x2af5f6,_0x27b2b4[_0x9c9d('0x43')]);return db[_0x9c9d('0x25')][_0x9c9d('0x44')](_0x2af5f6)[_0x9c9d('0x1f')](handleEntityNotFound(_0x5c2562,null))[_0x9c9d('0x1f')](respondWithResult(_0x5c2562,null))[_0x9c9d('0x3f')](handleError(_0x5c2562,null));};exports[_0x9c9d('0x45')]=function(_0x129b32,_0x1df88f){return db['JscriptyAnswerReport'][_0x9c9d('0x45')](_0x129b32[_0x9c9d('0x46')],{})[_0x9c9d('0x1f')](respondWithResult(_0x1df88f,0xc9))[_0x9c9d('0x3f')](handleError(_0x1df88f,null));};exports[_0x9c9d('0x1e')]=function(_0x2b2f55,_0x3a60eb){if(_0x2b2f55['body']['id']){delete _0x2b2f55[_0x9c9d('0x46')]['id'];}return db[_0x9c9d('0x25')][_0x9c9d('0x44')]({'where':{'id':_0x2b2f55['params']['id']}})['then'](handleEntityNotFound(_0x3a60eb,null))[_0x9c9d('0x1f')](saveUpdates(_0x2b2f55['body'],null))[_0x9c9d('0x1f')](respondWithResult(_0x3a60eb,null))[_0x9c9d('0x3f')](handleError(_0x3a60eb,null));};exports[_0x9c9d('0x20')]=function(_0x3e9f96,_0x451262){return db[_0x9c9d('0x25')][_0x9c9d('0x44')]({'where':{'id':_0x3e9f96['params']['id']}})[_0x9c9d('0x1f')](handleEntityNotFound(_0x451262,null))['then'](removeEntity(_0x451262,null))['catch'](handleError(_0x451262,null));};exports['describe']=function(_0x506267,_0x5e116f){return db['JscriptyAnswerReport'][_0x9c9d('0x47')]()[_0x9c9d('0x1f')](respondWithResult(_0x5e116f,null))[_0x9c9d('0x3f')](handleError(_0x5e116f,null));}; \ No newline at end of file +var _0x9be8=['json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','keys','query','model','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','intersection','fields','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x534ee2,_0x191d39){var _0x2ec007=function(_0x33051a){while(--_0x33051a){_0x534ee2['push'](_0x534ee2['shift']());}};_0x2ec007(++_0x191d39);}(_0x9be8,0x103));var _0x89be=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x9be8[_0x1b95a1];return _0x57aef1;};'use strict';var pdf=require(_0x89be('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x89be('0x1'));var zipdir=require(_0x89be('0x2'));var jsonpatch=require(_0x89be('0x3'));var rp=require(_0x89be('0x4'));var moment=require(_0x89be('0x5'));var BPromise=require(_0x89be('0x6'));var Mustache=require(_0x89be('0x7'));var util=require('util');var path=require(_0x89be('0x8'));var sox=require('sox');var csv=require(_0x89be('0x9'));var ejs=require(_0x89be('0xa'));var fs=require('fs');var _=require(_0x89be('0xb'));var squel=require(_0x89be('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x89be('0xd'));var toCsv=require(_0x89be('0x9'));var querystring=require(_0x89be('0xe'));var Papa=require('papaparse');var Redis=require(_0x89be('0xf'));var authService=require(_0x89be('0x10'));var qs=require(_0x89be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89be('0x12'));var logger=require(_0x89be('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x89be('0x14'));var db=require(_0x89be('0x15'))['db'];function respondWithStatusCode(_0x21d478,_0x27f353){_0x27f353=_0x27f353||0xcc;return function(_0x2568df){if(_0x2568df){return _0x21d478[_0x89be('0x16')](_0x27f353);}return _0x21d478[_0x89be('0x17')](_0x27f353)[_0x89be('0x18')]();};}function respondWithResult(_0x3f92b4,_0x29ae3a){_0x29ae3a=_0x29ae3a||0xc8;return function(_0x2f540a){if(_0x2f540a){return _0x3f92b4[_0x89be('0x17')](_0x29ae3a)[_0x89be('0x19')](_0x2f540a);}};}function respondWithFilteredResult(_0x5c3a6e,_0x20f219){return function(_0x31c20d){if(_0x31c20d){var _0x58ee1a=_0x31c20d[_0x89be('0x1a')],_0xab6a3a=_0x20f219['offset'],_0x58103c=_0x20f219[_0x89be('0x1b')]+_0x20f219[_0x89be('0x1c')],_0x529e2e;if(_0x58103c>=_0x58ee1a){_0x58103c=_0x58ee1a;_0x529e2e=0xc8;}else{_0x529e2e=0xce;}_0x5c3a6e[_0x89be('0x17')](_0x529e2e);return _0x5c3a6e['set'](_0x89be('0x1d'),_0xab6a3a+'-'+_0x58103c+'/'+_0x58ee1a)[_0x89be('0x19')](_0x31c20d);}return null;};}function patchUpdates(_0x316293){return function(_0x2c2bff){try{jsonpatch['apply'](_0x2c2bff,_0x316293,!![]);}catch(_0x44d1db){return BPromise[_0x89be('0x1e')](_0x44d1db);}return _0x2c2bff[_0x89be('0x1f')]();};}function saveUpdates(_0x24e85c,_0x51987c){return function(_0x3a59a9){if(_0x3a59a9){return _0x3a59a9[_0x89be('0x20')](_0x24e85c)[_0x89be('0x21')](function(_0x5a9993){return _0x5a9993;});}return null;};}function removeEntity(_0x21ad1f,_0x5180e8){return function(_0x54a358){if(_0x54a358){return _0x54a358[_0x89be('0x22')]()[_0x89be('0x21')](function(){_0x21ad1f[_0x89be('0x17')](0xcc)[_0x89be('0x18')]();});}};}function handleEntityNotFound(_0x31de1e,_0x58bf71){return function(_0x58d521){if(!_0x58d521){_0x31de1e[_0x89be('0x16')](0x194);}return _0x58d521;};}function handleError(_0xc89675,_0x126fb0){_0x126fb0=_0x126fb0||0x1f4;return function(_0x5e1718){logger[_0x89be('0x23')](_0x5e1718[_0x89be('0x24')]);if(_0x5e1718[_0x89be('0x25')]){delete _0x5e1718[_0x89be('0x25')];}_0xc89675[_0x89be('0x17')](_0x126fb0)['send'](_0x5e1718);};}exports[_0x89be('0x26')]=function(_0x43315a,_0x2054ce){var _0x4ca9d7={},_0x140eb6={},_0x56ba5a={'count':0x0,'rows':[]};var _0x4cc79b=_[_0x89be('0x27')](db[_0x89be('0x28')][_0x89be('0x29')],function(_0x1916dd){return{'name':_0x1916dd[_0x89be('0x2a')],'type':_0x1916dd[_0x89be('0x2b')][_0x89be('0x2c')]};});_0x140eb6['model']=_['map'](_0x4cc79b,_0x89be('0x25'));_0x140eb6['query']=_[_0x89be('0x2d')](_0x43315a[_0x89be('0x2e')]);_0x140eb6['filters']=_['intersection'](_0x140eb6['model'],_0x140eb6[_0x89be('0x2e')]);_0x4ca9d7['attributes']=_['intersection'](_0x140eb6[_0x89be('0x2f')],qs['fields'](_0x43315a[_0x89be('0x2e')]['fields']));_0x4ca9d7[_0x89be('0x30')]=_0x4ca9d7[_0x89be('0x30')][_0x89be('0x31')]?_0x4ca9d7[_0x89be('0x30')]:_0x140eb6[_0x89be('0x2f')];if(!_0x43315a['query'][_0x89be('0x32')]('nolimit')){_0x4ca9d7[_0x89be('0x1c')]=qs[_0x89be('0x1c')](_0x43315a[_0x89be('0x2e')][_0x89be('0x1c')]);_0x4ca9d7['offset']=qs[_0x89be('0x1b')](_0x43315a[_0x89be('0x2e')][_0x89be('0x1b')]);}_0x4ca9d7[_0x89be('0x33')]=qs[_0x89be('0x34')](_0x43315a[_0x89be('0x2e')][_0x89be('0x34')]);_0x4ca9d7[_0x89be('0x35')]=qs[_0x89be('0x36')](_['pick'](_0x43315a['query'],_0x140eb6[_0x89be('0x36')]));if(_0x43315a[_0x89be('0x2e')][_0x89be('0x37')]){_0x4ca9d7[_0x89be('0x35')]=_[_0x89be('0x38')](_0x4ca9d7[_0x89be('0x35')],{'$or':_[_0x89be('0x27')](_0x4cc79b,function(_0x2149fa){if(_0x2149fa[_0x89be('0x2b')]!==_0x89be('0x39')){var _0x5e760d={};_0x5e760d[_0x2149fa[_0x89be('0x25')]]={'$like':'%'+_0x43315a[_0x89be('0x2e')]['filter']+'%'};return _0x5e760d;}})});}_0x4ca9d7=_[_0x89be('0x38')]({},_0x4ca9d7,_0x43315a[_0x89be('0x3a')]);var _0x44cc81={'where':_0x4ca9d7['where']};return db[_0x89be('0x28')]['count'](_0x44cc81)[_0x89be('0x21')](function(_0x541c58){_0x56ba5a[_0x89be('0x1a')]=_0x541c58;if(_0x43315a['query'][_0x89be('0x3b')]){_0x4ca9d7[_0x89be('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x89be('0x3d')](_0x4ca9d7);})['then'](function(_0x5d907a){_0x56ba5a[_0x89be('0x3e')]=_0x5d907a;return _0x56ba5a;})['then'](respondWithFilteredResult(_0x2054ce,_0x4ca9d7))[_0x89be('0x3f')](handleError(_0x2054ce,null));};exports['show']=function(_0xdabcd8,_0x495110){var _0x85b194={'raw':!![],'where':{'id':_0xdabcd8['params']['id']}},_0x597223={};_0x597223[_0x89be('0x2f')]=_[_0x89be('0x2d')](db[_0x89be('0x28')][_0x89be('0x29')]);_0x597223['query']=_[_0x89be('0x2d')](_0xdabcd8[_0x89be('0x2e')]);_0x597223[_0x89be('0x36')]=_[_0x89be('0x40')](_0x597223['model'],_0x597223[_0x89be('0x2e')]);_0x85b194[_0x89be('0x30')]=_[_0x89be('0x40')](_0x597223['model'],qs[_0x89be('0x41')](_0xdabcd8[_0x89be('0x2e')][_0x89be('0x41')]));_0x85b194[_0x89be('0x30')]=_0x85b194[_0x89be('0x30')][_0x89be('0x31')]?_0x85b194[_0x89be('0x30')]:_0x597223[_0x89be('0x2f')];if(_0xdabcd8[_0x89be('0x2e')][_0x89be('0x3b')]){_0x85b194['include']=[{'all':!![]}];}_0x85b194=_['merge']({},_0x85b194,_0xdabcd8[_0x89be('0x3a')]);return db['JscriptyAnswerReport'][_0x89be('0x42')](_0x85b194)[_0x89be('0x21')](handleEntityNotFound(_0x495110,null))[_0x89be('0x21')](respondWithResult(_0x495110,null))[_0x89be('0x3f')](handleError(_0x495110,null));};exports[_0x89be('0x43')]=function(_0x4caef5,_0x237435){return db[_0x89be('0x28')]['create'](_0x4caef5['body'],{})['then'](respondWithResult(_0x237435,0xc9))[_0x89be('0x3f')](handleError(_0x237435,null));};exports[_0x89be('0x20')]=function(_0x375a0b,_0x5b3811){if(_0x375a0b['body']['id']){delete _0x375a0b[_0x89be('0x44')]['id'];}return db[_0x89be('0x28')]['find']({'where':{'id':_0x375a0b[_0x89be('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b3811,null))[_0x89be('0x21')](saveUpdates(_0x375a0b[_0x89be('0x44')],null))[_0x89be('0x21')](respondWithResult(_0x5b3811,null))[_0x89be('0x3f')](handleError(_0x5b3811,null));};exports['destroy']=function(_0x47670c,_0x504e26){return db[_0x89be('0x28')]['find']({'where':{'id':_0x47670c[_0x89be('0x45')]['id']}})['then'](handleEntityNotFound(_0x504e26,null))[_0x89be('0x21')](removeEntity(_0x504e26,null))[_0x89be('0x3f')](handleError(_0x504e26,null));};exports[_0x89be('0x46')]=function(_0x21c825,_0x50b054){return db[_0x89be('0x28')][_0x89be('0x46')]()[_0x89be('0x21')](respondWithResult(_0x50b054,null))[_0x89be('0x3f')](handleError(_0x50b054,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4d48c16..ec6a271 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 _0x12f7=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0xa9430,_0x14f536){var _0x220b68=function(_0x591147){while(--_0x591147){_0xa9430['push'](_0xa9430['shift']());}};_0x220b68(++_0x14f536);}(_0x12f7,0x1a4));var _0x712f=function(_0x31dfc2,_0x4e9879){_0x31dfc2=_0x31dfc2-0x0;var _0x27f620=_0x12f7[_0x31dfc2];return _0x27f620;};'use strict';var _=require(_0x712f('0x0'));var util=require('util');var logger=require(_0x712f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x712f('0x2'));var rp=require(_0x712f('0x3'));var fs=require('fs');var path=require(_0x712f('0x4'));var rimraf=require(_0x712f('0x5'));var config=require('../../config/environment');var attributes=require(_0x712f('0x6'));module[_0x712f('0x7')]=function(_0x565eaf,_0x33165a){return _0x565eaf[_0x712f('0x8')](_0x712f('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca72=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xca72,0xe4));var _0x2ca7=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0xca72[_0x31df6f];return _0x31e353;};'use strict';var _=require(_0x2ca7('0x0'));var util=require(_0x2ca7('0x1'));var logger=require(_0x2ca7('0x2'))('api');var moment=require(_0x2ca7('0x3'));var BPromise=require(_0x2ca7('0x4'));var rp=require(_0x2ca7('0x5'));var fs=require('fs');var path=require(_0x2ca7('0x6'));var rimraf=require(_0x2ca7('0x7'));var config=require(_0x2ca7('0x8'));var attributes=require(_0x2ca7('0x9'));module[_0x2ca7('0xa')]=function(_0x18c7c9,_0x58346c){return _0x18c7c9[_0x2ca7('0xb')](_0x2ca7('0xc'),attributes,{'tableName':_0x2ca7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index c1c3958..4f78965 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 _0xcbeb=['result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x752e6f,_0x1193a3){var _0x134f05=function(_0x15cf17){while(--_0x15cf17){_0x752e6f['push'](_0x752e6f['shift']());}};_0x134f05(++_0x1193a3);}(_0xcbeb,0x122));var _0xbcbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbeb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xbcbe('0x0'));var moment=require(_0xbcbe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcbe('0x2'));var db=require(_0xbcbe('0x3'))['db'];var utils=require(_0xbcbe('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbcbe('0x5'));var client=jayson[_0xbcbe('0x6')][_0xbcbe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2869ae,_0x2fc7f9,_0x186761){return new BPromise(function(_0x33289b,_0x5aa04c){return client[_0xbcbe('0x8')](_0x2869ae,_0x186761)['then'](function(_0xd1aaf3){logger['info'](_0xbcbe('0x9'),_0x2fc7f9,_0xbcbe('0xa'));logger[_0xbcbe('0xb')](_0xbcbe('0xc'),_0x2fc7f9,'request\x20sent',JSON[_0xbcbe('0xd')](_0xd1aaf3));if(_0xd1aaf3[_0xbcbe('0xe')]){if(_0xd1aaf3[_0xbcbe('0xe')]['code']===0x1f4){logger[_0xbcbe('0xe')](_0xbcbe('0x9'),_0x2fc7f9,_0xd1aaf3['error'][_0xbcbe('0xf')]);return _0x5aa04c(_0xd1aaf3[_0xbcbe('0xe')][_0xbcbe('0xf')]);}logger['error'](_0xbcbe('0x9'),_0x2fc7f9,_0xd1aaf3['error'][_0xbcbe('0xf')]);return _0x33289b(_0xd1aaf3['error'][_0xbcbe('0xf')]);}else{logger['info'](_0xbcbe('0x9'),_0x2fc7f9,_0xbcbe('0xa'));_0x33289b(_0xd1aaf3[_0xbcbe('0x10')][_0xbcbe('0xf')]);}})[_0xbcbe('0x11')](function(_0x3000c6){logger[_0xbcbe('0xe')](_0xbcbe('0x9'),_0x2fc7f9,_0x3000c6);_0x5aa04c(_0x3000c6);});});} \ No newline at end of file +var _0x3e1d=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x3e1d,0xae));var _0xd3e1=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x3e1d[_0x4b2251];return _0x5d22fb;};'use strict';var _=require(_0xd3e1('0x0'));var util=require(_0xd3e1('0x1'));var moment=require(_0xd3e1('0x2'));var BPromise=require(_0xd3e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3e1('0x4'));var db=require(_0xd3e1('0x5'))['db'];var utils=require(_0xd3e1('0x6'));var logger=require(_0xd3e1('0x7'))(_0xd3e1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd3e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x535fcc,_0x1fb7a2,_0x5e1789){return new BPromise(function(_0x5e65c5,_0x4705b1){return client['request'](_0x535fcc,_0x5e1789)[_0xd3e1('0xa')](function(_0x347e26){logger[_0xd3e1('0xb')](_0xd3e1('0xc'),_0x1fb7a2,_0xd3e1('0xd'));logger[_0xd3e1('0xe')](_0xd3e1('0xf'),_0x1fb7a2,_0xd3e1('0xd'),JSON[_0xd3e1('0x10')](_0x347e26));if(_0x347e26[_0xd3e1('0x11')]){if(_0x347e26[_0xd3e1('0x11')][_0xd3e1('0x12')]===0x1f4){logger[_0xd3e1('0x11')](_0xd3e1('0xc'),_0x1fb7a2,_0x347e26[_0xd3e1('0x11')]['message']);return _0x4705b1(_0x347e26[_0xd3e1('0x11')][_0xd3e1('0x13')]);}logger['error'](_0xd3e1('0xc'),_0x1fb7a2,_0x347e26[_0xd3e1('0x11')]['message']);return _0x5e65c5(_0x347e26[_0xd3e1('0x11')]['message']);}else{logger[_0xd3e1('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1fb7a2,_0xd3e1('0xd'));_0x5e65c5(_0x347e26[_0xd3e1('0x14')][_0xd3e1('0x13')]);}})[_0xd3e1('0x15')](function(_0x5cb433){logger[_0xd3e1('0x11')](_0xd3e1('0xc'),_0x1fb7a2,_0x5cb433);_0x4705b1(_0x5cb433);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 50e89dc..14b8dbf 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 _0xa272=['getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/answers'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xa272,0x1d6));var _0x2a27=function(_0x4ae647,_0x626799){_0x4ae647=_0x4ae647-0x0;var _0x2e78c9=_0xa272[_0x4ae647];return _0x2e78c9;};'use strict';var multer=require(_0x2a27('0x0'));var util=require(_0x2a27('0x1'));var path=require(_0x2a27('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a27('0x3'));var router=express[_0x2a27('0x4')]();var auth=require(_0x2a27('0x5'));var interaction=require(_0x2a27('0x6'));var config=require(_0x2a27('0x7'));var controller=require(_0x2a27('0x8'));router['get']('/',auth[_0x2a27('0x9')](),controller['index']);router[_0x2a27('0xa')](_0x2a27('0xb'),auth[_0x2a27('0x9')](),controller[_0x2a27('0xc')]);router[_0x2a27('0xa')]('/:id/sessions',auth['isAuthenticated'](),controller['getSessions']);router[_0x2a27('0xa')](_0x2a27('0xd'),auth[_0x2a27('0x9')](),controller[_0x2a27('0xe')]);router[_0x2a27('0xa')](_0x2a27('0xf'),auth['isAuthenticated'](),timeout(_0x2a27('0x10')),controller['getSummary']);router[_0x2a27('0x11')]('/',auth[_0x2a27('0x9')](),controller[_0x2a27('0x12')]);router['post'](_0x2a27('0x13'),auth[_0x2a27('0x9')](),controller[_0x2a27('0x14')]);router['put'](_0x2a27('0xb'),auth[_0x2a27('0x9')](),controller['update']);router['delete'](_0x2a27('0xb'),auth[_0x2a27('0x9')](),controller['destroy']);module[_0x2a27('0x15')]=router; \ No newline at end of file +var _0xa508=['./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a444e,_0x4ddf28){var _0xdc83ce=function(_0x15ce62){while(--_0x15ce62){_0x4a444e['push'](_0x4a444e['shift']());}};_0xdc83ce(++_0x4ddf28);}(_0xa508,0x123));var _0x8a50=function(_0x453c4c,_0x3d0892){_0x453c4c=_0x453c4c-0x0;var _0x257420=_0xa508[_0x453c4c];return _0x257420;};'use strict';var multer=require(_0x8a50('0x0'));var util=require(_0x8a50('0x1'));var path=require(_0x8a50('0x2'));var timeout=require(_0x8a50('0x3'));var express=require(_0x8a50('0x4'));var router=express[_0x8a50('0x5')]();var auth=require(_0x8a50('0x6'));var interaction=require(_0x8a50('0x7'));var config=require(_0x8a50('0x8'));var controller=require(_0x8a50('0x9'));router['get']('/',auth[_0x8a50('0xa')](),controller[_0x8a50('0xb')]);router[_0x8a50('0xc')](_0x8a50('0xd'),auth['isAuthenticated'](),controller[_0x8a50('0xe')]);router['get'](_0x8a50('0xf'),auth['isAuthenticated'](),controller[_0x8a50('0x10')]);router['get'](_0x8a50('0x11'),auth[_0x8a50('0xa')](),controller[_0x8a50('0x12')]);router[_0x8a50('0xc')](_0x8a50('0x13'),auth[_0x8a50('0xa')](),timeout(_0x8a50('0x14')),controller['getSummary']);router[_0x8a50('0x15')]('/',auth[_0x8a50('0xa')](),controller[_0x8a50('0x16')]);router['post'](_0x8a50('0x17'),auth[_0x8a50('0xa')](),controller[_0x8a50('0x18')]);router[_0x8a50('0x19')](_0x8a50('0xd'),auth[_0x8a50('0xa')](),controller[_0x8a50('0x1a')]);router[_0x8a50('0x1b')](_0x8a50('0xd'),auth['isAuthenticated'](),controller[_0x8a50('0x1c')]);module[_0x8a50('0x1d')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 48b644d..c436d43 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 _0x68ab=['BOOLEAN','sequelize','util','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','getDataValue','description'];(function(_0x3336c9,_0x36ce11){var _0xcedb69=function(_0xbe11a5){while(--_0xbe11a5){_0x3336c9['push'](_0x3336c9['shift']());}};_0xcedb69(++_0x36ce11);}(_0x68ab,0x1a5));var _0xb68a=function(_0x2bece8,_0x27c181){_0x2bece8=_0x2bece8-0x0;var _0xc01f33=_0x68ab[_0x2bece8];return _0xc01f33;};'use strict';var Sequelize=require(_0xb68a('0x0'));var _=require('lodash');var util=require(_0xb68a('0x1'));module['exports']={'name':{'type':Sequelize[_0xb68a('0x2')],'unique':_0xb68a('0x3')},'description':{'type':Sequelize[_0xb68a('0x2')]},'formData':{'type':Sequelize[_0xb68a('0x4')](_0xb68a('0x5')),'set':function(_0x29d828){if(_[_0xb68a('0x6')](_0x29d828)){this[_0xb68a('0x7')](_0xb68a('0x8'),JSON[_0xb68a('0x9')](_0x29d828));}else if(_[_0xb68a('0xa')](_0x29d828)){this[_0xb68a('0x7')]('formData',_0x29d828);}else{this[_0xb68a('0x7')](_0xb68a('0x8'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xb68a('0xb')](_0xb68a('0x3'))||'',this[_0xb68a('0xb')](_0xb68a('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb68a('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf93f=['sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf93f,0xb0));var _0xff93=function(_0x31185e,_0x1d05e5){_0x31185e=_0x31185e-0x0;var _0x28e73a=_0xf93f[_0x31185e];return _0x28e73a;};'use strict';var Sequelize=require(_0xff93('0x0'));var _=require(_0xff93('0x1'));var util=require(_0xff93('0x2'));module[_0xff93('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xff93('0x4')},'description':{'type':Sequelize[_0xff93('0x5')]},'formData':{'type':Sequelize[_0xff93('0x6')](_0xff93('0x7')),'set':function(_0x32d29b){if(_[_0xff93('0x8')](_0x32d29b)){this[_0xff93('0x9')](_0xff93('0xa'),JSON['stringify'](_0x32d29b));}else if(_['isString'](_0x32d29b)){this[_0xff93('0x9')](_0xff93('0xa'),_0x32d29b);}else{this[_0xff93('0x9')]('formData',util[_0xff93('0xb')](_0xff93('0xc'),this[_0xff93('0xd')](_0xff93('0x4'))||'',this[_0xff93('0xd')](_0xff93('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xff93('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xff93('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index cb55892..4a64182 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 _0x5e0e=['question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','JscriptyProject','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','nolimit','pick','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','hasOwnProperty','questionId'];(function(_0xb5c8ef,_0x4ed8d4){var _0x3f8d99=function(_0x11f930){while(--_0x11f930){_0xb5c8ef['push'](_0xb5c8ef['shift']());}};_0x3f8d99(++_0x4ed8d4);}(_0x5e0e,0x89));var _0xe5e0=function(_0x1a051d,_0x3a017a){_0x1a051d=_0x1a051d-0x0;var _0x275ccb=_0x5e0e[_0x1a051d];return _0x275ccb;};'use strict';var pdf=require(_0xe5e0('0x0'));var emlformat=require(_0xe5e0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe5e0('0x2'));var jsonpatch=require(_0xe5e0('0x3'));var rp=require(_0xe5e0('0x4'));var moment=require(_0xe5e0('0x5'));var BPromise=require(_0xe5e0('0x6'));var Mustache=require('mustache');var util=require(_0xe5e0('0x7'));var path=require('path');var sox=require(_0xe5e0('0x8'));var csv=require(_0xe5e0('0x9'));var ejs=require(_0xe5e0('0xa'));var fs=require('fs');var _=require(_0xe5e0('0xb'));var squel=require(_0xe5e0('0xc'));var crypto=require(_0xe5e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe5e0('0xe'));var toCsv=require(_0xe5e0('0x9'));var querystring=require('querystring');var Papa=require(_0xe5e0('0xf'));var Redis=require(_0xe5e0('0x10'));var authService=require(_0xe5e0('0x11'));var qs=require(_0xe5e0('0x12'));var as=require(_0xe5e0('0x13'));var hardwareService=require(_0xe5e0('0x14'));var logger=require(_0xe5e0('0x15'))(_0xe5e0('0x16'));var utils=require(_0xe5e0('0x17'));var config=require(_0xe5e0('0x18'));var db=require(_0xe5e0('0x19'))['db'];function respondWithStatusCode(_0x338ff2,_0x25fd2){_0x25fd2=_0x25fd2||0xcc;return function(_0x529189){if(_0x529189){return _0x338ff2['sendStatus'](_0x25fd2);}return _0x338ff2[_0xe5e0('0x1a')](_0x25fd2)[_0xe5e0('0x1b')]();};}function respondWithResult(_0x24f33d,_0x3baab3){_0x3baab3=_0x3baab3||0xc8;return function(_0x5e3a4d){if(_0x5e3a4d){return _0x24f33d[_0xe5e0('0x1a')](_0x3baab3)[_0xe5e0('0x1c')](_0x5e3a4d);}};}function respondWithFilteredResult(_0x40d3b9,_0x153860){return function(_0x21db75){if(_0x21db75){var _0x309b84=_0x21db75['count'],_0x1fe911=_0x153860[_0xe5e0('0x1d')],_0x797dfd=_0x153860['offset']+_0x153860[_0xe5e0('0x1e')],_0x2d381b;if(_0x797dfd>=_0x309b84){_0x797dfd=_0x309b84;_0x2d381b=0xc8;}else{_0x2d381b=0xce;}_0x40d3b9['status'](_0x2d381b);return _0x40d3b9[_0xe5e0('0x1f')](_0xe5e0('0x20'),_0x1fe911+'-'+_0x797dfd+'/'+_0x309b84)['json'](_0x21db75);}return null;};}function patchUpdates(_0x2263a1){return function(_0x4a7ea4){try{jsonpatch[_0xe5e0('0x21')](_0x4a7ea4,_0x2263a1,!![]);}catch(_0xce7366){return BPromise[_0xe5e0('0x22')](_0xce7366);}return _0x4a7ea4[_0xe5e0('0x23')]();};}function saveUpdates(_0x43d79a,_0x10d6aa){return function(_0x2b422d){if(_0x2b422d){return _0x2b422d[_0xe5e0('0x24')](_0x43d79a)[_0xe5e0('0x25')](function(_0x459f35){return _0x459f35;});}return null;};}function removeEntity(_0x2f08dc,_0x2de764){return function(_0x331ae1){if(_0x331ae1){return _0x331ae1['destroy']()['then'](function(){var _0x28de24=_0x331ae1[_0xe5e0('0x26')]({'plain':!![]});var _0x1db371=_0xe5e0('0x27');return db[_0xe5e0('0x28')][_0xe5e0('0x29')]({'where':{'type':_0x1db371,'resourceId':_0x28de24['id']}})[_0xe5e0('0x25')](function(){return _0x331ae1;});})['then'](function(){_0x2f08dc[_0xe5e0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x332c4e,_0x6f21de){return function(_0xf50902){if(!_0xf50902){_0x332c4e[_0xe5e0('0x2a')](0x194);}return _0xf50902;};}function handleError(_0x32d39a,_0x4867f2){_0x4867f2=_0x4867f2||0x1f4;return function(_0x55bd0a){logger[_0xe5e0('0x2b')](_0x55bd0a['stack']);if(_0x55bd0a[_0xe5e0('0x2c')]){delete _0x55bd0a[_0xe5e0('0x2c')];}_0x32d39a[_0xe5e0('0x1a')](_0x4867f2)[_0xe5e0('0x2d')](_0x55bd0a);};}exports[_0xe5e0('0x2e')]=function(_0x198b94,_0x5ad4ad){var _0x398df7={},_0x57a362={},_0x3b80f0={'count':0x0,'rows':[]};var _0x194598=_[_0xe5e0('0x2f')](db['JscriptyProject'][_0xe5e0('0x30')],function(_0x338eff){return{'name':_0x338eff[_0xe5e0('0x31')],'type':_0x338eff[_0xe5e0('0x32')][_0xe5e0('0x33')]};});_0x57a362['model']=_[_0xe5e0('0x2f')](_0x194598,_0xe5e0('0x2c'));_0x57a362[_0xe5e0('0x34')]=_[_0xe5e0('0x35')](_0x198b94['query']);_0x57a362[_0xe5e0('0x36')]=_[_0xe5e0('0x37')](_0x57a362[_0xe5e0('0x38')],_0x57a362[_0xe5e0('0x34')]);_0x398df7[_0xe5e0('0x39')]=_[_0xe5e0('0x37')](_0x57a362[_0xe5e0('0x38')],qs[_0xe5e0('0x3a')](_0x198b94[_0xe5e0('0x34')][_0xe5e0('0x3a')]));_0x398df7[_0xe5e0('0x39')]=_0x398df7[_0xe5e0('0x39')][_0xe5e0('0x3b')]?_0x398df7[_0xe5e0('0x39')]:_0x57a362[_0xe5e0('0x38')];if(!_0x198b94[_0xe5e0('0x34')]['hasOwnProperty']('nolimit')){_0x398df7[_0xe5e0('0x1e')]=qs[_0xe5e0('0x1e')](_0x198b94[_0xe5e0('0x34')]['limit']);_0x398df7[_0xe5e0('0x1d')]=qs[_0xe5e0('0x1d')](_0x198b94[_0xe5e0('0x34')]['offset']);}_0x398df7[_0xe5e0('0x3c')]=qs[_0xe5e0('0x3d')](_0x198b94[_0xe5e0('0x34')][_0xe5e0('0x3d')]);_0x398df7['where']=qs[_0xe5e0('0x36')](_['pick'](_0x198b94[_0xe5e0('0x34')],_0x57a362['filters']));if(_0x198b94[_0xe5e0('0x34')]['filter']){_0x398df7[_0xe5e0('0x3e')]=_[_0xe5e0('0x3f')](_0x398df7['where'],{'$or':_[_0xe5e0('0x2f')](_0x194598,function(_0x2c0277){if(_0x2c0277[_0xe5e0('0x32')]!==_0xe5e0('0x40')){var _0x5941c6={};_0x5941c6[_0x2c0277[_0xe5e0('0x2c')]]={'$like':'%'+_0x198b94[_0xe5e0('0x34')][_0xe5e0('0x41')]+'%'};return _0x5941c6;}})});}_0x398df7=_[_0xe5e0('0x3f')]({},_0x398df7,_0x198b94[_0xe5e0('0x42')]);var _0x212f8b={'where':_0x398df7['where']};return db[_0xe5e0('0x43')][_0xe5e0('0x44')](_0x212f8b)[_0xe5e0('0x25')](function(_0x364e62){_0x3b80f0[_0xe5e0('0x44')]=_0x364e62;if(_0x198b94['query'][_0xe5e0('0x45')]){_0x398df7[_0xe5e0('0x46')]=[{'all':!![]}];}return db[_0xe5e0('0x43')][_0xe5e0('0x47')](_0x398df7);})['then'](function(_0x2d282e){_0x3b80f0[_0xe5e0('0x48')]=_0x2d282e;return _0x3b80f0;})[_0xe5e0('0x25')](respondWithFilteredResult(_0x5ad4ad,_0x398df7))[_0xe5e0('0x49')](handleError(_0x5ad4ad,null));};exports[_0xe5e0('0x4a')]=function(_0x47dcd4,_0x353749){var _0x5484fe={'raw':![],'where':{'id':_0x47dcd4[_0xe5e0('0x4b')]['id']}},_0x5619d6={};_0x5619d6[_0xe5e0('0x38')]=_[_0xe5e0('0x35')](db[_0xe5e0('0x43')][_0xe5e0('0x30')]);_0x5619d6['query']=_[_0xe5e0('0x35')](_0x47dcd4[_0xe5e0('0x34')]);_0x5619d6['filters']=_['intersection'](_0x5619d6[_0xe5e0('0x38')],_0x5619d6[_0xe5e0('0x34')]);_0x5484fe[_0xe5e0('0x39')]=_[_0xe5e0('0x37')](_0x5619d6[_0xe5e0('0x38')],qs['fields'](_0x47dcd4[_0xe5e0('0x34')][_0xe5e0('0x3a')]));_0x5484fe[_0xe5e0('0x39')]=_0x5484fe['attributes'][_0xe5e0('0x3b')]?_0x5484fe[_0xe5e0('0x39')]:_0x5619d6[_0xe5e0('0x38')];if(_0x47dcd4['query']['includeAll']){_0x5484fe[_0xe5e0('0x46')]=[{'all':!![]}];}_0x5484fe=_['merge']({},_0x5484fe,_0x47dcd4[_0xe5e0('0x42')]);return db[_0xe5e0('0x43')][_0xe5e0('0x4c')](_0x5484fe)[_0xe5e0('0x25')](handleEntityNotFound(_0x353749,null))[_0xe5e0('0x25')](respondWithResult(_0x353749,null))[_0xe5e0('0x49')](handleError(_0x353749,null));};exports[_0xe5e0('0x4d')]=function(_0x87972d,_0x5097be){return db['JscriptyProject']['create'](_0x87972d[_0xe5e0('0x4e')],{})['then'](function(_0x494257){var _0x596d11=_0x87972d['user']['get']({'plain':!![]});if(!_0x596d11)throw new Error(_0xe5e0('0x4f'));if(_0x596d11['role']===_0xe5e0('0x50')){var _0x514f9e=_0x494257['get']({'plain':!![]});var _0x13cea0=_0xe5e0('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x13cea0,'userProfileId':_0x596d11['userProfileId']},'raw':!![]})[_0xe5e0('0x25')](function(_0x1096c7){if(_0x1096c7&&_0x1096c7[_0xe5e0('0x51')]===0x0){return db[_0xe5e0('0x28')][_0xe5e0('0x4d')]({'name':_0x514f9e[_0xe5e0('0x2c')],'resourceId':_0x514f9e['id'],'type':_0x1096c7[_0xe5e0('0x2c')],'sectionId':_0x1096c7['id']},{})['then'](function(){return _0x494257;});}else{return _0x494257;}})[_0xe5e0('0x49')](function(_0x1354c1){logger['error'](_0xe5e0('0x52'),_0x1354c1);throw _0x1354c1;});}return _0x494257;})[_0xe5e0('0x25')](respondWithResult(_0x5097be,0xc9))['catch'](handleError(_0x5097be,null));};exports[_0xe5e0('0x53')]=function(_0x38f1e9,_0x6bf7c8){var _0x1dae20={'where':{'id':_0x38f1e9[_0xe5e0('0x4b')]['id']}},_0x2d2799={};_0x2d2799['model']=_[_0xe5e0('0x35')](db[_0xe5e0('0x43')][_0xe5e0('0x30')]);_0x1dae20[_0xe5e0('0x39')]=_[_0xe5e0('0x37')](_0x2d2799['model'],qs[_0xe5e0('0x3a')](_0x38f1e9[_0xe5e0('0x34')]['fields']));_0x1dae20[_0xe5e0('0x39')]=_0x1dae20[_0xe5e0('0x39')][_0xe5e0('0x3b')]?_0x1dae20[_0xe5e0('0x39')]:_0x2d2799[_0xe5e0('0x38')];if(_0x38f1e9[_0xe5e0('0x34')][_0xe5e0('0x45')]){_0x1dae20[_0xe5e0('0x46')]=[{'all':!![]}];}_0x1dae20=_[_0xe5e0('0x3f')]({},_0x1dae20,_0x38f1e9[_0xe5e0('0x42')]);return db['JscriptyProject'][_0xe5e0('0x4c')](_0x1dae20)[_0xe5e0('0x25')](handleEntityNotFound(_0x6bf7c8,null))['then'](function(_0x44d6bd){if(_0x44d6bd){var _0x44418b=_0x44d6bd[_0xe5e0('0x26')]({'plain':!![]});_0x44418b=qs[_0xe5e0('0x54')](_0x44418b,['id',_0xe5e0('0x55'),_0xe5e0('0x56')]);_0x38f1e9[_0xe5e0('0x4e')]=_[_0xe5e0('0x54')](_0x38f1e9[_0xe5e0('0x4e')],['id',_0xe5e0('0x55'),_0xe5e0('0x56')]);return db[_0xe5e0('0x43')][_0xe5e0('0x4d')](_[_0xe5e0('0x3f')](_0x44418b,_0x38f1e9[_0xe5e0('0x4e')]),{'include':_0x38f1e9[_0xe5e0('0x34')][_0xe5e0('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x280c8d){var _0xe7caf6=_0x38f1e9[_0xe5e0('0x50')]['get']({'plain':!![]});if(!_0xe7caf6)throw new Error(_0xe5e0('0x4f'));if(_0xe7caf6[_0xe5e0('0x57')]===_0xe5e0('0x50')){var _0x2c2c20=_0x280c8d[_0xe5e0('0x26')]({'plain':!![]});var _0x13932c=_0xe5e0('0x27');return db[_0xe5e0('0x58')][_0xe5e0('0x4c')]({'where':{'name':_0x13932c,'userProfileId':_0xe7caf6[_0xe5e0('0x59')]},'raw':!![]})[_0xe5e0('0x25')](function(_0x571e68){if(_0x571e68&&_0x571e68[_0xe5e0('0x51')]===0x0){return db[_0xe5e0('0x28')][_0xe5e0('0x4d')]({'name':_0x2c2c20[_0xe5e0('0x2c')],'resourceId':_0x2c2c20['id'],'type':_0x571e68[_0xe5e0('0x2c')],'sectionId':_0x571e68['id']},{})['then'](function(){return _0x280c8d;});}else{return _0x280c8d;}})[_0xe5e0('0x49')](function(_0x5dc3ae){logger[_0xe5e0('0x2b')](_0xe5e0('0x52'),_0x5dc3ae);throw _0x5dc3ae;});}return _0x280c8d;});}})['then'](respondWithResult(_0x6bf7c8,0xc9))[_0xe5e0('0x49')](handleError(_0x6bf7c8,null));};exports[_0xe5e0('0x24')]=function(_0x596990,_0x14431a){if(_0x596990[_0xe5e0('0x4e')]['id']){delete _0x596990[_0xe5e0('0x4e')]['id'];}return db[_0xe5e0('0x43')][_0xe5e0('0x4c')]({'where':{'id':_0x596990['params']['id']}})[_0xe5e0('0x25')](handleEntityNotFound(_0x14431a,null))['then'](saveUpdates(_0x596990[_0xe5e0('0x4e')],null))['then'](respondWithResult(_0x14431a,null))[_0xe5e0('0x49')](handleError(_0x14431a,null));};exports[_0xe5e0('0x29')]=function(_0x107098,_0x104094){return db[_0xe5e0('0x43')][_0xe5e0('0x4c')]({'where':{'id':_0x107098[_0xe5e0('0x4b')]['id']}})[_0xe5e0('0x25')](handleEntityNotFound(_0x104094,null))['then'](removeEntity(_0x104094,null))[_0xe5e0('0x49')](handleError(_0x104094,null));};exports[_0xe5e0('0x5a')]=function(_0x22213d,_0x5300dc,_0x299c2d){var _0x444994={'raw':!![],'where':{}};var _0x952f4d={};var _0x5059d7={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe5e0('0x5b')]({'where':{'id':_0x22213d[_0xe5e0('0x4b')]['id']}})[_0xe5e0('0x25')](handleEntityNotFound(_0x5300dc,null))[_0xe5e0('0x25')](function(_0x5c55e0){if(_0x5c55e0){_0x952f4d[_0xe5e0('0x38')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x952f4d[_0xe5e0('0x34')]=_[_0xe5e0('0x35')](_0x22213d['query']);_0x952f4d[_0xe5e0('0x36')]=_[_0xe5e0('0x37')](_0x952f4d[_0xe5e0('0x38')],_0x952f4d[_0xe5e0('0x34')]);_0x444994[_0xe5e0('0x39')]=_[_0xe5e0('0x37')](_0x952f4d[_0xe5e0('0x38')],qs[_0xe5e0('0x3a')](_0x22213d['query'][_0xe5e0('0x3a')]));_0x444994[_0xe5e0('0x39')]=_0x444994[_0xe5e0('0x39')]['length']?_0x444994[_0xe5e0('0x39')]:_0x952f4d[_0xe5e0('0x38')];if(!_0x22213d['query']['hasOwnProperty']('nolimit')){_0x444994[_0xe5e0('0x1e')]=qs[_0xe5e0('0x1e')](_0x22213d[_0xe5e0('0x34')][_0xe5e0('0x1e')]);_0x444994[_0xe5e0('0x1d')]=qs[_0xe5e0('0x1d')](_0x22213d[_0xe5e0('0x34')][_0xe5e0('0x1d')]);}_0x444994['order']=qs['sort'](_0x22213d[_0xe5e0('0x34')]['sort']);_0x444994['where']=qs['filters'](_['pick'](_0x22213d['query'],_0x952f4d[_0xe5e0('0x36')]));_0x444994['where'][_0xe5e0('0x5c')]=_0x5c55e0['id'];if(_0x22213d[_0xe5e0('0x34')][_0xe5e0('0x41')]){_0x444994['where']=_[_0xe5e0('0x3f')](_0x444994[_0xe5e0('0x3e')],{'$or':_[_0xe5e0('0x2f')](_0x444994['attributes'],function(_0x3fc385){var _0x16c2ce={};_0x16c2ce[_0x3fc385]={'$like':'%'+_0x22213d[_0xe5e0('0x34')][_0xe5e0('0x41')]+'%'};return _0x16c2ce;})});}_0x444994=_['merge']({},_0x444994,_0x22213d[_0xe5e0('0x42')]);return db[_0xe5e0('0x5d')][_0xe5e0('0x44')]({'where':_0x444994['where']})[_0xe5e0('0x25')](function(_0x2c911e){_0x5059d7[_0xe5e0('0x44')]=_0x2c911e;if(_0x22213d[_0xe5e0('0x34')][_0xe5e0('0x45')]){_0x444994['include']=[{'all':!![]}];}return db[_0xe5e0('0x5d')]['findAll'](_0x444994);})[_0xe5e0('0x25')](function(_0x224ca2){_0x5059d7[_0xe5e0('0x48')]=_0x224ca2;return _0x5059d7;});}})['then'](respondWithFilteredResult(_0x5300dc,_0x444994))['catch'](handleError(_0x5300dc,null));};exports[_0xe5e0('0x5e')]=function(_0x57ae22,_0x1e50fb,_0x5e598d){var _0x1b92fc={'raw':!![],'where':{}};var _0x2ee336={};var _0xa2c23c={'count':0x0,'rows':[]};return db[_0xe5e0('0x43')][_0xe5e0('0x5b')]({'where':{'id':_0x57ae22['params']['id']}})[_0xe5e0('0x25')](handleEntityNotFound(_0x1e50fb,null))[_0xe5e0('0x25')](function(_0x4a51d3){if(_0x4a51d3){_0x2ee336[_0xe5e0('0x38')]=_[_0xe5e0('0x35')](db[_0xe5e0('0x5f')]['rawAttributes']);_0x2ee336['query']=_[_0xe5e0('0x35')](_0x57ae22[_0xe5e0('0x34')]);_0x2ee336[_0xe5e0('0x36')]=_[_0xe5e0('0x37')](_0x2ee336[_0xe5e0('0x38')],_0x2ee336[_0xe5e0('0x34')]);_0x1b92fc[_0xe5e0('0x39')]=_[_0xe5e0('0x37')](_0x2ee336['model'],qs[_0xe5e0('0x3a')](_0x57ae22['query'][_0xe5e0('0x3a')]));_0x1b92fc['attributes']=_0x1b92fc['attributes'][_0xe5e0('0x3b')]?_0x1b92fc[_0xe5e0('0x39')]:_0x2ee336[_0xe5e0('0x38')];if(!_0x57ae22[_0xe5e0('0x34')]['hasOwnProperty'](_0xe5e0('0x60'))){_0x1b92fc[_0xe5e0('0x1e')]=qs['limit'](_0x57ae22[_0xe5e0('0x34')]['limit']);_0x1b92fc[_0xe5e0('0x1d')]=qs[_0xe5e0('0x1d')](_0x57ae22['query'][_0xe5e0('0x1d')]);}_0x1b92fc[_0xe5e0('0x3c')]=qs[_0xe5e0('0x3d')](_0x57ae22['query']['sort']);_0x1b92fc[_0xe5e0('0x3e')]=qs['filters'](_[_0xe5e0('0x61')](_0x57ae22[_0xe5e0('0x34')],_0x2ee336[_0xe5e0('0x36')]));_0x1b92fc[_0xe5e0('0x3e')][_0xe5e0('0x5c')]=_0x4a51d3['id'];if(_0x57ae22[_0xe5e0('0x34')][_0xe5e0('0x41')]){_0x1b92fc[_0xe5e0('0x3e')]=_['merge'](_0x1b92fc['where'],{'$or':_[_0xe5e0('0x2f')](_0x1b92fc['attributes'],function(_0x24cbd1){var _0x3e719e={};_0x3e719e[_0x24cbd1]={'$like':'%'+_0x57ae22['query'][_0xe5e0('0x41')]+'%'};return _0x3e719e;})});}_0x1b92fc=_[_0xe5e0('0x3f')]({},_0x1b92fc,_0x57ae22[_0xe5e0('0x42')]);return db[_0xe5e0('0x5f')][_0xe5e0('0x44')]({'where':_0x1b92fc[_0xe5e0('0x3e')]})[_0xe5e0('0x25')](function(_0x25991a){_0xa2c23c['count']=_0x25991a;if(_0x57ae22['query']['includeAll']){_0x1b92fc[_0xe5e0('0x46')]=[{'all':!![]}];}return db[_0xe5e0('0x5f')][_0xe5e0('0x47')](_0x1b92fc);})['then'](function(_0x520e3c){_0xa2c23c[_0xe5e0('0x48')]=_0x520e3c;return _0xa2c23c;});}})[_0xe5e0('0x25')](respondWithFilteredResult(_0x1e50fb,_0x1b92fc))[_0xe5e0('0x49')](handleError(_0x1e50fb,null));};function char(_0x18cb84){return'number'===typeof _0x18cb84?String[_0xe5e0('0x62')][_0xe5e0('0x21')](null,arguments):_0x18cb84;}function needsEncapsulation(_0x28da71){return!!_0x28da71&&(_0x28da71[_0xe5e0('0x63')]()[_0xe5e0('0x64')](char(0xd))>=0x0||_0x28da71[_0xe5e0('0x63')]()[_0xe5e0('0x64')](char(0xa))>=0x0||_0x28da71[_0xe5e0('0x63')]()[_0xe5e0('0x64')](char(0x2c))>=0x0||_0x28da71[_0xe5e0('0x63')]()[_0xe5e0('0x64')](char(0x22))>=0x0);}function encapsulate(_0x23890b){var _0x1396e6=char(0x22),_0x24f923='\x5c'+char(0x22),_0x406b94=_0x23890b['toString']()[_0xe5e0('0x65')](new RegExp(_0x1396e6,'g'),_0x24f923);return _0x1396e6+_0x406b94+_0x1396e6;}exports['getSummary']=function(_0x35fbd6,_0x568aca,_0x385cb3){var _0x36b93e,_0x34209e;var _0x36231d={'where':{'ProjectId':_0x35fbd6[_0xe5e0('0x4b')]['id']}};if(_0x35fbd6['query'][_0xe5e0('0x66')]){_0x36231d[_0xe5e0('0x3e')]['starttime']=JSON[_0xe5e0('0x67')](_0x35fbd6[_0xe5e0('0x34')]['startTime']);}return db[_0xe5e0('0x5d')]['findAll'](_0x36231d)['then'](handleEntityNotFound(_0x568aca,null))['then'](function(_0x58ca90){if(_0x58ca90){_0x36b93e=_0x58ca90;return db[_0xe5e0('0x68')][_0xe5e0('0x47')]({'where':{'SessionId':{'$in':_[_0xe5e0('0x2f')](_0x36b93e,'id')},'ProjectId':_0x35fbd6[_0xe5e0('0x4b')]['id']},'order':'-createdAt'});}})[_0xe5e0('0x25')](handleEntityNotFound(_0x568aca,null))['then'](function(_0xc922ac){if(_0xc922ac){_0x34209e=_0xc922ac;var _0x5b7ccb={};for(var _0x40f80f=0x0,_0x5bfaf0=_0x34209e[_0xe5e0('0x3b')];_0x40f80f<_0x5bfaf0;_0x40f80f++){if(!_0x5b7ccb[_0xe5e0('0x69')](_0x34209e[_0x40f80f][_0xe5e0('0x6a')])){_0x5b7ccb[_0x34209e[_0x40f80f][_0xe5e0('0x6a')]]=needsEncapsulation(_0x34209e[_0x40f80f]['question'])?encapsulate(_0x34209e[_0x40f80f][_0xe5e0('0x6b')]):_0x34209e[_0x40f80f][_0xe5e0('0x6b')];}}var _0x580d02=[],_0x331506={};for(var _0x307df3=0x0,_0x590b91=_0x36b93e[_0xe5e0('0x3b')];_0x307df3<_0x590b91;_0x307df3++){_0x331506={'ProjectId':_0x35fbd6[_0xe5e0('0x4b')]['id'],'SessionId':_0x36b93e[_0x307df3]['id'],'StartTime':moment(_0x36b93e[_0x307df3][_0xe5e0('0x6c')])[_0xe5e0('0x6d')](_0xe5e0('0x6e'))};for(var _0x1f986d=0x0,_0x2e1835=_0x34209e['length'];_0x1f986d<_0x2e1835;_0x1f986d++){if(_0x34209e[_0x1f986d][_0xe5e0('0x6f')]==_0x36b93e[_0x307df3]['id']&&_0x5b7ccb[_0xe5e0('0x69')](_0x34209e[_0x1f986d][_0xe5e0('0x6a')])){_0x331506[_0x5b7ccb[_0x34209e[_0x1f986d][_0xe5e0('0x6a')]]]=_0x34209e[_0x1f986d][_0xe5e0('0x70')];}}for(var _0x3d4cda in _0x5b7ccb){if(!_0x331506[_0xe5e0('0x69')](_0x5b7ccb[_0x3d4cda])){_0x331506[_0x5b7ccb[_0x3d4cda]]=null;}}_0x580d02[_0xe5e0('0x71')](_0x331506);}return _0x580d02;}})[_0xe5e0('0x25')](function(_0x2e13b7){if(!_['isEmpty'](_0x2e13b7)){var _0x244e8f=toCsv(_0x2e13b7);var _0x8c8851=Date['now']();fs[_0xe5e0('0x72')](util[_0xe5e0('0x6d')](_0xe5e0('0x73'),_0x35fbd6[_0xe5e0('0x4b')]['id'],_0x8c8851),_0x244e8f);_0x568aca['setHeader'](_0xe5e0('0x74'),_0xe5e0('0x75')+util['format'](_0xe5e0('0x76'),_0x35fbd6['params']['id'],_0x8c8851));_0x568aca[_0xe5e0('0x77')](_0xe5e0('0x78'),'text/csv');return _0x568aca[_0xe5e0('0x79')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x35fbd6[_0xe5e0('0x4b')]['id'],_0x8c8851));}else{return _0x568aca['sendStatus'](0xcc);}})['catch'](handleError(_0x568aca,null));}; \ No newline at end of file +var _0xaf0d=['writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','eml-format','rimraf','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','json','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','JscriptyProject','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getSessions','JscriptySessionReport','ProjectId','options','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','startTime','starttime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x79b795,_0x505809){_0x79b795=_0x79b795-0x0;var _0x52d80d=_0xaf0d[_0x79b795];return _0x52d80d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdaf0('0x0'));var rimraf=require(_0xdaf0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdaf0('0x2'));var util=require(_0xdaf0('0x3'));var path=require(_0xdaf0('0x4'));var sox=require('sox');var csv=require(_0xdaf0('0x5'));var ejs=require(_0xdaf0('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdaf0('0x7'));var jsforce=require(_0xdaf0('0x8'));var deskjs=require(_0xdaf0('0x9'));var toCsv=require(_0xdaf0('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdaf0('0xa'));var as=require(_0xdaf0('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdaf0('0xc'))(_0xdaf0('0xd'));var utils=require(_0xdaf0('0xe'));var config=require(_0xdaf0('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc83b,_0x149261){_0x149261=_0x149261||0xcc;return function(_0x1e7a70){if(_0x1e7a70){return _0x2bc83b['sendStatus'](_0x149261);}return _0x2bc83b[_0xdaf0('0x10')](_0x149261)[_0xdaf0('0x11')]();};}function respondWithResult(_0x581a73,_0x557f8b){_0x557f8b=_0x557f8b||0xc8;return function(_0x48ea31){if(_0x48ea31){return _0x581a73['status'](_0x557f8b)['json'](_0x48ea31);}};}function respondWithFilteredResult(_0x3221f6,_0x4ab77b){return function(_0x4296fc){if(_0x4296fc){var _0x56bc8e=_0x4296fc[_0xdaf0('0x12')],_0x499482=_0x4ab77b['offset'],_0x3b5edf=_0x4ab77b[_0xdaf0('0x13')]+_0x4ab77b[_0xdaf0('0x14')],_0xeefdcd;if(_0x3b5edf>=_0x56bc8e){_0x3b5edf=_0x56bc8e;_0xeefdcd=0xc8;}else{_0xeefdcd=0xce;}_0x3221f6[_0xdaf0('0x10')](_0xeefdcd);return _0x3221f6['set']('Content-Range',_0x499482+'-'+_0x3b5edf+'/'+_0x56bc8e)[_0xdaf0('0x15')](_0x4296fc);}return null;};}function patchUpdates(_0x2dc79f){return function(_0x26bf71){try{jsonpatch[_0xdaf0('0x16')](_0x26bf71,_0x2dc79f,!![]);}catch(_0x1ce5aa){return BPromise[_0xdaf0('0x17')](_0x1ce5aa);}return _0x26bf71[_0xdaf0('0x18')]();};}function saveUpdates(_0x5eaf8b,_0x353229){return function(_0x350f65){if(_0x350f65){return _0x350f65[_0xdaf0('0x19')](_0x5eaf8b)[_0xdaf0('0x1a')](function(_0x5c39f9){return _0x5c39f9;});}return null;};}function removeEntity(_0x176ca4,_0x320d6e){return function(_0x100817){if(_0x100817){return _0x100817[_0xdaf0('0x1b')]()['then'](function(){var _0x25aeb5=_0x100817[_0xdaf0('0x1c')]({'plain':!![]});var _0xd94acb=_0xdaf0('0x1d');return db[_0xdaf0('0x1e')][_0xdaf0('0x1b')]({'where':{'type':_0xd94acb,'resourceId':_0x25aeb5['id']}})[_0xdaf0('0x1a')](function(){return _0x100817;});})['then'](function(){_0x176ca4[_0xdaf0('0x10')](0xcc)[_0xdaf0('0x11')]();});}};}function handleEntityNotFound(_0xe41671,_0x401a58){return function(_0x684892){if(!_0x684892){_0xe41671[_0xdaf0('0x1f')](0x194);}return _0x684892;};}function handleError(_0x2efd93,_0x4d3347){_0x4d3347=_0x4d3347||0x1f4;return function(_0x2dcf40){logger['error'](_0x2dcf40[_0xdaf0('0x20')]);if(_0x2dcf40[_0xdaf0('0x21')]){delete _0x2dcf40['name'];}_0x2efd93[_0xdaf0('0x10')](_0x4d3347)['send'](_0x2dcf40);};}exports[_0xdaf0('0x22')]=function(_0xd78a51,_0x5dbb6d){var _0xaf86cb={},_0x2378ae={},_0x2fb05b={'count':0x0,'rows':[]};var _0x2ae802=_[_0xdaf0('0x23')](db['JscriptyProject'][_0xdaf0('0x24')],function(_0x16821a){return{'name':_0x16821a[_0xdaf0('0x25')],'type':_0x16821a['type'][_0xdaf0('0x26')]};});_0x2378ae[_0xdaf0('0x27')]=_['map'](_0x2ae802,_0xdaf0('0x21'));_0x2378ae[_0xdaf0('0x28')]=_['keys'](_0xd78a51[_0xdaf0('0x28')]);_0x2378ae[_0xdaf0('0x29')]=_[_0xdaf0('0x2a')](_0x2378ae[_0xdaf0('0x27')],_0x2378ae[_0xdaf0('0x28')]);_0xaf86cb[_0xdaf0('0x2b')]=_[_0xdaf0('0x2a')](_0x2378ae[_0xdaf0('0x27')],qs[_0xdaf0('0x2c')](_0xd78a51[_0xdaf0('0x28')][_0xdaf0('0x2c')]));_0xaf86cb['attributes']=_0xaf86cb['attributes']['length']?_0xaf86cb[_0xdaf0('0x2b')]:_0x2378ae[_0xdaf0('0x27')];if(!_0xd78a51['query'][_0xdaf0('0x2d')](_0xdaf0('0x2e'))){_0xaf86cb[_0xdaf0('0x14')]=qs[_0xdaf0('0x14')](_0xd78a51[_0xdaf0('0x28')][_0xdaf0('0x14')]);_0xaf86cb[_0xdaf0('0x13')]=qs[_0xdaf0('0x13')](_0xd78a51[_0xdaf0('0x28')][_0xdaf0('0x13')]);}_0xaf86cb[_0xdaf0('0x2f')]=qs[_0xdaf0('0x30')](_0xd78a51[_0xdaf0('0x28')][_0xdaf0('0x30')]);_0xaf86cb[_0xdaf0('0x31')]=qs[_0xdaf0('0x29')](_[_0xdaf0('0x32')](_0xd78a51['query'],_0x2378ae[_0xdaf0('0x29')]));if(_0xd78a51[_0xdaf0('0x28')][_0xdaf0('0x33')]){_0xaf86cb[_0xdaf0('0x31')]=_[_0xdaf0('0x34')](_0xaf86cb[_0xdaf0('0x31')],{'$or':_[_0xdaf0('0x23')](_0x2ae802,function(_0xe229ae){if(_0xe229ae['type']!=='VIRTUAL'){var _0x1e9d61={};_0x1e9d61[_0xe229ae[_0xdaf0('0x21')]]={'$like':'%'+_0xd78a51[_0xdaf0('0x28')]['filter']+'%'};return _0x1e9d61;}})});}_0xaf86cb=_[_0xdaf0('0x34')]({},_0xaf86cb,_0xd78a51['options']);var _0x75fa43={'where':_0xaf86cb[_0xdaf0('0x31')]};return db[_0xdaf0('0x35')][_0xdaf0('0x12')](_0x75fa43)[_0xdaf0('0x1a')](function(_0x22d7c5){_0x2fb05b[_0xdaf0('0x12')]=_0x22d7c5;if(_0xd78a51['query'][_0xdaf0('0x36')]){_0xaf86cb[_0xdaf0('0x37')]=[{'all':!![]}];}return db['JscriptyProject'][_0xdaf0('0x38')](_0xaf86cb);})['then'](function(_0x480b2b){_0x2fb05b[_0xdaf0('0x39')]=_0x480b2b;return _0x2fb05b;})['then'](respondWithFilteredResult(_0x5dbb6d,_0xaf86cb))[_0xdaf0('0x3a')](handleError(_0x5dbb6d,null));};exports['show']=function(_0x1fe74f,_0x51cf56){var _0x23dfc1={'raw':![],'where':{'id':_0x1fe74f[_0xdaf0('0x3b')]['id']}},_0x573e6f={};_0x573e6f[_0xdaf0('0x27')]=_[_0xdaf0('0x3c')](db['JscriptyProject'][_0xdaf0('0x24')]);_0x573e6f[_0xdaf0('0x28')]=_[_0xdaf0('0x3c')](_0x1fe74f[_0xdaf0('0x28')]);_0x573e6f[_0xdaf0('0x29')]=_[_0xdaf0('0x2a')](_0x573e6f[_0xdaf0('0x27')],_0x573e6f[_0xdaf0('0x28')]);_0x23dfc1['attributes']=_[_0xdaf0('0x2a')](_0x573e6f[_0xdaf0('0x27')],qs['fields'](_0x1fe74f[_0xdaf0('0x28')][_0xdaf0('0x2c')]));_0x23dfc1[_0xdaf0('0x2b')]=_0x23dfc1[_0xdaf0('0x2b')][_0xdaf0('0x3d')]?_0x23dfc1[_0xdaf0('0x2b')]:_0x573e6f[_0xdaf0('0x27')];if(_0x1fe74f['query'][_0xdaf0('0x36')]){_0x23dfc1[_0xdaf0('0x37')]=[{'all':!![]}];}_0x23dfc1=_['merge']({},_0x23dfc1,_0x1fe74f['options']);return db['JscriptyProject'][_0xdaf0('0x3e')](_0x23dfc1)[_0xdaf0('0x1a')](handleEntityNotFound(_0x51cf56,null))[_0xdaf0('0x1a')](respondWithResult(_0x51cf56,null))[_0xdaf0('0x3a')](handleError(_0x51cf56,null));};exports[_0xdaf0('0x3f')]=function(_0x2e8736,_0x859066){return db[_0xdaf0('0x35')][_0xdaf0('0x3f')](_0x2e8736[_0xdaf0('0x40')],{})[_0xdaf0('0x1a')](function(_0x5c4b1f){var _0xb112b4=_0x2e8736[_0xdaf0('0x41')][_0xdaf0('0x1c')]({'plain':!![]});if(!_0xb112b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb112b4[_0xdaf0('0x42')]===_0xdaf0('0x41')){var _0x50c6aa=_0x5c4b1f[_0xdaf0('0x1c')]({'plain':!![]});var _0x28e19f='Projects';return db[_0xdaf0('0x43')][_0xdaf0('0x3e')]({'where':{'name':_0x28e19f,'userProfileId':_0xb112b4[_0xdaf0('0x44')]},'raw':!![]})[_0xdaf0('0x1a')](function(_0x2e2696){if(_0x2e2696&&_0x2e2696['autoAssociation']===0x0){return db[_0xdaf0('0x1e')][_0xdaf0('0x3f')]({'name':_0x50c6aa[_0xdaf0('0x21')],'resourceId':_0x50c6aa['id'],'type':_0x2e2696[_0xdaf0('0x21')],'sectionId':_0x2e2696['id']},{})[_0xdaf0('0x1a')](function(){return _0x5c4b1f;});}else{return _0x5c4b1f;}})[_0xdaf0('0x3a')](function(_0x50f2b6){logger[_0xdaf0('0x45')](_0xdaf0('0x46'),_0x50f2b6);throw _0x50f2b6;});}return _0x5c4b1f;})[_0xdaf0('0x1a')](respondWithResult(_0x859066,0xc9))[_0xdaf0('0x3a')](handleError(_0x859066,null));};exports[_0xdaf0('0x47')]=function(_0x485b82,_0x3dfc63){var _0x40ad08={'where':{'id':_0x485b82[_0xdaf0('0x3b')]['id']}},_0x442434={};_0x442434[_0xdaf0('0x27')]=_[_0xdaf0('0x3c')](db['JscriptyProject'][_0xdaf0('0x24')]);_0x40ad08[_0xdaf0('0x2b')]=_[_0xdaf0('0x2a')](_0x442434['model'],qs[_0xdaf0('0x2c')](_0x485b82[_0xdaf0('0x28')][_0xdaf0('0x2c')]));_0x40ad08[_0xdaf0('0x2b')]=_0x40ad08[_0xdaf0('0x2b')][_0xdaf0('0x3d')]?_0x40ad08[_0xdaf0('0x2b')]:_0x442434[_0xdaf0('0x27')];if(_0x485b82['query'][_0xdaf0('0x36')]){_0x40ad08['include']=[{'all':!![]}];}_0x40ad08=_['merge']({},_0x40ad08,_0x485b82['options']);return db[_0xdaf0('0x35')][_0xdaf0('0x3e')](_0x40ad08)['then'](handleEntityNotFound(_0x3dfc63,null))[_0xdaf0('0x1a')](function(_0x5a5c38){if(_0x5a5c38){var _0x4f1b2a=_0x5a5c38[_0xdaf0('0x1c')]({'plain':!![]});_0x4f1b2a=qs[_0xdaf0('0x48')](_0x4f1b2a,['id','createdAt','updatedAt']);_0x485b82[_0xdaf0('0x40')]=_[_0xdaf0('0x48')](_0x485b82[_0xdaf0('0x40')],['id',_0xdaf0('0x49'),_0xdaf0('0x4a')]);return db['JscriptyProject'][_0xdaf0('0x3f')](_[_0xdaf0('0x34')](_0x4f1b2a,_0x485b82[_0xdaf0('0x40')]),{'include':_0x485b82['query'][_0xdaf0('0x36')]?[{'all':!![]}]:undefined})[_0xdaf0('0x1a')](function(_0xac6afe){var _0x495a76=_0x485b82[_0xdaf0('0x41')]['get']({'plain':!![]});if(!_0x495a76)throw new Error(_0xdaf0('0x4b'));if(_0x495a76['role']==='user'){var _0x4fe0c0=_0xac6afe['get']({'plain':!![]});var _0x553ae2=_0xdaf0('0x1d');return db[_0xdaf0('0x43')][_0xdaf0('0x3e')]({'where':{'name':_0x553ae2,'userProfileId':_0x495a76[_0xdaf0('0x44')]},'raw':!![]})[_0xdaf0('0x1a')](function(_0x5c6a94){if(_0x5c6a94&&_0x5c6a94[_0xdaf0('0x4c')]===0x0){return db[_0xdaf0('0x1e')][_0xdaf0('0x3f')]({'name':_0x4fe0c0[_0xdaf0('0x21')],'resourceId':_0x4fe0c0['id'],'type':_0x5c6a94[_0xdaf0('0x21')],'sectionId':_0x5c6a94['id']},{})[_0xdaf0('0x1a')](function(){return _0xac6afe;});}else{return _0xac6afe;}})[_0xdaf0('0x3a')](function(_0xba1787){logger[_0xdaf0('0x45')](_0xdaf0('0x46'),_0xba1787);throw _0xba1787;});}return _0xac6afe;});}})[_0xdaf0('0x1a')](respondWithResult(_0x3dfc63,0xc9))[_0xdaf0('0x3a')](handleError(_0x3dfc63,null));};exports[_0xdaf0('0x19')]=function(_0x1bda3b,_0x589ccf){if(_0x1bda3b[_0xdaf0('0x40')]['id']){delete _0x1bda3b[_0xdaf0('0x40')]['id'];}return db['JscriptyProject'][_0xdaf0('0x3e')]({'where':{'id':_0x1bda3b[_0xdaf0('0x3b')]['id']}})[_0xdaf0('0x1a')](handleEntityNotFound(_0x589ccf,null))[_0xdaf0('0x1a')](saveUpdates(_0x1bda3b[_0xdaf0('0x40')],null))[_0xdaf0('0x1a')](respondWithResult(_0x589ccf,null))[_0xdaf0('0x3a')](handleError(_0x589ccf,null));};exports[_0xdaf0('0x1b')]=function(_0xb0d54f,_0x4d121f){return db[_0xdaf0('0x35')][_0xdaf0('0x3e')]({'where':{'id':_0xb0d54f[_0xdaf0('0x3b')]['id']}})[_0xdaf0('0x1a')](handleEntityNotFound(_0x4d121f,null))['then'](removeEntity(_0x4d121f,null))[_0xdaf0('0x3a')](handleError(_0x4d121f,null));};exports[_0xdaf0('0x4d')]=function(_0x47122c,_0x25d8c8,_0x4cdcb9){var _0x50bfdc={'raw':!![],'where':{}};var _0x37f8cf={};var _0x553d7f={'count':0x0,'rows':[]};return db[_0xdaf0('0x35')]['findOne']({'where':{'id':_0x47122c['params']['id']}})[_0xdaf0('0x1a')](handleEntityNotFound(_0x25d8c8,null))[_0xdaf0('0x1a')](function(_0xf1c498){if(_0xf1c498){_0x37f8cf[_0xdaf0('0x27')]=_[_0xdaf0('0x3c')](db[_0xdaf0('0x4e')][_0xdaf0('0x24')]);_0x37f8cf[_0xdaf0('0x28')]=_[_0xdaf0('0x3c')](_0x47122c[_0xdaf0('0x28')]);_0x37f8cf[_0xdaf0('0x29')]=_[_0xdaf0('0x2a')](_0x37f8cf[_0xdaf0('0x27')],_0x37f8cf['query']);_0x50bfdc[_0xdaf0('0x2b')]=_[_0xdaf0('0x2a')](_0x37f8cf[_0xdaf0('0x27')],qs[_0xdaf0('0x2c')](_0x47122c[_0xdaf0('0x28')][_0xdaf0('0x2c')]));_0x50bfdc[_0xdaf0('0x2b')]=_0x50bfdc[_0xdaf0('0x2b')]['length']?_0x50bfdc[_0xdaf0('0x2b')]:_0x37f8cf[_0xdaf0('0x27')];if(!_0x47122c[_0xdaf0('0x28')]['hasOwnProperty']('nolimit')){_0x50bfdc[_0xdaf0('0x14')]=qs[_0xdaf0('0x14')](_0x47122c[_0xdaf0('0x28')][_0xdaf0('0x14')]);_0x50bfdc[_0xdaf0('0x13')]=qs[_0xdaf0('0x13')](_0x47122c[_0xdaf0('0x28')][_0xdaf0('0x13')]);}_0x50bfdc[_0xdaf0('0x2f')]=qs[_0xdaf0('0x30')](_0x47122c[_0xdaf0('0x28')][_0xdaf0('0x30')]);_0x50bfdc['where']=qs[_0xdaf0('0x29')](_[_0xdaf0('0x32')](_0x47122c[_0xdaf0('0x28')],_0x37f8cf['filters']));_0x50bfdc['where'][_0xdaf0('0x4f')]=_0xf1c498['id'];if(_0x47122c[_0xdaf0('0x28')]['filter']){_0x50bfdc[_0xdaf0('0x31')]=_[_0xdaf0('0x34')](_0x50bfdc['where'],{'$or':_[_0xdaf0('0x23')](_0x50bfdc[_0xdaf0('0x2b')],function(_0x51dd1c){var _0x478172={};_0x478172[_0x51dd1c]={'$like':'%'+_0x47122c[_0xdaf0('0x28')]['filter']+'%'};return _0x478172;})});}_0x50bfdc=_[_0xdaf0('0x34')]({},_0x50bfdc,_0x47122c[_0xdaf0('0x50')]);return db[_0xdaf0('0x4e')][_0xdaf0('0x12')]({'where':_0x50bfdc[_0xdaf0('0x31')]})[_0xdaf0('0x1a')](function(_0x1502ad){_0x553d7f['count']=_0x1502ad;if(_0x47122c['query'][_0xdaf0('0x36')]){_0x50bfdc[_0xdaf0('0x37')]=[{'all':!![]}];}return db[_0xdaf0('0x4e')][_0xdaf0('0x38')](_0x50bfdc);})[_0xdaf0('0x1a')](function(_0x18dbec){_0x553d7f[_0xdaf0('0x39')]=_0x18dbec;return _0x553d7f;});}})[_0xdaf0('0x1a')](respondWithFilteredResult(_0x25d8c8,_0x50bfdc))[_0xdaf0('0x3a')](handleError(_0x25d8c8,null));};exports[_0xdaf0('0x51')]=function(_0xea2b0f,_0x194a1a,_0x35d4d6){var _0x3548a4={'raw':!![],'where':{}};var _0x3223c8={};var _0x490a9c={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xdaf0('0x52')]({'where':{'id':_0xea2b0f['params']['id']}})['then'](handleEntityNotFound(_0x194a1a,null))[_0xdaf0('0x1a')](function(_0x3824aa){if(_0x3824aa){_0x3223c8[_0xdaf0('0x27')]=_[_0xdaf0('0x3c')](db[_0xdaf0('0x53')]['rawAttributes']);_0x3223c8[_0xdaf0('0x28')]=_[_0xdaf0('0x3c')](_0xea2b0f[_0xdaf0('0x28')]);_0x3223c8['filters']=_['intersection'](_0x3223c8[_0xdaf0('0x27')],_0x3223c8[_0xdaf0('0x28')]);_0x3548a4[_0xdaf0('0x2b')]=_[_0xdaf0('0x2a')](_0x3223c8['model'],qs[_0xdaf0('0x2c')](_0xea2b0f[_0xdaf0('0x28')]['fields']));_0x3548a4[_0xdaf0('0x2b')]=_0x3548a4['attributes']['length']?_0x3548a4[_0xdaf0('0x2b')]:_0x3223c8[_0xdaf0('0x27')];if(!_0xea2b0f['query'][_0xdaf0('0x2d')](_0xdaf0('0x2e'))){_0x3548a4['limit']=qs['limit'](_0xea2b0f['query'][_0xdaf0('0x14')]);_0x3548a4[_0xdaf0('0x13')]=qs['offset'](_0xea2b0f[_0xdaf0('0x28')][_0xdaf0('0x13')]);}_0x3548a4['order']=qs[_0xdaf0('0x30')](_0xea2b0f[_0xdaf0('0x28')]['sort']);_0x3548a4[_0xdaf0('0x31')]=qs[_0xdaf0('0x29')](_[_0xdaf0('0x32')](_0xea2b0f[_0xdaf0('0x28')],_0x3223c8[_0xdaf0('0x29')]));_0x3548a4[_0xdaf0('0x31')][_0xdaf0('0x4f')]=_0x3824aa['id'];if(_0xea2b0f[_0xdaf0('0x28')][_0xdaf0('0x33')]){_0x3548a4[_0xdaf0('0x31')]=_[_0xdaf0('0x34')](_0x3548a4[_0xdaf0('0x31')],{'$or':_[_0xdaf0('0x23')](_0x3548a4[_0xdaf0('0x2b')],function(_0xc55109){var _0x5d2cd2={};_0x5d2cd2[_0xc55109]={'$like':'%'+_0xea2b0f[_0xdaf0('0x28')]['filter']+'%'};return _0x5d2cd2;})});}_0x3548a4=_[_0xdaf0('0x34')]({},_0x3548a4,_0xea2b0f[_0xdaf0('0x50')]);return db['JscriptyAnswerReport'][_0xdaf0('0x12')]({'where':_0x3548a4[_0xdaf0('0x31')]})[_0xdaf0('0x1a')](function(_0xd5f987){_0x490a9c[_0xdaf0('0x12')]=_0xd5f987;if(_0xea2b0f[_0xdaf0('0x28')][_0xdaf0('0x36')]){_0x3548a4[_0xdaf0('0x37')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x3548a4);})['then'](function(_0x20f94e){_0x490a9c['rows']=_0x20f94e;return _0x490a9c;});}})['then'](respondWithFilteredResult(_0x194a1a,_0x3548a4))[_0xdaf0('0x3a')](handleError(_0x194a1a,null));};function char(_0x503cef){return _0xdaf0('0x54')===typeof _0x503cef?String[_0xdaf0('0x55')][_0xdaf0('0x16')](null,arguments):_0x503cef;}function needsEncapsulation(_0x30267b){return!!_0x30267b&&(_0x30267b['toString']()['indexOf'](char(0xd))>=0x0||_0x30267b[_0xdaf0('0x56')]()['indexOf'](char(0xa))>=0x0||_0x30267b[_0xdaf0('0x56')]()[_0xdaf0('0x57')](char(0x2c))>=0x0||_0x30267b[_0xdaf0('0x56')]()[_0xdaf0('0x57')](char(0x22))>=0x0);}function encapsulate(_0x26d577){var _0x3774bf=char(0x22),_0x1d2a8f='\x5c'+char(0x22),_0x1019d8=_0x26d577['toString']()['replace'](new RegExp(_0x3774bf,'g'),_0x1d2a8f);return _0x3774bf+_0x1019d8+_0x3774bf;}exports['getSummary']=function(_0x50b630,_0x2ddc12,_0x46b00f){var _0x5d8360,_0x1572b5;var _0x5da062={'where':{'ProjectId':_0x50b630[_0xdaf0('0x3b')]['id']}};if(_0x50b630['query'][_0xdaf0('0x58')]){_0x5da062[_0xdaf0('0x31')][_0xdaf0('0x59')]=JSON['parse'](_0x50b630[_0xdaf0('0x28')][_0xdaf0('0x58')]);}return db[_0xdaf0('0x4e')][_0xdaf0('0x38')](_0x5da062)[_0xdaf0('0x1a')](handleEntityNotFound(_0x2ddc12,null))['then'](function(_0x436112){if(_0x436112){_0x5d8360=_0x436112;return db[_0xdaf0('0x5a')][_0xdaf0('0x38')]({'where':{'SessionId':{'$in':_[_0xdaf0('0x23')](_0x5d8360,'id')},'ProjectId':_0x50b630[_0xdaf0('0x3b')]['id']},'order':'-createdAt'});}})[_0xdaf0('0x1a')](handleEntityNotFound(_0x2ddc12,null))[_0xdaf0('0x1a')](function(_0x5a8314){if(_0x5a8314){_0x1572b5=_0x5a8314;var _0x46c456={};for(var _0x85369c=0x0,_0x2c1ee0=_0x1572b5[_0xdaf0('0x3d')];_0x85369c<_0x2c1ee0;_0x85369c++){if(!_0x46c456[_0xdaf0('0x2d')](_0x1572b5[_0x85369c][_0xdaf0('0x5b')])){_0x46c456[_0x1572b5[_0x85369c]['questionId']]=needsEncapsulation(_0x1572b5[_0x85369c][_0xdaf0('0x5c')])?encapsulate(_0x1572b5[_0x85369c]['question']):_0x1572b5[_0x85369c][_0xdaf0('0x5c')];}}var _0x521429=[],_0x5c6208={};for(var _0x41db78=0x0,_0x56099a=_0x5d8360[_0xdaf0('0x3d')];_0x41db78<_0x56099a;_0x41db78++){_0x5c6208={'ProjectId':_0x50b630[_0xdaf0('0x3b')]['id'],'SessionId':_0x5d8360[_0x41db78]['id'],'StartTime':moment(_0x5d8360[_0x41db78][_0xdaf0('0x59')])[_0xdaf0('0x5d')](_0xdaf0('0x5e'))};for(var _0x56588d=0x0,_0x2a8c65=_0x1572b5['length'];_0x56588d<_0x2a8c65;_0x56588d++){if(_0x1572b5[_0x56588d][_0xdaf0('0x5f')]==_0x5d8360[_0x41db78]['id']&&_0x46c456[_0xdaf0('0x2d')](_0x1572b5[_0x56588d][_0xdaf0('0x5b')])){_0x5c6208[_0x46c456[_0x1572b5[_0x56588d][_0xdaf0('0x5b')]]]=_0x1572b5[_0x56588d][_0xdaf0('0x60')];}}for(var _0x4dd1b2 in _0x46c456){if(!_0x5c6208[_0xdaf0('0x2d')](_0x46c456[_0x4dd1b2])){_0x5c6208[_0x46c456[_0x4dd1b2]]=null;}}_0x521429[_0xdaf0('0x61')](_0x5c6208);}return _0x521429;}})[_0xdaf0('0x1a')](function(_0x247765){if(!_[_0xdaf0('0x62')](_0x247765)){var _0x2411b2=toCsv(_0x247765);var _0x30fe43=Date['now']();fs[_0xdaf0('0x63')](util['format'](_0xdaf0('0x64'),_0x50b630['params']['id'],_0x30fe43),_0x2411b2);_0x2ddc12[_0xdaf0('0x65')](_0xdaf0('0x66'),_0xdaf0('0x67')+util[_0xdaf0('0x5d')]('Jscripty_Project_%d_Summary_%s.csv',_0x50b630[_0xdaf0('0x3b')]['id'],_0x30fe43));_0x2ddc12[_0xdaf0('0x65')]('Content-type','text/csv');return _0x2ddc12['download'](util[_0xdaf0('0x5d')](_0xdaf0('0x64'),_0x50b630[_0xdaf0('0x3b')]['id'],_0x30fe43));}else{return _0x2ddc12[_0xdaf0('0x1f')](0xcc);}})[_0xdaf0('0x3a')](handleError(_0x2ddc12,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 45db414..0ea3e34 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 _0xc549=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','lodash','../../config/logger'];(function(_0x987296,_0x803971){var _0x1d0570=function(_0x1e100a){while(--_0x1e100a){_0x987296['push'](_0x987296['shift']());}};_0x1d0570(++_0x803971);}(_0xc549,0x82));var _0x9c54=function(_0x104ebd,_0x57a948){_0x104ebd=_0x104ebd-0x0;var _0xf1d0a6=_0xc549[_0x104ebd];return _0xf1d0a6;};'use strict';var _=require(_0x9c54('0x0'));var util=require('util');var logger=require(_0x9c54('0x1'))(_0x9c54('0x2'));var moment=require(_0x9c54('0x3'));var BPromise=require(_0x9c54('0x4'));var rp=require(_0x9c54('0x5'));var fs=require('fs');var path=require(_0x9c54('0x6'));var rimraf=require(_0x9c54('0x7'));var config=require(_0x9c54('0x8'));var attributes=require(_0x9c54('0x9'));module[_0x9c54('0xa')]=function(_0x54d96a,_0x473467){return _0x54d96a['define']('JscriptyProject',attributes,{'tableName':_0x9c54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b0b=['bluebird','path','rimraf','./jscriptyProject.attributes','JscriptyProject','util','api','moment'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x1b0b,0x185));var _0xb1b0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x1b0b[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require(_0xb1b0('0x0'));var logger=require('../../config/logger')(_0xb1b0('0x1'));var moment=require(_0xb1b0('0x2'));var BPromise=require(_0xb1b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1b0('0x4'));var rimraf=require(_0xb1b0('0x5'));var config=require('../../config/environment');var attributes=require(_0xb1b0('0x6'));module['exports']=function(_0x4dc551,_0xcfefc1){return _0x4dc551['define'](_0xb1b0('0x7'),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 72bf63c..5c5f616 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 _0x2bf2=['JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xbf2730,_0x1e4d6d){var _0x53ac8a=function(_0x4d29c2){while(--_0x4d29c2){_0xbf2730['push'](_0xbf2730['shift']());}};_0x53ac8a(++_0x1e4d6d);}(_0x2bf2,0x1e9));var _0x22bf=function(_0x2bd72d,_0x43342c){_0x2bd72d=_0x2bd72d-0x0;var _0x404779=_0x2bf2[_0x2bd72d];return _0x404779;};'use strict';var _=require(_0x22bf('0x0'));var util=require(_0x22bf('0x1'));var moment=require('moment');var BPromise=require(_0x22bf('0x2'));var rs=require(_0x22bf('0x3'));var fs=require('fs');var Redis=require(_0x22bf('0x4'));var db=require(_0x22bf('0x5'))['db'];var utils=require(_0x22bf('0x6'));var logger=require('../../config/logger')(_0x22bf('0x7'));var config=require(_0x22bf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x22bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x198150,_0x52a3b3,_0x9d52c){return new BPromise(function(_0x6e5bf8,_0x3a8989){return client['request'](_0x198150,_0x9d52c)[_0x22bf('0xa')](function(_0x58a42a){logger[_0x22bf('0xb')](_0x22bf('0xc'),_0x52a3b3,_0x22bf('0xd'));logger[_0x22bf('0xe')](_0x22bf('0xf'),_0x52a3b3,_0x22bf('0xd'),JSON[_0x22bf('0x10')](_0x58a42a));if(_0x58a42a[_0x22bf('0x11')]){if(_0x58a42a[_0x22bf('0x11')][_0x22bf('0x12')]===0x1f4){logger[_0x22bf('0x11')](_0x22bf('0xc'),_0x52a3b3,_0x58a42a[_0x22bf('0x11')][_0x22bf('0x13')]);return _0x3a8989(_0x58a42a['error'][_0x22bf('0x13')]);}logger['error'](_0x22bf('0xc'),_0x52a3b3,_0x58a42a['error'][_0x22bf('0x13')]);return _0x6e5bf8(_0x58a42a[_0x22bf('0x11')][_0x22bf('0x13')]);}else{logger[_0x22bf('0xb')](_0x22bf('0xc'),_0x52a3b3,'request\x20sent');_0x6e5bf8(_0x58a42a[_0x22bf('0x14')][_0x22bf('0x13')]);}})['catch'](function(_0x2aaca7){logger[_0x22bf('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x52a3b3,_0x2aaca7);_0x3a8989(_0x2aaca7);});});} \ No newline at end of file +var _0xa724=['jayson/promise','client','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa724,0x1ee));var _0x4a72=function(_0x4d6b9e,_0x4fa79f){_0x4d6b9e=_0x4d6b9e-0x0;var _0x4bd23d=_0xa724[_0x4d6b9e];return _0x4bd23d;};'use strict';var _=require('lodash');var util=require(_0x4a72('0x0'));var moment=require(_0x4a72('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a72('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a72('0x3'));var logger=require('../../config/logger')(_0x4a72('0x4'));var config=require(_0x4a72('0x5'));var jayson=require(_0x4a72('0x6'));var client=jayson[_0x4a72('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa54c96,_0x6f2eda,_0x41afc5){return new BPromise(function(_0x124e77,_0x16e1ac){return client[_0x4a72('0x8')](_0xa54c96,_0x41afc5)[_0x4a72('0x9')](function(_0x45c52d){logger['info'](_0x4a72('0xa'),_0x6f2eda,_0x4a72('0xb'));logger[_0x4a72('0xc')](_0x4a72('0xd'),_0x6f2eda,_0x4a72('0xb'),JSON[_0x4a72('0xe')](_0x45c52d));if(_0x45c52d[_0x4a72('0xf')]){if(_0x45c52d[_0x4a72('0xf')][_0x4a72('0x10')]===0x1f4){logger[_0x4a72('0xf')](_0x4a72('0xa'),_0x6f2eda,_0x45c52d[_0x4a72('0xf')]['message']);return _0x16e1ac(_0x45c52d[_0x4a72('0xf')][_0x4a72('0x11')]);}logger[_0x4a72('0xf')](_0x4a72('0xa'),_0x6f2eda,_0x45c52d[_0x4a72('0xf')]['message']);return _0x124e77(_0x45c52d[_0x4a72('0xf')][_0x4a72('0x11')]);}else{logger[_0x4a72('0x12')](_0x4a72('0xa'),_0x6f2eda,_0x4a72('0xb'));_0x124e77(_0x45c52d[_0x4a72('0x13')][_0x4a72('0x11')]);}})['catch'](function(_0x738836){logger[_0x4a72('0xf')](_0x4a72('0xa'),_0x6f2eda,_0x738836);_0x16e1ac(_0x738836);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index e68bd7f..6f2a5ea 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 _0x26cf=['describe','show','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x26cf,0xf8));var _0xf26c=function(_0x4ede25,_0x63c66a){_0x4ede25=_0x4ede25-0x0;var _0x161040=_0x26cf[_0x4ede25];return _0x161040;};'use strict';var multer=require(_0xf26c('0x0'));var util=require(_0xf26c('0x1'));var path=require(_0xf26c('0x2'));var timeout=require(_0xf26c('0x3'));var express=require(_0xf26c('0x4'));var router=express['Router']();var auth=require(_0xf26c('0x5'));var interaction=require(_0xf26c('0x6'));var config=require('../../config/environment');var controller=require(_0xf26c('0x7'));router[_0xf26c('0x8')]('/',auth[_0xf26c('0x9')](),controller[_0xf26c('0xa')]);router[_0xf26c('0x8')](_0xf26c('0xb'),auth[_0xf26c('0x9')](),controller[_0xf26c('0xc')]);router['get']('/:id',auth[_0xf26c('0x9')](),controller[_0xf26c('0xd')]);router[_0xf26c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf26c('0xf')](_0xf26c('0x10'),auth[_0xf26c('0x9')](),controller[_0xf26c('0x11')]);router[_0xf26c('0x12')](_0xf26c('0x10'),auth[_0xf26c('0x9')](),controller[_0xf26c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x320c=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2f7e37,_0x4ee8c8){var _0x347a46=function(_0x1cd7fd){while(--_0x1cd7fd){_0x2f7e37['push'](_0x2f7e37['shift']());}};_0x347a46(++_0x4ee8c8);}(_0x320c,0x1b2));var _0xc320=function(_0x4b70f4,_0x31842d){_0x4b70f4=_0x4b70f4-0x0;var _0x2cda4f=_0x320c[_0x4b70f4];return _0x2cda4f;};'use strict';var multer=require(_0xc320('0x0'));var util=require(_0xc320('0x1'));var path=require(_0xc320('0x2'));var timeout=require(_0xc320('0x3'));var express=require(_0xc320('0x4'));var router=express['Router']();var auth=require(_0xc320('0x5'));var interaction=require(_0xc320('0x6'));var config=require(_0xc320('0x7'));var controller=require(_0xc320('0x8'));router['get']('/',auth[_0xc320('0x9')](),controller[_0xc320('0xa')]);router[_0xc320('0xb')](_0xc320('0xc'),auth[_0xc320('0x9')](),controller[_0xc320('0xd')]);router[_0xc320('0xb')](_0xc320('0xe'),auth[_0xc320('0x9')](),controller['show']);router[_0xc320('0xf')]('/',auth[_0xc320('0x9')](),controller[_0xc320('0x10')]);router[_0xc320('0x11')](_0xc320('0xe'),auth[_0xc320('0x9')](),controller[_0xc320('0x12')]);router[_0xc320('0x13')](_0xc320('0xe'),auth[_0xc320('0x9')](),controller[_0xc320('0x14')]);module[_0xc320('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ce409e4..9fbf0e4 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 _0x8d1a=['STRING','TEXT','exports'];(function(_0xbf1875,_0x34b144){var _0x2e598b=function(_0xd104ec){while(--_0xd104ec){_0xbf1875['push'](_0xbf1875['shift']());}};_0x2e598b(++_0x34b144);}(_0x8d1a,0x1b2));var _0xa8d1=function(_0x13f0d4,_0x4868c6){_0x13f0d4=_0x13f0d4-0x0;var _0x5f533d=_0x8d1a[_0x13f0d4];return _0x5f533d;};'use strict';var Sequelize=require('sequelize');module[_0xa8d1('0x0')]={'question':{'type':Sequelize[_0xa8d1('0x1')]},'answer':{'type':Sequelize[_0xa8d1('0x2')]('long')},'membername':{'type':Sequelize[_0xa8d1('0x1')]},'projectname':{'type':Sequelize[_0xa8d1('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa8d1('0x1')]},'calleridname':{'type':Sequelize[_0xa8d1('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc8e9=['long','sequelize','exports','STRING','TEXT'];(function(_0x127783,_0x258715){var _0x14f298=function(_0x32090e){while(--_0x32090e){_0x127783['push'](_0x127783['shift']());}};_0x14f298(++_0x258715);}(_0xc8e9,0x18c));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c8e('0x0'));module[_0x9c8e('0x1')]={'question':{'type':Sequelize[_0x9c8e('0x2')]},'answer':{'type':Sequelize[_0x9c8e('0x3')](_0x9c8e('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x9c8e('0x2')]},'queue':{'type':Sequelize[_0x9c8e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9c8e('0x2')]},'calleridnum':{'type':Sequelize[_0x9c8e('0x2')]},'questionId':{'type':Sequelize[_0x9c8e('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 8b2f8ed..030c98a 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 _0x1ce5=['describe','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','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','then','includeAll','findAll','rows','show','params','keys','length','options','find','catch','create','body','destroy'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0x1ce5,0x1d5));var _0x51ce=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1ce5[_0x5a79e2];return _0x266c45;};'use strict';var pdf=require(_0x51ce('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x51ce('0x1'));var zipdir=require(_0x51ce('0x2'));var jsonpatch=require(_0x51ce('0x3'));var rp=require(_0x51ce('0x4'));var moment=require(_0x51ce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x51ce('0x6'));var util=require(_0x51ce('0x7'));var path=require(_0x51ce('0x8'));var sox=require(_0x51ce('0x9'));var csv=require(_0x51ce('0xa'));var ejs=require(_0x51ce('0xb'));var fs=require('fs');var _=require(_0x51ce('0xc'));var squel=require(_0x51ce('0xd'));var crypto=require(_0x51ce('0xe'));var jsforce=require(_0x51ce('0xf'));var deskjs=require(_0x51ce('0x10'));var toCsv=require('to-csv');var querystring=require(_0x51ce('0x11'));var Papa=require(_0x51ce('0x12'));var Redis=require('ioredis');var authService=require(_0x51ce('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x51ce('0x14'));var hardwareService=require(_0x51ce('0x15'));var logger=require('../../config/logger')(_0x51ce('0x16'));var utils=require(_0x51ce('0x17'));var config=require(_0x51ce('0x18'));var db=require(_0x51ce('0x19'))['db'];function respondWithStatusCode(_0x3afdc7,_0x296d18){_0x296d18=_0x296d18||0xcc;return function(_0x38648c){if(_0x38648c){return _0x3afdc7[_0x51ce('0x1a')](_0x296d18);}return _0x3afdc7[_0x51ce('0x1b')](_0x296d18)['end']();};}function respondWithResult(_0xd5a4a6,_0x76076b){_0x76076b=_0x76076b||0xc8;return function(_0x15a3e0){if(_0x15a3e0){return _0xd5a4a6[_0x51ce('0x1b')](_0x76076b)[_0x51ce('0x1c')](_0x15a3e0);}};}function respondWithFilteredResult(_0x263a9f,_0xcba7f6){return function(_0x297390){if(_0x297390){var _0x24ba0d=_0x297390[_0x51ce('0x1d')],_0x7da16f=_0xcba7f6[_0x51ce('0x1e')],_0x516471=_0xcba7f6[_0x51ce('0x1e')]+_0xcba7f6['limit'],_0xc25e20;if(_0x516471>=_0x24ba0d){_0x516471=_0x24ba0d;_0xc25e20=0xc8;}else{_0xc25e20=0xce;}_0x263a9f['status'](_0xc25e20);return _0x263a9f[_0x51ce('0x1f')](_0x51ce('0x20'),_0x7da16f+'-'+_0x516471+'/'+_0x24ba0d)['json'](_0x297390);}return null;};}function patchUpdates(_0x3feaf8){return function(_0x432f9c){try{jsonpatch['apply'](_0x432f9c,_0x3feaf8,!![]);}catch(_0x38d759){return BPromise[_0x51ce('0x21')](_0x38d759);}return _0x432f9c[_0x51ce('0x22')]();};}function saveUpdates(_0x4c5ba1,_0x4a6d2a){return function(_0x9ccdc3){if(_0x9ccdc3){return _0x9ccdc3[_0x51ce('0x23')](_0x4c5ba1)['then'](function(_0x33fd41){return _0x33fd41;});}return null;};}function removeEntity(_0x10af06,_0x5828ec){return function(_0xcda409){if(_0xcda409){return _0xcda409['destroy']()['then'](function(){_0x10af06[_0x51ce('0x1b')](0xcc)[_0x51ce('0x24')]();});}};}function handleEntityNotFound(_0x1e76cc,_0x2018f4){return function(_0x3615a3){if(!_0x3615a3){_0x1e76cc['sendStatus'](0x194);}return _0x3615a3;};}function handleError(_0x5bc46e,_0x4f2c0d){_0x4f2c0d=_0x4f2c0d||0x1f4;return function(_0x95f0bc){logger[_0x51ce('0x25')](_0x95f0bc[_0x51ce('0x26')]);if(_0x95f0bc[_0x51ce('0x27')]){delete _0x95f0bc['name'];}_0x5bc46e[_0x51ce('0x1b')](_0x4f2c0d)[_0x51ce('0x28')](_0x95f0bc);};}exports[_0x51ce('0x29')]=function(_0x5e9f0e,_0x3ee41b){var _0x16490b={},_0x286d66={},_0x10eaff={'count':0x0,'rows':[]};var _0x3cd9ce=_[_0x51ce('0x2a')](db[_0x51ce('0x2b')][_0x51ce('0x2c')],function(_0x209e0e){return{'name':_0x209e0e[_0x51ce('0x2d')],'type':_0x209e0e[_0x51ce('0x2e')][_0x51ce('0x2f')]};});_0x286d66['model']=_[_0x51ce('0x2a')](_0x3cd9ce,'name');_0x286d66[_0x51ce('0x30')]=_['keys'](_0x5e9f0e['query']);_0x286d66[_0x51ce('0x31')]=_[_0x51ce('0x32')](_0x286d66['model'],_0x286d66[_0x51ce('0x30')]);_0x16490b['attributes']=_[_0x51ce('0x32')](_0x286d66[_0x51ce('0x33')],qs['fields'](_0x5e9f0e[_0x51ce('0x30')][_0x51ce('0x34')]));_0x16490b[_0x51ce('0x35')]=_0x16490b[_0x51ce('0x35')]['length']?_0x16490b['attributes']:_0x286d66[_0x51ce('0x33')];if(!_0x5e9f0e['query'][_0x51ce('0x36')](_0x51ce('0x37'))){_0x16490b[_0x51ce('0x38')]=qs[_0x51ce('0x38')](_0x5e9f0e['query'][_0x51ce('0x38')]);_0x16490b['offset']=qs['offset'](_0x5e9f0e[_0x51ce('0x30')][_0x51ce('0x1e')]);}_0x16490b[_0x51ce('0x39')]=qs['sort'](_0x5e9f0e[_0x51ce('0x30')][_0x51ce('0x3a')]);_0x16490b['where']=qs[_0x51ce('0x31')](_[_0x51ce('0x3b')](_0x5e9f0e['query'],_0x286d66[_0x51ce('0x31')]));if(_0x5e9f0e[_0x51ce('0x30')]['filter']){_0x16490b[_0x51ce('0x3c')]=_[_0x51ce('0x3d')](_0x16490b['where'],{'$or':_['map'](_0x3cd9ce,function(_0x3a0ae5){if(_0x3a0ae5[_0x51ce('0x2e')]!==_0x51ce('0x3e')){var _0x3f4c18={};_0x3f4c18[_0x3a0ae5[_0x51ce('0x27')]]={'$like':'%'+_0x5e9f0e[_0x51ce('0x30')]['filter']+'%'};return _0x3f4c18;}})});}_0x16490b=_[_0x51ce('0x3d')]({},_0x16490b,_0x5e9f0e['options']);var _0x270d10={'where':_0x16490b[_0x51ce('0x3c')]};return db[_0x51ce('0x2b')][_0x51ce('0x1d')](_0x270d10)[_0x51ce('0x3f')](function(_0x403856){_0x10eaff[_0x51ce('0x1d')]=_0x403856;if(_0x5e9f0e['query'][_0x51ce('0x40')]){_0x16490b['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x51ce('0x41')](_0x16490b);})['then'](function(_0x46c47a){_0x10eaff[_0x51ce('0x42')]=_0x46c47a;return _0x10eaff;})[_0x51ce('0x3f')](respondWithFilteredResult(_0x3ee41b,_0x16490b))['catch'](handleError(_0x3ee41b,null));};exports[_0x51ce('0x43')]=function(_0x4cf529,_0x15f1c5){var _0x42dac3={'raw':!![],'where':{'id':_0x4cf529[_0x51ce('0x44')]['id']}},_0x1c3fd7={};_0x1c3fd7[_0x51ce('0x33')]=_[_0x51ce('0x45')](db[_0x51ce('0x2b')]['rawAttributes']);_0x1c3fd7[_0x51ce('0x30')]=_[_0x51ce('0x45')](_0x4cf529['query']);_0x1c3fd7[_0x51ce('0x31')]=_['intersection'](_0x1c3fd7[_0x51ce('0x33')],_0x1c3fd7[_0x51ce('0x30')]);_0x42dac3[_0x51ce('0x35')]=_['intersection'](_0x1c3fd7[_0x51ce('0x33')],qs[_0x51ce('0x34')](_0x4cf529['query']['fields']));_0x42dac3[_0x51ce('0x35')]=_0x42dac3[_0x51ce('0x35')][_0x51ce('0x46')]?_0x42dac3[_0x51ce('0x35')]:_0x1c3fd7[_0x51ce('0x33')];if(_0x4cf529[_0x51ce('0x30')][_0x51ce('0x40')]){_0x42dac3['include']=[{'all':!![]}];}_0x42dac3=_['merge']({},_0x42dac3,_0x4cf529[_0x51ce('0x47')]);return db[_0x51ce('0x2b')][_0x51ce('0x48')](_0x42dac3)['then'](handleEntityNotFound(_0x15f1c5,null))[_0x51ce('0x3f')](respondWithResult(_0x15f1c5,null))[_0x51ce('0x49')](handleError(_0x15f1c5,null));};exports[_0x51ce('0x4a')]=function(_0x1e375e,_0x579578){return db[_0x51ce('0x2b')]['create'](_0x1e375e[_0x51ce('0x4b')],{})['then'](respondWithResult(_0x579578,0xc9))[_0x51ce('0x49')](handleError(_0x579578,null));};exports['update']=function(_0x295c39,_0x265c15){if(_0x295c39[_0x51ce('0x4b')]['id']){delete _0x295c39['body']['id'];}return db[_0x51ce('0x2b')]['find']({'where':{'id':_0x295c39[_0x51ce('0x44')]['id']}})[_0x51ce('0x3f')](handleEntityNotFound(_0x265c15,null))[_0x51ce('0x3f')](saveUpdates(_0x295c39['body'],null))[_0x51ce('0x3f')](respondWithResult(_0x265c15,null))[_0x51ce('0x49')](handleError(_0x265c15,null));};exports[_0x51ce('0x4c')]=function(_0xc774a4,_0x29c668){return db[_0x51ce('0x2b')][_0x51ce('0x48')]({'where':{'id':_0xc774a4[_0x51ce('0x44')]['id']}})[_0x51ce('0x3f')](handleEntityNotFound(_0x29c668,null))[_0x51ce('0x3f')](removeEntity(_0x29c668,null))[_0x51ce('0x49')](handleError(_0x29c668,null));};exports['describe']=function(_0x15fdd9,_0x5f23b0){return db['JscriptyQuestionReport'][_0x51ce('0x4d')]()[_0x51ce('0x3f')](respondWithResult(_0x5f23b0,null))[_0x51ce('0x49')](handleError(_0x5f23b0,null));}; \ No newline at end of file +var _0x5d2e=['apply','reject','save','update','destroy','error','stack','name','index','JscriptyQuestionReport','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','then','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set'];(function(_0x4bbbbd,_0x5ead99){var _0x53e82c=function(_0x3faaaa){while(--_0x3faaaa){_0x4bbbbd['push'](_0x4bbbbd['shift']());}};_0x53e82c(++_0x5ead99);}(_0x5d2e,0x1cb));var _0xe5d2=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x5d2e[_0x2e4aa2];return _0x5e6092;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe5d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5d2('0x2'));var moment=require(_0xe5d2('0x3'));var BPromise=require(_0xe5d2('0x4'));var Mustache=require(_0xe5d2('0x5'));var util=require(_0xe5d2('0x6'));var path=require(_0xe5d2('0x7'));var sox=require(_0xe5d2('0x8'));var csv=require(_0xe5d2('0x9'));var ejs=require(_0xe5d2('0xa'));var fs=require('fs');var _=require(_0xe5d2('0xb'));var squel=require(_0xe5d2('0xc'));var crypto=require(_0xe5d2('0xd'));var jsforce=require(_0xe5d2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe5d2('0x9'));var querystring=require(_0xe5d2('0xf'));var Papa=require('papaparse');var Redis=require(_0xe5d2('0x10'));var authService=require(_0xe5d2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5d2('0x12'));var logger=require(_0xe5d2('0x13'))(_0xe5d2('0x14'));var utils=require(_0xe5d2('0x15'));var config=require(_0xe5d2('0x16'));var db=require(_0xe5d2('0x17'))['db'];function respondWithStatusCode(_0x1669ec,_0x3d3b25){_0x3d3b25=_0x3d3b25||0xcc;return function(_0x85da7c){if(_0x85da7c){return _0x1669ec[_0xe5d2('0x18')](_0x3d3b25);}return _0x1669ec[_0xe5d2('0x19')](_0x3d3b25)[_0xe5d2('0x1a')]();};}function respondWithResult(_0x20046a,_0x1eac4b){_0x1eac4b=_0x1eac4b||0xc8;return function(_0x5037fe){if(_0x5037fe){return _0x20046a[_0xe5d2('0x19')](_0x1eac4b)[_0xe5d2('0x1b')](_0x5037fe);}};}function respondWithFilteredResult(_0x26e501,_0x178aa2){return function(_0x5627f3){if(_0x5627f3){var _0x16c9fe=_0x5627f3['count'],_0x4c12d9=_0x178aa2[_0xe5d2('0x1c')],_0xb51aec=_0x178aa2['offset']+_0x178aa2[_0xe5d2('0x1d')],_0x5a0594;if(_0xb51aec>=_0x16c9fe){_0xb51aec=_0x16c9fe;_0x5a0594=0xc8;}else{_0x5a0594=0xce;}_0x26e501[_0xe5d2('0x19')](_0x5a0594);return _0x26e501[_0xe5d2('0x1e')]('Content-Range',_0x4c12d9+'-'+_0xb51aec+'/'+_0x16c9fe)[_0xe5d2('0x1b')](_0x5627f3);}return null;};}function patchUpdates(_0x47b54b){return function(_0x45380d){try{jsonpatch[_0xe5d2('0x1f')](_0x45380d,_0x47b54b,!![]);}catch(_0x5dfcc0){return BPromise[_0xe5d2('0x20')](_0x5dfcc0);}return _0x45380d[_0xe5d2('0x21')]();};}function saveUpdates(_0x5564ce,_0x1f651e){return function(_0x1ba4fc){if(_0x1ba4fc){return _0x1ba4fc[_0xe5d2('0x22')](_0x5564ce)['then'](function(_0x24d011){return _0x24d011;});}return null;};}function removeEntity(_0x578451,_0x196705){return function(_0x596053){if(_0x596053){return _0x596053[_0xe5d2('0x23')]()['then'](function(){_0x578451[_0xe5d2('0x19')](0xcc)[_0xe5d2('0x1a')]();});}};}function handleEntityNotFound(_0x398c47,_0x37cf66){return function(_0x355599){if(!_0x355599){_0x398c47[_0xe5d2('0x18')](0x194);}return _0x355599;};}function handleError(_0x434046,_0x10a3c3){_0x10a3c3=_0x10a3c3||0x1f4;return function(_0x36e31a){logger[_0xe5d2('0x24')](_0x36e31a[_0xe5d2('0x25')]);if(_0x36e31a['name']){delete _0x36e31a[_0xe5d2('0x26')];}_0x434046[_0xe5d2('0x19')](_0x10a3c3)['send'](_0x36e31a);};}exports[_0xe5d2('0x27')]=function(_0x2fbcc9,_0x1773bc){var _0x1cb793={},_0x488cd6={},_0xc9c868={'count':0x0,'rows':[]};var _0x20d8a5=_['map'](db[_0xe5d2('0x28')]['rawAttributes'],function(_0x42985c){return{'name':_0x42985c['fieldName'],'type':_0x42985c[_0xe5d2('0x29')][_0xe5d2('0x2a')]};});_0x488cd6['model']=_[_0xe5d2('0x2b')](_0x20d8a5,_0xe5d2('0x26'));_0x488cd6[_0xe5d2('0x2c')]=_[_0xe5d2('0x2d')](_0x2fbcc9[_0xe5d2('0x2c')]);_0x488cd6[_0xe5d2('0x2e')]=_[_0xe5d2('0x2f')](_0x488cd6[_0xe5d2('0x30')],_0x488cd6[_0xe5d2('0x2c')]);_0x1cb793[_0xe5d2('0x31')]=_[_0xe5d2('0x2f')](_0x488cd6[_0xe5d2('0x30')],qs['fields'](_0x2fbcc9[_0xe5d2('0x2c')][_0xe5d2('0x32')]));_0x1cb793[_0xe5d2('0x31')]=_0x1cb793['attributes'][_0xe5d2('0x33')]?_0x1cb793[_0xe5d2('0x31')]:_0x488cd6[_0xe5d2('0x30')];if(!_0x2fbcc9['query']['hasOwnProperty'](_0xe5d2('0x34'))){_0x1cb793['limit']=qs[_0xe5d2('0x1d')](_0x2fbcc9[_0xe5d2('0x2c')]['limit']);_0x1cb793[_0xe5d2('0x1c')]=qs[_0xe5d2('0x1c')](_0x2fbcc9[_0xe5d2('0x2c')][_0xe5d2('0x1c')]);}_0x1cb793[_0xe5d2('0x35')]=qs[_0xe5d2('0x36')](_0x2fbcc9[_0xe5d2('0x2c')][_0xe5d2('0x36')]);_0x1cb793[_0xe5d2('0x37')]=qs[_0xe5d2('0x2e')](_[_0xe5d2('0x38')](_0x2fbcc9[_0xe5d2('0x2c')],_0x488cd6[_0xe5d2('0x2e')]));if(_0x2fbcc9[_0xe5d2('0x2c')][_0xe5d2('0x39')]){_0x1cb793[_0xe5d2('0x37')]=_['merge'](_0x1cb793[_0xe5d2('0x37')],{'$or':_[_0xe5d2('0x2b')](_0x20d8a5,function(_0x1c7a2a){if(_0x1c7a2a['type']!=='VIRTUAL'){var _0x25cf5c={};_0x25cf5c[_0x1c7a2a[_0xe5d2('0x26')]]={'$like':'%'+_0x2fbcc9['query'][_0xe5d2('0x39')]+'%'};return _0x25cf5c;}})});}_0x1cb793=_['merge']({},_0x1cb793,_0x2fbcc9['options']);var _0x241c23={'where':_0x1cb793[_0xe5d2('0x37')]};return db[_0xe5d2('0x28')]['count'](_0x241c23)[_0xe5d2('0x3a')](function(_0x1dbc10){_0xc9c868[_0xe5d2('0x3b')]=_0x1dbc10;if(_0x2fbcc9[_0xe5d2('0x2c')][_0xe5d2('0x3c')]){_0x1cb793[_0xe5d2('0x3d')]=[{'all':!![]}];}return db[_0xe5d2('0x28')][_0xe5d2('0x3e')](_0x1cb793);})['then'](function(_0xfa9733){_0xc9c868['rows']=_0xfa9733;return _0xc9c868;})['then'](respondWithFilteredResult(_0x1773bc,_0x1cb793))[_0xe5d2('0x3f')](handleError(_0x1773bc,null));};exports[_0xe5d2('0x40')]=function(_0x56fbf4,_0x1dcad2){var _0x5dc157={'raw':!![],'where':{'id':_0x56fbf4[_0xe5d2('0x41')]['id']}},_0x2000b8={};_0x2000b8[_0xe5d2('0x30')]=_[_0xe5d2('0x2d')](db['JscriptyQuestionReport'][_0xe5d2('0x42')]);_0x2000b8[_0xe5d2('0x2c')]=_[_0xe5d2('0x2d')](_0x56fbf4[_0xe5d2('0x2c')]);_0x2000b8[_0xe5d2('0x2e')]=_['intersection'](_0x2000b8[_0xe5d2('0x30')],_0x2000b8[_0xe5d2('0x2c')]);_0x5dc157[_0xe5d2('0x31')]=_['intersection'](_0x2000b8[_0xe5d2('0x30')],qs['fields'](_0x56fbf4[_0xe5d2('0x2c')][_0xe5d2('0x32')]));_0x5dc157[_0xe5d2('0x31')]=_0x5dc157[_0xe5d2('0x31')][_0xe5d2('0x33')]?_0x5dc157[_0xe5d2('0x31')]:_0x2000b8[_0xe5d2('0x30')];if(_0x56fbf4[_0xe5d2('0x2c')][_0xe5d2('0x3c')]){_0x5dc157[_0xe5d2('0x3d')]=[{'all':!![]}];}_0x5dc157=_['merge']({},_0x5dc157,_0x56fbf4['options']);return db[_0xe5d2('0x28')][_0xe5d2('0x43')](_0x5dc157)[_0xe5d2('0x3a')](handleEntityNotFound(_0x1dcad2,null))[_0xe5d2('0x3a')](respondWithResult(_0x1dcad2,null))[_0xe5d2('0x3f')](handleError(_0x1dcad2,null));};exports['create']=function(_0x2f1f19,_0x10f0d5){return db['JscriptyQuestionReport'][_0xe5d2('0x44')](_0x2f1f19[_0xe5d2('0x45')],{})[_0xe5d2('0x3a')](respondWithResult(_0x10f0d5,0xc9))[_0xe5d2('0x3f')](handleError(_0x10f0d5,null));};exports['update']=function(_0x2151f1,_0x30eb62){if(_0x2151f1[_0xe5d2('0x45')]['id']){delete _0x2151f1[_0xe5d2('0x45')]['id'];}return db[_0xe5d2('0x28')][_0xe5d2('0x43')]({'where':{'id':_0x2151f1[_0xe5d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x30eb62,null))[_0xe5d2('0x3a')](saveUpdates(_0x2151f1[_0xe5d2('0x45')],null))[_0xe5d2('0x3a')](respondWithResult(_0x30eb62,null))['catch'](handleError(_0x30eb62,null));};exports['destroy']=function(_0x50f3d8,_0x4920be){return db[_0xe5d2('0x28')][_0xe5d2('0x43')]({'where':{'id':_0x50f3d8[_0xe5d2('0x41')]['id']}})[_0xe5d2('0x3a')](handleEntityNotFound(_0x4920be,null))[_0xe5d2('0x3a')](removeEntity(_0x4920be,null))[_0xe5d2('0x3f')](handleError(_0x4920be,null));};exports['describe']=function(_0x599fc4,_0x5543c3){return db[_0xe5d2('0x28')]['describe']()[_0xe5d2('0x3a')](respondWithResult(_0x5543c3,null))['catch'](handleError(_0x5543c3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index d81ba3a..6ed6c9b 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 _0xcae6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x374325,_0x5c034e){var _0x202433=function(_0x24d47d){while(--_0x24d47d){_0x374325['push'](_0x374325['shift']());}};_0x202433(++_0x5c034e);}(_0xcae6,0x1ae));var _0x6cae=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcae6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var logger=require('../../config/logger')(_0x6cae('0x2'));var moment=require(_0x6cae('0x3'));var BPromise=require(_0x6cae('0x4'));var rp=require(_0x6cae('0x5'));var fs=require('fs');var path=require(_0x6cae('0x6'));var rimraf=require(_0x6cae('0x7'));var config=require(_0x6cae('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x6cae('0x9')]=function(_0x2683e6,_0x3e336b){return _0x2683e6['define'](_0x6cae('0xa'),attributes,{'tableName':_0x6cae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a86=['../../config/logger','api','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1a86,0x1a3));var _0x61a8=function(_0x4eaf05,_0x4ade11){_0x4eaf05=_0x4eaf05-0x0;var _0x480e22=_0x1a86[_0x4eaf05];return _0x480e22;};'use strict';var _=require(_0x61a8('0x0'));var util=require('util');var logger=require(_0x61a8('0x1'))(_0x61a8('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(_0x61a8('0x3'));var config=require(_0x61a8('0x4'));var attributes=require(_0x61a8('0x5'));module[_0x61a8('0x6')]=function(_0x3a9fa9,_0x4c8405){return _0x3a9fa9[_0x61a8('0x7')](_0x61a8('0x8'),attributes,{'tableName':_0x61a8('0x9'),'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 ddb5e23..27d7b73 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 _0xa221=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','moment','bluebird','randomstring','ioredis'];(function(_0x4e3e39,_0xc02f71){var _0x5d7ca3=function(_0x4e8f83){while(--_0x4e8f83){_0x4e3e39['push'](_0x4e3e39['shift']());}};_0x5d7ca3(++_0xc02f71);}(_0xa221,0x106));var _0x1a22=function(_0x277754,_0xf83219){_0x277754=_0x277754-0x0;var _0x174e78=_0xa221[_0x277754];return _0x174e78;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1a22('0x0'));var BPromise=require(_0x1a22('0x1'));var rs=require(_0x1a22('0x2'));var fs=require('fs');var Redis=require(_0x1a22('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a22('0x4'));var logger=require(_0x1a22('0x5'))(_0x1a22('0x6'));var config=require(_0x1a22('0x7'));var jayson=require(_0x1a22('0x8'));var client=jayson[_0x1a22('0x9')][_0x1a22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286b25,_0x5bef29,_0x86f9a6){return new BPromise(function(_0x1c217b,_0x28acfe){return client[_0x1a22('0xb')](_0x286b25,_0x86f9a6)['then'](function(_0x1f32bd){logger[_0x1a22('0xc')](_0x1a22('0xd'),_0x5bef29,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5bef29,_0x1a22('0xe'),JSON[_0x1a22('0xf')](_0x1f32bd));if(_0x1f32bd[_0x1a22('0x10')]){if(_0x1f32bd[_0x1a22('0x10')]['code']===0x1f4){logger['error'](_0x1a22('0xd'),_0x5bef29,_0x1f32bd['error'][_0x1a22('0x11')]);return _0x28acfe(_0x1f32bd[_0x1a22('0x10')][_0x1a22('0x11')]);}logger[_0x1a22('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5bef29,_0x1f32bd['error'][_0x1a22('0x11')]);return _0x1c217b(_0x1f32bd['error'][_0x1a22('0x11')]);}else{logger[_0x1a22('0xc')](_0x1a22('0xd'),_0x5bef29,_0x1a22('0xe'));_0x1c217b(_0x1f32bd['result'][_0x1a22('0x11')]);}})[_0x1a22('0x12')](function(_0x173187){logger[_0x1a22('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5bef29,_0x173187);_0x28acfe(_0x173187);});});} \ No newline at end of file +var _0x33ed=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x22a1b6,_0x30e2be){var _0xbd7b2c=function(_0x1516ff){while(--_0x1516ff){_0x22a1b6['push'](_0x22a1b6['shift']());}};_0xbd7b2c(++_0x30e2be);}(_0x33ed,0x127));var _0xd33e=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x33ed[_0x4f431d];return _0x4f31e1;};'use strict';var _=require('lodash');var util=require(_0xd33e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd33e('0x1'));var fs=require('fs');var Redis=require(_0xd33e('0x2'));var db=require(_0xd33e('0x3'))['db'];var utils=require(_0xd33e('0x4'));var logger=require(_0xd33e('0x5'))(_0xd33e('0x6'));var config=require(_0xd33e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd33e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x352e8b,_0x5dbb34,_0x340413){return new BPromise(function(_0x2901e7,_0x133e28){return client[_0xd33e('0x9')](_0x352e8b,_0x340413)[_0xd33e('0xa')](function(_0x2250e9){logger['info'](_0xd33e('0xb'),_0x5dbb34,_0xd33e('0xc'));logger[_0xd33e('0xd')](_0xd33e('0xe'),_0x5dbb34,_0xd33e('0xc'),JSON[_0xd33e('0xf')](_0x2250e9));if(_0x2250e9[_0xd33e('0x10')]){if(_0x2250e9['error'][_0xd33e('0x11')]===0x1f4){logger[_0xd33e('0x10')](_0xd33e('0xb'),_0x5dbb34,_0x2250e9[_0xd33e('0x10')][_0xd33e('0x12')]);return _0x133e28(_0x2250e9['error'][_0xd33e('0x12')]);}logger[_0xd33e('0x10')](_0xd33e('0xb'),_0x5dbb34,_0x2250e9[_0xd33e('0x10')][_0xd33e('0x12')]);return _0x2901e7(_0x2250e9[_0xd33e('0x10')][_0xd33e('0x12')]);}else{logger[_0xd33e('0x13')](_0xd33e('0xb'),_0x5dbb34,_0xd33e('0xc'));_0x2901e7(_0x2250e9['result'][_0xd33e('0x12')]);}})[_0xd33e('0x14')](function(_0x4c886e){logger[_0xd33e('0x10')](_0xd33e('0xb'),_0x5dbb34,_0x4c886e);_0x133e28(_0x4c886e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 1869a80..6d434f1 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 _0x032e=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','post','create','put','update','destroy','exports','multer','path'];(function(_0x3c57c5,_0x1bcd12){var _0x3a2ac9=function(_0x185475){while(--_0x185475){_0x3c57c5['push'](_0x3c57c5['shift']());}};_0x3a2ac9(++_0x1bcd12);}(_0x032e,0x124));var _0xe032=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x032e[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0x7')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0xd')]);router[_0xe032('0x7')](_0xe032('0xe'),auth[_0xe032('0x8')](),controller['getQuestions']);router[_0xe032('0xf')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x11')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0x12')]);router['delete'](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0x13')]);module[_0xe032('0x14')]=router; \ No newline at end of file +var _0x1670=['getQuestions','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','/:id/questions'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1670,0x9a));var _0x0167=function(_0x351cbd,_0x11342b){_0x351cbd=_0x351cbd-0x0;var _0x164e92=_0x1670[_0x351cbd];return _0x164e92;};'use strict';var multer=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var path=require('path');var timeout=require(_0x0167('0x2'));var express=require('express');var router=express[_0x0167('0x3')]();var auth=require(_0x0167('0x4'));var interaction=require(_0x0167('0x5'));var config=require(_0x0167('0x6'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x0167('0x7')](),controller[_0x0167('0x8')]);router[_0x0167('0x9')](_0x0167('0xa'),auth[_0x0167('0x7')](),controller[_0x0167('0xb')]);router[_0x0167('0x9')](_0x0167('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0167('0x9')](_0x0167('0xd'),auth[_0x0167('0x7')](),controller[_0x0167('0xe')]);router[_0x0167('0xf')]('/',auth[_0x0167('0x7')](),controller[_0x0167('0x10')]);router[_0x0167('0x11')](_0x0167('0xc'),auth[_0x0167('0x7')](),controller[_0x0167('0x12')]);router[_0x0167('0x13')](_0x0167('0xc'),auth[_0x0167('0x7')](),controller['destroy']);module[_0x0167('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 aa3ef46..3d9737b 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 _0xad21=['moment','sequelize','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x16108c,_0x88d9db){var _0xc6c9fa=function(_0x50c293){while(--_0x50c293){_0x16108c['push'](_0x16108c['shift']());}};_0xc6c9fa(++_0x88d9db);}(_0xad21,0x1cc));var _0x1ad2=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0xad21[_0x24392f];return _0x591e33;};'use strict';var moment=require(_0x1ad2('0x0'));var Sequelize=require(_0x1ad2('0x1'));module[_0x1ad2('0x2')]={'starttime':{'type':Sequelize[_0x1ad2('0x3')],'set':function(_0x1f58ad){this[_0x1ad2('0x4')](_0x1ad2('0x5'),_0x1f58ad);this['setDataValue']('endtime',moment()[_0x1ad2('0x6')](_0x1ad2('0x7')));}},'endtime':{'type':Sequelize[_0x1ad2('0x3')]},'membername':{'type':Sequelize[_0x1ad2('0x8')]},'projectname':{'type':Sequelize[_0x1ad2('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1ad2('0x8')]},'calleridname':{'type':Sequelize[_0x1ad2('0x8')]},'calleridnum':{'type':Sequelize[_0x1ad2('0x8')]},'completed':{'type':Sequelize[_0x1ad2('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xe567=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE','setDataValue','starttime'];(function(_0x50ae81,_0x14abe4){var _0x593328=function(_0xb43b69){while(--_0xb43b69){_0x50ae81['push'](_0x50ae81['shift']());}};_0x593328(++_0x14abe4);}(_0xe567,0x175));var _0x7e56=function(_0x5103c5,_0x33dfbf){_0x5103c5=_0x5103c5-0x0;var _0x10ef56=_0xe567[_0x5103c5];return _0x10ef56;};'use strict';var moment=require(_0x7e56('0x0'));var Sequelize=require('sequelize');module[_0x7e56('0x1')]={'starttime':{'type':Sequelize[_0x7e56('0x2')],'set':function(_0x58ab6f){this[_0x7e56('0x3')](_0x7e56('0x4'),_0x58ab6f);this[_0x7e56('0x3')](_0x7e56('0x5'),moment()[_0x7e56('0x6')](_0x7e56('0x7')));}},'endtime':{'type':Sequelize[_0x7e56('0x2')]},'membername':{'type':Sequelize[_0x7e56('0x8')]},'projectname':{'type':Sequelize[_0x7e56('0x8')]},'queue':{'type':Sequelize[_0x7e56('0x8')]},'uniqueid':{'type':Sequelize[_0x7e56('0x8')]},'calleridname':{'type':Sequelize[_0x7e56('0x8')]},'calleridnum':{'type':Sequelize[_0x7e56('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 8ea2fe2..d0a19f1 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 _0x1328=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','getQuestions','nolimit','order','pick','SessionId','JscriptyQuestionReport','html-pdf','eml-format','rimraf'];(function(_0x2f864d,_0x4ff703){var _0xf7b7e3=function(_0x2c5297){while(--_0x2c5297){_0x2f864d['push'](_0x2f864d['shift']());}};_0xf7b7e3(++_0x4ff703);}(_0x1328,0xea));var _0x8132=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x1328[_0x43d16c];return _0x208cce;};'use strict';var pdf=require(_0x8132('0x0'));var emlformat=require(_0x8132('0x1'));var rimraf=require(_0x8132('0x2'));var zipdir=require(_0x8132('0x3'));var jsonpatch=require(_0x8132('0x4'));var rp=require(_0x8132('0x5'));var moment=require(_0x8132('0x6'));var BPromise=require(_0x8132('0x7'));var Mustache=require(_0x8132('0x8'));var util=require('util');var path=require(_0x8132('0x9'));var sox=require(_0x8132('0xa'));var csv=require(_0x8132('0xb'));var ejs=require(_0x8132('0xc'));var fs=require('fs');var _=require(_0x8132('0xd'));var squel=require(_0x8132('0xe'));var crypto=require(_0x8132('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8132('0xb'));var querystring=require(_0x8132('0x10'));var Papa=require(_0x8132('0x11'));var Redis=require(_0x8132('0x12'));var authService=require(_0x8132('0x13'));var qs=require(_0x8132('0x14'));var as=require(_0x8132('0x15'));var hardwareService=require(_0x8132('0x16'));var logger=require('../../config/logger')(_0x8132('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4af930,_0x53c01f){_0x53c01f=_0x53c01f||0xcc;return function(_0x28a111){if(_0x28a111){return _0x4af930[_0x8132('0x18')](_0x53c01f);}return _0x4af930['status'](_0x53c01f)[_0x8132('0x19')]();};}function respondWithResult(_0x4284fb,_0x167716){_0x167716=_0x167716||0xc8;return function(_0x24ee01){if(_0x24ee01){return _0x4284fb[_0x8132('0x1a')](_0x167716)[_0x8132('0x1b')](_0x24ee01);}};}function respondWithFilteredResult(_0x5134ee,_0x3159b4){return function(_0x22d92e){if(_0x22d92e){var _0x202f40=_0x22d92e[_0x8132('0x1c')],_0x1d4d4e=_0x3159b4['offset'],_0x5de901=_0x3159b4[_0x8132('0x1d')]+_0x3159b4['limit'],_0x4e9bb9;if(_0x5de901>=_0x202f40){_0x5de901=_0x202f40;_0x4e9bb9=0xc8;}else{_0x4e9bb9=0xce;}_0x5134ee['status'](_0x4e9bb9);return _0x5134ee['set'](_0x8132('0x1e'),_0x1d4d4e+'-'+_0x5de901+'/'+_0x202f40)[_0x8132('0x1b')](_0x22d92e);}return null;};}function patchUpdates(_0x10632f){return function(_0x4c7fcc){try{jsonpatch[_0x8132('0x1f')](_0x4c7fcc,_0x10632f,!![]);}catch(_0xb55536){return BPromise[_0x8132('0x20')](_0xb55536);}return _0x4c7fcc[_0x8132('0x21')]();};}function saveUpdates(_0x57e974,_0x3c38b8){return function(_0x227cca){if(_0x227cca){return _0x227cca[_0x8132('0x22')](_0x57e974)[_0x8132('0x23')](function(_0x2df0f2){return _0x2df0f2;});}return null;};}function removeEntity(_0x53314c,_0xdadc4c){return function(_0x3bdd37){if(_0x3bdd37){return _0x3bdd37[_0x8132('0x24')]()[_0x8132('0x23')](function(){_0x53314c['status'](0xcc)[_0x8132('0x19')]();});}};}function handleEntityNotFound(_0x1b693c,_0x5aba3a){return function(_0x4d6056){if(!_0x4d6056){_0x1b693c[_0x8132('0x18')](0x194);}return _0x4d6056;};}function handleError(_0x979327,_0x293718){_0x293718=_0x293718||0x1f4;return function(_0x1cc73b){logger[_0x8132('0x25')](_0x1cc73b[_0x8132('0x26')]);if(_0x1cc73b[_0x8132('0x27')]){delete _0x1cc73b[_0x8132('0x27')];}_0x979327[_0x8132('0x1a')](_0x293718)['send'](_0x1cc73b);};}exports[_0x8132('0x28')]=function(_0x377175,_0x6e1398){var _0x2cb8c8={},_0x572be9={},_0x17ea07={'count':0x0,'rows':[]};var _0x1b5121=_[_0x8132('0x29')](db[_0x8132('0x2a')][_0x8132('0x2b')],function(_0x3920dd){return{'name':_0x3920dd['fieldName'],'type':_0x3920dd[_0x8132('0x2c')][_0x8132('0x2d')]};});_0x572be9[_0x8132('0x2e')]=_[_0x8132('0x29')](_0x1b5121,_0x8132('0x27'));_0x572be9[_0x8132('0x2f')]=_[_0x8132('0x30')](_0x377175[_0x8132('0x2f')]);_0x572be9[_0x8132('0x31')]=_[_0x8132('0x32')](_0x572be9['model'],_0x572be9['query']);_0x2cb8c8[_0x8132('0x33')]=_[_0x8132('0x32')](_0x572be9[_0x8132('0x2e')],qs[_0x8132('0x34')](_0x377175['query'][_0x8132('0x34')]));_0x2cb8c8[_0x8132('0x33')]=_0x2cb8c8['attributes'][_0x8132('0x35')]?_0x2cb8c8[_0x8132('0x33')]:_0x572be9[_0x8132('0x2e')];if(!_0x377175['query'][_0x8132('0x36')]('nolimit')){_0x2cb8c8[_0x8132('0x37')]=qs['limit'](_0x377175[_0x8132('0x2f')]['limit']);_0x2cb8c8[_0x8132('0x1d')]=qs[_0x8132('0x1d')](_0x377175[_0x8132('0x2f')]['offset']);}_0x2cb8c8['order']=qs[_0x8132('0x38')](_0x377175[_0x8132('0x2f')][_0x8132('0x38')]);_0x2cb8c8[_0x8132('0x39')]=qs[_0x8132('0x31')](_['pick'](_0x377175[_0x8132('0x2f')],_0x572be9[_0x8132('0x31')]));if(_0x377175[_0x8132('0x2f')]['filter']){_0x2cb8c8[_0x8132('0x39')]=_['merge'](_0x2cb8c8[_0x8132('0x39')],{'$or':_['map'](_0x1b5121,function(_0x5d78f5){if(_0x5d78f5[_0x8132('0x2c')]!==_0x8132('0x3a')){var _0x498bbd={};_0x498bbd[_0x5d78f5[_0x8132('0x27')]]={'$like':'%'+_0x377175['query'][_0x8132('0x3b')]+'%'};return _0x498bbd;}})});}_0x2cb8c8=_[_0x8132('0x3c')]({},_0x2cb8c8,_0x377175[_0x8132('0x3d')]);var _0x18487d={'where':_0x2cb8c8[_0x8132('0x39')]};return db['JscriptySessionReport'][_0x8132('0x1c')](_0x18487d)[_0x8132('0x23')](function(_0x3a70da){_0x17ea07[_0x8132('0x1c')]=_0x3a70da;if(_0x377175[_0x8132('0x2f')]['includeAll']){_0x2cb8c8[_0x8132('0x3e')]=[{'all':!![]}];}return db[_0x8132('0x2a')][_0x8132('0x3f')](_0x2cb8c8);})['then'](function(_0x16da48){_0x17ea07[_0x8132('0x40')]=_0x16da48;return _0x17ea07;})[_0x8132('0x23')](respondWithFilteredResult(_0x6e1398,_0x2cb8c8))[_0x8132('0x41')](handleError(_0x6e1398,null));};exports[_0x8132('0x42')]=function(_0x5e7a7c,_0x4ba3cb){var _0xc716d7={'raw':!![],'where':{'id':_0x5e7a7c[_0x8132('0x43')]['id']}},_0x380c60={};_0x380c60[_0x8132('0x2e')]=_[_0x8132('0x30')](db[_0x8132('0x2a')]['rawAttributes']);_0x380c60[_0x8132('0x2f')]=_[_0x8132('0x30')](_0x5e7a7c['query']);_0x380c60[_0x8132('0x31')]=_[_0x8132('0x32')](_0x380c60[_0x8132('0x2e')],_0x380c60['query']);_0xc716d7[_0x8132('0x33')]=_[_0x8132('0x32')](_0x380c60[_0x8132('0x2e')],qs[_0x8132('0x34')](_0x5e7a7c[_0x8132('0x2f')][_0x8132('0x34')]));_0xc716d7[_0x8132('0x33')]=_0xc716d7[_0x8132('0x33')][_0x8132('0x35')]?_0xc716d7[_0x8132('0x33')]:_0x380c60[_0x8132('0x2e')];if(_0x5e7a7c[_0x8132('0x2f')][_0x8132('0x44')]){_0xc716d7[_0x8132('0x3e')]=[{'all':!![]}];}_0xc716d7=_[_0x8132('0x3c')]({},_0xc716d7,_0x5e7a7c[_0x8132('0x3d')]);return db[_0x8132('0x2a')][_0x8132('0x45')](_0xc716d7)[_0x8132('0x23')](handleEntityNotFound(_0x4ba3cb,null))[_0x8132('0x23')](respondWithResult(_0x4ba3cb,null))[_0x8132('0x41')](handleError(_0x4ba3cb,null));};exports[_0x8132('0x46')]=function(_0x2e2778,_0x11b32b){return db[_0x8132('0x2a')][_0x8132('0x46')](_0x2e2778[_0x8132('0x47')],{})[_0x8132('0x23')](respondWithResult(_0x11b32b,0xc9))[_0x8132('0x41')](handleError(_0x11b32b,null));};exports[_0x8132('0x22')]=function(_0x26db46,_0x19aa90){if(_0x26db46['body']['id']){delete _0x26db46['body']['id'];}return db['JscriptySessionReport'][_0x8132('0x45')]({'where':{'id':_0x26db46[_0x8132('0x43')]['id']}})[_0x8132('0x23')](handleEntityNotFound(_0x19aa90,null))[_0x8132('0x23')](saveUpdates(_0x26db46[_0x8132('0x47')],null))['then'](respondWithResult(_0x19aa90,null))[_0x8132('0x41')](handleError(_0x19aa90,null));};exports[_0x8132('0x24')]=function(_0x50b24f,_0x192035){return db[_0x8132('0x2a')][_0x8132('0x45')]({'where':{'id':_0x50b24f[_0x8132('0x43')]['id']}})[_0x8132('0x23')](handleEntityNotFound(_0x192035,null))['then'](removeEntity(_0x192035,null))[_0x8132('0x41')](handleError(_0x192035,null));};exports[_0x8132('0x48')]=function(_0x5581e3,_0x212a4c){return db[_0x8132('0x2a')]['describe']()[_0x8132('0x23')](respondWithResult(_0x212a4c,null))[_0x8132('0x41')](handleError(_0x212a4c,null));};exports[_0x8132('0x49')]=function(_0x1b5620,_0x2ca8b7,_0x102ae3){var _0x520a54={'raw':!![],'where':{}};var _0x3039ec={};var _0x165923={'count':0x0,'rows':[]};return db[_0x8132('0x2a')]['findOne']({'where':{'id':_0x1b5620[_0x8132('0x43')]['id']}})[_0x8132('0x23')](handleEntityNotFound(_0x2ca8b7,null))[_0x8132('0x23')](function(_0x2cae2e){if(_0x2cae2e){_0x3039ec[_0x8132('0x2e')]=_[_0x8132('0x30')](db['JscriptyQuestionReport'][_0x8132('0x2b')]);_0x3039ec[_0x8132('0x2f')]=_[_0x8132('0x30')](_0x1b5620[_0x8132('0x2f')]);_0x3039ec['filters']=_[_0x8132('0x32')](_0x3039ec['model'],_0x3039ec[_0x8132('0x2f')]);_0x520a54[_0x8132('0x33')]=_[_0x8132('0x32')](_0x3039ec[_0x8132('0x2e')],qs['fields'](_0x1b5620[_0x8132('0x2f')]['fields']));_0x520a54[_0x8132('0x33')]=_0x520a54[_0x8132('0x33')]['length']?_0x520a54[_0x8132('0x33')]:_0x3039ec['model'];if(!_0x1b5620['query'][_0x8132('0x36')](_0x8132('0x4a'))){_0x520a54['limit']=qs[_0x8132('0x37')](_0x1b5620[_0x8132('0x2f')][_0x8132('0x37')]);_0x520a54[_0x8132('0x1d')]=qs['offset'](_0x1b5620['query'][_0x8132('0x1d')]);}_0x520a54[_0x8132('0x4b')]=qs[_0x8132('0x38')](_0x1b5620[_0x8132('0x2f')][_0x8132('0x38')]);_0x520a54[_0x8132('0x39')]=qs[_0x8132('0x31')](_[_0x8132('0x4c')](_0x1b5620[_0x8132('0x2f')],_0x3039ec['filters']));_0x520a54[_0x8132('0x39')][_0x8132('0x4d')]=_0x2cae2e['id'];if(_0x1b5620['query'][_0x8132('0x3b')]){_0x520a54[_0x8132('0x39')]=_[_0x8132('0x3c')](_0x520a54[_0x8132('0x39')],{'$or':_[_0x8132('0x29')](_0x520a54[_0x8132('0x33')],function(_0x691c29){var _0x4fa855={};_0x4fa855[_0x691c29]={'$like':'%'+_0x1b5620['query'][_0x8132('0x3b')]+'%'};return _0x4fa855;})});}_0x520a54=_[_0x8132('0x3c')]({},_0x520a54,_0x1b5620[_0x8132('0x3d')]);return db[_0x8132('0x4e')][_0x8132('0x1c')]({'where':_0x520a54['where']})['then'](function(_0x3a9565){_0x165923[_0x8132('0x1c')]=_0x3a9565;if(_0x1b5620[_0x8132('0x2f')][_0x8132('0x44')]){_0x520a54[_0x8132('0x3e')]=[{'all':!![]}];}return db[_0x8132('0x4e')][_0x8132('0x3f')](_0x520a54);})[_0x8132('0x23')](function(_0x1eb504){_0x165923[_0x8132('0x40')]=_0x1eb504;return _0x165923;});}})[_0x8132('0x23')](respondWithFilteredResult(_0x2ca8b7,_0x520a54))[_0x8132('0x41')](handleError(_0x2ca8b7,null));}; \ No newline at end of file +var _0x3ec5=['getQuestions','JscriptyQuestionReport','pick','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','include','find','create','body','params','describe'];(function(_0xbdfa21,_0x5492d7){var _0x48fd96=function(_0x5e0f91){while(--_0x5e0f91){_0xbdfa21['push'](_0xbdfa21['shift']());}};_0x48fd96(++_0x5492d7);}(_0x3ec5,0x1b9));var _0x53ec=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3ec5[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x53ec('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x53ec('0x1'));var zipdir=require(_0x53ec('0x2'));var jsonpatch=require(_0x53ec('0x3'));var rp=require(_0x53ec('0x4'));var moment=require('moment');var BPromise=require(_0x53ec('0x5'));var Mustache=require('mustache');var util=require(_0x53ec('0x6'));var path=require(_0x53ec('0x7'));var sox=require(_0x53ec('0x8'));var csv=require(_0x53ec('0x9'));var ejs=require(_0x53ec('0xa'));var fs=require('fs');var _=require(_0x53ec('0xb'));var squel=require(_0x53ec('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53ec('0xd'));var toCsv=require('to-csv');var querystring=require(_0x53ec('0xe'));var Papa=require(_0x53ec('0xf'));var Redis=require(_0x53ec('0x10'));var authService=require(_0x53ec('0x11'));var qs=require(_0x53ec('0x12'));var as=require(_0x53ec('0x13'));var hardwareService=require(_0x53ec('0x14'));var logger=require(_0x53ec('0x15'))(_0x53ec('0x16'));var utils=require(_0x53ec('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26883d,_0x2e126d){_0x2e126d=_0x2e126d||0xcc;return function(_0x7e3aef){if(_0x7e3aef){return _0x26883d[_0x53ec('0x18')](_0x2e126d);}return _0x26883d[_0x53ec('0x19')](_0x2e126d)[_0x53ec('0x1a')]();};}function respondWithResult(_0x83f004,_0x54c63c){_0x54c63c=_0x54c63c||0xc8;return function(_0x14b770){if(_0x14b770){return _0x83f004[_0x53ec('0x19')](_0x54c63c)[_0x53ec('0x1b')](_0x14b770);}};}function respondWithFilteredResult(_0x465bbd,_0x19a11d){return function(_0x3d793c){if(_0x3d793c){var _0x4539dd=_0x3d793c[_0x53ec('0x1c')],_0x28d650=_0x19a11d[_0x53ec('0x1d')],_0x368243=_0x19a11d[_0x53ec('0x1d')]+_0x19a11d['limit'],_0xe2c2de;if(_0x368243>=_0x4539dd){_0x368243=_0x4539dd;_0xe2c2de=0xc8;}else{_0xe2c2de=0xce;}_0x465bbd['status'](_0xe2c2de);return _0x465bbd['set'](_0x53ec('0x1e'),_0x28d650+'-'+_0x368243+'/'+_0x4539dd)[_0x53ec('0x1b')](_0x3d793c);}return null;};}function patchUpdates(_0x56dc23){return function(_0x3f63f2){try{jsonpatch['apply'](_0x3f63f2,_0x56dc23,!![]);}catch(_0x328778){return BPromise[_0x53ec('0x1f')](_0x328778);}return _0x3f63f2[_0x53ec('0x20')]();};}function saveUpdates(_0x52fd09,_0x4969b6){return function(_0x23890b){if(_0x23890b){return _0x23890b[_0x53ec('0x21')](_0x52fd09)[_0x53ec('0x22')](function(_0xc65512){return _0xc65512;});}return null;};}function removeEntity(_0x4c6678,_0x56faf3){return function(_0x57543e){if(_0x57543e){return _0x57543e[_0x53ec('0x23')]()[_0x53ec('0x22')](function(){_0x4c6678[_0x53ec('0x19')](0xcc)[_0x53ec('0x1a')]();});}};}function handleEntityNotFound(_0x2a2e0c,_0x22e2bb){return function(_0x58df14){if(!_0x58df14){_0x2a2e0c['sendStatus'](0x194);}return _0x58df14;};}function handleError(_0x3f8cc7,_0x30c8f1){_0x30c8f1=_0x30c8f1||0x1f4;return function(_0x507c2f){logger[_0x53ec('0x24')](_0x507c2f['stack']);if(_0x507c2f[_0x53ec('0x25')]){delete _0x507c2f[_0x53ec('0x25')];}_0x3f8cc7['status'](_0x30c8f1)[_0x53ec('0x26')](_0x507c2f);};}exports[_0x53ec('0x27')]=function(_0x5e3006,_0x4d6434){var _0x2424ff={},_0x44b000={},_0x5c6f2a={'count':0x0,'rows':[]};var _0x4f0ac2=_[_0x53ec('0x28')](db[_0x53ec('0x29')][_0x53ec('0x2a')],function(_0x3a1a08){return{'name':_0x3a1a08[_0x53ec('0x2b')],'type':_0x3a1a08[_0x53ec('0x2c')]['key']};});_0x44b000[_0x53ec('0x2d')]=_['map'](_0x4f0ac2,_0x53ec('0x25'));_0x44b000[_0x53ec('0x2e')]=_[_0x53ec('0x2f')](_0x5e3006[_0x53ec('0x2e')]);_0x44b000[_0x53ec('0x30')]=_['intersection'](_0x44b000[_0x53ec('0x2d')],_0x44b000[_0x53ec('0x2e')]);_0x2424ff[_0x53ec('0x31')]=_[_0x53ec('0x32')](_0x44b000[_0x53ec('0x2d')],qs[_0x53ec('0x33')](_0x5e3006[_0x53ec('0x2e')]['fields']));_0x2424ff[_0x53ec('0x31')]=_0x2424ff['attributes'][_0x53ec('0x34')]?_0x2424ff['attributes']:_0x44b000[_0x53ec('0x2d')];if(!_0x5e3006[_0x53ec('0x2e')]['hasOwnProperty']('nolimit')){_0x2424ff[_0x53ec('0x35')]=qs['limit'](_0x5e3006[_0x53ec('0x2e')][_0x53ec('0x35')]);_0x2424ff['offset']=qs[_0x53ec('0x1d')](_0x5e3006[_0x53ec('0x2e')]['offset']);}_0x2424ff[_0x53ec('0x36')]=qs[_0x53ec('0x37')](_0x5e3006[_0x53ec('0x2e')][_0x53ec('0x37')]);_0x2424ff['where']=qs[_0x53ec('0x30')](_['pick'](_0x5e3006[_0x53ec('0x2e')],_0x44b000[_0x53ec('0x30')]));if(_0x5e3006[_0x53ec('0x2e')]['filter']){_0x2424ff[_0x53ec('0x38')]=_[_0x53ec('0x39')](_0x2424ff['where'],{'$or':_['map'](_0x4f0ac2,function(_0x1bae24){if(_0x1bae24[_0x53ec('0x2c')]!==_0x53ec('0x3a')){var _0x53d834={};_0x53d834[_0x1bae24[_0x53ec('0x25')]]={'$like':'%'+_0x5e3006[_0x53ec('0x2e')][_0x53ec('0x3b')]+'%'};return _0x53d834;}})});}_0x2424ff=_['merge']({},_0x2424ff,_0x5e3006[_0x53ec('0x3c')]);var _0x585a99={'where':_0x2424ff[_0x53ec('0x38')]};return db['JscriptySessionReport']['count'](_0x585a99)[_0x53ec('0x22')](function(_0x1ef9ae){_0x5c6f2a[_0x53ec('0x1c')]=_0x1ef9ae;if(_0x5e3006['query'][_0x53ec('0x3d')]){_0x2424ff['include']=[{'all':!![]}];}return db[_0x53ec('0x29')]['findAll'](_0x2424ff);})[_0x53ec('0x22')](function(_0x5ddb93){_0x5c6f2a[_0x53ec('0x3e')]=_0x5ddb93;return _0x5c6f2a;})[_0x53ec('0x22')](respondWithFilteredResult(_0x4d6434,_0x2424ff))[_0x53ec('0x3f')](handleError(_0x4d6434,null));};exports['show']=function(_0x1e1e28,_0x130d8e){var _0x470651={'raw':!![],'where':{'id':_0x1e1e28['params']['id']}},_0x3af965={};_0x3af965[_0x53ec('0x2d')]=_['keys'](db[_0x53ec('0x29')][_0x53ec('0x2a')]);_0x3af965[_0x53ec('0x2e')]=_[_0x53ec('0x2f')](_0x1e1e28[_0x53ec('0x2e')]);_0x3af965[_0x53ec('0x30')]=_[_0x53ec('0x32')](_0x3af965[_0x53ec('0x2d')],_0x3af965[_0x53ec('0x2e')]);_0x470651[_0x53ec('0x31')]=_[_0x53ec('0x32')](_0x3af965['model'],qs['fields'](_0x1e1e28[_0x53ec('0x2e')]['fields']));_0x470651[_0x53ec('0x31')]=_0x470651[_0x53ec('0x31')][_0x53ec('0x34')]?_0x470651[_0x53ec('0x31')]:_0x3af965[_0x53ec('0x2d')];if(_0x1e1e28[_0x53ec('0x2e')][_0x53ec('0x3d')]){_0x470651[_0x53ec('0x40')]=[{'all':!![]}];}_0x470651=_[_0x53ec('0x39')]({},_0x470651,_0x1e1e28['options']);return db[_0x53ec('0x29')][_0x53ec('0x41')](_0x470651)[_0x53ec('0x22')](handleEntityNotFound(_0x130d8e,null))['then'](respondWithResult(_0x130d8e,null))[_0x53ec('0x3f')](handleError(_0x130d8e,null));};exports[_0x53ec('0x42')]=function(_0x3d0978,_0x439775){return db[_0x53ec('0x29')]['create'](_0x3d0978['body'],{})[_0x53ec('0x22')](respondWithResult(_0x439775,0xc9))[_0x53ec('0x3f')](handleError(_0x439775,null));};exports[_0x53ec('0x21')]=function(_0x29ceb9,_0x46d8b0){if(_0x29ceb9[_0x53ec('0x43')]['id']){delete _0x29ceb9[_0x53ec('0x43')]['id'];}return db[_0x53ec('0x29')][_0x53ec('0x41')]({'where':{'id':_0x29ceb9[_0x53ec('0x44')]['id']}})[_0x53ec('0x22')](handleEntityNotFound(_0x46d8b0,null))['then'](saveUpdates(_0x29ceb9[_0x53ec('0x43')],null))[_0x53ec('0x22')](respondWithResult(_0x46d8b0,null))[_0x53ec('0x3f')](handleError(_0x46d8b0,null));};exports[_0x53ec('0x23')]=function(_0xdd9f43,_0x42b604){return db[_0x53ec('0x29')][_0x53ec('0x41')]({'where':{'id':_0xdd9f43[_0x53ec('0x44')]['id']}})[_0x53ec('0x22')](handleEntityNotFound(_0x42b604,null))['then'](removeEntity(_0x42b604,null))['catch'](handleError(_0x42b604,null));};exports[_0x53ec('0x45')]=function(_0x36c9e4,_0x29ff4f){return db[_0x53ec('0x29')][_0x53ec('0x45')]()['then'](respondWithResult(_0x29ff4f,null))[_0x53ec('0x3f')](handleError(_0x29ff4f,null));};exports[_0x53ec('0x46')]=function(_0x44f4d8,_0x2d5254,_0x1f0098){var _0x2bd8f3={'raw':!![],'where':{}};var _0x4fa3ce={};var _0x2d68b9={'count':0x0,'rows':[]};return db[_0x53ec('0x29')]['findOne']({'where':{'id':_0x44f4d8['params']['id']}})[_0x53ec('0x22')](handleEntityNotFound(_0x2d5254,null))[_0x53ec('0x22')](function(_0x416272){if(_0x416272){_0x4fa3ce[_0x53ec('0x2d')]=_['keys'](db[_0x53ec('0x47')][_0x53ec('0x2a')]);_0x4fa3ce[_0x53ec('0x2e')]=_[_0x53ec('0x2f')](_0x44f4d8[_0x53ec('0x2e')]);_0x4fa3ce[_0x53ec('0x30')]=_[_0x53ec('0x32')](_0x4fa3ce[_0x53ec('0x2d')],_0x4fa3ce['query']);_0x2bd8f3[_0x53ec('0x31')]=_[_0x53ec('0x32')](_0x4fa3ce['model'],qs['fields'](_0x44f4d8[_0x53ec('0x2e')]['fields']));_0x2bd8f3[_0x53ec('0x31')]=_0x2bd8f3[_0x53ec('0x31')][_0x53ec('0x34')]?_0x2bd8f3['attributes']:_0x4fa3ce['model'];if(!_0x44f4d8[_0x53ec('0x2e')]['hasOwnProperty']('nolimit')){_0x2bd8f3[_0x53ec('0x35')]=qs[_0x53ec('0x35')](_0x44f4d8[_0x53ec('0x2e')][_0x53ec('0x35')]);_0x2bd8f3[_0x53ec('0x1d')]=qs[_0x53ec('0x1d')](_0x44f4d8[_0x53ec('0x2e')][_0x53ec('0x1d')]);}_0x2bd8f3[_0x53ec('0x36')]=qs[_0x53ec('0x37')](_0x44f4d8[_0x53ec('0x2e')][_0x53ec('0x37')]);_0x2bd8f3[_0x53ec('0x38')]=qs[_0x53ec('0x30')](_[_0x53ec('0x48')](_0x44f4d8[_0x53ec('0x2e')],_0x4fa3ce['filters']));_0x2bd8f3[_0x53ec('0x38')]['SessionId']=_0x416272['id'];if(_0x44f4d8[_0x53ec('0x2e')]['filter']){_0x2bd8f3[_0x53ec('0x38')]=_[_0x53ec('0x39')](_0x2bd8f3['where'],{'$or':_[_0x53ec('0x28')](_0x2bd8f3[_0x53ec('0x31')],function(_0x244d10){var _0x34dcda={};_0x34dcda[_0x244d10]={'$like':'%'+_0x44f4d8[_0x53ec('0x2e')][_0x53ec('0x3b')]+'%'};return _0x34dcda;})});}_0x2bd8f3=_['merge']({},_0x2bd8f3,_0x44f4d8[_0x53ec('0x3c')]);return db[_0x53ec('0x47')][_0x53ec('0x1c')]({'where':_0x2bd8f3[_0x53ec('0x38')]})['then'](function(_0x55c3c0){_0x2d68b9[_0x53ec('0x1c')]=_0x55c3c0;if(_0x44f4d8[_0x53ec('0x2e')]['includeAll']){_0x2bd8f3[_0x53ec('0x40')]=[{'all':!![]}];}return db[_0x53ec('0x47')]['findAll'](_0x2bd8f3);})['then'](function(_0x668586){_0x2d68b9[_0x53ec('0x3e')]=_0x668586;return _0x2d68b9;});}})['then'](respondWithFilteredResult(_0x2d5254,_0x2bd8f3))[_0x53ec('0x3f')](handleError(_0x2d5254,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 0d937b9..4e30b93 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 _0x3ce8=['JscriptySessionReport','report_jscripty_sessions','util','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x25505a,_0xbb425a){var _0x3f2849=function(_0x8bf14d){while(--_0x8bf14d){_0x25505a['push'](_0x25505a['shift']());}};_0x3f2849(++_0xbb425a);}(_0x3ce8,0x192));var _0x83ce=function(_0x315a1f,_0x54f84f){_0x315a1f=_0x315a1f-0x0;var _0x1c21a5=_0x3ce8[_0x315a1f];return _0x1c21a5;};'use strict';var _=require('lodash');var util=require(_0x83ce('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x83ce('0x1'));var BPromise=require(_0x83ce('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x83ce('0x3'));var rimraf=require(_0x83ce('0x4'));var config=require(_0x83ce('0x5'));var attributes=require(_0x83ce('0x6'));module[_0x83ce('0x7')]=function(_0x49c445,_0x1b28c1){return _0x49c445['define'](_0x83ce('0x8'),attributes,{'tableName':_0x83ce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e8c=['bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','util','moment'];(function(_0x3e2b67,_0x5eae3c){var _0x419d32=function(_0x454cbd){while(--_0x454cbd){_0x3e2b67['push'](_0x3e2b67['shift']());}};_0x419d32(++_0x5eae3c);}(_0x3e8c,0x1ac));var _0xc3e8=function(_0x39ae62,_0x47edeb){_0x39ae62=_0x39ae62-0x0;var _0x16cfac=_0x3e8c[_0x39ae62];return _0x16cfac;};'use strict';var _=require('lodash');var util=require(_0xc3e8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc3e8('0x1'));var BPromise=require(_0xc3e8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e8('0x3'));var rimraf=require(_0xc3e8('0x4'));var config=require(_0xc3e8('0x5'));var attributes=require(_0xc3e8('0x6'));module[_0xc3e8('0x7')]=function(_0x266d11,_0x5971b4){return _0x266d11[_0xc3e8('0x8')](_0xc3e8('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 79b32d4..bd0befc 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 _0xac85=['client','http','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x120039,_0x23f2ad){var _0x1e747c=function(_0xf932e8){while(--_0xf932e8){_0x120039['push'](_0x120039['shift']());}};_0x1e747c(++_0x23f2ad);}(_0xac85,0xbd));var _0x5ac8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xac85[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x5ac8('0x0'));var util=require(_0x5ac8('0x1'));var moment=require(_0x5ac8('0x2'));var BPromise=require(_0x5ac8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac8('0x4'));var db=require(_0x5ac8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ac8('0x6'))(_0x5ac8('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ac8('0x8'));var client=jayson[_0x5ac8('0x9')][_0x5ac8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f5e87,_0x7e29c7,_0x3beaa2){return new BPromise(function(_0x3ffe7b,_0xe7a758){return client[_0x5ac8('0xb')](_0x3f5e87,_0x3beaa2)['then'](function(_0x45f93f){logger[_0x5ac8('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x7e29c7,_0x5ac8('0xd'));logger[_0x5ac8('0xe')](_0x5ac8('0xf'),_0x7e29c7,_0x5ac8('0xd'),JSON['stringify'](_0x45f93f));if(_0x45f93f[_0x5ac8('0x10')]){if(_0x45f93f['error'][_0x5ac8('0x11')]===0x1f4){logger[_0x5ac8('0x10')](_0x5ac8('0x12'),_0x7e29c7,_0x45f93f[_0x5ac8('0x10')]['message']);return _0xe7a758(_0x45f93f['error'][_0x5ac8('0x13')]);}logger['error'](_0x5ac8('0x12'),_0x7e29c7,_0x45f93f['error']['message']);return _0x3ffe7b(_0x45f93f[_0x5ac8('0x10')][_0x5ac8('0x13')]);}else{logger[_0x5ac8('0xc')](_0x5ac8('0x12'),_0x7e29c7,_0x5ac8('0xd'));_0x3ffe7b(_0x45f93f[_0x5ac8('0x14')][_0x5ac8('0x13')]);}})[_0x5ac8('0x15')](function(_0x3aca3c){logger[_0x5ac8('0x10')](_0x5ac8('0x12'),_0x7e29c7,_0x3aca3c);_0xe7a758(_0x3aca3c);});});} \ No newline at end of file +var _0x0868=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x43b9b9,_0x33337f){var _0x172b66=function(_0x5653e5){while(--_0x5653e5){_0x43b9b9['push'](_0x43b9b9['shift']());}};_0x172b66(++_0x33337f);}(_0x0868,0xdf));var _0x8086=function(_0xfb0fe1,_0x5bd720){_0xfb0fe1=_0xfb0fe1-0x0;var _0x148e75=_0x0868[_0xfb0fe1];return _0x148e75;};'use strict';var _=require(_0x8086('0x0'));var util=require(_0x8086('0x1'));var moment=require(_0x8086('0x2'));var BPromise=require(_0x8086('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8086('0x4'));var db=require(_0x8086('0x5'))['db'];var utils=require(_0x8086('0x6'));var logger=require(_0x8086('0x7'))('rpc');var config=require(_0x8086('0x8'));var jayson=require(_0x8086('0x9'));var client=jayson[_0x8086('0xa')][_0x8086('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f44ae,_0x4dc83f,_0x194280){return new BPromise(function(_0x320934,_0x5d85f2){return client['request'](_0x2f44ae,_0x194280)[_0x8086('0xc')](function(_0x3ac1a3){logger[_0x8086('0xd')](_0x8086('0xe'),_0x4dc83f,_0x8086('0xf'));logger['debug'](_0x8086('0x10'),_0x4dc83f,_0x8086('0xf'),JSON['stringify'](_0x3ac1a3));if(_0x3ac1a3['error']){if(_0x3ac1a3['error'][_0x8086('0x11')]===0x1f4){logger[_0x8086('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x4dc83f,_0x3ac1a3[_0x8086('0x12')][_0x8086('0x13')]);return _0x5d85f2(_0x3ac1a3[_0x8086('0x12')]['message']);}logger[_0x8086('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x4dc83f,_0x3ac1a3[_0x8086('0x12')][_0x8086('0x13')]);return _0x320934(_0x3ac1a3[_0x8086('0x12')][_0x8086('0x13')]);}else{logger['info'](_0x8086('0xe'),_0x4dc83f,_0x8086('0xf'));_0x320934(_0x3ac1a3[_0x8086('0x14')][_0x8086('0x13')]);}})[_0x8086('0x15')](function(_0x8bbaf4){logger[_0x8086('0x12')](_0x8086('0xe'),_0x4dc83f,_0x8bbaf4);_0x5d85f2(_0x8bbaf4);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 8ba0419..f53d394 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 _0x9b09=['isAuthenticated','update','exports','multer','path','express','Router','../../config/environment','get','index','put'];(function(_0x2037e8,_0x2d9b11){var _0x4eb6f7=function(_0x2d67cf){while(--_0x2d67cf){_0x2037e8['push'](_0x2037e8['shift']());}};_0x4eb6f7(++_0x2d9b11);}(_0x9b09,0x184));var _0x99b0=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x9b09[_0xf2628e];return _0x13863a;};'use strict';var multer=require(_0x99b0('0x0'));var util=require('util');var path=require(_0x99b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x99b0('0x2'));var router=express[_0x99b0('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x99b0('0x4'));var controller=require('./license.controller');router[_0x99b0('0x5')]('/',controller[_0x99b0('0x6')]);router[_0x99b0('0x7')]('/:id',auth[_0x99b0('0x8')](),controller[_0x99b0('0x9')]);module[_0x99b0('0xa')]=router; \ No newline at end of file +var _0x3ad0=['./license.controller','get','index','put','/:id','isAuthenticated','update','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f08f1,_0x3a3f80){var _0xcbf27c=function(_0x378dd6){while(--_0x378dd6){_0x4f08f1['push'](_0x4f08f1['shift']());}};_0xcbf27c(++_0x3a3f80);}(_0x3ad0,0x161));var _0x03ad=function(_0x2f93cf,_0x153b05){_0x2f93cf=_0x2f93cf-0x0;var _0x48ccd7=_0x3ad0[_0x2f93cf];return _0x48ccd7;};'use strict';var multer=require('multer');var util=require(_0x03ad('0x0'));var path=require('path');var timeout=require(_0x03ad('0x1'));var express=require(_0x03ad('0x2'));var router=express[_0x03ad('0x3')]();var auth=require(_0x03ad('0x4'));var interaction=require(_0x03ad('0x5'));var config=require(_0x03ad('0x6'));var controller=require(_0x03ad('0x7'));router[_0x03ad('0x8')]('/',controller[_0x03ad('0x9')]);router[_0x03ad('0xa')](_0x03ad('0xb'),auth[_0x03ad('0xc')](),controller[_0x03ad('0xd')]);module[_0x03ad('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 3e44be0..2905219 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 _0x4975=['STRING','INTEGER','sequelize','TEXT'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4975,0x86));var _0x5497=function(_0xb6e4f5,_0x1fd163){_0xb6e4f5=_0xb6e4f5-0x0;var _0x3ca8b3=_0x4975[_0xb6e4f5];return _0x3ca8b3;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'license':{'type':Sequelize[_0x5497('0x1')]},'data1':{'type':Sequelize[_0x5497('0x2')]},'data2':{'type':Sequelize[_0x5497('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x5497('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1cb9=['STRING','INTEGER','sequelize','TEXT'];(function(_0x3d63de,_0x2971d3){var _0x3ae91a=function(_0x32c2e8){while(--_0x32c2e8){_0x3d63de['push'](_0x3d63de['shift']());}};_0x3ae91a(++_0x2971d3);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3495f6,_0x20c98f){_0x3495f6=_0x3495f6-0x0;var _0x18e0e0=_0x1cb9[_0x3495f6];return _0x18e0e0;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'license':{'type':Sequelize[_0x91cb('0x1')]},'data1':{'type':Sequelize[_0x91cb('0x2')]},'data2':{'type':Sequelize[_0x91cb('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x91cb('0x3')],'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 adc99cb..d70c585 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 _0x0546=['checkLicense','key','demo','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','../../config/license/util','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','options','getLicense','body','params'];(function(_0x59a9a0,_0x169fa8){var _0x2a7eec=function(_0x39b310){while(--_0x39b310){_0x59a9a0['push'](_0x59a9a0['shift']());}};_0x2a7eec(++_0x169fa8);}(_0x0546,0x78));var _0x6054=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x0546[_0x120376];return _0x28c529;};'use strict';var pdf=require(_0x6054('0x0'));var emlformat=require(_0x6054('0x1'));var rimraf=require(_0x6054('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6054('0x3'));var rp=require('request-promise');var moment=require(_0x6054('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6054('0x5'));var util=require(_0x6054('0x6'));var path=require('path');var sox=require(_0x6054('0x7'));var csv=require(_0x6054('0x8'));var ejs=require(_0x6054('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6054('0xa'));var crypto=require(_0x6054('0xb'));var jsforce=require(_0x6054('0xc'));var deskjs=require(_0x6054('0xd'));var toCsv=require(_0x6054('0x8'));var querystring=require(_0x6054('0xe'));var Papa=require('papaparse');var Redis=require(_0x6054('0xf'));var authService=require(_0x6054('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6054('0x11'));var hardwareService=require(_0x6054('0x12'));var logger=require(_0x6054('0x13'))(_0x6054('0x14'));var utils=require(_0x6054('0x15'));var config=require(_0x6054('0x16'));var db=require(_0x6054('0x17'))['db'];function respondWithStatusCode(_0x56bc9c,_0x13155c){_0x13155c=_0x13155c||0xcc;return function(_0x2aaea1){if(_0x2aaea1){return _0x56bc9c['sendStatus'](_0x13155c);}return _0x56bc9c[_0x6054('0x18')](_0x13155c)[_0x6054('0x19')]();};}function respondWithResult(_0x2429b9,_0xf16e1){_0xf16e1=_0xf16e1||0xc8;return function(_0x4dc708){if(_0x4dc708){return _0x2429b9[_0x6054('0x18')](_0xf16e1)[_0x6054('0x1a')](_0x4dc708);}};}function respondWithFilteredResult(_0x4b3e48,_0x1295d0){return function(_0x5212f2){if(_0x5212f2){var _0x3d8b32=_0x5212f2['count'],_0xbfcb12=_0x1295d0[_0x6054('0x1b')],_0x19ac4e=_0x1295d0['offset']+_0x1295d0[_0x6054('0x1c')],_0x49dc2d;if(_0x19ac4e>=_0x3d8b32){_0x19ac4e=_0x3d8b32;_0x49dc2d=0xc8;}else{_0x49dc2d=0xce;}_0x4b3e48[_0x6054('0x18')](_0x49dc2d);return _0x4b3e48[_0x6054('0x1d')](_0x6054('0x1e'),_0xbfcb12+'-'+_0x19ac4e+'/'+_0x3d8b32)[_0x6054('0x1a')](_0x5212f2);}return null;};}function patchUpdates(_0x3aa274){return function(_0x1116e0){try{jsonpatch[_0x6054('0x1f')](_0x1116e0,_0x3aa274,!![]);}catch(_0x4b0931){return BPromise['reject'](_0x4b0931);}return _0x1116e0[_0x6054('0x20')]();};}function saveUpdates(_0x800607,_0x15ef22){return function(_0x5be094){if(_0x5be094){return _0x5be094[_0x6054('0x21')](_0x800607)[_0x6054('0x22')](function(_0x4eb634){return _0x4eb634;});}return null;};}function removeEntity(_0x525f0b,_0x3a0984){return function(_0x4257bd){if(_0x4257bd){return _0x4257bd[_0x6054('0x23')]()[_0x6054('0x22')](function(){_0x525f0b[_0x6054('0x18')](0xcc)[_0x6054('0x19')]();});}};}function handleEntityNotFound(_0x466a30,_0x18c0d4){return function(_0x4d22c){if(!_0x4d22c){_0x466a30['sendStatus'](0x194);}return _0x4d22c;};}function handleError(_0x2a0899,_0x58360c){_0x58360c=_0x58360c||0x1f4;return function(_0x430e40){logger[_0x6054('0x24')](_0x430e40['stack']);if(_0x430e40[_0x6054('0x25')]){delete _0x430e40[_0x6054('0x25')];}_0x2a0899[_0x6054('0x18')](_0x58360c)[_0x6054('0x26')](_0x430e40);};}var utilLicense=require(_0x6054('0x27'));exports['index']=function(_0x97b69a,_0x2cab05){var _0x707f45={'raw':!![],'where':{'id':0x1}},_0x2695b9={};_0x2695b9[_0x6054('0x28')]=_[_0x6054('0x29')](db[_0x6054('0x2a')][_0x6054('0x2b')]);_0x2695b9[_0x6054('0x2c')]=_['keys'](_0x97b69a[_0x6054('0x2c')]);_0x2695b9[_0x6054('0x2d')]=_[_0x6054('0x2e')](_0x2695b9[_0x6054('0x28')],_0x2695b9[_0x6054('0x2c')]);_0x707f45['attributes']=_[_0x6054('0x2e')](_0x2695b9['model'],qs[_0x6054('0x2f')](_0x97b69a['query']['fields']));_0x707f45[_0x6054('0x30')]=_0x707f45[_0x6054('0x30')][_0x6054('0x31')]?_0x707f45['attributes']:_0x2695b9['model'];_0x707f45=_['merge']({},_0x707f45,_0x97b69a[_0x6054('0x32')]);return utilLicense[_0x6054('0x33')](_0x707f45)[_0x6054('0x22')](respondWithResult(_0x2cab05,null))['catch'](handleError(_0x2cab05,null));};exports[_0x6054('0x21')]=function(_0xe9453f,_0x53c20c){if(_0xe9453f[_0x6054('0x34')]['id']){delete _0xe9453f[_0x6054('0x34')]['id'];}return db[_0x6054('0x2a')]['find']({'where':{'id':_0xe9453f[_0x6054('0x35')]['id']}})[_0x6054('0x22')](handleEntityNotFound(_0x53c20c,null))[_0x6054('0x22')](function(_0x4555bf){var _0x50e938=_0x4555bf['get']({'plain':!![]});return utilLicense[_0x6054('0x36')](_0x50e938,_0xe9453f[_0x6054('0x34')][_0x6054('0x37')]);})[_0x6054('0x22')](function(_0x318a26){if(!_0x318a26[_0x6054('0x38')]){return saveUpdates(_0xe9453f[_0x6054('0x34')],null);}return _0x318a26;})['then'](respondWithResult(_0x53c20c,null))[_0x6054('0x39')](handleError(_0x53c20c,null));}; \ No newline at end of file +var _0x24eb=['json','offset','limit','apply','reject','update','then','destroy','error','stack','name','status','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','options','catch','body','find','params','get','checkLicense','key','demo','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x35f525,_0xffcc4){var _0xe9fcc3=function(_0x536363){while(--_0x536363){_0x35f525['push'](_0x35f525['shift']());}};_0xe9fcc3(++_0xffcc4);}(_0x24eb,0x96));var _0xb24e=function(_0x4cf2ad,_0x286351){_0x4cf2ad=_0x4cf2ad-0x0;var _0x5048c6=_0x24eb[_0x4cf2ad];return _0x5048c6;};'use strict';var pdf=require(_0xb24e('0x0'));var emlformat=require(_0xb24e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb24e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb24e('0x3'));var moment=require(_0xb24e('0x4'));var BPromise=require(_0xb24e('0x5'));var Mustache=require('mustache');var util=require(_0xb24e('0x6'));var path=require(_0xb24e('0x7'));var sox=require(_0xb24e('0x8'));var csv=require(_0xb24e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb24e('0xa'));var squel=require('squel');var crypto=require(_0xb24e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb24e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb24e('0xd'));var Papa=require(_0xb24e('0xe'));var Redis=require(_0xb24e('0xf'));var authService=require(_0xb24e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb24e('0x11'));var hardwareService=require(_0xb24e('0x12'));var logger=require(_0xb24e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb24e('0x14'));var db=require(_0xb24e('0x15'))['db'];function respondWithStatusCode(_0x5b31a6,_0x5a50dc){_0x5a50dc=_0x5a50dc||0xcc;return function(_0x1d27a3){if(_0x1d27a3){return _0x5b31a6[_0xb24e('0x16')](_0x5a50dc);}return _0x5b31a6['status'](_0x5a50dc)[_0xb24e('0x17')]();};}function respondWithResult(_0x47e506,_0x33a437){_0x33a437=_0x33a437||0xc8;return function(_0x31e216){if(_0x31e216){return _0x47e506['status'](_0x33a437)[_0xb24e('0x18')](_0x31e216);}};}function respondWithFilteredResult(_0x5a4c22,_0x1788f1){return function(_0x167455){if(_0x167455){var _0x46976b=_0x167455['count'],_0x3291d7=_0x1788f1['offset'],_0x2628cd=_0x1788f1[_0xb24e('0x19')]+_0x1788f1[_0xb24e('0x1a')],_0x3d318e;if(_0x2628cd>=_0x46976b){_0x2628cd=_0x46976b;_0x3d318e=0xc8;}else{_0x3d318e=0xce;}_0x5a4c22['status'](_0x3d318e);return _0x5a4c22['set']('Content-Range',_0x3291d7+'-'+_0x2628cd+'/'+_0x46976b)[_0xb24e('0x18')](_0x167455);}return null;};}function patchUpdates(_0x4a972b){return function(_0xeafa6d){try{jsonpatch[_0xb24e('0x1b')](_0xeafa6d,_0x4a972b,!![]);}catch(_0x4c922a){return BPromise[_0xb24e('0x1c')](_0x4c922a);}return _0xeafa6d['save']();};}function saveUpdates(_0xfef439,_0x5dce37){return function(_0x4da136){if(_0x4da136){return _0x4da136[_0xb24e('0x1d')](_0xfef439)[_0xb24e('0x1e')](function(_0x18745e){return _0x18745e;});}return null;};}function removeEntity(_0x56ba13,_0x361ce6){return function(_0x2effae){if(_0x2effae){return _0x2effae[_0xb24e('0x1f')]()[_0xb24e('0x1e')](function(){_0x56ba13['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x647cb2,_0x2e9094){return function(_0x4843dd){if(!_0x4843dd){_0x647cb2[_0xb24e('0x16')](0x194);}return _0x4843dd;};}function handleError(_0x34cc19,_0xc96c05){_0xc96c05=_0xc96c05||0x1f4;return function(_0x2ac5e0){logger[_0xb24e('0x20')](_0x2ac5e0[_0xb24e('0x21')]);if(_0x2ac5e0[_0xb24e('0x22')]){delete _0x2ac5e0[_0xb24e('0x22')];}_0x34cc19[_0xb24e('0x23')](_0xc96c05)[_0xb24e('0x24')](_0x2ac5e0);};}var utilLicense=require(_0xb24e('0x25'));exports[_0xb24e('0x26')]=function(_0xd5e813,_0x1d8cd4){var _0x4f893e={'raw':!![],'where':{'id':0x1}},_0x45062d={};_0x45062d[_0xb24e('0x27')]=_[_0xb24e('0x28')](db[_0xb24e('0x29')][_0xb24e('0x2a')]);_0x45062d[_0xb24e('0x2b')]=_[_0xb24e('0x28')](_0xd5e813[_0xb24e('0x2b')]);_0x45062d[_0xb24e('0x2c')]=_['intersection'](_0x45062d[_0xb24e('0x27')],_0x45062d[_0xb24e('0x2b')]);_0x4f893e[_0xb24e('0x2d')]=_[_0xb24e('0x2e')](_0x45062d[_0xb24e('0x27')],qs[_0xb24e('0x2f')](_0xd5e813['query'][_0xb24e('0x2f')]));_0x4f893e[_0xb24e('0x2d')]=_0x4f893e[_0xb24e('0x2d')][_0xb24e('0x30')]?_0x4f893e['attributes']:_0x45062d['model'];_0x4f893e=_['merge']({},_0x4f893e,_0xd5e813[_0xb24e('0x31')]);return utilLicense['getLicense'](_0x4f893e)['then'](respondWithResult(_0x1d8cd4,null))[_0xb24e('0x32')](handleError(_0x1d8cd4,null));};exports[_0xb24e('0x1d')]=function(_0x38ab15,_0x4efc1f){if(_0x38ab15[_0xb24e('0x33')]['id']){delete _0x38ab15[_0xb24e('0x33')]['id'];}return db[_0xb24e('0x29')][_0xb24e('0x34')]({'where':{'id':_0x38ab15[_0xb24e('0x35')]['id']}})[_0xb24e('0x1e')](handleEntityNotFound(_0x4efc1f,null))[_0xb24e('0x1e')](function(_0x4eb72a){var _0x5e4444=_0x4eb72a[_0xb24e('0x36')]({'plain':!![]});return utilLicense[_0xb24e('0x37')](_0x5e4444,_0x38ab15['body'][_0xb24e('0x38')]);})[_0xb24e('0x1e')](function(_0x42b616){if(!_0x42b616[_0xb24e('0x39')]){return saveUpdates(_0x38ab15[_0xb24e('0x33')],null);}return _0x42b616;})[_0xb24e('0x1e')](respondWithResult(_0x4efc1f,null))[_0xb24e('0x32')](handleError(_0x4efc1f,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 6df3714..061478e 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 _0xa7d3=['rimraf','../../config/environment','./license.attributes','exports','define','license','api','moment','bluebird','request-promise','path'];(function(_0x37e553,_0xd1e44a){var _0x5f4309=function(_0xe79d29){while(--_0xe79d29){_0x37e553['push'](_0x37e553['shift']());}};_0x5f4309(++_0xd1e44a);}(_0xa7d3,0x1ea));var _0x3a7d=function(_0x60a21e,_0x3793ea){_0x60a21e=_0x60a21e-0x0;var _0x96b612=_0xa7d3[_0x60a21e];return _0x96b612;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3a7d('0x0'));var moment=require(_0x3a7d('0x1'));var BPromise=require(_0x3a7d('0x2'));var rp=require(_0x3a7d('0x3'));var fs=require('fs');var path=require(_0x3a7d('0x4'));var rimraf=require(_0x3a7d('0x5'));var config=require(_0x3a7d('0x6'));var attributes=require(_0x3a7d('0x7'));module[_0x3a7d('0x8')]=function(_0xb58ee7,_0x3566ce){return _0xb58ee7[_0x3a7d('0x9')]('License',attributes,{'tableName':_0x3a7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d22=['lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','License'];(function(_0x32faa6,_0x231c1f){var _0x1526dd=function(_0x53627b){while(--_0x53627b){_0x32faa6['push'](_0x32faa6['shift']());}};_0x1526dd(++_0x231c1f);}(_0x4d22,0x1ef));var _0x24d2=function(_0x570a22,_0x3bc65b){_0x570a22=_0x570a22-0x0;var _0x16804c=_0x4d22[_0x570a22];return _0x16804c;};'use strict';var _=require(_0x24d2('0x0'));var util=require('util');var logger=require(_0x24d2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x24d2('0x2'));var rp=require(_0x24d2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d2('0x4'));var config=require(_0x24d2('0x5'));var attributes=require(_0x24d2('0x6'));module[_0x24d2('0x7')]=function(_0x5892f6,_0x483801){return _0x5892f6['define'](_0x24d2('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 1dee37b..11c64f8 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 _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1fb7c9,_0xb14ddf){var _0x5f0c3a=function(_0xa27e70){while(--_0xa27e70){_0x1fb7c9['push'](_0x1fb7c9['shift']());}};_0x5f0c3a(++_0xb14ddf);}(_0x9348,0x10d));var _0x8934=function(_0x573dc9,_0x51999f){_0x573dc9=_0x573dc9-0x0;var _0x22e1be=_0x9348[_0x573dc9];return _0x22e1be;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('License,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});} \ No newline at end of file +var _0x63ad=['moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','error','message','util'];(function(_0x57f0c9,_0x48f904){var _0x3a38fc=function(_0xa857a9){while(--_0xa857a9){_0x57f0c9['push'](_0x57f0c9['shift']());}};_0x3a38fc(++_0x48f904);}(_0x63ad,0x7d));var _0xd63a=function(_0x465550,_0x5bc937){_0x465550=_0x465550-0x0;var _0x24fbf1=_0x63ad[_0x465550];return _0x24fbf1;};'use strict';var _=require('lodash');var util=require(_0xd63a('0x0'));var moment=require(_0xd63a('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(_0xd63a('0x2'));var logger=require(_0xd63a('0x3'))('rpc');var config=require(_0xd63a('0x4'));var jayson=require(_0xd63a('0x5'));var client=jayson[_0xd63a('0x6')][_0xd63a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b0ad8,_0x3efd7d,_0x52d6cc){return new BPromise(function(_0x1505e0,_0x4e01e3){return client[_0xd63a('0x8')](_0x3b0ad8,_0x52d6cc)['then'](function(_0x432556){logger[_0xd63a('0x9')](_0xd63a('0xa'),_0x3efd7d,'request\x20sent');logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x3efd7d,_0xd63a('0xb'),JSON['stringify'](_0x432556));if(_0x432556[_0xd63a('0xc')]){if(_0x432556[_0xd63a('0xc')]['code']===0x1f4){logger[_0xd63a('0xc')](_0xd63a('0xa'),_0x3efd7d,_0x432556[_0xd63a('0xc')][_0xd63a('0xd')]);return _0x4e01e3(_0x432556[_0xd63a('0xc')][_0xd63a('0xd')]);}logger[_0xd63a('0xc')]('License,\x20%s,\x20%s',_0x3efd7d,_0x432556[_0xd63a('0xc')][_0xd63a('0xd')]);return _0x1505e0(_0x432556[_0xd63a('0xc')][_0xd63a('0xd')]);}else{logger[_0xd63a('0x9')](_0xd63a('0xa'),_0x3efd7d,_0xd63a('0xb'));_0x1505e0(_0x432556['result'][_0xd63a('0xd')]);}})['catch'](function(_0x11c164){logger[_0xd63a('0xc')](_0xd63a('0xa'),_0x3efd7d,_0x11c164);_0x4e01e3(_0x11c164);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5fafc3d..f1b6136 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 _0x824a=['put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','send','/:id/users'];(function(_0x19a28c,_0x3da97d){var _0x53ead3=function(_0x6f3ac3){while(--_0x6f3ac3){_0x19a28c['push'](_0x19a28c['shift']());}};_0x53ead3(++_0x3da97d);}(_0x824a,0x171));var _0xa824=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x824a[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xa824('0x0'));var util=require(_0xa824('0x1'));var path=require(_0xa824('0x2'));var timeout=require('connect-timeout');var express=require(_0xa824('0x3'));var router=express['Router']();var auth=require(_0xa824('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa824('0x5'));var controller=require(_0xa824('0x6'));router['get']('/',auth[_0xa824('0x7')](),controller[_0xa824('0x8')]);router[_0xa824('0x9')](_0xa824('0xa'),auth['isAuthenticated'](),controller[_0xa824('0xb')]);router[_0xa824('0x9')](_0xa824('0xc'),auth[_0xa824('0x7')](),controller[_0xa824('0xd')]);router[_0xa824('0x9')](_0xa824('0xe'),auth[_0xa824('0x7')](),controller['getDispositions']);router['get'](_0xa824('0xf'),auth[_0xa824('0x7')](),controller[_0xa824('0x10')]);router[_0xa824('0x9')]('/:id/in_servers',auth[_0xa824('0x7')](),controller[_0xa824('0x11')]);router[_0xa824('0x9')](_0xa824('0x12'),auth['isAuthenticated'](),controller['getSmtp']);router['get'](_0xa824('0x13'),auth[_0xa824('0x7')](),controller[_0xa824('0x14')]);router[_0xa824('0x9')](_0xa824('0x15'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa824('0x9')](_0xa824('0x16'),auth['isAuthenticated'](),controller[_0xa824('0x17')]);router['get'](_0xa824('0x18'),auth['isAuthenticated'](),controller[_0xa824('0x19')]);router['get']('/:id/users',auth[_0xa824('0x7')](),controller[_0xa824('0x1a')]);router[_0xa824('0x1b')](_0xa824('0xe'),auth[_0xa824('0x7')](),controller[_0xa824('0x1c')]);router[_0xa824('0x1b')](_0xa824('0xf'),auth[_0xa824('0x7')](),controller['addAnswer']);router[_0xa824('0x1b')]('/',auth[_0xa824('0x7')](),controller['create']);router[_0xa824('0x1b')](_0xa824('0x1d'),auth['isAuthenticated'](),controller[_0xa824('0x1e')]);router[_0xa824('0x1b')](_0xa824('0x12'),auth[_0xa824('0x7')](),controller[_0xa824('0x1f')]);router[_0xa824('0x1b')](_0xa824('0x13'),auth[_0xa824('0x7')](),controller[_0xa824('0x20')]);router['post']('/:id/applications',auth[_0xa824('0x7')](),controller[_0xa824('0x21')]);router[_0xa824('0x1b')]('/:id/send',auth[_0xa824('0x7')](),controller[_0xa824('0x22')]);router['post'](_0xa824('0x23'),auth[_0xa824('0x7')](),controller['addAgents']);router[_0xa824('0x24')]('/:id',auth[_0xa824('0x7')](),controller[_0xa824('0x25')]);router[_0xa824('0x26')](_0xa824('0xe'),auth[_0xa824('0x7')](),controller[_0xa824('0x27')]);router['delete'](_0xa824('0xf'),auth[_0xa824('0x7')](),controller[_0xa824('0x28')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller[_0xa824('0x29')]);router[_0xa824('0x26')](_0xa824('0x12'),auth[_0xa824('0x7')](),controller[_0xa824('0x2a')]);router['delete']('/:id',auth[_0xa824('0x7')](),controller['destroy']);router['delete'](_0xa824('0x23'),auth[_0xa824('0x7')](),controller[_0xa824('0x2b')]);module[_0xa824('0x2c')]=router; \ No newline at end of file +var _0x2099=['getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addInteraction','/:id/applications','addApplications','send','addAgents','put','removeDispositions','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2099,0x1d9));var _0x9209=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2099[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x9209('0x0'));var util=require(_0x9209('0x1'));var path=require(_0x9209('0x2'));var timeout=require(_0x9209('0x3'));var express=require(_0x9209('0x4'));var router=express[_0x9209('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9209('0x6'));var config=require('../../config/environment');var controller=require(_0x9209('0x7'));router['get']('/',auth[_0x9209('0x8')](),controller[_0x9209('0x9')]);router[_0x9209('0xa')](_0x9209('0xb'),auth[_0x9209('0x8')](),controller[_0x9209('0xc')]);router[_0x9209('0xa')](_0x9209('0xd'),auth[_0x9209('0x8')](),controller[_0x9209('0xe')]);router[_0x9209('0xa')](_0x9209('0xf'),auth[_0x9209('0x8')](),controller[_0x9209('0x10')]);router['get'](_0x9209('0x11'),auth[_0x9209('0x8')](),controller[_0x9209('0x12')]);router[_0x9209('0xa')](_0x9209('0x13'),auth[_0x9209('0x8')](),controller[_0x9209('0x14')]);router[_0x9209('0xa')](_0x9209('0x15'),auth['isAuthenticated'](),controller[_0x9209('0x16')]);router[_0x9209('0xa')](_0x9209('0x17'),auth[_0x9209('0x8')](),controller[_0x9209('0x18')]);router[_0x9209('0xa')]('/:id/applications',auth[_0x9209('0x8')](),controller[_0x9209('0x19')]);router[_0x9209('0xa')](_0x9209('0x1a'),auth[_0x9209('0x8')](),controller[_0x9209('0x1b')]);router[_0x9209('0xa')](_0x9209('0x1c'),auth['isAuthenticated'](),controller[_0x9209('0x1d')]);router[_0x9209('0xa')](_0x9209('0x1e'),auth['isAuthenticated'](),controller[_0x9209('0x1f')]);router[_0x9209('0x20')](_0x9209('0xf'),auth['isAuthenticated'](),controller[_0x9209('0x21')]);router[_0x9209('0x20')](_0x9209('0x11'),auth[_0x9209('0x8')](),controller[_0x9209('0x22')]);router[_0x9209('0x20')]('/',auth[_0x9209('0x8')](),controller['create']);router[_0x9209('0x20')](_0x9209('0x13'),auth[_0x9209('0x8')](),controller[_0x9209('0x23')]);router[_0x9209('0x20')](_0x9209('0x15'),auth[_0x9209('0x8')](),controller[_0x9209('0x24')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x9209('0x25')]);router[_0x9209('0x20')](_0x9209('0x26'),auth[_0x9209('0x8')](),controller[_0x9209('0x27')]);router[_0x9209('0x20')]('/:id/send',auth[_0x9209('0x8')](),controller[_0x9209('0x28')]);router[_0x9209('0x20')](_0x9209('0x1e'),auth[_0x9209('0x8')](),controller[_0x9209('0x29')]);router[_0x9209('0x2a')]('/:id',auth[_0x9209('0x8')](),controller['update']);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9209('0x2b')]);router[_0x9209('0x2c')](_0x9209('0x11'),auth[_0x9209('0x8')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0x9209('0x8')](),controller[_0x9209('0x2d')]);router[_0x9209('0x2c')]('/:id/out_servers',auth[_0x9209('0x8')](),controller[_0x9209('0x2e')]);router[_0x9209('0x2c')](_0x9209('0xd'),auth[_0x9209('0x8')](),controller[_0x9209('0x2f')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x9209('0x30')]);module[_0x9209('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 2c33e2a..406d7db 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 _0xc469=['STRING','BOOLEAN','TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xc469,0x6a));var _0x9c46=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xc469[_0x35fb56];return _0x2fd52c;};'use strict';var Sequelize=require(_0x9c46('0x0'));module[_0x9c46('0x1')]={'description':{'type':Sequelize[_0x9c46('0x2')]},'name':{'type':Sequelize[_0x9c46('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9c46('0x4')]},'markAsUnread':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9c46('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x9c46('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9c46('0x6');}},'notificationSound':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c46('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9c46('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x9c46('0x3')],'defaultValue':![],'comment':_0x9c46('0x9'),'set':function(_0x569844){if(!_0x569844)this[_0x9c46('0xa')]('mandatoryDispositionPauseId',null);this[_0x9c46('0xa')](_0x9c46('0xb'),_0x569844);}}}; \ No newline at end of file +var _0x3ae0=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x266a9d,_0x519d8f){var _0xa6f4a0=function(_0x580126){while(--_0x580126){_0x266a9d['push'](_0x266a9d['shift']());}};_0xa6f4a0(++_0x519d8f);}(_0x3ae0,0xb9));var _0x03ae=function(_0x218681,_0x16971b){_0x218681=_0x218681-0x0;var _0x56c5de=_0x3ae0[_0x218681];return _0x56c5de;};'use strict';var Sequelize=require(_0x03ae('0x0'));module[_0x03ae('0x1')]={'description':{'type':Sequelize[_0x03ae('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x03ae('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x03ae('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x03ae('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x03ae('0x5')},'fontSize':{'type':Sequelize[_0x03ae('0x6')](0x2)[_0x03ae('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x03ae('0x4')],'defaultValue':function(){return _0x03ae('0x8');}},'notificationSound':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x03ae('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x03ae('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03ae('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x03ae('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x03ae('0x3')],'defaultValue':![],'comment':_0x03ae('0xa'),'set':function(_0x2b9741){if(!_0x2b9741)this['setDataValue'](_0x03ae('0xb'),null);this['setDataValue'](_0x03ae('0xc'),_0x2b9741);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4a67669..51fc9d8 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 _0x2863=['Interaction','Messages','secure','verifySmtp','destroy','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','MailServerOut','length','options','find','body','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','rawAttributes','intersection','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','active','description','cservice','cauthentication','user','pass','cpassword','authentication','host','port','service','cuser','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','List','Contacts','updatedAt','DESC','isNil','from','email','attachments','join','root','server/files/attachments','auth','SendMail','sendMail','ListId','List\x20not\x20found','out','messageId'];(function(_0x180002,_0x265bce){var _0x1fa1cb=function(_0x273f5b){while(--_0x273f5b){_0x180002['push'](_0x180002['shift']());}};_0x1fa1cb(++_0x265bce);}(_0x2863,0xd2));var _0x3286=function(_0x8f7ebb,_0xaafe4f){_0x8f7ebb=_0x8f7ebb-0x0;var _0x4510ea=_0x2863[_0x8f7ebb];return _0x4510ea;};'use strict';var pdf=require(_0x3286('0x0'));var emlformat=require(_0x3286('0x1'));var rimraf=require(_0x3286('0x2'));var zipdir=require(_0x3286('0x3'));var jsonpatch=require(_0x3286('0x4'));var rp=require(_0x3286('0x5'));var moment=require(_0x3286('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x3286('0x7'));var util=require(_0x3286('0x8'));var path=require(_0x3286('0x9'));var sox=require('sox');var csv=require(_0x3286('0xa'));var ejs=require(_0x3286('0xb'));var fs=require('fs');var _=require(_0x3286('0xc'));var squel=require('squel');var crypto=require(_0x3286('0xd'));var jsforce=require(_0x3286('0xe'));var deskjs=require(_0x3286('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3286('0x10'));var Papa=require(_0x3286('0x11'));var Redis=require(_0x3286('0x12'));var authService=require(_0x3286('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3286('0x14'));var hardwareService=require(_0x3286('0x15'));var logger=require(_0x3286('0x16'))(_0x3286('0x17'));var utils=require(_0x3286('0x18'));var config=require(_0x3286('0x19'));var db=require(_0x3286('0x1a'))['db'];config['redis']=_[_0x3286('0x1b')](config[_0x3286('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x3286('0x1d'))(new Redis(config[_0x3286('0x1c')]));require('./mailAccount.socket')[_0x3286('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3286('0x1f')]['http']({'port':0x232b});function checkPasswordPattern(_0x53f7d9,_0x466c44,_0x49a2cf){if(_0x49a2cf){var _0x3daefa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3daefa[_0x3286('0x20')](_0x466c44)){return _0x53f7d9;}else{throw new db[(_0x3286('0x21'))][(_0x3286('0x22'))](_0x3286('0x23'));}}else{return _0x53f7d9;}}function respondWithRpcPromise(_0x494a25,_0x5201be,_0x3d161f,_0x58a846){return new BPromise(function(_0x55333f,_0x1c806a){var _0x474194=_0x58a846||client;return _0x474194[_0x3286('0x24')](_0x494a25,_0x3d161f)[_0x3286('0x25')](function(_0x3f4b82){logger[_0x3286('0x26')]('MailAccount,\x20%s,\x20%s',_0x5201be,_0x3286('0x27'));logger[_0x3286('0x28')](_0x3286('0x29'),_0x5201be,'request\x20sent',JSON[_0x3286('0x2a')](_0x3f4b82));if(_0x3f4b82[_0x3286('0x2b')]){if(_0x3f4b82[_0x3286('0x2b')][_0x3286('0x2c')]===0x1f4){logger[_0x3286('0x2b')]('MailAccount,\x20%s,\x20%s',_0x5201be,_0x3f4b82[_0x3286('0x2b')][_0x3286('0x2d')]);return _0x1c806a(_0x3f4b82['error'][_0x3286('0x2d')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5201be,_0x3f4b82['error'][_0x3286('0x2d')]);return _0x55333f(_0x3f4b82[_0x3286('0x2b')][_0x3286('0x2d')]);}else{logger[_0x3286('0x26')](_0x3286('0x2e'),_0x5201be,_0x3286('0x27'));_0x55333f(_0x3f4b82[_0x3286('0x2f')][_0x3286('0x2d')]);}})['catch'](function(_0x3cf13d){logger[_0x3286('0x2b')](_0x3286('0x2e'),_0x5201be,_0x3cf13d);_0x1c806a(_0x3cf13d);});});}function respondWithStatusCode(_0x560e11,_0xc63126){_0xc63126=_0xc63126||0xcc;return function(_0x4bbe39){if(_0x4bbe39){return _0x560e11[_0x3286('0x30')](_0xc63126);}return _0x560e11['status'](_0xc63126)[_0x3286('0x31')]();};}function respondWithResult(_0x3dbed8,_0x43424d){_0x43424d=_0x43424d||0xc8;return function(_0x29db20){if(_0x29db20){return _0x3dbed8[_0x3286('0x32')](_0x43424d)['json'](_0x29db20);}};}function respondWithFilteredResult(_0x265304,_0x4fd318){return function(_0x59a623){if(_0x59a623){var _0x5c8c43=_0x59a623[_0x3286('0x33')],_0x2fe3b6=_0x4fd318[_0x3286('0x34')],_0x3a8d0b=_0x4fd318[_0x3286('0x34')]+_0x4fd318['limit'],_0x588c05;if(_0x3a8d0b>=_0x5c8c43){_0x3a8d0b=_0x5c8c43;_0x588c05=0xc8;}else{_0x588c05=0xce;}_0x265304[_0x3286('0x32')](_0x588c05);return _0x265304[_0x3286('0x35')](_0x3286('0x36'),_0x2fe3b6+'-'+_0x3a8d0b+'/'+_0x5c8c43)[_0x3286('0x37')](_0x59a623);}return null;};}function patchUpdates(_0x31b653){return function(_0x4d852a){try{jsonpatch[_0x3286('0x38')](_0x4d852a,_0x31b653,!![]);}catch(_0xafa536){return BPromise[_0x3286('0x39')](_0xafa536);}return _0x4d852a[_0x3286('0x3a')]();};}function saveUpdates(_0x358690,_0x441001){return function(_0x8b3eeb){if(_0x8b3eeb){return _0x8b3eeb[_0x3286('0x3b')](_0x358690)['then'](function(_0x5c907e){return _0x5c907e;});}return null;};}function removeEntity(_0x1f8333,_0x5d91ed){return function(_0x4f2b4c){if(_0x4f2b4c){return _0x4f2b4c['destroy']()[_0x3286('0x25')](function(){var _0x24bffd=_0x4f2b4c['get']({'plain':!![]});var _0x5d4c38=_0x3286('0x3c');return db[_0x3286('0x3d')]['destroy']({'where':{'type':_0x5d4c38,'resourceId':_0x24bffd['id']}})['then'](function(){return _0x4f2b4c;});})[_0x3286('0x25')](function(){_0x1f8333[_0x3286('0x32')](0xcc)[_0x3286('0x31')]();});}};}function handleEntityNotFound(_0x2f1939,_0x58bbde){return function(_0x510319){if(!_0x510319){_0x2f1939[_0x3286('0x30')](0x194);}return _0x510319;};}function handleError(_0xe65883,_0x58f716){_0x58f716=_0x58f716||0x1f4;return function(_0x48e6ed){logger['error'](_0x48e6ed[_0x3286('0x3e')]);if(_0x48e6ed[_0x3286('0x3f')]){delete _0x48e6ed[_0x3286('0x3f')];}_0xe65883['status'](_0x58f716)[_0x3286('0x40')](_0x48e6ed);};}exports[_0x3286('0x41')]=function(_0x4a6bd7,_0x421705){var _0x11b587={'include':[{'model':db[_0x3286('0x42')],'as':_0x3286('0x43')},{'model':db['MailServerOut'],'as':_0x3286('0x44')},{'model':db[_0x3286('0x45')],'as':_0x3286('0x46')}]},_0xee426e={},_0x4743c4={'count':0x0,'rows':[]};var _0xdc52c2=_[_0x3286('0x47')](db[_0x3286('0x48')]['rawAttributes'],function(_0x2109b5){return{'name':_0x2109b5['fieldName'],'type':_0x2109b5[_0x3286('0x49')][_0x3286('0x4a')]};});_0xee426e['model']=_[_0x3286('0x47')](_0xdc52c2,'name');_0xee426e[_0x3286('0x4b')]=_[_0x3286('0x4c')](_0x4a6bd7['query']);_0xee426e[_0x3286('0x4d')]=_['intersection'](_0xee426e[_0x3286('0x4e')],_0xee426e['query']);_0x11b587[_0x3286('0x4f')]=_['intersection'](_0xee426e[_0x3286('0x4e')],qs['fields'](_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x50')]));_0x11b587[_0x3286('0x4f')]=_0x11b587[_0x3286('0x4f')]['length']?_0x11b587['attributes']:_0xee426e['model'];if(!_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x51')](_0x3286('0x52'))){_0x11b587[_0x3286('0x53')]=qs[_0x3286('0x53')](_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x53')]);_0x11b587[_0x3286('0x34')]=qs[_0x3286('0x34')](_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x34')]);}_0x11b587[_0x3286('0x54')]=qs['sort'](_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x55')]);_0x11b587[_0x3286('0x56')]=qs[_0x3286('0x4d')](_[_0x3286('0x57')](_0x4a6bd7[_0x3286('0x4b')],_0xee426e[_0x3286('0x4d')]));if(_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x58')]){_0x11b587['where']=_[_0x3286('0x59')](_0x11b587['where'],{'$or':_[_0x3286('0x47')](_0xdc52c2,function(_0xf5adcc){if(_0xf5adcc[_0x3286('0x49')]!==_0x3286('0x5a')){var _0x2f19e8={};_0x2f19e8[_0xf5adcc['name']]={'$like':'%'+_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x58')]+'%'};return _0x2f19e8;}})});}_0x11b587=_[_0x3286('0x59')]({},_0x11b587,_0x4a6bd7['options']);var _0x59791f={'where':_0x11b587['where']};return db[_0x3286('0x48')][_0x3286('0x33')](_0x59791f)[_0x3286('0x25')](function(_0x4ad2aa){_0x4743c4[_0x3286('0x33')]=_0x4ad2aa;if(_0x4a6bd7[_0x3286('0x4b')][_0x3286('0x5b')]){_0x11b587[_0x3286('0x5c')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x11b587);})[_0x3286('0x25')](function(_0x364148){_0x4743c4[_0x3286('0x5d')]=_0x364148;return _0x4743c4;})[_0x3286('0x25')](respondWithFilteredResult(_0x421705,_0x11b587))[_0x3286('0x5e')](handleError(_0x421705,null));};exports[_0x3286('0x5f')]=function(_0x53b263,_0x3718ad){var _0x36d81a={'raw':![],'where':{'id':_0x53b263[_0x3286('0x60')]['id']},'include':[{'model':db[_0x3286('0x42')],'as':'Imap'},{'model':db[_0x3286('0x61')],'as':_0x3286('0x44')},{'model':db[_0x3286('0x45')],'as':'mandatoryDispositionPause'}]},_0x3626a2={};_0x3626a2[_0x3286('0x4e')]=_[_0x3286('0x4c')](db['MailAccount']['rawAttributes']);_0x3626a2[_0x3286('0x4b')]=_[_0x3286('0x4c')](_0x53b263[_0x3286('0x4b')]);_0x3626a2[_0x3286('0x4d')]=_['intersection'](_0x3626a2[_0x3286('0x4e')],_0x3626a2[_0x3286('0x4b')]);_0x36d81a['attributes']=_['intersection'](_0x3626a2['model'],qs[_0x3286('0x50')](_0x53b263[_0x3286('0x4b')][_0x3286('0x50')]));_0x36d81a[_0x3286('0x4f')]=_0x36d81a[_0x3286('0x4f')][_0x3286('0x62')]?_0x36d81a[_0x3286('0x4f')]:_0x3626a2[_0x3286('0x4e')];if(_0x53b263[_0x3286('0x4b')][_0x3286('0x5b')]){_0x36d81a[_0x3286('0x5c')]=[{'all':!![]}];}_0x36d81a=_[_0x3286('0x59')]({},_0x36d81a,_0x53b263[_0x3286('0x63')]);return db['MailAccount'][_0x3286('0x64')](_0x36d81a)[_0x3286('0x25')](handleEntityNotFound(_0x3718ad,null))[_0x3286('0x25')](respondWithResult(_0x3718ad,null))['catch'](handleError(_0x3718ad,null));};exports[_0x3286('0x3b')]=function(_0x46f1b3,_0x22d972){if(_0x46f1b3['body']['id']){delete _0x46f1b3['body']['id'];}return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x46f1b3[_0x3286('0x60')]['id']},'include':[{'model':db[_0x3286('0x42')],'as':_0x3286('0x43')},{'model':db['MailServerOut'],'as':_0x3286('0x44')},{'model':db[_0x3286('0x45')],'as':_0x3286('0x46')}]})[_0x3286('0x25')](handleEntityNotFound(_0x22d972,null))[_0x3286('0x25')](saveUpdates(_0x46f1b3[_0x3286('0x65')],null))[_0x3286('0x25')](function(_0x298780){if(_0x298780&&_0x46f1b3[_0x3286('0x65')]['Imap']){return db[_0x3286('0x42')][_0x3286('0x3b')](_0x46f1b3['body']['Imap'],{'where':{'MailAccountId':_0x298780['id']}})[_0x3286('0x25')](function(){return _0x298780;});}return _0x298780;})[_0x3286('0x25')](function(_0x203f28){if(_0x203f28&&_0x46f1b3['body'][_0x3286('0x44')]){return db['MailServerOut'][_0x3286('0x3b')](_0x46f1b3[_0x3286('0x65')][_0x3286('0x44')],{'where':{'MailAccountId':_0x203f28['id']}})[_0x3286('0x25')](function(){return _0x203f28;});}return _0x203f28;})[_0x3286('0x25')](respondWithResult(_0x22d972,null))[_0x3286('0x5e')](handleError(_0x22d972,null));};exports[_0x3286('0x66')]=function(_0x33dd74,_0x392734){return db[_0x3286('0x48')][_0x3286('0x66')]()[_0x3286('0x25')](respondWithResult(_0x392734,null))[_0x3286('0x5e')](handleError(_0x392734,null));};exports[_0x3286('0x67')]=function(_0x46f8d5,_0x27a70e,_0xc84f28){if(_0x46f8d5[_0x3286('0x65')]['id']){delete _0x46f8d5[_0x3286('0x65')]['id'];}return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x46f8d5[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x27a70e,null))[_0x3286('0x25')](function(_0x586f57){if(_0x586f57){_0x46f8d5['body'][_0x3286('0x68')]=_0x586f57['id'];return db['Disposition'][_0x3286('0x69')](_0x46f8d5[_0x3286('0x65')]);}})[_0x3286('0x25')](respondWithResult(_0x27a70e,null))[_0x3286('0x5e')](handleError(_0x27a70e,null));};exports[_0x3286('0x6a')]=function(_0x12b06a,_0x43170f,_0x2c7496){var _0x4cdf9d={'raw':![],'where':{}};var _0x532a45={};var _0x189ee7={'count':0x0,'rows':[]};return db[_0x3286('0x48')][_0x3286('0x6b')]({'where':{'id':_0x12b06a[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x43170f,null))[_0x3286('0x25')](function(_0x3e29ad){if(_0x3e29ad){_0x532a45[_0x3286('0x4e')]=_[_0x3286('0x4c')](db[_0x3286('0x6c')][_0x3286('0x6d')]);_0x532a45['query']=_[_0x3286('0x4c')](_0x12b06a[_0x3286('0x4b')]);_0x532a45['filters']=_[_0x3286('0x6e')](_0x532a45[_0x3286('0x4e')],_0x532a45['query']);_0x4cdf9d[_0x3286('0x4f')]=_['intersection'](_0x532a45[_0x3286('0x4e')],qs[_0x3286('0x50')](_0x12b06a[_0x3286('0x4b')][_0x3286('0x50')]));_0x4cdf9d[_0x3286('0x4f')]=_0x4cdf9d[_0x3286('0x4f')][_0x3286('0x62')]?_0x4cdf9d[_0x3286('0x4f')]:_0x532a45[_0x3286('0x4e')];if(!_0x12b06a['query']['hasOwnProperty'](_0x3286('0x52'))){_0x4cdf9d[_0x3286('0x53')]=qs[_0x3286('0x53')](_0x12b06a[_0x3286('0x4b')][_0x3286('0x53')]);_0x4cdf9d[_0x3286('0x34')]=qs[_0x3286('0x34')](_0x12b06a[_0x3286('0x4b')][_0x3286('0x34')]);}_0x4cdf9d['order']=qs[_0x3286('0x55')](_0x12b06a[_0x3286('0x4b')][_0x3286('0x55')]);_0x4cdf9d[_0x3286('0x56')]=qs['filters'](_[_0x3286('0x57')](_0x12b06a[_0x3286('0x4b')],_0x532a45['filters']));_0x4cdf9d['where'][_0x3286('0x68')]=_0x3e29ad['id'];if(_0x12b06a[_0x3286('0x4b')][_0x3286('0x58')]){_0x4cdf9d['where']=_[_0x3286('0x59')](_0x4cdf9d[_0x3286('0x56')],{'$or':_['map'](_0x4cdf9d[_0x3286('0x4f')],function(_0x5bd90e){var _0xc58ab5={};_0xc58ab5[_0x5bd90e]={'$like':'%'+_0x12b06a[_0x3286('0x4b')][_0x3286('0x58')]+'%'};return _0xc58ab5;})});}_0x4cdf9d=_[_0x3286('0x59')]({},_0x4cdf9d,_0x12b06a['options']);return db['Disposition'][_0x3286('0x33')]({'where':_0x4cdf9d[_0x3286('0x56')]})[_0x3286('0x25')](function(_0x584193){_0x189ee7[_0x3286('0x33')]=_0x584193;if(_0x12b06a[_0x3286('0x4b')]['includeAll']){_0x4cdf9d['include']=[{'all':!![]}];}return db['Disposition'][_0x3286('0x6f')](_0x4cdf9d);})[_0x3286('0x25')](function(_0x3bb9b9){_0x189ee7[_0x3286('0x5d')]=_0x3bb9b9;return _0x189ee7;});}})[_0x3286('0x25')](respondWithFilteredResult(_0x43170f,_0x4cdf9d))[_0x3286('0x5e')](handleError(_0x43170f,null));};exports[_0x3286('0x70')]=function(_0x51fb1a,_0x4d27ce,_0x2c3d0a){return db['MailAccount'][_0x3286('0x64')]({'where':{'id':_0x51fb1a[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x4d27ce,null))[_0x3286('0x25')](function(_0x4ffec0){if(_0x4ffec0){return _0x4ffec0[_0x3286('0x70')](_0x51fb1a[_0x3286('0x4b')][_0x3286('0x71')]);}})[_0x3286('0x25')](respondWithStatusCode(_0x4d27ce,null))[_0x3286('0x5e')](handleError(_0x4d27ce,null));};exports[_0x3286('0x72')]=function(_0x2510b3,_0x321b31,_0x3c86c8){if(_0x2510b3[_0x3286('0x65')]['id']){delete _0x2510b3[_0x3286('0x65')]['id'];}return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x2510b3[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x321b31,null))['then'](function(_0x16eb9c){if(_0x16eb9c){_0x2510b3[_0x3286('0x65')][_0x3286('0x68')]=_0x16eb9c['id'];return db['CannedAnswer']['create'](_0x2510b3['body']);}})['then'](respondWithResult(_0x321b31,null))['catch'](handleError(_0x321b31,null));};exports[_0x3286('0x73')]=function(_0x40bd97,_0x9e91cd,_0x116698){var _0x1f8623={'raw':![],'where':{}};var _0x108cc8={};var _0x2c834f={'count':0x0,'rows':[]};return db[_0x3286('0x48')][_0x3286('0x6b')]({'where':{'id':_0x40bd97[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x9e91cd,null))[_0x3286('0x25')](function(_0x310f0a){if(_0x310f0a){_0x108cc8[_0x3286('0x4e')]=_[_0x3286('0x4c')](db[_0x3286('0x74')][_0x3286('0x6d')]);_0x108cc8[_0x3286('0x4b')]=_['keys'](_0x40bd97[_0x3286('0x4b')]);_0x108cc8[_0x3286('0x4d')]=_[_0x3286('0x6e')](_0x108cc8['model'],_0x108cc8['query']);_0x1f8623['attributes']=_[_0x3286('0x6e')](_0x108cc8['model'],qs['fields'](_0x40bd97[_0x3286('0x4b')][_0x3286('0x50')]));_0x1f8623['attributes']=_0x1f8623[_0x3286('0x4f')]['length']?_0x1f8623[_0x3286('0x4f')]:_0x108cc8[_0x3286('0x4e')];if(!_0x40bd97['query'][_0x3286('0x51')](_0x3286('0x52'))){_0x1f8623[_0x3286('0x53')]=qs[_0x3286('0x53')](_0x40bd97[_0x3286('0x4b')]['limit']);_0x1f8623['offset']=qs[_0x3286('0x34')](_0x40bd97['query'][_0x3286('0x34')]);}_0x1f8623[_0x3286('0x54')]=qs[_0x3286('0x55')](_0x40bd97[_0x3286('0x4b')]['sort']);_0x1f8623[_0x3286('0x56')]=qs[_0x3286('0x4d')](_[_0x3286('0x57')](_0x40bd97[_0x3286('0x4b')],_0x108cc8[_0x3286('0x4d')]));_0x1f8623['where'][_0x3286('0x68')]=_0x310f0a['id'];if(_0x40bd97['query'][_0x3286('0x58')]){_0x1f8623[_0x3286('0x56')]=_[_0x3286('0x59')](_0x1f8623[_0x3286('0x56')],{'$or':_[_0x3286('0x47')](_0x1f8623[_0x3286('0x4f')],function(_0x2c69df){var _0x5d0b5d={};_0x5d0b5d[_0x2c69df]={'$like':'%'+_0x40bd97[_0x3286('0x4b')][_0x3286('0x58')]+'%'};return _0x5d0b5d;})});}_0x1f8623=_['merge']({},_0x1f8623,_0x40bd97[_0x3286('0x63')]);return db['CannedAnswer'][_0x3286('0x33')]({'where':_0x1f8623[_0x3286('0x56')]})['then'](function(_0x322194){_0x2c834f['count']=_0x322194;if(_0x40bd97[_0x3286('0x4b')][_0x3286('0x5b')]){_0x1f8623[_0x3286('0x5c')]=[{'all':!![]}];}return db[_0x3286('0x74')][_0x3286('0x6f')](_0x1f8623);})[_0x3286('0x25')](function(_0x23d64d){_0x2c834f[_0x3286('0x5d')]=_0x23d64d;return _0x2c834f;});}})['then'](respondWithFilteredResult(_0x9e91cd,_0x1f8623))[_0x3286('0x5e')](handleError(_0x9e91cd,null));};exports[_0x3286('0x75')]=function(_0x750c75,_0x668be2,_0x1ac943){return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x750c75['params']['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x668be2,null))[_0x3286('0x25')](function(_0x2373b1){if(_0x2373b1){return _0x2373b1['removeAnswers'](_0x750c75[_0x3286('0x4b')][_0x3286('0x71')]);}})['then'](respondWithStatusCode(_0x668be2,null))[_0x3286('0x5e')](handleError(_0x668be2,null));};exports[_0x3286('0x69')]=function(_0x5bd9bf,_0x244c57){var _0x5635e3={'name':_0x5bd9bf[_0x3286('0x65')]['name'],'key':_0x5bd9bf[_0x3286('0x65')][_0x3286('0x4a')],'email':_0x5bd9bf['body']['email'],'ListId':_0x5bd9bf[_0x3286('0x65')]['ListId'],'active':!_['isNil'](_0x5bd9bf['body'][_0x3286('0x76')])?_0x5bd9bf[_0x3286('0x65')][_0x3286('0x76')]:!![],'description':_0x5bd9bf[_0x3286('0x65')][_0x3286('0x77')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x5bd9bf[_0x3286('0x65')][_0x3286('0x78')])){if(_0x5bd9bf[_0x3286('0x65')][_0x3286('0x79')]){_0x5635e3[_0x3286('0x43')][_0x3286('0x7a')]=_0x5635e3[_0x3286('0x44')]['user']=_0x5bd9bf[_0x3286('0x65')]['cuser'];_0x5635e3[_0x3286('0x43')]['password']=_0x5635e3[_0x3286('0x44')][_0x3286('0x7b')]=_0x5bd9bf[_0x3286('0x65')][_0x3286('0x7c')];}else{_0x5635e3[_0x3286('0x43')][_0x3286('0x7d')]=_0x5635e3['Smtp'][_0x3286('0x7d')]=![];}_0x5635e3[_0x3286('0x43')][_0x3286('0x7e')]=_0x5bd9bf[_0x3286('0x65')][_0x3286('0x43')][_0x3286('0x7e')];_0x5635e3[_0x3286('0x43')][_0x3286('0x7f')]=_0x5bd9bf[_0x3286('0x65')][_0x3286('0x43')]['port'];_0x5635e3['Smtp'][_0x3286('0x7e')]=_0x5bd9bf[_0x3286('0x65')][_0x3286('0x44')][_0x3286('0x7e')];_0x5635e3[_0x3286('0x44')][_0x3286('0x7f')]=_0x5bd9bf[_0x3286('0x65')][_0x3286('0x44')][_0x3286('0x7f')];}else{_0x5635e3[_0x3286('0x43')][_0x3286('0x80')]=_0x5635e3['Smtp'][_0x3286('0x80')]=_0x5bd9bf['body'][_0x3286('0x78')];_0x5635e3['Imap'][_0x3286('0x7a')]=_0x5635e3['Smtp'][_0x3286('0x7a')]=_0x5bd9bf[_0x3286('0x65')][_0x3286('0x81')];_0x5635e3[_0x3286('0x43')][_0x3286('0x82')]=_0x5635e3[_0x3286('0x44')][_0x3286('0x7b')]=_0x5bd9bf['body'][_0x3286('0x7c')];}return db['MailAccount'][_0x3286('0x69')](_0x5635e3,{'include':[{'model':db[_0x3286('0x61')],'as':_0x3286('0x44')},{'model':db[_0x3286('0x42')],'as':_0x3286('0x43')}]})[_0x3286('0x25')](function(_0x2fce95){var _0x4e8f2a=_0x5bd9bf[_0x3286('0x7a')]['get']({'plain':!![]});if(!_0x4e8f2a)throw new Error(_0x3286('0x83'));if(_0x4e8f2a['role']===_0x3286('0x7a')){var _0x157d43=_0x2fce95[_0x3286('0x84')]({'plain':!![]});return db[_0x3286('0x85')]['find']({'where':{'name':_0x3286('0x3c'),'userProfileId':_0x4e8f2a[_0x3286('0x86')]},'raw':!![]})[_0x3286('0x25')](function(_0x504ce9){if(_0x504ce9&&_0x504ce9[_0x3286('0x87')]===0x0){return db[_0x3286('0x3d')][_0x3286('0x69')]({'name':_0x157d43['name'],'resourceId':_0x157d43['id'],'type':_0x504ce9[_0x3286('0x3f')],'sectionId':_0x504ce9['id']},{})[_0x3286('0x25')](function(){return _0x2fce95;});}else{return _0x2fce95;}})['catch'](function(_0x234f7b){logger[_0x3286('0x2b')](_0x3286('0x88'),_0x234f7b);throw _0x234f7b;});}return _0x2fce95;})[_0x3286('0x25')](respondWithResult(_0x244c57,0xc9))[_0x3286('0x5e')](handleError(_0x244c57,null));};exports[_0x3286('0x89')]=function(_0x5cc3cc,_0x46cf1e,_0x47715d){return db[_0x3286('0x48')][_0x3286('0x6b')]({'where':{'id':_0x5cc3cc['params']['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x46cf1e,null))[_0x3286('0x25')](function(_0x598804){if(_0x598804){return _0x598804[_0x3286('0x89')]();}return null;})[_0x3286('0x25')](respondWithResult(_0x46cf1e,null))['catch'](handleError(_0x46cf1e,null));};exports[_0x3286('0x8a')]=function(_0x216933,_0x44d0e1,_0x2c27cd){if(_0x216933[_0x3286('0x65')]['id']){delete _0x216933[_0x3286('0x65')]['id'];}return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x216933[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x44d0e1,null))['then'](function(_0x194352){if(_0x194352){_0x216933['body'][_0x3286('0x68')]=_0x194352['id'];return db[_0x3286('0x42')][_0x3286('0x69')](_0x216933[_0x3286('0x65')]);}})['then'](respondWithResult(_0x44d0e1,null))[_0x3286('0x5e')](handleError(_0x44d0e1,null));};exports[_0x3286('0x8b')]=function(_0x5e14dd,_0x54d7bc,_0x519968){return db['MailAccount'][_0x3286('0x6b')]({'where':{'id':_0x5e14dd['params']['id']}})['then'](handleEntityNotFound(_0x54d7bc,null))['then'](function(_0x15e8a4){if(_0x15e8a4){return _0x15e8a4[_0x3286('0x8c')](null);}return null;})['then'](respondWithStatusCode(_0x54d7bc,null))[_0x3286('0x5e')](handleError(_0x54d7bc,null));};exports[_0x3286('0x8d')]=function(_0x5bd5e6,_0x3a2a4a,_0x355ace){return db['MailAccount'][_0x3286('0x6b')]({'where':{'id':_0x5bd5e6[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x3a2a4a,null))[_0x3286('0x25')](function(_0x2a448f){if(_0x2a448f){return _0x2a448f[_0x3286('0x8d')]();}return null;})[_0x3286('0x25')](respondWithResult(_0x3a2a4a,null))[_0x3286('0x5e')](handleError(_0x3a2a4a,null));};exports['addSmtp']=function(_0x50c77a,_0x109edb,_0x542a12){if(_0x50c77a[_0x3286('0x65')]['id']){delete _0x50c77a[_0x3286('0x65')]['id'];}return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x50c77a[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x109edb,null))[_0x3286('0x25')](function(_0x4a8c74){if(_0x4a8c74){_0x50c77a[_0x3286('0x65')][_0x3286('0x68')]=_0x4a8c74['id'];return db[_0x3286('0x61')][_0x3286('0x69')](_0x50c77a['body']);}})['then'](respondWithResult(_0x109edb,null))[_0x3286('0x5e')](handleError(_0x109edb,null));};exports[_0x3286('0x8e')]=function(_0x3acf33,_0x54b210,_0x2766e9){return db[_0x3286('0x48')][_0x3286('0x6b')]({'where':{'id':_0x3acf33[_0x3286('0x60')]['id']}})['then'](handleEntityNotFound(_0x54b210,null))['then'](function(_0x9c2723){if(_0x9c2723){return _0x9c2723[_0x3286('0x8f')](null);}return null;})[_0x3286('0x25')](respondWithStatusCode(_0x54b210,null))['catch'](handleError(_0x54b210,null));};exports[_0x3286('0x90')]=function(_0x4f45b2,_0x3ac04e,_0x4f19fd){return db[_0x3286('0x91')][_0x3286('0x64')]({'where':{'id':_0x4f45b2[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x3ac04e,null))[_0x3286('0x25')](function(_0x5f6f9e){if(_0x5f6f9e){return _0x5f6f9e[_0x3286('0x90')](_0x4f45b2[_0x3286('0x65')][_0x3286('0x71')],_[_0x3286('0x92')](_0x4f45b2[_0x3286('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x3ac04e,null))[_0x3286('0x5e')](handleError(_0x3ac04e,null));};exports[_0x3286('0x93')]=function(_0x2c32d6,_0x179c5c,_0x51918c){var _0x591e01={'raw':![],'where':{}};var _0x27d0a0={};var _0x328cbc={'count':0x0,'rows':[]};return db['MailAccount'][_0x3286('0x6b')]({'where':{'id':_0x2c32d6['params']['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x179c5c,null))[_0x3286('0x25')](function(_0x109c21){if(_0x109c21){_0x27d0a0[_0x3286('0x4e')]=_[_0x3286('0x4c')](db[_0x3286('0x91')][_0x3286('0x6d')]);_0x27d0a0[_0x3286('0x4b')]=_['keys'](_0x2c32d6[_0x3286('0x4b')]);_0x27d0a0[_0x3286('0x4d')]=_['intersection'](_0x27d0a0['model'],_0x27d0a0[_0x3286('0x4b')]);_0x591e01['attributes']=_['intersection'](_0x27d0a0[_0x3286('0x4e')],qs[_0x3286('0x50')](_0x2c32d6[_0x3286('0x4b')]['fields']));_0x591e01[_0x3286('0x4f')]=_0x591e01['attributes'][_0x3286('0x62')]?_0x591e01[_0x3286('0x4f')]:_0x27d0a0[_0x3286('0x4e')];if(!_0x2c32d6['query'][_0x3286('0x51')](_0x3286('0x52'))){_0x591e01['limit']=qs[_0x3286('0x53')](_0x2c32d6['query'][_0x3286('0x53')]);_0x591e01[_0x3286('0x34')]=qs[_0x3286('0x34')](_0x2c32d6[_0x3286('0x4b')][_0x3286('0x34')]);}_0x591e01['order']=qs[_0x3286('0x55')](_0x2c32d6[_0x3286('0x4b')][_0x3286('0x55')]);_0x591e01['where']=qs[_0x3286('0x4d')](_['pick'](_0x2c32d6[_0x3286('0x4b')],_0x27d0a0[_0x3286('0x4d')]));_0x591e01[_0x3286('0x56')][_0x3286('0x68')]=_0x109c21['id'];if(_0x2c32d6[_0x3286('0x4b')][_0x3286('0x58')]){_0x591e01[_0x3286('0x56')]=_['merge'](_0x591e01[_0x3286('0x56')],{'$or':_[_0x3286('0x47')](_0x591e01[_0x3286('0x4f')],function(_0x4efe5a){var _0x171063={};_0x171063[_0x4efe5a]={'$like':'%'+_0x2c32d6['query'][_0x3286('0x58')]+'%'};return _0x171063;})});}_0x591e01=_[_0x3286('0x59')]({},_0x591e01,_0x2c32d6[_0x3286('0x63')]);return db['MailInteraction'][_0x3286('0x33')]({'where':_0x591e01[_0x3286('0x56')]})[_0x3286('0x25')](function(_0x533c9d){_0x328cbc[_0x3286('0x33')]=_0x533c9d;if(_0x2c32d6[_0x3286('0x4b')][_0x3286('0x5b')]){_0x591e01[_0x3286('0x5c')]=[{'model':db[_0x3286('0x94')],'as':'Contact','required':![]},{'model':db[_0x3286('0x95')],'as':_0x3286('0x96'),'attributes':[_0x3286('0x3f'),'fullname',_0x3286('0x97')],'required':![]},{'model':db[_0x3286('0x98')],'as':'Tags','attributes':['id',_0x3286('0x3f'),_0x3286('0x99')],'where':_0x2c32d6[_0x3286('0x4b')]['tag']?{'id':_0x2c32d6[_0x3286('0x4b')][_0x3286('0x9a')]}:undefined,'required':_0x2c32d6[_0x3286('0x4b')][_0x3286('0x9a')]?!![]:![]}];}return db[_0x3286('0x91')]['findAll'](_0x591e01);})[_0x3286('0x25')](function(_0x46162c){_0x328cbc[_0x3286('0x5d')]=_0x46162c;return _0x328cbc;});}})['then'](respondWithFilteredResult(_0x179c5c,_0x591e01))[_0x3286('0x5e')](handleError(_0x179c5c,null));};exports[_0x3286('0x9b')]=function(_0x5794d0,_0x1899ed,_0x27ef15){return db[_0x3286('0x48')]['findOne']({'where':{'id':_0x5794d0[_0x3286('0x60')]['id']}})['then'](handleEntityNotFound(_0x1899ed,null))[_0x3286('0x25')](function(_0x25660f){if(_0x25660f){return db[_0x3286('0x9c')]['transaction'](function(_0x2d0fa1){return db[_0x3286('0x9d')]['destroy']({'where':{'MailAccountId':_0x5794d0['params']['id']},'transaction':_0x2d0fa1})[_0x3286('0x25')](function(_0x321ca2){var _0x34a466=_[_0x3286('0x47')](_0x5794d0['body'],function(_0x10be35){_0x10be35[_0x3286('0x68')]=_0x5794d0[_0x3286('0x60')]['id'];return _0x10be35;});return db[_0x3286('0x9d')][_0x3286('0x9e')](_0x34a466,{'transaction':_0x2d0fa1});});})['then'](function(){return db['MailApplication'][_0x3286('0x9f')]({'where':{'MailAccountId':_0x5794d0[_0x3286('0x60')]['id']},'order':_0x3286('0xa0')});});}})[_0x3286('0x25')](respondWithResult(_0x1899ed,null))[_0x3286('0x5e')](handleError(_0x1899ed,null));};exports[_0x3286('0xa1')]=function(_0x4871de,_0x1a5db1,_0x27d85a){var _0x22da7b={};var _0x11a69c={};var _0xc0f036;var _0x84daa7;return db[_0x3286('0x48')][_0x3286('0x6b')]({'where':{'id':_0x4871de[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x1a5db1,null))['then'](function(_0x2ecdbc){if(_0x2ecdbc){_0xc0f036=_0x2ecdbc;_0x11a69c[_0x3286('0x4e')]=_[_0x3286('0x4c')](db[_0x3286('0x9d')][_0x3286('0x6d')]);_0x11a69c['query']=_[_0x3286('0x4c')](_0x4871de['query']);_0x11a69c[_0x3286('0x4d')]=_['intersection'](_0x11a69c['model'],_0x11a69c[_0x3286('0x4b')]);_0x22da7b[_0x3286('0x4f')]=_[_0x3286('0x6e')](_0x11a69c[_0x3286('0x4e')],qs[_0x3286('0x50')](_0x4871de[_0x3286('0x4b')][_0x3286('0x50')]));_0x22da7b[_0x3286('0x4f')]=_0x22da7b['attributes'][_0x3286('0x62')]?_0x22da7b[_0x3286('0x4f')]:_0x11a69c[_0x3286('0x4e')];_0x22da7b['order']=qs[_0x3286('0x55')](_0x4871de[_0x3286('0x4b')]['sort']);_0x22da7b[_0x3286('0x56')]=qs[_0x3286('0x4d')](_[_0x3286('0x57')](_0x4871de['query'],_0x11a69c['filters']));if(_0x4871de[_0x3286('0x4b')][_0x3286('0x58')]){_0x22da7b[_0x3286('0x56')]=_[_0x3286('0x59')](_0x22da7b[_0x3286('0x56')],{'$or':_['map'](_0x22da7b[_0x3286('0x4f')],function(_0x35b832){var _0x247224={};_0x247224[_0x35b832]={'$like':'%'+_0x4871de['query'][_0x3286('0x58')]+'%'};return _0x247224;})});}_0x22da7b=_[_0x3286('0x59')]({},_0x22da7b,_0x4871de[_0x3286('0x63')]);return _0xc0f036['getApplications'](_0x22da7b);}})[_0x3286('0x25')](function(_0x4be764){if(_0x4be764){_0x84daa7=_0x4be764['length'];if(!_0x4871de[_0x3286('0x4b')][_0x3286('0x51')](_0x3286('0x52'))){_0x22da7b[_0x3286('0x53')]=qs[_0x3286('0x53')](_0x4871de[_0x3286('0x4b')][_0x3286('0x53')]);_0x22da7b['offset']=qs[_0x3286('0x34')](_0x4871de[_0x3286('0x4b')][_0x3286('0x34')]);}return _0xc0f036[_0x3286('0xa1')](_0x22da7b);}})['then'](function(_0xf21073){if(_0xf21073){return _0xf21073?{'count':_0x84daa7,'rows':_0xf21073}:null;}})[_0x3286('0x25')](respondWithResult(_0x1a5db1,null))[_0x3286('0x5e')](handleError(_0x1a5db1,null));};exports[_0x3286('0xa2')]=function(_0x109edc,_0xf1d3d4,_0x4ac01b){var _0x3b3219={'raw':!![],'where':{}};var _0x441bf3={};var _0x118c40={'count':0x0,'rows':[]};return db[_0x3286('0x48')][_0x3286('0x6b')]({'where':{'id':_0x109edc[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0xf1d3d4,null))[_0x3286('0x25')](function(_0x190b0b){if(_0x190b0b){_0x441bf3['model']=_[_0x3286('0x4c')](db['MailMessage'][_0x3286('0x6d')]);_0x441bf3[_0x3286('0x4b')]=_[_0x3286('0x4c')](_0x109edc[_0x3286('0x4b')]);_0x441bf3[_0x3286('0x4d')]=_[_0x3286('0x6e')](_0x441bf3['model'],_0x441bf3[_0x3286('0x4b')]);_0x3b3219[_0x3286('0x4f')]=_[_0x3286('0x6e')](_0x441bf3[_0x3286('0x4e')],qs['fields'](_0x109edc[_0x3286('0x4b')][_0x3286('0x50')]));_0x3b3219['attributes']=_0x3b3219[_0x3286('0x4f')][_0x3286('0x62')]?_0x3b3219[_0x3286('0x4f')]:_0x441bf3[_0x3286('0x4e')];if(!_0x109edc[_0x3286('0x4b')][_0x3286('0x51')]('nolimit')){_0x3b3219[_0x3286('0x53')]=qs['limit'](_0x109edc[_0x3286('0x4b')]['limit']);_0x3b3219[_0x3286('0x34')]=qs[_0x3286('0x34')](_0x109edc[_0x3286('0x4b')][_0x3286('0x34')]);}_0x3b3219['order']=qs['sort'](_0x109edc['query']['sort']);_0x3b3219['where']=qs[_0x3286('0x4d')](_[_0x3286('0x57')](_0x109edc[_0x3286('0x4b')],_0x441bf3[_0x3286('0x4d')]));_0x3b3219['where'][_0x3286('0x68')]=_0x190b0b['id'];if(_0x109edc['query']['filter']){_0x3b3219[_0x3286('0x56')]=_['merge'](_0x3b3219['where'],{'$or':_[_0x3286('0x47')](_0x3b3219[_0x3286('0x4f')],function(_0x4483a3){var _0x59b35c={};_0x59b35c[_0x4483a3]={'$like':'%'+_0x109edc[_0x3286('0x4b')][_0x3286('0x58')]+'%'};return _0x59b35c;})});}if(_0x109edc[_0x3286('0x4b')][_0x3286('0xa3')]){var _0x2e06dd=_0x109edc[_0x3286('0x4b')][_0x3286('0xa3')][_0x3286('0xa4')](',');var _0x30c03b={};_0x30c03b[_0x2e06dd[0x0]]={'$gte':moment(_0x2e06dd[0x1])[_0x3286('0xa5')](_0x3286('0xa6'))};_0x3b3219['where']=_[_0x3286('0x59')](_0x3b3219[_0x3286('0x56')],_0x30c03b);}_0x3b3219=_[_0x3286('0x59')]({},_0x3b3219,_0x109edc['options']);return db[_0x3286('0xa7')][_0x3286('0x33')]({'where':_0x3b3219['where']})['then'](function(_0x5b406b){_0x118c40[_0x3286('0x33')]=_0x5b406b;if(_0x109edc[_0x3286('0x4b')]['includeAll']){_0x3b3219[_0x3286('0x5c')]=[{'all':!![]}];}return db[_0x3286('0xa7')][_0x3286('0x6f')](_0x3b3219);})[_0x3286('0x25')](function(_0x2da253){_0x118c40[_0x3286('0x5d')]=_0x2da253;return _0x118c40;});}})[_0x3286('0x25')](respondWithFilteredResult(_0xf1d3d4,_0x3b3219))['catch'](handleError(_0xf1d3d4,null));};exports[_0x3286('0x40')]=function(_0x41f70d,_0x331008,_0x24ec37){var _0x4e2608,_0xf33418={},_0x3d00ba;if(_0x41f70d[_0x3286('0x65')]['to']){_0x3d00ba=_0x41f70d[_0x3286('0x65')]['to'][_0x3286('0xa4')](',')[0x0];}return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x41f70d[_0x3286('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x3286('0xa8'),'include':[{'model':db['CmContact'],'as':_0x3286('0xa9'),'where':{'email':_0x3d00ba},'limit':0x1,'order':[[_0x3286('0xaa'),_0x3286('0xab')]]}]},{'model':db['MailServerOut'],'as':_0x3286('0x44'),'raw':!![]}]})[_0x3286('0x25')](handleEntityNotFound(_0x331008,null))[_0x3286('0x25')](function(_0x328f29){if(_0x328f29){_0x4e2608=_0x328f29;if(_0x328f29[_0x3286('0x44')]){if(_[_0x3286('0xac')](_0x41f70d[_0x3286('0x65')][_0x3286('0xad')])){_0x41f70d[_0x3286('0x65')][_0x3286('0xad')]=util['format']('%s\x20<%s>',_0x328f29['name'],_0x328f29[_0x3286('0xae')]||_0x328f29[_0x3286('0x44')]['user']);}if(_0x41f70d[_0x3286('0x65')]['attachments']&&_0x41f70d[_0x3286('0x65')][_0x3286('0xaf')][_0x3286('0x62')]){for(var _0x545caf=0x0;_0x545caf<_0x41f70d[_0x3286('0x65')]['attachments'][_0x3286('0x62')];_0x545caf+=0x1){_0x41f70d[_0x3286('0x65')][_0x3286('0xaf')][_0x545caf]={'filename':_0x41f70d[_0x3286('0x65')][_0x3286('0xaf')][_0x545caf][_0x3286('0x3f')],'path':path[_0x3286('0xb0')](config[_0x3286('0xb1')],_0x3286('0xb2'),_0x41f70d[_0x3286('0x65')][_0x3286('0xaf')][_0x545caf]['basename'])};}}var _0x3184be={'tls':{'rejectUnauthorized':![]}};if(_[_0x3286('0xac')](_0x328f29['Smtp'][_0x3286('0x80')])){if(_0x328f29[_0x3286('0x44')][_0x3286('0x7d')]){_0x3184be[_0x3286('0xb3')]={'user':_0x328f29[_0x3286('0x44')][_0x3286('0x7a')],'pass':_0x328f29[_0x3286('0x44')][_0x3286('0x7b')]};}_0x3184be[_0x3286('0x7e')]=_0x328f29[_0x3286('0x44')][_0x3286('0x7e')];_0x3184be['port']=_0x328f29[_0x3286('0x44')][_0x3286('0x7f')];_0x3184be['secure']=_0x328f29[_0x3286('0x44')]['secure'];}else{_0x3184be[_0x3286('0x80')]=_0x328f29[_0x3286('0x44')][_0x3286('0x80')];_0x3184be[_0x3286('0xb3')]={'user':_0x328f29[_0x3286('0x44')][_0x3286('0x7a')],'pass':_0x328f29[_0x3286('0x44')][_0x3286('0x7b')]};}return respondWithRpcPromise(_0x3286('0xb4'),_0x3286('0xb5'),{'account':_0x3184be,'message':_0x41f70d[_0x3286('0x65')]});}else{throw new Error('List\x20not\x20found');}}})[_0x3286('0x25')](function(_0x233456){if(_0x233456){_0xf33418=_0x233456;if(_0x4e2608['List']){if(_0x4e2608[_0x3286('0xa8')][_0x3286('0xa9')][_0x3286('0x62')]){return _0x4e2608[_0x3286('0xa8')][_0x3286('0xa9')][0x0];}else{return db[_0x3286('0x94')][_0x3286('0x69')](_['defaults'](_0x41f70d[_0x3286('0x65')],{'firstName':_0x41f70d[_0x3286('0x65')]['to'],'email':_0x41f70d[_0x3286('0x65')]['to'],'phone':_0x41f70d['body']['to'],'ListId':_0x4e2608[_0x3286('0xb6')]}));}}else{throw new Error(_0x3286('0xb7'));}}})[_0x3286('0x25')](function(_0x14b22c){if(_0x14b22c){var _0xff8ca6={'UserId':_0x41f70d[_0x3286('0x7a')]['id'],'ContactId':_0x14b22c['id'],'MailAccountId':_0x4e2608['id'],'inReplyTo':_0xf33418['messageId'],'to':_0x41f70d[_0x3286('0x65')][_0x3286('0xad')],'cc':_0x41f70d['body']['cc'],'subject':_0x41f70d[_0x3286('0x65')]['subject'],'attach':_0x41f70d[_0x3286('0x65')]['attach'],'firstMsgDirection':_0x3286('0xb8'),'lastMsgAt':moment()[_0x3286('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x3286('0xb8'),'lastMsgBody':_0x41f70d['body']['body'],'Messages':[_[_0x3286('0x59')](_0x41f70d[_0x3286('0x65')],{'messageId':_0xf33418[_0x3286('0xb9')],'sentAt':moment()[_0x3286('0xa5')](_0x3286('0xa6')),'read':!![],'MailAccountId':_0x4e2608['id'],'UserId':_0x41f70d[_0x3286('0x7a')]['id'],'ContactId':_0x14b22c['id']})]};if(_0x41f70d[_0x3286('0x65')][_0x3286('0xba')]){_0xff8ca6=_[_0x3286('0x59')](_0xff8ca6,_0x41f70d[_0x3286('0x65')]['Interaction']);}return db[_0x3286('0x91')][_0x3286('0x69')](_0xff8ca6,{'include':[{'model':db['MailMessage'],'as':_0x3286('0xbb')}]});}})[_0x3286('0x25')](respondWithResult(_0x331008,null))[_0x3286('0x5e')](handleError(_0x331008,null));};exports['verifySmtp']=function(_0x138181,_0x404611,_0x525648){return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x138181[_0x3286('0x60')]['id']},'include':[{'model':db[_0x3286('0x61')],'as':'Smtp','raw':!![]}]})[_0x3286('0x25')](handleEntityNotFound(_0x404611,null))['then'](function(_0x233fe5){if(_0x233fe5&&_0x233fe5[_0x3286('0x44')]){var _0x2c180d={'id':_0x233fe5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x233fe5[_0x3286('0x44')][_0x3286('0x80')]){_0x2c180d[_0x3286('0x80')]=_0x233fe5[_0x3286('0x44')][_0x3286('0x80')];}else{_0x2c180d[_0x3286('0x7e')]=_0x233fe5['Smtp']['host'];_0x2c180d['port']=_0x233fe5[_0x3286('0x44')][_0x3286('0x7f')];_0x2c180d['secure']=_0x233fe5[_0x3286('0x44')][_0x3286('0xbc')];}if(_0x233fe5[_0x3286('0x44')][_0x3286('0x7d')]){_0x2c180d[_0x3286('0xb3')]={'user':_0x233fe5[_0x3286('0x44')][_0x3286('0x7a')],'pass':_0x233fe5[_0x3286('0x44')][_0x3286('0x7b')]};}return respondWithRpcPromise('VerifySmtp',_0x3286('0xbd'),{'account':_0x2c180d});}})['then'](respondWithResult(_0x404611,null))['catch'](handleError(_0x404611,null));};exports[_0x3286('0xbe')]=function(_0x523a34,_0x475eac){return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x523a34['params']['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x475eac,null))[_0x3286('0x25')](function(_0x1d4b75){if(_0x1d4b75&&_0x1d4b75[_0x3286('0x80')]){throw new db[(_0x3286('0x21'))][(_0x3286('0x22'))](_0x3286('0xbf'));}return _0x1d4b75;})[_0x3286('0x25')](removeEntity(_0x475eac,null))[_0x3286('0x5e')](handleError(_0x475eac,null));};exports['addAgents']=function(_0x58d012,_0x53cb25,_0x39a301){return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x58d012[_0x3286('0x60')]['id']}})[_0x3286('0x25')](handleEntityNotFound(_0x53cb25,null))[_0x3286('0x25')](function(_0x5f380e){if(_0x5f380e){return _0x5f380e[_0x3286('0xc0')](_0x58d012['body']['ids'],_[_0x3286('0x92')](_0x58d012[_0x3286('0x65')],[_0x3286('0x71'),'id'])||{})['spread'](function(_0x57b3ee){for(var _0x5bf48e=0x0;_0x5bf48e<_0x58d012[_0x3286('0x65')][_0x3286('0x71')]['length'];_0x5bf48e+=0x1){socket[_0x3286('0xc1')]('userMailAccount:save',{'UserId':_0x58d012[_0x3286('0x65')][_0x3286('0x71')][_0x5bf48e],'MailAccountId':_0x58d012['params']['id']});}return _0x57b3ee;});}})[_0x3286('0x25')](respondWithResult(_0x53cb25,null))[_0x3286('0x5e')](handleError(_0x53cb25,null));};exports[_0x3286('0xc2')]=function(_0x5736ca,_0x1fa2fc,_0x812c57){return db[_0x3286('0x48')][_0x3286('0x64')]({'where':{'id':_0x5736ca[_0x3286('0x60')]['id']}})['then'](handleEntityNotFound(_0x1fa2fc,null))[_0x3286('0x25')](function(_0x1894df){if(_0x1894df){return _0x1894df[_0x3286('0xc2')](_0x5736ca['query'][_0x3286('0x71')])['then'](function(){if(_[_0x3286('0xc3')](_0x5736ca[_0x3286('0x4b')][_0x3286('0x71')])){for(var _0x5b14b0=0x0;_0x5b14b0<_0x5736ca[_0x3286('0x4b')][_0x3286('0x71')][_0x3286('0x62')];_0x5b14b0+=0x1){socket[_0x3286('0xc1')](_0x3286('0xc4'),{'UserId':Number(_0x5736ca[_0x3286('0x4b')][_0x3286('0x71')][_0x5b14b0]),'MailAccountId':Number(_0x5736ca[_0x3286('0x60')]['id'])});}}else{socket[_0x3286('0xc1')](_0x3286('0xc4'),{'UserId':Number(_0x5736ca[_0x3286('0x4b')][_0x3286('0x71')]),'MailAccountId':Number(_0x5736ca[_0x3286('0x60')]['id'])});}});}})[_0x3286('0x25')](respondWithStatusCode(_0x1fa2fc,null))[_0x3286('0x5e')](handleError(_0x1fa2fc,null));};exports[_0x3286('0xc5')]=function(_0x2b45b1,_0x1c077f,_0x28507d){var _0x2c5961={};var _0x305ee6={};var _0x3dca2a;var _0x2275bb;return db['MailAccount'][_0x3286('0x6b')]({'where':{'id':_0x2b45b1[_0x3286('0x60')]['id']}})['then'](handleEntityNotFound(_0x1c077f,null))[_0x3286('0x25')](function(_0x26e426){if(_0x26e426){_0x3dca2a=_0x26e426;_0x305ee6[_0x3286('0x4e')]=_[_0x3286('0x4c')](db[_0x3286('0x95')]['rawAttributes']);_0x305ee6[_0x3286('0x4b')]=_[_0x3286('0x4c')](_0x2b45b1[_0x3286('0x4b')]);_0x305ee6['filters']=_[_0x3286('0x6e')](_0x305ee6[_0x3286('0x4e')],_0x305ee6[_0x3286('0x4b')]);_0x2c5961[_0x3286('0x4f')]=_[_0x3286('0x6e')](_0x305ee6[_0x3286('0x4e')],qs[_0x3286('0x50')](_0x2b45b1[_0x3286('0x4b')][_0x3286('0x50')]));_0x2c5961[_0x3286('0x4f')]=_0x2c5961[_0x3286('0x4f')][_0x3286('0x62')]?_0x2c5961['attributes']:_0x305ee6[_0x3286('0x4e')];_0x2c5961[_0x3286('0x54')]=qs['sort'](_0x2b45b1['query'][_0x3286('0x55')]);_0x2c5961[_0x3286('0x56')]=qs[_0x3286('0x4d')](_[_0x3286('0x57')](_0x2b45b1[_0x3286('0x4b')],_0x305ee6[_0x3286('0x4d')]));if(_0x2b45b1['query'][_0x3286('0x58')]){_0x2c5961[_0x3286('0x56')]=_[_0x3286('0x59')](_0x2c5961[_0x3286('0x56')],{'$or':_[_0x3286('0x47')](_0x2c5961['attributes'],function(_0x19f552){var _0x32c4d2={};_0x32c4d2[_0x19f552]={'$like':'%'+_0x2b45b1[_0x3286('0x4b')]['filter']+'%'};return _0x32c4d2;})});}_0x2c5961=_[_0x3286('0x59')]({},_0x2c5961,_0x2b45b1[_0x3286('0x63')]);return _0x3dca2a[_0x3286('0xc5')](_0x2c5961);}})['then'](function(_0x9d4d90){if(_0x9d4d90){_0x2275bb=_0x9d4d90['length'];if(!_0x2b45b1[_0x3286('0x4b')][_0x3286('0x51')]('nolimit')){_0x2c5961['limit']=qs[_0x3286('0x53')](_0x2b45b1[_0x3286('0x4b')][_0x3286('0x53')]);_0x2c5961[_0x3286('0x34')]=qs[_0x3286('0x34')](_0x2b45b1['query']['offset']);}return _0x3dca2a['getAgents'](_0x2c5961);}})[_0x3286('0x25')](function(_0x5de582){if(_0x5de582){return _0x5de582?{'count':_0x2275bb,'rows':_0x5de582}:null;}})[_0x3286('0x25')](respondWithResult(_0x1c077f,null))['catch'](handleError(_0x1c077f,null));}; \ No newline at end of file +var _0x4c9d=['rawAttributes','fieldName','type','key','map','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','MailServerIn','mandatoryDispositionPause','keys','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','length','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','MailAccountId','removeAnswers','email','ListId','isNil','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','updatedAt','from','%s\x20<%s>','attachments','root','auth','secure','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','limit','Content-Range','apply','update','destroy','get','MailAccounts','stack','send','index','Imap','MailServerOut','Smtp','Pause','MailAccount'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4c9d[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0xd4c9('0x0'));var emlformat=require(_0xd4c9('0x1'));var rimraf=require(_0xd4c9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4c9('0x3'));var rp=require(_0xd4c9('0x4'));var moment=require(_0xd4c9('0x5'));var BPromise=require(_0xd4c9('0x6'));var Mustache=require(_0xd4c9('0x7'));var util=require(_0xd4c9('0x8'));var path=require(_0xd4c9('0x9'));var sox=require(_0xd4c9('0xa'));var csv=require(_0xd4c9('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd4c9('0xc'));var crypto=require(_0xd4c9('0xd'));var jsforce=require(_0xd4c9('0xe'));var deskjs=require(_0xd4c9('0xf'));var toCsv=require(_0xd4c9('0xb'));var querystring=require('querystring');var Papa=require(_0xd4c9('0x10'));var Redis=require(_0xd4c9('0x11'));var authService=require(_0xd4c9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4c9('0x13'));var config=require('../../config/environment');var db=require(_0xd4c9('0x14'))['db'];config[_0xd4c9('0x15')]=_[_0xd4c9('0x16')](config['redis'],{'host':_0xd4c9('0x17'),'port':0x18eb});var socket=require(_0xd4c9('0x18'))(new Redis(config[_0xd4c9('0x15')]));require(_0xd4c9('0x19'))[_0xd4c9('0x1a')](socket);var jayson=require(_0xd4c9('0x1b'));var client=jayson[_0xd4c9('0x1c')][_0xd4c9('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x1e8953,_0x471ca0,_0x9aa580){if(_0x9aa580){var _0x47ccee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x47ccee[_0xd4c9('0x1e')](_0x471ca0)){return _0x1e8953;}else{throw new db[(_0xd4c9('0x1f'))]['ValidationError'](_0xd4c9('0x20'));}}else{return _0x1e8953;}}function respondWithRpcPromise(_0x458fc4,_0x4806bd,_0x4057d0,_0x42fd51){return new BPromise(function(_0x3ca10b,_0x255db2){var _0x9c862b=_0x42fd51||client;return _0x9c862b[_0xd4c9('0x21')](_0x458fc4,_0x4057d0)[_0xd4c9('0x22')](function(_0x209dc6){logger[_0xd4c9('0x23')](_0xd4c9('0x24'),_0x4806bd,_0xd4c9('0x25'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x4806bd,'request\x20sent',JSON[_0xd4c9('0x26')](_0x209dc6));if(_0x209dc6[_0xd4c9('0x27')]){if(_0x209dc6[_0xd4c9('0x27')][_0xd4c9('0x28')]===0x1f4){logger[_0xd4c9('0x27')](_0xd4c9('0x24'),_0x4806bd,_0x209dc6['error'][_0xd4c9('0x29')]);return _0x255db2(_0x209dc6[_0xd4c9('0x27')][_0xd4c9('0x29')]);}logger[_0xd4c9('0x27')](_0xd4c9('0x24'),_0x4806bd,_0x209dc6[_0xd4c9('0x27')]['message']);return _0x3ca10b(_0x209dc6['error'][_0xd4c9('0x29')]);}else{logger[_0xd4c9('0x23')](_0xd4c9('0x24'),_0x4806bd,_0xd4c9('0x25'));_0x3ca10b(_0x209dc6['result'][_0xd4c9('0x29')]);}})['catch'](function(_0x3c78dc){logger[_0xd4c9('0x27')](_0xd4c9('0x24'),_0x4806bd,_0x3c78dc);_0x255db2(_0x3c78dc);});});}function respondWithStatusCode(_0x2ded54,_0x105040){_0x105040=_0x105040||0xcc;return function(_0x2417fb){if(_0x2417fb){return _0x2ded54[_0xd4c9('0x2a')](_0x105040);}return _0x2ded54[_0xd4c9('0x2b')](_0x105040)[_0xd4c9('0x2c')]();};}function respondWithResult(_0x5f38d1,_0x28b733){_0x28b733=_0x28b733||0xc8;return function(_0x1c39db){if(_0x1c39db){return _0x5f38d1[_0xd4c9('0x2b')](_0x28b733)[_0xd4c9('0x2d')](_0x1c39db);}};}function respondWithFilteredResult(_0x2db6d8,_0x563a04){return function(_0x38d22f){if(_0x38d22f){var _0x4bf1ca=_0x38d22f['count'],_0x1da5d7=_0x563a04[_0xd4c9('0x2e')],_0x4fad8d=_0x563a04[_0xd4c9('0x2e')]+_0x563a04[_0xd4c9('0x2f')],_0x1c394b;if(_0x4fad8d>=_0x4bf1ca){_0x4fad8d=_0x4bf1ca;_0x1c394b=0xc8;}else{_0x1c394b=0xce;}_0x2db6d8[_0xd4c9('0x2b')](_0x1c394b);return _0x2db6d8['set'](_0xd4c9('0x30'),_0x1da5d7+'-'+_0x4fad8d+'/'+_0x4bf1ca)[_0xd4c9('0x2d')](_0x38d22f);}return null;};}function patchUpdates(_0x430322){return function(_0xd5a527){try{jsonpatch[_0xd4c9('0x31')](_0xd5a527,_0x430322,!![]);}catch(_0x2b7a10){return BPromise['reject'](_0x2b7a10);}return _0xd5a527['save']();};}function saveUpdates(_0xc22ee4,_0x130a9d){return function(_0x14a99a){if(_0x14a99a){return _0x14a99a[_0xd4c9('0x32')](_0xc22ee4)['then'](function(_0x2ed2ed){return _0x2ed2ed;});}return null;};}function removeEntity(_0x141e6c,_0x8f4623){return function(_0x6fb1bc){if(_0x6fb1bc){return _0x6fb1bc[_0xd4c9('0x33')]()[_0xd4c9('0x22')](function(){var _0x3c13a6=_0x6fb1bc[_0xd4c9('0x34')]({'plain':!![]});var _0x2d7042=_0xd4c9('0x35');return db['UserProfileResource'][_0xd4c9('0x33')]({'where':{'type':_0x2d7042,'resourceId':_0x3c13a6['id']}})[_0xd4c9('0x22')](function(){return _0x6fb1bc;});})[_0xd4c9('0x22')](function(){_0x141e6c[_0xd4c9('0x2b')](0xcc)[_0xd4c9('0x2c')]();});}};}function handleEntityNotFound(_0x4bb6c4,_0x5b523f){return function(_0x1a417e){if(!_0x1a417e){_0x4bb6c4[_0xd4c9('0x2a')](0x194);}return _0x1a417e;};}function handleError(_0xb539b2,_0xa8f451){_0xa8f451=_0xa8f451||0x1f4;return function(_0x1f00c5){logger['error'](_0x1f00c5[_0xd4c9('0x36')]);if(_0x1f00c5['name']){delete _0x1f00c5['name'];}_0xb539b2[_0xd4c9('0x2b')](_0xa8f451)[_0xd4c9('0x37')](_0x1f00c5);};}exports[_0xd4c9('0x38')]=function(_0x5d6af6,_0x58919b){var _0x16d198={'include':[{'model':db['MailServerIn'],'as':_0xd4c9('0x39')},{'model':db[_0xd4c9('0x3a')],'as':_0xd4c9('0x3b')},{'model':db[_0xd4c9('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3a9bde={},_0x42a6ff={'count':0x0,'rows':[]};var _0x1939d4=_['map'](db[_0xd4c9('0x3d')][_0xd4c9('0x3e')],function(_0x174033){return{'name':_0x174033[_0xd4c9('0x3f')],'type':_0x174033[_0xd4c9('0x40')][_0xd4c9('0x41')]};});_0x3a9bde['model']=_[_0xd4c9('0x42')](_0x1939d4,_0xd4c9('0x43'));_0x3a9bde['query']=_['keys'](_0x5d6af6[_0xd4c9('0x44')]);_0x3a9bde[_0xd4c9('0x45')]=_[_0xd4c9('0x46')](_0x3a9bde[_0xd4c9('0x47')],_0x3a9bde[_0xd4c9('0x44')]);_0x16d198[_0xd4c9('0x48')]=_[_0xd4c9('0x46')](_0x3a9bde[_0xd4c9('0x47')],qs[_0xd4c9('0x49')](_0x5d6af6[_0xd4c9('0x44')][_0xd4c9('0x49')]));_0x16d198[_0xd4c9('0x48')]=_0x16d198[_0xd4c9('0x48')]['length']?_0x16d198[_0xd4c9('0x48')]:_0x3a9bde[_0xd4c9('0x47')];if(!_0x5d6af6[_0xd4c9('0x44')][_0xd4c9('0x4a')]('nolimit')){_0x16d198[_0xd4c9('0x2f')]=qs['limit'](_0x5d6af6[_0xd4c9('0x44')][_0xd4c9('0x2f')]);_0x16d198[_0xd4c9('0x2e')]=qs['offset'](_0x5d6af6['query']['offset']);}_0x16d198[_0xd4c9('0x4b')]=qs[_0xd4c9('0x4c')](_0x5d6af6[_0xd4c9('0x44')][_0xd4c9('0x4c')]);_0x16d198['where']=qs[_0xd4c9('0x45')](_[_0xd4c9('0x4d')](_0x5d6af6[_0xd4c9('0x44')],_0x3a9bde['filters']));if(_0x5d6af6['query'][_0xd4c9('0x4e')]){_0x16d198[_0xd4c9('0x4f')]=_['merge'](_0x16d198[_0xd4c9('0x4f')],{'$or':_['map'](_0x1939d4,function(_0x3a0bb2){if(_0x3a0bb2[_0xd4c9('0x40')]!==_0xd4c9('0x50')){var _0x262455={};_0x262455[_0x3a0bb2['name']]={'$like':'%'+_0x5d6af6[_0xd4c9('0x44')][_0xd4c9('0x4e')]+'%'};return _0x262455;}})});}_0x16d198=_[_0xd4c9('0x51')]({},_0x16d198,_0x5d6af6[_0xd4c9('0x52')]);var _0x610974={'where':_0x16d198['where']};return db[_0xd4c9('0x3d')][_0xd4c9('0x53')](_0x610974)['then'](function(_0x423a91){_0x42a6ff['count']=_0x423a91;if(_0x5d6af6[_0xd4c9('0x44')][_0xd4c9('0x54')]){_0x16d198[_0xd4c9('0x55')]=[{'all':!![]}];}return db[_0xd4c9('0x3d')][_0xd4c9('0x56')](_0x16d198);})[_0xd4c9('0x22')](function(_0x350321){_0x42a6ff[_0xd4c9('0x57')]=_0x350321;return _0x42a6ff;})[_0xd4c9('0x22')](respondWithFilteredResult(_0x58919b,_0x16d198))[_0xd4c9('0x58')](handleError(_0x58919b,null));};exports[_0xd4c9('0x59')]=function(_0x2a339c,_0x1e3960){var _0x4e11fd={'raw':![],'where':{'id':_0x2a339c[_0xd4c9('0x5a')]['id']},'include':[{'model':db[_0xd4c9('0x5b')],'as':'Imap'},{'model':db[_0xd4c9('0x3a')],'as':_0xd4c9('0x3b')},{'model':db[_0xd4c9('0x3c')],'as':_0xd4c9('0x5c')}]},_0x37288f={};_0x37288f[_0xd4c9('0x47')]=_[_0xd4c9('0x5d')](db[_0xd4c9('0x3d')]['rawAttributes']);_0x37288f[_0xd4c9('0x44')]=_[_0xd4c9('0x5d')](_0x2a339c[_0xd4c9('0x44')]);_0x37288f[_0xd4c9('0x45')]=_[_0xd4c9('0x46')](_0x37288f['model'],_0x37288f[_0xd4c9('0x44')]);_0x4e11fd[_0xd4c9('0x48')]=_['intersection'](_0x37288f[_0xd4c9('0x47')],qs[_0xd4c9('0x49')](_0x2a339c[_0xd4c9('0x44')]['fields']));_0x4e11fd['attributes']=_0x4e11fd[_0xd4c9('0x48')]['length']?_0x4e11fd[_0xd4c9('0x48')]:_0x37288f[_0xd4c9('0x47')];if(_0x2a339c[_0xd4c9('0x44')][_0xd4c9('0x54')]){_0x4e11fd['include']=[{'all':!![]}];}_0x4e11fd=_[_0xd4c9('0x51')]({},_0x4e11fd,_0x2a339c[_0xd4c9('0x52')]);return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')](_0x4e11fd)[_0xd4c9('0x22')](handleEntityNotFound(_0x1e3960,null))[_0xd4c9('0x22')](respondWithResult(_0x1e3960,null))[_0xd4c9('0x58')](handleError(_0x1e3960,null));};exports[_0xd4c9('0x32')]=function(_0x5ed1e9,_0x3e10ee){if(_0x5ed1e9[_0xd4c9('0x5f')]['id']){delete _0x5ed1e9[_0xd4c9('0x5f')]['id'];}return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x5ed1e9[_0xd4c9('0x5a')]['id']},'include':[{'model':db[_0xd4c9('0x5b')],'as':_0xd4c9('0x39')},{'model':db[_0xd4c9('0x3a')],'as':_0xd4c9('0x3b')},{'model':db['Pause'],'as':_0xd4c9('0x5c')}]})[_0xd4c9('0x22')](handleEntityNotFound(_0x3e10ee,null))[_0xd4c9('0x22')](saveUpdates(_0x5ed1e9[_0xd4c9('0x5f')],null))[_0xd4c9('0x22')](function(_0x45a95c){if(_0x45a95c&&_0x5ed1e9[_0xd4c9('0x5f')]['Imap']){return db[_0xd4c9('0x5b')]['update'](_0x5ed1e9[_0xd4c9('0x5f')]['Imap'],{'where':{'MailAccountId':_0x45a95c['id']}})[_0xd4c9('0x22')](function(){return _0x45a95c;});}return _0x45a95c;})[_0xd4c9('0x22')](function(_0x414877){if(_0x414877&&_0x5ed1e9['body']['Smtp']){return db[_0xd4c9('0x3a')][_0xd4c9('0x32')](_0x5ed1e9['body']['Smtp'],{'where':{'MailAccountId':_0x414877['id']}})['then'](function(){return _0x414877;});}return _0x414877;})[_0xd4c9('0x22')](respondWithResult(_0x3e10ee,null))[_0xd4c9('0x58')](handleError(_0x3e10ee,null));};exports[_0xd4c9('0x60')]=function(_0xed9fa1,_0x595e7f){return db['MailAccount'][_0xd4c9('0x60')]()[_0xd4c9('0x22')](respondWithResult(_0x595e7f,null))[_0xd4c9('0x58')](handleError(_0x595e7f,null));};exports[_0xd4c9('0x61')]=function(_0x2b06ff,_0x50fec6,_0x1fd53e){if(_0x2b06ff[_0xd4c9('0x5f')]['id']){delete _0x2b06ff[_0xd4c9('0x5f')]['id'];}return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x2b06ff[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x50fec6,null))[_0xd4c9('0x22')](function(_0x22573d){if(_0x22573d){_0x2b06ff[_0xd4c9('0x5f')]['MailAccountId']=_0x22573d['id'];return db[_0xd4c9('0x62')][_0xd4c9('0x63')](_0x2b06ff['body']);}})['then'](respondWithResult(_0x50fec6,null))[_0xd4c9('0x58')](handleError(_0x50fec6,null));};exports[_0xd4c9('0x64')]=function(_0x24efee,_0x49ad25,_0x1aefea){var _0x5bb91f={'raw':![],'where':{}};var _0x2d3807={};var _0x28d8e7={'count':0x0,'rows':[]};return db['MailAccount'][_0xd4c9('0x65')]({'where':{'id':_0x24efee['params']['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x49ad25,null))[_0xd4c9('0x22')](function(_0x7c3aba){if(_0x7c3aba){_0x2d3807[_0xd4c9('0x47')]=_[_0xd4c9('0x5d')](db[_0xd4c9('0x62')][_0xd4c9('0x3e')]);_0x2d3807[_0xd4c9('0x44')]=_['keys'](_0x24efee[_0xd4c9('0x44')]);_0x2d3807['filters']=_[_0xd4c9('0x46')](_0x2d3807[_0xd4c9('0x47')],_0x2d3807['query']);_0x5bb91f['attributes']=_[_0xd4c9('0x46')](_0x2d3807[_0xd4c9('0x47')],qs[_0xd4c9('0x49')](_0x24efee[_0xd4c9('0x44')][_0xd4c9('0x49')]));_0x5bb91f[_0xd4c9('0x48')]=_0x5bb91f[_0xd4c9('0x48')][_0xd4c9('0x66')]?_0x5bb91f['attributes']:_0x2d3807[_0xd4c9('0x47')];if(!_0x24efee['query']['hasOwnProperty'](_0xd4c9('0x67'))){_0x5bb91f[_0xd4c9('0x2f')]=qs['limit'](_0x24efee[_0xd4c9('0x44')][_0xd4c9('0x2f')]);_0x5bb91f['offset']=qs[_0xd4c9('0x2e')](_0x24efee['query'][_0xd4c9('0x2e')]);}_0x5bb91f[_0xd4c9('0x4b')]=qs[_0xd4c9('0x4c')](_0x24efee['query'][_0xd4c9('0x4c')]);_0x5bb91f['where']=qs[_0xd4c9('0x45')](_[_0xd4c9('0x4d')](_0x24efee['query'],_0x2d3807[_0xd4c9('0x45')]));_0x5bb91f['where']['MailAccountId']=_0x7c3aba['id'];if(_0x24efee[_0xd4c9('0x44')]['filter']){_0x5bb91f[_0xd4c9('0x4f')]=_[_0xd4c9('0x51')](_0x5bb91f[_0xd4c9('0x4f')],{'$or':_[_0xd4c9('0x42')](_0x5bb91f[_0xd4c9('0x48')],function(_0x3a9076){var _0x40698a={};_0x40698a[_0x3a9076]={'$like':'%'+_0x24efee[_0xd4c9('0x44')][_0xd4c9('0x4e')]+'%'};return _0x40698a;})});}_0x5bb91f=_[_0xd4c9('0x51')]({},_0x5bb91f,_0x24efee['options']);return db[_0xd4c9('0x62')][_0xd4c9('0x53')]({'where':_0x5bb91f['where']})[_0xd4c9('0x22')](function(_0x1bec83){_0x28d8e7[_0xd4c9('0x53')]=_0x1bec83;if(_0x24efee['query'][_0xd4c9('0x54')]){_0x5bb91f[_0xd4c9('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xd4c9('0x56')](_0x5bb91f);})[_0xd4c9('0x22')](function(_0x8d70ec){_0x28d8e7['rows']=_0x8d70ec;return _0x28d8e7;});}})[_0xd4c9('0x22')](respondWithFilteredResult(_0x49ad25,_0x5bb91f))[_0xd4c9('0x58')](handleError(_0x49ad25,null));};exports[_0xd4c9('0x68')]=function(_0x4f4c82,_0x198d08,_0x1abfda){return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x4f4c82[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x198d08,null))[_0xd4c9('0x22')](function(_0x117208){if(_0x117208){return _0x117208[_0xd4c9('0x68')](_0x4f4c82[_0xd4c9('0x44')][_0xd4c9('0x69')]);}})['then'](respondWithStatusCode(_0x198d08,null))[_0xd4c9('0x58')](handleError(_0x198d08,null));};exports['addAnswer']=function(_0x88e46e,_0x4df7f5,_0x3413d1){if(_0x88e46e['body']['id']){delete _0x88e46e[_0xd4c9('0x5f')]['id'];}return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x88e46e[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x4df7f5,null))[_0xd4c9('0x22')](function(_0x6a5b72){if(_0x6a5b72){_0x88e46e[_0xd4c9('0x5f')]['MailAccountId']=_0x6a5b72['id'];return db[_0xd4c9('0x6a')][_0xd4c9('0x63')](_0x88e46e['body']);}})[_0xd4c9('0x22')](respondWithResult(_0x4df7f5,null))[_0xd4c9('0x58')](handleError(_0x4df7f5,null));};exports[_0xd4c9('0x6b')]=function(_0x374132,_0x14e11b,_0x50da5c){var _0x228fa8={'raw':![],'where':{}};var _0x19d511={};var _0x38b759={'count':0x0,'rows':[]};return db['MailAccount'][_0xd4c9('0x65')]({'where':{'id':_0x374132[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x14e11b,null))[_0xd4c9('0x22')](function(_0x4e66ff){if(_0x4e66ff){_0x19d511['model']=_[_0xd4c9('0x5d')](db[_0xd4c9('0x6a')][_0xd4c9('0x3e')]);_0x19d511[_0xd4c9('0x44')]=_['keys'](_0x374132[_0xd4c9('0x44')]);_0x19d511[_0xd4c9('0x45')]=_[_0xd4c9('0x46')](_0x19d511[_0xd4c9('0x47')],_0x19d511['query']);_0x228fa8[_0xd4c9('0x48')]=_[_0xd4c9('0x46')](_0x19d511['model'],qs[_0xd4c9('0x49')](_0x374132[_0xd4c9('0x44')]['fields']));_0x228fa8['attributes']=_0x228fa8['attributes'][_0xd4c9('0x66')]?_0x228fa8[_0xd4c9('0x48')]:_0x19d511[_0xd4c9('0x47')];if(!_0x374132[_0xd4c9('0x44')]['hasOwnProperty'](_0xd4c9('0x67'))){_0x228fa8[_0xd4c9('0x2f')]=qs[_0xd4c9('0x2f')](_0x374132[_0xd4c9('0x44')][_0xd4c9('0x2f')]);_0x228fa8[_0xd4c9('0x2e')]=qs['offset'](_0x374132[_0xd4c9('0x44')][_0xd4c9('0x2e')]);}_0x228fa8[_0xd4c9('0x4b')]=qs['sort'](_0x374132[_0xd4c9('0x44')][_0xd4c9('0x4c')]);_0x228fa8[_0xd4c9('0x4f')]=qs[_0xd4c9('0x45')](_[_0xd4c9('0x4d')](_0x374132['query'],_0x19d511[_0xd4c9('0x45')]));_0x228fa8[_0xd4c9('0x4f')][_0xd4c9('0x6c')]=_0x4e66ff['id'];if(_0x374132['query'][_0xd4c9('0x4e')]){_0x228fa8[_0xd4c9('0x4f')]=_[_0xd4c9('0x51')](_0x228fa8[_0xd4c9('0x4f')],{'$or':_['map'](_0x228fa8[_0xd4c9('0x48')],function(_0x2c0f60){var _0x515e12={};_0x515e12[_0x2c0f60]={'$like':'%'+_0x374132[_0xd4c9('0x44')][_0xd4c9('0x4e')]+'%'};return _0x515e12;})});}_0x228fa8=_[_0xd4c9('0x51')]({},_0x228fa8,_0x374132[_0xd4c9('0x52')]);return db[_0xd4c9('0x6a')]['count']({'where':_0x228fa8[_0xd4c9('0x4f')]})[_0xd4c9('0x22')](function(_0x48c390){_0x38b759[_0xd4c9('0x53')]=_0x48c390;if(_0x374132[_0xd4c9('0x44')]['includeAll']){_0x228fa8['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xd4c9('0x56')](_0x228fa8);})['then'](function(_0xad9889){_0x38b759[_0xd4c9('0x57')]=_0xad9889;return _0x38b759;});}})[_0xd4c9('0x22')](respondWithFilteredResult(_0x14e11b,_0x228fa8))[_0xd4c9('0x58')](handleError(_0x14e11b,null));};exports[_0xd4c9('0x6d')]=function(_0x58dc06,_0x299542,_0x4023fd){return db[_0xd4c9('0x3d')]['find']({'where':{'id':_0x58dc06[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x299542,null))[_0xd4c9('0x22')](function(_0xa76c8d){if(_0xa76c8d){return _0xa76c8d['removeAnswers'](_0x58dc06[_0xd4c9('0x44')][_0xd4c9('0x69')]);}})[_0xd4c9('0x22')](respondWithStatusCode(_0x299542,null))[_0xd4c9('0x58')](handleError(_0x299542,null));};exports['create']=function(_0xaba5b5,_0x113bf7){var _0x51612={'name':_0xaba5b5[_0xd4c9('0x5f')]['name'],'key':_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x41')],'email':_0xaba5b5['body'][_0xd4c9('0x6e')],'ListId':_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x6f')],'active':!_[_0xd4c9('0x70')](_0xaba5b5[_0xd4c9('0x5f')]['active'])?_0xaba5b5[_0xd4c9('0x5f')]['active']:!![],'description':_0xaba5b5['body'][_0xd4c9('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xd4c9('0x70')](_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x72')])){if(_0xaba5b5['body'][_0xd4c9('0x73')]){_0x51612[_0xd4c9('0x39')][_0xd4c9('0x74')]=_0x51612['Smtp'][_0xd4c9('0x74')]=_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x75')];_0x51612[_0xd4c9('0x39')][_0xd4c9('0x76')]=_0x51612[_0xd4c9('0x3b')][_0xd4c9('0x77')]=_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x78')];}else{_0x51612[_0xd4c9('0x39')]['authentication']=_0x51612[_0xd4c9('0x3b')][_0xd4c9('0x79')]=![];}_0x51612['Imap'][_0xd4c9('0x7a')]=_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x39')]['host'];_0x51612[_0xd4c9('0x39')][_0xd4c9('0x7b')]=_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x39')][_0xd4c9('0x7b')];_0x51612[_0xd4c9('0x3b')][_0xd4c9('0x7a')]=_0xaba5b5['body'][_0xd4c9('0x3b')][_0xd4c9('0x7a')];_0x51612['Smtp']['port']=_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x3b')]['port'];}else{_0x51612[_0xd4c9('0x39')][_0xd4c9('0x7c')]=_0x51612[_0xd4c9('0x3b')]['service']=_0xaba5b5[_0xd4c9('0x5f')][_0xd4c9('0x72')];_0x51612[_0xd4c9('0x39')]['user']=_0x51612[_0xd4c9('0x3b')][_0xd4c9('0x74')]=_0xaba5b5[_0xd4c9('0x5f')]['cuser'];_0x51612[_0xd4c9('0x39')][_0xd4c9('0x76')]=_0x51612[_0xd4c9('0x3b')][_0xd4c9('0x77')]=_0xaba5b5['body'][_0xd4c9('0x78')];}return db[_0xd4c9('0x3d')][_0xd4c9('0x63')](_0x51612,{'include':[{'model':db[_0xd4c9('0x3a')],'as':_0xd4c9('0x3b')},{'model':db[_0xd4c9('0x5b')],'as':_0xd4c9('0x39')}]})[_0xd4c9('0x22')](function(_0x978ad4){var _0x56aa98=_0xaba5b5[_0xd4c9('0x74')]['get']({'plain':!![]});if(!_0x56aa98)throw new Error(_0xd4c9('0x7d'));if(_0x56aa98[_0xd4c9('0x7e')]===_0xd4c9('0x74')){var _0x1baa47=_0x978ad4['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x56aa98[_0xd4c9('0x7f')]},'raw':!![]})[_0xd4c9('0x22')](function(_0x21c6ea){if(_0x21c6ea&&_0x21c6ea['autoAssociation']===0x0){return db[_0xd4c9('0x80')][_0xd4c9('0x63')]({'name':_0x1baa47[_0xd4c9('0x43')],'resourceId':_0x1baa47['id'],'type':_0x21c6ea[_0xd4c9('0x43')],'sectionId':_0x21c6ea['id']},{})[_0xd4c9('0x22')](function(){return _0x978ad4;});}else{return _0x978ad4;}})[_0xd4c9('0x58')](function(_0x3a9251){logger[_0xd4c9('0x27')](_0xd4c9('0x81'),_0x3a9251);throw _0x3a9251;});}return _0x978ad4;})[_0xd4c9('0x22')](respondWithResult(_0x113bf7,0xc9))[_0xd4c9('0x58')](handleError(_0x113bf7,null));};exports[_0xd4c9('0x82')]=function(_0x525d73,_0x1fbe7c,_0x5bfd1d){return db[_0xd4c9('0x3d')][_0xd4c9('0x65')]({'where':{'id':_0x525d73[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x1fbe7c,null))['then'](function(_0x3084a6){if(_0x3084a6){return _0x3084a6['getImap']();}return null;})['then'](respondWithResult(_0x1fbe7c,null))['catch'](handleError(_0x1fbe7c,null));};exports[_0xd4c9('0x83')]=function(_0x1058bc,_0x1baf17,_0x5b514f){if(_0x1058bc[_0xd4c9('0x5f')]['id']){delete _0x1058bc['body']['id'];}return db[_0xd4c9('0x3d')]['find']({'where':{'id':_0x1058bc[_0xd4c9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1baf17,null))['then'](function(_0x459f41){if(_0x459f41){_0x1058bc[_0xd4c9('0x5f')][_0xd4c9('0x6c')]=_0x459f41['id'];return db[_0xd4c9('0x5b')][_0xd4c9('0x63')](_0x1058bc[_0xd4c9('0x5f')]);}})['then'](respondWithResult(_0x1baf17,null))[_0xd4c9('0x58')](handleError(_0x1baf17,null));};exports[_0xd4c9('0x84')]=function(_0x5148e8,_0x382b89,_0x5044cf){return db[_0xd4c9('0x3d')][_0xd4c9('0x65')]({'where':{'id':_0x5148e8['params']['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x382b89,null))[_0xd4c9('0x22')](function(_0x2dafdb){if(_0x2dafdb){return _0x2dafdb['setImap'](null);}return null;})[_0xd4c9('0x22')](respondWithStatusCode(_0x382b89,null))[_0xd4c9('0x58')](handleError(_0x382b89,null));};exports['getSmtp']=function(_0x40648d,_0x4ad38c,_0x37cb31){return db[_0xd4c9('0x3d')]['findOne']({'where':{'id':_0x40648d[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x4ad38c,null))[_0xd4c9('0x22')](function(_0x572b90){if(_0x572b90){return _0x572b90[_0xd4c9('0x85')]();}return null;})[_0xd4c9('0x22')](respondWithResult(_0x4ad38c,null))[_0xd4c9('0x58')](handleError(_0x4ad38c,null));};exports[_0xd4c9('0x86')]=function(_0xfc1caa,_0x491c73,_0x29363d){if(_0xfc1caa[_0xd4c9('0x5f')]['id']){delete _0xfc1caa[_0xd4c9('0x5f')]['id'];}return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0xfc1caa[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x491c73,null))[_0xd4c9('0x22')](function(_0x15b34f){if(_0x15b34f){_0xfc1caa[_0xd4c9('0x5f')][_0xd4c9('0x6c')]=_0x15b34f['id'];return db[_0xd4c9('0x3a')][_0xd4c9('0x63')](_0xfc1caa['body']);}})[_0xd4c9('0x22')](respondWithResult(_0x491c73,null))['catch'](handleError(_0x491c73,null));};exports['removeSmtp']=function(_0x39ee32,_0x58579e,_0x503e78){return db[_0xd4c9('0x3d')][_0xd4c9('0x65')]({'where':{'id':_0x39ee32['params']['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x58579e,null))[_0xd4c9('0x22')](function(_0xd9684f){if(_0xd9684f){return _0xd9684f[_0xd4c9('0x87')](null);}return null;})[_0xd4c9('0x22')](respondWithStatusCode(_0x58579e,null))['catch'](handleError(_0x58579e,null));};exports['addInteraction']=function(_0x33ea2d,_0x246abb,_0x38f87d){return db[_0xd4c9('0x88')]['find']({'where':{'id':_0x33ea2d[_0xd4c9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x246abb,null))[_0xd4c9('0x22')](function(_0x24cb29){if(_0x24cb29){return _0x24cb29[_0xd4c9('0x89')](_0x33ea2d[_0xd4c9('0x5f')][_0xd4c9('0x69')],_[_0xd4c9('0x8a')](_0x33ea2d[_0xd4c9('0x5f')],[_0xd4c9('0x69'),'id'])||{});}})[_0xd4c9('0x22')](respondWithResult(_0x246abb,null))[_0xd4c9('0x58')](handleError(_0x246abb,null));};exports[_0xd4c9('0x8b')]=function(_0x521d56,_0x3431dd,_0x201f93){var _0x14a52f={'raw':![],'where':{}};var _0x56a97c={};var _0x4e0550={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x521d56[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x3431dd,null))[_0xd4c9('0x22')](function(_0x1c5f9f){if(_0x1c5f9f){_0x56a97c[_0xd4c9('0x47')]=_[_0xd4c9('0x5d')](db['MailInteraction'][_0xd4c9('0x3e')]);_0x56a97c['query']=_[_0xd4c9('0x5d')](_0x521d56[_0xd4c9('0x44')]);_0x56a97c['filters']=_['intersection'](_0x56a97c[_0xd4c9('0x47')],_0x56a97c[_0xd4c9('0x44')]);_0x14a52f[_0xd4c9('0x48')]=_[_0xd4c9('0x46')](_0x56a97c[_0xd4c9('0x47')],qs[_0xd4c9('0x49')](_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x49')]));_0x14a52f['attributes']=_0x14a52f[_0xd4c9('0x48')][_0xd4c9('0x66')]?_0x14a52f[_0xd4c9('0x48')]:_0x56a97c['model'];if(!_0x521d56[_0xd4c9('0x44')]['hasOwnProperty'](_0xd4c9('0x67'))){_0x14a52f[_0xd4c9('0x2f')]=qs[_0xd4c9('0x2f')](_0x521d56['query'][_0xd4c9('0x2f')]);_0x14a52f[_0xd4c9('0x2e')]=qs[_0xd4c9('0x2e')](_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x2e')]);}_0x14a52f[_0xd4c9('0x4b')]=qs[_0xd4c9('0x4c')](_0x521d56[_0xd4c9('0x44')]['sort']);_0x14a52f[_0xd4c9('0x4f')]=qs[_0xd4c9('0x45')](_[_0xd4c9('0x4d')](_0x521d56[_0xd4c9('0x44')],_0x56a97c[_0xd4c9('0x45')]));_0x14a52f[_0xd4c9('0x4f')]['MailAccountId']=_0x1c5f9f['id'];if(_0x521d56[_0xd4c9('0x44')]['filter']){_0x14a52f[_0xd4c9('0x4f')]=_['merge'](_0x14a52f[_0xd4c9('0x4f')],{'$or':_['map'](_0x14a52f['attributes'],function(_0x52f30c){var _0x175d25={};_0x175d25[_0x52f30c]={'$like':'%'+_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x4e')]+'%'};return _0x175d25;})});}_0x14a52f=_[_0xd4c9('0x51')]({},_0x14a52f,_0x521d56[_0xd4c9('0x52')]);return db['MailInteraction']['count']({'where':_0x14a52f['where']})['then'](function(_0x2add8e){_0x4e0550['count']=_0x2add8e;if(_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x54')]){_0x14a52f[_0xd4c9('0x55')]=[{'model':db['CmContact'],'as':_0xd4c9('0x8c'),'required':![]},{'model':db[_0xd4c9('0x8d')],'as':_0xd4c9('0x8e'),'attributes':[_0xd4c9('0x43'),_0xd4c9('0x8f'),'internal'],'required':![]},{'model':db[_0xd4c9('0x90')],'as':_0xd4c9('0x91'),'attributes':['id',_0xd4c9('0x43'),_0xd4c9('0x92')],'where':_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x93')]?{'id':_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x93')]}:undefined,'required':_0x521d56[_0xd4c9('0x44')][_0xd4c9('0x93')]?!![]:![]}];}return db[_0xd4c9('0x88')][_0xd4c9('0x56')](_0x14a52f);})[_0xd4c9('0x22')](function(_0x15ea7){_0x4e0550[_0xd4c9('0x57')]=_0x15ea7;return _0x4e0550;});}})[_0xd4c9('0x22')](respondWithFilteredResult(_0x3431dd,_0x14a52f))[_0xd4c9('0x58')](handleError(_0x3431dd,null));};exports[_0xd4c9('0x94')]=function(_0x474468,_0x4ba87b,_0x4b8fa0){return db['MailAccount'][_0xd4c9('0x65')]({'where':{'id':_0x474468[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x4ba87b,null))[_0xd4c9('0x22')](function(_0x80b603){if(_0x80b603){return db['sequelize']['transaction'](function(_0x823583){return db[_0xd4c9('0x95')][_0xd4c9('0x33')]({'where':{'MailAccountId':_0x474468['params']['id']},'transaction':_0x823583})[_0xd4c9('0x22')](function(_0xb2d0e9){var _0x57de7d=_[_0xd4c9('0x42')](_0x474468[_0xd4c9('0x5f')],function(_0x5c4a10){_0x5c4a10[_0xd4c9('0x6c')]=_0x474468[_0xd4c9('0x5a')]['id'];return _0x5c4a10;});return db[_0xd4c9('0x95')][_0xd4c9('0x96')](_0x57de7d,{'transaction':_0x823583});});})[_0xd4c9('0x22')](function(){return db[_0xd4c9('0x95')][_0xd4c9('0x97')]({'where':{'MailAccountId':_0x474468['params']['id']},'order':_0xd4c9('0x98')});});}})[_0xd4c9('0x22')](respondWithResult(_0x4ba87b,null))['catch'](handleError(_0x4ba87b,null));};exports['getApplications']=function(_0x1d3351,_0x10405b,_0x43939c){var _0x1d0c34={};var _0x31d0bc={};var _0x3261d1;var _0x2b3ba5;return db[_0xd4c9('0x3d')][_0xd4c9('0x65')]({'where':{'id':_0x1d3351[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x10405b,null))[_0xd4c9('0x22')](function(_0x595254){if(_0x595254){_0x3261d1=_0x595254;_0x31d0bc[_0xd4c9('0x47')]=_[_0xd4c9('0x5d')](db[_0xd4c9('0x95')][_0xd4c9('0x3e')]);_0x31d0bc[_0xd4c9('0x44')]=_[_0xd4c9('0x5d')](_0x1d3351[_0xd4c9('0x44')]);_0x31d0bc[_0xd4c9('0x45')]=_[_0xd4c9('0x46')](_0x31d0bc[_0xd4c9('0x47')],_0x31d0bc['query']);_0x1d0c34['attributes']=_['intersection'](_0x31d0bc[_0xd4c9('0x47')],qs['fields'](_0x1d3351[_0xd4c9('0x44')][_0xd4c9('0x49')]));_0x1d0c34[_0xd4c9('0x48')]=_0x1d0c34[_0xd4c9('0x48')][_0xd4c9('0x66')]?_0x1d0c34['attributes']:_0x31d0bc[_0xd4c9('0x47')];_0x1d0c34['order']=qs['sort'](_0x1d3351[_0xd4c9('0x44')][_0xd4c9('0x4c')]);_0x1d0c34[_0xd4c9('0x4f')]=qs[_0xd4c9('0x45')](_[_0xd4c9('0x4d')](_0x1d3351[_0xd4c9('0x44')],_0x31d0bc[_0xd4c9('0x45')]));if(_0x1d3351['query'][_0xd4c9('0x4e')]){_0x1d0c34[_0xd4c9('0x4f')]=_[_0xd4c9('0x51')](_0x1d0c34[_0xd4c9('0x4f')],{'$or':_['map'](_0x1d0c34[_0xd4c9('0x48')],function(_0x5850fa){var _0x38810a={};_0x38810a[_0x5850fa]={'$like':'%'+_0x1d3351[_0xd4c9('0x44')][_0xd4c9('0x4e')]+'%'};return _0x38810a;})});}_0x1d0c34=_[_0xd4c9('0x51')]({},_0x1d0c34,_0x1d3351[_0xd4c9('0x52')]);return _0x3261d1[_0xd4c9('0x99')](_0x1d0c34);}})[_0xd4c9('0x22')](function(_0x523358){if(_0x523358){_0x2b3ba5=_0x523358['length'];if(!_0x1d3351['query'][_0xd4c9('0x4a')](_0xd4c9('0x67'))){_0x1d0c34[_0xd4c9('0x2f')]=qs[_0xd4c9('0x2f')](_0x1d3351[_0xd4c9('0x44')][_0xd4c9('0x2f')]);_0x1d0c34[_0xd4c9('0x2e')]=qs['offset'](_0x1d3351['query'][_0xd4c9('0x2e')]);}return _0x3261d1[_0xd4c9('0x99')](_0x1d0c34);}})[_0xd4c9('0x22')](function(_0x58df28){if(_0x58df28){return _0x58df28?{'count':_0x2b3ba5,'rows':_0x58df28}:null;}})['then'](respondWithResult(_0x10405b,null))[_0xd4c9('0x58')](handleError(_0x10405b,null));};exports['getMessages']=function(_0x2afa71,_0x1aa96b,_0x2e7161){var _0x362eb0={'raw':!![],'where':{}};var _0x288809={};var _0x2a4339={'count':0x0,'rows':[]};return db[_0xd4c9('0x3d')][_0xd4c9('0x65')]({'where':{'id':_0x2afa71[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x1aa96b,null))['then'](function(_0x4dd7cb){if(_0x4dd7cb){_0x288809['model']=_['keys'](db[_0xd4c9('0x9a')][_0xd4c9('0x3e')]);_0x288809[_0xd4c9('0x44')]=_[_0xd4c9('0x5d')](_0x2afa71[_0xd4c9('0x44')]);_0x288809[_0xd4c9('0x45')]=_[_0xd4c9('0x46')](_0x288809[_0xd4c9('0x47')],_0x288809[_0xd4c9('0x44')]);_0x362eb0[_0xd4c9('0x48')]=_[_0xd4c9('0x46')](_0x288809[_0xd4c9('0x47')],qs[_0xd4c9('0x49')](_0x2afa71[_0xd4c9('0x44')][_0xd4c9('0x49')]));_0x362eb0['attributes']=_0x362eb0[_0xd4c9('0x48')][_0xd4c9('0x66')]?_0x362eb0[_0xd4c9('0x48')]:_0x288809[_0xd4c9('0x47')];if(!_0x2afa71[_0xd4c9('0x44')][_0xd4c9('0x4a')](_0xd4c9('0x67'))){_0x362eb0[_0xd4c9('0x2f')]=qs[_0xd4c9('0x2f')](_0x2afa71['query'][_0xd4c9('0x2f')]);_0x362eb0['offset']=qs[_0xd4c9('0x2e')](_0x2afa71[_0xd4c9('0x44')][_0xd4c9('0x2e')]);}_0x362eb0['order']=qs[_0xd4c9('0x4c')](_0x2afa71['query'][_0xd4c9('0x4c')]);_0x362eb0[_0xd4c9('0x4f')]=qs['filters'](_[_0xd4c9('0x4d')](_0x2afa71[_0xd4c9('0x44')],_0x288809[_0xd4c9('0x45')]));_0x362eb0[_0xd4c9('0x4f')][_0xd4c9('0x6c')]=_0x4dd7cb['id'];if(_0x2afa71[_0xd4c9('0x44')]['filter']){_0x362eb0[_0xd4c9('0x4f')]=_[_0xd4c9('0x51')](_0x362eb0['where'],{'$or':_[_0xd4c9('0x42')](_0x362eb0['attributes'],function(_0x590303){var _0x2e28f2={};_0x2e28f2[_0x590303]={'$like':'%'+_0x2afa71[_0xd4c9('0x44')]['filter']+'%'};return _0x2e28f2;})});}if(_0x2afa71[_0xd4c9('0x44')][_0xd4c9('0x9b')]){var _0x28bd72=_0x2afa71[_0xd4c9('0x44')][_0xd4c9('0x9b')][_0xd4c9('0x9c')](',');var _0xa59790={};_0xa59790[_0x28bd72[0x0]]={'$gte':moment(_0x28bd72[0x1])[_0xd4c9('0x9d')](_0xd4c9('0x9e'))};_0x362eb0[_0xd4c9('0x4f')]=_['merge'](_0x362eb0['where'],_0xa59790);}_0x362eb0=_['merge']({},_0x362eb0,_0x2afa71[_0xd4c9('0x52')]);return db['MailMessage']['count']({'where':_0x362eb0[_0xd4c9('0x4f')]})['then'](function(_0x5025d1){_0x2a4339[_0xd4c9('0x53')]=_0x5025d1;if(_0x2afa71[_0xd4c9('0x44')][_0xd4c9('0x54')]){_0x362eb0[_0xd4c9('0x55')]=[{'all':!![]}];}return db[_0xd4c9('0x9a')][_0xd4c9('0x56')](_0x362eb0);})[_0xd4c9('0x22')](function(_0x29222d){_0x2a4339[_0xd4c9('0x57')]=_0x29222d;return _0x2a4339;});}})[_0xd4c9('0x22')](respondWithFilteredResult(_0x1aa96b,_0x362eb0))[_0xd4c9('0x58')](handleError(_0x1aa96b,null));};exports[_0xd4c9('0x37')]=function(_0x526807,_0x1d53c5,_0x49d79e){var _0x436e47,_0x1f51d2={},_0x16dd47;if(_0x526807['body']['to']){_0x16dd47=_0x526807[_0xd4c9('0x5f')]['to'][_0xd4c9('0x9c')](',')[0x0];}return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x526807[_0xd4c9('0x5a')]['id']},'include':[{'model':db[_0xd4c9('0x9f')],'as':_0xd4c9('0xa0'),'include':[{'model':db[_0xd4c9('0xa1')],'as':_0xd4c9('0xa2'),'where':{'email':_0x16dd47},'limit':0x1,'order':[[_0xd4c9('0xa3'),'DESC']]}]},{'model':db[_0xd4c9('0x3a')],'as':_0xd4c9('0x3b'),'raw':!![]}]})[_0xd4c9('0x22')](handleEntityNotFound(_0x1d53c5,null))[_0xd4c9('0x22')](function(_0x1460dd){if(_0x1460dd){_0x436e47=_0x1460dd;if(_0x1460dd[_0xd4c9('0x3b')]){if(_[_0xd4c9('0x70')](_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xa4')])){_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xa4')]=util[_0xd4c9('0x9d')](_0xd4c9('0xa5'),_0x1460dd['name'],_0x1460dd[_0xd4c9('0x6e')]||_0x1460dd['Smtp']['user']);}if(_0x526807[_0xd4c9('0x5f')]['attachments']&&_0x526807['body'][_0xd4c9('0xa6')][_0xd4c9('0x66')]){for(var _0x3823a3=0x0;_0x3823a3<_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xa6')][_0xd4c9('0x66')];_0x3823a3+=0x1){_0x526807[_0xd4c9('0x5f')]['attachments'][_0x3823a3]={'filename':_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xa6')][_0x3823a3]['name'],'path':path['join'](config[_0xd4c9('0xa7')],'server/files/attachments',_0x526807[_0xd4c9('0x5f')]['attachments'][_0x3823a3]['basename'])};}}var _0x261929={'tls':{'rejectUnauthorized':![]}};if(_[_0xd4c9('0x70')](_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x7c')])){if(_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x79')]){_0x261929[_0xd4c9('0xa8')]={'user':_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x74')],'pass':_0x1460dd['Smtp'][_0xd4c9('0x77')]};}_0x261929[_0xd4c9('0x7a')]=_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x7a')];_0x261929[_0xd4c9('0x7b')]=_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x7b')];_0x261929[_0xd4c9('0xa9')]=_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0xa9')];}else{_0x261929[_0xd4c9('0x7c')]=_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x7c')];_0x261929['auth']={'user':_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x74')],'pass':_0x1460dd[_0xd4c9('0x3b')][_0xd4c9('0x77')]};}return respondWithRpcPromise('SendMail',_0xd4c9('0xaa'),{'account':_0x261929,'message':_0x526807[_0xd4c9('0x5f')]});}else{throw new Error(_0xd4c9('0xab'));}}})['then'](function(_0x1ca46c){if(_0x1ca46c){_0x1f51d2=_0x1ca46c;if(_0x436e47[_0xd4c9('0xa0')]){if(_0x436e47[_0xd4c9('0xa0')]['Contacts'][_0xd4c9('0x66')]){return _0x436e47[_0xd4c9('0xa0')][_0xd4c9('0xa2')][0x0];}else{return db[_0xd4c9('0xa1')][_0xd4c9('0x63')](_[_0xd4c9('0x16')](_0x526807['body'],{'firstName':_0x526807[_0xd4c9('0x5f')]['to'],'email':_0x526807[_0xd4c9('0x5f')]['to'],'phone':_0x526807[_0xd4c9('0x5f')]['to'],'ListId':_0x436e47[_0xd4c9('0x6f')]}));}}else{throw new Error(_0xd4c9('0xab'));}}})['then'](function(_0x5305b4){if(_0x5305b4){var _0x351a55={'UserId':_0x526807[_0xd4c9('0x74')]['id'],'ContactId':_0x5305b4['id'],'MailAccountId':_0x436e47['id'],'inReplyTo':_0x1f51d2[_0xd4c9('0xac')],'to':_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xa4')],'cc':_0x526807[_0xd4c9('0x5f')]['cc'],'subject':_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xad')],'attach':_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xae')],'firstMsgDirection':_0xd4c9('0xaf'),'lastMsgAt':moment()[_0xd4c9('0x9d')](_0xd4c9('0x9e')),'lastMsgDirection':'out','lastMsgBody':_0x526807[_0xd4c9('0x5f')][_0xd4c9('0x5f')],'Messages':[_['merge'](_0x526807[_0xd4c9('0x5f')],{'messageId':_0x1f51d2[_0xd4c9('0xac')],'sentAt':moment()[_0xd4c9('0x9d')](_0xd4c9('0x9e')),'read':!![],'MailAccountId':_0x436e47['id'],'UserId':_0x526807['user']['id'],'ContactId':_0x5305b4['id']})]};if(_0x526807[_0xd4c9('0x5f')][_0xd4c9('0xb0')]){_0x351a55=_[_0xd4c9('0x51')](_0x351a55,_0x526807['body']['Interaction']);}return db[_0xd4c9('0x88')]['create'](_0x351a55,{'include':[{'model':db[_0xd4c9('0x9a')],'as':_0xd4c9('0xb1')}]});}})[_0xd4c9('0x22')](respondWithResult(_0x1d53c5,null))[_0xd4c9('0x58')](handleError(_0x1d53c5,null));};exports['verifySmtp']=function(_0x1ab36d,_0x23a87f,_0x37e515){return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x1ab36d[_0xd4c9('0x5a')]['id']},'include':[{'model':db[_0xd4c9('0x3a')],'as':'Smtp','raw':!![]}]})[_0xd4c9('0x22')](handleEntityNotFound(_0x23a87f,null))[_0xd4c9('0x22')](function(_0x2c9d01){if(_0x2c9d01&&_0x2c9d01[_0xd4c9('0x3b')]){var _0x1d823b={'id':_0x2c9d01['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2c9d01[_0xd4c9('0x3b')][_0xd4c9('0x7c')]){_0x1d823b['service']=_0x2c9d01[_0xd4c9('0x3b')][_0xd4c9('0x7c')];}else{_0x1d823b[_0xd4c9('0x7a')]=_0x2c9d01[_0xd4c9('0x3b')][_0xd4c9('0x7a')];_0x1d823b['port']=_0x2c9d01[_0xd4c9('0x3b')][_0xd4c9('0x7b')];_0x1d823b[_0xd4c9('0xa9')]=_0x2c9d01['Smtp'][_0xd4c9('0xa9')];}if(_0x2c9d01[_0xd4c9('0x3b')][_0xd4c9('0x79')]){_0x1d823b[_0xd4c9('0xa8')]={'user':_0x2c9d01['Smtp'][_0xd4c9('0x74')],'pass':_0x2c9d01[_0xd4c9('0x3b')]['pass']};}return respondWithRpcPromise(_0xd4c9('0xb2'),'verifySmtp',{'account':_0x1d823b});}})[_0xd4c9('0x22')](respondWithResult(_0x23a87f,null))[_0xd4c9('0x58')](handleError(_0x23a87f,null));};exports[_0xd4c9('0x33')]=function(_0x2ada72,_0x1325bb){return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x2ada72[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x1325bb,null))[_0xd4c9('0x22')](function(_0x4148d3){if(_0x4148d3&&_0x4148d3[_0xd4c9('0x7c')]){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4148d3;})[_0xd4c9('0x22')](removeEntity(_0x1325bb,null))[_0xd4c9('0x58')](handleError(_0x1325bb,null));};exports[_0xd4c9('0xb3')]=function(_0x452529,_0x565c8c,_0xed2ce){return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x452529[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x565c8c,null))[_0xd4c9('0x22')](function(_0x28d83c){if(_0x28d83c){return _0x28d83c[_0xd4c9('0xb3')](_0x452529[_0xd4c9('0x5f')]['ids'],_[_0xd4c9('0x8a')](_0x452529[_0xd4c9('0x5f')],[_0xd4c9('0x69'),'id'])||{})[_0xd4c9('0xb4')](function(_0x5aa99d){for(var _0x1b2fa6=0x0;_0x1b2fa6<_0x452529['body'][_0xd4c9('0x69')][_0xd4c9('0x66')];_0x1b2fa6+=0x1){socket[_0xd4c9('0xb5')](_0xd4c9('0xb6'),{'UserId':_0x452529[_0xd4c9('0x5f')][_0xd4c9('0x69')][_0x1b2fa6],'MailAccountId':_0x452529[_0xd4c9('0x5a')]['id']});}return _0x5aa99d;});}})[_0xd4c9('0x22')](respondWithResult(_0x565c8c,null))[_0xd4c9('0x58')](handleError(_0x565c8c,null));};exports[_0xd4c9('0xb7')]=function(_0x4baa8c,_0x3943f0,_0x3140db){return db[_0xd4c9('0x3d')][_0xd4c9('0x5e')]({'where':{'id':_0x4baa8c[_0xd4c9('0x5a')]['id']}})[_0xd4c9('0x22')](handleEntityNotFound(_0x3943f0,null))[_0xd4c9('0x22')](function(_0x157a1b){if(_0x157a1b){return _0x157a1b[_0xd4c9('0xb7')](_0x4baa8c[_0xd4c9('0x44')]['ids'])[_0xd4c9('0x22')](function(){if(_['isArray'](_0x4baa8c[_0xd4c9('0x44')][_0xd4c9('0x69')])){for(var _0xd7c3cf=0x0;_0xd7c3cf<_0x4baa8c[_0xd4c9('0x44')][_0xd4c9('0x69')]['length'];_0xd7c3cf+=0x1){socket['emit'](_0xd4c9('0xb8'),{'UserId':Number(_0x4baa8c['query'][_0xd4c9('0x69')][_0xd7c3cf]),'MailAccountId':Number(_0x4baa8c[_0xd4c9('0x5a')]['id'])});}}else{socket[_0xd4c9('0xb5')](_0xd4c9('0xb8'),{'UserId':Number(_0x4baa8c[_0xd4c9('0x44')][_0xd4c9('0x69')]),'MailAccountId':Number(_0x4baa8c[_0xd4c9('0x5a')]['id'])});}});}})[_0xd4c9('0x22')](respondWithStatusCode(_0x3943f0,null))[_0xd4c9('0x58')](handleError(_0x3943f0,null));};exports[_0xd4c9('0xb9')]=function(_0x24ee08,_0x393dca,_0x381d01){var _0x1e015e={};var _0x609d1c={};var _0x55dfdc;var _0x245b04;return db[_0xd4c9('0x3d')][_0xd4c9('0x65')]({'where':{'id':_0x24ee08['params']['id']}})['then'](handleEntityNotFound(_0x393dca,null))[_0xd4c9('0x22')](function(_0xbc208c){if(_0xbc208c){_0x55dfdc=_0xbc208c;_0x609d1c['model']=_[_0xd4c9('0x5d')](db['User'][_0xd4c9('0x3e')]);_0x609d1c[_0xd4c9('0x44')]=_[_0xd4c9('0x5d')](_0x24ee08[_0xd4c9('0x44')]);_0x609d1c[_0xd4c9('0x45')]=_['intersection'](_0x609d1c[_0xd4c9('0x47')],_0x609d1c[_0xd4c9('0x44')]);_0x1e015e[_0xd4c9('0x48')]=_['intersection'](_0x609d1c['model'],qs[_0xd4c9('0x49')](_0x24ee08[_0xd4c9('0x44')][_0xd4c9('0x49')]));_0x1e015e[_0xd4c9('0x48')]=_0x1e015e[_0xd4c9('0x48')]['length']?_0x1e015e[_0xd4c9('0x48')]:_0x609d1c['model'];_0x1e015e[_0xd4c9('0x4b')]=qs['sort'](_0x24ee08['query'][_0xd4c9('0x4c')]);_0x1e015e[_0xd4c9('0x4f')]=qs[_0xd4c9('0x45')](_['pick'](_0x24ee08['query'],_0x609d1c[_0xd4c9('0x45')]));if(_0x24ee08[_0xd4c9('0x44')][_0xd4c9('0x4e')]){_0x1e015e[_0xd4c9('0x4f')]=_[_0xd4c9('0x51')](_0x1e015e[_0xd4c9('0x4f')],{'$or':_[_0xd4c9('0x42')](_0x1e015e[_0xd4c9('0x48')],function(_0x1f4df0){var _0x34b5e0={};_0x34b5e0[_0x1f4df0]={'$like':'%'+_0x24ee08[_0xd4c9('0x44')][_0xd4c9('0x4e')]+'%'};return _0x34b5e0;})});}_0x1e015e=_[_0xd4c9('0x51')]({},_0x1e015e,_0x24ee08['options']);return _0x55dfdc[_0xd4c9('0xb9')](_0x1e015e);}})['then'](function(_0x3d340a){if(_0x3d340a){_0x245b04=_0x3d340a[_0xd4c9('0x66')];if(!_0x24ee08['query'][_0xd4c9('0x4a')](_0xd4c9('0x67'))){_0x1e015e[_0xd4c9('0x2f')]=qs['limit'](_0x24ee08[_0xd4c9('0x44')][_0xd4c9('0x2f')]);_0x1e015e[_0xd4c9('0x2e')]=qs[_0xd4c9('0x2e')](_0x24ee08[_0xd4c9('0x44')][_0xd4c9('0x2e')]);}return _0x55dfdc[_0xd4c9('0xb9')](_0x1e015e);}})['then'](function(_0x34884e){if(_0x34884e){return _0x34884e?{'count':_0x245b04,'rows':_0x34884e}:null;}})[_0xd4c9('0x22')](respondWithResult(_0x393dca,null))['catch'](handleError(_0x393dca,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 960e069..5e2f116 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 _0xd62c=['MailAccount','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x573d89,_0x4cb34f){var _0x41e1ad=function(_0xbab0b1){while(--_0xbab0b1){_0x573d89['push'](_0x573d89['shift']());}};_0x41e1ad(++_0x4cb34f);}(_0xd62c,0x18c));var _0xcd62=function(_0x256acf,_0x511bbf){_0x256acf=_0x256acf-0x0;var _0x2afa9c=_0xd62c[_0x256acf];return _0x2afa9c;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0xcd62('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcd62('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd62('0x2'),'afterDestroy':'remove'};function emitEvent(_0x23e464){return function(_0x4b0238,_0x2e372c,_0x24a2ba){MailAccountEvents[_0xcd62('0x3')](_0x23e464+':'+_0x4b0238['id'],_0x4b0238);MailAccountEvents[_0xcd62('0x3')](_0x23e464,_0x4b0238);_0x24a2ba(null);};}for(var e in events){if(events[_0xcd62('0x4')](e)){var event=events[e];MailAccount[_0xcd62('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x02df=['hook','exports','events','../../mysqldb','MailAccount','save','update','emit','hasOwnProperty'];(function(_0x17bf7a,_0x329622){var _0x152b1f=function(_0x5d431a){while(--_0x5d431a){_0x17bf7a['push'](_0x17bf7a['shift']());}};_0x152b1f(++_0x329622);}(_0x02df,0x6e));var _0xf02d=function(_0x4092b2,_0x3ca3e0){_0x4092b2=_0x4092b2-0x0;var _0xd1df59=_0x02df[_0x4092b2];return _0xd1df59;};'use strict';var EventEmitter=require(_0xf02d('0x0'));var MailAccount=require(_0xf02d('0x1'))['db'][_0xf02d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf02d('0x3'),'afterUpdate':_0xf02d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x363dbc){return function(_0x888d15,_0x513e09,_0x221f62){MailAccountEvents[_0xf02d('0x5')](_0x363dbc+':'+_0x888d15['id'],_0x888d15);MailAccountEvents['emit'](_0x363dbc,_0x888d15);_0x221f62(null);};}for(var e in events){if(events[_0xf02d('0x6')](e)){var event=events[e];MailAccount[_0xf02d('0x7')](e,emitEvent(event));}}module[_0xf02d('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2500b3b..adc008f 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 _0xada7=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x125896,_0x3ff224){var _0x3f7447=function(_0x401efc){while(--_0x401efc){_0x125896['push'](_0x125896['shift']());}};_0x3f7447(++_0x3ff224);}(_0xada7,0x120));var _0x7ada=function(_0x573647,_0x46e315){_0x573647=_0x573647-0x0;var _0x3c1fb4=_0xada7[_0x573647];return _0x3c1fb4;};'use strict';var _=require(_0x7ada('0x0'));var util=require('util');var logger=require(_0x7ada('0x1'))('api');var moment=require(_0x7ada('0x2'));var BPromise=require(_0x7ada('0x3'));var rp=require(_0x7ada('0x4'));var fs=require('fs');var path=require(_0x7ada('0x5'));var rimraf=require(_0x7ada('0x6'));var config=require(_0x7ada('0x7'));var attributes=require(_0x7ada('0x8'));module[_0x7ada('0x9')]=function(_0x36065a,_0xf42292){return _0x36065a['define'](_0x7ada('0xa'),attributes,{'tableName':_0x7ada('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb58=['path','./mailAccount.attributes','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3995eb,_0x4832c6){var _0x141074=function(_0x38f649){while(--_0x38f649){_0x3995eb['push'](_0x3995eb['shift']());}};_0x141074(++_0x4832c6);}(_0xcb58,0x93));var _0x8cb5=function(_0x72736,_0x3d666b){_0x72736=_0x72736-0x0;var _0x51c33d=_0xcb58[_0x72736];return _0x51c33d;};'use strict';var _=require(_0x8cb5('0x0'));var util=require(_0x8cb5('0x1'));var logger=require(_0x8cb5('0x2'))('api');var moment=require(_0x8cb5('0x3'));var BPromise=require(_0x8cb5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cb5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8cb5('0x6'));module['exports']=function(_0x3d2899,_0xdbce5d){return _0x3d2899[_0x8cb5('0x7')]('MailAccount',attributes,{'tableName':'mail_accounts','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 90a52f6..728d16f 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 _0x8b1a=['model','stringify','catch','MailAccount','find','ShowMailAccount','body','mail','keys','CmContact','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','priority','asc','close','Contacts','create','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','spread','interaction','created','originTo','originCc','bcc','Attachment','Attachments','User','name','UserId','unshift','agent','*,*,*,*','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x7bfdf6,_0x1d49da){var _0x579102=function(_0x3eaf1e){while(--_0x3eaf1e){_0x7bfdf6['push'](_0x7bfdf6['shift']());}};_0x579102(++_0x1d49da);}(_0x8b1a,0x152));var _0xa8b1=function(_0x1615d4,_0x4e1530){_0x1615d4=_0x1615d4-0x0;var _0x57edfe=_0x8b1a[_0x1615d4];return _0x57edfe;};'use strict';var _=require(_0xa8b1('0x0'));var util=require(_0xa8b1('0x1'));var moment=require(_0xa8b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8b1('0x3'));var fs=require('fs');var Redis=require(_0xa8b1('0x4'));var db=require(_0xa8b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8b1('0x6'))(_0xa8b1('0x7'));var config=require(_0xa8b1('0x8'));var jayson=require(_0xa8b1('0x9'));var client=jayson[_0xa8b1('0xa')][_0xa8b1('0xb')]({'port':0x232c});config['redis']=_[_0xa8b1('0xc')](config[_0xa8b1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8b1('0xe'))(new Redis(config[_0xa8b1('0xd')]));require('./mailAccount.socket')[_0xa8b1('0xf')](socket);function respondWithRpcPromise(_0x2f0be9,_0x1c9b89,_0x5f19d4){return new BPromise(function(_0x5da796,_0x30f1d9){return client['request'](_0x2f0be9,_0x5f19d4)[_0xa8b1('0x10')](function(_0x54249d){logger[_0xa8b1('0x11')](_0xa8b1('0x12'),_0x1c9b89,_0xa8b1('0x13'));logger[_0xa8b1('0x14')](_0xa8b1('0x15'),_0x1c9b89,_0xa8b1('0x13'),JSON['stringify'](_0x54249d));if(_0x54249d[_0xa8b1('0x16')]){if(_0x54249d[_0xa8b1('0x16')]['code']===0x1f4){logger[_0xa8b1('0x16')]('MailAccount,\x20%s,\x20%s',_0x1c9b89,_0x54249d[_0xa8b1('0x16')]['message']);return _0x30f1d9(_0x54249d[_0xa8b1('0x16')][_0xa8b1('0x17')]);}logger[_0xa8b1('0x16')](_0xa8b1('0x12'),_0x1c9b89,_0x54249d[_0xa8b1('0x16')][_0xa8b1('0x17')]);return _0x5da796(_0x54249d[_0xa8b1('0x16')][_0xa8b1('0x17')]);}else{logger['info'](_0xa8b1('0x12'),_0x1c9b89,_0xa8b1('0x13'));_0x5da796(_0x54249d[_0xa8b1('0x18')]['message']);}})['catch'](function(_0x4e8ff4){logger['error'](_0xa8b1('0x12'),_0x1c9b89,_0x4e8ff4);_0x30f1d9(_0x4e8ff4);});});}exports[_0xa8b1('0x19')]=function(_0x2dda33){var _0x5746e2=this;return new Promise(function(_0x558c77,_0x22918b){return db['MailAccount'][_0xa8b1('0x1a')]({'raw':_0x2dda33[_0xa8b1('0x1b')]?_0x2dda33[_0xa8b1('0x1b')][_0xa8b1('0x1c')]===undefined?!![]:![]:!![],'where':_0x2dda33[_0xa8b1('0x1b')]?_0x2dda33['options'][_0xa8b1('0x1d')]||null:null,'attributes':_0x2dda33['options']?_0x2dda33['options'][_0xa8b1('0x1e')]||null:null,'limit':_0x2dda33[_0xa8b1('0x1b')]?_0x2dda33[_0xa8b1('0x1b')][_0xa8b1('0x1f')]||null:null,'include':_0x2dda33[_0xa8b1('0x1b')]?_0x2dda33[_0xa8b1('0x1b')][_0xa8b1('0x20')]?_[_0xa8b1('0x21')](_0x2dda33['options'][_0xa8b1('0x20')],function(_0x5c3f35){return{'model':db[_0x5c3f35[_0xa8b1('0x22')]],'as':_0x5c3f35['as'],'attributes':_0x5c3f35['attributes'],'include':_0x5c3f35['include']?_[_0xa8b1('0x21')](_0x5c3f35[_0xa8b1('0x20')],function(_0x2503da){return{'model':db[_0x2503da[_0xa8b1('0x22')]],'as':_0x2503da['as'],'attributes':_0x2503da[_0xa8b1('0x1e')],'include':_0x2503da[_0xa8b1('0x20')]?_[_0xa8b1('0x21')](_0x2503da[_0xa8b1('0x20')],function(_0x1f5314){return{'model':db[_0x1f5314[_0xa8b1('0x22')]],'as':_0x1f5314['as'],'attributes':_0x1f5314[_0xa8b1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa8b1('0x10')](function(_0x4f42da){logger[_0xa8b1('0x11')](_0xa8b1('0x19'),_0x2dda33);logger[_0xa8b1('0x14')]('GetMailAccount',_0x2dda33,JSON[_0xa8b1('0x23')](_0x4f42da));_0x558c77(_0x4f42da);})[_0xa8b1('0x24')](function(_0x2c27f2){logger[_0xa8b1('0x16')](_0xa8b1('0x19'),_0x2c27f2[_0xa8b1('0x17')],_0x2dda33);_0x22918b(_0x5746e2['error'](0x1f4,_0x2c27f2['message']));});});};exports['ShowMailAccount']=function(_0x5d01b5){var _0x4cd2b1=this;return new Promise(function(_0x4f57a4,_0x51f204){return db[_0xa8b1('0x25')][_0xa8b1('0x26')]({'raw':_0x5d01b5[_0xa8b1('0x1b')]?_0x5d01b5[_0xa8b1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5d01b5[_0xa8b1('0x1b')]?_0x5d01b5[_0xa8b1('0x1b')]['where']||null:null,'attributes':_0x5d01b5[_0xa8b1('0x1b')]?_0x5d01b5[_0xa8b1('0x1b')]['attributes']||null:null,'include':_0x5d01b5[_0xa8b1('0x1b')]?_0x5d01b5[_0xa8b1('0x1b')]['include']?_[_0xa8b1('0x21')](_0x5d01b5[_0xa8b1('0x1b')][_0xa8b1('0x20')],function(_0x401c4e){return{'model':db[_0x401c4e['model']],'as':_0x401c4e['as'],'attributes':_0x401c4e[_0xa8b1('0x1e')],'include':_0x401c4e[_0xa8b1('0x20')]?_[_0xa8b1('0x21')](_0x401c4e[_0xa8b1('0x20')],function(_0x134649){return{'model':db[_0x134649[_0xa8b1('0x22')]],'as':_0x134649['as'],'attributes':_0x134649[_0xa8b1('0x1e')],'include':_0x134649['include']?_['map'](_0x134649[_0xa8b1('0x20')],function(_0x55dbe4){return{'model':db[_0x55dbe4['model']],'as':_0x55dbe4['as'],'attributes':_0x55dbe4[_0xa8b1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26ca6f){logger[_0xa8b1('0x11')]('ShowMailAccount',_0x5d01b5);logger[_0xa8b1('0x14')](_0xa8b1('0x27'),_0x5d01b5,JSON[_0xa8b1('0x23')](_0x26ca6f));_0x4f57a4(_0x26ca6f);})['catch'](function(_0x267318){logger[_0xa8b1('0x16')](_0xa8b1('0x27'),_0x267318[_0xa8b1('0x17')],_0x5d01b5);_0x51f204(_0x4cd2b1[_0xa8b1('0x16')](0x1f4,_0x267318['message']));});});};exports['NotifyMailAccount']=function(_0x44ddff){var _0x503817=this;return new Promise(function(_0x5f49a8,_0x7bb2d7){var _0x5c8dfb={'body':_0x44ddff[_0xa8b1('0x28')],'channel':_0xa8b1('0x29')};var _0x29f46d=_['difference'](_[_0xa8b1('0x2a')](db[_0xa8b1('0x2b')]['rawAttributes']),['createdAt',_0xa8b1('0x2c'),'CompanyId',_0xa8b1('0x2d')]);var _0x13d0c3=![];if(_0x44ddff['body']['id']){delete _0x44ddff['body']['id'];}if(_[_0xa8b1('0x2e')](_0x44ddff['body'][_0xa8b1('0x2f')])){return _0x7bb2d7(_0x503817[_0xa8b1('0x16')](0x1f4,_0xa8b1('0x30')));}if(_[_0xa8b1('0x2e')](_0x44ddff['body'][_0xa8b1('0x28')])||_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x28')]===''){return _0x7bb2d7(_0x503817['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa8b1('0x2e')](_0x44ddff['body'][_0xa8b1('0x31')])){return _0x7bb2d7(_0x503817[_0xa8b1('0x16')](0x1f4,_0xa8b1('0x32')+_0x29f46d));}if(!_[_0xa8b1('0x33')](_0x29f46d,_0x44ddff[_0xa8b1('0x28')]['mapKey'])){return _0x7bb2d7(_0x503817[_0xa8b1('0x16')](0x1f4,_0xa8b1('0x34')+_0x29f46d));}var _0x1026e4={};_0x1026e4[_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x31')]]=_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x2f')];return db[_0xa8b1('0x25')][_0xa8b1('0x26')]({'where':{'id':_0x44ddff[_0xa8b1('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0xa8b1('0x36'),'include':[{'model':db[_0xa8b1('0x2b')],'as':'Contacts','where':_0x1026e4,'limit':0x1,'order':[[_0xa8b1('0x2c'),_0xa8b1('0x37')]]}]},{'model':db[_0xa8b1('0x38')],'as':_0xa8b1('0x39')},{'model':db[_0xa8b1('0x3a')],'as':_0xa8b1('0x3b')}]})['then'](function(_0x17d28a){if(_0x17d28a&&_0x17d28a[_0xa8b1('0x36')]){var _0xb5b069=_0x17d28a[_0xa8b1('0x3c')]({'plain':!![]});_0x5c8dfb[_0xa8b1('0x35')]=_[_0xa8b1('0x3d')](_0xb5b069,[_0xa8b1('0x39'),_0xa8b1('0x36')]);_0x5c8dfb[_0xa8b1('0x3e')]=_0xb5b069[_0xa8b1('0x39')];_0x5c8dfb['list']=_0xb5b069['List'];_0x5c8dfb['applications']=_['orderBy'](_0x5c8dfb[_0xa8b1('0x3e')],[_0xa8b1('0x3f')],[_0xa8b1('0x40')]);if(_0x5c8dfb[_0xa8b1('0x35')]&&_0x5c8dfb[_0xa8b1('0x35')]['autoclose']){_0x5c8dfb[_0xa8b1('0x3e')]['push']({'id':0x0,'priority':_0x5c8dfb[_0xa8b1('0x3e')]['length']+0x1,'app':_0xa8b1('0x41'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x5c8dfb['account'][_0xa8b1('0x39')]){delete _0x5c8dfb['account'][_0xa8b1('0x39')];}if(_0x5c8dfb['account'][_0xa8b1('0x36')]){delete _0x5c8dfb[_0xa8b1('0x35')][_0xa8b1('0x36')];}if(_0xb5b069[_0xa8b1('0x36')][_0xa8b1('0x42')]['length']){return _0xb5b069[_0xa8b1('0x36')][_0xa8b1('0x42')][0x0];}var _0x5c3ff9=_[_0xa8b1('0xc')](_0x44ddff[_0xa8b1('0x28')],{'firstName':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x2f')],'ListId':_0xb5b069[_0xa8b1('0x2d')]});_0x5c3ff9[_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x31')]]=_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x2f')];return db[_0xa8b1('0x2b')][_0xa8b1('0x43')](_0x5c3ff9);}else{throw new Error(_0xa8b1('0x44'));}})['then'](function(_0x24612d){_0x5c8dfb['contact']=_0x24612d;if(_0x24612d){if(!_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x45')]){_0x44ddff[_0xa8b1('0x28')]['message'][_0xa8b1('0x45')]=rs['generate']()+'\x20'+_0x44ddff['body'][_0xa8b1('0x17')][_0xa8b1('0x2f')];}var _0x16a8d5={'ContactId':_0x24612d['id'],'MailAccountId':_0x44ddff[_0xa8b1('0x35')]['id'],'inReplyTo':_0x44ddff['body'][_0xa8b1('0x17')]['messageId'],'to':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x2f')],'cc':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')]['cc'],'subject':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x46')],'attach':_0x44ddff['body'][_0xa8b1('0x17')][_0xa8b1('0x47')],'lastMsgAt':moment()[_0xa8b1('0x48')](_0xa8b1('0x49')),'lastMsgDirection':'in','lastMsgBody':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x28')]};return db[_0xa8b1('0x4a')][_0xa8b1('0x26')]({'where':{'closed':![],'MailAccountId':_0x44ddff[_0xa8b1('0x35')]['id']},'include':[{'model':db[_0xa8b1('0x4b')],'as':'Messages','attributes':[_0xa8b1('0x45')],'where':{'messageId':_0x44ddff['body'][_0xa8b1('0x17')]['inReplyTo']}}]})[_0xa8b1('0x10')](function(_0x5665a9){if(_0x5665a9){return[_0x5665a9,![]];}return db['MailInteraction']['create'](_0x16a8d5)[_0xa8b1('0x10')](function(_0x4c5fd0){return[_0x4c5fd0,!![]];});});}else{throw new Error(_0xa8b1('0x4c'));}})[_0xa8b1('0x4d')](function(_0x45fd59,_0x179c07){if(_0x45fd59){_0x13d0c3=_0x179c07;if(!_0x179c07){return _0x45fd59['update']({'inReplyTo':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x45')],'to':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x2f')],'cc':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')]['cc'],'subject':_0x44ddff[_0xa8b1('0x28')]['message']['subject'],'attach':_0x45fd59['attach']?_0x45fd59[_0xa8b1('0x47')]:_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x47')],'substatus':null,'substatusAt':moment()[_0xa8b1('0x48')](_0xa8b1('0x49')),'lastMsgAt':moment()['format'](_0xa8b1('0x49')),'lastMsgDirection':'in','lastMsgBody':_0x44ddff[_0xa8b1('0x28')]['body']});}else{return _0x45fd59;}}})[_0xa8b1('0x10')](function(_0x47b3b9){_0x5c8dfb[_0xa8b1('0x4e')]=_0x47b3b9[_0xa8b1('0x3c')]({'plain':!![]});_0x5c8dfb['interaction'][_0xa8b1('0x4f')]=_0x13d0c3;return db[_0xa8b1('0x4b')][_0xa8b1('0x43')]({'body':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x28')],'MailAccountId':_0x44ddff[_0xa8b1('0x35')]['id'],'MailInteractionId':_0x47b3b9['id'],'direction':'in','ContactId':_0x5c8dfb['contact']['id'],'messageId':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x45')],'from':_0x44ddff['body'][_0xa8b1('0x17')][_0xa8b1('0x2f')],'to':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')]['to'],'cc':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')]['cc'],'subject':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x46')],'attach':_0x44ddff[_0xa8b1('0x28')]['message'][_0xa8b1('0x47')],'Attachments':_0x44ddff['body']['message']['attachments'],'originTo':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x50')],'originCc':_0x44ddff[_0xa8b1('0x28')][_0xa8b1('0x17')][_0xa8b1('0x51')],'bcc':_0x44ddff[_0xa8b1('0x28')]['message'][_0xa8b1('0x52')]},{'include':[{'model':db[_0xa8b1('0x53')],'as':_0xa8b1('0x54')}]});})['then'](function(_0x286420){_0x5c8dfb[_0xa8b1('0x17')]=_0x286420;if(_0x5c8dfb[_0xa8b1('0x4e')]['UserId']){return db[_0xa8b1('0x55')][_0xa8b1('0x26')]({'attributes':['id',_0xa8b1('0x56')],'where':{'id':_0x5c8dfb[_0xa8b1('0x4e')][_0xa8b1('0x57')]}})[_0xa8b1('0x10')](function(_0x59080d){if(_0x59080d){_0x5c8dfb[_0xa8b1('0x3e')][_0xa8b1('0x58')]({'id':0x0,'priority':0x0,'app':_0xa8b1('0x59'),'appdata':_0x59080d[_0xa8b1('0x56')]+','+(_0x5c8dfb['account']['waitForTheAssignedAgent']||0xa),'interval':_0xa8b1('0x5a')});}return respondWithRpcPromise(_0xa8b1('0x5b'),_0xa8b1('0x5c'),_0x5c8dfb);});}return respondWithRpcPromise('Start',_0xa8b1('0x5c'),_0x5c8dfb);})[_0xa8b1('0x10')](function(_0x2e5b9b){_0x5f49a8(_0x2e5b9b);})[_0xa8b1('0x24')](function(_0x33a266){_0x7bb2d7(_0x503817['error'](0x1f4,_0x33a266[_0xa8b1('0x17')]));});});}; \ No newline at end of file +var _0xf6e8=['register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','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','find','account','CmList','List','DESC','MailApplication','Applications','Smtp','get','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','List\x20not\x20found','messageId','subject','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','create','contact','attachments','bcc','Attachment','Attachments','User','UserId','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket'];(function(_0x3a4b2a,_0x1d17d2){var _0xe2640e=function(_0x58f4d2){while(--_0x58f4d2){_0x3a4b2a['push'](_0x3a4b2a['shift']());}};_0xe2640e(++_0x1d17d2);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x2b2844,_0x62d41d){_0x2b2844=_0x2b2844-0x0;var _0x3a2a4d=_0xf6e8[_0x2b2844];return _0x3a2a4d;};'use strict';var _=require('lodash');var util=require(_0x8f6e('0x0'));var moment=require(_0x8f6e('0x1'));var BPromise=require(_0x8f6e('0x2'));var rs=require(_0x8f6e('0x3'));var fs=require('fs');var Redis=require(_0x8f6e('0x4'));var db=require(_0x8f6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f6e('0x6'))('rpc');var config=require(_0x8f6e('0x7'));var jayson=require(_0x8f6e('0x8'));var client=jayson['client'][_0x8f6e('0x9')]({'port':0x232c});config[_0x8f6e('0xa')]=_[_0x8f6e('0xb')](config[_0x8f6e('0xa')],{'host':_0x8f6e('0xc'),'port':0x18eb});var socket=require(_0x8f6e('0xd'))(new Redis(config[_0x8f6e('0xa')]));require(_0x8f6e('0xe'))[_0x8f6e('0xf')](socket);function respondWithRpcPromise(_0x35f528,_0x5b62d7,_0x34b6fa){return new BPromise(function(_0x1668bf,_0x4de3d0){return client[_0x8f6e('0x10')](_0x35f528,_0x34b6fa)[_0x8f6e('0x11')](function(_0xa86c9b){logger[_0x8f6e('0x12')](_0x8f6e('0x13'),_0x5b62d7,_0x8f6e('0x14'));logger[_0x8f6e('0x15')](_0x8f6e('0x16'),_0x5b62d7,_0x8f6e('0x14'),JSON[_0x8f6e('0x17')](_0xa86c9b));if(_0xa86c9b[_0x8f6e('0x18')]){if(_0xa86c9b[_0x8f6e('0x18')][_0x8f6e('0x19')]===0x1f4){logger['error'](_0x8f6e('0x13'),_0x5b62d7,_0xa86c9b[_0x8f6e('0x18')]['message']);return _0x4de3d0(_0xa86c9b[_0x8f6e('0x18')][_0x8f6e('0x1a')]);}logger[_0x8f6e('0x18')]('MailAccount,\x20%s,\x20%s',_0x5b62d7,_0xa86c9b['error']['message']);return _0x1668bf(_0xa86c9b[_0x8f6e('0x18')][_0x8f6e('0x1a')]);}else{logger[_0x8f6e('0x12')](_0x8f6e('0x13'),_0x5b62d7,_0x8f6e('0x14'));_0x1668bf(_0xa86c9b[_0x8f6e('0x1b')][_0x8f6e('0x1a')]);}})[_0x8f6e('0x1c')](function(_0x1ffb8f){logger[_0x8f6e('0x18')](_0x8f6e('0x13'),_0x5b62d7,_0x1ffb8f);_0x4de3d0(_0x1ffb8f);});});}exports[_0x8f6e('0x1d')]=function(_0x1d3ae4){var _0x8d79c4=this;return new Promise(function(_0x5c0823,_0x140f20){return db[_0x8f6e('0x1e')][_0x8f6e('0x1f')]({'raw':_0x1d3ae4[_0x8f6e('0x20')]?_0x1d3ae4[_0x8f6e('0x20')][_0x8f6e('0x21')]===undefined?!![]:![]:!![],'where':_0x1d3ae4['options']?_0x1d3ae4['options'][_0x8f6e('0x22')]||null:null,'attributes':_0x1d3ae4[_0x8f6e('0x20')]?_0x1d3ae4[_0x8f6e('0x20')][_0x8f6e('0x23')]||null:null,'limit':_0x1d3ae4[_0x8f6e('0x20')]?_0x1d3ae4['options'][_0x8f6e('0x24')]||null:null,'include':_0x1d3ae4['options']?_0x1d3ae4[_0x8f6e('0x20')][_0x8f6e('0x25')]?_[_0x8f6e('0x26')](_0x1d3ae4['options']['include'],function(_0xcbbfbd){return{'model':db[_0xcbbfbd[_0x8f6e('0x27')]],'as':_0xcbbfbd['as'],'attributes':_0xcbbfbd[_0x8f6e('0x23')],'include':_0xcbbfbd['include']?_['map'](_0xcbbfbd[_0x8f6e('0x25')],function(_0x433802){return{'model':db[_0x433802['model']],'as':_0x433802['as'],'attributes':_0x433802['attributes'],'include':_0x433802['include']?_[_0x8f6e('0x26')](_0x433802[_0x8f6e('0x25')],function(_0x3dadf9){return{'model':db[_0x3dadf9['model']],'as':_0x3dadf9['as'],'attributes':_0x3dadf9[_0x8f6e('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40dae5){logger[_0x8f6e('0x12')](_0x8f6e('0x1d'),_0x1d3ae4);logger[_0x8f6e('0x15')](_0x8f6e('0x1d'),_0x1d3ae4,JSON[_0x8f6e('0x17')](_0x40dae5));_0x5c0823(_0x40dae5);})[_0x8f6e('0x1c')](function(_0x22482c){logger[_0x8f6e('0x18')]('GetMailAccount',_0x22482c[_0x8f6e('0x1a')],_0x1d3ae4);_0x140f20(_0x8d79c4[_0x8f6e('0x18')](0x1f4,_0x22482c[_0x8f6e('0x1a')]));});});};exports['ShowMailAccount']=function(_0x4801e6){var _0x26abac=this;return new Promise(function(_0x33726f,_0x20ca6c){return db[_0x8f6e('0x1e')]['find']({'raw':_0x4801e6['options']?_0x4801e6['options'][_0x8f6e('0x21')]===undefined?!![]:![]:!![],'where':_0x4801e6['options']?_0x4801e6[_0x8f6e('0x20')][_0x8f6e('0x22')]||null:null,'attributes':_0x4801e6[_0x8f6e('0x20')]?_0x4801e6['options'][_0x8f6e('0x23')]||null:null,'include':_0x4801e6['options']?_0x4801e6[_0x8f6e('0x20')][_0x8f6e('0x25')]?_[_0x8f6e('0x26')](_0x4801e6[_0x8f6e('0x20')][_0x8f6e('0x25')],function(_0x449dd2){return{'model':db[_0x449dd2['model']],'as':_0x449dd2['as'],'attributes':_0x449dd2['attributes'],'include':_0x449dd2[_0x8f6e('0x25')]?_['map'](_0x449dd2[_0x8f6e('0x25')],function(_0x10cd4e){return{'model':db[_0x10cd4e[_0x8f6e('0x27')]],'as':_0x10cd4e['as'],'attributes':_0x10cd4e['attributes'],'include':_0x10cd4e[_0x8f6e('0x25')]?_[_0x8f6e('0x26')](_0x10cd4e['include'],function(_0x10db5c){return{'model':db[_0x10db5c['model']],'as':_0x10db5c['as'],'attributes':_0x10db5c[_0x8f6e('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8f6e('0x11')](function(_0x4b60cc){logger[_0x8f6e('0x12')](_0x8f6e('0x28'),_0x4801e6);logger[_0x8f6e('0x15')](_0x8f6e('0x28'),_0x4801e6,JSON[_0x8f6e('0x17')](_0x4b60cc));_0x33726f(_0x4b60cc);})[_0x8f6e('0x1c')](function(_0x3378d3){logger[_0x8f6e('0x18')](_0x8f6e('0x28'),_0x3378d3[_0x8f6e('0x1a')],_0x4801e6);_0x20ca6c(_0x26abac['error'](0x1f4,_0x3378d3[_0x8f6e('0x1a')]));});});};exports[_0x8f6e('0x29')]=function(_0x5d844a){var _0x29409b=this;return new Promise(function(_0x4b818d,_0x1334ca){var _0x4c00d6={'body':_0x5d844a[_0x8f6e('0x2a')],'channel':'mail'};var _0x7e2904=_[_0x8f6e('0x2b')](_[_0x8f6e('0x2c')](db[_0x8f6e('0x2d')][_0x8f6e('0x2e')]),[_0x8f6e('0x2f'),_0x8f6e('0x30'),_0x8f6e('0x31'),_0x8f6e('0x32')]);var _0x544451=![];if(_0x5d844a[_0x8f6e('0x2a')]['id']){delete _0x5d844a[_0x8f6e('0x2a')]['id'];}if(_['isNil'](_0x5d844a['body'][_0x8f6e('0x33')])){return _0x1334ca(_0x29409b[_0x8f6e('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x8f6e('0x34')](_0x5d844a[_0x8f6e('0x2a')]['body'])||_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x2a')]===''){return _0x1334ca(_0x29409b[_0x8f6e('0x18')](0x1f4,_0x8f6e('0x35')));}if(_[_0x8f6e('0x34')](_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x36')])){return _0x1334ca(_0x29409b[_0x8f6e('0x18')](0x1f4,_0x8f6e('0x37')+_0x7e2904));}if(!_[_0x8f6e('0x38')](_0x7e2904,_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x36')])){return _0x1334ca(_0x29409b[_0x8f6e('0x18')](0x1f4,_0x8f6e('0x39')+_0x7e2904));}var _0x2f68b7={};_0x2f68b7[_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x36')]]=_0x5d844a['body'][_0x8f6e('0x33')];return db[_0x8f6e('0x1e')][_0x8f6e('0x3a')]({'where':{'id':_0x5d844a[_0x8f6e('0x3b')]['id']},'include':[{'model':db[_0x8f6e('0x3c')],'as':_0x8f6e('0x3d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2f68b7,'limit':0x1,'order':[[_0x8f6e('0x30'),_0x8f6e('0x3e')]]}]},{'model':db[_0x8f6e('0x3f')],'as':_0x8f6e('0x40')},{'model':db['MailServerOut'],'as':_0x8f6e('0x41')}]})[_0x8f6e('0x11')](function(_0x1b1d72){if(_0x1b1d72&&_0x1b1d72['List']){var _0x4142a1=_0x1b1d72[_0x8f6e('0x42')]({'plain':!![]});_0x4c00d6[_0x8f6e('0x3b')]=_['omit'](_0x4142a1,[_0x8f6e('0x40'),_0x8f6e('0x3d')]);_0x4c00d6['applications']=_0x4142a1[_0x8f6e('0x40')];_0x4c00d6['list']=_0x4142a1['List'];_0x4c00d6[_0x8f6e('0x43')]=_[_0x8f6e('0x44')](_0x4c00d6[_0x8f6e('0x43')],[_0x8f6e('0x45')],[_0x8f6e('0x46')]);if(_0x4c00d6[_0x8f6e('0x3b')]&&_0x4c00d6[_0x8f6e('0x3b')][_0x8f6e('0x47')]){_0x4c00d6['applications'][_0x8f6e('0x48')]({'id':0x0,'priority':_0x4c00d6[_0x8f6e('0x43')][_0x8f6e('0x49')]+0x1,'app':_0x8f6e('0x4a'),'appdata':'autoclose','interval':_0x8f6e('0x4b')});}if(_0x4c00d6[_0x8f6e('0x3b')][_0x8f6e('0x40')]){delete _0x4c00d6[_0x8f6e('0x3b')][_0x8f6e('0x40')];}if(_0x4c00d6[_0x8f6e('0x3b')][_0x8f6e('0x3d')]){delete _0x4c00d6[_0x8f6e('0x3b')][_0x8f6e('0x3d')];}if(_0x4142a1[_0x8f6e('0x3d')]['Contacts'][_0x8f6e('0x49')]){return _0x4142a1[_0x8f6e('0x3d')][_0x8f6e('0x4c')][0x0];}var _0x5e9b72=_[_0x8f6e('0xb')](_0x5d844a[_0x8f6e('0x2a')],{'firstName':_0x5d844a[_0x8f6e('0x2a')]['from'],'ListId':_0x4142a1[_0x8f6e('0x32')]});_0x5e9b72[_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x36')]]=_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x33')];return db['CmContact']['create'](_0x5e9b72);}else{throw new Error(_0x8f6e('0x4d'));}})[_0x8f6e('0x11')](function(_0x120baf){_0x4c00d6['contact']=_0x120baf;if(_0x120baf){if(!_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')]['messageId']){_0x5d844a[_0x8f6e('0x2a')]['message'][_0x8f6e('0x4e')]=rs['generate']()+'\x20'+_0x5d844a['body'][_0x8f6e('0x1a')][_0x8f6e('0x33')];}var _0x599816={'ContactId':_0x120baf['id'],'MailAccountId':_0x5d844a['account']['id'],'inReplyTo':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x4e')],'to':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')]['from'],'cc':_0x5d844a['body'][_0x8f6e('0x1a')]['cc'],'subject':_0x5d844a[_0x8f6e('0x2a')]['message'][_0x8f6e('0x4f')],'attach':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')]['attach'],'lastMsgAt':moment()[_0x8f6e('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x2a')]};return db[_0x8f6e('0x51')]['find']({'where':{'closed':![],'MailAccountId':_0x5d844a[_0x8f6e('0x3b')]['id']},'include':[{'model':db[_0x8f6e('0x52')],'as':_0x8f6e('0x53'),'attributes':[_0x8f6e('0x4e')],'where':{'messageId':_0x5d844a['body']['message'][_0x8f6e('0x54')]}}]})['then'](function(_0x549c76){if(_0x549c76){return[_0x549c76,![]];}return db[_0x8f6e('0x51')]['create'](_0x599816)[_0x8f6e('0x11')](function(_0x328e2e){return[_0x328e2e,!![]];});});}else{throw new Error(_0x8f6e('0x55'));}})[_0x8f6e('0x56')](function(_0x34619d,_0x4ec90b){if(_0x34619d){_0x544451=_0x4ec90b;if(!_0x4ec90b){return _0x34619d[_0x8f6e('0x57')]({'inReplyTo':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x4e')],'to':_0x5d844a['body'][_0x8f6e('0x1a')]['from'],'cc':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')]['cc'],'subject':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')]['subject'],'attach':_0x34619d[_0x8f6e('0x58')]?_0x34619d[_0x8f6e('0x58')]:_0x5d844a[_0x8f6e('0x2a')]['message'][_0x8f6e('0x58')],'substatus':null,'substatusAt':moment()[_0x8f6e('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x8f6e('0x50')](_0x8f6e('0x59')),'lastMsgDirection':'in','lastMsgBody':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x2a')]});}else{return _0x34619d;}}})[_0x8f6e('0x11')](function(_0x8bf0ad){_0x4c00d6[_0x8f6e('0x5a')]=_0x8bf0ad[_0x8f6e('0x42')]({'plain':!![]});_0x4c00d6[_0x8f6e('0x5a')][_0x8f6e('0x5b')]=_0x544451;return db[_0x8f6e('0x52')][_0x8f6e('0x5c')]({'body':_0x5d844a[_0x8f6e('0x2a')]['body'],'MailAccountId':_0x5d844a[_0x8f6e('0x3b')]['id'],'MailInteractionId':_0x8bf0ad['id'],'direction':'in','ContactId':_0x4c00d6[_0x8f6e('0x5d')]['id'],'messageId':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x4e')],'from':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x33')],'to':_0x5d844a[_0x8f6e('0x2a')]['message']['to'],'cc':_0x5d844a[_0x8f6e('0x2a')]['message']['cc'],'subject':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x4f')],'attach':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x58')],'Attachments':_0x5d844a[_0x8f6e('0x2a')][_0x8f6e('0x1a')][_0x8f6e('0x5e')],'originTo':_0x5d844a['body'][_0x8f6e('0x1a')]['originTo'],'originCc':_0x5d844a['body'][_0x8f6e('0x1a')]['originCc'],'bcc':_0x5d844a['body']['message'][_0x8f6e('0x5f')]},{'include':[{'model':db[_0x8f6e('0x60')],'as':_0x8f6e('0x61')}]});})['then'](function(_0x2cc49b){_0x4c00d6[_0x8f6e('0x1a')]=_0x2cc49b;if(_0x4c00d6['interaction']['UserId']){return db[_0x8f6e('0x62')]['find']({'attributes':['id','name'],'where':{'id':_0x4c00d6[_0x8f6e('0x5a')][_0x8f6e('0x63')]}})[_0x8f6e('0x11')](function(_0x3665f9){if(_0x3665f9){_0x4c00d6[_0x8f6e('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3665f9[_0x8f6e('0x64')]+','+(_0x4c00d6[_0x8f6e('0x3b')][_0x8f6e('0x65')]||0xa),'interval':_0x8f6e('0x4b')});}return respondWithRpcPromise(_0x8f6e('0x66'),_0x8f6e('0x67'),_0x4c00d6);});}return respondWithRpcPromise(_0x8f6e('0x66'),_0x8f6e('0x67'),_0x4c00d6);})[_0x8f6e('0x11')](function(_0x8f0c7){_0x4b818d(_0x8f0c7);})[_0x8f6e('0x1c')](function(_0x1845c8){_0x1334ca(_0x29409b[_0x8f6e('0x18')](0x1f4,_0x1845c8[_0x8f6e('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index fdde5b8..deada67 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 _0xf69d=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0xf69d,0xd3));var _0xdf69=function(_0x1d0ab0,_0x40ccfc){_0x1d0ab0=_0x1d0ab0-0x0;var _0x494100=_0xf69d[_0x1d0ab0];return _0x494100;};'use strict';var MailAccountEvents=require(_0xdf69('0x0'));var events=[_0xdf69('0x1'),_0xdf69('0x2'),_0xdf69('0x3')];function createListener(_0xf89475,_0x4e4bdd){return function(_0x3013e5){_0x4e4bdd[_0xdf69('0x4')](_0xf89475,_0x3013e5);};}function removeListener(_0x5b5eec,_0x13ecb6){return function(){MailAccountEvents[_0xdf69('0x5')](_0x5b5eec,_0x13ecb6);};}exports[_0xdf69('0x6')]=function(_0x2d456f){for(var _0x465b1b=0x0,_0x1d2501=events[_0xdf69('0x7')];_0x465b1b<_0x1d2501;_0x465b1b++){var _0x18a08e=events[_0x465b1b];var _0xc1b77e=createListener(_0xdf69('0x8')+_0x18a08e,_0x2d456f);MailAccountEvents['on'](_0x18a08e,_0xc1b77e);}}; \ No newline at end of file +var _0xa9b1=['mailAccount:','remove','update','emit','register','length'];(function(_0x16f536,_0x2eaabf){var _0x5d05e8=function(_0x2e26d4){while(--_0x2e26d4){_0x16f536['push'](_0x16f536['shift']());}};_0x5d05e8(++_0x2eaabf);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x1a9b('0x0'),_0x1a9b('0x1')];function createListener(_0x11c1ff,_0x3f42db){return function(_0xc88712){_0x3f42db[_0x1a9b('0x2')](_0x11c1ff,_0xc88712);};}function removeListener(_0x52f55f,_0x57b453){return function(){MailAccountEvents['removeListener'](_0x52f55f,_0x57b453);};}exports[_0x1a9b('0x3')]=function(_0x15861d){for(var _0x1a78b6=0x0,_0xc55657=events[_0x1a9b('0x4')];_0x1a78b6<_0xc55657;_0x1a78b6++){var _0x16c344=events[_0x1a78b6];var _0x263b84=createListener(_0x1a9b('0x5')+_0x16c344,_0x15861d);MailAccountEvents['on'](_0x16c344,_0x263b84);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index ae38f7b..880571b 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 _0xf7b4=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x7b2e1a,_0x14863e){var _0x3bee38=function(_0x40ee6b){while(--_0x40ee6b){_0x7b2e1a['push'](_0x7b2e1a['shift']());}};_0x3bee38(++_0x14863e);}(_0xf7b4,0x152));var _0x4f7b=function(_0x15c9be,_0x213b7e){_0x15c9be=_0x15c9be-0x0;var _0x1ef66a=_0xf7b4[_0x15c9be];return _0x1ef66a;};'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')](_0x4f7b('0x7'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0xa')](_0x4f7b('0x7'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0xc')](_0x4f7b('0x7'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);module[_0x4f7b('0xe')]=router; \ No newline at end of file +var _0xcf66=['/:id','isAuthenticated','show','update','delete','multer','util','path','express','Router','../../config/environment','./mailApplication.controller'];(function(_0xba290c,_0x5eeb6a){var _0x40e80e=function(_0x44ad40){while(--_0x44ad40){_0xba290c['push'](_0xba290c['shift']());}};_0x40e80e(++_0x5eeb6a);}(_0xcf66,0x71));var _0x6cf6=function(_0x25b1ca,_0x2c7d75){_0x25b1ca=_0x25b1ca-0x0;var _0x1a659d=_0xcf66[_0x25b1ca];return _0x1a659d;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6cf6('0x5'));var controller=require(_0x6cf6('0x6'));router['get'](_0x6cf6('0x7'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x9')]);router['put'](_0x6cf6('0x7'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xa')]);router[_0x6cf6('0xb')](_0x6cf6('0x7'),auth[_0x6cf6('0x8')](),controller['destroy']);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 3745ef4..9938e12 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 _0x555d=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x555d,0x1bd));var _0xd555=function(_0x14286c,_0x4d7a2a){_0x14286c=_0x14286c-0x0;var _0x488f26=_0x555d[_0x14286c];return _0x488f26;};'use strict';var Sequelize=require(_0xd555('0x0'));module[_0xd555('0x1')]={'priority':{'type':Sequelize[_0xd555('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd555('0x3')],'allowNull':![],'defaultValue':_0xd555('0x4')},'appdata':{'type':Sequelize[_0xd555('0x5')]()},'description':{'type':Sequelize[_0xd555('0x3')]},'interval':{'type':Sequelize[_0xd555('0x3')],'defaultValue':_0xd555('0x6')}}; \ No newline at end of file +var _0x9ecd=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x59742b,_0x43d40a){var _0x48d115=function(_0x5bab3e){while(--_0x5bab3e){_0x59742b['push'](_0x59742b['shift']());}};_0x48d115(++_0x43d40a);}(_0x9ecd,0x129));var _0xd9ec=function(_0x54dd8c,_0x18bd4e){_0x54dd8c=_0x54dd8c-0x0;var _0x5e19c1=_0x9ecd[_0x54dd8c];return _0x5e19c1;};'use strict';var Sequelize=require(_0xd9ec('0x0'));module[_0xd9ec('0x1')]={'priority':{'type':Sequelize[_0xd9ec('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd9ec('0x3')],'allowNull':![],'defaultValue':_0xd9ec('0x4')},'appdata':{'type':Sequelize[_0xd9ec('0x5')]()},'description':{'type':Sequelize[_0xd9ec('0x3')]},'interval':{'type':Sequelize[_0xd9ec('0x3')],'defaultValue':_0xd9ec('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9c7eb94..926ce2f 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 _0x3e51=['body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','show','params','model','keys','MailApplication','rawAttributes','query','intersection','fields','attributes','includeAll','merge','options','find','catch'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x3e51,0x74));var _0x13e5=function(_0x55a505,_0x3e3950){_0x55a505=_0x55a505-0x0;var _0x416d89=_0x3e51[_0x55a505];return _0x416d89;};'use strict';var pdf=require(_0x13e5('0x0'));var emlformat=require(_0x13e5('0x1'));var rimraf=require(_0x13e5('0x2'));var zipdir=require(_0x13e5('0x3'));var jsonpatch=require(_0x13e5('0x4'));var rp=require(_0x13e5('0x5'));var moment=require('moment');var BPromise=require(_0x13e5('0x6'));var Mustache=require(_0x13e5('0x7'));var util=require(_0x13e5('0x8'));var path=require(_0x13e5('0x9'));var sox=require(_0x13e5('0xa'));var csv=require(_0x13e5('0xb'));var ejs=require(_0x13e5('0xc'));var fs=require('fs');var _=require(_0x13e5('0xd'));var squel=require('squel');var crypto=require(_0x13e5('0xe'));var jsforce=require(_0x13e5('0xf'));var deskjs=require(_0x13e5('0x10'));var toCsv=require(_0x13e5('0xb'));var querystring=require(_0x13e5('0x11'));var Papa=require('papaparse');var Redis=require(_0x13e5('0x12'));var authService=require(_0x13e5('0x13'));var qs=require(_0x13e5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13e5('0x15'))(_0x13e5('0x16'));var utils=require('../../config/utils');var config=require(_0x13e5('0x17'));var db=require(_0x13e5('0x18'))['db'];function respondWithStatusCode(_0x3499b7,_0x1c2f94){_0x1c2f94=_0x1c2f94||0xcc;return function(_0x3b3d13){if(_0x3b3d13){return _0x3499b7['sendStatus'](_0x1c2f94);}return _0x3499b7['status'](_0x1c2f94)[_0x13e5('0x19')]();};}function respondWithResult(_0x2d61a7,_0xb1dd18){_0xb1dd18=_0xb1dd18||0xc8;return function(_0x287427){if(_0x287427){return _0x2d61a7[_0x13e5('0x1a')](_0xb1dd18)[_0x13e5('0x1b')](_0x287427);}};}function respondWithFilteredResult(_0x25e11f,_0xba7e5){return function(_0x10ff61){if(_0x10ff61){var _0x4f1c1d=_0x10ff61[_0x13e5('0x1c')],_0x2b2afe=_0xba7e5[_0x13e5('0x1d')],_0x40cf2d=_0xba7e5[_0x13e5('0x1d')]+_0xba7e5['limit'],_0x1e8d5e;if(_0x40cf2d>=_0x4f1c1d){_0x40cf2d=_0x4f1c1d;_0x1e8d5e=0xc8;}else{_0x1e8d5e=0xce;}_0x25e11f[_0x13e5('0x1a')](_0x1e8d5e);return _0x25e11f[_0x13e5('0x1e')](_0x13e5('0x1f'),_0x2b2afe+'-'+_0x40cf2d+'/'+_0x4f1c1d)[_0x13e5('0x1b')](_0x10ff61);}return null;};}function patchUpdates(_0x4f07cf){return function(_0x46637a){try{jsonpatch[_0x13e5('0x20')](_0x46637a,_0x4f07cf,!![]);}catch(_0xf11168){return BPromise[_0x13e5('0x21')](_0xf11168);}return _0x46637a[_0x13e5('0x22')]();};}function saveUpdates(_0x4c0c65,_0x207c0b){return function(_0x153ef7){if(_0x153ef7){return _0x153ef7[_0x13e5('0x23')](_0x4c0c65)['then'](function(_0x6c4449){return _0x6c4449;});}return null;};}function removeEntity(_0x181ecf,_0x4a90a0){return function(_0x5ef406){if(_0x5ef406){return _0x5ef406['destroy']()[_0x13e5('0x24')](function(){_0x181ecf[_0x13e5('0x1a')](0xcc)[_0x13e5('0x19')]();});}};}function handleEntityNotFound(_0x3c3393,_0x121709){return function(_0x236238){if(!_0x236238){_0x3c3393['sendStatus'](0x194);}return _0x236238;};}function handleError(_0x1f28a5,_0x228682){_0x228682=_0x228682||0x1f4;return function(_0x220576){logger[_0x13e5('0x25')](_0x220576[_0x13e5('0x26')]);if(_0x220576[_0x13e5('0x27')]){delete _0x220576[_0x13e5('0x27')];}_0x1f28a5[_0x13e5('0x1a')](_0x228682)['send'](_0x220576);};}exports[_0x13e5('0x28')]=function(_0x196d69,_0x3fb27a){var _0x383122={'raw':!![],'where':{'id':_0x196d69[_0x13e5('0x29')]['id']}},_0x5cf3eb={};_0x5cf3eb[_0x13e5('0x2a')]=_[_0x13e5('0x2b')](db[_0x13e5('0x2c')][_0x13e5('0x2d')]);_0x5cf3eb[_0x13e5('0x2e')]=_['keys'](_0x196d69[_0x13e5('0x2e')]);_0x5cf3eb['filters']=_['intersection'](_0x5cf3eb['model'],_0x5cf3eb[_0x13e5('0x2e')]);_0x383122['attributes']=_[_0x13e5('0x2f')](_0x5cf3eb[_0x13e5('0x2a')],qs[_0x13e5('0x30')](_0x196d69[_0x13e5('0x2e')][_0x13e5('0x30')]));_0x383122[_0x13e5('0x31')]=_0x383122[_0x13e5('0x31')]['length']?_0x383122[_0x13e5('0x31')]:_0x5cf3eb[_0x13e5('0x2a')];if(_0x196d69[_0x13e5('0x2e')][_0x13e5('0x32')]){_0x383122['include']=[{'all':!![]}];}_0x383122=_[_0x13e5('0x33')]({},_0x383122,_0x196d69[_0x13e5('0x34')]);return db[_0x13e5('0x2c')][_0x13e5('0x35')](_0x383122)[_0x13e5('0x24')](handleEntityNotFound(_0x3fb27a,null))[_0x13e5('0x24')](respondWithResult(_0x3fb27a,null))[_0x13e5('0x36')](handleError(_0x3fb27a,null));};exports[_0x13e5('0x23')]=function(_0x53757a,_0x495545){if(_0x53757a['body']['id']){delete _0x53757a[_0x13e5('0x37')]['id'];}return db[_0x13e5('0x2c')][_0x13e5('0x35')]({'where':{'id':_0x53757a[_0x13e5('0x29')]['id']}})[_0x13e5('0x24')](handleEntityNotFound(_0x495545,null))[_0x13e5('0x24')](saveUpdates(_0x53757a[_0x13e5('0x37')],null))[_0x13e5('0x24')](respondWithResult(_0x495545,null))['catch'](handleError(_0x495545,null));};exports[_0x13e5('0x38')]=function(_0x53823b,_0x4281dd){return db[_0x13e5('0x2c')][_0x13e5('0x35')]({'where':{'id':_0x53823b[_0x13e5('0x29')]['id']}})[_0x13e5('0x24')](handleEntityNotFound(_0x4281dd,null))[_0x13e5('0x24')](removeEntity(_0x4281dd,null))[_0x13e5('0x36')](handleError(_0x4281dd,null));}; \ No newline at end of file +var _0x4051=['count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','intersection','attributes','length','includeAll','include','merge','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json'];(function(_0x2d0ca6,_0x4caccd){var _0x3e6878=function(_0x56d5b3){while(--_0x56d5b3){_0x2d0ca6['push'](_0x2d0ca6['shift']());}};_0x3e6878(++_0x4caccd);}(_0x4051,0xcb));var _0x1405=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4051[_0x422905];return _0x33dc6c;};'use strict';var pdf=require(_0x1405('0x0'));var emlformat=require(_0x1405('0x1'));var rimraf=require(_0x1405('0x2'));var zipdir=require(_0x1405('0x3'));var jsonpatch=require(_0x1405('0x4'));var rp=require(_0x1405('0x5'));var moment=require(_0x1405('0x6'));var BPromise=require(_0x1405('0x7'));var Mustache=require(_0x1405('0x8'));var util=require(_0x1405('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x1405('0xa'));var ejs=require(_0x1405('0xb'));var fs=require('fs');var _=require(_0x1405('0xc'));var squel=require('squel');var crypto=require(_0x1405('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1405('0xe'));var toCsv=require(_0x1405('0xa'));var querystring=require(_0x1405('0xf'));var Papa=require(_0x1405('0x10'));var Redis=require(_0x1405('0x11'));var authService=require(_0x1405('0x12'));var qs=require(_0x1405('0x13'));var as=require(_0x1405('0x14'));var hardwareService=require(_0x1405('0x15'));var logger=require('../../config/logger')(_0x1405('0x16'));var utils=require(_0x1405('0x17'));var config=require(_0x1405('0x18'));var db=require(_0x1405('0x19'))['db'];function respondWithStatusCode(_0x3b9147,_0x1c2dd6){_0x1c2dd6=_0x1c2dd6||0xcc;return function(_0x3657bc){if(_0x3657bc){return _0x3b9147['sendStatus'](_0x1c2dd6);}return _0x3b9147['status'](_0x1c2dd6)[_0x1405('0x1a')]();};}function respondWithResult(_0x3ecce7,_0x25a262){_0x25a262=_0x25a262||0xc8;return function(_0x5dc164){if(_0x5dc164){return _0x3ecce7[_0x1405('0x1b')](_0x25a262)[_0x1405('0x1c')](_0x5dc164);}};}function respondWithFilteredResult(_0x2bc226,_0x15da75){return function(_0x412415){if(_0x412415){var _0xfd5878=_0x412415[_0x1405('0x1d')],_0x2b1c68=_0x15da75[_0x1405('0x1e')],_0xf60a07=_0x15da75[_0x1405('0x1e')]+_0x15da75['limit'],_0x30b429;if(_0xf60a07>=_0xfd5878){_0xf60a07=_0xfd5878;_0x30b429=0xc8;}else{_0x30b429=0xce;}_0x2bc226['status'](_0x30b429);return _0x2bc226[_0x1405('0x1f')](_0x1405('0x20'),_0x2b1c68+'-'+_0xf60a07+'/'+_0xfd5878)[_0x1405('0x1c')](_0x412415);}return null;};}function patchUpdates(_0x14ec56){return function(_0x28e35f){try{jsonpatch[_0x1405('0x21')](_0x28e35f,_0x14ec56,!![]);}catch(_0x4e86c4){return BPromise[_0x1405('0x22')](_0x4e86c4);}return _0x28e35f['save']();};}function saveUpdates(_0x218ac7,_0x1d515c){return function(_0x4d7398){if(_0x4d7398){return _0x4d7398[_0x1405('0x23')](_0x218ac7)[_0x1405('0x24')](function(_0x35ee75){return _0x35ee75;});}return null;};}function removeEntity(_0x34fc06,_0x134030){return function(_0x15273e){if(_0x15273e){return _0x15273e[_0x1405('0x25')]()[_0x1405('0x24')](function(){_0x34fc06[_0x1405('0x1b')](0xcc)[_0x1405('0x1a')]();});}};}function handleEntityNotFound(_0x5361f,_0x133bcb){return function(_0x3fdfe1){if(!_0x3fdfe1){_0x5361f['sendStatus'](0x194);}return _0x3fdfe1;};}function handleError(_0x5efa59,_0x37dc26){_0x37dc26=_0x37dc26||0x1f4;return function(_0x49163b){logger[_0x1405('0x26')](_0x49163b[_0x1405('0x27')]);if(_0x49163b[_0x1405('0x28')]){delete _0x49163b[_0x1405('0x28')];}_0x5efa59[_0x1405('0x1b')](_0x37dc26)[_0x1405('0x29')](_0x49163b);};}exports[_0x1405('0x2a')]=function(_0x4b6baa,_0xca8654){var _0x62f6e7={'raw':!![],'where':{'id':_0x4b6baa[_0x1405('0x2b')]['id']}},_0x399718={};_0x399718[_0x1405('0x2c')]=_[_0x1405('0x2d')](db[_0x1405('0x2e')][_0x1405('0x2f')]);_0x399718[_0x1405('0x30')]=_[_0x1405('0x2d')](_0x4b6baa[_0x1405('0x30')]);_0x399718['filters']=_[_0x1405('0x31')](_0x399718[_0x1405('0x2c')],_0x399718[_0x1405('0x30')]);_0x62f6e7[_0x1405('0x32')]=_[_0x1405('0x31')](_0x399718['model'],qs['fields'](_0x4b6baa['query']['fields']));_0x62f6e7[_0x1405('0x32')]=_0x62f6e7[_0x1405('0x32')][_0x1405('0x33')]?_0x62f6e7['attributes']:_0x399718[_0x1405('0x2c')];if(_0x4b6baa[_0x1405('0x30')][_0x1405('0x34')]){_0x62f6e7[_0x1405('0x35')]=[{'all':!![]}];}_0x62f6e7=_[_0x1405('0x36')]({},_0x62f6e7,_0x4b6baa['options']);return db[_0x1405('0x2e')][_0x1405('0x37')](_0x62f6e7)[_0x1405('0x24')](handleEntityNotFound(_0xca8654,null))[_0x1405('0x24')](respondWithResult(_0xca8654,null))[_0x1405('0x38')](handleError(_0xca8654,null));};exports[_0x1405('0x23')]=function(_0x5ad0aa,_0xcc637){if(_0x5ad0aa['body']['id']){delete _0x5ad0aa[_0x1405('0x39')]['id'];}return db['MailApplication'][_0x1405('0x37')]({'where':{'id':_0x5ad0aa['params']['id']}})[_0x1405('0x24')](handleEntityNotFound(_0xcc637,null))[_0x1405('0x24')](saveUpdates(_0x5ad0aa[_0x1405('0x39')],null))[_0x1405('0x24')](respondWithResult(_0xcc637,null))['catch'](handleError(_0xcc637,null));};exports['destroy']=function(_0x48b072,_0x330414){return db[_0x1405('0x2e')][_0x1405('0x37')]({'where':{'id':_0x48b072[_0x1405('0x2b')]['id']}})[_0x1405('0x24')](handleEntityNotFound(_0x330414,null))['then'](removeEntity(_0x330414,null))[_0x1405('0x38')](handleError(_0x330414,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2226415..8390d7b 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 _0xf4ce=['api','moment','bluebird','request-promise','define','MailApplication','mail_applications','utf8mb4','lodash'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xf4ce,0xf2));var _0xef4c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf4ce[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xef4c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xef4c('0x1'));var moment=require(_0xef4c('0x2'));var BPromise=require(_0xef4c('0x3'));var rp=require(_0xef4c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x2488f4,_0x3e7b2a){return _0x2488f4[_0xef4c('0x5')](_0xef4c('0x6'),attributes,{'tableName':_0xef4c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef4c('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc1d3=['exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailApplication.attributes'];(function(_0x36f8c9,_0x1a629e){var _0xdb5373=function(_0x2cc937){while(--_0x2cc937){_0x36f8c9['push'](_0x36f8c9['shift']());}};_0xdb5373(++_0x1a629e);}(_0xc1d3,0x147));var _0x3c1d=function(_0x34c0f7,_0x519917){_0x34c0f7=_0x34c0f7-0x0;var _0x399e4c=_0xc1d3[_0x34c0f7];return _0x399e4c;};'use strict';var _=require(_0x3c1d('0x0'));var util=require(_0x3c1d('0x1'));var logger=require(_0x3c1d('0x2'))(_0x3c1d('0x3'));var moment=require(_0x3c1d('0x4'));var BPromise=require(_0x3c1d('0x5'));var rp=require(_0x3c1d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c1d('0x7'));var attributes=require(_0x3c1d('0x8'));module[_0x3c1d('0x9')]=function(_0x4d483a,_0x1b0abf){return _0x4d483a[_0x3c1d('0xa')](_0x3c1d('0xb'),attributes,{'tableName':_0x3c1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c1d('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 9efd36a..b928712 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 _0x8a85=['catch','UpdateMailApplication','MailApplication','body','options','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','MailApplication,\x20%s,\x20%s','message'];(function(_0x9a3f59,_0xcc9a36){var _0x292f5e=function(_0x3cac9e){while(--_0x3cac9e){_0x9a3f59['push'](_0x9a3f59['shift']());}};_0x292f5e(++_0xcc9a36);}(_0x8a85,0xde));var _0x58a8=function(_0x2abd5e,_0x528f66){_0x2abd5e=_0x2abd5e-0x0;var _0x13857a=_0x8a85[_0x2abd5e];return _0x13857a;};'use strict';var _=require(_0x58a8('0x0'));var util=require('util');var moment=require(_0x58a8('0x1'));var BPromise=require('bluebird');var rs=require(_0x58a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58a8('0x3'))['db'];var utils=require(_0x58a8('0x4'));var logger=require(_0x58a8('0x5'))(_0x58a8('0x6'));var config=require('../../config/environment');var jayson=require(_0x58a8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3929ad,_0xfa0a8f,_0x44b4ed){return new BPromise(function(_0x2e8540,_0x253e05){return client[_0x58a8('0x8')](_0x3929ad,_0x44b4ed)[_0x58a8('0x9')](function(_0x1f2aa1){logger[_0x58a8('0xa')]('MailApplication,\x20%s,\x20%s',_0xfa0a8f,_0x58a8('0xb'));logger[_0x58a8('0xc')](_0x58a8('0xd'),_0xfa0a8f,_0x58a8('0xb'),JSON[_0x58a8('0xe')](_0x1f2aa1));if(_0x1f2aa1[_0x58a8('0xf')]){if(_0x1f2aa1['error']['code']===0x1f4){logger['error'](_0x58a8('0x10'),_0xfa0a8f,_0x1f2aa1[_0x58a8('0xf')][_0x58a8('0x11')]);return _0x253e05(_0x1f2aa1[_0x58a8('0xf')][_0x58a8('0x11')]);}logger[_0x58a8('0xf')](_0x58a8('0x10'),_0xfa0a8f,_0x1f2aa1['error'][_0x58a8('0x11')]);return _0x2e8540(_0x1f2aa1[_0x58a8('0xf')][_0x58a8('0x11')]);}else{logger[_0x58a8('0xa')]('MailApplication,\x20%s,\x20%s',_0xfa0a8f,_0x58a8('0xb'));_0x2e8540(_0x1f2aa1['result'][_0x58a8('0x11')]);}})[_0x58a8('0x12')](function(_0x144d79){logger[_0x58a8('0xf')](_0x58a8('0x10'),_0xfa0a8f,_0x144d79);_0x253e05(_0x144d79);});});}exports[_0x58a8('0x13')]=function(_0x40107b){var _0x1479e8=this;return new Promise(function(_0x5bb89a,_0x3b5c78){return db[_0x58a8('0x14')]['update'](_0x40107b[_0x58a8('0x15')],{'raw':_0x40107b[_0x58a8('0x16')]?_0x40107b[_0x58a8('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40107b[_0x58a8('0x16')]?_0x40107b[_0x58a8('0x16')]['where']||null:null,'attributes':_0x40107b[_0x58a8('0x16')]?_0x40107b[_0x58a8('0x16')]['attributes']||null:null,'limit':_0x40107b[_0x58a8('0x16')]?_0x40107b[_0x58a8('0x16')][_0x58a8('0x17')]||null:null})['then'](function(_0x12feb3){logger[_0x58a8('0xa')](_0x58a8('0x13'),_0x40107b);logger[_0x58a8('0xc')](_0x58a8('0x13'),_0x40107b,JSON[_0x58a8('0xe')](_0x12feb3));_0x5bb89a(_0x12feb3);})['catch'](function(_0x5279aa){logger[_0x58a8('0xf')](_0x58a8('0x13'),_0x5279aa[_0x58a8('0x11')],_0x40107b);_0x3b5c78(_0x1479e8['error'](0x1f4,_0x5279aa[_0x58a8('0x11')]));});});}; \ No newline at end of file +var _0x5214=['catch','MailApplication','update','options','where','limit','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x31ffbf,_0x3a8aad){var _0x536035=function(_0x141468){while(--_0x141468){_0x31ffbf['push'](_0x31ffbf['shift']());}};_0x536035(++_0x3a8aad);}(_0x5214,0x64));var _0x4521=function(_0x4c5040,_0x370b8e){_0x4c5040=_0x4c5040-0x0;var _0x18cab8=_0x5214[_0x4c5040];return _0x18cab8;};'use strict';var _=require(_0x4521('0x0'));var util=require(_0x4521('0x1'));var moment=require(_0x4521('0x2'));var BPromise=require(_0x4521('0x3'));var rs=require(_0x4521('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4521('0x5'))['db'];var utils=require(_0x4521('0x6'));var logger=require(_0x4521('0x7'))(_0x4521('0x8'));var config=require('../../config/environment');var jayson=require(_0x4521('0x9'));var client=jayson[_0x4521('0xa')][_0x4521('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27420c,_0xc5c19b,_0x29e320){return new BPromise(function(_0x54c3cc,_0x335f64){return client[_0x4521('0xc')](_0x27420c,_0x29e320)[_0x4521('0xd')](function(_0x28d278){logger['info'](_0x4521('0xe'),_0xc5c19b,_0x4521('0xf'));logger[_0x4521('0x10')](_0x4521('0x11'),_0xc5c19b,_0x4521('0xf'),JSON[_0x4521('0x12')](_0x28d278));if(_0x28d278[_0x4521('0x13')]){if(_0x28d278[_0x4521('0x13')][_0x4521('0x14')]===0x1f4){logger[_0x4521('0x13')]('MailApplication,\x20%s,\x20%s',_0xc5c19b,_0x28d278['error'][_0x4521('0x15')]);return _0x335f64(_0x28d278['error']['message']);}logger[_0x4521('0x13')]('MailApplication,\x20%s,\x20%s',_0xc5c19b,_0x28d278['error']['message']);return _0x54c3cc(_0x28d278[_0x4521('0x13')][_0x4521('0x15')]);}else{logger[_0x4521('0x16')](_0x4521('0xe'),_0xc5c19b,_0x4521('0xf'));_0x54c3cc(_0x28d278[_0x4521('0x17')]['message']);}})[_0x4521('0x18')](function(_0x328ad0){logger['error'](_0x4521('0xe'),_0xc5c19b,_0x328ad0);_0x335f64(_0x328ad0);});});}exports['UpdateMailApplication']=function(_0x57fa96){var _0x5a3983=this;return new Promise(function(_0x407211,_0xb83251){return db[_0x4521('0x19')][_0x4521('0x1a')](_0x57fa96['body'],{'raw':_0x57fa96[_0x4521('0x1b')]?_0x57fa96[_0x4521('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57fa96[_0x4521('0x1b')]?_0x57fa96[_0x4521('0x1b')][_0x4521('0x1c')]||null:null,'attributes':_0x57fa96[_0x4521('0x1b')]?_0x57fa96['options']['attributes']||null:null,'limit':_0x57fa96['options']?_0x57fa96[_0x4521('0x1b')][_0x4521('0x1d')]||null:null})['then'](function(_0x30f1b9){logger[_0x4521('0x16')]('UpdateMailApplication',_0x57fa96);logger['debug']('UpdateMailApplication',_0x57fa96,JSON[_0x4521('0x12')](_0x30f1b9));_0x407211(_0x30f1b9);})['catch'](function(_0x44cf87){logger[_0x4521('0x13')](_0x4521('0x1e'),_0x44cf87[_0x4521('0x15')],_0x57fa96);_0xb83251(_0x5a3983[_0x4521('0x13')](0x1f4,_0x44cf87['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e9f1650..4a6df66 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 _0x4d61=['describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x235f92,_0x58b73b){var _0x11720f=function(_0x345b12){while(--_0x345b12){_0x235f92['push'](_0x235f92['shift']());}};_0x11720f(++_0x58b73b);}(_0x4d61,0x147));var _0x14d6=function(_0x5d8d18,_0x341ad4){_0x5d8d18=_0x5d8d18-0x0;var _0x12cbb5=_0x4d61[_0x5d8d18];return _0x12cbb5;};'use strict';var multer=require(_0x14d6('0x0'));var util=require(_0x14d6('0x1'));var path=require(_0x14d6('0x2'));var timeout=require(_0x14d6('0x3'));var express=require(_0x14d6('0x4'));var router=express[_0x14d6('0x5')]();var auth=require(_0x14d6('0x6'));var interaction=require(_0x14d6('0x7'));var config=require(_0x14d6('0x8'));var controller=require('./mailInteraction.controller');router[_0x14d6('0x9')]('/',auth[_0x14d6('0xa')](),controller[_0x14d6('0xb')]);router[_0x14d6('0x9')](_0x14d6('0xc'),auth[_0x14d6('0xa')](),controller[_0x14d6('0xd')]);router['get'](_0x14d6('0xe'),auth['isAuthenticated'](),controller[_0x14d6('0xf')]);router['get'](_0x14d6('0x10'),auth[_0x14d6('0xa')](),controller['getMessages']);router[_0x14d6('0x9')](_0x14d6('0x11'),auth[_0x14d6('0xa')](),controller[_0x14d6('0x12')]);router[_0x14d6('0x13')]('/',auth[_0x14d6('0xa')](),controller[_0x14d6('0x14')]);router[_0x14d6('0x13')](_0x14d6('0x10'),auth[_0x14d6('0xa')](),controller[_0x14d6('0x15')]);router['post'](_0x14d6('0x16'),auth[_0x14d6('0xa')](),interaction[_0x14d6('0x17')](_0x14d6('0x18'),_0x14d6('0x19')),controller['addTags']);router[_0x14d6('0x1a')](_0x14d6('0xe'),auth[_0x14d6('0xa')](),interaction[_0x14d6('0x17')]('mail',_0x14d6('0x1b')),controller[_0x14d6('0x1c')]);router[_0x14d6('0x1d')]('/:id',auth[_0x14d6('0xa')](),interaction[_0x14d6('0x17')](_0x14d6('0x18'),_0x14d6('0x1e')),controller[_0x14d6('0x1f')]);router[_0x14d6('0x1d')](_0x14d6('0x16'),auth[_0x14d6('0xa')](),controller[_0x14d6('0x20')]);module[_0x14d6('0x21')]=router; \ No newline at end of file +var _0x11a1=['connect-timeout','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x4e0c34,_0x596edd){var _0x352a41=function(_0x1a4c57){while(--_0x1a4c57){_0x4e0c34['push'](_0x4e0c34['shift']());}};_0x352a41(++_0x596edd);}(_0x11a1,0xbd));var _0x111a=function(_0x4e761d,_0x56c1a2){_0x4e761d=_0x4e761d-0x0;var _0xea2fe=_0x11a1[_0x4e761d];return _0xea2fe;};'use strict';var multer=require(_0x111a('0x0'));var util=require(_0x111a('0x1'));var path=require(_0x111a('0x2'));var timeout=require(_0x111a('0x3'));var express=require(_0x111a('0x4'));var router=express[_0x111a('0x5')]();var auth=require(_0x111a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x111a('0x7'));router[_0x111a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x111a('0x9')](),controller['describe']);router['get'](_0x111a('0xa'),auth[_0x111a('0x9')](),controller[_0x111a('0xb')]);router[_0x111a('0x8')](_0x111a('0xc'),auth[_0x111a('0x9')](),controller[_0x111a('0xd')]);router[_0x111a('0x8')](_0x111a('0xe'),auth[_0x111a('0x9')](),controller[_0x111a('0xf')]);router['post']('/',auth[_0x111a('0x9')](),controller[_0x111a('0x10')]);router[_0x111a('0x11')](_0x111a('0xc'),auth[_0x111a('0x9')](),controller[_0x111a('0x12')]);router[_0x111a('0x11')](_0x111a('0x13'),auth[_0x111a('0x9')](),interaction[_0x111a('0x14')](_0x111a('0x15'),_0x111a('0x16')),controller[_0x111a('0x17')]);router[_0x111a('0x18')]('/:id',auth[_0x111a('0x9')](),interaction[_0x111a('0x14')](_0x111a('0x15'),_0x111a('0x19')),controller[_0x111a('0x1a')]);router[_0x111a('0x1b')](_0x111a('0xa'),auth[_0x111a('0x9')](),interaction[_0x111a('0x14')](_0x111a('0x15'),_0x111a('0x1c')),controller[_0x111a('0x1d')]);router[_0x111a('0x1b')](_0x111a('0x13'),auth[_0x111a('0x9')](),controller[_0x111a('0x1e')]);module[_0x111a('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 675033d..6cced03 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 _0x70e2=['DATE','STRING','long','TEXT','ENUM','iconv'];(function(_0x3252f7,_0x1678e5){var _0x591cf0=function(_0x2b3e53){while(--_0x2b3e53){_0x3252f7['push'](_0x3252f7['shift']());}};_0x591cf0(++_0x1678e5);}(_0x70e2,0x1d9));var _0x270e=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x70e2[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x270e('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x270e('0x1')]},'disposition':{'type':Sequelize[_0x270e('0x2')]},'note':{'type':Sequelize[_0x270e('0x2')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x270e('0x3'))},'subject':{'type':Sequelize[_0x270e('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x270e('0x1')]},'substatus':{'type':Sequelize[_0x270e('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x270e('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x270e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x270e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x270e('0x4')](_0x270e('0x3'))},'lastMsgText':{'type':Sequelize[_0x270e('0x4')](_0x270e('0x3'))}}; \ No newline at end of file +var _0xe353=['exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out','long','sequelize','iconv'];(function(_0x15da74,_0x5b3ca0){var _0x18caea=function(_0x3f551d){while(--_0x3f551d){_0x15da74['push'](_0x15da74['shift']());}};_0x18caea(++_0x5b3ca0);}(_0xe353,0x148));var _0x3e35=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xe353[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x3e35('0x0'));var iconv=require(_0x3e35('0x1'));module[_0x3e35('0x2')]={'closed':{'type':Sequelize[_0x3e35('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3e35('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3e35('0x5')]},'inReplyTo':{'type':Sequelize[_0x3e35('0x5')](0x1fe)},'to':{'type':Sequelize[_0x3e35('0x5')]},'cc':{'type':Sequelize[_0x3e35('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3e35('0x4')]},'substatus':{'type':Sequelize[_0x3e35('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x3e35('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3e35('0x7')]('in',_0x3e35('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3e35('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3e35('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x3e35('0x6')](_0x3e35('0x9'))},'lastMsgText':{'type':Sequelize[_0x3e35('0x6')](_0x3e35('0x9'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 64d26b1..f5982d1 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 _0x4c45=['i.lastMsgDirection','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','push','rows','show','params','keys','include','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','spread','Tag','findAll','mailInteractionTags:save','removeTags','join','root','server','files','attachments','interaction-%s.zip','bcc','subject','Attachment','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','writeFileSync','download','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','update','error','stack','name','send','Users','map','Tags','forEach','TagIds','MailInteraction','lastMsgBody','lastMsgText','then','trimStart','fromString','catch','index','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','select','field','color','from','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','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','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','plainBody','some','compact','isEmpty','MailAccountId','createdAt','parse','$gte','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','user','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt'];(function(_0x49a757,_0x563dbb){var _0x4975ec=function(_0x1b7d95){while(--_0x1b7d95){_0x49a757['push'](_0x49a757['shift']());}};_0x4975ec(++_0x563dbb);}(_0x4c45,0x129));var _0x54c4=function(_0x5cd11e,_0x45a0b8){_0x5cd11e=_0x5cd11e-0x0;var _0x447476=_0x4c45[_0x5cd11e];return _0x447476;};'use strict';var pdf=require(_0x54c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x54c4('0x1'));var zipdir=require(_0x54c4('0x2'));var jsonpatch=require(_0x54c4('0x3'));var rp=require(_0x54c4('0x4'));var moment=require('moment');var BPromise=require(_0x54c4('0x5'));var Mustache=require(_0x54c4('0x6'));var util=require('util');var path=require(_0x54c4('0x7'));var sox=require(_0x54c4('0x8'));var csv=require(_0x54c4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x54c4('0xa'));var squel=require(_0x54c4('0xb'));var crypto=require(_0x54c4('0xc'));var jsforce=require(_0x54c4('0xd'));var deskjs=require(_0x54c4('0xe'));var toCsv=require(_0x54c4('0x9'));var querystring=require('querystring');var Papa=require(_0x54c4('0xf'));var htmlToText=require(_0x54c4('0x10'));var Redis=require(_0x54c4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x54c4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54c4('0x13'));var logger=require(_0x54c4('0x14'))('api');var utils=require(_0x54c4('0x15'));var config=require(_0x54c4('0x16'));var db=require(_0x54c4('0x17'))['db'];config[_0x54c4('0x18')]=_['defaults'](config[_0x54c4('0x18')],{'host':_0x54c4('0x19'),'port':0x18eb});var socket=require(_0x54c4('0x1a'))(new Redis(config[_0x54c4('0x18')]));require(_0x54c4('0x1b'))['register'](socket);function respondWithStatusCode(_0x2a6a2a,_0x26a502){_0x26a502=_0x26a502||0xcc;return function(_0x5bcb3e){if(_0x5bcb3e){return _0x2a6a2a[_0x54c4('0x1c')](_0x26a502);}return _0x2a6a2a[_0x54c4('0x1d')](_0x26a502)[_0x54c4('0x1e')]();};}function respondWithResult(_0x39308d,_0x309af8){_0x309af8=_0x309af8||0xc8;return function(_0x4faf57){if(_0x4faf57){return _0x39308d[_0x54c4('0x1d')](_0x309af8)[_0x54c4('0x1f')](_0x4faf57);}};}function respondWithFilteredResult(_0x1d991d,_0x40d797){return function(_0x2254ee){if(_0x2254ee){var _0x34d1e0=_0x2254ee[_0x54c4('0x20')],_0x167cf2=_0x40d797['offset'],_0x3198bb=_0x40d797['offset']+_0x40d797[_0x54c4('0x21')],_0x4ac910;if(_0x3198bb>=_0x34d1e0){_0x3198bb=_0x34d1e0;_0x4ac910=0xc8;}else{_0x4ac910=0xce;}_0x1d991d[_0x54c4('0x1d')](_0x4ac910);return _0x1d991d[_0x54c4('0x22')](_0x54c4('0x23'),_0x167cf2+'-'+_0x3198bb+'/'+_0x34d1e0)[_0x54c4('0x1f')](_0x2254ee);}return null;};}function patchUpdates(_0x37240b){return function(_0x59e7b4){try{jsonpatch[_0x54c4('0x24')](_0x59e7b4,_0x37240b,!![]);}catch(_0x4e37da){return BPromise[_0x54c4('0x25')](_0x4e37da);}return _0x59e7b4['save']();};}function saveUpdates(_0xdb93ee,_0x184ddc){return function(_0x466f4f){if(_0x466f4f){return _0x466f4f[_0x54c4('0x26')](_0xdb93ee)['then'](function(_0x8e222b){return _0x8e222b;});}return null;};}function removeEntity(_0x411cc2,_0xef27de){return function(_0x45c333){if(_0x45c333){return _0x45c333['destroy']()['then'](function(){_0x411cc2[_0x54c4('0x1d')](0xcc)[_0x54c4('0x1e')]();});}};}function handleEntityNotFound(_0x23801c,_0x2847d6){return function(_0x4f4f9e){if(!_0x4f4f9e){_0x23801c[_0x54c4('0x1c')](0x194);}return _0x4f4f9e;};}function handleError(_0x1d75b1,_0x347629){_0x347629=_0x347629||0x1f4;return function(_0x492401){logger[_0x54c4('0x27')](_0x492401[_0x54c4('0x28')]);if(_0x492401[_0x54c4('0x29')]){delete _0x492401[_0x54c4('0x29')];}_0x1d75b1[_0x54c4('0x1d')](_0x347629)[_0x54c4('0x2a')](_0x492401);};}function getInteractionUsers(_0x5302fa,_0x22b777){return new BPromise(function(_0xc762db,_0x402162){try{if(_0x22b777[_0x5302fa['id']]){_0x5302fa[_0x54c4('0x2b')]=_[_0x54c4('0x2c')](_0x22b777[_0x5302fa['id']],function(_0xadff4c){return{'id':_0xadff4c['id']};});}}catch(_0x4cf415){_0x402162(_0x4cf415);}_0xc762db(_0x5302fa);});}function getInteractionTags(_0x1e64e5,_0x4019f0){return new BPromise(function(_0x3a75cf,_0xf9de57){try{if(_0x1e64e5['TagIds']){_0x1e64e5[_0x54c4('0x2d')]=[];_0x1e64e5['TagIds']['split'](',')[_0x54c4('0x2e')](function(_0x1dc749){_0x1e64e5[_0x54c4('0x2d')]['push'](_0x4019f0[_0x1dc749]);});}delete _0x1e64e5[_0x54c4('0x2f')];}catch(_0x1ae92c){_0xf9de57(_0x1ae92c);}_0x3a75cf(_0x1e64e5);});}function getLastMessageText(_0x1a4510){return new BPromise(function(_0x274898,_0x8ac6d3){return db[_0x54c4('0x30')]['findOne']({'where':{'id':_0x1a4510['id']},'attributes':[_0x54c4('0x31'),_0x54c4('0x32')],'raw':!![]})[_0x54c4('0x33')](function(_0x1fe9fd){if(!_0x1fe9fd[_0x54c4('0x32')]){_0x1a4510[_0x54c4('0x32')]=_[_0x54c4('0x34')](htmlToText[_0x54c4('0x35')](_0x1fe9fd[_0x54c4('0x31')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x1a4510[_0x54c4('0x32')]=_0x1fe9fd[_0x54c4('0x32')];}_0x274898(_0x1a4510);})[_0x54c4('0x36')](function(_0x2b7c55){_0x8ac6d3(_0x2b7c55);});});}function updateMailInteraction(_0x12e398,_0x3d2441,_0x11dc44,_0xa4b544){return new BPromise(function(_0x1c1936,_0x2bfab1){return getInteractionUsers(_0x12e398,_0x11dc44)[_0x54c4('0x33')](function(_0x10a5e2){return getInteractionTags(_0x10a5e2,_0x3d2441);})[_0x54c4('0x33')](function(_0x1a15d9){if(_0xa4b544){_0x1c1936(getLastMessageText(_0x1a15d9));}else{_0x1c1936(_0x1a15d9);}})[_0x54c4('0x36')](function(_0x50efb8){_0x2bfab1(_0x50efb8);});});}exports[_0x54c4('0x37')]=function(_0x279e3b,_0x9ccde4){var _0x1d3e5a={},_0x35d689={},_0x422b93={'count':0x0,'rows':[]};var _0x457df6=_[_0x54c4('0x2c')](db[_0x54c4('0x30')][_0x54c4('0x38')],function(_0x5d29bb){return{'name':_0x5d29bb[_0x54c4('0x39')],'type':_0x5d29bb['type'][_0x54c4('0x3a')]};});_0x35d689['model']=_[_0x54c4('0x2c')](_0x457df6,'name');_0x35d689['query']=_['keys'](_0x279e3b['query']);_0x35d689[_0x54c4('0x3b')]=_[_0x54c4('0x3c')](_0x35d689[_0x54c4('0x3d')],_0x35d689[_0x54c4('0x3e')]);_0x1d3e5a[_0x54c4('0x3f')]=_[_0x54c4('0x3c')](_0x35d689[_0x54c4('0x3d')],qs[_0x54c4('0x40')](_0x279e3b[_0x54c4('0x3e')]['fields']));_0x1d3e5a[_0x54c4('0x3f')]=_0x1d3e5a[_0x54c4('0x3f')]['length']?_0x1d3e5a[_0x54c4('0x3f')]:_0x35d689[_0x54c4('0x3d')];if(!_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x41')](_0x54c4('0x42'))){_0x1d3e5a[_0x54c4('0x21')]=qs[_0x54c4('0x21')](_0x279e3b[_0x54c4('0x3e')]['limit']);_0x1d3e5a[_0x54c4('0x43')]=qs[_0x54c4('0x43')](_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x43')]);}_0x1d3e5a['order']=qs[_0x54c4('0x44')](_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x44')]);_0x1d3e5a[_0x54c4('0x45')]=qs[_0x54c4('0x3b')](_['pick'](_0x279e3b[_0x54c4('0x3e')],_0x35d689[_0x54c4('0x3b')]));var _0x26e39b=[];var _0x5778d3=squel[_0x54c4('0x46')]()[_0x54c4('0x47')]('id')[_0x54c4('0x47')](_0x54c4('0x29'))[_0x54c4('0x47')](_0x54c4('0x48'))[_0x54c4('0x49')]('tools_tags');var _0x569df8=squel['select']()['field'](_0x54c4('0x4a'))[_0x54c4('0x47')](_0x54c4('0x4b'))['from'](_0x54c4('0x4c'),'ui')[_0x54c4('0x4d')](_0x54c4('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x1784a6=squel[_0x54c4('0x46')]()[_0x54c4('0x49')](_0x54c4('0x4f'),'i')[_0x54c4('0x4d')](_0x54c4('0x50'),'c',_0x54c4('0x51'))[_0x54c4('0x4d')](_0x54c4('0x4e'),'o',_0x54c4('0x52'))[_0x54c4('0x4d')](_0x54c4('0x53'),'a',_0x54c4('0x54'))['left_join'](_0x54c4('0x55'),'me',_0x54c4('0x56'))[_0x54c4('0x4d')](_0x54c4('0x57'),'it',_0x54c4('0x58'))[_0x54c4('0x4d')](_0x54c4('0x59'),'t',_0x54c4('0x5a'));var _0x583138=squel[_0x54c4('0x5b')]();var _0x2b0f93=[];var _0x5d653e=squel['expr']();var _0x5631cb;if(_0x279e3b['query']['search']){_0x5631cb=as[_0x54c4('0x5c')](_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x5d')]);var _0x359523=_0x5631cb[_0x54c4('0x5e')];for(var _0x5f1d2d=0x0;_0x5f1d2d<_0x5631cb['conditions'][_0x54c4('0x5f')];_0x5f1d2d++){var _0x57ef9e=_0x5631cb[_0x54c4('0x60')][_0x5f1d2d];var _0x42c25b='i';var _0x33da33=_[_0x54c4('0x61')](_0x457df6,[_0x54c4('0x29'),_0x57ef9e['field']]);if(!_0x33da33){switch(_0x57ef9e[_0x54c4('0x47')]){case _0x54c4('0x62'):if(_0x57ef9e[_0x54c4('0x63')]==0x1){_0x1784a6['having']('`'+_0x57ef9e[_0x54c4('0x47')]+_0x54c4('0x64'));}else{_0x1784a6[_0x54c4('0x65')]('`'+_0x57ef9e[_0x54c4('0x47')]+_0x54c4('0x66'));}break;case _0x54c4('0x67'):if(_0x57ef9e['operator']===_0x54c4('0x68')){if(_0x57ef9e[_0x54c4('0x63')][_0x54c4('0x69')]('\x20')['length']>0x1){_0x583138[_0x359523](_0x54c4('0x6a'),qs[_0x54c4('0x6b')](_0x57ef9e[_0x54c4('0x63')]),null);}else{var _0x3f418a='%'+_0x57ef9e[_0x54c4('0x63')]+'%';_0x583138[_0x359523](_0x54c4('0x6c'),_0x3f418a,_0x3f418a,_0x3f418a);}}else{_0x33da33=_[_0x54c4('0x61')](_0x457df6,[_0x54c4('0x29'),_0x54c4('0x6d')]);_0x57ef9e[_0x54c4('0x47')]=_0x54c4('0x6d');_0x563c4f=as[_0x54c4('0x6e')](_0x42c25b,_0x33da33['type'],_0x57ef9e);_0x583138[_0x359523](_0x563c4f[_0x54c4('0x6f')],_0x563c4f['value'][_0x54c4('0x70')],_0x563c4f[_0x54c4('0x63')][_0x54c4('0x1e')]);}break;case'Tag':var _0x477e8b=_0x57ef9e[_0x54c4('0x63')][_0x54c4('0x69')](',')[_0x54c4('0x2c')](function(_0x37626a){return Number(_0x37626a);});_0x477e8b[_0x54c4('0x2e')](function(_0x57b3e){_0x5d653e['or'](_0x54c4('0x71'),'%,'+_0x57b3e+',%');});_0x2b0f93=_['union'](_0x2b0f93,_0x477e8b);break;case _0x54c4('0x72'):if(_0x57ef9e[_0x54c4('0x73')]===_0x54c4('0x68')){_0x583138[_0x359523](_0x54c4('0x74'),'%'+_0x57ef9e['value']+'%',null);}else{_0x33da33=_[_0x54c4('0x61')](_0x457df6,[_0x54c4('0x29'),_0x54c4('0x75')]);_0x57ef9e[_0x54c4('0x47')]=_0x54c4('0x75');_0x563c4f=as[_0x54c4('0x6e')](_0x42c25b,_0x33da33[_0x54c4('0x76')],_0x57ef9e);_0x583138[_0x359523](_0x563c4f['text'],_0x563c4f[_0x54c4('0x63')][_0x54c4('0x70')],_0x563c4f[_0x54c4('0x63')]['end']);}break;case _0x54c4('0x77'):_0x563c4f=as[_0x54c4('0x6e')]('me',null,_0x57ef9e);_0x583138[_0x359523](_0x563c4f[_0x54c4('0x6f')],_0x563c4f[_0x54c4('0x63')][_0x54c4('0x70')],_0x563c4f['value'][_0x54c4('0x1e')]);break;}}else{var _0x563c4f=as[_0x54c4('0x6e')](_0x42c25b,_0x33da33['type'],_0x57ef9e);_0x583138[_0x359523](_0x563c4f['text'],_0x563c4f['value'][_0x54c4('0x70')],_0x563c4f[_0x54c4('0x63')][_0x54c4('0x1e')]);}}}else{var _0x2127bc=_(_0x279e3b[_0x54c4('0x3e')])['keys']()['map'](function(_0x3c880a){return _[_0x54c4('0x78')](_0x457df6,[_0x54c4('0x29'),_0x3c880a])?_0x3c880a:undefined;})[_0x54c4('0x79')]()[_0x54c4('0x63')]();if(!_[_0x54c4('0x7a')](_0x2127bc)){_0x2127bc[_0x54c4('0x2e')](function(_0xb4fb7c){if(_0xb4fb7c===_0x54c4('0x7b')){_0x1784a6[_0x54c4('0x45')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x279e3b[_0x54c4('0x3e')][_0xb4fb7c]));}else if(_0xb4fb7c===_0x54c4('0x7c')){var _0x221421=JSON[_0x54c4('0x7d')](_0x279e3b['query'][_0xb4fb7c])[_0x54c4('0x7e')];var _0x4729aa=JSON[_0x54c4('0x7d')](_0x279e3b[_0x54c4('0x3e')][_0xb4fb7c])['$lte'];_0x1784a6['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x221421,_0x4729aa);}else{if(_0x279e3b[_0x54c4('0x3e')][_0xb4fb7c]==='null'){_0x1784a6[_0x54c4('0x45')]('i.'+_0xb4fb7c+'\x20IS\x20NULL');}else{_0x1784a6[_0x54c4('0x45')]('i.'+_0xb4fb7c+'\x20=\x20?',_0x279e3b[_0x54c4('0x3e')][_0xb4fb7c]);}}});}if(_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x7f')]){if(_0x279e3b['query'][_0x54c4('0x7f')]==0x1){_0x1784a6[_0x54c4('0x65')](_0x54c4('0x80'));}else{_0x1784a6[_0x54c4('0x65')](_0x54c4('0x81'));}}if(_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x82')]){_0x2b0f93=_[_0x54c4('0x83')](_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x82')])?_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x82')]:new Array(_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x82')]);_0x2b0f93[_0x54c4('0x2e')](function(_0x14050f){_0x5d653e['or'](_0x54c4('0x71'),'%,'+_0x14050f+',%');});}if(_0x279e3b[_0x54c4('0x3e')]['filter']){var _0xe77d2a=_0x279e3b[_0x54c4('0x3e')][_0x54c4('0x84')][_0x54c4('0x85')]('\x5c','\x5c\x5c')[_0x54c4('0x85')]('\x27\x27',_0x54c4('0x86'));if(qs[_0x54c4('0x87')](_0xe77d2a)){_0x583138['or'](_0x54c4('0x88'),_0xe77d2a+'%');}else if(qs[_0x54c4('0x89')](_0xe77d2a)){_0x583138['or'](_0x54c4('0x8a'),_0xe77d2a+'%');}else{_0x583138['or'](_0x54c4('0x8b'),qs[_0x54c4('0x6b')](_0xe77d2a))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xe77d2a));}}}_0x1784a6['where'](_0x583138);_0x1784a6[_0x54c4('0x8c')](_0x54c4('0x8d'));var _0x4bc18f={'type':db['Sequelize'][_0x54c4('0x8e')][_0x54c4('0x8f')],'raw':!![]};var _0x2bad38=_0x1784a6[_0x54c4('0x90')]();_0x2bad38['field'](_0x54c4('0x8d'));_0x2bad38[_0x54c4('0x47')](_0x54c4('0x91'),'unreadMessages');if(_0x1d3e5a[_0x54c4('0x92')]){_0x1d3e5a['order'][_0x54c4('0x2e')](function(_0x274255){_0x1784a6[_0x54c4('0x92')]('i.'+_0x274255[0x0],_0x274255[0x1]===_0x54c4('0x93')?![]:!![]);});}if(!_[_0x54c4('0x7a')](_0x2b0f93)){_0x1784a6[_0x54c4('0x65')](_0x5d653e);_0x2bad38[_0x54c4('0x45')]('t.id\x20IN\x20?',_0x2b0f93);}BPromise[_0x54c4('0x94')]()[_0x54c4('0x33')](function(){if(!_0x5631cb)return;return _0x279e3b[_0x54c4('0x95')]['getMailAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0xe435b6){_0x2bad38[_0x54c4('0x45')](_0x54c4('0x96'),_[_0x54c4('0x2c')](_0xe435b6,'id'));_0x1784a6[_0x54c4('0x45')](_0x54c4('0x96'),_[_0x54c4('0x2c')](_0xe435b6,'id'));});})['then'](function(){db[_0x54c4('0x97')][_0x54c4('0x3e')](_0x2bad38[_0x54c4('0x98')](),_0x4bc18f)[_0x54c4('0x33')](function(_0x43cfd2){_0x422b93['count']=_0x43cfd2['length'];if(_0x422b93[_0x54c4('0x20')]===0x0)return[];return db[_0x54c4('0x97')][_0x54c4('0x3e')](_0x5778d3[_0x54c4('0x98')](),_0x4bc18f)[_0x54c4('0x33')](function(_0x34d9f2){_0x26e39b=_['keyBy'](_0x34d9f2,'id');_0x4bc18f=_[_0x54c4('0x99')](_0x4bc18f,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1784a6[_0x54c4('0x47')](_0x54c4('0x91'),_0x54c4('0x62'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0x9a'),_0x54c4('0x9b'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0x9c'),_0x54c4('0x9d'));_0x1784a6['field']('i.id');_0x1784a6['field'](_0x54c4('0x9e'));_0x1784a6[_0x54c4('0x47')]('i.updatedAt');_0x1784a6[_0x54c4('0x47')](_0x54c4('0x9f'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa0'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa1'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa2'));_0x1784a6['field'](_0x54c4('0xa3'));_0x1784a6[_0x54c4('0x47')]('i.subject');_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa4'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa5'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa6'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa7'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa8'));_0x1784a6[_0x54c4('0x47')]('i.UserId');_0x1784a6[_0x54c4('0x47')](_0x54c4('0xa9'),'Contact.firstName');_0x1784a6[_0x54c4('0x47')](_0x54c4('0xaa'),_0x54c4('0xab'));_0x1784a6['field']('c.email','Contact.email');_0x1784a6['field'](_0x54c4('0xac'),'Contact.phone');_0x1784a6[_0x54c4('0x47')](_0x54c4('0xad'),_0x54c4('0xae'));_0x1784a6[_0x54c4('0x47')](_0x54c4('0xaf'),_0x54c4('0xb0'));_0x1784a6[_0x54c4('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');_0x1784a6[_0x54c4('0x21')](_0x1d3e5a[_0x54c4('0x21')]);_0x1784a6[_0x54c4('0x43')](_0x1d3e5a[_0x54c4('0x43')]);return db[_0x54c4('0x97')][_0x54c4('0x3e')](_0x1784a6[_0x54c4('0x98')](),_0x4bc18f);})[_0x54c4('0x33')](function(_0x3b6ae2){_0x569df8[_0x54c4('0x45')](_0x54c4('0xb1'),_[_0x54c4('0x2c')](_0x3b6ae2,'id'));return db[_0x54c4('0x97')][_0x54c4('0x3e')](_0x569df8[_0x54c4('0x98')](),_0x4bc18f)[_0x54c4('0x33')](function(_0x4aee2a){var _0x991558=_[_0x54c4('0xb2')](_0x4aee2a,_0x54c4('0xb3'));var _0x50b7d7=[];return db[_0x54c4('0xb4')][_0x54c4('0xb5')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x32be82){var _0x21b721=_0x32be82[_0x54c4('0xb6')];_0x3b6ae2[_0x54c4('0x2e')](function(_0x4ff1c7){_0x50b7d7[_0x54c4('0xb7')](updateMailInteraction(_0x4ff1c7,_0x26e39b,_0x991558,_0x21b721));});return BPromise['all'](_0x50b7d7);});});});})[_0x54c4('0x33')](function(_0x47e881){_0x422b93[_0x54c4('0xb8')]=_0x47e881;return _0x422b93;})[_0x54c4('0x33')](respondWithFilteredResult(_0x9ccde4,_0x1d3e5a));})['catch'](handleError(_0x9ccde4,null));};exports[_0x54c4('0xb9')]=function(_0x552eb1,_0x17609c){var _0x2b278c={'raw':![],'where':{'id':_0x552eb1[_0x54c4('0xba')]['id']}},_0x4d7c61={};_0x4d7c61[_0x54c4('0x3d')]=_[_0x54c4('0xbb')](db[_0x54c4('0x30')][_0x54c4('0x38')]);_0x4d7c61[_0x54c4('0x3e')]=_['keys'](_0x552eb1['query']);_0x4d7c61[_0x54c4('0x3b')]=_[_0x54c4('0x3c')](_0x4d7c61[_0x54c4('0x3d')],_0x4d7c61[_0x54c4('0x3e')]);_0x2b278c['attributes']=_['intersection'](_0x4d7c61[_0x54c4('0x3d')],qs[_0x54c4('0x40')](_0x552eb1['query'][_0x54c4('0x40')]));_0x2b278c[_0x54c4('0x3f')]=_0x2b278c[_0x54c4('0x3f')][_0x54c4('0x5f')]?_0x2b278c['attributes']:_0x4d7c61[_0x54c4('0x3d')];if(_0x552eb1[_0x54c4('0x3e')]['includeAll']){_0x2b278c[_0x54c4('0xbc')]=[{'all':!![]}];}_0x2b278c=_[_0x54c4('0x99')]({},_0x2b278c,_0x552eb1['options']);return db[_0x54c4('0x30')]['find'](_0x2b278c)[_0x54c4('0x33')](handleEntityNotFound(_0x17609c,null))['then'](respondWithResult(_0x17609c,null))['catch'](handleError(_0x17609c,null));};exports['create']=function(_0x35eec5,_0x5d3d50){return db['MailInteraction'][_0x54c4('0xbd')](_0x35eec5[_0x54c4('0xbe')],{})[_0x54c4('0x33')](respondWithResult(_0x5d3d50,0xc9))[_0x54c4('0x36')](handleError(_0x5d3d50,null));};exports[_0x54c4('0x26')]=function(_0x3d1cd9,_0x445740){if(_0x3d1cd9['body']['id']){delete _0x3d1cd9[_0x54c4('0xbe')]['id'];}return db['MailInteraction'][_0x54c4('0x61')]({'where':{'id':_0x3d1cd9[_0x54c4('0xba')]['id']}})['then'](handleEntityNotFound(_0x445740,null))['then'](saveUpdates(_0x3d1cd9[_0x54c4('0xbe')],null))[_0x54c4('0x33')](respondWithResult(_0x445740,null))[_0x54c4('0x36')](handleError(_0x445740,null));};exports['destroy']=function(_0x3d05a6,_0x8d9878){return db['MailInteraction']['find']({'where':{'id':_0x3d05a6[_0x54c4('0xba')]['id']}})['then'](handleEntityNotFound(_0x8d9878,null))[_0x54c4('0x33')](removeEntity(_0x8d9878,null))[_0x54c4('0x36')](handleError(_0x8d9878,null));};exports['describe']=function(_0x3446ee,_0x3f512a){return db[_0x54c4('0x30')][_0x54c4('0xbf')]()[_0x54c4('0x33')](respondWithResult(_0x3f512a,null))[_0x54c4('0x36')](handleError(_0x3f512a,null));};exports[_0x54c4('0xc0')]=function(_0x5c6c83,_0xcf0ef7,_0xee8bbd){return db[_0x54c4('0xc1')][_0x54c4('0x61')]({'where':{'id':_0x5c6c83['params']['id']}})[_0x54c4('0x33')](handleEntityNotFound(_0xcf0ef7,null))['then'](function(_0x4521dc){if(_0x4521dc){return _0x4521dc[_0x54c4('0xc0')](_0x5c6c83[_0x54c4('0xbe')]['ids'],_[_0x54c4('0xc2')](_0x5c6c83[_0x54c4('0xbe')],[_0x54c4('0xc3'),'id'])||{});}})[_0x54c4('0x33')](respondWithResult(_0xcf0ef7,null))['catch'](handleError(_0xcf0ef7,null));};exports[_0x54c4('0xc4')]=function(_0x470848,_0x149a4e,_0x5079bc){var _0x4cfc64={'raw':![],'where':{}};var _0x52577c={};var _0x55f9b9={'count':0x0,'rows':[]};return db[_0x54c4('0x30')]['findOne']({'where':{'id':_0x470848['params']['id']}})[_0x54c4('0x33')](handleEntityNotFound(_0x149a4e,null))[_0x54c4('0x33')](function(_0x513dce){if(_0x513dce){_0x52577c['model']=_[_0x54c4('0xbb')](db['MailMessage']['rawAttributes']);_0x52577c[_0x54c4('0x3e')]=_[_0x54c4('0xbb')](_0x470848[_0x54c4('0x3e')]);_0x52577c['filters']=_['intersection'](_0x52577c[_0x54c4('0x3d')],_0x52577c[_0x54c4('0x3e')]);_0x4cfc64['attributes']=_['intersection'](_0x52577c[_0x54c4('0x3d')],qs[_0x54c4('0x40')](_0x470848['query'][_0x54c4('0x40')]));_0x4cfc64['attributes']=_0x4cfc64[_0x54c4('0x3f')]['length']?_0x4cfc64[_0x54c4('0x3f')]:_0x52577c[_0x54c4('0x3d')];if(!_0x470848[_0x54c4('0x3e')][_0x54c4('0x41')]('nolimit')){_0x4cfc64[_0x54c4('0x21')]=qs[_0x54c4('0x21')](_0x470848[_0x54c4('0x3e')][_0x54c4('0x21')]);_0x4cfc64[_0x54c4('0x43')]=qs['offset'](_0x470848[_0x54c4('0x3e')][_0x54c4('0x43')]);}_0x4cfc64[_0x54c4('0x92')]=qs['sort'](_0x470848[_0x54c4('0x3e')][_0x54c4('0x44')]);_0x4cfc64[_0x54c4('0x45')]=qs[_0x54c4('0x3b')](_['pick'](_0x470848[_0x54c4('0x3e')],_0x52577c[_0x54c4('0x3b')]));_0x4cfc64[_0x54c4('0x45')][_0x54c4('0xb3')]=_0x513dce['id'];if(_0x470848['query'][_0x54c4('0x84')]){_0x4cfc64['where']=_[_0x54c4('0x99')](_0x4cfc64[_0x54c4('0x45')],{'$or':_['map'](_0x4cfc64[_0x54c4('0x3f')],function(_0x28e830){var _0x2fd289={};_0x2fd289[_0x28e830]={'$like':'%'+_0x470848[_0x54c4('0x3e')][_0x54c4('0x84')]+'%'};return _0x2fd289;})});}if(_0x470848[_0x54c4('0x3e')][_0x54c4('0x7e')]){var _0x2079a4=_0x470848['query'][_0x54c4('0x7e')][_0x54c4('0x69')](',');var _0xdaf9a5={};_0xdaf9a5[_0x2079a4[0x0]]={'$gte':moment(_0x2079a4[0x1])[_0x54c4('0xc5')](_0x54c4('0xc6'))};_0x4cfc64[_0x54c4('0x45')]=_[_0x54c4('0x99')](_0x4cfc64[_0x54c4('0x45')],_0xdaf9a5);}_0x4cfc64=_[_0x54c4('0x99')]({},_0x4cfc64,_0x470848[_0x54c4('0xc7')]);return db[_0x54c4('0xc1')][_0x54c4('0x20')]({'where':_0x4cfc64[_0x54c4('0x45')]})['then'](function(_0x2259a3){_0x55f9b9['count']=_0x2259a3;if(_0x470848[_0x54c4('0x3e')][_0x54c4('0xc8')]){_0x4cfc64[_0x54c4('0xbc')]=[{'all':!![]}];}return db[_0x54c4('0xc1')]['findAll'](_0x4cfc64);})['then'](function(_0x2a9d2f){_0x55f9b9[_0x54c4('0xb8')]=_0x2a9d2f;return _0x55f9b9;});}})[_0x54c4('0x33')](respondWithFilteredResult(_0x149a4e,_0x4cfc64))[_0x54c4('0x36')](handleError(_0x149a4e,null));};exports[_0x54c4('0xc9')]=function(_0xd6ff7b,_0x118913,_0x2e8130){return db[_0x54c4('0x30')][_0x54c4('0x61')]({'where':{'id':_0xd6ff7b[_0x54c4('0xba')]['id']}})[_0x54c4('0x33')](handleEntityNotFound(_0x118913,null))[_0x54c4('0x33')](function(_0x248c7d){if(_0x248c7d){return _0x248c7d['setTags'](_0xd6ff7b[_0x54c4('0xbe')][_0x54c4('0xc3')],_['omit'](_0xd6ff7b[_0x54c4('0xbe')],[_0x54c4('0xc3'),'id'])||{})[_0x54c4('0xca')](function(){return db[_0x54c4('0xcb')][_0x54c4('0xcc')]({'attributes':['id',_0x54c4('0x29'),_0x54c4('0x48')],'where':{'id':_0xd6ff7b[_0x54c4('0xbe')][_0x54c4('0xc3')]}});})[_0x54c4('0x33')](function(_0xda0c78){socket['emit'](_0x54c4('0xcd'),{'id':Number(_0xd6ff7b[_0x54c4('0xba')]['id']),'tags':_0xda0c78||[]});return{'id':Number(_0xd6ff7b['params']['id']),'tags':_0xda0c78||[]};});}})[_0x54c4('0x33')](respondWithResult(_0x118913,null))['catch'](handleError(_0x118913,null));};exports[_0x54c4('0xce')]=function(_0x4d8bb7,_0x316394,_0x137a1b){return db[_0x54c4('0x30')]['find']({'where':{'id':_0x4d8bb7['params']['id']}})[_0x54c4('0x33')](handleEntityNotFound(_0x316394,null))['then'](function(_0x26a36b){if(_0x26a36b){return _0x26a36b[_0x54c4('0xce')](_0x4d8bb7[_0x54c4('0x3e')][_0x54c4('0xc3')]);}})[_0x54c4('0x33')](respondWithStatusCode(_0x316394,null))['catch'](handleError(_0x316394,null));};exports['download']=function(_0x5af6f3,_0x2e55f7){var _0x2ae8f1=moment()['unix']()[_0x54c4('0x98')]();var _0x4ef3cd=path[_0x54c4('0xcf')](config[_0x54c4('0xd0')],_0x54c4('0xd1'),_0x54c4('0xd2'),_0x54c4('0xd3'));var _0x82d129=path[_0x54c4('0xcf')](config['root'],_0x54c4('0xd1'),_0x54c4('0xd2'),'tmp');var _0x49f448=path['join'](_0x82d129,_0x2ae8f1);var _0x155c5a=util['format'](_0x54c4('0xd4'),_0x2ae8f1);var _0x17c092=path[_0x54c4('0xcf')](_0x82d129,_0x155c5a);var _0x236c76=![];return db[_0x54c4('0x30')][_0x54c4('0x61')]({'where':{'id':_0x5af6f3[_0x54c4('0xba')]['id']}})['then'](handleEntityNotFound(_0x2e55f7,null))[_0x54c4('0x33')](function(_0x5a7980){if(_0x5a7980){return _0x5a7980['getMessages']({'attributes':['id','body',_0x54c4('0x49'),'to','cc',_0x54c4('0xd5'),_0x54c4('0xd6'),'createdAt'],'where':{'secret':![]},'include':_0x5af6f3['query']['attachments']?[{'model':db[_0x54c4('0xd7')],'as':'Attachments'}]:undefined,'order':qs[_0x54c4('0x44')]('id')});}return[];})[_0x54c4('0x33')](function(_0x424d8d){_0x236c76=_0x424d8d[_0x54c4('0x5f')];if(_0x424d8d[_0x54c4('0x5f')]){fs[_0x54c4('0xd8')](_0x49f448);return BPromise[_0x54c4('0xd9')](_0x424d8d,function(_0x107631,_0x5f56da){var _0x28bff9=_0x107631;var _0xa50b21={'from':_0x28bff9[_0x54c4('0x49')],'to':_0x28bff9['to'],'subject':_0x28bff9['subject'],'html':_0x28bff9[_0x54c4('0xbe')],'headers':{'Date':moment(_0x28bff9[_0x54c4('0x7c')])['format'](_0x54c4('0xda'))},'attachments':[]};if(_0x107631['cc']){_0xa50b21[_0x54c4('0xdb')]['Cc']=_0x107631['cc'];}if(_0x107631[_0x54c4('0xd5')]){_0xa50b21[_0x54c4('0xdb')][_0x54c4('0xdc')]=_0x107631[_0x54c4('0xd5')];}return new BPromise(function(_0x1a149e,_0xc29292){if(_0x107631[_0x54c4('0xdd')]){for(var _0x5466b7=0x0;_0x5466b7<_0x107631['Attachments'][_0x54c4('0x5f')];_0x5466b7++){var _0xd82405=_0x107631['Attachments'][_0x5466b7];var _0xc1b81=path[_0x54c4('0xcf')](_0x4ef3cd,_0xd82405[_0x54c4('0xde')]);if(fs[_0x54c4('0xdf')](_0xc1b81)){_0xa50b21[_0x54c4('0xd3')][_0x54c4('0xb7')]({'name':_0xd82405[_0x54c4('0x29')],'contentType':_0xd82405['type'],'data':fs[_0x54c4('0xe0')](_0xc1b81)});}}}emlformat['build'](_0xa50b21,function(_0x4b87a6,_0x51cda1){if(_0x4b87a6)return _0xc29292(_0x4b87a6);fs[_0x54c4('0xe1')](path[_0x54c4('0xcf')](_0x49f448,util[_0x54c4('0xc5')]('message%d.eml',_0x5f56da)),_0x51cda1);return _0x1a149e(_0x51cda1);});});});}})[_0x54c4('0x33')](function(){if(_0x236c76){return new BPromise(function(_0x26f890,_0x395354){zipdir(_0x49f448,{'saveTo':_0x17c092},function(_0x1f945d,_0x3c13fc){if(_0x1f945d)return _0x395354(_0x1f945d);return _0x26f890(_0x3c13fc);});});}})[_0x54c4('0x33')](function(){if(_0x236c76){return new BPromise(function(_0x34dbb3,_0x36d601){rimraf(_0x49f448,function(_0x444ba5){if(_0x444ba5)_0x36d601(_0x444ba5);return _0x34dbb3();});});}})['then'](function(){if(_0x236c76){return _0x2e55f7[_0x54c4('0xe2')](_0x17c092,_0x155c5a,function(_0x5cb859){if(_0x5cb859){console[_0x54c4('0xe3')](_0x54c4('0xe4'),_0x5cb859);}else{fs[_0x54c4('0xe5')](_0x17c092);}});}else{return _0x2e55f7[_0x54c4('0x1c')](0xc8);}})[_0x54c4('0x36')](handleError(_0x2e55f7,null));}; \ No newline at end of file +var _0x03a4=['omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','addTags','setTags','ids','spread','Tag','findAll','mailInteractionTags:save','removeTags','unix','root','server','files','attachments','tmp','join','subject','Attachments','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','readFileSync','build','message%d.eml','download','log','err','html-pdf','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','error','name','send','Users','TagIds','split','forEach','Tags','MailInteraction','findOne','lastMsgBody','lastMsgText','then','trimStart','catch','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','field','color','select','u.id','left_join','users','u.id\x20=\x20ui.UserId','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','start','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','plainBody','some','compact','isEmpty','MailAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','getMailAccounts','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','push','all','rows','params','fields','includeAll','include','options','create','body','describe','addMessage'];(function(_0xd99787,_0x485376){var _0x32db9e=function(_0x285fb5){while(--_0x285fb5){_0xd99787['push'](_0xd99787['shift']());}};_0x32db9e(++_0x485376);}(_0x03a4,0x1e3));var _0x403a=function(_0x10c59b,_0x4a7d71){_0x10c59b=_0x10c59b-0x0;var _0x17c965=_0x03a4[_0x10c59b];return _0x17c965;};'use strict';var pdf=require(_0x403a('0x0'));var emlformat=require(_0x403a('0x1'));var rimraf=require(_0x403a('0x2'));var zipdir=require(_0x403a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x403a('0x4'));var util=require(_0x403a('0x5'));var path=require(_0x403a('0x6'));var sox=require(_0x403a('0x7'));var csv=require(_0x403a('0x8'));var ejs=require(_0x403a('0x9'));var fs=require('fs');var _=require(_0x403a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x403a('0xb'));var deskjs=require(_0x403a('0xc'));var toCsv=require(_0x403a('0x8'));var querystring=require(_0x403a('0xd'));var Papa=require(_0x403a('0xe'));var htmlToText=require(_0x403a('0xf'));var Redis=require(_0x403a('0x10'));var authService=require(_0x403a('0x11'));var qs=require(_0x403a('0x12'));var as=require(_0x403a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x403a('0x14'));var utils=require(_0x403a('0x15'));var config=require(_0x403a('0x16'));var db=require(_0x403a('0x17'))['db'];config[_0x403a('0x18')]=_[_0x403a('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x403a('0x1a'))(new Redis(config[_0x403a('0x18')]));require('./mailInteraction.socket')[_0x403a('0x1b')](socket);function respondWithStatusCode(_0x5c60ae,_0x43b396){_0x43b396=_0x43b396||0xcc;return function(_0x393029){if(_0x393029){return _0x5c60ae[_0x403a('0x1c')](_0x43b396);}return _0x5c60ae[_0x403a('0x1d')](_0x43b396)[_0x403a('0x1e')]();};}function respondWithResult(_0x1ee5d6,_0x356daf){_0x356daf=_0x356daf||0xc8;return function(_0x40f29a){if(_0x40f29a){return _0x1ee5d6['status'](_0x356daf)[_0x403a('0x1f')](_0x40f29a);}};}function respondWithFilteredResult(_0x1d7c70,_0x2e30f1){return function(_0x43c604){if(_0x43c604){var _0x513495=_0x43c604[_0x403a('0x20')],_0x470d25=_0x2e30f1[_0x403a('0x21')],_0x2d6642=_0x2e30f1[_0x403a('0x21')]+_0x2e30f1['limit'],_0x5cd7be;if(_0x2d6642>=_0x513495){_0x2d6642=_0x513495;_0x5cd7be=0xc8;}else{_0x5cd7be=0xce;}_0x1d7c70[_0x403a('0x1d')](_0x5cd7be);return _0x1d7c70[_0x403a('0x22')](_0x403a('0x23'),_0x470d25+'-'+_0x2d6642+'/'+_0x513495)[_0x403a('0x1f')](_0x43c604);}return null;};}function patchUpdates(_0x1a94d2){return function(_0x1d2f4d){try{jsonpatch['apply'](_0x1d2f4d,_0x1a94d2,!![]);}catch(_0x27dc77){return BPromise[_0x403a('0x24')](_0x27dc77);}return _0x1d2f4d[_0x403a('0x25')]();};}function saveUpdates(_0x5131f7,_0x5de5ec){return function(_0x3bcd0b){if(_0x3bcd0b){return _0x3bcd0b[_0x403a('0x26')](_0x5131f7)['then'](function(_0x42fcc8){return _0x42fcc8;});}return null;};}function removeEntity(_0x165609,_0x6d2f23){return function(_0x4abccb){if(_0x4abccb){return _0x4abccb[_0x403a('0x27')]()['then'](function(){_0x165609['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f8d5,_0x4955bc){return function(_0x2d7478){if(!_0x2d7478){_0x40f8d5[_0x403a('0x1c')](0x194);}return _0x2d7478;};}function handleError(_0x5643c9,_0x346dd8){_0x346dd8=_0x346dd8||0x1f4;return function(_0x5bdbf9){logger[_0x403a('0x28')](_0x5bdbf9['stack']);if(_0x5bdbf9['name']){delete _0x5bdbf9[_0x403a('0x29')];}_0x5643c9['status'](_0x346dd8)[_0x403a('0x2a')](_0x5bdbf9);};}function getInteractionUsers(_0x578baf,_0x2374e3){return new BPromise(function(_0x181ec2,_0x144e3){try{if(_0x2374e3[_0x578baf['id']]){_0x578baf[_0x403a('0x2b')]=_['map'](_0x2374e3[_0x578baf['id']],function(_0x4e95dc){return{'id':_0x4e95dc['id']};});}}catch(_0x5ba6a0){_0x144e3(_0x5ba6a0);}_0x181ec2(_0x578baf);});}function getInteractionTags(_0x206e2d,_0x586a4b){return new BPromise(function(_0x5e9d4d,_0x742d6b){try{if(_0x206e2d[_0x403a('0x2c')]){_0x206e2d['Tags']=[];_0x206e2d[_0x403a('0x2c')][_0x403a('0x2d')](',')[_0x403a('0x2e')](function(_0x5bc050){_0x206e2d[_0x403a('0x2f')]['push'](_0x586a4b[_0x5bc050]);});}delete _0x206e2d[_0x403a('0x2c')];}catch(_0x507522){_0x742d6b(_0x507522);}_0x5e9d4d(_0x206e2d);});}function getLastMessageText(_0x210c29){return new BPromise(function(_0x73b2d3,_0x3fb62d){return db[_0x403a('0x30')][_0x403a('0x31')]({'where':{'id':_0x210c29['id']},'attributes':[_0x403a('0x32'),_0x403a('0x33')],'raw':!![]})[_0x403a('0x34')](function(_0xcb18d8){if(!_0xcb18d8['lastMsgText']){_0x210c29[_0x403a('0x33')]=_[_0x403a('0x35')](htmlToText['fromString'](_0xcb18d8[_0x403a('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x210c29[_0x403a('0x33')]=_0xcb18d8[_0x403a('0x33')];}_0x73b2d3(_0x210c29);})[_0x403a('0x36')](function(_0x4cc480){_0x3fb62d(_0x4cc480);});});}function updateMailInteraction(_0x4540cf,_0x1a4a83,_0x28e9b7,_0xe742b0){return new BPromise(function(_0xf8a057,_0x23749a){return getInteractionUsers(_0x4540cf,_0x28e9b7)[_0x403a('0x34')](function(_0x477e73){return getInteractionTags(_0x477e73,_0x1a4a83);})[_0x403a('0x34')](function(_0xa1cf4){if(_0xe742b0){_0xf8a057(getLastMessageText(_0xa1cf4));}else{_0xf8a057(_0xa1cf4);}})[_0x403a('0x36')](function(_0x102930){_0x23749a(_0x102930);});});}exports[_0x403a('0x37')]=function(_0x56ea5c,_0x28e245){var _0x382078={},_0x1f4149={},_0x1d96ff={'count':0x0,'rows':[]};var _0x52ac68=_['map'](db[_0x403a('0x30')][_0x403a('0x38')],function(_0xc1701b){return{'name':_0xc1701b[_0x403a('0x39')],'type':_0xc1701b['type']['key']};});_0x1f4149[_0x403a('0x3a')]=_['map'](_0x52ac68,_0x403a('0x29'));_0x1f4149[_0x403a('0x3b')]=_[_0x403a('0x3c')](_0x56ea5c[_0x403a('0x3b')]);_0x1f4149[_0x403a('0x3d')]=_[_0x403a('0x3e')](_0x1f4149[_0x403a('0x3a')],_0x1f4149[_0x403a('0x3b')]);_0x382078[_0x403a('0x3f')]=_[_0x403a('0x3e')](_0x1f4149['model'],qs['fields'](_0x56ea5c[_0x403a('0x3b')]['fields']));_0x382078['attributes']=_0x382078[_0x403a('0x3f')][_0x403a('0x40')]?_0x382078['attributes']:_0x1f4149[_0x403a('0x3a')];if(!_0x56ea5c[_0x403a('0x3b')][_0x403a('0x41')](_0x403a('0x42'))){_0x382078['limit']=qs['limit'](_0x56ea5c['query'][_0x403a('0x43')]);_0x382078[_0x403a('0x21')]=qs['offset'](_0x56ea5c[_0x403a('0x3b')][_0x403a('0x21')]);}_0x382078['order']=qs[_0x403a('0x44')](_0x56ea5c[_0x403a('0x3b')]['sort']);_0x382078[_0x403a('0x45')]=qs['filters'](_[_0x403a('0x46')](_0x56ea5c[_0x403a('0x3b')],_0x1f4149[_0x403a('0x3d')]));var _0x18b4c5=[];var _0x42c5a1=squel['select']()['field']('id')[_0x403a('0x47')](_0x403a('0x29'))[_0x403a('0x47')](_0x403a('0x48'))['from']('tools_tags');var _0x3c9b47=squel[_0x403a('0x49')]()[_0x403a('0x47')](_0x403a('0x4a'))[_0x403a('0x47')]('ui.MailInteractionId')['from']('user_has_mail_interactions','ui')[_0x403a('0x4b')](_0x403a('0x4c'),'u',_0x403a('0x4d'));var _0x255966=squel[_0x403a('0x49')]()[_0x403a('0x4e')]('mail_interactions','i')[_0x403a('0x4b')](_0x403a('0x4f'),'c',_0x403a('0x50'))['left_join'](_0x403a('0x4c'),'o',_0x403a('0x51'))[_0x403a('0x4b')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x403a('0x4b')]('mail_messages','me',_0x403a('0x52'))[_0x403a('0x4b')]('mail_interaction_has_tags','it',_0x403a('0x53'))[_0x403a('0x4b')](_0x403a('0x54'),'t',_0x403a('0x55'));var _0x41bee9=squel[_0x403a('0x56')]();var _0x30e131=[];var _0x1a5f6e=squel[_0x403a('0x56')]();var _0x1d86ef;if(_0x56ea5c[_0x403a('0x3b')][_0x403a('0x57')]){_0x1d86ef=as[_0x403a('0x58')](_0x56ea5c[_0x403a('0x3b')][_0x403a('0x57')]);var _0x476dfc=_0x1d86ef[_0x403a('0x59')];for(var _0x4552ea=0x0;_0x4552ea<_0x1d86ef[_0x403a('0x5a')]['length'];_0x4552ea++){var _0x24e437=_0x1d86ef[_0x403a('0x5a')][_0x4552ea];var _0x10051c='i';var _0x3bfea1=_['find'](_0x52ac68,[_0x403a('0x29'),_0x24e437[_0x403a('0x47')]]);if(!_0x3bfea1){switch(_0x24e437[_0x403a('0x47')]){case _0x403a('0x5b'):if(_0x24e437[_0x403a('0x5c')]==0x1){_0x255966['having']('`'+_0x24e437['field']+'`\x20=\x200');}else{_0x255966[_0x403a('0x5d')]('`'+_0x24e437[_0x403a('0x47')]+_0x403a('0x5e'));}break;case'Contact':if(_0x24e437[_0x403a('0x5f')]===_0x403a('0x60')){if(_0x24e437[_0x403a('0x5c')][_0x403a('0x2d')]('\x20')[_0x403a('0x40')]>0x1){_0x41bee9[_0x476dfc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x403a('0x61')](_0x24e437[_0x403a('0x5c')]),null);}else{var _0x15daaa='%'+_0x24e437['value']+'%';_0x41bee9[_0x476dfc](_0x403a('0x62'),_0x15daaa,_0x15daaa,_0x15daaa);}}else{_0x3bfea1=_[_0x403a('0x63')](_0x52ac68,['name','ContactId']);_0x24e437['field']=_0x403a('0x64');_0x5e3979=as[_0x403a('0x65')](_0x10051c,_0x3bfea1[_0x403a('0x66')],_0x24e437);_0x41bee9[_0x476dfc](_0x5e3979[_0x403a('0x67')],_0x5e3979[_0x403a('0x5c')][_0x403a('0x68')],_0x5e3979[_0x403a('0x5c')][_0x403a('0x1e')]);}break;case'Tag':var _0x2dad0c=_0x24e437['value'][_0x403a('0x2d')](',')[_0x403a('0x69')](function(_0x57a34e){return Number(_0x57a34e);});_0x2dad0c['forEach'](function(_0x31af0d){_0x1a5f6e['or'](_0x403a('0x6a'),'%,'+_0x31af0d+',%');});_0x30e131=_[_0x403a('0x6b')](_0x30e131,_0x2dad0c);break;case'User':if(_0x24e437[_0x403a('0x5f')]==='$substring'){_0x41bee9[_0x476dfc]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x24e437[_0x403a('0x5c')]+'%',null);}else{_0x3bfea1=_['find'](_0x52ac68,[_0x403a('0x29'),_0x403a('0x6c')]);_0x24e437[_0x403a('0x47')]=_0x403a('0x6c');_0x5e3979=as['buildExpression'](_0x10051c,_0x3bfea1[_0x403a('0x66')],_0x24e437);_0x41bee9[_0x476dfc](_0x5e3979['text'],_0x5e3979[_0x403a('0x5c')]['start'],_0x5e3979[_0x403a('0x5c')][_0x403a('0x1e')]);}break;case _0x403a('0x6d'):_0x5e3979=as[_0x403a('0x65')]('me',null,_0x24e437);_0x41bee9[_0x476dfc](_0x5e3979[_0x403a('0x67')],_0x5e3979[_0x403a('0x5c')]['start'],_0x5e3979['value'][_0x403a('0x1e')]);break;}}else{var _0x5e3979=as['buildExpression'](_0x10051c,_0x3bfea1[_0x403a('0x66')],_0x24e437);_0x41bee9[_0x476dfc](_0x5e3979['text'],_0x5e3979[_0x403a('0x5c')][_0x403a('0x68')],_0x5e3979[_0x403a('0x5c')][_0x403a('0x1e')]);}}}else{var _0x4d556c=_(_0x56ea5c[_0x403a('0x3b')])[_0x403a('0x3c')]()['map'](function(_0x2b2e6a){return _[_0x403a('0x6e')](_0x52ac68,[_0x403a('0x29'),_0x2b2e6a])?_0x2b2e6a:undefined;})[_0x403a('0x6f')]()[_0x403a('0x5c')]();if(!_[_0x403a('0x70')](_0x4d556c)){_0x4d556c['forEach'](function(_0x3b7228){if(_0x3b7228===_0x403a('0x71')){_0x255966[_0x403a('0x45')]('i.MailAccountId\x20IN\x20?',[][_0x403a('0x72')](_0x56ea5c[_0x403a('0x3b')][_0x3b7228]));}else if(_0x3b7228===_0x403a('0x73')){var _0x2685b4=JSON[_0x403a('0x74')](_0x56ea5c[_0x403a('0x3b')][_0x3b7228])[_0x403a('0x75')];var _0x2ac3ec=JSON[_0x403a('0x74')](_0x56ea5c[_0x403a('0x3b')][_0x3b7228])[_0x403a('0x76')];_0x255966['where'](_0x403a('0x77'),_0x2685b4,_0x2ac3ec);}else{if(_0x56ea5c[_0x403a('0x3b')][_0x3b7228]===_0x403a('0x78')){_0x255966[_0x403a('0x45')]('i.'+_0x3b7228+'\x20IS\x20NULL');}else{_0x255966[_0x403a('0x45')]('i.'+_0x3b7228+_0x403a('0x79'),_0x56ea5c[_0x403a('0x3b')][_0x3b7228]);}}});}if(_0x56ea5c[_0x403a('0x3b')]['read']){if(_0x56ea5c['query'][_0x403a('0x7a')]==0x1){_0x255966[_0x403a('0x5d')](_0x403a('0x7b'));}else{_0x255966[_0x403a('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x56ea5c[_0x403a('0x3b')][_0x403a('0x7c')]){_0x30e131=_[_0x403a('0x7d')](_0x56ea5c['query'][_0x403a('0x7c')])?_0x56ea5c['query']['tag']:new Array(_0x56ea5c[_0x403a('0x3b')][_0x403a('0x7c')]);_0x30e131[_0x403a('0x2e')](function(_0x295221){_0x1a5f6e['or'](_0x403a('0x6a'),'%,'+_0x295221+',%');});}if(_0x56ea5c[_0x403a('0x3b')][_0x403a('0x7e')]){var _0x45083d=_0x56ea5c[_0x403a('0x3b')][_0x403a('0x7e')][_0x403a('0x7f')]('\x5c','\x5c\x5c')[_0x403a('0x7f')]('\x27\x27',_0x403a('0x80'));if(qs['isNumeric'](_0x45083d)){_0x41bee9['or'](_0x403a('0x81'),_0x45083d+'%');}else if(qs[_0x403a('0x82')](_0x45083d)){_0x41bee9['or'](_0x403a('0x83'),_0x45083d+'%');}else{_0x41bee9['or'](_0x403a('0x84'),qs[_0x403a('0x61')](_0x45083d))['or'](_0x403a('0x85'),qs['getFullTextValue'](_0x45083d));}}}_0x255966[_0x403a('0x45')](_0x41bee9);_0x255966[_0x403a('0x86')]('i.id');var _0x3f8a41={'type':db['Sequelize'][_0x403a('0x87')][_0x403a('0x88')],'raw':!![]};var _0x35f5dc=_0x255966[_0x403a('0x89')]();_0x35f5dc['field'](_0x403a('0x8a'));_0x35f5dc['field'](_0x403a('0x8b'),_0x403a('0x5b'));if(_0x382078[_0x403a('0x8c')]){_0x382078[_0x403a('0x8c')][_0x403a('0x2e')](function(_0x4dba09){_0x255966['order']('i.'+_0x4dba09[0x0],_0x4dba09[0x1]===_0x403a('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x30e131)){_0x255966[_0x403a('0x5d')](_0x1a5f6e);_0x35f5dc[_0x403a('0x45')]('t.id\x20IN\x20?',_0x30e131);}BPromise[_0x403a('0x8e')]()[_0x403a('0x34')](function(){if(!_0x1d86ef)return;return _0x56ea5c['user'][_0x403a('0x8f')]({'attributes':['id'],'raw':!![]})[_0x403a('0x34')](function(_0x104a40){_0x35f5dc['where'](_0x403a('0x90'),_[_0x403a('0x69')](_0x104a40,'id'));_0x255966[_0x403a('0x45')](_0x403a('0x90'),_[_0x403a('0x69')](_0x104a40,'id'));});})[_0x403a('0x34')](function(){db[_0x403a('0x91')]['query'](_0x35f5dc[_0x403a('0x92')](),_0x3f8a41)['then'](function(_0x52093a){_0x1d96ff[_0x403a('0x20')]=_0x52093a[_0x403a('0x40')];if(_0x1d96ff['count']===0x0)return[];return db[_0x403a('0x91')][_0x403a('0x3b')](_0x42c5a1[_0x403a('0x92')](),_0x3f8a41)[_0x403a('0x34')](function(_0x2fdb9b){_0x18b4c5=_[_0x403a('0x93')](_0x2fdb9b,'id');_0x3f8a41=_[_0x403a('0x94')](_0x3f8a41,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x255966['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x403a('0x5b'));_0x255966[_0x403a('0x47')](_0x403a('0x95'),_0x403a('0x96'));_0x255966['field']('a.mandatoryDisposition',_0x403a('0x97'));_0x255966[_0x403a('0x47')](_0x403a('0x8a'));_0x255966[_0x403a('0x47')](_0x403a('0x98'));_0x255966['field'](_0x403a('0x99'));_0x255966[_0x403a('0x47')]('i.closed');_0x255966[_0x403a('0x47')]('i.closedAt');_0x255966[_0x403a('0x47')]('i.attach');_0x255966[_0x403a('0x47')](_0x403a('0x9a'));_0x255966[_0x403a('0x47')]('i.lastMsgDirection');_0x255966[_0x403a('0x47')](_0x403a('0x9b'));_0x255966[_0x403a('0x47')](_0x403a('0x9c'));_0x255966[_0x403a('0x47')](_0x403a('0x9d'));_0x255966[_0x403a('0x47')](_0x403a('0x9e'));_0x255966[_0x403a('0x47')](_0x403a('0x9f'));_0x255966['field']('i.MailAccountId');_0x255966[_0x403a('0x47')](_0x403a('0xa0'));_0x255966[_0x403a('0x47')](_0x403a('0xa1'),_0x403a('0xa2'));_0x255966[_0x403a('0x47')](_0x403a('0xa3'),_0x403a('0xa4'));_0x255966[_0x403a('0x47')](_0x403a('0xa5'),_0x403a('0xa6'));_0x255966[_0x403a('0x47')](_0x403a('0xa7'),_0x403a('0xa8'));_0x255966[_0x403a('0x47')](_0x403a('0xa9'),_0x403a('0xaa'));_0x255966['field']('c.fax',_0x403a('0xab'));_0x255966[_0x403a('0x47')](_0x403a('0xac'),_0x403a('0x2c'));_0x255966[_0x403a('0x43')](_0x382078[_0x403a('0x43')]);_0x255966[_0x403a('0x21')](_0x382078['offset']);return db[_0x403a('0x91')][_0x403a('0x3b')](_0x255966[_0x403a('0x92')](),_0x3f8a41);})[_0x403a('0x34')](function(_0x412f4b){_0x3c9b47[_0x403a('0x45')](_0x403a('0xad'),_[_0x403a('0x69')](_0x412f4b,'id'));return db['sequelize'][_0x403a('0x3b')](_0x3c9b47['toString'](),_0x3f8a41)[_0x403a('0x34')](function(_0x4e9c10){var _0x59e104=_[_0x403a('0xae')](_0x4e9c10,_0x403a('0xaf'));var _0x5a7de9=[];return db['Setting'][_0x403a('0x31')]({'attributes':[_0x403a('0xb0')],'raw':!![]})[_0x403a('0x34')](function(_0x923f64){var _0x1520f9=_0x923f64[_0x403a('0xb0')];_0x412f4b[_0x403a('0x2e')](function(_0x50db97){_0x5a7de9[_0x403a('0xb1')](updateMailInteraction(_0x50db97,_0x18b4c5,_0x59e104,_0x1520f9));});return BPromise[_0x403a('0xb2')](_0x5a7de9);});});});})[_0x403a('0x34')](function(_0xb82e14){_0x1d96ff[_0x403a('0xb3')]=_0xb82e14;return _0x1d96ff;})['then'](respondWithFilteredResult(_0x28e245,_0x382078));})[_0x403a('0x36')](handleError(_0x28e245,null));};exports['show']=function(_0x13bc7e,_0x11684e){var _0x38b952={'raw':![],'where':{'id':_0x13bc7e[_0x403a('0xb4')]['id']}},_0x35f643={};_0x35f643['model']=_[_0x403a('0x3c')](db[_0x403a('0x30')][_0x403a('0x38')]);_0x35f643[_0x403a('0x3b')]=_[_0x403a('0x3c')](_0x13bc7e['query']);_0x35f643[_0x403a('0x3d')]=_['intersection'](_0x35f643[_0x403a('0x3a')],_0x35f643[_0x403a('0x3b')]);_0x38b952[_0x403a('0x3f')]=_[_0x403a('0x3e')](_0x35f643['model'],qs[_0x403a('0xb5')](_0x13bc7e[_0x403a('0x3b')][_0x403a('0xb5')]));_0x38b952[_0x403a('0x3f')]=_0x38b952[_0x403a('0x3f')][_0x403a('0x40')]?_0x38b952['attributes']:_0x35f643['model'];if(_0x13bc7e[_0x403a('0x3b')][_0x403a('0xb6')]){_0x38b952[_0x403a('0xb7')]=[{'all':!![]}];}_0x38b952=_[_0x403a('0x94')]({},_0x38b952,_0x13bc7e[_0x403a('0xb8')]);return db[_0x403a('0x30')]['find'](_0x38b952)[_0x403a('0x34')](handleEntityNotFound(_0x11684e,null))[_0x403a('0x34')](respondWithResult(_0x11684e,null))[_0x403a('0x36')](handleError(_0x11684e,null));};exports[_0x403a('0xb9')]=function(_0x36ca0f,_0x368a77){return db[_0x403a('0x30')][_0x403a('0xb9')](_0x36ca0f['body'],{})[_0x403a('0x34')](respondWithResult(_0x368a77,0xc9))[_0x403a('0x36')](handleError(_0x368a77,null));};exports[_0x403a('0x26')]=function(_0x2813fc,_0x3e93e2){if(_0x2813fc[_0x403a('0xba')]['id']){delete _0x2813fc[_0x403a('0xba')]['id'];}return db[_0x403a('0x30')][_0x403a('0x63')]({'where':{'id':_0x2813fc[_0x403a('0xb4')]['id']}})[_0x403a('0x34')](handleEntityNotFound(_0x3e93e2,null))[_0x403a('0x34')](saveUpdates(_0x2813fc['body'],null))[_0x403a('0x34')](respondWithResult(_0x3e93e2,null))['catch'](handleError(_0x3e93e2,null));};exports[_0x403a('0x27')]=function(_0x5b5da7,_0x3074db){return db[_0x403a('0x30')][_0x403a('0x63')]({'where':{'id':_0x5b5da7[_0x403a('0xb4')]['id']}})[_0x403a('0x34')](handleEntityNotFound(_0x3074db,null))[_0x403a('0x34')](removeEntity(_0x3074db,null))['catch'](handleError(_0x3074db,null));};exports[_0x403a('0xbb')]=function(_0x189152,_0x3b5cd4){return db['MailInteraction']['describe']()[_0x403a('0x34')](respondWithResult(_0x3b5cd4,null))[_0x403a('0x36')](handleError(_0x3b5cd4,null));};exports[_0x403a('0xbc')]=function(_0x2fc0ec,_0x7233c1,_0x3dac72){return db['MailMessage'][_0x403a('0x63')]({'where':{'id':_0x2fc0ec[_0x403a('0xb4')]['id']}})[_0x403a('0x34')](handleEntityNotFound(_0x7233c1,null))[_0x403a('0x34')](function(_0x3de3bb){if(_0x3de3bb){return _0x3de3bb['addMessage'](_0x2fc0ec[_0x403a('0xba')]['ids'],_[_0x403a('0xbd')](_0x2fc0ec[_0x403a('0xba')],['ids','id'])||{});}})['then'](respondWithResult(_0x7233c1,null))[_0x403a('0x36')](handleError(_0x7233c1,null));};exports[_0x403a('0xbe')]=function(_0x21d997,_0xbae51f,_0x4870c1){var _0x1b121e={'raw':![],'where':{}};var _0x489ebd={};var _0xe51ed2={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x21d997[_0x403a('0xb4')]['id']}})[_0x403a('0x34')](handleEntityNotFound(_0xbae51f,null))[_0x403a('0x34')](function(_0x1ecdd5){if(_0x1ecdd5){_0x489ebd[_0x403a('0x3a')]=_[_0x403a('0x3c')](db['MailMessage'][_0x403a('0x38')]);_0x489ebd['query']=_[_0x403a('0x3c')](_0x21d997['query']);_0x489ebd['filters']=_['intersection'](_0x489ebd['model'],_0x489ebd[_0x403a('0x3b')]);_0x1b121e[_0x403a('0x3f')]=_['intersection'](_0x489ebd['model'],qs[_0x403a('0xb5')](_0x21d997['query'][_0x403a('0xb5')]));_0x1b121e[_0x403a('0x3f')]=_0x1b121e[_0x403a('0x3f')][_0x403a('0x40')]?_0x1b121e['attributes']:_0x489ebd[_0x403a('0x3a')];if(!_0x21d997['query'][_0x403a('0x41')]('nolimit')){_0x1b121e[_0x403a('0x43')]=qs[_0x403a('0x43')](_0x21d997['query'][_0x403a('0x43')]);_0x1b121e[_0x403a('0x21')]=qs['offset'](_0x21d997[_0x403a('0x3b')][_0x403a('0x21')]);}_0x1b121e['order']=qs[_0x403a('0x44')](_0x21d997['query'][_0x403a('0x44')]);_0x1b121e[_0x403a('0x45')]=qs[_0x403a('0x3d')](_['pick'](_0x21d997[_0x403a('0x3b')],_0x489ebd[_0x403a('0x3d')]));_0x1b121e['where']['MailInteractionId']=_0x1ecdd5['id'];if(_0x21d997[_0x403a('0x3b')][_0x403a('0x7e')]){_0x1b121e[_0x403a('0x45')]=_[_0x403a('0x94')](_0x1b121e[_0x403a('0x45')],{'$or':_['map'](_0x1b121e[_0x403a('0x3f')],function(_0x206f27){var _0x598839={};_0x598839[_0x206f27]={'$like':'%'+_0x21d997[_0x403a('0x3b')]['filter']+'%'};return _0x598839;})});}if(_0x21d997['query']['$gte']){var _0x51e76c=_0x21d997[_0x403a('0x3b')][_0x403a('0x75')][_0x403a('0x2d')](',');var _0x29e27c={};_0x29e27c[_0x51e76c[0x0]]={'$gte':moment(_0x51e76c[0x1])[_0x403a('0xbf')](_0x403a('0xc0'))};_0x1b121e[_0x403a('0x45')]=_['merge'](_0x1b121e[_0x403a('0x45')],_0x29e27c);}_0x1b121e=_['merge']({},_0x1b121e,_0x21d997[_0x403a('0xb8')]);return db[_0x403a('0xc1')]['count']({'where':_0x1b121e[_0x403a('0x45')]})['then'](function(_0x225498){_0xe51ed2[_0x403a('0x20')]=_0x225498;if(_0x21d997['query'][_0x403a('0xb6')]){_0x1b121e[_0x403a('0xb7')]=[{'all':!![]}];}return db[_0x403a('0xc1')]['findAll'](_0x1b121e);})[_0x403a('0x34')](function(_0x6ee06e){_0xe51ed2[_0x403a('0xb3')]=_0x6ee06e;return _0xe51ed2;});}})[_0x403a('0x34')](respondWithFilteredResult(_0xbae51f,_0x1b121e))[_0x403a('0x36')](handleError(_0xbae51f,null));};exports[_0x403a('0xc2')]=function(_0x13085f,_0x4827a5,_0x1de952){return db[_0x403a('0x30')][_0x403a('0x63')]({'where':{'id':_0x13085f[_0x403a('0xb4')]['id']}})[_0x403a('0x34')](handleEntityNotFound(_0x4827a5,null))[_0x403a('0x34')](function(_0x412008){if(_0x412008){return _0x412008[_0x403a('0xc3')](_0x13085f[_0x403a('0xba')][_0x403a('0xc4')],_[_0x403a('0xbd')](_0x13085f[_0x403a('0xba')],[_0x403a('0xc4'),'id'])||{})[_0x403a('0xc5')](function(){return db[_0x403a('0xc6')][_0x403a('0xc7')]({'attributes':['id','name',_0x403a('0x48')],'where':{'id':_0x13085f[_0x403a('0xba')][_0x403a('0xc4')]}});})['then'](function(_0x42296a){socket['emit'](_0x403a('0xc8'),{'id':Number(_0x13085f[_0x403a('0xb4')]['id']),'tags':_0x42296a||[]});return{'id':Number(_0x13085f['params']['id']),'tags':_0x42296a||[]};});}})[_0x403a('0x34')](respondWithResult(_0x4827a5,null))[_0x403a('0x36')](handleError(_0x4827a5,null));};exports[_0x403a('0xc9')]=function(_0x15af49,_0x1688c1,_0x2c307d){return db[_0x403a('0x30')][_0x403a('0x63')]({'where':{'id':_0x15af49[_0x403a('0xb4')]['id']}})['then'](handleEntityNotFound(_0x1688c1,null))[_0x403a('0x34')](function(_0x422ab2){if(_0x422ab2){return _0x422ab2[_0x403a('0xc9')](_0x15af49['query']['ids']);}})[_0x403a('0x34')](respondWithStatusCode(_0x1688c1,null))[_0x403a('0x36')](handleError(_0x1688c1,null));};exports['download']=function(_0x2f3848,_0x48a86f){var _0x30c699=moment()[_0x403a('0xca')]()[_0x403a('0x92')]();var _0x3ee4f7=path['join'](config[_0x403a('0xcb')],_0x403a('0xcc'),_0x403a('0xcd'),_0x403a('0xce'));var _0x456f45=path['join'](config[_0x403a('0xcb')],_0x403a('0xcc'),_0x403a('0xcd'),_0x403a('0xcf'));var _0x4cca09=path[_0x403a('0xd0')](_0x456f45,_0x30c699);var _0xcc6fa8=util[_0x403a('0xbf')]('interaction-%s.zip',_0x30c699);var _0x585e6c=path[_0x403a('0xd0')](_0x456f45,_0xcc6fa8);var _0x491ec3=![];return db[_0x403a('0x30')]['find']({'where':{'id':_0x2f3848['params']['id']}})[_0x403a('0x34')](handleEntityNotFound(_0x48a86f,null))[_0x403a('0x34')](function(_0x409d6c){if(_0x409d6c){return _0x409d6c[_0x403a('0xbe')]({'attributes':['id',_0x403a('0xba'),_0x403a('0x4e'),'to','cc','bcc',_0x403a('0xd1'),_0x403a('0x73')],'where':{'secret':![]},'include':_0x2f3848['query'][_0x403a('0xce')]?[{'model':db['Attachment'],'as':_0x403a('0xd2')}]:undefined,'order':qs['sort']('id')});}return[];})[_0x403a('0x34')](function(_0x200643){_0x491ec3=_0x200643[_0x403a('0x40')];if(_0x200643[_0x403a('0x40')]){fs[_0x403a('0xd3')](_0x4cca09);return BPromise[_0x403a('0xd4')](_0x200643,function(_0x34292b,_0x35a966){var _0x1bb1c4=_0x34292b;var _0x504dce={'from':_0x1bb1c4['from'],'to':_0x1bb1c4['to'],'subject':_0x1bb1c4['subject'],'html':_0x1bb1c4[_0x403a('0xba')],'headers':{'Date':moment(_0x1bb1c4[_0x403a('0x73')])['format'](_0x403a('0xd5'))},'attachments':[]};if(_0x34292b['cc']){_0x504dce[_0x403a('0xd6')]['Cc']=_0x34292b['cc'];}if(_0x34292b[_0x403a('0xd7')]){_0x504dce[_0x403a('0xd6')][_0x403a('0xd8')]=_0x34292b[_0x403a('0xd7')];}return new BPromise(function(_0x1b215b,_0x311a71){if(_0x34292b[_0x403a('0xd2')]){for(var _0x2f18bc=0x0;_0x2f18bc<_0x34292b[_0x403a('0xd2')][_0x403a('0x40')];_0x2f18bc++){var _0x2b5de7=_0x34292b['Attachments'][_0x2f18bc];var _0x308993=path[_0x403a('0xd0')](_0x3ee4f7,_0x2b5de7['basename']);if(fs[_0x403a('0xd9')](_0x308993)){_0x504dce[_0x403a('0xce')][_0x403a('0xb1')]({'name':_0x2b5de7[_0x403a('0x29')],'contentType':_0x2b5de7[_0x403a('0x66')],'data':fs[_0x403a('0xda')](_0x308993)});}}}emlformat[_0x403a('0xdb')](_0x504dce,function(_0x4dbdb8,_0xf52964){if(_0x4dbdb8)return _0x311a71(_0x4dbdb8);fs['writeFileSync'](path[_0x403a('0xd0')](_0x4cca09,util['format'](_0x403a('0xdc'),_0x35a966)),_0xf52964);return _0x1b215b(_0xf52964);});});});}})['then'](function(){if(_0x491ec3){return new BPromise(function(_0x3c596b,_0x30ae09){zipdir(_0x4cca09,{'saveTo':_0x585e6c},function(_0x1699c4,_0x161a8b){if(_0x1699c4)return _0x30ae09(_0x1699c4);return _0x3c596b(_0x161a8b);});});}})[_0x403a('0x34')](function(){if(_0x491ec3){return new BPromise(function(_0xe57c2,_0x5189e1){rimraf(_0x4cca09,function(_0xd95ae1){if(_0xd95ae1)_0x5189e1(_0xd95ae1);return _0xe57c2();});});}})[_0x403a('0x34')](function(){if(_0x491ec3){return _0x48a86f[_0x403a('0xdd')](_0x585e6c,_0xcc6fa8,function(_0x4c9a68){if(_0x4c9a68){console[_0x403a('0xde')](_0x403a('0xdf'),_0x4c9a68);}else{fs['unlinkSync'](_0x585e6c);}});}else{return _0x48a86f[_0x403a('0x1c')](0xc8);}})[_0x403a('0x36')](handleError(_0x48a86f,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 5ef160d..729a08e 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 _0x61ca=['../../mysqldb','MailMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events'];(function(_0x27d287,_0x283a14){var _0x2cb878=function(_0x39c3c4){while(--_0x39c3c4){_0x27d287['push'](_0x27d287['shift']());}};_0x2cb878(++_0x283a14);}(_0x61ca,0xd7));var _0xa61c=function(_0x59f638,_0x45a5d0){_0x59f638=_0x59f638-0x0;var _0x348cfc=_0x61ca[_0x59f638];return _0x348cfc;};'use strict';var EventEmitter=require(_0xa61c('0x0'));var MailInteraction=require(_0xa61c('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xa61c('0x1'))['db'][_0xa61c('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa61c('0x3'),'afterUpdate':_0xa61c('0x4'),'afterDestroy':_0xa61c('0x5')};function emitEvent(_0x3d0604){return function(_0x4e79f1,_0x1116f9,_0x2dbedb){_0x4e79f1[_0xa61c('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x183052){_0x4e79f1[_0xa61c('0x7')](_0xa61c('0x8'),_0x183052[_0xa61c('0x9')](function(_0x5c4920){return{'id':_0x5c4920['id']};}));return MailMessage[_0xa61c('0xa')]({'where':{'MailInteractionId':_0x4e79f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa61c('0xb')](function(_0x327e89){_0x4e79f1['setDataValue'](_0xa61c('0xc'),_0x327e89[_0xa61c('0xd')]);MailInteractionEvents[_0xa61c('0xe')](_0x3d0604+':'+_0x4e79f1['id'],_0x4e79f1);MailInteractionEvents[_0xa61c('0xe')](_0x3d0604,_0x4e79f1);_0x2dbedb(null);})['catch'](_0x2dbedb(null));};}for(var e in events){if(events[_0xa61c('0xf')](e)){var event=events[e];MailInteraction[_0xa61c('0x10')](e,emitEvent(event));}}module[_0xa61c('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x275b=['setMaxListeners','update','getUsers','Users','then','setDataValue','emit','catch','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2a0cb1,_0x519841){var _0x6717d6=function(_0xdc199e){while(--_0xdc199e){_0x2a0cb1['push'](_0x2a0cb1['shift']());}};_0x6717d6(++_0x519841);}(_0x275b,0x12b));var _0xb275=function(_0x358ec1,_0x5e2c85){_0x358ec1=_0x358ec1-0x0;var _0x25099a=_0x275b[_0x358ec1];return _0x25099a;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xb275('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xb275('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb275('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb275('0x2'),'afterDestroy':'remove'};function emitEvent(_0x370c97){return function(_0x37fac8,_0x59b9e8,_0x351eeb){_0x37fac8[_0xb275('0x3')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12e3ad){_0x37fac8['setDataValue'](_0xb275('0x4'),_0x12e3ad['map'](function(_0x41b76d){return{'id':_0x41b76d['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x37fac8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb275('0x5')](function(_0x1f061c){_0x37fac8[_0xb275('0x6')]('unreadMessages',_0x1f061c['length']);MailInteractionEvents[_0xb275('0x7')](_0x370c97+':'+_0x37fac8['id'],_0x37fac8);MailInteractionEvents[_0xb275('0x7')](_0x370c97,_0x37fac8);_0x351eeb(null);})[_0xb275('0x8')](_0x351eeb(null));};}for(var e in events){if(events[_0xb275('0x9')](e)){var event=events[e];MailInteraction[_0xb275('0xa')](e,emitEvent(event));}}module[_0xb275('0xb')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index cbfef6a..9850f25 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 _0x50d4=['request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','substatus','changed','closed','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50d4,0x1be));var _0x450d=function(_0x3f9203,_0x18a7f1){_0x3f9203=_0x3f9203-0x0;var _0x2415f5=_0x50d4[_0x3f9203];return _0x2415f5;};'use strict';var _=require(_0x450d('0x0'));var util=require(_0x450d('0x1'));var logger=require('../../config/logger')(_0x450d('0x2'));var moment=require(_0x450d('0x3'));var BPromise=require('bluebird');var rp=require(_0x450d('0x4'));var fs=require('fs');var path=require(_0x450d('0x5'));var rimraf=require(_0x450d('0x6'));var config=require(_0x450d('0x7'));var attributes=require(_0x450d('0x8'));module['exports']=function(_0x1ef561,_0x143cf2){return _0x1ef561['define'](_0x450d('0x9'),attributes,{'tableName':_0x450d('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x450d('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36d7e7,_0x7cb298,_0x3a3eb5){if(_0x36d7e7['substatus']){_0x36d7e7[_0x450d('0xc')]=moment()[_0x450d('0xd')](_0x450d('0xe'));}if(_0x36d7e7['closed']){_0x36d7e7[_0x450d('0xf')]=moment()[_0x450d('0xd')](_0x450d('0xe'));}_0x3a3eb5(null,_0x7cb298);},'beforeUpdate':function(_0x19cd90,_0x3c2151,_0x499611){if(_0x19cd90['changed'](_0x450d('0x10'))){_0x19cd90[_0x450d('0xc')]=moment()[_0x450d('0xd')](_0x450d('0xe'));}if(_0x19cd90[_0x450d('0x11')](_0x450d('0x12'))){_0x19cd90[_0x450d('0xf')]=moment()[_0x450d('0xd')](_0x450d('0xe'));}_0x499611(null,_0x19cd90);},'afterUpdate':function(_0x4eca15,_0x51704f,_0x2e40ec){var _0xc8f25e=_0x1ef561['models'];var _0x1d3d1d=_0x4eca15[_0x450d('0x13')]({'plain':!![]});if(_0x1d3d1d[_0x450d('0x12')]){return _0xc8f25e['MailMessage'][_0x450d('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x1d3d1d['id']}})[_0x450d('0x15')](function(){_0x2e40ec();})[_0x450d('0x16')](function(_0x172827){_0x2e40ec(_0x172827);});}else{_0x2e40ec();}}},'charset':_0x450d('0x17'),'collate':_0x450d('0x18')});}; \ No newline at end of file +var _0x759b=['mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','get','closed','MailMessage','update','then','catch','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x759b,0x85));var _0xb759=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0x759b[_0x326d35];return _0xd3f8f3;};'use strict';var _=require(_0xb759('0x0'));var util=require(_0xb759('0x1'));var logger=require('../../config/logger')(_0xb759('0x2'));var moment=require(_0xb759('0x3'));var BPromise=require(_0xb759('0x4'));var rp=require(_0xb759('0x5'));var fs=require('fs');var path=require(_0xb759('0x6'));var rimraf=require(_0xb759('0x7'));var config=require(_0xb759('0x8'));var attributes=require(_0xb759('0x9'));module[_0xb759('0xa')]=function(_0x13f3e0,_0x32555d){return _0x13f3e0['define'](_0xb759('0xb'),attributes,{'tableName':_0xb759('0xc'),'paranoid':![],'indexes':[{'name':_0xb759('0xd'),'fields':['subject','to'],'type':_0xb759('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x9db476,_0x3acea1,_0x2c76ab){if(_0x9db476[_0xb759('0xf')]){_0x9db476[_0xb759('0x10')]=moment()[_0xb759('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x9db476['closed']){_0x9db476[_0xb759('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2c76ab(null,_0x3acea1);},'beforeUpdate':function(_0x22dd69,_0x2d4c37,_0x30e182){if(_0x22dd69[_0xb759('0x13')](_0xb759('0xf'))){_0x22dd69[_0xb759('0x10')]=moment()[_0xb759('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x22dd69[_0xb759('0x13')]('closed')){_0x22dd69['closedAt']=moment()[_0xb759('0x11')](_0xb759('0x14'));}_0x30e182(null,_0x22dd69);},'afterUpdate':function(_0x2fbe1d,_0x57cfda,_0x45b470){var _0x5ae0d6=_0x13f3e0[_0xb759('0x15')];var _0x3b96ba=_0x2fbe1d[_0xb759('0x16')]({'plain':!![]});if(_0x3b96ba[_0xb759('0x17')]){return _0x5ae0d6[_0xb759('0x18')][_0xb759('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x3b96ba['id']}})[_0xb759('0x1a')](function(){_0x45b470();})[_0xb759('0x1b')](function(_0xfb46a4){_0x45b470(_0xfb46a4);});}else{_0x45b470();}}},'charset':_0xb759('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index e3ae7af..e21a1d2 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 _0xf6fb=['error','code','MailInteraction,\x20%s,\x20%s','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f95af,_0xee2caf){var _0x40612a=function(_0x1d4080){while(--_0x1d4080){_0x3f95af['push'](_0x3f95af['shift']());}};_0x40612a(++_0xee2caf);}(_0xf6fb,0x111));var _0xbf6f=function(_0x571575,_0x4ef078){_0x571575=_0x571575-0x0;var _0x58d458=_0xf6fb[_0x571575];return _0x58d458;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6f('0x0'));var BPromise=require(_0xbf6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require(_0xbf6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x4'))('rpc');var config=require(_0xbf6f('0x5'));var jayson=require(_0xbf6f('0x6'));var client=jayson[_0xbf6f('0x7')][_0xbf6f('0x8')]({'port':0x232a});config[_0xbf6f('0x9')]=_[_0xbf6f('0xa')](config[_0xbf6f('0x9')],{'host':_0xbf6f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf6f('0x9')]));require(_0xbf6f('0xc'))[_0xbf6f('0xd')](socket);function respondWithRpcPromise(_0x45d50a,_0x283d7e,_0x5ad71d){return new BPromise(function(_0x4b3ac5,_0xf8fa14){return client[_0xbf6f('0xe')](_0x45d50a,_0x5ad71d)[_0xbf6f('0xf')](function(_0x590d60){logger[_0xbf6f('0x10')]('MailInteraction,\x20%s,\x20%s',_0x283d7e,_0xbf6f('0x11'));logger[_0xbf6f('0x12')](_0xbf6f('0x13'),_0x283d7e,'request\x20sent',JSON[_0xbf6f('0x14')](_0x590d60));if(_0x590d60[_0xbf6f('0x15')]){if(_0x590d60[_0xbf6f('0x15')][_0xbf6f('0x16')]===0x1f4){logger[_0xbf6f('0x15')](_0xbf6f('0x17'),_0x283d7e,_0x590d60['error'][_0xbf6f('0x18')]);return _0xf8fa14(_0x590d60[_0xbf6f('0x15')][_0xbf6f('0x18')]);}logger[_0xbf6f('0x15')](_0xbf6f('0x17'),_0x283d7e,_0x590d60[_0xbf6f('0x15')][_0xbf6f('0x18')]);return _0x4b3ac5(_0x590d60['error']['message']);}else{logger[_0xbf6f('0x10')](_0xbf6f('0x17'),_0x283d7e,_0xbf6f('0x11'));_0x4b3ac5(_0x590d60['result']['message']);}})[_0xbf6f('0x19')](function(_0x1e4a92){logger[_0xbf6f('0x15')](_0xbf6f('0x17'),_0x283d7e,_0x1e4a92);_0xf8fa14(_0x1e4a92);});});}exports[_0xbf6f('0x1a')]=function(_0x527407){var _0x525e78=this;return new Promise(function(_0x23cc46,_0x5985ac){return db[_0xbf6f('0x1b')][_0xbf6f('0x1c')](_0x527407[_0xbf6f('0x1d')],{'raw':_0x527407['options']?_0x527407[_0xbf6f('0x1e')][_0xbf6f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x527407[_0xbf6f('0x1e')]?_0x527407['options'][_0xbf6f('0x20')]||null:null,'attributes':_0x527407['options']?_0x527407[_0xbf6f('0x1e')][_0xbf6f('0x21')]||null:null,'limit':_0x527407[_0xbf6f('0x1e')]?_0x527407['options'][_0xbf6f('0x22')]||null:null})[_0xbf6f('0xf')](function(_0x29415d){logger[_0xbf6f('0x10')](_0xbf6f('0x1a'),_0x527407);logger[_0xbf6f('0x12')]('UpdateMailInteraction',_0x527407,JSON[_0xbf6f('0x14')](_0x29415d));_0x23cc46(_0x29415d);})[_0xbf6f('0x19')](function(_0x4c7e8d){logger['error']('UpdateMailInteraction',_0x4c7e8d[_0xbf6f('0x18')],_0x527407);_0x5985ac(_0x525e78['error'](0x1f4,_0x4c7e8d[_0xbf6f('0x18')]));});});};exports[_0xbf6f('0x23')]=function(_0x3020c8){return new Promise(function(_0x34cd97,_0xb440e8){return db[_0xbf6f('0x1b')][_0xbf6f('0x24')]({'where':_0x3020c8['options']?_0x3020c8['options'][_0xbf6f('0x20')]||null:null})[_0xbf6f('0xf')](function(_0x5db6ba){if(_0x5db6ba){return _0x5db6ba[_0xbf6f('0x25')](_0x3020c8['body'][_0xbf6f('0x26')],_[_0xbf6f('0x27')](_0x3020c8[_0xbf6f('0x1d')],[_0xbf6f('0x26'),'id'])||{});}})[_0xbf6f('0x28')](function(_0x133119){logger[_0xbf6f('0x10')](_0xbf6f('0x29'),_0x3020c8);logger[_0xbf6f('0x12')](_0xbf6f('0x29'),_0x3020c8,JSON['stringify'](_0x133119));_0x34cd97(_0x133119);})['catch'](function(_0x35b1b2){logger[_0xbf6f('0x15')](_0xbf6f('0x29'),_0x35b1b2[_0xbf6f('0x18')],_0x3020c8);_0xb440e8(_this['error'](0x1f4,_0x35b1b2[_0xbf6f('0x18')]));});});}; \ No newline at end of file +var _0x3c81=['code','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','find','ids','spread','AddTags','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x366001,_0x9bac5b){var _0x31a66e=function(_0x2f19a8){while(--_0x2f19a8){_0x366001['push'](_0x366001['shift']());}};_0x31a66e(++_0x9bac5b);}(_0x3c81,0x102));var _0x13c8=function(_0xafc4e9,_0x2c692f){_0xafc4e9=_0xafc4e9-0x0;var _0x4cc0c8=_0x3c81[_0xafc4e9];return _0x4cc0c8;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});config[_0x13c8('0x9')]=_[_0x13c8('0xa')](config['redis'],{'host':_0x13c8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13c8('0x9')]));require(_0x13c8('0xc'))[_0x13c8('0xd')](socket);function respondWithRpcPromise(_0x30b4d6,_0xaa58b6,_0x13c717){return new BPromise(function(_0x29074d,_0x2ce95a){return client[_0x13c8('0xe')](_0x30b4d6,_0x13c717)[_0x13c8('0xf')](function(_0x3ca0a6){logger[_0x13c8('0x10')](_0x13c8('0x11'),_0xaa58b6,_0x13c8('0x12'));logger['debug'](_0x13c8('0x13'),_0xaa58b6,_0x13c8('0x12'),JSON[_0x13c8('0x14')](_0x3ca0a6));if(_0x3ca0a6[_0x13c8('0x15')]){if(_0x3ca0a6['error'][_0x13c8('0x16')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0xaa58b6,_0x3ca0a6['error'][_0x13c8('0x17')]);return _0x2ce95a(_0x3ca0a6['error'][_0x13c8('0x17')]);}logger[_0x13c8('0x15')](_0x13c8('0x11'),_0xaa58b6,_0x3ca0a6[_0x13c8('0x15')]['message']);return _0x29074d(_0x3ca0a6[_0x13c8('0x15')][_0x13c8('0x17')]);}else{logger[_0x13c8('0x10')](_0x13c8('0x11'),_0xaa58b6,_0x13c8('0x12'));_0x29074d(_0x3ca0a6[_0x13c8('0x18')][_0x13c8('0x17')]);}})[_0x13c8('0x19')](function(_0x34fbc0){logger[_0x13c8('0x15')](_0x13c8('0x11'),_0xaa58b6,_0x34fbc0);_0x2ce95a(_0x34fbc0);});});}exports['UpdateMailInteraction']=function(_0x3b8eac){var _0x37242f=this;return new Promise(function(_0x1d1686,_0x313ea3){return db['MailInteraction'][_0x13c8('0x1a')](_0x3b8eac[_0x13c8('0x1b')],{'raw':_0x3b8eac[_0x13c8('0x1c')]?_0x3b8eac[_0x13c8('0x1c')][_0x13c8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b8eac[_0x13c8('0x1c')]?_0x3b8eac['options'][_0x13c8('0x1e')]||null:null,'attributes':_0x3b8eac[_0x13c8('0x1c')]?_0x3b8eac[_0x13c8('0x1c')][_0x13c8('0x1f')]||null:null,'limit':_0x3b8eac['options']?_0x3b8eac[_0x13c8('0x1c')][_0x13c8('0x20')]||null:null})['then'](function(_0x49b552){logger[_0x13c8('0x10')](_0x13c8('0x21'),_0x3b8eac);logger['debug']('UpdateMailInteraction',_0x3b8eac,JSON[_0x13c8('0x14')](_0x49b552));_0x1d1686(_0x49b552);})[_0x13c8('0x19')](function(_0x53ada9){logger['error'](_0x13c8('0x21'),_0x53ada9['message'],_0x3b8eac);_0x313ea3(_0x37242f['error'](0x1f4,_0x53ada9[_0x13c8('0x17')]));});});};exports[_0x13c8('0x22')]=function(_0x34fdbe){return new Promise(function(_0x560ede,_0x5ef2f7){return db[_0x13c8('0x23')][_0x13c8('0x24')]({'where':_0x34fdbe[_0x13c8('0x1c')]?_0x34fdbe[_0x13c8('0x1c')][_0x13c8('0x1e')]||null:null})[_0x13c8('0xf')](function(_0x343080){if(_0x343080){return _0x343080['addTags'](_0x34fdbe[_0x13c8('0x1b')][_0x13c8('0x25')],_['omit'](_0x34fdbe['body'],[_0x13c8('0x25'),'id'])||{});}})[_0x13c8('0x26')](function(_0x50bb89){logger[_0x13c8('0x10')](_0x13c8('0x27'),_0x34fdbe);logger['debug'](_0x13c8('0x27'),_0x34fdbe,JSON[_0x13c8('0x14')](_0x50bb89));_0x560ede(_0x50bb89);})[_0x13c8('0x19')](function(_0x26a93b){logger[_0x13c8('0x15')](_0x13c8('0x27'),_0x26a93b[_0x13c8('0x17')],_0x34fdbe);_0x5ef2f7(_this[_0x13c8('0x15')](0x1f4,_0x26a93b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 968d522..c777810 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 _0x5d14=['length','./mailInteraction.events','remove','update','removeListener'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x5d14,0xc9));var _0x45d1=function(_0x27380a,_0x11b4db){_0x27380a=_0x27380a-0x0;var _0x49557d=_0x5d14[_0x27380a];return _0x49557d;};'use strict';var MailInteractionEvents=require(_0x45d1('0x0'));var events=['save',_0x45d1('0x1'),_0x45d1('0x2')];function createListener(_0x3db88c,_0x4b1ddd){return function(_0x48c972){_0x4b1ddd['emit'](_0x3db88c,_0x48c972);};}function removeListener(_0x37fa9b,_0x503be1){return function(){MailInteractionEvents[_0x45d1('0x3')](_0x37fa9b,_0x503be1);};}exports['register']=function(_0x52e7c6){for(var _0x472686=0x0,_0x2b4166=events[_0x45d1('0x4')];_0x472686<_0x2b4166;_0x472686++){var _0x39fb24=events[_0x472686];var _0x1434d1=createListener('mailInteraction:'+_0x39fb24,_0x52e7c6);MailInteractionEvents['on'](_0x39fb24,_0x1434d1);}}; \ No newline at end of file +var _0x0f7c=['update','emit','register','length','mailInteraction:','./mailInteraction.events','remove'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0f7c,0xc9));var _0xc0f7=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0f7c[_0x413feb];return _0x40ee88;};'use strict';var MailInteractionEvents=require(_0xc0f7('0x0'));var events=['save',_0xc0f7('0x1'),_0xc0f7('0x2')];function createListener(_0x268a30,_0x10b07e){return function(_0x4c04ee){_0x10b07e[_0xc0f7('0x3')](_0x268a30,_0x4c04ee);};}function removeListener(_0x1ffdd8,_0x3db24e){return function(){MailInteractionEvents['removeListener'](_0x1ffdd8,_0x3db24e);};}exports[_0xc0f7('0x4')]=function(_0x2e44ea){for(var _0x4400e8=0x0,_0x2cb4ef=events[_0xc0f7('0x5')];_0x4400e8<_0x2cb4ef;_0x4400e8++){var _0x13adc8=events[_0x4400e8];var _0x31a811=createListener(_0xc0f7('0x6')+_0x13adc8,_0x2e44ea);MailInteractionEvents['on'](_0x13adc8,_0x31a811);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 3ece1c4..95cb0d5 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 _0xedd9=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x195f64,_0x3480b9){var _0x516d0a=function(_0x3e451e){while(--_0x3e451e){_0x195f64['push'](_0x195f64['shift']());}};_0x516d0a(++_0x3480b9);}(_0xedd9,0xfc));var _0x9edd=function(_0x3978f1,_0x3af5b6){_0x3978f1=_0x3978f1-0x0;var _0x391fa2=_0xedd9[_0x3978f1];return _0x391fa2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./mailMessage.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'mailmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0x9')](),controller['accept']);router[_0x9edd('0x13')](_0x9edd('0x16'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7da7=['./mailMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0xeb80c9,_0x3fe888){var _0x259c37=function(_0x49478c){while(--_0x49478c){_0xeb80c9['push'](_0xeb80c9['shift']());}};_0x259c37(++_0x3fe888);}(_0x7da7,0x10d));var _0x77da=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x7da7[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0xd')]);router['get'](_0x77da('0xe'),auth[_0x77da('0x7')](),controller[_0x77da('0xf')]);router['post']('/',auth[_0x77da('0x7')](),interaction[_0x77da('0x10')](_0x77da('0x11'),_0x77da('0x12')),controller['create']);router[_0x77da('0x13')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller['update']);router['put'](_0x77da('0x14'),auth[_0x77da('0x7')](),controller['accept']);router[_0x77da('0x13')](_0x77da('0x15'),auth[_0x77da('0x7')](),controller[_0x77da('0x16')]);router['delete'](_0x77da('0xc'),auth['isAuthenticated'](),controller[_0x77da('0x17')]);module[_0x77da('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 1cc9c7f..6be99c7 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 _0xaebd=['exports','TEXT','long','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x31fc11,_0x55637f){_0x31fc11=_0x31fc11-0x0;var _0x13c366=_0xaebd[_0x31fc11];return _0x13c366;};'use strict';var Sequelize=require(_0xdaeb('0x0'));var _=require('lodash');module[_0xdaeb('0x1')]={'body':{'type':Sequelize[_0xdaeb('0x2')](_0xdaeb('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xdaeb('0x2')](_0xdaeb('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdaeb('0x5')]('in',_0xdaeb('0x6')),'defaultValue':_0xdaeb('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdaeb('0x7')](0x1fe)},'from':{'type':Sequelize[_0xdaeb('0x7')]},'to':{'type':Sequelize['TEXT'](_0xdaeb('0x3'))},'cc':{'type':Sequelize[_0xdaeb('0x2')]('long')},'bcc':{'type':Sequelize['TEXT'](_0xdaeb('0x3'))},'subject':{'type':Sequelize[_0xdaeb('0x2')]},'sentAt':{'type':Sequelize[_0xdaeb('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdaeb('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xdaeb('0x2')]('long')},'originCc':{'type':Sequelize[_0xdaeb('0x2')]('long')}}; \ No newline at end of file +var _0xb1ef=['out','STRING','DATE','INTEGER','sequelize','lodash','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x23516c,_0x16ea34){var _0x591310=function(_0x428292){while(--_0x428292){_0x23516c['push'](_0x23516c['shift']());}};_0x591310(++_0x16ea34);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xfb1e('0x0'));var _=require(_0xfb1e('0x1'));module['exports']={'body':{'type':Sequelize[_0xfb1e('0x2')](_0xfb1e('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xfb1e('0x2')](_0xfb1e('0x4'))},'read':{'type':Sequelize[_0xfb1e('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb1e('0x6')]('in',_0xfb1e('0x7')),'defaultValue':_0xfb1e('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xfb1e('0x8')]},'to':{'type':Sequelize[_0xfb1e('0x2')](_0xfb1e('0x3'))},'cc':{'type':Sequelize[_0xfb1e('0x2')]('long')},'bcc':{'type':Sequelize['TEXT'](_0xfb1e('0x3'))},'subject':{'type':Sequelize[_0xfb1e('0x2')]},'sentAt':{'type':Sequelize[_0xfb1e('0x9')]},'attach':{'type':Sequelize[_0xfb1e('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfb1e('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xfb1e('0x9')]},'originTo':{'type':Sequelize[_0xfb1e('0x2')](_0xfb1e('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xfb1e('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index b2dfd3d..a0da15a 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 _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','server/files/attachments','SendMail','sendMail','stringify','../../config/logger','mail-interactions','mail','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','accept','EventManager','role','RejectMessage','rejectMessage','rejectmessage','download','unix','server','tmp','root','files','bcc','subject','createdAt','Attachment','Attachments','from','headers','Bcc','readFileSync','writeFileSync','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9003=jayson[_0x0a9e('0x1b')]['http']({'port':0x232b});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x1985b6,_0x519dfd,_0x16033c){if(_0x16033c){var _0x12066b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12066b['test'](_0x519dfd)){return _0x1985b6;}else{throw new db[(_0x0a9e('0x1d'))]['ValidationError'](_0x0a9e('0x1e'));}}else{return _0x1985b6;}}function respondWithRpcPromise(_0x478723,_0x106033,_0x205fd6,_0x31b1ca){return new BPromise(function(_0x2eb11f,_0x530eb7){var _0x20559e=_0x31b1ca||client;return _0x20559e[_0x0a9e('0x1f')](_0x478723,_0x205fd6)[_0x0a9e('0x20')](function(_0x1c696a){logger[_0x0a9e('0x21')]('MailMessage,\x20%s,\x20%s',_0x106033,_0x0a9e('0x22'));logger[_0x0a9e('0x23')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x106033,_0x0a9e('0x22'),JSON['stringify'](_0x1c696a));if(_0x1c696a['error']){if(_0x1c696a[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x26'),_0x106033,_0x1c696a['error'][_0x0a9e('0x27')]);return _0x530eb7(_0x1c696a[_0x0a9e('0x24')][_0x0a9e('0x27')]);}logger[_0x0a9e('0x24')](_0x0a9e('0x26'),_0x106033,_0x1c696a[_0x0a9e('0x24')][_0x0a9e('0x27')]);return _0x2eb11f(_0x1c696a['error']['message']);}else{logger[_0x0a9e('0x21')](_0x0a9e('0x26'),_0x106033,_0x0a9e('0x22'));_0x2eb11f(_0x1c696a[_0x0a9e('0x28')]['message']);}})[_0x0a9e('0x29')](function(_0x479bc4){logger[_0x0a9e('0x24')]('MailMessage,\x20%s,\x20%s',_0x106033,_0x479bc4);_0x530eb7(_0x479bc4);});});}function respondWithStatusCode(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0xcc;return function(_0x25fba9){if(_0x25fba9){return _0x1dc186[_0x0a9e('0x2a')](_0x34dc65);}return _0x1dc186[_0x0a9e('0x2b')](_0x34dc65)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x11c3b6,_0x14de77){_0x14de77=_0x14de77||0xc8;return function(_0x5a101a){if(_0x5a101a){return _0x11c3b6[_0x0a9e('0x2b')](_0x14de77)[_0x0a9e('0x2d')](_0x5a101a);}};}function respondWithFilteredResult(_0x2b1f27,_0x2ec755){return function(_0x5c877d){if(_0x5c877d){var _0x15b200=_0x5c877d[_0x0a9e('0x2e')],_0x40e7a3=_0x2ec755[_0x0a9e('0x2f')],_0x1843b2=_0x2ec755[_0x0a9e('0x2f')]+_0x2ec755[_0x0a9e('0x30')],_0x824a4f;if(_0x1843b2>=_0x15b200){_0x1843b2=_0x15b200;_0x824a4f=0xc8;}else{_0x824a4f=0xce;}_0x2b1f27[_0x0a9e('0x2b')](_0x824a4f);return _0x2b1f27['set'](_0x0a9e('0x31'),_0x40e7a3+'-'+_0x1843b2+'/'+_0x15b200)['json'](_0x5c877d);}return null;};}function patchUpdates(_0x2407f9){return function(_0x3ae878){try{jsonpatch[_0x0a9e('0x32')](_0x3ae878,_0x2407f9,!![]);}catch(_0x33bdb7){return BPromise[_0x0a9e('0x33')](_0x33bdb7);}return _0x3ae878['save']();};}function saveUpdates(_0x66c1d2,_0x46f0a5){return function(_0x40cb85){if(_0x40cb85){return _0x40cb85[_0x0a9e('0x34')](_0x66c1d2)[_0x0a9e('0x20')](function(_0x409319){return _0x409319;});}return null;};}function removeEntity(_0x332d35,_0x39e565){return function(_0x5583a4){if(_0x5583a4){return _0x5583a4[_0x0a9e('0x35')]()['then'](function(){_0x332d35[_0x0a9e('0x2b')](0xcc)[_0x0a9e('0x2c')]();});}};}function handleEntityNotFound(_0x2b7e7f,_0x3f3d41){return function(_0x567193){if(!_0x567193){_0x2b7e7f[_0x0a9e('0x2a')](0x194);}return _0x567193;};}function handleError(_0xd1836d,_0x1fa90d){_0x1fa90d=_0x1fa90d||0x1f4;return function(_0x15de0e){logger['error'](_0x15de0e['stack']);if(_0x15de0e[_0x0a9e('0x36')]){delete _0x15de0e['name'];}_0xd1836d[_0x0a9e('0x2b')](_0x1fa90d)[_0x0a9e('0x37')](_0x15de0e);};}exports[_0x0a9e('0x38')]=function(_0x1ef87a,_0x4f41ae){var _0x31916f={},_0x3bfce8={},_0x3cae={'count':0x0,'rows':[]};var _0x533942=_[_0x0a9e('0x39')](db[_0x0a9e('0x3a')][_0x0a9e('0x3b')],function(_0x4c1c0e){return{'name':_0x4c1c0e['fieldName'],'type':_0x4c1c0e[_0x0a9e('0x3c')][_0x0a9e('0x3d')]};});_0x3bfce8['model']=_[_0x0a9e('0x39')](_0x533942,_0x0a9e('0x36'));_0x3bfce8[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x1ef87a['query']);_0x3bfce8['filters']=_[_0x0a9e('0x40')](_0x3bfce8[_0x0a9e('0x41')],_0x3bfce8['query']);_0x31916f[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x3bfce8[_0x0a9e('0x41')],qs['fields'](_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x43')]));_0x31916f[_0x0a9e('0x42')]=_0x31916f[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x31916f[_0x0a9e('0x42')]:_0x3bfce8[_0x0a9e('0x41')];if(!_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x45')](_0x0a9e('0x46'))){_0x31916f[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x30')]);_0x31916f[_0x0a9e('0x2f')]=qs['offset'](_0x1ef87a['query'][_0x0a9e('0x2f')]);}_0x31916f[_0x0a9e('0x47')]=qs[_0x0a9e('0x48')](_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x48')]);_0x31916f[_0x0a9e('0x49')]=qs[_0x0a9e('0x4a')](_[_0x0a9e('0x4b')](_0x1ef87a[_0x0a9e('0x3e')],_0x3bfce8[_0x0a9e('0x4a')]));if(_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x4c')]){_0x31916f['where']=_[_0x0a9e('0x4d')](_0x31916f[_0x0a9e('0x49')],{'$or':_[_0x0a9e('0x39')](_0x533942,function(_0xfbd5ad){if(_0xfbd5ad[_0x0a9e('0x3c')]!==_0x0a9e('0x4e')){var _0x21eb86={};_0x21eb86[_0xfbd5ad[_0x0a9e('0x36')]]={'$like':'%'+_0x1ef87a['query'][_0x0a9e('0x4c')]+'%'};return _0x21eb86;}})});}_0x31916f=_['merge']({},_0x31916f,_0x1ef87a[_0x0a9e('0x4f')]);var _0x476688={'where':_0x31916f[_0x0a9e('0x49')]};return db['MailMessage'][_0x0a9e('0x2e')](_0x476688)[_0x0a9e('0x20')](function(_0x4774f4){_0x3cae[_0x0a9e('0x2e')]=_0x4774f4;if(_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x50')]){_0x31916f[_0x0a9e('0x51')]=[{'all':!![]}];}return db['MailMessage'][_0x0a9e('0x52')](_0x31916f);})[_0x0a9e('0x20')](function(_0x1b5e80){_0x3cae[_0x0a9e('0x53')]=_0x1b5e80;return _0x3cae;})[_0x0a9e('0x20')](respondWithFilteredResult(_0x4f41ae,_0x31916f))[_0x0a9e('0x29')](handleError(_0x4f41ae,null));};exports[_0x0a9e('0x54')]=function(_0x19383e,_0x34febd){var _0x58a5c2={'raw':!![],'where':{'id':_0x19383e[_0x0a9e('0x55')]['id']}},_0xe401a={};_0xe401a['model']=_['keys'](db['MailMessage'][_0x0a9e('0x3b')]);_0xe401a[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x19383e[_0x0a9e('0x3e')]);_0xe401a[_0x0a9e('0x4a')]=_[_0x0a9e('0x40')](_0xe401a[_0x0a9e('0x41')],_0xe401a[_0x0a9e('0x3e')]);_0x58a5c2['attributes']=_['intersection'](_0xe401a['model'],qs[_0x0a9e('0x43')](_0x19383e[_0x0a9e('0x3e')][_0x0a9e('0x43')]));_0x58a5c2['attributes']=_0x58a5c2[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x58a5c2['attributes']:_0xe401a['model'];if(_0x19383e[_0x0a9e('0x3e')]['includeAll']){_0x58a5c2[_0x0a9e('0x51')]=[{'all':!![]}];}_0x58a5c2=_['merge']({},_0x58a5c2,_0x19383e[_0x0a9e('0x4f')]);return db[_0x0a9e('0x3a')][_0x0a9e('0x56')](_0x58a5c2)['then'](handleEntityNotFound(_0x34febd,null))[_0x0a9e('0x20')](respondWithResult(_0x34febd,null))[_0x0a9e('0x29')](handleError(_0x34febd,null));};exports['update']=function(_0x50f687,_0x128aa6){if(_0x50f687[_0x0a9e('0x57')]['id']){delete _0x50f687['body']['id'];}return db[_0x0a9e('0x3a')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x55')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x20')](saveUpdates(_0x50f687['body'],null))['then'](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x35')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x3a')][_0x0a9e('0x56')]({'where':{'id':_0x47de4c[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x20')](handleEntityNotFound(_0x2f7092,null))[_0x0a9e('0x20')](removeEntity(_0x2f7092,null))[_0x0a9e('0x29')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x58')]=function(_0x4e67ab,_0x1c693e){return db[_0x0a9e('0x3a')][_0x0a9e('0x58')]()[_0x0a9e('0x20')](respondWithResult(_0x1c693e,null))[_0x0a9e('0x29')](handleError(_0x1c693e,null));};exports[_0x0a9e('0x59')]=function(_0x5d86e9,_0x956fbe){return db[_0x0a9e('0x3a')]['create'](_0x5d86e9[_0x0a9e('0x57')])['then'](function(_0x20c668){if(_0x20c668){if(_0x20c668['direction']==='out'&&!_0x20c668['secret']){return db[_0x0a9e('0x5a')]['findOne']({'where':{'id':_0x20c668[_0x0a9e('0x5b')]},'include':[{'model':db[_0x0a9e('0x5c')],'as':_0x0a9e('0x5d'),'raw':!![]}]})[_0x0a9e('0x20')](function(_0x1cca9f){if(_0x1cca9f&&_0x1cca9f[_0x0a9e('0x5d')]){var _0x49eed0={'tls':{'rejectUnauthorized':![]}};if(_[_0x0a9e('0x5e')](_0x1cca9f['Smtp'][_0x0a9e('0x5f')])){_0x49eed0[_0x0a9e('0x60')]=_0x1cca9f[_0x0a9e('0x5d')]['host'];_0x49eed0[_0x0a9e('0x61')]=_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x61')];_0x49eed0[_0x0a9e('0x62')]=_0x1cca9f['Smtp'][_0x0a9e('0x62')];if(_0x1cca9f[_0x0a9e('0x5d')]['authentication']){_0x49eed0[_0x0a9e('0x63')]={'user':_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x64')],'pass':_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x65')]};}}else{_0x49eed0['service']=_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x5f')];_0x49eed0[_0x0a9e('0x63')]={'user':_0x1cca9f['Smtp'][_0x0a9e('0x64')],'pass':_0x1cca9f['Smtp']['pass']};_0x49eed0[_0x0a9e('0x62')]=_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x62')];}if(_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')]&&_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x0a9e('0x44')]){for(var _0x2d7205=0x0;_0x2d7205<_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x0a9e('0x44')];_0x2d7205+=0x1){_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x2d7205]={'filename':_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x2d7205][_0x0a9e('0x36')],'path':path[_0x0a9e('0x67')](config['root'],_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x2d7205]['basename'])};}}return{'account':_0x49eed0,'message':_0x5d86e9[_0x0a9e('0x57')]};}})[_0x0a9e('0x20')](function(_0x4b341d){if(_0x4b341d){return respondWithRpcPromise(_0x0a9e('0x69'),_0x0a9e('0x6a'),_0x4b341d,client9003)[_0x0a9e('0x20')](function(_0x427946){return _0x20c668[_0x0a9e('0x34')]({'read':!![],'messageId':_0x427946['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0a9e('0x29')](function(_0x18bf5d){logger[_0x0a9e('0x24')]('%s',JSON[_0x0a9e('0x6b')](_0x18bf5d));return _0x20c668;});}return _0x20c668;});}return _0x20c668;}})[_0x0a9e('0x20')](respondWithResult(_0x956fbe,0xc9))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x6c'))(_0x0a9e('0x6d'));exports['accept']=function(_0x235f8f,_0xcbc8b2,_0x12ccdb){var _0x4a4fc7={'channel':_0x0a9e('0x6e')};if(_0x235f8f['body']['id']){delete _0x235f8f[_0x0a9e('0x57')]['id'];}_0x235f8f[_0x0a9e('0x57')]['read']=!![];_0x235f8f[_0x0a9e('0x57')][_0x0a9e('0x6f')]=moment()[_0x0a9e('0x70')](_0x0a9e('0x71'));_0x235f8f['body'][_0x0a9e('0x72')]=_0x235f8f[_0x0a9e('0x57')][_0x0a9e('0x72')]||_0x235f8f[_0x0a9e('0x64')]['id'];return db['MailMessage'][_0x0a9e('0x56')]({'where':{'id':_0x235f8f[_0x0a9e('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x73')],'as':_0x0a9e('0x74')}]})['then'](handleEntityNotFound(_0xcbc8b2,null))[_0x0a9e('0x20')](saveUpdates(_0x235f8f[_0x0a9e('0x57')],null))[_0x0a9e('0x20')](function(_0xf410e5){if(_0xf410e5){_0x4a4fc7[_0x0a9e('0x27')]=_0xf410e5[_0x0a9e('0x75')]({'plain':!![]});return db[_0x0a9e('0x76')][_0x0a9e('0x56')]({'where':{'id':_0xf410e5[_0x0a9e('0x77')]}});}return null;})[_0x0a9e('0x20')](handleEntityNotFound(_0xcbc8b2,null))[_0x0a9e('0x20')](function(_0x1f10ef){if(_0x1f10ef){return _0x1f10ef[_0x0a9e('0x34')]({'UserId':_0x235f8f[_0x0a9e('0x57')]['UserId'],'read1stAt':_[_0x0a9e('0x5e')](_0x1f10ef[_0x0a9e('0x78')])?moment()[_0x0a9e('0x70')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x20')](function(_0x33dda0){if(_0x33dda0){_0x4a4fc7[_0x0a9e('0x79')]=_0x33dda0[_0x0a9e('0x75')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x235f8f[_0x0a9e('0x64')]['id'],_0x235f8f[_0x0a9e('0x64')]['name'],_0x235f8f[_0x0a9e('0x64')]['role'],_0x4a4fc7[_0x0a9e('0x79')]['id'],_0x235f8f[_0x0a9e('0x57')]?JSON['stringify'](_0x235f8f[_0x0a9e('0x57')]):_0x0a9e('0x7a'));return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x4a4fc7);}return null;})[_0x0a9e('0x20')](function(_0x1f42a0){if(_0x1f42a0){if(_0x235f8f[_0x0a9e('0x57')]['manual']){_0x4a4fc7[_0x0a9e('0x27')][_0x0a9e('0x7d')]=util[_0x0a9e('0x70')](_0x0a9e('0x7e'),_0x235f8f['user'][_0x0a9e('0x36')]);_0x4a4fc7[_0x0a9e('0x27')]['channel']=_0x4a4fc7[_0x0a9e('0x7f')];_0x4a4fc7['message'][_0x0a9e('0x80')]=_0x0a9e('0x81');return respondWithRpcPromise(_0x0a9e('0x82'),_0x0a9e('0x82'),{'event':'acceptmessage','message':_0x4a4fc7['message']},client9002)[_0x0a9e('0x20')](function(){return _0x4a4fc7;});}return _0x4a4fc7;}return null;})[_0x0a9e('0x20')](respondWithResult(_0xcbc8b2,null))[_0x0a9e('0x29')](handleError(_0xcbc8b2,null));};var interaction_log=require('../../config/logger')(_0x0a9e('0x6d'));exports[_0x0a9e('0x33')]=function(_0x524e38,_0x4e46b2,_0xf0a802){var _0x56acca={'agent':{},'channel':'mail'};if(_0x524e38['body']['id']){delete _0x524e38[_0x0a9e('0x57')]['id'];}_0x524e38[_0x0a9e('0x57')][_0x0a9e('0x72')]=_0x524e38[_0x0a9e('0x57')][_0x0a9e('0x72')]||_0x524e38[_0x0a9e('0x64')]['id'];_0x56acca['agent']['id']=_0x524e38[_0x0a9e('0x57')]['UserId'];return db[_0x0a9e('0x3a')][_0x0a9e('0x56')]({'where':{'id':_0x524e38[_0x0a9e('0x55')]['id'],'UserId':null}})[_0x0a9e('0x20')](handleEntityNotFound(_0x4e46b2,null))['then'](function(_0x46c9ac){if(_0x46c9ac){_0x56acca[_0x0a9e('0x27')]=_0x46c9ac[_0x0a9e('0x75')]({'plain':!![]});return db['MailInteraction'][_0x0a9e('0x56')]({'where':{'id':_0x46c9ac[_0x0a9e('0x77')]}});}return null;})[_0x0a9e('0x20')](handleEntityNotFound(_0x4e46b2,null))[_0x0a9e('0x20')](function(_0x255e49){if(_0x255e49){_0x56acca[_0x0a9e('0x79')]=_0x255e49[_0x0a9e('0x75')]({'plain':!![]});interaction_log[_0x0a9e('0x21')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x524e38[_0x0a9e('0x64')]['id'],_0x524e38[_0x0a9e('0x64')]['name'],_0x524e38[_0x0a9e('0x64')][_0x0a9e('0x83')],_0x56acca[_0x0a9e('0x79')]['id'],_0x524e38['body']?JSON[_0x0a9e('0x6b')](_0x524e38['body']):_0x0a9e('0x7a'));return respondWithRpcPromise(_0x0a9e('0x84'),_0x0a9e('0x85'),_0x56acca);}return null;})[_0x0a9e('0x20')](function(_0x842d6f){if(_0x842d6f){_0x842d6f[_0x0a9e('0x27')][_0x0a9e('0x7d')]=util[_0x0a9e('0x70')]('SIP/%s',_0x524e38[_0x0a9e('0x64')][_0x0a9e('0x36')]);_0x842d6f[_0x0a9e('0x27')][_0x0a9e('0x7f')]=_0x56acca[_0x0a9e('0x7f')];_0x842d6f[_0x0a9e('0x27')][_0x0a9e('0x80')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x82'),_0x0a9e('0x82'),{'event':_0x0a9e('0x86'),'message':_0x842d6f[_0x0a9e('0x27')]},client9002);return _0x56acca;}return null;})[_0x0a9e('0x20')](respondWithResult(_0x4e46b2,null))['catch'](handleError(_0x4e46b2,null));};exports[_0x0a9e('0x87')]=function(_0x23e2bd,_0x12843d){var _0x2ed526=moment()[_0x0a9e('0x88')]()['toString']();var _0x3afc8c=path[_0x0a9e('0x67')](config['root'],_0x0a9e('0x89'),'files',_0x0a9e('0x8a'));var _0x27041d=path[_0x0a9e('0x67')](config[_0x0a9e('0x8b')],'server',_0x0a9e('0x8c'),'attachments');var _0x2ec396=util[_0x0a9e('0x70')]('message-%s.eml',_0x2ed526);return db[_0x0a9e('0x3a')][_0x0a9e('0x56')]({'where':{'id':_0x23e2bd[_0x0a9e('0x55')]['id']},'attributes':['id','body','from','to','cc',_0x0a9e('0x8d'),_0x0a9e('0x8e'),_0x0a9e('0x8f')],'include':_0x23e2bd[_0x0a9e('0x3e')][_0x0a9e('0x66')]?[{'model':db[_0x0a9e('0x90')],'as':_0x0a9e('0x91')}]:undefined})[_0x0a9e('0x20')](handleEntityNotFound(_0x12843d,null))[_0x0a9e('0x20')](function(_0x586510){if(_0x586510){var _0x3156c7=_0x586510;var _0x517081={'from':_0x3156c7[_0x0a9e('0x92')],'to':_0x3156c7['to'],'subject':_0x3156c7[_0x0a9e('0x8e')],'html':_0x3156c7[_0x0a9e('0x57')],'headers':{'Date':moment(_0x3156c7[_0x0a9e('0x8f')])[_0x0a9e('0x70')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x586510['cc']){_0x517081[_0x0a9e('0x93')]['Cc']=_0x586510['cc'];}if(_0x586510[_0x0a9e('0x8d')]){_0x517081[_0x0a9e('0x93')][_0x0a9e('0x94')]=_0x586510[_0x0a9e('0x8d')];}return new BPromise(function(_0x5c66ef,_0x4f074c){if(_0x586510[_0x0a9e('0x91')]){for(var _0x583662=0x0;_0x583662<_0x586510[_0x0a9e('0x91')][_0x0a9e('0x44')];_0x583662++){var _0x4672e1=_0x586510[_0x0a9e('0x91')][_0x583662];var _0x2ad54b=path[_0x0a9e('0x67')](_0x27041d,_0x4672e1['basename']);if(fs['existsSync'](_0x2ad54b)){_0x517081[_0x0a9e('0x66')]['push']({'name':_0x4672e1[_0x0a9e('0x36')],'contentType':_0x4672e1['type'],'data':fs[_0x0a9e('0x95')](_0x2ad54b)});}}}emlformat['build'](_0x517081,function(_0x558d60,_0x1c49dc){if(_0x558d60)return _0x4f074c(_0x558d60);fs[_0x0a9e('0x96')](path['join'](_0x3afc8c,_0x2ec396),_0x1c49dc);return _0x5c66ef(_0x1c49dc);});});}})[_0x0a9e('0x20')](function(_0x17cb30){if(_0x17cb30){return _0x12843d[_0x0a9e('0x87')](path[_0x0a9e('0x67')](_0x3afc8c,_0x2ec396),_0x2ec396,function(_0x2eb028){if(_0x2eb028){console['log']('err',_0x2eb028);}else{fs[_0x0a9e('0x97')](path[_0x0a9e('0x67')](_0x3afc8c,_0x2ec396));}});}})[_0x0a9e('0x29')](handleError(_0x12843d,null));}; \ No newline at end of file +var _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','server/files/attachments','SendMail','sendMail','stringify','../../config/logger','mail-interactions','mail','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','accept','EventManager','role','RejectMessage','rejectMessage','rejectmessage','download','unix','server','tmp','root','files','bcc','subject','createdAt','Attachment','Attachments','from','headers','Bcc','readFileSync','writeFileSync','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9003=jayson[_0x0a9e('0x1b')]['http']({'port':0x232b});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x1985b6,_0x519dfd,_0x16033c){if(_0x16033c){var _0x12066b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12066b['test'](_0x519dfd)){return _0x1985b6;}else{throw new db[(_0x0a9e('0x1d'))]['ValidationError'](_0x0a9e('0x1e'));}}else{return _0x1985b6;}}function respondWithRpcPromise(_0x478723,_0x106033,_0x205fd6,_0x31b1ca){return new BPromise(function(_0x2eb11f,_0x530eb7){var _0x20559e=_0x31b1ca||client;return _0x20559e[_0x0a9e('0x1f')](_0x478723,_0x205fd6)[_0x0a9e('0x20')](function(_0x1c696a){logger[_0x0a9e('0x21')]('MailMessage,\x20%s,\x20%s',_0x106033,_0x0a9e('0x22'));logger[_0x0a9e('0x23')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x106033,_0x0a9e('0x22'),JSON['stringify'](_0x1c696a));if(_0x1c696a['error']){if(_0x1c696a[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x26'),_0x106033,_0x1c696a['error'][_0x0a9e('0x27')]);return _0x530eb7(_0x1c696a[_0x0a9e('0x24')][_0x0a9e('0x27')]);}logger[_0x0a9e('0x24')](_0x0a9e('0x26'),_0x106033,_0x1c696a[_0x0a9e('0x24')][_0x0a9e('0x27')]);return _0x2eb11f(_0x1c696a['error']['message']);}else{logger[_0x0a9e('0x21')](_0x0a9e('0x26'),_0x106033,_0x0a9e('0x22'));_0x2eb11f(_0x1c696a[_0x0a9e('0x28')]['message']);}})[_0x0a9e('0x29')](function(_0x479bc4){logger[_0x0a9e('0x24')]('MailMessage,\x20%s,\x20%s',_0x106033,_0x479bc4);_0x530eb7(_0x479bc4);});});}function respondWithStatusCode(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0xcc;return function(_0x25fba9){if(_0x25fba9){return _0x1dc186[_0x0a9e('0x2a')](_0x34dc65);}return _0x1dc186[_0x0a9e('0x2b')](_0x34dc65)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x11c3b6,_0x14de77){_0x14de77=_0x14de77||0xc8;return function(_0x5a101a){if(_0x5a101a){return _0x11c3b6[_0x0a9e('0x2b')](_0x14de77)[_0x0a9e('0x2d')](_0x5a101a);}};}function respondWithFilteredResult(_0x2b1f27,_0x2ec755){return function(_0x5c877d){if(_0x5c877d){var _0x15b200=_0x5c877d[_0x0a9e('0x2e')],_0x40e7a3=_0x2ec755[_0x0a9e('0x2f')],_0x1843b2=_0x2ec755[_0x0a9e('0x2f')]+_0x2ec755[_0x0a9e('0x30')],_0x824a4f;if(_0x1843b2>=_0x15b200){_0x1843b2=_0x15b200;_0x824a4f=0xc8;}else{_0x824a4f=0xce;}_0x2b1f27[_0x0a9e('0x2b')](_0x824a4f);return _0x2b1f27['set'](_0x0a9e('0x31'),_0x40e7a3+'-'+_0x1843b2+'/'+_0x15b200)['json'](_0x5c877d);}return null;};}function patchUpdates(_0x2407f9){return function(_0x3ae878){try{jsonpatch[_0x0a9e('0x32')](_0x3ae878,_0x2407f9,!![]);}catch(_0x33bdb7){return BPromise[_0x0a9e('0x33')](_0x33bdb7);}return _0x3ae878['save']();};}function saveUpdates(_0x66c1d2,_0x46f0a5){return function(_0x40cb85){if(_0x40cb85){return _0x40cb85[_0x0a9e('0x34')](_0x66c1d2)[_0x0a9e('0x20')](function(_0x409319){return _0x409319;});}return null;};}function removeEntity(_0x332d35,_0x39e565){return function(_0x5583a4){if(_0x5583a4){return _0x5583a4[_0x0a9e('0x35')]()['then'](function(){_0x332d35[_0x0a9e('0x2b')](0xcc)[_0x0a9e('0x2c')]();});}};}function handleEntityNotFound(_0x2b7e7f,_0x3f3d41){return function(_0x567193){if(!_0x567193){_0x2b7e7f[_0x0a9e('0x2a')](0x194);}return _0x567193;};}function handleError(_0xd1836d,_0x1fa90d){_0x1fa90d=_0x1fa90d||0x1f4;return function(_0x15de0e){logger['error'](_0x15de0e['stack']);if(_0x15de0e[_0x0a9e('0x36')]){delete _0x15de0e['name'];}_0xd1836d[_0x0a9e('0x2b')](_0x1fa90d)[_0x0a9e('0x37')](_0x15de0e);};}exports[_0x0a9e('0x38')]=function(_0x1ef87a,_0x4f41ae){var _0x31916f={},_0x3bfce8={},_0x3cae={'count':0x0,'rows':[]};var _0x533942=_[_0x0a9e('0x39')](db[_0x0a9e('0x3a')][_0x0a9e('0x3b')],function(_0x4c1c0e){return{'name':_0x4c1c0e['fieldName'],'type':_0x4c1c0e[_0x0a9e('0x3c')][_0x0a9e('0x3d')]};});_0x3bfce8['model']=_[_0x0a9e('0x39')](_0x533942,_0x0a9e('0x36'));_0x3bfce8[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x1ef87a['query']);_0x3bfce8['filters']=_[_0x0a9e('0x40')](_0x3bfce8[_0x0a9e('0x41')],_0x3bfce8['query']);_0x31916f[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x3bfce8[_0x0a9e('0x41')],qs['fields'](_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x43')]));_0x31916f[_0x0a9e('0x42')]=_0x31916f[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x31916f[_0x0a9e('0x42')]:_0x3bfce8[_0x0a9e('0x41')];if(!_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x45')](_0x0a9e('0x46'))){_0x31916f[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x30')]);_0x31916f[_0x0a9e('0x2f')]=qs['offset'](_0x1ef87a['query'][_0x0a9e('0x2f')]);}_0x31916f[_0x0a9e('0x47')]=qs[_0x0a9e('0x48')](_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x48')]);_0x31916f[_0x0a9e('0x49')]=qs[_0x0a9e('0x4a')](_[_0x0a9e('0x4b')](_0x1ef87a[_0x0a9e('0x3e')],_0x3bfce8[_0x0a9e('0x4a')]));if(_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x4c')]){_0x31916f['where']=_[_0x0a9e('0x4d')](_0x31916f[_0x0a9e('0x49')],{'$or':_[_0x0a9e('0x39')](_0x533942,function(_0xfbd5ad){if(_0xfbd5ad[_0x0a9e('0x3c')]!==_0x0a9e('0x4e')){var _0x21eb86={};_0x21eb86[_0xfbd5ad[_0x0a9e('0x36')]]={'$like':'%'+_0x1ef87a['query'][_0x0a9e('0x4c')]+'%'};return _0x21eb86;}})});}_0x31916f=_['merge']({},_0x31916f,_0x1ef87a[_0x0a9e('0x4f')]);var _0x476688={'where':_0x31916f[_0x0a9e('0x49')]};return db['MailMessage'][_0x0a9e('0x2e')](_0x476688)[_0x0a9e('0x20')](function(_0x4774f4){_0x3cae[_0x0a9e('0x2e')]=_0x4774f4;if(_0x1ef87a[_0x0a9e('0x3e')][_0x0a9e('0x50')]){_0x31916f[_0x0a9e('0x51')]=[{'all':!![]}];}return db['MailMessage'][_0x0a9e('0x52')](_0x31916f);})[_0x0a9e('0x20')](function(_0x1b5e80){_0x3cae[_0x0a9e('0x53')]=_0x1b5e80;return _0x3cae;})[_0x0a9e('0x20')](respondWithFilteredResult(_0x4f41ae,_0x31916f))[_0x0a9e('0x29')](handleError(_0x4f41ae,null));};exports[_0x0a9e('0x54')]=function(_0x19383e,_0x34febd){var _0x58a5c2={'raw':!![],'where':{'id':_0x19383e[_0x0a9e('0x55')]['id']}},_0xe401a={};_0xe401a['model']=_['keys'](db['MailMessage'][_0x0a9e('0x3b')]);_0xe401a[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x19383e[_0x0a9e('0x3e')]);_0xe401a[_0x0a9e('0x4a')]=_[_0x0a9e('0x40')](_0xe401a[_0x0a9e('0x41')],_0xe401a[_0x0a9e('0x3e')]);_0x58a5c2['attributes']=_['intersection'](_0xe401a['model'],qs[_0x0a9e('0x43')](_0x19383e[_0x0a9e('0x3e')][_0x0a9e('0x43')]));_0x58a5c2['attributes']=_0x58a5c2[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x58a5c2['attributes']:_0xe401a['model'];if(_0x19383e[_0x0a9e('0x3e')]['includeAll']){_0x58a5c2[_0x0a9e('0x51')]=[{'all':!![]}];}_0x58a5c2=_['merge']({},_0x58a5c2,_0x19383e[_0x0a9e('0x4f')]);return db[_0x0a9e('0x3a')][_0x0a9e('0x56')](_0x58a5c2)['then'](handleEntityNotFound(_0x34febd,null))[_0x0a9e('0x20')](respondWithResult(_0x34febd,null))[_0x0a9e('0x29')](handleError(_0x34febd,null));};exports['update']=function(_0x50f687,_0x128aa6){if(_0x50f687[_0x0a9e('0x57')]['id']){delete _0x50f687['body']['id'];}return db[_0x0a9e('0x3a')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x55')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x20')](saveUpdates(_0x50f687['body'],null))['then'](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x35')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x3a')][_0x0a9e('0x56')]({'where':{'id':_0x47de4c[_0x0a9e('0x55')]['id']}})[_0x0a9e('0x20')](handleEntityNotFound(_0x2f7092,null))[_0x0a9e('0x20')](removeEntity(_0x2f7092,null))[_0x0a9e('0x29')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x58')]=function(_0x4e67ab,_0x1c693e){return db[_0x0a9e('0x3a')][_0x0a9e('0x58')]()[_0x0a9e('0x20')](respondWithResult(_0x1c693e,null))[_0x0a9e('0x29')](handleError(_0x1c693e,null));};exports[_0x0a9e('0x59')]=function(_0x5d86e9,_0x956fbe){return db[_0x0a9e('0x3a')]['create'](_0x5d86e9[_0x0a9e('0x57')])['then'](function(_0x20c668){if(_0x20c668){if(_0x20c668['direction']==='out'&&!_0x20c668['secret']){return db[_0x0a9e('0x5a')]['findOne']({'where':{'id':_0x20c668[_0x0a9e('0x5b')]},'include':[{'model':db[_0x0a9e('0x5c')],'as':_0x0a9e('0x5d'),'raw':!![]}]})[_0x0a9e('0x20')](function(_0x1cca9f){if(_0x1cca9f&&_0x1cca9f[_0x0a9e('0x5d')]){var _0x49eed0={'tls':{'rejectUnauthorized':![]}};if(_[_0x0a9e('0x5e')](_0x1cca9f['Smtp'][_0x0a9e('0x5f')])){_0x49eed0[_0x0a9e('0x60')]=_0x1cca9f[_0x0a9e('0x5d')]['host'];_0x49eed0[_0x0a9e('0x61')]=_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x61')];_0x49eed0[_0x0a9e('0x62')]=_0x1cca9f['Smtp'][_0x0a9e('0x62')];if(_0x1cca9f[_0x0a9e('0x5d')]['authentication']){_0x49eed0[_0x0a9e('0x63')]={'user':_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x64')],'pass':_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x65')]};}}else{_0x49eed0['service']=_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x5f')];_0x49eed0[_0x0a9e('0x63')]={'user':_0x1cca9f['Smtp'][_0x0a9e('0x64')],'pass':_0x1cca9f['Smtp']['pass']};_0x49eed0[_0x0a9e('0x62')]=_0x1cca9f[_0x0a9e('0x5d')][_0x0a9e('0x62')];}if(_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')]&&_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x0a9e('0x44')]){for(var _0x2d7205=0x0;_0x2d7205<_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x0a9e('0x44')];_0x2d7205+=0x1){_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x2d7205]={'filename':_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x2d7205][_0x0a9e('0x36')],'path':path[_0x0a9e('0x67')](config['root'],_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x57')][_0x0a9e('0x66')][_0x2d7205]['basename'])};}}return{'account':_0x49eed0,'message':_0x5d86e9[_0x0a9e('0x57')]};}})[_0x0a9e('0x20')](function(_0x4b341d){if(_0x4b341d){return respondWithRpcPromise(_0x0a9e('0x69'),_0x0a9e('0x6a'),_0x4b341d,client9003)[_0x0a9e('0x20')](function(_0x427946){return _0x20c668[_0x0a9e('0x34')]({'read':!![],'messageId':_0x427946['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0a9e('0x29')](function(_0x18bf5d){logger[_0x0a9e('0x24')]('%s',JSON[_0x0a9e('0x6b')](_0x18bf5d));return _0x20c668;});}return _0x20c668;});}return _0x20c668;}})[_0x0a9e('0x20')](respondWithResult(_0x956fbe,0xc9))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x6c'))(_0x0a9e('0x6d'));exports['accept']=function(_0x235f8f,_0xcbc8b2,_0x12ccdb){var _0x4a4fc7={'channel':_0x0a9e('0x6e')};if(_0x235f8f['body']['id']){delete _0x235f8f[_0x0a9e('0x57')]['id'];}_0x235f8f[_0x0a9e('0x57')]['read']=!![];_0x235f8f[_0x0a9e('0x57')][_0x0a9e('0x6f')]=moment()[_0x0a9e('0x70')](_0x0a9e('0x71'));_0x235f8f['body'][_0x0a9e('0x72')]=_0x235f8f[_0x0a9e('0x57')][_0x0a9e('0x72')]||_0x235f8f[_0x0a9e('0x64')]['id'];return db['MailMessage'][_0x0a9e('0x56')]({'where':{'id':_0x235f8f[_0x0a9e('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x73')],'as':_0x0a9e('0x74')}]})['then'](handleEntityNotFound(_0xcbc8b2,null))[_0x0a9e('0x20')](saveUpdates(_0x235f8f[_0x0a9e('0x57')],null))[_0x0a9e('0x20')](function(_0xf410e5){if(_0xf410e5){_0x4a4fc7[_0x0a9e('0x27')]=_0xf410e5[_0x0a9e('0x75')]({'plain':!![]});return db[_0x0a9e('0x76')][_0x0a9e('0x56')]({'where':{'id':_0xf410e5[_0x0a9e('0x77')]}});}return null;})[_0x0a9e('0x20')](handleEntityNotFound(_0xcbc8b2,null))[_0x0a9e('0x20')](function(_0x1f10ef){if(_0x1f10ef){return _0x1f10ef[_0x0a9e('0x34')]({'UserId':_0x235f8f[_0x0a9e('0x57')]['UserId'],'read1stAt':_[_0x0a9e('0x5e')](_0x1f10ef[_0x0a9e('0x78')])?moment()[_0x0a9e('0x70')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x20')](function(_0x33dda0){if(_0x33dda0){_0x4a4fc7[_0x0a9e('0x79')]=_0x33dda0[_0x0a9e('0x75')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x235f8f[_0x0a9e('0x64')]['id'],_0x235f8f[_0x0a9e('0x64')]['name'],_0x235f8f[_0x0a9e('0x64')]['role'],_0x4a4fc7[_0x0a9e('0x79')]['id'],_0x235f8f[_0x0a9e('0x57')]?JSON['stringify'](_0x235f8f[_0x0a9e('0x57')]):_0x0a9e('0x7a'));return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x4a4fc7);}return null;})[_0x0a9e('0x20')](function(_0x1f42a0){if(_0x1f42a0){if(_0x235f8f[_0x0a9e('0x57')]['manual']){_0x4a4fc7[_0x0a9e('0x27')][_0x0a9e('0x7d')]=util[_0x0a9e('0x70')](_0x0a9e('0x7e'),_0x235f8f['user'][_0x0a9e('0x36')]);_0x4a4fc7[_0x0a9e('0x27')]['channel']=_0x4a4fc7[_0x0a9e('0x7f')];_0x4a4fc7['message'][_0x0a9e('0x80')]=_0x0a9e('0x81');return respondWithRpcPromise(_0x0a9e('0x82'),_0x0a9e('0x82'),{'event':'acceptmessage','message':_0x4a4fc7['message']},client9002)[_0x0a9e('0x20')](function(){return _0x4a4fc7;});}return _0x4a4fc7;}return null;})[_0x0a9e('0x20')](respondWithResult(_0xcbc8b2,null))[_0x0a9e('0x29')](handleError(_0xcbc8b2,null));};var interaction_log=require('../../config/logger')(_0x0a9e('0x6d'));exports[_0x0a9e('0x33')]=function(_0x524e38,_0x4e46b2,_0xf0a802){var _0x56acca={'agent':{},'channel':'mail'};if(_0x524e38['body']['id']){delete _0x524e38[_0x0a9e('0x57')]['id'];}_0x524e38[_0x0a9e('0x57')][_0x0a9e('0x72')]=_0x524e38[_0x0a9e('0x57')][_0x0a9e('0x72')]||_0x524e38[_0x0a9e('0x64')]['id'];_0x56acca['agent']['id']=_0x524e38[_0x0a9e('0x57')]['UserId'];return db[_0x0a9e('0x3a')][_0x0a9e('0x56')]({'where':{'id':_0x524e38[_0x0a9e('0x55')]['id'],'UserId':null}})[_0x0a9e('0x20')](handleEntityNotFound(_0x4e46b2,null))['then'](function(_0x46c9ac){if(_0x46c9ac){_0x56acca[_0x0a9e('0x27')]=_0x46c9ac[_0x0a9e('0x75')]({'plain':!![]});return db['MailInteraction'][_0x0a9e('0x56')]({'where':{'id':_0x46c9ac[_0x0a9e('0x77')]}});}return null;})[_0x0a9e('0x20')](handleEntityNotFound(_0x4e46b2,null))[_0x0a9e('0x20')](function(_0x255e49){if(_0x255e49){_0x56acca[_0x0a9e('0x79')]=_0x255e49[_0x0a9e('0x75')]({'plain':!![]});interaction_log[_0x0a9e('0x21')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x524e38[_0x0a9e('0x64')]['id'],_0x524e38[_0x0a9e('0x64')]['name'],_0x524e38[_0x0a9e('0x64')][_0x0a9e('0x83')],_0x56acca[_0x0a9e('0x79')]['id'],_0x524e38['body']?JSON[_0x0a9e('0x6b')](_0x524e38['body']):_0x0a9e('0x7a'));return respondWithRpcPromise(_0x0a9e('0x84'),_0x0a9e('0x85'),_0x56acca);}return null;})[_0x0a9e('0x20')](function(_0x842d6f){if(_0x842d6f){_0x842d6f[_0x0a9e('0x27')][_0x0a9e('0x7d')]=util[_0x0a9e('0x70')]('SIP/%s',_0x524e38[_0x0a9e('0x64')][_0x0a9e('0x36')]);_0x842d6f[_0x0a9e('0x27')][_0x0a9e('0x7f')]=_0x56acca[_0x0a9e('0x7f')];_0x842d6f[_0x0a9e('0x27')][_0x0a9e('0x80')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x82'),_0x0a9e('0x82'),{'event':_0x0a9e('0x86'),'message':_0x842d6f[_0x0a9e('0x27')]},client9002);return _0x56acca;}return null;})[_0x0a9e('0x20')](respondWithResult(_0x4e46b2,null))['catch'](handleError(_0x4e46b2,null));};exports[_0x0a9e('0x87')]=function(_0x23e2bd,_0x12843d){var _0x2ed526=moment()[_0x0a9e('0x88')]()['toString']();var _0x3afc8c=path[_0x0a9e('0x67')](config['root'],_0x0a9e('0x89'),'files',_0x0a9e('0x8a'));var _0x27041d=path[_0x0a9e('0x67')](config[_0x0a9e('0x8b')],'server',_0x0a9e('0x8c'),'attachments');var _0x2ec396=util[_0x0a9e('0x70')]('message-%s.eml',_0x2ed526);return db[_0x0a9e('0x3a')][_0x0a9e('0x56')]({'where':{'id':_0x23e2bd[_0x0a9e('0x55')]['id']},'attributes':['id','body','from','to','cc',_0x0a9e('0x8d'),_0x0a9e('0x8e'),_0x0a9e('0x8f')],'include':_0x23e2bd[_0x0a9e('0x3e')][_0x0a9e('0x66')]?[{'model':db[_0x0a9e('0x90')],'as':_0x0a9e('0x91')}]:undefined})[_0x0a9e('0x20')](handleEntityNotFound(_0x12843d,null))[_0x0a9e('0x20')](function(_0x586510){if(_0x586510){var _0x3156c7=_0x586510;var _0x517081={'from':_0x3156c7[_0x0a9e('0x92')],'to':_0x3156c7['to'],'subject':_0x3156c7[_0x0a9e('0x8e')],'html':_0x3156c7[_0x0a9e('0x57')],'headers':{'Date':moment(_0x3156c7[_0x0a9e('0x8f')])[_0x0a9e('0x70')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x586510['cc']){_0x517081[_0x0a9e('0x93')]['Cc']=_0x586510['cc'];}if(_0x586510[_0x0a9e('0x8d')]){_0x517081[_0x0a9e('0x93')][_0x0a9e('0x94')]=_0x586510[_0x0a9e('0x8d')];}return new BPromise(function(_0x5c66ef,_0x4f074c){if(_0x586510[_0x0a9e('0x91')]){for(var _0x583662=0x0;_0x583662<_0x586510[_0x0a9e('0x91')][_0x0a9e('0x44')];_0x583662++){var _0x4672e1=_0x586510[_0x0a9e('0x91')][_0x583662];var _0x2ad54b=path[_0x0a9e('0x67')](_0x27041d,_0x4672e1['basename']);if(fs['existsSync'](_0x2ad54b)){_0x517081[_0x0a9e('0x66')]['push']({'name':_0x4672e1[_0x0a9e('0x36')],'contentType':_0x4672e1['type'],'data':fs[_0x0a9e('0x95')](_0x2ad54b)});}}}emlformat['build'](_0x517081,function(_0x558d60,_0x1c49dc){if(_0x558d60)return _0x4f074c(_0x558d60);fs[_0x0a9e('0x96')](path['join'](_0x3afc8c,_0x2ec396),_0x1c49dc);return _0x5c66ef(_0x1c49dc);});});}})[_0x0a9e('0x20')](function(_0x17cb30){if(_0x17cb30){return _0x12843d[_0x0a9e('0x87')](path[_0x0a9e('0x67')](_0x3afc8c,_0x2ec396),_0x2ec396,function(_0x2eb028){if(_0x2eb028){console['log']('err',_0x2eb028);}else{fs[_0x0a9e('0x97')](path[_0x0a9e('0x67')](_0x3afc8c,_0x2ec396));}});}})[_0x0a9e('0x29')](handleError(_0x12843d,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 63c57d7..bc78444 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 _0xfb7e=['exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xfb7e,0x135));var _0xefb7=function(_0x101101,_0x50ace5){_0x101101=_0x101101-0x0;var _0x4003f7=_0xfb7e[_0x101101];return _0x4003f7;};'use strict';var EventEmitter=require(_0xefb7('0x0'));var MailMessage=require(_0xefb7('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xefb7('0x2')](0x0);var events={'afterCreate':_0xefb7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2a961d){return function(_0x54a9d7,_0x39d525,_0xec6a63){MailMessageEvents[_0xefb7('0x4')](_0x2a961d+':'+_0x54a9d7['id'],_0x54a9d7);MailMessageEvents['emit'](_0x2a961d,_0x54a9d7);_0xec6a63(null);};}for(var e in events){if(events[_0xefb7('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xefb7('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x582c=['emit','hook','events','../../mysqldb','MailMessage','setMaxListeners','update','remove'];(function(_0x28c30b,_0x17014b){var _0x53df41=function(_0x414d6d){while(--_0x414d6d){_0x28c30b['push'](_0x28c30b['shift']());}};_0x53df41(++_0x17014b);}(_0x582c,0x1c2));var _0xc582=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x582c[_0xc20f22];return _0x1535d5;};'use strict';var EventEmitter=require(_0xc582('0x0'));var MailMessage=require(_0xc582('0x1'))['db'][_0xc582('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc582('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc582('0x4'),'afterDestroy':_0xc582('0x5')};function emitEvent(_0xe80d38){return function(_0x4ec903,_0x5b8810,_0xf612e0){MailMessageEvents[_0xc582('0x6')](_0xe80d38+':'+_0x4ec903['id'],_0x4ec903);MailMessageEvents['emit'](_0xe80d38,_0x4ec903);_0xf612e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xc582('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 1d12602..daa6718 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 _0x9fe2=['exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','direction','toLowerCase','out','secret','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x9fe2,0x10d));var _0x29fe=function(_0x4e534b,_0x388f88){_0x4e534b=_0x4e534b-0x0;var _0x4fa1b7=_0x9fe2[_0x4e534b];return _0x4fa1b7;};'use strict';var _=require(_0x29fe('0x0'));var util=require(_0x29fe('0x1'));var logger=require(_0x29fe('0x2'))(_0x29fe('0x3'));var moment=require(_0x29fe('0x4'));var BPromise=require(_0x29fe('0x5'));var rp=require('request-promise');var htmlToText=require(_0x29fe('0x6'));var fs=require('fs');var path=require(_0x29fe('0x7'));var rimraf=require(_0x29fe('0x8'));var config=require(_0x29fe('0x9'));var attributes=require(_0x29fe('0xa'));module[_0x29fe('0xb')]=function(_0x1865aa,_0x259d4b){return _0x1865aa[_0x29fe('0xc')](_0x29fe('0xd'),attributes,{'tableName':_0x29fe('0xe'),'paranoid':![],'indexes':[{'name':_0x29fe('0xf'),'fields':['messageId']},{'name':_0x29fe('0x10'),'fields':[_0x29fe('0x11'),_0x29fe('0x12')],'type':_0x29fe('0x13')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e075f,_0x39fbe1,_0x1c6cab){if(_0x2e075f[_0x29fe('0x14')]){_0x2e075f[_0x29fe('0x11')]=htmlToText[_0x29fe('0x15')](_0x2e075f[_0x29fe('0x14')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1c6cab(null,_0x39fbe1);},'afterCreate':function(_0x5afe7e,_0x39b466,_0x40e56d){var _0x5a72a2=_0x1865aa['models'];var _0x3f738c=_0x5afe7e['get']({'plain':!![]});if(_0x3f738c[_0x29fe('0x16')][_0x29fe('0x17')]()==='in'||_0x3f738c[_0x29fe('0x16')][_0x29fe('0x17')]()===_0x29fe('0x18')&&!_0x3f738c[_0x29fe('0x19')]&&!_['isNil'](_0x3f738c['UserId'])){_0x5a72a2[_0x29fe('0x1a')][_0x29fe('0x1b')]({'where':{'id':_0x3f738c[_0x29fe('0x1c')]}})[_0x29fe('0x1d')](function(_0x479498){if(_0x479498){_0x479498[_0x29fe('0x1e')]({'lastMsgAt':_0x3f738c[_0x29fe('0x1f')],'lastMsgDirection':_0x3f738c[_0x29fe('0x16')][_0x29fe('0x17')](),'lastMsgBody':_0x3f738c['body']});}})['catch'](function(_0x589200){console[_0x29fe('0x20')](_0x589200);});}_0x40e56d();}},'charset':_0x29fe('0x21'),'collate':_0x29fe('0x22')});}; \ No newline at end of file +var _0x0b96=['../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','update','direction','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','html-to-text','path','rimraf'];(function(_0x733247,_0x52d2d3){var _0x25bd71=function(_0x14e15d){while(--_0x14e15d){_0x733247['push'](_0x733247['shift']());}};_0x25bd71(++_0x52d2d3);}(_0x0b96,0x12f));var _0x60b9=function(_0x46b0ba,_0x5a767c){_0x46b0ba=_0x46b0ba-0x0;var _0x2e53e0=_0x0b96[_0x46b0ba];return _0x2e53e0;};'use strict';var _=require(_0x60b9('0x0'));var util=require(_0x60b9('0x1'));var logger=require(_0x60b9('0x2'))(_0x60b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x60b9('0x4'));var fs=require('fs');var path=require(_0x60b9('0x5'));var rimraf=require(_0x60b9('0x6'));var config=require(_0x60b9('0x7'));var attributes=require(_0x60b9('0x8'));module[_0x60b9('0x9')]=function(_0x44aab6,_0x1b1d25){return _0x44aab6['define'](_0x60b9('0xa'),attributes,{'tableName':_0x60b9('0xb'),'paranoid':![],'indexes':[{'name':_0x60b9('0xc'),'fields':[_0x60b9('0xc')]},{'name':_0x60b9('0xd'),'fields':[_0x60b9('0xe'),_0x60b9('0xf')],'type':_0x60b9('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40e69f,_0x59fea5,_0x3793ae){if(_0x40e69f[_0x60b9('0x11')]){_0x40e69f['plainBody']=htmlToText[_0x60b9('0x12')](_0x40e69f['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3793ae(null,_0x59fea5);},'afterCreate':function(_0x2f90e4,_0x12fd34,_0x3f0297){var _0x5b0502=_0x44aab6['models'];var _0x1af546=_0x2f90e4[_0x60b9('0x13')]({'plain':!![]});if(_0x1af546['direction'][_0x60b9('0x14')]()==='in'||_0x1af546['direction'][_0x60b9('0x14')]()===_0x60b9('0x15')&&!_0x1af546[_0x60b9('0x16')]&&!_[_0x60b9('0x17')](_0x1af546['UserId'])){_0x5b0502[_0x60b9('0x18')]['findOne']({'where':{'id':_0x1af546[_0x60b9('0x19')]}})[_0x60b9('0x1a')](function(_0x1c8400){if(_0x1c8400){_0x1c8400[_0x60b9('0x1b')]({'lastMsgAt':_0x1af546['createdAt'],'lastMsgDirection':_0x1af546[_0x60b9('0x1c')][_0x60b9('0x14')](),'lastMsgBody':_0x1af546[_0x60b9('0x11')]});}})[_0x60b9('0x1d')](function(_0x25c5c4){console['error'](_0x25c5c4);});}_0x3f0297();}},'charset':'utf8mb4','collate':_0x60b9('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 8ed9eff..4d916f8 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 _0xa498=['rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','body','options','raw','CreateMailMessage','debug','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1f6fd5,_0x399cb0){var _0x587d12=function(_0x4d26e8){while(--_0x4d26e8){_0x1f6fd5['push'](_0x1f6fd5['shift']());}};_0x587d12(++_0x399cb0);}(_0xa498,0x179));var _0x8a49=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xa498[_0x547af];return _0x22f7f4;};'use strict';var _=require(_0x8a49('0x0'));var util=require(_0x8a49('0x1'));var moment=require(_0x8a49('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a49('0x3'));var fs=require('fs');var Redis=require(_0x8a49('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a49('0x5'));var logger=require(_0x8a49('0x6'))(_0x8a49('0x7'));var config=require(_0x8a49('0x8'));var jayson=require(_0x8a49('0x9'));var client=jayson[_0x8a49('0xa')]['http']({'port':0x232a});config[_0x8a49('0xb')]=_['defaults'](config['redis'],{'host':_0x8a49('0xc'),'port':0x18eb});var socket=require(_0x8a49('0xd'))(new Redis(config[_0x8a49('0xb')]));require(_0x8a49('0xe'))[_0x8a49('0xf')](socket);function respondWithRpcPromise(_0x1e098e,_0x49dca9,_0x2ae425){return new BPromise(function(_0x224a4b,_0x19f10a){return client[_0x8a49('0x10')](_0x1e098e,_0x2ae425)[_0x8a49('0x11')](function(_0x59885a){logger['info']('MailMessage,\x20%s,\x20%s',_0x49dca9,_0x8a49('0x12'));logger['debug'](_0x8a49('0x13'),_0x49dca9,'request\x20sent',JSON['stringify'](_0x59885a));if(_0x59885a[_0x8a49('0x14')]){if(_0x59885a[_0x8a49('0x14')]['code']===0x1f4){logger[_0x8a49('0x14')](_0x8a49('0x15'),_0x49dca9,_0x59885a['error'][_0x8a49('0x16')]);return _0x19f10a(_0x59885a[_0x8a49('0x14')]['message']);}logger[_0x8a49('0x14')]('MailMessage,\x20%s,\x20%s',_0x49dca9,_0x59885a[_0x8a49('0x14')]['message']);return _0x224a4b(_0x59885a['error']['message']);}else{logger[_0x8a49('0x17')](_0x8a49('0x15'),_0x49dca9,'request\x20sent');_0x224a4b(_0x59885a[_0x8a49('0x18')][_0x8a49('0x16')]);}})[_0x8a49('0x19')](function(_0xc4bd0b){logger[_0x8a49('0x14')](_0x8a49('0x15'),_0x49dca9,_0xc4bd0b);_0x19f10a(_0xc4bd0b);});});}exports['CreateMailMessage']=function(_0x1460dd){var _0x546c25=this;return new Promise(function(_0x211b68,_0x254d6e){return db['MailMessage']['create'](_0x1460dd[_0x8a49('0x1a')],{'raw':_0x1460dd[_0x8a49('0x1b')]?_0x1460dd[_0x8a49('0x1b')][_0x8a49('0x1c')]===undefined?!![]:![]:!![]})[_0x8a49('0x11')](function(_0x4e0bf1){logger[_0x8a49('0x17')](_0x8a49('0x1d'),_0x1460dd);logger[_0x8a49('0x1e')](_0x8a49('0x1d'),_0x1460dd,JSON[_0x8a49('0x1f')](_0x4e0bf1));_0x211b68(_0x4e0bf1);})[_0x8a49('0x19')](function(_0xf8705d){logger[_0x8a49('0x14')](_0x8a49('0x1d'),_0xf8705d[_0x8a49('0x16')],_0x1460dd);_0x254d6e(_0x546c25['error'](0x1f4,_0xf8705d['message']));});});}; \ No newline at end of file +var _0xb4c7=['debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x508a75,_0x3fa89b){var _0x6a41f0=function(_0x27c1b7){while(--_0x27c1b7){_0x508a75['push'](_0x508a75['shift']());}};_0x6a41f0(++_0x3fa89b);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x13685a,_0x53e1ce){_0x13685a=_0x13685a-0x0;var _0x3af986=_0xb4c7[_0x13685a];return _0x3af986;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});config[_0x7b4c('0xc')]=_['defaults'](config[_0x7b4c('0xc')],{'host':_0x7b4c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b4c('0xc')]));require(_0x7b4c('0xe'))[_0x7b4c('0xf')](socket);function respondWithRpcPromise(_0x237e28,_0x365225,_0x93d013){return new BPromise(function(_0x1a996f,_0xc62104){return client[_0x7b4c('0x10')](_0x237e28,_0x93d013)[_0x7b4c('0x11')](function(_0x5d5bc3){logger['info'](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));logger[_0x7b4c('0x14')](_0x7b4c('0x15'),_0x365225,_0x7b4c('0x13'),JSON[_0x7b4c('0x16')](_0x5d5bc3));if(_0x5d5bc3[_0x7b4c('0x17')]){if(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x18')]===0x1f4){logger[_0x7b4c('0x17')]('MailMessage,\x20%s,\x20%s',_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0xc62104(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);}logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0x1a996f(_0x5d5bc3['error'][_0x7b4c('0x19')]);}else{logger[_0x7b4c('0x1a')](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));_0x1a996f(_0x5d5bc3['result'][_0x7b4c('0x19')]);}})[_0x7b4c('0x1b')](function(_0x32110e){logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x32110e);_0xc62104(_0x32110e);});});}exports[_0x7b4c('0x1c')]=function(_0x237110){var _0x445281=this;return new Promise(function(_0x3556d8,_0x55e3df){return db[_0x7b4c('0x1d')][_0x7b4c('0x1e')](_0x237110[_0x7b4c('0x1f')],{'raw':_0x237110[_0x7b4c('0x20')]?_0x237110[_0x7b4c('0x20')][_0x7b4c('0x21')]===undefined?!![]:![]:!![]})[_0x7b4c('0x11')](function(_0x3d4826){logger[_0x7b4c('0x1a')](_0x7b4c('0x1c'),_0x237110);logger['debug'](_0x7b4c('0x1c'),_0x237110,JSON[_0x7b4c('0x16')](_0x3d4826));_0x3556d8(_0x3d4826);})[_0x7b4c('0x1b')](function(_0x3157b8){logger[_0x7b4c('0x17')](_0x7b4c('0x1c'),_0x3157b8[_0x7b4c('0x19')],_0x237110);_0x55e3df(_0x445281[_0x7b4c('0x17')](0x1f4,_0x3157b8[_0x7b4c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index ebef561..807fc0c 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 _0xd8f6=['length','./mailMessage.events','remove','removeListener','register'];(function(_0x1a2665,_0x3a493b){var _0x18c4f0=function(_0x248aa2){while(--_0x248aa2){_0x1a2665['push'](_0x1a2665['shift']());}};_0x18c4f0(++_0x3a493b);}(_0xd8f6,0x6f));var _0x6d8f=function(_0x202bb5,_0x4c5a09){_0x202bb5=_0x202bb5-0x0;var _0x1733b8=_0xd8f6[_0x202bb5];return _0x1733b8;};'use strict';var MailMessageEvents=require(_0x6d8f('0x0'));var events=['save',_0x6d8f('0x1'),'update'];function createListener(_0x2d3bd2,_0x462b3d){return function(_0x3c6193){_0x462b3d['emit'](_0x2d3bd2,_0x3c6193);};}function removeListener(_0x36c6a6,_0x4a22eb){return function(){MailMessageEvents[_0x6d8f('0x2')](_0x36c6a6,_0x4a22eb);};}exports[_0x6d8f('0x3')]=function(_0x3173e5){for(var _0x3cc67d=0x0,_0x5e6f1b=events[_0x6d8f('0x4')];_0x3cc67d<_0x5e6f1b;_0x3cc67d++){var _0x151dff=events[_0x3cc67d];var _0x515887=createListener('mailMessage:'+_0x151dff,_0x3173e5);MailMessageEvents['on'](_0x151dff,_0x515887);}}; \ No newline at end of file +var _0x30cb=['update','emit','register','length','./mailMessage.events','save','remove'];(function(_0x123978,_0x57f7c5){var _0x526174=function(_0x4ee8ed){while(--_0x4ee8ed){_0x123978['push'](_0x123978['shift']());}};_0x526174(++_0x57f7c5);}(_0x30cb,0x1c4));var _0xb30c=function(_0x39f023,_0x40eb0b){_0x39f023=_0x39f023-0x0;var _0x56e418=_0x30cb[_0x39f023];return _0x56e418;};'use strict';var MailMessageEvents=require(_0xb30c('0x0'));var events=[_0xb30c('0x1'),_0xb30c('0x2'),_0xb30c('0x3')];function createListener(_0xb0774a,_0x46fd14){return function(_0xbc950c){_0x46fd14[_0xb30c('0x4')](_0xb0774a,_0xbc950c);};}function removeListener(_0x2b53fb,_0x4c16d4){return function(){MailMessageEvents['removeListener'](_0x2b53fb,_0x4c16d4);};}exports[_0xb30c('0x5')]=function(_0x5677b8){for(var _0x14959d=0x0,_0x47b429=events[_0xb30c('0x6')];_0x14959d<_0x47b429;_0x14959d++){var _0x54a692=events[_0x14959d];var _0x526c91=createListener('mailMessage:'+_0x54a692,_0x5677b8);MailMessageEvents['on'](_0x54a692,_0x526c91);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 4853b1b..1bc224a 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 _0xa5d4=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path'];(function(_0x1b05b8,_0x44a92){var _0x36f4b4=function(_0x1754fb){while(--_0x1754fb){_0x1b05b8['push'](_0x1b05b8['shift']());}};_0x36f4b4(++_0x44a92);}(_0xa5d4,0x89));var _0x4a5d=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xa5d4[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require(_0x4a5d('0x0'));var util=require(_0x4a5d('0x1'));var path=require(_0x4a5d('0x2'));var timeout=require(_0x4a5d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4a5d('0x4'));var interaction=require(_0x4a5d('0x5'));var config=require(_0x4a5d('0x6'));var controller=require(_0x4a5d('0x7'));router[_0x4a5d('0x8')]('/',auth[_0x4a5d('0x9')](),controller[_0x4a5d('0xa')]);router[_0x4a5d('0x8')](_0x4a5d('0xb'),auth['isAuthenticated'](),controller[_0x4a5d('0xc')]);router['get']('/:id',auth[_0x4a5d('0x9')](),controller[_0x4a5d('0xd')]);router[_0x4a5d('0x8')]('/:id/members',auth[_0x4a5d('0x9')](),controller[_0x4a5d('0xe')]);router[_0x4a5d('0x8')](_0x4a5d('0xf'),auth['isAuthenticated'](),controller[_0x4a5d('0x10')]);router[_0x4a5d('0x8')](_0x4a5d('0x11'),auth['isAuthenticated'](),controller[_0x4a5d('0x12')]);router[_0x4a5d('0x13')]('/',auth[_0x4a5d('0x9')](),controller['create']);router[_0x4a5d('0x13')](_0x4a5d('0xf'),auth[_0x4a5d('0x9')](),controller[_0x4a5d('0x14')]);router[_0x4a5d('0x13')](_0x4a5d('0x11'),auth['isAuthenticated'](),controller[_0x4a5d('0x15')]);router['put']('/:id',auth[_0x4a5d('0x9')](),controller['update']);router[_0x4a5d('0x16')](_0x4a5d('0x17'),auth[_0x4a5d('0x9')](),controller[_0x4a5d('0x18')]);router[_0x4a5d('0x16')](_0x4a5d('0xf'),auth[_0x4a5d('0x9')](),controller[_0x4a5d('0x19')]);router[_0x4a5d('0x16')](_0x4a5d('0x11'),auth[_0x4a5d('0x9')](),controller[_0x4a5d('0x1a')]);module[_0x4a5d('0x1b')]=router; \ No newline at end of file +var _0x5f3f=['../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x56c740,_0x25eb9a){var _0x32cd25=function(_0x21abd7){while(--_0x21abd7){_0x56c740['push'](_0x56c740['shift']());}};_0x32cd25(++_0x25eb9a);}(_0x5f3f,0x111));var _0xf5f3=function(_0x1f1230,_0x12ae82){_0x1f1230=_0x1f1230-0x0;var _0x3ab793=_0x5f3f[_0x1f1230];return _0x3ab793;};'use strict';var multer=require(_0xf5f3('0x0'));var util=require(_0xf5f3('0x1'));var path=require(_0xf5f3('0x2'));var timeout=require(_0xf5f3('0x3'));var express=require('express');var router=express[_0xf5f3('0x4')]();var auth=require(_0xf5f3('0x5'));var interaction=require(_0xf5f3('0x6'));var config=require(_0xf5f3('0x7'));var controller=require(_0xf5f3('0x8'));router[_0xf5f3('0x9')]('/',auth[_0xf5f3('0xa')](),controller[_0xf5f3('0xb')]);router[_0xf5f3('0x9')](_0xf5f3('0xc'),auth['isAuthenticated'](),controller[_0xf5f3('0xd')]);router[_0xf5f3('0x9')]('/:id',auth[_0xf5f3('0xa')](),controller['show']);router[_0xf5f3('0x9')](_0xf5f3('0xe'),auth['isAuthenticated'](),controller[_0xf5f3('0xf')]);router['get'](_0xf5f3('0x10'),auth['isAuthenticated'](),controller[_0xf5f3('0x11')]);router[_0xf5f3('0x9')](_0xf5f3('0x12'),auth['isAuthenticated'](),controller[_0xf5f3('0x13')]);router[_0xf5f3('0x14')]('/',auth['isAuthenticated'](),controller[_0xf5f3('0x15')]);router[_0xf5f3('0x14')]('/:id/teams',auth[_0xf5f3('0xa')](),controller[_0xf5f3('0x16')]);router['post']('/:id/users',auth[_0xf5f3('0xa')](),controller[_0xf5f3('0x17')]);router['put'](_0xf5f3('0x18'),auth[_0xf5f3('0xa')](),controller[_0xf5f3('0x19')]);router[_0xf5f3('0x1a')]('/:id',auth[_0xf5f3('0xa')](),controller[_0xf5f3('0x1b')]);router['delete']('/:id/teams',auth[_0xf5f3('0xa')](),controller[_0xf5f3('0x1c')]);router[_0xf5f3('0x1a')](_0xf5f3('0x12'),auth[_0xf5f3('0xa')](),controller[_0xf5f3('0x1d')]);module[_0xf5f3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 6172429..349cffe 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 _0x714d=['name','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x62f1a2,_0x7d84cb){var _0x137fb0=function(_0xdea36a){while(--_0xdea36a){_0x62f1a2['push'](_0x62f1a2['shift']());}};_0x137fb0(++_0x7d84cb);}(_0x714d,0x7b));var _0xd714=function(_0x5b94b0,_0xe1973c){_0x5b94b0=_0x5b94b0-0x0;var _0x3587b5=_0x714d[_0x5b94b0];return _0x3587b5;};'use strict';var Sequelize=require(_0xd714('0x0'));module[_0xd714('0x1')]={'name':{'type':Sequelize[_0xd714('0x2')],'unique':_0xd714('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd714('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd714('0x4')](_0xd714('0x5'),_0xd714('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xd6d1=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0xd6d1,0x14a));var _0x1d6d=function(_0x2dec39,_0x2f6587){_0x2dec39=_0x2dec39-0x0;var _0x3dc51d=_0xd6d1[_0x2dec39];return _0x3dc51d;};'use strict';var Sequelize=require(_0x1d6d('0x0'));module[_0x1d6d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1d6d('0x2')]},'timeout':{'type':Sequelize[_0x1d6d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1d6d('0x4')](_0x1d6d('0x5'),_0x1d6d('0x6'),_0x1d6d('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f230e57..82d9c52 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 _0xb2b0=['select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','Agents','online','interface','sequelize','findOrCreate','forEach','emit','userMailQueue:save','removeTeams'];(function(_0xbe7fb8,_0x421c0f){var _0x182345=function(_0x53a15e){while(--_0x53a15e){_0xbe7fb8['push'](_0xbe7fb8['shift']());}};_0x182345(++_0x421c0f);}(_0xb2b0,0x14b));var _0x0b2b=function(_0x2366c0,_0x4fb532){_0x2366c0=_0x2366c0-0x0;var _0x1dc310=_0xb2b0[_0x2366c0];return _0x1dc310;};'use strict';var pdf=require(_0x0b2b('0x0'));var emlformat=require(_0x0b2b('0x1'));var rimraf=require(_0x0b2b('0x2'));var zipdir=require(_0x0b2b('0x3'));var jsonpatch=require(_0x0b2b('0x4'));var rp=require(_0x0b2b('0x5'));var moment=require(_0x0b2b('0x6'));var BPromise=require(_0x0b2b('0x7'));var Mustache=require(_0x0b2b('0x8'));var util=require(_0x0b2b('0x9'));var path=require(_0x0b2b('0xa'));var sox=require('sox');var csv=require(_0x0b2b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0b2b('0xc'));var squel=require(_0x0b2b('0xd'));var crypto=require(_0x0b2b('0xe'));var jsforce=require(_0x0b2b('0xf'));var deskjs=require(_0x0b2b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0b2b('0x11'));var Papa=require(_0x0b2b('0x12'));var Redis=require(_0x0b2b('0x13'));var authService=require(_0x0b2b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0b2b('0x15'));var hardwareService=require(_0x0b2b('0x16'));var logger=require(_0x0b2b('0x17'))(_0x0b2b('0x18'));var utils=require(_0x0b2b('0x19'));var config=require(_0x0b2b('0x1a'));var db=require(_0x0b2b('0x1b'))['db'];config[_0x0b2b('0x1c')]=_[_0x0b2b('0x1d')](config[_0x0b2b('0x1c')],{'host':_0x0b2b('0x1e'),'port':0x18eb});var socket=require(_0x0b2b('0x1f'))(new Redis(config[_0x0b2b('0x1c')]));require(_0x0b2b('0x20'))[_0x0b2b('0x21')](socket);function respondWithStatusCode(_0x52e019,_0x5dcc5e){_0x5dcc5e=_0x5dcc5e||0xcc;return function(_0x3ac4f6){if(_0x3ac4f6){return _0x52e019[_0x0b2b('0x22')](_0x5dcc5e);}return _0x52e019[_0x0b2b('0x23')](_0x5dcc5e)['end']();};}function respondWithResult(_0x46d2c,_0x96f1f3){_0x96f1f3=_0x96f1f3||0xc8;return function(_0x3eba56){if(_0x3eba56){return _0x46d2c['status'](_0x96f1f3)[_0x0b2b('0x24')](_0x3eba56);}};}function respondWithFilteredResult(_0x34fcf1,_0x24631a){return function(_0x3cd909){if(_0x3cd909){var _0xe54e33=_0x3cd909[_0x0b2b('0x25')],_0x1cc862=_0x24631a[_0x0b2b('0x26')],_0x4c6873=_0x24631a['offset']+_0x24631a[_0x0b2b('0x27')],_0x6c2e3;if(_0x4c6873>=_0xe54e33){_0x4c6873=_0xe54e33;_0x6c2e3=0xc8;}else{_0x6c2e3=0xce;}_0x34fcf1['status'](_0x6c2e3);return _0x34fcf1[_0x0b2b('0x28')](_0x0b2b('0x29'),_0x1cc862+'-'+_0x4c6873+'/'+_0xe54e33)[_0x0b2b('0x24')](_0x3cd909);}return null;};}function patchUpdates(_0x90e9f6){return function(_0x4e90fd){try{jsonpatch[_0x0b2b('0x2a')](_0x4e90fd,_0x90e9f6,!![]);}catch(_0x112184){return BPromise[_0x0b2b('0x2b')](_0x112184);}return _0x4e90fd[_0x0b2b('0x2c')]();};}function saveUpdates(_0x339738,_0x4a4fd1){return function(_0x2218a4){if(_0x2218a4){return _0x2218a4[_0x0b2b('0x2d')](_0x339738)[_0x0b2b('0x2e')](function(_0x1d8120){return _0x1d8120;});}return null;};}function removeEntity(_0x2420e1,_0x256eed){return function(_0x328f57){if(_0x328f57){return _0x328f57[_0x0b2b('0x2f')]()['then'](function(){var _0x5367c4=_0x328f57[_0x0b2b('0x30')]({'plain':!![]});var _0x44b2b0=_0x0b2b('0x31');return db[_0x0b2b('0x32')][_0x0b2b('0x2f')]({'where':{'type':_0x44b2b0,'resourceId':_0x5367c4['id']}})['then'](function(){return _0x328f57;});})[_0x0b2b('0x2e')](function(){_0x2420e1[_0x0b2b('0x23')](0xcc)[_0x0b2b('0x33')]();});}};}function handleEntityNotFound(_0x232977,_0xbc3d50){return function(_0x3a9920){if(!_0x3a9920){_0x232977[_0x0b2b('0x22')](0x194);}return _0x3a9920;};}function handleError(_0x4c6c33,_0x30a0a1){_0x30a0a1=_0x30a0a1||0x1f4;return function(_0x3260a0){logger['error'](_0x3260a0[_0x0b2b('0x34')]);if(_0x3260a0[_0x0b2b('0x35')]){delete _0x3260a0[_0x0b2b('0x35')];}_0x4c6c33[_0x0b2b('0x23')](_0x30a0a1)[_0x0b2b('0x36')](_0x3260a0);};}exports[_0x0b2b('0x37')]=function(_0x2efb98,_0x142ad0){var _0x4bf78b={},_0x274224={},_0x106fac={'count':0x0,'rows':[]};var _0x558582=_[_0x0b2b('0x38')](db[_0x0b2b('0x39')][_0x0b2b('0x3a')],function(_0x1618af){return{'name':_0x1618af[_0x0b2b('0x3b')],'type':_0x1618af[_0x0b2b('0x3c')][_0x0b2b('0x3d')]};});_0x274224[_0x0b2b('0x3e')]=_['map'](_0x558582,_0x0b2b('0x35'));_0x274224[_0x0b2b('0x3f')]=_[_0x0b2b('0x40')](_0x2efb98[_0x0b2b('0x3f')]);_0x274224[_0x0b2b('0x41')]=_[_0x0b2b('0x42')](_0x274224[_0x0b2b('0x3e')],_0x274224[_0x0b2b('0x3f')]);_0x4bf78b[_0x0b2b('0x43')]=_[_0x0b2b('0x42')](_0x274224['model'],qs[_0x0b2b('0x44')](_0x2efb98['query'][_0x0b2b('0x44')]));_0x4bf78b[_0x0b2b('0x43')]=_0x4bf78b[_0x0b2b('0x43')][_0x0b2b('0x45')]?_0x4bf78b[_0x0b2b('0x43')]:_0x274224[_0x0b2b('0x3e')];if(!_0x2efb98[_0x0b2b('0x3f')][_0x0b2b('0x46')](_0x0b2b('0x47'))){_0x4bf78b[_0x0b2b('0x27')]=qs[_0x0b2b('0x27')](_0x2efb98['query'][_0x0b2b('0x27')]);_0x4bf78b[_0x0b2b('0x26')]=qs['offset'](_0x2efb98[_0x0b2b('0x3f')]['offset']);}_0x4bf78b[_0x0b2b('0x48')]=qs[_0x0b2b('0x49')](_0x2efb98[_0x0b2b('0x3f')][_0x0b2b('0x49')]);_0x4bf78b[_0x0b2b('0x4a')]=qs['filters'](_[_0x0b2b('0x4b')](_0x2efb98[_0x0b2b('0x3f')],_0x274224[_0x0b2b('0x41')]));if(_0x2efb98[_0x0b2b('0x3f')][_0x0b2b('0x4c')]){_0x4bf78b[_0x0b2b('0x4a')]=_['merge'](_0x4bf78b[_0x0b2b('0x4a')],{'$or':_[_0x0b2b('0x38')](_0x558582,function(_0x3d5744){if(_0x3d5744[_0x0b2b('0x3c')]!==_0x0b2b('0x4d')){var _0x4c2ec2={};_0x4c2ec2[_0x3d5744[_0x0b2b('0x35')]]={'$like':'%'+_0x2efb98[_0x0b2b('0x3f')][_0x0b2b('0x4c')]+'%'};return _0x4c2ec2;}})});}_0x4bf78b=_['merge']({},_0x4bf78b,_0x2efb98[_0x0b2b('0x4e')]);var _0x53872d={'where':_0x4bf78b[_0x0b2b('0x4a')]};return db['MailQueue']['count'](_0x53872d)['then'](function(_0x2d9c0f){_0x106fac[_0x0b2b('0x25')]=_0x2d9c0f;if(_0x2efb98[_0x0b2b('0x3f')][_0x0b2b('0x4f')]){_0x4bf78b[_0x0b2b('0x50')]=[{'all':!![]}];}return db[_0x0b2b('0x39')][_0x0b2b('0x51')](_0x4bf78b);})[_0x0b2b('0x2e')](function(_0x45bcb3){_0x106fac[_0x0b2b('0x52')]=_0x45bcb3;return _0x106fac;})['then'](respondWithFilteredResult(_0x142ad0,_0x4bf78b))[_0x0b2b('0x53')](handleError(_0x142ad0,null));};exports[_0x0b2b('0x54')]=function(_0x2a5791,_0xfb8540){var _0x8b2182={'raw':!![],'where':{'id':_0x2a5791[_0x0b2b('0x55')]['id']}},_0xa18f6e={};_0xa18f6e['model']=_[_0x0b2b('0x40')](db[_0x0b2b('0x39')][_0x0b2b('0x3a')]);_0xa18f6e[_0x0b2b('0x3f')]=_[_0x0b2b('0x40')](_0x2a5791[_0x0b2b('0x3f')]);_0xa18f6e['filters']=_[_0x0b2b('0x42')](_0xa18f6e[_0x0b2b('0x3e')],_0xa18f6e[_0x0b2b('0x3f')]);_0x8b2182[_0x0b2b('0x43')]=_[_0x0b2b('0x42')](_0xa18f6e['model'],qs[_0x0b2b('0x44')](_0x2a5791[_0x0b2b('0x3f')][_0x0b2b('0x44')]));_0x8b2182[_0x0b2b('0x43')]=_0x8b2182[_0x0b2b('0x43')][_0x0b2b('0x45')]?_0x8b2182[_0x0b2b('0x43')]:_0xa18f6e[_0x0b2b('0x3e')];if(_0x2a5791['query'][_0x0b2b('0x4f')]){_0x8b2182['include']=[{'all':!![]}];}_0x8b2182=_[_0x0b2b('0x56')]({},_0x8b2182,_0x2a5791[_0x0b2b('0x4e')]);return db[_0x0b2b('0x39')][_0x0b2b('0x57')](_0x8b2182)['then'](handleEntityNotFound(_0xfb8540,null))[_0x0b2b('0x2e')](respondWithResult(_0xfb8540,null))['catch'](handleError(_0xfb8540,null));};exports[_0x0b2b('0x58')]=function(_0x6642ae,_0xc9b37a){return db[_0x0b2b('0x39')][_0x0b2b('0x58')](_0x6642ae[_0x0b2b('0x59')],{})['then'](function(_0x5b1de0){var _0x1b7641=_0x6642ae['user'][_0x0b2b('0x30')]({'plain':!![]});if(!_0x1b7641)throw new Error(_0x0b2b('0x5a'));if(_0x1b7641[_0x0b2b('0x5b')]===_0x0b2b('0x5c')){var _0x41d6d1=_0x5b1de0['get']({'plain':!![]});var _0x50fd68=_0x0b2b('0x31');return db['UserProfileSection'][_0x0b2b('0x57')]({'where':{'name':_0x50fd68,'userProfileId':_0x1b7641[_0x0b2b('0x5d')]},'raw':!![]})[_0x0b2b('0x2e')](function(_0x1eb441){if(_0x1eb441&&_0x1eb441['autoAssociation']===0x0){return db[_0x0b2b('0x32')][_0x0b2b('0x58')]({'name':_0x41d6d1[_0x0b2b('0x35')],'resourceId':_0x41d6d1['id'],'type':_0x1eb441[_0x0b2b('0x35')],'sectionId':_0x1eb441['id']},{})[_0x0b2b('0x2e')](function(){return _0x5b1de0;});}else{return _0x5b1de0;}})[_0x0b2b('0x53')](function(_0x4944b1){logger['error'](_0x0b2b('0x5e'),_0x4944b1);throw _0x4944b1;});}return _0x5b1de0;})[_0x0b2b('0x2e')](respondWithResult(_0xc9b37a,0xc9))[_0x0b2b('0x53')](handleError(_0xc9b37a,null));};exports[_0x0b2b('0x2d')]=function(_0xc54dcc,_0x523521){if(_0xc54dcc[_0x0b2b('0x59')]['id']){delete _0xc54dcc[_0x0b2b('0x59')]['id'];}return db['MailQueue'][_0x0b2b('0x57')]({'where':{'id':_0xc54dcc[_0x0b2b('0x55')]['id']}})[_0x0b2b('0x2e')](handleEntityNotFound(_0x523521,null))[_0x0b2b('0x2e')](saveUpdates(_0xc54dcc[_0x0b2b('0x59')],null))['then'](respondWithResult(_0x523521,null))['catch'](handleError(_0x523521,null));};exports['destroy']=function(_0x5860f5,_0x4faeaa){return db[_0x0b2b('0x39')][_0x0b2b('0x57')]({'where':{'id':_0x5860f5['params']['id']}})[_0x0b2b('0x2e')](handleEntityNotFound(_0x4faeaa,null))[_0x0b2b('0x2e')](removeEntity(_0x4faeaa,null))[_0x0b2b('0x53')](handleError(_0x4faeaa,null));};exports[_0x0b2b('0x5f')]=function(_0xfb82ec,_0x418f54){return db[_0x0b2b('0x39')][_0x0b2b('0x5f')]()[_0x0b2b('0x2e')](respondWithResult(_0x418f54,null))[_0x0b2b('0x53')](handleError(_0x418f54,null));};exports[_0x0b2b('0x60')]=function(_0x3c0c49,_0x138b5d,_0x54a258){var _0x46df18={'raw':!![],'where':{}},_0x4f6008={},_0x57589a;return db[_0x0b2b('0x39')][_0x0b2b('0x61')]({'where':{'id':_0x3c0c49['params']['id']}})['then'](handleEntityNotFound(_0x138b5d,null))[_0x0b2b('0x2e')](function(_0xe9cadc){if(_0xe9cadc){_0x57589a=_0xe9cadc[_0x0b2b('0x30')]({'plain':!![]});_0x4f6008[_0x0b2b('0x3e')]=_['keys'](db[_0x0b2b('0x62')]['rawAttributes']);_0x4f6008[_0x0b2b('0x3f')]=_['keys'](_0x3c0c49[_0x0b2b('0x3f')]);_0x4f6008['filters']=_[_0x0b2b('0x42')](_0x4f6008[_0x0b2b('0x3e')],_0x4f6008[_0x0b2b('0x3f')]);_0x46df18['attributes']=_[_0x0b2b('0x42')](_0x4f6008[_0x0b2b('0x3e')],qs['fields'](_0x3c0c49[_0x0b2b('0x3f')][_0x0b2b('0x44')]));_0x46df18[_0x0b2b('0x43')]=_0x46df18[_0x0b2b('0x43')]['length']?_0x46df18[_0x0b2b('0x43')]:_0x4f6008[_0x0b2b('0x3e')];if(!_0x3c0c49['query']['hasOwnProperty'](_0x0b2b('0x47'))){_0x46df18[_0x0b2b('0x27')]=qs['limit'](_0x3c0c49['query'][_0x0b2b('0x27')]);_0x46df18[_0x0b2b('0x26')]=qs[_0x0b2b('0x26')](_0x3c0c49[_0x0b2b('0x3f')][_0x0b2b('0x26')]);}_0x46df18[_0x0b2b('0x48')]=qs[_0x0b2b('0x49')](_0x3c0c49[_0x0b2b('0x3f')][_0x0b2b('0x49')]);_0x46df18[_0x0b2b('0x4a')]=qs['filters'](_[_0x0b2b('0x4b')](_0x3c0c49[_0x0b2b('0x3f')],_0x4f6008[_0x0b2b('0x41')]));_0x46df18[_0x0b2b('0x4a')][_0x0b2b('0x63')]=_0xe9cadc['id'];if(_0x3c0c49[_0x0b2b('0x3f')][_0x0b2b('0x4c')]){_0x46df18[_0x0b2b('0x4a')]=_[_0x0b2b('0x56')](_0x46df18[_0x0b2b('0x4a')],{'$or':_[_0x0b2b('0x38')](_0x46df18[_0x0b2b('0x43')],function(_0x4f2e62){var _0x52fa6f={};_0x52fa6f[_0x4f2e62]={'$like':'%'+_0x3c0c49[_0x0b2b('0x3f')][_0x0b2b('0x4c')]+'%'};return _0x52fa6f;})});}_0x46df18=_[_0x0b2b('0x56')]({},_0x46df18,_0x3c0c49[_0x0b2b('0x4e')]);return db[_0x0b2b('0x62')][_0x0b2b('0x51')](_0x46df18);}})[_0x0b2b('0x2e')](function(_0x2d16ed){if(_0x2d16ed){return db[_0x0b2b('0x64')][_0x0b2b('0x65')]({'where':{'id':_[_0x0b2b('0x38')](_0x2d16ed,_0x0b2b('0x66')),'role':_0x0b2b('0x67')},'attributes':['id','name',_0x0b2b('0x68'),_0x0b2b('0x69'),_0x0b2b('0x6a')]});}})[_0x0b2b('0x2e')](function(_0xea1561){if(_0xea1561){return{'count':_0xea1561[_0x0b2b('0x25')],'rows':_['map'](_0xea1561[_0x0b2b('0x52')],function(_0x5d8004){return{'membername':_0x5d8004[_0x0b2b('0x35')],'UserId':_0x5d8004['id'],'queue_name':_0x57589a['name'],'MailQueueId':_0x57589a['id'],'interface':util[_0x0b2b('0x6b')]('%s/%s',_0x0b2b('0x6c'),_0x5d8004['name']),'penalty':0x0,'paused':_0x5d8004[_0x0b2b('0x68')],'createdAt':_0x5d8004['createdAt'],'updatedAt':_0x5d8004[_0x0b2b('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b2b('0x2e')](respondWithFilteredResult(_0x138b5d,_0x46df18))[_0x0b2b('0x53')](handleError(_0x138b5d,null));};exports['getTeams']=function(_0x11c6c3,_0x114240,_0x5109d5){var _0x54f4fe={};var _0x35322d={};var _0x36c289;var _0x85a2b2;return db['MailQueue']['findOne']({'where':{'id':_0x11c6c3[_0x0b2b('0x55')]['id']}})['then'](handleEntityNotFound(_0x114240,null))[_0x0b2b('0x2e')](function(_0x428393){if(_0x428393){_0x36c289=_0x428393;_0x35322d[_0x0b2b('0x3e')]=_['keys'](db[_0x0b2b('0x6d')][_0x0b2b('0x3a')]);_0x35322d[_0x0b2b('0x3f')]=_[_0x0b2b('0x40')](_0x11c6c3[_0x0b2b('0x3f')]);_0x35322d[_0x0b2b('0x41')]=_['intersection'](_0x35322d[_0x0b2b('0x3e')],_0x35322d[_0x0b2b('0x3f')]);_0x54f4fe['attributes']=_[_0x0b2b('0x42')](_0x35322d[_0x0b2b('0x3e')],qs[_0x0b2b('0x44')](_0x11c6c3[_0x0b2b('0x3f')][_0x0b2b('0x44')]));_0x54f4fe[_0x0b2b('0x43')]=_0x54f4fe[_0x0b2b('0x43')][_0x0b2b('0x45')]?_0x54f4fe[_0x0b2b('0x43')]:_0x35322d['model'];_0x54f4fe[_0x0b2b('0x48')]=qs['sort'](_0x11c6c3[_0x0b2b('0x3f')][_0x0b2b('0x49')]);_0x54f4fe[_0x0b2b('0x4a')]=qs[_0x0b2b('0x41')](_[_0x0b2b('0x4b')](_0x11c6c3[_0x0b2b('0x3f')],_0x35322d[_0x0b2b('0x41')]));if(_0x11c6c3[_0x0b2b('0x3f')][_0x0b2b('0x4c')]){_0x54f4fe[_0x0b2b('0x4a')]=_[_0x0b2b('0x56')](_0x54f4fe['where'],{'$or':_['map'](_0x54f4fe[_0x0b2b('0x43')],function(_0x4a4c83){var _0x26e007={};_0x26e007[_0x4a4c83]={'$like':'%'+_0x11c6c3[_0x0b2b('0x3f')][_0x0b2b('0x4c')]+'%'};return _0x26e007;})});}_0x54f4fe=_['merge']({},_0x54f4fe,_0x11c6c3['options']);return _0x36c289[_0x0b2b('0x6e')](_0x54f4fe);}})[_0x0b2b('0x2e')](function(_0x29243e){if(_0x29243e){_0x85a2b2=_0x29243e[_0x0b2b('0x45')];if(!_0x11c6c3['query'][_0x0b2b('0x46')](_0x0b2b('0x47'))){_0x54f4fe[_0x0b2b('0x27')]=qs['limit'](_0x11c6c3[_0x0b2b('0x3f')][_0x0b2b('0x27')]);_0x54f4fe[_0x0b2b('0x26')]=qs['offset'](_0x11c6c3[_0x0b2b('0x3f')][_0x0b2b('0x26')]);}return _0x36c289[_0x0b2b('0x6e')](_0x54f4fe);}})[_0x0b2b('0x2e')](function(_0x1f30d9){if(_0x1f30d9){return _0x1f30d9?{'count':_0x85a2b2,'rows':_0x1f30d9}:null;}})[_0x0b2b('0x2e')](respondWithResult(_0x114240,null))[_0x0b2b('0x53')](handleError(_0x114240,null));};exports[_0x0b2b('0x6f')]=function(_0x5c68ed,_0x2c3977,_0x7da04){var _0x50225b=_0x5c68ed[_0x0b2b('0x59')][_0x0b2b('0x70')];return db['Team'][_0x0b2b('0x51')]({'where':{'id':_0x50225b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0b2b('0x71'),'attributes':['id',_0x0b2b('0x35'),_0x0b2b('0x72'),'voicePause',_0x0b2b('0x73')],'raw':!![]}]})[_0x0b2b('0x2e')](function(_0x576f0c){if(_0x576f0c){var _0x1ef317=_['flatMap'](_0x576f0c,function(_0x140cd2){var _0x12f518=_0x140cd2[_0x0b2b('0x30')]({'plain':!![]});return _0x12f518[_0x0b2b('0x71')];});return db[_0x0b2b('0x39')][_0x0b2b('0x57')]({'where':{'id':_0x5c68ed[_0x0b2b('0x55')]['id']}})[_0x0b2b('0x2e')](function(_0x4a8578){return db[_0x0b2b('0x74')]['transaction'](function(_0x2e577a){return _0x4a8578['addTeams'](_0x50225b,{'transaction':_0x2e577a})[_0x0b2b('0x2e')](function(){return BPromise['each'](_0x1ef317,function(_0xbfca){return db[_0x0b2b('0x62')][_0x0b2b('0x75')]({'where':{'UserId':_0xbfca['id'],'MailQueueId':_0x5c68ed[_0x0b2b('0x55')]['id']},'transaction':_0x2e577a});});})[_0x0b2b('0x2e')](function(){_0x1ef317[_0x0b2b('0x76')](function(_0x11f49b){socket[_0x0b2b('0x77')](_0x0b2b('0x78'),{'UserId':_0x11f49b['id'],'MailQueueId':_0x4a8578['id']});});});});});}})[_0x0b2b('0x2e')](respondWithStatusCode(_0x2c3977,null))[_0x0b2b('0x53')](handleError(_0x2c3977,null));};exports[_0x0b2b('0x79')]=function(_0x18c7ef,_0x44fbfd,_0x23fb05){return db['Team'][_0x0b2b('0x51')]({'where':{'id':_0x18c7ef[_0x0b2b('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0b2b('0x64')],'as':_0x0b2b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x0b2b('0x2e')](handleEntityNotFound(_0x44fbfd,null))[_0x0b2b('0x2e')](function(_0x5cd913){var _0x52b007=_[_0x0b2b('0x38')](_0x5cd913,'id');var _0x4d6374=[];var _0x5e37cc=[];var _0x3d94fc=squel[_0x0b2b('0x7a')]();_0x3d94fc['field'](_0x0b2b('0x7b'))[_0x0b2b('0x7c')](_0x0b2b('0x7d'),'tq')[_0x0b2b('0x7e')](_0x0b2b('0x7f'),'ut',_0x0b2b('0x80'))[_0x0b2b('0x4a')](_0x0b2b('0x81'),_0x18c7ef[_0x0b2b('0x55')]['id']);for(var _0x59686d=0x0;_0x59686d<_0x5cd913[_0x0b2b('0x45')];_0x59686d+=0x1){let _0x2a8425=_0x5cd913[_0x59686d];for(var _0x3c4927=0x0;_0x3c4927<_0x2a8425[_0x0b2b('0x71')][_0x0b2b('0x45')];_0x3c4927+=0x1){let _0x328447=_0x2a8425[_0x0b2b('0x71')][_0x3c4927];var _0x25a478=_0x3d94fc[_0x0b2b('0x82')]();_0x25a478['where'](_0x0b2b('0x83'),_0x328447['id']);_0x5e37cc[_0x0b2b('0x84')](db[_0x0b2b('0x74')][_0x0b2b('0x3f')](_0x25a478[_0x0b2b('0x85')](),{'type':db[_0x0b2b('0x74')][_0x0b2b('0x86')][_0x0b2b('0x87')]})[_0x0b2b('0x2e')](function(_0x1440f6){if(_0x1440f6[_0x0b2b('0x45')]===0x1){return _0x328447['id'];}else{var _0x3d9ba5=_[_0x0b2b('0x88')](_[_0x0b2b('0x38')](_0x1440f6,_0x0b2b('0x89')),function(_0x591e62){return _['includes'](_0x52b007,_0x591e62);});if(_0x3d9ba5){return _0x328447['id'];}}}));}}return BPromise[_0x0b2b('0x8a')](_0x5e37cc)['then'](function(_0x3d7ba6){_0x4d6374=_(_0x4d6374)[_0x0b2b('0x8b')](_0x3d7ba6)[_0x0b2b('0x8c')]()[_0x0b2b('0x8d')]();return db[_0x0b2b('0x39')]['find']({'where':{'id':_0x18c7ef[_0x0b2b('0x55')]['id']}})[_0x0b2b('0x2e')](function(_0x5760ba){return db[_0x0b2b('0x74')][_0x0b2b('0x8e')](function(_0x455ebc){return _0x5760ba[_0x0b2b('0x79')](_0x18c7ef[_0x0b2b('0x3f')][_0x0b2b('0x70')],{'transaction':_0x455ebc})[_0x0b2b('0x2e')](function(){if(!_[_0x0b2b('0x8f')](_0x4d6374)){return _0x5760ba[_0x0b2b('0x90')](_0x4d6374,{'transaction':_0x455ebc});}})[_0x0b2b('0x2e')](function(){_0x4d6374[_0x0b2b('0x76')](function(_0x48ddf2){socket['emit'](_0x0b2b('0x91'),{'UserId':_0x48ddf2,'MailQueueId':_0x5760ba['id']});});});});});});})[_0x0b2b('0x2e')](respondWithStatusCode(_0x44fbfd,null))[_0x0b2b('0x53')](handleError(_0x44fbfd,null));};exports[_0x0b2b('0x92')]=function(_0x23f2a9,_0x1b44f1,_0x4a6e1b){return db[_0x0b2b('0x39')][_0x0b2b('0x57')]({'where':{'id':_0x23f2a9[_0x0b2b('0x55')]['id']}})['then'](handleEntityNotFound(_0x1b44f1,null))[_0x0b2b('0x2e')](function(_0x3a87cd){if(_0x3a87cd){return _0x3a87cd[_0x0b2b('0x92')](_0x23f2a9[_0x0b2b('0x59')]['ids'],_[_0x0b2b('0x93')](_0x23f2a9[_0x0b2b('0x59')],[_0x0b2b('0x70'),'id'])||{})[_0x0b2b('0x94')](function(_0x1b1365){for(var _0x494f20=0x0;_0x494f20<_0x23f2a9[_0x0b2b('0x59')][_0x0b2b('0x70')][_0x0b2b('0x45')];_0x494f20+=0x1){socket[_0x0b2b('0x77')](_0x0b2b('0x78'),{'UserId':_0x23f2a9['body'][_0x0b2b('0x70')][_0x494f20],'MailQueueId':_0x23f2a9['params']['id']});}return _0x1b1365;});}})[_0x0b2b('0x2e')](respondWithResult(_0x1b44f1,null))[_0x0b2b('0x53')](handleError(_0x1b44f1,null));};exports[_0x0b2b('0x90')]=function(_0x550a6a,_0x3fe5dd,_0x201501){return db['MailQueue']['find']({'where':{'id':_0x550a6a[_0x0b2b('0x55')]['id']}})[_0x0b2b('0x2e')](handleEntityNotFound(_0x3fe5dd,null))[_0x0b2b('0x2e')](function(_0x48b0d4){if(_0x48b0d4){return _0x48b0d4[_0x0b2b('0x90')](_0x550a6a[_0x0b2b('0x3f')][_0x0b2b('0x70')])[_0x0b2b('0x2e')](function(){if(_[_0x0b2b('0x95')](_0x550a6a[_0x0b2b('0x3f')]['ids'])){for(var _0x5f4731=0x0;_0x5f4731<_0x550a6a['query'][_0x0b2b('0x70')]['length'];_0x5f4731+=0x1){socket[_0x0b2b('0x77')](_0x0b2b('0x91'),{'UserId':Number(_0x550a6a[_0x0b2b('0x3f')][_0x0b2b('0x70')][_0x5f4731]),'MailQueueId':Number(_0x550a6a[_0x0b2b('0x55')]['id'])});}}else{socket[_0x0b2b('0x77')](_0x0b2b('0x91'),{'UserId':Number(_0x550a6a[_0x0b2b('0x3f')][_0x0b2b('0x70')]),'MailQueueId':Number(_0x550a6a[_0x0b2b('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x3fe5dd,null))[_0x0b2b('0x53')](handleError(_0x3fe5dd,null));};exports[_0x0b2b('0x96')]=function(_0x5c97a1,_0x30f665,_0x2c66ad){var _0x42fc9d={};var _0xee8681={};var _0x126827;var _0x453604;return db[_0x0b2b('0x39')][_0x0b2b('0x61')]({'where':{'id':_0x5c97a1[_0x0b2b('0x55')]['id']}})[_0x0b2b('0x2e')](handleEntityNotFound(_0x30f665,null))[_0x0b2b('0x2e')](function(_0x353671){if(_0x353671){_0x126827=_0x353671;_0xee8681[_0x0b2b('0x3e')]=_['keys'](db[_0x0b2b('0x64')][_0x0b2b('0x3a')]);_0xee8681['query']=_[_0x0b2b('0x40')](_0x5c97a1[_0x0b2b('0x3f')]);_0xee8681[_0x0b2b('0x41')]=_[_0x0b2b('0x42')](_0xee8681['model'],_0xee8681[_0x0b2b('0x3f')]);_0x42fc9d[_0x0b2b('0x43')]=_[_0x0b2b('0x42')](_0xee8681['model'],qs[_0x0b2b('0x44')](_0x5c97a1[_0x0b2b('0x3f')][_0x0b2b('0x44')]));_0x42fc9d[_0x0b2b('0x43')]=_0x42fc9d[_0x0b2b('0x43')][_0x0b2b('0x45')]?_0x42fc9d[_0x0b2b('0x43')]:_0xee8681['model'];_0x42fc9d['order']=qs[_0x0b2b('0x49')](_0x5c97a1[_0x0b2b('0x3f')][_0x0b2b('0x49')]);_0x42fc9d[_0x0b2b('0x4a')]=qs['filters'](_['pick'](_0x5c97a1['query'],_0xee8681['filters']));if(_0x5c97a1[_0x0b2b('0x3f')][_0x0b2b('0x4c')]){_0x42fc9d[_0x0b2b('0x4a')]=_[_0x0b2b('0x56')](_0x42fc9d['where'],{'$or':_['map'](_0x42fc9d[_0x0b2b('0x43')],function(_0x13f41f){var _0x1644fb={};_0x1644fb[_0x13f41f]={'$like':'%'+_0x5c97a1[_0x0b2b('0x3f')]['filter']+'%'};return _0x1644fb;})});}_0x42fc9d=_['merge']({},_0x42fc9d,_0x5c97a1[_0x0b2b('0x4e')]);return _0x126827[_0x0b2b('0x96')](_0x42fc9d);}})[_0x0b2b('0x2e')](function(_0x22f09b){if(_0x22f09b){_0x453604=_0x22f09b[_0x0b2b('0x45')];if(!_0x5c97a1[_0x0b2b('0x3f')][_0x0b2b('0x46')]('nolimit')){_0x42fc9d[_0x0b2b('0x27')]=qs[_0x0b2b('0x27')](_0x5c97a1[_0x0b2b('0x3f')][_0x0b2b('0x27')]);_0x42fc9d[_0x0b2b('0x26')]=qs['offset'](_0x5c97a1['query']['offset']);}return _0x126827['getAgents'](_0x42fc9d);}})[_0x0b2b('0x2e')](function(_0x1c6e5c){if(_0x1c6e5c){return _0x1c6e5c?{'count':_0x453604,'rows':_0x1c6e5c}:null;}})[_0x0b2b('0x2e')](respondWithResult(_0x30f665,null))[_0x0b2b('0x53')](handleError(_0x30f665,null));}; \ No newline at end of file +var _0x5c0e=['removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','end','count','offset','status','set','Content-Range','json','apply','reject','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','MailQueues','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','UserMailQueue','MailQueueId','findAndCountAll','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','value','isEmpty','emit','userMailQueue:remove','addAgents','omit','spread'];(function(_0x43c114,_0x39820c){var _0x1c3a66=function(_0x130b0d){while(--_0x130b0d){_0x43c114['push'](_0x43c114['shift']());}};_0x1c3a66(++_0x39820c);}(_0x5c0e,0x90));var _0xe5c0=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0x5c0e[_0xa8369a];return _0x4b74b7;};'use strict';var pdf=require(_0xe5c0('0x0'));var emlformat=require(_0xe5c0('0x1'));var rimraf=require(_0xe5c0('0x2'));var zipdir=require(_0xe5c0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5c0('0x4'));var moment=require(_0xe5c0('0x5'));var BPromise=require(_0xe5c0('0x6'));var Mustache=require('mustache');var util=require(_0xe5c0('0x7'));var path=require(_0xe5c0('0x8'));var sox=require(_0xe5c0('0x9'));var csv=require(_0xe5c0('0xa'));var ejs=require(_0xe5c0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe5c0('0xc'));var crypto=require(_0xe5c0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe5c0('0xe'));var toCsv=require(_0xe5c0('0xa'));var querystring=require('querystring');var Papa=require(_0xe5c0('0xf'));var Redis=require(_0xe5c0('0x10'));var authService=require(_0xe5c0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe5c0('0x12'));var hardwareService=require(_0xe5c0('0x13'));var logger=require(_0xe5c0('0x14'))(_0xe5c0('0x15'));var utils=require(_0xe5c0('0x16'));var config=require(_0xe5c0('0x17'));var db=require(_0xe5c0('0x18'))['db'];config[_0xe5c0('0x19')]=_['defaults'](config[_0xe5c0('0x19')],{'host':_0xe5c0('0x1a'),'port':0x18eb});var socket=require(_0xe5c0('0x1b'))(new Redis(config['redis']));require('./mailQueue.socket')[_0xe5c0('0x1c')](socket);function respondWithStatusCode(_0x49c850,_0x5e227f){_0x5e227f=_0x5e227f||0xcc;return function(_0x59132e){if(_0x59132e){return _0x49c850['sendStatus'](_0x5e227f);}return _0x49c850['status'](_0x5e227f)[_0xe5c0('0x1d')]();};}function respondWithResult(_0x6fa982,_0x1a937d){_0x1a937d=_0x1a937d||0xc8;return function(_0x3191bc){if(_0x3191bc){return _0x6fa982['status'](_0x1a937d)['json'](_0x3191bc);}};}function respondWithFilteredResult(_0x1d711f,_0x44810c){return function(_0x33709d){if(_0x33709d){var _0x23e45a=_0x33709d[_0xe5c0('0x1e')],_0x1cda54=_0x44810c['offset'],_0x484c53=_0x44810c[_0xe5c0('0x1f')]+_0x44810c['limit'],_0x22ceb9;if(_0x484c53>=_0x23e45a){_0x484c53=_0x23e45a;_0x22ceb9=0xc8;}else{_0x22ceb9=0xce;}_0x1d711f[_0xe5c0('0x20')](_0x22ceb9);return _0x1d711f[_0xe5c0('0x21')](_0xe5c0('0x22'),_0x1cda54+'-'+_0x484c53+'/'+_0x23e45a)[_0xe5c0('0x23')](_0x33709d);}return null;};}function patchUpdates(_0x3b3106){return function(_0x5f3dfe){try{jsonpatch[_0xe5c0('0x24')](_0x5f3dfe,_0x3b3106,!![]);}catch(_0x49debc){return BPromise[_0xe5c0('0x25')](_0x49debc);}return _0x5f3dfe['save']();};}function saveUpdates(_0x8c87d,_0x2410fd){return function(_0x52b574){if(_0x52b574){return _0x52b574['update'](_0x8c87d)['then'](function(_0x12dd87){return _0x12dd87;});}return null;};}function removeEntity(_0x1bb621,_0x4008ad){return function(_0x495c61){if(_0x495c61){return _0x495c61['destroy']()[_0xe5c0('0x26')](function(){var _0xa46e5c=_0x495c61[_0xe5c0('0x27')]({'plain':!![]});var _0x1f8b95='MailQueues';return db[_0xe5c0('0x28')][_0xe5c0('0x29')]({'where':{'type':_0x1f8b95,'resourceId':_0xa46e5c['id']}})['then'](function(){return _0x495c61;});})['then'](function(){_0x1bb621[_0xe5c0('0x20')](0xcc)[_0xe5c0('0x1d')]();});}};}function handleEntityNotFound(_0x1df175,_0x2ea38f){return function(_0x2fedd6){if(!_0x2fedd6){_0x1df175[_0xe5c0('0x2a')](0x194);}return _0x2fedd6;};}function handleError(_0x53d78c,_0x5ae405){_0x5ae405=_0x5ae405||0x1f4;return function(_0x499097){logger['error'](_0x499097[_0xe5c0('0x2b')]);if(_0x499097[_0xe5c0('0x2c')]){delete _0x499097[_0xe5c0('0x2c')];}_0x53d78c['status'](_0x5ae405)[_0xe5c0('0x2d')](_0x499097);};}exports[_0xe5c0('0x2e')]=function(_0x5b505a,_0x4c7258){var _0x4092ce={},_0x330df5={},_0x5a72f9={'count':0x0,'rows':[]};var _0x2f8f72=_['map'](db[_0xe5c0('0x2f')][_0xe5c0('0x30')],function(_0x5b8661){return{'name':_0x5b8661[_0xe5c0('0x31')],'type':_0x5b8661[_0xe5c0('0x32')][_0xe5c0('0x33')]};});_0x330df5[_0xe5c0('0x34')]=_[_0xe5c0('0x35')](_0x2f8f72,_0xe5c0('0x2c'));_0x330df5['query']=_[_0xe5c0('0x36')](_0x5b505a[_0xe5c0('0x37')]);_0x330df5[_0xe5c0('0x38')]=_[_0xe5c0('0x39')](_0x330df5[_0xe5c0('0x34')],_0x330df5[_0xe5c0('0x37')]);_0x4092ce['attributes']=_[_0xe5c0('0x39')](_0x330df5[_0xe5c0('0x34')],qs[_0xe5c0('0x3a')](_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x3a')]));_0x4092ce['attributes']=_0x4092ce['attributes'][_0xe5c0('0x3b')]?_0x4092ce[_0xe5c0('0x3c')]:_0x330df5[_0xe5c0('0x34')];if(!_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x3d')](_0xe5c0('0x3e'))){_0x4092ce['limit']=qs[_0xe5c0('0x3f')](_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x3f')]);_0x4092ce['offset']=qs[_0xe5c0('0x1f')](_0x5b505a['query'][_0xe5c0('0x1f')]);}_0x4092ce[_0xe5c0('0x40')]=qs[_0xe5c0('0x41')](_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x41')]);_0x4092ce[_0xe5c0('0x42')]=qs[_0xe5c0('0x38')](_[_0xe5c0('0x43')](_0x5b505a[_0xe5c0('0x37')],_0x330df5[_0xe5c0('0x38')]));if(_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x44')]){_0x4092ce[_0xe5c0('0x42')]=_['merge'](_0x4092ce[_0xe5c0('0x42')],{'$or':_[_0xe5c0('0x35')](_0x2f8f72,function(_0x2e6f7b){if(_0x2e6f7b[_0xe5c0('0x32')]!==_0xe5c0('0x45')){var _0x371fc2={};_0x371fc2[_0x2e6f7b[_0xe5c0('0x2c')]]={'$like':'%'+_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x44')]+'%'};return _0x371fc2;}})});}_0x4092ce=_[_0xe5c0('0x46')]({},_0x4092ce,_0x5b505a[_0xe5c0('0x47')]);var _0x56f755={'where':_0x4092ce[_0xe5c0('0x42')]};return db['MailQueue'][_0xe5c0('0x1e')](_0x56f755)[_0xe5c0('0x26')](function(_0x508bb8){_0x5a72f9[_0xe5c0('0x1e')]=_0x508bb8;if(_0x5b505a[_0xe5c0('0x37')][_0xe5c0('0x48')]){_0x4092ce[_0xe5c0('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0xe5c0('0x4a')](_0x4092ce);})[_0xe5c0('0x26')](function(_0x5b3eeb){_0x5a72f9[_0xe5c0('0x4b')]=_0x5b3eeb;return _0x5a72f9;})['then'](respondWithFilteredResult(_0x4c7258,_0x4092ce))['catch'](handleError(_0x4c7258,null));};exports[_0xe5c0('0x4c')]=function(_0x2b3721,_0x391950){var _0xa60eaa={'raw':!![],'where':{'id':_0x2b3721[_0xe5c0('0x4d')]['id']}},_0x12ca5e={};_0x12ca5e[_0xe5c0('0x34')]=_[_0xe5c0('0x36')](db[_0xe5c0('0x2f')]['rawAttributes']);_0x12ca5e[_0xe5c0('0x37')]=_[_0xe5c0('0x36')](_0x2b3721[_0xe5c0('0x37')]);_0x12ca5e[_0xe5c0('0x38')]=_[_0xe5c0('0x39')](_0x12ca5e[_0xe5c0('0x34')],_0x12ca5e[_0xe5c0('0x37')]);_0xa60eaa[_0xe5c0('0x3c')]=_['intersection'](_0x12ca5e[_0xe5c0('0x34')],qs['fields'](_0x2b3721['query'][_0xe5c0('0x3a')]));_0xa60eaa[_0xe5c0('0x3c')]=_0xa60eaa[_0xe5c0('0x3c')][_0xe5c0('0x3b')]?_0xa60eaa['attributes']:_0x12ca5e['model'];if(_0x2b3721[_0xe5c0('0x37')][_0xe5c0('0x48')]){_0xa60eaa[_0xe5c0('0x49')]=[{'all':!![]}];}_0xa60eaa=_[_0xe5c0('0x46')]({},_0xa60eaa,_0x2b3721[_0xe5c0('0x47')]);return db['MailQueue'][_0xe5c0('0x4e')](_0xa60eaa)[_0xe5c0('0x26')](handleEntityNotFound(_0x391950,null))[_0xe5c0('0x26')](respondWithResult(_0x391950,null))[_0xe5c0('0x4f')](handleError(_0x391950,null));};exports[_0xe5c0('0x50')]=function(_0x5258e7,_0x221a33){return db[_0xe5c0('0x2f')]['create'](_0x5258e7[_0xe5c0('0x51')],{})[_0xe5c0('0x26')](function(_0x38f3cc){var _0xa39723=_0x5258e7[_0xe5c0('0x52')]['get']({'plain':!![]});if(!_0xa39723)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa39723[_0xe5c0('0x53')]===_0xe5c0('0x52')){var _0x266c7c=_0x38f3cc[_0xe5c0('0x27')]({'plain':!![]});var _0x56e765=_0xe5c0('0x54');return db[_0xe5c0('0x55')][_0xe5c0('0x4e')]({'where':{'name':_0x56e765,'userProfileId':_0xa39723[_0xe5c0('0x56')]},'raw':!![]})[_0xe5c0('0x26')](function(_0x55de9d){if(_0x55de9d&&_0x55de9d['autoAssociation']===0x0){return db[_0xe5c0('0x28')][_0xe5c0('0x50')]({'name':_0x266c7c[_0xe5c0('0x2c')],'resourceId':_0x266c7c['id'],'type':_0x55de9d[_0xe5c0('0x2c')],'sectionId':_0x55de9d['id']},{})[_0xe5c0('0x26')](function(){return _0x38f3cc;});}else{return _0x38f3cc;}})[_0xe5c0('0x4f')](function(_0x1a0582){logger[_0xe5c0('0x57')](_0xe5c0('0x58'),_0x1a0582);throw _0x1a0582;});}return _0x38f3cc;})[_0xe5c0('0x26')](respondWithResult(_0x221a33,0xc9))[_0xe5c0('0x4f')](handleError(_0x221a33,null));};exports['update']=function(_0x290d81,_0x4bce3a){if(_0x290d81['body']['id']){delete _0x290d81[_0xe5c0('0x51')]['id'];}return db['MailQueue'][_0xe5c0('0x4e')]({'where':{'id':_0x290d81[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x4bce3a,null))[_0xe5c0('0x26')](saveUpdates(_0x290d81['body'],null))['then'](respondWithResult(_0x4bce3a,null))[_0xe5c0('0x4f')](handleError(_0x4bce3a,null));};exports[_0xe5c0('0x29')]=function(_0x18c163,_0x5ed292){return db[_0xe5c0('0x2f')][_0xe5c0('0x4e')]({'where':{'id':_0x18c163[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x5ed292,null))[_0xe5c0('0x26')](removeEntity(_0x5ed292,null))[_0xe5c0('0x4f')](handleError(_0x5ed292,null));};exports['describe']=function(_0x139e7f,_0x43a025){return db[_0xe5c0('0x2f')]['describe']()['then'](respondWithResult(_0x43a025,null))[_0xe5c0('0x4f')](handleError(_0x43a025,null));};exports['getMembers']=function(_0xb27ec2,_0x35cf34,_0x91834f){var _0x21c029={'raw':!![],'where':{}},_0x5e7810={},_0x467f51;return db['MailQueue'][_0xe5c0('0x59')]({'where':{'id':_0xb27ec2[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x35cf34,null))[_0xe5c0('0x26')](function(_0xe7a6e){if(_0xe7a6e){_0x467f51=_0xe7a6e[_0xe5c0('0x27')]({'plain':!![]});_0x5e7810[_0xe5c0('0x34')]=_['keys'](db[_0xe5c0('0x5a')][_0xe5c0('0x30')]);_0x5e7810[_0xe5c0('0x37')]=_[_0xe5c0('0x36')](_0xb27ec2['query']);_0x5e7810['filters']=_['intersection'](_0x5e7810[_0xe5c0('0x34')],_0x5e7810['query']);_0x21c029[_0xe5c0('0x3c')]=_[_0xe5c0('0x39')](_0x5e7810[_0xe5c0('0x34')],qs[_0xe5c0('0x3a')](_0xb27ec2[_0xe5c0('0x37')][_0xe5c0('0x3a')]));_0x21c029[_0xe5c0('0x3c')]=_0x21c029[_0xe5c0('0x3c')]['length']?_0x21c029['attributes']:_0x5e7810['model'];if(!_0xb27ec2[_0xe5c0('0x37')]['hasOwnProperty']('nolimit')){_0x21c029[_0xe5c0('0x3f')]=qs['limit'](_0xb27ec2['query'][_0xe5c0('0x3f')]);_0x21c029[_0xe5c0('0x1f')]=qs[_0xe5c0('0x1f')](_0xb27ec2[_0xe5c0('0x37')][_0xe5c0('0x1f')]);}_0x21c029[_0xe5c0('0x40')]=qs[_0xe5c0('0x41')](_0xb27ec2[_0xe5c0('0x37')]['sort']);_0x21c029[_0xe5c0('0x42')]=qs['filters'](_['pick'](_0xb27ec2[_0xe5c0('0x37')],_0x5e7810[_0xe5c0('0x38')]));_0x21c029[_0xe5c0('0x42')][_0xe5c0('0x5b')]=_0xe7a6e['id'];if(_0xb27ec2[_0xe5c0('0x37')]['filter']){_0x21c029[_0xe5c0('0x42')]=_[_0xe5c0('0x46')](_0x21c029[_0xe5c0('0x42')],{'$or':_[_0xe5c0('0x35')](_0x21c029[_0xe5c0('0x3c')],function(_0xd610cc){var _0x559a56={};_0x559a56[_0xd610cc]={'$like':'%'+_0xb27ec2['query'][_0xe5c0('0x44')]+'%'};return _0x559a56;})});}_0x21c029=_[_0xe5c0('0x46')]({},_0x21c029,_0xb27ec2[_0xe5c0('0x47')]);return db[_0xe5c0('0x5a')][_0xe5c0('0x4a')](_0x21c029);}})['then'](function(_0x1bc0c6){if(_0x1bc0c6){return db['User'][_0xe5c0('0x5c')]({'where':{'id':_[_0xe5c0('0x35')](_0x1bc0c6,'UserId'),'role':'agent'},'attributes':['id',_0xe5c0('0x2c'),_0xe5c0('0x5d'),_0xe5c0('0x5e'),_0xe5c0('0x5f')]});}})[_0xe5c0('0x26')](function(_0xdf3455){if(_0xdf3455){return{'count':_0xdf3455['count'],'rows':_['map'](_0xdf3455[_0xe5c0('0x4b')],function(_0x446dc6){return{'membername':_0x446dc6[_0xe5c0('0x2c')],'UserId':_0x446dc6['id'],'queue_name':_0x467f51[_0xe5c0('0x2c')],'MailQueueId':_0x467f51['id'],'interface':util[_0xe5c0('0x60')](_0xe5c0('0x61'),_0xe5c0('0x62'),_0x446dc6[_0xe5c0('0x2c')]),'penalty':0x0,'paused':_0x446dc6[_0xe5c0('0x5d')],'createdAt':_0x446dc6[_0xe5c0('0x5f')],'updatedAt':_0x446dc6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe5c0('0x26')](respondWithFilteredResult(_0x35cf34,_0x21c029))[_0xe5c0('0x4f')](handleError(_0x35cf34,null));};exports[_0xe5c0('0x63')]=function(_0xa95b59,_0x31622c,_0x468a15){var _0x4da721={};var _0x3b0d3d={};var _0x5bc1d8;var _0x47605d;return db[_0xe5c0('0x2f')]['findOne']({'where':{'id':_0xa95b59[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x31622c,null))[_0xe5c0('0x26')](function(_0x3af830){if(_0x3af830){_0x5bc1d8=_0x3af830;_0x3b0d3d[_0xe5c0('0x34')]=_['keys'](db[_0xe5c0('0x64')][_0xe5c0('0x30')]);_0x3b0d3d[_0xe5c0('0x37')]=_[_0xe5c0('0x36')](_0xa95b59[_0xe5c0('0x37')]);_0x3b0d3d[_0xe5c0('0x38')]=_[_0xe5c0('0x39')](_0x3b0d3d['model'],_0x3b0d3d[_0xe5c0('0x37')]);_0x4da721[_0xe5c0('0x3c')]=_[_0xe5c0('0x39')](_0x3b0d3d[_0xe5c0('0x34')],qs['fields'](_0xa95b59[_0xe5c0('0x37')][_0xe5c0('0x3a')]));_0x4da721[_0xe5c0('0x3c')]=_0x4da721[_0xe5c0('0x3c')]['length']?_0x4da721[_0xe5c0('0x3c')]:_0x3b0d3d['model'];_0x4da721['order']=qs[_0xe5c0('0x41')](_0xa95b59[_0xe5c0('0x37')]['sort']);_0x4da721[_0xe5c0('0x42')]=qs[_0xe5c0('0x38')](_['pick'](_0xa95b59[_0xe5c0('0x37')],_0x3b0d3d[_0xe5c0('0x38')]));if(_0xa95b59['query'][_0xe5c0('0x44')]){_0x4da721[_0xe5c0('0x42')]=_[_0xe5c0('0x46')](_0x4da721['where'],{'$or':_[_0xe5c0('0x35')](_0x4da721['attributes'],function(_0x5b8107){var _0x4e6bf1={};_0x4e6bf1[_0x5b8107]={'$like':'%'+_0xa95b59[_0xe5c0('0x37')][_0xe5c0('0x44')]+'%'};return _0x4e6bf1;})});}_0x4da721=_[_0xe5c0('0x46')]({},_0x4da721,_0xa95b59[_0xe5c0('0x47')]);return _0x5bc1d8[_0xe5c0('0x63')](_0x4da721);}})[_0xe5c0('0x26')](function(_0x4e474a){if(_0x4e474a){_0x47605d=_0x4e474a[_0xe5c0('0x3b')];if(!_0xa95b59[_0xe5c0('0x37')][_0xe5c0('0x3d')]('nolimit')){_0x4da721[_0xe5c0('0x3f')]=qs[_0xe5c0('0x3f')](_0xa95b59[_0xe5c0('0x37')][_0xe5c0('0x3f')]);_0x4da721['offset']=qs[_0xe5c0('0x1f')](_0xa95b59[_0xe5c0('0x37')][_0xe5c0('0x1f')]);}return _0x5bc1d8[_0xe5c0('0x63')](_0x4da721);}})[_0xe5c0('0x26')](function(_0x31bf4d){if(_0x31bf4d){return _0x31bf4d?{'count':_0x47605d,'rows':_0x31bf4d}:null;}})[_0xe5c0('0x26')](respondWithResult(_0x31622c,null))['catch'](handleError(_0x31622c,null));};exports[_0xe5c0('0x65')]=function(_0x3135e5,_0x42b2c2,_0x56351e){var _0x4fb83e=_0x3135e5[_0xe5c0('0x51')][_0xe5c0('0x66')];return db[_0xe5c0('0x64')][_0xe5c0('0x4a')]({'where':{'id':_0x4fb83e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe5c0('0x67'),'attributes':['id',_0xe5c0('0x2c'),_0xe5c0('0x68'),_0xe5c0('0x69'),_0xe5c0('0x6a')],'raw':!![]}]})['then'](function(_0x3a3fad){if(_0x3a3fad){var _0x4efc1e=_['flatMap'](_0x3a3fad,function(_0x183fbd){var _0x2cfb79=_0x183fbd[_0xe5c0('0x27')]({'plain':!![]});return _0x2cfb79['Agents'];});return db[_0xe5c0('0x2f')]['find']({'where':{'id':_0x3135e5[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](function(_0xd1f453){return db[_0xe5c0('0x6b')][_0xe5c0('0x6c')](function(_0x4127b1){return _0xd1f453[_0xe5c0('0x65')](_0x4fb83e,{'transaction':_0x4127b1})[_0xe5c0('0x26')](function(){return BPromise[_0xe5c0('0x6d')](_0x4efc1e,function(_0x45fac2){return db[_0xe5c0('0x5a')][_0xe5c0('0x6e')]({'where':{'UserId':_0x45fac2['id'],'MailQueueId':_0x3135e5[_0xe5c0('0x4d')]['id']},'transaction':_0x4127b1});});})['then'](function(){_0x4efc1e[_0xe5c0('0x6f')](function(_0x4266ca){socket['emit'](_0xe5c0('0x70'),{'UserId':_0x4266ca['id'],'MailQueueId':_0xd1f453['id']});});});});});}})['then'](respondWithStatusCode(_0x42b2c2,null))[_0xe5c0('0x4f')](handleError(_0x42b2c2,null));};exports[_0xe5c0('0x71')]=function(_0x55ce7f,_0x47303c,_0x41925c){return db[_0xe5c0('0x64')][_0xe5c0('0x4a')]({'where':{'id':_0x55ce7f[_0xe5c0('0x37')][_0xe5c0('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe5c0('0x72')],'as':_0xe5c0('0x67'),'attributes':['id'],'raw':!![]}]})[_0xe5c0('0x26')](handleEntityNotFound(_0x47303c,null))[_0xe5c0('0x26')](function(_0x12892f){var _0x47c90b=_[_0xe5c0('0x35')](_0x12892f,'id');var _0xe6e172=[];var _0x4549ca=[];var _0x2a2b95=squel[_0xe5c0('0x73')]();_0x2a2b95[_0xe5c0('0x74')](_0xe5c0('0x75'))[_0xe5c0('0x76')](_0xe5c0('0x77'),'tq')['join'](_0xe5c0('0x78'),'ut',_0xe5c0('0x79'))[_0xe5c0('0x42')](_0xe5c0('0x7a'),_0x55ce7f[_0xe5c0('0x4d')]['id']);for(var _0x1c6e1c=0x0;_0x1c6e1c<_0x12892f[_0xe5c0('0x3b')];_0x1c6e1c+=0x1){let _0x113f62=_0x12892f[_0x1c6e1c];for(var _0x3a691a=0x0;_0x3a691a<_0x113f62['Agents'][_0xe5c0('0x3b')];_0x3a691a+=0x1){let _0x1e211e=_0x113f62['Agents'][_0x3a691a];var _0x1fde29=_0x2a2b95['clone']();_0x1fde29[_0xe5c0('0x42')](_0xe5c0('0x7b'),_0x1e211e['id']);_0x4549ca[_0xe5c0('0x7c')](db['sequelize'][_0xe5c0('0x37')](_0x1fde29[_0xe5c0('0x7d')](),{'type':db['sequelize'][_0xe5c0('0x7e')]['SELECT']})[_0xe5c0('0x26')](function(_0x4fe14f){if(_0x4fe14f[_0xe5c0('0x3b')]===0x1){return _0x1e211e['id'];}else{var _0x3216e1=_[_0xe5c0('0x7f')](_['map'](_0x4fe14f,_0xe5c0('0x80')),function(_0x265543){return _['includes'](_0x47c90b,_0x265543);});if(_0x3216e1){return _0x1e211e['id'];}}}));}}return BPromise[_0xe5c0('0x81')](_0x4549ca)[_0xe5c0('0x26')](function(_0x4a02dd){_0xe6e172=_(_0xe6e172)[_0xe5c0('0x82')](_0x4a02dd)['compact']()[_0xe5c0('0x83')]();return db['MailQueue'][_0xe5c0('0x4e')]({'where':{'id':_0x55ce7f[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](function(_0x4377d2){return db[_0xe5c0('0x6b')][_0xe5c0('0x6c')](function(_0x225175){return _0x4377d2[_0xe5c0('0x71')](_0x55ce7f[_0xe5c0('0x37')]['ids'],{'transaction':_0x225175})['then'](function(){if(!_[_0xe5c0('0x84')](_0xe6e172)){return _0x4377d2['removeAgents'](_0xe6e172,{'transaction':_0x225175});}})['then'](function(){_0xe6e172[_0xe5c0('0x6f')](function(_0x6f0ce3){socket[_0xe5c0('0x85')](_0xe5c0('0x86'),{'UserId':_0x6f0ce3,'MailQueueId':_0x4377d2['id']});});});});});});})['then'](respondWithStatusCode(_0x47303c,null))['catch'](handleError(_0x47303c,null));};exports[_0xe5c0('0x87')]=function(_0x192d15,_0x395a41,_0x87eae7){return db[_0xe5c0('0x2f')][_0xe5c0('0x4e')]({'where':{'id':_0x192d15[_0xe5c0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x395a41,null))['then'](function(_0x2e3940){if(_0x2e3940){return _0x2e3940['addAgents'](_0x192d15['body'][_0xe5c0('0x66')],_[_0xe5c0('0x88')](_0x192d15[_0xe5c0('0x51')],[_0xe5c0('0x66'),'id'])||{})[_0xe5c0('0x89')](function(_0x268672){for(var _0x595ee4=0x0;_0x595ee4<_0x192d15[_0xe5c0('0x51')][_0xe5c0('0x66')][_0xe5c0('0x3b')];_0x595ee4+=0x1){socket[_0xe5c0('0x85')](_0xe5c0('0x70'),{'UserId':_0x192d15[_0xe5c0('0x51')][_0xe5c0('0x66')][_0x595ee4],'MailQueueId':_0x192d15['params']['id']});}return _0x268672;});}})[_0xe5c0('0x26')](respondWithResult(_0x395a41,null))[_0xe5c0('0x4f')](handleError(_0x395a41,null));};exports['removeAgents']=function(_0x25ad79,_0x333526,_0x44f814){return db[_0xe5c0('0x2f')][_0xe5c0('0x4e')]({'where':{'id':_0x25ad79[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x333526,null))[_0xe5c0('0x26')](function(_0x108449){if(_0x108449){return _0x108449[_0xe5c0('0x8a')](_0x25ad79[_0xe5c0('0x37')][_0xe5c0('0x66')])[_0xe5c0('0x26')](function(){if(_[_0xe5c0('0x8b')](_0x25ad79[_0xe5c0('0x37')][_0xe5c0('0x66')])){for(var _0x20a71c=0x0;_0x20a71c<_0x25ad79['query'][_0xe5c0('0x66')][_0xe5c0('0x3b')];_0x20a71c+=0x1){socket[_0xe5c0('0x85')]('userMailQueue:remove',{'UserId':Number(_0x25ad79[_0xe5c0('0x37')][_0xe5c0('0x66')][_0x20a71c]),'MailQueueId':Number(_0x25ad79[_0xe5c0('0x4d')]['id'])});}}else{socket['emit'](_0xe5c0('0x86'),{'UserId':Number(_0x25ad79['query'][_0xe5c0('0x66')]),'MailQueueId':Number(_0x25ad79[_0xe5c0('0x4d')]['id'])});}});}})[_0xe5c0('0x26')](respondWithStatusCode(_0x333526,null))[_0xe5c0('0x4f')](handleError(_0x333526,null));};exports[_0xe5c0('0x8c')]=function(_0x40bb16,_0x15e0bf,_0x390ebb){var _0x224466={};var _0x540f29={};var _0x5ca223;var _0x4fb6b9;return db[_0xe5c0('0x2f')][_0xe5c0('0x59')]({'where':{'id':_0x40bb16[_0xe5c0('0x4d')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x15e0bf,null))[_0xe5c0('0x26')](function(_0x195207){if(_0x195207){_0x5ca223=_0x195207;_0x540f29[_0xe5c0('0x34')]=_['keys'](db['User'][_0xe5c0('0x30')]);_0x540f29['query']=_[_0xe5c0('0x36')](_0x40bb16['query']);_0x540f29[_0xe5c0('0x38')]=_[_0xe5c0('0x39')](_0x540f29['model'],_0x540f29['query']);_0x224466[_0xe5c0('0x3c')]=_[_0xe5c0('0x39')](_0x540f29[_0xe5c0('0x34')],qs[_0xe5c0('0x3a')](_0x40bb16[_0xe5c0('0x37')][_0xe5c0('0x3a')]));_0x224466[_0xe5c0('0x3c')]=_0x224466[_0xe5c0('0x3c')][_0xe5c0('0x3b')]?_0x224466['attributes']:_0x540f29['model'];_0x224466['order']=qs[_0xe5c0('0x41')](_0x40bb16[_0xe5c0('0x37')][_0xe5c0('0x41')]);_0x224466[_0xe5c0('0x42')]=qs[_0xe5c0('0x38')](_['pick'](_0x40bb16[_0xe5c0('0x37')],_0x540f29[_0xe5c0('0x38')]));if(_0x40bb16[_0xe5c0('0x37')]['filter']){_0x224466[_0xe5c0('0x42')]=_[_0xe5c0('0x46')](_0x224466[_0xe5c0('0x42')],{'$or':_['map'](_0x224466[_0xe5c0('0x3c')],function(_0x356b66){var _0x18ebdb={};_0x18ebdb[_0x356b66]={'$like':'%'+_0x40bb16[_0xe5c0('0x37')][_0xe5c0('0x44')]+'%'};return _0x18ebdb;})});}_0x224466=_[_0xe5c0('0x46')]({},_0x224466,_0x40bb16[_0xe5c0('0x47')]);return _0x5ca223[_0xe5c0('0x8c')](_0x224466);}})['then'](function(_0x37fe2f){if(_0x37fe2f){_0x4fb6b9=_0x37fe2f[_0xe5c0('0x3b')];if(!_0x40bb16[_0xe5c0('0x37')]['hasOwnProperty']('nolimit')){_0x224466[_0xe5c0('0x3f')]=qs[_0xe5c0('0x3f')](_0x40bb16[_0xe5c0('0x37')][_0xe5c0('0x3f')]);_0x224466[_0xe5c0('0x1f')]=qs[_0xe5c0('0x1f')](_0x40bb16['query'][_0xe5c0('0x1f')]);}return _0x5ca223[_0xe5c0('0x8c')](_0x224466);}})['then'](function(_0x2277f2){if(_0x2277f2){return _0x2277f2?{'count':_0x4fb6b9,'rows':_0x2277f2}:null;}})['then'](respondWithResult(_0x15e0bf,null))[_0xe5c0('0x4f')](handleError(_0x15e0bf,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d350f55..39cb850 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 _0x5565=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x55f7fd,_0x5b6e15){var _0x29738b=function(_0x238603){while(--_0x238603){_0x55f7fd['push'](_0x55f7fd['shift']());}};_0x29738b(++_0x5b6e15);}(_0x5565,0x1d3));var _0x5556=function(_0x2ee01c,_0xb5f33){_0x2ee01c=_0x2ee01c-0x0;var _0x66f86d=_0x5565[_0x2ee01c];return _0x66f86d;};'use strict';var EventEmitter=require(_0x5556('0x0'));var MailQueue=require(_0x5556('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5556('0x2')](0x0);var events={'afterCreate':_0x5556('0x3'),'afterUpdate':_0x5556('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8232f5){return function(_0x2471de,_0x4e6d5c,_0xf1cfa1){MailQueueEvents[_0x5556('0x5')](_0x8232f5+':'+_0x2471de['id'],_0x2471de);MailQueueEvents[_0x5556('0x5')](_0x8232f5,_0x2471de);_0xf1cfa1(null);};}for(var e in events){if(events[_0x5556('0x6')](e)){var event=events[e];MailQueue[_0x5556('0x7')](e,emitEvent(event));}}module[_0x5556('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x1d52=['update','remove','hasOwnProperty','hook','exports','events','MailQueue','save'];(function(_0x31de4a,_0x7277db){var _0x1bc351=function(_0x50f607){while(--_0x50f607){_0x31de4a['push'](_0x31de4a['shift']());}};_0x1bc351(++_0x7277db);}(_0x1d52,0x115));var _0x21d5=function(_0x33bc0f,_0x4d9838){_0x33bc0f=_0x33bc0f-0x0;var _0x3a5e9e=_0x1d52[_0x33bc0f];return _0x3a5e9e;};'use strict';var EventEmitter=require(_0x21d5('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x21d5('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x21d5('0x2'),'afterUpdate':_0x21d5('0x3'),'afterDestroy':_0x21d5('0x4')};function emitEvent(_0x10f859){return function(_0x441d4c,_0x2e45d8,_0x42ec7a){MailQueueEvents['emit'](_0x10f859+':'+_0x441d4c['id'],_0x441d4c);MailQueueEvents['emit'](_0x10f859,_0x441d4c);_0x42ec7a(null);};}for(var e in events){if(events[_0x21d5('0x5')](e)){var event=events[e];MailQueue[_0x21d5('0x6')](e,emitEvent(event));}}module[_0x21d5('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 2274737..57afe1b 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 _0x4610=['rimraf','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5834c7,_0x596152){var _0x151d83=function(_0x14ec39){while(--_0x14ec39){_0x5834c7['push'](_0x5834c7['shift']());}};_0x151d83(++_0x596152);}(_0x4610,0x139));var _0x0461=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x4610[_0x3f6bcf];return _0x1c5350;};'use strict';var _=require('lodash');var util=require(_0x0461('0x0'));var logger=require(_0x0461('0x1'))(_0x0461('0x2'));var moment=require(_0x0461('0x3'));var BPromise=require(_0x0461('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0461('0x5'));var rimraf=require(_0x0461('0x6'));var config=require(_0x0461('0x7'));var attributes=require(_0x0461('0x8'));module['exports']=function(_0x3ccea1,_0x1feb49){return _0x3ccea1['define'](_0x0461('0x9'),attributes,{'tableName':_0x0461('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2f9=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xc2f9,0x12c));var _0x9c2f=function(_0x2498bf,_0x586d07){_0x2498bf=_0x2498bf-0x0;var _0x1b246e=_0xc2f9[_0x2498bf];return _0x1b246e;};'use strict';var _=require(_0x9c2f('0x0'));var util=require('util');var logger=require(_0x9c2f('0x1'))(_0x9c2f('0x2'));var moment=require(_0x9c2f('0x3'));var BPromise=require(_0x9c2f('0x4'));var rp=require(_0x9c2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c2f('0x6'));var config=require(_0x9c2f('0x7'));var attributes=require(_0x9c2f('0x8'));module[_0x9c2f('0x9')]=function(_0x3ae671,_0x3017d5){return _0x3ae671[_0x9c2f('0xa')]('MailQueue',attributes,{'tableName':_0x9c2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 20ae74f..1f2af88 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 _0xe9ed=['GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','then','stringify','ShowMailQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0xf2d476,_0x255c4a){var _0x5ae8e7=function(_0x192a5d){while(--_0x192a5d){_0xf2d476['push'](_0xf2d476['shift']());}};_0x5ae8e7(++_0x255c4a);}(_0xe9ed,0xff));var _0xde9e=function(_0x53395e,_0x4a434c){_0x53395e=_0x53395e-0x0;var _0x3cf74d=_0xe9ed[_0x53395e];return _0x3cf74d;};'use strict';var _=require(_0xde9e('0x0'));var util=require(_0xde9e('0x1'));var moment=require(_0xde9e('0x2'));var BPromise=require(_0xde9e('0x3'));var rs=require(_0xde9e('0x4'));var fs=require('fs');var Redis=require(_0xde9e('0x5'));var db=require(_0xde9e('0x6'))['db'];var utils=require(_0xde9e('0x7'));var logger=require('../../config/logger')(_0xde9e('0x8'));var config=require('../../config/environment');var jayson=require(_0xde9e('0x9'));var client=jayson['client'][_0xde9e('0xa')]({'port':0x232a});config[_0xde9e('0xb')]=_['defaults'](config[_0xde9e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde9e('0xb')]));require(_0xde9e('0xc'))[_0xde9e('0xd')](socket);function respondWithRpcPromise(_0x1dca4a,_0x4ba254,_0x128805){return new BPromise(function(_0x388aa5,_0xb1a6de){return client[_0xde9e('0xe')](_0x1dca4a,_0x128805)['then'](function(_0x2dbc4a){logger[_0xde9e('0xf')](_0xde9e('0x10'),_0x4ba254,'request\x20sent');logger[_0xde9e('0x11')](_0xde9e('0x12'),_0x4ba254,_0xde9e('0x13'),JSON['stringify'](_0x2dbc4a));if(_0x2dbc4a['error']){if(_0x2dbc4a[_0xde9e('0x14')][_0xde9e('0x15')]===0x1f4){logger[_0xde9e('0x14')](_0xde9e('0x10'),_0x4ba254,_0x2dbc4a[_0xde9e('0x14')][_0xde9e('0x16')]);return _0xb1a6de(_0x2dbc4a[_0xde9e('0x14')][_0xde9e('0x16')]);}logger[_0xde9e('0x14')](_0xde9e('0x10'),_0x4ba254,_0x2dbc4a[_0xde9e('0x14')][_0xde9e('0x16')]);return _0x388aa5(_0x2dbc4a[_0xde9e('0x14')][_0xde9e('0x16')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x4ba254,'request\x20sent');_0x388aa5(_0x2dbc4a[_0xde9e('0x17')][_0xde9e('0x16')]);}})[_0xde9e('0x18')](function(_0x5077bf){logger[_0xde9e('0x14')](_0xde9e('0x10'),_0x4ba254,_0x5077bf);_0xb1a6de(_0x5077bf);});});}exports[_0xde9e('0x19')]=function(_0x5e2aaa){var _0x28027f=this;return new Promise(function(_0x4b2c95,_0x8612f4){return db[_0xde9e('0x1a')][_0xde9e('0x1b')]({'raw':_0x5e2aaa[_0xde9e('0x1c')]?_0x5e2aaa[_0xde9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5e2aaa[_0xde9e('0x1c')]?_0x5e2aaa[_0xde9e('0x1c')]['where']||null:null,'attributes':_0x5e2aaa[_0xde9e('0x1c')]?_0x5e2aaa[_0xde9e('0x1c')][_0xde9e('0x1d')]||null:null,'limit':_0x5e2aaa[_0xde9e('0x1c')]?_0x5e2aaa[_0xde9e('0x1c')][_0xde9e('0x1e')]||null:null,'include':_0x5e2aaa[_0xde9e('0x1c')]?_0x5e2aaa[_0xde9e('0x1c')][_0xde9e('0x1f')]?_[_0xde9e('0x20')](_0x5e2aaa[_0xde9e('0x1c')][_0xde9e('0x1f')],function(_0x937fee){return{'model':db[_0x937fee[_0xde9e('0x21')]],'as':_0x937fee['as'],'attributes':_0x937fee[_0xde9e('0x1d')],'include':_0x937fee[_0xde9e('0x1f')]?_['map'](_0x937fee[_0xde9e('0x1f')],function(_0x397067){return{'model':db[_0x397067[_0xde9e('0x21')]],'as':_0x397067['as'],'attributes':_0x397067[_0xde9e('0x1d')],'include':_0x397067[_0xde9e('0x1f')]?_[_0xde9e('0x20')](_0x397067[_0xde9e('0x1f')],function(_0x21263d){return{'model':db[_0x21263d[_0xde9e('0x21')]],'as':_0x21263d['as'],'attributes':_0x21263d['attributes']};}):[]};}):[]};}):[]:[]})[_0xde9e('0x22')](function(_0xc01322){logger[_0xde9e('0xf')](_0xde9e('0x19'),_0x5e2aaa);logger[_0xde9e('0x11')](_0xde9e('0x19'),_0x5e2aaa,JSON[_0xde9e('0x23')](_0xc01322));_0x4b2c95(_0xc01322);})['catch'](function(_0x4efd8b){logger['error'](_0xde9e('0x19'),_0x4efd8b[_0xde9e('0x16')],_0x5e2aaa);_0x8612f4(_0x28027f['error'](0x1f4,_0x4efd8b[_0xde9e('0x16')]));});});};exports[_0xde9e('0x24')]=function(_0x11b3e8){var _0x49252b=this;return new Promise(function(_0x19816d,_0x3ac656){return db['MailQueue'][_0xde9e('0x25')]({'raw':_0x11b3e8[_0xde9e('0x1c')]?_0x11b3e8[_0xde9e('0x1c')][_0xde9e('0x26')]===undefined?!![]:![]:!![],'where':_0x11b3e8[_0xde9e('0x1c')]?_0x11b3e8[_0xde9e('0x1c')][_0xde9e('0x27')]||null:null,'attributes':_0x11b3e8[_0xde9e('0x1c')]?_0x11b3e8[_0xde9e('0x1c')][_0xde9e('0x1d')]||null:null,'include':_0x11b3e8[_0xde9e('0x1c')]?_0x11b3e8['options'][_0xde9e('0x1f')]?_[_0xde9e('0x20')](_0x11b3e8['options']['include'],function(_0x31a354){return{'model':db[_0x31a354[_0xde9e('0x21')]],'as':_0x31a354['as'],'attributes':_0x31a354[_0xde9e('0x1d')],'include':_0x31a354[_0xde9e('0x1f')]?_['map'](_0x31a354[_0xde9e('0x1f')],function(_0xf20bff){return{'model':db[_0xf20bff['model']],'as':_0xf20bff['as'],'attributes':_0xf20bff[_0xde9e('0x1d')],'include':_0xf20bff['include']?_[_0xde9e('0x20')](_0xf20bff[_0xde9e('0x1f')],function(_0x3ed255){return{'model':db[_0x3ed255['model']],'as':_0x3ed255['as'],'attributes':_0x3ed255['attributes']};}):[]};}):[]};}):[]:[]})[_0xde9e('0x22')](function(_0x466d6f){logger[_0xde9e('0xf')]('ShowMailQueue',_0x11b3e8);logger[_0xde9e('0x11')]('ShowMailQueue',_0x11b3e8,JSON['stringify'](_0x466d6f));_0x19816d(_0x466d6f);})['catch'](function(_0xc9e1ff){logger[_0xde9e('0x14')]('ShowMailQueue',_0xc9e1ff[_0xde9e('0x16')],_0x11b3e8);_0x3ac656(_0x49252b['error'](0x1f4,_0xc9e1ff[_0xde9e('0x16')]));});});}; \ No newline at end of file +var _0x21bb=['info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailQueue','options','raw','where','attributes','include','model','map','ShowMailQueue','MailQueue','find','catch','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then'];(function(_0x3bfe41,_0x2249e5){var _0x3bdb2b=function(_0x1436a9){while(--_0x1436a9){_0x3bfe41['push'](_0x3bfe41['shift']());}};_0x3bdb2b(++_0x2249e5);}(_0x21bb,0x1de));var _0xb21b=function(_0x5dc792,_0x217716){_0x5dc792=_0x5dc792-0x0;var _0x1727f8=_0x21bb[_0x5dc792];return _0x1727f8;};'use strict';var _=require('lodash');var util=require(_0xb21b('0x0'));var moment=require(_0xb21b('0x1'));var BPromise=require(_0xb21b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb21b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb21b('0x4'))('rpc');var config=require(_0xb21b('0x5'));var jayson=require(_0xb21b('0x6'));var client=jayson[_0xb21b('0x7')][_0xb21b('0x8')]({'port':0x232a});config[_0xb21b('0x9')]=_[_0xb21b('0xa')](config['redis'],{'host':_0xb21b('0xb'),'port':0x18eb});var socket=require(_0xb21b('0xc'))(new Redis(config['redis']));require(_0xb21b('0xd'))[_0xb21b('0xe')](socket);function respondWithRpcPromise(_0x217b37,_0x420ba1,_0x4a3b27){return new BPromise(function(_0x25020a,_0x2e01a7){return client['request'](_0x217b37,_0x4a3b27)[_0xb21b('0xf')](function(_0x57d01a){logger[_0xb21b('0x10')](_0xb21b('0x11'),_0x420ba1,_0xb21b('0x12'));logger[_0xb21b('0x13')](_0xb21b('0x14'),_0x420ba1,_0xb21b('0x12'),JSON[_0xb21b('0x15')](_0x57d01a));if(_0x57d01a['error']){if(_0x57d01a[_0xb21b('0x16')][_0xb21b('0x17')]===0x1f4){logger[_0xb21b('0x16')]('MailQueue,\x20%s,\x20%s',_0x420ba1,_0x57d01a['error'][_0xb21b('0x18')]);return _0x2e01a7(_0x57d01a[_0xb21b('0x16')][_0xb21b('0x18')]);}logger[_0xb21b('0x16')](_0xb21b('0x11'),_0x420ba1,_0x57d01a['error'][_0xb21b('0x18')]);return _0x25020a(_0x57d01a[_0xb21b('0x16')][_0xb21b('0x18')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x420ba1,_0xb21b('0x12'));_0x25020a(_0x57d01a[_0xb21b('0x19')][_0xb21b('0x18')]);}})['catch'](function(_0x338c5b){logger[_0xb21b('0x16')](_0xb21b('0x11'),_0x420ba1,_0x338c5b);_0x2e01a7(_0x338c5b);});});}exports[_0xb21b('0x1a')]=function(_0x5a8594){var _0x31656a=this;return new Promise(function(_0xa32a32,_0x48ac41){return db['MailQueue']['findAll']({'raw':_0x5a8594[_0xb21b('0x1b')]?_0x5a8594[_0xb21b('0x1b')][_0xb21b('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a8594[_0xb21b('0x1b')]?_0x5a8594[_0xb21b('0x1b')][_0xb21b('0x1d')]||null:null,'attributes':_0x5a8594['options']?_0x5a8594[_0xb21b('0x1b')][_0xb21b('0x1e')]||null:null,'limit':_0x5a8594[_0xb21b('0x1b')]?_0x5a8594['options']['limit']||null:null,'include':_0x5a8594[_0xb21b('0x1b')]?_0x5a8594[_0xb21b('0x1b')][_0xb21b('0x1f')]?_['map'](_0x5a8594[_0xb21b('0x1b')][_0xb21b('0x1f')],function(_0x141567){return{'model':db[_0x141567[_0xb21b('0x20')]],'as':_0x141567['as'],'attributes':_0x141567[_0xb21b('0x1e')],'include':_0x141567[_0xb21b('0x1f')]?_[_0xb21b('0x21')](_0x141567[_0xb21b('0x1f')],function(_0x306bd8){return{'model':db[_0x306bd8['model']],'as':_0x306bd8['as'],'attributes':_0x306bd8['attributes'],'include':_0x306bd8['include']?_[_0xb21b('0x21')](_0x306bd8[_0xb21b('0x1f')],function(_0x3ab384){return{'model':db[_0x3ab384[_0xb21b('0x20')]],'as':_0x3ab384['as'],'attributes':_0x3ab384['attributes']};}):[]};}):[]};}):[]:[]})[_0xb21b('0xf')](function(_0x47de5b){logger['info'](_0xb21b('0x1a'),_0x5a8594);logger['debug'](_0xb21b('0x1a'),_0x5a8594,JSON['stringify'](_0x47de5b));_0xa32a32(_0x47de5b);})['catch'](function(_0x12bbec){logger[_0xb21b('0x16')]('GetMailQueue',_0x12bbec[_0xb21b('0x18')],_0x5a8594);_0x48ac41(_0x31656a[_0xb21b('0x16')](0x1f4,_0x12bbec[_0xb21b('0x18')]));});});};exports[_0xb21b('0x22')]=function(_0x303476){var _0x14686b=this;return new Promise(function(_0x62506c,_0x467bdb){return db[_0xb21b('0x23')][_0xb21b('0x24')]({'raw':_0x303476[_0xb21b('0x1b')]?_0x303476[_0xb21b('0x1b')][_0xb21b('0x1c')]===undefined?!![]:![]:!![],'where':_0x303476[_0xb21b('0x1b')]?_0x303476[_0xb21b('0x1b')]['where']||null:null,'attributes':_0x303476[_0xb21b('0x1b')]?_0x303476[_0xb21b('0x1b')][_0xb21b('0x1e')]||null:null,'include':_0x303476[_0xb21b('0x1b')]?_0x303476[_0xb21b('0x1b')][_0xb21b('0x1f')]?_[_0xb21b('0x21')](_0x303476[_0xb21b('0x1b')][_0xb21b('0x1f')],function(_0x5291f5){return{'model':db[_0x5291f5['model']],'as':_0x5291f5['as'],'attributes':_0x5291f5[_0xb21b('0x1e')],'include':_0x5291f5[_0xb21b('0x1f')]?_[_0xb21b('0x21')](_0x5291f5[_0xb21b('0x1f')],function(_0x3f1e98){return{'model':db[_0x3f1e98[_0xb21b('0x20')]],'as':_0x3f1e98['as'],'attributes':_0x3f1e98[_0xb21b('0x1e')],'include':_0x3f1e98[_0xb21b('0x1f')]?_['map'](_0x3f1e98[_0xb21b('0x1f')],function(_0x354d32){return{'model':db[_0x354d32[_0xb21b('0x20')]],'as':_0x354d32['as'],'attributes':_0x354d32[_0xb21b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ec0dc){logger[_0xb21b('0x10')](_0xb21b('0x22'),_0x303476);logger['debug']('ShowMailQueue',_0x303476,JSON['stringify'](_0x4ec0dc));_0x62506c(_0x4ec0dc);})[_0xb21b('0x25')](function(_0x3536f1){logger[_0xb21b('0x16')](_0xb21b('0x22'),_0x3536f1[_0xb21b('0x18')],_0x303476);_0x467bdb(_0x14686b[_0xb21b('0x16')](0x1f4,_0x3536f1[_0xb21b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5b88a32..a6bacd1 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 _0xa1b6=['save','remove','update','emit','register','length','mailQueue:','./mailQueue.events'];(function(_0xf1d0a2,_0x3b260c){var _0x1e3526=function(_0x2014d2){while(--_0x2014d2){_0xf1d0a2['push'](_0xf1d0a2['shift']());}};_0x1e3526(++_0x3b260c);}(_0xa1b6,0x117));var _0x6a1b=function(_0x29bea7,_0x25160b){_0x29bea7=_0x29bea7-0x0;var _0x3c0593=_0xa1b6[_0x29bea7];return _0x3c0593;};'use strict';var MailQueueEvents=require(_0x6a1b('0x0'));var events=[_0x6a1b('0x1'),_0x6a1b('0x2'),_0x6a1b('0x3')];function createListener(_0x1d4dc0,_0x12a2e3){return function(_0x35cb8e){_0x12a2e3[_0x6a1b('0x4')](_0x1d4dc0,_0x35cb8e);};}function removeListener(_0x446729,_0x220be4){return function(){MailQueueEvents['removeListener'](_0x446729,_0x220be4);};}exports[_0x6a1b('0x5')]=function(_0x4b0e7e){for(var _0x51aac8=0x0,_0x248d8c=events[_0x6a1b('0x6')];_0x51aac8<_0x248d8c;_0x51aac8++){var _0x2b9261=events[_0x51aac8];var _0x5b84a2=createListener(_0x6a1b('0x7')+_0x2b9261,_0x4b0e7e);MailQueueEvents['on'](_0x2b9261,_0x5b84a2);}}; \ No newline at end of file +var _0xee99=['update','emit','register','length','mailQueue:','./mailQueue.events'];(function(_0x966478,_0x5b7b09){var _0x5ec091=function(_0x2fa540){while(--_0x2fa540){_0x966478['push'](_0x966478['shift']());}};_0x5ec091(++_0x5b7b09);}(_0xee99,0x14f));var _0x9ee9=function(_0x4a2052,_0x259910){_0x4a2052=_0x4a2052-0x0;var _0x2ce721=_0xee99[_0x4a2052];return _0x2ce721;};'use strict';var MailQueueEvents=require(_0x9ee9('0x0'));var events=['save','remove',_0x9ee9('0x1')];function createListener(_0x547b8e,_0xed2eb1){return function(_0x20b3c8){_0xed2eb1[_0x9ee9('0x2')](_0x547b8e,_0x20b3c8);};}function removeListener(_0x1efd6b,_0x579b3c){return function(){MailQueueEvents['removeListener'](_0x1efd6b,_0x579b3c);};}exports[_0x9ee9('0x3')]=function(_0x237fe4){for(var _0x392d50=0x0,_0x4f026b=events[_0x9ee9('0x4')];_0x392d50<_0x4f026b;_0x392d50++){var _0x2facc2=events[_0x392d50];var _0xa122fd=createListener(_0x9ee9('0x5')+_0x2facc2,_0x237fe4);MailQueueEvents['on'](_0x2facc2,_0xa122fd);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 34a5304..14d2ac0 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 _0xe9e0=['./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x255aaf,_0x282056){var _0x145bd2=function(_0x6e8c61){while(--_0x6e8c61){_0x255aaf['push'](_0x255aaf['shift']());}};_0x145bd2(++_0x282056);}(_0xe9e0,0x7e));var _0x0e9e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe9e0[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x0e9e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0e9e('0x1'));var express=require(_0x0e9e('0x2'));var router=express[_0x0e9e('0x3')]();var auth=require(_0x0e9e('0x4'));var interaction=require(_0x0e9e('0x5'));var config=require(_0x0e9e('0x6'));var controller=require(_0x0e9e('0x7'));router[_0x0e9e('0x8')]('/',auth[_0x0e9e('0x9')](),controller[_0x0e9e('0xa')]);router[_0x0e9e('0x8')](_0x0e9e('0xb'),auth['isAuthenticated'](),controller[_0x0e9e('0xc')]);router['get'](_0x0e9e('0xd'),auth[_0x0e9e('0x9')](),controller[_0x0e9e('0xe')]);router['post']('/',auth[_0x0e9e('0x9')](),controller['create']);router[_0x0e9e('0xf')](_0x0e9e('0xd'),auth['isAuthenticated'](),controller[_0x0e9e('0x10')]);router['delete'](_0x0e9e('0xd'),auth[_0x0e9e('0x9')](),controller[_0x0e9e('0x11')]);module[_0x0e9e('0x12')]=router; \ No newline at end of file +var _0x178d=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id'];(function(_0x104e0e,_0x13a41d){var _0x39f0de=function(_0x342a26){while(--_0x342a26){_0x104e0e['push'](_0x104e0e['shift']());}};_0x39f0de(++_0x13a41d);}(_0x178d,0xeb));var _0xd178=function(_0x4d925f,_0x5c69db){_0x4d925f=_0x4d925f-0x0;var _0x3d2df8=_0x178d[_0x4d925f];return _0x3d2df8;};'use strict';var multer=require(_0xd178('0x0'));var util=require(_0xd178('0x1'));var path=require(_0xd178('0x2'));var timeout=require(_0xd178('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd178('0x4'));var interaction=require(_0xd178('0x5'));var config=require('../../config/environment');var controller=require(_0xd178('0x6'));router['get']('/',auth[_0xd178('0x7')](),controller[_0xd178('0x8')]);router[_0xd178('0x9')](_0xd178('0xa'),auth[_0xd178('0x7')](),controller[_0xd178('0xb')]);router[_0xd178('0x9')]('/:id',auth[_0xd178('0x7')](),controller[_0xd178('0xc')]);router[_0xd178('0xd')]('/',auth[_0xd178('0x7')](),controller[_0xd178('0xe')]);router[_0xd178('0xf')](_0xd178('0x10'),auth[_0xd178('0x7')](),controller[_0xd178('0x11')]);router[_0xd178('0x12')]('/:id',auth[_0xd178('0x7')](),controller[_0xd178('0x13')]);module[_0xd178('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 2337977..8303ff0 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 _0x8cdf=['DATE','moment','STRING'];(function(_0x4c12de,_0x342b3a){var _0x5ab1c9=function(_0xb81b09){while(--_0xb81b09){_0x4c12de['push'](_0x4c12de['shift']());}};_0x5ab1c9(++_0x342b3a);}(_0x8cdf,0x151));var _0xf8cd=function(_0x4282ae,_0x58abd1){_0x4282ae=_0x4282ae-0x0;var _0x3ad844=_0x8cdf[_0x4282ae];return _0x3ad844;};'use strict';var moment=require(_0xf8cd('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf8cd('0x1')]},'joinAt':{'type':Sequelize[_0xf8cd('0x2')]},'leaveAt':{'type':Sequelize[_0xf8cd('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf8cd('0x2')]},'reason':{'type':Sequelize[_0xf8cd('0x1')]}}; \ No newline at end of file +var _0x9598=['STRING','moment','sequelize','exports','DATE'];(function(_0x312b38,_0x1cfe9f){var _0x8d8abb=function(_0x1bf7ff){while(--_0x1bf7ff){_0x312b38['push'](_0x312b38['shift']());}};_0x8d8abb(++_0x1cfe9f);}(_0x9598,0x13c));var _0x8959=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x9598[_0x484e36];return _0xafc85d;};'use strict';var moment=require(_0x8959('0x0'));var Sequelize=require(_0x8959('0x1'));module[_0x8959('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8959('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8959('0x3')]},'exitAt':{'type':Sequelize[_0x8959('0x3')]},'reason':{'type':Sequelize[_0x8959('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 0fe5c5f..d1116ec 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 _0x36a2=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','keys','query'];(function(_0x4fcf29,_0x174aa2){var _0xa985ed=function(_0x43d0c0){while(--_0x43d0c0){_0x4fcf29['push'](_0x4fcf29['shift']());}};_0xa985ed(++_0x174aa2);}(_0x36a2,0x105));var _0x236a=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x36a2[_0x11f249];return _0x5c3656;};'use strict';var pdf=require(_0x236a('0x0'));var emlformat=require(_0x236a('0x1'));var rimraf=require(_0x236a('0x2'));var zipdir=require(_0x236a('0x3'));var jsonpatch=require(_0x236a('0x4'));var rp=require('request-promise');var moment=require(_0x236a('0x5'));var BPromise=require(_0x236a('0x6'));var Mustache=require(_0x236a('0x7'));var util=require('util');var path=require(_0x236a('0x8'));var sox=require(_0x236a('0x9'));var csv=require(_0x236a('0xa'));var ejs=require(_0x236a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x236a('0xc'));var crypto=require(_0x236a('0xd'));var jsforce=require(_0x236a('0xe'));var deskjs=require(_0x236a('0xf'));var toCsv=require(_0x236a('0xa'));var querystring=require(_0x236a('0x10'));var Papa=require(_0x236a('0x11'));var Redis=require(_0x236a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x236a('0x13'));var as=require(_0x236a('0x14'));var hardwareService=require(_0x236a('0x15'));var logger=require(_0x236a('0x16'))(_0x236a('0x17'));var utils=require('../../config/utils');var config=require(_0x236a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb8adb4,_0x5610df){_0x5610df=_0x5610df||0xcc;return function(_0x1385e7){if(_0x1385e7){return _0xb8adb4[_0x236a('0x19')](_0x5610df);}return _0xb8adb4[_0x236a('0x1a')](_0x5610df)['end']();};}function respondWithResult(_0x49c1b6,_0xdae799){_0xdae799=_0xdae799||0xc8;return function(_0x5ec17a){if(_0x5ec17a){return _0x49c1b6[_0x236a('0x1a')](_0xdae799)[_0x236a('0x1b')](_0x5ec17a);}};}function respondWithFilteredResult(_0x5077ae,_0x1741e6){return function(_0x150a04){if(_0x150a04){var _0x4a43a6=_0x150a04[_0x236a('0x1c')],_0x38b8a0=_0x1741e6[_0x236a('0x1d')],_0x969c10=_0x1741e6[_0x236a('0x1d')]+_0x1741e6['limit'],_0x29e524;if(_0x969c10>=_0x4a43a6){_0x969c10=_0x4a43a6;_0x29e524=0xc8;}else{_0x29e524=0xce;}_0x5077ae[_0x236a('0x1a')](_0x29e524);return _0x5077ae[_0x236a('0x1e')](_0x236a('0x1f'),_0x38b8a0+'-'+_0x969c10+'/'+_0x4a43a6)[_0x236a('0x1b')](_0x150a04);}return null;};}function patchUpdates(_0x2a09f9){return function(_0xe87e5f){try{jsonpatch[_0x236a('0x20')](_0xe87e5f,_0x2a09f9,!![]);}catch(_0x50885d){return BPromise[_0x236a('0x21')](_0x50885d);}return _0xe87e5f[_0x236a('0x22')]();};}function saveUpdates(_0x7efbe2,_0x110b59){return function(_0x5c7932){if(_0x5c7932){return _0x5c7932[_0x236a('0x23')](_0x7efbe2)['then'](function(_0x55205f){return _0x55205f;});}return null;};}function removeEntity(_0x34a342,_0x2f1517){return function(_0x8debb5){if(_0x8debb5){return _0x8debb5['destroy']()[_0x236a('0x24')](function(){_0x34a342[_0x236a('0x1a')](0xcc)[_0x236a('0x25')]();});}};}function handleEntityNotFound(_0x131325,_0x411929){return function(_0x3c2769){if(!_0x3c2769){_0x131325[_0x236a('0x19')](0x194);}return _0x3c2769;};}function handleError(_0x1521c2,_0x8a5a3){_0x8a5a3=_0x8a5a3||0x1f4;return function(_0x3cb02a){logger[_0x236a('0x26')](_0x3cb02a[_0x236a('0x27')]);if(_0x3cb02a[_0x236a('0x28')]){delete _0x3cb02a['name'];}_0x1521c2[_0x236a('0x1a')](_0x8a5a3)[_0x236a('0x29')](_0x3cb02a);};}exports[_0x236a('0x2a')]=function(_0x2c0a0d,_0x66b77d){var _0xdac439={},_0x4943dc={},_0x997a17={'count':0x0,'rows':[]};var _0x4dd8b2=_[_0x236a('0x2b')](db[_0x236a('0x2c')][_0x236a('0x2d')],function(_0x53889f){return{'name':_0x53889f['fieldName'],'type':_0x53889f[_0x236a('0x2e')][_0x236a('0x2f')]};});_0x4943dc[_0x236a('0x30')]=_[_0x236a('0x2b')](_0x4dd8b2,_0x236a('0x28'));_0x4943dc['query']=_[_0x236a('0x31')](_0x2c0a0d[_0x236a('0x32')]);_0x4943dc[_0x236a('0x33')]=_['intersection'](_0x4943dc[_0x236a('0x30')],_0x4943dc[_0x236a('0x32')]);_0xdac439[_0x236a('0x34')]=_[_0x236a('0x35')](_0x4943dc['model'],qs[_0x236a('0x36')](_0x2c0a0d[_0x236a('0x32')][_0x236a('0x36')]));_0xdac439['attributes']=_0xdac439[_0x236a('0x34')]['length']?_0xdac439[_0x236a('0x34')]:_0x4943dc[_0x236a('0x30')];if(!_0x2c0a0d[_0x236a('0x32')][_0x236a('0x37')](_0x236a('0x38'))){_0xdac439[_0x236a('0x39')]=qs[_0x236a('0x39')](_0x2c0a0d[_0x236a('0x32')][_0x236a('0x39')]);_0xdac439['offset']=qs[_0x236a('0x1d')](_0x2c0a0d[_0x236a('0x32')][_0x236a('0x1d')]);}_0xdac439[_0x236a('0x3a')]=qs[_0x236a('0x3b')](_0x2c0a0d[_0x236a('0x32')][_0x236a('0x3b')]);_0xdac439[_0x236a('0x3c')]=qs[_0x236a('0x33')](_[_0x236a('0x3d')](_0x2c0a0d[_0x236a('0x32')],_0x4943dc[_0x236a('0x33')]));if(_0x2c0a0d[_0x236a('0x32')][_0x236a('0x3e')]){_0xdac439['where']=_[_0x236a('0x3f')](_0xdac439[_0x236a('0x3c')],{'$or':_[_0x236a('0x2b')](_0x4dd8b2,function(_0x6f8c57){if(_0x6f8c57['type']!==_0x236a('0x40')){var _0x4d7146={};_0x4d7146[_0x6f8c57[_0x236a('0x28')]]={'$like':'%'+_0x2c0a0d[_0x236a('0x32')][_0x236a('0x3e')]+'%'};return _0x4d7146;}})});}_0xdac439=_[_0x236a('0x3f')]({},_0xdac439,_0x2c0a0d[_0x236a('0x41')]);var _0x59a761={'where':_0xdac439[_0x236a('0x3c')]};return db[_0x236a('0x2c')][_0x236a('0x1c')](_0x59a761)[_0x236a('0x24')](function(_0x2a3472){_0x997a17[_0x236a('0x1c')]=_0x2a3472;if(_0x2c0a0d[_0x236a('0x32')][_0x236a('0x42')]){_0xdac439[_0x236a('0x43')]=[{'all':!![]}];}return db['MailQueueReport'][_0x236a('0x44')](_0xdac439);})[_0x236a('0x24')](function(_0x370423){_0x997a17[_0x236a('0x45')]=_0x370423;return _0x997a17;})['then'](respondWithFilteredResult(_0x66b77d,_0xdac439))[_0x236a('0x46')](handleError(_0x66b77d,null));};exports[_0x236a('0x47')]=function(_0x20e6ec,_0x19e730){var _0x1efb06={'raw':!![],'where':{'id':_0x20e6ec['params']['id']}},_0x58b753={};_0x58b753[_0x236a('0x30')]=_[_0x236a('0x31')](db[_0x236a('0x2c')][_0x236a('0x2d')]);_0x58b753[_0x236a('0x32')]=_[_0x236a('0x31')](_0x20e6ec[_0x236a('0x32')]);_0x58b753[_0x236a('0x33')]=_[_0x236a('0x35')](_0x58b753[_0x236a('0x30')],_0x58b753[_0x236a('0x32')]);_0x1efb06['attributes']=_['intersection'](_0x58b753[_0x236a('0x30')],qs[_0x236a('0x36')](_0x20e6ec['query'][_0x236a('0x36')]));_0x1efb06[_0x236a('0x34')]=_0x1efb06[_0x236a('0x34')][_0x236a('0x48')]?_0x1efb06[_0x236a('0x34')]:_0x58b753[_0x236a('0x30')];if(_0x20e6ec[_0x236a('0x32')][_0x236a('0x42')]){_0x1efb06['include']=[{'all':!![]}];}_0x1efb06=_[_0x236a('0x3f')]({},_0x1efb06,_0x20e6ec[_0x236a('0x41')]);return db['MailQueueReport'][_0x236a('0x49')](_0x1efb06)[_0x236a('0x24')](handleEntityNotFound(_0x19e730,null))[_0x236a('0x24')](respondWithResult(_0x19e730,null))[_0x236a('0x46')](handleError(_0x19e730,null));};exports[_0x236a('0x4a')]=function(_0x3687ac,_0x5c6e1f){return db[_0x236a('0x2c')]['create'](_0x3687ac[_0x236a('0x4b')],{})[_0x236a('0x24')](respondWithResult(_0x5c6e1f,0xc9))['catch'](handleError(_0x5c6e1f,null));};exports[_0x236a('0x23')]=function(_0x15013f,_0x39cb08){if(_0x15013f[_0x236a('0x4b')]['id']){delete _0x15013f[_0x236a('0x4b')]['id'];}return db[_0x236a('0x2c')][_0x236a('0x49')]({'where':{'id':_0x15013f[_0x236a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x39cb08,null))[_0x236a('0x24')](saveUpdates(_0x15013f[_0x236a('0x4b')],null))[_0x236a('0x24')](respondWithResult(_0x39cb08,null))[_0x236a('0x46')](handleError(_0x39cb08,null));};exports['destroy']=function(_0x77583f,_0x2ded8e){return db[_0x236a('0x2c')][_0x236a('0x49')]({'where':{'id':_0x77583f[_0x236a('0x4c')]['id']}})[_0x236a('0x24')](handleEntityNotFound(_0x2ded8e,null))['then'](removeEntity(_0x2ded8e,null))[_0x236a('0x46')](handleError(_0x2ded8e,null));};exports[_0x236a('0x4d')]=function(_0x30f66d,_0x3398b3){return db[_0x236a('0x2c')][_0x236a('0x4d')]()['then'](respondWithResult(_0x3398b3,null))[_0x236a('0x46')](handleError(_0x3398b3,null));}; \ No newline at end of file +var _0x0bce=['destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailQueueReport','includeAll','include','findAll','rows','catch','keys','create','body','find','params','describe','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x1ff3d2,_0x50970e){var _0x4d92ec=function(_0x5bd037){while(--_0x5bd037){_0x1ff3d2['push'](_0x1ff3d2['shift']());}};_0x4d92ec(++_0x50970e);}(_0x0bce,0x1e1));var _0xe0bc=function(_0x804022,_0x1c1df1){_0x804022=_0x804022-0x0;var _0xf804a8=_0x0bce[_0x804022];return _0xf804a8;};'use strict';var pdf=require(_0xe0bc('0x0'));var emlformat=require(_0xe0bc('0x1'));var rimraf=require(_0xe0bc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe0bc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe0bc('0x4'));var util=require(_0xe0bc('0x5'));var path=require(_0xe0bc('0x6'));var sox=require(_0xe0bc('0x7'));var csv=require('to-csv');var ejs=require(_0xe0bc('0x8'));var fs=require('fs');var _=require(_0xe0bc('0x9'));var squel=require('squel');var crypto=require(_0xe0bc('0xa'));var jsforce=require(_0xe0bc('0xb'));var deskjs=require(_0xe0bc('0xc'));var toCsv=require(_0xe0bc('0xd'));var querystring=require(_0xe0bc('0xe'));var Papa=require('papaparse');var Redis=require(_0xe0bc('0xf'));var authService=require(_0xe0bc('0x10'));var qs=require(_0xe0bc('0x11'));var as=require(_0xe0bc('0x12'));var hardwareService=require(_0xe0bc('0x13'));var logger=require(_0xe0bc('0x14'))('api');var utils=require(_0xe0bc('0x15'));var config=require(_0xe0bc('0x16'));var db=require(_0xe0bc('0x17'))['db'];function respondWithStatusCode(_0x34f99a,_0x7b26cf){_0x7b26cf=_0x7b26cf||0xcc;return function(_0x1f7efa){if(_0x1f7efa){return _0x34f99a[_0xe0bc('0x18')](_0x7b26cf);}return _0x34f99a[_0xe0bc('0x19')](_0x7b26cf)[_0xe0bc('0x1a')]();};}function respondWithResult(_0x51676e,_0x32c5cb){_0x32c5cb=_0x32c5cb||0xc8;return function(_0x4fade6){if(_0x4fade6){return _0x51676e['status'](_0x32c5cb)[_0xe0bc('0x1b')](_0x4fade6);}};}function respondWithFilteredResult(_0xfdbcfe,_0x5ddde1){return function(_0x273c78){if(_0x273c78){var _0x3e3f61=_0x273c78[_0xe0bc('0x1c')],_0x1fb262=_0x5ddde1[_0xe0bc('0x1d')],_0x1d7db6=_0x5ddde1[_0xe0bc('0x1d')]+_0x5ddde1[_0xe0bc('0x1e')],_0x20fc9f;if(_0x1d7db6>=_0x3e3f61){_0x1d7db6=_0x3e3f61;_0x20fc9f=0xc8;}else{_0x20fc9f=0xce;}_0xfdbcfe[_0xe0bc('0x19')](_0x20fc9f);return _0xfdbcfe[_0xe0bc('0x1f')](_0xe0bc('0x20'),_0x1fb262+'-'+_0x1d7db6+'/'+_0x3e3f61)[_0xe0bc('0x1b')](_0x273c78);}return null;};}function patchUpdates(_0x3f6d1e){return function(_0x2008b5){try{jsonpatch[_0xe0bc('0x21')](_0x2008b5,_0x3f6d1e,!![]);}catch(_0x2bd6f6){return BPromise[_0xe0bc('0x22')](_0x2bd6f6);}return _0x2008b5['save']();};}function saveUpdates(_0x23c405,_0xe0c1d4){return function(_0x56e7d6){if(_0x56e7d6){return _0x56e7d6[_0xe0bc('0x23')](_0x23c405)[_0xe0bc('0x24')](function(_0x2bc314){return _0x2bc314;});}return null;};}function removeEntity(_0x325f1b,_0x18df49){return function(_0x234232){if(_0x234232){return _0x234232[_0xe0bc('0x25')]()[_0xe0bc('0x24')](function(){_0x325f1b[_0xe0bc('0x19')](0xcc)[_0xe0bc('0x1a')]();});}};}function handleEntityNotFound(_0x2be0fd,_0x2a7164){return function(_0x4e8cbf){if(!_0x4e8cbf){_0x2be0fd[_0xe0bc('0x18')](0x194);}return _0x4e8cbf;};}function handleError(_0xbd527b,_0x292073){_0x292073=_0x292073||0x1f4;return function(_0x2b43b0){logger[_0xe0bc('0x26')](_0x2b43b0[_0xe0bc('0x27')]);if(_0x2b43b0[_0xe0bc('0x28')]){delete _0x2b43b0['name'];}_0xbd527b[_0xe0bc('0x19')](_0x292073)[_0xe0bc('0x29')](_0x2b43b0);};}exports[_0xe0bc('0x2a')]=function(_0x183036,_0x5b0533){var _0x4f69f9={},_0x5610f={},_0x484a86={'count':0x0,'rows':[]};var _0x43cfdb=_[_0xe0bc('0x2b')](db['MailQueueReport']['rawAttributes'],function(_0x54e717){return{'name':_0x54e717[_0xe0bc('0x2c')],'type':_0x54e717[_0xe0bc('0x2d')][_0xe0bc('0x2e')]};});_0x5610f[_0xe0bc('0x2f')]=_[_0xe0bc('0x2b')](_0x43cfdb,_0xe0bc('0x28'));_0x5610f[_0xe0bc('0x30')]=_['keys'](_0x183036[_0xe0bc('0x30')]);_0x5610f[_0xe0bc('0x31')]=_['intersection'](_0x5610f['model'],_0x5610f[_0xe0bc('0x30')]);_0x4f69f9[_0xe0bc('0x32')]=_[_0xe0bc('0x33')](_0x5610f[_0xe0bc('0x2f')],qs[_0xe0bc('0x34')](_0x183036[_0xe0bc('0x30')][_0xe0bc('0x34')]));_0x4f69f9[_0xe0bc('0x32')]=_0x4f69f9['attributes'][_0xe0bc('0x35')]?_0x4f69f9['attributes']:_0x5610f[_0xe0bc('0x2f')];if(!_0x183036[_0xe0bc('0x30')][_0xe0bc('0x36')]('nolimit')){_0x4f69f9[_0xe0bc('0x1e')]=qs['limit'](_0x183036[_0xe0bc('0x30')][_0xe0bc('0x1e')]);_0x4f69f9[_0xe0bc('0x1d')]=qs[_0xe0bc('0x1d')](_0x183036['query'][_0xe0bc('0x1d')]);}_0x4f69f9[_0xe0bc('0x37')]=qs[_0xe0bc('0x38')](_0x183036[_0xe0bc('0x30')][_0xe0bc('0x38')]);_0x4f69f9[_0xe0bc('0x39')]=qs['filters'](_[_0xe0bc('0x3a')](_0x183036['query'],_0x5610f[_0xe0bc('0x31')]));if(_0x183036[_0xe0bc('0x30')][_0xe0bc('0x3b')]){_0x4f69f9[_0xe0bc('0x39')]=_[_0xe0bc('0x3c')](_0x4f69f9[_0xe0bc('0x39')],{'$or':_['map'](_0x43cfdb,function(_0x12eb82){if(_0x12eb82[_0xe0bc('0x2d')]!=='VIRTUAL'){var _0x5e0c1a={};_0x5e0c1a[_0x12eb82[_0xe0bc('0x28')]]={'$like':'%'+_0x183036[_0xe0bc('0x30')][_0xe0bc('0x3b')]+'%'};return _0x5e0c1a;}})});}_0x4f69f9=_[_0xe0bc('0x3c')]({},_0x4f69f9,_0x183036[_0xe0bc('0x3d')]);var _0x1d18c7={'where':_0x4f69f9[_0xe0bc('0x39')]};return db[_0xe0bc('0x3e')][_0xe0bc('0x1c')](_0x1d18c7)[_0xe0bc('0x24')](function(_0x27a560){_0x484a86[_0xe0bc('0x1c')]=_0x27a560;if(_0x183036[_0xe0bc('0x30')][_0xe0bc('0x3f')]){_0x4f69f9[_0xe0bc('0x40')]=[{'all':!![]}];}return db[_0xe0bc('0x3e')][_0xe0bc('0x41')](_0x4f69f9);})['then'](function(_0x22bf0e){_0x484a86[_0xe0bc('0x42')]=_0x22bf0e;return _0x484a86;})[_0xe0bc('0x24')](respondWithFilteredResult(_0x5b0533,_0x4f69f9))[_0xe0bc('0x43')](handleError(_0x5b0533,null));};exports['show']=function(_0x587917,_0xd8aa60){var _0x2f83b1={'raw':!![],'where':{'id':_0x587917['params']['id']}},_0x99f2cc={};_0x99f2cc['model']=_['keys'](db[_0xe0bc('0x3e')]['rawAttributes']);_0x99f2cc[_0xe0bc('0x30')]=_[_0xe0bc('0x44')](_0x587917[_0xe0bc('0x30')]);_0x99f2cc[_0xe0bc('0x31')]=_['intersection'](_0x99f2cc[_0xe0bc('0x2f')],_0x99f2cc['query']);_0x2f83b1[_0xe0bc('0x32')]=_[_0xe0bc('0x33')](_0x99f2cc['model'],qs[_0xe0bc('0x34')](_0x587917[_0xe0bc('0x30')][_0xe0bc('0x34')]));_0x2f83b1[_0xe0bc('0x32')]=_0x2f83b1[_0xe0bc('0x32')]['length']?_0x2f83b1['attributes']:_0x99f2cc[_0xe0bc('0x2f')];if(_0x587917[_0xe0bc('0x30')][_0xe0bc('0x3f')]){_0x2f83b1['include']=[{'all':!![]}];}_0x2f83b1=_['merge']({},_0x2f83b1,_0x587917[_0xe0bc('0x3d')]);return db[_0xe0bc('0x3e')]['find'](_0x2f83b1)[_0xe0bc('0x24')](handleEntityNotFound(_0xd8aa60,null))[_0xe0bc('0x24')](respondWithResult(_0xd8aa60,null))[_0xe0bc('0x43')](handleError(_0xd8aa60,null));};exports[_0xe0bc('0x45')]=function(_0x55a7c8,_0x225330){return db['MailQueueReport'][_0xe0bc('0x45')](_0x55a7c8[_0xe0bc('0x46')],{})[_0xe0bc('0x24')](respondWithResult(_0x225330,0xc9))[_0xe0bc('0x43')](handleError(_0x225330,null));};exports[_0xe0bc('0x23')]=function(_0x505e7a,_0x3f419c){if(_0x505e7a['body']['id']){delete _0x505e7a[_0xe0bc('0x46')]['id'];}return db[_0xe0bc('0x3e')][_0xe0bc('0x47')]({'where':{'id':_0x505e7a[_0xe0bc('0x48')]['id']}})[_0xe0bc('0x24')](handleEntityNotFound(_0x3f419c,null))[_0xe0bc('0x24')](saveUpdates(_0x505e7a[_0xe0bc('0x46')],null))[_0xe0bc('0x24')](respondWithResult(_0x3f419c,null))[_0xe0bc('0x43')](handleError(_0x3f419c,null));};exports[_0xe0bc('0x25')]=function(_0x23b1ee,_0x3f75cd){return db[_0xe0bc('0x3e')][_0xe0bc('0x47')]({'where':{'id':_0x23b1ee['params']['id']}})[_0xe0bc('0x24')](handleEntityNotFound(_0x3f75cd,null))[_0xe0bc('0x24')](removeEntity(_0x3f75cd,null))[_0xe0bc('0x43')](handleError(_0x3f75cd,null));};exports[_0xe0bc('0x49')]=function(_0x20b9f9,_0x3a075d){return db[_0xe0bc('0x3e')][_0xe0bc('0x49')]()[_0xe0bc('0x24')](respondWithResult(_0x3a075d,null))['catch'](handleError(_0x3a075d,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d2fb366..3b2e74d 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 _0x617a=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x617a,0x129));var _0xa617=function(_0x3c5b45,_0x5ec647){_0x3c5b45=_0x3c5b45-0x0;var _0x320b6c=_0x617a[_0x3c5b45];return _0x320b6c;};'use strict';var _=require(_0xa617('0x0'));var util=require('util');var logger=require(_0xa617('0x1'))(_0xa617('0x2'));var moment=require(_0xa617('0x3'));var BPromise=require(_0xa617('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa617('0x5'));var rimraf=require('rimraf');var config=require(_0xa617('0x6'));var attributes=require(_0xa617('0x7'));module[_0xa617('0x8')]=function(_0x29af77,_0x25f5eb){return _0x29af77[_0xa617('0x9')](_0xa617('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x62c8=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0xae0cef,_0x2dcd7c){var _0x56307c=function(_0xe080f1){while(--_0xe080f1){_0xae0cef['push'](_0xae0cef['shift']());}};_0x56307c(++_0x2dcd7c);}(_0x62c8,0x1ad));var _0x862c=function(_0x43b62a,_0x20648a){_0x43b62a=_0x43b62a-0x0;var _0x14358=_0x62c8[_0x43b62a];return _0x14358;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x862c('0x0'))('api');var moment=require('moment');var BPromise=require(_0x862c('0x1'));var rp=require(_0x862c('0x2'));var fs=require('fs');var path=require(_0x862c('0x3'));var rimraf=require(_0x862c('0x4'));var config=require(_0x862c('0x5'));var attributes=require(_0x862c('0x6'));module['exports']=function(_0x335320,_0x2c6929){return _0x335320[_0x862c('0x7')](_0x862c('0x8'),attributes,{'tableName':_0x862c('0x9'),'paranoid':![],'indexes':[{'name':_0x862c('0xa'),'fields':[_0x862c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 1b6e19d..589680a 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 _0x01d9=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','options','stringify','UpdateMailQueueReport','update','body','raw'];(function(_0x4787de,_0x43cac4){var _0x3e14b4=function(_0x2da45b){while(--_0x2da45b){_0x4787de['push'](_0x4787de['shift']());}};_0x3e14b4(++_0x43cac4);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')](_0x285353['body'],{'raw':_0x285353[_0x901d('0x1a')]?_0x285353[_0x901d('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x496a06){logger['info'](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')]('CreateMailQueueReport',_0x285353,JSON[_0x901d('0x1b')](_0x496a06));_0x38f42b(_0x496a06);})[_0x901d('0x16')](function(_0x488e24){logger[_0x901d('0x12')](_0x901d('0x17'),_0x488e24[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x488e24[_0x901d('0x14')]));});});};exports[_0x901d('0x1c')]=function(_0x46e5c6){var _0x45b6a8=this;return new Promise(function(_0x4c1318,_0x196a76){return db[_0x901d('0x18')][_0x901d('0x1d')](_0x46e5c6[_0x901d('0x1e')],{'raw':_0x46e5c6['options']?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e5c6[_0x901d('0x1a')]?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x20')]||null:null,'attributes':_0x46e5c6['options']?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x21')]||null:null,'limit':_0x46e5c6[_0x901d('0x1a')]?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x22')]||null:null})[_0x901d('0xd')](function(_0x48e86e){logger[_0x901d('0xe')]('UpdateMailQueueReport',_0x46e5c6);logger[_0x901d('0x11')](_0x901d('0x1c'),_0x46e5c6,JSON[_0x901d('0x1b')](_0x48e86e));_0x4c1318(_0x48e86e);})[_0x901d('0x16')](function(_0x1b1c17){logger[_0x901d('0x12')](_0x901d('0x1c'),_0x1b1c17[_0x901d('0x14')],_0x46e5c6);_0x196a76(_0x45b6a8[_0x901d('0x12')](0x1f4,_0x1b1c17[_0x901d('0x14')]));});});}; \ No newline at end of file +var _0x1623=['catch','CreateMailQueueReport','MailQueueReport','create','body','options','update','raw','where','limit','UpdateMailQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueueReport,\x20%s,\x20%s','message','result'];(function(_0x23bca9,_0x590fef){var _0x5eb135=function(_0x5e2e39){while(--_0x5e2e39){_0x23bca9['push'](_0x23bca9['shift']());}};_0x5eb135(++_0x590fef);}(_0x1623,0xab));var _0x3162=function(_0x23ff50,_0x542ed5){_0x23ff50=_0x23ff50-0x0;var _0x1e4d10=_0x1623[_0x23ff50];return _0x1e4d10;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('MailQueueReport,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('MailQueueReport,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')](_0x1eed46[_0x3162('0x19')],{'raw':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xa5c62b){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger['debug']('CreateMailQueueReport',_0x1eed46,JSON[_0x3162('0xf')](_0xa5c62b));_0x4b2bf3(_0xa5c62b);})[_0x3162('0x15')](function(_0x32c051){logger[_0x3162('0x10')](_0x3162('0x16'),_0x32c051[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97[_0x3162('0x10')](0x1f4,_0x32c051[_0x3162('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0xd283d6){var _0x2433f8=this;return new Promise(function(_0x3919e7,_0x1fd76f){return db[_0x3162('0x17')][_0x3162('0x1b')](_0xd283d6[_0x3162('0x19')],{'raw':_0xd283d6[_0x3162('0x1a')]?_0xd283d6[_0x3162('0x1a')][_0x3162('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd283d6[_0x3162('0x1a')]?_0xd283d6[_0x3162('0x1a')][_0x3162('0x1d')]||null:null,'attributes':_0xd283d6['options']?_0xd283d6[_0x3162('0x1a')]['attributes']||null:null,'limit':_0xd283d6[_0x3162('0x1a')]?_0xd283d6[_0x3162('0x1a')][_0x3162('0x1e')]||null:null})['then'](function(_0x4903e7){logger[_0x3162('0xb')](_0x3162('0x1f'),_0xd283d6);logger[_0x3162('0xc')](_0x3162('0x1f'),_0xd283d6,JSON[_0x3162('0xf')](_0x4903e7));_0x3919e7(_0x4903e7);})['catch'](function(_0x8a7bce){logger['error'](_0x3162('0x1f'),_0x8a7bce[_0x3162('0x13')],_0xd283d6);_0x1fd76f(_0x2433f8[_0x3162('0x10')](0x1f4,_0x8a7bce[_0x3162('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 9f04fb2..ae594bc 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 _0xd2df=['../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0xd2df,0x1bb));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xfd2d('0x0'));var path=require(_0xfd2d('0x1'));var timeout=require(_0xfd2d('0x2'));var express=require(_0xfd2d('0x3'));var router=express['Router']();var auth=require(_0xfd2d('0x4'));var interaction=require(_0xfd2d('0x5'));var config=require(_0xfd2d('0x6'));module[_0xfd2d('0x7')]=router; \ No newline at end of file +var _0x8e84=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x8e84,0x195));var _0x48e8=function(_0x54edc4,_0x11c7d5){_0x54edc4=_0x54edc4-0x0;var _0x37f202=_0x8e84[_0x54edc4];return _0x37f202;};'use strict';var multer=require(_0x48e8('0x0'));var util=require(_0x48e8('0x1'));var path=require(_0x48e8('0x2'));var timeout=require(_0x48e8('0x3'));var express=require(_0x48e8('0x4'));var router=express[_0x48e8('0x5')]();var auth=require(_0x48e8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x48e8('0x7'));module[_0x48e8('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 626b5d3..994d077 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 _0x1fe3=['username','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1fe3,0x1c5));var _0x31fe=function(_0xc840e8,_0x4d57fc){_0xc840e8=_0xc840e8-0x0;var _0x91bbb7=_0x1fe3[_0xc840e8];return _0x91bbb7;};'use strict';var Sequelize=require(_0x31fe('0x0'));module[_0x31fe('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x31fe('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x31fe('0x2')],'unique':_0x31fe('0x3')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x31fe('0x4')]},'tls':{'type':Sequelize[_0x31fe('0x5')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x31fe('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x31fe('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcea8=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xcea8,0x18e));var _0x8cea=function(_0x487177,_0x1ddcd6){_0x487177=_0x487177-0x0;var _0x147202=_0xcea8[_0x487177];return _0x147202;};'use strict';var Sequelize=require(_0x8cea('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x8cea('0x1')]},'authentication':{'type':Sequelize[_0x8cea('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8cea('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x8cea('0x3')]},'tls':{'type':Sequelize[_0x8cea('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8cea('0x1')],'defaultValue':_0x8cea('0x4')},'connTimeout':{'type':Sequelize[_0x8cea('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8cea('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8cea('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 55261af..464f3e8 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 _0xb688=['exports','MailServerIn','mail_servers_in','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x6ff0e8,_0x2a3ea2){var _0x38c58a=function(_0x128be4){while(--_0x128be4){_0x6ff0e8['push'](_0x6ff0e8['shift']());}};_0x38c58a(++_0x2a3ea2);}(_0xb688,0xcf));var _0x8b68=function(_0x401c55,_0x263c8f){_0x401c55=_0x401c55-0x0;var _0x3c1595=_0xb688[_0x401c55];return _0x3c1595;};'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 _0xea28=['../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x34e709,_0x59b732){var _0x6ec2ff=function(_0x254865){while(--_0x254865){_0x34e709['push'](_0x34e709['shift']());}};_0x6ec2ff(++_0x59b732);}(_0xea28,0x13a));var _0x8ea2=function(_0x3bb88e,_0x579375){_0x3bb88e=_0x3bb88e-0x0;var _0x485ff1=_0xea28[_0x3bb88e];return _0x485ff1;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 964d403..e2f0125 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 _0x009e=['http','request','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4665f7,_0x14ba78){var _0x3df6d9=function(_0x1e21a6){while(--_0x1e21a6){_0x4665f7['push'](_0x4665f7['shift']());}};_0x3df6d9(++_0x14ba78);}(_0x009e,0x100));var _0xe009=function(_0x454b36,_0x74cac4){_0x454b36=_0x454b36-0x0;var _0x389b43=_0x009e[_0x454b36];return _0x389b43;};'use strict';var _=require(_0xe009('0x0'));var util=require(_0xe009('0x1'));var moment=require(_0xe009('0x2'));var BPromise=require('bluebird');var rs=require(_0xe009('0x3'));var fs=require('fs');var Redis=require(_0xe009('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe009('0x5'));var logger=require(_0xe009('0x6'))('rpc');var config=require(_0xe009('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe009('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13de8e,_0x38d83e,_0x18c023){return new BPromise(function(_0x58e3ae,_0x51fb5f){return client[_0xe009('0x9')](_0x13de8e,_0x18c023)['then'](function(_0xf37863){logger[_0xe009('0xa')](_0xe009('0xb'),_0x38d83e,'request\x20sent');logger[_0xe009('0xc')](_0xe009('0xd'),_0x38d83e,_0xe009('0xe'),JSON['stringify'](_0xf37863));if(_0xf37863[_0xe009('0xf')]){if(_0xf37863[_0xe009('0xf')][_0xe009('0x10')]===0x1f4){logger[_0xe009('0xf')](_0xe009('0xb'),_0x38d83e,_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);return _0x51fb5f(_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);}logger[_0xe009('0xf')]('MailServerIn,\x20%s,\x20%s',_0x38d83e,_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);return _0x58e3ae(_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);}else{logger[_0xe009('0xa')](_0xe009('0xb'),_0x38d83e,_0xe009('0xe'));_0x58e3ae(_0xf37863[_0xe009('0x12')][_0xe009('0x11')]);}})[_0xe009('0x13')](function(_0x5608e2){logger['error'](_0xe009('0xb'),_0x38d83e,_0x5608e2);_0x51fb5f(_0x5608e2);});});}exports[_0xe009('0x14')]=function(_0x11c522){var _0x17a24d=this;return new Promise(function(_0x456176,_0x49299e){return db[_0xe009('0x15')][_0xe009('0x16')]({'raw':_0x11c522[_0xe009('0x17')]?_0x11c522[_0xe009('0x17')][_0xe009('0x18')]===undefined?!![]:![]:!![],'where':_0x11c522['options']?_0x11c522[_0xe009('0x17')][_0xe009('0x19')]||null:null,'attributes':_0x11c522['options']?_0x11c522[_0xe009('0x17')][_0xe009('0x1a')]||null:null,'limit':_0x11c522[_0xe009('0x17')]?_0x11c522[_0xe009('0x17')][_0xe009('0x1b')]||null:null,'include':_0x11c522[_0xe009('0x17')]?_0x11c522[_0xe009('0x17')][_0xe009('0x1c')]?_[_0xe009('0x1d')](_0x11c522[_0xe009('0x17')][_0xe009('0x1c')],function(_0xbec0d5){return{'model':db[_0xbec0d5[_0xe009('0x1e')]],'as':_0xbec0d5['as'],'attributes':_0xbec0d5[_0xe009('0x1a')],'include':_0xbec0d5[_0xe009('0x1c')]?_[_0xe009('0x1d')](_0xbec0d5[_0xe009('0x1c')],function(_0x20cb17){return{'model':db[_0x20cb17[_0xe009('0x1e')]],'as':_0x20cb17['as'],'attributes':_0x20cb17['attributes'],'include':_0x20cb17[_0xe009('0x1c')]?_[_0xe009('0x1d')](_0x20cb17[_0xe009('0x1c')],function(_0x475f15){return{'model':db[_0x475f15[_0xe009('0x1e')]],'as':_0x475f15['as'],'attributes':_0x475f15[_0xe009('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe009('0x1f')](function(_0x1b5057){logger['info'](_0xe009('0x14'),_0x11c522);logger[_0xe009('0xc')](_0xe009('0x14'),_0x11c522,JSON[_0xe009('0x20')](_0x1b5057));_0x456176(_0x1b5057);})[_0xe009('0x13')](function(_0x64f245){logger[_0xe009('0xf')]('GetMailServerIn',_0x64f245[_0xe009('0x11')],_0x11c522);_0x49299e(_0x17a24d['error'](0x1f4,_0x64f245[_0xe009('0x11')]));});});}; \ No newline at end of file +var _0x6197=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','MailServerIn','options','raw','attributes','limit','include','model','map','GetMailServerIn','stringify','catch','lodash','util','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6197,0x150));var _0x7619=function(_0x28052a,_0x262fa2){_0x28052a=_0x28052a-0x0;var _0x20614a=_0x6197[_0x28052a];return _0x20614a;};'use strict';var _=require(_0x7619('0x0'));var util=require(_0x7619('0x1'));var moment=require(_0x7619('0x2'));var BPromise=require(_0x7619('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7619('0x4'));var db=require(_0x7619('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7619('0x6'))(_0x7619('0x7'));var config=require(_0x7619('0x8'));var jayson=require(_0x7619('0x9'));var client=jayson[_0x7619('0xa')][_0x7619('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x543eca,_0x19f2cf,_0x5cf1d3){return new BPromise(function(_0x9ed3c,_0xfd2135){return client[_0x7619('0xc')](_0x543eca,_0x5cf1d3)[_0x7619('0xd')](function(_0x278540){logger[_0x7619('0xe')](_0x7619('0xf'),_0x19f2cf,_0x7619('0x10'));logger[_0x7619('0x11')](_0x7619('0x12'),_0x19f2cf,_0x7619('0x10'),JSON['stringify'](_0x278540));if(_0x278540[_0x7619('0x13')]){if(_0x278540[_0x7619('0x13')][_0x7619('0x14')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x19f2cf,_0x278540[_0x7619('0x13')][_0x7619('0x15')]);return _0xfd2135(_0x278540[_0x7619('0x13')][_0x7619('0x15')]);}logger[_0x7619('0x13')](_0x7619('0xf'),_0x19f2cf,_0x278540[_0x7619('0x13')][_0x7619('0x15')]);return _0x9ed3c(_0x278540['error'][_0x7619('0x15')]);}else{logger[_0x7619('0xe')](_0x7619('0xf'),_0x19f2cf,'request\x20sent');_0x9ed3c(_0x278540[_0x7619('0x16')][_0x7619('0x15')]);}})['catch'](function(_0x39b762){logger[_0x7619('0x13')](_0x7619('0xf'),_0x19f2cf,_0x39b762);_0xfd2135(_0x39b762);});});}exports['GetMailServerIn']=function(_0x198f86){var _0x74bbb0=this;return new Promise(function(_0x217d7e,_0x398e93){return db[_0x7619('0x17')]['findAll']({'raw':_0x198f86[_0x7619('0x18')]?_0x198f86[_0x7619('0x18')][_0x7619('0x19')]===undefined?!![]:![]:!![],'where':_0x198f86[_0x7619('0x18')]?_0x198f86[_0x7619('0x18')]['where']||null:null,'attributes':_0x198f86[_0x7619('0x18')]?_0x198f86['options'][_0x7619('0x1a')]||null:null,'limit':_0x198f86[_0x7619('0x18')]?_0x198f86[_0x7619('0x18')][_0x7619('0x1b')]||null:null,'include':_0x198f86[_0x7619('0x18')]?_0x198f86[_0x7619('0x18')][_0x7619('0x1c')]?_['map'](_0x198f86[_0x7619('0x18')][_0x7619('0x1c')],function(_0x485e5f){return{'model':db[_0x485e5f[_0x7619('0x1d')]],'as':_0x485e5f['as'],'attributes':_0x485e5f[_0x7619('0x1a')],'include':_0x485e5f[_0x7619('0x1c')]?_[_0x7619('0x1e')](_0x485e5f[_0x7619('0x1c')],function(_0x2adeec){return{'model':db[_0x2adeec[_0x7619('0x1d')]],'as':_0x2adeec['as'],'attributes':_0x2adeec[_0x7619('0x1a')],'include':_0x2adeec['include']?_[_0x7619('0x1e')](_0x2adeec['include'],function(_0x3e201b){return{'model':db[_0x3e201b[_0x7619('0x1d')]],'as':_0x3e201b['as'],'attributes':_0x3e201b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7619('0xd')](function(_0x431d3e){logger[_0x7619('0xe')](_0x7619('0x1f'),_0x198f86);logger[_0x7619('0x11')](_0x7619('0x1f'),_0x198f86,JSON[_0x7619('0x20')](_0x431d3e));_0x217d7e(_0x431d3e);})[_0x7619('0x21')](function(_0x13f6c8){logger[_0x7619('0x13')]('GetMailServerIn',_0x13f6c8[_0x7619('0x15')],_0x198f86);_0x398e93(_0x74bbb0[_0x7619('0x13')](0x1f4,_0x13f6c8[_0x7619('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d0a04b8..b476d7a 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 _0xc6d6=['express','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','put','update','exports','multer','path'];(function(_0x4a3378,_0x2fe53f){var _0x404f28=function(_0x4f657b){while(--_0x4f657b){_0x4a3378['push'](_0x4a3378['shift']());}};_0x404f28(++_0x2fe53f);}(_0xc6d6,0xde));var _0x6c6d=function(_0x59ddd3,_0x21440c){_0x59ddd3=_0x59ddd3-0x0;var _0x49fb32=_0xc6d6[_0x59ddd3];return _0x49fb32;};'use strict';var multer=require(_0x6c6d('0x0'));var util=require('util');var path=require(_0x6c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c6d('0x2'));var router=express[_0x6c6d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6c6d('0x4'));var config=require(_0x6c6d('0x5'));var controller=require(_0x6c6d('0x6'));router[_0x6c6d('0x7')]('/',auth[_0x6c6d('0x8')](),controller[_0x6c6d('0x9')]);router[_0x6c6d('0x7')](_0x6c6d('0xa'),auth[_0x6c6d('0x8')](),controller[_0x6c6d('0xb')]);router[_0x6c6d('0xc')]('/',auth[_0x6c6d('0x8')](),controller['create']);router[_0x6c6d('0xd')]('/:id',auth[_0x6c6d('0x8')](),controller[_0x6c6d('0xe')]);router['delete'](_0x6c6d('0xa'),auth[_0x6c6d('0x8')](),controller['destroy']);module[_0x6c6d('0xf')]=router; \ No newline at end of file +var _0x8251=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','index','/:id','isAuthenticated','post'];(function(_0xcccefa,_0x913ab3){var _0x4c64ed=function(_0x137b92){while(--_0x137b92){_0xcccefa['push'](_0xcccefa['shift']());}};_0x4c64ed(++_0x913ab3);}(_0x8251,0xc3));var _0x1825=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8251[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x1825('0x0'));var util=require(_0x1825('0x1'));var path=require(_0x1825('0x2'));var timeout=require(_0x1825('0x3'));var express=require(_0x1825('0x4'));var router=express['Router']();var auth=require(_0x1825('0x5'));var interaction=require(_0x1825('0x6'));var config=require(_0x1825('0x7'));var controller=require(_0x1825('0x8'));router[_0x1825('0x9')]('/',auth['isAuthenticated'](),controller[_0x1825('0xa')]);router[_0x1825('0x9')](_0x1825('0xb'),auth[_0x1825('0xc')](),controller['show']);router[_0x1825('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1825('0xe')](_0x1825('0xb'),auth['isAuthenticated'](),controller[_0x1825('0xf')]);router[_0x1825('0x10')](_0x1825('0xb'),auth['isAuthenticated'](),controller[_0x1825('0x11')]);module[_0x1825('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 606727d..041d6b5 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 _0x00f0=['sequelize','exports','STRING','INTEGER'];(function(_0xdd88a6,_0x581294){var _0x429480=function(_0x49fe3b){while(--_0x49fe3b){_0xdd88a6['push'](_0xdd88a6['shift']());}};_0x429480(++_0x581294);}(_0x00f0,0xec));var _0x000f=function(_0x1a9a27,_0x146825){_0x1a9a27=_0x1a9a27-0x0;var _0x121f1b=_0x00f0[_0x1a9a27];return _0x121f1b;};'use strict';var Sequelize=require(_0x000f('0x0'));module[_0x000f('0x1')]={'description':{'type':Sequelize[_0x000f('0x2')]},'host':{'type':Sequelize[_0x000f('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x000f('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x000f('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc373=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x1b0f82,_0x15e2f0){var _0x3c2aac=function(_0x67e619){while(--_0x67e619){_0x1b0f82['push'](_0x1b0f82['shift']());}};_0x3c2aac(++_0x15e2f0);}(_0xc373,0x1c7));var _0x3c37=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0xc373[_0x4df1f5];return _0x56585b;};'use strict';var Sequelize=require('sequelize');module[_0x3c37('0x0')]={'description':{'type':Sequelize[_0x3c37('0x1')]},'host':{'type':Sequelize[_0x3c37('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3c37('0x2')]},'secure':{'type':Sequelize[_0x3c37('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x3c37('0x1')]},'authentication':{'type':Sequelize[_0x3c37('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index c660783..c137c45 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 _0xee17=['set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','count','includeAll','include','MailServerOut','rows','catch','rawAttributes','options','find','create','body','params','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','offset','limit'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xee17,0x1c8));var _0x7ee1=function(_0x17a58d,_0x41eb44){_0x17a58d=_0x17a58d-0x0;var _0x4015af=_0xee17[_0x17a58d];return _0x4015af;};'use strict';var pdf=require(_0x7ee1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7ee1('0x1'));var jsonpatch=require(_0x7ee1('0x2'));var rp=require(_0x7ee1('0x3'));var moment=require('moment');var BPromise=require(_0x7ee1('0x4'));var Mustache=require(_0x7ee1('0x5'));var util=require(_0x7ee1('0x6'));var path=require('path');var sox=require(_0x7ee1('0x7'));var csv=require(_0x7ee1('0x8'));var ejs=require(_0x7ee1('0x9'));var fs=require('fs');var _=require(_0x7ee1('0xa'));var squel=require(_0x7ee1('0xb'));var crypto=require('crypto');var jsforce=require(_0x7ee1('0xc'));var deskjs=require(_0x7ee1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ee1('0xe'));var Papa=require(_0x7ee1('0xf'));var Redis=require(_0x7ee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7ee1('0x11'));var as=require(_0x7ee1('0x12'));var hardwareService=require(_0x7ee1('0x13'));var logger=require('../../config/logger')(_0x7ee1('0x14'));var utils=require('../../config/utils');var config=require(_0x7ee1('0x15'));var db=require(_0x7ee1('0x16'))['db'];function respondWithStatusCode(_0x3432c6,_0x2a8b77){_0x2a8b77=_0x2a8b77||0xcc;return function(_0x452354){if(_0x452354){return _0x3432c6['sendStatus'](_0x2a8b77);}return _0x3432c6['status'](_0x2a8b77)['end']();};}function respondWithResult(_0x2fb6ae,_0x249da6){_0x249da6=_0x249da6||0xc8;return function(_0x2e5fd6){if(_0x2e5fd6){return _0x2fb6ae[_0x7ee1('0x17')](_0x249da6)[_0x7ee1('0x18')](_0x2e5fd6);}};}function respondWithFilteredResult(_0x2b3539,_0x4da646){return function(_0x19ae1e){if(_0x19ae1e){var _0x184e23=_0x19ae1e['count'],_0x400b74=_0x4da646[_0x7ee1('0x19')],_0x20f5f2=_0x4da646[_0x7ee1('0x19')]+_0x4da646[_0x7ee1('0x1a')],_0x7b73ed;if(_0x20f5f2>=_0x184e23){_0x20f5f2=_0x184e23;_0x7b73ed=0xc8;}else{_0x7b73ed=0xce;}_0x2b3539[_0x7ee1('0x17')](_0x7b73ed);return _0x2b3539[_0x7ee1('0x1b')](_0x7ee1('0x1c'),_0x400b74+'-'+_0x20f5f2+'/'+_0x184e23)[_0x7ee1('0x18')](_0x19ae1e);}return null;};}function patchUpdates(_0xd7174e){return function(_0x3ac68f){try{jsonpatch[_0x7ee1('0x1d')](_0x3ac68f,_0xd7174e,!![]);}catch(_0x4af879){return BPromise['reject'](_0x4af879);}return _0x3ac68f[_0x7ee1('0x1e')]();};}function saveUpdates(_0x382e23,_0x5a70fd){return function(_0x364699){if(_0x364699){return _0x364699[_0x7ee1('0x1f')](_0x382e23)[_0x7ee1('0x20')](function(_0xaa6398){return _0xaa6398;});}return null;};}function removeEntity(_0x9a5651,_0xd6157){return function(_0x5c22dd){if(_0x5c22dd){return _0x5c22dd['destroy']()['then'](function(){_0x9a5651[_0x7ee1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452cd5,_0x50e257){return function(_0x1ecc3b){if(!_0x1ecc3b){_0x452cd5['sendStatus'](0x194);}return _0x1ecc3b;};}function handleError(_0x5a6b7e,_0x3312c2){_0x3312c2=_0x3312c2||0x1f4;return function(_0x4bf29f){logger[_0x7ee1('0x21')](_0x4bf29f[_0x7ee1('0x22')]);if(_0x4bf29f[_0x7ee1('0x23')]){delete _0x4bf29f[_0x7ee1('0x23')];}_0x5a6b7e[_0x7ee1('0x17')](_0x3312c2)[_0x7ee1('0x24')](_0x4bf29f);};}exports[_0x7ee1('0x25')]=function(_0x59d9c0,_0x4f088e){var _0x596f58={},_0x48830d={},_0xf20397={'count':0x0,'rows':[]};var _0x381713=_[_0x7ee1('0x26')](db['MailServerOut']['rawAttributes'],function(_0x56d9cf){return{'name':_0x56d9cf[_0x7ee1('0x27')],'type':_0x56d9cf[_0x7ee1('0x28')][_0x7ee1('0x29')]};});_0x48830d[_0x7ee1('0x2a')]=_['map'](_0x381713,_0x7ee1('0x23'));_0x48830d[_0x7ee1('0x2b')]=_[_0x7ee1('0x2c')](_0x59d9c0[_0x7ee1('0x2b')]);_0x48830d[_0x7ee1('0x2d')]=_[_0x7ee1('0x2e')](_0x48830d[_0x7ee1('0x2a')],_0x48830d[_0x7ee1('0x2b')]);_0x596f58['attributes']=_[_0x7ee1('0x2e')](_0x48830d[_0x7ee1('0x2a')],qs[_0x7ee1('0x2f')](_0x59d9c0[_0x7ee1('0x2b')][_0x7ee1('0x2f')]));_0x596f58[_0x7ee1('0x30')]=_0x596f58[_0x7ee1('0x30')][_0x7ee1('0x31')]?_0x596f58['attributes']:_0x48830d[_0x7ee1('0x2a')];if(!_0x59d9c0[_0x7ee1('0x2b')][_0x7ee1('0x32')](_0x7ee1('0x33'))){_0x596f58[_0x7ee1('0x1a')]=qs[_0x7ee1('0x1a')](_0x59d9c0['query'][_0x7ee1('0x1a')]);_0x596f58[_0x7ee1('0x19')]=qs['offset'](_0x59d9c0['query'][_0x7ee1('0x19')]);}_0x596f58[_0x7ee1('0x34')]=qs[_0x7ee1('0x35')](_0x59d9c0[_0x7ee1('0x2b')][_0x7ee1('0x35')]);_0x596f58['where']=qs[_0x7ee1('0x2d')](_['pick'](_0x59d9c0['query'],_0x48830d[_0x7ee1('0x2d')]));if(_0x59d9c0[_0x7ee1('0x2b')][_0x7ee1('0x36')]){_0x596f58[_0x7ee1('0x37')]=_[_0x7ee1('0x38')](_0x596f58[_0x7ee1('0x37')],{'$or':_['map'](_0x381713,function(_0xb7f14a){if(_0xb7f14a[_0x7ee1('0x28')]!=='VIRTUAL'){var _0x5b204a={};_0x5b204a[_0xb7f14a['name']]={'$like':'%'+_0x59d9c0[_0x7ee1('0x2b')][_0x7ee1('0x36')]+'%'};return _0x5b204a;}})});}_0x596f58=_[_0x7ee1('0x38')]({},_0x596f58,_0x59d9c0['options']);var _0x30a3c1={'where':_0x596f58[_0x7ee1('0x37')]};return db['MailServerOut'][_0x7ee1('0x39')](_0x30a3c1)[_0x7ee1('0x20')](function(_0x159442){_0xf20397[_0x7ee1('0x39')]=_0x159442;if(_0x59d9c0[_0x7ee1('0x2b')][_0x7ee1('0x3a')]){_0x596f58[_0x7ee1('0x3b')]=[{'all':!![]}];}return db[_0x7ee1('0x3c')]['findAll'](_0x596f58);})[_0x7ee1('0x20')](function(_0x356274){_0xf20397[_0x7ee1('0x3d')]=_0x356274;return _0xf20397;})[_0x7ee1('0x20')](respondWithFilteredResult(_0x4f088e,_0x596f58))[_0x7ee1('0x3e')](handleError(_0x4f088e,null));};exports['show']=function(_0x35cd91,_0x4b05c3){var _0x447297={'raw':!![],'where':{'id':_0x35cd91['params']['id']}},_0x358647={};_0x358647[_0x7ee1('0x2a')]=_[_0x7ee1('0x2c')](db[_0x7ee1('0x3c')][_0x7ee1('0x3f')]);_0x358647[_0x7ee1('0x2b')]=_[_0x7ee1('0x2c')](_0x35cd91[_0x7ee1('0x2b')]);_0x358647[_0x7ee1('0x2d')]=_[_0x7ee1('0x2e')](_0x358647[_0x7ee1('0x2a')],_0x358647[_0x7ee1('0x2b')]);_0x447297['attributes']=_[_0x7ee1('0x2e')](_0x358647[_0x7ee1('0x2a')],qs[_0x7ee1('0x2f')](_0x35cd91[_0x7ee1('0x2b')]['fields']));_0x447297[_0x7ee1('0x30')]=_0x447297[_0x7ee1('0x30')][_0x7ee1('0x31')]?_0x447297[_0x7ee1('0x30')]:_0x358647[_0x7ee1('0x2a')];if(_0x35cd91[_0x7ee1('0x2b')][_0x7ee1('0x3a')]){_0x447297[_0x7ee1('0x3b')]=[{'all':!![]}];}_0x447297=_[_0x7ee1('0x38')]({},_0x447297,_0x35cd91[_0x7ee1('0x40')]);return db[_0x7ee1('0x3c')][_0x7ee1('0x41')](_0x447297)[_0x7ee1('0x20')](handleEntityNotFound(_0x4b05c3,null))[_0x7ee1('0x20')](respondWithResult(_0x4b05c3,null))[_0x7ee1('0x3e')](handleError(_0x4b05c3,null));};exports[_0x7ee1('0x42')]=function(_0x1f329f,_0x427f47){return db['MailServerOut'][_0x7ee1('0x42')](_0x1f329f[_0x7ee1('0x43')],{})[_0x7ee1('0x20')](respondWithResult(_0x427f47,0xc9))['catch'](handleError(_0x427f47,null));};exports[_0x7ee1('0x1f')]=function(_0x30d8f8,_0x6595a0){if(_0x30d8f8[_0x7ee1('0x43')]['id']){delete _0x30d8f8[_0x7ee1('0x43')]['id'];}return db[_0x7ee1('0x3c')]['find']({'where':{'id':_0x30d8f8['params']['id']}})[_0x7ee1('0x20')](handleEntityNotFound(_0x6595a0,null))['then'](saveUpdates(_0x30d8f8['body'],null))['then'](respondWithResult(_0x6595a0,null))[_0x7ee1('0x3e')](handleError(_0x6595a0,null));};exports['destroy']=function(_0x475f88,_0x484a00){return db[_0x7ee1('0x3c')][_0x7ee1('0x41')]({'where':{'id':_0x475f88[_0x7ee1('0x44')]['id']}})['then'](handleEntityNotFound(_0x484a00,null))[_0x7ee1('0x20')](removeEntity(_0x484a00,null))[_0x7ee1('0x3e')](handleError(_0x484a00,null));}; \ No newline at end of file +var _0xf58e=['show','params','rawAttributes','includeAll','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','limit','reject','update','then','destroy','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','VIRTUAL','count','include','findAll','rows','catch'];(function(_0x9cf9f8,_0x1efb85){var _0x24550a=function(_0x588463){while(--_0x588463){_0x9cf9f8['push'](_0x9cf9f8['shift']());}};_0x24550a(++_0x1efb85);}(_0xf58e,0x107));var _0xef58=function(_0x4deede,_0xe3c8d5){_0x4deede=_0x4deede-0x0;var _0x18e7a5=_0xf58e[_0x4deede];return _0x18e7a5;};'use strict';var pdf=require(_0xef58('0x0'));var emlformat=require(_0xef58('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef58('0x2'));var rp=require(_0xef58('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xef58('0x4'));var sox=require('sox');var csv=require(_0xef58('0x5'));var ejs=require(_0xef58('0x6'));var fs=require('fs');var _=require(_0xef58('0x7'));var squel=require(_0xef58('0x8'));var crypto=require(_0xef58('0x9'));var jsforce=require(_0xef58('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xef58('0x5'));var querystring=require('querystring');var Papa=require(_0xef58('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xef58('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef58('0xd'))(_0xef58('0xe'));var utils=require(_0xef58('0xf'));var config=require(_0xef58('0x10'));var db=require(_0xef58('0x11'))['db'];function respondWithStatusCode(_0x1cb64b,_0x2a28c6){_0x2a28c6=_0x2a28c6||0xcc;return function(_0x5a9bfb){if(_0x5a9bfb){return _0x1cb64b['sendStatus'](_0x2a28c6);}return _0x1cb64b['status'](_0x2a28c6)[_0xef58('0x12')]();};}function respondWithResult(_0x5b4a30,_0x784bee){_0x784bee=_0x784bee||0xc8;return function(_0x174f09){if(_0x174f09){return _0x5b4a30[_0xef58('0x13')](_0x784bee)[_0xef58('0x14')](_0x174f09);}};}function respondWithFilteredResult(_0x3b6c9f,_0x53984f){return function(_0x2c3fc1){if(_0x2c3fc1){var _0xb28dbd=_0x2c3fc1['count'],_0x4cb29e=_0x53984f['offset'],_0x5aaefa=_0x53984f['offset']+_0x53984f[_0xef58('0x15')],_0x68b36;if(_0x5aaefa>=_0xb28dbd){_0x5aaefa=_0xb28dbd;_0x68b36=0xc8;}else{_0x68b36=0xce;}_0x3b6c9f[_0xef58('0x13')](_0x68b36);return _0x3b6c9f['set']('Content-Range',_0x4cb29e+'-'+_0x5aaefa+'/'+_0xb28dbd)[_0xef58('0x14')](_0x2c3fc1);}return null;};}function patchUpdates(_0x16e1a3){return function(_0x546391){try{jsonpatch['apply'](_0x546391,_0x16e1a3,!![]);}catch(_0x1055d0){return BPromise[_0xef58('0x16')](_0x1055d0);}return _0x546391['save']();};}function saveUpdates(_0x96c3f4,_0x48f3b0){return function(_0x535262){if(_0x535262){return _0x535262[_0xef58('0x17')](_0x96c3f4)[_0xef58('0x18')](function(_0x534524){return _0x534524;});}return null;};}function removeEntity(_0x4757cf,_0x4d95dd){return function(_0x5e75a7){if(_0x5e75a7){return _0x5e75a7[_0xef58('0x19')]()['then'](function(){_0x4757cf[_0xef58('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce137,_0x5a16d1){return function(_0x357278){if(!_0x357278){_0x4ce137['sendStatus'](0x194);}return _0x357278;};}function handleError(_0x2220b3,_0x27c5fc){_0x27c5fc=_0x27c5fc||0x1f4;return function(_0xd3b44b){logger['error'](_0xd3b44b[_0xef58('0x1a')]);if(_0xd3b44b[_0xef58('0x1b')]){delete _0xd3b44b[_0xef58('0x1b')];}_0x2220b3[_0xef58('0x13')](_0x27c5fc)[_0xef58('0x1c')](_0xd3b44b);};}exports[_0xef58('0x1d')]=function(_0x1e45ab,_0x24b950){var _0x1b1c42={},_0x42cb90={},_0x4f1e3c={'count':0x0,'rows':[]};var _0x2a1711=_[_0xef58('0x1e')](db[_0xef58('0x1f')]['rawAttributes'],function(_0x9d51ab){return{'name':_0x9d51ab[_0xef58('0x20')],'type':_0x9d51ab[_0xef58('0x21')][_0xef58('0x22')]};});_0x42cb90[_0xef58('0x23')]=_[_0xef58('0x1e')](_0x2a1711,'name');_0x42cb90[_0xef58('0x24')]=_[_0xef58('0x25')](_0x1e45ab[_0xef58('0x24')]);_0x42cb90[_0xef58('0x26')]=_[_0xef58('0x27')](_0x42cb90[_0xef58('0x23')],_0x42cb90[_0xef58('0x24')]);_0x1b1c42[_0xef58('0x28')]=_['intersection'](_0x42cb90[_0xef58('0x23')],qs[_0xef58('0x29')](_0x1e45ab['query'][_0xef58('0x29')]));_0x1b1c42[_0xef58('0x28')]=_0x1b1c42[_0xef58('0x28')][_0xef58('0x2a')]?_0x1b1c42['attributes']:_0x42cb90['model'];if(!_0x1e45ab[_0xef58('0x24')][_0xef58('0x2b')]('nolimit')){_0x1b1c42[_0xef58('0x15')]=qs[_0xef58('0x15')](_0x1e45ab['query'][_0xef58('0x15')]);_0x1b1c42[_0xef58('0x2c')]=qs[_0xef58('0x2c')](_0x1e45ab[_0xef58('0x24')][_0xef58('0x2c')]);}_0x1b1c42[_0xef58('0x2d')]=qs[_0xef58('0x2e')](_0x1e45ab[_0xef58('0x24')]['sort']);_0x1b1c42['where']=qs[_0xef58('0x26')](_[_0xef58('0x2f')](_0x1e45ab[_0xef58('0x24')],_0x42cb90['filters']));if(_0x1e45ab[_0xef58('0x24')][_0xef58('0x30')]){_0x1b1c42[_0xef58('0x31')]=_[_0xef58('0x32')](_0x1b1c42['where'],{'$or':_[_0xef58('0x1e')](_0x2a1711,function(_0x5bf601){if(_0x5bf601[_0xef58('0x21')]!==_0xef58('0x33')){var _0x9a8d3a={};_0x9a8d3a[_0x5bf601[_0xef58('0x1b')]]={'$like':'%'+_0x1e45ab[_0xef58('0x24')]['filter']+'%'};return _0x9a8d3a;}})});}_0x1b1c42=_['merge']({},_0x1b1c42,_0x1e45ab['options']);var _0x12ead0={'where':_0x1b1c42[_0xef58('0x31')]};return db['MailServerOut'][_0xef58('0x34')](_0x12ead0)['then'](function(_0x488454){_0x4f1e3c['count']=_0x488454;if(_0x1e45ab[_0xef58('0x24')]['includeAll']){_0x1b1c42[_0xef58('0x35')]=[{'all':!![]}];}return db[_0xef58('0x1f')][_0xef58('0x36')](_0x1b1c42);})['then'](function(_0x5a0e88){_0x4f1e3c[_0xef58('0x37')]=_0x5a0e88;return _0x4f1e3c;})[_0xef58('0x18')](respondWithFilteredResult(_0x24b950,_0x1b1c42))[_0xef58('0x38')](handleError(_0x24b950,null));};exports[_0xef58('0x39')]=function(_0x5363b2,_0x4d8e37){var _0x5d1f99={'raw':!![],'where':{'id':_0x5363b2[_0xef58('0x3a')]['id']}},_0x11eed5={};_0x11eed5[_0xef58('0x23')]=_[_0xef58('0x25')](db[_0xef58('0x1f')][_0xef58('0x3b')]);_0x11eed5[_0xef58('0x24')]=_[_0xef58('0x25')](_0x5363b2[_0xef58('0x24')]);_0x11eed5[_0xef58('0x26')]=_[_0xef58('0x27')](_0x11eed5[_0xef58('0x23')],_0x11eed5[_0xef58('0x24')]);_0x5d1f99[_0xef58('0x28')]=_[_0xef58('0x27')](_0x11eed5[_0xef58('0x23')],qs[_0xef58('0x29')](_0x5363b2[_0xef58('0x24')]['fields']));_0x5d1f99[_0xef58('0x28')]=_0x5d1f99[_0xef58('0x28')][_0xef58('0x2a')]?_0x5d1f99[_0xef58('0x28')]:_0x11eed5[_0xef58('0x23')];if(_0x5363b2[_0xef58('0x24')][_0xef58('0x3c')]){_0x5d1f99[_0xef58('0x35')]=[{'all':!![]}];}_0x5d1f99=_['merge']({},_0x5d1f99,_0x5363b2['options']);return db[_0xef58('0x1f')][_0xef58('0x3d')](_0x5d1f99)[_0xef58('0x18')](handleEntityNotFound(_0x4d8e37,null))['then'](respondWithResult(_0x4d8e37,null))[_0xef58('0x38')](handleError(_0x4d8e37,null));};exports[_0xef58('0x3e')]=function(_0x33c51d,_0x3a6dd7){return db[_0xef58('0x1f')]['create'](_0x33c51d[_0xef58('0x3f')],{})['then'](respondWithResult(_0x3a6dd7,0xc9))[_0xef58('0x38')](handleError(_0x3a6dd7,null));};exports[_0xef58('0x17')]=function(_0x1a4fbe,_0x10fc23){if(_0x1a4fbe[_0xef58('0x3f')]['id']){delete _0x1a4fbe[_0xef58('0x3f')]['id'];}return db[_0xef58('0x1f')][_0xef58('0x3d')]({'where':{'id':_0x1a4fbe[_0xef58('0x3a')]['id']}})[_0xef58('0x18')](handleEntityNotFound(_0x10fc23,null))[_0xef58('0x18')](saveUpdates(_0x1a4fbe['body'],null))[_0xef58('0x18')](respondWithResult(_0x10fc23,null))[_0xef58('0x38')](handleError(_0x10fc23,null));};exports[_0xef58('0x19')]=function(_0xbe53b3,_0x330dcc){return db[_0xef58('0x1f')]['find']({'where':{'id':_0xbe53b3[_0xef58('0x3a')]['id']}})[_0xef58('0x18')](handleEntityNotFound(_0x330dcc,null))['then'](removeEntity(_0x330dcc,null))[_0xef58('0x38')](handleError(_0x330dcc,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ab77269..1951c63 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 _0xc4aa=['bluebird','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'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':!![]});}; \ No newline at end of file +var _0x814b=['define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x2c062f,_0xc90b9){var _0x202e72=function(_0x397f6f){while(--_0x397f6f){_0x2c062f['push'](_0x2c062f['shift']());}};_0x202e72(++_0xc90b9);}(_0x814b,0x1a2));var _0xb814=function(_0x9cbfe0,_0x56aada){_0x9cbfe0=_0x9cbfe0-0x0;var _0x1f1534=_0x814b[_0x9cbfe0];return _0x1f1534;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index f8463fc..2efc3d9 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 _0xda07=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2aabb4,_0x2f67f3){var _0xde3977=function(_0x15120f){while(--_0x15120f){_0x2aabb4['push'](_0x2aabb4['shift']());}};_0xde3977(++_0x2f67f3);}(_0xda07,0x148));var _0x7da0=function(_0x4c18fa,_0x43a6b2){_0x4c18fa=_0x4c18fa-0x0;var _0x1d7c03=_0xda07[_0x4c18fa];return _0x1d7c03;};'use strict';var _=require(_0x7da0('0x0'));var util=require('util');var moment=require(_0x7da0('0x1'));var BPromise=require(_0x7da0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7da0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7da0('0x4'));var logger=require('../../config/logger')(_0x7da0('0x5'));var config=require(_0x7da0('0x6'));var jayson=require(_0x7da0('0x7'));var client=jayson['client'][_0x7da0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a70e3,_0x5b85fb,_0x17e417){return new BPromise(function(_0x56da0d,_0x3e3f7f){return client[_0x7da0('0x9')](_0x4a70e3,_0x17e417)[_0x7da0('0xa')](function(_0x124609){logger[_0x7da0('0xb')](_0x7da0('0xc'),_0x5b85fb,_0x7da0('0xd'));logger[_0x7da0('0xe')](_0x7da0('0xf'),_0x5b85fb,_0x7da0('0xd'),JSON[_0x7da0('0x10')](_0x124609));if(_0x124609[_0x7da0('0x11')]){if(_0x124609['error'][_0x7da0('0x12')]===0x1f4){logger['error'](_0x7da0('0xc'),_0x5b85fb,_0x124609['error'][_0x7da0('0x13')]);return _0x3e3f7f(_0x124609[_0x7da0('0x11')][_0x7da0('0x13')]);}logger[_0x7da0('0x11')](_0x7da0('0xc'),_0x5b85fb,_0x124609['error'][_0x7da0('0x13')]);return _0x56da0d(_0x124609[_0x7da0('0x11')][_0x7da0('0x13')]);}else{logger[_0x7da0('0xb')]('MailServerOut,\x20%s,\x20%s',_0x5b85fb,_0x7da0('0xd'));_0x56da0d(_0x124609[_0x7da0('0x14')][_0x7da0('0x13')]);}})[_0x7da0('0x15')](function(_0x46f881){logger['error']('MailServerOut,\x20%s,\x20%s',_0x5b85fb,_0x46f881);_0x3e3f7f(_0x46f881);});});} \ No newline at end of file +var _0x1408=['http','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x1408,0x7d));var _0x8140=function(_0x1701be,_0x321093){_0x1701be=_0x1701be-0x0;var _0x21d4a4=_0x1408[_0x1701be];return _0x21d4a4;};'use strict';var _=require('lodash');var util=require(_0x8140('0x0'));var moment=require(_0x8140('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8140('0x2'));var db=require(_0x8140('0x3'))['db'];var utils=require(_0x8140('0x4'));var logger=require(_0x8140('0x5'))(_0x8140('0x6'));var config=require(_0x8140('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8140('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d0c2a,_0x41290d,_0x33599e){return new BPromise(function(_0x9daaea,_0x187df7){return client['request'](_0x4d0c2a,_0x33599e)['then'](function(_0x3a35cf){logger[_0x8140('0x9')](_0x8140('0xa'),_0x41290d,'request\x20sent');logger[_0x8140('0xb')](_0x8140('0xc'),_0x41290d,_0x8140('0xd'),JSON['stringify'](_0x3a35cf));if(_0x3a35cf[_0x8140('0xe')]){if(_0x3a35cf[_0x8140('0xe')][_0x8140('0xf')]===0x1f4){logger[_0x8140('0xe')](_0x8140('0xa'),_0x41290d,_0x3a35cf['error'][_0x8140('0x10')]);return _0x187df7(_0x3a35cf[_0x8140('0xe')][_0x8140('0x10')]);}logger[_0x8140('0xe')](_0x8140('0xa'),_0x41290d,_0x3a35cf[_0x8140('0xe')][_0x8140('0x10')]);return _0x9daaea(_0x3a35cf[_0x8140('0xe')][_0x8140('0x10')]);}else{logger[_0x8140('0x9')](_0x8140('0xa'),_0x41290d,_0x8140('0xd'));_0x9daaea(_0x3a35cf[_0x8140('0x11')][_0x8140('0x10')]);}})[_0x8140('0x12')](function(_0x23bc59){logger[_0x8140('0xe')]('MailServerOut,\x20%s,\x20%s',_0x41290d,_0x23bc59);_0x187df7(_0x23bc59);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c0c06f9..3de2e5b 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 _0xc7d4=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','/:id','show','create','update'];(function(_0x306c19,_0x2f73ea){var _0x4e36d7=function(_0x54b144){while(--_0x54b144){_0x306c19['push'](_0x306c19['shift']());}};_0x4e36d7(++_0x2f73ea);}(_0xc7d4,0x124));var _0x4c7d=function(_0x23d2aa,_0x18bbf9){_0x23d2aa=_0x23d2aa-0x0;var _0x2e2ca5=_0xc7d4[_0x23d2aa];return _0x2e2ca5;};'use strict';var multer=require(_0x4c7d('0x0'));var util=require(_0x4c7d('0x1'));var path=require(_0x4c7d('0x2'));var timeout=require('connect-timeout');var express=require(_0x4c7d('0x3'));var router=express[_0x4c7d('0x4')]();var auth=require(_0x4c7d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c7d('0x6'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x4c7d('0x7')](),controller[_0x4c7d('0x8')]);router['get']('/describe',auth[_0x4c7d('0x7')](),controller[_0x4c7d('0x9')]);router['get'](_0x4c7d('0xa'),auth[_0x4c7d('0x7')](),controller[_0x4c7d('0xb')]);router['post']('/',auth[_0x4c7d('0x7')](),controller[_0x4c7d('0xc')]);router['put'](_0x4c7d('0xa'),auth['isAuthenticated'](),controller[_0x4c7d('0xd')]);router[_0x4c7d('0xe')](_0x4c7d('0xa'),auth[_0x4c7d('0x7')](),controller[_0x4c7d('0xf')]);module[_0x4c7d('0x10')]=router; \ No newline at end of file +var _0xff58=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xff58,0x150));var _0x8ff5=function(_0xc5c4fd,_0x1464e6){_0xc5c4fd=_0xc5c4fd-0x0;var _0x25247e=_0xff58[_0xc5c4fd];return _0x25247e;};'use strict';var multer=require(_0x8ff5('0x0'));var util=require(_0x8ff5('0x1'));var path=require(_0x8ff5('0x2'));var timeout=require(_0x8ff5('0x3'));var express=require('express');var router=express[_0x8ff5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8ff5('0x5'));var config=require(_0x8ff5('0x6'));var controller=require(_0x8ff5('0x7'));router[_0x8ff5('0x8')]('/',auth[_0x8ff5('0x9')](),controller[_0x8ff5('0xa')]);router[_0x8ff5('0x8')](_0x8ff5('0xb'),auth[_0x8ff5('0x9')](),controller['describe']);router[_0x8ff5('0x8')](_0x8ff5('0xc'),auth[_0x8ff5('0x9')](),controller[_0x8ff5('0xd')]);router[_0x8ff5('0xe')]('/',auth[_0x8ff5('0x9')](),controller[_0x8ff5('0xf')]);router['put']('/:id',auth[_0x8ff5('0x9')](),controller[_0x8ff5('0x10')]);router['delete'](_0x8ff5('0xc'),auth[_0x8ff5('0x9')](),controller[_0x8ff5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3b7eafe..8b7f239 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 _0x04cc=['STRING','name','sequelize','exports'];(function(_0xfc7786,_0x3fc5e9){var _0x2d5f07=function(_0x416b09){while(--_0x416b09){_0xfc7786['push'](_0xfc7786['shift']());}};_0x2d5f07(++_0x3fc5e9);}(_0x04cc,0x11a));var _0xc04c=function(_0x187499,_0x5e416a){_0x187499=_0x187499-0x0;var _0x2965fe=_0x04cc[_0x187499];return _0x2965fe;};'use strict';var Sequelize=require(_0xc04c('0x0'));module[_0xc04c('0x1')]={'name':{'type':Sequelize[_0xc04c('0x2')],'unique':_0xc04c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3f2e=['name','sequelize','STRING'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x3e37b3,_0x570305){_0x3e37b3=_0x3e37b3-0x0;var _0x47e724=_0x3f2e[_0x3e37b3];return _0x47e724;};'use strict';var Sequelize=require(_0xe3f2('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3f2('0x1')],'unique':_0xe3f2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe3f2('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 235e9cf..f8627e5 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 _0x5496=['create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','length','find','catch'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x5496,0x175));var _0x6549=function(_0x5742af,_0xfc283e){_0x5742af=_0x5742af-0x0;var _0x1cf02b=_0x5496[_0x5742af];return _0x1cf02b;};'use strict';var pdf=require(_0x6549('0x0'));var emlformat=require(_0x6549('0x1'));var rimraf=require(_0x6549('0x2'));var zipdir=require(_0x6549('0x3'));var jsonpatch=require(_0x6549('0x4'));var rp=require('request-promise');var moment=require(_0x6549('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6549('0x6'));var util=require(_0x6549('0x7'));var path=require(_0x6549('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6549('0x9'));var fs=require('fs');var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var db=require(_0x6549('0x17'))['db'];function respondWithStatusCode(_0x1a0f72,_0x5bc018){_0x5bc018=_0x5bc018||0xcc;return function(_0x4dfb06){if(_0x4dfb06){return _0x1a0f72[_0x6549('0x18')](_0x5bc018);}return _0x1a0f72[_0x6549('0x19')](_0x5bc018)['end']();};}function respondWithResult(_0x200ff1,_0x150fc8){_0x150fc8=_0x150fc8||0xc8;return function(_0x195d25){if(_0x195d25){return _0x200ff1[_0x6549('0x19')](_0x150fc8)[_0x6549('0x1a')](_0x195d25);}};}function respondWithFilteredResult(_0x86ae9d,_0x55c112){return function(_0x5db86d){if(_0x5db86d){var _0x384f75=_0x5db86d[_0x6549('0x1b')],_0x25da29=_0x55c112[_0x6549('0x1c')],_0x47a81a=_0x55c112[_0x6549('0x1c')]+_0x55c112[_0x6549('0x1d')],_0x238a04;if(_0x47a81a>=_0x384f75){_0x47a81a=_0x384f75;_0x238a04=0xc8;}else{_0x238a04=0xce;}_0x86ae9d['status'](_0x238a04);return _0x86ae9d['set'](_0x6549('0x1e'),_0x25da29+'-'+_0x47a81a+'/'+_0x384f75)['json'](_0x5db86d);}return null;};}function patchUpdates(_0x56c15b){return function(_0x31f8e7){try{jsonpatch[_0x6549('0x1f')](_0x31f8e7,_0x56c15b,!![]);}catch(_0x19c4a6){return BPromise[_0x6549('0x20')](_0x19c4a6);}return _0x31f8e7[_0x6549('0x21')]();};}function saveUpdates(_0x5ce3aa,_0x228117){return function(_0x4b40c1){if(_0x4b40c1){return _0x4b40c1[_0x6549('0x22')](_0x5ce3aa)[_0x6549('0x23')](function(_0x3992cf){return _0x3992cf;});}return null;};}function removeEntity(_0x29c6b3,_0x22bcf8){return function(_0x12d547){if(_0x12d547){return _0x12d547[_0x6549('0x24')]()[_0x6549('0x23')](function(){_0x29c6b3[_0x6549('0x19')](0xcc)[_0x6549('0x25')]();});}};}function handleEntityNotFound(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(!_0x23c0ba){_0x40d3f9['sendStatus'](0x194);}return _0x23c0ba;};}function handleError(_0x30404e,_0x1bc8db){_0x1bc8db=_0x1bc8db||0x1f4;return function(_0x53bbca){logger[_0x6549('0x26')](_0x53bbca[_0x6549('0x27')]);if(_0x53bbca[_0x6549('0x28')]){delete _0x53bbca['name'];}_0x30404e[_0x6549('0x19')](_0x1bc8db)[_0x6549('0x29')](_0x53bbca);};}exports[_0x6549('0x2a')]=function(_0x2900cd,_0x442862){var _0x3edf02={},_0x2f58f7={},_0xa6c718={'count':0x0,'rows':[]};var _0x4c52f1=_[_0x6549('0x2b')](db[_0x6549('0x2c')][_0x6549('0x2d')],function(_0x4c605c){return{'name':_0x4c605c[_0x6549('0x2e')],'type':_0x4c605c['type']['key']};});_0x2f58f7['model']=_[_0x6549('0x2b')](_0x4c52f1,_0x6549('0x28'));_0x2f58f7['query']=_[_0x6549('0x2f')](_0x2900cd[_0x6549('0x30')]);_0x2f58f7[_0x6549('0x31')]=_[_0x6549('0x32')](_0x2f58f7[_0x6549('0x33')],_0x2f58f7[_0x6549('0x30')]);_0x3edf02[_0x6549('0x34')]=_['intersection'](_0x2f58f7[_0x6549('0x33')],qs[_0x6549('0x35')](_0x2900cd[_0x6549('0x30')][_0x6549('0x35')]));_0x3edf02[_0x6549('0x34')]=_0x3edf02[_0x6549('0x34')]['length']?_0x3edf02[_0x6549('0x34')]:_0x2f58f7['model'];if(!_0x2900cd[_0x6549('0x30')]['hasOwnProperty'](_0x6549('0x36'))){_0x3edf02[_0x6549('0x1d')]=qs[_0x6549('0x1d')](_0x2900cd['query'][_0x6549('0x1d')]);_0x3edf02[_0x6549('0x1c')]=qs[_0x6549('0x1c')](_0x2900cd[_0x6549('0x30')]['offset']);}_0x3edf02['order']=qs['sort'](_0x2900cd[_0x6549('0x30')][_0x6549('0x37')]);_0x3edf02['where']=qs[_0x6549('0x31')](_[_0x6549('0x38')](_0x2900cd[_0x6549('0x30')],_0x2f58f7[_0x6549('0x31')]));if(_0x2900cd[_0x6549('0x30')]['filter']){_0x3edf02['where']=_[_0x6549('0x39')](_0x3edf02[_0x6549('0x3a')],{'$or':_[_0x6549('0x2b')](_0x4c52f1,function(_0xa79ffb){if(_0xa79ffb[_0x6549('0x3b')]!==_0x6549('0x3c')){var _0x1c6b46={};_0x1c6b46[_0xa79ffb[_0x6549('0x28')]]={'$like':'%'+_0x2900cd[_0x6549('0x30')][_0x6549('0x3d')]+'%'};return _0x1c6b46;}})});}_0x3edf02=_['merge']({},_0x3edf02,_0x2900cd[_0x6549('0x3e')]);var _0x7986b0={'where':_0x3edf02[_0x6549('0x3a')]};return db[_0x6549('0x2c')][_0x6549('0x1b')](_0x7986b0)['then'](function(_0x54ee33){_0xa6c718['count']=_0x54ee33;if(_0x2900cd[_0x6549('0x30')][_0x6549('0x3f')]){_0x3edf02[_0x6549('0x40')]=[{'all':!![]}];}return db[_0x6549('0x2c')]['findAll'](_0x3edf02);})['then'](function(_0x438f0b){_0xa6c718[_0x6549('0x41')]=_0x438f0b;return _0xa6c718;})[_0x6549('0x23')](respondWithFilteredResult(_0x442862,_0x3edf02))['catch'](handleError(_0x442862,null));};exports[_0x6549('0x42')]=function(_0x519622,_0x3ea7f9){var _0x2ec614={'raw':!![],'where':{'id':_0x519622[_0x6549('0x43')]['id']}},_0x19920f={};_0x19920f[_0x6549('0x33')]=_[_0x6549('0x2f')](db[_0x6549('0x2c')]['rawAttributes']);_0x19920f[_0x6549('0x30')]=_[_0x6549('0x2f')](_0x519622[_0x6549('0x30')]);_0x19920f[_0x6549('0x31')]=_[_0x6549('0x32')](_0x19920f[_0x6549('0x33')],_0x19920f[_0x6549('0x30')]);_0x2ec614[_0x6549('0x34')]=_[_0x6549('0x32')](_0x19920f[_0x6549('0x33')],qs[_0x6549('0x35')](_0x519622[_0x6549('0x30')][_0x6549('0x35')]));_0x2ec614[_0x6549('0x34')]=_0x2ec614[_0x6549('0x34')][_0x6549('0x44')]?_0x2ec614['attributes']:_0x19920f[_0x6549('0x33')];if(_0x519622[_0x6549('0x30')][_0x6549('0x3f')]){_0x2ec614[_0x6549('0x40')]=[{'all':!![]}];}_0x2ec614=_['merge']({},_0x2ec614,_0x519622[_0x6549('0x3e')]);return db['MailSubstatus'][_0x6549('0x45')](_0x2ec614)[_0x6549('0x23')](handleEntityNotFound(_0x3ea7f9,null))['then'](respondWithResult(_0x3ea7f9,null))[_0x6549('0x46')](handleError(_0x3ea7f9,null));};exports[_0x6549('0x47')]=function(_0x44e608,_0x18a751){return db[_0x6549('0x2c')]['create'](_0x44e608['body'],{})[_0x6549('0x23')](respondWithResult(_0x18a751,0xc9))[_0x6549('0x46')](handleError(_0x18a751,null));};exports[_0x6549('0x22')]=function(_0x1712f3,_0x1e562b){if(_0x1712f3['body']['id']){delete _0x1712f3[_0x6549('0x48')]['id'];}return db[_0x6549('0x2c')][_0x6549('0x45')]({'where':{'id':_0x1712f3[_0x6549('0x43')]['id']}})[_0x6549('0x23')](handleEntityNotFound(_0x1e562b,null))[_0x6549('0x23')](saveUpdates(_0x1712f3[_0x6549('0x48')],null))[_0x6549('0x23')](respondWithResult(_0x1e562b,null))['catch'](handleError(_0x1e562b,null));};exports[_0x6549('0x24')]=function(_0x58746c,_0x2ed77c){return db[_0x6549('0x2c')][_0x6549('0x45')]({'where':{'id':_0x58746c['params']['id']}})[_0x6549('0x23')](handleEntityNotFound(_0x2ed77c,null))[_0x6549('0x23')](removeEntity(_0x2ed77c,null))[_0x6549('0x46')](handleError(_0x2ed77c,null));};exports['describe']=function(_0x19ac50,_0x17d7ce){return db[_0x6549('0x2c')][_0x6549('0x49')]()[_0x6549('0x23')](respondWithResult(_0x17d7ce,null))[_0x6549('0x46')](handleError(_0x17d7ce,null));}; \ No newline at end of file +var _0x53ec=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','show','rawAttributes','options','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','MailSubstatus','fieldName','type'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x53ec,0x192));var _0xc53e=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x53ec[_0x1f27df];return _0x286ee2;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var Redis=require(_0xc53e('0x10'));var authService=require(_0xc53e('0x11'));var qs=require(_0xc53e('0x12'));var as=require(_0xc53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc53e('0x15'))['db'];function respondWithStatusCode(_0x9ffbcb,_0x863fa){_0x863fa=_0x863fa||0xcc;return function(_0x4203aa){if(_0x4203aa){return _0x9ffbcb['sendStatus'](_0x863fa);}return _0x9ffbcb['status'](_0x863fa)[_0xc53e('0x16')]();};}function respondWithResult(_0x19a772,_0x7cd798){_0x7cd798=_0x7cd798||0xc8;return function(_0x3d2e17){if(_0x3d2e17){return _0x19a772[_0xc53e('0x17')](_0x7cd798)[_0xc53e('0x18')](_0x3d2e17);}};}function respondWithFilteredResult(_0x3dc2fa,_0x19c0d1){return function(_0x455e4d){if(_0x455e4d){var _0x2ad6eb=_0x455e4d[_0xc53e('0x19')],_0x5b0a88=_0x19c0d1[_0xc53e('0x1a')],_0x8a522e=_0x19c0d1[_0xc53e('0x1a')]+_0x19c0d1[_0xc53e('0x1b')],_0x191567;if(_0x8a522e>=_0x2ad6eb){_0x8a522e=_0x2ad6eb;_0x191567=0xc8;}else{_0x191567=0xce;}_0x3dc2fa[_0xc53e('0x17')](_0x191567);return _0x3dc2fa[_0xc53e('0x1c')](_0xc53e('0x1d'),_0x5b0a88+'-'+_0x8a522e+'/'+_0x2ad6eb)['json'](_0x455e4d);}return null;};}function patchUpdates(_0x546fab){return function(_0x35b7b2){try{jsonpatch[_0xc53e('0x1e')](_0x35b7b2,_0x546fab,!![]);}catch(_0x421641){return BPromise[_0xc53e('0x1f')](_0x421641);}return _0x35b7b2[_0xc53e('0x20')]();};}function saveUpdates(_0x2cfe2b,_0x15a015){return function(_0x25702b){if(_0x25702b){return _0x25702b[_0xc53e('0x21')](_0x2cfe2b)[_0xc53e('0x22')](function(_0x17d825){return _0x17d825;});}return null;};}function removeEntity(_0x44fd93,_0x426467){return function(_0x4fb695){if(_0x4fb695){return _0x4fb695['destroy']()['then'](function(){_0x44fd93[_0xc53e('0x17')](0xcc)[_0xc53e('0x16')]();});}};}function handleEntityNotFound(_0x7591c1,_0x4015c8){return function(_0x180811){if(!_0x180811){_0x7591c1['sendStatus'](0x194);}return _0x180811;};}function handleError(_0x5e5377,_0xe06e42){_0xe06e42=_0xe06e42||0x1f4;return function(_0x496167){logger[_0xc53e('0x23')](_0x496167[_0xc53e('0x24')]);if(_0x496167[_0xc53e('0x25')]){delete _0x496167[_0xc53e('0x25')];}_0x5e5377[_0xc53e('0x17')](_0xe06e42)['send'](_0x496167);};}exports[_0xc53e('0x26')]=function(_0x4b9f6a,_0x4d9a68){var _0x5c65d3={},_0x3c5056={},_0x57a1f5={'count':0x0,'rows':[]};var _0x28240a=_['map'](db[_0xc53e('0x27')]['rawAttributes'],function(_0x5ce216){return{'name':_0x5ce216[_0xc53e('0x28')],'type':_0x5ce216[_0xc53e('0x29')][_0xc53e('0x2a')]};});_0x3c5056[_0xc53e('0x2b')]=_[_0xc53e('0x2c')](_0x28240a,_0xc53e('0x25'));_0x3c5056[_0xc53e('0x2d')]=_[_0xc53e('0x2e')](_0x4b9f6a['query']);_0x3c5056[_0xc53e('0x2f')]=_[_0xc53e('0x30')](_0x3c5056[_0xc53e('0x2b')],_0x3c5056['query']);_0x5c65d3[_0xc53e('0x31')]=_['intersection'](_0x3c5056[_0xc53e('0x2b')],qs[_0xc53e('0x32')](_0x4b9f6a['query']['fields']));_0x5c65d3[_0xc53e('0x31')]=_0x5c65d3[_0xc53e('0x31')][_0xc53e('0x33')]?_0x5c65d3[_0xc53e('0x31')]:_0x3c5056[_0xc53e('0x2b')];if(!_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5c65d3['limit']=qs[_0xc53e('0x1b')](_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x1b')]);_0x5c65d3[_0xc53e('0x1a')]=qs[_0xc53e('0x1a')](_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x1a')]);}_0x5c65d3[_0xc53e('0x36')]=qs[_0xc53e('0x37')](_0x4b9f6a['query'][_0xc53e('0x37')]);_0x5c65d3['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x38')](_0x4b9f6a['query'],_0x3c5056[_0xc53e('0x2f')]));if(_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x39')]){_0x5c65d3['where']=_[_0xc53e('0x3a')](_0x5c65d3[_0xc53e('0x3b')],{'$or':_[_0xc53e('0x2c')](_0x28240a,function(_0x78eb5e){if(_0x78eb5e[_0xc53e('0x29')]!==_0xc53e('0x3c')){var _0x312c1b={};_0x312c1b[_0x78eb5e['name']]={'$like':'%'+_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x39')]+'%'};return _0x312c1b;}})});}_0x5c65d3=_[_0xc53e('0x3a')]({},_0x5c65d3,_0x4b9f6a['options']);var _0x70b6c3={'where':_0x5c65d3['where']};return db[_0xc53e('0x27')][_0xc53e('0x19')](_0x70b6c3)[_0xc53e('0x22')](function(_0xad1232){_0x57a1f5[_0xc53e('0x19')]=_0xad1232;if(_0x4b9f6a['query'][_0xc53e('0x3d')]){_0x5c65d3[_0xc53e('0x3e')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x5c65d3);})['then'](function(_0x52cf0a){_0x57a1f5[_0xc53e('0x3f')]=_0x52cf0a;return _0x57a1f5;})[_0xc53e('0x22')](respondWithFilteredResult(_0x4d9a68,_0x5c65d3))['catch'](handleError(_0x4d9a68,null));};exports[_0xc53e('0x40')]=function(_0x574983,_0x55d07d){var _0x53447e={'raw':!![],'where':{'id':_0x574983['params']['id']}},_0x255794={};_0x255794['model']=_[_0xc53e('0x2e')](db['MailSubstatus'][_0xc53e('0x41')]);_0x255794[_0xc53e('0x2d')]=_['keys'](_0x574983[_0xc53e('0x2d')]);_0x255794[_0xc53e('0x2f')]=_['intersection'](_0x255794[_0xc53e('0x2b')],_0x255794['query']);_0x53447e['attributes']=_['intersection'](_0x255794['model'],qs[_0xc53e('0x32')](_0x574983[_0xc53e('0x2d')][_0xc53e('0x32')]));_0x53447e['attributes']=_0x53447e[_0xc53e('0x31')][_0xc53e('0x33')]?_0x53447e['attributes']:_0x255794['model'];if(_0x574983[_0xc53e('0x2d')][_0xc53e('0x3d')]){_0x53447e[_0xc53e('0x3e')]=[{'all':!![]}];}_0x53447e=_['merge']({},_0x53447e,_0x574983[_0xc53e('0x42')]);return db[_0xc53e('0x27')][_0xc53e('0x43')](_0x53447e)[_0xc53e('0x22')](handleEntityNotFound(_0x55d07d,null))[_0xc53e('0x22')](respondWithResult(_0x55d07d,null))[_0xc53e('0x44')](handleError(_0x55d07d,null));};exports[_0xc53e('0x45')]=function(_0x49b2e8,_0xed757e){return db[_0xc53e('0x27')][_0xc53e('0x45')](_0x49b2e8['body'],{})[_0xc53e('0x22')](respondWithResult(_0xed757e,0xc9))[_0xc53e('0x44')](handleError(_0xed757e,null));};exports[_0xc53e('0x21')]=function(_0x15e744,_0xa7d256){if(_0x15e744[_0xc53e('0x46')]['id']){delete _0x15e744['body']['id'];}return db[_0xc53e('0x27')][_0xc53e('0x43')]({'where':{'id':_0x15e744[_0xc53e('0x47')]['id']}})['then'](handleEntityNotFound(_0xa7d256,null))[_0xc53e('0x22')](saveUpdates(_0x15e744[_0xc53e('0x46')],null))[_0xc53e('0x22')](respondWithResult(_0xa7d256,null))[_0xc53e('0x44')](handleError(_0xa7d256,null));};exports[_0xc53e('0x48')]=function(_0x1ac62e,_0x1a5a8f){return db[_0xc53e('0x27')][_0xc53e('0x43')]({'where':{'id':_0x1ac62e[_0xc53e('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a5a8f,null))[_0xc53e('0x22')](removeEntity(_0x1a5a8f,null))[_0xc53e('0x44')](handleError(_0x1a5a8f,null));};exports[_0xc53e('0x49')]=function(_0x3d74ac,_0x136544){return db['MailSubstatus']['describe']()[_0xc53e('0x22')](respondWithResult(_0x136544,null))['catch'](handleError(_0x136544,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c98d159..87e9afe 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 _0xcae2=['mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus'];(function(_0x212b03,_0x1f1b50){var _0x423115=function(_0x35ab9d){while(--_0x35ab9d){_0x212b03['push'](_0x212b03['shift']());}};_0x423115(++_0x1f1b50);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var logger=require(_0x2cae('0x2'))(_0x2cae('0x3'));var moment=require(_0x2cae('0x4'));var BPromise=require(_0x2cae('0x5'));var rp=require(_0x2cae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cae('0x7'));var config=require(_0x2cae('0x8'));var attributes=require(_0x2cae('0x9'));module[_0x2cae('0xa')]=function(_0x57cbf8,_0x3a3e3b){return _0x57cbf8[_0x2cae('0xb')](_0x2cae('0xc'),attributes,{'tableName':_0x2cae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd509=['exports','define','mail_substatuses','../../config/logger','api','moment','path','rimraf','./mailSubstatus.attributes'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d50('0x0'))(_0x9d50('0x1'));var moment=require(_0x9d50('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d50('0x3'));var rimraf=require(_0x9d50('0x4'));var config=require('../../config/environment');var attributes=require(_0x9d50('0x5'));module[_0x9d50('0x6')]=function(_0x1800ce,_0x54afc4){return _0x1800ce[_0x9d50('0x7')]('MailSubstatus',attributes,{'tableName':_0x9d50('0x8'),'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 9e15801..d1587f9 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 _0x6f7a=['http','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x59eaf0,_0x5a94ac){_0x59eaf0=_0x59eaf0-0x0;var _0x4c79b8=_0x6f7a[_0x59eaf0];return _0x4c79b8;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});} \ No newline at end of file +var _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x23d7a7,_0x4b0f57){var _0x43f390=function(_0x3528d0){while(--_0x3528d0){_0x23d7a7['push'](_0x23d7a7['shift']());}};_0x43f390(++_0x4b0f57);}(_0x99e9,0xb4));var _0x999e=function(_0x37eca7,_0x3e016e){_0x37eca7=_0x37eca7-0x0;var _0x222bce=_0x99e9[_0x37eca7];return _0x222bce;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ab3e23e..ba2d0a8 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 _0xb7f8=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','get'];(function(_0x117581,_0x307e77){var _0x25cfa7=function(_0xcb89ee){while(--_0xcb89ee){_0x117581['push'](_0x117581['shift']());}};_0x25cfa7(++_0x307e77);}(_0xb7f8,0x197));var _0x8b7f=function(_0x3a31a5,_0x5f561f){_0x3a31a5=_0x3a31a5-0x0;var _0x30763c=_0xb7f8[_0x3a31a5];return _0x30763c;};'use strict';var multer=require(_0x8b7f('0x0'));var util=require('util');var path=require(_0x8b7f('0x1'));var timeout=require(_0x8b7f('0x2'));var express=require(_0x8b7f('0x3'));var router=express[_0x8b7f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8b7f('0x5'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x8b7f('0x6')]('/',auth[_0x8b7f('0x7')](),controller[_0x8b7f('0x8')]);router[_0x8b7f('0x6')](_0x8b7f('0x9'),auth['isAuthenticated'](),controller[_0x8b7f('0xa')]);router[_0x8b7f('0x6')](_0x8b7f('0xb'),auth[_0x8b7f('0x7')](),controller[_0x8b7f('0xc')]);router[_0x8b7f('0xd')]('/',auth[_0x8b7f('0x7')](),controller['create']);router[_0x8b7f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8b7f('0xf')]);router[_0x8b7f('0x10')](_0x8b7f('0xb'),auth[_0x8b7f('0x7')](),controller[_0x8b7f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0188=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','multer','path'];(function(_0x5edc57,_0x323ee5){var _0x3661aa=function(_0x5606cb){while(--_0x5606cb){_0x5edc57['push'](_0x5edc57['shift']());}};_0x3661aa(++_0x323ee5);}(_0x0188,0x11b));var _0x8018=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x0188[_0x4bacb6];return _0x58c029;};'use strict';var multer=require(_0x8018('0x0'));var util=require('util');var path=require(_0x8018('0x1'));var timeout=require(_0x8018('0x2'));var express=require('express');var router=express[_0x8018('0x3')]();var auth=require(_0x8018('0x4'));var interaction=require(_0x8018('0x5'));var config=require(_0x8018('0x6'));var controller=require(_0x8018('0x7'));router[_0x8018('0x8')]('/',auth[_0x8018('0x9')](),controller['index']);router[_0x8018('0x8')](_0x8018('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8018('0x8')](_0x8018('0xb'),auth[_0x8018('0x9')](),controller[_0x8018('0xc')]);router[_0x8018('0xd')]('/',auth[_0x8018('0x9')](),controller[_0x8018('0xe')]);router[_0x8018('0xf')](_0x8018('0xb'),auth['isAuthenticated'](),controller[_0x8018('0x10')]);router[_0x8018('0x11')](_0x8018('0xb'),auth[_0x8018('0x9')](),controller['destroy']);module[_0x8018('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index c340e7d..42f48bf 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 _0x0f66=['queue','DATE','moment','sequelize','exports','ENUM','agent'];(function(_0xf6bb6d,_0x39f16b){var _0x586466=function(_0x4eb3c0){while(--_0x4eb3c0){_0xf6bb6d['push'](_0xf6bb6d['shift']());}};_0x586466(++_0x39f16b);}(_0x0f66,0x6b));var _0x60f6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x0f66[_0x4fbfd9];return _0x31dc94;};'use strict';var moment=require(_0x60f6('0x0'));var Sequelize=require(_0x60f6('0x1'));module[_0x60f6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x60f6('0x3')]('account',_0x60f6('0x4'),_0x60f6('0x5')),'allowNull':![],'defaultValue':_0x60f6('0x5')},'transferredAt':{'type':Sequelize[_0x60f6('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x3ffc=['moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x89d57e,_0x16fa45){var _0x501fa2=function(_0x5517c7){while(--_0x5517c7){_0x89d57e['push'](_0x89d57e['shift']());}};_0x501fa2(++_0x16fa45);}(_0x3ffc,0xb4));var _0xc3ff=function(_0x13c4eb,_0x5d218c){_0x13c4eb=_0x13c4eb-0x0;var _0x421546=_0x3ffc[_0x13c4eb];return _0x421546;};'use strict';var moment=require(_0xc3ff('0x0'));var Sequelize=require(_0xc3ff('0x1'));module[_0xc3ff('0x2')]={'uniqueid':{'type':Sequelize[_0xc3ff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc3ff('0x4')](_0xc3ff('0x5'),_0xc3ff('0x6'),_0xc3ff('0x7')),'allowNull':![],'defaultValue':_0xc3ff('0x7')},'transferredAt':{'type':Sequelize[_0xc3ff('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 77adcff..8269037 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x276c03,_0x67f7e0){var _0x1b649f=function(_0x5290da){while(--_0x5290da){_0x276c03['push'](_0x276c03['shift']());}};_0x1b649f(++_0x67f7e0);}(_0x7a54,0x106));var _0x47a5=function(_0x3b3f2e,_0x289162){_0x3b3f2e=_0x3b3f2e-0x0;var _0x29d3fa=_0x7a54[_0x3b3f2e];return _0x29d3fa;};'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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x1a772f,_0x2099b5){var _0x18d7f1=function(_0x3e55e3){while(--_0x3e55e3){_0x1a772f['push'](_0x1a772f['shift']());}};_0x18d7f1(++_0x2099b5);}(_0x7a54,0x106));var _0x47a5=function(_0x16b183,_0x1a6ee4){_0x16b183=_0x16b183-0x0;var _0x2f0c89=_0x7a54[_0x16b183];return _0x2f0c89;};'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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 017935b..eae82c1 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 _0xc45e=['bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x493a6b,_0x67aeee){var _0x510548=function(_0x47bf01){while(--_0x47bf01){_0x493a6b['push'](_0x493a6b['shift']());}};_0x510548(++_0x67aeee);}(_0xc45e,0x141));var _0xec45=function(_0x403e34,_0xd256be){_0x403e34=_0x403e34-0x0;var _0x11ad75=_0xc45e[_0x403e34];return _0x11ad75;};'use strict';var _=require(_0xec45('0x0'));var util=require(_0xec45('0x1'));var logger=require(_0xec45('0x2'))('api');var moment=require('moment');var BPromise=require(_0xec45('0x3'));var rp=require(_0xec45('0x4'));var fs=require('fs');var path=require(_0xec45('0x5'));var rimraf=require('rimraf');var config=require(_0xec45('0x6'));var attributes=require(_0xec45('0x7'));module['exports']=function(_0x283b14,_0x4eb8f9){return _0x283b14[_0xec45('0x8')](_0xec45('0x9'),attributes,{'tableName':_0xec45('0xa'),'paranoid':![],'indexes':[{'name':_0xec45('0xb'),'fields':[_0xec45('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87ef=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport'];(function(_0x186514,_0x52a05a){var _0x18fa5e=function(_0x24becc){while(--_0x24becc){_0x186514['push'](_0x186514['shift']());}};_0x18fa5e(++_0x52a05a);}(_0x87ef,0xef));var _0xf87e=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x87ef[_0x2c2980];return _0x2a20a9;};'use strict';var _=require(_0xf87e('0x0'));var util=require(_0xf87e('0x1'));var logger=require(_0xf87e('0x2'))(_0xf87e('0x3'));var moment=require(_0xf87e('0x4'));var BPromise=require(_0xf87e('0x5'));var rp=require(_0xf87e('0x6'));var fs=require('fs');var path=require(_0xf87e('0x7'));var rimraf=require(_0xf87e('0x8'));var config=require(_0xf87e('0x9'));var attributes=require('./mailTransferReport.attributes');module[_0xf87e('0xa')]=function(_0x234ba1,_0x1262a1){return _0x234ba1[_0xf87e('0xb')](_0xf87e('0xc'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xf87e('0xd'),'fields':[_0xf87e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 325f3ec..7a609f2 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 _0x95b1=['code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','debug','request\x20sent','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95b1,0x1a8));var _0x195b=function(_0x44ec4c,_0x37b4c9){_0x44ec4c=_0x44ec4c-0x0;var _0x4e65e6=_0x95b1[_0x44ec4c];return _0x4e65e6;};'use strict';var _=require(_0x195b('0x0'));var util=require(_0x195b('0x1'));var moment=require('moment');var BPromise=require(_0x195b('0x2'));var rs=require(_0x195b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x195b('0x4'))['db'];var utils=require(_0x195b('0x5'));var logger=require(_0x195b('0x6'))(_0x195b('0x7'));var config=require('../../config/environment');var jayson=require(_0x195b('0x8'));var client=jayson['client'][_0x195b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2efb73,_0x34019b,_0xd114bf){return new BPromise(function(_0x2b463a,_0x5d4ad3){return client[_0x195b('0xa')](_0x2efb73,_0xd114bf)[_0x195b('0xb')](function(_0x7b5ad2){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x34019b,'request\x20sent');logger[_0x195b('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x34019b,_0x195b('0xd'),JSON[_0x195b('0xe')](_0x7b5ad2));if(_0x7b5ad2[_0x195b('0xf')]){if(_0x7b5ad2['error'][_0x195b('0x10')]===0x1f4){logger[_0x195b('0xf')](_0x195b('0x11'),_0x34019b,_0x7b5ad2['error'][_0x195b('0x12')]);return _0x5d4ad3(_0x7b5ad2[_0x195b('0xf')][_0x195b('0x12')]);}logger[_0x195b('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x34019b,_0x7b5ad2[_0x195b('0xf')][_0x195b('0x12')]);return _0x2b463a(_0x7b5ad2['error'][_0x195b('0x12')]);}else{logger[_0x195b('0x13')](_0x195b('0x11'),_0x34019b,_0x195b('0xd'));_0x2b463a(_0x7b5ad2[_0x195b('0x14')][_0x195b('0x12')]);}})[_0x195b('0x15')](function(_0x209a3e){logger[_0x195b('0xf')](_0x195b('0x11'),_0x34019b,_0x209a3e);_0x5d4ad3(_0x209a3e);});});} \ No newline at end of file +var _0xc5b9=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5a086d,_0x177557){var _0x39c15f=function(_0x5c4379){while(--_0x5c4379){_0x5a086d['push'](_0x5a086d['shift']());}};_0x39c15f(++_0x177557);}(_0xc5b9,0x1d4));var _0x9c5b=function(_0x22ed4b,_0x20609c){_0x22ed4b=_0x22ed4b-0x0;var _0x4e9cf6=_0xc5b9[_0x22ed4b];return _0x4e9cf6;};'use strict';var _=require(_0x9c5b('0x0'));var util=require(_0x9c5b('0x1'));var moment=require(_0x9c5b('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c5b('0x3'));var fs=require('fs');var Redis=require(_0x9c5b('0x4'));var db=require(_0x9c5b('0x5'))['db'];var utils=require(_0x9c5b('0x6'));var logger=require('../../config/logger')(_0x9c5b('0x7'));var config=require(_0x9c5b('0x8'));var jayson=require(_0x9c5b('0x9'));var client=jayson[_0x9c5b('0xa')][_0x9c5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25f426,_0x363f8c,_0x1cc4ea){return new BPromise(function(_0x14ddf6,_0x34c158){return client['request'](_0x25f426,_0x1cc4ea)[_0x9c5b('0xc')](function(_0x20410c){logger[_0x9c5b('0xd')](_0x9c5b('0xe'),_0x363f8c,_0x9c5b('0xf'));logger['debug'](_0x9c5b('0x10'),_0x363f8c,_0x9c5b('0xf'),JSON[_0x9c5b('0x11')](_0x20410c));if(_0x20410c[_0x9c5b('0x12')]){if(_0x20410c[_0x9c5b('0x12')][_0x9c5b('0x13')]===0x1f4){logger[_0x9c5b('0x12')](_0x9c5b('0xe'),_0x363f8c,_0x20410c[_0x9c5b('0x12')]['message']);return _0x34c158(_0x20410c[_0x9c5b('0x12')][_0x9c5b('0x14')]);}logger[_0x9c5b('0x12')](_0x9c5b('0xe'),_0x363f8c,_0x20410c[_0x9c5b('0x12')][_0x9c5b('0x14')]);return _0x14ddf6(_0x20410c['error'][_0x9c5b('0x14')]);}else{logger[_0x9c5b('0xd')](_0x9c5b('0xe'),_0x363f8c,'request\x20sent');_0x14ddf6(_0x20410c['result'][_0x9c5b('0x14')]);}})[_0x9c5b('0x15')](function(_0x9116f7){logger[_0x9c5b('0x12')](_0x9c5b('0xe'),_0x363f8c,_0x9116f7);_0x34c158(_0x9116f7);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f0a7a5e..0f19c35 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 _0x23bb=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x23bb,0x6d));var _0xb23b=function(_0x1ceafa,_0x252713){_0x1ceafa=_0x1ceafa-0x0;var _0x2cb283=_0x23bb[_0x1ceafa];return _0x2cb283;};'use strict';var multer=require(_0xb23b('0x0'));var util=require('util');var path=require(_0xb23b('0x1'));var timeout=require(_0xb23b('0x2'));var express=require(_0xb23b('0x3'));var router=express['Router']();var auth=require(_0xb23b('0x4'));var interaction=require(_0xb23b('0x5'));var config=require(_0xb23b('0x6'));var controller=require(_0xb23b('0x7'));router[_0xb23b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb23b('0x9'),auth[_0xb23b('0xa')](),controller['describe']);router['get'](_0xb23b('0xb'),auth[_0xb23b('0xa')](),controller[_0xb23b('0xc')]);router[_0xb23b('0xd')]('/',auth['isAuthenticated'](),controller[_0xb23b('0xe')]);router[_0xb23b('0xf')](_0xb23b('0xb'),auth['isAuthenticated'](),controller[_0xb23b('0x10')]);router[_0xb23b('0x11')]('/:id',auth[_0xb23b('0xa')](),controller[_0xb23b('0x12')]);module[_0xb23b('0x13')]=router; \ No newline at end of file +var _0x99f4=['path','express','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x99f4,0x167));var _0x499f=function(_0x5d39d5,_0x15c987){_0x5d39d5=_0x5d39d5-0x0;var _0x371e07=_0x99f4[_0x5d39d5];return _0x371e07;};'use strict';var multer=require(_0x499f('0x0'));var util=require(_0x499f('0x1'));var path=require(_0x499f('0x2'));var timeout=require('connect-timeout');var express=require(_0x499f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x499f('0x4'));var controller=require(_0x499f('0x5'));router[_0x499f('0x6')]('/',auth[_0x499f('0x7')](),controller[_0x499f('0x8')]);router['get'](_0x499f('0x9'),auth[_0x499f('0x7')](),controller[_0x499f('0xa')]);router[_0x499f('0x6')](_0x499f('0xb'),auth[_0x499f('0x7')](),controller[_0x499f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x499f('0xd')]);router[_0x499f('0xe')]('/:id',auth[_0x499f('0x7')](),controller[_0x499f('0xf')]);router[_0x499f('0x10')](_0x499f('0xb'),auth[_0x499f('0x7')](),controller[_0x499f('0x11')]);module[_0x499f('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 902d8e0..414970c 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 _0x419b=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','diff'];(function(_0x2aaa6f,_0x30148b){var _0x4e599f=function(_0x3a39a4){while(--_0x3a39a4){_0x2aaa6f['push'](_0x2aaa6f['shift']());}};_0x4e599f(++_0x30148b);}(_0x419b,0x1a1));var _0xb419=function(_0x113c46,_0x419bc2){_0x113c46=_0x113c46-0x0;var _0x42c8fd=_0x419b[_0x113c46];return _0x42c8fd;};'use strict';var Sequelize=require(_0xb419('0x0'));var moment=require(_0xb419('0x1'));module[_0xb419('0x2')]={'channel':{'type':Sequelize[_0xb419('0x3')]},'membername':{'type':Sequelize[_0xb419('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb419('0x3')],'defaultValue':_0xb419('0x4'),'comment':_0xb419('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb419('0x6')],'set':function(_0x5b7724){var _0x250a6f=moment(_0x5b7724);var _0x15d0b3=moment(this['getDataValue']('enterAt'));var _0x4db28a=_0x250a6f[_0xb419('0x7')](_0x15d0b3,_0xb419('0x8'));this[_0xb419('0x9')](_0xb419('0xa'),_0x5b7724);this[_0xb419('0x9')](_0xb419('0xb'),_0x4db28a||null);}},'data1':{'type':Sequelize[_0xb419('0x3')],'comment':_0xb419('0xc')},'data2':{'type':Sequelize[_0xb419('0x3')],'comment':_0xb419('0xd')},'data3':{'type':Sequelize[_0xb419('0x3')],'comment':_0xb419('0xe')},'data4':{'type':Sequelize[_0xb419('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb419('0x3')],'comment':_0xb419('0xf')},'role':{'type':Sequelize[_0xb419('0x3')]},'internal':{'type':Sequelize[_0xb419('0x10')]},'uniqueid':{'type':Sequelize[_0xb419('0x3')]}}; \ No newline at end of file +var _0x38a0=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration'];(function(_0x47d0bc,_0x5adbe7){var _0x12e3dd=function(_0xd7cd68){while(--_0xd7cd68){_0x47d0bc['push'](_0x47d0bc['shift']());}};_0x12e3dd(++_0x5adbe7);}(_0x38a0,0x174));var _0x038a=function(_0x1eb2c1,_0x488105){_0x1eb2c1=_0x1eb2c1-0x0;var _0x346953=_0x38a0[_0x1eb2c1];return _0x346953;};'use strict';var Sequelize=require(_0x038a('0x0'));var moment=require(_0x038a('0x1'));module[_0x038a('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x038a('0x3')]},'interface':{'type':Sequelize[_0x038a('0x3')]},'type':{'type':Sequelize[_0x038a('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x038a('0x4')]},'enterAt':{'type':Sequelize[_0x038a('0x5')]},'exitAt':{'type':Sequelize[_0x038a('0x5')],'set':function(_0x3770ed){var _0x20f326=moment(_0x3770ed);var _0x2598f4=moment(this[_0x038a('0x6')](_0x038a('0x7')));var _0x84c4f8=_0x20f326[_0x038a('0x8')](_0x2598f4,'seconds');this[_0x038a('0x9')](_0x038a('0xa'),_0x3770ed);this[_0x038a('0x9')](_0x038a('0xb'),_0x84c4f8||null);}},'data1':{'type':Sequelize[_0x038a('0x3')],'comment':_0x038a('0xc')},'data2':{'type':Sequelize[_0x038a('0x3')],'comment':_0x038a('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x038a('0x3')],'comment':_0x038a('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x038a('0xf')},'role':{'type':Sequelize[_0x038a('0x3')]},'internal':{'type':Sequelize[_0x038a('0x4')]},'uniqueid':{'type':Sequelize[_0x038a('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index bacebb0..099d7aa 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 _0xe1f8=['index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','MemberReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send'];(function(_0x724884,_0x257957){var _0x3438dd=function(_0x2fd1f2){while(--_0x2fd1f2){_0x724884['push'](_0x724884['shift']());}};_0x3438dd(++_0x257957);}(_0xe1f8,0x19a));var _0x8e1f=function(_0x15d1ae,_0x219256){_0x15d1ae=_0x15d1ae-0x0;var _0x32ab68=_0xe1f8[_0x15d1ae];return _0x32ab68;};'use strict';var pdf=require(_0x8e1f('0x0'));var emlformat=require(_0x8e1f('0x1'));var rimraf=require(_0x8e1f('0x2'));var zipdir=require(_0x8e1f('0x3'));var jsonpatch=require(_0x8e1f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8e1f('0x5'));var Mustache=require(_0x8e1f('0x6'));var util=require('util');var path=require(_0x8e1f('0x7'));var sox=require(_0x8e1f('0x8'));var csv=require('to-csv');var ejs=require(_0x8e1f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e1f('0xa'));var crypto=require(_0x8e1f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8e1f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8e1f('0xd'));var Papa=require(_0x8e1f('0xe'));var Redis=require(_0x8e1f('0xf'));var authService=require(_0x8e1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8e1f('0x11'));var hardwareService=require(_0x8e1f('0x12'));var logger=require(_0x8e1f('0x13'))(_0x8e1f('0x14'));var utils=require(_0x8e1f('0x15'));var config=require(_0x8e1f('0x16'));var db=require(_0x8e1f('0x17'))['db'];function respondWithStatusCode(_0x36e344,_0x5b6840){_0x5b6840=_0x5b6840||0xcc;return function(_0x4519aa){if(_0x4519aa){return _0x36e344['sendStatus'](_0x5b6840);}return _0x36e344[_0x8e1f('0x18')](_0x5b6840)[_0x8e1f('0x19')]();};}function respondWithResult(_0x1d0176,_0x104a59){_0x104a59=_0x104a59||0xc8;return function(_0x18dda0){if(_0x18dda0){return _0x1d0176['status'](_0x104a59)[_0x8e1f('0x1a')](_0x18dda0);}};}function respondWithFilteredResult(_0x2ab0bc,_0x4f4a03){return function(_0x3b5067){if(_0x3b5067){var _0x1c7a83=_0x3b5067[_0x8e1f('0x1b')],_0x442809=_0x4f4a03[_0x8e1f('0x1c')],_0x147059=_0x4f4a03[_0x8e1f('0x1c')]+_0x4f4a03['limit'],_0x54b11d;if(_0x147059>=_0x1c7a83){_0x147059=_0x1c7a83;_0x54b11d=0xc8;}else{_0x54b11d=0xce;}_0x2ab0bc[_0x8e1f('0x18')](_0x54b11d);return _0x2ab0bc[_0x8e1f('0x1d')](_0x8e1f('0x1e'),_0x442809+'-'+_0x147059+'/'+_0x1c7a83)[_0x8e1f('0x1a')](_0x3b5067);}return null;};}function patchUpdates(_0x5e5dc7){return function(_0x2b41ad){try{jsonpatch[_0x8e1f('0x1f')](_0x2b41ad,_0x5e5dc7,!![]);}catch(_0x389f4a){return BPromise[_0x8e1f('0x20')](_0x389f4a);}return _0x2b41ad[_0x8e1f('0x21')]();};}function saveUpdates(_0x3d0897,_0x53c0cd){return function(_0x2a0fb7){if(_0x2a0fb7){return _0x2a0fb7[_0x8e1f('0x22')](_0x3d0897)[_0x8e1f('0x23')](function(_0x5c6f68){return _0x5c6f68;});}return null;};}function removeEntity(_0x25198f,_0x36637b){return function(_0x28bedd){if(_0x28bedd){return _0x28bedd['destroy']()[_0x8e1f('0x23')](function(){_0x25198f[_0x8e1f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e852,_0x22689f){return function(_0xed4b05){if(!_0xed4b05){_0x55e852['sendStatus'](0x194);}return _0xed4b05;};}function handleError(_0x10317c,_0x4ac191){_0x4ac191=_0x4ac191||0x1f4;return function(_0x11da06){logger[_0x8e1f('0x24')](_0x11da06[_0x8e1f('0x25')]);if(_0x11da06[_0x8e1f('0x26')]){delete _0x11da06[_0x8e1f('0x26')];}_0x10317c[_0x8e1f('0x18')](_0x4ac191)[_0x8e1f('0x27')](_0x11da06);};}exports[_0x8e1f('0x28')]=function(_0x28f798,_0x5c4533){var _0x4d4260={},_0x20ca25={},_0x5ca661={'count':0x0,'rows':[]};var _0xb08e0b=_[_0x8e1f('0x29')](db['MemberReport'][_0x8e1f('0x2a')],function(_0x3d1864){return{'name':_0x3d1864['fieldName'],'type':_0x3d1864[_0x8e1f('0x2b')]['key']};});_0x20ca25[_0x8e1f('0x2c')]=_['map'](_0xb08e0b,_0x8e1f('0x26'));_0x20ca25[_0x8e1f('0x2d')]=_[_0x8e1f('0x2e')](_0x28f798[_0x8e1f('0x2d')]);_0x20ca25[_0x8e1f('0x2f')]=_[_0x8e1f('0x30')](_0x20ca25['model'],_0x20ca25[_0x8e1f('0x2d')]);_0x4d4260['attributes']=_['intersection'](_0x20ca25[_0x8e1f('0x2c')],qs[_0x8e1f('0x31')](_0x28f798['query']['fields']));_0x4d4260[_0x8e1f('0x32')]=_0x4d4260[_0x8e1f('0x32')][_0x8e1f('0x33')]?_0x4d4260[_0x8e1f('0x32')]:_0x20ca25[_0x8e1f('0x2c')];if(!_0x28f798[_0x8e1f('0x2d')][_0x8e1f('0x34')]('nolimit')){_0x4d4260[_0x8e1f('0x35')]=qs[_0x8e1f('0x35')](_0x28f798[_0x8e1f('0x2d')][_0x8e1f('0x35')]);_0x4d4260[_0x8e1f('0x1c')]=qs[_0x8e1f('0x1c')](_0x28f798[_0x8e1f('0x2d')][_0x8e1f('0x1c')]);}_0x4d4260[_0x8e1f('0x36')]=qs[_0x8e1f('0x37')](_0x28f798[_0x8e1f('0x2d')][_0x8e1f('0x37')]);_0x4d4260['where']=qs[_0x8e1f('0x2f')](_[_0x8e1f('0x38')](_0x28f798[_0x8e1f('0x2d')],_0x20ca25['filters']));if(_0x28f798['query'][_0x8e1f('0x39')]){_0x4d4260[_0x8e1f('0x3a')]=_[_0x8e1f('0x3b')](_0x4d4260[_0x8e1f('0x3a')],{'$or':_['map'](_0xb08e0b,function(_0x22fb75){if(_0x22fb75[_0x8e1f('0x2b')]!==_0x8e1f('0x3c')){var _0xd12876={};_0xd12876[_0x22fb75[_0x8e1f('0x26')]]={'$like':'%'+_0x28f798[_0x8e1f('0x2d')][_0x8e1f('0x39')]+'%'};return _0xd12876;}})});}_0x4d4260=_[_0x8e1f('0x3b')]({},_0x4d4260,_0x28f798[_0x8e1f('0x3d')]);var _0x586f02={'where':_0x4d4260['where']};return db[_0x8e1f('0x3e')][_0x8e1f('0x1b')](_0x586f02)[_0x8e1f('0x23')](function(_0x166198){_0x5ca661[_0x8e1f('0x1b')]=_0x166198;if(_0x28f798['query'][_0x8e1f('0x3f')]){_0x4d4260[_0x8e1f('0x40')]=[{'all':!![]}];}return db[_0x8e1f('0x3e')][_0x8e1f('0x41')](_0x4d4260);})[_0x8e1f('0x23')](function(_0x4fbcdb){_0x5ca661[_0x8e1f('0x42')]=_0x4fbcdb;return _0x5ca661;})['then'](respondWithFilteredResult(_0x5c4533,_0x4d4260))[_0x8e1f('0x43')](handleError(_0x5c4533,null));};exports[_0x8e1f('0x44')]=function(_0x31e98b,_0x16a79f){var _0x3bb331={'raw':!![],'where':{'id':_0x31e98b[_0x8e1f('0x45')]['id']}},_0x310b1f={};_0x310b1f['model']=_[_0x8e1f('0x2e')](db['MemberReport'][_0x8e1f('0x2a')]);_0x310b1f[_0x8e1f('0x2d')]=_['keys'](_0x31e98b[_0x8e1f('0x2d')]);_0x310b1f[_0x8e1f('0x2f')]=_[_0x8e1f('0x30')](_0x310b1f['model'],_0x310b1f[_0x8e1f('0x2d')]);_0x3bb331[_0x8e1f('0x32')]=_[_0x8e1f('0x30')](_0x310b1f[_0x8e1f('0x2c')],qs[_0x8e1f('0x31')](_0x31e98b[_0x8e1f('0x2d')]['fields']));_0x3bb331['attributes']=_0x3bb331[_0x8e1f('0x32')][_0x8e1f('0x33')]?_0x3bb331[_0x8e1f('0x32')]:_0x310b1f['model'];if(_0x31e98b[_0x8e1f('0x2d')][_0x8e1f('0x3f')]){_0x3bb331[_0x8e1f('0x40')]=[{'all':!![]}];}_0x3bb331=_['merge']({},_0x3bb331,_0x31e98b[_0x8e1f('0x3d')]);return db[_0x8e1f('0x3e')][_0x8e1f('0x46')](_0x3bb331)['then'](handleEntityNotFound(_0x16a79f,null))[_0x8e1f('0x23')](respondWithResult(_0x16a79f,null))[_0x8e1f('0x43')](handleError(_0x16a79f,null));};exports[_0x8e1f('0x47')]=function(_0x2fe178,_0x4c7ed3){return db[_0x8e1f('0x3e')][_0x8e1f('0x47')](_0x2fe178[_0x8e1f('0x48')],{})[_0x8e1f('0x23')](respondWithResult(_0x4c7ed3,0xc9))[_0x8e1f('0x43')](handleError(_0x4c7ed3,null));};exports[_0x8e1f('0x22')]=function(_0x66aed,_0x43e2dd){if(_0x66aed[_0x8e1f('0x48')]['id']){delete _0x66aed[_0x8e1f('0x48')]['id'];}return db[_0x8e1f('0x3e')][_0x8e1f('0x46')]({'where':{'id':_0x66aed[_0x8e1f('0x45')]['id']}})[_0x8e1f('0x23')](handleEntityNotFound(_0x43e2dd,null))['then'](saveUpdates(_0x66aed[_0x8e1f('0x48')],null))[_0x8e1f('0x23')](respondWithResult(_0x43e2dd,null))[_0x8e1f('0x43')](handleError(_0x43e2dd,null));};exports[_0x8e1f('0x49')]=function(_0x782add,_0x1a1cdb){return db[_0x8e1f('0x3e')][_0x8e1f('0x46')]({'where':{'id':_0x782add[_0x8e1f('0x45')]['id']}})[_0x8e1f('0x23')](handleEntityNotFound(_0x1a1cdb,null))[_0x8e1f('0x23')](removeEntity(_0x1a1cdb,null))[_0x8e1f('0x43')](handleError(_0x1a1cdb,null));};exports[_0x8e1f('0x4a')]=function(_0x12e68e,_0x67e23b){return db['MemberReport'][_0x8e1f('0x4a')]()[_0x8e1f('0x23')](respondWithResult(_0x67e23b,null))[_0x8e1f('0x43')](handleError(_0x67e23b,null));}; \ No newline at end of file +var _0x7b48=['to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','json','count','offset','update','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x2c8e8d,_0x35021e){var _0xf71d23=function(_0x234be5){while(--_0x234be5){_0x2c8e8d['push'](_0x2c8e8d['shift']());}};_0xf71d23(++_0x35021e);}(_0x7b48,0x86));var _0x87b4=function(_0x324e58,_0x5667bf){_0x324e58=_0x324e58-0x0;var _0x41bda1=_0x7b48[_0x324e58];return _0x41bda1;};'use strict';var pdf=require(_0x87b4('0x0'));var emlformat=require(_0x87b4('0x1'));var rimraf=require(_0x87b4('0x2'));var zipdir=require(_0x87b4('0x3'));var jsonpatch=require(_0x87b4('0x4'));var rp=require(_0x87b4('0x5'));var moment=require(_0x87b4('0x6'));var BPromise=require(_0x87b4('0x7'));var Mustache=require(_0x87b4('0x8'));var util=require(_0x87b4('0x9'));var path=require(_0x87b4('0xa'));var sox=require(_0x87b4('0xb'));var csv=require(_0x87b4('0xc'));var ejs=require(_0x87b4('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x87b4('0xe'));var crypto=require(_0x87b4('0xf'));var jsforce=require(_0x87b4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x87b4('0xc'));var querystring=require(_0x87b4('0x11'));var Papa=require(_0x87b4('0x12'));var Redis=require(_0x87b4('0x13'));var authService=require(_0x87b4('0x14'));var qs=require(_0x87b4('0x15'));var as=require(_0x87b4('0x16'));var hardwareService=require(_0x87b4('0x17'));var logger=require('../../config/logger')(_0x87b4('0x18'));var utils=require(_0x87b4('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb1b4,_0x3627c5){_0x3627c5=_0x3627c5||0xcc;return function(_0x2ed564){if(_0x2ed564){return _0x3eb1b4[_0x87b4('0x1a')](_0x3627c5);}return _0x3eb1b4['status'](_0x3627c5)[_0x87b4('0x1b')]();};}function respondWithResult(_0x2087b3,_0x36dcfc){_0x36dcfc=_0x36dcfc||0xc8;return function(_0x54f7ee){if(_0x54f7ee){return _0x2087b3[_0x87b4('0x1c')](_0x36dcfc)[_0x87b4('0x1d')](_0x54f7ee);}};}function respondWithFilteredResult(_0x4a5a4c,_0x5e1351){return function(_0x1afaf5){if(_0x1afaf5){var _0x5185dc=_0x1afaf5[_0x87b4('0x1e')],_0x11f172=_0x5e1351[_0x87b4('0x1f')],_0x44a4be=_0x5e1351[_0x87b4('0x1f')]+_0x5e1351['limit'],_0x597253;if(_0x44a4be>=_0x5185dc){_0x44a4be=_0x5185dc;_0x597253=0xc8;}else{_0x597253=0xce;}_0x4a5a4c[_0x87b4('0x1c')](_0x597253);return _0x4a5a4c['set']('Content-Range',_0x11f172+'-'+_0x44a4be+'/'+_0x5185dc)[_0x87b4('0x1d')](_0x1afaf5);}return null;};}function patchUpdates(_0x1eeaa7){return function(_0x3f8141){try{jsonpatch['apply'](_0x3f8141,_0x1eeaa7,!![]);}catch(_0x49a107){return BPromise['reject'](_0x49a107);}return _0x3f8141['save']();};}function saveUpdates(_0x3c7491,_0xfd8732){return function(_0x25baad){if(_0x25baad){return _0x25baad[_0x87b4('0x20')](_0x3c7491)['then'](function(_0x234cdc){return _0x234cdc;});}return null;};}function removeEntity(_0x2b1f56,_0x158ca1){return function(_0x5b9f13){if(_0x5b9f13){return _0x5b9f13[_0x87b4('0x21')]()['then'](function(){_0x2b1f56['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a0b72,_0x346f30){return function(_0x299c69){if(!_0x299c69){_0x1a0b72[_0x87b4('0x1a')](0x194);}return _0x299c69;};}function handleError(_0x1a6727,_0x375d4c){_0x375d4c=_0x375d4c||0x1f4;return function(_0x109a0c){logger[_0x87b4('0x22')](_0x109a0c[_0x87b4('0x23')]);if(_0x109a0c[_0x87b4('0x24')]){delete _0x109a0c[_0x87b4('0x24')];}_0x1a6727[_0x87b4('0x1c')](_0x375d4c)[_0x87b4('0x25')](_0x109a0c);};}exports[_0x87b4('0x26')]=function(_0xb6d081,_0xb6ff4f){var _0x24a615={},_0x1ddaa4={},_0x2d29c1={'count':0x0,'rows':[]};var _0x5b8310=_[_0x87b4('0x27')](db[_0x87b4('0x28')][_0x87b4('0x29')],function(_0x1b0b2a){return{'name':_0x1b0b2a[_0x87b4('0x2a')],'type':_0x1b0b2a['type'][_0x87b4('0x2b')]};});_0x1ddaa4[_0x87b4('0x2c')]=_[_0x87b4('0x27')](_0x5b8310,_0x87b4('0x24'));_0x1ddaa4['query']=_[_0x87b4('0x2d')](_0xb6d081[_0x87b4('0x2e')]);_0x1ddaa4[_0x87b4('0x2f')]=_[_0x87b4('0x30')](_0x1ddaa4[_0x87b4('0x2c')],_0x1ddaa4[_0x87b4('0x2e')]);_0x24a615[_0x87b4('0x31')]=_[_0x87b4('0x30')](_0x1ddaa4[_0x87b4('0x2c')],qs[_0x87b4('0x32')](_0xb6d081[_0x87b4('0x2e')]['fields']));_0x24a615[_0x87b4('0x31')]=_0x24a615[_0x87b4('0x31')][_0x87b4('0x33')]?_0x24a615['attributes']:_0x1ddaa4['model'];if(!_0xb6d081[_0x87b4('0x2e')]['hasOwnProperty'](_0x87b4('0x34'))){_0x24a615['limit']=qs[_0x87b4('0x35')](_0xb6d081['query']['limit']);_0x24a615[_0x87b4('0x1f')]=qs[_0x87b4('0x1f')](_0xb6d081[_0x87b4('0x2e')][_0x87b4('0x1f')]);}_0x24a615[_0x87b4('0x36')]=qs[_0x87b4('0x37')](_0xb6d081[_0x87b4('0x2e')]['sort']);_0x24a615[_0x87b4('0x38')]=qs[_0x87b4('0x2f')](_['pick'](_0xb6d081[_0x87b4('0x2e')],_0x1ddaa4[_0x87b4('0x2f')]));if(_0xb6d081[_0x87b4('0x2e')]['filter']){_0x24a615['where']=_[_0x87b4('0x39')](_0x24a615[_0x87b4('0x38')],{'$or':_[_0x87b4('0x27')](_0x5b8310,function(_0x57cf46){if(_0x57cf46[_0x87b4('0x3a')]!=='VIRTUAL'){var _0xdea98f={};_0xdea98f[_0x57cf46[_0x87b4('0x24')]]={'$like':'%'+_0xb6d081['query'][_0x87b4('0x3b')]+'%'};return _0xdea98f;}})});}_0x24a615=_[_0x87b4('0x39')]({},_0x24a615,_0xb6d081[_0x87b4('0x3c')]);var _0x1b3324={'where':_0x24a615[_0x87b4('0x38')]};return db[_0x87b4('0x28')][_0x87b4('0x1e')](_0x1b3324)['then'](function(_0x4ea2ff){_0x2d29c1['count']=_0x4ea2ff;if(_0xb6d081['query'][_0x87b4('0x3d')]){_0x24a615[_0x87b4('0x3e')]=[{'all':!![]}];}return db[_0x87b4('0x28')][_0x87b4('0x3f')](_0x24a615);})[_0x87b4('0x40')](function(_0x3d0615){_0x2d29c1[_0x87b4('0x41')]=_0x3d0615;return _0x2d29c1;})[_0x87b4('0x40')](respondWithFilteredResult(_0xb6ff4f,_0x24a615))[_0x87b4('0x42')](handleError(_0xb6ff4f,null));};exports[_0x87b4('0x43')]=function(_0x314078,_0x41f7ac){var _0x475060={'raw':!![],'where':{'id':_0x314078[_0x87b4('0x44')]['id']}},_0x1feac0={};_0x1feac0[_0x87b4('0x2c')]=_[_0x87b4('0x2d')](db['MemberReport'][_0x87b4('0x29')]);_0x1feac0[_0x87b4('0x2e')]=_[_0x87b4('0x2d')](_0x314078[_0x87b4('0x2e')]);_0x1feac0[_0x87b4('0x2f')]=_[_0x87b4('0x30')](_0x1feac0[_0x87b4('0x2c')],_0x1feac0[_0x87b4('0x2e')]);_0x475060[_0x87b4('0x31')]=_[_0x87b4('0x30')](_0x1feac0[_0x87b4('0x2c')],qs['fields'](_0x314078[_0x87b4('0x2e')][_0x87b4('0x32')]));_0x475060[_0x87b4('0x31')]=_0x475060[_0x87b4('0x31')][_0x87b4('0x33')]?_0x475060[_0x87b4('0x31')]:_0x1feac0[_0x87b4('0x2c')];if(_0x314078[_0x87b4('0x2e')][_0x87b4('0x3d')]){_0x475060[_0x87b4('0x3e')]=[{'all':!![]}];}_0x475060=_[_0x87b4('0x39')]({},_0x475060,_0x314078[_0x87b4('0x3c')]);return db['MemberReport'][_0x87b4('0x45')](_0x475060)['then'](handleEntityNotFound(_0x41f7ac,null))[_0x87b4('0x40')](respondWithResult(_0x41f7ac,null))[_0x87b4('0x42')](handleError(_0x41f7ac,null));};exports[_0x87b4('0x46')]=function(_0x2a9973,_0x596c09){return db[_0x87b4('0x28')][_0x87b4('0x46')](_0x2a9973['body'],{})[_0x87b4('0x40')](respondWithResult(_0x596c09,0xc9))[_0x87b4('0x42')](handleError(_0x596c09,null));};exports[_0x87b4('0x20')]=function(_0x50f1c1,_0x5c463a){if(_0x50f1c1[_0x87b4('0x47')]['id']){delete _0x50f1c1[_0x87b4('0x47')]['id'];}return db[_0x87b4('0x28')]['find']({'where':{'id':_0x50f1c1['params']['id']}})['then'](handleEntityNotFound(_0x5c463a,null))[_0x87b4('0x40')](saveUpdates(_0x50f1c1[_0x87b4('0x47')],null))['then'](respondWithResult(_0x5c463a,null))[_0x87b4('0x42')](handleError(_0x5c463a,null));};exports['destroy']=function(_0x48d431,_0x4a50fd){return db['MemberReport']['find']({'where':{'id':_0x48d431['params']['id']}})['then'](handleEntityNotFound(_0x4a50fd,null))[_0x87b4('0x40')](removeEntity(_0x4a50fd,null))[_0x87b4('0x42')](handleError(_0x4a50fd,null));};exports[_0x87b4('0x48')]=function(_0x386b79,_0x300610){return db[_0x87b4('0x28')][_0x87b4('0x48')]()['then'](respondWithResult(_0x300610,null))[_0x87b4('0x42')](handleError(_0x300610,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 07fce86..61fbd14 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 _0x8062=['rimraf','../../config/environment','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3fc0d0,_0x32a88c){var _0x33d656=function(_0x512c96){while(--_0x512c96){_0x3fc0d0['push'](_0x3fc0d0['shift']());}};_0x33d656(++_0x32a88c);}(_0x8062,0x189));var _0x2806=function(_0x5adaa5,_0x36dbe0){_0x5adaa5=_0x5adaa5-0x0;var _0x338103=_0x8062[_0x5adaa5];return _0x338103;};'use strict';var _=require(_0x2806('0x0'));var util=require(_0x2806('0x1'));var logger=require(_0x2806('0x2'))(_0x2806('0x3'));var moment=require(_0x2806('0x4'));var BPromise=require(_0x2806('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2806('0x6'));var rimraf=require(_0x2806('0x7'));var config=require(_0x2806('0x8'));var attributes=require('./memberReport.attributes');module[_0x2806('0x9')]=function(_0x4460fc,_0x7fbc3d){return _0x4460fc[_0x2806('0xa')](_0x2806('0xb'),attributes,{'tableName':_0x2806('0xc'),'paranoid':![],'indexes':[{'name':_0x2806('0xd'),'fields':[_0x2806('0xe'),_0x2806('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x794a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','report_member','membername_interface','membername','lodash','util'];(function(_0x189c2a,_0x3c94d3){var _0x1cdbcb=function(_0x496d6d){while(--_0x496d6d){_0x189c2a['push'](_0x189c2a['shift']());}};_0x1cdbcb(++_0x3c94d3);}(_0x794a,0x136));var _0xa794=function(_0x5c7f35,_0x2ec51e){_0x5c7f35=_0x5c7f35-0x0;var _0x4f1e26=_0x794a[_0x5c7f35];return _0x4f1e26;};'use strict';var _=require(_0xa794('0x0'));var util=require(_0xa794('0x1'));var logger=require(_0xa794('0x2'))('api');var moment=require(_0xa794('0x3'));var BPromise=require(_0xa794('0x4'));var rp=require(_0xa794('0x5'));var fs=require('fs');var path=require(_0xa794('0x6'));var rimraf=require(_0xa794('0x7'));var config=require('../../config/environment');var attributes=require(_0xa794('0x8'));module[_0xa794('0x9')]=function(_0x25cf31,_0x3f90e2){return _0x25cf31['define']('MemberReport',attributes,{'tableName':_0xa794('0xa'),'paranoid':![],'indexes':[{'name':_0xa794('0xb'),'fields':[_0xa794('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index eb8968c..15a76bc 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 _0x704f=['request\x20sent','MemberReport','options','raw','where','attributes','limit','include','map','model','GetMemberReport','CreateMemberReport','catch','UpdateMemberReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MemberReport,\x20%s,\x20%s','debug','stringify','error','code','message','info'];(function(_0x347379,_0x37de29){var _0x1e6dbf=function(_0x137484){while(--_0x137484){_0x347379['push'](_0x347379['shift']());}};_0x1e6dbf(++_0x37de29);}(_0x704f,0x15d));var _0xf704=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x704f[_0x28e74e];return _0xb45ac1;};'use strict';var _=require(_0xf704('0x0'));var util=require(_0xf704('0x1'));var moment=require(_0xf704('0x2'));var BPromise=require(_0xf704('0x3'));var rs=require(_0xf704('0x4'));var fs=require('fs');var Redis=require(_0xf704('0x5'));var db=require(_0xf704('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf704('0x7'))(_0xf704('0x8'));var config=require(_0xf704('0x9'));var jayson=require(_0xf704('0xa'));var client=jayson[_0xf704('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57117c,_0x3305a1,_0x95759d){return new BPromise(function(_0x2e3397,_0x258a41){return client[_0xf704('0xc')](_0x57117c,_0x95759d)[_0xf704('0xd')](function(_0x2cbec3){logger['info'](_0xf704('0xe'),_0x3305a1,'request\x20sent');logger[_0xf704('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3305a1,'request\x20sent',JSON[_0xf704('0x10')](_0x2cbec3));if(_0x2cbec3[_0xf704('0x11')]){if(_0x2cbec3[_0xf704('0x11')][_0xf704('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x3305a1,_0x2cbec3[_0xf704('0x11')][_0xf704('0x13')]);return _0x258a41(_0x2cbec3[_0xf704('0x11')][_0xf704('0x13')]);}logger[_0xf704('0x11')](_0xf704('0xe'),_0x3305a1,_0x2cbec3[_0xf704('0x11')][_0xf704('0x13')]);return _0x2e3397(_0x2cbec3[_0xf704('0x11')]['message']);}else{logger[_0xf704('0x14')]('MemberReport,\x20%s,\x20%s',_0x3305a1,_0xf704('0x15'));_0x2e3397(_0x2cbec3['result'][_0xf704('0x13')]);}})['catch'](function(_0x1b3dc4){logger['error']('MemberReport,\x20%s,\x20%s',_0x3305a1,_0x1b3dc4);_0x258a41(_0x1b3dc4);});});}exports['GetMemberReport']=function(_0x343b58){var _0x58d000=this;return new Promise(function(_0x5cb71f,_0x134c06){return db[_0xf704('0x16')]['findAll']({'raw':_0x343b58[_0xf704('0x17')]?_0x343b58['options'][_0xf704('0x18')]===undefined?!![]:![]:!![],'where':_0x343b58[_0xf704('0x17')]?_0x343b58[_0xf704('0x17')][_0xf704('0x19')]||null:null,'attributes':_0x343b58[_0xf704('0x17')]?_0x343b58[_0xf704('0x17')][_0xf704('0x1a')]||null:null,'limit':_0x343b58[_0xf704('0x17')]?_0x343b58[_0xf704('0x17')][_0xf704('0x1b')]||null:null,'include':_0x343b58[_0xf704('0x17')]?_0x343b58[_0xf704('0x17')][_0xf704('0x1c')]?_[_0xf704('0x1d')](_0x343b58[_0xf704('0x17')][_0xf704('0x1c')],function(_0x28036e){return{'model':db[_0x28036e['model']],'as':_0x28036e['as'],'attributes':_0x28036e[_0xf704('0x1a')],'include':_0x28036e[_0xf704('0x1c')]?_[_0xf704('0x1d')](_0x28036e[_0xf704('0x1c')],function(_0x4aea19){return{'model':db[_0x4aea19[_0xf704('0x1e')]],'as':_0x4aea19['as'],'attributes':_0x4aea19['attributes'],'include':_0x4aea19[_0xf704('0x1c')]?_['map'](_0x4aea19[_0xf704('0x1c')],function(_0x4002ee){return{'model':db[_0x4002ee[_0xf704('0x1e')]],'as':_0x4002ee['as'],'attributes':_0x4002ee[_0xf704('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a6c01){logger['info'](_0xf704('0x1f'),_0x343b58);logger['debug'](_0xf704('0x1f'),_0x343b58,JSON[_0xf704('0x10')](_0x5a6c01));_0x5cb71f(_0x5a6c01);})['catch'](function(_0x51afbf){logger['error']('GetMemberReport',_0x51afbf[_0xf704('0x13')],_0x343b58);_0x134c06(_0x58d000[_0xf704('0x11')](0x1f4,_0x51afbf['message']));});});};exports[_0xf704('0x20')]=function(_0x688c4a){var _0x384947=this;return new Promise(function(_0x5484db,_0x439dcb){return db['MemberReport']['create'](_0x688c4a['body'],{'raw':_0x688c4a['options']?_0x688c4a[_0xf704('0x17')][_0xf704('0x18')]===undefined?!![]:![]:!![]})[_0xf704('0xd')](function(_0x520b24){logger[_0xf704('0x14')](_0xf704('0x20'),_0x688c4a);logger['debug'](_0xf704('0x20'),_0x688c4a,JSON[_0xf704('0x10')](_0x520b24));_0x5484db(_0x520b24);})[_0xf704('0x21')](function(_0x2ad7c9){logger[_0xf704('0x11')]('CreateMemberReport',_0x2ad7c9[_0xf704('0x13')],_0x688c4a);_0x439dcb(_0x384947[_0xf704('0x11')](0x1f4,_0x2ad7c9[_0xf704('0x13')]));});});};exports[_0xf704('0x22')]=function(_0x1ba5e8){var _0x49b6af=this;return new Promise(function(_0x376e84,_0x9a3603){return db[_0xf704('0x16')][_0xf704('0x23')](_0x1ba5e8[_0xf704('0x24')],{'raw':_0x1ba5e8['options']?_0x1ba5e8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ba5e8[_0xf704('0x17')]?_0x1ba5e8[_0xf704('0x17')][_0xf704('0x19')]||null:null,'attributes':_0x1ba5e8[_0xf704('0x17')]?_0x1ba5e8[_0xf704('0x17')][_0xf704('0x1a')]||null:null,'limit':_0x1ba5e8[_0xf704('0x17')]?_0x1ba5e8['options'][_0xf704('0x1b')]||null:null})[_0xf704('0xd')](function(_0xc2777e){logger[_0xf704('0x14')]('UpdateMemberReport',_0x1ba5e8);logger[_0xf704('0xf')](_0xf704('0x22'),_0x1ba5e8,JSON['stringify'](_0xc2777e));_0x376e84(_0xc2777e);})[_0xf704('0x21')](function(_0x5c5121){logger[_0xf704('0x11')](_0xf704('0x22'),_0x5c5121[_0xf704('0x13')],_0x1ba5e8);_0x9a3603(_0x49b6af[_0xf704('0x11')](0x1f4,_0x5c5121['message']));});});}; \ No newline at end of file +var _0xb70d=['code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','then','create','CreateMemberReport','UpdateMemberReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0xb70d,0x105));var _0xdb70=function(_0x154980,_0x2710e5){_0x154980=_0x154980-0x0;var _0x55a463=_0xb70d[_0x154980];return _0x55a463;};'use strict';var _=require(_0xdb70('0x0'));var util=require(_0xdb70('0x1'));var moment=require(_0xdb70('0x2'));var BPromise=require(_0xdb70('0x3'));var rs=require(_0xdb70('0x4'));var fs=require('fs');var Redis=require(_0xdb70('0x5'));var db=require(_0xdb70('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb70('0x7'))(_0xdb70('0x8'));var config=require('../../config/environment');var jayson=require(_0xdb70('0x9'));var client=jayson[_0xdb70('0xa')][_0xdb70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2623b0,_0xf0bf81,_0x15a90a){return new BPromise(function(_0x5366b9,_0xdc173d){return client[_0xdb70('0xc')](_0x2623b0,_0x15a90a)['then'](function(_0x34524f){logger[_0xdb70('0xd')](_0xdb70('0xe'),_0xf0bf81,'request\x20sent');logger[_0xdb70('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0xf0bf81,_0xdb70('0x10'),JSON[_0xdb70('0x11')](_0x34524f));if(_0x34524f[_0xdb70('0x12')]){if(_0x34524f[_0xdb70('0x12')][_0xdb70('0x13')]===0x1f4){logger['error'](_0xdb70('0xe'),_0xf0bf81,_0x34524f[_0xdb70('0x12')]['message']);return _0xdc173d(_0x34524f['error'][_0xdb70('0x14')]);}logger[_0xdb70('0x12')](_0xdb70('0xe'),_0xf0bf81,_0x34524f['error']['message']);return _0x5366b9(_0x34524f['error']['message']);}else{logger[_0xdb70('0xd')](_0xdb70('0xe'),_0xf0bf81,_0xdb70('0x10'));_0x5366b9(_0x34524f[_0xdb70('0x15')][_0xdb70('0x14')]);}})[_0xdb70('0x16')](function(_0x32a2cf){logger[_0xdb70('0x12')](_0xdb70('0xe'),_0xf0bf81,_0x32a2cf);_0xdc173d(_0x32a2cf);});});}exports[_0xdb70('0x17')]=function(_0x4d0da5){var _0x5528a9=this;return new Promise(function(_0x87babc,_0x28549c){return db[_0xdb70('0x18')][_0xdb70('0x19')]({'raw':_0x4d0da5[_0xdb70('0x1a')]?_0x4d0da5[_0xdb70('0x1a')][_0xdb70('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d0da5[_0xdb70('0x1a')]?_0x4d0da5[_0xdb70('0x1a')][_0xdb70('0x1c')]||null:null,'attributes':_0x4d0da5[_0xdb70('0x1a')]?_0x4d0da5[_0xdb70('0x1a')][_0xdb70('0x1d')]||null:null,'limit':_0x4d0da5['options']?_0x4d0da5[_0xdb70('0x1a')][_0xdb70('0x1e')]||null:null,'include':_0x4d0da5[_0xdb70('0x1a')]?_0x4d0da5[_0xdb70('0x1a')][_0xdb70('0x1f')]?_['map'](_0x4d0da5['options']['include'],function(_0x2afbfa){return{'model':db[_0x2afbfa['model']],'as':_0x2afbfa['as'],'attributes':_0x2afbfa[_0xdb70('0x1d')],'include':_0x2afbfa['include']?_[_0xdb70('0x20')](_0x2afbfa[_0xdb70('0x1f')],function(_0x256a5f){return{'model':db[_0x256a5f[_0xdb70('0x21')]],'as':_0x256a5f['as'],'attributes':_0x256a5f[_0xdb70('0x1d')],'include':_0x256a5f[_0xdb70('0x1f')]?_['map'](_0x256a5f[_0xdb70('0x1f')],function(_0x51541e){return{'model':db[_0x51541e[_0xdb70('0x21')]],'as':_0x51541e['as'],'attributes':_0x51541e[_0xdb70('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdb70('0x22')](function(_0xff87dd){logger[_0xdb70('0xd')](_0xdb70('0x17'),_0x4d0da5);logger[_0xdb70('0xf')](_0xdb70('0x17'),_0x4d0da5,JSON['stringify'](_0xff87dd));_0x87babc(_0xff87dd);})[_0xdb70('0x16')](function(_0x4526ea){logger[_0xdb70('0x12')](_0xdb70('0x17'),_0x4526ea['message'],_0x4d0da5);_0x28549c(_0x5528a9[_0xdb70('0x12')](0x1f4,_0x4526ea['message']));});});};exports['CreateMemberReport']=function(_0x439771){var _0x1ced17=this;return new Promise(function(_0x55261b,_0x505f5e){return db[_0xdb70('0x18')][_0xdb70('0x23')](_0x439771['body'],{'raw':_0x439771[_0xdb70('0x1a')]?_0x439771[_0xdb70('0x1a')][_0xdb70('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x51cb76){logger[_0xdb70('0xd')]('CreateMemberReport',_0x439771);logger['debug'](_0xdb70('0x24'),_0x439771,JSON['stringify'](_0x51cb76));_0x55261b(_0x51cb76);})[_0xdb70('0x16')](function(_0x1bc20b){logger[_0xdb70('0x12')](_0xdb70('0x24'),_0x1bc20b['message'],_0x439771);_0x505f5e(_0x1ced17[_0xdb70('0x12')](0x1f4,_0x1bc20b[_0xdb70('0x14')]));});});};exports[_0xdb70('0x25')]=function(_0x570e29){var _0x49b1b7=this;return new Promise(function(_0x754496,_0x44b8f5){return db[_0xdb70('0x18')][_0xdb70('0x26')](_0x570e29[_0xdb70('0x27')],{'raw':_0x570e29[_0xdb70('0x1a')]?_0x570e29[_0xdb70('0x1a')][_0xdb70('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x570e29['options']?_0x570e29[_0xdb70('0x1a')]['where']||null:null,'attributes':_0x570e29[_0xdb70('0x1a')]?_0x570e29[_0xdb70('0x1a')]['attributes']||null:null,'limit':_0x570e29[_0xdb70('0x1a')]?_0x570e29['options'][_0xdb70('0x1e')]||null:null})[_0xdb70('0x22')](function(_0x1f818d){logger[_0xdb70('0xd')]('UpdateMemberReport',_0x570e29);logger['debug'](_0xdb70('0x25'),_0x570e29,JSON[_0xdb70('0x11')](_0x1f818d));_0x754496(_0x1f818d);})[_0xdb70('0x16')](function(_0x517472){logger['error'](_0xdb70('0x25'),_0x517472['message'],_0x570e29);_0x44b8f5(_0x49b1b7[_0xdb70('0x12')](0x1f4,_0x517472['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4cfbcad..24109fd 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 _0x02ce=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer'];(function(_0x292b35,_0xc2ce4e){var _0x384d26=function(_0x2558bf){while(--_0x2558bf){_0x292b35['push'](_0x292b35['shift']());}};_0x384d26(++_0xc2ce4e);}(_0x02ce,0x1ac));var _0xe02c=function(_0x3a3c9b,_0x4e8048){_0x3a3c9b=_0x3a3c9b-0x0;var _0x3f1d70=_0x02ce[_0x3a3c9b];return _0x3f1d70;};'use strict';var multer=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var path=require(_0xe02c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe02c('0x3'));var router=express['Router']();var auth=require(_0xe02c('0x4'));var interaction=require(_0xe02c('0x5'));var config=require(_0xe02c('0x6'));var controller=require(_0xe02c('0x7'));router[_0xe02c('0x8')]('/',controller[_0xe02c('0x9')]);module[_0xe02c('0xa')]=router; \ No newline at end of file +var _0x7334=['path','Router','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x2de483,_0x47e490){var _0x2e3188=function(_0x178db9){while(--_0x178db9){_0x2de483['push'](_0x2de483['shift']());}};_0x2e3188(++_0x47e490);}(_0x7334,0x184));var _0x4733=function(_0x46ba40,_0x37282a){_0x46ba40=_0x46ba40-0x0;var _0xc13a89=_0x7334[_0x46ba40];return _0xc13a89;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4733('0x4'));var config=require(_0x4733('0x5'));var controller=require(_0x4733('0x6'));router[_0x4733('0x7')]('/',controller[_0x4733('0x8')]);module[_0x4733('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 4144983..e1fd770 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 _0xf352=['exports','sequelize'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0xf352,0x18d));var _0x2f35=function(_0x4831ee,_0x49e362){_0x4831ee=_0x4831ee-0x0;var _0x24fca2=_0xf352[_0x4831ee];return _0x24fca2;};'use strict';var Sequelize=require(_0x2f35('0x0'));module[_0x2f35('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0xb34d=['exports','sequelize'];(function(_0x422574,_0x3ac50b){var _0xaea921=function(_0x596b14){while(--_0x596b14){_0x422574['push'](_0x422574['shift']());}};_0xaea921(++_0x3ac50b);}(_0xb34d,0xdf));var _0xdb34=function(_0x37ef8f,_0x1e66bd){_0x37ef8f=_0x37ef8f-0x0;var _0x19e7f0=_0xb34d[_0x37ef8f];return _0x19e7f0;};'use strict';var Sequelize=require(_0xdb34('0x0'));module[_0xdb34('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0bda56e..f69e442 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 _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x1d6533,_0x3d5571){var _0x224dfc=function(_0x4d7f3f){while(--_0x4d7f3f){_0x1d6533['push'](_0x1d6533['shift']());}};_0x224dfc(++_0x3d5571);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ec09d,_0x391827){_0x5ec09d=_0x5ec09d-0x0;var _0x304aae=_0x5f2f[_0x5ec09d];return _0x304aae;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file +var _0xb10b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x24e5db,_0x22ef51){var _0x7f7127=function(_0x5b7007){while(--_0x5b7007){_0x24e5db['push'](_0x24e5db['shift']());}};_0x7f7127(++_0x22ef51);}(_0xb10b,0x12a));var _0xbb10=function(_0x28c608,_0x432ee1){_0x28c608=_0x28c608-0x0;var _0x3ace3e=_0xb10b[_0x28c608];return _0x3ace3e;};'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 as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['Migration'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 826cc92..1f4bc78 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 _0xfc71=['request-promise','path','../../config/environment','./migration.attributes','exports','lodash','util','../../config/logger','api','bluebird'];(function(_0x3c999e,_0x4aa1b9){var _0x2e9226=function(_0x2d36ff){while(--_0x2d36ff){_0x3c999e['push'](_0x3c999e['shift']());}};_0x2e9226(++_0x4aa1b9);}(_0xfc71,0x11d));var _0x1fc7=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xfc71[_0x5e8c32];return _0x595f7b;};'use strict';var _=require(_0x1fc7('0x0'));var util=require(_0x1fc7('0x1'));var logger=require(_0x1fc7('0x2'))(_0x1fc7('0x3'));var moment=require('moment');var BPromise=require(_0x1fc7('0x4'));var rp=require(_0x1fc7('0x5'));var fs=require('fs');var path=require(_0x1fc7('0x6'));var rimraf=require('rimraf');var config=require(_0x1fc7('0x7'));var attributes=require(_0x1fc7('0x8'));module[_0x1fc7('0x9')]=function(_0x560be7,_0x18e2b3){return _0x560be7['define']('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb984=['moment','path','rimraf','./migration.attributes','exports','lodash','util','api'];(function(_0x4038db,_0x50fbd0){var _0x4933b5=function(_0x1bc13c){while(--_0x1bc13c){_0x4038db['push'](_0x4038db['shift']());}};_0x4933b5(++_0x50fbd0);}(_0xb984,0x12d));var _0x4b98=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb984[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x4b98('0x0'));var util=require(_0x4b98('0x1'));var logger=require('../../config/logger')(_0x4b98('0x2'));var moment=require(_0x4b98('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b98('0x4'));var rimraf=require(_0x4b98('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b98('0x6'));module[_0x4b98('0x7')]=function(_0x33fc96,_0x117a62){return _0x33fc96['define']('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 84e3fb5..ca7c372 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 _0x5752=['catch','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x5752,0x144));var _0x2575=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x5752[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2575('0x0'));var db=require(_0x2575('0x1'))['db'];var utils=require(_0x2575('0x2'));var logger=require(_0x2575('0x3'))(_0x2575('0x4'));var config=require(_0x2575('0x5'));var jayson=require(_0x2575('0x6'));var client=jayson[_0x2575('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1999,_0x570f15,_0x13dff8){return new BPromise(function(_0x103238,_0x2048c8){return client[_0x2575('0x8')](_0x5f1999,_0x13dff8)[_0x2575('0x9')](function(_0x255143){logger[_0x2575('0xa')]('Migration,\x20%s,\x20%s',_0x570f15,_0x2575('0xb'));logger[_0x2575('0xc')]('Migration,\x20%s,\x20%s,\x20%s',_0x570f15,_0x2575('0xb'),JSON[_0x2575('0xd')](_0x255143));if(_0x255143[_0x2575('0xe')]){if(_0x255143[_0x2575('0xe')][_0x2575('0xf')]===0x1f4){logger[_0x2575('0xe')](_0x2575('0x10'),_0x570f15,_0x255143[_0x2575('0xe')][_0x2575('0x11')]);return _0x2048c8(_0x255143[_0x2575('0xe')][_0x2575('0x11')]);}logger[_0x2575('0xe')](_0x2575('0x10'),_0x570f15,_0x255143['error'][_0x2575('0x11')]);return _0x103238(_0x255143[_0x2575('0xe')][_0x2575('0x11')]);}else{logger[_0x2575('0xa')](_0x2575('0x10'),_0x570f15,_0x2575('0xb'));_0x103238(_0x255143['result'][_0x2575('0x11')]);}})[_0x2575('0x12')](function(_0x125bf6){logger[_0x2575('0xe')]('Migration,\x20%s,\x20%s',_0x570f15,_0x125bf6);_0x2048c8(_0x125bf6);});});} \ No newline at end of file +var _0xf567=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4e7ccf,_0x50dbee){var _0x1f08bf=function(_0x2202b9){while(--_0x2202b9){_0x4e7ccf['push'](_0x4e7ccf['shift']());}};_0x1f08bf(++_0x50dbee);}(_0xf567,0x118));var _0x7f56=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf567[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var moment=require(_0x7f56('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f56('0x3'));var fs=require('fs');var Redis=require(_0x7f56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f56('0x5'));var logger=require(_0x7f56('0x6'))(_0x7f56('0x7'));var config=require(_0x7f56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f56('0x9')][_0x7f56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1215e3,_0x52959a,_0x3f7ad5){return new BPromise(function(_0x2eaed8,_0x22d94e){return client[_0x7f56('0xb')](_0x1215e3,_0x3f7ad5)[_0x7f56('0xc')](function(_0x3ad7d5){logger[_0x7f56('0xd')](_0x7f56('0xe'),_0x52959a,_0x7f56('0xf'));logger[_0x7f56('0x10')](_0x7f56('0x11'),_0x52959a,_0x7f56('0xf'),JSON[_0x7f56('0x12')](_0x3ad7d5));if(_0x3ad7d5[_0x7f56('0x13')]){if(_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x14')]===0x1f4){logger[_0x7f56('0x13')](_0x7f56('0xe'),_0x52959a,_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x15')]);return _0x22d94e(_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x15')]);}logger['error'](_0x7f56('0xe'),_0x52959a,_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x15')]);return _0x2eaed8(_0x3ad7d5['error'][_0x7f56('0x15')]);}else{logger[_0x7f56('0xd')]('Migration,\x20%s,\x20%s',_0x52959a,_0x7f56('0xf'));_0x2eaed8(_0x3ad7d5[_0x7f56('0x16')]['message']);}})['catch'](function(_0x1dee75){logger['error'](_0x7f56('0xe'),_0x52959a,_0x1dee75);_0x22d94e(_0x1dee75);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 0083225..481a22b 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 _0x3b64=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x3b64,0x1bd));var _0x43b6=function(_0x1681ae,_0x4811a5){_0x1681ae=_0x1681ae-0x0;var _0x3a774a=_0x3b64[_0x1681ae];return _0x3a774a;};'use strict';var multer=require(_0x43b6('0x0'));var util=require(_0x43b6('0x1'));var path=require(_0x43b6('0x2'));var timeout=require(_0x43b6('0x3'));var express=require(_0x43b6('0x4'));var router=express[_0x43b6('0x5')]();var auth=require(_0x43b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43b6('0x7'));var controller=require('./network.controller');router[_0x43b6('0x8')]('/',auth[_0x43b6('0x9')](),controller[_0x43b6('0xa')]);router['get'](_0x43b6('0xb'),auth['isAuthenticated'](),controller[_0x43b6('0xc')]);router['post']('/',auth[_0x43b6('0x9')](),controller[_0x43b6('0xd')]);router[_0x43b6('0xe')]('/:id',auth[_0x43b6('0x9')](),controller[_0x43b6('0xf')]);router[_0x43b6('0x10')](_0x43b6('0xb'),auth['isAuthenticated'](),controller[_0x43b6('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa671=['create','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x565515,_0x43ec10){var _0x35e3e1=function(_0x1d4d89){while(--_0x1d4d89){_0x565515['push'](_0x565515['shift']());}};_0x35e3e1(++_0x43ec10);}(_0xa671,0x153));var _0x1a67=function(_0x45d51f,_0x1b60e5){_0x45d51f=_0x45d51f-0x0;var _0x9afa32=_0xa671[_0x45d51f];return _0x9afa32;};'use strict';var multer=require('multer');var util=require(_0x1a67('0x0'));var path=require(_0x1a67('0x1'));var timeout=require(_0x1a67('0x2'));var express=require(_0x1a67('0x3'));var router=express[_0x1a67('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1a67('0x5'));var config=require(_0x1a67('0x6'));var controller=require('./network.controller');router['get']('/',auth[_0x1a67('0x7')](),controller[_0x1a67('0x8')]);router[_0x1a67('0x9')](_0x1a67('0xa'),auth[_0x1a67('0x7')](),controller[_0x1a67('0xb')]);router[_0x1a67('0xc')]('/',auth[_0x1a67('0x7')](),controller[_0x1a67('0xd')]);router['put'](_0x1a67('0xa'),auth[_0x1a67('0x7')](),controller['update']);router[_0x1a67('0xe')](_0x1a67('0xa'),auth[_0x1a67('0x7')](),controller[_0x1a67('0xf')]);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 49c8807..d29b372 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 _0xccfc=['STRING','sequelize','ENUM','localnet','externip'];(function(_0x5ade89,_0x2a90b0){var _0x272f1f=function(_0x571f9a){while(--_0x571f9a){_0x5ade89['push'](_0x5ade89['shift']());}};_0x272f1f(++_0x2a90b0);}(_0xccfc,0x123));var _0xcccf=function(_0x2626e0,_0x3096d6){_0x2626e0=_0x2626e0-0x0;var _0x135f54=_0xccfc[_0x2626e0];return _0x135f54;};'use strict';var Sequelize=require(_0xcccf('0x0'));module['exports']={'type':{'type':Sequelize[_0xcccf('0x1')](_0xcccf('0x2'),_0xcccf('0x3'))},'value':{'type':Sequelize[_0xcccf('0x4')]}}; \ No newline at end of file +var _0x532f=['ENUM','externip','STRING','exports'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x532f,0x1eb));var _0xf532=function(_0x37dd80,_0x1a6171){_0x37dd80=_0x37dd80-0x0;var _0x3d4090=_0x532f[_0x37dd80];return _0x3d4090;};'use strict';var Sequelize=require('sequelize');module[_0xf532('0x0')]={'type':{'type':Sequelize[_0xf532('0x1')]('localnet',_0xf532('0x2'))},'value':{'type':Sequelize[_0xf532('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 22b8310..07cbd81 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 _0x5b38=['sequelize','body','readFileSync','join','root','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','transaction','server/files/templates/network.ejs','utf8','Reload','update','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','save','destroy','stack','name','send','map','Network','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','merge','options','include','findAll','rows','params','includeAll','find','create'];(function(_0x4db60e,_0x347dfa){var _0xfebbc2=function(_0x5a2f00){while(--_0x5a2f00){_0x4db60e['push'](_0x4db60e['shift']());}};_0xfebbc2(++_0x347dfa);}(_0x5b38,0xda));var _0x85b3=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x5b38[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x85b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85b3('0x2'));var BPromise=require(_0x85b3('0x3'));var Mustache=require(_0x85b3('0x4'));var util=require(_0x85b3('0x5'));var path=require(_0x85b3('0x6'));var sox=require(_0x85b3('0x7'));var csv=require(_0x85b3('0x8'));var ejs=require(_0x85b3('0x9'));var fs=require('fs');var _=require(_0x85b3('0xa'));var squel=require(_0x85b3('0xb'));var crypto=require(_0x85b3('0xc'));var jsforce=require(_0x85b3('0xd'));var deskjs=require(_0x85b3('0xe'));var toCsv=require(_0x85b3('0x8'));var querystring=require(_0x85b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x85b3('0x10'));var authService=require(_0x85b3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x85b3('0x12'));var hardwareService=require(_0x85b3('0x13'));var logger=require(_0x85b3('0x14'))(_0x85b3('0x15'));var utils=require(_0x85b3('0x16'));var config=require(_0x85b3('0x17'));var db=require(_0x85b3('0x18'))['db'];var jayson=require(_0x85b3('0x19'));var client=jayson['client'][_0x85b3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3393e5,_0x3995b5,_0x358215){if(_0x358215){var _0x59d8af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59d8af[_0x85b3('0x1b')](_0x3995b5)){return _0x3393e5;}else{throw new db[(_0x85b3('0x1c'))][(_0x85b3('0x1d'))](_0x85b3('0x1e'));}}else{return _0x3393e5;}}function respondWithRpcPromise(_0x4178d6,_0xf4fdf4,_0x3e654a,_0x47ec04){return new BPromise(function(_0x5022d2,_0xf2828a){var _0x3ee61d=_0x47ec04||client;return _0x3ee61d['request'](_0x4178d6,_0x3e654a)[_0x85b3('0x1f')](function(_0x3124b1){logger[_0x85b3('0x20')](_0x85b3('0x21'),_0xf4fdf4,'request\x20sent');logger[_0x85b3('0x22')](_0x85b3('0x23'),_0xf4fdf4,_0x85b3('0x24'),JSON['stringify'](_0x3124b1));if(_0x3124b1[_0x85b3('0x25')]){if(_0x3124b1[_0x85b3('0x25')][_0x85b3('0x26')]===0x1f4){logger[_0x85b3('0x25')](_0x85b3('0x21'),_0xf4fdf4,_0x3124b1['error']['message']);return _0xf2828a(_0x3124b1[_0x85b3('0x25')][_0x85b3('0x27')]);}logger['error'](_0x85b3('0x21'),_0xf4fdf4,_0x3124b1['error']['message']);return _0x5022d2(_0x3124b1[_0x85b3('0x25')]['message']);}else{logger[_0x85b3('0x20')](_0x85b3('0x21'),_0xf4fdf4,'request\x20sent');_0x5022d2(_0x3124b1[_0x85b3('0x28')][_0x85b3('0x27')]);}})[_0x85b3('0x29')](function(_0x4901c9){logger['error'](_0x85b3('0x21'),_0xf4fdf4,_0x4901c9);_0xf2828a(_0x4901c9);});});}function respondWithStatusCode(_0x23d966,_0x1f0598){_0x1f0598=_0x1f0598||0xcc;return function(_0x390805){if(_0x390805){return _0x23d966[_0x85b3('0x2a')](_0x1f0598);}return _0x23d966[_0x85b3('0x2b')](_0x1f0598)[_0x85b3('0x2c')]();};}function respondWithResult(_0x5dc93c,_0x4ebd16){_0x4ebd16=_0x4ebd16||0xc8;return function(_0x108de4){if(_0x108de4){return _0x5dc93c['status'](_0x4ebd16)['json'](_0x108de4);}};}function respondWithFilteredResult(_0x42ed79,_0xad4e4c){return function(_0x4832a4){if(_0x4832a4){var _0x15d240=_0x4832a4[_0x85b3('0x2d')],_0x51e6a2=_0xad4e4c[_0x85b3('0x2e')],_0x212aeb=_0xad4e4c['offset']+_0xad4e4c[_0x85b3('0x2f')],_0x304f78;if(_0x212aeb>=_0x15d240){_0x212aeb=_0x15d240;_0x304f78=0xc8;}else{_0x304f78=0xce;}_0x42ed79[_0x85b3('0x2b')](_0x304f78);return _0x42ed79['set'](_0x85b3('0x30'),_0x51e6a2+'-'+_0x212aeb+'/'+_0x15d240)[_0x85b3('0x31')](_0x4832a4);}return null;};}function patchUpdates(_0x5f40ee){return function(_0xbacf3f){try{jsonpatch['apply'](_0xbacf3f,_0x5f40ee,!![]);}catch(_0x4d09a1){return BPromise['reject'](_0x4d09a1);}return _0xbacf3f[_0x85b3('0x32')]();};}function saveUpdates(_0x52a6c6,_0x5466f0){return function(_0x4ddfea){if(_0x4ddfea){return _0x4ddfea['update'](_0x52a6c6)['then'](function(_0x5ab3f7){return _0x5ab3f7;});}return null;};}function removeEntity(_0x10673e,_0x48ff51){return function(_0x29b82f){if(_0x29b82f){return _0x29b82f[_0x85b3('0x33')]()[_0x85b3('0x1f')](function(){_0x10673e[_0x85b3('0x2b')](0xcc)[_0x85b3('0x2c')]();});}};}function handleEntityNotFound(_0x2d8135,_0x382795){return function(_0x18c817){if(!_0x18c817){_0x2d8135[_0x85b3('0x2a')](0x194);}return _0x18c817;};}function handleError(_0x4c3263,_0x317717){_0x317717=_0x317717||0x1f4;return function(_0x4664c1){logger['error'](_0x4664c1[_0x85b3('0x34')]);if(_0x4664c1[_0x85b3('0x35')]){delete _0x4664c1[_0x85b3('0x35')];}_0x4c3263['status'](_0x317717)[_0x85b3('0x36')](_0x4664c1);};}exports['index']=function(_0x275c24,_0x26022e){var _0x497086={},_0x1e5b5b={},_0x41aa70={'count':0x0,'rows':[]};var _0x3dd5cc=_[_0x85b3('0x37')](db[_0x85b3('0x38')][_0x85b3('0x39')],function(_0x4a4eaf){return{'name':_0x4a4eaf[_0x85b3('0x3a')],'type':_0x4a4eaf['type'][_0x85b3('0x3b')]};});_0x1e5b5b[_0x85b3('0x3c')]=_[_0x85b3('0x37')](_0x3dd5cc,_0x85b3('0x35'));_0x1e5b5b[_0x85b3('0x3d')]=_[_0x85b3('0x3e')](_0x275c24[_0x85b3('0x3d')]);_0x1e5b5b['filters']=_[_0x85b3('0x3f')](_0x1e5b5b[_0x85b3('0x3c')],_0x1e5b5b[_0x85b3('0x3d')]);_0x497086['attributes']=_[_0x85b3('0x3f')](_0x1e5b5b['model'],qs['fields'](_0x275c24['query'][_0x85b3('0x40')]));_0x497086[_0x85b3('0x41')]=_0x497086[_0x85b3('0x41')][_0x85b3('0x42')]?_0x497086[_0x85b3('0x41')]:_0x1e5b5b['model'];if(!_0x275c24[_0x85b3('0x3d')][_0x85b3('0x43')](_0x85b3('0x44'))){_0x497086['limit']=qs['limit'](_0x275c24[_0x85b3('0x3d')][_0x85b3('0x2f')]);_0x497086['offset']=qs['offset'](_0x275c24['query'][_0x85b3('0x2e')]);}_0x497086[_0x85b3('0x45')]=qs[_0x85b3('0x46')](_0x275c24[_0x85b3('0x3d')][_0x85b3('0x46')]);_0x497086[_0x85b3('0x47')]=qs[_0x85b3('0x48')](_[_0x85b3('0x49')](_0x275c24[_0x85b3('0x3d')],_0x1e5b5b[_0x85b3('0x48')]));if(_0x275c24[_0x85b3('0x3d')]['filter']){_0x497086[_0x85b3('0x47')]=_['merge'](_0x497086['where'],{'$or':_[_0x85b3('0x37')](_0x3dd5cc,function(_0xc48d00){if(_0xc48d00[_0x85b3('0x4a')]!==_0x85b3('0x4b')){var _0x3d3a16={};_0x3d3a16[_0xc48d00[_0x85b3('0x35')]]={'$like':'%'+_0x275c24[_0x85b3('0x3d')]['filter']+'%'};return _0x3d3a16;}})});}_0x497086=_[_0x85b3('0x4c')]({},_0x497086,_0x275c24[_0x85b3('0x4d')]);var _0x3f38a8={'where':_0x497086[_0x85b3('0x47')]};return db['Network'][_0x85b3('0x2d')](_0x3f38a8)[_0x85b3('0x1f')](function(_0x1b544e){_0x41aa70[_0x85b3('0x2d')]=_0x1b544e;if(_0x275c24['query']['includeAll']){_0x497086[_0x85b3('0x4e')]=[{'all':!![]}];}return db[_0x85b3('0x38')][_0x85b3('0x4f')](_0x497086);})[_0x85b3('0x1f')](function(_0x444b04){_0x41aa70[_0x85b3('0x50')]=_0x444b04;return _0x41aa70;})['then'](respondWithFilteredResult(_0x26022e,_0x497086))[_0x85b3('0x29')](handleError(_0x26022e,null));};exports['show']=function(_0x324a94,_0x521b2d){var _0x274743={'raw':!![],'where':{'id':_0x324a94[_0x85b3('0x51')]['id']}},_0x194bcc={};_0x194bcc[_0x85b3('0x3c')]=_[_0x85b3('0x3e')](db[_0x85b3('0x38')][_0x85b3('0x39')]);_0x194bcc['query']=_[_0x85b3('0x3e')](_0x324a94[_0x85b3('0x3d')]);_0x194bcc['filters']=_['intersection'](_0x194bcc['model'],_0x194bcc[_0x85b3('0x3d')]);_0x274743[_0x85b3('0x41')]=_[_0x85b3('0x3f')](_0x194bcc[_0x85b3('0x3c')],qs['fields'](_0x324a94[_0x85b3('0x3d')][_0x85b3('0x40')]));_0x274743[_0x85b3('0x41')]=_0x274743['attributes'][_0x85b3('0x42')]?_0x274743[_0x85b3('0x41')]:_0x194bcc['model'];if(_0x324a94[_0x85b3('0x3d')][_0x85b3('0x52')]){_0x274743[_0x85b3('0x4e')]=[{'all':!![]}];}_0x274743=_[_0x85b3('0x4c')]({},_0x274743,_0x324a94['options']);return db['Network'][_0x85b3('0x53')](_0x274743)[_0x85b3('0x1f')](handleEntityNotFound(_0x521b2d,null))[_0x85b3('0x1f')](respondWithResult(_0x521b2d,null))[_0x85b3('0x29')](handleError(_0x521b2d,null));};exports[_0x85b3('0x54')]=function(_0x5611a4,_0x53e3ee,_0x218efc){var _0x2cc1df;return db[_0x85b3('0x55')]['transaction'](function(_0x38dd48){return db[_0x85b3('0x38')][_0x85b3('0x54')](_0x5611a4[_0x85b3('0x56')],{'raw':!![]})[_0x85b3('0x1f')](function(_0xcb24f8){_0x2cc1df=_0xcb24f8;return db[_0x85b3('0x38')][_0x85b3('0x4f')]({'where':{'type':_0x5611a4['body'][_0x85b3('0x4a')]},'raw':!![]});})['then'](function(_0x8a93b3){var _0x41ca93=fs[_0x85b3('0x57')](path[_0x85b3('0x58')](config[_0x85b3('0x59')],'server/files/templates/network.ejs'),'utf8');var _0x2646ee=ejs[_0x85b3('0x5a')](_0x41ca93,{'networks':_0x8a93b3||[]});fs[_0x85b3('0x5b')](util[_0x85b3('0x5c')](_0x85b3('0x5d'),_0x5611a4[_0x85b3('0x56')]['type'][_0x85b3('0x5e')]()),_0x2646ee);})[_0x85b3('0x1f')](function(){return respondWithRpcPromise('Reload',_0x85b3('0x54'),{'module':_0x85b3('0x5f')});})[_0x85b3('0x1f')](function(){return _0x2cc1df;});})[_0x85b3('0x1f')](respondWithResult(_0x53e3ee,0xc9))[_0x85b3('0x29')](handleError(_0x53e3ee,null));};exports['update']=function(_0x4d9c31,_0x23aa23,_0x5550a3){var _0x12d5d4;return db['sequelize'][_0x85b3('0x60')](function(_0x384205){return db[_0x85b3('0x38')][_0x85b3('0x53')]({'where':{'id':_0x4d9c31['params']['id']}})[_0x85b3('0x1f')](handleEntityNotFound(_0x23aa23,null))[_0x85b3('0x1f')](saveUpdates(_0x4d9c31[_0x85b3('0x56')],null))[_0x85b3('0x1f')](function(_0x1e70d8){if(_0x1e70d8){_0x12d5d4=_0x1e70d8;return db['Network'][_0x85b3('0x4f')]({'where':{'type':_0x12d5d4[_0x85b3('0x4a')]},'raw':!![]});}return null;})[_0x85b3('0x1f')](function(_0x31cb95){if(_0x31cb95){var _0x8a9d9c=fs[_0x85b3('0x57')](path['join'](config[_0x85b3('0x59')],_0x85b3('0x61')),_0x85b3('0x62'));var _0x3be185=ejs[_0x85b3('0x5a')](_0x8a9d9c,{'networks':_0x31cb95||[]});fs[_0x85b3('0x5b')](util[_0x85b3('0x5c')](_0x85b3('0x5d'),_0x12d5d4['type']['toLowerCase']()),_0x3be185);return respondWithRpcPromise(_0x85b3('0x63'),_0x85b3('0x64'),{'module':_0x85b3('0x5f')});}return null;})[_0x85b3('0x1f')](function(_0x5c2785){if(_0x5c2785){return _0x12d5d4;}return null;});})['then'](respondWithResult(_0x23aa23,null))[_0x85b3('0x29')](handleError(_0x23aa23,null));};exports['destroy']=function(_0x1f2324,_0x301b7b,_0x54a49b){var _0x497b46;return db[_0x85b3('0x38')][_0x85b3('0x53')]({'where':{'id':_0x1f2324['params']['id']}})[_0x85b3('0x1f')](function(_0x2a2c72){_0x497b46=_0x2a2c72;return _0x2a2c72;})[_0x85b3('0x1f')](handleEntityNotFound(_0x301b7b,null))['then'](removeEntity(_0x301b7b,null))['then'](function(){if(_0x497b46){return db[_0x85b3('0x38')]['findAll']({'where':{'type':_0x497b46[_0x85b3('0x4a')]},'raw':!![]});}})[_0x85b3('0x1f')](function(_0x2f062e){if(_0x2f062e){var _0x3ecf73=fs['readFileSync'](path['join'](config['root'],_0x85b3('0x61')),_0x85b3('0x62'));var _0x399433=ejs[_0x85b3('0x5a')](_0x3ecf73,{'networks':_0x2f062e||[]});fs['writeFileSync'](util[_0x85b3('0x5c')](_0x85b3('0x5d'),_0x497b46[_0x85b3('0x4a')]['toLowerCase']()),_0x399433);return respondWithRpcPromise('Reload',_0x85b3('0x33'),{'module':'chan_sip.so'});}})[_0x85b3('0x29')](handleError(_0x301b7b,null));}; \ No newline at end of file +var _0x009d=['test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','Network','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','length','create','sequelize','transaction','body','readFileSync','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','Reload','root','server/files/templates/network.ejs','utf8','render','toLowerCase','find','join','chan_sip.so','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http'];(function(_0x1d8bf7,_0x594592){var _0x30237a=function(_0x2e0cd5){while(--_0x2e0cd5){_0x1d8bf7['push'](_0x1d8bf7['shift']());}};_0x30237a(++_0x594592);}(_0x009d,0xaf));var _0xd009=function(_0x1b23d9,_0x5f5d3e){_0x1b23d9=_0x1b23d9-0x0;var _0x466859=_0x009d[_0x1b23d9];return _0x466859;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd009('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd009('0x1'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd009('0x2'));var sox=require(_0xd009('0x3'));var csv=require(_0xd009('0x4'));var ejs=require(_0xd009('0x5'));var fs=require('fs');var _=require(_0xd009('0x6'));var squel=require('squel');var crypto=require(_0xd009('0x7'));var jsforce=require(_0xd009('0x8'));var deskjs=require(_0xd009('0x9'));var toCsv=require(_0xd009('0x4'));var querystring=require(_0xd009('0xa'));var Papa=require(_0xd009('0xb'));var Redis=require(_0xd009('0xc'));var authService=require(_0xd009('0xd'));var qs=require(_0xd009('0xe'));var as=require(_0xd009('0xf'));var hardwareService=require(_0xd009('0x10'));var logger=require(_0xd009('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd009('0x12'));var db=require(_0xd009('0x13'))['db'];var jayson=require(_0xd009('0x14'));var client=jayson[_0xd009('0x15')][_0xd009('0x16')]({'port':0x232a});function checkPasswordPattern(_0x256a06,_0x3ebceb,_0x1b4083){if(_0x1b4083){var _0x3760fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3760fa[_0xd009('0x17')](_0x3ebceb)){return _0x256a06;}else{throw new db[(_0xd009('0x18'))]['ValidationError'](_0xd009('0x19'));}}else{return _0x256a06;}}function respondWithRpcPromise(_0x10d948,_0x239110,_0x375668,_0x4ff680){return new BPromise(function(_0x3246ac,_0x2dc2db){var _0x115609=_0x4ff680||client;return _0x115609[_0xd009('0x1a')](_0x10d948,_0x375668)[_0xd009('0x1b')](function(_0x1ec7f1){logger[_0xd009('0x1c')](_0xd009('0x1d'),_0x239110,'request\x20sent');logger[_0xd009('0x1e')](_0xd009('0x1f'),_0x239110,_0xd009('0x20'),JSON[_0xd009('0x21')](_0x1ec7f1));if(_0x1ec7f1[_0xd009('0x22')]){if(_0x1ec7f1[_0xd009('0x22')][_0xd009('0x23')]===0x1f4){logger[_0xd009('0x22')](_0xd009('0x1d'),_0x239110,_0x1ec7f1[_0xd009('0x22')][_0xd009('0x24')]);return _0x2dc2db(_0x1ec7f1['error'][_0xd009('0x24')]);}logger[_0xd009('0x22')]('Network,\x20%s,\x20%s',_0x239110,_0x1ec7f1[_0xd009('0x22')]['message']);return _0x3246ac(_0x1ec7f1[_0xd009('0x22')]['message']);}else{logger[_0xd009('0x1c')](_0xd009('0x1d'),_0x239110,'request\x20sent');_0x3246ac(_0x1ec7f1[_0xd009('0x25')][_0xd009('0x24')]);}})[_0xd009('0x26')](function(_0x1e017d){logger[_0xd009('0x22')]('Network,\x20%s,\x20%s',_0x239110,_0x1e017d);_0x2dc2db(_0x1e017d);});});}function respondWithStatusCode(_0x1fa948,_0x236985){_0x236985=_0x236985||0xcc;return function(_0x560640){if(_0x560640){return _0x1fa948['sendStatus'](_0x236985);}return _0x1fa948[_0xd009('0x27')](_0x236985)['end']();};}function respondWithResult(_0x11fdd1,_0x24e811){_0x24e811=_0x24e811||0xc8;return function(_0x12ac50){if(_0x12ac50){return _0x11fdd1[_0xd009('0x27')](_0x24e811)[_0xd009('0x28')](_0x12ac50);}};}function respondWithFilteredResult(_0x2baebf,_0x3b2ea5){return function(_0x2779c){if(_0x2779c){var _0xafc6a4=_0x2779c[_0xd009('0x29')],_0x36bb67=_0x3b2ea5[_0xd009('0x2a')],_0x341050=_0x3b2ea5[_0xd009('0x2a')]+_0x3b2ea5[_0xd009('0x2b')],_0xe3747d;if(_0x341050>=_0xafc6a4){_0x341050=_0xafc6a4;_0xe3747d=0xc8;}else{_0xe3747d=0xce;}_0x2baebf['status'](_0xe3747d);return _0x2baebf[_0xd009('0x2c')](_0xd009('0x2d'),_0x36bb67+'-'+_0x341050+'/'+_0xafc6a4)['json'](_0x2779c);}return null;};}function patchUpdates(_0x49883b){return function(_0x3d7797){try{jsonpatch['apply'](_0x3d7797,_0x49883b,!![]);}catch(_0x225a8e){return BPromise[_0xd009('0x2e')](_0x225a8e);}return _0x3d7797[_0xd009('0x2f')]();};}function saveUpdates(_0x43cea1,_0x2f92e4){return function(_0x1cc6df){if(_0x1cc6df){return _0x1cc6df[_0xd009('0x30')](_0x43cea1)[_0xd009('0x1b')](function(_0x3d51c7){return _0x3d51c7;});}return null;};}function removeEntity(_0x4d50a9,_0x37aa13){return function(_0x16b6a0){if(_0x16b6a0){return _0x16b6a0[_0xd009('0x31')]()['then'](function(){_0x4d50a9[_0xd009('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1b03,_0x38b0a2){return function(_0x156e4c){if(!_0x156e4c){_0x2f1b03[_0xd009('0x32')](0x194);}return _0x156e4c;};}function handleError(_0x4b61fe,_0x72c908){_0x72c908=_0x72c908||0x1f4;return function(_0x5428d7){logger[_0xd009('0x22')](_0x5428d7[_0xd009('0x33')]);if(_0x5428d7[_0xd009('0x34')]){delete _0x5428d7[_0xd009('0x34')];}_0x4b61fe[_0xd009('0x27')](_0x72c908)[_0xd009('0x35')](_0x5428d7);};}exports[_0xd009('0x36')]=function(_0x1cc11c,_0x27959e){var _0x5d7e7f={},_0x22bf9c={},_0x3820f1={'count':0x0,'rows':[]};var _0x4c63b4=_['map'](db[_0xd009('0x37')]['rawAttributes'],function(_0x4d2c05){return{'name':_0x4d2c05[_0xd009('0x38')],'type':_0x4d2c05[_0xd009('0x39')][_0xd009('0x3a')]};});_0x22bf9c[_0xd009('0x3b')]=_[_0xd009('0x3c')](_0x4c63b4,_0xd009('0x34'));_0x22bf9c['query']=_['keys'](_0x1cc11c[_0xd009('0x3d')]);_0x22bf9c[_0xd009('0x3e')]=_['intersection'](_0x22bf9c[_0xd009('0x3b')],_0x22bf9c[_0xd009('0x3d')]);_0x5d7e7f[_0xd009('0x3f')]=_[_0xd009('0x40')](_0x22bf9c[_0xd009('0x3b')],qs[_0xd009('0x41')](_0x1cc11c[_0xd009('0x3d')][_0xd009('0x41')]));_0x5d7e7f[_0xd009('0x3f')]=_0x5d7e7f[_0xd009('0x3f')]['length']?_0x5d7e7f[_0xd009('0x3f')]:_0x22bf9c[_0xd009('0x3b')];if(!_0x1cc11c['query']['hasOwnProperty'](_0xd009('0x42'))){_0x5d7e7f[_0xd009('0x2b')]=qs[_0xd009('0x2b')](_0x1cc11c['query'][_0xd009('0x2b')]);_0x5d7e7f[_0xd009('0x2a')]=qs[_0xd009('0x2a')](_0x1cc11c[_0xd009('0x3d')][_0xd009('0x2a')]);}_0x5d7e7f[_0xd009('0x43')]=qs[_0xd009('0x44')](_0x1cc11c[_0xd009('0x3d')][_0xd009('0x44')]);_0x5d7e7f[_0xd009('0x45')]=qs[_0xd009('0x3e')](_[_0xd009('0x46')](_0x1cc11c[_0xd009('0x3d')],_0x22bf9c[_0xd009('0x3e')]));if(_0x1cc11c[_0xd009('0x3d')][_0xd009('0x47')]){_0x5d7e7f[_0xd009('0x45')]=_['merge'](_0x5d7e7f['where'],{'$or':_[_0xd009('0x3c')](_0x4c63b4,function(_0xe25e60){if(_0xe25e60['type']!==_0xd009('0x48')){var _0x349913={};_0x349913[_0xe25e60[_0xd009('0x34')]]={'$like':'%'+_0x1cc11c['query'][_0xd009('0x47')]+'%'};return _0x349913;}})});}_0x5d7e7f=_[_0xd009('0x49')]({},_0x5d7e7f,_0x1cc11c['options']);var _0x593c9a={'where':_0x5d7e7f[_0xd009('0x45')]};return db[_0xd009('0x37')]['count'](_0x593c9a)['then'](function(_0x1f0d1c){_0x3820f1['count']=_0x1f0d1c;if(_0x1cc11c['query'][_0xd009('0x4a')]){_0x5d7e7f[_0xd009('0x4b')]=[{'all':!![]}];}return db[_0xd009('0x37')][_0xd009('0x4c')](_0x5d7e7f);})[_0xd009('0x1b')](function(_0x140511){_0x3820f1[_0xd009('0x4d')]=_0x140511;return _0x3820f1;})['then'](respondWithFilteredResult(_0x27959e,_0x5d7e7f))[_0xd009('0x26')](handleError(_0x27959e,null));};exports[_0xd009('0x4e')]=function(_0x45e849,_0x521a11){var _0x181fa3={'raw':!![],'where':{'id':_0x45e849[_0xd009('0x4f')]['id']}},_0x2a6192={};_0x2a6192['model']=_[_0xd009('0x50')](db[_0xd009('0x37')]['rawAttributes']);_0x2a6192[_0xd009('0x3d')]=_['keys'](_0x45e849['query']);_0x2a6192[_0xd009('0x3e')]=_[_0xd009('0x40')](_0x2a6192[_0xd009('0x3b')],_0x2a6192[_0xd009('0x3d')]);_0x181fa3[_0xd009('0x3f')]=_[_0xd009('0x40')](_0x2a6192[_0xd009('0x3b')],qs['fields'](_0x45e849['query'][_0xd009('0x41')]));_0x181fa3[_0xd009('0x3f')]=_0x181fa3['attributes'][_0xd009('0x51')]?_0x181fa3['attributes']:_0x2a6192[_0xd009('0x3b')];if(_0x45e849[_0xd009('0x3d')][_0xd009('0x4a')]){_0x181fa3[_0xd009('0x4b')]=[{'all':!![]}];}_0x181fa3=_['merge']({},_0x181fa3,_0x45e849['options']);return db[_0xd009('0x37')]['find'](_0x181fa3)[_0xd009('0x1b')](handleEntityNotFound(_0x521a11,null))[_0xd009('0x1b')](respondWithResult(_0x521a11,null))[_0xd009('0x26')](handleError(_0x521a11,null));};exports[_0xd009('0x52')]=function(_0x5751d2,_0x352129,_0x441ebe){var _0x3e236b;return db[_0xd009('0x53')][_0xd009('0x54')](function(_0x21e3f3){return db['Network'][_0xd009('0x52')](_0x5751d2[_0xd009('0x55')],{'raw':!![]})[_0xd009('0x1b')](function(_0x4bbd91){_0x3e236b=_0x4bbd91;return db[_0xd009('0x37')][_0xd009('0x4c')]({'where':{'type':_0x5751d2[_0xd009('0x55')]['type']},'raw':!![]});})[_0xd009('0x1b')](function(_0x1763e0){var _0x11eaa3=fs[_0xd009('0x56')](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x435d1d=ejs['render'](_0x11eaa3,{'networks':_0x1763e0||[]});fs[_0xd009('0x57')](util[_0xd009('0x58')](_0xd009('0x59'),_0x5751d2[_0xd009('0x55')][_0xd009('0x39')]['toLowerCase']()),_0x435d1d);})[_0xd009('0x1b')](function(){return respondWithRpcPromise(_0xd009('0x5a'),_0xd009('0x52'),{'module':'chan_sip.so'});})['then'](function(){return _0x3e236b;});})[_0xd009('0x1b')](respondWithResult(_0x352129,0xc9))[_0xd009('0x26')](handleError(_0x352129,null));};exports[_0xd009('0x30')]=function(_0x522e00,_0x190ad6,_0x46836a){var _0xb2eba;return db['sequelize']['transaction'](function(_0x1f67f1){return db[_0xd009('0x37')]['find']({'where':{'id':_0x522e00[_0xd009('0x4f')]['id']}})[_0xd009('0x1b')](handleEntityNotFound(_0x190ad6,null))[_0xd009('0x1b')](saveUpdates(_0x522e00['body'],null))[_0xd009('0x1b')](function(_0x5f340e){if(_0x5f340e){_0xb2eba=_0x5f340e;return db[_0xd009('0x37')][_0xd009('0x4c')]({'where':{'type':_0xb2eba[_0xd009('0x39')]},'raw':!![]});}return null;})[_0xd009('0x1b')](function(_0x539a4d){if(_0x539a4d){var _0x475fba=fs[_0xd009('0x56')](path['join'](config[_0xd009('0x5b')],_0xd009('0x5c')),_0xd009('0x5d'));var _0x5ad71a=ejs[_0xd009('0x5e')](_0x475fba,{'networks':_0x539a4d||[]});fs[_0xd009('0x57')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0xb2eba['type'][_0xd009('0x5f')]()),_0x5ad71a);return respondWithRpcPromise('Reload',_0xd009('0x30'),{'module':'chan_sip.so'});}return null;})[_0xd009('0x1b')](function(_0x55f9da){if(_0x55f9da){return _0xb2eba;}return null;});})[_0xd009('0x1b')](respondWithResult(_0x190ad6,null))[_0xd009('0x26')](handleError(_0x190ad6,null));};exports[_0xd009('0x31')]=function(_0x590052,_0x7619d6,_0x4d5e3b){var _0x40490f;return db[_0xd009('0x37')][_0xd009('0x60')]({'where':{'id':_0x590052[_0xd009('0x4f')]['id']}})['then'](function(_0x5b0934){_0x40490f=_0x5b0934;return _0x5b0934;})[_0xd009('0x1b')](handleEntityNotFound(_0x7619d6,null))[_0xd009('0x1b')](removeEntity(_0x7619d6,null))[_0xd009('0x1b')](function(){if(_0x40490f){return db['Network'][_0xd009('0x4c')]({'where':{'type':_0x40490f[_0xd009('0x39')]},'raw':!![]});}})['then'](function(_0x57136d){if(_0x57136d){var _0x1c4ffc=fs[_0xd009('0x56')](path[_0xd009('0x61')](config[_0xd009('0x5b')],_0xd009('0x5c')),_0xd009('0x5d'));var _0x3f1b97=ejs[_0xd009('0x5e')](_0x1c4ffc,{'networks':_0x57136d||[]});fs[_0xd009('0x57')](util[_0xd009('0x58')]('/etc/asterisk/sip_xcally_%s.conf',_0x40490f[_0xd009('0x39')]['toLowerCase']()),_0x3f1b97);return respondWithRpcPromise(_0xd009('0x5a'),_0xd009('0x31'),{'module':_0xd009('0x62')});}})['catch'](handleError(_0x7619d6,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index c2970a6..ebe4a7a 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 _0xee60=['Network','network','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0xe5d6e2,_0x4ac771){var _0x5809e7=function(_0x488614){while(--_0x488614){_0xe5d6e2['push'](_0xe5d6e2['shift']());}};_0x5809e7(++_0x4ac771);}(_0xee60,0x124));var _0x0ee6=function(_0x55e790,_0x1384cd){_0x55e790=_0x55e790-0x0;var _0x79af8e=_0xee60[_0x55e790];return _0x79af8e;};'use strict';var _=require('lodash');var util=require(_0x0ee6('0x0'));var logger=require(_0x0ee6('0x1'))('api');var moment=require(_0x0ee6('0x2'));var BPromise=require('bluebird');var rp=require(_0x0ee6('0x3'));var fs=require('fs');var path=require(_0x0ee6('0x4'));var rimraf=require(_0x0ee6('0x5'));var config=require(_0x0ee6('0x6'));var attributes=require(_0x0ee6('0x7'));module['exports']=function(_0x11305c,_0x279dec){return _0x11305c['define'](_0x0ee6('0x8'),attributes,{'tableName':_0x0ee6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3d0=['bluebird','request-promise','path','rimraf','./network.attributes','exports','define','Network','lodash','util','../../config/logger','api','moment'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xc3d0,0xb1));var _0x0c3d=function(_0x562999,_0x39b239){_0x562999=_0x562999-0x0;var _0x43437a=_0xc3d0[_0x562999];return _0x43437a;};'use strict';var _=require(_0x0c3d('0x0'));var util=require(_0x0c3d('0x1'));var logger=require(_0x0c3d('0x2'))(_0x0c3d('0x3'));var moment=require(_0x0c3d('0x4'));var BPromise=require(_0x0c3d('0x5'));var rp=require(_0x0c3d('0x6'));var fs=require('fs');var path=require(_0x0c3d('0x7'));var rimraf=require(_0x0c3d('0x8'));var config=require('../../config/environment');var attributes=require(_0x0c3d('0x9'));module[_0x0c3d('0xa')]=function(_0x595122,_0x4f34a8){return _0x595122[_0x0c3d('0xb')](_0x0c3d('0xc'),attributes,{'tableName':'network','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 1737a00..a77c0ac 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 _0x278a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x983dc2,_0x5cca11){var _0x4b0315=function(_0x1042f9){while(--_0x1042f9){_0x983dc2['push'](_0x983dc2['shift']());}};_0x4b0315(++_0x5cca11);}(_0x278a,0x13a));var _0xa278=function(_0x2f2275,_0xda43d){_0x2f2275=_0x2f2275-0x0;var _0x542b08=_0x278a[_0x2f2275];return _0x542b08;};'use strict';var _=require(_0xa278('0x0'));var util=require(_0xa278('0x1'));var moment=require('moment');var BPromise=require(_0xa278('0x2'));var rs=require(_0xa278('0x3'));var fs=require('fs');var Redis=require(_0xa278('0x4'));var db=require(_0xa278('0x5'))['db'];var utils=require(_0xa278('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa278('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa278('0x8')][_0xa278('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b48e2,_0x24062e,_0x292b7e){return new BPromise(function(_0x469519,_0xa45955){return client[_0xa278('0xa')](_0x1b48e2,_0x292b7e)[_0xa278('0xb')](function(_0x184722){logger['info']('Network,\x20%s,\x20%s',_0x24062e,_0xa278('0xc'));logger[_0xa278('0xd')](_0xa278('0xe'),_0x24062e,'request\x20sent',JSON[_0xa278('0xf')](_0x184722));if(_0x184722[_0xa278('0x10')]){if(_0x184722[_0xa278('0x10')]['code']===0x1f4){logger[_0xa278('0x10')](_0xa278('0x11'),_0x24062e,_0x184722[_0xa278('0x10')]['message']);return _0xa45955(_0x184722['error'][_0xa278('0x12')]);}logger[_0xa278('0x10')]('Network,\x20%s,\x20%s',_0x24062e,_0x184722['error']['message']);return _0x469519(_0x184722[_0xa278('0x10')][_0xa278('0x12')]);}else{logger[_0xa278('0x13')]('Network,\x20%s,\x20%s',_0x24062e,'request\x20sent');_0x469519(_0x184722[_0xa278('0x14')][_0xa278('0x12')]);}})['catch'](function(_0x3968ab){logger[_0xa278('0x10')](_0xa278('0x11'),_0x24062e,_0x3968ab);_0xa45955(_0x3968ab);});});} \ No newline at end of file +var _0x35b4=['randomstring','ioredis','../../mysqldb','rpc','http','request','then','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x4d3835,_0x4f5f50){var _0x823439=function(_0x25a5c6){while(--_0x25a5c6){_0x4d3835['push'](_0x4d3835['shift']());}};_0x823439(++_0x4f5f50);}(_0x35b4,0x10d));var _0x435b=function(_0x4588dc,_0x2d4412){_0x4588dc=_0x4588dc-0x0;var _0x20030c=_0x35b4[_0x4588dc];return _0x20030c;};'use strict';var _=require(_0x435b('0x0'));var util=require(_0x435b('0x1'));var moment=require(_0x435b('0x2'));var BPromise=require(_0x435b('0x3'));var rs=require(_0x435b('0x4'));var fs=require('fs');var Redis=require(_0x435b('0x5'));var db=require(_0x435b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x435b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x435b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e9f38,_0x3dc2d1,_0x44491c){return new BPromise(function(_0xa9422a,_0xf4603f){return client[_0x435b('0x9')](_0x5e9f38,_0x44491c)[_0x435b('0xa')](function(_0x6e0329){logger['info'](_0x435b('0xb'),_0x3dc2d1,'request\x20sent');logger[_0x435b('0xc')](_0x435b('0xd'),_0x3dc2d1,_0x435b('0xe'),JSON[_0x435b('0xf')](_0x6e0329));if(_0x6e0329[_0x435b('0x10')]){if(_0x6e0329[_0x435b('0x10')]['code']===0x1f4){logger[_0x435b('0x10')](_0x435b('0xb'),_0x3dc2d1,_0x6e0329[_0x435b('0x10')]['message']);return _0xf4603f(_0x6e0329[_0x435b('0x10')]['message']);}logger[_0x435b('0x10')]('Network,\x20%s,\x20%s',_0x3dc2d1,_0x6e0329[_0x435b('0x10')][_0x435b('0x11')]);return _0xa9422a(_0x6e0329[_0x435b('0x10')][_0x435b('0x11')]);}else{logger[_0x435b('0x12')](_0x435b('0xb'),_0x3dc2d1,_0x435b('0xe'));_0xa9422a(_0x6e0329[_0x435b('0x13')]['message']);}})[_0x435b('0x14')](function(_0x14e1ce){logger[_0x435b('0x10')]('Network,\x20%s,\x20%s',_0x3dc2d1,_0x14e1ce);_0xf4603f(_0x14e1ce);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index eee4e60..58fcdb5 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 _0xd1e9=['addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','update','destroy','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition'];(function(_0x33a8c5,_0x2f4b8a){var _0x5585b4=function(_0x2f26f4){while(--_0x2f26f4){_0x33a8c5['push'](_0x33a8c5['shift']());}};_0x5585b4(++_0x2f4b8a);}(_0xd1e9,0xa3));var _0x9d1e=function(_0x285069,_0x220333){_0x285069=_0x285069-0x0;var _0x55f382=_0xd1e9[_0x285069];return _0x55f382;};'use strict';var multer=require(_0x9d1e('0x0'));var util=require('util');var path=require(_0x9d1e('0x1'));var timeout=require(_0x9d1e('0x2'));var express=require('express');var router=express[_0x9d1e('0x3')]();var auth=require(_0x9d1e('0x4'));var interaction=require(_0x9d1e('0x5'));var config=require(_0x9d1e('0x6'));var controller=require(_0x9d1e('0x7'));router[_0x9d1e('0x8')]('/',auth[_0x9d1e('0x9')](),controller[_0x9d1e('0xa')]);router[_0x9d1e('0x8')](_0x9d1e('0xb'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0xc')]);router['get'](_0x9d1e('0xd'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0xe')]);router['get'](_0x9d1e('0xf'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x10')]);router[_0x9d1e('0x8')](_0x9d1e('0x11'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x12')]);router[_0x9d1e('0x8')](_0x9d1e('0x13'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x14')]);router['get'](_0x9d1e('0x15'),auth['isAuthenticated'](),controller[_0x9d1e('0x16')]);router['get'](_0x9d1e('0x17'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x18')]);router[_0x9d1e('0x19')]('/',auth[_0x9d1e('0x9')](),controller['create']);router[_0x9d1e('0x19')]('/:id/dispositions',auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x1a')]);router['post'](_0x9d1e('0x11'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x1b')]);router['post'](_0x9d1e('0x1c'),controller[_0x9d1e('0x1d')]);router['post']('/:id/applications',auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x1e')]);router['post'](_0x9d1e('0x17'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x1f')]);router[_0x9d1e('0x19')](_0x9d1e('0x20'),auth[_0x9d1e('0x9')](),controller['send']);router['put'](_0x9d1e('0xd'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x21')]);router['delete'](_0x9d1e('0xd'),auth['isAuthenticated'](),controller[_0x9d1e('0x22')]);router[_0x9d1e('0x23')]('/:id/dispositions',auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x24')]);router['delete'](_0x9d1e('0x11'),auth[_0x9d1e('0x9')](),controller[_0x9d1e('0x25')]);router[_0x9d1e('0x23')](_0x9d1e('0x17'),auth[_0x9d1e('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x18aa=['getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions'];(function(_0x193b15,_0x5cdf91){var _0x2df9d5=function(_0x53caf6){while(--_0x53caf6){_0x193b15['push'](_0x193b15['shift']());}};_0x2df9d5(++_0x5cdf91);}(_0x18aa,0xe5));var _0xa18a=function(_0xd54eb2,_0x3afb86){_0xd54eb2=_0xd54eb2-0x0;var _0x1aad4a=_0x18aa[_0xd54eb2];return _0x1aad4a;};'use strict';var multer=require(_0xa18a('0x0'));var util=require(_0xa18a('0x1'));var path=require(_0xa18a('0x2'));var timeout=require(_0xa18a('0x3'));var express=require(_0xa18a('0x4'));var router=express[_0xa18a('0x5')]();var auth=require(_0xa18a('0x6'));var interaction=require(_0xa18a('0x7'));var config=require(_0xa18a('0x8'));var controller=require(_0xa18a('0x9'));router[_0xa18a('0xa')]('/',auth[_0xa18a('0xb')](),controller[_0xa18a('0xc')]);router['get'](_0xa18a('0xd'),auth[_0xa18a('0xb')](),controller[_0xa18a('0xe')]);router[_0xa18a('0xa')](_0xa18a('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa18a('0x10'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x11')]);router[_0xa18a('0xa')](_0xa18a('0x12'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x13')]);router['get']('/:id/applications',auth[_0xa18a('0xb')](),controller['getApplications']);router[_0xa18a('0xa')](_0xa18a('0x14'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x15')]);router[_0xa18a('0xa')](_0xa18a('0x16'),auth['isAuthenticated'](),controller[_0xa18a('0x17')]);router[_0xa18a('0x18')]('/',auth[_0xa18a('0xb')](),controller[_0xa18a('0x19')]);router['post']('/:id/dispositions',auth[_0xa18a('0xb')](),controller['addDisposition']);router[_0xa18a('0x18')]('/:id/canned_answers',auth[_0xa18a('0xb')](),controller[_0xa18a('0x1a')]);router['post'](_0xa18a('0x1b'),controller[_0xa18a('0x1c')]);router['post'](_0xa18a('0x1d'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x1e')]);router[_0xa18a('0x18')](_0xa18a('0x16'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x1f')]);router[_0xa18a('0x18')]('/:id/send',auth['isAuthenticated'](),controller[_0xa18a('0x20')]);router[_0xa18a('0x21')](_0xa18a('0xf'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x22')]);router[_0xa18a('0x23')](_0xa18a('0xf'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x24')]);router[_0xa18a('0x23')](_0xa18a('0x10'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x25')]);router['delete'](_0xa18a('0x12'),auth['isAuthenticated'](),controller[_0xa18a('0x26')]);router['delete'](_0xa18a('0x16'),auth[_0xa18a('0xb')](),controller[_0xa18a('0x27')]);module[_0xa18a('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 22d4592..73001f3 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 _0xbdc4=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','name','STRING','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5aaa33,_0x454bba){var _0x11dba9=function(_0x5fb5cc){while(--_0x5fb5cc){_0x5aaa33['push'](_0x5aaa33['shift']());}};_0x11dba9(++_0x454bba);}(_0xbdc4,0xea));var _0x4bdc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xbdc4[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x4bdc('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bdc('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4bdc('0x2')]},'token':{'type':Sequelize[_0x4bdc('0x2')],'defaultValue':function(){return rs[_0x4bdc('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4bdc('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4bdc('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4bdc('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4bdc('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4bdc('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4bdc('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4bdc('0x7'),'set':function(_0x1ae23d){if(!_0x1ae23d)this[_0x4bdc('0x8')](_0x4bdc('0x9'),null);this[_0x4bdc('0x8')](_0x4bdc('0xa'),_0x1ae23d);}}}; \ No newline at end of file +var _0x0edb=['generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name'];(function(_0x28f922,_0x1302f8){var _0x4eceac=function(_0x2ce5a0){while(--_0x2ce5a0){_0x28f922['push'](_0x28f922['shift']());}};_0x4eceac(++_0x1302f8);}(_0x0edb,0x188));var _0xb0ed=function(_0x1995a6,_0x5cbae7){_0x1995a6=_0x1995a6-0x0;var _0x314896=_0x0edb[_0x1995a6];return _0x314896;};'use strict';var Sequelize=require(_0xb0ed('0x0'));var rs=require('randomstring');module[_0xb0ed('0x1')]={'name':{'type':Sequelize[_0xb0ed('0x2')],'unique':_0xb0ed('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb0ed('0x2')]},'token':{'type':Sequelize[_0xb0ed('0x2')],'defaultValue':function(){return rs[_0xb0ed('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb0ed('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb0ed('0x5');}},'notificationSound':{'type':Sequelize[_0xb0ed('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb0ed('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb0ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb0ed('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb0ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb0ed('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb0ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb0ed('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xb0ed('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb0ed('0x9'),'set':function(_0x5a43b6){if(!_0x5a43b6)this[_0xb0ed('0xa')]('mandatoryDispositionPauseId',null);this[_0xb0ed('0xa')](_0xb0ed('0xb'),_0x5a43b6);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 2d4cce4..a731b8b 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 _0xd3bb=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','merge','where','VIRTUAL','filter','OpenchannelAccount','include','findAll','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpnechannelAccountId','Disposition','findOne','sort','pick','OpenchannelAccountId','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','options','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','List','CmContact','Contacts','DESC','Applications','account','applications','list','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','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','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','end','status','count','offset','set','Content-Range','json','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xd3bb,0x1eb));var _0xbd3b=function(_0x43229d,_0x3c58d3){_0x43229d=_0x43229d-0x0;var _0x1e332d=_0xd3bb[_0x43229d];return _0x1e332d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd3b('0x0'));var rimraf=require(_0xbd3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd3b('0x2'));var rp=require(_0xbd3b('0x3'));var moment=require(_0xbd3b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbd3b('0x5'));var util=require(_0xbd3b('0x6'));var path=require(_0xbd3b('0x7'));var sox=require('sox');var csv=require(_0xbd3b('0x8'));var ejs=require(_0xbd3b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd3b('0xa'));var crypto=require(_0xbd3b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbd3b('0xc'));var toCsv=require(_0xbd3b('0x8'));var querystring=require(_0xbd3b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd3b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd3b('0xf'));var logger=require(_0xbd3b('0x10'))('api');var utils=require(_0xbd3b('0x11'));var config=require(_0xbd3b('0x12'));var db=require(_0xbd3b('0x13'))['db'];config[_0xbd3b('0x14')]=_[_0xbd3b('0x15')](config[_0xbd3b('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd3b('0x16'))(new Redis(config[_0xbd3b('0x14')]));require(_0xbd3b('0x17'))['register'](socket);var jayson=require(_0xbd3b('0x18'));var client=jayson[_0xbd3b('0x19')][_0xbd3b('0x1a')]({'port':0x232c});var client9002=jayson[_0xbd3b('0x19')][_0xbd3b('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x52387d,_0x2adc9c,_0x5ed9dd){if(_0x5ed9dd){var _0x184d5f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x184d5f[_0xbd3b('0x1b')](_0x2adc9c)){return _0x52387d;}else{throw new db['Sequelize']['ValidationError'](_0xbd3b('0x1c'));}}else{return _0x52387d;}}function respondWithRpcPromise(_0x2b2f7e,_0x23f187,_0x3fffb2,_0x5b059b){return new BPromise(function(_0x94dc28,_0x1c3299){var _0x182fec=_0x5b059b||client;return _0x182fec[_0xbd3b('0x1d')](_0x2b2f7e,_0x3fffb2)[_0xbd3b('0x1e')](function(_0xdb150b){logger[_0xbd3b('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x23f187,_0xbd3b('0x20'));logger[_0xbd3b('0x21')](_0xbd3b('0x22'),_0x23f187,_0xbd3b('0x20'),JSON[_0xbd3b('0x23')](_0xdb150b));if(_0xdb150b[_0xbd3b('0x24')]){if(_0xdb150b[_0xbd3b('0x24')][_0xbd3b('0x25')]===0x1f4){logger[_0xbd3b('0x24')](_0xbd3b('0x26'),_0x23f187,_0xdb150b[_0xbd3b('0x24')]['message']);return _0x1c3299(_0xdb150b['error'][_0xbd3b('0x27')]);}logger[_0xbd3b('0x24')](_0xbd3b('0x26'),_0x23f187,_0xdb150b[_0xbd3b('0x24')][_0xbd3b('0x27')]);return _0x94dc28(_0xdb150b[_0xbd3b('0x24')][_0xbd3b('0x27')]);}else{logger[_0xbd3b('0x1f')](_0xbd3b('0x26'),_0x23f187,_0xbd3b('0x20'));_0x94dc28(_0xdb150b['result'][_0xbd3b('0x27')]);}})['catch'](function(_0x59bf90){logger[_0xbd3b('0x24')](_0xbd3b('0x26'),_0x23f187,_0x59bf90);_0x1c3299(_0x59bf90);});});}function respondWithStatusCode(_0x270634,_0x24f347){_0x24f347=_0x24f347||0xcc;return function(_0x25bbda){if(_0x25bbda){return _0x270634['sendStatus'](_0x24f347);}return _0x270634['status'](_0x24f347)[_0xbd3b('0x28')]();};}function respondWithResult(_0x15be07,_0x43f619){_0x43f619=_0x43f619||0xc8;return function(_0x231c5b){if(_0x231c5b){return _0x15be07[_0xbd3b('0x29')](_0x43f619)['json'](_0x231c5b);}};}function respondWithFilteredResult(_0x283dad,_0x2b3d43){return function(_0x46b279){if(_0x46b279){var _0x556e0b=_0x46b279[_0xbd3b('0x2a')],_0x204b5f=_0x2b3d43[_0xbd3b('0x2b')],_0x1251e6=_0x2b3d43[_0xbd3b('0x2b')]+_0x2b3d43['limit'],_0x25415f;if(_0x1251e6>=_0x556e0b){_0x1251e6=_0x556e0b;_0x25415f=0xc8;}else{_0x25415f=0xce;}_0x283dad[_0xbd3b('0x29')](_0x25415f);return _0x283dad[_0xbd3b('0x2c')](_0xbd3b('0x2d'),_0x204b5f+'-'+_0x1251e6+'/'+_0x556e0b)[_0xbd3b('0x2e')](_0x46b279);}return null;};}function patchUpdates(_0x965763){return function(_0x5d1516){try{jsonpatch['apply'](_0x5d1516,_0x965763,!![]);}catch(_0x2b31c5){return BPromise[_0xbd3b('0x2f')](_0x2b31c5);}return _0x5d1516[_0xbd3b('0x30')]();};}function saveUpdates(_0x2b32ec,_0x56b004){return function(_0x4d9b24){if(_0x4d9b24){return _0x4d9b24[_0xbd3b('0x31')](_0x2b32ec)[_0xbd3b('0x1e')](function(_0x21df4c){return _0x21df4c;});}return null;};}function removeEntity(_0x19bab0,_0x324c4d){return function(_0x63655){if(_0x63655){return _0x63655[_0xbd3b('0x32')]()[_0xbd3b('0x1e')](function(){var _0x37d5e0=_0x63655[_0xbd3b('0x33')]({'plain':!![]});var _0x20e5fc=_0xbd3b('0x34');return db[_0xbd3b('0x35')]['destroy']({'where':{'type':_0x20e5fc,'resourceId':_0x37d5e0['id']}})[_0xbd3b('0x1e')](function(){return _0x63655;});})['then'](function(){_0x19bab0['status'](0xcc)[_0xbd3b('0x28')]();});}};}function handleEntityNotFound(_0x126a3e,_0x46f0b2){return function(_0x47e2bf){if(!_0x47e2bf){_0x126a3e[_0xbd3b('0x36')](0x194);}return _0x47e2bf;};}function handleError(_0x2d8b69,_0x35a147){_0x35a147=_0x35a147||0x1f4;return function(_0x5a9489){logger[_0xbd3b('0x24')](_0x5a9489[_0xbd3b('0x37')]);if(_0x5a9489[_0xbd3b('0x38')]){delete _0x5a9489[_0xbd3b('0x38')];}_0x2d8b69[_0xbd3b('0x29')](_0x35a147)['send'](_0x5a9489);};}exports[_0xbd3b('0x39')]=function(_0x40e95b,_0x318964){var _0x363cfd={'include':[{'model':db[_0xbd3b('0x3a')],'as':_0xbd3b('0x3b')}]},_0x5cee33={},_0x2ff437={'count':0x0,'rows':[]};var _0x5d0484=_[_0xbd3b('0x3c')](db['OpenchannelAccount'][_0xbd3b('0x3d')],function(_0x540efb){return{'name':_0x540efb[_0xbd3b('0x3e')],'type':_0x540efb[_0xbd3b('0x3f')][_0xbd3b('0x40')]};});_0x5cee33[_0xbd3b('0x41')]=_['map'](_0x5d0484,_0xbd3b('0x38'));_0x5cee33[_0xbd3b('0x42')]=_[_0xbd3b('0x43')](_0x40e95b['query']);_0x5cee33[_0xbd3b('0x44')]=_[_0xbd3b('0x45')](_0x5cee33['model'],_0x5cee33[_0xbd3b('0x42')]);_0x363cfd[_0xbd3b('0x46')]=_[_0xbd3b('0x45')](_0x5cee33[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x40e95b[_0xbd3b('0x42')]['fields']));_0x363cfd[_0xbd3b('0x46')]=_0x363cfd[_0xbd3b('0x46')][_0xbd3b('0x48')]?_0x363cfd[_0xbd3b('0x46')]:_0x5cee33[_0xbd3b('0x41')];if(!_0x40e95b[_0xbd3b('0x42')][_0xbd3b('0x49')](_0xbd3b('0x4a'))){_0x363cfd['limit']=qs[_0xbd3b('0x4b')](_0x40e95b['query'][_0xbd3b('0x4b')]);_0x363cfd[_0xbd3b('0x2b')]=qs['offset'](_0x40e95b[_0xbd3b('0x42')][_0xbd3b('0x2b')]);}_0x363cfd[_0xbd3b('0x4c')]=qs['sort'](_0x40e95b['query']['sort']);_0x363cfd['where']=qs[_0xbd3b('0x44')](_['pick'](_0x40e95b[_0xbd3b('0x42')],_0x5cee33[_0xbd3b('0x44')]));if(_0x40e95b['query']['filter']){_0x363cfd['where']=_[_0xbd3b('0x4d')](_0x363cfd[_0xbd3b('0x4e')],{'$or':_['map'](_0x5d0484,function(_0x3ac8fd){if(_0x3ac8fd['type']!==_0xbd3b('0x4f')){var _0x1d76e1={};_0x1d76e1[_0x3ac8fd['name']]={'$like':'%'+_0x40e95b['query'][_0xbd3b('0x50')]+'%'};return _0x1d76e1;}})});}_0x363cfd=_[_0xbd3b('0x4d')]({},_0x363cfd,_0x40e95b['options']);var _0x21bcf6={'where':_0x363cfd[_0xbd3b('0x4e')]};return db[_0xbd3b('0x51')]['count'](_0x21bcf6)[_0xbd3b('0x1e')](function(_0x2f772){_0x2ff437['count']=_0x2f772;if(_0x40e95b[_0xbd3b('0x42')]['includeAll']){_0x363cfd[_0xbd3b('0x52')]=[{'all':!![]}];}return db[_0xbd3b('0x51')][_0xbd3b('0x53')](_0x363cfd);})[_0xbd3b('0x1e')](function(_0x485b69){_0x2ff437['rows']=_0x485b69;return _0x2ff437;})[_0xbd3b('0x1e')](respondWithFilteredResult(_0x318964,_0x363cfd))[_0xbd3b('0x54')](handleError(_0x318964,null));};exports['show']=function(_0x6017ed,_0x5b50de){var _0x2aa191={'raw':![],'where':{'id':_0x6017ed['params']['id']},'include':[{'model':db[_0xbd3b('0x3a')],'as':_0xbd3b('0x3b')}]},_0x4cf2c8={};_0x4cf2c8['model']=_[_0xbd3b('0x43')](db[_0xbd3b('0x51')][_0xbd3b('0x3d')]);_0x4cf2c8[_0xbd3b('0x42')]=_[_0xbd3b('0x43')](_0x6017ed[_0xbd3b('0x42')]);_0x4cf2c8[_0xbd3b('0x44')]=_['intersection'](_0x4cf2c8[_0xbd3b('0x41')],_0x4cf2c8['query']);_0x2aa191[_0xbd3b('0x46')]=_[_0xbd3b('0x45')](_0x4cf2c8[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x6017ed['query']['fields']));_0x2aa191[_0xbd3b('0x46')]=_0x2aa191[_0xbd3b('0x46')]['length']?_0x2aa191[_0xbd3b('0x46')]:_0x4cf2c8[_0xbd3b('0x41')];if(_0x6017ed['query'][_0xbd3b('0x55')]){_0x2aa191[_0xbd3b('0x52')]=[{'all':!![]}];}_0x2aa191=_[_0xbd3b('0x4d')]({},_0x2aa191,_0x6017ed['options']);return db['OpenchannelAccount'][_0xbd3b('0x56')](_0x2aa191)[_0xbd3b('0x1e')](handleEntityNotFound(_0x5b50de,null))[_0xbd3b('0x1e')](respondWithResult(_0x5b50de,null))[_0xbd3b('0x54')](handleError(_0x5b50de,null));};exports[_0xbd3b('0x57')]=function(_0xf4502a,_0x5c505b){return db[_0xbd3b('0x51')][_0xbd3b('0x57')](_0xf4502a[_0xbd3b('0x58')],{})[_0xbd3b('0x1e')](function(_0x4a4aeb){var _0x457d11=_0xf4502a[_0xbd3b('0x59')]['get']({'plain':!![]});if(!_0x457d11)throw new Error(_0xbd3b('0x5a'));if(_0x457d11[_0xbd3b('0x5b')]===_0xbd3b('0x59')){var _0x17191f=_0x4a4aeb['get']({'plain':!![]});var _0x2e774c=_0xbd3b('0x34');return db['UserProfileSection'][_0xbd3b('0x56')]({'where':{'name':_0x2e774c,'userProfileId':_0x457d11['userProfileId']},'raw':!![]})[_0xbd3b('0x1e')](function(_0x124519){if(_0x124519&&_0x124519[_0xbd3b('0x5c')]===0x0){return db[_0xbd3b('0x35')]['create']({'name':_0x17191f[_0xbd3b('0x38')],'resourceId':_0x17191f['id'],'type':_0x124519[_0xbd3b('0x38')],'sectionId':_0x124519['id']},{})[_0xbd3b('0x1e')](function(){return _0x4a4aeb;});}else{return _0x4a4aeb;}})[_0xbd3b('0x54')](function(_0x1c9b13){logger[_0xbd3b('0x24')](_0xbd3b('0x5d'),_0x1c9b13);throw _0x1c9b13;});}return _0x4a4aeb;})[_0xbd3b('0x1e')](respondWithResult(_0x5c505b,0xc9))[_0xbd3b('0x54')](handleError(_0x5c505b,null));};exports[_0xbd3b('0x31')]=function(_0xec78fb,_0x498ac6){if(_0xec78fb[_0xbd3b('0x58')]['id']){delete _0xec78fb['body']['id'];}return db[_0xbd3b('0x51')][_0xbd3b('0x56')]({'where':{'id':_0xec78fb['params']['id']},'include':[{'model':db[_0xbd3b('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xbd3b('0x1e')](handleEntityNotFound(_0x498ac6,null))['then'](saveUpdates(_0xec78fb['body'],null))[_0xbd3b('0x1e')](respondWithResult(_0x498ac6,null))[_0xbd3b('0x54')](handleError(_0x498ac6,null));};exports[_0xbd3b('0x32')]=function(_0x15c00f,_0x386cbf){return db['OpenchannelAccount'][_0xbd3b('0x56')]({'where':{'id':_0x15c00f[_0xbd3b('0x5e')]['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x386cbf,null))[_0xbd3b('0x1e')](removeEntity(_0x386cbf,null))[_0xbd3b('0x54')](handleError(_0x386cbf,null));};exports[_0xbd3b('0x5f')]=function(_0x306cc0,_0x4d3a51){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x4d3a51,null))[_0xbd3b('0x54')](handleError(_0x4d3a51,null));};exports['addDisposition']=function(_0x10dce4,_0x2f7bce,_0x7321ab){if(_0x10dce4[_0xbd3b('0x58')]['id']){delete _0x10dce4[_0xbd3b('0x58')]['id'];}return db[_0xbd3b('0x51')][_0xbd3b('0x56')]({'where':{'id':_0x10dce4['params']['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x2f7bce,null))[_0xbd3b('0x1e')](function(_0x282bd7){if(_0x282bd7){_0x10dce4[_0xbd3b('0x58')][_0xbd3b('0x60')]=_0x282bd7['id'];return db[_0xbd3b('0x61')][_0xbd3b('0x57')](_0x10dce4[_0xbd3b('0x58')]);}})[_0xbd3b('0x1e')](respondWithResult(_0x2f7bce,null))[_0xbd3b('0x54')](handleError(_0x2f7bce,null));};exports['getDispositions']=function(_0x58675f,_0x26887e,_0x266099){var _0x39a5d3={'raw':![],'where':{}};var _0x1445eb={};var _0x4e0d49={'count':0x0,'rows':[]};return db[_0xbd3b('0x51')][_0xbd3b('0x62')]({'where':{'id':_0x58675f['params']['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x26887e,null))[_0xbd3b('0x1e')](function(_0x4f6da6){if(_0x4f6da6){_0x1445eb[_0xbd3b('0x41')]=_['keys'](db[_0xbd3b('0x61')][_0xbd3b('0x3d')]);_0x1445eb[_0xbd3b('0x42')]=_[_0xbd3b('0x43')](_0x58675f[_0xbd3b('0x42')]);_0x1445eb['filters']=_['intersection'](_0x1445eb['model'],_0x1445eb[_0xbd3b('0x42')]);_0x39a5d3[_0xbd3b('0x46')]=_[_0xbd3b('0x45')](_0x1445eb[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x58675f[_0xbd3b('0x42')][_0xbd3b('0x47')]));_0x39a5d3[_0xbd3b('0x46')]=_0x39a5d3[_0xbd3b('0x46')]['length']?_0x39a5d3[_0xbd3b('0x46')]:_0x1445eb[_0xbd3b('0x41')];if(!_0x58675f[_0xbd3b('0x42')]['hasOwnProperty'](_0xbd3b('0x4a'))){_0x39a5d3[_0xbd3b('0x4b')]=qs[_0xbd3b('0x4b')](_0x58675f[_0xbd3b('0x42')][_0xbd3b('0x4b')]);_0x39a5d3[_0xbd3b('0x2b')]=qs[_0xbd3b('0x2b')](_0x58675f[_0xbd3b('0x42')][_0xbd3b('0x2b')]);}_0x39a5d3[_0xbd3b('0x4c')]=qs[_0xbd3b('0x63')](_0x58675f['query'][_0xbd3b('0x63')]);_0x39a5d3[_0xbd3b('0x4e')]=qs[_0xbd3b('0x44')](_[_0xbd3b('0x64')](_0x58675f[_0xbd3b('0x42')],_0x1445eb[_0xbd3b('0x44')]));_0x39a5d3[_0xbd3b('0x4e')][_0xbd3b('0x65')]=_0x4f6da6['id'];if(_0x58675f[_0xbd3b('0x42')][_0xbd3b('0x50')]){_0x39a5d3[_0xbd3b('0x4e')]=_['merge'](_0x39a5d3[_0xbd3b('0x4e')],{'$or':_[_0xbd3b('0x3c')](_0x39a5d3['attributes'],function(_0x19276f){var _0x5f152b={};_0x5f152b[_0x19276f]={'$like':'%'+_0x58675f[_0xbd3b('0x42')][_0xbd3b('0x50')]+'%'};return _0x5f152b;})});}_0x39a5d3=_[_0xbd3b('0x4d')]({},_0x39a5d3,_0x58675f['options']);return db['Disposition'][_0xbd3b('0x2a')]({'where':_0x39a5d3['where']})[_0xbd3b('0x1e')](function(_0x3e95c3){_0x4e0d49[_0xbd3b('0x2a')]=_0x3e95c3;if(_0x58675f[_0xbd3b('0x42')]['includeAll']){_0x39a5d3['include']=[{'all':!![]}];}return db['Disposition'][_0xbd3b('0x53')](_0x39a5d3);})[_0xbd3b('0x1e')](function(_0x4eb976){_0x4e0d49[_0xbd3b('0x66')]=_0x4eb976;return _0x4e0d49;});}})[_0xbd3b('0x1e')](respondWithFilteredResult(_0x26887e,_0x39a5d3))[_0xbd3b('0x54')](handleError(_0x26887e,null));};exports[_0xbd3b('0x67')]=function(_0x313d53,_0x5efefc,_0x58e216){return db[_0xbd3b('0x51')][_0xbd3b('0x56')]({'where':{'id':_0x313d53[_0xbd3b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5efefc,null))[_0xbd3b('0x1e')](function(_0x423357){if(_0x423357){return _0x423357[_0xbd3b('0x67')](_0x313d53[_0xbd3b('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x5efefc,null))[_0xbd3b('0x54')](handleError(_0x5efefc,null));};exports[_0xbd3b('0x68')]=function(_0x42b509,_0xeb3953,_0x1bce1c){if(_0x42b509['body']['id']){delete _0x42b509[_0xbd3b('0x58')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x42b509['params']['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0xeb3953,null))[_0xbd3b('0x1e')](function(_0xe130c5){if(_0xe130c5){_0x42b509['body'][_0xbd3b('0x65')]=_0xe130c5['id'];return db[_0xbd3b('0x69')]['create'](_0x42b509[_0xbd3b('0x58')]);}})[_0xbd3b('0x1e')](respondWithResult(_0xeb3953,null))['catch'](handleError(_0xeb3953,null));};exports[_0xbd3b('0x6a')]=function(_0x560d11,_0x35ed27,_0x84b14f){var _0xd43981={'raw':![],'where':{}};var _0x157d05={};var _0x5c9e28={'count':0x0,'rows':[]};return db[_0xbd3b('0x51')]['findOne']({'where':{'id':_0x560d11[_0xbd3b('0x5e')]['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x35ed27,null))['then'](function(_0xd38d58){if(_0xd38d58){_0x157d05['model']=_[_0xbd3b('0x43')](db[_0xbd3b('0x69')][_0xbd3b('0x3d')]);_0x157d05['query']=_[_0xbd3b('0x43')](_0x560d11['query']);_0x157d05[_0xbd3b('0x44')]=_[_0xbd3b('0x45')](_0x157d05[_0xbd3b('0x41')],_0x157d05[_0xbd3b('0x42')]);_0xd43981[_0xbd3b('0x46')]=_['intersection'](_0x157d05[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x560d11[_0xbd3b('0x42')][_0xbd3b('0x47')]));_0xd43981['attributes']=_0xd43981['attributes'][_0xbd3b('0x48')]?_0xd43981[_0xbd3b('0x46')]:_0x157d05['model'];if(!_0x560d11[_0xbd3b('0x42')][_0xbd3b('0x49')](_0xbd3b('0x4a'))){_0xd43981[_0xbd3b('0x4b')]=qs[_0xbd3b('0x4b')](_0x560d11['query']['limit']);_0xd43981[_0xbd3b('0x2b')]=qs['offset'](_0x560d11[_0xbd3b('0x42')][_0xbd3b('0x2b')]);}_0xd43981[_0xbd3b('0x4c')]=qs['sort'](_0x560d11[_0xbd3b('0x42')][_0xbd3b('0x63')]);_0xd43981[_0xbd3b('0x4e')]=qs[_0xbd3b('0x44')](_[_0xbd3b('0x64')](_0x560d11[_0xbd3b('0x42')],_0x157d05['filters']));_0xd43981[_0xbd3b('0x4e')][_0xbd3b('0x65')]=_0xd38d58['id'];if(_0x560d11['query'][_0xbd3b('0x50')]){_0xd43981[_0xbd3b('0x4e')]=_['merge'](_0xd43981[_0xbd3b('0x4e')],{'$or':_[_0xbd3b('0x3c')](_0xd43981[_0xbd3b('0x46')],function(_0x127ed8){var _0x24066e={};_0x24066e[_0x127ed8]={'$like':'%'+_0x560d11[_0xbd3b('0x42')][_0xbd3b('0x50')]+'%'};return _0x24066e;})});}_0xd43981=_[_0xbd3b('0x4d')]({},_0xd43981,_0x560d11[_0xbd3b('0x6b')]);return db[_0xbd3b('0x69')]['count']({'where':_0xd43981[_0xbd3b('0x4e')]})[_0xbd3b('0x1e')](function(_0x502a53){_0x5c9e28[_0xbd3b('0x2a')]=_0x502a53;if(_0x560d11[_0xbd3b('0x42')][_0xbd3b('0x55')]){_0xd43981[_0xbd3b('0x52')]=[{'all':!![]}];}return db[_0xbd3b('0x69')][_0xbd3b('0x53')](_0xd43981);})['then'](function(_0x59e9d5){_0x5c9e28[_0xbd3b('0x66')]=_0x59e9d5;return _0x5c9e28;});}})[_0xbd3b('0x1e')](respondWithFilteredResult(_0x35ed27,_0xd43981))[_0xbd3b('0x54')](handleError(_0x35ed27,null));};exports[_0xbd3b('0x6c')]=function(_0x2f234a,_0x7dce30,_0x42f803){return db[_0xbd3b('0x51')][_0xbd3b('0x56')]({'where':{'id':_0x2f234a['params']['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x7dce30,null))[_0xbd3b('0x1e')](function(_0x3b8f9a){if(_0x3b8f9a){return _0x3b8f9a[_0xbd3b('0x6c')](_0x2f234a[_0xbd3b('0x42')]['ids']);}})[_0xbd3b('0x1e')](respondWithStatusCode(_0x7dce30,null))[_0xbd3b('0x54')](handleError(_0x7dce30,null));};exports[_0xbd3b('0x6d')]=function(_0x27e1ca,_0x2de476,_0xe29caf){var _0x4d0404={'body':_0x27e1ca[_0xbd3b('0x58')],'channel':_0xbd3b('0x6e')};var _0x4ddf0c=[];var _0x14e57e=[];var _0x542360={};var _0x469dc3=![];return db['CmContact'][_0xbd3b('0x5f')]()[_0xbd3b('0x1e')](function(_0x13775b){if(!_0x13775b){throw new db[(_0xbd3b('0x6f'))][(_0xbd3b('0x70'))](_0xbd3b('0x71'));}_0x4ddf0c=_['difference'](_[_0xbd3b('0x43')](_0x13775b),[_0xbd3b('0x72'),_0xbd3b('0x73')]);_0x14e57e=_['difference'](_[_0xbd3b('0x43')](_0x13775b),[_0xbd3b('0x72'),_0xbd3b('0x73'),'CompanyId',_0xbd3b('0x74')]);if(_0x27e1ca['body']['id']){delete _0x27e1ca[_0xbd3b('0x58')]['id'];}if(_[_0xbd3b('0x75')](_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x76')])){throw new db[(_0xbd3b('0x6f'))][(_0xbd3b('0x70'))](_0xbd3b('0x77'));}if(_[_0xbd3b('0x75')](_0x27e1ca['body'][_0xbd3b('0x58')])||_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x58')]===''){throw new db['Sequelize'][(_0xbd3b('0x70'))](_0xbd3b('0x78'));}if(_[_0xbd3b('0x75')](_0x27e1ca['body']['mapKey'])){throw new db[(_0xbd3b('0x6f'))][(_0xbd3b('0x70'))](_0xbd3b('0x79')+_0x14e57e);}if(!_[_0xbd3b('0x7a')](_0x14e57e,_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x7b')])){throw new db[(_0xbd3b('0x6f'))][(_0xbd3b('0x70'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14e57e);}_0x542360[_0x27e1ca['body']['mapKey']]=_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x76')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x27e1ca[_0xbd3b('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0xbd3b('0x7c'),'include':[{'model':db[_0xbd3b('0x7d')],'as':_0xbd3b('0x7e'),'where':_0x542360,'limit':0x1,'order':[[_0xbd3b('0x73'),_0xbd3b('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':_0xbd3b('0x80')}]});})[_0xbd3b('0x1e')](handleEntityNotFound(_0x2de476,null))[_0xbd3b('0x1e')](function(_0x2cc81b){if(_0x2cc81b&&_0x2cc81b['List']){_0x4d0404[_0xbd3b('0x81')]=_0x2cc81b;_0x4d0404[_0xbd3b('0x82')]=_0x2cc81b['Applications'];_0x4d0404[_0xbd3b('0x83')]=_0x2cc81b['List'];_0x4d0404[_0xbd3b('0x82')]=_['orderBy'](_0x4d0404['applications'],[_0xbd3b('0x84')],[_0xbd3b('0x85')]);if(_0x4d0404[_0xbd3b('0x81')]['Applications']){delete _0x4d0404[_0xbd3b('0x81')][_0xbd3b('0x80')];}if(_0x4d0404[_0xbd3b('0x81')][_0xbd3b('0x7c')]&&_0x4d0404[_0xbd3b('0x81')]['List']['Contacts'][_0xbd3b('0x48')]){return _0x4d0404['account'][_0xbd3b('0x7c')]['Contacts'][0x0];}var _0x24b598=_[_0xbd3b('0x15')](_0x27e1ca['body'],{'firstName':_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x76')],'ListId':_0x2cc81b[_0xbd3b('0x74')]});_0x24b598[_0x27e1ca['body'][_0xbd3b('0x7b')]]=_0x27e1ca['body']['from'];return db[_0xbd3b('0x7d')][_0xbd3b('0x57')](_0x24b598,{'fields':_0x4ddf0c,'raw':!![]});}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x2de476,null))['then'](function(_0x1dd80d){_0x4d0404[_0xbd3b('0x86')]=_0x1dd80d;if(_0x1dd80d){var _0x72893={'ContactId':_0x1dd80d['id'],'OpenchannelAccountId':_0x27e1ca[_0xbd3b('0x5e')]['id'],'from':(_0x1dd80d[_0xbd3b('0x87')]||'')+'\x20'+(_0x1dd80d[_0xbd3b('0x88')]||'')};var _0x2c3b47={'OpenchannelAccountId':_0x27e1ca[_0xbd3b('0x5e')]['id'],'closed':![]};if(_0x27e1ca[_0xbd3b('0x58')]['threadId']){_0x2c3b47[_0xbd3b('0x89')]=_0x27e1ca['body']['threadId'];return db[_0xbd3b('0x8a')][_0xbd3b('0x56')]({'where':_0x2c3b47})[_0xbd3b('0x1e')](function(_0x59a724){if(_0x59a724){return[_0x59a724,![]];}_0x72893[_0xbd3b('0x89')]=_0x27e1ca['body'][_0xbd3b('0x89')];_0x72893['externalUrl']=_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x8b')];return db[_0xbd3b('0x8a')][_0xbd3b('0x57')](_0x72893)[_0xbd3b('0x1e')](function(_0x143208){return[_0x143208,!![]];});});}else{_0x2c3b47[_0xbd3b('0x89')]=null;}_0x2c3b47[_0xbd3b('0x8c')]=_0x1dd80d['id'];return db[_0xbd3b('0x8a')]['find']({'where':_0x2c3b47})[_0xbd3b('0x1e')](function(_0x404fe8){if(_0x404fe8){return[_0x404fe8,![]];}return db[_0xbd3b('0x8a')]['create'](_0x72893)['then'](function(_0x2163df){return[_0x2163df,!![]];});});}})[_0xbd3b('0x8d')](function(_0xbe38cd,_0x2e3cb3){if(_0xbe38cd){_0x469dc3=_0x2e3cb3;if(!_0x2e3cb3){var _0x114d0d={'from':(_0x4d0404[_0xbd3b('0x86')][_0xbd3b('0x87')]||'')+'\x20'+(_0x4d0404[_0xbd3b('0x86')][_0xbd3b('0x88')]||'')};if(_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x89')]&&_0x27e1ca['body']['messageId']&&_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x89')]!=_0x27e1ca['body'][_0xbd3b('0x8e')]){_0x114d0d[_0xbd3b('0x89')]=_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x8e')];}return _0xbe38cd[_0xbd3b('0x31')](_0x114d0d);}else{return _0xbe38cd;}}})[_0xbd3b('0x1e')](function(_0x3fb03b){_0x4d0404['interaction']=_0x3fb03b['get']({'plain':!![]});_0x4d0404[_0xbd3b('0x8f')][_0xbd3b('0x90')]=_0x469dc3;if(_0x4d0404[_0xbd3b('0x8f')][_0xbd3b('0x90')]){if(_0x4d0404[_0xbd3b('0x81')]['autoclose']){_0x4d0404['applications']['push']({'id':0x0,'priority':_0x4d0404[_0xbd3b('0x82')][_0xbd3b('0x48')]+0x1,'app':_0xbd3b('0x91'),'appdata':_0xbd3b('0x92'),'interval':_0xbd3b('0x93')});}}return db[_0xbd3b('0x94')][_0xbd3b('0x57')]({'body':_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x58')],'OpenchannelAccountId':_0x27e1ca[_0xbd3b('0x5e')]['id'],'OpenchannelInteractionId':_0x3fb03b['id'],'direction':'in','ContactId':_0x4d0404[_0xbd3b('0x86')]['id'],'AttachmentId':_0x27e1ca[_0xbd3b('0x58')][_0xbd3b('0x95')]});})[_0xbd3b('0x1e')](function(_0x12c498){_0x4d0404[_0xbd3b('0x27')]=_0x12c498;if(_0x4d0404[_0xbd3b('0x8f')][_0xbd3b('0x96')]){return db[_0xbd3b('0x97')][_0xbd3b('0x56')]({'attributes':['id','name'],'where':{'id':_0x4d0404['interaction'][_0xbd3b('0x96')]}})[_0xbd3b('0x1e')](function(_0x53f725){if(_0x53f725){_0x4d0404[_0xbd3b('0x82')][_0xbd3b('0x98')]({'id':0x0,'priority':0x0,'app':_0xbd3b('0x99'),'appdata':_0x53f725[_0xbd3b('0x38')]+','+(_0x4d0404['account'][_0xbd3b('0x9a')]||0xa),'interval':_0xbd3b('0x93')});_0x4d0404['forcedOwnership']=![];}return respondWithRpcPromise(_0xbd3b('0x9b'),_0xbd3b('0x9c'),_0x4d0404);});}return respondWithRpcPromise(_0xbd3b('0x9b'),_0xbd3b('0x9c'),_0x4d0404);})[_0xbd3b('0x1e')](function(_0x2d13b2){respondWithRpcPromise(_0xbd3b('0x9d'),_0xbd3b('0x9d'),{'event':'notify','message':_0x2d13b2},client9002);return _0x2d13b2;})[_0xbd3b('0x1e')](respondWithResult(_0x2de476,null))['catch'](handleError(_0x2de476,null));};exports[_0xbd3b('0x9e')]=function(_0x98d62,_0x59e3dc,_0x4d6236){return db[_0xbd3b('0x51')][_0xbd3b('0x62')]({'where':{'id':_0x98d62[_0xbd3b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x59e3dc,null))['then'](function(_0x75c899){if(_0x75c899){return db[_0xbd3b('0x9f')]['transaction'](function(_0x4bb3ed){return db['OpenchannelApplication'][_0xbd3b('0x32')]({'where':{'OpenchannelAccountId':_0x98d62['params']['id']},'transaction':_0x4bb3ed})[_0xbd3b('0x1e')](function(_0xb2ef06){var _0x198b42=_[_0xbd3b('0x3c')](_0x98d62['body'],function(_0x45fa21){_0x45fa21[_0xbd3b('0x65')]=_0x98d62[_0xbd3b('0x5e')]['id'];return _0x45fa21;});return db[_0xbd3b('0xa0')][_0xbd3b('0xa1')](_0x198b42,{'transaction':_0x4bb3ed});});})[_0xbd3b('0x1e')](function(){return db[_0xbd3b('0xa0')][_0xbd3b('0xa2')]({'where':{'OpenchannelAccountId':_0x98d62[_0xbd3b('0x5e')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x59e3dc,null))[_0xbd3b('0x54')](handleError(_0x59e3dc,null));};exports[_0xbd3b('0xa3')]=function(_0x6151e7,_0x3d10c9,_0x84da77){var _0x261087={};var _0x27b3cb={};var _0x3472a2;var _0x2c93aa;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x6151e7[_0xbd3b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3d10c9,null))[_0xbd3b('0x1e')](function(_0x43cf7b){if(_0x43cf7b){_0x3472a2=_0x43cf7b;_0x27b3cb['model']=_[_0xbd3b('0x43')](db[_0xbd3b('0xa0')][_0xbd3b('0x3d')]);_0x27b3cb[_0xbd3b('0x42')]=_['keys'](_0x6151e7[_0xbd3b('0x42')]);_0x27b3cb[_0xbd3b('0x44')]=_[_0xbd3b('0x45')](_0x27b3cb[_0xbd3b('0x41')],_0x27b3cb[_0xbd3b('0x42')]);_0x261087[_0xbd3b('0x46')]=_[_0xbd3b('0x45')](_0x27b3cb[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x6151e7[_0xbd3b('0x42')][_0xbd3b('0x47')]));_0x261087['attributes']=_0x261087[_0xbd3b('0x46')][_0xbd3b('0x48')]?_0x261087[_0xbd3b('0x46')]:_0x27b3cb[_0xbd3b('0x41')];_0x261087[_0xbd3b('0x4c')]=qs[_0xbd3b('0x63')](_0x6151e7[_0xbd3b('0x42')][_0xbd3b('0x63')]);_0x261087[_0xbd3b('0x4e')]=qs[_0xbd3b('0x44')](_['pick'](_0x6151e7[_0xbd3b('0x42')],_0x27b3cb[_0xbd3b('0x44')]));if(_0x6151e7[_0xbd3b('0x42')][_0xbd3b('0x50')]){_0x261087[_0xbd3b('0x4e')]=_[_0xbd3b('0x4d')](_0x261087[_0xbd3b('0x4e')],{'$or':_[_0xbd3b('0x3c')](_0x261087[_0xbd3b('0x46')],function(_0x384fb2){var _0x45efcb={};_0x45efcb[_0x384fb2]={'$like':'%'+_0x6151e7['query']['filter']+'%'};return _0x45efcb;})});}_0x261087=_[_0xbd3b('0x4d')]({},_0x261087,_0x6151e7['options']);return _0x3472a2[_0xbd3b('0xa3')](_0x261087);}})[_0xbd3b('0x1e')](function(_0x5bc590){if(_0x5bc590){_0x2c93aa=_0x5bc590['length'];if(!_0x6151e7[_0xbd3b('0x42')]['hasOwnProperty'](_0xbd3b('0x4a'))){_0x261087[_0xbd3b('0x4b')]=qs[_0xbd3b('0x4b')](_0x6151e7['query'][_0xbd3b('0x4b')]);_0x261087[_0xbd3b('0x2b')]=qs['offset'](_0x6151e7[_0xbd3b('0x42')][_0xbd3b('0x2b')]);}return _0x3472a2[_0xbd3b('0xa3')](_0x261087);}})['then'](function(_0xf6ffb2){if(_0xf6ffb2){return _0xf6ffb2?{'count':_0x2c93aa,'rows':_0xf6ffb2}:null;}})[_0xbd3b('0x1e')](respondWithResult(_0x3d10c9,null))[_0xbd3b('0x54')](handleError(_0x3d10c9,null));};exports['getInteractions']=function(_0x265229,_0x1a2b78,_0x32676e){var _0x8b1788={'raw':![],'where':{}};var _0xb5b431={};var _0x20b318={'count':0x0,'rows':[]};return db[_0xbd3b('0x51')][_0xbd3b('0x62')]({'where':{'id':_0x265229['params']['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x1a2b78,null))['then'](function(_0x2639f8){if(_0x2639f8){_0xb5b431[_0xbd3b('0x41')]=_['keys'](db[_0xbd3b('0x8a')][_0xbd3b('0x3d')]);_0xb5b431[_0xbd3b('0x42')]=_[_0xbd3b('0x43')](_0x265229[_0xbd3b('0x42')]);_0xb5b431[_0xbd3b('0x44')]=_[_0xbd3b('0x45')](_0xb5b431[_0xbd3b('0x41')],_0xb5b431[_0xbd3b('0x42')]);_0x8b1788['attributes']=_[_0xbd3b('0x45')](_0xb5b431[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x265229[_0xbd3b('0x42')]['fields']));_0x8b1788[_0xbd3b('0x46')]=_0x8b1788[_0xbd3b('0x46')][_0xbd3b('0x48')]?_0x8b1788['attributes']:_0xb5b431[_0xbd3b('0x41')];if(!_0x265229[_0xbd3b('0x42')][_0xbd3b('0x49')](_0xbd3b('0x4a'))){_0x8b1788[_0xbd3b('0x4b')]=qs[_0xbd3b('0x4b')](_0x265229[_0xbd3b('0x42')][_0xbd3b('0x4b')]);_0x8b1788['offset']=qs['offset'](_0x265229[_0xbd3b('0x42')]['offset']);}_0x8b1788[_0xbd3b('0x4c')]=qs[_0xbd3b('0x63')](_0x265229[_0xbd3b('0x42')][_0xbd3b('0x63')]);_0x8b1788[_0xbd3b('0x4e')]=qs[_0xbd3b('0x44')](_[_0xbd3b('0x64')](_0x265229[_0xbd3b('0x42')],_0xb5b431[_0xbd3b('0x44')]));_0x8b1788[_0xbd3b('0x4e')]['OpenchannelAccountId']=_0x2639f8['id'];if(_0x265229['query'][_0xbd3b('0x50')]){_0x8b1788['where']=_[_0xbd3b('0x4d')](_0x8b1788[_0xbd3b('0x4e')],{'$or':_[_0xbd3b('0x3c')](_0x8b1788[_0xbd3b('0x46')],function(_0x33ac2b){var _0x4e37d6={};_0x4e37d6[_0x33ac2b]={'$like':'%'+_0x265229[_0xbd3b('0x42')]['filter']+'%'};return _0x4e37d6;})});}_0x8b1788=_[_0xbd3b('0x4d')]({},_0x8b1788,_0x265229[_0xbd3b('0x6b')]);return db[_0xbd3b('0x8a')][_0xbd3b('0x2a')]({'where':_0x8b1788[_0xbd3b('0x4e')]})[_0xbd3b('0x1e')](function(_0x5b807d){_0x20b318[_0xbd3b('0x2a')]=_0x5b807d;if(_0x265229[_0xbd3b('0x42')][_0xbd3b('0x55')]){_0x8b1788[_0xbd3b('0x52')]=[{'model':db[_0xbd3b('0x7d')],'as':_0xbd3b('0xa4'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xbd3b('0x38'),_0xbd3b('0xa5'),_0xbd3b('0xa6')],'required':![]},{'model':db[_0xbd3b('0xa7')],'as':_0xbd3b('0xa8'),'attributes':['id',_0xbd3b('0x38'),_0xbd3b('0xa9')],'where':_0x265229[_0xbd3b('0x42')]['tag']?{'id':_0x265229['query'][_0xbd3b('0xaa')]}:undefined,'required':_0x265229[_0xbd3b('0x42')][_0xbd3b('0xaa')]?!![]:![]}];}return db[_0xbd3b('0x8a')][_0xbd3b('0x53')](_0x8b1788);})[_0xbd3b('0x1e')](function(_0x548b69){_0x20b318[_0xbd3b('0x66')]=_0x548b69;return _0x20b318;});}})[_0xbd3b('0x1e')](respondWithFilteredResult(_0x1a2b78,_0x8b1788))[_0xbd3b('0x54')](handleError(_0x1a2b78,null));};exports['addAgents']=function(_0x4fa60c,_0x535b6b,_0x262cc1){return db[_0xbd3b('0x51')]['find']({'where':{'id':_0x4fa60c[_0xbd3b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x535b6b,null))[_0xbd3b('0x1e')](function(_0x333658){if(_0x333658){return _0x333658[_0xbd3b('0xab')](_0x4fa60c[_0xbd3b('0x58')][_0xbd3b('0xac')],_[_0xbd3b('0xad')](_0x4fa60c[_0xbd3b('0x58')],[_0xbd3b('0xac'),'id'])||{})[_0xbd3b('0x8d')](function(_0xe006d0){for(var _0x2c29a7=0x0;_0x2c29a7<_0x4fa60c[_0xbd3b('0x58')][_0xbd3b('0xac')][_0xbd3b('0x48')];_0x2c29a7+=0x1){socket[_0xbd3b('0xae')](_0xbd3b('0xaf'),{'UserId':_0x4fa60c[_0xbd3b('0x58')][_0xbd3b('0xac')][_0x2c29a7],'OpenchannelAccountId':_0x4fa60c['params']['id']});}return _0xe006d0;});}})['then'](respondWithResult(_0x535b6b,null))['catch'](handleError(_0x535b6b,null));};exports[_0xbd3b('0xb0')]=function(_0x43eedb,_0x51f538,_0x1c1689){return db[_0xbd3b('0x51')][_0xbd3b('0x56')]({'where':{'id':_0x43eedb[_0xbd3b('0x5e')]['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x51f538,null))[_0xbd3b('0x1e')](function(_0x369b62){if(_0x369b62){return _0x369b62[_0xbd3b('0xb0')](_0x43eedb[_0xbd3b('0x42')][_0xbd3b('0xac')])[_0xbd3b('0x1e')](function(){if(_[_0xbd3b('0xb1')](_0x43eedb['query'][_0xbd3b('0xac')])){for(var _0x4eb0a3=0x0;_0x4eb0a3<_0x43eedb[_0xbd3b('0x42')][_0xbd3b('0xac')][_0xbd3b('0x48')];_0x4eb0a3+=0x1){socket[_0xbd3b('0xae')](_0xbd3b('0xb2'),{'UserId':Number(_0x43eedb['query'][_0xbd3b('0xac')][_0x4eb0a3]),'OpenchannelAccountId':Number(_0x43eedb[_0xbd3b('0x5e')]['id'])});}}else{socket[_0xbd3b('0xae')](_0xbd3b('0xb2'),{'UserId':Number(_0x43eedb[_0xbd3b('0x42')][_0xbd3b('0xac')]),'OpenchannelAccountId':Number(_0x43eedb[_0xbd3b('0x5e')]['id'])});}});}})[_0xbd3b('0x1e')](respondWithStatusCode(_0x51f538,null))[_0xbd3b('0x54')](handleError(_0x51f538,null));};exports['getAgents']=function(_0x1d108e,_0x52e855,_0x15b73b){var _0x46fd0f={};var _0x466369={};var _0x523259;var _0x253b1b;return db['OpenchannelAccount'][_0xbd3b('0x62')]({'where':{'id':_0x1d108e[_0xbd3b('0x5e')]['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0x52e855,null))[_0xbd3b('0x1e')](function(_0xf4100d){if(_0xf4100d){_0x523259=_0xf4100d;_0x466369[_0xbd3b('0x41')]=_[_0xbd3b('0x43')](db['User'][_0xbd3b('0x3d')]);_0x466369[_0xbd3b('0x42')]=_[_0xbd3b('0x43')](_0x1d108e[_0xbd3b('0x42')]);_0x466369['filters']=_['intersection'](_0x466369[_0xbd3b('0x41')],_0x466369[_0xbd3b('0x42')]);_0x46fd0f[_0xbd3b('0x46')]=_[_0xbd3b('0x45')](_0x466369[_0xbd3b('0x41')],qs[_0xbd3b('0x47')](_0x1d108e[_0xbd3b('0x42')][_0xbd3b('0x47')]));_0x46fd0f[_0xbd3b('0x46')]=_0x46fd0f[_0xbd3b('0x46')][_0xbd3b('0x48')]?_0x46fd0f[_0xbd3b('0x46')]:_0x466369[_0xbd3b('0x41')];_0x46fd0f['order']=qs[_0xbd3b('0x63')](_0x1d108e[_0xbd3b('0x42')][_0xbd3b('0x63')]);_0x46fd0f[_0xbd3b('0x4e')]=qs[_0xbd3b('0x44')](_['pick'](_0x1d108e[_0xbd3b('0x42')],_0x466369[_0xbd3b('0x44')]));if(_0x1d108e['query'][_0xbd3b('0x50')]){_0x46fd0f[_0xbd3b('0x4e')]=_['merge'](_0x46fd0f[_0xbd3b('0x4e')],{'$or':_[_0xbd3b('0x3c')](_0x46fd0f[_0xbd3b('0x46')],function(_0xea3622){var _0x126c5b={};_0x126c5b[_0xea3622]={'$like':'%'+_0x1d108e[_0xbd3b('0x42')][_0xbd3b('0x50')]+'%'};return _0x126c5b;})});}_0x46fd0f=_[_0xbd3b('0x4d')]({},_0x46fd0f,_0x1d108e[_0xbd3b('0x6b')]);return _0x523259[_0xbd3b('0xb3')](_0x46fd0f);}})['then'](function(_0x124d9f){if(_0x124d9f){_0x253b1b=_0x124d9f['length'];if(!_0x1d108e[_0xbd3b('0x42')]['hasOwnProperty'](_0xbd3b('0x4a'))){_0x46fd0f[_0xbd3b('0x4b')]=qs[_0xbd3b('0x4b')](_0x1d108e[_0xbd3b('0x42')][_0xbd3b('0x4b')]);_0x46fd0f[_0xbd3b('0x2b')]=qs[_0xbd3b('0x2b')](_0x1d108e[_0xbd3b('0x42')][_0xbd3b('0x2b')]);}return _0x523259[_0xbd3b('0xb3')](_0x46fd0f);}})[_0xbd3b('0x1e')](function(_0xb97d23){if(_0xb97d23){return _0xb97d23?{'count':_0x253b1b,'rows':_0xb97d23}:null;}})[_0xbd3b('0x1e')](respondWithResult(_0x52e855,null))[_0xbd3b('0x54')](handleError(_0x52e855,null));};exports['send']=function(_0x5ef1d3,_0xfbb53,_0x4f5120){var _0x3c60d9,_0x44ec24,_0x218b60;if(_[_0xbd3b('0x75')](_0x5ef1d3[_0xbd3b('0x58')]['body'])||_0x5ef1d3[_0xbd3b('0x58')][_0xbd3b('0x58')]===''){throw new db[(_0xbd3b('0x6f'))][(_0xbd3b('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbd3b('0x75')](_0x5ef1d3[_0xbd3b('0x58')]['to'])){}_0x3c60d9=_0x5ef1d3[_0xbd3b('0x58')]['to'];return db[_0xbd3b('0x51')][_0xbd3b('0x62')]({'where':{'id':_0x5ef1d3['params']['id']}})[_0xbd3b('0x1e')](handleEntityNotFound(_0xfbb53,null))[_0xbd3b('0x1e')](function(_0x136637){if(_0x136637){return db[_0xbd3b('0x51')][_0xbd3b('0x56')]({'where':{'id':_0x136637['id']},'include':[{'model':db[_0xbd3b('0xb4')],'as':_0xbd3b('0x7c'),'include':[{'model':db[_0xbd3b('0x7d')],'as':_0xbd3b('0x7e'),'where':{[_0x136637[_0xbd3b('0x7b')]]:_0x3c60d9},'limit':0x1,'order':[[_0xbd3b('0x73'),_0xbd3b('0x7f')]]}]}]})[_0xbd3b('0x1e')](handleEntityNotFound(_0xfbb53,null))['then'](function(_0x18421b){if(_0x18421b&&_0x18421b[_0xbd3b('0x7c')]){_0x44ec24=_0x18421b[_0xbd3b('0x33')]({'plain':!![]});if(_0x44ec24['List']&&_0x44ec24[_0xbd3b('0x7c')][_0xbd3b('0x7e')][_0xbd3b('0x48')]){return _0x44ec24[_0xbd3b('0x7c')][_0xbd3b('0x7e')][0x0];}return db[_0xbd3b('0x7d')][_0xbd3b('0x57')](_[_0xbd3b('0x15')](_0x5ef1d3[_0xbd3b('0x58')],{'firstName':_0x3c60d9,[_0x18421b[_0xbd3b('0x7b')]]:_0x3c60d9,'phone':_0x3c60d9,'ListId':_0x44ec24[_0xbd3b('0x74')]}));}})[_0xbd3b('0x1e')](handleEntityNotFound(_0xfbb53,null))['then'](function(_0x435bab){if(_0x435bab){_0x218b60=_0x435bab;return db[_0xbd3b('0x8a')][_0xbd3b('0x56')]({'where':{'ContactId':_0x218b60['id'],'closed':![],'OpenchannelAccountId':_0x44ec24['id']}})[_0xbd3b('0x1e')](function(_0x3fc09f){if(_0x3fc09f){return[_0x3fc09f,![]];}return db[_0xbd3b('0x8a')][_0xbd3b('0x57')]({'UserId':_0x5ef1d3[_0xbd3b('0x59')]['id'],'ContactId':_0x218b60['id'],'OpenchannelAccountId':_0x44ec24['id'],'lastMsgDirection':_0xbd3b('0xb5'),'Messages':[_[_0xbd3b('0x4d')](_0x5ef1d3[_0xbd3b('0x58')],{'read':![],'body':_0x5ef1d3['body']['body'],'OpenchannelAccountId':_0x44ec24['id'],'UserId':_0x5ef1d3['user']['id'],'ContactId':_0x218b60['id']})]},{'include':[{'model':db[_0xbd3b('0x94')],'as':_0xbd3b('0xb6')}]})[_0xbd3b('0x1e')](function(_0x45f308){return[_0x45f308,!![]];});});}})['spread'](function(_0x240951,_0x5b307e){if(_0x5b307e){return _0x240951;}return db[_0xbd3b('0x94')][_0xbd3b('0x57')](_[_0xbd3b('0x4d')](_0x5ef1d3[_0xbd3b('0x58')],{'read':![],'body':_0x5ef1d3['body'][_0xbd3b('0x58')],'OpenchannelAccountId':_0x44ec24['id'],'OpenchannelInteractionId':_0x240951['id'],'UserId':_0x5ef1d3[_0xbd3b('0x59')]['id'],'ContactId':_0x218b60['id']}))[_0xbd3b('0x1e')](function(_0xe5755a){_0x240951[_0xbd3b('0xb7')][_0xbd3b('0xb6')]=[];_0x240951['dataValues']['Messages']['push'](_0xe5755a['dataValues']);return _0x240951;});});}})[_0xbd3b('0x1e')](respondWithResult(_0xfbb53,null))[_0xbd3b('0x54')](handleError(_0xfbb53,null));}; \ No newline at end of file +var _0x09bf=['merge','VIRTUAL','options','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','autoAssociation','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','rawAttributes','OpenchannelAccountId','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','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','from','CmList','List','Contacts','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','send','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter'];(function(_0x238157,_0x241ec3){var _0x17786b=function(_0x310005){while(--_0x310005){_0x238157['push'](_0x238157['shift']());}};_0x17786b(++_0x241ec3);}(_0x09bf,0x128));var _0xf09b=function(_0x39db05,_0x3868d0){_0x39db05=_0x39db05-0x0;var _0x3f0e22=_0x09bf[_0x39db05];return _0x3f0e22;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf09b('0x0'));var rimraf=require(_0xf09b('0x1'));var zipdir=require(_0xf09b('0x2'));var jsonpatch=require(_0xf09b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf09b('0x4'));var Mustache=require(_0xf09b('0x5'));var util=require(_0xf09b('0x6'));var path=require('path');var sox=require(_0xf09b('0x7'));var csv=require(_0xf09b('0x8'));var ejs=require(_0xf09b('0x9'));var fs=require('fs');var _=require(_0xf09b('0xa'));var squel=require('squel');var crypto=require(_0xf09b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf09b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf09b('0xd'));var Papa=require('papaparse');var Redis=require(_0xf09b('0xe'));var authService=require(_0xf09b('0xf'));var qs=require(_0xf09b('0x10'));var as=require(_0xf09b('0x11'));var hardwareService=require(_0xf09b('0x12'));var logger=require(_0xf09b('0x13'))(_0xf09b('0x14'));var utils=require(_0xf09b('0x15'));var config=require(_0xf09b('0x16'));var db=require(_0xf09b('0x17'))['db'];config[_0xf09b('0x18')]=_[_0xf09b('0x19')](config[_0xf09b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf09b('0x1a'))(new Redis(config[_0xf09b('0x18')]));require(_0xf09b('0x1b'))[_0xf09b('0x1c')](socket);var jayson=require(_0xf09b('0x1d'));var client=jayson[_0xf09b('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf09b('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x199d7a,_0x26f86,_0x55c8a3){if(_0x55c8a3){var _0x114d4c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x114d4c[_0xf09b('0x20')](_0x26f86)){return _0x199d7a;}else{throw new db['Sequelize'][(_0xf09b('0x21'))](_0xf09b('0x22'));}}else{return _0x199d7a;}}function respondWithRpcPromise(_0x4f30fa,_0x39024d,_0x5743c0,_0x33a80c){return new BPromise(function(_0x41dc6e,_0x5359ab){var _0x2bbb3c=_0x33a80c||client;return _0x2bbb3c['request'](_0x4f30fa,_0x5743c0)[_0xf09b('0x23')](function(_0x38bdbd){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x39024d,'request\x20sent');logger[_0xf09b('0x24')](_0xf09b('0x25'),_0x39024d,_0xf09b('0x26'),JSON[_0xf09b('0x27')](_0x38bdbd));if(_0x38bdbd[_0xf09b('0x28')]){if(_0x38bdbd[_0xf09b('0x28')][_0xf09b('0x29')]===0x1f4){logger[_0xf09b('0x28')](_0xf09b('0x2a'),_0x39024d,_0x38bdbd[_0xf09b('0x28')][_0xf09b('0x2b')]);return _0x5359ab(_0x38bdbd['error']['message']);}logger[_0xf09b('0x28')](_0xf09b('0x2a'),_0x39024d,_0x38bdbd['error']['message']);return _0x41dc6e(_0x38bdbd['error'][_0xf09b('0x2b')]);}else{logger[_0xf09b('0x2c')](_0xf09b('0x2a'),_0x39024d,_0xf09b('0x26'));_0x41dc6e(_0x38bdbd[_0xf09b('0x2d')][_0xf09b('0x2b')]);}})[_0xf09b('0x2e')](function(_0x346274){logger['error'](_0xf09b('0x2a'),_0x39024d,_0x346274);_0x5359ab(_0x346274);});});}function respondWithStatusCode(_0x212f8d,_0x1e1883){_0x1e1883=_0x1e1883||0xcc;return function(_0x3963d7){if(_0x3963d7){return _0x212f8d[_0xf09b('0x2f')](_0x1e1883);}return _0x212f8d[_0xf09b('0x30')](_0x1e1883)[_0xf09b('0x31')]();};}function respondWithResult(_0x2b8697,_0x2029f7){_0x2029f7=_0x2029f7||0xc8;return function(_0x92c76f){if(_0x92c76f){return _0x2b8697[_0xf09b('0x30')](_0x2029f7)[_0xf09b('0x32')](_0x92c76f);}};}function respondWithFilteredResult(_0x357fb4,_0x52f4e8){return function(_0x3269ae){if(_0x3269ae){var _0x270019=_0x3269ae[_0xf09b('0x33')],_0x2de7e0=_0x52f4e8[_0xf09b('0x34')],_0x1d640f=_0x52f4e8[_0xf09b('0x34')]+_0x52f4e8['limit'],_0x43bfb8;if(_0x1d640f>=_0x270019){_0x1d640f=_0x270019;_0x43bfb8=0xc8;}else{_0x43bfb8=0xce;}_0x357fb4[_0xf09b('0x30')](_0x43bfb8);return _0x357fb4[_0xf09b('0x35')](_0xf09b('0x36'),_0x2de7e0+'-'+_0x1d640f+'/'+_0x270019)[_0xf09b('0x32')](_0x3269ae);}return null;};}function patchUpdates(_0x29c2ab){return function(_0x214eff){try{jsonpatch[_0xf09b('0x37')](_0x214eff,_0x29c2ab,!![]);}catch(_0x5c448d){return BPromise[_0xf09b('0x38')](_0x5c448d);}return _0x214eff[_0xf09b('0x39')]();};}function saveUpdates(_0xc2890c,_0x36e768){return function(_0x481908){if(_0x481908){return _0x481908[_0xf09b('0x3a')](_0xc2890c)[_0xf09b('0x23')](function(_0x160662){return _0x160662;});}return null;};}function removeEntity(_0x3cf125,_0x3ff97e){return function(_0x55f318){if(_0x55f318){return _0x55f318[_0xf09b('0x3b')]()['then'](function(){var _0x11c9a9=_0x55f318[_0xf09b('0x3c')]({'plain':!![]});var _0x1f959f='OpenchannelAccounts';return db[_0xf09b('0x3d')]['destroy']({'where':{'type':_0x1f959f,'resourceId':_0x11c9a9['id']}})['then'](function(){return _0x55f318;});})[_0xf09b('0x23')](function(){_0x3cf125['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53bef6,_0x45c807){return function(_0x11cbb0){if(!_0x11cbb0){_0x53bef6[_0xf09b('0x2f')](0x194);}return _0x11cbb0;};}function handleError(_0x4b9523,_0x585e5a){_0x585e5a=_0x585e5a||0x1f4;return function(_0x156a67){logger[_0xf09b('0x28')](_0x156a67['stack']);if(_0x156a67[_0xf09b('0x3e')]){delete _0x156a67[_0xf09b('0x3e')];}_0x4b9523['status'](_0x585e5a)['send'](_0x156a67);};}exports[_0xf09b('0x3f')]=function(_0x3714ae,_0x5d440c){var _0x313902={'include':[{'model':db[_0xf09b('0x40')],'as':_0xf09b('0x41')}]},_0x10cc0e={},_0x1b2f5d={'count':0x0,'rows':[]};var _0x10d2b4=_['map'](db[_0xf09b('0x42')]['rawAttributes'],function(_0x575403){return{'name':_0x575403[_0xf09b('0x43')],'type':_0x575403[_0xf09b('0x44')][_0xf09b('0x45')]};});_0x10cc0e[_0xf09b('0x46')]=_[_0xf09b('0x47')](_0x10d2b4,'name');_0x10cc0e[_0xf09b('0x48')]=_[_0xf09b('0x49')](_0x3714ae[_0xf09b('0x48')]);_0x10cc0e[_0xf09b('0x4a')]=_[_0xf09b('0x4b')](_0x10cc0e[_0xf09b('0x46')],_0x10cc0e[_0xf09b('0x48')]);_0x313902[_0xf09b('0x4c')]=_[_0xf09b('0x4b')](_0x10cc0e[_0xf09b('0x46')],qs[_0xf09b('0x4d')](_0x3714ae['query']['fields']));_0x313902[_0xf09b('0x4c')]=_0x313902[_0xf09b('0x4c')][_0xf09b('0x4e')]?_0x313902[_0xf09b('0x4c')]:_0x10cc0e['model'];if(!_0x3714ae[_0xf09b('0x48')]['hasOwnProperty'](_0xf09b('0x4f'))){_0x313902[_0xf09b('0x50')]=qs['limit'](_0x3714ae['query']['limit']);_0x313902[_0xf09b('0x34')]=qs['offset'](_0x3714ae[_0xf09b('0x48')][_0xf09b('0x34')]);}_0x313902[_0xf09b('0x51')]=qs[_0xf09b('0x52')](_0x3714ae[_0xf09b('0x48')][_0xf09b('0x52')]);_0x313902[_0xf09b('0x53')]=qs['filters'](_[_0xf09b('0x54')](_0x3714ae['query'],_0x10cc0e[_0xf09b('0x4a')]));if(_0x3714ae[_0xf09b('0x48')][_0xf09b('0x55')]){_0x313902[_0xf09b('0x53')]=_[_0xf09b('0x56')](_0x313902[_0xf09b('0x53')],{'$or':_[_0xf09b('0x47')](_0x10d2b4,function(_0x12ad7e){if(_0x12ad7e[_0xf09b('0x44')]!==_0xf09b('0x57')){var _0x27b1bc={};_0x27b1bc[_0x12ad7e['name']]={'$like':'%'+_0x3714ae[_0xf09b('0x48')][_0xf09b('0x55')]+'%'};return _0x27b1bc;}})});}_0x313902=_[_0xf09b('0x56')]({},_0x313902,_0x3714ae[_0xf09b('0x58')]);var _0x1622d2={'where':_0x313902['where']};return db[_0xf09b('0x42')]['count'](_0x1622d2)[_0xf09b('0x23')](function(_0x39fe79){_0x1b2f5d[_0xf09b('0x33')]=_0x39fe79;if(_0x3714ae['query']['includeAll']){_0x313902['include']=[{'all':!![]}];}return db[_0xf09b('0x42')]['findAll'](_0x313902);})[_0xf09b('0x23')](function(_0x48b94d){_0x1b2f5d['rows']=_0x48b94d;return _0x1b2f5d;})['then'](respondWithFilteredResult(_0x5d440c,_0x313902))['catch'](handleError(_0x5d440c,null));};exports[_0xf09b('0x59')]=function(_0x4b4ec9,_0x23a774){var _0x565ea7={'raw':![],'where':{'id':_0x4b4ec9[_0xf09b('0x5a')]['id']},'include':[{'model':db[_0xf09b('0x40')],'as':'mandatoryDispositionPause'}]},_0x332eef={};_0x332eef[_0xf09b('0x46')]=_[_0xf09b('0x49')](db['OpenchannelAccount']['rawAttributes']);_0x332eef[_0xf09b('0x48')]=_[_0xf09b('0x49')](_0x4b4ec9[_0xf09b('0x48')]);_0x332eef[_0xf09b('0x4a')]=_['intersection'](_0x332eef[_0xf09b('0x46')],_0x332eef[_0xf09b('0x48')]);_0x565ea7['attributes']=_[_0xf09b('0x4b')](_0x332eef[_0xf09b('0x46')],qs[_0xf09b('0x4d')](_0x4b4ec9['query'][_0xf09b('0x4d')]));_0x565ea7['attributes']=_0x565ea7[_0xf09b('0x4c')][_0xf09b('0x4e')]?_0x565ea7[_0xf09b('0x4c')]:_0x332eef[_0xf09b('0x46')];if(_0x4b4ec9[_0xf09b('0x48')][_0xf09b('0x5b')]){_0x565ea7[_0xf09b('0x5c')]=[{'all':!![]}];}_0x565ea7=_[_0xf09b('0x56')]({},_0x565ea7,_0x4b4ec9[_0xf09b('0x58')]);return db[_0xf09b('0x42')][_0xf09b('0x5d')](_0x565ea7)[_0xf09b('0x23')](handleEntityNotFound(_0x23a774,null))[_0xf09b('0x23')](respondWithResult(_0x23a774,null))[_0xf09b('0x2e')](handleError(_0x23a774,null));};exports[_0xf09b('0x5e')]=function(_0x10cf20,_0x68e2b1){return db[_0xf09b('0x42')][_0xf09b('0x5e')](_0x10cf20[_0xf09b('0x5f')],{})[_0xf09b('0x23')](function(_0x455ec0){var _0x80a29d=_0x10cf20[_0xf09b('0x60')]['get']({'plain':!![]});if(!_0x80a29d)throw new Error(_0xf09b('0x61'));if(_0x80a29d['role']===_0xf09b('0x60')){var _0x1452a6=_0x455ec0[_0xf09b('0x3c')]({'plain':!![]});var _0x5332ae=_0xf09b('0x62');return db[_0xf09b('0x63')][_0xf09b('0x5d')]({'where':{'name':_0x5332ae,'userProfileId':_0x80a29d['userProfileId']},'raw':!![]})[_0xf09b('0x23')](function(_0x467b6d){if(_0x467b6d&&_0x467b6d[_0xf09b('0x64')]===0x0){return db['UserProfileResource'][_0xf09b('0x5e')]({'name':_0x1452a6[_0xf09b('0x3e')],'resourceId':_0x1452a6['id'],'type':_0x467b6d[_0xf09b('0x3e')],'sectionId':_0x467b6d['id']},{})[_0xf09b('0x23')](function(){return _0x455ec0;});}else{return _0x455ec0;}})[_0xf09b('0x2e')](function(_0x3ecef6){logger[_0xf09b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ecef6);throw _0x3ecef6;});}return _0x455ec0;})['then'](respondWithResult(_0x68e2b1,0xc9))['catch'](handleError(_0x68e2b1,null));};exports[_0xf09b('0x3a')]=function(_0x1c433b,_0x4b49b7){if(_0x1c433b['body']['id']){delete _0x1c433b[_0xf09b('0x5f')]['id'];}return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x1c433b[_0xf09b('0x5a')]['id']},'include':[{'model':db[_0xf09b('0x40')],'as':_0xf09b('0x41')}]})[_0xf09b('0x23')](handleEntityNotFound(_0x4b49b7,null))[_0xf09b('0x23')](saveUpdates(_0x1c433b['body'],null))[_0xf09b('0x23')](respondWithResult(_0x4b49b7,null))[_0xf09b('0x2e')](handleError(_0x4b49b7,null));};exports['destroy']=function(_0x176514,_0x7f021a){return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x176514[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x7f021a,null))[_0xf09b('0x23')](removeEntity(_0x7f021a,null))[_0xf09b('0x2e')](handleError(_0x7f021a,null));};exports[_0xf09b('0x65')]=function(_0x2240b4,_0x48aaf9){return db['OpenchannelAccount'][_0xf09b('0x65')]()[_0xf09b('0x23')](respondWithResult(_0x48aaf9,null))['catch'](handleError(_0x48aaf9,null));};exports[_0xf09b('0x66')]=function(_0x10fae0,_0x231e2c,_0x582968){if(_0x10fae0[_0xf09b('0x5f')]['id']){delete _0x10fae0[_0xf09b('0x5f')]['id'];}return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x10fae0[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x231e2c,null))['then'](function(_0x30c39a){if(_0x30c39a){_0x10fae0['body'][_0xf09b('0x67')]=_0x30c39a['id'];return db[_0xf09b('0x68')]['create'](_0x10fae0[_0xf09b('0x5f')]);}})['then'](respondWithResult(_0x231e2c,null))[_0xf09b('0x2e')](handleError(_0x231e2c,null));};exports[_0xf09b('0x69')]=function(_0x5123ec,_0x29385b,_0x20ed0d){var _0x35bbf1={'raw':![],'where':{}};var _0x42c235={};var _0xba3f89={'count':0x0,'rows':[]};return db[_0xf09b('0x42')]['findOne']({'where':{'id':_0x5123ec[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x29385b,null))[_0xf09b('0x23')](function(_0x569620){if(_0x569620){_0x42c235[_0xf09b('0x46')]=_[_0xf09b('0x49')](db[_0xf09b('0x68')][_0xf09b('0x6a')]);_0x42c235[_0xf09b('0x48')]=_[_0xf09b('0x49')](_0x5123ec['query']);_0x42c235['filters']=_[_0xf09b('0x4b')](_0x42c235[_0xf09b('0x46')],_0x42c235[_0xf09b('0x48')]);_0x35bbf1['attributes']=_[_0xf09b('0x4b')](_0x42c235[_0xf09b('0x46')],qs[_0xf09b('0x4d')](_0x5123ec[_0xf09b('0x48')]['fields']));_0x35bbf1['attributes']=_0x35bbf1['attributes'][_0xf09b('0x4e')]?_0x35bbf1['attributes']:_0x42c235['model'];if(!_0x5123ec[_0xf09b('0x48')]['hasOwnProperty'](_0xf09b('0x4f'))){_0x35bbf1[_0xf09b('0x50')]=qs[_0xf09b('0x50')](_0x5123ec[_0xf09b('0x48')][_0xf09b('0x50')]);_0x35bbf1[_0xf09b('0x34')]=qs[_0xf09b('0x34')](_0x5123ec['query']['offset']);}_0x35bbf1[_0xf09b('0x51')]=qs[_0xf09b('0x52')](_0x5123ec[_0xf09b('0x48')][_0xf09b('0x52')]);_0x35bbf1['where']=qs[_0xf09b('0x4a')](_[_0xf09b('0x54')](_0x5123ec[_0xf09b('0x48')],_0x42c235[_0xf09b('0x4a')]));_0x35bbf1['where'][_0xf09b('0x6b')]=_0x569620['id'];if(_0x5123ec[_0xf09b('0x48')][_0xf09b('0x55')]){_0x35bbf1[_0xf09b('0x53')]=_[_0xf09b('0x56')](_0x35bbf1[_0xf09b('0x53')],{'$or':_[_0xf09b('0x47')](_0x35bbf1['attributes'],function(_0x191621){var _0x5cb082={};_0x5cb082[_0x191621]={'$like':'%'+_0x5123ec[_0xf09b('0x48')]['filter']+'%'};return _0x5cb082;})});}_0x35bbf1=_[_0xf09b('0x56')]({},_0x35bbf1,_0x5123ec[_0xf09b('0x58')]);return db[_0xf09b('0x68')][_0xf09b('0x33')]({'where':_0x35bbf1[_0xf09b('0x53')]})[_0xf09b('0x23')](function(_0x376cfd){_0xba3f89[_0xf09b('0x33')]=_0x376cfd;if(_0x5123ec[_0xf09b('0x48')][_0xf09b('0x5b')]){_0x35bbf1[_0xf09b('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0xf09b('0x6c')](_0x35bbf1);})[_0xf09b('0x23')](function(_0x116803){_0xba3f89[_0xf09b('0x6d')]=_0x116803;return _0xba3f89;});}})[_0xf09b('0x23')](respondWithFilteredResult(_0x29385b,_0x35bbf1))[_0xf09b('0x2e')](handleError(_0x29385b,null));};exports[_0xf09b('0x6e')]=function(_0x2ce87f,_0x556095,_0x53da5f){return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x2ce87f[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x556095,null))[_0xf09b('0x23')](function(_0x5eea7f){if(_0x5eea7f){return _0x5eea7f['removeDispositions'](_0x2ce87f[_0xf09b('0x48')][_0xf09b('0x6f')]);}})['then'](respondWithStatusCode(_0x556095,null))[_0xf09b('0x2e')](handleError(_0x556095,null));};exports[_0xf09b('0x70')]=function(_0x119e29,_0x56992e,_0x5be090){if(_0x119e29[_0xf09b('0x5f')]['id']){delete _0x119e29[_0xf09b('0x5f')]['id'];}return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x119e29[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x56992e,null))[_0xf09b('0x23')](function(_0xa40843){if(_0xa40843){_0x119e29[_0xf09b('0x5f')][_0xf09b('0x6b')]=_0xa40843['id'];return db[_0xf09b('0x71')][_0xf09b('0x5e')](_0x119e29[_0xf09b('0x5f')]);}})[_0xf09b('0x23')](respondWithResult(_0x56992e,null))[_0xf09b('0x2e')](handleError(_0x56992e,null));};exports[_0xf09b('0x72')]=function(_0xb0f68,_0xd6e725,_0x2a01fb){var _0x3c1c80={'raw':![],'where':{}};var _0xc9ec5={};var _0x375b1e={'count':0x0,'rows':[]};return db[_0xf09b('0x42')][_0xf09b('0x73')]({'where':{'id':_0xb0f68['params']['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0xd6e725,null))[_0xf09b('0x23')](function(_0x1b62e2){if(_0x1b62e2){_0xc9ec5[_0xf09b('0x46')]=_[_0xf09b('0x49')](db[_0xf09b('0x71')][_0xf09b('0x6a')]);_0xc9ec5[_0xf09b('0x48')]=_[_0xf09b('0x49')](_0xb0f68[_0xf09b('0x48')]);_0xc9ec5['filters']=_[_0xf09b('0x4b')](_0xc9ec5['model'],_0xc9ec5[_0xf09b('0x48')]);_0x3c1c80[_0xf09b('0x4c')]=_[_0xf09b('0x4b')](_0xc9ec5['model'],qs[_0xf09b('0x4d')](_0xb0f68[_0xf09b('0x48')][_0xf09b('0x4d')]));_0x3c1c80[_0xf09b('0x4c')]=_0x3c1c80[_0xf09b('0x4c')][_0xf09b('0x4e')]?_0x3c1c80[_0xf09b('0x4c')]:_0xc9ec5[_0xf09b('0x46')];if(!_0xb0f68[_0xf09b('0x48')][_0xf09b('0x74')](_0xf09b('0x4f'))){_0x3c1c80[_0xf09b('0x50')]=qs[_0xf09b('0x50')](_0xb0f68[_0xf09b('0x48')][_0xf09b('0x50')]);_0x3c1c80[_0xf09b('0x34')]=qs[_0xf09b('0x34')](_0xb0f68[_0xf09b('0x48')][_0xf09b('0x34')]);}_0x3c1c80['order']=qs[_0xf09b('0x52')](_0xb0f68[_0xf09b('0x48')]['sort']);_0x3c1c80[_0xf09b('0x53')]=qs[_0xf09b('0x4a')](_['pick'](_0xb0f68[_0xf09b('0x48')],_0xc9ec5[_0xf09b('0x4a')]));_0x3c1c80['where'][_0xf09b('0x6b')]=_0x1b62e2['id'];if(_0xb0f68[_0xf09b('0x48')]['filter']){_0x3c1c80['where']=_['merge'](_0x3c1c80[_0xf09b('0x53')],{'$or':_['map'](_0x3c1c80['attributes'],function(_0xcd867a){var _0x29293f={};_0x29293f[_0xcd867a]={'$like':'%'+_0xb0f68['query']['filter']+'%'};return _0x29293f;})});}_0x3c1c80=_['merge']({},_0x3c1c80,_0xb0f68[_0xf09b('0x58')]);return db[_0xf09b('0x71')][_0xf09b('0x33')]({'where':_0x3c1c80[_0xf09b('0x53')]})[_0xf09b('0x23')](function(_0x18e390){_0x375b1e[_0xf09b('0x33')]=_0x18e390;if(_0xb0f68[_0xf09b('0x48')][_0xf09b('0x5b')]){_0x3c1c80['include']=[{'all':!![]}];}return db[_0xf09b('0x71')][_0xf09b('0x6c')](_0x3c1c80);})[_0xf09b('0x23')](function(_0x513e46){_0x375b1e[_0xf09b('0x6d')]=_0x513e46;return _0x375b1e;});}})[_0xf09b('0x23')](respondWithFilteredResult(_0xd6e725,_0x3c1c80))[_0xf09b('0x2e')](handleError(_0xd6e725,null));};exports[_0xf09b('0x75')]=function(_0x22ac97,_0x38851c,_0x7262d1){return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x22ac97[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x38851c,null))[_0xf09b('0x23')](function(_0x56268f){if(_0x56268f){return _0x56268f[_0xf09b('0x75')](_0x22ac97[_0xf09b('0x48')]['ids']);}})[_0xf09b('0x23')](respondWithStatusCode(_0x38851c,null))[_0xf09b('0x2e')](handleError(_0x38851c,null));};exports[_0xf09b('0x76')]=function(_0x2a74a3,_0x38a1ca,_0x319ede){var _0x30ff25={'body':_0x2a74a3[_0xf09b('0x5f')],'channel':'openchannel'};var _0xc2e975=[];var _0x12653f=[];var _0x7656a8={};var _0x4ef95f=![];return db[_0xf09b('0x77')][_0xf09b('0x65')]()['then'](function(_0xc3b436){if(!_0xc3b436){throw new db[(_0xf09b('0x78'))][(_0xf09b('0x21'))](_0xf09b('0x79'));}_0xc2e975=_[_0xf09b('0x7a')](_[_0xf09b('0x49')](_0xc3b436),[_0xf09b('0x7b'),_0xf09b('0x7c')]);_0x12653f=_[_0xf09b('0x7a')](_[_0xf09b('0x49')](_0xc3b436),[_0xf09b('0x7b'),_0xf09b('0x7c'),'CompanyId',_0xf09b('0x7d')]);if(_0x2a74a3['body']['id']){delete _0x2a74a3[_0xf09b('0x5f')]['id'];}if(_[_0xf09b('0x7e')](_0x2a74a3[_0xf09b('0x5f')]['from'])){throw new db[(_0xf09b('0x78'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xf09b('0x7e')](_0x2a74a3['body'][_0xf09b('0x5f')])||_0x2a74a3['body'][_0xf09b('0x5f')]===''){throw new db[(_0xf09b('0x78'))][(_0xf09b('0x21'))](_0xf09b('0x7f'));}if(_[_0xf09b('0x7e')](_0x2a74a3['body'][_0xf09b('0x80')])){throw new db[(_0xf09b('0x78'))]['ValidationError'](_0xf09b('0x81')+_0x12653f);}if(!_[_0xf09b('0x82')](_0x12653f,_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x80')])){throw new db[(_0xf09b('0x78'))][(_0xf09b('0x21'))](_0xf09b('0x83')+_0x12653f);}_0x7656a8[_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x80')]]=_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x84')];})[_0xf09b('0x23')](function(){return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x2a74a3[_0xf09b('0x5a')]['id']},'include':[{'model':db[_0xf09b('0x85')],'as':_0xf09b('0x86'),'include':[{'model':db['CmContact'],'as':_0xf09b('0x87'),'where':_0x7656a8,'limit':0x1,'order':[[_0xf09b('0x7c'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xf09b('0x88')}]});})[_0xf09b('0x23')](handleEntityNotFound(_0x38a1ca,null))['then'](function(_0x4d2c18){if(_0x4d2c18&&_0x4d2c18[_0xf09b('0x86')]){_0x30ff25[_0xf09b('0x89')]=_0x4d2c18;_0x30ff25[_0xf09b('0x8a')]=_0x4d2c18[_0xf09b('0x88')];_0x30ff25[_0xf09b('0x8b')]=_0x4d2c18[_0xf09b('0x86')];_0x30ff25[_0xf09b('0x8a')]=_[_0xf09b('0x8c')](_0x30ff25[_0xf09b('0x8a')],[_0xf09b('0x8d')],[_0xf09b('0x8e')]);if(_0x30ff25[_0xf09b('0x89')][_0xf09b('0x88')]){delete _0x30ff25[_0xf09b('0x89')][_0xf09b('0x88')];}if(_0x30ff25[_0xf09b('0x89')][_0xf09b('0x86')]&&_0x30ff25['account'][_0xf09b('0x86')]['Contacts'][_0xf09b('0x4e')]){return _0x30ff25[_0xf09b('0x89')]['List']['Contacts'][0x0];}var _0x178a01=_['defaults'](_0x2a74a3['body'],{'firstName':_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x84')],'ListId':_0x4d2c18['ListId']});_0x178a01[_0x2a74a3[_0xf09b('0x5f')]['mapKey']]=_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x84')];return db[_0xf09b('0x77')][_0xf09b('0x5e')](_0x178a01,{'fields':_0xc2e975,'raw':!![]});}})[_0xf09b('0x23')](handleEntityNotFound(_0x38a1ca,null))[_0xf09b('0x23')](function(_0xdfac34){_0x30ff25[_0xf09b('0x8f')]=_0xdfac34;if(_0xdfac34){var _0x4c58fc={'ContactId':_0xdfac34['id'],'OpenchannelAccountId':_0x2a74a3[_0xf09b('0x5a')]['id'],'from':(_0xdfac34[_0xf09b('0x90')]||'')+'\x20'+(_0xdfac34[_0xf09b('0x91')]||'')};var _0x318452={'OpenchannelAccountId':_0x2a74a3[_0xf09b('0x5a')]['id'],'closed':![]};if(_0x2a74a3['body'][_0xf09b('0x92')]){_0x318452[_0xf09b('0x92')]=_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x92')];return db[_0xf09b('0x93')][_0xf09b('0x5d')]({'where':_0x318452})['then'](function(_0x50728a){if(_0x50728a){return[_0x50728a,![]];}_0x4c58fc[_0xf09b('0x92')]=_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x92')];_0x4c58fc[_0xf09b('0x94')]=_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x94')];return db[_0xf09b('0x93')][_0xf09b('0x5e')](_0x4c58fc)[_0xf09b('0x23')](function(_0x2da253){return[_0x2da253,!![]];});});}else{_0x318452[_0xf09b('0x92')]=null;}_0x318452['ContactId']=_0xdfac34['id'];return db['OpenchannelInteraction']['find']({'where':_0x318452})[_0xf09b('0x23')](function(_0x4a31a6){if(_0x4a31a6){return[_0x4a31a6,![]];}return db[_0xf09b('0x93')][_0xf09b('0x5e')](_0x4c58fc)[_0xf09b('0x23')](function(_0x2294e0){return[_0x2294e0,!![]];});});}})[_0xf09b('0x95')](function(_0x5abad3,_0x166d7d){if(_0x5abad3){_0x4ef95f=_0x166d7d;if(!_0x166d7d){var _0x9f2ce4={'from':(_0x30ff25['contact']['firstName']||'')+'\x20'+(_0x30ff25[_0xf09b('0x8f')]['lastName']||'')};if(_0x2a74a3['body'][_0xf09b('0x92')]&&_0x2a74a3[_0xf09b('0x5f')]['messageId']&&_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x92')]!=_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x96')]){_0x9f2ce4[_0xf09b('0x92')]=_0x2a74a3['body'][_0xf09b('0x96')];}return _0x5abad3[_0xf09b('0x3a')](_0x9f2ce4);}else{return _0x5abad3;}}})[_0xf09b('0x23')](function(_0x59e996){_0x30ff25[_0xf09b('0x97')]=_0x59e996[_0xf09b('0x3c')]({'plain':!![]});_0x30ff25[_0xf09b('0x97')]['created']=_0x4ef95f;if(_0x30ff25[_0xf09b('0x97')][_0xf09b('0x98')]){if(_0x30ff25[_0xf09b('0x89')][_0xf09b('0x99')]){_0x30ff25['applications'][_0xf09b('0x9a')]({'id':0x0,'priority':_0x30ff25[_0xf09b('0x8a')][_0xf09b('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xf09b('0x9b')});}}return db[_0xf09b('0x9c')]['create']({'body':_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x5f')],'OpenchannelAccountId':_0x2a74a3[_0xf09b('0x5a')]['id'],'OpenchannelInteractionId':_0x59e996['id'],'direction':'in','ContactId':_0x30ff25[_0xf09b('0x8f')]['id'],'AttachmentId':_0x2a74a3[_0xf09b('0x5f')][_0xf09b('0x9d')]});})[_0xf09b('0x23')](function(_0x5628ed){_0x30ff25['message']=_0x5628ed;if(_0x30ff25[_0xf09b('0x97')]['UserId']){return db[_0xf09b('0x9e')][_0xf09b('0x5d')]({'attributes':['id',_0xf09b('0x3e')],'where':{'id':_0x30ff25['interaction'][_0xf09b('0x9f')]}})[_0xf09b('0x23')](function(_0x2c7459){if(_0x2c7459){_0x30ff25['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf09b('0xa0'),'appdata':_0x2c7459['name']+','+(_0x30ff25[_0xf09b('0x89')][_0xf09b('0xa1')]||0xa),'interval':_0xf09b('0x9b')});_0x30ff25[_0xf09b('0xa2')]=![];}return respondWithRpcPromise(_0xf09b('0xa3'),_0xf09b('0xa4'),_0x30ff25);});}return respondWithRpcPromise(_0xf09b('0xa3'),_0xf09b('0xa4'),_0x30ff25);})[_0xf09b('0x23')](function(_0x1f8bbe){respondWithRpcPromise(_0xf09b('0xa5'),'EventManager',{'event':_0xf09b('0x76'),'message':_0x1f8bbe},client9002);return _0x1f8bbe;})[_0xf09b('0x23')](respondWithResult(_0x38a1ca,null))[_0xf09b('0x2e')](handleError(_0x38a1ca,null));};exports[_0xf09b('0xa6')]=function(_0x23efc2,_0x25c1be,_0x594827){return db[_0xf09b('0x42')]['findOne']({'where':{'id':_0x23efc2[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x25c1be,null))[_0xf09b('0x23')](function(_0x565860){if(_0x565860){return db[_0xf09b('0xa7')][_0xf09b('0xa8')](function(_0x51908c){return db[_0xf09b('0xa9')][_0xf09b('0x3b')]({'where':{'OpenchannelAccountId':_0x23efc2[_0xf09b('0x5a')]['id']},'transaction':_0x51908c})['then'](function(_0x122c63){var _0x4d8bbd=_[_0xf09b('0x47')](_0x23efc2[_0xf09b('0x5f')],function(_0x501633){_0x501633[_0xf09b('0x6b')]=_0x23efc2[_0xf09b('0x5a')]['id'];return _0x501633;});return db['OpenchannelApplication'][_0xf09b('0xaa')](_0x4d8bbd,{'transaction':_0x51908c});});})[_0xf09b('0x23')](function(){return db[_0xf09b('0xa9')][_0xf09b('0xab')]({'where':{'OpenchannelAccountId':_0x23efc2[_0xf09b('0x5a')]['id']},'order':_0xf09b('0x8d')});});}})[_0xf09b('0x23')](respondWithResult(_0x25c1be,null))[_0xf09b('0x2e')](handleError(_0x25c1be,null));};exports[_0xf09b('0xac')]=function(_0x1d10c6,_0x9e0ca8,_0x5b77d9){var _0x51a637={};var _0x33667d={};var _0x454104;var _0xbce0bb;return db[_0xf09b('0x42')]['findOne']({'where':{'id':_0x1d10c6[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x9e0ca8,null))[_0xf09b('0x23')](function(_0x43a88f){if(_0x43a88f){_0x454104=_0x43a88f;_0x33667d[_0xf09b('0x46')]=_[_0xf09b('0x49')](db[_0xf09b('0xa9')][_0xf09b('0x6a')]);_0x33667d['query']=_[_0xf09b('0x49')](_0x1d10c6['query']);_0x33667d['filters']=_[_0xf09b('0x4b')](_0x33667d[_0xf09b('0x46')],_0x33667d['query']);_0x51a637['attributes']=_[_0xf09b('0x4b')](_0x33667d[_0xf09b('0x46')],qs[_0xf09b('0x4d')](_0x1d10c6[_0xf09b('0x48')][_0xf09b('0x4d')]));_0x51a637['attributes']=_0x51a637[_0xf09b('0x4c')][_0xf09b('0x4e')]?_0x51a637[_0xf09b('0x4c')]:_0x33667d[_0xf09b('0x46')];_0x51a637[_0xf09b('0x51')]=qs[_0xf09b('0x52')](_0x1d10c6[_0xf09b('0x48')][_0xf09b('0x52')]);_0x51a637[_0xf09b('0x53')]=qs['filters'](_[_0xf09b('0x54')](_0x1d10c6[_0xf09b('0x48')],_0x33667d[_0xf09b('0x4a')]));if(_0x1d10c6['query'][_0xf09b('0x55')]){_0x51a637[_0xf09b('0x53')]=_['merge'](_0x51a637[_0xf09b('0x53')],{'$or':_[_0xf09b('0x47')](_0x51a637[_0xf09b('0x4c')],function(_0x427157){var _0x33ed39={};_0x33ed39[_0x427157]={'$like':'%'+_0x1d10c6[_0xf09b('0x48')]['filter']+'%'};return _0x33ed39;})});}_0x51a637=_[_0xf09b('0x56')]({},_0x51a637,_0x1d10c6[_0xf09b('0x58')]);return _0x454104[_0xf09b('0xac')](_0x51a637);}})['then'](function(_0xca6386){if(_0xca6386){_0xbce0bb=_0xca6386[_0xf09b('0x4e')];if(!_0x1d10c6[_0xf09b('0x48')]['hasOwnProperty'](_0xf09b('0x4f'))){_0x51a637[_0xf09b('0x50')]=qs['limit'](_0x1d10c6[_0xf09b('0x48')]['limit']);_0x51a637[_0xf09b('0x34')]=qs[_0xf09b('0x34')](_0x1d10c6['query'][_0xf09b('0x34')]);}return _0x454104[_0xf09b('0xac')](_0x51a637);}})[_0xf09b('0x23')](function(_0x171305){if(_0x171305){return _0x171305?{'count':_0xbce0bb,'rows':_0x171305}:null;}})[_0xf09b('0x23')](respondWithResult(_0x9e0ca8,null))[_0xf09b('0x2e')](handleError(_0x9e0ca8,null));};exports[_0xf09b('0xad')]=function(_0xfa53b9,_0x19c8d8,_0x197a17){var _0x1c9a14={'raw':![],'where':{}};var _0x428b04={};var _0x5d691a={'count':0x0,'rows':[]};return db[_0xf09b('0x42')][_0xf09b('0x73')]({'where':{'id':_0xfa53b9['params']['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x19c8d8,null))[_0xf09b('0x23')](function(_0x74e356){if(_0x74e356){_0x428b04[_0xf09b('0x46')]=_['keys'](db[_0xf09b('0x93')][_0xf09b('0x6a')]);_0x428b04[_0xf09b('0x48')]=_[_0xf09b('0x49')](_0xfa53b9[_0xf09b('0x48')]);_0x428b04[_0xf09b('0x4a')]=_[_0xf09b('0x4b')](_0x428b04[_0xf09b('0x46')],_0x428b04['query']);_0x1c9a14[_0xf09b('0x4c')]=_[_0xf09b('0x4b')](_0x428b04[_0xf09b('0x46')],qs[_0xf09b('0x4d')](_0xfa53b9[_0xf09b('0x48')]['fields']));_0x1c9a14[_0xf09b('0x4c')]=_0x1c9a14[_0xf09b('0x4c')]['length']?_0x1c9a14[_0xf09b('0x4c')]:_0x428b04['model'];if(!_0xfa53b9[_0xf09b('0x48')][_0xf09b('0x74')](_0xf09b('0x4f'))){_0x1c9a14['limit']=qs[_0xf09b('0x50')](_0xfa53b9[_0xf09b('0x48')][_0xf09b('0x50')]);_0x1c9a14[_0xf09b('0x34')]=qs['offset'](_0xfa53b9[_0xf09b('0x48')]['offset']);}_0x1c9a14[_0xf09b('0x51')]=qs['sort'](_0xfa53b9['query'][_0xf09b('0x52')]);_0x1c9a14[_0xf09b('0x53')]=qs['filters'](_[_0xf09b('0x54')](_0xfa53b9[_0xf09b('0x48')],_0x428b04[_0xf09b('0x4a')]));_0x1c9a14['where']['OpenchannelAccountId']=_0x74e356['id'];if(_0xfa53b9[_0xf09b('0x48')][_0xf09b('0x55')]){_0x1c9a14['where']=_[_0xf09b('0x56')](_0x1c9a14[_0xf09b('0x53')],{'$or':_[_0xf09b('0x47')](_0x1c9a14[_0xf09b('0x4c')],function(_0x239966){var _0x5f56c2={};_0x5f56c2[_0x239966]={'$like':'%'+_0xfa53b9[_0xf09b('0x48')]['filter']+'%'};return _0x5f56c2;})});}_0x1c9a14=_[_0xf09b('0x56')]({},_0x1c9a14,_0xfa53b9['options']);return db[_0xf09b('0x93')]['count']({'where':_0x1c9a14[_0xf09b('0x53')]})['then'](function(_0x5eaa20){_0x5d691a[_0xf09b('0x33')]=_0x5eaa20;if(_0xfa53b9[_0xf09b('0x48')][_0xf09b('0x5b')]){_0x1c9a14[_0xf09b('0x5c')]=[{'model':db['CmContact'],'as':_0xf09b('0xae'),'required':![]},{'model':db[_0xf09b('0x9e')],'as':_0xf09b('0xaf'),'attributes':[_0xf09b('0x3e'),_0xf09b('0xb0'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xf09b('0xb1'),'attributes':['id','name','color'],'where':_0xfa53b9[_0xf09b('0x48')][_0xf09b('0xb2')]?{'id':_0xfa53b9[_0xf09b('0x48')][_0xf09b('0xb2')]}:undefined,'required':_0xfa53b9[_0xf09b('0x48')][_0xf09b('0xb2')]?!![]:![]}];}return db[_0xf09b('0x93')][_0xf09b('0x6c')](_0x1c9a14);})['then'](function(_0x26569f){_0x5d691a[_0xf09b('0x6d')]=_0x26569f;return _0x5d691a;});}})['then'](respondWithFilteredResult(_0x19c8d8,_0x1c9a14))['catch'](handleError(_0x19c8d8,null));};exports['addAgents']=function(_0x400b7a,_0x36f7d2,_0x4f5d37){return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0x400b7a[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x36f7d2,null))[_0xf09b('0x23')](function(_0x27d973){if(_0x27d973){return _0x27d973[_0xf09b('0xb3')](_0x400b7a[_0xf09b('0x5f')][_0xf09b('0x6f')],_[_0xf09b('0xb4')](_0x400b7a[_0xf09b('0x5f')],[_0xf09b('0x6f'),'id'])||{})['spread'](function(_0x59ba24){for(var _0x5423c6=0x0;_0x5423c6<_0x400b7a['body'][_0xf09b('0x6f')][_0xf09b('0x4e')];_0x5423c6+=0x1){socket[_0xf09b('0xb5')](_0xf09b('0xb6'),{'UserId':_0x400b7a[_0xf09b('0x5f')][_0xf09b('0x6f')][_0x5423c6],'OpenchannelAccountId':_0x400b7a[_0xf09b('0x5a')]['id']});}return _0x59ba24;});}})[_0xf09b('0x23')](respondWithResult(_0x36f7d2,null))[_0xf09b('0x2e')](handleError(_0x36f7d2,null));};exports['removeAgents']=function(_0x546a52,_0x47e0a0,_0x1229bb){return db[_0xf09b('0x42')]['find']({'where':{'id':_0x546a52[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x47e0a0,null))[_0xf09b('0x23')](function(_0x4a5912){if(_0x4a5912){return _0x4a5912[_0xf09b('0xb7')](_0x546a52[_0xf09b('0x48')][_0xf09b('0x6f')])[_0xf09b('0x23')](function(){if(_['isArray'](_0x546a52[_0xf09b('0x48')][_0xf09b('0x6f')])){for(var _0x2620be=0x0;_0x2620be<_0x546a52['query'][_0xf09b('0x6f')][_0xf09b('0x4e')];_0x2620be+=0x1){socket['emit'](_0xf09b('0xb8'),{'UserId':Number(_0x546a52[_0xf09b('0x48')][_0xf09b('0x6f')][_0x2620be]),'OpenchannelAccountId':Number(_0x546a52[_0xf09b('0x5a')]['id'])});}}else{socket[_0xf09b('0xb5')](_0xf09b('0xb8'),{'UserId':Number(_0x546a52[_0xf09b('0x48')][_0xf09b('0x6f')]),'OpenchannelAccountId':Number(_0x546a52['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47e0a0,null))[_0xf09b('0x2e')](handleError(_0x47e0a0,null));};exports[_0xf09b('0xb9')]=function(_0x19c6d7,_0x3855bd,_0x297f2a){var _0x522ea1={};var _0x3e37ac={};var _0x3c7f94;var _0x11e6ff;return db[_0xf09b('0x42')][_0xf09b('0x73')]({'where':{'id':_0x19c6d7['params']['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x3855bd,null))['then'](function(_0x3f3e76){if(_0x3f3e76){_0x3c7f94=_0x3f3e76;_0x3e37ac['model']=_['keys'](db['User'][_0xf09b('0x6a')]);_0x3e37ac['query']=_[_0xf09b('0x49')](_0x19c6d7[_0xf09b('0x48')]);_0x3e37ac[_0xf09b('0x4a')]=_['intersection'](_0x3e37ac[_0xf09b('0x46')],_0x3e37ac[_0xf09b('0x48')]);_0x522ea1[_0xf09b('0x4c')]=_[_0xf09b('0x4b')](_0x3e37ac['model'],qs[_0xf09b('0x4d')](_0x19c6d7[_0xf09b('0x48')]['fields']));_0x522ea1['attributes']=_0x522ea1[_0xf09b('0x4c')]['length']?_0x522ea1[_0xf09b('0x4c')]:_0x3e37ac[_0xf09b('0x46')];_0x522ea1[_0xf09b('0x51')]=qs[_0xf09b('0x52')](_0x19c6d7[_0xf09b('0x48')]['sort']);_0x522ea1[_0xf09b('0x53')]=qs[_0xf09b('0x4a')](_[_0xf09b('0x54')](_0x19c6d7[_0xf09b('0x48')],_0x3e37ac[_0xf09b('0x4a')]));if(_0x19c6d7[_0xf09b('0x48')][_0xf09b('0x55')]){_0x522ea1[_0xf09b('0x53')]=_[_0xf09b('0x56')](_0x522ea1[_0xf09b('0x53')],{'$or':_[_0xf09b('0x47')](_0x522ea1[_0xf09b('0x4c')],function(_0x29a31b){var _0xfddfc7={};_0xfddfc7[_0x29a31b]={'$like':'%'+_0x19c6d7['query'][_0xf09b('0x55')]+'%'};return _0xfddfc7;})});}_0x522ea1=_[_0xf09b('0x56')]({},_0x522ea1,_0x19c6d7[_0xf09b('0x58')]);return _0x3c7f94['getAgents'](_0x522ea1);}})[_0xf09b('0x23')](function(_0xf81177){if(_0xf81177){_0x11e6ff=_0xf81177[_0xf09b('0x4e')];if(!_0x19c6d7[_0xf09b('0x48')][_0xf09b('0x74')](_0xf09b('0x4f'))){_0x522ea1[_0xf09b('0x50')]=qs['limit'](_0x19c6d7[_0xf09b('0x48')][_0xf09b('0x50')]);_0x522ea1[_0xf09b('0x34')]=qs[_0xf09b('0x34')](_0x19c6d7[_0xf09b('0x48')][_0xf09b('0x34')]);}return _0x3c7f94[_0xf09b('0xb9')](_0x522ea1);}})['then'](function(_0x5df9c7){if(_0x5df9c7){return _0x5df9c7?{'count':_0x11e6ff,'rows':_0x5df9c7}:null;}})[_0xf09b('0x23')](respondWithResult(_0x3855bd,null))[_0xf09b('0x2e')](handleError(_0x3855bd,null));};exports[_0xf09b('0xba')]=function(_0x21e848,_0x487315,_0x5bcc41){var _0x43d346,_0x35e235,_0x103762;if(_[_0xf09b('0x7e')](_0x21e848[_0xf09b('0x5f')]['body'])||_0x21e848[_0xf09b('0x5f')]['body']===''){throw new db[(_0xf09b('0x78'))][(_0xf09b('0x21'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf09b('0x7e')](_0x21e848[_0xf09b('0x5f')]['to'])){}_0x43d346=_0x21e848[_0xf09b('0x5f')]['to'];return db[_0xf09b('0x42')]['findOne']({'where':{'id':_0x21e848[_0xf09b('0x5a')]['id']}})[_0xf09b('0x23')](handleEntityNotFound(_0x487315,null))['then'](function(_0xbec5b2){if(_0xbec5b2){return db[_0xf09b('0x42')][_0xf09b('0x5d')]({'where':{'id':_0xbec5b2['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xf09b('0x77')],'as':_0xf09b('0x87'),'where':{[_0xbec5b2[_0xf09b('0x80')]]:_0x43d346},'limit':0x1,'order':[[_0xf09b('0x7c'),_0xf09b('0xbb')]]}]}]})[_0xf09b('0x23')](handleEntityNotFound(_0x487315,null))[_0xf09b('0x23')](function(_0x4d9faf){if(_0x4d9faf&&_0x4d9faf[_0xf09b('0x86')]){_0x35e235=_0x4d9faf[_0xf09b('0x3c')]({'plain':!![]});if(_0x35e235[_0xf09b('0x86')]&&_0x35e235[_0xf09b('0x86')][_0xf09b('0x87')][_0xf09b('0x4e')]){return _0x35e235['List'][_0xf09b('0x87')][0x0];}return db[_0xf09b('0x77')][_0xf09b('0x5e')](_['defaults'](_0x21e848[_0xf09b('0x5f')],{'firstName':_0x43d346,[_0x4d9faf['mapKey']]:_0x43d346,'phone':_0x43d346,'ListId':_0x35e235[_0xf09b('0x7d')]}));}})['then'](handleEntityNotFound(_0x487315,null))['then'](function(_0x35c609){if(_0x35c609){_0x103762=_0x35c609;return db[_0xf09b('0x93')][_0xf09b('0x5d')]({'where':{'ContactId':_0x103762['id'],'closed':![],'OpenchannelAccountId':_0x35e235['id']}})[_0xf09b('0x23')](function(_0x55eacb){if(_0x55eacb){return[_0x55eacb,![]];}return db[_0xf09b('0x93')][_0xf09b('0x5e')]({'UserId':_0x21e848['user']['id'],'ContactId':_0x103762['id'],'OpenchannelAccountId':_0x35e235['id'],'lastMsgDirection':_0xf09b('0xbc'),'Messages':[_[_0xf09b('0x56')](_0x21e848[_0xf09b('0x5f')],{'read':![],'body':_0x21e848[_0xf09b('0x5f')][_0xf09b('0x5f')],'OpenchannelAccountId':_0x35e235['id'],'UserId':_0x21e848['user']['id'],'ContactId':_0x103762['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xf09b('0xbd')}]})[_0xf09b('0x23')](function(_0x1ffca3){return[_0x1ffca3,!![]];});});}})[_0xf09b('0x95')](function(_0x50fb8d,_0x59c480){if(_0x59c480){return _0x50fb8d;}return db[_0xf09b('0x9c')][_0xf09b('0x5e')](_[_0xf09b('0x56')](_0x21e848[_0xf09b('0x5f')],{'read':![],'body':_0x21e848[_0xf09b('0x5f')][_0xf09b('0x5f')],'OpenchannelAccountId':_0x35e235['id'],'OpenchannelInteractionId':_0x50fb8d['id'],'UserId':_0x21e848['user']['id'],'ContactId':_0x103762['id']}))[_0xf09b('0x23')](function(_0x38eddd){_0x50fb8d[_0xf09b('0xbe')][_0xf09b('0xbd')]=[];_0x50fb8d['dataValues']['Messages'][_0xf09b('0x9a')](_0x38eddd[_0xf09b('0xbe')]);return _0x50fb8d;});});}})[_0xf09b('0x23')](respondWithResult(_0x487315,null))[_0xf09b('0x2e')](handleError(_0x487315,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 08fb069..7bdca0d 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 _0x40b1=['hasOwnProperty','exports','OpenchannelAccount','save','update','emit'];(function(_0x430793,_0x33321a){var _0x1e41a8=function(_0xe37aa2){while(--_0xe37aa2){_0x430793['push'](_0x430793['shift']());}};_0x1e41a8(++_0x33321a);}(_0x40b1,0x1ee));var _0x140b=function(_0x2109f2,_0x4e5847){_0x2109f2=_0x2109f2-0x0;var _0x4983b9=_0x40b1[_0x2109f2];return _0x4983b9;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x140b('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x140b('0x1'),'afterUpdate':_0x140b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1cb0dd){return function(_0x46c596,_0x237367,_0x7fcfdf){OpenchannelAccountEvents[_0x140b('0x3')](_0x1cb0dd+':'+_0x46c596['id'],_0x46c596);OpenchannelAccountEvents['emit'](_0x1cb0dd,_0x46c596);_0x7fcfdf(null);};}for(var e in events){if(events[_0x140b('0x4')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x140b('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x33ee=['remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x37eb98,_0x27be96){var _0x1a1452=function(_0x25853b){while(--_0x25853b){_0x37eb98['push'](_0x37eb98['shift']());}};_0x1a1452(++_0x27be96);}(_0x33ee,0x124));var _0xe33e=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x33ee[_0x4c6d6f];return _0x2d4478;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe33e('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe33e('0x1')](0x0);var events={'afterCreate':_0xe33e('0x2'),'afterUpdate':_0xe33e('0x3'),'afterDestroy':_0xe33e('0x4')};function emitEvent(_0x15b6ac){return function(_0x588cae,_0x21ef17,_0x4b4a8c){OpenchannelAccountEvents[_0xe33e('0x5')](_0x15b6ac+':'+_0x588cae['id'],_0x588cae);OpenchannelAccountEvents[_0xe33e('0x5')](_0x15b6ac,_0x588cae);_0x4b4a8c(null);};}for(var e in events){if(events[_0xe33e('0x6')](e)){var event=events[e];OpenchannelAccount[_0xe33e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b6e3007..3c6d7ec 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 _0x591a=['path','rimraf','./openchannelAccount.attributes','exports','OpenchannelAccount','lodash','../../config/logger','moment','request-promise'];(function(_0x481f6f,_0x46eae1){var _0x1762e1=function(_0x2a1115){while(--_0x2a1115){_0x481f6f['push'](_0x481f6f['shift']());}};_0x1762e1(++_0x46eae1);}(_0x591a,0xf8));var _0xa591=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x591a[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0xa591('0x0'));var util=require('util');var logger=require(_0xa591('0x1'))('api');var moment=require(_0xa591('0x2'));var BPromise=require('bluebird');var rp=require(_0xa591('0x3'));var fs=require('fs');var path=require(_0xa591('0x4'));var rimraf=require(_0xa591('0x5'));var config=require('../../config/environment');var attributes=require(_0xa591('0x6'));module[_0xa591('0x7')]=function(_0x1d86cb,_0x24dde4){return _0x1d86cb['define'](_0xa591('0x8'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa227=['util','../../config/logger','api','moment','request-promise','rimraf','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0xa227,0x18b));var _0x7a22=function(_0x170753,_0x4c1768){_0x170753=_0x170753-0x0;var _0x278cc0=_0xa227[_0x170753];return _0x278cc0;};'use strict';var _=require(_0x7a22('0x0'));var util=require(_0x7a22('0x1'));var logger=require(_0x7a22('0x2'))(_0x7a22('0x3'));var moment=require(_0x7a22('0x4'));var BPromise=require('bluebird');var rp=require(_0x7a22('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a22('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a22('0x7'));module[_0x7a22('0x8')]=function(_0x5e940c,_0x33b4a1){return _0x5e940c[_0x7a22('0x9')](_0x7a22('0xa'),attributes,{'tableName':_0x7a22('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 83d7190..dd0912a 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 _0x95b0=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x135161,_0x568a03){var _0x217277=function(_0x12194d){while(--_0x12194d){_0x135161['push'](_0x135161['shift']());}};_0x217277(++_0x568a03);}(_0x95b0,0xa0));var _0x095b=function(_0x14134a,_0x4c353d){_0x14134a=_0x14134a-0x0;var _0x2b5d90=_0x95b0[_0x14134a];return _0x2b5d90;};'use strict';var _=require(_0x095b('0x0'));var util=require(_0x095b('0x1'));var moment=require(_0x095b('0x2'));var BPromise=require(_0x095b('0x3'));var rs=require(_0x095b('0x4'));var fs=require('fs');var Redis=require(_0x095b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x095b('0x6'));var logger=require('../../config/logger')(_0x095b('0x7'));var config=require(_0x095b('0x8'));var jayson=require(_0x095b('0x9'));var client=jayson[_0x095b('0xa')]['http']({'port':0x232a});config[_0x095b('0xb')]=_[_0x095b('0xc')](config[_0x095b('0xb')],{'host':_0x095b('0xd'),'port':0x18eb});var socket=require(_0x095b('0xe'))(new Redis(config['redis']));require(_0x095b('0xf'))[_0x095b('0x10')](socket);function respondWithRpcPromise(_0x32ced4,_0x56f897,_0x1e70cb){return new BPromise(function(_0x305ac8,_0x36dc27){return client[_0x095b('0x11')](_0x32ced4,_0x1e70cb)['then'](function(_0x509cba){logger[_0x095b('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x56f897,_0x095b('0x13'));logger[_0x095b('0x14')](_0x095b('0x15'),_0x56f897,_0x095b('0x13'),JSON[_0x095b('0x16')](_0x509cba));if(_0x509cba[_0x095b('0x17')]){if(_0x509cba[_0x095b('0x17')]['code']===0x1f4){logger[_0x095b('0x17')](_0x095b('0x18'),_0x56f897,_0x509cba[_0x095b('0x17')][_0x095b('0x19')]);return _0x36dc27(_0x509cba[_0x095b('0x17')][_0x095b('0x19')]);}logger[_0x095b('0x17')](_0x095b('0x18'),_0x56f897,_0x509cba['error'][_0x095b('0x19')]);return _0x305ac8(_0x509cba[_0x095b('0x17')][_0x095b('0x19')]);}else{logger['info'](_0x095b('0x18'),_0x56f897,_0x095b('0x13'));_0x305ac8(_0x509cba[_0x095b('0x1a')]['message']);}})[_0x095b('0x1b')](function(_0x2f2cfb){logger[_0x095b('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x56f897,_0x2f2cfb);_0x36dc27(_0x2f2cfb);});});} \ No newline at end of file +var _0xa747=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','randomstring'];(function(_0x5947a7,_0x2e365f){var _0x16b3cf=function(_0x539fa9){while(--_0x539fa9){_0x5947a7['push'](_0x5947a7['shift']());}};_0x16b3cf(++_0x2e365f);}(_0xa747,0x7e));var _0x7a74=function(_0xb96be3,_0x2384d4){_0xb96be3=_0xb96be3-0x0;var _0x9db447=_0xa747[_0xb96be3];return _0x9db447;};'use strict';var _=require(_0x7a74('0x0'));var util=require(_0x7a74('0x1'));var moment=require(_0x7a74('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a74('0x3'));var fs=require('fs');var Redis=require(_0x7a74('0x4'));var db=require(_0x7a74('0x5'))['db'];var utils=require(_0x7a74('0x6'));var logger=require(_0x7a74('0x7'))(_0x7a74('0x8'));var config=require(_0x7a74('0x9'));var jayson=require(_0x7a74('0xa'));var client=jayson['client'][_0x7a74('0xb')]({'port':0x232a});config[_0x7a74('0xc')]=_[_0x7a74('0xd')](config[_0x7a74('0xc')],{'host':_0x7a74('0xe'),'port':0x18eb});var socket=require(_0x7a74('0xf'))(new Redis(config[_0x7a74('0xc')]));require(_0x7a74('0x10'))['register'](socket);function respondWithRpcPromise(_0x11bd53,_0x56eceb,_0x19f46b){return new BPromise(function(_0x2ab9b3,_0x36f67a){return client[_0x7a74('0x11')](_0x11bd53,_0x19f46b)['then'](function(_0x52a3f7){logger['info'](_0x7a74('0x12'),_0x56eceb,_0x7a74('0x13'));logger['debug'](_0x7a74('0x14'),_0x56eceb,_0x7a74('0x13'),JSON['stringify'](_0x52a3f7));if(_0x52a3f7['error']){if(_0x52a3f7[_0x7a74('0x15')][_0x7a74('0x16')]===0x1f4){logger[_0x7a74('0x15')](_0x7a74('0x12'),_0x56eceb,_0x52a3f7[_0x7a74('0x15')][_0x7a74('0x17')]);return _0x36f67a(_0x52a3f7['error'][_0x7a74('0x17')]);}logger[_0x7a74('0x15')](_0x7a74('0x12'),_0x56eceb,_0x52a3f7[_0x7a74('0x15')]['message']);return _0x2ab9b3(_0x52a3f7[_0x7a74('0x15')]['message']);}else{logger[_0x7a74('0x18')](_0x7a74('0x12'),_0x56eceb,'request\x20sent');_0x2ab9b3(_0x52a3f7[_0x7a74('0x19')][_0x7a74('0x17')]);}})['catch'](function(_0xfc9f48){logger[_0x7a74('0x15')](_0x7a74('0x12'),_0x56eceb,_0xfc9f48);_0x36f67a(_0xfc9f48);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 62dff55..2cec503 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 _0x5f3e=['remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f3e,0x166));var _0xe5f3=function(_0x1f4811,_0x53abb2){_0x1f4811=_0x1f4811-0x0;var _0x28b51a=_0x5f3e[_0x1f4811];return _0x28b51a;};'use strict';var OpenchannelAccountEvents=require(_0xe5f3('0x0'));var events=[_0xe5f3('0x1'),_0xe5f3('0x2'),_0xe5f3('0x3')];function createListener(_0x1b76cc,_0x14e5b2){return function(_0x274d33){_0x14e5b2[_0xe5f3('0x4')](_0x1b76cc,_0x274d33);};}function removeListener(_0x1507c6,_0x4586c4){return function(){OpenchannelAccountEvents[_0xe5f3('0x5')](_0x1507c6,_0x4586c4);};}exports[_0xe5f3('0x6')]=function(_0x35b8fe){for(var _0x52354f=0x0,_0x2f3559=events[_0xe5f3('0x7')];_0x52354f<_0x2f3559;_0x52354f++){var _0x23d4fc=events[_0x52354f];var _0x24f990=createListener(_0xe5f3('0x8')+_0x23d4fc,_0x35b8fe);OpenchannelAccountEvents['on'](_0x23d4fc,_0x24f990);}}; \ No newline at end of file +var _0xe9c5=['openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener','register'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe9c5,0x1ac));var _0x5e9c=function(_0x35fabc,_0x2c0435){_0x35fabc=_0x35fabc-0x0;var _0x25ce0f=_0xe9c5[_0x35fabc];return _0x25ce0f;};'use strict';var OpenchannelAccountEvents=require(_0x5e9c('0x0'));var events=['save',_0x5e9c('0x1'),_0x5e9c('0x2')];function createListener(_0x5c9d5e,_0x4c1a68){return function(_0x8a47c3){_0x4c1a68[_0x5e9c('0x3')](_0x5c9d5e,_0x8a47c3);};}function removeListener(_0xf2b63e,_0x1f5603){return function(){OpenchannelAccountEvents[_0x5e9c('0x4')](_0xf2b63e,_0x1f5603);};}exports[_0x5e9c('0x5')]=function(_0x15b1d6){for(var _0x2f41c9=0x0,_0x58e9bd=events['length'];_0x2f41c9<_0x58e9bd;_0x2f41c9++){var _0x31507c=events[_0x2f41c9];var _0x283bf9=createListener(_0x5e9c('0x6')+_0x31507c,_0x15b1d6);OpenchannelAccountEvents['on'](_0x31507c,_0x283bf9);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ba26199..df0a968 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 _0xfc85=['isAuthenticated','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','index','/:id','post'];(function(_0x260d4b,_0x25be3a){var _0x32751f=function(_0xd7db96){while(--_0xd7db96){_0x260d4b['push'](_0x260d4b['shift']());}};_0x32751f(++_0x25be3a);}(_0xfc85,0x1b6));var _0x5fc8=function(_0x5558f8,_0x11d46b){_0x5558f8=_0x5558f8-0x0;var _0x47f2d7=_0xfc85[_0x5558f8];return _0x47f2d7;};'use strict';var multer=require('multer');var util=require(_0x5fc8('0x0'));var path=require(_0x5fc8('0x1'));var timeout=require(_0x5fc8('0x2'));var express=require(_0x5fc8('0x3'));var router=express[_0x5fc8('0x4')]();var auth=require(_0x5fc8('0x5'));var interaction=require(_0x5fc8('0x6'));var config=require('../../config/environment');var controller=require(_0x5fc8('0x7'));router[_0x5fc8('0x8')]('/',auth['isAuthenticated'](),controller[_0x5fc8('0x9')]);router[_0x5fc8('0x8')](_0x5fc8('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5fc8('0xb')]('/',auth[_0x5fc8('0xc')](),controller[_0x5fc8('0xd')]);router['put'](_0x5fc8('0xa'),auth[_0x5fc8('0xc')](),controller[_0x5fc8('0xe')]);router[_0x5fc8('0xf')](_0x5fc8('0xa'),auth[_0x5fc8('0xc')](),controller[_0x5fc8('0x10')]);module[_0x5fc8('0x11')]=router; \ No newline at end of file +var _0x30be=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x30be,0x72));var _0xe30b=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x30be[_0x4a095e];return _0x10ef73;};'use strict';var multer=require(_0xe30b('0x0'));var util=require(_0xe30b('0x1'));var path=require(_0xe30b('0x2'));var timeout=require(_0xe30b('0x3'));var express=require('express');var router=express[_0xe30b('0x4')]();var auth=require(_0xe30b('0x5'));var interaction=require(_0xe30b('0x6'));var config=require(_0xe30b('0x7'));var controller=require(_0xe30b('0x8'));router['get']('/',auth[_0xe30b('0x9')](),controller[_0xe30b('0xa')]);router[_0xe30b('0xb')]('/:id',auth[_0xe30b('0x9')](),controller[_0xe30b('0xc')]);router[_0xe30b('0xd')]('/',auth[_0xe30b('0x9')](),controller[_0xe30b('0xe')]);router[_0xe30b('0xf')](_0xe30b('0x10'),auth[_0xe30b('0x9')](),controller['update']);router[_0xe30b('0x11')](_0xe30b('0x10'),auth[_0xe30b('0x9')](),controller[_0xe30b('0x12')]);module[_0xe30b('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 3233cd3..73baa33 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 _0xd459=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xd459,0xb6));var _0x9d45=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xd459[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x9d45('0x0'));module[_0x9d45('0x1')]={'priority':{'type':Sequelize[_0x9d45('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9d45('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9d45('0x4')]},'interval':{'type':Sequelize[_0x9d45('0x4')],'defaultValue':_0x9d45('0x5')}}; \ No newline at end of file +var _0xaec8=['STRING','noop','*,*,*,*','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xaec8,0x13f));var _0x8aec=function(_0x298159,_0x3f66c2){_0x298159=_0x298159-0x0;var _0x436c51=_0xaec8[_0x298159];return _0x436c51;};'use strict';var Sequelize=require(_0x8aec('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8aec('0x1')],'allowNull':![],'defaultValue':_0x8aec('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8aec('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8aec('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 38fc6b5..b5f7dbc 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 _0x6148=['path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','count','offset','limit','set','json','save','update','then','destroy','sendStatus','error','stack','name','send','map','OpenchannelApplication','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x1cfaaf,_0x36fa52){var _0x21e6df=function(_0x54ae51){while(--_0x54ae51){_0x1cfaaf['push'](_0x1cfaaf['shift']());}};_0x21e6df(++_0x36fa52);}(_0x6148,0xc3));var _0x8614=function(_0x25f9e3,_0x576384){_0x25f9e3=_0x25f9e3-0x0;var _0x48964a=_0x6148[_0x25f9e3];return _0x48964a;};'use strict';var pdf=require(_0x8614('0x0'));var emlformat=require(_0x8614('0x1'));var rimraf=require(_0x8614('0x2'));var zipdir=require(_0x8614('0x3'));var jsonpatch=require(_0x8614('0x4'));var rp=require(_0x8614('0x5'));var moment=require(_0x8614('0x6'));var BPromise=require(_0x8614('0x7'));var Mustache=require('mustache');var util=require(_0x8614('0x8'));var path=require(_0x8614('0x9'));var sox=require('sox');var csv=require(_0x8614('0xa'));var ejs=require(_0x8614('0xb'));var fs=require('fs');var _=require(_0x8614('0xc'));var squel=require(_0x8614('0xd'));var crypto=require('crypto');var jsforce=require(_0x8614('0xe'));var deskjs=require(_0x8614('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8614('0x10'));var Papa=require('papaparse');var Redis=require(_0x8614('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8614('0x12'));var as=require(_0x8614('0x13'));var hardwareService=require(_0x8614('0x14'));var logger=require(_0x8614('0x15'))(_0x8614('0x16'));var utils=require(_0x8614('0x17'));var config=require('../../config/environment');var db=require(_0x8614('0x18'))['db'];function respondWithStatusCode(_0x26b141,_0x49aabb){_0x49aabb=_0x49aabb||0xcc;return function(_0x57af66){if(_0x57af66){return _0x26b141['sendStatus'](_0x49aabb);}return _0x26b141['status'](_0x49aabb)['end']();};}function respondWithResult(_0x5c8bd5,_0x5b0ed2){_0x5b0ed2=_0x5b0ed2||0xc8;return function(_0x4608b1){if(_0x4608b1){return _0x5c8bd5[_0x8614('0x19')](_0x5b0ed2)['json'](_0x4608b1);}};}function respondWithFilteredResult(_0x268998,_0x385ac7){return function(_0x30f11c){if(_0x30f11c){var _0x18442b=_0x30f11c[_0x8614('0x1a')],_0x28f863=_0x385ac7[_0x8614('0x1b')],_0x452a88=_0x385ac7[_0x8614('0x1b')]+_0x385ac7[_0x8614('0x1c')],_0x2bf0fc;if(_0x452a88>=_0x18442b){_0x452a88=_0x18442b;_0x2bf0fc=0xc8;}else{_0x2bf0fc=0xce;}_0x268998[_0x8614('0x19')](_0x2bf0fc);return _0x268998[_0x8614('0x1d')]('Content-Range',_0x28f863+'-'+_0x452a88+'/'+_0x18442b)[_0x8614('0x1e')](_0x30f11c);}return null;};}function patchUpdates(_0x426ece){return function(_0x31192d){try{jsonpatch['apply'](_0x31192d,_0x426ece,!![]);}catch(_0x43e05d){return BPromise['reject'](_0x43e05d);}return _0x31192d[_0x8614('0x1f')]();};}function saveUpdates(_0x2b2355,_0x2dcb1d){return function(_0x232611){if(_0x232611){return _0x232611[_0x8614('0x20')](_0x2b2355)[_0x8614('0x21')](function(_0x2a0a65){return _0x2a0a65;});}return null;};}function removeEntity(_0xa0d9fd,_0x2e40c2){return function(_0x1a71ef){if(_0x1a71ef){return _0x1a71ef[_0x8614('0x22')]()[_0x8614('0x21')](function(){_0xa0d9fd[_0x8614('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a474a,_0x2b0c4b){return function(_0x11e20b){if(!_0x11e20b){_0x1a474a[_0x8614('0x23')](0x194);}return _0x11e20b;};}function handleError(_0x12b026,_0x8f3a6){_0x8f3a6=_0x8f3a6||0x1f4;return function(_0x5e9414){logger[_0x8614('0x24')](_0x5e9414[_0x8614('0x25')]);if(_0x5e9414[_0x8614('0x26')]){delete _0x5e9414[_0x8614('0x26')];}_0x12b026['status'](_0x8f3a6)[_0x8614('0x27')](_0x5e9414);};}exports['index']=function(_0x574d06,_0x27d1a5){var _0xac25cd={},_0x156453={},_0x2bd67e={'count':0x0,'rows':[]};var _0x1d1396=_[_0x8614('0x28')](db[_0x8614('0x29')][_0x8614('0x2a')],function(_0x4973c0){return{'name':_0x4973c0['fieldName'],'type':_0x4973c0[_0x8614('0x2b')]['key']};});_0x156453[_0x8614('0x2c')]=_[_0x8614('0x28')](_0x1d1396,'name');_0x156453['query']=_[_0x8614('0x2d')](_0x574d06[_0x8614('0x2e')]);_0x156453[_0x8614('0x2f')]=_[_0x8614('0x30')](_0x156453[_0x8614('0x2c')],_0x156453[_0x8614('0x2e')]);_0xac25cd[_0x8614('0x31')]=_[_0x8614('0x30')](_0x156453['model'],qs[_0x8614('0x32')](_0x574d06['query'][_0x8614('0x32')]));_0xac25cd[_0x8614('0x31')]=_0xac25cd[_0x8614('0x31')]['length']?_0xac25cd['attributes']:_0x156453['model'];if(!_0x574d06[_0x8614('0x2e')]['hasOwnProperty']('nolimit')){_0xac25cd['limit']=qs['limit'](_0x574d06[_0x8614('0x2e')][_0x8614('0x1c')]);_0xac25cd[_0x8614('0x1b')]=qs['offset'](_0x574d06['query'][_0x8614('0x1b')]);}_0xac25cd[_0x8614('0x33')]=qs[_0x8614('0x34')](_0x574d06[_0x8614('0x2e')][_0x8614('0x34')]);_0xac25cd[_0x8614('0x35')]=qs[_0x8614('0x2f')](_['pick'](_0x574d06[_0x8614('0x2e')],_0x156453['filters']));if(_0x574d06[_0x8614('0x2e')][_0x8614('0x36')]){_0xac25cd[_0x8614('0x35')]=_[_0x8614('0x37')](_0xac25cd[_0x8614('0x35')],{'$or':_['map'](_0x1d1396,function(_0xe332b6){if(_0xe332b6['type']!==_0x8614('0x38')){var _0x5051f9={};_0x5051f9[_0xe332b6['name']]={'$like':'%'+_0x574d06[_0x8614('0x2e')]['filter']+'%'};return _0x5051f9;}})});}_0xac25cd=_[_0x8614('0x37')]({},_0xac25cd,_0x574d06[_0x8614('0x39')]);var _0x55e9bc={'where':_0xac25cd['where']};return db[_0x8614('0x29')][_0x8614('0x1a')](_0x55e9bc)[_0x8614('0x21')](function(_0x506f94){_0x2bd67e[_0x8614('0x1a')]=_0x506f94;if(_0x574d06[_0x8614('0x2e')][_0x8614('0x3a')]){_0xac25cd[_0x8614('0x3b')]=[{'all':!![]}];}return db[_0x8614('0x29')][_0x8614('0x3c')](_0xac25cd);})[_0x8614('0x21')](function(_0x4a0fcd){_0x2bd67e[_0x8614('0x3d')]=_0x4a0fcd;return _0x2bd67e;})[_0x8614('0x21')](respondWithFilteredResult(_0x27d1a5,_0xac25cd))[_0x8614('0x3e')](handleError(_0x27d1a5,null));};exports[_0x8614('0x3f')]=function(_0x5ac482,_0x2e0a55){var _0x44c892={'raw':!![],'where':{'id':_0x5ac482['params']['id']}},_0x235a30={};_0x235a30[_0x8614('0x2c')]=_['keys'](db[_0x8614('0x29')][_0x8614('0x2a')]);_0x235a30[_0x8614('0x2e')]=_[_0x8614('0x2d')](_0x5ac482[_0x8614('0x2e')]);_0x235a30[_0x8614('0x2f')]=_[_0x8614('0x30')](_0x235a30[_0x8614('0x2c')],_0x235a30[_0x8614('0x2e')]);_0x44c892[_0x8614('0x31')]=_['intersection'](_0x235a30[_0x8614('0x2c')],qs['fields'](_0x5ac482[_0x8614('0x2e')][_0x8614('0x32')]));_0x44c892[_0x8614('0x31')]=_0x44c892[_0x8614('0x31')][_0x8614('0x40')]?_0x44c892[_0x8614('0x31')]:_0x235a30['model'];if(_0x5ac482[_0x8614('0x2e')][_0x8614('0x3a')]){_0x44c892[_0x8614('0x3b')]=[{'all':!![]}];}_0x44c892=_[_0x8614('0x37')]({},_0x44c892,_0x5ac482['options']);return db[_0x8614('0x29')][_0x8614('0x41')](_0x44c892)[_0x8614('0x21')](handleEntityNotFound(_0x2e0a55,null))[_0x8614('0x21')](respondWithResult(_0x2e0a55,null))[_0x8614('0x3e')](handleError(_0x2e0a55,null));};exports['create']=function(_0xc8771d,_0x1a721e){return db[_0x8614('0x29')]['create'](_0xc8771d['body'],{})[_0x8614('0x21')](respondWithResult(_0x1a721e,0xc9))[_0x8614('0x3e')](handleError(_0x1a721e,null));};exports[_0x8614('0x20')]=function(_0xc1f230,_0x4c0c3b){if(_0xc1f230['body']['id']){delete _0xc1f230[_0x8614('0x42')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0xc1f230[_0x8614('0x43')]['id']}})[_0x8614('0x21')](handleEntityNotFound(_0x4c0c3b,null))[_0x8614('0x21')](saveUpdates(_0xc1f230[_0x8614('0x42')],null))[_0x8614('0x21')](respondWithResult(_0x4c0c3b,null))['catch'](handleError(_0x4c0c3b,null));};exports[_0x8614('0x22')]=function(_0x236bc6,_0x5676b5){return db[_0x8614('0x29')][_0x8614('0x41')]({'where':{'id':_0x236bc6[_0x8614('0x43')]['id']}})[_0x8614('0x21')](handleEntityNotFound(_0x5676b5,null))[_0x8614('0x21')](removeEntity(_0x5676b5,null))['catch'](handleError(_0x5676b5,null));}; \ No newline at end of file +var _0x9d91=['desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce'];(function(_0x51677c,_0x1b1501){var _0x3df3e8=function(_0x43cd61){while(--_0x43cd61){_0x51677c['push'](_0x51677c['shift']());}};_0x3df3e8(++_0x1b1501);}(_0x9d91,0x116));var _0x19d9=function(_0xf30d8f,_0x265a29){_0xf30d8f=_0xf30d8f-0x0;var _0x3e5dab=_0x9d91[_0xf30d8f];return _0x3e5dab;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x19d9('0x0'));var rimraf=require(_0x19d9('0x1'));var zipdir=require(_0x19d9('0x2'));var jsonpatch=require(_0x19d9('0x3'));var rp=require(_0x19d9('0x4'));var moment=require('moment');var BPromise=require(_0x19d9('0x5'));var Mustache=require(_0x19d9('0x6'));var util=require(_0x19d9('0x7'));var path=require(_0x19d9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x19d9('0x9'));var fs=require('fs');var _=require(_0x19d9('0xa'));var squel=require(_0x19d9('0xb'));var crypto=require(_0x19d9('0xc'));var jsforce=require(_0x19d9('0xd'));var deskjs=require(_0x19d9('0xe'));var toCsv=require(_0x19d9('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x19d9('0x10'));var authService=require(_0x19d9('0x11'));var qs=require(_0x19d9('0x12'));var as=require(_0x19d9('0x13'));var hardwareService=require(_0x19d9('0x14'));var logger=require(_0x19d9('0x15'))(_0x19d9('0x16'));var utils=require(_0x19d9('0x17'));var config=require(_0x19d9('0x18'));var db=require(_0x19d9('0x19'))['db'];function respondWithStatusCode(_0x7460af,_0x1e89b7){_0x1e89b7=_0x1e89b7||0xcc;return function(_0x21dae7){if(_0x21dae7){return _0x7460af['sendStatus'](_0x1e89b7);}return _0x7460af['status'](_0x1e89b7)[_0x19d9('0x1a')]();};}function respondWithResult(_0x3b4426,_0x4ffee3){_0x4ffee3=_0x4ffee3||0xc8;return function(_0x470f47){if(_0x470f47){return _0x3b4426[_0x19d9('0x1b')](_0x4ffee3)['json'](_0x470f47);}};}function respondWithFilteredResult(_0x14aad0,_0x3b7779){return function(_0x3cef14){if(_0x3cef14){var _0x538a48=_0x3cef14[_0x19d9('0x1c')],_0x4b5067=_0x3b7779[_0x19d9('0x1d')],_0x1001f0=_0x3b7779[_0x19d9('0x1d')]+_0x3b7779[_0x19d9('0x1e')],_0x52f7a8;if(_0x1001f0>=_0x538a48){_0x1001f0=_0x538a48;_0x52f7a8=0xc8;}else{_0x52f7a8=0xce;}_0x14aad0[_0x19d9('0x1b')](_0x52f7a8);return _0x14aad0['set'](_0x19d9('0x1f'),_0x4b5067+'-'+_0x1001f0+'/'+_0x538a48)[_0x19d9('0x20')](_0x3cef14);}return null;};}function patchUpdates(_0x4ddcdc){return function(_0x135311){try{jsonpatch[_0x19d9('0x21')](_0x135311,_0x4ddcdc,!![]);}catch(_0x43358a){return BPromise['reject'](_0x43358a);}return _0x135311['save']();};}function saveUpdates(_0x23562c,_0x1b4ad5){return function(_0x3be210){if(_0x3be210){return _0x3be210[_0x19d9('0x22')](_0x23562c)[_0x19d9('0x23')](function(_0x46b918){return _0x46b918;});}return null;};}function removeEntity(_0x456f6a,_0x9ca69a){return function(_0x53c416){if(_0x53c416){return _0x53c416[_0x19d9('0x24')]()['then'](function(){_0x456f6a[_0x19d9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d78d4,_0x846359){return function(_0x5aeb27){if(!_0x5aeb27){_0x2d78d4['sendStatus'](0x194);}return _0x5aeb27;};}function handleError(_0x42b37,_0xd2f722){_0xd2f722=_0xd2f722||0x1f4;return function(_0x23fdcf){logger[_0x19d9('0x25')](_0x23fdcf[_0x19d9('0x26')]);if(_0x23fdcf[_0x19d9('0x27')]){delete _0x23fdcf['name'];}_0x42b37[_0x19d9('0x1b')](_0xd2f722)[_0x19d9('0x28')](_0x23fdcf);};}exports[_0x19d9('0x29')]=function(_0x4510e4,_0x29b1ee){var _0x56699c={},_0x178529={},_0xe32fb2={'count':0x0,'rows':[]};var _0x54709c=_['map'](db[_0x19d9('0x2a')][_0x19d9('0x2b')],function(_0x4d82da){return{'name':_0x4d82da[_0x19d9('0x2c')],'type':_0x4d82da[_0x19d9('0x2d')]['key']};});_0x178529[_0x19d9('0x2e')]=_[_0x19d9('0x2f')](_0x54709c,'name');_0x178529[_0x19d9('0x30')]=_[_0x19d9('0x31')](_0x4510e4[_0x19d9('0x30')]);_0x178529['filters']=_[_0x19d9('0x32')](_0x178529[_0x19d9('0x2e')],_0x178529[_0x19d9('0x30')]);_0x56699c['attributes']=_['intersection'](_0x178529[_0x19d9('0x2e')],qs[_0x19d9('0x33')](_0x4510e4[_0x19d9('0x30')][_0x19d9('0x33')]));_0x56699c['attributes']=_0x56699c[_0x19d9('0x34')][_0x19d9('0x35')]?_0x56699c[_0x19d9('0x34')]:_0x178529[_0x19d9('0x2e')];if(!_0x4510e4['query'][_0x19d9('0x36')]('nolimit')){_0x56699c[_0x19d9('0x1e')]=qs[_0x19d9('0x1e')](_0x4510e4['query'][_0x19d9('0x1e')]);_0x56699c['offset']=qs[_0x19d9('0x1d')](_0x4510e4[_0x19d9('0x30')][_0x19d9('0x1d')]);}_0x56699c[_0x19d9('0x37')]=qs['sort'](_0x4510e4[_0x19d9('0x30')][_0x19d9('0x38')]);_0x56699c[_0x19d9('0x39')]=qs[_0x19d9('0x3a')](_[_0x19d9('0x3b')](_0x4510e4[_0x19d9('0x30')],_0x178529[_0x19d9('0x3a')]));if(_0x4510e4[_0x19d9('0x30')][_0x19d9('0x3c')]){_0x56699c['where']=_[_0x19d9('0x3d')](_0x56699c[_0x19d9('0x39')],{'$or':_['map'](_0x54709c,function(_0x18aea4){if(_0x18aea4[_0x19d9('0x2d')]!=='VIRTUAL'){var _0x58f3a8={};_0x58f3a8[_0x18aea4['name']]={'$like':'%'+_0x4510e4[_0x19d9('0x30')][_0x19d9('0x3c')]+'%'};return _0x58f3a8;}})});}_0x56699c=_['merge']({},_0x56699c,_0x4510e4[_0x19d9('0x3e')]);var _0x1b748b={'where':_0x56699c[_0x19d9('0x39')]};return db[_0x19d9('0x2a')]['count'](_0x1b748b)[_0x19d9('0x23')](function(_0x267124){_0xe32fb2['count']=_0x267124;if(_0x4510e4[_0x19d9('0x30')][_0x19d9('0x3f')]){_0x56699c[_0x19d9('0x40')]=[{'all':!![]}];}return db[_0x19d9('0x2a')][_0x19d9('0x41')](_0x56699c);})['then'](function(_0x16089a){_0xe32fb2[_0x19d9('0x42')]=_0x16089a;return _0xe32fb2;})[_0x19d9('0x23')](respondWithFilteredResult(_0x29b1ee,_0x56699c))['catch'](handleError(_0x29b1ee,null));};exports[_0x19d9('0x43')]=function(_0xc41bdb,_0x28f7ab){var _0x46b1db={'raw':!![],'where':{'id':_0xc41bdb[_0x19d9('0x44')]['id']}},_0x53db84={};_0x53db84[_0x19d9('0x2e')]=_[_0x19d9('0x31')](db['OpenchannelApplication'][_0x19d9('0x2b')]);_0x53db84['query']=_[_0x19d9('0x31')](_0xc41bdb['query']);_0x53db84[_0x19d9('0x3a')]=_[_0x19d9('0x32')](_0x53db84['model'],_0x53db84['query']);_0x46b1db[_0x19d9('0x34')]=_['intersection'](_0x53db84[_0x19d9('0x2e')],qs[_0x19d9('0x33')](_0xc41bdb[_0x19d9('0x30')][_0x19d9('0x33')]));_0x46b1db[_0x19d9('0x34')]=_0x46b1db['attributes'][_0x19d9('0x35')]?_0x46b1db['attributes']:_0x53db84['model'];if(_0xc41bdb[_0x19d9('0x30')][_0x19d9('0x3f')]){_0x46b1db[_0x19d9('0x40')]=[{'all':!![]}];}_0x46b1db=_[_0x19d9('0x3d')]({},_0x46b1db,_0xc41bdb[_0x19d9('0x3e')]);return db['OpenchannelApplication'][_0x19d9('0x45')](_0x46b1db)['then'](handleEntityNotFound(_0x28f7ab,null))['then'](respondWithResult(_0x28f7ab,null))[_0x19d9('0x46')](handleError(_0x28f7ab,null));};exports[_0x19d9('0x47')]=function(_0x35a1af,_0x3f7e99){return db[_0x19d9('0x2a')][_0x19d9('0x47')](_0x35a1af[_0x19d9('0x48')],{})['then'](respondWithResult(_0x3f7e99,0xc9))['catch'](handleError(_0x3f7e99,null));};exports['update']=function(_0x10ab8b,_0x3a7c7a){if(_0x10ab8b[_0x19d9('0x48')]['id']){delete _0x10ab8b[_0x19d9('0x48')]['id'];}return db[_0x19d9('0x2a')][_0x19d9('0x45')]({'where':{'id':_0x10ab8b['params']['id']}})[_0x19d9('0x23')](handleEntityNotFound(_0x3a7c7a,null))['then'](saveUpdates(_0x10ab8b[_0x19d9('0x48')],null))[_0x19d9('0x23')](respondWithResult(_0x3a7c7a,null))[_0x19d9('0x46')](handleError(_0x3a7c7a,null));};exports[_0x19d9('0x24')]=function(_0x15c3ff,_0x3b2afe){return db[_0x19d9('0x2a')][_0x19d9('0x45')]({'where':{'id':_0x15c3ff[_0x19d9('0x44')]['id']}})[_0x19d9('0x23')](handleEntityNotFound(_0x3b2afe,null))['then'](removeEntity(_0x3b2afe,null))[_0x19d9('0x46')](handleError(_0x3b2afe,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 502501f..90e2cfa 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 _0x45cc=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x33ecfe,_0x2f5ea4){var _0x26105f=function(_0x447568){while(--_0x447568){_0x33ecfe['push'](_0x33ecfe['shift']());}};_0x26105f(++_0x2f5ea4);}(_0x45cc,0x103));var _0xc45c=function(_0x43df87,_0x59bac7){_0x43df87=_0x43df87-0x0;var _0x49caaf=_0x45cc[_0x43df87];return _0x49caaf;};'use strict';var _=require(_0xc45c('0x0'));var util=require(_0xc45c('0x1'));var logger=require(_0xc45c('0x2'))(_0xc45c('0x3'));var moment=require('moment');var BPromise=require(_0xc45c('0x4'));var rp=require(_0xc45c('0x5'));var fs=require('fs');var path=require(_0xc45c('0x6'));var rimraf=require(_0xc45c('0x7'));var config=require(_0xc45c('0x8'));var attributes=require(_0xc45c('0x9'));module[_0xc45c('0xa')]=function(_0x49918e,_0x185c19){return _0x49918e[_0xc45c('0xb')]('OpenchannelApplication',attributes,{'tableName':_0xc45c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc45c('0xd')});}; \ No newline at end of file +var _0x0fc8=['moment','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x1d3faf,_0x5b1354){var _0x2b5746=function(_0x1ae0dc){while(--_0x1ae0dc){_0x1d3faf['push'](_0x1d3faf['shift']());}};_0x2b5746(++_0x5b1354);}(_0x0fc8,0x10f));var _0x80fc=function(_0x26690a,_0x1d206d){_0x26690a=_0x26690a-0x0;var _0x395c3f=_0x0fc8[_0x26690a];return _0x395c3f;};'use strict';var _=require(_0x80fc('0x0'));var util=require('util');var logger=require(_0x80fc('0x1'))('api');var moment=require(_0x80fc('0x2'));var BPromise=require('bluebird');var rp=require(_0x80fc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80fc('0x4'));var config=require(_0x80fc('0x5'));var attributes=require(_0x80fc('0x6'));module[_0x80fc('0x7')]=function(_0x5ee60f,_0x22f539){return _0x5ee60f[_0x80fc('0x8')](_0x80fc('0x9'),attributes,{'tableName':_0x80fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80fc('0xb'),'collate':_0x80fc('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 49f7cda..151d06d 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 _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x53e936,_0x34ada1){var _0x1e9ccf=function(_0x22fea2){while(--_0x22fea2){_0x53e936['push'](_0x53e936['shift']());}};_0x1e9ccf(++_0x34ada1);}(_0xb10b,0x12a));var _0xbb10=function(_0x12699c,_0xf9dd49){_0x12699c=_0x12699c-0x0;var _0x54360e=_0xb10b[_0x12699c];return _0x54360e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x181959,_0x111e0a){var _0x5e3ca1=function(_0x1d0b05){while(--_0x1d0b05){_0x181959['push'](_0x181959['shift']());}};_0x5e3ca1(++_0x111e0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xb10b[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 8d2af67..18e4175 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 _0x3adb=['isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x3adb,0x14a));var _0xb3ad=function(_0x208a4f,_0x9e80b1){_0x208a4f=_0x208a4f-0x0;var _0xd9bc99=_0x3adb[_0x208a4f];return _0xd9bc99;};'use strict';var multer=require(_0xb3ad('0x0'));var util=require(_0xb3ad('0x1'));var path=require('path');var timeout=require(_0xb3ad('0x2'));var express=require(_0xb3ad('0x3'));var router=express[_0xb3ad('0x4')]();var auth=require(_0xb3ad('0x5'));var interaction=require(_0xb3ad('0x6'));var config=require(_0xb3ad('0x7'));var controller=require(_0xb3ad('0x8'));router[_0xb3ad('0x9')]('/',auth[_0xb3ad('0xa')](),controller[_0xb3ad('0xb')]);router[_0xb3ad('0x9')](_0xb3ad('0xc'),auth[_0xb3ad('0xa')](),controller['describe']);router['get'](_0xb3ad('0xd'),auth['isAuthenticated'](),controller[_0xb3ad('0xe')]);router[_0xb3ad('0x9')](_0xb3ad('0xf'),auth['isAuthenticated'](),controller[_0xb3ad('0x10')]);router[_0xb3ad('0x9')](_0xb3ad('0x11'),auth[_0xb3ad('0xa')](),controller['download']);router[_0xb3ad('0x12')]('/',auth[_0xb3ad('0xa')](),controller[_0xb3ad('0x13')]);router['post'](_0xb3ad('0xf'),auth[_0xb3ad('0xa')](),controller[_0xb3ad('0x14')]);router[_0xb3ad('0x12')](_0xb3ad('0x15'),auth['isAuthenticated'](),interaction[_0xb3ad('0x16')](_0xb3ad('0x17'),_0xb3ad('0x18')),controller[_0xb3ad('0x19')]);router[_0xb3ad('0x1a')]('/:id',auth[_0xb3ad('0xa')](),interaction[_0xb3ad('0x16')](_0xb3ad('0x17'),_0xb3ad('0x1b')),controller[_0xb3ad('0x1c')]);router[_0xb3ad('0x1d')](_0xb3ad('0xd'),auth[_0xb3ad('0xa')](),interaction['tracked']('openchannel',_0xb3ad('0x1e')),controller[_0xb3ad('0x1f')]);router[_0xb3ad('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0xb3ad('0x20')]);module[_0xb3ad('0x21')]=router; \ No newline at end of file +var _0x4d3d=['tracked','openchannelinteraction:update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','/:id'];(function(_0x53c73b,_0x3ce7df){var _0x5513a6=function(_0x309e1f){while(--_0x309e1f){_0x53c73b['push'](_0x53c73b['shift']());}};_0x5513a6(++_0x3ce7df);}(_0x4d3d,0x17a));var _0xd4d3=function(_0x4c4855,_0x2d109d){_0x4c4855=_0x4c4855-0x0;var _0x11ba1c=_0x4d3d[_0x4c4855];return _0x11ba1c;};'use strict';var multer=require(_0xd4d3('0x0'));var util=require(_0xd4d3('0x1'));var path=require(_0xd4d3('0x2'));var timeout=require('connect-timeout');var express=require(_0xd4d3('0x3'));var router=express[_0xd4d3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4d3('0x5'));var config=require(_0xd4d3('0x6'));var controller=require(_0xd4d3('0x7'));router[_0xd4d3('0x8')]('/',auth[_0xd4d3('0x9')](),controller[_0xd4d3('0xa')]);router[_0xd4d3('0x8')](_0xd4d3('0xb'),auth[_0xd4d3('0x9')](),controller[_0xd4d3('0xc')]);router[_0xd4d3('0x8')]('/:id',auth[_0xd4d3('0x9')](),controller[_0xd4d3('0xd')]);router[_0xd4d3('0x8')]('/:id/messages',auth[_0xd4d3('0x9')](),controller[_0xd4d3('0xe')]);router[_0xd4d3('0x8')](_0xd4d3('0xf'),auth[_0xd4d3('0x9')](),controller[_0xd4d3('0x10')]);router['post']('/',auth[_0xd4d3('0x9')](),controller['create']);router[_0xd4d3('0x11')]('/:id/messages',auth[_0xd4d3('0x9')](),controller[_0xd4d3('0x12')]);router['post'](_0xd4d3('0x13'),auth[_0xd4d3('0x9')](),interaction['tracked'](_0xd4d3('0x14'),_0xd4d3('0x15')),controller[_0xd4d3('0x16')]);router[_0xd4d3('0x17')](_0xd4d3('0x18'),auth[_0xd4d3('0x9')](),interaction[_0xd4d3('0x19')]('openchannel',_0xd4d3('0x1a')),controller['update']);router[_0xd4d3('0x1b')](_0xd4d3('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0xd4d3('0x14'),_0xd4d3('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0xd4d3('0x1d')]);module[_0xd4d3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8db5d15..a72c525 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 _0xfe8c=['out','BOOLEAN','DATE','STRING'];(function(_0x10b304,_0x3f188e){var _0x10fb78=function(_0x5079b1){while(--_0x5079b1){_0x10b304['push'](_0x10b304['shift']());}};_0x10fb78(++_0x3f188e);}(_0xfe8c,0x1b5));var _0xcfe8=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0xfe8c[_0x264d4d];return _0xc917e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xcfe8('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcfe8('0x1')]},'disposition':{'type':Sequelize[_0xcfe8('0x2')]},'note':{'type':Sequelize[_0xcfe8('0x2')]},'read1stAt':{'type':Sequelize[_0xcfe8('0x1')]},'threadId':{'type':Sequelize[_0xcfe8('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xcfe8('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xcfe8('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xcfe8('0x2')]}}; \ No newline at end of file +var _0xa947=['exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0xdd30d4,_0x340160){var _0x3c56e6=function(_0x2ff98c){while(--_0x2ff98c){_0xdd30d4['push'](_0xdd30d4['shift']());}};_0x3c56e6(++_0x340160);}(_0xa947,0x1b0));var _0x7a94=function(_0x405b63,_0x2ce2e3){_0x405b63=_0x405b63-0x0;var _0x232c48=_0xa947[_0x405b63];return _0x232c48;};'use strict';var Sequelize=require('sequelize');module[_0x7a94('0x0')]={'closed':{'type':Sequelize[_0x7a94('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7a94('0x2')]},'read1stAt':{'type':Sequelize[_0x7a94('0x3')]},'threadId':{'type':Sequelize[_0x7a94('0x2')]},'externalUrl':{'type':Sequelize[_0x7a94('0x2')]},'lastMsgAt':{'type':Sequelize[_0x7a94('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7a94('0x4')]('in',_0x7a94('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7a94('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index bdcc366..ad37140 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 _0x32ef=['Openchannel','mkdirSync','closedAt','disposition','threadId','Private','basename','pipe','createWriteStream','out','System','direction','secret','renderFile','views','downloadInteraction.html','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','Users','map','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','openchannel_interactions','left_join','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','getOpenchannelAccounts','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','catch','show','params','include','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','includeAll','addTags','setTags','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Messages','fullname','firstName','lastName','Attachment','OpenchannelAccount','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'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x32ef,0xf9));var _0xf32e=function(_0x449d4e,_0x9d2bad){_0x449d4e=_0x449d4e-0x0;var _0x315f1a=_0x32ef[_0x449d4e];return _0x315f1a;};'use strict';var pdf=require(_0xf32e('0x0'));var emlformat=require(_0xf32e('0x1'));var rimraf=require(_0xf32e('0x2'));var zipdir=require(_0xf32e('0x3'));var jsonpatch=require(_0xf32e('0x4'));var rp=require(_0xf32e('0x5'));var moment=require('moment');var BPromise=require(_0xf32e('0x6'));var Mustache=require(_0xf32e('0x7'));var util=require('util');var path=require(_0xf32e('0x8'));var sox=require(_0xf32e('0x9'));var csv=require(_0xf32e('0xa'));var ejs=require(_0xf32e('0xb'));var fs=require('fs');var _=require(_0xf32e('0xc'));var squel=require(_0xf32e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf32e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf32e('0xa'));var querystring=require(_0xf32e('0xf'));var Papa=require(_0xf32e('0x10'));var Redis=require(_0xf32e('0x11'));var authService=require(_0xf32e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf32e('0x13'));var hardwareService=require(_0xf32e('0x14'));var logger=require(_0xf32e('0x15'))(_0xf32e('0x16'));var utils=require(_0xf32e('0x17'));var config=require(_0xf32e('0x18'));var db=require(_0xf32e('0x19'))['db'];config[_0xf32e('0x1a')]=_[_0xf32e('0x1b')](config[_0xf32e('0x1a')],{'host':_0xf32e('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf32e('0x1a')]));require(_0xf32e('0x1d'))[_0xf32e('0x1e')](socket);function respondWithStatusCode(_0x336e26,_0x35988d){_0x35988d=_0x35988d||0xcc;return function(_0x458002){if(_0x458002){return _0x336e26['sendStatus'](_0x35988d);}return _0x336e26[_0xf32e('0x1f')](_0x35988d)[_0xf32e('0x20')]();};}function respondWithResult(_0x1dd008,_0x400d25){_0x400d25=_0x400d25||0xc8;return function(_0x43eedf){if(_0x43eedf){return _0x1dd008[_0xf32e('0x1f')](_0x400d25)[_0xf32e('0x21')](_0x43eedf);}};}function respondWithFilteredResult(_0x2c092d,_0x21aa73){return function(_0x4caac5){if(_0x4caac5){var _0x3510ec=_0x4caac5[_0xf32e('0x22')],_0xc47a9=_0x21aa73[_0xf32e('0x23')],_0xb828b8=_0x21aa73[_0xf32e('0x23')]+_0x21aa73[_0xf32e('0x24')],_0x290547;if(_0xb828b8>=_0x3510ec){_0xb828b8=_0x3510ec;_0x290547=0xc8;}else{_0x290547=0xce;}_0x2c092d[_0xf32e('0x1f')](_0x290547);return _0x2c092d[_0xf32e('0x25')](_0xf32e('0x26'),_0xc47a9+'-'+_0xb828b8+'/'+_0x3510ec)[_0xf32e('0x21')](_0x4caac5);}return null;};}function patchUpdates(_0x3202e1){return function(_0x3c0d43){try{jsonpatch[_0xf32e('0x27')](_0x3c0d43,_0x3202e1,!![]);}catch(_0x54fea1){return BPromise[_0xf32e('0x28')](_0x54fea1);}return _0x3c0d43['save']();};}function saveUpdates(_0x27b92c,_0x2aaabf){return function(_0x44ba6d){if(_0x44ba6d){return _0x44ba6d[_0xf32e('0x29')](_0x27b92c)[_0xf32e('0x2a')](function(_0x5409b4){return _0x5409b4;});}return null;};}function removeEntity(_0x227405,_0x4407f8){return function(_0x13d87a){if(_0x13d87a){return _0x13d87a[_0xf32e('0x2b')]()['then'](function(){_0x227405[_0xf32e('0x1f')](0xcc)[_0xf32e('0x20')]();});}};}function handleEntityNotFound(_0x2e8c34,_0xe0a285){return function(_0xb3ee4b){if(!_0xb3ee4b){_0x2e8c34[_0xf32e('0x2c')](0x194);}return _0xb3ee4b;};}function handleError(_0x2f925b,_0x1eb42e){_0x1eb42e=_0x1eb42e||0x1f4;return function(_0x237c72){logger[_0xf32e('0x2d')](_0x237c72['stack']);if(_0x237c72[_0xf32e('0x2e')]){delete _0x237c72[_0xf32e('0x2e')];}_0x2f925b[_0xf32e('0x1f')](_0x1eb42e)['send'](_0x237c72);};}function getInteractionUsers(_0x419d13,_0x5bc6f2){return new BPromise(function(_0x1586d9,_0x5c8779){try{if(_0x5bc6f2[_0x419d13['id']]){_0x419d13[_0xf32e('0x2f')]=_[_0xf32e('0x30')](_0x5bc6f2[_0x419d13['id']],function(_0x3e42ac){return{'id':_0x3e42ac['id']};});}}catch(_0xf42594){_0x5c8779(_0xf42594);}_0x1586d9(_0x419d13);});}function getInteractionTags(_0x32a74b,_0x4e64d4){return new BPromise(function(_0x2e2ea4,_0x1d3c7a){try{if(_0x32a74b[_0xf32e('0x31')]){_0x32a74b['Tags']=[];_0x32a74b[_0xf32e('0x31')][_0xf32e('0x32')](',')[_0xf32e('0x33')](function(_0x3b87d3){_0x32a74b[_0xf32e('0x34')][_0xf32e('0x35')](_0x4e64d4[_0x3b87d3]);});}delete _0x32a74b[_0xf32e('0x31')];}catch(_0x20f36b){_0x1d3c7a(_0x20f36b);}_0x2e2ea4(_0x32a74b);});}function updateOpenchannelInteraction(_0x2e580c,_0x15712d,_0x177727){return new BPromise(function(_0x45524d,_0xe36079){return getInteractionUsers(_0x2e580c,_0x177727)['then'](function(_0x7b643e){return getInteractionTags(_0x7b643e,_0x15712d);})['then'](function(_0x576446){_0x45524d(_0x576446);})['catch'](function(_0x565552){_0xe36079(_0x565552);});});}exports[_0xf32e('0x36')]=function(_0x300013,_0x37231c){var _0x20d846={},_0x40e82c={},_0x47fcf9={'count':0x0,'rows':[]};var _0x4432de=_[_0xf32e('0x30')](db[_0xf32e('0x37')][_0xf32e('0x38')],function(_0x4a775c){return{'name':_0x4a775c[_0xf32e('0x39')],'type':_0x4a775c[_0xf32e('0x3a')][_0xf32e('0x3b')]};});_0x40e82c[_0xf32e('0x3c')]=_[_0xf32e('0x30')](_0x4432de,'name');_0x40e82c[_0xf32e('0x3d')]=_[_0xf32e('0x3e')](_0x300013[_0xf32e('0x3d')]);_0x40e82c['filters']=_[_0xf32e('0x3f')](_0x40e82c['model'],_0x40e82c[_0xf32e('0x3d')]);_0x20d846[_0xf32e('0x40')]=_[_0xf32e('0x3f')](_0x40e82c['model'],qs[_0xf32e('0x41')](_0x300013[_0xf32e('0x3d')][_0xf32e('0x41')]));_0x20d846[_0xf32e('0x40')]=_0x20d846[_0xf32e('0x40')][_0xf32e('0x42')]?_0x20d846['attributes']:_0x40e82c[_0xf32e('0x3c')];if(!_0x300013[_0xf32e('0x3d')][_0xf32e('0x43')](_0xf32e('0x44'))){_0x20d846[_0xf32e('0x24')]=qs[_0xf32e('0x24')](_0x300013[_0xf32e('0x3d')]['limit']);_0x20d846[_0xf32e('0x23')]=qs[_0xf32e('0x23')](_0x300013[_0xf32e('0x3d')][_0xf32e('0x23')]);}_0x20d846[_0xf32e('0x45')]=qs[_0xf32e('0x46')](_0x300013[_0xf32e('0x3d')]['sort']);_0x20d846[_0xf32e('0x47')]=qs[_0xf32e('0x48')](_[_0xf32e('0x49')](_0x300013[_0xf32e('0x3d')],_0x40e82c[_0xf32e('0x48')]));var _0x453e24=[];var _0x1bff7b=squel[_0xf32e('0x4a')]()[_0xf32e('0x4b')]('id')[_0xf32e('0x4b')]('name')[_0xf32e('0x4b')](_0xf32e('0x4c'))[_0xf32e('0x4d')](_0xf32e('0x4e'));var _0x159dfd=squel[_0xf32e('0x4a')]()['field'](_0xf32e('0x4f'))[_0xf32e('0x4b')](_0xf32e('0x50'))[_0xf32e('0x4d')](_0xf32e('0x51'),'ui')['left_join'](_0xf32e('0x52'),'u','u.id\x20=\x20ui.UserId');var _0xd81744=squel[_0xf32e('0x4a')]()['from'](_0xf32e('0x53'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf32e('0x54')](_0xf32e('0x52'),'o',_0xf32e('0x55'))[_0xf32e('0x54')](_0xf32e('0x56'),'a',_0xf32e('0x57'))[_0xf32e('0x54')](_0xf32e('0x58'),'me',_0xf32e('0x59'))[_0xf32e('0x54')](_0xf32e('0x5a'),'it',_0xf32e('0x5b'))[_0xf32e('0x54')](_0xf32e('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x30b67c=squel[_0xf32e('0x5c')]();var _0xc83c9f=[];var _0x4b15be=squel['expr']();var _0x49e5a1;if(_0x300013[_0xf32e('0x3d')][_0xf32e('0x5d')]){_0x49e5a1=as['parseSearch'](_0x300013[_0xf32e('0x3d')][_0xf32e('0x5d')]);var _0x50d492=_0x49e5a1[_0xf32e('0x5e')];for(var _0x11ecb6=0x0;_0x11ecb6<_0x49e5a1[_0xf32e('0x5f')][_0xf32e('0x42')];_0x11ecb6++){var _0x2db8bc=_0x49e5a1[_0xf32e('0x5f')][_0x11ecb6];var _0x5ec996='i';var _0x412def=_[_0xf32e('0x60')](_0x4432de,[_0xf32e('0x2e'),_0x2db8bc['field']]);if(!_0x412def){switch(_0x2db8bc[_0xf32e('0x4b')]){case _0xf32e('0x61'):if(_0x2db8bc[_0xf32e('0x62')]==0x1){_0xd81744['having']('`'+_0x2db8bc['field']+'`\x20=\x200');}else{_0xd81744[_0xf32e('0x63')]('`'+_0x2db8bc[_0xf32e('0x4b')]+_0xf32e('0x64'));}break;case _0xf32e('0x65'):if(_0x2db8bc['operator']===_0xf32e('0x66')){if(_0x2db8bc[_0xf32e('0x62')][_0xf32e('0x32')]('\x20')[_0xf32e('0x42')]>0x1){_0x30b67c[_0x50d492](_0xf32e('0x67'),qs['getFullTextValue'](_0x2db8bc[_0xf32e('0x62')]),null);}else{var _0x24487f='%'+_0x2db8bc[_0xf32e('0x62')]+'%';_0x30b67c[_0x50d492](_0xf32e('0x68'),_0x24487f,_0x24487f,_0x24487f);}}else{_0x412def=_['find'](_0x4432de,[_0xf32e('0x2e'),'ContactId']);_0x2db8bc['field']=_0xf32e('0x69');_0x4cd47e=as[_0xf32e('0x6a')](_0x5ec996,_0x412def[_0xf32e('0x3a')],_0x2db8bc);_0x30b67c[_0x50d492](_0x4cd47e[_0xf32e('0x6b')],_0x4cd47e[_0xf32e('0x62')][_0xf32e('0x6c')],_0x4cd47e[_0xf32e('0x62')][_0xf32e('0x20')]);}break;case _0xf32e('0x6d'):var _0xd2b80a=_0x2db8bc[_0xf32e('0x62')][_0xf32e('0x32')](',')['map'](function(_0x5867f){return Number(_0x5867f);});_0xd2b80a['forEach'](function(_0x3ae9df){_0x4b15be['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3ae9df+',%');});_0xc83c9f=_[_0xf32e('0x6e')](_0xc83c9f,_0xd2b80a);break;case _0xf32e('0x6f'):if(_0x2db8bc[_0xf32e('0x70')]==='$substring'){_0x30b67c[_0x50d492](_0xf32e('0x71'),'%'+_0x2db8bc[_0xf32e('0x62')]+'%',null);}else{_0x412def=_['find'](_0x4432de,['name','UserId']);_0x2db8bc[_0xf32e('0x4b')]=_0xf32e('0x72');_0x4cd47e=as[_0xf32e('0x6a')](_0x5ec996,_0x412def[_0xf32e('0x3a')],_0x2db8bc);_0x30b67c[_0x50d492](_0x4cd47e[_0xf32e('0x6b')],_0x4cd47e[_0xf32e('0x62')]['start'],_0x4cd47e[_0xf32e('0x62')]['end']);}break;case _0xf32e('0x73'):_0x4cd47e=as[_0xf32e('0x6a')]('me',null,_0x2db8bc);_0x30b67c[_0x50d492](_0x4cd47e[_0xf32e('0x6b')],_0x4cd47e[_0xf32e('0x62')]['start'],_0x4cd47e[_0xf32e('0x62')][_0xf32e('0x20')]);break;}}else{var _0x4cd47e=as[_0xf32e('0x6a')](_0x5ec996,_0x412def['type'],_0x2db8bc);_0x30b67c[_0x50d492](_0x4cd47e[_0xf32e('0x6b')],_0x4cd47e[_0xf32e('0x62')][_0xf32e('0x6c')],_0x4cd47e[_0xf32e('0x62')][_0xf32e('0x20')]);}}}else{var _0x57bf56=_(_0x300013[_0xf32e('0x3d')])[_0xf32e('0x3e')]()[_0xf32e('0x30')](function(_0x30bdbe){return _['some'](_0x4432de,[_0xf32e('0x2e'),_0x30bdbe])?_0x30bdbe:undefined;})[_0xf32e('0x74')]()[_0xf32e('0x62')]();if(!_['isEmpty'](_0x57bf56)){_0x57bf56[_0xf32e('0x33')](function(_0x4c8b4b){if(_0x4c8b4b===_0xf32e('0x75')){_0xd81744[_0xf32e('0x47')](_0xf32e('0x76'),[][_0xf32e('0x77')](_0x300013[_0xf32e('0x3d')][_0x4c8b4b]));}else if(_0x4c8b4b===_0xf32e('0x78')){var _0x2239db=JSON[_0xf32e('0x79')](_0x300013[_0xf32e('0x3d')][_0x4c8b4b])[_0xf32e('0x7a')];var _0x435509=JSON['parse'](_0x300013[_0xf32e('0x3d')][_0x4c8b4b])[_0xf32e('0x7b')];_0xd81744[_0xf32e('0x47')](_0xf32e('0x7c'),_0x2239db,_0x435509);}else{if(_0x300013['query'][_0x4c8b4b]==='null'){_0xd81744['where']('i.'+_0x4c8b4b+'\x20IS\x20NULL');}else{_0xd81744[_0xf32e('0x47')]('i.'+_0x4c8b4b+_0xf32e('0x7d'),_0x300013[_0xf32e('0x3d')][_0x4c8b4b]);}}});}if(_0x300013[_0xf32e('0x3d')][_0xf32e('0x7e')]){if(_0x300013[_0xf32e('0x3d')]['read']==0x1){_0xd81744[_0xf32e('0x63')](_0xf32e('0x7f'));}else{_0xd81744[_0xf32e('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x300013['query']['tag']){_0xc83c9f=_['isArray'](_0x300013[_0xf32e('0x3d')][_0xf32e('0x80')])?_0x300013[_0xf32e('0x3d')][_0xf32e('0x80')]:new Array(_0x300013['query'][_0xf32e('0x80')]);_0xc83c9f[_0xf32e('0x33')](function(_0x30fbbd){_0x4b15be['or'](_0xf32e('0x81'),'%,'+_0x30fbbd+',%');});}if(_0x300013['query'][_0xf32e('0x82')]){var _0x15644c=_0x300013[_0xf32e('0x3d')][_0xf32e('0x82')][_0xf32e('0x83')]('\x5c','\x5c\x5c')[_0xf32e('0x83')]('\x27\x27',_0xf32e('0x84'));if(qs['isNumeric'](_0x15644c)){_0x30b67c['or']('i.id\x20LIKE\x20?',_0x15644c+'%');}else{_0x30b67c['or'](_0xf32e('0x85'),qs[_0xf32e('0x86')](_0x15644c))['or'](_0xf32e('0x87'),_0x15644c+'%')['or'](_0xf32e('0x88'),_0x15644c+'%');}}}_0xd81744[_0xf32e('0x47')](_0x30b67c);_0xd81744[_0xf32e('0x89')](_0xf32e('0x8a'));var _0x509b9f={'type':db[_0xf32e('0x8b')][_0xf32e('0x8c')][_0xf32e('0x8d')],'raw':!![]};var _0x317b44=_0xd81744['clone']();_0x317b44[_0xf32e('0x4b')](_0xf32e('0x8a'));_0x317b44[_0xf32e('0x4b')](_0xf32e('0x8e'),'unreadMessages');if(_0x20d846[_0xf32e('0x45')]){_0x20d846[_0xf32e('0x45')][_0xf32e('0x33')](function(_0xe67bf1){_0xd81744[_0xf32e('0x45')]('i.'+_0xe67bf1[0x0],_0xe67bf1[0x1]===_0xf32e('0x8f')?![]:!![]);});}if(!_[_0xf32e('0x90')](_0xc83c9f)){_0xd81744['having'](_0x4b15be);_0x317b44[_0xf32e('0x47')](_0xf32e('0x91'),_0xc83c9f);}BPromise[_0xf32e('0x92')]()[_0xf32e('0x2a')](function(){if(!_0x49e5a1)return;return _0x300013['user'][_0xf32e('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1a446e){_0x317b44[_0xf32e('0x47')](_0xf32e('0x76'),_[_0xf32e('0x30')](_0x1a446e,'id'));_0xd81744[_0xf32e('0x47')](_0xf32e('0x76'),_[_0xf32e('0x30')](_0x1a446e,'id'));});})['then'](function(){db[_0xf32e('0x94')]['query'](_0x317b44[_0xf32e('0x95')](),_0x509b9f)[_0xf32e('0x2a')](function(_0x396a73){_0x47fcf9[_0xf32e('0x22')]=_0x396a73[_0xf32e('0x42')];if(_0x47fcf9[_0xf32e('0x22')]===0x0)return[];return db[_0xf32e('0x94')][_0xf32e('0x3d')](_0x1bff7b[_0xf32e('0x95')](),_0x509b9f)['then'](function(_0x539a70){_0x453e24=_['keyBy'](_0x539a70,'id');_0x509b9f=_['merge'](_0x509b9f,{'model':db[_0xf32e('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xd81744[_0xf32e('0x4b')](_0xf32e('0x8e'),'unreadMessages');_0xd81744[_0xf32e('0x4b')](_0xf32e('0x96'),_0xf32e('0x97'));_0xd81744[_0xf32e('0x4b')](_0xf32e('0x98'),'Account.mandatoryDisposition');_0xd81744['field'](_0xf32e('0x99'));_0xd81744[_0xf32e('0x4b')](_0xf32e('0x9a'),_0xf32e('0x9b'));_0xd81744['field'](_0xf32e('0x9c'),'Contact.lastName');_0xd81744[_0xf32e('0x4b')]('c.email',_0xf32e('0x9d'));_0xd81744[_0xf32e('0x4b')](_0xf32e('0x9e'),_0xf32e('0x9f'));_0xd81744[_0xf32e('0x4b')](_0xf32e('0xa0'),_0xf32e('0xa1'));_0xd81744['field'](_0xf32e('0xa2'),_0xf32e('0xa3'));_0xd81744['field'](_0xf32e('0xa4'),_0xf32e('0x31'));_0xd81744[_0xf32e('0x24')](_0x20d846[_0xf32e('0x24')]);_0xd81744['offset'](_0x20d846['offset']);return db[_0xf32e('0x94')][_0xf32e('0x3d')](_0xd81744[_0xf32e('0x95')](),_0x509b9f);})[_0xf32e('0x2a')](function(_0x2c5abe){_0x159dfd[_0xf32e('0x47')](_0xf32e('0xa5'),_['map'](_0x2c5abe,'id'));return db[_0xf32e('0x94')][_0xf32e('0x3d')](_0x159dfd[_0xf32e('0x95')](),_0x509b9f)['then'](function(_0x3499a4){var _0x4e55c2=_['groupBy'](_0x3499a4,_0xf32e('0xa6'));var _0x1ac801=[];_0x2c5abe[_0xf32e('0x33')](function(_0x279a60){_0x1ac801[_0xf32e('0x35')](updateOpenchannelInteraction(_0x279a60,_0x453e24,_0x4e55c2));});return BPromise[_0xf32e('0xa7')](_0x1ac801);});});})[_0xf32e('0x2a')](function(_0x19036c){_0x47fcf9[_0xf32e('0xa8')]=_0x19036c;return _0x47fcf9;})[_0xf32e('0x2a')](respondWithFilteredResult(_0x37231c,_0x20d846));})[_0xf32e('0xa9')](handleError(_0x37231c,null));};exports[_0xf32e('0xaa')]=function(_0x5557c9,_0x1edc70){var _0x2b8ea1={'raw':![],'where':{'id':_0x5557c9[_0xf32e('0xab')]['id']}},_0x35f8e3={};_0x35f8e3[_0xf32e('0x3c')]=_[_0xf32e('0x3e')](db[_0xf32e('0x37')][_0xf32e('0x38')]);_0x35f8e3['query']=_[_0xf32e('0x3e')](_0x5557c9[_0xf32e('0x3d')]);_0x35f8e3[_0xf32e('0x48')]=_[_0xf32e('0x3f')](_0x35f8e3['model'],_0x35f8e3[_0xf32e('0x3d')]);_0x2b8ea1[_0xf32e('0x40')]=_[_0xf32e('0x3f')](_0x35f8e3[_0xf32e('0x3c')],qs['fields'](_0x5557c9['query'][_0xf32e('0x41')]));_0x2b8ea1[_0xf32e('0x40')]=_0x2b8ea1[_0xf32e('0x40')][_0xf32e('0x42')]?_0x2b8ea1['attributes']:_0x35f8e3['model'];if(_0x5557c9[_0xf32e('0x3d')]['includeAll']){_0x2b8ea1[_0xf32e('0xac')]=[{'all':!![]}];}_0x2b8ea1=_['merge']({},_0x2b8ea1,_0x5557c9['options']);return db[_0xf32e('0x37')]['find'](_0x2b8ea1)['then'](handleEntityNotFound(_0x1edc70,null))[_0xf32e('0x2a')](respondWithResult(_0x1edc70,null))['catch'](handleError(_0x1edc70,null));};exports[_0xf32e('0xad')]=function(_0x5ee2ca,_0x37dda6){return db['OpenchannelInteraction'][_0xf32e('0xad')](_0x5ee2ca[_0xf32e('0x73')],{})[_0xf32e('0x2a')](respondWithResult(_0x37dda6,0xc9))[_0xf32e('0xa9')](handleError(_0x37dda6,null));};exports[_0xf32e('0x29')]=function(_0x21f75b,_0x2e1371){if(_0x21f75b['body']['id']){delete _0x21f75b[_0xf32e('0x73')]['id'];}return db[_0xf32e('0x37')]['find']({'where':{'id':_0x21f75b[_0xf32e('0xab')]['id']}})['then'](handleEntityNotFound(_0x2e1371,null))[_0xf32e('0x2a')](saveUpdates(_0x21f75b[_0xf32e('0x73')],null))[_0xf32e('0x2a')](respondWithResult(_0x2e1371,null))[_0xf32e('0xa9')](handleError(_0x2e1371,null));};exports['destroy']=function(_0x5168fa,_0x3b05bc){return db[_0xf32e('0x37')][_0xf32e('0x60')]({'where':{'id':_0x5168fa['params']['id']}})[_0xf32e('0x2a')](handleEntityNotFound(_0x3b05bc,null))[_0xf32e('0x2a')](removeEntity(_0x3b05bc,null))[_0xf32e('0xa9')](handleError(_0x3b05bc,null));};exports[_0xf32e('0xae')]=function(_0x9189b2,_0x5bf533){return db[_0xf32e('0x37')][_0xf32e('0xae')]()[_0xf32e('0x2a')](respondWithResult(_0x5bf533,null))[_0xf32e('0xa9')](handleError(_0x5bf533,null));};exports[_0xf32e('0xaf')]=function(_0x222d3a,_0x405189,_0x1a618a){return db[_0xf32e('0xb0')][_0xf32e('0x60')]({'where':{'id':_0x222d3a[_0xf32e('0xab')]['id']}})[_0xf32e('0x2a')](handleEntityNotFound(_0x405189,null))['then'](function(_0x1491c0){if(_0x1491c0){return _0x1491c0['addMessage'](_0x222d3a[_0xf32e('0x73')][_0xf32e('0xb1')],_[_0xf32e('0xb2')](_0x222d3a[_0xf32e('0x73')],[_0xf32e('0xb1'),'id'])||{});}})[_0xf32e('0x2a')](respondWithResult(_0x405189,null))[_0xf32e('0xa9')](handleError(_0x405189,null));};exports[_0xf32e('0xb3')]=function(_0x403a51,_0x5e9a68,_0x491dfe){var _0x329e69={'raw':![],'where':{}};var _0x397518={};var _0x3addcf={'count':0x0,'rows':[]};return db[_0xf32e('0x37')][_0xf32e('0xb4')]({'where':{'id':_0x403a51[_0xf32e('0xab')]['id']}})['then'](handleEntityNotFound(_0x5e9a68,null))[_0xf32e('0x2a')](function(_0x2c3e4f){if(_0x2c3e4f){_0x397518[_0xf32e('0x3c')]=_[_0xf32e('0x3e')](db['OpenchannelMessage'][_0xf32e('0x38')]);_0x397518['query']=_[_0xf32e('0x3e')](_0x403a51[_0xf32e('0x3d')]);_0x397518['filters']=_[_0xf32e('0x3f')](_0x397518[_0xf32e('0x3c')],_0x397518['query']);_0x329e69[_0xf32e('0x40')]=_[_0xf32e('0x3f')](_0x397518['model'],qs['fields'](_0x403a51['query'][_0xf32e('0x41')]));_0x329e69[_0xf32e('0x40')]=_0x329e69[_0xf32e('0x40')][_0xf32e('0x42')]?_0x329e69[_0xf32e('0x40')]:_0x397518[_0xf32e('0x3c')];if(!_0x403a51['query']['hasOwnProperty']('nolimit')){_0x329e69[_0xf32e('0x24')]=qs[_0xf32e('0x24')](_0x403a51[_0xf32e('0x3d')][_0xf32e('0x24')]);_0x329e69['offset']=qs[_0xf32e('0x23')](_0x403a51[_0xf32e('0x3d')][_0xf32e('0x23')]);}_0x329e69[_0xf32e('0x45')]=qs[_0xf32e('0x46')](_0x403a51[_0xf32e('0x3d')][_0xf32e('0x46')]);_0x329e69[_0xf32e('0x47')]=qs[_0xf32e('0x48')](_[_0xf32e('0x49')](_0x403a51[_0xf32e('0x3d')],_0x397518[_0xf32e('0x48')]));_0x329e69[_0xf32e('0x47')]['OpenchannelInteractionId']=_0x2c3e4f['id'];if(_0x403a51[_0xf32e('0x3d')][_0xf32e('0x82')]){_0x329e69['where']=_['merge'](_0x329e69[_0xf32e('0x47')],{'$or':_['map'](_0x329e69[_0xf32e('0x40')],function(_0x14a167){var _0x5f2973={};_0x5f2973[_0x14a167]={'$like':'%'+_0x403a51[_0xf32e('0x3d')][_0xf32e('0x82')]+'%'};return _0x5f2973;})});}if(_0x403a51[_0xf32e('0x3d')][_0xf32e('0x7a')]){var _0x5916ab=_0x403a51[_0xf32e('0x3d')]['$gte'][_0xf32e('0x32')](',');var _0x2f0d5d={};_0x2f0d5d[_0x5916ab[0x0]]={'$gte':moment(_0x5916ab[0x1])[_0xf32e('0xb5')](_0xf32e('0xb6'))};_0x329e69[_0xf32e('0x47')]=_[_0xf32e('0xb7')](_0x329e69[_0xf32e('0x47')],_0x2f0d5d);}_0x329e69=_[_0xf32e('0xb7')]({},_0x329e69,_0x403a51[_0xf32e('0xb8')]);return db['OpenchannelMessage'][_0xf32e('0x22')]({'where':_0x329e69[_0xf32e('0x47')]})[_0xf32e('0x2a')](function(_0xf2c668){_0x3addcf[_0xf32e('0x22')]=_0xf2c668;if(_0x403a51[_0xf32e('0x3d')][_0xf32e('0xb9')]){_0x329e69[_0xf32e('0xac')]=[{'all':!![]}];}return db[_0xf32e('0xb0')]['findAll'](_0x329e69);})[_0xf32e('0x2a')](function(_0x1f6bc1){_0x3addcf[_0xf32e('0xa8')]=_0x1f6bc1;return _0x3addcf;});}})[_0xf32e('0x2a')](respondWithFilteredResult(_0x5e9a68,_0x329e69))[_0xf32e('0xa9')](handleError(_0x5e9a68,null));};exports[_0xf32e('0xba')]=function(_0x4864c7,_0x296747,_0x274275){return db[_0xf32e('0x37')]['find']({'where':{'id':_0x4864c7[_0xf32e('0xab')]['id']}})[_0xf32e('0x2a')](handleEntityNotFound(_0x296747,null))['then'](function(_0x5942e1){if(_0x5942e1){return _0x5942e1[_0xf32e('0xbb')](_0x4864c7['body'][_0xf32e('0xb1')],_[_0xf32e('0xb2')](_0x4864c7['body'],[_0xf32e('0xb1'),'id'])||{})['spread'](function(){return db['Tag'][_0xf32e('0xbc')]({'attributes':['id',_0xf32e('0x2e'),_0xf32e('0x4c')],'where':{'id':_0x4864c7['body'][_0xf32e('0xb1')]}});})['then'](function(_0x24a930){socket[_0xf32e('0xbd')](_0xf32e('0xbe'),{'id':Number(_0x4864c7[_0xf32e('0xab')]['id']),'tags':_0x24a930||[]});return{'id':Number(_0x4864c7['params']['id']),'tags':_0x24a930||[]};});}})[_0xf32e('0x2a')](respondWithResult(_0x296747,null))[_0xf32e('0xa9')](handleError(_0x296747,null));};exports[_0xf32e('0xbf')]=function(_0x285e9f,_0x3e0798,_0x53031e){return db['OpenchannelInteraction'][_0xf32e('0x60')]({'where':{'id':_0x285e9f[_0xf32e('0xab')]['id']}})[_0xf32e('0x2a')](handleEntityNotFound(_0x3e0798,null))['then'](function(_0x4e2a0a){if(_0x4e2a0a){return _0x4e2a0a[_0xf32e('0xbf')](_0x285e9f[_0xf32e('0x3d')][_0xf32e('0xb1')]);}})[_0xf32e('0x2a')](respondWithStatusCode(_0x3e0798,null))['catch'](handleError(_0x3e0798,null));};exports[_0xf32e('0xc0')]=function(_0x23cbb5,_0x253dd9){var _0x38deeb=moment()[_0xf32e('0xc1')]()[_0xf32e('0x95')]();var _0x11a4fc=path[_0xf32e('0xc2')](config['root'],_0xf32e('0xc3'),_0xf32e('0xc4'),_0xf32e('0xc5'));var _0x471a4f=path[_0xf32e('0xc2')](config[_0xf32e('0xc6')],_0xf32e('0xc3'),_0xf32e('0xc4'),_0xf32e('0xc7'));var _0x462595=path[_0xf32e('0xc2')](_0x11a4fc,_0x38deeb);var _0x37d2a1=util[_0xf32e('0xb5')](_0xf32e('0xc8'),_0x23cbb5['params']['id'],_0x38deeb);var _0x35ca3f=path[_0xf32e('0xc2')](_0x11a4fc,_0x37d2a1);var _0x896755=![];return db[_0xf32e('0x37')][_0xf32e('0x60')]({'where':{'id':_0x23cbb5[_0xf32e('0xab')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0xf32e('0xc9'),'attributes':['id',_0xf32e('0x73'),_0xf32e('0x78'),'direction','secret',_0xf32e('0x7e')],'include':[{'model':db[_0xf32e('0x6f')],'as':_0xf32e('0x6f'),'attributes':['id',_0xf32e('0xca')],'raw':!![]},{'model':db['CmContact'],'as':'Contact','attributes':['id',_0xf32e('0xcb'),_0xf32e('0xcc')],'raw':!![]},{'model':db['Attachment'],'as':_0xf32e('0xcd'),'raw':!![]}]},{'model':db[_0xf32e('0xce')],'as':'Account','attributes':['id',_0xf32e('0x2e')]},{'model':db[_0xf32e('0x6f')],'as':_0xf32e('0xcf'),'attributes':['id',_0xf32e('0xca')]}]})['then'](handleEntityNotFound(_0x253dd9,null))['then'](function(_0x48a1f6){if(_0x48a1f6){var _0x3049ef=_0x48a1f6[_0xf32e('0xd0')]({'plain':!![]});_0x896755=!![];var _0x5a2362={'format':'A4','border':_0xf32e('0xd1'),'header':{'height':_0xf32e('0xd2'),'contents':{'first':_0xf32e('0xd3')}},'footer':{'height':_0xf32e('0xd4'),'contents':{'default':util['format']('\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[_0xf32e('0xb5')]('%s\x20#%d',_0xf32e('0xd5'),_0x3049ef['id']),moment()[_0xf32e('0xb5')]('YYYY-MM-DD')['toString']())}}};fs[_0xf32e('0xd6')](_0x462595);var _0x392d0f={'channel':_0xf32e('0xd5'),'account':_0x3049ef['Account']['name'],'agent':_0x3049ef[_0xf32e('0xcf')]?_0x3049ef['Owner']['fullname']:'N.A.','createdAt':moment(_0x3049ef['createdAt'])[_0xf32e('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf32e('0x95')](),'closedAt':_0x3049ef['closed']?moment(_0x3049ef[_0xf32e('0xd7')])[_0xf32e('0xb5')](_0xf32e('0xb6'))[_0xf32e('0x95')]():'','disposition':_0x3049ef[_0xf32e('0xd8')],'visibility':_0x3049ef[_0xf32e('0xd9')]?'Public':_0xf32e('0xda'),'messages':_(_0x3049ef[_0xf32e('0xc9')])['filter']({'secret':![]})[_0xf32e('0x30')](function(_0x3c17f1){if(_0x3c17f1[_0xf32e('0xcd')]){var _0x37e290=path[_0xf32e('0xc2')](_0x471a4f,_0x3c17f1[_0xf32e('0xcd')][_0xf32e('0xdb')]);if(fs['existsSync'](_0x37e290)){fs['createReadStream'](_0x37e290)[_0xf32e('0xdc')](fs[_0xf32e('0xdd')](path[_0xf32e('0xc2')](_0x462595,_0x3c17f1[_0xf32e('0xcd')][_0xf32e('0xdb')])));}}return{'date':moment(_0x3c17f1['createdAt'])[_0xf32e('0xb5')](_0xf32e('0xb6'))[_0xf32e('0x95')](),'sender':_0x3c17f1['direction']===_0xf32e('0xde')?_0x3c17f1[_0xf32e('0x6f')]?_0x3c17f1[_0xf32e('0x6f')][_0xf32e('0xca')]:_0xf32e('0xdf'):_0x3c17f1[_0xf32e('0x65')][_0xf32e('0xcb')]+(_0x3c17f1[_0xf32e('0x65')][_0xf32e('0xcc')]?'\x20'+_0x3c17f1['Contact'][_0xf32e('0xcc')]:''),'body':_0x3c17f1['Attachment']?_0x3c17f1[_0xf32e('0xcd')]['basename']:_0x3c17f1['body'],'direction':_0x3c17f1[_0xf32e('0xe0')]===_0xf32e('0xde')?'A':'C','secret':_0x3c17f1[_0xf32e('0xe1')],'read':_0x3c17f1[_0xf32e('0x7e')],'attachment':_0x3c17f1[_0xf32e('0xcd')]};})[_0xf32e('0x62')]()};return ejs[_0xf32e('0xe2')](path[_0xf32e('0xc2')](config[_0xf32e('0xc6')],'server',_0xf32e('0xe3'),_0xf32e('0xe4')),{'interaction':_0x392d0f})[_0xf32e('0x2a')](function(_0x1de678){return new BPromise(function(_0x24c40a,_0x1ebd0b){pdf[_0xf32e('0xad')](_0x1de678,_0x5a2362)['toFile'](path[_0xf32e('0xc2')](_0x462595,'transcript-'+_0x3049ef['id']+'-'+_0x38deeb+'.pdf'),function(_0x354b7e,_0x575da2){if(_0x354b7e)return _0x1ebd0b(_0x354b7e);_0x24c40a(_0x575da2);});});});}})['then'](function(){if(_0x896755){return new BPromise(function(_0x33a7f5,_0x4fd23f){zipdir(_0x462595,{'saveTo':_0x35ca3f},function(_0x2d2571,_0x56cc07){if(_0x2d2571)return _0x4fd23f(_0x2d2571);return _0x33a7f5(_0x56cc07);});})[_0xf32e('0x2a')](function(){return new BPromise(function(_0x4348d5,_0x176dc5){rimraf(_0x462595,function(_0x18ff53){if(_0x18ff53)_0x176dc5(_0x18ff53);return _0x4348d5();});});})[_0xf32e('0x2a')](function(){return _0x253dd9[_0xf32e('0xc0')](_0x35ca3f,_0x37d2a1,function(_0xca53a9){if(_0xca53a9){console[_0xf32e('0xe5')](_0xf32e('0xe6'),_0xca53a9);}else{fs['unlinkSync'](_0x35ca3f);}});});}else{return _0x253dd9['sendStatus'](0xc8);}})[_0xf32e('0xa9')](handleError(_0x253dd9,null));}; \ No newline at end of file +var _0x55a5=['pipe','createWriteStream','direction','out','System','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./openchannelInteraction.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','Users','map','TagIds','split','Tags','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','forEach','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','getOpenchannelAccounts','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','show','params','includeAll','include','options','create','destroy','addMessage','OpenchannelMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Messages','secret','fullname','CmContact','firstName','lastName','Attachment','OpenchannelAccount','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','Openchannel','YYYY-MM-DD','mkdirSync','Owner','N.A.','closed','closedAt','disposition','Public','basename'];(function(_0x4cea31,_0x54ef05){var _0x30bf16=function(_0x1530a7){while(--_0x1530a7){_0x4cea31['push'](_0x4cea31['shift']());}};_0x30bf16(++_0x54ef05);}(_0x55a5,0xf7));var _0x555a=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0x55a5[_0xc8a11];return _0x55a500;};'use strict';var pdf=require(_0x555a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x555a('0x1'));var zipdir=require(_0x555a('0x2'));var jsonpatch=require(_0x555a('0x3'));var rp=require(_0x555a('0x4'));var moment=require(_0x555a('0x5'));var BPromise=require(_0x555a('0x6'));var Mustache=require(_0x555a('0x7'));var util=require(_0x555a('0x8'));var path=require(_0x555a('0x9'));var sox=require(_0x555a('0xa'));var csv=require(_0x555a('0xb'));var ejs=require(_0x555a('0xc'));var fs=require('fs');var _=require(_0x555a('0xd'));var squel=require(_0x555a('0xe'));var crypto=require(_0x555a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x555a('0x10'));var toCsv=require(_0x555a('0xb'));var querystring=require(_0x555a('0x11'));var Papa=require(_0x555a('0x12'));var Redis=require(_0x555a('0x13'));var authService=require(_0x555a('0x14'));var qs=require(_0x555a('0x15'));var as=require(_0x555a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x555a('0x17'))(_0x555a('0x18'));var utils=require(_0x555a('0x19'));var config=require(_0x555a('0x1a'));var db=require(_0x555a('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x555a('0x1c'))(new Redis(config[_0x555a('0x1d')]));require(_0x555a('0x1e'))[_0x555a('0x1f')](socket);function respondWithStatusCode(_0x1c5016,_0x39a30e){_0x39a30e=_0x39a30e||0xcc;return function(_0x3fe691){if(_0x3fe691){return _0x1c5016[_0x555a('0x20')](_0x39a30e);}return _0x1c5016['status'](_0x39a30e)['end']();};}function respondWithResult(_0x503e51,_0x1532b4){_0x1532b4=_0x1532b4||0xc8;return function(_0x411605){if(_0x411605){return _0x503e51[_0x555a('0x21')](_0x1532b4)['json'](_0x411605);}};}function respondWithFilteredResult(_0x175005,_0x350b7a){return function(_0x1add3b){if(_0x1add3b){var _0x59e2e4=_0x1add3b[_0x555a('0x22')],_0x19e556=_0x350b7a[_0x555a('0x23')],_0x4f475a=_0x350b7a[_0x555a('0x23')]+_0x350b7a[_0x555a('0x24')],_0x8d9ff8;if(_0x4f475a>=_0x59e2e4){_0x4f475a=_0x59e2e4;_0x8d9ff8=0xc8;}else{_0x8d9ff8=0xce;}_0x175005[_0x555a('0x21')](_0x8d9ff8);return _0x175005[_0x555a('0x25')](_0x555a('0x26'),_0x19e556+'-'+_0x4f475a+'/'+_0x59e2e4)['json'](_0x1add3b);}return null;};}function patchUpdates(_0x441c55){return function(_0x2ca56a){try{jsonpatch[_0x555a('0x27')](_0x2ca56a,_0x441c55,!![]);}catch(_0x55116b){return BPromise[_0x555a('0x28')](_0x55116b);}return _0x2ca56a[_0x555a('0x29')]();};}function saveUpdates(_0x4d0ecf,_0x44f756){return function(_0x22b0d6){if(_0x22b0d6){return _0x22b0d6[_0x555a('0x2a')](_0x4d0ecf)[_0x555a('0x2b')](function(_0x1e6328){return _0x1e6328;});}return null;};}function removeEntity(_0x2f7a93,_0x32a465){return function(_0xf0d7ed){if(_0xf0d7ed){return _0xf0d7ed['destroy']()[_0x555a('0x2b')](function(){_0x2f7a93[_0x555a('0x21')](0xcc)[_0x555a('0x2c')]();});}};}function handleEntityNotFound(_0x2b84a2,_0x10e884){return function(_0x8f98dc){if(!_0x8f98dc){_0x2b84a2['sendStatus'](0x194);}return _0x8f98dc;};}function handleError(_0x5e11bb,_0x41ecd4){_0x41ecd4=_0x41ecd4||0x1f4;return function(_0x2dab06){logger[_0x555a('0x2d')](_0x2dab06[_0x555a('0x2e')]);if(_0x2dab06[_0x555a('0x2f')]){delete _0x2dab06[_0x555a('0x2f')];}_0x5e11bb['status'](_0x41ecd4)['send'](_0x2dab06);};}function getInteractionUsers(_0x59d3ee,_0x4318f1){return new BPromise(function(_0x28c2d6,_0x23d509){try{if(_0x4318f1[_0x59d3ee['id']]){_0x59d3ee[_0x555a('0x30')]=_[_0x555a('0x31')](_0x4318f1[_0x59d3ee['id']],function(_0x2cb3dc){return{'id':_0x2cb3dc['id']};});}}catch(_0x3c4f1f){_0x23d509(_0x3c4f1f);}_0x28c2d6(_0x59d3ee);});}function getInteractionTags(_0x5d42c1,_0x4010c0){return new BPromise(function(_0x2eec60,_0x4ae051){try{if(_0x5d42c1['TagIds']){_0x5d42c1['Tags']=[];_0x5d42c1[_0x555a('0x32')][_0x555a('0x33')](',')['forEach'](function(_0x557aee){_0x5d42c1[_0x555a('0x34')][_0x555a('0x35')](_0x4010c0[_0x557aee]);});}delete _0x5d42c1[_0x555a('0x32')];}catch(_0x27aaf8){_0x4ae051(_0x27aaf8);}_0x2eec60(_0x5d42c1);});}function updateOpenchannelInteraction(_0x4c781e,_0x408148,_0x3adc9c){return new BPromise(function(_0x36dfd0,_0x5eac77){return getInteractionUsers(_0x4c781e,_0x3adc9c)[_0x555a('0x2b')](function(_0x40947e){return getInteractionTags(_0x40947e,_0x408148);})[_0x555a('0x2b')](function(_0x3187e2){_0x36dfd0(_0x3187e2);})[_0x555a('0x36')](function(_0x1f2f8d){_0x5eac77(_0x1f2f8d);});});}exports[_0x555a('0x37')]=function(_0x638136,_0x281c7a){var _0x4bbd78={},_0x152409={},_0x28aac4={'count':0x0,'rows':[]};var _0x5963c3=_['map'](db['OpenchannelInteraction'][_0x555a('0x38')],function(_0x160021){return{'name':_0x160021[_0x555a('0x39')],'type':_0x160021[_0x555a('0x3a')][_0x555a('0x3b')]};});_0x152409[_0x555a('0x3c')]=_['map'](_0x5963c3,'name');_0x152409[_0x555a('0x3d')]=_[_0x555a('0x3e')](_0x638136[_0x555a('0x3d')]);_0x152409[_0x555a('0x3f')]=_[_0x555a('0x40')](_0x152409[_0x555a('0x3c')],_0x152409['query']);_0x4bbd78[_0x555a('0x41')]=_[_0x555a('0x40')](_0x152409['model'],qs[_0x555a('0x42')](_0x638136[_0x555a('0x3d')][_0x555a('0x42')]));_0x4bbd78[_0x555a('0x41')]=_0x4bbd78[_0x555a('0x41')][_0x555a('0x43')]?_0x4bbd78[_0x555a('0x41')]:_0x152409[_0x555a('0x3c')];if(!_0x638136['query'][_0x555a('0x44')](_0x555a('0x45'))){_0x4bbd78['limit']=qs[_0x555a('0x24')](_0x638136[_0x555a('0x3d')][_0x555a('0x24')]);_0x4bbd78['offset']=qs[_0x555a('0x23')](_0x638136[_0x555a('0x3d')][_0x555a('0x23')]);}_0x4bbd78[_0x555a('0x46')]=qs[_0x555a('0x47')](_0x638136['query'][_0x555a('0x47')]);_0x4bbd78[_0x555a('0x48')]=qs[_0x555a('0x3f')](_[_0x555a('0x49')](_0x638136[_0x555a('0x3d')],_0x152409['filters']));var _0x219ad3=[];var _0x45d4c2=squel[_0x555a('0x4a')]()[_0x555a('0x4b')]('id')[_0x555a('0x4b')](_0x555a('0x2f'))[_0x555a('0x4b')](_0x555a('0x4c'))[_0x555a('0x4d')]('tools_tags');var _0x2e51a9=squel[_0x555a('0x4a')]()['field'](_0x555a('0x4e'))[_0x555a('0x4b')](_0x555a('0x4f'))[_0x555a('0x4d')](_0x555a('0x50'),'ui')[_0x555a('0x51')](_0x555a('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x595395=squel[_0x555a('0x4a')]()[_0x555a('0x4d')](_0x555a('0x53'),'i')[_0x555a('0x51')]('cm_contacts','c',_0x555a('0x54'))[_0x555a('0x51')](_0x555a('0x52'),'o',_0x555a('0x55'))[_0x555a('0x51')](_0x555a('0x56'),'a',_0x555a('0x57'))['left_join']('openchannel_messages','me',_0x555a('0x58'))['left_join']('openchannel_interaction_has_tags','it',_0x555a('0x59'))['left_join'](_0x555a('0x5a'),'t',_0x555a('0x5b'));var _0x588306=squel[_0x555a('0x5c')]();var _0x4517b3=[];var _0x27fa27=squel[_0x555a('0x5c')]();var _0x441116;if(_0x638136[_0x555a('0x3d')][_0x555a('0x5d')]){_0x441116=as[_0x555a('0x5e')](_0x638136['query'][_0x555a('0x5d')]);var _0x5299fa=_0x441116[_0x555a('0x5f')];for(var _0x1c07f0=0x0;_0x1c07f0<_0x441116['conditions'][_0x555a('0x43')];_0x1c07f0++){var _0x35b475=_0x441116[_0x555a('0x60')][_0x1c07f0];var _0x517e66='i';var _0x4e6720=_['find'](_0x5963c3,[_0x555a('0x2f'),_0x35b475[_0x555a('0x4b')]]);if(!_0x4e6720){switch(_0x35b475['field']){case _0x555a('0x61'):if(_0x35b475[_0x555a('0x62')]==0x1){_0x595395[_0x555a('0x63')]('`'+_0x35b475[_0x555a('0x4b')]+'`\x20=\x200');}else{_0x595395['having']('`'+_0x35b475['field']+_0x555a('0x64'));}break;case _0x555a('0x65'):if(_0x35b475['operator']==='$substring'){if(_0x35b475['value'][_0x555a('0x33')]('\x20')[_0x555a('0x43')]>0x1){_0x588306[_0x5299fa](_0x555a('0x66'),qs['getFullTextValue'](_0x35b475['value']),null);}else{var _0x24a83c='%'+_0x35b475[_0x555a('0x62')]+'%';_0x588306[_0x5299fa](_0x555a('0x67'),_0x24a83c,_0x24a83c,_0x24a83c);}}else{_0x4e6720=_[_0x555a('0x68')](_0x5963c3,[_0x555a('0x2f'),'ContactId']);_0x35b475[_0x555a('0x4b')]=_0x555a('0x69');_0x59219c=as[_0x555a('0x6a')](_0x517e66,_0x4e6720[_0x555a('0x3a')],_0x35b475);_0x588306[_0x5299fa](_0x59219c['text'],_0x59219c['value'][_0x555a('0x6b')],_0x59219c[_0x555a('0x62')][_0x555a('0x2c')]);}break;case _0x555a('0x6c'):var _0x20a587=_0x35b475[_0x555a('0x62')][_0x555a('0x33')](',')[_0x555a('0x31')](function(_0x2419bc){return Number(_0x2419bc);});_0x20a587[_0x555a('0x6d')](function(_0x5038c0){_0x27fa27['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5038c0+',%');});_0x4517b3=_['union'](_0x4517b3,_0x20a587);break;case _0x555a('0x6e'):if(_0x35b475[_0x555a('0x6f')]===_0x555a('0x70')){_0x588306[_0x5299fa](_0x555a('0x71'),'%'+_0x35b475[_0x555a('0x62')]+'%',null);}else{_0x4e6720=_[_0x555a('0x68')](_0x5963c3,[_0x555a('0x2f'),'UserId']);_0x35b475[_0x555a('0x4b')]=_0x555a('0x72');_0x59219c=as['buildExpression'](_0x517e66,_0x4e6720['type'],_0x35b475);_0x588306[_0x5299fa](_0x59219c[_0x555a('0x73')],_0x59219c[_0x555a('0x62')][_0x555a('0x6b')],_0x59219c[_0x555a('0x62')]['end']);}break;case _0x555a('0x74'):_0x59219c=as[_0x555a('0x6a')]('me',null,_0x35b475);_0x588306[_0x5299fa](_0x59219c[_0x555a('0x73')],_0x59219c[_0x555a('0x62')][_0x555a('0x6b')],_0x59219c[_0x555a('0x62')]['end']);break;}}else{var _0x59219c=as[_0x555a('0x6a')](_0x517e66,_0x4e6720[_0x555a('0x3a')],_0x35b475);_0x588306[_0x5299fa](_0x59219c['text'],_0x59219c[_0x555a('0x62')][_0x555a('0x6b')],_0x59219c[_0x555a('0x62')][_0x555a('0x2c')]);}}}else{var _0x2178c7=_(_0x638136[_0x555a('0x3d')])[_0x555a('0x3e')]()[_0x555a('0x31')](function(_0x730894){return _[_0x555a('0x75')](_0x5963c3,['name',_0x730894])?_0x730894:undefined;})[_0x555a('0x76')]()[_0x555a('0x62')]();if(!_[_0x555a('0x77')](_0x2178c7)){_0x2178c7[_0x555a('0x6d')](function(_0x17206e){if(_0x17206e==='OpenchannelAccountId'){_0x595395['where'](_0x555a('0x78'),[][_0x555a('0x79')](_0x638136[_0x555a('0x3d')][_0x17206e]));}else if(_0x17206e===_0x555a('0x7a')){var _0x3f1e10=JSON['parse'](_0x638136[_0x555a('0x3d')][_0x17206e])[_0x555a('0x7b')];var _0x4147ed=JSON[_0x555a('0x7c')](_0x638136[_0x555a('0x3d')][_0x17206e])[_0x555a('0x7d')];_0x595395[_0x555a('0x48')](_0x555a('0x7e'),_0x3f1e10,_0x4147ed);}else{if(_0x638136[_0x555a('0x3d')][_0x17206e]===_0x555a('0x7f')){_0x595395[_0x555a('0x48')]('i.'+_0x17206e+_0x555a('0x80'));}else{_0x595395['where']('i.'+_0x17206e+'\x20=\x20?',_0x638136['query'][_0x17206e]);}}});}if(_0x638136[_0x555a('0x3d')][_0x555a('0x81')]){if(_0x638136[_0x555a('0x3d')][_0x555a('0x81')]==0x1){_0x595395['having']('`unreadMessages`\x20=\x200');}else{_0x595395[_0x555a('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x638136['query'][_0x555a('0x82')]){_0x4517b3=_['isArray'](_0x638136[_0x555a('0x3d')][_0x555a('0x82')])?_0x638136['query']['tag']:new Array(_0x638136[_0x555a('0x3d')]['tag']);_0x4517b3['forEach'](function(_0x72e04f){_0x27fa27['or'](_0x555a('0x83'),'%,'+_0x72e04f+',%');});}if(_0x638136[_0x555a('0x3d')][_0x555a('0x84')]){var _0x7b0943=_0x638136['query'][_0x555a('0x84')][_0x555a('0x85')]('\x5c','\x5c\x5c')[_0x555a('0x85')]('\x27\x27',_0x555a('0x86'));if(qs[_0x555a('0x87')](_0x7b0943)){_0x588306['or'](_0x555a('0x88'),_0x7b0943+'%');}else{_0x588306['or'](_0x555a('0x89'),qs[_0x555a('0x8a')](_0x7b0943))['or'](_0x555a('0x8b'),_0x7b0943+'%')['or'](_0x555a('0x8c'),_0x7b0943+'%');}}}_0x595395[_0x555a('0x48')](_0x588306);_0x595395[_0x555a('0x8d')](_0x555a('0x8e'));var _0x54e815={'type':db[_0x555a('0x8f')]['QueryTypes'][_0x555a('0x90')],'raw':!![]};var _0x5332ac=_0x595395[_0x555a('0x91')]();_0x5332ac['field'](_0x555a('0x8e'));_0x5332ac[_0x555a('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x555a('0x61'));if(_0x4bbd78['order']){_0x4bbd78['order'][_0x555a('0x6d')](function(_0x1d79f1){_0x595395[_0x555a('0x46')]('i.'+_0x1d79f1[0x0],_0x1d79f1[0x1]===_0x555a('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x4517b3)){_0x595395[_0x555a('0x63')](_0x27fa27);_0x5332ac['where'](_0x555a('0x93'),_0x4517b3);}BPromise[_0x555a('0x94')]()[_0x555a('0x2b')](function(){if(!_0x441116)return;return _0x638136['user'][_0x555a('0x95')]({'attributes':['id'],'raw':!![]})[_0x555a('0x2b')](function(_0x235318){_0x5332ac['where'](_0x555a('0x78'),_[_0x555a('0x31')](_0x235318,'id'));_0x595395[_0x555a('0x48')](_0x555a('0x78'),_['map'](_0x235318,'id'));});})[_0x555a('0x2b')](function(){db[_0x555a('0x96')]['query'](_0x5332ac[_0x555a('0x97')](),_0x54e815)[_0x555a('0x2b')](function(_0x31dfb0){_0x28aac4[_0x555a('0x22')]=_0x31dfb0[_0x555a('0x43')];if(_0x28aac4[_0x555a('0x22')]===0x0)return[];return db[_0x555a('0x96')][_0x555a('0x3d')](_0x45d4c2['toString'](),_0x54e815)[_0x555a('0x2b')](function(_0x300b5f){_0x219ad3=_[_0x555a('0x98')](_0x300b5f,'id');_0x54e815=_[_0x555a('0x99')](_0x54e815,{'model':db[_0x555a('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x595395[_0x555a('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x595395[_0x555a('0x4b')](_0x555a('0x9b'),'Account.key');_0x595395['field'](_0x555a('0x9c'),_0x555a('0x9d'));_0x595395[_0x555a('0x4b')]('i.*');_0x595395[_0x555a('0x4b')]('c.firstName',_0x555a('0x9e'));_0x595395[_0x555a('0x4b')](_0x555a('0x9f'),_0x555a('0xa0'));_0x595395[_0x555a('0x4b')](_0x555a('0xa1'),_0x555a('0xa2'));_0x595395[_0x555a('0x4b')](_0x555a('0xa3'),_0x555a('0xa4'));_0x595395[_0x555a('0x4b')]('c.mobile',_0x555a('0xa5'));_0x595395[_0x555a('0x4b')](_0x555a('0xa6'),_0x555a('0xa7'));_0x595395['field'](_0x555a('0xa8'),'TagIds');_0x595395[_0x555a('0x24')](_0x4bbd78[_0x555a('0x24')]);_0x595395[_0x555a('0x23')](_0x4bbd78[_0x555a('0x23')]);return db[_0x555a('0x96')][_0x555a('0x3d')](_0x595395[_0x555a('0x97')](),_0x54e815);})[_0x555a('0x2b')](function(_0xc35ea0){_0x2e51a9['where'](_0x555a('0xa9'),_['map'](_0xc35ea0,'id'));return db[_0x555a('0x96')][_0x555a('0x3d')](_0x2e51a9[_0x555a('0x97')](),_0x54e815)[_0x555a('0x2b')](function(_0x5b0e9d){var _0x510215=_[_0x555a('0xaa')](_0x5b0e9d,_0x555a('0xab'));var _0x1bee7b=[];_0xc35ea0[_0x555a('0x6d')](function(_0x22d9ef){_0x1bee7b[_0x555a('0x35')](updateOpenchannelInteraction(_0x22d9ef,_0x219ad3,_0x510215));});return BPromise['all'](_0x1bee7b);});});})['then'](function(_0x330090){_0x28aac4['rows']=_0x330090;return _0x28aac4;})[_0x555a('0x2b')](respondWithFilteredResult(_0x281c7a,_0x4bbd78));})[_0x555a('0x36')](handleError(_0x281c7a,null));};exports[_0x555a('0xac')]=function(_0x15550f,_0x321e1d){var _0x398c14={'raw':![],'where':{'id':_0x15550f[_0x555a('0xad')]['id']}},_0x70e1f0={};_0x70e1f0[_0x555a('0x3c')]=_[_0x555a('0x3e')](db[_0x555a('0x9a')][_0x555a('0x38')]);_0x70e1f0[_0x555a('0x3d')]=_['keys'](_0x15550f[_0x555a('0x3d')]);_0x70e1f0['filters']=_[_0x555a('0x40')](_0x70e1f0['model'],_0x70e1f0['query']);_0x398c14[_0x555a('0x41')]=_[_0x555a('0x40')](_0x70e1f0[_0x555a('0x3c')],qs['fields'](_0x15550f[_0x555a('0x3d')]['fields']));_0x398c14[_0x555a('0x41')]=_0x398c14[_0x555a('0x41')][_0x555a('0x43')]?_0x398c14[_0x555a('0x41')]:_0x70e1f0['model'];if(_0x15550f['query'][_0x555a('0xae')]){_0x398c14[_0x555a('0xaf')]=[{'all':!![]}];}_0x398c14=_[_0x555a('0x99')]({},_0x398c14,_0x15550f[_0x555a('0xb0')]);return db[_0x555a('0x9a')][_0x555a('0x68')](_0x398c14)['then'](handleEntityNotFound(_0x321e1d,null))[_0x555a('0x2b')](respondWithResult(_0x321e1d,null))[_0x555a('0x36')](handleError(_0x321e1d,null));};exports[_0x555a('0xb1')]=function(_0x140ac6,_0x4ce997){return db[_0x555a('0x9a')][_0x555a('0xb1')](_0x140ac6[_0x555a('0x74')],{})[_0x555a('0x2b')](respondWithResult(_0x4ce997,0xc9))['catch'](handleError(_0x4ce997,null));};exports[_0x555a('0x2a')]=function(_0x38f58a,_0x1b79e8){if(_0x38f58a[_0x555a('0x74')]['id']){delete _0x38f58a[_0x555a('0x74')]['id'];}return db['OpenchannelInteraction'][_0x555a('0x68')]({'where':{'id':_0x38f58a[_0x555a('0xad')]['id']}})[_0x555a('0x2b')](handleEntityNotFound(_0x1b79e8,null))['then'](saveUpdates(_0x38f58a[_0x555a('0x74')],null))[_0x555a('0x2b')](respondWithResult(_0x1b79e8,null))[_0x555a('0x36')](handleError(_0x1b79e8,null));};exports[_0x555a('0xb2')]=function(_0x4e1422,_0xee6435){return db[_0x555a('0x9a')][_0x555a('0x68')]({'where':{'id':_0x4e1422['params']['id']}})[_0x555a('0x2b')](handleEntityNotFound(_0xee6435,null))[_0x555a('0x2b')](removeEntity(_0xee6435,null))[_0x555a('0x36')](handleError(_0xee6435,null));};exports['describe']=function(_0x4800c7,_0x29f1f4){return db[_0x555a('0x9a')]['describe']()[_0x555a('0x2b')](respondWithResult(_0x29f1f4,null))[_0x555a('0x36')](handleError(_0x29f1f4,null));};exports[_0x555a('0xb3')]=function(_0x1bfdb0,_0xcf76af,_0x4b9c99){return db[_0x555a('0xb4')][_0x555a('0x68')]({'where':{'id':_0x1bfdb0['params']['id']}})['then'](handleEntityNotFound(_0xcf76af,null))[_0x555a('0x2b')](function(_0x13e03e){if(_0x13e03e){return _0x13e03e[_0x555a('0xb3')](_0x1bfdb0['body'][_0x555a('0xb5')],_[_0x555a('0xb6')](_0x1bfdb0[_0x555a('0x74')],['ids','id'])||{});}})[_0x555a('0x2b')](respondWithResult(_0xcf76af,null))[_0x555a('0x36')](handleError(_0xcf76af,null));};exports[_0x555a('0xb7')]=function(_0xc97692,_0x34ec7c,_0x2589df){var _0x12eb89={'raw':![],'where':{}};var _0x464895={};var _0x218d64={'count':0x0,'rows':[]};return db[_0x555a('0x9a')]['findOne']({'where':{'id':_0xc97692[_0x555a('0xad')]['id']}})[_0x555a('0x2b')](handleEntityNotFound(_0x34ec7c,null))['then'](function(_0x44dc61){if(_0x44dc61){_0x464895[_0x555a('0x3c')]=_['keys'](db[_0x555a('0xb4')]['rawAttributes']);_0x464895[_0x555a('0x3d')]=_[_0x555a('0x3e')](_0xc97692[_0x555a('0x3d')]);_0x464895[_0x555a('0x3f')]=_[_0x555a('0x40')](_0x464895['model'],_0x464895[_0x555a('0x3d')]);_0x12eb89[_0x555a('0x41')]=_['intersection'](_0x464895[_0x555a('0x3c')],qs[_0x555a('0x42')](_0xc97692[_0x555a('0x3d')][_0x555a('0x42')]));_0x12eb89[_0x555a('0x41')]=_0x12eb89['attributes'][_0x555a('0x43')]?_0x12eb89[_0x555a('0x41')]:_0x464895[_0x555a('0x3c')];if(!_0xc97692[_0x555a('0x3d')]['hasOwnProperty'](_0x555a('0x45'))){_0x12eb89[_0x555a('0x24')]=qs[_0x555a('0x24')](_0xc97692['query'][_0x555a('0x24')]);_0x12eb89[_0x555a('0x23')]=qs['offset'](_0xc97692['query']['offset']);}_0x12eb89[_0x555a('0x46')]=qs[_0x555a('0x47')](_0xc97692[_0x555a('0x3d')][_0x555a('0x47')]);_0x12eb89[_0x555a('0x48')]=qs['filters'](_[_0x555a('0x49')](_0xc97692[_0x555a('0x3d')],_0x464895[_0x555a('0x3f')]));_0x12eb89[_0x555a('0x48')][_0x555a('0xab')]=_0x44dc61['id'];if(_0xc97692[_0x555a('0x3d')][_0x555a('0x84')]){_0x12eb89[_0x555a('0x48')]=_[_0x555a('0x99')](_0x12eb89[_0x555a('0x48')],{'$or':_[_0x555a('0x31')](_0x12eb89['attributes'],function(_0x25deff){var _0x2b7127={};_0x2b7127[_0x25deff]={'$like':'%'+_0xc97692[_0x555a('0x3d')][_0x555a('0x84')]+'%'};return _0x2b7127;})});}if(_0xc97692[_0x555a('0x3d')]['$gte']){var _0x2e7437=_0xc97692['query'][_0x555a('0x7b')][_0x555a('0x33')](',');var _0x4a6541={};_0x4a6541[_0x2e7437[0x0]]={'$gte':moment(_0x2e7437[0x1])[_0x555a('0xb8')](_0x555a('0xb9'))};_0x12eb89[_0x555a('0x48')]=_[_0x555a('0x99')](_0x12eb89[_0x555a('0x48')],_0x4a6541);}_0x12eb89=_['merge']({},_0x12eb89,_0xc97692[_0x555a('0xb0')]);return db[_0x555a('0xb4')]['count']({'where':_0x12eb89[_0x555a('0x48')]})[_0x555a('0x2b')](function(_0x4d4628){_0x218d64['count']=_0x4d4628;if(_0xc97692[_0x555a('0x3d')]['includeAll']){_0x12eb89[_0x555a('0xaf')]=[{'all':!![]}];}return db[_0x555a('0xb4')][_0x555a('0xba')](_0x12eb89);})[_0x555a('0x2b')](function(_0x7209d0){_0x218d64['rows']=_0x7209d0;return _0x218d64;});}})['then'](respondWithFilteredResult(_0x34ec7c,_0x12eb89))[_0x555a('0x36')](handleError(_0x34ec7c,null));};exports['addTags']=function(_0x8edc41,_0x1154d6,_0x11213d){return db['OpenchannelInteraction'][_0x555a('0x68')]({'where':{'id':_0x8edc41[_0x555a('0xad')]['id']}})['then'](handleEntityNotFound(_0x1154d6,null))['then'](function(_0x3f8096){if(_0x3f8096){return _0x3f8096[_0x555a('0xbb')](_0x8edc41[_0x555a('0x74')][_0x555a('0xb5')],_[_0x555a('0xb6')](_0x8edc41[_0x555a('0x74')],[_0x555a('0xb5'),'id'])||{})['spread'](function(){return db['Tag'][_0x555a('0xba')]({'attributes':['id',_0x555a('0x2f'),_0x555a('0x4c')],'where':{'id':_0x8edc41[_0x555a('0x74')][_0x555a('0xb5')]}});})[_0x555a('0x2b')](function(_0x534bde){socket[_0x555a('0xbc')](_0x555a('0xbd'),{'id':Number(_0x8edc41[_0x555a('0xad')]['id']),'tags':_0x534bde||[]});return{'id':Number(_0x8edc41['params']['id']),'tags':_0x534bde||[]};});}})['then'](respondWithResult(_0x1154d6,null))[_0x555a('0x36')](handleError(_0x1154d6,null));};exports[_0x555a('0xbe')]=function(_0x3553a1,_0x59c0f2,_0xf9e6ba){return db[_0x555a('0x9a')][_0x555a('0x68')]({'where':{'id':_0x3553a1[_0x555a('0xad')]['id']}})[_0x555a('0x2b')](handleEntityNotFound(_0x59c0f2,null))[_0x555a('0x2b')](function(_0x5a9e28){if(_0x5a9e28){return _0x5a9e28[_0x555a('0xbe')](_0x3553a1[_0x555a('0x3d')][_0x555a('0xb5')]);}})[_0x555a('0x2b')](respondWithStatusCode(_0x59c0f2,null))[_0x555a('0x36')](handleError(_0x59c0f2,null));};exports[_0x555a('0xbf')]=function(_0xa7d19f,_0x37e975){var _0x430f4a=moment()[_0x555a('0xc0')]()[_0x555a('0x97')]();var _0x131c2b=path[_0x555a('0xc1')](config['root'],_0x555a('0xc2'),_0x555a('0xc3'),_0x555a('0xc4'));var _0x5def19=path[_0x555a('0xc1')](config[_0x555a('0xc5')],_0x555a('0xc2'),_0x555a('0xc3'),_0x555a('0xc6'));var _0x186185=path[_0x555a('0xc1')](_0x131c2b,_0x430f4a);var _0x17f9d0=util[_0x555a('0xb8')](_0x555a('0xc7'),_0xa7d19f[_0x555a('0xad')]['id'],_0x430f4a);var _0x343b0d=path[_0x555a('0xc1')](_0x131c2b,_0x17f9d0);var _0x5d6f67=![];return db[_0x555a('0x9a')][_0x555a('0x68')]({'where':{'id':_0xa7d19f[_0x555a('0xad')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x555a('0xc8'),'attributes':['id',_0x555a('0x74'),'createdAt','direction',_0x555a('0xc9'),_0x555a('0x81')],'include':[{'model':db[_0x555a('0x6e')],'as':_0x555a('0x6e'),'attributes':['id',_0x555a('0xca')],'raw':!![]},{'model':db[_0x555a('0xcb')],'as':_0x555a('0x65'),'attributes':['id',_0x555a('0xcc'),_0x555a('0xcd')],'raw':!![]},{'model':db[_0x555a('0xce')],'as':'Attachment','raw':!![]}]},{'model':db[_0x555a('0xcf')],'as':'Account','attributes':['id',_0x555a('0x2f')]},{'model':db[_0x555a('0x6e')],'as':'Owner','attributes':['id','fullname']}]})[_0x555a('0x2b')](handleEntityNotFound(_0x37e975,null))[_0x555a('0x2b')](function(_0x462062){if(_0x462062){var _0x361f57=_0x462062[_0x555a('0xd0')]({'plain':!![]});_0x5d6f67=!![];var _0x552b11={'format':'A4','border':_0x555a('0xd1'),'header':{'height':_0x555a('0xd2'),'contents':{'first':_0x555a('0xd3')}},'footer':{'height':_0x555a('0xd4'),'contents':{'default':util[_0x555a('0xb8')]('\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[_0x555a('0xb8')]('%s\x20#%d',_0x555a('0xd5'),_0x361f57['id']),moment()['format'](_0x555a('0xd6'))['toString']())}}};fs[_0x555a('0xd7')](_0x186185);var _0x4b4eea={'channel':_0x555a('0xd5'),'account':_0x361f57['Account'][_0x555a('0x2f')],'agent':_0x361f57[_0x555a('0xd8')]?_0x361f57['Owner'][_0x555a('0xca')]:_0x555a('0xd9'),'createdAt':moment(_0x361f57['createdAt'])[_0x555a('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x555a('0x97')](),'closedAt':_0x361f57[_0x555a('0xda')]?moment(_0x361f57[_0x555a('0xdb')])[_0x555a('0xb8')](_0x555a('0xb9'))[_0x555a('0x97')]():'','disposition':_0x361f57[_0x555a('0xdc')],'visibility':_0x361f57['threadId']?_0x555a('0xdd'):'Private','messages':_(_0x361f57[_0x555a('0xc8')])[_0x555a('0x84')]({'secret':![]})[_0x555a('0x31')](function(_0x189500){if(_0x189500[_0x555a('0xce')]){var _0x1931f5=path[_0x555a('0xc1')](_0x5def19,_0x189500[_0x555a('0xce')][_0x555a('0xde')]);if(fs['existsSync'](_0x1931f5)){fs['createReadStream'](_0x1931f5)[_0x555a('0xdf')](fs[_0x555a('0xe0')](path[_0x555a('0xc1')](_0x186185,_0x189500[_0x555a('0xce')][_0x555a('0xde')])));}}return{'date':moment(_0x189500[_0x555a('0x7a')])[_0x555a('0xb8')](_0x555a('0xb9'))['toString'](),'sender':_0x189500[_0x555a('0xe1')]===_0x555a('0xe2')?_0x189500[_0x555a('0x6e')]?_0x189500[_0x555a('0x6e')]['fullname']:_0x555a('0xe3'):_0x189500[_0x555a('0x65')][_0x555a('0xcc')]+(_0x189500[_0x555a('0x65')]['lastName']?'\x20'+_0x189500['Contact'][_0x555a('0xcd')]:''),'body':_0x189500[_0x555a('0xce')]?_0x189500['Attachment'][_0x555a('0xde')]:_0x189500[_0x555a('0x74')],'direction':_0x189500['direction']===_0x555a('0xe2')?'A':'C','secret':_0x189500[_0x555a('0xc9')],'read':_0x189500[_0x555a('0x81')],'attachment':_0x189500[_0x555a('0xce')]};})[_0x555a('0x62')]()};return ejs['renderFile'](path['join'](config[_0x555a('0xc5')],'server','views',_0x555a('0xe4')),{'interaction':_0x4b4eea})[_0x555a('0x2b')](function(_0x2e3183){return new BPromise(function(_0x2442e3,_0x4f05a3){pdf[_0x555a('0xb1')](_0x2e3183,_0x552b11)[_0x555a('0xe5')](path[_0x555a('0xc1')](_0x186185,_0x555a('0xe6')+_0x361f57['id']+'-'+_0x430f4a+_0x555a('0xe7')),function(_0x3aa0c5,_0x79ecd2){if(_0x3aa0c5)return _0x4f05a3(_0x3aa0c5);_0x2442e3(_0x79ecd2);});});});}})['then'](function(){if(_0x5d6f67){return new BPromise(function(_0x46e98e,_0x2045c8){zipdir(_0x186185,{'saveTo':_0x343b0d},function(_0x3fb577,_0x4f7a23){if(_0x3fb577)return _0x2045c8(_0x3fb577);return _0x46e98e(_0x4f7a23);});})['then'](function(){return new BPromise(function(_0x138b6c,_0x2a76f2){rimraf(_0x186185,function(_0x307de6){if(_0x307de6)_0x2a76f2(_0x307de6);return _0x138b6c();});});})[_0x555a('0x2b')](function(){return _0x37e975[_0x555a('0xbf')](_0x343b0d,_0x17f9d0,function(_0x69baa1){if(_0x69baa1){console[_0x555a('0xe8')](_0x555a('0xe9'),_0x69baa1);}else{fs[_0x555a('0xea')](_0x343b0d);}});});}else{return _0x37e975[_0x555a('0x20')](0xc8);}})['catch'](handleError(_0x37e975,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 66fbe5e..547304f 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 _0xc025=['findAll','setDataValue','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','update','remove','getUsers','then','Users','map'];(function(_0x30e804,_0x8d453b){var _0x529374=function(_0x4731c0){while(--_0x4731c0){_0x30e804['push'](_0x30e804['shift']());}};_0x529374(++_0x8d453b);}(_0xc025,0x1d6));var _0x5c02=function(_0x256823,_0x1e8306){_0x256823=_0x256823-0x0;var _0x25a70f=_0xc025[_0x256823];return _0x25a70f;};'use strict';var EventEmitter=require(_0x5c02('0x0'));var OpenchannelInteraction=require(_0x5c02('0x1'))['db'][_0x5c02('0x2')];var OpenchannelMessage=require(_0x5c02('0x1'))['db'][_0x5c02('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c02('0x4'),'afterDestroy':_0x5c02('0x5')};function emitEvent(_0x3ded30){return function(_0x1b7703,_0xdb736a,_0x397d04){_0x1b7703[_0x5c02('0x6')]({'attributes':['id'],'raw':!![]})[_0x5c02('0x7')](function(_0x4d471f){_0x1b7703['setDataValue'](_0x5c02('0x8'),_0x4d471f[_0x5c02('0x9')](function(_0x2054a6){return{'id':_0x2054a6['id']};}));return OpenchannelMessage[_0x5c02('0xa')]({'where':{'OpenchannelInteractionId':_0x1b7703['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5c02('0x7')](function(_0x20f424){_0x1b7703[_0x5c02('0xb')]('unreadMessages',_0x20f424[_0x5c02('0xc')]);OpenchannelInteractionEvents['emit'](_0x3ded30+':'+_0x1b7703['id'],_0x1b7703);OpenchannelInteractionEvents[_0x5c02('0xd')](_0x3ded30,_0x1b7703);_0x397d04(null);})['catch'](_0x397d04(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x5c02('0xe')](e,emitEvent(event));}}module[_0x5c02('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x148d=['emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length'];(function(_0x4ebfca,_0x5a276d){var _0x25dcce=function(_0x4802b1){while(--_0x4802b1){_0x4ebfca['push'](_0x4ebfca['shift']());}};_0x25dcce(++_0x5a276d);}(_0x148d,0x193));var _0xd148=function(_0xa1b54a,_0x354a54){_0xa1b54a=_0xa1b54a-0x0;var _0x1a8c8b=_0x148d[_0xa1b54a];return _0x1a8c8b;};'use strict';var EventEmitter=require(_0xd148('0x0'));var OpenchannelInteraction=require(_0xd148('0x1'))['db'][_0xd148('0x2')];var OpenchannelMessage=require(_0xd148('0x1'))['db'][_0xd148('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd148('0x4')](0x0);var events={'afterCreate':_0xd148('0x5'),'afterUpdate':_0xd148('0x6'),'afterDestroy':_0xd148('0x7')};function emitEvent(_0x133f90){return function(_0xb851f,_0x13012d,_0x25cd2a){_0xb851f[_0xd148('0x8')]({'attributes':['id'],'raw':!![]})[_0xd148('0x9')](function(_0x33ec37){_0xb851f[_0xd148('0xa')](_0xd148('0xb'),_0x33ec37['map'](function(_0x24bb4d){return{'id':_0x24bb4d['id']};}));return OpenchannelMessage[_0xd148('0xc')]({'where':{'OpenchannelInteractionId':_0xb851f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd148('0x9')](function(_0x32d5df){_0xb851f['setDataValue'](_0xd148('0xd'),_0x32d5df[_0xd148('0xe')]);OpenchannelInteractionEvents[_0xd148('0xf')](_0x133f90+':'+_0xb851f['id'],_0xb851f);OpenchannelInteractionEvents['emit'](_0x133f90,_0xb851f);_0x25cd2a(null);})[_0xd148('0x10')](_0x25cd2a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xd148('0x11')](e,emitEvent(event));}}module[_0xd148('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 1ae4572..71333b5 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 _0x9c5a=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','changed'];(function(_0x2d342e,_0x63338){var _0x54f133=function(_0x18feee){while(--_0x18feee){_0x2d342e['push'](_0x2d342e['shift']());}};_0x54f133(++_0x63338);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x358ee7,_0x44eb52){_0x358ee7=_0x358ee7-0x0;var _0x178cba=_0x9c5a[_0x358ee7];return _0x178cba;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d6b50,_0x16f331,_0x52afb2){if(_0x3d6b50[_0xa9c5('0xa')](_0xa9c5('0xb'))){_0x3d6b50['closedAt']=moment()[_0xa9c5('0xc')](_0xa9c5('0xd'));}_0x52afb2(null,_0x3d6b50);}}});}; \ No newline at end of file +var _0x9f5a=['path','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closedAt','format','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x25d6db,_0x3093af){var _0xa6d330=function(_0xa6bfc1){while(--_0xa6bfc1){_0x25d6db['push'](_0x25d6db['shift']());}};_0xa6d330(++_0x3093af);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x5116b6,_0x515232){_0x5116b6=_0x5116b6-0x0;var _0x11d54a=_0x9f5a[_0x5116b6];return _0x11d54a;};'use strict';var _=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var logger=require(_0xa9f5('0x2'))(_0xa9f5('0x3'));var moment=require('moment');var BPromise=require(_0xa9f5('0x4'));var rp=require(_0xa9f5('0x5'));var fs=require('fs');var path=require(_0xa9f5('0x6'));var rimraf=require('rimraf');var config=require(_0xa9f5('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xa9f5('0x8')]=function(_0x219e89,_0x49e337){return _0x219e89[_0xa9f5('0x9')](_0xa9f5('0xa'),attributes,{'tableName':_0xa9f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f6c78,_0x21006b,_0x22a318){if(_0x1f6c78[_0xa9f5('0xc')]('closed')){_0x1f6c78[_0xa9f5('0xd')]=moment()[_0xa9f5('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x22a318(null,_0x1f6c78);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a9a10e5..3bd0cf4 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 _0xb753=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw','options','where','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','bluebird','../../config/utils','rpc','client','http','redis','localhost','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0xb753,0xe6));var _0x3b75=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0xb753[_0x4854d6];return _0x3885c0;};'use strict';var _=require(_0x3b75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b75('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b75('0x2'));var logger=require('../../config/logger')(_0x3b75('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3b75('0x4')][_0x3b75('0x5')]({'port':0x232a});config[_0x3b75('0x6')]=_['defaults'](config[_0x3b75('0x6')],{'host':_0x3b75('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b75('0x6')]));require(_0x3b75('0x8'))[_0x3b75('0x9')](socket);function respondWithRpcPromise(_0x5add79,_0x310a21,_0x4f684e){return new BPromise(function(_0x3a6a15,_0x23b6d9){return client[_0x3b75('0xa')](_0x5add79,_0x4f684e)[_0x3b75('0xb')](function(_0x20b9a3){logger[_0x3b75('0xc')]('OpenchannelInteraction,\x20%s,\x20%s',_0x310a21,_0x3b75('0xd'));logger[_0x3b75('0xe')](_0x3b75('0xf'),_0x310a21,'request\x20sent',JSON[_0x3b75('0x10')](_0x20b9a3));if(_0x20b9a3[_0x3b75('0x11')]){if(_0x20b9a3[_0x3b75('0x11')]['code']===0x1f4){logger[_0x3b75('0x11')](_0x3b75('0x12'),_0x310a21,_0x20b9a3['error']['message']);return _0x23b6d9(_0x20b9a3['error']['message']);}logger[_0x3b75('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x310a21,_0x20b9a3[_0x3b75('0x11')]['message']);return _0x3a6a15(_0x20b9a3['error'][_0x3b75('0x13')]);}else{logger['info'](_0x3b75('0x12'),_0x310a21,_0x3b75('0xd'));_0x3a6a15(_0x20b9a3[_0x3b75('0x14')][_0x3b75('0x13')]);}})[_0x3b75('0x15')](function(_0x155909){logger[_0x3b75('0x11')](_0x3b75('0x12'),_0x310a21,_0x155909);_0x23b6d9(_0x155909);});});}exports[_0x3b75('0x16')]=function(_0x5694a9){var _0x357157=this;return new Promise(function(_0x3cd364,_0x41e83c){return db[_0x3b75('0x17')][_0x3b75('0x18')](_0x5694a9[_0x3b75('0x19')],{'raw':_0x5694a9['options']?_0x5694a9['options'][_0x3b75('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5694a9['options']?_0x5694a9[_0x3b75('0x1b')][_0x3b75('0x1c')]||null:null,'attributes':_0x5694a9[_0x3b75('0x1b')]?_0x5694a9[_0x3b75('0x1b')]['attributes']||null:null,'limit':_0x5694a9[_0x3b75('0x1b')]?_0x5694a9[_0x3b75('0x1b')]['limit']||null:null})[_0x3b75('0xb')](function(_0x7b86a2){logger[_0x3b75('0xc')](_0x3b75('0x16'),_0x5694a9);logger[_0x3b75('0xe')](_0x3b75('0x16'),_0x5694a9,JSON[_0x3b75('0x10')](_0x7b86a2));_0x3cd364(_0x7b86a2);})[_0x3b75('0x15')](function(_0x15f391){logger['error']('UpdateOpenchannelInteraction',_0x15f391[_0x3b75('0x13')],_0x5694a9);_0x41e83c(_0x357157['error'](0x1f4,_0x15f391['message']));});});};exports[_0x3b75('0x1d')]=function(_0x499ae7){return new Promise(function(_0x58617a,_0x1ae56c){return db['OpenchannelInteraction'][_0x3b75('0x1e')]({'where':_0x499ae7[_0x3b75('0x1b')]?_0x499ae7[_0x3b75('0x1b')][_0x3b75('0x1c')]||null:null})[_0x3b75('0xb')](function(_0x651ce4){if(_0x651ce4){return _0x651ce4[_0x3b75('0x1f')](_0x499ae7[_0x3b75('0x19')][_0x3b75('0x20')],_['omit'](_0x499ae7[_0x3b75('0x19')],[_0x3b75('0x20'),'id'])||{});}})[_0x3b75('0x21')](function(_0x5b9ea5){logger['info'](_0x3b75('0x22'),_0x499ae7);logger[_0x3b75('0xe')](_0x3b75('0x22'),_0x499ae7,JSON[_0x3b75('0x10')](_0x5b9ea5));_0x58617a(_0x5b9ea5);})[_0x3b75('0x15')](function(_0x138cad){logger[_0x3b75('0x11')](_0x3b75('0x22'),_0x138cad[_0x3b75('0x13')],_0x499ae7);_0x1ae56c(_this[_0x3b75('0x11')](0x1f4,_0x138cad['message']));});});}; \ No newline at end of file +var _0x00e7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','limit','info','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash'];(function(_0xd4fe81,_0xe0ef93){var _0x82d1fa=function(_0x4498c4){while(--_0x4498c4){_0xd4fe81['push'](_0xd4fe81['shift']());}};_0x82d1fa(++_0xe0ef93);}(_0x00e7,0x1b7));var _0x700e=function(_0x3c30a4,_0x152fd6){_0x3c30a4=_0x3c30a4-0x0;var _0x4f3e14=_0x00e7[_0x3c30a4];return _0x4f3e14;};'use strict';var _=require(_0x700e('0x0'));var util=require('util');var moment=require(_0x700e('0x1'));var BPromise=require(_0x700e('0x2'));var rs=require(_0x700e('0x3'));var fs=require('fs');var Redis=require(_0x700e('0x4'));var db=require(_0x700e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x700e('0x6'))(_0x700e('0x7'));var config=require(_0x700e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x700e('0x9')][_0x700e('0xa')]({'port':0x232a});config['redis']=_[_0x700e('0xb')](config['redis'],{'host':_0x700e('0xc'),'port':0x18eb});var socket=require(_0x700e('0xd'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x700e('0xe')](socket);function respondWithRpcPromise(_0x81ad1d,_0x18011a,_0x502636){return new BPromise(function(_0x5d5c40,_0x17ebef){return client[_0x700e('0xf')](_0x81ad1d,_0x502636)[_0x700e('0x10')](function(_0x15feab){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x18011a,_0x700e('0x11'));logger[_0x700e('0x12')](_0x700e('0x13'),_0x18011a,'request\x20sent',JSON[_0x700e('0x14')](_0x15feab));if(_0x15feab['error']){if(_0x15feab['error']['code']===0x1f4){logger[_0x700e('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x18011a,_0x15feab[_0x700e('0x15')][_0x700e('0x16')]);return _0x17ebef(_0x15feab['error'][_0x700e('0x16')]);}logger[_0x700e('0x15')](_0x700e('0x17'),_0x18011a,_0x15feab[_0x700e('0x15')][_0x700e('0x16')]);return _0x5d5c40(_0x15feab['error'][_0x700e('0x16')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x18011a,'request\x20sent');_0x5d5c40(_0x15feab[_0x700e('0x18')][_0x700e('0x16')]);}})[_0x700e('0x19')](function(_0x328fac){logger[_0x700e('0x15')](_0x700e('0x17'),_0x18011a,_0x328fac);_0x17ebef(_0x328fac);});});}exports[_0x700e('0x1a')]=function(_0x558311){var _0x7410e0=this;return new Promise(function(_0x409944,_0x17da5f){return db[_0x700e('0x1b')]['update'](_0x558311['body'],{'raw':_0x558311['options']?_0x558311[_0x700e('0x1c')][_0x700e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x558311[_0x700e('0x1c')]?_0x558311[_0x700e('0x1c')][_0x700e('0x1e')]||null:null,'attributes':_0x558311[_0x700e('0x1c')]?_0x558311[_0x700e('0x1c')][_0x700e('0x1f')]||null:null,'limit':_0x558311[_0x700e('0x1c')]?_0x558311[_0x700e('0x1c')][_0x700e('0x20')]||null:null})['then'](function(_0x111c55){logger[_0x700e('0x21')](_0x700e('0x1a'),_0x558311);logger[_0x700e('0x12')](_0x700e('0x1a'),_0x558311,JSON['stringify'](_0x111c55));_0x409944(_0x111c55);})[_0x700e('0x19')](function(_0x3367f4){logger['error'](_0x700e('0x1a'),_0x3367f4[_0x700e('0x16')],_0x558311);_0x17da5f(_0x7410e0[_0x700e('0x15')](0x1f4,_0x3367f4['message']));});});};exports[_0x700e('0x22')]=function(_0x25ac6c){return new Promise(function(_0x2cd79a,_0x42a665){return db[_0x700e('0x1b')][_0x700e('0x23')]({'where':_0x25ac6c[_0x700e('0x1c')]?_0x25ac6c[_0x700e('0x1c')][_0x700e('0x1e')]||null:null})[_0x700e('0x10')](function(_0x25c916){if(_0x25c916){return _0x25c916['addTags'](_0x25ac6c['body'][_0x700e('0x24')],_[_0x700e('0x25')](_0x25ac6c['body'],[_0x700e('0x24'),'id'])||{});}})[_0x700e('0x26')](function(_0x3cd4c0){logger['info'](_0x700e('0x27'),_0x25ac6c);logger[_0x700e('0x12')]('AddTags',_0x25ac6c,JSON[_0x700e('0x14')](_0x3cd4c0));_0x2cd79a(_0x3cd4c0);})[_0x700e('0x19')](function(_0x330b37){logger[_0x700e('0x15')](_0x700e('0x27'),_0x330b37[_0x700e('0x16')],_0x25ac6c);_0x42a665(_this[_0x700e('0x15')](0x1f4,_0x330b37['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b4467b7..8dd87ff 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 _0xc584=['save','emit','removeListener','register','length','./openchannelInteraction.events'];(function(_0x14de9c,_0x5e5063){var _0x439f1d=function(_0xe21a81){while(--_0xe21a81){_0x14de9c['push'](_0x14de9c['shift']());}};_0x439f1d(++_0x5e5063);}(_0xc584,0x179));var _0x4c58=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0xc584[_0xe5b349];return _0x26b0ad;};'use strict';var OpenchannelInteractionEvents=require(_0x4c58('0x0'));var events=[_0x4c58('0x1'),'remove','update'];function createListener(_0x517e7a,_0x2b3752){return function(_0x24f4f7){_0x2b3752[_0x4c58('0x2')](_0x517e7a,_0x24f4f7);};}function removeListener(_0x322056,_0x49b56a){return function(){OpenchannelInteractionEvents[_0x4c58('0x3')](_0x322056,_0x49b56a);};}exports[_0x4c58('0x4')]=function(_0x5d6228){for(var _0x14f5f0=0x0,_0x5e55f0=events[_0x4c58('0x5')];_0x14f5f0<_0x5e55f0;_0x14f5f0++){var _0x5b8801=events[_0x14f5f0];var _0x39f1bc=createListener('openchannelInteraction:'+_0x5b8801,_0x5d6228);OpenchannelInteractionEvents['on'](_0x5b8801,_0x39f1bc);}}; \ No newline at end of file +var _0x664f=['save','update','emit','register','length','openchannelInteraction:'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0x664f,0x9c));var _0xf664=function(_0x22766f,_0x577e75){_0x22766f=_0x22766f-0x0;var _0x5e0773=_0x664f[_0x22766f];return _0x5e0773;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xf664('0x0'),'remove',_0xf664('0x1')];function createListener(_0xa49102,_0x7f150d){return function(_0x453876){_0x7f150d[_0xf664('0x2')](_0xa49102,_0x453876);};}function removeListener(_0x149c8e,_0x1f86e7){return function(){OpenchannelInteractionEvents['removeListener'](_0x149c8e,_0x1f86e7);};}exports[_0xf664('0x3')]=function(_0x4308ab){for(var _0x3074c5=0x0,_0x559cd7=events[_0xf664('0x4')];_0x3074c5<_0x559cd7;_0x3074c5++){var _0x43741a=events[_0x3074c5];var _0x1e96f8=createListener(_0xf664('0x5')+_0x43741a,_0x4308ab);OpenchannelInteractionEvents['on'](_0x43741a,_0x1e96f8);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index affec8f..7eda5f8 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 _0x46e2=['/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','openchannel','create','put','update','accept'];(function(_0x233420,_0x233cae){var _0x3a149d=function(_0x21e002){while(--_0x21e002){_0x233420['push'](_0x233420['shift']());}};_0x3a149d(++_0x233cae);}(_0x46e2,0x1c6));var _0x246e=function(_0x4855e8,_0x4d19ef){_0x4855e8=_0x4855e8-0x0;var _0x1ef89d=_0x46e2[_0x4855e8];return _0x1ef89d;};'use strict';var multer=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var path=require(_0x246e('0x2'));var timeout=require(_0x246e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x246e('0x4'));var interaction=require(_0x246e('0x5'));var config=require(_0x246e('0x6'));var controller=require(_0x246e('0x7'));router[_0x246e('0x8')]('/',auth[_0x246e('0x9')](),controller[_0x246e('0xa')]);router['get'](_0x246e('0xb'),auth[_0x246e('0x9')](),controller['describe']);router[_0x246e('0x8')](_0x246e('0xc'),auth['isAuthenticated'](),controller[_0x246e('0xd')]);router[_0x246e('0xe')]('/',auth[_0x246e('0x9')](),interaction[_0x246e('0xf')](_0x246e('0x10'),'openchannelmessage:create'),controller[_0x246e('0x11')]);router[_0x246e('0x12')](_0x246e('0xc'),auth['isAuthenticated'](),controller[_0x246e('0x13')]);router[_0x246e('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x246e('0x14')]);router['put'](_0x246e('0x15'),auth[_0x246e('0x9')](),controller[_0x246e('0x16')]);router[_0x246e('0x17')](_0x246e('0xc'),auth[_0x246e('0x9')](),controller[_0x246e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x5469=['post','tracked','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5469,0x17b));var _0x9546=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x5469[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0x9546('0x0'));var util=require(_0x9546('0x1'));var path=require('path');var timeout=require(_0x9546('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x9546('0x3'));var interaction=require(_0x9546('0x4'));var config=require(_0x9546('0x5'));var controller=require('./openchannelMessage.controller');router[_0x9546('0x6')]('/',auth[_0x9546('0x7')](),controller['index']);router[_0x9546('0x6')](_0x9546('0x8'),auth[_0x9546('0x7')](),controller[_0x9546('0x9')]);router['get'](_0x9546('0xa'),auth[_0x9546('0x7')](),controller[_0x9546('0xb')]);router[_0x9546('0xc')]('/',auth['isAuthenticated'](),interaction[_0x9546('0xd')]('openchannel','openchannelmessage:create'),controller[_0x9546('0xe')]);router[_0x9546('0xf')](_0x9546('0xa'),auth['isAuthenticated'](),controller[_0x9546('0x10')]);router['put'](_0x9546('0x11'),auth[_0x9546('0x7')](),controller[_0x9546('0x12')]);router['put'](_0x9546('0x13'),auth['isAuthenticated'](),controller[_0x9546('0x14')]);router[_0x9546('0x15')](_0x9546('0xa'),auth[_0x9546('0x7')](),controller[_0x9546('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 600c39b..ae46621 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 _0x0d22=['BOOLEAN','ENUM','out','sequelize','TEXT','medium'];(function(_0x253eee,_0x5ca204){var _0x12c14b=function(_0x1d45ce){while(--_0x1d45ce){_0x253eee['push'](_0x253eee['shift']());}};_0x12c14b(++_0x5ca204);}(_0x0d22,0xf9));var _0x20d2=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x0d22[_0x155c64];return _0x1f154a;};'use strict';var Sequelize=require(_0x20d2('0x0'));module['exports']={'body':{'type':Sequelize[_0x20d2('0x1')](_0x20d2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x20d2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x20d2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x20d2('0x4')]('in',_0x20d2('0x5')),'defaultValue':_0x20d2('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x0c59=['BOOLEAN','ENUM','out','DATE','exports','TEXT','medium'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0c59,0x1a1));var _0x90c5=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0x0c59[_0x623e7];return _0x121131;};'use strict';var Sequelize=require('sequelize');module[_0x90c5('0x0')]={'body':{'type':Sequelize[_0x90c5('0x1')](_0x90c5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90c5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x90c5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x90c5('0x4')]('in',_0x90c5('0x5')),'defaultValue':_0x90c5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90c5('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 9249d57..806e319 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 _0x80f7=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./openchannelMessage.socket','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','describe','../../config/logger','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','manual','interface','SIP/%s','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','channel','EventManager','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x399ec8,_0xae6c1b){var _0xbd731c=function(_0x50451c){while(--_0x50451c){_0x399ec8['push'](_0x399ec8['shift']());}};_0xbd731c(++_0xae6c1b);}(_0x80f7,0x14b));var _0x780f=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0x80f7[_0x13992d];return _0x3d15bf;};'use strict';var pdf=require(_0x780f('0x0'));var emlformat=require(_0x780f('0x1'));var rimraf=require(_0x780f('0x2'));var zipdir=require(_0x780f('0x3'));var jsonpatch=require(_0x780f('0x4'));var rp=require(_0x780f('0x5'));var moment=require(_0x780f('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x780f('0x7'));var path=require(_0x780f('0x8'));var sox=require('sox');var csv=require(_0x780f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x780f('0xa'));var jsforce=require(_0x780f('0xb'));var deskjs=require(_0x780f('0xc'));var toCsv=require(_0x780f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x780f('0xd'));var authService=require(_0x780f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x780f('0xf'));var hardwareService=require(_0x780f('0x10'));var logger=require('../../config/logger')(_0x780f('0x11'));var utils=require(_0x780f('0x12'));var config=require(_0x780f('0x13'));var db=require(_0x780f('0x14'))['db'];config[_0x780f('0x15')]=_[_0x780f('0x16')](config[_0x780f('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x780f('0x15')]));require(_0x780f('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x780f('0x18')]({'port':0x232c});var client9002=jayson['client'][_0x780f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x6a26e0,_0x46afc9,_0x37495d){if(_0x37495d){var _0x5b9131=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b9131[_0x780f('0x19')](_0x46afc9)){return _0x6a26e0;}else{throw new db[(_0x780f('0x1a'))][(_0x780f('0x1b'))](_0x780f('0x1c'));}}else{return _0x6a26e0;}}function respondWithRpcPromise(_0x2101bc,_0x360375,_0x3dcbbe,_0x3515ae){return new BPromise(function(_0x3ddfcb,_0x2ee89e){var _0x20fce0=_0x3515ae||client;return _0x20fce0[_0x780f('0x1d')](_0x2101bc,_0x3dcbbe)['then'](function(_0x32a280){logger[_0x780f('0x1e')](_0x780f('0x1f'),_0x360375,_0x780f('0x20'));logger[_0x780f('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x360375,_0x780f('0x20'),JSON['stringify'](_0x32a280));if(_0x32a280[_0x780f('0x22')]){if(_0x32a280['error']['code']===0x1f4){logger['error'](_0x780f('0x1f'),_0x360375,_0x32a280[_0x780f('0x22')][_0x780f('0x23')]);return _0x2ee89e(_0x32a280[_0x780f('0x22')][_0x780f('0x23')]);}logger[_0x780f('0x22')](_0x780f('0x1f'),_0x360375,_0x32a280[_0x780f('0x22')][_0x780f('0x23')]);return _0x3ddfcb(_0x32a280[_0x780f('0x22')][_0x780f('0x23')]);}else{logger[_0x780f('0x1e')](_0x780f('0x1f'),_0x360375,'request\x20sent');_0x3ddfcb(_0x32a280[_0x780f('0x24')][_0x780f('0x23')]);}})[_0x780f('0x25')](function(_0x43110f){logger[_0x780f('0x22')](_0x780f('0x1f'),_0x360375,_0x43110f);_0x2ee89e(_0x43110f);});});}function respondWithStatusCode(_0x2b0f71,_0x390626){_0x390626=_0x390626||0xcc;return function(_0x29b7eb){if(_0x29b7eb){return _0x2b0f71[_0x780f('0x26')](_0x390626);}return _0x2b0f71[_0x780f('0x27')](_0x390626)['end']();};}function respondWithResult(_0x182bc8,_0x1191d3){_0x1191d3=_0x1191d3||0xc8;return function(_0x4faa39){if(_0x4faa39){return _0x182bc8[_0x780f('0x27')](_0x1191d3)[_0x780f('0x28')](_0x4faa39);}};}function respondWithFilteredResult(_0x4aa91d,_0x332ac1){return function(_0x159120){if(_0x159120){var _0x2b63a6=_0x159120[_0x780f('0x29')],_0x2ad9ec=_0x332ac1[_0x780f('0x2a')],_0x2791ba=_0x332ac1['offset']+_0x332ac1[_0x780f('0x2b')],_0x244b7f;if(_0x2791ba>=_0x2b63a6){_0x2791ba=_0x2b63a6;_0x244b7f=0xc8;}else{_0x244b7f=0xce;}_0x4aa91d[_0x780f('0x27')](_0x244b7f);return _0x4aa91d[_0x780f('0x2c')](_0x780f('0x2d'),_0x2ad9ec+'-'+_0x2791ba+'/'+_0x2b63a6)[_0x780f('0x28')](_0x159120);}return null;};}function patchUpdates(_0x2e94da){return function(_0x17b94e){try{jsonpatch[_0x780f('0x2e')](_0x17b94e,_0x2e94da,!![]);}catch(_0x4ea3f3){return BPromise[_0x780f('0x2f')](_0x4ea3f3);}return _0x17b94e[_0x780f('0x30')]();};}function saveUpdates(_0x1028dd,_0x1b8a25){return function(_0x777af2){if(_0x777af2){return _0x777af2[_0x780f('0x31')](_0x1028dd)[_0x780f('0x32')](function(_0x13f2ea){return _0x13f2ea;});}return null;};}function removeEntity(_0x3637cb,_0x11c2db){return function(_0x49dee4){if(_0x49dee4){return _0x49dee4[_0x780f('0x33')]()[_0x780f('0x32')](function(){_0x3637cb[_0x780f('0x27')](0xcc)[_0x780f('0x34')]();});}};}function handleEntityNotFound(_0x4849ff,_0x165382){return function(_0x57b60f){if(!_0x57b60f){_0x4849ff[_0x780f('0x26')](0x194);}return _0x57b60f;};}function handleError(_0x5a5a0c,_0x281140){_0x281140=_0x281140||0x1f4;return function(_0x217065){logger[_0x780f('0x22')](_0x217065['stack']);if(_0x217065[_0x780f('0x35')]){delete _0x217065[_0x780f('0x35')];}_0x5a5a0c[_0x780f('0x27')](_0x281140)[_0x780f('0x36')](_0x217065);};}exports['index']=function(_0x303b27,_0x2b33eb){var _0x449ba8={},_0x26f9a6={},_0x190529={'count':0x0,'rows':[]};var _0xae47bd=_[_0x780f('0x37')](db[_0x780f('0x38')][_0x780f('0x39')],function(_0x42d7b1){return{'name':_0x42d7b1[_0x780f('0x3a')],'type':_0x42d7b1[_0x780f('0x3b')][_0x780f('0x3c')]};});_0x26f9a6['model']=_[_0x780f('0x37')](_0xae47bd,_0x780f('0x35'));_0x26f9a6['query']=_[_0x780f('0x3d')](_0x303b27[_0x780f('0x3e')]);_0x26f9a6['filters']=_[_0x780f('0x3f')](_0x26f9a6[_0x780f('0x40')],_0x26f9a6['query']);_0x449ba8[_0x780f('0x41')]=_[_0x780f('0x3f')](_0x26f9a6['model'],qs['fields'](_0x303b27[_0x780f('0x3e')][_0x780f('0x42')]));_0x449ba8[_0x780f('0x41')]=_0x449ba8[_0x780f('0x41')][_0x780f('0x43')]?_0x449ba8[_0x780f('0x41')]:_0x26f9a6[_0x780f('0x40')];if(!_0x303b27['query'][_0x780f('0x44')](_0x780f('0x45'))){_0x449ba8[_0x780f('0x2b')]=qs[_0x780f('0x2b')](_0x303b27['query'][_0x780f('0x2b')]);_0x449ba8[_0x780f('0x2a')]=qs['offset'](_0x303b27['query'][_0x780f('0x2a')]);}_0x449ba8[_0x780f('0x46')]=qs[_0x780f('0x47')](_0x303b27[_0x780f('0x3e')][_0x780f('0x47')]);_0x449ba8[_0x780f('0x48')]=qs[_0x780f('0x49')](_['pick'](_0x303b27[_0x780f('0x3e')],_0x26f9a6[_0x780f('0x49')]));if(_0x303b27[_0x780f('0x3e')]['filter']){_0x449ba8[_0x780f('0x48')]=_['merge'](_0x449ba8['where'],{'$or':_[_0x780f('0x37')](_0xae47bd,function(_0x58878d){if(_0x58878d[_0x780f('0x3b')]!==_0x780f('0x4a')){var _0x15725e={};_0x15725e[_0x58878d[_0x780f('0x35')]]={'$like':'%'+_0x303b27['query']['filter']+'%'};return _0x15725e;}})});}_0x449ba8=_[_0x780f('0x4b')]({},_0x449ba8,_0x303b27[_0x780f('0x4c')]);var _0x3b16fd={'where':_0x449ba8[_0x780f('0x48')]};return db['OpenchannelMessage'][_0x780f('0x29')](_0x3b16fd)['then'](function(_0x328e90){_0x190529[_0x780f('0x29')]=_0x328e90;if(_0x303b27[_0x780f('0x3e')][_0x780f('0x4d')]){_0x449ba8['include']=[{'all':!![]}];}return db[_0x780f('0x38')][_0x780f('0x4e')](_0x449ba8);})[_0x780f('0x32')](function(_0x30be88){_0x190529[_0x780f('0x4f')]=_0x30be88;return _0x190529;})[_0x780f('0x32')](respondWithFilteredResult(_0x2b33eb,_0x449ba8))[_0x780f('0x25')](handleError(_0x2b33eb,null));};exports[_0x780f('0x50')]=function(_0x2da364,_0x154be5){var _0x1cbb05={'raw':!![],'where':{'id':_0x2da364[_0x780f('0x51')]['id']}},_0x3869e6={};_0x3869e6[_0x780f('0x40')]=_[_0x780f('0x3d')](db['OpenchannelMessage']['rawAttributes']);_0x3869e6[_0x780f('0x3e')]=_[_0x780f('0x3d')](_0x2da364['query']);_0x3869e6[_0x780f('0x49')]=_[_0x780f('0x3f')](_0x3869e6[_0x780f('0x40')],_0x3869e6[_0x780f('0x3e')]);_0x1cbb05[_0x780f('0x41')]=_[_0x780f('0x3f')](_0x3869e6[_0x780f('0x40')],qs[_0x780f('0x42')](_0x2da364[_0x780f('0x3e')]['fields']));_0x1cbb05['attributes']=_0x1cbb05[_0x780f('0x41')]['length']?_0x1cbb05[_0x780f('0x41')]:_0x3869e6[_0x780f('0x40')];if(_0x2da364[_0x780f('0x3e')][_0x780f('0x4d')]){_0x1cbb05[_0x780f('0x52')]=[{'all':!![]}];}_0x1cbb05=_[_0x780f('0x4b')]({},_0x1cbb05,_0x2da364['options']);return db[_0x780f('0x38')][_0x780f('0x53')](_0x1cbb05)['then'](handleEntityNotFound(_0x154be5,null))[_0x780f('0x32')](respondWithResult(_0x154be5,null))['catch'](handleError(_0x154be5,null));};exports[_0x780f('0x54')]=function(_0x1b735b,_0x2d0c1f){return db[_0x780f('0x38')]['create'](_0x1b735b[_0x780f('0x55')],{})[_0x780f('0x32')](respondWithResult(_0x2d0c1f,0xc9))[_0x780f('0x25')](handleError(_0x2d0c1f,null));};exports['update']=function(_0x331c6c,_0x3a89ea){if(_0x331c6c[_0x780f('0x55')]['id']){delete _0x331c6c[_0x780f('0x55')]['id'];}return db['OpenchannelMessage'][_0x780f('0x53')]({'where':{'id':_0x331c6c[_0x780f('0x51')]['id']}})[_0x780f('0x32')](handleEntityNotFound(_0x3a89ea,null))['then'](saveUpdates(_0x331c6c[_0x780f('0x55')],null))[_0x780f('0x32')](respondWithResult(_0x3a89ea,null))[_0x780f('0x25')](handleError(_0x3a89ea,null));};exports[_0x780f('0x33')]=function(_0x3f962b,_0x13551c){return db['OpenchannelMessage']['find']({'where':{'id':_0x3f962b['params']['id']}})[_0x780f('0x32')](handleEntityNotFound(_0x13551c,null))['then'](removeEntity(_0x13551c,null))[_0x780f('0x25')](handleError(_0x13551c,null));};exports[_0x780f('0x56')]=function(_0x16a7b4,_0x57e7db){return db[_0x780f('0x38')][_0x780f('0x56')]()[_0x780f('0x32')](respondWithResult(_0x57e7db,null))['catch'](handleError(_0x57e7db,null));};var interaction_log=require(_0x780f('0x57'))('openchannel-interactions');exports[_0x780f('0x58')]=function(_0x46cd3c,_0x57a3a1,_0x454132){var _0x28772b={'channel':_0x780f('0x59')};if(_0x46cd3c[_0x780f('0x55')]['id']){delete _0x46cd3c[_0x780f('0x55')]['id'];}_0x46cd3c[_0x780f('0x55')][_0x780f('0x5a')]=!![];_0x46cd3c[_0x780f('0x55')]['readAt']=moment()[_0x780f('0x5b')](_0x780f('0x5c'));_0x46cd3c['body'][_0x780f('0x5d')]=_0x46cd3c[_0x780f('0x55')][_0x780f('0x5d')]||_0x46cd3c[_0x780f('0x5e')]['id'];return db[_0x780f('0x38')][_0x780f('0x53')]({'where':{'id':_0x46cd3c[_0x780f('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x780f('0x5f')],'as':'Contact'}]})[_0x780f('0x32')](handleEntityNotFound(_0x57a3a1,null))['then'](saveUpdates(_0x46cd3c[_0x780f('0x55')],null))[_0x780f('0x32')](function(_0x3c7ebf){if(_0x3c7ebf){_0x28772b['message']=_0x3c7ebf[_0x780f('0x60')]({'plain':!![]});return db[_0x780f('0x61')][_0x780f('0x53')]({'where':{'id':_0x3c7ebf['OpenchannelInteractionId']}});}return null;})[_0x780f('0x32')](handleEntityNotFound(_0x57a3a1,null))[_0x780f('0x32')](function(_0x352cac){if(_0x352cac){return _0x352cac[_0x780f('0x31')]({'UserId':_0x46cd3c[_0x780f('0x55')][_0x780f('0x5d')],'read1stAt':_[_0x780f('0x62')](_0x352cac[_0x780f('0x63')])?moment()[_0x780f('0x5b')](_0x780f('0x5c')):undefined});}return null;})[_0x780f('0x32')](function(_0x1f21e1){if(_0x1f21e1){_0x28772b[_0x780f('0x64')]=_0x1f21e1[_0x780f('0x60')]({'plain':!![]});interaction_log[_0x780f('0x1e')](_0x780f('0x65'),_0x46cd3c[_0x780f('0x5e')]['id'],_0x46cd3c[_0x780f('0x5e')]['name'],_0x46cd3c['user'][_0x780f('0x66')],_0x28772b[_0x780f('0x64')]['id'],_0x46cd3c['body']?JSON[_0x780f('0x67')](_0x46cd3c[_0x780f('0x55')]):'null');return respondWithRpcPromise(_0x780f('0x68'),_0x780f('0x69'),_0x28772b);}return null;})['then'](function(_0x5f29cd){if(_0x5f29cd){if(_0x46cd3c[_0x780f('0x55')][_0x780f('0x6a')]){_0x28772b['message'][_0x780f('0x6b')]=util[_0x780f('0x5b')](_0x780f('0x6c'),_0x46cd3c['user'][_0x780f('0x35')]);_0x28772b[_0x780f('0x23')]['channel']=_0x28772b['channel'];_0x28772b[_0x780f('0x23')]['event']=_0x780f('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x780f('0x6d'),'message':_0x28772b[_0x780f('0x23')]},client9002)[_0x780f('0x32')](function(){return _0x28772b;});}return _0x28772b;}return null;})[_0x780f('0x32')](respondWithResult(_0x57a3a1,null))[_0x780f('0x25')](handleError(_0x57a3a1,null));};var interaction_log=require(_0x780f('0x57'))('openchannel-interactions');exports['reject']=function(_0x27b5a9,_0x4fccde,_0x383830){var _0x5b6b72={'agent':{},'channel':_0x780f('0x59')};if(_0x27b5a9[_0x780f('0x55')]['id']){delete _0x27b5a9[_0x780f('0x55')]['id'];}_0x27b5a9[_0x780f('0x55')]['UserId']=_0x27b5a9['body']['UserId']||_0x27b5a9[_0x780f('0x5e')]['id'];_0x5b6b72['agent']['id']=_0x27b5a9[_0x780f('0x55')][_0x780f('0x5d')];return db[_0x780f('0x38')][_0x780f('0x53')]({'where':{'id':_0x27b5a9[_0x780f('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4fccde,null))[_0x780f('0x32')](function(_0x5be26d){if(_0x5be26d){_0x5b6b72[_0x780f('0x23')]=_0x5be26d[_0x780f('0x60')]({'plain':!![]});return db[_0x780f('0x61')]['find']({'where':{'id':_0x5be26d[_0x780f('0x6e')]}});}return null;})[_0x780f('0x32')](handleEntityNotFound(_0x4fccde,null))['then'](function(_0x4f2f35){if(_0x4f2f35){_0x5b6b72[_0x780f('0x64')]=_0x4f2f35['get']({'plain':!![]});interaction_log[_0x780f('0x1e')](_0x780f('0x6f'),_0x27b5a9[_0x780f('0x5e')]['id'],_0x27b5a9[_0x780f('0x5e')]['name'],_0x27b5a9['user'][_0x780f('0x66')],_0x5b6b72[_0x780f('0x64')]['id'],_0x27b5a9[_0x780f('0x55')]?JSON[_0x780f('0x67')](_0x27b5a9[_0x780f('0x55')]):'null');return respondWithRpcPromise('RejectMessage',_0x780f('0x70'),_0x5b6b72);}return null;})[_0x780f('0x32')](function(_0x1b3785){if(_0x1b3785){_0x1b3785[_0x780f('0x23')][_0x780f('0x6b')]=util[_0x780f('0x5b')]('SIP/%s',_0x27b5a9[_0x780f('0x5e')][_0x780f('0x35')]);_0x1b3785[_0x780f('0x23')][_0x780f('0x71')]=_0x5b6b72['channel'];_0x1b3785[_0x780f('0x23')]['event']='reject';respondWithRpcPromise(_0x780f('0x72'),_0x780f('0x72'),{'event':_0x780f('0x73'),'message':_0x1b3785[_0x780f('0x23')]},client9002);return _0x5b6b72;}return null;})[_0x780f('0x32')](respondWithResult(_0x4fccde,null))[_0x780f('0x25')](handleError(_0x4fccde,null));}; \ No newline at end of file +var _0xa1a0=['count','offset','limit','set','json','reject','save','update','then','stack','name','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end'];(function(_0x31a127,_0x346987){var _0x5c7f34=function(_0x3f055f){while(--_0x3f055f){_0x31a127['push'](_0x31a127['shift']());}};_0x5c7f34(++_0x346987);}(_0xa1a0,0x1be));var _0x0a1a=function(_0x356d1b,_0x2a9fb7){_0x356d1b=_0x356d1b-0x0;var _0x4c2ca4=_0xa1a0[_0x356d1b];return _0x4c2ca4;};'use strict';var pdf=require(_0x0a1a('0x0'));var emlformat=require(_0x0a1a('0x1'));var rimraf=require(_0x0a1a('0x2'));var zipdir=require(_0x0a1a('0x3'));var jsonpatch=require(_0x0a1a('0x4'));var rp=require(_0x0a1a('0x5'));var moment=require(_0x0a1a('0x6'));var BPromise=require(_0x0a1a('0x7'));var Mustache=require(_0x0a1a('0x8'));var util=require(_0x0a1a('0x9'));var path=require(_0x0a1a('0xa'));var sox=require(_0x0a1a('0xb'));var csv=require(_0x0a1a('0xc'));var ejs=require(_0x0a1a('0xd'));var fs=require('fs');var _=require(_0x0a1a('0xe'));var squel=require(_0x0a1a('0xf'));var crypto=require('crypto');var jsforce=require(_0x0a1a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0a1a('0xc'));var querystring=require(_0x0a1a('0x11'));var Papa=require(_0x0a1a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0a1a('0x13'));var as=require(_0x0a1a('0x14'));var hardwareService=require(_0x0a1a('0x15'));var logger=require(_0x0a1a('0x16'))('api');var utils=require(_0x0a1a('0x17'));var config=require(_0x0a1a('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a1a('0x19')](config['redis'],{'host':_0x0a1a('0x1a'),'port':0x18eb});var socket=require(_0x0a1a('0x1b'))(new Redis(config[_0x0a1a('0x1c')]));require(_0x0a1a('0x1d'))['register'](socket);var jayson=require(_0x0a1a('0x1e'));var client=jayson[_0x0a1a('0x1f')][_0x0a1a('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x0a1a('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5cfda0,_0x2273fe,_0x5a8b9){if(_0x5a8b9){var _0x55ae0b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55ae0b[_0x0a1a('0x21')](_0x2273fe)){return _0x5cfda0;}else{throw new db[(_0x0a1a('0x22'))][(_0x0a1a('0x23'))](_0x0a1a('0x24'));}}else{return _0x5cfda0;}}function respondWithRpcPromise(_0x33c571,_0x3a6862,_0x312471,_0x191ff9){return new BPromise(function(_0x51db10,_0x3b2ce2){var _0xc773ba=_0x191ff9||client;return _0xc773ba[_0x0a1a('0x25')](_0x33c571,_0x312471)['then'](function(_0x3395ef){logger[_0x0a1a('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x3a6862,_0x0a1a('0x27'));logger[_0x0a1a('0x28')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3a6862,_0x0a1a('0x27'),JSON[_0x0a1a('0x29')](_0x3395ef));if(_0x3395ef[_0x0a1a('0x2a')]){if(_0x3395ef[_0x0a1a('0x2a')][_0x0a1a('0x2b')]===0x1f4){logger[_0x0a1a('0x2a')](_0x0a1a('0x2c'),_0x3a6862,_0x3395ef[_0x0a1a('0x2a')][_0x0a1a('0x2d')]);return _0x3b2ce2(_0x3395ef[_0x0a1a('0x2a')][_0x0a1a('0x2d')]);}logger[_0x0a1a('0x2a')](_0x0a1a('0x2c'),_0x3a6862,_0x3395ef[_0x0a1a('0x2a')][_0x0a1a('0x2d')]);return _0x51db10(_0x3395ef[_0x0a1a('0x2a')][_0x0a1a('0x2d')]);}else{logger[_0x0a1a('0x26')](_0x0a1a('0x2c'),_0x3a6862,_0x0a1a('0x27'));_0x51db10(_0x3395ef['result'][_0x0a1a('0x2d')]);}})[_0x0a1a('0x2e')](function(_0x704e2f){logger[_0x0a1a('0x2a')](_0x0a1a('0x2c'),_0x3a6862,_0x704e2f);_0x3b2ce2(_0x704e2f);});});}function respondWithStatusCode(_0x15d531,_0x374fde){_0x374fde=_0x374fde||0xcc;return function(_0x224262){if(_0x224262){return _0x15d531[_0x0a1a('0x2f')](_0x374fde);}return _0x15d531[_0x0a1a('0x30')](_0x374fde)[_0x0a1a('0x31')]();};}function respondWithResult(_0x5b7dda,_0x25514b){_0x25514b=_0x25514b||0xc8;return function(_0x478e87){if(_0x478e87){return _0x5b7dda[_0x0a1a('0x30')](_0x25514b)['json'](_0x478e87);}};}function respondWithFilteredResult(_0x410d26,_0x3d8df6){return function(_0x5ea83c){if(_0x5ea83c){var _0x10a9ca=_0x5ea83c[_0x0a1a('0x32')],_0x3b8f0f=_0x3d8df6[_0x0a1a('0x33')],_0x4d3c2d=_0x3d8df6[_0x0a1a('0x33')]+_0x3d8df6[_0x0a1a('0x34')],_0x31a748;if(_0x4d3c2d>=_0x10a9ca){_0x4d3c2d=_0x10a9ca;_0x31a748=0xc8;}else{_0x31a748=0xce;}_0x410d26[_0x0a1a('0x30')](_0x31a748);return _0x410d26[_0x0a1a('0x35')]('Content-Range',_0x3b8f0f+'-'+_0x4d3c2d+'/'+_0x10a9ca)[_0x0a1a('0x36')](_0x5ea83c);}return null;};}function patchUpdates(_0x57a53e){return function(_0x113c0a){try{jsonpatch['apply'](_0x113c0a,_0x57a53e,!![]);}catch(_0xdb0409){return BPromise[_0x0a1a('0x37')](_0xdb0409);}return _0x113c0a[_0x0a1a('0x38')]();};}function saveUpdates(_0x351c24,_0x3621a2){return function(_0x24a2c4){if(_0x24a2c4){return _0x24a2c4[_0x0a1a('0x39')](_0x351c24)[_0x0a1a('0x3a')](function(_0x3811cb){return _0x3811cb;});}return null;};}function removeEntity(_0x5be802,_0x23574e){return function(_0x2f9075){if(_0x2f9075){return _0x2f9075['destroy']()[_0x0a1a('0x3a')](function(){_0x5be802['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a6936,_0x47d872){return function(_0x159805){if(!_0x159805){_0x3a6936[_0x0a1a('0x2f')](0x194);}return _0x159805;};}function handleError(_0x28eba7,_0x3392b2){_0x3392b2=_0x3392b2||0x1f4;return function(_0x1dea96){logger[_0x0a1a('0x2a')](_0x1dea96[_0x0a1a('0x3b')]);if(_0x1dea96[_0x0a1a('0x3c')]){delete _0x1dea96[_0x0a1a('0x3c')];}_0x28eba7['status'](_0x3392b2)['send'](_0x1dea96);};}exports['index']=function(_0x2953f2,_0x3f0c3a){var _0x4c7bfe={},_0x151f60={},_0x10e76e={'count':0x0,'rows':[]};var _0x14b4af=_[_0x0a1a('0x3d')](db[_0x0a1a('0x3e')][_0x0a1a('0x3f')],function(_0x4b6f97){return{'name':_0x4b6f97[_0x0a1a('0x40')],'type':_0x4b6f97[_0x0a1a('0x41')][_0x0a1a('0x42')]};});_0x151f60[_0x0a1a('0x43')]=_[_0x0a1a('0x3d')](_0x14b4af,_0x0a1a('0x3c'));_0x151f60['query']=_[_0x0a1a('0x44')](_0x2953f2[_0x0a1a('0x45')]);_0x151f60[_0x0a1a('0x46')]=_[_0x0a1a('0x47')](_0x151f60[_0x0a1a('0x43')],_0x151f60[_0x0a1a('0x45')]);_0x4c7bfe[_0x0a1a('0x48')]=_[_0x0a1a('0x47')](_0x151f60[_0x0a1a('0x43')],qs[_0x0a1a('0x49')](_0x2953f2['query'][_0x0a1a('0x49')]));_0x4c7bfe['attributes']=_0x4c7bfe[_0x0a1a('0x48')][_0x0a1a('0x4a')]?_0x4c7bfe[_0x0a1a('0x48')]:_0x151f60['model'];if(!_0x2953f2[_0x0a1a('0x45')][_0x0a1a('0x4b')](_0x0a1a('0x4c'))){_0x4c7bfe[_0x0a1a('0x34')]=qs['limit'](_0x2953f2['query'][_0x0a1a('0x34')]);_0x4c7bfe[_0x0a1a('0x33')]=qs[_0x0a1a('0x33')](_0x2953f2[_0x0a1a('0x45')][_0x0a1a('0x33')]);}_0x4c7bfe[_0x0a1a('0x4d')]=qs[_0x0a1a('0x4e')](_0x2953f2[_0x0a1a('0x45')][_0x0a1a('0x4e')]);_0x4c7bfe[_0x0a1a('0x4f')]=qs[_0x0a1a('0x46')](_[_0x0a1a('0x50')](_0x2953f2[_0x0a1a('0x45')],_0x151f60[_0x0a1a('0x46')]));if(_0x2953f2[_0x0a1a('0x45')][_0x0a1a('0x51')]){_0x4c7bfe[_0x0a1a('0x4f')]=_[_0x0a1a('0x52')](_0x4c7bfe[_0x0a1a('0x4f')],{'$or':_[_0x0a1a('0x3d')](_0x14b4af,function(_0x34a3da){if(_0x34a3da[_0x0a1a('0x41')]!==_0x0a1a('0x53')){var _0x5a56b6={};_0x5a56b6[_0x34a3da[_0x0a1a('0x3c')]]={'$like':'%'+_0x2953f2[_0x0a1a('0x45')]['filter']+'%'};return _0x5a56b6;}})});}_0x4c7bfe=_['merge']({},_0x4c7bfe,_0x2953f2[_0x0a1a('0x54')]);var _0x91ea0e={'where':_0x4c7bfe['where']};return db[_0x0a1a('0x3e')][_0x0a1a('0x32')](_0x91ea0e)[_0x0a1a('0x3a')](function(_0x1062a1){_0x10e76e['count']=_0x1062a1;if(_0x2953f2[_0x0a1a('0x45')][_0x0a1a('0x55')]){_0x4c7bfe[_0x0a1a('0x56')]=[{'all':!![]}];}return db[_0x0a1a('0x3e')][_0x0a1a('0x57')](_0x4c7bfe);})[_0x0a1a('0x3a')](function(_0x178a42){_0x10e76e[_0x0a1a('0x58')]=_0x178a42;return _0x10e76e;})[_0x0a1a('0x3a')](respondWithFilteredResult(_0x3f0c3a,_0x4c7bfe))['catch'](handleError(_0x3f0c3a,null));};exports[_0x0a1a('0x59')]=function(_0x41c27d,_0x53088d){var _0x1c50b1={'raw':!![],'where':{'id':_0x41c27d[_0x0a1a('0x5a')]['id']}},_0x36dc7f={};_0x36dc7f['model']=_[_0x0a1a('0x44')](db[_0x0a1a('0x3e')][_0x0a1a('0x3f')]);_0x36dc7f[_0x0a1a('0x45')]=_[_0x0a1a('0x44')](_0x41c27d[_0x0a1a('0x45')]);_0x36dc7f[_0x0a1a('0x46')]=_[_0x0a1a('0x47')](_0x36dc7f['model'],_0x36dc7f[_0x0a1a('0x45')]);_0x1c50b1[_0x0a1a('0x48')]=_[_0x0a1a('0x47')](_0x36dc7f[_0x0a1a('0x43')],qs['fields'](_0x41c27d['query'][_0x0a1a('0x49')]));_0x1c50b1[_0x0a1a('0x48')]=_0x1c50b1[_0x0a1a('0x48')][_0x0a1a('0x4a')]?_0x1c50b1['attributes']:_0x36dc7f[_0x0a1a('0x43')];if(_0x41c27d[_0x0a1a('0x45')]['includeAll']){_0x1c50b1[_0x0a1a('0x56')]=[{'all':!![]}];}_0x1c50b1=_[_0x0a1a('0x52')]({},_0x1c50b1,_0x41c27d[_0x0a1a('0x54')]);return db[_0x0a1a('0x3e')][_0x0a1a('0x5b')](_0x1c50b1)[_0x0a1a('0x3a')](handleEntityNotFound(_0x53088d,null))[_0x0a1a('0x3a')](respondWithResult(_0x53088d,null))[_0x0a1a('0x2e')](handleError(_0x53088d,null));};exports[_0x0a1a('0x5c')]=function(_0x42c6b0,_0x4974b8){return db['OpenchannelMessage'][_0x0a1a('0x5c')](_0x42c6b0['body'],{})[_0x0a1a('0x3a')](respondWithResult(_0x4974b8,0xc9))[_0x0a1a('0x2e')](handleError(_0x4974b8,null));};exports[_0x0a1a('0x39')]=function(_0x439044,_0x23e4af){if(_0x439044[_0x0a1a('0x5d')]['id']){delete _0x439044['body']['id'];}return db[_0x0a1a('0x3e')]['find']({'where':{'id':_0x439044[_0x0a1a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x23e4af,null))[_0x0a1a('0x3a')](saveUpdates(_0x439044[_0x0a1a('0x5d')],null))[_0x0a1a('0x3a')](respondWithResult(_0x23e4af,null))[_0x0a1a('0x2e')](handleError(_0x23e4af,null));};exports[_0x0a1a('0x5e')]=function(_0x22c7d3,_0x293f45){return db[_0x0a1a('0x3e')][_0x0a1a('0x5b')]({'where':{'id':_0x22c7d3[_0x0a1a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x293f45,null))[_0x0a1a('0x3a')](removeEntity(_0x293f45,null))[_0x0a1a('0x2e')](handleError(_0x293f45,null));};exports['describe']=function(_0x3c2755,_0x499756){return db[_0x0a1a('0x3e')][_0x0a1a('0x5f')]()['then'](respondWithResult(_0x499756,null))[_0x0a1a('0x2e')](handleError(_0x499756,null));};var interaction_log=require(_0x0a1a('0x16'))(_0x0a1a('0x60'));exports[_0x0a1a('0x61')]=function(_0x55295c,_0x55d2cb,_0x36142c){var _0x86c997={'channel':_0x0a1a('0x62')};if(_0x55295c[_0x0a1a('0x5d')]['id']){delete _0x55295c['body']['id'];}_0x55295c['body'][_0x0a1a('0x63')]=!![];_0x55295c[_0x0a1a('0x5d')]['readAt']=moment()[_0x0a1a('0x64')](_0x0a1a('0x65'));_0x55295c['body'][_0x0a1a('0x66')]=_0x55295c[_0x0a1a('0x5d')]['UserId']||_0x55295c['user']['id'];return db[_0x0a1a('0x3e')][_0x0a1a('0x5b')]({'where':{'id':_0x55295c[_0x0a1a('0x5a')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x0a1a('0x67')}]})['then'](handleEntityNotFound(_0x55d2cb,null))['then'](saveUpdates(_0x55295c[_0x0a1a('0x5d')],null))['then'](function(_0x1d7475){if(_0x1d7475){_0x86c997[_0x0a1a('0x2d')]=_0x1d7475[_0x0a1a('0x68')]({'plain':!![]});return db[_0x0a1a('0x69')][_0x0a1a('0x5b')]({'where':{'id':_0x1d7475[_0x0a1a('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x55d2cb,null))[_0x0a1a('0x3a')](function(_0x592457){if(_0x592457){return _0x592457['update']({'UserId':_0x55295c['body'][_0x0a1a('0x66')],'read1stAt':_[_0x0a1a('0x6b')](_0x592457['read1stAt'])?moment()[_0x0a1a('0x64')](_0x0a1a('0x65')):undefined});}return null;})[_0x0a1a('0x3a')](function(_0x5011da){if(_0x5011da){_0x86c997[_0x0a1a('0x6c')]=_0x5011da[_0x0a1a('0x68')]({'plain':!![]});interaction_log[_0x0a1a('0x26')](_0x0a1a('0x6d'),_0x55295c[_0x0a1a('0x6e')]['id'],_0x55295c['user'][_0x0a1a('0x3c')],_0x55295c[_0x0a1a('0x6e')][_0x0a1a('0x6f')],_0x86c997[_0x0a1a('0x6c')]['id'],_0x55295c[_0x0a1a('0x5d')]?JSON[_0x0a1a('0x29')](_0x55295c[_0x0a1a('0x5d')]):'null');return respondWithRpcPromise(_0x0a1a('0x70'),_0x0a1a('0x71'),_0x86c997);}return null;})[_0x0a1a('0x3a')](function(_0x3beac1){if(_0x3beac1){if(_0x55295c[_0x0a1a('0x5d')][_0x0a1a('0x72')]){_0x86c997['message'][_0x0a1a('0x73')]=util['format']('SIP/%s',_0x55295c[_0x0a1a('0x6e')][_0x0a1a('0x3c')]);_0x86c997['message'][_0x0a1a('0x74')]=_0x86c997[_0x0a1a('0x74')];_0x86c997[_0x0a1a('0x2d')][_0x0a1a('0x75')]=_0x0a1a('0x61');return respondWithRpcPromise(_0x0a1a('0x76'),_0x0a1a('0x76'),{'event':_0x0a1a('0x77'),'message':_0x86c997[_0x0a1a('0x2d')]},client9002)[_0x0a1a('0x3a')](function(){return _0x86c997;});}return _0x86c997;}return null;})[_0x0a1a('0x3a')](respondWithResult(_0x55d2cb,null))[_0x0a1a('0x2e')](handleError(_0x55d2cb,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x0a1a('0x37')]=function(_0xff838b,_0x3cc6c,_0x4f2772){var _0x553b2b={'agent':{},'channel':'openchannel'};if(_0xff838b[_0x0a1a('0x5d')]['id']){delete _0xff838b[_0x0a1a('0x5d')]['id'];}_0xff838b['body'][_0x0a1a('0x66')]=_0xff838b[_0x0a1a('0x5d')][_0x0a1a('0x66')]||_0xff838b['user']['id'];_0x553b2b[_0x0a1a('0x78')]['id']=_0xff838b['body']['UserId'];return db[_0x0a1a('0x3e')][_0x0a1a('0x5b')]({'where':{'id':_0xff838b[_0x0a1a('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3cc6c,null))[_0x0a1a('0x3a')](function(_0x22e801){if(_0x22e801){_0x553b2b[_0x0a1a('0x2d')]=_0x22e801[_0x0a1a('0x68')]({'plain':!![]});return db['OpenchannelInteraction'][_0x0a1a('0x5b')]({'where':{'id':_0x22e801[_0x0a1a('0x6a')]}});}return null;})[_0x0a1a('0x3a')](handleEntityNotFound(_0x3cc6c,null))[_0x0a1a('0x3a')](function(_0x5586f0){if(_0x5586f0){_0x553b2b[_0x0a1a('0x6c')]=_0x5586f0['get']({'plain':!![]});interaction_log[_0x0a1a('0x26')](_0x0a1a('0x79'),_0xff838b['user']['id'],_0xff838b[_0x0a1a('0x6e')]['name'],_0xff838b[_0x0a1a('0x6e')]['role'],_0x553b2b['interaction']['id'],_0xff838b[_0x0a1a('0x5d')]?JSON[_0x0a1a('0x29')](_0xff838b[_0x0a1a('0x5d')]):'null');return respondWithRpcPromise(_0x0a1a('0x7a'),_0x0a1a('0x7b'),_0x553b2b);}return null;})[_0x0a1a('0x3a')](function(_0x344054){if(_0x344054){_0x344054['message']['interface']=util[_0x0a1a('0x64')]('SIP/%s',_0xff838b['user'][_0x0a1a('0x3c')]);_0x344054[_0x0a1a('0x2d')][_0x0a1a('0x74')]=_0x553b2b[_0x0a1a('0x74')];_0x344054[_0x0a1a('0x2d')][_0x0a1a('0x75')]=_0x0a1a('0x37');respondWithRpcPromise(_0x0a1a('0x76'),_0x0a1a('0x76'),{'event':'rejectmessage','message':_0x344054['message']},client9002);return _0x553b2b;}return null;})[_0x0a1a('0x3a')](respondWithResult(_0x3cc6c,null))['catch'](handleError(_0x3cc6c,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9703744..aee24ba 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 _0xffea=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x440d05,_0x115c4a){var _0xa4d9d9=function(_0x5ac52e){while(--_0x5ac52e){_0x440d05['push'](_0x440d05['shift']());}};_0xa4d9d9(++_0x115c4a);}(_0xffea,0x10d));var _0xaffe=function(_0x3e6055,_0x5a9b27){_0x3e6055=_0x3e6055-0x0;var _0x27ef6e=_0xffea[_0x3e6055];return _0x27ef6e;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xaffe('0x0'))['db'][_0xaffe('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xaffe('0x2')](0x0);var events={'afterCreate':_0xaffe('0x3'),'afterUpdate':_0xaffe('0x4'),'afterDestroy':_0xaffe('0x5')};function emitEvent(_0x5ebad1){return function(_0x41f587,_0x3fe866,_0x199afc){OpenchannelMessageEvents['emit'](_0x5ebad1+':'+_0x41f587['id'],_0x41f587);OpenchannelMessageEvents[_0xaffe('0x6')](_0x5ebad1,_0x41f587);_0x199afc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xaffe('0x7')](e,emitEvent(event));}}module[_0xaffe('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xf722=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x559aab,_0x4b7dc4){var _0x5e5801=function(_0xb3a24f){while(--_0xb3a24f){_0x559aab['push'](_0x559aab['shift']());}};_0x5e5801(++_0x4b7dc4);}(_0xf722,0x127));var _0x2f72=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf722[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x2f72('0x0'))['db'][_0x2f72('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2f72('0x2')](0x0);var events={'afterCreate':_0x2f72('0x3'),'afterUpdate':_0x2f72('0x4'),'afterDestroy':_0x2f72('0x5')};function emitEvent(_0x22a11d){return function(_0x5293e3,_0x499758,_0x1b63a2){OpenchannelMessageEvents['emit'](_0x22a11d+':'+_0x5293e3['id'],_0x5293e3);OpenchannelMessageEvents[_0x2f72('0x6')](_0x22a11d,_0x5293e3);_0x1b63a2(null);};}for(var e in events){if(events[_0x2f72('0x7')](e)){var event=events[e];OpenchannelMessage[_0x2f72('0x8')](e,emitEvent(event));}}module[_0x2f72('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1508d35..df511dc 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 _0x3ee5=['findOne','OpenchannelInteractionId','update','createdAt','error','CmContact','describe','then','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','GET','threadId','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3ee5,0x15b));var _0x53ee=function(_0x157fa8,_0x5b70d5){_0x157fa8=_0x157fa8-0x0;var _0x447c87=_0x3ee5[_0x157fa8];return _0x447c87;};'use strict';var _=require(_0x53ee('0x0'));var util=require(_0x53ee('0x1'));var logger=require(_0x53ee('0x2'))(_0x53ee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53ee('0x4'));var fs=require('fs');var path=require(_0x53ee('0x5'));var rimraf=require(_0x53ee('0x6'));var config=require(_0x53ee('0x7'));var attributes=require(_0x53ee('0x8'));module[_0x53ee('0x9')]=function(_0x4a2c07,_0xeaf2f1){return _0x4a2c07[_0x53ee('0xa')](_0x53ee('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x53ee('0xc'),'fields':[_0x53ee('0xd')],'type':_0x53ee('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22fcf4,_0x3c228e,_0x11d473){var _0x18dbba=_0x4a2c07[_0x53ee('0xf')];var _0x34cda2=_0x22fcf4[_0x53ee('0x10')]({'plain':!![]});if(_0x34cda2[_0x53ee('0x11')][_0x53ee('0x12')]()==='in'||_0x34cda2[_0x53ee('0x11')][_0x53ee('0x12')]()===_0x53ee('0x13')&&!_0x34cda2[_0x53ee('0x14')]&&!_[_0x53ee('0x15')](_0x34cda2[_0x53ee('0x16')])){_0x18dbba[_0x53ee('0x17')][_0x53ee('0x18')]({'where':{'id':_0x34cda2[_0x53ee('0x19')]}})['then'](function(_0x4eb372){if(_0x4eb372){_0x4eb372[_0x53ee('0x1a')]({'lastMsgAt':_0x34cda2[_0x53ee('0x1b')],'lastMsgDirection':_0x34cda2[_0x53ee('0x11')][_0x53ee('0x12')]()});}})['catch'](function(_0x4d1b8b){console[_0x53ee('0x1c')](_0x4d1b8b);});}if(_0x34cda2[_0x53ee('0x11')]===_0x53ee('0x13')&&!_0x34cda2[_0x53ee('0x14')]){var _0x273a43;_0x18dbba[_0x53ee('0x1d')][_0x53ee('0x1e')]()[_0x53ee('0x1f')](function(_0xfac7a){return _0x18dbba[_0x53ee('0x20')]['find']({'where':{'id':_0x34cda2[_0x53ee('0x21')]},'include':[{'model':_0x18dbba['OpenchannelInteraction'],'as':_0x53ee('0x22'),'where':{'id':_0x34cda2['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x18dbba[_0x53ee('0x1d')],'as':_0x53ee('0x23'),'attributes':_[_0x53ee('0x24')](_0xfac7a)}]}]});})[_0x53ee('0x1f')](function(_0x31efe0){_0x273a43=_0x31efe0[_0x53ee('0x10')]({'plain':!![]});if(_0x273a43&&_0x273a43[_0x53ee('0x25')]){logger[_0x53ee('0x26')](_0x53ee('0x27'),_0x53ee('0x28'),util[_0x53ee('0x29')](_0x53ee('0x2a'),_0x34cda2['id'],_0x273a43[_0x53ee('0x25')]));if(_0x273a43[_0x53ee('0x22')]&&_0x273a43[_0x53ee('0x22')][_0x53ee('0x2b')]){_0x34cda2[_0x53ee('0x2c')]=_['omit'](_0x273a43[_0x53ee('0x22')][0x0],_0x53ee('0x23'));_0x34cda2[_0x53ee('0x23')]=_0x273a43[_0x53ee('0x22')][0x0][_0x53ee('0x23')];}var _0x3c228e={'method':_0x53ee('0x2d'),'uri':encodeURI(_0x273a43[_0x53ee('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3c228e[_0x53ee('0x2e')]){case _0x53ee('0x2f'):_0x3c228e['qs']=_0x34cda2;break;case'POST':_0x3c228e[_0x53ee('0xd')]=_0x34cda2;break;}return rp(_0x3c228e)[_0x53ee('0x1f')](function(_0x14734c){logger['info'](_0x53ee('0x27'),'afterCreate',util[_0x53ee('0x29')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x34cda2['id'],_0x273a43['replyUri']));if(_0x14734c[_0x53ee('0xd')][_0x53ee('0x30')]&&_0x14734c[_0x53ee('0xd')][_0x53ee('0x30')]!=_0x34cda2['Interaction'][_0x53ee('0x30')]){return _0x18dbba['OpenchannelInteraction'][_0x53ee('0x1a')]({'threadId':_0x14734c[_0x53ee('0xd')]['threadId']},{'logging':!![],'where':{'id':_0x34cda2[_0x53ee('0x2c')]['id']}});}else{return;}})[_0x53ee('0x1f')](function(){return _0x22fcf4[_0x53ee('0x1a')]({'read':!![]});})[_0x53ee('0x31')](function(_0x102381){logger[_0x53ee('0x1c')](_0x53ee('0x27'),_0x53ee('0x28'),util[_0x53ee('0x32')](_0x102381,{'showHidden':![],'depth':null}));_0x11d473();});}else{_0x11d473();}})['finally'](function(){_0x11d473();});}else{_0x11d473();}}},'charset':_0x53ee('0x33'),'collate':_0x53ee('0x34')});}; \ No newline at end of file +var _0xf824=['direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','Contact','POST','method','GET','body','OpenchannelMessage,\x20%s,\x20%s','threadId','update','error','inspect','finally','utf8mb4','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','models','get'];(function(_0x2c6af3,_0x3ce442){var _0x4895bf=function(_0x5566cf){while(--_0x5566cf){_0x2c6af3['push'](_0x2c6af3['shift']());}};_0x4895bf(++_0x3ce442);}(_0xf824,0xc1));var _0x4f82=function(_0x422baa,_0x98d34a){_0x422baa=_0x422baa-0x0;var _0x31c810=_0xf824[_0x422baa];return _0x31c810;};'use strict';var _=require(_0x4f82('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f82('0x1'));var moment=require(_0x4f82('0x2'));var BPromise=require('bluebird');var rp=require(_0x4f82('0x3'));var fs=require('fs');var path=require(_0x4f82('0x4'));var rimraf=require(_0x4f82('0x5'));var config=require(_0x4f82('0x6'));var attributes=require(_0x4f82('0x7'));module[_0x4f82('0x8')]=function(_0x2c26a2,_0x2b20e6){return _0x2c26a2[_0x4f82('0x9')](_0x4f82('0xa'),attributes,{'tableName':_0x4f82('0xb'),'paranoid':![],'indexes':[{'name':_0x4f82('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x189cf2,_0x5a9075,_0x37c80b){var _0x49abf3=_0x2c26a2[_0x4f82('0xd')];var _0x22767e=_0x189cf2[_0x4f82('0xe')]({'plain':!![]});if(_0x22767e[_0x4f82('0xf')][_0x4f82('0x10')]()==='in'||_0x22767e[_0x4f82('0xf')][_0x4f82('0x10')]()===_0x4f82('0x11')&&!_0x22767e[_0x4f82('0x12')]&&!_[_0x4f82('0x13')](_0x22767e[_0x4f82('0x14')])){_0x49abf3[_0x4f82('0x15')][_0x4f82('0x16')]({'where':{'id':_0x22767e[_0x4f82('0x17')]}})[_0x4f82('0x18')](function(_0x388dee){if(_0x388dee){_0x388dee['update']({'lastMsgAt':_0x22767e[_0x4f82('0x19')],'lastMsgDirection':_0x22767e[_0x4f82('0xf')]['toLowerCase']()});}})[_0x4f82('0x1a')](function(_0x558142){console['error'](_0x558142);});}if(_0x22767e[_0x4f82('0xf')]===_0x4f82('0x11')&&!_0x22767e[_0x4f82('0x12')]){var _0x1df04f;_0x49abf3['CmContact']['describe']()[_0x4f82('0x18')](function(_0x12bbe4){return _0x49abf3[_0x4f82('0x1b')][_0x4f82('0x1c')]({'where':{'id':_0x22767e[_0x4f82('0x1d')]},'include':[{'model':_0x49abf3[_0x4f82('0x15')],'as':_0x4f82('0x1e'),'where':{'id':_0x22767e[_0x4f82('0x17')]},'limit':0x1,'include':[{'model':_0x49abf3[_0x4f82('0x1f')],'as':'Contact','attributes':_[_0x4f82('0x20')](_0x12bbe4)}]}]});})['then'](function(_0x2848f3){_0x1df04f=_0x2848f3[_0x4f82('0xe')]({'plain':!![]});if(_0x1df04f&&_0x1df04f[_0x4f82('0x21')]){logger[_0x4f82('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f82('0x23'),util[_0x4f82('0x24')](_0x4f82('0x25'),_0x22767e['id'],_0x1df04f[_0x4f82('0x21')]));if(_0x1df04f['Interactions']&&_0x1df04f[_0x4f82('0x1e')]['length']){_0x22767e[_0x4f82('0x26')]=_[_0x4f82('0x27')](_0x1df04f[_0x4f82('0x1e')][0x0],'Contact');_0x22767e[_0x4f82('0x28')]=_0x1df04f['Interactions'][0x0]['Contact'];}var _0x5a9075={'method':_0x4f82('0x29'),'uri':encodeURI(_0x1df04f[_0x4f82('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5a9075[_0x4f82('0x2a')]){case _0x4f82('0x2b'):_0x5a9075['qs']=_0x22767e;break;case _0x4f82('0x29'):_0x5a9075[_0x4f82('0x2c')]=_0x22767e;break;}return rp(_0x5a9075)['then'](function(_0xd57eaa){logger['info'](_0x4f82('0x2d'),_0x4f82('0x23'),util[_0x4f82('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x22767e['id'],_0x1df04f[_0x4f82('0x21')]));if(_0xd57eaa['body']['threadId']&&_0xd57eaa[_0x4f82('0x2c')][_0x4f82('0x2e')]!=_0x22767e[_0x4f82('0x26')][_0x4f82('0x2e')]){return _0x49abf3[_0x4f82('0x15')][_0x4f82('0x2f')]({'threadId':_0xd57eaa['body'][_0x4f82('0x2e')]},{'logging':!![],'where':{'id':_0x22767e[_0x4f82('0x26')]['id']}});}else{return;}})[_0x4f82('0x18')](function(){return _0x189cf2[_0x4f82('0x2f')]({'read':!![]});})[_0x4f82('0x1a')](function(_0x5cf85a){logger[_0x4f82('0x30')](_0x4f82('0x2d'),'afterCreate',util[_0x4f82('0x31')](_0x5cf85a,{'showHidden':![],'depth':null}));_0x37c80b();});}else{_0x37c80b();}})[_0x4f82('0x32')](function(){_0x37c80b();});}else{_0x37c80b();}}},'charset':_0x4f82('0x33'),'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 0b190bf..08006e2 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 _0x15ef=['debug','stringify','error','code','message','info','catch','CreateOpenchannelMessage','create','options','raw','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelMessage.socket','register','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x15ef,0x80));var _0xf15e=function(_0x22ad50,_0x456b90){_0x22ad50=_0x22ad50-0x0;var _0x3e8eb3=_0x15ef[_0x22ad50];return _0x3e8eb3;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var moment=require(_0xf15e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf15e('0x2'));var fs=require('fs');var Redis=require(_0xf15e('0x3'));var db=require(_0xf15e('0x4'))['db'];var utils=require(_0xf15e('0x5'));var logger=require(_0xf15e('0x6'))('rpc');var config=require(_0xf15e('0x7'));var jayson=require(_0xf15e('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf15e('0x9')]=_[_0xf15e('0xa')](config['redis'],{'host':_0xf15e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf15e('0x9')]));require(_0xf15e('0xc'))[_0xf15e('0xd')](socket);function respondWithRpcPromise(_0x403e52,_0x556bf5,_0x492fa3){return new BPromise(function(_0x5a14f5,_0x250a60){return client[_0xf15e('0xe')](_0x403e52,_0x492fa3)['then'](function(_0x5e487f){logger['info'](_0xf15e('0xf'),_0x556bf5,_0xf15e('0x10'));logger[_0xf15e('0x11')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x556bf5,_0xf15e('0x10'),JSON[_0xf15e('0x12')](_0x5e487f));if(_0x5e487f[_0xf15e('0x13')]){if(_0x5e487f['error'][_0xf15e('0x14')]===0x1f4){logger[_0xf15e('0x13')](_0xf15e('0xf'),_0x556bf5,_0x5e487f[_0xf15e('0x13')][_0xf15e('0x15')]);return _0x250a60(_0x5e487f[_0xf15e('0x13')][_0xf15e('0x15')]);}logger[_0xf15e('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x556bf5,_0x5e487f[_0xf15e('0x13')][_0xf15e('0x15')]);return _0x5a14f5(_0x5e487f['error'][_0xf15e('0x15')]);}else{logger[_0xf15e('0x16')](_0xf15e('0xf'),_0x556bf5,'request\x20sent');_0x5a14f5(_0x5e487f['result'][_0xf15e('0x15')]);}})[_0xf15e('0x17')](function(_0x503df0){logger[_0xf15e('0x13')](_0xf15e('0xf'),_0x556bf5,_0x503df0);_0x250a60(_0x503df0);});});}exports[_0xf15e('0x18')]=function(_0x4b144c){var _0x4d78cd=this;return new Promise(function(_0x1b44d9,_0x3fa737){return db['OpenchannelMessage'][_0xf15e('0x19')](_0x4b144c['body'],{'raw':_0x4b144c['options']?_0x4b144c[_0xf15e('0x1a')][_0xf15e('0x1b')]===undefined?!![]:![]:!![]})[_0xf15e('0x1c')](function(_0x9ece34){logger['info'](_0xf15e('0x18'),_0x4b144c);logger[_0xf15e('0x11')](_0xf15e('0x18'),_0x4b144c,JSON['stringify'](_0x9ece34));_0x1b44d9(_0x9ece34);})[_0xf15e('0x17')](function(_0x43f8f2){logger['error']('CreateOpenchannelMessage',_0x43f8f2[_0xf15e('0x15')],_0x4b144c);_0x3fa737(_0x4d78cd[_0xf15e('0x13')](0x1f4,_0x43f8f2[_0xf15e('0x15')]));});});}; \ No newline at end of file +var _0xf108=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','stringify','lodash','moment','bluebird'];(function(_0x218795,_0x35f090){var _0x1a1c8b=function(_0x2a8fcf){while(--_0x2a8fcf){_0x218795['push'](_0x218795['shift']());}};_0x1a1c8b(++_0x35f090);}(_0xf108,0x1d9));var _0x8f10=function(_0x3a0a35,_0x245ff6){_0x3a0a35=_0x3a0a35-0x0;var _0x38608a=_0xf108[_0x3a0a35];return _0x38608a;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});config[_0x8f10('0xa')]=_[_0x8f10('0xb')](config[_0x8f10('0xa')],{'host':_0x8f10('0xc'),'port':0x18eb});var socket=require(_0x8f10('0xd'))(new Redis(config['redis']));require(_0x8f10('0xe'))[_0x8f10('0xf')](socket);function respondWithRpcPromise(_0x1bbe48,_0x1d863a,_0x37527d){return new BPromise(function(_0x7003f3,_0x2e00f7){return client[_0x8f10('0x10')](_0x1bbe48,_0x37527d)[_0x8f10('0x11')](function(_0x23c485){logger[_0x8f10('0x12')](_0x8f10('0x13'),_0x1d863a,_0x8f10('0x14'));logger[_0x8f10('0x15')](_0x8f10('0x16'),_0x1d863a,'request\x20sent',JSON['stringify'](_0x23c485));if(_0x23c485[_0x8f10('0x17')]){if(_0x23c485[_0x8f10('0x17')][_0x8f10('0x18')]===0x1f4){logger[_0x8f10('0x17')](_0x8f10('0x13'),_0x1d863a,_0x23c485[_0x8f10('0x17')][_0x8f10('0x19')]);return _0x2e00f7(_0x23c485[_0x8f10('0x17')][_0x8f10('0x19')]);}logger['error'](_0x8f10('0x13'),_0x1d863a,_0x23c485[_0x8f10('0x17')][_0x8f10('0x19')]);return _0x7003f3(_0x23c485['error'][_0x8f10('0x19')]);}else{logger[_0x8f10('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d863a,_0x8f10('0x14'));_0x7003f3(_0x23c485[_0x8f10('0x1a')][_0x8f10('0x19')]);}})[_0x8f10('0x1b')](function(_0x48eb4f){logger['error'](_0x8f10('0x13'),_0x1d863a,_0x48eb4f);_0x2e00f7(_0x48eb4f);});});}exports[_0x8f10('0x1c')]=function(_0x3a6165){var _0x34d6be=this;return new Promise(function(_0x301775,_0xfdb66e){return db[_0x8f10('0x1d')][_0x8f10('0x1e')](_0x3a6165[_0x8f10('0x1f')],{'raw':_0x3a6165[_0x8f10('0x20')]?_0x3a6165[_0x8f10('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x8f10('0x11')](function(_0x485e83){logger['info']('CreateOpenchannelMessage',_0x3a6165);logger[_0x8f10('0x15')]('CreateOpenchannelMessage',_0x3a6165,JSON[_0x8f10('0x21')](_0x485e83));_0x301775(_0x485e83);})[_0x8f10('0x1b')](function(_0x2cbbf4){logger[_0x8f10('0x17')](_0x8f10('0x1c'),_0x2cbbf4[_0x8f10('0x19')],_0x3a6165);_0xfdb66e(_0x34d6be[_0x8f10('0x17')](0x1f4,_0x2cbbf4[_0x8f10('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1ae6a6c..823c374 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 _0xd8b0=['save','emit','./openchannelMessage.events'];(function(_0x5003ca,_0x3e1865){var _0x1d25cf=function(_0x172706){while(--_0x172706){_0x5003ca['push'](_0x5003ca['shift']());}};_0x1d25cf(++_0x3e1865);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelMessageEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){OpenchannelMessageEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('openchannelMessage:'+_0x413284,_0x3f8b6f);OpenchannelMessageEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0xb43b=['./openchannelMessage.events','save','update','emit','removeListener','length','openchannelMessage:'];(function(_0x5d7803,_0x30e9aa){var _0x1a43b2=function(_0x1359df){while(--_0x1359df){_0x5d7803['push'](_0x5d7803['shift']());}};_0x1a43b2(++_0x30e9aa);}(_0xb43b,0x1b2));var _0xbb43=function(_0x488a58,_0x447674){_0x488a58=_0x488a58-0x0;var _0x5b6186=_0xb43b[_0x488a58];return _0x5b6186;};'use strict';var OpenchannelMessageEvents=require(_0xbb43('0x0'));var events=[_0xbb43('0x1'),'remove',_0xbb43('0x2')];function createListener(_0x1995f8,_0x22bc86){return function(_0x4cf605){_0x22bc86[_0xbb43('0x3')](_0x1995f8,_0x4cf605);};}function removeListener(_0x41aff6,_0x351254){return function(){OpenchannelMessageEvents[_0xbb43('0x4')](_0x41aff6,_0x351254);};}exports['register']=function(_0x491fb9){for(var _0x378df5=0x0,_0x553520=events[_0xbb43('0x5')];_0x378df5<_0x553520;_0x378df5++){var _0x1ccd49=events[_0x378df5];var _0x2a2f11=createListener(_0xbb43('0x6')+_0x1ccd49,_0x491fb9);OpenchannelMessageEvents['on'](_0x1ccd49,_0x2a2f11);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 411e11d..7c12307 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 _0xe55d=['destroy','removeTeams','/:id/users','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put','update','delete'];(function(_0x119880,_0x4f291f){var _0x4a1707=function(_0x4e88c2){while(--_0x4e88c2){_0x119880['push'](_0x119880['shift']());}};_0x4a1707(++_0x4f291f);}(_0xe55d,0x126));var _0xde55=function(_0x420f2c,_0x220e65){_0x420f2c=_0x420f2c-0x0;var _0x2f7b3a=_0xe55d[_0x420f2c];return _0x2f7b3a;};'use strict';var multer=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var path=require('path');var timeout=require(_0xde55('0x2'));var express=require(_0xde55('0x3'));var router=express[_0xde55('0x4')]();var auth=require(_0xde55('0x5'));var interaction=require(_0xde55('0x6'));var config=require(_0xde55('0x7'));var controller=require('./openchannelQueue.controller');router[_0xde55('0x8')]('/',auth[_0xde55('0x9')](),controller[_0xde55('0xa')]);router['get'](_0xde55('0xb'),auth[_0xde55('0x9')](),controller[_0xde55('0xc')]);router[_0xde55('0x8')](_0xde55('0xd'),auth[_0xde55('0x9')](),controller['show']);router[_0xde55('0x8')](_0xde55('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xde55('0x8')](_0xde55('0xf'),auth['isAuthenticated'](),controller[_0xde55('0x10')]);router[_0xde55('0x8')]('/:id/users',auth[_0xde55('0x9')](),controller[_0xde55('0x11')]);router[_0xde55('0x12')]('/',auth['isAuthenticated'](),controller[_0xde55('0x13')]);router[_0xde55('0x12')](_0xde55('0xf'),auth[_0xde55('0x9')](),controller[_0xde55('0x14')]);router[_0xde55('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xde55('0x15')]);router[_0xde55('0x16')]('/:id',auth[_0xde55('0x9')](),controller[_0xde55('0x17')]);router[_0xde55('0x18')](_0xde55('0xd'),auth[_0xde55('0x9')](),controller[_0xde55('0x19')]);router[_0xde55('0x18')](_0xde55('0xf'),auth[_0xde55('0x9')](),controller[_0xde55('0x1a')]);router[_0xde55('0x18')](_0xde55('0x1b'),auth[_0xde55('0x9')](),controller['removeAgents']);module[_0xde55('0x1c')]=router; \ No newline at end of file +var _0x4ce6=['removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','index','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete'];(function(_0x329cbf,_0x5cd707){var _0x54317d=function(_0x4af17a){while(--_0x4af17a){_0x329cbf['push'](_0x329cbf['shift']());}};_0x54317d(++_0x5cd707);}(_0x4ce6,0x108));var _0x64ce=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x4ce6[_0x1f5887];return _0x21774b;};'use strict';var multer=require(_0x64ce('0x0'));var util=require('util');var path=require(_0x64ce('0x1'));var timeout=require(_0x64ce('0x2'));var express=require(_0x64ce('0x3'));var router=express[_0x64ce('0x4')]();var auth=require(_0x64ce('0x5'));var interaction=require(_0x64ce('0x6'));var config=require('../../config/environment');var controller=require(_0x64ce('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x64ce('0x8')]);router[_0x64ce('0x9')]('/describe',auth[_0x64ce('0xa')](),controller[_0x64ce('0xb')]);router[_0x64ce('0x9')](_0x64ce('0xc'),auth[_0x64ce('0xa')](),controller[_0x64ce('0xd')]);router[_0x64ce('0x9')](_0x64ce('0xe'),auth[_0x64ce('0xa')](),controller[_0x64ce('0xf')]);router['get'](_0x64ce('0x10'),auth[_0x64ce('0xa')](),controller[_0x64ce('0x11')]);router[_0x64ce('0x9')](_0x64ce('0x12'),auth[_0x64ce('0xa')](),controller[_0x64ce('0x13')]);router[_0x64ce('0x14')]('/',auth['isAuthenticated'](),controller[_0x64ce('0x15')]);router['post']('/:id/teams',auth[_0x64ce('0xa')](),controller['addTeams']);router[_0x64ce('0x14')](_0x64ce('0x12'),auth[_0x64ce('0xa')](),controller[_0x64ce('0x16')]);router[_0x64ce('0x17')](_0x64ce('0xc'),auth[_0x64ce('0xa')](),controller[_0x64ce('0x18')]);router[_0x64ce('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x64ce('0x19')](_0x64ce('0x10'),auth[_0x64ce('0xa')](),controller[_0x64ce('0x1a')]);router[_0x64ce('0x19')](_0x64ce('0x12'),auth[_0x64ce('0xa')](),controller[_0x64ce('0x1b')]);module[_0x64ce('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 9535908..8a681b0 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 _0xa3e8=['beepall','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0xafdef3,_0xbe26f2){var _0x857a29=function(_0x294b67){while(--_0x294b67){_0xafdef3['push'](_0xafdef3['shift']());}};_0x857a29(++_0xbe26f2);}(_0xa3e8,0x127));var _0x8a3e=function(_0x3c02b8,_0xd16302){_0x3c02b8=_0x3c02b8-0x0;var _0x3e10f7=_0xa3e8[_0x3c02b8];return _0x3e10f7;};'use strict';var Sequelize=require(_0x8a3e('0x0'));module[_0x8a3e('0x1')]={'name':{'type':Sequelize[_0x8a3e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8a3e('0x2')]},'timeout':{'type':Sequelize[_0x8a3e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8a3e('0x4')](_0x8a3e('0x5'),_0x8a3e('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x3e9c=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x578c04,_0x359b1a){var _0x5c29d8=function(_0x396b78){while(--_0x396b78){_0x578c04['push'](_0x578c04['shift']());}};_0x5c29d8(++_0x359b1a);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3e9c[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xc3e9('0x0'));module[_0xc3e9('0x1')]={'name':{'type':Sequelize[_0xc3e9('0x2')],'unique':_0xc3e9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc3e9('0x2')]},'timeout':{'type':Sequelize[_0xc3e9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc3e9('0x5')](_0xc3e9('0x6'),_0xc3e9('0x7'),_0xc3e9('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 2dbdd76..813e206 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 _0x4b1b=['localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','OpenchannelQueues','error','stack','name','send','index','map','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','OpenchannelQueue','include','findAll','show','params','rawAttributes','includeAll','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','Team','order','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','removeTeams','select','tq.TeamId','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','emit','getAgents','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','squel','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults'];(function(_0x984e4,_0x56ed63){var _0x2bdeb7=function(_0x357b97){while(--_0x357b97){_0x984e4['push'](_0x984e4['shift']());}};_0x2bdeb7(++_0x56ed63);}(_0x4b1b,0xf8));var _0xb4b1=function(_0x406cd7,_0x4dfc3d){_0x406cd7=_0x406cd7-0x0;var _0xe36e1f=_0x4b1b[_0x406cd7];return _0xe36e1f;};'use strict';var pdf=require(_0xb4b1('0x0'));var emlformat=require(_0xb4b1('0x1'));var rimraf=require(_0xb4b1('0x2'));var zipdir=require(_0xb4b1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb4b1('0x4'));var Mustache=require(_0xb4b1('0x5'));var util=require(_0xb4b1('0x6'));var path=require(_0xb4b1('0x7'));var sox=require(_0xb4b1('0x8'));var csv=require('to-csv');var ejs=require(_0xb4b1('0x9'));var fs=require('fs');var _=require(_0xb4b1('0xa'));var squel=require(_0xb4b1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb4b1('0xc'));var querystring=require('querystring');var Papa=require(_0xb4b1('0xd'));var Redis=require(_0xb4b1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb4b1('0xf'));var as=require(_0xb4b1('0x10'));var hardwareService=require(_0xb4b1('0x11'));var logger=require(_0xb4b1('0x12'))('api');var utils=require(_0xb4b1('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb4b1('0x14')]=_[_0xb4b1('0x15')](config[_0xb4b1('0x14')],{'host':_0xb4b1('0x16'),'port':0x18eb});var socket=require(_0xb4b1('0x17'))(new Redis(config['redis']));require(_0xb4b1('0x18'))[_0xb4b1('0x19')](socket);function respondWithStatusCode(_0x433cb5,_0x1fe31d){_0x1fe31d=_0x1fe31d||0xcc;return function(_0x3681e6){if(_0x3681e6){return _0x433cb5[_0xb4b1('0x1a')](_0x1fe31d);}return _0x433cb5[_0xb4b1('0x1b')](_0x1fe31d)['end']();};}function respondWithResult(_0x41be16,_0x4ad44a){_0x4ad44a=_0x4ad44a||0xc8;return function(_0x3f5417){if(_0x3f5417){return _0x41be16[_0xb4b1('0x1b')](_0x4ad44a)[_0xb4b1('0x1c')](_0x3f5417);}};}function respondWithFilteredResult(_0x5e0582,_0x27788d){return function(_0x1aa512){if(_0x1aa512){var _0x561987=_0x1aa512[_0xb4b1('0x1d')],_0x4122ad=_0x27788d[_0xb4b1('0x1e')],_0x388a08=_0x27788d[_0xb4b1('0x1e')]+_0x27788d[_0xb4b1('0x1f')],_0x3c8c2b;if(_0x388a08>=_0x561987){_0x388a08=_0x561987;_0x3c8c2b=0xc8;}else{_0x3c8c2b=0xce;}_0x5e0582[_0xb4b1('0x1b')](_0x3c8c2b);return _0x5e0582[_0xb4b1('0x20')](_0xb4b1('0x21'),_0x4122ad+'-'+_0x388a08+'/'+_0x561987)[_0xb4b1('0x1c')](_0x1aa512);}return null;};}function patchUpdates(_0x4d45f1){return function(_0x5127d7){try{jsonpatch['apply'](_0x5127d7,_0x4d45f1,!![]);}catch(_0x2032fd){return BPromise[_0xb4b1('0x22')](_0x2032fd);}return _0x5127d7['save']();};}function saveUpdates(_0x53e764,_0x11b1a6){return function(_0x3f2f50){if(_0x3f2f50){return _0x3f2f50[_0xb4b1('0x23')](_0x53e764)[_0xb4b1('0x24')](function(_0x41a5c6){return _0x41a5c6;});}return null;};}function removeEntity(_0x45abff,_0x1ed15c){return function(_0x6f9178){if(_0x6f9178){return _0x6f9178[_0xb4b1('0x25')]()[_0xb4b1('0x24')](function(){var _0x57226d=_0x6f9178[_0xb4b1('0x26')]({'plain':!![]});var _0x3f6d66=_0xb4b1('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3f6d66,'resourceId':_0x57226d['id']}})[_0xb4b1('0x24')](function(){return _0x6f9178;});})['then'](function(){_0x45abff[_0xb4b1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b3a3,_0x44a87b){return function(_0xfe9960){if(!_0xfe9960){_0x14b3a3['sendStatus'](0x194);}return _0xfe9960;};}function handleError(_0x1cb5bd,_0xa25b60){_0xa25b60=_0xa25b60||0x1f4;return function(_0x157953){logger[_0xb4b1('0x28')](_0x157953[_0xb4b1('0x29')]);if(_0x157953[_0xb4b1('0x2a')]){delete _0x157953[_0xb4b1('0x2a')];}_0x1cb5bd[_0xb4b1('0x1b')](_0xa25b60)[_0xb4b1('0x2b')](_0x157953);};}exports[_0xb4b1('0x2c')]=function(_0x40f962,_0x2ecaef){var _0x28b19f={},_0x3033ca={},_0xf6bdd={'count':0x0,'rows':[]};var _0x4732f1=_[_0xb4b1('0x2d')](db['OpenchannelQueue']['rawAttributes'],function(_0x308492){return{'name':_0x308492[_0xb4b1('0x2e')],'type':_0x308492['type'][_0xb4b1('0x2f')]};});_0x3033ca[_0xb4b1('0x30')]=_[_0xb4b1('0x2d')](_0x4732f1,_0xb4b1('0x2a'));_0x3033ca['query']=_[_0xb4b1('0x31')](_0x40f962['query']);_0x3033ca['filters']=_[_0xb4b1('0x32')](_0x3033ca[_0xb4b1('0x30')],_0x3033ca[_0xb4b1('0x33')]);_0x28b19f[_0xb4b1('0x34')]=_[_0xb4b1('0x32')](_0x3033ca['model'],qs['fields'](_0x40f962[_0xb4b1('0x33')][_0xb4b1('0x35')]));_0x28b19f['attributes']=_0x28b19f[_0xb4b1('0x34')][_0xb4b1('0x36')]?_0x28b19f[_0xb4b1('0x34')]:_0x3033ca[_0xb4b1('0x30')];if(!_0x40f962[_0xb4b1('0x33')][_0xb4b1('0x37')](_0xb4b1('0x38'))){_0x28b19f[_0xb4b1('0x1f')]=qs[_0xb4b1('0x1f')](_0x40f962['query'][_0xb4b1('0x1f')]);_0x28b19f['offset']=qs[_0xb4b1('0x1e')](_0x40f962['query'][_0xb4b1('0x1e')]);}_0x28b19f['order']=qs[_0xb4b1('0x39')](_0x40f962[_0xb4b1('0x33')][_0xb4b1('0x39')]);_0x28b19f[_0xb4b1('0x3a')]=qs[_0xb4b1('0x3b')](_[_0xb4b1('0x3c')](_0x40f962[_0xb4b1('0x33')],_0x3033ca[_0xb4b1('0x3b')]));if(_0x40f962[_0xb4b1('0x33')]['filter']){_0x28b19f['where']=_['merge'](_0x28b19f[_0xb4b1('0x3a')],{'$or':_['map'](_0x4732f1,function(_0x28fb16){if(_0x28fb16['type']!=='VIRTUAL'){var _0x300288={};_0x300288[_0x28fb16[_0xb4b1('0x2a')]]={'$like':'%'+_0x40f962[_0xb4b1('0x33')][_0xb4b1('0x3d')]+'%'};return _0x300288;}})});}_0x28b19f=_[_0xb4b1('0x3e')]({},_0x28b19f,_0x40f962[_0xb4b1('0x3f')]);var _0x3c8636={'where':_0x28b19f[_0xb4b1('0x3a')]};return db[_0xb4b1('0x40')][_0xb4b1('0x1d')](_0x3c8636)[_0xb4b1('0x24')](function(_0x373fad){_0xf6bdd['count']=_0x373fad;if(_0x40f962[_0xb4b1('0x33')]['includeAll']){_0x28b19f[_0xb4b1('0x41')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xb4b1('0x42')](_0x28b19f);})['then'](function(_0x34f0bd){_0xf6bdd['rows']=_0x34f0bd;return _0xf6bdd;})[_0xb4b1('0x24')](respondWithFilteredResult(_0x2ecaef,_0x28b19f))['catch'](handleError(_0x2ecaef,null));};exports[_0xb4b1('0x43')]=function(_0x2324b1,_0x45299a){var _0x2c6810={'raw':!![],'where':{'id':_0x2324b1[_0xb4b1('0x44')]['id']}},_0x5f5d5e={};_0x5f5d5e['model']=_['keys'](db[_0xb4b1('0x40')][_0xb4b1('0x45')]);_0x5f5d5e[_0xb4b1('0x33')]=_['keys'](_0x2324b1['query']);_0x5f5d5e[_0xb4b1('0x3b')]=_[_0xb4b1('0x32')](_0x5f5d5e[_0xb4b1('0x30')],_0x5f5d5e[_0xb4b1('0x33')]);_0x2c6810['attributes']=_['intersection'](_0x5f5d5e[_0xb4b1('0x30')],qs[_0xb4b1('0x35')](_0x2324b1['query'][_0xb4b1('0x35')]));_0x2c6810[_0xb4b1('0x34')]=_0x2c6810[_0xb4b1('0x34')][_0xb4b1('0x36')]?_0x2c6810['attributes']:_0x5f5d5e['model'];if(_0x2324b1[_0xb4b1('0x33')][_0xb4b1('0x46')]){_0x2c6810['include']=[{'all':!![]}];}_0x2c6810=_['merge']({},_0x2c6810,_0x2324b1[_0xb4b1('0x3f')]);return db[_0xb4b1('0x40')]['find'](_0x2c6810)[_0xb4b1('0x24')](handleEntityNotFound(_0x45299a,null))[_0xb4b1('0x24')](respondWithResult(_0x45299a,null))[_0xb4b1('0x47')](handleError(_0x45299a,null));};exports['create']=function(_0x2a0ed6,_0x610eb){return db['OpenchannelQueue']['create'](_0x2a0ed6[_0xb4b1('0x48')],{})[_0xb4b1('0x24')](function(_0x3a0060){var _0x30a15a=_0x2a0ed6[_0xb4b1('0x49')][_0xb4b1('0x26')]({'plain':!![]});if(!_0x30a15a)throw new Error(_0xb4b1('0x4a'));if(_0x30a15a[_0xb4b1('0x4b')]===_0xb4b1('0x49')){var _0x3aed5=_0x3a0060[_0xb4b1('0x26')]({'plain':!![]});var _0x5dbc33=_0xb4b1('0x27');return db[_0xb4b1('0x4c')][_0xb4b1('0x4d')]({'where':{'name':_0x5dbc33,'userProfileId':_0x30a15a[_0xb4b1('0x4e')]},'raw':!![]})[_0xb4b1('0x24')](function(_0xfc9d4d){if(_0xfc9d4d&&_0xfc9d4d[_0xb4b1('0x4f')]===0x0){return db[_0xb4b1('0x50')][_0xb4b1('0x51')]({'name':_0x3aed5[_0xb4b1('0x2a')],'resourceId':_0x3aed5['id'],'type':_0xfc9d4d['name'],'sectionId':_0xfc9d4d['id']},{})['then'](function(){return _0x3a0060;});}else{return _0x3a0060;}})[_0xb4b1('0x47')](function(_0x49cadc){logger[_0xb4b1('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49cadc);throw _0x49cadc;});}return _0x3a0060;})[_0xb4b1('0x24')](respondWithResult(_0x610eb,0xc9))[_0xb4b1('0x47')](handleError(_0x610eb,null));};exports[_0xb4b1('0x23')]=function(_0x85f045,_0x5e3d5d){if(_0x85f045[_0xb4b1('0x48')]['id']){delete _0x85f045[_0xb4b1('0x48')]['id'];}return db[_0xb4b1('0x40')][_0xb4b1('0x4d')]({'where':{'id':_0x85f045[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x5e3d5d,null))[_0xb4b1('0x24')](saveUpdates(_0x85f045['body'],null))[_0xb4b1('0x24')](respondWithResult(_0x5e3d5d,null))[_0xb4b1('0x47')](handleError(_0x5e3d5d,null));};exports[_0xb4b1('0x25')]=function(_0x32a641,_0x1ac961){return db[_0xb4b1('0x40')][_0xb4b1('0x4d')]({'where':{'id':_0x32a641[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x1ac961,null))[_0xb4b1('0x24')](removeEntity(_0x1ac961,null))[_0xb4b1('0x47')](handleError(_0x1ac961,null));};exports[_0xb4b1('0x52')]=function(_0x452037,_0x1c357a){return db[_0xb4b1('0x40')]['describe']()[_0xb4b1('0x24')](respondWithResult(_0x1c357a,null))[_0xb4b1('0x47')](handleError(_0x1c357a,null));};exports['getMembers']=function(_0x527445,_0x143677,_0xc84ea6){var _0x20fbbb={'raw':!![],'where':{}},_0x1283e9={},_0x79b45c;return db[_0xb4b1('0x40')][_0xb4b1('0x53')]({'where':{'id':_0x527445[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x143677,null))[_0xb4b1('0x24')](function(_0x20db1a){if(_0x20db1a){_0x79b45c=_0x20db1a['get']({'plain':!![]});_0x1283e9[_0xb4b1('0x30')]=_[_0xb4b1('0x31')](db[_0xb4b1('0x54')][_0xb4b1('0x45')]);_0x1283e9[_0xb4b1('0x33')]=_[_0xb4b1('0x31')](_0x527445[_0xb4b1('0x33')]);_0x1283e9[_0xb4b1('0x3b')]=_[_0xb4b1('0x32')](_0x1283e9[_0xb4b1('0x30')],_0x1283e9['query']);_0x20fbbb[_0xb4b1('0x34')]=_[_0xb4b1('0x32')](_0x1283e9[_0xb4b1('0x30')],qs[_0xb4b1('0x35')](_0x527445[_0xb4b1('0x33')][_0xb4b1('0x35')]));_0x20fbbb[_0xb4b1('0x34')]=_0x20fbbb[_0xb4b1('0x34')][_0xb4b1('0x36')]?_0x20fbbb[_0xb4b1('0x34')]:_0x1283e9[_0xb4b1('0x30')];if(!_0x527445[_0xb4b1('0x33')]['hasOwnProperty'](_0xb4b1('0x38'))){_0x20fbbb[_0xb4b1('0x1f')]=qs[_0xb4b1('0x1f')](_0x527445[_0xb4b1('0x33')][_0xb4b1('0x1f')]);_0x20fbbb[_0xb4b1('0x1e')]=qs[_0xb4b1('0x1e')](_0x527445[_0xb4b1('0x33')][_0xb4b1('0x1e')]);}_0x20fbbb['order']=qs[_0xb4b1('0x39')](_0x527445[_0xb4b1('0x33')][_0xb4b1('0x39')]);_0x20fbbb[_0xb4b1('0x3a')]=qs[_0xb4b1('0x3b')](_[_0xb4b1('0x3c')](_0x527445[_0xb4b1('0x33')],_0x1283e9[_0xb4b1('0x3b')]));_0x20fbbb[_0xb4b1('0x3a')][_0xb4b1('0x55')]=_0x20db1a['id'];if(_0x527445[_0xb4b1('0x33')]['filter']){_0x20fbbb[_0xb4b1('0x3a')]=_[_0xb4b1('0x3e')](_0x20fbbb['where'],{'$or':_['map'](_0x20fbbb[_0xb4b1('0x34')],function(_0x4fba9d){var _0x21137f={};_0x21137f[_0x4fba9d]={'$like':'%'+_0x527445[_0xb4b1('0x33')][_0xb4b1('0x3d')]+'%'};return _0x21137f;})});}_0x20fbbb=_[_0xb4b1('0x3e')]({},_0x20fbbb,_0x527445[_0xb4b1('0x3f')]);return db[_0xb4b1('0x54')][_0xb4b1('0x42')](_0x20fbbb);}})['then'](function(_0x1c6909){if(_0x1c6909){return db[_0xb4b1('0x56')][_0xb4b1('0x57')]({'where':{'id':_[_0xb4b1('0x2d')](_0x1c6909,_0xb4b1('0x58')),'role':_0xb4b1('0x59')},'attributes':['id','name',_0xb4b1('0x5a'),_0xb4b1('0x5b'),'createdAt']});}})[_0xb4b1('0x24')](function(_0x427a9d){if(_0x427a9d){return{'count':_0x427a9d[_0xb4b1('0x1d')],'rows':_[_0xb4b1('0x2d')](_0x427a9d['rows'],function(_0x5eb40d){return{'membername':_0x5eb40d[_0xb4b1('0x2a')],'UserId':_0x5eb40d['id'],'queue_name':_0x79b45c[_0xb4b1('0x2a')],'OpenchannelQueueId':_0x79b45c['id'],'interface':util[_0xb4b1('0x5c')](_0xb4b1('0x5d'),_0xb4b1('0x5e'),_0x5eb40d['name']),'penalty':0x0,'paused':_0x5eb40d[_0xb4b1('0x5a')],'createdAt':_0x5eb40d[_0xb4b1('0x5f')],'updatedAt':_0x5eb40d[_0xb4b1('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x143677,_0x20fbbb))[_0xb4b1('0x47')](handleError(_0x143677,null));};exports['getTeams']=function(_0x414901,_0x4a1c5c,_0x15a77b){var _0x3a416a={};var _0x165352={};var _0x14332c;var _0x4baa6e;return db[_0xb4b1('0x40')]['findOne']({'where':{'id':_0x414901[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x4a1c5c,null))['then'](function(_0x43ece5){if(_0x43ece5){_0x14332c=_0x43ece5;_0x165352[_0xb4b1('0x30')]=_['keys'](db[_0xb4b1('0x60')][_0xb4b1('0x45')]);_0x165352[_0xb4b1('0x33')]=_[_0xb4b1('0x31')](_0x414901[_0xb4b1('0x33')]);_0x165352[_0xb4b1('0x3b')]=_['intersection'](_0x165352[_0xb4b1('0x30')],_0x165352['query']);_0x3a416a[_0xb4b1('0x34')]=_['intersection'](_0x165352['model'],qs['fields'](_0x414901[_0xb4b1('0x33')][_0xb4b1('0x35')]));_0x3a416a[_0xb4b1('0x34')]=_0x3a416a[_0xb4b1('0x34')]['length']?_0x3a416a['attributes']:_0x165352[_0xb4b1('0x30')];_0x3a416a[_0xb4b1('0x61')]=qs[_0xb4b1('0x39')](_0x414901['query'][_0xb4b1('0x39')]);_0x3a416a[_0xb4b1('0x3a')]=qs[_0xb4b1('0x3b')](_[_0xb4b1('0x3c')](_0x414901[_0xb4b1('0x33')],_0x165352[_0xb4b1('0x3b')]));if(_0x414901[_0xb4b1('0x33')][_0xb4b1('0x3d')]){_0x3a416a[_0xb4b1('0x3a')]=_[_0xb4b1('0x3e')](_0x3a416a['where'],{'$or':_[_0xb4b1('0x2d')](_0x3a416a[_0xb4b1('0x34')],function(_0x48f2a8){var _0x3adb13={};_0x3adb13[_0x48f2a8]={'$like':'%'+_0x414901[_0xb4b1('0x33')][_0xb4b1('0x3d')]+'%'};return _0x3adb13;})});}_0x3a416a=_[_0xb4b1('0x3e')]({},_0x3a416a,_0x414901[_0xb4b1('0x3f')]);return _0x14332c[_0xb4b1('0x62')](_0x3a416a);}})[_0xb4b1('0x24')](function(_0x50b854){if(_0x50b854){_0x4baa6e=_0x50b854['length'];if(!_0x414901[_0xb4b1('0x33')][_0xb4b1('0x37')](_0xb4b1('0x38'))){_0x3a416a[_0xb4b1('0x1f')]=qs['limit'](_0x414901[_0xb4b1('0x33')][_0xb4b1('0x1f')]);_0x3a416a[_0xb4b1('0x1e')]=qs[_0xb4b1('0x1e')](_0x414901[_0xb4b1('0x33')][_0xb4b1('0x1e')]);}return _0x14332c[_0xb4b1('0x62')](_0x3a416a);}})[_0xb4b1('0x24')](function(_0x43ff9c){if(_0x43ff9c){return _0x43ff9c?{'count':_0x4baa6e,'rows':_0x43ff9c}:null;}})[_0xb4b1('0x24')](respondWithResult(_0x4a1c5c,null))['catch'](handleError(_0x4a1c5c,null));};exports[_0xb4b1('0x63')]=function(_0x4bfc7f,_0x1376f9,_0x5c8ee7){var _0x1105bd=_0x4bfc7f[_0xb4b1('0x48')][_0xb4b1('0x64')];return db[_0xb4b1('0x60')][_0xb4b1('0x42')]({'where':{'id':_0x1105bd},'attributes':['id'],'include':[{'model':db[_0xb4b1('0x56')],'as':_0xb4b1('0x65'),'attributes':['id',_0xb4b1('0x2a'),_0xb4b1('0x66'),_0xb4b1('0x67'),_0xb4b1('0x68')],'raw':!![]}]})[_0xb4b1('0x24')](function(_0x1873c1){if(_0x1873c1){var _0x2a384d=_[_0xb4b1('0x69')](_0x1873c1,function(_0x42fe8e){var _0x11a048=_0x42fe8e[_0xb4b1('0x26')]({'plain':!![]});return _0x11a048[_0xb4b1('0x65')];});return db[_0xb4b1('0x40')][_0xb4b1('0x4d')]({'where':{'id':_0x4bfc7f[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](function(_0x123104){return db[_0xb4b1('0x6a')][_0xb4b1('0x6b')](function(_0xacccae){return _0x123104[_0xb4b1('0x63')](_0x1105bd,{'transaction':_0xacccae})[_0xb4b1('0x24')](function(){return BPromise['each'](_0x2a384d,function(_0x26a7c1){return db[_0xb4b1('0x54')]['findOrCreate']({'where':{'UserId':_0x26a7c1['id'],'OpenchannelQueueId':_0x4bfc7f[_0xb4b1('0x44')]['id']},'transaction':_0xacccae});});})[_0xb4b1('0x24')](function(){_0x2a384d[_0xb4b1('0x6c')](function(_0x233f8b){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x233f8b['id'],'OpenchannelQueueId':_0x123104['id']});});});});});}})[_0xb4b1('0x24')](respondWithStatusCode(_0x1376f9,null))[_0xb4b1('0x47')](handleError(_0x1376f9,null));};exports[_0xb4b1('0x6d')]=function(_0x5795af,_0xe5dac0,_0x3354e3){return db[_0xb4b1('0x60')][_0xb4b1('0x42')]({'where':{'id':_0x5795af[_0xb4b1('0x33')][_0xb4b1('0x64')]},'attributes':['id'],'include':[{'model':db[_0xb4b1('0x56')],'as':_0xb4b1('0x65'),'attributes':['id'],'raw':!![]}]})[_0xb4b1('0x24')](handleEntityNotFound(_0xe5dac0,null))['then'](function(_0x13b981){var _0x4a87b2=_[_0xb4b1('0x2d')](_0x13b981,'id');var _0x2fd44f=[];var _0x321d0f=[];var _0x58b014=squel[_0xb4b1('0x6e')]();_0x58b014['field'](_0xb4b1('0x6f'))['from'](_0xb4b1('0x70'),'tq')['join']('user_has_teams','ut',_0xb4b1('0x71'))['where'](_0xb4b1('0x72'),_0x5795af[_0xb4b1('0x44')]['id']);for(var _0x11f890=0x0;_0x11f890<_0x13b981[_0xb4b1('0x36')];_0x11f890+=0x1){let _0x4ef226=_0x13b981[_0x11f890];for(var _0x2a85e7=0x0;_0x2a85e7<_0x4ef226['Agents'][_0xb4b1('0x36')];_0x2a85e7+=0x1){let _0x3b3b91=_0x4ef226[_0xb4b1('0x65')][_0x2a85e7];var _0x756fec=_0x58b014[_0xb4b1('0x73')]();_0x756fec['where'](_0xb4b1('0x74'),_0x3b3b91['id']);_0x321d0f['push'](db[_0xb4b1('0x6a')]['query'](_0x756fec[_0xb4b1('0x75')](),{'type':db[_0xb4b1('0x6a')][_0xb4b1('0x76')][_0xb4b1('0x77')]})[_0xb4b1('0x24')](function(_0x14c00e){if(_0x14c00e[_0xb4b1('0x36')]===0x1){return _0x3b3b91['id'];}else{var _0x1b2fe1=_[_0xb4b1('0x78')](_[_0xb4b1('0x2d')](_0x14c00e,'TeamId'),function(_0x4e1a31){return _[_0xb4b1('0x79')](_0x4a87b2,_0x4e1a31);});if(_0x1b2fe1){return _0x3b3b91['id'];}}}));}}return BPromise['all'](_0x321d0f)[_0xb4b1('0x24')](function(_0x53b82f){_0x2fd44f=_(_0x2fd44f)[_0xb4b1('0x7a')](_0x53b82f)[_0xb4b1('0x7b')]()[_0xb4b1('0x7c')]();return db[_0xb4b1('0x40')][_0xb4b1('0x4d')]({'where':{'id':_0x5795af[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](function(_0x974162){return db[_0xb4b1('0x6a')][_0xb4b1('0x6b')](function(_0x3414bf){return _0x974162[_0xb4b1('0x6d')](_0x5795af['query'][_0xb4b1('0x64')],{'transaction':_0x3414bf})[_0xb4b1('0x24')](function(){if(!_[_0xb4b1('0x7d')](_0x2fd44f)){return _0x974162[_0xb4b1('0x7e')](_0x2fd44f,{'transaction':_0x3414bf});}})[_0xb4b1('0x24')](function(){_0x2fd44f['forEach'](function(_0x550ace){socket['emit'](_0xb4b1('0x7f'),{'UserId':_0x550ace,'OpenchannelQueueId':_0x974162['id']});});});});});});})[_0xb4b1('0x24')](respondWithStatusCode(_0xe5dac0,null))[_0xb4b1('0x47')](handleError(_0xe5dac0,null));};exports[_0xb4b1('0x80')]=function(_0x465d34,_0x5db35e,_0x3303c5){return db[_0xb4b1('0x40')]['find']({'where':{'id':_0x465d34[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x5db35e,null))['then'](function(_0x9d6905){if(_0x9d6905){return _0x9d6905[_0xb4b1('0x80')](_0x465d34[_0xb4b1('0x48')][_0xb4b1('0x64')],_[_0xb4b1('0x81')](_0x465d34[_0xb4b1('0x48')],[_0xb4b1('0x64'),'id'])||{})[_0xb4b1('0x82')](function(_0x3eed6e){for(var _0x337f0d=0x0;_0x337f0d<_0x465d34['body'][_0xb4b1('0x64')]['length'];_0x337f0d+=0x1){socket['emit'](_0xb4b1('0x83'),{'UserId':_0x465d34[_0xb4b1('0x48')][_0xb4b1('0x64')][_0x337f0d],'OpenchannelQueueId':_0x465d34[_0xb4b1('0x44')]['id']});}return _0x3eed6e;});}})[_0xb4b1('0x24')](respondWithResult(_0x5db35e,null))[_0xb4b1('0x47')](handleError(_0x5db35e,null));};exports[_0xb4b1('0x7e')]=function(_0xf75074,_0x518bf6,_0x36309a){return db[_0xb4b1('0x40')][_0xb4b1('0x4d')]({'where':{'id':_0xf75074[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x518bf6,null))[_0xb4b1('0x24')](function(_0x2537be){if(_0x2537be){return _0x2537be[_0xb4b1('0x7e')](_0xf75074['query'][_0xb4b1('0x64')])[_0xb4b1('0x24')](function(){if(_[_0xb4b1('0x84')](_0xf75074['query'][_0xb4b1('0x64')])){for(var _0x4d4c=0x0;_0x4d4c<_0xf75074[_0xb4b1('0x33')][_0xb4b1('0x64')][_0xb4b1('0x36')];_0x4d4c+=0x1){socket['emit'](_0xb4b1('0x7f'),{'UserId':Number(_0xf75074['query'][_0xb4b1('0x64')][_0x4d4c]),'OpenchannelQueueId':Number(_0xf75074[_0xb4b1('0x44')]['id'])});}}else{socket[_0xb4b1('0x85')](_0xb4b1('0x7f'),{'UserId':Number(_0xf75074[_0xb4b1('0x33')][_0xb4b1('0x64')]),'OpenchannelQueueId':Number(_0xf75074[_0xb4b1('0x44')]['id'])});}});}})[_0xb4b1('0x24')](respondWithStatusCode(_0x518bf6,null))['catch'](handleError(_0x518bf6,null));};exports[_0xb4b1('0x86')]=function(_0x4d6d5e,_0x56bb7,_0x5873a2){var _0x5200ba={};var _0x33652b={};var _0x1025f9;var _0x5dbd74;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4d6d5e[_0xb4b1('0x44')]['id']}})[_0xb4b1('0x24')](handleEntityNotFound(_0x56bb7,null))[_0xb4b1('0x24')](function(_0x3131f0){if(_0x3131f0){_0x1025f9=_0x3131f0;_0x33652b[_0xb4b1('0x30')]=_[_0xb4b1('0x31')](db['User'][_0xb4b1('0x45')]);_0x33652b['query']=_['keys'](_0x4d6d5e[_0xb4b1('0x33')]);_0x33652b['filters']=_['intersection'](_0x33652b[_0xb4b1('0x30')],_0x33652b[_0xb4b1('0x33')]);_0x5200ba[_0xb4b1('0x34')]=_[_0xb4b1('0x32')](_0x33652b['model'],qs['fields'](_0x4d6d5e['query'][_0xb4b1('0x35')]));_0x5200ba['attributes']=_0x5200ba[_0xb4b1('0x34')][_0xb4b1('0x36')]?_0x5200ba[_0xb4b1('0x34')]:_0x33652b[_0xb4b1('0x30')];_0x5200ba[_0xb4b1('0x61')]=qs[_0xb4b1('0x39')](_0x4d6d5e[_0xb4b1('0x33')][_0xb4b1('0x39')]);_0x5200ba['where']=qs[_0xb4b1('0x3b')](_[_0xb4b1('0x3c')](_0x4d6d5e[_0xb4b1('0x33')],_0x33652b[_0xb4b1('0x3b')]));if(_0x4d6d5e[_0xb4b1('0x33')][_0xb4b1('0x3d')]){_0x5200ba[_0xb4b1('0x3a')]=_[_0xb4b1('0x3e')](_0x5200ba[_0xb4b1('0x3a')],{'$or':_['map'](_0x5200ba['attributes'],function(_0x2ff0a5){var _0x13a400={};_0x13a400[_0x2ff0a5]={'$like':'%'+_0x4d6d5e[_0xb4b1('0x33')][_0xb4b1('0x3d')]+'%'};return _0x13a400;})});}_0x5200ba=_[_0xb4b1('0x3e')]({},_0x5200ba,_0x4d6d5e[_0xb4b1('0x3f')]);return _0x1025f9[_0xb4b1('0x86')](_0x5200ba);}})[_0xb4b1('0x24')](function(_0x5bbacd){if(_0x5bbacd){_0x5dbd74=_0x5bbacd[_0xb4b1('0x36')];if(!_0x4d6d5e[_0xb4b1('0x33')][_0xb4b1('0x37')](_0xb4b1('0x38'))){_0x5200ba[_0xb4b1('0x1f')]=qs[_0xb4b1('0x1f')](_0x4d6d5e[_0xb4b1('0x33')][_0xb4b1('0x1f')]);_0x5200ba[_0xb4b1('0x1e')]=qs[_0xb4b1('0x1e')](_0x4d6d5e[_0xb4b1('0x33')][_0xb4b1('0x1e')]);}return _0x1025f9[_0xb4b1('0x86')](_0x5200ba);}})[_0xb4b1('0x24')](function(_0x1c2712){if(_0x1c2712){return _0x1c2712?{'count':_0x5dbd74,'rows':_0x1c2712}:null;}})[_0xb4b1('0x24')](respondWithResult(_0x56bb7,null))[_0xb4b1('0x47')](handleError(_0x56bb7,null));}; \ No newline at end of file +var _0xd635=['map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','include','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','interface','sequelize','transaction','addTeams','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd635,0xdd));var _0x5d63=function(_0x3003fc,_0x5ac5de){_0x3003fc=_0x3003fc-0x0;var _0x22cb43=_0xd635[_0x3003fc];return _0x22cb43;};'use strict';var pdf=require(_0x5d63('0x0'));var emlformat=require(_0x5d63('0x1'));var rimraf=require(_0x5d63('0x2'));var zipdir=require(_0x5d63('0x3'));var jsonpatch=require(_0x5d63('0x4'));var rp=require(_0x5d63('0x5'));var moment=require(_0x5d63('0x6'));var BPromise=require(_0x5d63('0x7'));var Mustache=require(_0x5d63('0x8'));var util=require(_0x5d63('0x9'));var path=require(_0x5d63('0xa'));var sox=require(_0x5d63('0xb'));var csv=require(_0x5d63('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5d63('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d63('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d63('0xc'));var querystring=require(_0x5d63('0xf'));var Papa=require(_0x5d63('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5d63('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5d63('0x12'));var utils=require(_0x5d63('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5d63('0x14')]=_[_0x5d63('0x15')](config[_0x5d63('0x14')],{'host':_0x5d63('0x16'),'port':0x18eb});var socket=require(_0x5d63('0x17'))(new Redis(config['redis']));require(_0x5d63('0x18'))['register'](socket);function respondWithStatusCode(_0x3c14fa,_0x7140ab){_0x7140ab=_0x7140ab||0xcc;return function(_0x35e8e3){if(_0x35e8e3){return _0x3c14fa['sendStatus'](_0x7140ab);}return _0x3c14fa[_0x5d63('0x19')](_0x7140ab)[_0x5d63('0x1a')]();};}function respondWithResult(_0x4a5483,_0x536b3b){_0x536b3b=_0x536b3b||0xc8;return function(_0x16cd7c){if(_0x16cd7c){return _0x4a5483[_0x5d63('0x19')](_0x536b3b)[_0x5d63('0x1b')](_0x16cd7c);}};}function respondWithFilteredResult(_0x22d4e5,_0x30c52f){return function(_0x12a52b){if(_0x12a52b){var _0xa90f6=_0x12a52b[_0x5d63('0x1c')],_0x4f8a64=_0x30c52f[_0x5d63('0x1d')],_0x569504=_0x30c52f['offset']+_0x30c52f[_0x5d63('0x1e')],_0x1eb106;if(_0x569504>=_0xa90f6){_0x569504=_0xa90f6;_0x1eb106=0xc8;}else{_0x1eb106=0xce;}_0x22d4e5[_0x5d63('0x19')](_0x1eb106);return _0x22d4e5[_0x5d63('0x1f')](_0x5d63('0x20'),_0x4f8a64+'-'+_0x569504+'/'+_0xa90f6)[_0x5d63('0x1b')](_0x12a52b);}return null;};}function patchUpdates(_0x4426d1){return function(_0x181b2e){try{jsonpatch[_0x5d63('0x21')](_0x181b2e,_0x4426d1,!![]);}catch(_0x425137){return BPromise['reject'](_0x425137);}return _0x181b2e['save']();};}function saveUpdates(_0x255b84,_0x175ec6){return function(_0x3ada9d){if(_0x3ada9d){return _0x3ada9d[_0x5d63('0x22')](_0x255b84)[_0x5d63('0x23')](function(_0x2d0ead){return _0x2d0ead;});}return null;};}function removeEntity(_0x51d04a,_0x17cb21){return function(_0x1f3000){if(_0x1f3000){return _0x1f3000[_0x5d63('0x24')]()[_0x5d63('0x23')](function(){var _0x32dde4=_0x1f3000[_0x5d63('0x25')]({'plain':!![]});var _0x25c5a1='OpenchannelQueues';return db[_0x5d63('0x26')][_0x5d63('0x24')]({'where':{'type':_0x25c5a1,'resourceId':_0x32dde4['id']}})[_0x5d63('0x23')](function(){return _0x1f3000;});})[_0x5d63('0x23')](function(){_0x51d04a[_0x5d63('0x19')](0xcc)[_0x5d63('0x1a')]();});}};}function handleEntityNotFound(_0x5b957e,_0x4e64cd){return function(_0x8e9294){if(!_0x8e9294){_0x5b957e[_0x5d63('0x27')](0x194);}return _0x8e9294;};}function handleError(_0x230058,_0x2f4aaa){_0x2f4aaa=_0x2f4aaa||0x1f4;return function(_0x5c1dc0){logger[_0x5d63('0x28')](_0x5c1dc0[_0x5d63('0x29')]);if(_0x5c1dc0[_0x5d63('0x2a')]){delete _0x5c1dc0[_0x5d63('0x2a')];}_0x230058[_0x5d63('0x19')](_0x2f4aaa)[_0x5d63('0x2b')](_0x5c1dc0);};}exports[_0x5d63('0x2c')]=function(_0x6012a6,_0x5e1910){var _0x267939={},_0x9aa695={},_0x45fc2f={'count':0x0,'rows':[]};var _0x4e43d4=_[_0x5d63('0x2d')](db[_0x5d63('0x2e')][_0x5d63('0x2f')],function(_0x1f2fb0){return{'name':_0x1f2fb0[_0x5d63('0x30')],'type':_0x1f2fb0[_0x5d63('0x31')][_0x5d63('0x32')]};});_0x9aa695[_0x5d63('0x33')]=_[_0x5d63('0x2d')](_0x4e43d4,_0x5d63('0x2a'));_0x9aa695[_0x5d63('0x34')]=_['keys'](_0x6012a6[_0x5d63('0x34')]);_0x9aa695[_0x5d63('0x35')]=_[_0x5d63('0x36')](_0x9aa695[_0x5d63('0x33')],_0x9aa695[_0x5d63('0x34')]);_0x267939[_0x5d63('0x37')]=_[_0x5d63('0x36')](_0x9aa695[_0x5d63('0x33')],qs[_0x5d63('0x38')](_0x6012a6['query']['fields']));_0x267939[_0x5d63('0x37')]=_0x267939[_0x5d63('0x37')][_0x5d63('0x39')]?_0x267939[_0x5d63('0x37')]:_0x9aa695['model'];if(!_0x6012a6[_0x5d63('0x34')]['hasOwnProperty'](_0x5d63('0x3a'))){_0x267939[_0x5d63('0x1e')]=qs[_0x5d63('0x1e')](_0x6012a6[_0x5d63('0x34')][_0x5d63('0x1e')]);_0x267939[_0x5d63('0x1d')]=qs[_0x5d63('0x1d')](_0x6012a6[_0x5d63('0x34')]['offset']);}_0x267939[_0x5d63('0x3b')]=qs['sort'](_0x6012a6[_0x5d63('0x34')][_0x5d63('0x3c')]);_0x267939[_0x5d63('0x3d')]=qs[_0x5d63('0x35')](_[_0x5d63('0x3e')](_0x6012a6[_0x5d63('0x34')],_0x9aa695[_0x5d63('0x35')]));if(_0x6012a6[_0x5d63('0x34')][_0x5d63('0x3f')]){_0x267939[_0x5d63('0x3d')]=_[_0x5d63('0x40')](_0x267939[_0x5d63('0x3d')],{'$or':_['map'](_0x4e43d4,function(_0x1ced3e){if(_0x1ced3e[_0x5d63('0x31')]!==_0x5d63('0x41')){var _0x23b533={};_0x23b533[_0x1ced3e['name']]={'$like':'%'+_0x6012a6['query'][_0x5d63('0x3f')]+'%'};return _0x23b533;}})});}_0x267939=_[_0x5d63('0x40')]({},_0x267939,_0x6012a6['options']);var _0x3ecbdc={'where':_0x267939[_0x5d63('0x3d')]};return db[_0x5d63('0x2e')][_0x5d63('0x1c')](_0x3ecbdc)[_0x5d63('0x23')](function(_0x22c1f0){_0x45fc2f['count']=_0x22c1f0;if(_0x6012a6[_0x5d63('0x34')]['includeAll']){_0x267939['include']=[{'all':!![]}];}return db[_0x5d63('0x2e')][_0x5d63('0x42')](_0x267939);})[_0x5d63('0x23')](function(_0x185367){_0x45fc2f[_0x5d63('0x43')]=_0x185367;return _0x45fc2f;})['then'](respondWithFilteredResult(_0x5e1910,_0x267939))[_0x5d63('0x44')](handleError(_0x5e1910,null));};exports[_0x5d63('0x45')]=function(_0x26fe9b,_0x196e12){var _0x556b94={'raw':!![],'where':{'id':_0x26fe9b[_0x5d63('0x46')]['id']}},_0x48d153={};_0x48d153[_0x5d63('0x33')]=_[_0x5d63('0x47')](db['OpenchannelQueue']['rawAttributes']);_0x48d153['query']=_['keys'](_0x26fe9b['query']);_0x48d153[_0x5d63('0x35')]=_['intersection'](_0x48d153['model'],_0x48d153['query']);_0x556b94[_0x5d63('0x37')]=_[_0x5d63('0x36')](_0x48d153[_0x5d63('0x33')],qs[_0x5d63('0x38')](_0x26fe9b[_0x5d63('0x34')][_0x5d63('0x38')]));_0x556b94['attributes']=_0x556b94['attributes'][_0x5d63('0x39')]?_0x556b94['attributes']:_0x48d153['model'];if(_0x26fe9b['query']['includeAll']){_0x556b94[_0x5d63('0x48')]=[{'all':!![]}];}_0x556b94=_[_0x5d63('0x40')]({},_0x556b94,_0x26fe9b[_0x5d63('0x49')]);return db['OpenchannelQueue'][_0x5d63('0x4a')](_0x556b94)[_0x5d63('0x23')](handleEntityNotFound(_0x196e12,null))[_0x5d63('0x23')](respondWithResult(_0x196e12,null))[_0x5d63('0x44')](handleError(_0x196e12,null));};exports[_0x5d63('0x4b')]=function(_0x5c5a12,_0x2a8212){return db[_0x5d63('0x2e')][_0x5d63('0x4b')](_0x5c5a12[_0x5d63('0x4c')],{})[_0x5d63('0x23')](function(_0x5b88f6){var _0xbcd12c=_0x5c5a12[_0x5d63('0x4d')][_0x5d63('0x25')]({'plain':!![]});if(!_0xbcd12c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbcd12c['role']===_0x5d63('0x4d')){var _0x2b97c=_0x5b88f6['get']({'plain':!![]});var _0x382210='OpenchannelQueues';return db[_0x5d63('0x4e')][_0x5d63('0x4a')]({'where':{'name':_0x382210,'userProfileId':_0xbcd12c[_0x5d63('0x4f')]},'raw':!![]})['then'](function(_0x1658e8){if(_0x1658e8&&_0x1658e8[_0x5d63('0x50')]===0x0){return db[_0x5d63('0x26')][_0x5d63('0x4b')]({'name':_0x2b97c['name'],'resourceId':_0x2b97c['id'],'type':_0x1658e8[_0x5d63('0x2a')],'sectionId':_0x1658e8['id']},{})[_0x5d63('0x23')](function(){return _0x5b88f6;});}else{return _0x5b88f6;}})[_0x5d63('0x44')](function(_0x5a1091){logger['error'](_0x5d63('0x51'),_0x5a1091);throw _0x5a1091;});}return _0x5b88f6;})[_0x5d63('0x23')](respondWithResult(_0x2a8212,0xc9))[_0x5d63('0x44')](handleError(_0x2a8212,null));};exports[_0x5d63('0x22')]=function(_0x563c89,_0x3744d0){if(_0x563c89[_0x5d63('0x4c')]['id']){delete _0x563c89[_0x5d63('0x4c')]['id'];}return db['OpenchannelQueue'][_0x5d63('0x4a')]({'where':{'id':_0x563c89[_0x5d63('0x46')]['id']}})['then'](handleEntityNotFound(_0x3744d0,null))[_0x5d63('0x23')](saveUpdates(_0x563c89[_0x5d63('0x4c')],null))[_0x5d63('0x23')](respondWithResult(_0x3744d0,null))[_0x5d63('0x44')](handleError(_0x3744d0,null));};exports[_0x5d63('0x24')]=function(_0xe3dd93,_0xa20fe9){return db[_0x5d63('0x2e')][_0x5d63('0x4a')]({'where':{'id':_0xe3dd93[_0x5d63('0x46')]['id']}})[_0x5d63('0x23')](handleEntityNotFound(_0xa20fe9,null))['then'](removeEntity(_0xa20fe9,null))[_0x5d63('0x44')](handleError(_0xa20fe9,null));};exports['describe']=function(_0xedc85d,_0xafd3ef){return db['OpenchannelQueue']['describe']()[_0x5d63('0x23')](respondWithResult(_0xafd3ef,null))[_0x5d63('0x44')](handleError(_0xafd3ef,null));};exports[_0x5d63('0x52')]=function(_0x25e7b8,_0x8c6fcf,_0x30cac5){var _0x40c4da={'raw':!![],'where':{}},_0x3c5090={},_0x5b8783;return db[_0x5d63('0x2e')][_0x5d63('0x53')]({'where':{'id':_0x25e7b8['params']['id']}})[_0x5d63('0x23')](handleEntityNotFound(_0x8c6fcf,null))[_0x5d63('0x23')](function(_0x4dcc6a){if(_0x4dcc6a){_0x5b8783=_0x4dcc6a[_0x5d63('0x25')]({'plain':!![]});_0x3c5090['model']=_[_0x5d63('0x47')](db[_0x5d63('0x54')][_0x5d63('0x2f')]);_0x3c5090[_0x5d63('0x34')]=_['keys'](_0x25e7b8[_0x5d63('0x34')]);_0x3c5090[_0x5d63('0x35')]=_['intersection'](_0x3c5090[_0x5d63('0x33')],_0x3c5090['query']);_0x40c4da[_0x5d63('0x37')]=_[_0x5d63('0x36')](_0x3c5090['model'],qs['fields'](_0x25e7b8[_0x5d63('0x34')]['fields']));_0x40c4da[_0x5d63('0x37')]=_0x40c4da['attributes'][_0x5d63('0x39')]?_0x40c4da[_0x5d63('0x37')]:_0x3c5090[_0x5d63('0x33')];if(!_0x25e7b8[_0x5d63('0x34')][_0x5d63('0x55')]('nolimit')){_0x40c4da[_0x5d63('0x1e')]=qs[_0x5d63('0x1e')](_0x25e7b8['query']['limit']);_0x40c4da[_0x5d63('0x1d')]=qs['offset'](_0x25e7b8['query'][_0x5d63('0x1d')]);}_0x40c4da['order']=qs['sort'](_0x25e7b8['query'][_0x5d63('0x3c')]);_0x40c4da[_0x5d63('0x3d')]=qs[_0x5d63('0x35')](_['pick'](_0x25e7b8['query'],_0x3c5090[_0x5d63('0x35')]));_0x40c4da['where'][_0x5d63('0x56')]=_0x4dcc6a['id'];if(_0x25e7b8['query'][_0x5d63('0x3f')]){_0x40c4da[_0x5d63('0x3d')]=_[_0x5d63('0x40')](_0x40c4da[_0x5d63('0x3d')],{'$or':_[_0x5d63('0x2d')](_0x40c4da['attributes'],function(_0x4b138a){var _0x47e19a={};_0x47e19a[_0x4b138a]={'$like':'%'+_0x25e7b8[_0x5d63('0x34')][_0x5d63('0x3f')]+'%'};return _0x47e19a;})});}_0x40c4da=_[_0x5d63('0x40')]({},_0x40c4da,_0x25e7b8[_0x5d63('0x49')]);return db[_0x5d63('0x54')]['findAll'](_0x40c4da);}})[_0x5d63('0x23')](function(_0x162516){if(_0x162516){return db[_0x5d63('0x57')][_0x5d63('0x58')]({'where':{'id':_[_0x5d63('0x2d')](_0x162516,_0x5d63('0x59')),'role':'agent'},'attributes':['id',_0x5d63('0x2a'),_0x5d63('0x5a'),'updatedAt',_0x5d63('0x5b')]});}})[_0x5d63('0x23')](function(_0x120787){if(_0x120787){return{'count':_0x120787[_0x5d63('0x1c')],'rows':_[_0x5d63('0x2d')](_0x120787['rows'],function(_0x205c8c){return{'membername':_0x205c8c['name'],'UserId':_0x205c8c['id'],'queue_name':_0x5b8783[_0x5d63('0x2a')],'OpenchannelQueueId':_0x5b8783['id'],'interface':util[_0x5d63('0x5c')](_0x5d63('0x5d'),_0x5d63('0x5e'),_0x205c8c[_0x5d63('0x2a')]),'penalty':0x0,'paused':_0x205c8c[_0x5d63('0x5a')],'createdAt':_0x205c8c[_0x5d63('0x5b')],'updatedAt':_0x205c8c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5d63('0x23')](respondWithFilteredResult(_0x8c6fcf,_0x40c4da))[_0x5d63('0x44')](handleError(_0x8c6fcf,null));};exports[_0x5d63('0x5f')]=function(_0x3d659d,_0x468dd5,_0x5f0c51){var _0x48175a={};var _0x1eeaaa={};var _0x4f8ea2;var _0xe4f9b5;return db[_0x5d63('0x2e')]['findOne']({'where':{'id':_0x3d659d[_0x5d63('0x46')]['id']}})['then'](handleEntityNotFound(_0x468dd5,null))['then'](function(_0x31f8e5){if(_0x31f8e5){_0x4f8ea2=_0x31f8e5;_0x1eeaaa[_0x5d63('0x33')]=_[_0x5d63('0x47')](db[_0x5d63('0x60')][_0x5d63('0x2f')]);_0x1eeaaa[_0x5d63('0x34')]=_[_0x5d63('0x47')](_0x3d659d['query']);_0x1eeaaa[_0x5d63('0x35')]=_['intersection'](_0x1eeaaa['model'],_0x1eeaaa['query']);_0x48175a[_0x5d63('0x37')]=_[_0x5d63('0x36')](_0x1eeaaa[_0x5d63('0x33')],qs[_0x5d63('0x38')](_0x3d659d[_0x5d63('0x34')][_0x5d63('0x38')]));_0x48175a[_0x5d63('0x37')]=_0x48175a[_0x5d63('0x37')][_0x5d63('0x39')]?_0x48175a[_0x5d63('0x37')]:_0x1eeaaa[_0x5d63('0x33')];_0x48175a[_0x5d63('0x3b')]=qs[_0x5d63('0x3c')](_0x3d659d[_0x5d63('0x34')][_0x5d63('0x3c')]);_0x48175a['where']=qs[_0x5d63('0x35')](_[_0x5d63('0x3e')](_0x3d659d[_0x5d63('0x34')],_0x1eeaaa[_0x5d63('0x35')]));if(_0x3d659d[_0x5d63('0x34')][_0x5d63('0x3f')]){_0x48175a['where']=_[_0x5d63('0x40')](_0x48175a['where'],{'$or':_[_0x5d63('0x2d')](_0x48175a['attributes'],function(_0x328067){var _0x3b732e={};_0x3b732e[_0x328067]={'$like':'%'+_0x3d659d[_0x5d63('0x34')][_0x5d63('0x3f')]+'%'};return _0x3b732e;})});}_0x48175a=_[_0x5d63('0x40')]({},_0x48175a,_0x3d659d[_0x5d63('0x49')]);return _0x4f8ea2[_0x5d63('0x5f')](_0x48175a);}})[_0x5d63('0x23')](function(_0x400c87){if(_0x400c87){_0xe4f9b5=_0x400c87[_0x5d63('0x39')];if(!_0x3d659d[_0x5d63('0x34')][_0x5d63('0x55')]('nolimit')){_0x48175a[_0x5d63('0x1e')]=qs['limit'](_0x3d659d[_0x5d63('0x34')][_0x5d63('0x1e')]);_0x48175a[_0x5d63('0x1d')]=qs[_0x5d63('0x1d')](_0x3d659d[_0x5d63('0x34')][_0x5d63('0x1d')]);}return _0x4f8ea2[_0x5d63('0x5f')](_0x48175a);}})[_0x5d63('0x23')](function(_0x53cc3c){if(_0x53cc3c){return _0x53cc3c?{'count':_0xe4f9b5,'rows':_0x53cc3c}:null;}})[_0x5d63('0x23')](respondWithResult(_0x468dd5,null))[_0x5d63('0x44')](handleError(_0x468dd5,null));};exports['addTeams']=function(_0x53a522,_0x243f77,_0x27acd1){var _0x5ca21d=_0x53a522[_0x5d63('0x4c')][_0x5d63('0x61')];return db[_0x5d63('0x60')][_0x5d63('0x42')]({'where':{'id':_0x5ca21d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5d63('0x62'),'attributes':['id',_0x5d63('0x2a'),_0x5d63('0x63'),'voicePause',_0x5d63('0x64')],'raw':!![]}]})[_0x5d63('0x23')](function(_0x127e19){if(_0x127e19){var _0x2eb385=_['flatMap'](_0x127e19,function(_0x2959d3){var _0x480973=_0x2959d3[_0x5d63('0x25')]({'plain':!![]});return _0x480973[_0x5d63('0x62')];});return db[_0x5d63('0x2e')][_0x5d63('0x4a')]({'where':{'id':_0x53a522[_0x5d63('0x46')]['id']}})['then'](function(_0x2eaa91){return db[_0x5d63('0x65')][_0x5d63('0x66')](function(_0x8452cb){return _0x2eaa91[_0x5d63('0x67')](_0x5ca21d,{'transaction':_0x8452cb})[_0x5d63('0x23')](function(){return BPromise['each'](_0x2eb385,function(_0x1e5014){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x1e5014['id'],'OpenchannelQueueId':_0x53a522[_0x5d63('0x46')]['id']},'transaction':_0x8452cb});});})[_0x5d63('0x23')](function(){_0x2eb385[_0x5d63('0x68')](function(_0x36fd5f){socket['emit'](_0x5d63('0x69'),{'UserId':_0x36fd5f['id'],'OpenchannelQueueId':_0x2eaa91['id']});});});});});}})['then'](respondWithStatusCode(_0x243f77,null))['catch'](handleError(_0x243f77,null));};exports[_0x5d63('0x6a')]=function(_0x25f1bd,_0x2e0c61,_0x5f55a6){return db['Team'][_0x5d63('0x42')]({'where':{'id':_0x25f1bd[_0x5d63('0x34')][_0x5d63('0x61')]},'attributes':['id'],'include':[{'model':db[_0x5d63('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5d63('0x23')](handleEntityNotFound(_0x2e0c61,null))['then'](function(_0x9424f4){var _0x402c84=_[_0x5d63('0x2d')](_0x9424f4,'id');var _0x4281f6=[];var _0x303ad9=[];var _0x3725b7=squel[_0x5d63('0x6b')]();_0x3725b7[_0x5d63('0x6c')](_0x5d63('0x6d'))[_0x5d63('0x6e')](_0x5d63('0x6f'),'tq')[_0x5d63('0x70')](_0x5d63('0x71'),'ut',_0x5d63('0x72'))[_0x5d63('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x25f1bd[_0x5d63('0x46')]['id']);for(var _0x534720=0x0;_0x534720<_0x9424f4['length'];_0x534720+=0x1){let _0xa38548=_0x9424f4[_0x534720];for(var _0x55754a=0x0;_0x55754a<_0xa38548['Agents'][_0x5d63('0x39')];_0x55754a+=0x1){let _0x1b193e=_0xa38548['Agents'][_0x55754a];var _0xa3f70f=_0x3725b7[_0x5d63('0x73')]();_0xa3f70f[_0x5d63('0x3d')](_0x5d63('0x74'),_0x1b193e['id']);_0x303ad9[_0x5d63('0x75')](db[_0x5d63('0x65')]['query'](_0xa3f70f['toString'](),{'type':db['sequelize'][_0x5d63('0x76')][_0x5d63('0x77')]})[_0x5d63('0x23')](function(_0x1c8a37){if(_0x1c8a37[_0x5d63('0x39')]===0x1){return _0x1b193e['id'];}else{var _0x5aca76=_[_0x5d63('0x78')](_[_0x5d63('0x2d')](_0x1c8a37,_0x5d63('0x79')),function(_0x5cb31b){return _['includes'](_0x402c84,_0x5cb31b);});if(_0x5aca76){return _0x1b193e['id'];}}}));}}return BPromise[_0x5d63('0x7a')](_0x303ad9)[_0x5d63('0x23')](function(_0x5b0cc4){_0x4281f6=_(_0x4281f6)['union'](_0x5b0cc4)[_0x5d63('0x7b')]()[_0x5d63('0x7c')]();return db[_0x5d63('0x2e')]['find']({'where':{'id':_0x25f1bd[_0x5d63('0x46')]['id']}})[_0x5d63('0x23')](function(_0x27c4b7){return db['sequelize'][_0x5d63('0x66')](function(_0x52a7f5){return _0x27c4b7[_0x5d63('0x6a')](_0x25f1bd['query']['ids'],{'transaction':_0x52a7f5})[_0x5d63('0x23')](function(){if(!_[_0x5d63('0x7d')](_0x4281f6)){return _0x27c4b7[_0x5d63('0x7e')](_0x4281f6,{'transaction':_0x52a7f5});}})[_0x5d63('0x23')](function(){_0x4281f6[_0x5d63('0x68')](function(_0x2a346d){socket[_0x5d63('0x7f')](_0x5d63('0x80'),{'UserId':_0x2a346d,'OpenchannelQueueId':_0x27c4b7['id']});});});});});});})['then'](respondWithStatusCode(_0x2e0c61,null))['catch'](handleError(_0x2e0c61,null));};exports['addAgents']=function(_0x509e9e,_0x2b6de9,_0x19ed71){return db['OpenchannelQueue']['find']({'where':{'id':_0x509e9e[_0x5d63('0x46')]['id']}})[_0x5d63('0x23')](handleEntityNotFound(_0x2b6de9,null))[_0x5d63('0x23')](function(_0x4a64b0){if(_0x4a64b0){return _0x4a64b0['addAgents'](_0x509e9e[_0x5d63('0x4c')][_0x5d63('0x61')],_[_0x5d63('0x81')](_0x509e9e['body'],[_0x5d63('0x61'),'id'])||{})[_0x5d63('0x82')](function(_0x223b55){for(var _0xe7513a=0x0;_0xe7513a<_0x509e9e[_0x5d63('0x4c')]['ids'][_0x5d63('0x39')];_0xe7513a+=0x1){socket[_0x5d63('0x7f')](_0x5d63('0x69'),{'UserId':_0x509e9e['body'][_0x5d63('0x61')][_0xe7513a],'OpenchannelQueueId':_0x509e9e['params']['id']});}return _0x223b55;});}})[_0x5d63('0x23')](respondWithResult(_0x2b6de9,null))[_0x5d63('0x44')](handleError(_0x2b6de9,null));};exports['removeAgents']=function(_0x628b2d,_0x158b07,_0x3e0c14){return db[_0x5d63('0x2e')]['find']({'where':{'id':_0x628b2d[_0x5d63('0x46')]['id']}})[_0x5d63('0x23')](handleEntityNotFound(_0x158b07,null))['then'](function(_0x2c098e){if(_0x2c098e){return _0x2c098e['removeAgents'](_0x628b2d[_0x5d63('0x34')][_0x5d63('0x61')])['then'](function(){if(_[_0x5d63('0x83')](_0x628b2d[_0x5d63('0x34')]['ids'])){for(var _0x5bb453=0x0;_0x5bb453<_0x628b2d[_0x5d63('0x34')][_0x5d63('0x61')][_0x5d63('0x39')];_0x5bb453+=0x1){socket[_0x5d63('0x7f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x628b2d[_0x5d63('0x34')][_0x5d63('0x61')][_0x5bb453]),'OpenchannelQueueId':Number(_0x628b2d[_0x5d63('0x46')]['id'])});}}else{socket[_0x5d63('0x7f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x628b2d[_0x5d63('0x34')]['ids']),'OpenchannelQueueId':Number(_0x628b2d[_0x5d63('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x158b07,null))[_0x5d63('0x44')](handleError(_0x158b07,null));};exports[_0x5d63('0x84')]=function(_0x5e2986,_0x214780,_0x393d48){var _0x22efc3={};var _0x353aba={};var _0x1d6a08;var _0x3d53ee;return db['OpenchannelQueue'][_0x5d63('0x53')]({'where':{'id':_0x5e2986['params']['id']}})[_0x5d63('0x23')](handleEntityNotFound(_0x214780,null))[_0x5d63('0x23')](function(_0x53a6aa){if(_0x53a6aa){_0x1d6a08=_0x53a6aa;_0x353aba[_0x5d63('0x33')]=_['keys'](db[_0x5d63('0x57')][_0x5d63('0x2f')]);_0x353aba[_0x5d63('0x34')]=_[_0x5d63('0x47')](_0x5e2986['query']);_0x353aba['filters']=_['intersection'](_0x353aba[_0x5d63('0x33')],_0x353aba[_0x5d63('0x34')]);_0x22efc3['attributes']=_['intersection'](_0x353aba[_0x5d63('0x33')],qs[_0x5d63('0x38')](_0x5e2986[_0x5d63('0x34')][_0x5d63('0x38')]));_0x22efc3['attributes']=_0x22efc3[_0x5d63('0x37')][_0x5d63('0x39')]?_0x22efc3[_0x5d63('0x37')]:_0x353aba[_0x5d63('0x33')];_0x22efc3[_0x5d63('0x3b')]=qs[_0x5d63('0x3c')](_0x5e2986[_0x5d63('0x34')][_0x5d63('0x3c')]);_0x22efc3[_0x5d63('0x3d')]=qs['filters'](_[_0x5d63('0x3e')](_0x5e2986[_0x5d63('0x34')],_0x353aba[_0x5d63('0x35')]));if(_0x5e2986['query'][_0x5d63('0x3f')]){_0x22efc3[_0x5d63('0x3d')]=_[_0x5d63('0x40')](_0x22efc3['where'],{'$or':_[_0x5d63('0x2d')](_0x22efc3['attributes'],function(_0x5321b1){var _0x49b6a8={};_0x49b6a8[_0x5321b1]={'$like':'%'+_0x5e2986[_0x5d63('0x34')]['filter']+'%'};return _0x49b6a8;})});}_0x22efc3=_[_0x5d63('0x40')]({},_0x22efc3,_0x5e2986[_0x5d63('0x49')]);return _0x1d6a08[_0x5d63('0x84')](_0x22efc3);}})['then'](function(_0x3bd6b7){if(_0x3bd6b7){_0x3d53ee=_0x3bd6b7[_0x5d63('0x39')];if(!_0x5e2986[_0x5d63('0x34')]['hasOwnProperty'](_0x5d63('0x3a'))){_0x22efc3[_0x5d63('0x1e')]=qs[_0x5d63('0x1e')](_0x5e2986[_0x5d63('0x34')][_0x5d63('0x1e')]);_0x22efc3[_0x5d63('0x1d')]=qs['offset'](_0x5e2986[_0x5d63('0x34')][_0x5d63('0x1d')]);}return _0x1d6a08[_0x5d63('0x84')](_0x22efc3);}})[_0x5d63('0x23')](function(_0x343883){if(_0x343883){return _0x343883?{'count':_0x3d53ee,'rows':_0x343883}:null;}})[_0x5d63('0x23')](respondWithResult(_0x214780,null))[_0x5d63('0x44')](handleError(_0x214780,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4a8ebee..6f69abc 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 _0xcb65=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x4d20e7,_0x3f63f7){var _0x56ad59=function(_0x565019){while(--_0x565019){_0x4d20e7['push'](_0x4d20e7['shift']());}};_0x56ad59(++_0x3f63f7);}(_0xcb65,0x6a));var _0x5cb6=function(_0x34ea1e,_0x152007){_0x34ea1e=_0x34ea1e-0x0;var _0xcb6be2=_0xcb65[_0x34ea1e];return _0xcb6be2;};'use strict';var EventEmitter=require(_0x5cb6('0x0'));var OpenchannelQueue=require(_0x5cb6('0x1'))['db'][_0x5cb6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5cb6('0x3')](0x0);var events={'afterCreate':_0x5cb6('0x4'),'afterUpdate':_0x5cb6('0x5'),'afterDestroy':_0x5cb6('0x6')};function emitEvent(_0x4b351e){return function(_0x3db979,_0x25c354,_0x441e2e){OpenchannelQueueEvents[_0x5cb6('0x7')](_0x4b351e+':'+_0x3db979['id'],_0x3db979);OpenchannelQueueEvents[_0x5cb6('0x7')](_0x4b351e,_0x3db979);_0x441e2e(null);};}for(var e in events){if(events[_0x5cb6('0x8')](e)){var event=events[e];OpenchannelQueue[_0x5cb6('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x4949=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x2499c5,_0x103451){var _0x2a4cd9=function(_0x4aaa4f){while(--_0x4aaa4f){_0x2499c5['push'](_0x2499c5['shift']());}};_0x2a4cd9(++_0x103451);}(_0x4949,0xfd));var _0x9494=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4949[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9494('0x0'))['db'][_0x9494('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9494('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9494('0x3'),'afterDestroy':_0x9494('0x4')};function emitEvent(_0x3b2da8){return function(_0x5c57c9,_0x15aa0a,_0x516a24){OpenchannelQueueEvents[_0x9494('0x5')](_0x3b2da8+':'+_0x5c57c9['id'],_0x5c57c9);OpenchannelQueueEvents[_0x9494('0x5')](_0x3b2da8,_0x5c57c9);_0x516a24(null);};}for(var e in events){if(events[_0x9494('0x6')](e)){var event=events[e];OpenchannelQueue[_0x9494('0x7')](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 5248ed3..a73aff1 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 _0x749c=['path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x33a89d,_0xed52ed){var _0x175025=function(_0x27030f){while(--_0x27030f){_0x33a89d['push'](_0x33a89d['shift']());}};_0x175025(++_0xed52ed);}(_0x749c,0x17a));var _0xc749=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x749c[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0xc749('0x0'));var util=require(_0xc749('0x1'));var logger=require(_0xc749('0x2'))(_0xc749('0x3'));var moment=require('moment');var BPromise=require(_0xc749('0x4'));var rp=require(_0xc749('0x5'));var fs=require('fs');var path=require(_0xc749('0x6'));var rimraf=require(_0xc749('0x7'));var config=require(_0xc749('0x8'));var attributes=require(_0xc749('0x9'));module['exports']=function(_0x2b3dbc,_0x4adb3e){return _0x2b3dbc[_0xc749('0xa')](_0xc749('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c74=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x6c74,0xb4));var _0x46c7=function(_0x3b77aa,_0xb10575){_0x3b77aa=_0x3b77aa-0x0;var _0x217df5=_0x6c74[_0x3b77aa];return _0x217df5;};'use strict';var _=require('lodash');var util=require(_0x46c7('0x0'));var logger=require('../../config/logger')(_0x46c7('0x1'));var moment=require(_0x46c7('0x2'));var BPromise=require(_0x46c7('0x3'));var rp=require(_0x46c7('0x4'));var fs=require('fs');var path=require(_0x46c7('0x5'));var rimraf=require(_0x46c7('0x6'));var config=require(_0x46c7('0x7'));var attributes=require(_0x46c7('0x8'));module[_0x46c7('0x9')]=function(_0x2635e2,_0x392ec9){return _0x2635e2[_0x46c7('0xa')](_0x46c7('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 7624131..010cfda 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 _0xaaaf=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','OpenchannelQueue','options','raw','where','attributes','limit','map','model','include','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find','lodash'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0xaaaf,0x1df));var _0xfaaa=function(_0x8052d3,_0x31dfc7){_0x8052d3=_0x8052d3-0x0;var _0x2a3988=_0xaaaf[_0x8052d3];return _0x2a3988;};'use strict';var _=require(_0xfaaa('0x0'));var util=require(_0xfaaa('0x1'));var moment=require(_0xfaaa('0x2'));var BPromise=require('bluebird');var rs=require(_0xfaaa('0x3'));var fs=require('fs');var Redis=require(_0xfaaa('0x4'));var db=require(_0xfaaa('0x5'))['db'];var utils=require(_0xfaaa('0x6'));var logger=require(_0xfaaa('0x7'))('rpc');var config=require(_0xfaaa('0x8'));var jayson=require(_0xfaaa('0x9'));var client=jayson[_0xfaaa('0xa')][_0xfaaa('0xb')]({'port':0x232a});config[_0xfaaa('0xc')]=_[_0xfaaa('0xd')](config[_0xfaaa('0xc')],{'host':_0xfaaa('0xe'),'port':0x18eb});var socket=require(_0xfaaa('0xf'))(new Redis(config[_0xfaaa('0xc')]));require('./openchannelQueue.socket')[_0xfaaa('0x10')](socket);function respondWithRpcPromise(_0x905765,_0x256970,_0x1b4228){return new BPromise(function(_0xb6f77c,_0x59d251){return client[_0xfaaa('0x11')](_0x905765,_0x1b4228)[_0xfaaa('0x12')](function(_0x401b97){logger[_0xfaaa('0x13')](_0xfaaa('0x14'),_0x256970,_0xfaaa('0x15'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x256970,'request\x20sent',JSON[_0xfaaa('0x16')](_0x401b97));if(_0x401b97[_0xfaaa('0x17')]){if(_0x401b97[_0xfaaa('0x17')]['code']===0x1f4){logger[_0xfaaa('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x256970,_0x401b97[_0xfaaa('0x17')][_0xfaaa('0x18')]);return _0x59d251(_0x401b97[_0xfaaa('0x17')][_0xfaaa('0x18')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x256970,_0x401b97['error'][_0xfaaa('0x18')]);return _0xb6f77c(_0x401b97[_0xfaaa('0x17')][_0xfaaa('0x18')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x256970,_0xfaaa('0x15'));_0xb6f77c(_0x401b97[_0xfaaa('0x19')]['message']);}})[_0xfaaa('0x1a')](function(_0x1674bf){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x256970,_0x1674bf);_0x59d251(_0x1674bf);});});}exports['GetOpenchannelQueue']=function(_0xefa4ab){var _0x24b8df=this;return new Promise(function(_0x710d42,_0x42c970){return db[_0xfaaa('0x1b')]['findAll']({'raw':_0xefa4ab[_0xfaaa('0x1c')]?_0xefa4ab[_0xfaaa('0x1c')][_0xfaaa('0x1d')]===undefined?!![]:![]:!![],'where':_0xefa4ab[_0xfaaa('0x1c')]?_0xefa4ab[_0xfaaa('0x1c')][_0xfaaa('0x1e')]||null:null,'attributes':_0xefa4ab[_0xfaaa('0x1c')]?_0xefa4ab[_0xfaaa('0x1c')][_0xfaaa('0x1f')]||null:null,'limit':_0xefa4ab['options']?_0xefa4ab[_0xfaaa('0x1c')][_0xfaaa('0x20')]||null:null,'include':_0xefa4ab['options']?_0xefa4ab[_0xfaaa('0x1c')]['include']?_[_0xfaaa('0x21')](_0xefa4ab[_0xfaaa('0x1c')]['include'],function(_0x1bf3a5){return{'model':db[_0x1bf3a5[_0xfaaa('0x22')]],'as':_0x1bf3a5['as'],'attributes':_0x1bf3a5[_0xfaaa('0x1f')],'include':_0x1bf3a5[_0xfaaa('0x23')]?_[_0xfaaa('0x21')](_0x1bf3a5[_0xfaaa('0x23')],function(_0x257ee7){return{'model':db[_0x257ee7[_0xfaaa('0x22')]],'as':_0x257ee7['as'],'attributes':_0x257ee7[_0xfaaa('0x1f')],'include':_0x257ee7[_0xfaaa('0x23')]?_[_0xfaaa('0x21')](_0x257ee7['include'],function(_0x2ee0c5){return{'model':db[_0x2ee0c5[_0xfaaa('0x22')]],'as':_0x2ee0c5['as'],'attributes':_0x2ee0c5[_0xfaaa('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e0b80){logger[_0xfaaa('0x13')](_0xfaaa('0x24'),_0xefa4ab);logger[_0xfaaa('0x25')]('GetOpenchannelQueue',_0xefa4ab,JSON[_0xfaaa('0x16')](_0x5e0b80));_0x710d42(_0x5e0b80);})[_0xfaaa('0x1a')](function(_0x42b583){logger['error'](_0xfaaa('0x24'),_0x42b583[_0xfaaa('0x18')],_0xefa4ab);_0x42c970(_0x24b8df[_0xfaaa('0x17')](0x1f4,_0x42b583[_0xfaaa('0x18')]));});});};exports[_0xfaaa('0x26')]=function(_0x5c7272){var _0x2bba25=this;return new Promise(function(_0x518619,_0x1fc5f1){return db[_0xfaaa('0x1b')][_0xfaaa('0x27')]({'raw':_0x5c7272[_0xfaaa('0x1c')]?_0x5c7272[_0xfaaa('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5c7272[_0xfaaa('0x1c')]?_0x5c7272[_0xfaaa('0x1c')]['where']||null:null,'attributes':_0x5c7272[_0xfaaa('0x1c')]?_0x5c7272[_0xfaaa('0x1c')][_0xfaaa('0x1f')]||null:null,'include':_0x5c7272[_0xfaaa('0x1c')]?_0x5c7272[_0xfaaa('0x1c')][_0xfaaa('0x23')]?_[_0xfaaa('0x21')](_0x5c7272[_0xfaaa('0x1c')][_0xfaaa('0x23')],function(_0x412f4f){return{'model':db[_0x412f4f[_0xfaaa('0x22')]],'as':_0x412f4f['as'],'attributes':_0x412f4f[_0xfaaa('0x1f')],'include':_0x412f4f[_0xfaaa('0x23')]?_[_0xfaaa('0x21')](_0x412f4f[_0xfaaa('0x23')],function(_0x213340){return{'model':db[_0x213340['model']],'as':_0x213340['as'],'attributes':_0x213340[_0xfaaa('0x1f')],'include':_0x213340[_0xfaaa('0x23')]?_[_0xfaaa('0x21')](_0x213340[_0xfaaa('0x23')],function(_0x100791){return{'model':db[_0x100791['model']],'as':_0x100791['as'],'attributes':_0x100791[_0xfaaa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfaaa('0x12')](function(_0x350e4d){logger['info'](_0xfaaa('0x26'),_0x5c7272);logger['debug']('ShowOpenchannelQueue',_0x5c7272,JSON[_0xfaaa('0x16')](_0x350e4d));_0x518619(_0x350e4d);})[_0xfaaa('0x1a')](function(_0xfc41b3){logger[_0xfaaa('0x17')](_0xfaaa('0x26'),_0xfc41b3[_0xfaaa('0x18')],_0x5c7272);_0x1fc5f1(_0x2bba25[_0xfaaa('0x17')](0x1f4,_0xfc41b3[_0xfaaa('0x18')]));});});}; \ No newline at end of file +var _0x890c=['stringify','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x177ba5,_0xb74e07){var _0x2bb6ff=function(_0x1eb01a){while(--_0x1eb01a){_0x177ba5['push'](_0x177ba5['shift']());}};_0x2bb6ff(++_0xb74e07);}(_0x890c,0xd5));var _0xc890=function(_0x380c5e,_0x14fc28){_0x380c5e=_0x380c5e-0x0;var _0x33ce50=_0x890c[_0x380c5e];return _0x33ce50;};'use strict';var _=require(_0xc890('0x0'));var util=require(_0xc890('0x1'));var moment=require(_0xc890('0x2'));var BPromise=require(_0xc890('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc890('0x4'));var db=require(_0xc890('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc890('0x6'));var config=require(_0xc890('0x7'));var jayson=require(_0xc890('0x8'));var client=jayson[_0xc890('0x9')]['http']({'port':0x232a});config[_0xc890('0xa')]=_[_0xc890('0xb')](config['redis'],{'host':_0xc890('0xc'),'port':0x18eb});var socket=require(_0xc890('0xd'))(new Redis(config[_0xc890('0xa')]));require(_0xc890('0xe'))[_0xc890('0xf')](socket);function respondWithRpcPromise(_0x4bde32,_0x30e99b,_0x17213d){return new BPromise(function(_0x472dcb,_0x260b73){return client[_0xc890('0x10')](_0x4bde32,_0x17213d)[_0xc890('0x11')](function(_0x565832){logger[_0xc890('0x12')](_0xc890('0x13'),_0x30e99b,_0xc890('0x14'));logger[_0xc890('0x15')](_0xc890('0x16'),_0x30e99b,'request\x20sent',JSON['stringify'](_0x565832));if(_0x565832['error']){if(_0x565832[_0xc890('0x17')][_0xc890('0x18')]===0x1f4){logger[_0xc890('0x17')](_0xc890('0x13'),_0x30e99b,_0x565832[_0xc890('0x17')][_0xc890('0x19')]);return _0x260b73(_0x565832['error'][_0xc890('0x19')]);}logger[_0xc890('0x17')](_0xc890('0x13'),_0x30e99b,_0x565832[_0xc890('0x17')][_0xc890('0x19')]);return _0x472dcb(_0x565832['error'][_0xc890('0x19')]);}else{logger[_0xc890('0x12')](_0xc890('0x13'),_0x30e99b,_0xc890('0x14'));_0x472dcb(_0x565832[_0xc890('0x1a')][_0xc890('0x19')]);}})[_0xc890('0x1b')](function(_0x344652){logger['error'](_0xc890('0x13'),_0x30e99b,_0x344652);_0x260b73(_0x344652);});});}exports[_0xc890('0x1c')]=function(_0x353bd8){var _0x1e6e03=this;return new Promise(function(_0x296325,_0x2232c4){return db[_0xc890('0x1d')][_0xc890('0x1e')]({'raw':_0x353bd8['options']?_0x353bd8[_0xc890('0x1f')][_0xc890('0x20')]===undefined?!![]:![]:!![],'where':_0x353bd8[_0xc890('0x1f')]?_0x353bd8[_0xc890('0x1f')][_0xc890('0x21')]||null:null,'attributes':_0x353bd8[_0xc890('0x1f')]?_0x353bd8[_0xc890('0x1f')][_0xc890('0x22')]||null:null,'limit':_0x353bd8[_0xc890('0x1f')]?_0x353bd8[_0xc890('0x1f')][_0xc890('0x23')]||null:null,'include':_0x353bd8[_0xc890('0x1f')]?_0x353bd8['options'][_0xc890('0x24')]?_[_0xc890('0x25')](_0x353bd8[_0xc890('0x1f')][_0xc890('0x24')],function(_0x511812){return{'model':db[_0x511812[_0xc890('0x26')]],'as':_0x511812['as'],'attributes':_0x511812[_0xc890('0x22')],'include':_0x511812['include']?_[_0xc890('0x25')](_0x511812['include'],function(_0x41b5e3){return{'model':db[_0x41b5e3[_0xc890('0x26')]],'as':_0x41b5e3['as'],'attributes':_0x41b5e3['attributes'],'include':_0x41b5e3[_0xc890('0x24')]?_[_0xc890('0x25')](_0x41b5e3[_0xc890('0x24')],function(_0x4e780c){return{'model':db[_0x4e780c[_0xc890('0x26')]],'as':_0x4e780c['as'],'attributes':_0x4e780c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc890('0x11')](function(_0x2d00ed){logger[_0xc890('0x12')]('GetOpenchannelQueue',_0x353bd8);logger['debug'](_0xc890('0x1c'),_0x353bd8,JSON[_0xc890('0x27')](_0x2d00ed));_0x296325(_0x2d00ed);})['catch'](function(_0x29ee97){logger[_0xc890('0x17')](_0xc890('0x1c'),_0x29ee97[_0xc890('0x19')],_0x353bd8);_0x2232c4(_0x1e6e03[_0xc890('0x17')](0x1f4,_0x29ee97[_0xc890('0x19')]));});});};exports[_0xc890('0x28')]=function(_0xa47cb6){var _0x474024=this;return new Promise(function(_0x43fb37,_0xbc7e78){return db['OpenchannelQueue'][_0xc890('0x29')]({'raw':_0xa47cb6['options']?_0xa47cb6['options']['raw']===undefined?!![]:![]:!![],'where':_0xa47cb6['options']?_0xa47cb6[_0xc890('0x1f')][_0xc890('0x21')]||null:null,'attributes':_0xa47cb6[_0xc890('0x1f')]?_0xa47cb6[_0xc890('0x1f')][_0xc890('0x22')]||null:null,'include':_0xa47cb6[_0xc890('0x1f')]?_0xa47cb6[_0xc890('0x1f')][_0xc890('0x24')]?_[_0xc890('0x25')](_0xa47cb6[_0xc890('0x1f')][_0xc890('0x24')],function(_0x3ca640){return{'model':db[_0x3ca640[_0xc890('0x26')]],'as':_0x3ca640['as'],'attributes':_0x3ca640['attributes'],'include':_0x3ca640['include']?_[_0xc890('0x25')](_0x3ca640[_0xc890('0x24')],function(_0x4e5edd){return{'model':db[_0x4e5edd[_0xc890('0x26')]],'as':_0x4e5edd['as'],'attributes':_0x4e5edd['attributes'],'include':_0x4e5edd['include']?_['map'](_0x4e5edd[_0xc890('0x24')],function(_0x33515d){return{'model':db[_0x33515d['model']],'as':_0x33515d['as'],'attributes':_0x33515d[_0xc890('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc890('0x11')](function(_0x2c29e1){logger[_0xc890('0x12')](_0xc890('0x28'),_0xa47cb6);logger['debug'](_0xc890('0x28'),_0xa47cb6,JSON['stringify'](_0x2c29e1));_0x43fb37(_0x2c29e1);})[_0xc890('0x1b')](function(_0x4aa197){logger[_0xc890('0x17')](_0xc890('0x28'),_0x4aa197[_0xc890('0x19')],_0xa47cb6);_0xbc7e78(_0x474024[_0xc890('0x17')](0x1f4,_0x4aa197[_0xc890('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b1e9362..1a8d1c1 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 _0x7f7b=['emit','removeListener','register','./openchannelQueue.events'];(function(_0x66f16a,_0x36f438){var _0x2501c3=function(_0x2a959a){while(--_0x2a959a){_0x66f16a['push'](_0x66f16a['shift']());}};_0x2501c3(++_0x36f438);}(_0x7f7b,0xfb));var _0xb7f7=function(_0x4ab0be,_0x3411c9){_0x4ab0be=_0x4ab0be-0x0;var _0x576b08=_0x7f7b[_0x4ab0be];return _0x576b08;};'use strict';var OpenchannelQueueEvents=require(_0xb7f7('0x0'));var events=['save','remove','update'];function createListener(_0x1a10bd,_0x3b0206){return function(_0x4fe344){_0x3b0206[_0xb7f7('0x1')](_0x1a10bd,_0x4fe344);};}function removeListener(_0x1fe242,_0x4461f5){return function(){OpenchannelQueueEvents[_0xb7f7('0x2')](_0x1fe242,_0x4461f5);};}exports[_0xb7f7('0x3')]=function(_0x758dc9){for(var _0x459389=0x0,_0x175010=events['length'];_0x459389<_0x175010;_0x459389++){var _0xd37ccd=events[_0x459389];var _0x11eea1=createListener('openchannelQueue:'+_0xd37ccd,_0x758dc9);OpenchannelQueueEvents['on'](_0xd37ccd,_0x11eea1);}}; \ No newline at end of file +var _0xf83d=['./openchannelQueue.events','update','emit','removeListener','register','openchannelQueue:'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0xf83d,0x138));var _0xdf83=function(_0x46be46,_0x2149c6){_0x46be46=_0x46be46-0x0;var _0x1b0381=_0xf83d[_0x46be46];return _0x1b0381;};'use strict';var OpenchannelQueueEvents=require(_0xdf83('0x0'));var events=['save','remove',_0xdf83('0x1')];function createListener(_0x1a149d,_0x3b7575){return function(_0x1abb58){_0x3b7575[_0xdf83('0x2')](_0x1a149d,_0x1abb58);};}function removeListener(_0x2dbadc,_0x166177){return function(){OpenchannelQueueEvents[_0xdf83('0x3')](_0x2dbadc,_0x166177);};}exports[_0xdf83('0x4')]=function(_0x11c2c0){for(var _0x378a22=0x0,_0x4a43b2=events['length'];_0x378a22<_0x4a43b2;_0x378a22++){var _0x35eb10=events[_0x378a22];var _0x4a14f4=createListener(_0xdf83('0x5')+_0x35eb10,_0x11c2c0);OpenchannelQueueEvents['on'](_0x35eb10,_0x4a14f4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 1ff3aff..d748daa 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 _0x6373=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','show','post','/:id','update'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x6373,0x18a));var _0x3637=function(_0xf8063b,_0x4e3f70){_0xf8063b=_0xf8063b-0x0;var _0x32cb04=_0x6373[_0xf8063b];return _0x32cb04;};'use strict';var multer=require(_0x3637('0x0'));var util=require('util');var path=require(_0x3637('0x1'));var timeout=require(_0x3637('0x2'));var express=require(_0x3637('0x3'));var router=express['Router']();var auth=require(_0x3637('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3637('0x5'));router['get']('/',auth[_0x3637('0x6')](),controller[_0x3637('0x7')]);router[_0x3637('0x8')]('/describe',auth[_0x3637('0x6')](),controller[_0x3637('0x9')]);router[_0x3637('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3637('0xa')]);router[_0x3637('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3637('0xc'),auth[_0x3637('0x6')](),controller[_0x3637('0xd')]);router[_0x3637('0xe')](_0x3637('0xc'),auth[_0x3637('0x6')](),controller[_0x3637('0xf')]);module[_0x3637('0x10')]=router; \ No newline at end of file +var _0x865e=['describe','/:id','show','post','create','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0xc3a073,_0x48b86d){var _0x2d2a68=function(_0x3a5543){while(--_0x3a5543){_0xc3a073['push'](_0xc3a073['shift']());}};_0x2d2a68(++_0x48b86d);}(_0x865e,0x1e3));var _0xe865=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x865e[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0xe865('0x0'));var util=require(_0xe865('0x1'));var path=require('path');var timeout=require(_0xe865('0x2'));var express=require('express');var router=express[_0xe865('0x3')]();var auth=require(_0xe865('0x4'));var interaction=require(_0xe865('0x5'));var config=require(_0xe865('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0xe865('0x7')]('/',auth[_0xe865('0x8')](),controller[_0xe865('0x9')]);router['get'](_0xe865('0xa'),auth[_0xe865('0x8')](),controller[_0xe865('0xb')]);router[_0xe865('0x7')](_0xe865('0xc'),auth[_0xe865('0x8')](),controller[_0xe865('0xd')]);router[_0xe865('0xe')]('/',auth[_0xe865('0x8')](),controller[_0xe865('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe865('0x10')]);router[_0xe865('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe865('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 e914277..5ca0069 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 _0x61a1=['STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x61a1,0x1c0));var _0x161a=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x61a1[_0x56756b];return _0xa3002;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x161a('0x0')]},'joinAt':{'type':Sequelize[_0x161a('0x1')]},'leaveAt':{'type':Sequelize[_0x161a('0x1')]},'acceptAt':{'type':Sequelize[_0x161a('0x1')]},'exitAt':{'type':Sequelize[_0x161a('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1462=['DATE','sequelize','exports','STRING'];(function(_0x1915f9,_0x10f57d){var _0x2997bd=function(_0x1521f7){while(--_0x1521f7){_0x1915f9['push'](_0x1915f9['shift']());}};_0x2997bd(++_0x10f57d);}(_0x1462,0x109));var _0x2146=function(_0x3590b5,_0x9abc4c){_0x3590b5=_0x3590b5-0x0;var _0x50dcb9=_0x1462[_0x3590b5];return _0x50dcb9;};'use strict';var moment=require('moment');var Sequelize=require(_0x2146('0x0'));module[_0x2146('0x1')]={'uniqueid':{'type':Sequelize[_0x2146('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2146('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2146('0x3')]},'reason':{'type':Sequelize[_0x2146('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index f78b10d..fad2391 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 _0x0424=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service'];(function(_0x4a4d8f,_0x13aae4){var _0xf1b3d5=function(_0x1c705c){while(--_0x1c705c){_0x4a4d8f['push'](_0x4a4d8f['shift']());}};_0xf1b3d5(++_0x13aae4);}(_0x0424,0x159));var _0x4042=function(_0x38b347,_0x29f7f6){_0x38b347=_0x38b347-0x0;var _0x24134e=_0x0424[_0x38b347];return _0x24134e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4042('0x0'));var zipdir=require(_0x4042('0x1'));var jsonpatch=require(_0x4042('0x2'));var rp=require(_0x4042('0x3'));var moment=require('moment');var BPromise=require(_0x4042('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4042('0x5'));var sox=require(_0x4042('0x6'));var csv=require(_0x4042('0x7'));var ejs=require(_0x4042('0x8'));var fs=require('fs');var _=require(_0x4042('0x9'));var squel=require(_0x4042('0xa'));var crypto=require(_0x4042('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4042('0x7'));var querystring=require(_0x4042('0xc'));var Papa=require(_0x4042('0xd'));var Redis=require('ioredis');var authService=require(_0x4042('0xe'));var qs=require(_0x4042('0xf'));var as=require(_0x4042('0x10'));var hardwareService=require(_0x4042('0x11'));var logger=require(_0x4042('0x12'))(_0x4042('0x13'));var utils=require(_0x4042('0x14'));var config=require(_0x4042('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c06ae,_0x357838){_0x357838=_0x357838||0xcc;return function(_0x59a068){if(_0x59a068){return _0x2c06ae[_0x4042('0x16')](_0x357838);}return _0x2c06ae[_0x4042('0x17')](_0x357838)[_0x4042('0x18')]();};}function respondWithResult(_0x1dd593,_0x35f82a){_0x35f82a=_0x35f82a||0xc8;return function(_0x1ff3ca){if(_0x1ff3ca){return _0x1dd593[_0x4042('0x17')](_0x35f82a)['json'](_0x1ff3ca);}};}function respondWithFilteredResult(_0x1029cf,_0x291e5c){return function(_0x50206f){if(_0x50206f){var _0x28087d=_0x50206f[_0x4042('0x19')],_0x3f99f8=_0x291e5c[_0x4042('0x1a')],_0x43dcb5=_0x291e5c[_0x4042('0x1a')]+_0x291e5c[_0x4042('0x1b')],_0x1c3328;if(_0x43dcb5>=_0x28087d){_0x43dcb5=_0x28087d;_0x1c3328=0xc8;}else{_0x1c3328=0xce;}_0x1029cf[_0x4042('0x17')](_0x1c3328);return _0x1029cf['set'](_0x4042('0x1c'),_0x3f99f8+'-'+_0x43dcb5+'/'+_0x28087d)['json'](_0x50206f);}return null;};}function patchUpdates(_0x9c8357){return function(_0x4bbc20){try{jsonpatch[_0x4042('0x1d')](_0x4bbc20,_0x9c8357,!![]);}catch(_0x163eee){return BPromise[_0x4042('0x1e')](_0x163eee);}return _0x4bbc20[_0x4042('0x1f')]();};}function saveUpdates(_0x52af14,_0xb72021){return function(_0x4561e3){if(_0x4561e3){return _0x4561e3[_0x4042('0x20')](_0x52af14)[_0x4042('0x21')](function(_0x51a1d4){return _0x51a1d4;});}return null;};}function removeEntity(_0x42b518,_0xf0e0c6){return function(_0xd6fe6c){if(_0xd6fe6c){return _0xd6fe6c[_0x4042('0x22')]()[_0x4042('0x21')](function(){_0x42b518['status'](0xcc)[_0x4042('0x18')]();});}};}function handleEntityNotFound(_0x6d12a5,_0x519f2c){return function(_0x1daee8){if(!_0x1daee8){_0x6d12a5['sendStatus'](0x194);}return _0x1daee8;};}function handleError(_0x271b82,_0x2c5fcf){_0x2c5fcf=_0x2c5fcf||0x1f4;return function(_0x3f5a64){logger['error'](_0x3f5a64[_0x4042('0x23')]);if(_0x3f5a64[_0x4042('0x24')]){delete _0x3f5a64[_0x4042('0x24')];}_0x271b82[_0x4042('0x17')](_0x2c5fcf)[_0x4042('0x25')](_0x3f5a64);};}exports['index']=function(_0x58c409,_0x1d8d48){var _0x1acdf2={},_0x26542c={},_0x3e5c02={'count':0x0,'rows':[]};var _0x332fe3=_[_0x4042('0x26')](db['OpenchannelQueueReport'][_0x4042('0x27')],function(_0x1e9bd7){return{'name':_0x1e9bd7['fieldName'],'type':_0x1e9bd7[_0x4042('0x28')][_0x4042('0x29')]};});_0x26542c[_0x4042('0x2a')]=_['map'](_0x332fe3,'name');_0x26542c[_0x4042('0x2b')]=_[_0x4042('0x2c')](_0x58c409['query']);_0x26542c[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x26542c[_0x4042('0x2a')],_0x26542c[_0x4042('0x2b')]);_0x1acdf2[_0x4042('0x2f')]=_[_0x4042('0x2e')](_0x26542c[_0x4042('0x2a')],qs[_0x4042('0x30')](_0x58c409[_0x4042('0x2b')]['fields']));_0x1acdf2[_0x4042('0x2f')]=_0x1acdf2[_0x4042('0x2f')]['length']?_0x1acdf2[_0x4042('0x2f')]:_0x26542c[_0x4042('0x2a')];if(!_0x58c409['query'][_0x4042('0x31')](_0x4042('0x32'))){_0x1acdf2[_0x4042('0x1b')]=qs[_0x4042('0x1b')](_0x58c409[_0x4042('0x2b')][_0x4042('0x1b')]);_0x1acdf2[_0x4042('0x1a')]=qs[_0x4042('0x1a')](_0x58c409[_0x4042('0x2b')][_0x4042('0x1a')]);}_0x1acdf2[_0x4042('0x33')]=qs[_0x4042('0x34')](_0x58c409[_0x4042('0x2b')][_0x4042('0x34')]);_0x1acdf2[_0x4042('0x35')]=qs[_0x4042('0x2d')](_[_0x4042('0x36')](_0x58c409[_0x4042('0x2b')],_0x26542c[_0x4042('0x2d')]));if(_0x58c409[_0x4042('0x2b')][_0x4042('0x37')]){_0x1acdf2['where']=_[_0x4042('0x38')](_0x1acdf2[_0x4042('0x35')],{'$or':_[_0x4042('0x26')](_0x332fe3,function(_0x464831){if(_0x464831['type']!==_0x4042('0x39')){var _0x271e94={};_0x271e94[_0x464831[_0x4042('0x24')]]={'$like':'%'+_0x58c409[_0x4042('0x2b')][_0x4042('0x37')]+'%'};return _0x271e94;}})});}_0x1acdf2=_[_0x4042('0x38')]({},_0x1acdf2,_0x58c409[_0x4042('0x3a')]);var _0x44f0c6={'where':_0x1acdf2[_0x4042('0x35')]};return db[_0x4042('0x3b')]['count'](_0x44f0c6)[_0x4042('0x21')](function(_0x4597fe){_0x3e5c02[_0x4042('0x19')]=_0x4597fe;if(_0x58c409[_0x4042('0x2b')][_0x4042('0x3c')]){_0x1acdf2[_0x4042('0x3d')]=[{'all':!![]}];}return db[_0x4042('0x3b')][_0x4042('0x3e')](_0x1acdf2);})['then'](function(_0x49213c){_0x3e5c02[_0x4042('0x3f')]=_0x49213c;return _0x3e5c02;})[_0x4042('0x21')](respondWithFilteredResult(_0x1d8d48,_0x1acdf2))[_0x4042('0x40')](handleError(_0x1d8d48,null));};exports[_0x4042('0x41')]=function(_0x3d215e,_0x4784ca){var _0xdfb5cb={'raw':!![],'where':{'id':_0x3d215e[_0x4042('0x42')]['id']}},_0x363fd={};_0x363fd[_0x4042('0x2a')]=_[_0x4042('0x2c')](db[_0x4042('0x3b')]['rawAttributes']);_0x363fd['query']=_[_0x4042('0x2c')](_0x3d215e[_0x4042('0x2b')]);_0x363fd['filters']=_[_0x4042('0x2e')](_0x363fd['model'],_0x363fd[_0x4042('0x2b')]);_0xdfb5cb[_0x4042('0x2f')]=_[_0x4042('0x2e')](_0x363fd['model'],qs[_0x4042('0x30')](_0x3d215e[_0x4042('0x2b')]['fields']));_0xdfb5cb[_0x4042('0x2f')]=_0xdfb5cb[_0x4042('0x2f')][_0x4042('0x43')]?_0xdfb5cb[_0x4042('0x2f')]:_0x363fd[_0x4042('0x2a')];if(_0x3d215e['query']['includeAll']){_0xdfb5cb['include']=[{'all':!![]}];}_0xdfb5cb=_[_0x4042('0x38')]({},_0xdfb5cb,_0x3d215e[_0x4042('0x3a')]);return db['OpenchannelQueueReport']['find'](_0xdfb5cb)['then'](handleEntityNotFound(_0x4784ca,null))[_0x4042('0x21')](respondWithResult(_0x4784ca,null))['catch'](handleError(_0x4784ca,null));};exports['create']=function(_0x136622,_0x19853f){return db[_0x4042('0x3b')][_0x4042('0x44')](_0x136622[_0x4042('0x45')],{})[_0x4042('0x21')](respondWithResult(_0x19853f,0xc9))[_0x4042('0x40')](handleError(_0x19853f,null));};exports[_0x4042('0x20')]=function(_0x198209,_0x57d413){if(_0x198209['body']['id']){delete _0x198209['body']['id'];}return db['OpenchannelQueueReport'][_0x4042('0x46')]({'where':{'id':_0x198209[_0x4042('0x42')]['id']}})[_0x4042('0x21')](handleEntityNotFound(_0x57d413,null))[_0x4042('0x21')](saveUpdates(_0x198209[_0x4042('0x45')],null))[_0x4042('0x21')](respondWithResult(_0x57d413,null))[_0x4042('0x40')](handleError(_0x57d413,null));};exports[_0x4042('0x22')]=function(_0x4a14bd,_0x24071a){return db[_0x4042('0x3b')][_0x4042('0x46')]({'where':{'id':_0x4a14bd[_0x4042('0x42')]['id']}})[_0x4042('0x21')](handleEntityNotFound(_0x24071a,null))[_0x4042('0x21')](removeEntity(_0x24071a,null))[_0x4042('0x40')](handleError(_0x24071a,null));};exports['describe']=function(_0x5ed001,_0x5c7212){return db[_0x4042('0x3b')][_0x4042('0x47')]()['then'](respondWithResult(_0x5c7212,null))[_0x4042('0x40')](handleError(_0x5c7212,null));}; \ No newline at end of file +var _0xd914=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format'];(function(_0x20f850,_0x5c2b01){var _0x48a89e=function(_0x477c02){while(--_0x477c02){_0x20f850['push'](_0x20f850['shift']());}};_0x48a89e(++_0x5c2b01);}(_0xd914,0x17f));var _0x4d91=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xd914[_0x17784a];return _0x41aded;};'use strict';var pdf=require(_0x4d91('0x0'));var emlformat=require(_0x4d91('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d91('0x2'));var jsonpatch=require(_0x4d91('0x3'));var rp=require(_0x4d91('0x4'));var moment=require(_0x4d91('0x5'));var BPromise=require(_0x4d91('0x6'));var Mustache=require(_0x4d91('0x7'));var util=require('util');var path=require(_0x4d91('0x8'));var sox=require('sox');var csv=require(_0x4d91('0x9'));var ejs=require(_0x4d91('0xa'));var fs=require('fs');var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x9'));var querystring=require('querystring');var Papa=require(_0x4d91('0x10'));var Redis=require(_0x4d91('0x11'));var authService=require(_0x4d91('0x12'));var qs=require(_0x4d91('0x13'));var as=require(_0x4d91('0x14'));var hardwareService=require(_0x4d91('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x16'));var config=require(_0x4d91('0x17'));var db=require(_0x4d91('0x18'))['db'];function respondWithStatusCode(_0x370e78,_0x1c15b7){_0x1c15b7=_0x1c15b7||0xcc;return function(_0x318e0c){if(_0x318e0c){return _0x370e78['sendStatus'](_0x1c15b7);}return _0x370e78['status'](_0x1c15b7)[_0x4d91('0x19')]();};}function respondWithResult(_0x1e7600,_0xb6590d){_0xb6590d=_0xb6590d||0xc8;return function(_0x3c9fd6){if(_0x3c9fd6){return _0x1e7600[_0x4d91('0x1a')](_0xb6590d)[_0x4d91('0x1b')](_0x3c9fd6);}};}function respondWithFilteredResult(_0x36f606,_0x4f5aef){return function(_0x3a8ec9){if(_0x3a8ec9){var _0x42631a=_0x3a8ec9['count'],_0x1e2ef7=_0x4f5aef[_0x4d91('0x1c')],_0xb92681=_0x4f5aef[_0x4d91('0x1c')]+_0x4f5aef[_0x4d91('0x1d')],_0x280e80;if(_0xb92681>=_0x42631a){_0xb92681=_0x42631a;_0x280e80=0xc8;}else{_0x280e80=0xce;}_0x36f606[_0x4d91('0x1a')](_0x280e80);return _0x36f606['set'](_0x4d91('0x1e'),_0x1e2ef7+'-'+_0xb92681+'/'+_0x42631a)[_0x4d91('0x1b')](_0x3a8ec9);}return null;};}function patchUpdates(_0x13254c){return function(_0x56dbd4){try{jsonpatch[_0x4d91('0x1f')](_0x56dbd4,_0x13254c,!![]);}catch(_0x127911){return BPromise[_0x4d91('0x20')](_0x127911);}return _0x56dbd4[_0x4d91('0x21')]();};}function saveUpdates(_0x10b767,_0x40cde4){return function(_0xc1d44f){if(_0xc1d44f){return _0xc1d44f[_0x4d91('0x22')](_0x10b767)[_0x4d91('0x23')](function(_0x226d85){return _0x226d85;});}return null;};}function removeEntity(_0x554878,_0x4493da){return function(_0x5f5236){if(_0x5f5236){return _0x5f5236['destroy']()[_0x4d91('0x23')](function(){_0x554878[_0x4d91('0x1a')](0xcc)[_0x4d91('0x19')]();});}};}function handleEntityNotFound(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(!_0x12b722){_0x9cb864[_0x4d91('0x24')](0x194);}return _0x12b722;};}function handleError(_0x123606,_0x55356b){_0x55356b=_0x55356b||0x1f4;return function(_0x498d58){logger[_0x4d91('0x25')](_0x498d58[_0x4d91('0x26')]);if(_0x498d58[_0x4d91('0x27')]){delete _0x498d58[_0x4d91('0x27')];}_0x123606[_0x4d91('0x1a')](_0x55356b)[_0x4d91('0x28')](_0x498d58);};}exports[_0x4d91('0x29')]=function(_0x560966,_0x3dc353){var _0xda9802={},_0x12ac74={},_0x5dded7={'count':0x0,'rows':[]};var _0x480a56=_[_0x4d91('0x2a')](db[_0x4d91('0x2b')]['rawAttributes'],function(_0x50fe76){return{'name':_0x50fe76[_0x4d91('0x2c')],'type':_0x50fe76[_0x4d91('0x2d')][_0x4d91('0x2e')]};});_0x12ac74[_0x4d91('0x2f')]=_['map'](_0x480a56,_0x4d91('0x27'));_0x12ac74[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x560966[_0x4d91('0x30')]);_0x12ac74[_0x4d91('0x32')]=_[_0x4d91('0x33')](_0x12ac74[_0x4d91('0x2f')],_0x12ac74['query']);_0xda9802[_0x4d91('0x34')]=_['intersection'](_0x12ac74['model'],qs[_0x4d91('0x35')](_0x560966[_0x4d91('0x30')]['fields']));_0xda9802[_0x4d91('0x34')]=_0xda9802[_0x4d91('0x34')][_0x4d91('0x36')]?_0xda9802[_0x4d91('0x34')]:_0x12ac74[_0x4d91('0x2f')];if(!_0x560966['query'][_0x4d91('0x37')](_0x4d91('0x38'))){_0xda9802[_0x4d91('0x1d')]=qs[_0x4d91('0x1d')](_0x560966[_0x4d91('0x30')][_0x4d91('0x1d')]);_0xda9802['offset']=qs[_0x4d91('0x1c')](_0x560966[_0x4d91('0x30')]['offset']);}_0xda9802[_0x4d91('0x39')]=qs[_0x4d91('0x3a')](_0x560966[_0x4d91('0x30')]['sort']);_0xda9802[_0x4d91('0x3b')]=qs[_0x4d91('0x32')](_[_0x4d91('0x3c')](_0x560966[_0x4d91('0x30')],_0x12ac74['filters']));if(_0x560966[_0x4d91('0x30')][_0x4d91('0x3d')]){_0xda9802[_0x4d91('0x3b')]=_[_0x4d91('0x3e')](_0xda9802['where'],{'$or':_['map'](_0x480a56,function(_0x30f969){if(_0x30f969[_0x4d91('0x2d')]!=='VIRTUAL'){var _0x25ee27={};_0x25ee27[_0x30f969[_0x4d91('0x27')]]={'$like':'%'+_0x560966[_0x4d91('0x30')][_0x4d91('0x3d')]+'%'};return _0x25ee27;}})});}_0xda9802=_['merge']({},_0xda9802,_0x560966[_0x4d91('0x3f')]);var _0x2a1106={'where':_0xda9802['where']};return db[_0x4d91('0x2b')]['count'](_0x2a1106)[_0x4d91('0x23')](function(_0x4e0841){_0x5dded7[_0x4d91('0x40')]=_0x4e0841;if(_0x560966['query'][_0x4d91('0x41')]){_0xda9802[_0x4d91('0x42')]=[{'all':!![]}];}return db[_0x4d91('0x2b')][_0x4d91('0x43')](_0xda9802);})['then'](function(_0x5bcc9b){_0x5dded7[_0x4d91('0x44')]=_0x5bcc9b;return _0x5dded7;})['then'](respondWithFilteredResult(_0x3dc353,_0xda9802))[_0x4d91('0x45')](handleError(_0x3dc353,null));};exports[_0x4d91('0x46')]=function(_0x51510e,_0x1dedfd){var _0x2ae356={'raw':!![],'where':{'id':_0x51510e[_0x4d91('0x47')]['id']}},_0x14db37={};_0x14db37[_0x4d91('0x2f')]=_[_0x4d91('0x31')](db[_0x4d91('0x2b')]['rawAttributes']);_0x14db37[_0x4d91('0x30')]=_['keys'](_0x51510e[_0x4d91('0x30')]);_0x14db37[_0x4d91('0x32')]=_[_0x4d91('0x33')](_0x14db37[_0x4d91('0x2f')],_0x14db37[_0x4d91('0x30')]);_0x2ae356[_0x4d91('0x34')]=_['intersection'](_0x14db37['model'],qs[_0x4d91('0x35')](_0x51510e[_0x4d91('0x30')]['fields']));_0x2ae356[_0x4d91('0x34')]=_0x2ae356[_0x4d91('0x34')][_0x4d91('0x36')]?_0x2ae356[_0x4d91('0x34')]:_0x14db37[_0x4d91('0x2f')];if(_0x51510e[_0x4d91('0x30')][_0x4d91('0x41')]){_0x2ae356[_0x4d91('0x42')]=[{'all':!![]}];}_0x2ae356=_[_0x4d91('0x3e')]({},_0x2ae356,_0x51510e['options']);return db['OpenchannelQueueReport'][_0x4d91('0x48')](_0x2ae356)['then'](handleEntityNotFound(_0x1dedfd,null))[_0x4d91('0x23')](respondWithResult(_0x1dedfd,null))[_0x4d91('0x45')](handleError(_0x1dedfd,null));};exports[_0x4d91('0x49')]=function(_0x10b1bb,_0x591b3e){return db[_0x4d91('0x2b')]['create'](_0x10b1bb['body'],{})[_0x4d91('0x23')](respondWithResult(_0x591b3e,0xc9))[_0x4d91('0x45')](handleError(_0x591b3e,null));};exports[_0x4d91('0x22')]=function(_0xa03d75,_0x1f91ec){if(_0xa03d75[_0x4d91('0x4a')]['id']){delete _0xa03d75['body']['id'];}return db[_0x4d91('0x2b')][_0x4d91('0x48')]({'where':{'id':_0xa03d75[_0x4d91('0x47')]['id']}})[_0x4d91('0x23')](handleEntityNotFound(_0x1f91ec,null))[_0x4d91('0x23')](saveUpdates(_0xa03d75[_0x4d91('0x4a')],null))[_0x4d91('0x23')](respondWithResult(_0x1f91ec,null))[_0x4d91('0x45')](handleError(_0x1f91ec,null));};exports[_0x4d91('0x4b')]=function(_0x145dfd,_0x16f776){return db['OpenchannelQueueReport'][_0x4d91('0x48')]({'where':{'id':_0x145dfd['params']['id']}})[_0x4d91('0x23')](handleEntityNotFound(_0x16f776,null))[_0x4d91('0x23')](removeEntity(_0x16f776,null))[_0x4d91('0x45')](handleError(_0x16f776,null));};exports[_0x4d91('0x4c')]=function(_0x436a3d,_0x3edc43){return db[_0x4d91('0x2b')][_0x4d91('0x4c')]()['then'](respondWithResult(_0x3edc43,null))[_0x4d91('0x45')](handleError(_0x3edc43,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 36a316e..1ae3576 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 _0xe198=['rimraf','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x54e792,_0x5f909){var _0x5ae41b=function(_0x58be29){while(--_0x58be29){_0x54e792['push'](_0x54e792['shift']());}};_0x5ae41b(++_0x5f909);}(_0xe198,0x6f));var _0x8e19=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xe198[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8e19('0x2'));var BPromise=require(_0x8e19('0x3'));var rp=require(_0x8e19('0x4'));var fs=require('fs');var path=require(_0x8e19('0x5'));var rimraf=require(_0x8e19('0x6'));var config=require('../../config/environment');var attributes=require(_0x8e19('0x7'));module[_0x8e19('0x8')]=function(_0x2fb138,_0x188ce0){return _0x2fb138[_0x8e19('0x9')](_0x8e19('0xa'),attributes,{'tableName':_0x8e19('0xb'),'paranoid':![],'indexes':[{'name':_0x8e19('0xc'),'fields':[_0x8e19('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x430e=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue'];(function(_0x5ec2b7,_0x1ceb0f){var _0x44ca29=function(_0x44449b){while(--_0x44449b){_0x5ec2b7['push'](_0x5ec2b7['shift']());}};_0x44ca29(++_0x1ceb0f);}(_0x430e,0x105));var _0xe430=function(_0x1c3736,_0x34662d){_0x1c3736=_0x1c3736-0x0;var _0x2a3fd6=_0x430e[_0x1c3736];return _0x2a3fd6;};'use strict';var _=require('lodash');var util=require(_0xe430('0x0'));var logger=require(_0xe430('0x1'))('api');var moment=require(_0xe430('0x2'));var BPromise=require(_0xe430('0x3'));var rp=require(_0xe430('0x4'));var fs=require('fs');var path=require(_0xe430('0x5'));var rimraf=require('rimraf');var config=require(_0xe430('0x6'));var attributes=require(_0xe430('0x7'));module[_0xe430('0x8')]=function(_0x1faac1,_0x541e30){return _0x1faac1[_0xe430('0x9')](_0xe430('0xa'),attributes,{'tableName':_0xe430('0xb'),'paranoid':![],'indexes':[{'name':_0xe430('0xc'),'fields':[_0xe430('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index d6030d1..68d8549 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 _0xae6e=['raw','update','options','attributes','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body'];(function(_0x33b4ad,_0xaa13c2){var _0x337266=function(_0xcc1025){while(--_0xcc1025){_0x33b4ad['push'](_0x33b4ad['shift']());}};_0x337266(++_0xaa13c2);}(_0xae6e,0x1e5));var _0xeae6=function(_0x28f74d,_0x37a93f){_0x28f74d=_0x28f74d-0x0;var _0x5abe79=_0xae6e[_0x28f74d];return _0x5abe79;};'use strict';var _=require(_0xeae6('0x0'));var util=require(_0xeae6('0x1'));var moment=require(_0xeae6('0x2'));var BPromise=require(_0xeae6('0x3'));var rs=require(_0xeae6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeae6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeae6('0x7')][_0xeae6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51854c,_0x2b8f17,_0x44d211){return new BPromise(function(_0x59ec94,_0x551f45){return client[_0xeae6('0x9')](_0x51854c,_0x44d211)[_0xeae6('0xa')](function(_0x2bb3e0){logger[_0xeae6('0xb')](_0xeae6('0xc'),_0x2b8f17,'request\x20sent');logger[_0xeae6('0xd')](_0xeae6('0xe'),_0x2b8f17,_0xeae6('0xf'),JSON[_0xeae6('0x10')](_0x2bb3e0));if(_0x2bb3e0[_0xeae6('0x11')]){if(_0x2bb3e0[_0xeae6('0x11')][_0xeae6('0x12')]===0x1f4){logger[_0xeae6('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b8f17,_0x2bb3e0[_0xeae6('0x11')]['message']);return _0x551f45(_0x2bb3e0['error'][_0xeae6('0x13')]);}logger[_0xeae6('0x11')](_0xeae6('0xc'),_0x2b8f17,_0x2bb3e0[_0xeae6('0x11')][_0xeae6('0x13')]);return _0x59ec94(_0x2bb3e0[_0xeae6('0x11')][_0xeae6('0x13')]);}else{logger[_0xeae6('0xb')](_0xeae6('0xc'),_0x2b8f17,'request\x20sent');_0x59ec94(_0x2bb3e0['result'][_0xeae6('0x13')]);}})[_0xeae6('0x14')](function(_0x35f217){logger[_0xeae6('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2b8f17,_0x35f217);_0x551f45(_0x35f217);});});}exports[_0xeae6('0x15')]=function(_0x3376b6){var _0x29682c=this;return new Promise(function(_0x126e69,_0x1dedfa){return db[_0xeae6('0x16')][_0xeae6('0x17')](_0x3376b6[_0xeae6('0x18')],{'raw':_0x3376b6['options']?_0x3376b6['options'][_0xeae6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1f0550){logger[_0xeae6('0xb')](_0xeae6('0x15'),_0x3376b6);logger['debug'](_0xeae6('0x15'),_0x3376b6,JSON[_0xeae6('0x10')](_0x1f0550));_0x126e69(_0x1f0550);})[_0xeae6('0x14')](function(_0x1e8c0f){logger[_0xeae6('0x11')](_0xeae6('0x15'),_0x1e8c0f[_0xeae6('0x13')],_0x3376b6);_0x1dedfa(_0x29682c[_0xeae6('0x11')](0x1f4,_0x1e8c0f['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4bf0db){var _0x227bc4=this;return new Promise(function(_0x154415,_0x47435b){return db[_0xeae6('0x16')][_0xeae6('0x1a')](_0x4bf0db[_0xeae6('0x18')],{'raw':_0x4bf0db[_0xeae6('0x1b')]?_0x4bf0db['options'][_0xeae6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bf0db['options']?_0x4bf0db['options']['where']||null:null,'attributes':_0x4bf0db[_0xeae6('0x1b')]?_0x4bf0db[_0xeae6('0x1b')][_0xeae6('0x1c')]||null:null,'limit':_0x4bf0db[_0xeae6('0x1b')]?_0x4bf0db['options']['limit']||null:null})['then'](function(_0x22fa08){logger[_0xeae6('0xb')](_0xeae6('0x1d'),_0x4bf0db);logger['debug'](_0xeae6('0x1d'),_0x4bf0db,JSON[_0xeae6('0x10')](_0x22fa08));_0x154415(_0x22fa08);})[_0xeae6('0x14')](function(_0x4d90ba){logger['error'](_0xeae6('0x1d'),_0x4d90ba[_0xeae6('0x13')],_0x4bf0db);_0x47435b(_0x227bc4[_0xeae6('0x11')](0x1f4,_0x4d90ba[_0xeae6('0x13')]));});});}; \ No newline at end of file +var _0x26b2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','UpdateOpenchannelQueueReport','update','body','where','limit','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5a6d6d,_0x509135){var _0x4acef=function(_0x1f9102){while(--_0x1f9102){_0x5a6d6d['push'](_0x5a6d6d['shift']());}};_0x4acef(++_0x509135);}(_0x26b2,0xc5));var _0x226b=function(_0x217f37,_0x4605e3){_0x217f37=_0x217f37-0x0;var _0x47e660=_0x26b2[_0x217f37];return _0x47e660;};'use strict';var _=require(_0x226b('0x0'));var util=require(_0x226b('0x1'));var moment=require(_0x226b('0x2'));var BPromise=require('bluebird');var rs=require(_0x226b('0x3'));var fs=require('fs');var Redis=require(_0x226b('0x4'));var db=require(_0x226b('0x5'))['db'];var utils=require(_0x226b('0x6'));var logger=require(_0x226b('0x7'))(_0x226b('0x8'));var config=require(_0x226b('0x9'));var jayson=require(_0x226b('0xa'));var client=jayson[_0x226b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7997dc,_0x4eb496,_0x15b465){return new BPromise(function(_0x28d0f8,_0x2cd2db){return client['request'](_0x7997dc,_0x15b465)['then'](function(_0x1fea7e){logger[_0x226b('0xc')](_0x226b('0xd'),_0x4eb496,_0x226b('0xe'));logger[_0x226b('0xf')](_0x226b('0x10'),_0x4eb496,'request\x20sent',JSON[_0x226b('0x11')](_0x1fea7e));if(_0x1fea7e['error']){if(_0x1fea7e[_0x226b('0x12')][_0x226b('0x13')]===0x1f4){logger[_0x226b('0x12')](_0x226b('0xd'),_0x4eb496,_0x1fea7e[_0x226b('0x12')][_0x226b('0x14')]);return _0x2cd2db(_0x1fea7e['error'][_0x226b('0x14')]);}logger[_0x226b('0x12')](_0x226b('0xd'),_0x4eb496,_0x1fea7e[_0x226b('0x12')]['message']);return _0x28d0f8(_0x1fea7e[_0x226b('0x12')][_0x226b('0x14')]);}else{logger[_0x226b('0xc')](_0x226b('0xd'),_0x4eb496,_0x226b('0xe'));_0x28d0f8(_0x1fea7e[_0x226b('0x15')]['message']);}})[_0x226b('0x16')](function(_0xadda16){logger[_0x226b('0x12')](_0x226b('0xd'),_0x4eb496,_0xadda16);_0x2cd2db(_0xadda16);});});}exports[_0x226b('0x17')]=function(_0x407c9c){var _0x2034bf=this;return new Promise(function(_0x5e49a6,_0x15cb89){return db[_0x226b('0x18')][_0x226b('0x19')](_0x407c9c['body'],{'raw':_0x407c9c[_0x226b('0x1a')]?_0x407c9c['options'][_0x226b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xd97c4b){logger[_0x226b('0xc')]('CreateOpenchannelQueueReport',_0x407c9c);logger[_0x226b('0xf')](_0x226b('0x17'),_0x407c9c,JSON[_0x226b('0x11')](_0xd97c4b));_0x5e49a6(_0xd97c4b);})[_0x226b('0x16')](function(_0x1cdba9){logger[_0x226b('0x12')](_0x226b('0x17'),_0x1cdba9[_0x226b('0x14')],_0x407c9c);_0x15cb89(_0x2034bf[_0x226b('0x12')](0x1f4,_0x1cdba9[_0x226b('0x14')]));});});};exports[_0x226b('0x1c')]=function(_0x43193d){var _0xfd3ae=this;return new Promise(function(_0x2a5c79,_0x286a38){return db['OpenchannelQueueReport'][_0x226b('0x1d')](_0x43193d[_0x226b('0x1e')],{'raw':_0x43193d['options']?_0x43193d[_0x226b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43193d[_0x226b('0x1a')]?_0x43193d[_0x226b('0x1a')][_0x226b('0x1f')]||null:null,'attributes':_0x43193d[_0x226b('0x1a')]?_0x43193d[_0x226b('0x1a')]['attributes']||null:null,'limit':_0x43193d[_0x226b('0x1a')]?_0x43193d[_0x226b('0x1a')][_0x226b('0x20')]||null:null})[_0x226b('0x21')](function(_0x5859b5){logger[_0x226b('0xc')](_0x226b('0x1c'),_0x43193d);logger[_0x226b('0xf')](_0x226b('0x1c'),_0x43193d,JSON['stringify'](_0x5859b5));_0x2a5c79(_0x5859b5);})[_0x226b('0x16')](function(_0x21f276){logger[_0x226b('0x12')]('UpdateOpenchannelQueueReport',_0x21f276[_0x226b('0x14')],_0x43193d);_0x286a38(_0xfd3ae[_0x226b('0x12')](0x1f4,_0x21f276[_0x226b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index edfb3ce..24ed579 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6548152..1a13a10 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 _0x7f44=['queue','DATE','NOW','sequelize','exports','STRING','ENUM','agent'];(function(_0x3d674a,_0x157900){var _0xf07c93=function(_0x40c730){while(--_0x40c730){_0x3d674a['push'](_0x3d674a['shift']());}};_0xf07c93(++_0x157900);}(_0x7f44,0x1cb));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x47f4('0x0'));module[_0x47f4('0x1')]={'uniqueid':{'type':Sequelize[_0x47f4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x47f4('0x3')]('account',_0x47f4('0x4'),_0x47f4('0x5')),'allowNull':![],'defaultValue':_0x47f4('0x5')},'transferredAt':{'type':Sequelize[_0x47f4('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x47f4('0x7')]}}; \ No newline at end of file +var _0x52de=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x52de,0xe6));var _0xe52d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x52de[_0x4a9fb1];return _0x348672;};'use strict';var moment=require('moment');var Sequelize=require(_0xe52d('0x0'));module[_0xe52d('0x1')]={'uniqueid':{'type':Sequelize[_0xe52d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe52d('0x3')](_0xe52d('0x4'),_0xe52d('0x5'),_0xe52d('0x6')),'allowNull':![],'defaultValue':_0xe52d('0x6')},'transferredAt':{'type':Sequelize[_0xe52d('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 763dbb2..6e9f21b 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 _0xd617=['moment','mustache','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','html-pdf','eml-format','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd617,0x111));var _0x7d61=function(_0x23761c,_0x444d2d){_0x23761c=_0x23761c-0x0;var _0x3be435=_0xd617[_0x23761c];return _0x3be435;};'use strict';var pdf=require(_0x7d61('0x0'));var emlformat=require(_0x7d61('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7d61('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7d61('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7d61('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7d61('0x5'));var fs=require('fs');var _=require(_0x7d61('0x6'));var squel=require('squel');var crypto=require(_0x7d61('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d61('0x8'));var Papa=require(_0x7d61('0x9'));var Redis=require(_0x7d61('0xa'));var authService=require(_0x7d61('0xb'));var qs=require(_0x7d61('0xc'));var as=require(_0x7d61('0xd'));var hardwareService=require(_0x7d61('0xe'));var logger=require(_0x7d61('0xf'))('api');var utils=require(_0x7d61('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dd6d,_0xb94e9){_0xb94e9=_0xb94e9||0xcc;return function(_0x555d8e){if(_0x555d8e){return _0x21dd6d[_0x7d61('0x11')](_0xb94e9);}return _0x21dd6d[_0x7d61('0x12')](_0xb94e9)['end']();};}function respondWithResult(_0x108b3f,_0x26512d){_0x26512d=_0x26512d||0xc8;return function(_0x42b183){if(_0x42b183){return _0x108b3f[_0x7d61('0x12')](_0x26512d)['json'](_0x42b183);}};}function respondWithFilteredResult(_0x49f08e,_0x5b9d1d){return function(_0x389b14){if(_0x389b14){var _0x1fc08e=_0x389b14['count'],_0x54db7a=_0x5b9d1d[_0x7d61('0x13')],_0x3b0310=_0x5b9d1d[_0x7d61('0x13')]+_0x5b9d1d[_0x7d61('0x14')],_0x4ef458;if(_0x3b0310>=_0x1fc08e){_0x3b0310=_0x1fc08e;_0x4ef458=0xc8;}else{_0x4ef458=0xce;}_0x49f08e[_0x7d61('0x12')](_0x4ef458);return _0x49f08e[_0x7d61('0x15')](_0x7d61('0x16'),_0x54db7a+'-'+_0x3b0310+'/'+_0x1fc08e)[_0x7d61('0x17')](_0x389b14);}return null;};}function patchUpdates(_0x4a705a){return function(_0x2ed076){try{jsonpatch[_0x7d61('0x18')](_0x2ed076,_0x4a705a,!![]);}catch(_0x4e007d){return BPromise[_0x7d61('0x19')](_0x4e007d);}return _0x2ed076[_0x7d61('0x1a')]();};}function saveUpdates(_0xfc8def,_0x4aac1f){return function(_0x54ea42){if(_0x54ea42){return _0x54ea42['update'](_0xfc8def)[_0x7d61('0x1b')](function(_0x319092){return _0x319092;});}return null;};}function removeEntity(_0x3924bd,_0x48dde5){return function(_0x33a486){if(_0x33a486){return _0x33a486[_0x7d61('0x1c')]()[_0x7d61('0x1b')](function(){_0x3924bd['status'](0xcc)[_0x7d61('0x1d')]();});}};}function handleEntityNotFound(_0xabe489,_0x4a2bad){return function(_0x2f5a7b){if(!_0x2f5a7b){_0xabe489[_0x7d61('0x11')](0x194);}return _0x2f5a7b;};}function handleError(_0x5196f3,_0x4df8c3){_0x4df8c3=_0x4df8c3||0x1f4;return function(_0x2f8db1){logger['error'](_0x2f8db1['stack']);if(_0x2f8db1[_0x7d61('0x1e')]){delete _0x2f8db1[_0x7d61('0x1e')];}_0x5196f3[_0x7d61('0x12')](_0x4df8c3)[_0x7d61('0x1f')](_0x2f8db1);};}exports[_0x7d61('0x20')]=function(_0x475513,_0x2b44d0){var _0x247bc9={},_0x43e286={},_0x1235ad={'count':0x0,'rows':[]};var _0x3a85be=_[_0x7d61('0x21')](db[_0x7d61('0x22')][_0x7d61('0x23')],function(_0x11c501){return{'name':_0x11c501[_0x7d61('0x24')],'type':_0x11c501[_0x7d61('0x25')][_0x7d61('0x26')]};});_0x43e286['model']=_[_0x7d61('0x21')](_0x3a85be,'name');_0x43e286[_0x7d61('0x27')]=_[_0x7d61('0x28')](_0x475513[_0x7d61('0x27')]);_0x43e286['filters']=_[_0x7d61('0x29')](_0x43e286[_0x7d61('0x2a')],_0x43e286['query']);_0x247bc9['attributes']=_[_0x7d61('0x29')](_0x43e286['model'],qs[_0x7d61('0x2b')](_0x475513['query']['fields']));_0x247bc9['attributes']=_0x247bc9[_0x7d61('0x2c')][_0x7d61('0x2d')]?_0x247bc9[_0x7d61('0x2c')]:_0x43e286[_0x7d61('0x2a')];if(!_0x475513[_0x7d61('0x27')][_0x7d61('0x2e')](_0x7d61('0x2f'))){_0x247bc9['limit']=qs[_0x7d61('0x14')](_0x475513[_0x7d61('0x27')]['limit']);_0x247bc9[_0x7d61('0x13')]=qs['offset'](_0x475513[_0x7d61('0x27')][_0x7d61('0x13')]);}_0x247bc9[_0x7d61('0x30')]=qs[_0x7d61('0x31')](_0x475513['query'][_0x7d61('0x31')]);_0x247bc9[_0x7d61('0x32')]=qs[_0x7d61('0x33')](_[_0x7d61('0x34')](_0x475513['query'],_0x43e286['filters']));if(_0x475513[_0x7d61('0x27')][_0x7d61('0x35')]){_0x247bc9['where']=_['merge'](_0x247bc9[_0x7d61('0x32')],{'$or':_[_0x7d61('0x21')](_0x3a85be,function(_0x3343ef){if(_0x3343ef[_0x7d61('0x25')]!==_0x7d61('0x36')){var _0x195d92={};_0x195d92[_0x3343ef[_0x7d61('0x1e')]]={'$like':'%'+_0x475513['query']['filter']+'%'};return _0x195d92;}})});}_0x247bc9=_[_0x7d61('0x37')]({},_0x247bc9,_0x475513[_0x7d61('0x38')]);var _0x37132f={'where':_0x247bc9['where']};return db[_0x7d61('0x22')][_0x7d61('0x39')](_0x37132f)[_0x7d61('0x1b')](function(_0x2f174f){_0x1235ad[_0x7d61('0x39')]=_0x2f174f;if(_0x475513[_0x7d61('0x27')][_0x7d61('0x3a')]){_0x247bc9[_0x7d61('0x3b')]=[{'all':!![]}];}return db[_0x7d61('0x22')][_0x7d61('0x3c')](_0x247bc9);})[_0x7d61('0x1b')](function(_0x2aa78e){_0x1235ad['rows']=_0x2aa78e;return _0x1235ad;})[_0x7d61('0x1b')](respondWithFilteredResult(_0x2b44d0,_0x247bc9))[_0x7d61('0x3d')](handleError(_0x2b44d0,null));};exports[_0x7d61('0x3e')]=function(_0x53972b,_0x45d505){var _0x426ea2={'raw':!![],'where':{'id':_0x53972b[_0x7d61('0x3f')]['id']}},_0x16270b={};_0x16270b[_0x7d61('0x2a')]=_[_0x7d61('0x28')](db[_0x7d61('0x22')]['rawAttributes']);_0x16270b['query']=_[_0x7d61('0x28')](_0x53972b[_0x7d61('0x27')]);_0x16270b[_0x7d61('0x33')]=_[_0x7d61('0x29')](_0x16270b['model'],_0x16270b[_0x7d61('0x27')]);_0x426ea2[_0x7d61('0x2c')]=_[_0x7d61('0x29')](_0x16270b[_0x7d61('0x2a')],qs[_0x7d61('0x2b')](_0x53972b[_0x7d61('0x27')][_0x7d61('0x2b')]));_0x426ea2['attributes']=_0x426ea2['attributes'][_0x7d61('0x2d')]?_0x426ea2[_0x7d61('0x2c')]:_0x16270b['model'];if(_0x53972b['query'][_0x7d61('0x3a')]){_0x426ea2[_0x7d61('0x3b')]=[{'all':!![]}];}_0x426ea2=_[_0x7d61('0x37')]({},_0x426ea2,_0x53972b[_0x7d61('0x38')]);return db[_0x7d61('0x22')][_0x7d61('0x40')](_0x426ea2)[_0x7d61('0x1b')](handleEntityNotFound(_0x45d505,null))[_0x7d61('0x1b')](respondWithResult(_0x45d505,null))[_0x7d61('0x3d')](handleError(_0x45d505,null));};exports[_0x7d61('0x41')]=function(_0x16de69,_0x4fa5be){return db[_0x7d61('0x22')][_0x7d61('0x41')](_0x16de69['body'],{})[_0x7d61('0x1b')](respondWithResult(_0x4fa5be,0xc9))[_0x7d61('0x3d')](handleError(_0x4fa5be,null));};exports[_0x7d61('0x42')]=function(_0x590354,_0x19f254){if(_0x590354[_0x7d61('0x43')]['id']){delete _0x590354[_0x7d61('0x43')]['id'];}return db[_0x7d61('0x22')]['find']({'where':{'id':_0x590354[_0x7d61('0x3f')]['id']}})[_0x7d61('0x1b')](handleEntityNotFound(_0x19f254,null))[_0x7d61('0x1b')](saveUpdates(_0x590354[_0x7d61('0x43')],null))['then'](respondWithResult(_0x19f254,null))[_0x7d61('0x3d')](handleError(_0x19f254,null));};exports[_0x7d61('0x1c')]=function(_0x527ada,_0x44e2e8){return db[_0x7d61('0x22')][_0x7d61('0x40')]({'where':{'id':_0x527ada[_0x7d61('0x3f')]['id']}})[_0x7d61('0x1b')](handleEntityNotFound(_0x44e2e8,null))['then'](removeEntity(_0x44e2e8,null))['catch'](handleError(_0x44e2e8,null));};exports[_0x7d61('0x44')]=function(_0x3bebdf,_0x443592){return db[_0x7d61('0x22')][_0x7d61('0x44')]()['then'](respondWithResult(_0x443592,null))['catch'](handleError(_0x443592,null));}; \ No newline at end of file +var _0xd148=['find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','name','send','map','rawAttributes','query','keys','filters','attributes','model','fields','length','hasOwnProperty','offset','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','OpenchannelTransferReport','findAll','show','intersection','catch','create','body','params','destroy'];(function(_0x344822,_0x1ee7e1){var _0x299a7c=function(_0x471de8){while(--_0x471de8){_0x344822['push'](_0x344822['shift']());}};_0x299a7c(++_0x1ee7e1);}(_0xd148,0x1e5));var _0x8d14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd148[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x8d14('0x0'));var emlformat=require(_0x8d14('0x1'));var rimraf=require(_0x8d14('0x2'));var zipdir=require(_0x8d14('0x3'));var jsonpatch=require(_0x8d14('0x4'));var rp=require(_0x8d14('0x5'));var moment=require(_0x8d14('0x6'));var BPromise=require(_0x8d14('0x7'));var Mustache=require(_0x8d14('0x8'));var util=require(_0x8d14('0x9'));var path=require(_0x8d14('0xa'));var sox=require(_0x8d14('0xb'));var csv=require(_0x8d14('0xc'));var ejs=require(_0x8d14('0xd'));var fs=require('fs');var _=require(_0x8d14('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8d14('0xf'));var deskjs=require(_0x8d14('0x10'));var toCsv=require(_0x8d14('0xc'));var querystring=require(_0x8d14('0x11'));var Papa=require(_0x8d14('0x12'));var Redis=require('ioredis');var authService=require(_0x8d14('0x13'));var qs=require(_0x8d14('0x14'));var as=require(_0x8d14('0x15'));var hardwareService=require(_0x8d14('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8d14('0x17'))['db'];function respondWithStatusCode(_0x43f719,_0x2a6bee){_0x2a6bee=_0x2a6bee||0xcc;return function(_0x30e8a4){if(_0x30e8a4){return _0x43f719[_0x8d14('0x18')](_0x2a6bee);}return _0x43f719[_0x8d14('0x19')](_0x2a6bee)[_0x8d14('0x1a')]();};}function respondWithResult(_0x2bc08e,_0x760ea2){_0x760ea2=_0x760ea2||0xc8;return function(_0x2c8d46){if(_0x2c8d46){return _0x2bc08e['status'](_0x760ea2)['json'](_0x2c8d46);}};}function respondWithFilteredResult(_0x1574b1,_0x54fbd4){return function(_0x2a917a){if(_0x2a917a){var _0x5f3124=_0x2a917a[_0x8d14('0x1b')],_0x28cb55=_0x54fbd4['offset'],_0x878eac=_0x54fbd4['offset']+_0x54fbd4[_0x8d14('0x1c')],_0x3f9b41;if(_0x878eac>=_0x5f3124){_0x878eac=_0x5f3124;_0x3f9b41=0xc8;}else{_0x3f9b41=0xce;}_0x1574b1[_0x8d14('0x19')](_0x3f9b41);return _0x1574b1[_0x8d14('0x1d')](_0x8d14('0x1e'),_0x28cb55+'-'+_0x878eac+'/'+_0x5f3124)['json'](_0x2a917a);}return null;};}function patchUpdates(_0x493202){return function(_0x2e84a1){try{jsonpatch[_0x8d14('0x1f')](_0x2e84a1,_0x493202,!![]);}catch(_0x1dbf0c){return BPromise[_0x8d14('0x20')](_0x1dbf0c);}return _0x2e84a1[_0x8d14('0x21')]();};}function saveUpdates(_0x46375f,_0x3f23b0){return function(_0x4a9fbc){if(_0x4a9fbc){return _0x4a9fbc[_0x8d14('0x22')](_0x46375f)[_0x8d14('0x23')](function(_0x1bc723){return _0x1bc723;});}return null;};}function removeEntity(_0x3720ad,_0xa4739a){return function(_0x52b1b9){if(_0x52b1b9){return _0x52b1b9['destroy']()['then'](function(){_0x3720ad[_0x8d14('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7e318,_0x308eb3){return function(_0x53096f){if(!_0x53096f){_0xa7e318['sendStatus'](0x194);}return _0x53096f;};}function handleError(_0x48a055,_0x38c914){_0x38c914=_0x38c914||0x1f4;return function(_0x625492){logger['error'](_0x625492['stack']);if(_0x625492[_0x8d14('0x24')]){delete _0x625492[_0x8d14('0x24')];}_0x48a055[_0x8d14('0x19')](_0x38c914)[_0x8d14('0x25')](_0x625492);};}exports['index']=function(_0x5d6ab0,_0x381d31){var _0x3fe075={},_0x2d55c4={},_0xb22cf8={'count':0x0,'rows':[]};var _0x535a51=_[_0x8d14('0x26')](db['OpenchannelTransferReport'][_0x8d14('0x27')],function(_0x2fe024){return{'name':_0x2fe024['fieldName'],'type':_0x2fe024['type']['key']};});_0x2d55c4['model']=_[_0x8d14('0x26')](_0x535a51,_0x8d14('0x24'));_0x2d55c4[_0x8d14('0x28')]=_[_0x8d14('0x29')](_0x5d6ab0[_0x8d14('0x28')]);_0x2d55c4[_0x8d14('0x2a')]=_['intersection'](_0x2d55c4['model'],_0x2d55c4['query']);_0x3fe075[_0x8d14('0x2b')]=_['intersection'](_0x2d55c4[_0x8d14('0x2c')],qs[_0x8d14('0x2d')](_0x5d6ab0[_0x8d14('0x28')]['fields']));_0x3fe075[_0x8d14('0x2b')]=_0x3fe075[_0x8d14('0x2b')][_0x8d14('0x2e')]?_0x3fe075[_0x8d14('0x2b')]:_0x2d55c4[_0x8d14('0x2c')];if(!_0x5d6ab0['query'][_0x8d14('0x2f')]('nolimit')){_0x3fe075[_0x8d14('0x1c')]=qs[_0x8d14('0x1c')](_0x5d6ab0['query']['limit']);_0x3fe075[_0x8d14('0x30')]=qs[_0x8d14('0x30')](_0x5d6ab0['query'][_0x8d14('0x30')]);}_0x3fe075['order']=qs['sort'](_0x5d6ab0[_0x8d14('0x28')][_0x8d14('0x31')]);_0x3fe075[_0x8d14('0x32')]=qs['filters'](_[_0x8d14('0x33')](_0x5d6ab0[_0x8d14('0x28')],_0x2d55c4[_0x8d14('0x2a')]));if(_0x5d6ab0['query'][_0x8d14('0x34')]){_0x3fe075[_0x8d14('0x32')]=_[_0x8d14('0x35')](_0x3fe075[_0x8d14('0x32')],{'$or':_[_0x8d14('0x26')](_0x535a51,function(_0x258bdc){if(_0x258bdc[_0x8d14('0x36')]!==_0x8d14('0x37')){var _0x17f90e={};_0x17f90e[_0x258bdc['name']]={'$like':'%'+_0x5d6ab0['query'][_0x8d14('0x34')]+'%'};return _0x17f90e;}})});}_0x3fe075=_[_0x8d14('0x35')]({},_0x3fe075,_0x5d6ab0['options']);var _0x26de6b={'where':_0x3fe075[_0x8d14('0x32')]};return db['OpenchannelTransferReport'][_0x8d14('0x1b')](_0x26de6b)[_0x8d14('0x23')](function(_0x55e6a7){_0xb22cf8['count']=_0x55e6a7;if(_0x5d6ab0['query'][_0x8d14('0x38')]){_0x3fe075[_0x8d14('0x39')]=[{'all':!![]}];}return db[_0x8d14('0x3a')][_0x8d14('0x3b')](_0x3fe075);})[_0x8d14('0x23')](function(_0x3bcedd){_0xb22cf8['rows']=_0x3bcedd;return _0xb22cf8;})['then'](respondWithFilteredResult(_0x381d31,_0x3fe075))['catch'](handleError(_0x381d31,null));};exports[_0x8d14('0x3c')]=function(_0x3c98f3,_0x12ee86){var _0x1fadbb={'raw':!![],'where':{'id':_0x3c98f3['params']['id']}},_0x319629={};_0x319629[_0x8d14('0x2c')]=_[_0x8d14('0x29')](db['OpenchannelTransferReport'][_0x8d14('0x27')]);_0x319629[_0x8d14('0x28')]=_[_0x8d14('0x29')](_0x3c98f3[_0x8d14('0x28')]);_0x319629[_0x8d14('0x2a')]=_[_0x8d14('0x3d')](_0x319629[_0x8d14('0x2c')],_0x319629[_0x8d14('0x28')]);_0x1fadbb[_0x8d14('0x2b')]=_[_0x8d14('0x3d')](_0x319629['model'],qs['fields'](_0x3c98f3[_0x8d14('0x28')][_0x8d14('0x2d')]));_0x1fadbb['attributes']=_0x1fadbb[_0x8d14('0x2b')][_0x8d14('0x2e')]?_0x1fadbb[_0x8d14('0x2b')]:_0x319629[_0x8d14('0x2c')];if(_0x3c98f3['query']['includeAll']){_0x1fadbb[_0x8d14('0x39')]=[{'all':!![]}];}_0x1fadbb=_[_0x8d14('0x35')]({},_0x1fadbb,_0x3c98f3['options']);return db[_0x8d14('0x3a')]['find'](_0x1fadbb)[_0x8d14('0x23')](handleEntityNotFound(_0x12ee86,null))[_0x8d14('0x23')](respondWithResult(_0x12ee86,null))[_0x8d14('0x3e')](handleError(_0x12ee86,null));};exports[_0x8d14('0x3f')]=function(_0x4f82c5,_0x48f628){return db[_0x8d14('0x3a')][_0x8d14('0x3f')](_0x4f82c5[_0x8d14('0x40')],{})[_0x8d14('0x23')](respondWithResult(_0x48f628,0xc9))[_0x8d14('0x3e')](handleError(_0x48f628,null));};exports[_0x8d14('0x22')]=function(_0x2d0acb,_0x240774){if(_0x2d0acb['body']['id']){delete _0x2d0acb[_0x8d14('0x40')]['id'];}return db[_0x8d14('0x3a')]['find']({'where':{'id':_0x2d0acb[_0x8d14('0x41')]['id']}})[_0x8d14('0x23')](handleEntityNotFound(_0x240774,null))['then'](saveUpdates(_0x2d0acb[_0x8d14('0x40')],null))['then'](respondWithResult(_0x240774,null))[_0x8d14('0x3e')](handleError(_0x240774,null));};exports[_0x8d14('0x42')]=function(_0xc23902,_0x10977c){return db[_0x8d14('0x3a')][_0x8d14('0x43')]({'where':{'id':_0xc23902['params']['id']}})[_0x8d14('0x23')](handleEntityNotFound(_0x10977c,null))[_0x8d14('0x23')](removeEntity(_0x10977c,null))[_0x8d14('0x3e')](handleError(_0x10977c,null));};exports[_0x8d14('0x44')]=function(_0x134be7,_0x1a13c2){return db[_0x8d14('0x3a')][_0x8d14('0x44')]()[_0x8d14('0x23')](respondWithResult(_0x1a13c2,null))[_0x8d14('0x3e')](handleError(_0x1a13c2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d8a3ebb..bbba8ed 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 _0x458e=['../../config/logger','api','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x458e,0xfa));var _0xe458=function(_0x187ff8,_0x393b9b){_0x187ff8=_0x187ff8-0x0;var _0x543117=_0x458e[_0x187ff8];return _0x543117;};'use strict';var _=require(_0xe458('0x0'));var util=require(_0xe458('0x1'));var logger=require(_0xe458('0x2'))(_0xe458('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe458('0x4'));var rimraf=require(_0xe458('0x5'));var config=require(_0xe458('0x6'));var attributes=require(_0xe458('0x7'));module[_0xe458('0x8')]=function(_0x5d7812,_0x67ac66){return _0x5d7812[_0xe458('0x9')](_0xe458('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xe458('0xb'),'fields':[_0xe458('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd919=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','OpenchannelTransferReport'];(function(_0x3530d0,_0x4dfb47){var _0x2165c6=function(_0x2ab151){while(--_0x2ab151){_0x3530d0['push'](_0x3530d0['shift']());}};_0x2165c6(++_0x4dfb47);}(_0xd919,0x13b));var _0x9d91=function(_0x38d64a,_0x38edcb){_0x38d64a=_0x38d64a-0x0;var _0x5e6089=_0xd919[_0x38d64a];return _0x5e6089;};'use strict';var _=require(_0x9d91('0x0'));var util=require(_0x9d91('0x1'));var logger=require(_0x9d91('0x2'))('api');var moment=require(_0x9d91('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d91('0x4'));var fs=require('fs');var path=require(_0x9d91('0x5'));var rimraf=require(_0x9d91('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x9d91('0x7')]=function(_0x1bcaa6,_0x16235f){return _0x1bcaa6['define'](_0x9d91('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 17ba7cf..b658ca4 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 _0x343f=['message','result','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x343f,0xb6));var _0xf343=function(_0x15ee4d,_0x30a5c5){_0x15ee4d=_0x15ee4d-0x0;var _0x291eba=_0x343f[_0x15ee4d];return _0x291eba;};'use strict';var _=require(_0xf343('0x0'));var util=require('util');var moment=require(_0xf343('0x1'));var BPromise=require('bluebird');var rs=require(_0xf343('0x2'));var fs=require('fs');var Redis=require(_0xf343('0x3'));var db=require(_0xf343('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf343('0x5'));var config=require(_0xf343('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf343('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36d20b,_0x3c09ba,_0x3e83de){return new BPromise(function(_0x3d6e22,_0x14cde5){return client['request'](_0x36d20b,_0x3e83de)[_0xf343('0x8')](function(_0x3ab2d1){logger[_0xf343('0x9')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3c09ba,_0xf343('0xa'));logger['debug'](_0xf343('0xb'),_0x3c09ba,_0xf343('0xa'),JSON[_0xf343('0xc')](_0x3ab2d1));if(_0x3ab2d1[_0xf343('0xd')]){if(_0x3ab2d1[_0xf343('0xd')][_0xf343('0xe')]===0x1f4){logger[_0xf343('0xd')](_0xf343('0xf'),_0x3c09ba,_0x3ab2d1['error'][_0xf343('0x10')]);return _0x14cde5(_0x3ab2d1[_0xf343('0xd')][_0xf343('0x10')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3c09ba,_0x3ab2d1['error']['message']);return _0x3d6e22(_0x3ab2d1[_0xf343('0xd')][_0xf343('0x10')]);}else{logger[_0xf343('0x9')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3c09ba,'request\x20sent');_0x3d6e22(_0x3ab2d1[_0xf343('0x11')][_0xf343('0x10')]);}})['catch'](function(_0xa26b83){logger[_0xf343('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3c09ba,_0xa26b83);_0x14cde5(_0xa26b83);});});} \ No newline at end of file +var _0xf773=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xf773,0x154));var _0x3f77=function(_0x122b11,_0xe77191){_0x122b11=_0x122b11-0x0;var _0x42dbb4=_0xf773[_0x122b11];return _0x42dbb4;};'use strict';var _=require(_0x3f77('0x0'));var util=require(_0x3f77('0x1'));var moment=require(_0x3f77('0x2'));var BPromise=require(_0x3f77('0x3'));var rs=require(_0x3f77('0x4'));var fs=require('fs');var Redis=require(_0x3f77('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f77('0x6'))('rpc');var config=require(_0x3f77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3f77('0x8')][_0x3f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c4049,_0x4ecbd0,_0x3cbc43){return new BPromise(function(_0x2a855a,_0x2f215d){return client[_0x3f77('0xa')](_0x4c4049,_0x3cbc43)['then'](function(_0x5c7cee){logger[_0x3f77('0xb')](_0x3f77('0xc'),_0x4ecbd0,_0x3f77('0xd'));logger[_0x3f77('0xe')](_0x3f77('0xf'),_0x4ecbd0,'request\x20sent',JSON[_0x3f77('0x10')](_0x5c7cee));if(_0x5c7cee[_0x3f77('0x11')]){if(_0x5c7cee[_0x3f77('0x11')]['code']===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4ecbd0,_0x5c7cee['error']['message']);return _0x2f215d(_0x5c7cee[_0x3f77('0x11')][_0x3f77('0x12')]);}logger[_0x3f77('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4ecbd0,_0x5c7cee[_0x3f77('0x11')][_0x3f77('0x12')]);return _0x2a855a(_0x5c7cee[_0x3f77('0x11')][_0x3f77('0x12')]);}else{logger[_0x3f77('0xb')](_0x3f77('0xc'),_0x4ecbd0,'request\x20sent');_0x2a855a(_0x5c7cee[_0x3f77('0x13')][_0x3f77('0x12')]);}})['catch'](function(_0x24adba){logger[_0x3f77('0x11')](_0x3f77('0xc'),_0x4ecbd0,_0x24adba);_0x2f215d(_0x24adba);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index d2a71cb..db1a653 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 _0xc921=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','put','update','destroy','util','path','connect-timeout','express'];(function(_0xba863a,_0x23110a){var _0x399553=function(_0x171f0b){while(--_0x171f0b){_0xba863a['push'](_0xba863a['shift']());}};_0x399553(++_0x23110a);}(_0xc921,0x10c));var _0x1c92=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0xc921[_0x5bf2b3];return _0x5e8a9b;};'use strict';var multer=require('multer');var util=require(_0x1c92('0x0'));var path=require(_0x1c92('0x1'));var timeout=require(_0x1c92('0x2'));var express=require(_0x1c92('0x3'));var router=express[_0x1c92('0x4')]();var auth=require(_0x1c92('0x5'));var interaction=require(_0x1c92('0x6'));var config=require(_0x1c92('0x7'));var controller=require(_0x1c92('0x8'));router[_0x1c92('0x9')]('/',auth[_0x1c92('0xa')](),controller[_0x1c92('0xb')]);router['get'](_0x1c92('0xc'),auth[_0x1c92('0xa')](),controller['show']);router['post']('/',auth[_0x1c92('0xa')](),controller['create']);router[_0x1c92('0xd')](_0x1c92('0xc'),auth[_0x1c92('0xa')](),controller[_0x1c92('0xe')]);router['delete'](_0x1c92('0xc'),auth[_0x1c92('0xa')](),controller[_0x1c92('0xf')]);module['exports']=router; \ No newline at end of file +var _0xeef7=['create','put','update','delete','exports','multer','util','connect-timeout','express','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show'];(function(_0x44d3ff,_0x3afa5d){var _0x2e177b=function(_0x4ed2bd){while(--_0x4ed2bd){_0x44d3ff['push'](_0x44d3ff['shift']());}};_0x2e177b(++_0x3afa5d);}(_0xeef7,0x7d));var _0x7eef=function(_0x270f82,_0x5cf8a8){_0x270f82=_0x270f82-0x0;var _0x18f333=_0xeef7[_0x270f82];return _0x18f333;};'use strict';var multer=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var path=require('path');var timeout=require(_0x7eef('0x2'));var express=require(_0x7eef('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7eef('0x4'));var controller=require(_0x7eef('0x5'));router[_0x7eef('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7eef('0x7'),auth[_0x7eef('0x8')](),controller[_0x7eef('0x9')]);router['post']('/',auth[_0x7eef('0x8')](),controller[_0x7eef('0xa')]);router[_0x7eef('0xb')](_0x7eef('0x7'),auth[_0x7eef('0x8')](),controller[_0x7eef('0xc')]);router[_0x7eef('0xd')](_0x7eef('0x7'),auth[_0x7eef('0x8')](),controller['destroy']);module[_0x7eef('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 3ae6497..c4d81af 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 _0x082d=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x082d,0x174));var _0xd082=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x082d[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require('sequelize');module[_0xd082('0x0')]={'name':{'type':Sequelize[_0xd082('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda9c=['exports','STRING','sequelize'];(function(_0x1a3064,_0x157b8d){var _0x3eb01b=function(_0x2e94d7){while(--_0x2e94d7){_0x1a3064['push'](_0x1a3064['shift']());}};_0x3eb01b(++_0x157b8d);}(_0xda9c,0x113));var _0xcda9=function(_0x461dba,_0x2568ad){_0x461dba=_0x461dba-0x0;var _0x361c5f=_0xda9c[_0x461dba];return _0x361c5f;};'use strict';var Sequelize=require(_0xcda9('0x0'));module[_0xcda9('0x1')]={'name':{'type':Sequelize[_0xcda9('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcda9('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9683c81..73725a3 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 _0xa02a=['set','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','map','Pause','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','intersection','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','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','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','limit'];(function(_0x2af6e5,_0x347a5d){var _0x5da923=function(_0x3ec73b){while(--_0x3ec73b){_0x2af6e5['push'](_0x2af6e5['shift']());}};_0x5da923(++_0x347a5d);}(_0xa02a,0x18c));var _0xaa02=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0xa02a[_0x4bf96c];return _0x281d09;};'use strict';var pdf=require(_0xaa02('0x0'));var emlformat=require(_0xaa02('0x1'));var rimraf=require(_0xaa02('0x2'));var zipdir=require(_0xaa02('0x3'));var jsonpatch=require(_0xaa02('0x4'));var rp=require(_0xaa02('0x5'));var moment=require(_0xaa02('0x6'));var BPromise=require(_0xaa02('0x7'));var Mustache=require('mustache');var util=require(_0xaa02('0x8'));var path=require(_0xaa02('0x9'));var sox=require(_0xaa02('0xa'));var csv=require(_0xaa02('0xb'));var ejs=require(_0xaa02('0xc'));var fs=require('fs');var _=require(_0xaa02('0xd'));var squel=require(_0xaa02('0xe'));var crypto=require(_0xaa02('0xf'));var jsforce=require(_0xaa02('0x10'));var deskjs=require(_0xaa02('0x11'));var toCsv=require('to-csv');var querystring=require(_0xaa02('0x12'));var Papa=require('papaparse');var Redis=require(_0xaa02('0x13'));var authService=require(_0xaa02('0x14'));var qs=require(_0xaa02('0x15'));var as=require(_0xaa02('0x16'));var hardwareService=require(_0xaa02('0x17'));var logger=require(_0xaa02('0x18'))(_0xaa02('0x19'));var utils=require(_0xaa02('0x1a'));var config=require(_0xaa02('0x1b'));var db=require(_0xaa02('0x1c'))['db'];function respondWithStatusCode(_0x52d6f1,_0x422d86){_0x422d86=_0x422d86||0xcc;return function(_0x3baabd){if(_0x3baabd){return _0x52d6f1['sendStatus'](_0x422d86);}return _0x52d6f1['status'](_0x422d86)[_0xaa02('0x1d')]();};}function respondWithResult(_0x3254da,_0x105caa){_0x105caa=_0x105caa||0xc8;return function(_0x29e0ba){if(_0x29e0ba){return _0x3254da[_0xaa02('0x1e')](_0x105caa)[_0xaa02('0x1f')](_0x29e0ba);}};}function respondWithFilteredResult(_0x5e96ab,_0x140a53){return function(_0x5b64df){if(_0x5b64df){var _0x4747ed=_0x5b64df[_0xaa02('0x20')],_0x2a6810=_0x140a53['offset'],_0x574db3=_0x140a53['offset']+_0x140a53[_0xaa02('0x21')],_0x21ee35;if(_0x574db3>=_0x4747ed){_0x574db3=_0x4747ed;_0x21ee35=0xc8;}else{_0x21ee35=0xce;}_0x5e96ab[_0xaa02('0x1e')](_0x21ee35);return _0x5e96ab[_0xaa02('0x22')]('Content-Range',_0x2a6810+'-'+_0x574db3+'/'+_0x4747ed)[_0xaa02('0x1f')](_0x5b64df);}return null;};}function patchUpdates(_0x5c74b4){return function(_0x598dbf){try{jsonpatch[_0xaa02('0x23')](_0x598dbf,_0x5c74b4,!![]);}catch(_0xafec47){return BPromise[_0xaa02('0x24')](_0xafec47);}return _0x598dbf[_0xaa02('0x25')]();};}function saveUpdates(_0x157050,_0x5a0c2d){return function(_0x8637da){if(_0x8637da){return _0x8637da[_0xaa02('0x26')](_0x157050)[_0xaa02('0x27')](function(_0x2dbd8b){return _0x2dbd8b;});}return null;};}function removeEntity(_0xe4ebc8,_0x2f4677){return function(_0x266268){if(_0x266268){return _0x266268[_0xaa02('0x28')]()[_0xaa02('0x27')](function(){var _0x3ffc78=_0x266268[_0xaa02('0x29')]({'plain':!![]});var _0x4605fa=_0xaa02('0x2a');return db[_0xaa02('0x2b')][_0xaa02('0x28')]({'where':{'type':_0x4605fa,'resourceId':_0x3ffc78['id']}})[_0xaa02('0x27')](function(){return _0x266268;});})['then'](function(){_0xe4ebc8[_0xaa02('0x1e')](0xcc)[_0xaa02('0x1d')]();});}};}function handleEntityNotFound(_0x2a9c85,_0x35a48e){return function(_0x31ce1f){if(!_0x31ce1f){_0x2a9c85['sendStatus'](0x194);}return _0x31ce1f;};}function handleError(_0x3b315b,_0x1297b8){_0x1297b8=_0x1297b8||0x1f4;return function(_0x1a3ced){logger[_0xaa02('0x2c')](_0x1a3ced[_0xaa02('0x2d')]);if(_0x1a3ced[_0xaa02('0x2e')]){delete _0x1a3ced[_0xaa02('0x2e')];}_0x3b315b[_0xaa02('0x1e')](_0x1297b8)[_0xaa02('0x2f')](_0x1a3ced);};}exports['index']=function(_0xd621ee,_0x4b38ec){var _0x516e12={},_0x52a2c7={},_0x318dd1={'count':0x0,'rows':[]};var _0x3c29a8=_[_0xaa02('0x30')](db[_0xaa02('0x31')]['rawAttributes'],function(_0x589cd9){return{'name':_0x589cd9[_0xaa02('0x32')],'type':_0x589cd9[_0xaa02('0x33')][_0xaa02('0x34')]};});_0x52a2c7[_0xaa02('0x35')]=_[_0xaa02('0x30')](_0x3c29a8,'name');_0x52a2c7[_0xaa02('0x36')]=_[_0xaa02('0x37')](_0xd621ee[_0xaa02('0x36')]);_0x52a2c7[_0xaa02('0x38')]=_['intersection'](_0x52a2c7['model'],_0x52a2c7[_0xaa02('0x36')]);_0x516e12[_0xaa02('0x39')]=_['intersection'](_0x52a2c7[_0xaa02('0x35')],qs[_0xaa02('0x3a')](_0xd621ee[_0xaa02('0x36')][_0xaa02('0x3a')]));_0x516e12['attributes']=_0x516e12[_0xaa02('0x39')][_0xaa02('0x3b')]?_0x516e12[_0xaa02('0x39')]:_0x52a2c7['model'];if(!_0xd621ee[_0xaa02('0x36')][_0xaa02('0x3c')](_0xaa02('0x3d'))){_0x516e12[_0xaa02('0x21')]=qs['limit'](_0xd621ee['query']['limit']);_0x516e12[_0xaa02('0x3e')]=qs[_0xaa02('0x3e')](_0xd621ee['query'][_0xaa02('0x3e')]);}_0x516e12[_0xaa02('0x3f')]=qs[_0xaa02('0x40')](_0xd621ee[_0xaa02('0x36')][_0xaa02('0x40')]);_0x516e12[_0xaa02('0x41')]=qs[_0xaa02('0x38')](_['pick'](_0xd621ee[_0xaa02('0x36')],_0x52a2c7['filters']));if(_0xd621ee[_0xaa02('0x36')][_0xaa02('0x42')]){_0x516e12[_0xaa02('0x41')]=_['merge'](_0x516e12[_0xaa02('0x41')],{'$or':_[_0xaa02('0x30')](_0x3c29a8,function(_0x47cfb2){if(_0x47cfb2[_0xaa02('0x33')]!=='VIRTUAL'){var _0x16c776={};_0x16c776[_0x47cfb2[_0xaa02('0x2e')]]={'$like':'%'+_0xd621ee[_0xaa02('0x36')]['filter']+'%'};return _0x16c776;}})});}_0x516e12=_[_0xaa02('0x43')]({},_0x516e12,_0xd621ee[_0xaa02('0x44')]);var _0x1997c2={'where':_0x516e12[_0xaa02('0x41')]};return db[_0xaa02('0x31')][_0xaa02('0x20')](_0x1997c2)[_0xaa02('0x27')](function(_0x377691){_0x318dd1['count']=_0x377691;if(_0xd621ee[_0xaa02('0x36')][_0xaa02('0x45')]){_0x516e12[_0xaa02('0x46')]=[{'all':!![]}];}return db[_0xaa02('0x31')][_0xaa02('0x47')](_0x516e12);})[_0xaa02('0x27')](function(_0x3d0e18){_0x318dd1['rows']=_0x3d0e18;return _0x318dd1;})[_0xaa02('0x27')](respondWithFilteredResult(_0x4b38ec,_0x516e12))[_0xaa02('0x48')](handleError(_0x4b38ec,null));};exports['show']=function(_0x40fc84,_0x1f614f){var _0x20bf9c={'raw':!![],'where':{'id':_0x40fc84[_0xaa02('0x49')]['id']}},_0x5199c0={};_0x5199c0[_0xaa02('0x35')]=_[_0xaa02('0x37')](db[_0xaa02('0x31')][_0xaa02('0x4a')]);_0x5199c0[_0xaa02('0x36')]=_[_0xaa02('0x37')](_0x40fc84[_0xaa02('0x36')]);_0x5199c0['filters']=_['intersection'](_0x5199c0[_0xaa02('0x35')],_0x5199c0[_0xaa02('0x36')]);_0x20bf9c[_0xaa02('0x39')]=_[_0xaa02('0x4b')](_0x5199c0[_0xaa02('0x35')],qs[_0xaa02('0x3a')](_0x40fc84[_0xaa02('0x36')][_0xaa02('0x3a')]));_0x20bf9c[_0xaa02('0x39')]=_0x20bf9c['attributes'][_0xaa02('0x3b')]?_0x20bf9c[_0xaa02('0x39')]:_0x5199c0['model'];if(_0x40fc84[_0xaa02('0x36')]['includeAll']){_0x20bf9c['include']=[{'all':!![]}];}_0x20bf9c=_[_0xaa02('0x43')]({},_0x20bf9c,_0x40fc84[_0xaa02('0x44')]);return db[_0xaa02('0x31')][_0xaa02('0x4c')](_0x20bf9c)['then'](handleEntityNotFound(_0x1f614f,null))['then'](respondWithResult(_0x1f614f,null))[_0xaa02('0x48')](handleError(_0x1f614f,null));};exports['create']=function(_0x45ca02,_0x1dde06){return db[_0xaa02('0x31')][_0xaa02('0x4d')](_0x45ca02['body'],{})[_0xaa02('0x27')](function(_0x4d7314){var _0x12f452=_0x45ca02[_0xaa02('0x4e')][_0xaa02('0x29')]({'plain':!![]});if(!_0x12f452)throw new Error(_0xaa02('0x4f'));if(_0x12f452[_0xaa02('0x50')]==='user'){var _0x3268d2=_0x4d7314['get']({'plain':!![]});var _0x38d587=_0xaa02('0x2a');return db[_0xaa02('0x51')][_0xaa02('0x4c')]({'where':{'name':_0x38d587,'userProfileId':_0x12f452[_0xaa02('0x52')]},'raw':!![]})[_0xaa02('0x27')](function(_0x1fb5c3){if(_0x1fb5c3&&_0x1fb5c3[_0xaa02('0x53')]===0x0){return db[_0xaa02('0x2b')][_0xaa02('0x4d')]({'name':_0x3268d2[_0xaa02('0x2e')],'resourceId':_0x3268d2['id'],'type':_0x1fb5c3[_0xaa02('0x2e')],'sectionId':_0x1fb5c3['id']},{})[_0xaa02('0x27')](function(){return _0x4d7314;});}else{return _0x4d7314;}})[_0xaa02('0x48')](function(_0xe342fa){logger[_0xaa02('0x2c')](_0xaa02('0x54'),_0xe342fa);throw _0xe342fa;});}return _0x4d7314;})[_0xaa02('0x27')](respondWithResult(_0x1dde06,0xc9))['catch'](handleError(_0x1dde06,null));};exports[_0xaa02('0x26')]=function(_0x4ba8ae,_0x1bbd41){if(_0x4ba8ae[_0xaa02('0x55')]['id']){delete _0x4ba8ae['body']['id'];}return db[_0xaa02('0x31')]['find']({'where':{'id':_0x4ba8ae[_0xaa02('0x49')]['id']}})[_0xaa02('0x27')](handleEntityNotFound(_0x1bbd41,null))[_0xaa02('0x27')](saveUpdates(_0x4ba8ae['body'],null))[_0xaa02('0x27')](respondWithResult(_0x1bbd41,null))[_0xaa02('0x48')](handleError(_0x1bbd41,null));};exports[_0xaa02('0x28')]=function(_0x159512,_0x418b46){return db[_0xaa02('0x31')]['find']({'where':{'id':_0x159512[_0xaa02('0x49')]['id']}})['then'](handleEntityNotFound(_0x418b46,null))['then'](removeEntity(_0x418b46,null))[_0xaa02('0x48')](handleError(_0x418b46,null));}; \ No newline at end of file +var _0x2a2c=['count','Content-Range','apply','reject','update','then','get','Pauses','destroy','error','stack','name','send','map','Pause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','offset','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x30b994,_0xb5453b){var _0x1b3ca4=function(_0x385cd8){while(--_0x385cd8){_0x30b994['push'](_0x30b994['shift']());}};_0x1b3ca4(++_0xb5453b);}(_0x2a2c,0xd3));var _0xc2a2=function(_0x1bb343,_0x5dc9c2){_0x1bb343=_0x1bb343-0x0;var _0x142b3a=_0x2a2c[_0x1bb343];return _0x142b3a;};'use strict';var pdf=require(_0xc2a2('0x0'));var emlformat=require(_0xc2a2('0x1'));var rimraf=require(_0xc2a2('0x2'));var zipdir=require(_0xc2a2('0x3'));var jsonpatch=require(_0xc2a2('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc2a2('0x5'));var Mustache=require(_0xc2a2('0x6'));var util=require(_0xc2a2('0x7'));var path=require(_0xc2a2('0x8'));var sox=require(_0xc2a2('0x9'));var csv=require(_0xc2a2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc2a2('0xb'));var crypto=require(_0xc2a2('0xc'));var jsforce=require(_0xc2a2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc2a2('0xe'));var Papa=require(_0xc2a2('0xf'));var Redis=require('ioredis');var authService=require(_0xc2a2('0x10'));var qs=require(_0xc2a2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2a2('0x12'));var logger=require(_0xc2a2('0x13'))('api');var utils=require(_0xc2a2('0x14'));var config=require(_0xc2a2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32c3c1,_0x383f6c){_0x383f6c=_0x383f6c||0xcc;return function(_0x53d208){if(_0x53d208){return _0x32c3c1[_0xc2a2('0x16')](_0x383f6c);}return _0x32c3c1[_0xc2a2('0x17')](_0x383f6c)[_0xc2a2('0x18')]();};}function respondWithResult(_0x12a4f1,_0x213523){_0x213523=_0x213523||0xc8;return function(_0x4a08c4){if(_0x4a08c4){return _0x12a4f1[_0xc2a2('0x17')](_0x213523)[_0xc2a2('0x19')](_0x4a08c4);}};}function respondWithFilteredResult(_0x4b2585,_0x68b829){return function(_0x3784bc){if(_0x3784bc){var _0x4edf20=_0x3784bc[_0xc2a2('0x1a')],_0x3f9766=_0x68b829['offset'],_0x5732b6=_0x68b829['offset']+_0x68b829['limit'],_0x3134ab;if(_0x5732b6>=_0x4edf20){_0x5732b6=_0x4edf20;_0x3134ab=0xc8;}else{_0x3134ab=0xce;}_0x4b2585[_0xc2a2('0x17')](_0x3134ab);return _0x4b2585['set'](_0xc2a2('0x1b'),_0x3f9766+'-'+_0x5732b6+'/'+_0x4edf20)['json'](_0x3784bc);}return null;};}function patchUpdates(_0x18f1ed){return function(_0x239829){try{jsonpatch[_0xc2a2('0x1c')](_0x239829,_0x18f1ed,!![]);}catch(_0x4c4bdd){return BPromise[_0xc2a2('0x1d')](_0x4c4bdd);}return _0x239829['save']();};}function saveUpdates(_0x10cc7f,_0x404f3f){return function(_0x32b7c1){if(_0x32b7c1){return _0x32b7c1[_0xc2a2('0x1e')](_0x10cc7f)[_0xc2a2('0x1f')](function(_0xc59095){return _0xc59095;});}return null;};}function removeEntity(_0x41643b,_0x124e83){return function(_0x29117d){if(_0x29117d){return _0x29117d['destroy']()[_0xc2a2('0x1f')](function(){var _0x2cd8cb=_0x29117d[_0xc2a2('0x20')]({'plain':!![]});var _0x2a2a6f=_0xc2a2('0x21');return db['UserProfileResource'][_0xc2a2('0x22')]({'where':{'type':_0x2a2a6f,'resourceId':_0x2cd8cb['id']}})[_0xc2a2('0x1f')](function(){return _0x29117d;});})['then'](function(){_0x41643b[_0xc2a2('0x17')](0xcc)[_0xc2a2('0x18')]();});}};}function handleEntityNotFound(_0x3420ac,_0x51d24a){return function(_0x34f96f){if(!_0x34f96f){_0x3420ac[_0xc2a2('0x16')](0x194);}return _0x34f96f;};}function handleError(_0xf5c20a,_0x20f95f){_0x20f95f=_0x20f95f||0x1f4;return function(_0x362507){logger[_0xc2a2('0x23')](_0x362507[_0xc2a2('0x24')]);if(_0x362507[_0xc2a2('0x25')]){delete _0x362507[_0xc2a2('0x25')];}_0xf5c20a['status'](_0x20f95f)[_0xc2a2('0x26')](_0x362507);};}exports['index']=function(_0x5b223d,_0x446ee0){var _0x409402={},_0x3af85f={},_0xfd4085={'count':0x0,'rows':[]};var _0xb14220=_[_0xc2a2('0x27')](db[_0xc2a2('0x28')][_0xc2a2('0x29')],function(_0xc9de74){return{'name':_0xc9de74[_0xc2a2('0x2a')],'type':_0xc9de74['type'][_0xc2a2('0x2b')]};});_0x3af85f[_0xc2a2('0x2c')]=_[_0xc2a2('0x27')](_0xb14220,_0xc2a2('0x25'));_0x3af85f[_0xc2a2('0x2d')]=_[_0xc2a2('0x2e')](_0x5b223d[_0xc2a2('0x2d')]);_0x3af85f[_0xc2a2('0x2f')]=_[_0xc2a2('0x30')](_0x3af85f[_0xc2a2('0x2c')],_0x3af85f[_0xc2a2('0x2d')]);_0x409402[_0xc2a2('0x31')]=_[_0xc2a2('0x30')](_0x3af85f[_0xc2a2('0x2c')],qs[_0xc2a2('0x32')](_0x5b223d[_0xc2a2('0x2d')][_0xc2a2('0x32')]));_0x409402[_0xc2a2('0x31')]=_0x409402[_0xc2a2('0x31')][_0xc2a2('0x33')]?_0x409402[_0xc2a2('0x31')]:_0x3af85f['model'];if(!_0x5b223d[_0xc2a2('0x2d')][_0xc2a2('0x34')]('nolimit')){_0x409402[_0xc2a2('0x35')]=qs[_0xc2a2('0x35')](_0x5b223d[_0xc2a2('0x2d')]['limit']);_0x409402['offset']=qs['offset'](_0x5b223d[_0xc2a2('0x2d')][_0xc2a2('0x36')]);}_0x409402['order']=qs[_0xc2a2('0x37')](_0x5b223d[_0xc2a2('0x2d')][_0xc2a2('0x37')]);_0x409402[_0xc2a2('0x38')]=qs[_0xc2a2('0x2f')](_[_0xc2a2('0x39')](_0x5b223d[_0xc2a2('0x2d')],_0x3af85f[_0xc2a2('0x2f')]));if(_0x5b223d[_0xc2a2('0x2d')]['filter']){_0x409402[_0xc2a2('0x38')]=_[_0xc2a2('0x3a')](_0x409402[_0xc2a2('0x38')],{'$or':_[_0xc2a2('0x27')](_0xb14220,function(_0x29fd5a){if(_0x29fd5a[_0xc2a2('0x3b')]!==_0xc2a2('0x3c')){var _0x1236e1={};_0x1236e1[_0x29fd5a[_0xc2a2('0x25')]]={'$like':'%'+_0x5b223d[_0xc2a2('0x2d')][_0xc2a2('0x3d')]+'%'};return _0x1236e1;}})});}_0x409402=_[_0xc2a2('0x3a')]({},_0x409402,_0x5b223d[_0xc2a2('0x3e')]);var _0x7d3930={'where':_0x409402[_0xc2a2('0x38')]};return db[_0xc2a2('0x28')][_0xc2a2('0x1a')](_0x7d3930)['then'](function(_0x5451fd){_0xfd4085[_0xc2a2('0x1a')]=_0x5451fd;if(_0x5b223d[_0xc2a2('0x2d')][_0xc2a2('0x3f')]){_0x409402['include']=[{'all':!![]}];}return db[_0xc2a2('0x28')][_0xc2a2('0x40')](_0x409402);})['then'](function(_0x1ed056){_0xfd4085[_0xc2a2('0x41')]=_0x1ed056;return _0xfd4085;})['then'](respondWithFilteredResult(_0x446ee0,_0x409402))[_0xc2a2('0x42')](handleError(_0x446ee0,null));};exports[_0xc2a2('0x43')]=function(_0x407c18,_0x4aa3c5){var _0x30ab38={'raw':!![],'where':{'id':_0x407c18['params']['id']}},_0x3c03ba={};_0x3c03ba[_0xc2a2('0x2c')]=_[_0xc2a2('0x2e')](db[_0xc2a2('0x28')][_0xc2a2('0x29')]);_0x3c03ba[_0xc2a2('0x2d')]=_['keys'](_0x407c18[_0xc2a2('0x2d')]);_0x3c03ba['filters']=_['intersection'](_0x3c03ba[_0xc2a2('0x2c')],_0x3c03ba[_0xc2a2('0x2d')]);_0x30ab38[_0xc2a2('0x31')]=_['intersection'](_0x3c03ba[_0xc2a2('0x2c')],qs['fields'](_0x407c18['query'][_0xc2a2('0x32')]));_0x30ab38[_0xc2a2('0x31')]=_0x30ab38[_0xc2a2('0x31')][_0xc2a2('0x33')]?_0x30ab38['attributes']:_0x3c03ba['model'];if(_0x407c18[_0xc2a2('0x2d')][_0xc2a2('0x3f')]){_0x30ab38['include']=[{'all':!![]}];}_0x30ab38=_['merge']({},_0x30ab38,_0x407c18[_0xc2a2('0x3e')]);return db[_0xc2a2('0x28')]['find'](_0x30ab38)[_0xc2a2('0x1f')](handleEntityNotFound(_0x4aa3c5,null))[_0xc2a2('0x1f')](respondWithResult(_0x4aa3c5,null))[_0xc2a2('0x42')](handleError(_0x4aa3c5,null));};exports[_0xc2a2('0x44')]=function(_0x2e95f6,_0x157cfb){return db[_0xc2a2('0x28')][_0xc2a2('0x44')](_0x2e95f6[_0xc2a2('0x45')],{})[_0xc2a2('0x1f')](function(_0x28d8a8){var _0x141b08=_0x2e95f6[_0xc2a2('0x46')][_0xc2a2('0x20')]({'plain':!![]});if(!_0x141b08)throw new Error(_0xc2a2('0x47'));if(_0x141b08[_0xc2a2('0x48')]===_0xc2a2('0x46')){var _0x4f8976=_0x28d8a8[_0xc2a2('0x20')]({'plain':!![]});var _0x52dbce='Pauses';return db[_0xc2a2('0x49')][_0xc2a2('0x4a')]({'where':{'name':_0x52dbce,'userProfileId':_0x141b08[_0xc2a2('0x4b')]},'raw':!![]})['then'](function(_0x3e6d3b){if(_0x3e6d3b&&_0x3e6d3b[_0xc2a2('0x4c')]===0x0){return db['UserProfileResource'][_0xc2a2('0x44')]({'name':_0x4f8976[_0xc2a2('0x25')],'resourceId':_0x4f8976['id'],'type':_0x3e6d3b[_0xc2a2('0x25')],'sectionId':_0x3e6d3b['id']},{})['then'](function(){return _0x28d8a8;});}else{return _0x28d8a8;}})[_0xc2a2('0x42')](function(_0x49a4c4){logger['error'](_0xc2a2('0x4d'),_0x49a4c4);throw _0x49a4c4;});}return _0x28d8a8;})[_0xc2a2('0x1f')](respondWithResult(_0x157cfb,0xc9))[_0xc2a2('0x42')](handleError(_0x157cfb,null));};exports[_0xc2a2('0x1e')]=function(_0xdc7e06,_0x19122e){if(_0xdc7e06[_0xc2a2('0x45')]['id']){delete _0xdc7e06['body']['id'];}return db[_0xc2a2('0x28')][_0xc2a2('0x4a')]({'where':{'id':_0xdc7e06[_0xc2a2('0x4e')]['id']}})[_0xc2a2('0x1f')](handleEntityNotFound(_0x19122e,null))[_0xc2a2('0x1f')](saveUpdates(_0xdc7e06[_0xc2a2('0x45')],null))[_0xc2a2('0x1f')](respondWithResult(_0x19122e,null))['catch'](handleError(_0x19122e,null));};exports[_0xc2a2('0x22')]=function(_0x59b656,_0x3b76da){return db[_0xc2a2('0x28')][_0xc2a2('0x4a')]({'where':{'id':_0x59b656[_0xc2a2('0x4e')]['id']}})[_0xc2a2('0x1f')](handleEntityNotFound(_0x3b76da,null))[_0xc2a2('0x1f')](removeEntity(_0x3b76da,null))[_0xc2a2('0x42')](handleError(_0x3b76da,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index f20f84a..ba1efe7 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 _0xe458=['tools_pauses','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','define','Pause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe458,0x160));var _0x8e45=function(_0x2eb4e0,_0x437591){_0x2eb4e0=_0x2eb4e0-0x0;var _0x2aba32=_0xe458[_0x2eb4e0];return _0x2aba32;};'use strict';var _=require(_0x8e45('0x0'));var util=require(_0x8e45('0x1'));var logger=require('../../config/logger')(_0x8e45('0x2'));var moment=require(_0x8e45('0x3'));var BPromise=require(_0x8e45('0x4'));var rp=require(_0x8e45('0x5'));var fs=require('fs');var path=require(_0x8e45('0x6'));var rimraf=require(_0x8e45('0x7'));var config=require(_0x8e45('0x8'));var attributes=require(_0x8e45('0x9'));module['exports']=function(_0x4a9756,_0x3aea2b){return _0x4a9756[_0x8e45('0xa')](_0x8e45('0xb'),attributes,{'tableName':_0x8e45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47c5=['rimraf','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4a61f0,_0x16ed44){var _0x548ea5=function(_0xd574e1){while(--_0xd574e1){_0x4a61f0['push'](_0x4a61f0['shift']());}};_0x548ea5(++_0x16ed44);}(_0x47c5,0x165));var _0x547c=function(_0x2e8660,_0x5ca0c2){_0x2e8660=_0x2e8660-0x0;var _0x3dc331=_0x47c5[_0x2e8660];return _0x3dc331;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));module[_0x547c('0x9')]=function(_0x51ab7f,_0x2e5b57){return _0x51ab7f[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('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 9b50540..c6bc20b 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 _0x0a21=['find','options','raw','where','attributes','include','model','map','debug','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Pause,\x20%s,\x20%s','result','catch','Pause'];(function(_0x445988,_0x19a6fe){var _0x2a2fd0=function(_0x378fd){while(--_0x378fd){_0x445988['push'](_0x445988['shift']());}};_0x2a2fd0(++_0x19a6fe);}(_0x0a21,0x9f));var _0x10a2=function(_0x2f7f44,_0x350380){_0x2f7f44=_0x2f7f44-0x0;var _0xc027e5=_0x0a21[_0x2f7f44];return _0xc027e5;};'use strict';var _=require('lodash');var util=require(_0x10a2('0x0'));var moment=require('moment');var BPromise=require(_0x10a2('0x1'));var rs=require(_0x10a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a2('0x3'))['db'];var utils=require(_0x10a2('0x4'));var logger=require(_0x10a2('0x5'))(_0x10a2('0x6'));var config=require(_0x10a2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x10a2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33f92b,_0x5c4296,_0x169267){return new BPromise(function(_0x21877e,_0x2c7eeb){return client[_0x10a2('0x9')](_0x33f92b,_0x169267)['then'](function(_0x53d18f){logger[_0x10a2('0xa')]('Pause,\x20%s,\x20%s',_0x5c4296,'request\x20sent');logger['debug'](_0x10a2('0xb'),_0x5c4296,_0x10a2('0xc'),JSON[_0x10a2('0xd')](_0x53d18f));if(_0x53d18f[_0x10a2('0xe')]){if(_0x53d18f[_0x10a2('0xe')][_0x10a2('0xf')]===0x1f4){logger[_0x10a2('0xe')]('Pause,\x20%s,\x20%s',_0x5c4296,_0x53d18f[_0x10a2('0xe')][_0x10a2('0x10')]);return _0x2c7eeb(_0x53d18f[_0x10a2('0xe')]['message']);}logger[_0x10a2('0xe')](_0x10a2('0x11'),_0x5c4296,_0x53d18f['error']['message']);return _0x21877e(_0x53d18f['error'][_0x10a2('0x10')]);}else{logger[_0x10a2('0xa')]('Pause,\x20%s,\x20%s',_0x5c4296,'request\x20sent');_0x21877e(_0x53d18f[_0x10a2('0x12')]['message']);}})[_0x10a2('0x13')](function(_0x3d6495){logger[_0x10a2('0xe')](_0x10a2('0x11'),_0x5c4296,_0x3d6495);_0x2c7eeb(_0x3d6495);});});}exports['ShowPause']=function(_0xd140f){var _0x8b0e63=this;return new Promise(function(_0x2a85d9,_0x513d73){return db[_0x10a2('0x14')][_0x10a2('0x15')]({'raw':_0xd140f[_0x10a2('0x16')]?_0xd140f[_0x10a2('0x16')][_0x10a2('0x17')]===undefined?!![]:![]:!![],'where':_0xd140f['options']?_0xd140f[_0x10a2('0x16')][_0x10a2('0x18')]||null:null,'attributes':_0xd140f[_0x10a2('0x16')]?_0xd140f[_0x10a2('0x16')][_0x10a2('0x19')]||null:null,'include':_0xd140f[_0x10a2('0x16')]?_0xd140f['options'][_0x10a2('0x1a')]?_['map'](_0xd140f[_0x10a2('0x16')][_0x10a2('0x1a')],function(_0x5644ab){return{'model':db[_0x5644ab['model']],'as':_0x5644ab['as'],'attributes':_0x5644ab[_0x10a2('0x19')],'include':_0x5644ab['include']?_['map'](_0x5644ab[_0x10a2('0x1a')],function(_0x2887f7){return{'model':db[_0x2887f7[_0x10a2('0x1b')]],'as':_0x2887f7['as'],'attributes':_0x2887f7[_0x10a2('0x19')],'include':_0x2887f7[_0x10a2('0x1a')]?_[_0x10a2('0x1c')](_0x2887f7[_0x10a2('0x1a')],function(_0x4fd10b){return{'model':db[_0x4fd10b[_0x10a2('0x1b')]],'as':_0x4fd10b['as'],'attributes':_0x4fd10b[_0x10a2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1db943){logger['info']('ShowPause',_0xd140f);logger[_0x10a2('0x1d')]('ShowPause',_0xd140f,JSON['stringify'](_0x1db943));_0x2a85d9(_0x1db943);})['catch'](function(_0x288912){logger['error']('ShowPause',_0x288912[_0x10a2('0x10')],_0xd140f);_0x513d73(_0x8b0e63[_0x10a2('0xe')](0x1f4,_0x288912['message']));});});}; \ No newline at end of file +var _0xe497=['find','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','Pause,\x20%s,\x20%s','message','result','ShowPause','Pause'];(function(_0x136516,_0x1e01ba){var _0x195898=function(_0x424361){while(--_0x424361){_0x136516['push'](_0x136516['shift']());}};_0x195898(++_0x1e01ba);}(_0xe497,0xb3));var _0x7e49=function(_0x536cf9,_0xd39d6d){_0x536cf9=_0x536cf9-0x0;var _0x156573=_0xe497[_0x536cf9];return _0x156573;};'use strict';var _=require(_0x7e49('0x0'));var util=require(_0x7e49('0x1'));var moment=require(_0x7e49('0x2'));var BPromise=require(_0x7e49('0x3'));var rs=require(_0x7e49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e49('0x5'))['db'];var utils=require(_0x7e49('0x6'));var logger=require(_0x7e49('0x7'))(_0x7e49('0x8'));var config=require(_0x7e49('0x9'));var jayson=require(_0x7e49('0xa'));var client=jayson[_0x7e49('0xb')][_0x7e49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ffba5,_0x266afd,_0x5a0818){return new BPromise(function(_0x471111,_0x17a882){return client[_0x7e49('0xd')](_0x3ffba5,_0x5a0818)[_0x7e49('0xe')](function(_0x36b1b1){logger[_0x7e49('0xf')]('Pause,\x20%s,\x20%s',_0x266afd,_0x7e49('0x10'));logger[_0x7e49('0x11')]('Pause,\x20%s,\x20%s,\x20%s',_0x266afd,_0x7e49('0x10'),JSON[_0x7e49('0x12')](_0x36b1b1));if(_0x36b1b1['error']){if(_0x36b1b1[_0x7e49('0x13')]['code']===0x1f4){logger[_0x7e49('0x13')](_0x7e49('0x14'),_0x266afd,_0x36b1b1[_0x7e49('0x13')]['message']);return _0x17a882(_0x36b1b1['error'][_0x7e49('0x15')]);}logger[_0x7e49('0x13')](_0x7e49('0x14'),_0x266afd,_0x36b1b1[_0x7e49('0x13')][_0x7e49('0x15')]);return _0x471111(_0x36b1b1[_0x7e49('0x13')][_0x7e49('0x15')]);}else{logger['info'](_0x7e49('0x14'),_0x266afd,'request\x20sent');_0x471111(_0x36b1b1[_0x7e49('0x16')][_0x7e49('0x15')]);}})['catch'](function(_0x195438){logger[_0x7e49('0x13')](_0x7e49('0x14'),_0x266afd,_0x195438);_0x17a882(_0x195438);});});}exports[_0x7e49('0x17')]=function(_0x124a1d){var _0xf9d7bb=this;return new Promise(function(_0x3ab6da,_0x1d8601){return db[_0x7e49('0x18')][_0x7e49('0x19')]({'raw':_0x124a1d[_0x7e49('0x1a')]?_0x124a1d[_0x7e49('0x1a')][_0x7e49('0x1b')]===undefined?!![]:![]:!![],'where':_0x124a1d[_0x7e49('0x1a')]?_0x124a1d[_0x7e49('0x1a')][_0x7e49('0x1c')]||null:null,'attributes':_0x124a1d[_0x7e49('0x1a')]?_0x124a1d[_0x7e49('0x1a')][_0x7e49('0x1d')]||null:null,'include':_0x124a1d[_0x7e49('0x1a')]?_0x124a1d[_0x7e49('0x1a')][_0x7e49('0x1e')]?_[_0x7e49('0x1f')](_0x124a1d[_0x7e49('0x1a')][_0x7e49('0x1e')],function(_0x2ae85c){return{'model':db[_0x2ae85c[_0x7e49('0x20')]],'as':_0x2ae85c['as'],'attributes':_0x2ae85c['attributes'],'include':_0x2ae85c['include']?_['map'](_0x2ae85c[_0x7e49('0x1e')],function(_0x2659aa){return{'model':db[_0x2659aa[_0x7e49('0x20')]],'as':_0x2659aa['as'],'attributes':_0x2659aa[_0x7e49('0x1d')],'include':_0x2659aa[_0x7e49('0x1e')]?_[_0x7e49('0x1f')](_0x2659aa[_0x7e49('0x1e')],function(_0xf48bcd){return{'model':db[_0xf48bcd[_0x7e49('0x20')]],'as':_0xf48bcd['as'],'attributes':_0xf48bcd[_0x7e49('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e49('0xe')](function(_0x14a2a9){logger[_0x7e49('0xf')](_0x7e49('0x17'),_0x124a1d);logger[_0x7e49('0x11')](_0x7e49('0x17'),_0x124a1d,JSON[_0x7e49('0x12')](_0x14a2a9));_0x3ab6da(_0x14a2a9);})[_0x7e49('0x21')](function(_0x16b3b7){logger[_0x7e49('0x13')](_0x7e49('0x17'),_0x16b3b7[_0x7e49('0x15')],_0x124a1d);_0x1d8601(_0xf9d7bb[_0x7e49('0x13')](0x1f4,_0x16b3b7[_0x7e49('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 983255c..eb48105 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 _0xd4c5=['%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname'];(function(_0x565afd,_0x1e676f){var _0x59ee92=function(_0xf9abda){while(--_0xf9abda){_0x565afd['push'](_0x565afd['shift']());}};_0x59ee92(++_0x1e676f);}(_0xd4c5,0x140));var _0x5d4c=function(_0x1ccc9a,_0x44563a){_0x1ccc9a=_0x1ccc9a-0x0;var _0x5507ea=_0xd4c5[_0x1ccc9a];return _0x5507ea;};'use strict';var multer=require('multer');var util=require(_0x5d4c('0x0'));var path=require(_0x5d4c('0x1'));var timeout=require(_0x5d4c('0x2'));var express=require(_0x5d4c('0x3'));var router=express['Router']();var auth=require(_0x5d4c('0x4'));var interaction=require(_0x5d4c('0x5'));var config=require('../../config/environment');var controller=require(_0x5d4c('0x6'));router['get']('/',auth[_0x5d4c('0x7')](),controller[_0x5d4c('0x8')]);router[_0x5d4c('0x9')](_0x5d4c('0xa'),controller[_0x5d4c('0xb')]);router[_0x5d4c('0x9')]('/:id',auth[_0x5d4c('0x7')](),controller[_0x5d4c('0xc')]);router['get'](_0x5d4c('0xd'),auth[_0x5d4c('0x7')](),controller[_0x5d4c('0xe')]);var upload=multer({'storage':multer[_0x5d4c('0xf')]({'destination':function(_0x390445,_0x255ddb,_0xe1a667){_0xe1a667(null,path[_0x5d4c('0x10')](config[_0x5d4c('0x11')],_0x5d4c('0x12')));},'filename':function(_0x563b56,_0x5a5d15,_0x4b0e0a){_0x5a5d15[_0x5d4c('0x13')]=_0x5a5d15['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b0e0a(null,util['format'](_0x5d4c('0x14'),path[_0x5d4c('0x15')](_0x5a5d15[_0x5d4c('0x13')],path[_0x5d4c('0x16')](_0x5a5d15['originalname'])),Date[_0x5d4c('0x17')](),path['extname'](_0x5a5d15[_0x5d4c('0x13')])));}})});router[_0x5d4c('0x18')]('/',upload[_0x5d4c('0x19')](_0x5d4c('0x1a')),controller[_0x5d4c('0x1b')]);router[_0x5d4c('0x18')](_0x5d4c('0xa'),controller[_0x5d4c('0x1c')]);router[_0x5d4c('0x1d')](_0x5d4c('0x1e'),auth['isAuthenticated'](),controller[_0x5d4c('0x1f')]);router['delete'](_0x5d4c('0x1e'),auth[_0x5d4c('0x7')](),controller[_0x5d4c('0x20')]);module[_0x5d4c('0x21')]=router; \ No newline at end of file +var _0xb00e=['upload','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single'];(function(_0x370b89,_0x54e414){var _0x257a63=function(_0x1f223b){while(--_0x1f223b){_0x370b89['push'](_0x370b89['shift']());}};_0x257a63(++_0x54e414);}(_0xb00e,0x1f3));var _0xeb00=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0xb00e[_0x2d4421];return _0x2d3b01;};'use strict';var multer=require(_0xeb00('0x0'));var util=require(_0xeb00('0x1'));var path=require(_0xeb00('0x2'));var timeout=require(_0xeb00('0x3'));var express=require(_0xeb00('0x4'));var router=express[_0xeb00('0x5')]();var auth=require(_0xeb00('0x6'));var interaction=require(_0xeb00('0x7'));var config=require(_0xeb00('0x8'));var controller=require(_0xeb00('0x9'));router[_0xeb00('0xa')]('/',auth[_0xeb00('0xb')](),controller[_0xeb00('0xc')]);router[_0xeb00('0xa')](_0xeb00('0xd'),controller[_0xeb00('0xe')]);router[_0xeb00('0xa')](_0xeb00('0xf'),auth[_0xeb00('0xb')](),controller['show']);router['get'](_0xeb00('0x10'),auth[_0xeb00('0xb')](),controller[_0xeb00('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x407c4e,_0x573b83,_0x13a24f){_0x13a24f(null,path[_0xeb00('0x12')](config[_0xeb00('0x13')],_0xeb00('0x14')));},'filename':function(_0x47df71,_0x207f07,_0x40034f){_0x207f07[_0xeb00('0x15')]=_0x207f07[_0xeb00('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40034f(null,util[_0xeb00('0x16')](_0xeb00('0x17'),path[_0xeb00('0x18')](_0x207f07['originalname'],path[_0xeb00('0x19')](_0x207f07[_0xeb00('0x15')])),Date[_0xeb00('0x1a')](),path[_0xeb00('0x19')](_0x207f07[_0xeb00('0x15')])));}})});router[_0xeb00('0x1b')]('/',upload[_0xeb00('0x1c')]('file'),controller[_0xeb00('0x1d')]);router['post'](_0xeb00('0xd'),controller['webhookPost']);router[_0xeb00('0x1e')](_0xeb00('0xf'),auth[_0xeb00('0xb')](),controller['update']);router[_0xeb00('0x1f')](_0xeb00('0xf'),auth[_0xeb00('0xb')](),controller[_0xeb00('0x1f')]);module[_0xeb00('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 04a0113..9cb8b44 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 _0xf3b1=['agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM'];(function(_0x3cb60d,_0x50ec13){var _0x36a74b=function(_0x350ea3){while(--_0x350ea3){_0x3cb60d['push'](_0x3cb60d['shift']());}};_0x36a74b(++_0x50ec13);}(_0xf3b1,0xab));var _0x1f3b=function(_0x4f855e,_0x685f00){_0x4f855e=_0x4f855e-0x0;var _0x25645a=_0xf3b1[_0x4f855e];return _0x25645a;};'use strict';var Sequelize=require(_0x1f3b('0x0'));module[_0x1f3b('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1f3b('0x2'),'script')},'description':{'type':Sequelize[_0x1f3b('0x3')]},'version':{'type':Sequelize[_0x1f3b('0x3')]},'path':{'type':Sequelize[_0x1f3b('0x4')],'comment':_0x1f3b('0x5')},'active':{'type':Sequelize[_0x1f3b('0x6')],'defaultValue':0x0,'comment':_0x1f3b('0x7')},'sidebar':{'type':Sequelize[_0x1f3b('0x8')]('adminOnly',_0x1f3b('0x9'),_0x1f3b('0xa'),'never'),'defaultValue':_0x1f3b('0xa'),'comment':_0x1f3b('0xb')},'icon':{'type':Sequelize[_0x1f3b('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x1f3b('0x4')]},'scriptName':{'type':Sequelize[_0x1f3b('0x4')]},'scriptPath':{'type':Sequelize[_0x1f3b('0x4')]}}; \ No newline at end of file +var _0xe1ae=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x46a50c,_0x3a7f4a){var _0x4274db=function(_0x213af1){while(--_0x213af1){_0x46a50c['push'](_0x46a50c['shift']());}};_0x4274db(++_0x3a7f4a);}(_0xe1ae,0x69));var _0xee1a=function(_0x1e6951,_0x4d39ee){_0x1e6951=_0x1e6951-0x0;var _0x235723=_0xe1ae[_0x1e6951];return _0x235723;};'use strict';var Sequelize=require(_0xee1a('0x0'));module[_0xee1a('0x1')]={'name':{'type':Sequelize[_0xee1a('0x2')]},'type':{'type':Sequelize['ENUM'](_0xee1a('0x3'),_0xee1a('0x4'))},'description':{'type':Sequelize[_0xee1a('0x5')]},'version':{'type':Sequelize[_0xee1a('0x5')]},'path':{'type':Sequelize[_0xee1a('0x2')],'comment':_0xee1a('0x6')},'active':{'type':Sequelize[_0xee1a('0x7')],'defaultValue':0x0,'comment':_0xee1a('0x8')},'sidebar':{'type':Sequelize[_0xee1a('0x9')](_0xee1a('0xa'),'agentOnly',_0xee1a('0xb'),_0xee1a('0xc')),'defaultValue':_0xee1a('0xb'),'comment':_0xee1a('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xee1a('0x2')]},'agentUrl':{'type':Sequelize[_0xee1a('0x2')]},'scriptName':{'type':Sequelize[_0xee1a('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d41061a..0d8ffd8 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 _0xdf0f=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','Plugins','UserProfileResource','end','stack','name','index','map','Plugin','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','catch','root','server/files/plugins','basename','path','createWriteStream','zip','warning','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','version','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','destroy','webhookGet','resolve','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','statusCode','send','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','content-type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf0f,0xa8));var _0xfdf0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf0f[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfdf0('0x0'));var rimraf=require(_0xfdf0('0x1'));var zipdir=require(_0xfdf0('0x2'));var jsonpatch=require(_0xfdf0('0x3'));var rp=require(_0xfdf0('0x4'));var moment=require(_0xfdf0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfdf0('0x6'));var util=require(_0xfdf0('0x7'));var path=require('path');var sox=require(_0xfdf0('0x8'));var csv=require(_0xfdf0('0x9'));var ejs=require(_0xfdf0('0xa'));var fs=require('fs');var _=require(_0xfdf0('0xb'));var squel=require(_0xfdf0('0xc'));var crypto=require(_0xfdf0('0xd'));var jsforce=require(_0xfdf0('0xe'));var deskjs=require(_0xfdf0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfdf0('0x10'));var Papa=require(_0xfdf0('0x11'));var extract=require('extract-zip');var rimraf=require(_0xfdf0('0x1'));var archiver=require('archiver');var Redis=require(_0xfdf0('0x12'));var authService=require(_0xfdf0('0x13'));var qs=require(_0xfdf0('0x14'));var as=require(_0xfdf0('0x15'));var hardwareService=require(_0xfdf0('0x16'));var logger=require(_0xfdf0('0x17'))(_0xfdf0('0x18'));var utils=require(_0xfdf0('0x19'));var config=require(_0xfdf0('0x1a'));var db=require(_0xfdf0('0x1b'))['db'];config['redis']=_[_0xfdf0('0x1c')](config[_0xfdf0('0x1d')],{'host':_0xfdf0('0x1e'),'port':0x18eb});var socket=require(_0xfdf0('0x1f'))(new Redis(config[_0xfdf0('0x1d')]));require(_0xfdf0('0x20'))[_0xfdf0('0x21')](socket);function respondWithStatusCode(_0x56319b,_0x1f3f39){_0x1f3f39=_0x1f3f39||0xcc;return function(_0x20134f){if(_0x20134f){return _0x56319b[_0xfdf0('0x22')](_0x1f3f39);}return _0x56319b[_0xfdf0('0x23')](_0x1f3f39)['end']();};}function respondWithResult(_0xc7b411,_0x38b543){_0x38b543=_0x38b543||0xc8;return function(_0x585720){if(_0x585720){return _0xc7b411['status'](_0x38b543)[_0xfdf0('0x24')](_0x585720);}};}function respondWithFilteredResult(_0x4e307e,_0x4f7331){return function(_0x191262){if(_0x191262){var _0x21a29a=_0x191262[_0xfdf0('0x25')],_0x28db7c=_0x4f7331['offset'],_0x437492=_0x4f7331[_0xfdf0('0x26')]+_0x4f7331[_0xfdf0('0x27')],_0x30a21a;if(_0x437492>=_0x21a29a){_0x437492=_0x21a29a;_0x30a21a=0xc8;}else{_0x30a21a=0xce;}_0x4e307e[_0xfdf0('0x23')](_0x30a21a);return _0x4e307e[_0xfdf0('0x28')](_0xfdf0('0x29'),_0x28db7c+'-'+_0x437492+'/'+_0x21a29a)['json'](_0x191262);}return null;};}function patchUpdates(_0x5c6125){return function(_0x25ad06){try{jsonpatch[_0xfdf0('0x2a')](_0x25ad06,_0x5c6125,!![]);}catch(_0x501923){return BPromise[_0xfdf0('0x2b')](_0x501923);}return _0x25ad06['save']();};}function saveUpdates(_0x35c6d3,_0x219757){return function(_0x4f1ea1){if(_0x4f1ea1){return _0x4f1ea1[_0xfdf0('0x2c')](_0x35c6d3)[_0xfdf0('0x2d')](function(_0x359313){return _0x359313;});}return null;};}function removeEntity(_0x2ffec4,_0x1a9dc4){return function(_0x3a5b3f){if(_0x3a5b3f){return _0x3a5b3f['destroy']()[_0xfdf0('0x2d')](function(){var _0x1b6e59=_0x3a5b3f['get']({'plain':!![]});var _0x19a0eb=_0xfdf0('0x2e');return db[_0xfdf0('0x2f')]['destroy']({'where':{'type':_0x19a0eb,'resourceId':_0x1b6e59['id']}})[_0xfdf0('0x2d')](function(){return _0x3a5b3f;});})[_0xfdf0('0x2d')](function(){_0x2ffec4[_0xfdf0('0x23')](0xcc)[_0xfdf0('0x30')]();});}};}function handleEntityNotFound(_0x124fc7,_0x9be3d4){return function(_0x1e2b62){if(!_0x1e2b62){_0x124fc7[_0xfdf0('0x22')](0x194);}return _0x1e2b62;};}function handleError(_0x59ad77,_0x11941f){_0x11941f=_0x11941f||0x1f4;return function(_0x48af7b){logger['error'](_0x48af7b[_0xfdf0('0x31')]);if(_0x48af7b[_0xfdf0('0x32')]){delete _0x48af7b[_0xfdf0('0x32')];}_0x59ad77[_0xfdf0('0x23')](_0x11941f)['send'](_0x48af7b);};}exports[_0xfdf0('0x33')]=function(_0x50ed7f,_0x259699){var _0x43f3f4={},_0x51e48e={},_0xb6198={'count':0x0,'rows':[]};var _0x192538=_[_0xfdf0('0x34')](db[_0xfdf0('0x35')]['rawAttributes'],function(_0x1c3a9d){return{'name':_0x1c3a9d['fieldName'],'type':_0x1c3a9d[_0xfdf0('0x36')][_0xfdf0('0x37')]};});_0x51e48e[_0xfdf0('0x38')]=_[_0xfdf0('0x34')](_0x192538,_0xfdf0('0x32'));_0x51e48e[_0xfdf0('0x39')]=_[_0xfdf0('0x3a')](_0x50ed7f['query']);_0x51e48e[_0xfdf0('0x3b')]=_[_0xfdf0('0x3c')](_0x51e48e[_0xfdf0('0x38')],_0x51e48e[_0xfdf0('0x39')]);_0x43f3f4[_0xfdf0('0x3d')]=_[_0xfdf0('0x3c')](_0x51e48e[_0xfdf0('0x38')],qs[_0xfdf0('0x3e')](_0x50ed7f['query'][_0xfdf0('0x3e')]));_0x43f3f4['attributes']=_0x43f3f4[_0xfdf0('0x3d')]['length']?_0x43f3f4['attributes']:_0x51e48e['model'];if(!_0x50ed7f[_0xfdf0('0x39')][_0xfdf0('0x3f')](_0xfdf0('0x40'))){_0x43f3f4['limit']=qs[_0xfdf0('0x27')](_0x50ed7f['query'][_0xfdf0('0x27')]);_0x43f3f4[_0xfdf0('0x26')]=qs[_0xfdf0('0x26')](_0x50ed7f[_0xfdf0('0x39')]['offset']);}_0x43f3f4[_0xfdf0('0x41')]=qs[_0xfdf0('0x42')](_0x50ed7f[_0xfdf0('0x39')][_0xfdf0('0x42')]);_0x43f3f4[_0xfdf0('0x43')]=qs['filters'](_[_0xfdf0('0x44')](_0x50ed7f[_0xfdf0('0x39')],_0x51e48e[_0xfdf0('0x3b')]));if(_0x50ed7f[_0xfdf0('0x39')][_0xfdf0('0x45')]){_0x43f3f4['where']=_[_0xfdf0('0x46')](_0x43f3f4[_0xfdf0('0x43')],{'$or':_[_0xfdf0('0x34')](_0x192538,function(_0x9e5187){if(_0x9e5187[_0xfdf0('0x36')]!==_0xfdf0('0x47')){var _0x55ebcc={};_0x55ebcc[_0x9e5187['name']]={'$like':'%'+_0x50ed7f[_0xfdf0('0x39')][_0xfdf0('0x45')]+'%'};return _0x55ebcc;}})});}_0x43f3f4=_['merge']({},_0x43f3f4,_0x50ed7f[_0xfdf0('0x48')]);var _0x2a3958={'where':_0x43f3f4[_0xfdf0('0x43')]};return db[_0xfdf0('0x35')][_0xfdf0('0x25')](_0x2a3958)['then'](function(_0x282df0){_0xb6198[_0xfdf0('0x25')]=_0x282df0;if(_0x50ed7f[_0xfdf0('0x39')][_0xfdf0('0x49')]){_0x43f3f4['include']=[{'all':!![]}];}return db[_0xfdf0('0x35')][_0xfdf0('0x4a')](_0x43f3f4);})['then'](function(_0x3dcd53){_0xb6198[_0xfdf0('0x4b')]=_0x3dcd53;return _0xb6198;})['then'](respondWithFilteredResult(_0x259699,_0x43f3f4))['catch'](handleError(_0x259699,null));};exports[_0xfdf0('0x4c')]=function(_0x51ef1a,_0x5d1920){var _0x19b0e7={'raw':!![],'where':{'id':_0x51ef1a[_0xfdf0('0x4d')]['id']}},_0x3284c1={};_0x3284c1['model']=_[_0xfdf0('0x3a')](db[_0xfdf0('0x35')]['rawAttributes']);_0x3284c1['query']=_['keys'](_0x51ef1a['query']);_0x3284c1[_0xfdf0('0x3b')]=_[_0xfdf0('0x3c')](_0x3284c1['model'],_0x3284c1[_0xfdf0('0x39')]);_0x19b0e7['attributes']=_['intersection'](_0x3284c1[_0xfdf0('0x38')],qs[_0xfdf0('0x3e')](_0x51ef1a['query'][_0xfdf0('0x3e')]));_0x19b0e7['attributes']=_0x19b0e7[_0xfdf0('0x3d')][_0xfdf0('0x4e')]?_0x19b0e7[_0xfdf0('0x3d')]:_0x3284c1[_0xfdf0('0x38')];if(_0x51ef1a['query'][_0xfdf0('0x49')]){_0x19b0e7[_0xfdf0('0x4f')]=[{'all':!![]}];}_0x19b0e7=_['merge']({},_0x19b0e7,_0x51ef1a['options']);return db[_0xfdf0('0x35')]['find'](_0x19b0e7)['then'](handleEntityNotFound(_0x5d1920,null))[_0xfdf0('0x2d')](respondWithResult(_0x5d1920,null))[_0xfdf0('0x50')](handleError(_0x5d1920,null));};exports['download']=function(_0x1ea33f,_0x2612cc,_0x270de8){return db[_0xfdf0('0x35')]['find']({'where':{'id':_0x1ea33f[_0xfdf0('0x4d')]['id']},'attributes':[_0xfdf0('0x32'),'path'],'raw':!![]})[_0xfdf0('0x2d')](handleEntityNotFound(_0x2612cc,null))[_0xfdf0('0x2d')](function(_0x2d0033){if(_0x2d0033){var _0x3fa0a4=path['join'](config[_0xfdf0('0x51')],_0xfdf0('0x52'),util['format']('%s.zip',path[_0xfdf0('0x53')](_0x2d0033[_0xfdf0('0x54')])));var _0x27841a=fs[_0xfdf0('0x55')](_0x3fa0a4);var _0x2cc7f2=archiver(_0xfdf0('0x56'),{'zlib':{'level':0x9}});_0x2cc7f2['on'](_0xfdf0('0x57'),function(_0x2d6919){if(_0x2d6919['code']==='ENOENT'){logger[_0xfdf0('0x58')](_0x2d6919);}else{throw new db[(_0xfdf0('0x59'))][(_0xfdf0('0x5a'))](_0xfdf0('0x5b'));}});_0x2cc7f2['on'](_0xfdf0('0x58'),function(_0x28c29f){throw new db[(_0xfdf0('0x59'))]['Error'](_0xfdf0('0x5b'));});_0x2cc7f2['pipe'](_0x27841a);_0x2cc7f2[_0xfdf0('0x5c')](_0xfdf0('0x5d'),{'cwd':path[_0xfdf0('0x5e')](config[_0xfdf0('0x51')],_0xfdf0('0x52'),path[_0xfdf0('0x5f')](_0x2d0033[_0xfdf0('0x54')])),'ignore':[path['join'](path[_0xfdf0('0x53')](_0x2d0033[_0xfdf0('0x54')]),_0xfdf0('0x60')),path[_0xfdf0('0x5e')](path[_0xfdf0('0x53')](_0x2d0033['path']),_0xfdf0('0x61'))],'nodir':!![]})[_0xfdf0('0x62')]();_0x27841a['on'](_0xfdf0('0x63'),function(){if(!fs[_0xfdf0('0x64')](_0x3fa0a4)){throw new db[(_0xfdf0('0x59'))]['Error'](_0xfdf0('0x65'));}return _0x2612cc[_0xfdf0('0x66')](_0x3fa0a4,util[_0xfdf0('0x67')](_0xfdf0('0x68'),path[_0xfdf0('0x53')](_0x2d0033[_0xfdf0('0x54')])),function(_0x37e7aa){if(_0x37e7aa){throw new db[(_0xfdf0('0x59'))]['Error'](_0xfdf0('0x69'));}fs['unlinkSync'](_0x3fa0a4);logger[_0xfdf0('0x6a')]('Download\x20completed');logger[_0xfdf0('0x6a')](_0xfdf0('0x6b'));});});}return null;})[_0xfdf0('0x50')](handleError(_0x2612cc,null));};exports[_0xfdf0('0x6c')]=function(_0x411e05,_0x6ea3c3,_0x7cadab){var _0x2f4d06=path[_0xfdf0('0x53')](_0x411e05[_0xfdf0('0x6d')][_0xfdf0('0x6e')],path['extname'](_0x411e05[_0xfdf0('0x6d')][_0xfdf0('0x6e')]));var _0x4a7a77=path[_0xfdf0('0x5e')](config[_0xfdf0('0x51')],_0xfdf0('0x52'),_0x411e05[_0xfdf0('0x6d')][_0xfdf0('0x6e')]);var _0xd31f3=path['join'](config[_0xfdf0('0x51')],_0xfdf0('0x52'),_0x2f4d06);logger[_0xfdf0('0x6a')](_0xfdf0('0x6f'),_0x4a7a77);logger[_0xfdf0('0x6a')](_0xfdf0('0x70'),_0xd31f3);try{fs[_0xfdf0('0x71')](_0x4a7a77,parseInt('0777',0x8));extract(_0x4a7a77,{'dir':_0xd31f3},function(_0x50ff82){if(_0x50ff82){logger[_0xfdf0('0x58')](_0x50ff82);handleError(_0x50ff82,!![]);};var _0x4da715=fs[_0xfdf0('0x72')](_0xd31f3);if(_0x4da715['length']>0x1){removeReferences(_0x4a7a77,_0xd31f3);logger[_0xfdf0('0x58')]('Invalid\x20plugin\x20structure');return _0x7cadab(new Error(_0xfdf0('0x73')));}var _0x4c5819=fs['lstatSync'](path[_0xfdf0('0x5e')](_0xd31f3,_0x4da715[0x0]));if(_0x4c5819['isFile']()){removeReferences(_0x4a7a77,_0xd31f3);logger['error'](_0xfdf0('0x73'));return _0x7cadab(new Error(_0xfdf0('0x73')));}if(_0x4c5819['isDirectory']()){var _0x3a6b81=fs['readdirSync'](path[_0xfdf0('0x5e')](_0xd31f3,_0x4da715[0x0]));if(_0x3a6b81[_0xfdf0('0x4e')]===0x0){removeReferences(_0x4a7a77,_0xd31f3);logger['error'](_0xfdf0('0x73'));return _0x7cadab(new Error(_0xfdf0('0x73')));}var _0x95ec2f=_0x3a6b81[_0xfdf0('0x74')](function(_0x2f41a3){return _0x2f41a3===_0xfdf0('0x75');});if(!_0x95ec2f){return _0x7cadab(new Error(_0xfdf0('0x76')));}var _0x244c84=fs[_0xfdf0('0x77')](path[_0xfdf0('0x5e')](_0xd31f3,_0x4da715[0x0],_0xfdf0('0x75')));var _0x3a8601=JSON[_0xfdf0('0x78')](_0x244c84);if(_0xfdf0('0x79')==typeof _0x3a8601[_0xfdf0('0x32')]){return _0x7cadab(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xfdf0('0x79')==typeof _0x3a8601['type']){return _0x7cadab(new Error(_0xfdf0('0x7a')));}if('undefined'==typeof _0x3a8601['version']){return _0x7cadab(new Error(_0xfdf0('0x7b')));}if(_0xfdf0('0x79')==typeof _0x3a8601['parameters']){return _0x7cadab(new Error(_0xfdf0('0x7c')));}if(_0x3a8601[_0xfdf0('0x36')]===_0xfdf0('0x7d')){if('undefined'==typeof _0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x7f')]){return _0x7cadab(new Error(_0xfdf0('0x80')));}if(_0xfdf0('0x79')==typeof _0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x7f')][_0xfdf0('0x81')]&&_0xfdf0('0x79')==typeof _0x3a8601['parameters'][_0xfdf0('0x7f')][_0xfdf0('0x82')]){return _0x7cadab(new Error(_0xfdf0('0x83')));}}else if(_0x3a8601[_0xfdf0('0x36')]===_0xfdf0('0x84')){if(_0xfdf0('0x79')==typeof _0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x85')]){return _0x7cadab(new Error(_0xfdf0('0x86')));}if(_0xfdf0('0x79')==typeof _0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x87')]){return _0x7cadab(new Error(_0xfdf0('0x88')));}}else{return _0x7cadab(new Error(_0xfdf0('0x89')));}var _0x41d0e1=_0x3a8601['name'];var _0x40af72=_0x3a8601['description'];var _0x3afafd=_0x3a8601[_0xfdf0('0x36')];var _0x26e212=_0x3a8601[_0xfdf0('0x8a')]?_0x3a8601[_0xfdf0('0x8a')]:_0xfdf0('0x8b');var _0x5139be=_0x3a8601[_0xfdf0('0x8c')]?_0x3a8601[_0xfdf0('0x8c')]:'icon-apps';var _0x23430d='';var _0xba024='';var _0x378ff4='';var _0x5c4da7='';var _0x17cffa=_0x3a8601[_0xfdf0('0x8d')];if(_0x3afafd==='html'){if('undefined'!=typeof _0x3a8601['parameters'][_0xfdf0('0x7f')][_0xfdf0('0x81')]){var _0x20fdb3=_0x3a8601[_0xfdf0('0x7e')]['views'][_0xfdf0('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfdf0('0x8e')](_0x20fdb3)){_0x23430d=path['join']('plugins',_0x2f4d06,_0x4da715[0x0],_0x20fdb3);}else{_0x23430d=_0x20fdb3;}}else{logger[_0xfdf0('0x6a')](_0xfdf0('0x8f'));}if(_0xfdf0('0x79')!=typeof _0x3a8601['parameters'][_0xfdf0('0x7f')][_0xfdf0('0x82')]){var _0x2658f3=_0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xfdf0('0x8e')](_0x2658f3)){_0xba024=path[_0xfdf0('0x5e')](_0xfdf0('0x90'),_0x2f4d06,_0x4da715[0x0],_0x2658f3);}else{_0xba024=_0x2658f3;}}else{logger[_0xfdf0('0x6a')](_0xfdf0('0x91'));}}else if(_0x3afafd===_0xfdf0('0x84')){_0x378ff4=_0x3a8601['parameters'][_0xfdf0('0x85')];_0x5c4da7=_0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x87')];if(_0xfdf0('0x79')!=typeof _0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x7f')]){if('undefined'!=typeof _0x3a8601[_0xfdf0('0x7e')]['views'][_0xfdf0('0x81')]){var _0x20fdb3=_0x3a8601[_0xfdf0('0x7e')]['views'][_0xfdf0('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfdf0('0x8e')](_0x20fdb3)){_0x23430d=path[_0xfdf0('0x5e')]('plugins',_0x2f4d06,_0x4da715[0x0],_0x20fdb3);}else{_0x23430d=_0x20fdb3;}}if('undefined'!=typeof _0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x7f')][_0xfdf0('0x82')]){var _0x2658f3=_0x3a8601[_0xfdf0('0x7e')][_0xfdf0('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xfdf0('0x8e')](_0x2658f3)){_0xba024=path[_0xfdf0('0x5e')](_0xfdf0('0x90'),_0x2f4d06,_0x4da715[0x0],_0x2658f3);}else{_0xba024=_0x2658f3;}}}}var _0x3a04a4={'name':_0x41d0e1,'description':_0x40af72,'path':path['join'](_0x2f4d06,_0x4da715[0x0]),'type':_0x3afafd,'sidebar':_0x26e212,'icon':_0x5139be,'adminUrl':_0x23430d,'agentUrl':_0xba024,'scriptName':_0x378ff4,'scriptPath':_0x5c4da7,'version':_0x17cffa};removeReferences(_0x4a7a77,null);return db[_0xfdf0('0x35')][_0xfdf0('0x92')](_0x3a04a4)[_0xfdf0('0x2d')](function(_0xf098c4){var _0x3149ca={'role':_0x411e05[_0xfdf0('0x93')][_0xfdf0('0x94')],'userProfileId':_0x411e05[_0xfdf0('0x93')]['userProfileId']};if(!_0x3149ca)throw new Error(_0xfdf0('0x95'));if(_0x3149ca[_0xfdf0('0x94')]===_0xfdf0('0x96')){var _0x3a6ad6=_0xf098c4['get']({'plain':!![]});return db[_0xfdf0('0x97')][_0xfdf0('0x98')]({'where':{'name':_0xfdf0('0x2e'),'userProfileId':_0x3149ca[_0xfdf0('0x99')]},'raw':!![]})[_0xfdf0('0x2d')](function(_0x871d84){if(_0x871d84&&_0x871d84[_0xfdf0('0x9a')]===0x0){return db['UserProfileResource'][_0xfdf0('0x92')]({'name':_0x3a6ad6[_0xfdf0('0x32')],'resourceId':_0x3a6ad6['id'],'type':_0x871d84[_0xfdf0('0x32')],'sectionId':_0x871d84['id']},{})[_0xfdf0('0x2d')](function(){return _0xf098c4;});}else{return _0xf098c4;}})[_0xfdf0('0x50')](function(_0x595a15){logger[_0xfdf0('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x595a15);throw _0x595a15;});}return _0xf098c4;})[_0xfdf0('0x2d')](respondWithResult(_0x6ea3c3,null))[_0xfdf0('0x50')](handleError(_0x6ea3c3,null));}});}catch(_0x386159){_0x6ea3c3[_0xfdf0('0x23')](0x1f4)['send'](_0x386159);}};function removeReferences(_0x2fabfb,_0x27efcc){try{if(_0x2fabfb){fs[_0xfdf0('0x9b')](_0x2fabfb);logger['info'](_0xfdf0('0x9c'));}if(_0x27efcc){rimraf(_0x27efcc,function(){});logger['info'](_0xfdf0('0x9d'));}}catch(_0x16c413){logger['error'](_0x16c413);}}exports['update']=function(_0x3b8217,_0x14997f,_0x4bec7b){return db[_0xfdf0('0x35')][_0xfdf0('0x98')]({'where':{'id':_0x3b8217[_0xfdf0('0x4d')]['id']}})[_0xfdf0('0x2d')](handleEntityNotFound(_0x14997f,null))[_0xfdf0('0x2d')](saveUpdates(_0x3b8217[_0xfdf0('0x93')],null))[_0xfdf0('0x2d')](respondWithResult(_0x14997f,null))['catch'](handleError(_0x14997f,null));};exports['delete']=function(_0x2ae663,_0x2c4d73,_0x5f3228){return db['Plugin'][_0xfdf0('0x98')]({'where':{'id':_0x2ae663[_0xfdf0('0x4d')]['id']}})[_0xfdf0('0x2d')](function(_0x3992e4){if(_0x3992e4){return _0x3992e4[_0xfdf0('0x9e')]();}})[_0xfdf0('0x2d')](function(_0x2863a2){rimraf(path[_0xfdf0('0x5e')](config[_0xfdf0('0x51')],_0xfdf0('0x52'),path[_0xfdf0('0x5f')](_0x2863a2[_0xfdf0('0x54')])),function(){});return _0x2863a2;})[_0xfdf0('0x2d')](handleEntityNotFound(_0x2c4d73,null))['then'](respondWithStatusCode(_0x2c4d73,null))[_0xfdf0('0x50')](handleError(_0x2c4d73,null));};exports[_0xfdf0('0x9f')]=function(_0x6a9445,_0x56c72f,_0x22f3ba){return BPromise[_0xfdf0('0xa0')]()[_0xfdf0('0x2d')](function(){if(!_0x6a9445[_0xfdf0('0x39')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x8ad352=_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0xa2')]?_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0xa2')]+':'+_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0xa1')]:_0xfdf0('0xa3')+_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0xa1')];var _0x242aa6=_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0x24')]?_0x6a9445['query'][_0xfdf0('0x24')]:!![];var _0x56dd7c=_0x6a9445['query'][_0xfdf0('0xa4')]?_0x6a9445[_0xfdf0('0x39')]['encoding']:null;var _0x2d2385={'method':_0x6a9445[_0xfdf0('0xa5')],'uri':util[_0xfdf0('0x67')](_0xfdf0('0xa6'),_0x8ad352,_0x6a9445[_0xfdf0('0x39')][_0xfdf0('0x54')]),'json':_0x242aa6,'resolveWithFullResponse':!![],'encoding':_0x56dd7c,'qs':_0x6a9445[_0xfdf0('0x39')]};if(_0x6a9445['headers']){_0x2d2385['headers']=_0x6a9445['headers'];if(_0x2d2385[_0xfdf0('0xa7')][_0xfdf0('0xa8')]){delete _0x2d2385[_0xfdf0('0xa7')][_0xfdf0('0xa8')];}}if(_0x2d2385[_0xfdf0('0xa7')]['content-type']){delete _0x2d2385[_0xfdf0('0xa7')]['content-type'];}return rp(_0x2d2385);})['then'](function(_0x13fba7){if(_0x13fba7){_0x56c72f['set'](_0x13fba7[_0xfdf0('0xa7')]);logger[_0xfdf0('0x6a')](_0x13fba7[_0xfdf0('0x93')]);if(_['endsWith'](_0x6a9445[_0xfdf0('0x39')]['path'],_0xfdf0('0x66'))&&_0x13fba7['statusCode']==0x1f4){return _0x56c72f[_0xfdf0('0x22')](_0x13fba7[_0xfdf0('0xa9')]);}else{return _0x56c72f['status'](_0x13fba7[_0xfdf0('0xa9')])[_0xfdf0('0xaa')](_0x13fba7['body']);}}else{return _0x56c72f[_0xfdf0('0x22')](0xc8);}})[_0xfdf0('0x50')](handleError(_0x56c72f,null));};exports[_0xfdf0('0xab')]=function(_0x5a183b,_0x4c5e78,_0x5142a6){return BPromise[_0xfdf0('0xa0')]()[_0xfdf0('0x2d')](function(){if(!_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0x54')]){throw new Error(_0xfdf0('0xac'));}if(!_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0xa1')]){throw new Error(_0xfdf0('0xad'));}var _0x1e9f10=_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0xa2')]?_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0xa2')]+':'+_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0xa1')]:_0xfdf0('0xa3')+_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0xa1')];var _0x177824=_0x5a183b['query'][_0xfdf0('0x24')]?_0x5a183b['query'][_0xfdf0('0x24')]:!![];var _0x14162c=_0x5a183b[_0xfdf0('0x39')]['encoding']?_0x5a183b['query']['encoding']:null;var _0x3414a0={'method':_0x5a183b[_0xfdf0('0xa5')],'uri':util['format'](_0xfdf0('0xa6'),_0x1e9f10,_0x5a183b[_0xfdf0('0x39')][_0xfdf0('0x54')]),'json':_0x177824,'resolveWithFullResponse':!![],'encoding':_0x14162c,'body':_0x5a183b[_0xfdf0('0x93')]};if(_0x5a183b[_0xfdf0('0xa7')]){_0x3414a0[_0xfdf0('0xa7')]=_0x5a183b[_0xfdf0('0xa7')];if(_0x3414a0[_0xfdf0('0xa7')][_0xfdf0('0xa8')]){delete _0x3414a0[_0xfdf0('0xa7')][_0xfdf0('0xa8')];}}if(_0x3414a0['headers'][_0xfdf0('0xae')]){delete _0x3414a0[_0xfdf0('0xa7')][_0xfdf0('0xae')];}return rp(_0x3414a0);})[_0xfdf0('0x2d')](function(_0x555ebb){if(_0x555ebb){_0x4c5e78[_0xfdf0('0x28')](_0x555ebb['headers']);logger[_0xfdf0('0x6a')](_0x555ebb[_0xfdf0('0x93')]);return _0x4c5e78['status'](_0x555ebb[_0xfdf0('0xa9')])[_0xfdf0('0xaa')](_0x555ebb['body']);}else{return _0x4c5e78[_0xfdf0('0x22')](0xc8);}})[_0xfdf0('0x50')](handleError(_0x4c5e78,null));}; \ No newline at end of file +var _0xb416=['Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','extname','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','send','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','stack','name','map','Plugin','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','download','path','join','root','server/files/plugins','%s.zip','basename','createWriteStream','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','glob','**/*','dirname','node_modules/**/*','close','existsSync','format'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb416,0xee));var _0x6b41=function(_0x3ad2a1,_0x1e87e6){_0x3ad2a1=_0x3ad2a1-0x0;var _0x1a0f4c=_0xb416[_0x3ad2a1];return _0x1a0f4c;};'use strict';var pdf=require(_0x6b41('0x0'));var emlformat=require(_0x6b41('0x1'));var rimraf=require(_0x6b41('0x2'));var zipdir=require(_0x6b41('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6b41('0x4'));var BPromise=require(_0x6b41('0x5'));var Mustache=require('mustache');var util=require(_0x6b41('0x6'));var path=require('path');var sox=require(_0x6b41('0x7'));var csv=require(_0x6b41('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b41('0x9'));var squel=require(_0x6b41('0xa'));var crypto=require(_0x6b41('0xb'));var jsforce=require(_0x6b41('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b41('0x8'));var querystring=require(_0x6b41('0xd'));var Papa=require(_0x6b41('0xe'));var extract=require(_0x6b41('0xf'));var rimraf=require(_0x6b41('0x2'));var archiver=require('archiver');var Redis=require(_0x6b41('0x10'));var authService=require(_0x6b41('0x11'));var qs=require(_0x6b41('0x12'));var as=require(_0x6b41('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b41('0x14'))(_0x6b41('0x15'));var utils=require(_0x6b41('0x16'));var config=require(_0x6b41('0x17'));var db=require('../../mysqldb')['db'];config[_0x6b41('0x18')]=_[_0x6b41('0x19')](config[_0x6b41('0x18')],{'host':_0x6b41('0x1a'),'port':0x18eb});var socket=require(_0x6b41('0x1b'))(new Redis(config['redis']));require(_0x6b41('0x1c'))['register'](socket);function respondWithStatusCode(_0x2db757,_0x44675a){_0x44675a=_0x44675a||0xcc;return function(_0xf36b26){if(_0xf36b26){return _0x2db757[_0x6b41('0x1d')](_0x44675a);}return _0x2db757[_0x6b41('0x1e')](_0x44675a)[_0x6b41('0x1f')]();};}function respondWithResult(_0x443425,_0x35d076){_0x35d076=_0x35d076||0xc8;return function(_0x11c830){if(_0x11c830){return _0x443425[_0x6b41('0x1e')](_0x35d076)[_0x6b41('0x20')](_0x11c830);}};}function respondWithFilteredResult(_0x1993a0,_0x554f7a){return function(_0x390a72){if(_0x390a72){var _0x216e53=_0x390a72[_0x6b41('0x21')],_0x1d5f67=_0x554f7a[_0x6b41('0x22')],_0x455ad4=_0x554f7a[_0x6b41('0x22')]+_0x554f7a[_0x6b41('0x23')],_0x2bec98;if(_0x455ad4>=_0x216e53){_0x455ad4=_0x216e53;_0x2bec98=0xc8;}else{_0x2bec98=0xce;}_0x1993a0[_0x6b41('0x1e')](_0x2bec98);return _0x1993a0[_0x6b41('0x24')](_0x6b41('0x25'),_0x1d5f67+'-'+_0x455ad4+'/'+_0x216e53)['json'](_0x390a72);}return null;};}function patchUpdates(_0x4eedbc){return function(_0x27915c){try{jsonpatch[_0x6b41('0x26')](_0x27915c,_0x4eedbc,!![]);}catch(_0x5b8bd4){return BPromise[_0x6b41('0x27')](_0x5b8bd4);}return _0x27915c['save']();};}function saveUpdates(_0x3dba5b,_0x2b0afa){return function(_0x30ec1f){if(_0x30ec1f){return _0x30ec1f[_0x6b41('0x28')](_0x3dba5b)['then'](function(_0x29c068){return _0x29c068;});}return null;};}function removeEntity(_0x3868ca,_0x4207b1){return function(_0x5f2b54){if(_0x5f2b54){return _0x5f2b54[_0x6b41('0x29')]()[_0x6b41('0x2a')](function(){var _0x214375=_0x5f2b54[_0x6b41('0x2b')]({'plain':!![]});var _0xaba61e='Plugins';return db[_0x6b41('0x2c')][_0x6b41('0x29')]({'where':{'type':_0xaba61e,'resourceId':_0x214375['id']}})[_0x6b41('0x2a')](function(){return _0x5f2b54;});})[_0x6b41('0x2a')](function(){_0x3868ca[_0x6b41('0x1e')](0xcc)[_0x6b41('0x1f')]();});}};}function handleEntityNotFound(_0x529623,_0x2ac3ff){return function(_0x2b0bca){if(!_0x2b0bca){_0x529623['sendStatus'](0x194);}return _0x2b0bca;};}function handleError(_0x4f5d0a,_0x4df6f9){_0x4df6f9=_0x4df6f9||0x1f4;return function(_0x371ed2){logger['error'](_0x371ed2[_0x6b41('0x2d')]);if(_0x371ed2[_0x6b41('0x2e')]){delete _0x371ed2[_0x6b41('0x2e')];}_0x4f5d0a[_0x6b41('0x1e')](_0x4df6f9)['send'](_0x371ed2);};}exports['index']=function(_0x4257d9,_0x489be4){var _0x7d30d={},_0x282829={},_0xcd8b5={'count':0x0,'rows':[]};var _0x285d07=_[_0x6b41('0x2f')](db[_0x6b41('0x30')]['rawAttributes'],function(_0x36d3d1){return{'name':_0x36d3d1[_0x6b41('0x31')],'type':_0x36d3d1[_0x6b41('0x32')]['key']};});_0x282829[_0x6b41('0x33')]=_[_0x6b41('0x2f')](_0x285d07,_0x6b41('0x2e'));_0x282829[_0x6b41('0x34')]=_[_0x6b41('0x35')](_0x4257d9['query']);_0x282829[_0x6b41('0x36')]=_[_0x6b41('0x37')](_0x282829[_0x6b41('0x33')],_0x282829[_0x6b41('0x34')]);_0x7d30d['attributes']=_['intersection'](_0x282829[_0x6b41('0x33')],qs[_0x6b41('0x38')](_0x4257d9[_0x6b41('0x34')]['fields']));_0x7d30d[_0x6b41('0x39')]=_0x7d30d['attributes'][_0x6b41('0x3a')]?_0x7d30d['attributes']:_0x282829[_0x6b41('0x33')];if(!_0x4257d9[_0x6b41('0x34')][_0x6b41('0x3b')](_0x6b41('0x3c'))){_0x7d30d[_0x6b41('0x23')]=qs['limit'](_0x4257d9['query'][_0x6b41('0x23')]);_0x7d30d['offset']=qs[_0x6b41('0x22')](_0x4257d9[_0x6b41('0x34')][_0x6b41('0x22')]);}_0x7d30d[_0x6b41('0x3d')]=qs['sort'](_0x4257d9[_0x6b41('0x34')][_0x6b41('0x3e')]);_0x7d30d['where']=qs['filters'](_[_0x6b41('0x3f')](_0x4257d9[_0x6b41('0x34')],_0x282829[_0x6b41('0x36')]));if(_0x4257d9[_0x6b41('0x34')][_0x6b41('0x40')]){_0x7d30d['where']=_[_0x6b41('0x41')](_0x7d30d[_0x6b41('0x42')],{'$or':_['map'](_0x285d07,function(_0x478377){if(_0x478377['type']!==_0x6b41('0x43')){var _0x3104dc={};_0x3104dc[_0x478377[_0x6b41('0x2e')]]={'$like':'%'+_0x4257d9['query'][_0x6b41('0x40')]+'%'};return _0x3104dc;}})});}_0x7d30d=_[_0x6b41('0x41')]({},_0x7d30d,_0x4257d9[_0x6b41('0x44')]);var _0xcbd961={'where':_0x7d30d['where']};return db[_0x6b41('0x30')][_0x6b41('0x21')](_0xcbd961)[_0x6b41('0x2a')](function(_0x24800a){_0xcd8b5[_0x6b41('0x21')]=_0x24800a;if(_0x4257d9[_0x6b41('0x34')][_0x6b41('0x45')]){_0x7d30d[_0x6b41('0x46')]=[{'all':!![]}];}return db[_0x6b41('0x30')][_0x6b41('0x47')](_0x7d30d);})[_0x6b41('0x2a')](function(_0x3b0468){_0xcd8b5['rows']=_0x3b0468;return _0xcd8b5;})['then'](respondWithFilteredResult(_0x489be4,_0x7d30d))[_0x6b41('0x48')](handleError(_0x489be4,null));};exports[_0x6b41('0x49')]=function(_0x4d82ef,_0x174914){var _0x1569a8={'raw':!![],'where':{'id':_0x4d82ef[_0x6b41('0x4a')]['id']}},_0xfea3b0={};_0xfea3b0[_0x6b41('0x33')]=_[_0x6b41('0x35')](db[_0x6b41('0x30')][_0x6b41('0x4b')]);_0xfea3b0['query']=_['keys'](_0x4d82ef[_0x6b41('0x34')]);_0xfea3b0[_0x6b41('0x36')]=_[_0x6b41('0x37')](_0xfea3b0['model'],_0xfea3b0[_0x6b41('0x34')]);_0x1569a8['attributes']=_[_0x6b41('0x37')](_0xfea3b0[_0x6b41('0x33')],qs[_0x6b41('0x38')](_0x4d82ef[_0x6b41('0x34')][_0x6b41('0x38')]));_0x1569a8[_0x6b41('0x39')]=_0x1569a8[_0x6b41('0x39')][_0x6b41('0x3a')]?_0x1569a8[_0x6b41('0x39')]:_0xfea3b0['model'];if(_0x4d82ef[_0x6b41('0x34')][_0x6b41('0x45')]){_0x1569a8['include']=[{'all':!![]}];}_0x1569a8=_['merge']({},_0x1569a8,_0x4d82ef[_0x6b41('0x44')]);return db[_0x6b41('0x30')][_0x6b41('0x4c')](_0x1569a8)[_0x6b41('0x2a')](handleEntityNotFound(_0x174914,null))[_0x6b41('0x2a')](respondWithResult(_0x174914,null))[_0x6b41('0x48')](handleError(_0x174914,null));};exports[_0x6b41('0x4d')]=function(_0x12e1eb,_0x4071df,_0x198f01){return db[_0x6b41('0x30')][_0x6b41('0x4c')]({'where':{'id':_0x12e1eb['params']['id']},'attributes':[_0x6b41('0x2e'),_0x6b41('0x4e')],'raw':!![]})[_0x6b41('0x2a')](handleEntityNotFound(_0x4071df,null))[_0x6b41('0x2a')](function(_0x523e64){if(_0x523e64){var _0x38236c=path[_0x6b41('0x4f')](config[_0x6b41('0x50')],_0x6b41('0x51'),util['format'](_0x6b41('0x52'),path[_0x6b41('0x53')](_0x523e64['path'])));var _0x47ac28=fs[_0x6b41('0x54')](_0x38236c);var _0xd172b2=archiver('zip',{'zlib':{'level':0x9}});_0xd172b2['on'](_0x6b41('0x55'),function(_0x49b4a4){if(_0x49b4a4[_0x6b41('0x56')]==='ENOENT'){logger['error'](_0x49b4a4);}else{throw new db[(_0x6b41('0x57'))][(_0x6b41('0x58'))](_0x6b41('0x59'));}});_0xd172b2['on'](_0x6b41('0x5a'),function(_0x42a064){throw new db[(_0x6b41('0x57'))]['Error'](_0x6b41('0x59'));});_0xd172b2['pipe'](_0x47ac28);_0xd172b2[_0x6b41('0x5b')](_0x6b41('0x5c'),{'cwd':path[_0x6b41('0x4f')](config[_0x6b41('0x50')],_0x6b41('0x51'),path[_0x6b41('0x5d')](_0x523e64[_0x6b41('0x4e')])),'ignore':[path[_0x6b41('0x4f')](path['basename'](_0x523e64['path']),_0x6b41('0x5e')),path[_0x6b41('0x4f')](path['basename'](_0x523e64['path']),'attachments/**/*')],'nodir':!![]})['finalize']();_0x47ac28['on'](_0x6b41('0x5f'),function(){if(!fs[_0x6b41('0x60')](_0x38236c)){throw new db[(_0x6b41('0x57'))][(_0x6b41('0x58'))]('Plugin\x20not\x20found');}return _0x4071df[_0x6b41('0x4d')](_0x38236c,util[_0x6b41('0x61')](_0x6b41('0x52'),path[_0x6b41('0x53')](_0x523e64[_0x6b41('0x4e')])),function(_0x7a8598){if(_0x7a8598){throw new db[(_0x6b41('0x57'))]['Error'](_0x6b41('0x62'));}fs[_0x6b41('0x63')](_0x38236c);logger[_0x6b41('0x64')]('Download\x20completed');logger[_0x6b41('0x64')](_0x6b41('0x65'));});});}return null;})[_0x6b41('0x48')](handleError(_0x4071df,null));};exports[_0x6b41('0x66')]=function(_0x166662,_0x598e6a,_0x3ee09c){var _0x4739e6=path[_0x6b41('0x53')](_0x166662['file']['filename'],path[_0x6b41('0x67')](_0x166662[_0x6b41('0x68')][_0x6b41('0x69')]));var _0x1310c5=path[_0x6b41('0x4f')](config['root'],_0x6b41('0x51'),_0x166662[_0x6b41('0x68')][_0x6b41('0x69')]);var _0x207078=path[_0x6b41('0x4f')](config[_0x6b41('0x50')],_0x6b41('0x51'),_0x4739e6);logger[_0x6b41('0x64')](_0x6b41('0x6a'),_0x1310c5);logger[_0x6b41('0x64')](_0x6b41('0x6b'),_0x207078);try{fs[_0x6b41('0x6c')](_0x1310c5,parseInt(_0x6b41('0x6d'),0x8));extract(_0x1310c5,{'dir':_0x207078},function(_0x4eb36c){if(_0x4eb36c){logger[_0x6b41('0x5a')](_0x4eb36c);handleError(_0x4eb36c,!![]);};var _0x29d5b8=fs[_0x6b41('0x6e')](_0x207078);if(_0x29d5b8[_0x6b41('0x3a')]>0x1){removeReferences(_0x1310c5,_0x207078);logger['error'](_0x6b41('0x6f'));return _0x3ee09c(new Error(_0x6b41('0x6f')));}var _0xe1cf9d=fs[_0x6b41('0x70')](path[_0x6b41('0x4f')](_0x207078,_0x29d5b8[0x0]));if(_0xe1cf9d['isFile']()){removeReferences(_0x1310c5,_0x207078);logger[_0x6b41('0x5a')]('Invalid\x20plugin\x20structure');return _0x3ee09c(new Error('Invalid\x20plugin\x20structure'));}if(_0xe1cf9d[_0x6b41('0x71')]()){var _0x4ce2eb=fs[_0x6b41('0x6e')](path[_0x6b41('0x4f')](_0x207078,_0x29d5b8[0x0]));if(_0x4ce2eb[_0x6b41('0x3a')]===0x0){removeReferences(_0x1310c5,_0x207078);logger['error'](_0x6b41('0x6f'));return _0x3ee09c(new Error(_0x6b41('0x6f')));}var _0x2fcd89=_0x4ce2eb[_0x6b41('0x72')](function(_0xbd7391){return _0xbd7391===_0x6b41('0x73');});if(!_0x2fcd89){return _0x3ee09c(new Error(_0x6b41('0x74')));}var _0x401f66=fs[_0x6b41('0x75')](path[_0x6b41('0x4f')](_0x207078,_0x29d5b8[0x0],'manifest.json'));var _0x25a8d3=JSON[_0x6b41('0x76')](_0x401f66);if(_0x6b41('0x77')==typeof _0x25a8d3[_0x6b41('0x2e')]){return _0x3ee09c(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x6b41('0x77')==typeof _0x25a8d3[_0x6b41('0x32')]){return _0x3ee09c(new Error(_0x6b41('0x78')));}if(_0x6b41('0x77')==typeof _0x25a8d3['version']){return _0x3ee09c(new Error(_0x6b41('0x79')));}if('undefined'==typeof _0x25a8d3[_0x6b41('0x7a')]){return _0x3ee09c(new Error(_0x6b41('0x7b')));}if(_0x25a8d3[_0x6b41('0x32')]===_0x6b41('0x7c')){if(_0x6b41('0x77')==typeof _0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x7d')]){return _0x3ee09c(new Error(_0x6b41('0x7e')));}if('undefined'==typeof _0x25a8d3[_0x6b41('0x7a')]['views'][_0x6b41('0x7f')]&&_0x6b41('0x77')==typeof _0x25a8d3['parameters'][_0x6b41('0x7d')]['agent']){return _0x3ee09c(new Error(_0x6b41('0x80')));}}else if(_0x25a8d3[_0x6b41('0x32')]===_0x6b41('0x81')){if(_0x6b41('0x77')==typeof _0x25a8d3['parameters'][_0x6b41('0x82')]){return _0x3ee09c(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x83')]){return _0x3ee09c(new Error(_0x6b41('0x84')));}}else{return _0x3ee09c(new Error(_0x6b41('0x85')));}var _0x576e1a=_0x25a8d3[_0x6b41('0x2e')];var _0x32d521=_0x25a8d3['description'];var _0x4ab498=_0x25a8d3['type'];var _0x52bac0=_0x25a8d3[_0x6b41('0x86')]?_0x25a8d3[_0x6b41('0x86')]:_0x6b41('0x87');var _0x2af843=_0x25a8d3[_0x6b41('0x88')]?_0x25a8d3[_0x6b41('0x88')]:'icon-apps';var _0x36d4e7='';var _0x30bfb0='';var _0x5d57c1='';var _0x4d1166='';var _0x2c5197=_0x25a8d3['version'];if(_0x4ab498===_0x6b41('0x7c')){if(_0x6b41('0x77')!=typeof _0x25a8d3['parameters']['views']['admin']){var _0x23424a=_0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x7d')][_0x6b41('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x6b41('0x89')](_0x23424a)){_0x36d4e7=path['join']('plugins',_0x4739e6,_0x29d5b8[0x0],_0x23424a);}else{_0x36d4e7=_0x23424a;}}else{logger[_0x6b41('0x64')](_0x6b41('0x8a'));}if(_0x6b41('0x77')!=typeof _0x25a8d3[_0x6b41('0x7a')]['views'][_0x6b41('0x8b')]){var _0x41cdc0=_0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x7d')][_0x6b41('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x41cdc0)){_0x30bfb0=path['join'](_0x6b41('0x8c'),_0x4739e6,_0x29d5b8[0x0],_0x41cdc0);}else{_0x30bfb0=_0x41cdc0;}}else{logger[_0x6b41('0x64')](_0x6b41('0x8d'));}}else if(_0x4ab498==='script'){_0x5d57c1=_0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x82')];_0x4d1166=_0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x83')];if(_0x6b41('0x77')!=typeof _0x25a8d3[_0x6b41('0x7a')]['views']){if('undefined'!=typeof _0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x7d')][_0x6b41('0x7f')]){var _0x23424a=_0x25a8d3['parameters'][_0x6b41('0x7d')][_0x6b41('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x6b41('0x89')](_0x23424a)){_0x36d4e7=path[_0x6b41('0x4f')]('plugins',_0x4739e6,_0x29d5b8[0x0],_0x23424a);}else{_0x36d4e7=_0x23424a;}}if(_0x6b41('0x77')!=typeof _0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x7d')][_0x6b41('0x8b')]){var _0x41cdc0=_0x25a8d3[_0x6b41('0x7a')][_0x6b41('0x7d')][_0x6b41('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x6b41('0x89')](_0x41cdc0)){_0x30bfb0=path[_0x6b41('0x4f')]('plugins',_0x4739e6,_0x29d5b8[0x0],_0x41cdc0);}else{_0x30bfb0=_0x41cdc0;}}}}var _0x2b7354={'name':_0x576e1a,'description':_0x32d521,'path':path[_0x6b41('0x4f')](_0x4739e6,_0x29d5b8[0x0]),'type':_0x4ab498,'sidebar':_0x52bac0,'icon':_0x2af843,'adminUrl':_0x36d4e7,'agentUrl':_0x30bfb0,'scriptName':_0x5d57c1,'scriptPath':_0x4d1166,'version':_0x2c5197};removeReferences(_0x1310c5,null);return db['Plugin'][_0x6b41('0x8e')](_0x2b7354)['then'](function(_0x2bc8fd){var _0x5e4a13={'role':_0x166662[_0x6b41('0x8f')][_0x6b41('0x90')],'userProfileId':_0x166662[_0x6b41('0x8f')]['userProfileId']};if(!_0x5e4a13)throw new Error(_0x6b41('0x91'));if(_0x5e4a13[_0x6b41('0x90')]===_0x6b41('0x92')){var _0x558fd3=_0x2bc8fd['get']({'plain':!![]});return db[_0x6b41('0x93')][_0x6b41('0x4c')]({'where':{'name':_0x6b41('0x94'),'userProfileId':_0x5e4a13[_0x6b41('0x95')]},'raw':!![]})[_0x6b41('0x2a')](function(_0x464ba8){if(_0x464ba8&&_0x464ba8[_0x6b41('0x96')]===0x0){return db[_0x6b41('0x2c')][_0x6b41('0x8e')]({'name':_0x558fd3[_0x6b41('0x2e')],'resourceId':_0x558fd3['id'],'type':_0x464ba8[_0x6b41('0x2e')],'sectionId':_0x464ba8['id']},{})[_0x6b41('0x2a')](function(){return _0x2bc8fd;});}else{return _0x2bc8fd;}})[_0x6b41('0x48')](function(_0x3325f5){logger[_0x6b41('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3325f5);throw _0x3325f5;});}return _0x2bc8fd;})['then'](respondWithResult(_0x598e6a,null))[_0x6b41('0x48')](handleError(_0x598e6a,null));}});}catch(_0x32d200){_0x598e6a[_0x6b41('0x1e')](0x1f4)['send'](_0x32d200);}};function removeReferences(_0x380c61,_0x294d77){try{if(_0x380c61){fs[_0x6b41('0x63')](_0x380c61);logger[_0x6b41('0x64')](_0x6b41('0x97'));}if(_0x294d77){rimraf(_0x294d77,function(){});logger[_0x6b41('0x64')](_0x6b41('0x98'));}}catch(_0x5985ec){logger[_0x6b41('0x5a')](_0x5985ec);}}exports[_0x6b41('0x28')]=function(_0x307d28,_0x182a69,_0x24e75e){return db[_0x6b41('0x30')][_0x6b41('0x4c')]({'where':{'id':_0x307d28[_0x6b41('0x4a')]['id']}})[_0x6b41('0x2a')](handleEntityNotFound(_0x182a69,null))['then'](saveUpdates(_0x307d28[_0x6b41('0x8f')],null))['then'](respondWithResult(_0x182a69,null))['catch'](handleError(_0x182a69,null));};exports[_0x6b41('0x99')]=function(_0x5c4476,_0x584836,_0x4120a9){return db[_0x6b41('0x30')][_0x6b41('0x4c')]({'where':{'id':_0x5c4476[_0x6b41('0x4a')]['id']}})['then'](function(_0x57fa32){if(_0x57fa32){return _0x57fa32[_0x6b41('0x29')]();}})[_0x6b41('0x2a')](function(_0xed03c9){rimraf(path[_0x6b41('0x4f')](config[_0x6b41('0x50')],_0x6b41('0x51'),path[_0x6b41('0x5d')](_0xed03c9[_0x6b41('0x4e')])),function(){});return _0xed03c9;})[_0x6b41('0x2a')](handleEntityNotFound(_0x584836,null))[_0x6b41('0x2a')](respondWithStatusCode(_0x584836,null))[_0x6b41('0x48')](handleError(_0x584836,null));};exports['webhookGet']=function(_0x4f3c94,_0x241e9d,_0x1bcd1d){return BPromise['resolve']()[_0x6b41('0x2a')](function(){if(!_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x4e')]){throw new Error(_0x6b41('0x9a'));}if(!_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4d001f=_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x9c')]?_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x9c')]+':'+_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x9b')]:_0x6b41('0x9d')+_0x4f3c94[_0x6b41('0x34')]['port'];var _0x1e76e6=_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x20')]?_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x20')]:!![];var _0x176a47=_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x9e')]?_0x4f3c94[_0x6b41('0x34')]['encoding']:null;var _0x47bda1={'method':_0x4f3c94['method'],'uri':util[_0x6b41('0x61')](_0x6b41('0x9f'),_0x4d001f,_0x4f3c94[_0x6b41('0x34')]['path']),'json':_0x1e76e6,'resolveWithFullResponse':!![],'encoding':_0x176a47,'qs':_0x4f3c94[_0x6b41('0x34')]};if(_0x4f3c94[_0x6b41('0xa0')]){_0x47bda1[_0x6b41('0xa0')]=_0x4f3c94['headers'];if(_0x47bda1['headers']['content-length']){delete _0x47bda1[_0x6b41('0xa0')][_0x6b41('0xa1')];}}if(_0x47bda1[_0x6b41('0xa0')][_0x6b41('0xa2')]){delete _0x47bda1[_0x6b41('0xa0')][_0x6b41('0xa2')];}return rp(_0x47bda1);})['then'](function(_0x44ac80){if(_0x44ac80){_0x241e9d[_0x6b41('0x24')](_0x44ac80[_0x6b41('0xa0')]);logger['info'](_0x44ac80['body']);if(_[_0x6b41('0xa3')](_0x4f3c94[_0x6b41('0x34')][_0x6b41('0x4e')],_0x6b41('0x4d'))&&_0x44ac80['statusCode']==0x1f4){return _0x241e9d['sendStatus'](_0x44ac80[_0x6b41('0xa4')]);}else{return _0x241e9d[_0x6b41('0x1e')](_0x44ac80[_0x6b41('0xa4')])['send'](_0x44ac80[_0x6b41('0x8f')]);}}else{return _0x241e9d[_0x6b41('0x1d')](0xc8);}})[_0x6b41('0x48')](handleError(_0x241e9d,null));};exports[_0x6b41('0xa5')]=function(_0x408e7d,_0x7239a9,_0xd1673f){return BPromise[_0x6b41('0xa6')]()['then'](function(){if(!_0x408e7d['query'][_0x6b41('0x4e')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x408e7d[_0x6b41('0x34')][_0x6b41('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3774ac=_0x408e7d['query']['hostname']?_0x408e7d[_0x6b41('0x34')][_0x6b41('0x9c')]+':'+_0x408e7d[_0x6b41('0x34')][_0x6b41('0x9b')]:'http://localhost:'+_0x408e7d[_0x6b41('0x34')][_0x6b41('0x9b')];var _0x2246d8=_0x408e7d[_0x6b41('0x34')][_0x6b41('0x20')]?_0x408e7d[_0x6b41('0x34')][_0x6b41('0x20')]:!![];var _0x529e3e=_0x408e7d[_0x6b41('0x34')][_0x6b41('0x9e')]?_0x408e7d[_0x6b41('0x34')][_0x6b41('0x9e')]:null;var _0x24d4bc={'method':_0x408e7d['method'],'uri':util[_0x6b41('0x61')](_0x6b41('0x9f'),_0x3774ac,_0x408e7d[_0x6b41('0x34')]['path']),'json':_0x2246d8,'resolveWithFullResponse':!![],'encoding':_0x529e3e,'body':_0x408e7d[_0x6b41('0x8f')]};if(_0x408e7d[_0x6b41('0xa0')]){_0x24d4bc['headers']=_0x408e7d['headers'];if(_0x24d4bc[_0x6b41('0xa0')][_0x6b41('0xa1')]){delete _0x24d4bc[_0x6b41('0xa0')]['content-length'];}}if(_0x24d4bc['headers']['content-type']){delete _0x24d4bc[_0x6b41('0xa0')]['content-type'];}return rp(_0x24d4bc);})[_0x6b41('0x2a')](function(_0x4426d4){if(_0x4426d4){_0x7239a9[_0x6b41('0x24')](_0x4426d4[_0x6b41('0xa0')]);logger['info'](_0x4426d4[_0x6b41('0x8f')]);return _0x7239a9[_0x6b41('0x1e')](_0x4426d4[_0x6b41('0xa4')])[_0x6b41('0xa7')](_0x4426d4['body']);}else{return _0x7239a9[_0x6b41('0x1d')](0xc8);}})[_0x6b41('0x48')](handleError(_0x7239a9,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1f6501f..282c619 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 _0xfb11=['hasOwnProperty','exports','events','Plugin','setMaxListeners','update','emit'];(function(_0x3b1a88,_0x2e5222){var _0x16d65f=function(_0x4becb9){while(--_0x4becb9){_0x3b1a88['push'](_0x3b1a88['shift']());}};_0x16d65f(++_0x2e5222);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xfb11[_0x5447fd];return _0x15b28a;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var Plugin=require('../../mysqldb')['db'][_0x1fb1('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x1fb1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18108f){return function(_0x5a830e,_0x190f74,_0x2ae20f){PluginEvents['emit'](_0x18108f+':'+_0x5a830e['id'],_0x5a830e);PluginEvents[_0x1fb1('0x4')](_0x18108f,_0x5a830e);_0x2ae20f(null);};}for(var e in events){if(events[_0x1fb1('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x1fb1('0x6')]=PluginEvents; \ No newline at end of file +var _0x0adf=['Plugin','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x41100,_0x212891){var _0x4b4934=function(_0x597547){while(--_0x597547){_0x41100['push'](_0x41100['shift']());}};_0x4b4934(++_0x212891);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x7e2f65,_0x408b78){_0x7e2f65=_0x7e2f65-0x0;var _0x15460c=_0x0adf[_0x7e2f65];return _0x15460c;};'use strict';var EventEmitter=require(_0xf0ad('0x0'));var Plugin=require(_0xf0ad('0x1'))['db'][_0xf0ad('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ad('0x3'),'afterUpdate':_0xf0ad('0x4'),'afterDestroy':_0xf0ad('0x5')};function emitEvent(_0x187aa4){return function(_0x27d666,_0x459e70,_0x719547){PluginEvents['emit'](_0x187aa4+':'+_0x27d666['id'],_0x27d666);PluginEvents[_0xf0ad('0x6')](_0x187aa4,_0x27d666);_0x719547(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xf0ad('0x7')](e,emitEvent(event));}}module[_0xf0ad('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e2c1b12..be983a9 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 _0xa630=['define','Plugin','plugins','lodash','util','moment','request-promise','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x2caa1b,_0x133ae9){_0x2caa1b=_0x2caa1b-0x0;var _0x2feebb=_0xa630[_0x2caa1b];return _0x2feebb;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));module[_0x0a63('0x7')]=function(_0x37b4c9,_0x4b7474){return _0x37b4c9[_0x0a63('0x8')](_0x0a63('0x9'),attributes,{'tableName':_0x0a63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24ca=['Plugin','plugins','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x5d91c1,_0x1cd55f){var _0x19c74e=function(_0x4e4c0e){while(--_0x4e4c0e){_0x5d91c1['push'](_0x5d91c1['shift']());}};_0x19c74e(++_0x1cd55f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x24ca[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 6d5672b..00dda06 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 _0xc4e0=['Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','body','raw','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info'];(function(_0x764fbb,_0x9b8ad2){var _0x11b040=function(_0x45adca){while(--_0x45adca){_0x764fbb['push'](_0x764fbb['shift']());}};_0x11b040(++_0x9b8ad2);}(_0xc4e0,0xc1));var _0x0c4e=function(_0x575c8f,_0x3cc9c1){_0x575c8f=_0x575c8f-0x0;var _0x2f5f58=_0xc4e0[_0x575c8f];return _0x2f5f58;};'use strict';var _=require(_0x0c4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c4e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c4e('0x2'))['db'];var utils=require(_0x0c4e('0x3'));var logger=require('../../config/logger')(_0x0c4e('0x4'));var config=require(_0x0c4e('0x5'));var jayson=require(_0x0c4e('0x6'));var client=jayson[_0x0c4e('0x7')][_0x0c4e('0x8')]({'port':0x232a});config[_0x0c4e('0x9')]=_[_0x0c4e('0xa')](config[_0x0c4e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c4e('0xb'))(new Redis(config[_0x0c4e('0x9')]));require(_0x0c4e('0xc'))[_0x0c4e('0xd')](socket);function respondWithRpcPromise(_0xcae912,_0x2df026,_0x367284){return new BPromise(function(_0x36ccf4,_0x58648b){return client[_0x0c4e('0xe')](_0xcae912,_0x367284)[_0x0c4e('0xf')](function(_0x9b3368){logger[_0x0c4e('0x10')](_0x0c4e('0x11'),_0x2df026,'request\x20sent');logger['debug'](_0x0c4e('0x12'),_0x2df026,_0x0c4e('0x13'),JSON[_0x0c4e('0x14')](_0x9b3368));if(_0x9b3368[_0x0c4e('0x15')]){if(_0x9b3368[_0x0c4e('0x15')][_0x0c4e('0x16')]===0x1f4){logger['error'](_0x0c4e('0x11'),_0x2df026,_0x9b3368[_0x0c4e('0x15')]['message']);return _0x58648b(_0x9b3368[_0x0c4e('0x15')][_0x0c4e('0x17')]);}logger[_0x0c4e('0x15')]('Plugin,\x20%s,\x20%s',_0x2df026,_0x9b3368[_0x0c4e('0x15')][_0x0c4e('0x17')]);return _0x36ccf4(_0x9b3368['error']['message']);}else{logger[_0x0c4e('0x10')](_0x0c4e('0x11'),_0x2df026,_0x0c4e('0x13'));_0x36ccf4(_0x9b3368[_0x0c4e('0x18')]['message']);}})[_0x0c4e('0x19')](function(_0x589771){logger['error']('Plugin,\x20%s,\x20%s',_0x2df026,_0x589771);_0x58648b(_0x589771);});});}exports[_0x0c4e('0x1a')]=function(_0x813f0d){var _0x4ba669=this;return new Promise(function(_0x109b97,_0x29f73e){return db[_0x0c4e('0x1b')]['create'](_0x813f0d[_0x0c4e('0x1c')],{'raw':_0x813f0d['options']?_0x813f0d['options'][_0x0c4e('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x565dda){logger[_0x0c4e('0x10')]('CreatePlugin',_0x813f0d);logger['debug'](_0x0c4e('0x1a'),_0x813f0d,JSON[_0x0c4e('0x14')](_0x565dda));_0x109b97(_0x565dda);})['catch'](function(_0x1aae5e){logger[_0x0c4e('0x15')](_0x0c4e('0x1a'),_0x1aae5e[_0x0c4e('0x17')],_0x813f0d);_0x29f73e(_0x4ba669['error'](0x1f4,_0x1aae5e['message']));});});}; \ No newline at end of file +var _0x1871=['options','raw','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreatePlugin','create'];(function(_0x188d5c,_0x2f113e){var _0x104d75=function(_0x3776b7){while(--_0x3776b7){_0x188d5c['push'](_0x188d5c['shift']());}};_0x104d75(++_0x2f113e);}(_0x1871,0x99));var _0x1187=function(_0x19f7fd,_0x5e74a9){_0x19f7fd=_0x19f7fd-0x0;var _0x3b2b0d=_0x1871[_0x19f7fd];return _0x3b2b0d;};'use strict';var _=require(_0x1187('0x0'));var util=require(_0x1187('0x1'));var moment=require('moment');var BPromise=require(_0x1187('0x2'));var rs=require(_0x1187('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1187('0x4'))['db'];var utils=require(_0x1187('0x5'));var logger=require(_0x1187('0x6'))(_0x1187('0x7'));var config=require(_0x1187('0x8'));var jayson=require(_0x1187('0x9'));var client=jayson['client'][_0x1187('0xa')]({'port':0x232a});config['redis']=_[_0x1187('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1187('0xc'))(new Redis(config[_0x1187('0xd')]));require(_0x1187('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f4a6c,_0x550f33,_0x218f8f){return new BPromise(function(_0x467f83,_0xe50caa){return client[_0x1187('0xf')](_0x4f4a6c,_0x218f8f)[_0x1187('0x10')](function(_0x1cd82a){logger['info'](_0x1187('0x11'),_0x550f33,'request\x20sent');logger[_0x1187('0x12')](_0x1187('0x13'),_0x550f33,_0x1187('0x14'),JSON['stringify'](_0x1cd82a));if(_0x1cd82a['error']){if(_0x1cd82a[_0x1187('0x15')]['code']===0x1f4){logger[_0x1187('0x15')]('Plugin,\x20%s,\x20%s',_0x550f33,_0x1cd82a[_0x1187('0x15')][_0x1187('0x16')]);return _0xe50caa(_0x1cd82a[_0x1187('0x15')][_0x1187('0x16')]);}logger[_0x1187('0x15')](_0x1187('0x11'),_0x550f33,_0x1cd82a[_0x1187('0x15')]['message']);return _0x467f83(_0x1cd82a['error'][_0x1187('0x16')]);}else{logger[_0x1187('0x17')](_0x1187('0x11'),_0x550f33,'request\x20sent');_0x467f83(_0x1cd82a['result'][_0x1187('0x16')]);}})[_0x1187('0x18')](function(_0x383cfd){logger[_0x1187('0x15')]('Plugin,\x20%s,\x20%s',_0x550f33,_0x383cfd);_0xe50caa(_0x383cfd);});});}exports[_0x1187('0x19')]=function(_0x270590){var _0x1f8591=this;return new Promise(function(_0x2f8226,_0x62c0ea){return db['Plugin'][_0x1187('0x1a')](_0x270590['body'],{'raw':_0x270590[_0x1187('0x1b')]?_0x270590[_0x1187('0x1b')][_0x1187('0x1c')]===undefined?!![]:![]:!![]})[_0x1187('0x10')](function(_0xf358e7){logger[_0x1187('0x17')](_0x1187('0x19'),_0x270590);logger[_0x1187('0x12')](_0x1187('0x19'),_0x270590,JSON[_0x1187('0x1d')](_0xf358e7));_0x2f8226(_0xf358e7);})[_0x1187('0x18')](function(_0x21c3cd){logger[_0x1187('0x15')](_0x1187('0x19'),_0x21c3cd[_0x1187('0x16')],_0x270590);_0x62c0ea(_0x1f8591[_0x1187('0x15')](0x1f4,_0x21c3cd[_0x1187('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 380a5bb..bb0efa8 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 _0xc264=['remove','update','emit','removeListener','register','plugin:','./plugin.events','save'];(function(_0x178d2c,_0x367647){var _0x2fac2a=function(_0x1e4bfd){while(--_0x1e4bfd){_0x178d2c['push'](_0x178d2c['shift']());}};_0x2fac2a(++_0x367647);}(_0xc264,0x1a6));var _0x4c26=function(_0xf7f60a,_0x15f736){_0xf7f60a=_0xf7f60a-0x0;var _0x2567ad=_0xc264[_0xf7f60a];return _0x2567ad;};'use strict';var PluginEvents=require(_0x4c26('0x0'));var events=[_0x4c26('0x1'),_0x4c26('0x2'),_0x4c26('0x3')];function createListener(_0x4ba294,_0x20b3fa){return function(_0x2a7da4){_0x20b3fa[_0x4c26('0x4')](_0x4ba294,_0x2a7da4);};}function removeListener(_0x1b226c,_0x4dd12b){return function(){PluginEvents[_0x4c26('0x5')](_0x1b226c,_0x4dd12b);};}exports[_0x4c26('0x6')]=function(_0xe07456){for(var _0xcc60a7=0x0,_0x208947=events['length'];_0xcc60a7<_0x208947;_0xcc60a7++){var _0x3c1a8f=events[_0xcc60a7];var _0x4fabcd=createListener(_0x4c26('0x7')+_0x3c1a8f,_0xe07456);PluginEvents['on'](_0x3c1a8f,_0x4fabcd);}}; \ No newline at end of file +var _0x6a01=['update','emit','removeListener','length','./plugin.events','save','remove'];(function(_0x1e7978,_0x474d70){var _0x27b64f=function(_0x2cdc42){while(--_0x2cdc42){_0x1e7978['push'](_0x1e7978['shift']());}};_0x27b64f(++_0x474d70);}(_0x6a01,0x170));var _0x16a0=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0x6a01[_0x1aae33];return _0x2e91e9;};'use strict';var PluginEvents=require(_0x16a0('0x0'));var events=[_0x16a0('0x1'),_0x16a0('0x2'),_0x16a0('0x3')];function createListener(_0x509e4d,_0x164ccd){return function(_0x17c5b9){_0x164ccd[_0x16a0('0x4')](_0x509e4d,_0x17c5b9);};}function removeListener(_0x48f2b4,_0x41fb2b){return function(){PluginEvents[_0x16a0('0x5')](_0x48f2b4,_0x41fb2b);};}exports['register']=function(_0x2f3495){for(var _0x5c465b=0x0,_0x293c60=events[_0x16a0('0x6')];_0x5c465b<_0x293c60;_0x5c465b++){var _0x148fec=events[_0x5c465b];var _0x26eb64=createListener('plugin:'+_0x148fec,_0x2f3495);PluginEvents['on'](_0x148fec,_0x26eb64);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0344e6c..e0bcaef 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 _0x01fe=['update','destroy','exports','express','Router','get','isAuthenticated','/:id','show','post','create'];(function(_0xaa7629,_0x219723){var _0x487c07=function(_0x36959c){while(--_0x36959c){_0xaa7629['push'](_0xaa7629['shift']());}};_0x487c07(++_0x219723);}(_0x01fe,0x1a5));var _0xe01f=function(_0x14f119,_0x1d3098){_0x14f119=_0x14f119-0x0;var _0x29a068=_0x01fe[_0x14f119];return _0x29a068;};'use strict';var express=require(_0xe01f('0x0'));var router=express[_0xe01f('0x1')]();var auth=require('../../components/auth/service');var controller=require('./pm2.controller');router[_0xe01f('0x2')]('/',auth[_0xe01f('0x3')](),controller['index']);router[_0xe01f('0x2')](_0xe01f('0x4'),auth[_0xe01f('0x3')](),controller[_0xe01f('0x5')]);router[_0xe01f('0x6')]('/',auth[_0xe01f('0x3')](),controller[_0xe01f('0x7')]);router['put'](_0xe01f('0x4'),auth[_0xe01f('0x3')](),controller[_0xe01f('0x8')]);router['delete']('/:id',auth[_0xe01f('0x3')](),controller[_0xe01f('0x9')]);module[_0xe01f('0xa')]=router; \ No newline at end of file +var _0x2bf8=['create','put','isAuthenticated','update','delete','destroy','exports','express','Router','get','index','/:id','show'];(function(_0x56e2a0,_0x13b891){var _0x1b3b78=function(_0x79e8b1){while(--_0x79e8b1){_0x56e2a0['push'](_0x56e2a0['shift']());}};_0x1b3b78(++_0x13b891);}(_0x2bf8,0x19a));var _0x82bf=function(_0xf759e3,_0x6fe18c){_0xf759e3=_0xf759e3-0x0;var _0xff6c1f=_0x2bf8[_0xf759e3];return _0xff6c1f;};'use strict';var express=require(_0x82bf('0x0'));var router=express[_0x82bf('0x1')]();var auth=require('../../components/auth/service');var controller=require('./pm2.controller');router[_0x82bf('0x2')]('/',auth['isAuthenticated'](),controller[_0x82bf('0x3')]);router[_0x82bf('0x2')](_0x82bf('0x4'),auth['isAuthenticated'](),controller[_0x82bf('0x5')]);router['post']('/',auth['isAuthenticated'](),controller[_0x82bf('0x6')]);router[_0x82bf('0x7')]('/:id',auth[_0x82bf('0x8')](),controller[_0x82bf('0x9')]);router[_0x82bf('0xa')]('/:id',auth[_0x82bf('0x8')](),controller[_0x82bf('0xb')]);module[_0x82bf('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 73ed328..4b0a8d8 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 _0x01b8=['then','reject','motion2','length','show','describe','catch','create','body','script','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','stack','name','send','npm\x20install','index','list'];(function(_0x2b4757,_0x2e5159){var _0x5e143a=function(_0x49e0fb){while(--_0x49e0fb){_0x2b4757['push'](_0x2b4757['shift']());}};_0x5e143a(++_0x2e5159);}(_0x01b8,0x189));var _0x801b=function(_0x569a45,_0x2da15b){_0x569a45=_0x569a45-0x0;var _0x1a5ef8=_0x01b8[_0x569a45];return _0x1a5ef8;};'use strict';var _=require(_0x801b('0x0'));var pm2=require(_0x801b('0x1'));var logger=require(_0x801b('0x2'))(_0x801b('0x3'));var path=require('path');var exec=require(_0x801b('0x4'))['exec'];var BPromise=require(_0x801b('0x5'));function handleEntityNotFound(_0x295aae,_0x4c1f3c){return function(_0x295957){if(!_0x295957){_0x295aae[_0x801b('0x6')](0x194);;}return _0x295957;};}function respondWithResult(_0x1d3168,_0x5bf07a){_0x5bf07a=_0x5bf07a||0xc8;return function(_0x2b019a){if(_0x2b019a){return _0x1d3168[_0x801b('0x7')](_0x5bf07a)['json'](_0x2b019a);}return null;};}function handleError(_0x49c1e0,_0x2e2fa9){_0x2e2fa9=_0x2e2fa9||0x1f4;return function(_0x54e1e6){logger['error'](_0x54e1e6[_0x801b('0x8')]);if(_0x54e1e6[_0x801b('0x9')]){delete _0x54e1e6[_0x801b('0x9')];}_0x49c1e0[_0x801b('0x7')](_0x2e2fa9)[_0x801b('0xa')](_0x54e1e6);};}function execChildProcess(){return new BPromise(function(_0x262476,_0x5ef1b1){exec(_0x801b('0xb'),function(_0x258cbd,_0x498c53,_0x1b7a9b){logger['info'](_0x498c53);logger['info'](_0x1b7a9b);if(_0x258cbd){logger['error'](_0x258cbd);return _0x5ef1b1(_0x258cbd);}return _0x262476(_0x498c53);});});}exports[_0x801b('0xc')]=function(_0x31bea5,_0x42ef34){return pm2[_0x801b('0xd')]()[_0x801b('0xe')](function(_0x21cf17){if(_0x21cf17){var _0x139547=_[_0x801b('0xf')](_0x21cf17,function(_0x530f32){return _0x530f32['name']==='express'||_0x530f32[_0x801b('0x9')]===_0x801b('0x10');});return{'rows':_0x139547,'count':_0x139547[_0x801b('0x11')]};}return null;})['then'](respondWithResult(_0x42ef34,null))['catch'](handleError(_0x42ef34,null));};exports[_0x801b('0x12')]=function(_0x171fb9,_0x10d5ee){return pm2[_0x801b('0x13')](_0x171fb9['params']['id'])[_0x801b('0xe')](respondWithResult(_0x10d5ee,null))[_0x801b('0xe')](handleEntityNotFound(_0x10d5ee,null))[_0x801b('0x14')](handleError(_0x10d5ee,null));};exports[_0x801b('0x15')]=function(_0x26663e,_0x2050b4){if(_0x26663e[_0x801b('0x16')][_0x801b('0x9')]&&_0x26663e[_0x801b('0x16')][_0x801b('0x17')]){var _0x5a38e1=path['join'](__dirname,_0x801b('0x18'),_0x26663e[_0x801b('0x16')][_0x801b('0x17')]);var _0x1829bb=process['cwd']();process['chdir'](path['dirname'](_0x5a38e1));return execChildProcess()['then'](function(_0x1624f3){process[_0x801b('0x19')](_0x1829bb);return pm2[_0x801b('0x1a')]({'name':_0x26663e[_0x801b('0x16')][_0x801b('0x9')],'script':_0x5a38e1});})[_0x801b('0xe')](function(_0x4ef17d){pm2[_0x801b('0x1b')]();return _0x4ef17d[0x0];})[_0x801b('0xe')](respondWithResult(_0x2050b4,0xc9))[_0x801b('0x14')](handleError(_0x2050b4,null));}else{return _0x2050b4[_0x801b('0x7')](0x1f4)[_0x801b('0xa')]({'message':_0x801b('0x1c')});}};exports[_0x801b('0x1d')]=function(_0x45e4c1,_0x2ae561){if(_0x45e4c1['body']['id']){delete _0x45e4c1[_0x801b('0x16')]['id'];}var _0x54aa6a={'online':_0x801b('0x1e'),'stopped':_0x801b('0x1f')};if(_0x54aa6a[_0x801b('0x20')](_0x45e4c1[_0x801b('0x16')][_0x801b('0x7')])){return pm2[_0x54aa6a[_0x45e4c1[_0x801b('0x16')][_0x801b('0x7')]]](_0x45e4c1[_0x801b('0x21')]['id'])['then'](respondWithResult(_0x2ae561,0xc8))[_0x801b('0x14')](handleError(_0x2ae561,null));}else{return _0x2ae561[_0x801b('0x7')](0x1f4)[_0x801b('0xa')]({'message':_0x801b('0x22')});}};exports[_0x801b('0x23')]=function(_0x521617,_0x36635b){if(_0x521617['body']['id']){delete _0x521617[_0x801b('0x16')]['id'];}if(_0x521617[_0x801b('0x21')]['id']){return pm2['delete'](_0x521617['params']['id'])[_0x801b('0xe')](function(_0x5f4581){pm2[_0x801b('0x1b')]();return _0x5f4581[0x0];})[_0x801b('0xe')](respondWithResult(_0x36635b,null))[_0x801b('0x14')](handleError(_0x36635b,null));}else{return _0x36635b[_0x801b('0x7')](0x1f4)[_0x801b('0xa')]({'message':_0x801b('0x24')});}}; \ No newline at end of file +var _0x99c9=['describe','params','create','body','script','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','delete','Unknown\x20id','lodash','../../config/logger','path','exec','bluebird','json','error','name','status','send','npm\x20install','info','list','then','reject','length','catch'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0x99c9,0x10f));var _0x999c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x99c9[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x999c('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x999c('0x1'))('api');var path=require(_0x999c('0x2'));var exec=require('child_process')[_0x999c('0x3')];var BPromise=require(_0x999c('0x4'));function handleEntityNotFound(_0x36430d,_0x2dc42f){return function(_0x22402a){if(!_0x22402a){_0x36430d['sendStatus'](0x194);;}return _0x22402a;};}function respondWithResult(_0x52d8f1,_0x373ae2){_0x373ae2=_0x373ae2||0xc8;return function(_0x330b10){if(_0x330b10){return _0x52d8f1['status'](_0x373ae2)[_0x999c('0x5')](_0x330b10);}return null;};}function handleError(_0x28aac3,_0x332a64){_0x332a64=_0x332a64||0x1f4;return function(_0x382ac3){logger[_0x999c('0x6')](_0x382ac3['stack']);if(_0x382ac3[_0x999c('0x7')]){delete _0x382ac3['name'];}_0x28aac3[_0x999c('0x8')](_0x332a64)[_0x999c('0x9')](_0x382ac3);};}function execChildProcess(){return new BPromise(function(_0x3f3b96,_0x60a347){exec(_0x999c('0xa'),function(_0x404534,_0x1be0c7,_0x15c5f1){logger[_0x999c('0xb')](_0x1be0c7);logger[_0x999c('0xb')](_0x15c5f1);if(_0x404534){logger[_0x999c('0x6')](_0x404534);return _0x60a347(_0x404534);}return _0x3f3b96(_0x1be0c7);});});}exports['index']=function(_0x1fc025,_0x17fa3b){return pm2[_0x999c('0xc')]()[_0x999c('0xd')](function(_0xd93e76){if(_0xd93e76){var _0x152ec8=_[_0x999c('0xe')](_0xd93e76,function(_0x48c712){return _0x48c712[_0x999c('0x7')]==='express'||_0x48c712[_0x999c('0x7')]==='motion2';});return{'rows':_0x152ec8,'count':_0x152ec8[_0x999c('0xf')]};}return null;})[_0x999c('0xd')](respondWithResult(_0x17fa3b,null))[_0x999c('0x10')](handleError(_0x17fa3b,null));};exports['show']=function(_0x369785,_0x5c1c9e){return pm2[_0x999c('0x11')](_0x369785[_0x999c('0x12')]['id'])[_0x999c('0xd')](respondWithResult(_0x5c1c9e,null))[_0x999c('0xd')](handleEntityNotFound(_0x5c1c9e,null))[_0x999c('0x10')](handleError(_0x5c1c9e,null));};exports[_0x999c('0x13')]=function(_0x4e2136,_0xaf5a78){if(_0x4e2136[_0x999c('0x14')][_0x999c('0x7')]&&_0x4e2136[_0x999c('0x14')][_0x999c('0x15')]){var _0x40952d=path['join'](__dirname,_0x999c('0x16'),_0x4e2136[_0x999c('0x14')][_0x999c('0x15')]);var _0x42a386=process[_0x999c('0x17')]();process[_0x999c('0x18')](path[_0x999c('0x19')](_0x40952d));return execChildProcess()[_0x999c('0xd')](function(_0x4a7ab6){process['chdir'](_0x42a386);return pm2[_0x999c('0x1a')]({'name':_0x4e2136['body'][_0x999c('0x7')],'script':_0x40952d});})[_0x999c('0xd')](function(_0x3cd639){pm2['dump']();return _0x3cd639[0x0];})[_0x999c('0xd')](respondWithResult(_0xaf5a78,0xc9))[_0x999c('0x10')](handleError(_0xaf5a78,null));}else{return _0xaf5a78[_0x999c('0x8')](0x1f4)[_0x999c('0x9')]({'message':_0x999c('0x1b')});}};exports[_0x999c('0x1c')]=function(_0x319c11,_0x13e881){if(_0x319c11[_0x999c('0x14')]['id']){delete _0x319c11[_0x999c('0x14')]['id'];}var _0x47320b={'online':'restart','stopped':'stop'};if(_0x47320b[_0x999c('0x1d')](_0x319c11[_0x999c('0x14')][_0x999c('0x8')])){return pm2[_0x47320b[_0x319c11['body'][_0x999c('0x8')]]](_0x319c11['params']['id'])[_0x999c('0xd')](respondWithResult(_0x13e881,0xc8))[_0x999c('0x10')](handleError(_0x13e881,null));}else{return _0x13e881[_0x999c('0x8')](0x1f4)[_0x999c('0x9')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x5b1b59,_0xdbc31){if(_0x5b1b59[_0x999c('0x14')]['id']){delete _0x5b1b59[_0x999c('0x14')]['id'];}if(_0x5b1b59[_0x999c('0x12')]['id']){return pm2[_0x999c('0x1e')](_0x5b1b59[_0x999c('0x12')]['id'])[_0x999c('0xd')](function(_0x2d5ac9){pm2['dump']();return _0x2d5ac9[0x0];})[_0x999c('0xd')](respondWithResult(_0xdbc31,null))['catch'](handleError(_0xdbc31,null));}else{return _0xdbc31[_0x999c('0x8')](0x1f4)['send']({'message':_0x999c('0x1f')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5112c45..21964e3 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 _0x95b9=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','express','Router'];(function(_0x383b15,_0x10ac96){var _0x2a120d=function(_0x28ef1b){while(--_0x28ef1b){_0x383b15['push'](_0x383b15['shift']());}};_0x2a120d(++_0x10ac96);}(_0x95b9,0x174));var _0x995b=function(_0x35f989,_0x4e0dcf){_0x35f989=_0x35f989-0x0;var _0x578c9b=_0x95b9[_0x35f989];return _0x578c9b;};'use strict';var multer=require('multer');var util=require(_0x995b('0x0'));var path=require(_0x995b('0x1'));var timeout=require('connect-timeout');var express=require(_0x995b('0x2'));var router=express[_0x995b('0x3')]();var auth=require(_0x995b('0x4'));var interaction=require(_0x995b('0x5'));var config=require(_0x995b('0x6'));module[_0x995b('0x7')]=router; \ No newline at end of file +var _0x838d=['Router','../../components/interaction/service','../../config/environment','util','connect-timeout','express'];(function(_0x5ed2c9,_0x20c01f){var _0x424059=function(_0x57fb34){while(--_0x57fb34){_0x5ed2c9['push'](_0x5ed2c9['shift']());}};_0x424059(++_0x20c01f);}(_0x838d,0x1d1));var _0xd838=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x838d[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require(_0xd838('0x0'));var path=require('path');var timeout=require(_0xd838('0x1'));var express=require(_0xd838('0x2'));var router=express[_0xd838('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd838('0x4'));var config=require(_0xd838('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 8e19135..1d29235 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 _0x2ddb=['DATE','STRING','sequelize','INTEGER'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x2ddb,0x11e));var _0xb2dd=function(_0x539ff9,_0x149fa0){_0x539ff9=_0x539ff9-0x0;var _0x2f4fdb=_0x2ddb[_0x539ff9];return _0x2f4fdb;};'use strict';var Sequelize=require(_0xb2dd('0x0'));module['exports']={'state':{'type':Sequelize[_0xb2dd('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb2dd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb2dd('0x2')]},'responsetime':{'type':Sequelize[_0xb2dd('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb2dd('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8b88=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0xac62da,_0x18b7b4){var _0x3de8f9=function(_0x209cdb){while(--_0x209cdb){_0xac62da['push'](_0xac62da['shift']());}};_0x3de8f9(++_0x18b7b4);}(_0x8b88,0x162));var _0x88b8=function(_0x5f55d5,_0x312065){_0x5f55d5=_0x5f55d5-0x0;var _0x1a8944=_0x8b88[_0x5f55d5];return _0x1a8944;};'use strict';var Sequelize=require(_0x88b8('0x0'));module[_0x88b8('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x88b8('0x2')]},'uniqueid':{'type':Sequelize[_0x88b8('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x88b8('0x2')]},'ringtime':{'type':Sequelize[_0x88b8('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x88b8('0x3')]},'campaigntype':{'type':Sequelize[_0x88b8('0x3')]},'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 571a028..729885d 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 _0x67d6=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x345752,_0xe2fbc5){var _0x505131=function(_0x29dbf6){while(--_0x29dbf6){_0x345752['push'](_0x345752['shift']());}};_0x505131(++_0xe2fbc5);}(_0x67d6,0x15e));var _0x667d=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0x67d6[_0x50f112];return _0x4ecf28;};'use strict';var _=require(_0x667d('0x0'));var util=require(_0x667d('0x1'));var logger=require(_0x667d('0x2'))(_0x667d('0x3'));var moment=require(_0x667d('0x4'));var BPromise=require(_0x667d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x667d('0x6'));var attributes=require(_0x667d('0x7'));module[_0x667d('0x8')]=function(_0x2e4dc3,_0x136f5d){return _0x2e4dc3[_0x667d('0x9')](_0x667d('0xa'),attributes,{'tableName':_0x667d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6247=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./reportAgentPreview.attributes','define','report_agent_preview'];(function(_0x27a125,_0x330c0e){var _0x36eac1=function(_0x49265f){while(--_0x49265f){_0x27a125['push'](_0x27a125['shift']());}};_0x36eac1(++_0x330c0e);}(_0x6247,0x1ce));var _0x7624=function(_0x456cda,_0x136e4c){_0x456cda=_0x456cda-0x0;var _0x4b3440=_0x6247[_0x456cda];return _0x4b3440;};'use strict';var _=require(_0x7624('0x0'));var util=require(_0x7624('0x1'));var logger=require(_0x7624('0x2'))(_0x7624('0x3'));var moment=require(_0x7624('0x4'));var BPromise=require('bluebird');var rp=require(_0x7624('0x5'));var fs=require('fs');var path=require(_0x7624('0x6'));var rimraf=require('rimraf');var config=require(_0x7624('0x7'));var attributes=require(_0x7624('0x8'));module['exports']=function(_0x434f3a,_0x17d327){return _0x434f3a[_0x7624('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x7624('0xa'),'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 0ad5ce5..57af319 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 _0x6280=['options','raw','debug','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateReportAgentPreview','ReportAgentPreview','create','body'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0x6280,0x1a8));var _0x0628=function(_0x2ec611,_0x192c3e){_0x2ec611=_0x2ec611-0x0;var _0x587588=_0x6280[_0x2ec611];return _0x587588;};'use strict';var _=require(_0x0628('0x0'));var util=require(_0x0628('0x1'));var moment=require(_0x0628('0x2'));var BPromise=require(_0x0628('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0628('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0628('0x5'));var logger=require(_0x0628('0x6'))(_0x0628('0x7'));var config=require(_0x0628('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0628('0x9')][_0x0628('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d9f43,_0x4e6ac9,_0x5d1dd9){return new BPromise(function(_0x385f8a,_0x5b0ea0){return client[_0x0628('0xb')](_0x4d9f43,_0x5d1dd9)[_0x0628('0xc')](function(_0x5811c9){logger[_0x0628('0xd')](_0x0628('0xe'),_0x4e6ac9,_0x0628('0xf'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4e6ac9,_0x0628('0xf'),JSON[_0x0628('0x10')](_0x5811c9));if(_0x5811c9[_0x0628('0x11')]){if(_0x5811c9[_0x0628('0x11')][_0x0628('0x12')]===0x1f4){logger[_0x0628('0x11')](_0x0628('0xe'),_0x4e6ac9,_0x5811c9['error']['message']);return _0x5b0ea0(_0x5811c9['error']['message']);}logger[_0x0628('0x11')](_0x0628('0xe'),_0x4e6ac9,_0x5811c9[_0x0628('0x11')][_0x0628('0x13')]);return _0x385f8a(_0x5811c9['error']['message']);}else{logger[_0x0628('0xd')](_0x0628('0xe'),_0x4e6ac9,_0x0628('0xf'));_0x385f8a(_0x5811c9['result'][_0x0628('0x13')]);}})['catch'](function(_0x352d21){logger[_0x0628('0x11')](_0x0628('0xe'),_0x4e6ac9,_0x352d21);_0x5b0ea0(_0x352d21);});});}exports[_0x0628('0x14')]=function(_0x39802c){var _0x27a4b8=this;return new Promise(function(_0x5a4beb,_0x1b03be){return db[_0x0628('0x15')][_0x0628('0x16')](_0x39802c[_0x0628('0x17')],{'raw':_0x39802c[_0x0628('0x18')]?_0x39802c[_0x0628('0x18')][_0x0628('0x19')]===undefined?!![]:![]:!![]})[_0x0628('0xc')](function(_0x187843){logger[_0x0628('0xd')](_0x0628('0x14'),_0x39802c);logger[_0x0628('0x1a')](_0x0628('0x14'),_0x39802c,JSON[_0x0628('0x10')](_0x187843));_0x5a4beb(_0x187843);})[_0x0628('0x1b')](function(_0x487580){logger[_0x0628('0x11')](_0x0628('0x14'),_0x487580[_0x0628('0x13')],_0x39802c);_0x1b03be(_0x27a4b8['error'](0x1f4,_0x487580[_0x0628('0x13')]));});});}; \ No newline at end of file +var _0xc0a1=['request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','raw','then','stringify','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5f930a,_0x254c6a){var _0x314552=function(_0x2f9818){while(--_0x2f9818){_0x5f930a['push'](_0x5f930a['shift']());}};_0x314552(++_0x254c6a);}(_0xc0a1,0xfa));var _0x1c0a=function(_0x5b11e0,_0x48afdf){_0x5b11e0=_0x5b11e0-0x0;var _0x40256b=_0xc0a1[_0x5b11e0];return _0x40256b;};'use strict';var _=require('lodash');var util=require(_0x1c0a('0x0'));var moment=require(_0x1c0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c0a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c0a('0x3'))['db'];var utils=require(_0x1c0a('0x4'));var logger=require(_0x1c0a('0x5'))(_0x1c0a('0x6'));var config=require(_0x1c0a('0x7'));var jayson=require(_0x1c0a('0x8'));var client=jayson['client'][_0x1c0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ef2db,_0x37d9d0,_0x519037){return new BPromise(function(_0x219922,_0x5de07c){return client[_0x1c0a('0xa')](_0x3ef2db,_0x519037)['then'](function(_0x3c5dcf){logger[_0x1c0a('0xb')](_0x1c0a('0xc'),_0x37d9d0,_0x1c0a('0xd'));logger[_0x1c0a('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x37d9d0,_0x1c0a('0xd'),JSON['stringify'](_0x3c5dcf));if(_0x3c5dcf['error']){if(_0x3c5dcf[_0x1c0a('0xf')][_0x1c0a('0x10')]===0x1f4){logger[_0x1c0a('0xf')](_0x1c0a('0xc'),_0x37d9d0,_0x3c5dcf[_0x1c0a('0xf')][_0x1c0a('0x11')]);return _0x5de07c(_0x3c5dcf['error']['message']);}logger[_0x1c0a('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x37d9d0,_0x3c5dcf[_0x1c0a('0xf')][_0x1c0a('0x11')]);return _0x219922(_0x3c5dcf[_0x1c0a('0xf')][_0x1c0a('0x11')]);}else{logger[_0x1c0a('0xb')](_0x1c0a('0xc'),_0x37d9d0,'request\x20sent');_0x219922(_0x3c5dcf[_0x1c0a('0x12')][_0x1c0a('0x11')]);}})[_0x1c0a('0x13')](function(_0x5b319d){logger['error'](_0x1c0a('0xc'),_0x37d9d0,_0x5b319d);_0x5de07c(_0x5b319d);});});}exports[_0x1c0a('0x14')]=function(_0x6af765){var _0x1edf45=this;return new Promise(function(_0x4a564f,_0x8e971d){return db[_0x1c0a('0x15')]['create'](_0x6af765[_0x1c0a('0x16')],{'raw':_0x6af765['options']?_0x6af765['options'][_0x1c0a('0x17')]===undefined?!![]:![]:!![]})[_0x1c0a('0x18')](function(_0x2200fd){logger['info']('CreateReportAgentPreview',_0x6af765);logger[_0x1c0a('0xe')]('CreateReportAgentPreview',_0x6af765,JSON[_0x1c0a('0x19')](_0x2200fd));_0x4a564f(_0x2200fd);})[_0x1c0a('0x13')](function(_0x457c40){logger['error'](_0x1c0a('0x14'),_0x457c40[_0x1c0a('0x11')],_0x6af765);_0x8e971d(_0x1edf45[_0x1c0a('0xf')](0x1f4,_0x457c40['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 41f8e05..632c674 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 _0x7752=['showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','/outbound','agents','/agents/:id/capacity','/telephones','telephones','trunks','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x7752,0x92));var _0x2775=function(_0x2668c6,_0x2c3ab9){_0x2668c6=_0x2668c6-0x0;var _0x5cd442=_0x7752[_0x2668c6];return _0x5cd442;};'use strict';var multer=require(_0x2775('0x0'));var util=require(_0x2775('0x1'));var path=require('path');var express=require(_0x2775('0x2'));var router=express[_0x2775('0x3')]();var auth=require(_0x2775('0x4'));var controller=require(_0x2775('0x5'));router[_0x2775('0x6')](_0x2775('0x7'),auth[_0x2775('0x8')](),controller[_0x2775('0x9')]);router[_0x2775('0x6')](_0x2775('0xa'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x2775('0x6')](_0x2775('0xb'),auth[_0x2775('0x8')](),controller[_0x2775('0xc')]);router[_0x2775('0x6')](_0x2775('0xd'),auth[_0x2775('0x8')](),controller[_0x2775('0xe')]);router[_0x2775('0x6')](_0x2775('0xf'),auth[_0x2775('0x8')](),controller[_0x2775('0x10')]);router['get'](_0x2775('0x11'),auth[_0x2775('0x8')](),controller[_0x2775('0x12')]);router[_0x2775('0x6')]('/mail/accounts',auth[_0x2775('0x8')](),controller[_0x2775('0x13')]);router[_0x2775('0x6')](_0x2775('0x14'),auth[_0x2775('0x8')](),controller[_0x2775('0x15')]);router[_0x2775('0x6')]('/sms/queues',auth[_0x2775('0x8')](),controller[_0x2775('0x16')]);router[_0x2775('0x6')](_0x2775('0x17'),auth[_0x2775('0x8')](),controller[_0x2775('0x18')]);router[_0x2775('0x6')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x2775('0x6')](_0x2775('0x19'),auth[_0x2775('0x8')](),controller[_0x2775('0x1a')]);router[_0x2775('0x6')](_0x2775('0x1b'),auth[_0x2775('0x8')](),controller['voiceQueuesChannel']);router[_0x2775('0x6')](_0x2775('0x1c'),auth[_0x2775('0x8')](),controller[_0x2775('0x1d')]);router[_0x2775('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2775('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x2775('0x6')](_0x2775('0x1e'),auth[_0x2775('0x8')](),controller[_0x2775('0x1f')]);router[_0x2775('0x6')](_0x2775('0x20'),auth['isAuthenticated'](),controller['outbound']);router[_0x2775('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller['outboundChannels']);router[_0x2775('0x6')]('/agents',auth['isAuthenticated'](),controller[_0x2775('0x21')]);router['put'](_0x2775('0x22'),auth[_0x2775('0x8')](),controller['agentCapacity']);router[_0x2775('0x6')](_0x2775('0x23'),auth[_0x2775('0x8')](),controller[_0x2775('0x24')]);router['get']('/trunks',auth['isAuthenticated'](),controller[_0x2775('0x25')]);router['get']('/campaigns',auth[_0x2775('0x8')](),controller[_0x2775('0x26')]);router[_0x2775('0x6')]('/fax/accounts',auth[_0x2775('0x8')](),controller['faxAccounts']);router[_0x2775('0x6')](_0x2775('0x27'),auth[_0x2775('0x8')](),controller[_0x2775('0x28')]);router['get'](_0x2775('0x29'),auth[_0x2775('0x8')](),controller[_0x2775('0x2a')]);router[_0x2775('0x6')](_0x2775('0x2b'),auth[_0x2775('0x8')](),controller[_0x2775('0x2c')]);router[_0x2775('0x6')](_0x2775('0x2d'),auth[_0x2775('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x2775('0x6')](_0x2775('0x2e'),auth[_0x2775('0x8')](),controller[_0x2775('0x2f')]);router[_0x2775('0x30')](_0x2775('0x31'),auth[_0x2775('0x8')](),controller[_0x2775('0x32')](_0x2775('0x33')));router[_0x2775('0x6')](_0x2775('0x34'),auth[_0x2775('0x8')](),controller[_0x2775('0x35')]);router[_0x2775('0x30')](_0x2775('0x36'),auth[_0x2775('0x8')](),controller[_0x2775('0x32')]('chat'));router[_0x2775('0x6')](_0x2775('0x37'),auth[_0x2775('0x8')](),controller[_0x2775('0x38')]);router['post']('/fax/queues/:id/notify',auth[_0x2775('0x8')](),controller[_0x2775('0x32')]('fax'));router['get'](_0x2775('0x39'),auth['isAuthenticated'](),controller[_0x2775('0x3a')]);router[_0x2775('0x30')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x2775('0x3b')));router['get'](_0x2775('0x3c'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x2775('0x30')](_0x2775('0x3d'),auth[_0x2775('0x8')](),controller[_0x2775('0x32')](_0x2775('0x3e')));router[_0x2775('0x6')](_0x2775('0x3f'),auth[_0x2775('0x8')](),controller[_0x2775('0x40')]);router[_0x2775('0x30')](_0x2775('0x41'),auth['isAuthenticated'](),controller[_0x2775('0x42')]);module[_0x2775('0x43')]=router; \ No newline at end of file +var _0x9564=['/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','mailAccounts','openchannelQueues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0x9564,0x1eb));var _0x4956=function(_0x107f31,_0x1bcd53){_0x107f31=_0x107f31-0x0;var _0x10560c=_0x9564[_0x107f31];return _0x10560c;};'use strict';var multer=require(_0x4956('0x0'));var util=require(_0x4956('0x1'));var path=require(_0x4956('0x2'));var express=require('express');var router=express[_0x4956('0x3')]();var auth=require(_0x4956('0x4'));var controller=require('./rpc.controller');router[_0x4956('0x5')]('/voice/channels',auth['isAuthenticated'](),controller[_0x4956('0x6')]);router[_0x4956('0x5')](_0x4956('0x7'),auth[_0x4956('0x8')](),controller[_0x4956('0x9')]);router[_0x4956('0x5')](_0x4956('0xa'),auth[_0x4956('0x8')](),controller[_0x4956('0xb')]);router[_0x4956('0x5')](_0x4956('0xc'),auth[_0x4956('0x8')](),controller[_0x4956('0xd')]);router[_0x4956('0x5')](_0x4956('0xe'),auth[_0x4956('0x8')](),controller['chatQueues']);router[_0x4956('0x5')]('/mail/queues',auth[_0x4956('0x8')](),controller[_0x4956('0xf')]);router[_0x4956('0x5')]('/mail/accounts',auth[_0x4956('0x8')](),controller[_0x4956('0x10')]);router[_0x4956('0x5')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x4956('0x11')]);router[_0x4956('0x5')]('/sms/queues',auth[_0x4956('0x8')](),controller[_0x4956('0x12')]);router[_0x4956('0x5')](_0x4956('0x13'),auth[_0x4956('0x8')](),controller[_0x4956('0x14')]);router[_0x4956('0x5')](_0x4956('0x15'),auth[_0x4956('0x8')](),controller[_0x4956('0x16')]);router['get'](_0x4956('0x17'),auth[_0x4956('0x8')](),controller[_0x4956('0x18')]);router[_0x4956('0x5')](_0x4956('0x19'),auth[_0x4956('0x8')](),controller[_0x4956('0x1a')]);router[_0x4956('0x5')](_0x4956('0x1b'),auth[_0x4956('0x8')](),controller[_0x4956('0x1c')]);router[_0x4956('0x5')](_0x4956('0x1d'),auth[_0x4956('0x8')](),controller[_0x4956('0x1e')]);router[_0x4956('0x5')](_0x4956('0x1f'),auth[_0x4956('0x8')](),controller[_0x4956('0x20')]);router[_0x4956('0x5')](_0x4956('0x21'),auth['isAuthenticated'](),controller['outbound']);router[_0x4956('0x5')](_0x4956('0x22'),auth['isAuthenticated'](),controller[_0x4956('0x23')]);router[_0x4956('0x5')](_0x4956('0x24'),auth['isAuthenticated'](),controller[_0x4956('0x25')]);router[_0x4956('0x26')](_0x4956('0x27'),auth[_0x4956('0x8')](),controller[_0x4956('0x28')]);router[_0x4956('0x5')]('/telephones',auth[_0x4956('0x8')](),controller['telephones']);router[_0x4956('0x5')](_0x4956('0x29'),auth[_0x4956('0x8')](),controller[_0x4956('0x2a')]);router[_0x4956('0x5')](_0x4956('0x2b'),auth[_0x4956('0x8')](),controller[_0x4956('0x2c')]);router['get']('/fax/accounts',auth['isAuthenticated'](),controller[_0x4956('0x2d')]);router[_0x4956('0x5')]('/chat/queues/waitinginteractions',auth[_0x4956('0x8')](),controller[_0x4956('0x2e')]);router[_0x4956('0x5')](_0x4956('0x2f'),auth['isAuthenticated'](),controller[_0x4956('0x30')]);router[_0x4956('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x4956('0x8')](),controller[_0x4956('0x31')]);router[_0x4956('0x5')](_0x4956('0x32'),auth[_0x4956('0x8')](),controller[_0x4956('0x33')]);router[_0x4956('0x5')](_0x4956('0x34'),auth[_0x4956('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x4956('0x35')]('/mail/queues/:id/notify',auth[_0x4956('0x8')](),controller[_0x4956('0x36')](_0x4956('0x37')));router[_0x4956('0x5')](_0x4956('0x38'),auth[_0x4956('0x8')](),controller[_0x4956('0x39')]);router[_0x4956('0x35')](_0x4956('0x3a'),auth['isAuthenticated'](),controller[_0x4956('0x36')](_0x4956('0x3b')));router['get'](_0x4956('0x3c'),auth[_0x4956('0x8')](),controller['showChatQueues']);router[_0x4956('0x35')](_0x4956('0x3d'),auth[_0x4956('0x8')](),controller['queueNotify'](_0x4956('0x3e')));router[_0x4956('0x5')](_0x4956('0x3f'),auth[_0x4956('0x8')](),controller[_0x4956('0x40')]);router[_0x4956('0x35')](_0x4956('0x41'),auth[_0x4956('0x8')](),controller[_0x4956('0x36')]('openchannel'));router['get'](_0x4956('0x42'),auth['isAuthenticated'](),controller[_0x4956('0x43')]);router[_0x4956('0x35')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x4956('0x36')](_0x4956('0x44')));router[_0x4956('0x5')](_0x4956('0x45'),auth[_0x4956('0x8')](),controller[_0x4956('0x46')]);router[_0x4956('0x35')](_0x4956('0x47'),auth[_0x4956('0x8')](),controller[_0x4956('0x48')]);module[_0x4956('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 3539d83..56d6a09 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 _0xb62a=['chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Website','Account','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','From','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','User','agent','Agent\x20not\x20found','Message','MessageId','TransferReport','Start','bluebird','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','catch','json','sendStatus','stack','name','status','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','params','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','format','SIP/%s','internal','telephones','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts'];(function(_0x44a9c8,_0x19facb){var _0x3a3d70=function(_0x133828){while(--_0x133828){_0x44a9c8['push'](_0x44a9c8['shift']());}};_0x3a3d70(++_0x19facb);}(_0xb62a,0x107));var _0xab62=function(_0xe791a7,_0xb5a735){_0xe791a7=_0xe791a7-0x0;var _0xa31224=_0xb62a[_0xe791a7];return _0xa31224;};'use strict';var BPromise=require(_0xab62('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xab62('0x1'));var db=require(_0xab62('0x2'))['db'];var logger=require(_0xab62('0x3'))(_0xab62('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xab62('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xab62('0x5')][_0xab62('0x6')]({'port':0x232b});var routingClient=jayson[_0xab62('0x5')][_0xab62('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x467c10,_0x1ed7a5,_0x5ecaea){return new BPromise(function(_0x106558,_0x2f4bc4){var _0x346337=_0x5ecaea?_0x5ecaea:amiClient;return _0x346337[_0xab62('0x7')](_0x467c10,_0x1ed7a5)[_0xab62('0x8')](function(_0x361396){if(_0x361396[_0xab62('0x9')]){if(_0x361396[_0xab62('0x9')]['code']===0x1f4){return _0x2f4bc4(_0x361396[_0xab62('0x9')][_0xab62('0xa')]);}return _0x106558(_0x361396['error'][_0xab62('0xa')]);}else{_0x106558(_0x361396[_0xab62('0xb')]);}})[_0xab62('0xc')](function(_0xa0b4c1){_0x2f4bc4(_0xa0b4c1);});});}function respondWithResult(_0x455858,_0x4ef09e){_0x4ef09e=_0x4ef09e||0xc8;return function(_0x216341){if(_0x216341){return _0x455858['status'](_0x4ef09e)[_0xab62('0xd')](_0x216341);}return _0x455858[_0xab62('0xe')](0x194);};}function handleError(_0x427d3b,_0x13e78d){_0x13e78d=_0x13e78d||0x1f4;return function(_0xe894b6){logger[_0xab62('0x9')](_0xe894b6[_0xab62('0xf')]);if(_0xe894b6[_0xab62('0x10')]){delete _0xe894b6[_0xab62('0x10')];}_0x427d3b[_0xab62('0x11')](_0x13e78d)['send'](_0xe894b6);};}function findById(_0x4b6509){return function(_0x3b1024){if(!_['isNil'](_0x4b6509)&&!_[_0xab62('0x12')](_0x3b1024)&&!_[_0xab62('0x12')](_0x3b1024['rows'])){return _[_0xab62('0x13')](_0x3b1024[_0xab62('0x14')],function(_0x40252b){return _0x40252b['id']==_0x4b6509;});}return null;};}exports[_0xab62('0x15')]=function(_0x1822cd,_0x1a80ea){return respondWithRpcPromise(_0xab62('0x16'),_0x1822cd[_0xab62('0x17')])[_0xab62('0x8')](respondWithResult(_0x1a80ea,null))[_0xab62('0xc')](handleError(_0x1a80ea,null));};exports[_0xab62('0x18')]=function(_0x169f4f,_0x420036){return respondWithRpcPromise(_0xab62('0x19'),_[_0xab62('0x1a')](_0x169f4f['query'],_0x169f4f['params']))[_0xab62('0x8')](respondWithResult(_0x420036,null))['catch'](handleError(_0x420036,null));};exports[_0xab62('0x1b')]=function(_0x13193e,_0x2e329d){return respondWithRpcPromise(_0xab62('0x1c'),_[_0xab62('0x1a')](_0x13193e[_0xab62('0x17')],_0x13193e['params']))[_0xab62('0x8')](respondWithResult(_0x2e329d,null))[_0xab62('0xc')](handleError(_0x2e329d,null));};exports[_0xab62('0x1d')]=function(_0xb4bb44,_0x70dfaf){return respondWithRpcPromise(_0xab62('0x1e'),_0xb4bb44['query'])['then'](respondWithResult(_0x70dfaf,null))['catch'](handleError(_0x70dfaf,null));};exports[_0xab62('0x1f')]=function(_0xca5cf6,_0x1d1910){return respondWithRpcPromise('VoiceQueues',_0xca5cf6[_0xab62('0x17')])[_0xab62('0x8')](findById(_0xca5cf6['params']['id']))['then'](respondWithResult(_0x1d1910,null))[_0xab62('0xc')](handleError(_0x1d1910,null));};exports[_0xab62('0x20')]=function(_0x814e86,_0x45f9e1){return respondWithRpcPromise(_0xab62('0x21'),_['merge'](_0x814e86[_0xab62('0x17')],_0x814e86[_0xab62('0x22')]))['then'](respondWithResult(_0x45f9e1,null))[_0xab62('0xc')](handleError(_0x45f9e1,null));};exports['voiceQueuesChannels']=function(_0x16a8d1,_0x295e62){return respondWithRpcPromise('VoiceQueuesChannels',_0x16a8d1[_0xab62('0x17')])['then'](respondWithResult(_0x295e62,null))[_0xab62('0xc')](handleError(_0x295e62,null));};exports[_0xab62('0x23')]=function(_0x44cf25,_0x47eea6){return respondWithRpcPromise(_0xab62('0x24'),_['merge'](_0x44cf25[_0xab62('0x17')],_0x44cf25['params']))[_0xab62('0x8')](respondWithResult(_0x47eea6,null))['catch'](handleError(_0x47eea6,null));};exports[_0xab62('0x25')]=function(_0x6c0093,_0x1f2f26){return respondWithRpcPromise(_0xab62('0x26'),_[_0xab62('0x1a')](_0x6c0093[_0xab62('0x17')],_0x6c0093[_0xab62('0x22')]))[_0xab62('0x8')](respondWithResult(_0x1f2f26,null))['catch'](handleError(_0x1f2f26,null));};exports[_0xab62('0x27')]=function(_0x8d06f8,_0x143f03){return respondWithRpcPromise(_0xab62('0x28'),_[_0xab62('0x1a')](_0x8d06f8['query'],_0x8d06f8[_0xab62('0x22')]))[_0xab62('0x8')](respondWithResult(_0x143f03,null))[_0xab62('0xc')](handleError(_0x143f03,null));};exports[_0xab62('0x29')]=function(_0x22ff68,_0x27b5b5){return respondWithRpcPromise(_0xab62('0x2a'),_0x22ff68['query'])['then'](respondWithResult(_0x27b5b5,null))[_0xab62('0xc')](handleError(_0x27b5b5,null));};exports[_0xab62('0x2b')]=function(_0x48860e,_0x13db99){return respondWithRpcPromise(_0xab62('0x2c'),_0x48860e[_0xab62('0x17')])[_0xab62('0x8')](respondWithResult(_0x13db99,null))[_0xab62('0xc')](handleError(_0x13db99,null));};exports['agents']=function(_0x26c44e,_0x208430){var _0x3b13a7;return respondWithRpcPromise(_0xab62('0x2d'),_0x26c44e[_0xab62('0x17')])[_0xab62('0x8')](function(_0x282553){_0x3b13a7=_0x282553;return respondWithRpcPromise(_0xab62('0x2d'),_0x26c44e[_0xab62('0x17')],routingClient);})['then'](function(_0x37f5f7){return _[_0xab62('0x1a')]({},_0x37f5f7,_0x3b13a7);})['then'](respondWithResult(_0x208430,null))[_0xab62('0xc')](handleError(_0x208430,null));};exports[_0xab62('0x2e')]=function(_0x4ada54,_0x106987){if(_0x4ada54[_0xab62('0x2f')]&&_0x4ada54[_0xab62('0x2f')][_0xab62('0x30')]&&_0x4ada54[_0xab62('0x31')]&&_0x4ada54[_0xab62('0x31')][_0xab62('0x10')]){for(var _0x392a14 in _0x4ada54[_0xab62('0x2f')]['interaction']){if(_0x4ada54[_0xab62('0x2f')][_0xab62('0x30')][_0xab62('0x32')](_0x392a14)){db['MemberReport'][_0xab62('0x33')]({'where':{'channel':_0x392a14,'membername':_0x4ada54[_0xab62('0x31')][_0xab62('0x10')],'type':_0xab62('0x34'),'exitAt':null,'uniqueid':_0x4ada54[_0xab62('0x2f')][_0xab62('0x30')][_0x392a14]&&_0x4ada54[_0xab62('0x2f')][_0xab62('0x30')][_0x392a14][_0xab62('0x35')]?{'$notIn':_0x4ada54['body'][_0xab62('0x30')][_0x392a14]}:{'$ne':null}}})[_0xab62('0x8')](function(_0x2aeb3c){var _0x119195=moment()['format'](_0xab62('0x36'));for(var _0x505d10=0x0,_0xbffc3e=_0x2aeb3c[_0xab62('0x35')];_0x505d10<_0xbffc3e;_0x505d10+=0x1){_0x2aeb3c[_0x505d10][_0xab62('0x37')]({'exitAt':_0x119195});}});for(var _0x3b4d22=0x0;_0x3b4d22<_0x4ada54[_0xab62('0x2f')][_0xab62('0x30')][_0x392a14][_0xab62('0x35')];_0x3b4d22+=0x1){db[_0xab62('0x38')][_0xab62('0x39')]({'where':{'channel':_0x392a14,'membername':_0x4ada54[_0xab62('0x31')]['name'],'type':_0xab62('0x34'),'uniqueid':_0x4ada54[_0xab62('0x2f')]['interaction'][_0x392a14][_0x3b4d22],'exitAt':null},'defaults':{'channel':_0x392a14,'membername':_0x4ada54['user'][_0xab62('0x10')],'interface':_[_0xab62('0x12')](_0x4ada54[_0xab62('0x31')][_0xab62('0x3a')])?util[_0xab62('0x3b')](_0xab62('0x3c'),_0x4ada54[_0xab62('0x31')][_0xab62('0x10')]):_0x4ada54[_0xab62('0x31')][_0xab62('0x3a')],'type':_0xab62('0x34'),'enterAt':moment()[_0xab62('0x3b')](_0xab62('0x36')),'role':'agent','internal':_0x4ada54[_0xab62('0x31')][_0xab62('0x3d')],'uniqueid':_0x4ada54['body'][_0xab62('0x30')][_0x392a14][_0x3b4d22]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x4ada54[_0xab62('0x22')]['id'],'capacity':_0x4ada54[_0xab62('0x2f')]['capacity']},routingClient)[_0xab62('0x8')](respondWithResult(_0x106987,null))[_0xab62('0xc')](handleError(_0x106987,null));};exports[_0xab62('0x3e')]=function(_0x1d5e47,_0x1a9a81){return respondWithRpcPromise(_0xab62('0x3f'),_0x1d5e47['query'])[_0xab62('0x8')](respondWithResult(_0x1a9a81,null))[_0xab62('0xc')](handleError(_0x1a9a81,null));};exports[_0xab62('0x40')]=function(_0x30a2a0,_0x18e5ab){return respondWithRpcPromise(_0xab62('0x41'),_0x30a2a0[_0xab62('0x17')])[_0xab62('0x8')](respondWithResult(_0x18e5ab,null))[_0xab62('0xc')](handleError(_0x18e5ab,null));};exports['campaigns']=function(_0x294162,_0x6879d){return respondWithRpcPromise(_0xab62('0x42'),_0x294162[_0xab62('0x17')])[_0xab62('0x8')](respondWithResult(_0x6879d,null))[_0xab62('0xc')](handleError(_0x6879d,null));};exports[_0xab62('0x43')]=function(_0xb2a6e8,_0x490d03){return respondWithRpcPromise(_0xab62('0x44'),_0xb2a6e8['query'],routingClient)[_0xab62('0x8')](respondWithResult(_0x490d03,null))[_0xab62('0xc')](handleError(_0x490d03,null));};exports[_0xab62('0x45')]=function(_0x3aaa8e,_0x2f9b2a){return respondWithRpcPromise(_0xab62('0x44'),_0x3aaa8e[_0xab62('0x17')],routingClient)[_0xab62('0x8')](findById(_0x3aaa8e[_0xab62('0x22')]['id']))[_0xab62('0x8')](respondWithResult(_0x2f9b2a,null))[_0xab62('0xc')](handleError(_0x2f9b2a,null));};exports['mailQueues']=function(_0x1adca5,_0x571022){return respondWithRpcPromise(_0xab62('0x46'),_0x1adca5[_0xab62('0x17')],routingClient)[_0xab62('0x8')](respondWithResult(_0x571022,null))[_0xab62('0xc')](handleError(_0x571022,null));};exports[_0xab62('0x47')]=function(_0x30aff7,_0x2cda22){return respondWithRpcPromise(_0xab62('0x46'),_0x30aff7[_0xab62('0x17')],routingClient)['then'](findById(_0x30aff7[_0xab62('0x22')]['id']))[_0xab62('0x8')](respondWithResult(_0x2cda22,null))[_0xab62('0xc')](handleError(_0x2cda22,null));};exports[_0xab62('0x48')]=function(_0x2a54de,_0x2374c3){return respondWithRpcPromise(_0xab62('0x49'),_0x2a54de['query'],mailClient)[_0xab62('0x8')](respondWithResult(_0x2374c3,null))[_0xab62('0xc')](handleError(_0x2374c3,null));};exports['openchannelQueues']=function(_0xd0a86f,_0x1191aa){return respondWithRpcPromise(_0xab62('0x4a'),_0xd0a86f[_0xab62('0x17')],routingClient)[_0xab62('0x8')](respondWithResult(_0x1191aa,null))[_0xab62('0xc')](handleError(_0x1191aa,null));};exports['showOpenchannelQueues']=function(_0x254ba5,_0x1366a3){return respondWithRpcPromise(_0xab62('0x4a'),_0x254ba5[_0xab62('0x17')],routingClient)[_0xab62('0x8')](findById(_0x254ba5[_0xab62('0x22')]['id']))['then'](respondWithResult(_0x1366a3,null))[_0xab62('0xc')](handleError(_0x1366a3,null));};exports[_0xab62('0x4b')]=function(_0x5f3a7c,_0xd2db0f){return respondWithRpcPromise(_0xab62('0x4c'),_0x5f3a7c[_0xab62('0x17')],routingClient)[_0xab62('0x8')](respondWithResult(_0xd2db0f,null))[_0xab62('0xc')](handleError(_0xd2db0f,null));};exports[_0xab62('0x4d')]=function(_0x118221,_0x52d23c){return respondWithRpcPromise(_0xab62('0x4c'),_0x118221[_0xab62('0x17')],routingClient)[_0xab62('0x8')](findById(_0x118221[_0xab62('0x22')]['id']))[_0xab62('0x8')](respondWithResult(_0x52d23c,null))[_0xab62('0xc')](handleError(_0x52d23c,null));};exports[_0xab62('0x4e')]=function(_0x4bb3d9,_0x4dca3d){return respondWithRpcPromise('FaxQueues',_0x4bb3d9[_0xab62('0x17')],routingClient)['then'](respondWithResult(_0x4dca3d,null))[_0xab62('0xc')](handleError(_0x4dca3d,null));};exports[_0xab62('0x4f')]=function(_0x226dcd,_0x131c79){return respondWithRpcPromise(_0xab62('0x50'),_0x226dcd[_0xab62('0x17')],routingClient)['then'](findById(_0x226dcd[_0xab62('0x22')]['id']))['then'](respondWithResult(_0x131c79,null))[_0xab62('0xc')](handleError(_0x131c79,null));};exports[_0xab62('0x51')]=function(_0x2ad01a,_0x1d0544){return respondWithRpcPromise('FaxAccounts',_0x2ad01a[_0xab62('0x17')])[_0xab62('0x8')](respondWithResult(_0x1d0544,null))[_0xab62('0xc')](handleError(_0x1d0544,null));};exports[_0xab62('0x52')]=function(_0xf204cf,_0x127b8f){return respondWithRpcPromise(_0xab62('0x53'),_0xf204cf[_0xab62('0x17')],routingClient)[_0xab62('0x8')](respondWithResult(_0x127b8f,null))[_0xab62('0xc')](handleError(_0x127b8f,null));};exports[_0xab62('0x54')]=function(_0x18634b,_0x22de06){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x18634b['query'],routingClient)[_0xab62('0x8')](respondWithResult(_0x22de06,null))[_0xab62('0xc')](handleError(_0x22de06,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2133be,_0x165d3d){return respondWithRpcPromise(_0xab62('0x55'),_0x2133be[_0xab62('0x17')],routingClient)[_0xab62('0x8')](respondWithResult(_0x165d3d,null))[_0xab62('0xc')](handleError(_0x165d3d,null));};exports[_0xab62('0x56')]=function(_0x2a0d07,_0x3b522d){return respondWithRpcPromise(_0xab62('0x57'),_0x2a0d07[_0xab62('0x17')],routingClient)[_0xab62('0x8')](respondWithResult(_0x3b522d,null))[_0xab62('0xc')](handleError(_0x3b522d,null));};exports[_0xab62('0x58')]=function(_0x4de3b2,_0x4234d6){return respondWithRpcPromise(_0xab62('0x59'),_0x4de3b2['query'],routingClient)[_0xab62('0x8')](respondWithResult(_0x4234d6,null))['catch'](handleError(_0x4234d6,null));};exports['queueNotify']=function(_0x4a6c58){return function(_0x377ae2,_0x45b35b){var _0x1da041,_0xad1bc9;var _0x211173=_[_0xab62('0x5a')](_0x4a6c58);var _0x3011d9=_0x4a6c58==='chat'?_0xab62('0x5b'):_0xab62('0x5c');return db[_0x211173+'Queue']['findOne']({'raw':!![],'where':{'id':_0x377ae2[_0xab62('0x22')]['id']}})[_0xab62('0x8')](function(_0x417cac){if(_[_0xab62('0x12')](_0x417cac)){throw new Error(_0x211173+'\x20Queue\x20not\x20found');}_0x1da041=_0x417cac;return db[_0x211173+'Message'][_0xab62('0x5d')]({'where':{'id':_0x377ae2[_0xab62('0x2f')][_0xab62('0x5e')]},'include':[{'model':db[_0x211173+'Interaction'],'as':_0xab62('0x5f')},{'model':db[_0x211173+_0x3011d9],'as':_0xab62('0x5c')}]});})['then'](function(_0x68b0af){if(_[_0xab62('0x12')](_0x68b0af)){throw new Error(_0x211173+_0xab62('0x60'));}_0xad1bc9=_0x68b0af;return _0x68b0af[_0xab62('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0xab62('0x8')](function(){var _0x650d71={'uniqueid':_0x4a6c58+'.'+_0xad1bc9['id']+'.'+_0xad1bc9[_0xab62('0x5f')]['id'],'FromUserId':_0x377ae2[_0xab62('0x31')]['id'],'type':'queue'};_0x650d71[_0x211173+'MessageId']=_0xad1bc9['id'];_0x650d71[_0x211173+_0xab62('0x62')]=_0xad1bc9[_0xab62('0x5f')]['id'];_0x650d71[_0xab62('0x63')+_0x211173+_0x3011d9+'Id']=_0xad1bc9[_0xab62('0x5c')]['id'];_0x650d71['To'+_0x211173+'QueueId']=_0x1da041['id'];return db[_0x211173+'TransferReport'][_0xab62('0x64')](_0x650d71);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x4a6c58,'interaction':_0xad1bc9[_0xab62('0x5f')],'message':_0xad1bc9,'account':_0xad1bc9['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xab62('0x65'),'appdata':_0x1da041[_0xab62('0x10')]+','+(_0xad1bc9['Account'][_0xab62('0x66')]||0x12c),'interval':_0xab62('0x67')}]},routingClient);})['then'](respondWithResult(_0x45b35b,null))[_0xab62('0xc')](handleError(_0x45b35b,null));};};exports[_0xab62('0x68')]=function(_0x33bdd5,_0x5b2dc5){var _0x514bb0,_0x155367;if(_['isNil'](_0x33bdd5['body']['channel'])){throw new Error(_0xab62('0x69'));}var _0x3e18d5=_0x33bdd5['body'][_0xab62('0x6a')];var _0x39cfaa=_[_0xab62('0x5a')](_0x3e18d5);var _0x467071=_0x3e18d5===_0xab62('0x6b')?_0xab62('0x5b'):'Account';return db[_0xab62('0x6c')][_0xab62('0x5d')]({'raw':!![],'where':{'id':_0x33bdd5[_0xab62('0x22')]['id'],'role':_0xab62('0x6d')}})[_0xab62('0x8')](function(_0x2eb2bf){if(_[_0xab62('0x12')](_0x2eb2bf)){throw new Error(_0xab62('0x6e'));}_0x514bb0=_0x2eb2bf;return db[_0x39cfaa+_0xab62('0x6f')][_0xab62('0x5d')]({'where':{'id':_0x33bdd5['body'][_0xab62('0x5e')]},'include':[{'model':db[_0x39cfaa+'Interaction'],'as':_0xab62('0x5f')},{'model':db[_0x39cfaa+_0x467071],'as':_0xab62('0x5c')}]});})['then'](function(_0x22b214){if(_[_0xab62('0x12')](_0x22b214)){throw new Error(_0x39cfaa+_0xab62('0x60'));}_0x155367=_0x22b214;return _0x22b214[_0xab62('0x61')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5df520={'uniqueid':_0x3e18d5+'.'+_0x155367['id']+'.'+_0x155367['Interaction']['id'],'FromUserId':_0x33bdd5['user']['id'],'type':_0xab62('0x65'),'ToUserId':_0x514bb0['id']};_0x5df520[_0x39cfaa+_0xab62('0x70')]=_0x155367['id'];_0x5df520[_0x39cfaa+_0xab62('0x62')]=_0x155367[_0xab62('0x5f')]['id'];_0x5df520[_0xab62('0x63')+_0x39cfaa+_0x467071+'Id']=_0x155367[_0xab62('0x5c')]['id'];return db[_0x39cfaa+_0xab62('0x71')]['create'](_0x5df520);})[_0xab62('0x8')](function(){return respondWithRpcPromise(_0xab62('0x72'),{'channel':_0x3e18d5,'interaction':_0x155367['Interaction'],'message':_0x155367,'account':_0x155367[_0xab62('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x514bb0[_0xab62('0x10')]+','+(_0x155367[_0xab62('0x5c')]['agentTransferTimeout']||0x12c),'interval':_0xab62('0x67')}]},routingClient);})[_0xab62('0x8')](respondWithResult(_0x5b2dc5,null))['catch'](handleError(_0x5b2dc5,null));}; \ No newline at end of file +var _0x455c=['voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Queue','findOne','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','create','*,*,*,*','agentNotify','chat','Website','User','Message','messageId','queue','moment','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues'];(function(_0x33bfc9,_0x3bb9ca){var _0x14b5e2=function(_0x1df188){while(--_0x1df188){_0x33bfc9['push'](_0x33bfc9['shift']());}};_0x14b5e2(++_0x3bb9ca);}(_0x455c,0xbc));var _0xc455=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x455c[_0x10b317];return _0x1e3054;};'use strict';var BPromise=require('bluebird');var moment=require(_0xc455('0x0'));var _=require(_0xc455('0x1'));var util=require(_0xc455('0x2'));var db=require(_0xc455('0x3'))['db'];var logger=require('../../config/logger')(_0xc455('0x4'));var jayson=require(_0xc455('0x5'));var amiClient=jayson[_0xc455('0x6')]['http']({'port':0x232a});var mailClient=jayson['client'][_0xc455('0x7')]({'port':0x232b});var routingClient=jayson[_0xc455('0x6')][_0xc455('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x656536,_0x8dfebe,_0x1eaa3d){return new BPromise(function(_0x5866be,_0x5e35d3){var _0x55b4bf=_0x1eaa3d?_0x1eaa3d:amiClient;return _0x55b4bf[_0xc455('0x8')](_0x656536,_0x8dfebe)[_0xc455('0x9')](function(_0x4a5876){if(_0x4a5876['error']){if(_0x4a5876[_0xc455('0xa')]['code']===0x1f4){return _0x5e35d3(_0x4a5876['error'][_0xc455('0xb')]);}return _0x5866be(_0x4a5876[_0xc455('0xa')]['message']);}else{_0x5866be(_0x4a5876[_0xc455('0xc')]);}})[_0xc455('0xd')](function(_0x504bf8){_0x5e35d3(_0x504bf8);});});}function respondWithResult(_0x3de21a,_0x37ca47){_0x37ca47=_0x37ca47||0xc8;return function(_0x3c715b){if(_0x3c715b){return _0x3de21a[_0xc455('0xe')](_0x37ca47)[_0xc455('0xf')](_0x3c715b);}return _0x3de21a[_0xc455('0x10')](0x194);};}function handleError(_0x2496ea,_0x4e9b9b){_0x4e9b9b=_0x4e9b9b||0x1f4;return function(_0x1df438){logger[_0xc455('0xa')](_0x1df438[_0xc455('0x11')]);if(_0x1df438[_0xc455('0x12')]){delete _0x1df438['name'];}_0x2496ea[_0xc455('0xe')](_0x4e9b9b)[_0xc455('0x13')](_0x1df438);};}function findById(_0x22d110){return function(_0x34912e){if(!_[_0xc455('0x14')](_0x22d110)&&!_[_0xc455('0x14')](_0x34912e)&&!_[_0xc455('0x14')](_0x34912e[_0xc455('0x15')])){return _['find'](_0x34912e['rows'],function(_0x4d6f7b){return _0x4d6f7b['id']==_0x22d110;});}return null;};}exports['voiceChannels']=function(_0x430c5a,_0x3ed298){return respondWithRpcPromise(_0xc455('0x16'),_0x430c5a[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x3ed298,null))[_0xc455('0xd')](handleError(_0x3ed298,null));};exports[_0xc455('0x18')]=function(_0x2edc0b,_0x383ac0){return respondWithRpcPromise(_0xc455('0x19'),_[_0xc455('0x1a')](_0x2edc0b[_0xc455('0x17')],_0x2edc0b[_0xc455('0x1b')]))[_0xc455('0x9')](respondWithResult(_0x383ac0,null))[_0xc455('0xd')](handleError(_0x383ac0,null));};exports[_0xc455('0x1c')]=function(_0x5a82fa,_0x2b78e9){return respondWithRpcPromise(_0xc455('0x1d'),_[_0xc455('0x1a')](_0x5a82fa[_0xc455('0x17')],_0x5a82fa[_0xc455('0x1b')]))[_0xc455('0x9')](respondWithResult(_0x2b78e9,null))[_0xc455('0xd')](handleError(_0x2b78e9,null));};exports['voiceQueues']=function(_0x1f707c,_0x245377){return respondWithRpcPromise(_0xc455('0x1e'),_0x1f707c[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x245377,null))[_0xc455('0xd')](handleError(_0x245377,null));};exports[_0xc455('0x1f')]=function(_0x4c1a1c,_0x8ea265){return respondWithRpcPromise(_0xc455('0x1e'),_0x4c1a1c[_0xc455('0x17')])[_0xc455('0x9')](findById(_0x4c1a1c[_0xc455('0x1b')]['id']))['then'](respondWithResult(_0x8ea265,null))['catch'](handleError(_0x8ea265,null));};exports[_0xc455('0x20')]=function(_0x230bb8,_0x1d7b82){return respondWithRpcPromise(_0xc455('0x21'),_[_0xc455('0x1a')](_0x230bb8[_0xc455('0x17')],_0x230bb8['params']))[_0xc455('0x9')](respondWithResult(_0x1d7b82,null))['catch'](handleError(_0x1d7b82,null));};exports['voiceQueuesChannels']=function(_0x4b3482,_0x391cd4){return respondWithRpcPromise(_0xc455('0x22'),_0x4b3482['query'])[_0xc455('0x9')](respondWithResult(_0x391cd4,null))['catch'](handleError(_0x391cd4,null));};exports['voiceQueuesChannel']=function(_0x5142fb,_0x45b1b6){return respondWithRpcPromise(_0xc455('0x23'),_[_0xc455('0x1a')](_0x5142fb['query'],_0x5142fb['params']))[_0xc455('0x9')](respondWithResult(_0x45b1b6,null))[_0xc455('0xd')](handleError(_0x45b1b6,null));};exports[_0xc455('0x24')]=function(_0x2ac370,_0x4f8efa){return respondWithRpcPromise(_0xc455('0x25'),_['merge'](_0x2ac370[_0xc455('0x17')],_0x2ac370[_0xc455('0x1b')]))['then'](respondWithResult(_0x4f8efa,null))['catch'](handleError(_0x4f8efa,null));};exports[_0xc455('0x26')]=function(_0x21d95e,_0x3d83df){return respondWithRpcPromise(_0xc455('0x27'),_[_0xc455('0x1a')](_0x21d95e['query'],_0x21d95e[_0xc455('0x1b')]))[_0xc455('0x9')](respondWithResult(_0x3d83df,null))[_0xc455('0xd')](handleError(_0x3d83df,null));};exports['outbound']=function(_0x61d498,_0x19078f){return respondWithRpcPromise('Outbound',_0x61d498[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x19078f,null))[_0xc455('0xd')](handleError(_0x19078f,null));};exports[_0xc455('0x28')]=function(_0x8337c1,_0x5647e5){return respondWithRpcPromise('OutboundChannels',_0x8337c1[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x5647e5,null))['catch'](handleError(_0x5647e5,null));};exports[_0xc455('0x29')]=function(_0x1869c9,_0x5cc501){var _0xe2dd19;return respondWithRpcPromise(_0xc455('0x2a'),_0x1869c9[_0xc455('0x17')])[_0xc455('0x9')](function(_0x237e9f){_0xe2dd19=_0x237e9f;return respondWithRpcPromise(_0xc455('0x2a'),_0x1869c9[_0xc455('0x17')],routingClient);})[_0xc455('0x9')](function(_0x5abfd8){return _[_0xc455('0x1a')]({},_0x5abfd8,_0xe2dd19);})['then'](respondWithResult(_0x5cc501,null))[_0xc455('0xd')](handleError(_0x5cc501,null));};exports[_0xc455('0x2b')]=function(_0x5de60e,_0x52d06){if(_0x5de60e[_0xc455('0x2c')]&&_0x5de60e[_0xc455('0x2c')][_0xc455('0x2d')]&&_0x5de60e[_0xc455('0x2e')]&&_0x5de60e['user'][_0xc455('0x12')]){for(var _0x2111b8 in _0x5de60e[_0xc455('0x2c')]['interaction']){if(_0x5de60e[_0xc455('0x2c')][_0xc455('0x2d')][_0xc455('0x2f')](_0x2111b8)){db[_0xc455('0x30')][_0xc455('0x31')]({'where':{'channel':_0x2111b8,'membername':_0x5de60e['user'][_0xc455('0x12')],'type':_0xc455('0x32'),'exitAt':null,'uniqueid':_0x5de60e['body']['interaction'][_0x2111b8]&&_0x5de60e[_0xc455('0x2c')][_0xc455('0x2d')][_0x2111b8]['length']?{'$notIn':_0x5de60e[_0xc455('0x2c')][_0xc455('0x2d')][_0x2111b8]}:{'$ne':null}}})[_0xc455('0x9')](function(_0x5d0750){var _0x4bf745=moment()[_0xc455('0x33')](_0xc455('0x34'));for(var _0x4a12db=0x0,_0x28f210=_0x5d0750[_0xc455('0x35')];_0x4a12db<_0x28f210;_0x4a12db+=0x1){_0x5d0750[_0x4a12db]['updateAttributes']({'exitAt':_0x4bf745});}});for(var _0x539eee=0x0;_0x539eee<_0x5de60e[_0xc455('0x2c')][_0xc455('0x2d')][_0x2111b8][_0xc455('0x35')];_0x539eee+=0x1){db[_0xc455('0x30')][_0xc455('0x36')]({'where':{'channel':_0x2111b8,'membername':_0x5de60e[_0xc455('0x2e')][_0xc455('0x12')],'type':_0xc455('0x32'),'uniqueid':_0x5de60e[_0xc455('0x2c')]['interaction'][_0x2111b8][_0x539eee],'exitAt':null},'defaults':{'channel':_0x2111b8,'membername':_0x5de60e['user']['name'],'interface':_[_0xc455('0x14')](_0x5de60e[_0xc455('0x2e')][_0xc455('0x37')])?util[_0xc455('0x33')](_0xc455('0x38'),_0x5de60e[_0xc455('0x2e')]['name']):_0x5de60e[_0xc455('0x2e')][_0xc455('0x37')],'type':'INTERACTION','enterAt':moment()[_0xc455('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xc455('0x39'),'internal':_0x5de60e['user'][_0xc455('0x3a')],'uniqueid':_0x5de60e[_0xc455('0x2c')]['interaction'][_0x2111b8][_0x539eee]}});}}}}return respondWithRpcPromise(_0xc455('0x3b'),{'id':_0x5de60e[_0xc455('0x1b')]['id'],'capacity':_0x5de60e[_0xc455('0x2c')][_0xc455('0x3c')]},routingClient)['then'](respondWithResult(_0x52d06,null))[_0xc455('0xd')](handleError(_0x52d06,null));};exports[_0xc455('0x3d')]=function(_0x573a99,_0x38b14e){return respondWithRpcPromise('Telephones',_0x573a99[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x38b14e,null))[_0xc455('0xd')](handleError(_0x38b14e,null));};exports['trunks']=function(_0x514af8,_0x1e086e){return respondWithRpcPromise(_0xc455('0x3e'),_0x514af8[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x1e086e,null))['catch'](handleError(_0x1e086e,null));};exports[_0xc455('0x3f')]=function(_0x5288d7,_0x4870b6){return respondWithRpcPromise('Campaigns',_0x5288d7[_0xc455('0x17')])['then'](respondWithResult(_0x4870b6,null))[_0xc455('0xd')](handleError(_0x4870b6,null));};exports[_0xc455('0x40')]=function(_0x3d6ec0,_0x2c1b24){return respondWithRpcPromise(_0xc455('0x41'),_0x3d6ec0[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x2c1b24,null))[_0xc455('0xd')](handleError(_0x2c1b24,null));};exports[_0xc455('0x42')]=function(_0x34a0a8,_0x2543f7){return respondWithRpcPromise(_0xc455('0x41'),_0x34a0a8[_0xc455('0x17')],routingClient)[_0xc455('0x9')](findById(_0x34a0a8['params']['id']))['then'](respondWithResult(_0x2543f7,null))[_0xc455('0xd')](handleError(_0x2543f7,null));};exports[_0xc455('0x43')]=function(_0x46a862,_0x1273fc){return respondWithRpcPromise(_0xc455('0x44'),_0x46a862[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x1273fc,null))[_0xc455('0xd')](handleError(_0x1273fc,null));};exports[_0xc455('0x45')]=function(_0x19f70e,_0x36664c){return respondWithRpcPromise(_0xc455('0x44'),_0x19f70e['query'],routingClient)[_0xc455('0x9')](findById(_0x19f70e[_0xc455('0x1b')]['id']))[_0xc455('0x9')](respondWithResult(_0x36664c,null))[_0xc455('0xd')](handleError(_0x36664c,null));};exports[_0xc455('0x46')]=function(_0x5c4674,_0x109861){return respondWithRpcPromise(_0xc455('0x47'),_0x5c4674[_0xc455('0x17')],mailClient)[_0xc455('0x9')](respondWithResult(_0x109861,null))[_0xc455('0xd')](handleError(_0x109861,null));};exports['openchannelQueues']=function(_0x583a69,_0x1b4de6){return respondWithRpcPromise('OpenchannelQueues',_0x583a69[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x1b4de6,null))[_0xc455('0xd')](handleError(_0x1b4de6,null));};exports['showOpenchannelQueues']=function(_0x57fbb7,_0x693dc5){return respondWithRpcPromise('OpenchannelQueues',_0x57fbb7[_0xc455('0x17')],routingClient)['then'](findById(_0x57fbb7['params']['id']))[_0xc455('0x9')](respondWithResult(_0x693dc5,null))[_0xc455('0xd')](handleError(_0x693dc5,null));};exports[_0xc455('0x48')]=function(_0x3a1c4c,_0x23d34a){return respondWithRpcPromise(_0xc455('0x49'),_0x3a1c4c[_0xc455('0x17')],routingClient)['then'](respondWithResult(_0x23d34a,null))[_0xc455('0xd')](handleError(_0x23d34a,null));};exports[_0xc455('0x4a')]=function(_0x1c1c1d,_0x2274b6){return respondWithRpcPromise('SmsQueues',_0x1c1c1d[_0xc455('0x17')],routingClient)[_0xc455('0x9')](findById(_0x1c1c1d[_0xc455('0x1b')]['id']))[_0xc455('0x9')](respondWithResult(_0x2274b6,null))[_0xc455('0xd')](handleError(_0x2274b6,null));};exports[_0xc455('0x4b')]=function(_0x54f1d2,_0x58d691){return respondWithRpcPromise(_0xc455('0x4c'),_0x54f1d2[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x58d691,null))[_0xc455('0xd')](handleError(_0x58d691,null));};exports[_0xc455('0x4d')]=function(_0x181494,_0x51420d){return respondWithRpcPromise(_0xc455('0x4c'),_0x181494[_0xc455('0x17')],routingClient)[_0xc455('0x9')](findById(_0x181494[_0xc455('0x1b')]['id']))['then'](respondWithResult(_0x51420d,null))[_0xc455('0xd')](handleError(_0x51420d,null));};exports[_0xc455('0x4e')]=function(_0x527e4f,_0x343187){return respondWithRpcPromise(_0xc455('0x4f'),_0x527e4f[_0xc455('0x17')])[_0xc455('0x9')](respondWithResult(_0x343187,null))[_0xc455('0xd')](handleError(_0x343187,null));};exports[_0xc455('0x50')]=function(_0x4f5f4c,_0x25d963){return respondWithRpcPromise(_0xc455('0x51'),_0x4f5f4c[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x25d963,null))[_0xc455('0xd')](handleError(_0x25d963,null));};exports['mailQueuesWaitingInteractions']=function(_0x220f25,_0x12be2d){return respondWithRpcPromise(_0xc455('0x52'),_0x220f25['query'],routingClient)[_0xc455('0x9')](respondWithResult(_0x12be2d,null))['catch'](handleError(_0x12be2d,null));};exports[_0xc455('0x53')]=function(_0x709126,_0x42b65f){return respondWithRpcPromise(_0xc455('0x54'),_0x709126[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x42b65f,null))[_0xc455('0xd')](handleError(_0x42b65f,null));};exports[_0xc455('0x55')]=function(_0x4ba202,_0x19c484){return respondWithRpcPromise(_0xc455('0x56'),_0x4ba202[_0xc455('0x17')],routingClient)['then'](respondWithResult(_0x19c484,null))[_0xc455('0xd')](handleError(_0x19c484,null));};exports[_0xc455('0x57')]=function(_0x4a699c,_0x439818){return respondWithRpcPromise(_0xc455('0x58'),_0x4a699c[_0xc455('0x17')],routingClient)[_0xc455('0x9')](respondWithResult(_0x439818,null))[_0xc455('0xd')](handleError(_0x439818,null));};exports[_0xc455('0x59')]=function(_0x5677ae){return function(_0x269e8b,_0x23b8b3){var _0x4a9d14,_0x483830;var _0x5e913c=_['capitalize'](_0x5677ae);var _0x16532e=_0x5677ae==='chat'?'Website':'Account';return db[_0x5e913c+_0xc455('0x5a')]['findOne']({'raw':!![],'where':{'id':_0x269e8b['params']['id']}})[_0xc455('0x9')](function(_0x4db946){if(_[_0xc455('0x14')](_0x4db946)){throw new Error(_0x5e913c+'\x20Queue\x20not\x20found');}_0x4a9d14=_0x4db946;return db[_0x5e913c+'Message'][_0xc455('0x5b')]({'where':{'id':_0x269e8b[_0xc455('0x2c')]['messageId']},'include':[{'model':db[_0x5e913c+_0xc455('0x5c')],'as':'Interaction'},{'model':db[_0x5e913c+_0x16532e],'as':_0xc455('0x5d')}]});})[_0xc455('0x9')](function(_0x3fee2c){if(_[_0xc455('0x14')](_0x3fee2c)){throw new Error(_0x5e913c+_0xc455('0x5e'));}_0x483830=_0x3fee2c;return _0x3fee2c[_0xc455('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc455('0x9')](function(){var _0x4894ab={'uniqueid':_0x5677ae+'.'+_0x483830['id']+'.'+_0x483830[_0xc455('0x5c')]['id'],'FromUserId':_0x269e8b[_0xc455('0x2e')]['id'],'type':'queue'};_0x4894ab[_0x5e913c+_0xc455('0x60')]=_0x483830['id'];_0x4894ab[_0x5e913c+_0xc455('0x61')]=_0x483830['Interaction']['id'];_0x4894ab[_0xc455('0x62')+_0x5e913c+_0x16532e+'Id']=_0x483830['Account']['id'];_0x4894ab['To'+_0x5e913c+_0xc455('0x63')]=_0x4a9d14['id'];return db[_0x5e913c+_0xc455('0x64')][_0xc455('0x65')](_0x4894ab);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5677ae,'interaction':_0x483830[_0xc455('0x5c')],'message':_0x483830,'account':_0x483830[_0xc455('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4a9d14[_0xc455('0x12')]+','+(_0x483830[_0xc455('0x5d')]['queueTransferTimeout']||0x12c),'interval':_0xc455('0x66')}]},routingClient);})['then'](respondWithResult(_0x23b8b3,null))[_0xc455('0xd')](handleError(_0x23b8b3,null));};};exports[_0xc455('0x67')]=function(_0x1f48e7,_0x453b4c){var _0x26a8b8,_0x733b3f;if(_['isNil'](_0x1f48e7[_0xc455('0x2c')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4b8af4=_0x1f48e7[_0xc455('0x2c')]['channel'];var _0x68e3d0=_['capitalize'](_0x4b8af4);var _0x47b43a=_0x4b8af4===_0xc455('0x68')?_0xc455('0x69'):_0xc455('0x5d');return db[_0xc455('0x6a')][_0xc455('0x5b')]({'raw':!![],'where':{'id':_0x1f48e7[_0xc455('0x1b')]['id'],'role':_0xc455('0x39')}})[_0xc455('0x9')](function(_0x782daf){if(_['isNil'](_0x782daf)){throw new Error('Agent\x20not\x20found');}_0x26a8b8=_0x782daf;return db[_0x68e3d0+_0xc455('0x6b')][_0xc455('0x5b')]({'where':{'id':_0x1f48e7[_0xc455('0x2c')][_0xc455('0x6c')]},'include':[{'model':db[_0x68e3d0+_0xc455('0x5c')],'as':_0xc455('0x5c')},{'model':db[_0x68e3d0+_0x47b43a],'as':_0xc455('0x5d')}]});})[_0xc455('0x9')](function(_0x2ad319){if(_[_0xc455('0x14')](_0x2ad319)){throw new Error(_0x68e3d0+'\x20Message\x20not\x20found');}_0x733b3f=_0x2ad319;return _0x2ad319[_0xc455('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc455('0x9')](function(){var _0x1e2165={'uniqueid':_0x4b8af4+'.'+_0x733b3f['id']+'.'+_0x733b3f[_0xc455('0x5c')]['id'],'FromUserId':_0x1f48e7[_0xc455('0x2e')]['id'],'type':_0xc455('0x6d'),'ToUserId':_0x26a8b8['id']};_0x1e2165[_0x68e3d0+_0xc455('0x60')]=_0x733b3f['id'];_0x1e2165[_0x68e3d0+_0xc455('0x61')]=_0x733b3f[_0xc455('0x5c')]['id'];_0x1e2165[_0xc455('0x62')+_0x68e3d0+_0x47b43a+'Id']=_0x733b3f[_0xc455('0x5d')]['id'];return db[_0x68e3d0+_0xc455('0x64')][_0xc455('0x65')](_0x1e2165);})[_0xc455('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x4b8af4,'interaction':_0x733b3f['Interaction'],'message':_0x733b3f,'account':_0x733b3f[_0xc455('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xc455('0x39'),'appdata':_0x26a8b8[_0xc455('0x12')]+','+(_0x733b3f[_0xc455('0x5d')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x453b4c,null))['catch'](handleError(_0x453b4c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7a0604a..cf11845 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 _0x47ae=['show','/:id/run','run','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5a1db2,_0x2b9699){var _0x327bcf=function(_0x2ef6a4){while(--_0x2ef6a4){_0x5a1db2['push'](_0x5a1db2['shift']());}};_0x327bcf(++_0x2b9699);}(_0x47ae,0x97));var _0xe47a=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x47ae[_0x35007a];return _0x574f68;};'use strict';var multer=require(_0xe47a('0x0'));var util=require(_0xe47a('0x1'));var path=require(_0xe47a('0x2'));var timeout=require(_0xe47a('0x3'));var express=require(_0xe47a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe47a('0x5'));var config=require(_0xe47a('0x6'));var controller=require('./schedule.controller');router[_0xe47a('0x7')]('/',auth[_0xe47a('0x8')](),controller['index']);router['get']('/:id',auth[_0xe47a('0x8')](),controller[_0xe47a('0x9')]);router[_0xe47a('0x7')](_0xe47a('0xa'),auth[_0xe47a('0x8')](),controller[_0xe47a('0xb')]);router[_0xe47a('0xc')]('/',auth[_0xe47a('0x8')](),controller[_0xe47a('0xd')]);router[_0xe47a('0xe')](_0xe47a('0xf'),auth[_0xe47a('0x8')](),controller[_0xe47a('0x10')]);router[_0xe47a('0x11')](_0xe47a('0xf'),auth[_0xe47a('0x8')](),controller[_0xe47a('0x12')]);module[_0xe47a('0x13')]=router; \ No newline at end of file +var _0x28ac=['path','express','../../components/auth/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','show','/:id/run','run','post','create','put','update','delete','/:id','exports','multer','util'];(function(_0x589eb4,_0xaa2019){var _0xf50816=function(_0x572fc5){while(--_0x572fc5){_0x589eb4['push'](_0x589eb4['shift']());}};_0xf50816(++_0xaa2019);}(_0x28ac,0x9e));var _0xc28a=function(_0x365647,_0x44e6b7){_0x365647=_0x365647-0x0;var _0xdf680f=_0x28ac[_0x365647];return _0xdf680f;};'use strict';var multer=require(_0xc28a('0x0'));var util=require(_0xc28a('0x1'));var path=require(_0xc28a('0x2'));var timeout=require('connect-timeout');var express=require(_0xc28a('0x3'));var router=express['Router']();var auth=require(_0xc28a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc28a('0x5'));var controller=require(_0xc28a('0x6'));router['get']('/',auth[_0xc28a('0x7')](),controller[_0xc28a('0x8')]);router[_0xc28a('0x9')]('/:id',auth[_0xc28a('0x7')](),controller[_0xc28a('0xa')]);router[_0xc28a('0x9')](_0xc28a('0xb'),auth[_0xc28a('0x7')](),controller[_0xc28a('0xc')]);router[_0xc28a('0xd')]('/',auth[_0xc28a('0x7')](),controller[_0xc28a('0xe')]);router[_0xc28a('0xf')]('/:id',auth[_0xc28a('0x7')](),controller[_0xc28a('0x10')]);router[_0xc28a('0x11')](_0xc28a('0x12'),auth[_0xc28a('0x7')](),controller['destroy']);module[_0xc28a('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index e785ffb..dc40b99 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 _0x1623=['TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','days','hours','minutes','csv','pdf','xlsx','custom','default'];(function(_0x4ccc87,_0x1efdb6){var _0x1437b3=function(_0x432f0d){while(--_0x432f0d){_0x4ccc87['push'](_0x4ccc87['shift']());}};_0x1437b3(++_0x1efdb6);}(_0x1623,0xab));var _0x3162=function(_0x2e289d,_0xa23a27){_0x2e289d=_0x2e289d-0x0;var _0x292a6b=_0x1623[_0x2e289d];return _0x292a6b;};'use strict';var Sequelize=require(_0x3162('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3162('0x1')]},'active':{'type':Sequelize[_0x3162('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3162('0x1')],'allowNull':![],'defaultValue':_0x3162('0x3')},'startAt':{'type':Sequelize[_0x3162('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3162('0x5')]('years',_0x3162('0x6'),_0x3162('0x7'),'weeks',_0x3162('0x8'),_0x3162('0x9'),_0x3162('0xa')),'allowNull':![],'defaultValue':_0x3162('0x8')},'output':{'type':Sequelize[_0x3162('0x5')](_0x3162('0xb'),_0x3162('0xc'),_0x3162('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x3162('0xe'),_0x3162('0xf')),'allowNull':![],'defaultValue':_0x3162('0xe')},'sendMail':{'type':Sequelize[_0x3162('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3162('0x1')]},'cc':{'type':Sequelize[_0x3162('0x10')]},'bcc':{'type':Sequelize[_0x3162('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x3162('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7bd0=['days','minutes','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks'];(function(_0x2994b0,_0x45973d){var _0x58377e=function(_0x2634ee){while(--_0x2634ee){_0x2994b0['push'](_0x2994b0['shift']());}};_0x58377e(++_0x45973d);}(_0x7bd0,0x111));var _0x07bd=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x7bd0[_0x1af98d];return _0x3553ea;};'use strict';var Sequelize=require(_0x07bd('0x0'));module[_0x07bd('0x1')]={'name':{'type':Sequelize[_0x07bd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x07bd('0x2')]},'active':{'type':Sequelize[_0x07bd('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x07bd('0x2')],'allowNull':![],'defaultValue':_0x07bd('0x4')},'startAt':{'type':Sequelize[_0x07bd('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x07bd('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x07bd('0x7')](_0x07bd('0x8'),_0x07bd('0x9'),_0x07bd('0xa'),_0x07bd('0xb'),_0x07bd('0xc'),'hours',_0x07bd('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x07bd('0x7')](_0x07bd('0xe'),_0x07bd('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0x07bd('0xe')},'type':{'type':Sequelize[_0x07bd('0x7')](_0x07bd('0x10'),_0x07bd('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x07bd('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x07bd('0x2')]},'cc':{'type':Sequelize[_0x07bd('0x12')]},'bcc':{'type':Sequelize[_0x07bd('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x07bd('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 542da14..7c070a2 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 _0xe0b8=['UserProfileSection','find','userProfileId','autoAssociation','params','run','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','intersection','create','body','user','role'];(function(_0xc5ea76,_0xc9cc02){var _0x4a3697=function(_0x5e579f){while(--_0x5e579f){_0xc5ea76['push'](_0xc5ea76['shift']());}};_0x4a3697(++_0xc9cc02);}(_0xe0b8,0x146));var _0x8e0b=function(_0x18bd06,_0x1574b3){_0x18bd06=_0x18bd06-0x0;var _0x4cf3ce=_0xe0b8[_0x18bd06];return _0x4cf3ce;};'use strict';var pdf=require(_0x8e0b('0x0'));var emlformat=require(_0x8e0b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8e0b('0x2'));var jsonpatch=require(_0x8e0b('0x3'));var rp=require(_0x8e0b('0x4'));var moment=require(_0x8e0b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8e0b('0x6'));var util=require(_0x8e0b('0x7'));var path=require(_0x8e0b('0x8'));var sox=require(_0x8e0b('0x9'));var csv=require(_0x8e0b('0xa'));var ejs=require(_0x8e0b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8e0b('0xa'));var querystring=require(_0x8e0b('0xc'));var Papa=require(_0x8e0b('0xd'));var Redis=require(_0x8e0b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8e0b('0xf'));var as=require(_0x8e0b('0x10'));var hardwareService=require(_0x8e0b('0x11'));var logger=require('../../config/logger')(_0x8e0b('0x12'));var utils=require(_0x8e0b('0x13'));var config=require('../../config/environment');var db=require(_0x8e0b('0x14'))['db'];function respondWithStatusCode(_0x35d9ef,_0x3f9baa){_0x3f9baa=_0x3f9baa||0xcc;return function(_0x260792){if(_0x260792){return _0x35d9ef[_0x8e0b('0x15')](_0x3f9baa);}return _0x35d9ef[_0x8e0b('0x16')](_0x3f9baa)[_0x8e0b('0x17')]();};}function respondWithResult(_0x4ce43a,_0x4009d4){_0x4009d4=_0x4009d4||0xc8;return function(_0x2423e0){if(_0x2423e0){return _0x4ce43a[_0x8e0b('0x16')](_0x4009d4)[_0x8e0b('0x18')](_0x2423e0);}};}function respondWithFilteredResult(_0xda5b11,_0x1386b9){return function(_0x51acc6){if(_0x51acc6){var _0xc3a67=_0x51acc6[_0x8e0b('0x19')],_0x2173f7=_0x1386b9[_0x8e0b('0x1a')],_0x1f76b5=_0x1386b9[_0x8e0b('0x1a')]+_0x1386b9[_0x8e0b('0x1b')],_0x19d05b;if(_0x1f76b5>=_0xc3a67){_0x1f76b5=_0xc3a67;_0x19d05b=0xc8;}else{_0x19d05b=0xce;}_0xda5b11['status'](_0x19d05b);return _0xda5b11[_0x8e0b('0x1c')](_0x8e0b('0x1d'),_0x2173f7+'-'+_0x1f76b5+'/'+_0xc3a67)[_0x8e0b('0x18')](_0x51acc6);}return null;};}function patchUpdates(_0x2df9d6){return function(_0x2a5d00){try{jsonpatch['apply'](_0x2a5d00,_0x2df9d6,!![]);}catch(_0x11f60c){return BPromise['reject'](_0x11f60c);}return _0x2a5d00[_0x8e0b('0x1e')]();};}function saveUpdates(_0x3c8c4,_0x49f0a3){return function(_0x263bb0){if(_0x263bb0){return _0x263bb0[_0x8e0b('0x1f')](_0x3c8c4)[_0x8e0b('0x20')](function(_0x91c238){return _0x91c238;});}return null;};}function removeEntity(_0x4de28b,_0xad68a){return function(_0x2c018e){if(_0x2c018e){return _0x2c018e[_0x8e0b('0x21')]()[_0x8e0b('0x20')](function(){var _0x974f68=_0x2c018e[_0x8e0b('0x22')]({'plain':!![]});var _0x567f90=_0x8e0b('0x23');return db[_0x8e0b('0x24')][_0x8e0b('0x21')]({'where':{'type':_0x567f90,'resourceId':_0x974f68['id']}})['then'](function(){return _0x2c018e;});})[_0x8e0b('0x20')](function(){_0x4de28b[_0x8e0b('0x16')](0xcc)[_0x8e0b('0x17')]();});}};}function handleEntityNotFound(_0x50fc6d,_0x2e427d){return function(_0x1e6fd3){if(!_0x1e6fd3){_0x50fc6d[_0x8e0b('0x15')](0x194);}return _0x1e6fd3;};}function handleError(_0x26e4bd,_0x1c3471){_0x1c3471=_0x1c3471||0x1f4;return function(_0xef1971){logger[_0x8e0b('0x25')](_0xef1971[_0x8e0b('0x26')]);if(_0xef1971['name']){delete _0xef1971[_0x8e0b('0x27')];}_0x26e4bd['status'](_0x1c3471)[_0x8e0b('0x28')](_0xef1971);};}exports['index']=function(_0x36c1b5,_0x6cdb1d){var _0x254d56={},_0x1e6f14={},_0x396d9e={'count':0x0,'rows':[]};var _0x55e191=_[_0x8e0b('0x29')](db[_0x8e0b('0x2a')][_0x8e0b('0x2b')],function(_0xa04b4e){return{'name':_0xa04b4e['fieldName'],'type':_0xa04b4e[_0x8e0b('0x2c')][_0x8e0b('0x2d')]};});_0x1e6f14[_0x8e0b('0x2e')]=_[_0x8e0b('0x29')](_0x55e191,_0x8e0b('0x27'));_0x1e6f14[_0x8e0b('0x2f')]=_[_0x8e0b('0x30')](_0x36c1b5[_0x8e0b('0x2f')]);_0x1e6f14['filters']=_['intersection'](_0x1e6f14['model'],_0x1e6f14[_0x8e0b('0x2f')]);_0x254d56[_0x8e0b('0x31')]=_['intersection'](_0x1e6f14['model'],qs[_0x8e0b('0x32')](_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x32')]));_0x254d56[_0x8e0b('0x31')]=_0x254d56['attributes'][_0x8e0b('0x33')]?_0x254d56[_0x8e0b('0x31')]:_0x1e6f14['model'];if(!_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x34')](_0x8e0b('0x35'))){_0x254d56[_0x8e0b('0x1b')]=qs[_0x8e0b('0x1b')](_0x36c1b5[_0x8e0b('0x2f')]['limit']);_0x254d56['offset']=qs[_0x8e0b('0x1a')](_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x1a')]);}_0x254d56[_0x8e0b('0x36')]=qs[_0x8e0b('0x37')](_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x37')]);_0x254d56['where']=qs[_0x8e0b('0x38')](_[_0x8e0b('0x39')](_0x36c1b5[_0x8e0b('0x2f')],_0x1e6f14['filters']));if(_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x3a')]){_0x254d56['where']=_['merge'](_0x254d56[_0x8e0b('0x3b')],{'$or':_[_0x8e0b('0x29')](_0x55e191,function(_0x5b3a5b){if(_0x5b3a5b['type']!==_0x8e0b('0x3c')){var _0x51ca66={};_0x51ca66[_0x5b3a5b[_0x8e0b('0x27')]]={'$like':'%'+_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x3a')]+'%'};return _0x51ca66;}})});}_0x254d56=_[_0x8e0b('0x3d')]({},_0x254d56,_0x36c1b5[_0x8e0b('0x3e')]);var _0x146e12={'where':_0x254d56['where']};return db[_0x8e0b('0x2a')][_0x8e0b('0x19')](_0x146e12)['then'](function(_0x2e6c3a){_0x396d9e[_0x8e0b('0x19')]=_0x2e6c3a;if(_0x36c1b5[_0x8e0b('0x2f')][_0x8e0b('0x3f')]){_0x254d56[_0x8e0b('0x40')]=[{'all':!![]}];}return db[_0x8e0b('0x2a')][_0x8e0b('0x41')](_0x254d56);})[_0x8e0b('0x20')](function(_0x9c3aff){_0x396d9e[_0x8e0b('0x42')]=_0x9c3aff;return _0x396d9e;})[_0x8e0b('0x20')](respondWithFilteredResult(_0x6cdb1d,_0x254d56))[_0x8e0b('0x43')](handleError(_0x6cdb1d,null));};exports[_0x8e0b('0x44')]=function(_0x457d97,_0x1a227a){var _0x1facc0={'raw':![],'where':{'id':_0x457d97['params']['id']}},_0x423e2e={};_0x423e2e['model']=_[_0x8e0b('0x30')](db[_0x8e0b('0x2a')][_0x8e0b('0x2b')]);_0x423e2e[_0x8e0b('0x2f')]=_['keys'](_0x457d97['query']);_0x423e2e[_0x8e0b('0x38')]=_[_0x8e0b('0x45')](_0x423e2e['model'],_0x423e2e['query']);_0x1facc0[_0x8e0b('0x31')]=_[_0x8e0b('0x45')](_0x423e2e[_0x8e0b('0x2e')],qs['fields'](_0x457d97[_0x8e0b('0x2f')]['fields']));_0x1facc0['attributes']=_0x1facc0['attributes'][_0x8e0b('0x33')]?_0x1facc0['attributes']:_0x423e2e['model'];if(_0x457d97[_0x8e0b('0x2f')][_0x8e0b('0x3f')]){_0x1facc0[_0x8e0b('0x40')]=[{'all':!![]}];}_0x1facc0=_['merge']({},_0x1facc0,_0x457d97[_0x8e0b('0x3e')]);return db['Schedule']['find'](_0x1facc0)[_0x8e0b('0x20')](handleEntityNotFound(_0x1a227a,null))[_0x8e0b('0x20')](respondWithResult(_0x1a227a,null))[_0x8e0b('0x43')](handleError(_0x1a227a,null));};exports[_0x8e0b('0x46')]=function(_0x2e079a,_0x31dce1){return db[_0x8e0b('0x2a')]['create'](_0x2e079a[_0x8e0b('0x47')],{})['then'](function(_0x2dc552){var _0x36a408=_0x2e079a[_0x8e0b('0x48')][_0x8e0b('0x22')]({'plain':!![]});if(!_0x36a408)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36a408[_0x8e0b('0x49')]===_0x8e0b('0x48')){var _0x85691e=_0x2dc552[_0x8e0b('0x22')]({'plain':!![]});var _0x564241=_0x8e0b('0x23');return db[_0x8e0b('0x4a')][_0x8e0b('0x4b')]({'where':{'name':_0x564241,'userProfileId':_0x36a408[_0x8e0b('0x4c')]},'raw':!![]})[_0x8e0b('0x20')](function(_0xb51ec4){if(_0xb51ec4&&_0xb51ec4[_0x8e0b('0x4d')]===0x0){return db[_0x8e0b('0x24')]['create']({'name':_0x85691e[_0x8e0b('0x27')],'resourceId':_0x85691e['id'],'type':_0xb51ec4[_0x8e0b('0x27')],'sectionId':_0xb51ec4['id']},{})['then'](function(){return _0x2dc552;});}else{return _0x2dc552;}})['catch'](function(_0x300d53){logger[_0x8e0b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x300d53);throw _0x300d53;});}return _0x2dc552;})[_0x8e0b('0x20')](respondWithResult(_0x31dce1,0xc9))[_0x8e0b('0x43')](handleError(_0x31dce1,null));};exports['update']=function(_0x1eb512,_0x27413e){if(_0x1eb512[_0x8e0b('0x47')]['id']){delete _0x1eb512['body']['id'];}return db[_0x8e0b('0x2a')][_0x8e0b('0x4b')]({'where':{'id':_0x1eb512['params']['id']}})[_0x8e0b('0x20')](handleEntityNotFound(_0x27413e,null))[_0x8e0b('0x20')](saveUpdates(_0x1eb512[_0x8e0b('0x47')],null))[_0x8e0b('0x20')](respondWithResult(_0x27413e,null))[_0x8e0b('0x43')](handleError(_0x27413e,null));};exports[_0x8e0b('0x21')]=function(_0x10d06d,_0x266f9a){return db['Schedule'][_0x8e0b('0x4b')]({'where':{'id':_0x10d06d[_0x8e0b('0x4e')]['id']}})[_0x8e0b('0x20')](handleEntityNotFound(_0x266f9a,null))[_0x8e0b('0x20')](removeEntity(_0x266f9a,null))['catch'](handleError(_0x266f9a,null));};exports['run']=function(_0x21118e,_0x76855e,_0x37ee1f){var _0x3a21de=require('../../config/schedule');return db['Schedule'][_0x8e0b('0x4b')]({'where':{'id':_0x21118e[_0x8e0b('0x4e')]['id']},'raw':!![]})[_0x8e0b('0x20')](handleEntityNotFound(_0x76855e,null))[_0x8e0b('0x20')](function(){_0x3a21de[_0x8e0b('0x4f')](_0x21118e[_0x8e0b('0x4e')]['id']);})[_0x8e0b('0x20')](respondWithStatusCode(_0x76855e,null))['catch'](handleError(_0x76855e,null));}; \ No newline at end of file +var _0xb6e4=['model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','Scheduler','UserProfileResource','error','name','index','map','Schedule','rawAttributes','fieldName','type','key'];(function(_0x46f5ef,_0x337f98){var _0x46f2a2=function(_0x2833db){while(--_0x2833db){_0x46f5ef['push'](_0x46f5ef['shift']());}};_0x46f2a2(++_0x337f98);}(_0xb6e4,0x11b));var _0x4b6e=function(_0x2e3f94,_0x8d75fb){_0x2e3f94=_0x2e3f94-0x0;var _0x328b06=_0xb6e4[_0x2e3f94];return _0x328b06;};'use strict';var pdf=require(_0x4b6e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4b6e('0x1'));var zipdir=require(_0x4b6e('0x2'));var jsonpatch=require(_0x4b6e('0x3'));var rp=require(_0x4b6e('0x4'));var moment=require('moment');var BPromise=require(_0x4b6e('0x5'));var Mustache=require(_0x4b6e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4b6e('0x7'));var csv=require(_0x4b6e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4b6e('0x9'));var crypto=require(_0x4b6e('0xa'));var jsforce=require(_0x4b6e('0xb'));var deskjs=require(_0x4b6e('0xc'));var toCsv=require(_0x4b6e('0x8'));var querystring=require(_0x4b6e('0xd'));var Papa=require(_0x4b6e('0xe'));var Redis=require(_0x4b6e('0xf'));var authService=require(_0x4b6e('0x10'));var qs=require(_0x4b6e('0x11'));var as=require(_0x4b6e('0x12'));var hardwareService=require(_0x4b6e('0x13'));var logger=require(_0x4b6e('0x14'))('api');var utils=require(_0x4b6e('0x15'));var config=require(_0x4b6e('0x16'));var db=require(_0x4b6e('0x17'))['db'];function respondWithStatusCode(_0x24da9d,_0x363575){_0x363575=_0x363575||0xcc;return function(_0x2b6de2){if(_0x2b6de2){return _0x24da9d[_0x4b6e('0x18')](_0x363575);}return _0x24da9d['status'](_0x363575)[_0x4b6e('0x19')]();};}function respondWithResult(_0x54c69d,_0x3f7f53){_0x3f7f53=_0x3f7f53||0xc8;return function(_0x164e3e){if(_0x164e3e){return _0x54c69d['status'](_0x3f7f53)[_0x4b6e('0x1a')](_0x164e3e);}};}function respondWithFilteredResult(_0x22780f,_0x3f2ba9){return function(_0x1f5b6a){if(_0x1f5b6a){var _0x5aac48=_0x1f5b6a[_0x4b6e('0x1b')],_0x3c2a8f=_0x3f2ba9[_0x4b6e('0x1c')],_0x40dbb5=_0x3f2ba9[_0x4b6e('0x1c')]+_0x3f2ba9[_0x4b6e('0x1d')],_0x5b1f6e;if(_0x40dbb5>=_0x5aac48){_0x40dbb5=_0x5aac48;_0x5b1f6e=0xc8;}else{_0x5b1f6e=0xce;}_0x22780f['status'](_0x5b1f6e);return _0x22780f[_0x4b6e('0x1e')](_0x4b6e('0x1f'),_0x3c2a8f+'-'+_0x40dbb5+'/'+_0x5aac48)[_0x4b6e('0x1a')](_0x1f5b6a);}return null;};}function patchUpdates(_0x59bee8){return function(_0x571cb6){try{jsonpatch[_0x4b6e('0x20')](_0x571cb6,_0x59bee8,!![]);}catch(_0x14cd0c){return BPromise[_0x4b6e('0x21')](_0x14cd0c);}return _0x571cb6['save']();};}function saveUpdates(_0x36d344,_0x3a6970){return function(_0x224aee){if(_0x224aee){return _0x224aee[_0x4b6e('0x22')](_0x36d344)['then'](function(_0x3ebde3){return _0x3ebde3;});}return null;};}function removeEntity(_0x51da44,_0x446f6a){return function(_0xcae3d6){if(_0xcae3d6){return _0xcae3d6[_0x4b6e('0x23')]()[_0x4b6e('0x24')](function(){var _0x5a5125=_0xcae3d6[_0x4b6e('0x25')]({'plain':!![]});var _0x40ac52=_0x4b6e('0x26');return db[_0x4b6e('0x27')]['destroy']({'where':{'type':_0x40ac52,'resourceId':_0x5a5125['id']}})[_0x4b6e('0x24')](function(){return _0xcae3d6;});})['then'](function(){_0x51da44['status'](0xcc)[_0x4b6e('0x19')]();});}};}function handleEntityNotFound(_0x19d869,_0x4b5b3a){return function(_0x11c4fb){if(!_0x11c4fb){_0x19d869[_0x4b6e('0x18')](0x194);}return _0x11c4fb;};}function handleError(_0x5ef859,_0x5a012f){_0x5a012f=_0x5a012f||0x1f4;return function(_0x4fc5b1){logger[_0x4b6e('0x28')](_0x4fc5b1['stack']);if(_0x4fc5b1[_0x4b6e('0x29')]){delete _0x4fc5b1[_0x4b6e('0x29')];}_0x5ef859['status'](_0x5a012f)['send'](_0x4fc5b1);};}exports[_0x4b6e('0x2a')]=function(_0xb8b05c,_0x11e945){var _0x1dd645={},_0x3a8633={},_0x2eb7cb={'count':0x0,'rows':[]};var _0x1abfbc=_[_0x4b6e('0x2b')](db[_0x4b6e('0x2c')][_0x4b6e('0x2d')],function(_0x2275f7){return{'name':_0x2275f7[_0x4b6e('0x2e')],'type':_0x2275f7[_0x4b6e('0x2f')][_0x4b6e('0x30')]};});_0x3a8633[_0x4b6e('0x31')]=_[_0x4b6e('0x2b')](_0x1abfbc,_0x4b6e('0x29'));_0x3a8633[_0x4b6e('0x32')]=_[_0x4b6e('0x33')](_0xb8b05c[_0x4b6e('0x32')]);_0x3a8633[_0x4b6e('0x34')]=_[_0x4b6e('0x35')](_0x3a8633['model'],_0x3a8633[_0x4b6e('0x32')]);_0x1dd645[_0x4b6e('0x36')]=_['intersection'](_0x3a8633[_0x4b6e('0x31')],qs[_0x4b6e('0x37')](_0xb8b05c[_0x4b6e('0x32')][_0x4b6e('0x37')]));_0x1dd645[_0x4b6e('0x36')]=_0x1dd645[_0x4b6e('0x36')][_0x4b6e('0x38')]?_0x1dd645[_0x4b6e('0x36')]:_0x3a8633[_0x4b6e('0x31')];if(!_0xb8b05c[_0x4b6e('0x32')]['hasOwnProperty']('nolimit')){_0x1dd645[_0x4b6e('0x1d')]=qs[_0x4b6e('0x1d')](_0xb8b05c[_0x4b6e('0x32')]['limit']);_0x1dd645[_0x4b6e('0x1c')]=qs['offset'](_0xb8b05c[_0x4b6e('0x32')][_0x4b6e('0x1c')]);}_0x1dd645[_0x4b6e('0x39')]=qs[_0x4b6e('0x3a')](_0xb8b05c[_0x4b6e('0x32')][_0x4b6e('0x3a')]);_0x1dd645[_0x4b6e('0x3b')]=qs[_0x4b6e('0x34')](_[_0x4b6e('0x3c')](_0xb8b05c[_0x4b6e('0x32')],_0x3a8633[_0x4b6e('0x34')]));if(_0xb8b05c[_0x4b6e('0x32')][_0x4b6e('0x3d')]){_0x1dd645[_0x4b6e('0x3b')]=_[_0x4b6e('0x3e')](_0x1dd645[_0x4b6e('0x3b')],{'$or':_[_0x4b6e('0x2b')](_0x1abfbc,function(_0x20da20){if(_0x20da20[_0x4b6e('0x2f')]!==_0x4b6e('0x3f')){var _0x3ed616={};_0x3ed616[_0x20da20[_0x4b6e('0x29')]]={'$like':'%'+_0xb8b05c[_0x4b6e('0x32')]['filter']+'%'};return _0x3ed616;}})});}_0x1dd645=_['merge']({},_0x1dd645,_0xb8b05c[_0x4b6e('0x40')]);var _0x9a70aa={'where':_0x1dd645[_0x4b6e('0x3b')]};return db['Schedule']['count'](_0x9a70aa)['then'](function(_0x24712d){_0x2eb7cb[_0x4b6e('0x1b')]=_0x24712d;if(_0xb8b05c[_0x4b6e('0x32')][_0x4b6e('0x41')]){_0x1dd645[_0x4b6e('0x42')]=[{'all':!![]}];}return db[_0x4b6e('0x2c')][_0x4b6e('0x43')](_0x1dd645);})[_0x4b6e('0x24')](function(_0x22e761){_0x2eb7cb[_0x4b6e('0x44')]=_0x22e761;return _0x2eb7cb;})[_0x4b6e('0x24')](respondWithFilteredResult(_0x11e945,_0x1dd645))[_0x4b6e('0x45')](handleError(_0x11e945,null));};exports[_0x4b6e('0x46')]=function(_0x3dd416,_0x43e23e){var _0x5f0545={'raw':![],'where':{'id':_0x3dd416[_0x4b6e('0x47')]['id']}},_0x555468={};_0x555468[_0x4b6e('0x31')]=_[_0x4b6e('0x33')](db[_0x4b6e('0x2c')][_0x4b6e('0x2d')]);_0x555468[_0x4b6e('0x32')]=_[_0x4b6e('0x33')](_0x3dd416['query']);_0x555468[_0x4b6e('0x34')]=_[_0x4b6e('0x35')](_0x555468[_0x4b6e('0x31')],_0x555468[_0x4b6e('0x32')]);_0x5f0545[_0x4b6e('0x36')]=_[_0x4b6e('0x35')](_0x555468[_0x4b6e('0x31')],qs[_0x4b6e('0x37')](_0x3dd416[_0x4b6e('0x32')][_0x4b6e('0x37')]));_0x5f0545['attributes']=_0x5f0545[_0x4b6e('0x36')][_0x4b6e('0x38')]?_0x5f0545[_0x4b6e('0x36')]:_0x555468[_0x4b6e('0x31')];if(_0x3dd416[_0x4b6e('0x32')][_0x4b6e('0x41')]){_0x5f0545[_0x4b6e('0x42')]=[{'all':!![]}];}_0x5f0545=_[_0x4b6e('0x3e')]({},_0x5f0545,_0x3dd416[_0x4b6e('0x40')]);return db['Schedule'][_0x4b6e('0x48')](_0x5f0545)[_0x4b6e('0x24')](handleEntityNotFound(_0x43e23e,null))[_0x4b6e('0x24')](respondWithResult(_0x43e23e,null))['catch'](handleError(_0x43e23e,null));};exports[_0x4b6e('0x49')]=function(_0x149e69,_0x1239ad){return db[_0x4b6e('0x2c')][_0x4b6e('0x49')](_0x149e69[_0x4b6e('0x4a')],{})[_0x4b6e('0x24')](function(_0x35f693){var _0x5b8539=_0x149e69[_0x4b6e('0x4b')][_0x4b6e('0x25')]({'plain':!![]});if(!_0x5b8539)throw new Error(_0x4b6e('0x4c'));if(_0x5b8539[_0x4b6e('0x4d')]===_0x4b6e('0x4b')){var _0x5eb0c5=_0x35f693['get']({'plain':!![]});var _0x24e7a4=_0x4b6e('0x26');return db[_0x4b6e('0x4e')][_0x4b6e('0x48')]({'where':{'name':_0x24e7a4,'userProfileId':_0x5b8539[_0x4b6e('0x4f')]},'raw':!![]})[_0x4b6e('0x24')](function(_0x49a69a){if(_0x49a69a&&_0x49a69a[_0x4b6e('0x50')]===0x0){return db[_0x4b6e('0x27')]['create']({'name':_0x5eb0c5[_0x4b6e('0x29')],'resourceId':_0x5eb0c5['id'],'type':_0x49a69a[_0x4b6e('0x29')],'sectionId':_0x49a69a['id']},{})[_0x4b6e('0x24')](function(){return _0x35f693;});}else{return _0x35f693;}})[_0x4b6e('0x45')](function(_0x445394){logger['error'](_0x4b6e('0x51'),_0x445394);throw _0x445394;});}return _0x35f693;})[_0x4b6e('0x24')](respondWithResult(_0x1239ad,0xc9))[_0x4b6e('0x45')](handleError(_0x1239ad,null));};exports[_0x4b6e('0x22')]=function(_0x145d30,_0xc67d3b){if(_0x145d30[_0x4b6e('0x4a')]['id']){delete _0x145d30['body']['id'];}return db[_0x4b6e('0x2c')][_0x4b6e('0x48')]({'where':{'id':_0x145d30['params']['id']}})['then'](handleEntityNotFound(_0xc67d3b,null))[_0x4b6e('0x24')](saveUpdates(_0x145d30['body'],null))[_0x4b6e('0x24')](respondWithResult(_0xc67d3b,null))[_0x4b6e('0x45')](handleError(_0xc67d3b,null));};exports[_0x4b6e('0x23')]=function(_0x1719d4,_0x5c9500){return db['Schedule'][_0x4b6e('0x48')]({'where':{'id':_0x1719d4[_0x4b6e('0x47')]['id']}})[_0x4b6e('0x24')](handleEntityNotFound(_0x5c9500,null))[_0x4b6e('0x24')](removeEntity(_0x5c9500,null))[_0x4b6e('0x45')](handleError(_0x5c9500,null));};exports['run']=function(_0x56d5f7,_0x4c4d2e,_0xecbc2){var _0xa1d1b2=require('../../config/schedule');return db[_0x4b6e('0x2c')][_0x4b6e('0x48')]({'where':{'id':_0x56d5f7[_0x4b6e('0x47')]['id']},'raw':!![]})[_0x4b6e('0x24')](handleEntityNotFound(_0x4c4d2e,null))[_0x4b6e('0x24')](function(){_0xa1d1b2[_0x4b6e('0x52')](_0x56d5f7['params']['id']);})['then'](respondWithStatusCode(_0x4c4d2e,null))['catch'](handleError(_0x4c4d2e,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index cb6c39a..a69a6c1 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 _0x57d6=['path','rimraf','./schedule.attributes','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3df186,_0x12592c){var _0x5440fc=function(_0x2a7a70){while(--_0x2a7a70){_0x3df186['push'](_0x3df186['shift']());}};_0x5440fc(++_0x12592c);}(_0x57d6,0x9e));var _0x657d=function(_0x5d7141,_0x59c862){_0x5d7141=_0x5d7141-0x0;var _0x101738=_0x57d6[_0x5d7141];return _0x101738;};'use strict';var _=require(_0x657d('0x0'));var util=require(_0x657d('0x1'));var logger=require(_0x657d('0x2'))(_0x657d('0x3'));var moment=require(_0x657d('0x4'));var BPromise=require(_0x657d('0x5'));var rp=require(_0x657d('0x6'));var fs=require('fs');var path=require(_0x657d('0x7'));var rimraf=require(_0x657d('0x8'));var config=require('../../config/environment');var attributes=require(_0x657d('0x9'));module['exports']=function(_0x4edf20,_0x2b4111){return _0x4edf20['define']('Schedule',attributes,{'tableName':_0x657d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fa2=['request-promise','rimraf','../../config/environment','Schedule','tools_schedules','lodash','../../config/logger','api','bluebird'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x0fa2,0x68));var _0x20fa=function(_0xa491cd,_0x3c07b1){_0xa491cd=_0xa491cd-0x0;var _0x34bece=_0x0fa2[_0xa491cd];return _0x34bece;};'use strict';var _=require(_0x20fa('0x0'));var util=require('util');var logger=require(_0x20fa('0x1'))(_0x20fa('0x2'));var moment=require('moment');var BPromise=require(_0x20fa('0x3'));var rp=require(_0x20fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20fa('0x5'));var config=require(_0x20fa('0x6'));var attributes=require('./schedule.attributes');module['exports']=function(_0x1781d5,_0x494ade){return _0x1781d5['define'](_0x20fa('0x7'),attributes,{'tableName':_0x20fa('0x8'),'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 baac81d..3b3708b 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 _0xcb88=['then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','Schedule,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x19f137,_0x69a6c5){var _0x13021f=function(_0x53e2c5){while(--_0x53e2c5){_0x19f137['push'](_0x19f137['shift']());}};_0x13021f(++_0x69a6c5);}(_0xcb88,0x169));var _0x8cb8=function(_0x11ab61,_0x22cfe0){_0x11ab61=_0x11ab61-0x0;var _0x62597=_0xcb88[_0x11ab61];return _0x62597;};'use strict';var _=require(_0x8cb8('0x0'));var util=require(_0x8cb8('0x1'));var moment=require(_0x8cb8('0x2'));var BPromise=require(_0x8cb8('0x3'));var rs=require(_0x8cb8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb8('0x5'))['db'];var utils=require(_0x8cb8('0x6'));var logger=require(_0x8cb8('0x7'))(_0x8cb8('0x8'));var config=require(_0x8cb8('0x9'));var jayson=require(_0x8cb8('0xa'));var client=jayson[_0x8cb8('0xb')][_0x8cb8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b92c6,_0x23ef62,_0x49d390){return new BPromise(function(_0xad7f46,_0x9c25a7){return client[_0x8cb8('0xd')](_0x2b92c6,_0x49d390)[_0x8cb8('0xe')](function(_0xd83639){logger[_0x8cb8('0xf')]('Schedule,\x20%s,\x20%s',_0x23ef62,_0x8cb8('0x10'));logger[_0x8cb8('0x11')](_0x8cb8('0x12'),_0x23ef62,'request\x20sent',JSON[_0x8cb8('0x13')](_0xd83639));if(_0xd83639[_0x8cb8('0x14')]){if(_0xd83639['error']['code']===0x1f4){logger[_0x8cb8('0x14')]('Schedule,\x20%s,\x20%s',_0x23ef62,_0xd83639['error'][_0x8cb8('0x15')]);return _0x9c25a7(_0xd83639[_0x8cb8('0x14')][_0x8cb8('0x15')]);}logger['error'](_0x8cb8('0x16'),_0x23ef62,_0xd83639[_0x8cb8('0x14')]['message']);return _0xad7f46(_0xd83639[_0x8cb8('0x14')][_0x8cb8('0x15')]);}else{logger[_0x8cb8('0xf')](_0x8cb8('0x16'),_0x23ef62,_0x8cb8('0x10'));_0xad7f46(_0xd83639[_0x8cb8('0x17')][_0x8cb8('0x15')]);}})[_0x8cb8('0x18')](function(_0x547448){logger['error'](_0x8cb8('0x16'),_0x23ef62,_0x547448);_0x9c25a7(_0x547448);});});} \ No newline at end of file +var _0x794f=['error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x794f,0x65));var _0xf794=function(_0x3f7bdf,_0x1b66b7){_0x3f7bdf=_0x3f7bdf-0x0;var _0x12c15a=_0x794f[_0x3f7bdf];return _0x12c15a;};'use strict';var _=require(_0xf794('0x0'));var util=require(_0xf794('0x1'));var moment=require(_0xf794('0x2'));var BPromise=require('bluebird');var rs=require(_0xf794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf794('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf794('0x5'))(_0xf794('0x6'));var config=require(_0xf794('0x7'));var jayson=require(_0xf794('0x8'));var client=jayson[_0xf794('0x9')][_0xf794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x269294,_0x29bdd7,_0x3b9352){return new BPromise(function(_0x175aba,_0x466887){return client[_0xf794('0xb')](_0x269294,_0x3b9352)[_0xf794('0xc')](function(_0x35103f){logger[_0xf794('0xd')](_0xf794('0xe'),_0x29bdd7,_0xf794('0xf'));logger[_0xf794('0x10')](_0xf794('0x11'),_0x29bdd7,_0xf794('0xf'),JSON[_0xf794('0x12')](_0x35103f));if(_0x35103f['error']){if(_0x35103f[_0xf794('0x13')][_0xf794('0x14')]===0x1f4){logger[_0xf794('0x13')](_0xf794('0xe'),_0x29bdd7,_0x35103f[_0xf794('0x13')][_0xf794('0x15')]);return _0x466887(_0x35103f[_0xf794('0x13')][_0xf794('0x15')]);}logger[_0xf794('0x13')]('Schedule,\x20%s,\x20%s',_0x29bdd7,_0x35103f[_0xf794('0x13')][_0xf794('0x15')]);return _0x175aba(_0x35103f[_0xf794('0x13')][_0xf794('0x15')]);}else{logger[_0xf794('0xd')](_0xf794('0xe'),_0x29bdd7,'request\x20sent');_0x175aba(_0x35103f[_0xf794('0x16')][_0xf794('0x15')]);}})[_0xf794('0x17')](function(_0x27da5a){logger[_0xf794('0x13')](_0xf794('0xe'),_0x29bdd7,_0x27da5a);_0x466887(_0x27da5a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b0e56c5..f68d29d 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 _0xcedb=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcedb,0x141));var _0xbced=function(_0x28296f,_0x34a1bc){_0x28296f=_0x28296f-0x0;var _0x5d8c80=_0xcedb[_0x28296f];return _0x5d8c80;};'use strict';var multer=require(_0xbced('0x0'));var util=require(_0xbced('0x1'));var path=require(_0xbced('0x2'));var timeout=require(_0xbced('0x3'));var express=require(_0xbced('0x4'));var router=express['Router']();var auth=require(_0xbced('0x5'));var interaction=require(_0xbced('0x6'));var config=require('../../config/environment');var controller=require(_0xbced('0x7'));router[_0xbced('0x8')]('/',auth[_0xbced('0x9')](),controller[_0xbced('0xa')]);router[_0xbced('0x8')](_0xbced('0xb'),auth[_0xbced('0x9')](),controller[_0xbced('0xc')]);router[_0xbced('0x8')](_0xbced('0xd'),auth[_0xbced('0x9')](),controller['show']);router[_0xbced('0x8')](_0xbced('0xe'),auth['isAuthenticated'](),controller[_0xbced('0xf')]);router[_0xbced('0x10')]('/',auth['isAuthenticated'](),controller[_0xbced('0x11')]);router[_0xbced('0x12')](_0xbced('0xd'),auth['isAuthenticated'](),controller[_0xbced('0x13')]);router[_0xbced('0x14')](_0xbced('0xd'),auth[_0xbced('0x9')](),controller[_0xbced('0x15')]);module[_0xbced('0x16')]=router; \ No newline at end of file +var _0x7604=['create','/:id','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','download','post'];(function(_0x2bbba7,_0x29304a){var _0x14cf36=function(_0x23714b){while(--_0x23714b){_0x2bbba7['push'](_0x2bbba7['shift']());}};_0x14cf36(++_0x29304a);}(_0x7604,0x9a));var _0x4760=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7604[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x4760('0x0'));var path=require(_0x4760('0x1'));var timeout=require('connect-timeout');var express=require(_0x4760('0x2'));var router=express[_0x4760('0x3')]();var auth=require(_0x4760('0x4'));var interaction=require(_0x4760('0x5'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x4760('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4760('0x6')]('/describe',auth[_0x4760('0x7')](),controller['describe']);router[_0x4760('0x6')]('/:id',auth[_0x4760('0x7')](),controller[_0x4760('0x8')]);router[_0x4760('0x6')]('/:id/download',auth[_0x4760('0x7')](),controller[_0x4760('0x9')]);router[_0x4760('0xa')]('/',auth['isAuthenticated'](),controller[_0x4760('0xb')]);router['put'](_0x4760('0xc'),auth[_0x4760('0x7')](),controller[_0x4760('0xd')]);router['delete'](_0x4760('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4760('0xe')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 3f49a00..3ae421f 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 _0x5fc3=['duration','startedAt','toString','closedAt','format','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','subtract'];(function(_0x1074ee,_0x230f04){var _0x4ad58d=function(_0x3363f2){while(--_0x3363f2){_0x1074ee['push'](_0x1074ee['shift']());}};_0x4ad58d(++_0x230f04);}(_0x5fc3,0xa8));var _0x35fc=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0x5fc3[_0x29e35f];return _0x266b74;};'use strict';var Sequelize=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var path=require('path');var config=require(_0x35fc('0x2'));module[_0x35fc('0x3')]={'format':{'type':Sequelize[_0x35fc('0x4')],'get':function(){return this[_0x35fc('0x5')](_0x35fc('0x6'))?path['extname'](this[_0x35fc('0x5')](_0x35fc('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x35fc('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x19a0d1){var _0x508b32=_0x19a0d1[_0x35fc('0x8')](/\\/g,'/');this[_0x35fc('0x9')](_0x35fc('0x6'),_0x508b32);}},'rating':{'type':Sequelize[_0x35fc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x35fc('0xa')],'set':function(_0xf9d3a6){this[_0x35fc('0x9')]('startedAt',moment()[_0x35fc('0xb')](_0xf9d3a6,'ms'));this[_0x35fc('0x9')]('closedAt',moment());this[_0x35fc('0x9')](_0x35fc('0xc'),_0xf9d3a6);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x35fc('0x5')](_0x35fc('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x35fc('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x35fc('0x5')](_0x35fc('0xf')))[_0x35fc('0x10')](_0x35fc('0x11'))[_0x35fc('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x35fc('0x11'))[_0x35fc('0xe')]();}},'updatedAt':{'type':Sequelize[_0x35fc('0x12')],'get':function(){return moment(this[_0x35fc('0x5')](_0x35fc('0x13')))[_0x35fc('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x35fc('0xe')]();}}}; \ No newline at end of file +var _0x2bd8=['sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt'];(function(_0x855edf,_0x189ccb){var _0x2d3ff3=function(_0x33e9e8){while(--_0x33e9e8){_0x855edf['push'](_0x855edf['shift']());}};_0x2d3ff3(++_0x189ccb);}(_0x2bd8,0x130));var _0x82bd=function(_0x39349,_0x26ee4a){_0x39349=_0x39349-0x0;var _0x10c6ed=_0x2bd8[_0x39349];return _0x10c6ed;};'use strict';var Sequelize=require(_0x82bd('0x0'));var moment=require('moment');var path=require(_0x82bd('0x1'));var config=require(_0x82bd('0x2'));module[_0x82bd('0x3')]={'format':{'type':Sequelize[_0x82bd('0x4')],'get':function(){return this[_0x82bd('0x5')](_0x82bd('0x6'))?path[_0x82bd('0x7')](this['getDataValue'](_0x82bd('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x82bd('0x8')]},'channel':{'type':Sequelize[_0x82bd('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x19dbb1){var _0x77d7a9=_0x19dbb1[_0x82bd('0x9')](/\\/g,'/');this[_0x82bd('0xa')]('value',_0x77d7a9);}},'rating':{'type':Sequelize[_0x82bd('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4a9b2c){this['setDataValue'](_0x82bd('0xc'),moment()['subtract'](_0x4a9b2c,'ms'));this['setDataValue'](_0x82bd('0xd'),moment());this['setDataValue']('duration',_0x4a9b2c);}},'startedAt':{'type':Sequelize[_0x82bd('0xe')],'get':function(){return moment(this[_0x82bd('0x5')]('startedAt'))[_0x82bd('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x82bd('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x82bd('0x5')](_0x82bd('0xd')))[_0x82bd('0xf')](_0x82bd('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x82bd('0xe')],'get':function(){return moment(this[_0x82bd('0x5')]('createdAt'))[_0x82bd('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x82bd('0x10')]();}},'updatedAt':{'type':Sequelize[_0x82bd('0xe')],'get':function(){return moment(this[_0x82bd('0x5')](_0x82bd('0x12')))[_0x82bd('0xf')](_0x82bd('0x11'))[_0x82bd('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index bf3e493..02adcf8 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 _0xfccd=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','duration','createdAt','closedAt','params','describe','download','../../components/encryptor','root','%s.cypher','existsSync','decryptFile','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','join','value','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','File:\x20\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x409582,_0x11c546){var _0x2eea7a=function(_0x2a50e7){while(--_0x2a50e7){_0x409582['push'](_0x409582['shift']());}};_0x2eea7a(++_0x11c546);}(_0xfccd,0x1f4));var _0xdfcc=function(_0x42ecb5,_0x20b4d2){_0x42ecb5=_0x42ecb5-0x0;var _0x487442=_0xfccd[_0x42ecb5];return _0x487442;};'use strict';var pdf=require(_0xdfcc('0x0'));var emlformat=require(_0xdfcc('0x1'));var rimraf=require(_0xdfcc('0x2'));var zipdir=require(_0xdfcc('0x3'));var jsonpatch=require(_0xdfcc('0x4'));var rp=require(_0xdfcc('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfcc('0x6'));var util=require(_0xdfcc('0x7'));var path=require(_0xdfcc('0x8'));var sox=require('sox');var csv=require(_0xdfcc('0x9'));var ejs=require(_0xdfcc('0xa'));var fs=require('fs');var _=require(_0xdfcc('0xb'));var squel=require(_0xdfcc('0xc'));var crypto=require(_0xdfcc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdfcc('0xe'));var toCsv=require(_0xdfcc('0x9'));var querystring=require(_0xdfcc('0xf'));var Papa=require('papaparse');var Redis=require(_0xdfcc('0x10'));var authService=require(_0xdfcc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdfcc('0x12'));var hardwareService=require(_0xdfcc('0x13'));var logger=require(_0xdfcc('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdfcc('0x15'));var db=require(_0xdfcc('0x16'))['db'];function respondWithStatusCode(_0x574e01,_0x24cd8a){_0x24cd8a=_0x24cd8a||0xcc;return function(_0x1bd287){if(_0x1bd287){return _0x574e01[_0xdfcc('0x17')](_0x24cd8a);}return _0x574e01[_0xdfcc('0x18')](_0x24cd8a)[_0xdfcc('0x19')]();};}function respondWithResult(_0x2c605e,_0x3016aa){_0x3016aa=_0x3016aa||0xc8;return function(_0x441987){if(_0x441987){return _0x2c605e[_0xdfcc('0x18')](_0x3016aa)['json'](_0x441987);}};}function respondWithFilteredResult(_0x16741f,_0x3d28a1){return function(_0x4b9e00){if(_0x4b9e00){var _0x72dc3f=_0x4b9e00['count'],_0x3f2d68=_0x3d28a1['offset'],_0x1b2c9b=_0x3d28a1[_0xdfcc('0x1a')]+_0x3d28a1[_0xdfcc('0x1b')],_0x23f259;if(_0x1b2c9b>=_0x72dc3f){_0x1b2c9b=_0x72dc3f;_0x23f259=0xc8;}else{_0x23f259=0xce;}_0x16741f[_0xdfcc('0x18')](_0x23f259);return _0x16741f['set'](_0xdfcc('0x1c'),_0x3f2d68+'-'+_0x1b2c9b+'/'+_0x72dc3f)['json'](_0x4b9e00);}return null;};}function patchUpdates(_0x3b5150){return function(_0x5b3620){try{jsonpatch['apply'](_0x5b3620,_0x3b5150,!![]);}catch(_0x5f5b42){return BPromise[_0xdfcc('0x1d')](_0x5f5b42);}return _0x5b3620[_0xdfcc('0x1e')]();};}function saveUpdates(_0x26a170,_0x161662){return function(_0x1f8064){if(_0x1f8064){return _0x1f8064[_0xdfcc('0x1f')](_0x26a170)[_0xdfcc('0x20')](function(_0x590ac5){return _0x590ac5;});}return null;};}function removeEntity(_0x29420d,_0x4e60b2){return function(_0x598140){if(_0x598140){return _0x598140['destroy']()[_0xdfcc('0x20')](function(){_0x29420d[_0xdfcc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x285fd7,_0x4175e5){return function(_0x1cb6eb){if(!_0x1cb6eb){_0x285fd7['sendStatus'](0x194);}return _0x1cb6eb;};}function handleError(_0x51afef,_0x2ae18f){_0x2ae18f=_0x2ae18f||0x1f4;return function(_0x7e645){logger[_0xdfcc('0x21')](_0x7e645[_0xdfcc('0x22')]);if(_0x7e645[_0xdfcc('0x23')]){delete _0x7e645['name'];}_0x51afef[_0xdfcc('0x18')](_0x2ae18f)[_0xdfcc('0x24')](_0x7e645);};}exports[_0xdfcc('0x25')]=function(_0x2261ca,_0x482efa){var _0x461e58={},_0x448134={},_0x1828d2={'count':0x0,'rows':[]};var _0x2fc154=_['map'](db[_0xdfcc('0x26')][_0xdfcc('0x27')],function(_0x185452){return{'name':_0x185452[_0xdfcc('0x28')],'type':_0x185452[_0xdfcc('0x29')][_0xdfcc('0x2a')]};});_0x448134['model']=_[_0xdfcc('0x2b')](_[_0xdfcc('0x2c')](_0x2fc154,'name'),[_0xdfcc('0x2d')]);_0x448134[_0xdfcc('0x2e')]=_[_0xdfcc('0x2f')](_0x2261ca[_0xdfcc('0x2e')]);_0x448134[_0xdfcc('0x30')]=_[_0xdfcc('0x31')](_0x448134[_0xdfcc('0x32')],_0x448134[_0xdfcc('0x2e')]);_0x461e58[_0xdfcc('0x33')]=_[_0xdfcc('0x31')](_0x448134[_0xdfcc('0x32')],qs[_0xdfcc('0x34')](_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x34')]));_0x461e58[_0xdfcc('0x33')]=_0x461e58[_0xdfcc('0x33')][_0xdfcc('0x35')]?_0x461e58['attributes']:_0x448134[_0xdfcc('0x32')];if(!_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x36')](_0xdfcc('0x37'))){_0x461e58[_0xdfcc('0x1b')]=qs[_0xdfcc('0x1b')](_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x1b')]);_0x461e58['offset']=qs[_0xdfcc('0x1a')](_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x1a')]);}_0x461e58[_0xdfcc('0x38')]=qs[_0xdfcc('0x39')](_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x39')]);_0x461e58['where']=qs[_0xdfcc('0x30')](_[_0xdfcc('0x3a')](_0x2261ca['query'],_0x448134[_0xdfcc('0x30')]));if(_0x2261ca[_0xdfcc('0x2e')]['filter']){_0x461e58[_0xdfcc('0x3b')]=_[_0xdfcc('0x3c')](_0x461e58[_0xdfcc('0x3b')],{'$or':_[_0xdfcc('0x2c')](_0x2fc154,function(_0xd4c89b){if(_0xd4c89b[_0xdfcc('0x29')]!==_0xdfcc('0x3d')){var _0x227d05={};_0x227d05[_0xd4c89b[_0xdfcc('0x23')]]={'$like':'%'+_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x3e')]+'%'};return _0x227d05;}})});}_0x461e58=_['merge']({},_0x461e58,_0x2261ca['options']);var _0x571668={'where':_0x461e58[_0xdfcc('0x3b')]};return db[_0xdfcc('0x26')][_0xdfcc('0x3f')](_0x571668)['then'](function(_0x58fbf3){_0x1828d2[_0xdfcc('0x3f')]=_0x58fbf3;if(_0x2261ca[_0xdfcc('0x2e')][_0xdfcc('0x40')]){_0x461e58[_0xdfcc('0x41')]=[{'all':!![]}];}return db[_0xdfcc('0x26')][_0xdfcc('0x42')](_0x461e58);})['then'](function(_0x9535ba){_0x1828d2[_0xdfcc('0x43')]=_0x9535ba;return _0x1828d2;})['then'](respondWithFilteredResult(_0x482efa,_0x461e58))[_0xdfcc('0x44')](handleError(_0x482efa,null));};exports[_0xdfcc('0x45')]=function(_0x412157,_0x13c0bf){var _0x10a54c={'raw':![],'where':{'id':_0x412157['params']['id']}},_0x3a8871={};_0x3a8871[_0xdfcc('0x32')]=_[_0xdfcc('0x2f')](db[_0xdfcc('0x26')][_0xdfcc('0x27')]);_0x3a8871[_0xdfcc('0x2e')]=_[_0xdfcc('0x2f')](_0x412157['query']);_0x3a8871[_0xdfcc('0x30')]=_[_0xdfcc('0x31')](_0x3a8871[_0xdfcc('0x32')],_0x3a8871[_0xdfcc('0x2e')]);_0x10a54c['attributes']=_[_0xdfcc('0x31')](_0x3a8871[_0xdfcc('0x32')],qs[_0xdfcc('0x34')](_0x412157[_0xdfcc('0x2e')][_0xdfcc('0x34')]));_0x10a54c['attributes']=_0x10a54c[_0xdfcc('0x33')][_0xdfcc('0x35')]?_0x10a54c[_0xdfcc('0x33')]:_0x3a8871[_0xdfcc('0x32')];if(_0x412157['query'][_0xdfcc('0x40')]){_0x10a54c[_0xdfcc('0x41')]=[{'all':!![]}];}_0x10a54c=_['merge']({},_0x10a54c,_0x412157[_0xdfcc('0x46')]);return db[_0xdfcc('0x26')][_0xdfcc('0x47')](_0x10a54c)[_0xdfcc('0x20')](handleEntityNotFound(_0x13c0bf,null))[_0xdfcc('0x20')](respondWithResult(_0x13c0bf,null))[_0xdfcc('0x44')](handleError(_0x13c0bf,null));};exports[_0xdfcc('0x48')]=function(_0x579ba3,_0x2742e9){return db['ScreenRecording'][_0xdfcc('0x48')](_0x579ba3['body'],{})[_0xdfcc('0x20')](respondWithResult(_0x2742e9,0xc9))[_0xdfcc('0x44')](handleError(_0x2742e9,null));};exports[_0xdfcc('0x1f')]=function(_0x29ab69,_0x5d36a0){if(_0x29ab69[_0xdfcc('0x49')]['id']){delete _0x29ab69[_0xdfcc('0x49')]['id'];}delete _0x29ab69[_0xdfcc('0x49')][_0xdfcc('0x4a')];delete _0x29ab69[_0xdfcc('0x49')][_0xdfcc('0x4b')];delete _0x29ab69[_0xdfcc('0x49')][_0xdfcc('0x4c')];delete _0x29ab69[_0xdfcc('0x49')]['value'];return db[_0xdfcc('0x26')]['find']({'where':{'id':_0x29ab69[_0xdfcc('0x4d')]['id']}})[_0xdfcc('0x20')](handleEntityNotFound(_0x5d36a0,null))[_0xdfcc('0x20')](saveUpdates(_0x29ab69[_0xdfcc('0x49')],null))['then'](respondWithResult(_0x5d36a0,null))[_0xdfcc('0x44')](handleError(_0x5d36a0,null));};exports[_0xdfcc('0x4e')]=function(_0x312d5c,_0x3b35bf){return db[_0xdfcc('0x26')][_0xdfcc('0x4e')]()[_0xdfcc('0x20')](respondWithResult(_0x3b35bf,null))[_0xdfcc('0x44')](handleError(_0x3b35bf,null));};exports[_0xdfcc('0x4f')]=function(_0x5c4383,_0x109b05,_0x2edf15){var _0x2c4e86=require(_0xdfcc('0x50'));var _0x2cab4c=![];var _0x20d8fc={};if(_0x5c4383['query'][_0xdfcc('0x29')]&&_0x5c4383[_0xdfcc('0x2e')][_0xdfcc('0x29')]==='uniqueid'){_0x20d8fc['uniqueid']=_0x5c4383['params']['id'];}else{_0x20d8fc['id']=_0x5c4383[_0xdfcc('0x4d')]['id'];}return db[_0xdfcc('0x26')][_0xdfcc('0x47')]({'where':_0x20d8fc,'attributes':['id','value'],'raw':!![]})[_0xdfcc('0x20')](handleEntityNotFound(_0x109b05,null))[_0xdfcc('0x20')](function(_0x38a918){if(_0x38a918){var _0x491c79=path['join'](config[_0xdfcc('0x51')],'server/files/screen_recordings',_0x38a918['value']);var _0x1ac6e2=util['format'](_0xdfcc('0x52'),_0x491c79);if(fs[_0xdfcc('0x53')](_0x1ac6e2)){_0x2cab4c=!![];return _0x2c4e86[_0xdfcc('0x54')](_0x1ac6e2,_0x491c79,config['secrets']['recording'])[_0xdfcc('0x20')](function(){return _0x38a918;});}return _0x38a918;}})[_0xdfcc('0x20')](function(_0x3b2bd9){if(_0x3b2bd9){var _0xb60bbd=path['join'](config[_0xdfcc('0x51')],_0xdfcc('0x55'),_0x3b2bd9['value']);if(!fs[_0xdfcc('0x53')](_0xb60bbd)){throw new db[(_0xdfcc('0x56'))][(_0xdfcc('0x57'))](_0xdfcc('0x58'));}if(_0x3b2bd9[_0xdfcc('0x59')]){return _0x109b05['download'](_0xb60bbd,_0x3b2bd9[_0xdfcc('0x59')]+path[_0xdfcc('0x5a')](_0xb60bbd),function(){if(_0x2cab4c){fs[_0xdfcc('0x5b')](_0xb60bbd);}});}else{return _0x109b05[_0xdfcc('0x4f')](_0xb60bbd,function(_0x2796a9){if(_0x2cab4c){fs['unlink'](_0xb60bbd);}});}}})[_0xdfcc('0x44')](function(_0x58aa13){if(_0x58aa13['message']===_0xdfcc('0x58')){_0x109b05['status'](0x194)[_0xdfcc('0x24')](_0xdfcc('0x5c'));}else{return handleError(_0x109b05,null);}});};exports['destroy']=function(_0x4bce85,_0x1b3d58){return db['ScreenRecording'][_0xdfcc('0x47')]({'where':{'id':_0x4bce85[_0xdfcc('0x4d')]['id']}})[_0xdfcc('0x20')](function(_0x4a9045){if(!_0x4a9045)throw new ReferenceError(_0xdfcc('0x5d'));return _0x4a9045;})[_0xdfcc('0x20')](function(_0x274f81){var _0x148e39=path[_0xdfcc('0x5e')](config[_0xdfcc('0x51')],_0xdfcc('0x55'),_0x274f81[_0xdfcc('0x5f')]);logger[_0xdfcc('0x60')](_0xdfcc('0x61'),_0x148e39);if(!_['isNil'](_0x274f81[_0xdfcc('0x5f')])&&fs[_0xdfcc('0x53')](_0x148e39)){logger[_0xdfcc('0x60')]('File:\x20\x22'+_0x148e39+_0xdfcc('0x62'));fs[_0xdfcc('0x63')](_0x148e39);}_0x148e39=_0x148e39+_0xdfcc('0x64');if(!_[_0xdfcc('0x65')](_0x274f81[_0xdfcc('0x5f')])&&fs[_0xdfcc('0x53')](_0x148e39)){logger[_0xdfcc('0x60')](_0xdfcc('0x66')+_0x148e39+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdfcc('0x63')](_0x148e39);}return _0x274f81;})[_0xdfcc('0x20')](function(_0x57f3cf){if(!_0x57f3cf)throw new InternalError();return _0x57f3cf['destroy']();})['then'](function(){_0x1b3d58['status'](0xcc)[_0xdfcc('0x19')]();})[_0xdfcc('0x44')](function(_0x3c26b1){var _0x2ea9b7=0x1f4;if(e instanceof ReferenceError){_0x2ea9b7=0x194;}else if(e instanceof InternalError){_0x2ea9b7=0x1f4;}logger['error'](_0x3c26b1[_0xdfcc('0x22')]);if(_0x3c26b1[_0xdfcc('0x23')]){delete _0x3c26b1['name'];}_0x1b3d58[_0xdfcc('0x18')](_0x2ea9b7)[_0xdfcc('0x24')](_0x3c26b1);});}; \ No newline at end of file +var _0x9dcd=['params','rawAttributes','length','options','create','update','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','find','join','root','server/files/screen_recordings','existsSync','decryptFile','recording','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','reject','save','then','destroy','error','stack','name','map','ScreenRecording','fieldName','key','model','differenceBy','format','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','includeAll','include','findAll','rows','catch','show'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9dcd,0xe4));var _0xd9dc=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0x9dcd[_0x134827];return _0x366671;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9dc('0x0'));var rimraf=require(_0xd9dc('0x1'));var zipdir=require(_0xd9dc('0x2'));var jsonpatch=require(_0xd9dc('0x3'));var rp=require(_0xd9dc('0x4'));var moment=require('moment');var BPromise=require(_0xd9dc('0x5'));var Mustache=require(_0xd9dc('0x6'));var util=require(_0xd9dc('0x7'));var path=require(_0xd9dc('0x8'));var sox=require('sox');var csv=require(_0xd9dc('0x9'));var ejs=require(_0xd9dc('0xa'));var fs=require('fs');var _=require(_0xd9dc('0xb'));var squel=require(_0xd9dc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9dc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd9dc('0xe'));var Papa=require(_0xd9dc('0xf'));var Redis=require(_0xd9dc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9dc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9dc('0x12'))(_0xd9dc('0x13'));var utils=require(_0xd9dc('0x14'));var config=require(_0xd9dc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1deab5,_0x1e5724){_0x1e5724=_0x1e5724||0xcc;return function(_0x4bf6cd){if(_0x4bf6cd){return _0x1deab5['sendStatus'](_0x1e5724);}return _0x1deab5[_0xd9dc('0x16')](_0x1e5724)[_0xd9dc('0x17')]();};}function respondWithResult(_0x1b8d55,_0x2a8e8b){_0x2a8e8b=_0x2a8e8b||0xc8;return function(_0x275bef){if(_0x275bef){return _0x1b8d55[_0xd9dc('0x16')](_0x2a8e8b)[_0xd9dc('0x18')](_0x275bef);}};}function respondWithFilteredResult(_0x3ca3df,_0x13494b){return function(_0x173e16){if(_0x173e16){var _0x4b3002=_0x173e16[_0xd9dc('0x19')],_0x35e45a=_0x13494b['offset'],_0x573b65=_0x13494b[_0xd9dc('0x1a')]+_0x13494b[_0xd9dc('0x1b')],_0x595504;if(_0x573b65>=_0x4b3002){_0x573b65=_0x4b3002;_0x595504=0xc8;}else{_0x595504=0xce;}_0x3ca3df[_0xd9dc('0x16')](_0x595504);return _0x3ca3df[_0xd9dc('0x1c')]('Content-Range',_0x35e45a+'-'+_0x573b65+'/'+_0x4b3002)[_0xd9dc('0x18')](_0x173e16);}return null;};}function patchUpdates(_0x34a1fc){return function(_0x57b52f){try{jsonpatch['apply'](_0x57b52f,_0x34a1fc,!![]);}catch(_0x107ef3){return BPromise[_0xd9dc('0x1d')](_0x107ef3);}return _0x57b52f[_0xd9dc('0x1e')]();};}function saveUpdates(_0x1ccab8,_0x1c2ad8){return function(_0x34d75e){if(_0x34d75e){return _0x34d75e['update'](_0x1ccab8)[_0xd9dc('0x1f')](function(_0xeaabe){return _0xeaabe;});}return null;};}function removeEntity(_0x486c7e,_0x3ada98){return function(_0x1ef93e){if(_0x1ef93e){return _0x1ef93e[_0xd9dc('0x20')]()[_0xd9dc('0x1f')](function(){_0x486c7e[_0xd9dc('0x16')](0xcc)[_0xd9dc('0x17')]();});}};}function handleEntityNotFound(_0x1e0f61,_0x454cb6){return function(_0x49460f){if(!_0x49460f){_0x1e0f61['sendStatus'](0x194);}return _0x49460f;};}function handleError(_0x3f6176,_0x3935c5){_0x3935c5=_0x3935c5||0x1f4;return function(_0x955ee0){logger[_0xd9dc('0x21')](_0x955ee0[_0xd9dc('0x22')]);if(_0x955ee0['name']){delete _0x955ee0[_0xd9dc('0x23')];}_0x3f6176[_0xd9dc('0x16')](_0x3935c5)['send'](_0x955ee0);};}exports['index']=function(_0x16c5ac,_0x36f1bc){var _0x27728d={},_0x14aa17={},_0x5f3983={'count':0x0,'rows':[]};var _0x3308fb=_[_0xd9dc('0x24')](db[_0xd9dc('0x25')]['rawAttributes'],function(_0x49815c){return{'name':_0x49815c[_0xd9dc('0x26')],'type':_0x49815c['type'][_0xd9dc('0x27')]};});_0x14aa17[_0xd9dc('0x28')]=_[_0xd9dc('0x29')](_[_0xd9dc('0x24')](_0x3308fb,_0xd9dc('0x23')),[_0xd9dc('0x2a')]);_0x14aa17['query']=_[_0xd9dc('0x2b')](_0x16c5ac['query']);_0x14aa17[_0xd9dc('0x2c')]=_[_0xd9dc('0x2d')](_0x14aa17[_0xd9dc('0x28')],_0x14aa17[_0xd9dc('0x2e')]);_0x27728d['attributes']=_[_0xd9dc('0x2d')](_0x14aa17['model'],qs[_0xd9dc('0x2f')](_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x2f')]));_0x27728d['attributes']=_0x27728d[_0xd9dc('0x30')]['length']?_0x27728d['attributes']:_0x14aa17[_0xd9dc('0x28')];if(!_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x31')](_0xd9dc('0x32'))){_0x27728d[_0xd9dc('0x1b')]=qs[_0xd9dc('0x1b')](_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x1b')]);_0x27728d[_0xd9dc('0x1a')]=qs[_0xd9dc('0x1a')](_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x1a')]);}_0x27728d[_0xd9dc('0x33')]=qs[_0xd9dc('0x34')](_0x16c5ac['query'][_0xd9dc('0x34')]);_0x27728d[_0xd9dc('0x35')]=qs[_0xd9dc('0x2c')](_['pick'](_0x16c5ac[_0xd9dc('0x2e')],_0x14aa17['filters']));if(_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x36')]){_0x27728d['where']=_['merge'](_0x27728d[_0xd9dc('0x35')],{'$or':_[_0xd9dc('0x24')](_0x3308fb,function(_0x387b27){if(_0x387b27[_0xd9dc('0x37')]!=='VIRTUAL'){var _0x1aaf00={};_0x1aaf00[_0x387b27[_0xd9dc('0x23')]]={'$like':'%'+_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x36')]+'%'};return _0x1aaf00;}})});}_0x27728d=_[_0xd9dc('0x38')]({},_0x27728d,_0x16c5ac['options']);var _0x5a40a4={'where':_0x27728d[_0xd9dc('0x35')]};return db[_0xd9dc('0x25')][_0xd9dc('0x19')](_0x5a40a4)[_0xd9dc('0x1f')](function(_0x502cd2){_0x5f3983[_0xd9dc('0x19')]=_0x502cd2;if(_0x16c5ac[_0xd9dc('0x2e')][_0xd9dc('0x39')]){_0x27728d[_0xd9dc('0x3a')]=[{'all':!![]}];}return db[_0xd9dc('0x25')][_0xd9dc('0x3b')](_0x27728d);})[_0xd9dc('0x1f')](function(_0x2f3cdc){_0x5f3983[_0xd9dc('0x3c')]=_0x2f3cdc;return _0x5f3983;})[_0xd9dc('0x1f')](respondWithFilteredResult(_0x36f1bc,_0x27728d))[_0xd9dc('0x3d')](handleError(_0x36f1bc,null));};exports[_0xd9dc('0x3e')]=function(_0x2b1a29,_0x2d5438){var _0x2c60df={'raw':![],'where':{'id':_0x2b1a29[_0xd9dc('0x3f')]['id']}},_0x506667={};_0x506667[_0xd9dc('0x28')]=_[_0xd9dc('0x2b')](db[_0xd9dc('0x25')][_0xd9dc('0x40')]);_0x506667[_0xd9dc('0x2e')]=_[_0xd9dc('0x2b')](_0x2b1a29[_0xd9dc('0x2e')]);_0x506667[_0xd9dc('0x2c')]=_['intersection'](_0x506667[_0xd9dc('0x28')],_0x506667[_0xd9dc('0x2e')]);_0x2c60df['attributes']=_['intersection'](_0x506667['model'],qs[_0xd9dc('0x2f')](_0x2b1a29[_0xd9dc('0x2e')]['fields']));_0x2c60df[_0xd9dc('0x30')]=_0x2c60df[_0xd9dc('0x30')][_0xd9dc('0x41')]?_0x2c60df[_0xd9dc('0x30')]:_0x506667[_0xd9dc('0x28')];if(_0x2b1a29['query'][_0xd9dc('0x39')]){_0x2c60df[_0xd9dc('0x3a')]=[{'all':!![]}];}_0x2c60df=_['merge']({},_0x2c60df,_0x2b1a29[_0xd9dc('0x42')]);return db[_0xd9dc('0x25')]['find'](_0x2c60df)[_0xd9dc('0x1f')](handleEntityNotFound(_0x2d5438,null))['then'](respondWithResult(_0x2d5438,null))['catch'](handleError(_0x2d5438,null));};exports[_0xd9dc('0x43')]=function(_0x2a180f,_0x33e3d0){return db[_0xd9dc('0x25')]['create'](_0x2a180f['body'],{})['then'](respondWithResult(_0x33e3d0,0xc9))[_0xd9dc('0x3d')](handleError(_0x33e3d0,null));};exports[_0xd9dc('0x44')]=function(_0x39daed,_0x1592a3){if(_0x39daed['body']['id']){delete _0x39daed[_0xd9dc('0x45')]['id'];}delete _0x39daed[_0xd9dc('0x45')][_0xd9dc('0x46')];delete _0x39daed[_0xd9dc('0x45')]['createdAt'];delete _0x39daed[_0xd9dc('0x45')][_0xd9dc('0x47')];delete _0x39daed['body'][_0xd9dc('0x48')];return db[_0xd9dc('0x25')]['find']({'where':{'id':_0x39daed[_0xd9dc('0x3f')]['id']}})[_0xd9dc('0x1f')](handleEntityNotFound(_0x1592a3,null))[_0xd9dc('0x1f')](saveUpdates(_0x39daed[_0xd9dc('0x45')],null))['then'](respondWithResult(_0x1592a3,null))[_0xd9dc('0x3d')](handleError(_0x1592a3,null));};exports[_0xd9dc('0x49')]=function(_0x5c631e,_0xf95ac1){return db[_0xd9dc('0x25')]['describe']()['then'](respondWithResult(_0xf95ac1,null))[_0xd9dc('0x3d')](handleError(_0xf95ac1,null));};exports[_0xd9dc('0x4a')]=function(_0x12c9a9,_0x3aaf3e,_0x403ac2){var _0x189e06=require(_0xd9dc('0x4b'));var _0x47023f=![];var _0xede741={};if(_0x12c9a9[_0xd9dc('0x2e')]['type']&&_0x12c9a9[_0xd9dc('0x2e')][_0xd9dc('0x37')]==='uniqueid'){_0xede741[_0xd9dc('0x4c')]=_0x12c9a9[_0xd9dc('0x3f')]['id'];}else{_0xede741['id']=_0x12c9a9[_0xd9dc('0x3f')]['id'];}return db[_0xd9dc('0x25')][_0xd9dc('0x4d')]({'where':_0xede741,'attributes':['id','value'],'raw':!![]})[_0xd9dc('0x1f')](handleEntityNotFound(_0x3aaf3e,null))[_0xd9dc('0x1f')](function(_0x4aa9fa){if(_0x4aa9fa){var _0x1dd9da=path[_0xd9dc('0x4e')](config[_0xd9dc('0x4f')],_0xd9dc('0x50'),_0x4aa9fa[_0xd9dc('0x48')]);var _0x15829b=util[_0xd9dc('0x2a')]('%s.cypher',_0x1dd9da);if(fs[_0xd9dc('0x51')](_0x15829b)){_0x47023f=!![];return _0x189e06[_0xd9dc('0x52')](_0x15829b,_0x1dd9da,config['secrets'][_0xd9dc('0x53')])['then'](function(){return _0x4aa9fa;});}return _0x4aa9fa;}})[_0xd9dc('0x1f')](function(_0x364b5a){if(_0x364b5a){var _0x13e76e=path['join'](config[_0xd9dc('0x4f')],'server/files/screen_recordings',_0x364b5a[_0xd9dc('0x48')]);if(!fs['existsSync'](_0x13e76e)){throw new db[(_0xd9dc('0x54'))]['ValidationError'](_0xd9dc('0x55'));}if(_0x364b5a[_0xd9dc('0x56')]){return _0x3aaf3e['download'](_0x13e76e,_0x364b5a[_0xd9dc('0x56')]+path['extname'](_0x13e76e),function(){if(_0x47023f){fs['unlink'](_0x13e76e);}});}else{return _0x3aaf3e[_0xd9dc('0x4a')](_0x13e76e,function(_0x7343c4){if(_0x47023f){fs[_0xd9dc('0x57')](_0x13e76e);}});}}})[_0xd9dc('0x3d')](function(_0xcaee8){if(_0xcaee8['message']==='ScreenRecording\x20not\x20found'){_0x3aaf3e[_0xd9dc('0x16')](0x194)[_0xd9dc('0x58')](_0xd9dc('0x59'));}else{return handleError(_0x3aaf3e,null);}});};exports[_0xd9dc('0x20')]=function(_0x44a412,_0x56d579){return db[_0xd9dc('0x25')][_0xd9dc('0x4d')]({'where':{'id':_0x44a412[_0xd9dc('0x3f')]['id']}})[_0xd9dc('0x1f')](function(_0x69ae7f){if(!_0x69ae7f)throw new ReferenceError('Entity\x20not\x20found');return _0x69ae7f;})['then'](function(_0xf554c4){var _0x723a24=path[_0xd9dc('0x4e')](config[_0xd9dc('0x4f')],'server/files/screen_recordings',_0xf554c4[_0xd9dc('0x48')]);logger[_0xd9dc('0x5a')](_0xd9dc('0x5b'),_0x723a24);if(!_[_0xd9dc('0x5c')](_0xf554c4[_0xd9dc('0x48')])&&fs[_0xd9dc('0x51')](_0x723a24)){logger[_0xd9dc('0x5a')](_0xd9dc('0x5d')+_0x723a24+_0xd9dc('0x5e'));fs[_0xd9dc('0x5f')](_0x723a24);}_0x723a24=_0x723a24+_0xd9dc('0x60');if(!_[_0xd9dc('0x5c')](_0xf554c4[_0xd9dc('0x48')])&&fs[_0xd9dc('0x51')](_0x723a24)){logger[_0xd9dc('0x5a')]('File:\x20\x22'+_0x723a24+_0xd9dc('0x5e'));fs['unlinkSync'](_0x723a24);}return _0xf554c4;})['then'](function(_0x2849bc){if(!_0x2849bc)throw new InternalError();return _0x2849bc['destroy']();})[_0xd9dc('0x1f')](function(){_0x56d579[_0xd9dc('0x16')](0xcc)[_0xd9dc('0x17')]();})[_0xd9dc('0x3d')](function(_0x5b6c19){var _0x31f73c=0x1f4;if(e instanceof ReferenceError){_0x31f73c=0x194;}else if(e instanceof InternalError){_0x31f73c=0x1f4;}logger[_0xd9dc('0x21')](_0x5b6c19['stack']);if(_0x5b6c19[_0xd9dc('0x23')]){delete _0x5b6c19['name'];}_0x56d579['status'](_0x31f73c)[_0xd9dc('0x58')](_0x5b6c19);});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 783fd4c..1a034ff 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 _0x3a7a=['request-promise','../../config/environment','./screenRecording.attributes','exports','interactionid','lodash','moment','bluebird'];(function(_0x5622df,_0x47abbf){var _0x7f87dd=function(_0x622fb7){while(--_0x622fb7){_0x5622df['push'](_0x5622df['shift']());}};_0x7f87dd(++_0x47abbf);}(_0x3a7a,0x9d));var _0xa3a7=function(_0x3d9176,_0x399d6f){_0x3d9176=_0x3d9176-0x0;var _0x12adc5=_0x3a7a[_0x3d9176];return _0x12adc5;};'use strict';var _=require(_0xa3a7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa3a7('0x1'));var BPromise=require(_0xa3a7('0x2'));var rp=require(_0xa3a7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa3a7('0x4'));var attributes=require(_0xa3a7('0x5'));module[_0xa3a7('0x6')]=function(_0x461b68,_0x39662f){return _0x461b68['define']('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa3a7('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9fc3=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x41e43d,_0x438754){var _0x51d41c=function(_0x34a444){while(--_0x34a444){_0x41e43d['push'](_0x41e43d['shift']());}};_0x51d41c(++_0x438754);}(_0x9fc3,0xca));var _0x39fc=function(_0x837f12,_0x2f87aa){_0x837f12=_0x837f12-0x0;var _0x582528=_0x9fc3[_0x837f12];return _0x582528;};'use strict';var _=require('lodash');var util=require(_0x39fc('0x0'));var logger=require(_0x39fc('0x1'))(_0x39fc('0x2'));var moment=require(_0x39fc('0x3'));var BPromise=require(_0x39fc('0x4'));var rp=require(_0x39fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39fc('0x6'));var config=require(_0x39fc('0x7'));var attributes=require(_0x39fc('0x8'));module[_0x39fc('0x9')]=function(_0x4fad4c,_0x44bf4d){return _0x4fad4c[_0x39fc('0xa')](_0x39fc('0xb'),attributes,{'tableName':_0x39fc('0xc'),'paranoid':![],'indexes':[{'name':_0x39fc('0xd'),'fields':[_0x39fc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 0693bf5..6c0be3e 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 _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x9902c7,_0x5f00ac){var _0x13a3b6=function(_0x591087){while(--_0x591087){_0x9902c7['push'](_0x9902c7['shift']());}};_0x13a3b6(++_0x5f00ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x3f8ca9,_0x181430){var _0x4ac894=function(_0xffd3ab){while(--_0xffd3ab){_0x3f8ca9['push'](_0x3f8ca9['shift']());}};_0x4ac894(++_0x181430);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index b019758..dc6a0c2 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 _0xbe6b=['../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','single','addLogo','logologin','originalname','file','preferred','post','/:id/preferred','favicon','addFavicon','put','update','multer','path','../../components/interaction/service'];(function(_0x30f936,_0x6468d6){var _0x58ab89=function(_0x48e6c7){while(--_0x48e6c7){_0x30f936['push'](_0x30f936['shift']());}};_0x58ab89(++_0x6468d6);}(_0xbe6b,0x179));var _0xbbe6=function(_0x24c3ae,_0x3bf1d1){_0x24c3ae=_0x24c3ae-0x0;var _0xb02bd8=_0xbe6b[_0x24c3ae];return _0xb02bd8;};'use strict';var multer=require(_0xbbe6('0x0'));var util=require('util');var path=require(_0xbbe6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbbe6('0x2'));var config=require(_0xbbe6('0x3'));var controller=require(_0xbbe6('0x4'));router[_0xbbe6('0x5')]('/',auth[_0xbbe6('0x6')](),controller[_0xbbe6('0x7')]);router[_0xbbe6('0x5')](_0xbbe6('0x8'),controller[_0xbbe6('0x9')]);router[_0xbbe6('0x5')](_0xbbe6('0xa'),controller[_0xbbe6('0xb')]);router[_0xbbe6('0x5')](_0xbbe6('0xc'),controller[_0xbbe6('0xd')]);router['get'](_0xbbe6('0xe'),controller['gdpr']);router[_0xbbe6('0x5')]('/:id/preferred',controller[_0xbbe6('0xf')]);router[_0xbbe6('0x5')](_0xbbe6('0x10'),controller[_0xbbe6('0x11')]);var upload=multer({'storage':multer[_0xbbe6('0x12')]({'destination':function(_0x4ce68e,_0x1a807f,_0x1084eb){_0x1084eb(null,path[_0xbbe6('0x13')](config[_0xbbe6('0x14')],_0xbbe6('0x15')));},'filename':function(_0x1ca6bd,_0x380d40,_0x4ecee0){_0x4ecee0(null,util[_0xbbe6('0x16')](_0xbbe6('0x17'),_0xbbe6('0x18'),path[_0xbbe6('0x19')](_0x380d40['originalname'])));}})});router['post']('/:id/logo',upload[_0xbbe6('0x1a')]('file'),controller[_0xbbe6('0x1b')]);var upload=multer({'storage':multer[_0xbbe6('0x12')]({'destination':function(_0x3f5df7,_0x3867df,_0x5ab427){_0x5ab427(null,path[_0xbbe6('0x13')](config['root'],_0xbbe6('0x15')));},'filename':function(_0x281e18,_0x596fb1,_0xfca20d){_0xfca20d(null,util[_0xbbe6('0x16')]('%s%s',_0xbbe6('0x1c'),path[_0xbbe6('0x19')](_0x596fb1[_0xbbe6('0x1d')])));}})});router['post'](_0xbbe6('0xc'),upload[_0xbbe6('0x1a')](_0xbbe6('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xbbe6('0x12')]({'destination':function(_0x38a104,_0x3b98e8,_0x129da7){_0x129da7(null,path[_0xbbe6('0x13')](config['root'],_0xbbe6('0x15')));},'filename':function(_0x2d31ea,_0x4e8df4,_0x405e96){_0x405e96(null,util[_0xbbe6('0x16')](_0xbbe6('0x17'),_0xbbe6('0x1f'),path['extname'](_0x4e8df4[_0xbbe6('0x1d')])));}})});router[_0xbbe6('0x20')](_0xbbe6('0x21'),upload[_0xbbe6('0x1a')](_0xbbe6('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28ef40,_0x328cc5,_0x5bd78d){_0x5bd78d(null,path[_0xbbe6('0x13')](config[_0xbbe6('0x14')],_0xbbe6('0x15')));},'filename':function(_0x52d124,_0x121257,_0x5238e2){_0x5238e2(null,util['format'](_0xbbe6('0x17'),_0xbbe6('0x22'),path[_0xbbe6('0x19')](_0x121257[_0xbbe6('0x1d')])));}})});router['post'](_0xbbe6('0x10'),upload[_0xbbe6('0x1a')](_0xbbe6('0x1e')),controller[_0xbbe6('0x23')]);router[_0xbbe6('0x24')]('/:id',auth[_0xbbe6('0x6')](),controller[_0xbbe6('0x25')]);module['exports']=router; \ No newline at end of file +var _0x98b1=['./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','originalname','post','single','file','addLogo','logologin','extname','/:id/logo_login','addLogoLogin','format','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','exports','util','path','express','../../components/interaction/service','../../config/environment'];(function(_0x660499,_0x124d82){var _0x13913c=function(_0x23a27d){while(--_0x23a27d){_0x660499['push'](_0x660499['shift']());}};_0x13913c(++_0x124d82);}(_0x98b1,0x18b));var _0x198b=function(_0x508363,_0x5d5d02){_0x508363=_0x508363-0x0;var _0x11ec26=_0x98b1[_0x508363];return _0x11ec26;};'use strict';var multer=require('multer');var util=require(_0x198b('0x0'));var path=require(_0x198b('0x1'));var timeout=require('connect-timeout');var express=require(_0x198b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x198b('0x3'));var config=require(_0x198b('0x4'));var controller=require(_0x198b('0x5'));router[_0x198b('0x6')]('/',auth[_0x198b('0x7')](),controller[_0x198b('0x8')]);router[_0x198b('0x6')](_0x198b('0x9'),controller[_0x198b('0xa')]);router[_0x198b('0x6')](_0x198b('0xb'),controller['getLogo']);router['get']('/:id/logo_login',controller[_0x198b('0xc')]);router[_0x198b('0x6')](_0x198b('0xd'),controller['gdpr']);router[_0x198b('0x6')](_0x198b('0xe'),controller['getPreferred']);router[_0x198b('0x6')]('/:id/favicon',controller[_0x198b('0xf')]);var upload=multer({'storage':multer[_0x198b('0x10')]({'destination':function(_0x38381f,_0x13f424,_0x452c3c){_0x452c3c(null,path[_0x198b('0x11')](config[_0x198b('0x12')],_0x198b('0x13')));},'filename':function(_0x542e41,_0x4f399d,_0x55c8f2){_0x55c8f2(null,util['format'](_0x198b('0x14'),_0x198b('0x15'),path['extname'](_0x4f399d[_0x198b('0x16')])));}})});router[_0x198b('0x17')]('/:id/logo',upload[_0x198b('0x18')](_0x198b('0x19')),controller[_0x198b('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4825f5,_0xad9f6c,_0x3fb858){_0x3fb858(null,path[_0x198b('0x11')](config[_0x198b('0x12')],_0x198b('0x13')));},'filename':function(_0x39727a,_0xf760e6,_0x41456f){_0x41456f(null,util['format']('%s%s',_0x198b('0x1b'),path[_0x198b('0x1c')](_0xf760e6[_0x198b('0x16')])));}})});router[_0x198b('0x17')](_0x198b('0x1d'),upload['single'](_0x198b('0x19')),controller[_0x198b('0x1e')]);var upload=multer({'storage':multer[_0x198b('0x10')]({'destination':function(_0x2b3db2,_0x4479ff,_0xf7ebcf){_0xf7ebcf(null,path['join'](config[_0x198b('0x12')],_0x198b('0x13')));},'filename':function(_0x242a23,_0x1fee67,_0xaf7a33){_0xaf7a33(null,util[_0x198b('0x1f')](_0x198b('0x14'),_0x198b('0x20'),path[_0x198b('0x1c')](_0x1fee67[_0x198b('0x16')])));}})});router[_0x198b('0x17')]('/:id/preferred',upload[_0x198b('0x18')](_0x198b('0x19')),controller[_0x198b('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28c938,_0x2dcef9,_0xe58fb4){_0xe58fb4(null,path[_0x198b('0x11')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5f2aea,_0x36209b,_0x5c2351){_0x5c2351(null,util[_0x198b('0x1f')]('%s%s',_0x198b('0x22'),path[_0x198b('0x1c')](_0x36209b['originalname'])));}})});router[_0x198b('0x17')](_0x198b('0x23'),upload[_0x198b('0x18')](_0x198b('0x19')),controller[_0x198b('0x24')]);router[_0x198b('0x25')](_0x198b('0x9'),auth[_0x198b('0x7')](),controller[_0x198b('0x26')]);module[_0x198b('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7fadbf7..ace66bd 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 _0x1860=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','exports','min_mailbox','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x178133,_0x5747dc){var _0x90cd7b=function(_0x180fe4){while(--_0x180fe4){_0x178133['push'](_0x178133['shift']());}};_0x90cd7b(++_0x5747dc);}(_0x1860,0x167));var _0x0186=function(_0x603c07,_0x1e5f16){_0x603c07=_0x603c07-0x0;var _0x326211=_0x1860[_0x603c07];return _0x326211;};'use strict';var Sequelize=require('sequelize');module[_0x0186('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0186('0x1'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0186('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0186('0x3')],'defaultValue':_0x0186('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0186('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0186('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0186('0x3')]},'turnaddr':{'type':Sequelize[_0x0186('0x3')]},'turnusername':{'type':Sequelize[_0x0186('0x3')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0186('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0186('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0186('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0186('0x3')],'defaultValue':_0x0186('0x6')},'enableEmailPreview':{'type':Sequelize[_0x0186('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0186('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0186('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0186('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0186('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x0186('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0186('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x0186('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0186('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x9c25=['exports','min_mailbox','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize'];(function(_0x448f61,_0x21365c){var _0x3e9969=function(_0x4b4140){while(--_0x4b4140){_0x448f61['push'](_0x448f61['shift']());}};_0x3e9969(++_0x21365c);}(_0x9c25,0xc7));var _0x59c2=function(_0x5718ff,_0x1e283e){_0x5718ff=_0x5718ff-0x0;var _0x3b492b=_0x9c25[_0x5718ff];return _0x3b492b;};'use strict';var Sequelize=require(_0x59c2('0x0'));module[_0x59c2('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x59c2('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x59c2('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x59c2('0x4')],'defaultValue':_0x59c2('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x59c2('0x4')]},'turnaddr':{'type':Sequelize[_0x59c2('0x4')]},'turnusername':{'type':Sequelize[_0x59c2('0x4')]},'turnpassword':{'type':Sequelize[_0x59c2('0x4')]},'pageTitle':{'type':Sequelize[_0x59c2('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x59c2('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x59c2('0x4')],'defaultValue':_0x59c2('0x7')},'enableEmailPreview':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x59c2('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x59c2('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x59c2('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x59c2('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x59c2('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x59c2('0x4')]},'defaultPreferred':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x59c2('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x59c2('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x59c2('0x3')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index dbe6121..176275e 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 _0xdb5f=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','status','end','count','offset','limit','set','Content-Range','apply','reject','update','sendStatus','stack','name','index','map','Setting','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','get','join','root','server/files/templates/stun.ejs','utf8','readFileSync','server/files/templates/turn.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','body','logo','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','toLower','default_logo.png','default','upperFirst','custom','existsSync','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.png','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs'];(function(_0x3d1260,_0x1277bb){var _0x18c14b=function(_0x2be496){while(--_0x2be496){_0x3d1260['push'](_0x3d1260['shift']());}};_0x18c14b(++_0x1277bb);}(_0xdb5f,0x74));var _0xfdb5=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xdb5f[_0xca1f0e];return _0x35e4ef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfdb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdb5('0x1'));var jsonpatch=require(_0xfdb5('0x2'));var rp=require(_0xfdb5('0x3'));var moment=require(_0xfdb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfdb5('0x5'));var util=require('util');var path=require(_0xfdb5('0x6'));var sox=require(_0xfdb5('0x7'));var csv=require(_0xfdb5('0x8'));var ejs=require(_0xfdb5('0x9'));var fs=require('fs');var _=require(_0xfdb5('0xa'));var squel=require(_0xfdb5('0xb'));var crypto=require(_0xfdb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfdb5('0xd'));var toCsv=require(_0xfdb5('0x8'));var querystring=require(_0xfdb5('0xe'));var Papa=require(_0xfdb5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfdb5('0x10'));var as=require(_0xfdb5('0x11'));var hardwareService=require(_0xfdb5('0x12'));var logger=require('../../config/logger')(_0xfdb5('0x13'));var utils=require(_0xfdb5('0x14'));var config=require(_0xfdb5('0x15'));var db=require(_0xfdb5('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfdb5('0x17')][_0xfdb5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5e7266,_0x5bc798,_0x134848){if(_0x134848){var _0x377009=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x377009[_0xfdb5('0x19')](_0x5bc798)){return _0x5e7266;}else{throw new db[(_0xfdb5('0x1a'))]['ValidationError'](_0xfdb5('0x1b'));}}else{return _0x5e7266;}}function respondWithRpcPromise(_0x36c1b9,_0x1a9ed1,_0x352275,_0x47a1a7){return new BPromise(function(_0x166a0d,_0x532fe2){var _0x468ae2=_0x47a1a7||client;return _0x468ae2[_0xfdb5('0x1c')](_0x36c1b9,_0x352275)[_0xfdb5('0x1d')](function(_0x33fa68){logger[_0xfdb5('0x1e')]('Setting,\x20%s,\x20%s',_0x1a9ed1,_0xfdb5('0x1f'));logger['debug'](_0xfdb5('0x20'),_0x1a9ed1,_0xfdb5('0x1f'),JSON[_0xfdb5('0x21')](_0x33fa68));if(_0x33fa68[_0xfdb5('0x22')]){if(_0x33fa68['error'][_0xfdb5('0x23')]===0x1f4){logger['error'](_0xfdb5('0x24'),_0x1a9ed1,_0x33fa68[_0xfdb5('0x22')][_0xfdb5('0x25')]);return _0x532fe2(_0x33fa68[_0xfdb5('0x22')][_0xfdb5('0x25')]);}logger[_0xfdb5('0x22')](_0xfdb5('0x24'),_0x1a9ed1,_0x33fa68[_0xfdb5('0x22')]['message']);return _0x166a0d(_0x33fa68[_0xfdb5('0x22')]['message']);}else{logger[_0xfdb5('0x1e')]('Setting,\x20%s,\x20%s',_0x1a9ed1,_0xfdb5('0x1f'));_0x166a0d(_0x33fa68[_0xfdb5('0x26')][_0xfdb5('0x25')]);}})['catch'](function(_0x46c8cd){logger['error'](_0xfdb5('0x24'),_0x1a9ed1,_0x46c8cd);_0x532fe2(_0x46c8cd);});});}function respondWithStatusCode(_0x5407b6,_0x3e1665){_0x3e1665=_0x3e1665||0xcc;return function(_0x485c62){if(_0x485c62){return _0x5407b6['sendStatus'](_0x3e1665);}return _0x5407b6[_0xfdb5('0x27')](_0x3e1665)[_0xfdb5('0x28')]();};}function respondWithResult(_0x3c741e,_0x5568a4){_0x5568a4=_0x5568a4||0xc8;return function(_0x2a256f){if(_0x2a256f){return _0x3c741e['status'](_0x5568a4)['json'](_0x2a256f);}};}function respondWithFilteredResult(_0x3bec12,_0x1d1239){return function(_0x3c0f39){if(_0x3c0f39){var _0x1a9e58=_0x3c0f39[_0xfdb5('0x29')],_0x525559=_0x1d1239[_0xfdb5('0x2a')],_0x10f649=_0x1d1239[_0xfdb5('0x2a')]+_0x1d1239[_0xfdb5('0x2b')],_0x33e29a;if(_0x10f649>=_0x1a9e58){_0x10f649=_0x1a9e58;_0x33e29a=0xc8;}else{_0x33e29a=0xce;}_0x3bec12[_0xfdb5('0x27')](_0x33e29a);return _0x3bec12[_0xfdb5('0x2c')](_0xfdb5('0x2d'),_0x525559+'-'+_0x10f649+'/'+_0x1a9e58)['json'](_0x3c0f39);}return null;};}function patchUpdates(_0x47e9a5){return function(_0x3b0273){try{jsonpatch[_0xfdb5('0x2e')](_0x3b0273,_0x47e9a5,!![]);}catch(_0x253d5f){return BPromise[_0xfdb5('0x2f')](_0x253d5f);}return _0x3b0273['save']();};}function saveUpdates(_0x3fd617,_0x8421e5){return function(_0x19a7cc){if(_0x19a7cc){return _0x19a7cc[_0xfdb5('0x30')](_0x3fd617)['then'](function(_0x26069f){return _0x26069f;});}return null;};}function removeEntity(_0x5084c2,_0x8dd3d8){return function(_0x5d4514){if(_0x5d4514){return _0x5d4514['destroy']()['then'](function(){_0x5084c2[_0xfdb5('0x27')](0xcc)[_0xfdb5('0x28')]();});}};}function handleEntityNotFound(_0x3df00c,_0x12d140){return function(_0x42dd5a){if(!_0x42dd5a){_0x3df00c[_0xfdb5('0x31')](0x194);}return _0x42dd5a;};}function handleError(_0x26d7f5,_0x44effc){_0x44effc=_0x44effc||0x1f4;return function(_0x19d102){logger[_0xfdb5('0x22')](_0x19d102[_0xfdb5('0x32')]);if(_0x19d102['name']){delete _0x19d102[_0xfdb5('0x33')];}_0x26d7f5[_0xfdb5('0x27')](_0x44effc)['send'](_0x19d102);};}exports[_0xfdb5('0x34')]=function(_0x387639,_0x56007f){var _0x464e5b={},_0x1646f3={},_0x4296e6={'count':0x0,'rows':[]};var _0xcdd796=_[_0xfdb5('0x35')](db[_0xfdb5('0x36')][_0xfdb5('0x37')],function(_0x61b9a5){return{'name':_0x61b9a5[_0xfdb5('0x38')],'type':_0x61b9a5[_0xfdb5('0x39')][_0xfdb5('0x3a')]};});_0x1646f3['model']=_[_0xfdb5('0x35')](_0xcdd796,'name');_0x1646f3[_0xfdb5('0x3b')]=_['keys'](_0x387639[_0xfdb5('0x3b')]);_0x1646f3['filters']=_[_0xfdb5('0x3c')](_0x1646f3[_0xfdb5('0x3d')],_0x1646f3['query']);_0x464e5b[_0xfdb5('0x3e')]=_[_0xfdb5('0x3c')](_0x1646f3['model'],qs[_0xfdb5('0x3f')](_0x387639[_0xfdb5('0x3b')][_0xfdb5('0x3f')]));_0x464e5b[_0xfdb5('0x3e')]=_0x464e5b[_0xfdb5('0x3e')][_0xfdb5('0x40')]?_0x464e5b[_0xfdb5('0x3e')]:_0x1646f3[_0xfdb5('0x3d')];if(!_0x387639[_0xfdb5('0x3b')]['hasOwnProperty'](_0xfdb5('0x41'))){_0x464e5b['limit']=qs['limit'](_0x387639[_0xfdb5('0x3b')][_0xfdb5('0x2b')]);_0x464e5b['offset']=qs[_0xfdb5('0x2a')](_0x387639['query'][_0xfdb5('0x2a')]);}_0x464e5b[_0xfdb5('0x42')]=qs[_0xfdb5('0x43')](_0x387639[_0xfdb5('0x3b')][_0xfdb5('0x43')]);_0x464e5b[_0xfdb5('0x44')]=qs[_0xfdb5('0x45')](_['pick'](_0x387639[_0xfdb5('0x3b')],_0x1646f3['filters']));if(_0x387639[_0xfdb5('0x3b')]['filter']){_0x464e5b['where']=_[_0xfdb5('0x46')](_0x464e5b[_0xfdb5('0x44')],{'$or':_['map'](_0xcdd796,function(_0x59040e){if(_0x59040e[_0xfdb5('0x39')]!==_0xfdb5('0x47')){var _0x2baa71={};_0x2baa71[_0x59040e[_0xfdb5('0x33')]]={'$like':'%'+_0x387639['query'][_0xfdb5('0x48')]+'%'};return _0x2baa71;}})});}_0x464e5b=_['merge']({},_0x464e5b,_0x387639[_0xfdb5('0x49')]);var _0x4b2ef2={'where':_0x464e5b['where']};return db[_0xfdb5('0x36')]['count'](_0x4b2ef2)[_0xfdb5('0x1d')](function(_0xef3d20){_0x4296e6[_0xfdb5('0x29')]=_0xef3d20;if(_0x387639[_0xfdb5('0x3b')][_0xfdb5('0x4a')]){_0x464e5b[_0xfdb5('0x4b')]=[{'all':!![]}];}return db[_0xfdb5('0x36')][_0xfdb5('0x4c')](_0x464e5b);})[_0xfdb5('0x1d')](function(_0x34058e){_0x4296e6[_0xfdb5('0x4d')]=_0x34058e;return _0x4296e6;})[_0xfdb5('0x1d')](respondWithFilteredResult(_0x56007f,_0x464e5b))[_0xfdb5('0x4e')](handleError(_0x56007f,null));};exports['show']=function(_0x458973,_0x39f68d){var _0x257a35={'raw':![],'where':{'id':_0x458973[_0xfdb5('0x4f')]['id']}},_0x374032={};_0x374032[_0xfdb5('0x3d')]=_['keys'](db[_0xfdb5('0x36')][_0xfdb5('0x37')]);_0x374032[_0xfdb5('0x3b')]=_['keys'](_0x458973[_0xfdb5('0x3b')]);_0x374032[_0xfdb5('0x45')]=_[_0xfdb5('0x3c')](_0x374032[_0xfdb5('0x3d')],_0x374032[_0xfdb5('0x3b')]);_0x257a35[_0xfdb5('0x3e')]=_[_0xfdb5('0x3c')](_0x374032[_0xfdb5('0x3d')],qs['fields'](_0x458973['query']['fields']));_0x257a35[_0xfdb5('0x3e')]=_0x257a35[_0xfdb5('0x3e')][_0xfdb5('0x40')]?_0x257a35[_0xfdb5('0x3e')]:_0x374032['model'];if(_0x458973['query'][_0xfdb5('0x4a')]){_0x257a35[_0xfdb5('0x4b')]=[{'all':!![]}];}_0x257a35=_[_0xfdb5('0x46')]({},_0x257a35,_0x458973[_0xfdb5('0x49')]);return db[_0xfdb5('0x36')][_0xfdb5('0x50')](_0x257a35)[_0xfdb5('0x1d')](handleEntityNotFound(_0x39f68d,null))['then'](respondWithResult(_0x39f68d,null))['catch'](handleError(_0x39f68d,null));};exports['update']=function(_0x5f7676,_0x3d5b75,_0x405863){var _0x2b1883;return db[_0xfdb5('0x36')]['find']({'where':{'id':_0x5f7676[_0xfdb5('0x4f')]['id']}})[_0xfdb5('0x1d')](handleEntityNotFound(_0x3d5b75,null))[_0xfdb5('0x1d')](saveUpdates(_0x5f7676['body'],null))[_0xfdb5('0x1d')](function(_0x1bae42){if(_0x1bae42){_0x2b1883=_0x1bae42[_0xfdb5('0x51')]({'plain':!![]});var _0x29d846=fs['readFileSync'](path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0xfdb5('0x54')),_0xfdb5('0x55'));var _0x2c6e91=ejs['render'](_0x29d846,_0x2b1883);var _0x591d70=fs[_0xfdb5('0x56')](path[_0xfdb5('0x52')](config['root'],_0xfdb5('0x57')),_0xfdb5('0x55'));var _0x204488=ejs[_0xfdb5('0x58')](_0x591d70,_0x2b1883);fs[_0xfdb5('0x59')](_0xfdb5('0x5a'),_0x2c6e91);fs[_0xfdb5('0x59')](_0xfdb5('0x5b'),_0x204488);return respondWithRpcPromise(_0xfdb5('0x5c'),_0xfdb5('0x30'),{'module':_0xfdb5('0x5d')});}})[_0xfdb5('0x1d')](function(){return respondWithRpcPromise(_0xfdb5('0x5c'),_0xfdb5('0x30'),{'module':_0xfdb5('0x5e')});})[_0xfdb5('0x1d')](function(){return _0x2b1883||null;})['then'](respondWithResult(_0x3d5b75,null))[_0xfdb5('0x4e')](handleError(_0x3d5b75,null));};exports[_0xfdb5('0x5f')]=function(_0x146b5d,_0x629e51,_0x457ac1){if(_0x146b5d[_0xfdb5('0x60')]&&_0x146b5d[_0xfdb5('0x60')][_0xfdb5('0x61')]){_0x146b5d[_0xfdb5('0x62')][_0xfdb5('0x63')]=_0x146b5d['file'][_0xfdb5('0x61')];}return db[_0xfdb5('0x36')]['find']({'where':{'id':_0x146b5d[_0xfdb5('0x4f')]['id']}})[_0xfdb5('0x1d')](handleEntityNotFound(_0x629e51,null))[_0xfdb5('0x1d')](saveUpdates(_0x146b5d['body'],null))[_0xfdb5('0x1d')](respondWithResult(_0x629e51,null))[_0xfdb5('0x4e')](handleError(_0x629e51,null));};exports['addLogoLogin']=function(_0x5a5321,_0x139614,_0x22124d){if(_0x5a5321[_0xfdb5('0x60')]&&_0x5a5321[_0xfdb5('0x60')][_0xfdb5('0x61')]){_0x5a5321[_0xfdb5('0x62')][_0xfdb5('0x64')]=_0x5a5321[_0xfdb5('0x60')][_0xfdb5('0x61')];}return db[_0xfdb5('0x36')][_0xfdb5('0x50')]({'where':{'id':_0x5a5321[_0xfdb5('0x4f')]['id']}})[_0xfdb5('0x1d')](handleEntityNotFound(_0x139614,null))[_0xfdb5('0x1d')](saveUpdates(_0x5a5321[_0xfdb5('0x62')],null))[_0xfdb5('0x1d')](respondWithResult(_0x139614,null))[_0xfdb5('0x4e')](handleError(_0x139614,null));};var utilLicense=require(_0xfdb5('0x65'));exports[_0xfdb5('0x66')]=function(_0x429d32,_0x42cbd0,_0x23bf22){var _0x46db65=_0xfdb5('0x67');var _0x35d133={'custom':![]};return utilLicense[_0xfdb5('0x68')]()['then'](function(_0x1c8595){if(_0x1c8595){_0x35d133=_0x1c8595;}return db[_0xfdb5('0x36')]['find']({'where':{'id':_0x429d32[_0xfdb5('0x4f')]['id']},'attributes':[_0xfdb5('0x63'),'loginLogo',_0xfdb5('0x69'),_0xfdb5('0x6a'),_0xfdb5('0x6b'),_0xfdb5('0x6c'),_0xfdb5('0x6d'),_0xfdb5('0x6e')],'raw':!![]});})[_0xfdb5('0x1d')](handleEntityNotFound(_0x42cbd0,null))[_0xfdb5('0x1d')](function(_0x48b103){if(_0x48b103){var _0x1dba28=_0x48b103[_0xfdb5('0x63')]&&fs['existsSync'](path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x46db65,_[_0xfdb5('0x6f')](_0x48b103['logo'])))?path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x46db65,_[_0xfdb5('0x6f')](_0x48b103[_0xfdb5('0x63')])):path['join'](config[_0xfdb5('0x53')],_0x46db65,_[_0xfdb5('0x6f')](_0xfdb5('0x70')));var _0x320af9=_0xfdb5('0x71')+_[_0xfdb5('0x72')](_0xfdb5('0x63'));if(_0x48b103[_0x320af9]||!_0x35d133[_0xfdb5('0x73')]){_0x1dba28=path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x46db65,_[_0xfdb5('0x6f')]('default_logo.png'));}if(!fs[_0xfdb5('0x74')](_0x1dba28)){throw new db['Sequelize'][(_0xfdb5('0x75'))](_['upperFirst'](_0xfdb5('0x63'))+_0xfdb5('0x76'));}return _0x42cbd0[_0xfdb5('0x77')](_0x1dba28);}})[_0xfdb5('0x4e')](handleError(_0x42cbd0,null));};var utilLicense=require(_0xfdb5('0x65'));exports[_0xfdb5('0x78')]=function(_0x22d653,_0x44c339,_0x4814c2){var _0x5afc52=_0xfdb5('0x67');var _0x59399d={'custom':![]};return utilLicense['getLicense']()[_0xfdb5('0x1d')](function(_0x5a1342){if(_0x5a1342){_0x59399d=_0x5a1342;}return db[_0xfdb5('0x36')][_0xfdb5('0x50')]({'where':{'id':_0x22d653[_0xfdb5('0x4f')]['id']},'attributes':[_0xfdb5('0x63'),_0xfdb5('0x64'),_0xfdb5('0x69'),_0xfdb5('0x6a'),'defaultLogo',_0xfdb5('0x6c'),_0xfdb5('0x6d'),_0xfdb5('0x6e')],'raw':!![]});})[_0xfdb5('0x1d')](handleEntityNotFound(_0x44c339,null))['then'](function(_0x16708c){if(_0x16708c){var _0xb8ad38=_0x16708c[_0xfdb5('0x64')]&&fs[_0xfdb5('0x74')](path['join'](config[_0xfdb5('0x53')],_0x5afc52,_['toLower'](_0x16708c['loginLogo'])))?path['join'](config[_0xfdb5('0x53')],_0x5afc52,_['toLower'](_0x16708c[_0xfdb5('0x64')])):path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x5afc52,_[_0xfdb5('0x6f')](_0xfdb5('0x79')));var _0x1e4482='default'+_[_0xfdb5('0x72')](_0xfdb5('0x64'));if(_0x16708c[_0x1e4482]||!_0x59399d['custom']){_0xb8ad38=path['join'](config[_0xfdb5('0x53')],_0x5afc52,_[_0xfdb5('0x6f')](_0xfdb5('0x79')));}if(!fs[_0xfdb5('0x74')](_0xb8ad38)){throw new db[(_0xfdb5('0x1a'))][(_0xfdb5('0x75'))](_['upperFirst']('loginLogo')+_0xfdb5('0x76'));}return _0x44c339[_0xfdb5('0x77')](_0xb8ad38);}})[_0xfdb5('0x4e')](handleError(_0x44c339,null));};exports['gdpr']=function(_0x2c35ff,_0x2fef45){return db['Setting'][_0xfdb5('0x50')]({'where':{'id':_0x2c35ff[_0xfdb5('0x4f')]['id']},'attributes':['securePassword']})[_0xfdb5('0x1d')](respondWithResult(_0x2fef45,null))[_0xfdb5('0x4e')](handleError(_0x2fef45,null));};exports['addPreferred']=function(_0x4214c7,_0x3be7fd,_0x118f8e){if(_0x4214c7[_0xfdb5('0x60')]&&_0x4214c7['file'][_0xfdb5('0x61')]){_0x4214c7['body'][_0xfdb5('0x69')]=_0x4214c7[_0xfdb5('0x60')][_0xfdb5('0x61')];}return db['Setting'][_0xfdb5('0x50')]({'where':{'id':_0x4214c7[_0xfdb5('0x4f')]['id']}})[_0xfdb5('0x1d')](handleEntityNotFound(_0x3be7fd,null))[_0xfdb5('0x1d')](saveUpdates(_0x4214c7['body'],null))[_0xfdb5('0x1d')](respondWithResult(_0x3be7fd,null))[_0xfdb5('0x4e')](handleError(_0x3be7fd,null));};var utilLicense=require(_0xfdb5('0x65'));exports['getPreferred']=function(_0x40f429,_0x16e01c,_0xcf176e){var _0x1d67d1=_0xfdb5('0x67');var _0x2f8c6a={'custom':![]};return utilLicense['getLicense']()[_0xfdb5('0x1d')](function(_0x47f7d1){if(_0x47f7d1){_0x2f8c6a=_0x47f7d1;}return db[_0xfdb5('0x36')][_0xfdb5('0x50')]({'where':{'id':_0x40f429[_0xfdb5('0x4f')]['id']},'attributes':[_0xfdb5('0x63'),_0xfdb5('0x64'),_0xfdb5('0x69'),'favicon',_0xfdb5('0x6b'),_0xfdb5('0x6c'),_0xfdb5('0x6d'),_0xfdb5('0x6e')],'raw':!![]});})[_0xfdb5('0x1d')](handleEntityNotFound(_0x16e01c,null))[_0xfdb5('0x1d')](function(_0x3b70ad){if(_0x3b70ad){var _0x4aed83=_0x3b70ad[_0xfdb5('0x69')]&&fs[_0xfdb5('0x74')](path[_0xfdb5('0x52')](config['root'],_0x1d67d1,_[_0xfdb5('0x6f')](_0x3b70ad[_0xfdb5('0x69')])))?path['join'](config[_0xfdb5('0x53')],_0x1d67d1,_['toLower'](_0x3b70ad[_0xfdb5('0x69')])):path['join'](config[_0xfdb5('0x53')],_0x1d67d1,_[_0xfdb5('0x6f')](_0xfdb5('0x7a')));var _0x1ecadb=_0xfdb5('0x71')+_[_0xfdb5('0x72')](_0xfdb5('0x69'));if(_0x3b70ad[_0x1ecadb]||!_0x2f8c6a[_0xfdb5('0x73')]||!_0x2f8c6a['preferred']){_0x4aed83=path['join'](config[_0xfdb5('0x53')],_0x1d67d1,_[_0xfdb5('0x6f')](_0xfdb5('0x7a')));}if(!fs[_0xfdb5('0x74')](_0x4aed83)){throw new db[(_0xfdb5('0x1a'))][(_0xfdb5('0x75'))](_[_0xfdb5('0x72')](_0xfdb5('0x69'))+_0xfdb5('0x76'));}return _0x16e01c[_0xfdb5('0x77')](_0x4aed83);}})[_0xfdb5('0x4e')](handleError(_0x16e01c,null));};exports[_0xfdb5('0x7b')]=function(_0x2e7fb6,_0x375a94,_0x25d80a){if(_0x2e7fb6[_0xfdb5('0x60')]&&_0x2e7fb6['file'][_0xfdb5('0x61')]){_0x2e7fb6[_0xfdb5('0x62')][_0xfdb5('0x6a')]=_0x2e7fb6[_0xfdb5('0x60')][_0xfdb5('0x61')];}return db['Setting'][_0xfdb5('0x50')]({'where':{'id':_0x2e7fb6['params']['id']}})['then'](handleEntityNotFound(_0x375a94,null))[_0xfdb5('0x1d')](saveUpdates(_0x2e7fb6['body'],null))[_0xfdb5('0x1d')](respondWithResult(_0x375a94,null))[_0xfdb5('0x4e')](handleError(_0x375a94,null));};var utilLicense=require('../../config/license/util');exports[_0xfdb5('0x7c')]=function(_0x3c9cca,_0x41444a,_0x20bd35){var _0x4e5998='server/files/images/logos';var _0x29347c={'custom':![]};return utilLicense[_0xfdb5('0x68')]()[_0xfdb5('0x1d')](function(_0x43c753){if(_0x43c753){_0x29347c=_0x43c753;}return db['Setting'][_0xfdb5('0x50')]({'where':{'id':_0x3c9cca[_0xfdb5('0x4f')]['id']},'attributes':[_0xfdb5('0x63'),_0xfdb5('0x64'),'preferred',_0xfdb5('0x6a'),_0xfdb5('0x6b'),_0xfdb5('0x6c'),_0xfdb5('0x6d'),_0xfdb5('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x41444a,null))[_0xfdb5('0x1d')](function(_0x47e034){if(_0x47e034){var _0x3e2243=_0x47e034[_0xfdb5('0x6a')]&&fs[_0xfdb5('0x74')](path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x4e5998,_[_0xfdb5('0x6f')](_0x47e034[_0xfdb5('0x6a')])))?path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x4e5998,_['toLower'](_0x47e034[_0xfdb5('0x6a')])):path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x4e5998,_['toLower'](_0xfdb5('0x7d')));var _0x5104c3=_0xfdb5('0x71')+_['upperFirst'](_0xfdb5('0x6a'));if(_0x47e034[_0x5104c3]||!_0x29347c['custom']){_0x3e2243=path[_0xfdb5('0x52')](config[_0xfdb5('0x53')],_0x4e5998,_['toLower'](_0xfdb5('0x7d')));}if(!fs[_0xfdb5('0x74')](_0x3e2243)){throw new db['Sequelize'][(_0xfdb5('0x75'))](_[_0xfdb5('0x72')](_0xfdb5('0x6a'))+_0xfdb5('0x76'));}return _0x41444a[_0xfdb5('0x77')](_0x3e2243);}})[_0xfdb5('0x4e')](handleError(_0x41444a,null));}; \ No newline at end of file +var _0xacc6=['message','result','catch','sendStatus','status','end','count','offset','json','apply','reject','update','destroy','name','send','index','map','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filters','filter','where','merge','VIRTUAL','options','Setting','includeAll','findAll','rows','show','params','rawAttributes','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','res_rtp_asterisk.so','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','\x20not\x20found','download','getLicense','favicon','default_loginLogo.png','securePassword','addPreferred','getPreferred','defaultLogo','default_preferred.png','getFavicon','default_favicon.ico','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2eee7e,_0x2ee664){var _0x465b51=function(_0x5edf2d){while(--_0x5edf2d){_0x2eee7e['push'](_0x2eee7e['shift']());}};_0x465b51(++_0x2ee664);}(_0xacc6,0x150));var _0x6acc=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xacc6[_0x3cea78];return _0x33b66b;};'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 as=require(_0x6acc('0x11'));var hardwareService=require(_0x6acc('0x12'));var logger=require(_0x6acc('0x13'))(_0x6acc('0x14'));var utils=require(_0x6acc('0x15'));var config=require('../../config/environment');var db=require(_0x6acc('0x16'))['db'];var jayson=require(_0x6acc('0x17'));var client=jayson[_0x6acc('0x18')][_0x6acc('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1b95a6,_0x5bdf65,_0x5c6aed){if(_0x5c6aed){var _0x15674a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15674a[_0x6acc('0x1a')](_0x5bdf65)){return _0x1b95a6;}else{throw new db[(_0x6acc('0x1b'))][(_0x6acc('0x1c'))](_0x6acc('0x1d'));}}else{return _0x1b95a6;}}function respondWithRpcPromise(_0x2e3e01,_0x3c4e61,_0x4034fb,_0xf24527){return new BPromise(function(_0xc07208,_0x1fe0ac){var _0x14312b=_0xf24527||client;return _0x14312b[_0x6acc('0x1e')](_0x2e3e01,_0x4034fb)[_0x6acc('0x1f')](function(_0x24f513){logger[_0x6acc('0x20')](_0x6acc('0x21'),_0x3c4e61,_0x6acc('0x22'));logger['debug'](_0x6acc('0x23'),_0x3c4e61,_0x6acc('0x22'),JSON[_0x6acc('0x24')](_0x24f513));if(_0x24f513[_0x6acc('0x25')]){if(_0x24f513['error'][_0x6acc('0x26')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x3c4e61,_0x24f513[_0x6acc('0x25')]['message']);return _0x1fe0ac(_0x24f513[_0x6acc('0x25')][_0x6acc('0x27')]);}logger[_0x6acc('0x25')](_0x6acc('0x21'),_0x3c4e61,_0x24f513[_0x6acc('0x25')]['message']);return _0xc07208(_0x24f513[_0x6acc('0x25')][_0x6acc('0x27')]);}else{logger['info'](_0x6acc('0x21'),_0x3c4e61,'request\x20sent');_0xc07208(_0x24f513[_0x6acc('0x28')][_0x6acc('0x27')]);}})[_0x6acc('0x29')](function(_0x205bda){logger['error'](_0x6acc('0x21'),_0x3c4e61,_0x205bda);_0x1fe0ac(_0x205bda);});});}function respondWithStatusCode(_0xa4d97c,_0x4a4ca1){_0x4a4ca1=_0x4a4ca1||0xcc;return function(_0x10f286){if(_0x10f286){return _0xa4d97c[_0x6acc('0x2a')](_0x4a4ca1);}return _0xa4d97c[_0x6acc('0x2b')](_0x4a4ca1)[_0x6acc('0x2c')]();};}function respondWithResult(_0x212bde,_0x472220){_0x472220=_0x472220||0xc8;return function(_0x31b849){if(_0x31b849){return _0x212bde[_0x6acc('0x2b')](_0x472220)['json'](_0x31b849);}};}function respondWithFilteredResult(_0x89c205,_0x54519d){return function(_0x15be7c){if(_0x15be7c){var _0x490ce6=_0x15be7c[_0x6acc('0x2d')],_0x1bcfad=_0x54519d[_0x6acc('0x2e')],_0x8e75a9=_0x54519d[_0x6acc('0x2e')]+_0x54519d['limit'],_0x3c8c95;if(_0x8e75a9>=_0x490ce6){_0x8e75a9=_0x490ce6;_0x3c8c95=0xc8;}else{_0x3c8c95=0xce;}_0x89c205['status'](_0x3c8c95);return _0x89c205['set']('Content-Range',_0x1bcfad+'-'+_0x8e75a9+'/'+_0x490ce6)[_0x6acc('0x2f')](_0x15be7c);}return null;};}function patchUpdates(_0x23a581){return function(_0x3b8ef2){try{jsonpatch[_0x6acc('0x30')](_0x3b8ef2,_0x23a581,!![]);}catch(_0x349f9d){return BPromise[_0x6acc('0x31')](_0x349f9d);}return _0x3b8ef2['save']();};}function saveUpdates(_0x5942c3,_0x907c72){return function(_0x9415de){if(_0x9415de){return _0x9415de[_0x6acc('0x32')](_0x5942c3)[_0x6acc('0x1f')](function(_0x5e6393){return _0x5e6393;});}return null;};}function removeEntity(_0x2fa0c0,_0x2c0bf4){return function(_0x59a327){if(_0x59a327){return _0x59a327[_0x6acc('0x33')]()[_0x6acc('0x1f')](function(){_0x2fa0c0[_0x6acc('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x518cff,_0xa7bd17){return function(_0x29dc9a){if(!_0x29dc9a){_0x518cff['sendStatus'](0x194);}return _0x29dc9a;};}function handleError(_0x50eef5,_0x51751f){_0x51751f=_0x51751f||0x1f4;return function(_0x204be8){logger[_0x6acc('0x25')](_0x204be8['stack']);if(_0x204be8[_0x6acc('0x34')]){delete _0x204be8[_0x6acc('0x34')];}_0x50eef5[_0x6acc('0x2b')](_0x51751f)[_0x6acc('0x35')](_0x204be8);};}exports[_0x6acc('0x36')]=function(_0x4e52dd,_0x113c7d){var _0x4c8da7={},_0x32c961={},_0x40c2ff={'count':0x0,'rows':[]};var _0x5d6c84=_[_0x6acc('0x37')](db['Setting']['rawAttributes'],function(_0x81e316){return{'name':_0x81e316[_0x6acc('0x38')],'type':_0x81e316[_0x6acc('0x39')]['key']};});_0x32c961[_0x6acc('0x3a')]=_['map'](_0x5d6c84,_0x6acc('0x34'));_0x32c961['query']=_[_0x6acc('0x3b')](_0x4e52dd[_0x6acc('0x3c')]);_0x32c961['filters']=_[_0x6acc('0x3d')](_0x32c961[_0x6acc('0x3a')],_0x32c961[_0x6acc('0x3c')]);_0x4c8da7[_0x6acc('0x3e')]=_[_0x6acc('0x3d')](_0x32c961[_0x6acc('0x3a')],qs[_0x6acc('0x3f')](_0x4e52dd['query']['fields']));_0x4c8da7[_0x6acc('0x3e')]=_0x4c8da7[_0x6acc('0x3e')][_0x6acc('0x40')]?_0x4c8da7['attributes']:_0x32c961[_0x6acc('0x3a')];if(!_0x4e52dd[_0x6acc('0x3c')][_0x6acc('0x41')](_0x6acc('0x42'))){_0x4c8da7[_0x6acc('0x43')]=qs[_0x6acc('0x43')](_0x4e52dd[_0x6acc('0x3c')][_0x6acc('0x43')]);_0x4c8da7[_0x6acc('0x2e')]=qs[_0x6acc('0x2e')](_0x4e52dd[_0x6acc('0x3c')][_0x6acc('0x2e')]);}_0x4c8da7['order']=qs['sort'](_0x4e52dd['query'][_0x6acc('0x44')]);_0x4c8da7['where']=qs['filters'](_[_0x6acc('0x45')](_0x4e52dd[_0x6acc('0x3c')],_0x32c961[_0x6acc('0x46')]));if(_0x4e52dd[_0x6acc('0x3c')][_0x6acc('0x47')]){_0x4c8da7[_0x6acc('0x48')]=_[_0x6acc('0x49')](_0x4c8da7[_0x6acc('0x48')],{'$or':_[_0x6acc('0x37')](_0x5d6c84,function(_0x1311a4){if(_0x1311a4[_0x6acc('0x39')]!==_0x6acc('0x4a')){var _0x1ff2a6={};_0x1ff2a6[_0x1311a4['name']]={'$like':'%'+_0x4e52dd[_0x6acc('0x3c')][_0x6acc('0x47')]+'%'};return _0x1ff2a6;}})});}_0x4c8da7=_['merge']({},_0x4c8da7,_0x4e52dd[_0x6acc('0x4b')]);var _0x4e2504={'where':_0x4c8da7[_0x6acc('0x48')]};return db[_0x6acc('0x4c')]['count'](_0x4e2504)[_0x6acc('0x1f')](function(_0x1b5544){_0x40c2ff[_0x6acc('0x2d')]=_0x1b5544;if(_0x4e52dd[_0x6acc('0x3c')][_0x6acc('0x4d')]){_0x4c8da7['include']=[{'all':!![]}];}return db[_0x6acc('0x4c')][_0x6acc('0x4e')](_0x4c8da7);})[_0x6acc('0x1f')](function(_0x40c879){_0x40c2ff[_0x6acc('0x4f')]=_0x40c879;return _0x40c2ff;})[_0x6acc('0x1f')](respondWithFilteredResult(_0x113c7d,_0x4c8da7))[_0x6acc('0x29')](handleError(_0x113c7d,null));};exports[_0x6acc('0x50')]=function(_0x2e9a6f,_0x28e601){var _0x1989a6={'raw':![],'where':{'id':_0x2e9a6f[_0x6acc('0x51')]['id']}},_0x2344a7={};_0x2344a7[_0x6acc('0x3a')]=_[_0x6acc('0x3b')](db[_0x6acc('0x4c')][_0x6acc('0x52')]);_0x2344a7['query']=_['keys'](_0x2e9a6f['query']);_0x2344a7[_0x6acc('0x46')]=_[_0x6acc('0x3d')](_0x2344a7['model'],_0x2344a7[_0x6acc('0x3c')]);_0x1989a6[_0x6acc('0x3e')]=_[_0x6acc('0x3d')](_0x2344a7[_0x6acc('0x3a')],qs['fields'](_0x2e9a6f[_0x6acc('0x3c')][_0x6acc('0x3f')]));_0x1989a6[_0x6acc('0x3e')]=_0x1989a6[_0x6acc('0x3e')][_0x6acc('0x40')]?_0x1989a6['attributes']:_0x2344a7[_0x6acc('0x3a')];if(_0x2e9a6f[_0x6acc('0x3c')][_0x6acc('0x4d')]){_0x1989a6['include']=[{'all':!![]}];}_0x1989a6=_[_0x6acc('0x49')]({},_0x1989a6,_0x2e9a6f[_0x6acc('0x4b')]);return db[_0x6acc('0x4c')][_0x6acc('0x53')](_0x1989a6)['then'](handleEntityNotFound(_0x28e601,null))[_0x6acc('0x1f')](respondWithResult(_0x28e601,null))[_0x6acc('0x29')](handleError(_0x28e601,null));};exports['update']=function(_0x362613,_0x48b8e1,_0x56f551){var _0x56c1f8;return db[_0x6acc('0x4c')][_0x6acc('0x53')]({'where':{'id':_0x362613[_0x6acc('0x51')]['id']}})['then'](handleEntityNotFound(_0x48b8e1,null))[_0x6acc('0x1f')](saveUpdates(_0x362613[_0x6acc('0x54')],null))['then'](function(_0xae3072){if(_0xae3072){_0x56c1f8=_0xae3072[_0x6acc('0x55')]({'plain':!![]});var _0x40aa59=fs[_0x6acc('0x56')](path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x6acc('0x59')),'utf8');var _0x5265e4=ejs['render'](_0x40aa59,_0x56c1f8);var _0x4caf0f=fs[_0x6acc('0x56')](path['join'](config[_0x6acc('0x58')],_0x6acc('0x5a')),'utf8');var _0x3b8dc8=ejs['render'](_0x4caf0f,_0x56c1f8);fs[_0x6acc('0x5b')](_0x6acc('0x5c'),_0x5265e4);fs[_0x6acc('0x5b')](_0x6acc('0x5d'),_0x3b8dc8);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}})['then'](function(){return respondWithRpcPromise('Reload',_0x6acc('0x32'),{'module':_0x6acc('0x5e')});})[_0x6acc('0x1f')](function(){return _0x56c1f8||null;})[_0x6acc('0x1f')](respondWithResult(_0x48b8e1,null))['catch'](handleError(_0x48b8e1,null));};exports['addLogo']=function(_0x31d1cf,_0x5cbe0e,_0x3557df){if(_0x31d1cf['file']&&_0x31d1cf[_0x6acc('0x5f')][_0x6acc('0x60')]){_0x31d1cf[_0x6acc('0x54')][_0x6acc('0x61')]=_0x31d1cf[_0x6acc('0x5f')][_0x6acc('0x60')];}return db[_0x6acc('0x4c')][_0x6acc('0x53')]({'where':{'id':_0x31d1cf[_0x6acc('0x51')]['id']}})[_0x6acc('0x1f')](handleEntityNotFound(_0x5cbe0e,null))[_0x6acc('0x1f')](saveUpdates(_0x31d1cf[_0x6acc('0x54')],null))[_0x6acc('0x1f')](respondWithResult(_0x5cbe0e,null))[_0x6acc('0x29')](handleError(_0x5cbe0e,null));};exports[_0x6acc('0x62')]=function(_0x257b83,_0x241318,_0xe53bc3){if(_0x257b83[_0x6acc('0x5f')]&&_0x257b83['file'][_0x6acc('0x60')]){_0x257b83['body'][_0x6acc('0x63')]=_0x257b83['file'][_0x6acc('0x60')];}return db['Setting'][_0x6acc('0x53')]({'where':{'id':_0x257b83['params']['id']}})['then'](handleEntityNotFound(_0x241318,null))[_0x6acc('0x1f')](saveUpdates(_0x257b83[_0x6acc('0x54')],null))['then'](respondWithResult(_0x241318,null))[_0x6acc('0x29')](handleError(_0x241318,null));};var utilLicense=require(_0x6acc('0x64'));exports[_0x6acc('0x65')]=function(_0x5c3247,_0x42097a,_0x6f3ffd){var _0x1fe0c7=_0x6acc('0x66');var _0x5b3bd5={'custom':![]};return utilLicense['getLicense']()[_0x6acc('0x1f')](function(_0x86222e){if(_0x86222e){_0x5b3bd5=_0x86222e;}return db[_0x6acc('0x4c')]['find']({'where':{'id':_0x5c3247['params']['id']},'attributes':[_0x6acc('0x61'),_0x6acc('0x63'),_0x6acc('0x67'),'favicon','defaultLogo',_0x6acc('0x68'),_0x6acc('0x69'),_0x6acc('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x42097a,null))[_0x6acc('0x1f')](function(_0xb8a3db){if(_0xb8a3db){var _0x1cd513=_0xb8a3db[_0x6acc('0x61')]&&fs[_0x6acc('0x6b')](path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x1fe0c7,_[_0x6acc('0x6c')](_0xb8a3db[_0x6acc('0x61')])))?path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x1fe0c7,_[_0x6acc('0x6c')](_0xb8a3db['logo'])):path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x1fe0c7,_[_0x6acc('0x6c')](_0x6acc('0x6d')));var _0x47db86=_0x6acc('0x6e')+_[_0x6acc('0x6f')](_0x6acc('0x61'));if(_0xb8a3db[_0x47db86]||!_0x5b3bd5[_0x6acc('0x70')]){_0x1cd513=path[_0x6acc('0x57')](config['root'],_0x1fe0c7,_[_0x6acc('0x6c')]('default_logo.png'));}if(!fs[_0x6acc('0x6b')](_0x1cd513)){throw new db[(_0x6acc('0x1b'))][(_0x6acc('0x1c'))](_[_0x6acc('0x6f')](_0x6acc('0x61'))+_0x6acc('0x71'));}return _0x42097a[_0x6acc('0x72')](_0x1cd513);}})[_0x6acc('0x29')](handleError(_0x42097a,null));};var utilLicense=require(_0x6acc('0x64'));exports['getLogoLogin']=function(_0x1c5853,_0x3bb086,_0x4ff77d){var _0x150e3f=_0x6acc('0x66');var _0x5721e2={'custom':![]};return utilLicense[_0x6acc('0x73')]()[_0x6acc('0x1f')](function(_0x550d09){if(_0x550d09){_0x5721e2=_0x550d09;}return db[_0x6acc('0x4c')]['find']({'where':{'id':_0x1c5853[_0x6acc('0x51')]['id']},'attributes':[_0x6acc('0x61'),'loginLogo','preferred',_0x6acc('0x74'),'defaultLogo',_0x6acc('0x68'),_0x6acc('0x69'),_0x6acc('0x6a')],'raw':!![]});})[_0x6acc('0x1f')](handleEntityNotFound(_0x3bb086,null))[_0x6acc('0x1f')](function(_0x51319a){if(_0x51319a){var _0xd48d1f=_0x51319a[_0x6acc('0x63')]&&fs['existsSync'](path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x150e3f,_[_0x6acc('0x6c')](_0x51319a[_0x6acc('0x63')])))?path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x150e3f,_[_0x6acc('0x6c')](_0x51319a['loginLogo'])):path['join'](config[_0x6acc('0x58')],_0x150e3f,_[_0x6acc('0x6c')](_0x6acc('0x75')));var _0x3e0506=_0x6acc('0x6e')+_[_0x6acc('0x6f')]('loginLogo');if(_0x51319a[_0x3e0506]||!_0x5721e2[_0x6acc('0x70')]){_0xd48d1f=path[_0x6acc('0x57')](config['root'],_0x150e3f,_[_0x6acc('0x6c')]('default_loginLogo.png'));}if(!fs[_0x6acc('0x6b')](_0xd48d1f)){throw new db[(_0x6acc('0x1b'))][(_0x6acc('0x1c'))](_[_0x6acc('0x6f')](_0x6acc('0x63'))+'\x20not\x20found');}return _0x3bb086[_0x6acc('0x72')](_0xd48d1f);}})[_0x6acc('0x29')](handleError(_0x3bb086,null));};exports['gdpr']=function(_0x2e2354,_0x618bbf){return db[_0x6acc('0x4c')][_0x6acc('0x53')]({'where':{'id':_0x2e2354[_0x6acc('0x51')]['id']},'attributes':[_0x6acc('0x76')]})[_0x6acc('0x1f')](respondWithResult(_0x618bbf,null))[_0x6acc('0x29')](handleError(_0x618bbf,null));};exports[_0x6acc('0x77')]=function(_0xb9566d,_0x140f1f,_0x154299){if(_0xb9566d[_0x6acc('0x5f')]&&_0xb9566d['file']['filename']){_0xb9566d[_0x6acc('0x54')][_0x6acc('0x67')]=_0xb9566d[_0x6acc('0x5f')][_0x6acc('0x60')];}return db[_0x6acc('0x4c')][_0x6acc('0x53')]({'where':{'id':_0xb9566d['params']['id']}})['then'](handleEntityNotFound(_0x140f1f,null))[_0x6acc('0x1f')](saveUpdates(_0xb9566d[_0x6acc('0x54')],null))['then'](respondWithResult(_0x140f1f,null))[_0x6acc('0x29')](handleError(_0x140f1f,null));};var utilLicense=require(_0x6acc('0x64'));exports[_0x6acc('0x78')]=function(_0x3612aa,_0x12d784,_0x523537){var _0x574f5b='server/files/images/logos';var _0x286fb5={'custom':![]};return utilLicense[_0x6acc('0x73')]()[_0x6acc('0x1f')](function(_0x30aef7){if(_0x30aef7){_0x286fb5=_0x30aef7;}return db[_0x6acc('0x4c')]['find']({'where':{'id':_0x3612aa[_0x6acc('0x51')]['id']},'attributes':[_0x6acc('0x61'),'loginLogo',_0x6acc('0x67'),_0x6acc('0x74'),_0x6acc('0x79'),_0x6acc('0x68'),_0x6acc('0x69'),_0x6acc('0x6a')],'raw':!![]});})[_0x6acc('0x1f')](handleEntityNotFound(_0x12d784,null))[_0x6acc('0x1f')](function(_0x2c51fb){if(_0x2c51fb){var _0x2246b8=_0x2c51fb[_0x6acc('0x67')]&&fs['existsSync'](path[_0x6acc('0x57')](config['root'],_0x574f5b,_[_0x6acc('0x6c')](_0x2c51fb['preferred'])))?path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x574f5b,_[_0x6acc('0x6c')](_0x2c51fb[_0x6acc('0x67')])):path[_0x6acc('0x57')](config['root'],_0x574f5b,_[_0x6acc('0x6c')](_0x6acc('0x7a')));var _0x4fc2fb='default'+_[_0x6acc('0x6f')]('preferred');if(_0x2c51fb[_0x4fc2fb]||!_0x286fb5[_0x6acc('0x70')]||!_0x286fb5['preferred']){_0x2246b8=path[_0x6acc('0x57')](config[_0x6acc('0x58')],_0x574f5b,_[_0x6acc('0x6c')]('default_preferred.png'));}if(!fs[_0x6acc('0x6b')](_0x2246b8)){throw new db[(_0x6acc('0x1b'))][(_0x6acc('0x1c'))](_[_0x6acc('0x6f')](_0x6acc('0x67'))+_0x6acc('0x71'));}return _0x12d784[_0x6acc('0x72')](_0x2246b8);}})[_0x6acc('0x29')](handleError(_0x12d784,null));};exports['addFavicon']=function(_0x2fffcd,_0x5ebcc7,_0x273cb1){if(_0x2fffcd[_0x6acc('0x5f')]&&_0x2fffcd[_0x6acc('0x5f')][_0x6acc('0x60')]){_0x2fffcd[_0x6acc('0x54')]['favicon']=_0x2fffcd[_0x6acc('0x5f')][_0x6acc('0x60')];}return db[_0x6acc('0x4c')][_0x6acc('0x53')]({'where':{'id':_0x2fffcd[_0x6acc('0x51')]['id']}})[_0x6acc('0x1f')](handleEntityNotFound(_0x5ebcc7,null))[_0x6acc('0x1f')](saveUpdates(_0x2fffcd['body'],null))[_0x6acc('0x1f')](respondWithResult(_0x5ebcc7,null))[_0x6acc('0x29')](handleError(_0x5ebcc7,null));};var utilLicense=require(_0x6acc('0x64'));exports[_0x6acc('0x7b')]=function(_0x3f070e,_0x262be1,_0x2c7274){var _0x4d5944=_0x6acc('0x66');var _0x1ea3c1={'custom':![]};return utilLicense[_0x6acc('0x73')]()['then'](function(_0x697dd1){if(_0x697dd1){_0x1ea3c1=_0x697dd1;}return db['Setting']['find']({'where':{'id':_0x3f070e[_0x6acc('0x51')]['id']},'attributes':[_0x6acc('0x61'),_0x6acc('0x63'),_0x6acc('0x67'),_0x6acc('0x74'),'defaultLogo',_0x6acc('0x68'),_0x6acc('0x69'),_0x6acc('0x6a')],'raw':!![]});})[_0x6acc('0x1f')](handleEntityNotFound(_0x262be1,null))['then'](function(_0x59da89){if(_0x59da89){var _0x3f356b=_0x59da89[_0x6acc('0x74')]&&fs['existsSync'](path[_0x6acc('0x57')](config['root'],_0x4d5944,_[_0x6acc('0x6c')](_0x59da89[_0x6acc('0x74')])))?path['join'](config[_0x6acc('0x58')],_0x4d5944,_[_0x6acc('0x6c')](_0x59da89[_0x6acc('0x74')])):path['join'](config['root'],_0x4d5944,_[_0x6acc('0x6c')]('default_favicon.ico'));var _0x7d1955=_0x6acc('0x6e')+_[_0x6acc('0x6f')]('favicon');if(_0x59da89[_0x7d1955]||!_0x1ea3c1[_0x6acc('0x70')]){_0x3f356b=path['join'](config['root'],_0x4d5944,_['toLower'](_0x6acc('0x7c')));}if(!fs['existsSync'](_0x3f356b)){throw new db[(_0x6acc('0x1b'))]['ValidationError'](_['upperFirst'](_0x6acc('0x74'))+_0x6acc('0x71'));}return _0x262be1[_0x6acc('0x72')](_0x3f356b);}})['catch'](handleError(_0x262be1,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e09dfcb..2b2306c 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 _0x8f3b=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Setting','settings','lodash','util'];(function(_0x44c836,_0x707237){var _0x16e98f=function(_0x59bb1a){while(--_0x59bb1a){_0x44c836['push'](_0x44c836['shift']());}};_0x16e98f(++_0x707237);}(_0x8f3b,0xee));var _0xb8f3=function(_0x41983f,_0x277cb8){_0x41983f=_0x41983f-0x0;var _0x5ac289=_0x8f3b[_0x41983f];return _0x5ac289;};'use strict';var _=require(_0xb8f3('0x0'));var util=require(_0xb8f3('0x1'));var logger=require('../../config/logger')(_0xb8f3('0x2'));var moment=require(_0xb8f3('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8f3('0x4'));var fs=require('fs');var path=require(_0xb8f3('0x5'));var rimraf=require(_0xb8f3('0x6'));var config=require(_0xb8f3('0x7'));var attributes=require('./setting.attributes');module[_0xb8f3('0x8')]=function(_0x31f052,_0x3efd05){return _0x31f052[_0xb8f3('0x9')](_0xb8f3('0xa'),attributes,{'tableName':_0xb8f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09f4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting','settings'];(function(_0x549a84,_0x225007){var _0x121d5d=function(_0xc71860){while(--_0xc71860){_0x549a84['push'](_0x549a84['shift']());}};_0x121d5d(++_0x225007);}(_0x09f4,0xe4));var _0x409f=function(_0x1858d6,_0x1b0c23){_0x1858d6=_0x1858d6-0x0;var _0x5cff88=_0x09f4[_0x1858d6];return _0x5cff88;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x409f('0x0'))(_0x409f('0x1'));var moment=require(_0x409f('0x2'));var BPromise=require(_0x409f('0x3'));var rp=require(_0x409f('0x4'));var fs=require('fs');var path=require(_0x409f('0x5'));var rimraf=require(_0x409f('0x6'));var config=require(_0x409f('0x7'));var attributes=require(_0x409f('0x8'));module[_0x409f('0x9')]=function(_0x2ca9ed,_0x4a17e8){return _0x2ca9ed['define'](_0x409f('0xa'),attributes,{'tableName':_0x409f('0xb'),'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 e0bf2d8..453f953 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 _0xa4f6=['../../config/environment','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Setting,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa4f6,0xc6));var _0x6a4f=function(_0x26dec9,_0x335a1f){_0x26dec9=_0x26dec9-0x0;var _0x215027=_0xa4f6[_0x26dec9];return _0x215027;};'use strict';var _=require(_0x6a4f('0x0'));var util=require(_0x6a4f('0x1'));var moment=require(_0x6a4f('0x2'));var BPromise=require(_0x6a4f('0x3'));var rs=require(_0x6a4f('0x4'));var fs=require('fs');var Redis=require(_0x6a4f('0x5'));var db=require(_0x6a4f('0x6'))['db'];var utils=require(_0x6a4f('0x7'));var logger=require(_0x6a4f('0x8'))(_0x6a4f('0x9'));var config=require(_0x6a4f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6a4f('0xb')][_0x6a4f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1098d4,_0x3ca1b2,_0x2e6076){return new BPromise(function(_0x32e87d,_0x3e50ed){return client[_0x6a4f('0xd')](_0x1098d4,_0x2e6076)[_0x6a4f('0xe')](function(_0x50e91f){logger['info']('Setting,\x20%s,\x20%s',_0x3ca1b2,_0x6a4f('0xf'));logger[_0x6a4f('0x10')](_0x6a4f('0x11'),_0x3ca1b2,'request\x20sent',JSON[_0x6a4f('0x12')](_0x50e91f));if(_0x50e91f[_0x6a4f('0x13')]){if(_0x50e91f[_0x6a4f('0x13')][_0x6a4f('0x14')]===0x1f4){logger[_0x6a4f('0x13')]('Setting,\x20%s,\x20%s',_0x3ca1b2,_0x50e91f[_0x6a4f('0x13')][_0x6a4f('0x15')]);return _0x3e50ed(_0x50e91f[_0x6a4f('0x13')][_0x6a4f('0x15')]);}logger[_0x6a4f('0x13')]('Setting,\x20%s,\x20%s',_0x3ca1b2,_0x50e91f[_0x6a4f('0x13')][_0x6a4f('0x15')]);return _0x32e87d(_0x50e91f['error'][_0x6a4f('0x15')]);}else{logger[_0x6a4f('0x16')]('Setting,\x20%s,\x20%s',_0x3ca1b2,'request\x20sent');_0x32e87d(_0x50e91f[_0x6a4f('0x17')][_0x6a4f('0x15')]);}})[_0x6a4f('0x18')](function(_0x42d663){logger['error'](_0x6a4f('0x19'),_0x3ca1b2,_0x42d663);_0x3e50ed(_0x42d663);});});} \ No newline at end of file +var _0x1257=['util','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x2f9de8,_0x4f8d46){var _0x259b83=function(_0x20ac87){while(--_0x20ac87){_0x2f9de8['push'](_0x2f9de8['shift']());}};_0x259b83(++_0x4f8d46);}(_0x1257,0x7f));var _0x7125=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x1257[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x7125('0x0'));var util=require(_0x7125('0x1'));var moment=require('moment');var BPromise=require(_0x7125('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7125('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x7125('0x4'));var jayson=require(_0x7125('0x5'));var client=jayson[_0x7125('0x6')][_0x7125('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59f88d,_0x28d461,_0x4d19ba){return new BPromise(function(_0x301083,_0x868840){return client[_0x7125('0x8')](_0x59f88d,_0x4d19ba)['then'](function(_0x5e8986){logger['info'](_0x7125('0x9'),_0x28d461,_0x7125('0xa'));logger['debug'](_0x7125('0xb'),_0x28d461,_0x7125('0xa'),JSON[_0x7125('0xc')](_0x5e8986));if(_0x5e8986[_0x7125('0xd')]){if(_0x5e8986[_0x7125('0xd')]['code']===0x1f4){logger[_0x7125('0xd')](_0x7125('0x9'),_0x28d461,_0x5e8986[_0x7125('0xd')]['message']);return _0x868840(_0x5e8986[_0x7125('0xd')]['message']);}logger[_0x7125('0xd')]('Setting,\x20%s,\x20%s',_0x28d461,_0x5e8986[_0x7125('0xd')][_0x7125('0xe')]);return _0x301083(_0x5e8986['error'][_0x7125('0xe')]);}else{logger['info'](_0x7125('0x9'),_0x28d461,'request\x20sent');_0x301083(_0x5e8986['result'][_0x7125('0xe')]);}})[_0x7125('0xf')](function(_0x1b5e35){logger[_0x7125('0xd')](_0x7125('0x9'),_0x28d461,_0x1b5e35);_0x868840(_0x1b5e35);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 896f2f2..492f213 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 _0xebf1=['/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x20a3ee,_0x3acc69){var _0x2c7cb1=function(_0x1c7dcd){while(--_0x1c7dcd){_0x20a3ee['push'](_0x20a3ee['shift']());}};_0x2c7cb1(++_0x3acc69);}(_0xebf1,0x65));var _0x1ebf=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xebf1[_0x4b73a2];return _0x383c66;};'use strict';var multer=require(_0x1ebf('0x0'));var util=require(_0x1ebf('0x1'));var path=require(_0x1ebf('0x2'));var timeout=require(_0x1ebf('0x3'));var express=require(_0x1ebf('0x4'));var router=express[_0x1ebf('0x5')]();var auth=require(_0x1ebf('0x6'));var interaction=require(_0x1ebf('0x7'));var config=require(_0x1ebf('0x8'));var controller=require('./smsAccount.controller');router[_0x1ebf('0x9')]('/',auth['isAuthenticated'](),controller[_0x1ebf('0xa')]);router['get'](_0x1ebf('0xb'),auth['isAuthenticated'](),controller[_0x1ebf('0xc')]);router[_0x1ebf('0x9')](_0x1ebf('0xd'),auth['isAuthenticated'](),controller[_0x1ebf('0xe')]);router['get'](_0x1ebf('0xf'),auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x11')]);router[_0x1ebf('0x9')](_0x1ebf('0x12'),auth['isAuthenticated'](),controller[_0x1ebf('0x13')]);router[_0x1ebf('0x9')](_0x1ebf('0x14'),auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x15')]);router[_0x1ebf('0x9')](_0x1ebf('0x16'),auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x17')]);router['get'](_0x1ebf('0x18'),controller['statusGet']);router['get'](_0x1ebf('0x19'),auth['isAuthenticated'](),controller[_0x1ebf('0x1a')]);router[_0x1ebf('0x1b')]('/',auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x1c')]);router[_0x1ebf('0x1b')]('/:id/dispositions',auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x1d')]);router[_0x1ebf('0x1b')]('/:id/canned_answers',auth[_0x1ebf('0x10')](),controller['addAnswer']);router[_0x1ebf('0x1b')](_0x1ebf('0x1e'),controller[_0x1ebf('0x1f')]);router[_0x1ebf('0x1b')]('/:id/applications',auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x20')]);router[_0x1ebf('0x1b')]('/:id/send',auth['isAuthenticated'](),controller[_0x1ebf('0x21')]);router[_0x1ebf('0x1b')](_0x1ebf('0x18'),controller['status']);router['post'](_0x1ebf('0x19'),auth[_0x1ebf('0x10')](),controller['addAgents']);router[_0x1ebf('0x22')](_0x1ebf('0xd'),auth['isAuthenticated'](),controller[_0x1ebf('0x23')]);router[_0x1ebf('0x24')](_0x1ebf('0xd'),auth['isAuthenticated'](),controller[_0x1ebf('0x25')]);router[_0x1ebf('0x24')](_0x1ebf('0xf'),auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x26')]);router['delete']('/:id/canned_answers',auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x27')]);router[_0x1ebf('0x24')](_0x1ebf('0x19'),auth[_0x1ebf('0x10')](),controller[_0x1ebf('0x28')]);module[_0x1ebf('0x29')]=router; \ No newline at end of file +var _0x7c8d=['/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','/:id/send','send','status','put','/:id','delete','/:id/dispositions','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c8d,0x115));var _0xd7c8=function(_0x12ef39,_0x18d320){_0x12ef39=_0x12ef39-0x0;var _0x47a734=_0x7c8d[_0x12ef39];return _0x47a734;};'use strict';var multer=require(_0xd7c8('0x0'));var util=require(_0xd7c8('0x1'));var path=require(_0xd7c8('0x2'));var timeout=require(_0xd7c8('0x3'));var express=require('express');var router=express[_0xd7c8('0x4')]();var auth=require(_0xd7c8('0x5'));var interaction=require(_0xd7c8('0x6'));var config=require(_0xd7c8('0x7'));var controller=require('./smsAccount.controller');router[_0xd7c8('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7c8('0x9')]);router['get'](_0xd7c8('0xa'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0xc')]);router['get']('/:id',auth[_0xd7c8('0xb')](),controller[_0xd7c8('0xd')]);router[_0xd7c8('0x8')]('/:id/dispositions',auth[_0xd7c8('0xb')](),controller['getDispositions']);router[_0xd7c8('0x8')]('/:id/canned_answers',auth[_0xd7c8('0xb')](),controller['getAnswers']);router[_0xd7c8('0x8')](_0xd7c8('0xe'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0xf')]);router[_0xd7c8('0x8')](_0xd7c8('0x10'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x11')]);router[_0xd7c8('0x8')](_0xd7c8('0x12'),controller['statusGet']);router[_0xd7c8('0x8')](_0xd7c8('0x13'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x14')]);router[_0xd7c8('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd7c8('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd7c8('0x16')]);router[_0xd7c8('0x15')](_0xd7c8('0x17'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x18')]);router[_0xd7c8('0x15')](_0xd7c8('0x19'),controller['notify']);router[_0xd7c8('0x15')](_0xd7c8('0xe'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x1a')]);router['post'](_0xd7c8('0x1b'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x1c')]);router['post'](_0xd7c8('0x12'),controller[_0xd7c8('0x1d')]);router[_0xd7c8('0x15')](_0xd7c8('0x13'),auth[_0xd7c8('0xb')](),controller['addAgents']);router[_0xd7c8('0x1e')](_0xd7c8('0x1f'),auth[_0xd7c8('0xb')](),controller['update']);router[_0xd7c8('0x20')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd7c8('0x20')](_0xd7c8('0x21'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x22')]);router[_0xd7c8('0x20')](_0xd7c8('0x17'),auth[_0xd7c8('0xb')](),controller[_0xd7c8('0x23')]);router['delete']('/:id/users',auth[_0xd7c8('0xb')](),controller['removeAgents']);module[_0xd7c8('0x24')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 1913578..9b8f116 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 _0x1339=['intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','exports','STRING','name','generate','twilio','skebby','connectel','plivo','clickatell','csc','infobip'];(function(_0x2db0de,_0x279fcb){var _0x4c2dfb=function(_0x11ea7c){while(--_0x11ea7c){_0x2db0de['push'](_0x2db0de['shift']());}};_0x4c2dfb(++_0x279fcb);}(_0x1339,0x1ed));var _0x9133=function(_0x296363,_0x4f125a){_0x296363=_0x296363-0x0;var _0x29e0ee=_0x1339[_0x296363];return _0x29e0ee;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x9133('0x0')]={'name':{'type':Sequelize[_0x9133('0x1')],'unique':_0x9133('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9133('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x9133('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x9133('0x1')],'defaultValue':function(){return rs[_0x9133('0x3')]();}},'phone':{'type':Sequelize[_0x9133('0x1')]},'type':{'type':Sequelize['ENUM'](_0x9133('0x4'),_0x9133('0x5'),_0x9133('0x6'),'clicksend',_0x9133('0x7'),_0x9133('0x8'),_0x9133('0x9'),_0x9133('0xa'),_0x9133('0xb'))},'accountSid':{'type':Sequelize[_0x9133('0x1')]},'authId':{'type':Sequelize[_0x9133('0x1')]},'authToken':{'type':Sequelize[_0x9133('0x1')]},'smsMethod':{'type':Sequelize[_0x9133('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9133('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x9133('0x1')]},'senderString':{'type':Sequelize[_0x9133('0x1')]},'deliveryReport':{'type':Sequelize[_0x9133('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x9133('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9133('0xe')],'defaultValue':function(){return _0x9133('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9133('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9133('0x10')],'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[_0x9133('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9133('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9133('0x10')],'comment':_0x9133('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x9133('0xd')],'defaultValue':![],'comment':_0x9133('0x12'),'set':function(_0x4327b3){if(!_0x4327b3)this['setDataValue'](_0x9133('0x13'),null);this[_0x9133('0x14')]('mandatoryDisposition',_0x4327b3);}}}; \ No newline at end of file +var _0xb903=['infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','connectel','clickatell','csc'];(function(_0x19ff05,_0xff368e){var _0x2a1aed=function(_0x49bba9){while(--_0x49bba9){_0x19ff05['push'](_0x19ff05['shift']());}};_0x2a1aed(++_0xff368e);}(_0xb903,0x185));var _0x3b90=function(_0x2480ca,_0x613642){_0x2480ca=_0x2480ca-0x0;var _0x578dfb=_0xb903[_0x2480ca];return _0x578dfb;};'use strict';var Sequelize=require(_0x3b90('0x0'));var rs=require(_0x3b90('0x1'));module[_0x3b90('0x2')]={'name':{'type':Sequelize[_0x3b90('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':function(){return rs[_0x3b90('0x4')]();}},'phone':{'type':Sequelize[_0x3b90('0x3')]},'type':{'type':Sequelize[_0x3b90('0x5')](_0x3b90('0x6'),'skebby',_0x3b90('0x7'),'clicksend','plivo',_0x3b90('0x8'),_0x3b90('0x9'),_0x3b90('0xa'),_0x3b90('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x3b90('0x3')]},'senderString':{'type':Sequelize[_0x3b90('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3b90('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3b90('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3b90('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3b90('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3b90('0xe')],'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[_0x3b90('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3b90('0xe')],'comment':_0x3b90('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3725b9){if(!_0x3725b9)this[_0x3b90('0x10')](_0x3b90('0x11'),null);this[_0x3b90('0x10')](_0x3b90('0x12'),_0x3725b9);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 19af1db..f1b5933 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 _0x4ea7=['index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','nolimit','limit','order','sort','where','merge','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','catch','params','length','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','findOne','pick','filter','removeDispositions','ids','CannedAnswer','hasOwnProperty','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','plivo','MessageUUID','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','log','inspect','skebby_dispatch_id','connectel','requestid','message_id','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','received\x20delivery\x20report\x20from','message-id','state','csc','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','status','json','count','offset','set','apply','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send'];(function(_0x526936,_0x10a4ac){var _0x44c22e=function(_0xa4b9b4){while(--_0xa4b9b4){_0x526936['push'](_0x526936['shift']());}};_0x44c22e(++_0x10a4ac);}(_0x4ea7,0x182));var _0x74ea=function(_0x1c82e3,_0x44b94d){_0x1c82e3=_0x1c82e3-0x0;var _0x214a9f=_0x4ea7[_0x1c82e3];return _0x214a9f;};'use strict';var pdf=require(_0x74ea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x74ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74ea('0x2'));var rp=require(_0x74ea('0x3'));var moment=require('moment');var BPromise=require(_0x74ea('0x4'));var Mustache=require(_0x74ea('0x5'));var util=require('util');var path=require(_0x74ea('0x6'));var sox=require(_0x74ea('0x7'));var csv=require(_0x74ea('0x8'));var ejs=require(_0x74ea('0x9'));var fs=require('fs');var _=require(_0x74ea('0xa'));var squel=require(_0x74ea('0xb'));var crypto=require(_0x74ea('0xc'));var jsforce=require(_0x74ea('0xd'));var deskjs=require(_0x74ea('0xe'));var toCsv=require(_0x74ea('0x8'));var querystring=require(_0x74ea('0xf'));var Papa=require(_0x74ea('0x10'));var Redis=require(_0x74ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x74ea('0x12'));var as=require(_0x74ea('0x13'));var hardwareService=require(_0x74ea('0x14'));var logger=require(_0x74ea('0x15'))('api');var utils=require(_0x74ea('0x16'));var config=require('../../config/environment');var db=require(_0x74ea('0x17'))['db'];config[_0x74ea('0x18')]=_['defaults'](config[_0x74ea('0x18')],{'host':_0x74ea('0x19'),'port':0x18eb});var socket=require(_0x74ea('0x1a'))(new Redis(config[_0x74ea('0x18')]));require(_0x74ea('0x1b'))[_0x74ea('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x74ea('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x26a0a8,_0x41a6d5,_0x7c8668){if(_0x7c8668){var _0x39c753=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39c753['test'](_0x41a6d5)){return _0x26a0a8;}else{throw new db[(_0x74ea('0x1e'))][(_0x74ea('0x1f'))](_0x74ea('0x20'));}}else{return _0x26a0a8;}}function respondWithRpcPromise(_0x468a36,_0x4ee243,_0xcc85ed,_0x16b549){return new BPromise(function(_0x549530,_0x2e692d){var _0x4b5b4b=_0x16b549||client;return _0x4b5b4b[_0x74ea('0x21')](_0x468a36,_0xcc85ed)['then'](function(_0x5df894){logger[_0x74ea('0x22')](_0x74ea('0x23'),_0x4ee243,_0x74ea('0x24'));logger[_0x74ea('0x25')](_0x74ea('0x26'),_0x4ee243,'request\x20sent',JSON[_0x74ea('0x27')](_0x5df894));if(_0x5df894['error']){if(_0x5df894[_0x74ea('0x28')]['code']===0x1f4){logger['error'](_0x74ea('0x23'),_0x4ee243,_0x5df894[_0x74ea('0x28')]['message']);return _0x2e692d(_0x5df894[_0x74ea('0x28')]['message']);}logger[_0x74ea('0x28')](_0x74ea('0x23'),_0x4ee243,_0x5df894[_0x74ea('0x28')][_0x74ea('0x29')]);return _0x549530(_0x5df894[_0x74ea('0x28')]['message']);}else{logger[_0x74ea('0x22')]('SmsAccount,\x20%s,\x20%s',_0x4ee243,_0x74ea('0x24'));_0x549530(_0x5df894[_0x74ea('0x2a')][_0x74ea('0x29')]);}})['catch'](function(_0x6d52ae){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4ee243,_0x6d52ae);_0x2e692d(_0x6d52ae);});});}function respondWithStatusCode(_0x58d00a,_0x2bd257){_0x2bd257=_0x2bd257||0xcc;return function(_0x2e43cb){if(_0x2e43cb){return _0x58d00a['sendStatus'](_0x2bd257);}return _0x58d00a['status'](_0x2bd257)[_0x74ea('0x2b')]();};}function respondWithResult(_0x540199,_0xa0ae7f){_0xa0ae7f=_0xa0ae7f||0xc8;return function(_0x8058f7){if(_0x8058f7){return _0x540199[_0x74ea('0x2c')](_0xa0ae7f)[_0x74ea('0x2d')](_0x8058f7);}};}function respondWithFilteredResult(_0x2580fa,_0x11a09e){return function(_0x4916e2){if(_0x4916e2){var _0x1d1ca7=_0x4916e2[_0x74ea('0x2e')],_0x2ee625=_0x11a09e[_0x74ea('0x2f')],_0x347d49=_0x11a09e[_0x74ea('0x2f')]+_0x11a09e['limit'],_0xfb5d7b;if(_0x347d49>=_0x1d1ca7){_0x347d49=_0x1d1ca7;_0xfb5d7b=0xc8;}else{_0xfb5d7b=0xce;}_0x2580fa[_0x74ea('0x2c')](_0xfb5d7b);return _0x2580fa[_0x74ea('0x30')]('Content-Range',_0x2ee625+'-'+_0x347d49+'/'+_0x1d1ca7)['json'](_0x4916e2);}return null;};}function patchUpdates(_0x1a09f7){return function(_0x3d32e7){try{jsonpatch[_0x74ea('0x31')](_0x3d32e7,_0x1a09f7,!![]);}catch(_0x29ee01){return BPromise[_0x74ea('0x32')](_0x29ee01);}return _0x3d32e7['save']();};}function saveUpdates(_0x48be07,_0x2d8f96){return function(_0x41d9fd){if(_0x41d9fd){return _0x41d9fd[_0x74ea('0x33')](_0x48be07)[_0x74ea('0x34')](function(_0x2ba886){return _0x2ba886;});}return null;};}function removeEntity(_0x40986a,_0x4ec718){return function(_0x45e51a){if(_0x45e51a){return _0x45e51a[_0x74ea('0x35')]()['then'](function(){var _0x489e5a=_0x45e51a[_0x74ea('0x36')]({'plain':!![]});var _0x229e00=_0x74ea('0x37');return db[_0x74ea('0x38')][_0x74ea('0x35')]({'where':{'type':_0x229e00,'resourceId':_0x489e5a['id']}})[_0x74ea('0x34')](function(){return _0x45e51a;});})['then'](function(){_0x40986a[_0x74ea('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55272f,_0x1f2ba1){return function(_0x2b8f00){if(!_0x2b8f00){_0x55272f['sendStatus'](0x194);}return _0x2b8f00;};}function handleError(_0x2d50ff,_0x41d1fd){_0x41d1fd=_0x41d1fd||0x1f4;return function(_0x1acdaf){logger['error'](_0x1acdaf[_0x74ea('0x39')]);if(_0x1acdaf[_0x74ea('0x3a')]){delete _0x1acdaf['name'];}_0x2d50ff[_0x74ea('0x2c')](_0x41d1fd)[_0x74ea('0x3b')](_0x1acdaf);};}exports[_0x74ea('0x3c')]=function(_0x44de7b,_0x47686d){var _0x575785={'include':[{'model':db[_0x74ea('0x3d')],'as':_0x74ea('0x3e')}]},_0x3f59ca={},_0x46f4f6={'count':0x0,'rows':[]};var _0x18176a=_['map'](db['SmsAccount'][_0x74ea('0x3f')],function(_0x194ec9){return{'name':_0x194ec9[_0x74ea('0x40')],'type':_0x194ec9[_0x74ea('0x41')][_0x74ea('0x42')]};});_0x3f59ca['model']=_[_0x74ea('0x43')](_0x18176a,'name');_0x3f59ca[_0x74ea('0x44')]=_[_0x74ea('0x45')](_0x44de7b[_0x74ea('0x44')]);_0x3f59ca[_0x74ea('0x46')]=_[_0x74ea('0x47')](_0x3f59ca[_0x74ea('0x48')],_0x3f59ca[_0x74ea('0x44')]);_0x575785['attributes']=_[_0x74ea('0x47')](_0x3f59ca[_0x74ea('0x48')],qs[_0x74ea('0x49')](_0x44de7b[_0x74ea('0x44')][_0x74ea('0x49')]));_0x575785[_0x74ea('0x4a')]=_0x575785[_0x74ea('0x4a')]['length']?_0x575785[_0x74ea('0x4a')]:_0x3f59ca[_0x74ea('0x48')];if(!_0x44de7b[_0x74ea('0x44')]['hasOwnProperty'](_0x74ea('0x4b'))){_0x575785[_0x74ea('0x4c')]=qs[_0x74ea('0x4c')](_0x44de7b[_0x74ea('0x44')][_0x74ea('0x4c')]);_0x575785[_0x74ea('0x2f')]=qs['offset'](_0x44de7b[_0x74ea('0x44')]['offset']);}_0x575785[_0x74ea('0x4d')]=qs[_0x74ea('0x4e')](_0x44de7b['query'][_0x74ea('0x4e')]);_0x575785[_0x74ea('0x4f')]=qs[_0x74ea('0x46')](_['pick'](_0x44de7b['query'],_0x3f59ca[_0x74ea('0x46')]));if(_0x44de7b['query']['filter']){_0x575785[_0x74ea('0x4f')]=_[_0x74ea('0x50')](_0x575785[_0x74ea('0x4f')],{'$or':_['map'](_0x18176a,function(_0x32ac69){if(_0x32ac69['type']!==_0x74ea('0x51')){var _0x2c22b4={};_0x2c22b4[_0x32ac69['name']]={'$like':'%'+_0x44de7b[_0x74ea('0x44')]['filter']+'%'};return _0x2c22b4;}})});}_0x575785=_[_0x74ea('0x50')]({},_0x575785,_0x44de7b[_0x74ea('0x52')]);var _0x25ec86={'where':_0x575785[_0x74ea('0x4f')]};return db[_0x74ea('0x53')][_0x74ea('0x2e')](_0x25ec86)[_0x74ea('0x34')](function(_0x52b9cf){_0x46f4f6[_0x74ea('0x2e')]=_0x52b9cf;if(_0x44de7b[_0x74ea('0x44')][_0x74ea('0x54')]){_0x575785[_0x74ea('0x55')]=[{'all':!![]}];}return db[_0x74ea('0x53')][_0x74ea('0x56')](_0x575785);})[_0x74ea('0x34')](function(_0x47e37c){_0x46f4f6[_0x74ea('0x57')]=_0x47e37c;return _0x46f4f6;})[_0x74ea('0x34')](respondWithFilteredResult(_0x47686d,_0x575785))[_0x74ea('0x58')](handleError(_0x47686d,null));};exports['show']=function(_0xe65e53,_0x5a4d9b){var _0x107c51={'raw':![],'where':{'id':_0xe65e53[_0x74ea('0x59')]['id']},'include':[{'model':db[_0x74ea('0x3d')],'as':_0x74ea('0x3e')}]},_0x2a780d={};_0x2a780d[_0x74ea('0x48')]=_[_0x74ea('0x45')](db[_0x74ea('0x53')][_0x74ea('0x3f')]);_0x2a780d[_0x74ea('0x44')]=_[_0x74ea('0x45')](_0xe65e53[_0x74ea('0x44')]);_0x2a780d[_0x74ea('0x46')]=_[_0x74ea('0x47')](_0x2a780d[_0x74ea('0x48')],_0x2a780d['query']);_0x107c51[_0x74ea('0x4a')]=_[_0x74ea('0x47')](_0x2a780d[_0x74ea('0x48')],qs['fields'](_0xe65e53['query'][_0x74ea('0x49')]));_0x107c51[_0x74ea('0x4a')]=_0x107c51[_0x74ea('0x4a')][_0x74ea('0x5a')]?_0x107c51[_0x74ea('0x4a')]:_0x2a780d[_0x74ea('0x48')];if(_0xe65e53[_0x74ea('0x44')][_0x74ea('0x54')]){_0x107c51[_0x74ea('0x55')]=[{'all':!![]}];}_0x107c51=_[_0x74ea('0x50')]({},_0x107c51,_0xe65e53['options']);return db[_0x74ea('0x53')][_0x74ea('0x5b')](_0x107c51)['then'](handleEntityNotFound(_0x5a4d9b,null))[_0x74ea('0x34')](respondWithResult(_0x5a4d9b,null))[_0x74ea('0x58')](handleError(_0x5a4d9b,null));};exports[_0x74ea('0x5c')]=function(_0x4b3548,_0x4eb18c){return db[_0x74ea('0x53')][_0x74ea('0x5c')](_0x4b3548['body'],{})[_0x74ea('0x34')](function(_0x14b3e0){var _0x4c2b71=_0x4b3548[_0x74ea('0x5d')]['get']({'plain':!![]});if(!_0x4c2b71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c2b71[_0x74ea('0x5e')]==='user'){var _0x23a088=_0x14b3e0[_0x74ea('0x36')]({'plain':!![]});var _0x1c5b03=_0x74ea('0x37');return db[_0x74ea('0x5f')][_0x74ea('0x5b')]({'where':{'name':_0x1c5b03,'userProfileId':_0x4c2b71[_0x74ea('0x60')]},'raw':!![]})[_0x74ea('0x34')](function(_0x3328f7){if(_0x3328f7&&_0x3328f7[_0x74ea('0x61')]===0x0){return db[_0x74ea('0x38')][_0x74ea('0x5c')]({'name':_0x23a088[_0x74ea('0x3a')],'resourceId':_0x23a088['id'],'type':_0x3328f7[_0x74ea('0x3a')],'sectionId':_0x3328f7['id']},{})[_0x74ea('0x34')](function(){return _0x14b3e0;});}else{return _0x14b3e0;}})[_0x74ea('0x58')](function(_0x5ba4cc){logger['error'](_0x74ea('0x62'),_0x5ba4cc);throw _0x5ba4cc;});}return _0x14b3e0;})[_0x74ea('0x34')](respondWithResult(_0x4eb18c,0xc9))[_0x74ea('0x58')](handleError(_0x4eb18c,null));};exports['update']=function(_0x21c28c,_0x3c2e72){if(_0x21c28c[_0x74ea('0x63')]['id']){delete _0x21c28c[_0x74ea('0x63')]['id'];}return db['SmsAccount'][_0x74ea('0x5b')]({'where':{'id':_0x21c28c[_0x74ea('0x59')]['id']},'include':[{'model':db[_0x74ea('0x3d')],'as':_0x74ea('0x3e')}]})[_0x74ea('0x34')](handleEntityNotFound(_0x3c2e72,null))[_0x74ea('0x34')](saveUpdates(_0x21c28c['body'],null))[_0x74ea('0x34')](respondWithResult(_0x3c2e72,null))[_0x74ea('0x58')](handleError(_0x3c2e72,null));};exports['destroy']=function(_0x2e5148,_0x227c97){return db[_0x74ea('0x53')]['find']({'where':{'id':_0x2e5148[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x227c97,null))[_0x74ea('0x34')](removeEntity(_0x227c97,null))[_0x74ea('0x58')](handleError(_0x227c97,null));};exports['describe']=function(_0x58083b,_0x5a278d){return db[_0x74ea('0x53')][_0x74ea('0x64')]()[_0x74ea('0x34')](respondWithResult(_0x5a278d,null))[_0x74ea('0x58')](handleError(_0x5a278d,null));};exports[_0x74ea('0x65')]=function(_0x4d31d3,_0xd45d55,_0x7c3e01){if(_0x4d31d3['body']['id']){delete _0x4d31d3[_0x74ea('0x63')]['id'];}return db[_0x74ea('0x53')][_0x74ea('0x5b')]({'where':{'id':_0x4d31d3[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0xd45d55,null))[_0x74ea('0x34')](function(_0x444e07){if(_0x444e07){_0x4d31d3['body'][_0x74ea('0x66')]=_0x444e07['id'];return db[_0x74ea('0x67')][_0x74ea('0x5c')](_0x4d31d3[_0x74ea('0x63')]);}})[_0x74ea('0x34')](respondWithResult(_0xd45d55,null))[_0x74ea('0x58')](handleError(_0xd45d55,null));};exports['getDispositions']=function(_0x1ec2bd,_0x8edad4,_0x501b6f){var _0x26a482={'raw':![],'where':{}};var _0xf85730={};var _0x1e6374={'count':0x0,'rows':[]};return db[_0x74ea('0x53')][_0x74ea('0x68')]({'where':{'id':_0x1ec2bd[_0x74ea('0x59')]['id']}})['then'](handleEntityNotFound(_0x8edad4,null))['then'](function(_0x2f506a){if(_0x2f506a){_0xf85730[_0x74ea('0x48')]=_['keys'](db[_0x74ea('0x67')][_0x74ea('0x3f')]);_0xf85730[_0x74ea('0x44')]=_['keys'](_0x1ec2bd[_0x74ea('0x44')]);_0xf85730[_0x74ea('0x46')]=_[_0x74ea('0x47')](_0xf85730[_0x74ea('0x48')],_0xf85730[_0x74ea('0x44')]);_0x26a482['attributes']=_['intersection'](_0xf85730['model'],qs[_0x74ea('0x49')](_0x1ec2bd[_0x74ea('0x44')][_0x74ea('0x49')]));_0x26a482[_0x74ea('0x4a')]=_0x26a482[_0x74ea('0x4a')]['length']?_0x26a482[_0x74ea('0x4a')]:_0xf85730[_0x74ea('0x48')];if(!_0x1ec2bd[_0x74ea('0x44')]['hasOwnProperty'](_0x74ea('0x4b'))){_0x26a482[_0x74ea('0x4c')]=qs[_0x74ea('0x4c')](_0x1ec2bd[_0x74ea('0x44')][_0x74ea('0x4c')]);_0x26a482[_0x74ea('0x2f')]=qs[_0x74ea('0x2f')](_0x1ec2bd[_0x74ea('0x44')][_0x74ea('0x2f')]);}_0x26a482[_0x74ea('0x4d')]=qs[_0x74ea('0x4e')](_0x1ec2bd[_0x74ea('0x44')][_0x74ea('0x4e')]);_0x26a482[_0x74ea('0x4f')]=qs[_0x74ea('0x46')](_[_0x74ea('0x69')](_0x1ec2bd['query'],_0xf85730[_0x74ea('0x46')]));_0x26a482[_0x74ea('0x4f')]['SmsAccountId']=_0x2f506a['id'];if(_0x1ec2bd[_0x74ea('0x44')]['filter']){_0x26a482[_0x74ea('0x4f')]=_['merge'](_0x26a482[_0x74ea('0x4f')],{'$or':_[_0x74ea('0x43')](_0x26a482['attributes'],function(_0x4188a8){var _0x10ab2e={};_0x10ab2e[_0x4188a8]={'$like':'%'+_0x1ec2bd[_0x74ea('0x44')][_0x74ea('0x6a')]+'%'};return _0x10ab2e;})});}_0x26a482=_[_0x74ea('0x50')]({},_0x26a482,_0x1ec2bd[_0x74ea('0x52')]);return db[_0x74ea('0x67')]['count']({'where':_0x26a482[_0x74ea('0x4f')]})[_0x74ea('0x34')](function(_0x4462c4){_0x1e6374[_0x74ea('0x2e')]=_0x4462c4;if(_0x1ec2bd[_0x74ea('0x44')][_0x74ea('0x54')]){_0x26a482['include']=[{'all':!![]}];}return db[_0x74ea('0x67')][_0x74ea('0x56')](_0x26a482);})[_0x74ea('0x34')](function(_0xd4220f){_0x1e6374['rows']=_0xd4220f;return _0x1e6374;});}})['then'](respondWithFilteredResult(_0x8edad4,_0x26a482))[_0x74ea('0x58')](handleError(_0x8edad4,null));};exports[_0x74ea('0x6b')]=function(_0x5573ac,_0x271db2,_0x49b82e){return db[_0x74ea('0x53')]['find']({'where':{'id':_0x5573ac['params']['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x271db2,null))[_0x74ea('0x34')](function(_0x645033){if(_0x645033){return _0x645033[_0x74ea('0x6b')](_0x5573ac[_0x74ea('0x44')][_0x74ea('0x6c')]);}})['then'](respondWithStatusCode(_0x271db2,null))[_0x74ea('0x58')](handleError(_0x271db2,null));};exports['addAnswer']=function(_0x2ab78f,_0x28407b,_0x5cc055){if(_0x2ab78f[_0x74ea('0x63')]['id']){delete _0x2ab78f[_0x74ea('0x63')]['id'];}return db[_0x74ea('0x53')][_0x74ea('0x5b')]({'where':{'id':_0x2ab78f[_0x74ea('0x59')]['id']}})['then'](handleEntityNotFound(_0x28407b,null))['then'](function(_0x4fb5ae){if(_0x4fb5ae){_0x2ab78f['body'][_0x74ea('0x66')]=_0x4fb5ae['id'];return db[_0x74ea('0x6d')][_0x74ea('0x5c')](_0x2ab78f[_0x74ea('0x63')]);}})[_0x74ea('0x34')](respondWithResult(_0x28407b,null))[_0x74ea('0x58')](handleError(_0x28407b,null));};exports['getAnswers']=function(_0x19b26e,_0x83fc23,_0x133682){var _0x4d7315={'raw':![],'where':{}};var _0x473710={};var _0x388c15={'count':0x0,'rows':[]};return db[_0x74ea('0x53')][_0x74ea('0x68')]({'where':{'id':_0x19b26e[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x83fc23,null))[_0x74ea('0x34')](function(_0x3bc880){if(_0x3bc880){_0x473710[_0x74ea('0x48')]=_[_0x74ea('0x45')](db[_0x74ea('0x6d')][_0x74ea('0x3f')]);_0x473710[_0x74ea('0x44')]=_['keys'](_0x19b26e[_0x74ea('0x44')]);_0x473710[_0x74ea('0x46')]=_['intersection'](_0x473710['model'],_0x473710[_0x74ea('0x44')]);_0x4d7315['attributes']=_[_0x74ea('0x47')](_0x473710[_0x74ea('0x48')],qs[_0x74ea('0x49')](_0x19b26e[_0x74ea('0x44')]['fields']));_0x4d7315[_0x74ea('0x4a')]=_0x4d7315[_0x74ea('0x4a')][_0x74ea('0x5a')]?_0x4d7315[_0x74ea('0x4a')]:_0x473710[_0x74ea('0x48')];if(!_0x19b26e['query'][_0x74ea('0x6e')](_0x74ea('0x4b'))){_0x4d7315[_0x74ea('0x4c')]=qs[_0x74ea('0x4c')](_0x19b26e[_0x74ea('0x44')][_0x74ea('0x4c')]);_0x4d7315[_0x74ea('0x2f')]=qs[_0x74ea('0x2f')](_0x19b26e[_0x74ea('0x44')][_0x74ea('0x2f')]);}_0x4d7315[_0x74ea('0x4d')]=qs[_0x74ea('0x4e')](_0x19b26e['query'][_0x74ea('0x4e')]);_0x4d7315[_0x74ea('0x4f')]=qs[_0x74ea('0x46')](_[_0x74ea('0x69')](_0x19b26e[_0x74ea('0x44')],_0x473710[_0x74ea('0x46')]));_0x4d7315[_0x74ea('0x4f')][_0x74ea('0x66')]=_0x3bc880['id'];if(_0x19b26e[_0x74ea('0x44')][_0x74ea('0x6a')]){_0x4d7315['where']=_[_0x74ea('0x50')](_0x4d7315['where'],{'$or':_[_0x74ea('0x43')](_0x4d7315['attributes'],function(_0x5b065e){var _0x3b91d0={};_0x3b91d0[_0x5b065e]={'$like':'%'+_0x19b26e[_0x74ea('0x44')][_0x74ea('0x6a')]+'%'};return _0x3b91d0;})});}_0x4d7315=_[_0x74ea('0x50')]({},_0x4d7315,_0x19b26e[_0x74ea('0x52')]);return db[_0x74ea('0x6d')][_0x74ea('0x2e')]({'where':_0x4d7315[_0x74ea('0x4f')]})['then'](function(_0x473337){_0x388c15['count']=_0x473337;if(_0x19b26e['query'][_0x74ea('0x54')]){_0x4d7315['include']=[{'all':!![]}];}return db[_0x74ea('0x6d')][_0x74ea('0x56')](_0x4d7315);})['then'](function(_0x53d12c){_0x388c15[_0x74ea('0x57')]=_0x53d12c;return _0x388c15;});}})[_0x74ea('0x34')](respondWithFilteredResult(_0x83fc23,_0x4d7315))[_0x74ea('0x58')](handleError(_0x83fc23,null));};exports[_0x74ea('0x6f')]=function(_0x4dc058,_0x8701d1,_0x53edde){return db[_0x74ea('0x53')][_0x74ea('0x5b')]({'where':{'id':_0x4dc058[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x8701d1,null))['then'](function(_0x521d54){if(_0x521d54){return _0x521d54['removeAnswers'](_0x4dc058[_0x74ea('0x44')][_0x74ea('0x6c')]);}})[_0x74ea('0x34')](respondWithStatusCode(_0x8701d1,null))[_0x74ea('0x58')](handleError(_0x8701d1,null));};exports[_0x74ea('0x70')]=function(_0x49712d,_0x57c320,_0x2b2481){var _0x1f3f36={'channel':_0x74ea('0x71')};var _0x251ed8=[];var _0xe87373=[];var _0xa35525={};return db[_0x74ea('0x53')][_0x74ea('0x5b')]({'where':{'id':_0x49712d[_0x74ea('0x59')]['id']},'include':[{'model':db[_0x74ea('0x72')],'as':_0x74ea('0x73')}]})['then'](handleEntityNotFound(_0x57c320,null))[_0x74ea('0x34')](function(_0x26c721){_0x1f3f36[_0x74ea('0x74')]=_0x26c721;_0x1f3f36[_0x74ea('0x75')]=_[_0x74ea('0x76')](_0x26c721[_0x74ea('0x73')],[_0x74ea('0x77')],[_0x74ea('0x78')]);if(_0x1f3f36[_0x74ea('0x74')][_0x74ea('0x73')]){delete _0x1f3f36['account'][_0x74ea('0x73')];}return db[_0x74ea('0x79')]['describe']();})['then'](function(_0x17d959){if(!_0x17d959){throw new db['Sequelize']['ValidationError'](_0x74ea('0x7a'));}_0x251ed8=_[_0x74ea('0x7b')](_[_0x74ea('0x45')](_0x17d959),[_0x74ea('0x7c'),_0x74ea('0x7d')]);_0xe87373=_[_0x74ea('0x7b')](_['keys'](_0x17d959),[_0x74ea('0x7c'),_0x74ea('0x7d'),_0x74ea('0x7e'),_0x74ea('0x7f')]);_0x1f3f36['body']={'mapKey':'mobile'};if(_0x1f3f36[_0x74ea('0x74')][_0x74ea('0x41')]){switch(_0x1f3f36['account'][_0x74ea('0x41')]){case _0x74ea('0x80'):_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x82')];_0x1f3f36[_0x74ea('0x63')]['body']=_0x49712d['body'][_0x74ea('0x83')];_0x1f3f36['body'][_0x74ea('0x84')]=_0x49712d['body'][_0x74ea('0x85')];break;case _0x74ea('0x86'):_0x1f3f36[_0x74ea('0x63')]['from']='+'+_0x49712d[_0x74ea('0x63')][_0x74ea('0x87')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')]=_0x49712d['body'][_0x74ea('0x88')];break;case'connectel':_0x1f3f36[_0x74ea('0x63')]['from']=_0x49712d['body'][_0x74ea('0x81')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x29')];break;case _0x74ea('0x89'):_0x1f3f36[_0x74ea('0x63')]['from']=_0x49712d[_0x74ea('0x63')][_0x74ea('0x81')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')]=_0x49712d[_0x74ea('0x63')]['body'];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x84')]=_0x49712d['body']['message_id'];break;case _0x74ea('0x8a'):_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x82')];_0x1f3f36[_0x74ea('0x63')]['body']=_0x49712d['body']['Text'];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x84')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x8b')];break;case _0x74ea('0x8c'):_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')]='+'+_0x49712d[_0x74ea('0x63')][_0x74ea('0x8d')][0x0]['from'];_0x1f3f36[_0x74ea('0x63')]['body']=_0x49712d['body']['results'][0x0][_0x74ea('0x88')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x84')]=_0x49712d[_0x74ea('0x63')]['results'][0x0][_0x74ea('0x84')];break;case'csc':_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x8e')];_0x1f3f36[_0x74ea('0x63')]['body']=_0x49712d[_0x74ea('0x63')]['segmentedMessage'][_0x74ea('0x29')];break;case _0x74ea('0x8f'):_0x1f3f36[_0x74ea('0x63')]['from']=_0x49712d[_0x74ea('0x63')][_0x74ea('0x90')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x88')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x84')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x91')];break;case _0x74ea('0x92'):_0x1f3f36['body'][_0x74ea('0x81')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x81')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x29')];_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x84')]=_0x49712d[_0x74ea('0x63')][_0x74ea('0x93')];break;}}if(_0x1f3f36[_0x74ea('0x63')]['id']){delete _0x1f3f36[_0x74ea('0x63')]['id'];}if(_[_0x74ea('0x94')](_0x1f3f36[_0x74ea('0x63')]['from'])){throw new db[(_0x74ea('0x1e'))][(_0x74ea('0x1f'))](_0x74ea('0x95'));}if(_[_0x74ea('0x94')](_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')])||_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')]===''){throw new db[(_0x74ea('0x1e'))]['ValidationError'](_0x74ea('0x96'));}if(_[_0x74ea('0x94')](_0x1f3f36['body'][_0x74ea('0x97')])){throw new db['Sequelize']['ValidationError'](_0x74ea('0x98')+_0xe87373);}if(!_[_0x74ea('0x99')](_0xe87373,_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x97')])){throw new db['Sequelize']['ValidationError'](_0x74ea('0x9a')+_0xe87373);}_0xa35525[_0x1f3f36[_0x74ea('0x63')]['mapKey']]=_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')];return db[_0x74ea('0x9b')][_0x74ea('0x5b')]({'where':{'id':_0x1f3f36[_0x74ea('0x74')][_0x74ea('0x7f')]},'include':[{'model':db[_0x74ea('0x79')],'as':_0x74ea('0x9c'),'where':_0xa35525,'limit':0x1,'order':[['updatedAt',_0x74ea('0x9d')]]}]});})['then'](handleEntityNotFound(_0x57c320,null))[_0x74ea('0x34')](function(_0x118784){if(_0x118784){_0x1f3f36[_0x74ea('0x9e')]=_[_0x74ea('0x9f')](_0x118784,[_0x74ea('0x9c')]);if(_0x118784['Contacts'][_0x74ea('0x5a')]){return _0x118784[_0x74ea('0x9c')][0x0];}var _0x208f82=_[_0x74ea('0xa0')](_0x1f3f36['body'],{'firstName':_0x1f3f36['body'][_0x74ea('0x81')],'ListId':_0x118784['id']});_0x208f82[_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x97')]]=_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')];return db[_0x74ea('0x79')][_0x74ea('0x5c')](_0x208f82,{'fields':_0x251ed8,'raw':!![]});}})[_0x74ea('0x34')](handleEntityNotFound(_0x57c320,null))['then'](function(_0x331285){if(_0x331285){_0x1f3f36[_0x74ea('0xa1')]=_0x331285;var _0x2c00be={'ContactId':_0x331285['id'],'phone':_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x81')],'SmsAccountId':_0x49712d['params']['id']};var _0x25eb52={'ContactId':_0x331285['id'],'SmsAccountId':_0x49712d[_0x74ea('0x59')]['id'],'closed':![]};return db[_0x74ea('0xa2')][_0x74ea('0x5b')]({'where':_0x25eb52})[_0x74ea('0x34')](function(_0x5d2bbb){if(_0x5d2bbb){return[_0x5d2bbb,![]];}return db[_0x74ea('0xa2')]['create'](_0x2c00be)[_0x74ea('0x34')](function(_0x5cdbea){return[_0x5cdbea,!![]];});});}})[_0x74ea('0xa3')](function(_0x4cbf8b,_0x18c874){_0x1f3f36[_0x74ea('0xa4')]=_0x4cbf8b['get']({'plain':!![]});_0x1f3f36[_0x74ea('0xa4')][_0x74ea('0xa5')]=![];if(_0x18c874){if(_0x1f3f36[_0x74ea('0x74')][_0x74ea('0xa6')]){_0x1f3f36['applications'][_0x74ea('0xa7')]({'id':0x0,'priority':_0x1f3f36[_0x74ea('0x75')]['length']+0x1,'app':_0x74ea('0xa8'),'appdata':_0x74ea('0xa9'),'interval':'*,*,*,*'});}_0x1f3f36[_0x74ea('0xa4')][_0x74ea('0xa5')]=!![];}return db[_0x74ea('0xaa')][_0x74ea('0x5c')]({'phone':_0x1f3f36[_0x74ea('0x63')]['from'],'messageId':_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x84')],'body':_0x1f3f36[_0x74ea('0x63')][_0x74ea('0x63')],'SmsAccountId':_0x49712d['params']['id'],'SmsInteractionId':_0x4cbf8b['id'],'direction':'in','ContactId':_0x4cbf8b['ContactId'],'AttachmentId':_0x1f3f36[_0x74ea('0x63')][_0x74ea('0xab')]});})[_0x74ea('0x34')](function(_0x4004bb){_0x1f3f36['message']=_0x4004bb;if(_0x1f3f36[_0x74ea('0xa4')][_0x74ea('0xac')]){return db[_0x74ea('0xad')][_0x74ea('0x5b')]({'attributes':['id',_0x74ea('0x3a')],'where':{'id':_0x1f3f36[_0x74ea('0xa4')]['UserId']}})[_0x74ea('0x34')](function(_0x166090){if(_0x166090){_0x1f3f36[_0x74ea('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x166090['name']+','+(_0x1f3f36[_0x74ea('0x74')][_0x74ea('0xae')]||0xa),'interval':_0x74ea('0xaf')});}return respondWithRpcPromise(_0x74ea('0xb0'),_0x74ea('0xb1'),_0x1f3f36);});}return respondWithRpcPromise(_0x74ea('0xb0'),_0x74ea('0xb1'),_0x1f3f36);})[_0x74ea('0x34')](function(_0x4203fc){if(_0x4203fc){var _0x5629a4=0xc8;var _0x11c0d4='receiveMessage';logger[_0x74ea('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x11c0d4,_0x5629a4,_0x74ea('0xb2'));logger['debug'](_0x74ea('0xb3'),_0x11c0d4,_0x5629a4,'entity\x20found',JSON[_0x74ea('0x27')](_0x4203fc));if(_0x1f3f36[_0x74ea('0x74')]['type']===_0x74ea('0x80')){return _0x57c320[_0x74ea('0x2c')](_0x5629a4)[_0x74ea('0x30')](_0x74ea('0xb4'),'text/xml')[_0x74ea('0x3b')](_0x74ea('0xb5'));}else{return _0x57c320['status'](_0x5629a4)[_0x74ea('0x2d')](_0x4203fc);}}})[_0x74ea('0x58')](handleError(_0x57c320,null));};exports[_0x74ea('0xb6')]=function(_0x4b4d34,_0x5ba522,_0x2ef8ce){return db[_0x74ea('0x53')][_0x74ea('0x68')]({'where':{'id':_0x4b4d34[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x5ba522,null))[_0x74ea('0x34')](function(_0x24f362){if(_0x24f362){return db[_0x74ea('0xb7')][_0x74ea('0xb8')](function(_0x2c4950){return db[_0x74ea('0x72')][_0x74ea('0x35')]({'where':{'SmsAccountId':_0x4b4d34[_0x74ea('0x59')]['id']},'transaction':_0x2c4950})[_0x74ea('0x34')](function(_0x592007){var _0x2d237e=_[_0x74ea('0x43')](_0x4b4d34[_0x74ea('0x63')],function(_0xb537bf){_0xb537bf[_0x74ea('0x66')]=_0x4b4d34[_0x74ea('0x59')]['id'];return _0xb537bf;});return db['SmsApplication'][_0x74ea('0xb9')](_0x2d237e,{'transaction':_0x2c4950});});})[_0x74ea('0x34')](function(){return db[_0x74ea('0x72')][_0x74ea('0xba')]({'where':{'SmsAccountId':_0x4b4d34[_0x74ea('0x59')]['id']},'order':_0x74ea('0x77')});});}})[_0x74ea('0x34')](respondWithResult(_0x5ba522,null))[_0x74ea('0x58')](handleError(_0x5ba522,null));};exports[_0x74ea('0xbb')]=function(_0x29f137,_0x27c7eb,_0x5e7988){var _0x4f517d={};var _0x2d062d={};var _0x3b4ab5;var _0x3a03d8;return db[_0x74ea('0x53')][_0x74ea('0x68')]({'where':{'id':_0x29f137[_0x74ea('0x59')]['id']}})['then'](handleEntityNotFound(_0x27c7eb,null))[_0x74ea('0x34')](function(_0x4bb288){if(_0x4bb288){_0x3b4ab5=_0x4bb288;_0x2d062d['model']=_[_0x74ea('0x45')](db[_0x74ea('0x72')][_0x74ea('0x3f')]);_0x2d062d[_0x74ea('0x44')]=_[_0x74ea('0x45')](_0x29f137['query']);_0x2d062d[_0x74ea('0x46')]=_['intersection'](_0x2d062d[_0x74ea('0x48')],_0x2d062d[_0x74ea('0x44')]);_0x4f517d[_0x74ea('0x4a')]=_[_0x74ea('0x47')](_0x2d062d['model'],qs[_0x74ea('0x49')](_0x29f137[_0x74ea('0x44')][_0x74ea('0x49')]));_0x4f517d[_0x74ea('0x4a')]=_0x4f517d['attributes'][_0x74ea('0x5a')]?_0x4f517d[_0x74ea('0x4a')]:_0x2d062d[_0x74ea('0x48')];_0x4f517d[_0x74ea('0x4d')]=qs[_0x74ea('0x4e')](_0x29f137['query'][_0x74ea('0x4e')]);_0x4f517d[_0x74ea('0x4f')]=qs[_0x74ea('0x46')](_[_0x74ea('0x69')](_0x29f137[_0x74ea('0x44')],_0x2d062d[_0x74ea('0x46')]));if(_0x29f137[_0x74ea('0x44')][_0x74ea('0x6a')]){_0x4f517d[_0x74ea('0x4f')]=_[_0x74ea('0x50')](_0x4f517d[_0x74ea('0x4f')],{'$or':_['map'](_0x4f517d[_0x74ea('0x4a')],function(_0x2428e5){var _0x2ec145={};_0x2ec145[_0x2428e5]={'$like':'%'+_0x29f137['query'][_0x74ea('0x6a')]+'%'};return _0x2ec145;})});}_0x4f517d=_['merge']({},_0x4f517d,_0x29f137[_0x74ea('0x52')]);return _0x3b4ab5['getApplications'](_0x4f517d);}})['then'](function(_0x3ec0c8){if(_0x3ec0c8){_0x3a03d8=_0x3ec0c8['length'];if(!_0x29f137['query'][_0x74ea('0x6e')]('nolimit')){_0x4f517d[_0x74ea('0x4c')]=qs[_0x74ea('0x4c')](_0x29f137[_0x74ea('0x44')][_0x74ea('0x4c')]);_0x4f517d['offset']=qs['offset'](_0x29f137['query'][_0x74ea('0x2f')]);}return _0x3b4ab5['getApplications'](_0x4f517d);}})[_0x74ea('0x34')](function(_0x311923){if(_0x311923){return _0x311923?{'count':_0x3a03d8,'rows':_0x311923}:null;}})[_0x74ea('0x34')](respondWithResult(_0x27c7eb,null))['catch'](handleError(_0x27c7eb,null));};exports[_0x74ea('0xbc')]=function(_0x528074,_0x4b4905,_0x35c8f3){var _0x444c96={'raw':![],'where':{}};var _0x1c6f4c={};var _0x38e65e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x74ea('0x68')]({'where':{'id':_0x528074['params']['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x4b4905,null))[_0x74ea('0x34')](function(_0x32e36a){if(_0x32e36a){_0x1c6f4c[_0x74ea('0x48')]=_[_0x74ea('0x45')](db[_0x74ea('0xa2')]['rawAttributes']);_0x1c6f4c[_0x74ea('0x44')]=_[_0x74ea('0x45')](_0x528074[_0x74ea('0x44')]);_0x1c6f4c[_0x74ea('0x46')]=_[_0x74ea('0x47')](_0x1c6f4c[_0x74ea('0x48')],_0x1c6f4c[_0x74ea('0x44')]);_0x444c96[_0x74ea('0x4a')]=_[_0x74ea('0x47')](_0x1c6f4c['model'],qs['fields'](_0x528074[_0x74ea('0x44')][_0x74ea('0x49')]));_0x444c96[_0x74ea('0x4a')]=_0x444c96['attributes']['length']?_0x444c96[_0x74ea('0x4a')]:_0x1c6f4c[_0x74ea('0x48')];if(!_0x528074[_0x74ea('0x44')]['hasOwnProperty'](_0x74ea('0x4b'))){_0x444c96[_0x74ea('0x4c')]=qs[_0x74ea('0x4c')](_0x528074[_0x74ea('0x44')][_0x74ea('0x4c')]);_0x444c96[_0x74ea('0x2f')]=qs[_0x74ea('0x2f')](_0x528074['query']['offset']);}_0x444c96[_0x74ea('0x4d')]=qs['sort'](_0x528074[_0x74ea('0x44')]['sort']);_0x444c96[_0x74ea('0x4f')]=qs[_0x74ea('0x46')](_[_0x74ea('0x69')](_0x528074[_0x74ea('0x44')],_0x1c6f4c[_0x74ea('0x46')]));_0x444c96[_0x74ea('0x4f')]['SmsAccountId']=_0x32e36a['id'];if(_0x528074['query']['filter']){_0x444c96[_0x74ea('0x4f')]=_[_0x74ea('0x50')](_0x444c96['where'],{'$or':_[_0x74ea('0x43')](_0x444c96[_0x74ea('0x4a')],function(_0x25f78a){var _0x82284a={};_0x82284a[_0x25f78a]={'$like':'%'+_0x528074[_0x74ea('0x44')][_0x74ea('0x6a')]+'%'};return _0x82284a;})});}_0x444c96=_[_0x74ea('0x50')]({},_0x444c96,_0x528074[_0x74ea('0x52')]);return db[_0x74ea('0xa2')][_0x74ea('0x2e')]({'where':_0x444c96['where']})[_0x74ea('0x34')](function(_0x25dac7){_0x38e65e[_0x74ea('0x2e')]=_0x25dac7;if(_0x528074[_0x74ea('0x44')][_0x74ea('0x54')]){_0x444c96[_0x74ea('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x74ea('0xad')],'as':_0x74ea('0xbd'),'attributes':['name',_0x74ea('0xbe'),'internal'],'required':![]},{'model':db[_0x74ea('0xbf')],'as':_0x74ea('0xc0'),'attributes':['id',_0x74ea('0x3a'),_0x74ea('0xc1')],'where':_0x528074[_0x74ea('0x44')][_0x74ea('0xc2')]?{'id':_0x528074[_0x74ea('0x44')][_0x74ea('0xc2')]}:undefined,'required':_0x528074[_0x74ea('0x44')][_0x74ea('0xc2')]?!![]:![]}];}return db[_0x74ea('0xa2')]['findAll'](_0x444c96);})['then'](function(_0x30b7b8){_0x38e65e['rows']=_0x30b7b8;return _0x38e65e;});}})[_0x74ea('0x34')](respondWithFilteredResult(_0x4b4905,_0x444c96))[_0x74ea('0x58')](handleError(_0x4b4905,null));};exports[_0x74ea('0x3b')]=function(_0x560873,_0x380d04,_0x423e7b){var _0x3abb00,_0xba3a7f,_0x187496;if(_[_0x74ea('0x94')](_0x560873[_0x74ea('0x63')][_0x74ea('0x63')])||_0x560873['body'][_0x74ea('0x63')]===''){throw new db[(_0x74ea('0x1e'))][(_0x74ea('0x1f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x74ea('0x94')](_0x560873[_0x74ea('0x63')]['to'])){throw new db[(_0x74ea('0x1e'))]['ValidationError'](_0x74ea('0xc3'));}_0x3abb00=_0x560873[_0x74ea('0x63')]['to'];return db[_0x74ea('0x53')][_0x74ea('0x5b')]({'where':{'id':_0x560873[_0x74ea('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x74ea('0x9c'),'where':{'mobile':_0x3abb00},'limit':0x1,'order':[[_0x74ea('0x7d'),_0x74ea('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x380d04,null))[_0x74ea('0x34')](function(_0x4431c8){if(_0x4431c8&&_0x4431c8[_0x74ea('0xc4')]){_0xba3a7f=_0x4431c8[_0x74ea('0x36')]({'plain':!![]});if(_0xba3a7f['List']&&_0xba3a7f['List'][_0x74ea('0x9c')]['length']){return _0xba3a7f[_0x74ea('0xc4')][_0x74ea('0x9c')][0x0];}return db[_0x74ea('0x79')][_0x74ea('0x5c')](_[_0x74ea('0xa0')](_0x560873[_0x74ea('0x63')],{'firstName':_0x3abb00,'mobile':_0x3abb00,'phone':_0x3abb00,'ListId':_0xba3a7f[_0x74ea('0x7f')]}));}})[_0x74ea('0x34')](handleEntityNotFound(_0x380d04,null))[_0x74ea('0x34')](function(_0x46bb4e){if(_0x46bb4e){_0x187496=_0x46bb4e;return db[_0x74ea('0xa2')][_0x74ea('0x5b')]({'where':{'ContactId':_0x187496['id'],'closed':![],'SmsAccountId':_0xba3a7f['id']}})['then'](function(_0x3080c5){if(_0x3080c5){return[_0x3080c5,![]];}return db[_0x74ea('0xa2')]['create']({'UserId':_0x560873[_0x74ea('0x5d')]['id'],'ContactId':_0x187496['id'],'SmsAccountId':_0xba3a7f['id'],'phone':_0x3abb00,'firstMsgDirection':_0x74ea('0xc5'),'Messages':[_['merge'](_0x560873[_0x74ea('0x63')],{'read':![],'body':_0x560873[_0x74ea('0x63')][_0x74ea('0x63')],'phone':_0x3abb00,'SmsAccountId':_0xba3a7f['id'],'UserId':_0x560873['user']['id'],'ContactId':_0x187496['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x74ea('0xc6')}]})[_0x74ea('0x34')](function(_0x26a0a7){return[_0x26a0a7,!![]];});});}})[_0x74ea('0xa3')](function(_0x25b027,_0x217be6){if(_0x217be6){return _0x25b027;}return db['SmsMessage']['create'](_[_0x74ea('0x50')](_0x560873[_0x74ea('0x63')],{'read':![],'body':_0x560873['body'][_0x74ea('0x63')],'phone':_0x3abb00,'SmsAccountId':_0xba3a7f['id'],'SmsInteractionId':_0x25b027['id'],'UserId':_0x560873['user']['id'],'ContactId':_0x187496['id']}))['then'](function(_0x376fef){_0x25b027[_0x74ea('0xc7')]['Messages']=[];_0x25b027[_0x74ea('0xc7')]['Messages'][_0x74ea('0xa7')](_0x376fef[_0x74ea('0xc7')]);return _0x25b027;});})[_0x74ea('0x34')](respondWithResult(_0x380d04,null))[_0x74ea('0x58')](handleError(_0x380d04,null));};exports[_0x74ea('0x2c')]=function(_0xa2608a,_0x2a6aec,_0x2a0dda){if(_0xa2608a[_0x74ea('0x63')]['id']){delete _0xa2608a[_0x74ea('0x63')]['id'];}console[_0x74ea('0xc8')]('endpoint\x20/status\x20POST\x20/',_0xa2608a[_0x74ea('0x63')]);var _0x247b85,_0x255dd8,_0x4e9c5a;return db[_0x74ea('0x53')]['find']({'where':{'id':_0xa2608a[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x2a6aec,null))['then'](function(_0x29b088){if(_0x29b088){_0x4e9c5a=_0x29b088;logger[_0x74ea('0x25')](_0x74ea('0x26'),'status','received\x20delivery\x20report\x20from',_0x29b088[_0x74ea('0x41')],util[_0x74ea('0xc9')](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));switch(_0x29b088[_0x74ea('0x41')]){case _0x74ea('0x86'):if(_0xa2608a[_0x74ea('0x63')][_0x74ea('0xca')]&&_0xa2608a[_0x74ea('0x63')]['status']){_0x255dd8=_0xa2608a[_0x74ea('0x63')][_0x74ea('0x2c')];return db['SmsMessage'][_0x74ea('0x5b')]({'where':{'messageId':_0xa2608a['body'][_0x74ea('0xca')]}});}break;case _0x74ea('0xcb'):if(_0xa2608a[_0x74ea('0x63')][_0x74ea('0xcc')]&&_0xa2608a[_0x74ea('0x63')]['statusInt']){_0x255dd8=_0xa2608a['body']['statusInt'];return db[_0x74ea('0xaa')][_0x74ea('0x5b')]({'where':{'messageId':_0xa2608a['body'][_0x74ea('0xcc')]}});}break;case _0x74ea('0x89'):if(_0xa2608a[_0x74ea('0x63')][_0x74ea('0xcd')]&&_0xa2608a['body']['status_code']){_0x255dd8=_0xa2608a[_0x74ea('0x63')][_0x74ea('0xce')];return db['SmsMessage']['find']({'where':{'messageId':_0xa2608a[_0x74ea('0x63')][_0x74ea('0xcd')]}});}break;case _0x74ea('0x8c'):var _0x42456d=_0xa2608a[_0x74ea('0x63')][_0x74ea('0x8d')][0x0];if(_0x42456d[_0x74ea('0x84')]&&_0x42456d[_0x74ea('0x2c')][_0x74ea('0xcf')]===_0x74ea('0xd0')){_0x255dd8=_0x42456d[_0x74ea('0x2c')][_0x74ea('0xcf')];return db[_0x74ea('0xaa')]['find']({'where':{'messageId':_0x42456d[_0x74ea('0x84')]}});}break;case _0x74ea('0x8f'):if(_0xa2608a[_0x74ea('0x63')][_0x74ea('0x84')]&&_0xa2608a['body'][_0x74ea('0x2c')]){_0x255dd8=_0xa2608a[_0x74ea('0x63')][_0x74ea('0x2c')];return db['SmsMessage'][_0x74ea('0x5b')]({'where':{'messageId':_0xa2608a['body'][_0x74ea('0x84')]}});}break;case _0x74ea('0x92'):if(_0xa2608a[_0x74ea('0x63')][_0x74ea('0xd1')]&&_0xa2608a[_0x74ea('0x63')][_0x74ea('0x2c')]){_0x255dd8=_0xa2608a['body'][_0x74ea('0x2c')];return db[_0x74ea('0xaa')]['find']({'where':{'messageId':_0xa2608a[_0x74ea('0x63')][_0x74ea('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x2a6aec,null))[_0x74ea('0x34')](function(_0x337023){if(_0x337023){_0x247b85=_0x337023;switch(_0x4e9c5a['type']){case _0x74ea('0x86'):if(_0x255dd8===_0x74ea('0xd0')){return _0x247b85['update']({'read':!![]});}else{logger[_0x74ea('0x28')](_0x74ea('0x26'),_0x74ea('0x2c'),'skebby',util[_0x74ea('0xc9')](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x255dd8==='1'){return _0x247b85[_0x74ea('0x33')]({'read':!![]});}else{logger[_0x74ea('0x28')](_0x74ea('0x26'),_0x74ea('0x2c'),'skebby',util['inspect'](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));}break;case _0x74ea('0x89'):if(!_0xa2608a[_0x74ea('0x63')][_0x74ea('0xd2')]&&_0x255dd8>=0xc8&&_0x255dd8<=0xce){return _0x247b85['update']({'read':!![]});}else{logger['error'](_0x74ea('0x26'),_0x74ea('0x2c'),_0x74ea('0x89'),util[_0x74ea('0xc9')](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));}break;case _0x74ea('0x8c'):var _0x3d0598=_0xa2608a[_0x74ea('0x63')][_0x74ea('0x8d')][0x0];if(_0x3d0598[_0x74ea('0x2c')][_0x74ea('0xcf')]===_0x74ea('0xd0')){return _0x247b85['update']({'read':!![]});}else{logger[_0x74ea('0x28')](_0x74ea('0x26'),_0x74ea('0x2c'),_0x74ea('0x8c'),util[_0x74ea('0xc9')](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x255dd8==_0x74ea('0xd3')||_0x255dd8==_0x74ea('0xd4')){return _0x247b85['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x74ea('0x2c'),'clickatell',util['inspect'](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));}break;case _0x74ea('0x92'):if(_0x255dd8==='DELIVRD'||_0x255dd8==='ACCEPTD'){return _0x247b85[_0x74ea('0x33')]({'read':!![]});}else{logger[_0x74ea('0x28')](_0x74ea('0x26'),_0x74ea('0x2c'),_0x74ea('0x92'),util['inspect'](_0xa2608a[_0x74ea('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x247b85;}})[_0x74ea('0x34')](respondWithResult(_0x2a6aec,null))[_0x74ea('0x58')](handleError(_0x2a6aec,null));};exports['statusGet']=function(_0x3fb12c,_0x9755ee,_0x4ddbda){var _0x237ef8,_0x4136d6,_0x548c89;return db[_0x74ea('0x53')][_0x74ea('0x5b')]({'where':{'id':_0x3fb12c[_0x74ea('0x59')]['id']}})['then'](handleEntityNotFound(_0x9755ee,null))[_0x74ea('0x34')](function(_0x496e05){if(_0x496e05){_0x548c89=_0x496e05;logger[_0x74ea('0x25')](_0x74ea('0x26'),_0x74ea('0x2c'),_0x74ea('0xd5'),_0x496e05['type'],util['inspect'](_0x3fb12c[_0x74ea('0x44')],{'showHidden':![],'depth':null}));switch(_0x496e05['type']){case'csc':if(_0x3fb12c['query'][_0x74ea('0xd6')]&&_0x3fb12c[_0x74ea('0x44')][_0x74ea('0xd7')]){_0x4136d6=_0x3fb12c[_0x74ea('0x44')][_0x74ea('0xd7')];return db[_0x74ea('0xaa')][_0x74ea('0x5b')]({'where':{'messageId':_0x3fb12c[_0x74ea('0x44')][_0x74ea('0xd6')]}});}break;}}})[_0x74ea('0x34')](handleEntityNotFound(_0x9755ee,null))[_0x74ea('0x34')](function(_0x324f1a){if(_0x324f1a){_0x237ef8=_0x324f1a;switch(_0x548c89['type']){case _0x74ea('0xd8'):if(_0x4136d6==='2'||_0x4136d6==='6'){return _0x237ef8[_0x74ea('0x33')]({'read':!![]});}else{logger[_0x74ea('0x28')](_0x74ea('0x26'),'status',_0x74ea('0xd8'),util[_0x74ea('0xc9')](_0x3fb12c[_0x74ea('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x237ef8;}})[_0x74ea('0x34')](respondWithResult(_0x9755ee,null))[_0x74ea('0x58')](handleError(_0x9755ee,null));};exports[_0x74ea('0xd9')]=function(_0x38251a,_0xf462c,_0x1f2dec){return db[_0x74ea('0x53')]['find']({'where':{'id':_0x38251a['params']['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0xf462c,null))[_0x74ea('0x34')](function(_0x1ed825){if(_0x1ed825){return _0x1ed825[_0x74ea('0xd9')](_0x38251a[_0x74ea('0x63')][_0x74ea('0x6c')],_[_0x74ea('0x9f')](_0x38251a[_0x74ea('0x63')],[_0x74ea('0x6c'),'id'])||{})[_0x74ea('0xa3')](function(_0x553ee5){for(var _0xeeaf29=0x0;_0xeeaf29<_0x38251a[_0x74ea('0x63')][_0x74ea('0x6c')]['length'];_0xeeaf29+=0x1){socket[_0x74ea('0xda')]('userSmsAccount:save',{'UserId':_0x38251a['body'][_0x74ea('0x6c')][_0xeeaf29],'SmsAccountId':_0x38251a[_0x74ea('0x59')]['id']});}return _0x553ee5;});}})[_0x74ea('0x34')](respondWithResult(_0xf462c,null))['catch'](handleError(_0xf462c,null));};exports[_0x74ea('0xdb')]=function(_0x57a2d1,_0x17555e,_0x3a7674){return db[_0x74ea('0x53')]['find']({'where':{'id':_0x57a2d1[_0x74ea('0x59')]['id']}})['then'](handleEntityNotFound(_0x17555e,null))[_0x74ea('0x34')](function(_0x459680){if(_0x459680){return _0x459680['removeAgents'](_0x57a2d1[_0x74ea('0x44')][_0x74ea('0x6c')])[_0x74ea('0x34')](function(){if(_[_0x74ea('0xdc')](_0x57a2d1[_0x74ea('0x44')][_0x74ea('0x6c')])){for(var _0x4e862b=0x0;_0x4e862b<_0x57a2d1[_0x74ea('0x44')][_0x74ea('0x6c')]['length'];_0x4e862b+=0x1){socket[_0x74ea('0xda')](_0x74ea('0xdd'),{'UserId':Number(_0x57a2d1[_0x74ea('0x44')]['ids'][_0x4e862b]),'SmsAccountId':Number(_0x57a2d1[_0x74ea('0x59')]['id'])});}}else{socket['emit'](_0x74ea('0xdd'),{'UserId':Number(_0x57a2d1[_0x74ea('0x44')][_0x74ea('0x6c')]),'SmsAccountId':Number(_0x57a2d1[_0x74ea('0x59')]['id'])});}});}})[_0x74ea('0x34')](respondWithStatusCode(_0x17555e,null))[_0x74ea('0x58')](handleError(_0x17555e,null));};exports[_0x74ea('0xde')]=function(_0x15d5f3,_0x237f8f,_0x2e57e1){var _0x49aeec={};var _0x1c8501={};var _0x36f766;var _0x248f74;return db[_0x74ea('0x53')][_0x74ea('0x68')]({'where':{'id':_0x15d5f3[_0x74ea('0x59')]['id']}})[_0x74ea('0x34')](handleEntityNotFound(_0x237f8f,null))[_0x74ea('0x34')](function(_0x59d234){if(_0x59d234){_0x36f766=_0x59d234;_0x1c8501[_0x74ea('0x48')]=_[_0x74ea('0x45')](db[_0x74ea('0xad')]['rawAttributes']);_0x1c8501['query']=_[_0x74ea('0x45')](_0x15d5f3['query']);_0x1c8501['filters']=_['intersection'](_0x1c8501['model'],_0x1c8501['query']);_0x49aeec['attributes']=_[_0x74ea('0x47')](_0x1c8501[_0x74ea('0x48')],qs[_0x74ea('0x49')](_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x49')]));_0x49aeec[_0x74ea('0x4a')]=_0x49aeec['attributes'][_0x74ea('0x5a')]?_0x49aeec[_0x74ea('0x4a')]:_0x1c8501[_0x74ea('0x48')];_0x49aeec[_0x74ea('0x4d')]=qs[_0x74ea('0x4e')](_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x4e')]);_0x49aeec[_0x74ea('0x4f')]=qs[_0x74ea('0x46')](_[_0x74ea('0x69')](_0x15d5f3[_0x74ea('0x44')],_0x1c8501['filters']));if(_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x6a')]){_0x49aeec['where']=_['merge'](_0x49aeec[_0x74ea('0x4f')],{'$or':_[_0x74ea('0x43')](_0x49aeec[_0x74ea('0x4a')],function(_0x500916){var _0x1a6d09={};_0x1a6d09[_0x500916]={'$like':'%'+_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x6a')]+'%'};return _0x1a6d09;})});}_0x49aeec=_['merge']({},_0x49aeec,_0x15d5f3[_0x74ea('0x52')]);return _0x36f766[_0x74ea('0xde')](_0x49aeec);}})[_0x74ea('0x34')](function(_0x17bd54){if(_0x17bd54){_0x248f74=_0x17bd54['length'];if(!_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x6e')](_0x74ea('0x4b'))){_0x49aeec[_0x74ea('0x4c')]=qs[_0x74ea('0x4c')](_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x4c')]);_0x49aeec[_0x74ea('0x2f')]=qs[_0x74ea('0x2f')](_0x15d5f3[_0x74ea('0x44')][_0x74ea('0x2f')]);}return _0x36f766['getAgents'](_0x49aeec);}})[_0x74ea('0x34')](function(_0x1809ab){if(_0x1809ab){return _0x1809ab?{'count':_0x248f74,'rows':_0x1809ab}:null;}})[_0x74ea('0x34')](respondWithResult(_0x237f8f,null))['catch'](handleError(_0x237f8f,null));}; \ No newline at end of file +var _0xf24f=['applications','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','\x0a','sequelize','bulkCreate','priority','getApplications','getInteractions','Contact','Owner','internal','Tag','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','message_id','status_code','groupName','DELIVERED','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','spread','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','index','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','SmsAccount','includeAll','include','findAll','rows','show','params','Pause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','describe','addDisposition','SmsAccountId','Disposition','findOne','nolimit','pick','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','sender','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','list','SmsInteraction','interaction','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User'];(function(_0x504403,_0x4062a1){var _0x45fb51=function(_0x3e32fe){while(--_0x3e32fe){_0x504403['push'](_0x504403['shift']());}};_0x45fb51(++_0x4062a1);}(_0xf24f,0x113));var _0xff24=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0xf24f[_0x3e2489];return _0x2254ce;};'use strict';var pdf=require(_0xff24('0x0'));var emlformat=require(_0xff24('0x1'));var rimraf=require(_0xff24('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff24('0x3'));var rp=require(_0xff24('0x4'));var moment=require(_0xff24('0x5'));var BPromise=require(_0xff24('0x6'));var Mustache=require(_0xff24('0x7'));var util=require(_0xff24('0x8'));var path=require(_0xff24('0x9'));var sox=require(_0xff24('0xa'));var csv=require(_0xff24('0xb'));var ejs=require(_0xff24('0xc'));var fs=require('fs');var _=require(_0xff24('0xd'));var squel=require('squel');var crypto=require(_0xff24('0xe'));var jsforce=require(_0xff24('0xf'));var deskjs=require(_0xff24('0x10'));var toCsv=require('to-csv');var querystring=require(_0xff24('0x11'));var Papa=require(_0xff24('0x12'));var Redis=require(_0xff24('0x13'));var authService=require(_0xff24('0x14'));var qs=require(_0xff24('0x15'));var as=require(_0xff24('0x16'));var hardwareService=require(_0xff24('0x17'));var logger=require(_0xff24('0x18'))(_0xff24('0x19'));var utils=require('../../config/utils');var config=require(_0xff24('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xff24('0x1b')](config[_0xff24('0x1c')],{'host':_0xff24('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff24('0x1c')]));require(_0xff24('0x1e'))[_0xff24('0x1f')](socket);var jayson=require(_0xff24('0x20'));var client=jayson[_0xff24('0x21')]['http']({'port':0x232c});function checkPasswordPattern(_0x5d6ae8,_0x5eeea6,_0x16ab13){if(_0x16ab13){var _0x27c7e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27c7e8['test'](_0x5eeea6)){return _0x5d6ae8;}else{throw new db['Sequelize'][(_0xff24('0x22'))](_0xff24('0x23'));}}else{return _0x5d6ae8;}}function respondWithRpcPromise(_0x9d7964,_0x945700,_0x4b0d87,_0x490c90){return new BPromise(function(_0x1f4c66,_0x1c53ff){var _0x243819=_0x490c90||client;return _0x243819[_0xff24('0x24')](_0x9d7964,_0x4b0d87)[_0xff24('0x25')](function(_0x43b929){logger[_0xff24('0x26')]('SmsAccount,\x20%s,\x20%s',_0x945700,_0xff24('0x27'));logger[_0xff24('0x28')](_0xff24('0x29'),_0x945700,'request\x20sent',JSON[_0xff24('0x2a')](_0x43b929));if(_0x43b929[_0xff24('0x2b')]){if(_0x43b929[_0xff24('0x2b')]['code']===0x1f4){logger['error'](_0xff24('0x2c'),_0x945700,_0x43b929['error'][_0xff24('0x2d')]);return _0x1c53ff(_0x43b929[_0xff24('0x2b')][_0xff24('0x2d')]);}logger[_0xff24('0x2b')](_0xff24('0x2c'),_0x945700,_0x43b929[_0xff24('0x2b')][_0xff24('0x2d')]);return _0x1f4c66(_0x43b929[_0xff24('0x2b')]['message']);}else{logger[_0xff24('0x26')]('SmsAccount,\x20%s,\x20%s',_0x945700,'request\x20sent');_0x1f4c66(_0x43b929['result']['message']);}})[_0xff24('0x2e')](function(_0x1b0ad5){logger[_0xff24('0x2b')](_0xff24('0x2c'),_0x945700,_0x1b0ad5);_0x1c53ff(_0x1b0ad5);});});}function respondWithStatusCode(_0xd9a73f,_0x22e208){_0x22e208=_0x22e208||0xcc;return function(_0x35e8b1){if(_0x35e8b1){return _0xd9a73f['sendStatus'](_0x22e208);}return _0xd9a73f[_0xff24('0x2f')](_0x22e208)[_0xff24('0x30')]();};}function respondWithResult(_0x4ecd8a,_0x26af75){_0x26af75=_0x26af75||0xc8;return function(_0x47c301){if(_0x47c301){return _0x4ecd8a[_0xff24('0x2f')](_0x26af75)[_0xff24('0x31')](_0x47c301);}};}function respondWithFilteredResult(_0x186ea7,_0x33abca){return function(_0x253a89){if(_0x253a89){var _0x178faf=_0x253a89[_0xff24('0x32')],_0x3e29e3=_0x33abca[_0xff24('0x33')],_0x2af57f=_0x33abca['offset']+_0x33abca[_0xff24('0x34')],_0x525c43;if(_0x2af57f>=_0x178faf){_0x2af57f=_0x178faf;_0x525c43=0xc8;}else{_0x525c43=0xce;}_0x186ea7['status'](_0x525c43);return _0x186ea7[_0xff24('0x35')](_0xff24('0x36'),_0x3e29e3+'-'+_0x2af57f+'/'+_0x178faf)['json'](_0x253a89);}return null;};}function patchUpdates(_0x598d3c){return function(_0x401db9){try{jsonpatch[_0xff24('0x37')](_0x401db9,_0x598d3c,!![]);}catch(_0xaf12c4){return BPromise['reject'](_0xaf12c4);}return _0x401db9[_0xff24('0x38')]();};}function saveUpdates(_0x130149,_0x5ad4b){return function(_0x477991){if(_0x477991){return _0x477991[_0xff24('0x39')](_0x130149)[_0xff24('0x25')](function(_0x129213){return _0x129213;});}return null;};}function removeEntity(_0x2ebe1e,_0x563423){return function(_0x12f880){if(_0x12f880){return _0x12f880[_0xff24('0x3a')]()['then'](function(){var _0x5e068b=_0x12f880[_0xff24('0x3b')]({'plain':!![]});var _0x37d65e='SmsAccounts';return db[_0xff24('0x3c')][_0xff24('0x3a')]({'where':{'type':_0x37d65e,'resourceId':_0x5e068b['id']}})['then'](function(){return _0x12f880;});})[_0xff24('0x25')](function(){_0x2ebe1e[_0xff24('0x2f')](0xcc)[_0xff24('0x30')]();});}};}function handleEntityNotFound(_0x2179e6,_0x150a3d){return function(_0x1c3b8c){if(!_0x1c3b8c){_0x2179e6[_0xff24('0x3d')](0x194);}return _0x1c3b8c;};}function handleError(_0x143c7d,_0xd34844){_0xd34844=_0xd34844||0x1f4;return function(_0x51b52a){logger['error'](_0x51b52a[_0xff24('0x3e')]);if(_0x51b52a[_0xff24('0x3f')]){delete _0x51b52a[_0xff24('0x3f')];}_0x143c7d['status'](_0xd34844)['send'](_0x51b52a);};}exports[_0xff24('0x40')]=function(_0x17b082,_0x1c4d1d){var _0x6decac={'include':[{'model':db['Pause'],'as':_0xff24('0x41')}]},_0x46e95e={},_0x412fe7={'count':0x0,'rows':[]};var _0x173ea5=_['map'](db['SmsAccount'][_0xff24('0x42')],function(_0x1928e5){return{'name':_0x1928e5[_0xff24('0x43')],'type':_0x1928e5[_0xff24('0x44')][_0xff24('0x45')]};});_0x46e95e[_0xff24('0x46')]=_[_0xff24('0x47')](_0x173ea5,_0xff24('0x3f'));_0x46e95e[_0xff24('0x48')]=_['keys'](_0x17b082['query']);_0x46e95e[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x46e95e[_0xff24('0x46')],_0x46e95e['query']);_0x6decac[_0xff24('0x4b')]=_[_0xff24('0x4a')](_0x46e95e['model'],qs['fields'](_0x17b082['query'][_0xff24('0x4c')]));_0x6decac[_0xff24('0x4b')]=_0x6decac[_0xff24('0x4b')][_0xff24('0x4d')]?_0x6decac[_0xff24('0x4b')]:_0x46e95e[_0xff24('0x46')];if(!_0x17b082[_0xff24('0x48')][_0xff24('0x4e')]('nolimit')){_0x6decac[_0xff24('0x34')]=qs['limit'](_0x17b082[_0xff24('0x48')]['limit']);_0x6decac['offset']=qs[_0xff24('0x33')](_0x17b082[_0xff24('0x48')][_0xff24('0x33')]);}_0x6decac[_0xff24('0x4f')]=qs[_0xff24('0x50')](_0x17b082['query'][_0xff24('0x50')]);_0x6decac[_0xff24('0x51')]=qs['filters'](_['pick'](_0x17b082[_0xff24('0x48')],_0x46e95e[_0xff24('0x49')]));if(_0x17b082['query']['filter']){_0x6decac[_0xff24('0x51')]=_[_0xff24('0x52')](_0x6decac[_0xff24('0x51')],{'$or':_[_0xff24('0x47')](_0x173ea5,function(_0x28bf68){if(_0x28bf68[_0xff24('0x44')]!=='VIRTUAL'){var _0x1aa10e={};_0x1aa10e[_0x28bf68['name']]={'$like':'%'+_0x17b082[_0xff24('0x48')][_0xff24('0x53')]+'%'};return _0x1aa10e;}})});}_0x6decac=_[_0xff24('0x52')]({},_0x6decac,_0x17b082[_0xff24('0x54')]);var _0x196a1e={'where':_0x6decac[_0xff24('0x51')]};return db[_0xff24('0x55')][_0xff24('0x32')](_0x196a1e)[_0xff24('0x25')](function(_0x43c013){_0x412fe7[_0xff24('0x32')]=_0x43c013;if(_0x17b082[_0xff24('0x48')][_0xff24('0x56')]){_0x6decac[_0xff24('0x57')]=[{'all':!![]}];}return db[_0xff24('0x55')][_0xff24('0x58')](_0x6decac);})[_0xff24('0x25')](function(_0x20e6cf){_0x412fe7[_0xff24('0x59')]=_0x20e6cf;return _0x412fe7;})['then'](respondWithFilteredResult(_0x1c4d1d,_0x6decac))[_0xff24('0x2e')](handleError(_0x1c4d1d,null));};exports[_0xff24('0x5a')]=function(_0x39f88d,_0xa17cf3){var _0x1a3749={'raw':![],'where':{'id':_0x39f88d[_0xff24('0x5b')]['id']},'include':[{'model':db[_0xff24('0x5c')],'as':_0xff24('0x41')}]},_0x400a9c={};_0x400a9c[_0xff24('0x46')]=_['keys'](db[_0xff24('0x55')]['rawAttributes']);_0x400a9c[_0xff24('0x48')]=_[_0xff24('0x5d')](_0x39f88d[_0xff24('0x48')]);_0x400a9c[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x400a9c[_0xff24('0x46')],_0x400a9c[_0xff24('0x48')]);_0x1a3749['attributes']=_['intersection'](_0x400a9c[_0xff24('0x46')],qs[_0xff24('0x4c')](_0x39f88d[_0xff24('0x48')][_0xff24('0x4c')]));_0x1a3749[_0xff24('0x4b')]=_0x1a3749[_0xff24('0x4b')][_0xff24('0x4d')]?_0x1a3749['attributes']:_0x400a9c[_0xff24('0x46')];if(_0x39f88d['query'][_0xff24('0x56')]){_0x1a3749[_0xff24('0x57')]=[{'all':!![]}];}_0x1a3749=_[_0xff24('0x52')]({},_0x1a3749,_0x39f88d[_0xff24('0x54')]);return db[_0xff24('0x55')][_0xff24('0x5e')](_0x1a3749)['then'](handleEntityNotFound(_0xa17cf3,null))[_0xff24('0x25')](respondWithResult(_0xa17cf3,null))[_0xff24('0x2e')](handleError(_0xa17cf3,null));};exports[_0xff24('0x5f')]=function(_0x314a0f,_0x705078){return db[_0xff24('0x55')][_0xff24('0x5f')](_0x314a0f[_0xff24('0x60')],{})[_0xff24('0x25')](function(_0x1a0a42){var _0x2528df=_0x314a0f[_0xff24('0x61')][_0xff24('0x3b')]({'plain':!![]});if(!_0x2528df)throw new Error(_0xff24('0x62'));if(_0x2528df[_0xff24('0x63')]===_0xff24('0x61')){var _0x42f58d=_0x1a0a42['get']({'plain':!![]});var _0x47dd8a='SmsAccounts';return db['UserProfileSection'][_0xff24('0x5e')]({'where':{'name':_0x47dd8a,'userProfileId':_0x2528df[_0xff24('0x64')]},'raw':!![]})[_0xff24('0x25')](function(_0x2f695e){if(_0x2f695e&&_0x2f695e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x42f58d[_0xff24('0x3f')],'resourceId':_0x42f58d['id'],'type':_0x2f695e['name'],'sectionId':_0x2f695e['id']},{})[_0xff24('0x25')](function(){return _0x1a0a42;});}else{return _0x1a0a42;}})[_0xff24('0x2e')](function(_0x348b2d){logger[_0xff24('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x348b2d);throw _0x348b2d;});}return _0x1a0a42;})[_0xff24('0x25')](respondWithResult(_0x705078,0xc9))['catch'](handleError(_0x705078,null));};exports['update']=function(_0x3b1b00,_0x26c029){if(_0x3b1b00[_0xff24('0x60')]['id']){delete _0x3b1b00['body']['id'];}return db[_0xff24('0x55')][_0xff24('0x5e')]({'where':{'id':_0x3b1b00['params']['id']},'include':[{'model':db[_0xff24('0x5c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x26c029,null))['then'](saveUpdates(_0x3b1b00['body'],null))[_0xff24('0x25')](respondWithResult(_0x26c029,null))['catch'](handleError(_0x26c029,null));};exports[_0xff24('0x3a')]=function(_0x3aeb27,_0x2cd458){return db[_0xff24('0x55')]['find']({'where':{'id':_0x3aeb27[_0xff24('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2cd458,null))[_0xff24('0x25')](removeEntity(_0x2cd458,null))['catch'](handleError(_0x2cd458,null));};exports[_0xff24('0x65')]=function(_0xadfecc,_0x4f8598){return db[_0xff24('0x55')][_0xff24('0x65')]()[_0xff24('0x25')](respondWithResult(_0x4f8598,null))['catch'](handleError(_0x4f8598,null));};exports[_0xff24('0x66')]=function(_0x4a6965,_0x37f9c4,_0x306d73){if(_0x4a6965[_0xff24('0x60')]['id']){delete _0x4a6965['body']['id'];}return db['SmsAccount'][_0xff24('0x5e')]({'where':{'id':_0x4a6965[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x37f9c4,null))[_0xff24('0x25')](function(_0x56259f){if(_0x56259f){_0x4a6965[_0xff24('0x60')][_0xff24('0x67')]=_0x56259f['id'];return db[_0xff24('0x68')][_0xff24('0x5f')](_0x4a6965['body']);}})[_0xff24('0x25')](respondWithResult(_0x37f9c4,null))[_0xff24('0x2e')](handleError(_0x37f9c4,null));};exports['getDispositions']=function(_0x606861,_0x495ca4,_0x10bfec){var _0x58c5d2={'raw':![],'where':{}};var _0x5ada72={};var _0xe5b9cd={'count':0x0,'rows':[]};return db[_0xff24('0x55')][_0xff24('0x69')]({'where':{'id':_0x606861[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x495ca4,null))[_0xff24('0x25')](function(_0x4910bd){if(_0x4910bd){_0x5ada72[_0xff24('0x46')]=_[_0xff24('0x5d')](db['Disposition'][_0xff24('0x42')]);_0x5ada72['query']=_['keys'](_0x606861[_0xff24('0x48')]);_0x5ada72[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x5ada72[_0xff24('0x46')],_0x5ada72['query']);_0x58c5d2[_0xff24('0x4b')]=_[_0xff24('0x4a')](_0x5ada72[_0xff24('0x46')],qs['fields'](_0x606861[_0xff24('0x48')][_0xff24('0x4c')]));_0x58c5d2['attributes']=_0x58c5d2[_0xff24('0x4b')]['length']?_0x58c5d2['attributes']:_0x5ada72[_0xff24('0x46')];if(!_0x606861[_0xff24('0x48')][_0xff24('0x4e')](_0xff24('0x6a'))){_0x58c5d2['limit']=qs[_0xff24('0x34')](_0x606861[_0xff24('0x48')][_0xff24('0x34')]);_0x58c5d2[_0xff24('0x33')]=qs[_0xff24('0x33')](_0x606861[_0xff24('0x48')]['offset']);}_0x58c5d2[_0xff24('0x4f')]=qs[_0xff24('0x50')](_0x606861[_0xff24('0x48')][_0xff24('0x50')]);_0x58c5d2['where']=qs[_0xff24('0x49')](_[_0xff24('0x6b')](_0x606861[_0xff24('0x48')],_0x5ada72['filters']));_0x58c5d2[_0xff24('0x51')][_0xff24('0x67')]=_0x4910bd['id'];if(_0x606861[_0xff24('0x48')][_0xff24('0x53')]){_0x58c5d2[_0xff24('0x51')]=_[_0xff24('0x52')](_0x58c5d2[_0xff24('0x51')],{'$or':_[_0xff24('0x47')](_0x58c5d2[_0xff24('0x4b')],function(_0x137d77){var _0x2a7d3d={};_0x2a7d3d[_0x137d77]={'$like':'%'+_0x606861[_0xff24('0x48')][_0xff24('0x53')]+'%'};return _0x2a7d3d;})});}_0x58c5d2=_[_0xff24('0x52')]({},_0x58c5d2,_0x606861['options']);return db[_0xff24('0x68')][_0xff24('0x32')]({'where':_0x58c5d2[_0xff24('0x51')]})[_0xff24('0x25')](function(_0x238d01){_0xe5b9cd['count']=_0x238d01;if(_0x606861[_0xff24('0x48')][_0xff24('0x56')]){_0x58c5d2[_0xff24('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xff24('0x58')](_0x58c5d2);})[_0xff24('0x25')](function(_0x2957e7){_0xe5b9cd[_0xff24('0x59')]=_0x2957e7;return _0xe5b9cd;});}})[_0xff24('0x25')](respondWithFilteredResult(_0x495ca4,_0x58c5d2))[_0xff24('0x2e')](handleError(_0x495ca4,null));};exports['removeDispositions']=function(_0x2d980c,_0x6ec3a4,_0x758bab){return db[_0xff24('0x55')][_0xff24('0x5e')]({'where':{'id':_0x2d980c[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x6ec3a4,null))[_0xff24('0x25')](function(_0x58b81a){if(_0x58b81a){return _0x58b81a['removeDispositions'](_0x2d980c['query'][_0xff24('0x6c')]);}})['then'](respondWithStatusCode(_0x6ec3a4,null))[_0xff24('0x2e')](handleError(_0x6ec3a4,null));};exports[_0xff24('0x6d')]=function(_0x131e00,_0x5277a8,_0x2a9822){if(_0x131e00[_0xff24('0x60')]['id']){delete _0x131e00[_0xff24('0x60')]['id'];}return db[_0xff24('0x55')][_0xff24('0x5e')]({'where':{'id':_0x131e00['params']['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x5277a8,null))[_0xff24('0x25')](function(_0x304980){if(_0x304980){_0x131e00['body'][_0xff24('0x67')]=_0x304980['id'];return db[_0xff24('0x6e')][_0xff24('0x5f')](_0x131e00[_0xff24('0x60')]);}})[_0xff24('0x25')](respondWithResult(_0x5277a8,null))['catch'](handleError(_0x5277a8,null));};exports['getAnswers']=function(_0x2f2e49,_0x5d7613,_0x4cae0a){var _0x159a9b={'raw':![],'where':{}};var _0x282131={};var _0x1be778={'count':0x0,'rows':[]};return db['SmsAccount'][_0xff24('0x69')]({'where':{'id':_0x2f2e49[_0xff24('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d7613,null))['then'](function(_0x15d231){if(_0x15d231){_0x282131[_0xff24('0x46')]=_[_0xff24('0x5d')](db['CannedAnswer'][_0xff24('0x42')]);_0x282131[_0xff24('0x48')]=_['keys'](_0x2f2e49[_0xff24('0x48')]);_0x282131[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x282131['model'],_0x282131['query']);_0x159a9b[_0xff24('0x4b')]=_[_0xff24('0x4a')](_0x282131['model'],qs[_0xff24('0x4c')](_0x2f2e49[_0xff24('0x48')][_0xff24('0x4c')]));_0x159a9b[_0xff24('0x4b')]=_0x159a9b[_0xff24('0x4b')][_0xff24('0x4d')]?_0x159a9b[_0xff24('0x4b')]:_0x282131['model'];if(!_0x2f2e49[_0xff24('0x48')][_0xff24('0x4e')](_0xff24('0x6a'))){_0x159a9b['limit']=qs['limit'](_0x2f2e49[_0xff24('0x48')][_0xff24('0x34')]);_0x159a9b[_0xff24('0x33')]=qs[_0xff24('0x33')](_0x2f2e49[_0xff24('0x48')][_0xff24('0x33')]);}_0x159a9b[_0xff24('0x4f')]=qs['sort'](_0x2f2e49[_0xff24('0x48')]['sort']);_0x159a9b[_0xff24('0x51')]=qs[_0xff24('0x49')](_['pick'](_0x2f2e49[_0xff24('0x48')],_0x282131[_0xff24('0x49')]));_0x159a9b[_0xff24('0x51')][_0xff24('0x67')]=_0x15d231['id'];if(_0x2f2e49[_0xff24('0x48')][_0xff24('0x53')]){_0x159a9b['where']=_['merge'](_0x159a9b[_0xff24('0x51')],{'$or':_[_0xff24('0x47')](_0x159a9b['attributes'],function(_0x57b01e){var _0x42f2f6={};_0x42f2f6[_0x57b01e]={'$like':'%'+_0x2f2e49['query']['filter']+'%'};return _0x42f2f6;})});}_0x159a9b=_['merge']({},_0x159a9b,_0x2f2e49['options']);return db[_0xff24('0x6e')][_0xff24('0x32')]({'where':_0x159a9b['where']})[_0xff24('0x25')](function(_0x1553d3){_0x1be778[_0xff24('0x32')]=_0x1553d3;if(_0x2f2e49[_0xff24('0x48')][_0xff24('0x56')]){_0x159a9b[_0xff24('0x57')]=[{'all':!![]}];}return db[_0xff24('0x6e')][_0xff24('0x58')](_0x159a9b);})[_0xff24('0x25')](function(_0x3af85c){_0x1be778[_0xff24('0x59')]=_0x3af85c;return _0x1be778;});}})[_0xff24('0x25')](respondWithFilteredResult(_0x5d7613,_0x159a9b))[_0xff24('0x2e')](handleError(_0x5d7613,null));};exports[_0xff24('0x6f')]=function(_0x253d95,_0x122663,_0x3b8a12){return db[_0xff24('0x55')][_0xff24('0x5e')]({'where':{'id':_0x253d95[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x122663,null))[_0xff24('0x25')](function(_0x380de8){if(_0x380de8){return _0x380de8[_0xff24('0x6f')](_0x253d95['query']['ids']);}})['then'](respondWithStatusCode(_0x122663,null))[_0xff24('0x2e')](handleError(_0x122663,null));};exports[_0xff24('0x70')]=function(_0x1976f9,_0x18e926,_0x40f2c3){var _0x53d84e={'channel':_0xff24('0x71')};var _0x2629d9=[];var _0x39d5b8=[];var _0x55c1b8={};return db[_0xff24('0x55')][_0xff24('0x5e')]({'where':{'id':_0x1976f9[_0xff24('0x5b')]['id']},'include':[{'model':db[_0xff24('0x72')],'as':_0xff24('0x73')}]})['then'](handleEntityNotFound(_0x18e926,null))[_0xff24('0x25')](function(_0xeefe99){_0x53d84e[_0xff24('0x74')]=_0xeefe99;_0x53d84e['applications']=_[_0xff24('0x75')](_0xeefe99['Applications'],['priority'],['asc']);if(_0x53d84e['account']['Applications']){delete _0x53d84e[_0xff24('0x74')]['Applications'];}return db[_0xff24('0x76')][_0xff24('0x65')]();})['then'](function(_0x1949e4){if(!_0x1949e4){throw new db[(_0xff24('0x77'))][(_0xff24('0x22'))](_0xff24('0x78'));}_0x2629d9=_['difference'](_[_0xff24('0x5d')](_0x1949e4),[_0xff24('0x79'),_0xff24('0x7a')]);_0x39d5b8=_[_0xff24('0x7b')](_[_0xff24('0x5d')](_0x1949e4),[_0xff24('0x79'),_0xff24('0x7a'),_0xff24('0x7c'),'ListId']);_0x53d84e[_0xff24('0x60')]={'mapKey':_0xff24('0x7d')};if(_0x53d84e[_0xff24('0x74')]['type']){switch(_0x53d84e[_0xff24('0x74')][_0xff24('0x44')]){case _0xff24('0x7e'):_0x53d84e['body'][_0xff24('0x7f')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x80')];_0x53d84e[_0xff24('0x60')]['body']=_0x1976f9[_0xff24('0x60')][_0xff24('0x81')];_0x53d84e['body'][_0xff24('0x82')]=_0x1976f9[_0xff24('0x60')]['MessageSid'];break;case _0xff24('0x83'):_0x53d84e[_0xff24('0x60')]['from']='+'+_0x1976f9['body'][_0xff24('0x84')];_0x53d84e[_0xff24('0x60')]['body']=_0x1976f9['body']['text'];break;case'connectel':_0x53d84e['body']['from']=_0x1976f9['body'][_0xff24('0x7f')];_0x53d84e['body'][_0xff24('0x60')]=_0x1976f9['body'][_0xff24('0x2d')];break;case'clicksend':_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')]=_0x1976f9['body'][_0xff24('0x7f')];_0x53d84e[_0xff24('0x60')][_0xff24('0x60')]=_0x1976f9[_0xff24('0x60')]['body'];_0x53d84e[_0xff24('0x60')]['messageId']=_0x1976f9[_0xff24('0x60')]['message_id'];break;case _0xff24('0x85'):_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')]=_0x1976f9['body'][_0xff24('0x80')];_0x53d84e[_0xff24('0x60')][_0xff24('0x60')]=_0x1976f9[_0xff24('0x60')]['Text'];_0x53d84e[_0xff24('0x60')][_0xff24('0x82')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x86')];break;case _0xff24('0x87'):_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')]='+'+_0x1976f9[_0xff24('0x60')][_0xff24('0x88')][0x0]['from'];_0x53d84e[_0xff24('0x60')][_0xff24('0x60')]=_0x1976f9['body'][_0xff24('0x88')][0x0]['text'];_0x53d84e[_0xff24('0x60')][_0xff24('0x82')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x88')][0x0]['messageId'];break;case _0xff24('0x89'):_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x8a')];_0x53d84e['body'][_0xff24('0x60')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x8b')][_0xff24('0x2d')];break;case _0xff24('0x8c'):_0x53d84e[_0xff24('0x60')]['from']=_0x1976f9[_0xff24('0x60')]['fromNumber'];_0x53d84e['body'][_0xff24('0x60')]=_0x1976f9['body']['text'];_0x53d84e[_0xff24('0x60')][_0xff24('0x82')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x8d')];break;case _0xff24('0x8e'):_0x53d84e['body'][_0xff24('0x7f')]=_0x1976f9[_0xff24('0x60')]['from'];_0x53d84e[_0xff24('0x60')][_0xff24('0x60')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x2d')];_0x53d84e[_0xff24('0x60')][_0xff24('0x82')]=_0x1976f9[_0xff24('0x60')][_0xff24('0x8f')];break;}}if(_0x53d84e[_0xff24('0x60')]['id']){delete _0x53d84e[_0xff24('0x60')]['id'];}if(_[_0xff24('0x90')](_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')])){throw new db[(_0xff24('0x77'))][(_0xff24('0x22'))]('from\x20is\x20mandatory');}if(_[_0xff24('0x90')](_0x53d84e[_0xff24('0x60')][_0xff24('0x60')])||_0x53d84e[_0xff24('0x60')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xff24('0x91'));}if(_[_0xff24('0x90')](_0x53d84e[_0xff24('0x60')][_0xff24('0x92')])){throw new db[(_0xff24('0x77'))][(_0xff24('0x22'))](_0xff24('0x93')+_0x39d5b8);}if(!_[_0xff24('0x94')](_0x39d5b8,_0x53d84e[_0xff24('0x60')][_0xff24('0x92')])){throw new db['Sequelize'][(_0xff24('0x22'))](_0xff24('0x95')+_0x39d5b8);}_0x55c1b8[_0x53d84e[_0xff24('0x60')][_0xff24('0x92')]]=_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')];return db[_0xff24('0x96')][_0xff24('0x5e')]({'where':{'id':_0x53d84e['account'][_0xff24('0x97')]},'include':[{'model':db[_0xff24('0x76')],'as':_0xff24('0x98'),'where':_0x55c1b8,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xff24('0x25')](handleEntityNotFound(_0x18e926,null))[_0xff24('0x25')](function(_0x356313){if(_0x356313){_0x53d84e[_0xff24('0x99')]=_['omit'](_0x356313,[_0xff24('0x98')]);if(_0x356313[_0xff24('0x98')][_0xff24('0x4d')]){return _0x356313[_0xff24('0x98')][0x0];}var _0x3dc8a4=_[_0xff24('0x1b')](_0x53d84e[_0xff24('0x60')],{'firstName':_0x53d84e['body'][_0xff24('0x7f')],'ListId':_0x356313['id']});_0x3dc8a4[_0x53d84e[_0xff24('0x60')]['mapKey']]=_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')];return db[_0xff24('0x76')][_0xff24('0x5f')](_0x3dc8a4,{'fields':_0x2629d9,'raw':!![]});}})[_0xff24('0x25')](handleEntityNotFound(_0x18e926,null))['then'](function(_0x45b4fe){if(_0x45b4fe){_0x53d84e['contact']=_0x45b4fe;var _0x3a31fe={'ContactId':_0x45b4fe['id'],'phone':_0x53d84e[_0xff24('0x60')][_0xff24('0x7f')],'SmsAccountId':_0x1976f9[_0xff24('0x5b')]['id']};var _0x3c9294={'ContactId':_0x45b4fe['id'],'SmsAccountId':_0x1976f9[_0xff24('0x5b')]['id'],'closed':![]};return db[_0xff24('0x9a')][_0xff24('0x5e')]({'where':_0x3c9294})[_0xff24('0x25')](function(_0xedabd1){if(_0xedabd1){return[_0xedabd1,![]];}return db[_0xff24('0x9a')]['create'](_0x3a31fe)[_0xff24('0x25')](function(_0x10b215){return[_0x10b215,!![]];});});}})['spread'](function(_0x5d5bac,_0x6432d3){_0x53d84e[_0xff24('0x9b')]=_0x5d5bac[_0xff24('0x3b')]({'plain':!![]});_0x53d84e[_0xff24('0x9b')]['created']=![];if(_0x6432d3){if(_0x53d84e['account'][_0xff24('0x9c')]){_0x53d84e['applications'][_0xff24('0x9d')]({'id':0x0,'priority':_0x53d84e['applications']['length']+0x1,'app':_0xff24('0x9e'),'appdata':'unmanaged','interval':_0xff24('0x9f')});}_0x53d84e[_0xff24('0x9b')]['created']=!![];}return db[_0xff24('0xa0')][_0xff24('0x5f')]({'phone':_0x53d84e['body'][_0xff24('0x7f')],'messageId':_0x53d84e['body'][_0xff24('0x82')],'body':_0x53d84e[_0xff24('0x60')]['body'],'SmsAccountId':_0x1976f9[_0xff24('0x5b')]['id'],'SmsInteractionId':_0x5d5bac['id'],'direction':'in','ContactId':_0x5d5bac[_0xff24('0xa1')],'AttachmentId':_0x53d84e[_0xff24('0x60')][_0xff24('0xa2')]});})[_0xff24('0x25')](function(_0x4a31ba){_0x53d84e[_0xff24('0x2d')]=_0x4a31ba;if(_0x53d84e[_0xff24('0x9b')][_0xff24('0xa3')]){return db[_0xff24('0xa4')][_0xff24('0x5e')]({'attributes':['id',_0xff24('0x3f')],'where':{'id':_0x53d84e['interaction']['UserId']}})[_0xff24('0x25')](function(_0x13019b){if(_0x13019b){_0x53d84e[_0xff24('0xa5')][_0xff24('0xa6')]({'id':0x0,'priority':0x0,'app':_0xff24('0xa7'),'appdata':_0x13019b[_0xff24('0x3f')]+','+(_0x53d84e[_0xff24('0x74')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xff24('0xa8'),'startRouting',_0x53d84e);});}return respondWithRpcPromise(_0xff24('0xa8'),_0xff24('0xa9'),_0x53d84e);})[_0xff24('0x25')](function(_0x37043f){if(_0x37043f){var _0x4c5a1e=0xc8;var _0x18fa81=_0xff24('0xaa');logger[_0xff24('0x26')](_0xff24('0x29'),_0x18fa81,_0x4c5a1e,_0xff24('0xab'));logger[_0xff24('0x28')](_0xff24('0xac'),_0x18fa81,_0x4c5a1e,'entity\x20found',JSON[_0xff24('0x2a')](_0x37043f));if(_0x53d84e[_0xff24('0x74')]['type']===_0xff24('0x7e')){return _0x18e926[_0xff24('0x2f')](_0x4c5a1e)[_0xff24('0x35')]('Content-Type',_0xff24('0xad'))[_0xff24('0xae')](_0xff24('0xaf'));}else{return _0x18e926[_0xff24('0x2f')](_0x4c5a1e)[_0xff24('0x31')](_0x37043f);}}})[_0xff24('0x2e')](handleError(_0x18e926,null));};exports['addApplications']=function(_0x54a1e8,_0xe23eec,_0x21fc65){return db[_0xff24('0x55')]['findOne']({'where':{'id':_0x54a1e8[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0xe23eec,null))[_0xff24('0x25')](function(_0x290e82){if(_0x290e82){return db[_0xff24('0xb0')]['transaction'](function(_0x11f25e){return db[_0xff24('0x72')][_0xff24('0x3a')]({'where':{'SmsAccountId':_0x54a1e8[_0xff24('0x5b')]['id']},'transaction':_0x11f25e})['then'](function(_0x2ad9fa){var _0x5943e4=_['map'](_0x54a1e8[_0xff24('0x60')],function(_0x4a3526){_0x4a3526[_0xff24('0x67')]=_0x54a1e8[_0xff24('0x5b')]['id'];return _0x4a3526;});return db[_0xff24('0x72')][_0xff24('0xb1')](_0x5943e4,{'transaction':_0x11f25e});});})[_0xff24('0x25')](function(){return db[_0xff24('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x54a1e8[_0xff24('0x5b')]['id']},'order':_0xff24('0xb2')});});}})['then'](respondWithResult(_0xe23eec,null))[_0xff24('0x2e')](handleError(_0xe23eec,null));};exports['getApplications']=function(_0x3228b3,_0x33d428,_0x321cb1){var _0x12c754={};var _0x2a5a7c={};var _0x428dcb;var _0x3fdcfe;return db['SmsAccount'][_0xff24('0x69')]({'where':{'id':_0x3228b3['params']['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x33d428,null))[_0xff24('0x25')](function(_0xae420){if(_0xae420){_0x428dcb=_0xae420;_0x2a5a7c[_0xff24('0x46')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x2a5a7c[_0xff24('0x48')]=_[_0xff24('0x5d')](_0x3228b3[_0xff24('0x48')]);_0x2a5a7c[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x2a5a7c[_0xff24('0x46')],_0x2a5a7c[_0xff24('0x48')]);_0x12c754[_0xff24('0x4b')]=_[_0xff24('0x4a')](_0x2a5a7c['model'],qs[_0xff24('0x4c')](_0x3228b3[_0xff24('0x48')][_0xff24('0x4c')]));_0x12c754[_0xff24('0x4b')]=_0x12c754[_0xff24('0x4b')][_0xff24('0x4d')]?_0x12c754[_0xff24('0x4b')]:_0x2a5a7c[_0xff24('0x46')];_0x12c754[_0xff24('0x4f')]=qs['sort'](_0x3228b3['query']['sort']);_0x12c754['where']=qs[_0xff24('0x49')](_[_0xff24('0x6b')](_0x3228b3[_0xff24('0x48')],_0x2a5a7c[_0xff24('0x49')]));if(_0x3228b3['query'][_0xff24('0x53')]){_0x12c754['where']=_[_0xff24('0x52')](_0x12c754['where'],{'$or':_[_0xff24('0x47')](_0x12c754[_0xff24('0x4b')],function(_0x2907a1){var _0x28ba27={};_0x28ba27[_0x2907a1]={'$like':'%'+_0x3228b3[_0xff24('0x48')][_0xff24('0x53')]+'%'};return _0x28ba27;})});}_0x12c754=_[_0xff24('0x52')]({},_0x12c754,_0x3228b3[_0xff24('0x54')]);return _0x428dcb[_0xff24('0xb3')](_0x12c754);}})['then'](function(_0x739d59){if(_0x739d59){_0x3fdcfe=_0x739d59[_0xff24('0x4d')];if(!_0x3228b3[_0xff24('0x48')][_0xff24('0x4e')]('nolimit')){_0x12c754[_0xff24('0x34')]=qs[_0xff24('0x34')](_0x3228b3[_0xff24('0x48')][_0xff24('0x34')]);_0x12c754[_0xff24('0x33')]=qs['offset'](_0x3228b3['query']['offset']);}return _0x428dcb[_0xff24('0xb3')](_0x12c754);}})[_0xff24('0x25')](function(_0x1353ef){if(_0x1353ef){return _0x1353ef?{'count':_0x3fdcfe,'rows':_0x1353ef}:null;}})[_0xff24('0x25')](respondWithResult(_0x33d428,null))[_0xff24('0x2e')](handleError(_0x33d428,null));};exports[_0xff24('0xb4')]=function(_0x32f8af,_0x4f9672,_0x569a0d){var _0x40ab2e={'raw':![],'where':{}};var _0x4476eb={};var _0x550037={'count':0x0,'rows':[]};return db[_0xff24('0x55')][_0xff24('0x69')]({'where':{'id':_0x32f8af[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x4f9672,null))['then'](function(_0x2dd311){if(_0x2dd311){_0x4476eb[_0xff24('0x46')]=_[_0xff24('0x5d')](db[_0xff24('0x9a')][_0xff24('0x42')]);_0x4476eb['query']=_['keys'](_0x32f8af[_0xff24('0x48')]);_0x4476eb[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x4476eb[_0xff24('0x46')],_0x4476eb['query']);_0x40ab2e['attributes']=_[_0xff24('0x4a')](_0x4476eb['model'],qs['fields'](_0x32f8af[_0xff24('0x48')]['fields']));_0x40ab2e[_0xff24('0x4b')]=_0x40ab2e[_0xff24('0x4b')]['length']?_0x40ab2e['attributes']:_0x4476eb[_0xff24('0x46')];if(!_0x32f8af[_0xff24('0x48')][_0xff24('0x4e')](_0xff24('0x6a'))){_0x40ab2e[_0xff24('0x34')]=qs[_0xff24('0x34')](_0x32f8af[_0xff24('0x48')][_0xff24('0x34')]);_0x40ab2e['offset']=qs[_0xff24('0x33')](_0x32f8af[_0xff24('0x48')][_0xff24('0x33')]);}_0x40ab2e[_0xff24('0x4f')]=qs[_0xff24('0x50')](_0x32f8af[_0xff24('0x48')][_0xff24('0x50')]);_0x40ab2e[_0xff24('0x51')]=qs[_0xff24('0x49')](_['pick'](_0x32f8af['query'],_0x4476eb[_0xff24('0x49')]));_0x40ab2e[_0xff24('0x51')][_0xff24('0x67')]=_0x2dd311['id'];if(_0x32f8af[_0xff24('0x48')][_0xff24('0x53')]){_0x40ab2e[_0xff24('0x51')]=_[_0xff24('0x52')](_0x40ab2e[_0xff24('0x51')],{'$or':_[_0xff24('0x47')](_0x40ab2e[_0xff24('0x4b')],function(_0x4ea1cb){var _0x1f9a86={};_0x1f9a86[_0x4ea1cb]={'$like':'%'+_0x32f8af[_0xff24('0x48')]['filter']+'%'};return _0x1f9a86;})});}_0x40ab2e=_['merge']({},_0x40ab2e,_0x32f8af['options']);return db[_0xff24('0x9a')]['count']({'where':_0x40ab2e[_0xff24('0x51')]})[_0xff24('0x25')](function(_0x4c796f){_0x550037['count']=_0x4c796f;if(_0x32f8af[_0xff24('0x48')][_0xff24('0x56')]){_0x40ab2e[_0xff24('0x57')]=[{'model':db['CmContact'],'as':_0xff24('0xb5'),'required':![]},{'model':db[_0xff24('0xa4')],'as':_0xff24('0xb6'),'attributes':[_0xff24('0x3f'),'fullname',_0xff24('0xb7')],'required':![]},{'model':db[_0xff24('0xb8')],'as':'Tags','attributes':['id','name',_0xff24('0xb9')],'where':_0x32f8af[_0xff24('0x48')]['tag']?{'id':_0x32f8af[_0xff24('0x48')][_0xff24('0xba')]}:undefined,'required':_0x32f8af['query'][_0xff24('0xba')]?!![]:![]}];}return db[_0xff24('0x9a')][_0xff24('0x58')](_0x40ab2e);})[_0xff24('0x25')](function(_0x2a8750){_0x550037[_0xff24('0x59')]=_0x2a8750;return _0x550037;});}})[_0xff24('0x25')](respondWithFilteredResult(_0x4f9672,_0x40ab2e))['catch'](handleError(_0x4f9672,null));};exports['send']=function(_0x13a523,_0xc3fbf5,_0xb8e987){var _0xa46133,_0x407e5f,_0x228f70;if(_[_0xff24('0x90')](_0x13a523['body'][_0xff24('0x60')])||_0x13a523[_0xff24('0x60')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xff24('0x91'));}if(_[_0xff24('0x90')](_0x13a523[_0xff24('0x60')]['to'])){throw new db[(_0xff24('0x77'))][(_0xff24('0x22'))](_0xff24('0xbb'));}_0xa46133=_0x13a523['body']['to'];return db['SmsAccount'][_0xff24('0x5e')]({'where':{'id':_0x13a523[_0xff24('0x5b')]['id']},'include':[{'model':db[_0xff24('0x96')],'as':_0xff24('0xbc'),'include':[{'model':db[_0xff24('0x76')],'as':'Contacts','where':{'mobile':_0xa46133},'limit':0x1,'order':[[_0xff24('0x7a'),'DESC']]}]}]})[_0xff24('0x25')](handleEntityNotFound(_0xc3fbf5,null))[_0xff24('0x25')](function(_0x1b775f){if(_0x1b775f&&_0x1b775f[_0xff24('0xbc')]){_0x407e5f=_0x1b775f[_0xff24('0x3b')]({'plain':!![]});if(_0x407e5f['List']&&_0x407e5f['List'][_0xff24('0x98')][_0xff24('0x4d')]){return _0x407e5f[_0xff24('0xbc')][_0xff24('0x98')][0x0];}return db[_0xff24('0x76')][_0xff24('0x5f')](_['defaults'](_0x13a523[_0xff24('0x60')],{'firstName':_0xa46133,'mobile':_0xa46133,'phone':_0xa46133,'ListId':_0x407e5f[_0xff24('0x97')]}));}})[_0xff24('0x25')](handleEntityNotFound(_0xc3fbf5,null))[_0xff24('0x25')](function(_0x25629a){if(_0x25629a){_0x228f70=_0x25629a;return db['SmsInteraction'][_0xff24('0x5e')]({'where':{'ContactId':_0x228f70['id'],'closed':![],'SmsAccountId':_0x407e5f['id']}})['then'](function(_0x26a551){if(_0x26a551){return[_0x26a551,![]];}return db[_0xff24('0x9a')][_0xff24('0x5f')]({'UserId':_0x13a523['user']['id'],'ContactId':_0x228f70['id'],'SmsAccountId':_0x407e5f['id'],'phone':_0xa46133,'firstMsgDirection':'out','Messages':[_[_0xff24('0x52')](_0x13a523['body'],{'read':![],'body':_0x13a523[_0xff24('0x60')][_0xff24('0x60')],'phone':_0xa46133,'SmsAccountId':_0x407e5f['id'],'UserId':_0x13a523[_0xff24('0x61')]['id'],'ContactId':_0x228f70['id']})]},{'include':[{'model':db[_0xff24('0xa0')],'as':_0xff24('0xbd')}]})[_0xff24('0x25')](function(_0x5e0ddf){return[_0x5e0ddf,!![]];});});}})['spread'](function(_0x4d5741,_0x373439){if(_0x373439){return _0x4d5741;}return db['SmsMessage'][_0xff24('0x5f')](_[_0xff24('0x52')](_0x13a523['body'],{'read':![],'body':_0x13a523['body'][_0xff24('0x60')],'phone':_0xa46133,'SmsAccountId':_0x407e5f['id'],'SmsInteractionId':_0x4d5741['id'],'UserId':_0x13a523[_0xff24('0x61')]['id'],'ContactId':_0x228f70['id']}))['then'](function(_0x3b18bb){_0x4d5741[_0xff24('0xbe')][_0xff24('0xbd')]=[];_0x4d5741[_0xff24('0xbe')][_0xff24('0xbd')][_0xff24('0x9d')](_0x3b18bb[_0xff24('0xbe')]);return _0x4d5741;});})[_0xff24('0x25')](respondWithResult(_0xc3fbf5,null))[_0xff24('0x2e')](handleError(_0xc3fbf5,null));};exports[_0xff24('0x2f')]=function(_0x4cf53f,_0x34b93f,_0xfb03d8){if(_0x4cf53f[_0xff24('0x60')]['id']){delete _0x4cf53f[_0xff24('0x60')]['id'];}console[_0xff24('0xbf')](_0xff24('0xc0'),_0x4cf53f['body']);var _0x30e372,_0xb598cb,_0x1bbfff;return db['SmsAccount'][_0xff24('0x5e')]({'where':{'id':_0x4cf53f[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x34b93f,null))[_0xff24('0x25')](function(_0x454401){if(_0x454401){_0x1bbfff=_0x454401;logger[_0xff24('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xff24('0x2f'),_0xff24('0xc1'),_0x454401['type'],util['inspect'](_0x4cf53f[_0xff24('0x60')],{'showHidden':![],'depth':null}));switch(_0x454401[_0xff24('0x44')]){case'skebby':if(_0x4cf53f['body'][_0xff24('0xc2')]&&_0x4cf53f[_0xff24('0x60')][_0xff24('0x2f')]){_0xb598cb=_0x4cf53f[_0xff24('0x60')][_0xff24('0x2f')];return db[_0xff24('0xa0')][_0xff24('0x5e')]({'where':{'messageId':_0x4cf53f[_0xff24('0x60')][_0xff24('0xc2')]}});}break;case _0xff24('0xc3'):if(_0x4cf53f[_0xff24('0x60')][_0xff24('0xc4')]&&_0x4cf53f['body'][_0xff24('0xc5')]){_0xb598cb=_0x4cf53f[_0xff24('0x60')][_0xff24('0xc5')];return db[_0xff24('0xa0')][_0xff24('0x5e')]({'where':{'messageId':_0x4cf53f[_0xff24('0x60')]['requestid']}});}break;case _0xff24('0xc6'):if(_0x4cf53f[_0xff24('0x60')][_0xff24('0xc7')]&&_0x4cf53f['body']['status_code']){_0xb598cb=_0x4cf53f['body'][_0xff24('0xc8')];return db['SmsMessage']['find']({'where':{'messageId':_0x4cf53f[_0xff24('0x60')][_0xff24('0xc7')]}});}break;case _0xff24('0x87'):var _0x347a53=_0x4cf53f[_0xff24('0x60')][_0xff24('0x88')][0x0];if(_0x347a53[_0xff24('0x82')]&&_0x347a53[_0xff24('0x2f')][_0xff24('0xc9')]===_0xff24('0xca')){_0xb598cb=_0x347a53[_0xff24('0x2f')][_0xff24('0xc9')];return db[_0xff24('0xa0')][_0xff24('0x5e')]({'where':{'messageId':_0x347a53[_0xff24('0x82')]}});}break;case _0xff24('0x8c'):if(_0x4cf53f['body'][_0xff24('0x82')]&&_0x4cf53f[_0xff24('0x60')][_0xff24('0x2f')]){_0xb598cb=_0x4cf53f[_0xff24('0x60')]['status'];return db[_0xff24('0xa0')][_0xff24('0x5e')]({'where':{'messageId':_0x4cf53f['body'][_0xff24('0x82')]}});}break;case'intelepeer':if(_0x4cf53f['body']['redif']&&_0x4cf53f[_0xff24('0x60')][_0xff24('0x2f')]){_0xb598cb=_0x4cf53f[_0xff24('0x60')]['status'];return db['SmsMessage'][_0xff24('0x5e')]({'where':{'messageId':_0x4cf53f[_0xff24('0x60')][_0xff24('0xcb')]}});}break;}}})[_0xff24('0x25')](handleEntityNotFound(_0x34b93f,null))['then'](function(_0x149a68){if(_0x149a68){_0x30e372=_0x149a68;switch(_0x1bbfff[_0xff24('0x44')]){case _0xff24('0x83'):if(_0xb598cb===_0xff24('0xca')){return _0x30e372[_0xff24('0x39')]({'read':!![]});}else{logger[_0xff24('0x2b')](_0xff24('0x29'),_0xff24('0x2f'),_0xff24('0x83'),util[_0xff24('0xcc')](_0x4cf53f[_0xff24('0x60')],{'showHidden':![],'depth':null}));}break;case _0xff24('0xc3'):if(_0xb598cb==='1'){return _0x30e372[_0xff24('0x39')]({'read':!![]});}else{logger[_0xff24('0x2b')](_0xff24('0x29'),_0xff24('0x2f'),'skebby',util[_0xff24('0xcc')](_0x4cf53f['body'],{'showHidden':![],'depth':null}));}break;case _0xff24('0xc6'):if(!_0x4cf53f['body'][_0xff24('0xcd')]&&_0xb598cb>=0xc8&&_0xb598cb<=0xce){return _0x30e372[_0xff24('0x39')]({'read':!![]});}else{logger[_0xff24('0x2b')](_0xff24('0x29'),_0xff24('0x2f'),_0xff24('0xc6'),util[_0xff24('0xcc')](_0x4cf53f[_0xff24('0x60')],{'showHidden':![],'depth':null}));}break;case _0xff24('0x87'):var _0x4abe7e=_0x4cf53f['body'][_0xff24('0x88')][0x0];if(_0x4abe7e[_0xff24('0x2f')][_0xff24('0xc9')]===_0xff24('0xca')){return _0x30e372[_0xff24('0x39')]({'read':!![]});}else{logger['error'](_0xff24('0x29'),_0xff24('0x2f'),_0xff24('0x87'),util[_0xff24('0xcc')](_0x4cf53f[_0xff24('0x60')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0xb598cb=='DELIVERED_TO_GATEWAY'||_0xb598cb==_0xff24('0xce')){return _0x30e372[_0xff24('0x39')]({'read':!![]});}else{logger[_0xff24('0x2b')](_0xff24('0x29'),_0xff24('0x2f'),_0xff24('0x8c'),util['inspect'](_0x4cf53f['body'],{'showHidden':![],'depth':null}));}break;case _0xff24('0x8e'):if(_0xb598cb===_0xff24('0xcf')||_0xb598cb===_0xff24('0xd0')){return _0x30e372[_0xff24('0x39')]({'read':!![]});}else{logger[_0xff24('0x2b')](_0xff24('0x29'),_0xff24('0x2f'),_0xff24('0x8e'),util['inspect'](_0x4cf53f['body'],{'showHidden':![],'depth':null}));}break;}return _0x30e372;}})['then'](respondWithResult(_0x34b93f,null))[_0xff24('0x2e')](handleError(_0x34b93f,null));};exports[_0xff24('0xd1')]=function(_0x5aae9d,_0xe54276,_0x51547c){var _0x2e6852,_0xc33910,_0x15edfe;return db['SmsAccount'][_0xff24('0x5e')]({'where':{'id':_0x5aae9d['params']['id']}})[_0xff24('0x25')](handleEntityNotFound(_0xe54276,null))[_0xff24('0x25')](function(_0x48cffd){if(_0x48cffd){_0x15edfe=_0x48cffd;logger[_0xff24('0x28')](_0xff24('0x29'),_0xff24('0x2f'),_0xff24('0xc1'),_0x48cffd['type'],util['inspect'](_0x5aae9d[_0xff24('0x48')],{'showHidden':![],'depth':null}));switch(_0x48cffd[_0xff24('0x44')]){case _0xff24('0x89'):if(_0x5aae9d[_0xff24('0x48')][_0xff24('0xd2')]&&_0x5aae9d['query'][_0xff24('0xd3')]){_0xc33910=_0x5aae9d['query'][_0xff24('0xd3')];return db[_0xff24('0xa0')][_0xff24('0x5e')]({'where':{'messageId':_0x5aae9d['query']['message-id']}});}break;}}})['then'](handleEntityNotFound(_0xe54276,null))[_0xff24('0x25')](function(_0x4cff2c){if(_0x4cff2c){_0x2e6852=_0x4cff2c;switch(_0x15edfe[_0xff24('0x44')]){case _0xff24('0x89'):if(_0xc33910==='2'||_0xc33910==='6'){return _0x2e6852[_0xff24('0x39')]({'read':!![]});}else{logger[_0xff24('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xff24('0x2f'),_0xff24('0x89'),util['inspect'](_0x5aae9d[_0xff24('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x2e6852;}})[_0xff24('0x25')](respondWithResult(_0xe54276,null))['catch'](handleError(_0xe54276,null));};exports[_0xff24('0xd4')]=function(_0x4e6049,_0x3b713d,_0x150c58){return db['SmsAccount'][_0xff24('0x5e')]({'where':{'id':_0x4e6049['params']['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x3b713d,null))[_0xff24('0x25')](function(_0x20b256){if(_0x20b256){return _0x20b256[_0xff24('0xd4')](_0x4e6049[_0xff24('0x60')][_0xff24('0x6c')],_[_0xff24('0xd5')](_0x4e6049[_0xff24('0x60')],[_0xff24('0x6c'),'id'])||{})[_0xff24('0xd6')](function(_0x467c99){for(var _0x458839=0x0;_0x458839<_0x4e6049[_0xff24('0x60')][_0xff24('0x6c')][_0xff24('0x4d')];_0x458839+=0x1){socket[_0xff24('0xd7')](_0xff24('0xd8'),{'UserId':_0x4e6049[_0xff24('0x60')][_0xff24('0x6c')][_0x458839],'SmsAccountId':_0x4e6049[_0xff24('0x5b')]['id']});}return _0x467c99;});}})['then'](respondWithResult(_0x3b713d,null))[_0xff24('0x2e')](handleError(_0x3b713d,null));};exports['removeAgents']=function(_0x4f064b,_0x4b4f76,_0x236c29){return db['SmsAccount'][_0xff24('0x5e')]({'where':{'id':_0x4f064b[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0x4b4f76,null))[_0xff24('0x25')](function(_0x43bf33){if(_0x43bf33){return _0x43bf33[_0xff24('0xd9')](_0x4f064b[_0xff24('0x48')][_0xff24('0x6c')])['then'](function(){if(_['isArray'](_0x4f064b['query'][_0xff24('0x6c')])){for(var _0x48d288=0x0;_0x48d288<_0x4f064b['query'][_0xff24('0x6c')]['length'];_0x48d288+=0x1){socket[_0xff24('0xd7')](_0xff24('0xda'),{'UserId':Number(_0x4f064b['query'][_0xff24('0x6c')][_0x48d288]),'SmsAccountId':Number(_0x4f064b[_0xff24('0x5b')]['id'])});}}else{socket['emit'](_0xff24('0xda'),{'UserId':Number(_0x4f064b[_0xff24('0x48')][_0xff24('0x6c')]),'SmsAccountId':Number(_0x4f064b[_0xff24('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4b4f76,null))[_0xff24('0x2e')](handleError(_0x4b4f76,null));};exports['getAgents']=function(_0x456286,_0xafb913,_0x3a367f){var _0x886760={};var _0x15e0f5={};var _0x2c5c31;var _0x218558;return db[_0xff24('0x55')][_0xff24('0x69')]({'where':{'id':_0x456286[_0xff24('0x5b')]['id']}})[_0xff24('0x25')](handleEntityNotFound(_0xafb913,null))['then'](function(_0x2cef33){if(_0x2cef33){_0x2c5c31=_0x2cef33;_0x15e0f5[_0xff24('0x46')]=_['keys'](db[_0xff24('0xa4')][_0xff24('0x42')]);_0x15e0f5['query']=_[_0xff24('0x5d')](_0x456286[_0xff24('0x48')]);_0x15e0f5[_0xff24('0x49')]=_[_0xff24('0x4a')](_0x15e0f5[_0xff24('0x46')],_0x15e0f5['query']);_0x886760[_0xff24('0x4b')]=_['intersection'](_0x15e0f5[_0xff24('0x46')],qs['fields'](_0x456286[_0xff24('0x48')][_0xff24('0x4c')]));_0x886760['attributes']=_0x886760[_0xff24('0x4b')][_0xff24('0x4d')]?_0x886760[_0xff24('0x4b')]:_0x15e0f5[_0xff24('0x46')];_0x886760[_0xff24('0x4f')]=qs[_0xff24('0x50')](_0x456286[_0xff24('0x48')]['sort']);_0x886760[_0xff24('0x51')]=qs['filters'](_['pick'](_0x456286[_0xff24('0x48')],_0x15e0f5['filters']));if(_0x456286['query'][_0xff24('0x53')]){_0x886760[_0xff24('0x51')]=_[_0xff24('0x52')](_0x886760[_0xff24('0x51')],{'$or':_[_0xff24('0x47')](_0x886760['attributes'],function(_0x2d0c88){var _0x5ca4c1={};_0x5ca4c1[_0x2d0c88]={'$like':'%'+_0x456286['query'][_0xff24('0x53')]+'%'};return _0x5ca4c1;})});}_0x886760=_[_0xff24('0x52')]({},_0x886760,_0x456286['options']);return _0x2c5c31['getAgents'](_0x886760);}})[_0xff24('0x25')](function(_0x39bdc0){if(_0x39bdc0){_0x218558=_0x39bdc0[_0xff24('0x4d')];if(!_0x456286[_0xff24('0x48')][_0xff24('0x4e')]('nolimit')){_0x886760[_0xff24('0x34')]=qs['limit'](_0x456286[_0xff24('0x48')][_0xff24('0x34')]);_0x886760[_0xff24('0x33')]=qs[_0xff24('0x33')](_0x456286[_0xff24('0x48')][_0xff24('0x33')]);}return _0x2c5c31[_0xff24('0xdb')](_0x886760);}})[_0xff24('0x25')](function(_0x2935b7){if(_0x2935b7){return _0x2935b7?{'count':_0x218558,'rows':_0x2935b7}:null;}})[_0xff24('0x25')](respondWithResult(_0xafb913,null))[_0xff24('0x2e')](handleError(_0xafb913,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 750e818..a3374e9 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 _0x9b8e=['hook','exports','events','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5554ab,_0x52b733){var _0x13642f=function(_0x12501d){while(--_0x12501d){_0x5554ab['push'](_0x5554ab['shift']());}};_0x13642f(++_0x52b733);}(_0x9b8e,0xe8));var _0xe9b8=function(_0x5e58da,_0x58c733){_0x5e58da=_0x5e58da-0x0;var _0x3c8bc0=_0x9b8e[_0x5e58da];return _0x3c8bc0;};'use strict';var EventEmitter=require(_0xe9b8('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xe9b8('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe9b8('0x2')](0x0);var events={'afterCreate':_0xe9b8('0x3'),'afterUpdate':_0xe9b8('0x4'),'afterDestroy':_0xe9b8('0x5')};function emitEvent(_0x4638a2){return function(_0x29bc4f,_0x15a35f,_0x359951){SmsAccountEvents['emit'](_0x4638a2+':'+_0x29bc4f['id'],_0x29bc4f);SmsAccountEvents[_0xe9b8('0x6')](_0x4638a2,_0x29bc4f);_0x359951(null);};}for(var e in events){if(events[_0xe9b8('0x7')](e)){var event=events[e];SmsAccount[_0xe9b8('0x8')](e,emitEvent(event));}}module[_0xe9b8('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x63f4=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x49e629,_0xa38717){var _0x2c8167=function(_0x263ab4){while(--_0x263ab4){_0x49e629['push'](_0x49e629['shift']());}};_0x2c8167(++_0xa38717);}(_0x63f4,0xf0));var _0x463f=function(_0x542d9c,_0x45d5e7){_0x542d9c=_0x542d9c-0x0;var _0xe75a0f=_0x63f4[_0x542d9c];return _0xe75a0f;};'use strict';var EventEmitter=require(_0x463f('0x0'));var SmsAccount=require(_0x463f('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x463f('0x2')](0x0);var events={'afterCreate':_0x463f('0x3'),'afterUpdate':_0x463f('0x4'),'afterDestroy':_0x463f('0x5')};function emitEvent(_0x184a38){return function(_0x646055,_0x2ac516,_0x334baf){SmsAccountEvents[_0x463f('0x6')](_0x184a38+':'+_0x646055['id'],_0x646055);SmsAccountEvents[_0x463f('0x6')](_0x184a38,_0x646055);_0x334baf(null);};}for(var e in events){if(events[_0x463f('0x7')](e)){var event=events[e];SmsAccount[_0x463f('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index cf8795a..85e8197 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 _0xde2e=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes'];(function(_0x4f7d96,_0x5c080b){var _0x6e4bd2=function(_0x1b0f1a){while(--_0x1b0f1a){_0x4f7d96['push'](_0x4f7d96['shift']());}};_0x6e4bd2(++_0x5c080b);}(_0xde2e,0x92));var _0xede2=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xde2e[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xede2('0x0'));var util=require(_0xede2('0x1'));var logger=require(_0xede2('0x2'))(_0xede2('0x3'));var moment=require(_0xede2('0x4'));var BPromise=require(_0xede2('0x5'));var rp=require(_0xede2('0x6'));var fs=require('fs');var path=require(_0xede2('0x7'));var rimraf=require('rimraf');var config=require(_0xede2('0x8'));var attributes=require(_0xede2('0x9'));module['exports']=function(_0x3de764,_0xd42aeb){return _0x3de764[_0xede2('0xa')](_0xede2('0xb'),attributes,{'tableName':_0xede2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f71=['path','../../config/environment','./smsAccount.attributes','exports','SmsAccount','moment','bluebird'];(function(_0x1f57ef,_0x18a629){var _0x43ccd1=function(_0x5b495d){while(--_0x5b495d){_0x1f57ef['push'](_0x1f57ef['shift']());}};_0x43ccd1(++_0x18a629);}(_0x5f71,0x1da));var _0x15f7=function(_0x3224e8,_0x3e0ec2){_0x3224e8=_0x3224e8-0x0;var _0x33c46b=_0x5f71[_0x3224e8];return _0x33c46b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x15f7('0x0'));var BPromise=require(_0x15f7('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15f7('0x2'));var rimraf=require('rimraf');var config=require(_0x15f7('0x3'));var attributes=require(_0x15f7('0x4'));module[_0x15f7('0x5')]=function(_0x141b9d,_0x21a222){return _0x141b9d['define'](_0x15f7('0x6'),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 dcf44c8..2037cdb 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 _0x6001=['http','redis','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','map','model','attributes','include','ShowSmsAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x22f0ad,_0x284428){var _0xaf79f8=function(_0x4c28f6){while(--_0x4c28f6){_0x22f0ad['push'](_0x22f0ad['shift']());}};_0xaf79f8(++_0x284428);}(_0x6001,0xf8));var _0x1600=function(_0x7488c6,_0x1b2889){_0x7488c6=_0x7488c6-0x0;var _0x50fafa=_0x6001[_0x7488c6];return _0x50fafa;};'use strict';var _=require('lodash');var util=require(_0x1600('0x0'));var moment=require(_0x1600('0x1'));var BPromise=require(_0x1600('0x2'));var rs=require(_0x1600('0x3'));var fs=require('fs');var Redis=require(_0x1600('0x4'));var db=require(_0x1600('0x5'))['db'];var utils=require(_0x1600('0x6'));var logger=require(_0x1600('0x7'))(_0x1600('0x8'));var config=require(_0x1600('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1600('0xa')][_0x1600('0xb')]({'port':0x232a});config[_0x1600('0xc')]=_['defaults'](config[_0x1600('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1600('0xd'))(new Redis(config[_0x1600('0xc')]));require(_0x1600('0xe'))['register'](socket);function respondWithRpcPromise(_0x8c4791,_0x3c7280,_0x25a189){return new BPromise(function(_0x46f446,_0x14f773){return client[_0x1600('0xf')](_0x8c4791,_0x25a189)[_0x1600('0x10')](function(_0x12f697){logger[_0x1600('0x11')](_0x1600('0x12'),_0x3c7280,_0x1600('0x13'));logger[_0x1600('0x14')](_0x1600('0x15'),_0x3c7280,_0x1600('0x13'),JSON[_0x1600('0x16')](_0x12f697));if(_0x12f697[_0x1600('0x17')]){if(_0x12f697[_0x1600('0x17')][_0x1600('0x18')]===0x1f4){logger[_0x1600('0x17')](_0x1600('0x12'),_0x3c7280,_0x12f697['error']['message']);return _0x14f773(_0x12f697[_0x1600('0x17')]['message']);}logger[_0x1600('0x17')](_0x1600('0x12'),_0x3c7280,_0x12f697[_0x1600('0x17')][_0x1600('0x19')]);return _0x46f446(_0x12f697['error'][_0x1600('0x19')]);}else{logger['info'](_0x1600('0x12'),_0x3c7280,_0x1600('0x13'));_0x46f446(_0x12f697[_0x1600('0x1a')][_0x1600('0x19')]);}})[_0x1600('0x1b')](function(_0x102bed){logger[_0x1600('0x17')](_0x1600('0x12'),_0x3c7280,_0x102bed);_0x14f773(_0x102bed);});});}exports['ShowSmsAccount']=function(_0x20b110){var _0x410bfd=this;return new Promise(function(_0x3a7dd2,_0x15996d){return db[_0x1600('0x1c')][_0x1600('0x1d')]({'raw':_0x20b110[_0x1600('0x1e')]?_0x20b110[_0x1600('0x1e')][_0x1600('0x1f')]===undefined?!![]:![]:!![],'where':_0x20b110[_0x1600('0x1e')]?_0x20b110[_0x1600('0x1e')]['where']||null:null,'attributes':_0x20b110['options']?_0x20b110[_0x1600('0x1e')]['attributes']||null:null,'include':_0x20b110[_0x1600('0x1e')]?_0x20b110[_0x1600('0x1e')]['include']?_[_0x1600('0x20')](_0x20b110[_0x1600('0x1e')]['include'],function(_0x2b18e1){return{'model':db[_0x2b18e1[_0x1600('0x21')]],'as':_0x2b18e1['as'],'attributes':_0x2b18e1[_0x1600('0x22')],'include':_0x2b18e1[_0x1600('0x23')]?_[_0x1600('0x20')](_0x2b18e1['include'],function(_0x25cd51){return{'model':db[_0x25cd51[_0x1600('0x21')]],'as':_0x25cd51['as'],'attributes':_0x25cd51[_0x1600('0x22')],'include':_0x25cd51[_0x1600('0x23')]?_[_0x1600('0x20')](_0x25cd51[_0x1600('0x23')],function(_0x16e2ca){return{'model':db[_0x16e2ca[_0x1600('0x21')]],'as':_0x16e2ca['as'],'attributes':_0x16e2ca['attributes']};}):[]};}):[]};}):[]:[]})[_0x1600('0x10')](function(_0x2fae29){logger[_0x1600('0x11')]('ShowSmsAccount',_0x20b110);logger[_0x1600('0x14')](_0x1600('0x24'),_0x20b110,JSON[_0x1600('0x16')](_0x2fae29));_0x3a7dd2(_0x2fae29);})[_0x1600('0x1b')](function(_0x3c25d5){logger[_0x1600('0x17')]('ShowSmsAccount',_0x3c25d5[_0x1600('0x19')],_0x20b110);_0x15996d(_0x410bfd[_0x1600('0x17')](0x1f4,_0x3c25d5[_0x1600('0x19')]));});});}; \ No newline at end of file +var _0xdef8=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','where','include','map','model','attributes','ShowSmsAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s'];(function(_0x34d29a,_0x1b90fa){var _0x1bac57=function(_0x10cd77){while(--_0x10cd77){_0x34d29a['push'](_0x34d29a['shift']());}};_0x1bac57(++_0x1b90fa);}(_0xdef8,0xdb));var _0x8def=function(_0x2887c0,_0xabef83){_0x2887c0=_0x2887c0-0x0;var _0x39852c=_0xdef8[_0x2887c0];return _0x39852c;};'use strict';var _=require(_0x8def('0x0'));var util=require('util');var moment=require(_0x8def('0x1'));var BPromise=require(_0x8def('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8def('0x3'));var db=require(_0x8def('0x4'))['db'];var utils=require(_0x8def('0x5'));var logger=require(_0x8def('0x6'))(_0x8def('0x7'));var config=require(_0x8def('0x8'));var jayson=require(_0x8def('0x9'));var client=jayson[_0x8def('0xa')][_0x8def('0xb')]({'port':0x232a});config[_0x8def('0xc')]=_[_0x8def('0xd')](config[_0x8def('0xc')],{'host':_0x8def('0xe'),'port':0x18eb});var socket=require(_0x8def('0xf'))(new Redis(config['redis']));require(_0x8def('0x10'))['register'](socket);function respondWithRpcPromise(_0x2c5ac5,_0x2fc13,_0x567473){return new BPromise(function(_0x143f47,_0x594495){return client[_0x8def('0x11')](_0x2c5ac5,_0x567473)[_0x8def('0x12')](function(_0xf9c93d){logger[_0x8def('0x13')](_0x8def('0x14'),_0x2fc13,_0x8def('0x15'));logger[_0x8def('0x16')](_0x8def('0x17'),_0x2fc13,_0x8def('0x15'),JSON[_0x8def('0x18')](_0xf9c93d));if(_0xf9c93d[_0x8def('0x19')]){if(_0xf9c93d[_0x8def('0x19')][_0x8def('0x1a')]===0x1f4){logger[_0x8def('0x19')](_0x8def('0x14'),_0x2fc13,_0xf9c93d['error'][_0x8def('0x1b')]);return _0x594495(_0xf9c93d[_0x8def('0x19')][_0x8def('0x1b')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x2fc13,_0xf9c93d[_0x8def('0x19')][_0x8def('0x1b')]);return _0x143f47(_0xf9c93d[_0x8def('0x19')]['message']);}else{logger[_0x8def('0x13')](_0x8def('0x14'),_0x2fc13,_0x8def('0x15'));_0x143f47(_0xf9c93d[_0x8def('0x1c')][_0x8def('0x1b')]);}})[_0x8def('0x1d')](function(_0x55c683){logger[_0x8def('0x19')]('SmsAccount,\x20%s,\x20%s',_0x2fc13,_0x55c683);_0x594495(_0x55c683);});});}exports['ShowSmsAccount']=function(_0x22541a){var _0x38b889=this;return new Promise(function(_0x1fb255,_0x2266d1){return db[_0x8def('0x1e')][_0x8def('0x1f')]({'raw':_0x22541a[_0x8def('0x20')]?_0x22541a['options'][_0x8def('0x21')]===undefined?!![]:![]:!![],'where':_0x22541a[_0x8def('0x20')]?_0x22541a[_0x8def('0x20')][_0x8def('0x22')]||null:null,'attributes':_0x22541a['options']?_0x22541a['options']['attributes']||null:null,'include':_0x22541a['options']?_0x22541a[_0x8def('0x20')][_0x8def('0x23')]?_[_0x8def('0x24')](_0x22541a[_0x8def('0x20')][_0x8def('0x23')],function(_0x519fd9){return{'model':db[_0x519fd9[_0x8def('0x25')]],'as':_0x519fd9['as'],'attributes':_0x519fd9[_0x8def('0x26')],'include':_0x519fd9[_0x8def('0x23')]?_[_0x8def('0x24')](_0x519fd9['include'],function(_0x9dca94){return{'model':db[_0x9dca94[_0x8def('0x25')]],'as':_0x9dca94['as'],'attributes':_0x9dca94[_0x8def('0x26')],'include':_0x9dca94[_0x8def('0x23')]?_['map'](_0x9dca94['include'],function(_0x50e4a2){return{'model':db[_0x50e4a2['model']],'as':_0x50e4a2['as'],'attributes':_0x50e4a2[_0x8def('0x26')]};}):[]};}):[]};}):[]:[]})[_0x8def('0x12')](function(_0x172443){logger['info']('ShowSmsAccount',_0x22541a);logger['debug'](_0x8def('0x27'),_0x22541a,JSON[_0x8def('0x18')](_0x172443));_0x1fb255(_0x172443);})[_0x8def('0x1d')](function(_0x2ace09){logger[_0x8def('0x19')](_0x8def('0x27'),_0x2ace09[_0x8def('0x1b')],_0x22541a);_0x2266d1(_0x38b889['error'](0x1f4,_0x2ace09['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ad65462..b20ad26 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 _0x4cf8=['remove','update','emit','removeListener','register','./smsAccount.events','save'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5e5c4c,_0x21abba){_0x5e5c4c=_0x5e5c4c-0x0;var _0x176148=_0x4cf8[_0x5e5c4c];return _0x176148;};'use strict';var SmsAccountEvents=require(_0x84cf('0x0'));var events=[_0x84cf('0x1'),_0x84cf('0x2'),_0x84cf('0x3')];function createListener(_0xae953,_0x28455b){return function(_0x36b912){_0x28455b[_0x84cf('0x4')](_0xae953,_0x36b912);};}function removeListener(_0x3bbbc3,_0x2d38c0){return function(){SmsAccountEvents[_0x84cf('0x5')](_0x3bbbc3,_0x2d38c0);};}exports[_0x84cf('0x6')]=function(_0x50ade2){for(var _0x4af3f1=0x0,_0x455345=events['length'];_0x4af3f1<_0x455345;_0x4af3f1++){var _0x15ba85=events[_0x4af3f1];var _0x2c11b0=createListener('smsAccount:'+_0x15ba85,_0x50ade2);SmsAccountEvents['on'](_0x15ba85,_0x2c11b0);}}; \ No newline at end of file +var _0x6ff6=['length','smsAccount:','remove','update','emit','register'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6ff6,0x182));var _0x66ff=function(_0x34a61e,_0x1c8115){_0x34a61e=_0x34a61e-0x0;var _0x2a732b=_0x6ff6[_0x34a61e];return _0x2a732b;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save',_0x66ff('0x0'),_0x66ff('0x1')];function createListener(_0x311885,_0x1ff8fb){return function(_0x17290a){_0x1ff8fb[_0x66ff('0x2')](_0x311885,_0x17290a);};}function removeListener(_0x203d52,_0x51a5d8){return function(){SmsAccountEvents['removeListener'](_0x203d52,_0x51a5d8);};}exports[_0x66ff('0x3')]=function(_0x457e58){for(var _0x4a55fb=0x0,_0x53c517=events[_0x66ff('0x4')];_0x4a55fb<_0x53c517;_0x4a55fb++){var _0x244a73=events[_0x4a55fb];var _0x5488fa=createListener(_0x66ff('0x5')+_0x244a73,_0x457e58);SmsAccountEvents['on'](_0x244a73,_0x5488fa);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index eddf6b6..e95581c 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 _0x4326=['post','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show'];(function(_0x4d9b08,_0x394aff){var _0x2c9955=function(_0x158b51){while(--_0x158b51){_0x4d9b08['push'](_0x4d9b08['shift']());}};_0x2c9955(++_0x394aff);}(_0x4326,0x1ce));var _0x6432=function(_0x370cad,_0x2edeb3){_0x370cad=_0x370cad-0x0;var _0x31a8cf=_0x4326[_0x370cad];return _0x31a8cf;};'use strict';var multer=require('multer');var util=require(_0x6432('0x0'));var path=require(_0x6432('0x1'));var timeout=require(_0x6432('0x2'));var express=require(_0x6432('0x3'));var router=express[_0x6432('0x4')]();var auth=require(_0x6432('0x5'));var interaction=require(_0x6432('0x6'));var config=require(_0x6432('0x7'));var controller=require(_0x6432('0x8'));router[_0x6432('0x9')]('/',auth[_0x6432('0xa')](),controller[_0x6432('0xb')]);router[_0x6432('0x9')]('/:id',auth[_0x6432('0xa')](),controller[_0x6432('0xc')]);router[_0x6432('0xd')]('/',auth[_0x6432('0xa')](),controller['create']);router['put'](_0x6432('0xe'),auth[_0x6432('0xa')](),controller[_0x6432('0xf')]);router[_0x6432('0x10')](_0x6432('0xe'),auth[_0x6432('0xa')](),controller[_0x6432('0x11')]);module[_0x6432('0x12')]=router; \ No newline at end of file +var _0x6931=['/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','index','get','isAuthenticated','show','post'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x6931,0x16d));var _0x1693=function(_0x1d66f4,_0x268f43){_0x1d66f4=_0x1d66f4-0x0;var _0x48f759=_0x6931[_0x1d66f4];return _0x48f759;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1693('0x0'));var timeout=require(_0x1693('0x1'));var express=require(_0x1693('0x2'));var router=express[_0x1693('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1693('0x4'));var config=require('../../config/environment');var controller=require('./smsApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1693('0x5')]);router[_0x1693('0x6')]('/:id',auth[_0x1693('0x7')](),controller[_0x1693('0x8')]);router[_0x1693('0x9')]('/',auth[_0x1693('0x7')](),controller['create']);router['put'](_0x1693('0xa'),auth[_0x1693('0x7')](),controller[_0x1693('0xb')]);router[_0x1693('0xc')](_0x1693('0xa'),auth['isAuthenticated'](),controller[_0x1693('0xd')]);module[_0x1693('0xe')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1ff8fc9..b24195c 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 _0xe5c7=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x26210f,_0x1042c6){var _0x420c19=function(_0x1dd466){while(--_0x1dd466){_0x26210f['push'](_0x26210f['shift']());}};_0x420c19(++_0x1042c6);}(_0xe5c7,0x17b));var _0x7e5c=function(_0x550a82,_0x45e6b3){_0x550a82=_0x550a82-0x0;var _0x26e9ba=_0xe5c7[_0x550a82];return _0x26e9ba;};'use strict';var Sequelize=require(_0x7e5c('0x0'));module[_0x7e5c('0x1')]={'priority':{'type':Sequelize[_0x7e5c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7e5c('0x3')},'appdata':{'type':Sequelize[_0x7e5c('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7e5c('0x5')}}; \ No newline at end of file +var _0xceeb=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x549121,_0x32eac7){var _0xc3a8d8=function(_0x3dc7e6){while(--_0x3dc7e6){_0x549121['push'](_0x549121['shift']());}};_0xc3a8d8(++_0x32eac7);}(_0xceeb,0xa3));var _0xbcee=function(_0x307b88,_0x52b9d0){_0x307b88=_0x307b88-0x0;var _0x5c44db=_0xceeb[_0x307b88];return _0x5c44db;};'use strict';var Sequelize=require(_0xbcee('0x0'));module[_0xbcee('0x1')]={'priority':{'type':Sequelize[_0xbcee('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbcee('0x3')],'allowNull':![],'defaultValue':_0xbcee('0x4')},'appdata':{'type':Sequelize[_0xbcee('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbcee('0x3')],'defaultValue':_0xbcee('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c31fe56..88cd4f8 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 _0x8b9d=['map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','SmsApplication','findAll','rows','catch','show','params','length','create','body','update','find','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8b9d,0x6a));var _0xd8b9=function(_0x32e8f2,_0x33cff3){_0x32e8f2=_0x32e8f2-0x0;var _0xefd2e6=_0x8b9d[_0x32e8f2];return _0xefd2e6;};'use strict';var pdf=require(_0xd8b9('0x0'));var emlformat=require(_0xd8b9('0x1'));var rimraf=require(_0xd8b9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd8b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8b9('0x4'));var util=require(_0xd8b9('0x5'));var path=require(_0xd8b9('0x6'));var sox=require(_0xd8b9('0x7'));var csv=require(_0xd8b9('0x8'));var ejs=require(_0xd8b9('0x9'));var fs=require('fs');var _=require(_0xd8b9('0xa'));var squel=require('squel');var crypto=require(_0xd8b9('0xb'));var jsforce=require(_0xd8b9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd8b9('0x8'));var querystring=require(_0xd8b9('0xd'));var Papa=require('papaparse');var Redis=require(_0xd8b9('0xe'));var authService=require(_0xd8b9('0xf'));var qs=require(_0xd8b9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8b9('0x11'));var logger=require('../../config/logger')(_0xd8b9('0x12'));var utils=require(_0xd8b9('0x13'));var config=require(_0xd8b9('0x14'));var db=require(_0xd8b9('0x15'))['db'];function respondWithStatusCode(_0x51f860,_0x42f4df){_0x42f4df=_0x42f4df||0xcc;return function(_0xf2a3c){if(_0xf2a3c){return _0x51f860['sendStatus'](_0x42f4df);}return _0x51f860['status'](_0x42f4df)[_0xd8b9('0x16')]();};}function respondWithResult(_0x1de50b,_0x1b94c3){_0x1b94c3=_0x1b94c3||0xc8;return function(_0x5e6eb9){if(_0x5e6eb9){return _0x1de50b[_0xd8b9('0x17')](_0x1b94c3)[_0xd8b9('0x18')](_0x5e6eb9);}};}function respondWithFilteredResult(_0x4a13e1,_0x1fbeba){return function(_0x4a447c){if(_0x4a447c){var _0x1e610a=_0x4a447c[_0xd8b9('0x19')],_0x1ea3d6=_0x1fbeba[_0xd8b9('0x1a')],_0x5d1c56=_0x1fbeba[_0xd8b9('0x1a')]+_0x1fbeba[_0xd8b9('0x1b')],_0x70d87c;if(_0x5d1c56>=_0x1e610a){_0x5d1c56=_0x1e610a;_0x70d87c=0xc8;}else{_0x70d87c=0xce;}_0x4a13e1[_0xd8b9('0x17')](_0x70d87c);return _0x4a13e1['set'](_0xd8b9('0x1c'),_0x1ea3d6+'-'+_0x5d1c56+'/'+_0x1e610a)[_0xd8b9('0x18')](_0x4a447c);}return null;};}function patchUpdates(_0x61a5ff){return function(_0x48a8f5){try{jsonpatch[_0xd8b9('0x1d')](_0x48a8f5,_0x61a5ff,!![]);}catch(_0x21c22d){return BPromise[_0xd8b9('0x1e')](_0x21c22d);}return _0x48a8f5[_0xd8b9('0x1f')]();};}function saveUpdates(_0x57adb4,_0x33880f){return function(_0x3a097f){if(_0x3a097f){return _0x3a097f['update'](_0x57adb4)[_0xd8b9('0x20')](function(_0x4d0cb6){return _0x4d0cb6;});}return null;};}function removeEntity(_0x788d05,_0x5bafde){return function(_0x108abf){if(_0x108abf){return _0x108abf[_0xd8b9('0x21')]()[_0xd8b9('0x20')](function(){_0x788d05[_0xd8b9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217f1f,_0x3e6086){return function(_0x5976d4){if(!_0x5976d4){_0x217f1f['sendStatus'](0x194);}return _0x5976d4;};}function handleError(_0x2d89b,_0x582cdf){_0x582cdf=_0x582cdf||0x1f4;return function(_0x41a350){logger[_0xd8b9('0x22')](_0x41a350[_0xd8b9('0x23')]);if(_0x41a350[_0xd8b9('0x24')]){delete _0x41a350[_0xd8b9('0x24')];}_0x2d89b[_0xd8b9('0x17')](_0x582cdf)[_0xd8b9('0x25')](_0x41a350);};}exports['index']=function(_0x28ad2d,_0x7a0342){var _0x5c9c12={},_0x555f65={},_0x257266={'count':0x0,'rows':[]};var _0x20da63=_[_0xd8b9('0x26')](db['SmsApplication'][_0xd8b9('0x27')],function(_0x134d1f){return{'name':_0x134d1f[_0xd8b9('0x28')],'type':_0x134d1f[_0xd8b9('0x29')][_0xd8b9('0x2a')]};});_0x555f65['model']=_[_0xd8b9('0x26')](_0x20da63,'name');_0x555f65[_0xd8b9('0x2b')]=_[_0xd8b9('0x2c')](_0x28ad2d[_0xd8b9('0x2b')]);_0x555f65[_0xd8b9('0x2d')]=_[_0xd8b9('0x2e')](_0x555f65['model'],_0x555f65[_0xd8b9('0x2b')]);_0x5c9c12['attributes']=_[_0xd8b9('0x2e')](_0x555f65[_0xd8b9('0x2f')],qs[_0xd8b9('0x30')](_0x28ad2d['query'][_0xd8b9('0x30')]));_0x5c9c12[_0xd8b9('0x31')]=_0x5c9c12[_0xd8b9('0x31')]['length']?_0x5c9c12[_0xd8b9('0x31')]:_0x555f65[_0xd8b9('0x2f')];if(!_0x28ad2d[_0xd8b9('0x2b')][_0xd8b9('0x32')](_0xd8b9('0x33'))){_0x5c9c12['limit']=qs[_0xd8b9('0x1b')](_0x28ad2d[_0xd8b9('0x2b')][_0xd8b9('0x1b')]);_0x5c9c12[_0xd8b9('0x1a')]=qs['offset'](_0x28ad2d['query'][_0xd8b9('0x1a')]);}_0x5c9c12[_0xd8b9('0x34')]=qs[_0xd8b9('0x35')](_0x28ad2d[_0xd8b9('0x2b')][_0xd8b9('0x35')]);_0x5c9c12[_0xd8b9('0x36')]=qs['filters'](_['pick'](_0x28ad2d[_0xd8b9('0x2b')],_0x555f65[_0xd8b9('0x2d')]));if(_0x28ad2d[_0xd8b9('0x2b')][_0xd8b9('0x37')]){_0x5c9c12[_0xd8b9('0x36')]=_[_0xd8b9('0x38')](_0x5c9c12[_0xd8b9('0x36')],{'$or':_[_0xd8b9('0x26')](_0x20da63,function(_0x3b9388){if(_0x3b9388[_0xd8b9('0x29')]!==_0xd8b9('0x39')){var _0x22d926={};_0x22d926[_0x3b9388[_0xd8b9('0x24')]]={'$like':'%'+_0x28ad2d[_0xd8b9('0x2b')][_0xd8b9('0x37')]+'%'};return _0x22d926;}})});}_0x5c9c12=_[_0xd8b9('0x38')]({},_0x5c9c12,_0x28ad2d[_0xd8b9('0x3a')]);var _0x286888={'where':_0x5c9c12[_0xd8b9('0x36')]};return db['SmsApplication'][_0xd8b9('0x19')](_0x286888)[_0xd8b9('0x20')](function(_0x1e7f96){_0x257266['count']=_0x1e7f96;if(_0x28ad2d[_0xd8b9('0x2b')][_0xd8b9('0x3b')]){_0x5c9c12[_0xd8b9('0x3c')]=[{'all':!![]}];}return db[_0xd8b9('0x3d')][_0xd8b9('0x3e')](_0x5c9c12);})['then'](function(_0x2030fb){_0x257266[_0xd8b9('0x3f')]=_0x2030fb;return _0x257266;})['then'](respondWithFilteredResult(_0x7a0342,_0x5c9c12))[_0xd8b9('0x40')](handleError(_0x7a0342,null));};exports[_0xd8b9('0x41')]=function(_0x5ee1bb,_0x17d395){var _0x5961fc={'raw':!![],'where':{'id':_0x5ee1bb[_0xd8b9('0x42')]['id']}},_0x21b15f={};_0x21b15f[_0xd8b9('0x2f')]=_[_0xd8b9('0x2c')](db[_0xd8b9('0x3d')][_0xd8b9('0x27')]);_0x21b15f[_0xd8b9('0x2b')]=_[_0xd8b9('0x2c')](_0x5ee1bb['query']);_0x21b15f[_0xd8b9('0x2d')]=_['intersection'](_0x21b15f[_0xd8b9('0x2f')],_0x21b15f[_0xd8b9('0x2b')]);_0x5961fc[_0xd8b9('0x31')]=_[_0xd8b9('0x2e')](_0x21b15f[_0xd8b9('0x2f')],qs[_0xd8b9('0x30')](_0x5ee1bb[_0xd8b9('0x2b')][_0xd8b9('0x30')]));_0x5961fc['attributes']=_0x5961fc[_0xd8b9('0x31')][_0xd8b9('0x43')]?_0x5961fc[_0xd8b9('0x31')]:_0x21b15f[_0xd8b9('0x2f')];if(_0x5ee1bb[_0xd8b9('0x2b')][_0xd8b9('0x3b')]){_0x5961fc['include']=[{'all':!![]}];}_0x5961fc=_[_0xd8b9('0x38')]({},_0x5961fc,_0x5ee1bb[_0xd8b9('0x3a')]);return db['SmsApplication']['find'](_0x5961fc)['then'](handleEntityNotFound(_0x17d395,null))[_0xd8b9('0x20')](respondWithResult(_0x17d395,null))[_0xd8b9('0x40')](handleError(_0x17d395,null));};exports[_0xd8b9('0x44')]=function(_0x30f64b,_0x4eb5f8){return db[_0xd8b9('0x3d')][_0xd8b9('0x44')](_0x30f64b[_0xd8b9('0x45')],{})[_0xd8b9('0x20')](respondWithResult(_0x4eb5f8,0xc9))['catch'](handleError(_0x4eb5f8,null));};exports[_0xd8b9('0x46')]=function(_0x1b670c,_0x339546){if(_0x1b670c[_0xd8b9('0x45')]['id']){delete _0x1b670c[_0xd8b9('0x45')]['id'];}return db[_0xd8b9('0x3d')][_0xd8b9('0x47')]({'where':{'id':_0x1b670c[_0xd8b9('0x42')]['id']}})[_0xd8b9('0x20')](handleEntityNotFound(_0x339546,null))['then'](saveUpdates(_0x1b670c[_0xd8b9('0x45')],null))[_0xd8b9('0x20')](respondWithResult(_0x339546,null))['catch'](handleError(_0x339546,null));};exports['destroy']=function(_0xb21bd3,_0x17d24c){return db[_0xd8b9('0x3d')][_0xd8b9('0x47')]({'where':{'id':_0xb21bd3[_0xd8b9('0x42')]['id']}})[_0xd8b9('0x20')](handleEntityNotFound(_0x17d24c,null))['then'](removeEntity(_0x17d24c,null))[_0xd8b9('0x40')](handleError(_0x17d24c,null));}; \ No newline at end of file +var _0xca39=['send','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','SmsApplication','includeAll','include','findAll','show','catch','body','params','find','html-pdf','rimraf','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca39,0xa7));var _0x9ca3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xca39[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x9ca3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ca3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9ca3('0x2'));var Mustache=require(_0x9ca3('0x3'));var util=require(_0x9ca3('0x4'));var path=require(_0x9ca3('0x5'));var sox=require('sox');var csv=require(_0x9ca3('0x6'));var ejs=require(_0x9ca3('0x7'));var fs=require('fs');var _=require(_0x9ca3('0x8'));var squel=require(_0x9ca3('0x9'));var crypto=require(_0x9ca3('0xa'));var jsforce=require(_0x9ca3('0xb'));var deskjs=require(_0x9ca3('0xc'));var toCsv=require(_0x9ca3('0x6'));var querystring=require('querystring');var Papa=require(_0x9ca3('0xd'));var Redis=require(_0x9ca3('0xe'));var authService=require(_0x9ca3('0xf'));var qs=require(_0x9ca3('0x10'));var as=require(_0x9ca3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ca3('0x12'))('api');var utils=require(_0x9ca3('0x13'));var config=require('../../config/environment');var db=require(_0x9ca3('0x14'))['db'];function respondWithStatusCode(_0x1faf9d,_0x224da5){_0x224da5=_0x224da5||0xcc;return function(_0x3c68ba){if(_0x3c68ba){return _0x1faf9d[_0x9ca3('0x15')](_0x224da5);}return _0x1faf9d['status'](_0x224da5)[_0x9ca3('0x16')]();};}function respondWithResult(_0x5974f4,_0x33dfc2){_0x33dfc2=_0x33dfc2||0xc8;return function(_0x186323){if(_0x186323){return _0x5974f4[_0x9ca3('0x17')](_0x33dfc2)[_0x9ca3('0x18')](_0x186323);}};}function respondWithFilteredResult(_0x4c61fb,_0x93b580){return function(_0x31d14b){if(_0x31d14b){var _0x5cd748=_0x31d14b[_0x9ca3('0x19')],_0x596d6a=_0x93b580[_0x9ca3('0x1a')],_0x4e4acc=_0x93b580[_0x9ca3('0x1a')]+_0x93b580[_0x9ca3('0x1b')],_0x1b2278;if(_0x4e4acc>=_0x5cd748){_0x4e4acc=_0x5cd748;_0x1b2278=0xc8;}else{_0x1b2278=0xce;}_0x4c61fb['status'](_0x1b2278);return _0x4c61fb[_0x9ca3('0x1c')]('Content-Range',_0x596d6a+'-'+_0x4e4acc+'/'+_0x5cd748)['json'](_0x31d14b);}return null;};}function patchUpdates(_0xa82cb9){return function(_0x545e66){try{jsonpatch[_0x9ca3('0x1d')](_0x545e66,_0xa82cb9,!![]);}catch(_0x5d33f7){return BPromise[_0x9ca3('0x1e')](_0x5d33f7);}return _0x545e66[_0x9ca3('0x1f')]();};}function saveUpdates(_0x613d73,_0x26ab79){return function(_0x2350c0){if(_0x2350c0){return _0x2350c0[_0x9ca3('0x20')](_0x613d73)[_0x9ca3('0x21')](function(_0x593638){return _0x593638;});}return null;};}function removeEntity(_0x530397,_0x3b9f0c){return function(_0x457321){if(_0x457321){return _0x457321[_0x9ca3('0x22')]()[_0x9ca3('0x21')](function(){_0x530397['status'](0xcc)[_0x9ca3('0x16')]();});}};}function handleEntityNotFound(_0x1967ee,_0x2076be){return function(_0x414ced){if(!_0x414ced){_0x1967ee[_0x9ca3('0x15')](0x194);}return _0x414ced;};}function handleError(_0x271939,_0xb65eb2){_0xb65eb2=_0xb65eb2||0x1f4;return function(_0x42bf9c){logger['error'](_0x42bf9c[_0x9ca3('0x23')]);if(_0x42bf9c[_0x9ca3('0x24')]){delete _0x42bf9c['name'];}_0x271939[_0x9ca3('0x17')](_0xb65eb2)[_0x9ca3('0x25')](_0x42bf9c);};}exports[_0x9ca3('0x26')]=function(_0x376b12,_0x354d27){var _0x4fae62={},_0x422efe={},_0x5b8c5f={'count':0x0,'rows':[]};var _0x2642ba=_[_0x9ca3('0x27')](db['SmsApplication'][_0x9ca3('0x28')],function(_0x3cbe07){return{'name':_0x3cbe07[_0x9ca3('0x29')],'type':_0x3cbe07[_0x9ca3('0x2a')][_0x9ca3('0x2b')]};});_0x422efe[_0x9ca3('0x2c')]=_[_0x9ca3('0x27')](_0x2642ba,_0x9ca3('0x24'));_0x422efe['query']=_['keys'](_0x376b12['query']);_0x422efe[_0x9ca3('0x2d')]=_[_0x9ca3('0x2e')](_0x422efe['model'],_0x422efe['query']);_0x4fae62[_0x9ca3('0x2f')]=_[_0x9ca3('0x2e')](_0x422efe[_0x9ca3('0x2c')],qs['fields'](_0x376b12[_0x9ca3('0x30')][_0x9ca3('0x31')]));_0x4fae62[_0x9ca3('0x2f')]=_0x4fae62[_0x9ca3('0x2f')][_0x9ca3('0x32')]?_0x4fae62['attributes']:_0x422efe[_0x9ca3('0x2c')];if(!_0x376b12[_0x9ca3('0x30')][_0x9ca3('0x33')](_0x9ca3('0x34'))){_0x4fae62['limit']=qs['limit'](_0x376b12['query']['limit']);_0x4fae62[_0x9ca3('0x1a')]=qs['offset'](_0x376b12[_0x9ca3('0x30')][_0x9ca3('0x1a')]);}_0x4fae62['order']=qs[_0x9ca3('0x35')](_0x376b12[_0x9ca3('0x30')]['sort']);_0x4fae62[_0x9ca3('0x36')]=qs['filters'](_[_0x9ca3('0x37')](_0x376b12[_0x9ca3('0x30')],_0x422efe['filters']));if(_0x376b12['query'][_0x9ca3('0x38')]){_0x4fae62[_0x9ca3('0x36')]=_['merge'](_0x4fae62[_0x9ca3('0x36')],{'$or':_[_0x9ca3('0x27')](_0x2642ba,function(_0x478dda){if(_0x478dda[_0x9ca3('0x2a')]!=='VIRTUAL'){var _0x18884f={};_0x18884f[_0x478dda[_0x9ca3('0x24')]]={'$like':'%'+_0x376b12[_0x9ca3('0x30')][_0x9ca3('0x38')]+'%'};return _0x18884f;}})});}_0x4fae62=_[_0x9ca3('0x39')]({},_0x4fae62,_0x376b12[_0x9ca3('0x3a')]);var _0x53caba={'where':_0x4fae62['where']};return db[_0x9ca3('0x3b')][_0x9ca3('0x19')](_0x53caba)[_0x9ca3('0x21')](function(_0x32af4b){_0x5b8c5f[_0x9ca3('0x19')]=_0x32af4b;if(_0x376b12[_0x9ca3('0x30')][_0x9ca3('0x3c')]){_0x4fae62[_0x9ca3('0x3d')]=[{'all':!![]}];}return db[_0x9ca3('0x3b')][_0x9ca3('0x3e')](_0x4fae62);})[_0x9ca3('0x21')](function(_0x4693a4){_0x5b8c5f['rows']=_0x4693a4;return _0x5b8c5f;})[_0x9ca3('0x21')](respondWithFilteredResult(_0x354d27,_0x4fae62))['catch'](handleError(_0x354d27,null));};exports[_0x9ca3('0x3f')]=function(_0x2b7d6e,_0x25b93a){var _0x15838b={'raw':!![],'where':{'id':_0x2b7d6e['params']['id']}},_0x413a16={};_0x413a16[_0x9ca3('0x2c')]=_['keys'](db[_0x9ca3('0x3b')][_0x9ca3('0x28')]);_0x413a16[_0x9ca3('0x30')]=_['keys'](_0x2b7d6e[_0x9ca3('0x30')]);_0x413a16[_0x9ca3('0x2d')]=_[_0x9ca3('0x2e')](_0x413a16[_0x9ca3('0x2c')],_0x413a16['query']);_0x15838b['attributes']=_[_0x9ca3('0x2e')](_0x413a16['model'],qs[_0x9ca3('0x31')](_0x2b7d6e['query'][_0x9ca3('0x31')]));_0x15838b[_0x9ca3('0x2f')]=_0x15838b['attributes'][_0x9ca3('0x32')]?_0x15838b['attributes']:_0x413a16[_0x9ca3('0x2c')];if(_0x2b7d6e[_0x9ca3('0x30')][_0x9ca3('0x3c')]){_0x15838b[_0x9ca3('0x3d')]=[{'all':!![]}];}_0x15838b=_[_0x9ca3('0x39')]({},_0x15838b,_0x2b7d6e[_0x9ca3('0x3a')]);return db[_0x9ca3('0x3b')]['find'](_0x15838b)['then'](handleEntityNotFound(_0x25b93a,null))['then'](respondWithResult(_0x25b93a,null))['catch'](handleError(_0x25b93a,null));};exports['create']=function(_0x1eee83,_0xf42449){return db[_0x9ca3('0x3b')]['create'](_0x1eee83['body'],{})[_0x9ca3('0x21')](respondWithResult(_0xf42449,0xc9))[_0x9ca3('0x40')](handleError(_0xf42449,null));};exports['update']=function(_0x2ed24e,_0x53417f){if(_0x2ed24e[_0x9ca3('0x41')]['id']){delete _0x2ed24e['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0x2ed24e[_0x9ca3('0x42')]['id']}})[_0x9ca3('0x21')](handleEntityNotFound(_0x53417f,null))[_0x9ca3('0x21')](saveUpdates(_0x2ed24e['body'],null))[_0x9ca3('0x21')](respondWithResult(_0x53417f,null))[_0x9ca3('0x40')](handleError(_0x53417f,null));};exports[_0x9ca3('0x22')]=function(_0x353818,_0x42d04a){return db[_0x9ca3('0x3b')][_0x9ca3('0x43')]({'where':{'id':_0x353818[_0x9ca3('0x42')]['id']}})['then'](handleEntityNotFound(_0x42d04a,null))[_0x9ca3('0x21')](removeEntity(_0x42d04a,null))[_0x9ca3('0x40')](handleError(_0x42d04a,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index f88a82d..1fb4ec7 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 _0x7e76=['../../config/environment','./smsApplication.attributes','define','sms_applications','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x27bca4,_0xc692ab){var _0x1b0602=function(_0x48cf1a){while(--_0x48cf1a){_0x27bca4['push'](_0x27bca4['shift']());}};_0x1b0602(++_0xc692ab);}(_0x7e76,0x16d));var _0x67e7=function(_0xf80b7e,_0xb4051f){_0xf80b7e=_0xf80b7e-0x0;var _0x5e4789=_0x7e76[_0xf80b7e];return _0x5e4789;};'use strict';var _=require('lodash');var util=require(_0x67e7('0x0'));var logger=require(_0x67e7('0x1'))(_0x67e7('0x2'));var moment=require(_0x67e7('0x3'));var BPromise=require(_0x67e7('0x4'));var rp=require(_0x67e7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67e7('0x6'));var config=require(_0x67e7('0x7'));var attributes=require(_0x67e7('0x8'));module['exports']=function(_0xb0f894,_0x51ac36){return _0xb0f894[_0x67e7('0x9')]('SmsApplication',attributes,{'tableName':_0x67e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67e7('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2e0e=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1546c1,_0x23f8da){var _0x2725b6=function(_0x379307){while(--_0x379307){_0x1546c1['push'](_0x1546c1['shift']());}};_0x2725b6(++_0x23f8da);}(_0x2e0e,0x107));var _0xe2e0=function(_0x549c4f,_0x1aee1d){_0x549c4f=_0x549c4f-0x0;var _0x2ad5dc=_0x2e0e[_0x549c4f];return _0x2ad5dc;};'use strict';var _=require(_0xe2e0('0x0'));var util=require(_0xe2e0('0x1'));var logger=require(_0xe2e0('0x2'))(_0xe2e0('0x3'));var moment=require(_0xe2e0('0x4'));var BPromise=require('bluebird');var rp=require(_0xe2e0('0x5'));var fs=require('fs');var path=require(_0xe2e0('0x6'));var rimraf=require(_0xe2e0('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xe2e0('0x8')]=function(_0x508057,_0xcb71ab){return _0x508057['define']('SmsApplication',attributes,{'tableName':_0xe2e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe2e0('0xa'),'collate':_0xe2e0('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6da507d..07b4368 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 _0x891b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment'];(function(_0x291385,_0xee933d){var _0x22ba99=function(_0x3156ab){while(--_0x3156ab){_0x291385['push'](_0x291385['shift']());}};_0x22ba99(++_0xee933d);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb891('0x0'));var BPromise=require(_0xb891('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb891('0x2'));var db=require(_0xb891('0x3'))['db'];var utils=require(_0xb891('0x4'));var logger=require(_0xb891('0x5'))('rpc');var config=require(_0xb891('0x6'));var jayson=require(_0xb891('0x7'));var client=jayson['client'][_0xb891('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eda97,_0x47ecc2,_0x5521f0){return new BPromise(function(_0x134dc0,_0x367478){return client[_0xb891('0x9')](_0x4eda97,_0x5521f0)[_0xb891('0xa')](function(_0x1ab1d6){logger[_0xb891('0xb')](_0xb891('0xc'),_0x47ecc2,'request\x20sent');logger[_0xb891('0xd')](_0xb891('0xe'),_0x47ecc2,_0xb891('0xf'),JSON[_0xb891('0x10')](_0x1ab1d6));if(_0x1ab1d6[_0xb891('0x11')]){if(_0x1ab1d6[_0xb891('0x11')][_0xb891('0x12')]===0x1f4){logger[_0xb891('0x11')](_0xb891('0xc'),_0x47ecc2,_0x1ab1d6[_0xb891('0x11')][_0xb891('0x13')]);return _0x367478(_0x1ab1d6['error'][_0xb891('0x13')]);}logger[_0xb891('0x11')](_0xb891('0xc'),_0x47ecc2,_0x1ab1d6['error'][_0xb891('0x13')]);return _0x134dc0(_0x1ab1d6[_0xb891('0x11')]['message']);}else{logger[_0xb891('0xb')]('SmsApplication,\x20%s,\x20%s',_0x47ecc2,_0xb891('0xf'));_0x134dc0(_0x1ab1d6[_0xb891('0x14')][_0xb891('0x13')]);}})[_0xb891('0x15')](function(_0x1fd866){logger[_0xb891('0x11')]('SmsApplication,\x20%s,\x20%s',_0x47ecc2,_0x1fd866);_0x367478(_0x1fd866);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x42e1e0,_0x215a69){var _0x421181=function(_0x2b9437){while(--_0x2b9437){_0x42e1e0['push'](_0x42e1e0['shift']());}};_0x421181(++_0x215a69);}(_0x55ca,0x126));var _0xa55c=function(_0x119e7a,_0x3949d3){_0x119e7a=_0x119e7a-0x0;var _0x1fb90a=_0x55ca[_0x119e7a];return _0x1fb90a;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SmsApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SmsApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 6f0553d..9f95de7 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 _0xdaa1=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','smsinteraction:addtags','addTags','sms','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','show'];(function(_0x2e9820,_0x37a299){var _0x49b764=function(_0x58e771){while(--_0x58e771){_0x2e9820['push'](_0x2e9820['shift']());}};_0x49b764(++_0x37a299);}(_0xdaa1,0x17d));var _0x1daa=function(_0x307ca7,_0x1340d){_0x307ca7=_0x307ca7-0x0;var _0x9e13c1=_0xdaa1[_0x307ca7];return _0x9e13c1;};'use strict';var multer=require(_0x1daa('0x0'));var util=require(_0x1daa('0x1'));var path=require(_0x1daa('0x2'));var timeout=require(_0x1daa('0x3'));var express=require(_0x1daa('0x4'));var router=express[_0x1daa('0x5')]();var auth=require(_0x1daa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1daa('0x7'));var controller=require(_0x1daa('0x8'));router['get']('/',auth[_0x1daa('0x9')](),controller[_0x1daa('0xa')]);router['get'](_0x1daa('0xb'),auth[_0x1daa('0x9')](),controller[_0x1daa('0xc')]);router[_0x1daa('0xd')]('/:id',auth[_0x1daa('0x9')](),controller[_0x1daa('0xe')]);router[_0x1daa('0xd')](_0x1daa('0xf'),auth['isAuthenticated'](),controller[_0x1daa('0x10')]);router['get'](_0x1daa('0x11'),auth[_0x1daa('0x9')](),controller[_0x1daa('0x12')]);router[_0x1daa('0x13')]('/',auth[_0x1daa('0x9')](),controller[_0x1daa('0x14')]);router[_0x1daa('0x13')]('/:id/messages',auth[_0x1daa('0x9')](),controller[_0x1daa('0x15')]);router[_0x1daa('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1daa('0x16')]('sms',_0x1daa('0x17')),controller[_0x1daa('0x18')]);router['put']('/:id',auth[_0x1daa('0x9')](),interaction['tracked'](_0x1daa('0x19'),_0x1daa('0x1a')),controller[_0x1daa('0x1b')]);router[_0x1daa('0x1c')](_0x1daa('0x1d'),auth[_0x1daa('0x9')](),interaction[_0x1daa('0x16')]('sms',_0x1daa('0x1e')),controller['destroy']);router[_0x1daa('0x1c')](_0x1daa('0x1f'),auth[_0x1daa('0x9')](),controller['removeTags']);module[_0x1daa('0x20')]=router; \ No newline at end of file +var _0x236c=['./smsInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','addTags','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x236c,0x155));var _0xc236=function(_0x599c2c,_0x23687a){_0x599c2c=_0x599c2c-0x0;var _0x6a7094=_0x236c[_0x599c2c];return _0x6a7094;};'use strict';var multer=require(_0xc236('0x0'));var util=require('util');var path=require(_0xc236('0x1'));var timeout=require(_0xc236('0x2'));var express=require(_0xc236('0x3'));var router=express[_0xc236('0x4')]();var auth=require(_0xc236('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc236('0x6'));var controller=require(_0xc236('0x7'));router[_0xc236('0x8')]('/',auth[_0xc236('0x9')](),controller[_0xc236('0xa')]);router[_0xc236('0x8')]('/describe',auth[_0xc236('0x9')](),controller[_0xc236('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc236('0xc')]);router['get'](_0xc236('0xd'),auth[_0xc236('0x9')](),controller[_0xc236('0xe')]);router[_0xc236('0x8')](_0xc236('0xf'),auth['isAuthenticated'](),controller[_0xc236('0x10')]);router[_0xc236('0x11')]('/',auth['isAuthenticated'](),controller[_0xc236('0x12')]);router[_0xc236('0x11')]('/:id/messages',auth[_0xc236('0x9')](),controller['addMessage']);router['post'](_0xc236('0x13'),auth[_0xc236('0x9')](),interaction[_0xc236('0x14')](_0xc236('0x15'),'smsinteraction:addtags'),controller[_0xc236('0x16')]);router['put']('/:id',auth[_0xc236('0x9')](),interaction[_0xc236('0x14')](_0xc236('0x15'),_0xc236('0x17')),controller[_0xc236('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0xc236('0x14')](_0xc236('0x15'),_0xc236('0x19')),controller['destroy']);router[_0xc236('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc236('0x1b')]);module[_0xc236('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index e9c3b9c..17e16d7 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 _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x48b912,_0xd64d60){var _0xc5ecce=function(_0xb33bbc){while(--_0xb33bbc){_0x48b912['push'](_0x48b912['shift']());}};_0xc5ecce(++_0xd64d60);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0xf1d26c,_0x1463d0){var _0x11c159=function(_0x3f71e8){while(--_0x3f71e8){_0xf1d26c['push'](_0xf1d26c['shift']());}};_0x11c159(++_0x1463d0);}(_0x757a,0xde));var _0xa757=function(_0x3046d8,_0x502d84){_0x3046d8=_0x3046d8-0x0;var _0x3bbeb6=_0x757a[_0x3046d8];return _0x3bbeb6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa757('0x0'));module[_0xa757('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa757('0x2')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'read1stAt':{'type':Sequelize[_0xa757('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa757('0x4')]('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa757('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa757('0x5')),'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 b71d150..77b5750 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 _0xf576=['user_has_sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','user','getSmsAccounts','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','show','params','keys','includeAll','include','create','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','nolimit','$gte','format','options','findAll','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','createdAt','direction','read','User','fullname','CmContact','firstName','lastName','SmsAccount','Account','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','\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','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','System','Contact','secret','views','downloadInteraction.html','toFile','transcript-','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','map','TagIds','split','forEach','Tags','push','then','catch','SmsInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','field','color','from','tools_tags','select','u.id'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0xf576,0x96));var _0x6f57=function(_0x41f079,_0x33060c){_0x41f079=_0x41f079-0x0;var _0x56e1de=_0xf576[_0x41f079];return _0x56e1de;};'use strict';var pdf=require(_0x6f57('0x0'));var emlformat=require(_0x6f57('0x1'));var rimraf=require(_0x6f57('0x2'));var zipdir=require(_0x6f57('0x3'));var jsonpatch=require(_0x6f57('0x4'));var rp=require('request-promise');var moment=require(_0x6f57('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6f57('0x6'));var util=require(_0x6f57('0x7'));var path=require(_0x6f57('0x8'));var sox=require(_0x6f57('0x9'));var csv=require(_0x6f57('0xa'));var ejs=require(_0x6f57('0xb'));var fs=require('fs');var _=require(_0x6f57('0xc'));var squel=require(_0x6f57('0xd'));var crypto=require(_0x6f57('0xe'));var jsforce=require(_0x6f57('0xf'));var deskjs=require(_0x6f57('0x10'));var toCsv=require(_0x6f57('0xa'));var querystring=require(_0x6f57('0x11'));var Papa=require(_0x6f57('0x12'));var Redis=require(_0x6f57('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6f57('0x14'));var as=require(_0x6f57('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f57('0x16'))('api');var utils=require(_0x6f57('0x17'));var config=require('../../config/environment');var db=require(_0x6f57('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6f57('0x19'))(new Redis(config[_0x6f57('0x1a')]));require(_0x6f57('0x1b'))[_0x6f57('0x1c')](socket);function respondWithStatusCode(_0x3689f7,_0x4f04e9){_0x4f04e9=_0x4f04e9||0xcc;return function(_0x4cb0a9){if(_0x4cb0a9){return _0x3689f7[_0x6f57('0x1d')](_0x4f04e9);}return _0x3689f7[_0x6f57('0x1e')](_0x4f04e9)[_0x6f57('0x1f')]();};}function respondWithResult(_0x4bd348,_0x58e0cc){_0x58e0cc=_0x58e0cc||0xc8;return function(_0xfaa602){if(_0xfaa602){return _0x4bd348[_0x6f57('0x1e')](_0x58e0cc)['json'](_0xfaa602);}};}function respondWithFilteredResult(_0xdadb1d,_0x154047){return function(_0x52fd3f){if(_0x52fd3f){var _0x560a5f=_0x52fd3f[_0x6f57('0x20')],_0x4a4d0f=_0x154047[_0x6f57('0x21')],_0x4bebdc=_0x154047['offset']+_0x154047[_0x6f57('0x22')],_0x5b960c;if(_0x4bebdc>=_0x560a5f){_0x4bebdc=_0x560a5f;_0x5b960c=0xc8;}else{_0x5b960c=0xce;}_0xdadb1d['status'](_0x5b960c);return _0xdadb1d[_0x6f57('0x23')](_0x6f57('0x24'),_0x4a4d0f+'-'+_0x4bebdc+'/'+_0x560a5f)['json'](_0x52fd3f);}return null;};}function patchUpdates(_0x1c9f72){return function(_0x1c46c8){try{jsonpatch[_0x6f57('0x25')](_0x1c46c8,_0x1c9f72,!![]);}catch(_0x18a502){return BPromise[_0x6f57('0x26')](_0x18a502);}return _0x1c46c8['save']();};}function saveUpdates(_0x242ee9,_0x335254){return function(_0xe421d7){if(_0xe421d7){return _0xe421d7[_0x6f57('0x27')](_0x242ee9)['then'](function(_0x99b071){return _0x99b071;});}return null;};}function removeEntity(_0x5a439b,_0x3c5f8d){return function(_0x39e252){if(_0x39e252){return _0x39e252[_0x6f57('0x28')]()['then'](function(){_0x5a439b[_0x6f57('0x1e')](0xcc)[_0x6f57('0x1f')]();});}};}function handleEntityNotFound(_0x5ac308,_0x56501a){return function(_0xdf0fd4){if(!_0xdf0fd4){_0x5ac308[_0x6f57('0x1d')](0x194);}return _0xdf0fd4;};}function handleError(_0x5f073c,_0x5f31d9){_0x5f31d9=_0x5f31d9||0x1f4;return function(_0x4b5467){logger[_0x6f57('0x29')](_0x4b5467[_0x6f57('0x2a')]);if(_0x4b5467[_0x6f57('0x2b')]){delete _0x4b5467[_0x6f57('0x2b')];}_0x5f073c[_0x6f57('0x1e')](_0x5f31d9)[_0x6f57('0x2c')](_0x4b5467);};}function getInteractionUsers(_0x32996f,_0x4cd692){return new BPromise(function(_0x1bab82,_0x250cfd){try{if(_0x4cd692[_0x32996f['id']]){_0x32996f['Users']=_[_0x6f57('0x2d')](_0x4cd692[_0x32996f['id']],function(_0x3e4133){return{'id':_0x3e4133['id']};});}}catch(_0x35abb8){_0x250cfd(_0x35abb8);}_0x1bab82(_0x32996f);});}function getInteractionTags(_0x5827d1,_0x5cf288){return new BPromise(function(_0x3846e5,_0x588e1d){try{if(_0x5827d1[_0x6f57('0x2e')]){_0x5827d1['Tags']=[];_0x5827d1[_0x6f57('0x2e')][_0x6f57('0x2f')](',')[_0x6f57('0x30')](function(_0x3dd5ba){_0x5827d1[_0x6f57('0x31')][_0x6f57('0x32')](_0x5cf288[_0x3dd5ba]);});}delete _0x5827d1['TagIds'];}catch(_0x2b4a74){_0x588e1d(_0x2b4a74);}_0x3846e5(_0x5827d1);});}function updateSmsInteraction(_0xd40187,_0x9d9245,_0x1992c8){return new BPromise(function(_0x577a38,_0x54960e){return getInteractionUsers(_0xd40187,_0x1992c8)[_0x6f57('0x33')](function(_0x183b92){return getInteractionTags(_0x183b92,_0x9d9245);})[_0x6f57('0x33')](function(_0x342485){_0x577a38(_0x342485);})[_0x6f57('0x34')](function(_0x3eb1d4){_0x54960e(_0x3eb1d4);});});}exports['index']=function(_0x1994da,_0x3a2522){var _0x474990={},_0x135b04={},_0x1a8ecc={'count':0x0,'rows':[]};var _0xaf262=_[_0x6f57('0x2d')](db[_0x6f57('0x35')][_0x6f57('0x36')],function(_0x1d1115){return{'name':_0x1d1115[_0x6f57('0x37')],'type':_0x1d1115[_0x6f57('0x38')][_0x6f57('0x39')]};});_0x135b04[_0x6f57('0x3a')]=_[_0x6f57('0x2d')](_0xaf262,_0x6f57('0x2b'));_0x135b04[_0x6f57('0x3b')]=_['keys'](_0x1994da['query']);_0x135b04[_0x6f57('0x3c')]=_['intersection'](_0x135b04[_0x6f57('0x3a')],_0x135b04[_0x6f57('0x3b')]);_0x474990[_0x6f57('0x3d')]=_[_0x6f57('0x3e')](_0x135b04[_0x6f57('0x3a')],qs[_0x6f57('0x3f')](_0x1994da['query'][_0x6f57('0x3f')]));_0x474990[_0x6f57('0x3d')]=_0x474990[_0x6f57('0x3d')]['length']?_0x474990['attributes']:_0x135b04['model'];if(!_0x1994da[_0x6f57('0x3b')][_0x6f57('0x40')]('nolimit')){_0x474990[_0x6f57('0x22')]=qs[_0x6f57('0x22')](_0x1994da[_0x6f57('0x3b')][_0x6f57('0x22')]);_0x474990[_0x6f57('0x21')]=qs['offset'](_0x1994da[_0x6f57('0x3b')][_0x6f57('0x21')]);}_0x474990[_0x6f57('0x41')]=qs[_0x6f57('0x42')](_0x1994da[_0x6f57('0x3b')]['sort']);_0x474990[_0x6f57('0x43')]=qs['filters'](_[_0x6f57('0x44')](_0x1994da[_0x6f57('0x3b')],_0x135b04[_0x6f57('0x3c')]));var _0x2a5239=[];var _0x5a2bb8=squel['select']()[_0x6f57('0x45')]('id')[_0x6f57('0x45')]('name')[_0x6f57('0x45')](_0x6f57('0x46'))[_0x6f57('0x47')](_0x6f57('0x48'));var _0x221294=squel[_0x6f57('0x49')]()['field'](_0x6f57('0x4a'))[_0x6f57('0x45')]('ui.SmsInteractionId')[_0x6f57('0x47')](_0x6f57('0x4b'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x3befaa=squel[_0x6f57('0x49')]()['from']('sms_interactions','i')[_0x6f57('0x4c')](_0x6f57('0x4d'),'c',_0x6f57('0x4e'))['left_join'](_0x6f57('0x4f'),'o',_0x6f57('0x50'))[_0x6f57('0x4c')](_0x6f57('0x51'),'a',_0x6f57('0x52'))['left_join'](_0x6f57('0x53'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x6f57('0x4c')](_0x6f57('0x54'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x6f57('0x4c')](_0x6f57('0x48'),'t',_0x6f57('0x55'));var _0x1174fb=squel[_0x6f57('0x56')]();var _0x1f362a=[];var _0x75cb7b=squel[_0x6f57('0x56')]();var _0x24e9d5;if(_0x1994da[_0x6f57('0x3b')][_0x6f57('0x57')]){_0x24e9d5=as[_0x6f57('0x58')](_0x1994da[_0x6f57('0x3b')]['search']);var _0x2b9faa=_0x24e9d5[_0x6f57('0x59')];for(var _0x4813e0=0x0;_0x4813e0<_0x24e9d5[_0x6f57('0x5a')]['length'];_0x4813e0++){var _0x2cd73e=_0x24e9d5[_0x6f57('0x5a')][_0x4813e0];var _0x1c7bcd='i';var _0x3bee8c=_[_0x6f57('0x5b')](_0xaf262,['name',_0x2cd73e[_0x6f57('0x45')]]);if(!_0x3bee8c){switch(_0x2cd73e['field']){case _0x6f57('0x5c'):if(_0x2cd73e['value']==0x1){_0x3befaa[_0x6f57('0x5d')]('`'+_0x2cd73e[_0x6f57('0x45')]+_0x6f57('0x5e'));}else{_0x3befaa[_0x6f57('0x5d')]('`'+_0x2cd73e[_0x6f57('0x45')]+_0x6f57('0x5f'));}break;case'Contact':if(_0x2cd73e[_0x6f57('0x60')]===_0x6f57('0x61')){if(_0x2cd73e[_0x6f57('0x62')][_0x6f57('0x2f')]('\x20')[_0x6f57('0x63')]>0x1){_0x1174fb[_0x2b9faa](_0x6f57('0x64'),qs[_0x6f57('0x65')](_0x2cd73e[_0x6f57('0x62')]),null);}else{var _0x10ecd3='%'+_0x2cd73e[_0x6f57('0x62')]+'%';_0x1174fb[_0x2b9faa](_0x6f57('0x66'),_0x10ecd3,_0x10ecd3,_0x10ecd3);}}else{_0x3bee8c=_[_0x6f57('0x5b')](_0xaf262,[_0x6f57('0x2b'),_0x6f57('0x67')]);_0x2cd73e['field']=_0x6f57('0x67');_0x2c5ecb=as[_0x6f57('0x68')](_0x1c7bcd,_0x3bee8c['type'],_0x2cd73e);_0x1174fb[_0x2b9faa](_0x2c5ecb[_0x6f57('0x69')],_0x2c5ecb[_0x6f57('0x62')]['start'],_0x2c5ecb['value'][_0x6f57('0x1f')]);}break;case _0x6f57('0x6a'):var _0x45c9e1=_0x2cd73e[_0x6f57('0x62')][_0x6f57('0x2f')](',')[_0x6f57('0x2d')](function(_0x1bd40d){return Number(_0x1bd40d);});_0x45c9e1[_0x6f57('0x30')](function(_0x20ffd8){_0x75cb7b['or'](_0x6f57('0x6b'),'%,'+_0x20ffd8+',%');});_0x1f362a=_['union'](_0x1f362a,_0x45c9e1);break;case'User':if(_0x2cd73e['operator']===_0x6f57('0x61')){_0x1174fb[_0x2b9faa](_0x6f57('0x6c'),'%'+_0x2cd73e['value']+'%',null);}else{_0x3bee8c=_[_0x6f57('0x5b')](_0xaf262,[_0x6f57('0x2b'),_0x6f57('0x6d')]);_0x2cd73e[_0x6f57('0x45')]=_0x6f57('0x6d');_0x2c5ecb=as[_0x6f57('0x68')](_0x1c7bcd,_0x3bee8c[_0x6f57('0x38')],_0x2cd73e);_0x1174fb[_0x2b9faa](_0x2c5ecb[_0x6f57('0x69')],_0x2c5ecb[_0x6f57('0x62')][_0x6f57('0x6e')],_0x2c5ecb[_0x6f57('0x62')][_0x6f57('0x1f')]);}break;case _0x6f57('0x6f'):_0x2c5ecb=as[_0x6f57('0x68')]('me',null,_0x2cd73e);_0x1174fb[_0x2b9faa](_0x2c5ecb[_0x6f57('0x69')],_0x2c5ecb[_0x6f57('0x62')][_0x6f57('0x6e')],_0x2c5ecb[_0x6f57('0x62')][_0x6f57('0x1f')]);break;}}else{var _0x2c5ecb=as[_0x6f57('0x68')](_0x1c7bcd,_0x3bee8c['type'],_0x2cd73e);_0x1174fb[_0x2b9faa](_0x2c5ecb[_0x6f57('0x69')],_0x2c5ecb['value'][_0x6f57('0x6e')],_0x2c5ecb[_0x6f57('0x62')][_0x6f57('0x1f')]);}}}else{var _0x16d50e=_(_0x1994da['query'])['keys']()['map'](function(_0x3d4cb4){return _['some'](_0xaf262,[_0x6f57('0x2b'),_0x3d4cb4])?_0x3d4cb4:undefined;})[_0x6f57('0x70')]()[_0x6f57('0x62')]();if(!_[_0x6f57('0x71')](_0x16d50e)){_0x16d50e[_0x6f57('0x30')](function(_0x3aaa08){if(_0x3aaa08===_0x6f57('0x72')){_0x3befaa[_0x6f57('0x43')](_0x6f57('0x73'),[][_0x6f57('0x74')](_0x1994da[_0x6f57('0x3b')][_0x3aaa08]));}else if(_0x3aaa08==='createdAt'){var _0x5621bb=JSON[_0x6f57('0x75')](_0x1994da[_0x6f57('0x3b')][_0x3aaa08])['$gte'];var _0x4e9f37=JSON[_0x6f57('0x75')](_0x1994da[_0x6f57('0x3b')][_0x3aaa08])[_0x6f57('0x76')];_0x3befaa[_0x6f57('0x43')](_0x6f57('0x77'),_0x5621bb,_0x4e9f37);}else{if(_0x1994da[_0x6f57('0x3b')][_0x3aaa08]==='null'){_0x3befaa[_0x6f57('0x43')]('i.'+_0x3aaa08+'\x20IS\x20NULL');}else{_0x3befaa[_0x6f57('0x43')]('i.'+_0x3aaa08+_0x6f57('0x78'),_0x1994da['query'][_0x3aaa08]);}}});}if(_0x1994da['query']['read']){if(_0x1994da['query']['read']==0x1){_0x3befaa[_0x6f57('0x5d')](_0x6f57('0x79'));}else{_0x3befaa[_0x6f57('0x5d')](_0x6f57('0x7a'));}}if(_0x1994da[_0x6f57('0x3b')][_0x6f57('0x7b')]){_0x1f362a=_[_0x6f57('0x7c')](_0x1994da['query'][_0x6f57('0x7b')])?_0x1994da['query']['tag']:new Array(_0x1994da[_0x6f57('0x3b')]['tag']);_0x1f362a[_0x6f57('0x30')](function(_0x208c67){_0x75cb7b['or'](_0x6f57('0x6b'),'%,'+_0x208c67+',%');});}if(_0x1994da[_0x6f57('0x3b')][_0x6f57('0x7d')]){var _0x2eafb3=_0x1994da['query'][_0x6f57('0x7d')][_0x6f57('0x7e')]('\x5c','\x5c\x5c')[_0x6f57('0x7e')]('\x27\x27',_0x6f57('0x7f'));if(qs[_0x6f57('0x80')](_0x2eafb3)){_0x1174fb['or'](_0x6f57('0x81'),_0x2eafb3+'%')['or'](_0x6f57('0x82'),_0x2eafb3+'%');}else{_0x1174fb['or'](_0x6f57('0x83'),qs['getFullTextValue'](_0x2eafb3))['or'](_0x6f57('0x84'),_0x2eafb3+'%');}}}_0x3befaa[_0x6f57('0x43')](_0x1174fb);_0x3befaa[_0x6f57('0x85')]('i.id');var _0x261754={'type':db[_0x6f57('0x86')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5a270c=_0x3befaa['clone']();_0x5a270c[_0x6f57('0x45')]('i.id');_0x5a270c['field'](_0x6f57('0x87'),_0x6f57('0x5c'));if(_0x474990[_0x6f57('0x41')]){_0x474990['order'][_0x6f57('0x30')](function(_0x2c23e4){_0x3befaa[_0x6f57('0x41')]('i.'+_0x2c23e4[0x0],_0x2c23e4[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6f57('0x71')](_0x1f362a)){_0x3befaa['having'](_0x75cb7b);_0x5a270c[_0x6f57('0x43')](_0x6f57('0x88'),_0x1f362a);}BPromise[_0x6f57('0x89')]()[_0x6f57('0x33')](function(){if(!_0x24e9d5)return;return _0x1994da[_0x6f57('0x8a')][_0x6f57('0x8b')]({'attributes':['id'],'raw':!![]})[_0x6f57('0x33')](function(_0x936508){_0x5a270c[_0x6f57('0x43')](_0x6f57('0x73'),_['map'](_0x936508,'id'));_0x3befaa[_0x6f57('0x43')](_0x6f57('0x73'),_['map'](_0x936508,'id'));});})['then'](function(){db[_0x6f57('0x8c')]['query'](_0x5a270c[_0x6f57('0x8d')](),_0x261754)[_0x6f57('0x33')](function(_0x143598){_0x1a8ecc['count']=_0x143598[_0x6f57('0x63')];if(_0x1a8ecc[_0x6f57('0x20')]===0x0)return[];return db[_0x6f57('0x8c')][_0x6f57('0x3b')](_0x5a2bb8[_0x6f57('0x8d')](),_0x261754)['then'](function(_0x4d4905){_0x2a5239=_['keyBy'](_0x4d4905,'id');_0x261754=_[_0x6f57('0x8e')](_0x261754,{'model':db[_0x6f57('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3befaa['field'](_0x6f57('0x87'),_0x6f57('0x5c'));_0x3befaa[_0x6f57('0x45')]('a.key',_0x6f57('0x8f'));_0x3befaa[_0x6f57('0x45')](_0x6f57('0x90'),_0x6f57('0x91'));_0x3befaa[_0x6f57('0x45')](_0x6f57('0x92'));_0x3befaa[_0x6f57('0x45')](_0x6f57('0x93'),'Contact.firstName');_0x3befaa['field'](_0x6f57('0x94'),_0x6f57('0x95'));_0x3befaa[_0x6f57('0x45')](_0x6f57('0x96'),_0x6f57('0x97'));_0x3befaa['field'](_0x6f57('0x98'),_0x6f57('0x99'));_0x3befaa[_0x6f57('0x45')]('c.mobile','Contact.mobile');_0x3befaa['field'](_0x6f57('0x9a'),_0x6f57('0x9b'));_0x3befaa['field'](_0x6f57('0x9c'),_0x6f57('0x2e'));_0x3befaa[_0x6f57('0x22')](_0x474990[_0x6f57('0x22')]);_0x3befaa[_0x6f57('0x21')](_0x474990['offset']);return db[_0x6f57('0x8c')]['query'](_0x3befaa[_0x6f57('0x8d')](),_0x261754);})['then'](function(_0x53db59){_0x221294[_0x6f57('0x43')]('ui.SmsInteractionId\x20IN\x20?',_[_0x6f57('0x2d')](_0x53db59,'id'));return db[_0x6f57('0x8c')][_0x6f57('0x3b')](_0x221294[_0x6f57('0x8d')](),_0x261754)['then'](function(_0x2c80be){var _0x4de540=_[_0x6f57('0x9d')](_0x2c80be,_0x6f57('0x9e'));var _0x358b32=[];_0x53db59['forEach'](function(_0x287fa6){_0x358b32['push'](updateSmsInteraction(_0x287fa6,_0x2a5239,_0x4de540));});return BPromise['all'](_0x358b32);});});})['then'](function(_0x15b621){_0x1a8ecc['rows']=_0x15b621;return _0x1a8ecc;})['then'](respondWithFilteredResult(_0x3a2522,_0x474990));})[_0x6f57('0x34')](handleError(_0x3a2522,null));};exports[_0x6f57('0x9f')]=function(_0x26425b,_0x4807d9){var _0xca421a={'raw':![],'where':{'id':_0x26425b[_0x6f57('0xa0')]['id']}},_0xbade4d={};_0xbade4d[_0x6f57('0x3a')]=_[_0x6f57('0xa1')](db[_0x6f57('0x35')]['rawAttributes']);_0xbade4d[_0x6f57('0x3b')]=_['keys'](_0x26425b['query']);_0xbade4d[_0x6f57('0x3c')]=_[_0x6f57('0x3e')](_0xbade4d['model'],_0xbade4d[_0x6f57('0x3b')]);_0xca421a[_0x6f57('0x3d')]=_[_0x6f57('0x3e')](_0xbade4d['model'],qs[_0x6f57('0x3f')](_0x26425b[_0x6f57('0x3b')]['fields']));_0xca421a[_0x6f57('0x3d')]=_0xca421a['attributes']['length']?_0xca421a[_0x6f57('0x3d')]:_0xbade4d[_0x6f57('0x3a')];if(_0x26425b['query'][_0x6f57('0xa2')]){_0xca421a[_0x6f57('0xa3')]=[{'all':!![]}];}_0xca421a=_[_0x6f57('0x8e')]({},_0xca421a,_0x26425b['options']);return db['SmsInteraction'][_0x6f57('0x5b')](_0xca421a)[_0x6f57('0x33')](handleEntityNotFound(_0x4807d9,null))[_0x6f57('0x33')](respondWithResult(_0x4807d9,null))[_0x6f57('0x34')](handleError(_0x4807d9,null));};exports[_0x6f57('0xa4')]=function(_0x36071c,_0x3dc684){return db[_0x6f57('0x35')][_0x6f57('0xa4')](_0x36071c['body'],{})['then'](respondWithResult(_0x3dc684,0xc9))[_0x6f57('0x34')](handleError(_0x3dc684,null));};exports['update']=function(_0x349a5d,_0x3e06fe){if(_0x349a5d['body']['id']){delete _0x349a5d['body']['id'];}return db[_0x6f57('0x35')][_0x6f57('0x5b')]({'where':{'id':_0x349a5d['params']['id']}})[_0x6f57('0x33')](handleEntityNotFound(_0x3e06fe,null))['then'](saveUpdates(_0x349a5d['body'],null))[_0x6f57('0x33')](respondWithResult(_0x3e06fe,null))['catch'](handleError(_0x3e06fe,null));};exports[_0x6f57('0x28')]=function(_0x4014d7,_0x40b947){return db['SmsInteraction'][_0x6f57('0x5b')]({'where':{'id':_0x4014d7[_0x6f57('0xa0')]['id']}})[_0x6f57('0x33')](handleEntityNotFound(_0x40b947,null))[_0x6f57('0x33')](removeEntity(_0x40b947,null))[_0x6f57('0x34')](handleError(_0x40b947,null));};exports[_0x6f57('0xa5')]=function(_0x2793e5,_0x2be991){return db[_0x6f57('0x35')][_0x6f57('0xa5')]()['then'](respondWithResult(_0x2be991,null))[_0x6f57('0x34')](handleError(_0x2be991,null));};exports[_0x6f57('0xa6')]=function(_0x30dd2a,_0x529f87,_0xc0ba56){return db[_0x6f57('0xa7')]['find']({'where':{'id':_0x30dd2a[_0x6f57('0xa0')]['id']}})[_0x6f57('0x33')](handleEntityNotFound(_0x529f87,null))['then'](function(_0xdf9d71){if(_0xdf9d71){return _0xdf9d71[_0x6f57('0xa6')](_0x30dd2a['body']['ids'],_[_0x6f57('0xa8')](_0x30dd2a[_0x6f57('0x6f')],[_0x6f57('0xa9'),'id'])||{});}})[_0x6f57('0x33')](respondWithResult(_0x529f87,null))[_0x6f57('0x34')](handleError(_0x529f87,null));};exports[_0x6f57('0xaa')]=function(_0x5521d,_0x38102a,_0x573fbe){var _0x29748e={'raw':![],'where':{}};var _0x5bb094={};var _0x52de30={'count':0x0,'rows':[]};return db[_0x6f57('0x35')][_0x6f57('0xab')]({'where':{'id':_0x5521d[_0x6f57('0xa0')]['id']}})[_0x6f57('0x33')](handleEntityNotFound(_0x38102a,null))[_0x6f57('0x33')](function(_0x5eed79){if(_0x5eed79){_0x5bb094[_0x6f57('0x3a')]=_[_0x6f57('0xa1')](db[_0x6f57('0xa7')][_0x6f57('0x36')]);_0x5bb094[_0x6f57('0x3b')]=_[_0x6f57('0xa1')](_0x5521d['query']);_0x5bb094['filters']=_[_0x6f57('0x3e')](_0x5bb094['model'],_0x5bb094['query']);_0x29748e['attributes']=_[_0x6f57('0x3e')](_0x5bb094['model'],qs[_0x6f57('0x3f')](_0x5521d['query'][_0x6f57('0x3f')]));_0x29748e[_0x6f57('0x3d')]=_0x29748e[_0x6f57('0x3d')][_0x6f57('0x63')]?_0x29748e[_0x6f57('0x3d')]:_0x5bb094[_0x6f57('0x3a')];if(!_0x5521d['query'][_0x6f57('0x40')](_0x6f57('0xac'))){_0x29748e[_0x6f57('0x22')]=qs[_0x6f57('0x22')](_0x5521d[_0x6f57('0x3b')][_0x6f57('0x22')]);_0x29748e['offset']=qs[_0x6f57('0x21')](_0x5521d[_0x6f57('0x3b')][_0x6f57('0x21')]);}_0x29748e['order']=qs['sort'](_0x5521d['query'][_0x6f57('0x42')]);_0x29748e[_0x6f57('0x43')]=qs[_0x6f57('0x3c')](_[_0x6f57('0x44')](_0x5521d[_0x6f57('0x3b')],_0x5bb094[_0x6f57('0x3c')]));_0x29748e['where'][_0x6f57('0x9e')]=_0x5eed79['id'];if(_0x5521d[_0x6f57('0x3b')][_0x6f57('0x7d')]){_0x29748e[_0x6f57('0x43')]=_['merge'](_0x29748e[_0x6f57('0x43')],{'$or':_['map'](_0x29748e[_0x6f57('0x3d')],function(_0x1b05a1){var _0x47d1eb={};_0x47d1eb[_0x1b05a1]={'$like':'%'+_0x5521d[_0x6f57('0x3b')]['filter']+'%'};return _0x47d1eb;})});}if(_0x5521d[_0x6f57('0x3b')][_0x6f57('0xad')]){var _0x330f98=_0x5521d[_0x6f57('0x3b')]['$gte'][_0x6f57('0x2f')](',');var _0x2f74f8={};_0x2f74f8[_0x330f98[0x0]]={'$gte':moment(_0x330f98[0x1])[_0x6f57('0xae')]('YYYY-MM-DD\x20HH:mm:ss')};_0x29748e[_0x6f57('0x43')]=_[_0x6f57('0x8e')](_0x29748e[_0x6f57('0x43')],_0x2f74f8);}_0x29748e=_[_0x6f57('0x8e')]({},_0x29748e,_0x5521d[_0x6f57('0xaf')]);return db['SmsMessage'][_0x6f57('0x20')]({'where':_0x29748e['where']})[_0x6f57('0x33')](function(_0x405331){_0x52de30[_0x6f57('0x20')]=_0x405331;if(_0x5521d[_0x6f57('0x3b')][_0x6f57('0xa2')]){_0x29748e[_0x6f57('0xa3')]=[{'all':!![]}];}return db[_0x6f57('0xa7')][_0x6f57('0xb0')](_0x29748e);})[_0x6f57('0x33')](function(_0xc19061){_0x52de30[_0x6f57('0xb1')]=_0xc19061;return _0x52de30;});}})[_0x6f57('0x33')](respondWithFilteredResult(_0x38102a,_0x29748e))[_0x6f57('0x34')](handleError(_0x38102a,null));};exports[_0x6f57('0xb2')]=function(_0x5b52df,_0x3d72df,_0x53076a){return db['SmsInteraction'][_0x6f57('0x5b')]({'where':{'id':_0x5b52df[_0x6f57('0xa0')]['id']}})[_0x6f57('0x33')](handleEntityNotFound(_0x3d72df,null))[_0x6f57('0x33')](function(_0xf62f36){if(_0xf62f36){return _0xf62f36[_0x6f57('0xb3')](_0x5b52df['body'][_0x6f57('0xa9')],_['omit'](_0x5b52df[_0x6f57('0x6f')],[_0x6f57('0xa9'),'id'])||{})[_0x6f57('0xb4')](function(){return db[_0x6f57('0x6a')][_0x6f57('0xb0')]({'attributes':['id',_0x6f57('0x2b'),_0x6f57('0x46')],'where':{'id':_0x5b52df[_0x6f57('0x6f')]['ids']}});})[_0x6f57('0x33')](function(_0x1e6ab1){socket[_0x6f57('0xb5')]('smsInteractionTags:save',{'id':Number(_0x5b52df[_0x6f57('0xa0')]['id']),'tags':_0x1e6ab1||[]});return{'id':Number(_0x5b52df[_0x6f57('0xa0')]['id']),'tags':_0x1e6ab1||[]};});}})[_0x6f57('0x33')](respondWithResult(_0x3d72df,null))[_0x6f57('0x34')](handleError(_0x3d72df,null));};exports[_0x6f57('0xb6')]=function(_0x348bb0,_0x48773b,_0x299088){return db['SmsInteraction'][_0x6f57('0x5b')]({'where':{'id':_0x348bb0['params']['id']}})[_0x6f57('0x33')](handleEntityNotFound(_0x48773b,null))[_0x6f57('0x33')](function(_0x13d58c){if(_0x13d58c){return _0x13d58c[_0x6f57('0xb6')](_0x348bb0[_0x6f57('0x3b')][_0x6f57('0xa9')]);}})[_0x6f57('0x33')](respondWithStatusCode(_0x48773b,null))[_0x6f57('0x34')](handleError(_0x48773b,null));};exports[_0x6f57('0xb7')]=function(_0x9fb6e,_0x4c531d){var _0x2befc3=moment()[_0x6f57('0xb8')]()[_0x6f57('0x8d')]();var _0x4a52ec=path[_0x6f57('0xb9')](config[_0x6f57('0xba')],_0x6f57('0xbb'),_0x6f57('0xbc'),_0x6f57('0xbd'));var _0x496076=path[_0x6f57('0xb9')](config[_0x6f57('0xba')],_0x6f57('0xbb'),_0x6f57('0xbc'),_0x6f57('0xbe'));var _0x52acd6=path[_0x6f57('0xb9')](_0x4a52ec,_0x2befc3);var _0x4dd712=util[_0x6f57('0xae')](_0x6f57('0xbf'),_0x9fb6e['params']['id'],_0x2befc3);var _0x4a5e3b=path[_0x6f57('0xb9')](_0x4a52ec,_0x4dd712);var _0x9e3f4d=![];return db[_0x6f57('0x35')][_0x6f57('0x5b')]({'where':{'id':_0x9fb6e[_0x6f57('0xa0')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x6f57('0xc0'),'attributes':['id',_0x6f57('0x6f'),_0x6f57('0xc1'),_0x6f57('0xc2'),'secret',_0x6f57('0xc3')],'include':[{'model':db[_0x6f57('0xc4')],'as':_0x6f57('0xc4'),'attributes':['id',_0x6f57('0xc5')],'raw':!![]},{'model':db[_0x6f57('0xc6')],'as':'Contact','attributes':['id',_0x6f57('0xc7'),_0x6f57('0xc8')],'raw':!![]}]},{'model':db[_0x6f57('0xc9')],'as':_0x6f57('0xca'),'attributes':['id',_0x6f57('0x2b')]},{'model':db[_0x6f57('0xc4')],'as':_0x6f57('0xcb'),'attributes':['id',_0x6f57('0xc5')]}]})[_0x6f57('0x33')](handleEntityNotFound(_0x4c531d,null))['then'](function(_0x136800){if(_0x136800){var _0x2e8c6d=_0x136800[_0x6f57('0xcc')]({'plain':!![]});_0x9e3f4d=!![];var _0x4429b1={'format':'A4','border':_0x6f57('0xcd'),'header':{'height':_0x6f57('0xce'),'contents':{'first':_0x6f57('0xcf')}},'footer':{'height':_0x6f57('0xd0'),'contents':{'default':util[_0x6f57('0xae')](_0x6f57('0xd1'),util[_0x6f57('0xae')](_0x6f57('0xd2'),'Sms',_0x2e8c6d['id']),moment()[_0x6f57('0xae')](_0x6f57('0xd3'))[_0x6f57('0x8d')]())}}};fs['mkdirSync'](_0x52acd6);var _0x4d617d={'channel':'Sms','account':_0x2e8c6d[_0x6f57('0xca')][_0x6f57('0x2b')],'agent':_0x2e8c6d[_0x6f57('0xcb')]?_0x2e8c6d[_0x6f57('0xcb')][_0x6f57('0xc5')]:_0x6f57('0xd4'),'createdAt':moment(_0x2e8c6d[_0x6f57('0xc1')])[_0x6f57('0xae')](_0x6f57('0xd5'))[_0x6f57('0x8d')](),'closedAt':_0x2e8c6d['closed']?moment(_0x2e8c6d[_0x6f57('0xd6')])[_0x6f57('0xae')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2e8c6d['disposition'],'messages':_(_0x2e8c6d[_0x6f57('0xc0')])[_0x6f57('0x7d')]({'secret':![]})['map'](function(_0x1aab08){return{'date':moment(_0x1aab08['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6f57('0x8d')](),'sender':_0x1aab08[_0x6f57('0xc2')]===_0x6f57('0xd7')?_0x1aab08[_0x6f57('0xc4')]?_0x1aab08['User']['fullname']:_0x6f57('0xd8'):_0x1aab08[_0x6f57('0xd9')]['firstName']+(_0x1aab08[_0x6f57('0xd9')]['lastName']?'\x20'+_0x1aab08[_0x6f57('0xd9')][_0x6f57('0xc8')]:''),'body':_0x1aab08[_0x6f57('0x6f')],'direction':_0x1aab08[_0x6f57('0xc2')]==='out'?'A':'C','secret':_0x1aab08[_0x6f57('0xda')],'read':_0x1aab08['read']};})[_0x6f57('0x62')]()};return ejs['renderFile'](path[_0x6f57('0xb9')](config[_0x6f57('0xba')],_0x6f57('0xbb'),_0x6f57('0xdb'),_0x6f57('0xdc')),{'interaction':_0x4d617d})[_0x6f57('0x33')](function(_0x55aef6){return new BPromise(function(_0x3bf45c,_0x177da6){pdf[_0x6f57('0xa4')](_0x55aef6,_0x4429b1)[_0x6f57('0xdd')](path['join'](_0x52acd6,_0x6f57('0xde')+_0x2e8c6d['id']+'-'+_0x2befc3+'.pdf'),function(_0x143545,_0x3b83e4){if(_0x143545)return _0x177da6(_0x143545);_0x3bf45c(_0x3b83e4);});});});}})[_0x6f57('0x33')](function(){if(_0x9e3f4d){return new BPromise(function(_0x3d314d,_0x52aa06){zipdir(_0x52acd6,{'saveTo':_0x4a5e3b},function(_0x5c73f5,_0x6cb957){if(_0x5c73f5)return _0x52aa06(_0x5c73f5);return _0x3d314d(_0x6cb957);});})['then'](function(){return new BPromise(function(_0x276366,_0x5ee793){rimraf(_0x52acd6,function(_0xccf8f8){if(_0xccf8f8)_0x5ee793(_0xccf8f8);return _0x276366();});});})[_0x6f57('0x33')](function(){return _0x4c531d['download'](_0x4a5e3b,_0x4dd712,function(_0xcf39bb){if(_0xcf39bb){console['log'](_0x6f57('0xdf'),_0xcf39bb);}else{fs[_0x6f57('0xe0')](_0x4a5e3b);}});});}else{return _0x4c531d['sendStatus'](0xc8);}})[_0x6f57('0x34')](handleError(_0x4c531d,null));}; \ No newline at end of file +var _0x3454=['ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','include','options','create','describe','addMessage','SmsMessage','ids','omit','pick','SmsInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','smsInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Messages','secret','User','fullname','firstName','lastName','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','\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','Sms','YYYY-MM-DD','mkdirSync','Account','closed','closedAt','disposition','direction','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','unlinkSync','eml-format','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Users','TagIds','Tags','forEach','push','catch','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','tools_tags','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','keys','some','compact','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','user','getSmsAccounts','i.SmsAccountId\x20IN\x20?','sequelize','toString','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x9c1f48,_0x25da55){var _0x52ecd4=function(_0x47aef6){while(--_0x47aef6){_0x9c1f48['push'](_0x9c1f48['shift']());}};_0x52ecd4(++_0x25da55);}(_0x3454,0x120));var _0x4345=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3454[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4345('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4345('0x1'));var jsonpatch=require(_0x4345('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4345('0x3'));var util=require('util');var path=require(_0x4345('0x4'));var sox=require(_0x4345('0x5'));var csv=require(_0x4345('0x6'));var ejs=require(_0x4345('0x7'));var fs=require('fs');var _=require(_0x4345('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4345('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4345('0x6'));var querystring=require('querystring');var Papa=require(_0x4345('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4345('0xb'));var as=require(_0x4345('0xc'));var hardwareService=require(_0x4345('0xd'));var logger=require(_0x4345('0xe'))(_0x4345('0xf'));var utils=require('../../config/utils');var config=require(_0x4345('0x10'));var db=require(_0x4345('0x11'))['db'];config[_0x4345('0x12')]=_[_0x4345('0x13')](config['redis'],{'host':_0x4345('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4345('0x15'))['register'](socket);function respondWithStatusCode(_0x512996,_0x494318){_0x494318=_0x494318||0xcc;return function(_0x393a60){if(_0x393a60){return _0x512996[_0x4345('0x16')](_0x494318);}return _0x512996['status'](_0x494318)[_0x4345('0x17')]();};}function respondWithResult(_0x33cb94,_0xaf9da){_0xaf9da=_0xaf9da||0xc8;return function(_0x56d97f){if(_0x56d97f){return _0x33cb94[_0x4345('0x18')](_0xaf9da)[_0x4345('0x19')](_0x56d97f);}};}function respondWithFilteredResult(_0x3d24d3,_0x326723){return function(_0x3fea48){if(_0x3fea48){var _0x335c25=_0x3fea48[_0x4345('0x1a')],_0x144768=_0x326723[_0x4345('0x1b')],_0x4229d4=_0x326723[_0x4345('0x1b')]+_0x326723[_0x4345('0x1c')],_0x244742;if(_0x4229d4>=_0x335c25){_0x4229d4=_0x335c25;_0x244742=0xc8;}else{_0x244742=0xce;}_0x3d24d3[_0x4345('0x18')](_0x244742);return _0x3d24d3['set'](_0x4345('0x1d'),_0x144768+'-'+_0x4229d4+'/'+_0x335c25)[_0x4345('0x19')](_0x3fea48);}return null;};}function patchUpdates(_0x526f9d){return function(_0x166ff2){try{jsonpatch[_0x4345('0x1e')](_0x166ff2,_0x526f9d,!![]);}catch(_0x3d0aef){return BPromise[_0x4345('0x1f')](_0x3d0aef);}return _0x166ff2[_0x4345('0x20')]();};}function saveUpdates(_0x3323fe,_0x49ce91){return function(_0x4aa97c){if(_0x4aa97c){return _0x4aa97c['update'](_0x3323fe)[_0x4345('0x21')](function(_0x301d2e){return _0x301d2e;});}return null;};}function removeEntity(_0x3125cc,_0x599fa6){return function(_0x13d881){if(_0x13d881){return _0x13d881[_0x4345('0x22')]()[_0x4345('0x21')](function(){_0x3125cc[_0x4345('0x18')](0xcc)[_0x4345('0x17')]();});}};}function handleEntityNotFound(_0x4fba24,_0x3e1297){return function(_0x16ebbd){if(!_0x16ebbd){_0x4fba24[_0x4345('0x16')](0x194);}return _0x16ebbd;};}function handleError(_0x6a89c2,_0x7dba85){_0x7dba85=_0x7dba85||0x1f4;return function(_0x4f930f){logger[_0x4345('0x23')](_0x4f930f[_0x4345('0x24')]);if(_0x4f930f[_0x4345('0x25')]){delete _0x4f930f[_0x4345('0x25')];}_0x6a89c2[_0x4345('0x18')](_0x7dba85)[_0x4345('0x26')](_0x4f930f);};}function getInteractionUsers(_0x106bdb,_0x3da783){return new BPromise(function(_0x1d5158,_0xfc60c9){try{if(_0x3da783[_0x106bdb['id']]){_0x106bdb[_0x4345('0x27')]=_['map'](_0x3da783[_0x106bdb['id']],function(_0x292959){return{'id':_0x292959['id']};});}}catch(_0x53eba5){_0xfc60c9(_0x53eba5);}_0x1d5158(_0x106bdb);});}function getInteractionTags(_0x4351a2,_0x138a65){return new BPromise(function(_0x43997a,_0x18276c){try{if(_0x4351a2[_0x4345('0x28')]){_0x4351a2[_0x4345('0x29')]=[];_0x4351a2[_0x4345('0x28')]['split'](',')[_0x4345('0x2a')](function(_0x1d5d28){_0x4351a2[_0x4345('0x29')][_0x4345('0x2b')](_0x138a65[_0x1d5d28]);});}delete _0x4351a2[_0x4345('0x28')];}catch(_0xc4f9fb){_0x18276c(_0xc4f9fb);}_0x43997a(_0x4351a2);});}function updateSmsInteraction(_0x2432ce,_0x4d86ce,_0x19f54f){return new BPromise(function(_0x49d710,_0x51dcfa){return getInteractionUsers(_0x2432ce,_0x19f54f)[_0x4345('0x21')](function(_0x463306){return getInteractionTags(_0x463306,_0x4d86ce);})[_0x4345('0x21')](function(_0x5cbee4){_0x49d710(_0x5cbee4);})[_0x4345('0x2c')](function(_0x5c741c){_0x51dcfa(_0x5c741c);});});}exports[_0x4345('0x2d')]=function(_0x5cb1df,_0x5df899){var _0x238b8c={},_0x3d202e={},_0x14df8f={'count':0x0,'rows':[]};var _0xdc1a44=_[_0x4345('0x2e')](db['SmsInteraction'][_0x4345('0x2f')],function(_0x315549){return{'name':_0x315549[_0x4345('0x30')],'type':_0x315549['type'][_0x4345('0x31')]};});_0x3d202e[_0x4345('0x32')]=_[_0x4345('0x2e')](_0xdc1a44,'name');_0x3d202e[_0x4345('0x33')]=_['keys'](_0x5cb1df[_0x4345('0x33')]);_0x3d202e[_0x4345('0x34')]=_['intersection'](_0x3d202e[_0x4345('0x32')],_0x3d202e[_0x4345('0x33')]);_0x238b8c[_0x4345('0x35')]=_[_0x4345('0x36')](_0x3d202e['model'],qs[_0x4345('0x37')](_0x5cb1df['query']['fields']));_0x238b8c['attributes']=_0x238b8c[_0x4345('0x35')][_0x4345('0x38')]?_0x238b8c[_0x4345('0x35')]:_0x3d202e['model'];if(!_0x5cb1df[_0x4345('0x33')][_0x4345('0x39')](_0x4345('0x3a'))){_0x238b8c[_0x4345('0x1c')]=qs[_0x4345('0x1c')](_0x5cb1df[_0x4345('0x33')]['limit']);_0x238b8c[_0x4345('0x1b')]=qs[_0x4345('0x1b')](_0x5cb1df[_0x4345('0x33')][_0x4345('0x1b')]);}_0x238b8c[_0x4345('0x3b')]=qs[_0x4345('0x3c')](_0x5cb1df[_0x4345('0x33')][_0x4345('0x3c')]);_0x238b8c[_0x4345('0x3d')]=qs['filters'](_['pick'](_0x5cb1df[_0x4345('0x33')],_0x3d202e[_0x4345('0x34')]));var _0x13dbf3=[];var _0x247581=squel[_0x4345('0x3e')]()[_0x4345('0x3f')]('id')[_0x4345('0x3f')](_0x4345('0x25'))[_0x4345('0x3f')](_0x4345('0x40'))['from'](_0x4345('0x41'));var _0x5c2b1b=squel['select']()[_0x4345('0x3f')](_0x4345('0x42'))[_0x4345('0x3f')](_0x4345('0x43'))[_0x4345('0x44')](_0x4345('0x45'),'ui')[_0x4345('0x46')](_0x4345('0x47'),'u',_0x4345('0x48'));var _0x2c8c75=squel[_0x4345('0x3e')]()[_0x4345('0x44')]('sms_interactions','i')[_0x4345('0x46')](_0x4345('0x49'),'c',_0x4345('0x4a'))[_0x4345('0x46')](_0x4345('0x47'),'o',_0x4345('0x4b'))[_0x4345('0x46')](_0x4345('0x4c'),'a',_0x4345('0x4d'))[_0x4345('0x46')](_0x4345('0x4e'),'me',_0x4345('0x4f'))['left_join'](_0x4345('0x50'),'it',_0x4345('0x51'))[_0x4345('0x46')](_0x4345('0x41'),'t','t.id\x20=\x20it.TagId');var _0x3b79d3=squel[_0x4345('0x52')]();var _0x9afa05=[];var _0xcecc14=squel[_0x4345('0x52')]();var _0x202b53;if(_0x5cb1df[_0x4345('0x33')]['search']){_0x202b53=as['parseSearch'](_0x5cb1df[_0x4345('0x33')][_0x4345('0x53')]);var _0x1ab8d2=_0x202b53['sqlOperator'];for(var _0x299c4b=0x0;_0x299c4b<_0x202b53[_0x4345('0x54')][_0x4345('0x38')];_0x299c4b++){var _0x4f8175=_0x202b53[_0x4345('0x54')][_0x299c4b];var _0x23d9cf='i';var _0xc0fa04=_[_0x4345('0x55')](_0xdc1a44,[_0x4345('0x25'),_0x4f8175[_0x4345('0x3f')]]);if(!_0xc0fa04){switch(_0x4f8175[_0x4345('0x3f')]){case'unreadMessages':if(_0x4f8175[_0x4345('0x56')]==0x1){_0x2c8c75['having']('`'+_0x4f8175['field']+_0x4345('0x57'));}else{_0x2c8c75[_0x4345('0x58')]('`'+_0x4f8175[_0x4345('0x3f')]+_0x4345('0x59'));}break;case _0x4345('0x5a'):if(_0x4f8175['operator']===_0x4345('0x5b')){if(_0x4f8175[_0x4345('0x56')][_0x4345('0x5c')]('\x20')['length']>0x1){_0x3b79d3[_0x1ab8d2](_0x4345('0x5d'),qs[_0x4345('0x5e')](_0x4f8175[_0x4345('0x56')]),null);}else{var _0x1dcedd='%'+_0x4f8175['value']+'%';_0x3b79d3[_0x1ab8d2](_0x4345('0x5f'),_0x1dcedd,_0x1dcedd,_0x1dcedd);}}else{_0xc0fa04=_[_0x4345('0x55')](_0xdc1a44,[_0x4345('0x25'),_0x4345('0x60')]);_0x4f8175[_0x4345('0x3f')]=_0x4345('0x60');_0xa2f234=as[_0x4345('0x61')](_0x23d9cf,_0xc0fa04[_0x4345('0x62')],_0x4f8175);_0x3b79d3[_0x1ab8d2](_0xa2f234['text'],_0xa2f234[_0x4345('0x56')][_0x4345('0x63')],_0xa2f234[_0x4345('0x56')][_0x4345('0x17')]);}break;case _0x4345('0x64'):var _0x30c47e=_0x4f8175[_0x4345('0x56')][_0x4345('0x5c')](',')[_0x4345('0x2e')](function(_0x5a01b5){return Number(_0x5a01b5);});_0x30c47e[_0x4345('0x2a')](function(_0xd266fd){_0xcecc14['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd266fd+',%');});_0x9afa05=_[_0x4345('0x65')](_0x9afa05,_0x30c47e);break;case'User':if(_0x4f8175[_0x4345('0x66')]==='$substring'){_0x3b79d3[_0x1ab8d2](_0x4345('0x67'),'%'+_0x4f8175[_0x4345('0x56')]+'%',null);}else{_0xc0fa04=_[_0x4345('0x55')](_0xdc1a44,['name',_0x4345('0x68')]);_0x4f8175[_0x4345('0x3f')]=_0x4345('0x68');_0xa2f234=as[_0x4345('0x61')](_0x23d9cf,_0xc0fa04['type'],_0x4f8175);_0x3b79d3[_0x1ab8d2](_0xa2f234[_0x4345('0x69')],_0xa2f234['value'][_0x4345('0x63')],_0xa2f234[_0x4345('0x56')][_0x4345('0x17')]);}break;case _0x4345('0x6a'):_0xa2f234=as[_0x4345('0x61')]('me',null,_0x4f8175);_0x3b79d3[_0x1ab8d2](_0xa2f234[_0x4345('0x69')],_0xa2f234[_0x4345('0x56')][_0x4345('0x63')],_0xa2f234[_0x4345('0x56')][_0x4345('0x17')]);break;}}else{var _0xa2f234=as['buildExpression'](_0x23d9cf,_0xc0fa04['type'],_0x4f8175);_0x3b79d3[_0x1ab8d2](_0xa2f234[_0x4345('0x69')],_0xa2f234[_0x4345('0x56')][_0x4345('0x63')],_0xa2f234[_0x4345('0x56')]['end']);}}}else{var _0x58e6c0=_(_0x5cb1df[_0x4345('0x33')])[_0x4345('0x6b')]()['map'](function(_0x24ab6e){return _[_0x4345('0x6c')](_0xdc1a44,['name',_0x24ab6e])?_0x24ab6e:undefined;})[_0x4345('0x6d')]()[_0x4345('0x56')]();if(!_[_0x4345('0x6e')](_0x58e6c0)){_0x58e6c0[_0x4345('0x2a')](function(_0x3b551c){if(_0x3b551c==='SmsAccountId'){_0x2c8c75[_0x4345('0x3d')]('i.SmsAccountId\x20IN\x20?',[][_0x4345('0x6f')](_0x5cb1df[_0x4345('0x33')][_0x3b551c]));}else if(_0x3b551c===_0x4345('0x70')){var _0x54f7e8=JSON['parse'](_0x5cb1df['query'][_0x3b551c])['$gte'];var _0x15c3f5=JSON[_0x4345('0x71')](_0x5cb1df[_0x4345('0x33')][_0x3b551c])[_0x4345('0x72')];_0x2c8c75[_0x4345('0x3d')](_0x4345('0x73'),_0x54f7e8,_0x15c3f5);}else{if(_0x5cb1df[_0x4345('0x33')][_0x3b551c]===_0x4345('0x74')){_0x2c8c75[_0x4345('0x3d')]('i.'+_0x3b551c+_0x4345('0x75'));}else{_0x2c8c75[_0x4345('0x3d')]('i.'+_0x3b551c+'\x20=\x20?',_0x5cb1df[_0x4345('0x33')][_0x3b551c]);}}});}if(_0x5cb1df['query'][_0x4345('0x76')]){if(_0x5cb1df[_0x4345('0x33')][_0x4345('0x76')]==0x1){_0x2c8c75[_0x4345('0x58')]('`unreadMessages`\x20=\x200');}else{_0x2c8c75[_0x4345('0x58')](_0x4345('0x77'));}}if(_0x5cb1df[_0x4345('0x33')][_0x4345('0x78')]){_0x9afa05=_[_0x4345('0x79')](_0x5cb1df[_0x4345('0x33')]['tag'])?_0x5cb1df[_0x4345('0x33')][_0x4345('0x78')]:new Array(_0x5cb1df['query'][_0x4345('0x78')]);_0x9afa05[_0x4345('0x2a')](function(_0x1a8798){_0xcecc14['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1a8798+',%');});}if(_0x5cb1df[_0x4345('0x33')][_0x4345('0x7a')]){var _0x26fa29=_0x5cb1df[_0x4345('0x33')][_0x4345('0x7a')][_0x4345('0x7b')]('\x5c','\x5c\x5c')[_0x4345('0x7b')]('\x27\x27',_0x4345('0x7c'));if(qs[_0x4345('0x7d')](_0x26fa29)){_0x3b79d3['or']('i.id\x20LIKE\x20?',_0x26fa29+'%')['or'](_0x4345('0x7e'),_0x26fa29+'%');}else{_0x3b79d3['or'](_0x4345('0x7f'),qs[_0x4345('0x5e')](_0x26fa29))['or'](_0x4345('0x80'),_0x26fa29+'%');}}}_0x2c8c75['where'](_0x3b79d3);_0x2c8c75[_0x4345('0x81')]('i.id');var _0x403a25={'type':db[_0x4345('0x82')][_0x4345('0x83')][_0x4345('0x84')],'raw':!![]};var _0x484ac7=_0x2c8c75[_0x4345('0x85')]();_0x484ac7[_0x4345('0x3f')](_0x4345('0x86'));_0x484ac7[_0x4345('0x3f')](_0x4345('0x87'),_0x4345('0x88'));if(_0x238b8c['order']){_0x238b8c[_0x4345('0x3b')][_0x4345('0x2a')](function(_0x274114){_0x2c8c75[_0x4345('0x3b')]('i.'+_0x274114[0x0],_0x274114[0x1]===_0x4345('0x89')?![]:!![]);});}if(!_[_0x4345('0x6e')](_0x9afa05)){_0x2c8c75[_0x4345('0x58')](_0xcecc14);_0x484ac7['where'](_0x4345('0x8a'),_0x9afa05);}BPromise['resolve']()[_0x4345('0x21')](function(){if(!_0x202b53)return;return _0x5cb1df[_0x4345('0x8b')][_0x4345('0x8c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x71e001){_0x484ac7[_0x4345('0x3d')](_0x4345('0x8d'),_[_0x4345('0x2e')](_0x71e001,'id'));_0x2c8c75[_0x4345('0x3d')](_0x4345('0x8d'),_[_0x4345('0x2e')](_0x71e001,'id'));});})['then'](function(){db[_0x4345('0x8e')][_0x4345('0x33')](_0x484ac7[_0x4345('0x8f')](),_0x403a25)[_0x4345('0x21')](function(_0x23b51b){_0x14df8f[_0x4345('0x1a')]=_0x23b51b[_0x4345('0x38')];if(_0x14df8f[_0x4345('0x1a')]===0x0)return[];return db[_0x4345('0x8e')][_0x4345('0x33')](_0x247581['toString'](),_0x403a25)['then'](function(_0x56113c){_0x13dbf3=_['keyBy'](_0x56113c,'id');_0x403a25=_[_0x4345('0x90')](_0x403a25,{'model':db[_0x4345('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2c8c75['field'](_0x4345('0x87'),_0x4345('0x88'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x92'),_0x4345('0x93'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x94'),'Account.mandatoryDisposition');_0x2c8c75[_0x4345('0x3f')](_0x4345('0x95'));_0x2c8c75[_0x4345('0x3f')]('c.firstName',_0x4345('0x96'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x97'),_0x4345('0x98'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x99'),_0x4345('0x9a'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x9b'),_0x4345('0x9c'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x9d'),_0x4345('0x9e'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0x9f'),_0x4345('0xa0'));_0x2c8c75[_0x4345('0x3f')](_0x4345('0xa1'),_0x4345('0x28'));_0x2c8c75[_0x4345('0x1c')](_0x238b8c['limit']);_0x2c8c75[_0x4345('0x1b')](_0x238b8c['offset']);return db[_0x4345('0x8e')][_0x4345('0x33')](_0x2c8c75[_0x4345('0x8f')](),_0x403a25);})['then'](function(_0x430121){_0x5c2b1b['where'](_0x4345('0xa2'),_[_0x4345('0x2e')](_0x430121,'id'));return db['sequelize'][_0x4345('0x33')](_0x5c2b1b[_0x4345('0x8f')](),_0x403a25)[_0x4345('0x21')](function(_0x2cd036){var _0x8c746c=_[_0x4345('0xa3')](_0x2cd036,'SmsInteractionId');var _0x340db0=[];_0x430121['forEach'](function(_0x11c16d){_0x340db0[_0x4345('0x2b')](updateSmsInteraction(_0x11c16d,_0x13dbf3,_0x8c746c));});return BPromise[_0x4345('0xa4')](_0x340db0);});});})[_0x4345('0x21')](function(_0x492ae3){_0x14df8f[_0x4345('0xa5')]=_0x492ae3;return _0x14df8f;})['then'](respondWithFilteredResult(_0x5df899,_0x238b8c));})[_0x4345('0x2c')](handleError(_0x5df899,null));};exports[_0x4345('0xa6')]=function(_0x2679d7,_0x3176d9){var _0x586507={'raw':![],'where':{'id':_0x2679d7[_0x4345('0xa7')]['id']}},_0xa5a3a4={};_0xa5a3a4[_0x4345('0x32')]=_[_0x4345('0x6b')](db['SmsInteraction'][_0x4345('0x2f')]);_0xa5a3a4['query']=_['keys'](_0x2679d7[_0x4345('0x33')]);_0xa5a3a4[_0x4345('0x34')]=_['intersection'](_0xa5a3a4[_0x4345('0x32')],_0xa5a3a4[_0x4345('0x33')]);_0x586507['attributes']=_[_0x4345('0x36')](_0xa5a3a4[_0x4345('0x32')],qs[_0x4345('0x37')](_0x2679d7[_0x4345('0x33')][_0x4345('0x37')]));_0x586507['attributes']=_0x586507[_0x4345('0x35')][_0x4345('0x38')]?_0x586507[_0x4345('0x35')]:_0xa5a3a4['model'];if(_0x2679d7[_0x4345('0x33')]['includeAll']){_0x586507[_0x4345('0xa8')]=[{'all':!![]}];}_0x586507=_['merge']({},_0x586507,_0x2679d7[_0x4345('0xa9')]);return db[_0x4345('0x91')]['find'](_0x586507)[_0x4345('0x21')](handleEntityNotFound(_0x3176d9,null))[_0x4345('0x21')](respondWithResult(_0x3176d9,null))[_0x4345('0x2c')](handleError(_0x3176d9,null));};exports[_0x4345('0xaa')]=function(_0x2ab7a7,_0x54936d){return db[_0x4345('0x91')]['create'](_0x2ab7a7[_0x4345('0x6a')],{})[_0x4345('0x21')](respondWithResult(_0x54936d,0xc9))[_0x4345('0x2c')](handleError(_0x54936d,null));};exports['update']=function(_0x47e447,_0x287df9){if(_0x47e447[_0x4345('0x6a')]['id']){delete _0x47e447[_0x4345('0x6a')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x47e447['params']['id']}})[_0x4345('0x21')](handleEntityNotFound(_0x287df9,null))[_0x4345('0x21')](saveUpdates(_0x47e447[_0x4345('0x6a')],null))[_0x4345('0x21')](respondWithResult(_0x287df9,null))[_0x4345('0x2c')](handleError(_0x287df9,null));};exports['destroy']=function(_0x5938f2,_0x1b8f7c){return db[_0x4345('0x91')][_0x4345('0x55')]({'where':{'id':_0x5938f2['params']['id']}})[_0x4345('0x21')](handleEntityNotFound(_0x1b8f7c,null))[_0x4345('0x21')](removeEntity(_0x1b8f7c,null))[_0x4345('0x2c')](handleError(_0x1b8f7c,null));};exports['describe']=function(_0x122d5c,_0x4d0512){return db[_0x4345('0x91')][_0x4345('0xab')]()[_0x4345('0x21')](respondWithResult(_0x4d0512,null))[_0x4345('0x2c')](handleError(_0x4d0512,null));};exports[_0x4345('0xac')]=function(_0x318c93,_0xbcfc67,_0x134f4e){return db[_0x4345('0xad')]['find']({'where':{'id':_0x318c93[_0x4345('0xa7')]['id']}})[_0x4345('0x21')](handleEntityNotFound(_0xbcfc67,null))[_0x4345('0x21')](function(_0x997b37){if(_0x997b37){return _0x997b37[_0x4345('0xac')](_0x318c93[_0x4345('0x6a')][_0x4345('0xae')],_[_0x4345('0xaf')](_0x318c93['body'],[_0x4345('0xae'),'id'])||{});}})[_0x4345('0x21')](respondWithResult(_0xbcfc67,null))['catch'](handleError(_0xbcfc67,null));};exports['getMessages']=function(_0x126d96,_0x262a07,_0x775f80){var _0x27b283={'raw':![],'where':{}};var _0x1b72dc={};var _0x2416b1={'count':0x0,'rows':[]};return db[_0x4345('0x91')]['findOne']({'where':{'id':_0x126d96[_0x4345('0xa7')]['id']}})[_0x4345('0x21')](handleEntityNotFound(_0x262a07,null))[_0x4345('0x21')](function(_0xdc57b7){if(_0xdc57b7){_0x1b72dc['model']=_[_0x4345('0x6b')](db[_0x4345('0xad')][_0x4345('0x2f')]);_0x1b72dc['query']=_[_0x4345('0x6b')](_0x126d96[_0x4345('0x33')]);_0x1b72dc[_0x4345('0x34')]=_[_0x4345('0x36')](_0x1b72dc[_0x4345('0x32')],_0x1b72dc[_0x4345('0x33')]);_0x27b283[_0x4345('0x35')]=_[_0x4345('0x36')](_0x1b72dc[_0x4345('0x32')],qs['fields'](_0x126d96['query'][_0x4345('0x37')]));_0x27b283['attributes']=_0x27b283[_0x4345('0x35')][_0x4345('0x38')]?_0x27b283[_0x4345('0x35')]:_0x1b72dc[_0x4345('0x32')];if(!_0x126d96[_0x4345('0x33')][_0x4345('0x39')]('nolimit')){_0x27b283[_0x4345('0x1c')]=qs[_0x4345('0x1c')](_0x126d96[_0x4345('0x33')][_0x4345('0x1c')]);_0x27b283['offset']=qs[_0x4345('0x1b')](_0x126d96[_0x4345('0x33')][_0x4345('0x1b')]);}_0x27b283[_0x4345('0x3b')]=qs[_0x4345('0x3c')](_0x126d96[_0x4345('0x33')][_0x4345('0x3c')]);_0x27b283[_0x4345('0x3d')]=qs[_0x4345('0x34')](_[_0x4345('0xb0')](_0x126d96[_0x4345('0x33')],_0x1b72dc['filters']));_0x27b283[_0x4345('0x3d')][_0x4345('0xb1')]=_0xdc57b7['id'];if(_0x126d96[_0x4345('0x33')][_0x4345('0x7a')]){_0x27b283[_0x4345('0x3d')]=_[_0x4345('0x90')](_0x27b283[_0x4345('0x3d')],{'$or':_[_0x4345('0x2e')](_0x27b283[_0x4345('0x35')],function(_0x258fd1){var _0x151e7a={};_0x151e7a[_0x258fd1]={'$like':'%'+_0x126d96[_0x4345('0x33')]['filter']+'%'};return _0x151e7a;})});}if(_0x126d96[_0x4345('0x33')][_0x4345('0xb2')]){var _0x4c9cf8=_0x126d96[_0x4345('0x33')]['$gte'][_0x4345('0x5c')](',');var _0x32ee57={};_0x32ee57[_0x4c9cf8[0x0]]={'$gte':moment(_0x4c9cf8[0x1])[_0x4345('0xb3')](_0x4345('0xb4'))};_0x27b283[_0x4345('0x3d')]=_['merge'](_0x27b283[_0x4345('0x3d')],_0x32ee57);}_0x27b283=_['merge']({},_0x27b283,_0x126d96['options']);return db['SmsMessage'][_0x4345('0x1a')]({'where':_0x27b283[_0x4345('0x3d')]})[_0x4345('0x21')](function(_0x5a0dae){_0x2416b1[_0x4345('0x1a')]=_0x5a0dae;if(_0x126d96['query']['includeAll']){_0x27b283['include']=[{'all':!![]}];}return db[_0x4345('0xad')][_0x4345('0xb5')](_0x27b283);})['then'](function(_0xebdcc9){_0x2416b1[_0x4345('0xa5')]=_0xebdcc9;return _0x2416b1;});}})[_0x4345('0x21')](respondWithFilteredResult(_0x262a07,_0x27b283))['catch'](handleError(_0x262a07,null));};exports[_0x4345('0xb6')]=function(_0x1ac10c,_0x2bece1,_0x456683){return db['SmsInteraction'][_0x4345('0x55')]({'where':{'id':_0x1ac10c[_0x4345('0xa7')]['id']}})['then'](handleEntityNotFound(_0x2bece1,null))[_0x4345('0x21')](function(_0x30a3ab){if(_0x30a3ab){return _0x30a3ab[_0x4345('0xb7')](_0x1ac10c[_0x4345('0x6a')][_0x4345('0xae')],_[_0x4345('0xaf')](_0x1ac10c['body'],['ids','id'])||{})[_0x4345('0xb8')](function(){return db[_0x4345('0x64')][_0x4345('0xb5')]({'attributes':['id',_0x4345('0x25'),_0x4345('0x40')],'where':{'id':_0x1ac10c[_0x4345('0x6a')][_0x4345('0xae')]}});})[_0x4345('0x21')](function(_0x59c5ff){socket['emit'](_0x4345('0xb9'),{'id':Number(_0x1ac10c[_0x4345('0xa7')]['id']),'tags':_0x59c5ff||[]});return{'id':Number(_0x1ac10c[_0x4345('0xa7')]['id']),'tags':_0x59c5ff||[]};});}})[_0x4345('0x21')](respondWithResult(_0x2bece1,null))['catch'](handleError(_0x2bece1,null));};exports[_0x4345('0xba')]=function(_0x1ae21a,_0x43e401,_0x31421c){return db[_0x4345('0x91')][_0x4345('0x55')]({'where':{'id':_0x1ae21a[_0x4345('0xa7')]['id']}})[_0x4345('0x21')](handleEntityNotFound(_0x43e401,null))[_0x4345('0x21')](function(_0x2043a0){if(_0x2043a0){return _0x2043a0['removeTags'](_0x1ae21a['query'][_0x4345('0xae')]);}})[_0x4345('0x21')](respondWithStatusCode(_0x43e401,null))[_0x4345('0x2c')](handleError(_0x43e401,null));};exports['download']=function(_0x4eacda,_0x4c9944){var _0x9f2bad=moment()[_0x4345('0xbb')]()[_0x4345('0x8f')]();var _0x254363=path[_0x4345('0xbc')](config[_0x4345('0xbd')],_0x4345('0xbe'),_0x4345('0xbf'),'tmp');var _0x2d1efa=path[_0x4345('0xbc')](config[_0x4345('0xbd')],_0x4345('0xbe'),'files',_0x4345('0xc0'));var _0x187146=path[_0x4345('0xbc')](_0x254363,_0x9f2bad);var _0x339ed0=util[_0x4345('0xb3')](_0x4345('0xc1'),_0x4eacda[_0x4345('0xa7')]['id'],_0x9f2bad);var _0x52520e=path[_0x4345('0xbc')](_0x254363,_0x339ed0);var _0x26ab44=![];return db['SmsInteraction']['find']({'where':{'id':_0x4eacda[_0x4345('0xa7')]['id']},'include':[{'model':db[_0x4345('0xad')],'as':_0x4345('0xc2'),'attributes':['id',_0x4345('0x6a'),'createdAt','direction',_0x4345('0xc3'),_0x4345('0x76')],'include':[{'model':db[_0x4345('0xc4')],'as':'User','attributes':['id',_0x4345('0xc5')],'raw':!![]},{'model':db['CmContact'],'as':_0x4345('0x5a'),'attributes':['id',_0x4345('0xc6'),_0x4345('0xc7')],'raw':!![]}]},{'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x4345('0x25')]},{'model':db[_0x4345('0xc4')],'as':_0x4345('0xc8'),'attributes':['id',_0x4345('0xc5')]}]})[_0x4345('0x21')](handleEntityNotFound(_0x4c9944,null))[_0x4345('0x21')](function(_0x205b9a){if(_0x205b9a){var _0x20c25a=_0x205b9a[_0x4345('0xc9')]({'plain':!![]});_0x26ab44=!![];var _0x1df405={'format':'A4','border':_0x4345('0xca'),'header':{'height':_0x4345('0xcb'),'contents':{'first':_0x4345('0xcc')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x4345('0xcd'),util['format'](_0x4345('0xce'),_0x4345('0xcf'),_0x20c25a['id']),moment()['format'](_0x4345('0xd0'))[_0x4345('0x8f')]())}}};fs[_0x4345('0xd1')](_0x187146);var _0x571eb6={'channel':_0x4345('0xcf'),'account':_0x20c25a[_0x4345('0xd2')][_0x4345('0x25')],'agent':_0x20c25a['Owner']?_0x20c25a[_0x4345('0xc8')]['fullname']:'N.A.','createdAt':moment(_0x20c25a[_0x4345('0x70')])[_0x4345('0xb3')](_0x4345('0xb4'))[_0x4345('0x8f')](),'closedAt':_0x20c25a[_0x4345('0xd3')]?moment(_0x20c25a[_0x4345('0xd4')])[_0x4345('0xb3')](_0x4345('0xb4'))[_0x4345('0x8f')]():'','disposition':_0x20c25a[_0x4345('0xd5')],'messages':_(_0x20c25a[_0x4345('0xc2')])[_0x4345('0x7a')]({'secret':![]})['map'](function(_0x353074){return{'date':moment(_0x353074[_0x4345('0x70')])[_0x4345('0xb3')](_0x4345('0xb4'))[_0x4345('0x8f')](),'sender':_0x353074[_0x4345('0xd6')]===_0x4345('0xd7')?_0x353074[_0x4345('0xc4')]?_0x353074[_0x4345('0xc4')][_0x4345('0xc5')]:'System':_0x353074[_0x4345('0x5a')][_0x4345('0xc6')]+(_0x353074['Contact'][_0x4345('0xc7')]?'\x20'+_0x353074[_0x4345('0x5a')][_0x4345('0xc7')]:''),'body':_0x353074[_0x4345('0x6a')],'direction':_0x353074['direction']===_0x4345('0xd7')?'A':'C','secret':_0x353074['secret'],'read':_0x353074[_0x4345('0x76')]};})[_0x4345('0x56')]()};return ejs[_0x4345('0xd8')](path[_0x4345('0xbc')](config[_0x4345('0xbd')],_0x4345('0xbe'),_0x4345('0xd9'),_0x4345('0xda')),{'interaction':_0x571eb6})['then'](function(_0x48485b){return new BPromise(function(_0x320fc6,_0x188406){pdf[_0x4345('0xaa')](_0x48485b,_0x1df405)[_0x4345('0xdb')](path[_0x4345('0xbc')](_0x187146,_0x4345('0xdc')+_0x20c25a['id']+'-'+_0x9f2bad+_0x4345('0xdd')),function(_0x4f390a,_0x9ed6cc){if(_0x4f390a)return _0x188406(_0x4f390a);_0x320fc6(_0x9ed6cc);});});});}})[_0x4345('0x21')](function(){if(_0x26ab44){return new BPromise(function(_0x59117f,_0x47eef8){zipdir(_0x187146,{'saveTo':_0x52520e},function(_0x355daa,_0x3f420a){if(_0x355daa)return _0x47eef8(_0x355daa);return _0x59117f(_0x3f420a);});})[_0x4345('0x21')](function(){return new BPromise(function(_0x403acc,_0xcb79a7){rimraf(_0x187146,function(_0x3a7457){if(_0x3a7457)_0xcb79a7(_0x3a7457);return _0x403acc();});});})[_0x4345('0x21')](function(){return _0x4c9944[_0x4345('0xde')](_0x52520e,_0x339ed0,function(_0xbb2fc0){if(_0xbb2fc0){console[_0x4345('0xdf')]('err',_0xbb2fc0);}else{fs[_0x4345('0xe0')](_0x52520e);}});});}else{return _0x4c9944[_0x4345('0x16')](0xc8);}})[_0x4345('0x2c')](handleError(_0x4c9944,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 6acfeaa..e3f45a2 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 _0xee24=['setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x5cc9be,_0x4b61f4){var _0x110c11=function(_0x43d175){while(--_0x43d175){_0x5cc9be['push'](_0x5cc9be['shift']());}};_0x110c11(++_0x4b61f4);}(_0xee24,0x1a6));var _0x4ee2=function(_0x38db92,_0x593c17){_0x38db92=_0x38db92-0x0;var _0x544d98=_0xee24[_0x38db92];return _0x544d98;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x4ee2('0x0'))['db'][_0x4ee2('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x4ee2('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4ee2('0x3')](0x0);var events={'afterCreate':_0x4ee2('0x4'),'afterUpdate':_0x4ee2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1aee89){return function(_0x179bfa,_0x477664,_0x1993de){_0x179bfa['getUsers']({'attributes':['id'],'raw':!![]})[_0x4ee2('0x6')](function(_0x319d9d){_0x179bfa[_0x4ee2('0x7')](_0x4ee2('0x8'),_0x319d9d[_0x4ee2('0x9')](function(_0x15f436){return{'id':_0x15f436['id']};}));return SmsMessage[_0x4ee2('0xa')]({'where':{'SmsInteractionId':_0x179bfa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4ee2('0x6')](function(_0x550e8d){_0x179bfa['setDataValue'](_0x4ee2('0xb'),_0x550e8d[_0x4ee2('0xc')]);SmsInteractionEvents[_0x4ee2('0xd')](_0x1aee89+':'+_0x179bfa['id'],_0x179bfa);SmsInteractionEvents[_0x4ee2('0xd')](_0x1aee89,_0x179bfa);_0x1993de(null);})[_0x4ee2('0xe')](_0x1993de(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4ee2('0xf')](e,emitEvent(event));}}module[_0x4ee2('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x5292=['setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','then','map'];(function(_0x25e2d5,_0x352b16){var _0x55d43a=function(_0x68ba34){while(--_0x68ba34){_0x25e2d5['push'](_0x25e2d5['shift']());}};_0x55d43a(++_0x352b16);}(_0x5292,0xf7));var _0x2529=function(_0x560b33,_0x54a69c){_0x560b33=_0x560b33-0x0;var _0x15c35e=_0x5292[_0x560b33];return _0x15c35e;};'use strict';var EventEmitter=require(_0x2529('0x0'));var SmsInteraction=require(_0x2529('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x2529('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2529('0x2')](0x0);var events={'afterCreate':_0x2529('0x3'),'afterUpdate':_0x2529('0x4'),'afterDestroy':_0x2529('0x5')};function emitEvent(_0x5d25dc){return function(_0x28c08d,_0x482dba,_0x4c9b4c){_0x28c08d['getUsers']({'attributes':['id'],'raw':!![]})[_0x2529('0x6')](function(_0x43cbef){_0x28c08d['setDataValue']('Users',_0x43cbef[_0x2529('0x7')](function(_0x2a0306){return{'id':_0x2a0306['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x28c08d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2529('0x6')](function(_0x44c8da){_0x28c08d[_0x2529('0x8')](_0x2529('0x9'),_0x44c8da[_0x2529('0xa')]);SmsInteractionEvents[_0x2529('0xb')](_0x5d25dc+':'+_0x28c08d['id'],_0x28c08d);SmsInteractionEvents[_0x2529('0xb')](_0x5d25dc,_0x28c08d);_0x4c9b4c(null);})[_0x2529('0xc')](_0x4c9b4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2529('0xd')](e,emitEvent(event));}}module[_0x2529('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0f71cb5..bef2bd5 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 _0xc1df=['util','../../config/logger','api','moment','request-promise','rimraf','define','SmsInteraction','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x18e2ea,_0x25beb1){var _0x4e320d=function(_0x5c2511){while(--_0x5c2511){_0x18e2ea['push'](_0x18e2ea['shift']());}};_0x4e320d(++_0x25beb1);}(_0xc1df,0x15b));var _0xfc1d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc1df[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xfc1d('0x0'));var util=require(_0xfc1d('0x1'));var logger=require(_0xfc1d('0x2'))(_0xfc1d('0x3'));var moment=require(_0xfc1d('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc1d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc1d('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x1b00c7,_0x322124){return _0x1b00c7[_0xfc1d('0x7')](_0xfc1d('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e8537,_0x26ad5f,_0x28231c){if(_0x3e8537['changed'](_0xfc1d('0x9'))){_0x3e8537[_0xfc1d('0xa')]=moment()['format'](_0xfc1d('0xb'));}_0x28231c(null,_0x3e8537);}}});}; \ No newline at end of file +var _0x6c5b=['sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction'];(function(_0x17eb64,_0x4e4545){var _0x32fa34=function(_0x4f7fe5){while(--_0x4f7fe5){_0x17eb64['push'](_0x17eb64['shift']());}};_0x32fa34(++_0x4e4545);}(_0x6c5b,0x85));var _0xb6c5=function(_0x27b438,_0x2e696d){_0x27b438=_0x27b438-0x0;var _0x23ae39=_0x6c5b[_0x27b438];return _0x23ae39;};'use strict';var _=require('lodash');var util=require(_0xb6c5('0x0'));var logger=require(_0xb6c5('0x1'))(_0xb6c5('0x2'));var moment=require(_0xb6c5('0x3'));var BPromise=require(_0xb6c5('0x4'));var rp=require(_0xb6c5('0x5'));var fs=require('fs');var path=require(_0xb6c5('0x6'));var rimraf=require('rimraf');var config=require(_0xb6c5('0x7'));var attributes=require(_0xb6c5('0x8'));module[_0xb6c5('0x9')]=function(_0xf7701,_0x348c4a){return _0xf7701['define'](_0xb6c5('0xa'),attributes,{'tableName':_0xb6c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ba631,_0x349573,_0x4ca9ea){if(_0x5ba631[_0xb6c5('0xc')]('closed')){_0x5ba631[_0xb6c5('0xd')]=moment()[_0xb6c5('0xe')](_0xb6c5('0xf'));}_0x4ca9ea(null,_0x5ba631);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 556bcfd..6b356cb 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 _0x5f85=['raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','omit','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsInteraction,\x20%s,\x20%s','result','UpdateSmsInteraction','SmsInteraction','update','body','options'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x5f85,0x1b0));var _0x55f8=function(_0x77d53b,_0x4f2b69){_0x77d53b=_0x77d53b-0x0;var _0x4ac08f=_0x5f85[_0x77d53b];return _0x4ac08f;};'use strict';var _=require(_0x55f8('0x0'));var util=require(_0x55f8('0x1'));var moment=require(_0x55f8('0x2'));var BPromise=require(_0x55f8('0x3'));var rs=require(_0x55f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55f8('0x5'))['db'];var utils=require(_0x55f8('0x6'));var logger=require(_0x55f8('0x7'))(_0x55f8('0x8'));var config=require(_0x55f8('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x55f8('0xa')]=_['defaults'](config[_0x55f8('0xa')],{'host':_0x55f8('0xb'),'port':0x18eb});var socket=require(_0x55f8('0xc'))(new Redis(config['redis']));require(_0x55f8('0xd'))['register'](socket);function respondWithRpcPromise(_0x17a6c7,_0x5b14f0,_0x7a86e8){return new BPromise(function(_0x4121d6,_0xe76f97){return client[_0x55f8('0xe')](_0x17a6c7,_0x7a86e8)[_0x55f8('0xf')](function(_0x2576da){logger[_0x55f8('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x5b14f0,_0x55f8('0x11'));logger[_0x55f8('0x12')](_0x55f8('0x13'),_0x5b14f0,_0x55f8('0x11'),JSON[_0x55f8('0x14')](_0x2576da));if(_0x2576da['error']){if(_0x2576da[_0x55f8('0x15')]['code']===0x1f4){logger[_0x55f8('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x5b14f0,_0x2576da[_0x55f8('0x15')][_0x55f8('0x16')]);return _0xe76f97(_0x2576da[_0x55f8('0x15')][_0x55f8('0x16')]);}logger[_0x55f8('0x15')](_0x55f8('0x17'),_0x5b14f0,_0x2576da[_0x55f8('0x15')][_0x55f8('0x16')]);return _0x4121d6(_0x2576da[_0x55f8('0x15')]['message']);}else{logger['info'](_0x55f8('0x17'),_0x5b14f0,'request\x20sent');_0x4121d6(_0x2576da[_0x55f8('0x18')][_0x55f8('0x16')]);}})['catch'](function(_0x13240d){logger['error'](_0x55f8('0x17'),_0x5b14f0,_0x13240d);_0xe76f97(_0x13240d);});});}exports[_0x55f8('0x19')]=function(_0x591915){var _0xb0c3ae=this;return new Promise(function(_0x2c53f1,_0x28800b){return db[_0x55f8('0x1a')][_0x55f8('0x1b')](_0x591915[_0x55f8('0x1c')],{'raw':_0x591915['options']?_0x591915[_0x55f8('0x1d')][_0x55f8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591915[_0x55f8('0x1d')]?_0x591915[_0x55f8('0x1d')][_0x55f8('0x1f')]||null:null,'attributes':_0x591915[_0x55f8('0x1d')]?_0x591915[_0x55f8('0x1d')][_0x55f8('0x20')]||null:null,'limit':_0x591915[_0x55f8('0x1d')]?_0x591915[_0x55f8('0x1d')][_0x55f8('0x21')]||null:null})['then'](function(_0x332652){logger['info'](_0x55f8('0x19'),_0x591915);logger[_0x55f8('0x12')](_0x55f8('0x19'),_0x591915,JSON[_0x55f8('0x14')](_0x332652));_0x2c53f1(_0x332652);})['catch'](function(_0x1ad6dc){logger[_0x55f8('0x15')](_0x55f8('0x19'),_0x1ad6dc['message'],_0x591915);_0x28800b(_0xb0c3ae[_0x55f8('0x15')](0x1f4,_0x1ad6dc[_0x55f8('0x16')]));});});};exports[_0x55f8('0x22')]=function(_0x58a394){return new Promise(function(_0x515918,_0x18bde2){return db[_0x55f8('0x1a')][_0x55f8('0x23')]({'where':_0x58a394['options']?_0x58a394['options']['where']||null:null})[_0x55f8('0xf')](function(_0x358c82){if(_0x358c82){return _0x358c82[_0x55f8('0x24')](_0x58a394[_0x55f8('0x1c')]['ids'],_[_0x55f8('0x25')](_0x58a394[_0x55f8('0x1c')],[_0x55f8('0x26'),'id'])||{});}})[_0x55f8('0x27')](function(_0x1e1df3){logger[_0x55f8('0x10')](_0x55f8('0x28'),_0x58a394);logger[_0x55f8('0x12')](_0x55f8('0x28'),_0x58a394,JSON[_0x55f8('0x14')](_0x1e1df3));_0x515918(_0x1e1df3);})[_0x55f8('0x29')](function(_0xc6eb38){logger[_0x55f8('0x15')](_0x55f8('0x28'),_0xc6eb38[_0x55f8('0x16')],_0x58a394);_0x18bde2(_this[_0x55f8('0x15')](0x1f4,_0xc6eb38['message']));});});}; \ No newline at end of file +var _0x5ab5=['message','result','catch','SmsInteraction','update','body','options','raw','attributes','limit','then','UpdateSmsInteraction','AddTagsToSmsInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error'];(function(_0x33aa21,_0x4fbae1){var _0xcaa1a0=function(_0x2ed1c9){while(--_0x2ed1c9){_0x33aa21['push'](_0x33aa21['shift']());}};_0xcaa1a0(++_0x4fbae1);}(_0x5ab5,0x140));var _0x55ab=function(_0x2435a2,_0x51b2b2){_0x2435a2=_0x2435a2-0x0;var _0x5d66b5=_0x5ab5[_0x2435a2];return _0x5d66b5;};'use strict';var _=require(_0x55ab('0x0'));var util=require(_0x55ab('0x1'));var moment=require(_0x55ab('0x2'));var BPromise=require(_0x55ab('0x3'));var rs=require(_0x55ab('0x4'));var fs=require('fs');var Redis=require(_0x55ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x55ab('0x6'));var logger=require(_0x55ab('0x7'))(_0x55ab('0x8'));var config=require(_0x55ab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x55ab('0xa')][_0x55ab('0xb')]({'port':0x232a});config['redis']=_[_0x55ab('0xc')](config[_0x55ab('0xd')],{'host':_0x55ab('0xe'),'port':0x18eb});var socket=require(_0x55ab('0xf'))(new Redis(config[_0x55ab('0xd')]));require('./smsInteraction.socket')[_0x55ab('0x10')](socket);function respondWithRpcPromise(_0x143ceb,_0xa6d8e6,_0x380bf9){return new BPromise(function(_0x32a3db,_0x34ab11){return client[_0x55ab('0x11')](_0x143ceb,_0x380bf9)['then'](function(_0x4b432a){logger[_0x55ab('0x12')](_0x55ab('0x13'),_0xa6d8e6,_0x55ab('0x14'));logger[_0x55ab('0x15')](_0x55ab('0x16'),_0xa6d8e6,'request\x20sent',JSON['stringify'](_0x4b432a));if(_0x4b432a[_0x55ab('0x17')]){if(_0x4b432a[_0x55ab('0x17')]['code']===0x1f4){logger['error'](_0x55ab('0x13'),_0xa6d8e6,_0x4b432a[_0x55ab('0x17')][_0x55ab('0x18')]);return _0x34ab11(_0x4b432a[_0x55ab('0x17')][_0x55ab('0x18')]);}logger[_0x55ab('0x17')]('SmsInteraction,\x20%s,\x20%s',_0xa6d8e6,_0x4b432a['error'][_0x55ab('0x18')]);return _0x32a3db(_0x4b432a[_0x55ab('0x17')][_0x55ab('0x18')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0xa6d8e6,_0x55ab('0x14'));_0x32a3db(_0x4b432a[_0x55ab('0x19')][_0x55ab('0x18')]);}})[_0x55ab('0x1a')](function(_0x41245a){logger[_0x55ab('0x17')](_0x55ab('0x13'),_0xa6d8e6,_0x41245a);_0x34ab11(_0x41245a);});});}exports['UpdateSmsInteraction']=function(_0x67b761){var _0x46db63=this;return new Promise(function(_0x3646c9,_0x3f3196){return db[_0x55ab('0x1b')][_0x55ab('0x1c')](_0x67b761[_0x55ab('0x1d')],{'raw':_0x67b761[_0x55ab('0x1e')]?_0x67b761[_0x55ab('0x1e')][_0x55ab('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x67b761[_0x55ab('0x1e')]?_0x67b761['options']['where']||null:null,'attributes':_0x67b761[_0x55ab('0x1e')]?_0x67b761[_0x55ab('0x1e')][_0x55ab('0x20')]||null:null,'limit':_0x67b761[_0x55ab('0x1e')]?_0x67b761[_0x55ab('0x1e')][_0x55ab('0x21')]||null:null})[_0x55ab('0x22')](function(_0x41ec65){logger['info'](_0x55ab('0x23'),_0x67b761);logger[_0x55ab('0x15')](_0x55ab('0x23'),_0x67b761,JSON['stringify'](_0x41ec65));_0x3646c9(_0x41ec65);})[_0x55ab('0x1a')](function(_0x59dc5c){logger[_0x55ab('0x17')](_0x55ab('0x23'),_0x59dc5c[_0x55ab('0x18')],_0x67b761);_0x3f3196(_0x46db63[_0x55ab('0x17')](0x1f4,_0x59dc5c[_0x55ab('0x18')]));});});};exports[_0x55ab('0x24')]=function(_0x5ebeb1){return new Promise(function(_0x3d4656,_0x2471fc){return db[_0x55ab('0x1b')][_0x55ab('0x25')]({'where':_0x5ebeb1[_0x55ab('0x1e')]?_0x5ebeb1[_0x55ab('0x1e')][_0x55ab('0x26')]||null:null})[_0x55ab('0x22')](function(_0x2c4fca){if(_0x2c4fca){return _0x2c4fca[_0x55ab('0x27')](_0x5ebeb1[_0x55ab('0x1d')][_0x55ab('0x28')],_[_0x55ab('0x29')](_0x5ebeb1[_0x55ab('0x1d')],['ids','id'])||{});}})['spread'](function(_0x2c0cdd){logger[_0x55ab('0x12')](_0x55ab('0x2a'),_0x5ebeb1);logger[_0x55ab('0x15')]('AddTags',_0x5ebeb1,JSON['stringify'](_0x2c0cdd));_0x3d4656(_0x2c0cdd);})[_0x55ab('0x1a')](function(_0x1453b9){logger[_0x55ab('0x17')](_0x55ab('0x2a'),_0x1453b9[_0x55ab('0x18')],_0x5ebeb1);_0x2471fc(_this['error'](0x1f4,_0x1453b9[_0x55ab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 9e5dd3f..a4982d9 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 _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x2032,0xd9));var _0x2203=function(_0x19ccf7,_0x5142dd){_0x19ccf7=_0x19ccf7-0x0;var _0x6db405=_0x2032[_0x19ccf7];return _0x6db405;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}}; \ No newline at end of file +var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0xa7a730,_0x507ec3){var _0x1aa35b=function(_0x24adf9){while(--_0x24adf9){_0xa7a730['push'](_0xa7a730['shift']());}};_0x1aa35b(++_0x507ec3);}(_0x757a,0xde));var _0xa757=function(_0x1dabe7,_0x317b6a){_0x1dabe7=_0x1dabe7-0x0;var _0x44ed6b=_0x757a[_0x1dabe7];return _0x44ed6b;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index af3d540..dca398a 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 _0x523f=['multer','connect-timeout','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','show','sms','create','post','status','put','/:id/reject','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x523f,0x156));var _0xf523=function(_0x111104,_0x36b6c1){_0x111104=_0x111104-0x0;var _0x180f70=_0x523f[_0x111104];return _0x180f70;};'use strict';var multer=require(_0xf523('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf523('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xf523('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0xf523('0x3')]('/',auth['isAuthenticated'](),controller[_0xf523('0x4')]);router[_0xf523('0x3')](_0xf523('0x5'),auth[_0xf523('0x6')](),controller[_0xf523('0x7')]);router[_0xf523('0x3')](_0xf523('0x8'),auth[_0xf523('0x6')](),controller[_0xf523('0x9')]);router['post']('/',auth[_0xf523('0x6')](),interaction['tracked'](_0xf523('0xa'),'smsmessage:create'),controller[_0xf523('0xb')]);router[_0xf523('0xc')]('/:id/status',controller[_0xf523('0xd')]);router['put'](_0xf523('0x8'),auth[_0xf523('0x6')](),controller['update']);router[_0xf523('0xe')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0xf523('0xe')](_0xf523('0xf'),auth[_0xf523('0x6')](),controller['reject']);router[_0xf523('0x10')](_0xf523('0x8'),auth[_0xf523('0x6')](),controller[_0xf523('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf235=['tracked','sms','smsmessage:create','create','/:id/status','status','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5e9551,_0x539d4d){var _0x56b205=function(_0x399018){while(--_0x399018){_0x5e9551['push'](_0x5e9551['shift']());}};_0x56b205(++_0x539d4d);}(_0xf235,0xb6));var _0x5f23=function(_0x320064,_0x16bc9e){_0x320064=_0x320064-0x0;var _0xe0b3d6=_0xf235[_0x320064];return _0xe0b3d6;};'use strict';var multer=require('multer');var util=require(_0x5f23('0x0'));var path=require(_0x5f23('0x1'));var timeout=require(_0x5f23('0x2'));var express=require(_0x5f23('0x3'));var router=express[_0x5f23('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5f23('0x5'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x5f23('0x6')]('/',auth[_0x5f23('0x7')](),controller[_0x5f23('0x8')]);router[_0x5f23('0x6')](_0x5f23('0x9'),auth[_0x5f23('0x7')](),controller[_0x5f23('0xa')]);router[_0x5f23('0x6')](_0x5f23('0xb'),auth[_0x5f23('0x7')](),controller[_0x5f23('0xc')]);router[_0x5f23('0xd')]('/',auth[_0x5f23('0x7')](),interaction[_0x5f23('0xe')](_0x5f23('0xf'),_0x5f23('0x10')),controller[_0x5f23('0x11')]);router[_0x5f23('0xd')](_0x5f23('0x12'),controller[_0x5f23('0x13')]);router['put']('/:id',auth[_0x5f23('0x7')](),controller[_0x5f23('0x14')]);router[_0x5f23('0x15')](_0x5f23('0x16'),auth[_0x5f23('0x7')](),controller['accept']);router[_0x5f23('0x15')](_0x5f23('0x17'),auth['isAuthenticated'](),controller[_0x5f23('0x18')]);router[_0x5f23('0x19')](_0x5f23('0xb'),auth[_0x5f23('0x7')](),controller[_0x5f23('0x1a')]);module[_0x5f23('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 4b6a8b4..9e94c72 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 _0x0439=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x0439,0xdd));var _0x9043=function(_0x584098,_0x16cb1d){_0x584098=_0x584098-0x0;var _0x242bb6=_0x0439[_0x584098];return _0x242bb6;};'use strict';var Sequelize=require(_0x9043('0x0'));module[_0x9043('0x1')]={'body':{'type':Sequelize[_0x9043('0x2')](_0x9043('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9043('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9043('0x5')]('in',_0x9043('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9043('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9043('0x7')]},'readAt':{'type':Sequelize[_0x9043('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf150=['TEXT','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0xa09242,_0x13dfdc){var _0x411cd0=function(_0x88dbe4){while(--_0x88dbe4){_0xa09242['push'](_0xa09242['shift']());}};_0x411cd0(++_0x13dfdc);}(_0xf150,0x106));var _0x0f15=function(_0x12263e,_0x330ccf){_0x12263e=_0x12263e-0x0;var _0x453932=_0xf150[_0x12263e];return _0x453932;};'use strict';var Sequelize=require(_0x0f15('0x0'));module[_0x0f15('0x1')]={'body':{'type':Sequelize[_0x0f15('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0f15('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0f15('0x4')]('in',_0x0f15('0x5')),'defaultValue':_0x0f15('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0f15('0x6')](0xbe)},'phone':{'type':Sequelize[_0x0f15('0x6')]},'readAt':{'type':Sequelize[_0x0f15('0x7')]},'secret':{'type':Sequelize[_0x0f15('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 9ba1c04..064307c 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 _0xec0a=['sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','event','EventManager','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','delivered','Status','plivio','inspect','infobip','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec0a,0x86));var _0xaec0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xec0a[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xaec0('0x0'));var emlformat=require(_0xaec0('0x1'));var rimraf=require(_0xaec0('0x2'));var zipdir=require(_0xaec0('0x3'));var jsonpatch=require(_0xaec0('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaec0('0x5'));var path=require(_0xaec0('0x6'));var sox=require(_0xaec0('0x7'));var csv=require(_0xaec0('0x8'));var ejs=require(_0xaec0('0x9'));var fs=require('fs');var _=require(_0xaec0('0xa'));var squel=require(_0xaec0('0xb'));var crypto=require(_0xaec0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaec0('0x8'));var querystring=require(_0xaec0('0xd'));var Papa=require(_0xaec0('0xe'));var Redis=require(_0xaec0('0xf'));var authService=require(_0xaec0('0x10'));var qs=require(_0xaec0('0x11'));var as=require(_0xaec0('0x12'));var hardwareService=require(_0xaec0('0x13'));var logger=require(_0xaec0('0x14'))(_0xaec0('0x15'));var utils=require(_0xaec0('0x16'));var config=require(_0xaec0('0x17'));var db=require(_0xaec0('0x18'))['db'];config['redis']=_[_0xaec0('0x19')](config[_0xaec0('0x1a')],{'host':_0xaec0('0x1b'),'port':0x18eb});var socket=require(_0xaec0('0x1c'))(new Redis(config[_0xaec0('0x1a')]));require(_0xaec0('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xaec0('0x1e')][_0xaec0('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xaec0('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2431b8,_0x377a3f,_0x2ab503){if(_0x2ab503){var _0x5deb4f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5deb4f[_0xaec0('0x20')](_0x377a3f)){return _0x2431b8;}else{throw new db[(_0xaec0('0x21'))][(_0xaec0('0x22'))](_0xaec0('0x23'));}}else{return _0x2431b8;}}function respondWithRpcPromise(_0x1a9861,_0x4bd0cd,_0x25263f,_0x27f013){return new BPromise(function(_0x1132a3,_0xa8824f){var _0x598739=_0x27f013||client;return _0x598739[_0xaec0('0x24')](_0x1a9861,_0x25263f)[_0xaec0('0x25')](function(_0x491c71){logger[_0xaec0('0x26')](_0xaec0('0x27'),_0x4bd0cd,_0xaec0('0x28'));logger[_0xaec0('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4bd0cd,_0xaec0('0x28'),JSON[_0xaec0('0x2a')](_0x491c71));if(_0x491c71[_0xaec0('0x2b')]){if(_0x491c71[_0xaec0('0x2b')][_0xaec0('0x2c')]===0x1f4){logger[_0xaec0('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x4bd0cd,_0x491c71[_0xaec0('0x2b')]['message']);return _0xa8824f(_0x491c71[_0xaec0('0x2b')]['message']);}logger[_0xaec0('0x2b')](_0xaec0('0x27'),_0x4bd0cd,_0x491c71[_0xaec0('0x2b')][_0xaec0('0x2d')]);return _0x1132a3(_0x491c71[_0xaec0('0x2b')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4bd0cd,'request\x20sent');_0x1132a3(_0x491c71[_0xaec0('0x2e')][_0xaec0('0x2d')]);}})[_0xaec0('0x2f')](function(_0x986197){logger[_0xaec0('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x4bd0cd,_0x986197);_0xa8824f(_0x986197);});});}function respondWithStatusCode(_0x476a28,_0x173ad1){_0x173ad1=_0x173ad1||0xcc;return function(_0x5b0e1a){if(_0x5b0e1a){return _0x476a28[_0xaec0('0x30')](_0x173ad1);}return _0x476a28[_0xaec0('0x31')](_0x173ad1)[_0xaec0('0x32')]();};}function respondWithResult(_0x4aceda,_0x342f61){_0x342f61=_0x342f61||0xc8;return function(_0x338922){if(_0x338922){return _0x4aceda[_0xaec0('0x31')](_0x342f61)[_0xaec0('0x33')](_0x338922);}};}function respondWithFilteredResult(_0x2d014f,_0x468990){return function(_0xb3a87f){if(_0xb3a87f){var _0x34334c=_0xb3a87f[_0xaec0('0x34')],_0x5c4524=_0x468990[_0xaec0('0x35')],_0x400ba0=_0x468990[_0xaec0('0x35')]+_0x468990[_0xaec0('0x36')],_0x527683;if(_0x400ba0>=_0x34334c){_0x400ba0=_0x34334c;_0x527683=0xc8;}else{_0x527683=0xce;}_0x2d014f[_0xaec0('0x31')](_0x527683);return _0x2d014f[_0xaec0('0x37')](_0xaec0('0x38'),_0x5c4524+'-'+_0x400ba0+'/'+_0x34334c)[_0xaec0('0x33')](_0xb3a87f);}return null;};}function patchUpdates(_0x18864c){return function(_0x18ba7d){try{jsonpatch[_0xaec0('0x39')](_0x18ba7d,_0x18864c,!![]);}catch(_0xd332cd){return BPromise[_0xaec0('0x3a')](_0xd332cd);}return _0x18ba7d[_0xaec0('0x3b')]();};}function saveUpdates(_0x5ccd15,_0x35e1ad){return function(_0x1f3e3f){if(_0x1f3e3f){return _0x1f3e3f[_0xaec0('0x3c')](_0x5ccd15)[_0xaec0('0x25')](function(_0x6db4df){return _0x6db4df;});}return null;};}function removeEntity(_0x154dda,_0x5e43f8){return function(_0xdb06b9){if(_0xdb06b9){return _0xdb06b9[_0xaec0('0x3d')]()[_0xaec0('0x25')](function(){_0x154dda['status'](0xcc)[_0xaec0('0x32')]();});}};}function handleEntityNotFound(_0x32cb1b,_0x197561){return function(_0x32fc9c){if(!_0x32fc9c){_0x32cb1b['sendStatus'](0x194);}return _0x32fc9c;};}function handleError(_0x1d4f73,_0x498cf9){_0x498cf9=_0x498cf9||0x1f4;return function(_0x35628b){logger[_0xaec0('0x2b')](_0x35628b['stack']);if(_0x35628b[_0xaec0('0x3e')]){delete _0x35628b['name'];}_0x1d4f73['status'](_0x498cf9)[_0xaec0('0x3f')](_0x35628b);};}exports[_0xaec0('0x40')]=function(_0x1f5bd5,_0x2b53e0){var _0x571fd9={},_0x5c1e58={},_0x585eef={'count':0x0,'rows':[]};var _0x101522=_[_0xaec0('0x41')](db[_0xaec0('0x42')][_0xaec0('0x43')],function(_0x4b88f3){return{'name':_0x4b88f3[_0xaec0('0x44')],'type':_0x4b88f3[_0xaec0('0x45')][_0xaec0('0x46')]};});_0x5c1e58[_0xaec0('0x47')]=_[_0xaec0('0x41')](_0x101522,'name');_0x5c1e58['query']=_[_0xaec0('0x48')](_0x1f5bd5[_0xaec0('0x49')]);_0x5c1e58[_0xaec0('0x4a')]=_['intersection'](_0x5c1e58[_0xaec0('0x47')],_0x5c1e58['query']);_0x571fd9[_0xaec0('0x4b')]=_[_0xaec0('0x4c')](_0x5c1e58[_0xaec0('0x47')],qs[_0xaec0('0x4d')](_0x1f5bd5[_0xaec0('0x49')][_0xaec0('0x4d')]));_0x571fd9[_0xaec0('0x4b')]=_0x571fd9[_0xaec0('0x4b')][_0xaec0('0x4e')]?_0x571fd9[_0xaec0('0x4b')]:_0x5c1e58[_0xaec0('0x47')];if(!_0x1f5bd5['query'][_0xaec0('0x4f')]('nolimit')){_0x571fd9[_0xaec0('0x36')]=qs['limit'](_0x1f5bd5[_0xaec0('0x49')][_0xaec0('0x36')]);_0x571fd9[_0xaec0('0x35')]=qs['offset'](_0x1f5bd5[_0xaec0('0x49')][_0xaec0('0x35')]);}_0x571fd9[_0xaec0('0x50')]=qs[_0xaec0('0x51')](_0x1f5bd5[_0xaec0('0x49')][_0xaec0('0x51')]);_0x571fd9[_0xaec0('0x52')]=qs[_0xaec0('0x4a')](_[_0xaec0('0x53')](_0x1f5bd5[_0xaec0('0x49')],_0x5c1e58[_0xaec0('0x4a')]));if(_0x1f5bd5[_0xaec0('0x49')][_0xaec0('0x54')]){_0x571fd9[_0xaec0('0x52')]=_[_0xaec0('0x55')](_0x571fd9[_0xaec0('0x52')],{'$or':_['map'](_0x101522,function(_0x10d0ba){if(_0x10d0ba[_0xaec0('0x45')]!==_0xaec0('0x56')){var _0x28d4f4={};_0x28d4f4[_0x10d0ba[_0xaec0('0x3e')]]={'$like':'%'+_0x1f5bd5['query'][_0xaec0('0x54')]+'%'};return _0x28d4f4;}})});}_0x571fd9=_[_0xaec0('0x55')]({},_0x571fd9,_0x1f5bd5[_0xaec0('0x57')]);var _0x37ba57={'where':_0x571fd9[_0xaec0('0x52')]};return db[_0xaec0('0x42')][_0xaec0('0x34')](_0x37ba57)['then'](function(_0x58553e){_0x585eef[_0xaec0('0x34')]=_0x58553e;if(_0x1f5bd5[_0xaec0('0x49')][_0xaec0('0x58')]){_0x571fd9[_0xaec0('0x59')]=[{'all':!![]}];}return db['SmsMessage'][_0xaec0('0x5a')](_0x571fd9);})[_0xaec0('0x25')](function(_0x3d3d52){_0x585eef[_0xaec0('0x5b')]=_0x3d3d52;return _0x585eef;})['then'](respondWithFilteredResult(_0x2b53e0,_0x571fd9))[_0xaec0('0x2f')](handleError(_0x2b53e0,null));};exports[_0xaec0('0x5c')]=function(_0x414d90,_0x579d62){var _0x39ace9={'raw':!![],'where':{'id':_0x414d90[_0xaec0('0x5d')]['id']}},_0xc2bcfd={};_0xc2bcfd['model']=_['keys'](db[_0xaec0('0x42')][_0xaec0('0x43')]);_0xc2bcfd['query']=_['keys'](_0x414d90[_0xaec0('0x49')]);_0xc2bcfd[_0xaec0('0x4a')]=_[_0xaec0('0x4c')](_0xc2bcfd[_0xaec0('0x47')],_0xc2bcfd[_0xaec0('0x49')]);_0x39ace9['attributes']=_[_0xaec0('0x4c')](_0xc2bcfd[_0xaec0('0x47')],qs[_0xaec0('0x4d')](_0x414d90[_0xaec0('0x49')]['fields']));_0x39ace9[_0xaec0('0x4b')]=_0x39ace9[_0xaec0('0x4b')][_0xaec0('0x4e')]?_0x39ace9['attributes']:_0xc2bcfd[_0xaec0('0x47')];if(_0x414d90['query']['includeAll']){_0x39ace9['include']=[{'all':!![]}];}_0x39ace9=_[_0xaec0('0x55')]({},_0x39ace9,_0x414d90[_0xaec0('0x57')]);return db[_0xaec0('0x42')][_0xaec0('0x5e')](_0x39ace9)[_0xaec0('0x25')](handleEntityNotFound(_0x579d62,null))[_0xaec0('0x25')](respondWithResult(_0x579d62,null))[_0xaec0('0x2f')](handleError(_0x579d62,null));};exports[_0xaec0('0x5f')]=function(_0xc3a482,_0x47cf83){return db[_0xaec0('0x42')][_0xaec0('0x5f')](_0xc3a482[_0xaec0('0x60')],{})[_0xaec0('0x25')](respondWithResult(_0x47cf83,0xc9))['catch'](handleError(_0x47cf83,null));};exports[_0xaec0('0x3c')]=function(_0x5f25fd,_0x3a6944){if(_0x5f25fd[_0xaec0('0x60')]['id']){delete _0x5f25fd[_0xaec0('0x60')]['id'];}return db['SmsMessage'][_0xaec0('0x5e')]({'where':{'id':_0x5f25fd['params']['id']}})[_0xaec0('0x25')](handleEntityNotFound(_0x3a6944,null))[_0xaec0('0x25')](saveUpdates(_0x5f25fd[_0xaec0('0x60')],null))['then'](respondWithResult(_0x3a6944,null))[_0xaec0('0x2f')](handleError(_0x3a6944,null));};exports[_0xaec0('0x3d')]=function(_0x20ba46,_0x48b94b){return db[_0xaec0('0x42')]['find']({'where':{'id':_0x20ba46[_0xaec0('0x5d')]['id']}})[_0xaec0('0x25')](handleEntityNotFound(_0x48b94b,null))['then'](removeEntity(_0x48b94b,null))['catch'](handleError(_0x48b94b,null));};exports[_0xaec0('0x61')]=function(_0x5853dd,_0x1a489f){return db[_0xaec0('0x42')][_0xaec0('0x61')]()['then'](respondWithResult(_0x1a489f,null))[_0xaec0('0x2f')](handleError(_0x1a489f,null));};var interaction_log=require(_0xaec0('0x14'))(_0xaec0('0x62'));exports[_0xaec0('0x63')]=function(_0x3c2f1c,_0x339de9,_0x295723){var _0xf58d54={'channel':'sms'};if(_0x3c2f1c[_0xaec0('0x60')]['id']){delete _0x3c2f1c[_0xaec0('0x60')]['id'];}_0x3c2f1c[_0xaec0('0x60')][_0xaec0('0x64')]=!![];_0x3c2f1c[_0xaec0('0x60')][_0xaec0('0x65')]=moment()[_0xaec0('0x66')](_0xaec0('0x67'));_0x3c2f1c[_0xaec0('0x60')][_0xaec0('0x68')]=_0x3c2f1c[_0xaec0('0x60')][_0xaec0('0x68')]||_0x3c2f1c[_0xaec0('0x69')]['id'];return db['SmsMessage'][_0xaec0('0x5e')]({'where':{'id':_0x3c2f1c['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xaec0('0x25')](handleEntityNotFound(_0x339de9,null))['then'](saveUpdates(_0x3c2f1c[_0xaec0('0x60')],null))[_0xaec0('0x25')](function(_0x1c7297){if(_0x1c7297){_0xf58d54[_0xaec0('0x2d')]=_0x1c7297[_0xaec0('0x6a')]({'plain':!![]});return db[_0xaec0('0x6b')][_0xaec0('0x5e')]({'where':{'id':_0x1c7297['SmsInteractionId']}});}return null;})[_0xaec0('0x25')](handleEntityNotFound(_0x339de9,null))[_0xaec0('0x25')](function(_0x1e13dc){if(_0x1e13dc){return _0x1e13dc[_0xaec0('0x3c')]({'UserId':_0x3c2f1c['body'][_0xaec0('0x68')],'read1stAt':_['isNil'](_0x1e13dc[_0xaec0('0x6c')])?moment()['format'](_0xaec0('0x67')):undefined});}return null;})[_0xaec0('0x25')](function(_0x501a49){if(_0x501a49){_0xf58d54[_0xaec0('0x6d')]=_0x501a49['get']({'plain':!![]});interaction_log['info'](_0xaec0('0x6e'),_0x3c2f1c[_0xaec0('0x69')]['id'],_0x3c2f1c[_0xaec0('0x69')]['name'],_0x3c2f1c[_0xaec0('0x69')][_0xaec0('0x6f')],_0xf58d54[_0xaec0('0x6d')]['id'],_0x3c2f1c[_0xaec0('0x60')]?JSON[_0xaec0('0x2a')](_0x3c2f1c['body']):_0xaec0('0x70'));return respondWithRpcPromise('AcceptMessage',_0xaec0('0x71'),_0xf58d54);}return null;})[_0xaec0('0x25')](function(_0x45ab3f){if(_0x45ab3f){if(_0x3c2f1c[_0xaec0('0x60')][_0xaec0('0x72')]){_0xf58d54[_0xaec0('0x2d')][_0xaec0('0x73')]=util[_0xaec0('0x66')](_0xaec0('0x74'),_0x3c2f1c[_0xaec0('0x69')][_0xaec0('0x3e')]);_0xf58d54[_0xaec0('0x2d')]['channel']=_0xf58d54['channel'];_0xf58d54[_0xaec0('0x2d')][_0xaec0('0x75')]=_0xaec0('0x63');return respondWithRpcPromise(_0xaec0('0x76'),_0xaec0('0x76'),{'event':'acceptmessage','message':_0xf58d54['message']},client9002)[_0xaec0('0x25')](function(){return _0xf58d54;});}return _0xf58d54;}return null;})[_0xaec0('0x25')](respondWithResult(_0x339de9,null))[_0xaec0('0x2f')](handleError(_0x339de9,null));};var interaction_log=require(_0xaec0('0x14'))(_0xaec0('0x62'));exports[_0xaec0('0x3a')]=function(_0x4f0dd5,_0x26912d,_0x46a2c0){var _0x33aa60={'agent':{},'channel':'sms'};if(_0x4f0dd5[_0xaec0('0x60')]['id']){delete _0x4f0dd5[_0xaec0('0x60')]['id'];}_0x4f0dd5[_0xaec0('0x60')][_0xaec0('0x68')]=_0x4f0dd5['body'][_0xaec0('0x68')]||_0x4f0dd5[_0xaec0('0x69')]['id'];_0x33aa60['agent']['id']=_0x4f0dd5[_0xaec0('0x60')][_0xaec0('0x68')];return db['SmsMessage'][_0xaec0('0x5e')]({'where':{'id':_0x4f0dd5[_0xaec0('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x26912d,null))[_0xaec0('0x25')](function(_0x270ec8){if(_0x270ec8){_0x33aa60[_0xaec0('0x2d')]=_0x270ec8[_0xaec0('0x6a')]({'plain':!![]});return db[_0xaec0('0x6b')][_0xaec0('0x5e')]({'where':{'id':_0x270ec8[_0xaec0('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x26912d,null))[_0xaec0('0x25')](function(_0x42b15b){if(_0x42b15b){_0x33aa60[_0xaec0('0x6d')]=_0x42b15b[_0xaec0('0x6a')]({'plain':!![]});interaction_log[_0xaec0('0x26')](_0xaec0('0x78'),_0x4f0dd5[_0xaec0('0x69')]['id'],_0x4f0dd5[_0xaec0('0x69')][_0xaec0('0x3e')],_0x4f0dd5[_0xaec0('0x69')]['role'],_0x33aa60[_0xaec0('0x6d')]['id'],_0x4f0dd5[_0xaec0('0x60')]?JSON['stringify'](_0x4f0dd5[_0xaec0('0x60')]):_0xaec0('0x70'));return respondWithRpcPromise(_0xaec0('0x79'),_0xaec0('0x7a'),_0x33aa60);}return null;})[_0xaec0('0x25')](function(_0x54ef2f){if(_0x54ef2f){_0x54ef2f['message'][_0xaec0('0x73')]=util[_0xaec0('0x66')](_0xaec0('0x74'),_0x4f0dd5['user'][_0xaec0('0x3e')]);_0x54ef2f['message'][_0xaec0('0x7b')]=_0x33aa60[_0xaec0('0x7b')];_0x54ef2f[_0xaec0('0x2d')]['event']='reject';respondWithRpcPromise(_0xaec0('0x76'),'EventManager',{'event':_0xaec0('0x7c'),'message':_0x54ef2f[_0xaec0('0x2d')]},client9002);return _0x33aa60;}return null;})['then'](respondWithResult(_0x26912d,null))[_0xaec0('0x2f')](handleError(_0x26912d,null));};exports[_0xaec0('0x31')]=function(_0x5e7b44,_0x343daf,_0x42d0ac){if(_0x5e7b44['body']['id']){delete _0x5e7b44[_0xaec0('0x60')]['id'];}var _0x290106;return db[_0xaec0('0x42')][_0xaec0('0x5e')]({'where':{'id':_0x5e7b44['params']['id']}})[_0xaec0('0x25')](handleEntityNotFound(_0x343daf,null))[_0xaec0('0x25')](function(_0x30ddbb){if(_0x30ddbb){_0x290106=_0x30ddbb;return db['SmsAccount'][_0xaec0('0x5e')]({'where':{'id':_0x30ddbb[_0xaec0('0x7d')]}});}})[_0xaec0('0x25')](handleEntityNotFound(_0x343daf,null))[_0xaec0('0x25')](function(_0x54be6f){if(_0x54be6f){logger[_0xaec0('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaec0('0x31'),_0xaec0('0x7e'),_0x54be6f[_0xaec0('0x45')],util['inspect'](_0x5e7b44['body'],{'showHidden':![],'depth':null}));switch(_0x54be6f[_0xaec0('0x45')]){case'twilio':if(_0x5e7b44[_0xaec0('0x60')][_0xaec0('0x7f')]&&_0x5e7b44[_0xaec0('0x60')][_0xaec0('0x7f')]===_0x290106[_0xaec0('0x80')]){return _0x290106[_0xaec0('0x3c')]({'read':!![]});}else{logger[_0xaec0('0x2b')](_0xaec0('0x81'),_0xaec0('0x31'),_0xaec0('0x82'),util['inspect'](_0x5e7b44[_0xaec0('0x60')],{'showHidden':![],'depth':null}));}break;case _0xaec0('0x83'):if(_0x5e7b44[_0xaec0('0x60')]['MessageUUID']&&_0x5e7b44[_0xaec0('0x60')][_0xaec0('0x84')]===_0x290106['messageId']&&_[_0xaec0('0x85')](['sent',_0xaec0('0x86')],_0x5e7b44[_0xaec0('0x60')][_0xaec0('0x87')])>=0x0){return _0x290106[_0xaec0('0x3c')]({'read':!![]});}else{logger[_0xaec0('0x2b')](_0xaec0('0x81'),_0xaec0('0x31'),_0xaec0('0x88'),util[_0xaec0('0x89')](_0x5e7b44[_0xaec0('0x60')],{'showHidden':![],'depth':null}));}break;case _0xaec0('0x8a'):var _0x2775ca=_0x5e7b44[_0xaec0('0x60')]['results'][0x0];if(_0x2775ca['status'][_0xaec0('0x8b')]===_0xaec0('0x8c')){return _0x290106[_0xaec0('0x3c')]({'read':!![]});}else{logger[_0xaec0('0x2b')](_0xaec0('0x81'),_0xaec0('0x31'),_0xaec0('0x8a'),util[_0xaec0('0x89')](_0x5e7b44[_0xaec0('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x290106;}})[_0xaec0('0x25')](respondWithResult(_0x343daf,null))[_0xaec0('0x2f')](handleError(_0x343daf,null));}; \ No newline at end of file +var _0xad56=['results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','options','count','findAll','show','params','keys','includeAll','include','merge','find','create','body','describe','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','Status','plivio','inspect','infobip'];(function(_0x48bfba,_0x569f67){var _0x43a250=function(_0x3c9f32){while(--_0x3c9f32){_0x48bfba['push'](_0x48bfba['shift']());}};_0x43a250(++_0x569f67);}(_0xad56,0x11b));var _0x6ad5=function(_0x26670a,_0x19b687){_0x26670a=_0x26670a-0x0;var _0x27f61e=_0xad56[_0x26670a];return _0x27f61e;};'use strict';var pdf=require(_0x6ad5('0x0'));var emlformat=require(_0x6ad5('0x1'));var rimraf=require(_0x6ad5('0x2'));var zipdir=require(_0x6ad5('0x3'));var jsonpatch=require(_0x6ad5('0x4'));var rp=require(_0x6ad5('0x5'));var moment=require(_0x6ad5('0x6'));var BPromise=require(_0x6ad5('0x7'));var Mustache=require(_0x6ad5('0x8'));var util=require(_0x6ad5('0x9'));var path=require(_0x6ad5('0xa'));var sox=require(_0x6ad5('0xb'));var csv=require('to-csv');var ejs=require(_0x6ad5('0xc'));var fs=require('fs');var _=require(_0x6ad5('0xd'));var squel=require('squel');var crypto=require(_0x6ad5('0xe'));var jsforce=require(_0x6ad5('0xf'));var deskjs=require(_0x6ad5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6ad5('0x11'));var Papa=require(_0x6ad5('0x12'));var Redis=require(_0x6ad5('0x13'));var authService=require(_0x6ad5('0x14'));var qs=require(_0x6ad5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ad5('0x16'));var logger=require(_0x6ad5('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x6ad5('0x18'));var db=require(_0x6ad5('0x19'))['db'];config[_0x6ad5('0x1a')]=_[_0x6ad5('0x1b')](config['redis'],{'host':_0x6ad5('0x1c'),'port':0x18eb});var socket=require(_0x6ad5('0x1d'))(new Redis(config[_0x6ad5('0x1a')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x6ad5('0x1e'));var client=jayson[_0x6ad5('0x1f')][_0x6ad5('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x6ad5('0x20')]({'port':0x232a});function checkPasswordPattern(_0x25bbd3,_0x59ef23,_0x3873d8){if(_0x3873d8){var _0xf90b1e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf90b1e[_0x6ad5('0x21')](_0x59ef23)){return _0x25bbd3;}else{throw new db[(_0x6ad5('0x22'))][(_0x6ad5('0x23'))](_0x6ad5('0x24'));}}else{return _0x25bbd3;}}function respondWithRpcPromise(_0x55b039,_0x4dc238,_0x2da825,_0x3fe6be){return new BPromise(function(_0x4aad69,_0xf2a040){var _0x393b3b=_0x3fe6be||client;return _0x393b3b['request'](_0x55b039,_0x2da825)[_0x6ad5('0x25')](function(_0x59170d){logger[_0x6ad5('0x26')](_0x6ad5('0x27'),_0x4dc238,_0x6ad5('0x28'));logger[_0x6ad5('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4dc238,_0x6ad5('0x28'),JSON[_0x6ad5('0x2a')](_0x59170d));if(_0x59170d[_0x6ad5('0x2b')]){if(_0x59170d['error'][_0x6ad5('0x2c')]===0x1f4){logger[_0x6ad5('0x2b')](_0x6ad5('0x27'),_0x4dc238,_0x59170d[_0x6ad5('0x2b')][_0x6ad5('0x2d')]);return _0xf2a040(_0x59170d[_0x6ad5('0x2b')][_0x6ad5('0x2d')]);}logger[_0x6ad5('0x2b')](_0x6ad5('0x27'),_0x4dc238,_0x59170d[_0x6ad5('0x2b')][_0x6ad5('0x2d')]);return _0x4aad69(_0x59170d[_0x6ad5('0x2b')]['message']);}else{logger['info'](_0x6ad5('0x27'),_0x4dc238,_0x6ad5('0x28'));_0x4aad69(_0x59170d['result'][_0x6ad5('0x2d')]);}})[_0x6ad5('0x2e')](function(_0x4d2867){logger['error'](_0x6ad5('0x27'),_0x4dc238,_0x4d2867);_0xf2a040(_0x4d2867);});});}function respondWithStatusCode(_0x451f4d,_0x2e1a51){_0x2e1a51=_0x2e1a51||0xcc;return function(_0x3827bd){if(_0x3827bd){return _0x451f4d[_0x6ad5('0x2f')](_0x2e1a51);}return _0x451f4d[_0x6ad5('0x30')](_0x2e1a51)['end']();};}function respondWithResult(_0x27f126,_0x170378){_0x170378=_0x170378||0xc8;return function(_0x470cfb){if(_0x470cfb){return _0x27f126[_0x6ad5('0x30')](_0x170378)[_0x6ad5('0x31')](_0x470cfb);}};}function respondWithFilteredResult(_0x4f5982,_0x3a67b8){return function(_0x1485b5){if(_0x1485b5){var _0x15440d=_0x1485b5['count'],_0x28b06b=_0x3a67b8[_0x6ad5('0x32')],_0x3bd7a8=_0x3a67b8['offset']+_0x3a67b8[_0x6ad5('0x33')],_0xd1afcd;if(_0x3bd7a8>=_0x15440d){_0x3bd7a8=_0x15440d;_0xd1afcd=0xc8;}else{_0xd1afcd=0xce;}_0x4f5982[_0x6ad5('0x30')](_0xd1afcd);return _0x4f5982[_0x6ad5('0x34')]('Content-Range',_0x28b06b+'-'+_0x3bd7a8+'/'+_0x15440d)[_0x6ad5('0x31')](_0x1485b5);}return null;};}function patchUpdates(_0x2e04e0){return function(_0x567dbf){try{jsonpatch[_0x6ad5('0x35')](_0x567dbf,_0x2e04e0,!![]);}catch(_0x49542e){return BPromise[_0x6ad5('0x36')](_0x49542e);}return _0x567dbf[_0x6ad5('0x37')]();};}function saveUpdates(_0x4f87a5,_0x420094){return function(_0x24b84b){if(_0x24b84b){return _0x24b84b[_0x6ad5('0x38')](_0x4f87a5)[_0x6ad5('0x25')](function(_0x46ddb0){return _0x46ddb0;});}return null;};}function removeEntity(_0x192653,_0x4a773f){return function(_0x480514){if(_0x480514){return _0x480514[_0x6ad5('0x39')]()[_0x6ad5('0x25')](function(){_0x192653[_0x6ad5('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ba1ec,_0x555639){return function(_0x5190ce){if(!_0x5190ce){_0x2ba1ec[_0x6ad5('0x2f')](0x194);}return _0x5190ce;};}function handleError(_0x53c3fd,_0x1c099f){_0x1c099f=_0x1c099f||0x1f4;return function(_0x2e34bf){logger['error'](_0x2e34bf[_0x6ad5('0x3a')]);if(_0x2e34bf[_0x6ad5('0x3b')]){delete _0x2e34bf['name'];}_0x53c3fd[_0x6ad5('0x30')](_0x1c099f)[_0x6ad5('0x3c')](_0x2e34bf);};}exports[_0x6ad5('0x3d')]=function(_0x18873c,_0x26bdfd){var _0x249431={},_0x362527={},_0x5305f4={'count':0x0,'rows':[]};var _0x434208=_[_0x6ad5('0x3e')](db[_0x6ad5('0x3f')][_0x6ad5('0x40')],function(_0x46d6ff){return{'name':_0x46d6ff[_0x6ad5('0x41')],'type':_0x46d6ff[_0x6ad5('0x42')]['key']};});_0x362527[_0x6ad5('0x43')]=_[_0x6ad5('0x3e')](_0x434208,_0x6ad5('0x3b'));_0x362527[_0x6ad5('0x44')]=_['keys'](_0x18873c['query']);_0x362527['filters']=_[_0x6ad5('0x45')](_0x362527[_0x6ad5('0x43')],_0x362527[_0x6ad5('0x44')]);_0x249431[_0x6ad5('0x46')]=_[_0x6ad5('0x45')](_0x362527[_0x6ad5('0x43')],qs[_0x6ad5('0x47')](_0x18873c[_0x6ad5('0x44')]['fields']));_0x249431[_0x6ad5('0x46')]=_0x249431[_0x6ad5('0x46')][_0x6ad5('0x48')]?_0x249431[_0x6ad5('0x46')]:_0x362527[_0x6ad5('0x43')];if(!_0x18873c[_0x6ad5('0x44')][_0x6ad5('0x49')](_0x6ad5('0x4a'))){_0x249431[_0x6ad5('0x33')]=qs['limit'](_0x18873c[_0x6ad5('0x44')][_0x6ad5('0x33')]);_0x249431[_0x6ad5('0x32')]=qs[_0x6ad5('0x32')](_0x18873c[_0x6ad5('0x44')]['offset']);}_0x249431[_0x6ad5('0x4b')]=qs[_0x6ad5('0x4c')](_0x18873c[_0x6ad5('0x44')]['sort']);_0x249431[_0x6ad5('0x4d')]=qs[_0x6ad5('0x4e')](_['pick'](_0x18873c['query'],_0x362527['filters']));if(_0x18873c[_0x6ad5('0x44')]['filter']){_0x249431[_0x6ad5('0x4d')]=_['merge'](_0x249431[_0x6ad5('0x4d')],{'$or':_[_0x6ad5('0x3e')](_0x434208,function(_0xd91b1a){if(_0xd91b1a[_0x6ad5('0x42')]!==_0x6ad5('0x4f')){var _0x5ee327={};_0x5ee327[_0xd91b1a['name']]={'$like':'%'+_0x18873c[_0x6ad5('0x44')][_0x6ad5('0x50')]+'%'};return _0x5ee327;}})});}_0x249431=_['merge']({},_0x249431,_0x18873c[_0x6ad5('0x51')]);var _0x495444={'where':_0x249431[_0x6ad5('0x4d')]};return db[_0x6ad5('0x3f')][_0x6ad5('0x52')](_0x495444)[_0x6ad5('0x25')](function(_0x1b05d0){_0x5305f4[_0x6ad5('0x52')]=_0x1b05d0;if(_0x18873c[_0x6ad5('0x44')]['includeAll']){_0x249431['include']=[{'all':!![]}];}return db[_0x6ad5('0x3f')][_0x6ad5('0x53')](_0x249431);})[_0x6ad5('0x25')](function(_0xb8d807){_0x5305f4['rows']=_0xb8d807;return _0x5305f4;})[_0x6ad5('0x25')](respondWithFilteredResult(_0x26bdfd,_0x249431))['catch'](handleError(_0x26bdfd,null));};exports[_0x6ad5('0x54')]=function(_0x8a2d29,_0x5a9de7){var _0x113279={'raw':!![],'where':{'id':_0x8a2d29[_0x6ad5('0x55')]['id']}},_0x1ccdca={};_0x1ccdca[_0x6ad5('0x43')]=_[_0x6ad5('0x56')](db[_0x6ad5('0x3f')]['rawAttributes']);_0x1ccdca[_0x6ad5('0x44')]=_['keys'](_0x8a2d29['query']);_0x1ccdca[_0x6ad5('0x4e')]=_[_0x6ad5('0x45')](_0x1ccdca['model'],_0x1ccdca[_0x6ad5('0x44')]);_0x113279[_0x6ad5('0x46')]=_['intersection'](_0x1ccdca['model'],qs[_0x6ad5('0x47')](_0x8a2d29[_0x6ad5('0x44')][_0x6ad5('0x47')]));_0x113279[_0x6ad5('0x46')]=_0x113279['attributes'][_0x6ad5('0x48')]?_0x113279['attributes']:_0x1ccdca[_0x6ad5('0x43')];if(_0x8a2d29[_0x6ad5('0x44')][_0x6ad5('0x57')]){_0x113279[_0x6ad5('0x58')]=[{'all':!![]}];}_0x113279=_[_0x6ad5('0x59')]({},_0x113279,_0x8a2d29[_0x6ad5('0x51')]);return db['SmsMessage'][_0x6ad5('0x5a')](_0x113279)[_0x6ad5('0x25')](handleEntityNotFound(_0x5a9de7,null))['then'](respondWithResult(_0x5a9de7,null))[_0x6ad5('0x2e')](handleError(_0x5a9de7,null));};exports[_0x6ad5('0x5b')]=function(_0x4caa34,_0x3e1959){return db[_0x6ad5('0x3f')]['create'](_0x4caa34[_0x6ad5('0x5c')],{})['then'](respondWithResult(_0x3e1959,0xc9))['catch'](handleError(_0x3e1959,null));};exports[_0x6ad5('0x38')]=function(_0x598db7,_0x35f092){if(_0x598db7[_0x6ad5('0x5c')]['id']){delete _0x598db7[_0x6ad5('0x5c')]['id'];}return db[_0x6ad5('0x3f')][_0x6ad5('0x5a')]({'where':{'id':_0x598db7[_0x6ad5('0x55')]['id']}})['then'](handleEntityNotFound(_0x35f092,null))[_0x6ad5('0x25')](saveUpdates(_0x598db7[_0x6ad5('0x5c')],null))[_0x6ad5('0x25')](respondWithResult(_0x35f092,null))[_0x6ad5('0x2e')](handleError(_0x35f092,null));};exports[_0x6ad5('0x39')]=function(_0xe15ce5,_0x55ce52){return db[_0x6ad5('0x3f')][_0x6ad5('0x5a')]({'where':{'id':_0xe15ce5[_0x6ad5('0x55')]['id']}})['then'](handleEntityNotFound(_0x55ce52,null))[_0x6ad5('0x25')](removeEntity(_0x55ce52,null))[_0x6ad5('0x2e')](handleError(_0x55ce52,null));};exports[_0x6ad5('0x5d')]=function(_0x4b6bf8,_0x5c373d){return db[_0x6ad5('0x3f')][_0x6ad5('0x5d')]()['then'](respondWithResult(_0x5c373d,null))['catch'](handleError(_0x5c373d,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x6ad5('0x5e')]=function(_0x4cd3d8,_0x2da838,_0x114a1f){var _0x56eee3={'channel':_0x6ad5('0x5f')};if(_0x4cd3d8['body']['id']){delete _0x4cd3d8[_0x6ad5('0x5c')]['id'];}_0x4cd3d8['body'][_0x6ad5('0x60')]=!![];_0x4cd3d8[_0x6ad5('0x5c')]['readAt']=moment()[_0x6ad5('0x61')](_0x6ad5('0x62'));_0x4cd3d8[_0x6ad5('0x5c')][_0x6ad5('0x63')]=_0x4cd3d8[_0x6ad5('0x5c')][_0x6ad5('0x63')]||_0x4cd3d8[_0x6ad5('0x64')]['id'];return db[_0x6ad5('0x3f')]['find']({'where':{'id':_0x4cd3d8['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x6ad5('0x65')}]})[_0x6ad5('0x25')](handleEntityNotFound(_0x2da838,null))[_0x6ad5('0x25')](saveUpdates(_0x4cd3d8['body'],null))['then'](function(_0x11cae1){if(_0x11cae1){_0x56eee3['message']=_0x11cae1[_0x6ad5('0x66')]({'plain':!![]});return db[_0x6ad5('0x67')][_0x6ad5('0x5a')]({'where':{'id':_0x11cae1[_0x6ad5('0x68')]}});}return null;})[_0x6ad5('0x25')](handleEntityNotFound(_0x2da838,null))[_0x6ad5('0x25')](function(_0x299d0b){if(_0x299d0b){return _0x299d0b[_0x6ad5('0x38')]({'UserId':_0x4cd3d8[_0x6ad5('0x5c')][_0x6ad5('0x63')],'read1stAt':_[_0x6ad5('0x69')](_0x299d0b[_0x6ad5('0x6a')])?moment()[_0x6ad5('0x61')](_0x6ad5('0x62')):undefined});}return null;})[_0x6ad5('0x25')](function(_0x3ec355){if(_0x3ec355){_0x56eee3[_0x6ad5('0x6b')]=_0x3ec355[_0x6ad5('0x66')]({'plain':!![]});interaction_log[_0x6ad5('0x26')](_0x6ad5('0x6c'),_0x4cd3d8['user']['id'],_0x4cd3d8[_0x6ad5('0x64')][_0x6ad5('0x3b')],_0x4cd3d8[_0x6ad5('0x64')][_0x6ad5('0x6d')],_0x56eee3[_0x6ad5('0x6b')]['id'],_0x4cd3d8[_0x6ad5('0x5c')]?JSON[_0x6ad5('0x2a')](_0x4cd3d8[_0x6ad5('0x5c')]):_0x6ad5('0x6e'));return respondWithRpcPromise(_0x6ad5('0x6f'),_0x6ad5('0x70'),_0x56eee3);}return null;})[_0x6ad5('0x25')](function(_0x2c6e81){if(_0x2c6e81){if(_0x4cd3d8[_0x6ad5('0x5c')][_0x6ad5('0x71')]){_0x56eee3['message'][_0x6ad5('0x72')]=util[_0x6ad5('0x61')](_0x6ad5('0x73'),_0x4cd3d8[_0x6ad5('0x64')][_0x6ad5('0x3b')]);_0x56eee3[_0x6ad5('0x2d')][_0x6ad5('0x74')]=_0x56eee3[_0x6ad5('0x74')];_0x56eee3['message'][_0x6ad5('0x75')]='accept';return respondWithRpcPromise(_0x6ad5('0x76'),_0x6ad5('0x76'),{'event':_0x6ad5('0x77'),'message':_0x56eee3[_0x6ad5('0x2d')]},client9002)[_0x6ad5('0x25')](function(){return _0x56eee3;});}return _0x56eee3;}return null;})[_0x6ad5('0x25')](respondWithResult(_0x2da838,null))['catch'](handleError(_0x2da838,null));};var interaction_log=require(_0x6ad5('0x17'))(_0x6ad5('0x78'));exports[_0x6ad5('0x36')]=function(_0x4fcb08,_0x84b8c6,_0x4d5cba){var _0x11e3d1={'agent':{},'channel':_0x6ad5('0x5f')};if(_0x4fcb08[_0x6ad5('0x5c')]['id']){delete _0x4fcb08[_0x6ad5('0x5c')]['id'];}_0x4fcb08['body']['UserId']=_0x4fcb08['body'][_0x6ad5('0x63')]||_0x4fcb08[_0x6ad5('0x64')]['id'];_0x11e3d1[_0x6ad5('0x79')]['id']=_0x4fcb08[_0x6ad5('0x5c')][_0x6ad5('0x63')];return db[_0x6ad5('0x3f')][_0x6ad5('0x5a')]({'where':{'id':_0x4fcb08[_0x6ad5('0x55')]['id'],'UserId':null}})[_0x6ad5('0x25')](handleEntityNotFound(_0x84b8c6,null))[_0x6ad5('0x25')](function(_0x431fe2){if(_0x431fe2){_0x11e3d1[_0x6ad5('0x2d')]=_0x431fe2['get']({'plain':!![]});return db['SmsInteraction'][_0x6ad5('0x5a')]({'where':{'id':_0x431fe2[_0x6ad5('0x68')]}});}return null;})[_0x6ad5('0x25')](handleEntityNotFound(_0x84b8c6,null))[_0x6ad5('0x25')](function(_0x379e2b){if(_0x379e2b){_0x11e3d1[_0x6ad5('0x6b')]=_0x379e2b[_0x6ad5('0x66')]({'plain':!![]});interaction_log[_0x6ad5('0x26')](_0x6ad5('0x7a'),_0x4fcb08[_0x6ad5('0x64')]['id'],_0x4fcb08[_0x6ad5('0x64')][_0x6ad5('0x3b')],_0x4fcb08[_0x6ad5('0x64')]['role'],_0x11e3d1[_0x6ad5('0x6b')]['id'],_0x4fcb08[_0x6ad5('0x5c')]?JSON['stringify'](_0x4fcb08['body']):_0x6ad5('0x6e'));return respondWithRpcPromise(_0x6ad5('0x7b'),_0x6ad5('0x7c'),_0x11e3d1);}return null;})[_0x6ad5('0x25')](function(_0x20a09a){if(_0x20a09a){_0x20a09a[_0x6ad5('0x2d')][_0x6ad5('0x72')]=util[_0x6ad5('0x61')](_0x6ad5('0x73'),_0x4fcb08[_0x6ad5('0x64')][_0x6ad5('0x3b')]);_0x20a09a[_0x6ad5('0x2d')][_0x6ad5('0x74')]=_0x11e3d1[_0x6ad5('0x74')];_0x20a09a['message'][_0x6ad5('0x75')]=_0x6ad5('0x36');respondWithRpcPromise('EventManager',_0x6ad5('0x76'),{'event':'rejectmessage','message':_0x20a09a[_0x6ad5('0x2d')]},client9002);return _0x11e3d1;}return null;})[_0x6ad5('0x25')](respondWithResult(_0x84b8c6,null))[_0x6ad5('0x2e')](handleError(_0x84b8c6,null));};exports[_0x6ad5('0x30')]=function(_0x347345,_0x276672,_0x2ea367){if(_0x347345['body']['id']){delete _0x347345[_0x6ad5('0x5c')]['id'];}var _0x22d00c;return db[_0x6ad5('0x3f')][_0x6ad5('0x5a')]({'where':{'id':_0x347345[_0x6ad5('0x55')]['id']}})['then'](handleEntityNotFound(_0x276672,null))[_0x6ad5('0x25')](function(_0xea6b25){if(_0xea6b25){_0x22d00c=_0xea6b25;return db['SmsAccount']['find']({'where':{'id':_0xea6b25['SmsAccountId']}});}})[_0x6ad5('0x25')](handleEntityNotFound(_0x276672,null))[_0x6ad5('0x25')](function(_0x51c3c6){if(_0x51c3c6){logger[_0x6ad5('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ad5('0x30'),_0x6ad5('0x7d'),_0x51c3c6[_0x6ad5('0x42')],util['inspect'](_0x347345[_0x6ad5('0x5c')],{'showHidden':![],'depth':null}));switch(_0x51c3c6[_0x6ad5('0x42')]){case _0x6ad5('0x7e'):if(_0x347345[_0x6ad5('0x5c')][_0x6ad5('0x7f')]&&_0x347345[_0x6ad5('0x5c')][_0x6ad5('0x7f')]===_0x22d00c[_0x6ad5('0x80')]){return _0x22d00c[_0x6ad5('0x38')]({'read':!![]});}else{logger[_0x6ad5('0x2b')](_0x6ad5('0x81'),_0x6ad5('0x30'),_0x6ad5('0x7e'),util['inspect'](_0x347345['body'],{'showHidden':![],'depth':null}));}break;case _0x6ad5('0x82'):if(_0x347345[_0x6ad5('0x5c')][_0x6ad5('0x83')]&&_0x347345[_0x6ad5('0x5c')]['MessageUUID']===_0x22d00c[_0x6ad5('0x80')]&&_['indexOf']([_0x6ad5('0x84'),'delivered'],_0x347345[_0x6ad5('0x5c')][_0x6ad5('0x85')])>=0x0){return _0x22d00c['update']({'read':!![]});}else{logger[_0x6ad5('0x2b')](_0x6ad5('0x81'),'status',_0x6ad5('0x86'),util[_0x6ad5('0x87')](_0x347345[_0x6ad5('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6ad5('0x88'):var _0x15351b=_0x347345[_0x6ad5('0x5c')][_0x6ad5('0x89')][0x0];if(_0x15351b[_0x6ad5('0x30')][_0x6ad5('0x8a')]===_0x6ad5('0x8b')){return _0x22d00c[_0x6ad5('0x38')]({'read':!![]});}else{logger[_0x6ad5('0x2b')](_0x6ad5('0x81'),'status',_0x6ad5('0x88'),util[_0x6ad5('0x87')](_0x347345[_0x6ad5('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x22d00c;}})[_0x6ad5('0x25')](respondWithResult(_0x276672,null))[_0x6ad5('0x2e')](handleError(_0x276672,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7dad9e7..2f70a8b 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 _0xf0e0=['save','update','emit','hook','exports','events','setMaxListeners'];(function(_0x14712a,_0x18735c){var _0x315307=function(_0x199a5e){while(--_0x199a5e){_0x14712a['push'](_0x14712a['shift']());}};_0x315307(++_0x18735c);}(_0xf0e0,0x116));var _0x0f0e=function(_0x4dd3a6,_0x38b237){_0x4dd3a6=_0x4dd3a6-0x0;var _0x3f3aef=_0xf0e0[_0x4dd3a6];return _0x3f3aef;};'use strict';var EventEmitter=require(_0x0f0e('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0f0e('0x1')](0x0);var events={'afterCreate':_0x0f0e('0x2'),'afterUpdate':_0x0f0e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x30ecae){return function(_0x199be3,_0x593038,_0x3f4b55){SmsMessageEvents[_0x0f0e('0x4')](_0x30ecae+':'+_0x199be3['id'],_0x199be3);SmsMessageEvents['emit'](_0x30ecae,_0x199be3);_0x3f4b55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x0f0e('0x5')](e,emitEvent(event));}}module[_0x0f0e('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x25bb=['exports','events','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x36fdef,_0x5651b0){var _0x4814b0=function(_0x5e470c){while(--_0x5e470c){_0x36fdef['push'](_0x36fdef['shift']());}};_0x4814b0(++_0x5651b0);}(_0x25bb,0x1af));var _0xb25b=function(_0xad080e,_0x127e12){_0xad080e=_0xad080e-0x0;var _0xfc8e5=_0x25bb[_0xad080e];return _0xfc8e5;};'use strict';var EventEmitter=require(_0xb25b('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xb25b('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb25b('0x2')](0x0);var events={'afterCreate':_0xb25b('0x3'),'afterUpdate':_0xb25b('0x4'),'afterDestroy':_0xb25b('0x5')};function emitEvent(_0xe31f6a){return function(_0x3c0715,_0x5f5f40,_0x595ef1){SmsMessageEvents[_0xb25b('0x6')](_0xe31f6a+':'+_0x3c0715['id'],_0x3c0715);SmsMessageEvents[_0xb25b('0x6')](_0xe31f6a,_0x3c0715);_0x595ef1(null);};}for(var e in events){if(events[_0xb25b('0x7')](e)){var event=events[e];SmsMessage[_0xb25b('0x8')](e,emitEvent(event));}}module[_0xb25b('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f75441a..f0ded8c 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 _0x645e=['Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','direction','toLowerCase','out','secret','isNil','SmsInteraction','then','update','createdAt','error','SmsAccount','find','SmsAccountId','type','authToken','phone','accountSid','messages','create','body','remote','/api/sms/messages/','/status?token=','token','sid','catch','afterCreate','twilio','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','inspect','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid'];(function(_0x27a970,_0x4998af){var _0xa63d0a=function(_0x42a7c5){while(--_0x42a7c5){_0x27a970['push'](_0x27a970['shift']());}};_0xa63d0a(++_0x4998af);}(_0x645e,0x191));var _0xe645=function(_0x2ac687,_0x9c85e3){_0x2ac687=_0x2ac687-0x0;var _0x478831=_0x645e[_0x2ac687];return _0x478831;};'use strict';var _=require('lodash');var util=require(_0xe645('0x0'));var logger=require(_0xe645('0x1'))('api');var moment=require(_0xe645('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe645('0x3'));var rimraf=require(_0xe645('0x4'));var config=require(_0xe645('0x5'));var attributes=require(_0xe645('0x6'));module[_0xe645('0x7')]=function(_0x223c83,_0x100edc){return _0x223c83[_0xe645('0x8')](_0xe645('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe645('0xa')]},{'name':_0xe645('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x330c57,_0x53c423,_0x1b9700){var _0x4eff3b=_0x223c83['models'];var _0x2a0296=_0x330c57['get']({'plain':!![]});if(_0x2a0296[_0xe645('0xc')][_0xe645('0xd')]()==='in'||_0x2a0296[_0xe645('0xc')][_0xe645('0xd')]()===_0xe645('0xe')&&!_0x2a0296[_0xe645('0xf')]&&!_[_0xe645('0x10')](_0x2a0296['UserId'])){_0x4eff3b[_0xe645('0x11')]['findOne']({'where':{'id':_0x2a0296['SmsInteractionId']}})[_0xe645('0x12')](function(_0x51cb09){if(_0x51cb09){_0x51cb09[_0xe645('0x13')]({'lastMsgAt':_0x2a0296[_0xe645('0x14')],'lastMsgDirection':_0x2a0296['direction'][_0xe645('0xd')]()});}})['catch'](function(_0x5da7b6){console[_0xe645('0x15')](_0x5da7b6);});}if(_0x2a0296[_0xe645('0xc')]==='out'&&!_0x2a0296[_0xe645('0xf')]){var _0x17396c;_0x4eff3b[_0xe645('0x16')][_0xe645('0x17')]({'where':{'id':_0x2a0296[_0xe645('0x18')]},'raw':!![]})[_0xe645('0x12')](function(_0x39aca6){_0x17396c=_0x39aca6;if(_0x17396c&&_0x17396c[_0xe645('0x19')]){switch(_0x17396c[_0xe645('0x19')]){case'twilio':var _0x522f84=require('twilio');if(_0x17396c['accountSid']&&_0x17396c[_0xe645('0x1a')]&&_0x17396c[_0xe645('0x1b')]){var _0x4a75cb=new _0x522f84(_0x17396c[_0xe645('0x1c')],_0x17396c[_0xe645('0x1a')]);_0x4a75cb[_0xe645('0x1d')][_0xe645('0x1e')]({'body':_0x2a0296[_0xe645('0x1f')],'to':_0x2a0296[_0xe645('0x1b')],'from':_0x17396c['phone'],'statusCallback':_0x17396c[_0xe645('0x20')]+_0xe645('0x21')+_0x2a0296['id']+_0xe645('0x22')+_0x17396c[_0xe645('0x23')]})['then'](function(_0x2c33ec){if(_0x2c33ec['sid']){return _0x330c57[_0xe645('0x13')]({'messageId':_0x2c33ec[_0xe645('0x24')]});}})[_0xe645('0x25')](function(_0x4e86df){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe645('0x26'),_0xe645('0x27'),util['inspect'](_0x4e86df,{'showHidden':![],'depth':null}));});}else{logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x27'),_0xe645('0x29'));}break;case _0xe645('0x2a'):var _0x3eaafd=_0xe645('0x2b');if(_0x17396c['username']&&_0x17396c[_0xe645('0x2c')]){var _0x59b07e={'recipient':[_0x2a0296['phone']],'message':_0x2a0296[_0xe645('0x1f')],'message_type':_0x17396c[_0xe645('0x2d')]};if(_0x17396c[_0xe645('0x2d')]&&_0x17396c['smsMethod']!=='SI'){_0x59b07e[_0xe645('0x2e')]=_0x17396c[_0xe645('0x1b')];}var _0x1a9efc={'url':_0x3eaafd+_0xe645('0x2f')+_0x17396c[_0xe645('0x30')]+_0xe645('0x31')+_0x17396c[_0xe645('0x2c')],'method':_0xe645('0x32')};rp(_0x1a9efc)['then'](function(_0x890365){var _0x415c45=_0x890365['split'](';');var _0x4deb9f={'user_key':_0x415c45[0x0],'session_key':_0x415c45[0x1]};_0x1a9efc={'url':_0x3eaafd+_0xe645('0x33'),'method':_0xe645('0x34'),'headers':{'user_key':_0x4deb9f[_0xe645('0x35')],'Session_key':_0x4deb9f[_0xe645('0x36')]},'json':!![],'body':_0x59b07e};return rp(_0x1a9efc);})[_0xe645('0x12')](function(_0x3d9d7e){if(_0x3d9d7e['total_sent']>=0x1){var _0x5ddc18={'messageId':_0x3d9d7e[_0xe645('0x37')]};if(_0x17396c[_0xe645('0x2d')]!=='GP'||!_0x17396c[_0xe645('0x38')]){_0x5ddc18[_0xe645('0x39')]=!![];}return _0x330c57[_0xe645('0x13')](_0x5ddc18);}else{return logger[_0xe645('0x15')](_0xe645('0x28'),'afterCreate','skebby',util[_0xe645('0x3a')](_0x3d9d7e,{'showHidden':![],'depth':null}));}})[_0xe645('0x25')](function(_0x12f061){return logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x2a'),util[_0xe645('0x3a')](_0x12f061,{'showHidden':![],'depth':null}));});}else{logger[_0xe645('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe645('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe645('0x3b'):if(_0x17396c[_0xe645('0x1a')]){var _0x37aec3={'recipient':_0x2a0296[_0xe645('0x1b')],'message':_0x2a0296['body'],'sender':_0x17396c[_0xe645('0x3c')]||_0x17396c['phone'],'authorization':_0x17396c['authToken']};var _0x53c423={'method':_0xe645('0x34'),'uri':_0xe645('0x3d'),'body':_0x37aec3,'json':!![]};rp(_0x53c423)[_0xe645('0x12')](function(_0x3db372){var _0x27b39c={'messageId':_0x3db372[_0xe645('0x3e')]};if(!_0x17396c[_0xe645('0x38')]){_0x27b39c[_0xe645('0x39')]=!![];}return _0x330c57[_0xe645('0x13')](_0x27b39c);})[_0xe645('0x25')](function(_0xd9e7a3){logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x3b'),util[_0xe645('0x3a')](_0xd9e7a3,{'showHidden':![],'depth':null}));});}else{logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x3b'),_0xe645('0x3f'));}break;case _0xe645('0x40'):if(_0x17396c['username']&&_0x17396c[_0xe645('0x2c')]){var _0x37aec3={'messages':[{'source':_0xe645('0x41'),'to':_0x2a0296[_0xe645('0x1b')],'body':_0x2a0296[_0xe645('0x1f')],'from':_0x17396c[_0xe645('0x3c')]||_0x17396c[_0xe645('0x1b')]}]};var _0x5ea53e=util[_0xe645('0x42')](_0xe645('0x43'),_0x17396c[_0xe645('0x30')],_0x17396c[_0xe645('0x2c')]);var _0x53c423={'method':_0xe645('0x34'),'uri':_0xe645('0x44'),'body':_0x37aec3,'headers':{'Authorization':util[_0xe645('0x42')]('Basic\x20%s',new Buffer(_0x5ea53e)[_0xe645('0x45')](_0xe645('0x46')))},'json':!![]};rp(_0x53c423)[_0xe645('0x12')](function(_0x22493d){if(_0x22493d[_0xe645('0x47')]>=0xc8&&_0x22493d[_0xe645('0x47')]<=0xce){if(_0x22493d[_0xe645('0x48')]&&_0x22493d[_0xe645('0x48')][_0xe645('0x49')]>0x0){var _0x171dba=_['head'](_0x22493d[_0xe645('0x48')]['messages']);var _0x12753a={'messageId':_0x171dba['message_id']};if(!_0x17396c[_0xe645('0x38')]){_0x12753a[_0xe645('0x39')]=!![];}return _0x330c57[_0xe645('0x13')](_0x12753a);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe645('0x26'),_0xe645('0x4a'),util[_0xe645('0x3a')](_0x22493d,{'showHidden':![],'depth':null}));}}else{logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x4a'),util[_0xe645('0x3a')](_0x22493d,{'showHidden':![],'depth':null}));}})[_0xe645('0x25')](function(_0x58c7ce){logger[_0xe645('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe645('0x26'),'clickSend',util['inspect'](_0x58c7ce,{'showHidden':![],'depth':null}));});}else{logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x4a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe645('0x4b'):if(_0x17396c['authId']&&_0x17396c[_0xe645('0x1a')]){var _0x37aec3={'dst':_0x2a0296['phone'],'text':_0x2a0296[_0xe645('0x1f')],'src':_0x17396c[_0xe645('0x3c')]||_0x17396c[_0xe645('0x1b')],'url':_0x17396c[_0xe645('0x20')]+_0xe645('0x21')+_0x2a0296['id']+_0xe645('0x22')+_0x17396c[_0xe645('0x23')]};var _0x5ea53e=util['format'](_0xe645('0x43'),_0x17396c['authId'],_0x17396c[_0xe645('0x1a')]);var _0x53c423={'method':_0xe645('0x34'),'uri':util[_0xe645('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x17396c[_0xe645('0x4c')]),'body':_0x37aec3,'headers':{'Authorization':util[_0xe645('0x42')]('Basic\x20%s',new Buffer(_0x5ea53e)[_0xe645('0x45')](_0xe645('0x46')))},'json':!![]};rp(_0x53c423)[_0xe645('0x12')](function(_0xab87b7){var _0x4e3244={'messageId':_0xab87b7[_0xe645('0x4d')][0x0]};return _0x330c57[_0xe645('0x13')](_0x4e3244);})[_0xe645('0x25')](function(_0xbc9878){logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x4b'),util['inspect'](_0xbc9878,{'showHidden':![],'depth':null}));});}else{logger[_0xe645('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe645('0x26'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xe645('0x4e'):if(_0x17396c[_0xe645('0x30')]&&_0x17396c[_0xe645('0x2c')]){if(_0x17396c['baseUrl']){var _0x578b59={'method':'POST','uri':_0x17396c[_0xe645('0x4f')]+_0xe645('0x50'),'body':{'username':_0x17396c[_0xe645('0x30')],'password':_0x17396c[_0xe645('0x2c')]},'json':!![]};return rp(_0x578b59)['then'](function(_0x53fba2){var _0x3387b5={'method':_0xe645('0x34'),'uri':_0x17396c[_0xe645('0x4f')]+_0xe645('0x51'),'body':{'messages':[{'from':_0x17396c[_0xe645('0x1b')],'destinations':[{'to':_0x2a0296['phone']}],'text':_0x2a0296[_0xe645('0x1f')],'notifyUrl':_0x17396c[_0xe645('0x20')]+_0xe645('0x21')+_0x2a0296['id']+_0xe645('0x22')+_0x17396c[_0xe645('0x23')],'notifyContentType':_0xe645('0x52'),'callbackData':_0x17396c['phone']+';'+_0x2a0296[_0xe645('0x1f')]}]},'headers':{'Authorization':_0xe645('0x53')+_0x53fba2['token']},'json':!![]};return rp(_0x3387b5)[_0xe645('0x12')](function(_0x42aaf3){if(_0x42aaf3[_0xe645('0x1d')]){var _0x5bd6e3={'messageId':_0x42aaf3[_0xe645('0x1d')][0x0][_0xe645('0xa')]};if(!_0x17396c[_0xe645('0x38')]){_0x5bd6e3[_0xe645('0x39')]=!![];}return _0x330c57[_0xe645('0x13')](_0x5bd6e3);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe645('0x4e'),util[_0xe645('0x3a')](_0x42aaf3,{'showHidden':![],'depth':null}));}});})[_0xe645('0x25')](function(_0x1b7394){return logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x4e'),util['inspect'](_0x1b7394,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe645('0x28'),'afterCreate',_0xe645('0x4e'),_0xe645('0x54'));}}else{logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x4e'),_0xe645('0x55'));}break;case _0xe645('0x56'):var _0x463eff=require(_0xe645('0x57'));if(_0x17396c[_0xe645('0x58')]){var _0x2ff396={};_0x2ff396[_0xe645('0x59')]=_0x17396c[_0xe645('0x30')];_0x2ff396[_0xe645('0x1b')]=_0x2a0296[_0xe645('0x1b')];_0x2ff396[_0xe645('0x2e')]=_0x17396c[_0xe645('0x1b')];_0x2ff396[_0xe645('0x5a')]=_0x2a0296[_0xe645('0x1f')];_0x2ff396[_0xe645('0x5b')]=+new Date();var _0x2827ec='';var _0x56c18e='';var _0x149126=Object[_0xe645('0x5c')](_0x2ff396);_0x149126[_0xe645('0x5d')]();for(var _0x1acd0d=0x0;_0x1acd0d<_0x149126[_0xe645('0x5e')];_0x1acd0d++){if(_0x2827ec!=''){_0x2827ec+='&';}_0x2827ec+=_0x149126[_0x1acd0d]+'='+encodeURIComponent(_0x2ff396[_0x149126[_0x1acd0d]]);_0x56c18e+=_0x2ff396[_0x149126[_0x1acd0d]];}_0x56c18e+=_0x17396c[_0xe645('0x58')];_0x56c18e=_0x463eff['createHash']('md5')[_0xe645('0x13')](_0x56c18e)[_0xe645('0x5f')](_0xe645('0x60'));if(_0x2827ec!==''){_0x2827ec+='&';}_0x2827ec+=_0xe645('0x61')+_0x56c18e;var _0x1a9efc={'method':'GET','uri':_0xe645('0x62')+_0x2827ec,'json':!![]};return rp(_0x1a9efc)[_0xe645('0x12')](function(_0x5c2246){var _0x115df7=Object[_0xe645('0x5c')](_0x5c2246);if(_0x5c2246[_0x115df7[0x0]][_0xe645('0x15')]&&parseInt(_0x5c2246[_0x115df7[0x0]][_0xe645('0x15')])===0x0){var _0x7f93bf={'messageId':_0x5c2246[_0x115df7[0x0]][_0xe645('0x63')]};if(!_0x17396c[_0xe645('0x38')]){_0x7f93bf[_0xe645('0x39')]=!![];}return _0x330c57[_0xe645('0x13')](_0x7f93bf);}else{return logger[_0xe645('0x15')](_0xe645('0x28'),'afterCreate','csc',util[_0xe645('0x3a')](_0x5c2246[_0xe645('0x15')],{'showHidden':![],'depth':null}));}})[_0xe645('0x25')](function(_0x4b2e90){return logger['error'](_0xe645('0x28'),_0xe645('0x26'),'csc',util[_0xe645('0x3a')](_0x4b2e90,{'showHidden':![],'depth':null}));});}else{logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x56'),_0xe645('0x64'));}break;case'clickatell':if(_0x17396c[_0xe645('0x58')]){var _0x5a4af1={'method':_0xe645('0x34'),'uri':_0xe645('0x65'),'headers':{'Authorization':_0x17396c['apiKey']},'body':{'content':_0x2a0296[_0xe645('0x1f')],'to':[_0x2a0296['phone']],'from':_0x17396c[_0xe645('0x1b')],'binary':![],'clientMessageId':_0xe645('0x66'),'charset':_0xe645('0x67')},'json':!![]};rp(_0x5a4af1)[_0xe645('0x12')](function(_0x144fe3){if(!_0x144fe3[_0xe645('0x15')]){var _0x54aae5={'messageId':_0x144fe3[_0xe645('0x1d')][0x0]['apiMessageId']};if(!_0x17396c['deliveryReport']){_0x54aae5[_0xe645('0x39')]=!![];}return _0x330c57[_0xe645('0x13')](_0x54aae5);}else{return logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x68'),util[_0xe645('0x3a')](_0x144fe3[_0xe645('0x15')],{'showHidden':![],'depth':null}));}})[_0xe645('0x25')](function(_0x346856){return logger[_0xe645('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe645('0x68'),util[_0xe645('0x3a')](_0x346856,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x68'),'Missing\x20parameters:\x20apiKey');}break;case _0xe645('0x69'):if(_0x17396c[_0xe645('0x58')]){var _0x4eedc6={};var _0x1a9efc={'method':_0xe645('0x34'),'uri':_0xe645('0x6a'),'headers':{'Authorization':_0xe645('0x6b')+_0x17396c[_0xe645('0x58')],'Content-Type':_0xe645('0x52')},'body':{'from':_0x17396c['phone'],'to':_0x2a0296[_0xe645('0x1b')],'text':_0x2a0296[_0xe645('0x1f')]},'json':!![]};return rp(_0x1a9efc)[_0xe645('0x12')](function(_0xd388f){if(_0xd388f[_0xe645('0x6c')]==0xca){_0x4eedc6[_0xe645('0x6d')]=_0xd388f;var _0xe2b03d={'method':_0xe645('0x34'),'uri':_0xe645('0x6e'),'headers':{'Authorization':_0xe645('0x6b')+_0x17396c[_0xe645('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x4eedc6[_0xe645('0x6d')][_0xe645('0x6f')]},'json':!![]};return rp(_0xe2b03d)[_0xe645('0x12')](function(_0x26682c){_0x4eedc6[_0xe645('0x70')]=_0x26682c;var _0x10c877={'messageId':_0x4eedc6[_0xe645('0x6d')][_0xe645('0x6f')],'read':!![]};return _0x330c57['update'](_0x10c877);});}else{return logger[_0xe645('0x15')](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x69'),util[_0xe645('0x3a')](_0xd388f,{'showHidden':![],'depth':null}));}})['catch'](function(_0xdcaf15){return logger['error'](_0xe645('0x28'),_0xe645('0x26'),_0xe645('0x69'),util[_0xe645('0x3a')](_0xdcaf15,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe645('0x28'),_0xe645('0x26'),'intelepeer','Token\x20not\x20received');}break;}}})[_0xe645('0x71')](function(){_0x1b9700();});}else{_0x1b9700();}}},'charset':_0xe645('0x72'),'collate':_0xe645('0x73')});}; \ No newline at end of file +var _0x373f=['define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','findOne','update','createdAt','error','SmsAccount','find','SmsAccountId','then','type','twilio','authToken','accountSid','messages','phone','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','sender','GET','split','POST','session_key','smsMethod','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','deliveryReport','clickSend','catch','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','token','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','keys','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','uuid','apiMessageId','clickatell','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes'];(function(_0x4240bc,_0xa8431d){var _0x52dabe=function(_0x474c38){while(--_0x474c38){_0x4240bc['push'](_0x4240bc['shift']());}};_0x52dabe(++_0xa8431d);}(_0x373f,0x1bb));var _0xf373=function(_0x1d68a1,_0x375a62){_0x1d68a1=_0x1d68a1-0x0;var _0x230be1=_0x373f[_0x1d68a1];return _0x230be1;};'use strict';var _=require(_0xf373('0x0'));var util=require(_0xf373('0x1'));var logger=require('../../config/logger')(_0xf373('0x2'));var moment=require(_0xf373('0x3'));var BPromise=require(_0xf373('0x4'));var rp=require(_0xf373('0x5'));var fs=require('fs');var path=require(_0xf373('0x6'));var rimraf=require('rimraf');var config=require(_0xf373('0x7'));var attributes=require(_0xf373('0x8'));module['exports']=function(_0x4d5102,_0x740c63){return _0x4d5102[_0xf373('0x9')](_0xf373('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xf373('0xb'),'fields':[_0xf373('0xb')]},{'name':_0xf373('0xc'),'fields':[_0xf373('0xd')],'type':_0xf373('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x330655,_0x2bd8d3,_0x47a459){var _0x28ef6d=_0x4d5102[_0xf373('0xf')];var _0x40c41c=_0x330655[_0xf373('0x10')]({'plain':!![]});if(_0x40c41c[_0xf373('0x11')][_0xf373('0x12')]()==='in'||_0x40c41c['direction'][_0xf373('0x12')]()===_0xf373('0x13')&&!_0x40c41c[_0xf373('0x14')]&&!_[_0xf373('0x15')](_0x40c41c['UserId'])){_0x28ef6d[_0xf373('0x16')][_0xf373('0x17')]({'where':{'id':_0x40c41c['SmsInteractionId']}})['then'](function(_0x542619){if(_0x542619){_0x542619[_0xf373('0x18')]({'lastMsgAt':_0x40c41c[_0xf373('0x19')],'lastMsgDirection':_0x40c41c[_0xf373('0x11')]['toLowerCase']()});}})['catch'](function(_0x2b16ca){console[_0xf373('0x1a')](_0x2b16ca);});}if(_0x40c41c[_0xf373('0x11')]===_0xf373('0x13')&&!_0x40c41c[_0xf373('0x14')]){var _0x2e8ca9;_0x28ef6d[_0xf373('0x1b')][_0xf373('0x1c')]({'where':{'id':_0x40c41c[_0xf373('0x1d')]},'raw':!![]})[_0xf373('0x1e')](function(_0x24de3e){_0x2e8ca9=_0x24de3e;if(_0x2e8ca9&&_0x2e8ca9[_0xf373('0x1f')]){switch(_0x2e8ca9[_0xf373('0x1f')]){case _0xf373('0x20'):var _0x3e9892=require(_0xf373('0x20'));if(_0x2e8ca9['accountSid']&&_0x2e8ca9[_0xf373('0x21')]&&_0x2e8ca9['phone']){var _0x26f756=new _0x3e9892(_0x2e8ca9[_0xf373('0x22')],_0x2e8ca9[_0xf373('0x21')]);_0x26f756[_0xf373('0x23')]['create']({'body':_0x40c41c[_0xf373('0xd')],'to':_0x40c41c[_0xf373('0x24')],'from':_0x2e8ca9['phone'],'statusCallback':_0x2e8ca9['remote']+_0xf373('0x25')+_0x40c41c['id']+_0xf373('0x26')+_0x2e8ca9['token']})['then'](function(_0x3545fe){if(_0x3545fe[_0xf373('0x27')]){return _0x330655[_0xf373('0x18')]({'messageId':_0x3545fe['sid']});}})['catch'](function(_0x504a11){logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x20'),util['inspect'](_0x504a11,{'showHidden':![],'depth':null}));});}else{logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf373('0x2a'):var _0x48cd5c=_0xf373('0x2b');if(_0x2e8ca9[_0xf373('0x2c')]&&_0x2e8ca9[_0xf373('0x2d')]){var _0x221777={'recipient':[_0x40c41c[_0xf373('0x24')]],'message':_0x40c41c['body'],'message_type':_0x2e8ca9['smsMethod']};if(_0x2e8ca9['smsMethod']&&_0x2e8ca9['smsMethod']!=='SI'){_0x221777[_0xf373('0x2e')]=_0x2e8ca9[_0xf373('0x24')];}var _0x3aa221={'url':_0x48cd5c+'login?username='+_0x2e8ca9['username']+'&password='+_0x2e8ca9[_0xf373('0x2d')],'method':_0xf373('0x2f')};rp(_0x3aa221)[_0xf373('0x1e')](function(_0x17e6b8){var _0x9fd794=_0x17e6b8[_0xf373('0x30')](';');var _0x535c34={'user_key':_0x9fd794[0x0],'session_key':_0x9fd794[0x1]};_0x3aa221={'url':_0x48cd5c+'sms','method':_0xf373('0x31'),'headers':{'user_key':_0x535c34['user_key'],'Session_key':_0x535c34[_0xf373('0x32')]},'json':!![],'body':_0x221777};return rp(_0x3aa221);})['then'](function(_0x2fe3ee){if(_0x2fe3ee['total_sent']>=0x1){var _0x3cca6d={'messageId':_0x2fe3ee['internal_order_id']};if(_0x2e8ca9[_0xf373('0x33')]!=='GP'||!_0x2e8ca9['deliveryReport']){_0x3cca6d[_0xf373('0x34')]=!![];}return _0x330655[_0xf373('0x18')](_0x3cca6d);}else{return logger[_0xf373('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf373('0x29'),_0xf373('0x2a'),util[_0xf373('0x35')](_0x2fe3ee,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3b89e8){return logger[_0xf373('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf373('0x29'),_0xf373('0x2a'),util['inspect'](_0x3b89e8,{'showHidden':![],'depth':null}));});}else{logger[_0xf373('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf373('0x29'),_0xf373('0x2a'),_0xf373('0x36'));}break;case _0xf373('0x37'):if(_0x2e8ca9[_0xf373('0x21')]){var _0x3f43c4={'recipient':_0x40c41c[_0xf373('0x24')],'message':_0x40c41c[_0xf373('0xd')],'sender':_0x2e8ca9[_0xf373('0x38')]||_0x2e8ca9[_0xf373('0x24')],'authorization':_0x2e8ca9[_0xf373('0x21')]};var _0x2bd8d3={'method':_0xf373('0x31'),'uri':_0xf373('0x39'),'body':_0x3f43c4,'json':!![]};rp(_0x2bd8d3)[_0xf373('0x1e')](function(_0x1d5a15){var _0x133156={'messageId':_0x1d5a15['requestid']};if(!_0x2e8ca9['deliveryReport']){_0x133156[_0xf373('0x34')]=!![];}return _0x330655['update'](_0x133156);})['catch'](function(_0x2d2413){logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x37'),util[_0xf373('0x35')](_0x2d2413,{'showHidden':![],'depth':null}));});}else{logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x37'),_0xf373('0x3a'));}break;case _0xf373('0x3b'):if(_0x2e8ca9['username']&&_0x2e8ca9[_0xf373('0x2d')]){var _0x3f43c4={'messages':[{'source':_0xf373('0x3c'),'to':_0x40c41c[_0xf373('0x24')],'body':_0x40c41c[_0xf373('0xd')],'from':_0x2e8ca9[_0xf373('0x38')]||_0x2e8ca9[_0xf373('0x24')]}]};var _0x2cc5bd=util[_0xf373('0x3d')](_0xf373('0x3e'),_0x2e8ca9['username'],_0x2e8ca9[_0xf373('0x2d')]);var _0x2bd8d3={'method':_0xf373('0x31'),'uri':_0xf373('0x3f'),'body':_0x3f43c4,'headers':{'Authorization':util[_0xf373('0x3d')]('Basic\x20%s',new Buffer(_0x2cc5bd)[_0xf373('0x40')](_0xf373('0x41')))},'json':!![]};rp(_0x2bd8d3)[_0xf373('0x1e')](function(_0x2f6880){if(_0x2f6880[_0xf373('0x42')]>=0xc8&&_0x2f6880[_0xf373('0x42')]<=0xce){if(_0x2f6880[_0xf373('0x43')]&&_0x2f6880[_0xf373('0x43')][_0xf373('0x44')]>0x0){var _0x52bfc2=_[_0xf373('0x45')](_0x2f6880[_0xf373('0x43')][_0xf373('0x23')]);var _0x2d5dbd={'messageId':_0x52bfc2[_0xf373('0x46')]};if(!_0x2e8ca9[_0xf373('0x47')]){_0x2d5dbd['read']=!![];}return _0x330655[_0xf373('0x18')](_0x2d5dbd);}else{logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),'clickSend',util['inspect'](_0x2f6880,{'showHidden':![],'depth':null}));}}else{logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x48'),util[_0xf373('0x35')](_0x2f6880,{'showHidden':![],'depth':null}));}})[_0xf373('0x49')](function(_0x1afb57){logger[_0xf373('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf373('0x29'),_0xf373('0x48'),util[_0xf373('0x35')](_0x1afb57,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x48'),_0xf373('0x36'));}break;case _0xf373('0x4a'):if(_0x2e8ca9[_0xf373('0x4b')]&&_0x2e8ca9[_0xf373('0x21')]){var _0x3f43c4={'dst':_0x40c41c[_0xf373('0x24')],'text':_0x40c41c[_0xf373('0xd')],'src':_0x2e8ca9['senderString']||_0x2e8ca9[_0xf373('0x24')],'url':_0x2e8ca9[_0xf373('0x4c')]+'/api/sms/messages/'+_0x40c41c['id']+_0xf373('0x26')+_0x2e8ca9['token']};var _0x2cc5bd=util[_0xf373('0x3d')]('%s:%s',_0x2e8ca9[_0xf373('0x4b')],_0x2e8ca9['authToken']);var _0x2bd8d3={'method':'POST','uri':util[_0xf373('0x3d')](_0xf373('0x4d'),_0x2e8ca9[_0xf373('0x4b')]),'body':_0x3f43c4,'headers':{'Authorization':util[_0xf373('0x3d')](_0xf373('0x4e'),new Buffer(_0x2cc5bd)['toString']('base64'))},'json':!![]};rp(_0x2bd8d3)[_0xf373('0x1e')](function(_0x174503){var _0x2bd836={'messageId':_0x174503[_0xf373('0x4f')][0x0]};return _0x330655[_0xf373('0x18')](_0x2bd836);})[_0xf373('0x49')](function(_0x32f005){logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x4a'),util['inspect'](_0x32f005,{'showHidden':![],'depth':null}));});}else{logger[_0xf373('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf373('0x4a'),_0xf373('0x50'));}break;case _0xf373('0x51'):if(_0x2e8ca9[_0xf373('0x2c')]&&_0x2e8ca9['password']){if(_0x2e8ca9[_0xf373('0x52')]){var _0x25cb67={'method':_0xf373('0x31'),'uri':_0x2e8ca9['baseUrl']+'/auth/1/session','body':{'username':_0x2e8ca9[_0xf373('0x2c')],'password':_0x2e8ca9[_0xf373('0x2d')]},'json':!![]};return rp(_0x25cb67)[_0xf373('0x1e')](function(_0x5accac){var _0x454faa={'method':'POST','uri':_0x2e8ca9[_0xf373('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2e8ca9['phone'],'destinations':[{'to':_0x40c41c[_0xf373('0x24')]}],'text':_0x40c41c[_0xf373('0xd')],'notifyUrl':_0x2e8ca9[_0xf373('0x4c')]+_0xf373('0x25')+_0x40c41c['id']+_0xf373('0x26')+_0x2e8ca9[_0xf373('0x53')],'notifyContentType':'application/json','callbackData':_0x2e8ca9[_0xf373('0x24')]+';'+_0x40c41c[_0xf373('0xd')]}]},'headers':{'Authorization':_0xf373('0x54')+_0x5accac[_0xf373('0x53')]},'json':!![]};return rp(_0x454faa)[_0xf373('0x1e')](function(_0x363326){if(_0x363326[_0xf373('0x23')]){var _0x5948c5={'messageId':_0x363326[_0xf373('0x23')][0x0][_0xf373('0xb')]};if(!_0x2e8ca9['deliveryReport']){_0x5948c5[_0xf373('0x34')]=!![];}return _0x330655['update'](_0x5948c5);}else{return logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x51'),util[_0xf373('0x35')](_0x363326,{'showHidden':![],'depth':null}));}});})[_0xf373('0x49')](function(_0x58a5ce){return logger['error'](_0xf373('0x28'),'afterCreate',_0xf373('0x51'),util['inspect'](_0x58a5ce,{'showHidden':![],'depth':null}));});}else{logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x51'),_0xf373('0x36'));}break;case _0xf373('0x55'):var _0x361156=require(_0xf373('0x56'));if(_0x2e8ca9[_0xf373('0x57')]){var _0xec9a41={};_0xec9a41[_0xf373('0x58')]=_0x2e8ca9[_0xf373('0x2c')];_0xec9a41[_0xf373('0x24')]=_0x40c41c[_0xf373('0x24')];_0xec9a41[_0xf373('0x2e')]=_0x2e8ca9[_0xf373('0x24')];_0xec9a41[_0xf373('0x59')]=_0x40c41c[_0xf373('0xd')];_0xec9a41[_0xf373('0x5a')]=+new Date();var _0x100a9b='';var _0x54b4f5='';var _0x57806b=Object[_0xf373('0x5b')](_0xec9a41);_0x57806b['sort']();for(var _0x10ce9d=0x0;_0x10ce9d<_0x57806b['length'];_0x10ce9d++){if(_0x100a9b!=''){_0x100a9b+='&';}_0x100a9b+=_0x57806b[_0x10ce9d]+'='+encodeURIComponent(_0xec9a41[_0x57806b[_0x10ce9d]]);_0x54b4f5+=_0xec9a41[_0x57806b[_0x10ce9d]];}_0x54b4f5+=_0x2e8ca9[_0xf373('0x57')];_0x54b4f5=_0x361156['createHash'](_0xf373('0x5c'))[_0xf373('0x18')](_0x54b4f5)[_0xf373('0x5d')](_0xf373('0x5e'));if(_0x100a9b!==''){_0x100a9b+='&';}_0x100a9b+=_0xf373('0x5f')+_0x54b4f5;var _0x3aa221={'method':_0xf373('0x2f'),'uri':_0xf373('0x60')+_0x100a9b,'json':!![]};return rp(_0x3aa221)['then'](function(_0x19dc7b){var _0x51b526=Object[_0xf373('0x5b')](_0x19dc7b);if(_0x19dc7b[_0x51b526[0x0]][_0xf373('0x1a')]&&parseInt(_0x19dc7b[_0x51b526[0x0]][_0xf373('0x1a')])===0x0){var _0x4a0fb4={'messageId':_0x19dc7b[_0x51b526[0x0]][_0xf373('0x61')]};if(!_0x2e8ca9[_0xf373('0x47')]){_0x4a0fb4['read']=!![];}return _0x330655[_0xf373('0x18')](_0x4a0fb4);}else{return logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x55'),util[_0xf373('0x35')](_0x19dc7b[_0xf373('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x10e7bf){return logger[_0xf373('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xf373('0x35')](_0x10e7bf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf373('0x28'),'afterCreate',_0xf373('0x55'),_0xf373('0x62'));}break;case'clickatell':if(_0x2e8ca9['apiKey']){var _0x3ed6c1={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2e8ca9[_0xf373('0x57')]},'body':{'content':_0x40c41c['body'],'to':[_0x40c41c['phone']],'from':_0x2e8ca9['phone'],'binary':![],'clientMessageId':_0xf373('0x63'),'charset':'UTF-8'},'json':!![]};rp(_0x3ed6c1)[_0xf373('0x1e')](function(_0x3d9f80){if(!_0x3d9f80[_0xf373('0x1a')]){var _0x4784e8={'messageId':_0x3d9f80['messages'][0x0][_0xf373('0x64')]};if(!_0x2e8ca9['deliveryReport']){_0x4784e8[_0xf373('0x34')]=!![];}return _0x330655[_0xf373('0x18')](_0x4784e8);}else{return logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),'clickatell',util[_0xf373('0x35')](_0x3d9f80[_0xf373('0x1a')],{'showHidden':![],'depth':null}));}})[_0xf373('0x49')](function(_0x4c999b){return logger['error'](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x65'),util['inspect'](_0x4c999b,{'showHidden':![],'depth':null}));});}else{logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x65'),_0xf373('0x62'));}break;case'intelepeer':if(_0x2e8ca9[_0xf373('0x57')]){var _0x27901c={};var _0x3aa221={'method':_0xf373('0x31'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x2e8ca9[_0xf373('0x57')],'Content-Type':_0xf373('0x66')},'body':{'from':_0x2e8ca9['phone'],'to':_0x40c41c[_0xf373('0x24')],'text':_0x40c41c['body']},'json':!![]};return rp(_0x3aa221)[_0xf373('0x1e')](function(_0x2a5d55){if(_0x2a5d55[_0xf373('0x67')]==0xca){_0x27901c[_0xf373('0x68')]=_0x2a5d55;var _0x439ffd={'method':_0xf373('0x31'),'uri':_0xf373('0x69'),'headers':{'Authorization':_0xf373('0x6a')+_0x2e8ca9[_0xf373('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x27901c[_0xf373('0x68')]['refid']},'json':!![]};return rp(_0x439ffd)[_0xf373('0x1e')](function(_0x1c0bef){_0x27901c['status']=_0x1c0bef;var _0x252ad3={'messageId':_0x27901c[_0xf373('0x68')][_0xf373('0x6b')],'read':!![]};return _0x330655['update'](_0x252ad3);});}else{return logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x6c'),util[_0xf373('0x35')](_0x2a5d55,{'showHidden':![],'depth':null}));}})[_0xf373('0x49')](function(_0x1317bc){return logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x6c'),util[_0xf373('0x35')](_0x1317bc,{'showHidden':![],'depth':null}));});}else{return logger[_0xf373('0x1a')](_0xf373('0x28'),_0xf373('0x29'),_0xf373('0x6c'),_0xf373('0x6d'));}break;}}})[_0xf373('0x6e')](function(){_0x47a459();});}else{_0x47a459();}}},'charset':_0xf373('0x6f'),'collate':_0xf373('0x70')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fa2ba87..8379470 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 _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x1199ae,_0x4d3766){var _0x211782=function(_0x1c7877){while(--_0x1c7877){_0x1199ae['push'](_0x1199ae['shift']());}};_0x211782(++_0x4d3766);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f14bd,_0x28b9db){_0x4f14bd=_0x4f14bd-0x0;var _0x515b8b=_0xb10b[_0x4f14bd];return _0x515b8b;};'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')]('SmsMessage,\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')]('SmsMessage,\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')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file +var _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xda2d,0x102));var _0xdda2=function(_0x1fba57,_0x225d98){_0x1fba57=_0x1fba57-0x0;var _0x3b350d=_0xda2d[_0x1fba57];return _0x3b350d;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('SmsMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateSmsMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index caefd67..b3aa9d1 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 _0x88d9=['save','remove','emit','removeListener','length','smsMessage:','./smsMessage.events'];(function(_0x465aa5,_0x125aa5){var _0x5dbb6a=function(_0x2097a6){while(--_0x2097a6){_0x465aa5['push'](_0x465aa5['shift']());}};_0x5dbb6a(++_0x125aa5);}(_0x88d9,0xa0));var _0x988d=function(_0x3815ed,_0x363707){_0x3815ed=_0x3815ed-0x0;var _0x32503d=_0x88d9[_0x3815ed];return _0x32503d;};'use strict';var SmsMessageEvents=require(_0x988d('0x0'));var events=[_0x988d('0x1'),_0x988d('0x2'),'update'];function createListener(_0x25a980,_0x136fe3){return function(_0x2c1fe2){_0x136fe3[_0x988d('0x3')](_0x25a980,_0x2c1fe2);};}function removeListener(_0x53c333,_0x4cad36){return function(){SmsMessageEvents[_0x988d('0x4')](_0x53c333,_0x4cad36);};}exports['register']=function(_0x5cb009){for(var _0x5a7aa8=0x0,_0xd9ff4e=events[_0x988d('0x5')];_0x5a7aa8<_0xd9ff4e;_0x5a7aa8++){var _0x1ad8b5=events[_0x5a7aa8];var _0x5e6848=createListener(_0x988d('0x6')+_0x1ad8b5,_0x5cb009);SmsMessageEvents['on'](_0x1ad8b5,_0x5e6848);}}; \ No newline at end of file +var _0x0277=['emit','removeListener','register','length','./smsMessage.events','save','remove'];(function(_0x3e5e13,_0x442f46){var _0x4bda87=function(_0x1a6236){while(--_0x1a6236){_0x3e5e13['push'](_0x3e5e13['shift']());}};_0x4bda87(++_0x442f46);}(_0x0277,0x1b6));var _0x7027=function(_0x5491e2,_0x50091d){_0x5491e2=_0x5491e2-0x0;var _0x28d78e=_0x0277[_0x5491e2];return _0x28d78e;};'use strict';var SmsMessageEvents=require(_0x7027('0x0'));var events=[_0x7027('0x1'),_0x7027('0x2'),'update'];function createListener(_0x2c0acd,_0x227edd){return function(_0x548d83){_0x227edd[_0x7027('0x3')](_0x2c0acd,_0x548d83);};}function removeListener(_0x3a5666,_0x525f65){return function(){SmsMessageEvents[_0x7027('0x4')](_0x3a5666,_0x525f65);};}exports[_0x7027('0x5')]=function(_0x56494b){for(var _0x4de05c=0x0,_0x524bc7=events[_0x7027('0x6')];_0x4de05c<_0x524bc7;_0x4de05c++){var _0x148352=events[_0x4de05c];var _0x2587c2=createListener('smsMessage:'+_0x148352,_0x56494b);SmsMessageEvents['on'](_0x148352,_0x2587c2);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 01bfb6d..d90d6bf 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 _0x2d2c=['Router','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x32746f,_0x28de01){var _0xd0109=function(_0x554f66){while(--_0x554f66){_0x32746f['push'](_0x32746f['shift']());}};_0xd0109(++_0x28de01);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x2d2c[_0x3b0912];return _0xa8f339;};'use strict';var multer=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var path=require(_0xc2d2('0x2'));var timeout=require(_0xc2d2('0x3'));var express=require(_0xc2d2('0x4'));var router=express[_0xc2d2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc2d2('0x6'));var config=require('../../config/environment');var controller=require(_0xc2d2('0x7'));router[_0xc2d2('0x8')]('/',auth[_0xc2d2('0x9')](),controller[_0xc2d2('0xa')]);router[_0xc2d2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc2d2('0xb')]);router[_0xc2d2('0x8')](_0xc2d2('0xc'),auth[_0xc2d2('0x9')](),controller[_0xc2d2('0xd')]);router[_0xc2d2('0x8')](_0xc2d2('0xe'),auth[_0xc2d2('0x9')](),controller[_0xc2d2('0xf')]);router[_0xc2d2('0x8')](_0xc2d2('0x10'),auth[_0xc2d2('0x9')](),controller['getTeams']);router[_0xc2d2('0x8')](_0xc2d2('0x11'),auth[_0xc2d2('0x9')](),controller['getAgents']);router[_0xc2d2('0x12')]('/',auth[_0xc2d2('0x9')](),controller['create']);router[_0xc2d2('0x12')](_0xc2d2('0x10'),auth['isAuthenticated'](),controller[_0xc2d2('0x13')]);router['post']('/:id/users',auth[_0xc2d2('0x9')](),controller[_0xc2d2('0x14')]);router[_0xc2d2('0x15')](_0xc2d2('0xc'),auth[_0xc2d2('0x9')](),controller[_0xc2d2('0x16')]);router[_0xc2d2('0x17')](_0xc2d2('0xc'),auth[_0xc2d2('0x9')](),controller[_0xc2d2('0x18')]);router[_0xc2d2('0x17')]('/:id/teams',auth[_0xc2d2('0x9')](),controller[_0xc2d2('0x19')]);router[_0xc2d2('0x17')](_0xc2d2('0x11'),auth['isAuthenticated'](),controller[_0xc2d2('0x1a')]);module[_0xc2d2('0x1b')]=router; \ No newline at end of file +var _0x94ba=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsQueue.controller','index','get','/describe','isAuthenticated','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','removeAgents'];(function(_0x55fc40,_0x3363b4){var _0x29b61f=function(_0x24f56b){while(--_0x24f56b){_0x55fc40['push'](_0x55fc40['shift']());}};_0x29b61f(++_0x3363b4);}(_0x94ba,0xbe));var _0xa94b=function(_0x382602,_0x5e9d2d){_0x382602=_0x382602-0x0;var _0x14dda6=_0x94ba[_0x382602];return _0x14dda6;};'use strict';var multer=require(_0xa94b('0x0'));var util=require(_0xa94b('0x1'));var path=require(_0xa94b('0x2'));var timeout=require(_0xa94b('0x3'));var express=require(_0xa94b('0x4'));var router=express['Router']();var auth=require(_0xa94b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa94b('0x6'));var controller=require(_0xa94b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa94b('0x8')]);router[_0xa94b('0x9')](_0xa94b('0xa'),auth[_0xa94b('0xb')](),controller['describe']);router[_0xa94b('0x9')](_0xa94b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa94b('0x9')](_0xa94b('0xd'),auth[_0xa94b('0xb')](),controller['getMembers']);router[_0xa94b('0x9')](_0xa94b('0xe'),auth[_0xa94b('0xb')](),controller[_0xa94b('0xf')]);router[_0xa94b('0x9')](_0xa94b('0x10'),auth['isAuthenticated'](),controller[_0xa94b('0x11')]);router[_0xa94b('0x12')]('/',auth[_0xa94b('0xb')](),controller[_0xa94b('0x13')]);router[_0xa94b('0x12')](_0xa94b('0xe'),auth[_0xa94b('0xb')](),controller[_0xa94b('0x14')]);router['post'](_0xa94b('0x10'),auth[_0xa94b('0xb')](),controller['addAgents']);router[_0xa94b('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa94b('0x16')](_0xa94b('0xc'),auth[_0xa94b('0xb')](),controller[_0xa94b('0x17')]);router[_0xa94b('0x16')](_0xa94b('0xe'),auth[_0xa94b('0xb')](),controller[_0xa94b('0x18')]);router[_0xa94b('0x16')](_0xa94b('0x10'),auth[_0xa94b('0xb')](),controller[_0xa94b('0x19')]);module[_0xa94b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index bcef9ce..523892d 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 _0x943d=['exports','name','STRING','INTEGER','ENUM','rrmemory','sequelize'];(function(_0x4123d4,_0x37b120){var _0x1200c6=function(_0x31f1b9){while(--_0x31f1b9){_0x4123d4['push'](_0x4123d4['shift']());}};_0x1200c6(++_0x37b120);}(_0x943d,0xd8));var _0xd943=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x943d[_0x2fd69d];return _0x5d5ef3;};'use strict';var Sequelize=require(_0xd943('0x0'));module[_0xd943('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd943('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd943('0x3')]},'timeout':{'type':Sequelize[_0xd943('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd943('0x5')](_0xd943('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xf036=['roundrobin','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x2d41b1,_0x312bef){var _0x33b4c5=function(_0x780559){while(--_0x780559){_0x2d41b1['push'](_0x2d41b1['shift']());}};_0x33b4c5(++_0x312bef);}(_0xf036,0x174));var _0x6f03=function(_0x218228,_0x31fedd){_0x218228=_0x218228-0x0;var _0xae1580=_0xf036[_0x218228];return _0xae1580;};'use strict';var Sequelize=require('sequelize');module[_0x6f03('0x0')]={'name':{'type':Sequelize[_0x6f03('0x1')],'unique':_0x6f03('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f03('0x1')]},'timeout':{'type':Sequelize[_0x6f03('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6f03('0x4'),_0x6f03('0x5'),_0x6f03('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 5bc47dd..be49316 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 _0x66fa=['omit','spread','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','map','SmsQueue','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','include','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','SmsQueueId','UserSmsQueue','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','emit','userSmsQueue:remove','addAgents'];(function(_0x5b6a86,_0x59489c){var _0x425888=function(_0x38fdfd){while(--_0x38fdfd){_0x5b6a86['push'](_0x5b6a86['shift']());}};_0x425888(++_0x59489c);}(_0x66fa,0x117));var _0xa66f=function(_0x1c0316,_0x31ad18){_0x1c0316=_0x1c0316-0x0;var _0x10a580=_0x66fa[_0x1c0316];return _0x10a580;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){var _0x5e9639=_0x209f4d[_0xa66f('0x28')]({'plain':!![]});var _0x598942=_0xa66f('0x29');return db[_0xa66f('0x2a')][_0xa66f('0x27')]({'where':{'type':_0x598942,'resourceId':_0x5e9639['id']}})['then'](function(){return _0x209f4d;});})[_0xa66f('0x26')](function(){_0x337602[_0xa66f('0x1a')](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x238eb2,_0x17c103){return function(_0x236046){if(!_0x236046){_0x238eb2[_0xa66f('0x19')](0x194);}return _0x236046;};}function handleError(_0xea2c89,_0x20ee67){_0x20ee67=_0x20ee67||0x1f4;return function(_0x117d03){logger[_0xa66f('0x2b')](_0x117d03[_0xa66f('0x2c')]);if(_0x117d03[_0xa66f('0x2d')]){delete _0x117d03[_0xa66f('0x2d')];}_0xea2c89['status'](_0x20ee67)['send'](_0x117d03);};}exports[_0xa66f('0x2e')]=function(_0x27ceae,_0x55f309){var _0x44c79a={},_0x2de5f3={},_0x4cd7f2={'count':0x0,'rows':[]};var _0x332e86=_[_0xa66f('0x2f')](db[_0xa66f('0x30')][_0xa66f('0x31')],function(_0x395623){return{'name':_0x395623['fieldName'],'type':_0x395623[_0xa66f('0x32')]['key']};});_0x2de5f3[_0xa66f('0x33')]=_[_0xa66f('0x2f')](_0x332e86,_0xa66f('0x2d'));_0x2de5f3['query']=_[_0xa66f('0x34')](_0x27ceae[_0xa66f('0x35')]);_0x2de5f3['filters']=_[_0xa66f('0x36')](_0x2de5f3[_0xa66f('0x33')],_0x2de5f3[_0xa66f('0x35')]);_0x44c79a[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x2de5f3[_0xa66f('0x33')],qs[_0xa66f('0x38')](_0x27ceae[_0xa66f('0x35')][_0xa66f('0x38')]));_0x44c79a[_0xa66f('0x37')]=_0x44c79a['attributes'][_0xa66f('0x39')]?_0x44c79a['attributes']:_0x2de5f3[_0xa66f('0x33')];if(!_0x27ceae[_0xa66f('0x35')][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0x44c79a[_0xa66f('0x1f')]=qs[_0xa66f('0x1f')](_0x27ceae[_0xa66f('0x35')][_0xa66f('0x1f')]);_0x44c79a['offset']=qs[_0xa66f('0x1e')](_0x27ceae['query'][_0xa66f('0x1e')]);}_0x44c79a[_0xa66f('0x3c')]=qs[_0xa66f('0x3d')](_0x27ceae['query']['sort']);_0x44c79a[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_[_0xa66f('0x40')](_0x27ceae[_0xa66f('0x35')],_0x2de5f3[_0xa66f('0x3f')]));if(_0x27ceae['query']['filter']){_0x44c79a['where']=_[_0xa66f('0x41')](_0x44c79a['where'],{'$or':_['map'](_0x332e86,function(_0x5bf856){if(_0x5bf856[_0xa66f('0x32')]!=='VIRTUAL'){var _0x8965d3={};_0x8965d3[_0x5bf856[_0xa66f('0x2d')]]={'$like':'%'+_0x27ceae[_0xa66f('0x35')][_0xa66f('0x42')]+'%'};return _0x8965d3;}})});}_0x44c79a=_[_0xa66f('0x41')]({},_0x44c79a,_0x27ceae[_0xa66f('0x43')]);var _0x192033={'where':_0x44c79a[_0xa66f('0x3e')]};return db[_0xa66f('0x30')][_0xa66f('0x1d')](_0x192033)[_0xa66f('0x26')](function(_0x93f6ff){_0x4cd7f2[_0xa66f('0x1d')]=_0x93f6ff;if(_0x27ceae[_0xa66f('0x35')]['includeAll']){_0x44c79a[_0xa66f('0x44')]=[{'all':!![]}];}return db[_0xa66f('0x30')]['findAll'](_0x44c79a);})[_0xa66f('0x26')](function(_0x4b6e6b){_0x4cd7f2[_0xa66f('0x45')]=_0x4b6e6b;return _0x4cd7f2;})[_0xa66f('0x26')](respondWithFilteredResult(_0x55f309,_0x44c79a))['catch'](handleError(_0x55f309,null));};exports[_0xa66f('0x46')]=function(_0xa42041,_0x2126e8){var _0x5276ea={'raw':!![],'where':{'id':_0xa42041['params']['id']}},_0x394b1e={};_0x394b1e[_0xa66f('0x33')]=_[_0xa66f('0x34')](db[_0xa66f('0x30')][_0xa66f('0x31')]);_0x394b1e[_0xa66f('0x35')]=_[_0xa66f('0x34')](_0xa42041[_0xa66f('0x35')]);_0x394b1e['filters']=_[_0xa66f('0x36')](_0x394b1e[_0xa66f('0x33')],_0x394b1e[_0xa66f('0x35')]);_0x5276ea[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x394b1e['model'],qs['fields'](_0xa42041[_0xa66f('0x35')][_0xa66f('0x38')]));_0x5276ea[_0xa66f('0x37')]=_0x5276ea[_0xa66f('0x37')][_0xa66f('0x39')]?_0x5276ea[_0xa66f('0x37')]:_0x394b1e['model'];if(_0xa42041[_0xa66f('0x35')][_0xa66f('0x47')]){_0x5276ea[_0xa66f('0x44')]=[{'all':!![]}];}_0x5276ea=_['merge']({},_0x5276ea,_0xa42041['options']);return db[_0xa66f('0x30')][_0xa66f('0x48')](_0x5276ea)[_0xa66f('0x26')](handleEntityNotFound(_0x2126e8,null))['then'](respondWithResult(_0x2126e8,null))['catch'](handleError(_0x2126e8,null));};exports['create']=function(_0x19e7ce,_0x35e477){return db[_0xa66f('0x30')][_0xa66f('0x49')](_0x19e7ce[_0xa66f('0x4a')],{})[_0xa66f('0x26')](function(_0x164242){var _0x15de06=_0x19e7ce['user'][_0xa66f('0x28')]({'plain':!![]});if(!_0x15de06)throw new Error(_0xa66f('0x4b'));if(_0x15de06[_0xa66f('0x4c')]===_0xa66f('0x4d')){var _0x11597b=_0x164242[_0xa66f('0x28')]({'plain':!![]});var _0x56379e=_0xa66f('0x29');return db[_0xa66f('0x4e')][_0xa66f('0x48')]({'where':{'name':_0x56379e,'userProfileId':_0x15de06[_0xa66f('0x4f')]},'raw':!![]})[_0xa66f('0x26')](function(_0x5d77d1){if(_0x5d77d1&&_0x5d77d1[_0xa66f('0x50')]===0x0){return db['UserProfileResource'][_0xa66f('0x49')]({'name':_0x11597b['name'],'resourceId':_0x11597b['id'],'type':_0x5d77d1['name'],'sectionId':_0x5d77d1['id']},{})[_0xa66f('0x26')](function(){return _0x164242;});}else{return _0x164242;}})[_0xa66f('0x51')](function(_0x12271d){logger[_0xa66f('0x2b')](_0xa66f('0x52'),_0x12271d);throw _0x12271d;});}return _0x164242;})[_0xa66f('0x26')](respondWithResult(_0x35e477,0xc9))['catch'](handleError(_0x35e477,null));};exports[_0xa66f('0x25')]=function(_0x13822b,_0x1da406){if(_0x13822b[_0xa66f('0x4a')]['id']){delete _0x13822b['body']['id'];}return db[_0xa66f('0x30')]['find']({'where':{'id':_0x13822b[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x1da406,null))[_0xa66f('0x26')](saveUpdates(_0x13822b[_0xa66f('0x4a')],null))[_0xa66f('0x26')](respondWithResult(_0x1da406,null))[_0xa66f('0x51')](handleError(_0x1da406,null));};exports[_0xa66f('0x27')]=function(_0x56b860,_0x2ab3c8){return db[_0xa66f('0x30')][_0xa66f('0x48')]({'where':{'id':_0x56b860[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x2ab3c8,null))[_0xa66f('0x26')](removeEntity(_0x2ab3c8,null))[_0xa66f('0x51')](handleError(_0x2ab3c8,null));};exports[_0xa66f('0x54')]=function(_0x350fce,_0x4dfede){return db['SmsQueue'][_0xa66f('0x54')]()[_0xa66f('0x26')](respondWithResult(_0x4dfede,null))[_0xa66f('0x51')](handleError(_0x4dfede,null));};exports[_0xa66f('0x55')]=function(_0x2f1f1e,_0x1fd3f0,_0x8bea2b){var _0x4b10cf={'raw':!![],'where':{}},_0x1709eb={},_0x11c89e;return db[_0xa66f('0x30')][_0xa66f('0x56')]({'where':{'id':_0x2f1f1e['params']['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x1fd3f0,null))[_0xa66f('0x26')](function(_0x19ff30){if(_0x19ff30){_0x11c89e=_0x19ff30[_0xa66f('0x28')]({'plain':!![]});_0x1709eb[_0xa66f('0x33')]=_[_0xa66f('0x34')](db['UserSmsQueue']['rawAttributes']);_0x1709eb[_0xa66f('0x35')]=_[_0xa66f('0x34')](_0x2f1f1e[_0xa66f('0x35')]);_0x1709eb['filters']=_[_0xa66f('0x36')](_0x1709eb[_0xa66f('0x33')],_0x1709eb[_0xa66f('0x35')]);_0x4b10cf[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x1709eb[_0xa66f('0x33')],qs[_0xa66f('0x38')](_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x38')]));_0x4b10cf['attributes']=_0x4b10cf[_0xa66f('0x37')][_0xa66f('0x39')]?_0x4b10cf[_0xa66f('0x37')]:_0x1709eb[_0xa66f('0x33')];if(!_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0x4b10cf[_0xa66f('0x1f')]=qs['limit'](_0x2f1f1e['query'][_0xa66f('0x1f')]);_0x4b10cf[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x1e')]);}_0x4b10cf['order']=qs[_0xa66f('0x3d')](_0x2f1f1e['query'][_0xa66f('0x3d')]);_0x4b10cf[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_[_0xa66f('0x40')](_0x2f1f1e['query'],_0x1709eb[_0xa66f('0x3f')]));_0x4b10cf[_0xa66f('0x3e')][_0xa66f('0x57')]=_0x19ff30['id'];if(_0x2f1f1e[_0xa66f('0x35')][_0xa66f('0x42')]){_0x4b10cf[_0xa66f('0x3e')]=_[_0xa66f('0x41')](_0x4b10cf[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x2f')](_0x4b10cf[_0xa66f('0x37')],function(_0x290323){var _0x3eb1f5={};_0x3eb1f5[_0x290323]={'$like':'%'+_0x2f1f1e['query'][_0xa66f('0x42')]+'%'};return _0x3eb1f5;})});}_0x4b10cf=_[_0xa66f('0x41')]({},_0x4b10cf,_0x2f1f1e[_0xa66f('0x43')]);return db[_0xa66f('0x58')][_0xa66f('0x59')](_0x4b10cf);}})[_0xa66f('0x26')](function(_0x324780){if(_0x324780){return db[_0xa66f('0x5a')]['findAndCountAll']({'where':{'id':_[_0xa66f('0x2f')](_0x324780,_0xa66f('0x5b')),'role':_0xa66f('0x5c')},'attributes':['id',_0xa66f('0x2d'),_0xa66f('0x5d'),_0xa66f('0x5e'),_0xa66f('0x5f')]});}})[_0xa66f('0x26')](function(_0x4b5785){if(_0x4b5785){return{'count':_0x4b5785['count'],'rows':_[_0xa66f('0x2f')](_0x4b5785[_0xa66f('0x45')],function(_0x34a590){return{'membername':_0x34a590['name'],'UserId':_0x34a590['id'],'queue_name':_0x11c89e['name'],'SmsQueueId':_0x11c89e['id'],'interface':util[_0xa66f('0x60')](_0xa66f('0x61'),_0xa66f('0x62'),_0x34a590[_0xa66f('0x2d')]),'penalty':0x0,'paused':_0x34a590['smsPause'],'createdAt':_0x34a590[_0xa66f('0x5f')],'updatedAt':_0x34a590[_0xa66f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa66f('0x26')](respondWithFilteredResult(_0x1fd3f0,_0x4b10cf))[_0xa66f('0x51')](handleError(_0x1fd3f0,null));};exports[_0xa66f('0x63')]=function(_0x306129,_0x218128,_0x1396ae){var _0x534820={};var _0x231106={};var _0xbf4084;var _0x5c6c40;return db['SmsQueue'][_0xa66f('0x56')]({'where':{'id':_0x306129[_0xa66f('0x53')]['id']}})['then'](handleEntityNotFound(_0x218128,null))[_0xa66f('0x26')](function(_0x5ef2a3){if(_0x5ef2a3){_0xbf4084=_0x5ef2a3;_0x231106[_0xa66f('0x33')]=_['keys'](db['Team']['rawAttributes']);_0x231106[_0xa66f('0x35')]=_[_0xa66f('0x34')](_0x306129[_0xa66f('0x35')]);_0x231106[_0xa66f('0x3f')]=_[_0xa66f('0x36')](_0x231106[_0xa66f('0x33')],_0x231106[_0xa66f('0x35')]);_0x534820[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x231106[_0xa66f('0x33')],qs[_0xa66f('0x38')](_0x306129[_0xa66f('0x35')][_0xa66f('0x38')]));_0x534820[_0xa66f('0x37')]=_0x534820[_0xa66f('0x37')][_0xa66f('0x39')]?_0x534820['attributes']:_0x231106[_0xa66f('0x33')];_0x534820['order']=qs[_0xa66f('0x3d')](_0x306129['query'][_0xa66f('0x3d')]);_0x534820[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_['pick'](_0x306129['query'],_0x231106[_0xa66f('0x3f')]));if(_0x306129[_0xa66f('0x35')][_0xa66f('0x42')]){_0x534820[_0xa66f('0x3e')]=_[_0xa66f('0x41')](_0x534820[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x2f')](_0x534820['attributes'],function(_0x4013b9){var _0x85de12={};_0x85de12[_0x4013b9]={'$like':'%'+_0x306129[_0xa66f('0x35')][_0xa66f('0x42')]+'%'};return _0x85de12;})});}_0x534820=_[_0xa66f('0x41')]({},_0x534820,_0x306129[_0xa66f('0x43')]);return _0xbf4084[_0xa66f('0x63')](_0x534820);}})[_0xa66f('0x26')](function(_0x15bff2){if(_0x15bff2){_0x5c6c40=_0x15bff2[_0xa66f('0x39')];if(!_0x306129[_0xa66f('0x35')][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0x534820['limit']=qs[_0xa66f('0x1f')](_0x306129[_0xa66f('0x35')][_0xa66f('0x1f')]);_0x534820[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x306129[_0xa66f('0x35')][_0xa66f('0x1e')]);}return _0xbf4084[_0xa66f('0x63')](_0x534820);}})[_0xa66f('0x26')](function(_0x4bb74f){if(_0x4bb74f){return _0x4bb74f?{'count':_0x5c6c40,'rows':_0x4bb74f}:null;}})[_0xa66f('0x26')](respondWithResult(_0x218128,null))['catch'](handleError(_0x218128,null));};exports[_0xa66f('0x64')]=function(_0x5e19c5,_0x25d203,_0x5dbe8a){var _0x298bd8=_0x5e19c5['body'][_0xa66f('0x65')];return db[_0xa66f('0x66')][_0xa66f('0x59')]({'where':{'id':_0x298bd8},'attributes':['id'],'include':[{'model':db[_0xa66f('0x5a')],'as':_0xa66f('0x67'),'attributes':['id',_0xa66f('0x2d'),'online',_0xa66f('0x68'),_0xa66f('0x69')],'raw':!![]}]})[_0xa66f('0x26')](function(_0x49419c){if(_0x49419c){var _0x458275=_[_0xa66f('0x6a')](_0x49419c,function(_0x4e5f0d){var _0x1e8510=_0x4e5f0d[_0xa66f('0x28')]({'plain':!![]});return _0x1e8510['Agents'];});return db['SmsQueue'][_0xa66f('0x48')]({'where':{'id':_0x5e19c5[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](function(_0x2929fe){return db[_0xa66f('0x6b')]['transaction'](function(_0x3aaf96){return _0x2929fe[_0xa66f('0x64')](_0x298bd8,{'transaction':_0x3aaf96})['then'](function(){return BPromise[_0xa66f('0x6c')](_0x458275,function(_0x173409){return db['UserSmsQueue'][_0xa66f('0x6d')]({'where':{'UserId':_0x173409['id'],'SmsQueueId':_0x5e19c5[_0xa66f('0x53')]['id']},'transaction':_0x3aaf96});});})[_0xa66f('0x26')](function(){_0x458275[_0xa66f('0x6e')](function(_0x1f28e8){socket['emit'](_0xa66f('0x6f'),{'UserId':_0x1f28e8['id'],'SmsQueueId':_0x2929fe['id']});});});});});}})[_0xa66f('0x26')](respondWithStatusCode(_0x25d203,null))[_0xa66f('0x51')](handleError(_0x25d203,null));};exports[_0xa66f('0x70')]=function(_0x40fb75,_0x3224a5,_0x4e318d){return db[_0xa66f('0x66')][_0xa66f('0x59')]({'where':{'id':_0x40fb75[_0xa66f('0x35')][_0xa66f('0x65')]},'attributes':['id'],'include':[{'model':db[_0xa66f('0x5a')],'as':_0xa66f('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa66f('0x26')](handleEntityNotFound(_0x3224a5,null))['then'](function(_0x5ec355){var _0x50192d=_['map'](_0x5ec355,'id');var _0x26cc07=[];var _0x148a8d=[];var _0x5a957c=squel[_0xa66f('0x71')]();_0x5a957c[_0xa66f('0x72')](_0xa66f('0x73'))['from']('team_has_sms_queues','tq')[_0xa66f('0x74')]('user_has_teams','ut',_0xa66f('0x75'))[_0xa66f('0x3e')](_0xa66f('0x76'),_0x40fb75['params']['id']);for(var _0x283ca2=0x0;_0x283ca2<_0x5ec355['length'];_0x283ca2+=0x1){let _0x3dd1a3=_0x5ec355[_0x283ca2];for(var _0xfdb067=0x0;_0xfdb067<_0x3dd1a3[_0xa66f('0x67')][_0xa66f('0x39')];_0xfdb067+=0x1){let _0x5a1838=_0x3dd1a3[_0xa66f('0x67')][_0xfdb067];var _0x3ac90f=_0x5a957c[_0xa66f('0x77')]();_0x3ac90f[_0xa66f('0x3e')](_0xa66f('0x78'),_0x5a1838['id']);_0x148a8d[_0xa66f('0x79')](db['sequelize'][_0xa66f('0x35')](_0x3ac90f[_0xa66f('0x7a')](),{'type':db[_0xa66f('0x6b')][_0xa66f('0x7b')][_0xa66f('0x7c')]})['then'](function(_0x520dbb){if(_0x520dbb[_0xa66f('0x39')]===0x1){return _0x5a1838['id'];}else{var _0x30468d=_[_0xa66f('0x7d')](_[_0xa66f('0x2f')](_0x520dbb,_0xa66f('0x7e')),function(_0x3285c6){return _[_0xa66f('0x7f')](_0x50192d,_0x3285c6);});if(_0x30468d){return _0x5a1838['id'];}}}));}}return BPromise[_0xa66f('0x80')](_0x148a8d)[_0xa66f('0x26')](function(_0x1704e3){_0x26cc07=_(_0x26cc07)[_0xa66f('0x81')](_0x1704e3)[_0xa66f('0x82')]()['value']();return db[_0xa66f('0x30')][_0xa66f('0x48')]({'where':{'id':_0x40fb75['params']['id']}})[_0xa66f('0x26')](function(_0x5c5445){return db[_0xa66f('0x6b')]['transaction'](function(_0x4fe5e1){return _0x5c5445[_0xa66f('0x70')](_0x40fb75['query'][_0xa66f('0x65')],{'transaction':_0x4fe5e1})[_0xa66f('0x26')](function(){if(!_['isEmpty'](_0x26cc07)){return _0x5c5445[_0xa66f('0x83')](_0x26cc07,{'transaction':_0x4fe5e1});}})[_0xa66f('0x26')](function(){_0x26cc07['forEach'](function(_0xa568ed){socket[_0xa66f('0x84')](_0xa66f('0x85'),{'UserId':_0xa568ed,'SmsQueueId':_0x5c5445['id']});});});});});});})[_0xa66f('0x26')](respondWithStatusCode(_0x3224a5,null))['catch'](handleError(_0x3224a5,null));};exports['addAgents']=function(_0x34daef,_0xdd2d09,_0x41f6a2){return db[_0xa66f('0x30')][_0xa66f('0x48')]({'where':{'id':_0x34daef[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0xdd2d09,null))[_0xa66f('0x26')](function(_0x51f11a){if(_0x51f11a){return _0x51f11a[_0xa66f('0x86')](_0x34daef['body']['ids'],_[_0xa66f('0x87')](_0x34daef[_0xa66f('0x4a')],[_0xa66f('0x65'),'id'])||{})[_0xa66f('0x88')](function(_0x22ea68){for(var _0x59d4a5=0x0;_0x59d4a5<_0x34daef[_0xa66f('0x4a')][_0xa66f('0x65')][_0xa66f('0x39')];_0x59d4a5+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x34daef['body'][_0xa66f('0x65')][_0x59d4a5],'SmsQueueId':_0x34daef['params']['id']});}return _0x22ea68;});}})[_0xa66f('0x26')](respondWithResult(_0xdd2d09,null))[_0xa66f('0x51')](handleError(_0xdd2d09,null));};exports[_0xa66f('0x83')]=function(_0x90b7f1,_0x4bf3f6,_0xbf5668){return db[_0xa66f('0x30')]['find']({'where':{'id':_0x90b7f1[_0xa66f('0x53')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x4bf3f6,null))['then'](function(_0x4fa27c){if(_0x4fa27c){return _0x4fa27c[_0xa66f('0x83')](_0x90b7f1[_0xa66f('0x35')][_0xa66f('0x65')])['then'](function(){if(_['isArray'](_0x90b7f1['query']['ids'])){for(var _0xb6b51b=0x0;_0xb6b51b<_0x90b7f1[_0xa66f('0x35')][_0xa66f('0x65')][_0xa66f('0x39')];_0xb6b51b+=0x1){socket[_0xa66f('0x84')](_0xa66f('0x85'),{'UserId':Number(_0x90b7f1['query'][_0xa66f('0x65')][_0xb6b51b]),'SmsQueueId':Number(_0x90b7f1[_0xa66f('0x53')]['id'])});}}else{socket[_0xa66f('0x84')](_0xa66f('0x85'),{'UserId':Number(_0x90b7f1['query']['ids']),'SmsQueueId':Number(_0x90b7f1[_0xa66f('0x53')]['id'])});}});}})[_0xa66f('0x26')](respondWithStatusCode(_0x4bf3f6,null))[_0xa66f('0x51')](handleError(_0x4bf3f6,null));};exports[_0xa66f('0x89')]=function(_0x10e0fd,_0x21a2d7,_0x1f4f4b){var _0xb01698={};var _0x7a57e9={};var _0x179eb7;var _0x5e0b36;return db['SmsQueue'][_0xa66f('0x56')]({'where':{'id':_0x10e0fd['params']['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x21a2d7,null))[_0xa66f('0x26')](function(_0x13f006){if(_0x13f006){_0x179eb7=_0x13f006;_0x7a57e9[_0xa66f('0x33')]=_[_0xa66f('0x34')](db['User']['rawAttributes']);_0x7a57e9['query']=_['keys'](_0x10e0fd[_0xa66f('0x35')]);_0x7a57e9[_0xa66f('0x3f')]=_[_0xa66f('0x36')](_0x7a57e9[_0xa66f('0x33')],_0x7a57e9['query']);_0xb01698[_0xa66f('0x37')]=_[_0xa66f('0x36')](_0x7a57e9['model'],qs[_0xa66f('0x38')](_0x10e0fd[_0xa66f('0x35')]['fields']));_0xb01698[_0xa66f('0x37')]=_0xb01698[_0xa66f('0x37')]['length']?_0xb01698[_0xa66f('0x37')]:_0x7a57e9[_0xa66f('0x33')];_0xb01698[_0xa66f('0x3c')]=qs[_0xa66f('0x3d')](_0x10e0fd[_0xa66f('0x35')][_0xa66f('0x3d')]);_0xb01698[_0xa66f('0x3e')]=qs[_0xa66f('0x3f')](_[_0xa66f('0x40')](_0x10e0fd[_0xa66f('0x35')],_0x7a57e9[_0xa66f('0x3f')]));if(_0x10e0fd['query']['filter']){_0xb01698[_0xa66f('0x3e')]=_[_0xa66f('0x41')](_0xb01698[_0xa66f('0x3e')],{'$or':_['map'](_0xb01698['attributes'],function(_0x2a6992){var _0x1d5f20={};_0x1d5f20[_0x2a6992]={'$like':'%'+_0x10e0fd[_0xa66f('0x35')][_0xa66f('0x42')]+'%'};return _0x1d5f20;})});}_0xb01698=_[_0xa66f('0x41')]({},_0xb01698,_0x10e0fd['options']);return _0x179eb7[_0xa66f('0x89')](_0xb01698);}})[_0xa66f('0x26')](function(_0x287f9e){if(_0x287f9e){_0x5e0b36=_0x287f9e[_0xa66f('0x39')];if(!_0x10e0fd['query'][_0xa66f('0x3a')](_0xa66f('0x3b'))){_0xb01698['limit']=qs[_0xa66f('0x1f')](_0x10e0fd[_0xa66f('0x35')]['limit']);_0xb01698[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x10e0fd[_0xa66f('0x35')][_0xa66f('0x1e')]);}return _0x179eb7[_0xa66f('0x89')](_0xb01698);}})[_0xa66f('0x26')](function(_0x2aca23){if(_0x2aca23){return _0x2aca23?{'count':_0x5e0b36,'rows':_0x2aca23}:null;}})['then'](respondWithResult(_0x21a2d7,null))['catch'](handleError(_0x21a2d7,null));}; \ No newline at end of file +var _0x57ca=['userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','SmsQueue','rows','params','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','catch','describe','findOne','UserSmsQueue','sort','pick','SmsQueueId','findAll','findAndCountAll','UserId','smsPause','updatedAt','format','%s/%s','getTeams','Team','addTeams','ids','User','online','Agents','sequelize','each','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','compact','value','transaction','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray'];(function(_0x7a0496,_0x3b4dbc){var _0x4d5a25=function(_0x52bbc4){while(--_0x52bbc4){_0x7a0496['push'](_0x7a0496['shift']());}};_0x4d5a25(++_0x3b4dbc);}(_0x57ca,0x108));var _0xa57c=function(_0x293702,_0x1bf05c){_0x293702=_0x293702-0x0;var _0x55be29=_0x57ca[_0x293702];return _0x55be29;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var db=require(_0xa57c('0x15'))['db'];config[_0xa57c('0x16')]=_[_0xa57c('0x17')](config[_0xa57c('0x16')],{'host':_0xa57c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0x16')]));require('./smsQueue.socket')[_0xa57c('0x19')](socket);function respondWithStatusCode(_0x3d5995,_0x30940d){_0x30940d=_0x30940d||0xcc;return function(_0x3821d2){if(_0x3821d2){return _0x3d5995[_0xa57c('0x1a')](_0x30940d);}return _0x3d5995[_0xa57c('0x1b')](_0x30940d)[_0xa57c('0x1c')]();};}function respondWithResult(_0x4b4bdb,_0x26607a){_0x26607a=_0x26607a||0xc8;return function(_0xdf7ff6){if(_0xdf7ff6){return _0x4b4bdb[_0xa57c('0x1b')](_0x26607a)['json'](_0xdf7ff6);}};}function respondWithFilteredResult(_0x2746a0,_0x5f33f1){return function(_0x3e7afa){if(_0x3e7afa){var _0x3d781d=_0x3e7afa[_0xa57c('0x1d')],_0x93462c=_0x5f33f1[_0xa57c('0x1e')],_0xe3d505=_0x5f33f1[_0xa57c('0x1e')]+_0x5f33f1['limit'],_0x1fd0d8;if(_0xe3d505>=_0x3d781d){_0xe3d505=_0x3d781d;_0x1fd0d8=0xc8;}else{_0x1fd0d8=0xce;}_0x2746a0[_0xa57c('0x1b')](_0x1fd0d8);return _0x2746a0['set']('Content-Range',_0x93462c+'-'+_0xe3d505+'/'+_0x3d781d)[_0xa57c('0x1f')](_0x3e7afa);}return null;};}function patchUpdates(_0xa5b314){return function(_0x3eee75){try{jsonpatch[_0xa57c('0x20')](_0x3eee75,_0xa5b314,!![]);}catch(_0x49242c){return BPromise[_0xa57c('0x21')](_0x49242c);}return _0x3eee75[_0xa57c('0x22')]();};}function saveUpdates(_0x34d1bc,_0x2213b2){return function(_0x3bb969){if(_0x3bb969){return _0x3bb969[_0xa57c('0x23')](_0x34d1bc)[_0xa57c('0x24')](function(_0x42038e){return _0x42038e;});}return null;};}function removeEntity(_0x2e99ed,_0xdf65dd){return function(_0x382a26){if(_0x382a26){return _0x382a26[_0xa57c('0x25')]()[_0xa57c('0x24')](function(){var _0x10a33d=_0x382a26[_0xa57c('0x26')]({'plain':!![]});var _0x511a26=_0xa57c('0x27');return db[_0xa57c('0x28')][_0xa57c('0x25')]({'where':{'type':_0x511a26,'resourceId':_0x10a33d['id']}})[_0xa57c('0x24')](function(){return _0x382a26;});})[_0xa57c('0x24')](function(){_0x2e99ed[_0xa57c('0x1b')](0xcc)[_0xa57c('0x1c')]();});}};}function handleEntityNotFound(_0xe50fb8,_0x337f97){return function(_0x1d59c2){if(!_0x1d59c2){_0xe50fb8['sendStatus'](0x194);}return _0x1d59c2;};}function handleError(_0x3b7364,_0x4c1478){_0x4c1478=_0x4c1478||0x1f4;return function(_0x54a18b){logger[_0xa57c('0x29')](_0x54a18b[_0xa57c('0x2a')]);if(_0x54a18b['name']){delete _0x54a18b[_0xa57c('0x2b')];}_0x3b7364[_0xa57c('0x1b')](_0x4c1478)[_0xa57c('0x2c')](_0x54a18b);};}exports['index']=function(_0xd779f1,_0x58d46f){var _0xf5f70c={},_0x5464f2={},_0x2a3bbe={'count':0x0,'rows':[]};var _0x51ad09=_[_0xa57c('0x2d')](db['SmsQueue'][_0xa57c('0x2e')],function(_0x1d82d9){return{'name':_0x1d82d9[_0xa57c('0x2f')],'type':_0x1d82d9[_0xa57c('0x30')][_0xa57c('0x31')]};});_0x5464f2[_0xa57c('0x32')]=_[_0xa57c('0x2d')](_0x51ad09,'name');_0x5464f2[_0xa57c('0x33')]=_['keys'](_0xd779f1[_0xa57c('0x33')]);_0x5464f2[_0xa57c('0x34')]=_[_0xa57c('0x35')](_0x5464f2['model'],_0x5464f2[_0xa57c('0x33')]);_0xf5f70c['attributes']=_[_0xa57c('0x35')](_0x5464f2['model'],qs[_0xa57c('0x36')](_0xd779f1['query'][_0xa57c('0x36')]));_0xf5f70c[_0xa57c('0x37')]=_0xf5f70c['attributes'][_0xa57c('0x38')]?_0xf5f70c['attributes']:_0x5464f2[_0xa57c('0x32')];if(!_0xd779f1['query'][_0xa57c('0x39')](_0xa57c('0x3a'))){_0xf5f70c[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3b')]);_0xf5f70c['offset']=qs['offset'](_0xd779f1[_0xa57c('0x33')][_0xa57c('0x1e')]);}_0xf5f70c[_0xa57c('0x3c')]=qs['sort'](_0xd779f1[_0xa57c('0x33')]['sort']);_0xf5f70c[_0xa57c('0x3d')]=qs[_0xa57c('0x34')](_['pick'](_0xd779f1['query'],_0x5464f2['filters']));if(_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3e')]){_0xf5f70c[_0xa57c('0x3d')]=_[_0xa57c('0x3f')](_0xf5f70c[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x51ad09,function(_0x5a444a){if(_0x5a444a[_0xa57c('0x30')]!==_0xa57c('0x40')){var _0x5a5490={};_0x5a5490[_0x5a444a['name']]={'$like':'%'+_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x5a5490;}})});}_0xf5f70c=_['merge']({},_0xf5f70c,_0xd779f1[_0xa57c('0x41')]);var _0x5603cf={'where':_0xf5f70c[_0xa57c('0x3d')]};return db[_0xa57c('0x42')][_0xa57c('0x1d')](_0x5603cf)[_0xa57c('0x24')](function(_0x5d210b){_0x2a3bbe[_0xa57c('0x1d')]=_0x5d210b;if(_0xd779f1['query']['includeAll']){_0xf5f70c['include']=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0xf5f70c);})[_0xa57c('0x24')](function(_0x32ed25){_0x2a3bbe[_0xa57c('0x43')]=_0x32ed25;return _0x2a3bbe;})['then'](respondWithFilteredResult(_0x58d46f,_0xf5f70c))['catch'](handleError(_0x58d46f,null));};exports['show']=function(_0x44f1e8,_0x2755bc){var _0x44e38f={'raw':!![],'where':{'id':_0x44f1e8[_0xa57c('0x44')]['id']}},_0x40715e={};_0x40715e[_0xa57c('0x32')]=_['keys'](db[_0xa57c('0x42')][_0xa57c('0x2e')]);_0x40715e[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x44f1e8[_0xa57c('0x33')]);_0x40715e[_0xa57c('0x34')]=_['intersection'](_0x40715e[_0xa57c('0x32')],_0x40715e[_0xa57c('0x33')]);_0x44e38f[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x40715e[_0xa57c('0x32')],qs['fields'](_0x44f1e8[_0xa57c('0x33')][_0xa57c('0x36')]));_0x44e38f[_0xa57c('0x37')]=_0x44e38f[_0xa57c('0x37')][_0xa57c('0x38')]?_0x44e38f[_0xa57c('0x37')]:_0x40715e['model'];if(_0x44f1e8[_0xa57c('0x33')][_0xa57c('0x46')]){_0x44e38f[_0xa57c('0x47')]=[{'all':!![]}];}_0x44e38f=_[_0xa57c('0x3f')]({},_0x44e38f,_0x44f1e8[_0xa57c('0x41')]);return db[_0xa57c('0x42')]['find'](_0x44e38f)['then'](handleEntityNotFound(_0x2755bc,null))['then'](respondWithResult(_0x2755bc,null))['catch'](handleError(_0x2755bc,null));};exports[_0xa57c('0x48')]=function(_0x49492f,_0x273a17){return db[_0xa57c('0x42')]['create'](_0x49492f[_0xa57c('0x49')],{})[_0xa57c('0x24')](function(_0x368e87){var _0x128ea2=_0x49492f[_0xa57c('0x4a')]['get']({'plain':!![]});if(!_0x128ea2)throw new Error(_0xa57c('0x4b'));if(_0x128ea2[_0xa57c('0x4c')]===_0xa57c('0x4a')){var _0xd57bac=_0x368e87[_0xa57c('0x26')]({'plain':!![]});var _0x5ace6d=_0xa57c('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5ace6d,'userProfileId':_0x128ea2[_0xa57c('0x4d')]},'raw':!![]})[_0xa57c('0x24')](function(_0x5ded49){if(_0x5ded49&&_0x5ded49['autoAssociation']===0x0){return db['UserProfileResource'][_0xa57c('0x48')]({'name':_0xd57bac[_0xa57c('0x2b')],'resourceId':_0xd57bac['id'],'type':_0x5ded49[_0xa57c('0x2b')],'sectionId':_0x5ded49['id']},{})[_0xa57c('0x24')](function(){return _0x368e87;});}else{return _0x368e87;}})['catch'](function(_0x3c450f){logger[_0xa57c('0x29')](_0xa57c('0x4e'),_0x3c450f);throw _0x3c450f;});}return _0x368e87;})['then'](respondWithResult(_0x273a17,0xc9))['catch'](handleError(_0x273a17,null));};exports[_0xa57c('0x23')]=function(_0x25fc6b,_0x4d5d46){if(_0x25fc6b[_0xa57c('0x49')]['id']){delete _0x25fc6b[_0xa57c('0x49')]['id'];}return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x25fc6b[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x4d5d46,null))[_0xa57c('0x24')](saveUpdates(_0x25fc6b['body'],null))['then'](respondWithResult(_0x4d5d46,null))[_0xa57c('0x50')](handleError(_0x4d5d46,null));};exports[_0xa57c('0x25')]=function(_0x2fd759,_0x2a6538){return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x2fd759[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x2a6538,null))['then'](removeEntity(_0x2a6538,null))['catch'](handleError(_0x2a6538,null));};exports[_0xa57c('0x51')]=function(_0x4e18ad,_0x1880e6){return db[_0xa57c('0x42')][_0xa57c('0x51')]()['then'](respondWithResult(_0x1880e6,null))[_0xa57c('0x50')](handleError(_0x1880e6,null));};exports['getMembers']=function(_0x21b00a,_0x4b3416,_0x39484d){var _0x170187={'raw':!![],'where':{}},_0x398743={},_0x26a8e1;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x21b00a[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x4b3416,null))[_0xa57c('0x24')](function(_0x3345d5){if(_0x3345d5){_0x26a8e1=_0x3345d5['get']({'plain':!![]});_0x398743[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x53')][_0xa57c('0x2e')]);_0x398743[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x21b00a[_0xa57c('0x33')]);_0x398743[_0xa57c('0x34')]=_[_0xa57c('0x35')](_0x398743[_0xa57c('0x32')],_0x398743['query']);_0x170187[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x398743[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x21b00a[_0xa57c('0x33')][_0xa57c('0x36')]));_0x170187['attributes']=_0x170187[_0xa57c('0x37')][_0xa57c('0x38')]?_0x170187['attributes']:_0x398743[_0xa57c('0x32')];if(!_0x21b00a[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x170187[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x21b00a[_0xa57c('0x33')]['limit']);_0x170187[_0xa57c('0x1e')]=qs['offset'](_0x21b00a[_0xa57c('0x33')]['offset']);}_0x170187[_0xa57c('0x3c')]=qs['sort'](_0x21b00a[_0xa57c('0x33')][_0xa57c('0x54')]);_0x170187['where']=qs[_0xa57c('0x34')](_[_0xa57c('0x55')](_0x21b00a[_0xa57c('0x33')],_0x398743[_0xa57c('0x34')]));_0x170187['where'][_0xa57c('0x56')]=_0x3345d5['id'];if(_0x21b00a[_0xa57c('0x33')][_0xa57c('0x3e')]){_0x170187[_0xa57c('0x3d')]=_[_0xa57c('0x3f')](_0x170187[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x170187[_0xa57c('0x37')],function(_0x11c13e){var _0x428ac0={};_0x428ac0[_0x11c13e]={'$like':'%'+_0x21b00a[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x428ac0;})});}_0x170187=_[_0xa57c('0x3f')]({},_0x170187,_0x21b00a[_0xa57c('0x41')]);return db[_0xa57c('0x53')][_0xa57c('0x57')](_0x170187);}})['then'](function(_0x393119){if(_0x393119){return db['User'][_0xa57c('0x58')]({'where':{'id':_[_0xa57c('0x2d')](_0x393119,_0xa57c('0x59')),'role':'agent'},'attributes':['id',_0xa57c('0x2b'),_0xa57c('0x5a'),_0xa57c('0x5b'),'createdAt']});}})['then'](function(_0x20ff5f){if(_0x20ff5f){return{'count':_0x20ff5f[_0xa57c('0x1d')],'rows':_[_0xa57c('0x2d')](_0x20ff5f[_0xa57c('0x43')],function(_0x3fd9aa){return{'membername':_0x3fd9aa[_0xa57c('0x2b')],'UserId':_0x3fd9aa['id'],'queue_name':_0x26a8e1[_0xa57c('0x2b')],'SmsQueueId':_0x26a8e1['id'],'interface':util[_0xa57c('0x5c')](_0xa57c('0x5d'),'SIP',_0x3fd9aa[_0xa57c('0x2b')]),'penalty':0x0,'paused':_0x3fd9aa[_0xa57c('0x5a')],'createdAt':_0x3fd9aa['createdAt'],'updatedAt':_0x3fd9aa[_0xa57c('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa57c('0x24')](respondWithFilteredResult(_0x4b3416,_0x170187))[_0xa57c('0x50')](handleError(_0x4b3416,null));};exports[_0xa57c('0x5e')]=function(_0x1bb561,_0x28ec46,_0x42763b){var _0x10616e={};var _0x5a457d={};var _0x2960fd;var _0x29bf7f;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x1bb561[_0xa57c('0x44')]['id']}})['then'](handleEntityNotFound(_0x28ec46,null))['then'](function(_0x30dac7){if(_0x30dac7){_0x2960fd=_0x30dac7;_0x5a457d[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x5f')][_0xa57c('0x2e')]);_0x5a457d['query']=_[_0xa57c('0x45')](_0x1bb561[_0xa57c('0x33')]);_0x5a457d[_0xa57c('0x34')]=_['intersection'](_0x5a457d[_0xa57c('0x32')],_0x5a457d['query']);_0x10616e[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x5a457d[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x1bb561['query'][_0xa57c('0x36')]));_0x10616e[_0xa57c('0x37')]=_0x10616e[_0xa57c('0x37')][_0xa57c('0x38')]?_0x10616e['attributes']:_0x5a457d[_0xa57c('0x32')];_0x10616e[_0xa57c('0x3c')]=qs[_0xa57c('0x54')](_0x1bb561['query'][_0xa57c('0x54')]);_0x10616e[_0xa57c('0x3d')]=qs[_0xa57c('0x34')](_['pick'](_0x1bb561[_0xa57c('0x33')],_0x5a457d[_0xa57c('0x34')]));if(_0x1bb561[_0xa57c('0x33')][_0xa57c('0x3e')]){_0x10616e['where']=_[_0xa57c('0x3f')](_0x10616e[_0xa57c('0x3d')],{'$or':_['map'](_0x10616e[_0xa57c('0x37')],function(_0x1157ea){var _0x59d2a2={};_0x59d2a2[_0x1157ea]={'$like':'%'+_0x1bb561[_0xa57c('0x33')]['filter']+'%'};return _0x59d2a2;})});}_0x10616e=_[_0xa57c('0x3f')]({},_0x10616e,_0x1bb561[_0xa57c('0x41')]);return _0x2960fd[_0xa57c('0x5e')](_0x10616e);}})[_0xa57c('0x24')](function(_0x599408){if(_0x599408){_0x29bf7f=_0x599408[_0xa57c('0x38')];if(!_0x1bb561[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x10616e[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x1bb561[_0xa57c('0x33')][_0xa57c('0x3b')]);_0x10616e[_0xa57c('0x1e')]=qs[_0xa57c('0x1e')](_0x1bb561[_0xa57c('0x33')]['offset']);}return _0x2960fd['getTeams'](_0x10616e);}})['then'](function(_0x29b491){if(_0x29b491){return _0x29b491?{'count':_0x29bf7f,'rows':_0x29b491}:null;}})['then'](respondWithResult(_0x28ec46,null))[_0xa57c('0x50')](handleError(_0x28ec46,null));};exports[_0xa57c('0x60')]=function(_0x193705,_0x4c543a,_0x21c428){var _0x3e7946=_0x193705[_0xa57c('0x49')][_0xa57c('0x61')];return db[_0xa57c('0x5f')][_0xa57c('0x57')]({'where':{'id':_0x3e7946},'attributes':['id'],'include':[{'model':db[_0xa57c('0x62')],'as':'Agents','attributes':['id',_0xa57c('0x2b'),_0xa57c('0x63'),'voicePause','interface'],'raw':!![]}]})[_0xa57c('0x24')](function(_0x201983){if(_0x201983){var _0x4fc97e=_['flatMap'](_0x201983,function(_0xc5f17e){var _0x4962ae=_0xc5f17e[_0xa57c('0x26')]({'plain':!![]});return _0x4962ae[_0xa57c('0x64')];});return db['SmsQueue'][_0xa57c('0x4f')]({'where':{'id':_0x193705[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](function(_0x3df8f5){return db[_0xa57c('0x65')]['transaction'](function(_0x17fc78){return _0x3df8f5['addTeams'](_0x3e7946,{'transaction':_0x17fc78})[_0xa57c('0x24')](function(){return BPromise[_0xa57c('0x66')](_0x4fc97e,function(_0x4a2b64){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4a2b64['id'],'SmsQueueId':_0x193705[_0xa57c('0x44')]['id']},'transaction':_0x17fc78});});})['then'](function(){_0x4fc97e['forEach'](function(_0x175253){socket[_0xa57c('0x67')](_0xa57c('0x68'),{'UserId':_0x175253['id'],'SmsQueueId':_0x3df8f5['id']});});});});});}})['then'](respondWithStatusCode(_0x4c543a,null))[_0xa57c('0x50')](handleError(_0x4c543a,null));};exports[_0xa57c('0x69')]=function(_0x11e592,_0x5bbb59,_0x4b8228){return db[_0xa57c('0x5f')]['findAll']({'where':{'id':_0x11e592[_0xa57c('0x33')][_0xa57c('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa57c('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5bbb59,null))['then'](function(_0x5db013){var _0x6825df=_['map'](_0x5db013,'id');var _0x5143c0=[];var _0x542194=[];var _0x3e12e5=squel[_0xa57c('0x6a')]();_0x3e12e5['field'](_0xa57c('0x6b'))[_0xa57c('0x6c')](_0xa57c('0x6d'),'tq')['join'](_0xa57c('0x6e'),'ut',_0xa57c('0x6f'))[_0xa57c('0x3d')](_0xa57c('0x70'),_0x11e592['params']['id']);for(var _0x5e0db8=0x0;_0x5e0db8<_0x5db013[_0xa57c('0x38')];_0x5e0db8+=0x1){let _0x512e3d=_0x5db013[_0x5e0db8];for(var _0x121343=0x0;_0x121343<_0x512e3d[_0xa57c('0x64')][_0xa57c('0x38')];_0x121343+=0x1){let _0x4dc6ac=_0x512e3d[_0xa57c('0x64')][_0x121343];var _0x513f24=_0x3e12e5['clone']();_0x513f24[_0xa57c('0x3d')]('ut.UserId\x20=\x20?',_0x4dc6ac['id']);_0x542194[_0xa57c('0x71')](db[_0xa57c('0x65')]['query'](_0x513f24['toString'](),{'type':db[_0xa57c('0x65')][_0xa57c('0x72')]['SELECT']})['then'](function(_0x2550bc){if(_0x2550bc[_0xa57c('0x38')]===0x1){return _0x4dc6ac['id'];}else{var _0xa09ff=_['every'](_[_0xa57c('0x2d')](_0x2550bc,_0xa57c('0x73')),function(_0xb51336){return _[_0xa57c('0x74')](_0x6825df,_0xb51336);});if(_0xa09ff){return _0x4dc6ac['id'];}}}));}}return BPromise[_0xa57c('0x75')](_0x542194)[_0xa57c('0x24')](function(_0x10f1b5){_0x5143c0=_(_0x5143c0)[_0xa57c('0x76')](_0x10f1b5)[_0xa57c('0x77')]()[_0xa57c('0x78')]();return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x11e592[_0xa57c('0x44')]['id']}})['then'](function(_0x89be65){return db[_0xa57c('0x65')][_0xa57c('0x79')](function(_0x107ebd){return _0x89be65[_0xa57c('0x69')](_0x11e592[_0xa57c('0x33')]['ids'],{'transaction':_0x107ebd})['then'](function(){if(!_[_0xa57c('0x7a')](_0x5143c0)){return _0x89be65['removeAgents'](_0x5143c0,{'transaction':_0x107ebd});}})['then'](function(){_0x5143c0[_0xa57c('0x7b')](function(_0x138edd){socket[_0xa57c('0x67')]('userSmsQueue:remove',{'UserId':_0x138edd,'SmsQueueId':_0x89be65['id']});});});});});});})[_0xa57c('0x24')](respondWithStatusCode(_0x5bbb59,null))[_0xa57c('0x50')](handleError(_0x5bbb59,null));};exports[_0xa57c('0x7c')]=function(_0x2c0db4,_0x3eb06d,_0x4cabef){return db['SmsQueue'][_0xa57c('0x4f')]({'where':{'id':_0x2c0db4[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x3eb06d,null))['then'](function(_0x3f2152){if(_0x3f2152){return _0x3f2152['addAgents'](_0x2c0db4[_0xa57c('0x49')][_0xa57c('0x61')],_[_0xa57c('0x7d')](_0x2c0db4[_0xa57c('0x49')],[_0xa57c('0x61'),'id'])||{})[_0xa57c('0x7e')](function(_0xda3db4){for(var _0x5c76b0=0x0;_0x5c76b0<_0x2c0db4['body'][_0xa57c('0x61')][_0xa57c('0x38')];_0x5c76b0+=0x1){socket[_0xa57c('0x67')]('userSmsQueue:save',{'UserId':_0x2c0db4['body'][_0xa57c('0x61')][_0x5c76b0],'SmsQueueId':_0x2c0db4[_0xa57c('0x44')]['id']});}return _0xda3db4;});}})[_0xa57c('0x24')](respondWithResult(_0x3eb06d,null))[_0xa57c('0x50')](handleError(_0x3eb06d,null));};exports[_0xa57c('0x7f')]=function(_0x58a3c9,_0x41ffe3,_0x28dc85){return db[_0xa57c('0x42')]['find']({'where':{'id':_0x58a3c9[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x41ffe3,null))['then'](function(_0x1883b8){if(_0x1883b8){return _0x1883b8[_0xa57c('0x7f')](_0x58a3c9[_0xa57c('0x33')][_0xa57c('0x61')])[_0xa57c('0x24')](function(){if(_[_0xa57c('0x80')](_0x58a3c9[_0xa57c('0x33')][_0xa57c('0x61')])){for(var _0x16e745=0x0;_0x16e745<_0x58a3c9['query'][_0xa57c('0x61')][_0xa57c('0x38')];_0x16e745+=0x1){socket[_0xa57c('0x67')](_0xa57c('0x81'),{'UserId':Number(_0x58a3c9['query']['ids'][_0x16e745]),'SmsQueueId':Number(_0x58a3c9[_0xa57c('0x44')]['id'])});}}else{socket['emit'](_0xa57c('0x81'),{'UserId':Number(_0x58a3c9['query'][_0xa57c('0x61')]),'SmsQueueId':Number(_0x58a3c9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x41ffe3,null))[_0xa57c('0x50')](handleError(_0x41ffe3,null));};exports['getAgents']=function(_0x3facda,_0x5a4843,_0x1ecfa9){var _0x3698aa={};var _0x129a89={};var _0x422849;var _0x5abf60;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x3facda[_0xa57c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a4843,null))[_0xa57c('0x24')](function(_0xeb14ed){if(_0xeb14ed){_0x422849=_0xeb14ed;_0x129a89[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x62')][_0xa57c('0x2e')]);_0x129a89[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x3facda[_0xa57c('0x33')]);_0x129a89[_0xa57c('0x34')]=_['intersection'](_0x129a89['model'],_0x129a89[_0xa57c('0x33')]);_0x3698aa['attributes']=_[_0xa57c('0x35')](_0x129a89[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x3facda['query'][_0xa57c('0x36')]));_0x3698aa['attributes']=_0x3698aa['attributes'][_0xa57c('0x38')]?_0x3698aa[_0xa57c('0x37')]:_0x129a89[_0xa57c('0x32')];_0x3698aa[_0xa57c('0x3c')]=qs['sort'](_0x3facda[_0xa57c('0x33')]['sort']);_0x3698aa['where']=qs['filters'](_[_0xa57c('0x55')](_0x3facda[_0xa57c('0x33')],_0x129a89[_0xa57c('0x34')]));if(_0x3facda[_0xa57c('0x33')]['filter']){_0x3698aa[_0xa57c('0x3d')]=_['merge'](_0x3698aa[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x3698aa['attributes'],function(_0x2ca1af){var _0x287b5c={};_0x287b5c[_0x2ca1af]={'$like':'%'+_0x3facda[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x287b5c;})});}_0x3698aa=_[_0xa57c('0x3f')]({},_0x3698aa,_0x3facda['options']);return _0x422849[_0xa57c('0x82')](_0x3698aa);}})['then'](function(_0x185ee5){if(_0x185ee5){_0x5abf60=_0x185ee5[_0xa57c('0x38')];if(!_0x3facda[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x3698aa[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x3facda[_0xa57c('0x33')][_0xa57c('0x3b')]);_0x3698aa[_0xa57c('0x1e')]=qs['offset'](_0x3facda[_0xa57c('0x33')][_0xa57c('0x1e')]);}return _0x422849['getAgents'](_0x3698aa);}})['then'](function(_0x525865){if(_0x525865){return _0x525865?{'count':_0x5abf60,'rows':_0x525865}:null;}})[_0xa57c('0x24')](respondWithResult(_0x5a4843,null))[_0xa57c('0x50')](handleError(_0x5a4843,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index fb4403c..98d7ca3 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 _0xc557=['../../mysqldb','save','update','remove','emit','exports','events'];(function(_0x4983ac,_0x61a391){var _0x48d1f0=function(_0x2047f1){while(--_0x2047f1){_0x4983ac['push'](_0x4983ac['shift']());}};_0x48d1f0(++_0x61a391);}(_0xc557,0x180));var _0x7c55=function(_0x7404bb,_0x3249a1){_0x7404bb=_0x7404bb-0x0;var _0x2d9af1=_0xc557[_0x7404bb];return _0x2d9af1;};'use strict';var EventEmitter=require(_0x7c55('0x0'));var SmsQueue=require(_0x7c55('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7c55('0x2'),'afterUpdate':_0x7c55('0x3'),'afterDestroy':_0x7c55('0x4')};function emitEvent(_0x26a12a){return function(_0x48ef12,_0xd80232,_0x5d302f){SmsQueueEvents[_0x7c55('0x5')](_0x26a12a+':'+_0x48ef12['id'],_0x48ef12);SmsQueueEvents[_0x7c55('0x5')](_0x26a12a,_0x48ef12);_0x5d302f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x7c55('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0xb741=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3a2872,_0x4cb40b){var _0x5bc385=function(_0x45c615){while(--_0x45c615){_0x3a2872['push'](_0x3a2872['shift']());}};_0x5bc385(++_0x4cb40b);}(_0xb741,0x141));var _0x1b74=function(_0x2f2025,_0x1b8d28){_0x2f2025=_0x2f2025-0x0;var _0xf0eb73=_0xb741[_0x2f2025];return _0xf0eb73;};'use strict';var EventEmitter=require(_0x1b74('0x0'));var SmsQueue=require(_0x1b74('0x1'))['db'][_0x1b74('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1b74('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b74('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bc6af){return function(_0x314e43,_0x3d36e2,_0x239c4c){SmsQueueEvents[_0x1b74('0x5')](_0x3bc6af+':'+_0x314e43['id'],_0x314e43);SmsQueueEvents[_0x1b74('0x5')](_0x3bc6af,_0x314e43);_0x239c4c(null);};}for(var e in events){if(events[_0x1b74('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x1b74('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 609be59..397323e 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 _0xfa59=['define','SmsQueue','sms_queues','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsQueue.attributes','exports'];(function(_0x311307,_0x26126c){var _0x46358c=function(_0x12f5a0){while(--_0x12f5a0){_0x311307['push'](_0x311307['shift']());}};_0x46358c(++_0x26126c);}(_0xfa59,0x121));var _0x9fa5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfa59[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9fa5('0x0'))(_0x9fa5('0x1'));var moment=require(_0x9fa5('0x2'));var BPromise=require(_0x9fa5('0x3'));var rp=require(_0x9fa5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9fa5('0x5'));var attributes=require(_0x9fa5('0x6'));module[_0x9fa5('0x7')]=function(_0x4e6014,_0x4a4937){return _0x4e6014[_0x9fa5('0x8')](_0x9fa5('0x9'),attributes,{'tableName':_0x9fa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5219=['request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','moment','bluebird'];(function(_0x3fb24d,_0x51b349){var _0x46db46=function(_0x46b6a7){while(--_0x46b6a7){_0x3fb24d['push'](_0x3fb24d['shift']());}};_0x46db46(++_0x51b349);}(_0x5219,0x80));var _0x9521=function(_0x497677,_0x5d467a){_0x497677=_0x497677-0x0;var _0x2b2ceb=_0x5219[_0x497677];return _0x2b2ceb;};'use strict';var _=require(_0x9521('0x0'));var util=require(_0x9521('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9521('0x2'));var BPromise=require(_0x9521('0x3'));var rp=require(_0x9521('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9521('0x5'));var config=require(_0x9521('0x6'));var attributes=require(_0x9521('0x7'));module[_0x9521('0x8')]=function(_0x3461b0,_0x21e6f8){return _0x3461b0[_0x9521('0x9')]('SmsQueue',attributes,{'tableName':_0x9521('0xa'),'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 aacd90a..3b51ae7 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 _0x8bc8=['code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','include','map','model','then','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x573208,_0x304299){var _0x132d9c=function(_0x556830){while(--_0x556830){_0x573208['push'](_0x573208['shift']());}};_0x132d9c(++_0x304299);}(_0x8bc8,0xb3));var _0x88bc=function(_0x400a4f,_0x302b31){_0x400a4f=_0x400a4f-0x0;var _0x2d0335=_0x8bc8[_0x400a4f];return _0x2d0335;};'use strict';var _=require(_0x88bc('0x0'));var util=require(_0x88bc('0x1'));var moment=require(_0x88bc('0x2'));var BPromise=require(_0x88bc('0x3'));var rs=require(_0x88bc('0x4'));var fs=require('fs');var Redis=require(_0x88bc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x88bc('0x6'));var logger=require(_0x88bc('0x7'))(_0x88bc('0x8'));var config=require(_0x88bc('0x9'));var jayson=require(_0x88bc('0xa'));var client=jayson[_0x88bc('0xb')][_0x88bc('0xc')]({'port':0x232a});config[_0x88bc('0xd')]=_[_0x88bc('0xe')](config[_0x88bc('0xd')],{'host':_0x88bc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88bc('0xd')]));require(_0x88bc('0x10'))[_0x88bc('0x11')](socket);function respondWithRpcPromise(_0x256603,_0x1233b5,_0x14ced0){return new BPromise(function(_0x4d2e0e,_0x1a042b){return client[_0x88bc('0x12')](_0x256603,_0x14ced0)['then'](function(_0x1799c1){logger[_0x88bc('0x13')](_0x88bc('0x14'),_0x1233b5,_0x88bc('0x15'));logger[_0x88bc('0x16')](_0x88bc('0x17'),_0x1233b5,'request\x20sent',JSON[_0x88bc('0x18')](_0x1799c1));if(_0x1799c1[_0x88bc('0x19')]){if(_0x1799c1['error'][_0x88bc('0x1a')]===0x1f4){logger['error'](_0x88bc('0x14'),_0x1233b5,_0x1799c1['error'][_0x88bc('0x1b')]);return _0x1a042b(_0x1799c1[_0x88bc('0x19')][_0x88bc('0x1b')]);}logger[_0x88bc('0x19')](_0x88bc('0x14'),_0x1233b5,_0x1799c1[_0x88bc('0x19')]['message']);return _0x4d2e0e(_0x1799c1[_0x88bc('0x19')][_0x88bc('0x1b')]);}else{logger[_0x88bc('0x13')]('SmsQueue,\x20%s,\x20%s',_0x1233b5,_0x88bc('0x15'));_0x4d2e0e(_0x1799c1[_0x88bc('0x1c')][_0x88bc('0x1b')]);}})[_0x88bc('0x1d')](function(_0x40ea9e){logger[_0x88bc('0x19')](_0x88bc('0x14'),_0x1233b5,_0x40ea9e);_0x1a042b(_0x40ea9e);});});}exports[_0x88bc('0x1e')]=function(_0x5d73d1){var _0x47da90=this;return new Promise(function(_0x17bbc9,_0x5552d0){return db[_0x88bc('0x1f')]['findAll']({'raw':_0x5d73d1['options']?_0x5d73d1[_0x88bc('0x20')][_0x88bc('0x21')]===undefined?!![]:![]:!![],'where':_0x5d73d1[_0x88bc('0x20')]?_0x5d73d1[_0x88bc('0x20')][_0x88bc('0x22')]||null:null,'attributes':_0x5d73d1[_0x88bc('0x20')]?_0x5d73d1[_0x88bc('0x20')][_0x88bc('0x23')]||null:null,'limit':_0x5d73d1['options']?_0x5d73d1['options']['limit']||null:null,'include':_0x5d73d1['options']?_0x5d73d1['options'][_0x88bc('0x24')]?_[_0x88bc('0x25')](_0x5d73d1['options'][_0x88bc('0x24')],function(_0x34f75a){return{'model':db[_0x34f75a[_0x88bc('0x26')]],'as':_0x34f75a['as'],'attributes':_0x34f75a[_0x88bc('0x23')],'include':_0x34f75a['include']?_[_0x88bc('0x25')](_0x34f75a[_0x88bc('0x24')],function(_0x1df4bf){return{'model':db[_0x1df4bf[_0x88bc('0x26')]],'as':_0x1df4bf['as'],'attributes':_0x1df4bf[_0x88bc('0x23')],'include':_0x1df4bf[_0x88bc('0x24')]?_[_0x88bc('0x25')](_0x1df4bf[_0x88bc('0x24')],function(_0x2ec813){return{'model':db[_0x2ec813[_0x88bc('0x26')]],'as':_0x2ec813['as'],'attributes':_0x2ec813[_0x88bc('0x23')]};}):[]};}):[]};}):[]:[]})[_0x88bc('0x27')](function(_0x29090b){logger[_0x88bc('0x13')](_0x88bc('0x1e'),_0x5d73d1);logger['debug'](_0x88bc('0x1e'),_0x5d73d1,JSON[_0x88bc('0x18')](_0x29090b));_0x17bbc9(_0x29090b);})[_0x88bc('0x1d')](function(_0x14a90c){logger[_0x88bc('0x19')](_0x88bc('0x1e'),_0x14a90c['message'],_0x5d73d1);_0x5552d0(_0x47da90[_0x88bc('0x19')](0x1f4,_0x14a90c[_0x88bc('0x1b')]));});});};exports[_0x88bc('0x28')]=function(_0x50347c){var _0x2c28c8=this;return new Promise(function(_0x2c68a2,_0x59975c){return db[_0x88bc('0x1f')]['find']({'raw':_0x50347c[_0x88bc('0x20')]?_0x50347c[_0x88bc('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x50347c[_0x88bc('0x20')]?_0x50347c[_0x88bc('0x20')][_0x88bc('0x22')]||null:null,'attributes':_0x50347c[_0x88bc('0x20')]?_0x50347c['options'][_0x88bc('0x23')]||null:null,'include':_0x50347c['options']?_0x50347c[_0x88bc('0x20')]['include']?_[_0x88bc('0x25')](_0x50347c[_0x88bc('0x20')]['include'],function(_0x438b24){return{'model':db[_0x438b24[_0x88bc('0x26')]],'as':_0x438b24['as'],'attributes':_0x438b24[_0x88bc('0x23')],'include':_0x438b24[_0x88bc('0x24')]?_[_0x88bc('0x25')](_0x438b24[_0x88bc('0x24')],function(_0x537b07){return{'model':db[_0x537b07['model']],'as':_0x537b07['as'],'attributes':_0x537b07[_0x88bc('0x23')],'include':_0x537b07[_0x88bc('0x24')]?_['map'](_0x537b07[_0x88bc('0x24')],function(_0x200a1f){return{'model':db[_0x200a1f['model']],'as':_0x200a1f['as'],'attributes':_0x200a1f[_0x88bc('0x23')]};}):[]};}):[]};}):[]:[]})[_0x88bc('0x27')](function(_0x6951fb){logger['info'](_0x88bc('0x28'),_0x50347c);logger[_0x88bc('0x16')](_0x88bc('0x28'),_0x50347c,JSON[_0x88bc('0x18')](_0x6951fb));_0x2c68a2(_0x6951fb);})[_0x88bc('0x1d')](function(_0xb86f99){logger[_0x88bc('0x19')](_0x88bc('0x28'),_0xb86f99[_0x88bc('0x1b')],_0x50347c);_0x59975c(_0x2c28c8['error'](0x1f4,_0xb86f99[_0x88bc('0x1b')]));});});}; \ No newline at end of file +var _0x838c=['catch','SmsQueue','findAll','raw','options','attributes','include','map','model','GetSmsQueue','stringify','find','where','ShowSmsQueue','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0xd5c1e9,_0x3ea077){var _0x1b3fce=function(_0x2953e0){while(--_0x2953e0){_0xd5c1e9['push'](_0xd5c1e9['shift']());}};_0x1b3fce(++_0x3ea077);}(_0x838c,0x1b2));var _0xc838=function(_0x1bde7a,_0x5aa4fd){_0x1bde7a=_0x1bde7a-0x0;var _0x2c2d88=_0x838c[_0x1bde7a];return _0x2c2d88;};'use strict';var _=require('lodash');var util=require(_0xc838('0x0'));var moment=require(_0xc838('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc838('0x2'));var db=require(_0xc838('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc838('0x4'));var config=require(_0xc838('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc838('0x6')][_0xc838('0x7')]({'port':0x232a});config[_0xc838('0x8')]=_[_0xc838('0x9')](config[_0xc838('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc838('0xa'))(new Redis(config[_0xc838('0x8')]));require('./smsQueue.socket')[_0xc838('0xb')](socket);function respondWithRpcPromise(_0x11f878,_0x1cf1b2,_0x2a14c3){return new BPromise(function(_0x2f53d9,_0x2bd856){return client['request'](_0x11f878,_0x2a14c3)[_0xc838('0xc')](function(_0x31f55d){logger[_0xc838('0xd')](_0xc838('0xe'),_0x1cf1b2,_0xc838('0xf'));logger[_0xc838('0x10')](_0xc838('0x11'),_0x1cf1b2,'request\x20sent',JSON['stringify'](_0x31f55d));if(_0x31f55d['error']){if(_0x31f55d[_0xc838('0x12')]['code']===0x1f4){logger[_0xc838('0x12')](_0xc838('0xe'),_0x1cf1b2,_0x31f55d[_0xc838('0x12')][_0xc838('0x13')]);return _0x2bd856(_0x31f55d['error'][_0xc838('0x13')]);}logger[_0xc838('0x12')](_0xc838('0xe'),_0x1cf1b2,_0x31f55d[_0xc838('0x12')][_0xc838('0x13')]);return _0x2f53d9(_0x31f55d[_0xc838('0x12')][_0xc838('0x13')]);}else{logger[_0xc838('0xd')](_0xc838('0xe'),_0x1cf1b2,_0xc838('0xf'));_0x2f53d9(_0x31f55d[_0xc838('0x14')][_0xc838('0x13')]);}})[_0xc838('0x15')](function(_0x173f16){logger[_0xc838('0x12')]('SmsQueue,\x20%s,\x20%s',_0x1cf1b2,_0x173f16);_0x2bd856(_0x173f16);});});}exports['GetSmsQueue']=function(_0x386853){var _0x301b46=this;return new Promise(function(_0x1442d9,_0x5624a5){return db[_0xc838('0x16')][_0xc838('0x17')]({'raw':_0x386853['options']?_0x386853['options'][_0xc838('0x18')]===undefined?!![]:![]:!![],'where':_0x386853[_0xc838('0x19')]?_0x386853[_0xc838('0x19')]['where']||null:null,'attributes':_0x386853[_0xc838('0x19')]?_0x386853[_0xc838('0x19')][_0xc838('0x1a')]||null:null,'limit':_0x386853['options']?_0x386853[_0xc838('0x19')]['limit']||null:null,'include':_0x386853['options']?_0x386853[_0xc838('0x19')][_0xc838('0x1b')]?_[_0xc838('0x1c')](_0x386853[_0xc838('0x19')][_0xc838('0x1b')],function(_0x41184f){return{'model':db[_0x41184f[_0xc838('0x1d')]],'as':_0x41184f['as'],'attributes':_0x41184f['attributes'],'include':_0x41184f[_0xc838('0x1b')]?_[_0xc838('0x1c')](_0x41184f[_0xc838('0x1b')],function(_0x1dfaaa){return{'model':db[_0x1dfaaa[_0xc838('0x1d')]],'as':_0x1dfaaa['as'],'attributes':_0x1dfaaa[_0xc838('0x1a')],'include':_0x1dfaaa[_0xc838('0x1b')]?_[_0xc838('0x1c')](_0x1dfaaa[_0xc838('0x1b')],function(_0x206fd2){return{'model':db[_0x206fd2[_0xc838('0x1d')]],'as':_0x206fd2['as'],'attributes':_0x206fd2[_0xc838('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc838('0xc')](function(_0xcdc62b){logger[_0xc838('0xd')](_0xc838('0x1e'),_0x386853);logger[_0xc838('0x10')]('GetSmsQueue',_0x386853,JSON[_0xc838('0x1f')](_0xcdc62b));_0x1442d9(_0xcdc62b);})['catch'](function(_0x46c2e6){logger[_0xc838('0x12')](_0xc838('0x1e'),_0x46c2e6[_0xc838('0x13')],_0x386853);_0x5624a5(_0x301b46[_0xc838('0x12')](0x1f4,_0x46c2e6[_0xc838('0x13')]));});});};exports['ShowSmsQueue']=function(_0x4504ac){var _0x346f6a=this;return new Promise(function(_0x294a78,_0x22944e){return db['SmsQueue'][_0xc838('0x20')]({'raw':_0x4504ac['options']?_0x4504ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x4504ac['options']?_0x4504ac['options'][_0xc838('0x21')]||null:null,'attributes':_0x4504ac['options']?_0x4504ac[_0xc838('0x19')]['attributes']||null:null,'include':_0x4504ac[_0xc838('0x19')]?_0x4504ac[_0xc838('0x19')]['include']?_[_0xc838('0x1c')](_0x4504ac[_0xc838('0x19')]['include'],function(_0x5cea93){return{'model':db[_0x5cea93[_0xc838('0x1d')]],'as':_0x5cea93['as'],'attributes':_0x5cea93[_0xc838('0x1a')],'include':_0x5cea93['include']?_[_0xc838('0x1c')](_0x5cea93['include'],function(_0x29e496){return{'model':db[_0x29e496[_0xc838('0x1d')]],'as':_0x29e496['as'],'attributes':_0x29e496[_0xc838('0x1a')],'include':_0x29e496['include']?_[_0xc838('0x1c')](_0x29e496[_0xc838('0x1b')],function(_0x4fbe35){return{'model':db[_0x4fbe35['model']],'as':_0x4fbe35['as'],'attributes':_0x4fbe35[_0xc838('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc838('0xc')](function(_0x356b51){logger[_0xc838('0xd')](_0xc838('0x22'),_0x4504ac);logger['debug'](_0xc838('0x22'),_0x4504ac,JSON[_0xc838('0x1f')](_0x356b51));_0x294a78(_0x356b51);})[_0xc838('0x15')](function(_0xdb88dd){logger[_0xc838('0x12')](_0xc838('0x22'),_0xdb88dd['message'],_0x4504ac);_0x22944e(_0x346f6a[_0xc838('0x12')](0x1f4,_0xdb88dd[_0xc838('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 91af7c8..b31dd40 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 _0x91a9=['length','smsQueue:','save','update','emit','register'];(function(_0x48aafd,_0x163aec){var _0x250d5f=function(_0x8861e6){while(--_0x8861e6){_0x48aafd['push'](_0x48aafd['shift']());}};_0x250d5f(++_0x163aec);}(_0x91a9,0x146));var _0x991a=function(_0x548b1e,_0x36a928){_0x548b1e=_0x548b1e-0x0;var _0x45dd42=_0x91a9[_0x548b1e];return _0x45dd42;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x991a('0x0'),'remove',_0x991a('0x1')];function createListener(_0x5d5ea8,_0x56634c){return function(_0x4f1386){_0x56634c[_0x991a('0x2')](_0x5d5ea8,_0x4f1386);};}function removeListener(_0xb28396,_0x4c6e85){return function(){SmsQueueEvents['removeListener'](_0xb28396,_0x4c6e85);};}exports[_0x991a('0x3')]=function(_0x250170){for(var _0x3a7c58=0x0,_0x3f51e1=events[_0x991a('0x4')];_0x3a7c58<_0x3f51e1;_0x3a7c58++){var _0x4d9c94=events[_0x3a7c58];var _0x1f0f8a=createListener(_0x991a('0x5')+_0x4d9c94,_0x250170);SmsQueueEvents['on'](_0x4d9c94,_0x1f0f8a);}}; \ No newline at end of file +var _0x8d16=['register','length','./smsQueue.events','save','remove','update'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x8d16,0x134));var _0x68d1=function(_0x20e5d4,_0x4ae460){_0x20e5d4=_0x20e5d4-0x0;var _0x54d52a=_0x8d16[_0x20e5d4];return _0x54d52a;};'use strict';var SmsQueueEvents=require(_0x68d1('0x0'));var events=[_0x68d1('0x1'),_0x68d1('0x2'),_0x68d1('0x3')];function createListener(_0x10d5e1,_0x5e9623){return function(_0x421f35){_0x5e9623['emit'](_0x10d5e1,_0x421f35);};}function removeListener(_0x54b5e3,_0x2d9a67){return function(){SmsQueueEvents['removeListener'](_0x54b5e3,_0x2d9a67);};}exports[_0x68d1('0x4')]=function(_0x2ad4de){for(var _0xa17ec4=0x0,_0x36cc9b=events[_0x68d1('0x5')];_0xa17ec4<_0x36cc9b;_0xa17ec4++){var _0x5872b0=events[_0xa17ec4];var _0x836723=createListener('smsQueue:'+_0x5872b0,_0x2ad4de);SmsQueueEvents['on'](_0x5872b0,_0x836723);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 61c869a..e355e97 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 _0xcd19=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','update','delete','destroy'];(function(_0x5a6da9,_0x32df4d){var _0x29d30f=function(_0x2b6742){while(--_0x2b6742){_0x5a6da9['push'](_0x5a6da9['shift']());}};_0x29d30f(++_0x32df4d);}(_0xcd19,0x131));var _0x9cd1=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xcd19[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x9cd1('0x0'));var util=require('util');var path=require(_0x9cd1('0x1'));var timeout=require(_0x9cd1('0x2'));var express=require(_0x9cd1('0x3'));var router=express[_0x9cd1('0x4')]();var auth=require(_0x9cd1('0x5'));var interaction=require(_0x9cd1('0x6'));var config=require('../../config/environment');var controller=require(_0x9cd1('0x7'));router['get']('/',auth[_0x9cd1('0x8')](),controller['index']);router[_0x9cd1('0x9')](_0x9cd1('0xa'),auth[_0x9cd1('0x8')](),controller[_0x9cd1('0xb')]);router[_0x9cd1('0x9')](_0x9cd1('0xc'),auth[_0x9cd1('0x8')](),controller[_0x9cd1('0xd')]);router['post']('/',auth[_0x9cd1('0x8')](),controller[_0x9cd1('0xe')]);router['put'](_0x9cd1('0xc'),auth[_0x9cd1('0x8')](),controller[_0x9cd1('0xf')]);router[_0x9cd1('0x10')](_0x9cd1('0xc'),auth['isAuthenticated'](),controller[_0x9cd1('0x11')]);module[_0x9cd1('0x12')]=router; \ No newline at end of file +var _0xcf7d=['isAuthenticated','index','/describe','show','post','update','delete','/:id','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x1d9ae5,_0x4c8da8){var _0x1787f0=function(_0x236b64){while(--_0x236b64){_0x1d9ae5['push'](_0x1d9ae5['shift']());}};_0x1787f0(++_0x4c8da8);}(_0xcf7d,0x8a));var _0xdcf7=function(_0x116cbf,_0x99988d){_0x116cbf=_0x116cbf-0x0;var _0x496e78=_0xcf7d[_0x116cbf];return _0x496e78;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdcf7('0x0'));var timeout=require(_0xdcf7('0x1'));var express=require('express');var router=express[_0xdcf7('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xdcf7('0x3'));var config=require('../../config/environment');var controller=require(_0xdcf7('0x4'));router[_0xdcf7('0x5')]('/',auth[_0xdcf7('0x6')](),controller[_0xdcf7('0x7')]);router[_0xdcf7('0x5')](_0xdcf7('0x8'),auth[_0xdcf7('0x6')](),controller['describe']);router[_0xdcf7('0x5')]('/:id',auth[_0xdcf7('0x6')](),controller[_0xdcf7('0x9')]);router[_0xdcf7('0xa')]('/',auth[_0xdcf7('0x6')](),controller['create']);router['put']('/:id',auth[_0xdcf7('0x6')](),controller[_0xdcf7('0xb')]);router[_0xdcf7('0xc')](_0xdcf7('0xd'),auth['isAuthenticated'](),controller[_0xdcf7('0xe')]);module[_0xdcf7('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 9a37463..fcb3b13 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 _0xd090=['sequelize','STRING','DATE','moment'];(function(_0x49bff8,_0x5bb942){var _0x517ba4=function(_0x5c1b9e){while(--_0x5c1b9e){_0x49bff8['push'](_0x49bff8['shift']());}};_0x517ba4(++_0x5bb942);}(_0xd090,0x1cf));var _0x0d09=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd090[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x0d09('0x0'));var Sequelize=require(_0x0d09('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0d09('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0d09('0x3')]},'leaveAt':{'type':Sequelize[_0x0d09('0x3')]},'acceptAt':{'type':Sequelize[_0x0d09('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0d09('0x2')]}}; \ No newline at end of file +var _0x7083=['moment','exports','STRING','DATE'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7083,0xa8));var _0x3708=function(_0x2a5852,_0x5512a2){_0x2a5852=_0x2a5852-0x0;var _0xa8905a=_0x7083[_0x2a5852];return _0xa8905a;};'use strict';var moment=require(_0x3708('0x0'));var Sequelize=require('sequelize');module[_0x3708('0x1')]={'uniqueid':{'type':Sequelize[_0x3708('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3708('0x3')]},'leaveAt':{'type':Sequelize[_0x3708('0x3')]},'acceptAt':{'type':Sequelize[_0x3708('0x3')]},'exitAt':{'type':Sequelize[_0x3708('0x3')]},'reason':{'type':Sequelize[_0x3708('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 5f84aa6..35e64e2 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 _0x9c5c=['reject','save','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','include','SmsQueueReport','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','count','Content-Range','json'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x9c5c,0x1f0));var _0xc9c5=function(_0x23c6bc,_0x311abb){_0x23c6bc=_0x23c6bc-0x0;var _0x2f7529=_0x9c5c[_0x23c6bc];return _0x2f7529;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc9c5('0x0'));var zipdir=require(_0xc9c5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9c5('0x2'));var moment=require(_0xc9c5('0x3'));var BPromise=require(_0xc9c5('0x4'));var Mustache=require(_0xc9c5('0x5'));var util=require(_0xc9c5('0x6'));var path=require(_0xc9c5('0x7'));var sox=require(_0xc9c5('0x8'));var csv=require(_0xc9c5('0x9'));var ejs=require(_0xc9c5('0xa'));var fs=require('fs');var _=require(_0xc9c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc9c5('0xc'));var deskjs=require(_0xc9c5('0xd'));var toCsv=require(_0xc9c5('0x9'));var querystring=require(_0xc9c5('0xe'));var Papa=require(_0xc9c5('0xf'));var Redis=require(_0xc9c5('0x10'));var authService=require(_0xc9c5('0x11'));var qs=require(_0xc9c5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9c5('0x13'));var logger=require(_0xc9c5('0x14'))(_0xc9c5('0x15'));var utils=require(_0xc9c5('0x16'));var config=require(_0xc9c5('0x17'));var db=require(_0xc9c5('0x18'))['db'];function respondWithStatusCode(_0x1726c4,_0x116f17){_0x116f17=_0x116f17||0xcc;return function(_0x2ca6d2){if(_0x2ca6d2){return _0x1726c4['sendStatus'](_0x116f17);}return _0x1726c4['status'](_0x116f17)[_0xc9c5('0x19')]();};}function respondWithResult(_0x135b95,_0x411b70){_0x411b70=_0x411b70||0xc8;return function(_0x30e521){if(_0x30e521){return _0x135b95['status'](_0x411b70)['json'](_0x30e521);}};}function respondWithFilteredResult(_0x149f66,_0x1a5c28){return function(_0x484525){if(_0x484525){var _0x27894d=_0x484525[_0xc9c5('0x1a')],_0x56826f=_0x1a5c28['offset'],_0x339532=_0x1a5c28['offset']+_0x1a5c28['limit'],_0xcd0885;if(_0x339532>=_0x27894d){_0x339532=_0x27894d;_0xcd0885=0xc8;}else{_0xcd0885=0xce;}_0x149f66['status'](_0xcd0885);return _0x149f66['set'](_0xc9c5('0x1b'),_0x56826f+'-'+_0x339532+'/'+_0x27894d)[_0xc9c5('0x1c')](_0x484525);}return null;};}function patchUpdates(_0x2d723f){return function(_0x50ecbb){try{jsonpatch['apply'](_0x50ecbb,_0x2d723f,!![]);}catch(_0x12164c){return BPromise[_0xc9c5('0x1d')](_0x12164c);}return _0x50ecbb[_0xc9c5('0x1e')]();};}function saveUpdates(_0x430d2a,_0x4a2381){return function(_0x5bd227){if(_0x5bd227){return _0x5bd227[_0xc9c5('0x1f')](_0x430d2a)[_0xc9c5('0x20')](function(_0x4b6c1f){return _0x4b6c1f;});}return null;};}function removeEntity(_0x54a0f4,_0x2edaa0){return function(_0x5ee07e){if(_0x5ee07e){return _0x5ee07e[_0xc9c5('0x21')]()['then'](function(){_0x54a0f4[_0xc9c5('0x22')](0xcc)[_0xc9c5('0x19')]();});}};}function handleEntityNotFound(_0x2c5b51,_0x2f6c57){return function(_0x116cbc){if(!_0x116cbc){_0x2c5b51[_0xc9c5('0x23')](0x194);}return _0x116cbc;};}function handleError(_0x17ff0a,_0xb0e77d){_0xb0e77d=_0xb0e77d||0x1f4;return function(_0x3c8973){logger[_0xc9c5('0x24')](_0x3c8973[_0xc9c5('0x25')]);if(_0x3c8973[_0xc9c5('0x26')]){delete _0x3c8973[_0xc9c5('0x26')];}_0x17ff0a[_0xc9c5('0x22')](_0xb0e77d)[_0xc9c5('0x27')](_0x3c8973);};}exports[_0xc9c5('0x28')]=function(_0x39777d,_0x4dc92b){var _0x2a2cbd={},_0x891147={},_0x1e6c84={'count':0x0,'rows':[]};var _0x52559b=_[_0xc9c5('0x29')](db['SmsQueueReport'][_0xc9c5('0x2a')],function(_0x2b5bd8){return{'name':_0x2b5bd8[_0xc9c5('0x2b')],'type':_0x2b5bd8[_0xc9c5('0x2c')]['key']};});_0x891147['model']=_[_0xc9c5('0x29')](_0x52559b,'name');_0x891147['query']=_['keys'](_0x39777d[_0xc9c5('0x2d')]);_0x891147[_0xc9c5('0x2e')]=_['intersection'](_0x891147[_0xc9c5('0x2f')],_0x891147[_0xc9c5('0x2d')]);_0x2a2cbd[_0xc9c5('0x30')]=_[_0xc9c5('0x31')](_0x891147['model'],qs[_0xc9c5('0x32')](_0x39777d[_0xc9c5('0x2d')][_0xc9c5('0x32')]));_0x2a2cbd[_0xc9c5('0x30')]=_0x2a2cbd[_0xc9c5('0x30')][_0xc9c5('0x33')]?_0x2a2cbd[_0xc9c5('0x30')]:_0x891147[_0xc9c5('0x2f')];if(!_0x39777d[_0xc9c5('0x2d')][_0xc9c5('0x34')](_0xc9c5('0x35'))){_0x2a2cbd[_0xc9c5('0x36')]=qs[_0xc9c5('0x36')](_0x39777d['query'][_0xc9c5('0x36')]);_0x2a2cbd[_0xc9c5('0x37')]=qs[_0xc9c5('0x37')](_0x39777d['query'][_0xc9c5('0x37')]);}_0x2a2cbd[_0xc9c5('0x38')]=qs[_0xc9c5('0x39')](_0x39777d[_0xc9c5('0x2d')]['sort']);_0x2a2cbd[_0xc9c5('0x3a')]=qs[_0xc9c5('0x2e')](_[_0xc9c5('0x3b')](_0x39777d['query'],_0x891147[_0xc9c5('0x2e')]));if(_0x39777d[_0xc9c5('0x2d')][_0xc9c5('0x3c')]){_0x2a2cbd['where']=_[_0xc9c5('0x3d')](_0x2a2cbd[_0xc9c5('0x3a')],{'$or':_[_0xc9c5('0x29')](_0x52559b,function(_0x14bf8e){if(_0x14bf8e[_0xc9c5('0x2c')]!==_0xc9c5('0x3e')){var _0x18f697={};_0x18f697[_0x14bf8e['name']]={'$like':'%'+_0x39777d[_0xc9c5('0x2d')][_0xc9c5('0x3c')]+'%'};return _0x18f697;}})});}_0x2a2cbd=_[_0xc9c5('0x3d')]({},_0x2a2cbd,_0x39777d['options']);var _0x3717c1={'where':_0x2a2cbd[_0xc9c5('0x3a')]};return db['SmsQueueReport']['count'](_0x3717c1)['then'](function(_0x1abec4){_0x1e6c84[_0xc9c5('0x1a')]=_0x1abec4;if(_0x39777d[_0xc9c5('0x2d')]['includeAll']){_0x2a2cbd[_0xc9c5('0x3f')]=[{'all':!![]}];}return db[_0xc9c5('0x40')]['findAll'](_0x2a2cbd);})[_0xc9c5('0x20')](function(_0xf25c44){_0x1e6c84[_0xc9c5('0x41')]=_0xf25c44;return _0x1e6c84;})[_0xc9c5('0x20')](respondWithFilteredResult(_0x4dc92b,_0x2a2cbd))[_0xc9c5('0x42')](handleError(_0x4dc92b,null));};exports[_0xc9c5('0x43')]=function(_0x51cf9e,_0x4acb88){var _0x177286={'raw':!![],'where':{'id':_0x51cf9e[_0xc9c5('0x44')]['id']}},_0x3f4968={};_0x3f4968[_0xc9c5('0x2f')]=_[_0xc9c5('0x45')](db[_0xc9c5('0x40')][_0xc9c5('0x2a')]);_0x3f4968[_0xc9c5('0x2d')]=_['keys'](_0x51cf9e[_0xc9c5('0x2d')]);_0x3f4968[_0xc9c5('0x2e')]=_[_0xc9c5('0x31')](_0x3f4968[_0xc9c5('0x2f')],_0x3f4968[_0xc9c5('0x2d')]);_0x177286[_0xc9c5('0x30')]=_['intersection'](_0x3f4968['model'],qs['fields'](_0x51cf9e[_0xc9c5('0x2d')][_0xc9c5('0x32')]));_0x177286[_0xc9c5('0x30')]=_0x177286[_0xc9c5('0x30')][_0xc9c5('0x33')]?_0x177286[_0xc9c5('0x30')]:_0x3f4968[_0xc9c5('0x2f')];if(_0x51cf9e['query']['includeAll']){_0x177286[_0xc9c5('0x3f')]=[{'all':!![]}];}_0x177286=_['merge']({},_0x177286,_0x51cf9e[_0xc9c5('0x46')]);return db[_0xc9c5('0x40')][_0xc9c5('0x47')](_0x177286)['then'](handleEntityNotFound(_0x4acb88,null))['then'](respondWithResult(_0x4acb88,null))['catch'](handleError(_0x4acb88,null));};exports['create']=function(_0x29948c,_0x59d1f2){return db[_0xc9c5('0x40')][_0xc9c5('0x48')](_0x29948c[_0xc9c5('0x49')],{})[_0xc9c5('0x20')](respondWithResult(_0x59d1f2,0xc9))[_0xc9c5('0x42')](handleError(_0x59d1f2,null));};exports[_0xc9c5('0x1f')]=function(_0x1f93df,_0xc6a3a2){if(_0x1f93df['body']['id']){delete _0x1f93df[_0xc9c5('0x49')]['id'];}return db['SmsQueueReport'][_0xc9c5('0x47')]({'where':{'id':_0x1f93df[_0xc9c5('0x44')]['id']}})[_0xc9c5('0x20')](handleEntityNotFound(_0xc6a3a2,null))[_0xc9c5('0x20')](saveUpdates(_0x1f93df['body'],null))[_0xc9c5('0x20')](respondWithResult(_0xc6a3a2,null))[_0xc9c5('0x42')](handleError(_0xc6a3a2,null));};exports['destroy']=function(_0x4fac0e,_0x539bdb){return db[_0xc9c5('0x40')][_0xc9c5('0x47')]({'where':{'id':_0x4fac0e['params']['id']}})['then'](handleEntityNotFound(_0x539bdb,null))[_0xc9c5('0x20')](removeEntity(_0x539bdb,null))[_0xc9c5('0x42')](handleError(_0x539bdb,null));};exports[_0xc9c5('0x4a')]=function(_0x310e07,_0x5a178b){return db['SmsQueueReport']['describe']()[_0xc9c5('0x20')](respondWithResult(_0x5a178b,null))[_0xc9c5('0x42')](handleError(_0x5a178b,null));}; \ No newline at end of file +var _0x8a7e=['name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','catch','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','then','sendStatus','error','stack'];(function(_0x3d6b69,_0x18caad){var _0xedab6f=function(_0x4bd540){while(--_0x4bd540){_0x3d6b69['push'](_0x3d6b69['shift']());}};_0xedab6f(++_0x18caad);}(_0x8a7e,0x101));var _0xe8a7=function(_0x5e8c1f,_0x2d8ab6){_0x5e8c1f=_0x5e8c1f-0x0;var _0x4d7a15=_0x8a7e[_0x5e8c1f];return _0x4d7a15;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe8a7('0x0'));var rimraf=require(_0xe8a7('0x1'));var zipdir=require(_0xe8a7('0x2'));var jsonpatch=require(_0xe8a7('0x3'));var rp=require(_0xe8a7('0x4'));var moment=require(_0xe8a7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe8a7('0x6'));var util=require(_0xe8a7('0x7'));var path=require(_0xe8a7('0x8'));var sox=require(_0xe8a7('0x9'));var csv=require(_0xe8a7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe8a7('0xb'));var crypto=require(_0xe8a7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe8a7('0xd'));var toCsv=require(_0xe8a7('0xa'));var querystring=require('querystring');var Papa=require(_0xe8a7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe8a7('0xf'));var as=require(_0xe8a7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8a7('0x11'))(_0xe8a7('0x12'));var utils=require(_0xe8a7('0x13'));var config=require(_0xe8a7('0x14'));var db=require(_0xe8a7('0x15'))['db'];function respondWithStatusCode(_0x59d991,_0x56a126){_0x56a126=_0x56a126||0xcc;return function(_0x5873a8){if(_0x5873a8){return _0x59d991['sendStatus'](_0x56a126);}return _0x59d991[_0xe8a7('0x16')](_0x56a126)[_0xe8a7('0x17')]();};}function respondWithResult(_0x56329e,_0x3a16d8){_0x3a16d8=_0x3a16d8||0xc8;return function(_0x330996){if(_0x330996){return _0x56329e[_0xe8a7('0x16')](_0x3a16d8)[_0xe8a7('0x18')](_0x330996);}};}function respondWithFilteredResult(_0x1dccf9,_0x37fffb){return function(_0x48a3ce){if(_0x48a3ce){var _0x11b7f3=_0x48a3ce[_0xe8a7('0x19')],_0x1480e1=_0x37fffb[_0xe8a7('0x1a')],_0x4d318a=_0x37fffb[_0xe8a7('0x1a')]+_0x37fffb[_0xe8a7('0x1b')],_0x54be3a;if(_0x4d318a>=_0x11b7f3){_0x4d318a=_0x11b7f3;_0x54be3a=0xc8;}else{_0x54be3a=0xce;}_0x1dccf9[_0xe8a7('0x16')](_0x54be3a);return _0x1dccf9['set'](_0xe8a7('0x1c'),_0x1480e1+'-'+_0x4d318a+'/'+_0x11b7f3)[_0xe8a7('0x18')](_0x48a3ce);}return null;};}function patchUpdates(_0x533378){return function(_0x1d7ef9){try{jsonpatch[_0xe8a7('0x1d')](_0x1d7ef9,_0x533378,!![]);}catch(_0x10158b){return BPromise[_0xe8a7('0x1e')](_0x10158b);}return _0x1d7ef9['save']();};}function saveUpdates(_0x5019e8,_0x41443b){return function(_0x2f71f7){if(_0x2f71f7){return _0x2f71f7['update'](_0x5019e8)['then'](function(_0x1dc7c9){return _0x1dc7c9;});}return null;};}function removeEntity(_0x42c4a2,_0x10cc69){return function(_0x29cf68){if(_0x29cf68){return _0x29cf68['destroy']()[_0xe8a7('0x1f')](function(){_0x42c4a2[_0xe8a7('0x16')](0xcc)[_0xe8a7('0x17')]();});}};}function handleEntityNotFound(_0x59c3cb,_0x49e6ea){return function(_0x29913d){if(!_0x29913d){_0x59c3cb[_0xe8a7('0x20')](0x194);}return _0x29913d;};}function handleError(_0x5ba6d2,_0x2e034d){_0x2e034d=_0x2e034d||0x1f4;return function(_0x58d57b){logger[_0xe8a7('0x21')](_0x58d57b[_0xe8a7('0x22')]);if(_0x58d57b[_0xe8a7('0x23')]){delete _0x58d57b[_0xe8a7('0x23')];}_0x5ba6d2[_0xe8a7('0x16')](_0x2e034d)[_0xe8a7('0x24')](_0x58d57b);};}exports['index']=function(_0x336390,_0x177d42){var _0x4d6b6d={},_0x22b7be={},_0x8e9c3={'count':0x0,'rows':[]};var _0xfb72d3=_[_0xe8a7('0x25')](db[_0xe8a7('0x26')][_0xe8a7('0x27')],function(_0x17b8e0){return{'name':_0x17b8e0[_0xe8a7('0x28')],'type':_0x17b8e0[_0xe8a7('0x29')][_0xe8a7('0x2a')]};});_0x22b7be[_0xe8a7('0x2b')]=_[_0xe8a7('0x25')](_0xfb72d3,'name');_0x22b7be[_0xe8a7('0x2c')]=_[_0xe8a7('0x2d')](_0x336390['query']);_0x22b7be[_0xe8a7('0x2e')]=_[_0xe8a7('0x2f')](_0x22b7be[_0xe8a7('0x2b')],_0x22b7be[_0xe8a7('0x2c')]);_0x4d6b6d[_0xe8a7('0x30')]=_[_0xe8a7('0x2f')](_0x22b7be[_0xe8a7('0x2b')],qs['fields'](_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x31')]));_0x4d6b6d[_0xe8a7('0x30')]=_0x4d6b6d[_0xe8a7('0x30')]['length']?_0x4d6b6d['attributes']:_0x22b7be[_0xe8a7('0x2b')];if(!_0x336390['query'][_0xe8a7('0x32')](_0xe8a7('0x33'))){_0x4d6b6d['limit']=qs[_0xe8a7('0x1b')](_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x1b')]);_0x4d6b6d[_0xe8a7('0x1a')]=qs['offset'](_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x1a')]);}_0x4d6b6d['order']=qs['sort'](_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x34')]);_0x4d6b6d[_0xe8a7('0x35')]=qs[_0xe8a7('0x2e')](_[_0xe8a7('0x36')](_0x336390['query'],_0x22b7be[_0xe8a7('0x2e')]));if(_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x37')]){_0x4d6b6d[_0xe8a7('0x35')]=_[_0xe8a7('0x38')](_0x4d6b6d['where'],{'$or':_['map'](_0xfb72d3,function(_0x3d7da4){if(_0x3d7da4[_0xe8a7('0x29')]!==_0xe8a7('0x39')){var _0x10ccf0={};_0x10ccf0[_0x3d7da4['name']]={'$like':'%'+_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x37')]+'%'};return _0x10ccf0;}})});}_0x4d6b6d=_[_0xe8a7('0x38')]({},_0x4d6b6d,_0x336390[_0xe8a7('0x3a')]);var _0x268d8d={'where':_0x4d6b6d[_0xe8a7('0x35')]};return db[_0xe8a7('0x26')][_0xe8a7('0x19')](_0x268d8d)[_0xe8a7('0x1f')](function(_0x3a0831){_0x8e9c3['count']=_0x3a0831;if(_0x336390[_0xe8a7('0x2c')][_0xe8a7('0x3b')]){_0x4d6b6d['include']=[{'all':!![]}];}return db[_0xe8a7('0x26')][_0xe8a7('0x3c')](_0x4d6b6d);})[_0xe8a7('0x1f')](function(_0x194029){_0x8e9c3[_0xe8a7('0x3d')]=_0x194029;return _0x8e9c3;})[_0xe8a7('0x1f')](respondWithFilteredResult(_0x177d42,_0x4d6b6d))['catch'](handleError(_0x177d42,null));};exports[_0xe8a7('0x3e')]=function(_0x16464b,_0x170859){var _0x151d9d={'raw':!![],'where':{'id':_0x16464b[_0xe8a7('0x3f')]['id']}},_0x595229={};_0x595229['model']=_[_0xe8a7('0x2d')](db['SmsQueueReport'][_0xe8a7('0x27')]);_0x595229[_0xe8a7('0x2c')]=_['keys'](_0x16464b['query']);_0x595229[_0xe8a7('0x2e')]=_[_0xe8a7('0x2f')](_0x595229[_0xe8a7('0x2b')],_0x595229['query']);_0x151d9d[_0xe8a7('0x30')]=_[_0xe8a7('0x2f')](_0x595229[_0xe8a7('0x2b')],qs['fields'](_0x16464b['query'][_0xe8a7('0x31')]));_0x151d9d['attributes']=_0x151d9d[_0xe8a7('0x30')][_0xe8a7('0x40')]?_0x151d9d[_0xe8a7('0x30')]:_0x595229[_0xe8a7('0x2b')];if(_0x16464b['query'][_0xe8a7('0x3b')]){_0x151d9d[_0xe8a7('0x41')]=[{'all':!![]}];}_0x151d9d=_[_0xe8a7('0x38')]({},_0x151d9d,_0x16464b[_0xe8a7('0x3a')]);return db[_0xe8a7('0x26')][_0xe8a7('0x42')](_0x151d9d)['then'](handleEntityNotFound(_0x170859,null))[_0xe8a7('0x1f')](respondWithResult(_0x170859,null))['catch'](handleError(_0x170859,null));};exports['create']=function(_0x8bb67d,_0xbc71e8){return db[_0xe8a7('0x26')][_0xe8a7('0x43')](_0x8bb67d[_0xe8a7('0x44')],{})[_0xe8a7('0x1f')](respondWithResult(_0xbc71e8,0xc9))[_0xe8a7('0x45')](handleError(_0xbc71e8,null));};exports[_0xe8a7('0x46')]=function(_0x527a3a,_0x51a265){if(_0x527a3a[_0xe8a7('0x44')]['id']){delete _0x527a3a[_0xe8a7('0x44')]['id'];}return db[_0xe8a7('0x26')][_0xe8a7('0x42')]({'where':{'id':_0x527a3a[_0xe8a7('0x3f')]['id']}})[_0xe8a7('0x1f')](handleEntityNotFound(_0x51a265,null))[_0xe8a7('0x1f')](saveUpdates(_0x527a3a['body'],null))[_0xe8a7('0x1f')](respondWithResult(_0x51a265,null))[_0xe8a7('0x45')](handleError(_0x51a265,null));};exports[_0xe8a7('0x47')]=function(_0x5f0a56,_0x31d902){return db['SmsQueueReport'][_0xe8a7('0x42')]({'where':{'id':_0x5f0a56[_0xe8a7('0x3f')]['id']}})[_0xe8a7('0x1f')](handleEntityNotFound(_0x31d902,null))[_0xe8a7('0x1f')](removeEntity(_0x31d902,null))[_0xe8a7('0x45')](handleError(_0x31d902,null));};exports[_0xe8a7('0x48')]=function(_0x22720a,_0x54bc5f){return db[_0xe8a7('0x26')][_0xe8a7('0x48')]()[_0xe8a7('0x1f')](respondWithResult(_0x54bc5f,null))[_0xe8a7('0x45')](handleError(_0x54bc5f,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bc86e59..166f030 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 _0xce92=['path','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce92,0x186));var _0x2ce9=function(_0x2bbf4e,_0x21ddbc){_0x2bbf4e=_0x2bbf4e-0x0;var _0x39d499=_0xce92[_0x2bbf4e];return _0x39d499;};'use strict';var _=require(_0x2ce9('0x0'));var util=require('util');var logger=require(_0x2ce9('0x1'))(_0x2ce9('0x2'));var moment=require(_0x2ce9('0x3'));var BPromise=require(_0x2ce9('0x4'));var rp=require(_0x2ce9('0x5'));var fs=require('fs');var path=require(_0x2ce9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueueReport.attributes');module[_0x2ce9('0x7')]=function(_0x52ae15,_0x2024b4){return _0x52ae15[_0x2ce9('0x8')](_0x2ce9('0x9'),attributes,{'tableName':_0x2ce9('0xa'),'paranoid':![],'indexes':[{'name':_0x2ce9('0xb'),'fields':[_0x2ce9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54af=['../../config/environment','define','SmsQueueReport','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x54af,0xb9));var _0xf54a=function(_0x1402b8,_0x366123){_0x1402b8=_0x1402b8-0x0;var _0x210017=_0x54af[_0x1402b8];return _0x210017;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf54a('0x0'))(_0xf54a('0x1'));var moment=require(_0xf54a('0x2'));var BPromise=require(_0xf54a('0x3'));var rp=require(_0xf54a('0x4'));var fs=require('fs');var path=require(_0xf54a('0x5'));var rimraf=require(_0xf54a('0x6'));var config=require(_0xf54a('0x7'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x16ca4b,_0x452730){return _0x16ca4b[_0xf54a('0x8')](_0xf54a('0x9'),attributes,{'tableName':_0xf54a('0xa'),'paranoid':![],'indexes':[{'name':_0xf54a('0xb'),'fields':[_0xf54a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1320300..75ea38e 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 _0x65c8=['request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','raw','UpdateSmsQueueReport','update','body','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x65c8,0x11e));var _0x865c=function(_0x3d210e,_0x4ac492){_0x3d210e=_0x3d210e-0x0;var _0x3cc2a3=_0x65c8[_0x3d210e];return _0x3cc2a3;};'use strict';var _=require(_0x865c('0x0'));var util=require(_0x865c('0x1'));var moment=require(_0x865c('0x2'));var BPromise=require(_0x865c('0x3'));var rs=require(_0x865c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x865c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x865c('0x6'))(_0x865c('0x7'));var config=require(_0x865c('0x8'));var jayson=require(_0x865c('0x9'));var client=jayson[_0x865c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ede43,_0x57d18e,_0x3acf3d){return new BPromise(function(_0x322141,_0x3e2475){return client[_0x865c('0xb')](_0x5ede43,_0x3acf3d)[_0x865c('0xc')](function(_0x4d85d7){logger[_0x865c('0xd')](_0x865c('0xe'),_0x57d18e,'request\x20sent');logger[_0x865c('0xf')](_0x865c('0x10'),_0x57d18e,_0x865c('0x11'),JSON[_0x865c('0x12')](_0x4d85d7));if(_0x4d85d7[_0x865c('0x13')]){if(_0x4d85d7[_0x865c('0x13')][_0x865c('0x14')]===0x1f4){logger[_0x865c('0x13')](_0x865c('0xe'),_0x57d18e,_0x4d85d7[_0x865c('0x13')]['message']);return _0x3e2475(_0x4d85d7[_0x865c('0x13')][_0x865c('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x57d18e,_0x4d85d7[_0x865c('0x13')]['message']);return _0x322141(_0x4d85d7[_0x865c('0x13')][_0x865c('0x15')]);}else{logger['info'](_0x865c('0xe'),_0x57d18e,_0x865c('0x11'));_0x322141(_0x4d85d7[_0x865c('0x16')][_0x865c('0x15')]);}})['catch'](function(_0x1cb124){logger[_0x865c('0x13')](_0x865c('0xe'),_0x57d18e,_0x1cb124);_0x3e2475(_0x1cb124);});});}exports[_0x865c('0x17')]=function(_0x7594c1){var _0x261523=this;return new Promise(function(_0x5bdb6c,_0x47d654){return db[_0x865c('0x18')][_0x865c('0x19')](_0x7594c1['body'],{'raw':_0x7594c1['options']?_0x7594c1['options'][_0x865c('0x1a')]===undefined?!![]:![]:!![]})[_0x865c('0xc')](function(_0x2aaf49){logger[_0x865c('0xd')]('CreateSmsQueueReport',_0x7594c1);logger['debug']('CreateSmsQueueReport',_0x7594c1,JSON['stringify'](_0x2aaf49));_0x5bdb6c(_0x2aaf49);})['catch'](function(_0x2b10e7){logger[_0x865c('0x13')]('CreateSmsQueueReport',_0x2b10e7['message'],_0x7594c1);_0x47d654(_0x261523[_0x865c('0x13')](0x1f4,_0x2b10e7[_0x865c('0x15')]));});});};exports[_0x865c('0x1b')]=function(_0x4d03f8){var _0x33adc7=this;return new Promise(function(_0x1b6b4c,_0x2f8e9b){return db['SmsQueueReport'][_0x865c('0x1c')](_0x4d03f8[_0x865c('0x1d')],{'raw':_0x4d03f8[_0x865c('0x1e')]?_0x4d03f8[_0x865c('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d03f8['options']?_0x4d03f8[_0x865c('0x1e')][_0x865c('0x1f')]||null:null,'attributes':_0x4d03f8[_0x865c('0x1e')]?_0x4d03f8[_0x865c('0x1e')][_0x865c('0x20')]||null:null,'limit':_0x4d03f8[_0x865c('0x1e')]?_0x4d03f8[_0x865c('0x1e')]['limit']||null:null})[_0x865c('0xc')](function(_0x6253b2){logger[_0x865c('0xd')](_0x865c('0x1b'),_0x4d03f8);logger[_0x865c('0xf')](_0x865c('0x1b'),_0x4d03f8,JSON['stringify'](_0x6253b2));_0x1b6b4c(_0x6253b2);})['catch'](function(_0x4b1a4c){logger[_0x865c('0x13')](_0x865c('0x1b'),_0x4b1a4c[_0x865c('0x15')],_0x4d03f8);_0x2f8e9b(_0x33adc7[_0x865c('0x13')](0x1f4,_0x4b1a4c[_0x865c('0x15')]));});});}; \ No newline at end of file +var _0xff90=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','update','where','attributes','limit','UpdateSmsQueueReport','bluebird','randomstring','../../config/utils'];(function(_0x5e3787,_0x30e60f){var _0x4f0b0f=function(_0x2439dd){while(--_0x2439dd){_0x5e3787['push'](_0x5e3787['shift']());}};_0x4f0b0f(++_0x30e60f);}(_0xff90,0x15d));var _0x0ff9=function(_0x4d183d,_0x123de0){_0x4d183d=_0x4d183d-0x0;var _0x431236=_0xff90[_0x4d183d];return _0x431236;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0ff9('0x0'));var rs=require(_0x0ff9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0ff9('0x2'));var logger=require(_0x0ff9('0x3'))(_0x0ff9('0x4'));var config=require(_0x0ff9('0x5'));var jayson=require(_0x0ff9('0x6'));var client=jayson['client'][_0x0ff9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25e4f9,_0x44c6da,_0x11aeae){return new BPromise(function(_0x264a90,_0x53ae2d){return client[_0x0ff9('0x8')](_0x25e4f9,_0x11aeae)[_0x0ff9('0x9')](function(_0x47ef41){logger[_0x0ff9('0xa')](_0x0ff9('0xb'),_0x44c6da,_0x0ff9('0xc'));logger[_0x0ff9('0xd')](_0x0ff9('0xe'),_0x44c6da,_0x0ff9('0xc'),JSON[_0x0ff9('0xf')](_0x47ef41));if(_0x47ef41[_0x0ff9('0x10')]){if(_0x47ef41[_0x0ff9('0x10')][_0x0ff9('0x11')]===0x1f4){logger['error'](_0x0ff9('0xb'),_0x44c6da,_0x47ef41['error']['message']);return _0x53ae2d(_0x47ef41[_0x0ff9('0x10')][_0x0ff9('0x12')]);}logger['error'](_0x0ff9('0xb'),_0x44c6da,_0x47ef41[_0x0ff9('0x10')][_0x0ff9('0x12')]);return _0x264a90(_0x47ef41['error'][_0x0ff9('0x12')]);}else{logger[_0x0ff9('0xa')](_0x0ff9('0xb'),_0x44c6da,_0x0ff9('0xc'));_0x264a90(_0x47ef41[_0x0ff9('0x13')]['message']);}})[_0x0ff9('0x14')](function(_0x12f22d){logger[_0x0ff9('0x10')](_0x0ff9('0xb'),_0x44c6da,_0x12f22d);_0x53ae2d(_0x12f22d);});});}exports['CreateSmsQueueReport']=function(_0x62982c){var _0x3134c6=this;return new Promise(function(_0x2b9c41,_0x4b59e7){return db[_0x0ff9('0x15')][_0x0ff9('0x16')](_0x62982c[_0x0ff9('0x17')],{'raw':_0x62982c[_0x0ff9('0x18')]?_0x62982c['options'][_0x0ff9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x42fe5b){logger[_0x0ff9('0xa')](_0x0ff9('0x1a'),_0x62982c);logger[_0x0ff9('0xd')]('CreateSmsQueueReport',_0x62982c,JSON[_0x0ff9('0xf')](_0x42fe5b));_0x2b9c41(_0x42fe5b);})[_0x0ff9('0x14')](function(_0x22fb61){logger[_0x0ff9('0x10')](_0x0ff9('0x1a'),_0x22fb61['message'],_0x62982c);_0x4b59e7(_0x3134c6[_0x0ff9('0x10')](0x1f4,_0x22fb61[_0x0ff9('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x38ce8b){var _0x6013b9=this;return new Promise(function(_0x52a3cf,_0x44338e){return db[_0x0ff9('0x15')][_0x0ff9('0x1b')](_0x38ce8b[_0x0ff9('0x17')],{'raw':_0x38ce8b[_0x0ff9('0x18')]?_0x38ce8b[_0x0ff9('0x18')][_0x0ff9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38ce8b[_0x0ff9('0x18')]?_0x38ce8b[_0x0ff9('0x18')][_0x0ff9('0x1c')]||null:null,'attributes':_0x38ce8b[_0x0ff9('0x18')]?_0x38ce8b[_0x0ff9('0x18')][_0x0ff9('0x1d')]||null:null,'limit':_0x38ce8b['options']?_0x38ce8b[_0x0ff9('0x18')][_0x0ff9('0x1e')]||null:null})[_0x0ff9('0x9')](function(_0x6af1cd){logger[_0x0ff9('0xa')](_0x0ff9('0x1f'),_0x38ce8b);logger[_0x0ff9('0xd')]('UpdateSmsQueueReport',_0x38ce8b,JSON[_0x0ff9('0xf')](_0x6af1cd));_0x52a3cf(_0x6af1cd);})[_0x0ff9('0x14')](function(_0x28ab71){logger[_0x0ff9('0x10')](_0x0ff9('0x1f'),_0x28ab71['message'],_0x38ce8b);_0x44338e(_0x6013b9[_0x0ff9('0x10')](0x1f4,_0x28ab71[_0x0ff9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7d82d49..371e2e0 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 _0x087b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util','express'];(function(_0x537ab5,_0x5dc6c6){var _0x100378=function(_0x16353b){while(--_0x16353b){_0x537ab5['push'](_0x537ab5['shift']());}};_0x100378(++_0x5dc6c6);}(_0x087b,0x11a));var _0xb087=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x087b[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var auth=require(_0xb087('0x3'));var interaction=require(_0xb087('0x4'));var config=require(_0xb087('0x5'));var controller=require(_0xb087('0x6'));router[_0xb087('0x7')]('/',auth[_0xb087('0x8')](),controller[_0xb087('0x9')]);router[_0xb087('0x7')](_0xb087('0xa'),auth[_0xb087('0x8')](),controller[_0xb087('0xb')]);router[_0xb087('0x7')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0xd')]);router[_0xb087('0xe')]('/',auth[_0xb087('0x8')](),controller['create']);router[_0xb087('0xf')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller['destroy']);module[_0xb087('0x12')]=router; \ No newline at end of file +var _0xefda=['show','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x329b53,_0x55ab65){var _0x48468d=function(_0x359878){while(--_0x359878){_0x329b53['push'](_0x329b53['shift']());}};_0x48468d(++_0x55ab65);}(_0xefda,0x96));var _0xaefd=function(_0x2e0bd8,_0x11e41d){_0x2e0bd8=_0x2e0bd8-0x0;var _0x5cb4b5=_0xefda[_0x2e0bd8];return _0x5cb4b5;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var auth=require(_0xaefd('0x3'));var interaction=require(_0xaefd('0x4'));var config=require(_0xaefd('0x5'));var controller=require(_0xaefd('0x6'));router[_0xaefd('0x7')]('/',auth[_0xaefd('0x8')](),controller['index']);router[_0xaefd('0x7')](_0xaefd('0x9'),auth[_0xaefd('0x8')](),controller[_0xaefd('0xa')]);router['get'](_0xaefd('0xb'),auth[_0xaefd('0x8')](),controller[_0xaefd('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaefd('0xd')](_0xaefd('0xb'),auth[_0xaefd('0x8')](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xb'),auth[_0xaefd('0x8')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 21642a7..c6ef229 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 _0xa094=['agent','queue','DATE','NOW','moment','exports','STRING','ENUM','account'];(function(_0x980f9b,_0x25570c){var _0x3969fe=function(_0x2a39a6){while(--_0x2a39a6){_0x980f9b['push'](_0x980f9b['shift']());}};_0x3969fe(++_0x25570c);}(_0xa094,0xc1));var _0x4a09=function(_0x109480,_0x6bc599){_0x109480=_0x109480-0x0;var _0x2d26eb=_0xa094[_0x109480];return _0x2d26eb;};'use strict';var moment=require(_0x4a09('0x0'));var Sequelize=require('sequelize');module[_0x4a09('0x1')]={'uniqueid':{'type':Sequelize[_0x4a09('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4a09('0x3')](_0x4a09('0x4'),_0x4a09('0x5'),_0x4a09('0x6')),'allowNull':![],'defaultValue':_0x4a09('0x6')},'transferredAt':{'type':Sequelize[_0x4a09('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x4a09('0x8')]}}; \ No newline at end of file +var _0x1b58=['DATE','NOW','sequelize','exports','ENUM','account','queue'];(function(_0xd09757,_0x183203){var _0x3247ac=function(_0x276228){while(--_0x276228){_0xd09757['push'](_0xd09757['shift']());}};_0x3247ac(++_0x183203);}(_0x1b58,0x64));var _0x81b5=function(_0x36c40b,_0x251f62){_0x36c40b=_0x36c40b-0x0;var _0x30f67c=_0x1b58[_0x36c40b];return _0x30f67c;};'use strict';var moment=require('moment');var Sequelize=require(_0x81b5('0x0'));module[_0x81b5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x81b5('0x2')](_0x81b5('0x3'),'agent',_0x81b5('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x81b5('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x81b5('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7d548f9..8b3d60a 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 _0xed95=['status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','VIRTUAL','SmsTransferReport','count','includeAll','include','catch','keys','attributes','length','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x412a72,_0x10284f){var _0x53e97f=function(_0x10d626){while(--_0x10d626){_0x412a72['push'](_0x412a72['shift']());}};_0x53e97f(++_0x10284f);}(_0xed95,0x145));var _0x5ed9=function(_0x406ea6,_0x3f4e73){_0x406ea6=_0x406ea6-0x0;var _0x6894d7=_0xed95[_0x406ea6];return _0x6894d7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ed9('0x0'));var rimraf=require(_0x5ed9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ed9('0x2'));var rp=require(_0x5ed9('0x3'));var moment=require(_0x5ed9('0x4'));var BPromise=require(_0x5ed9('0x5'));var Mustache=require(_0x5ed9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5ed9('0x7'));var csv=require(_0x5ed9('0x8'));var ejs=require(_0x5ed9('0x9'));var fs=require('fs');var _=require(_0x5ed9('0xa'));var squel=require(_0x5ed9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ed9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5ed9('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ed9('0xe'));var qs=require(_0x5ed9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ed9('0x10'));var logger=require(_0x5ed9('0x11'))('api');var utils=require(_0x5ed9('0x12'));var config=require(_0x5ed9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5984ce,_0x20ebdb){_0x20ebdb=_0x20ebdb||0xcc;return function(_0x301ef9){if(_0x301ef9){return _0x5984ce['sendStatus'](_0x20ebdb);}return _0x5984ce[_0x5ed9('0x14')](_0x20ebdb)[_0x5ed9('0x15')]();};}function respondWithResult(_0x358018,_0x579bea){_0x579bea=_0x579bea||0xc8;return function(_0x4d745b){if(_0x4d745b){return _0x358018['status'](_0x579bea)[_0x5ed9('0x16')](_0x4d745b);}};}function respondWithFilteredResult(_0xc911ff,_0x5615f8){return function(_0x4f4904){if(_0x4f4904){var _0x2a318e=_0x4f4904['count'],_0x2f4755=_0x5615f8[_0x5ed9('0x17')],_0x35ad5b=_0x5615f8[_0x5ed9('0x17')]+_0x5615f8[_0x5ed9('0x18')],_0x435573;if(_0x35ad5b>=_0x2a318e){_0x35ad5b=_0x2a318e;_0x435573=0xc8;}else{_0x435573=0xce;}_0xc911ff[_0x5ed9('0x14')](_0x435573);return _0xc911ff[_0x5ed9('0x19')](_0x5ed9('0x1a'),_0x2f4755+'-'+_0x35ad5b+'/'+_0x2a318e)[_0x5ed9('0x16')](_0x4f4904);}return null;};}function patchUpdates(_0x2b2b16){return function(_0x3de9a8){try{jsonpatch[_0x5ed9('0x1b')](_0x3de9a8,_0x2b2b16,!![]);}catch(_0x3008ae){return BPromise[_0x5ed9('0x1c')](_0x3008ae);}return _0x3de9a8['save']();};}function saveUpdates(_0x120578,_0x4ff7a6){return function(_0x136bb6){if(_0x136bb6){return _0x136bb6[_0x5ed9('0x1d')](_0x120578)[_0x5ed9('0x1e')](function(_0x2bb8eb){return _0x2bb8eb;});}return null;};}function removeEntity(_0xe6ba2f,_0x4ec170){return function(_0x4c925a){if(_0x4c925a){return _0x4c925a[_0x5ed9('0x1f')]()[_0x5ed9('0x1e')](function(){_0xe6ba2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x352e9,_0x344504){return function(_0x5182e5){if(!_0x5182e5){_0x352e9[_0x5ed9('0x20')](0x194);}return _0x5182e5;};}function handleError(_0x2f9a71,_0x3fdcc0){_0x3fdcc0=_0x3fdcc0||0x1f4;return function(_0x2d5875){logger[_0x5ed9('0x21')](_0x2d5875['stack']);if(_0x2d5875['name']){delete _0x2d5875[_0x5ed9('0x22')];}_0x2f9a71[_0x5ed9('0x14')](_0x3fdcc0)[_0x5ed9('0x23')](_0x2d5875);};}exports[_0x5ed9('0x24')]=function(_0x53facf,_0x1b3dba){var _0x6a7b29={},_0x3cb5cd={},_0x305e19={'count':0x0,'rows':[]};var _0x4e2d5d=_['map'](db['SmsTransferReport'][_0x5ed9('0x25')],function(_0x2760ac){return{'name':_0x2760ac[_0x5ed9('0x26')],'type':_0x2760ac['type'][_0x5ed9('0x27')]};});_0x3cb5cd[_0x5ed9('0x28')]=_['map'](_0x4e2d5d,_0x5ed9('0x22'));_0x3cb5cd[_0x5ed9('0x29')]=_['keys'](_0x53facf['query']);_0x3cb5cd[_0x5ed9('0x2a')]=_['intersection'](_0x3cb5cd[_0x5ed9('0x28')],_0x3cb5cd[_0x5ed9('0x29')]);_0x6a7b29['attributes']=_[_0x5ed9('0x2b')](_0x3cb5cd[_0x5ed9('0x28')],qs['fields'](_0x53facf['query'][_0x5ed9('0x2c')]));_0x6a7b29['attributes']=_0x6a7b29['attributes']['length']?_0x6a7b29['attributes']:_0x3cb5cd['model'];if(!_0x53facf[_0x5ed9('0x29')][_0x5ed9('0x2d')](_0x5ed9('0x2e'))){_0x6a7b29[_0x5ed9('0x18')]=qs[_0x5ed9('0x18')](_0x53facf[_0x5ed9('0x29')][_0x5ed9('0x18')]);_0x6a7b29[_0x5ed9('0x17')]=qs['offset'](_0x53facf['query']['offset']);}_0x6a7b29[_0x5ed9('0x2f')]=qs['sort'](_0x53facf[_0x5ed9('0x29')]['sort']);_0x6a7b29[_0x5ed9('0x30')]=qs[_0x5ed9('0x2a')](_[_0x5ed9('0x31')](_0x53facf['query'],_0x3cb5cd[_0x5ed9('0x2a')]));if(_0x53facf[_0x5ed9('0x29')][_0x5ed9('0x32')]){_0x6a7b29['where']=_[_0x5ed9('0x33')](_0x6a7b29[_0x5ed9('0x30')],{'$or':_[_0x5ed9('0x34')](_0x4e2d5d,function(_0x392dba){if(_0x392dba[_0x5ed9('0x35')]!==_0x5ed9('0x36')){var _0x1284e0={};_0x1284e0[_0x392dba[_0x5ed9('0x22')]]={'$like':'%'+_0x53facf['query'][_0x5ed9('0x32')]+'%'};return _0x1284e0;}})});}_0x6a7b29=_[_0x5ed9('0x33')]({},_0x6a7b29,_0x53facf['options']);var _0x2dda57={'where':_0x6a7b29['where']};return db[_0x5ed9('0x37')][_0x5ed9('0x38')](_0x2dda57)[_0x5ed9('0x1e')](function(_0x4d40e2){_0x305e19[_0x5ed9('0x38')]=_0x4d40e2;if(_0x53facf[_0x5ed9('0x29')][_0x5ed9('0x39')]){_0x6a7b29[_0x5ed9('0x3a')]=[{'all':!![]}];}return db[_0x5ed9('0x37')]['findAll'](_0x6a7b29);})[_0x5ed9('0x1e')](function(_0x2f6906){_0x305e19['rows']=_0x2f6906;return _0x305e19;})[_0x5ed9('0x1e')](respondWithFilteredResult(_0x1b3dba,_0x6a7b29))[_0x5ed9('0x3b')](handleError(_0x1b3dba,null));};exports['show']=function(_0x25d1e4,_0x1f8b02){var _0xf67e5f={'raw':!![],'where':{'id':_0x25d1e4['params']['id']}},_0x3f0dfc={};_0x3f0dfc[_0x5ed9('0x28')]=_[_0x5ed9('0x3c')](db[_0x5ed9('0x37')][_0x5ed9('0x25')]);_0x3f0dfc[_0x5ed9('0x29')]=_[_0x5ed9('0x3c')](_0x25d1e4[_0x5ed9('0x29')]);_0x3f0dfc[_0x5ed9('0x2a')]=_[_0x5ed9('0x2b')](_0x3f0dfc['model'],_0x3f0dfc['query']);_0xf67e5f[_0x5ed9('0x3d')]=_[_0x5ed9('0x2b')](_0x3f0dfc[_0x5ed9('0x28')],qs[_0x5ed9('0x2c')](_0x25d1e4['query'][_0x5ed9('0x2c')]));_0xf67e5f[_0x5ed9('0x3d')]=_0xf67e5f[_0x5ed9('0x3d')][_0x5ed9('0x3e')]?_0xf67e5f[_0x5ed9('0x3d')]:_0x3f0dfc[_0x5ed9('0x28')];if(_0x25d1e4[_0x5ed9('0x29')][_0x5ed9('0x39')]){_0xf67e5f[_0x5ed9('0x3a')]=[{'all':!![]}];}_0xf67e5f=_['merge']({},_0xf67e5f,_0x25d1e4[_0x5ed9('0x3f')]);return db[_0x5ed9('0x37')][_0x5ed9('0x40')](_0xf67e5f)[_0x5ed9('0x1e')](handleEntityNotFound(_0x1f8b02,null))['then'](respondWithResult(_0x1f8b02,null))[_0x5ed9('0x3b')](handleError(_0x1f8b02,null));};exports[_0x5ed9('0x41')]=function(_0x5d70d7,_0x26bad7){return db[_0x5ed9('0x37')][_0x5ed9('0x41')](_0x5d70d7[_0x5ed9('0x42')],{})[_0x5ed9('0x1e')](respondWithResult(_0x26bad7,0xc9))[_0x5ed9('0x3b')](handleError(_0x26bad7,null));};exports[_0x5ed9('0x1d')]=function(_0x51a6e6,_0x3432ca){if(_0x51a6e6[_0x5ed9('0x42')]['id']){delete _0x51a6e6['body']['id'];}return db['SmsTransferReport'][_0x5ed9('0x40')]({'where':{'id':_0x51a6e6['params']['id']}})['then'](handleEntityNotFound(_0x3432ca,null))[_0x5ed9('0x1e')](saveUpdates(_0x51a6e6[_0x5ed9('0x42')],null))['then'](respondWithResult(_0x3432ca,null))[_0x5ed9('0x3b')](handleError(_0x3432ca,null));};exports[_0x5ed9('0x1f')]=function(_0x1787ca,_0x23ad50){return db['SmsTransferReport']['find']({'where':{'id':_0x1787ca[_0x5ed9('0x43')]['id']}})[_0x5ed9('0x1e')](handleEntityNotFound(_0x23ad50,null))[_0x5ed9('0x1e')](removeEntity(_0x23ad50,null))[_0x5ed9('0x3b')](handleError(_0x23ad50,null));};exports[_0x5ed9('0x44')]=function(_0xc0e6f1,_0x33bbbe){return db[_0x5ed9('0x37')][_0x5ed9('0x44')]()[_0x5ed9('0x1e')](respondWithResult(_0x33bbbe,null))[_0x5ed9('0x3b')](handleError(_0x33bbbe,null));}; \ No newline at end of file +var _0x8dd5=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','set','apply','reject','then','destroy','status','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x36d1d3,_0x32add9){var _0x407caf=function(_0x5b88ee){while(--_0x5b88ee){_0x36d1d3['push'](_0x36d1d3['shift']());}};_0x407caf(++_0x32add9);}(_0x8dd5,0xca));var _0x58dd=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x8dd5[_0x309d93];return _0x2dd61d;};'use strict';var pdf=require(_0x58dd('0x0'));var emlformat=require(_0x58dd('0x1'));var rimraf=require(_0x58dd('0x2'));var zipdir=require(_0x58dd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58dd('0x4'));var moment=require('moment');var BPromise=require(_0x58dd('0x5'));var Mustache=require('mustache');var util=require(_0x58dd('0x6'));var path=require(_0x58dd('0x7'));var sox=require(_0x58dd('0x8'));var csv=require(_0x58dd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x58dd('0xa'));var crypto=require('crypto');var jsforce=require(_0x58dd('0xb'));var deskjs=require(_0x58dd('0xc'));var toCsv=require(_0x58dd('0x9'));var querystring=require(_0x58dd('0xd'));var Papa=require(_0x58dd('0xe'));var Redis=require(_0x58dd('0xf'));var authService=require(_0x58dd('0x10'));var qs=require(_0x58dd('0x11'));var as=require(_0x58dd('0x12'));var hardwareService=require(_0x58dd('0x13'));var logger=require(_0x58dd('0x14'))(_0x58dd('0x15'));var utils=require(_0x58dd('0x16'));var config=require(_0x58dd('0x17'));var db=require(_0x58dd('0x18'))['db'];function respondWithStatusCode(_0x3266e8,_0x12953e){_0x12953e=_0x12953e||0xcc;return function(_0x46e5dd){if(_0x46e5dd){return _0x3266e8[_0x58dd('0x19')](_0x12953e);}return _0x3266e8['status'](_0x12953e)['end']();};}function respondWithResult(_0x41b4ec,_0x57a30b){_0x57a30b=_0x57a30b||0xc8;return function(_0x2f475f){if(_0x2f475f){return _0x41b4ec['status'](_0x57a30b)[_0x58dd('0x1a')](_0x2f475f);}};}function respondWithFilteredResult(_0x38feba,_0x234e33){return function(_0x49b42c){if(_0x49b42c){var _0x2af06e=_0x49b42c[_0x58dd('0x1b')],_0x3446a0=_0x234e33['offset'],_0x54ef50=_0x234e33[_0x58dd('0x1c')]+_0x234e33['limit'],_0x240c47;if(_0x54ef50>=_0x2af06e){_0x54ef50=_0x2af06e;_0x240c47=0xc8;}else{_0x240c47=0xce;}_0x38feba['status'](_0x240c47);return _0x38feba[_0x58dd('0x1d')]('Content-Range',_0x3446a0+'-'+_0x54ef50+'/'+_0x2af06e)[_0x58dd('0x1a')](_0x49b42c);}return null;};}function patchUpdates(_0x437e0f){return function(_0x4d9b1a){try{jsonpatch[_0x58dd('0x1e')](_0x4d9b1a,_0x437e0f,!![]);}catch(_0x32fdb3){return BPromise[_0x58dd('0x1f')](_0x32fdb3);}return _0x4d9b1a['save']();};}function saveUpdates(_0x49bb4a,_0x203e4d){return function(_0x1d799e){if(_0x1d799e){return _0x1d799e['update'](_0x49bb4a)[_0x58dd('0x20')](function(_0x52d930){return _0x52d930;});}return null;};}function removeEntity(_0x516f94,_0x4927b8){return function(_0x1fb865){if(_0x1fb865){return _0x1fb865[_0x58dd('0x21')]()[_0x58dd('0x20')](function(){_0x516f94[_0x58dd('0x22')](0xcc)[_0x58dd('0x23')]();});}};}function handleEntityNotFound(_0x23c39b,_0x3e4410){return function(_0xd6dbdf){if(!_0xd6dbdf){_0x23c39b[_0x58dd('0x19')](0x194);}return _0xd6dbdf;};}function handleError(_0x2784e1,_0x5e7c5c){_0x5e7c5c=_0x5e7c5c||0x1f4;return function(_0x513967){logger[_0x58dd('0x24')](_0x513967[_0x58dd('0x25')]);if(_0x513967['name']){delete _0x513967[_0x58dd('0x26')];}_0x2784e1[_0x58dd('0x22')](_0x5e7c5c)[_0x58dd('0x27')](_0x513967);};}exports[_0x58dd('0x28')]=function(_0x41a044,_0x13ada6){var _0x4f2c13={},_0x3df96f={},_0x3f6c57={'count':0x0,'rows':[]};var _0x574cab=_[_0x58dd('0x29')](db[_0x58dd('0x2a')][_0x58dd('0x2b')],function(_0x316183){return{'name':_0x316183[_0x58dd('0x2c')],'type':_0x316183[_0x58dd('0x2d')]['key']};});_0x3df96f[_0x58dd('0x2e')]=_[_0x58dd('0x29')](_0x574cab,'name');_0x3df96f[_0x58dd('0x2f')]=_['keys'](_0x41a044[_0x58dd('0x2f')]);_0x3df96f['filters']=_[_0x58dd('0x30')](_0x3df96f[_0x58dd('0x2e')],_0x3df96f['query']);_0x4f2c13[_0x58dd('0x31')]=_['intersection'](_0x3df96f[_0x58dd('0x2e')],qs[_0x58dd('0x32')](_0x41a044['query']['fields']));_0x4f2c13[_0x58dd('0x31')]=_0x4f2c13[_0x58dd('0x31')][_0x58dd('0x33')]?_0x4f2c13[_0x58dd('0x31')]:_0x3df96f[_0x58dd('0x2e')];if(!_0x41a044[_0x58dd('0x2f')]['hasOwnProperty'](_0x58dd('0x34'))){_0x4f2c13[_0x58dd('0x35')]=qs['limit'](_0x41a044[_0x58dd('0x2f')][_0x58dd('0x35')]);_0x4f2c13[_0x58dd('0x1c')]=qs['offset'](_0x41a044[_0x58dd('0x2f')][_0x58dd('0x1c')]);}_0x4f2c13[_0x58dd('0x36')]=qs[_0x58dd('0x37')](_0x41a044['query'][_0x58dd('0x37')]);_0x4f2c13[_0x58dd('0x38')]=qs[_0x58dd('0x39')](_['pick'](_0x41a044[_0x58dd('0x2f')],_0x3df96f['filters']));if(_0x41a044[_0x58dd('0x2f')][_0x58dd('0x3a')]){_0x4f2c13[_0x58dd('0x38')]=_[_0x58dd('0x3b')](_0x4f2c13[_0x58dd('0x38')],{'$or':_[_0x58dd('0x29')](_0x574cab,function(_0x3ea330){if(_0x3ea330[_0x58dd('0x2d')]!=='VIRTUAL'){var _0x1dbbcc={};_0x1dbbcc[_0x3ea330[_0x58dd('0x26')]]={'$like':'%'+_0x41a044[_0x58dd('0x2f')][_0x58dd('0x3a')]+'%'};return _0x1dbbcc;}})});}_0x4f2c13=_[_0x58dd('0x3b')]({},_0x4f2c13,_0x41a044[_0x58dd('0x3c')]);var _0x2b9e9e={'where':_0x4f2c13['where']};return db['SmsTransferReport'][_0x58dd('0x1b')](_0x2b9e9e)[_0x58dd('0x20')](function(_0x2d5436){_0x3f6c57['count']=_0x2d5436;if(_0x41a044[_0x58dd('0x2f')][_0x58dd('0x3d')]){_0x4f2c13[_0x58dd('0x3e')]=[{'all':!![]}];}return db[_0x58dd('0x2a')][_0x58dd('0x3f')](_0x4f2c13);})['then'](function(_0x2b9223){_0x3f6c57[_0x58dd('0x40')]=_0x2b9223;return _0x3f6c57;})[_0x58dd('0x20')](respondWithFilteredResult(_0x13ada6,_0x4f2c13))['catch'](handleError(_0x13ada6,null));};exports[_0x58dd('0x41')]=function(_0x39cb19,_0x13668a){var _0x546f5c={'raw':!![],'where':{'id':_0x39cb19[_0x58dd('0x42')]['id']}},_0x2421c2={};_0x2421c2[_0x58dd('0x2e')]=_['keys'](db[_0x58dd('0x2a')][_0x58dd('0x2b')]);_0x2421c2[_0x58dd('0x2f')]=_[_0x58dd('0x43')](_0x39cb19[_0x58dd('0x2f')]);_0x2421c2['filters']=_[_0x58dd('0x30')](_0x2421c2[_0x58dd('0x2e')],_0x2421c2[_0x58dd('0x2f')]);_0x546f5c[_0x58dd('0x31')]=_[_0x58dd('0x30')](_0x2421c2['model'],qs[_0x58dd('0x32')](_0x39cb19[_0x58dd('0x2f')][_0x58dd('0x32')]));_0x546f5c[_0x58dd('0x31')]=_0x546f5c[_0x58dd('0x31')]['length']?_0x546f5c[_0x58dd('0x31')]:_0x2421c2[_0x58dd('0x2e')];if(_0x39cb19[_0x58dd('0x2f')][_0x58dd('0x3d')]){_0x546f5c[_0x58dd('0x3e')]=[{'all':!![]}];}_0x546f5c=_[_0x58dd('0x3b')]({},_0x546f5c,_0x39cb19[_0x58dd('0x3c')]);return db[_0x58dd('0x2a')][_0x58dd('0x44')](_0x546f5c)['then'](handleEntityNotFound(_0x13668a,null))[_0x58dd('0x20')](respondWithResult(_0x13668a,null))[_0x58dd('0x45')](handleError(_0x13668a,null));};exports[_0x58dd('0x46')]=function(_0x3fe765,_0x214b59){return db[_0x58dd('0x2a')][_0x58dd('0x46')](_0x3fe765[_0x58dd('0x47')],{})[_0x58dd('0x20')](respondWithResult(_0x214b59,0xc9))[_0x58dd('0x45')](handleError(_0x214b59,null));};exports[_0x58dd('0x48')]=function(_0x2840f0,_0x28f5ac){if(_0x2840f0[_0x58dd('0x47')]['id']){delete _0x2840f0[_0x58dd('0x47')]['id'];}return db[_0x58dd('0x2a')]['find']({'where':{'id':_0x2840f0[_0x58dd('0x42')]['id']}})[_0x58dd('0x20')](handleEntityNotFound(_0x28f5ac,null))['then'](saveUpdates(_0x2840f0['body'],null))[_0x58dd('0x20')](respondWithResult(_0x28f5ac,null))['catch'](handleError(_0x28f5ac,null));};exports[_0x58dd('0x21')]=function(_0x2001c2,_0x195269){return db[_0x58dd('0x2a')][_0x58dd('0x44')]({'where':{'id':_0x2001c2[_0x58dd('0x42')]['id']}})['then'](handleEntityNotFound(_0x195269,null))[_0x58dd('0x20')](removeEntity(_0x195269,null))['catch'](handleError(_0x195269,null));};exports['describe']=function(_0x52fa20,_0x22ad15){return db[_0x58dd('0x2a')][_0x58dd('0x49')]()[_0x58dd('0x20')](respondWithResult(_0x22ad15,null))[_0x58dd('0x45')](handleError(_0x22ad15,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7fbba75..99cc911 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 _0xc1c6=['rimraf','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x22fcb1,_0x2d8dae){_0x22fcb1=_0x22fcb1-0x0;var _0x4712b9=_0xc1c6[_0x22fcb1];return _0x4712b9;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[{'name':_0x6c1c('0xa'),'fields':[_0x6c1c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1967=['rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4468de,_0x7b7569){var _0x38c936=function(_0x4c3865){while(--_0x4c3865){_0x4468de['push'](_0x4468de['shift']());}};_0x38c936(++_0x7b7569);}(_0x1967,0x173));var _0x7196=function(_0x293c9e,_0x4089a3){_0x293c9e=_0x293c9e-0x0;var _0x4f6e73=_0x1967[_0x293c9e];return _0x4f6e73;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[{'name':_0x7196('0xd'),'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 c08e6cf..26cc2e2 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 _0xc224=['then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0xc224,0xe8));var _0x4c22=function(_0x14b52e,_0x257698){_0x14b52e=_0x14b52e-0x0;var _0x530ba5=_0xc224[_0x14b52e];return _0x530ba5;};'use strict';var _=require(_0x4c22('0x0'));var util=require('util');var moment=require(_0x4c22('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c22('0x2'));var fs=require('fs');var Redis=require(_0x4c22('0x3'));var db=require(_0x4c22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c22('0x5'))('rpc');var config=require(_0x4c22('0x6'));var jayson=require(_0x4c22('0x7'));var client=jayson[_0x4c22('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b8496,_0x2ab035,_0x54fdc0){return new BPromise(function(_0x4fa366,_0x398aa1){return client[_0x4c22('0x9')](_0x3b8496,_0x54fdc0)[_0x4c22('0xa')](function(_0x52e511){logger['info'](_0x4c22('0xb'),_0x2ab035,_0x4c22('0xc'));logger[_0x4c22('0xd')](_0x4c22('0xe'),_0x2ab035,'request\x20sent',JSON[_0x4c22('0xf')](_0x52e511));if(_0x52e511['error']){if(_0x52e511[_0x4c22('0x10')][_0x4c22('0x11')]===0x1f4){logger['error'](_0x4c22('0xb'),_0x2ab035,_0x52e511[_0x4c22('0x10')]['message']);return _0x398aa1(_0x52e511[_0x4c22('0x10')][_0x4c22('0x12')]);}logger[_0x4c22('0x10')](_0x4c22('0xb'),_0x2ab035,_0x52e511[_0x4c22('0x10')][_0x4c22('0x12')]);return _0x4fa366(_0x52e511['error'][_0x4c22('0x12')]);}else{logger[_0x4c22('0x13')](_0x4c22('0xb'),_0x2ab035,_0x4c22('0xc'));_0x4fa366(_0x52e511[_0x4c22('0x14')][_0x4c22('0x12')]);}})[_0x4c22('0x15')](function(_0x50cc5b){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2ab035,_0x50cc5b);_0x398aa1(_0x50cc5b);});});} \ No newline at end of file +var _0x4999=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x37047c,_0x696a36){var _0x4b986a=function(_0x3a6aa0){while(--_0x3a6aa0){_0x37047c['push'](_0x37047c['shift']());}};_0x4b986a(++_0x696a36);}(_0x4999,0x145));var _0x9499=function(_0x2700d5,_0x1b113b){_0x2700d5=_0x2700d5-0x0;var _0xdc3338=_0x4999[_0x2700d5];return _0xdc3338;};'use strict';var _=require('lodash');var util=require(_0x9499('0x0'));var moment=require('moment');var BPromise=require(_0x9499('0x1'));var rs=require(_0x9499('0x2'));var fs=require('fs');var Redis=require(_0x9499('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9499('0x4'));var logger=require(_0x9499('0x5'))('rpc');var config=require(_0x9499('0x6'));var jayson=require(_0x9499('0x7'));var client=jayson[_0x9499('0x8')][_0x9499('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa4b0d,_0x123207,_0x4d91f4){return new BPromise(function(_0x2353bd,_0xf152bd){return client[_0x9499('0xa')](_0xa4b0d,_0x4d91f4)[_0x9499('0xb')](function(_0x261783){logger[_0x9499('0xc')](_0x9499('0xd'),_0x123207,_0x9499('0xe'));logger[_0x9499('0xf')](_0x9499('0x10'),_0x123207,_0x9499('0xe'),JSON[_0x9499('0x11')](_0x261783));if(_0x261783[_0x9499('0x12')]){if(_0x261783[_0x9499('0x12')][_0x9499('0x13')]===0x1f4){logger[_0x9499('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x123207,_0x261783[_0x9499('0x12')][_0x9499('0x14')]);return _0xf152bd(_0x261783['error']['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x123207,_0x261783[_0x9499('0x12')][_0x9499('0x14')]);return _0x2353bd(_0x261783[_0x9499('0x12')][_0x9499('0x14')]);}else{logger[_0x9499('0xc')](_0x9499('0xd'),_0x123207,_0x9499('0xe'));_0x2353bd(_0x261783[_0x9499('0x15')][_0x9499('0x14')]);}})[_0x9499('0x16')](function(_0x177655){logger[_0x9499('0x12')](_0x9499('0xd'),_0x123207,_0x177655);_0xf152bd(_0x177655);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ff58cc2..440de4e 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 _0xe741=['connect-timeout','express','../../components/auth/service','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','create','put','update','delete','exports','util','path'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xe741,0xce));var _0x1e74=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe741[_0x25e7cb];return _0x375d92;};'use strict';var multer=require('multer');var util=require(_0x1e74('0x0'));var path=require(_0x1e74('0x1'));var timeout=require(_0x1e74('0x2'));var express=require(_0x1e74('0x3'));var router=express['Router']();var auth=require(_0x1e74('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e74('0x5'));router['get']('/',auth[_0x1e74('0x6')](),controller[_0x1e74('0x7')]);router[_0x1e74('0x8')](_0x1e74('0x9'),auth['isAuthenticated'](),controller[_0x1e74('0xa')]);router['get'](_0x1e74('0xb'),auth[_0x1e74('0x6')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x41827e,_0x6885df,_0x117551){_0x117551(null,path['join'](config[_0x1e74('0xc')],_0x1e74('0xd')));},'filename':function(_0x1b6599,_0x26e9a5,_0x162e82){_0x26e9a5[_0x1e74('0xe')]=_0x26e9a5[_0x1e74('0xe')][_0x1e74('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x162e82(null,util[_0x1e74('0x10')](_0x1e74('0x11'),path[_0x1e74('0x12')](_0x26e9a5[_0x1e74('0xe')],path[_0x1e74('0x13')](_0x26e9a5[_0x1e74('0xe')])),Date['now'](),path['extname'](_0x26e9a5['originalname'])));}})});router[_0x1e74('0x14')]('/',upload['single']('file'),controller[_0x1e74('0x15')]);router[_0x1e74('0x16')](_0x1e74('0x9'),auth[_0x1e74('0x6')](),controller[_0x1e74('0x17')]);router[_0x1e74('0x18')](_0x1e74('0x9'),auth['isAuthenticated'](),controller['delete']);module[_0x1e74('0x19')]=router; \ No newline at end of file +var _0x74e0=['create','put','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single'];(function(_0x2d5b33,_0x509dd2){var _0x532074=function(_0x3dcb70){while(--_0x3dcb70){_0x2d5b33['push'](_0x2d5b33['shift']());}};_0x532074(++_0x509dd2);}(_0x74e0,0xad));var _0x074e=function(_0x560663,_0x4f67c1){_0x560663=_0x560663-0x0;var _0x16d667=_0x74e0[_0x560663];return _0x16d667;};'use strict';var multer=require(_0x074e('0x0'));var util=require(_0x074e('0x1'));var path=require(_0x074e('0x2'));var timeout=require(_0x074e('0x3'));var express=require(_0x074e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x074e('0x5'));var config=require(_0x074e('0x6'));var controller=require(_0x074e('0x7'));router[_0x074e('0x8')]('/',auth[_0x074e('0x9')](),controller[_0x074e('0xa')]);router[_0x074e('0x8')]('/:id',auth[_0x074e('0x9')](),controller['show']);router[_0x074e('0x8')]('/:id/download',auth[_0x074e('0x9')](),controller[_0x074e('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2bda5b,_0x310a52,_0x4d0ea4){_0x4d0ea4(null,path[_0x074e('0xc')](config[_0x074e('0xd')],_0x074e('0xe')));},'filename':function(_0x45a5f2,_0x583929,_0x5093a1){_0x583929[_0x074e('0xf')]=_0x583929['originalname'][_0x074e('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5093a1(null,util[_0x074e('0x11')](_0x074e('0x12'),path[_0x074e('0x13')](_0x583929[_0x074e('0xf')],path[_0x074e('0x14')](_0x583929[_0x074e('0xf')])),Date[_0x074e('0x15')](),path['extname'](_0x583929[_0x074e('0xf')])));}})});router['post']('/',upload[_0x074e('0x16')]('file'),controller[_0x074e('0x17')]);router[_0x074e('0x18')]('/:id',auth[_0x074e('0x9')](),controller['update']);router[_0x074e('0x19')](_0x074e('0x1a'),auth[_0x074e('0x9')](),controller[_0x074e('0x19')]);module[_0x074e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 79b6010..1ec22c6 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 _0x2d9a=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x2d9a,0x1ef));var _0xa2d9=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x2d9a[_0x3b2369];return _0x5a1367;};'use strict';var Sequelize=require(_0xa2d9('0x0'));module[_0xa2d9('0x1')]={'name':{'type':Sequelize[_0xa2d9('0x2')],'unique':_0xa2d9('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa2d9('0x2')]},'display_name':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xa2d9('0x2')]},'original_format':{'type':Sequelize[_0xa2d9('0x2')]},'original_duration':{'type':Sequelize[_0xa2d9('0x4')]},'original_sampleCount':{'type':Sequelize[_0xa2d9('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xa2d9('0x5')]},'original_sampleRate':{'type':Sequelize[_0xa2d9('0x6')]},'converted_format':{'type':Sequelize[_0xa2d9('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xa2d9('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xa2d9('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x433a=['STRING','FLOAT','INTEGER','BIGINT','sequelize','name'];(function(_0xe9d880,_0x2c1ef0){var _0x186188=function(_0x312ec0){while(--_0x312ec0){_0xe9d880['push'](_0xe9d880['shift']());}};_0x186188(++_0x2c1ef0);}(_0x433a,0x70));var _0xa433=function(_0x6b027f,_0xd71753){_0x6b027f=_0x6b027f-0x0;var _0x32aa26=_0x433a[_0x6b027f];return _0x32aa26;};'use strict';var Sequelize=require(_0xa433('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa433('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa433('0x2')]},'display_name':{'type':Sequelize[_0xa433('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xa433('0x2')]},'original_format':{'type':Sequelize[_0xa433('0x2')]},'original_duration':{'type':Sequelize[_0xa433('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa433('0x4')]},'original_bitRate':{'type':Sequelize[_0xa433('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xa433('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xa433('0x5')]},'converted_channelCount':{'type':Sequelize[_0xa433('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xa433('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 3599466..5a267ef 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 _0x7d06=['converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','end','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','update','then','destroy','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','download','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','create','originalname','file','basename','extname','filename','substring','wav','server/files/sounds/original','format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','error','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount'];(function(_0x355045,_0x2622ad){var _0x348a47=function(_0xffa16b){while(--_0xffa16b){_0x355045['push'](_0x355045['shift']());}};_0x348a47(++_0x2622ad);}(_0x7d06,0x108));var _0x67d0=function(_0x4f6e75,_0x1539ba){_0x4f6e75=_0x4f6e75-0x0;var _0x21ea91=_0x7d06[_0x4f6e75];return _0x21ea91;};'use strict';var pdf=require(_0x67d0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x67d0('0x1'));var zipdir=require(_0x67d0('0x2'));var jsonpatch=require(_0x67d0('0x3'));var rp=require(_0x67d0('0x4'));var moment=require(_0x67d0('0x5'));var BPromise=require(_0x67d0('0x6'));var Mustache=require(_0x67d0('0x7'));var util=require('util');var path=require(_0x67d0('0x8'));var sox=require(_0x67d0('0x9'));var csv=require('to-csv');var ejs=require(_0x67d0('0xa'));var fs=require('fs');var _=require(_0x67d0('0xb'));var squel=require(_0x67d0('0xc'));var crypto=require(_0x67d0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x67d0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x67d0('0xf'));var authService=require(_0x67d0('0x10'));var qs=require(_0x67d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x67d0('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x67d0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee744e,_0x23c404){_0x23c404=_0x23c404||0xcc;return function(_0x4cbe2b){if(_0x4cbe2b){return _0xee744e[_0x67d0('0x14')](_0x23c404);}return _0xee744e[_0x67d0('0x15')](_0x23c404)['end']();};}function respondWithResult(_0x1518c0,_0x515541){_0x515541=_0x515541||0xc8;return function(_0x78df00){if(_0x78df00){return _0x1518c0['status'](_0x515541)[_0x67d0('0x16')](_0x78df00);}};}function respondWithFilteredResult(_0x153aad,_0x23686d){return function(_0x4f7437){if(_0x4f7437){var _0x1b6a19=_0x4f7437[_0x67d0('0x17')],_0x51b0ec=_0x23686d[_0x67d0('0x18')],_0x4d1edf=_0x23686d[_0x67d0('0x18')]+_0x23686d[_0x67d0('0x19')],_0x103886;if(_0x4d1edf>=_0x1b6a19){_0x4d1edf=_0x1b6a19;_0x103886=0xc8;}else{_0x103886=0xce;}_0x153aad[_0x67d0('0x15')](_0x103886);return _0x153aad[_0x67d0('0x1a')](_0x67d0('0x1b'),_0x51b0ec+'-'+_0x4d1edf+'/'+_0x1b6a19)[_0x67d0('0x16')](_0x4f7437);}return null;};}function patchUpdates(_0x2e068b){return function(_0x3d259f){try{jsonpatch['apply'](_0x3d259f,_0x2e068b,!![]);}catch(_0x5bfeeb){return BPromise['reject'](_0x5bfeeb);}return _0x3d259f['save']();};}function saveUpdates(_0x59b271,_0x3032db){return function(_0x55f8ab){if(_0x55f8ab){return _0x55f8ab[_0x67d0('0x1c')](_0x59b271)[_0x67d0('0x1d')](function(_0x909ccc){return _0x909ccc;});}return null;};}function removeEntity(_0x4a1d5c,_0x340989){return function(_0x23c89a){if(_0x23c89a){return _0x23c89a[_0x67d0('0x1e')]()[_0x67d0('0x1d')](function(){var _0x946518=_0x23c89a['get']({'plain':!![]});var _0x3516fe=_0x67d0('0x1f');return db[_0x67d0('0x20')][_0x67d0('0x1e')]({'where':{'type':_0x3516fe,'resourceId':_0x946518['id']}})['then'](function(){return _0x23c89a;});})[_0x67d0('0x1d')](function(){_0x4a1d5c[_0x67d0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281dd3,_0x1fe22e){return function(_0x3d0fab){if(!_0x3d0fab){_0x281dd3[_0x67d0('0x14')](0x194);}return _0x3d0fab;};}function handleError(_0x5b8775,_0x28b3d4){_0x28b3d4=_0x28b3d4||0x1f4;return function(_0x414003){logger['error'](_0x414003[_0x67d0('0x21')]);if(_0x414003[_0x67d0('0x22')]){delete _0x414003[_0x67d0('0x22')];}_0x5b8775['status'](_0x28b3d4)[_0x67d0('0x23')](_0x414003);};}exports[_0x67d0('0x24')]=function(_0x3d1f27,_0x354d14){var _0x11ae61={},_0x5b1541={},_0x5e0d30={'count':0x0,'rows':[]};var _0x594ef3=_[_0x67d0('0x25')](db[_0x67d0('0x26')][_0x67d0('0x27')],function(_0x3d121b){return{'name':_0x3d121b[_0x67d0('0x28')],'type':_0x3d121b['type'][_0x67d0('0x29')]};});_0x5b1541[_0x67d0('0x2a')]=_['map'](_0x594ef3,_0x67d0('0x22'));_0x5b1541['query']=_[_0x67d0('0x2b')](_0x3d1f27[_0x67d0('0x2c')]);_0x5b1541[_0x67d0('0x2d')]=_[_0x67d0('0x2e')](_0x5b1541[_0x67d0('0x2a')],_0x5b1541[_0x67d0('0x2c')]);_0x11ae61[_0x67d0('0x2f')]=_['intersection'](_0x5b1541['model'],qs['fields'](_0x3d1f27[_0x67d0('0x2c')][_0x67d0('0x30')]));_0x11ae61['attributes']=_0x11ae61[_0x67d0('0x2f')][_0x67d0('0x31')]?_0x11ae61[_0x67d0('0x2f')]:_0x5b1541[_0x67d0('0x2a')];if(!_0x3d1f27[_0x67d0('0x2c')][_0x67d0('0x32')]('nolimit')){_0x11ae61['limit']=qs[_0x67d0('0x19')](_0x3d1f27[_0x67d0('0x2c')]['limit']);_0x11ae61[_0x67d0('0x18')]=qs[_0x67d0('0x18')](_0x3d1f27[_0x67d0('0x2c')][_0x67d0('0x18')]);}_0x11ae61[_0x67d0('0x33')]=qs['sort'](_0x3d1f27[_0x67d0('0x2c')][_0x67d0('0x34')]);_0x11ae61[_0x67d0('0x35')]=qs[_0x67d0('0x2d')](_[_0x67d0('0x36')](_0x3d1f27[_0x67d0('0x2c')],_0x5b1541['filters']));if(_0x3d1f27[_0x67d0('0x2c')][_0x67d0('0x37')]){_0x11ae61[_0x67d0('0x35')]=_[_0x67d0('0x38')](_0x11ae61[_0x67d0('0x35')],{'$or':_[_0x67d0('0x25')](_0x594ef3,function(_0x2d06dc){if(_0x2d06dc[_0x67d0('0x39')]!==_0x67d0('0x3a')){var _0x2b087f={};_0x2b087f[_0x2d06dc[_0x67d0('0x22')]]={'$like':'%'+_0x3d1f27['query'][_0x67d0('0x37')]+'%'};return _0x2b087f;}})});}_0x11ae61=_[_0x67d0('0x38')]({},_0x11ae61,_0x3d1f27[_0x67d0('0x3b')]);var _0x27b761={'where':_0x11ae61['where']};return db[_0x67d0('0x26')][_0x67d0('0x17')](_0x27b761)[_0x67d0('0x1d')](function(_0x5ad1bd){_0x5e0d30[_0x67d0('0x17')]=_0x5ad1bd;if(_0x3d1f27[_0x67d0('0x2c')][_0x67d0('0x3c')]){_0x11ae61[_0x67d0('0x3d')]=[{'all':!![]}];}return db[_0x67d0('0x26')]['findAll'](_0x11ae61);})['then'](function(_0x4e50c5){_0x5e0d30[_0x67d0('0x3e')]=_0x4e50c5;return _0x5e0d30;})[_0x67d0('0x1d')](respondWithFilteredResult(_0x354d14,_0x11ae61))[_0x67d0('0x3f')](handleError(_0x354d14,null));};exports[_0x67d0('0x40')]=function(_0x364ef9,_0x288a97){var _0x1de2b2={'raw':!![],'where':{'id':_0x364ef9['params']['id']}},_0x3f166e={};_0x3f166e[_0x67d0('0x2a')]=_[_0x67d0('0x2b')](db['Sound']['rawAttributes']);_0x3f166e[_0x67d0('0x2c')]=_['keys'](_0x364ef9['query']);_0x3f166e[_0x67d0('0x2d')]=_[_0x67d0('0x2e')](_0x3f166e[_0x67d0('0x2a')],_0x3f166e[_0x67d0('0x2c')]);_0x1de2b2[_0x67d0('0x2f')]=_[_0x67d0('0x2e')](_0x3f166e['model'],qs[_0x67d0('0x30')](_0x364ef9[_0x67d0('0x2c')]['fields']));_0x1de2b2['attributes']=_0x1de2b2[_0x67d0('0x2f')][_0x67d0('0x31')]?_0x1de2b2['attributes']:_0x3f166e[_0x67d0('0x2a')];if(_0x364ef9[_0x67d0('0x2c')]['includeAll']){_0x1de2b2[_0x67d0('0x3d')]=[{'all':!![]}];}_0x1de2b2=_[_0x67d0('0x38')]({},_0x1de2b2,_0x364ef9[_0x67d0('0x3b')]);return db[_0x67d0('0x26')]['find'](_0x1de2b2)[_0x67d0('0x1d')](handleEntityNotFound(_0x288a97,null))[_0x67d0('0x1d')](respondWithResult(_0x288a97,null))[_0x67d0('0x3f')](handleError(_0x288a97,null));};exports[_0x67d0('0x41')]=function(_0xe9d42d,_0x522e1f,_0x176880){return db[_0x67d0('0x26')]['find']({'where':{'id':_0xe9d42d[_0x67d0('0x42')]['id']},'attributes':[_0x67d0('0x22'),_0x67d0('0x43'),_0x67d0('0x44')],'raw':!![]})[_0x67d0('0x1d')](handleEntityNotFound(_0x522e1f,null))[_0x67d0('0x1d')](function(_0x1af42a){if(_0x1af42a){if(!fs[_0x67d0('0x45')](path[_0x67d0('0x46')](config[_0x67d0('0x47')],_0x67d0('0x48'),_0x1af42a[_0x67d0('0x43')]+'.'+_0x1af42a['converted_format']))){throw new db[(_0x67d0('0x49'))][(_0x67d0('0x4a'))](_0x67d0('0x4b'));}return _0x522e1f[_0x67d0('0x41')](path[_0x67d0('0x46')](config[_0x67d0('0x47')],'server/files/sounds/converted',util['format'](_0x67d0('0x4c'),_0x1af42a[_0x67d0('0x43')],_0x1af42a[_0x67d0('0x44')])),util['format']('%s.%s',_0x1af42a['name'],_0x1af42a[_0x67d0('0x44')]));}return null;})['catch'](handleError(_0x522e1f,null));};exports[_0x67d0('0x4d')]=function(_0x18fa7d,_0x1b20f7,_0x41fdd5){var _0x4a38f6={'name':path['basename'](_0x18fa7d['file'][_0x67d0('0x4e')],path['extname'](_0x18fa7d[_0x67d0('0x4f')][_0x67d0('0x4e')])),'save_name':path[_0x67d0('0x50')](_0x18fa7d[_0x67d0('0x4f')]['filename'],path[_0x67d0('0x51')](_0x18fa7d[_0x67d0('0x4f')][_0x67d0('0x52')])),'original_format':path[_0x67d0('0x51')](_0x18fa7d[_0x67d0('0x4f')][_0x67d0('0x4e')])[_0x67d0('0x53')](0x1),'converted_format':_0x67d0('0x54')};var _0x25d94f=path['join'](config[_0x67d0('0x47')],_0x67d0('0x55'),_0x18fa7d[_0x67d0('0x4f')]['filename']);var _0x5bc976=path[_0x67d0('0x46')](config[_0x67d0('0x47')],_0x67d0('0x48'),util[_0x67d0('0x56')](_0x67d0('0x4c'),path[_0x67d0('0x50')](_0x18fa7d['file'][_0x67d0('0x52')],path[_0x67d0('0x51')](_0x18fa7d['file']['filename'])),_0x4a38f6[_0x67d0('0x44')]));logger[_0x67d0('0x57')](_0x67d0('0x58'),_0x25d94f);logger['info'](_0x67d0('0x59'),_0x5bc976);try{fs['chmodSync'](_0x25d94f,parseInt(_0x67d0('0x5a'),0x8));var _0x9c0dcf=sox['transcode'](_0x25d94f,_0x5bc976,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x9c0dcf['on'](_0x67d0('0x5b'),function(_0x41135d){fs[_0x67d0('0x5c')](_0x25d94f);_0x1b20f7[_0x67d0('0x15')](0x1f4)['send'](_0x41135d);});_0x9c0dcf['on'](_0x67d0('0x5d'),function(_0x15dd11){_0x4a38f6['original_duration']=isNaN(_0x15dd11[_0x67d0('0x5e')])?null:_0x15dd11['duration']*0x3e8;_0x4a38f6[_0x67d0('0x5f')]=isNaN(_0x15dd11[_0x67d0('0x60')])?null:_0x15dd11[_0x67d0('0x60')];_0x4a38f6[_0x67d0('0x61')]=isNaN(_0x15dd11[_0x67d0('0x62')])?null:_0x15dd11[_0x67d0('0x62')];_0x4a38f6[_0x67d0('0x63')]=isNaN(_0x15dd11['bitRate'])?null:_0x15dd11['bitRate'];_0x4a38f6[_0x67d0('0x64')]=isNaN(_0x15dd11['sampleRate'])?null:_0x15dd11[_0x67d0('0x65')];});_0x9c0dcf['on'](_0x67d0('0x66'),function(_0x2ac33c){_0x4a38f6[_0x67d0('0x67')]=isNaN(_0x2ac33c['duration'])?null:_0x2ac33c['duration']*0x3e8;_0x4a38f6[_0x67d0('0x68')]=isNaN(_0x2ac33c[_0x67d0('0x60')])?null:_0x2ac33c[_0x67d0('0x60')];_0x4a38f6[_0x67d0('0x69')]=isNaN(_0x2ac33c[_0x67d0('0x62')])?null:_0x2ac33c[_0x67d0('0x62')];_0x4a38f6[_0x67d0('0x6a')]=isNaN(_0x2ac33c[_0x67d0('0x6b')])?null:_0x2ac33c['bitRate'];_0x4a38f6[_0x67d0('0x6c')]=isNaN(_0x2ac33c['sampleRate'])?null:_0x2ac33c[_0x67d0('0x65')];});_0x9c0dcf['on']('end',function(){fs[_0x67d0('0x6d')](_0x5bc976,parseInt(_0x67d0('0x5a'),0x8));return db[_0x67d0('0x26')]['create'](_0x4a38f6)[_0x67d0('0x1d')](function(_0x260f38){var _0x453258={'role':_0x18fa7d[_0x67d0('0x6e')][_0x67d0('0x6f')],'userProfileId':_0x18fa7d[_0x67d0('0x6e')]['userProfileId']};if(!_0x453258)throw new Error(_0x67d0('0x70'));if(_0x453258['role']===_0x67d0('0x71')){var _0x144518=_0x260f38[_0x67d0('0x72')]({'plain':!![]});return db[_0x67d0('0x73')][_0x67d0('0x74')]({'where':{'name':_0x67d0('0x1f'),'userProfileId':_0x453258['userProfileId']},'raw':!![]})['then'](function(_0x51bc9f){if(_0x51bc9f&&_0x51bc9f[_0x67d0('0x75')]===0x0){return db['UserProfileResource'][_0x67d0('0x4d')]({'name':_0x144518['name'],'resourceId':_0x144518['id'],'type':_0x51bc9f[_0x67d0('0x22')],'sectionId':_0x51bc9f['id']},{})[_0x67d0('0x1d')](function(){return _0x260f38;});}else{return _0x260f38;}})[_0x67d0('0x3f')](function(_0x2ff754){logger['error'](_0x67d0('0x76'),_0x2ff754);throw _0x2ff754;});}return _0x260f38;})['then'](respondWithResult(_0x1b20f7,null))['catch'](handleError(_0x1b20f7,null));});_0x9c0dcf[_0x67d0('0x77')]();}catch(_0x265d7e){_0x1b20f7[_0x67d0('0x15')](0x1f4)['send'](_0x265d7e);}};exports[_0x67d0('0x1c')]=function(_0x487807,_0x1aa453,_0x373478){return db['Sound'][_0x67d0('0x74')]({'where':{'id':_0x487807[_0x67d0('0x42')]['id']}})['then'](handleEntityNotFound(_0x1aa453,null))[_0x67d0('0x1d')](saveUpdates(_[_0x67d0('0x36')](_0x487807['body'],[_0x67d0('0x22'),_0x67d0('0x78')]),null))[_0x67d0('0x1d')](respondWithResult(_0x1aa453,null))['catch'](handleError(_0x1aa453,null));};exports[_0x67d0('0x79')]=function(_0x22a6ba,_0x57df57,_0xeafbbe){return db['Sound'][_0x67d0('0x74')]({'where':{'id':_0x22a6ba[_0x67d0('0x42')]['id']}})['then'](function(_0x4afad2){if(_0x4afad2){return _0x4afad2[_0x67d0('0x1e')]();}})[_0x67d0('0x1d')](function(_0xd962bb){var _0x2b2df6=path[_0x67d0('0x46')](config[_0x67d0('0x47')],_0x67d0('0x55'),util[_0x67d0('0x56')](_0x67d0('0x4c'),_0xd962bb[_0x67d0('0x43')],_0xd962bb['original_format']));var _0x3e48b8=path['join'](config[_0x67d0('0x47')],_0x67d0('0x48'),util[_0x67d0('0x56')](_0x67d0('0x4c'),_0xd962bb['save_name'],_0xd962bb[_0x67d0('0x44')]));fs[_0x67d0('0x5c')](_0x2b2df6);fs[_0x67d0('0x5c')](_0x3e48b8);return _0xd962bb;})[_0x67d0('0x1d')](function(_0x1ab35c){if(_0x1ab35c){return _0x57df57[_0x67d0('0x15')](0xcc)[_0x67d0('0x7a')]();}})[_0x67d0('0x1d')](handleEntityNotFound(_0x57df57,null))[_0x67d0('0x3f')](handleError(_0x57df57,null));}; \ No newline at end of file +var _0x0b2e=['json','offset','limit','set','save','then','destroy','Sounds','UserProfileResource','error','name','send','index','Sound','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','save_name','existsSync','join','root','converted_format','Sequelize','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','wav','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','body','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0xe978af,_0x588c49){var _0x5c3a91=function(_0x256334){while(--_0x256334){_0xe978af['push'](_0xe978af['shift']());}};_0x5c3a91(++_0x588c49);}(_0x0b2e,0x1d2));var _0xe0b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b2e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe0b2('0x0'));var rimraf=require(_0xe0b2('0x1'));var zipdir=require(_0xe0b2('0x2'));var jsonpatch=require(_0xe0b2('0x3'));var rp=require('request-promise');var moment=require(_0xe0b2('0x4'));var BPromise=require(_0xe0b2('0x5'));var Mustache=require(_0xe0b2('0x6'));var util=require(_0xe0b2('0x7'));var path=require('path');var sox=require(_0xe0b2('0x8'));var csv=require(_0xe0b2('0x9'));var ejs=require(_0xe0b2('0xa'));var fs=require('fs');var _=require(_0xe0b2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe0b2('0x9'));var querystring=require(_0xe0b2('0xd'));var Papa=require(_0xe0b2('0xe'));var Redis=require('ioredis');var authService=require(_0xe0b2('0xf'));var qs=require(_0xe0b2('0x10'));var as=require(_0xe0b2('0x11'));var hardwareService=require(_0xe0b2('0x12'));var logger=require('../../config/logger')(_0xe0b2('0x13'));var utils=require(_0xe0b2('0x14'));var config=require(_0xe0b2('0x15'));var db=require(_0xe0b2('0x16'))['db'];function respondWithStatusCode(_0xc5b2c4,_0x50a4da){_0x50a4da=_0x50a4da||0xcc;return function(_0x31cdbf){if(_0x31cdbf){return _0xc5b2c4[_0xe0b2('0x17')](_0x50a4da);}return _0xc5b2c4[_0xe0b2('0x18')](_0x50a4da)[_0xe0b2('0x19')]();};}function respondWithResult(_0x344bfb,_0x12a634){_0x12a634=_0x12a634||0xc8;return function(_0x6f9b8c){if(_0x6f9b8c){return _0x344bfb[_0xe0b2('0x18')](_0x12a634)[_0xe0b2('0x1a')](_0x6f9b8c);}};}function respondWithFilteredResult(_0x2c0993,_0x4c5a3d){return function(_0x5238a4){if(_0x5238a4){var _0x35db1b=_0x5238a4['count'],_0x456530=_0x4c5a3d[_0xe0b2('0x1b')],_0x303b10=_0x4c5a3d[_0xe0b2('0x1b')]+_0x4c5a3d[_0xe0b2('0x1c')],_0x2a4df8;if(_0x303b10>=_0x35db1b){_0x303b10=_0x35db1b;_0x2a4df8=0xc8;}else{_0x2a4df8=0xce;}_0x2c0993['status'](_0x2a4df8);return _0x2c0993[_0xe0b2('0x1d')]('Content-Range',_0x456530+'-'+_0x303b10+'/'+_0x35db1b)['json'](_0x5238a4);}return null;};}function patchUpdates(_0x21a76d){return function(_0xa560d5){try{jsonpatch['apply'](_0xa560d5,_0x21a76d,!![]);}catch(_0x35aded){return BPromise['reject'](_0x35aded);}return _0xa560d5[_0xe0b2('0x1e')]();};}function saveUpdates(_0x2be617,_0x2664a4){return function(_0xabba02){if(_0xabba02){return _0xabba02['update'](_0x2be617)[_0xe0b2('0x1f')](function(_0x118b1e){return _0x118b1e;});}return null;};}function removeEntity(_0x15d52a,_0x18d94a){return function(_0x15a5c4){if(_0x15a5c4){return _0x15a5c4[_0xe0b2('0x20')]()[_0xe0b2('0x1f')](function(){var _0x409184=_0x15a5c4['get']({'plain':!![]});var _0x13224c=_0xe0b2('0x21');return db[_0xe0b2('0x22')]['destroy']({'where':{'type':_0x13224c,'resourceId':_0x409184['id']}})[_0xe0b2('0x1f')](function(){return _0x15a5c4;});})[_0xe0b2('0x1f')](function(){_0x15d52a['status'](0xcc)[_0xe0b2('0x19')]();});}};}function handleEntityNotFound(_0x516780,_0x4f8920){return function(_0x584cd4){if(!_0x584cd4){_0x516780[_0xe0b2('0x17')](0x194);}return _0x584cd4;};}function handleError(_0x53c5f1,_0x4de64b){_0x4de64b=_0x4de64b||0x1f4;return function(_0x1a15eb){logger[_0xe0b2('0x23')](_0x1a15eb['stack']);if(_0x1a15eb[_0xe0b2('0x24')]){delete _0x1a15eb[_0xe0b2('0x24')];}_0x53c5f1[_0xe0b2('0x18')](_0x4de64b)[_0xe0b2('0x25')](_0x1a15eb);};}exports[_0xe0b2('0x26')]=function(_0x44de12,_0x3a0bda){var _0x4077ec={},_0x24763a={},_0x1bcfe6={'count':0x0,'rows':[]};var _0x5a4e94=_['map'](db[_0xe0b2('0x27')][_0xe0b2('0x28')],function(_0x2696d6){return{'name':_0x2696d6[_0xe0b2('0x29')],'type':_0x2696d6['type'][_0xe0b2('0x2a')]};});_0x24763a[_0xe0b2('0x2b')]=_[_0xe0b2('0x2c')](_0x5a4e94,_0xe0b2('0x24'));_0x24763a[_0xe0b2('0x2d')]=_[_0xe0b2('0x2e')](_0x44de12[_0xe0b2('0x2d')]);_0x24763a[_0xe0b2('0x2f')]=_['intersection'](_0x24763a[_0xe0b2('0x2b')],_0x24763a[_0xe0b2('0x2d')]);_0x4077ec[_0xe0b2('0x30')]=_[_0xe0b2('0x31')](_0x24763a['model'],qs['fields'](_0x44de12[_0xe0b2('0x2d')][_0xe0b2('0x32')]));_0x4077ec[_0xe0b2('0x30')]=_0x4077ec['attributes']['length']?_0x4077ec[_0xe0b2('0x30')]:_0x24763a['model'];if(!_0x44de12['query'][_0xe0b2('0x33')](_0xe0b2('0x34'))){_0x4077ec[_0xe0b2('0x1c')]=qs[_0xe0b2('0x1c')](_0x44de12[_0xe0b2('0x2d')][_0xe0b2('0x1c')]);_0x4077ec['offset']=qs[_0xe0b2('0x1b')](_0x44de12[_0xe0b2('0x2d')][_0xe0b2('0x1b')]);}_0x4077ec['order']=qs[_0xe0b2('0x35')](_0x44de12[_0xe0b2('0x2d')][_0xe0b2('0x35')]);_0x4077ec[_0xe0b2('0x36')]=qs[_0xe0b2('0x2f')](_[_0xe0b2('0x37')](_0x44de12[_0xe0b2('0x2d')],_0x24763a['filters']));if(_0x44de12[_0xe0b2('0x2d')][_0xe0b2('0x38')]){_0x4077ec[_0xe0b2('0x36')]=_[_0xe0b2('0x39')](_0x4077ec[_0xe0b2('0x36')],{'$or':_[_0xe0b2('0x2c')](_0x5a4e94,function(_0x2cb4b0){if(_0x2cb4b0[_0xe0b2('0x3a')]!==_0xe0b2('0x3b')){var _0x514756={};_0x514756[_0x2cb4b0['name']]={'$like':'%'+_0x44de12[_0xe0b2('0x2d')]['filter']+'%'};return _0x514756;}})});}_0x4077ec=_[_0xe0b2('0x39')]({},_0x4077ec,_0x44de12['options']);var _0x44b9f3={'where':_0x4077ec['where']};return db['Sound'][_0xe0b2('0x3c')](_0x44b9f3)[_0xe0b2('0x1f')](function(_0x765417){_0x1bcfe6[_0xe0b2('0x3c')]=_0x765417;if(_0x44de12[_0xe0b2('0x2d')][_0xe0b2('0x3d')]){_0x4077ec[_0xe0b2('0x3e')]=[{'all':!![]}];}return db[_0xe0b2('0x27')][_0xe0b2('0x3f')](_0x4077ec);})[_0xe0b2('0x1f')](function(_0x4fea91){_0x1bcfe6[_0xe0b2('0x40')]=_0x4fea91;return _0x1bcfe6;})[_0xe0b2('0x1f')](respondWithFilteredResult(_0x3a0bda,_0x4077ec))[_0xe0b2('0x41')](handleError(_0x3a0bda,null));};exports[_0xe0b2('0x42')]=function(_0x2356f7,_0x44a84a){var _0x4ee0bd={'raw':!![],'where':{'id':_0x2356f7[_0xe0b2('0x43')]['id']}},_0x59c5e6={};_0x59c5e6[_0xe0b2('0x2b')]=_[_0xe0b2('0x2e')](db[_0xe0b2('0x27')][_0xe0b2('0x28')]);_0x59c5e6[_0xe0b2('0x2d')]=_[_0xe0b2('0x2e')](_0x2356f7['query']);_0x59c5e6[_0xe0b2('0x2f')]=_[_0xe0b2('0x31')](_0x59c5e6[_0xe0b2('0x2b')],_0x59c5e6['query']);_0x4ee0bd['attributes']=_['intersection'](_0x59c5e6[_0xe0b2('0x2b')],qs[_0xe0b2('0x32')](_0x2356f7[_0xe0b2('0x2d')]['fields']));_0x4ee0bd[_0xe0b2('0x30')]=_0x4ee0bd[_0xe0b2('0x30')]['length']?_0x4ee0bd[_0xe0b2('0x30')]:_0x59c5e6[_0xe0b2('0x2b')];if(_0x2356f7[_0xe0b2('0x2d')]['includeAll']){_0x4ee0bd['include']=[{'all':!![]}];}_0x4ee0bd=_[_0xe0b2('0x39')]({},_0x4ee0bd,_0x2356f7[_0xe0b2('0x44')]);return db[_0xe0b2('0x27')][_0xe0b2('0x45')](_0x4ee0bd)[_0xe0b2('0x1f')](handleEntityNotFound(_0x44a84a,null))[_0xe0b2('0x1f')](respondWithResult(_0x44a84a,null))[_0xe0b2('0x41')](handleError(_0x44a84a,null));};exports['download']=function(_0x479fc9,_0x254e80,_0x419510){return db[_0xe0b2('0x27')][_0xe0b2('0x45')]({'where':{'id':_0x479fc9[_0xe0b2('0x43')]['id']},'attributes':[_0xe0b2('0x24'),_0xe0b2('0x46'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x254e80,null))[_0xe0b2('0x1f')](function(_0x35cf69){if(_0x35cf69){if(!fs[_0xe0b2('0x47')](path[_0xe0b2('0x48')](config[_0xe0b2('0x49')],'server/files/sounds/converted',_0x35cf69[_0xe0b2('0x46')]+'.'+_0x35cf69[_0xe0b2('0x4a')]))){throw new db[(_0xe0b2('0x4b'))]['ValidationError'](_0xe0b2('0x4c'));}return _0x254e80['download'](path[_0xe0b2('0x48')](config[_0xe0b2('0x49')],_0xe0b2('0x4d'),util[_0xe0b2('0x4e')](_0xe0b2('0x4f'),_0x35cf69[_0xe0b2('0x46')],_0x35cf69['converted_format'])),util[_0xe0b2('0x4e')](_0xe0b2('0x4f'),_0x35cf69[_0xe0b2('0x24')],_0x35cf69[_0xe0b2('0x4a')]));}return null;})[_0xe0b2('0x41')](handleError(_0x254e80,null));};exports[_0xe0b2('0x50')]=function(_0x57245a,_0x1d1573,_0x422413){var _0x4c7ab7={'name':path[_0xe0b2('0x51')](_0x57245a[_0xe0b2('0x52')][_0xe0b2('0x53')],path[_0xe0b2('0x54')](_0x57245a[_0xe0b2('0x52')][_0xe0b2('0x53')])),'save_name':path[_0xe0b2('0x51')](_0x57245a[_0xe0b2('0x52')][_0xe0b2('0x55')],path['extname'](_0x57245a['file']['filename'])),'original_format':path[_0xe0b2('0x54')](_0x57245a['file'][_0xe0b2('0x53')])[_0xe0b2('0x56')](0x1),'converted_format':'wav'};var _0x58dbdf=path[_0xe0b2('0x48')](config['root'],_0xe0b2('0x57'),_0x57245a[_0xe0b2('0x52')][_0xe0b2('0x55')]);var _0x14495e=path[_0xe0b2('0x48')](config[_0xe0b2('0x49')],_0xe0b2('0x4d'),util[_0xe0b2('0x4e')](_0xe0b2('0x4f'),path['basename'](_0x57245a[_0xe0b2('0x52')][_0xe0b2('0x55')],path[_0xe0b2('0x54')](_0x57245a[_0xe0b2('0x52')]['filename'])),_0x4c7ab7[_0xe0b2('0x4a')]));logger[_0xe0b2('0x58')](_0xe0b2('0x59'),_0x58dbdf);logger[_0xe0b2('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x14495e);try{fs['chmodSync'](_0x58dbdf,parseInt(_0xe0b2('0x5a'),0x8));var _0x36c70e=sox[_0xe0b2('0x5b')](_0x58dbdf,_0x14495e,{'sampleRate':0x1f40,'format':_0xe0b2('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36c70e['on'](_0xe0b2('0x23'),function(_0x1294bd){fs['unlinkSync'](_0x58dbdf);_0x1d1573[_0xe0b2('0x18')](0x1f4)[_0xe0b2('0x25')](_0x1294bd);});_0x36c70e['on'](_0xe0b2('0x5d'),function(_0x23ca74){_0x4c7ab7['original_duration']=isNaN(_0x23ca74[_0xe0b2('0x5e')])?null:_0x23ca74[_0xe0b2('0x5e')]*0x3e8;_0x4c7ab7[_0xe0b2('0x5f')]=isNaN(_0x23ca74[_0xe0b2('0x60')])?null:_0x23ca74[_0xe0b2('0x60')];_0x4c7ab7[_0xe0b2('0x61')]=isNaN(_0x23ca74[_0xe0b2('0x62')])?null:_0x23ca74['channelCount'];_0x4c7ab7[_0xe0b2('0x63')]=isNaN(_0x23ca74[_0xe0b2('0x64')])?null:_0x23ca74[_0xe0b2('0x64')];_0x4c7ab7[_0xe0b2('0x65')]=isNaN(_0x23ca74[_0xe0b2('0x66')])?null:_0x23ca74[_0xe0b2('0x66')];});_0x36c70e['on'](_0xe0b2('0x67'),function(_0x3ba9d1){_0x4c7ab7[_0xe0b2('0x68')]=isNaN(_0x3ba9d1[_0xe0b2('0x5e')])?null:_0x3ba9d1[_0xe0b2('0x5e')]*0x3e8;_0x4c7ab7[_0xe0b2('0x69')]=isNaN(_0x3ba9d1[_0xe0b2('0x60')])?null:_0x3ba9d1[_0xe0b2('0x60')];_0x4c7ab7[_0xe0b2('0x6a')]=isNaN(_0x3ba9d1[_0xe0b2('0x62')])?null:_0x3ba9d1[_0xe0b2('0x62')];_0x4c7ab7[_0xe0b2('0x6b')]=isNaN(_0x3ba9d1['bitRate'])?null:_0x3ba9d1[_0xe0b2('0x64')];_0x4c7ab7[_0xe0b2('0x6c')]=isNaN(_0x3ba9d1[_0xe0b2('0x66')])?null:_0x3ba9d1[_0xe0b2('0x66')];});_0x36c70e['on'](_0xe0b2('0x19'),function(){fs[_0xe0b2('0x6d')](_0x14495e,parseInt(_0xe0b2('0x5a'),0x8));return db[_0xe0b2('0x27')][_0xe0b2('0x50')](_0x4c7ab7)['then'](function(_0x339d7c){var _0x467fad={'role':_0x57245a['body']['role'],'userProfileId':_0x57245a['body'][_0xe0b2('0x6e')]};if(!_0x467fad)throw new Error(_0xe0b2('0x6f'));if(_0x467fad['role']===_0xe0b2('0x70')){var _0x22d1c9=_0x339d7c[_0xe0b2('0x71')]({'plain':!![]});return db[_0xe0b2('0x72')][_0xe0b2('0x45')]({'where':{'name':'Sounds','userProfileId':_0x467fad['userProfileId']},'raw':!![]})[_0xe0b2('0x1f')](function(_0xf50ba8){if(_0xf50ba8&&_0xf50ba8[_0xe0b2('0x73')]===0x0){return db[_0xe0b2('0x22')][_0xe0b2('0x50')]({'name':_0x22d1c9[_0xe0b2('0x24')],'resourceId':_0x22d1c9['id'],'type':_0xf50ba8[_0xe0b2('0x24')],'sectionId':_0xf50ba8['id']},{})[_0xe0b2('0x1f')](function(){return _0x339d7c;});}else{return _0x339d7c;}})[_0xe0b2('0x41')](function(_0x5050dc){logger[_0xe0b2('0x23')](_0xe0b2('0x74'),_0x5050dc);throw _0x5050dc;});}return _0x339d7c;})[_0xe0b2('0x1f')](respondWithResult(_0x1d1573,null))['catch'](handleError(_0x1d1573,null));});_0x36c70e[_0xe0b2('0x75')]();}catch(_0xddcd94){_0x1d1573[_0xe0b2('0x18')](0x1f4)['send'](_0xddcd94);}};exports[_0xe0b2('0x76')]=function(_0x50cfe0,_0x1f3237,_0x3092bd){return db[_0xe0b2('0x27')][_0xe0b2('0x45')]({'where':{'id':_0x50cfe0[_0xe0b2('0x43')]['id']}})[_0xe0b2('0x1f')](handleEntityNotFound(_0x1f3237,null))['then'](saveUpdates(_[_0xe0b2('0x37')](_0x50cfe0[_0xe0b2('0x77')],[_0xe0b2('0x24'),_0xe0b2('0x78')]),null))['then'](respondWithResult(_0x1f3237,null))[_0xe0b2('0x41')](handleError(_0x1f3237,null));};exports[_0xe0b2('0x79')]=function(_0x212203,_0x946721,_0x2ab2be){return db[_0xe0b2('0x27')][_0xe0b2('0x45')]({'where':{'id':_0x212203['params']['id']}})['then'](function(_0x276197){if(_0x276197){return _0x276197[_0xe0b2('0x20')]();}})[_0xe0b2('0x1f')](function(_0x10c86e){var _0x32088f=path[_0xe0b2('0x48')](config['root'],'server/files/sounds/original',util[_0xe0b2('0x4e')]('%s.%s',_0x10c86e[_0xe0b2('0x46')],_0x10c86e[_0xe0b2('0x7a')]));var _0x1b2dff=path[_0xe0b2('0x48')](config[_0xe0b2('0x49')],_0xe0b2('0x4d'),util[_0xe0b2('0x4e')]('%s.%s',_0x10c86e['save_name'],_0x10c86e[_0xe0b2('0x4a')]));fs['unlinkSync'](_0x32088f);fs['unlinkSync'](_0x1b2dff);return _0x10c86e;})[_0xe0b2('0x1f')](function(_0x1bf6ae){if(_0x1bf6ae){return _0x946721[_0xe0b2('0x18')](0xcc)[_0xe0b2('0x19')]();}})['then'](handleEntityNotFound(_0x946721,null))['catch'](handleError(_0x946721,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 312d1bb..fc47dd3 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 _0xfc12=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x56c847,_0x4bf64a){var _0x50ae5a=function(_0x35b625){while(--_0x35b625){_0x56c847['push'](_0x56c847['shift']());}};_0x50ae5a(++_0x4bf64a);}(_0xfc12,0xb4));var _0x2fc1=function(_0x47172e,_0x45d243){_0x47172e=_0x47172e-0x0;var _0x37cb9c=_0xfc12[_0x47172e];return _0x37cb9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2fc1('0x0'))(_0x2fc1('0x1'));var moment=require(_0x2fc1('0x2'));var BPromise=require(_0x2fc1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fc1('0x4'));var rimraf=require(_0x2fc1('0x5'));var config=require(_0x2fc1('0x6'));var attributes=require(_0x2fc1('0x7'));module[_0x2fc1('0x8')]=function(_0x5d1758,_0x39be88){return _0x5d1758[_0x2fc1('0x9')](_0x2fc1('0xa'),attributes,{'tableName':_0x2fc1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56bc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Sound','lodash'];(function(_0x54810d,_0x160e82){var _0x105564=function(_0xfb507a){while(--_0xfb507a){_0x54810d['push'](_0x54810d['shift']());}};_0x105564(++_0x160e82);}(_0x56bc,0xa8));var _0xc56b=function(_0x398f98,_0x5e95f7){_0x398f98=_0x398f98-0x0;var _0x8703ea=_0x56bc[_0x398f98];return _0x8703ea;};'use strict';var _=require(_0xc56b('0x0'));var util=require(_0xc56b('0x1'));var logger=require(_0xc56b('0x2'))(_0xc56b('0x3'));var moment=require(_0xc56b('0x4'));var BPromise=require(_0xc56b('0x5'));var rp=require(_0xc56b('0x6'));var fs=require('fs');var path=require(_0xc56b('0x7'));var rimraf=require(_0xc56b('0x8'));var config=require(_0xc56b('0x9'));var attributes=require('./sound.attributes');module[_0xc56b('0xa')]=function(_0x53548c,_0x1f751a){return _0x53548c[_0xc56b('0xb')](_0xc56b('0xc'),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 d91ac54..871d368 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 _0xa5af=['info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x52a5a7,_0x5dcadc){var _0x2b42d5=function(_0x1d29e7){while(--_0x1d29e7){_0x52a5a7['push'](_0x52a5a7['shift']());}};_0x2b42d5(++_0x5dcadc);}(_0xa5af,0x1e3));var _0xfa5a=function(_0xf33cdb,_0x26579b){_0xf33cdb=_0xf33cdb-0x0;var _0x3761e7=_0xa5af[_0xf33cdb];return _0x3761e7;};'use strict';var _=require(_0xfa5a('0x0'));var util=require(_0xfa5a('0x1'));var moment=require('moment');var BPromise=require(_0xfa5a('0x2'));var rs=require(_0xfa5a('0x3'));var fs=require('fs');var Redis=require(_0xfa5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa5a('0x5'));var logger=require(_0xfa5a('0x6'))(_0xfa5a('0x7'));var config=require(_0xfa5a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfa5a('0x9')][_0xfa5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x595862,_0x4304f4,_0x355059){return new BPromise(function(_0x22efb1,_0x354b29){return client['request'](_0x595862,_0x355059)[_0xfa5a('0xb')](function(_0x41bf07){logger[_0xfa5a('0xc')]('Sound,\x20%s,\x20%s',_0x4304f4,_0xfa5a('0xd'));logger[_0xfa5a('0xe')](_0xfa5a('0xf'),_0x4304f4,_0xfa5a('0xd'),JSON[_0xfa5a('0x10')](_0x41bf07));if(_0x41bf07[_0xfa5a('0x11')]){if(_0x41bf07[_0xfa5a('0x11')][_0xfa5a('0x12')]===0x1f4){logger[_0xfa5a('0x11')](_0xfa5a('0x13'),_0x4304f4,_0x41bf07[_0xfa5a('0x11')][_0xfa5a('0x14')]);return _0x354b29(_0x41bf07['error'][_0xfa5a('0x14')]);}logger[_0xfa5a('0x11')](_0xfa5a('0x13'),_0x4304f4,_0x41bf07[_0xfa5a('0x11')][_0xfa5a('0x14')]);return _0x22efb1(_0x41bf07[_0xfa5a('0x11')][_0xfa5a('0x14')]);}else{logger['info'](_0xfa5a('0x13'),_0x4304f4,_0xfa5a('0xd'));_0x22efb1(_0x41bf07[_0xfa5a('0x15')][_0xfa5a('0x14')]);}})['catch'](function(_0x407199){logger[_0xfa5a('0x11')]('Sound,\x20%s,\x20%s',_0x4304f4,_0x407199);_0x354b29(_0x407199);});});}exports[_0xfa5a('0x16')]=function(_0x5a437b){var _0x132576=this;return new Promise(function(_0x192215,_0xcb5aed){return db[_0xfa5a('0x17')][_0xfa5a('0x18')]({'raw':_0x5a437b[_0xfa5a('0x19')]?_0x5a437b['options'][_0xfa5a('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a437b['options']?_0x5a437b[_0xfa5a('0x19')][_0xfa5a('0x1b')]||null:null,'attributes':_0x5a437b[_0xfa5a('0x19')]?_0x5a437b[_0xfa5a('0x19')][_0xfa5a('0x1c')]||null:null,'include':_0x5a437b['options']?_0x5a437b[_0xfa5a('0x19')][_0xfa5a('0x1d')]?_['map'](_0x5a437b['options']['include'],function(_0x9f5202){return{'model':db[_0x9f5202['model']],'as':_0x9f5202['as'],'attributes':_0x9f5202[_0xfa5a('0x1c')],'include':_0x9f5202['include']?_[_0xfa5a('0x1e')](_0x9f5202[_0xfa5a('0x1d')],function(_0xa00b80){return{'model':db[_0xa00b80[_0xfa5a('0x1f')]],'as':_0xa00b80['as'],'attributes':_0xa00b80[_0xfa5a('0x1c')],'include':_0xa00b80[_0xfa5a('0x1d')]?_[_0xfa5a('0x1e')](_0xa00b80['include'],function(_0x4d8e8a){return{'model':db[_0x4d8e8a['model']],'as':_0x4d8e8a['as'],'attributes':_0x4d8e8a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f28c7){logger[_0xfa5a('0xc')]('ShowSound',_0x5a437b);logger[_0xfa5a('0xe')](_0xfa5a('0x16'),_0x5a437b,JSON[_0xfa5a('0x10')](_0x3f28c7));_0x192215(_0x3f28c7);})[_0xfa5a('0x20')](function(_0x2ddba8){logger[_0xfa5a('0x11')]('ShowSound',_0x2ddba8[_0xfa5a('0x14')],_0x5a437b);_0xcb5aed(_0x132576['error'](0x1f4,_0x2ddba8[_0xfa5a('0x14')]));});});}; \ No newline at end of file +var _0x6f9d=['info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Sound','options','raw','where','attributes','include','map','model','ShowSound','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x504bff,_0x5c2f3b){var _0x1428e8=function(_0x5815a9){while(--_0x5815a9){_0x504bff['push'](_0x504bff['shift']());}};_0x1428e8(++_0x5c2f3b);}(_0x6f9d,0x9b));var _0xd6f9=function(_0x108213,_0x2ae76d){_0x108213=_0x108213-0x0;var _0x45f2f0=_0x6f9d[_0x108213];return _0x45f2f0;};'use strict';var _=require(_0xd6f9('0x0'));var util=require(_0xd6f9('0x1'));var moment=require('moment');var BPromise=require(_0xd6f9('0x2'));var rs=require(_0xd6f9('0x3'));var fs=require('fs');var Redis=require(_0xd6f9('0x4'));var db=require(_0xd6f9('0x5'))['db'];var utils=require(_0xd6f9('0x6'));var logger=require(_0xd6f9('0x7'))(_0xd6f9('0x8'));var config=require(_0xd6f9('0x9'));var jayson=require(_0xd6f9('0xa'));var client=jayson[_0xd6f9('0xb')][_0xd6f9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x186ce0,_0x351bbf,_0x59c40f){return new BPromise(function(_0x1fcaa5,_0x5d3521){return client[_0xd6f9('0xd')](_0x186ce0,_0x59c40f)[_0xd6f9('0xe')](function(_0x51ae73){logger[_0xd6f9('0xf')](_0xd6f9('0x10'),_0x351bbf,_0xd6f9('0x11'));logger[_0xd6f9('0x12')](_0xd6f9('0x13'),_0x351bbf,_0xd6f9('0x11'),JSON[_0xd6f9('0x14')](_0x51ae73));if(_0x51ae73['error']){if(_0x51ae73[_0xd6f9('0x15')][_0xd6f9('0x16')]===0x1f4){logger[_0xd6f9('0x15')](_0xd6f9('0x10'),_0x351bbf,_0x51ae73[_0xd6f9('0x15')]['message']);return _0x5d3521(_0x51ae73[_0xd6f9('0x15')]['message']);}logger[_0xd6f9('0x15')](_0xd6f9('0x10'),_0x351bbf,_0x51ae73['error'][_0xd6f9('0x17')]);return _0x1fcaa5(_0x51ae73[_0xd6f9('0x15')][_0xd6f9('0x17')]);}else{logger['info'](_0xd6f9('0x10'),_0x351bbf,_0xd6f9('0x11'));_0x1fcaa5(_0x51ae73['result'][_0xd6f9('0x17')]);}})['catch'](function(_0x267514){logger[_0xd6f9('0x15')]('Sound,\x20%s,\x20%s',_0x351bbf,_0x267514);_0x5d3521(_0x267514);});});}exports['ShowSound']=function(_0x22087c){var _0x1c8e77=this;return new Promise(function(_0x37438b,_0x1a14e4){return db[_0xd6f9('0x18')]['find']({'raw':_0x22087c[_0xd6f9('0x19')]?_0x22087c[_0xd6f9('0x19')][_0xd6f9('0x1a')]===undefined?!![]:![]:!![],'where':_0x22087c[_0xd6f9('0x19')]?_0x22087c['options'][_0xd6f9('0x1b')]||null:null,'attributes':_0x22087c[_0xd6f9('0x19')]?_0x22087c[_0xd6f9('0x19')][_0xd6f9('0x1c')]||null:null,'include':_0x22087c[_0xd6f9('0x19')]?_0x22087c[_0xd6f9('0x19')][_0xd6f9('0x1d')]?_[_0xd6f9('0x1e')](_0x22087c[_0xd6f9('0x19')][_0xd6f9('0x1d')],function(_0x192f4b){return{'model':db[_0x192f4b['model']],'as':_0x192f4b['as'],'attributes':_0x192f4b['attributes'],'include':_0x192f4b[_0xd6f9('0x1d')]?_[_0xd6f9('0x1e')](_0x192f4b[_0xd6f9('0x1d')],function(_0x534b86){return{'model':db[_0x534b86['model']],'as':_0x534b86['as'],'attributes':_0x534b86[_0xd6f9('0x1c')],'include':_0x534b86[_0xd6f9('0x1d')]?_['map'](_0x534b86['include'],function(_0x520af2){return{'model':db[_0x520af2[_0xd6f9('0x1f')]],'as':_0x520af2['as'],'attributes':_0x520af2[_0xd6f9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21ca14){logger[_0xd6f9('0xf')](_0xd6f9('0x20'),_0x22087c);logger[_0xd6f9('0x12')](_0xd6f9('0x20'),_0x22087c,JSON['stringify'](_0x21ca14));_0x37438b(_0x21ca14);})[_0xd6f9('0x21')](function(_0x71597a){logger['error']('ShowSound',_0x71597a[_0xd6f9('0x17')],_0x22087c);_0x1a14e4(_0x1c8e77[_0xd6f9('0x15')](0x1f4,_0x71597a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 2dfbd89..8df36cd 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 _0x9772=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','show','post','isAuthenticated','create','put','/:id'];(function(_0x51ffcf,_0x1f07e1){var _0x189f1b=function(_0x18054c){while(--_0x18054c){_0x51ffcf['push'](_0x51ffcf['shift']());}};_0x189f1b(++_0x1f07e1);}(_0x9772,0x1a8));var _0x2977=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9772[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x2977('0x0'));var util=require(_0x2977('0x1'));var path=require(_0x2977('0x2'));var timeout=require('connect-timeout');var express=require(_0x2977('0x3'));var router=express[_0x2977('0x4')]();var auth=require(_0x2977('0x5'));var interaction=require(_0x2977('0x6'));var config=require(_0x2977('0x7'));var controller=require(_0x2977('0x8'));router[_0x2977('0x9')]('/',auth['isAuthenticated'](),controller[_0x2977('0xa')]);router[_0x2977('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2977('0xb')]);router[_0x2977('0xc')]('/',auth[_0x2977('0xd')](),controller[_0x2977('0xe')]);router[_0x2977('0xf')](_0x2977('0x10'),auth[_0x2977('0xd')](),controller[_0x2977('0x11')]);router[_0x2977('0x12')](_0x2977('0x10'),auth['isAuthenticated'](),controller[_0x2977('0x13')]);module[_0x2977('0x14')]=router; \ No newline at end of file +var _0x7e06=['show','post','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','/:id','isAuthenticated'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x7e06,0x1d1));var _0x67e0=function(_0x2c011f,_0x531877){_0x2c011f=_0x2c011f-0x0;var _0x18767a=_0x7e06[_0x2c011f];return _0x18767a;};'use strict';var multer=require(_0x67e0('0x0'));var util=require(_0x67e0('0x1'));var path=require(_0x67e0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x67e0('0x3')]();var auth=require(_0x67e0('0x4'));var interaction=require(_0x67e0('0x5'));var config=require(_0x67e0('0x6'));var controller=require(_0x67e0('0x7'));router[_0x67e0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x67e0('0x8')](_0x67e0('0x9'),auth[_0x67e0('0xa')](),controller[_0x67e0('0xb')]);router[_0x67e0('0xc')]('/',auth[_0x67e0('0xa')](),controller['create']);router[_0x67e0('0xd')](_0x67e0('0x9'),auth[_0x67e0('0xa')](),controller[_0x67e0('0xe')]);router[_0x67e0('0xf')](_0x67e0('0x9'),auth['isAuthenticated'](),controller[_0x67e0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1113dcf..6735a60 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 _0x502e=['TEXT','medium','ENUM','out','sequelize','STRING'];(function(_0x1d5fb5,_0x2af00e){var _0x317fbe=function(_0xfe09bf){while(--_0xfe09bf){_0x1d5fb5['push'](_0x1d5fb5['shift']());}};_0x317fbe(++_0x2af00e);}(_0x502e,0x12a));var _0xe502=function(_0x27d52d,_0x251471){_0x27d52d=_0x27d52d-0x0;var _0x92035e=_0x502e[_0x27d52d];return _0x92035e;};'use strict';var Sequelize=require(_0xe502('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe502('0x1')]},'body':{'type':Sequelize[_0xe502('0x2')](_0xe502('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe502('0x4')]('in',_0xe502('0x5')),'defaultValue':_0xe502('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xe675=['TEXT','ENUM','out','sequelize','exports'];(function(_0x12de23,_0x15cdf8){var _0x5e8507=function(_0x16fe7e){while(--_0x16fe7e){_0x12de23['push'](_0x12de23['shift']());}};_0x5e8507(++_0x15cdf8);}(_0xe675,0x189));var _0x5e67=function(_0x5d7c7e,_0x234ae6){_0x5d7c7e=_0x5d7c7e-0x0;var _0x330606=_0xe675[_0x5d7c7e];return _0x330606;};'use strict';var Sequelize=require(_0x5e67('0x0'));module[_0x5e67('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x5e67('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x5e67('0x3')]('in',_0x5e67('0x4')),'defaultValue':_0x5e67('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c9f8720..fb2a543 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 _0x49a1=['Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset'];(function(_0x51c4a4,_0x57383a){var _0x393e9a=function(_0x4f5108){while(--_0x4f5108){_0x51c4a4['push'](_0x51c4a4['shift']());}};_0x393e9a(++_0x57383a);}(_0x49a1,0x190));var _0x149a=function(_0x402aa5,_0x198873){_0x402aa5=_0x402aa5-0x0;var _0x5bdaa7=_0x49a1[_0x402aa5];return _0x5bdaa7;};'use strict';var pdf=require(_0x149a('0x0'));var emlformat=require(_0x149a('0x1'));var rimraf=require(_0x149a('0x2'));var zipdir=require(_0x149a('0x3'));var jsonpatch=require(_0x149a('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x149a('0x5'));var util=require(_0x149a('0x6'));var path=require('path');var sox=require(_0x149a('0x7'));var csv=require(_0x149a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x149a('0x9'));var squel=require('squel');var crypto=require(_0x149a('0xa'));var jsforce=require(_0x149a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x149a('0x8'));var querystring=require(_0x149a('0xc'));var Papa=require(_0x149a('0xd'));var Redis=require(_0x149a('0xe'));var authService=require(_0x149a('0xf'));var qs=require(_0x149a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x149a('0x11'))(_0x149a('0x12'));var utils=require(_0x149a('0x13'));var config=require(_0x149a('0x14'));var db=require(_0x149a('0x15'))['db'];function respondWithStatusCode(_0x2f5046,_0x191f29){_0x191f29=_0x191f29||0xcc;return function(_0x4ff4ef){if(_0x4ff4ef){return _0x2f5046['sendStatus'](_0x191f29);}return _0x2f5046[_0x149a('0x16')](_0x191f29)['end']();};}function respondWithResult(_0x2673da,_0x2c2b7b){_0x2c2b7b=_0x2c2b7b||0xc8;return function(_0x28b843){if(_0x28b843){return _0x2673da[_0x149a('0x16')](_0x2c2b7b)[_0x149a('0x17')](_0x28b843);}};}function respondWithFilteredResult(_0x1c721a,_0xe55b75){return function(_0x103990){if(_0x103990){var _0x2b84ae=_0x103990[_0x149a('0x18')],_0x3e7e0b=_0xe55b75[_0x149a('0x19')],_0x4f6467=_0xe55b75[_0x149a('0x19')]+_0xe55b75['limit'],_0x3a6bab;if(_0x4f6467>=_0x2b84ae){_0x4f6467=_0x2b84ae;_0x3a6bab=0xc8;}else{_0x3a6bab=0xce;}_0x1c721a[_0x149a('0x16')](_0x3a6bab);return _0x1c721a['set'](_0x149a('0x1a'),_0x3e7e0b+'-'+_0x4f6467+'/'+_0x2b84ae)['json'](_0x103990);}return null;};}function patchUpdates(_0x17bb32){return function(_0x36107c){try{jsonpatch['apply'](_0x36107c,_0x17bb32,!![]);}catch(_0x2be8c7){return BPromise[_0x149a('0x1b')](_0x2be8c7);}return _0x36107c['save']();};}function saveUpdates(_0x4a7b7b,_0x560e9a){return function(_0x2c8bdc){if(_0x2c8bdc){return _0x2c8bdc[_0x149a('0x1c')](_0x4a7b7b)['then'](function(_0x30253f){return _0x30253f;});}return null;};}function removeEntity(_0x444efd,_0x228c90){return function(_0x3b765d){if(_0x3b765d){return _0x3b765d[_0x149a('0x1d')]()[_0x149a('0x1e')](function(){_0x444efd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd40885,_0x1b7a8c){return function(_0x336cf2){if(!_0x336cf2){_0xd40885[_0x149a('0x1f')](0x194);}return _0x336cf2;};}function handleError(_0xdbb5c1,_0x1d436b){_0x1d436b=_0x1d436b||0x1f4;return function(_0xb74ddb){logger[_0x149a('0x20')](_0xb74ddb[_0x149a('0x21')]);if(_0xb74ddb[_0x149a('0x22')]){delete _0xb74ddb[_0x149a('0x22')];}_0xdbb5c1['status'](_0x1d436b)[_0x149a('0x23')](_0xb74ddb);};}exports[_0x149a('0x24')]=function(_0x53ad37,_0x59eb85){var _0xde50d6={},_0x2c260c={},_0x4635a0={'count':0x0,'rows':[]};var _0x5d6f97=_[_0x149a('0x25')](db[_0x149a('0x26')][_0x149a('0x27')],function(_0xd3457){return{'name':_0xd3457[_0x149a('0x28')],'type':_0xd3457['type'][_0x149a('0x29')]};});_0x2c260c[_0x149a('0x2a')]=_['map'](_0x5d6f97,_0x149a('0x22'));_0x2c260c[_0x149a('0x2b')]=_[_0x149a('0x2c')](_0x53ad37[_0x149a('0x2b')]);_0x2c260c[_0x149a('0x2d')]=_[_0x149a('0x2e')](_0x2c260c['model'],_0x2c260c['query']);_0xde50d6['attributes']=_[_0x149a('0x2e')](_0x2c260c[_0x149a('0x2a')],qs[_0x149a('0x2f')](_0x53ad37['query']['fields']));_0xde50d6['attributes']=_0xde50d6[_0x149a('0x30')][_0x149a('0x31')]?_0xde50d6[_0x149a('0x30')]:_0x2c260c[_0x149a('0x2a')];if(!_0x53ad37[_0x149a('0x2b')][_0x149a('0x32')]('nolimit')){_0xde50d6[_0x149a('0x33')]=qs[_0x149a('0x33')](_0x53ad37['query'][_0x149a('0x33')]);_0xde50d6[_0x149a('0x19')]=qs['offset'](_0x53ad37[_0x149a('0x2b')]['offset']);}_0xde50d6[_0x149a('0x34')]=qs[_0x149a('0x35')](_0x53ad37[_0x149a('0x2b')][_0x149a('0x35')]);_0xde50d6[_0x149a('0x36')]=qs[_0x149a('0x2d')](_[_0x149a('0x37')](_0x53ad37[_0x149a('0x2b')],_0x2c260c[_0x149a('0x2d')]));if(_0x53ad37[_0x149a('0x2b')][_0x149a('0x38')]){_0xde50d6[_0x149a('0x36')]=_[_0x149a('0x39')](_0xde50d6[_0x149a('0x36')],{'$or':_[_0x149a('0x25')](_0x5d6f97,function(_0x249eae){if(_0x249eae[_0x149a('0x3a')]!==_0x149a('0x3b')){var _0x1f550f={};_0x1f550f[_0x249eae['name']]={'$like':'%'+_0x53ad37[_0x149a('0x2b')][_0x149a('0x38')]+'%'};return _0x1f550f;}})});}_0xde50d6=_[_0x149a('0x39')]({},_0xde50d6,_0x53ad37[_0x149a('0x3c')]);var _0xa0441a={'where':_0xde50d6[_0x149a('0x36')]};return db[_0x149a('0x26')][_0x149a('0x18')](_0xa0441a)[_0x149a('0x1e')](function(_0xdbc0f3){_0x4635a0[_0x149a('0x18')]=_0xdbc0f3;if(_0x53ad37[_0x149a('0x2b')][_0x149a('0x3d')]){_0xde50d6['include']=[{'all':!![]}];}return db['SquareMessage'][_0x149a('0x3e')](_0xde50d6);})['then'](function(_0x2a1257){_0x4635a0[_0x149a('0x3f')]=_0x2a1257;return _0x4635a0;})['then'](respondWithFilteredResult(_0x59eb85,_0xde50d6))[_0x149a('0x40')](handleError(_0x59eb85,null));};exports[_0x149a('0x41')]=function(_0x50dbd5,_0x340b01){var _0x4f5344={'raw':!![],'where':{'id':_0x50dbd5[_0x149a('0x42')]['id']}},_0x441866={};_0x441866[_0x149a('0x2a')]=_[_0x149a('0x2c')](db[_0x149a('0x26')][_0x149a('0x27')]);_0x441866[_0x149a('0x2b')]=_[_0x149a('0x2c')](_0x50dbd5[_0x149a('0x2b')]);_0x441866[_0x149a('0x2d')]=_[_0x149a('0x2e')](_0x441866[_0x149a('0x2a')],_0x441866['query']);_0x4f5344['attributes']=_[_0x149a('0x2e')](_0x441866[_0x149a('0x2a')],qs[_0x149a('0x2f')](_0x50dbd5[_0x149a('0x2b')][_0x149a('0x2f')]));_0x4f5344['attributes']=_0x4f5344[_0x149a('0x30')][_0x149a('0x31')]?_0x4f5344[_0x149a('0x30')]:_0x441866[_0x149a('0x2a')];if(_0x50dbd5['query']['includeAll']){_0x4f5344[_0x149a('0x43')]=[{'all':!![]}];}_0x4f5344=_[_0x149a('0x39')]({},_0x4f5344,_0x50dbd5[_0x149a('0x3c')]);return db[_0x149a('0x26')][_0x149a('0x44')](_0x4f5344)['then'](handleEntityNotFound(_0x340b01,null))[_0x149a('0x1e')](respondWithResult(_0x340b01,null))[_0x149a('0x40')](handleError(_0x340b01,null));};exports[_0x149a('0x45')]=function(_0xf22113,_0x276cf9){return db[_0x149a('0x26')][_0x149a('0x45')](_0xf22113[_0x149a('0x46')],{})[_0x149a('0x1e')](respondWithResult(_0x276cf9,0xc9))[_0x149a('0x40')](handleError(_0x276cf9,null));};exports[_0x149a('0x1c')]=function(_0xeece2f,_0x22193e){if(_0xeece2f[_0x149a('0x46')]['id']){delete _0xeece2f[_0x149a('0x46')]['id'];}return db[_0x149a('0x26')][_0x149a('0x44')]({'where':{'id':_0xeece2f[_0x149a('0x42')]['id']}})[_0x149a('0x1e')](handleEntityNotFound(_0x22193e,null))[_0x149a('0x1e')](saveUpdates(_0xeece2f[_0x149a('0x46')],null))[_0x149a('0x1e')](respondWithResult(_0x22193e,null))[_0x149a('0x40')](handleError(_0x22193e,null));};exports['destroy']=function(_0x3f564c,_0x12a83c){return db[_0x149a('0x26')][_0x149a('0x44')]({'where':{'id':_0x3f564c[_0x149a('0x42')]['id']}})[_0x149a('0x1e')](handleEntityNotFound(_0x12a83c,null))['then'](removeEntity(_0x12a83c,null))[_0x149a('0x40')](handleError(_0x12a83c,null));}; \ No newline at end of file +var _0xef82=['keys','rawAttributes','length','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','SquareMessage','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params'];(function(_0x4d9a3b,_0x20f142){var _0x2c68a0=function(_0x1adc9f){while(--_0x1adc9f){_0x4d9a3b['push'](_0x4d9a3b['shift']());}};_0x2c68a0(++_0x20f142);}(_0xef82,0x98));var _0x2ef8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xef82[_0x4a53d];return _0x27410e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2ef8('0x0'));var rimraf=require(_0x2ef8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ef8('0x2'));var BPromise=require(_0x2ef8('0x3'));var Mustache=require(_0x2ef8('0x4'));var util=require(_0x2ef8('0x5'));var path=require('path');var sox=require(_0x2ef8('0x6'));var csv=require(_0x2ef8('0x7'));var ejs=require(_0x2ef8('0x8'));var fs=require('fs');var _=require(_0x2ef8('0x9'));var squel=require(_0x2ef8('0xa'));var crypto=require('crypto');var jsforce=require(_0x2ef8('0xb'));var deskjs=require(_0x2ef8('0xc'));var toCsv=require(_0x2ef8('0x7'));var querystring=require(_0x2ef8('0xd'));var Papa=require(_0x2ef8('0xe'));var Redis=require(_0x2ef8('0xf'));var authService=require(_0x2ef8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2ef8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ef8('0x12'))(_0x2ef8('0x13'));var utils=require(_0x2ef8('0x14'));var config=require(_0x2ef8('0x15'));var db=require(_0x2ef8('0x16'))['db'];function respondWithStatusCode(_0x17ae98,_0xedab2f){_0xedab2f=_0xedab2f||0xcc;return function(_0x17ca04){if(_0x17ca04){return _0x17ae98[_0x2ef8('0x17')](_0xedab2f);}return _0x17ae98[_0x2ef8('0x18')](_0xedab2f)[_0x2ef8('0x19')]();};}function respondWithResult(_0x5e0b3d,_0x45534c){_0x45534c=_0x45534c||0xc8;return function(_0x1b6fe6){if(_0x1b6fe6){return _0x5e0b3d['status'](_0x45534c)[_0x2ef8('0x1a')](_0x1b6fe6);}};}function respondWithFilteredResult(_0x5c8394,_0x170532){return function(_0x259107){if(_0x259107){var _0x24e463=_0x259107[_0x2ef8('0x1b')],_0x3b7908=_0x170532[_0x2ef8('0x1c')],_0x296e86=_0x170532[_0x2ef8('0x1c')]+_0x170532[_0x2ef8('0x1d')],_0x468649;if(_0x296e86>=_0x24e463){_0x296e86=_0x24e463;_0x468649=0xc8;}else{_0x468649=0xce;}_0x5c8394[_0x2ef8('0x18')](_0x468649);return _0x5c8394[_0x2ef8('0x1e')](_0x2ef8('0x1f'),_0x3b7908+'-'+_0x296e86+'/'+_0x24e463)[_0x2ef8('0x1a')](_0x259107);}return null;};}function patchUpdates(_0x45e9f3){return function(_0x914cfe){try{jsonpatch['apply'](_0x914cfe,_0x45e9f3,!![]);}catch(_0xaae576){return BPromise[_0x2ef8('0x20')](_0xaae576);}return _0x914cfe[_0x2ef8('0x21')]();};}function saveUpdates(_0x3161f4,_0x5858ec){return function(_0x452d7d){if(_0x452d7d){return _0x452d7d[_0x2ef8('0x22')](_0x3161f4)[_0x2ef8('0x23')](function(_0x21c6b5){return _0x21c6b5;});}return null;};}function removeEntity(_0x718f3,_0x70712a){return function(_0x5389b7){if(_0x5389b7){return _0x5389b7[_0x2ef8('0x24')]()[_0x2ef8('0x23')](function(){_0x718f3[_0x2ef8('0x18')](0xcc)[_0x2ef8('0x19')]();});}};}function handleEntityNotFound(_0x188489,_0x44b6a0){return function(_0x41bbb1){if(!_0x41bbb1){_0x188489[_0x2ef8('0x17')](0x194);}return _0x41bbb1;};}function handleError(_0x4a93e2,_0x3ccb2a){_0x3ccb2a=_0x3ccb2a||0x1f4;return function(_0x3c2cd3){logger[_0x2ef8('0x25')](_0x3c2cd3['stack']);if(_0x3c2cd3[_0x2ef8('0x26')]){delete _0x3c2cd3[_0x2ef8('0x26')];}_0x4a93e2['status'](_0x3ccb2a)[_0x2ef8('0x27')](_0x3c2cd3);};}exports[_0x2ef8('0x28')]=function(_0x3cf7e,_0x32068f){var _0x9dfdb8={},_0x353478={},_0x4c21af={'count':0x0,'rows':[]};var _0x2f148a=_['map'](db[_0x2ef8('0x29')]['rawAttributes'],function(_0x257754){return{'name':_0x257754[_0x2ef8('0x2a')],'type':_0x257754[_0x2ef8('0x2b')][_0x2ef8('0x2c')]};});_0x353478['model']=_[_0x2ef8('0x2d')](_0x2f148a,_0x2ef8('0x26'));_0x353478[_0x2ef8('0x2e')]=_['keys'](_0x3cf7e['query']);_0x353478['filters']=_[_0x2ef8('0x2f')](_0x353478[_0x2ef8('0x30')],_0x353478[_0x2ef8('0x2e')]);_0x9dfdb8[_0x2ef8('0x31')]=_[_0x2ef8('0x2f')](_0x353478[_0x2ef8('0x30')],qs[_0x2ef8('0x32')](_0x3cf7e['query']['fields']));_0x9dfdb8[_0x2ef8('0x31')]=_0x9dfdb8[_0x2ef8('0x31')]['length']?_0x9dfdb8[_0x2ef8('0x31')]:_0x353478[_0x2ef8('0x30')];if(!_0x3cf7e[_0x2ef8('0x2e')][_0x2ef8('0x33')](_0x2ef8('0x34'))){_0x9dfdb8[_0x2ef8('0x1d')]=qs[_0x2ef8('0x1d')](_0x3cf7e[_0x2ef8('0x2e')][_0x2ef8('0x1d')]);_0x9dfdb8[_0x2ef8('0x1c')]=qs[_0x2ef8('0x1c')](_0x3cf7e['query'][_0x2ef8('0x1c')]);}_0x9dfdb8[_0x2ef8('0x35')]=qs[_0x2ef8('0x36')](_0x3cf7e[_0x2ef8('0x2e')][_0x2ef8('0x36')]);_0x9dfdb8[_0x2ef8('0x37')]=qs[_0x2ef8('0x38')](_[_0x2ef8('0x39')](_0x3cf7e['query'],_0x353478[_0x2ef8('0x38')]));if(_0x3cf7e[_0x2ef8('0x2e')]['filter']){_0x9dfdb8[_0x2ef8('0x37')]=_[_0x2ef8('0x3a')](_0x9dfdb8[_0x2ef8('0x37')],{'$or':_['map'](_0x2f148a,function(_0x2d2afa){if(_0x2d2afa[_0x2ef8('0x2b')]!==_0x2ef8('0x3b')){var _0x4b064d={};_0x4b064d[_0x2d2afa[_0x2ef8('0x26')]]={'$like':'%'+_0x3cf7e[_0x2ef8('0x2e')][_0x2ef8('0x3c')]+'%'};return _0x4b064d;}})});}_0x9dfdb8=_[_0x2ef8('0x3a')]({},_0x9dfdb8,_0x3cf7e['options']);var _0x3e5b43={'where':_0x9dfdb8[_0x2ef8('0x37')]};return db[_0x2ef8('0x29')][_0x2ef8('0x1b')](_0x3e5b43)[_0x2ef8('0x23')](function(_0xf8d58a){_0x4c21af[_0x2ef8('0x1b')]=_0xf8d58a;if(_0x3cf7e['query'][_0x2ef8('0x3d')]){_0x9dfdb8[_0x2ef8('0x3e')]=[{'all':!![]}];}return db[_0x2ef8('0x29')][_0x2ef8('0x3f')](_0x9dfdb8);})[_0x2ef8('0x23')](function(_0x405592){_0x4c21af['rows']=_0x405592;return _0x4c21af;})['then'](respondWithFilteredResult(_0x32068f,_0x9dfdb8))[_0x2ef8('0x40')](handleError(_0x32068f,null));};exports[_0x2ef8('0x41')]=function(_0x48291e,_0x269ab3){var _0x4eab79={'raw':!![],'where':{'id':_0x48291e[_0x2ef8('0x42')]['id']}},_0x5f1ca2={};_0x5f1ca2[_0x2ef8('0x30')]=_[_0x2ef8('0x43')](db['SquareMessage'][_0x2ef8('0x44')]);_0x5f1ca2[_0x2ef8('0x2e')]=_['keys'](_0x48291e[_0x2ef8('0x2e')]);_0x5f1ca2[_0x2ef8('0x38')]=_[_0x2ef8('0x2f')](_0x5f1ca2[_0x2ef8('0x30')],_0x5f1ca2['query']);_0x4eab79[_0x2ef8('0x31')]=_[_0x2ef8('0x2f')](_0x5f1ca2['model'],qs[_0x2ef8('0x32')](_0x48291e['query'][_0x2ef8('0x32')]));_0x4eab79[_0x2ef8('0x31')]=_0x4eab79[_0x2ef8('0x31')][_0x2ef8('0x45')]?_0x4eab79[_0x2ef8('0x31')]:_0x5f1ca2[_0x2ef8('0x30')];if(_0x48291e[_0x2ef8('0x2e')][_0x2ef8('0x3d')]){_0x4eab79[_0x2ef8('0x3e')]=[{'all':!![]}];}_0x4eab79=_['merge']({},_0x4eab79,_0x48291e['options']);return db[_0x2ef8('0x29')][_0x2ef8('0x46')](_0x4eab79)[_0x2ef8('0x23')](handleEntityNotFound(_0x269ab3,null))[_0x2ef8('0x23')](respondWithResult(_0x269ab3,null))[_0x2ef8('0x40')](handleError(_0x269ab3,null));};exports[_0x2ef8('0x47')]=function(_0x555d3d,_0x28d190){return db[_0x2ef8('0x29')][_0x2ef8('0x47')](_0x555d3d['body'],{})[_0x2ef8('0x23')](respondWithResult(_0x28d190,0xc9))[_0x2ef8('0x40')](handleError(_0x28d190,null));};exports[_0x2ef8('0x22')]=function(_0x2c3dd9,_0x49eed5){if(_0x2c3dd9['body']['id']){delete _0x2c3dd9[_0x2ef8('0x48')]['id'];}return db[_0x2ef8('0x29')][_0x2ef8('0x46')]({'where':{'id':_0x2c3dd9[_0x2ef8('0x42')]['id']}})[_0x2ef8('0x23')](handleEntityNotFound(_0x49eed5,null))['then'](saveUpdates(_0x2c3dd9[_0x2ef8('0x48')],null))[_0x2ef8('0x23')](respondWithResult(_0x49eed5,null))[_0x2ef8('0x40')](handleError(_0x49eed5,null));};exports[_0x2ef8('0x24')]=function(_0x3a0975,_0x328c5e){return db[_0x2ef8('0x29')]['find']({'where':{'id':_0x3a0975[_0x2ef8('0x42')]['id']}})[_0x2ef8('0x23')](handleEntityNotFound(_0x328c5e,null))[_0x2ef8('0x23')](removeEntity(_0x328c5e,null))[_0x2ef8('0x40')](handleError(_0x328c5e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index b9945dc..9c39b4c 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 _0x0f3f=['SquareMessage','square_messages','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./squareMessage.attributes','define'];(function(_0x42bf81,_0x2cb2ae){var _0x35c178=function(_0x12fc05){while(--_0x12fc05){_0x42bf81['push'](_0x42bf81['shift']());}};_0x35c178(++_0x2cb2ae);}(_0x0f3f,0x1f1));var _0xf0f3=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x0f3f[_0x29d6e6];return _0xc75ff0;};'use strict';var _=require(_0xf0f3('0x0'));var util=require(_0xf0f3('0x1'));var logger=require(_0xf0f3('0x2'))(_0xf0f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0f3('0x5'));var config=require(_0xf0f3('0x6'));var attributes=require(_0xf0f3('0x7'));module['exports']=function(_0x5b87f0,_0x4065e8){return _0x5b87f0[_0xf0f3('0x8')](_0xf0f3('0x9'),attributes,{'tableName':_0xf0f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x342e=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','util','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x342e,0x74));var _0xe342=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x342e[_0x308213];return _0x2e1619;};'use strict';var _=require('lodash');var util=require(_0xe342('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe342('0x1'));var BPromise=require(_0xe342('0x2'));var rp=require(_0xe342('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe342('0x4'));var config=require(_0xe342('0x5'));var attributes=require(_0xe342('0x6'));module[_0xe342('0x7')]=function(_0x5ae777,_0x131962){return _0x5ae777[_0xe342('0x8')]('SquareMessage',attributes,{'tableName':_0xe342('0x9'),'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 99195c3..b5c6eff 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 _0xd634=['body','options','then','debug','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareMessage','SquareMessage','create'];(function(_0x1f0bb8,_0x3cb832){var _0x3e15b5=function(_0x3f89a3){while(--_0x3f89a3){_0x1f0bb8['push'](_0x1f0bb8['shift']());}};_0x3e15b5(++_0x3cb832);}(_0xd634,0xf4));var _0x4d63=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xd634[_0x29d6e6];return _0xc75ff0;};'use strict';var _=require('lodash');var util=require(_0x4d63('0x0'));var moment=require(_0x4d63('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d63('0x2'));var db=require(_0x4d63('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d63('0x4'));var config=require(_0x4d63('0x5'));var jayson=require(_0x4d63('0x6'));var client=jayson[_0x4d63('0x7')][_0x4d63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x381601,_0x3e90e1,_0x6a60f4){return new BPromise(function(_0x49c1da,_0x5be18a){return client['request'](_0x381601,_0x6a60f4)['then'](function(_0x5cfc22){logger[_0x4d63('0x9')](_0x4d63('0xa'),_0x3e90e1,_0x4d63('0xb'));logger['debug'](_0x4d63('0xc'),_0x3e90e1,_0x4d63('0xb'),JSON['stringify'](_0x5cfc22));if(_0x5cfc22['error']){if(_0x5cfc22[_0x4d63('0xd')]['code']===0x1f4){logger[_0x4d63('0xd')](_0x4d63('0xa'),_0x3e90e1,_0x5cfc22[_0x4d63('0xd')][_0x4d63('0xe')]);return _0x5be18a(_0x5cfc22[_0x4d63('0xd')][_0x4d63('0xe')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x3e90e1,_0x5cfc22['error'][_0x4d63('0xe')]);return _0x49c1da(_0x5cfc22[_0x4d63('0xd')][_0x4d63('0xe')]);}else{logger[_0x4d63('0x9')]('SquareMessage,\x20%s,\x20%s',_0x3e90e1,_0x4d63('0xb'));_0x49c1da(_0x5cfc22[_0x4d63('0xf')][_0x4d63('0xe')]);}})[_0x4d63('0x10')](function(_0x3c96b8){logger[_0x4d63('0xd')](_0x4d63('0xa'),_0x3e90e1,_0x3c96b8);_0x5be18a(_0x3c96b8);});});}exports[_0x4d63('0x11')]=function(_0x53bbb8){var _0x4fe175=this;return new Promise(function(_0x790e03,_0x4b849f){return db[_0x4d63('0x12')][_0x4d63('0x13')](_0x53bbb8[_0x4d63('0x14')],{'raw':_0x53bbb8[_0x4d63('0x15')]?_0x53bbb8[_0x4d63('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x4d63('0x16')](function(_0x12ef62){logger['info'](_0x4d63('0x11'),_0x53bbb8);logger[_0x4d63('0x17')](_0x4d63('0x11'),_0x53bbb8,JSON['stringify'](_0x12ef62));_0x790e03(_0x12ef62);})[_0x4d63('0x10')](function(_0x131386){logger[_0x4d63('0xd')](_0x4d63('0x11'),_0x131386['message'],_0x53bbb8);_0x4b849f(_0x4fe175[_0x4d63('0xd')](0x1f4,_0x131386['message']));});});}; \ No newline at end of file +var _0x89fb=['result','catch','body','options','raw','then','CreateSquareMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x14ce8f,_0x5d1cf3){var _0xb2e807=function(_0x1db106){while(--_0x1db106){_0x14ce8f['push'](_0x14ce8f['shift']());}};_0xb2e807(++_0x5d1cf3);}(_0x89fb,0x14b));var _0xb89f=function(_0x5d4495,_0x200eb5){_0x5d4495=_0x5d4495-0x0;var _0x11f343=_0x89fb[_0x5d4495];return _0x11f343;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var moment=require(_0xb89f('0x1'));var BPromise=require(_0xb89f('0x2'));var rs=require(_0xb89f('0x3'));var fs=require('fs');var Redis=require(_0xb89f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb89f('0x5'));var logger=require(_0xb89f('0x6'))(_0xb89f('0x7'));var config=require(_0xb89f('0x8'));var jayson=require(_0xb89f('0x9'));var client=jayson['client'][_0xb89f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b467c,_0x334236,_0x537685){return new BPromise(function(_0x3c0105,_0x95385){return client[_0xb89f('0xb')](_0x5b467c,_0x537685)['then'](function(_0x18f75f){logger[_0xb89f('0xc')](_0xb89f('0xd'),_0x334236,_0xb89f('0xe'));logger[_0xb89f('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x334236,'request\x20sent',JSON[_0xb89f('0x10')](_0x18f75f));if(_0x18f75f[_0xb89f('0x11')]){if(_0x18f75f[_0xb89f('0x11')][_0xb89f('0x12')]===0x1f4){logger[_0xb89f('0x11')]('SquareMessage,\x20%s,\x20%s',_0x334236,_0x18f75f[_0xb89f('0x11')][_0xb89f('0x13')]);return _0x95385(_0x18f75f[_0xb89f('0x11')][_0xb89f('0x13')]);}logger[_0xb89f('0x11')](_0xb89f('0xd'),_0x334236,_0x18f75f['error'][_0xb89f('0x13')]);return _0x3c0105(_0x18f75f[_0xb89f('0x11')][_0xb89f('0x13')]);}else{logger[_0xb89f('0xc')](_0xb89f('0xd'),_0x334236,_0xb89f('0xe'));_0x3c0105(_0x18f75f[_0xb89f('0x14')]['message']);}})[_0xb89f('0x15')](function(_0xfc48d){logger[_0xb89f('0x11')](_0xb89f('0xd'),_0x334236,_0xfc48d);_0x95385(_0xfc48d);});});}exports['CreateSquareMessage']=function(_0x55c865){var _0x77a882=this;return new Promise(function(_0x3004b7,_0xc35f8){return db['SquareMessage']['create'](_0x55c865[_0xb89f('0x16')],{'raw':_0x55c865[_0xb89f('0x17')]?_0x55c865[_0xb89f('0x17')][_0xb89f('0x18')]===undefined?!![]:![]:!![]})[_0xb89f('0x19')](function(_0x3c772d){logger[_0xb89f('0xc')]('CreateSquareMessage',_0x55c865);logger['debug']('CreateSquareMessage',_0x55c865,JSON['stringify'](_0x3c772d));_0x3004b7(_0x3c772d);})['catch'](function(_0x42005c){logger['error'](_0xb89f('0x1a'),_0x42005c[_0xb89f('0x13')],_0x55c865);_0xc35f8(_0x77a882[_0xb89f('0x11')](0x1f4,_0x42005c[_0xb89f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 7ffdbf2..0633e66 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 _0xa58f=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','15s','post','create','put','/:id','delete','exports','multer','path'];(function(_0x1137cd,_0x173553){var _0x2ba362=function(_0x1f58cc){while(--_0x1f58cc){_0x1137cd['push'](_0x1137cd['shift']());}};_0x2ba362(++_0x173553);}(_0xa58f,0x19e));var _0xfa58=function(_0x2d337c,_0x3e4641){_0x2d337c=_0x2d337c-0x0;var _0xfa0b93=_0xa58f[_0x2d337c];return _0xfa0b93;};'use strict';var multer=require(_0xfa58('0x0'));var util=require('util');var path=require(_0xfa58('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa58('0x2'));var router=express['Router']();var auth=require(_0xfa58('0x3'));var interaction=require(_0xfa58('0x4'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xfa58('0x5')]('/',auth[_0xfa58('0x6')](),controller[_0xfa58('0x7')]);router['get']('/:id',auth[_0xfa58('0x6')](),controller[_0xfa58('0x8')]);router[_0xfa58('0x5')]('/:id/test',auth['isAuthenticated'](),timeout(_0xfa58('0x9')),controller['test']);router[_0xfa58('0xa')]('/',auth[_0xfa58('0x6')](),controller[_0xfa58('0xb')]);router[_0xfa58('0xc')](_0xfa58('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfa58('0xe')](_0xfa58('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xfa58('0xf')]=router; \ No newline at end of file +var _0x3114=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/test','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3114,0x19f));var _0x4311=function(_0x11d42f,_0x257c6a){_0x11d42f=_0x11d42f-0x0;var _0x53177e=_0x3114[_0x11d42f];return _0x53177e;};'use strict';var multer=require(_0x4311('0x0'));var util=require(_0x4311('0x1'));var path=require(_0x4311('0x2'));var timeout=require(_0x4311('0x3'));var express=require(_0x4311('0x4'));var router=express[_0x4311('0x5')]();var auth=require(_0x4311('0x6'));var interaction=require(_0x4311('0x7'));var config=require(_0x4311('0x8'));var controller=require('./squareOdbc.controller');router[_0x4311('0x9')]('/',auth[_0x4311('0xa')](),controller[_0x4311('0xb')]);router[_0x4311('0x9')]('/:id',auth[_0x4311('0xa')](),controller[_0x4311('0xc')]);router[_0x4311('0x9')](_0x4311('0xd'),auth[_0x4311('0xa')](),timeout('15s'),controller['test']);router[_0x4311('0xe')]('/',auth[_0x4311('0xa')](),controller[_0x4311('0xf')]);router[_0x4311('0x10')]('/:id',auth[_0x4311('0xa')](),controller[_0x4311('0x11')]);router[_0x4311('0x12')](_0x4311('0x13'),auth[_0x4311('0xa')](),controller[_0x4311('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 642a4dd..ca3080a 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 _0x8cbd=['name','sequelize','exports','STRING'];(function(_0x5b3fb0,_0x3afe49){var _0x514507=function(_0x231803){while(--_0x231803){_0x5b3fb0['push'](_0x5b3fb0['shift']());}};_0x514507(++_0x3afe49);}(_0x8cbd,0x145));var _0xd8cb=function(_0x59a5d0,_0x4b3308){_0x59a5d0=_0x59a5d0-0x0;var _0x6840ac=_0x8cbd[_0x59a5d0];return _0x6840ac;};'use strict';var Sequelize=require(_0xd8cb('0x0'));module[_0xd8cb('0x1')]={'name':{'type':Sequelize[_0xd8cb('0x2')],'unique':_0xd8cb('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd8cb('0x2')]},'description':{'type':Sequelize[_0xd8cb('0x2')]}}; \ No newline at end of file +var _0xe5af=['exports','STRING','name','sequelize'];(function(_0x3c8c2d,_0x3022ff){var _0x38ce17=function(_0x270282){while(--_0x270282){_0x3c8c2d['push'](_0x3c8c2d['shift']());}};_0x38ce17(++_0x3022ff);}(_0xe5af,0x147));var _0xfe5a=function(_0x14017d,_0x346fdf){_0x14017d=_0x14017d-0x0;var _0x37d4aa=_0xe5af[_0x14017d];return _0x37d4aa;};'use strict';var Sequelize=require(_0xfe5a('0x0'));module[_0xfe5a('0x1')]={'name':{'type':Sequelize[_0xfe5a('0x2')],'unique':_0xfe5a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfe5a('0x2')]},'description':{'type':Sequelize[_0xfe5a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 333b053..8af480c 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 _0x0238=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','type','options','include','findAll','rows','show','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x0238,0x14a));var _0x8023=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x0238[_0xa4f636];return _0x37e02a;};'use strict';var pdf=require(_0x8023('0x0'));var emlformat=require(_0x8023('0x1'));var rimraf=require(_0x8023('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8023('0x3'));var rp=require(_0x8023('0x4'));var moment=require('moment');var BPromise=require(_0x8023('0x5'));var Mustache=require(_0x8023('0x6'));var util=require(_0x8023('0x7'));var path=require(_0x8023('0x8'));var sox=require('sox');var csv=require(_0x8023('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8023('0xa'));var squel=require(_0x8023('0xb'));var crypto=require(_0x8023('0xc'));var jsforce=require(_0x8023('0xd'));var deskjs=require(_0x8023('0xe'));var toCsv=require(_0x8023('0x9'));var querystring=require(_0x8023('0xf'));var Papa=require(_0x8023('0x10'));var Redis=require(_0x8023('0x11'));var authService=require(_0x8023('0x12'));var qs=require(_0x8023('0x13'));var as=require(_0x8023('0x14'));var hardwareService=require(_0x8023('0x15'));var logger=require(_0x8023('0x16'))(_0x8023('0x17'));var utils=require(_0x8023('0x18'));var config=require(_0x8023('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5009ac,_0x1d072f){_0x1d072f=_0x1d072f||0xcc;return function(_0x52cfe4){if(_0x52cfe4){return _0x5009ac[_0x8023('0x1a')](_0x1d072f);}return _0x5009ac[_0x8023('0x1b')](_0x1d072f)[_0x8023('0x1c')]();};}function respondWithResult(_0x5c5b22,_0x362578){_0x362578=_0x362578||0xc8;return function(_0x3ea7f0){if(_0x3ea7f0){return _0x5c5b22[_0x8023('0x1b')](_0x362578)['json'](_0x3ea7f0);}};}function respondWithFilteredResult(_0x472678,_0x340af1){return function(_0x4cbade){if(_0x4cbade){var _0x67d874=_0x4cbade[_0x8023('0x1d')],_0x5eec18=_0x340af1[_0x8023('0x1e')],_0x640c54=_0x340af1[_0x8023('0x1e')]+_0x340af1['limit'],_0x5d5688;if(_0x640c54>=_0x67d874){_0x640c54=_0x67d874;_0x5d5688=0xc8;}else{_0x5d5688=0xce;}_0x472678['status'](_0x5d5688);return _0x472678['set'](_0x8023('0x1f'),_0x5eec18+'-'+_0x640c54+'/'+_0x67d874)['json'](_0x4cbade);}return null;};}function patchUpdates(_0x3406c7){return function(_0x33cec3){try{jsonpatch['apply'](_0x33cec3,_0x3406c7,!![]);}catch(_0x35b004){return BPromise[_0x8023('0x20')](_0x35b004);}return _0x33cec3[_0x8023('0x21')]();};}function saveUpdates(_0x238397,_0x512a58){return function(_0x14847f){if(_0x14847f){return _0x14847f[_0x8023('0x22')](_0x238397)[_0x8023('0x23')](function(_0x482bad){return _0x482bad;});}return null;};}function removeEntity(_0x11c49b,_0xa744d4){return function(_0x37459c){if(_0x37459c){return _0x37459c[_0x8023('0x24')]()[_0x8023('0x23')](function(){var _0x5858ba=_0x37459c['get']({'plain':!![]});var _0x945be9='ODBC';return db[_0x8023('0x25')][_0x8023('0x24')]({'where':{'type':_0x945be9,'resourceId':_0x5858ba['id']}})[_0x8023('0x23')](function(){return _0x37459c;});})[_0x8023('0x23')](function(){_0x11c49b[_0x8023('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27d3a7,_0x137541){return function(_0x5cee92){if(!_0x5cee92){_0x27d3a7[_0x8023('0x1a')](0x194);}return _0x5cee92;};}function handleError(_0x41c6c5,_0x44b42c){_0x44b42c=_0x44b42c||0x1f4;return function(_0x44e5e4){logger[_0x8023('0x26')](_0x44e5e4[_0x8023('0x27')]);if(_0x44e5e4['name']){delete _0x44e5e4[_0x8023('0x28')];}_0x41c6c5[_0x8023('0x1b')](_0x44b42c)[_0x8023('0x29')](_0x44e5e4);};}exports['index']=function(_0x25796c,_0x441bfe){var _0x5ec973={},_0x25a86c={},_0x4fc96c={'count':0x0,'rows':[]};var _0xf88bce=_[_0x8023('0x2a')](db[_0x8023('0x2b')][_0x8023('0x2c')],function(_0x24cb83){return{'name':_0x24cb83[_0x8023('0x2d')],'type':_0x24cb83['type'][_0x8023('0x2e')]};});_0x25a86c[_0x8023('0x2f')]=_[_0x8023('0x2a')](_0xf88bce,'name');_0x25a86c[_0x8023('0x30')]=_[_0x8023('0x31')](_0x25796c[_0x8023('0x30')]);_0x25a86c[_0x8023('0x32')]=_[_0x8023('0x33')](_0x25a86c[_0x8023('0x2f')],_0x25a86c[_0x8023('0x30')]);_0x5ec973[_0x8023('0x34')]=_[_0x8023('0x33')](_0x25a86c[_0x8023('0x2f')],qs[_0x8023('0x35')](_0x25796c[_0x8023('0x30')][_0x8023('0x35')]));_0x5ec973[_0x8023('0x34')]=_0x5ec973['attributes'][_0x8023('0x36')]?_0x5ec973[_0x8023('0x34')]:_0x25a86c[_0x8023('0x2f')];if(!_0x25796c[_0x8023('0x30')][_0x8023('0x37')](_0x8023('0x38'))){_0x5ec973['limit']=qs[_0x8023('0x39')](_0x25796c[_0x8023('0x30')][_0x8023('0x39')]);_0x5ec973[_0x8023('0x1e')]=qs[_0x8023('0x1e')](_0x25796c[_0x8023('0x30')]['offset']);}_0x5ec973['order']=qs[_0x8023('0x3a')](_0x25796c['query']['sort']);_0x5ec973['where']=qs[_0x8023('0x32')](_[_0x8023('0x3b')](_0x25796c[_0x8023('0x30')],_0x25a86c[_0x8023('0x32')]));if(_0x25796c[_0x8023('0x30')]['filter']){_0x5ec973[_0x8023('0x3c')]=_[_0x8023('0x3d')](_0x5ec973[_0x8023('0x3c')],{'$or':_[_0x8023('0x2a')](_0xf88bce,function(_0x454098){if(_0x454098[_0x8023('0x3e')]!=='VIRTUAL'){var _0x423494={};_0x423494[_0x454098[_0x8023('0x28')]]={'$like':'%'+_0x25796c[_0x8023('0x30')]['filter']+'%'};return _0x423494;}})});}_0x5ec973=_[_0x8023('0x3d')]({},_0x5ec973,_0x25796c[_0x8023('0x3f')]);var _0x1dca1d={'where':_0x5ec973[_0x8023('0x3c')]};return db[_0x8023('0x2b')][_0x8023('0x1d')](_0x1dca1d)['then'](function(_0x5c0145){_0x4fc96c[_0x8023('0x1d')]=_0x5c0145;if(_0x25796c[_0x8023('0x30')]['includeAll']){_0x5ec973[_0x8023('0x40')]=[{'all':!![]}];}return db[_0x8023('0x2b')][_0x8023('0x41')](_0x5ec973);})['then'](function(_0x2735e7){_0x4fc96c[_0x8023('0x42')]=_0x2735e7;return _0x4fc96c;})[_0x8023('0x23')](respondWithFilteredResult(_0x441bfe,_0x5ec973))['catch'](handleError(_0x441bfe,null));};exports[_0x8023('0x43')]=function(_0x5a11f6,_0xcf16e0){var _0x188c88={'raw':!![],'where':{'id':_0x5a11f6['params']['id']}},_0x3c98fd={};_0x3c98fd['model']=_[_0x8023('0x31')](db['SquareOdbc'][_0x8023('0x2c')]);_0x3c98fd[_0x8023('0x30')]=_[_0x8023('0x31')](_0x5a11f6[_0x8023('0x30')]);_0x3c98fd[_0x8023('0x32')]=_[_0x8023('0x33')](_0x3c98fd[_0x8023('0x2f')],_0x3c98fd['query']);_0x188c88[_0x8023('0x34')]=_[_0x8023('0x33')](_0x3c98fd['model'],qs[_0x8023('0x35')](_0x5a11f6[_0x8023('0x30')][_0x8023('0x35')]));_0x188c88['attributes']=_0x188c88['attributes']['length']?_0x188c88[_0x8023('0x34')]:_0x3c98fd[_0x8023('0x2f')];if(_0x5a11f6[_0x8023('0x30')][_0x8023('0x44')]){_0x188c88[_0x8023('0x40')]=[{'all':!![]}];}_0x188c88=_['merge']({},_0x188c88,_0x5a11f6[_0x8023('0x3f')]);return db[_0x8023('0x2b')][_0x8023('0x45')](_0x188c88)['then'](handleEntityNotFound(_0xcf16e0,null))[_0x8023('0x23')](respondWithResult(_0xcf16e0,null))[_0x8023('0x46')](handleError(_0xcf16e0,null));};exports[_0x8023('0x47')]=function(_0x5e6711,_0xf8182c){return db[_0x8023('0x2b')][_0x8023('0x47')](_0x5e6711[_0x8023('0x48')],{})['then'](function(_0x34b94c){var _0x97727b=_0x5e6711[_0x8023('0x49')][_0x8023('0x4a')]({'plain':!![]});if(!_0x97727b)throw new Error(_0x8023('0x4b'));if(_0x97727b['role']===_0x8023('0x49')){var _0x5591bc=_0x34b94c[_0x8023('0x4a')]({'plain':!![]});var _0x30bb21=_0x8023('0x4c');return db[_0x8023('0x4d')][_0x8023('0x45')]({'where':{'name':_0x30bb21,'userProfileId':_0x97727b[_0x8023('0x4e')]},'raw':!![]})[_0x8023('0x23')](function(_0x5353de){if(_0x5353de&&_0x5353de[_0x8023('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x5591bc[_0x8023('0x28')],'resourceId':_0x5591bc['id'],'type':_0x5353de[_0x8023('0x28')],'sectionId':_0x5353de['id']},{})[_0x8023('0x23')](function(){return _0x34b94c;});}else{return _0x34b94c;}})[_0x8023('0x46')](function(_0x38811c){logger[_0x8023('0x26')](_0x8023('0x50'),_0x38811c);throw _0x38811c;});}return _0x34b94c;})['then'](respondWithResult(_0xf8182c,0xc9))[_0x8023('0x46')](handleError(_0xf8182c,null));};exports[_0x8023('0x22')]=function(_0x489dda,_0x3c3c2f){if(_0x489dda[_0x8023('0x48')]['id']){delete _0x489dda[_0x8023('0x48')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x489dda[_0x8023('0x51')]['id']}})['then'](handleEntityNotFound(_0x3c3c2f,null))[_0x8023('0x23')](saveUpdates(_0x489dda[_0x8023('0x48')],null))[_0x8023('0x23')](respondWithResult(_0x3c3c2f,null))[_0x8023('0x46')](handleError(_0x3c3c2f,null));};exports[_0x8023('0x24')]=function(_0x1f7ee0,_0x14548a){return db[_0x8023('0x2b')]['find']({'where':{'id':_0x1f7ee0['params']['id']}})[_0x8023('0x23')](handleEntityNotFound(_0x14548a,null))[_0x8023('0x23')](removeEntity(_0x14548a,null))[_0x8023('0x46')](handleError(_0x14548a,null));};exports[_0x8023('0x52')]=function(_0x45b743,_0x4bd647,_0x5987ad){var _0x3762c0;return db[_0x8023('0x2b')][_0x8023('0x45')]({'where':{'id':_0x45b743['params']['id']},'attributes':['id',_0x8023('0x53')]})[_0x8023('0x23')](handleEntityNotFound(_0x4bd647,null))[_0x8023('0x23')](function(_0x56755b){if(_0x56755b){var _0x461770=require(_0x8023('0x54'))();_0x461770['openSync'](_0x56755b[_0x8023('0x53')]);_0x461770['closeSync']();return _0x56755b;}})[_0x8023('0x23')](respondWithResult(_0x4bd647,null))[_0x8023('0x46')](handleError(_0x4bd647,null));}; \ No newline at end of file +var _0x4ed2=['apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','merge','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','dsn','closeSync','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','Content-Range','json'];(function(_0x5bffc0,_0x378dd8){var _0x39a98a=function(_0x512a9c){while(--_0x512a9c){_0x5bffc0['push'](_0x5bffc0['shift']());}};_0x39a98a(++_0x378dd8);}(_0x4ed2,0x135));var _0x24ed=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4ed2[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x24ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24ed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x24ed('0x2'));var BPromise=require(_0x24ed('0x3'));var Mustache=require(_0x24ed('0x4'));var util=require('util');var path=require(_0x24ed('0x5'));var sox=require('sox');var csv=require(_0x24ed('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x24ed('0x7'));var squel=require(_0x24ed('0x8'));var crypto=require('crypto');var jsforce=require(_0x24ed('0x9'));var deskjs=require(_0x24ed('0xa'));var toCsv=require(_0x24ed('0x6'));var querystring=require('querystring');var Papa=require(_0x24ed('0xb'));var Redis=require(_0x24ed('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x24ed('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24ed('0xe'));var logger=require('../../config/logger')(_0x24ed('0xf'));var utils=require(_0x24ed('0x10'));var config=require(_0x24ed('0x11'));var db=require(_0x24ed('0x12'))['db'];function respondWithStatusCode(_0x1cd19b,_0x296dca){_0x296dca=_0x296dca||0xcc;return function(_0x48db74){if(_0x48db74){return _0x1cd19b['sendStatus'](_0x296dca);}return _0x1cd19b[_0x24ed('0x13')](_0x296dca)['end']();};}function respondWithResult(_0x2d9de2,_0x4e2573){_0x4e2573=_0x4e2573||0xc8;return function(_0x5bfdc8){if(_0x5bfdc8){return _0x2d9de2[_0x24ed('0x13')](_0x4e2573)['json'](_0x5bfdc8);}};}function respondWithFilteredResult(_0x3769b5,_0x2af605){return function(_0x2bb503){if(_0x2bb503){var _0x247ff5=_0x2bb503['count'],_0x31219d=_0x2af605['offset'],_0x5e33f6=_0x2af605[_0x24ed('0x14')]+_0x2af605['limit'],_0x5b7824;if(_0x5e33f6>=_0x247ff5){_0x5e33f6=_0x247ff5;_0x5b7824=0xc8;}else{_0x5b7824=0xce;}_0x3769b5[_0x24ed('0x13')](_0x5b7824);return _0x3769b5['set'](_0x24ed('0x15'),_0x31219d+'-'+_0x5e33f6+'/'+_0x247ff5)[_0x24ed('0x16')](_0x2bb503);}return null;};}function patchUpdates(_0x5c3ca6){return function(_0x52ccac){try{jsonpatch[_0x24ed('0x17')](_0x52ccac,_0x5c3ca6,!![]);}catch(_0xe21fb7){return BPromise[_0x24ed('0x18')](_0xe21fb7);}return _0x52ccac[_0x24ed('0x19')]();};}function saveUpdates(_0x38f158,_0x349f5c){return function(_0x745c20){if(_0x745c20){return _0x745c20[_0x24ed('0x1a')](_0x38f158)[_0x24ed('0x1b')](function(_0x42bbe2){return _0x42bbe2;});}return null;};}function removeEntity(_0x1e2775,_0x223721){return function(_0x39c2f1){if(_0x39c2f1){return _0x39c2f1[_0x24ed('0x1c')]()[_0x24ed('0x1b')](function(){var _0x1d4a10=_0x39c2f1[_0x24ed('0x1d')]({'plain':!![]});var _0x4475eb=_0x24ed('0x1e');return db[_0x24ed('0x1f')][_0x24ed('0x1c')]({'where':{'type':_0x4475eb,'resourceId':_0x1d4a10['id']}})[_0x24ed('0x1b')](function(){return _0x39c2f1;});})[_0x24ed('0x1b')](function(){_0x1e2775['status'](0xcc)[_0x24ed('0x20')]();});}};}function handleEntityNotFound(_0x336591,_0x16a718){return function(_0x3024a7){if(!_0x3024a7){_0x336591[_0x24ed('0x21')](0x194);}return _0x3024a7;};}function handleError(_0x87fe49,_0x3e4df2){_0x3e4df2=_0x3e4df2||0x1f4;return function(_0x3c602f){logger[_0x24ed('0x22')](_0x3c602f[_0x24ed('0x23')]);if(_0x3c602f['name']){delete _0x3c602f[_0x24ed('0x24')];}_0x87fe49[_0x24ed('0x13')](_0x3e4df2)[_0x24ed('0x25')](_0x3c602f);};}exports[_0x24ed('0x26')]=function(_0x338869,_0x41b414){var _0x2e248c={},_0x15e009={},_0x1cfe9f={'count':0x0,'rows':[]};var _0x41eaf8=_[_0x24ed('0x27')](db[_0x24ed('0x28')][_0x24ed('0x29')],function(_0x3b6d17){return{'name':_0x3b6d17[_0x24ed('0x2a')],'type':_0x3b6d17['type']['key']};});_0x15e009['model']=_[_0x24ed('0x27')](_0x41eaf8,_0x24ed('0x24'));_0x15e009['query']=_[_0x24ed('0x2b')](_0x338869[_0x24ed('0x2c')]);_0x15e009[_0x24ed('0x2d')]=_['intersection'](_0x15e009[_0x24ed('0x2e')],_0x15e009[_0x24ed('0x2c')]);_0x2e248c[_0x24ed('0x2f')]=_[_0x24ed('0x30')](_0x15e009[_0x24ed('0x2e')],qs[_0x24ed('0x31')](_0x338869[_0x24ed('0x2c')][_0x24ed('0x31')]));_0x2e248c[_0x24ed('0x2f')]=_0x2e248c[_0x24ed('0x2f')]['length']?_0x2e248c['attributes']:_0x15e009[_0x24ed('0x2e')];if(!_0x338869[_0x24ed('0x2c')][_0x24ed('0x32')]('nolimit')){_0x2e248c[_0x24ed('0x33')]=qs['limit'](_0x338869[_0x24ed('0x2c')][_0x24ed('0x33')]);_0x2e248c[_0x24ed('0x14')]=qs[_0x24ed('0x14')](_0x338869[_0x24ed('0x2c')][_0x24ed('0x14')]);}_0x2e248c[_0x24ed('0x34')]=qs[_0x24ed('0x35')](_0x338869['query'][_0x24ed('0x35')]);_0x2e248c[_0x24ed('0x36')]=qs[_0x24ed('0x2d')](_['pick'](_0x338869[_0x24ed('0x2c')],_0x15e009['filters']));if(_0x338869[_0x24ed('0x2c')]['filter']){_0x2e248c[_0x24ed('0x36')]=_[_0x24ed('0x37')](_0x2e248c[_0x24ed('0x36')],{'$or':_['map'](_0x41eaf8,function(_0x421f8d){if(_0x421f8d[_0x24ed('0x38')]!==_0x24ed('0x39')){var _0x4a8d85={};_0x4a8d85[_0x421f8d[_0x24ed('0x24')]]={'$like':'%'+_0x338869[_0x24ed('0x2c')][_0x24ed('0x3a')]+'%'};return _0x4a8d85;}})});}_0x2e248c=_[_0x24ed('0x37')]({},_0x2e248c,_0x338869[_0x24ed('0x3b')]);var _0x543a13={'where':_0x2e248c[_0x24ed('0x36')]};return db['SquareOdbc'][_0x24ed('0x3c')](_0x543a13)[_0x24ed('0x1b')](function(_0xc9f695){_0x1cfe9f['count']=_0xc9f695;if(_0x338869[_0x24ed('0x2c')]['includeAll']){_0x2e248c[_0x24ed('0x3d')]=[{'all':!![]}];}return db[_0x24ed('0x28')][_0x24ed('0x3e')](_0x2e248c);})[_0x24ed('0x1b')](function(_0xadc170){_0x1cfe9f[_0x24ed('0x3f')]=_0xadc170;return _0x1cfe9f;})[_0x24ed('0x1b')](respondWithFilteredResult(_0x41b414,_0x2e248c))[_0x24ed('0x40')](handleError(_0x41b414,null));};exports[_0x24ed('0x41')]=function(_0x1c327a,_0x3ab842){var _0x459f7f={'raw':!![],'where':{'id':_0x1c327a[_0x24ed('0x42')]['id']}},_0x5aa182={};_0x5aa182[_0x24ed('0x2e')]=_[_0x24ed('0x2b')](db[_0x24ed('0x28')][_0x24ed('0x29')]);_0x5aa182['query']=_['keys'](_0x1c327a['query']);_0x5aa182['filters']=_[_0x24ed('0x30')](_0x5aa182['model'],_0x5aa182[_0x24ed('0x2c')]);_0x459f7f[_0x24ed('0x2f')]=_['intersection'](_0x5aa182[_0x24ed('0x2e')],qs[_0x24ed('0x31')](_0x1c327a[_0x24ed('0x2c')][_0x24ed('0x31')]));_0x459f7f[_0x24ed('0x2f')]=_0x459f7f['attributes'][_0x24ed('0x43')]?_0x459f7f[_0x24ed('0x2f')]:_0x5aa182[_0x24ed('0x2e')];if(_0x1c327a[_0x24ed('0x2c')][_0x24ed('0x44')]){_0x459f7f[_0x24ed('0x3d')]=[{'all':!![]}];}_0x459f7f=_['merge']({},_0x459f7f,_0x1c327a['options']);return db[_0x24ed('0x28')][_0x24ed('0x45')](_0x459f7f)[_0x24ed('0x1b')](handleEntityNotFound(_0x3ab842,null))[_0x24ed('0x1b')](respondWithResult(_0x3ab842,null))[_0x24ed('0x40')](handleError(_0x3ab842,null));};exports['create']=function(_0xddf8a2,_0x4a6ad1){return db[_0x24ed('0x28')][_0x24ed('0x46')](_0xddf8a2[_0x24ed('0x47')],{})[_0x24ed('0x1b')](function(_0x22a3f2){var _0x2114d3=_0xddf8a2[_0x24ed('0x48')][_0x24ed('0x1d')]({'plain':!![]});if(!_0x2114d3)throw new Error(_0x24ed('0x49'));if(_0x2114d3[_0x24ed('0x4a')]===_0x24ed('0x48')){var _0x5d7599=_0x22a3f2[_0x24ed('0x1d')]({'plain':!![]});var _0x1a7ab1=_0x24ed('0x1e');return db[_0x24ed('0x4b')][_0x24ed('0x45')]({'where':{'name':_0x1a7ab1,'userProfileId':_0x2114d3[_0x24ed('0x4c')]},'raw':!![]})[_0x24ed('0x1b')](function(_0x8418ef){if(_0x8418ef&&_0x8418ef[_0x24ed('0x4d')]===0x0){return db['UserProfileResource'][_0x24ed('0x46')]({'name':_0x5d7599['name'],'resourceId':_0x5d7599['id'],'type':_0x8418ef[_0x24ed('0x24')],'sectionId':_0x8418ef['id']},{})[_0x24ed('0x1b')](function(){return _0x22a3f2;});}else{return _0x22a3f2;}})[_0x24ed('0x40')](function(_0x557912){logger[_0x24ed('0x22')](_0x24ed('0x4e'),_0x557912);throw _0x557912;});}return _0x22a3f2;})[_0x24ed('0x1b')](respondWithResult(_0x4a6ad1,0xc9))['catch'](handleError(_0x4a6ad1,null));};exports['update']=function(_0x19b990,_0x3b0f53){if(_0x19b990[_0x24ed('0x47')]['id']){delete _0x19b990[_0x24ed('0x47')]['id'];}return db['SquareOdbc'][_0x24ed('0x45')]({'where':{'id':_0x19b990[_0x24ed('0x42')]['id']}})[_0x24ed('0x1b')](handleEntityNotFound(_0x3b0f53,null))[_0x24ed('0x1b')](saveUpdates(_0x19b990[_0x24ed('0x47')],null))[_0x24ed('0x1b')](respondWithResult(_0x3b0f53,null))[_0x24ed('0x40')](handleError(_0x3b0f53,null));};exports[_0x24ed('0x1c')]=function(_0x219037,_0x582316){return db[_0x24ed('0x28')][_0x24ed('0x45')]({'where':{'id':_0x219037[_0x24ed('0x42')]['id']}})[_0x24ed('0x1b')](handleEntityNotFound(_0x582316,null))[_0x24ed('0x1b')](removeEntity(_0x582316,null))[_0x24ed('0x40')](handleError(_0x582316,null));};exports[_0x24ed('0x4f')]=function(_0x153c42,_0x1c1a1a,_0x51accd){var _0x6ef636;return db['SquareOdbc'][_0x24ed('0x45')]({'where':{'id':_0x153c42['params']['id']},'attributes':['id','dsn']})[_0x24ed('0x1b')](handleEntityNotFound(_0x1c1a1a,null))['then'](function(_0x548909){if(_0x548909){var _0x511a69=require(_0x24ed('0x50'))();_0x511a69['openSync'](_0x548909[_0x24ed('0x51')]);_0x511a69[_0x24ed('0x52')]();return _0x548909;}})[_0x24ed('0x1b')](respondWithResult(_0x1c1a1a,null))[_0x24ed('0x40')](handleError(_0x1c1a1a,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 6d5335e..16de47c 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 _0x3e57=['path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','../../config/logger','bluebird','request-promise'];(function(_0x8ae008,_0x50cded){var _0x360286=function(_0x4df151){while(--_0x4df151){_0x8ae008['push'](_0x8ae008['shift']());}};_0x360286(++_0x50cded);}(_0x3e57,0x1cb));var _0x73e5=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x3e57[_0x238671];return _0x474844;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73e5('0x0'))('api');var moment=require('moment');var BPromise=require(_0x73e5('0x1'));var rp=require(_0x73e5('0x2'));var fs=require('fs');var path=require(_0x73e5('0x3'));var rimraf=require(_0x73e5('0x4'));var config=require(_0x73e5('0x5'));var attributes=require(_0x73e5('0x6'));module[_0x73e5('0x7')]=function(_0x10b649,_0x5e855c){return _0x10b649[_0x73e5('0x8')](_0x73e5('0x9'),attributes,{'tableName':_0x73e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3d3=['../../config/environment','exports','define','SquareOdbc','square_odbc','../../config/logger','api','path','rimraf'];(function(_0x28b715,_0x41122c){var _0x49210d=function(_0x1af905){while(--_0x1af905){_0x28b715['push'](_0x28b715['shift']());}};_0x49210d(++_0x41122c);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xd3d3[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3d3d('0x0'))(_0x3d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d3d('0x2'));var rimraf=require(_0x3d3d('0x3'));var config=require(_0x3d3d('0x4'));var attributes=require('./squareOdbc.attributes');module[_0x3d3d('0x5')]=function(_0x5de1f8,_0x228033){return _0x5de1f8[_0x3d3d('0x6')](_0x3d3d('0x7'),attributes,{'tableName':_0x3d3d('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 5041ce0..c3fff12 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 _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x902d2d,_0x349166){var _0x1422d5=function(_0x29e810){while(--_0x29e810){_0x902d2d['push'](_0x902d2d['shift']());}};_0x1422d5(++_0x349166);}(_0x008c,0x188));var _0xc008=function(_0x1dfe96,_0xacd7bf){_0x1dfe96=_0x1dfe96-0x0;var _0x23bb8a=_0x008c[_0x1dfe96];return _0x23bb8a;};'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')]('SquareOdbc,\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')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x5b8320,_0x2ab5e5){var _0x5239ff=function(_0x4a26bf){while(--_0x4a26bf){_0x5b8320['push'](_0x5b8320['shift']());}};_0x5239ff(++_0x2ab5e5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0x5fc3[_0x1f1a97];return _0x29fc6a;};'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')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\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']('SquareOdbc,\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);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index aa8f5c0..56d9195 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 _0xe820=['destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','isAuthenticated','index','get','/:id','/:id/users','getUsers','post','create','addUsers','put','update','delete'];(function(_0x48c33f,_0x7e34f){var _0x125946=function(_0x2ccea4){while(--_0x2ccea4){_0x48c33f['push'](_0x48c33f['shift']());}};_0x125946(++_0x7e34f);}(_0xe820,0xd2));var _0x0e82=function(_0x2e25bc,_0x53eeff){_0x2e25bc=_0x2e25bc-0x0;var _0x523523=_0xe820[_0x2e25bc];return _0x523523;};'use strict';var multer=require(_0x0e82('0x0'));var util=require('util');var path=require(_0x0e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e82('0x2')]();var auth=require(_0x0e82('0x3'));var interaction=require(_0x0e82('0x4'));var config=require('../../config/environment');var controller=require(_0x0e82('0x5'));router['get']('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0x7')]);router[_0x0e82('0x8')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller['show']);router[_0x0e82('0x8')](_0x0e82('0xa'),auth[_0x0e82('0x6')](),controller[_0x0e82('0xb')]);router[_0x0e82('0xc')]('/',auth['isAuthenticated'](),controller[_0x0e82('0xd')]);router[_0x0e82('0xc')](_0x0e82('0xa'),auth[_0x0e82('0x6')](),controller[_0x0e82('0xe')]);router[_0x0e82('0xf')](_0x0e82('0x9'),auth['isAuthenticated'](),controller[_0x0e82('0x10')]);router[_0x0e82('0x11')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller[_0x0e82('0x12')]);router[_0x0e82('0x11')]('/:id/users',auth[_0x0e82('0x6')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0x80ed=['create','addUsers','put','/:id','update','delete','removeUsers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','/:id/users','getUsers','post'];(function(_0x2c8aa8,_0x23bb2b){var _0x36ac2d=function(_0x1e6697){while(--_0x1e6697){_0x2c8aa8['push'](_0x2c8aa8['shift']());}};_0x36ac2d(++_0x23bb2b);}(_0x80ed,0x11c));var _0xd80e=function(_0x1dfcf2,_0x57b084){_0x1dfcf2=_0x1dfcf2-0x0;var _0x306ec2=_0x80ed[_0x1dfcf2];return _0x306ec2;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var auth=require(_0xd80e('0x4'));var interaction=require(_0xd80e('0x5'));var config=require(_0xd80e('0x6'));var controller=require(_0xd80e('0x7'));router['get']('/',auth[_0xd80e('0x8')](),controller[_0xd80e('0x9')]);router[_0xd80e('0xa')]('/:id',auth[_0xd80e('0x8')](),controller[_0xd80e('0xb')]);router[_0xd80e('0xa')](_0xd80e('0xc'),auth[_0xd80e('0x8')](),controller[_0xd80e('0xd')]);router[_0xd80e('0xe')]('/',auth[_0xd80e('0x8')](),controller[_0xd80e('0xf')]);router[_0xd80e('0xe')]('/:id/users',auth[_0xd80e('0x8')](),controller[_0xd80e('0x10')]);router[_0xd80e('0x11')](_0xd80e('0x12'),auth[_0xd80e('0x8')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x14')](_0xd80e('0x12'),auth[_0xd80e('0x8')](),controller['destroy']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xd80e('0x15')]);module[_0xd80e('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 367db8a..bf9525e 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 _0x8b20=['BLOB','production','sequelize','exports','name','STRING','TEXT','long','preproduction','getDataValue','toString','utf8'];(function(_0x5770ed,_0x28a6c6){var _0x501701=function(_0x440460){while(--_0x440460){_0x5770ed['push'](_0x5770ed['shift']());}};_0x501701(++_0x28a6c6);}(_0x8b20,0x176));var _0x08b2=function(_0x10e6df,_0x147724){_0x10e6df=_0x10e6df-0x0;var _0x9fe199=_0x8b20[_0x10e6df];return _0x9fe199;};'use strict';var Sequelize=require(_0x08b2('0x0'));module[_0x08b2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x08b2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x08b2('0x3')]},'notes':{'type':Sequelize[_0x08b2('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x08b2('0x5')),'get':function(){if(this['getDataValue'](_0x08b2('0x6'))){return this[_0x08b2('0x7')](_0x08b2('0x6'))[_0x08b2('0x8')](_0x08b2('0x9'));}}},'production':{'type':Sequelize[_0x08b2('0xa')](_0x08b2('0x5')),'get':function(){if(this[_0x08b2('0x7')](_0x08b2('0xb'))){return this[_0x08b2('0x7')](_0x08b2('0xb'))[_0x08b2('0x8')](_0x08b2('0x9'));}}}}; \ No newline at end of file +var _0x2333=['getDataValue','toString','utf8','production','sequelize','exports','STRING','name','BLOB'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x2333,0x187));var _0x3233=function(_0x14362f,_0x4a62b4){_0x14362f=_0x14362f-0x0;var _0x121c7e=_0x2333[_0x14362f];return _0x121c7e;};'use strict';var Sequelize=require(_0x3233('0x0'));module[_0x3233('0x1')]={'name':{'type':Sequelize[_0x3233('0x2')],'unique':_0x3233('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3233('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3233('0x4')]('long'),'get':function(){if(this[_0x3233('0x5')]('preproduction')){return this[_0x3233('0x5')]('preproduction')[_0x3233('0x6')](_0x3233('0x7'));}}},'production':{'type':Sequelize[_0x3233('0x4')]('long'),'get':function(){if(this[_0x3233('0x5')](_0x3233('0x8'))){return this[_0x3233('0x5')](_0x3233('0x8'))[_0x3233('0x6')](_0x3233('0x7'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index d660463..250a1ba 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 _0x68fc=['register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','removeUsers','userSquareProject:remove','findOne','keys','sort','getUsers','html-pdf','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x911353,_0x1648ed){var _0x2f05fa=function(_0x4a00a4){while(--_0x4a00a4){_0x911353['push'](_0x911353['shift']());}};_0x2f05fa(++_0x1648ed);}(_0x68fc,0xa5));var _0xc68f=function(_0x3bbadf,_0x4ba43d){_0x3bbadf=_0x3bbadf-0x0;var _0x4429b7=_0x68fc[_0x3bbadf];return _0x4429b7;};'use strict';var pdf=require(_0xc68f('0x0'));var emlformat=require(_0xc68f('0x1'));var rimraf=require(_0xc68f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc68f('0x3'));var moment=require('moment');var BPromise=require(_0xc68f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc68f('0x5'));var sox=require(_0xc68f('0x6'));var csv=require(_0xc68f('0x7'));var ejs=require(_0xc68f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc68f('0x9'));var jsforce=require(_0xc68f('0xa'));var deskjs=require(_0xc68f('0xb'));var toCsv=require(_0xc68f('0x7'));var querystring=require(_0xc68f('0xc'));var Papa=require(_0xc68f('0xd'));var Redis=require(_0xc68f('0xe'));var authService=require(_0xc68f('0xf'));var qs=require(_0xc68f('0x10'));var as=require(_0xc68f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc68f('0x12'))(_0xc68f('0x13'));var utils=require(_0xc68f('0x14'));var config=require(_0xc68f('0x15'));var db=require(_0xc68f('0x16'))['db'];config[_0xc68f('0x17')]=_[_0xc68f('0x18')](config[_0xc68f('0x17')],{'host':_0xc68f('0x19'),'port':0x18eb});var socket=require(_0xc68f('0x1a'))(new Redis(config[_0xc68f('0x17')]));require('./squareProject.socket')[_0xc68f('0x1b')](socket);function respondWithStatusCode(_0x90ccbd,_0x2b1d30){_0x2b1d30=_0x2b1d30||0xcc;return function(_0xe6e7db){if(_0xe6e7db){return _0x90ccbd[_0xc68f('0x1c')](_0x2b1d30);}return _0x90ccbd[_0xc68f('0x1d')](_0x2b1d30)[_0xc68f('0x1e')]();};}function respondWithResult(_0x209d16,_0x4648c6){_0x4648c6=_0x4648c6||0xc8;return function(_0x5e1e5b){if(_0x5e1e5b){return _0x209d16['status'](_0x4648c6)[_0xc68f('0x1f')](_0x5e1e5b);}};}function respondWithFilteredResult(_0x366b23,_0x171eea){return function(_0x3714f7){if(_0x3714f7){var _0x2d9d85=_0x3714f7[_0xc68f('0x20')],_0x2c7261=_0x171eea[_0xc68f('0x21')],_0x50fab4=_0x171eea[_0xc68f('0x21')]+_0x171eea[_0xc68f('0x22')],_0x385dbe;if(_0x50fab4>=_0x2d9d85){_0x50fab4=_0x2d9d85;_0x385dbe=0xc8;}else{_0x385dbe=0xce;}_0x366b23[_0xc68f('0x1d')](_0x385dbe);return _0x366b23[_0xc68f('0x23')](_0xc68f('0x24'),_0x2c7261+'-'+_0x50fab4+'/'+_0x2d9d85)['json'](_0x3714f7);}return null;};}function patchUpdates(_0xcc11a3){return function(_0x2b48b7){try{jsonpatch[_0xc68f('0x25')](_0x2b48b7,_0xcc11a3,!![]);}catch(_0x540ef2){return BPromise[_0xc68f('0x26')](_0x540ef2);}return _0x2b48b7[_0xc68f('0x27')]();};}function saveUpdates(_0x116203,_0x2064db){return function(_0x2f6785){if(_0x2f6785){return _0x2f6785[_0xc68f('0x28')](_0x116203)[_0xc68f('0x29')](function(_0x547d46){return _0x547d46;});}return null;};}function removeEntity(_0x38c3a0,_0x288957){return function(_0x512c9c){if(_0x512c9c){return _0x512c9c[_0xc68f('0x2a')]()[_0xc68f('0x29')](function(){var _0x35945b=_0x512c9c[_0xc68f('0x2b')]({'plain':!![]});var _0x39419a='SquareProjects';return db[_0xc68f('0x2c')][_0xc68f('0x2a')]({'where':{'type':_0x39419a,'resourceId':_0x35945b['id']}})['then'](function(){return _0x512c9c;});})[_0xc68f('0x29')](function(){_0x38c3a0[_0xc68f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f6c07,_0xdde47e){return function(_0x2a4a5d){if(!_0x2a4a5d){_0x3f6c07[_0xc68f('0x1c')](0x194);}return _0x2a4a5d;};}function handleError(_0x58dd95,_0x477a1c){_0x477a1c=_0x477a1c||0x1f4;return function(_0x1cc5b2){logger[_0xc68f('0x2d')](_0x1cc5b2[_0xc68f('0x2e')]);if(_0x1cc5b2[_0xc68f('0x2f')]){delete _0x1cc5b2[_0xc68f('0x2f')];}_0x58dd95[_0xc68f('0x1d')](_0x477a1c)[_0xc68f('0x30')](_0x1cc5b2);};}exports['index']=function(_0x37f947,_0x352eb9){var _0x4b64da={},_0x323677={},_0x6d2d34={'count':0x0,'rows':[]};var _0x1cb436=_[_0xc68f('0x31')](db['SquareProject'][_0xc68f('0x32')],function(_0x16e1d0){return{'name':_0x16e1d0['fieldName'],'type':_0x16e1d0[_0xc68f('0x33')][_0xc68f('0x34')]};});_0x323677[_0xc68f('0x35')]=_[_0xc68f('0x31')](_0x1cb436,_0xc68f('0x2f'));_0x323677['query']=_['keys'](_0x37f947[_0xc68f('0x36')]);_0x323677[_0xc68f('0x37')]=_[_0xc68f('0x38')](_0x323677[_0xc68f('0x35')],_0x323677[_0xc68f('0x36')]);_0x4b64da['attributes']=_['intersection'](_0x323677[_0xc68f('0x35')],qs['fields'](_0x37f947[_0xc68f('0x36')][_0xc68f('0x39')]));_0x4b64da[_0xc68f('0x3a')]=_0x4b64da[_0xc68f('0x3a')][_0xc68f('0x3b')]?_0x4b64da[_0xc68f('0x3a')]:_0x323677[_0xc68f('0x35')];if(!_0x37f947['query'][_0xc68f('0x3c')](_0xc68f('0x3d'))){_0x4b64da[_0xc68f('0x22')]=qs[_0xc68f('0x22')](_0x37f947[_0xc68f('0x36')][_0xc68f('0x22')]);_0x4b64da[_0xc68f('0x21')]=qs[_0xc68f('0x21')](_0x37f947[_0xc68f('0x36')][_0xc68f('0x21')]);}_0x4b64da[_0xc68f('0x3e')]=qs['sort'](_0x37f947['query']['sort']);_0x4b64da[_0xc68f('0x3f')]=qs[_0xc68f('0x37')](_[_0xc68f('0x40')](_0x37f947[_0xc68f('0x36')],_0x323677['filters']));if(_0x37f947[_0xc68f('0x36')][_0xc68f('0x41')]){_0x4b64da[_0xc68f('0x3f')]=_['merge'](_0x4b64da[_0xc68f('0x3f')],{'$or':_[_0xc68f('0x31')](_0x1cb436,function(_0x4a8883){if(_0x4a8883[_0xc68f('0x33')]!==_0xc68f('0x42')){var _0x3b75d5={};_0x3b75d5[_0x4a8883['name']]={'$like':'%'+_0x37f947[_0xc68f('0x36')][_0xc68f('0x41')]+'%'};return _0x3b75d5;}})});}_0x4b64da=_[_0xc68f('0x43')]({},_0x4b64da,_0x37f947[_0xc68f('0x44')]);var _0x3af569={'where':_0x4b64da[_0xc68f('0x3f')]};return db[_0xc68f('0x45')]['count'](_0x3af569)[_0xc68f('0x29')](function(_0x40777c){_0x6d2d34[_0xc68f('0x20')]=_0x40777c;if(_0x37f947[_0xc68f('0x36')][_0xc68f('0x46')]){_0x4b64da[_0xc68f('0x47')]=[{'all':!![]}];}return db[_0xc68f('0x45')][_0xc68f('0x48')](_0x4b64da);})[_0xc68f('0x29')](function(_0x563386){_0x6d2d34[_0xc68f('0x49')]=_0x563386;return _0x6d2d34;})[_0xc68f('0x29')](respondWithFilteredResult(_0x352eb9,_0x4b64da))[_0xc68f('0x4a')](handleError(_0x352eb9,null));};exports[_0xc68f('0x4b')]=function(_0x45782f,_0x3683c0){var _0x3e7b43={'raw':![],'where':{'id':_0x45782f[_0xc68f('0x4c')]['id']}},_0x58e0f8={};_0x58e0f8['model']=_['keys'](db[_0xc68f('0x45')][_0xc68f('0x32')]);_0x58e0f8['query']=_['keys'](_0x45782f[_0xc68f('0x36')]);_0x58e0f8[_0xc68f('0x37')]=_[_0xc68f('0x38')](_0x58e0f8[_0xc68f('0x35')],_0x58e0f8[_0xc68f('0x36')]);_0x3e7b43[_0xc68f('0x3a')]=_[_0xc68f('0x38')](_0x58e0f8[_0xc68f('0x35')],qs[_0xc68f('0x39')](_0x45782f[_0xc68f('0x36')][_0xc68f('0x39')]));_0x3e7b43['attributes']=_0x3e7b43[_0xc68f('0x3a')]['length']?_0x3e7b43[_0xc68f('0x3a')]:_0x58e0f8[_0xc68f('0x35')];if(_0x45782f['query'][_0xc68f('0x46')]){_0x3e7b43[_0xc68f('0x47')]=[{'all':!![]}];}_0x3e7b43=_[_0xc68f('0x43')]({},_0x3e7b43,_0x45782f[_0xc68f('0x44')]);return db[_0xc68f('0x45')][_0xc68f('0x4d')](_0x3e7b43)[_0xc68f('0x29')](handleEntityNotFound(_0x3683c0,null))[_0xc68f('0x29')](respondWithResult(_0x3683c0,null))['catch'](handleError(_0x3683c0,null));};exports[_0xc68f('0x4e')]=function(_0x15eaa2,_0x45861f){return db['SquareProject']['create'](_0x15eaa2['body'],{})[_0xc68f('0x29')](function(_0x237327){var _0x483631=_0x15eaa2[_0xc68f('0x4f')]['get']({'plain':!![]});if(!_0x483631)throw new Error(_0xc68f('0x50'));if(_0x483631[_0xc68f('0x51')]===_0xc68f('0x4f')){var _0x26ac9a=_0x237327[_0xc68f('0x2b')]({'plain':!![]});var _0x17b190=_0xc68f('0x52');return db[_0xc68f('0x53')][_0xc68f('0x4d')]({'where':{'name':_0x17b190,'userProfileId':_0x483631[_0xc68f('0x54')]},'raw':!![]})[_0xc68f('0x29')](function(_0x5e36c7){if(_0x5e36c7&&_0x5e36c7[_0xc68f('0x55')]===0x0){return db[_0xc68f('0x2c')]['create']({'name':_0x26ac9a['name'],'resourceId':_0x26ac9a['id'],'type':_0x5e36c7[_0xc68f('0x2f')],'sectionId':_0x5e36c7['id']},{})[_0xc68f('0x29')](function(){return _0x237327;});}else{return _0x237327;}})[_0xc68f('0x4a')](function(_0x4f883a){logger[_0xc68f('0x2d')](_0xc68f('0x56'),_0x4f883a);throw _0x4f883a;});}return _0x237327;})['then'](respondWithResult(_0x45861f,0xc9))['catch'](handleError(_0x45861f,null));};exports[_0xc68f('0x28')]=function(_0x4281a5,_0x44b5ce){if(_0x4281a5[_0xc68f('0x57')]['id']){delete _0x4281a5[_0xc68f('0x57')]['id'];}return db[_0xc68f('0x45')][_0xc68f('0x4d')]({'where':{'id':_0x4281a5[_0xc68f('0x4c')]['id']}})[_0xc68f('0x29')](handleEntityNotFound(_0x44b5ce,null))[_0xc68f('0x29')](saveUpdates(_0x4281a5[_0xc68f('0x57')],null))[_0xc68f('0x29')](respondWithResult(_0x44b5ce,null))[_0xc68f('0x4a')](handleError(_0x44b5ce,null));};exports[_0xc68f('0x2a')]=function(_0x23ebdd,_0x1733fe){return db[_0xc68f('0x45')][_0xc68f('0x4d')]({'where':{'id':_0x23ebdd[_0xc68f('0x4c')]['id']}})[_0xc68f('0x29')](handleEntityNotFound(_0x1733fe,null))[_0xc68f('0x29')](removeEntity(_0x1733fe,null))['catch'](handleError(_0x1733fe,null));};exports['addUsers']=function(_0x10c4ea,_0x371316,_0x29c3e0){return db[_0xc68f('0x45')][_0xc68f('0x4d')]({'where':{'id':_0x10c4ea[_0xc68f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x371316,null))[_0xc68f('0x29')](function(_0x1e3c83){if(_0x1e3c83){return _0x1e3c83[_0xc68f('0x58')](_0x10c4ea['body'][_0xc68f('0x59')],_['omit'](_0x10c4ea[_0xc68f('0x57')],[_0xc68f('0x59'),'id'])||{});}})[_0xc68f('0x29')](respondWithResult(_0x371316,null))[_0xc68f('0x4a')](handleError(_0x371316,null));};exports[_0xc68f('0x5a')]=function(_0x527be7,_0x38f80a,_0x47b1ec){return db[_0xc68f('0x45')][_0xc68f('0x4d')]({'where':{'id':_0x527be7[_0xc68f('0x4c')]['id']}})[_0xc68f('0x29')](handleEntityNotFound(_0x38f80a,null))['then'](function(_0x4fc359){if(_0x4fc359){return _0x4fc359[_0xc68f('0x5a')](_0x527be7[_0xc68f('0x36')]['ids'])[_0xc68f('0x29')](function(){if(_['isArray'](_0x527be7[_0xc68f('0x36')][_0xc68f('0x59')])){for(var _0xde8c3=0x0;_0xde8c3<_0x527be7[_0xc68f('0x36')][_0xc68f('0x59')]['length'];_0xde8c3+=0x1){socket['emit'](_0xc68f('0x5b'),{'UserId':Number(_0x527be7[_0xc68f('0x36')][_0xc68f('0x59')][_0xde8c3]),'SquareProjectId':Number(_0x527be7[_0xc68f('0x4c')]['id'])});}}else{socket['emit'](_0xc68f('0x5b'),{'UserId':Number(_0x527be7[_0xc68f('0x36')][_0xc68f('0x59')]),'SquareProjectId':Number(_0x527be7[_0xc68f('0x4c')]['id'])});}});}})[_0xc68f('0x29')](respondWithStatusCode(_0x38f80a,null))[_0xc68f('0x4a')](handleError(_0x38f80a,null));};exports['getUsers']=function(_0xedc6df,_0x238b54,_0x52a18c){var _0x3689ec={};var _0x24618c={};var _0x5db68e;var _0x44ce7f;return db['SquareProject'][_0xc68f('0x5c')]({'where':{'id':_0xedc6df[_0xc68f('0x4c')]['id']}})[_0xc68f('0x29')](handleEntityNotFound(_0x238b54,null))[_0xc68f('0x29')](function(_0x5cdfb7){if(_0x5cdfb7){_0x5db68e=_0x5cdfb7;_0x24618c[_0xc68f('0x35')]=_['keys'](db['User'][_0xc68f('0x32')]);_0x24618c[_0xc68f('0x36')]=_[_0xc68f('0x5d')](_0xedc6df[_0xc68f('0x36')]);_0x24618c['filters']=_['intersection'](_0x24618c['model'],_0x24618c['query']);_0x3689ec[_0xc68f('0x3a')]=_[_0xc68f('0x38')](_0x24618c[_0xc68f('0x35')],qs[_0xc68f('0x39')](_0xedc6df[_0xc68f('0x36')][_0xc68f('0x39')]));_0x3689ec[_0xc68f('0x3a')]=_0x3689ec[_0xc68f('0x3a')][_0xc68f('0x3b')]?_0x3689ec['attributes']:_0x24618c['model'];_0x3689ec['order']=qs[_0xc68f('0x5e')](_0xedc6df[_0xc68f('0x36')][_0xc68f('0x5e')]);_0x3689ec['where']=qs['filters'](_[_0xc68f('0x40')](_0xedc6df['query'],_0x24618c[_0xc68f('0x37')]));if(_0xedc6df['query']['filter']){_0x3689ec[_0xc68f('0x3f')]=_[_0xc68f('0x43')](_0x3689ec[_0xc68f('0x3f')],{'$or':_[_0xc68f('0x31')](_0x3689ec[_0xc68f('0x3a')],function(_0x79409e){var _0x47e8ea={};_0x47e8ea[_0x79409e]={'$like':'%'+_0xedc6df['query'][_0xc68f('0x41')]+'%'};return _0x47e8ea;})});}_0x3689ec=_[_0xc68f('0x43')]({},_0x3689ec,_0xedc6df[_0xc68f('0x44')]);return _0x5db68e[_0xc68f('0x5f')](_0x3689ec);}})[_0xc68f('0x29')](function(_0x53d3c6){if(_0x53d3c6){_0x44ce7f=_0x53d3c6[_0xc68f('0x3b')];if(!_0xedc6df[_0xc68f('0x36')][_0xc68f('0x3c')](_0xc68f('0x3d'))){_0x3689ec[_0xc68f('0x22')]=qs['limit'](_0xedc6df[_0xc68f('0x36')][_0xc68f('0x22')]);_0x3689ec[_0xc68f('0x21')]=qs['offset'](_0xedc6df['query']['offset']);}return _0x5db68e[_0xc68f('0x5f')](_0x3689ec);}})[_0xc68f('0x29')](function(_0x23973e){if(_0x23973e){return _0x23973e?{'count':_0x44ce7f,'rows':_0x23973e}:null;}})[_0xc68f('0x29')](respondWithResult(_0x238b54,null))['catch'](handleError(_0x238b54,null));}; \ No newline at end of file +var _0x1cc7=['ioredis','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','./squareProject.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','html-pdf','eml-format','rimraf','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xdfb29a,_0x3443b5){var _0x52f21e=function(_0x56598e){while(--_0x56598e){_0xdfb29a['push'](_0xdfb29a['shift']());}};_0x52f21e(++_0x3443b5);}(_0x1cc7,0x15a));var _0x71cc=function(_0x271ae9,_0x568c73){_0x271ae9=_0x271ae9-0x0;var _0xef781c=_0x1cc7[_0x271ae9];return _0xef781c;};'use strict';var pdf=require(_0x71cc('0x0'));var emlformat=require(_0x71cc('0x1'));var rimraf=require(_0x71cc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71cc('0x3'));var BPromise=require(_0x71cc('0x4'));var Mustache=require(_0x71cc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x71cc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71cc('0x7'));var squel=require(_0x71cc('0x8'));var crypto=require(_0x71cc('0x9'));var jsforce=require(_0x71cc('0xa'));var deskjs=require(_0x71cc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x71cc('0xc'));var Papa=require(_0x71cc('0xd'));var Redis=require(_0x71cc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x71cc('0xf'))(_0x71cc('0x10'));var utils=require(_0x71cc('0x11'));var config=require('../../config/environment');var db=require(_0x71cc('0x12'))['db'];config['redis']=_[_0x71cc('0x13')](config['redis'],{'host':_0x71cc('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71cc('0x15')]));require(_0x71cc('0x16'))[_0x71cc('0x17')](socket);function respondWithStatusCode(_0xd16032,_0x33070e){_0x33070e=_0x33070e||0xcc;return function(_0x540200){if(_0x540200){return _0xd16032[_0x71cc('0x18')](_0x33070e);}return _0xd16032[_0x71cc('0x19')](_0x33070e)[_0x71cc('0x1a')]();};}function respondWithResult(_0x14d5ab,_0x3875b8){_0x3875b8=_0x3875b8||0xc8;return function(_0x14087c){if(_0x14087c){return _0x14d5ab[_0x71cc('0x19')](_0x3875b8)['json'](_0x14087c);}};}function respondWithFilteredResult(_0xf3c790,_0x14788d){return function(_0x1a7d71){if(_0x1a7d71){var _0x1d1da8=_0x1a7d71[_0x71cc('0x1b')],_0x1067be=_0x14788d[_0x71cc('0x1c')],_0x10da0a=_0x14788d['offset']+_0x14788d['limit'],_0x4c5c6d;if(_0x10da0a>=_0x1d1da8){_0x10da0a=_0x1d1da8;_0x4c5c6d=0xc8;}else{_0x4c5c6d=0xce;}_0xf3c790[_0x71cc('0x19')](_0x4c5c6d);return _0xf3c790[_0x71cc('0x1d')](_0x71cc('0x1e'),_0x1067be+'-'+_0x10da0a+'/'+_0x1d1da8)[_0x71cc('0x1f')](_0x1a7d71);}return null;};}function patchUpdates(_0x258d30){return function(_0xccbfb){try{jsonpatch[_0x71cc('0x20')](_0xccbfb,_0x258d30,!![]);}catch(_0x18683d){return BPromise['reject'](_0x18683d);}return _0xccbfb[_0x71cc('0x21')]();};}function saveUpdates(_0x109239,_0x587a0b){return function(_0x2bee90){if(_0x2bee90){return _0x2bee90[_0x71cc('0x22')](_0x109239)[_0x71cc('0x23')](function(_0x1a9b4f){return _0x1a9b4f;});}return null;};}function removeEntity(_0x1bc67c,_0x887399){return function(_0x4a0abc){if(_0x4a0abc){return _0x4a0abc[_0x71cc('0x24')]()[_0x71cc('0x23')](function(){var _0x446580=_0x4a0abc[_0x71cc('0x25')]({'plain':!![]});var _0x36367b=_0x71cc('0x26');return db[_0x71cc('0x27')][_0x71cc('0x24')]({'where':{'type':_0x36367b,'resourceId':_0x446580['id']}})[_0x71cc('0x23')](function(){return _0x4a0abc;});})['then'](function(){_0x1bc67c[_0x71cc('0x19')](0xcc)[_0x71cc('0x1a')]();});}};}function handleEntityNotFound(_0x28e095,_0x26becf){return function(_0x20b093){if(!_0x20b093){_0x28e095[_0x71cc('0x18')](0x194);}return _0x20b093;};}function handleError(_0x16fc33,_0x9a7ca3){_0x9a7ca3=_0x9a7ca3||0x1f4;return function(_0x3cc813){logger[_0x71cc('0x28')](_0x3cc813[_0x71cc('0x29')]);if(_0x3cc813[_0x71cc('0x2a')]){delete _0x3cc813[_0x71cc('0x2a')];}_0x16fc33[_0x71cc('0x19')](_0x9a7ca3)[_0x71cc('0x2b')](_0x3cc813);};}exports[_0x71cc('0x2c')]=function(_0x4fa63e,_0x3054ff){var _0x3b7451={},_0x34c6bc={},_0x184a51={'count':0x0,'rows':[]};var _0x11d0bc=_[_0x71cc('0x2d')](db['SquareProject'][_0x71cc('0x2e')],function(_0x11bd4e){return{'name':_0x11bd4e[_0x71cc('0x2f')],'type':_0x11bd4e[_0x71cc('0x30')][_0x71cc('0x31')]};});_0x34c6bc[_0x71cc('0x32')]=_[_0x71cc('0x2d')](_0x11d0bc,'name');_0x34c6bc[_0x71cc('0x33')]=_['keys'](_0x4fa63e['query']);_0x34c6bc[_0x71cc('0x34')]=_['intersection'](_0x34c6bc['model'],_0x34c6bc[_0x71cc('0x33')]);_0x3b7451['attributes']=_[_0x71cc('0x35')](_0x34c6bc['model'],qs[_0x71cc('0x36')](_0x4fa63e[_0x71cc('0x33')]['fields']));_0x3b7451[_0x71cc('0x37')]=_0x3b7451[_0x71cc('0x37')][_0x71cc('0x38')]?_0x3b7451[_0x71cc('0x37')]:_0x34c6bc[_0x71cc('0x32')];if(!_0x4fa63e[_0x71cc('0x33')][_0x71cc('0x39')](_0x71cc('0x3a'))){_0x3b7451[_0x71cc('0x3b')]=qs[_0x71cc('0x3b')](_0x4fa63e['query'][_0x71cc('0x3b')]);_0x3b7451['offset']=qs[_0x71cc('0x1c')](_0x4fa63e[_0x71cc('0x33')][_0x71cc('0x1c')]);}_0x3b7451[_0x71cc('0x3c')]=qs[_0x71cc('0x3d')](_0x4fa63e[_0x71cc('0x33')]['sort']);_0x3b7451[_0x71cc('0x3e')]=qs['filters'](_[_0x71cc('0x3f')](_0x4fa63e[_0x71cc('0x33')],_0x34c6bc[_0x71cc('0x34')]));if(_0x4fa63e['query'][_0x71cc('0x40')]){_0x3b7451['where']=_[_0x71cc('0x41')](_0x3b7451[_0x71cc('0x3e')],{'$or':_[_0x71cc('0x2d')](_0x11d0bc,function(_0x92389){if(_0x92389[_0x71cc('0x30')]!==_0x71cc('0x42')){var _0x104aee={};_0x104aee[_0x92389[_0x71cc('0x2a')]]={'$like':'%'+_0x4fa63e[_0x71cc('0x33')][_0x71cc('0x40')]+'%'};return _0x104aee;}})});}_0x3b7451=_[_0x71cc('0x41')]({},_0x3b7451,_0x4fa63e[_0x71cc('0x43')]);var _0x4f0bb0={'where':_0x3b7451[_0x71cc('0x3e')]};return db[_0x71cc('0x44')]['count'](_0x4f0bb0)['then'](function(_0x463cdd){_0x184a51[_0x71cc('0x1b')]=_0x463cdd;if(_0x4fa63e['query'][_0x71cc('0x45')]){_0x3b7451[_0x71cc('0x46')]=[{'all':!![]}];}return db[_0x71cc('0x44')][_0x71cc('0x47')](_0x3b7451);})[_0x71cc('0x23')](function(_0x5b3a38){_0x184a51['rows']=_0x5b3a38;return _0x184a51;})['then'](respondWithFilteredResult(_0x3054ff,_0x3b7451))[_0x71cc('0x48')](handleError(_0x3054ff,null));};exports['show']=function(_0x3bd7d0,_0x38ef60){var _0x70cd0e={'raw':![],'where':{'id':_0x3bd7d0[_0x71cc('0x49')]['id']}},_0x218558={};_0x218558[_0x71cc('0x32')]=_[_0x71cc('0x4a')](db[_0x71cc('0x44')][_0x71cc('0x2e')]);_0x218558[_0x71cc('0x33')]=_[_0x71cc('0x4a')](_0x3bd7d0[_0x71cc('0x33')]);_0x218558[_0x71cc('0x34')]=_['intersection'](_0x218558[_0x71cc('0x32')],_0x218558[_0x71cc('0x33')]);_0x70cd0e[_0x71cc('0x37')]=_['intersection'](_0x218558[_0x71cc('0x32')],qs[_0x71cc('0x36')](_0x3bd7d0[_0x71cc('0x33')][_0x71cc('0x36')]));_0x70cd0e[_0x71cc('0x37')]=_0x70cd0e[_0x71cc('0x37')][_0x71cc('0x38')]?_0x70cd0e[_0x71cc('0x37')]:_0x218558[_0x71cc('0x32')];if(_0x3bd7d0[_0x71cc('0x33')][_0x71cc('0x45')]){_0x70cd0e[_0x71cc('0x46')]=[{'all':!![]}];}_0x70cd0e=_['merge']({},_0x70cd0e,_0x3bd7d0[_0x71cc('0x43')]);return db[_0x71cc('0x44')][_0x71cc('0x4b')](_0x70cd0e)[_0x71cc('0x23')](handleEntityNotFound(_0x38ef60,null))[_0x71cc('0x23')](respondWithResult(_0x38ef60,null))[_0x71cc('0x48')](handleError(_0x38ef60,null));};exports[_0x71cc('0x4c')]=function(_0x51cd49,_0x108e3f){return db[_0x71cc('0x44')]['create'](_0x51cd49[_0x71cc('0x4d')],{})[_0x71cc('0x23')](function(_0x1bda7f){var _0xe6b3db=_0x51cd49[_0x71cc('0x4e')][_0x71cc('0x25')]({'plain':!![]});if(!_0xe6b3db)throw new Error(_0x71cc('0x4f'));if(_0xe6b3db[_0x71cc('0x50')]===_0x71cc('0x4e')){var _0x1647ce=_0x1bda7f[_0x71cc('0x25')]({'plain':!![]});var _0x580c21=_0x71cc('0x26');return db['UserProfileSection'][_0x71cc('0x4b')]({'where':{'name':_0x580c21,'userProfileId':_0xe6b3db['userProfileId']},'raw':!![]})[_0x71cc('0x23')](function(_0x36c71e){if(_0x36c71e&&_0x36c71e['autoAssociation']===0x0){return db[_0x71cc('0x27')][_0x71cc('0x4c')]({'name':_0x1647ce['name'],'resourceId':_0x1647ce['id'],'type':_0x36c71e[_0x71cc('0x2a')],'sectionId':_0x36c71e['id']},{})[_0x71cc('0x23')](function(){return _0x1bda7f;});}else{return _0x1bda7f;}})[_0x71cc('0x48')](function(_0x1f0673){logger[_0x71cc('0x28')](_0x71cc('0x51'),_0x1f0673);throw _0x1f0673;});}return _0x1bda7f;})[_0x71cc('0x23')](respondWithResult(_0x108e3f,0xc9))['catch'](handleError(_0x108e3f,null));};exports[_0x71cc('0x22')]=function(_0xdc11f2,_0x570f87){if(_0xdc11f2['body']['id']){delete _0xdc11f2[_0x71cc('0x4d')]['id'];}return db[_0x71cc('0x44')]['find']({'where':{'id':_0xdc11f2[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0x570f87,null))[_0x71cc('0x23')](saveUpdates(_0xdc11f2[_0x71cc('0x4d')],null))[_0x71cc('0x23')](respondWithResult(_0x570f87,null))[_0x71cc('0x48')](handleError(_0x570f87,null));};exports['destroy']=function(_0x49cd24,_0x211dbf){return db['SquareProject']['find']({'where':{'id':_0x49cd24[_0x71cc('0x49')]['id']}})['then'](handleEntityNotFound(_0x211dbf,null))['then'](removeEntity(_0x211dbf,null))['catch'](handleError(_0x211dbf,null));};exports['addUsers']=function(_0x572c62,_0x32999d,_0x4b5587){return db['SquareProject'][_0x71cc('0x4b')]({'where':{'id':_0x572c62[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0x32999d,null))[_0x71cc('0x23')](function(_0x2b108e){if(_0x2b108e){return _0x2b108e[_0x71cc('0x52')](_0x572c62['body']['ids'],_['omit'](_0x572c62[_0x71cc('0x4d')],[_0x71cc('0x53'),'id'])||{});}})[_0x71cc('0x23')](respondWithResult(_0x32999d,null))[_0x71cc('0x48')](handleError(_0x32999d,null));};exports[_0x71cc('0x54')]=function(_0x5b1560,_0xcd78b5,_0xca3919){return db['SquareProject']['find']({'where':{'id':_0x5b1560[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0xcd78b5,null))['then'](function(_0x5484c9){if(_0x5484c9){return _0x5484c9[_0x71cc('0x54')](_0x5b1560['query']['ids'])[_0x71cc('0x23')](function(){if(_[_0x71cc('0x55')](_0x5b1560[_0x71cc('0x33')]['ids'])){for(var _0x35e963=0x0;_0x35e963<_0x5b1560[_0x71cc('0x33')][_0x71cc('0x53')]['length'];_0x35e963+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x5b1560[_0x71cc('0x33')][_0x71cc('0x53')][_0x35e963]),'SquareProjectId':Number(_0x5b1560[_0x71cc('0x49')]['id'])});}}else{socket[_0x71cc('0x56')](_0x71cc('0x57'),{'UserId':Number(_0x5b1560[_0x71cc('0x33')]['ids']),'SquareProjectId':Number(_0x5b1560['params']['id'])});}});}})[_0x71cc('0x23')](respondWithStatusCode(_0xcd78b5,null))[_0x71cc('0x48')](handleError(_0xcd78b5,null));};exports[_0x71cc('0x58')]=function(_0x1c60f0,_0x355f28,_0x22b8ac){var _0x1f8649={};var _0x220b8f={};var _0x471cb7;var _0x17ecd1;return db['SquareProject']['findOne']({'where':{'id':_0x1c60f0[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0x355f28,null))[_0x71cc('0x23')](function(_0x2d05b5){if(_0x2d05b5){_0x471cb7=_0x2d05b5;_0x220b8f[_0x71cc('0x32')]=_[_0x71cc('0x4a')](db[_0x71cc('0x59')][_0x71cc('0x2e')]);_0x220b8f[_0x71cc('0x33')]=_['keys'](_0x1c60f0[_0x71cc('0x33')]);_0x220b8f[_0x71cc('0x34')]=_[_0x71cc('0x35')](_0x220b8f[_0x71cc('0x32')],_0x220b8f['query']);_0x1f8649['attributes']=_[_0x71cc('0x35')](_0x220b8f[_0x71cc('0x32')],qs[_0x71cc('0x36')](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x36')]));_0x1f8649['attributes']=_0x1f8649['attributes'][_0x71cc('0x38')]?_0x1f8649[_0x71cc('0x37')]:_0x220b8f['model'];_0x1f8649[_0x71cc('0x3c')]=qs[_0x71cc('0x3d')](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x3d')]);_0x1f8649['where']=qs['filters'](_['pick'](_0x1c60f0[_0x71cc('0x33')],_0x220b8f[_0x71cc('0x34')]));if(_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x40')]){_0x1f8649[_0x71cc('0x3e')]=_[_0x71cc('0x41')](_0x1f8649[_0x71cc('0x3e')],{'$or':_[_0x71cc('0x2d')](_0x1f8649[_0x71cc('0x37')],function(_0x2248d5){var _0x53bf3c={};_0x53bf3c[_0x2248d5]={'$like':'%'+_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x40')]+'%'};return _0x53bf3c;})});}_0x1f8649=_[_0x71cc('0x41')]({},_0x1f8649,_0x1c60f0[_0x71cc('0x43')]);return _0x471cb7['getUsers'](_0x1f8649);}})['then'](function(_0x434475){if(_0x434475){_0x17ecd1=_0x434475[_0x71cc('0x38')];if(!_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x39')](_0x71cc('0x3a'))){_0x1f8649[_0x71cc('0x3b')]=qs['limit'](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x3b')]);_0x1f8649['offset']=qs['offset'](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x1c')]);}return _0x471cb7[_0x71cc('0x58')](_0x1f8649);}})[_0x71cc('0x23')](function(_0x48d807){if(_0x48d807){return _0x48d807?{'count':_0x17ecd1,'rows':_0x48d807}:null;}})['then'](respondWithResult(_0x355f28,null))['catch'](handleError(_0x355f28,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 84a2726..0af64fa 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 _0xb0fc=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xb0fc,0xf6));var _0xcb0f=function(_0x43a74a,_0x846237){_0x43a74a=_0x43a74a-0x0;var _0x35744a=_0xb0fc[_0x43a74a];return _0x35744a;};'use strict';var EventEmitter=require(_0xcb0f('0x0'));var SquareProject=require(_0xcb0f('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcb0f('0x2')](0x0);var events={'afterCreate':_0xcb0f('0x3'),'afterUpdate':_0xcb0f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2c16cf){return function(_0x796529,_0x168c36,_0x4f6513){SquareProjectEvents['emit'](_0x2c16cf+':'+_0x796529['id'],_0x796529);SquareProjectEvents[_0xcb0f('0x5')](_0x2c16cf,_0x796529);_0x4f6513(null);};}for(var e in events){if(events[_0xcb0f('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xcb0f('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x833b=['setMaxListeners','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x164c4a,_0x5ac2da){var _0xd3855c=function(_0x5b99c8){while(--_0x5b99c8){_0x164c4a['push'](_0x164c4a['shift']());}};_0xd3855c(++_0x5ac2da);}(_0x833b,0x131));var _0xb833=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x833b[_0x4fbfd9];return _0x31dc94;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb833('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb833('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb833('0x2'),'afterDestroy':'remove'};function emitEvent(_0x66e74c){return function(_0x37ea87,_0x1f9d90,_0x181a4e){SquareProjectEvents[_0xb833('0x3')](_0x66e74c+':'+_0x37ea87['id'],_0x37ea87);SquareProjectEvents[_0xb833('0x3')](_0x66e74c,_0x37ea87);_0x181a4e(null);};}for(var e in events){if(events[_0xb833('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xb833('0x5')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 080512b..4b7a39c 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 _0xa85a=['SquareProject','square_projects','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x30cc1f,_0x7c7185){var _0x1e12d7=function(_0x3d9176){while(--_0x3d9176){_0x30cc1f['push'](_0x30cc1f['shift']());}};_0x1e12d7(++_0x7c7185);}(_0xa85a,0x84));var _0xaa85=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xa85a[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xaa85('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa85('0x1'));var moment=require(_0xaa85('0x2'));var BPromise=require(_0xaa85('0x3'));var rp=require(_0xaa85('0x4'));var fs=require('fs');var path=require(_0xaa85('0x5'));var rimraf=require(_0xaa85('0x6'));var config=require(_0xaa85('0x7'));var attributes=require(_0xaa85('0x8'));module[_0xaa85('0x9')]=function(_0x4126c8,_0x317a03){return _0x4126c8[_0xaa85('0xa')](_0xaa85('0xb'),attributes,{'tableName':_0xaa85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd006=['exports','define','SquareProject','square_projects','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2b0acc,_0x4ae9d9){var _0x4d2cfb=function(_0x45a5c8){while(--_0x45a5c8){_0x2b0acc['push'](_0x2b0acc['shift']());}};_0x4d2cfb(++_0x4ae9d9);}(_0xd006,0x19b));var _0x6d00=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0xd006[_0x286bfb];return _0x52b683;};'use strict';var _=require(_0x6d00('0x0'));var util=require('util');var logger=require(_0x6d00('0x1'))(_0x6d00('0x2'));var moment=require(_0x6d00('0x3'));var BPromise=require(_0x6d00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d00('0x5'));var config=require(_0x6d00('0x6'));var attributes=require('./squareProject.attributes');module[_0x6d00('0x7')]=function(_0x2909ae,_0x6e7498){return _0x2909ae[_0x6d00('0x8')](_0x6d00('0x9'),attributes,{'tableName':_0x6d00('0xa'),'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 76c8789..39ee60f 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 _0x7e19=['localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareProject','find','options','raw','where','attributes','include','map','model','ShowSquareProject','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x36622f,_0x40cac0){var _0x40d12a=function(_0x104b47){while(--_0x104b47){_0x36622f['push'](_0x36622f['shift']());}};_0x40d12a(++_0x40cac0);}(_0x7e19,0x92));var _0x97e1=function(_0xadd1d0,_0x47cae8){_0xadd1d0=_0xadd1d0-0x0;var _0x2d9141=_0x7e19[_0xadd1d0];return _0x2d9141;};'use strict';var _=require(_0x97e1('0x0'));var util=require(_0x97e1('0x1'));var moment=require('moment');var BPromise=require(_0x97e1('0x2'));var rs=require(_0x97e1('0x3'));var fs=require('fs');var Redis=require(_0x97e1('0x4'));var db=require(_0x97e1('0x5'))['db'];var utils=require(_0x97e1('0x6'));var logger=require(_0x97e1('0x7'))(_0x97e1('0x8'));var config=require(_0x97e1('0x9'));var jayson=require(_0x97e1('0xa'));var client=jayson[_0x97e1('0xb')][_0x97e1('0xc')]({'port':0x232a});config[_0x97e1('0xd')]=_['defaults'](config['redis'],{'host':_0x97e1('0xe'),'port':0x18eb});var socket=require(_0x97e1('0xf'))(new Redis(config[_0x97e1('0xd')]));require(_0x97e1('0x10'))[_0x97e1('0x11')](socket);function respondWithRpcPromise(_0x5d0c1e,_0x16fcdc,_0x54e2ea){return new BPromise(function(_0xf76e5d,_0x4c5f2e){return client[_0x97e1('0x12')](_0x5d0c1e,_0x54e2ea)['then'](function(_0x48eb7e){logger[_0x97e1('0x13')](_0x97e1('0x14'),_0x16fcdc,_0x97e1('0x15'));logger[_0x97e1('0x16')](_0x97e1('0x17'),_0x16fcdc,_0x97e1('0x15'),JSON[_0x97e1('0x18')](_0x48eb7e));if(_0x48eb7e[_0x97e1('0x19')]){if(_0x48eb7e[_0x97e1('0x19')][_0x97e1('0x1a')]===0x1f4){logger[_0x97e1('0x19')]('SquareProject,\x20%s,\x20%s',_0x16fcdc,_0x48eb7e[_0x97e1('0x19')][_0x97e1('0x1b')]);return _0x4c5f2e(_0x48eb7e[_0x97e1('0x19')]['message']);}logger[_0x97e1('0x19')](_0x97e1('0x14'),_0x16fcdc,_0x48eb7e['error'][_0x97e1('0x1b')]);return _0xf76e5d(_0x48eb7e[_0x97e1('0x19')][_0x97e1('0x1b')]);}else{logger[_0x97e1('0x13')](_0x97e1('0x14'),_0x16fcdc,_0x97e1('0x15'));_0xf76e5d(_0x48eb7e[_0x97e1('0x1c')][_0x97e1('0x1b')]);}})[_0x97e1('0x1d')](function(_0x24b1ad){logger['error'](_0x97e1('0x14'),_0x16fcdc,_0x24b1ad);_0x4c5f2e(_0x24b1ad);});});}exports['ShowSquareProject']=function(_0x21e4cb){var _0x26e681=this;return new Promise(function(_0x4f5576,_0x380aed){return db[_0x97e1('0x1e')][_0x97e1('0x1f')]({'raw':_0x21e4cb['options']?_0x21e4cb[_0x97e1('0x20')][_0x97e1('0x21')]===undefined?!![]:![]:!![],'where':_0x21e4cb[_0x97e1('0x20')]?_0x21e4cb['options'][_0x97e1('0x22')]||null:null,'attributes':_0x21e4cb[_0x97e1('0x20')]?_0x21e4cb[_0x97e1('0x20')][_0x97e1('0x23')]||null:null,'include':_0x21e4cb[_0x97e1('0x20')]?_0x21e4cb[_0x97e1('0x20')][_0x97e1('0x24')]?_[_0x97e1('0x25')](_0x21e4cb[_0x97e1('0x20')][_0x97e1('0x24')],function(_0x2d1359){return{'model':db[_0x2d1359[_0x97e1('0x26')]],'as':_0x2d1359['as'],'attributes':_0x2d1359['attributes'],'include':_0x2d1359['include']?_[_0x97e1('0x25')](_0x2d1359['include'],function(_0x506983){return{'model':db[_0x506983[_0x97e1('0x26')]],'as':_0x506983['as'],'attributes':_0x506983['attributes'],'include':_0x506983[_0x97e1('0x24')]?_[_0x97e1('0x25')](_0x506983[_0x97e1('0x24')],function(_0x242de3){return{'model':db[_0x242de3[_0x97e1('0x26')]],'as':_0x242de3['as'],'attributes':_0x242de3[_0x97e1('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x389f59){logger['info'](_0x97e1('0x27'),_0x21e4cb);logger['debug'](_0x97e1('0x27'),_0x21e4cb,JSON[_0x97e1('0x18')](_0x389f59));_0x4f5576(_0x389f59);})[_0x97e1('0x1d')](function(_0xf4b07b){logger[_0x97e1('0x19')]('ShowSquareProject',_0xf4b07b[_0x97e1('0x1b')],_0x21e4cb);_0x380aed(_0x26e681['error'](0x1f4,_0xf4b07b['message']));});});}; \ No newline at end of file +var _0x7edb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./squareProject.socket','register','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareProject','SquareProject','find','options','raw','where','include','map','model','attributes','then','lodash','util'];(function(_0x15034b,_0x4b8880){var _0x2cc477=function(_0x570b33){while(--_0x570b33){_0x15034b['push'](_0x15034b['shift']());}};_0x2cc477(++_0x4b8880);}(_0x7edb,0x1d2));var _0xb7ed=function(_0x2b6426,_0x3a72a9){_0x2b6426=_0x2b6426-0x0;var _0x4e2c28=_0x7edb[_0x2b6426];return _0x4e2c28;};'use strict';var _=require(_0xb7ed('0x0'));var util=require(_0xb7ed('0x1'));var moment=require(_0xb7ed('0x2'));var BPromise=require(_0xb7ed('0x3'));var rs=require(_0xb7ed('0x4'));var fs=require('fs');var Redis=require(_0xb7ed('0x5'));var db=require(_0xb7ed('0x6'))['db'];var utils=require(_0xb7ed('0x7'));var logger=require(_0xb7ed('0x8'))(_0xb7ed('0x9'));var config=require(_0xb7ed('0xa'));var jayson=require(_0xb7ed('0xb'));var client=jayson[_0xb7ed('0xc')][_0xb7ed('0xd')]({'port':0x232a});config[_0xb7ed('0xe')]=_['defaults'](config['redis'],{'host':_0xb7ed('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7ed('0xe')]));require(_0xb7ed('0x10'))[_0xb7ed('0x11')](socket);function respondWithRpcPromise(_0x39993e,_0x42adf3,_0x1be407){return new BPromise(function(_0x45c719,_0x4f6047){return client['request'](_0x39993e,_0x1be407)['then'](function(_0x49431a){logger[_0xb7ed('0x12')](_0xb7ed('0x13'),_0x42adf3,_0xb7ed('0x14'));logger[_0xb7ed('0x15')](_0xb7ed('0x16'),_0x42adf3,_0xb7ed('0x14'),JSON[_0xb7ed('0x17')](_0x49431a));if(_0x49431a[_0xb7ed('0x18')]){if(_0x49431a[_0xb7ed('0x18')][_0xb7ed('0x19')]===0x1f4){logger[_0xb7ed('0x18')](_0xb7ed('0x13'),_0x42adf3,_0x49431a[_0xb7ed('0x18')][_0xb7ed('0x1a')]);return _0x4f6047(_0x49431a['error']['message']);}logger[_0xb7ed('0x18')](_0xb7ed('0x13'),_0x42adf3,_0x49431a[_0xb7ed('0x18')][_0xb7ed('0x1a')]);return _0x45c719(_0x49431a[_0xb7ed('0x18')][_0xb7ed('0x1a')]);}else{logger[_0xb7ed('0x12')](_0xb7ed('0x13'),_0x42adf3,'request\x20sent');_0x45c719(_0x49431a[_0xb7ed('0x1b')][_0xb7ed('0x1a')]);}})['catch'](function(_0x5bec47){logger[_0xb7ed('0x18')](_0xb7ed('0x13'),_0x42adf3,_0x5bec47);_0x4f6047(_0x5bec47);});});}exports[_0xb7ed('0x1c')]=function(_0x256588){var _0x5d76d8=this;return new Promise(function(_0x124c5a,_0x19624b){return db[_0xb7ed('0x1d')][_0xb7ed('0x1e')]({'raw':_0x256588[_0xb7ed('0x1f')]?_0x256588[_0xb7ed('0x1f')][_0xb7ed('0x20')]===undefined?!![]:![]:!![],'where':_0x256588[_0xb7ed('0x1f')]?_0x256588[_0xb7ed('0x1f')][_0xb7ed('0x21')]||null:null,'attributes':_0x256588[_0xb7ed('0x1f')]?_0x256588[_0xb7ed('0x1f')]['attributes']||null:null,'include':_0x256588[_0xb7ed('0x1f')]?_0x256588['options'][_0xb7ed('0x22')]?_[_0xb7ed('0x23')](_0x256588[_0xb7ed('0x1f')]['include'],function(_0x14d71c){return{'model':db[_0x14d71c[_0xb7ed('0x24')]],'as':_0x14d71c['as'],'attributes':_0x14d71c[_0xb7ed('0x25')],'include':_0x14d71c[_0xb7ed('0x22')]?_['map'](_0x14d71c[_0xb7ed('0x22')],function(_0x451387){return{'model':db[_0x451387[_0xb7ed('0x24')]],'as':_0x451387['as'],'attributes':_0x451387[_0xb7ed('0x25')],'include':_0x451387[_0xb7ed('0x22')]?_['map'](_0x451387[_0xb7ed('0x22')],function(_0x3b8b99){return{'model':db[_0x3b8b99[_0xb7ed('0x24')]],'as':_0x3b8b99['as'],'attributes':_0x3b8b99['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7ed('0x26')](function(_0x4b2614){logger['info'](_0xb7ed('0x1c'),_0x256588);logger[_0xb7ed('0x15')](_0xb7ed('0x1c'),_0x256588,JSON[_0xb7ed('0x17')](_0x4b2614));_0x124c5a(_0x4b2614);})['catch'](function(_0x181c78){logger[_0xb7ed('0x18')](_0xb7ed('0x1c'),_0x181c78[_0xb7ed('0x1a')],_0x256588);_0x19624b(_0x5d76d8[_0xb7ed('0x18')](0x1f4,_0x181c78[_0xb7ed('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 9691b73..560acfe 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 _0x9536=['length','./squareProject.events','save','remove','update','emit','removeListener','register'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x9536,0x179));var _0x6953=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9536[_0x3b380d];return _0x54502b;};'use strict';var SquareProjectEvents=require(_0x6953('0x0'));var events=[_0x6953('0x1'),_0x6953('0x2'),_0x6953('0x3')];function createListener(_0x4d218f,_0xc3e4dd){return function(_0x53b172){_0xc3e4dd[_0x6953('0x4')](_0x4d218f,_0x53b172);};}function removeListener(_0x3c32c7,_0x1dee7c){return function(){SquareProjectEvents[_0x6953('0x5')](_0x3c32c7,_0x1dee7c);};}exports[_0x6953('0x6')]=function(_0x494ac2){for(var _0x2b273e=0x0,_0x2bb026=events[_0x6953('0x7')];_0x2b273e<_0x2bb026;_0x2b273e++){var _0x3e1aff=events[_0x2b273e];var _0x1c8225=createListener('squareProject:'+_0x3e1aff,_0x494ac2);SquareProjectEvents['on'](_0x3e1aff,_0x1c8225);}}; \ No newline at end of file +var _0x4137=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x179170,_0x414a7a){var _0x2e0aac=function(_0x32ca3f){while(--_0x32ca3f){_0x179170['push'](_0x179170['shift']());}};_0x2e0aac(++_0x414a7a);}(_0x4137,0xf8));var _0x7413=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4137[_0x40a045];return _0x1a687c;};'use strict';var SquareProjectEvents=require(_0x7413('0x0'));var events=[_0x7413('0x1'),_0x7413('0x2'),_0x7413('0x3')];function createListener(_0x392ebc,_0x410971){return function(_0x2e6df7){_0x410971[_0x7413('0x4')](_0x392ebc,_0x2e6df7);};}function removeListener(_0x258255,_0x3dc48a){return function(){SquareProjectEvents[_0x7413('0x5')](_0x258255,_0x3dc48a);};}exports[_0x7413('0x6')]=function(_0x4fbade){for(var _0xc808cd=0x0,_0x188d89=events[_0x7413('0x7')];_0xc808cd<_0x188d89;_0xc808cd++){var _0x15af0d=events[_0xc808cd];var _0x5f4cd0=createListener(_0x7413('0x8')+_0x15af0d,_0x4fbade);SquareProjectEvents['on'](_0x15af0d,_0x5f4cd0);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 34b2ca4..d2c8a68 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 _0x2ef3=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1e24b1,_0x14ab30){var _0x212baf=function(_0x2bd3e9){while(--_0x2bd3e9){_0x1e24b1['push'](_0x1e24b1['shift']());}};_0x212baf(++_0x14ab30);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f6970,_0x47b644){_0x1f6970=_0x1f6970-0x0;var _0x145efa=_0x2ef3[_0x1f6970];return _0x145efa;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./squareRecording.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['put']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')](_0x32ef('0xa'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdb28=['download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download'];(function(_0x26d016,_0x14d83d){var _0x14bdbb=function(_0x80f52e){while(--_0x80f52e){_0x26d016['push'](_0x26d016['shift']());}};_0x14bdbb(++_0x14d83d);}(_0xdb28,0x106));var _0x8db2=function(_0x3a5f79,_0x27c2c5){_0x3a5f79=_0x3a5f79-0x0;var _0x3ff6ec=_0xdb28[_0x3a5f79];return _0x3ff6ec;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xf')]('/',auth['isAuthenticated'](),controller[_0x8db2('0x10')]);router[_0x8db2('0x11')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0x15')]);module[_0x8db2('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 74bb616..8fdfc5c 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 _0x7633=['STRING','sequelize'];(function(_0x38f609,_0x2d60f4){var _0x39b734=function(_0x5204fe){while(--_0x5204fe){_0x38f609['push'](_0x38f609['shift']());}};_0x39b734(++_0x2d60f4);}(_0x7633,0x99));var _0x3763=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7633[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3763('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3763('0x1')]},'callerid':{'type':Sequelize[_0x3763('0x1')]},'calleridname':{'type':Sequelize[_0x3763('0x1')]},'context':{'type':Sequelize[_0x3763('0x1')]},'extension':{'type':Sequelize[_0x3763('0x1')]},'priority':{'type':Sequelize[_0x3763('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x3763('0x1')]},'saveName':{'type':Sequelize[_0x3763('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x3763('0x1')]}}; \ No newline at end of file +var _0x6e8c=['sequelize','exports','STRING'];(function(_0xb0f4d2,_0x44b5e6){var _0x4b2409=function(_0x1cea4a){while(--_0x1cea4a){_0xb0f4d2['push'](_0xb0f4d2['shift']());}};_0x4b2409(++_0x44b5e6);}(_0x6e8c,0x14d));var _0xc6e8=function(_0x3dbf53,_0x1aea84){_0x3dbf53=_0x3dbf53-0x0;var _0x351045=_0x6e8c[_0x3dbf53];return _0x351045;};'use strict';var Sequelize=require(_0xc6e8('0x0'));module[_0xc6e8('0x1')]={'uniqueid':{'type':Sequelize[_0xc6e8('0x2')]},'callerid':{'type':Sequelize[_0xc6e8('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc6e8('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc6e8('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xc6e8('0x2')]},'saveName':{'type':Sequelize[_0xc6e8('0x2')]},'filename':{'type':Sequelize[_0xc6e8('0x2')]},'savePath':{'type':Sequelize[_0xc6e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index b9c20f7..1f69389 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 _0x3c81=['sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SquareRecording','include','findAll','rows','catch','show','params','filters','create','body','find','destroy','../../components/encryptor','uniqueid','filename','format','existsSync','secrets','recording','savePath','download','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','util','path'];(function(_0x51aa5b,_0x512fc0){var _0x5066d8=function(_0x2bdda9){while(--_0x2bdda9){_0x51aa5b['push'](_0x51aa5b['shift']());}};_0x5066d8(++_0x512fc0);}(_0x3c81,0x102));var _0x13c8=function(_0x5b4c2e,_0xe1bd9e){_0x5b4c2e=_0x5b4c2e-0x0;var _0x2d3f9e=_0x3c81[_0x5b4c2e];return _0x2d3f9e;};'use strict';var pdf=require(_0x13c8('0x0'));var emlformat=require(_0x13c8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x13c8('0x2'));var jsonpatch=require(_0x13c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13c8('0x4'));var path=require(_0x13c8('0x5'));var sox=require(_0x13c8('0x6'));var csv=require(_0x13c8('0x7'));var ejs=require(_0x13c8('0x8'));var fs=require('fs');var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x7'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var db=require(_0x13c8('0x17'))['db'];function respondWithStatusCode(_0x48c171,_0x5ab91d){_0x5ab91d=_0x5ab91d||0xcc;return function(_0x21442d){if(_0x21442d){return _0x48c171[_0x13c8('0x18')](_0x5ab91d);}return _0x48c171[_0x13c8('0x19')](_0x5ab91d)[_0x13c8('0x1a')]();};}function respondWithResult(_0x4a077c,_0x42955d){_0x42955d=_0x42955d||0xc8;return function(_0x515681){if(_0x515681){return _0x4a077c['status'](_0x42955d)['json'](_0x515681);}};}function respondWithFilteredResult(_0x126359,_0x5e0e06){return function(_0x337397){if(_0x337397){var _0x17a3c1=_0x337397[_0x13c8('0x1b')],_0x23f64e=_0x5e0e06[_0x13c8('0x1c')],_0x7cbfb=_0x5e0e06[_0x13c8('0x1c')]+_0x5e0e06[_0x13c8('0x1d')],_0x5d7906;if(_0x7cbfb>=_0x17a3c1){_0x7cbfb=_0x17a3c1;_0x5d7906=0xc8;}else{_0x5d7906=0xce;}_0x126359[_0x13c8('0x19')](_0x5d7906);return _0x126359[_0x13c8('0x1e')](_0x13c8('0x1f'),_0x23f64e+'-'+_0x7cbfb+'/'+_0x17a3c1)[_0x13c8('0x20')](_0x337397);}return null;};}function patchUpdates(_0x34fbc0){return function(_0x31d122){try{jsonpatch[_0x13c8('0x21')](_0x31d122,_0x34fbc0,!![]);}catch(_0x5ac776){return BPromise[_0x13c8('0x22')](_0x5ac776);}return _0x31d122[_0x13c8('0x23')]();};}function saveUpdates(_0x1d1686,_0x313ea3){return function(_0x513085){if(_0x513085){return _0x513085[_0x13c8('0x24')](_0x1d1686)[_0x13c8('0x25')](function(_0x3e3951){return _0x3e3951;});}return null;};}function removeEntity(_0x1f60ed,_0x436d5d){return function(_0x2fc123){if(_0x2fc123){return _0x2fc123['destroy']()[_0x13c8('0x25')](function(){_0x1f60ed[_0x13c8('0x19')](0xcc)[_0x13c8('0x1a')]();});}};}function handleEntityNotFound(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(!_0x1770e5){_0xcf41d2[_0x13c8('0x18')](0x194);}return _0x1770e5;};}function handleError(_0x4e392f,_0x49b552){_0x49b552=_0x49b552||0x1f4;return function(_0x3b4fd8){logger[_0x13c8('0x26')](_0x3b4fd8['stack']);if(_0x3b4fd8['name']){delete _0x3b4fd8[_0x13c8('0x27')];}_0x4e392f[_0x13c8('0x19')](_0x49b552)['send'](_0x3b4fd8);};}exports['index']=function(_0x196983,_0x596166){var _0x545b47={},_0x1c7dc4={},_0x6c2dc8={'count':0x0,'rows':[]};var _0x34fdbe=_['map'](db['SquareRecording'][_0x13c8('0x28')],function(_0x1071a0){return{'name':_0x1071a0[_0x13c8('0x29')],'type':_0x1071a0[_0x13c8('0x2a')][_0x13c8('0x2b')]};});_0x1c7dc4[_0x13c8('0x2c')]=_[_0x13c8('0x2d')](_0x34fdbe,'name');_0x1c7dc4[_0x13c8('0x2e')]=_[_0x13c8('0x2f')](_0x196983['query']);_0x1c7dc4['filters']=_[_0x13c8('0x30')](_0x1c7dc4[_0x13c8('0x2c')],_0x1c7dc4['query']);_0x545b47[_0x13c8('0x31')]=_[_0x13c8('0x30')](_0x1c7dc4['model'],qs[_0x13c8('0x32')](_0x196983[_0x13c8('0x2e')][_0x13c8('0x32')]));_0x545b47[_0x13c8('0x31')]=_0x545b47[_0x13c8('0x31')][_0x13c8('0x33')]?_0x545b47[_0x13c8('0x31')]:_0x1c7dc4[_0x13c8('0x2c')];if(!_0x196983['query']['hasOwnProperty'](_0x13c8('0x34'))){_0x545b47[_0x13c8('0x1d')]=qs['limit'](_0x196983[_0x13c8('0x2e')]['limit']);_0x545b47[_0x13c8('0x1c')]=qs['offset'](_0x196983[_0x13c8('0x2e')][_0x13c8('0x1c')]);}_0x545b47[_0x13c8('0x35')]=qs[_0x13c8('0x36')](_0x196983[_0x13c8('0x2e')][_0x13c8('0x36')]);_0x545b47[_0x13c8('0x37')]=qs['filters'](_[_0x13c8('0x38')](_0x196983[_0x13c8('0x2e')],_0x1c7dc4['filters']));if(_0x196983[_0x13c8('0x2e')][_0x13c8('0x39')]){_0x545b47[_0x13c8('0x37')]=_['merge'](_0x545b47['where'],{'$or':_['map'](_0x34fdbe,function(_0x2776c0){if(_0x2776c0[_0x13c8('0x2a')]!==_0x13c8('0x3a')){var _0x42e860={};_0x42e860[_0x2776c0[_0x13c8('0x27')]]={'$like':'%'+_0x196983[_0x13c8('0x2e')][_0x13c8('0x39')]+'%'};return _0x42e860;}})});}_0x545b47=_[_0x13c8('0x3b')]({},_0x545b47,_0x196983[_0x13c8('0x3c')]);var _0x50d19a={'where':_0x545b47['where']};return db[_0x13c8('0x3d')][_0x13c8('0x1b')](_0x50d19a)[_0x13c8('0x25')](function(_0x362040){_0x6c2dc8['count']=_0x362040;if(_0x196983[_0x13c8('0x2e')]['includeAll']){_0x545b47[_0x13c8('0x3e')]=[{'all':!![]}];}return db[_0x13c8('0x3d')][_0x13c8('0x3f')](_0x545b47);})[_0x13c8('0x25')](function(_0xbb1d49){_0x6c2dc8[_0x13c8('0x40')]=_0xbb1d49;return _0x6c2dc8;})[_0x13c8('0x25')](respondWithFilteredResult(_0x596166,_0x545b47))[_0x13c8('0x41')](handleError(_0x596166,null));};exports[_0x13c8('0x42')]=function(_0x6ee38b,_0x32d5a5){var _0x416169={'raw':!![],'where':{'id':_0x6ee38b[_0x13c8('0x43')]['id']}},_0x89bbab={};_0x89bbab[_0x13c8('0x2c')]=_[_0x13c8('0x2f')](db[_0x13c8('0x3d')][_0x13c8('0x28')]);_0x89bbab[_0x13c8('0x2e')]=_[_0x13c8('0x2f')](_0x6ee38b[_0x13c8('0x2e')]);_0x89bbab[_0x13c8('0x44')]=_[_0x13c8('0x30')](_0x89bbab[_0x13c8('0x2c')],_0x89bbab[_0x13c8('0x2e')]);_0x416169['attributes']=_[_0x13c8('0x30')](_0x89bbab[_0x13c8('0x2c')],qs[_0x13c8('0x32')](_0x6ee38b[_0x13c8('0x2e')][_0x13c8('0x32')]));_0x416169['attributes']=_0x416169['attributes'][_0x13c8('0x33')]?_0x416169[_0x13c8('0x31')]:_0x89bbab[_0x13c8('0x2c')];if(_0x6ee38b['query']['includeAll']){_0x416169['include']=[{'all':!![]}];}_0x416169=_[_0x13c8('0x3b')]({},_0x416169,_0x6ee38b['options']);return db[_0x13c8('0x3d')]['find'](_0x416169)[_0x13c8('0x25')](handleEntityNotFound(_0x32d5a5,null))[_0x13c8('0x25')](respondWithResult(_0x32d5a5,null))[_0x13c8('0x41')](handleError(_0x32d5a5,null));};exports[_0x13c8('0x45')]=function(_0x3fcc4d,_0x471bfc){return db['SquareRecording'][_0x13c8('0x45')](_0x3fcc4d[_0x13c8('0x46')],{})['then'](respondWithResult(_0x471bfc,0xc9))[_0x13c8('0x41')](handleError(_0x471bfc,null));};exports[_0x13c8('0x24')]=function(_0x2e925f,_0x162918){if(_0x2e925f[_0x13c8('0x46')]['id']){delete _0x2e925f['body']['id'];}return db[_0x13c8('0x3d')][_0x13c8('0x47')]({'where':{'id':_0x2e925f[_0x13c8('0x43')]['id']}})[_0x13c8('0x25')](handleEntityNotFound(_0x162918,null))[_0x13c8('0x25')](saveUpdates(_0x2e925f['body'],null))[_0x13c8('0x25')](respondWithResult(_0x162918,null))[_0x13c8('0x41')](handleError(_0x162918,null));};exports[_0x13c8('0x48')]=function(_0x6b042b,_0x2d4f87){return db[_0x13c8('0x3d')][_0x13c8('0x47')]({'where':{'id':_0x6b042b[_0x13c8('0x43')]['id']}})[_0x13c8('0x25')](handleEntityNotFound(_0x2d4f87,null))[_0x13c8('0x25')](removeEntity(_0x2d4f87,null))[_0x13c8('0x41')](handleError(_0x2d4f87,null));};exports['download']=function(_0x10ba7c,_0x3b90e4,_0x47d862){var _0x3b3458=require(_0x13c8('0x49'));var _0x11aa65=![];var _0x48b7f6={};if(_0x10ba7c[_0x13c8('0x2e')][_0x13c8('0x2a')]&&_0x10ba7c[_0x13c8('0x2e')]['type']==='uniqueid'){_0x48b7f6[_0x13c8('0x4a')]=_0x10ba7c[_0x13c8('0x43')]['id'];}else{_0x48b7f6['id']=_0x10ba7c['params']['id'];}return db[_0x13c8('0x3d')][_0x13c8('0x47')]({'where':_0x48b7f6,'attributes':['id','savePath',_0x13c8('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3b90e4,null))[_0x13c8('0x25')](function(_0x1f67bd){if(_0x1f67bd){var _0x10c72f=_0x1f67bd['savePath'];var _0x3235af=util[_0x13c8('0x4c')]('%s.cypher',_0x10c72f);if(fs[_0x13c8('0x4d')](_0x3235af)){_0x11aa65=!![];return _0x3b3458['decryptFile'](_0x3235af,_0x10c72f,config[_0x13c8('0x4e')][_0x13c8('0x4f')])[_0x13c8('0x25')](function(){return _0x1f67bd;});}return _0x1f67bd;}})[_0x13c8('0x25')](function(_0x3760e4){if(_0x3760e4){var _0x5f4884=_0x3760e4[_0x13c8('0x50')];if(!fs['existsSync'](_0x5f4884)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x3760e4['filename']){return _0x3b90e4[_0x13c8('0x51')](_0x5f4884,_0x3760e4[_0x13c8('0x4b')]+path[_0x13c8('0x52')](_0x5f4884),function(){if(_0x11aa65){fs[_0x13c8('0x53')](_0x5f4884);}});}else{return _0x3b90e4[_0x13c8('0x51')](_0x5f4884,function(_0x256b3b){if(_0x11aa65){fs[_0x13c8('0x53')](_0x5f4884);}});}}})['catch'](function(_0x4920d0){if(_0x4920d0[_0x13c8('0x54')]===_0x13c8('0x55')){_0x3b90e4[_0x13c8('0x19')](0x194)[_0x13c8('0x56')](_0x13c8('0x57'));}else{return handleError(_0x3b90e4,null);}});}; \ No newline at end of file +var _0x1c8a=['../../mysqldb','sendStatus','status','json','offset','set','reject','save','then','destroy','end','stack','name','send','index','SquareRecording','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','count','includeAll','findAll','rows','catch','show','include','create','body','update','find','params','type','uniqueid','savePath','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3a4a47,_0x16a689){var _0x5744f0=function(_0x486bc5){while(--_0x486bc5){_0x3a4a47['push'](_0x3a4a47['shift']());}};_0x5744f0(++_0x16a689);}(_0x1c8a,0x140));var _0xa1c8=function(_0x5d6bd7,_0x48aae8){_0x5d6bd7=_0x5d6bd7-0x0;var _0x3c3610=_0x1c8a[_0x5d6bd7];return _0x3c3610;};'use strict';var pdf=require(_0xa1c8('0x0'));var emlformat=require(_0xa1c8('0x1'));var rimraf=require(_0xa1c8('0x2'));var zipdir=require(_0xa1c8('0x3'));var jsonpatch=require(_0xa1c8('0x4'));var rp=require('request-promise');var moment=require(_0xa1c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa1c8('0x6'));var util=require(_0xa1c8('0x7'));var path=require(_0xa1c8('0x8'));var sox=require('sox');var csv=require(_0xa1c8('0x9'));var ejs=require(_0xa1c8('0xa'));var fs=require('fs');var _=require(_0xa1c8('0xb'));var squel=require('squel');var crypto=require(_0xa1c8('0xc'));var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c8('0xf'));var Papa=require(_0xa1c8('0x10'));var Redis=require(_0xa1c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa1c8('0x14'))['db'];function respondWithStatusCode(_0x35c9d7,_0x2647fa){_0x2647fa=_0x2647fa||0xcc;return function(_0x707249){if(_0x707249){return _0x35c9d7[_0xa1c8('0x15')](_0x2647fa);}return _0x35c9d7[_0xa1c8('0x16')](_0x2647fa)['end']();};}function respondWithResult(_0x284687,_0x282525){_0x282525=_0x282525||0xc8;return function(_0xcccc7b){if(_0xcccc7b){return _0x284687[_0xa1c8('0x16')](_0x282525)[_0xa1c8('0x17')](_0xcccc7b);}};}function respondWithFilteredResult(_0x21718d,_0x517130){return function(_0x7f1128){if(_0x7f1128){var _0x51b1c3=_0x7f1128['count'],_0x17d4d2=_0x517130[_0xa1c8('0x18')],_0x2ef438=_0x517130['offset']+_0x517130['limit'],_0x144f54;if(_0x2ef438>=_0x51b1c3){_0x2ef438=_0x51b1c3;_0x144f54=0xc8;}else{_0x144f54=0xce;}_0x21718d[_0xa1c8('0x16')](_0x144f54);return _0x21718d[_0xa1c8('0x19')]('Content-Range',_0x17d4d2+'-'+_0x2ef438+'/'+_0x51b1c3)[_0xa1c8('0x17')](_0x7f1128);}return null;};}function patchUpdates(_0x367094){return function(_0x3e1284){try{jsonpatch['apply'](_0x3e1284,_0x367094,!![]);}catch(_0x35cd08){return BPromise[_0xa1c8('0x1a')](_0x35cd08);}return _0x3e1284[_0xa1c8('0x1b')]();};}function saveUpdates(_0x592582,_0x2eabb2){return function(_0x874b1f){if(_0x874b1f){return _0x874b1f['update'](_0x592582)[_0xa1c8('0x1c')](function(_0x34d526){return _0x34d526;});}return null;};}function removeEntity(_0x1a638d,_0x2a7fa5){return function(_0x19fe5a){if(_0x19fe5a){return _0x19fe5a[_0xa1c8('0x1d')]()[_0xa1c8('0x1c')](function(){_0x1a638d[_0xa1c8('0x16')](0xcc)[_0xa1c8('0x1e')]();});}};}function handleEntityNotFound(_0x193077,_0x28473c){return function(_0x125047){if(!_0x125047){_0x193077[_0xa1c8('0x15')](0x194);}return _0x125047;};}function handleError(_0x1aac37,_0x3f929f){_0x3f929f=_0x3f929f||0x1f4;return function(_0x395b61){logger['error'](_0x395b61[_0xa1c8('0x1f')]);if(_0x395b61['name']){delete _0x395b61[_0xa1c8('0x20')];}_0x1aac37['status'](_0x3f929f)[_0xa1c8('0x21')](_0x395b61);};}exports[_0xa1c8('0x22')]=function(_0x22eec1,_0x4eb627){var _0x305148={},_0x914018={},_0x384b52={'count':0x0,'rows':[]};var _0xa067ae=_['map'](db[_0xa1c8('0x23')][_0xa1c8('0x24')],function(_0x28b9e5){return{'name':_0x28b9e5['fieldName'],'type':_0x28b9e5['type'][_0xa1c8('0x25')]};});_0x914018[_0xa1c8('0x26')]=_['map'](_0xa067ae,_0xa1c8('0x20'));_0x914018[_0xa1c8('0x27')]=_[_0xa1c8('0x28')](_0x22eec1['query']);_0x914018['filters']=_['intersection'](_0x914018[_0xa1c8('0x26')],_0x914018['query']);_0x305148[_0xa1c8('0x29')]=_[_0xa1c8('0x2a')](_0x914018[_0xa1c8('0x26')],qs[_0xa1c8('0x2b')](_0x22eec1[_0xa1c8('0x27')][_0xa1c8('0x2b')]));_0x305148['attributes']=_0x305148[_0xa1c8('0x29')][_0xa1c8('0x2c')]?_0x305148[_0xa1c8('0x29')]:_0x914018[_0xa1c8('0x26')];if(!_0x22eec1['query']['hasOwnProperty'](_0xa1c8('0x2d'))){_0x305148['limit']=qs[_0xa1c8('0x2e')](_0x22eec1[_0xa1c8('0x27')][_0xa1c8('0x2e')]);_0x305148[_0xa1c8('0x18')]=qs[_0xa1c8('0x18')](_0x22eec1[_0xa1c8('0x27')][_0xa1c8('0x18')]);}_0x305148[_0xa1c8('0x2f')]=qs['sort'](_0x22eec1[_0xa1c8('0x27')][_0xa1c8('0x30')]);_0x305148[_0xa1c8('0x31')]=qs[_0xa1c8('0x32')](_[_0xa1c8('0x33')](_0x22eec1[_0xa1c8('0x27')],_0x914018[_0xa1c8('0x32')]));if(_0x22eec1[_0xa1c8('0x27')][_0xa1c8('0x34')]){_0x305148[_0xa1c8('0x31')]=_[_0xa1c8('0x35')](_0x305148[_0xa1c8('0x31')],{'$or':_[_0xa1c8('0x36')](_0xa067ae,function(_0x2e2516){if(_0x2e2516['type']!=='VIRTUAL'){var _0x322971={};_0x322971[_0x2e2516[_0xa1c8('0x20')]]={'$like':'%'+_0x22eec1[_0xa1c8('0x27')]['filter']+'%'};return _0x322971;}})});}_0x305148=_['merge']({},_0x305148,_0x22eec1['options']);var _0x297d21={'where':_0x305148['where']};return db['SquareRecording'][_0xa1c8('0x37')](_0x297d21)[_0xa1c8('0x1c')](function(_0x2c3fcd){_0x384b52['count']=_0x2c3fcd;if(_0x22eec1[_0xa1c8('0x27')][_0xa1c8('0x38')]){_0x305148['include']=[{'all':!![]}];}return db[_0xa1c8('0x23')][_0xa1c8('0x39')](_0x305148);})[_0xa1c8('0x1c')](function(_0x4bad1e){_0x384b52[_0xa1c8('0x3a')]=_0x4bad1e;return _0x384b52;})[_0xa1c8('0x1c')](respondWithFilteredResult(_0x4eb627,_0x305148))[_0xa1c8('0x3b')](handleError(_0x4eb627,null));};exports[_0xa1c8('0x3c')]=function(_0x3232ba,_0x5937b5){var _0x52aea5={'raw':!![],'where':{'id':_0x3232ba['params']['id']}},_0x57c24c={};_0x57c24c['model']=_[_0xa1c8('0x28')](db[_0xa1c8('0x23')][_0xa1c8('0x24')]);_0x57c24c[_0xa1c8('0x27')]=_[_0xa1c8('0x28')](_0x3232ba['query']);_0x57c24c['filters']=_[_0xa1c8('0x2a')](_0x57c24c[_0xa1c8('0x26')],_0x57c24c[_0xa1c8('0x27')]);_0x52aea5['attributes']=_['intersection'](_0x57c24c[_0xa1c8('0x26')],qs[_0xa1c8('0x2b')](_0x3232ba[_0xa1c8('0x27')][_0xa1c8('0x2b')]));_0x52aea5[_0xa1c8('0x29')]=_0x52aea5[_0xa1c8('0x29')][_0xa1c8('0x2c')]?_0x52aea5['attributes']:_0x57c24c[_0xa1c8('0x26')];if(_0x3232ba['query'][_0xa1c8('0x38')]){_0x52aea5[_0xa1c8('0x3d')]=[{'all':!![]}];}_0x52aea5=_[_0xa1c8('0x35')]({},_0x52aea5,_0x3232ba['options']);return db[_0xa1c8('0x23')]['find'](_0x52aea5)[_0xa1c8('0x1c')](handleEntityNotFound(_0x5937b5,null))[_0xa1c8('0x1c')](respondWithResult(_0x5937b5,null))[_0xa1c8('0x3b')](handleError(_0x5937b5,null));};exports['create']=function(_0x2c0fbf,_0x1c0805){return db['SquareRecording'][_0xa1c8('0x3e')](_0x2c0fbf[_0xa1c8('0x3f')],{})[_0xa1c8('0x1c')](respondWithResult(_0x1c0805,0xc9))[_0xa1c8('0x3b')](handleError(_0x1c0805,null));};exports[_0xa1c8('0x40')]=function(_0x43616f,_0x258d46){if(_0x43616f[_0xa1c8('0x3f')]['id']){delete _0x43616f[_0xa1c8('0x3f')]['id'];}return db['SquareRecording'][_0xa1c8('0x41')]({'where':{'id':_0x43616f[_0xa1c8('0x42')]['id']}})[_0xa1c8('0x1c')](handleEntityNotFound(_0x258d46,null))[_0xa1c8('0x1c')](saveUpdates(_0x43616f['body'],null))[_0xa1c8('0x1c')](respondWithResult(_0x258d46,null))[_0xa1c8('0x3b')](handleError(_0x258d46,null));};exports[_0xa1c8('0x1d')]=function(_0x44580d,_0x364b57){return db['SquareRecording'][_0xa1c8('0x41')]({'where':{'id':_0x44580d[_0xa1c8('0x42')]['id']}})[_0xa1c8('0x1c')](handleEntityNotFound(_0x364b57,null))[_0xa1c8('0x1c')](removeEntity(_0x364b57,null))[_0xa1c8('0x3b')](handleError(_0x364b57,null));};exports['download']=function(_0x5bbef3,_0x2d216f,_0x240924){var _0x44343b=require('../../components/encryptor');var _0x3cada6=![];var _0x475590={};if(_0x5bbef3[_0xa1c8('0x27')][_0xa1c8('0x43')]&&_0x5bbef3[_0xa1c8('0x27')][_0xa1c8('0x43')]===_0xa1c8('0x44')){_0x475590[_0xa1c8('0x44')]=_0x5bbef3[_0xa1c8('0x42')]['id'];}else{_0x475590['id']=_0x5bbef3[_0xa1c8('0x42')]['id'];}return db[_0xa1c8('0x23')][_0xa1c8('0x41')]({'where':_0x475590,'attributes':['id',_0xa1c8('0x45'),'filename'],'raw':!![]})[_0xa1c8('0x1c')](handleEntityNotFound(_0x2d216f,null))[_0xa1c8('0x1c')](function(_0x3fb365){if(_0x3fb365){var _0x3d35b4=_0x3fb365[_0xa1c8('0x45')];var _0x2a0c54=util[_0xa1c8('0x46')](_0xa1c8('0x47'),_0x3d35b4);if(fs['existsSync'](_0x2a0c54)){_0x3cada6=!![];return _0x44343b[_0xa1c8('0x48')](_0x2a0c54,_0x3d35b4,config[_0xa1c8('0x49')][_0xa1c8('0x4a')])[_0xa1c8('0x1c')](function(){return _0x3fb365;});}return _0x3fb365;}})['then'](function(_0x50dfd1){if(_0x50dfd1){var _0x1f63e5=_0x50dfd1['savePath'];if(!fs[_0xa1c8('0x4b')](_0x1f63e5)){throw new db[(_0xa1c8('0x4c'))][(_0xa1c8('0x4d'))](_0xa1c8('0x4e'));}if(_0x50dfd1[_0xa1c8('0x4f')]){return _0x2d216f[_0xa1c8('0x50')](_0x1f63e5,_0x50dfd1['filename']+path[_0xa1c8('0x51')](_0x1f63e5),function(){if(_0x3cada6){fs['unlink'](_0x1f63e5);}});}else{return _0x2d216f[_0xa1c8('0x50')](_0x1f63e5,function(_0x4d828f){if(_0x3cada6){fs[_0xa1c8('0x52')](_0x1f63e5);}});}}})[_0xa1c8('0x3b')](function(_0x437ca8){if(_0x437ca8[_0xa1c8('0x53')]==='SquareRecording\x20not\x20found'){_0x2d216f[_0xa1c8('0x16')](0x194)[_0xa1c8('0x21')](_0xa1c8('0x54'));}else{return handleError(_0x2d216f,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c3ea60a..335c339 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 _0x349e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','SquareRecording','square_recordings','lodash'];(function(_0x7f5353,_0x53e48c){var _0x4dc21b=function(_0x5cfd20){while(--_0x5cfd20){_0x7f5353['push'](_0x7f5353['shift']());}};_0x4dc21b(++_0x53e48c);}(_0x349e,0xcb));var _0xe349=function(_0x3781bd,_0x291272){_0x3781bd=_0x3781bd-0x0;var _0x1d2d3f=_0x349e[_0x3781bd];return _0x1d2d3f;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var logger=require(_0xe349('0x2'))(_0xe349('0x3'));var moment=require(_0xe349('0x4'));var BPromise=require(_0xe349('0x5'));var rp=require(_0xe349('0x6'));var fs=require('fs');var path=require(_0xe349('0x7'));var rimraf=require(_0xe349('0x8'));var config=require('../../config/environment');var attributes=require(_0xe349('0x9'));module['exports']=function(_0x55aae6,_0xb21068){return _0x55aae6['define'](_0xe349('0xa'),attributes,{'tableName':_0xe349('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0abf=['define','square_recordings','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x538a03,_0x34f7a6){var _0x5a99c0=function(_0x35929f){while(--_0x35929f){_0x538a03['push'](_0x538a03['shift']());}};_0x5a99c0(++_0x34f7a6);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));module[_0xf0ab('0x7')]=function(_0x2ab7d6,_0x4d2ea8){return _0x2ab7d6[_0xf0ab('0x8')]('SquareRecording',attributes,{'tableName':_0xf0ab('0x9'),'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 fe6e55e..9453cc2 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 _0xbf88=['SquareRecording','create','body','options','raw','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareRecording'];(function(_0x3dedd0,_0x24dc0c){var _0x28a73b=function(_0x40f636){while(--_0x40f636){_0x3dedd0['push'](_0x3dedd0['shift']());}};_0x28a73b(++_0x24dc0c);}(_0xbf88,0x19a));var _0x8bf8=function(_0x53c680,_0x41f89b){_0x53c680=_0x53c680-0x0;var _0x1b39b6=_0xbf88[_0x53c680];return _0x1b39b6;};'use strict';var _=require(_0x8bf8('0x0'));var util=require(_0x8bf8('0x1'));var moment=require('moment');var BPromise=require(_0x8bf8('0x2'));var rs=require(_0x8bf8('0x3'));var fs=require('fs');var Redis=require(_0x8bf8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bf8('0x5'));var logger=require(_0x8bf8('0x6'))(_0x8bf8('0x7'));var config=require(_0x8bf8('0x8'));var jayson=require(_0x8bf8('0x9'));var client=jayson[_0x8bf8('0xa')][_0x8bf8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b8e30,_0xb8ee05,_0x1284b4){return new BPromise(function(_0x466c92,_0x478e73){return client[_0x8bf8('0xc')](_0x5b8e30,_0x1284b4)[_0x8bf8('0xd')](function(_0x5ccd60){logger[_0x8bf8('0xe')](_0x8bf8('0xf'),_0xb8ee05,_0x8bf8('0x10'));logger['debug'](_0x8bf8('0x11'),_0xb8ee05,_0x8bf8('0x10'),JSON['stringify'](_0x5ccd60));if(_0x5ccd60[_0x8bf8('0x12')]){if(_0x5ccd60[_0x8bf8('0x12')][_0x8bf8('0x13')]===0x1f4){logger['error'](_0x8bf8('0xf'),_0xb8ee05,_0x5ccd60[_0x8bf8('0x12')]['message']);return _0x478e73(_0x5ccd60[_0x8bf8('0x12')]['message']);}logger[_0x8bf8('0x12')](_0x8bf8('0xf'),_0xb8ee05,_0x5ccd60[_0x8bf8('0x12')][_0x8bf8('0x14')]);return _0x466c92(_0x5ccd60[_0x8bf8('0x12')][_0x8bf8('0x14')]);}else{logger[_0x8bf8('0xe')](_0x8bf8('0xf'),_0xb8ee05,_0x8bf8('0x10'));_0x466c92(_0x5ccd60[_0x8bf8('0x15')][_0x8bf8('0x14')]);}})[_0x8bf8('0x16')](function(_0x494425){logger[_0x8bf8('0x12')]('SquareRecording,\x20%s,\x20%s',_0xb8ee05,_0x494425);_0x478e73(_0x494425);});});}exports[_0x8bf8('0x17')]=function(_0x462aaf){var _0x175313=this;return new Promise(function(_0x31ccb0,_0x564220){return db[_0x8bf8('0x18')][_0x8bf8('0x19')](_0x462aaf[_0x8bf8('0x1a')],{'raw':_0x462aaf[_0x8bf8('0x1b')]?_0x462aaf['options'][_0x8bf8('0x1c')]===undefined?!![]:![]:!![]})[_0x8bf8('0xd')](function(_0x4010b1){logger[_0x8bf8('0xe')](_0x8bf8('0x17'),_0x462aaf);logger[_0x8bf8('0x1d')](_0x8bf8('0x17'),_0x462aaf,JSON[_0x8bf8('0x1e')](_0x4010b1));_0x31ccb0(_0x4010b1);})[_0x8bf8('0x16')](function(_0xa285d0){logger[_0x8bf8('0x12')]('CreateSquareRecording',_0xa285d0['message'],_0x462aaf);_0x564220(_0x175313[_0x8bf8('0x12')](0x1f4,_0xa285d0[_0x8bf8('0x14')]));});});}; \ No newline at end of file +var _0xed87=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','info','CreateSquareRecording','create','body','options','stringify','catch','lodash','util'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0xed87,0x14e));var _0x7ed8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xed87[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7ed8('0x0'));var util=require(_0x7ed8('0x1'));var moment=require(_0x7ed8('0x2'));var BPromise=require(_0x7ed8('0x3'));var rs=require(_0x7ed8('0x4'));var fs=require('fs');var Redis=require(_0x7ed8('0x5'));var db=require(_0x7ed8('0x6'))['db'];var utils=require(_0x7ed8('0x7'));var logger=require(_0x7ed8('0x8'))(_0x7ed8('0x9'));var config=require(_0x7ed8('0xa'));var jayson=require(_0x7ed8('0xb'));var client=jayson['client'][_0x7ed8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49f900,_0x355d61,_0x2e4ffb){return new BPromise(function(_0x341dae,_0x10a7f5){return client[_0x7ed8('0xd')](_0x49f900,_0x2e4ffb)[_0x7ed8('0xe')](function(_0x14ebd5){logger['info'](_0x7ed8('0xf'),_0x355d61,_0x7ed8('0x10'));logger[_0x7ed8('0x11')](_0x7ed8('0x12'),_0x355d61,_0x7ed8('0x10'),JSON['stringify'](_0x14ebd5));if(_0x14ebd5['error']){if(_0x14ebd5[_0x7ed8('0x13')]['code']===0x1f4){logger[_0x7ed8('0x13')]('SquareRecording,\x20%s,\x20%s',_0x355d61,_0x14ebd5[_0x7ed8('0x13')][_0x7ed8('0x14')]);return _0x10a7f5(_0x14ebd5[_0x7ed8('0x13')]['message']);}logger[_0x7ed8('0x13')]('SquareRecording,\x20%s,\x20%s',_0x355d61,_0x14ebd5[_0x7ed8('0x13')][_0x7ed8('0x14')]);return _0x341dae(_0x14ebd5[_0x7ed8('0x13')][_0x7ed8('0x14')]);}else{logger[_0x7ed8('0x15')](_0x7ed8('0xf'),_0x355d61,_0x7ed8('0x10'));_0x341dae(_0x14ebd5['result']['message']);}})['catch'](function(_0x5a80e3){logger['error'](_0x7ed8('0xf'),_0x355d61,_0x5a80e3);_0x10a7f5(_0x5a80e3);});});}exports[_0x7ed8('0x16')]=function(_0x33d341){var _0x5cbc48=this;return new Promise(function(_0xc30ba,_0x114275){return db['SquareRecording'][_0x7ed8('0x17')](_0x33d341[_0x7ed8('0x18')],{'raw':_0x33d341[_0x7ed8('0x19')]?_0x33d341['options']['raw']===undefined?!![]:![]:!![]})[_0x7ed8('0xe')](function(_0x177ed9){logger[_0x7ed8('0x15')](_0x7ed8('0x16'),_0x33d341);logger[_0x7ed8('0x11')](_0x7ed8('0x16'),_0x33d341,JSON[_0x7ed8('0x1a')](_0x177ed9));_0xc30ba(_0x177ed9);})[_0x7ed8('0x1b')](function(_0x5624ca){logger[_0x7ed8('0x13')](_0x7ed8('0x16'),_0x5624ca[_0x7ed8('0x14')],_0x33d341);_0x114275(_0x5cbc48['error'](0x1f4,_0x5624ca[_0x7ed8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 63b0403..9df890d 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 _0x8e35=['../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete','destroy','exports','Router'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x8e35,0x194));var _0x58e3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8e35[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x58e3('0x0')]();var auth=require(_0x58e3('0x1'));var interaction=require(_0x58e3('0x2'));var config=require('../../config/environment');var controller=require(_0x58e3('0x3'));router[_0x58e3('0x4')]('/',auth[_0x58e3('0x5')](),controller['index']);router[_0x58e3('0x4')](_0x58e3('0x6'),auth[_0x58e3('0x5')](),controller[_0x58e3('0x7')]);router[_0x58e3('0x4')](_0x58e3('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x58e3('0x5')](),controller[_0x58e3('0x9')]);router[_0x58e3('0xa')](_0x58e3('0x8'),auth[_0x58e3('0x5')](),controller[_0x58e3('0xb')]);router[_0x58e3('0xc')](_0x58e3('0x8'),auth[_0x58e3('0x5')](),controller[_0x58e3('0xd')]);module[_0x58e3('0xe')]=router; \ No newline at end of file +var _0x6894=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','update','delete','/:id'];(function(_0x12d0ea,_0x1d19b3){var _0x25ed27=function(_0x38f874){while(--_0x38f874){_0x12d0ea['push'](_0x12d0ea['shift']());}};_0x25ed27(++_0x1d19b3);}(_0x6894,0x156));var _0x4689=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x6894[_0x5e8eae];return _0xdd09cd;};'use strict';var multer=require(_0x4689('0x0'));var util=require(_0x4689('0x1'));var path=require(_0x4689('0x2'));var timeout=require('connect-timeout');var express=require(_0x4689('0x3'));var router=express[_0x4689('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4689('0x5'));var config=require('../../config/environment');var controller=require(_0x4689('0x6'));router[_0x4689('0x7')]('/',auth[_0x4689('0x8')](),controller[_0x4689('0x9')]);router[_0x4689('0x7')](_0x4689('0xa'),auth[_0x4689('0x8')](),controller[_0x4689('0xb')]);router[_0x4689('0x7')]('/:id',auth[_0x4689('0x8')](),controller[_0x4689('0xc')]);router['post']('/',auth[_0x4689('0x8')](),controller[_0x4689('0xd')]);router[_0x4689('0xe')]('/:id',auth[_0x4689('0x8')](),controller[_0x4689('0xf')]);router[_0x4689('0x10')](_0x4689('0x11'),auth['isAuthenticated'](),controller[_0x4689('0x12')]);module[_0x4689('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index a6e51f9..eb6ce13 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 _0x9c8c=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x1bd1a7,_0x5025c4){var _0x33a9cc=function(_0x1c5a80){while(--_0x1c5a80){_0x1bd1a7['push'](_0x1bd1a7['shift']());}};_0x33a9cc(++_0x5025c4);}(_0x9c8c,0x1b0));var _0xc9c8=function(_0x5e8b9f,_0x5d8426){_0x5e8b9f=_0x5e8b9f-0x0;var _0x420f07=_0x9c8c[_0x5e8b9f];return _0x420f07;};'use strict';var Sequelize=require(_0xc9c8('0x0'));module[_0xc9c8('0x1')]={'network':{'type':Sequelize[_0xc9c8('0x2')]},'network_script':{'type':Sequelize[_0xc9c8('0x2')]},'request':{'type':Sequelize[_0xc9c8('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc9c8('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xc9c8('0x2')]},'callerid':{'type':Sequelize[_0xc9c8('0x2')]},'calleridname':{'type':Sequelize[_0xc9c8('0x2')]},'callingpres':{'type':Sequelize[_0xc9c8('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xc9c8('0x2')]},'dnid':{'type':Sequelize[_0xc9c8('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc9c8('0x2')]},'extension':{'type':Sequelize[_0xc9c8('0x2')]},'priority':{'type':Sequelize[_0xc9c8('0x2')]},'enhanced':{'type':Sequelize[_0xc9c8('0x2')]},'accountcode':{'type':Sequelize[_0xc9c8('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xc9c8('0x2')]},'joinAt':{'type':Sequelize[_0xc9c8('0x3')]},'leaveAt':{'type':Sequelize[_0xc9c8('0x3')]},'bot':{'type':Sequelize[_0xc9c8('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x71c9=['DATE','sequelize','STRING'];(function(_0x527365,_0x36fb3a){var _0x5de073=function(_0x52a251){while(--_0x52a251){_0x527365['push'](_0x527365['shift']());}};_0x5de073(++_0x36fb3a);}(_0x71c9,0xb8));var _0x971c=function(_0x166c4b,_0x462358){_0x166c4b=_0x166c4b-0x0;var _0x3bf572=_0x71c9[_0x166c4b];return _0x3bf572;};'use strict';var Sequelize=require(_0x971c('0x0'));module['exports']={'network':{'type':Sequelize[_0x971c('0x1')]},'network_script':{'type':Sequelize[_0x971c('0x1')]},'request':{'type':Sequelize[_0x971c('0x1')]},'channel':{'type':Sequelize[_0x971c('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x971c('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x971c('0x1')]},'calleridname':{'type':Sequelize[_0x971c('0x1')]},'callingpres':{'type':Sequelize[_0x971c('0x1')]},'callingani2':{'type':Sequelize[_0x971c('0x1')]},'callington':{'type':Sequelize[_0x971c('0x1')]},'callingtns':{'type':Sequelize[_0x971c('0x1')]},'dnid':{'type':Sequelize[_0x971c('0x1')]},'rdnis':{'type':Sequelize[_0x971c('0x1')]},'context':{'type':Sequelize[_0x971c('0x1')]},'extension':{'type':Sequelize[_0x971c('0x1')]},'priority':{'type':Sequelize[_0x971c('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x971c('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x971c('0x2')]},'leaveAt':{'type':Sequelize[_0x971c('0x2')]},'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 0dc221b..287d85f 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 _0x7fbe=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SquareReport','includeAll','findAll','rows','show','params','include','options','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x2654e1,_0x52bcf2){var _0x26c16e=function(_0x55b45c){while(--_0x55b45c){_0x2654e1['push'](_0x2654e1['shift']());}};_0x26c16e(++_0x52bcf2);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3a7257,_0x30b139){_0x3a7257=_0x3a7257-0x0;var _0x467d25=_0x7fbe[_0x3a7257];return _0x467d25;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var db=require(_0xe7fb('0x19'))['db'];function respondWithStatusCode(_0x2fe8ab,_0x2437d4){_0x2437d4=_0x2437d4||0xcc;return function(_0x188e1d){if(_0x188e1d){return _0x2fe8ab[_0xe7fb('0x1a')](_0x2437d4);}return _0x2fe8ab[_0xe7fb('0x1b')](_0x2437d4)[_0xe7fb('0x1c')]();};}function respondWithResult(_0x598729,_0x278b75){_0x278b75=_0x278b75||0xc8;return function(_0x2225e5){if(_0x2225e5){return _0x598729['status'](_0x278b75)[_0xe7fb('0x1d')](_0x2225e5);}};}function respondWithFilteredResult(_0x37eb9f,_0x482f7d){return function(_0xa76acf){if(_0xa76acf){var _0x559129=_0xa76acf[_0xe7fb('0x1e')],_0x12fff6=_0x482f7d['offset'],_0x18d23c=_0x482f7d[_0xe7fb('0x1f')]+_0x482f7d['limit'],_0x12603d;if(_0x18d23c>=_0x559129){_0x18d23c=_0x559129;_0x12603d=0xc8;}else{_0x12603d=0xce;}_0x37eb9f[_0xe7fb('0x1b')](_0x12603d);return _0x37eb9f['set'](_0xe7fb('0x20'),_0x12fff6+'-'+_0x18d23c+'/'+_0x559129)[_0xe7fb('0x1d')](_0xa76acf);}return null;};}function patchUpdates(_0x3f96a7){return function(_0x182269){try{jsonpatch['apply'](_0x182269,_0x3f96a7,!![]);}catch(_0x44466e){return BPromise['reject'](_0x44466e);}return _0x182269[_0xe7fb('0x21')]();};}function saveUpdates(_0x51f01f,_0x15f7a4){return function(_0x4ea664){if(_0x4ea664){return _0x4ea664[_0xe7fb('0x22')](_0x51f01f)[_0xe7fb('0x23')](function(_0x4a9994){return _0x4a9994;});}return null;};}function removeEntity(_0x143eb6,_0x4742bd){return function(_0x3ae8f1){if(_0x3ae8f1){return _0x3ae8f1['destroy']()[_0xe7fb('0x23')](function(){_0x143eb6[_0xe7fb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(!_0x35e4db){_0x5bea27['sendStatus'](0x194);}return _0x35e4db;};}function handleError(_0x49b219,_0x4026b1){_0x4026b1=_0x4026b1||0x1f4;return function(_0x32e8b2){logger[_0xe7fb('0x24')](_0x32e8b2['stack']);if(_0x32e8b2[_0xe7fb('0x25')]){delete _0x32e8b2[_0xe7fb('0x25')];}_0x49b219[_0xe7fb('0x1b')](_0x4026b1)[_0xe7fb('0x26')](_0x32e8b2);};}exports[_0xe7fb('0x27')]=function(_0x16237a,_0x380130){var _0x59e015={},_0x5df9f2={},_0x1086e6={'count':0x0,'rows':[]};var _0x3bdee9=_[_0xe7fb('0x28')](db['SquareReport'][_0xe7fb('0x29')],function(_0x251807){return{'name':_0x251807[_0xe7fb('0x2a')],'type':_0x251807[_0xe7fb('0x2b')][_0xe7fb('0x2c')]};});_0x5df9f2[_0xe7fb('0x2d')]=_[_0xe7fb('0x28')](_0x3bdee9,_0xe7fb('0x25'));_0x5df9f2['query']=_[_0xe7fb('0x2e')](_0x16237a[_0xe7fb('0x2f')]);_0x5df9f2[_0xe7fb('0x30')]=_['intersection'](_0x5df9f2['model'],_0x5df9f2[_0xe7fb('0x2f')]);_0x59e015['attributes']=_[_0xe7fb('0x31')](_0x5df9f2[_0xe7fb('0x2d')],qs[_0xe7fb('0x32')](_0x16237a[_0xe7fb('0x2f')]['fields']));_0x59e015[_0xe7fb('0x33')]=_0x59e015[_0xe7fb('0x33')][_0xe7fb('0x34')]?_0x59e015[_0xe7fb('0x33')]:_0x5df9f2[_0xe7fb('0x2d')];if(!_0x16237a['query'][_0xe7fb('0x35')](_0xe7fb('0x36'))){_0x59e015[_0xe7fb('0x37')]=qs[_0xe7fb('0x37')](_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x37')]);_0x59e015[_0xe7fb('0x1f')]=qs[_0xe7fb('0x1f')](_0x16237a[_0xe7fb('0x2f')]['offset']);}_0x59e015[_0xe7fb('0x38')]=qs[_0xe7fb('0x39')](_0x16237a[_0xe7fb('0x2f')]['sort']);_0x59e015[_0xe7fb('0x3a')]=qs[_0xe7fb('0x30')](_[_0xe7fb('0x3b')](_0x16237a[_0xe7fb('0x2f')],_0x5df9f2[_0xe7fb('0x30')]));if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]){_0x59e015[_0xe7fb('0x3a')]=_[_0xe7fb('0x3d')](_0x59e015[_0xe7fb('0x3a')],{'$or':_[_0xe7fb('0x28')](_0x3bdee9,function(_0x3c4f4b){if(_0x3c4f4b[_0xe7fb('0x2b')]!==_0xe7fb('0x3e')){var _0xeb7c29={};_0xeb7c29[_0x3c4f4b[_0xe7fb('0x25')]]={'$like':'%'+_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]+'%'};return _0xeb7c29;}})});}_0x59e015=_[_0xe7fb('0x3d')]({},_0x59e015,_0x16237a['options']);var _0x261ec5={'where':_0x59e015[_0xe7fb('0x3a')]};return db[_0xe7fb('0x3f')][_0xe7fb('0x1e')](_0x261ec5)['then'](function(_0x3426a9){_0x1086e6[_0xe7fb('0x1e')]=_0x3426a9;if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x40')]){_0x59e015['include']=[{'all':!![]}];}return db[_0xe7fb('0x3f')][_0xe7fb('0x41')](_0x59e015);})[_0xe7fb('0x23')](function(_0x62a8a1){_0x1086e6[_0xe7fb('0x42')]=_0x62a8a1;return _0x1086e6;})[_0xe7fb('0x23')](respondWithFilteredResult(_0x380130,_0x59e015))['catch'](handleError(_0x380130,null));};exports[_0xe7fb('0x43')]=function(_0x35139f,_0x3a96cd){var _0x4b263d={'raw':!![],'where':{'id':_0x35139f[_0xe7fb('0x44')]['id']}},_0x36a341={};_0x36a341['model']=_['keys'](db['SquareReport']['rawAttributes']);_0x36a341['query']=_[_0xe7fb('0x2e')](_0x35139f[_0xe7fb('0x2f')]);_0x36a341[_0xe7fb('0x30')]=_['intersection'](_0x36a341[_0xe7fb('0x2d')],_0x36a341['query']);_0x4b263d[_0xe7fb('0x33')]=_[_0xe7fb('0x31')](_0x36a341['model'],qs[_0xe7fb('0x32')](_0x35139f[_0xe7fb('0x2f')][_0xe7fb('0x32')]));_0x4b263d[_0xe7fb('0x33')]=_0x4b263d['attributes'][_0xe7fb('0x34')]?_0x4b263d[_0xe7fb('0x33')]:_0x36a341[_0xe7fb('0x2d')];if(_0x35139f['query'][_0xe7fb('0x40')]){_0x4b263d[_0xe7fb('0x45')]=[{'all':!![]}];}_0x4b263d=_[_0xe7fb('0x3d')]({},_0x4b263d,_0x35139f[_0xe7fb('0x46')]);return db[_0xe7fb('0x3f')]['find'](_0x4b263d)[_0xe7fb('0x23')](handleEntityNotFound(_0x3a96cd,null))['then'](respondWithResult(_0x3a96cd,null))[_0xe7fb('0x47')](handleError(_0x3a96cd,null));};exports[_0xe7fb('0x48')]=function(_0x3520e3,_0x1ecbfd){return db[_0xe7fb('0x3f')]['create'](_0x3520e3[_0xe7fb('0x49')],{})['then'](respondWithResult(_0x1ecbfd,0xc9))['catch'](handleError(_0x1ecbfd,null));};exports[_0xe7fb('0x22')]=function(_0x3d740f,_0x16327f){if(_0x3d740f['body']['id']){delete _0x3d740f[_0xe7fb('0x49')]['id'];}return db[_0xe7fb('0x3f')]['find']({'where':{'id':_0x3d740f['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x16327f,null))[_0xe7fb('0x23')](saveUpdates(_0x3d740f[_0xe7fb('0x49')],null))[_0xe7fb('0x23')](respondWithResult(_0x16327f,null))[_0xe7fb('0x47')](handleError(_0x16327f,null));};exports[_0xe7fb('0x4a')]=function(_0x18a590,_0x347177){return db['SquareReport'][_0xe7fb('0x4b')]({'where':{'id':_0x18a590['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x347177,null))[_0xe7fb('0x23')](removeEntity(_0x347177,null))['catch'](handleError(_0x347177,null));};exports[_0xe7fb('0x4c')]=function(_0x5efd24,_0x239c56){return db['SquareReport'][_0xe7fb('0x4c')]()['then'](respondWithResult(_0x239c56,null))[_0xe7fb('0x47')](handleError(_0x239c56,null));}; \ No newline at end of file +var _0x8ef6=['merge','options','count','then','includeAll','include','rows','catch','show','params','keys','length','create','body','destroy','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','set','apply','reject','save','update','end','error','name','index','map','SquareReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','filters','filter','where'];(function(_0x76fd91,_0x55330f){var _0x44820e=function(_0x1e1949){while(--_0x1e1949){_0x76fd91['push'](_0x76fd91['shift']());}};_0x44820e(++_0x55330f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4aaa05,_0x29a99d){_0x4aaa05=_0x4aaa05-0x0;var _0x34b7c4=_0x8ef6[_0x4aaa05];return _0x34b7c4;};'use strict';var pdf=require(_0x68ef('0x0'));var emlformat=require(_0x68ef('0x1'));var rimraf=require(_0x68ef('0x2'));var zipdir=require(_0x68ef('0x3'));var jsonpatch=require(_0x68ef('0x4'));var rp=require(_0x68ef('0x5'));var moment=require(_0x68ef('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x68ef('0x7'));var util=require(_0x68ef('0x8'));var path=require(_0x68ef('0x9'));var sox=require(_0x68ef('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xf'));var querystring=require(_0x68ef('0x10'));var Papa=require(_0x68ef('0x11'));var Redis=require(_0x68ef('0x12'));var authService=require(_0x68ef('0x13'));var qs=require(_0x68ef('0x14'));var as=require(_0x68ef('0x15'));var hardwareService=require(_0x68ef('0x16'));var logger=require(_0x68ef('0x17'))(_0x68ef('0x18'));var utils=require(_0x68ef('0x19'));var config=require('../../config/environment');var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x46356f,_0x1e117a){_0x1e117a=_0x1e117a||0xcc;return function(_0x454ef4){if(_0x454ef4){return _0x46356f[_0x68ef('0x1b')](_0x1e117a);}return _0x46356f[_0x68ef('0x1c')](_0x1e117a)['end']();};}function respondWithResult(_0x3b48dd,_0xc50cce){_0xc50cce=_0xc50cce||0xc8;return function(_0x2657c5){if(_0x2657c5){return _0x3b48dd['status'](_0xc50cce)[_0x68ef('0x1d')](_0x2657c5);}};}function respondWithFilteredResult(_0x1764de,_0x24682d){return function(_0x5005ba){if(_0x5005ba){var _0x35493d=_0x5005ba['count'],_0x37c4cc=_0x24682d[_0x68ef('0x1e')],_0x3d1e90=_0x24682d['offset']+_0x24682d['limit'],_0x3780a4;if(_0x3d1e90>=_0x35493d){_0x3d1e90=_0x35493d;_0x3780a4=0xc8;}else{_0x3780a4=0xce;}_0x1764de[_0x68ef('0x1c')](_0x3780a4);return _0x1764de[_0x68ef('0x1f')]('Content-Range',_0x37c4cc+'-'+_0x3d1e90+'/'+_0x35493d)['json'](_0x5005ba);}return null;};}function patchUpdates(_0x3c4c1f){return function(_0x2cd92c){try{jsonpatch[_0x68ef('0x20')](_0x2cd92c,_0x3c4c1f,!![]);}catch(_0x4fad1c){return BPromise[_0x68ef('0x21')](_0x4fad1c);}return _0x2cd92c[_0x68ef('0x22')]();};}function saveUpdates(_0x183f5f,_0x5b246b){return function(_0x3c46d4){if(_0x3c46d4){return _0x3c46d4[_0x68ef('0x23')](_0x183f5f)['then'](function(_0x399da4){return _0x399da4;});}return null;};}function removeEntity(_0xf4760f,_0x19aa3d){return function(_0x5ddec7){if(_0x5ddec7){return _0x5ddec7['destroy']()['then'](function(){_0xf4760f[_0x68ef('0x1c')](0xcc)[_0x68ef('0x24')]();});}};}function handleEntityNotFound(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(!_0x438b4c){_0x312cc9[_0x68ef('0x1b')](0x194);}return _0x438b4c;};}function handleError(_0x258cd5,_0x49374f){_0x49374f=_0x49374f||0x1f4;return function(_0x65fd09){logger[_0x68ef('0x25')](_0x65fd09['stack']);if(_0x65fd09[_0x68ef('0x26')]){delete _0x65fd09['name'];}_0x258cd5['status'](_0x49374f)['send'](_0x65fd09);};}exports[_0x68ef('0x27')]=function(_0x268f32,_0x123041){var _0x29518e={},_0x52e67e={},_0x4a0550={'count':0x0,'rows':[]};var _0x1cbe4f=_[_0x68ef('0x28')](db[_0x68ef('0x29')][_0x68ef('0x2a')],function(_0x22ef25){return{'name':_0x22ef25[_0x68ef('0x2b')],'type':_0x22ef25[_0x68ef('0x2c')][_0x68ef('0x2d')]};});_0x52e67e['model']=_[_0x68ef('0x28')](_0x1cbe4f,_0x68ef('0x26'));_0x52e67e[_0x68ef('0x2e')]=_['keys'](_0x268f32[_0x68ef('0x2e')]);_0x52e67e['filters']=_[_0x68ef('0x2f')](_0x52e67e[_0x68ef('0x30')],_0x52e67e['query']);_0x29518e['attributes']=_[_0x68ef('0x2f')](_0x52e67e[_0x68ef('0x30')],qs['fields'](_0x268f32[_0x68ef('0x2e')][_0x68ef('0x31')]));_0x29518e[_0x68ef('0x32')]=_0x29518e[_0x68ef('0x32')]['length']?_0x29518e[_0x68ef('0x32')]:_0x52e67e[_0x68ef('0x30')];if(!_0x268f32['query'][_0x68ef('0x33')]('nolimit')){_0x29518e[_0x68ef('0x34')]=qs[_0x68ef('0x34')](_0x268f32['query'][_0x68ef('0x34')]);_0x29518e['offset']=qs[_0x68ef('0x1e')](_0x268f32['query'][_0x68ef('0x1e')]);}_0x29518e[_0x68ef('0x35')]=qs[_0x68ef('0x36')](_0x268f32['query'][_0x68ef('0x36')]);_0x29518e['where']=qs[_0x68ef('0x37')](_['pick'](_0x268f32[_0x68ef('0x2e')],_0x52e67e[_0x68ef('0x37')]));if(_0x268f32[_0x68ef('0x2e')][_0x68ef('0x38')]){_0x29518e[_0x68ef('0x39')]=_[_0x68ef('0x3a')](_0x29518e['where'],{'$or':_[_0x68ef('0x28')](_0x1cbe4f,function(_0x15a6ab){if(_0x15a6ab[_0x68ef('0x2c')]!=='VIRTUAL'){var _0x32eddd={};_0x32eddd[_0x15a6ab[_0x68ef('0x26')]]={'$like':'%'+_0x268f32[_0x68ef('0x2e')]['filter']+'%'};return _0x32eddd;}})});}_0x29518e=_['merge']({},_0x29518e,_0x268f32[_0x68ef('0x3b')]);var _0xec7de3={'where':_0x29518e[_0x68ef('0x39')]};return db[_0x68ef('0x29')][_0x68ef('0x3c')](_0xec7de3)[_0x68ef('0x3d')](function(_0x41ffe0){_0x4a0550['count']=_0x41ffe0;if(_0x268f32[_0x68ef('0x2e')][_0x68ef('0x3e')]){_0x29518e[_0x68ef('0x3f')]=[{'all':!![]}];}return db[_0x68ef('0x29')]['findAll'](_0x29518e);})[_0x68ef('0x3d')](function(_0x3a2f53){_0x4a0550[_0x68ef('0x40')]=_0x3a2f53;return _0x4a0550;})[_0x68ef('0x3d')](respondWithFilteredResult(_0x123041,_0x29518e))[_0x68ef('0x41')](handleError(_0x123041,null));};exports[_0x68ef('0x42')]=function(_0x558efb,_0x3f000f){var _0x3f7699={'raw':!![],'where':{'id':_0x558efb[_0x68ef('0x43')]['id']}},_0xf5010c={};_0xf5010c[_0x68ef('0x30')]=_[_0x68ef('0x44')](db[_0x68ef('0x29')][_0x68ef('0x2a')]);_0xf5010c[_0x68ef('0x2e')]=_['keys'](_0x558efb[_0x68ef('0x2e')]);_0xf5010c[_0x68ef('0x37')]=_[_0x68ef('0x2f')](_0xf5010c[_0x68ef('0x30')],_0xf5010c[_0x68ef('0x2e')]);_0x3f7699[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0xf5010c['model'],qs[_0x68ef('0x31')](_0x558efb['query'][_0x68ef('0x31')]));_0x3f7699[_0x68ef('0x32')]=_0x3f7699[_0x68ef('0x32')][_0x68ef('0x45')]?_0x3f7699['attributes']:_0xf5010c[_0x68ef('0x30')];if(_0x558efb['query'][_0x68ef('0x3e')]){_0x3f7699['include']=[{'all':!![]}];}_0x3f7699=_[_0x68ef('0x3a')]({},_0x3f7699,_0x558efb[_0x68ef('0x3b')]);return db[_0x68ef('0x29')]['find'](_0x3f7699)['then'](handleEntityNotFound(_0x3f000f,null))[_0x68ef('0x3d')](respondWithResult(_0x3f000f,null))[_0x68ef('0x41')](handleError(_0x3f000f,null));};exports['create']=function(_0x589688,_0x4b4d6b){return db[_0x68ef('0x29')][_0x68ef('0x46')](_0x589688[_0x68ef('0x47')],{})[_0x68ef('0x3d')](respondWithResult(_0x4b4d6b,0xc9))[_0x68ef('0x41')](handleError(_0x4b4d6b,null));};exports['update']=function(_0x55f385,_0xc39f5b){if(_0x55f385[_0x68ef('0x47')]['id']){delete _0x55f385[_0x68ef('0x47')]['id'];}return db[_0x68ef('0x29')]['find']({'where':{'id':_0x55f385[_0x68ef('0x43')]['id']}})[_0x68ef('0x3d')](handleEntityNotFound(_0xc39f5b,null))[_0x68ef('0x3d')](saveUpdates(_0x55f385[_0x68ef('0x47')],null))['then'](respondWithResult(_0xc39f5b,null))['catch'](handleError(_0xc39f5b,null));};exports[_0x68ef('0x48')]=function(_0x3c3074,_0x566e7c){return db[_0x68ef('0x29')][_0x68ef('0x49')]({'where':{'id':_0x3c3074[_0x68ef('0x43')]['id']}})[_0x68ef('0x3d')](handleEntityNotFound(_0x566e7c,null))[_0x68ef('0x3d')](removeEntity(_0x566e7c,null))['catch'](handleError(_0x566e7c,null));};exports[_0x68ef('0x4a')]=function(_0x3984ca,_0x340bfb){return db['SquareReport'][_0x68ef('0x4a')]()[_0x68ef('0x3d')](respondWithResult(_0x340bfb,null))[_0x68ef('0x41')](handleError(_0x340bfb,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 75659e0..de1cdbf 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 _0xb593=['define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','api','moment','bluebird','path','../../config/environment','./squareReport.attributes'];(function(_0x27b41b,_0x4943cb){var _0x5a1086=function(_0x43f771){while(--_0x43f771){_0x27b41b['push'](_0x27b41b['shift']());}};_0x5a1086(++_0x4943cb);}(_0xb593,0x1a6));var _0x3b59=function(_0x41031d,_0x17a3ee){_0x41031d=_0x41031d-0x0;var _0x2606c8=_0xb593[_0x41031d];return _0x2606c8;};'use strict';var _=require(_0x3b59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3b59('0x1'));var moment=require(_0x3b59('0x2'));var BPromise=require(_0x3b59('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b59('0x4'));var rimraf=require('rimraf');var config=require(_0x3b59('0x5'));var attributes=require(_0x3b59('0x6'));module['exports']=function(_0x2bcfe6,_0x49bd89){return _0x2bcfe6[_0x3b59('0x7')](_0x3b59('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x3b59('0x9'),'fields':[_0x3b59('0xa'),_0x3b59('0xb')]},{'name':_0x3b59('0xc'),'fields':[_0x3b59('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea0f=['leaveAt','lodash','util','api','moment','bluebird','path','rimraf','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid'];(function(_0x5be1d9,_0x54415d){var _0x4db062=function(_0x229721){while(--_0x229721){_0x5be1d9['push'](_0x5be1d9['shift']());}};_0x4db062(++_0x54415d);}(_0xea0f,0x71));var _0xfea0=function(_0x2353d2,_0x3fd86b){_0x2353d2=_0x2353d2-0x0;var _0x18b4ba=_0xea0f[_0x2353d2];return _0x18b4ba;};'use strict';var _=require(_0xfea0('0x0'));var util=require(_0xfea0('0x1'));var logger=require('../../config/logger')(_0xfea0('0x2'));var moment=require(_0xfea0('0x3'));var BPromise=require(_0xfea0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfea0('0x5'));var rimraf=require(_0xfea0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfea0('0x7'));module[_0xfea0('0x8')]=function(_0x59374c,_0x1e7458){return _0x59374c[_0xfea0('0x9')]('SquareReport',attributes,{'tableName':_0xfea0('0xa'),'paranoid':![],'indexes':[{'name':_0xfea0('0xb'),'fields':[_0xfea0('0xc'),'project_name']},{'name':_0xfea0('0xd'),'fields':[_0xfea0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 3a397f9..2704f6e 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 _0x556f=['stringify','error','message','SquareReport,\x20%s,\x20%s','info','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x556f,0x14f));var _0xf556=function(_0x55347a,_0x33c745){_0x55347a=_0x55347a-0x0;var _0x475c73=_0x556f[_0x55347a];return _0x475c73;};'use strict';var _=require('lodash');var util=require(_0xf556('0x0'));var moment=require(_0xf556('0x1'));var BPromise=require(_0xf556('0x2'));var rs=require(_0xf556('0x3'));var fs=require('fs');var Redis=require(_0xf556('0x4'));var db=require(_0xf556('0x5'))['db'];var utils=require(_0xf556('0x6'));var logger=require(_0xf556('0x7'))(_0xf556('0x8'));var config=require(_0xf556('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf556('0xa')][_0xf556('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346ec2,_0x52ec25,_0x125681){return new BPromise(function(_0x32507f,_0xb69a98){return client[_0xf556('0xc')](_0x346ec2,_0x125681)[_0xf556('0xd')](function(_0x15a2c4){logger['info']('SquareReport,\x20%s,\x20%s',_0x52ec25,_0xf556('0xe'));logger[_0xf556('0xf')](_0xf556('0x10'),_0x52ec25,_0xf556('0xe'),JSON[_0xf556('0x11')](_0x15a2c4));if(_0x15a2c4[_0xf556('0x12')]){if(_0x15a2c4['error']['code']===0x1f4){logger[_0xf556('0x12')]('SquareReport,\x20%s,\x20%s',_0x52ec25,_0x15a2c4[_0xf556('0x12')][_0xf556('0x13')]);return _0xb69a98(_0x15a2c4[_0xf556('0x12')][_0xf556('0x13')]);}logger['error'](_0xf556('0x14'),_0x52ec25,_0x15a2c4[_0xf556('0x12')]['message']);return _0x32507f(_0x15a2c4[_0xf556('0x12')][_0xf556('0x13')]);}else{logger[_0xf556('0x15')](_0xf556('0x14'),_0x52ec25,_0xf556('0xe'));_0x32507f(_0x15a2c4['result'][_0xf556('0x13')]);}})[_0xf556('0x16')](function(_0x2a4fc6){logger[_0xf556('0x12')]('SquareReport,\x20%s,\x20%s',_0x52ec25,_0x2a4fc6);_0xb69a98(_0x2a4fc6);});});}exports[_0xf556('0x17')]=function(_0x298e28){var _0x4a3cfa=this;return new Promise(function(_0x3429e9,_0x1a13a0){return db[_0xf556('0x18')][_0xf556('0x19')](_0x298e28['body'],{'raw':_0x298e28[_0xf556('0x1a')]?_0x298e28[_0xf556('0x1a')][_0xf556('0x1b')]===undefined?!![]:![]:!![]})[_0xf556('0xd')](function(_0x467d29){logger['info'](_0xf556('0x17'),_0x298e28);logger['debug'](_0xf556('0x17'),_0x298e28,JSON[_0xf556('0x11')](_0x467d29));_0x3429e9(_0x467d29);})[_0xf556('0x16')](function(_0x4684b8){logger[_0xf556('0x12')](_0xf556('0x17'),_0x4684b8['message'],_0x298e28);_0x1a13a0(_0x4a3cfa['error'](0x1f4,_0x4684b8['message']));});});};exports[_0xf556('0x1c')]=function(_0x33b216){var _0x5db5bd=this;return new Promise(function(_0x565f2e,_0x3915aa){return db[_0xf556('0x18')][_0xf556('0x1d')](_0x33b216[_0xf556('0x1e')],{'raw':_0x33b216['options']?_0x33b216['options'][_0xf556('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33b216[_0xf556('0x1a')]?_0x33b216['options'][_0xf556('0x1f')]||null:null,'attributes':_0x33b216[_0xf556('0x1a')]?_0x33b216['options']['attributes']||null:null,'limit':_0x33b216[_0xf556('0x1a')]?_0x33b216[_0xf556('0x1a')]['limit']||null:null})['then'](function(_0x100433){logger[_0xf556('0x15')]('UpdateSquareReport',_0x33b216);logger[_0xf556('0xf')]('UpdateSquareReport',_0x33b216,JSON[_0xf556('0x11')](_0x100433));_0x565f2e(_0x100433);})['catch'](function(_0x421148){logger['error'](_0xf556('0x1c'),_0x421148['message'],_0x33b216);_0x3915aa(_0x5db5bd[_0xf556('0x12')](0x1f4,_0x421148[_0xf556('0x13')]));});});}; \ No newline at end of file +var _0xd3c3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','body','options','UpdateSquareReport','SquareReport','update','raw','attributes','limit','lodash','util','moment','randomstring'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd3c3,0x1d8));var _0x3d3c=function(_0x40464b,_0x5188be){_0x40464b=_0x40464b-0x0;var _0x2c2462=_0xd3c3[_0x40464b];return _0x2c2462;};'use strict';var _=require(_0x3d3c('0x0'));var util=require(_0x3d3c('0x1'));var moment=require(_0x3d3c('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d3c('0x3'));var fs=require('fs');var Redis=require(_0x3d3c('0x4'));var db=require(_0x3d3c('0x5'))['db'];var utils=require(_0x3d3c('0x6'));var logger=require(_0x3d3c('0x7'))(_0x3d3c('0x8'));var config=require(_0x3d3c('0x9'));var jayson=require(_0x3d3c('0xa'));var client=jayson[_0x3d3c('0xb')][_0x3d3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ac9c9,_0x20f663,_0x230ab1){return new BPromise(function(_0x9a2860,_0x4b8a85){return client[_0x3d3c('0xd')](_0x3ac9c9,_0x230ab1)[_0x3d3c('0xe')](function(_0x12e766){logger[_0x3d3c('0xf')](_0x3d3c('0x10'),_0x20f663,_0x3d3c('0x11'));logger[_0x3d3c('0x12')](_0x3d3c('0x13'),_0x20f663,_0x3d3c('0x11'),JSON[_0x3d3c('0x14')](_0x12e766));if(_0x12e766[_0x3d3c('0x15')]){if(_0x12e766[_0x3d3c('0x15')][_0x3d3c('0x16')]===0x1f4){logger[_0x3d3c('0x15')](_0x3d3c('0x10'),_0x20f663,_0x12e766[_0x3d3c('0x15')]['message']);return _0x4b8a85(_0x12e766[_0x3d3c('0x15')]['message']);}logger['error'](_0x3d3c('0x10'),_0x20f663,_0x12e766[_0x3d3c('0x15')][_0x3d3c('0x17')]);return _0x9a2860(_0x12e766['error']['message']);}else{logger['info'](_0x3d3c('0x10'),_0x20f663,_0x3d3c('0x11'));_0x9a2860(_0x12e766['result']['message']);}})[_0x3d3c('0x18')](function(_0x156d73){logger[_0x3d3c('0x15')]('SquareReport,\x20%s,\x20%s',_0x20f663,_0x156d73);_0x4b8a85(_0x156d73);});});}exports[_0x3d3c('0x19')]=function(_0x511833){var _0x54c75f=this;return new Promise(function(_0x10b0a4,_0x14db52){return db['SquareReport']['create'](_0x511833[_0x3d3c('0x1a')],{'raw':_0x511833[_0x3d3c('0x1b')]?_0x511833[_0x3d3c('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3d3c('0xe')](function(_0x5a1efb){logger[_0x3d3c('0xf')]('CreateSquareReport',_0x511833);logger[_0x3d3c('0x12')](_0x3d3c('0x19'),_0x511833,JSON[_0x3d3c('0x14')](_0x5a1efb));_0x10b0a4(_0x5a1efb);})[_0x3d3c('0x18')](function(_0x7e334){logger[_0x3d3c('0x15')](_0x3d3c('0x19'),_0x7e334['message'],_0x511833);_0x14db52(_0x54c75f[_0x3d3c('0x15')](0x1f4,_0x7e334[_0x3d3c('0x17')]));});});};exports[_0x3d3c('0x1c')]=function(_0x5f0fc6){var _0x41c12b=this;return new Promise(function(_0x28c55b,_0xd38f9a){return db[_0x3d3c('0x1d')][_0x3d3c('0x1e')](_0x5f0fc6[_0x3d3c('0x1a')],{'raw':_0x5f0fc6[_0x3d3c('0x1b')]?_0x5f0fc6[_0x3d3c('0x1b')][_0x3d3c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0fc6[_0x3d3c('0x1b')]?_0x5f0fc6['options']['where']||null:null,'attributes':_0x5f0fc6['options']?_0x5f0fc6[_0x3d3c('0x1b')][_0x3d3c('0x20')]||null:null,'limit':_0x5f0fc6[_0x3d3c('0x1b')]?_0x5f0fc6[_0x3d3c('0x1b')][_0x3d3c('0x21')]||null:null})[_0x3d3c('0xe')](function(_0x314b42){logger[_0x3d3c('0xf')](_0x3d3c('0x1c'),_0x5f0fc6);logger[_0x3d3c('0x12')]('UpdateSquareReport',_0x5f0fc6,JSON[_0x3d3c('0x14')](_0x314b42));_0x28c55b(_0x314b42);})[_0x3d3c('0x18')](function(_0x9dd234){logger[_0x3d3c('0x15')](_0x3d3c('0x1c'),_0x9dd234[_0x3d3c('0x17')],_0x5f0fc6);_0xd38f9a(_0x41c12b[_0x3d3c('0x15')](0x1f4,_0x9dd234[_0x3d3c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ca20e38..b22da8d 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 _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x2f9200,_0x435a09){var _0x4a9958=function(_0x3dc832){while(--_0x3dc832){_0x2f9200['push'](_0x2f9200['shift']());}};_0x4a9958(++_0x435a09);}(_0x7a54,0x106));var _0x47a5=function(_0x6ba1f0,_0x18425a){_0x6ba1f0=_0x6ba1f0-0x0;var _0x81a945=_0x7a54[_0x6ba1f0];return _0x81a945;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2242b8,_0x1c2d50){var _0x47de20=function(_0x10a324){while(--_0x10a324){_0x2242b8['push'](_0x2242b8['shift']());}};_0x47de20(++_0x1c2d50);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4fefcc,_0x4debb5){_0x4fefcc=_0x4fefcc-0x0;var _0x35340f=_0x5f2f[_0x4fefcc];return _0x35340f;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3a746af..561ff36 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 _0x3af2=['TEXT','sequelize','STRING'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x3af2,0x187));var _0x23af=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0x3af2[_0x441f7a];return _0x4821da;};'use strict';var Sequelize=require(_0x23af('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x23af('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x23af('0x2')]},'project_name':{'type':Sequelize[_0x23af('0x1')]},'callerid':{'type':Sequelize[_0x23af('0x1')]}}; \ No newline at end of file +var _0xcc41=['exports','STRING'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xcc41,0x150));var _0x1cc4=function(_0x46733d,_0x28cc9a){_0x46733d=_0x46733d-0x0;var _0xb37111=_0xcc41[_0x46733d];return _0xb37111;};'use strict';var Sequelize=require('sequelize');module[_0x1cc4('0x0')]={'uniqueid':{'type':Sequelize[_0x1cc4('0x1')]},'node':{'type':Sequelize[_0x1cc4('0x1')]},'application':{'type':Sequelize[_0x1cc4('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x1cc4('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index a782ac1..984334c 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 _0x781e=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','update','then','destroy','error','stack','name','send','map','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareDetailsReport','catch','show','keys','includeAll','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x781e,0x1d6));var _0xe781=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x781e[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xe781('0x0'));var emlformat=require(_0xe781('0x1'));var rimraf=require(_0xe781('0x2'));var zipdir=require(_0xe781('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe781('0x4'));var moment=require('moment');var BPromise=require(_0xe781('0x5'));var Mustache=require(_0xe781('0x6'));var util=require(_0xe781('0x7'));var path=require(_0xe781('0x8'));var sox=require(_0xe781('0x9'));var csv=require(_0xe781('0xa'));var ejs=require(_0xe781('0xb'));var fs=require('fs');var _=require(_0xe781('0xc'));var squel=require('squel');var crypto=require(_0xe781('0xd'));var jsforce=require(_0xe781('0xe'));var deskjs=require(_0xe781('0xf'));var toCsv=require(_0xe781('0xa'));var querystring=require(_0xe781('0x10'));var Papa=require(_0xe781('0x11'));var Redis=require('ioredis');var authService=require(_0xe781('0x12'));var qs=require(_0xe781('0x13'));var as=require(_0xe781('0x14'));var hardwareService=require(_0xe781('0x15'));var logger=require(_0xe781('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe781('0x17'))['db'];function respondWithStatusCode(_0x28c4f0,_0x48976b){_0x48976b=_0x48976b||0xcc;return function(_0x289fba){if(_0x289fba){return _0x28c4f0[_0xe781('0x18')](_0x48976b);}return _0x28c4f0[_0xe781('0x19')](_0x48976b)[_0xe781('0x1a')]();};}function respondWithResult(_0x13ff39,_0xe64802){_0xe64802=_0xe64802||0xc8;return function(_0x2645fc){if(_0x2645fc){return _0x13ff39[_0xe781('0x19')](_0xe64802)[_0xe781('0x1b')](_0x2645fc);}};}function respondWithFilteredResult(_0x2f3688,_0x2672f4){return function(_0x475f21){if(_0x475f21){var _0x1b6909=_0x475f21[_0xe781('0x1c')],_0x4e84a8=_0x2672f4['offset'],_0x51643e=_0x2672f4[_0xe781('0x1d')]+_0x2672f4['limit'],_0x16c0e5;if(_0x51643e>=_0x1b6909){_0x51643e=_0x1b6909;_0x16c0e5=0xc8;}else{_0x16c0e5=0xce;}_0x2f3688[_0xe781('0x19')](_0x16c0e5);return _0x2f3688['set'](_0xe781('0x1e'),_0x4e84a8+'-'+_0x51643e+'/'+_0x1b6909)[_0xe781('0x1b')](_0x475f21);}return null;};}function patchUpdates(_0x3030e7){return function(_0x197688){try{jsonpatch['apply'](_0x197688,_0x3030e7,!![]);}catch(_0x299cc2){return BPromise['reject'](_0x299cc2);}return _0x197688['save']();};}function saveUpdates(_0x517d16,_0x13aa38){return function(_0x133a94){if(_0x133a94){return _0x133a94[_0xe781('0x1f')](_0x517d16)[_0xe781('0x20')](function(_0xd854c3){return _0xd854c3;});}return null;};}function removeEntity(_0x35d1bd,_0x235ea0){return function(_0x434364){if(_0x434364){return _0x434364[_0xe781('0x21')]()[_0xe781('0x20')](function(){_0x35d1bd[_0xe781('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6d1ea3,_0x52da94){return function(_0x3e3389){if(!_0x3e3389){_0x6d1ea3['sendStatus'](0x194);}return _0x3e3389;};}function handleError(_0xcb11b,_0x775ef5){_0x775ef5=_0x775ef5||0x1f4;return function(_0xdc49df){logger[_0xe781('0x22')](_0xdc49df[_0xe781('0x23')]);if(_0xdc49df[_0xe781('0x24')]){delete _0xdc49df[_0xe781('0x24')];}_0xcb11b[_0xe781('0x19')](_0x775ef5)[_0xe781('0x25')](_0xdc49df);};}exports['index']=function(_0x510b9f,_0x38722){var _0x4bd61b={},_0x5a07ec={},_0x3266ec={'count':0x0,'rows':[]};var _0x41d735=_[_0xe781('0x26')](db['SquareDetailsReport'][_0xe781('0x27')],function(_0x562262){return{'name':_0x562262['fieldName'],'type':_0x562262['type'][_0xe781('0x28')]};});_0x5a07ec[_0xe781('0x29')]=_['map'](_0x41d735,_0xe781('0x24'));_0x5a07ec[_0xe781('0x2a')]=_['keys'](_0x510b9f[_0xe781('0x2a')]);_0x5a07ec[_0xe781('0x2b')]=_['intersection'](_0x5a07ec[_0xe781('0x29')],_0x5a07ec[_0xe781('0x2a')]);_0x4bd61b[_0xe781('0x2c')]=_[_0xe781('0x2d')](_0x5a07ec['model'],qs[_0xe781('0x2e')](_0x510b9f[_0xe781('0x2a')][_0xe781('0x2e')]));_0x4bd61b[_0xe781('0x2c')]=_0x4bd61b['attributes'][_0xe781('0x2f')]?_0x4bd61b[_0xe781('0x2c')]:_0x5a07ec['model'];if(!_0x510b9f['query'][_0xe781('0x30')](_0xe781('0x31'))){_0x4bd61b['limit']=qs['limit'](_0x510b9f[_0xe781('0x2a')][_0xe781('0x32')]);_0x4bd61b[_0xe781('0x1d')]=qs[_0xe781('0x1d')](_0x510b9f[_0xe781('0x2a')][_0xe781('0x1d')]);}_0x4bd61b['order']=qs[_0xe781('0x33')](_0x510b9f[_0xe781('0x2a')][_0xe781('0x33')]);_0x4bd61b[_0xe781('0x34')]=qs[_0xe781('0x2b')](_[_0xe781('0x35')](_0x510b9f[_0xe781('0x2a')],_0x5a07ec[_0xe781('0x2b')]));if(_0x510b9f[_0xe781('0x2a')][_0xe781('0x36')]){_0x4bd61b[_0xe781('0x34')]=_[_0xe781('0x37')](_0x4bd61b[_0xe781('0x34')],{'$or':_[_0xe781('0x26')](_0x41d735,function(_0x57c17a){if(_0x57c17a[_0xe781('0x38')]!==_0xe781('0x39')){var _0x5ce18a={};_0x5ce18a[_0x57c17a[_0xe781('0x24')]]={'$like':'%'+_0x510b9f['query'][_0xe781('0x36')]+'%'};return _0x5ce18a;}})});}_0x4bd61b=_['merge']({},_0x4bd61b,_0x510b9f[_0xe781('0x3a')]);var _0x210a7d={'where':_0x4bd61b[_0xe781('0x34')]};return db[_0xe781('0x3b')][_0xe781('0x1c')](_0x210a7d)['then'](function(_0x3313d2){_0x3266ec[_0xe781('0x1c')]=_0x3313d2;if(_0x510b9f[_0xe781('0x2a')]['includeAll']){_0x4bd61b['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x4bd61b);})[_0xe781('0x20')](function(_0x1bf4c9){_0x3266ec['rows']=_0x1bf4c9;return _0x3266ec;})[_0xe781('0x20')](respondWithFilteredResult(_0x38722,_0x4bd61b))[_0xe781('0x3c')](handleError(_0x38722,null));};exports[_0xe781('0x3d')]=function(_0x5e2b11,_0x492cd8){var _0x3353f0={'raw':!![],'where':{'id':_0x5e2b11['params']['id']}},_0x5fdf96={};_0x5fdf96[_0xe781('0x29')]=_[_0xe781('0x3e')](db[_0xe781('0x3b')]['rawAttributes']);_0x5fdf96[_0xe781('0x2a')]=_[_0xe781('0x3e')](_0x5e2b11[_0xe781('0x2a')]);_0x5fdf96[_0xe781('0x2b')]=_[_0xe781('0x2d')](_0x5fdf96['model'],_0x5fdf96['query']);_0x3353f0[_0xe781('0x2c')]=_[_0xe781('0x2d')](_0x5fdf96[_0xe781('0x29')],qs[_0xe781('0x2e')](_0x5e2b11['query'][_0xe781('0x2e')]));_0x3353f0[_0xe781('0x2c')]=_0x3353f0[_0xe781('0x2c')][_0xe781('0x2f')]?_0x3353f0[_0xe781('0x2c')]:_0x5fdf96[_0xe781('0x29')];if(_0x5e2b11['query'][_0xe781('0x3f')]){_0x3353f0['include']=[{'all':!![]}];}_0x3353f0=_[_0xe781('0x37')]({},_0x3353f0,_0x5e2b11[_0xe781('0x3a')]);return db[_0xe781('0x3b')]['find'](_0x3353f0)['then'](handleEntityNotFound(_0x492cd8,null))[_0xe781('0x20')](respondWithResult(_0x492cd8,null))['catch'](handleError(_0x492cd8,null));};exports[_0xe781('0x40')]=function(_0x4f2afc,_0x1dffce){return db[_0xe781('0x3b')][_0xe781('0x40')](_0x4f2afc[_0xe781('0x41')],{})['then'](respondWithResult(_0x1dffce,0xc9))[_0xe781('0x3c')](handleError(_0x1dffce,null));};exports['update']=function(_0x1c4c9f,_0x5ee960){if(_0x1c4c9f[_0xe781('0x41')]['id']){delete _0x1c4c9f[_0xe781('0x41')]['id'];}return db[_0xe781('0x3b')][_0xe781('0x42')]({'where':{'id':_0x1c4c9f[_0xe781('0x43')]['id']}})[_0xe781('0x20')](handleEntityNotFound(_0x5ee960,null))[_0xe781('0x20')](saveUpdates(_0x1c4c9f['body'],null))[_0xe781('0x20')](respondWithResult(_0x5ee960,null))[_0xe781('0x3c')](handleError(_0x5ee960,null));};exports[_0xe781('0x21')]=function(_0x136f93,_0x245c22){return db[_0xe781('0x3b')][_0xe781('0x42')]({'where':{'id':_0x136f93[_0xe781('0x43')]['id']}})['then'](handleEntityNotFound(_0x245c22,null))['then'](removeEntity(_0x245c22,null))[_0xe781('0x3c')](handleError(_0x245c22,null));};exports[_0xe781('0x44')]=function(_0x1100f2,_0x41230d){return db[_0xe781('0x3b')][_0xe781('0x44')]()[_0xe781('0x20')](respondWithResult(_0x41230d,null))[_0xe781('0x3c')](handleError(_0x41230d,null));}; \ No newline at end of file +var _0xe1e7=['to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','apply','reject','save','then','destroy','error','stack','name','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','util','sox'];(function(_0x59602c,_0x31958d){var _0x54eda2=function(_0x33c3f5){while(--_0x33c3f5){_0x59602c['push'](_0x59602c['shift']());}};_0x54eda2(++_0x31958d);}(_0xe1e7,0x19d));var _0x7e1e=function(_0x5ba57f,_0x58711b){_0x5ba57f=_0x5ba57f-0x0;var _0x3162b6=_0xe1e7[_0x5ba57f];return _0x3162b6;};'use strict';var pdf=require(_0x7e1e('0x0'));var emlformat=require(_0x7e1e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e1e('0x2'));var rp=require('request-promise');var moment=require(_0x7e1e('0x3'));var BPromise=require(_0x7e1e('0x4'));var Mustache=require('mustache');var util=require(_0x7e1e('0x5'));var path=require('path');var sox=require(_0x7e1e('0x6'));var csv=require(_0x7e1e('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e1e('0x8'));var squel=require('squel');var crypto=require(_0x7e1e('0x9'));var jsforce=require(_0x7e1e('0xa'));var deskjs=require(_0x7e1e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7e1e('0xc'));var Papa=require('papaparse');var Redis=require(_0x7e1e('0xd'));var authService=require(_0x7e1e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7e1e('0xf'));var hardwareService=require(_0x7e1e('0x10'));var logger=require(_0x7e1e('0x11'))(_0x7e1e('0x12'));var utils=require(_0x7e1e('0x13'));var config=require(_0x7e1e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x500c8b,_0x4660be){_0x4660be=_0x4660be||0xcc;return function(_0xe5c599){if(_0xe5c599){return _0x500c8b['sendStatus'](_0x4660be);}return _0x500c8b[_0x7e1e('0x15')](_0x4660be)[_0x7e1e('0x16')]();};}function respondWithResult(_0x4c3161,_0x1d1338){_0x1d1338=_0x1d1338||0xc8;return function(_0x56a576){if(_0x56a576){return _0x4c3161[_0x7e1e('0x15')](_0x1d1338)[_0x7e1e('0x17')](_0x56a576);}};}function respondWithFilteredResult(_0x2f7fe4,_0x561e1e){return function(_0x57dd99){if(_0x57dd99){var _0x293af7=_0x57dd99[_0x7e1e('0x18')],_0x273b1e=_0x561e1e[_0x7e1e('0x19')],_0x449774=_0x561e1e[_0x7e1e('0x19')]+_0x561e1e['limit'],_0x503bc3;if(_0x449774>=_0x293af7){_0x449774=_0x293af7;_0x503bc3=0xc8;}else{_0x503bc3=0xce;}_0x2f7fe4[_0x7e1e('0x15')](_0x503bc3);return _0x2f7fe4[_0x7e1e('0x1a')]('Content-Range',_0x273b1e+'-'+_0x449774+'/'+_0x293af7)[_0x7e1e('0x17')](_0x57dd99);}return null;};}function patchUpdates(_0x207c4c){return function(_0x5cfbc8){try{jsonpatch[_0x7e1e('0x1b')](_0x5cfbc8,_0x207c4c,!![]);}catch(_0xd3d24a){return BPromise[_0x7e1e('0x1c')](_0xd3d24a);}return _0x5cfbc8[_0x7e1e('0x1d')]();};}function saveUpdates(_0x1b4538,_0x4704a1){return function(_0x5e594f){if(_0x5e594f){return _0x5e594f['update'](_0x1b4538)[_0x7e1e('0x1e')](function(_0x328478){return _0x328478;});}return null;};}function removeEntity(_0x22f92a,_0x1914a5){return function(_0x7f5d11){if(_0x7f5d11){return _0x7f5d11[_0x7e1e('0x1f')]()[_0x7e1e('0x1e')](function(){_0x22f92a['status'](0xcc)[_0x7e1e('0x16')]();});}};}function handleEntityNotFound(_0x9ace43,_0x39cd18){return function(_0x3a43cc){if(!_0x3a43cc){_0x9ace43['sendStatus'](0x194);}return _0x3a43cc;};}function handleError(_0x22a0f7,_0x52cdb2){_0x52cdb2=_0x52cdb2||0x1f4;return function(_0x38b184){logger[_0x7e1e('0x20')](_0x38b184[_0x7e1e('0x21')]);if(_0x38b184[_0x7e1e('0x22')]){delete _0x38b184[_0x7e1e('0x22')];}_0x22a0f7['status'](_0x52cdb2)['send'](_0x38b184);};}exports['index']=function(_0x570bef,_0x222714){var _0x5a5311={},_0x17e638={},_0x2dcc44={'count':0x0,'rows':[]};var _0x50b574=_[_0x7e1e('0x23')](db['SquareDetailsReport']['rawAttributes'],function(_0x44922f){return{'name':_0x44922f[_0x7e1e('0x24')],'type':_0x44922f['type'][_0x7e1e('0x25')]};});_0x17e638[_0x7e1e('0x26')]=_[_0x7e1e('0x23')](_0x50b574,_0x7e1e('0x22'));_0x17e638[_0x7e1e('0x27')]=_[_0x7e1e('0x28')](_0x570bef[_0x7e1e('0x27')]);_0x17e638[_0x7e1e('0x29')]=_[_0x7e1e('0x2a')](_0x17e638[_0x7e1e('0x26')],_0x17e638['query']);_0x5a5311[_0x7e1e('0x2b')]=_[_0x7e1e('0x2a')](_0x17e638[_0x7e1e('0x26')],qs['fields'](_0x570bef['query'][_0x7e1e('0x2c')]));_0x5a5311[_0x7e1e('0x2b')]=_0x5a5311[_0x7e1e('0x2b')][_0x7e1e('0x2d')]?_0x5a5311[_0x7e1e('0x2b')]:_0x17e638[_0x7e1e('0x26')];if(!_0x570bef[_0x7e1e('0x27')][_0x7e1e('0x2e')](_0x7e1e('0x2f'))){_0x5a5311[_0x7e1e('0x30')]=qs[_0x7e1e('0x30')](_0x570bef[_0x7e1e('0x27')]['limit']);_0x5a5311[_0x7e1e('0x19')]=qs[_0x7e1e('0x19')](_0x570bef[_0x7e1e('0x27')][_0x7e1e('0x19')]);}_0x5a5311[_0x7e1e('0x31')]=qs[_0x7e1e('0x32')](_0x570bef[_0x7e1e('0x27')][_0x7e1e('0x32')]);_0x5a5311[_0x7e1e('0x33')]=qs[_0x7e1e('0x29')](_[_0x7e1e('0x34')](_0x570bef['query'],_0x17e638[_0x7e1e('0x29')]));if(_0x570bef[_0x7e1e('0x27')][_0x7e1e('0x35')]){_0x5a5311[_0x7e1e('0x33')]=_['merge'](_0x5a5311['where'],{'$or':_[_0x7e1e('0x23')](_0x50b574,function(_0x2ba4fa){if(_0x2ba4fa[_0x7e1e('0x36')]!==_0x7e1e('0x37')){var _0x1a2414={};_0x1a2414[_0x2ba4fa[_0x7e1e('0x22')]]={'$like':'%'+_0x570bef['query'][_0x7e1e('0x35')]+'%'};return _0x1a2414;}})});}_0x5a5311=_[_0x7e1e('0x38')]({},_0x5a5311,_0x570bef[_0x7e1e('0x39')]);var _0x2c65ad={'where':_0x5a5311['where']};return db[_0x7e1e('0x3a')]['count'](_0x2c65ad)['then'](function(_0x515cae){_0x2dcc44['count']=_0x515cae;if(_0x570bef[_0x7e1e('0x27')][_0x7e1e('0x3b')]){_0x5a5311[_0x7e1e('0x3c')]=[{'all':!![]}];}return db[_0x7e1e('0x3a')][_0x7e1e('0x3d')](_0x5a5311);})[_0x7e1e('0x1e')](function(_0x55c2fe){_0x2dcc44[_0x7e1e('0x3e')]=_0x55c2fe;return _0x2dcc44;})[_0x7e1e('0x1e')](respondWithFilteredResult(_0x222714,_0x5a5311))[_0x7e1e('0x3f')](handleError(_0x222714,null));};exports[_0x7e1e('0x40')]=function(_0xc79972,_0x193707){var _0x263ed8={'raw':!![],'where':{'id':_0xc79972[_0x7e1e('0x41')]['id']}},_0x1e6391={};_0x1e6391[_0x7e1e('0x26')]=_['keys'](db['SquareDetailsReport'][_0x7e1e('0x42')]);_0x1e6391['query']=_[_0x7e1e('0x28')](_0xc79972[_0x7e1e('0x27')]);_0x1e6391[_0x7e1e('0x29')]=_['intersection'](_0x1e6391[_0x7e1e('0x26')],_0x1e6391[_0x7e1e('0x27')]);_0x263ed8[_0x7e1e('0x2b')]=_['intersection'](_0x1e6391[_0x7e1e('0x26')],qs[_0x7e1e('0x2c')](_0xc79972['query'][_0x7e1e('0x2c')]));_0x263ed8[_0x7e1e('0x2b')]=_0x263ed8['attributes'][_0x7e1e('0x2d')]?_0x263ed8[_0x7e1e('0x2b')]:_0x1e6391[_0x7e1e('0x26')];if(_0xc79972[_0x7e1e('0x27')]['includeAll']){_0x263ed8['include']=[{'all':!![]}];}_0x263ed8=_[_0x7e1e('0x38')]({},_0x263ed8,_0xc79972['options']);return db[_0x7e1e('0x3a')][_0x7e1e('0x43')](_0x263ed8)[_0x7e1e('0x1e')](handleEntityNotFound(_0x193707,null))['then'](respondWithResult(_0x193707,null))['catch'](handleError(_0x193707,null));};exports['create']=function(_0x2d8e77,_0xf9161f){return db[_0x7e1e('0x3a')]['create'](_0x2d8e77[_0x7e1e('0x44')],{})[_0x7e1e('0x1e')](respondWithResult(_0xf9161f,0xc9))[_0x7e1e('0x3f')](handleError(_0xf9161f,null));};exports['update']=function(_0x3057bf,_0x18fd71){if(_0x3057bf[_0x7e1e('0x44')]['id']){delete _0x3057bf[_0x7e1e('0x44')]['id'];}return db[_0x7e1e('0x3a')]['find']({'where':{'id':_0x3057bf['params']['id']}})[_0x7e1e('0x1e')](handleEntityNotFound(_0x18fd71,null))[_0x7e1e('0x1e')](saveUpdates(_0x3057bf[_0x7e1e('0x44')],null))[_0x7e1e('0x1e')](respondWithResult(_0x18fd71,null))['catch'](handleError(_0x18fd71,null));};exports[_0x7e1e('0x1f')]=function(_0x140f9b,_0x4f873e){return db[_0x7e1e('0x3a')][_0x7e1e('0x43')]({'where':{'id':_0x140f9b['params']['id']}})[_0x7e1e('0x1e')](handleEntityNotFound(_0x4f873e,null))[_0x7e1e('0x1e')](removeEntity(_0x4f873e,null))[_0x7e1e('0x3f')](handleError(_0x4f873e,null));};exports[_0x7e1e('0x45')]=function(_0x5c0c01,_0x380c25){return db[_0x7e1e('0x3a')][_0x7e1e('0x45')]()[_0x7e1e('0x1e')](respondWithResult(_0x380c25,null))[_0x7e1e('0x3f')](handleError(_0x380c25,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index cb06168..650b5bd 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 _0x7d8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x113fce,_0x2a2062){var _0x5882d7=function(_0x220689){while(--_0x220689){_0x113fce['push'](_0x113fce['shift']());}};_0x5882d7(++_0x2a2062);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x7d8a[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0xa7d8('0x0'));var util=require(_0xa7d8('0x1'));var logger=require(_0xa7d8('0x2'))(_0xa7d8('0x3'));var moment=require(_0xa7d8('0x4'));var BPromise=require(_0xa7d8('0x5'));var rp=require(_0xa7d8('0x6'));var fs=require('fs');var path=require(_0xa7d8('0x7'));var rimraf=require(_0xa7d8('0x8'));var config=require(_0xa7d8('0x9'));var attributes=require(_0xa7d8('0xa'));module[_0xa7d8('0xb')]=function(_0x3f35c9,_0x44660b){return _0x3f35c9['define'](_0xa7d8('0xc'),attributes,{'tableName':_0xa7d8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8dc=['path','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','request-promise'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xf8dc,0x15b));var _0xcf8d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf8dc[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xcf8d('0x0'));var util=require(_0xcf8d('0x1'));var logger=require(_0xcf8d('0x2'))('api');var moment=require(_0xcf8d('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf8d('0x4'));var fs=require('fs');var path=require(_0xcf8d('0x5'));var rimraf=require('rimraf');var config=require(_0xcf8d('0x6'));var attributes=require(_0xcf8d('0x7'));module['exports']=function(_0x394105,_0xbbbdca){return _0x394105[_0xcf8d('0x8')](_0xcf8d('0x9'),attributes,{'tableName':_0xcf8d('0xa'),'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 8ca9312..684046b 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 _0x7ebc=['request','then','info','request\x20sent','debug','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x29d645,_0x364936){var _0x5a5ce8=function(_0x29fcc2){while(--_0x29fcc2){_0x29d645['push'](_0x29d645['shift']());}};_0x5a5ce8(++_0x364936);}(_0x7ebc,0x85));var _0xc7eb=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x7ebc[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0xc7eb('0x0'));var util=require(_0xc7eb('0x1'));var moment=require(_0xc7eb('0x2'));var BPromise=require(_0xc7eb('0x3'));var rs=require(_0xc7eb('0x4'));var fs=require('fs');var Redis=require(_0xc7eb('0x5'));var db=require(_0xc7eb('0x6'))['db'];var utils=require(_0xc7eb('0x7'));var logger=require(_0xc7eb('0x8'))(_0xc7eb('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc7eb('0xa')][_0xc7eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x462b26,_0x5a2159,_0x1ef584){return new BPromise(function(_0x405f13,_0x1f362c){return client[_0xc7eb('0xc')](_0x462b26,_0x1ef584)[_0xc7eb('0xd')](function(_0x3a954e){logger[_0xc7eb('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x5a2159,_0xc7eb('0xf'));logger[_0xc7eb('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5a2159,'request\x20sent',JSON[_0xc7eb('0x11')](_0x3a954e));if(_0x3a954e[_0xc7eb('0x12')]){if(_0x3a954e[_0xc7eb('0x12')][_0xc7eb('0x13')]===0x1f4){logger[_0xc7eb('0x12')](_0xc7eb('0x14'),_0x5a2159,_0x3a954e[_0xc7eb('0x12')]['message']);return _0x1f362c(_0x3a954e[_0xc7eb('0x12')][_0xc7eb('0x15')]);}logger['error'](_0xc7eb('0x14'),_0x5a2159,_0x3a954e[_0xc7eb('0x12')][_0xc7eb('0x15')]);return _0x405f13(_0x3a954e[_0xc7eb('0x12')]['message']);}else{logger['info'](_0xc7eb('0x14'),_0x5a2159,_0xc7eb('0xf'));_0x405f13(_0x3a954e[_0xc7eb('0x16')][_0xc7eb('0x15')]);}})[_0xc7eb('0x17')](function(_0x43e832){logger['error'](_0xc7eb('0x14'),_0x5a2159,_0x43e832);_0x1f362c(_0x43e832);});});}exports[_0xc7eb('0x18')]=function(_0x2a02e8){var _0x31b3be=this;return new Promise(function(_0x145b67,_0x166b41){return db[_0xc7eb('0x19')][_0xc7eb('0x1a')](_0x2a02e8[_0xc7eb('0x1b')],{'raw':_0x2a02e8[_0xc7eb('0x1c')]?_0x2a02e8[_0xc7eb('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x32f172){logger[_0xc7eb('0xe')](_0xc7eb('0x18'),_0x2a02e8);logger[_0xc7eb('0x10')](_0xc7eb('0x18'),_0x2a02e8,JSON[_0xc7eb('0x11')](_0x32f172));_0x145b67(_0x32f172);})[_0xc7eb('0x17')](function(_0x16d8af){logger[_0xc7eb('0x12')](_0xc7eb('0x18'),_0x16d8af[_0xc7eb('0x15')],_0x2a02e8);_0x166b41(_0x31b3be['error'](0x1f4,_0x16d8af['message']));});});}; \ No newline at end of file +var _0x9796=['stringify','error','code','message','info','SquareDetailsReport','create','body','options','CreateSquareDetailsReport','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x56c406,_0x47ab03){var _0x1068fe=function(_0x56c6c9){while(--_0x56c6c9){_0x56c406['push'](_0x56c406['shift']());}};_0x1068fe(++_0x47ab03);}(_0x9796,0xd3));var _0x6979=function(_0xcc3054,_0x2517ef){_0xcc3054=_0xcc3054-0x0;var _0x3cf7f4=_0x9796[_0xcc3054];return _0x3cf7f4;};'use strict';var _=require(_0x6979('0x0'));var util=require('util');var moment=require(_0x6979('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6979('0x2'));var db=require(_0x6979('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6979('0x4'))(_0x6979('0x5'));var config=require(_0x6979('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6979('0x7')][_0x6979('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aaca7,_0x4300c3,_0x5a3775){return new BPromise(function(_0x9c7889,_0x1c85ad){return client['request'](_0x3aaca7,_0x5a3775)[_0x6979('0x9')](function(_0x41f74e){logger['info'](_0x6979('0xa'),_0x4300c3,_0x6979('0xb'));logger[_0x6979('0xc')](_0x6979('0xd'),_0x4300c3,'request\x20sent',JSON[_0x6979('0xe')](_0x41f74e));if(_0x41f74e[_0x6979('0xf')]){if(_0x41f74e[_0x6979('0xf')][_0x6979('0x10')]===0x1f4){logger[_0x6979('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x4300c3,_0x41f74e[_0x6979('0xf')]['message']);return _0x1c85ad(_0x41f74e['error'][_0x6979('0x11')]);}logger[_0x6979('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x4300c3,_0x41f74e['error']['message']);return _0x9c7889(_0x41f74e[_0x6979('0xf')][_0x6979('0x11')]);}else{logger[_0x6979('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x4300c3,_0x6979('0xb'));_0x9c7889(_0x41f74e['result'][_0x6979('0x11')]);}})['catch'](function(_0x300212){logger['error'](_0x6979('0xa'),_0x4300c3,_0x300212);_0x1c85ad(_0x300212);});});}exports['CreateSquareDetailsReport']=function(_0x3e04bc){var _0x216232=this;return new Promise(function(_0x3aeafa,_0x7503ba){return db[_0x6979('0x13')][_0x6979('0x14')](_0x3e04bc[_0x6979('0x15')],{'raw':_0x3e04bc[_0x6979('0x16')]?_0x3e04bc[_0x6979('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x93b9bc){logger[_0x6979('0x12')](_0x6979('0x17'),_0x3e04bc);logger[_0x6979('0xc')](_0x6979('0x17'),_0x3e04bc,JSON[_0x6979('0xe')](_0x93b9bc));_0x3aeafa(_0x93b9bc);})[_0x6979('0x18')](function(_0x5b35f0){logger[_0x6979('0xf')](_0x6979('0x17'),_0x5b35f0['message'],_0x3e04bc);_0x7503ba(_0x216232['error'](0x1f4,_0x5b35f0['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index d329946..b7f8e3f 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 _0x7a52=['get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','../../components/auth/service','./system.controller'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0x7a52,0x1bd));var _0x27a5=function(_0x12078e,_0x16583d){_0x12078e=_0x12078e-0x0;var _0x1963f1=_0x7a52[_0x12078e];return _0x1963f1;};'use strict';var express=require(_0x27a5('0x0'));var router=express['Router']();var auth=require(_0x27a5('0x1'));var controller=require(_0x27a5('0x2'));router[_0x27a5('0x3')]('/',auth[_0x27a5('0x4')](),controller['index']);router[_0x27a5('0x3')](_0x27a5('0x5'),auth[_0x27a5('0x4')](),controller[_0x27a5('0x6')]);module[_0x27a5('0x7')]=router; \ No newline at end of file +var _0x66fd=['get','isAuthenticated','index','/process/:pid/kill','express','../../components/auth/service','./system.controller'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x66fd,0x82));var _0xd66f=function(_0x1b94c1,_0x4c7399){_0x1b94c1=_0x1b94c1-0x0;var _0x14d9e9=_0x66fd[_0x1b94c1];return _0x14d9e9;};'use strict';var express=require(_0xd66f('0x0'));var router=express['Router']();var auth=require(_0xd66f('0x1'));var controller=require(_0xd66f('0x2'));router[_0xd66f('0x3')]('/',auth[_0xd66f('0x4')](),controller[_0xd66f('0x5')]);router[_0xd66f('0x3')](_0xd66f('0x6'),auth['isAuthenticated'](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 79c197f..0a12d18 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 _0xb6fa=['format','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','exec','../../config/logger','api','util','bluebird','lodash','error','status','send','json','components/import/cm'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb6fa,0x18c));var _0xab6f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb6fa[_0x2641f9];return _0x585741;};'use strict';var info=require(_0xab6f('0x0'));var exec=require('child_process')[_0xab6f('0x1')];var logger=require(_0xab6f('0x2'))(_0xab6f('0x3'));var util=require(_0xab6f('0x4'));var BPromise=require(_0xab6f('0x5'));var _=require(_0xab6f('0x6'));function handleError(_0x1e3ef6,_0x3ac444,_0x194df2){_0x3ac444=_0x3ac444||0x1f4;return function(_0x1ddd11){logger[_0xab6f('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x194df2,_0x3ac444,util['inspect'](_0x1ddd11,{'showHidden':![],'depth':null}));delete _0x1ddd11['name'];_0x1e3ef6[_0xab6f('0x8')](_0x3ac444)[_0xab6f('0x9')](_0x1ddd11);};}exports['index']=function(_0x2657d0,_0x485110){return info['getAllData']()['then'](function(_0x576e26){return _0x485110['status'](0xc8)[_0xab6f('0xa')](_0x576e26);})['catch'](function(_0xdb04e9){return _0x485110[_0xab6f('0x8')](0x1f4)[_0xab6f('0xa')](_0xdb04e9);});};exports['killProcess']=function(_0x14a6c3,_0x539038){var _0xafbdea=[_0xab6f('0xb')];return new BPromise(function(_0xf17647,_0x55f57f){return exec(util[_0xab6f('0xc')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x14a6c3[_0xab6f('0xd')][_0xab6f('0xe')]),function(_0x139ef0,_0x17c0f1,_0x28d5bc){if(_0x139ef0){return _0x55f57f(_0x139ef0);}return _0xf17647(_0x17c0f1);});})[_0xab6f('0xf')](function(_0x4745cb){var _0xdbc5ac=![];var _0x2d8288=_0x4745cb[_0xab6f('0x10')](/\n/);for(var _0x370903=0x0,_0x121d33=_0xafbdea[_0xab6f('0x11')];_0x370903<_0x121d33,_0xdbc5ac===![];_0x370903+=0x1){if(_0x4745cb[_0xab6f('0x12')](_0xafbdea[_0x370903])>=0x0){_0xdbc5ac=!![];}}if(!_0xdbc5ac){throw new Error(util[_0xab6f('0xc')](_0xab6f('0x13'),_0x14a6c3[_0xab6f('0xd')]['pid']));}process[_0xab6f('0x14')](_0x14a6c3['params'][_0xab6f('0xe')],_0xab6f('0x15'));return _0x539038[_0xab6f('0x8')](0xc8)[_0xab6f('0xa')]({'message':util[_0xab6f('0xc')](_0xab6f('0x16'),_0x14a6c3[_0xab6f('0xd')]['pid'])});})['catch'](handleError(_0x539038,null,_0xab6f('0x17')));}; \ No newline at end of file +var _0xcfa8=['send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','SIGINT','systeminformation','child_process','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x8f9bed,_0x3c4e41){var _0x326799=function(_0x515933){while(--_0x515933){_0x8f9bed['push'](_0x8f9bed['shift']());}};_0x326799(++_0x3c4e41);}(_0xcfa8,0xdf));var _0x8cfa=function(_0x341faa,_0x56dd3e){_0x341faa=_0x341faa-0x0;var _0x247243=_0xcfa8[_0x341faa];return _0x247243;};'use strict';var info=require(_0x8cfa('0x0'));var exec=require(_0x8cfa('0x1'))['exec'];var logger=require(_0x8cfa('0x2'))(_0x8cfa('0x3'));var util=require(_0x8cfa('0x4'));var BPromise=require(_0x8cfa('0x5'));var _=require('lodash');function handleError(_0x346070,_0x4b0dae,_0x7db54f){_0x4b0dae=_0x4b0dae||0x1f4;return function(_0x155136){logger[_0x8cfa('0x6')](_0x8cfa('0x7'),_0x7db54f,_0x4b0dae,util[_0x8cfa('0x8')](_0x155136,{'showHidden':![],'depth':null}));delete _0x155136[_0x8cfa('0x9')];_0x346070[_0x8cfa('0xa')](_0x4b0dae)[_0x8cfa('0xb')](_0x155136);};}exports[_0x8cfa('0xc')]=function(_0x57eb16,_0x4b2c71){return info[_0x8cfa('0xd')]()[_0x8cfa('0xe')](function(_0x29e506){return _0x4b2c71[_0x8cfa('0xa')](0xc8)[_0x8cfa('0xf')](_0x29e506);})[_0x8cfa('0x10')](function(_0x169485){return _0x4b2c71[_0x8cfa('0xa')](0x1f4)[_0x8cfa('0xf')](_0x169485);});};exports[_0x8cfa('0x11')]=function(_0x152765,_0x397dbd){var _0x36865f=[_0x8cfa('0x12')];return new BPromise(function(_0x55bb27,_0x2da75b){return exec(util[_0x8cfa('0x13')](_0x8cfa('0x14'),_0x152765[_0x8cfa('0x15')][_0x8cfa('0x16')]),function(_0x30afde,_0x35562a,_0x25115d){if(_0x30afde){return _0x2da75b(_0x30afde);}return _0x55bb27(_0x35562a);});})[_0x8cfa('0xe')](function(_0x5519a3){var _0x105c3d=![];var _0x35463c=_0x5519a3[_0x8cfa('0x17')](/\n/);for(var _0x2b913c=0x0,_0xfda06d=_0x36865f['length'];_0x2b913c<_0xfda06d,_0x105c3d===![];_0x2b913c+=0x1){if(_0x5519a3[_0x8cfa('0x18')](_0x36865f[_0x2b913c])>=0x0){_0x105c3d=!![];}}if(!_0x105c3d){throw new Error(util[_0x8cfa('0x13')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x152765[_0x8cfa('0x15')][_0x8cfa('0x16')]));}process['kill'](_0x152765[_0x8cfa('0x15')]['pid'],_0x8cfa('0x19'));return _0x397dbd[_0x8cfa('0xa')](0xc8)[_0x8cfa('0xf')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x152765['params'][_0x8cfa('0x16')])});})[_0x8cfa('0x10')](handleError(_0x397dbd,null,_0x8cfa('0x11')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8de1e78..6e2158b 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 _0xfd28=['index','/:id','post','create','update','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2d9191,_0x1ba25c){var _0x214372=function(_0x464945){while(--_0x464945){_0x2d9191['push'](_0x2d9191['shift']());}};_0x214372(++_0x1ba25c);}(_0xfd28,0x148));var _0x8fd2=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0xfd28[_0x1b92a6];return _0x24be5b;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var auth=require(_0x8fd2('0x3'));var interaction=require(_0x8fd2('0x4'));var config=require(_0x8fd2('0x5'));var controller=require('./tag.controller');router[_0x8fd2('0x6')]('/',auth[_0x8fd2('0x7')](),controller[_0x8fd2('0x8')]);router[_0x8fd2('0x6')](_0x8fd2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8fd2('0xa')]('/',auth[_0x8fd2('0x7')](),controller[_0x8fd2('0xb')]);router['put'](_0x8fd2('0x9'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['delete'](_0x8fd2('0x9'),auth['isAuthenticated'](),controller[_0x8fd2('0xd')]);module['exports']=router; \ No newline at end of file +var _0x9f62=['update','destroy','util','connect-timeout','express','Router','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post'];(function(_0x2c89e9,_0x1756cc){var _0x55b4b5=function(_0x366cc9){while(--_0x366cc9){_0x2c89e9['push'](_0x2c89e9['shift']());}};_0x55b4b5(++_0x1756cc);}(_0x9f62,0x154));var _0x29f6=function(_0x2d02e8,_0x12087f){_0x2d02e8=_0x2d02e8-0x0;var _0x425e83=_0x9f62[_0x2d02e8];return _0x425e83;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x29f6('0x7')](),controller[_0x29f6('0xb')]);router['delete']('/:id',auth[_0x29f6('0x7')](),controller[_0x29f6('0xc')]);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 bf7e076..50f05ec 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 _0x0abf=['name','sequelize','STRING'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0abf[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0ab('0x1')],'unique':_0xf0ab('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xf0ab('0x1')]}}; \ No newline at end of file +var _0x878f=['STRING','name','#0091EA','exports'];(function(_0x1c42e9,_0x48a5c4){var _0x1dc2d3=function(_0x45bb0f){while(--_0x45bb0f){_0x1c42e9['push'](_0x1c42e9['shift']());}};_0x1dc2d3(++_0x48a5c4);}(_0x878f,0x173));var _0xf878=function(_0x3333db,_0x25ec6e){_0x3333db=_0x3333db-0x0;var _0x1f7207=_0x878f[_0x3333db];return _0x1f7207;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'name':{'type':Sequelize[_0xf878('0x1')],'unique':_0xf878('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf878('0x1')],'defaultValue':_0xf878('0x3')},'description':{'type':Sequelize[_0xf878('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a7dfcbf..fd3d620 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 _0xad5b=['intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','type','options','count','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','stack','name','send','index','Tag','key','model','map','query','keys','filters'];(function(_0x2b2f24,_0x4809c5){var _0x1cb47b=function(_0x51366d){while(--_0x51366d){_0x2b2f24['push'](_0x2b2f24['shift']());}};_0x1cb47b(++_0x4809c5);}(_0xad5b,0x1b5));var _0xbad5=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0xad5b[_0x508685];return _0x976a76;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbad5('0x0'));var rimraf=require(_0xbad5('0x1'));var zipdir=require(_0xbad5('0x2'));var jsonpatch=require(_0xbad5('0x3'));var rp=require(_0xbad5('0x4'));var moment=require(_0xbad5('0x5'));var BPromise=require(_0xbad5('0x6'));var Mustache=require('mustache');var util=require(_0xbad5('0x7'));var path=require('path');var sox=require(_0xbad5('0x8'));var csv=require(_0xbad5('0x9'));var ejs=require(_0xbad5('0xa'));var fs=require('fs');var _=require(_0xbad5('0xb'));var squel=require(_0xbad5('0xc'));var crypto=require(_0xbad5('0xd'));var jsforce=require(_0xbad5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbad5('0x9'));var querystring=require('querystring');var Papa=require(_0xbad5('0xf'));var Redis=require(_0xbad5('0x10'));var authService=require(_0xbad5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbad5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbad5('0x13'))('api');var utils=require(_0xbad5('0x14'));var config=require(_0xbad5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a9dd2,_0x52a51e){_0x52a51e=_0x52a51e||0xcc;return function(_0x5560e5){if(_0x5560e5){return _0x4a9dd2['sendStatus'](_0x52a51e);}return _0x4a9dd2[_0xbad5('0x16')](_0x52a51e)[_0xbad5('0x17')]();};}function respondWithResult(_0x5be9fe,_0x290833){_0x290833=_0x290833||0xc8;return function(_0xf041d6){if(_0xf041d6){return _0x5be9fe[_0xbad5('0x16')](_0x290833)[_0xbad5('0x18')](_0xf041d6);}};}function respondWithFilteredResult(_0x482266,_0x4d5850){return function(_0x2d4850){if(_0x2d4850){var _0x476e2f=_0x2d4850['count'],_0xa54e8c=_0x4d5850['offset'],_0x431a7f=_0x4d5850[_0xbad5('0x19')]+_0x4d5850[_0xbad5('0x1a')],_0x186082;if(_0x431a7f>=_0x476e2f){_0x431a7f=_0x476e2f;_0x186082=0xc8;}else{_0x186082=0xce;}_0x482266['status'](_0x186082);return _0x482266[_0xbad5('0x1b')](_0xbad5('0x1c'),_0xa54e8c+'-'+_0x431a7f+'/'+_0x476e2f)[_0xbad5('0x18')](_0x2d4850);}return null;};}function patchUpdates(_0x1cc599){return function(_0x152aa3){try{jsonpatch[_0xbad5('0x1d')](_0x152aa3,_0x1cc599,!![]);}catch(_0x18236d){return BPromise[_0xbad5('0x1e')](_0x18236d);}return _0x152aa3[_0xbad5('0x1f')]();};}function saveUpdates(_0x3b5075,_0x597372){return function(_0x5cdd42){if(_0x5cdd42){return _0x5cdd42[_0xbad5('0x20')](_0x3b5075)['then'](function(_0x4f45ca){return _0x4f45ca;});}return null;};}function removeEntity(_0x375da4,_0x5e1d2c){return function(_0x2fff11){if(_0x2fff11){return _0x2fff11[_0xbad5('0x21')]()['then'](function(){var _0x47923c=_0x2fff11[_0xbad5('0x22')]({'plain':!![]});var _0x41c88c='Tags';return db[_0xbad5('0x23')][_0xbad5('0x21')]({'where':{'type':_0x41c88c,'resourceId':_0x47923c['id']}})[_0xbad5('0x24')](function(){return _0x2fff11;});})[_0xbad5('0x24')](function(){_0x375da4[_0xbad5('0x16')](0xcc)[_0xbad5('0x17')]();});}};}function handleEntityNotFound(_0xc52f74,_0x359ad7){return function(_0x597d95){if(!_0x597d95){_0xc52f74[_0xbad5('0x25')](0x194);}return _0x597d95;};}function handleError(_0x24706e,_0x1501c7){_0x1501c7=_0x1501c7||0x1f4;return function(_0x578b7e){logger['error'](_0x578b7e[_0xbad5('0x26')]);if(_0x578b7e['name']){delete _0x578b7e[_0xbad5('0x27')];}_0x24706e[_0xbad5('0x16')](_0x1501c7)[_0xbad5('0x28')](_0x578b7e);};}exports[_0xbad5('0x29')]=function(_0x2d1759,_0x401e43){var _0x5b5603={},_0x1c691f={},_0x4f9ce1={'count':0x0,'rows':[]};var _0x128472=_['map'](db[_0xbad5('0x2a')]['rawAttributes'],function(_0x5d592b){return{'name':_0x5d592b['fieldName'],'type':_0x5d592b['type'][_0xbad5('0x2b')]};});_0x1c691f[_0xbad5('0x2c')]=_[_0xbad5('0x2d')](_0x128472,_0xbad5('0x27'));_0x1c691f[_0xbad5('0x2e')]=_[_0xbad5('0x2f')](_0x2d1759[_0xbad5('0x2e')]);_0x1c691f[_0xbad5('0x30')]=_[_0xbad5('0x31')](_0x1c691f[_0xbad5('0x2c')],_0x1c691f[_0xbad5('0x2e')]);_0x5b5603[_0xbad5('0x32')]=_[_0xbad5('0x31')](_0x1c691f[_0xbad5('0x2c')],qs[_0xbad5('0x33')](_0x2d1759['query'][_0xbad5('0x33')]));_0x5b5603['attributes']=_0x5b5603[_0xbad5('0x32')][_0xbad5('0x34')]?_0x5b5603[_0xbad5('0x32')]:_0x1c691f[_0xbad5('0x2c')];if(!_0x2d1759[_0xbad5('0x2e')]['hasOwnProperty'](_0xbad5('0x35'))){_0x5b5603[_0xbad5('0x1a')]=qs[_0xbad5('0x1a')](_0x2d1759[_0xbad5('0x2e')][_0xbad5('0x1a')]);_0x5b5603[_0xbad5('0x19')]=qs[_0xbad5('0x19')](_0x2d1759[_0xbad5('0x2e')][_0xbad5('0x19')]);}_0x5b5603[_0xbad5('0x36')]=qs['sort'](_0x2d1759['query']['sort']);_0x5b5603[_0xbad5('0x37')]=qs['filters'](_[_0xbad5('0x38')](_0x2d1759[_0xbad5('0x2e')],_0x1c691f[_0xbad5('0x30')]));if(_0x2d1759[_0xbad5('0x2e')][_0xbad5('0x39')]){_0x5b5603[_0xbad5('0x37')]=_[_0xbad5('0x3a')](_0x5b5603['where'],{'$or':_[_0xbad5('0x2d')](_0x128472,function(_0x3af8c0){if(_0x3af8c0[_0xbad5('0x3b')]!=='VIRTUAL'){var _0x134db0={};_0x134db0[_0x3af8c0['name']]={'$like':'%'+_0x2d1759[_0xbad5('0x2e')]['filter']+'%'};return _0x134db0;}})});}_0x5b5603=_[_0xbad5('0x3a')]({},_0x5b5603,_0x2d1759[_0xbad5('0x3c')]);var _0x503344={'where':_0x5b5603[_0xbad5('0x37')]};return db[_0xbad5('0x2a')][_0xbad5('0x3d')](_0x503344)['then'](function(_0x38a70c){_0x4f9ce1['count']=_0x38a70c;if(_0x2d1759[_0xbad5('0x2e')][_0xbad5('0x3e')]){_0x5b5603[_0xbad5('0x3f')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x5b5603);})[_0xbad5('0x24')](function(_0x31e39a){_0x4f9ce1[_0xbad5('0x40')]=_0x31e39a;return _0x4f9ce1;})[_0xbad5('0x24')](respondWithFilteredResult(_0x401e43,_0x5b5603))[_0xbad5('0x41')](handleError(_0x401e43,null));};exports[_0xbad5('0x42')]=function(_0x4144d0,_0x30f252){var _0x1f73a2={'raw':!![],'where':{'id':_0x4144d0[_0xbad5('0x43')]['id']}},_0x334a51={};_0x334a51[_0xbad5('0x2c')]=_['keys'](db[_0xbad5('0x2a')][_0xbad5('0x44')]);_0x334a51[_0xbad5('0x2e')]=_[_0xbad5('0x2f')](_0x4144d0['query']);_0x334a51[_0xbad5('0x30')]=_[_0xbad5('0x31')](_0x334a51[_0xbad5('0x2c')],_0x334a51['query']);_0x1f73a2['attributes']=_[_0xbad5('0x31')](_0x334a51[_0xbad5('0x2c')],qs['fields'](_0x4144d0['query'][_0xbad5('0x33')]));_0x1f73a2[_0xbad5('0x32')]=_0x1f73a2[_0xbad5('0x32')]['length']?_0x1f73a2['attributes']:_0x334a51[_0xbad5('0x2c')];if(_0x4144d0[_0xbad5('0x2e')][_0xbad5('0x3e')]){_0x1f73a2[_0xbad5('0x3f')]=[{'all':!![]}];}_0x1f73a2=_[_0xbad5('0x3a')]({},_0x1f73a2,_0x4144d0[_0xbad5('0x3c')]);return db[_0xbad5('0x2a')]['find'](_0x1f73a2)[_0xbad5('0x24')](handleEntityNotFound(_0x30f252,null))[_0xbad5('0x24')](respondWithResult(_0x30f252,null))[_0xbad5('0x41')](handleError(_0x30f252,null));};exports[_0xbad5('0x45')]=function(_0x50995d,_0x245f52){return db[_0xbad5('0x2a')]['create'](_0x50995d[_0xbad5('0x46')],{})['then'](function(_0x4e2472){var _0xaac411=_0x50995d[_0xbad5('0x47')][_0xbad5('0x22')]({'plain':!![]});if(!_0xaac411)throw new Error(_0xbad5('0x48'));if(_0xaac411[_0xbad5('0x49')]===_0xbad5('0x47')){var _0x2ba8f9=_0x4e2472[_0xbad5('0x22')]({'plain':!![]});var _0x408393=_0xbad5('0x4a');return db[_0xbad5('0x4b')][_0xbad5('0x4c')]({'where':{'name':_0x408393,'userProfileId':_0xaac411[_0xbad5('0x4d')]},'raw':!![]})[_0xbad5('0x24')](function(_0x561f0b){if(_0x561f0b&&_0x561f0b[_0xbad5('0x4e')]===0x0){return db[_0xbad5('0x23')][_0xbad5('0x45')]({'name':_0x2ba8f9[_0xbad5('0x27')],'resourceId':_0x2ba8f9['id'],'type':_0x561f0b[_0xbad5('0x27')],'sectionId':_0x561f0b['id']},{})['then'](function(){return _0x4e2472;});}else{return _0x4e2472;}})['catch'](function(_0x2041a8){logger[_0xbad5('0x4f')](_0xbad5('0x50'),_0x2041a8);throw _0x2041a8;});}return _0x4e2472;})['then'](respondWithResult(_0x245f52,0xc9))['catch'](handleError(_0x245f52,null));};exports[_0xbad5('0x20')]=function(_0x1050bf,_0x358c18){if(_0x1050bf['body']['id']){delete _0x1050bf[_0xbad5('0x46')]['id'];}return db['Tag']['find']({'where':{'id':_0x1050bf[_0xbad5('0x43')]['id']}})[_0xbad5('0x24')](handleEntityNotFound(_0x358c18,null))[_0xbad5('0x24')](saveUpdates(_0x1050bf['body'],null))[_0xbad5('0x24')](respondWithResult(_0x358c18,null))['catch'](handleError(_0x358c18,null));};exports[_0xbad5('0x21')]=function(_0x16db3f,_0x29554e){return db[_0xbad5('0x2a')][_0xbad5('0x4c')]({'where':{'id':_0x16db3f[_0xbad5('0x43')]['id']}})[_0xbad5('0x24')](handleEntityNotFound(_0x29554e,null))[_0xbad5('0x24')](removeEntity(_0x29554e,null))[_0xbad5('0x41')](handleError(_0x29554e,null));}; \ No newline at end of file +var _0x4613=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','save','then','get','Tags','UserProfileResource','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create'];(function(_0x3329fa,_0x5ad773){var _0x1173b6=function(_0x25ebec){while(--_0x25ebec){_0x3329fa['push'](_0x3329fa['shift']());}};_0x1173b6(++_0x5ad773);}(_0x4613,0x101));var _0x3461=function(_0x1fb6b7,_0x266909){_0x1fb6b7=_0x1fb6b7-0x0;var _0x3b562e=_0x4613[_0x1fb6b7];return _0x3b562e;};'use strict';var pdf=require(_0x3461('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3461('0x1'));var jsonpatch=require(_0x3461('0x2'));var rp=require('request-promise');var moment=require(_0x3461('0x3'));var BPromise=require(_0x3461('0x4'));var Mustache=require(_0x3461('0x5'));var util=require(_0x3461('0x6'));var path=require(_0x3461('0x7'));var sox=require(_0x3461('0x8'));var csv=require('to-csv');var ejs=require(_0x3461('0x9'));var fs=require('fs');var _=require(_0x3461('0xa'));var squel=require(_0x3461('0xb'));var crypto=require(_0x3461('0xc'));var jsforce=require(_0x3461('0xd'));var deskjs=require(_0x3461('0xe'));var toCsv=require(_0x3461('0xf'));var querystring=require(_0x3461('0x10'));var Papa=require(_0x3461('0x11'));var Redis=require(_0x3461('0x12'));var authService=require(_0x3461('0x13'));var qs=require(_0x3461('0x14'));var as=require(_0x3461('0x15'));var hardwareService=require(_0x3461('0x16'));var logger=require(_0x3461('0x17'))(_0x3461('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3461('0x19'))['db'];function respondWithStatusCode(_0x5ef370,_0x30c2a0){_0x30c2a0=_0x30c2a0||0xcc;return function(_0x18e57a){if(_0x18e57a){return _0x5ef370[_0x3461('0x1a')](_0x30c2a0);}return _0x5ef370['status'](_0x30c2a0)[_0x3461('0x1b')]();};}function respondWithResult(_0x521d97,_0xdd4b13){_0xdd4b13=_0xdd4b13||0xc8;return function(_0x1c0b02){if(_0x1c0b02){return _0x521d97[_0x3461('0x1c')](_0xdd4b13)[_0x3461('0x1d')](_0x1c0b02);}};}function respondWithFilteredResult(_0x3aa77c,_0x383e81){return function(_0x490501){if(_0x490501){var _0x4a0e61=_0x490501[_0x3461('0x1e')],_0x1f55d9=_0x383e81[_0x3461('0x1f')],_0x318082=_0x383e81['offset']+_0x383e81[_0x3461('0x20')],_0x2a0707;if(_0x318082>=_0x4a0e61){_0x318082=_0x4a0e61;_0x2a0707=0xc8;}else{_0x2a0707=0xce;}_0x3aa77c[_0x3461('0x1c')](_0x2a0707);return _0x3aa77c[_0x3461('0x21')]('Content-Range',_0x1f55d9+'-'+_0x318082+'/'+_0x4a0e61)[_0x3461('0x1d')](_0x490501);}return null;};}function patchUpdates(_0x2680d1){return function(_0x1e13be){try{jsonpatch[_0x3461('0x22')](_0x1e13be,_0x2680d1,!![]);}catch(_0x2d2d00){return BPromise['reject'](_0x2d2d00);}return _0x1e13be[_0x3461('0x23')]();};}function saveUpdates(_0x5d29c5,_0x213637){return function(_0xcefcdc){if(_0xcefcdc){return _0xcefcdc['update'](_0x5d29c5)[_0x3461('0x24')](function(_0x14d3ae){return _0x14d3ae;});}return null;};}function removeEntity(_0x135a36,_0x54f2ac){return function(_0x2aec2d){if(_0x2aec2d){return _0x2aec2d['destroy']()['then'](function(){var _0x8fb273=_0x2aec2d[_0x3461('0x25')]({'plain':!![]});var _0x1a586a=_0x3461('0x26');return db[_0x3461('0x27')]['destroy']({'where':{'type':_0x1a586a,'resourceId':_0x8fb273['id']}})['then'](function(){return _0x2aec2d;});})[_0x3461('0x24')](function(){_0x135a36[_0x3461('0x1c')](0xcc)[_0x3461('0x1b')]();});}};}function handleEntityNotFound(_0x4e5060,_0x361c1f){return function(_0x4550f7){if(!_0x4550f7){_0x4e5060[_0x3461('0x1a')](0x194);}return _0x4550f7;};}function handleError(_0x414ed4,_0x545d8b){_0x545d8b=_0x545d8b||0x1f4;return function(_0x172f77){logger[_0x3461('0x28')](_0x172f77[_0x3461('0x29')]);if(_0x172f77[_0x3461('0x2a')]){delete _0x172f77[_0x3461('0x2a')];}_0x414ed4[_0x3461('0x1c')](_0x545d8b)['send'](_0x172f77);};}exports[_0x3461('0x2b')]=function(_0x5bb529,_0x479143){var _0x959502={},_0x1a7f79={},_0x12e84a={'count':0x0,'rows':[]};var _0x201b6b=_[_0x3461('0x2c')](db[_0x3461('0x2d')][_0x3461('0x2e')],function(_0x33879f){return{'name':_0x33879f[_0x3461('0x2f')],'type':_0x33879f[_0x3461('0x30')][_0x3461('0x31')]};});_0x1a7f79[_0x3461('0x32')]=_['map'](_0x201b6b,'name');_0x1a7f79['query']=_['keys'](_0x5bb529[_0x3461('0x33')]);_0x1a7f79[_0x3461('0x34')]=_[_0x3461('0x35')](_0x1a7f79['model'],_0x1a7f79[_0x3461('0x33')]);_0x959502['attributes']=_[_0x3461('0x35')](_0x1a7f79[_0x3461('0x32')],qs[_0x3461('0x36')](_0x5bb529[_0x3461('0x33')]['fields']));_0x959502['attributes']=_0x959502['attributes'][_0x3461('0x37')]?_0x959502[_0x3461('0x38')]:_0x1a7f79[_0x3461('0x32')];if(!_0x5bb529[_0x3461('0x33')][_0x3461('0x39')]('nolimit')){_0x959502[_0x3461('0x20')]=qs[_0x3461('0x20')](_0x5bb529[_0x3461('0x33')]['limit']);_0x959502[_0x3461('0x1f')]=qs['offset'](_0x5bb529[_0x3461('0x33')][_0x3461('0x1f')]);}_0x959502[_0x3461('0x3a')]=qs[_0x3461('0x3b')](_0x5bb529[_0x3461('0x33')][_0x3461('0x3b')]);_0x959502[_0x3461('0x3c')]=qs[_0x3461('0x34')](_[_0x3461('0x3d')](_0x5bb529[_0x3461('0x33')],_0x1a7f79['filters']));if(_0x5bb529['query'][_0x3461('0x3e')]){_0x959502[_0x3461('0x3c')]=_[_0x3461('0x3f')](_0x959502[_0x3461('0x3c')],{'$or':_[_0x3461('0x2c')](_0x201b6b,function(_0x53f0a5){if(_0x53f0a5[_0x3461('0x30')]!==_0x3461('0x40')){var _0x2c8cab={};_0x2c8cab[_0x53f0a5[_0x3461('0x2a')]]={'$like':'%'+_0x5bb529['query']['filter']+'%'};return _0x2c8cab;}})});}_0x959502=_['merge']({},_0x959502,_0x5bb529[_0x3461('0x41')]);var _0x5591f4={'where':_0x959502['where']};return db[_0x3461('0x2d')]['count'](_0x5591f4)['then'](function(_0x491447){_0x12e84a[_0x3461('0x1e')]=_0x491447;if(_0x5bb529[_0x3461('0x33')]['includeAll']){_0x959502[_0x3461('0x42')]=[{'all':!![]}];}return db[_0x3461('0x2d')][_0x3461('0x43')](_0x959502);})['then'](function(_0x512771){_0x12e84a[_0x3461('0x44')]=_0x512771;return _0x12e84a;})[_0x3461('0x24')](respondWithFilteredResult(_0x479143,_0x959502))[_0x3461('0x45')](handleError(_0x479143,null));};exports[_0x3461('0x46')]=function(_0x2b2a2a,_0x22f62d){var _0x59670c={'raw':!![],'where':{'id':_0x2b2a2a[_0x3461('0x47')]['id']}},_0x4612a0={};_0x4612a0[_0x3461('0x32')]=_[_0x3461('0x48')](db[_0x3461('0x2d')][_0x3461('0x2e')]);_0x4612a0[_0x3461('0x33')]=_[_0x3461('0x48')](_0x2b2a2a[_0x3461('0x33')]);_0x4612a0[_0x3461('0x34')]=_[_0x3461('0x35')](_0x4612a0[_0x3461('0x32')],_0x4612a0['query']);_0x59670c[_0x3461('0x38')]=_[_0x3461('0x35')](_0x4612a0[_0x3461('0x32')],qs[_0x3461('0x36')](_0x2b2a2a[_0x3461('0x33')]['fields']));_0x59670c[_0x3461('0x38')]=_0x59670c[_0x3461('0x38')]['length']?_0x59670c[_0x3461('0x38')]:_0x4612a0[_0x3461('0x32')];if(_0x2b2a2a[_0x3461('0x33')]['includeAll']){_0x59670c[_0x3461('0x42')]=[{'all':!![]}];}_0x59670c=_['merge']({},_0x59670c,_0x2b2a2a[_0x3461('0x41')]);return db['Tag'][_0x3461('0x49')](_0x59670c)['then'](handleEntityNotFound(_0x22f62d,null))[_0x3461('0x24')](respondWithResult(_0x22f62d,null))[_0x3461('0x45')](handleError(_0x22f62d,null));};exports['create']=function(_0x112b3d,_0x293bb0){return db['Tag'][_0x3461('0x4a')](_0x112b3d[_0x3461('0x4b')],{})['then'](function(_0x510619){var _0xd672cb=_0x112b3d[_0x3461('0x4c')][_0x3461('0x25')]({'plain':!![]});if(!_0xd672cb)throw new Error(_0x3461('0x4d'));if(_0xd672cb['role']==='user'){var _0x3f2970=_0x510619[_0x3461('0x25')]({'plain':!![]});var _0x109e29=_0x3461('0x26');return db[_0x3461('0x4e')][_0x3461('0x49')]({'where':{'name':_0x109e29,'userProfileId':_0xd672cb['userProfileId']},'raw':!![]})[_0x3461('0x24')](function(_0x4622e9){if(_0x4622e9&&_0x4622e9[_0x3461('0x4f')]===0x0){return db[_0x3461('0x27')]['create']({'name':_0x3f2970[_0x3461('0x2a')],'resourceId':_0x3f2970['id'],'type':_0x4622e9[_0x3461('0x2a')],'sectionId':_0x4622e9['id']},{})[_0x3461('0x24')](function(){return _0x510619;});}else{return _0x510619;}})[_0x3461('0x45')](function(_0x164b76){logger[_0x3461('0x28')](_0x3461('0x50'),_0x164b76);throw _0x164b76;});}return _0x510619;})[_0x3461('0x24')](respondWithResult(_0x293bb0,0xc9))['catch'](handleError(_0x293bb0,null));};exports[_0x3461('0x51')]=function(_0x58e478,_0x1ba425){if(_0x58e478[_0x3461('0x4b')]['id']){delete _0x58e478[_0x3461('0x4b')]['id'];}return db[_0x3461('0x2d')][_0x3461('0x49')]({'where':{'id':_0x58e478[_0x3461('0x47')]['id']}})[_0x3461('0x24')](handleEntityNotFound(_0x1ba425,null))[_0x3461('0x24')](saveUpdates(_0x58e478['body'],null))['then'](respondWithResult(_0x1ba425,null))[_0x3461('0x45')](handleError(_0x1ba425,null));};exports[_0x3461('0x52')]=function(_0x1a02b4,_0x21c155){return db[_0x3461('0x2d')][_0x3461('0x49')]({'where':{'id':_0x1a02b4[_0x3461('0x47')]['id']}})[_0x3461('0x24')](handleEntityNotFound(_0x21c155,null))['then'](removeEntity(_0x21c155,null))[_0x3461('0x45')](handleError(_0x21c155,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 4936041..8fe487d 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 _0xe05d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','define','lodash'];(function(_0x4a3646,_0x5ae904){var _0x5dea68=function(_0x427e30){while(--_0x427e30){_0x4a3646['push'](_0x4a3646['shift']());}};_0x5dea68(++_0x5ae904);}(_0xe05d,0x143));var _0xde05=function(_0xf57451,_0x989913){_0xf57451=_0xf57451-0x0;var _0x2f9e1d=_0xe05d[_0xf57451];return _0x2f9e1d;};'use strict';var _=require(_0xde05('0x0'));var util=require(_0xde05('0x1'));var logger=require(_0xde05('0x2'))(_0xde05('0x3'));var moment=require(_0xde05('0x4'));var BPromise=require(_0xde05('0x5'));var rp=require(_0xde05('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde05('0x7'));var config=require(_0xde05('0x8'));var attributes=require(_0xde05('0x9'));module[_0xde05('0xa')]=function(_0x16e88b,_0x95251b){return _0x16e88b[_0xde05('0xb')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8da0=['define','Tag','tools_tags','lodash','util','../../config/logger','moment','path','exports'];(function(_0x2b217f,_0x2351e2){var _0x5ebea5=function(_0x467364){while(--_0x467364){_0x2b217f['push'](_0x2b217f['shift']());}};_0x5ebea5(++_0x2351e2);}(_0x8da0,0x135));var _0x08da=function(_0x346448,_0x4400be){_0x346448=_0x346448-0x0;var _0x4dbcf5=_0x8da0[_0x346448];return _0x4dbcf5;};'use strict';var _=require(_0x08da('0x0'));var util=require(_0x08da('0x1'));var logger=require(_0x08da('0x2'))('api');var moment=require(_0x08da('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08da('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x08da('0x5')]=function(_0x8fd120,_0x7fecda){return _0x8fd120[_0x08da('0x6')](_0x08da('0x7'),attributes,{'tableName':_0x08da('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 89e86ff..c06717b 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 _0x44a3=['http','request','then','info','request\x20sent','debug','error','code','message','Tag,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x347b7c,_0x349406){var _0x3124b1=function(_0x140fce){while(--_0x140fce){_0x347b7c['push'](_0x347b7c['shift']());}};_0x3124b1(++_0x349406);}(_0x44a3,0x1a9));var _0x344a=function(_0x5e1aa5,_0x35d6e9){_0x5e1aa5=_0x5e1aa5-0x0;var _0x2c4704=_0x44a3[_0x5e1aa5];return _0x2c4704;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('Tag,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('Tag,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('Tag,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('Tag,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x2fb1bc,_0xc002d4){var _0x4bcc47=function(_0x5121c4){while(--_0x5121c4){_0x2fb1bc['push'](_0x2fb1bc['shift']());}};_0x4bcc47(++_0xc002d4);}(_0x54ef,0x112));var _0xf54e=function(_0x389b9f,_0x57c0c8){_0x389b9f=_0x389b9f-0x0;var _0x2e1463=_0x54ef[_0x389b9f];return _0x2e1463;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('Tag,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('Tag,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index ed392f4..5353df0 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 _0xee6b=['put','destroy','delete','removeQueues','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','getQueues','/:id/users','getAgents','create','/:id/queues','post','addAgents'];(function(_0x3806f2,_0x55b30d){var _0x146d82=function(_0x35a73f){while(--_0x35a73f){_0x3806f2['push'](_0x3806f2['shift']());}};_0x146d82(++_0x55b30d);}(_0xee6b,0x1bf));var _0xbee6=function(_0x4bf926,_0x3bf9cb){_0x4bf926=_0x4bf926-0x0;var _0x5b6e62=_0xee6b[_0x4bf926];return _0x5b6e62;};'use strict';var multer=require(_0xbee6('0x0'));var util=require(_0xbee6('0x1'));var path=require(_0xbee6('0x2'));var timeout=require(_0xbee6('0x3'));var express=require(_0xbee6('0x4'));var router=express['Router']();var auth=require(_0xbee6('0x5'));var interaction=require(_0xbee6('0x6'));var config=require(_0xbee6('0x7'));var controller=require(_0xbee6('0x8'));router[_0xbee6('0x9')]('/',auth[_0xbee6('0xa')](),controller[_0xbee6('0xb')]);router['get'](_0xbee6('0xc'),auth['isAuthenticated'](),controller[_0xbee6('0xd')]);router[_0xbee6('0x9')]('/:id/queues',auth[_0xbee6('0xa')](),controller[_0xbee6('0xe')]);router['get'](_0xbee6('0xf'),auth[_0xbee6('0xa')](),controller[_0xbee6('0x10')]);router['post']('/',auth[_0xbee6('0xa')](),controller[_0xbee6('0x11')]);router['post'](_0xbee6('0x12'),auth[_0xbee6('0xa')](),controller['addQueues']);router[_0xbee6('0x13')]('/:id/users',auth[_0xbee6('0xa')](),controller[_0xbee6('0x14')]);router[_0xbee6('0x15')](_0xbee6('0xc'),auth[_0xbee6('0xa')](),controller['update']);router['delete'](_0xbee6('0xc'),auth[_0xbee6('0xa')](),controller[_0xbee6('0x16')]);router[_0xbee6('0x17')](_0xbee6('0x12'),auth['isAuthenticated'](),controller[_0xbee6('0x18')]);router['delete']('/:id/users',auth[_0xbee6('0xa')](),controller[_0xbee6('0x19')]);module['exports']=router; \ No newline at end of file +var _0x42a4=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','index','/:id','isAuthenticated','show','get','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','put','update','delete','destroy','removeQueues','removeAgents','multer','util'];(function(_0x1fa3d2,_0x5518c6){var _0xae3160=function(_0x5078d6){while(--_0x5078d6){_0x1fa3d2['push'](_0x1fa3d2['shift']());}};_0xae3160(++_0x5518c6);}(_0x42a4,0xa6));var _0x442a=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x42a4[_0x2b81be];return _0x8ed4a7;};'use strict';var multer=require(_0x442a('0x0'));var util=require(_0x442a('0x1'));var path=require(_0x442a('0x2'));var timeout=require(_0x442a('0x3'));var express=require(_0x442a('0x4'));var router=express['Router']();var auth=require(_0x442a('0x5'));var interaction=require(_0x442a('0x6'));var config=require(_0x442a('0x7'));var controller=require(_0x442a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x442a('0x9')]);router['get'](_0x442a('0xa'),auth[_0x442a('0xb')](),controller[_0x442a('0xc')]);router[_0x442a('0xd')](_0x442a('0xe'),auth[_0x442a('0xb')](),controller[_0x442a('0xf')]);router[_0x442a('0xd')](_0x442a('0x10'),auth[_0x442a('0xb')](),controller[_0x442a('0x11')]);router[_0x442a('0x12')]('/',auth[_0x442a('0xb')](),controller[_0x442a('0x13')]);router[_0x442a('0x12')]('/:id/queues',auth['isAuthenticated'](),controller[_0x442a('0x14')]);router[_0x442a('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x442a('0x15')]);router[_0x442a('0x16')]('/:id',auth[_0x442a('0xb')](),controller[_0x442a('0x17')]);router[_0x442a('0x18')](_0x442a('0xa'),auth['isAuthenticated'](),controller[_0x442a('0x19')]);router[_0x442a('0x18')](_0x442a('0xe'),auth['isAuthenticated'](),controller[_0x442a('0x1a')]);router[_0x442a('0x18')]('/:id/users',auth[_0x442a('0xb')](),controller[_0x442a('0x1b')]);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 f928520..c1ff1f3 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 _0x901a=['exports','STRING','sequelize'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x901a,0x1e2));var _0xa901=function(_0x3fa684,_0x27049a){_0x3fa684=_0x3fa684-0x0;var _0x25c7fb=_0x901a[_0x3fa684];return _0x25c7fb;};'use strict';var Sequelize=require(_0xa901('0x0'));module[_0xa901('0x1')]={'name':{'type':Sequelize[_0xa901('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xa901('0x2')]}}; \ No newline at end of file +var _0x35cc=['STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x35cc,0x101));var _0xc35c=function(_0x5bb864,_0x2b8096){_0x5bb864=_0x5bb864-0x0;var _0x11ce9d=_0x35cc[_0x5bb864];return _0x11ce9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc35c('0x0')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xc35c('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index aa73f8a..26f2b14 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 _0x7d37=['count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','Teams','UserProfileResource','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','Team','includeAll','findAll','catch','show','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','sort','pick','Queues','addQueues','ValidationError','ids','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','omit','spread','removeAgents','voice','mail','sms','fax','openchannel','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end'];(function(_0x252e9e,_0x1d22bc){var _0x3e1009=function(_0x123bed){while(--_0x123bed){_0x252e9e['push'](_0x252e9e['shift']());}};_0x3e1009(++_0x1d22bc);}(_0x7d37,0x1db));var _0x77d3=function(_0x21f62e,_0x3e3099){_0x21f62e=_0x21f62e-0x0;var _0x251bd4=_0x7d37[_0x21f62e];return _0x251bd4;};'use strict';var pdf=require(_0x77d3('0x0'));var emlformat=require(_0x77d3('0x1'));var rimraf=require(_0x77d3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77d3('0x3'));var rp=require(_0x77d3('0x4'));var moment=require(_0x77d3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x77d3('0x6'));var util=require(_0x77d3('0x7'));var path=require('path');var sox=require(_0x77d3('0x8'));var csv=require('to-csv');var ejs=require(_0x77d3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x77d3('0xa'));var crypto=require(_0x77d3('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x77d3('0xc'));var querystring=require(_0x77d3('0xd'));var Papa=require('papaparse');var Redis=require(_0x77d3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x77d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77d3('0x10'));var logger=require('../../config/logger')(_0x77d3('0x11'));var utils=require(_0x77d3('0x12'));var config=require(_0x77d3('0x13'));var db=require(_0x77d3('0x14'))['db'];config[_0x77d3('0x15')]=_[_0x77d3('0x16')](config[_0x77d3('0x15')],{'host':_0x77d3('0x17'),'port':0x18eb});var socket=require(_0x77d3('0x18'))(new Redis(config['redis']));require(_0x77d3('0x19'))['register'](socket);function respondWithStatusCode(_0x4f40fb,_0x5a9cdb){_0x5a9cdb=_0x5a9cdb||0xcc;return function(_0x3747d2){if(_0x3747d2){return _0x4f40fb[_0x77d3('0x1a')](_0x5a9cdb);}return _0x4f40fb[_0x77d3('0x1b')](_0x5a9cdb)[_0x77d3('0x1c')]();};}function respondWithResult(_0x891f26,_0x4d98a4){_0x4d98a4=_0x4d98a4||0xc8;return function(_0x296e89){if(_0x296e89){return _0x891f26[_0x77d3('0x1b')](_0x4d98a4)['json'](_0x296e89);}};}function respondWithFilteredResult(_0x5dbf72,_0xfe320e){return function(_0xcae48d){if(_0xcae48d){var _0x60173f=_0xcae48d[_0x77d3('0x1d')],_0x4500a2=_0xfe320e[_0x77d3('0x1e')],_0x144656=_0xfe320e[_0x77d3('0x1e')]+_0xfe320e[_0x77d3('0x1f')],_0x1378a5;if(_0x144656>=_0x60173f){_0x144656=_0x60173f;_0x1378a5=0xc8;}else{_0x1378a5=0xce;}_0x5dbf72[_0x77d3('0x1b')](_0x1378a5);return _0x5dbf72[_0x77d3('0x20')](_0x77d3('0x21'),_0x4500a2+'-'+_0x144656+'/'+_0x60173f)[_0x77d3('0x22')](_0xcae48d);}return null;};}function patchUpdates(_0x4366b6){return function(_0x9c6c7e){try{jsonpatch[_0x77d3('0x23')](_0x9c6c7e,_0x4366b6,!![]);}catch(_0x471bc0){return BPromise['reject'](_0x471bc0);}return _0x9c6c7e[_0x77d3('0x24')]();};}function saveUpdates(_0x17d3a3,_0x1504c7){return function(_0x1ce7c0){if(_0x1ce7c0){return _0x1ce7c0[_0x77d3('0x25')](_0x17d3a3)[_0x77d3('0x26')](function(_0x12c085){return _0x12c085;});}return null;};}function removeEntity(_0x17e9f9,_0x2c0861){return function(_0x4a8e5b){if(_0x4a8e5b){return _0x4a8e5b[_0x77d3('0x27')]()['then'](function(){var _0x467335=_0x4a8e5b[_0x77d3('0x28')]({'plain':!![]});var _0x1f03a3=_0x77d3('0x29');return db[_0x77d3('0x2a')][_0x77d3('0x27')]({'where':{'type':_0x1f03a3,'resourceId':_0x467335['id']}})['then'](function(){return _0x4a8e5b;});})[_0x77d3('0x26')](function(){_0x17e9f9[_0x77d3('0x1b')](0xcc)[_0x77d3('0x1c')]();});}};}function handleEntityNotFound(_0x1e2ead,_0x451c1a){return function(_0x3a5735){if(!_0x3a5735){_0x1e2ead[_0x77d3('0x1a')](0x194);}return _0x3a5735;};}function handleError(_0x44b1bd,_0x275eb5){_0x275eb5=_0x275eb5||0x1f4;return function(_0x41b79d){logger['error'](_0x41b79d[_0x77d3('0x2b')]);if(_0x41b79d[_0x77d3('0x2c')]){delete _0x41b79d['name'];}_0x44b1bd[_0x77d3('0x1b')](_0x275eb5)[_0x77d3('0x2d')](_0x41b79d);};}exports['index']=function(_0x524f89,_0x2f4542){var _0x582575={},_0xb9ebbb={},_0x14e933={'count':0x0,'rows':[]};var _0x3b474e=_['map'](db['Team']['rawAttributes'],function(_0x41530b){return{'name':_0x41530b[_0x77d3('0x2e')],'type':_0x41530b[_0x77d3('0x2f')][_0x77d3('0x30')]};});_0xb9ebbb[_0x77d3('0x31')]=_[_0x77d3('0x32')](_0x3b474e,_0x77d3('0x2c'));_0xb9ebbb[_0x77d3('0x33')]=_['keys'](_0x524f89['query']);_0xb9ebbb[_0x77d3('0x34')]=_[_0x77d3('0x35')](_0xb9ebbb['model'],_0xb9ebbb[_0x77d3('0x33')]);_0x582575['attributes']=_[_0x77d3('0x35')](_0xb9ebbb[_0x77d3('0x31')],qs[_0x77d3('0x36')](_0x524f89[_0x77d3('0x33')][_0x77d3('0x36')]));_0x582575['attributes']=_0x582575['attributes'][_0x77d3('0x37')]?_0x582575[_0x77d3('0x38')]:_0xb9ebbb[_0x77d3('0x31')];if(!_0x524f89[_0x77d3('0x33')][_0x77d3('0x39')](_0x77d3('0x3a'))){_0x582575[_0x77d3('0x1f')]=qs[_0x77d3('0x1f')](_0x524f89[_0x77d3('0x33')][_0x77d3('0x1f')]);_0x582575['offset']=qs['offset'](_0x524f89[_0x77d3('0x33')]['offset']);}_0x582575[_0x77d3('0x3b')]=qs['sort'](_0x524f89[_0x77d3('0x33')]['sort']);_0x582575[_0x77d3('0x3c')]=qs[_0x77d3('0x34')](_['pick'](_0x524f89[_0x77d3('0x33')],_0xb9ebbb[_0x77d3('0x34')]));if(_0x524f89['query'][_0x77d3('0x3d')]){_0x582575[_0x77d3('0x3c')]=_[_0x77d3('0x3e')](_0x582575[_0x77d3('0x3c')],{'$or':_[_0x77d3('0x32')](_0x3b474e,function(_0x412cb5){if(_0x412cb5[_0x77d3('0x2f')]!==_0x77d3('0x3f')){var _0x5a12e4={};_0x5a12e4[_0x412cb5[_0x77d3('0x2c')]]={'$like':'%'+_0x524f89[_0x77d3('0x33')][_0x77d3('0x3d')]+'%'};return _0x5a12e4;}})});}_0x582575=_[_0x77d3('0x3e')]({},_0x582575,_0x524f89[_0x77d3('0x40')]);var _0x603c92={'where':_0x582575[_0x77d3('0x3c')]};return db[_0x77d3('0x41')][_0x77d3('0x1d')](_0x603c92)[_0x77d3('0x26')](function(_0x1a966f){_0x14e933[_0x77d3('0x1d')]=_0x1a966f;if(_0x524f89[_0x77d3('0x33')][_0x77d3('0x42')]){_0x582575['include']=[{'all':!![]}];}return db[_0x77d3('0x41')][_0x77d3('0x43')](_0x582575);})[_0x77d3('0x26')](function(_0x4921bc){_0x14e933['rows']=_0x4921bc;return _0x14e933;})['then'](respondWithFilteredResult(_0x2f4542,_0x582575))[_0x77d3('0x44')](handleError(_0x2f4542,null));};exports[_0x77d3('0x45')]=function(_0xc24ae9,_0x3abe37){var _0xc2e93f={'raw':![],'where':{'id':_0xc24ae9['params']['id']}},_0x1b96ad={};_0x1b96ad['model']=_[_0x77d3('0x46')](db[_0x77d3('0x41')][_0x77d3('0x47')]);_0x1b96ad['query']=_['keys'](_0xc24ae9[_0x77d3('0x33')]);_0x1b96ad[_0x77d3('0x34')]=_['intersection'](_0x1b96ad[_0x77d3('0x31')],_0x1b96ad['query']);_0xc2e93f['attributes']=_[_0x77d3('0x35')](_0x1b96ad[_0x77d3('0x31')],qs[_0x77d3('0x36')](_0xc24ae9[_0x77d3('0x33')][_0x77d3('0x36')]));_0xc2e93f[_0x77d3('0x38')]=_0xc2e93f[_0x77d3('0x38')][_0x77d3('0x37')]?_0xc2e93f['attributes']:_0x1b96ad[_0x77d3('0x31')];if(_0xc24ae9[_0x77d3('0x33')][_0x77d3('0x42')]){_0xc2e93f[_0x77d3('0x48')]=[{'all':!![]}];}_0xc2e93f=_[_0x77d3('0x3e')]({},_0xc2e93f,_0xc24ae9[_0x77d3('0x40')]);return db[_0x77d3('0x41')][_0x77d3('0x49')](_0xc2e93f)[_0x77d3('0x26')](handleEntityNotFound(_0x3abe37,null))[_0x77d3('0x26')](respondWithResult(_0x3abe37,null))['catch'](handleError(_0x3abe37,null));};exports[_0x77d3('0x4a')]=function(_0x37e2f7,_0x520fd7){return db['Team']['create'](_0x37e2f7[_0x77d3('0x4b')],{})['then'](function(_0x3ee985){var _0xbf0366=_0x37e2f7[_0x77d3('0x4c')][_0x77d3('0x28')]({'plain':!![]});if(!_0xbf0366)throw new Error(_0x77d3('0x4d'));if(_0xbf0366['role']===_0x77d3('0x4c')){var _0x514688=_0x3ee985[_0x77d3('0x28')]({'plain':!![]});var _0x47ebbb='Teams';return db[_0x77d3('0x4e')]['find']({'where':{'name':_0x47ebbb,'userProfileId':_0xbf0366[_0x77d3('0x4f')]},'raw':!![]})[_0x77d3('0x26')](function(_0x4a1c12){if(_0x4a1c12&&_0x4a1c12[_0x77d3('0x50')]===0x0){return db[_0x77d3('0x2a')][_0x77d3('0x4a')]({'name':_0x514688[_0x77d3('0x2c')],'resourceId':_0x514688['id'],'type':_0x4a1c12[_0x77d3('0x2c')],'sectionId':_0x4a1c12['id']},{})[_0x77d3('0x26')](function(){return _0x3ee985;});}else{return _0x3ee985;}})[_0x77d3('0x44')](function(_0x243409){logger[_0x77d3('0x51')](_0x77d3('0x52'),_0x243409);throw _0x243409;});}return _0x3ee985;})['then'](respondWithResult(_0x520fd7,0xc9))[_0x77d3('0x44')](handleError(_0x520fd7,null));};exports['update']=function(_0x330fe0,_0x1ad0f8){if(_0x330fe0['body']['id']){delete _0x330fe0[_0x77d3('0x4b')]['id'];}return db['Team'][_0x77d3('0x49')]({'where':{'id':_0x330fe0[_0x77d3('0x53')]['id']}})['then'](handleEntityNotFound(_0x1ad0f8,null))[_0x77d3('0x26')](saveUpdates(_0x330fe0['body'],null))[_0x77d3('0x26')](respondWithResult(_0x1ad0f8,null))[_0x77d3('0x44')](handleError(_0x1ad0f8,null));};exports['destroy']=function(_0x2deccb,_0x2cf666){return db[_0x77d3('0x41')][_0x77d3('0x49')]({'where':{'id':_0x2deccb['params']['id']}})[_0x77d3('0x26')](handleEntityNotFound(_0x2cf666,null))['then'](removeEntity(_0x2cf666,null))[_0x77d3('0x44')](handleError(_0x2cf666,null));};exports['getQueues']=function(_0x5a0061,_0x4800eb,_0x5906b7){return db[_0x77d3('0x41')][_0x77d3('0x54')]({'where':{'id':_0x5a0061[_0x77d3('0x53')]['id']}})[_0x77d3('0x26')](handleEntityNotFound(_0x4800eb,null))[_0x77d3('0x26')](function(_0x42f9c8){if(!_0x5a0061['query'][_0x77d3('0x55')]||!utils[_0x77d3('0x56')](_0x5a0061[_0x77d3('0x33')]['channel'])){throw new db[(_0x77d3('0x57'))]['ValidationError'](_0x77d3('0x58'));}var _0x28c099={};var _0xf358a9={};_0xf358a9[_0x77d3('0x31')]=_[_0x77d3('0x46')](db[_[_0x77d3('0x59')](_0x5a0061['query'][_0x77d3('0x55')][_0x77d3('0x5a')]())+'Queue'][_0x77d3('0x47')]);_0xf358a9[_0x77d3('0x33')]=_[_0x77d3('0x46')](_0x5a0061[_0x77d3('0x33')]);_0xf358a9[_0x77d3('0x34')]=_[_0x77d3('0x35')](_0xf358a9[_0x77d3('0x31')],_0xf358a9[_0x77d3('0x33')]);_0x28c099[_0x77d3('0x38')]=_[_0x77d3('0x35')](_0xf358a9['model'],qs[_0x77d3('0x36')](_0x5a0061['query']['fields']));_0x28c099['attributes']=_0x28c099[_0x77d3('0x38')][_0x77d3('0x37')]?_0x28c099['attributes']:_0xf358a9[_0x77d3('0x31')];_0x28c099[_0x77d3('0x1f')]=qs[_0x77d3('0x1f')](_0x5a0061[_0x77d3('0x33')][_0x77d3('0x1f')]);_0x28c099[_0x77d3('0x1e')]=qs[_0x77d3('0x1e')](_0x5a0061[_0x77d3('0x33')][_0x77d3('0x1e')]);_0x28c099['order']=qs[_0x77d3('0x5b')](_0x5a0061['query'][_0x77d3('0x5b')]);_0x28c099[_0x77d3('0x3c')]=qs[_0x77d3('0x34')](_[_0x77d3('0x5c')](_0x5a0061['query'],_0xf358a9[_0x77d3('0x34')]));_0x28c099=_[_0x77d3('0x3e')]({},_0x28c099,_0x5a0061[_0x77d3('0x40')]);return _0x42f9c8['get'+_[_0x77d3('0x59')](_0x5a0061['query'][_0x77d3('0x55')][_0x77d3('0x5a')]())+_0x77d3('0x5d')](_0x28c099);})['then'](respondWithResult(_0x4800eb,null))[_0x77d3('0x44')](handleError(_0x4800eb,null));};exports[_0x77d3('0x5e')]=function(_0x4ad52b,_0x3fb7fd,_0x4a240d){return db[_0x77d3('0x41')][_0x77d3('0x54')]({'where':{'id':_0x4ad52b[_0x77d3('0x53')]['id']}})[_0x77d3('0x26')](function(_0x43894c){if(_0x43894c){if(!_0x4ad52b[_0x77d3('0x4b')][_0x77d3('0x55')]||!utils[_0x77d3('0x56')](_0x4ad52b['body'][_0x77d3('0x55')])){throw new db[(_0x77d3('0x57'))][(_0x77d3('0x5f'))](_0x77d3('0x58'));}return _0x43894c['add'+_[_0x77d3('0x59')](_0x4ad52b['body'][_0x77d3('0x55')][_0x77d3('0x5a')]())+'Queues'](_0x4ad52b[_0x77d3('0x4b')][_0x77d3('0x60')]);}return null;})[_0x77d3('0x26')](handleEntityNotFound(_0x3fb7fd,null))[_0x77d3('0x26')](respondWithStatusCode(_0x3fb7fd,null))['catch'](handleError(_0x3fb7fd,null));};exports['removeQueues']=function(_0x1e9f2f,_0x13e3a2,_0x248c94){return db['Team'][_0x77d3('0x54')]({'where':{'id':_0x1e9f2f['params']['id']}})[_0x77d3('0x26')](function(_0x409a98){if(_0x409a98){if(!_0x1e9f2f[_0x77d3('0x33')][_0x77d3('0x55')]||!utils['isValidChannel'](_0x1e9f2f['query'][_0x77d3('0x55')])){throw new db[(_0x77d3('0x57'))][(_0x77d3('0x5f'))](_0x77d3('0x58'));}return _0x409a98[_0x77d3('0x61')+_['capitalize'](_0x1e9f2f['query'][_0x77d3('0x55')][_0x77d3('0x5a')]())+_0x77d3('0x5d')](_0x1e9f2f[_0x77d3('0x33')][_0x77d3('0x60')]);}return null;})[_0x77d3('0x26')](handleEntityNotFound(_0x13e3a2,null))[_0x77d3('0x26')](respondWithStatusCode(_0x13e3a2,null))[_0x77d3('0x44')](handleError(_0x13e3a2,null));};exports[_0x77d3('0x62')]=function(_0x480ff5,_0x546462,_0x144307){return db['Team'][_0x77d3('0x49')]({'where':{'id':_0x480ff5[_0x77d3('0x53')]['id']}})[_0x77d3('0x26')](handleEntityNotFound(_0x546462,null))[_0x77d3('0x26')](function(_0x8d6bec){if(_0x8d6bec){var _0x42bdaa=[_0x77d3('0x63'),_0x77d3('0x64'),_0x77d3('0x65'),_0x77d3('0x66'),'Fax',_0x77d3('0x67')];return BPromise[_0x77d3('0x68')](_0x42bdaa,function(_0x1ad4d7){return _0x8d6bec['get'+_0x1ad4d7+'Queues']({'attributes':['id',_0x77d3('0x2c')]})[_0x77d3('0x26')](function(_0x344277){return BPromise['each'](_0x344277,function(_0xe13fff){return _0xe13fff['addAgents'](_0x480ff5['body'][_0x77d3('0x60')])[_0x77d3('0x26')](function(){if(_0x1ad4d7===_0x77d3('0x63')){return db[_0x77d3('0x69')][_0x77d3('0x43')]({'where':{'id':_0x480ff5[_0x77d3('0x4b')][_0x77d3('0x60')]},'attributes':['id',_0x77d3('0x2c'),_0x77d3('0x6a'),_0x77d3('0x6b'),_0x77d3('0x6c')],'raw':!![]})[_0x77d3('0x26')](function(_0x3d549a){return BPromise[_0x77d3('0x68')](_['filter'](_0x3d549a,{'online':0x1}),function(_0x350b89){return db[_0x77d3('0x6d')][_0x77d3('0x6e')]({'membername':_0x350b89['name'],'UserId':_0x350b89['id'],'queue_name':_0xe13fff[_0x77d3('0x2c')],'VoiceQueueId':_0xe13fff['id'],'interface':_[_0x77d3('0x6f')](_0x350b89[_0x77d3('0x6c')])?util[_0x77d3('0x70')](_0x77d3('0x71'),_0x350b89[_0x77d3('0x2c')]):_0x350b89[_0x77d3('0x6c')],'paused':_0x350b89['voicePause']||![],'penalty':0x0});});});}});});})[_0x77d3('0x26')](function(){return _0x8d6bec;});})[_0x77d3('0x26')](function(){return _0x8d6bec;});}})['then'](function(_0x740eea){if(_0x740eea){return _0x740eea['addAgents'](_0x480ff5[_0x77d3('0x4b')]['ids'],_[_0x77d3('0x72')](_0x480ff5[_0x77d3('0x4b')],[_0x77d3('0x60'),'id'])||{})[_0x77d3('0x73')](function(_0x22bcc8){for(var _0x5832ba=0x0;_0x5832ba<_0x480ff5[_0x77d3('0x4b')][_0x77d3('0x60')][_0x77d3('0x37')];_0x5832ba+=0x1){socket['emit']('userTeam:save',{'UserId':_0x480ff5[_0x77d3('0x4b')][_0x77d3('0x60')][_0x5832ba],'TeamId':_0x480ff5[_0x77d3('0x53')]['id']});}return _0x22bcc8;});}})[_0x77d3('0x26')](respondWithResult(_0x546462,null))['catch'](handleError(_0x546462,null));};exports[_0x77d3('0x74')]=function(_0x1252d3,_0x174a59,_0x17b22e){return db[_0x77d3('0x41')][_0x77d3('0x49')]({'where':{'id':_0x1252d3[_0x77d3('0x53')]['id']}})[_0x77d3('0x26')](handleEntityNotFound(_0x174a59,null))[_0x77d3('0x26')](function(_0x29b4df){if(_0x29b4df){return BPromise[_0x77d3('0x68')]([_0x77d3('0x75'),'chat',_0x77d3('0x76'),_0x77d3('0x77'),_0x77d3('0x78'),_0x77d3('0x79')],function(_0x5961cb){return _0x29b4df[_0x77d3('0x28')+_['capitalize'](_0x5961cb)+_0x77d3('0x5d')]({'attributes':['id',_0x77d3('0x2c')]})[_0x77d3('0x26')](function(_0x10b769){return BPromise[_0x77d3('0x68')](_0x10b769,function(_0xda92d9){return _0xda92d9[_0x77d3('0x74')](_0x1252d3[_0x77d3('0x33')][_0x77d3('0x60')])['then'](function(){if(_0x5961cb==='voice'){return db[_0x77d3('0x6d')][_0x77d3('0x27')]({'where':{'VoiceQueueId':_0xda92d9['id'],'UserId':_0x1252d3['query'][_0x77d3('0x60')]}});}});});})['then'](function(){return _0x29b4df;});})['then'](function(){return _0x29b4df;});}})[_0x77d3('0x26')](function(_0x51381b){if(_0x51381b){return _0x51381b[_0x77d3('0x74')](_0x1252d3[_0x77d3('0x33')]['ids'])['then'](function(){if(_[_0x77d3('0x7a')](_0x1252d3[_0x77d3('0x33')][_0x77d3('0x60')])){for(var _0x5f0b6b=0x0;_0x5f0b6b<_0x1252d3[_0x77d3('0x33')][_0x77d3('0x60')][_0x77d3('0x37')];_0x5f0b6b+=0x1){socket[_0x77d3('0x7b')](_0x77d3('0x7c'),{'UserId':Number(_0x1252d3[_0x77d3('0x33')][_0x77d3('0x60')][_0x5f0b6b]),'TeamId':Number(_0x1252d3[_0x77d3('0x53')]['id'])});}}else{socket[_0x77d3('0x7b')]('userTeam:remove',{'UserId':Number(_0x1252d3['query']['ids']),'TeamId':Number(_0x1252d3[_0x77d3('0x53')]['id'])});}});}})[_0x77d3('0x26')](respondWithStatusCode(_0x174a59,null))[_0x77d3('0x44')](handleError(_0x174a59,null));};exports['getAgents']=function(_0x5f538e,_0x56ae64,_0x53a333){var _0x4c1e91={};var _0x5f1b3a={};var _0x58db46;var _0x9a1b8f;return db[_0x77d3('0x41')]['findOne']({'where':{'id':_0x5f538e['params']['id']}})[_0x77d3('0x26')](handleEntityNotFound(_0x56ae64,null))[_0x77d3('0x26')](function(_0x501680){if(_0x501680){_0x58db46=_0x501680;_0x5f1b3a['model']=_[_0x77d3('0x46')](db[_0x77d3('0x69')][_0x77d3('0x47')]);_0x5f1b3a['query']=_['keys'](_0x5f538e[_0x77d3('0x33')]);_0x5f1b3a[_0x77d3('0x34')]=_[_0x77d3('0x35')](_0x5f1b3a[_0x77d3('0x31')],_0x5f1b3a[_0x77d3('0x33')]);_0x4c1e91[_0x77d3('0x38')]=_[_0x77d3('0x35')](_0x5f1b3a[_0x77d3('0x31')],qs[_0x77d3('0x36')](_0x5f538e['query'][_0x77d3('0x36')]));_0x4c1e91[_0x77d3('0x38')]=_0x4c1e91[_0x77d3('0x38')]['length']?_0x4c1e91[_0x77d3('0x38')]:_0x5f1b3a[_0x77d3('0x31')];_0x4c1e91[_0x77d3('0x3b')]=qs[_0x77d3('0x5b')](_0x5f538e['query'][_0x77d3('0x5b')]);_0x4c1e91['where']=qs[_0x77d3('0x34')](_[_0x77d3('0x5c')](_0x5f538e['query'],_0x5f1b3a[_0x77d3('0x34')]));if(_0x5f538e['query'][_0x77d3('0x3d')]){_0x4c1e91[_0x77d3('0x3c')]=_[_0x77d3('0x3e')](_0x4c1e91['where'],{'$or':_['map'](_0x4c1e91[_0x77d3('0x38')],function(_0x25fbcd){var _0x18eca5={};_0x18eca5[_0x25fbcd]={'$like':'%'+_0x5f538e[_0x77d3('0x33')][_0x77d3('0x3d')]+'%'};return _0x18eca5;})});}_0x4c1e91=_[_0x77d3('0x3e')]({},_0x4c1e91,_0x5f538e[_0x77d3('0x40')]);return _0x58db46[_0x77d3('0x7d')](_0x4c1e91);}})[_0x77d3('0x26')](function(_0x4a9d57){if(_0x4a9d57){_0x9a1b8f=_0x4a9d57['length'];if(!_0x5f538e[_0x77d3('0x33')][_0x77d3('0x39')]('nolimit')){_0x4c1e91[_0x77d3('0x1f')]=qs[_0x77d3('0x1f')](_0x5f538e[_0x77d3('0x33')][_0x77d3('0x1f')]);_0x4c1e91['offset']=qs['offset'](_0x5f538e[_0x77d3('0x33')][_0x77d3('0x1e')]);}return _0x58db46[_0x77d3('0x7d')](_0x4c1e91);}})[_0x77d3('0x26')](function(_0x380f57){if(_0x380f57){return _0x380f57?{'count':_0x9a1b8f,'rows':_0x380f57}:null;}})[_0x77d3('0x26')](respondWithResult(_0x56ae64,null))[_0x77d3('0x44')](handleError(_0x56ae64,null));}; \ No newline at end of file +var _0x32f4=['offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','Teams','end','error','name','send','index','map','Team','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','get','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','body','getQueues','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','add','remove','ids','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','emit','userTeam:save','removeAgents','voice','chat','mail','fax','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','count'];(function(_0x4e704a,_0x7f0720){var _0x3f6b9f=function(_0x21fc95){while(--_0x21fc95){_0x4e704a['push'](_0x4e704a['shift']());}};_0x3f6b9f(++_0x7f0720);}(_0x32f4,0x154));var _0x432f=function(_0x46ef49,_0x5c5c31){_0x46ef49=_0x46ef49-0x0;var _0x57fffc=_0x32f4[_0x46ef49];return _0x57fffc;};'use strict';var pdf=require(_0x432f('0x0'));var emlformat=require(_0x432f('0x1'));var rimraf=require(_0x432f('0x2'));var zipdir=require(_0x432f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x432f('0x4'));var moment=require(_0x432f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x432f('0x6'));var util=require(_0x432f('0x7'));var path=require(_0x432f('0x8'));var sox=require(_0x432f('0x9'));var csv=require(_0x432f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x432f('0xb'));var crypto=require(_0x432f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x432f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x432f('0xe'));var Papa=require(_0x432f('0xf'));var Redis=require(_0x432f('0x10'));var authService=require(_0x432f('0x11'));var qs=require(_0x432f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x432f('0x13'));var logger=require('../../config/logger')(_0x432f('0x14'));var utils=require('../../config/utils');var config=require(_0x432f('0x15'));var db=require(_0x432f('0x16'))['db'];config['redis']=_[_0x432f('0x17')](config[_0x432f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x432f('0x19'))(new Redis(config[_0x432f('0x18')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x28d9e9,_0x44756d){_0x44756d=_0x44756d||0xcc;return function(_0x34add6){if(_0x34add6){return _0x28d9e9[_0x432f('0x1a')](_0x44756d);}return _0x28d9e9[_0x432f('0x1b')](_0x44756d)['end']();};}function respondWithResult(_0x175ba7,_0x2f0708){_0x2f0708=_0x2f0708||0xc8;return function(_0x1e2c30){if(_0x1e2c30){return _0x175ba7[_0x432f('0x1b')](_0x2f0708)['json'](_0x1e2c30);}};}function respondWithFilteredResult(_0xdd0293,_0x30f231){return function(_0x42c2d2){if(_0x42c2d2){var _0x243cf=_0x42c2d2[_0x432f('0x1c')],_0x3cd5da=_0x30f231['offset'],_0x129582=_0x30f231[_0x432f('0x1d')]+_0x30f231[_0x432f('0x1e')],_0x5ae24e;if(_0x129582>=_0x243cf){_0x129582=_0x243cf;_0x5ae24e=0xc8;}else{_0x5ae24e=0xce;}_0xdd0293[_0x432f('0x1b')](_0x5ae24e);return _0xdd0293[_0x432f('0x1f')](_0x432f('0x20'),_0x3cd5da+'-'+_0x129582+'/'+_0x243cf)[_0x432f('0x21')](_0x42c2d2);}return null;};}function patchUpdates(_0x10f39b){return function(_0x1899e6){try{jsonpatch[_0x432f('0x22')](_0x1899e6,_0x10f39b,!![]);}catch(_0xf5b60c){return BPromise[_0x432f('0x23')](_0xf5b60c);}return _0x1899e6[_0x432f('0x24')]();};}function saveUpdates(_0x4dd230,_0x5940bd){return function(_0x343d13){if(_0x343d13){return _0x343d13['update'](_0x4dd230)[_0x432f('0x25')](function(_0x5b9c70){return _0x5b9c70;});}return null;};}function removeEntity(_0x37f136,_0x175d1b){return function(_0x241cb4){if(_0x241cb4){return _0x241cb4[_0x432f('0x26')]()[_0x432f('0x25')](function(){var _0x1e347a=_0x241cb4['get']({'plain':!![]});var _0x252b3b=_0x432f('0x27');return db['UserProfileResource'][_0x432f('0x26')]({'where':{'type':_0x252b3b,'resourceId':_0x1e347a['id']}})[_0x432f('0x25')](function(){return _0x241cb4;});})[_0x432f('0x25')](function(){_0x37f136[_0x432f('0x1b')](0xcc)[_0x432f('0x28')]();});}};}function handleEntityNotFound(_0x781862,_0x138a6a){return function(_0x5a3d18){if(!_0x5a3d18){_0x781862[_0x432f('0x1a')](0x194);}return _0x5a3d18;};}function handleError(_0x4eeae1,_0x1f1fdd){_0x1f1fdd=_0x1f1fdd||0x1f4;return function(_0x573cc5){logger[_0x432f('0x29')](_0x573cc5['stack']);if(_0x573cc5[_0x432f('0x2a')]){delete _0x573cc5['name'];}_0x4eeae1[_0x432f('0x1b')](_0x1f1fdd)[_0x432f('0x2b')](_0x573cc5);};}exports[_0x432f('0x2c')]=function(_0x59c1ab,_0x6a116e){var _0x24406a={},_0x48139b={},_0x5ee0fa={'count':0x0,'rows':[]};var _0x1dd815=_[_0x432f('0x2d')](db[_0x432f('0x2e')][_0x432f('0x2f')],function(_0x194f5e){return{'name':_0x194f5e[_0x432f('0x30')],'type':_0x194f5e['type']['key']};});_0x48139b[_0x432f('0x31')]=_[_0x432f('0x2d')](_0x1dd815,_0x432f('0x2a'));_0x48139b['query']=_[_0x432f('0x32')](_0x59c1ab[_0x432f('0x33')]);_0x48139b[_0x432f('0x34')]=_[_0x432f('0x35')](_0x48139b[_0x432f('0x31')],_0x48139b[_0x432f('0x33')]);_0x24406a[_0x432f('0x36')]=_[_0x432f('0x35')](_0x48139b['model'],qs['fields'](_0x59c1ab[_0x432f('0x33')][_0x432f('0x37')]));_0x24406a['attributes']=_0x24406a['attributes']['length']?_0x24406a[_0x432f('0x36')]:_0x48139b[_0x432f('0x31')];if(!_0x59c1ab['query'][_0x432f('0x38')](_0x432f('0x39'))){_0x24406a[_0x432f('0x1e')]=qs['limit'](_0x59c1ab[_0x432f('0x33')][_0x432f('0x1e')]);_0x24406a['offset']=qs[_0x432f('0x1d')](_0x59c1ab[_0x432f('0x33')]['offset']);}_0x24406a[_0x432f('0x3a')]=qs[_0x432f('0x3b')](_0x59c1ab[_0x432f('0x33')][_0x432f('0x3b')]);_0x24406a[_0x432f('0x3c')]=qs[_0x432f('0x34')](_[_0x432f('0x3d')](_0x59c1ab[_0x432f('0x33')],_0x48139b[_0x432f('0x34')]));if(_0x59c1ab[_0x432f('0x33')][_0x432f('0x3e')]){_0x24406a['where']=_[_0x432f('0x3f')](_0x24406a['where'],{'$or':_[_0x432f('0x2d')](_0x1dd815,function(_0x3e8a0a){if(_0x3e8a0a['type']!==_0x432f('0x40')){var _0x47d44d={};_0x47d44d[_0x3e8a0a[_0x432f('0x2a')]]={'$like':'%'+_0x59c1ab[_0x432f('0x33')]['filter']+'%'};return _0x47d44d;}})});}_0x24406a=_['merge']({},_0x24406a,_0x59c1ab[_0x432f('0x41')]);var _0x25ae0d={'where':_0x24406a[_0x432f('0x3c')]};return db[_0x432f('0x2e')][_0x432f('0x1c')](_0x25ae0d)['then'](function(_0x5dade1){_0x5ee0fa['count']=_0x5dade1;if(_0x59c1ab[_0x432f('0x33')][_0x432f('0x42')]){_0x24406a['include']=[{'all':!![]}];}return db[_0x432f('0x2e')][_0x432f('0x43')](_0x24406a);})[_0x432f('0x25')](function(_0x2656eb){_0x5ee0fa[_0x432f('0x44')]=_0x2656eb;return _0x5ee0fa;})[_0x432f('0x25')](respondWithFilteredResult(_0x6a116e,_0x24406a))[_0x432f('0x45')](handleError(_0x6a116e,null));};exports[_0x432f('0x46')]=function(_0x1c5f87,_0x5c6298){var _0x247b63={'raw':![],'where':{'id':_0x1c5f87['params']['id']}},_0xd8264f={};_0xd8264f[_0x432f('0x31')]=_[_0x432f('0x32')](db[_0x432f('0x2e')][_0x432f('0x2f')]);_0xd8264f[_0x432f('0x33')]=_[_0x432f('0x32')](_0x1c5f87[_0x432f('0x33')]);_0xd8264f[_0x432f('0x34')]=_[_0x432f('0x35')](_0xd8264f[_0x432f('0x31')],_0xd8264f[_0x432f('0x33')]);_0x247b63[_0x432f('0x36')]=_[_0x432f('0x35')](_0xd8264f[_0x432f('0x31')],qs['fields'](_0x1c5f87['query'][_0x432f('0x37')]));_0x247b63[_0x432f('0x36')]=_0x247b63[_0x432f('0x36')][_0x432f('0x47')]?_0x247b63[_0x432f('0x36')]:_0xd8264f['model'];if(_0x1c5f87[_0x432f('0x33')][_0x432f('0x42')]){_0x247b63[_0x432f('0x48')]=[{'all':!![]}];}_0x247b63=_[_0x432f('0x3f')]({},_0x247b63,_0x1c5f87[_0x432f('0x41')]);return db[_0x432f('0x2e')][_0x432f('0x49')](_0x247b63)['then'](handleEntityNotFound(_0x5c6298,null))[_0x432f('0x25')](respondWithResult(_0x5c6298,null))[_0x432f('0x45')](handleError(_0x5c6298,null));};exports[_0x432f('0x4a')]=function(_0x547bd0,_0x2c023d){return db[_0x432f('0x2e')]['create'](_0x547bd0['body'],{})[_0x432f('0x25')](function(_0x24f244){var _0x4a6d37=_0x547bd0['user'][_0x432f('0x4b')]({'plain':!![]});if(!_0x4a6d37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a6d37[_0x432f('0x4c')]===_0x432f('0x4d')){var _0x5df9b3=_0x24f244[_0x432f('0x4b')]({'plain':!![]});var _0x560b3c=_0x432f('0x27');return db[_0x432f('0x4e')][_0x432f('0x49')]({'where':{'name':_0x560b3c,'userProfileId':_0x4a6d37[_0x432f('0x4f')]},'raw':!![]})[_0x432f('0x25')](function(_0x2a4d36){if(_0x2a4d36&&_0x2a4d36['autoAssociation']===0x0){return db[_0x432f('0x50')]['create']({'name':_0x5df9b3[_0x432f('0x2a')],'resourceId':_0x5df9b3['id'],'type':_0x2a4d36[_0x432f('0x2a')],'sectionId':_0x2a4d36['id']},{})[_0x432f('0x25')](function(){return _0x24f244;});}else{return _0x24f244;}})[_0x432f('0x45')](function(_0x55a0df){logger[_0x432f('0x29')](_0x432f('0x51'),_0x55a0df);throw _0x55a0df;});}return _0x24f244;})[_0x432f('0x25')](respondWithResult(_0x2c023d,0xc9))[_0x432f('0x45')](handleError(_0x2c023d,null));};exports[_0x432f('0x52')]=function(_0x2a26bd,_0x404368){if(_0x2a26bd['body']['id']){delete _0x2a26bd['body']['id'];}return db[_0x432f('0x2e')][_0x432f('0x49')]({'where':{'id':_0x2a26bd[_0x432f('0x53')]['id']}})[_0x432f('0x25')](handleEntityNotFound(_0x404368,null))[_0x432f('0x25')](saveUpdates(_0x2a26bd[_0x432f('0x54')],null))['then'](respondWithResult(_0x404368,null))[_0x432f('0x45')](handleError(_0x404368,null));};exports['destroy']=function(_0x4e96d8,_0x451377){return db[_0x432f('0x2e')][_0x432f('0x49')]({'where':{'id':_0x4e96d8[_0x432f('0x53')]['id']}})[_0x432f('0x25')](handleEntityNotFound(_0x451377,null))[_0x432f('0x25')](removeEntity(_0x451377,null))['catch'](handleError(_0x451377,null));};exports[_0x432f('0x55')]=function(_0x1dcb3e,_0x49e51d,_0x247ffa){return db[_0x432f('0x2e')]['findOne']({'where':{'id':_0x1dcb3e[_0x432f('0x53')]['id']}})[_0x432f('0x25')](handleEntityNotFound(_0x49e51d,null))[_0x432f('0x25')](function(_0x387999){if(!_0x1dcb3e[_0x432f('0x33')][_0x432f('0x56')]||!utils[_0x432f('0x57')](_0x1dcb3e[_0x432f('0x33')][_0x432f('0x56')])){throw new db[(_0x432f('0x58'))][(_0x432f('0x59'))](_0x432f('0x5a'));}var _0x1caa4b={};var _0x43577d={};_0x43577d[_0x432f('0x31')]=_[_0x432f('0x32')](db[_['capitalize'](_0x1dcb3e['query'][_0x432f('0x56')][_0x432f('0x5b')]())+_0x432f('0x5c')]['rawAttributes']);_0x43577d[_0x432f('0x33')]=_[_0x432f('0x32')](_0x1dcb3e[_0x432f('0x33')]);_0x43577d['filters']=_['intersection'](_0x43577d[_0x432f('0x31')],_0x43577d[_0x432f('0x33')]);_0x1caa4b['attributes']=_[_0x432f('0x35')](_0x43577d['model'],qs[_0x432f('0x37')](_0x1dcb3e[_0x432f('0x33')][_0x432f('0x37')]));_0x1caa4b['attributes']=_0x1caa4b[_0x432f('0x36')][_0x432f('0x47')]?_0x1caa4b[_0x432f('0x36')]:_0x43577d[_0x432f('0x31')];_0x1caa4b['limit']=qs[_0x432f('0x1e')](_0x1dcb3e[_0x432f('0x33')]['limit']);_0x1caa4b[_0x432f('0x1d')]=qs['offset'](_0x1dcb3e['query']['offset']);_0x1caa4b[_0x432f('0x3a')]=qs['sort'](_0x1dcb3e[_0x432f('0x33')][_0x432f('0x3b')]);_0x1caa4b['where']=qs['filters'](_[_0x432f('0x3d')](_0x1dcb3e[_0x432f('0x33')],_0x43577d[_0x432f('0x34')]));_0x1caa4b=_[_0x432f('0x3f')]({},_0x1caa4b,_0x1dcb3e['options']);return _0x387999[_0x432f('0x4b')+_[_0x432f('0x5d')](_0x1dcb3e['query'][_0x432f('0x56')]['toLowerCase']())+_0x432f('0x5e')](_0x1caa4b);})[_0x432f('0x25')](respondWithResult(_0x49e51d,null))[_0x432f('0x45')](handleError(_0x49e51d,null));};exports['addQueues']=function(_0x1e6171,_0x33b624,_0x149119){return db[_0x432f('0x2e')]['findOne']({'where':{'id':_0x1e6171[_0x432f('0x53')]['id']}})['then'](function(_0x1a2eda){if(_0x1a2eda){if(!_0x1e6171[_0x432f('0x54')][_0x432f('0x56')]||!utils[_0x432f('0x57')](_0x1e6171[_0x432f('0x54')][_0x432f('0x56')])){throw new db[(_0x432f('0x58'))][(_0x432f('0x59'))]('Unknown\x20channel');}return _0x1a2eda[_0x432f('0x5f')+_[_0x432f('0x5d')](_0x1e6171[_0x432f('0x54')][_0x432f('0x56')]['toLowerCase']())+_0x432f('0x5e')](_0x1e6171[_0x432f('0x54')]['ids']);}return null;})[_0x432f('0x25')](handleEntityNotFound(_0x33b624,null))[_0x432f('0x25')](respondWithStatusCode(_0x33b624,null))[_0x432f('0x45')](handleError(_0x33b624,null));};exports['removeQueues']=function(_0x1ac552,_0x197e77,_0x1f497a){return db['Team']['findOne']({'where':{'id':_0x1ac552[_0x432f('0x53')]['id']}})[_0x432f('0x25')](function(_0x439509){if(_0x439509){if(!_0x1ac552[_0x432f('0x33')]['channel']||!utils['isValidChannel'](_0x1ac552[_0x432f('0x33')]['channel'])){throw new db[(_0x432f('0x58'))][(_0x432f('0x59'))](_0x432f('0x5a'));}return _0x439509[_0x432f('0x60')+_[_0x432f('0x5d')](_0x1ac552[_0x432f('0x33')][_0x432f('0x56')][_0x432f('0x5b')]())+'Queues'](_0x1ac552[_0x432f('0x33')][_0x432f('0x61')]);}return null;})['then'](handleEntityNotFound(_0x197e77,null))[_0x432f('0x25')](respondWithStatusCode(_0x197e77,null))[_0x432f('0x45')](handleError(_0x197e77,null));};exports['addAgents']=function(_0x531ea9,_0x547b0c,_0x2a92ef){return db[_0x432f('0x2e')][_0x432f('0x49')]({'where':{'id':_0x531ea9[_0x432f('0x53')]['id']}})[_0x432f('0x25')](handleEntityNotFound(_0x547b0c,null))[_0x432f('0x25')](function(_0x504dd8){if(_0x504dd8){var _0x350132=[_0x432f('0x62'),_0x432f('0x63'),_0x432f('0x64'),_0x432f('0x65'),_0x432f('0x66'),_0x432f('0x67')];return BPromise[_0x432f('0x68')](_0x350132,function(_0x38ba64){return _0x504dd8['get'+_0x38ba64+_0x432f('0x5e')]({'attributes':['id',_0x432f('0x2a')]})[_0x432f('0x25')](function(_0x438ed8){return BPromise[_0x432f('0x68')](_0x438ed8,function(_0x465e43){return _0x465e43[_0x432f('0x69')](_0x531ea9[_0x432f('0x54')][_0x432f('0x61')])[_0x432f('0x25')](function(){if(_0x38ba64===_0x432f('0x62')){return db['User'][_0x432f('0x43')]({'where':{'id':_0x531ea9['body']['ids']},'attributes':['id',_0x432f('0x2a'),_0x432f('0x6a'),_0x432f('0x6b'),'interface'],'raw':!![]})['then'](function(_0x3977e0){return BPromise[_0x432f('0x68')](_[_0x432f('0x3e')](_0x3977e0,{'online':0x1}),function(_0x183a91){return db[_0x432f('0x6c')][_0x432f('0x6d')]({'membername':_0x183a91[_0x432f('0x2a')],'UserId':_0x183a91['id'],'queue_name':_0x465e43['name'],'VoiceQueueId':_0x465e43['id'],'interface':_[_0x432f('0x6e')](_0x183a91[_0x432f('0x6f')])?util[_0x432f('0x70')]('SIP/%s',_0x183a91[_0x432f('0x2a')]):_0x183a91[_0x432f('0x6f')],'paused':_0x183a91['voicePause']||![],'penalty':0x0});});});}});});})[_0x432f('0x25')](function(){return _0x504dd8;});})['then'](function(){return _0x504dd8;});}})[_0x432f('0x25')](function(_0x1b1de9){if(_0x1b1de9){return _0x1b1de9[_0x432f('0x69')](_0x531ea9[_0x432f('0x54')][_0x432f('0x61')],_[_0x432f('0x71')](_0x531ea9[_0x432f('0x54')],[_0x432f('0x61'),'id'])||{})['spread'](function(_0x5d87f9){for(var _0x525560=0x0;_0x525560<_0x531ea9[_0x432f('0x54')][_0x432f('0x61')]['length'];_0x525560+=0x1){socket[_0x432f('0x72')](_0x432f('0x73'),{'UserId':_0x531ea9[_0x432f('0x54')][_0x432f('0x61')][_0x525560],'TeamId':_0x531ea9['params']['id']});}return _0x5d87f9;});}})[_0x432f('0x25')](respondWithResult(_0x547b0c,null))[_0x432f('0x45')](handleError(_0x547b0c,null));};exports[_0x432f('0x74')]=function(_0x4dd2f4,_0x13c605,_0x3a0b57){return db[_0x432f('0x2e')][_0x432f('0x49')]({'where':{'id':_0x4dd2f4[_0x432f('0x53')]['id']}})[_0x432f('0x25')](handleEntityNotFound(_0x13c605,null))[_0x432f('0x25')](function(_0x471a7f){if(_0x471a7f){return BPromise[_0x432f('0x68')]([_0x432f('0x75'),_0x432f('0x76'),_0x432f('0x77'),'sms',_0x432f('0x78'),'openchannel'],function(_0x36618f){return _0x471a7f[_0x432f('0x4b')+_[_0x432f('0x5d')](_0x36618f)+'Queues']({'attributes':['id',_0x432f('0x2a')]})[_0x432f('0x25')](function(_0x1da920){return BPromise[_0x432f('0x68')](_0x1da920,function(_0x2d01a5){return _0x2d01a5[_0x432f('0x74')](_0x4dd2f4[_0x432f('0x33')][_0x432f('0x61')])[_0x432f('0x25')](function(){if(_0x36618f==='voice'){return db[_0x432f('0x6c')]['destroy']({'where':{'VoiceQueueId':_0x2d01a5['id'],'UserId':_0x4dd2f4[_0x432f('0x33')][_0x432f('0x61')]}});}});});})[_0x432f('0x25')](function(){return _0x471a7f;});})[_0x432f('0x25')](function(){return _0x471a7f;});}})[_0x432f('0x25')](function(_0xd6f8e0){if(_0xd6f8e0){return _0xd6f8e0[_0x432f('0x74')](_0x4dd2f4[_0x432f('0x33')][_0x432f('0x61')])[_0x432f('0x25')](function(){if(_['isArray'](_0x4dd2f4[_0x432f('0x33')]['ids'])){for(var _0x5fecde=0x0;_0x5fecde<_0x4dd2f4['query'][_0x432f('0x61')][_0x432f('0x47')];_0x5fecde+=0x1){socket[_0x432f('0x72')](_0x432f('0x79'),{'UserId':Number(_0x4dd2f4[_0x432f('0x33')][_0x432f('0x61')][_0x5fecde]),'TeamId':Number(_0x4dd2f4[_0x432f('0x53')]['id'])});}}else{socket[_0x432f('0x72')](_0x432f('0x79'),{'UserId':Number(_0x4dd2f4[_0x432f('0x33')][_0x432f('0x61')]),'TeamId':Number(_0x4dd2f4[_0x432f('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x13c605,null))[_0x432f('0x45')](handleError(_0x13c605,null));};exports[_0x432f('0x7a')]=function(_0x5be889,_0x2357ac,_0x3f478d){var _0x485ae8={};var _0x7ae055={};var _0x742766;var _0x4eb3f8;return db[_0x432f('0x2e')]['findOne']({'where':{'id':_0x5be889['params']['id']}})[_0x432f('0x25')](handleEntityNotFound(_0x2357ac,null))['then'](function(_0xc6a70e){if(_0xc6a70e){_0x742766=_0xc6a70e;_0x7ae055[_0x432f('0x31')]=_['keys'](db['User']['rawAttributes']);_0x7ae055[_0x432f('0x33')]=_[_0x432f('0x32')](_0x5be889[_0x432f('0x33')]);_0x7ae055[_0x432f('0x34')]=_[_0x432f('0x35')](_0x7ae055[_0x432f('0x31')],_0x7ae055['query']);_0x485ae8[_0x432f('0x36')]=_[_0x432f('0x35')](_0x7ae055[_0x432f('0x31')],qs[_0x432f('0x37')](_0x5be889[_0x432f('0x33')][_0x432f('0x37')]));_0x485ae8[_0x432f('0x36')]=_0x485ae8[_0x432f('0x36')][_0x432f('0x47')]?_0x485ae8['attributes']:_0x7ae055['model'];_0x485ae8[_0x432f('0x3a')]=qs[_0x432f('0x3b')](_0x5be889[_0x432f('0x33')][_0x432f('0x3b')]);_0x485ae8['where']=qs[_0x432f('0x34')](_['pick'](_0x5be889[_0x432f('0x33')],_0x7ae055[_0x432f('0x34')]));if(_0x5be889[_0x432f('0x33')]['filter']){_0x485ae8[_0x432f('0x3c')]=_[_0x432f('0x3f')](_0x485ae8['where'],{'$or':_[_0x432f('0x2d')](_0x485ae8['attributes'],function(_0x546c82){var _0xff39eb={};_0xff39eb[_0x546c82]={'$like':'%'+_0x5be889[_0x432f('0x33')][_0x432f('0x3e')]+'%'};return _0xff39eb;})});}_0x485ae8=_[_0x432f('0x3f')]({},_0x485ae8,_0x5be889[_0x432f('0x41')]);return _0x742766[_0x432f('0x7a')](_0x485ae8);}})[_0x432f('0x25')](function(_0x23d164){if(_0x23d164){_0x4eb3f8=_0x23d164[_0x432f('0x47')];if(!_0x5be889[_0x432f('0x33')][_0x432f('0x38')](_0x432f('0x39'))){_0x485ae8['limit']=qs[_0x432f('0x1e')](_0x5be889['query'][_0x432f('0x1e')]);_0x485ae8['offset']=qs[_0x432f('0x1d')](_0x5be889[_0x432f('0x33')][_0x432f('0x1d')]);}return _0x742766[_0x432f('0x7a')](_0x485ae8);}})['then'](function(_0x250cca){if(_0x250cca){return _0x250cca?{'count':_0x4eb3f8,'rows':_0x250cca}:null;}})[_0x432f('0x25')](respondWithResult(_0x2357ac,null))[_0x432f('0x45')](handleError(_0x2357ac,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1cdc379..334f6b3 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 _0x8c68=['events','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x47d18e,_0x4b78ce){var _0x2099d0=function(_0x115622){while(--_0x115622){_0x47d18e['push'](_0x47d18e['shift']());}};_0x2099d0(++_0x4b78ce);}(_0x8c68,0x171));var _0x88c6=function(_0x1d8600,_0x1e2037){_0x1d8600=_0x1d8600-0x0;var _0x19d236=_0x8c68[_0x1d8600];return _0x19d236;};'use strict';var EventEmitter=require(_0x88c6('0x0'));var Team=require('../../mysqldb')['db'][_0x88c6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x88c6('0x2')](0x0);var events={'afterCreate':_0x88c6('0x3'),'afterUpdate':_0x88c6('0x4'),'afterDestroy':_0x88c6('0x5')};function emitEvent(_0x34d4dc){return function(_0x3cfabb,_0x17d603,_0x46bae4){TeamEvents[_0x88c6('0x6')](_0x34d4dc+':'+_0x3cfabb['id'],_0x3cfabb);TeamEvents[_0x88c6('0x6')](_0x34d4dc,_0x3cfabb);_0x46bae4(null);};}for(var e in events){if(events[_0x88c6('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x88c6('0x8')]=TeamEvents; \ No newline at end of file +var _0x7ee5=['exports','events','../../mysqldb','Team','update','remove','emit','hasOwnProperty','hook'];(function(_0xf74b45,_0x38ac42){var _0x59a95d=function(_0x36aeb0){while(--_0x36aeb0){_0xf74b45['push'](_0xf74b45['shift']());}};_0x59a95d(++_0x38ac42);}(_0x7ee5,0x14e));var _0x57ee=function(_0x1c9cfb,_0x4efc3b){_0x1c9cfb=_0x1c9cfb-0x0;var _0x32436a=_0x7ee5[_0x1c9cfb];return _0x32436a;};'use strict';var EventEmitter=require(_0x57ee('0x0'));var Team=require(_0x57ee('0x1'))['db'][_0x57ee('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x57ee('0x3'),'afterDestroy':_0x57ee('0x4')};function emitEvent(_0x4149a0){return function(_0xd41ac1,_0x47742b,_0x4cfda4){TeamEvents[_0x57ee('0x5')](_0x4149a0+':'+_0xd41ac1['id'],_0xd41ac1);TeamEvents[_0x57ee('0x5')](_0x4149a0,_0xd41ac1);_0x4cfda4(null);};}for(var e in events){if(events[_0x57ee('0x6')](e)){var event=events[e];Team[_0x57ee('0x7')](e,emitEvent(event));}}module[_0x57ee('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0e9339d..c96bc1e 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 _0x7d0a=['request-promise','rimraf','../../config/environment','./team.attributes','exports','define','teams','lodash','util','../../config/logger','bluebird'];(function(_0x1a47ff,_0x987cff){var _0x1a768a=function(_0x420633){while(--_0x420633){_0x1a47ff['push'](_0x1a47ff['shift']());}};_0x1a768a(++_0x987cff);}(_0x7d0a,0xe3));var _0xa7d0=function(_0x1f6a60,_0x1465de){_0x1f6a60=_0x1f6a60-0x0;var _0x526310=_0x7d0a[_0x1f6a60];return _0x526310;};'use strict';var _=require(_0xa7d0('0x0'));var util=require(_0xa7d0('0x1'));var logger=require(_0xa7d0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa7d0('0x3'));var rp=require(_0xa7d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7d0('0x5'));var config=require(_0xa7d0('0x6'));var attributes=require(_0xa7d0('0x7'));module[_0xa7d0('0x8')]=function(_0x15aa8,_0x5fb491){return _0x15aa8[_0xa7d0('0x9')]('Team',attributes,{'tableName':_0xa7d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2d9=['exports','define','Team','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./team.attributes'];(function(_0x22ad09,_0x4214c3){var _0x23bf5c=function(_0x395317){while(--_0x395317){_0x22ad09['push'](_0x22ad09['shift']());}};_0x23bf5c(++_0x4214c3);}(_0xe2d9,0x14d));var _0x9e2d=function(_0x7bf6ab,_0x359c5e){_0x7bf6ab=_0x7bf6ab-0x0;var _0x5cc087=_0xe2d9[_0x7bf6ab];return _0x5cc087;};'use strict';var _=require(_0x9e2d('0x0'));var util=require(_0x9e2d('0x1'));var logger=require(_0x9e2d('0x2'))(_0x9e2d('0x3'));var moment=require(_0x9e2d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e2d('0x5'));var config=require(_0x9e2d('0x6'));var attributes=require(_0x9e2d('0x7'));module[_0x9e2d('0x8')]=function(_0x28226d,_0xaa890c){return _0x28226d[_0x9e2d('0x9')](_0x9e2d('0xa'),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 c2cb8a5..4e5c7d8 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 _0x3c7b=['code','message','info','result','catch','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xac8a5,_0x27d769){var _0x2c726f=function(_0x3beaa2){while(--_0x3beaa2){_0xac8a5['push'](_0xac8a5['shift']());}};_0x2c726f(++_0x27d769);}(_0x3c7b,0x19a));var _0xb3c7=function(_0x1424c8,_0x3d5663){_0x1424c8=_0x1424c8-0x0;var _0x441911=_0x3c7b[_0x1424c8];return _0x441911;};'use strict';var _=require(_0xb3c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3c7('0x1'))['db'];var utils=require(_0xb3c7('0x2'));var logger=require(_0xb3c7('0x3'))(_0xb3c7('0x4'));var config=require(_0xb3c7('0x5'));var jayson=require(_0xb3c7('0x6'));var client=jayson[_0xb3c7('0x7')]['http']({'port':0x232a});config['redis']=_[_0xb3c7('0x8')](config[_0xb3c7('0x9')],{'host':_0xb3c7('0xa'),'port':0x18eb});var socket=require(_0xb3c7('0xb'))(new Redis(config['redis']));require(_0xb3c7('0xc'))[_0xb3c7('0xd')](socket);function respondWithRpcPromise(_0x1e26ff,_0x260c37,_0x101c6d){return new BPromise(function(_0x1b727e,_0x47910c){return client[_0xb3c7('0xe')](_0x1e26ff,_0x101c6d)[_0xb3c7('0xf')](function(_0x5b8d1d){logger['info'](_0xb3c7('0x10'),_0x260c37,_0xb3c7('0x11'));logger[_0xb3c7('0x12')](_0xb3c7('0x13'),_0x260c37,'request\x20sent',JSON[_0xb3c7('0x14')](_0x5b8d1d));if(_0x5b8d1d['error']){if(_0x5b8d1d[_0xb3c7('0x15')][_0xb3c7('0x16')]===0x1f4){logger[_0xb3c7('0x15')](_0xb3c7('0x10'),_0x260c37,_0x5b8d1d['error'][_0xb3c7('0x17')]);return _0x47910c(_0x5b8d1d['error'][_0xb3c7('0x17')]);}logger[_0xb3c7('0x15')](_0xb3c7('0x10'),_0x260c37,_0x5b8d1d[_0xb3c7('0x15')][_0xb3c7('0x17')]);return _0x1b727e(_0x5b8d1d[_0xb3c7('0x15')][_0xb3c7('0x17')]);}else{logger[_0xb3c7('0x18')](_0xb3c7('0x10'),_0x260c37,_0xb3c7('0x11'));_0x1b727e(_0x5b8d1d[_0xb3c7('0x19')][_0xb3c7('0x17')]);}})[_0xb3c7('0x1a')](function(_0x2f17df){logger[_0xb3c7('0x15')]('Team,\x20%s,\x20%s',_0x260c37,_0x2f17df);_0x47910c(_0x2f17df);});});} \ No newline at end of file +var _0x40a5=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc'];(function(_0x403ad5,_0x1072cf){var _0x7d8ed7=function(_0x44c148){while(--_0x44c148){_0x403ad5['push'](_0x403ad5['shift']());}};_0x7d8ed7(++_0x1072cf);}(_0x40a5,0xf5));var _0x540a=function(_0x4dc35f,_0x377c51){_0x4dc35f=_0x4dc35f-0x0;var _0x1f8820=_0x40a5[_0x4dc35f];return _0x1f8820;};'use strict';var _=require(_0x540a('0x0'));var util=require(_0x540a('0x1'));var moment=require(_0x540a('0x2'));var BPromise=require('bluebird');var rs=require(_0x540a('0x3'));var fs=require('fs');var Redis=require(_0x540a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x540a('0x5'));var logger=require('../../config/logger')(_0x540a('0x6'));var config=require(_0x540a('0x7'));var jayson=require(_0x540a('0x8'));var client=jayson[_0x540a('0x9')][_0x540a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x540a('0xb')],{'host':_0x540a('0xc'),'port':0x18eb});var socket=require(_0x540a('0xd'))(new Redis(config[_0x540a('0xb')]));require(_0x540a('0xe'))[_0x540a('0xf')](socket);function respondWithRpcPromise(_0xe85f80,_0x13fbda,_0x11e50c){return new BPromise(function(_0x5cdd5c,_0x330824){return client[_0x540a('0x10')](_0xe85f80,_0x11e50c)[_0x540a('0x11')](function(_0x558eaa){logger[_0x540a('0x12')](_0x540a('0x13'),_0x13fbda,_0x540a('0x14'));logger[_0x540a('0x15')](_0x540a('0x16'),_0x13fbda,_0x540a('0x14'),JSON[_0x540a('0x17')](_0x558eaa));if(_0x558eaa[_0x540a('0x18')]){if(_0x558eaa['error'][_0x540a('0x19')]===0x1f4){logger[_0x540a('0x18')](_0x540a('0x13'),_0x13fbda,_0x558eaa[_0x540a('0x18')][_0x540a('0x1a')]);return _0x330824(_0x558eaa[_0x540a('0x18')][_0x540a('0x1a')]);}logger[_0x540a('0x18')](_0x540a('0x13'),_0x13fbda,_0x558eaa[_0x540a('0x18')][_0x540a('0x1a')]);return _0x5cdd5c(_0x558eaa['error'][_0x540a('0x1a')]);}else{logger[_0x540a('0x12')](_0x540a('0x13'),_0x13fbda,_0x540a('0x14'));_0x5cdd5c(_0x558eaa['result'][_0x540a('0x1a')]);}})[_0x540a('0x1b')](function(_0x212c6a){logger[_0x540a('0x18')](_0x540a('0x13'),_0x13fbda,_0x212c6a);_0x330824(_0x212c6a);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f5bc63e..8b0d321 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 _0xaac4=['removeListener','register','length','./team.events','save','update','emit'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0xaac4,0x6c));var _0x4aac=function(_0x27af08,_0x192c31){_0x27af08=_0x27af08-0x0;var _0x49eb8e=_0xaac4[_0x27af08];return _0x49eb8e;};'use strict';var TeamEvents=require(_0x4aac('0x0'));var events=[_0x4aac('0x1'),'remove',_0x4aac('0x2')];function createListener(_0x3e93f9,_0x158ac2){return function(_0x5c92c5){_0x158ac2[_0x4aac('0x3')](_0x3e93f9,_0x5c92c5);};}function removeListener(_0x2e630e,_0x17a5e7){return function(){TeamEvents[_0x4aac('0x4')](_0x2e630e,_0x17a5e7);};}exports[_0x4aac('0x5')]=function(_0x4c94f2){for(var _0x2d795c=0x0,_0x688327=events[_0x4aac('0x6')];_0x2d795c<_0x688327;_0x2d795c++){var _0x4a901c=events[_0x2d795c];var _0x645ec6=createListener('team:'+_0x4a901c,_0x4c94f2);TeamEvents['on'](_0x4a901c,_0x645ec6);}}; \ No newline at end of file +var _0x292c=['./team.events','remove','update','register','length','team:'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x292c,0x66));var _0xc292=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x292c[_0x92c450];return _0x2a9599;};'use strict';var TeamEvents=require(_0xc292('0x0'));var events=['save',_0xc292('0x1'),_0xc292('0x2')];function createListener(_0x61f2da,_0x1931ea){return function(_0x124054){_0x1931ea['emit'](_0x61f2da,_0x124054);};}function removeListener(_0x1f14f9,_0x536154){return function(){TeamEvents['removeListener'](_0x1f14f9,_0x536154);};}exports[_0xc292('0x3')]=function(_0x1c45ed){for(var _0x2c01eb=0x0,_0x262ac8=events[_0xc292('0x4')];_0x2c01eb<_0x262ac8;_0x2c01eb++){var _0x3a733b=events[_0x2c01eb];var _0x14178b=createListener(_0xc292('0x5')+_0x3a733b,_0x1c45ed);TeamEvents['on'](_0x3a733b,_0x14178b);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index f27ae4f..f14f3d9 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 _0x3342=['../../config/environment','./template.controller','isAuthenticated','index','get','/:id','post','put','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x24b068,_0x194849){var _0x1f8b6a=function(_0x551a8c){while(--_0x551a8c){_0x24b068['push'](_0x24b068['shift']());}};_0x1f8b6a(++_0x194849);}(_0x3342,0x12a));var _0x2334=function(_0x4d1fc5,_0x21d2f5){_0x4d1fc5=_0x4d1fc5-0x0;var _0x397db6=_0x3342[_0x4d1fc5];return _0x397db6;};'use strict';var multer=require(_0x2334('0x0'));var util=require(_0x2334('0x1'));var path=require(_0x2334('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2334('0x3')]();var auth=require(_0x2334('0x4'));var interaction=require(_0x2334('0x5'));var config=require(_0x2334('0x6'));var controller=require(_0x2334('0x7'));router['get']('/',auth[_0x2334('0x8')](),controller[_0x2334('0x9')]);router[_0x2334('0xa')](_0x2334('0xb'),auth[_0x2334('0x8')](),controller['show']);router[_0x2334('0xc')]('/',auth[_0x2334('0x8')](),controller['create']);router[_0x2334('0xd')](_0x2334('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2334('0xe')](_0x2334('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2334('0xf')]=router; \ No newline at end of file +var _0x681c=['create','put','update','delete','multer','util','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x15bf64,_0x5eaebc){var _0x55dbbf=function(_0xcf58e9){while(--_0xcf58e9){_0x15bf64['push'](_0x15bf64['shift']());}};_0x55dbbf(++_0x5eaebc);}(_0x681c,0x130));var _0xc681=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x681c[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0xc681('0x0'));var util=require(_0xc681('0x1'));var path=require('path');var timeout=require(_0xc681('0x2'));var express=require(_0xc681('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc681('0x4'));var controller=require('./template.controller');router[_0xc681('0x5')]('/',auth[_0xc681('0x6')](),controller[_0xc681('0x7')]);router[_0xc681('0x5')](_0xc681('0x8'),auth[_0xc681('0x6')](),controller[_0xc681('0x9')]);router[_0xc681('0xa')]('/',auth['isAuthenticated'](),controller[_0xc681('0xb')]);router[_0xc681('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xc681('0xd')]);router[_0xc681('0xe')]('/:id',auth[_0xc681('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 1a79be3..e326be6 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 _0xbbdd=['STRING'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xbbdd,0xa2));var _0xdbbd=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xbbdd[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdbbd('0x0')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa557=['TEXT','exports','STRING'];(function(_0xb57eff,_0x82e10b){var _0x4661f8=function(_0x182ee7){while(--_0x182ee7){_0xb57eff['push'](_0xb57eff['shift']());}};_0x4661f8(++_0x82e10b);}(_0xa557,0x1ab));var _0x7a55=function(_0x4fb3aa,_0x2fd675){_0x4fb3aa=_0x4fb3aa-0x0;var _0x34dfac=_0xa557[_0x4fb3aa];return _0x34dfac;};'use strict';var Sequelize=require('sequelize');module[_0x7a55('0x0')]={'name':{'type':Sequelize[_0x7a55('0x1')]},'description':{'type':Sequelize[_0x7a55('0x1')]},'html':{'type':Sequelize[_0x7a55('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index d001589..bc81782 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 _0x7edc=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','set','Content-Range','json','save','update','destroy','get','Templates','end','error','stack','name','send','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','limit','offset','order','sort','pick','filter','where','merge','map','options','Template','then','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x19283e,_0x5d4bb5){var _0x1c6de6=function(_0x341527){while(--_0x341527){_0x19283e['push'](_0x19283e['shift']());}};_0x1c6de6(++_0x5d4bb5);}(_0x7edc,0xec));var _0xc7ed=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x7edc[_0x1857d0];return _0x3e3c46;};'use strict';var pdf=require(_0xc7ed('0x0'));var emlformat=require(_0xc7ed('0x1'));var rimraf=require(_0xc7ed('0x2'));var zipdir=require(_0xc7ed('0x3'));var jsonpatch=require(_0xc7ed('0x4'));var rp=require(_0xc7ed('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc7ed('0x6'));var csv=require('to-csv');var ejs=require(_0xc7ed('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc7ed('0x8'));var crypto=require(_0xc7ed('0x9'));var jsforce=require(_0xc7ed('0xa'));var deskjs=require(_0xc7ed('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc7ed('0xc'));var Papa=require(_0xc7ed('0xd'));var Redis=require(_0xc7ed('0xe'));var authService=require(_0xc7ed('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc7ed('0x10'));var hardwareService=require(_0xc7ed('0x11'));var logger=require(_0xc7ed('0x12'))('api');var utils=require(_0xc7ed('0x13'));var config=require(_0xc7ed('0x14'));var db=require(_0xc7ed('0x15'))['db'];function respondWithStatusCode(_0x3421e8,_0x1274ab){_0x1274ab=_0x1274ab||0xcc;return function(_0x3f4f30){if(_0x3f4f30){return _0x3421e8[_0xc7ed('0x16')](_0x1274ab);}return _0x3421e8[_0xc7ed('0x17')](_0x1274ab)['end']();};}function respondWithResult(_0x36944e,_0xf0fef0){_0xf0fef0=_0xf0fef0||0xc8;return function(_0x2fe96){if(_0x2fe96){return _0x36944e['status'](_0xf0fef0)['json'](_0x2fe96);}};}function respondWithFilteredResult(_0x815884,_0x56f210){return function(_0x1ec22d){if(_0x1ec22d){var _0x450ac5=_0x1ec22d[_0xc7ed('0x18')],_0xf96b57=_0x56f210['offset'],_0x537563=_0x56f210['offset']+_0x56f210['limit'],_0x38890c;if(_0x537563>=_0x450ac5){_0x537563=_0x450ac5;_0x38890c=0xc8;}else{_0x38890c=0xce;}_0x815884['status'](_0x38890c);return _0x815884[_0xc7ed('0x19')](_0xc7ed('0x1a'),_0xf96b57+'-'+_0x537563+'/'+_0x450ac5)[_0xc7ed('0x1b')](_0x1ec22d);}return null;};}function patchUpdates(_0x25f5e8){return function(_0x1bf069){try{jsonpatch['apply'](_0x1bf069,_0x25f5e8,!![]);}catch(_0x244711){return BPromise['reject'](_0x244711);}return _0x1bf069[_0xc7ed('0x1c')]();};}function saveUpdates(_0x44d339,_0x560500){return function(_0x2e998e){if(_0x2e998e){return _0x2e998e[_0xc7ed('0x1d')](_0x44d339)['then'](function(_0x3767d9){return _0x3767d9;});}return null;};}function removeEntity(_0x1d9973,_0x24ee51){return function(_0x2a036c){if(_0x2a036c){return _0x2a036c[_0xc7ed('0x1e')]()['then'](function(){var _0x36ae62=_0x2a036c[_0xc7ed('0x1f')]({'plain':!![]});var _0x557638=_0xc7ed('0x20');return db['UserProfileResource'][_0xc7ed('0x1e')]({'where':{'type':_0x557638,'resourceId':_0x36ae62['id']}})['then'](function(){return _0x2a036c;});})['then'](function(){_0x1d9973[_0xc7ed('0x17')](0xcc)[_0xc7ed('0x21')]();});}};}function handleEntityNotFound(_0x2eeb4e,_0x53f9f5){return function(_0x2a3d45){if(!_0x2a3d45){_0x2eeb4e['sendStatus'](0x194);}return _0x2a3d45;};}function handleError(_0x4f0c0a,_0x3204d5){_0x3204d5=_0x3204d5||0x1f4;return function(_0x2b57b9){logger[_0xc7ed('0x22')](_0x2b57b9[_0xc7ed('0x23')]);if(_0x2b57b9[_0xc7ed('0x24')]){delete _0x2b57b9[_0xc7ed('0x24')];}_0x4f0c0a[_0xc7ed('0x17')](_0x3204d5)[_0xc7ed('0x25')](_0x2b57b9);};}exports['index']=function(_0x39d152,_0x12c65a){var _0x13f28c={},_0x29ce85={},_0x415580={'count':0x0,'rows':[]};var _0x2c5fe9=_['map'](db['Template'][_0xc7ed('0x26')],function(_0x39d88c){return{'name':_0x39d88c[_0xc7ed('0x27')],'type':_0x39d88c[_0xc7ed('0x28')][_0xc7ed('0x29')]};});_0x29ce85['model']=_['map'](_0x2c5fe9,_0xc7ed('0x24'));_0x29ce85['query']=_[_0xc7ed('0x2a')](_0x39d152['query']);_0x29ce85[_0xc7ed('0x2b')]=_[_0xc7ed('0x2c')](_0x29ce85[_0xc7ed('0x2d')],_0x29ce85[_0xc7ed('0x2e')]);_0x13f28c[_0xc7ed('0x2f')]=_[_0xc7ed('0x2c')](_0x29ce85[_0xc7ed('0x2d')],qs[_0xc7ed('0x30')](_0x39d152[_0xc7ed('0x2e')][_0xc7ed('0x30')]));_0x13f28c['attributes']=_0x13f28c[_0xc7ed('0x2f')][_0xc7ed('0x31')]?_0x13f28c[_0xc7ed('0x2f')]:_0x29ce85[_0xc7ed('0x2d')];if(!_0x39d152[_0xc7ed('0x2e')]['hasOwnProperty'](_0xc7ed('0x32'))){_0x13f28c[_0xc7ed('0x33')]=qs[_0xc7ed('0x33')](_0x39d152[_0xc7ed('0x2e')][_0xc7ed('0x33')]);_0x13f28c[_0xc7ed('0x34')]=qs[_0xc7ed('0x34')](_0x39d152[_0xc7ed('0x2e')][_0xc7ed('0x34')]);}_0x13f28c[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x39d152[_0xc7ed('0x2e')][_0xc7ed('0x36')]);_0x13f28c['where']=qs['filters'](_[_0xc7ed('0x37')](_0x39d152[_0xc7ed('0x2e')],_0x29ce85['filters']));if(_0x39d152['query'][_0xc7ed('0x38')]){_0x13f28c[_0xc7ed('0x39')]=_[_0xc7ed('0x3a')](_0x13f28c[_0xc7ed('0x39')],{'$or':_[_0xc7ed('0x3b')](_0x2c5fe9,function(_0x1199d8){if(_0x1199d8[_0xc7ed('0x28')]!=='VIRTUAL'){var _0x27b169={};_0x27b169[_0x1199d8['name']]={'$like':'%'+_0x39d152[_0xc7ed('0x2e')][_0xc7ed('0x38')]+'%'};return _0x27b169;}})});}_0x13f28c=_['merge']({},_0x13f28c,_0x39d152[_0xc7ed('0x3c')]);var _0x57dc0b={'where':_0x13f28c[_0xc7ed('0x39')]};return db[_0xc7ed('0x3d')][_0xc7ed('0x18')](_0x57dc0b)[_0xc7ed('0x3e')](function(_0x586e5f){_0x415580[_0xc7ed('0x18')]=_0x586e5f;if(_0x39d152[_0xc7ed('0x2e')]['includeAll']){_0x13f28c[_0xc7ed('0x3f')]=[{'all':!![]}];}return db[_0xc7ed('0x3d')]['findAll'](_0x13f28c);})[_0xc7ed('0x3e')](function(_0x5b55c6){_0x415580[_0xc7ed('0x40')]=_0x5b55c6;return _0x415580;})[_0xc7ed('0x3e')](respondWithFilteredResult(_0x12c65a,_0x13f28c))[_0xc7ed('0x41')](handleError(_0x12c65a,null));};exports['show']=function(_0x39a144,_0x4cf80e){var _0xf149ba={'raw':!![],'where':{'id':_0x39a144[_0xc7ed('0x42')]['id']}},_0x82302e={};_0x82302e[_0xc7ed('0x2d')]=_['keys'](db[_0xc7ed('0x3d')]['rawAttributes']);_0x82302e[_0xc7ed('0x2e')]=_[_0xc7ed('0x2a')](_0x39a144[_0xc7ed('0x2e')]);_0x82302e[_0xc7ed('0x2b')]=_[_0xc7ed('0x2c')](_0x82302e[_0xc7ed('0x2d')],_0x82302e[_0xc7ed('0x2e')]);_0xf149ba[_0xc7ed('0x2f')]=_['intersection'](_0x82302e[_0xc7ed('0x2d')],qs[_0xc7ed('0x30')](_0x39a144['query'][_0xc7ed('0x30')]));_0xf149ba['attributes']=_0xf149ba[_0xc7ed('0x2f')][_0xc7ed('0x31')]?_0xf149ba[_0xc7ed('0x2f')]:_0x82302e[_0xc7ed('0x2d')];if(_0x39a144[_0xc7ed('0x2e')]['includeAll']){_0xf149ba[_0xc7ed('0x3f')]=[{'all':!![]}];}_0xf149ba=_['merge']({},_0xf149ba,_0x39a144[_0xc7ed('0x3c')]);return db[_0xc7ed('0x3d')][_0xc7ed('0x43')](_0xf149ba)['then'](handleEntityNotFound(_0x4cf80e,null))[_0xc7ed('0x3e')](respondWithResult(_0x4cf80e,null))[_0xc7ed('0x41')](handleError(_0x4cf80e,null));};exports['create']=function(_0x5cbdcc,_0x3b19b3){return db[_0xc7ed('0x3d')][_0xc7ed('0x44')](_0x5cbdcc[_0xc7ed('0x45')],{})[_0xc7ed('0x3e')](function(_0x535be1){var _0x4efbb0=_0x5cbdcc[_0xc7ed('0x46')][_0xc7ed('0x1f')]({'plain':!![]});if(!_0x4efbb0)throw new Error(_0xc7ed('0x47'));if(_0x4efbb0[_0xc7ed('0x48')]===_0xc7ed('0x46')){var _0xa0419c=_0x535be1['get']({'plain':!![]});var _0x39604b=_0xc7ed('0x20');return db[_0xc7ed('0x49')]['find']({'where':{'name':_0x39604b,'userProfileId':_0x4efbb0[_0xc7ed('0x4a')]},'raw':!![]})[_0xc7ed('0x3e')](function(_0x475665){if(_0x475665&&_0x475665[_0xc7ed('0x4b')]===0x0){return db['UserProfileResource'][_0xc7ed('0x44')]({'name':_0xa0419c[_0xc7ed('0x24')],'resourceId':_0xa0419c['id'],'type':_0x475665[_0xc7ed('0x24')],'sectionId':_0x475665['id']},{})[_0xc7ed('0x3e')](function(){return _0x535be1;});}else{return _0x535be1;}})[_0xc7ed('0x41')](function(_0x43004a){logger['error'](_0xc7ed('0x4c'),_0x43004a);throw _0x43004a;});}return _0x535be1;})[_0xc7ed('0x3e')](respondWithResult(_0x3b19b3,0xc9))[_0xc7ed('0x41')](handleError(_0x3b19b3,null));};exports[_0xc7ed('0x1d')]=function(_0x2f5f82,_0xfc1c89){if(_0x2f5f82[_0xc7ed('0x45')]['id']){delete _0x2f5f82[_0xc7ed('0x45')]['id'];}return db[_0xc7ed('0x3d')][_0xc7ed('0x43')]({'where':{'id':_0x2f5f82[_0xc7ed('0x42')]['id']}})['then'](handleEntityNotFound(_0xfc1c89,null))[_0xc7ed('0x3e')](saveUpdates(_0x2f5f82[_0xc7ed('0x45')],null))[_0xc7ed('0x3e')](respondWithResult(_0xfc1c89,null))[_0xc7ed('0x41')](handleError(_0xfc1c89,null));};exports['destroy']=function(_0x2fba8c,_0x1dc19e){return db['Template']['find']({'where':{'id':_0x2fba8c[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x3e')](handleEntityNotFound(_0x1dc19e,null))[_0xc7ed('0x3e')](removeEntity(_0x1dc19e,null))['catch'](handleError(_0x1dc19e,null));}; \ No newline at end of file +var _0x899c=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','Content-Range','json','apply','reject','save','then','destroy','get','Templates','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','Template','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf'];(function(_0x4c0342,_0x5d9cad){var _0x42d134=function(_0x42c293){while(--_0x42c293){_0x4c0342['push'](_0x4c0342['shift']());}};_0x42d134(++_0x5d9cad);}(_0x899c,0x1a8));var _0xc899=function(_0x4d5672,_0x4517e7){_0x4d5672=_0x4d5672-0x0;var _0x4a7aec=_0x899c[_0x4d5672];return _0x4a7aec;};'use strict';var pdf=require(_0xc899('0x0'));var emlformat=require(_0xc899('0x1'));var rimraf=require(_0xc899('0x2'));var zipdir=require(_0xc899('0x3'));var jsonpatch=require(_0xc899('0x4'));var rp=require(_0xc899('0x5'));var moment=require('moment');var BPromise=require(_0xc899('0x6'));var Mustache=require(_0xc899('0x7'));var util=require(_0xc899('0x8'));var path=require(_0xc899('0x9'));var sox=require(_0xc899('0xa'));var csv=require(_0xc899('0xb'));var ejs=require(_0xc899('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc899('0xd'));var crypto=require(_0xc899('0xe'));var jsforce=require(_0xc899('0xf'));var deskjs=require(_0xc899('0x10'));var toCsv=require(_0xc899('0xb'));var querystring=require(_0xc899('0x11'));var Papa=require(_0xc899('0x12'));var Redis=require(_0xc899('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc899('0x14'));var as=require(_0xc899('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc899('0x16'))('api');var utils=require(_0xc899('0x17'));var config=require('../../config/environment');var db=require(_0xc899('0x18'))['db'];function respondWithStatusCode(_0x5dac7e,_0x519ab1){_0x519ab1=_0x519ab1||0xcc;return function(_0x5addcb){if(_0x5addcb){return _0x5dac7e['sendStatus'](_0x519ab1);}return _0x5dac7e[_0xc899('0x19')](_0x519ab1)[_0xc899('0x1a')]();};}function respondWithResult(_0x1303b2,_0x11618b){_0x11618b=_0x11618b||0xc8;return function(_0xfcc9cf){if(_0xfcc9cf){return _0x1303b2[_0xc899('0x19')](_0x11618b)['json'](_0xfcc9cf);}};}function respondWithFilteredResult(_0x5498fe,_0x41fa86){return function(_0x275474){if(_0x275474){var _0x4af92c=_0x275474[_0xc899('0x1b')],_0x23d6f2=_0x41fa86[_0xc899('0x1c')],_0x20ebd5=_0x41fa86['offset']+_0x41fa86['limit'],_0x426ae3;if(_0x20ebd5>=_0x4af92c){_0x20ebd5=_0x4af92c;_0x426ae3=0xc8;}else{_0x426ae3=0xce;}_0x5498fe['status'](_0x426ae3);return _0x5498fe['set'](_0xc899('0x1d'),_0x23d6f2+'-'+_0x20ebd5+'/'+_0x4af92c)[_0xc899('0x1e')](_0x275474);}return null;};}function patchUpdates(_0x1811d0){return function(_0x381da5){try{jsonpatch[_0xc899('0x1f')](_0x381da5,_0x1811d0,!![]);}catch(_0x2d284f){return BPromise[_0xc899('0x20')](_0x2d284f);}return _0x381da5[_0xc899('0x21')]();};}function saveUpdates(_0x406894,_0xe1c485){return function(_0x319200){if(_0x319200){return _0x319200['update'](_0x406894)[_0xc899('0x22')](function(_0x31feda){return _0x31feda;});}return null;};}function removeEntity(_0x20268d,_0x915c98){return function(_0x5ce262){if(_0x5ce262){return _0x5ce262[_0xc899('0x23')]()['then'](function(){var _0xc3fabb=_0x5ce262[_0xc899('0x24')]({'plain':!![]});var _0x133c9e=_0xc899('0x25');return db[_0xc899('0x26')][_0xc899('0x23')]({'where':{'type':_0x133c9e,'resourceId':_0xc3fabb['id']}})[_0xc899('0x22')](function(){return _0x5ce262;});})[_0xc899('0x22')](function(){_0x20268d[_0xc899('0x19')](0xcc)[_0xc899('0x1a')]();});}};}function handleEntityNotFound(_0x10cfe6,_0x517023){return function(_0x304edf){if(!_0x304edf){_0x10cfe6[_0xc899('0x27')](0x194);}return _0x304edf;};}function handleError(_0x1ba2f5,_0xf3279d){_0xf3279d=_0xf3279d||0x1f4;return function(_0x507757){logger[_0xc899('0x28')](_0x507757[_0xc899('0x29')]);if(_0x507757[_0xc899('0x2a')]){delete _0x507757['name'];}_0x1ba2f5[_0xc899('0x19')](_0xf3279d)[_0xc899('0x2b')](_0x507757);};}exports[_0xc899('0x2c')]=function(_0x7ced4a,_0xdcaedd){var _0x2a146e={},_0x4085c8={},_0x1c73ea={'count':0x0,'rows':[]};var _0x1cd10e=_[_0xc899('0x2d')](db['Template'][_0xc899('0x2e')],function(_0x449bfc){return{'name':_0x449bfc[_0xc899('0x2f')],'type':_0x449bfc[_0xc899('0x30')][_0xc899('0x31')]};});_0x4085c8[_0xc899('0x32')]=_[_0xc899('0x2d')](_0x1cd10e,_0xc899('0x2a'));_0x4085c8['query']=_[_0xc899('0x33')](_0x7ced4a[_0xc899('0x34')]);_0x4085c8[_0xc899('0x35')]=_[_0xc899('0x36')](_0x4085c8[_0xc899('0x32')],_0x4085c8[_0xc899('0x34')]);_0x2a146e[_0xc899('0x37')]=_[_0xc899('0x36')](_0x4085c8[_0xc899('0x32')],qs[_0xc899('0x38')](_0x7ced4a['query'][_0xc899('0x38')]));_0x2a146e[_0xc899('0x37')]=_0x2a146e[_0xc899('0x37')][_0xc899('0x39')]?_0x2a146e['attributes']:_0x4085c8[_0xc899('0x32')];if(!_0x7ced4a[_0xc899('0x34')][_0xc899('0x3a')]('nolimit')){_0x2a146e[_0xc899('0x3b')]=qs['limit'](_0x7ced4a[_0xc899('0x34')][_0xc899('0x3b')]);_0x2a146e['offset']=qs[_0xc899('0x1c')](_0x7ced4a['query']['offset']);}_0x2a146e['order']=qs[_0xc899('0x3c')](_0x7ced4a[_0xc899('0x34')][_0xc899('0x3c')]);_0x2a146e[_0xc899('0x3d')]=qs[_0xc899('0x35')](_[_0xc899('0x3e')](_0x7ced4a[_0xc899('0x34')],_0x4085c8[_0xc899('0x35')]));if(_0x7ced4a[_0xc899('0x34')][_0xc899('0x3f')]){_0x2a146e[_0xc899('0x3d')]=_[_0xc899('0x40')](_0x2a146e[_0xc899('0x3d')],{'$or':_[_0xc899('0x2d')](_0x1cd10e,function(_0x58433a){if(_0x58433a[_0xc899('0x30')]!=='VIRTUAL'){var _0x2b07dd={};_0x2b07dd[_0x58433a[_0xc899('0x2a')]]={'$like':'%'+_0x7ced4a[_0xc899('0x34')][_0xc899('0x3f')]+'%'};return _0x2b07dd;}})});}_0x2a146e=_[_0xc899('0x40')]({},_0x2a146e,_0x7ced4a[_0xc899('0x41')]);var _0x496d09={'where':_0x2a146e[_0xc899('0x3d')]};return db[_0xc899('0x42')][_0xc899('0x1b')](_0x496d09)[_0xc899('0x22')](function(_0x3097d0){_0x1c73ea[_0xc899('0x1b')]=_0x3097d0;if(_0x7ced4a[_0xc899('0x34')][_0xc899('0x43')]){_0x2a146e[_0xc899('0x44')]=[{'all':!![]}];}return db[_0xc899('0x42')][_0xc899('0x45')](_0x2a146e);})[_0xc899('0x22')](function(_0x573220){_0x1c73ea[_0xc899('0x46')]=_0x573220;return _0x1c73ea;})[_0xc899('0x22')](respondWithFilteredResult(_0xdcaedd,_0x2a146e))[_0xc899('0x47')](handleError(_0xdcaedd,null));};exports[_0xc899('0x48')]=function(_0x32f78e,_0x131cf4){var _0x3ed032={'raw':!![],'where':{'id':_0x32f78e['params']['id']}},_0x4aa825={};_0x4aa825[_0xc899('0x32')]=_['keys'](db[_0xc899('0x42')]['rawAttributes']);_0x4aa825[_0xc899('0x34')]=_['keys'](_0x32f78e[_0xc899('0x34')]);_0x4aa825[_0xc899('0x35')]=_[_0xc899('0x36')](_0x4aa825[_0xc899('0x32')],_0x4aa825['query']);_0x3ed032[_0xc899('0x37')]=_[_0xc899('0x36')](_0x4aa825[_0xc899('0x32')],qs[_0xc899('0x38')](_0x32f78e[_0xc899('0x34')][_0xc899('0x38')]));_0x3ed032[_0xc899('0x37')]=_0x3ed032['attributes'][_0xc899('0x39')]?_0x3ed032[_0xc899('0x37')]:_0x4aa825['model'];if(_0x32f78e['query'][_0xc899('0x43')]){_0x3ed032['include']=[{'all':!![]}];}_0x3ed032=_[_0xc899('0x40')]({},_0x3ed032,_0x32f78e[_0xc899('0x41')]);return db[_0xc899('0x42')][_0xc899('0x49')](_0x3ed032)[_0xc899('0x22')](handleEntityNotFound(_0x131cf4,null))[_0xc899('0x22')](respondWithResult(_0x131cf4,null))['catch'](handleError(_0x131cf4,null));};exports['create']=function(_0x3e936a,_0x36473c){return db[_0xc899('0x42')][_0xc899('0x4a')](_0x3e936a[_0xc899('0x4b')],{})[_0xc899('0x22')](function(_0x515888){var _0x406c16=_0x3e936a[_0xc899('0x4c')][_0xc899('0x24')]({'plain':!![]});if(!_0x406c16)throw new Error(_0xc899('0x4d'));if(_0x406c16[_0xc899('0x4e')]===_0xc899('0x4c')){var _0x2a17fa=_0x515888[_0xc899('0x24')]({'plain':!![]});var _0x567109=_0xc899('0x25');return db[_0xc899('0x4f')][_0xc899('0x49')]({'where':{'name':_0x567109,'userProfileId':_0x406c16[_0xc899('0x50')]},'raw':!![]})[_0xc899('0x22')](function(_0x4c8a4e){if(_0x4c8a4e&&_0x4c8a4e[_0xc899('0x51')]===0x0){return db[_0xc899('0x26')]['create']({'name':_0x2a17fa['name'],'resourceId':_0x2a17fa['id'],'type':_0x4c8a4e[_0xc899('0x2a')],'sectionId':_0x4c8a4e['id']},{})[_0xc899('0x22')](function(){return _0x515888;});}else{return _0x515888;}})[_0xc899('0x47')](function(_0x7cc833){logger[_0xc899('0x28')](_0xc899('0x52'),_0x7cc833);throw _0x7cc833;});}return _0x515888;})[_0xc899('0x22')](respondWithResult(_0x36473c,0xc9))[_0xc899('0x47')](handleError(_0x36473c,null));};exports[_0xc899('0x53')]=function(_0x4a4281,_0x5dee3f){if(_0x4a4281[_0xc899('0x4b')]['id']){delete _0x4a4281['body']['id'];}return db['Template'][_0xc899('0x49')]({'where':{'id':_0x4a4281[_0xc899('0x54')]['id']}})['then'](handleEntityNotFound(_0x5dee3f,null))[_0xc899('0x22')](saveUpdates(_0x4a4281[_0xc899('0x4b')],null))[_0xc899('0x22')](respondWithResult(_0x5dee3f,null))[_0xc899('0x47')](handleError(_0x5dee3f,null));};exports[_0xc899('0x23')]=function(_0x5230c4,_0x47ede9){return db[_0xc899('0x42')][_0xc899('0x49')]({'where':{'id':_0x5230c4[_0xc899('0x54')]['id']}})[_0xc899('0x22')](handleEntityNotFound(_0x47ede9,null))[_0xc899('0x22')](removeEntity(_0x47ede9,null))['catch'](handleError(_0x47ede9,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 95ac789..813ab23 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 _0x554d=['request-promise','path','rimraf','../../config/environment','define','Template','tools_templates','lodash','util','api','moment'];(function(_0xdeac64,_0x5522fa){var _0x283d82=function(_0x5db9cd){while(--_0x5db9cd){_0xdeac64['push'](_0xdeac64['shift']());}};_0x283d82(++_0x5522fa);}(_0x554d,0x1d5));var _0xd554=function(_0x34f908,_0x439c8e){_0x34f908=_0x34f908-0x0;var _0x2a2388=_0x554d[_0x34f908];return _0x2a2388;};'use strict';var _=require(_0xd554('0x0'));var util=require(_0xd554('0x1'));var logger=require('../../config/logger')(_0xd554('0x2'));var moment=require(_0xd554('0x3'));var BPromise=require('bluebird');var rp=require(_0xd554('0x4'));var fs=require('fs');var path=require(_0xd554('0x5'));var rimraf=require(_0xd554('0x6'));var config=require(_0xd554('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x22f377,_0x11bc1a){return _0x22f377[_0xd554('0x8')](_0xd554('0x9'),attributes,{'tableName':_0xd554('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce42=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57a092,_0x2bcfba){var _0x2b2569=function(_0x250449){while(--_0x250449){_0x57a092['push'](_0x57a092['shift']());}};_0x2b2569(++_0x2bcfba);}(_0xce42,0x1cb));var _0x2ce4=function(_0x434db2,_0x113541){_0x434db2=_0x434db2-0x0;var _0x4e9284=_0xce42[_0x434db2];return _0x4e9284;};'use strict';var _=require(_0x2ce4('0x0'));var util=require(_0x2ce4('0x1'));var logger=require(_0x2ce4('0x2'))(_0x2ce4('0x3'));var moment=require(_0x2ce4('0x4'));var BPromise=require(_0x2ce4('0x5'));var rp=require(_0x2ce4('0x6'));var fs=require('fs');var path=require(_0x2ce4('0x7'));var rimraf=require(_0x2ce4('0x8'));var config=require(_0x2ce4('0x9'));var attributes=require(_0x2ce4('0xa'));module[_0x2ce4('0xb')]=function(_0x11ae21,_0x142b94){return _0x11ae21[_0x2ce4('0xc')](_0x2ce4('0xd'),attributes,{'tableName':_0x2ce4('0xe'),'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 7e67099..6190fd6 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 _0x05b6=['../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','map','include','model','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x05b6,0x181));var _0x605b=function(_0x585b83,_0x25d403){_0x585b83=_0x585b83-0x0;var _0x2faa24=_0x05b6[_0x585b83];return _0x2faa24;};'use strict';var _=require(_0x605b('0x0'));var util=require('util');var moment=require(_0x605b('0x1'));var BPromise=require('bluebird');var rs=require(_0x605b('0x2'));var fs=require('fs');var Redis=require(_0x605b('0x3'));var db=require(_0x605b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x605b('0x5'));var jayson=require(_0x605b('0x6'));var client=jayson[_0x605b('0x7')][_0x605b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44b8ef,_0x2a5b63,_0x3e54b1){return new BPromise(function(_0x4d091e,_0x27f568){return client[_0x605b('0x9')](_0x44b8ef,_0x3e54b1)[_0x605b('0xa')](function(_0x97f928){logger['info'](_0x605b('0xb'),_0x2a5b63,'request\x20sent');logger[_0x605b('0xc')](_0x605b('0xd'),_0x2a5b63,'request\x20sent',JSON[_0x605b('0xe')](_0x97f928));if(_0x97f928[_0x605b('0xf')]){if(_0x97f928[_0x605b('0xf')]['code']===0x1f4){logger[_0x605b('0xf')](_0x605b('0xb'),_0x2a5b63,_0x97f928[_0x605b('0xf')]['message']);return _0x27f568(_0x97f928[_0x605b('0xf')][_0x605b('0x10')]);}logger[_0x605b('0xf')](_0x605b('0xb'),_0x2a5b63,_0x97f928['error'][_0x605b('0x10')]);return _0x4d091e(_0x97f928[_0x605b('0xf')][_0x605b('0x10')]);}else{logger[_0x605b('0x11')](_0x605b('0xb'),_0x2a5b63,'request\x20sent');_0x4d091e(_0x97f928[_0x605b('0x12')]['message']);}})[_0x605b('0x13')](function(_0x474df8){logger[_0x605b('0xf')](_0x605b('0xb'),_0x2a5b63,_0x474df8);_0x27f568(_0x474df8);});});}exports[_0x605b('0x14')]=function(_0x32641b){var _0x1a7b93=this;return new Promise(function(_0x1af6aa,_0x224809){return db[_0x605b('0x15')]['findAll']({'raw':_0x32641b[_0x605b('0x16')]?_0x32641b[_0x605b('0x16')][_0x605b('0x17')]===undefined?!![]:![]:!![],'where':_0x32641b[_0x605b('0x16')]?_0x32641b[_0x605b('0x16')][_0x605b('0x18')]||null:null,'attributes':_0x32641b['options']?_0x32641b['options'][_0x605b('0x19')]||null:null,'limit':_0x32641b[_0x605b('0x16')]?_0x32641b['options'][_0x605b('0x1a')]||null:null,'include':_0x32641b['options']?_0x32641b[_0x605b('0x16')]['include']?_[_0x605b('0x1b')](_0x32641b[_0x605b('0x16')][_0x605b('0x1c')],function(_0x5b3776){return{'model':db[_0x5b3776[_0x605b('0x1d')]],'as':_0x5b3776['as'],'attributes':_0x5b3776[_0x605b('0x19')],'include':_0x5b3776['include']?_['map'](_0x5b3776['include'],function(_0x33972f){return{'model':db[_0x33972f[_0x605b('0x1d')]],'as':_0x33972f['as'],'attributes':_0x33972f[_0x605b('0x19')],'include':_0x33972f['include']?_[_0x605b('0x1b')](_0x33972f[_0x605b('0x1c')],function(_0x5b0915){return{'model':db[_0x5b0915[_0x605b('0x1d')]],'as':_0x5b0915['as'],'attributes':_0x5b0915['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43ec2f){logger[_0x605b('0x11')]('GetTemplate',_0x32641b);logger[_0x605b('0xc')](_0x605b('0x14'),_0x32641b,JSON['stringify'](_0x43ec2f));_0x1af6aa(_0x43ec2f);})[_0x605b('0x13')](function(_0x59df74){logger[_0x605b('0xf')](_0x605b('0x14'),_0x59df74['message'],_0x32641b);_0x224809(_0x1a7b93[_0x605b('0xf')](0x1f4,_0x59df74[_0x605b('0x10')]));});});}; \ No newline at end of file +var _0xfec9=['request\x20sent','stringify','error','message','result','GetTemplate','Template','findAll','raw','options','where','include','map','model','attributes','then','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','Template,\x20%s,\x20%s','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfec9,0x101));var _0x9fec=function(_0x27bf80,_0x138f80){_0x27bf80=_0x27bf80-0x0;var _0xf2a523=_0xfec9[_0x27bf80];return _0xf2a523;};'use strict';var _=require(_0x9fec('0x0'));var util=require(_0x9fec('0x1'));var moment=require(_0x9fec('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fec('0x3'));var db=require(_0x9fec('0x4'))['db'];var utils=require(_0x9fec('0x5'));var logger=require(_0x9fec('0x6'))(_0x9fec('0x7'));var config=require(_0x9fec('0x8'));var jayson=require(_0x9fec('0x9'));var client=jayson[_0x9fec('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce541,_0xbcf1c4,_0x6ec82f){return new BPromise(function(_0x4032cb,_0x1a4e31){return client['request'](_0x5ce541,_0x6ec82f)['then'](function(_0x489d52){logger['info'](_0x9fec('0xb'),_0xbcf1c4,'request\x20sent');logger[_0x9fec('0xc')]('Template,\x20%s,\x20%s,\x20%s',_0xbcf1c4,_0x9fec('0xd'),JSON[_0x9fec('0xe')](_0x489d52));if(_0x489d52[_0x9fec('0xf')]){if(_0x489d52[_0x9fec('0xf')]['code']===0x1f4){logger[_0x9fec('0xf')](_0x9fec('0xb'),_0xbcf1c4,_0x489d52[_0x9fec('0xf')][_0x9fec('0x10')]);return _0x1a4e31(_0x489d52[_0x9fec('0xf')][_0x9fec('0x10')]);}logger['error'](_0x9fec('0xb'),_0xbcf1c4,_0x489d52[_0x9fec('0xf')]['message']);return _0x4032cb(_0x489d52[_0x9fec('0xf')]['message']);}else{logger['info']('Template,\x20%s,\x20%s',_0xbcf1c4,_0x9fec('0xd'));_0x4032cb(_0x489d52[_0x9fec('0x11')][_0x9fec('0x10')]);}})['catch'](function(_0x347288){logger[_0x9fec('0xf')](_0x9fec('0xb'),_0xbcf1c4,_0x347288);_0x1a4e31(_0x347288);});});}exports[_0x9fec('0x12')]=function(_0x3b1af0){var _0x4f1ff9=this;return new Promise(function(_0xc65b9f,_0x5e4c3a){return db[_0x9fec('0x13')][_0x9fec('0x14')]({'raw':_0x3b1af0['options']?_0x3b1af0['options'][_0x9fec('0x15')]===undefined?!![]:![]:!![],'where':_0x3b1af0[_0x9fec('0x16')]?_0x3b1af0[_0x9fec('0x16')][_0x9fec('0x17')]||null:null,'attributes':_0x3b1af0[_0x9fec('0x16')]?_0x3b1af0[_0x9fec('0x16')]['attributes']||null:null,'limit':_0x3b1af0[_0x9fec('0x16')]?_0x3b1af0['options']['limit']||null:null,'include':_0x3b1af0[_0x9fec('0x16')]?_0x3b1af0[_0x9fec('0x16')][_0x9fec('0x18')]?_[_0x9fec('0x19')](_0x3b1af0[_0x9fec('0x16')][_0x9fec('0x18')],function(_0x1c7082){return{'model':db[_0x1c7082[_0x9fec('0x1a')]],'as':_0x1c7082['as'],'attributes':_0x1c7082[_0x9fec('0x1b')],'include':_0x1c7082['include']?_[_0x9fec('0x19')](_0x1c7082['include'],function(_0x1790ad){return{'model':db[_0x1790ad['model']],'as':_0x1790ad['as'],'attributes':_0x1790ad[_0x9fec('0x1b')],'include':_0x1790ad['include']?_[_0x9fec('0x19')](_0x1790ad[_0x9fec('0x18')],function(_0xe6189){return{'model':db[_0xe6189[_0x9fec('0x1a')]],'as':_0xe6189['as'],'attributes':_0xe6189['attributes']};}):[]};}):[]};}):[]:[]})[_0x9fec('0x1c')](function(_0x2f8263){logger[_0x9fec('0x1d')](_0x9fec('0x12'),_0x3b1af0);logger['debug'](_0x9fec('0x12'),_0x3b1af0,JSON[_0x9fec('0xe')](_0x2f8263));_0xc65b9f(_0x2f8263);})['catch'](function(_0x335a53){logger[_0x9fec('0xf')]('GetTemplate',_0x335a53[_0x9fec('0x10')],_0x3b1af0);_0x5e4c3a(_0x4f1ff9[_0x9fec('0xf')](0x1f4,_0x335a53[_0x9fec('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 87053f0..64dd176 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 _0x994c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x994c,0x128));var _0xc994=function(_0x385a4f,_0x34e849){_0x385a4f=_0x385a4f-0x0;var _0x316c37=_0x994c[_0x385a4f];return _0x316c37;};'use strict';var multer=require('multer');var util=require(_0xc994('0x0'));var path=require('path');var timeout=require(_0xc994('0x1'));var express=require(_0xc994('0x2'));var router=express[_0xc994('0x3')]();var auth=require(_0xc994('0x4'));var interaction=require(_0xc994('0x5'));var config=require(_0xc994('0x6'));var controller=require(_0xc994('0x7'));router[_0xc994('0x8')]('/',auth['isAuthenticated'](),controller[_0xc994('0x9')]);router[_0xc994('0x8')]('/:id',auth[_0xc994('0xa')](),controller[_0xc994('0xb')]);router['get'](_0xc994('0xc'),auth[_0xc994('0xa')](),controller[_0xc994('0xd')]);router['get'](_0xc994('0xe'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0xc994('0x8')](_0xc994('0xf'),auth[_0xc994('0xa')](),controller[_0xc994('0x10')]);router[_0xc994('0x11')]('/',auth[_0xc994('0xa')](),controller['create']);router[_0xc994('0x11')](_0xc994('0xc'),auth['isAuthenticated'](),controller[_0xc994('0x12')]);router[_0xc994('0x11')](_0xc994('0xe'),auth[_0xc994('0xa')](),controller[_0xc994('0x13')]);router['post']('/:id/actions',auth[_0xc994('0xa')](),controller[_0xc994('0x14')]);router[_0xc994('0x15')](_0xc994('0x16'),auth[_0xc994('0xa')](),controller[_0xc994('0x17')]);router[_0xc994('0x18')]('/:id',auth[_0xc994('0xa')](),controller[_0xc994('0x19')]);module[_0xc994('0x1a')]=router; \ No newline at end of file +var _0x78d6=['get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x78d6,0x1ec));var _0x678d=function(_0x45271e,_0xf29077){_0x45271e=_0x45271e-0x0;var _0xe15e0e=_0x78d6[_0x45271e];return _0xe15e0e;};'use strict';var multer=require('multer');var util=require(_0x678d('0x0'));var path=require(_0x678d('0x1'));var timeout=require(_0x678d('0x2'));var express=require(_0x678d('0x3'));var router=express[_0x678d('0x4')]();var auth=require(_0x678d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x678d('0x6'));var controller=require(_0x678d('0x7'));router[_0x678d('0x8')]('/',auth[_0x678d('0x9')](),controller[_0x678d('0xa')]);router[_0x678d('0x8')](_0x678d('0xb'),auth[_0x678d('0x9')](),controller[_0x678d('0xc')]);router['get'](_0x678d('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x678d('0x8')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x678d('0xe')]);router[_0x678d('0x8')](_0x678d('0xf'),auth[_0x678d('0x9')](),controller[_0x678d('0x10')]);router[_0x678d('0x11')]('/',auth['isAuthenticated'](),controller[_0x678d('0x12')]);router['post'](_0x678d('0xd'),auth['isAuthenticated'](),controller[_0x678d('0x13')]);router[_0x678d('0x11')](_0x678d('0x14'),auth[_0x678d('0x9')](),controller['addAnyCondition']);router[_0x678d('0x11')]('/:id/actions',auth[_0x678d('0x9')](),controller['addAction']);router[_0x678d('0x15')](_0x678d('0xb'),auth[_0x678d('0x9')](),controller[_0x678d('0x16')]);router[_0x678d('0x17')](_0x678d('0xb'),auth[_0x678d('0x9')](),controller[_0x678d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index bb37625..240916b 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 _0xa20b=['BOOLEAN','exports','STRING'];(function(_0x4a6bbb,_0x2fc7c3){var _0x318a6c=function(_0x49d0b9){while(--_0x49d0b9){_0x4a6bbb['push'](_0x4a6bbb['shift']());}};_0x318a6c(++_0x2fc7c3);}(_0xa20b,0x9d));var _0xba20=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa20b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xba20('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba20('0x1')]},'status':{'type':Sequelize[_0xba20('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xa5a2=['exports','STRING','sequelize'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa5a2,0xad));var _0x2a5a=function(_0xd3efb2,_0x421628){_0xd3efb2=_0xd3efb2-0x0;var _0x465ecb=_0xa5a2[_0xd3efb2];return _0x465ecb;};'use strict';var Sequelize=require(_0x2a5a('0x0'));module[_0x2a5a('0x1')]={'name':{'type':Sequelize[_0x2a5a('0x2')]},'channel':{'type':Sequelize[_0x2a5a('0x2')]},'description':{'type':Sequelize[_0x2a5a('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e255ed6..37b07a2 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 _0xa201=['catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','length','getAnyConditions','rawAttributes','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa201,0x1eb));var _0x1a20=function(_0x2c92c5,_0x1691f9){_0x2c92c5=_0x2c92c5-0x0;var _0x1be71b=_0xa201[_0x2c92c5];return _0x1be71b;};'use strict';var pdf=require(_0x1a20('0x0'));var emlformat=require(_0x1a20('0x1'));var rimraf=require(_0x1a20('0x2'));var zipdir=require(_0x1a20('0x3'));var jsonpatch=require(_0x1a20('0x4'));var rp=require('request-promise');var moment=require(_0x1a20('0x5'));var BPromise=require(_0x1a20('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a20('0x7'));var sox=require(_0x1a20('0x8'));var csv=require(_0x1a20('0x9'));var ejs=require(_0x1a20('0xa'));var fs=require('fs');var _=require(_0x1a20('0xb'));var squel=require(_0x1a20('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a20('0xd'));var deskjs=require(_0x1a20('0xe'));var toCsv=require(_0x1a20('0x9'));var querystring=require('querystring');var Papa=require(_0x1a20('0xf'));var Redis=require(_0x1a20('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a20('0x11'));var hardwareService=require(_0x1a20('0x12'));var logger=require('../../config/logger')(_0x1a20('0x13'));var utils=require(_0x1a20('0x14'));var config=require(_0x1a20('0x15'));var db=require(_0x1a20('0x16'))['db'];function respondWithStatusCode(_0x338c72,_0x5a3131){_0x5a3131=_0x5a3131||0xcc;return function(_0x169f78){if(_0x169f78){return _0x338c72[_0x1a20('0x17')](_0x5a3131);}return _0x338c72['status'](_0x5a3131)['end']();};}function respondWithResult(_0x31071c,_0x406a82){_0x406a82=_0x406a82||0xc8;return function(_0x20fff6){if(_0x20fff6){return _0x31071c[_0x1a20('0x18')](_0x406a82)['json'](_0x20fff6);}};}function respondWithFilteredResult(_0x3240d4,_0x2e8241){return function(_0x18b4ef){if(_0x18b4ef){var _0xcd73d2=_0x18b4ef[_0x1a20('0x19')],_0x1ae80f=_0x2e8241[_0x1a20('0x1a')],_0x39f038=_0x2e8241[_0x1a20('0x1a')]+_0x2e8241[_0x1a20('0x1b')],_0x5ee65a;if(_0x39f038>=_0xcd73d2){_0x39f038=_0xcd73d2;_0x5ee65a=0xc8;}else{_0x5ee65a=0xce;}_0x3240d4['status'](_0x5ee65a);return _0x3240d4[_0x1a20('0x1c')](_0x1a20('0x1d'),_0x1ae80f+'-'+_0x39f038+'/'+_0xcd73d2)[_0x1a20('0x1e')](_0x18b4ef);}return null;};}function patchUpdates(_0x59236){return function(_0xd4f9ec){try{jsonpatch[_0x1a20('0x1f')](_0xd4f9ec,_0x59236,!![]);}catch(_0x169804){return BPromise[_0x1a20('0x20')](_0x169804);}return _0xd4f9ec['save']();};}function saveUpdates(_0x124463,_0x46ec9e){return function(_0x2604d7){if(_0x2604d7){return _0x2604d7['update'](_0x124463)[_0x1a20('0x21')](function(_0x282dfd){return _0x282dfd;});}return null;};}function removeEntity(_0x230bb4,_0x1005f5){return function(_0x367da5){if(_0x367da5){return _0x367da5[_0x1a20('0x22')]()[_0x1a20('0x21')](function(){var _0x2ac5ab=_0x367da5[_0x1a20('0x23')]({'plain':!![]});var _0x1e5c3f=_0x1a20('0x24');return db[_0x1a20('0x25')][_0x1a20('0x22')]({'where':{'type':_0x1e5c3f,'resourceId':_0x2ac5ab['id']}})[_0x1a20('0x21')](function(){return _0x367da5;});})['then'](function(){_0x230bb4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1417e2,_0x55b650){return function(_0x144a68){if(!_0x144a68){_0x1417e2[_0x1a20('0x17')](0x194);}return _0x144a68;};}function handleError(_0x3f2b53,_0x897e71){_0x897e71=_0x897e71||0x1f4;return function(_0x262890){logger[_0x1a20('0x26')](_0x262890[_0x1a20('0x27')]);if(_0x262890[_0x1a20('0x28')]){delete _0x262890[_0x1a20('0x28')];}_0x3f2b53['status'](_0x897e71)[_0x1a20('0x29')](_0x262890);};}exports[_0x1a20('0x2a')]=function(_0x346df2,_0x400eaf){var _0x426977={},_0x4daaec={},_0x240a7d={'count':0x0,'rows':[]};var _0x2c1f17=_[_0x1a20('0x2b')](db[_0x1a20('0x2c')]['rawAttributes'],function(_0x57a999){return{'name':_0x57a999[_0x1a20('0x2d')],'type':_0x57a999[_0x1a20('0x2e')][_0x1a20('0x2f')]};});_0x4daaec['model']=_['map'](_0x2c1f17,_0x1a20('0x28'));_0x4daaec[_0x1a20('0x30')]=_[_0x1a20('0x31')](_0x346df2['query']);_0x4daaec[_0x1a20('0x32')]=_[_0x1a20('0x33')](_0x4daaec['model'],_0x4daaec[_0x1a20('0x30')]);_0x426977[_0x1a20('0x34')]=_[_0x1a20('0x33')](_0x4daaec['model'],qs[_0x1a20('0x35')](_0x346df2[_0x1a20('0x30')]['fields']));_0x426977[_0x1a20('0x34')]=_0x426977[_0x1a20('0x34')]['length']?_0x426977[_0x1a20('0x34')]:_0x4daaec[_0x1a20('0x36')];if(!_0x346df2[_0x1a20('0x30')][_0x1a20('0x37')](_0x1a20('0x38'))){_0x426977[_0x1a20('0x1b')]=qs[_0x1a20('0x1b')](_0x346df2[_0x1a20('0x30')][_0x1a20('0x1b')]);_0x426977['offset']=qs[_0x1a20('0x1a')](_0x346df2['query'][_0x1a20('0x1a')]);}_0x426977[_0x1a20('0x39')]=qs['sort'](_0x346df2[_0x1a20('0x30')][_0x1a20('0x3a')]);_0x426977[_0x1a20('0x3b')]=qs[_0x1a20('0x32')](_[_0x1a20('0x3c')](_0x346df2[_0x1a20('0x30')],_0x4daaec[_0x1a20('0x32')]));if(_0x346df2[_0x1a20('0x30')]['filter']){_0x426977[_0x1a20('0x3b')]=_[_0x1a20('0x3d')](_0x426977[_0x1a20('0x3b')],{'$or':_[_0x1a20('0x2b')](_0x2c1f17,function(_0x5e2a3d){if(_0x5e2a3d[_0x1a20('0x2e')]!==_0x1a20('0x3e')){var _0x4895c9={};_0x4895c9[_0x5e2a3d[_0x1a20('0x28')]]={'$like':'%'+_0x346df2[_0x1a20('0x30')][_0x1a20('0x3f')]+'%'};return _0x4895c9;}})});}_0x426977=_[_0x1a20('0x3d')]({},_0x426977,_0x346df2[_0x1a20('0x40')]);var _0x38a995={'where':_0x426977[_0x1a20('0x3b')]};return db[_0x1a20('0x2c')][_0x1a20('0x19')](_0x38a995)[_0x1a20('0x21')](function(_0x3952ad){_0x240a7d['count']=_0x3952ad;if(_0x346df2[_0x1a20('0x30')]['includeAll']){_0x426977[_0x1a20('0x41')]=[{'all':!![]}];}return db['Trigger'][_0x1a20('0x42')](_0x426977);})[_0x1a20('0x21')](function(_0x5e2ffe){_0x240a7d['rows']=_0x5e2ffe;return _0x240a7d;})[_0x1a20('0x21')](respondWithFilteredResult(_0x400eaf,_0x426977))[_0x1a20('0x43')](handleError(_0x400eaf,null));};exports['show']=function(_0x14a5ba,_0x370026){var _0x2fcfe4={'raw':![],'where':{'id':_0x14a5ba[_0x1a20('0x44')]['id']}},_0x530ac6={};_0x530ac6[_0x1a20('0x36')]=_['keys'](db[_0x1a20('0x2c')]['rawAttributes']);_0x530ac6[_0x1a20('0x30')]=_['keys'](_0x14a5ba[_0x1a20('0x30')]);_0x530ac6[_0x1a20('0x32')]=_[_0x1a20('0x33')](_0x530ac6[_0x1a20('0x36')],_0x530ac6['query']);_0x2fcfe4[_0x1a20('0x34')]=_[_0x1a20('0x33')](_0x530ac6[_0x1a20('0x36')],qs[_0x1a20('0x35')](_0x14a5ba[_0x1a20('0x30')]['fields']));_0x2fcfe4['attributes']=_0x2fcfe4[_0x1a20('0x34')]['length']?_0x2fcfe4[_0x1a20('0x34')]:_0x530ac6[_0x1a20('0x36')];if(_0x14a5ba['query'][_0x1a20('0x45')]){_0x2fcfe4['include']=[{'all':!![]}];}_0x2fcfe4=_['merge']({},_0x2fcfe4,_0x14a5ba[_0x1a20('0x40')]);return db[_0x1a20('0x2c')][_0x1a20('0x46')](_0x2fcfe4)[_0x1a20('0x21')](handleEntityNotFound(_0x370026,null))[_0x1a20('0x21')](respondWithResult(_0x370026,null))[_0x1a20('0x43')](handleError(_0x370026,null));};exports['create']=function(_0x1a5e7e,_0x3d169d){return db['Trigger'][_0x1a20('0x47')](_0x1a5e7e[_0x1a20('0x48')],{})[_0x1a20('0x21')](function(_0x3846f9){var _0xd953cc=_0x1a5e7e[_0x1a20('0x49')][_0x1a20('0x23')]({'plain':!![]});if(!_0xd953cc)throw new Error(_0x1a20('0x4a'));if(_0xd953cc['role']===_0x1a20('0x49')){var _0x2a18d9=_0x3846f9['get']({'plain':!![]});var _0x4583b2='Triggers';return db[_0x1a20('0x4b')][_0x1a20('0x46')]({'where':{'name':_0x4583b2,'userProfileId':_0xd953cc[_0x1a20('0x4c')]},'raw':!![]})[_0x1a20('0x21')](function(_0xb470ed){if(_0xb470ed&&_0xb470ed['autoAssociation']===0x0){return db[_0x1a20('0x25')][_0x1a20('0x47')]({'name':_0x2a18d9[_0x1a20('0x28')],'resourceId':_0x2a18d9['id'],'type':_0xb470ed['name'],'sectionId':_0xb470ed['id']},{})[_0x1a20('0x21')](function(){return _0x3846f9;});}else{return _0x3846f9;}})[_0x1a20('0x43')](function(_0x55c844){logger['error'](_0x1a20('0x4d'),_0x55c844);throw _0x55c844;});}return _0x3846f9;})['then'](respondWithResult(_0x3d169d,0xc9))['catch'](handleError(_0x3d169d,null));};exports[_0x1a20('0x4e')]=function(_0x5ce824,_0x7ae473){if(_0x5ce824[_0x1a20('0x48')]['id']){delete _0x5ce824[_0x1a20('0x48')]['id'];}return db[_0x1a20('0x2c')][_0x1a20('0x46')]({'where':{'id':_0x5ce824['params']['id']}})['then'](handleEntityNotFound(_0x7ae473,null))['then'](saveUpdates(_0x5ce824[_0x1a20('0x48')],null))[_0x1a20('0x21')](respondWithResult(_0x7ae473,null))[_0x1a20('0x43')](handleError(_0x7ae473,null));};exports[_0x1a20('0x22')]=function(_0x18c8fc,_0x3f41a3){return db['Trigger'][_0x1a20('0x46')]({'where':{'id':_0x18c8fc[_0x1a20('0x44')]['id']}})[_0x1a20('0x21')](handleEntityNotFound(_0x3f41a3,null))['then'](removeEntity(_0x3f41a3,null))[_0x1a20('0x43')](handleError(_0x3f41a3,null));};exports[_0x1a20('0x4f')]=function(_0x170fea,_0x4f8365,_0x1f11dc){if(_0x170fea[_0x1a20('0x48')]['id']){delete _0x170fea[_0x1a20('0x48')]['id'];}return db[_0x1a20('0x2c')]['find']({'where':{'id':_0x170fea['params']['id']}})[_0x1a20('0x21')](handleEntityNotFound(_0x4f8365,null))[_0x1a20('0x21')](function(_0x5b2b54){if(_0x5b2b54){_0x170fea[_0x1a20('0x48')][_0x1a20('0x50')]=_0x5b2b54['id'];return db['Condition'][_0x1a20('0x47')](_0x170fea[_0x1a20('0x48')]);}})[_0x1a20('0x21')](respondWithResult(_0x4f8365,null))[_0x1a20('0x43')](handleError(_0x4f8365,null));};exports[_0x1a20('0x51')]=function(_0x392ddd,_0x23bbf8,_0xae3e7c){if(_0x392ddd[_0x1a20('0x48')]['id']){delete _0x392ddd[_0x1a20('0x48')]['id'];}return db['Trigger'][_0x1a20('0x46')]({'where':{'id':_0x392ddd[_0x1a20('0x44')]['id']}})['then'](handleEntityNotFound(_0x23bbf8,null))[_0x1a20('0x21')](function(_0x27ea4f){if(_0x27ea4f){_0x392ddd[_0x1a20('0x48')][_0x1a20('0x52')]=_0x27ea4f['id'];return db[_0x1a20('0x53')][_0x1a20('0x47')](_0x392ddd[_0x1a20('0x48')]);}})[_0x1a20('0x21')](respondWithResult(_0x23bbf8,null))[_0x1a20('0x43')](handleError(_0x23bbf8,null));};exports[_0x1a20('0x54')]=function(_0x9a503e,_0x20c7a2,_0x23ef9f){var _0x2987df={};var _0xb75874={};var _0x56438c;var _0x59055c;return db['Trigger'][_0x1a20('0x55')]({'where':{'id':_0x9a503e[_0x1a20('0x44')]['id']}})[_0x1a20('0x21')](handleEntityNotFound(_0x20c7a2,null))[_0x1a20('0x21')](function(_0x5dd071){if(_0x5dd071){_0x56438c=_0x5dd071;_0xb75874['model']=_[_0x1a20('0x31')](db['Condition']['rawAttributes']);_0xb75874[_0x1a20('0x30')]=_['keys'](_0x9a503e[_0x1a20('0x30')]);_0xb75874[_0x1a20('0x32')]=_['intersection'](_0xb75874[_0x1a20('0x36')],_0xb75874['query']);_0x2987df[_0x1a20('0x34')]=_[_0x1a20('0x33')](_0xb75874[_0x1a20('0x36')],qs[_0x1a20('0x35')](_0x9a503e[_0x1a20('0x30')][_0x1a20('0x35')]));_0x2987df[_0x1a20('0x34')]=_0x2987df[_0x1a20('0x34')]['length']?_0x2987df[_0x1a20('0x34')]:_0xb75874[_0x1a20('0x36')];_0x2987df[_0x1a20('0x39')]=qs[_0x1a20('0x3a')](_0x9a503e[_0x1a20('0x30')][_0x1a20('0x3a')]);_0x2987df[_0x1a20('0x3b')]=qs[_0x1a20('0x32')](_[_0x1a20('0x3c')](_0x9a503e[_0x1a20('0x30')],_0xb75874[_0x1a20('0x32')]));if(_0x9a503e[_0x1a20('0x30')][_0x1a20('0x3f')]){_0x2987df[_0x1a20('0x3b')]=_['merge'](_0x2987df[_0x1a20('0x3b')],{'$or':_[_0x1a20('0x2b')](_0x2987df[_0x1a20('0x34')],function(_0x2b3c61){var _0x6bde21={};_0x6bde21[_0x2b3c61]={'$like':'%'+_0x9a503e['query'][_0x1a20('0x3f')]+'%'};return _0x6bde21;})});}_0x2987df=_[_0x1a20('0x3d')]({},_0x2987df,_0x9a503e[_0x1a20('0x40')]);return _0x56438c[_0x1a20('0x54')](_0x2987df);}})[_0x1a20('0x21')](function(_0x38b521){if(_0x38b521){_0x59055c=_0x38b521[_0x1a20('0x56')];if(!_0x9a503e['query'][_0x1a20('0x37')](_0x1a20('0x38'))){_0x2987df[_0x1a20('0x1b')]=qs['limit'](_0x9a503e[_0x1a20('0x30')][_0x1a20('0x1b')]);_0x2987df['offset']=qs[_0x1a20('0x1a')](_0x9a503e['query'][_0x1a20('0x1a')]);}return _0x56438c[_0x1a20('0x54')](_0x2987df);}})[_0x1a20('0x21')](function(_0x58376a){if(_0x58376a){return _0x58376a?{'count':_0x59055c,'rows':_0x58376a}:null;}})[_0x1a20('0x21')](respondWithResult(_0x20c7a2,null))[_0x1a20('0x43')](handleError(_0x20c7a2,null));};exports[_0x1a20('0x57')]=function(_0x49681d,_0x5e7b89,_0x292d67){var _0x2788d5={};var _0x67d126={};var _0x1d5f5c;var _0x372670;return db[_0x1a20('0x2c')][_0x1a20('0x55')]({'where':{'id':_0x49681d[_0x1a20('0x44')]['id']}})[_0x1a20('0x21')](handleEntityNotFound(_0x5e7b89,null))['then'](function(_0x5355cc){if(_0x5355cc){_0x1d5f5c=_0x5355cc;_0x67d126[_0x1a20('0x36')]=_[_0x1a20('0x31')](db[_0x1a20('0x53')][_0x1a20('0x58')]);_0x67d126[_0x1a20('0x30')]=_['keys'](_0x49681d['query']);_0x67d126[_0x1a20('0x32')]=_['intersection'](_0x67d126[_0x1a20('0x36')],_0x67d126[_0x1a20('0x30')]);_0x2788d5[_0x1a20('0x34')]=_['intersection'](_0x67d126[_0x1a20('0x36')],qs[_0x1a20('0x35')](_0x49681d[_0x1a20('0x30')][_0x1a20('0x35')]));_0x2788d5['attributes']=_0x2788d5[_0x1a20('0x34')][_0x1a20('0x56')]?_0x2788d5['attributes']:_0x67d126[_0x1a20('0x36')];_0x2788d5[_0x1a20('0x39')]=qs[_0x1a20('0x3a')](_0x49681d[_0x1a20('0x30')][_0x1a20('0x3a')]);_0x2788d5[_0x1a20('0x3b')]=qs[_0x1a20('0x32')](_[_0x1a20('0x3c')](_0x49681d['query'],_0x67d126['filters']));if(_0x49681d[_0x1a20('0x30')][_0x1a20('0x3f')]){_0x2788d5['where']=_[_0x1a20('0x3d')](_0x2788d5['where'],{'$or':_[_0x1a20('0x2b')](_0x2788d5[_0x1a20('0x34')],function(_0x3e42f0){var _0x13242b={};_0x13242b[_0x3e42f0]={'$like':'%'+_0x49681d[_0x1a20('0x30')][_0x1a20('0x3f')]+'%'};return _0x13242b;})});}_0x2788d5=_[_0x1a20('0x3d')]({},_0x2788d5,_0x49681d['options']);return _0x1d5f5c['getAnyConditions'](_0x2788d5);}})[_0x1a20('0x21')](function(_0x4c80d3){if(_0x4c80d3){_0x372670=_0x4c80d3[_0x1a20('0x56')];if(!_0x49681d['query']['hasOwnProperty'](_0x1a20('0x38'))){_0x2788d5[_0x1a20('0x1b')]=qs[_0x1a20('0x1b')](_0x49681d[_0x1a20('0x30')][_0x1a20('0x1b')]);_0x2788d5['offset']=qs[_0x1a20('0x1a')](_0x49681d['query'][_0x1a20('0x1a')]);}return _0x1d5f5c[_0x1a20('0x57')](_0x2788d5);}})['then'](function(_0x2641e1){if(_0x2641e1){return _0x2641e1?{'count':_0x372670,'rows':_0x2641e1}:null;}})['then'](respondWithResult(_0x5e7b89,null))['catch'](handleError(_0x5e7b89,null));};exports[_0x1a20('0x59')]=function(_0x4e64ab,_0x48845f,_0x5b9bf1){if(_0x4e64ab[_0x1a20('0x48')]['id']){delete _0x4e64ab[_0x1a20('0x48')]['id'];}return db[_0x1a20('0x2c')]['find']({'where':{'id':_0x4e64ab[_0x1a20('0x44')]['id']}})[_0x1a20('0x21')](handleEntityNotFound(_0x48845f,null))[_0x1a20('0x21')](function(_0x57d158){if(_0x57d158){_0x4e64ab[_0x1a20('0x48')][_0x1a20('0x5a')]=_0x57d158['id'];return db[_0x1a20('0x5b')][_0x1a20('0x47')](_0x4e64ab['body']);}})[_0x1a20('0x21')](respondWithResult(_0x48845f,null))[_0x1a20('0x43')](handleError(_0x48845f,null));};exports[_0x1a20('0x5c')]=function(_0x5e9997,_0x2bf4d2,_0x522be1){var _0xa2b92c={};var _0x2ac64e={};var _0x2f13b3;var _0x5133d1;return db[_0x1a20('0x2c')][_0x1a20('0x55')]({'where':{'id':_0x5e9997[_0x1a20('0x44')]['id']}})[_0x1a20('0x21')](handleEntityNotFound(_0x2bf4d2,null))[_0x1a20('0x21')](function(_0x2bc021){if(_0x2bc021){_0x2f13b3=_0x2bc021;_0x2ac64e['model']=_[_0x1a20('0x31')](db[_0x1a20('0x5b')]['rawAttributes']);_0x2ac64e['query']=_['keys'](_0x5e9997['query']);_0x2ac64e[_0x1a20('0x32')]=_[_0x1a20('0x33')](_0x2ac64e[_0x1a20('0x36')],_0x2ac64e[_0x1a20('0x30')]);_0xa2b92c[_0x1a20('0x34')]=_[_0x1a20('0x33')](_0x2ac64e['model'],qs[_0x1a20('0x35')](_0x5e9997['query']['fields']));_0xa2b92c['attributes']=_0xa2b92c['attributes'][_0x1a20('0x56')]?_0xa2b92c['attributes']:_0x2ac64e[_0x1a20('0x36')];_0xa2b92c[_0x1a20('0x39')]=qs[_0x1a20('0x3a')](_0x5e9997[_0x1a20('0x30')][_0x1a20('0x3a')]);_0xa2b92c['where']=qs['filters'](_[_0x1a20('0x3c')](_0x5e9997['query'],_0x2ac64e[_0x1a20('0x32')]));if(_0x5e9997[_0x1a20('0x30')][_0x1a20('0x3f')]){_0xa2b92c[_0x1a20('0x3b')]=_[_0x1a20('0x3d')](_0xa2b92c['where'],{'$or':_[_0x1a20('0x2b')](_0xa2b92c[_0x1a20('0x34')],function(_0x46309b){var _0x14cfc8={};_0x14cfc8[_0x46309b]={'$like':'%'+_0x5e9997['query'][_0x1a20('0x3f')]+'%'};return _0x14cfc8;})});}_0xa2b92c=_['merge']({},_0xa2b92c,_0x5e9997[_0x1a20('0x40')]);return _0x2f13b3[_0x1a20('0x5c')](_0xa2b92c);}})[_0x1a20('0x21')](function(_0x41cce4){if(_0x41cce4){_0x5133d1=_0x41cce4['length'];if(!_0x5e9997[_0x1a20('0x30')][_0x1a20('0x37')]('nolimit')){_0xa2b92c[_0x1a20('0x1b')]=qs['limit'](_0x5e9997['query'][_0x1a20('0x1b')]);_0xa2b92c[_0x1a20('0x1a')]=qs[_0x1a20('0x1a')](_0x5e9997[_0x1a20('0x30')][_0x1a20('0x1a')]);}return _0x2f13b3[_0x1a20('0x5c')](_0xa2b92c);}})[_0x1a20('0x21')](function(_0xe0839c){if(_0xe0839c){return _0xe0839c?{'count':_0x5133d1,'rows':_0xe0839c}:null;}})['then'](respondWithResult(_0x2bf4d2,null))[_0x1a20('0x43')](handleError(_0x2bf4d2,null));}; \ No newline at end of file +var _0x2e5d=['then','destroy','get','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','error','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','update'];(function(_0xc4fee,_0x3d033d){var _0x167aad=function(_0x18f1d7){while(--_0x18f1d7){_0xc4fee['push'](_0xc4fee['shift']());}};_0x167aad(++_0x3d033d);}(_0x2e5d,0x1c1));var _0xd2e5=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x2e5d[_0x178668];return _0x26107d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd2e5('0x0'));var rimraf=require(_0xd2e5('0x1'));var zipdir=require(_0xd2e5('0x2'));var jsonpatch=require(_0xd2e5('0x3'));var rp=require(_0xd2e5('0x4'));var moment=require(_0xd2e5('0x5'));var BPromise=require(_0xd2e5('0x6'));var Mustache=require(_0xd2e5('0x7'));var util=require(_0xd2e5('0x8'));var path=require(_0xd2e5('0x9'));var sox=require(_0xd2e5('0xa'));var csv=require(_0xd2e5('0xb'));var ejs=require(_0xd2e5('0xc'));var fs=require('fs');var _=require(_0xd2e5('0xd'));var squel=require(_0xd2e5('0xe'));var crypto=require(_0xd2e5('0xf'));var jsforce=require(_0xd2e5('0x10'));var deskjs=require(_0xd2e5('0x11'));var toCsv=require(_0xd2e5('0xb'));var querystring=require(_0xd2e5('0x12'));var Papa=require('papaparse');var Redis=require(_0xd2e5('0x13'));var authService=require(_0xd2e5('0x14'));var qs=require(_0xd2e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2e5('0x16'));var logger=require(_0xd2e5('0x17'))(_0xd2e5('0x18'));var utils=require('../../config/utils');var config=require(_0xd2e5('0x19'));var db=require(_0xd2e5('0x1a'))['db'];function respondWithStatusCode(_0x1d2d89,_0x481bed){_0x481bed=_0x481bed||0xcc;return function(_0x497646){if(_0x497646){return _0x1d2d89[_0xd2e5('0x1b')](_0x481bed);}return _0x1d2d89[_0xd2e5('0x1c')](_0x481bed)['end']();};}function respondWithResult(_0x53c297,_0x2532af){_0x2532af=_0x2532af||0xc8;return function(_0x3c800a){if(_0x3c800a){return _0x53c297['status'](_0x2532af)['json'](_0x3c800a);}};}function respondWithFilteredResult(_0x5a71a7,_0x23e90b){return function(_0x398ed6){if(_0x398ed6){var _0x16b4fe=_0x398ed6[_0xd2e5('0x1d')],_0x50e09b=_0x23e90b[_0xd2e5('0x1e')],_0x59445c=_0x23e90b['offset']+_0x23e90b[_0xd2e5('0x1f')],_0x3021b4;if(_0x59445c>=_0x16b4fe){_0x59445c=_0x16b4fe;_0x3021b4=0xc8;}else{_0x3021b4=0xce;}_0x5a71a7[_0xd2e5('0x1c')](_0x3021b4);return _0x5a71a7[_0xd2e5('0x20')](_0xd2e5('0x21'),_0x50e09b+'-'+_0x59445c+'/'+_0x16b4fe)[_0xd2e5('0x22')](_0x398ed6);}return null;};}function patchUpdates(_0x59d10a){return function(_0x42152d){try{jsonpatch['apply'](_0x42152d,_0x59d10a,!![]);}catch(_0x339653){return BPromise['reject'](_0x339653);}return _0x42152d['save']();};}function saveUpdates(_0x3eb02b,_0x3619f7){return function(_0x227b3f){if(_0x227b3f){return _0x227b3f[_0xd2e5('0x23')](_0x3eb02b)[_0xd2e5('0x24')](function(_0x59da9d){return _0x59da9d;});}return null;};}function removeEntity(_0x4792ad,_0x4ff9e3){return function(_0x2ff885){if(_0x2ff885){return _0x2ff885[_0xd2e5('0x25')]()[_0xd2e5('0x24')](function(){var _0x2d8cf0=_0x2ff885[_0xd2e5('0x26')]({'plain':!![]});var _0x682763='Triggers';return db[_0xd2e5('0x27')][_0xd2e5('0x25')]({'where':{'type':_0x682763,'resourceId':_0x2d8cf0['id']}})['then'](function(){return _0x2ff885;});})[_0xd2e5('0x24')](function(){_0x4792ad['status'](0xcc)[_0xd2e5('0x28')]();});}};}function handleEntityNotFound(_0x1dee42,_0x3cb9b8){return function(_0x1ad756){if(!_0x1ad756){_0x1dee42['sendStatus'](0x194);}return _0x1ad756;};}function handleError(_0x19d237,_0x339179){_0x339179=_0x339179||0x1f4;return function(_0x344159){logger['error'](_0x344159[_0xd2e5('0x29')]);if(_0x344159[_0xd2e5('0x2a')]){delete _0x344159['name'];}_0x19d237[_0xd2e5('0x1c')](_0x339179)[_0xd2e5('0x2b')](_0x344159);};}exports[_0xd2e5('0x2c')]=function(_0x193860,_0x103a2e){var _0x6136d8={},_0x4cf166={},_0x44a71b={'count':0x0,'rows':[]};var _0x551664=_[_0xd2e5('0x2d')](db[_0xd2e5('0x2e')][_0xd2e5('0x2f')],function(_0x232fe8){return{'name':_0x232fe8[_0xd2e5('0x30')],'type':_0x232fe8[_0xd2e5('0x31')]['key']};});_0x4cf166[_0xd2e5('0x32')]=_[_0xd2e5('0x2d')](_0x551664,'name');_0x4cf166[_0xd2e5('0x33')]=_[_0xd2e5('0x34')](_0x193860[_0xd2e5('0x33')]);_0x4cf166['filters']=_['intersection'](_0x4cf166['model'],_0x4cf166['query']);_0x6136d8[_0xd2e5('0x35')]=_[_0xd2e5('0x36')](_0x4cf166['model'],qs[_0xd2e5('0x37')](_0x193860[_0xd2e5('0x33')][_0xd2e5('0x37')]));_0x6136d8[_0xd2e5('0x35')]=_0x6136d8['attributes'][_0xd2e5('0x38')]?_0x6136d8[_0xd2e5('0x35')]:_0x4cf166[_0xd2e5('0x32')];if(!_0x193860['query'][_0xd2e5('0x39')](_0xd2e5('0x3a'))){_0x6136d8[_0xd2e5('0x1f')]=qs[_0xd2e5('0x1f')](_0x193860[_0xd2e5('0x33')][_0xd2e5('0x1f')]);_0x6136d8['offset']=qs[_0xd2e5('0x1e')](_0x193860[_0xd2e5('0x33')][_0xd2e5('0x1e')]);}_0x6136d8['order']=qs['sort'](_0x193860[_0xd2e5('0x33')][_0xd2e5('0x3b')]);_0x6136d8[_0xd2e5('0x3c')]=qs['filters'](_[_0xd2e5('0x3d')](_0x193860[_0xd2e5('0x33')],_0x4cf166[_0xd2e5('0x3e')]));if(_0x193860['query'][_0xd2e5('0x3f')]){_0x6136d8[_0xd2e5('0x3c')]=_[_0xd2e5('0x40')](_0x6136d8[_0xd2e5('0x3c')],{'$or':_[_0xd2e5('0x2d')](_0x551664,function(_0x27f7c9){if(_0x27f7c9[_0xd2e5('0x31')]!=='VIRTUAL'){var _0x2c1fb3={};_0x2c1fb3[_0x27f7c9[_0xd2e5('0x2a')]]={'$like':'%'+_0x193860[_0xd2e5('0x33')][_0xd2e5('0x3f')]+'%'};return _0x2c1fb3;}})});}_0x6136d8=_['merge']({},_0x6136d8,_0x193860[_0xd2e5('0x41')]);var _0x317bbf={'where':_0x6136d8[_0xd2e5('0x3c')]};return db[_0xd2e5('0x2e')]['count'](_0x317bbf)[_0xd2e5('0x24')](function(_0x1d2896){_0x44a71b[_0xd2e5('0x1d')]=_0x1d2896;if(_0x193860[_0xd2e5('0x33')][_0xd2e5('0x42')]){_0x6136d8['include']=[{'all':!![]}];}return db[_0xd2e5('0x2e')][_0xd2e5('0x43')](_0x6136d8);})[_0xd2e5('0x24')](function(_0x1f56b0){_0x44a71b[_0xd2e5('0x44')]=_0x1f56b0;return _0x44a71b;})['then'](respondWithFilteredResult(_0x103a2e,_0x6136d8))[_0xd2e5('0x45')](handleError(_0x103a2e,null));};exports[_0xd2e5('0x46')]=function(_0x434929,_0x1c1337){var _0x1b18d7={'raw':![],'where':{'id':_0x434929[_0xd2e5('0x47')]['id']}},_0x76adf3={};_0x76adf3[_0xd2e5('0x32')]=_[_0xd2e5('0x34')](db[_0xd2e5('0x2e')][_0xd2e5('0x2f')]);_0x76adf3[_0xd2e5('0x33')]=_[_0xd2e5('0x34')](_0x434929[_0xd2e5('0x33')]);_0x76adf3[_0xd2e5('0x3e')]=_['intersection'](_0x76adf3['model'],_0x76adf3[_0xd2e5('0x33')]);_0x1b18d7[_0xd2e5('0x35')]=_[_0xd2e5('0x36')](_0x76adf3['model'],qs[_0xd2e5('0x37')](_0x434929[_0xd2e5('0x33')]['fields']));_0x1b18d7['attributes']=_0x1b18d7['attributes']['length']?_0x1b18d7[_0xd2e5('0x35')]:_0x76adf3[_0xd2e5('0x32')];if(_0x434929[_0xd2e5('0x33')]['includeAll']){_0x1b18d7[_0xd2e5('0x48')]=[{'all':!![]}];}_0x1b18d7=_['merge']({},_0x1b18d7,_0x434929[_0xd2e5('0x41')]);return db[_0xd2e5('0x2e')][_0xd2e5('0x49')](_0x1b18d7)[_0xd2e5('0x24')](handleEntityNotFound(_0x1c1337,null))['then'](respondWithResult(_0x1c1337,null))[_0xd2e5('0x45')](handleError(_0x1c1337,null));};exports[_0xd2e5('0x4a')]=function(_0x2c0113,_0x3ab00d){return db[_0xd2e5('0x2e')]['create'](_0x2c0113['body'],{})[_0xd2e5('0x24')](function(_0x4137dd){var _0x4b7ee2=_0x2c0113[_0xd2e5('0x4b')][_0xd2e5('0x26')]({'plain':!![]});if(!_0x4b7ee2)throw new Error(_0xd2e5('0x4c'));if(_0x4b7ee2[_0xd2e5('0x4d')]===_0xd2e5('0x4b')){var _0x131954=_0x4137dd[_0xd2e5('0x26')]({'plain':!![]});var _0x1b5316=_0xd2e5('0x4e');return db[_0xd2e5('0x4f')][_0xd2e5('0x49')]({'where':{'name':_0x1b5316,'userProfileId':_0x4b7ee2[_0xd2e5('0x50')]},'raw':!![]})['then'](function(_0x38dc04){if(_0x38dc04&&_0x38dc04[_0xd2e5('0x51')]===0x0){return db[_0xd2e5('0x27')][_0xd2e5('0x4a')]({'name':_0x131954['name'],'resourceId':_0x131954['id'],'type':_0x38dc04[_0xd2e5('0x2a')],'sectionId':_0x38dc04['id']},{})['then'](function(){return _0x4137dd;});}else{return _0x4137dd;}})[_0xd2e5('0x45')](function(_0x1b7e26){logger[_0xd2e5('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7e26);throw _0x1b7e26;});}return _0x4137dd;})['then'](respondWithResult(_0x3ab00d,0xc9))[_0xd2e5('0x45')](handleError(_0x3ab00d,null));};exports[_0xd2e5('0x23')]=function(_0xe38efe,_0x454256){if(_0xe38efe[_0xd2e5('0x53')]['id']){delete _0xe38efe[_0xd2e5('0x53')]['id'];}return db[_0xd2e5('0x2e')]['find']({'where':{'id':_0xe38efe[_0xd2e5('0x47')]['id']}})[_0xd2e5('0x24')](handleEntityNotFound(_0x454256,null))[_0xd2e5('0x24')](saveUpdates(_0xe38efe[_0xd2e5('0x53')],null))[_0xd2e5('0x24')](respondWithResult(_0x454256,null))[_0xd2e5('0x45')](handleError(_0x454256,null));};exports[_0xd2e5('0x25')]=function(_0x36b714,_0x9da26f){return db[_0xd2e5('0x2e')][_0xd2e5('0x49')]({'where':{'id':_0x36b714['params']['id']}})[_0xd2e5('0x24')](handleEntityNotFound(_0x9da26f,null))[_0xd2e5('0x24')](removeEntity(_0x9da26f,null))[_0xd2e5('0x45')](handleError(_0x9da26f,null));};exports[_0xd2e5('0x54')]=function(_0x2a5ba2,_0x12c72f,_0x42db13){if(_0x2a5ba2[_0xd2e5('0x53')]['id']){delete _0x2a5ba2[_0xd2e5('0x53')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2a5ba2[_0xd2e5('0x47')]['id']}})[_0xd2e5('0x24')](handleEntityNotFound(_0x12c72f,null))['then'](function(_0x45fa31){if(_0x45fa31){_0x2a5ba2['body'][_0xd2e5('0x55')]=_0x45fa31['id'];return db[_0xd2e5('0x56')][_0xd2e5('0x4a')](_0x2a5ba2['body']);}})['then'](respondWithResult(_0x12c72f,null))[_0xd2e5('0x45')](handleError(_0x12c72f,null));};exports[_0xd2e5('0x57')]=function(_0x8e9ee,_0x1fc5c7,_0x460867){if(_0x8e9ee[_0xd2e5('0x53')]['id']){delete _0x8e9ee[_0xd2e5('0x53')]['id'];}return db['Trigger'][_0xd2e5('0x49')]({'where':{'id':_0x8e9ee['params']['id']}})[_0xd2e5('0x24')](handleEntityNotFound(_0x1fc5c7,null))[_0xd2e5('0x24')](function(_0x2ed035){if(_0x2ed035){_0x8e9ee['body'][_0xd2e5('0x58')]=_0x2ed035['id'];return db['Condition'][_0xd2e5('0x4a')](_0x8e9ee[_0xd2e5('0x53')]);}})[_0xd2e5('0x24')](respondWithResult(_0x1fc5c7,null))['catch'](handleError(_0x1fc5c7,null));};exports['getAllConditions']=function(_0x2b617d,_0x41e970,_0x196e1f){var _0x15afad={};var _0x5b61f0={};var _0xb1751d;var _0x43bb38;return db['Trigger'][_0xd2e5('0x59')]({'where':{'id':_0x2b617d[_0xd2e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x41e970,null))['then'](function(_0x579ead){if(_0x579ead){_0xb1751d=_0x579ead;_0x5b61f0['model']=_[_0xd2e5('0x34')](db[_0xd2e5('0x56')][_0xd2e5('0x2f')]);_0x5b61f0[_0xd2e5('0x33')]=_[_0xd2e5('0x34')](_0x2b617d[_0xd2e5('0x33')]);_0x5b61f0['filters']=_[_0xd2e5('0x36')](_0x5b61f0[_0xd2e5('0x32')],_0x5b61f0['query']);_0x15afad[_0xd2e5('0x35')]=_[_0xd2e5('0x36')](_0x5b61f0[_0xd2e5('0x32')],qs[_0xd2e5('0x37')](_0x2b617d[_0xd2e5('0x33')][_0xd2e5('0x37')]));_0x15afad['attributes']=_0x15afad['attributes']['length']?_0x15afad[_0xd2e5('0x35')]:_0x5b61f0[_0xd2e5('0x32')];_0x15afad[_0xd2e5('0x5a')]=qs['sort'](_0x2b617d[_0xd2e5('0x33')][_0xd2e5('0x3b')]);_0x15afad[_0xd2e5('0x3c')]=qs[_0xd2e5('0x3e')](_['pick'](_0x2b617d[_0xd2e5('0x33')],_0x5b61f0[_0xd2e5('0x3e')]));if(_0x2b617d['query']['filter']){_0x15afad['where']=_['merge'](_0x15afad[_0xd2e5('0x3c')],{'$or':_[_0xd2e5('0x2d')](_0x15afad[_0xd2e5('0x35')],function(_0x1d1953){var _0x3e015c={};_0x3e015c[_0x1d1953]={'$like':'%'+_0x2b617d[_0xd2e5('0x33')]['filter']+'%'};return _0x3e015c;})});}_0x15afad=_[_0xd2e5('0x40')]({},_0x15afad,_0x2b617d[_0xd2e5('0x41')]);return _0xb1751d[_0xd2e5('0x5b')](_0x15afad);}})['then'](function(_0xd15a7a){if(_0xd15a7a){_0x43bb38=_0xd15a7a[_0xd2e5('0x38')];if(!_0x2b617d[_0xd2e5('0x33')][_0xd2e5('0x39')](_0xd2e5('0x3a'))){_0x15afad['limit']=qs[_0xd2e5('0x1f')](_0x2b617d[_0xd2e5('0x33')][_0xd2e5('0x1f')]);_0x15afad['offset']=qs[_0xd2e5('0x1e')](_0x2b617d['query'][_0xd2e5('0x1e')]);}return _0xb1751d[_0xd2e5('0x5b')](_0x15afad);}})[_0xd2e5('0x24')](function(_0x5dd20e){if(_0x5dd20e){return _0x5dd20e?{'count':_0x43bb38,'rows':_0x5dd20e}:null;}})[_0xd2e5('0x24')](respondWithResult(_0x41e970,null))[_0xd2e5('0x45')](handleError(_0x41e970,null));};exports[_0xd2e5('0x5c')]=function(_0x303400,_0x252714,_0x2d5347){var _0x23b15b={};var _0x532089={};var _0x4d4d42;var _0x424400;return db['Trigger'][_0xd2e5('0x59')]({'where':{'id':_0x303400[_0xd2e5('0x47')]['id']}})[_0xd2e5('0x24')](handleEntityNotFound(_0x252714,null))[_0xd2e5('0x24')](function(_0x2c2d58){if(_0x2c2d58){_0x4d4d42=_0x2c2d58;_0x532089['model']=_[_0xd2e5('0x34')](db[_0xd2e5('0x56')]['rawAttributes']);_0x532089['query']=_[_0xd2e5('0x34')](_0x303400[_0xd2e5('0x33')]);_0x532089[_0xd2e5('0x3e')]=_[_0xd2e5('0x36')](_0x532089[_0xd2e5('0x32')],_0x532089[_0xd2e5('0x33')]);_0x23b15b[_0xd2e5('0x35')]=_[_0xd2e5('0x36')](_0x532089['model'],qs['fields'](_0x303400[_0xd2e5('0x33')]['fields']));_0x23b15b['attributes']=_0x23b15b['attributes'][_0xd2e5('0x38')]?_0x23b15b[_0xd2e5('0x35')]:_0x532089[_0xd2e5('0x32')];_0x23b15b[_0xd2e5('0x5a')]=qs[_0xd2e5('0x3b')](_0x303400[_0xd2e5('0x33')][_0xd2e5('0x3b')]);_0x23b15b[_0xd2e5('0x3c')]=qs[_0xd2e5('0x3e')](_[_0xd2e5('0x3d')](_0x303400[_0xd2e5('0x33')],_0x532089['filters']));if(_0x303400[_0xd2e5('0x33')][_0xd2e5('0x3f')]){_0x23b15b[_0xd2e5('0x3c')]=_['merge'](_0x23b15b[_0xd2e5('0x3c')],{'$or':_[_0xd2e5('0x2d')](_0x23b15b['attributes'],function(_0x299320){var _0x3c055f={};_0x3c055f[_0x299320]={'$like':'%'+_0x303400[_0xd2e5('0x33')][_0xd2e5('0x3f')]+'%'};return _0x3c055f;})});}_0x23b15b=_['merge']({},_0x23b15b,_0x303400[_0xd2e5('0x41')]);return _0x4d4d42[_0xd2e5('0x5c')](_0x23b15b);}})[_0xd2e5('0x24')](function(_0x2dbca5){if(_0x2dbca5){_0x424400=_0x2dbca5[_0xd2e5('0x38')];if(!_0x303400['query']['hasOwnProperty'](_0xd2e5('0x3a'))){_0x23b15b['limit']=qs['limit'](_0x303400['query'][_0xd2e5('0x1f')]);_0x23b15b['offset']=qs['offset'](_0x303400[_0xd2e5('0x33')][_0xd2e5('0x1e')]);}return _0x4d4d42[_0xd2e5('0x5c')](_0x23b15b);}})[_0xd2e5('0x24')](function(_0xfc5080){if(_0xfc5080){return _0xfc5080?{'count':_0x424400,'rows':_0xfc5080}:null;}})['then'](respondWithResult(_0x252714,null))[_0xd2e5('0x45')](handleError(_0x252714,null));};exports[_0xd2e5('0x5d')]=function(_0x78c18f,_0x551fae,_0x54c5c8){if(_0x78c18f[_0xd2e5('0x53')]['id']){delete _0x78c18f['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x78c18f[_0xd2e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x551fae,null))[_0xd2e5('0x24')](function(_0x577116){if(_0x577116){_0x78c18f[_0xd2e5('0x53')][_0xd2e5('0x5e')]=_0x577116['id'];return db[_0xd2e5('0x5f')][_0xd2e5('0x4a')](_0x78c18f[_0xd2e5('0x53')]);}})[_0xd2e5('0x24')](respondWithResult(_0x551fae,null))[_0xd2e5('0x45')](handleError(_0x551fae,null));};exports['getActions']=function(_0x207479,_0x35f7d5,_0x2a3c9c){var _0x5b898c={};var _0x3094cd={};var _0x223f1f;var _0x17ce19;return db[_0xd2e5('0x2e')][_0xd2e5('0x59')]({'where':{'id':_0x207479['params']['id']}})[_0xd2e5('0x24')](handleEntityNotFound(_0x35f7d5,null))[_0xd2e5('0x24')](function(_0x48f335){if(_0x48f335){_0x223f1f=_0x48f335;_0x3094cd[_0xd2e5('0x32')]=_[_0xd2e5('0x34')](db[_0xd2e5('0x5f')]['rawAttributes']);_0x3094cd['query']=_[_0xd2e5('0x34')](_0x207479[_0xd2e5('0x33')]);_0x3094cd['filters']=_[_0xd2e5('0x36')](_0x3094cd[_0xd2e5('0x32')],_0x3094cd[_0xd2e5('0x33')]);_0x5b898c[_0xd2e5('0x35')]=_[_0xd2e5('0x36')](_0x3094cd[_0xd2e5('0x32')],qs['fields'](_0x207479[_0xd2e5('0x33')][_0xd2e5('0x37')]));_0x5b898c[_0xd2e5('0x35')]=_0x5b898c['attributes'][_0xd2e5('0x38')]?_0x5b898c[_0xd2e5('0x35')]:_0x3094cd[_0xd2e5('0x32')];_0x5b898c[_0xd2e5('0x5a')]=qs[_0xd2e5('0x3b')](_0x207479[_0xd2e5('0x33')][_0xd2e5('0x3b')]);_0x5b898c[_0xd2e5('0x3c')]=qs[_0xd2e5('0x3e')](_['pick'](_0x207479[_0xd2e5('0x33')],_0x3094cd['filters']));if(_0x207479[_0xd2e5('0x33')][_0xd2e5('0x3f')]){_0x5b898c[_0xd2e5('0x3c')]=_[_0xd2e5('0x40')](_0x5b898c[_0xd2e5('0x3c')],{'$or':_[_0xd2e5('0x2d')](_0x5b898c[_0xd2e5('0x35')],function(_0x5472b0){var _0x4c67b3={};_0x4c67b3[_0x5472b0]={'$like':'%'+_0x207479[_0xd2e5('0x33')][_0xd2e5('0x3f')]+'%'};return _0x4c67b3;})});}_0x5b898c=_[_0xd2e5('0x40')]({},_0x5b898c,_0x207479[_0xd2e5('0x41')]);return _0x223f1f['getActions'](_0x5b898c);}})['then'](function(_0x3f56d9){if(_0x3f56d9){_0x17ce19=_0x3f56d9[_0xd2e5('0x38')];if(!_0x207479[_0xd2e5('0x33')][_0xd2e5('0x39')](_0xd2e5('0x3a'))){_0x5b898c[_0xd2e5('0x1f')]=qs[_0xd2e5('0x1f')](_0x207479[_0xd2e5('0x33')]['limit']);_0x5b898c[_0xd2e5('0x1e')]=qs[_0xd2e5('0x1e')](_0x207479[_0xd2e5('0x33')][_0xd2e5('0x1e')]);}return _0x223f1f[_0xd2e5('0x60')](_0x5b898c);}})[_0xd2e5('0x24')](function(_0x3e424e){if(_0x3e424e){return _0x3e424e?{'count':_0x17ce19,'rows':_0x3e424e}:null;}})['then'](respondWithResult(_0x35f7d5,null))[_0xd2e5('0x45')](handleError(_0x35f7d5,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 6e0e730..636377c 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 _0x996a=['define','tools_triggers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x56d9ad,_0x5070b0){var _0xc41489=function(_0x3af908){while(--_0x3af908){_0x56d9ad['push'](_0x56d9ad['shift']());}};_0xc41489(++_0x5070b0);}(_0x996a,0x1e2));var _0xa996=function(_0x3551eb,_0x3a0ef5){_0x3551eb=_0x3551eb-0x0;var _0x2487c9=_0x996a[_0x3551eb];return _0x2487c9;};'use strict';var _=require(_0xa996('0x0'));var util=require(_0xa996('0x1'));var logger=require(_0xa996('0x2'))('api');var moment=require(_0xa996('0x3'));var BPromise=require('bluebird');var rp=require(_0xa996('0x4'));var fs=require('fs');var path=require(_0xa996('0x5'));var rimraf=require(_0xa996('0x6'));var config=require(_0xa996('0x7'));var attributes=require(_0xa996('0x8'));module[_0xa996('0x9')]=function(_0x5a4254,_0x48d2a6){return _0x5a4254[_0xa996('0xa')]('Trigger',attributes,{'tableName':_0xa996('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07ec=['tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger'];(function(_0x4b0c3e,_0x50754a){var _0xa99d4e=function(_0x1034a2){while(--_0x1034a2){_0x4b0c3e['push'](_0x4b0c3e['shift']());}};_0xa99d4e(++_0x50754a);}(_0x07ec,0x1e1));var _0xc07e=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x07ec[_0x25d2fb];return _0x1ded53;};'use strict';var _=require(_0xc07e('0x0'));var util=require(_0xc07e('0x1'));var logger=require(_0xc07e('0x2'))(_0xc07e('0x3'));var moment=require(_0xc07e('0x4'));var BPromise=require(_0xc07e('0x5'));var rp=require(_0xc07e('0x6'));var fs=require('fs');var path=require(_0xc07e('0x7'));var rimraf=require(_0xc07e('0x8'));var config=require(_0xc07e('0x9'));var attributes=require(_0xc07e('0xa'));module[_0xc07e('0xb')]=function(_0x179db5,_0x7d302b){return _0x179db5[_0xc07e('0xc')](_0xc07e('0xd'),attributes,{'tableName':_0xc07e('0xe'),'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 2223ab1..978e6a2 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 _0xdd4f=['request\x20sent','stringify','error','code','message','info','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowTrigger','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s'];(function(_0x3288aa,_0x5a5484){var _0x2a4a0f=function(_0x37f069){while(--_0x37f069){_0x3288aa['push'](_0x3288aa['shift']());}};_0x2a4a0f(++_0x5a5484);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xe9c716,_0x44607b){_0xe9c716=_0xe9c716-0x0;var _0x2e6f97=_0xdd4f[_0xe9c716];return _0x2e6f97;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});}exports[_0xfdd4('0x15')]=function(_0x2ccc88){var _0x32b5f7=this;return new Promise(function(_0x33d752,_0x1746e1){return db[_0xfdd4('0x16')][_0xfdd4('0x17')]({'raw':_0x2ccc88['options']?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x19')]===undefined?!![]:![]:!![],'where':_0x2ccc88[_0xfdd4('0x18')]?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x1a')]||null:null,'attributes':_0x2ccc88[_0xfdd4('0x18')]?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x1b')]||null:null,'limit':_0x2ccc88['options']?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x1c')]||null:null,'include':_0x2ccc88[_0xfdd4('0x18')]?_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x1d')]?_[_0xfdd4('0x1e')](_0x2ccc88[_0xfdd4('0x18')][_0xfdd4('0x1d')],function(_0x538b00){return{'model':db[_0x538b00[_0xfdd4('0x1f')]],'as':_0x538b00['as'],'attributes':_0x538b00[_0xfdd4('0x1b')],'include':_0x538b00[_0xfdd4('0x1d')]?_['map'](_0x538b00[_0xfdd4('0x1d')],function(_0x39b712){return{'model':db[_0x39b712[_0xfdd4('0x1f')]],'as':_0x39b712['as'],'attributes':_0x39b712[_0xfdd4('0x1b')],'include':_0x39b712[_0xfdd4('0x1d')]?_['map'](_0x39b712[_0xfdd4('0x1d')],function(_0x2c88ad){return{'model':db[_0x2c88ad[_0xfdd4('0x1f')]],'as':_0x2c88ad['as'],'attributes':_0x2c88ad[_0xfdd4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfdd4('0xa')](function(_0x192471){logger[_0xfdd4('0x13')](_0xfdd4('0x15'),_0x2ccc88);logger['debug'](_0xfdd4('0x15'),_0x2ccc88,JSON[_0xfdd4('0xf')](_0x192471));_0x33d752(_0x192471);})[_0xfdd4('0x20')](function(_0xef012e){logger[_0xfdd4('0x10')]('GetTrigger',_0xef012e[_0xfdd4('0x12')],_0x2ccc88);_0x1746e1(_0x32b5f7[_0xfdd4('0x10')](0x1f4,_0xef012e[_0xfdd4('0x12')]));});});};exports[_0xfdd4('0x21')]=function(_0x13cc5e){var _0x4d64ce=this;return new Promise(function(_0x374e98,_0x315568){return db[_0xfdd4('0x16')]['find']({'raw':_0x13cc5e[_0xfdd4('0x18')]?_0x13cc5e['options'][_0xfdd4('0x19')]===undefined?!![]:![]:!![],'where':_0x13cc5e[_0xfdd4('0x18')]?_0x13cc5e['options']['where']||null:null,'attributes':_0x13cc5e[_0xfdd4('0x18')]?_0x13cc5e[_0xfdd4('0x18')]['attributes']||null:null,'include':_0x13cc5e['options']?_0x13cc5e[_0xfdd4('0x18')][_0xfdd4('0x1d')]?_[_0xfdd4('0x1e')](_0x13cc5e[_0xfdd4('0x18')][_0xfdd4('0x1d')],function(_0x265cab){return{'model':db[_0x265cab[_0xfdd4('0x1f')]],'as':_0x265cab['as'],'attributes':_0x265cab[_0xfdd4('0x1b')],'include':_0x265cab[_0xfdd4('0x1d')]?_[_0xfdd4('0x1e')](_0x265cab[_0xfdd4('0x1d')],function(_0x12b8b1){return{'model':db[_0x12b8b1[_0xfdd4('0x1f')]],'as':_0x12b8b1['as'],'attributes':_0x12b8b1[_0xfdd4('0x1b')],'include':_0x12b8b1[_0xfdd4('0x1d')]?_[_0xfdd4('0x1e')](_0x12b8b1[_0xfdd4('0x1d')],function(_0x3a0102){return{'model':db[_0x3a0102[_0xfdd4('0x1f')]],'as':_0x3a0102['as'],'attributes':_0x3a0102[_0xfdd4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfdd4('0xa')](function(_0x2e4c8c){logger[_0xfdd4('0x13')](_0xfdd4('0x21'),_0x13cc5e);logger[_0xfdd4('0xc')](_0xfdd4('0x21'),_0x13cc5e,JSON['stringify'](_0x2e4c8c));_0x374e98(_0x2e4c8c);})[_0xfdd4('0x20')](function(_0x3716da){logger[_0xfdd4('0x10')](_0xfdd4('0x21'),_0x3716da[_0xfdd4('0x12')],_0x13cc5e);_0x315568(_0x4d64ce[_0xfdd4('0x10')](0x1f4,_0x3716da['message']));});});}; \ No newline at end of file +var _0xe820=['findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowTrigger','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger'];(function(_0x1f2984,_0x41b117){var _0x4f526d=function(_0x2d2455){while(--_0x2d2455){_0x1f2984['push'](_0x1f2984['shift']());}};_0x4f526d(++_0x41b117);}(_0xe820,0xd2));var _0x0e82=function(_0x41fd9a,_0x4f8968){_0x41fd9a=_0x41fd9a-0x0;var _0x55383f=_0xe820[_0x41fd9a];return _0x55383f;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('Trigger,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')]({'raw':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x17')]===undefined?!![]:![]:!![],'where':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x18')]||null:null,'attributes':_0x53622b['options']?_0x53622b['options'][_0x0e82('0x19')]||null:null,'limit':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x1a')]||null:null,'include':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0x53622b['options'][_0x0e82('0x1b')],function(_0x13f023){return{'model':db[_0x13f023[_0x0e82('0x1d')]],'as':_0x13f023['as'],'attributes':_0x13f023[_0x0e82('0x19')],'include':_0x13f023['include']?_[_0x0e82('0x1c')](_0x13f023[_0x0e82('0x1b')],function(_0x7a9399){return{'model':db[_0x7a9399[_0x0e82('0x1d')]],'as':_0x7a9399['as'],'attributes':_0x7a9399['attributes'],'include':_0x7a9399[_0x0e82('0x1b')]?_['map'](_0x7a9399['include'],function(_0x384f88){return{'model':db[_0x384f88[_0x0e82('0x1d')]],'as':_0x384f88['as'],'attributes':_0x384f88['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e82('0xa')](function(_0xe3c530){logger[_0x0e82('0x1e')]('GetTrigger',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON['stringify'](_0xe3c530));_0x310aac(_0xe3c530);})[_0x0e82('0x1f')](function(_0x59a5b6){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0x59a5b6['message'],_0x53622b);_0x3a3ddf(_0x25ac21[_0x0e82('0x10')](0x1f4,_0x59a5b6[_0x0e82('0x12')]));});});};exports[_0x0e82('0x20')]=function(_0x4d74d0){var _0x50adb7=this;return new Promise(function(_0x2dc021,_0x4a8c43){return db[_0x0e82('0x14')]['find']({'raw':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x17')]===undefined?!![]:![]:!![],'where':_0x4d74d0['options']?_0x4d74d0[_0x0e82('0x16')]['where']||null:null,'attributes':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x19')]||null:null,'include':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x1b')]?_['map'](_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x1b')],function(_0x34c914){return{'model':db[_0x34c914[_0x0e82('0x1d')]],'as':_0x34c914['as'],'attributes':_0x34c914[_0x0e82('0x19')],'include':_0x34c914[_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0x34c914[_0x0e82('0x1b')],function(_0xfd7924){return{'model':db[_0xfd7924[_0x0e82('0x1d')]],'as':_0xfd7924['as'],'attributes':_0xfd7924[_0x0e82('0x19')],'include':_0xfd7924[_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0xfd7924[_0x0e82('0x1b')],function(_0x21dd97){return{'model':db[_0x21dd97['model']],'as':_0x21dd97['as'],'attributes':_0x21dd97[_0x0e82('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0e82('0xa')](function(_0x3be8e8){logger[_0x0e82('0x1e')]('ShowTrigger',_0x4d74d0);logger[_0x0e82('0xd')](_0x0e82('0x20'),_0x4d74d0,JSON['stringify'](_0x3be8e8));_0x2dc021(_0x3be8e8);})[_0x0e82('0x1f')](function(_0x57e505){logger['error'](_0x0e82('0x20'),_0x57e505[_0x0e82('0x12')],_0x4d74d0);_0x4a8c43(_0x50adb7[_0x0e82('0x10')](0x1f4,_0x57e505[_0x0e82('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index db32d3d..d9ec24a 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 _0xac9d=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','/:id','show','/:id/clone','clone','post','create','put'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xac9d,0x14d));var _0xdac9=function(_0x2c8d85,_0x590fef){_0x2c8d85=_0x2c8d85-0x0;var _0x277ef4=_0xac9d[_0x2c8d85];return _0x277ef4;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var auth=require(_0xdac9('0x6'));var interaction=require(_0xdac9('0x7'));var config=require('../../config/environment');var controller=require(_0xdac9('0x8'));router['get']('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0xa')]);router[_0xdac9('0xb')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xd')]);router['post'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')]('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0x11')]);router[_0xdac9('0x12')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x13')]);router[_0xdac9('0x14')]('/:id',auth[_0xdac9('0x9')](),controller[_0xdac9('0x15')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','/:id/clone','clone'];(function(_0x23e0c9,_0x1dc91b){var _0x499bc2=function(_0x2431c7){while(--_0x2431c7){_0x23e0c9['push'](_0x23e0c9['shift']());}};_0x499bc2(++_0x1dc91b);}(_0x34e8,0x12c));var _0x834e=function(_0x474fad,_0x4e2359){_0x474fad=_0x474fad-0x0;var _0x2f35e2=_0x34e8[_0x474fad];return _0x2f35e2;};'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')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')](_0x834e('0xd'),auth[_0x834e('0xa')](),controller[_0x834e('0xe')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x10')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 0102050..ff0ca44 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 _0xe94d=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN'];(function(_0x33123b,_0x1e4aaa){var _0x42b92b=function(_0x47d586){while(--_0x47d586){_0x33123b['push'](_0x33123b['shift']());}};_0x42b92b(++_0x1e4aaa);}(_0xe94d,0x92));var _0xde94=function(_0xdc72d2,_0x20b969){_0xdc72d2=_0xdc72d2-0x0;var _0x16a0f5=_0xe94d[_0xdc72d2];return _0x16a0f5;};'use strict';var Sequelize=require('sequelize');module[_0xde94('0x0')]={'name':{'type':Sequelize[_0xde94('0x1')],'allowNull':![],'unique':_0xde94('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x4'),_0xde94('0x5'),_0xde94('0x6')),'allowNull':![],'defaultValue':_0xde94('0x4')},'context':{'type':Sequelize[_0xde94('0x1')],'allowNull':![],'defaultValue':_0xde94('0x7')},'callingpres':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x8'),'ALLOWED_PASSED_SCREEN',_0xde94('0x9'),_0xde94('0xa'),_0xde94('0xb'),_0xde94('0xc'),_0xde94('0xd'),_0xde94('0xe'))},'deny':{'type':Sequelize[_0xde94('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xde94('0x1')]},'md5secret':{'type':Sequelize[_0xde94('0x1')]},'remotesecret':{'type':Sequelize[_0xde94('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x392a8f){this[_0xde94('0xf')]('transport',_0x392a8f?_0x392a8f[_0xde94('0x10')](','):null);},'get':function(){return this[_0xde94('0x11')](_0xde94('0x12'))?this[_0xde94('0x11')](_0xde94('0x12'))['split'](','):null;},'comment':_0xde94('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xde94('0x14'),'info',_0xde94('0x15'),_0xde94('0x16'),'auto'),'defaultValue':_0xde94('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0xde94('0x17'),'no',_0xde94('0x18'),_0xde94('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xde94('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xde94('0x1')]},'directmediadeny':{'type':Sequelize[_0xde94('0x1')]},'nat':{'type':Sequelize[_0xde94('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x90060){this[_0xde94('0xf')](_0xde94('0x1a'),_0x90060?_0x90060[_0xde94('0x10')](','):null);},'get':function(){return this[_0xde94('0x11')](_0xde94('0x1a'))?this[_0xde94('0x11')](_0xde94('0x1a'))[_0xde94('0x1b')](','):null;},'comment':_0xde94('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xde94('0x1')]},'pickupgroup':{'type':Sequelize[_0xde94('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xde94('0x1')]},'language':{'type':Sequelize[_0xde94('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xde94('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xde94('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x474f36){this[_0xde94('0xf')]('allow',_0x474f36?_0x474f36[_0xde94('0x10')](';'):_0xde94('0x1e'));},'get':function(){return this[_0xde94('0x11')]('allow')?this[_0xde94('0x11')](_0xde94('0x1f'))[_0xde94('0x1b')](';'):null;},'comment':_0xde94('0x20')},'autoframing':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'insecure':{'type':Sequelize[_0xde94('0x1')],'defaultValue':_0xde94('0x21'),'set':function(_0x16cf72){this['setDataValue'](_0xde94('0x22'),_0x16cf72?_0x16cf72[_0xde94('0x10')](','):null);},'get':function(){return this[_0xde94('0x11')]('insecure')?this[_0xde94('0x11')](_0xde94('0x22'))[_0xde94('0x1b')](','):null;},'comment':_0xde94('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0xde94('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xde94('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xde94('0x17'),'no',_0xde94('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0xde94('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'accountcode':{'type':Sequelize[_0xde94('0x25')](0xb)},'setvar':{'type':Sequelize[_0xde94('0x1')]},'callerid':{'type':Sequelize[_0xde94('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xde94('0x1')]},'callcounter':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no'),'defaultValue':_0xde94('0x17')},'busylevel':{'type':Sequelize[_0xde94('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xde94('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xde94('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no',_0xde94('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xde94('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x27'),_0xde94('0x28'),'originate')},'session_expires':{'type':Sequelize[_0xde94('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xde94('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x29'),_0xde94('0x2a')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xde94('0x1')]},'fromdomain':{'type':Sequelize[_0xde94('0x1')]},'fromuser':{'type':Sequelize[_0xde94('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no'),'defaultValue':_0xde94('0x17')},'keepalive':{'type':Sequelize[_0xde94('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xde94('0x1')]},'defaultuser':{'type':Sequelize[_0xde94('0x1')]},'rtptimeout':{'type':Sequelize[_0xde94('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xde94('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no',_0xde94('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xde94('0x1')]},'callbackextension':{'type':Sequelize[_0xde94('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xde94('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xde94('0x1')]},'contactdeny':{'type':Sequelize[_0xde94('0x1')]},'contactacl':{'type':Sequelize[_0xde94('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xde94('0x1')]},'maxforwards':{'type':Sequelize[_0xde94('0x25')](0xb)},'encryption':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xde94('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'icesupport':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no',_0xde94('0x2c'),_0xde94('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xde94('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xde94('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xde94('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xde94('0x1')]},'dtlscapath':{'type':Sequelize[_0xde94('0x1')]},'dtlssetup':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x2e'),_0xde94('0x2f'),_0xde94('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xde94('0x1')]},'usereqphone':{'type':Sequelize[_0xde94('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xde94('0x1')]},'recordofffeature':{'type':Sequelize[_0xde94('0x1')]},'call_limit':{'type':Sequelize[_0xde94('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no')},'vmexten':{'type':Sequelize[_0xde94('0x1')]},'mohinterpret':{'type':Sequelize[_0xde94('0x1')]},'mohsuggest':{'type':Sequelize[_0xde94('0x1')]},'parkinglot':{'type':Sequelize[_0xde94('0x1')]},'description':{'type':Sequelize[_0xde94('0x1')]},'host':{'type':Sequelize[_0xde94('0x1')],'defaultValue':_0xde94('0x31')},'canreinvite':{'type':Sequelize[_0xde94('0x3')](_0xde94('0x17'),'no',_0xde94('0x18'),'update',_0xde94('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xde94('0x1')]},'otherFields':{'type':Sequelize[_0xde94('0x1')]},'active':{'type':Sequelize[_0xde94('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xde94('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x3012=['force_rport,comedia','nat','join','getDataValue','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','setDataValue','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','rfc2833','yes','nonat','update','outgoing'];(function(_0x564bfc,_0x32bb18){var _0x5e7676=function(_0x2553b1){while(--_0x2553b1){_0x564bfc['push'](_0x564bfc['shift']());}};_0x5e7676(++_0x32bb18);}(_0x3012,0x181));var _0x2301=function(_0x5e03ab,_0x595d38){_0x5e03ab=_0x5e03ab-0x0;var _0x25a10f=_0x3012[_0x5e03ab];return _0x25a10f;};'use strict';var Sequelize=require(_0x2301('0x0'));module[_0x2301('0x1')]={'name':{'type':Sequelize[_0x2301('0x2')],'allowNull':![],'unique':_0x2301('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2301('0x4')]('friend',_0x2301('0x5'),_0x2301('0x6')),'allowNull':![],'defaultValue':_0x2301('0x7')},'context':{'type':Sequelize[_0x2301('0x2')],'allowNull':![],'defaultValue':_0x2301('0x8')},'callingpres':{'type':Sequelize[_0x2301('0x4')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x2301('0x9'),'ALLOWED',_0x2301('0xa'),_0x2301('0xb'),'PROHIB_FAILED_SCREEN',_0x2301('0xc'))},'deny':{'type':Sequelize[_0x2301('0x2')]},'permit':{'type':Sequelize[_0x2301('0x2')]},'secret':{'type':Sequelize[_0x2301('0x2')]},'md5secret':{'type':Sequelize[_0x2301('0x2')]},'remotesecret':{'type':Sequelize[_0x2301('0x2')]},'transport':{'type':Sequelize[_0x2301('0x2')],'defaultValue':_0x2301('0xd'),'set':function(_0x35186f){this['setDataValue'](_0x2301('0xe'),_0x35186f?_0x35186f['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0x2301('0xe'))[_0x2301('0xf')](','):null;},'comment':_0x2301('0x10')},'dtmfmode':{'type':Sequelize[_0x2301('0x4')]('rfc2833',_0x2301('0x11'),'shortinfo','inband','auto'),'defaultValue':_0x2301('0x12')},'directmedia':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no',_0x2301('0x14'),_0x2301('0x15'),_0x2301('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x2301('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x2301('0x17'),'set':function(_0x14e57b){this['setDataValue'](_0x2301('0x18'),_0x14e57b?_0x14e57b[_0x2301('0x19')](','):null);},'get':function(){return this[_0x2301('0x1a')](_0x2301('0x18'))?this[_0x2301('0x1a')](_0x2301('0x18'))[_0x2301('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x2301('0x2')]},'namedcallgroup':{'type':Sequelize[_0x2301('0x2')]},'pickupgroup':{'type':Sequelize[_0x2301('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2301('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2301('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2301('0x2')],'defaultValue':_0x2301('0x1b')},'allow':{'type':Sequelize[_0x2301('0x2')],'allowNull':![],'defaultValue':_0x2301('0x1c'),'set':function(_0x18113b){this['setDataValue'](_0x2301('0x1d'),_0x18113b?_0x18113b[_0x2301('0x19')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x2301('0x1d'))?this[_0x2301('0x1a')](_0x2301('0x1d'))['split'](';'):null;},'comment':_0x2301('0x1e')},'autoframing':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x2301('0x1f'),'set':function(_0x129f42){this[_0x2301('0x20')](_0x2301('0x21'),_0x129f42?_0x129f42[_0x2301('0x19')](','):null);},'get':function(){return this[_0x2301('0x1a')]('insecure')?this['getDataValue'](_0x2301('0x21'))['split'](','):null;},'comment':_0x2301('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no',_0x2301('0x23'))},'promiscredir':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no')},'accountcode':{'type':Sequelize[_0x2301('0x24')](0xb)},'setvar':{'type':Sequelize[_0x2301('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x2301('0x25')},'amaflags':{'type':Sequelize[_0x2301('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no'),'defaultValue':_0x2301('0x13')},'busylevel':{'type':Sequelize[_0x2301('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x2301('0x2')]},'template':{'type':Sequelize[_0x2301('0x2')]},'videosupport':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2301('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'mailbox':{'type':Sequelize[_0x2301('0x2')]},'session_timers':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x26'),_0x2301('0x27'),_0x2301('0x28'))},'session_expires':{'type':Sequelize[_0x2301('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x2301('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x29'),_0x2301('0x2a')),'defaultValue':_0x2301('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x2301('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x2301('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2301('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x2301('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x2301('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2301('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x2301('0x4')]('yes','no',_0x2301('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2301('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x2301('0x24')](0xb)},'timerb':{'type':Sequelize[_0x2301('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2301('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x2301('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2301('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2301('0x2')]},'use_q850_reason':{'type':Sequelize[_0x2301('0x2')]},'maxforwards':{'type':Sequelize[_0x2301('0x24')](0xb)},'encryption':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'force_avp':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x2301('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x2301('0x4')]('yes','no',_0x2301('0x2c'),_0x2301('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x2301('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2301('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2301('0x2')]},'dtlscipher':{'type':Sequelize[_0x2301('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x2301('0x2')]},'dtlssetup':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x2e'),_0x2301('0x2f'),_0x2301('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2301('0x2')]},'usereqphone':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2301('0x2')]},'recordofffeature':{'type':Sequelize[_0x2301('0x2')]},'call_limit':{'type':Sequelize[_0x2301('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x2301('0x2')]},'mohinterpret':{'type':Sequelize[_0x2301('0x2')]},'mohsuggest':{'type':Sequelize[_0x2301('0x2')]},'parkinglot':{'type':Sequelize[_0x2301('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x2301('0x31')},'canreinvite':{'type':Sequelize[_0x2301('0x4')](_0x2301('0x13'),'no','nonat',_0x2301('0x15'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2301('0x2')]},'otherFields':{'type':Sequelize[_0x2301('0x2')]},'active':{'type':Sequelize[_0x2301('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2301('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 9480ec3..1b96ea7 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 _0x639a=['server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_trunks.conf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','Trunks','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','find','clone','includeAll','omit','createdAt','body','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/registry.ejs','utf8','render','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x639a,0x152));var _0xa639=function(_0x162f9b,_0x19ef19){_0x162f9b=_0x162f9b-0x0;var _0x30ff29=_0x639a[_0x162f9b];return _0x30ff29;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require('request-promise');var moment=require(_0xa639('0x3'));var BPromise=require(_0xa639('0x4'));var Mustache=require(_0xa639('0x5'));var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa639('0x8'));var jsforce=require(_0xa639('0x9'));var deskjs=require(_0xa639('0xa'));var toCsv=require(_0xa639('0xb'));var querystring=require(_0xa639('0xc'));var Papa=require(_0xa639('0xd'));var Redis=require(_0xa639('0xe'));var authService=require(_0xa639('0xf'));var qs=require(_0xa639('0x10'));var as=require(_0xa639('0x11'));var hardwareService=require(_0xa639('0x12'));var logger=require('../../config/logger')(_0xa639('0x13'));var utils=require('../../config/utils');var config=require(_0xa639('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa639('0x15'));var client=jayson[_0xa639('0x16')][_0xa639('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5d3775,_0xd5eb22,_0x3f2e12){if(_0x3f2e12){var _0x5e8119=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e8119[_0xa639('0x18')](_0xd5eb22)){return _0x5d3775;}else{throw new db[(_0xa639('0x19'))][(_0xa639('0x1a'))](_0xa639('0x1b'));}}else{return _0x5d3775;}}function respondWithRpcPromise(_0x35ca2b,_0x126ca4,_0xdedbe,_0x2d73e1){return new BPromise(function(_0x53399d,_0x32e120){var _0x34ba09=_0x2d73e1||client;return _0x34ba09[_0xa639('0x1c')](_0x35ca2b,_0xdedbe)[_0xa639('0x1d')](function(_0x216654){logger['info'](_0xa639('0x1e'),_0x126ca4,_0xa639('0x1f'));logger[_0xa639('0x20')](_0xa639('0x21'),_0x126ca4,_0xa639('0x1f'),JSON['stringify'](_0x216654));if(_0x216654[_0xa639('0x22')]){if(_0x216654[_0xa639('0x22')][_0xa639('0x23')]===0x1f4){logger[_0xa639('0x22')](_0xa639('0x1e'),_0x126ca4,_0x216654[_0xa639('0x22')][_0xa639('0x24')]);return _0x32e120(_0x216654['error']['message']);}logger[_0xa639('0x22')](_0xa639('0x1e'),_0x126ca4,_0x216654[_0xa639('0x22')][_0xa639('0x24')]);return _0x53399d(_0x216654[_0xa639('0x22')][_0xa639('0x24')]);}else{logger['info'](_0xa639('0x1e'),_0x126ca4,_0xa639('0x1f'));_0x53399d(_0x216654[_0xa639('0x25')][_0xa639('0x24')]);}})[_0xa639('0x26')](function(_0x34be99){logger[_0xa639('0x22')](_0xa639('0x1e'),_0x126ca4,_0x34be99);_0x32e120(_0x34be99);});});}function respondWithStatusCode(_0x7ee8c3,_0x93b40){_0x93b40=_0x93b40||0xcc;return function(_0x33d42d){if(_0x33d42d){return _0x7ee8c3[_0xa639('0x27')](_0x93b40);}return _0x7ee8c3['status'](_0x93b40)['end']();};}function respondWithResult(_0x307b7d,_0x310534){_0x310534=_0x310534||0xc8;return function(_0x4ac25c){if(_0x4ac25c){return _0x307b7d[_0xa639('0x28')](_0x310534)[_0xa639('0x29')](_0x4ac25c);}};}function respondWithFilteredResult(_0x33eddb,_0x556b7e){return function(_0x47c539){if(_0x47c539){var _0x3ecb07=_0x47c539[_0xa639('0x2a')],_0x133985=_0x556b7e[_0xa639('0x2b')],_0x30c205=_0x556b7e[_0xa639('0x2b')]+_0x556b7e['limit'],_0x18a207;if(_0x30c205>=_0x3ecb07){_0x30c205=_0x3ecb07;_0x18a207=0xc8;}else{_0x18a207=0xce;}_0x33eddb[_0xa639('0x28')](_0x18a207);return _0x33eddb[_0xa639('0x2c')](_0xa639('0x2d'),_0x133985+'-'+_0x30c205+'/'+_0x3ecb07)[_0xa639('0x29')](_0x47c539);}return null;};}function patchUpdates(_0x59e941){return function(_0x2e39de){try{jsonpatch[_0xa639('0x2e')](_0x2e39de,_0x59e941,!![]);}catch(_0x25e07d){return BPromise['reject'](_0x25e07d);}return _0x2e39de[_0xa639('0x2f')]();};}function saveUpdates(_0x54d27a,_0x841cff){return function(_0x32724a){if(_0x32724a){return _0x32724a[_0xa639('0x30')](_0x54d27a)['then'](function(_0xf4459b){return _0xf4459b;});}return null;};}function removeEntity(_0x2fa28b,_0x25ace9){return function(_0x180633){if(_0x180633){return _0x180633['destroy']()[_0xa639('0x1d')](function(){var _0x3a725a=_0x180633['get']({'plain':!![]});var _0x329866=_0xa639('0x31');return db['UserProfileResource'][_0xa639('0x32')]({'where':{'type':_0x329866,'resourceId':_0x3a725a['id']}})[_0xa639('0x1d')](function(){return _0x180633;});})['then'](function(){_0x2fa28b[_0xa639('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x108707,_0x396e69){return function(_0x15c9d2){if(!_0x15c9d2){_0x108707[_0xa639('0x27')](0x194);}return _0x15c9d2;};}function handleError(_0x564834,_0x452b4b){_0x452b4b=_0x452b4b||0x1f4;return function(_0x555217){logger[_0xa639('0x22')](_0x555217[_0xa639('0x33')]);if(_0x555217[_0xa639('0x34')]){delete _0x555217[_0xa639('0x34')];}_0x564834[_0xa639('0x28')](_0x452b4b)[_0xa639('0x35')](_0x555217);};}exports['index']=function(_0x115bec,_0x4089cd){var _0x18d2d6={},_0x566742={},_0x254e4a={'count':0x0,'rows':[]};var _0x5800b0=_[_0xa639('0x36')](db[_0xa639('0x37')][_0xa639('0x38')],function(_0x30914d){return{'name':_0x30914d[_0xa639('0x39')],'type':_0x30914d[_0xa639('0x3a')][_0xa639('0x3b')]};});_0x566742[_0xa639('0x3c')]=_['map'](_0x5800b0,_0xa639('0x34'));_0x566742[_0xa639('0x3d')]=_[_0xa639('0x3e')](_0x115bec[_0xa639('0x3d')]);_0x566742[_0xa639('0x3f')]=_[_0xa639('0x40')](_0x566742[_0xa639('0x3c')],_0x566742[_0xa639('0x3d')]);_0x18d2d6['attributes']=_[_0xa639('0x40')](_0x566742[_0xa639('0x3c')],qs[_0xa639('0x41')](_0x115bec[_0xa639('0x3d')][_0xa639('0x41')]));_0x18d2d6[_0xa639('0x42')]=_0x18d2d6[_0xa639('0x42')][_0xa639('0x43')]?_0x18d2d6[_0xa639('0x42')]:_0x566742[_0xa639('0x3c')];if(!_0x115bec[_0xa639('0x3d')][_0xa639('0x44')](_0xa639('0x45'))){_0x18d2d6[_0xa639('0x46')]=qs[_0xa639('0x46')](_0x115bec[_0xa639('0x3d')][_0xa639('0x46')]);_0x18d2d6['offset']=qs[_0xa639('0x2b')](_0x115bec['query'][_0xa639('0x2b')]);}_0x18d2d6[_0xa639('0x47')]=qs[_0xa639('0x48')](_0x115bec[_0xa639('0x3d')]['sort']);_0x18d2d6['where']=qs[_0xa639('0x3f')](_[_0xa639('0x49')](_0x115bec['query'],_0x566742['filters']));if(_0x115bec[_0xa639('0x3d')][_0xa639('0x4a')]){_0x18d2d6[_0xa639('0x4b')]=_[_0xa639('0x4c')](_0x18d2d6[_0xa639('0x4b')],{'$or':_[_0xa639('0x36')](_0x5800b0,function(_0x22e1f9){if(_0x22e1f9['type']!==_0xa639('0x4d')){var _0x404d0e={};_0x404d0e[_0x22e1f9['name']]={'$like':'%'+_0x115bec[_0xa639('0x3d')][_0xa639('0x4a')]+'%'};return _0x404d0e;}})});}_0x18d2d6=_[_0xa639('0x4c')]({},_0x18d2d6,_0x115bec[_0xa639('0x4e')]);var _0x290eed={'where':_0x18d2d6[_0xa639('0x4b')]};return db[_0xa639('0x37')][_0xa639('0x2a')](_0x290eed)[_0xa639('0x1d')](function(_0x2c3ed6){_0x254e4a[_0xa639('0x2a')]=_0x2c3ed6;if(_0x115bec[_0xa639('0x3d')]['includeAll']){_0x18d2d6[_0xa639('0x4f')]=[{'all':!![]}];}return db[_0xa639('0x37')][_0xa639('0x50')](_0x18d2d6);})[_0xa639('0x1d')](function(_0x3f32ba){_0x254e4a[_0xa639('0x51')]=_0x3f32ba;return _0x254e4a;})[_0xa639('0x1d')](respondWithFilteredResult(_0x4089cd,_0x18d2d6))[_0xa639('0x26')](handleError(_0x4089cd,null));};exports['show']=function(_0x317a98,_0x587961){var _0x111fd2={'raw':![],'where':{'id':_0x317a98[_0xa639('0x52')]['id']}},_0x52841b={};_0x52841b[_0xa639('0x3c')]=_[_0xa639('0x3e')](db[_0xa639('0x37')][_0xa639('0x38')]);_0x52841b[_0xa639('0x3d')]=_[_0xa639('0x3e')](_0x317a98[_0xa639('0x3d')]);_0x52841b[_0xa639('0x3f')]=_[_0xa639('0x40')](_0x52841b[_0xa639('0x3c')],_0x52841b[_0xa639('0x3d')]);_0x111fd2[_0xa639('0x42')]=_[_0xa639('0x40')](_0x52841b[_0xa639('0x3c')],qs[_0xa639('0x41')](_0x317a98['query'][_0xa639('0x41')]));_0x111fd2['attributes']=_0x111fd2[_0xa639('0x42')]['length']?_0x111fd2[_0xa639('0x42')]:_0x52841b[_0xa639('0x3c')];if(_0x317a98['query']['includeAll']){_0x111fd2['include']=[{'all':!![]}];}_0x111fd2=_[_0xa639('0x4c')]({},_0x111fd2,_0x317a98['options']);return db[_0xa639('0x37')][_0xa639('0x53')](_0x111fd2)[_0xa639('0x1d')](handleEntityNotFound(_0x587961,null))[_0xa639('0x1d')](respondWithResult(_0x587961,null))[_0xa639('0x26')](handleError(_0x587961,null));};exports[_0xa639('0x54')]=function(_0x117f81,_0xc6631c){var _0xcd3cad={'where':{'id':_0x117f81[_0xa639('0x52')]['id']}},_0x32fdb3={};_0x32fdb3['model']=_[_0xa639('0x3e')](db[_0xa639('0x37')][_0xa639('0x38')]);_0xcd3cad[_0xa639('0x42')]=_[_0xa639('0x40')](_0x32fdb3[_0xa639('0x3c')],qs[_0xa639('0x41')](_0x117f81[_0xa639('0x3d')][_0xa639('0x41')]));_0xcd3cad['attributes']=_0xcd3cad[_0xa639('0x42')]['length']?_0xcd3cad[_0xa639('0x42')]:_0x32fdb3['model'];if(_0x117f81[_0xa639('0x3d')][_0xa639('0x55')]){_0xcd3cad[_0xa639('0x4f')]=[{'all':!![]}];}_0xcd3cad=_[_0xa639('0x4c')]({},_0xcd3cad,_0x117f81[_0xa639('0x4e')]);return db['Trunk'][_0xa639('0x53')](_0xcd3cad)[_0xa639('0x1d')](handleEntityNotFound(_0xc6631c,null))[_0xa639('0x1d')](function(_0x4f07bb){if(_0x4f07bb){var _0x338e48=_0x4f07bb['get']({'plain':!![]});_0x338e48=qs[_0xa639('0x56')](_0x338e48,['id',_0xa639('0x57'),'updatedAt']);_0x117f81['body']=_['omit'](_0x117f81[_0xa639('0x58')],['id',_0xa639('0x57'),'updatedAt']);return db[_0xa639('0x37')][_0xa639('0x59')](_[_0xa639('0x4c')](_0x338e48,_0x117f81[_0xa639('0x58')]),{'include':_0x117f81[_0xa639('0x3d')][_0xa639('0x55')]?[{'all':!![]}]:undefined})[_0xa639('0x1d')](function(_0x133e06){var _0x3383ab=_0x117f81['user'][_0xa639('0x5a')]({'plain':!![]});if(!_0x3383ab)throw new Error(_0xa639('0x5b'));if(_0x3383ab[_0xa639('0x5c')]===_0xa639('0x5d')){var _0x4ff5e6=_0x133e06['get']({'plain':!![]});var _0x5741d8=_0xa639('0x31');return db['UserProfileSection'][_0xa639('0x53')]({'where':{'name':_0x5741d8,'userProfileId':_0x3383ab['userProfileId']},'raw':!![]})[_0xa639('0x1d')](function(_0x5a4998){if(_0x5a4998&&_0x5a4998[_0xa639('0x5e')]===0x0){return db[_0xa639('0x5f')][_0xa639('0x59')]({'name':_0x4ff5e6[_0xa639('0x34')],'resourceId':_0x4ff5e6['id'],'type':_0x5a4998[_0xa639('0x34')],'sectionId':_0x5a4998['id']},{})['then'](function(){return _0x133e06;});}else{return _0x133e06;}})[_0xa639('0x26')](function(_0x370808){logger[_0xa639('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x370808);throw _0x370808;});}return _0x133e06;});}})[_0xa639('0x1d')](respondWithResult(_0xc6631c,0xc9))[_0xa639('0x26')](handleError(_0xc6631c,null));};exports['create']=function(_0x35e2ea,_0x4c8931,_0x2bbd36){var _0x36c5e4;return db[_0xa639('0x37')][_0xa639('0x59')](_0x35e2ea[_0xa639('0x58')],{'raw':!![]})[_0xa639('0x1d')](function(_0x1b100b){_0x36c5e4=_0x1b100b;return db[_0xa639('0x37')][_0xa639('0x50')]({'raw':!![]});})[_0xa639('0x1d')](function(_0x2bc640){var _0x480222=fs[_0xa639('0x60')](path[_0xa639('0x61')](config[_0xa639('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x1322fc=fs[_0xa639('0x60')](path[_0xa639('0x61')](config[_0xa639('0x62')],_0xa639('0x63')),_0xa639('0x64'));var _0x391d01=ejs[_0xa639('0x65')](_0x480222,{'trunks':_0x2bc640||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x391d01);if(_0x36c5e4[_0xa639('0x66')]){var _0x5cac5d=ejs[_0xa639('0x65')](_0x1322fc,{'trunks':_0x2bc640||[]});fs[_0xa639('0x67')](_0xa639('0x68'),_0x5cac5d);}})['then'](function(){return respondWithRpcPromise(_0xa639('0x69'),_0xa639('0x59'),{'module':_0xa639('0x6a')});})[_0xa639('0x1d')](function(){var _0xc65239=_0x35e2ea['user'][_0xa639('0x5a')]({'plain':!![]});if(!_0xc65239)throw new Error(_0xa639('0x5b'));if(_0xc65239[_0xa639('0x5c')]==='user'){var _0x3fd825=_0x36c5e4[_0xa639('0x5a')]({'plain':!![]});return db[_0xa639('0x6b')]['find']({'where':{'name':'Trunks','userProfileId':_0xc65239[_0xa639('0x6c')]},'raw':!![]})['then'](function(_0x55c75b){if(_0x55c75b&&_0x55c75b[_0xa639('0x5e')]===0x0){return db[_0xa639('0x5f')]['create']({'name':_0x3fd825[_0xa639('0x34')],'resourceId':_0x3fd825['id'],'type':_0x55c75b['name'],'sectionId':_0x55c75b['id']},{})[_0xa639('0x1d')](function(){return _0x36c5e4;});}else{return _0x36c5e4;}})[_0xa639('0x26')](function(_0x568166){logger[_0xa639('0x22')](_0xa639('0x6d'),_0x568166);throw _0x568166;});}return _0x36c5e4;})[_0xa639('0x1d')](respondWithResult(_0x4c8931,0xc9))['catch'](handleError(_0x4c8931,null));};exports[_0xa639('0x30')]=function(_0x29ed1f,_0x3dfe17,_0x874eb7){var _0x40aaa7;return db[_0xa639('0x37')][_0xa639('0x53')]({'where':{'id':_0x29ed1f[_0xa639('0x52')]['id']}})[_0xa639('0x1d')](handleEntityNotFound(_0x3dfe17,null))[_0xa639('0x1d')](saveUpdates(_0x29ed1f[_0xa639('0x58')],null))['then'](function(_0xe28fee){if(_0xe28fee){_0x40aaa7=_0xe28fee;return db[_0xa639('0x37')][_0xa639('0x50')]({'raw':!![]});}})[_0xa639('0x1d')](function(_0x3ab63d){if(_0x3ab63d){var _0x418ecc=fs[_0xa639('0x60')](path[_0xa639('0x61')](config[_0xa639('0x62')],_0xa639('0x6e')),'utf8');var _0x233043=fs[_0xa639('0x60')](path['join'](config['root'],_0xa639('0x63')),_0xa639('0x64'));var _0x4876d3=ejs['render'](_0x418ecc,{'trunks':_0x3ab63d||[]});fs[_0xa639('0x67')](_0xa639('0x6f'),_0x4876d3);var _0x3353c6=ejs[_0xa639('0x65')](_0x233043,{'trunks':_0x3ab63d||[]});fs['writeFileSync'](_0xa639('0x68'),_0x3353c6);return respondWithRpcPromise('Reload',_0xa639('0x30'),{'module':_0xa639('0x6a')});}return null;})[_0xa639('0x1d')](function(_0x497164){if(_0x497164){return _0x40aaa7;}})[_0xa639('0x1d')](respondWithResult(_0x3dfe17,null))[_0xa639('0x26')](handleError(_0x3dfe17,null));};exports[_0xa639('0x32')]=function(_0x2307a1,_0x3df387,_0x34c074){var _0x59282d;return db['Trunk'][_0xa639('0x53')]({'where':{'id':_0x2307a1[_0xa639('0x52')]['id']}})[_0xa639('0x1d')](handleEntityNotFound(_0x3df387,null))[_0xa639('0x1d')](removeEntity(_0x3df387,null))['then'](function(){return db['Trunk'][_0xa639('0x50')]({'raw':!![]});})['then'](function(_0x49c573){var _0x55e234=fs[_0xa639('0x60')](path[_0xa639('0x61')](config['root'],_0xa639('0x6e')),_0xa639('0x64'));var _0x399e4e=fs[_0xa639('0x60')](path[_0xa639('0x61')](config[_0xa639('0x62')],_0xa639('0x63')),_0xa639('0x64'));var _0x205fa9=ejs[_0xa639('0x65')](_0x55e234,{'trunks':_0x49c573});var _0x33aa7f=ejs['render'](_0x399e4e,{'trunks':_0x49c573});fs[_0xa639('0x67')](_0xa639('0x6f'),_0x205fa9);fs[_0xa639('0x67')](_0xa639('0x68'),_0x33aa7f);return respondWithRpcPromise(_0xa639('0x69'),_0xa639('0x32'),{'module':_0xa639('0x6a')});})['catch'](handleError(_0x3df387,null));}; \ No newline at end of file +var _0xec9c=['/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','render','writeFileSync'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xec9c,0x77));var _0xcec9=function(_0x1535d6,_0x285855){_0x1535d6=_0x1535d6-0x0;var _0x5d1b53=_0xec9c[_0x1535d6];return _0x5d1b53;};'use strict';var pdf=require(_0xcec9('0x0'));var emlformat=require(_0xcec9('0x1'));var rimraf=require(_0xcec9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcec9('0x3'));var rp=require(_0xcec9('0x4'));var moment=require(_0xcec9('0x5'));var BPromise=require(_0xcec9('0x6'));var Mustache=require(_0xcec9('0x7'));var util=require(_0xcec9('0x8'));var path=require('path');var sox=require(_0xcec9('0x9'));var csv=require(_0xcec9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcec9('0xb'));var crypto=require('crypto');var jsforce=require(_0xcec9('0xc'));var deskjs=require(_0xcec9('0xd'));var toCsv=require(_0xcec9('0xa'));var querystring=require('querystring');var Papa=require(_0xcec9('0xe'));var Redis=require('ioredis');var authService=require(_0xcec9('0xf'));var qs=require(_0xcec9('0x10'));var as=require(_0xcec9('0x11'));var hardwareService=require(_0xcec9('0x12'));var logger=require('../../config/logger')(_0xcec9('0x13'));var utils=require('../../config/utils');var config=require(_0xcec9('0x14'));var db=require(_0xcec9('0x15'))['db'];var jayson=require(_0xcec9('0x16'));var client=jayson[_0xcec9('0x17')][_0xcec9('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5484c5,_0x3eb51b,_0x159d56){if(_0x159d56){var _0x1cae25=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cae25['test'](_0x3eb51b)){return _0x5484c5;}else{throw new db['Sequelize'][(_0xcec9('0x19'))](_0xcec9('0x1a'));}}else{return _0x5484c5;}}function respondWithRpcPromise(_0x11c72d,_0x2db9a0,_0x223cf4,_0x5001f1){return new BPromise(function(_0x40ff36,_0x28e2f7){var _0x33b274=_0x5001f1||client;return _0x33b274[_0xcec9('0x1b')](_0x11c72d,_0x223cf4)['then'](function(_0x599470){logger[_0xcec9('0x1c')](_0xcec9('0x1d'),_0x2db9a0,'request\x20sent');logger[_0xcec9('0x1e')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2db9a0,_0xcec9('0x1f'),JSON[_0xcec9('0x20')](_0x599470));if(_0x599470[_0xcec9('0x21')]){if(_0x599470['error'][_0xcec9('0x22')]===0x1f4){logger[_0xcec9('0x21')](_0xcec9('0x1d'),_0x2db9a0,_0x599470[_0xcec9('0x21')]['message']);return _0x28e2f7(_0x599470[_0xcec9('0x21')][_0xcec9('0x23')]);}logger[_0xcec9('0x21')]('Trunk,\x20%s,\x20%s',_0x2db9a0,_0x599470[_0xcec9('0x21')][_0xcec9('0x23')]);return _0x40ff36(_0x599470[_0xcec9('0x21')][_0xcec9('0x23')]);}else{logger[_0xcec9('0x1c')](_0xcec9('0x1d'),_0x2db9a0,_0xcec9('0x1f'));_0x40ff36(_0x599470[_0xcec9('0x24')][_0xcec9('0x23')]);}})[_0xcec9('0x25')](function(_0x2c52c5){logger[_0xcec9('0x21')](_0xcec9('0x1d'),_0x2db9a0,_0x2c52c5);_0x28e2f7(_0x2c52c5);});});}function respondWithStatusCode(_0xc7b9a9,_0x3b6711){_0x3b6711=_0x3b6711||0xcc;return function(_0x6de91f){if(_0x6de91f){return _0xc7b9a9[_0xcec9('0x26')](_0x3b6711);}return _0xc7b9a9[_0xcec9('0x27')](_0x3b6711)[_0xcec9('0x28')]();};}function respondWithResult(_0x3fb3c7,_0x268a9b){_0x268a9b=_0x268a9b||0xc8;return function(_0x26a4d3){if(_0x26a4d3){return _0x3fb3c7[_0xcec9('0x27')](_0x268a9b)[_0xcec9('0x29')](_0x26a4d3);}};}function respondWithFilteredResult(_0x3eb55d,_0x26a52e){return function(_0x4511f9){if(_0x4511f9){var _0x1fc4c2=_0x4511f9[_0xcec9('0x2a')],_0x28857d=_0x26a52e[_0xcec9('0x2b')],_0x41e052=_0x26a52e['offset']+_0x26a52e[_0xcec9('0x2c')],_0x4c755f;if(_0x41e052>=_0x1fc4c2){_0x41e052=_0x1fc4c2;_0x4c755f=0xc8;}else{_0x4c755f=0xce;}_0x3eb55d['status'](_0x4c755f);return _0x3eb55d[_0xcec9('0x2d')](_0xcec9('0x2e'),_0x28857d+'-'+_0x41e052+'/'+_0x1fc4c2)['json'](_0x4511f9);}return null;};}function patchUpdates(_0x24cb48){return function(_0x545c7c){try{jsonpatch[_0xcec9('0x2f')](_0x545c7c,_0x24cb48,!![]);}catch(_0x348396){return BPromise[_0xcec9('0x30')](_0x348396);}return _0x545c7c[_0xcec9('0x31')]();};}function saveUpdates(_0x57f51c,_0x343701){return function(_0x597d38){if(_0x597d38){return _0x597d38[_0xcec9('0x32')](_0x57f51c)[_0xcec9('0x33')](function(_0x19232a){return _0x19232a;});}return null;};}function removeEntity(_0xf2bfda,_0x1a17d8){return function(_0x109825){if(_0x109825){return _0x109825[_0xcec9('0x34')]()['then'](function(){var _0x58ee89=_0x109825[_0xcec9('0x35')]({'plain':!![]});var _0x352d46=_0xcec9('0x36');return db[_0xcec9('0x37')][_0xcec9('0x34')]({'where':{'type':_0x352d46,'resourceId':_0x58ee89['id']}})[_0xcec9('0x33')](function(){return _0x109825;});})[_0xcec9('0x33')](function(){_0xf2bfda[_0xcec9('0x27')](0xcc)[_0xcec9('0x28')]();});}};}function handleEntityNotFound(_0x20aefb,_0x4ea319){return function(_0x5aeb39){if(!_0x5aeb39){_0x20aefb['sendStatus'](0x194);}return _0x5aeb39;};}function handleError(_0x355a19,_0x20f56d){_0x20f56d=_0x20f56d||0x1f4;return function(_0x4dfd4){logger[_0xcec9('0x21')](_0x4dfd4[_0xcec9('0x38')]);if(_0x4dfd4[_0xcec9('0x39')]){delete _0x4dfd4[_0xcec9('0x39')];}_0x355a19[_0xcec9('0x27')](_0x20f56d)[_0xcec9('0x3a')](_0x4dfd4);};}exports[_0xcec9('0x3b')]=function(_0x24aacd,_0x1c82fb){var _0xc71926={},_0x3cd411={},_0x494729={'count':0x0,'rows':[]};var _0x3ac8f1=_[_0xcec9('0x3c')](db[_0xcec9('0x3d')][_0xcec9('0x3e')],function(_0x5a435b){return{'name':_0x5a435b[_0xcec9('0x3f')],'type':_0x5a435b[_0xcec9('0x40')][_0xcec9('0x41')]};});_0x3cd411[_0xcec9('0x42')]=_[_0xcec9('0x3c')](_0x3ac8f1,_0xcec9('0x39'));_0x3cd411[_0xcec9('0x43')]=_[_0xcec9('0x44')](_0x24aacd[_0xcec9('0x43')]);_0x3cd411[_0xcec9('0x45')]=_[_0xcec9('0x46')](_0x3cd411[_0xcec9('0x42')],_0x3cd411[_0xcec9('0x43')]);_0xc71926['attributes']=_[_0xcec9('0x46')](_0x3cd411[_0xcec9('0x42')],qs[_0xcec9('0x47')](_0x24aacd['query'][_0xcec9('0x47')]));_0xc71926[_0xcec9('0x48')]=_0xc71926[_0xcec9('0x48')][_0xcec9('0x49')]?_0xc71926[_0xcec9('0x48')]:_0x3cd411[_0xcec9('0x42')];if(!_0x24aacd[_0xcec9('0x43')][_0xcec9('0x4a')](_0xcec9('0x4b'))){_0xc71926['limit']=qs[_0xcec9('0x2c')](_0x24aacd[_0xcec9('0x43')]['limit']);_0xc71926['offset']=qs[_0xcec9('0x2b')](_0x24aacd[_0xcec9('0x43')][_0xcec9('0x2b')]);}_0xc71926[_0xcec9('0x4c')]=qs[_0xcec9('0x4d')](_0x24aacd[_0xcec9('0x43')][_0xcec9('0x4d')]);_0xc71926[_0xcec9('0x4e')]=qs[_0xcec9('0x45')](_[_0xcec9('0x4f')](_0x24aacd[_0xcec9('0x43')],_0x3cd411[_0xcec9('0x45')]));if(_0x24aacd[_0xcec9('0x43')][_0xcec9('0x50')]){_0xc71926[_0xcec9('0x4e')]=_[_0xcec9('0x51')](_0xc71926[_0xcec9('0x4e')],{'$or':_[_0xcec9('0x3c')](_0x3ac8f1,function(_0xd90a1b){if(_0xd90a1b['type']!==_0xcec9('0x52')){var _0x35e7ba={};_0x35e7ba[_0xd90a1b['name']]={'$like':'%'+_0x24aacd[_0xcec9('0x43')]['filter']+'%'};return _0x35e7ba;}})});}_0xc71926=_['merge']({},_0xc71926,_0x24aacd['options']);var _0x3e343b={'where':_0xc71926['where']};return db[_0xcec9('0x3d')][_0xcec9('0x2a')](_0x3e343b)[_0xcec9('0x33')](function(_0x33e0d3){_0x494729[_0xcec9('0x2a')]=_0x33e0d3;if(_0x24aacd[_0xcec9('0x43')][_0xcec9('0x53')]){_0xc71926['include']=[{'all':!![]}];}return db[_0xcec9('0x3d')][_0xcec9('0x54')](_0xc71926);})[_0xcec9('0x33')](function(_0x33d827){_0x494729[_0xcec9('0x55')]=_0x33d827;return _0x494729;})[_0xcec9('0x33')](respondWithFilteredResult(_0x1c82fb,_0xc71926))[_0xcec9('0x25')](handleError(_0x1c82fb,null));};exports['show']=function(_0x846669,_0xa3de92){var _0xff51b8={'raw':![],'where':{'id':_0x846669[_0xcec9('0x56')]['id']}},_0xf3137f={};_0xf3137f[_0xcec9('0x42')]=_['keys'](db[_0xcec9('0x3d')][_0xcec9('0x3e')]);_0xf3137f['query']=_['keys'](_0x846669[_0xcec9('0x43')]);_0xf3137f['filters']=_[_0xcec9('0x46')](_0xf3137f['model'],_0xf3137f['query']);_0xff51b8[_0xcec9('0x48')]=_['intersection'](_0xf3137f[_0xcec9('0x42')],qs[_0xcec9('0x47')](_0x846669[_0xcec9('0x43')][_0xcec9('0x47')]));_0xff51b8[_0xcec9('0x48')]=_0xff51b8[_0xcec9('0x48')][_0xcec9('0x49')]?_0xff51b8[_0xcec9('0x48')]:_0xf3137f[_0xcec9('0x42')];if(_0x846669['query'][_0xcec9('0x53')]){_0xff51b8[_0xcec9('0x57')]=[{'all':!![]}];}_0xff51b8=_[_0xcec9('0x51')]({},_0xff51b8,_0x846669[_0xcec9('0x58')]);return db[_0xcec9('0x3d')][_0xcec9('0x59')](_0xff51b8)[_0xcec9('0x33')](handleEntityNotFound(_0xa3de92,null))[_0xcec9('0x33')](respondWithResult(_0xa3de92,null))['catch'](handleError(_0xa3de92,null));};exports['clone']=function(_0x1637ec,_0x2ee88a){var _0x27dc77={'where':{'id':_0x1637ec[_0xcec9('0x56')]['id']}},_0x3b2522={};_0x3b2522[_0xcec9('0x42')]=_[_0xcec9('0x44')](db['Trunk'][_0xcec9('0x3e')]);_0x27dc77[_0xcec9('0x48')]=_[_0xcec9('0x46')](_0x3b2522[_0xcec9('0x42')],qs[_0xcec9('0x47')](_0x1637ec['query'][_0xcec9('0x47')]));_0x27dc77[_0xcec9('0x48')]=_0x27dc77[_0xcec9('0x48')]['length']?_0x27dc77[_0xcec9('0x48')]:_0x3b2522[_0xcec9('0x42')];if(_0x1637ec[_0xcec9('0x43')]['includeAll']){_0x27dc77[_0xcec9('0x57')]=[{'all':!![]}];}_0x27dc77=_[_0xcec9('0x51')]({},_0x27dc77,_0x1637ec[_0xcec9('0x58')]);return db[_0xcec9('0x3d')]['find'](_0x27dc77)['then'](handleEntityNotFound(_0x2ee88a,null))[_0xcec9('0x33')](function(_0x23a356){if(_0x23a356){var _0x522d93=_0x23a356[_0xcec9('0x35')]({'plain':!![]});_0x522d93=qs['omit'](_0x522d93,['id',_0xcec9('0x5a'),'updatedAt']);_0x1637ec['body']=_['omit'](_0x1637ec[_0xcec9('0x5b')],['id',_0xcec9('0x5a'),_0xcec9('0x5c')]);return db[_0xcec9('0x3d')][_0xcec9('0x5d')](_[_0xcec9('0x51')](_0x522d93,_0x1637ec['body']),{'include':_0x1637ec[_0xcec9('0x43')]['includeAll']?[{'all':!![]}]:undefined})[_0xcec9('0x33')](function(_0x36758d){var _0xc5253b=_0x1637ec[_0xcec9('0x5e')][_0xcec9('0x35')]({'plain':!![]});if(!_0xc5253b)throw new Error(_0xcec9('0x5f'));if(_0xc5253b[_0xcec9('0x60')]===_0xcec9('0x5e')){var _0x5d0f81=_0x36758d[_0xcec9('0x35')]({'plain':!![]});var _0x93afb3=_0xcec9('0x36');return db[_0xcec9('0x61')][_0xcec9('0x59')]({'where':{'name':_0x93afb3,'userProfileId':_0xc5253b['userProfileId']},'raw':!![]})[_0xcec9('0x33')](function(_0x2fca79){if(_0x2fca79&&_0x2fca79[_0xcec9('0x62')]===0x0){return db[_0xcec9('0x37')][_0xcec9('0x5d')]({'name':_0x5d0f81[_0xcec9('0x39')],'resourceId':_0x5d0f81['id'],'type':_0x2fca79[_0xcec9('0x39')],'sectionId':_0x2fca79['id']},{})[_0xcec9('0x33')](function(){return _0x36758d;});}else{return _0x36758d;}})['catch'](function(_0x535604){logger[_0xcec9('0x21')](_0xcec9('0x63'),_0x535604);throw _0x535604;});}return _0x36758d;});}})['then'](respondWithResult(_0x2ee88a,0xc9))['catch'](handleError(_0x2ee88a,null));};exports[_0xcec9('0x5d')]=function(_0x56db88,_0x2c0b0a,_0x2b96db){var _0x3f8439;return db[_0xcec9('0x3d')][_0xcec9('0x5d')](_0x56db88[_0xcec9('0x5b')],{'raw':!![]})[_0xcec9('0x33')](function(_0x1356b3){_0x3f8439=_0x1356b3;return db[_0xcec9('0x3d')]['findAll']({'raw':!![]});})[_0xcec9('0x33')](function(_0x3e345b){var _0x5c3df0=fs['readFileSync'](path[_0xcec9('0x64')](config[_0xcec9('0x65')],_0xcec9('0x66')),_0xcec9('0x67'));var _0x56ae4f=fs[_0xcec9('0x68')](path[_0xcec9('0x64')](config[_0xcec9('0x65')],'server/files/templates/registry.ejs'),_0xcec9('0x67'));var _0x4f5b3e=ejs[_0xcec9('0x69')](_0x5c3df0,{'trunks':_0x3e345b||[]});fs[_0xcec9('0x6a')](_0xcec9('0x6b'),_0x4f5b3e);if(_0x3f8439[_0xcec9('0x6c')]){var _0x1aa26c=ejs[_0xcec9('0x69')](_0x56ae4f,{'trunks':_0x3e345b||[]});fs[_0xcec9('0x6a')](_0xcec9('0x6d'),_0x1aa26c);}})[_0xcec9('0x33')](function(){return respondWithRpcPromise(_0xcec9('0x6e'),_0xcec9('0x5d'),{'module':_0xcec9('0x6f')});})[_0xcec9('0x33')](function(){var _0x548ff7=_0x56db88['user'][_0xcec9('0x35')]({'plain':!![]});if(!_0x548ff7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x548ff7[_0xcec9('0x60')]===_0xcec9('0x5e')){var _0x5d165a=_0x3f8439['get']({'plain':!![]});return db[_0xcec9('0x61')][_0xcec9('0x59')]({'where':{'name':_0xcec9('0x36'),'userProfileId':_0x548ff7[_0xcec9('0x70')]},'raw':!![]})[_0xcec9('0x33')](function(_0x188c2e){if(_0x188c2e&&_0x188c2e[_0xcec9('0x62')]===0x0){return db[_0xcec9('0x37')][_0xcec9('0x5d')]({'name':_0x5d165a[_0xcec9('0x39')],'resourceId':_0x5d165a['id'],'type':_0x188c2e[_0xcec9('0x39')],'sectionId':_0x188c2e['id']},{})[_0xcec9('0x33')](function(){return _0x3f8439;});}else{return _0x3f8439;}})['catch'](function(_0x52b3ca){logger[_0xcec9('0x21')](_0xcec9('0x63'),_0x52b3ca);throw _0x52b3ca;});}return _0x3f8439;})[_0xcec9('0x33')](respondWithResult(_0x2c0b0a,0xc9))['catch'](handleError(_0x2c0b0a,null));};exports['update']=function(_0x30c3d4,_0x528224,_0x40961e){var _0x56143a;return db[_0xcec9('0x3d')][_0xcec9('0x59')]({'where':{'id':_0x30c3d4[_0xcec9('0x56')]['id']}})[_0xcec9('0x33')](handleEntityNotFound(_0x528224,null))[_0xcec9('0x33')](saveUpdates(_0x30c3d4['body'],null))[_0xcec9('0x33')](function(_0x477e1e){if(_0x477e1e){_0x56143a=_0x477e1e;return db[_0xcec9('0x3d')]['findAll']({'raw':!![]});}})[_0xcec9('0x33')](function(_0x30d2d2){if(_0x30d2d2){var _0x4b550f=fs['readFileSync'](path[_0xcec9('0x64')](config[_0xcec9('0x65')],'server/files/templates/trunk.ejs'),_0xcec9('0x67'));var _0x4863e6=fs[_0xcec9('0x68')](path[_0xcec9('0x64')](config[_0xcec9('0x65')],'server/files/templates/registry.ejs'),_0xcec9('0x67'));var _0x171fac=ejs[_0xcec9('0x69')](_0x4b550f,{'trunks':_0x30d2d2||[]});fs[_0xcec9('0x6a')](_0xcec9('0x6b'),_0x171fac);var _0x322c29=ejs[_0xcec9('0x69')](_0x4863e6,{'trunks':_0x30d2d2||[]});fs['writeFileSync'](_0xcec9('0x6d'),_0x322c29);return respondWithRpcPromise(_0xcec9('0x6e'),_0xcec9('0x32'),{'module':_0xcec9('0x6f')});}return null;})[_0xcec9('0x33')](function(_0x5cfb5d){if(_0x5cfb5d){return _0x56143a;}})[_0xcec9('0x33')](respondWithResult(_0x528224,null))[_0xcec9('0x25')](handleError(_0x528224,null));};exports[_0xcec9('0x34')]=function(_0x2819b8,_0x9b98c2,_0x1442cf){var _0xb185b;return db[_0xcec9('0x3d')][_0xcec9('0x59')]({'where':{'id':_0x2819b8['params']['id']}})[_0xcec9('0x33')](handleEntityNotFound(_0x9b98c2,null))[_0xcec9('0x33')](removeEntity(_0x9b98c2,null))[_0xcec9('0x33')](function(){return db[_0xcec9('0x3d')][_0xcec9('0x54')]({'raw':!![]});})[_0xcec9('0x33')](function(_0xa033bb){var _0x8478e3=fs['readFileSync'](path[_0xcec9('0x64')](config[_0xcec9('0x65')],_0xcec9('0x66')),_0xcec9('0x67'));var _0x51332a=fs[_0xcec9('0x68')](path['join'](config[_0xcec9('0x65')],'server/files/templates/registry.ejs'),_0xcec9('0x67'));var _0x242529=ejs[_0xcec9('0x69')](_0x8478e3,{'trunks':_0xa033bb});var _0x225271=ejs[_0xcec9('0x69')](_0x51332a,{'trunks':_0xa033bb});fs['writeFileSync'](_0xcec9('0x6b'),_0x242529);fs[_0xcec9('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x225271);return respondWithRpcPromise(_0xcec9('0x6e'),_0xcec9('0x34'),{'module':'chan_sip.so'});})['catch'](handleError(_0x9b98c2,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 6513943..37ccb51 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 _0x1f9d=['path','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','api','moment','request-promise'];(function(_0x4c7c4a,_0x520920){var _0x4d78ae=function(_0x3bcee0){while(--_0x3bcee0){_0x4c7c4a['push'](_0x4c7c4a['shift']());}};_0x4d78ae(++_0x520920);}(_0x1f9d,0x15a));var _0xd1f9=function(_0x3f4d0d,_0x4ac6b3){_0x3f4d0d=_0x3f4d0d-0x0;var _0x1988b3=_0x1f9d[_0x3f4d0d];return _0x1988b3;};'use strict';var _=require(_0xd1f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd1f9('0x1'));var moment=require(_0xd1f9('0x2'));var BPromise=require('bluebird');var rp=require(_0xd1f9('0x3'));var fs=require('fs');var path=require(_0xd1f9('0x4'));var rimraf=require('rimraf');var config=require(_0xd1f9('0x5'));var attributes=require(_0xd1f9('0x6'));module[_0xd1f9('0x7')]=function(_0x40e7ab,_0x3dc190){return _0x40e7ab[_0xd1f9('0x8')](_0xd1f9('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6fe=['define','Trunk','tools_trunks','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x8550ba,_0x57c10d){var _0x432399=function(_0x33ab8a){while(--_0x33ab8a){_0x8550ba['push'](_0x8550ba['shift']());}};_0x432399(++_0x57c10d);}(_0xb6fe,0x1d1));var _0xeb6f=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xb6fe[_0x4dab14];return _0xf41aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb6f('0x0'))('api');var moment=require(_0xeb6f('0x1'));var BPromise=require('bluebird');var rp=require(_0xeb6f('0x2'));var fs=require('fs');var path=require(_0xeb6f('0x3'));var rimraf=require(_0xeb6f('0x4'));var config=require(_0xeb6f('0x5'));var attributes=require(_0xeb6f('0x6'));module[_0xeb6f('0x7')]=function(_0x340fd2,_0x386ead){return _0x340fd2[_0xeb6f('0x8')](_0xeb6f('0x9'),attributes,{'tableName':_0xeb6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index cc74ae8..10bc612 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 _0xda2d=['../../config/environment','jayson/promise','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrunk','Trunk','findAll','options','raw','attributes','include','map','model','catch','find','where','ShowTrunk','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x399aac,_0x162856){var _0x2b902e=function(_0x5a7115){while(--_0x5a7115){_0x399aac['push'](_0x399aac['shift']());}};_0x2b902e(++_0x162856);}(_0xda2d,0x102));var _0xdda2=function(_0x57eac9,_0x33cb6a){_0x57eac9=_0x57eac9-0x0;var _0xf7c26f=_0xda2d[_0x57eac9];return _0xf7c26f;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Trunk,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')]({'raw':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')][_0xdda2('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['where']||null:null,'attributes':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x19')]||null:null,'limit':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35[_0xdda2('0x17')]['limit']||null:null,'include':_0x1a3b35[_0xdda2('0x17')]?_0x1a3b35['options'][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x1a3b35['options'][_0xdda2('0x1a')],function(_0xfda248){return{'model':db[_0xfda248[_0xdda2('0x1c')]],'as':_0xfda248['as'],'attributes':_0xfda248[_0xdda2('0x19')],'include':_0xfda248[_0xdda2('0x1a')]?_['map'](_0xfda248[_0xdda2('0x1a')],function(_0x4be5ea){return{'model':db[_0x4be5ea[_0xdda2('0x1c')]],'as':_0x4be5ea['as'],'attributes':_0x4be5ea[_0xdda2('0x19')],'include':_0x4be5ea['include']?_['map'](_0x4be5ea[_0xdda2('0x1a')],function(_0x4567e7){return{'model':db[_0x4567e7[_0xdda2('0x1c')]],'as':_0x4567e7['as'],'attributes':_0x4567e7['attributes']};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x5d26ae){logger[_0xdda2('0x12')](_0xdda2('0x14'),_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON['stringify'](_0x5d26ae));_0x2b6ee8(_0x5d26ae);})[_0xdda2('0x1d')](function(_0x255bbc){logger['error'](_0xdda2('0x14'),_0x255bbc[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x255bbc[_0xdda2('0x11')]));});});};exports['ShowTrunk']=function(_0x129eba){var _0x5e107f=this;return new Promise(function(_0x4b19b7,_0x1ca9f3){return db['Trunk'][_0xdda2('0x1e')]({'raw':_0x129eba['options']?_0x129eba['options']['raw']===undefined?!![]:![]:!![],'where':_0x129eba[_0xdda2('0x17')]?_0x129eba['options'][_0xdda2('0x1f')]||null:null,'attributes':_0x129eba['options']?_0x129eba['options']['attributes']||null:null,'include':_0x129eba[_0xdda2('0x17')]?_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x129eba[_0xdda2('0x17')][_0xdda2('0x1a')],function(_0x2bcfba){return{'model':db[_0x2bcfba[_0xdda2('0x1c')]],'as':_0x2bcfba['as'],'attributes':_0x2bcfba[_0xdda2('0x19')],'include':_0x2bcfba[_0xdda2('0x1a')]?_['map'](_0x2bcfba[_0xdda2('0x1a')],function(_0x4212da){return{'model':db[_0x4212da[_0xdda2('0x1c')]],'as':_0x4212da['as'],'attributes':_0x4212da[_0xdda2('0x19')],'include':_0x4212da[_0xdda2('0x1a')]?_[_0xdda2('0x1b')](_0x4212da[_0xdda2('0x1a')],function(_0x5835cd){return{'model':db[_0x5835cd['model']],'as':_0x5835cd['as'],'attributes':_0x5835cd[_0xdda2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdda2('0xa')](function(_0x40eb19){logger['info']('ShowTrunk',_0x129eba);logger[_0xdda2('0xd')](_0xdda2('0x20'),_0x129eba,JSON[_0xdda2('0xf')](_0x40eb19));_0x4b19b7(_0x40eb19);})[_0xdda2('0x1d')](function(_0x246001){logger['error'](_0xdda2('0x20'),_0x246001[_0xdda2('0x11')],_0x129eba);_0x1ca9f3(_0x5e107f['error'](0x1f4,_0x246001['message']));});});}; \ No newline at end of file +var _0x757a=['stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x38b92c,_0x57bb7d){var _0x54807d=function(_0xe095c5){while(--_0xe095c5){_0x38b92c['push'](_0x38b92c['shift']());}};_0x54807d(++_0x57bb7d);}(_0x757a,0xde));var _0xa757=function(_0x5f5a09,_0x18cae6){_0x5f5a09=_0x5f5a09-0x0;var _0x3d8a16=_0x757a[_0x5f5a09];return _0x3d8a16;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetTrunk',_0x4d9f58);logger['debug']('GetTrunk',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetTrunk',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0e97085..6103535 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 _0xadb5=['/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','now','single','addAvatar','/:id/logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','removeQueues','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x26beb1,_0x205a85){var _0x1c6f50=function(_0x55b150){while(--_0x55b150){_0x26beb1['push'](_0x26beb1['shift']());}};_0x1c6f50(++_0x205a85);}(_0xadb5,0xad));var _0x5adb=function(_0x49af09,_0x4f6bfd){_0x49af09=_0x49af09-0x0;var _0x1e5c13=_0xadb5[_0x49af09];return _0x1e5c13;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['get']('/:id/avatar',controller[_0x5adb('0x10')]);router[_0x5adb('0x9')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth['isAuthenticated'](),controller[_0x5adb('0x14')]);router[_0x5adb('0x9')](_0x5adb('0x15'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);router[_0x5adb('0x9')](_0x5adb('0x17'),auth['isAuthenticated'](),controller[_0x5adb('0x18')]);router['get'](_0x5adb('0x19'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x9')](_0x5adb('0x1b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x9')](_0x5adb('0x1d'),auth['isAuthenticated'](),controller[_0x5adb('0x1e')]);router['get'](_0x5adb('0x1f'),auth['isAuthenticated'](),controller[_0x5adb('0x20')]);router['get']('/:id/mail/interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x9')](_0x5adb('0x22'),auth[_0x5adb('0x7')](),controller['getSmsInteractions']);router[_0x5adb('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x5adb('0x23')]);router[_0x5adb('0x9')](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x25')]);router[_0x5adb('0x9')](_0x5adb('0x26'),auth['isAuthenticated'](),controller[_0x5adb('0x27')]);router[_0x5adb('0x9')](_0x5adb('0x28'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x29')]);router['get'](_0x5adb('0x2a'),auth[_0x5adb('0x7')](),controller['getVoicePrefixes']);router[_0x5adb('0x9')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller['getFaxAccounts']);router[_0x5adb('0x9')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x2d')]);router[_0x5adb('0x9')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x5adb('0x2f'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x30')]);router[_0x5adb('0x9')](_0x5adb('0x31'),auth['isAuthenticated'](),controller[_0x5adb('0x32')]);router[_0x5adb('0x9')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x34')]);router[_0x5adb('0x9')](_0x5adb('0x35'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x36')]);router[_0x5adb('0x9')]('/:id/api_key',auth[_0x5adb('0x7')](),controller['getApiKey']);router[_0x5adb('0x37')](_0x5adb('0x38'),auth['isAuthenticated'](),controller[_0x5adb('0x39')]);router[_0x5adb('0x37')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x3a')]);router[_0x5adb('0x37')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5adb('0x37')]('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x3b')]);var upload=multer({'storage':multer[_0x5adb('0x3c')]({'destination':function(_0x2da912,_0x9bdece,_0x5ece39){_0x5ece39(null,path[_0x5adb('0x3d')](config[_0x5adb('0x3e')],_0x5adb('0x3f')));},'filename':function(_0x54851b,_0x4c8870,_0x32eb69){_0x32eb69(null,util[_0x5adb('0x40')]('%s-%s',Date[_0x5adb('0x41')](),_0x4c8870['originalname']));}})});router[_0x5adb('0x37')]('/:id/avatar',upload[_0x5adb('0x42')]('file'),controller[_0x5adb('0x43')]);router[_0x5adb('0x37')]('/:id/login',auth[_0x5adb('0x7')](),controller['login']);router[_0x5adb('0x37')](_0x5adb('0x44'),auth[_0x5adb('0x7')](),controller['logout']);router[_0x5adb('0x37')](_0x5adb('0x45'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x46')]);router[_0x5adb('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x47')]);router[_0x5adb('0x37')](_0x5adb('0x48'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x49')]);router[_0x5adb('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5adb('0x4a')]);router['post'](_0x5adb('0x4b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x4c')]);router[_0x5adb('0x37')](_0x5adb('0x4d'),auth['isAuthenticated'](),controller[_0x5adb('0x4e')]);router[_0x5adb('0x37')]('/:id/openchannel_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x4f')]);router['post'](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x50')]);router[_0x5adb('0x37')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x51')]);router['post']('/:id/openchannel_accounts',auth[_0x5adb('0x7')](),controller[_0x5adb('0x52')]);router[_0x5adb('0x37')](_0x5adb('0x2f'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x5adb('0x37')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x53')]);router[_0x5adb('0x37')]('/:id/square_projects',auth[_0x5adb('0x7')](),controller[_0x5adb('0x54')]);router['post'](_0x5adb('0x55'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x56')]);router[_0x5adb('0x57')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x58')]);router[_0x5adb('0x57')]('/:id/password',auth[_0x5adb('0x7')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x59')]);router[_0x5adb('0x5a')]('/:id/teams',auth[_0x5adb('0x7')](),controller['removeTeams']);router[_0x5adb('0x5a')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller['destroy']);router[_0x5adb('0x5a')]('/:id/chat_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x5b')]);router['delete'](_0x5adb('0x5c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x5d')]);router[_0x5adb('0x5a')](_0x5adb('0x4b'),auth['isAuthenticated'](),controller[_0x5adb('0x5e')]);router[_0x5adb('0x5a')](_0x5adb('0x4d'),auth[_0x5adb('0x7')](),controller['removeSmsInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x5f'),auth[_0x5adb('0x7')](),controller['removeOpenchannelInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x60')]);router['delete'](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x61')]);router[_0x5adb('0x5a')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller[_0x5adb('0x62')]);router['delete'](_0x5adb('0x2f'),auth['isAuthenticated'](),controller[_0x5adb('0x63')]);router[_0x5adb('0x5a')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller['removeChatWebsites']);router[_0x5adb('0x5a')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x5adb('0x7')](),controller[_0x5adb('0x64')]);module[_0x5adb('0x65')]=router; \ No newline at end of file +var _0xdb28=['/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','/:id','update','put','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','describe','get','/whoami','whoami','show','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getScheduledCalls','getApiKey','post','bulkCreate','/:id/contacts','addContacts','create','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','login'];(function(_0xba26ab,_0x128b35){var _0x2a46ca=function(_0x32d325){while(--_0x32d325){_0xba26ab['push'](_0xba26ab['shift']());}};_0x2a46ca(++_0x128b35);}(_0xdb28,0x106));var _0x8db2=function(_0x59c313,_0x4ca06a){_0x59c313=_0x59c313-0x0;var _0x54322a=_0xdb28[_0x59c313];return _0x54322a;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0xc')]('/:id/avatar',controller[_0x8db2('0x10')]);router[_0x8db2('0xc')]('/:id/contacts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x11')]);router[_0x8db2('0xc')](_0x8db2('0x12'),auth[_0x8db2('0x9')](),controller['getQueues']);router['get'](_0x8db2('0x13'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x14')]);router[_0x8db2('0xc')](_0x8db2('0x15'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x16')]);router[_0x8db2('0xc')](_0x8db2('0x17'),auth[_0x8db2('0x9')](),controller['getRecordings']);router[_0x8db2('0xc')](_0x8db2('0x18'),auth['isAuthenticated'](),controller[_0x8db2('0x19')]);router[_0x8db2('0xc')](_0x8db2('0x1a'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1b')]);router[_0x8db2('0xc')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8db2('0x1c')]);router[_0x8db2('0xc')](_0x8db2('0x1d'),auth[_0x8db2('0x9')](),controller['getMailInteractions']);router[_0x8db2('0xc')](_0x8db2('0x1e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0xc')]('/:id/fax/interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x20')]);router[_0x8db2('0xc')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x22')]);router[_0x8db2('0xc')]('/:id/lists',auth[_0x8db2('0x9')](),controller['getLists']);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);router[_0x8db2('0xc')](_0x8db2('0x24'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x25')]);router[_0x8db2('0xc')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x26')]);router[_0x8db2('0xc')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x28')]);router[_0x8db2('0xc')](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2a')]);router[_0x8db2('0xc')](_0x8db2('0x2b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2c')]);router['get'](_0x8db2('0x2d'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x8db2('0xc')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller['getSquareProjects']);router[_0x8db2('0xc')]('/:id/scheduled_calls',auth[_0x8db2('0x9')](),controller[_0x8db2('0x2f')]);router[_0x8db2('0xc')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8db2('0x30')]);router[_0x8db2('0x31')]('/create_many',auth['isAuthenticated'](),controller[_0x8db2('0x32')]);router[_0x8db2('0x31')](_0x8db2('0x33'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x34')]);router[_0x8db2('0x31')]('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0x35')]);router[_0x8db2('0x31')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x36')]);var upload=multer({'storage':multer[_0x8db2('0x37')]({'destination':function(_0x5d2a5b,_0x41594c,_0x3ca80b){_0x3ca80b(null,path['join'](config['root'],_0x8db2('0x38')));},'filename':function(_0x4a45dd,_0x3dfbaa,_0x264696){_0x264696(null,util[_0x8db2('0x39')](_0x8db2('0x3a'),Date['now'](),_0x3dfbaa[_0x8db2('0x3b')]));}})});router['post'](_0x8db2('0x3c'),upload[_0x8db2('0x3d')](_0x8db2('0x3e')),controller[_0x8db2('0x3f')]);router['post']('/:id/login',auth[_0x8db2('0x9')](),controller[_0x8db2('0x40')]);router['post'](_0x8db2('0x41'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x42')]);router['post'](_0x8db2('0x43'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x44')]);router[_0x8db2('0x31')](_0x8db2('0x45'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x46')]);router[_0x8db2('0x31')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x47')]);router[_0x8db2('0x31')](_0x8db2('0x48'),auth['isAuthenticated'](),controller[_0x8db2('0x49')]);router[_0x8db2('0x31')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8db2('0x4a')]);router['post'](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4c')]);router[_0x8db2('0x31')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4e')]);router['post'](_0x8db2('0x4f'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x50')]);router[_0x8db2('0x31')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x51')]);router[_0x8db2('0x31')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x52')]);router['post'](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x53')]);router['post']('/:id/sms_accounts',auth[_0x8db2('0x9')](),controller['addSmsAccounts']);router[_0x8db2('0x31')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x54')]);router[_0x8db2('0x31')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x55')]);router[_0x8db2('0x31')](_0x8db2('0x56'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x57')]);router['put'](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x59')]);router[_0x8db2('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0x8db2('0x5b')]);router[_0x8db2('0x5c')](_0x8db2('0x12'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5d')]);router[_0x8db2('0x5c')](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5e')]);router['delete']('/:id/chat_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x5f')]);router[_0x8db2('0x5c')](_0x8db2('0x60'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x61')]);router[_0x8db2('0x5c')](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x62')]);router[_0x8db2('0x5c')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x63')]);router[_0x8db2('0x5c')]('/:id/openchannel_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x64')]);router['delete'](_0x8db2('0x65'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x66')]);router['delete'](_0x8db2('0x27'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x67')]);router[_0x8db2('0x5c')](_0x8db2('0x29'),auth['isAuthenticated'](),controller[_0x8db2('0x68')]);router[_0x8db2('0x5c')](_0x8db2('0x2b'),auth['isAuthenticated'](),controller[_0x8db2('0x69')]);router[_0x8db2('0x5c')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x6a')]);router[_0x8db2('0x5c')](_0x8db2('0x2e'),auth['isAuthenticated'](),controller[_0x8db2('0x6b')]);router[_0x8db2('0x5c')]('/:id/api_key',auth[_0x8db2('0x9')](),controller[_0x8db2('0x6c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a5f87f6..e3e79b3 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 _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x3608a9,_0x2b21cc){var _0x22ecf5=function(_0x3c667e){while(--_0x3c667e){_0x3608a9['push'](_0x3608a9['shift']());}};_0x22ecf5(++_0x2b21cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x5cd1a1,_0x10da5c){var _0x5e62f0=function(_0x2d5951){while(--_0x2d5951){_0x5cd1a1['push'](_0x5cd1a1['shift']());}};_0x5e62f0(++_0x10da5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a0e508d..71dd3f1 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 _0xba38=['removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$notLike','$iLike','$notILike','$like','$any','firstName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','send','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','jayson/promise','http','Sequelize','ValidationError','request','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','role','find','name','UserProfileResource','destroy','stack','index','type','key','model','salt','query','keys','filters','intersection','attributes','fields','length','order','sort','where','VIRTUAL','sequelize','lower','col','merge','User','includeAll','include','findAll','rows','show','params','differenceBy','rawAttributes','password','bulkCreate','body','update','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','min_internal','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','102','103','110','104','105','106','109','100','111','create','VoiceMail','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','securePassword','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','penalty','spread','toLowerCase','QueueId','Queue:save','voice','VoiceQueue','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','remove','emit','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getContacts','pick','options','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','admin','Queues','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','concat','isMiddleware','logout','QueuePause','pause','updateAttributes','PAUSE','DEFAULT\x20PAUSE','unpause','faxPause','smsPause','lastPauseAt','manual','mail','chat','sms','Pause','Team','getTeams','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','getSmsQueues','Sms','getFaxQueues','Fax','Openchannel','flatten','addAgent','getDataValue','removeTeams','getMailQueues','Mail','getOpenchannelQueues','transaction','removeAgent','getLists','getAgents','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xba38,0x190));var _0x8ba3=function(_0x35ed4a,_0x2f7a40){_0x35ed4a=_0x35ed4a-0x0;var _0xcf44bd=_0xba38[_0x35ed4a];return _0xcf44bd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ba3('0x0'));var rimraf=require(_0x8ba3('0x1'));var zipdir=require(_0x8ba3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ba3('0x3'));var moment=require('moment');var BPromise=require(_0x8ba3('0x4'));var Mustache=require(_0x8ba3('0x5'));var util=require(_0x8ba3('0x6'));var path=require(_0x8ba3('0x7'));var sox=require(_0x8ba3('0x8'));var csv=require(_0x8ba3('0x9'));var ejs=require(_0x8ba3('0xa'));var fs=require('fs');var _=require(_0x8ba3('0xb'));var squel=require(_0x8ba3('0xc'));var crypto=require(_0x8ba3('0xd'));var jsforce=require(_0x8ba3('0xe'));var deskjs=require(_0x8ba3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8ba3('0x10'));var Papa=require(_0x8ba3('0x11'));var Redis=require('ioredis');var authService=require(_0x8ba3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8ba3('0x13'));var hardwareService=require(_0x8ba3('0x14'));var logger=require(_0x8ba3('0x15'))(_0x8ba3('0x16'));var utils=require(_0x8ba3('0x17'));var config=require(_0x8ba3('0x18'));var db=require(_0x8ba3('0x19'))['db'];config[_0x8ba3('0x1a')]=_[_0x8ba3('0x1b')](config['redis'],{'host':_0x8ba3('0x1c'),'port':0x18eb});var socket=require(_0x8ba3('0x1d'))(new Redis(config['redis']));require(_0x8ba3('0x1e'))['register'](socket);var jayson=require(_0x8ba3('0x1f'));var client=jayson['client'][_0x8ba3('0x20')]({'port':0x232a});function checkPasswordPattern(_0x167e86,_0x57f76d,_0x2842b9){if(_0x2842b9){var _0x417960=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x417960['test'](_0x57f76d)){return _0x167e86;}else{throw new db[(_0x8ba3('0x21'))][(_0x8ba3('0x22'))]('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 _0x167e86;}}function respondWithRpcPromise(_0x5b7583,_0x47020f,_0x4e8bd6,_0x5a8f04){return new BPromise(function(_0x2e2ed7,_0x563d61){var _0x4c34c0=_0x5a8f04||client;return _0x4c34c0[_0x8ba3('0x23')](_0x5b7583,_0x4e8bd6)['then'](function(_0x118c50){logger['info'](_0x8ba3('0x24'),_0x47020f,_0x8ba3('0x25'));logger[_0x8ba3('0x26')]('User,\x20%s,\x20%s,\x20%s',_0x47020f,_0x8ba3('0x25'),JSON[_0x8ba3('0x27')](_0x118c50));if(_0x118c50[_0x8ba3('0x28')]){if(_0x118c50[_0x8ba3('0x28')][_0x8ba3('0x29')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x47020f,_0x118c50[_0x8ba3('0x28')][_0x8ba3('0x2a')]);return _0x563d61(_0x118c50[_0x8ba3('0x28')][_0x8ba3('0x2a')]);}logger['error']('User,\x20%s,\x20%s',_0x47020f,_0x118c50[_0x8ba3('0x28')][_0x8ba3('0x2a')]);return _0x2e2ed7(_0x118c50[_0x8ba3('0x28')][_0x8ba3('0x2a')]);}else{logger['info'](_0x8ba3('0x24'),_0x47020f,'request\x20sent');_0x2e2ed7(_0x118c50[_0x8ba3('0x2b')][_0x8ba3('0x2a')]);}})[_0x8ba3('0x2c')](function(_0x8b2237){logger[_0x8ba3('0x28')](_0x8ba3('0x24'),_0x47020f,_0x8b2237);_0x563d61(_0x8b2237);});});}function respondWithStatusCode(_0x14e1df,_0x41b482){_0x41b482=_0x41b482||0xcc;return function(_0x2ffd77){if(_0x2ffd77){return _0x14e1df[_0x8ba3('0x2d')](_0x41b482);}return _0x14e1df[_0x8ba3('0x2e')](_0x41b482)[_0x8ba3('0x2f')]();};}function respondWithResult(_0x16d189,_0x2df77c){_0x2df77c=_0x2df77c||0xc8;return function(_0x309a89){if(_0x309a89){return _0x16d189[_0x8ba3('0x2e')](_0x2df77c)[_0x8ba3('0x30')](_0x309a89);}};}function respondWithFilteredResult(_0x4570d3,_0x595f3b){return function(_0x205b97){if(_0x205b97){var _0x42ceeb=_0x205b97[_0x8ba3('0x31')],_0x4f3b2b=_0x595f3b[_0x8ba3('0x32')],_0x52e795=_0x595f3b[_0x8ba3('0x32')]+_0x595f3b[_0x8ba3('0x33')],_0xd6bc23;if(_0x52e795>=_0x42ceeb){_0x52e795=_0x42ceeb;_0xd6bc23=0xc8;}else{_0xd6bc23=0xce;}_0x4570d3[_0x8ba3('0x2e')](_0xd6bc23);return _0x4570d3[_0x8ba3('0x34')](_0x8ba3('0x35'),_0x4f3b2b+'-'+_0x52e795+'/'+_0x42ceeb)[_0x8ba3('0x30')](_0x205b97);}return null;};}function patchUpdates(_0x5a0e65){return function(_0x4ed17){try{jsonpatch[_0x8ba3('0x36')](_0x4ed17,_0x5a0e65,!![]);}catch(_0x174f4f){return BPromise[_0x8ba3('0x37')](_0x174f4f);}return _0x4ed17[_0x8ba3('0x38')]();};}function saveUpdates(_0xb75ffc,_0x2c77a3){return function(_0x4ab4e6){if(_0x4ab4e6){return _0x4ab4e6['update'](_0xb75ffc)[_0x8ba3('0x39')](function(_0x2d9448){return _0x2d9448;});}return null;};}function removeEntity(_0x467324,_0x46929a){return function(_0x4e4651){if(_0x4e4651){return _0x4e4651['destroy']()[_0x8ba3('0x39')](function(){var _0x5a5b34=_0x4e4651['get']({'plain':!![]});var _0x1edb0e=[{'name':'Users','value':_0x8ba3('0x3a'),'ignore':!![]},{'name':_0x8ba3('0x3b'),'value':'agent','ignore':![]},{'name':_0x8ba3('0x3c'),'value':_0x8ba3('0x3d'),'ignore':![]}];var _0x1e8e9c=_(_0x1edb0e)[_0x8ba3('0x3e')](_0x8ba3('0x3f'))[_0x8ba3('0x40')](_0x8ba3('0x41'))[_0x8ba3('0x41')]();if(_[_0x8ba3('0x42')](_0x1e8e9c,_0x5a5b34[_0x8ba3('0x43')])){return;}var _0x2b850a=_[_0x8ba3('0x44')](_0x1edb0e,['value',_0x5a5b34[_0x8ba3('0x43')]])[_0x8ba3('0x45')];return db[_0x8ba3('0x46')][_0x8ba3('0x47')]({'where':{'type':_0x2b850a,'resourceId':_0x5a5b34['id']}})[_0x8ba3('0x39')](function(){return _0x4e4651;});})[_0x8ba3('0x39')](function(){_0x467324[_0x8ba3('0x2e')](0xcc)[_0x8ba3('0x2f')]();});}};}function handleEntityNotFound(_0x19271a,_0xc7869e){return function(_0x376c68){if(!_0x376c68){_0x19271a[_0x8ba3('0x2d')](0x194);}return _0x376c68;};}function handleError(_0x497d1f,_0x1e0069){_0x1e0069=_0x1e0069||0x1f4;return function(_0x51d764){logger['error'](_0x51d764[_0x8ba3('0x48')]);if(_0x51d764[_0x8ba3('0x45')]){delete _0x51d764['name'];}_0x497d1f['status'](_0x1e0069)['send'](_0x51d764);};}exports[_0x8ba3('0x49')]=function(_0x5bbc2f,_0x50bfb9){var _0x22d9ee={},_0x4883b7={},_0x2c1bc4={'count':0x0,'rows':[]};var _0x125f04=_[_0x8ba3('0x40')](db['User']['rawAttributes'],function(_0x5cb74a){return{'name':_0x5cb74a['fieldName'],'type':_0x5cb74a[_0x8ba3('0x4a')][_0x8ba3('0x4b')]};});_0x4883b7[_0x8ba3('0x4c')]=_['differenceBy'](_[_0x8ba3('0x40')](_0x125f04,_0x8ba3('0x45')),['password',_0x8ba3('0x4d')]);_0x4883b7[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x5bbc2f['query']);_0x4883b7[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x4883b7[_0x8ba3('0x4c')],_0x4883b7['query']);_0x22d9ee[_0x8ba3('0x52')]=_['intersection'](_0x4883b7[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x5bbc2f[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x22d9ee[_0x8ba3('0x52')]=_0x22d9ee['attributes'][_0x8ba3('0x54')]?_0x22d9ee['attributes']:_0x4883b7[_0x8ba3('0x4c')];if(!_0x5bbc2f['query']['hasOwnProperty']('nolimit')){_0x22d9ee[_0x8ba3('0x33')]=qs['limit'](_0x5bbc2f[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x22d9ee[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x5bbc2f[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}_0x22d9ee[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x5bbc2f['query'][_0x8ba3('0x56')]);_0x22d9ee[_0x8ba3('0x57')]=qs[_0x8ba3('0x50')](_['pick'](_0x5bbc2f['query'],_0x4883b7[_0x8ba3('0x50')]));if(_0x5bbc2f[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x22d9ee[_0x8ba3('0x57')]=_['merge'](_0x22d9ee[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x125f04,function(_0x471b59){if(_0x471b59['type']!==_0x8ba3('0x58')){return db[_0x8ba3('0x59')][_0x8ba3('0x57')](db[_0x8ba3('0x59')]['fn'](_0x8ba3('0x5a'),db[_0x8ba3('0x59')][_0x8ba3('0x5b')](_0x471b59['name'])),{'$like':db[_0x8ba3('0x59')]['fn'](_0x8ba3('0x5a'),'%'+_0x5bbc2f['query'][_0x8ba3('0x3e')]+'%')});}})});}_0x22d9ee=_[_0x8ba3('0x5c')]({},_0x22d9ee,_0x5bbc2f['options']);var _0x27166b={'where':_0x22d9ee['where']};return db[_0x8ba3('0x5d')][_0x8ba3('0x31')](_0x27166b)[_0x8ba3('0x39')](function(_0x1a4281){_0x2c1bc4[_0x8ba3('0x31')]=_0x1a4281;if(_0x5bbc2f[_0x8ba3('0x4e')][_0x8ba3('0x5e')]){_0x22d9ee[_0x8ba3('0x5f')]=[{'all':!![]}];}return db[_0x8ba3('0x5d')][_0x8ba3('0x60')](_0x22d9ee);})[_0x8ba3('0x39')](function(_0x293bf5){_0x2c1bc4[_0x8ba3('0x61')]=_0x293bf5;return _0x2c1bc4;})[_0x8ba3('0x39')](respondWithFilteredResult(_0x50bfb9,_0x22d9ee))['catch'](handleError(_0x50bfb9,null));};exports[_0x8ba3('0x62')]=function(_0xd7bb77,_0x1be66f){var _0x30a0c5={'raw':![],'where':{'id':_0xd7bb77[_0x8ba3('0x63')]['id']}},_0x89eff3={};_0x89eff3['model']=_[_0x8ba3('0x64')](_[_0x8ba3('0x4f')](db[_0x8ba3('0x5d')][_0x8ba3('0x65')]),[_0x8ba3('0x66'),_0x8ba3('0x4d')]);_0x89eff3[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0xd7bb77['query']);_0x89eff3['filters']=_[_0x8ba3('0x51')](_0x89eff3['model'],_0x89eff3[_0x8ba3('0x4e')]);_0x30a0c5[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x89eff3[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0xd7bb77['query']['fields']));_0x30a0c5[_0x8ba3('0x52')]=_0x30a0c5[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x30a0c5['attributes']:_0x89eff3[_0x8ba3('0x4c')];if(_0xd7bb77[_0x8ba3('0x4e')][_0x8ba3('0x5e')]){_0x30a0c5[_0x8ba3('0x5f')]=[{'all':!![]}];}_0x30a0c5=_[_0x8ba3('0x5c')]({},_0x30a0c5,_0xd7bb77['options']);return db[_0x8ba3('0x5d')][_0x8ba3('0x44')](_0x30a0c5)[_0x8ba3('0x39')](handleEntityNotFound(_0x1be66f,null))[_0x8ba3('0x39')](respondWithResult(_0x1be66f,null))[_0x8ba3('0x2c')](handleError(_0x1be66f,null));};exports[_0x8ba3('0x67')]=function(_0x59b1bf,_0x324345){return db[_0x8ba3('0x5d')][_0x8ba3('0x67')](_0x59b1bf[_0x8ba3('0x68')],{'raw':![],'individualHooks':!![]})[_0x8ba3('0x39')](respondWithResult(_0x324345,0xc9))['catch'](handleError(_0x324345,null));};exports[_0x8ba3('0x69')]=function(_0x393aa0,_0x1c5acf){if(_0x393aa0['body']['id']){delete _0x393aa0[_0x8ba3('0x68')]['id'];}delete _0x393aa0[_0x8ba3('0x68')]['role'];return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x393aa0[_0x8ba3('0x63')]['id']}})['then'](handleEntityNotFound(_0x1c5acf,null))[_0x8ba3('0x39')](saveUpdates(_0x393aa0[_0x8ba3('0x68')],null))[_0x8ba3('0x39')](respondWithResult(_0x1c5acf,null))[_0x8ba3('0x2c')](handleError(_0x1c5acf,null));};exports['describe']=function(_0x289e9d,_0x2c32e3){return db[_0x8ba3('0x5d')][_0x8ba3('0x6a')]()[_0x8ba3('0x39')](respondWithResult(_0x2c32e3,null))[_0x8ba3('0x2c')](handleError(_0x2c32e3,null));};exports['addContacts']=function(_0x414b8b,_0x5eab9c,_0x2c29){return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x414b8b[_0x8ba3('0x63')]['id']}})['then'](handleEntityNotFound(_0x5eab9c,null))[_0x8ba3('0x39')](function(_0x9f23ad){if(_0x9f23ad){return _0x9f23ad[_0x8ba3('0x6b')](_0x414b8b[_0x8ba3('0x68')]['ids'],_['omit'](_0x414b8b['body'],[_0x8ba3('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x5eab9c,null))['catch'](handleError(_0x5eab9c,null));};var getLicense=function(_0xba2f47){return new BPromise(function(_0x324741,_0x57df33){var _0x5215c2=0x0;_0xba2f47['body']['role']===_0x8ba3('0x6d')&&_0x324741(_0x8ba3('0x6e'));return db[_0x8ba3('0x5d')][_0x8ba3('0x31')]({'where':{'$or':[{'role':_0xba2f47[_0x8ba3('0x68')][_0x8ba3('0x43')]===_0x8ba3('0x3d')?_0x8ba3('0x3d'):['admin',_0x8ba3('0x3a')]}]}})[_0x8ba3('0x39')](function(_0x38e40b){_0x5215c2=_0x38e40b;return require(_0x8ba3('0x6f'))[_0x8ba3('0x70')]();})[_0x8ba3('0x39')](function(_0x22cf9b){var _0x5ee50b=_0xba2f47[_0x8ba3('0x68')][_0x8ba3('0x43')]==='telephone'?_0x8ba3('0x71'):_0x8ba3('0x72');if(!_[_0x8ba3('0x73')](_0x22cf9b[_0x5ee50b])&&_0x5215c2>=_0x22cf9b[_0x5ee50b]){return _0x57df33({'message':_0x8ba3('0x74')});}return _0x324741(util[_0x8ba3('0x75')](_0x8ba3('0x76'),_0x5ee50b,_0x5215c2));})['catch'](function(_0x2c3932){return _0x57df33(_0x2c3932);});});};exports['create']=function(_0x2a8e9f,_0x4f773f){return getLicense(_0x2a8e9f)['then'](function(_0x43920d){if(!_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]){var _0x1b20ee;return db[_0x8ba3('0x78')][_0x8ba3('0x79')](0x1)[_0x8ba3('0x39')](function(_0x5d04be){return checkPasswordPattern(_0x5d04be,_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x66')],_0x5d04be['securePassword']);})[_0x8ba3('0x39')](function(_0x30c9cd){_0x1b20ee=_0x30c9cd[_0x8ba3('0x7a')];return db[_0x8ba3('0x5d')]['max']('internal');})[_0x8ba3('0x39')](function(_0x50b2d8){if(_['isNil'](_0x50b2d8)){if(_0x1b20ee){_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]=_0x1b20ee;}else{_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]=0x1;}}else{if(_[_0x8ba3('0x73')](_0x1b20ee)||_0x1b20ee==_0x50b2d8){_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]=_0x50b2d8+0x1;}else if(_0x1b20ee>_0x50b2d8){_0x2a8e9f[_0x8ba3('0x68')]['internal']=_0x1b20ee;}else{return db[_0x8ba3('0x59')][_0x8ba3('0x4e')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x8ba3('0x59')][_0x8ba3('0x7b')][_0x8ba3('0x7c')]})[_0x8ba3('0x39')](function(_0x35bb0b){if(_0x35bb0b&&_0x35bb0b[_0x8ba3('0x54')]){for(var _0x2158f7=0x0,_0x129c02=_0x35bb0b[_0x8ba3('0x54')];_0x2158f7<_0x129c02&&_['isNil'](_0x2a8e9f['body'][_0x8ba3('0x77')]);_0x2158f7++){if(_0x1b20ee<=_0x35bb0b[_0x2158f7]['from']){_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]=_0x35bb0b[_0x2158f7][_0x8ba3('0x7d')];}else if(_0x1b20ee>_0x35bb0b[_0x2158f7][_0x8ba3('0x7d')]&&_0x1b20ee<=_0x35bb0b[_0x2158f7]['to']){_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]=_0x1b20ee;}}}if(_[_0x8ba3('0x73')](_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')])){_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')]=_0x50b2d8+0x1;}});}}});}})[_0x8ba3('0x39')](function(){if(_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x7e')]){_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x7f')]=_0x2a8e9f[_0x8ba3('0x68')]['internal'];_0x2a8e9f[_0x8ba3('0x68')]['VoiceMail']={'mailbox':_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x77')],'password':_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x66')],'fullname':_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x80')],'email':_0x2a8e9f[_0x8ba3('0x68')][_0x8ba3('0x81')]};}if(_0x2a8e9f[_0x8ba3('0x68')]&&_0x2a8e9f[_0x8ba3('0x68')]['role']==='agent'){_0x2a8e9f['body'][_0x8ba3('0x82')]=[_0x8ba3('0x83'),_0x8ba3('0x84'),_0x8ba3('0x85'),_0x8ba3('0x86'),_0x8ba3('0x87'),_0x8ba3('0x88'),_0x8ba3('0x89'),'107','108',_0x8ba3('0x8a'),_0x8ba3('0x8b'),_0x8ba3('0x8c')];}return db[_0x8ba3('0x5d')][_0x8ba3('0x8d')](_0x2a8e9f['body'],{'include':[{'model':db[_0x8ba3('0x8e')],'as':_0x8ba3('0x8e')}]});})[_0x8ba3('0x39')](function(_0x1454c7){if(_0x2a8e9f['body'][_0x8ba3('0x43')]===_0x8ba3('0x3a'))return _0x1454c7;var _0x485a9f=_0x2a8e9f['user'][_0x8ba3('0x8f')]({'plain':!![]});if(!_0x485a9f)throw new Error(_0x8ba3('0x90'));if(_0x485a9f[_0x8ba3('0x43')]===_0x8ba3('0x3a')){var _0x498a44=_0x1454c7[_0x8ba3('0x8f')]({'plain':!![]});var _0x26e4d2=[{'name':_0x8ba3('0x3b'),'value':'agent'},{'name':_0x8ba3('0x3c'),'value':_0x8ba3('0x3d')}];var _0x11b486=_[_0x8ba3('0x44')](_0x26e4d2,['value',_0x498a44[_0x8ba3('0x43')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x11b486,'userProfileId':_0x485a9f[_0x8ba3('0x91')]},'raw':!![]})[_0x8ba3('0x39')](function(_0x2244b8){if(_0x2244b8&&_0x2244b8[_0x8ba3('0x92')]===0x0){return db['UserProfileResource'][_0x8ba3('0x8d')]({'name':_0x498a44[_0x8ba3('0x45')],'resourceId':_0x498a44['id'],'type':_0x2244b8['name'],'sectionId':_0x2244b8['id']},{})[_0x8ba3('0x39')](function(){return _0x1454c7;});}else{return _0x1454c7;}})[_0x8ba3('0x2c')](function(_0x1fd67a){logger[_0x8ba3('0x28')](_0x8ba3('0x93'),_0x1fd67a);throw _0x1fd67a;});}return _0x1454c7;})['then'](respondWithResult(_0x4f773f,0xc9))[_0x8ba3('0x2c')](handleError(_0x4f773f,null));};exports[_0x8ba3('0x94')]=function(_0x1703ac,_0x58d3f9,_0x17b840){var _0x385afa=![];if(_0x1703ac[_0x8ba3('0x68')]['id']){delete _0x1703ac['body']['id'];}return db[_0x8ba3('0x78')][_0x8ba3('0x95')]({'attributes':['id','securePassword']})[_0x8ba3('0x39')](function(_0x3c6875){_0x385afa=_0x3c6875[_0x8ba3('0x96')];return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x1703ac[_0x8ba3('0x63')]['id']}});})['then'](function(_0x18e43b){if(_0x18e43b){if(_0x18e43b['id']==_0x1703ac[_0x8ba3('0x3a')]['id']){if(!_0x1703ac['body'][_0x8ba3('0x97')]||!_0x1703ac[_0x8ba3('0x68')][_0x8ba3('0x98')]){throw new db['Sequelize'][(_0x8ba3('0x22'))](_0x8ba3('0x99'));}if(!_0x18e43b[_0x8ba3('0x9a')](_0x1703ac[_0x8ba3('0x68')][_0x8ba3('0x97')])){throw new db[(_0x8ba3('0x21'))][(_0x8ba3('0x22'))](_0x8ba3('0x9b'));}if(_0x1703ac[_0x8ba3('0x68')][_0x8ba3('0x97')]==_0x1703ac[_0x8ba3('0x68')][_0x8ba3('0x98')]){throw new db[(_0x8ba3('0x21'))]['ValidationError'](_0x8ba3('0x9c'));}return _0x18e43b;}else if(_0x1703ac[_0x8ba3('0x3a')][_0x8ba3('0x43')]=='admin'){if(!_0x1703ac[_0x8ba3('0x68')][_0x8ba3('0x98')]){throw new db[(_0x8ba3('0x21'))]['ValidationError'](_0x8ba3('0x9d'));}return _0x18e43b;}else if(_0x1703ac['user'][_0x8ba3('0x43')]==_0x8ba3('0x3a')){if(!_0x1703ac[_0x8ba3('0x68')][_0x8ba3('0x98')]){throw new db[(_0x8ba3('0x21'))]['ValidationError'](_0x8ba3('0x9d'));}if(_0x18e43b[_0x8ba3('0x43')]!='agent'){throw new db[(_0x8ba3('0x21'))]['ValidationError'](_0x8ba3('0x9e'));}return _0x18e43b;}else{throw new db['Sequelize'][(_0x8ba3('0x22'))](_0x8ba3('0x9e'));}}return null;})[_0x8ba3('0x39')](handleEntityNotFound(_0x58d3f9,null))['then'](function(_0x4373ec){return checkPasswordPattern(_0x4373ec,_0x1703ac['body'][_0x8ba3('0x98')],_0x385afa);})[_0x8ba3('0x39')](saveUpdates({'password':_0x1703ac[_0x8ba3('0x68')]['newPassword'],'passwordResetAt':_0x1703ac[_0x8ba3('0x3a')]['id']==_0x1703ac[_0x8ba3('0x63')]['id']?moment():null},null))[_0x8ba3('0x39')](respondWithResult(_0x58d3f9,null))[_0x8ba3('0x2c')](handleError(_0x58d3f9,null));};exports[_0x8ba3('0x9f')]=function(_0x4e5542,_0x29831c,_0xa3ca2){var _0x6df568=_0x4e5542[_0x8ba3('0x68')][_0x8ba3('0xa0')];return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x4e5542[_0x8ba3('0x63')]['id']},'attributes':['id',_0x8ba3('0x45'),'role',_0x8ba3('0xa1'),_0x8ba3('0xa2'),_0x8ba3('0xa3'),_0x8ba3('0xa4')]})[_0x8ba3('0x39')](handleEntityNotFound(_0x29831c,null))[_0x8ba3('0x39')](function(_0x1bf64a){if(_0x1bf64a){if(!utils[_0x8ba3('0xa5')](_0x6df568)){throw new db[(_0x8ba3('0x21'))]['ValidationError'](_0x8ba3('0xa6'));}return _0x1bf64a[_0x8ba3('0xa7')+_[_0x8ba3('0xa8')](_0x6df568['toLowerCase']())+'Queues'](_0x4e5542['body']['ids'],{'penalty':_0x4e5542[_0x8ba3('0x68')][_0x8ba3('0xa9')]||0x0})[_0x8ba3('0xaa')](function(_0x3dd586){for(var _0x2f1bdd=0x0;_0x2f1bdd<_0x4e5542[_0x8ba3('0x68')][_0x8ba3('0x6c')][_0x8ba3('0x54')];_0x2f1bdd+=0x1){var _0x1c1d4f={'UserId':_0x4e5542['params']['id']};_0x1c1d4f[_[_0x8ba3('0xa8')](_0x6df568[_0x8ba3('0xab')]())+_0x8ba3('0xac')]=_0x4e5542[_0x8ba3('0x68')][_0x8ba3('0x6c')][_0x2f1bdd];socket['emit'](_0x8ba3('0x3a')+_[_0x8ba3('0xa8')](_0x6df568[_0x8ba3('0xab')]())+_0x8ba3('0xad'),_0x1c1d4f);}return _0x3dd586;})[_0x8ba3('0x39')](function(){if(_0x6df568===_0x8ba3('0xae')){return db[_0x8ba3('0xaf')][_0x8ba3('0x60')]({'where':{'id':_0x4e5542[_0x8ba3('0x68')][_0x8ba3('0x6c')]||[]},'raw':!![],'attributes':['id',_0x8ba3('0x45')]});}})['then'](function(_0x3cda33){var _0x26c8b0=_0x1bf64a[_0x8ba3('0x8f')]({'plain':!![]});var _0x3aabf5=[];if(_0x6df568===_0x8ba3('0xae')&&_0x26c8b0[_0x8ba3('0x43')]===_0x8ba3('0x6d')&&_0x26c8b0['online']){for(var _0x4d62de=0x0;_0x4d62de<_0x3cda33[_0x8ba3('0x54')];_0x4d62de+=0x1){_0x3aabf5[_0x8ba3('0xb0')]({'membername':_0x26c8b0['name'],'UserId':_0x26c8b0['id'],'queue_name':_0x3cda33[_0x4d62de][_0x8ba3('0x45')],'VoiceQueueId':_0x3cda33[_0x4d62de]['id'],'interface':_['isNil'](_0x26c8b0[_0x8ba3('0xa4')])?util[_0x8ba3('0x75')](_0x8ba3('0xb1'),_0x26c8b0['name']):_0x26c8b0[_0x8ba3('0xa4')],'paused':_0x26c8b0[_0x8ba3('0xa3')]||![],'penalty':_0x4e5542['body'][_0x8ba3('0xa9')]||0x0});}return BPromise[_0x8ba3('0xb2')](_0x3aabf5,function(_0x3c323b){return db[_0x8ba3('0xb3')][_0x8ba3('0xb4')](_0x3c323b);});}return _0x1bf64a;});}})['then'](respondWithStatusCode(_0x29831c,null))['catch'](handleError(_0x29831c,null));};exports[_0x8ba3('0xb5')]=function(_0x85055b,_0x4d544f,_0x49672b){var _0x29d3ec;return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x85055b['params']['id']},'attributes':['id',_0x8ba3('0x45'),'role']})['then'](handleEntityNotFound(_0x4d544f,null))[_0x8ba3('0x39')](function(_0xcad955){if(_0xcad955){_0x29d3ec=_0xcad955;if(!_0x85055b[_0x8ba3('0x4e')][_0x8ba3('0xa0')]||!utils['isValidChannel'](_0x85055b[_0x8ba3('0x4e')]['channel'])){throw new db[(_0x8ba3('0x21'))][(_0x8ba3('0x22'))](_0x8ba3('0xa6'));}return _0xcad955[_0x8ba3('0xb6')+_[_0x8ba3('0xa8')](_0x85055b['query'][_0x8ba3('0xa0')][_0x8ba3('0xab')]())+'Queues'](_0x85055b['query'][_0x8ba3('0x6c')]);}})['then'](function(_0x20fb6c){for(var _0x463a79=0x0;_0x463a79<_0x85055b[_0x8ba3('0x4e')][_0x8ba3('0x6c')]['length'];_0x463a79+=0x1){var _0x421ef3={'UserId':_0x85055b[_0x8ba3('0x63')]['id']};_0x421ef3[_[_0x8ba3('0xa8')](_0x85055b[_0x8ba3('0x4e')]['channel'][_0x8ba3('0xab')]())+_0x8ba3('0xac')]=_0x85055b['query']['ids'][_0x463a79];socket[_0x8ba3('0xb7')]('user'+_['capitalize'](_0x85055b[_0x8ba3('0x4e')][_0x8ba3('0xa0')]['toLowerCase']())+_0x8ba3('0xb8'),_0x421ef3);}return _0x20fb6c;})[_0x8ba3('0x39')](function(){if(_0x85055b[_0x8ba3('0x4e')][_0x8ba3('0xa0')]===_0x8ba3('0xae')){return db['UserVoiceQueueRt'][_0x8ba3('0x47')]({'where':{'UserId':_0x85055b[_0x8ba3('0x63')]['id'],'VoiceQueueId':_0x85055b[_0x8ba3('0x4e')]['ids']},'individualHooks':!![]})[_0x8ba3('0x39')](function(){return _0x29d3ec;});}return _0x29d3ec;})[_0x8ba3('0x39')](respondWithStatusCode(_0x4d544f,null))[_0x8ba3('0x2c')](handleError(_0x4d544f,null));};exports[_0x8ba3('0xb9')]=function(_0x1e7e2c,_0x2cf198,_0xae4432){_0x1e7e2c[_0x8ba3('0x68')][_0x8ba3('0xba')]=_0x1e7e2c[_0x8ba3('0xbb')]['filename'];return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x1e7e2c[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x2cf198,null))['then'](saveUpdates(_0x1e7e2c['body'],null))[_0x8ba3('0x39')](respondWithResult(_0x2cf198,null))[_0x8ba3('0x2c')](handleError(_0x2cf198,null));};exports[_0x8ba3('0xbc')]=function(_0x336ea7,_0x2ce7c3,_0x3bef46){var _0x547b75=path[_0x8ba3('0xbd')](config[_0x8ba3('0xbe')],_0x8ba3('0xbf'));return db['User'][_0x8ba3('0x44')]({'where':{'id':_0x336ea7[_0x8ba3('0x63')]['id']},'attributes':['id',_0x8ba3('0xba')],'raw':!![]})[_0x8ba3('0x39')](handleEntityNotFound(_0x2ce7c3,null))[_0x8ba3('0x39')](function(_0x4d7455){if(_0x4d7455){if(_['isNil'](_0x4d7455[_0x8ba3('0xba')])){return _0x2ce7c3[_0x8ba3('0xc0')](_0x547b75);}else{if(!fs[_0x8ba3('0xc1')](path[_0x8ba3('0xbd')](config['root'],_0x8ba3('0xc2'),_0x4d7455[_0x8ba3('0xba')]))){return _0x2ce7c3[_0x8ba3('0xc0')](_0x547b75);}return _0x2ce7c3[_0x8ba3('0xc0')](path[_0x8ba3('0xbd')](config[_0x8ba3('0xbe')],_0x8ba3('0xc2'),_0x4d7455[_0x8ba3('0xba')]));}}})[_0x8ba3('0x2c')](handleError(_0x2ce7c3,null));};exports[_0x8ba3('0xc3')]=function(_0x6a0735,_0x52e4a2,_0x1bb50a){var _0x3dc0fe={};var _0x146603={};var _0x5c9b5f;var _0x3a52af;return db[_0x8ba3('0x5d')]['findOne']({'where':{'id':_0x6a0735[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x52e4a2,null))[_0x8ba3('0x39')](function(_0x33ae9c){if(_0x33ae9c){_0x5c9b5f=_0x33ae9c;_0x146603[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db['CmContact'][_0x8ba3('0x65')]);_0x146603[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x6a0735[_0x8ba3('0x4e')]);_0x146603[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x146603[_0x8ba3('0x4c')],_0x146603['query']);_0x3dc0fe['attributes']=_[_0x8ba3('0x51')](_0x146603[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x3dc0fe[_0x8ba3('0x52')]=_0x3dc0fe[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x3dc0fe[_0x8ba3('0x52')]:_0x146603[_0x8ba3('0x4c')];_0x3dc0fe[_0x8ba3('0x55')]=qs['sort'](_0x6a0735[_0x8ba3('0x4e')]['sort']);_0x3dc0fe['where']=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x6a0735[_0x8ba3('0x4e')],_0x146603[_0x8ba3('0x50')]));if(_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x3dc0fe['where']=_[_0x8ba3('0x5c')](_0x3dc0fe[_0x8ba3('0x57')],{'$or':_['map'](_0x3dc0fe[_0x8ba3('0x52')],function(_0x3ed66e){var _0x232a95={};_0x232a95[_0x3ed66e]={'$like':'%'+_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x232a95;})});}_0x3dc0fe=_[_0x8ba3('0x5c')]({},_0x3dc0fe,_0x6a0735[_0x8ba3('0xc5')]);return _0x5c9b5f[_0x8ba3('0xc3')](_0x3dc0fe);}})['then'](function(_0x11564b){if(_0x11564b){_0x3a52af=_0x11564b[_0x8ba3('0x54')];if(_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0xc6')]('includeAll')){_0x3dc0fe[_0x8ba3('0x5f')]=[{'model':db[_0x8ba3('0xc7')],'as':_0x8ba3('0xc8'),'required':![]},{'model':db[_0x8ba3('0xc9')],'as':_0x8ba3('0xca'),'attributes':['id',_0x8ba3('0x45'),_0x8ba3('0xcb')],'where':_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0xcc')]?{'id':_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0xcc')]}:undefined,'required':_0x6a0735[_0x8ba3('0x4e')]['tag']?!![]:![]}];}if(!_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x3dc0fe[_0x8ba3('0x33')]=qs[_0x8ba3('0x33')](_0x6a0735[_0x8ba3('0x4e')]['limit']);_0x3dc0fe[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x6a0735[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}return _0x5c9b5f[_0x8ba3('0xc3')](_0x3dc0fe);}})['then'](function(_0x3aded8){if(_0x3aded8){return _0x3aded8?{'count':_0x3a52af,'rows':_0x3aded8}:null;}})[_0x8ba3('0x39')](respondWithResult(_0x52e4a2,null))[_0x8ba3('0x2c')](handleError(_0x52e4a2,null));};exports[_0x8ba3('0xce')]=function(_0x59dd1a,_0x3abd17,_0x558c2e){var _0x27530c;var _0x4bfdec;var _0x4a8443={};var _0x3f893e;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x59dd1a['params']['id']},'attributes':['id',_0x8ba3('0x45'),_0x8ba3('0x43')]})[_0x8ba3('0x39')](handleEntityNotFound(_0x3abd17,null))[_0x8ba3('0x39')](function(_0x210608){if(!utils['isValidChannel'](_0x59dd1a[_0x8ba3('0x4e')]['channel'])){throw new db[(_0x8ba3('0x21'))]['ValidationError']('Unknown\x20channel');}_0x27530c=_0x210608;var _0x3b346b={};_0x3b346b['model']=_[_0x8ba3('0x4f')](db[_['capitalize'](_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0xa0')])+_0x8ba3('0xcf')][_0x8ba3('0x65')]);_0x3b346b[_0x8ba3('0x4e')]=_['keys'](_0x59dd1a[_0x8ba3('0x4e')]);_0x3b346b[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x3b346b[_0x8ba3('0x4c')],_0x3b346b[_0x8ba3('0x4e')]);_0x4a8443[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x3b346b[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x59dd1a[_0x8ba3('0x4e')]['fields']));_0x4a8443[_0x8ba3('0x52')]=_0x4a8443['attributes'][_0x8ba3('0x54')]?_0x4a8443[_0x8ba3('0x52')]:_0x3b346b[_0x8ba3('0x4c')];_0x4a8443[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x59dd1a['query'][_0x8ba3('0x56')]);_0x4a8443[_0x8ba3('0x57')]=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x59dd1a[_0x8ba3('0x4e')],_0x3b346b['filters']));if(_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x4a8443[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x4a8443['where'],{'$or':_[_0x8ba3('0x40')](_0x4a8443['attributes'],function(_0x4655af){var _0x341644={};_0x341644[_0x4655af]={'$like':'%'+_0x59dd1a['query'][_0x8ba3('0x3e')]+'%'};return _0x341644;})});}_0x4a8443=_[_0x8ba3('0x5c')]({},_0x4a8443,_0x59dd1a[_0x8ba3('0xc5')]);switch(_0x27530c[_0x8ba3('0x43')]){case _0x8ba3('0xd0'):return db[_[_0x8ba3('0xa8')](_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0xa0')])+_0x8ba3('0xcf')][_0x8ba3('0x60')](_0x4a8443);case _0x8ba3('0x3a'):case'agent':return _0x27530c[_0x8ba3('0x8f')+_['capitalize'](_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0xa0')])+_0x8ba3('0xd1')](_0x4a8443);default:throw new db['Sequelize']['ValidationError'](_0x8ba3('0xd2'));}})[_0x8ba3('0x39')](function(_0x2c92be){_0x3f893e=_0x2c92be[_0x8ba3('0x54')];if(!_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x4a8443['limit']=qs[_0x8ba3('0x33')](_0x59dd1a[_0x8ba3('0x4e')]['limit']);_0x4a8443['offset']=qs['offset'](_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}switch(_0x27530c[_0x8ba3('0x43')]){case _0x8ba3('0xd0'):return db[_['capitalize'](_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0xa0')])+_0x8ba3('0xcf')][_0x8ba3('0x60')](_0x4a8443);case _0x8ba3('0x3a'):case'agent':return _0x27530c[_0x8ba3('0x8f')+_[_0x8ba3('0xa8')](_0x59dd1a[_0x8ba3('0x4e')][_0x8ba3('0xa0')])+'Queues'](_0x4a8443);}})[_0x8ba3('0x39')](function(_0x88435){return{'count':_0x3f893e,'rows':_0x88435};})[_0x8ba3('0x39')](respondWithResult(_0x3abd17,null))[_0x8ba3('0x2c')](handleError(_0x3abd17,null));};exports[_0x8ba3('0xd3')]=function(_0x1db2ac,_0x4bd6f7,_0x35f083){var _0x10880b={};var _0x204fb4={};var _0x2d961f;var _0x44327a;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x1db2ac[_0x8ba3('0x63')]['id']}})['then'](handleEntityNotFound(_0x4bd6f7,null))[_0x8ba3('0x39')](function(_0x221dba){if(_0x221dba){_0x2d961f=_0x221dba;_0x204fb4[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db[_0x8ba3('0xb3')][_0x8ba3('0x65')]);_0x204fb4[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x1db2ac[_0x8ba3('0x4e')]);_0x204fb4[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x204fb4[_0x8ba3('0x4c')],_0x204fb4[_0x8ba3('0x4e')]);_0x10880b[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x204fb4[_0x8ba3('0x4c')],qs['fields'](_0x1db2ac[_0x8ba3('0x4e')]['fields']));_0x10880b[_0x8ba3('0x52')]=_0x10880b[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x10880b['attributes']:_0x204fb4[_0x8ba3('0x4c')];_0x10880b['order']=qs[_0x8ba3('0x56')](_0x1db2ac['query']['sort']);_0x10880b['where']=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x1db2ac[_0x8ba3('0x4e')],_0x204fb4['filters']));if(_0x1db2ac[_0x8ba3('0x4e')]['filter']){_0x10880b[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x10880b[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x10880b[_0x8ba3('0x52')],function(_0x544428){var _0x5c7c23={};_0x5c7c23[_0x544428]={'$like':'%'+_0x1db2ac[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x5c7c23;})});}_0x10880b=_[_0x8ba3('0x5c')]({},_0x10880b,_0x1db2ac['options']);return _0x2d961f[_0x8ba3('0xd3')](_0x10880b);}})[_0x8ba3('0x39')](function(_0x38bf40){if(_0x38bf40){_0x44327a=_0x38bf40[_0x8ba3('0x54')];if(!_0x1db2ac['query'][_0x8ba3('0xc6')]('nolimit')){_0x10880b['limit']=qs[_0x8ba3('0x33')](_0x1db2ac[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x10880b['offset']=qs['offset'](_0x1db2ac[_0x8ba3('0x4e')]['offset']);}return _0x2d961f[_0x8ba3('0xd3')](_0x10880b);}})[_0x8ba3('0x39')](function(_0x412418){if(_0x412418){return _0x412418?{'count':_0x44327a,'rows':_0x412418}:null;}})['then'](respondWithResult(_0x4bd6f7,null))[_0x8ba3('0x2c')](handleError(_0x4bd6f7,null));};exports[_0x8ba3('0xd4')]=function(_0x48705c,_0x8c1488,_0x21c5e7){var _0x5dd394={};var _0xd7912a={};var _0x1a5d0d;var _0x286522;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x48705c['params']['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x8c1488,null))[_0x8ba3('0x39')](function(_0x12b9bc){if(_0x12b9bc){_0x1a5d0d=_0x12b9bc;_0xd7912a['model']=_[_0x8ba3('0x4f')](db[_0x8ba3('0xd5')][_0x8ba3('0x65')]);_0xd7912a[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x48705c[_0x8ba3('0x4e')]);_0xd7912a[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0xd7912a[_0x8ba3('0x4c')],_0xd7912a['query']);_0x5dd394['attributes']=_[_0x8ba3('0x51')](_0xd7912a[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x5dd394[_0x8ba3('0x52')]=_0x5dd394[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x5dd394['attributes']:_0xd7912a['model'];_0x5dd394[_0x8ba3('0x55')]=qs['sort'](_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0x56')]);_0x5dd394['where']=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x48705c[_0x8ba3('0x4e')],_0xd7912a['filters']));if(_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x5dd394[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x5dd394[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x5dd394[_0x8ba3('0x52')],function(_0x22a812){var _0x4bc8dd={};_0x4bc8dd[_0x22a812]={'$like':'%'+_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x4bc8dd;})});}_0x5dd394=_[_0x8ba3('0x5c')]({},_0x5dd394,_0x48705c[_0x8ba3('0xc5')]);return _0x1a5d0d[_0x8ba3('0xd4')](_0x5dd394);}})[_0x8ba3('0x39')](function(_0x12fe92){if(_0x12fe92){_0x286522=_0x12fe92[_0x8ba3('0x54')];if(!_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x5dd394[_0x8ba3('0x33')]=qs[_0x8ba3('0x33')](_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x5dd394[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x48705c[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}return _0x1a5d0d[_0x8ba3('0xd4')](_0x5dd394);}})[_0x8ba3('0x39')](function(_0x464b81){if(_0x464b81){return _0x464b81?{'count':_0x286522,'rows':_0x464b81}:null;}})[_0x8ba3('0x39')](respondWithResult(_0x8c1488,null))[_0x8ba3('0x2c')](handleError(_0x8c1488,null));};exports[_0x8ba3('0xd6')]=function(_0x5b2708,_0x460314,_0xb2815a){var _0x498e95={'raw':!![],'where':{}};var _0x5d8536={};var _0x1af659={'count':0x0,'rows':[]};return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x5b2708[_0x8ba3('0x63')]['id']}})['then'](handleEntityNotFound(_0x460314,null))[_0x8ba3('0x39')](function(_0xf5842b){if(_0xf5842b){_0x5d8536[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db['VoiceRecording'][_0x8ba3('0x65')]);_0x5d8536[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x5b2708[_0x8ba3('0x4e')]);_0x5d8536['filters']=_['intersection'](_0x5d8536[_0x8ba3('0x4c')],_0x5d8536[_0x8ba3('0x4e')]);_0x498e95[_0x8ba3('0x52')]=_['intersection'](_0x5d8536['model'],qs[_0x8ba3('0x53')](_0x5b2708[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x498e95['attributes']=_0x498e95['attributes'][_0x8ba3('0x54')]?_0x498e95['attributes']:_0x5d8536[_0x8ba3('0x4c')];if(!_0x5b2708['query'][_0x8ba3('0xc6')]('nolimit')){_0x498e95[_0x8ba3('0x33')]=qs['limit'](_0x5b2708[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x498e95[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x5b2708[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}_0x498e95[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x5b2708[_0x8ba3('0x4e')]['sort']);_0x498e95[_0x8ba3('0x57')]=qs['filters'](_[_0x8ba3('0xc4')](_0x5b2708[_0x8ba3('0x4e')],_0x5d8536[_0x8ba3('0x50')]));_0x498e95[_0x8ba3('0x57')][_0x8ba3('0xd7')]=_0xf5842b['id'];if(_0x5b2708[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x498e95[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x498e95['where'],{'$or':_[_0x8ba3('0x40')](_0x498e95[_0x8ba3('0x52')],function(_0x354c7d){var _0x32c5b6={};_0x32c5b6[_0x354c7d]={'$like':'%'+_0x5b2708[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x32c5b6;})});}_0x498e95=_[_0x8ba3('0x5c')]({},_0x498e95,_0x5b2708[_0x8ba3('0xc5')]);return db['VoiceRecording'][_0x8ba3('0x31')]({'where':_0x498e95[_0x8ba3('0x57')]})[_0x8ba3('0x39')](function(_0x40a441){_0x1af659[_0x8ba3('0x31')]=_0x40a441;if(_0x5b2708[_0x8ba3('0x4e')][_0x8ba3('0x5e')]){_0x498e95[_0x8ba3('0x5f')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8ba3('0x60')](_0x498e95);})[_0x8ba3('0x39')](function(_0x3713aa){_0x1af659['rows']=_0x3713aa;return _0x1af659;});}})[_0x8ba3('0x39')](respondWithFilteredResult(_0x460314,_0x498e95))[_0x8ba3('0x2c')](handleError(_0x460314,null));};exports[_0x8ba3('0xd8')]=function(_0x3627ba,_0x57db08,_0x11ffd8){var _0x58aaad={'raw':!![],'where':{}};var _0x5d4273={};var _0x5bf0c2={'count':0x0,'rows':[]};return db[_0x8ba3('0x5d')]['findOne']({'where':{'id':_0x3627ba[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x57db08,null))['then'](function(_0x2e58d0){if(_0x2e58d0){_0x5d4273[_0x8ba3('0x4c')]=_['keys'](db[_0x8ba3('0xd9')][_0x8ba3('0x65')]);_0x5d4273[_0x8ba3('0x4e')]=_['keys'](_0x3627ba['query']);_0x5d4273['filters']=_[_0x8ba3('0x51')](_0x5d4273[_0x8ba3('0x4c')],_0x5d4273[_0x8ba3('0x4e')]);_0x58aaad[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x5d4273['model'],qs['fields'](_0x3627ba[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x58aaad[_0x8ba3('0x52')]=_0x58aaad[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x58aaad[_0x8ba3('0x52')]:_0x5d4273[_0x8ba3('0x4c')];if(!_0x3627ba['query'][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x58aaad['limit']=qs[_0x8ba3('0x33')](_0x3627ba['query'][_0x8ba3('0x33')]);_0x58aaad['offset']=qs[_0x8ba3('0x32')](_0x3627ba[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}_0x58aaad[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x3627ba[_0x8ba3('0x4e')]['sort']);_0x58aaad[_0x8ba3('0x57')]=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x3627ba[_0x8ba3('0x4e')],_0x5d4273['filters']));_0x58aaad[_0x8ba3('0x57')]['UserId']=_0x2e58d0['id'];if(_0x3627ba[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x58aaad[_0x8ba3('0x57')]=_['merge'](_0x58aaad[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x58aaad[_0x8ba3('0x52')],function(_0x1a7cf8){var _0x559474={};_0x559474[_0x1a7cf8]={'$like':'%'+_0x3627ba['query'][_0x8ba3('0x3e')]+'%'};return _0x559474;})});}_0x58aaad=_[_0x8ba3('0x5c')]({},_0x58aaad,_0x3627ba[_0x8ba3('0xc5')]);return db[_0x8ba3('0xd9')][_0x8ba3('0x31')]({'where':_0x58aaad[_0x8ba3('0x57')]})[_0x8ba3('0x39')](function(_0x1e6aa1){_0x5bf0c2['count']=_0x1e6aa1;if(_0x3627ba[_0x8ba3('0x4e')][_0x8ba3('0x5e')]){_0x58aaad[_0x8ba3('0x5f')]=[{'all':!![]}];}return db[_0x8ba3('0xd9')][_0x8ba3('0x60')](_0x58aaad);})[_0x8ba3('0x39')](function(_0x30a1d0){_0x5bf0c2[_0x8ba3('0x61')]=_0x30a1d0;return _0x5bf0c2;});}})['then'](respondWithFilteredResult(_0x57db08,_0x58aaad))[_0x8ba3('0x2c')](handleError(_0x57db08,null));};exports[_0x8ba3('0xda')]=function(_0x273c42,_0x2a3430,_0x1e2ed9){var _0x4d4ab9={};var _0x3de5c9={};var _0x3bd8ef;var _0x50f9de;return db[_0x8ba3('0x5d')]['findOne']({'where':{'id':_0x273c42[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x2a3430,null))['then'](function(_0x36e8a3){if(_0x36e8a3){_0x3bd8ef=_0x36e8a3;_0x3de5c9['model']=_['keys'](db[_0x8ba3('0xdb')][_0x8ba3('0x65')]);_0x3de5c9[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x273c42[_0x8ba3('0x4e')]);_0x3de5c9['filters']=_['intersection'](_0x3de5c9['model'],_0x3de5c9[_0x8ba3('0x4e')]);_0x4d4ab9[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x3de5c9[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x273c42[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x4d4ab9[_0x8ba3('0x52')]=_0x4d4ab9[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x4d4ab9[_0x8ba3('0x52')]:_0x3de5c9[_0x8ba3('0x4c')];_0x4d4ab9['order']=qs[_0x8ba3('0x56')](_0x273c42[_0x8ba3('0x4e')]['sort']);_0x4d4ab9[_0x8ba3('0x57')]=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x273c42['query'],_0x3de5c9[_0x8ba3('0x50')]));if(_0x273c42[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x4d4ab9[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x4d4ab9['where'],{'$or':_[_0x8ba3('0x40')](_0x4d4ab9[_0x8ba3('0x52')],function(_0x18872d){var _0x59ea2a={};_0x59ea2a[_0x18872d]={'$like':'%'+_0x273c42[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x59ea2a;})});}_0x4d4ab9=_[_0x8ba3('0x5c')]({},_0x4d4ab9,_0x273c42['options']);return _0x3bd8ef['getChatInteractions'](_0x4d4ab9);}})[_0x8ba3('0x39')](function(_0x45435a){if(_0x45435a){_0x50f9de=_0x45435a[_0x8ba3('0x54')];if(!_0x273c42[_0x8ba3('0x4e')][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x4d4ab9[_0x8ba3('0x33')]=qs[_0x8ba3('0x33')](_0x273c42[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x4d4ab9[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x273c42['query'][_0x8ba3('0x32')]);}return _0x3bd8ef[_0x8ba3('0xda')](_0x4d4ab9);}})[_0x8ba3('0x39')](function(_0x583ab8){if(_0x583ab8){return _0x583ab8?{'count':_0x50f9de,'rows':_0x583ab8}:null;}})[_0x8ba3('0x39')](respondWithResult(_0x2a3430,null))[_0x8ba3('0x2c')](handleError(_0x2a3430,null));};exports['getOpenchannelInteractions']=function(_0x592012,_0x30b530,_0x55edd6){var _0x423b3e={};var _0xe9a3e0={};var _0x41ffc7;var _0x1aefdf;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x592012[_0x8ba3('0x63')]['id']}})['then'](handleEntityNotFound(_0x30b530,null))[_0x8ba3('0x39')](function(_0x3e2a97){if(_0x3e2a97){_0x41ffc7=_0x3e2a97;_0xe9a3e0[_0x8ba3('0x4c')]=_['keys'](db[_0x8ba3('0xdc')]['rawAttributes']);_0xe9a3e0['query']=_[_0x8ba3('0x4f')](_0x592012[_0x8ba3('0x4e')]);_0xe9a3e0[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0xe9a3e0['model'],_0xe9a3e0['query']);_0x423b3e['attributes']=_['intersection'](_0xe9a3e0[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x592012[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x423b3e[_0x8ba3('0x52')]=_0x423b3e[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x423b3e[_0x8ba3('0x52')]:_0xe9a3e0[_0x8ba3('0x4c')];_0x423b3e[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x592012['query'][_0x8ba3('0x56')]);_0x423b3e['where']=qs[_0x8ba3('0x50')](_['pick'](_0x592012[_0x8ba3('0x4e')],_0xe9a3e0[_0x8ba3('0x50')]));if(_0x592012[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x423b3e[_0x8ba3('0x57')]=_['merge'](_0x423b3e['where'],{'$or':_['map'](_0x423b3e[_0x8ba3('0x52')],function(_0x30bf6e){var _0x2f189b={};_0x2f189b[_0x30bf6e]={'$like':'%'+_0x592012['query'][_0x8ba3('0x3e')]+'%'};return _0x2f189b;})});}_0x423b3e=_[_0x8ba3('0x5c')]({},_0x423b3e,_0x592012[_0x8ba3('0xc5')]);return _0x41ffc7['getOpenchannelInteractions'](_0x423b3e);}})[_0x8ba3('0x39')](function(_0x2dbe21){if(_0x2dbe21){_0x1aefdf=_0x2dbe21[_0x8ba3('0x54')];if(!_0x592012['query'][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x423b3e['limit']=qs['limit'](_0x592012[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x423b3e[_0x8ba3('0x32')]=qs['offset'](_0x592012[_0x8ba3('0x4e')]['offset']);}return _0x41ffc7[_0x8ba3('0xdd')](_0x423b3e);}})[_0x8ba3('0x39')](function(_0x3acf87){if(_0x3acf87){return _0x3acf87?{'count':_0x1aefdf,'rows':_0x3acf87}:null;}})[_0x8ba3('0x39')](respondWithResult(_0x30b530,null))[_0x8ba3('0x2c')](handleError(_0x30b530,null));};exports[_0x8ba3('0xde')]=function(_0x5638c0,_0x1671ba,_0x7b354e){var _0x38eb08={'raw':!![],'where':{}};var _0x525949={};var _0x45b761={'count':0x0,'rows':[]};return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x5638c0['params']['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x1671ba,null))[_0x8ba3('0x39')](function(_0x1d7fe7){if(_0x1d7fe7){_0x525949[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db[_0x8ba3('0xdf')]['rawAttributes']);_0x525949[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x5638c0[_0x8ba3('0x4e')]);_0x525949[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x525949[_0x8ba3('0x4c')],_0x525949[_0x8ba3('0x4e')]);_0x38eb08[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x525949[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x5638c0[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x38eb08['attributes']=_0x38eb08[_0x8ba3('0x52')]['length']?_0x38eb08[_0x8ba3('0x52')]:_0x525949[_0x8ba3('0x4c')];if(!_0x5638c0['query'][_0x8ba3('0xc6')]('nolimit')){_0x38eb08['limit']=qs[_0x8ba3('0x33')](_0x5638c0[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x38eb08[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x5638c0[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}_0x38eb08[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x5638c0[_0x8ba3('0x4e')][_0x8ba3('0x56')]);_0x38eb08['where']=qs['filters'](_['pick'](_0x5638c0['query'],_0x525949[_0x8ba3('0x50')]));_0x38eb08[_0x8ba3('0x57')][_0x8ba3('0xd7')]=_0x1d7fe7['id'];if(_0x5638c0['query'][_0x8ba3('0x3e')]){_0x38eb08[_0x8ba3('0x57')]=_['merge'](_0x38eb08[_0x8ba3('0x57')],{'$or':_['map'](_0x38eb08[_0x8ba3('0x52')],function(_0x1996d1){var _0x4dd5e9={};_0x4dd5e9[_0x1996d1]={'$like':'%'+_0x5638c0['query'][_0x8ba3('0x3e')]+'%'};return _0x4dd5e9;})});}_0x38eb08=_[_0x8ba3('0x5c')]({},_0x38eb08,_0x5638c0['options']);return db[_0x8ba3('0xdf')][_0x8ba3('0x31')]({'where':_0x38eb08[_0x8ba3('0x57')]})[_0x8ba3('0x39')](function(_0x29f2f0){_0x45b761[_0x8ba3('0x31')]=_0x29f2f0;if(_0x5638c0[_0x8ba3('0x4e')][_0x8ba3('0x5e')]){_0x38eb08['include']=[{'all':!![]}];}return db['MailInteraction'][_0x8ba3('0x60')](_0x38eb08);})['then'](function(_0x623818){_0x45b761[_0x8ba3('0x61')]=_0x623818;return _0x45b761;});}})[_0x8ba3('0x39')](respondWithFilteredResult(_0x1671ba,_0x38eb08))[_0x8ba3('0x2c')](handleError(_0x1671ba,null));};exports[_0x8ba3('0xe0')]=function(_0x1744dd,_0x117fb2,_0x355f37){var _0x3c70e7={};var _0x13affb={};var _0x1c0334;var _0xa2a486;return db['User'][_0x8ba3('0x95')]({'where':{'id':_0x1744dd[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x117fb2,null))[_0x8ba3('0x39')](function(_0x3edcd4){if(_0x3edcd4){_0x1c0334=_0x3edcd4;_0x13affb[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db['SmsInteraction'][_0x8ba3('0x65')]);_0x13affb['query']=_[_0x8ba3('0x4f')](_0x1744dd[_0x8ba3('0x4e')]);_0x13affb[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x13affb[_0x8ba3('0x4c')],_0x13affb[_0x8ba3('0x4e')]);_0x3c70e7[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x13affb[_0x8ba3('0x4c')],qs['fields'](_0x1744dd[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x3c70e7[_0x8ba3('0x52')]=_0x3c70e7['attributes']['length']?_0x3c70e7[_0x8ba3('0x52')]:_0x13affb['model'];_0x3c70e7[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x1744dd[_0x8ba3('0x4e')][_0x8ba3('0x56')]);_0x3c70e7[_0x8ba3('0x57')]=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x1744dd[_0x8ba3('0x4e')],_0x13affb[_0x8ba3('0x50')]));if(_0x1744dd[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x3c70e7['where']=_[_0x8ba3('0x5c')](_0x3c70e7[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x3c70e7[_0x8ba3('0x52')],function(_0x26f859){var _0x1f6599={};_0x1f6599[_0x26f859]={'$like':'%'+_0x1744dd[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x1f6599;})});}_0x3c70e7=_['merge']({},_0x3c70e7,_0x1744dd['options']);return _0x1c0334[_0x8ba3('0xe0')](_0x3c70e7);}})['then'](function(_0x534cbe){if(_0x534cbe){_0xa2a486=_0x534cbe[_0x8ba3('0x54')];if(!_0x1744dd[_0x8ba3('0x4e')][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x3c70e7[_0x8ba3('0x33')]=qs['limit'](_0x1744dd['query'][_0x8ba3('0x33')]);_0x3c70e7[_0x8ba3('0x32')]=qs['offset'](_0x1744dd[_0x8ba3('0x4e')]['offset']);}return _0x1c0334[_0x8ba3('0xe0')](_0x3c70e7);}})[_0x8ba3('0x39')](function(_0x46c112){if(_0x46c112){return _0x46c112?{'count':_0xa2a486,'rows':_0x46c112}:null;}})['then'](respondWithResult(_0x117fb2,null))[_0x8ba3('0x2c')](handleError(_0x117fb2,null));};exports[_0x8ba3('0xe1')]=function(_0x1b3d3e,_0x3b5ebf,_0x65c84a){var _0x229552={};var _0x146894={};var _0x396b00;var _0x338f09;return db['User'][_0x8ba3('0x95')]({'where':{'id':_0x1b3d3e['params']['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x3b5ebf,null))[_0x8ba3('0x39')](function(_0x168a4e){if(_0x168a4e){_0x396b00=_0x168a4e;_0x146894[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db[_0x8ba3('0xe2')][_0x8ba3('0x65')]);_0x146894[_0x8ba3('0x4e')]=_['keys'](_0x1b3d3e[_0x8ba3('0x4e')]);_0x146894[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x146894[_0x8ba3('0x4c')],_0x146894[_0x8ba3('0x4e')]);_0x229552[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x146894[_0x8ba3('0x4c')],qs['fields'](_0x1b3d3e[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x229552[_0x8ba3('0x52')]=_0x229552[_0x8ba3('0x52')]['length']?_0x229552[_0x8ba3('0x52')]:_0x146894['model'];_0x229552['order']=qs[_0x8ba3('0x56')](_0x1b3d3e['query']['sort']);_0x229552['where']=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x1b3d3e[_0x8ba3('0x4e')],_0x146894['filters']));if(_0x1b3d3e[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x229552[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x229552[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x229552[_0x8ba3('0x52')],function(_0x3fdab4){var _0x505753={};_0x505753[_0x3fdab4]={'$like':'%'+_0x1b3d3e[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x505753;})});}_0x229552=_['merge']({},_0x229552,_0x1b3d3e[_0x8ba3('0xc5')]);return _0x396b00[_0x8ba3('0xe1')](_0x229552);}})[_0x8ba3('0x39')](function(_0x9d7df7){if(_0x9d7df7){_0x338f09=_0x9d7df7['length'];if(!_0x1b3d3e['query'][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x229552[_0x8ba3('0x33')]=qs[_0x8ba3('0x33')](_0x1b3d3e[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x229552[_0x8ba3('0x32')]=qs[_0x8ba3('0x32')](_0x1b3d3e[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}return _0x396b00['getFaxInteractions'](_0x229552);}})[_0x8ba3('0x39')](function(_0x111f79){if(_0x111f79){return _0x111f79?{'count':_0x338f09,'rows':_0x111f79}:null;}})[_0x8ba3('0x39')](respondWithResult(_0x3b5ebf,null))['catch'](handleError(_0x3b5ebf,null));};exports[_0x8ba3('0xe3')]=function(_0xac6b53,_0x10eedb,_0x303c2b){var _0x427b83;var _0x917f4e;var _0x2ead8f;var _0x3fd3c4=!_['isNil'](_0xac6b53[_0x8ba3('0x63')]['id'])?_0xac6b53[_0x8ba3('0x63')]['id']:!_[_0x8ba3('0x73')](_0xac6b53['user']['id'])?_0xac6b53[_0x8ba3('0x3a')]['id']:null;return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x3fd3c4,'role':_0x8ba3('0x6d')},'attributes':['id',_0x8ba3('0x45'),_0x8ba3('0xe4'),'mobile',_0x8ba3('0x43'),'internal',_0x8ba3('0xa2')]})[_0x8ba3('0x39')](handleEntityNotFound(_0x10eedb,null))['then'](function(_0x5d0a41){if(_0x5d0a41){_0x427b83=_0x5d0a41;if(_0xac6b53['body'][_0x8ba3('0xa4')]){_0x2ead8f=util['format'](_0x8ba3('0xe5'),_0x427b83[_0xac6b53[_0x8ba3('0x68')][_0x8ba3('0xa4')]]);}else if(_0xac6b53['body'][_0x8ba3('0xe6')]){_0x2ead8f=util[_0x8ba3('0x75')](_0x8ba3('0xb1'),_0xac6b53[_0x8ba3('0x68')][_0x8ba3('0xe6')]);}else{_0x2ead8f=util[_0x8ba3('0x75')](_0x8ba3('0xb1'),_0x427b83['name']);}socket['to'](util[_0x8ba3('0x75')]('user:%s',_0x427b83['name']))[_0x8ba3('0xb7')](_0x8ba3('0xe7'),{'ip':_0xac6b53[_0x8ba3('0xe8')]['x-forwarded-for']||_0xac6b53[_0x8ba3('0xe9')]['remoteAddress']||_0xac6b53['socket'][_0x8ba3('0xea')]||_0xac6b53[_0x8ba3('0xe9')][_0x8ba3('0xeb')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x427b83['name']},'individualHooks':!![]});}})[_0x8ba3('0x39')](function(_0x26c726){if(_0x427b83){return _0x427b83[_0x8ba3('0xec')]({'raw':!![]});}})[_0x8ba3('0x39')](function(_0x58ac1e){var _0x4b2f2f=[];if(_0x58ac1e){_0x917f4e=_0x58ac1e;if(_0x917f4e[_0x8ba3('0x54')]){for(var _0x1216f1=0x0;_0x1216f1<_0x917f4e[_0x8ba3('0x54')];_0x1216f1++){_0x4b2f2f[_0x8ba3('0xb0')]({'membername':_0x427b83[_0x8ba3('0x45')],'UserId':_0x427b83['id'],'queue_name':_0x917f4e[_0x1216f1][_0x8ba3('0x45')],'VoiceQueueId':_0x917f4e[_0x1216f1]['id'],'interface':_0x2ead8f,'paused':_0x427b83[_0x8ba3('0xa2')]||![],'penalty':_0x917f4e[_0x1216f1][_0x8ba3('0xed')]||0x0});}return BPromise[_0x8ba3('0xb2')](_0x4b2f2f,function(_0x24e0f4){return db['UserVoiceQueueRt']['upsert'](_0x24e0f4);});}}})[_0x8ba3('0x39')](function(){return db[_0x8ba3('0xee')][_0x8ba3('0x60')]({'where':{'membername':_0x427b83[_0x8ba3('0x45')],'exitAt':null}});})['then'](function(_0x270883){var _0x6e227a=[];_0x270883[_0x8ba3('0xef')](function(_0xfb4ecc){_0x6e227a[_0x8ba3('0xb0')](_0xfb4ecc[_0x8ba3('0x69')]({'exitAt':moment()[_0x8ba3('0x75')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8ba3('0xf0')](_0x6e227a);})[_0x8ba3('0x39')](function(){var _0x19cc34=[];var _0x57ea10=[];var _0x1bb28d=utils[_0x8ba3('0xf1')]();var _0x506561={'membername':_0x427b83[_0x8ba3('0x45')],'interface':_0x2ead8f,'enterAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2')),'role':_0x427b83[_0x8ba3('0x43')],'internal':_0x427b83[_0x8ba3('0x77')]};_0x1bb28d['forEach'](function(_0x2bb73b){_0x19cc34[_0x8ba3('0xb0')](_[_0x8ba3('0x5c')]({'channel':_0x2bb73b,'type':'LOGIN','data1':_0xac6b53['body'][_0x8ba3('0xf3')],'data2':_0x2ead8f},_0x506561));if(_0x427b83[_0x8ba3('0xa2')]){_0x57ea10[_0x8ba3('0xb0')](_[_0x8ba3('0x5c')]({'channel':_0x2bb73b,'type':'PAUSE','data1':'LOGININPAUSE'},_0x506561));}});return db[_0x8ba3('0xee')][_0x8ba3('0x67')](_0x19cc34[_0x8ba3('0xf4')](_0x57ea10),{'individualHooks':!![]});})[_0x8ba3('0x39')](function(){return _0x427b83[_0x8ba3('0x69')]({'online':!![],'lastLoginAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2')),'voicePause':_0x427b83['loginInPause']||![],'mailPause':_0x427b83[_0x8ba3('0xa2')]||![],'chatPause':_0x427b83['loginInPause']||![],'faxPause':_0x427b83['loginInPause']||![],'smsPause':_0x427b83[_0x8ba3('0xa2')]||![],'openchannelPause':_0x427b83['loginInPause']||![],'pauseType':_0x427b83[_0x8ba3('0xa2')]?'LOGININPAUSE':null,'interface':_0x2ead8f,'lastPauseAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2'))});})[_0x8ba3('0x39')](function(_0x544ebb){if(_0xac6b53[_0x8ba3('0xf5')]){return _0x303c2b();}else{return BPromise['resolve'](_0x544ebb)[_0x8ba3('0x39')](respondWithResult(_0x10eedb,null));}})['catch'](handleError(_0x10eedb,null));};exports[_0x8ba3('0xf6')]=function(_0x293284,_0xaf64fd,_0x50c5b6){var _0x822b80;return db[_0x8ba3('0x5d')]['find']({'where':{'id':_0x293284[_0x8ba3('0x63')]['id'],'role':_0x8ba3('0x6d')},'attributes':['id','name',_0x8ba3('0x43')]})['then'](handleEntityNotFound(_0xaf64fd,null))[_0x8ba3('0x39')](function(_0x4f2fcf){if(_0x4f2fcf){_0x822b80=_0x4f2fcf;return db['UserVoiceQueueRt'][_0x8ba3('0x47')]({'where':{'membername':_0x822b80[_0x8ba3('0x45')]},'individualHooks':!![]});}})[_0x8ba3('0x39')](function(){return db[_0x8ba3('0xee')][_0x8ba3('0x60')]({'where':{'membername':_0x822b80[_0x8ba3('0x45')],'exitAt':null}});})[_0x8ba3('0x39')](function(_0x500031){var _0x25f54c=[];_0x500031[_0x8ba3('0xef')](function(_0x5b3dee){_0x25f54c[_0x8ba3('0xb0')](_0x5b3dee[_0x8ba3('0x69')]({'exitAt':moment()['format'](_0x8ba3('0xf2'))}));});return BPromise['all'](_0x25f54c);})['then'](function(){return _0x822b80[_0x8ba3('0x69')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x8ba3('0x39')](respondWithResult(_0xaf64fd,null))['catch'](handleError(_0xaf64fd,null));};exports['pause']=function(_0x43be3f,_0x53be7a,_0x24b58f){var _0x5d9ac2;return db['UserVoiceQueueRt'][_0x8ba3('0x69')]({'paused':0x1},{'where':{'UserId':_0x43be3f[_0x8ba3('0x63')]['id']},'individualHooks':!![]})[_0x8ba3('0x39')](function(){return db[_0x8ba3('0x5d')]['find']({'where':{'id':_0x43be3f['params']['id'],'role':_0x8ba3('0x6d')},'attributes':['id',_0x8ba3('0x45'),_0x8ba3('0x43'),'internal','interface']});})[_0x8ba3('0x39')](handleEntityNotFound(_0x53be7a,null))[_0x8ba3('0x39')](function(_0x3e3183){if(_0x3e3183){_0x5d9ac2=_0x3e3183;return respondWithRpcPromise(_0x8ba3('0xf7'),_0x8ba3('0xf8'),{'id':_0x5d9ac2['id'],'name':_0x5d9ac2['name'],'pause':!![]});}})[_0x8ba3('0x39')](function(){if(_0x5d9ac2){return db[_0x8ba3('0xee')][_0x8ba3('0x60')]({'where':{'membername':_0x5d9ac2[_0x8ba3('0x45')],'type':'PAUSE','exitAt':null}});}})[_0x8ba3('0x39')](function(_0x49a95e){if(_0x49a95e[_0x8ba3('0x54')]){var _0x454e72=moment()[_0x8ba3('0x75')](_0x8ba3('0xf2'));for(var _0x3f9186=0x0,_0x52006e=_0x49a95e[_0x8ba3('0x54')];_0x3f9186<_0x52006e;_0x3f9186++){_0x49a95e[_0x3f9186][_0x8ba3('0xf9')]({'exitAt':_0x454e72});}}})[_0x8ba3('0x39')](function(){var _0xb53942=[];var _0x3a14e6=utils[_0x8ba3('0xf1')]();_0x3a14e6[_0x8ba3('0xef')](function(_0x541719){_0xb53942['push']({'channel':_0x541719,'membername':_0x5d9ac2[_0x8ba3('0x45')],'interface':_[_0x8ba3('0x73')](_0x5d9ac2['interface'])?util['format'](_0x8ba3('0xb1'),_0x5d9ac2[_0x8ba3('0x45')]):_0x5d9ac2[_0x8ba3('0xa4')],'type':_0x8ba3('0xfa'),'enterAt':moment()[_0x8ba3('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x43be3f[_0x8ba3('0x68')][_0x8ba3('0x4a')]||_0x8ba3('0xfb'),'role':_0x5d9ac2['role'],'internal':_0x5d9ac2[_0x8ba3('0x77')]});});return db[_0x8ba3('0xee')]['bulkCreate'](_0xb53942,{'individualHooks':!![]});})[_0x8ba3('0x39')](function(){return _0x5d9ac2['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x43be3f[_0x8ba3('0x68')][_0x8ba3('0x4a')]||_0x8ba3('0xfb'),'lastPauseAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2'))});})[_0x8ba3('0x39')](respondWithResult(_0x53be7a,null))[_0x8ba3('0x2c')](handleError(_0x53be7a,null));};exports[_0x8ba3('0xfc')]=function(_0x48928f,_0xf4b52,_0x2717af){var _0x3f32e1;return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x48928f['params']['id']},'attributes':['id',_0x8ba3('0x45'),'role',_0x8ba3('0xa3'),'mailPause','chatPause',_0x8ba3('0xfd'),'openchannelPause',_0x8ba3('0xfe'),'pauseType',_0x8ba3('0xff')]})[_0x8ba3('0x39')](handleEntityNotFound(_0xf4b52,null))[_0x8ba3('0x39')](function(_0x18e43e){if(_0x18e43e){_0x3f32e1=_0x18e43e;if(_0x48928f[_0x8ba3('0x68')][_0x8ba3('0xa0')]&&!utils[_0x8ba3('0xa5')](_0x48928f['body']['channel'])){throw new db[(_0x8ba3('0x21'))][(_0x8ba3('0x22'))]('Unknown\x20channel');}switch(_0x48928f['body'][_0x8ba3('0xa0')]){case _0x8ba3('0xae'):return respondWithRpcPromise(_0x8ba3('0xf7'),'unpause',{'id':_0x3f32e1['id'],'name':_0x3f32e1[_0x8ba3('0x45')],'pause':![]})[_0x8ba3('0x39')](function(){return db[_0x8ba3('0xb3')]['update']({'paused':0x0},{'where':{'UserId':_0x3f32e1['id']},'individualHooks':!![]});})[_0x8ba3('0x39')](function(){return db['MemberReport'][_0x8ba3('0x44')]({'where':{'channel':_0x48928f['body'][_0x8ba3('0xa0')],'membername':_0x3f32e1[_0x8ba3('0x45')],'type':_0x8ba3('0xfa'),'exitAt':null}});})[_0x8ba3('0x39')](function(_0xa508d0){if(_0xa508d0){return _0xa508d0[_0x8ba3('0x69')]({'exitAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2')),'data2':_0x8ba3('0x100')},{'individualHooks':!![]});}return null;})[_0x8ba3('0x39')](function(){return _0x3f32e1[_0x8ba3('0x69')]({'voicePause':![]});});case _0x8ba3('0x101'):case _0x8ba3('0x102'):case'fax':case _0x8ba3('0x103'):case'openchannel':return db[_0x8ba3('0xee')][_0x8ba3('0x44')]({'where':{'channel':_0x48928f[_0x8ba3('0x68')][_0x8ba3('0xa0')],'membername':_0x3f32e1[_0x8ba3('0x45')],'type':'PAUSE','exitAt':null}})['then'](function(_0x331647){if(_0x331647){return _0x331647['update']({'exitAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2')),'data2':_0x8ba3('0x100')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x74bfbf={};_[_0x8ba3('0x34')](_0x74bfbf,util[_0x8ba3('0x75')]('%s%s',_0x48928f[_0x8ba3('0x68')]['channel'],_0x8ba3('0x104')),![]);return _0x3f32e1['update'](_0x74bfbf);});default:return respondWithRpcPromise(_0x8ba3('0xf7'),_0x8ba3('0xfc'),{'id':_0x3f32e1['id'],'name':_0x3f32e1['name'],'pause':![]})[_0x8ba3('0x39')](function(){return db[_0x8ba3('0xb3')][_0x8ba3('0x69')]({'paused':0x0},{'where':{'UserId':_0x3f32e1['id']}});})[_0x8ba3('0x39')](function(){return db[_0x8ba3('0xee')][_0x8ba3('0x60')]({'where':{'membername':_0x3f32e1[_0x8ba3('0x45')],'type':_0x8ba3('0xfa'),'exitAt':null}});})[_0x8ba3('0x39')](function(_0x4bf36c){var _0x2dc848=[];_0x4bf36c[_0x8ba3('0xef')](function(_0x2ce90b){_0x2dc848[_0x8ba3('0xb0')](_0x2ce90b['update']({'exitAt':moment()[_0x8ba3('0x75')](_0x8ba3('0xf2')),'data2':_0x8ba3('0x100')}));});return BPromise[_0x8ba3('0xf0')](_0x2dc848);})[_0x8ba3('0x39')](function(){return _0x3f32e1[_0x8ba3('0x69')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x8ba3('0x39')](respondWithResult(_0xf4b52,null))[_0x8ba3('0x2c')](handleError(_0xf4b52,null));};exports['getTeams']=function(_0x2814a4,_0x4dea02,_0x4b79e0){var _0x5cfb17={};var _0x566964={};var _0x169af7;var _0x3f6d48;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x2814a4[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x4dea02,null))[_0x8ba3('0x39')](function(_0x54b22f){if(_0x54b22f){_0x169af7=_0x54b22f;_0x566964[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db[_0x8ba3('0x105')][_0x8ba3('0x65')]);_0x566964[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x2814a4[_0x8ba3('0x4e')]);_0x566964[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x566964['model'],_0x566964[_0x8ba3('0x4e')]);_0x5cfb17[_0x8ba3('0x52')]=_['intersection'](_0x566964[_0x8ba3('0x4c')],qs[_0x8ba3('0x53')](_0x2814a4[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x5cfb17[_0x8ba3('0x52')]=_0x5cfb17[_0x8ba3('0x52')][_0x8ba3('0x54')]?_0x5cfb17[_0x8ba3('0x52')]:_0x566964['model'];_0x5cfb17[_0x8ba3('0x55')]=qs['sort'](_0x2814a4[_0x8ba3('0x4e')][_0x8ba3('0x56')]);_0x5cfb17[_0x8ba3('0x57')]=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x2814a4[_0x8ba3('0x4e')],_0x566964[_0x8ba3('0x50')]));if(_0x2814a4['query'][_0x8ba3('0x3e')]){_0x5cfb17['where']=_[_0x8ba3('0x5c')](_0x5cfb17['where'],{'$or':_[_0x8ba3('0x40')](_0x5cfb17[_0x8ba3('0x52')],function(_0x4c972d){var _0x53d3d6={};_0x53d3d6[_0x4c972d]={'$like':'%'+_0x2814a4['query']['filter']+'%'};return _0x53d3d6;})});}_0x5cfb17=_['merge']({},_0x5cfb17,_0x2814a4['options']);return _0x169af7[_0x8ba3('0x106')](_0x5cfb17);}})[_0x8ba3('0x39')](function(_0xa1b303){if(_0xa1b303){_0x3f6d48=_0xa1b303[_0x8ba3('0x54')];if(!_0x2814a4['query'][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x5cfb17[_0x8ba3('0x33')]=qs[_0x8ba3('0x33')](_0x2814a4[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x5cfb17['offset']=qs[_0x8ba3('0x32')](_0x2814a4[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}return _0x169af7[_0x8ba3('0x106')](_0x5cfb17);}})[_0x8ba3('0x39')](function(_0x5006fb){if(_0x5006fb){return _0x5006fb?{'count':_0x3f6d48,'rows':_0x5006fb}:null;}})['then'](respondWithResult(_0x4dea02,null))['catch'](handleError(_0x4dea02,null));};exports[_0x8ba3('0x107')]=function(_0x413444,_0x54068a){return db[_0x8ba3('0x5d')][_0x8ba3('0x44')]({'where':{'id':_0x413444['params']['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x54068a,null))['then'](function(_0x3d56a5){if(_0x3d56a5){var _0x308961=_0x3d56a5['get']({'plain':!![]});return _0x3d56a5['addTeams'](_0x413444[_0x8ba3('0x68')][_0x8ba3('0x6c')],_[_0x8ba3('0x108')](_0x413444[_0x8ba3('0x68')],[_0x8ba3('0x6c'),'id'])||{})[_0x8ba3('0x39')](function(){for(var _0x1713b6=0x0;_0x1713b6<_0x413444[_0x8ba3('0x68')][_0x8ba3('0x6c')][_0x8ba3('0x54')];_0x1713b6++){var _0x5571a4=[];db[_0x8ba3('0x105')]['findOne']({'where':{'id':_0x413444[_0x8ba3('0x68')]['ids'][_0x1713b6]}})[_0x8ba3('0x39')](function(_0x4dd7c2){_0x5571a4['push'](_0x4dd7c2[_0x8ba3('0xec')]()[_0x8ba3('0x39')](function(_0x56a261){for(var _0x4a1aa6=0x0;_0x4a1aa6<_0x56a261[_0x8ba3('0x54')];_0x4a1aa6++){_0x56a261[_0x4a1aa6][_0x8ba3('0x109')](_0x8ba3('0xa0'),_0x8ba3('0x10a'));}return _0x56a261;}));_0x5571a4[_0x8ba3('0xb0')](_0x4dd7c2[_0x8ba3('0x10b')]()[_0x8ba3('0x39')](function(_0x438362){for(var _0x3d001a=0x0;_0x3d001a<_0x438362['length'];_0x3d001a++){_0x438362[_0x3d001a]['setDataValue'](_0x8ba3('0xa0'),_0x8ba3('0x10c'));}return _0x438362;}));_0x5571a4[_0x8ba3('0xb0')](_0x4dd7c2['getMailQueues']()['then'](function(_0x4f47ca){for(var _0x59dbe3=0x0;_0x59dbe3<_0x4f47ca['length'];_0x59dbe3++){_0x4f47ca[_0x59dbe3][_0x8ba3('0x109')]('channel','Mail');}return _0x4f47ca;}));_0x5571a4[_0x8ba3('0xb0')](_0x4dd7c2[_0x8ba3('0x10d')]()[_0x8ba3('0x39')](function(_0x13fc9c){for(var _0x29cd4d=0x0;_0x29cd4d<_0x13fc9c[_0x8ba3('0x54')];_0x29cd4d++){_0x13fc9c[_0x29cd4d][_0x8ba3('0x109')]('channel',_0x8ba3('0x10e'));}return _0x13fc9c;}));_0x5571a4[_0x8ba3('0xb0')](_0x4dd7c2[_0x8ba3('0x10f')]()['then'](function(_0x32f979){for(var _0x470904=0x0;_0x470904<_0x32f979[_0x8ba3('0x54')];_0x470904++){_0x32f979[_0x470904][_0x8ba3('0x109')](_0x8ba3('0xa0'),_0x8ba3('0x110'));}return _0x32f979;}));_0x5571a4['push'](_0x4dd7c2['getOpenchannelQueues']()['then'](function(_0x5f0d28){for(var _0x5037c1=0x0;_0x5037c1<_0x5f0d28[_0x8ba3('0x54')];_0x5037c1++){_0x5f0d28[_0x5037c1][_0x8ba3('0x109')](_0x8ba3('0xa0'),_0x8ba3('0x111'));}return _0x5f0d28;}));return BPromise[_0x8ba3('0xf0')](_0x5571a4);})[_0x8ba3('0x39')](function(_0x56598b){var _0x2e7edc=_[_0x8ba3('0x112')](_0x56598b);_0x5571a4=[];return db[_0x8ba3('0x59')]['transaction'](function(_0x1bc480){for(var _0x225a54=0x0;_0x225a54<_0x2e7edc[_0x8ba3('0x54')];_0x225a54++){_0x5571a4[_0x8ba3('0xb0')](_0x2e7edc[_0x225a54][_0x8ba3('0x113')](_0x308961['id']),{'transaction':_0x1bc480});}return BPromise[_0x8ba3('0xf0')](_0x5571a4)[_0x8ba3('0x39')](function(){if(_0x308961[_0x8ba3('0xa1')]){return BPromise['each'](_[_0x8ba3('0x3e')](_0x2e7edc,function(_0x56cb2d){return _0x56cb2d[_0x8ba3('0x114')](_0x8ba3('0xa0'))===_0x8ba3('0x10a');}),function(_0x1b496f){return db[_0x8ba3('0xb3')]['upsert']({'membername':_0x308961[_0x8ba3('0x45')],'UserId':_0x308961['id'],'queue_name':_0x1b496f['name'],'VoiceQueueId':_0x1b496f['id'],'interface':_['isNil'](_0x308961[_0x8ba3('0xa4')])?util['format']('SIP/%s',_0x308961[_0x8ba3('0x45')]):_0x308961['interface'],'paused':_0x308961[_0x8ba3('0xa3')]||![],'penalty':_0x308961[_0x8ba3('0xa9')]},{'transaction':_0x1bc480});});}else{return;}})[_0x8ba3('0x39')](function(){for(var _0x167090=0x0;_0x167090<_0x2e7edc['length'];_0x167090++){var _0x503313=_0x2e7edc[_0x167090][_0x8ba3('0x114')](_0x8ba3('0xa0'));var _0x46714e=_0x503313+'QueueId';socket['emit']('user'+_0x503313+_0x8ba3('0xad'),{'UserId':_0x308961['id'],['queueField']:_0x2e7edc[_0x167090]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x54068a,null))[_0x8ba3('0x2c')](handleError(_0x54068a,null));};exports['removeTeams']=function(_0x4b3112,_0x1bc28a){return db[_0x8ba3('0x5d')]['findOne']({'where':{'id':_0x4b3112[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x1bc28a,null))[_0x8ba3('0x39')](function(_0x32de8f){if(_0x32de8f){var _0x581e51=_0x32de8f['get']({'plain':!![]});var _0x562931=_0x4b3112[_0x8ba3('0x4e')][_0x8ba3('0x6c')];return _0x32de8f[_0x8ba3('0x115')](_0x562931)[_0x8ba3('0x39')](function(){for(var _0x39152b=0x0;_0x39152b<_0x562931['length'];_0x39152b++){var _0x59d6fc=[];db[_0x8ba3('0x105')][_0x8ba3('0x95')]({'where':{'id':_0x562931[_0x39152b]}})[_0x8ba3('0x39')](function(_0x23111c){_0x59d6fc['push'](_0x23111c[_0x8ba3('0xec')]()[_0x8ba3('0x39')](function(_0x1ae810){for(var _0x4fc8ec=0x0;_0x4fc8ec<_0x1ae810[_0x8ba3('0x54')];_0x4fc8ec++){_0x1ae810[_0x4fc8ec][_0x8ba3('0x109')]('channel','Voice');}return _0x1ae810;}));_0x59d6fc[_0x8ba3('0xb0')](_0x23111c[_0x8ba3('0x10b')]()[_0x8ba3('0x39')](function(_0x4229c0){for(var _0x41b7aa=0x0;_0x41b7aa<_0x4229c0[_0x8ba3('0x54')];_0x41b7aa++){_0x4229c0[_0x41b7aa][_0x8ba3('0x109')](_0x8ba3('0xa0'),_0x8ba3('0x10c'));}return _0x4229c0;}));_0x59d6fc[_0x8ba3('0xb0')](_0x23111c[_0x8ba3('0x116')]()[_0x8ba3('0x39')](function(_0xa6379c){for(var _0x3add44=0x0;_0x3add44<_0xa6379c[_0x8ba3('0x54')];_0x3add44++){_0xa6379c[_0x3add44]['setDataValue'](_0x8ba3('0xa0'),_0x8ba3('0x117'));}return _0xa6379c;}));_0x59d6fc[_0x8ba3('0xb0')](_0x23111c[_0x8ba3('0x10d')]()['then'](function(_0x3846ad){for(var _0x59d934=0x0;_0x59d934<_0x3846ad[_0x8ba3('0x54')];_0x59d934++){_0x3846ad[_0x59d934][_0x8ba3('0x109')](_0x8ba3('0xa0'),_0x8ba3('0x10e'));}return _0x3846ad;}));_0x59d6fc[_0x8ba3('0xb0')](_0x23111c[_0x8ba3('0x10f')]()[_0x8ba3('0x39')](function(_0x352a0e){for(var _0x52ddc1=0x0;_0x52ddc1<_0x352a0e[_0x8ba3('0x54')];_0x52ddc1++){_0x352a0e[_0x52ddc1][_0x8ba3('0x109')]('channel','Fax');}return _0x352a0e;}));_0x59d6fc[_0x8ba3('0xb0')](_0x23111c[_0x8ba3('0x118')]()['then'](function(_0x308f69){for(var _0x4b0481=0x0;_0x4b0481<_0x308f69['length'];_0x4b0481++){_0x308f69[_0x4b0481][_0x8ba3('0x109')](_0x8ba3('0xa0'),_0x8ba3('0x111'));}return _0x308f69;}));return BPromise['all'](_0x59d6fc);})[_0x8ba3('0x39')](function(_0x4191da){var _0x3d7b99=_[_0x8ba3('0x112')](_0x4191da);_0x59d6fc=[];return db[_0x8ba3('0x59')][_0x8ba3('0x119')](function(_0x5b377a){for(var _0x15dcc8=0x0;_0x15dcc8<_0x3d7b99[_0x8ba3('0x54')];_0x15dcc8++){_0x59d6fc[_0x8ba3('0xb0')](_0x3d7b99[_0x15dcc8][_0x8ba3('0x11a')](_0x581e51['id']),{'transaction':_0x5b377a});}return BPromise[_0x8ba3('0xf0')](_0x59d6fc)['then'](function(){if(_0x581e51[_0x8ba3('0xa1')]){return BPromise[_0x8ba3('0xb2')](_[_0x8ba3('0x3e')](_0x3d7b99,function(_0x2c4dcc){return _0x2c4dcc[_0x8ba3('0x114')](_0x8ba3('0xa0'))===_0x8ba3('0x10a');}),function(_0x4fdaa9){return db['UserVoiceQueueRt'][_0x8ba3('0x47')]({'where':{'VoiceQueueId':_0x4fdaa9['id'],'UserId':_0x581e51['id']},'transaction':_0x5b377a});});}else{return;}})[_0x8ba3('0x39')](function(){for(var _0x28d5a3=0x0;_0x28d5a3<_0x3d7b99[_0x8ba3('0x54')];_0x28d5a3++){var _0x1250ff=_0x3d7b99[_0x28d5a3]['getDataValue']('channel');var _0x481ec3=_0x1250ff+'QueueId';socket[_0x8ba3('0xb7')]('user'+_0x1250ff+_0x8ba3('0xb8'),{'UserId':_0x581e51['id'],['queueField']:_0x3d7b99[_0x28d5a3]['id']});}});});});}});}})[_0x8ba3('0x39')](respondWithStatusCode(_0x1bc28a,null))[_0x8ba3('0x2c')](handleError(_0x1bc28a,null));};exports[_0x8ba3('0x11b')]=function(_0x3e749c,_0x388f91,_0x27a613){var _0x421942={};var _0x24b5fe={};var _0x431705;var _0x2c5df3;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x3e749c[_0x8ba3('0x63')]['id']}})['then'](handleEntityNotFound(_0x388f91,null))['then'](function(_0x5849ad){if(_0x5849ad){_0x431705=_0x5849ad;_0x24b5fe[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db[_0x8ba3('0xc7')]['rawAttributes']);_0x24b5fe[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x3e749c[_0x8ba3('0x4e')]);_0x24b5fe[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x24b5fe[_0x8ba3('0x4c')],_0x24b5fe[_0x8ba3('0x4e')]);_0x421942[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x24b5fe['model'],qs[_0x8ba3('0x53')](_0x3e749c[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x421942[_0x8ba3('0x52')]=_0x421942[_0x8ba3('0x52')]['length']?_0x421942[_0x8ba3('0x52')]:_0x24b5fe['model'];_0x421942[_0x8ba3('0x55')]=qs[_0x8ba3('0x56')](_0x3e749c['query'][_0x8ba3('0x56')]);_0x421942['where']=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x3e749c[_0x8ba3('0x4e')],_0x24b5fe[_0x8ba3('0x50')]));if(_0x3e749c[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x421942['where']=_[_0x8ba3('0x5c')](_0x421942[_0x8ba3('0x57')],{'$or':_[_0x8ba3('0x40')](_0x421942[_0x8ba3('0x52')],function(_0x204656){var _0x45ecff={};_0x45ecff[_0x204656]={'$like':'%'+_0x3e749c[_0x8ba3('0x4e')][_0x8ba3('0x3e')]+'%'};return _0x45ecff;})});}_0x421942=_[_0x8ba3('0x5c')]({},_0x421942,_0x3e749c[_0x8ba3('0xc5')]);return _0x431705[_0x8ba3('0x11b')](_0x421942);}})['then'](function(_0x29b788){if(_0x29b788){_0x2c5df3=_0x29b788[_0x8ba3('0x54')];if(!_0x3e749c[_0x8ba3('0x4e')][_0x8ba3('0xc6')](_0x8ba3('0xcd'))){_0x421942[_0x8ba3('0x33')]=qs[_0x8ba3('0x33')](_0x3e749c[_0x8ba3('0x4e')][_0x8ba3('0x33')]);_0x421942[_0x8ba3('0x32')]=qs['offset'](_0x3e749c[_0x8ba3('0x4e')][_0x8ba3('0x32')]);}return _0x431705[_0x8ba3('0x11b')](_0x421942);}})[_0x8ba3('0x39')](function(_0x16cd74){if(_0x16cd74){return _0x16cd74?{'count':_0x2c5df3,'rows':_0x16cd74}:null;}})['then'](respondWithResult(_0x388f91,null))[_0x8ba3('0x2c')](handleError(_0x388f91,null));};exports[_0x8ba3('0x11c')]=function(_0x591347,_0x1bb177,_0x4e5fce){var _0x4e8f65={};var _0x2a4898={};var _0x58528f;var _0x4a1aa8;return db[_0x8ba3('0x5d')][_0x8ba3('0x95')]({'where':{'id':_0x591347[_0x8ba3('0x63')]['id']}})[_0x8ba3('0x39')](handleEntityNotFound(_0x1bb177,null))[_0x8ba3('0x39')](function(_0x3f2e9d){if(_0x3f2e9d){_0x58528f=_0x3f2e9d;_0x2a4898[_0x8ba3('0x4c')]=_[_0x8ba3('0x4f')](db['User'][_0x8ba3('0x65')]);_0x2a4898[_0x8ba3('0x4e')]=_[_0x8ba3('0x4f')](_0x591347[_0x8ba3('0x4e')]);_0x2a4898[_0x8ba3('0x50')]=_[_0x8ba3('0x51')](_0x2a4898['model'],_0x2a4898['query']);_0x4e8f65[_0x8ba3('0x52')]=_[_0x8ba3('0x51')](_0x2a4898[_0x8ba3('0x4c')],qs['fields'](_0x591347[_0x8ba3('0x4e')][_0x8ba3('0x53')]));_0x4e8f65['attributes']=_0x4e8f65['attributes']['length']?_0x4e8f65[_0x8ba3('0x52')]:_0x2a4898[_0x8ba3('0x4c')];_0x4e8f65[_0x8ba3('0x55')]=qs['sort'](_0x591347[_0x8ba3('0x4e')][_0x8ba3('0x56')]);_0x4e8f65['where']=qs[_0x8ba3('0x50')](_[_0x8ba3('0xc4')](_0x591347[_0x8ba3('0x4e')],_0x2a4898['filters']));if(_0x591347[_0x8ba3('0x4e')][_0x8ba3('0x3e')]){_0x4e8f65[_0x8ba3('0x57')]=_[_0x8ba3('0x5c')](_0x4e8f65[_0x8ba3('0x57')],{'$or':_['map'](_0x4e8f65[_0x8ba3('0x52')],function(_0x3b3eb2){var _0x108b81={};_0x108b81[_0x3b3eb2]={'$like':'%'+_0x591347['query'][_0x8ba3('0x3e')]+'%'};return _0x108b81;})});}_0x4e8f65[_0x8ba3('0x4c')]=db[_0x8ba3('0x5d')];_0x4e8f65['as']=_0x8ba3('0x3b');_0x4e8f65=_[_0x8ba3('0x5c')]({},_0x4e8f65,_0x591347[_0x8ba3('0xc5')]);return _0x58528f[_0x8ba3('0xec')]({'include':[_0x4e8f65]});}})[_0x8ba3('0x39')](function(_0x5f3c9f){if(_0x5f3c9f){var _0x47e337={},_0x454f7a=[],_0xe8c93e=0x0;for(var _0x5d0939=0x0;_0x5d0939<_0x5f3c9f['length'];_0x5d0939+=0x1){for(var _0x3b3741=0x0,_0x48bc3e;_0x3b3741<_0x5f3c9f[_0x5d0939][_0x8ba3('0x3b')]['length'];_0x3b3741+=0x1){_0x48bc3e=_0x5f3c9f[_0x5d0939][_0x8ba3('0x3b')][_0x3b3741][_0x8ba3('0x8f')]({'plain':!![]});_0x47e337[_0x48bc3e['id']]=_0x48bc3e;}}_0x47e337=_['values'](_0x47e337);for(var _0x4b5d6c=qs[_0x8ba3('0x32')](_0x591347[_0x8ba3('0x4e')][_0x8ba3('0x32')]);_0x4b5d6c<_0x47e337[_0x8ba3('0x54')]&&_0x454f7a['length']=_0x5788b9){_0x4a3d36=_0x5788b9;_0x51f9ea=0xc8;}else{_0x51f9ea=0xce;}_0x3cffd5[_0x25e6('0x2b')](_0x51f9ea);return _0x3cffd5[_0x25e6('0x30')](_0x25e6('0x31'),_0xf3ea2b+'-'+_0x4a3d36+'/'+_0x5788b9)[_0x25e6('0x2c')](_0x2dc20f);}return null;};}function patchUpdates(_0x4fcc65){return function(_0x5ec5fe){try{jsonpatch[_0x25e6('0x32')](_0x5ec5fe,_0x4fcc65,!![]);}catch(_0x5deb7f){return BPromise[_0x25e6('0x33')](_0x5deb7f);}return _0x5ec5fe[_0x25e6('0x34')]();};}function saveUpdates(_0x4888f1,_0x323fe4){return function(_0x33acd9){if(_0x33acd9){return _0x33acd9['update'](_0x4888f1)[_0x25e6('0x21')](function(_0x7ac4a1){return _0x7ac4a1;});}return null;};}function removeEntity(_0x42c886,_0x5aa9f5){return function(_0x27745a){if(_0x27745a){return _0x27745a[_0x25e6('0x35')]()['then'](function(){var _0x1b333e=_0x27745a['get']({'plain':!![]});var _0x2689bc=[{'name':_0x25e6('0x36'),'value':_0x25e6('0x37'),'ignore':!![]},{'name':_0x25e6('0x38'),'value':_0x25e6('0x39'),'ignore':![]},{'name':_0x25e6('0x3a'),'value':_0x25e6('0x3b'),'ignore':![]}];var _0xab52d3=_(_0x2689bc)[_0x25e6('0x3c')](_0x25e6('0x3d'))[_0x25e6('0x3e')](_0x25e6('0x3f'))[_0x25e6('0x3f')]();if(_[_0x25e6('0x40')](_0xab52d3,_0x1b333e[_0x25e6('0x41')])){return;}var _0x2cf1eb=_[_0x25e6('0x42')](_0x2689bc,['value',_0x1b333e['role']])[_0x25e6('0x43')];return db[_0x25e6('0x44')][_0x25e6('0x35')]({'where':{'type':_0x2cf1eb,'resourceId':_0x1b333e['id']}})['then'](function(){return _0x27745a;});})['then'](function(){_0x42c886[_0x25e6('0x2b')](0xcc)[_0x25e6('0x45')]();});}};}function handleEntityNotFound(_0x32b0df,_0x28303b){return function(_0x620b21){if(!_0x620b21){_0x32b0df['sendStatus'](0x194);}return _0x620b21;};}function handleError(_0x505ae1,_0x3fde17){_0x3fde17=_0x3fde17||0x1f4;return function(_0x17f251){logger[_0x25e6('0x27')](_0x17f251['stack']);if(_0x17f251[_0x25e6('0x43')]){delete _0x17f251[_0x25e6('0x43')];}_0x505ae1[_0x25e6('0x2b')](_0x3fde17)[_0x25e6('0x46')](_0x17f251);};}exports['index']=function(_0x1bc2d6,_0x1cb340){var _0x569bc6={},_0xb2ddeb={},_0x36fc73={'count':0x0,'rows':[]};var _0x334310=_[_0x25e6('0x3e')](db['User'][_0x25e6('0x47')],function(_0x1d22bb){return{'name':_0x1d22bb[_0x25e6('0x48')],'type':_0x1d22bb[_0x25e6('0x49')][_0x25e6('0x4a')]};});_0xb2ddeb['model']=_[_0x25e6('0x4b')](_[_0x25e6('0x3e')](_0x334310,_0x25e6('0x43')),[_0x25e6('0x4c'),_0x25e6('0x4d')]);_0xb2ddeb[_0x25e6('0x4e')]=_['keys'](_0x1bc2d6[_0x25e6('0x4e')]);_0xb2ddeb[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0xb2ddeb[_0x25e6('0x51')],_0xb2ddeb['query']);_0x569bc6[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0xb2ddeb[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x569bc6[_0x25e6('0x52')]=_0x569bc6[_0x25e6('0x52')][_0x25e6('0x54')]?_0x569bc6['attributes']:_0xb2ddeb[_0x25e6('0x51')];if(!_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x569bc6[_0x25e6('0x2f')]=qs['limit'](_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x569bc6['offset']=qs[_0x25e6('0x2e')](_0x1bc2d6['query'][_0x25e6('0x2e')]);}_0x569bc6[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x569bc6['where']=qs['filters'](_[_0x25e6('0x59')](_0x1bc2d6[_0x25e6('0x4e')],_0xb2ddeb['filters']));if(_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x569bc6[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x569bc6[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x334310,function(_0x1da71b){if(_0x1da71b[_0x25e6('0x49')]!==_0x25e6('0x5c')){return db['sequelize'][_0x25e6('0x5a')](db[_0x25e6('0x5d')]['fn']('lower',db[_0x25e6('0x5d')][_0x25e6('0x5e')](_0x1da71b['name'])),{'$like':db[_0x25e6('0x5d')]['fn'](_0x25e6('0x5f'),'%'+_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%')});}})});}_0x569bc6=_['merge']({},_0x569bc6,_0x1bc2d6[_0x25e6('0x60')]);var _0x5b8e8b={'where':_0x569bc6[_0x25e6('0x5a')]};return db[_0x25e6('0x61')][_0x25e6('0x2d')](_0x5b8e8b)['then'](function(_0x4996b2){_0x36fc73[_0x25e6('0x2d')]=_0x4996b2;if(_0x1bc2d6[_0x25e6('0x4e')][_0x25e6('0x62')]){_0x569bc6['include']=[{'all':!![]}];}return db[_0x25e6('0x61')][_0x25e6('0x63')](_0x569bc6);})[_0x25e6('0x21')](function(_0x57211f){_0x36fc73[_0x25e6('0x64')]=_0x57211f;return _0x36fc73;})[_0x25e6('0x21')](respondWithFilteredResult(_0x1cb340,_0x569bc6))[_0x25e6('0x65')](handleError(_0x1cb340,null));};exports[_0x25e6('0x66')]=function(_0x4a90d0,_0x7976e7){var _0x3c4c6b={'raw':![],'where':{'id':_0x4a90d0[_0x25e6('0x67')]['id']}},_0x49b273={};_0x49b273[_0x25e6('0x51')]=_[_0x25e6('0x4b')](_[_0x25e6('0x68')](db[_0x25e6('0x61')][_0x25e6('0x47')]),['password',_0x25e6('0x4d')]);_0x49b273[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x4a90d0['query']);_0x49b273[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x49b273[_0x25e6('0x51')],_0x49b273[_0x25e6('0x4e')]);_0x3c4c6b['attributes']=_['intersection'](_0x49b273[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x4a90d0[_0x25e6('0x4e')]['fields']));_0x3c4c6b['attributes']=_0x3c4c6b[_0x25e6('0x52')][_0x25e6('0x54')]?_0x3c4c6b['attributes']:_0x49b273[_0x25e6('0x51')];if(_0x4a90d0[_0x25e6('0x4e')][_0x25e6('0x62')]){_0x3c4c6b[_0x25e6('0x69')]=[{'all':!![]}];}_0x3c4c6b=_[_0x25e6('0x5b')]({},_0x3c4c6b,_0x4a90d0[_0x25e6('0x60')]);return db['User'][_0x25e6('0x42')](_0x3c4c6b)[_0x25e6('0x21')](handleEntityNotFound(_0x7976e7,null))['then'](respondWithResult(_0x7976e7,null))[_0x25e6('0x65')](handleError(_0x7976e7,null));};exports[_0x25e6('0x6a')]=function(_0x3caa5d,_0x1af75b){return db['User'][_0x25e6('0x6a')](_0x3caa5d[_0x25e6('0x6b')],{'raw':![],'individualHooks':!![]})[_0x25e6('0x21')](respondWithResult(_0x1af75b,0xc9))[_0x25e6('0x65')](handleError(_0x1af75b,null));};exports[_0x25e6('0x6c')]=function(_0xa55e3,_0x499a04){if(_0xa55e3[_0x25e6('0x6b')]['id']){delete _0xa55e3[_0x25e6('0x6b')]['id'];}delete _0xa55e3[_0x25e6('0x6b')][_0x25e6('0x41')];return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0xa55e3[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x499a04,null))[_0x25e6('0x21')](saveUpdates(_0xa55e3[_0x25e6('0x6b')],null))[_0x25e6('0x21')](respondWithResult(_0x499a04,null))[_0x25e6('0x65')](handleError(_0x499a04,null));};exports[_0x25e6('0x6d')]=function(_0x2e15e6,_0x169cf0){return db[_0x25e6('0x61')][_0x25e6('0x6d')]()[_0x25e6('0x21')](respondWithResult(_0x169cf0,null))['catch'](handleError(_0x169cf0,null));};exports[_0x25e6('0x6e')]=function(_0xd5939c,_0x2b63c8,_0x37314c){return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0xd5939c[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x2b63c8,null))[_0x25e6('0x21')](function(_0x9ef09e){if(_0x9ef09e){return _0x9ef09e[_0x25e6('0x6e')](_0xd5939c['body']['ids'],_[_0x25e6('0x6f')](_0xd5939c['body'],['ids','id'])||{});}})[_0x25e6('0x21')](respondWithResult(_0x2b63c8,null))[_0x25e6('0x65')](handleError(_0x2b63c8,null));};var getLicense=function(_0x4acb06){return new BPromise(function(_0x9b5888,_0x365351){var _0x50febc=0x0;_0x4acb06['body']['role']===_0x25e6('0x39')&&_0x9b5888(_0x25e6('0x70'));return db[_0x25e6('0x61')][_0x25e6('0x2d')]({'where':{'$or':[{'role':_0x4acb06[_0x25e6('0x6b')][_0x25e6('0x41')]===_0x25e6('0x3b')?_0x25e6('0x3b'):['admin','user']}]}})['then'](function(_0x45d614){_0x50febc=_0x45d614;return require(_0x25e6('0x71'))[_0x25e6('0x72')]();})[_0x25e6('0x21')](function(_0x17c13b){var _0x232f49=_0x4acb06[_0x25e6('0x6b')][_0x25e6('0x41')]==='telephone'?_0x25e6('0x73'):_0x25e6('0x74');if(!_['isNil'](_0x17c13b[_0x232f49])&&_0x50febc>=_0x17c13b[_0x232f49]){return _0x365351({'message':_0x25e6('0x75')});}return _0x9b5888(util[_0x25e6('0x76')](_0x25e6('0x77'),_0x232f49,_0x50febc));})[_0x25e6('0x65')](function(_0x221d1b){return _0x365351(_0x221d1b);});});};exports[_0x25e6('0x78')]=function(_0x1234fc,_0x24b66c){return getLicense(_0x1234fc)[_0x25e6('0x21')](function(_0x4ed0bd){if(!_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x79')]){var _0x408b3f;return db[_0x25e6('0x7a')][_0x25e6('0x7b')](0x1)['then'](function(_0x1e3a15){return checkPasswordPattern(_0x1e3a15,_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x4c')],_0x1e3a15['securePassword']);})['then'](function(_0x4fb25c){_0x408b3f=_0x4fb25c[_0x25e6('0x7c')];return db[_0x25e6('0x61')][_0x25e6('0x7d')](_0x25e6('0x79'));})[_0x25e6('0x21')](function(_0x5763d6){if(_[_0x25e6('0x7e')](_0x5763d6)){if(_0x408b3f){_0x1234fc[_0x25e6('0x6b')]['internal']=_0x408b3f;}else{_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x79')]=0x1;}}else{if(_[_0x25e6('0x7e')](_0x408b3f)||_0x408b3f==_0x5763d6){_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x79')]=_0x5763d6+0x1;}else if(_0x408b3f>_0x5763d6){_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x79')]=_0x408b3f;}else{return db[_0x25e6('0x5d')][_0x25e6('0x4e')](_0x25e6('0x7f'),{'type':db[_0x25e6('0x5d')][_0x25e6('0x80')][_0x25e6('0x81')]})[_0x25e6('0x21')](function(_0x311ee0){if(_0x311ee0&&_0x311ee0[_0x25e6('0x54')]){for(var _0x3c5fe7=0x0,_0x2f4436=_0x311ee0[_0x25e6('0x54')];_0x3c5fe7<_0x2f4436&&_['isNil'](_0x1234fc[_0x25e6('0x6b')]['internal']);_0x3c5fe7++){if(_0x408b3f<=_0x311ee0[_0x3c5fe7]['from']){_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x79')]=_0x311ee0[_0x3c5fe7]['from'];}else if(_0x408b3f>_0x311ee0[_0x3c5fe7][_0x25e6('0x82')]&&_0x408b3f<=_0x311ee0[_0x3c5fe7]['to']){_0x1234fc[_0x25e6('0x6b')]['internal']=_0x408b3f;}}}if(_[_0x25e6('0x7e')](_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x79')])){_0x1234fc['body'][_0x25e6('0x79')]=_0x5763d6+0x1;}});}}});}})[_0x25e6('0x21')](function(){if(_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x83')]){_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x84')]=_0x1234fc[_0x25e6('0x6b')]['internal'];_0x1234fc['body']['VoiceMail']={'mailbox':_0x1234fc[_0x25e6('0x6b')]['internal'],'password':_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x4c')],'fullname':_0x1234fc[_0x25e6('0x6b')]['fullname'],'email':_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x85')]};}if(_0x1234fc[_0x25e6('0x6b')]&&_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x41')]===_0x25e6('0x39')){_0x1234fc[_0x25e6('0x6b')][_0x25e6('0x86')]=['101','102',_0x25e6('0x87'),_0x25e6('0x88'),_0x25e6('0x89'),'105',_0x25e6('0x8a'),_0x25e6('0x8b'),_0x25e6('0x8c'),'109',_0x25e6('0x8d'),'111'];}return db[_0x25e6('0x61')]['create'](_0x1234fc[_0x25e6('0x6b')],{'include':[{'model':db[_0x25e6('0x8e')],'as':'VoiceMail'}]});})['then'](function(_0x441ff1){if(_0x1234fc[_0x25e6('0x6b')]['role']==='user')return _0x441ff1;var _0x44496a=_0x1234fc['user'][_0x25e6('0x8f')]({'plain':!![]});if(!_0x44496a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44496a[_0x25e6('0x41')]===_0x25e6('0x37')){var _0xbf0105=_0x441ff1[_0x25e6('0x8f')]({'plain':!![]});var _0x2efe4f=[{'name':'Agents','value':_0x25e6('0x39')},{'name':'Telephones','value':_0x25e6('0x3b')}];var _0x344689=_['find'](_0x2efe4f,[_0x25e6('0x3f'),_0xbf0105['role']])[_0x25e6('0x43')];return db['UserProfileSection']['find']({'where':{'name':_0x344689,'userProfileId':_0x44496a['userProfileId']},'raw':!![]})[_0x25e6('0x21')](function(_0x569f0b){if(_0x569f0b&&_0x569f0b[_0x25e6('0x90')]===0x0){return db['UserProfileResource'][_0x25e6('0x78')]({'name':_0xbf0105[_0x25e6('0x43')],'resourceId':_0xbf0105['id'],'type':_0x569f0b['name'],'sectionId':_0x569f0b['id']},{})[_0x25e6('0x21')](function(){return _0x441ff1;});}else{return _0x441ff1;}})[_0x25e6('0x65')](function(_0x17295d){logger['error'](_0x25e6('0x91'),_0x17295d);throw _0x17295d;});}return _0x441ff1;})[_0x25e6('0x21')](respondWithResult(_0x24b66c,0xc9))['catch'](handleError(_0x24b66c,null));};exports[_0x25e6('0x92')]=function(_0x4dca84,_0x34c3dc,_0x3855ff){var _0x133b90=![];if(_0x4dca84[_0x25e6('0x6b')]['id']){delete _0x4dca84[_0x25e6('0x6b')]['id'];}return db['Setting'][_0x25e6('0x93')]({'attributes':['id',_0x25e6('0x94')]})[_0x25e6('0x21')](function(_0x5c31b4){_0x133b90=_0x5c31b4[_0x25e6('0x94')];return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x4dca84[_0x25e6('0x67')]['id']}});})[_0x25e6('0x21')](function(_0xd69cd0){if(_0xd69cd0){if(_0xd69cd0['id']==_0x4dca84[_0x25e6('0x37')]['id']){if(!_0x4dca84[_0x25e6('0x6b')]['oldPassword']||!_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x95')]){throw new db['Sequelize'][(_0x25e6('0x96'))](_0x25e6('0x97'));}if(!_0xd69cd0[_0x25e6('0x98')](_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x99')])){throw new db['Sequelize'][(_0x25e6('0x96'))](_0x25e6('0x9a'));}if(_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x99')]==_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x95')]){throw new db['Sequelize'][(_0x25e6('0x96'))](_0x25e6('0x9b'));}return _0xd69cd0;}else if(_0x4dca84[_0x25e6('0x37')]['role']==_0x25e6('0x9c')){if(!_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x95')]){throw new db['Sequelize'][(_0x25e6('0x96'))](_0x25e6('0x9d'));}return _0xd69cd0;}else if(_0x4dca84[_0x25e6('0x37')][_0x25e6('0x41')]=='user'){if(!_0x4dca84['body'][_0x25e6('0x95')]){throw new db[(_0x25e6('0x1e'))][(_0x25e6('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0xd69cd0['role']!=_0x25e6('0x39')){throw new db[(_0x25e6('0x1e'))]['ValidationError'](_0x25e6('0x9e'));}return _0xd69cd0;}else{throw new db['Sequelize'][(_0x25e6('0x96'))](_0x25e6('0x9e'));}}return null;})[_0x25e6('0x21')](handleEntityNotFound(_0x34c3dc,null))['then'](function(_0x1295fa){return checkPasswordPattern(_0x1295fa,_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x95')],_0x133b90);})[_0x25e6('0x21')](saveUpdates({'password':_0x4dca84[_0x25e6('0x6b')][_0x25e6('0x95')],'passwordResetAt':_0x4dca84[_0x25e6('0x37')]['id']==_0x4dca84[_0x25e6('0x67')]['id']?moment():null},null))[_0x25e6('0x21')](respondWithResult(_0x34c3dc,null))[_0x25e6('0x65')](handleError(_0x34c3dc,null));};exports['addQueues']=function(_0x2c19c3,_0x147677,_0x4717d5){var _0x264c4d=_0x2c19c3[_0x25e6('0x6b')][_0x25e6('0x9f')];return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x2c19c3[_0x25e6('0x67')]['id']},'attributes':['id','name',_0x25e6('0x41'),_0x25e6('0xa0'),'loginInPause',_0x25e6('0xa1'),_0x25e6('0xa2')]})[_0x25e6('0x21')](handleEntityNotFound(_0x147677,null))[_0x25e6('0x21')](function(_0x502b7b){if(_0x502b7b){if(!utils['isValidChannel'](_0x264c4d)){throw new db[(_0x25e6('0x1e'))][(_0x25e6('0x96'))](_0x25e6('0xa3'));}return _0x502b7b[_0x25e6('0xa4')+_[_0x25e6('0xa5')](_0x264c4d['toLowerCase']())+'Queues'](_0x2c19c3[_0x25e6('0x6b')]['ids'],{'penalty':_0x2c19c3['body'][_0x25e6('0xa6')]||0x0})[_0x25e6('0xa7')](function(_0x2cb672){for(var _0x184f27=0x0;_0x184f27<_0x2c19c3[_0x25e6('0x6b')]['ids']['length'];_0x184f27+=0x1){var _0x33adfe={'UserId':_0x2c19c3['params']['id']};_0x33adfe[_[_0x25e6('0xa5')](_0x264c4d['toLowerCase']())+_0x25e6('0xa8')]=_0x2c19c3[_0x25e6('0x6b')][_0x25e6('0xa9')][_0x184f27];socket[_0x25e6('0xaa')]('user'+_[_0x25e6('0xa5')](_0x264c4d['toLowerCase']())+_0x25e6('0xab'),_0x33adfe);}return _0x2cb672;})[_0x25e6('0x21')](function(){if(_0x264c4d===_0x25e6('0xac')){return db[_0x25e6('0xad')]['findAll']({'where':{'id':_0x2c19c3[_0x25e6('0x6b')]['ids']||[]},'raw':!![],'attributes':['id',_0x25e6('0x43')]});}})[_0x25e6('0x21')](function(_0x5f59d8){var _0x5c16a7=_0x502b7b[_0x25e6('0x8f')]({'plain':!![]});var _0x58f3ae=[];if(_0x264c4d==='voice'&&_0x5c16a7['role']===_0x25e6('0x39')&&_0x5c16a7[_0x25e6('0xa0')]){for(var _0x5b6d3b=0x0;_0x5b6d3b<_0x5f59d8['length'];_0x5b6d3b+=0x1){_0x58f3ae['push']({'membername':_0x5c16a7[_0x25e6('0x43')],'UserId':_0x5c16a7['id'],'queue_name':_0x5f59d8[_0x5b6d3b][_0x25e6('0x43')],'VoiceQueueId':_0x5f59d8[_0x5b6d3b]['id'],'interface':_[_0x25e6('0x7e')](_0x5c16a7[_0x25e6('0xa2')])?util[_0x25e6('0x76')](_0x25e6('0xae'),_0x5c16a7[_0x25e6('0x43')]):_0x5c16a7[_0x25e6('0xa2')],'paused':_0x5c16a7['voicePause']||![],'penalty':_0x2c19c3['body']['penalty']||0x0});}return BPromise[_0x25e6('0xaf')](_0x58f3ae,function(_0x44fd0b){return db[_0x25e6('0xb0')][_0x25e6('0xb1')](_0x44fd0b);});}return _0x502b7b;});}})[_0x25e6('0x21')](respondWithStatusCode(_0x147677,null))[_0x25e6('0x65')](handleError(_0x147677,null));};exports[_0x25e6('0xb2')]=function(_0x19b370,_0xe95db,_0x38a32e){var _0x50f689;return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x19b370['params']['id']},'attributes':['id',_0x25e6('0x43'),_0x25e6('0x41')]})['then'](handleEntityNotFound(_0xe95db,null))[_0x25e6('0x21')](function(_0x1d171a){if(_0x1d171a){_0x50f689=_0x1d171a;if(!_0x19b370[_0x25e6('0x4e')]['channel']||!utils[_0x25e6('0xb3')](_0x19b370[_0x25e6('0x4e')][_0x25e6('0x9f')])){throw new db[(_0x25e6('0x1e'))]['ValidationError']('Unknown\x20channel');}return _0x1d171a['remove'+_[_0x25e6('0xa5')](_0x19b370['query'][_0x25e6('0x9f')][_0x25e6('0xb4')]())+'Queues'](_0x19b370['query'][_0x25e6('0xa9')]);}})[_0x25e6('0x21')](function(_0x7d875e){for(var _0x2faee8=0x0;_0x2faee8<_0x19b370[_0x25e6('0x4e')][_0x25e6('0xa9')][_0x25e6('0x54')];_0x2faee8+=0x1){var _0x141e2b={'UserId':_0x19b370[_0x25e6('0x67')]['id']};_0x141e2b[_[_0x25e6('0xa5')](_0x19b370['query'][_0x25e6('0x9f')]['toLowerCase']())+_0x25e6('0xa8')]=_0x19b370[_0x25e6('0x4e')][_0x25e6('0xa9')][_0x2faee8];socket['emit'](_0x25e6('0x37')+_[_0x25e6('0xa5')](_0x19b370[_0x25e6('0x4e')][_0x25e6('0x9f')]['toLowerCase']())+_0x25e6('0xb5'),_0x141e2b);}return _0x7d875e;})[_0x25e6('0x21')](function(){if(_0x19b370['query'][_0x25e6('0x9f')]===_0x25e6('0xac')){return db['UserVoiceQueueRt'][_0x25e6('0x35')]({'where':{'UserId':_0x19b370[_0x25e6('0x67')]['id'],'VoiceQueueId':_0x19b370[_0x25e6('0x4e')][_0x25e6('0xa9')]},'individualHooks':!![]})['then'](function(){return _0x50f689;});}return _0x50f689;})['then'](respondWithStatusCode(_0xe95db,null))[_0x25e6('0x65')](handleError(_0xe95db,null));};exports['addAvatar']=function(_0x2cd9ac,_0x16fedf,_0x4654e9){_0x2cd9ac[_0x25e6('0x6b')][_0x25e6('0xb6')]=_0x2cd9ac['file'][_0x25e6('0xb7')];return db[_0x25e6('0x61')]['find']({'where':{'id':_0x2cd9ac[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x16fedf,null))[_0x25e6('0x21')](saveUpdates(_0x2cd9ac[_0x25e6('0x6b')],null))[_0x25e6('0x21')](respondWithResult(_0x16fedf,null))[_0x25e6('0x65')](handleError(_0x16fedf,null));};exports[_0x25e6('0xb8')]=function(_0x41c7bd,_0x49e650,_0x244f1c){var _0x5dc7aa=path[_0x25e6('0xb9')](config['root'],_0x25e6('0xba'));return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x41c7bd['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x49e650,null))[_0x25e6('0x21')](function(_0x17205c){if(_0x17205c){if(_[_0x25e6('0x7e')](_0x17205c['userpic'])){return _0x49e650['download'](_0x5dc7aa);}else{if(!fs[_0x25e6('0xbb')](path[_0x25e6('0xb9')](config['root'],_0x25e6('0xbc'),_0x17205c['userpic']))){return _0x49e650[_0x25e6('0xbd')](_0x5dc7aa);}return _0x49e650[_0x25e6('0xbd')](path['join'](config[_0x25e6('0xbe')],_0x25e6('0xbc'),_0x17205c['userpic']));}}})[_0x25e6('0x65')](handleError(_0x49e650,null));};exports[_0x25e6('0xbf')]=function(_0x2ef8db,_0x2ed450,_0x327b8e){var _0x305677={};var _0xba770e={};var _0x4cc3f0;var _0x1e208a;return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x2ef8db['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x2ed450,null))[_0x25e6('0x21')](function(_0x55f9bb){if(_0x55f9bb){_0x4cc3f0=_0x55f9bb;_0xba770e[_0x25e6('0x51')]=_['keys'](db['CmContact']['rawAttributes']);_0xba770e[_0x25e6('0x4e')]=_['keys'](_0x2ef8db[_0x25e6('0x4e')]);_0xba770e[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0xba770e['model'],_0xba770e['query']);_0x305677[_0x25e6('0x52')]=_['intersection'](_0xba770e[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x2ef8db['query']['fields']));_0x305677[_0x25e6('0x52')]=_0x305677[_0x25e6('0x52')][_0x25e6('0x54')]?_0x305677['attributes']:_0xba770e[_0x25e6('0x51')];_0x305677[_0x25e6('0x57')]=qs['sort'](_0x2ef8db[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x305677['where']=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x2ef8db[_0x25e6('0x4e')],_0xba770e[_0x25e6('0x4f')]));if(_0x2ef8db[_0x25e6('0x4e')]['filter']){_0x305677[_0x25e6('0x5a')]=_['merge'](_0x305677[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x305677[_0x25e6('0x52')],function(_0x54c3a7){var _0x4b9425={};_0x4b9425[_0x54c3a7]={'$like':'%'+_0x2ef8db[_0x25e6('0x4e')]['filter']+'%'};return _0x4b9425;})});}_0x305677=_[_0x25e6('0x5b')]({},_0x305677,_0x2ef8db[_0x25e6('0x60')]);return _0x4cc3f0[_0x25e6('0xbf')](_0x305677);}})[_0x25e6('0x21')](function(_0x1a398e){if(_0x1a398e){_0x1e208a=_0x1a398e['length'];if(_0x2ef8db['query'][_0x25e6('0x55')](_0x25e6('0x62'))){_0x305677[_0x25e6('0x69')]=[{'model':db[_0x25e6('0xc0')],'as':'List','required':![]},{'model':db[_0x25e6('0xc1')],'as':'Tags','attributes':['id',_0x25e6('0x43'),'color'],'where':_0x2ef8db[_0x25e6('0x4e')][_0x25e6('0xc2')]?{'id':_0x2ef8db[_0x25e6('0x4e')][_0x25e6('0xc2')]}:undefined,'required':_0x2ef8db[_0x25e6('0x4e')]['tag']?!![]:![]}];}if(!_0x2ef8db[_0x25e6('0x4e')][_0x25e6('0x55')]('nolimit')){_0x305677['limit']=qs[_0x25e6('0x2f')](_0x2ef8db[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x305677['offset']=qs[_0x25e6('0x2e')](_0x2ef8db[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x4cc3f0['getContacts'](_0x305677);}})[_0x25e6('0x21')](function(_0x5f32e6){if(_0x5f32e6){return _0x5f32e6?{'count':_0x1e208a,'rows':_0x5f32e6}:null;}})[_0x25e6('0x21')](respondWithResult(_0x2ed450,null))[_0x25e6('0x65')](handleError(_0x2ed450,null));};exports['getQueues']=function(_0x1e74f7,_0x51fd55,_0x1cf3a6){var _0x8557b0;var _0x3a5477;var _0x76a589={};var _0x8cd7cf;return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x1e74f7[_0x25e6('0x67')]['id']},'attributes':['id',_0x25e6('0x43'),_0x25e6('0x41')]})[_0x25e6('0x21')](handleEntityNotFound(_0x51fd55,null))[_0x25e6('0x21')](function(_0x11ed11){if(!utils[_0x25e6('0xb3')](_0x1e74f7['query'][_0x25e6('0x9f')])){throw new db[(_0x25e6('0x1e'))][(_0x25e6('0x96'))](_0x25e6('0xa3'));}_0x8557b0=_0x11ed11;var _0x3cb108={};_0x3cb108[_0x25e6('0x51')]=_[_0x25e6('0x68')](db[_['capitalize'](_0x1e74f7[_0x25e6('0x4e')]['channel'])+'Queue']['rawAttributes']);_0x3cb108[_0x25e6('0x4e')]=_['keys'](_0x1e74f7[_0x25e6('0x4e')]);_0x3cb108[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x3cb108[_0x25e6('0x51')],_0x3cb108[_0x25e6('0x4e')]);_0x76a589[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x3cb108['model'],qs['fields'](_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x76a589['attributes']=_0x76a589[_0x25e6('0x52')][_0x25e6('0x54')]?_0x76a589[_0x25e6('0x52')]:_0x3cb108[_0x25e6('0x51')];_0x76a589[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x76a589[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x1e74f7[_0x25e6('0x4e')],_0x3cb108[_0x25e6('0x4f')]));if(_0x1e74f7[_0x25e6('0x4e')]['filter']){_0x76a589[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x76a589['where'],{'$or':_[_0x25e6('0x3e')](_0x76a589['attributes'],function(_0x1ee483){var _0x3aea73={};_0x3aea73[_0x1ee483]={'$like':'%'+_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x3aea73;})});}_0x76a589=_[_0x25e6('0x5b')]({},_0x76a589,_0x1e74f7[_0x25e6('0x60')]);switch(_0x8557b0['role']){case _0x25e6('0x9c'):return db[_['capitalize'](_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x9f')])+_0x25e6('0xc3')][_0x25e6('0x63')](_0x76a589);case _0x25e6('0x37'):case _0x25e6('0x39'):return _0x8557b0['get'+_[_0x25e6('0xa5')](_0x1e74f7[_0x25e6('0x4e')]['channel'])+_0x25e6('0xc4')](_0x76a589);default:throw new db[(_0x25e6('0x1e'))][(_0x25e6('0x96'))](_0x25e6('0xc5'));}})[_0x25e6('0x21')](function(_0x3d38ec){_0x8cd7cf=_0x3d38ec[_0x25e6('0x54')];if(!_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x55')]('nolimit')){_0x76a589[_0x25e6('0x2f')]=qs[_0x25e6('0x2f')](_0x1e74f7[_0x25e6('0x4e')]['limit']);_0x76a589['offset']=qs['offset'](_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x2e')]);}switch(_0x8557b0[_0x25e6('0x41')]){case _0x25e6('0x9c'):return db[_[_0x25e6('0xa5')](_0x1e74f7[_0x25e6('0x4e')]['channel'])+_0x25e6('0xc3')][_0x25e6('0x63')](_0x76a589);case _0x25e6('0x37'):case'agent':return _0x8557b0[_0x25e6('0x8f')+_[_0x25e6('0xa5')](_0x1e74f7[_0x25e6('0x4e')][_0x25e6('0x9f')])+_0x25e6('0xc4')](_0x76a589);}})[_0x25e6('0x21')](function(_0x340901){return{'count':_0x8cd7cf,'rows':_0x340901};})[_0x25e6('0x21')](respondWithResult(_0x51fd55,null))[_0x25e6('0x65')](handleError(_0x51fd55,null));};exports['getVoiceQueuesRt']=function(_0x9089bb,_0x147c83,_0x1a42ae){var _0x1eddad={};var _0x53e43a={};var _0x37c135;var _0x1e3ea4;return db['User'][_0x25e6('0x93')]({'where':{'id':_0x9089bb['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x147c83,null))[_0x25e6('0x21')](function(_0x39175c){if(_0x39175c){_0x37c135=_0x39175c;_0x53e43a['model']=_['keys'](db['UserVoiceQueueRt'][_0x25e6('0x47')]);_0x53e43a[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x9089bb['query']);_0x53e43a[_0x25e6('0x4f')]=_['intersection'](_0x53e43a[_0x25e6('0x51')],_0x53e43a[_0x25e6('0x4e')]);_0x1eddad[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x53e43a[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x9089bb[_0x25e6('0x4e')]['fields']));_0x1eddad[_0x25e6('0x52')]=_0x1eddad[_0x25e6('0x52')][_0x25e6('0x54')]?_0x1eddad[_0x25e6('0x52')]:_0x53e43a[_0x25e6('0x51')];_0x1eddad['order']=qs['sort'](_0x9089bb['query'][_0x25e6('0x58')]);_0x1eddad[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x9089bb[_0x25e6('0x4e')],_0x53e43a['filters']));if(_0x9089bb[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x1eddad[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x1eddad['where'],{'$or':_[_0x25e6('0x3e')](_0x1eddad[_0x25e6('0x52')],function(_0x2a1d2f){var _0x4b1e74={};_0x4b1e74[_0x2a1d2f]={'$like':'%'+_0x9089bb[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x4b1e74;})});}_0x1eddad=_[_0x25e6('0x5b')]({},_0x1eddad,_0x9089bb[_0x25e6('0x60')]);return _0x37c135[_0x25e6('0xc6')](_0x1eddad);}})[_0x25e6('0x21')](function(_0x4345a6){if(_0x4345a6){_0x1e3ea4=_0x4345a6[_0x25e6('0x54')];if(!_0x9089bb['query']['hasOwnProperty'](_0x25e6('0x56'))){_0x1eddad[_0x25e6('0x2f')]=qs['limit'](_0x9089bb['query'][_0x25e6('0x2f')]);_0x1eddad['offset']=qs[_0x25e6('0x2e')](_0x9089bb[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x37c135[_0x25e6('0xc6')](_0x1eddad);}})[_0x25e6('0x21')](function(_0x53a476){if(_0x53a476){return _0x53a476?{'count':_0x1e3ea4,'rows':_0x53a476}:null;}})[_0x25e6('0x21')](respondWithResult(_0x147c83,null))[_0x25e6('0x65')](handleError(_0x147c83,null));};exports[_0x25e6('0xc7')]=function(_0x242edd,_0x458ec0,_0x427731){var _0x18b42a={};var _0x3bf356={};var _0x410db1;var _0x91f26a;return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x242edd[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x458ec0,null))[_0x25e6('0x21')](function(_0x57a26a){if(_0x57a26a){_0x410db1=_0x57a26a;_0x3bf356['model']=_[_0x25e6('0x68')](db[_0x25e6('0xc8')][_0x25e6('0x47')]);_0x3bf356[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x242edd[_0x25e6('0x4e')]);_0x3bf356[_0x25e6('0x4f')]=_['intersection'](_0x3bf356[_0x25e6('0x51')],_0x3bf356[_0x25e6('0x4e')]);_0x18b42a[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x3bf356[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x242edd['query'][_0x25e6('0x53')]));_0x18b42a[_0x25e6('0x52')]=_0x18b42a[_0x25e6('0x52')][_0x25e6('0x54')]?_0x18b42a[_0x25e6('0x52')]:_0x3bf356[_0x25e6('0x51')];_0x18b42a[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0x242edd[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x18b42a[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x242edd[_0x25e6('0x4e')],_0x3bf356[_0x25e6('0x4f')]));if(_0x242edd['query']['filter']){_0x18b42a[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x18b42a['where'],{'$or':_['map'](_0x18b42a['attributes'],function(_0x24fba5){var _0x1f763a={};_0x1f763a[_0x24fba5]={'$like':'%'+_0x242edd[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x1f763a;})});}_0x18b42a=_[_0x25e6('0x5b')]({},_0x18b42a,_0x242edd[_0x25e6('0x60')]);return _0x410db1['getGroups'](_0x18b42a);}})['then'](function(_0x52d3c9){if(_0x52d3c9){_0x91f26a=_0x52d3c9[_0x25e6('0x54')];if(!_0x242edd['query'][_0x25e6('0x55')](_0x25e6('0x56'))){_0x18b42a[_0x25e6('0x2f')]=qs[_0x25e6('0x2f')](_0x242edd['query'][_0x25e6('0x2f')]);_0x18b42a[_0x25e6('0x2e')]=qs[_0x25e6('0x2e')](_0x242edd[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x410db1[_0x25e6('0xc7')](_0x18b42a);}})[_0x25e6('0x21')](function(_0x2f242b){if(_0x2f242b){return _0x2f242b?{'count':_0x91f26a,'rows':_0x2f242b}:null;}})['then'](respondWithResult(_0x458ec0,null))['catch'](handleError(_0x458ec0,null));};exports['getRecordings']=function(_0x1103d6,_0x533eb2,_0x3b7fdb){var _0x56bc65={'raw':!![],'where':{}};var _0x5056e5={};var _0x10d349={'count':0x0,'rows':[]};return db['User'][_0x25e6('0x93')]({'where':{'id':_0x1103d6[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x533eb2,null))[_0x25e6('0x21')](function(_0x320d5f){if(_0x320d5f){_0x5056e5[_0x25e6('0x51')]=_[_0x25e6('0x68')](db[_0x25e6('0xc9')]['rawAttributes']);_0x5056e5[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x1103d6[_0x25e6('0x4e')]);_0x5056e5[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x5056e5[_0x25e6('0x51')],_0x5056e5['query']);_0x56bc65[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x5056e5[_0x25e6('0x51')],qs['fields'](_0x1103d6[_0x25e6('0x4e')]['fields']));_0x56bc65[_0x25e6('0x52')]=_0x56bc65[_0x25e6('0x52')][_0x25e6('0x54')]?_0x56bc65[_0x25e6('0x52')]:_0x5056e5[_0x25e6('0x51')];if(!_0x1103d6[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x56bc65[_0x25e6('0x2f')]=qs['limit'](_0x1103d6[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x56bc65[_0x25e6('0x2e')]=qs[_0x25e6('0x2e')](_0x1103d6[_0x25e6('0x4e')][_0x25e6('0x2e')]);}_0x56bc65[_0x25e6('0x57')]=qs['sort'](_0x1103d6[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x56bc65['where']=qs[_0x25e6('0x4f')](_['pick'](_0x1103d6[_0x25e6('0x4e')],_0x5056e5[_0x25e6('0x4f')]));_0x56bc65[_0x25e6('0x5a')]['UserId']=_0x320d5f['id'];if(_0x1103d6[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x56bc65[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x56bc65[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x56bc65['attributes'],function(_0x4e8f8e){var _0x1c487c={};_0x1c487c[_0x4e8f8e]={'$like':'%'+_0x1103d6[_0x25e6('0x4e')]['filter']+'%'};return _0x1c487c;})});}_0x56bc65=_['merge']({},_0x56bc65,_0x1103d6[_0x25e6('0x60')]);return db[_0x25e6('0xc9')]['count']({'where':_0x56bc65[_0x25e6('0x5a')]})[_0x25e6('0x21')](function(_0x28e646){_0x10d349['count']=_0x28e646;if(_0x1103d6[_0x25e6('0x4e')][_0x25e6('0x62')]){_0x56bc65['include']=[{'all':!![]}];}return db[_0x25e6('0xc9')]['findAll'](_0x56bc65);})[_0x25e6('0x21')](function(_0x53ccf2){_0x10d349[_0x25e6('0x64')]=_0x53ccf2;return _0x10d349;});}})[_0x25e6('0x21')](respondWithFilteredResult(_0x533eb2,_0x56bc65))[_0x25e6('0x65')](handleError(_0x533eb2,null));};exports[_0x25e6('0xca')]=function(_0x3d7030,_0xa69998,_0x80507a){var _0x561991={'raw':!![],'where':{}};var _0x172e2d={};var _0x57b119={'count':0x0,'rows':[]};return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x3d7030[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0xa69998,null))[_0x25e6('0x21')](function(_0x1230ab){if(_0x1230ab){_0x172e2d[_0x25e6('0x51')]=_[_0x25e6('0x68')](db[_0x25e6('0xcb')][_0x25e6('0x47')]);_0x172e2d['query']=_[_0x25e6('0x68')](_0x3d7030[_0x25e6('0x4e')]);_0x172e2d[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x172e2d[_0x25e6('0x51')],_0x172e2d[_0x25e6('0x4e')]);_0x561991[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x172e2d['model'],qs[_0x25e6('0x53')](_0x3d7030[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x561991[_0x25e6('0x52')]=_0x561991[_0x25e6('0x52')]['length']?_0x561991[_0x25e6('0x52')]:_0x172e2d[_0x25e6('0x51')];if(!_0x3d7030['query'][_0x25e6('0x55')](_0x25e6('0x56'))){_0x561991[_0x25e6('0x2f')]=qs['limit'](_0x3d7030[_0x25e6('0x4e')]['limit']);_0x561991[_0x25e6('0x2e')]=qs['offset'](_0x3d7030[_0x25e6('0x4e')]['offset']);}_0x561991['order']=qs[_0x25e6('0x58')](_0x3d7030['query'][_0x25e6('0x58')]);_0x561991[_0x25e6('0x5a')]=qs['filters'](_['pick'](_0x3d7030[_0x25e6('0x4e')],_0x172e2d[_0x25e6('0x4f')]));_0x561991['where']['UserId']=_0x1230ab['id'];if(_0x3d7030[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x561991[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x561991[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x561991[_0x25e6('0x52')],function(_0xf110e2){var _0x4ecfb0={};_0x4ecfb0[_0xf110e2]={'$like':'%'+_0x3d7030[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x4ecfb0;})});}_0x561991=_[_0x25e6('0x5b')]({},_0x561991,_0x3d7030[_0x25e6('0x60')]);return db['ScreenRecording'][_0x25e6('0x2d')]({'where':_0x561991[_0x25e6('0x5a')]})['then'](function(_0x1bd708){_0x57b119[_0x25e6('0x2d')]=_0x1bd708;if(_0x3d7030['query'][_0x25e6('0x62')]){_0x561991[_0x25e6('0x69')]=[{'all':!![]}];}return db[_0x25e6('0xcb')]['findAll'](_0x561991);})[_0x25e6('0x21')](function(_0x3c8197){_0x57b119['rows']=_0x3c8197;return _0x57b119;});}})[_0x25e6('0x21')](respondWithFilteredResult(_0xa69998,_0x561991))[_0x25e6('0x65')](handleError(_0xa69998,null));};exports[_0x25e6('0xcc')]=function(_0x5d5780,_0x547509,_0x5bd6a7){var _0x44cb9b={};var _0x39d429={};var _0x3c521f;var _0x464e04;return db[_0x25e6('0x61')]['findOne']({'where':{'id':_0x5d5780['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x547509,null))[_0x25e6('0x21')](function(_0x4ea4a2){if(_0x4ea4a2){_0x3c521f=_0x4ea4a2;_0x39d429[_0x25e6('0x51')]=_[_0x25e6('0x68')](db[_0x25e6('0xcd')][_0x25e6('0x47')]);_0x39d429[_0x25e6('0x4e')]=_['keys'](_0x5d5780[_0x25e6('0x4e')]);_0x39d429[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x39d429['model'],_0x39d429['query']);_0x44cb9b[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x39d429[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x5d5780[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x44cb9b[_0x25e6('0x52')]=_0x44cb9b[_0x25e6('0x52')]['length']?_0x44cb9b[_0x25e6('0x52')]:_0x39d429[_0x25e6('0x51')];_0x44cb9b[_0x25e6('0x57')]=qs['sort'](_0x5d5780['query']['sort']);_0x44cb9b[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x5d5780[_0x25e6('0x4e')],_0x39d429['filters']));if(_0x5d5780[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x44cb9b[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x44cb9b[_0x25e6('0x5a')],{'$or':_['map'](_0x44cb9b['attributes'],function(_0xa01e9f){var _0x4c6741={};_0x4c6741[_0xa01e9f]={'$like':'%'+_0x5d5780[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x4c6741;})});}_0x44cb9b=_['merge']({},_0x44cb9b,_0x5d5780['options']);return _0x3c521f[_0x25e6('0xcc')](_0x44cb9b);}})[_0x25e6('0x21')](function(_0x4ab07c){if(_0x4ab07c){_0x464e04=_0x4ab07c[_0x25e6('0x54')];if(!_0x5d5780[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x44cb9b[_0x25e6('0x2f')]=qs[_0x25e6('0x2f')](_0x5d5780[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x44cb9b[_0x25e6('0x2e')]=qs[_0x25e6('0x2e')](_0x5d5780[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x3c521f[_0x25e6('0xcc')](_0x44cb9b);}})[_0x25e6('0x21')](function(_0x50a41b){if(_0x50a41b){return _0x50a41b?{'count':_0x464e04,'rows':_0x50a41b}:null;}})[_0x25e6('0x21')](respondWithResult(_0x547509,null))['catch'](handleError(_0x547509,null));};exports[_0x25e6('0xce')]=function(_0xded16f,_0x4250df,_0x300b1d){var _0x56da3f={};var _0x1bd2c0={};var _0x21a606;var _0x3bda81;return db[_0x25e6('0x61')]['findOne']({'where':{'id':_0xded16f['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x4250df,null))[_0x25e6('0x21')](function(_0x5bac08){if(_0x5bac08){_0x21a606=_0x5bac08;_0x1bd2c0[_0x25e6('0x51')]=_[_0x25e6('0x68')](db['OpenchannelInteraction'][_0x25e6('0x47')]);_0x1bd2c0[_0x25e6('0x4e')]=_['keys'](_0xded16f[_0x25e6('0x4e')]);_0x1bd2c0[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x1bd2c0[_0x25e6('0x51')],_0x1bd2c0['query']);_0x56da3f['attributes']=_[_0x25e6('0x50')](_0x1bd2c0[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0xded16f['query'][_0x25e6('0x53')]));_0x56da3f['attributes']=_0x56da3f[_0x25e6('0x52')][_0x25e6('0x54')]?_0x56da3f[_0x25e6('0x52')]:_0x1bd2c0[_0x25e6('0x51')];_0x56da3f['order']=qs[_0x25e6('0x58')](_0xded16f[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x56da3f['where']=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0xded16f[_0x25e6('0x4e')],_0x1bd2c0[_0x25e6('0x4f')]));if(_0xded16f[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x56da3f[_0x25e6('0x5a')]=_[_0x25e6('0x5b')](_0x56da3f[_0x25e6('0x5a')],{'$or':_['map'](_0x56da3f[_0x25e6('0x52')],function(_0x206441){var _0x2b0cef={};_0x2b0cef[_0x206441]={'$like':'%'+_0xded16f[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x2b0cef;})});}_0x56da3f=_[_0x25e6('0x5b')]({},_0x56da3f,_0xded16f[_0x25e6('0x60')]);return _0x21a606[_0x25e6('0xce')](_0x56da3f);}})[_0x25e6('0x21')](function(_0x37e442){if(_0x37e442){_0x3bda81=_0x37e442['length'];if(!_0xded16f['query'][_0x25e6('0x55')]('nolimit')){_0x56da3f[_0x25e6('0x2f')]=qs[_0x25e6('0x2f')](_0xded16f['query'][_0x25e6('0x2f')]);_0x56da3f['offset']=qs[_0x25e6('0x2e')](_0xded16f[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x21a606[_0x25e6('0xce')](_0x56da3f);}})[_0x25e6('0x21')](function(_0x9c768d){if(_0x9c768d){return _0x9c768d?{'count':_0x3bda81,'rows':_0x9c768d}:null;}})[_0x25e6('0x21')](respondWithResult(_0x4250df,null))[_0x25e6('0x65')](handleError(_0x4250df,null));};exports['getMailInteractions']=function(_0xc673db,_0x8b80b,_0x259f8a){var _0x48f1dc={'raw':!![],'where':{}};var _0x258126={};var _0x233a82={'count':0x0,'rows':[]};return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0xc673db[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x8b80b,null))[_0x25e6('0x21')](function(_0x8da7eb){if(_0x8da7eb){_0x258126[_0x25e6('0x51')]=_[_0x25e6('0x68')](db['MailInteraction'][_0x25e6('0x47')]);_0x258126['query']=_[_0x25e6('0x68')](_0xc673db['query']);_0x258126['filters']=_[_0x25e6('0x50')](_0x258126[_0x25e6('0x51')],_0x258126[_0x25e6('0x4e')]);_0x48f1dc['attributes']=_['intersection'](_0x258126[_0x25e6('0x51')],qs['fields'](_0xc673db[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x48f1dc[_0x25e6('0x52')]=_0x48f1dc[_0x25e6('0x52')][_0x25e6('0x54')]?_0x48f1dc[_0x25e6('0x52')]:_0x258126[_0x25e6('0x51')];if(!_0xc673db['query'][_0x25e6('0x55')](_0x25e6('0x56'))){_0x48f1dc[_0x25e6('0x2f')]=qs[_0x25e6('0x2f')](_0xc673db[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x48f1dc['offset']=qs['offset'](_0xc673db[_0x25e6('0x4e')][_0x25e6('0x2e')]);}_0x48f1dc[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0xc673db[_0x25e6('0x4e')]['sort']);_0x48f1dc[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0xc673db[_0x25e6('0x4e')],_0x258126[_0x25e6('0x4f')]));_0x48f1dc[_0x25e6('0x5a')]['UserId']=_0x8da7eb['id'];if(_0xc673db[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x48f1dc['where']=_[_0x25e6('0x5b')](_0x48f1dc[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x48f1dc[_0x25e6('0x52')],function(_0x14c624){var _0x53477e={};_0x53477e[_0x14c624]={'$like':'%'+_0xc673db[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x53477e;})});}_0x48f1dc=_[_0x25e6('0x5b')]({},_0x48f1dc,_0xc673db[_0x25e6('0x60')]);return db['MailInteraction'][_0x25e6('0x2d')]({'where':_0x48f1dc[_0x25e6('0x5a')]})[_0x25e6('0x21')](function(_0x3a66e8){_0x233a82['count']=_0x3a66e8;if(_0xc673db['query'][_0x25e6('0x62')]){_0x48f1dc[_0x25e6('0x69')]=[{'all':!![]}];}return db[_0x25e6('0xcf')][_0x25e6('0x63')](_0x48f1dc);})[_0x25e6('0x21')](function(_0x32f2ff){_0x233a82[_0x25e6('0x64')]=_0x32f2ff;return _0x233a82;});}})[_0x25e6('0x21')](respondWithFilteredResult(_0x8b80b,_0x48f1dc))[_0x25e6('0x65')](handleError(_0x8b80b,null));};exports[_0x25e6('0xd0')]=function(_0x57a351,_0x852959,_0x39d5ca){var _0x353b24={};var _0x5b60df={};var _0x4cb23f;var _0x3887a2;return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x57a351['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x852959,null))[_0x25e6('0x21')](function(_0x354357){if(_0x354357){_0x4cb23f=_0x354357;_0x5b60df[_0x25e6('0x51')]=_[_0x25e6('0x68')](db[_0x25e6('0xd1')][_0x25e6('0x47')]);_0x5b60df[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x57a351[_0x25e6('0x4e')]);_0x5b60df[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x5b60df['model'],_0x5b60df[_0x25e6('0x4e')]);_0x353b24[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x5b60df['model'],qs['fields'](_0x57a351['query'][_0x25e6('0x53')]));_0x353b24[_0x25e6('0x52')]=_0x353b24[_0x25e6('0x52')][_0x25e6('0x54')]?_0x353b24[_0x25e6('0x52')]:_0x5b60df[_0x25e6('0x51')];_0x353b24[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0x57a351['query'][_0x25e6('0x58')]);_0x353b24[_0x25e6('0x5a')]=qs['filters'](_['pick'](_0x57a351[_0x25e6('0x4e')],_0x5b60df['filters']));if(_0x57a351[_0x25e6('0x4e')]['filter']){_0x353b24['where']=_['merge'](_0x353b24[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x353b24[_0x25e6('0x52')],function(_0x4be239){var _0x1b5033={};_0x1b5033[_0x4be239]={'$like':'%'+_0x57a351[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x1b5033;})});}_0x353b24=_[_0x25e6('0x5b')]({},_0x353b24,_0x57a351['options']);return _0x4cb23f[_0x25e6('0xd0')](_0x353b24);}})[_0x25e6('0x21')](function(_0x23cd75){if(_0x23cd75){_0x3887a2=_0x23cd75[_0x25e6('0x54')];if(!_0x57a351[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x353b24[_0x25e6('0x2f')]=qs[_0x25e6('0x2f')](_0x57a351['query'][_0x25e6('0x2f')]);_0x353b24[_0x25e6('0x2e')]=qs[_0x25e6('0x2e')](_0x57a351['query'][_0x25e6('0x2e')]);}return _0x4cb23f[_0x25e6('0xd0')](_0x353b24);}})[_0x25e6('0x21')](function(_0xc25db8){if(_0xc25db8){return _0xc25db8?{'count':_0x3887a2,'rows':_0xc25db8}:null;}})[_0x25e6('0x21')](respondWithResult(_0x852959,null))[_0x25e6('0x65')](handleError(_0x852959,null));};exports[_0x25e6('0xd2')]=function(_0x8e91c7,_0x31d5b7,_0x14fa93){var _0x510b8a={};var _0x4f5cb0={};var _0x369eec;var _0x341c3a;return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x8e91c7[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x31d5b7,null))[_0x25e6('0x21')](function(_0x50a24c){if(_0x50a24c){_0x369eec=_0x50a24c;_0x4f5cb0[_0x25e6('0x51')]=_['keys'](db[_0x25e6('0xd3')][_0x25e6('0x47')]);_0x4f5cb0[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x8e91c7[_0x25e6('0x4e')]);_0x4f5cb0['filters']=_[_0x25e6('0x50')](_0x4f5cb0['model'],_0x4f5cb0[_0x25e6('0x4e')]);_0x510b8a['attributes']=_[_0x25e6('0x50')](_0x4f5cb0[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0x8e91c7[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x510b8a[_0x25e6('0x52')]=_0x510b8a[_0x25e6('0x52')][_0x25e6('0x54')]?_0x510b8a[_0x25e6('0x52')]:_0x4f5cb0['model'];_0x510b8a[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0x8e91c7[_0x25e6('0x4e')]['sort']);_0x510b8a[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x8e91c7['query'],_0x4f5cb0[_0x25e6('0x4f')]));if(_0x8e91c7[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x510b8a['where']=_['merge'](_0x510b8a['where'],{'$or':_['map'](_0x510b8a[_0x25e6('0x52')],function(_0xd68225){var _0x2076a9={};_0x2076a9[_0xd68225]={'$like':'%'+_0x8e91c7[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x2076a9;})});}_0x510b8a=_[_0x25e6('0x5b')]({},_0x510b8a,_0x8e91c7[_0x25e6('0x60')]);return _0x369eec[_0x25e6('0xd2')](_0x510b8a);}})['then'](function(_0x215de2){if(_0x215de2){_0x341c3a=_0x215de2[_0x25e6('0x54')];if(!_0x8e91c7[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x510b8a[_0x25e6('0x2f')]=qs['limit'](_0x8e91c7[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x510b8a[_0x25e6('0x2e')]=qs[_0x25e6('0x2e')](_0x8e91c7[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x369eec[_0x25e6('0xd2')](_0x510b8a);}})[_0x25e6('0x21')](function(_0x4fa133){if(_0x4fa133){return _0x4fa133?{'count':_0x341c3a,'rows':_0x4fa133}:null;}})[_0x25e6('0x21')](respondWithResult(_0x31d5b7,null))[_0x25e6('0x65')](handleError(_0x31d5b7,null));};exports[_0x25e6('0xd4')]=function(_0x36987e,_0x89ab95,_0x41f5c5){var _0x4326d5;var _0x563392;var _0x12eab4;var _0x540bb2=!_[_0x25e6('0x7e')](_0x36987e[_0x25e6('0x67')]['id'])?_0x36987e['params']['id']:!_['isNil'](_0x36987e['user']['id'])?_0x36987e['user']['id']:null;return db[_0x25e6('0x61')]['find']({'where':{'id':_0x540bb2,'role':'agent'},'attributes':['id',_0x25e6('0x43'),_0x25e6('0xd5'),_0x25e6('0xd6'),_0x25e6('0x41'),_0x25e6('0x79'),_0x25e6('0xd7')]})['then'](handleEntityNotFound(_0x89ab95,null))['then'](function(_0x18655e){if(_0x18655e){_0x4326d5=_0x18655e;if(_0x36987e[_0x25e6('0x6b')][_0x25e6('0xa2')]){_0x12eab4=util[_0x25e6('0x76')](_0x25e6('0xd8'),_0x4326d5[_0x36987e[_0x25e6('0x6b')][_0x25e6('0xa2')]]);}else if(_0x36987e[_0x25e6('0x6b')][_0x25e6('0xd9')]){_0x12eab4=util[_0x25e6('0x76')]('SIP/%s',_0x36987e[_0x25e6('0x6b')][_0x25e6('0xd9')]);}else{_0x12eab4=util[_0x25e6('0x76')](_0x25e6('0xae'),_0x4326d5[_0x25e6('0x43')]);}socket['to'](util[_0x25e6('0x76')](_0x25e6('0xda'),_0x4326d5[_0x25e6('0x43')]))[_0x25e6('0xaa')](_0x25e6('0xdb'),{'ip':_0x36987e[_0x25e6('0xdc')][_0x25e6('0xdd')]||_0x36987e[_0x25e6('0xde')][_0x25e6('0xdf')]||_0x36987e[_0x25e6('0xe0')][_0x25e6('0xdf')]||_0x36987e[_0x25e6('0xde')][_0x25e6('0xe0')][_0x25e6('0xdf')]});return db[_0x25e6('0xb0')][_0x25e6('0x35')]({'where':{'membername':_0x4326d5[_0x25e6('0x43')]},'individualHooks':!![]});}})[_0x25e6('0x21')](function(_0x328f2c){if(_0x4326d5){return _0x4326d5[_0x25e6('0xe1')]({'raw':!![]});}})[_0x25e6('0x21')](function(_0x5b2d5f){var _0x484838=[];if(_0x5b2d5f){_0x563392=_0x5b2d5f;if(_0x563392['length']){for(var _0x51c332=0x0;_0x51c332<_0x563392['length'];_0x51c332++){_0x484838[_0x25e6('0xe2')]({'membername':_0x4326d5[_0x25e6('0x43')],'UserId':_0x4326d5['id'],'queue_name':_0x563392[_0x51c332][_0x25e6('0x43')],'VoiceQueueId':_0x563392[_0x51c332]['id'],'interface':_0x12eab4,'paused':_0x4326d5[_0x25e6('0xd7')]||![],'penalty':_0x563392[_0x51c332][_0x25e6('0xe3')]||0x0});}return BPromise['each'](_0x484838,function(_0x555fd5){return db[_0x25e6('0xb0')]['upsert'](_0x555fd5);});}}})[_0x25e6('0x21')](function(){return db[_0x25e6('0xe4')][_0x25e6('0x63')]({'where':{'membername':_0x4326d5[_0x25e6('0x43')],'exitAt':null}});})[_0x25e6('0x21')](function(_0x13f6d6){var _0x1666b3=[];_0x13f6d6[_0x25e6('0xe5')](function(_0x5df349){_0x1666b3[_0x25e6('0xe2')](_0x5df349[_0x25e6('0x6c')]({'exitAt':moment()[_0x25e6('0x76')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x1666b3);})[_0x25e6('0x21')](function(){var _0x13e952=[];var _0x16e9d9=[];var _0x32f006=utils['getChannels']();var _0x5c5889={'membername':_0x4326d5['name'],'interface':_0x12eab4,'enterAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6')),'role':_0x4326d5['role'],'internal':_0x4326d5[_0x25e6('0x79')]};_0x32f006[_0x25e6('0xe5')](function(_0x2b95b6){_0x13e952[_0x25e6('0xe2')](_[_0x25e6('0x5b')]({'channel':_0x2b95b6,'type':_0x25e6('0xe7'),'data1':_0x36987e[_0x25e6('0x6b')][_0x25e6('0xe8')],'data2':_0x12eab4},_0x5c5889));if(_0x4326d5[_0x25e6('0xd7')]){_0x16e9d9[_0x25e6('0xe2')](_['merge']({'channel':_0x2b95b6,'type':'PAUSE','data1':_0x25e6('0xe9')},_0x5c5889));}});return db[_0x25e6('0xe4')][_0x25e6('0x6a')](_0x13e952[_0x25e6('0xea')](_0x16e9d9),{'individualHooks':!![]});})[_0x25e6('0x21')](function(){return _0x4326d5[_0x25e6('0x6c')]({'online':!![],'lastLoginAt':moment()[_0x25e6('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4326d5[_0x25e6('0xd7')]||![],'mailPause':_0x4326d5['loginInPause']||![],'chatPause':_0x4326d5[_0x25e6('0xd7')]||![],'faxPause':_0x4326d5[_0x25e6('0xd7')]||![],'smsPause':_0x4326d5[_0x25e6('0xd7')]||![],'openchannelPause':_0x4326d5[_0x25e6('0xd7')]||![],'pauseType':_0x4326d5[_0x25e6('0xd7')]?_0x25e6('0xe9'):null,'interface':_0x12eab4,'lastPauseAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6'))});})[_0x25e6('0x21')](function(_0x22b55c){if(_0x36987e[_0x25e6('0xeb')]){return _0x41f5c5();}else{return BPromise['resolve'](_0x22b55c)[_0x25e6('0x21')](respondWithResult(_0x89ab95,null));}})[_0x25e6('0x65')](handleError(_0x89ab95,null));};exports['logout']=function(_0x4bc4a7,_0x42967f,_0x203354){var _0x410120;return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x4bc4a7[_0x25e6('0x67')]['id'],'role':_0x25e6('0x39')},'attributes':['id',_0x25e6('0x43'),_0x25e6('0x41')]})[_0x25e6('0x21')](handleEntityNotFound(_0x42967f,null))[_0x25e6('0x21')](function(_0x52579e){if(_0x52579e){_0x410120=_0x52579e;return db[_0x25e6('0xb0')]['destroy']({'where':{'membername':_0x410120[_0x25e6('0x43')]},'individualHooks':!![]});}})[_0x25e6('0x21')](function(){return db[_0x25e6('0xe4')][_0x25e6('0x63')]({'where':{'membername':_0x410120[_0x25e6('0x43')],'exitAt':null}});})[_0x25e6('0x21')](function(_0x4ee86a){var _0x550163=[];_0x4ee86a[_0x25e6('0xe5')](function(_0x34af3f){_0x550163[_0x25e6('0xe2')](_0x34af3f[_0x25e6('0x6c')]({'exitAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6'))}));});return BPromise[_0x25e6('0xec')](_0x550163);})[_0x25e6('0x21')](function(){return _0x410120[_0x25e6('0x6c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x25e6('0x21')](respondWithResult(_0x42967f,null))[_0x25e6('0x65')](handleError(_0x42967f,null));};exports[_0x25e6('0xed')]=function(_0x3b97b8,_0x32c500,_0x3c6490){var _0x1b0d9e;return db[_0x25e6('0xb0')]['update']({'paused':0x1},{'where':{'UserId':_0x3b97b8[_0x25e6('0x67')]['id']},'individualHooks':!![]})[_0x25e6('0x21')](function(){return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x3b97b8[_0x25e6('0x67')]['id'],'role':'agent'},'attributes':['id',_0x25e6('0x43'),'role',_0x25e6('0x79'),'interface']});})[_0x25e6('0x21')](handleEntityNotFound(_0x32c500,null))['then'](function(_0xe5877f){if(_0xe5877f){_0x1b0d9e=_0xe5877f;return respondWithRpcPromise('QueuePause',_0x25e6('0xed'),{'id':_0x1b0d9e['id'],'name':_0x1b0d9e[_0x25e6('0x43')],'pause':!![]});}})[_0x25e6('0x21')](function(){if(_0x1b0d9e){return db['MemberReport'][_0x25e6('0x63')]({'where':{'membername':_0x1b0d9e[_0x25e6('0x43')],'type':_0x25e6('0xee'),'exitAt':null}});}})[_0x25e6('0x21')](function(_0x1d5912){if(_0x1d5912['length']){var _0x5a6781=moment()[_0x25e6('0x76')](_0x25e6('0xe6'));for(var _0x399f67=0x0,_0x4175e1=_0x1d5912[_0x25e6('0x54')];_0x399f67<_0x4175e1;_0x399f67++){_0x1d5912[_0x399f67][_0x25e6('0xef')]({'exitAt':_0x5a6781});}}})['then'](function(){var _0x4130c2=[];var _0x4ca8fc=utils[_0x25e6('0xf0')]();_0x4ca8fc[_0x25e6('0xe5')](function(_0x3ba3b8){_0x4130c2[_0x25e6('0xe2')]({'channel':_0x3ba3b8,'membername':_0x1b0d9e['name'],'interface':_[_0x25e6('0x7e')](_0x1b0d9e['interface'])?util['format']('SIP/%s',_0x1b0d9e['name']):_0x1b0d9e[_0x25e6('0xa2')],'type':_0x25e6('0xee'),'enterAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6')),'data1':_0x3b97b8[_0x25e6('0x6b')][_0x25e6('0x49')]||_0x25e6('0xf1'),'role':_0x1b0d9e[_0x25e6('0x41')],'internal':_0x1b0d9e[_0x25e6('0x79')]});});return db['MemberReport']['bulkCreate'](_0x4130c2,{'individualHooks':!![]});})['then'](function(){return _0x1b0d9e[_0x25e6('0x6c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3b97b8[_0x25e6('0x6b')][_0x25e6('0x49')]||_0x25e6('0xf1'),'lastPauseAt':moment()[_0x25e6('0x76')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x32c500,null))[_0x25e6('0x65')](handleError(_0x32c500,null));};exports[_0x25e6('0xf2')]=function(_0x7a5c82,_0x45673c,_0x1fe680){var _0x494442;return db[_0x25e6('0x61')][_0x25e6('0x42')]({'where':{'id':_0x7a5c82[_0x25e6('0x67')]['id']},'attributes':['id','name','role','voicePause',_0x25e6('0xf3'),_0x25e6('0xf4'),'faxPause','openchannelPause',_0x25e6('0xf5'),_0x25e6('0xf6'),_0x25e6('0xf7')]})[_0x25e6('0x21')](handleEntityNotFound(_0x45673c,null))[_0x25e6('0x21')](function(_0x4d9f43){if(_0x4d9f43){_0x494442=_0x4d9f43;if(_0x7a5c82[_0x25e6('0x6b')][_0x25e6('0x9f')]&&!utils[_0x25e6('0xb3')](_0x7a5c82['body'][_0x25e6('0x9f')])){throw new db['Sequelize'][(_0x25e6('0x96'))](_0x25e6('0xa3'));}switch(_0x7a5c82[_0x25e6('0x6b')][_0x25e6('0x9f')]){case _0x25e6('0xac'):return respondWithRpcPromise(_0x25e6('0xf8'),_0x25e6('0xf2'),{'id':_0x494442['id'],'name':_0x494442[_0x25e6('0x43')],'pause':![]})[_0x25e6('0x21')](function(){return db['UserVoiceQueueRt'][_0x25e6('0x6c')]({'paused':0x0},{'where':{'UserId':_0x494442['id']},'individualHooks':!![]});})[_0x25e6('0x21')](function(){return db[_0x25e6('0xe4')][_0x25e6('0x42')]({'where':{'channel':_0x7a5c82['body'][_0x25e6('0x9f')],'membername':_0x494442['name'],'type':'PAUSE','exitAt':null}});})[_0x25e6('0x21')](function(_0x59f1b7){if(_0x59f1b7){return _0x59f1b7[_0x25e6('0x6c')]({'exitAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6')),'data2':_0x25e6('0xf9')},{'individualHooks':!![]});}return null;})[_0x25e6('0x21')](function(){return _0x494442[_0x25e6('0x6c')]({'voicePause':![]});});case _0x25e6('0xfa'):case _0x25e6('0xfb'):case'fax':case _0x25e6('0xfc'):case _0x25e6('0xfd'):return db['MemberReport'][_0x25e6('0x42')]({'where':{'channel':_0x7a5c82[_0x25e6('0x6b')][_0x25e6('0x9f')],'membername':_0x494442[_0x25e6('0x43')],'type':'PAUSE','exitAt':null}})[_0x25e6('0x21')](function(_0x29d09c){if(_0x29d09c){return _0x29d09c[_0x25e6('0x6c')]({'exitAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x3899f0={};_[_0x25e6('0x30')](_0x3899f0,util['format'](_0x25e6('0xfe'),_0x7a5c82[_0x25e6('0x6b')]['channel'],_0x25e6('0xff')),![]);return _0x494442[_0x25e6('0x6c')](_0x3899f0);});default:return respondWithRpcPromise(_0x25e6('0xf8'),_0x25e6('0xf2'),{'id':_0x494442['id'],'name':_0x494442[_0x25e6('0x43')],'pause':![]})[_0x25e6('0x21')](function(){return db[_0x25e6('0xb0')]['update']({'paused':0x0},{'where':{'UserId':_0x494442['id']}});})[_0x25e6('0x21')](function(){return db['MemberReport'][_0x25e6('0x63')]({'where':{'membername':_0x494442[_0x25e6('0x43')],'type':'PAUSE','exitAt':null}});})[_0x25e6('0x21')](function(_0x2cbe4e){var _0x54f18c=[];_0x2cbe4e[_0x25e6('0xe5')](function(_0x507166){_0x54f18c[_0x25e6('0xe2')](_0x507166[_0x25e6('0x6c')]({'exitAt':moment()[_0x25e6('0x76')](_0x25e6('0xe6')),'data2':_0x25e6('0xf9')}));});return BPromise[_0x25e6('0xec')](_0x54f18c);})[_0x25e6('0x21')](function(){return _0x494442[_0x25e6('0x6c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x25e6('0x21')](respondWithResult(_0x45673c,null))['catch'](handleError(_0x45673c,null));};exports[_0x25e6('0x100')]=function(_0x58982d,_0x219c87,_0x53f327){var _0x5892db={};var _0x54b438={};var _0x26896c;var _0x8d81cd;return db[_0x25e6('0x61')]['findOne']({'where':{'id':_0x58982d[_0x25e6('0x67')]['id']}})['then'](handleEntityNotFound(_0x219c87,null))[_0x25e6('0x21')](function(_0x1552ad){if(_0x1552ad){_0x26896c=_0x1552ad;_0x54b438[_0x25e6('0x51')]=_[_0x25e6('0x68')](db[_0x25e6('0x101')][_0x25e6('0x47')]);_0x54b438[_0x25e6('0x4e')]=_[_0x25e6('0x68')](_0x58982d[_0x25e6('0x4e')]);_0x54b438[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x54b438[_0x25e6('0x51')],_0x54b438[_0x25e6('0x4e')]);_0x5892db[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x54b438['model'],qs[_0x25e6('0x53')](_0x58982d[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x5892db[_0x25e6('0x52')]=_0x5892db[_0x25e6('0x52')]['length']?_0x5892db[_0x25e6('0x52')]:_0x54b438[_0x25e6('0x51')];_0x5892db[_0x25e6('0x57')]=qs[_0x25e6('0x58')](_0x58982d[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x5892db['where']=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0x58982d[_0x25e6('0x4e')],_0x54b438[_0x25e6('0x4f')]));if(_0x58982d[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x5892db['where']=_[_0x25e6('0x5b')](_0x5892db['where'],{'$or':_['map'](_0x5892db[_0x25e6('0x52')],function(_0x26c58f){var _0x4cb199={};_0x4cb199[_0x26c58f]={'$like':'%'+_0x58982d[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x4cb199;})});}_0x5892db=_[_0x25e6('0x5b')]({},_0x5892db,_0x58982d[_0x25e6('0x60')]);return _0x26896c['getTeams'](_0x5892db);}})[_0x25e6('0x21')](function(_0x244747){if(_0x244747){_0x8d81cd=_0x244747[_0x25e6('0x54')];if(!_0x58982d[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x5892db[_0x25e6('0x2f')]=qs['limit'](_0x58982d[_0x25e6('0x4e')][_0x25e6('0x2f')]);_0x5892db[_0x25e6('0x2e')]=qs['offset'](_0x58982d[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x26896c['getTeams'](_0x5892db);}})['then'](function(_0x5e22a7){if(_0x5e22a7){return _0x5e22a7?{'count':_0x8d81cd,'rows':_0x5e22a7}:null;}})['then'](respondWithResult(_0x219c87,null))['catch'](handleError(_0x219c87,null));};exports[_0x25e6('0x102')]=function(_0x28e4cf,_0x4d22d7){return db[_0x25e6('0x61')]['find']({'where':{'id':_0x28e4cf['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x4d22d7,null))[_0x25e6('0x21')](function(_0x2f6fb1){if(_0x2f6fb1){var _0x4de44b=_0x2f6fb1[_0x25e6('0x8f')]({'plain':!![]});return _0x2f6fb1[_0x25e6('0x102')](_0x28e4cf['body'][_0x25e6('0xa9')],_['omit'](_0x28e4cf[_0x25e6('0x6b')],['ids','id'])||{})[_0x25e6('0x21')](function(){for(var _0x476e9e=0x0;_0x476e9e<_0x28e4cf[_0x25e6('0x6b')][_0x25e6('0xa9')][_0x25e6('0x54')];_0x476e9e++){var _0x1edbc4=[];db['Team']['findOne']({'where':{'id':_0x28e4cf[_0x25e6('0x6b')][_0x25e6('0xa9')][_0x476e9e]}})[_0x25e6('0x21')](function(_0x1a17eb){_0x1edbc4[_0x25e6('0xe2')](_0x1a17eb[_0x25e6('0xe1')]()[_0x25e6('0x21')](function(_0x3bdbb8){for(var _0x434e4b=0x0;_0x434e4b<_0x3bdbb8[_0x25e6('0x54')];_0x434e4b++){_0x3bdbb8[_0x434e4b][_0x25e6('0x103')](_0x25e6('0x9f'),'Voice');}return _0x3bdbb8;}));_0x1edbc4['push'](_0x1a17eb[_0x25e6('0x104')]()['then'](function(_0x212615){for(var _0x418853=0x0;_0x418853<_0x212615[_0x25e6('0x54')];_0x418853++){_0x212615[_0x418853][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x105'));}return _0x212615;}));_0x1edbc4[_0x25e6('0xe2')](_0x1a17eb[_0x25e6('0x106')]()[_0x25e6('0x21')](function(_0x169c4b){for(var _0x5cd8a4=0x0;_0x5cd8a4<_0x169c4b['length'];_0x5cd8a4++){_0x169c4b[_0x5cd8a4][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x107'));}return _0x169c4b;}));_0x1edbc4['push'](_0x1a17eb[_0x25e6('0x108')]()['then'](function(_0x19f5e){for(var _0x546efb=0x0;_0x546efb<_0x19f5e[_0x25e6('0x54')];_0x546efb++){_0x19f5e[_0x546efb]['setDataValue']('channel',_0x25e6('0x109'));}return _0x19f5e;}));_0x1edbc4[_0x25e6('0xe2')](_0x1a17eb[_0x25e6('0x10a')]()['then'](function(_0x3d85ee){for(var _0x14e06b=0x0;_0x14e06b<_0x3d85ee['length'];_0x14e06b++){_0x3d85ee[_0x14e06b][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x10b'));}return _0x3d85ee;}));_0x1edbc4[_0x25e6('0xe2')](_0x1a17eb[_0x25e6('0x10c')]()[_0x25e6('0x21')](function(_0x131506){for(var _0x55afc4=0x0;_0x55afc4<_0x131506[_0x25e6('0x54')];_0x55afc4++){_0x131506[_0x55afc4][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x10d'));}return _0x131506;}));return BPromise[_0x25e6('0xec')](_0x1edbc4);})['then'](function(_0x15cd6b){var _0x5a5edd=_['flatten'](_0x15cd6b);_0x1edbc4=[];return db['sequelize'][_0x25e6('0x10e')](function(_0x418abd){for(var _0x2c1c02=0x0;_0x2c1c02<_0x5a5edd[_0x25e6('0x54')];_0x2c1c02++){_0x1edbc4[_0x25e6('0xe2')](_0x5a5edd[_0x2c1c02][_0x25e6('0x10f')](_0x4de44b['id']),{'transaction':_0x418abd});}return BPromise[_0x25e6('0xec')](_0x1edbc4)[_0x25e6('0x21')](function(){if(_0x4de44b[_0x25e6('0xa0')]){return BPromise[_0x25e6('0xaf')](_[_0x25e6('0x3c')](_0x5a5edd,function(_0x22a7ae){return _0x22a7ae['getDataValue'](_0x25e6('0x9f'))===_0x25e6('0x110');}),function(_0x474f56){return db[_0x25e6('0xb0')][_0x25e6('0xb1')]({'membername':_0x4de44b[_0x25e6('0x43')],'UserId':_0x4de44b['id'],'queue_name':_0x474f56[_0x25e6('0x43')],'VoiceQueueId':_0x474f56['id'],'interface':_['isNil'](_0x4de44b[_0x25e6('0xa2')])?util[_0x25e6('0x76')](_0x25e6('0xae'),_0x4de44b[_0x25e6('0x43')]):_0x4de44b[_0x25e6('0xa2')],'paused':_0x4de44b['voicePause']||![],'penalty':_0x4de44b['penalty']},{'transaction':_0x418abd});});}else{return;}})[_0x25e6('0x21')](function(){for(var _0x4180b6=0x0;_0x4180b6<_0x5a5edd['length'];_0x4180b6++){var _0x439092=_0x5a5edd[_0x4180b6][_0x25e6('0x111')](_0x25e6('0x9f'));var _0x51d4ca=_0x439092+'QueueId';socket[_0x25e6('0xaa')](_0x25e6('0x37')+_0x439092+_0x25e6('0xab'),{'UserId':_0x4de44b['id'],['queueField']:_0x5a5edd[_0x4180b6]['id']});}});});});}});}})[_0x25e6('0x21')](respondWithStatusCode(_0x4d22d7,null))[_0x25e6('0x65')](handleError(_0x4d22d7,null));};exports[_0x25e6('0x112')]=function(_0x422ccd,_0x3e46a9){return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x422ccd['params']['id']}})['then'](handleEntityNotFound(_0x3e46a9,null))[_0x25e6('0x21')](function(_0x43e856){if(_0x43e856){var _0x2cecad=_0x43e856[_0x25e6('0x8f')]({'plain':!![]});var _0x3dd0a2=_0x422ccd[_0x25e6('0x4e')][_0x25e6('0xa9')];return _0x43e856[_0x25e6('0x112')](_0x3dd0a2)[_0x25e6('0x21')](function(){for(var _0x4d337f=0x0;_0x4d337f<_0x3dd0a2[_0x25e6('0x54')];_0x4d337f++){var _0x49a0d1=[];db[_0x25e6('0x101')][_0x25e6('0x93')]({'where':{'id':_0x3dd0a2[_0x4d337f]}})[_0x25e6('0x21')](function(_0x37ffb9){_0x49a0d1[_0x25e6('0xe2')](_0x37ffb9[_0x25e6('0xe1')]()[_0x25e6('0x21')](function(_0x59610c){for(var _0x597f32=0x0;_0x597f32<_0x59610c['length'];_0x597f32++){_0x59610c[_0x597f32][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x110'));}return _0x59610c;}));_0x49a0d1['push'](_0x37ffb9[_0x25e6('0x104')]()[_0x25e6('0x21')](function(_0x234bfd){for(var _0x420874=0x0;_0x420874<_0x234bfd[_0x25e6('0x54')];_0x420874++){_0x234bfd[_0x420874]['setDataValue'](_0x25e6('0x9f'),'Chat');}return _0x234bfd;}));_0x49a0d1[_0x25e6('0xe2')](_0x37ffb9[_0x25e6('0x106')]()['then'](function(_0x47f47f){for(var _0x1a2340=0x0;_0x1a2340<_0x47f47f[_0x25e6('0x54')];_0x1a2340++){_0x47f47f[_0x1a2340][_0x25e6('0x103')]('channel','Mail');}return _0x47f47f;}));_0x49a0d1[_0x25e6('0xe2')](_0x37ffb9[_0x25e6('0x108')]()[_0x25e6('0x21')](function(_0x209495){for(var _0x10faae=0x0;_0x10faae<_0x209495['length'];_0x10faae++){_0x209495[_0x10faae][_0x25e6('0x103')]('channel',_0x25e6('0x109'));}return _0x209495;}));_0x49a0d1['push'](_0x37ffb9[_0x25e6('0x10a')]()[_0x25e6('0x21')](function(_0x5ffced){for(var _0x1c3333=0x0;_0x1c3333<_0x5ffced[_0x25e6('0x54')];_0x1c3333++){_0x5ffced[_0x1c3333][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x10b'));}return _0x5ffced;}));_0x49a0d1[_0x25e6('0xe2')](_0x37ffb9[_0x25e6('0x10c')]()[_0x25e6('0x21')](function(_0x3daaed){for(var _0x557e32=0x0;_0x557e32<_0x3daaed[_0x25e6('0x54')];_0x557e32++){_0x3daaed[_0x557e32][_0x25e6('0x103')](_0x25e6('0x9f'),_0x25e6('0x10d'));}return _0x3daaed;}));return BPromise['all'](_0x49a0d1);})[_0x25e6('0x21')](function(_0x1c8f28){var _0x52af92=_['flatten'](_0x1c8f28);_0x49a0d1=[];return db['sequelize'][_0x25e6('0x10e')](function(_0x388a20){for(var _0x4258a9=0x0;_0x4258a9<_0x52af92['length'];_0x4258a9++){_0x49a0d1[_0x25e6('0xe2')](_0x52af92[_0x4258a9][_0x25e6('0x113')](_0x2cecad['id']),{'transaction':_0x388a20});}return BPromise['all'](_0x49a0d1)['then'](function(){if(_0x2cecad[_0x25e6('0xa0')]){return BPromise['each'](_[_0x25e6('0x3c')](_0x52af92,function(_0x5eb9ba){return _0x5eb9ba[_0x25e6('0x111')](_0x25e6('0x9f'))===_0x25e6('0x110');}),function(_0x24cf83){return db[_0x25e6('0xb0')][_0x25e6('0x35')]({'where':{'VoiceQueueId':_0x24cf83['id'],'UserId':_0x2cecad['id']},'transaction':_0x388a20});});}else{return;}})[_0x25e6('0x21')](function(){for(var _0x21ca64=0x0;_0x21ca64<_0x52af92[_0x25e6('0x54')];_0x21ca64++){var _0x249acc=_0x52af92[_0x21ca64][_0x25e6('0x111')](_0x25e6('0x9f'));var _0x32d810=_0x249acc+'QueueId';socket['emit'](_0x25e6('0x37')+_0x249acc+_0x25e6('0xb5'),{'UserId':_0x2cecad['id'],['queueField']:_0x52af92[_0x21ca64]['id']});}});});});}});}})[_0x25e6('0x21')](respondWithStatusCode(_0x3e46a9,null))['catch'](handleError(_0x3e46a9,null));};exports[_0x25e6('0x114')]=function(_0xdb58d9,_0x243d45,_0x15c607){var _0x1f16b6={};var _0x39c268={};var _0x188c25;var _0x544349;return db['User'][_0x25e6('0x93')]({'where':{'id':_0xdb58d9[_0x25e6('0x67')]['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x243d45,null))[_0x25e6('0x21')](function(_0x70b35b){if(_0x70b35b){_0x188c25=_0x70b35b;_0x39c268[_0x25e6('0x51')]=_[_0x25e6('0x68')](db['CmList'][_0x25e6('0x47')]);_0x39c268['query']=_[_0x25e6('0x68')](_0xdb58d9[_0x25e6('0x4e')]);_0x39c268['filters']=_[_0x25e6('0x50')](_0x39c268[_0x25e6('0x51')],_0x39c268['query']);_0x1f16b6[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x39c268[_0x25e6('0x51')],qs[_0x25e6('0x53')](_0xdb58d9['query'][_0x25e6('0x53')]));_0x1f16b6[_0x25e6('0x52')]=_0x1f16b6[_0x25e6('0x52')][_0x25e6('0x54')]?_0x1f16b6['attributes']:_0x39c268[_0x25e6('0x51')];_0x1f16b6['order']=qs[_0x25e6('0x58')](_0xdb58d9[_0x25e6('0x4e')]['sort']);_0x1f16b6[_0x25e6('0x5a')]=qs[_0x25e6('0x4f')](_[_0x25e6('0x59')](_0xdb58d9[_0x25e6('0x4e')],_0x39c268[_0x25e6('0x4f')]));if(_0xdb58d9[_0x25e6('0x4e')][_0x25e6('0x3c')]){_0x1f16b6['where']=_[_0x25e6('0x5b')](_0x1f16b6[_0x25e6('0x5a')],{'$or':_['map'](_0x1f16b6['attributes'],function(_0x37c7e0){var _0x1bf631={};_0x1bf631[_0x37c7e0]={'$like':'%'+_0xdb58d9[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0x1bf631;})});}_0x1f16b6=_[_0x25e6('0x5b')]({},_0x1f16b6,_0xdb58d9[_0x25e6('0x60')]);return _0x188c25[_0x25e6('0x114')](_0x1f16b6);}})[_0x25e6('0x21')](function(_0x42a0e2){if(_0x42a0e2){_0x544349=_0x42a0e2[_0x25e6('0x54')];if(!_0xdb58d9[_0x25e6('0x4e')][_0x25e6('0x55')](_0x25e6('0x56'))){_0x1f16b6[_0x25e6('0x2f')]=qs['limit'](_0xdb58d9['query']['limit']);_0x1f16b6[_0x25e6('0x2e')]=qs[_0x25e6('0x2e')](_0xdb58d9[_0x25e6('0x4e')][_0x25e6('0x2e')]);}return _0x188c25[_0x25e6('0x114')](_0x1f16b6);}})['then'](function(_0x470dd0){if(_0x470dd0){return _0x470dd0?{'count':_0x544349,'rows':_0x470dd0}:null;}})['then'](respondWithResult(_0x243d45,null))[_0x25e6('0x65')](handleError(_0x243d45,null));};exports[_0x25e6('0x115')]=function(_0x2ed71a,_0x1bf5c8,_0x42d9bf){var _0x8a3f09={};var _0x5793f9={};var _0x143fe7;var _0x7053b4;return db[_0x25e6('0x61')][_0x25e6('0x93')]({'where':{'id':_0x2ed71a['params']['id']}})[_0x25e6('0x21')](handleEntityNotFound(_0x1bf5c8,null))['then'](function(_0x382bb7){if(_0x382bb7){_0x143fe7=_0x382bb7;_0x5793f9['model']=_[_0x25e6('0x68')](db[_0x25e6('0x61')][_0x25e6('0x47')]);_0x5793f9[_0x25e6('0x4e')]=_['keys'](_0x2ed71a[_0x25e6('0x4e')]);_0x5793f9[_0x25e6('0x4f')]=_[_0x25e6('0x50')](_0x5793f9[_0x25e6('0x51')],_0x5793f9['query']);_0x8a3f09[_0x25e6('0x52')]=_[_0x25e6('0x50')](_0x5793f9[_0x25e6('0x51')],qs['fields'](_0x2ed71a[_0x25e6('0x4e')][_0x25e6('0x53')]));_0x8a3f09[_0x25e6('0x52')]=_0x8a3f09[_0x25e6('0x52')]['length']?_0x8a3f09[_0x25e6('0x52')]:_0x5793f9[_0x25e6('0x51')];_0x8a3f09['order']=qs[_0x25e6('0x58')](_0x2ed71a[_0x25e6('0x4e')][_0x25e6('0x58')]);_0x8a3f09[_0x25e6('0x5a')]=qs['filters'](_['pick'](_0x2ed71a[_0x25e6('0x4e')],_0x5793f9[_0x25e6('0x4f')]));if(_0x2ed71a['query'][_0x25e6('0x3c')]){_0x8a3f09[_0x25e6('0x5a')]=_['merge'](_0x8a3f09[_0x25e6('0x5a')],{'$or':_[_0x25e6('0x3e')](_0x8a3f09[_0x25e6('0x52')],function(_0x1cfd6d){var _0xfd90ca={};_0xfd90ca[_0x1cfd6d]={'$like':'%'+_0x2ed71a[_0x25e6('0x4e')][_0x25e6('0x3c')]+'%'};return _0xfd90ca;})});}_0x8a3f09[_0x25e6('0x51')]=db[_0x25e6('0x61')];_0x8a3f09['as']=_0x25e6('0x38');_0x8a3f09=_['merge']({},_0x8a3f09,_0x2ed71a['options']);return _0x143fe7[_0x25e6('0xe1')]({'include':[_0x8a3f09]});}})[_0x25e6('0x21')](function(_0x51108c){if(_0x51108c){var _0x166e8b={},_0x5e7ae8=[],_0x16bd12=0x0;for(var _0x3d7bbe=0x0;_0x3d7bbe<_0x51108c[_0x25e6('0x54')];_0x3d7bbe+=0x1){for(var _0x423f91=0x0,_0x149abe;_0x423f91<_0x51108c[_0x3d7bbe][_0x25e6('0x38')][_0x25e6('0x54')];_0x423f91+=0x1){_0x149abe=_0x51108c[_0x3d7bbe][_0x25e6('0x38')][_0x423f91][_0x25e6('0x8f')]({'plain':!![]});_0x166e8b[_0x149abe['id']]=_0x149abe;}}_0x166e8b=_[_0x25e6('0x116')](_0x166e8b);for(var _0x4482cd=qs['offset'](_0x2ed71a[_0x25e6('0x4e')][_0x25e6('0x2e')]);_0x4482cd<_0x166e8b['length']&&_0x5e7ae8[_0x25e6('0x54')]=_0x3e04f8[_0x65c6('0x55')]){throw new Error(_0x65c6('0x56'));}})[_0x65c6('0x10')](function(){if(_0x47b5b5){return db[_0x65c6('0x2b')]['destroy']({'where':{'membername':_0x47b5b5['name']},'individualHooks':!![]});}})[_0x65c6('0x10')](function(){if(_0x47b5b5){return _0x47b5b5[_0x65c6('0x57')]({'raw':!![]});}})[_0x65c6('0x10')](function(_0x466f52){if(_0x47b5b5){if(_0x466f52){var _0x1350bf=[];_0x5c5af3=_0x466f52;if(_0x5c5af3[_0x65c6('0x2e')]){for(var _0x2d2538=0x0;_0x2d2538<_0x5c5af3['length'];_0x2d2538++){_0x1350bf[_0x65c6('0x33')](db[_0x65c6('0x2b')][_0x65c6('0x58')]({'membername':_0x47b5b5[_0x65c6('0x29')],'UserId':_0x47b5b5['id'],'queue_name':_0x5c5af3[_0x2d2538][_0x65c6('0x29')],'VoiceQueueId':_0x5c5af3[_0x2d2538]['id'],'interface':_0x16c58f,'paused':_0x47b5b5[_0x65c6('0x51')]||![],'penalty':_0x5c5af3[_0x2d2538]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x65c6('0x4b')](_0x1350bf);}}}})[_0x65c6('0x10')](function(){if(_0x47b5b5){return db[_0x65c6('0x2c')][_0x65c6('0x1d')]({'where':{'membername':_0x47b5b5[_0x65c6('0x29')],'exitAt':null}});}})['then'](function(_0x1f8477){if(_0x47b5b5){if(_0x1f8477&&_0x1f8477[_0x65c6('0x2e')]){var _0x31b68d=[];_0x1f8477[_0x65c6('0x32')](function(_0x2585bd){_0x31b68d[_0x65c6('0x33')](_0x2585bd['update']({'exitAt':moment()['format'](_0x65c6('0x2f'))}));});return BPromise['all'](_0x31b68d);}}})[_0x65c6('0x10')](function(_0x218052){if(_0x47b5b5){var _0x3d571a=[];var _0x7246f0=[];var _0x1441cd=utils['getChannels']();var _0x1aa660={'membername':_0x47b5b5['name'],'interface':_0x16c58f,'enterAt':moment()[_0x65c6('0x36')](_0x65c6('0x2f')),'role':_0x47b5b5[_0x65c6('0x3b')],'internal':_0x47b5b5[_0x65c6('0x2a')]};_0x1441cd[_0x65c6('0x32')](function(_0x1af989){_0x3d571a['push'](_[_0x65c6('0x59')]({'channel':_0x1af989,'type':_0x65c6('0x5a'),'data1':_0x65c6('0x5b'),'data2':_0x16c58f},_0x1aa660));if(_0x47b5b5[_0x65c6('0x51')]){_0x7246f0['push'](_[_0x65c6('0x59')]({'channel':_0x1af989,'type':_0x65c6('0x2d'),'data1':'LOGININPAUSE'},_0x1aa660));}});return db['MemberReport'][_0x65c6('0x5c')](_0x3d571a[_0x65c6('0x5d')](_0x7246f0),{'individualHooks':!![]});}})[_0x65c6('0x10')](function(){if(_0x47b5b5){return _0x47b5b5[_0x65c6('0x43')]({'online':!![],'lastLoginAt':moment()[_0x65c6('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x47b5b5['loginInPause']||![],'mailPause':_0x47b5b5[_0x65c6('0x51')]||![],'chatPause':_0x47b5b5[_0x65c6('0x51')]||![],'faxPause':_0x47b5b5[_0x65c6('0x51')]||![],'smsPause':_0x47b5b5['loginInPause']||![],'openchannelPause':_0x47b5b5[_0x65c6('0x51')]||![],'pauseType':_0x47b5b5[_0x65c6('0x51')]?_0x65c6('0x5e'):null,'lastPauseAt':moment()[_0x65c6('0x36')](_0x65c6('0x2f')),'interface':_0x16c58f});}})[_0x65c6('0x10')](function(_0x22f690){_0x35402c(_0x22f690);})[_0x65c6('0x1a')](function(_0x130bec){_0x576f67(_0x569ab3[_0x65c6('0x16')](0x1f4,_0x130bec[_0x65c6('0x18')]));});});}; \ No newline at end of file +var _0x69d1=['findAll','phone','loginInPause','count','agent','getLicense','agents','getVoiceQueues','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','options','where','attributes','limit','include','map','model','debug','raw','ShowUser','stringify','PauseUser','User','find','name','role','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','voice','system','mail','chat','sms','openchannel','set','%s%s','Pause','push','all','LogoutUser','destroy'];(function(_0x329fac,_0x43b216){var _0x42b353=function(_0x50e19b){while(--_0x50e19b){_0x329fac['push'](_0x329fac['shift']());}};_0x42b353(++_0x43b216);}(_0x69d1,0x1d4));var _0x169d=function(_0x3754c9,_0x43d6e7){_0x3754c9=_0x3754c9-0x0;var _0x40bdea=_0x69d1[_0x3754c9];return _0x40bdea;};'use strict';var _=require('lodash');var util=require(_0x169d('0x0'));var moment=require(_0x169d('0x1'));var BPromise=require('bluebird');var rs=require(_0x169d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x169d('0x3'))['db'];var utils=require(_0x169d('0x4'));var logger=require(_0x169d('0x5'))(_0x169d('0x6'));var config=require(_0x169d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x169d('0x8')]['http']({'port':0x232a});config[_0x169d('0x9')]=_[_0x169d('0xa')](config[_0x169d('0x9')],{'host':_0x169d('0xb'),'port':0x18eb});var socket=require(_0x169d('0xc'))(new Redis(config['redis']));require(_0x169d('0xd'))[_0x169d('0xe')](socket);function respondWithRpcPromise(_0x816fdb,_0x2adcc1,_0x336fac){return new BPromise(function(_0x4e57f1,_0x54aea8){return client['request'](_0x816fdb,_0x336fac)[_0x169d('0xf')](function(_0x477d0e){logger[_0x169d('0x10')](_0x169d('0x11'),_0x2adcc1,_0x169d('0x12'));logger['debug'](_0x169d('0x13'),_0x2adcc1,_0x169d('0x12'),JSON['stringify'](_0x477d0e));if(_0x477d0e[_0x169d('0x14')]){if(_0x477d0e[_0x169d('0x14')][_0x169d('0x15')]===0x1f4){logger[_0x169d('0x14')]('User,\x20%s,\x20%s',_0x2adcc1,_0x477d0e['error'][_0x169d('0x16')]);return _0x54aea8(_0x477d0e[_0x169d('0x14')][_0x169d('0x16')]);}logger['error'](_0x169d('0x11'),_0x2adcc1,_0x477d0e['error']['message']);return _0x4e57f1(_0x477d0e[_0x169d('0x14')]['message']);}else{logger[_0x169d('0x10')](_0x169d('0x11'),_0x2adcc1,_0x169d('0x12'));_0x4e57f1(_0x477d0e[_0x169d('0x17')][_0x169d('0x16')]);}})[_0x169d('0x18')](function(_0x1368af){logger[_0x169d('0x14')](_0x169d('0x11'),_0x2adcc1,_0x1368af);_0x54aea8(_0x1368af);});});}exports[_0x169d('0x19')]=function(_0x4257e5){var _0x877ccf=this;return new Promise(function(_0x594db9,_0x31c472){return db['User']['findAll']({'raw':_0x4257e5[_0x169d('0x1a')]?_0x4257e5[_0x169d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4257e5[_0x169d('0x1a')]?_0x4257e5[_0x169d('0x1a')][_0x169d('0x1b')]||null:null,'attributes':_0x4257e5[_0x169d('0x1a')]?_0x4257e5[_0x169d('0x1a')][_0x169d('0x1c')]||null:null,'limit':_0x4257e5['options']?_0x4257e5[_0x169d('0x1a')][_0x169d('0x1d')]||null:null,'include':_0x4257e5['options']?_0x4257e5[_0x169d('0x1a')][_0x169d('0x1e')]?_[_0x169d('0x1f')](_0x4257e5[_0x169d('0x1a')][_0x169d('0x1e')],function(_0xf7768e){return{'model':db[_0xf7768e[_0x169d('0x20')]],'as':_0xf7768e['as'],'attributes':_0xf7768e[_0x169d('0x1c')],'include':_0xf7768e[_0x169d('0x1e')]?_[_0x169d('0x1f')](_0xf7768e[_0x169d('0x1e')],function(_0x3f046c){return{'model':db[_0x3f046c['model']],'as':_0x3f046c['as'],'attributes':_0x3f046c[_0x169d('0x1c')],'include':_0x3f046c[_0x169d('0x1e')]?_['map'](_0x3f046c[_0x169d('0x1e')],function(_0x5ca80b){return{'model':db[_0x5ca80b[_0x169d('0x20')]],'as':_0x5ca80b['as'],'attributes':_0x5ca80b[_0x169d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d3e1a){logger[_0x169d('0x10')](_0x169d('0x19'),_0x4257e5);logger[_0x169d('0x21')](_0x169d('0x19'),_0x4257e5,JSON['stringify'](_0x4d3e1a));_0x594db9(_0x4d3e1a);})['catch'](function(_0x3f578c){logger[_0x169d('0x14')](_0x169d('0x19'),_0x3f578c[_0x169d('0x16')],_0x4257e5);_0x31c472(_0x877ccf[_0x169d('0x14')](0x1f4,_0x3f578c[_0x169d('0x16')]));});});};exports['ShowUser']=function(_0x391298){var _0x45a45b=this;return new Promise(function(_0x1e976c,_0x1e5de2){return db['User']['find']({'raw':_0x391298[_0x169d('0x1a')]?_0x391298['options'][_0x169d('0x22')]===undefined?!![]:![]:!![],'where':_0x391298[_0x169d('0x1a')]?_0x391298[_0x169d('0x1a')]['where']||null:null,'attributes':_0x391298[_0x169d('0x1a')]?_0x391298['options'][_0x169d('0x1c')]||null:null,'include':_0x391298[_0x169d('0x1a')]?_0x391298['options'][_0x169d('0x1e')]?_[_0x169d('0x1f')](_0x391298[_0x169d('0x1a')][_0x169d('0x1e')],function(_0x3312db){return{'model':db[_0x3312db['model']],'as':_0x3312db['as'],'attributes':_0x3312db['attributes'],'include':_0x3312db['include']?_[_0x169d('0x1f')](_0x3312db[_0x169d('0x1e')],function(_0x20080b){return{'model':db[_0x20080b[_0x169d('0x20')]],'as':_0x20080b['as'],'attributes':_0x20080b['attributes'],'include':_0x20080b[_0x169d('0x1e')]?_[_0x169d('0x1f')](_0x20080b[_0x169d('0x1e')],function(_0x11e2c2){return{'model':db[_0x11e2c2[_0x169d('0x20')]],'as':_0x11e2c2['as'],'attributes':_0x11e2c2[_0x169d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x169d('0xf')](function(_0x194e8d){logger[_0x169d('0x10')](_0x169d('0x23'),_0x391298);logger['debug'](_0x169d('0x23'),_0x391298,JSON[_0x169d('0x24')](_0x194e8d));_0x1e976c(_0x194e8d);})[_0x169d('0x18')](function(_0x1b1826){logger[_0x169d('0x14')](_0x169d('0x23'),_0x1b1826[_0x169d('0x16')],_0x391298);_0x1e5de2(_0x45a45b[_0x169d('0x14')](0x1f4,_0x1b1826[_0x169d('0x16')]));});});};exports[_0x169d('0x25')]=function(_0x18c51d){var _0x59dae6=this;return new Promise(function(_0x4d3579,_0xad2545){var _0x18df5d;return db[_0x169d('0x26')][_0x169d('0x27')]({'where':_0x18c51d[_0x169d('0x1a')][_0x169d('0x1b')]||{},'attributes':['id',_0x169d('0x28'),_0x169d('0x29'),'internal',_0x169d('0x2a')]})['then'](function(_0x202e08){if(_0x202e08){_0x18df5d=_0x202e08;return db[_0x169d('0x2b')][_0x169d('0x2c')]({'paused':0x1},{'where':{'UserId':_0x18df5d['id']},'individualHooks':!![]});}})['then'](function(){if(_0x18df5d){return db[_0x169d('0x2d')]['findAll']({'where':{'membername':_0x18df5d[_0x169d('0x28')],'type':_0x169d('0x2e'),'exitAt':null}});}})[_0x169d('0xf')](function(_0x3ff06e){if(_0x18df5d){if(_0x3ff06e&&_0x3ff06e[_0x169d('0x2f')]){var _0x308974=moment()[_0x169d('0x30')](_0x169d('0x31'));for(var _0x53c627=0x0,_0x3af67c=_0x3ff06e['length'];_0x53c627<_0x3af67c;_0x53c627++){_0x3ff06e[_0x53c627][_0x169d('0x32')]({'exitAt':_0x308974});}}}})['then'](function(){if(_0x18df5d){var _0x29580f=[];var _0x5669f1=utils[_0x169d('0x33')]();_0x5669f1[_0x169d('0x34')](function(_0xf0d057){_0x29580f['push']({'channel':_0xf0d057,'membername':_0x18df5d['name'],'interface':_[_0x169d('0x35')](_0x18df5d[_0x169d('0x2a')])?util[_0x169d('0x30')](_0x169d('0x36'),_0x18df5d[_0x169d('0x28')]):_0x18df5d[_0x169d('0x2a')],'type':_0x169d('0x2e'),'enterAt':moment()[_0x169d('0x30')](_0x169d('0x31')),'data1':_0x18c51d[_0x169d('0x37')][_0x169d('0x38')]||_0x169d('0x39'),'role':_0x18df5d['role'],'internal':_0x18df5d[_0x169d('0x3a')],'uniqueid':_0x18c51d[_0x169d('0x37')][_0x169d('0x3b')]||null});});return db[_0x169d('0x2d')][_0x169d('0x3c')](_0x29580f,{'individualHooks':!![]});}})[_0x169d('0xf')](function(){if(_0x18df5d){return _0x18df5d[_0x169d('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x18c51d['body'][_0x169d('0x38')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x169d('0x30')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x169d('0xf')](function(_0x589601){_0x4d3579(_0x589601);})[_0x169d('0x18')](function(_0x1e4b21){_0xad2545(_0x59dae6['error'](0x1f4,_0x1e4b21[_0x169d('0x16')]));});});};exports[_0x169d('0x3d')]=function(_0x1ec9d7){var _0x577d1b=this;return new Promise(function(_0x4aa76d,_0x13730e){var _0x39c01e;return db[_0x169d('0x26')][_0x169d('0x3e')]({'where':_0x1ec9d7[_0x169d('0x1a')][_0x169d('0x1b')]||{},'attributes':['id',_0x169d('0x28')]})['then'](function(_0x2895df){if(_0x2895df){_0x39c01e=_0x2895df;if(_0x1ec9d7[_0x169d('0x37')][_0x169d('0x3f')]&&!utils[_0x169d('0x40')](_0x1ec9d7[_0x169d('0x37')][_0x169d('0x3f')])){throw new Error('Unknown\x20channel');}switch(_0x1ec9d7[_0x169d('0x37')][_0x169d('0x3f')]){case _0x169d('0x41'):return db['UserVoiceQueueRt'][_0x169d('0x2c')]({'paused':0x0},{'where':{'UserId':_0x39c01e['id']}})[_0x169d('0xf')](function(){return db['MemberReport'][_0x169d('0x27')]({'where':{'channel':_0x1ec9d7['body']['channel'],'membername':_0x39c01e[_0x169d('0x28')],'type':_0x169d('0x2e'),'exitAt':null}});})[_0x169d('0xf')](function(_0xd5de28){if(_0xd5de28){return _0xd5de28['update']({'exitAt':moment()[_0x169d('0x30')](_0x169d('0x31')),'data2':_0x169d('0x42')},{'individualHooks':!![]});}return null;})[_0x169d('0xf')](function(){return _0x39c01e[_0x169d('0x2c')]({'voicePause':![]});});case _0x169d('0x43'):case _0x169d('0x44'):case'fax':case _0x169d('0x45'):case _0x169d('0x46'):return db[_0x169d('0x2d')][_0x169d('0x27')]({'where':{'channel':_0x1ec9d7['body'][_0x169d('0x3f')],'membername':_0x39c01e[_0x169d('0x28')],'type':_0x169d('0x2e'),'exitAt':null}})[_0x169d('0xf')](function(_0x441110){return _0x441110[_0x169d('0x2c')]({'exitAt':moment()['format'](_0x169d('0x31')),'data2':_0x169d('0x42')},{'individualHooks':!![]});})['then'](function(){var _0x57f30a={};_[_0x169d('0x47')](_0x57f30a,util[_0x169d('0x30')](_0x169d('0x48'),_0x1ec9d7[_0x169d('0x37')][_0x169d('0x3f')],_0x169d('0x49')),![]);return _0x39c01e['update'](_0x57f30a);});default:return db[_0x169d('0x2b')][_0x169d('0x2c')]({'paused':0x0},{'where':{'UserId':_0x39c01e['id']}})[_0x169d('0xf')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x39c01e['name'],'type':_0x169d('0x2e'),'exitAt':null}});})[_0x169d('0xf')](function(_0x17ce9a){var _0x10c1ec=[];_0x17ce9a[_0x169d('0x34')](function(_0x20a311){_0x10c1ec[_0x169d('0x4a')](_0x20a311[_0x169d('0x2c')]({'exitAt':moment()[_0x169d('0x30')](_0x169d('0x31')),'data2':'system'}));});return BPromise[_0x169d('0x4b')](_0x10c1ec);})[_0x169d('0xf')](function(){return _0x39c01e[_0x169d('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x169d('0xf')](function(_0x245cf4){_0x4aa76d(_0x245cf4);})[_0x169d('0x18')](function(_0x56a146){_0x13730e(_0x577d1b['error'](0x1f4,_0x56a146[_0x169d('0x16')]));});});};exports[_0x169d('0x4c')]=function(_0x5e856e){var _0x4434a3=this;return new Promise(function(_0x4d0350,_0x1e5cd6){var _0x5047ff;return db[_0x169d('0x26')][_0x169d('0x3e')]({'where':_0x5e856e[_0x169d('0x1a')][_0x169d('0x1b')]||{},'attributes':['id','name']})[_0x169d('0xf')](function(_0x2a12b6){if(_0x2a12b6){_0x5047ff=_0x2a12b6;return db[_0x169d('0x2b')][_0x169d('0x4d')]({'where':{'membername':_0x5047ff['name']},'individualHooks':!![]});}})['then'](function(){if(_0x5047ff){return db[_0x169d('0x2d')][_0x169d('0x4e')]({'where':{'membername':_0x5047ff['name'],'exitAt':null}});}})['then'](function(_0x4ebd53){if(_0x5047ff){if(_0x4ebd53&&_0x4ebd53[_0x169d('0x2f')]){var _0x3b9050=[];_0x4ebd53[_0x169d('0x34')](function(_0x3365f3){_0x3b9050[_0x169d('0x4a')](_0x3365f3[_0x169d('0x2c')]({'exitAt':moment()[_0x169d('0x30')](_0x169d('0x31'))}));});return BPromise['all'](_0x3b9050);}}})[_0x169d('0xf')](function(){if(_0x5047ff){return _0x5047ff[_0x169d('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x169d('0xf')](function(_0x57ec70){_0x4d0350(_0x57ec70);})[_0x169d('0x18')](function(_0x44591f){_0x1e5cd6(_0x4434a3[_0x169d('0x14')](0x1f4,_0x44591f[_0x169d('0x16')]));});});};exports['LoginUser']=function(_0x372bca){var _0x2fc80f=this;return new Promise(function(_0x34b12f,_0x5704ed){var _0x55bbd1;var _0x35d08b;var _0x1b155a;var _0x1ad55d;return db[_0x169d('0x26')]['findOne']({'where':_0x372bca[_0x169d('0x1a')]['where']||{},'attributes':['id',_0x169d('0x28'),_0x169d('0x29'),'mobile',_0x169d('0x4f'),'internal',_0x169d('0x50'),_0x169d('0x2a')]})[_0x169d('0xf')](function(_0x4115e5){if(_0x4115e5){_0x55bbd1=_0x4115e5;_0x1ad55d=_0x372bca[_0x169d('0x37')][_0x169d('0x2a')]?_0x372bca['body']['interface']:util['format']('SIP/%s',_0x55bbd1['name']);return db[_0x169d('0x26')][_0x169d('0x51')]({'where':{'role':_0x169d('0x52'),'online':!![],'id':{'$ne':_0x55bbd1['id']}}});}})[_0x169d('0xf')](function(_0x1a27ad){if(_0x1a27ad){_0x1b155a=_0x1a27ad;return require('../../config/license/util')[_0x169d('0x53')]();}})['then'](function(_0x362d51){if(_0x362d51&&_0x362d51['agents']&&_0x1b155a>=_0x362d51[_0x169d('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x169d('0xf')](function(){if(_0x55bbd1){return db['UserVoiceQueueRt'][_0x169d('0x4d')]({'where':{'membername':_0x55bbd1[_0x169d('0x28')]},'individualHooks':!![]});}})[_0x169d('0xf')](function(){if(_0x55bbd1){return _0x55bbd1[_0x169d('0x55')]({'raw':!![]});}})[_0x169d('0xf')](function(_0x57cfeb){if(_0x55bbd1){if(_0x57cfeb){var _0x10d71a=[];_0x35d08b=_0x57cfeb;if(_0x35d08b[_0x169d('0x2f')]){for(var _0x187a18=0x0;_0x187a18<_0x35d08b[_0x169d('0x2f')];_0x187a18++){_0x10d71a[_0x169d('0x4a')](db[_0x169d('0x2b')]['upsert']({'membername':_0x55bbd1['name'],'UserId':_0x55bbd1['id'],'queue_name':_0x35d08b[_0x187a18][_0x169d('0x28')],'VoiceQueueId':_0x35d08b[_0x187a18]['id'],'interface':_0x1ad55d,'paused':_0x55bbd1[_0x169d('0x50')]||![],'penalty':_0x35d08b[_0x187a18]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x169d('0x4b')](_0x10d71a);}}}})[_0x169d('0xf')](function(){if(_0x55bbd1){return db['MemberReport'][_0x169d('0x4e')]({'where':{'membername':_0x55bbd1['name'],'exitAt':null}});}})['then'](function(_0x34d344){if(_0x55bbd1){if(_0x34d344&&_0x34d344[_0x169d('0x2f')]){var _0x1ade9d=[];_0x34d344[_0x169d('0x34')](function(_0x4b6608){_0x1ade9d[_0x169d('0x4a')](_0x4b6608[_0x169d('0x2c')]({'exitAt':moment()['format'](_0x169d('0x31'))}));});return BPromise[_0x169d('0x4b')](_0x1ade9d);}}})[_0x169d('0xf')](function(_0x416dd8){if(_0x55bbd1){var _0x259256=[];var _0x5ab4f1=[];var _0x160de5=utils[_0x169d('0x33')]();var _0x44017d={'membername':_0x55bbd1[_0x169d('0x28')],'interface':_0x1ad55d,'enterAt':moment()['format'](_0x169d('0x31')),'role':_0x55bbd1[_0x169d('0x29')],'internal':_0x55bbd1[_0x169d('0x3a')]};_0x160de5[_0x169d('0x34')](function(_0x3c8af9){_0x259256[_0x169d('0x4a')](_[_0x169d('0x56')]({'channel':_0x3c8af9,'type':_0x169d('0x57'),'data1':_0x169d('0x58'),'data2':_0x1ad55d},_0x44017d));if(_0x55bbd1[_0x169d('0x50')]){_0x5ab4f1[_0x169d('0x4a')](_['merge']({'channel':_0x3c8af9,'type':_0x169d('0x2e'),'data1':_0x169d('0x59')},_0x44017d));}});return db[_0x169d('0x2d')][_0x169d('0x3c')](_0x259256[_0x169d('0x5a')](_0x5ab4f1),{'individualHooks':!![]});}})[_0x169d('0xf')](function(){if(_0x55bbd1){return _0x55bbd1[_0x169d('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x169d('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x55bbd1[_0x169d('0x50')]||![],'mailPause':_0x55bbd1['loginInPause']||![],'chatPause':_0x55bbd1[_0x169d('0x50')]||![],'faxPause':_0x55bbd1[_0x169d('0x50')]||![],'smsPause':_0x55bbd1[_0x169d('0x50')]||![],'openchannelPause':_0x55bbd1[_0x169d('0x50')]||![],'pauseType':_0x55bbd1[_0x169d('0x50')]?_0x169d('0x59'):null,'lastPauseAt':moment()[_0x169d('0x30')](_0x169d('0x31')),'interface':_0x1ad55d});}})[_0x169d('0xf')](function(_0x20d149){_0x34b12f(_0x20d149);})['catch'](function(_0x3ec431){_0x5704ed(_0x2fc80f['error'](0x1f4,_0x3ec431[_0x169d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 366a940..5e317f1 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 _0x61d7=['update','removeListener','register','length','user:'];(function(_0x3d41be,_0x1f3920){var _0x224664=function(_0xb88f32){while(--_0xb88f32){_0x3d41be['push'](_0x3d41be['shift']());}};_0x224664(++_0x1f3920);}(_0x61d7,0x163));var _0x761d=function(_0x28b703,_0xd0566c){_0x28b703=_0x28b703-0x0;var _0x28279e=_0x61d7[_0x28b703];return _0x28279e;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x761d('0x0')];function createListener(_0x309c2b,_0x39718a){return function(_0x10a098){_0x39718a['emit'](_0x309c2b,_0x10a098);};}function removeListener(_0x2136a6,_0x431795){return function(){UserEvents[_0x761d('0x1')](_0x2136a6,_0x431795);};}exports[_0x761d('0x2')]=function(_0x30126c){for(var _0x295e91=0x0,_0xf36eeb=events[_0x761d('0x3')];_0x295e91<_0xf36eeb;_0x295e91++){var _0x202a32=events[_0x295e91];var _0x42a0c8=createListener(_0x761d('0x4')+_0x202a32,_0x30126c);UserEvents['on'](_0x202a32,_0x42a0c8);}}; \ No newline at end of file +var _0xc175=['removeListener','register','length','update','emit'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0xc175,0x19d));var _0x5c17=function(_0x3b03d5,_0x534a88){_0x3b03d5=_0x3b03d5-0x0;var _0x272073=_0xc175[_0x3b03d5];return _0x272073;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x5c17('0x0')];function createListener(_0x7a49f,_0x23c23d){return function(_0x23ea31){_0x23c23d[_0x5c17('0x1')](_0x7a49f,_0x23ea31);};}function removeListener(_0x3d59da,_0x375733){return function(){UserEvents[_0x5c17('0x2')](_0x3d59da,_0x375733);};}exports[_0x5c17('0x3')]=function(_0x249523){for(var _0x304741=0x0,_0x41bcbc=events[_0x5c17('0x4')];_0x304741<_0x41bcbc;_0x304741++){var _0x52c089=events[_0x304741];var _0x4aa563=createListener('user:'+_0x52c089,_0x249523);UserEvents['on'](_0x52c089,_0x4aa563);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index cf8cc3d..ec26963 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 _0x8031=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','util'];(function(_0x3b9861,_0x56aeb7){var _0xec3969=function(_0x13d973){while(--_0x13d973){_0x3b9861['push'](_0x3b9861['shift']());}};_0xec3969(++_0x56aeb7);}(_0x8031,0x1d7));var _0x1803=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x8031[_0x368fb9];return _0x4892fb;};'use strict';var multer=require('multer');var util=require(_0x1803('0x0'));var path=require(_0x1803('0x1'));var timeout=require(_0x1803('0x2'));var express=require(_0x1803('0x3'));var router=express[_0x1803('0x4')]();var auth=require(_0x1803('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1803('0x6'));module[_0x1803('0x7')]=router; \ No newline at end of file +var _0xb44a=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','exports'];(function(_0x5a6de2,_0x5c8b10){var _0x2c0525=function(_0x59d072){while(--_0x59d072){_0x5a6de2['push'](_0x5a6de2['shift']());}};_0x2c0525(++_0x5c8b10);}(_0xb44a,0x138));var _0xab44=function(_0x52ece1,_0x425dc5){_0x52ece1=_0x52ece1-0x0;var _0x329205=_0xb44a[_0x52ece1];return _0x329205;};'use strict';var multer=require(_0xab44('0x0'));var util=require(_0xab44('0x1'));var path=require(_0xab44('0x2'));var timeout=require(_0xab44('0x3'));var express=require(_0xab44('0x4'));var router=express[_0xab44('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xab44('0x6'));var config=require('../../config/environment');module[_0xab44('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8c374a3..c0a4753 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 _0xd8b0=['exports','sequelize'];(function(_0x49655b,_0x40c634){var _0x1878c9=function(_0x3b3b7b){while(--_0x3b3b7b){_0x49655b['push'](_0x49655b['shift']());}};_0x1878c9(++_0x40c634);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x27f354,_0x486d28){var _0x4e27c7=function(_0x8ac30a){while(--_0x8ac30a){_0x27f354['push'](_0x27f354['shift']());}};_0x4e27c7(++_0x486d28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('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 e9527bf..12989a9 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 _0xa9b9=['request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x2679ae,_0x1bcbb3){var _0x42e9dd=function(_0x2acbb2){while(--_0x2acbb2){_0x2679ae['push'](_0x2679ae['shift']());}};_0x42e9dd(++_0x1bcbb3);}(_0xa9b9,0x1c2));var _0x9a9b=function(_0x1628b3,_0x5f1805){_0x1628b3=_0x1628b3-0x0;var _0x4bad95=_0xa9b9[_0x1628b3];return _0x4bad95;};'use strict';var _=require(_0x9a9b('0x0'));var util=require(_0x9a9b('0x1'));var logger=require(_0x9a9b('0x2'))(_0x9a9b('0x3'));var moment=require('moment');var BPromise=require(_0x9a9b('0x4'));var rp=require(_0x9a9b('0x5'));var fs=require('fs');var path=require(_0x9a9b('0x6'));var rimraf=require(_0x9a9b('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a9b('0x8'));module[_0x9a9b('0x9')]=function(_0x3ac11d,_0x342c05){return _0x3ac11d[_0x9a9b('0xa')](_0x9a9b('0xb'),attributes,{'tableName':_0x9a9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0289=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0xa189a4,_0x4f754e){var _0x4cde04=function(_0x490b43){while(--_0x490b43){_0xa189a4['push'](_0xa189a4['shift']());}};_0x4cde04(++_0x4f754e);}(_0x0289,0x14c));var _0x9028=function(_0x44d385,_0x1a313a){_0x44d385=_0x44d385-0x0;var _0x5c2cc5=_0x0289[_0x44d385];return _0x5c2cc5;};'use strict';var _=require(_0x9028('0x0'));var util=require(_0x9028('0x1'));var logger=require('../../config/logger')(_0x9028('0x2'));var moment=require(_0x9028('0x3'));var BPromise=require(_0x9028('0x4'));var rp=require(_0x9028('0x5'));var fs=require('fs');var path=require(_0x9028('0x6'));var rimraf=require(_0x9028('0x7'));var config=require(_0x9028('0x8'));var attributes=require(_0x9028('0x9'));module[_0x9028('0xa')]=function(_0x163a19,_0x14bd40){return _0x163a19[_0x9028('0xb')]('UserChatQueue',attributes,{'tableName':_0x9028('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index ae29118..5b83454 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 _0x3c8d=['../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x57ad2a,_0x37353a){var _0x3cc44a=function(_0x35c235){while(--_0x35c235){_0x57ad2a['push'](_0x57ad2a['shift']());}};_0x3cc44a(++_0x37353a);}(_0x3c8d,0x6a));var _0xd3c8=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x3c8d[_0x34bf97];return _0x292719;};'use strict';var _=require(_0xd3c8('0x0'));var util=require(_0xd3c8('0x1'));var moment=require(_0xd3c8('0x2'));var BPromise=require(_0xd3c8('0x3'));var rs=require(_0xd3c8('0x4'));var fs=require('fs');var Redis=require(_0xd3c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3c8('0x6'));var logger=require(_0xd3c8('0x7'))(_0xd3c8('0x8'));var config=require(_0xd3c8('0x9'));var jayson=require(_0xd3c8('0xa'));var client=jayson[_0xd3c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2747c9,_0x491060,_0x3ed463){return new BPromise(function(_0x132aa6,_0x36695b){return client[_0xd3c8('0xc')](_0x2747c9,_0x3ed463)[_0xd3c8('0xd')](function(_0xfdb12f){logger[_0xd3c8('0xe')](_0xd3c8('0xf'),_0x491060,_0xd3c8('0x10'));logger[_0xd3c8('0x11')](_0xd3c8('0x12'),_0x491060,_0xd3c8('0x10'),JSON['stringify'](_0xfdb12f));if(_0xfdb12f[_0xd3c8('0x13')]){if(_0xfdb12f['error'][_0xd3c8('0x14')]===0x1f4){logger[_0xd3c8('0x13')](_0xd3c8('0xf'),_0x491060,_0xfdb12f[_0xd3c8('0x13')][_0xd3c8('0x15')]);return _0x36695b(_0xfdb12f[_0xd3c8('0x13')][_0xd3c8('0x15')]);}logger['error'](_0xd3c8('0xf'),_0x491060,_0xfdb12f[_0xd3c8('0x13')][_0xd3c8('0x15')]);return _0x132aa6(_0xfdb12f[_0xd3c8('0x13')][_0xd3c8('0x15')]);}else{logger[_0xd3c8('0xe')](_0xd3c8('0xf'),_0x491060,'request\x20sent');_0x132aa6(_0xfdb12f[_0xd3c8('0x16')][_0xd3c8('0x15')]);}})['catch'](function(_0x3e2dcc){logger[_0xd3c8('0x13')](_0xd3c8('0xf'),_0x491060,_0x3e2dcc);_0x36695b(_0x3e2dcc);});});} \ No newline at end of file +var _0x773d=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x773d,0x184));var _0xd773=function(_0x48bd16,_0x5ea61e){_0x48bd16=_0x48bd16-0x0;var _0xb77318=_0x773d[_0x48bd16];return _0xb77318;};'use strict';var _=require(_0xd773('0x0'));var util=require(_0xd773('0x1'));var moment=require('moment');var BPromise=require(_0xd773('0x2'));var rs=require(_0xd773('0x3'));var fs=require('fs');var Redis=require(_0xd773('0x4'));var db=require(_0xd773('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd773('0x6'))(_0xd773('0x7'));var config=require(_0xd773('0x8'));var jayson=require(_0xd773('0x9'));var client=jayson[_0xd773('0xa')][_0xd773('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe14ef0,_0x56d59c,_0x459ee8){return new BPromise(function(_0x43ec1f,_0x1dd2c6){return client[_0xd773('0xc')](_0xe14ef0,_0x459ee8)[_0xd773('0xd')](function(_0x5702f6){logger[_0xd773('0xe')](_0xd773('0xf'),_0x56d59c,_0xd773('0x10'));logger[_0xd773('0x11')](_0xd773('0x12'),_0x56d59c,_0xd773('0x10'),JSON['stringify'](_0x5702f6));if(_0x5702f6[_0xd773('0x13')]){if(_0x5702f6[_0xd773('0x13')][_0xd773('0x14')]===0x1f4){logger[_0xd773('0x13')](_0xd773('0xf'),_0x56d59c,_0x5702f6[_0xd773('0x13')][_0xd773('0x15')]);return _0x1dd2c6(_0x5702f6[_0xd773('0x13')][_0xd773('0x15')]);}logger['error'](_0xd773('0xf'),_0x56d59c,_0x5702f6[_0xd773('0x13')]['message']);return _0x43ec1f(_0x5702f6[_0xd773('0x13')][_0xd773('0x15')]);}else{logger[_0xd773('0xe')](_0xd773('0xf'),_0x56d59c,'request\x20sent');_0x43ec1f(_0x5702f6[_0xd773('0x16')][_0xd773('0x15')]);}})[_0xd773('0x17')](function(_0x31d511){logger[_0xd773('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x56d59c,_0x31d511);_0x1dd2c6(_0x31d511);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 431bc70..fb3c1a1 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 _0xb178=['multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','exports'];(function(_0x212529,_0x1f35bf){var _0x112e5f=function(_0x532c95){while(--_0x532c95){_0x212529['push'](_0x212529['shift']());}};_0x112e5f(++_0x1f35bf);}(_0xb178,0x180));var _0x8b17=function(_0x4a1e96,_0x143e6b){_0x4a1e96=_0x4a1e96-0x0;var _0x5acea9=_0xb178[_0x4a1e96];return _0x5acea9;};'use strict';var multer=require(_0x8b17('0x0'));var util=require(_0x8b17('0x1'));var path=require(_0x8b17('0x2'));var timeout=require(_0x8b17('0x3'));var express=require(_0x8b17('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8b17('0x5'));var config=require(_0x8b17('0x6'));module[_0x8b17('0x7')]=router; \ No newline at end of file +var _0x0157=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3b3546,_0x432159){var _0x56dec0=function(_0xbea8bd){while(--_0xbea8bd){_0x3b3546['push'](_0x3b3546['shift']());}};_0x56dec0(++_0x432159);}(_0x0157,0xf9));var _0x7015=function(_0x3ed579,_0x509451){_0x3ed579=_0x3ed579-0x0;var _0x53ad35=_0x0157[_0x3ed579];return _0x53ad35;};'use strict';var multer=require(_0x7015('0x0'));var util=require('util');var path=require(_0x7015('0x1'));var timeout=require(_0x7015('0x2'));var express=require(_0x7015('0x3'));var router=express[_0x7015('0x4')]();var auth=require(_0x7015('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7015('0x6'));module[_0x7015('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 7317d7b..aa770bc 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 _0xd7d1=['exports','INTEGER','STRING','sequelize'];(function(_0x296dc5,_0x4fe9cb){var _0x1e0b61=function(_0x503e6e){while(--_0x503e6e){_0x296dc5['push'](_0x296dc5['shift']());}};_0x1e0b61(++_0x4fe9cb);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x219cab,_0x45e942){_0x219cab=_0x219cab-0x0;var _0x3568a7=_0xd7d1[_0x219cab];return _0x3568a7;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'penalty':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1d7d('0x3')]}}; \ No newline at end of file +var _0x13f6=['STRING','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x13f6,0x124));var _0x613f=function(_0x46a827,_0x1a20a0){_0x46a827=_0x46a827-0x0;var _0x420410=_0x13f6[_0x46a827];return _0x420410;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x613f('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7673f0d..3d25bba 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 _0x7d8a=['../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7d8a,0xbf));var _0xa7d8=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7d8a[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0xa7d8('0x0'));var util=require(_0xa7d8('0x1'));var logger=require(_0xa7d8('0x2'))('api');var moment=require(_0xa7d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7d8('0x4'));var fs=require('fs');var path=require(_0xa7d8('0x5'));var rimraf=require(_0xa7d8('0x6'));var config=require(_0xa7d8('0x7'));var attributes=require(_0xa7d8('0x8'));module['exports']=function(_0x2ae5d9,_0x7437e6){return _0x2ae5d9[_0xa7d8('0x9')](_0xa7d8('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec5=['./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0ec5,0x9e));var _0x50ec=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x0ec5[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x50ec('0x0'));var util=require(_0x50ec('0x1'));var logger=require(_0x50ec('0x2'))(_0x50ec('0x3'));var moment=require(_0x50ec('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x50ec('0x5'));var rimraf=require('rimraf');var config=require(_0x50ec('0x6'));var attributes=require(_0x50ec('0x7'));module[_0x50ec('0x8')]=function(_0x51659e,_0x632ba0){return _0x51659e[_0x50ec('0x9')]('UserFaxQueue',attributes,{'tableName':_0x50ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 23487de..91682fd 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 _0xdb21=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x119b4b,_0x322a87){var _0x2ca4d5=function(_0x45a93e){while(--_0x45a93e){_0x119b4b['push'](_0x119b4b['shift']());}};_0x2ca4d5(++_0x322a87);}(_0xdb21,0x135));var _0x1db2=function(_0x222688,_0x46c5eb){_0x222688=_0x222688-0x0;var _0x437433=_0xdb21[_0x222688];return _0x437433;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var moment=require(_0x1db2('0x2'));var BPromise=require(_0x1db2('0x3'));var rs=require(_0x1db2('0x4'));var fs=require('fs');var Redis=require(_0x1db2('0x5'));var db=require(_0x1db2('0x6'))['db'];var utils=require(_0x1db2('0x7'));var logger=require(_0x1db2('0x8'))('rpc');var config=require(_0x1db2('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1db2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36cb30,_0x18d3ac,_0x3f3a1d){return new BPromise(function(_0x45b180,_0x24210c){return client[_0x1db2('0xb')](_0x36cb30,_0x3f3a1d)[_0x1db2('0xc')](function(_0x246867){logger[_0x1db2('0xd')](_0x1db2('0xe'),_0x18d3ac,'request\x20sent');logger[_0x1db2('0xf')](_0x1db2('0x10'),_0x18d3ac,_0x1db2('0x11'),JSON['stringify'](_0x246867));if(_0x246867['error']){if(_0x246867[_0x1db2('0x12')]['code']===0x1f4){logger[_0x1db2('0x12')](_0x1db2('0xe'),_0x18d3ac,_0x246867[_0x1db2('0x12')][_0x1db2('0x13')]);return _0x24210c(_0x246867[_0x1db2('0x12')][_0x1db2('0x13')]);}logger['error'](_0x1db2('0xe'),_0x18d3ac,_0x246867[_0x1db2('0x12')][_0x1db2('0x13')]);return _0x45b180(_0x246867[_0x1db2('0x12')][_0x1db2('0x13')]);}else{logger[_0x1db2('0xd')](_0x1db2('0xe'),_0x18d3ac,'request\x20sent');_0x45b180(_0x246867[_0x1db2('0x14')]['message']);}})[_0x1db2('0x15')](function(_0x233d76){logger[_0x1db2('0x12')](_0x1db2('0xe'),_0x18d3ac,_0x233d76);_0x24210c(_0x233d76);});});} \ No newline at end of file +var _0xa96d=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x31f6e3,_0x2ba20a){var _0x208cf3=function(_0x115b6b){while(--_0x115b6b){_0x31f6e3['push'](_0x31f6e3['shift']());}};_0x208cf3(++_0x2ba20a);}(_0xa96d,0x116));var _0xda96=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0xa96d[_0xcdac34];return _0x269d23;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xda96('0x0'));var fs=require('fs');var Redis=require(_0xda96('0x1'));var db=require(_0xda96('0x2'))['db'];var utils=require(_0xda96('0x3'));var logger=require(_0xda96('0x4'))(_0xda96('0x5'));var config=require(_0xda96('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xda96('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x478da9,_0x3199d0,_0x2ff9dd){return new BPromise(function(_0x3673b8,_0x3e0c6f){return client['request'](_0x478da9,_0x2ff9dd)[_0xda96('0x8')](function(_0x1c3e37){logger['info'](_0xda96('0x9'),_0x3199d0,_0xda96('0xa'));logger['debug'](_0xda96('0xb'),_0x3199d0,_0xda96('0xa'),JSON[_0xda96('0xc')](_0x1c3e37));if(_0x1c3e37['error']){if(_0x1c3e37[_0xda96('0xd')]['code']===0x1f4){logger[_0xda96('0xd')](_0xda96('0x9'),_0x3199d0,_0x1c3e37[_0xda96('0xd')][_0xda96('0xe')]);return _0x3e0c6f(_0x1c3e37[_0xda96('0xd')][_0xda96('0xe')]);}logger[_0xda96('0xd')](_0xda96('0x9'),_0x3199d0,_0x1c3e37[_0xda96('0xd')]['message']);return _0x3673b8(_0x1c3e37['error']['message']);}else{logger['info'](_0xda96('0x9'),_0x3199d0,_0xda96('0xa'));_0x3673b8(_0x1c3e37[_0xda96('0xf')][_0xda96('0xe')]);}})[_0xda96('0x10')](function(_0x2155b0){logger[_0xda96('0xd')](_0xda96('0x9'),_0x3199d0,_0x2155b0);_0x3e0c6f(_0x2155b0);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 6f38aef..2325100 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 _0x5c8b=['path','Router','../../components/interaction/service','exports','util'];(function(_0x447209,_0x5c1794){var _0x30f143=function(_0xb7815d){while(--_0xb7815d){_0x447209['push'](_0x447209['shift']());}};_0x30f143(++_0x5c1794);}(_0x5c8b,0x144));var _0xb5c8=function(_0x3f1c7c,_0x19ae6a){_0x3f1c7c=_0x3f1c7c-0x0;var _0x5b1417=_0x5c8b[_0x3f1c7c];return _0x5b1417;};'use strict';var multer=require('multer');var util=require(_0xb5c8('0x0'));var path=require(_0xb5c8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5c8('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb5c8('0x3'));var config=require('../../config/environment');module[_0xb5c8('0x4')]=router; \ No newline at end of file +var _0x8765=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x8765,0x189));var _0x5876=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8765[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x5876('0x0'));var util=require('util');var path=require(_0x5876('0x1'));var timeout=require(_0x5876('0x2'));var express=require('express');var router=express[_0x5876('0x3')]();var auth=require(_0x5876('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5876('0x5'));module[_0x5876('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index cf493c7..ef71e39 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 _0xd8b0=['exports','sequelize'];(function(_0x38ec43,_0x46e019){var _0x26f816=function(_0x1429c4){while(--_0x1429c4){_0x38ec43['push'](_0x38ec43['shift']());}};_0x26f816(++_0x46e019);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x4b49c9,_0x290d55){var _0xab2d67=function(_0x3a8e9c){while(--_0x3a8e9c){_0x4b49c9['push'](_0x4b49c9['shift']());}};_0xab2d67(++_0x290d55);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('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 eff052e..53d8dfb 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api'];(function(_0x341c3f,_0x4ee1af){var _0x2b07b2=function(_0x3dd562){while(--_0x3dd562){_0x341c3f['push'](_0x341c3f['shift']());}};_0x2b07b2(++_0x4ee1af);}(_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 _0x2032=['user_has_mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x2343c4,_0xb94393){var _0x281e8b=function(_0x2de08b){while(--_0x2de08b){_0x2343c4['push'](_0x2343c4['shift']());}};_0x281e8b(++_0xb94393);}(_0x2032,0xd9));var _0x2203=function(_0x35884d,_0x5b7b1e){_0x35884d=_0x35884d-0x0;var _0x2b5ab7=_0x2032[_0x35884d];return _0x2b5ab7;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'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 f83a1ac..afaaf1a 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 _0xdd68=['UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xdd68,0x196));var _0x8dd6=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0xdd68[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0x8dd6('0x0'));var util=require('util');var moment=require(_0x8dd6('0x1'));var BPromise=require(_0x8dd6('0x2'));var rs=require(_0x8dd6('0x3'));var fs=require('fs');var Redis=require(_0x8dd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8dd6('0x5'));var logger=require(_0x8dd6('0x6'))('rpc');var config=require(_0x8dd6('0x7'));var jayson=require(_0x8dd6('0x8'));var client=jayson['client'][_0x8dd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c021f,_0x476bad,_0x51f78e){return new BPromise(function(_0x199f07,_0x35319b){return client[_0x8dd6('0xa')](_0x4c021f,_0x51f78e)['then'](function(_0x4323ac){logger[_0x8dd6('0xb')](_0x8dd6('0xc'),_0x476bad,_0x8dd6('0xd'));logger[_0x8dd6('0xe')](_0x8dd6('0xf'),_0x476bad,_0x8dd6('0xd'),JSON[_0x8dd6('0x10')](_0x4323ac));if(_0x4323ac[_0x8dd6('0x11')]){if(_0x4323ac[_0x8dd6('0x11')][_0x8dd6('0x12')]===0x1f4){logger[_0x8dd6('0x11')](_0x8dd6('0xc'),_0x476bad,_0x4323ac['error'][_0x8dd6('0x13')]);return _0x35319b(_0x4323ac[_0x8dd6('0x11')][_0x8dd6('0x13')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x476bad,_0x4323ac[_0x8dd6('0x11')]['message']);return _0x199f07(_0x4323ac['error'][_0x8dd6('0x13')]);}else{logger[_0x8dd6('0xb')](_0x8dd6('0xc'),_0x476bad,_0x8dd6('0xd'));_0x199f07(_0x4323ac[_0x8dd6('0x14')][_0x8dd6('0x13')]);}})[_0x8dd6('0x15')](function(_0x3e2fb5){logger[_0x8dd6('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x476bad,_0x3e2fb5);_0x35319b(_0x3e2fb5);});});} \ No newline at end of file +var _0xf228=['UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd748a1,_0x16b881){var _0x4c150e=function(_0x4efb16){while(--_0x4efb16){_0xd748a1['push'](_0xd748a1['shift']());}};_0x4c150e(++_0x16b881);}(_0xf228,0x1a9));var _0x8f22=function(_0x3b2494,_0x1851ec){_0x3b2494=_0x3b2494-0x0;var _0x2a6d44=_0xf228[_0x3b2494];return _0x2a6d44;};'use strict';var _=require(_0x8f22('0x0'));var util=require(_0x8f22('0x1'));var moment=require('moment');var BPromise=require(_0x8f22('0x2'));var rs=require(_0x8f22('0x3'));var fs=require('fs');var Redis=require(_0x8f22('0x4'));var db=require(_0x8f22('0x5'))['db'];var utils=require(_0x8f22('0x6'));var logger=require(_0x8f22('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f22('0x8'));var client=jayson['client'][_0x8f22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcf8bf8,_0x47f1a6,_0x2f65b7){return new BPromise(function(_0x22c45d,_0x5d913d){return client[_0x8f22('0xa')](_0xcf8bf8,_0x2f65b7)[_0x8f22('0xb')](function(_0x32dd0b){logger[_0x8f22('0xc')](_0x8f22('0xd'),_0x47f1a6,_0x8f22('0xe'));logger[_0x8f22('0xf')](_0x8f22('0x10'),_0x47f1a6,'request\x20sent',JSON[_0x8f22('0x11')](_0x32dd0b));if(_0x32dd0b[_0x8f22('0x12')]){if(_0x32dd0b[_0x8f22('0x12')]['code']===0x1f4){logger[_0x8f22('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x47f1a6,_0x32dd0b[_0x8f22('0x12')][_0x8f22('0x13')]);return _0x5d913d(_0x32dd0b[_0x8f22('0x12')][_0x8f22('0x13')]);}logger[_0x8f22('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x47f1a6,_0x32dd0b[_0x8f22('0x12')][_0x8f22('0x13')]);return _0x22c45d(_0x32dd0b['error'][_0x8f22('0x13')]);}else{logger[_0x8f22('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x47f1a6,_0x8f22('0xe'));_0x22c45d(_0x32dd0b[_0x8f22('0x14')][_0x8f22('0x13')]);}})['catch'](function(_0x1b3bcc){logger[_0x8f22('0x12')](_0x8f22('0xd'),_0x47f1a6,_0x1b3bcc);_0x5d913d(_0x1b3bcc);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index d2c50bb..d7f6079 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 _0x8dfa=['path','connect-timeout','express','../../components/auth/service','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dfa,0x155));var _0xa8df=function(_0x5f23d9,_0x431d9a){_0x5f23d9=_0x5f23d9-0x0;var _0x68fb9e=_0x8dfa[_0x5f23d9];return _0x68fb9e;};'use strict';var multer=require(_0xa8df('0x0'));var util=require(_0xa8df('0x1'));var path=require(_0xa8df('0x2'));var timeout=require(_0xa8df('0x3'));var express=require(_0xa8df('0x4'));var router=express['Router']();var auth=require(_0xa8df('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xa8df('0x6')]=router; \ No newline at end of file +var _0x33fb=['../../components/interaction/service','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33fb,0xaa));var _0xb33f=function(_0x1f2747,_0x421988){_0x1f2747=_0x1f2747-0x0;var _0x12372b=_0x33fb[_0x1f2747];return _0x12372b;};'use strict';var multer=require('multer');var util=require(_0xb33f('0x0'));var path=require(_0xb33f('0x1'));var timeout=require(_0xb33f('0x2'));var express=require(_0xb33f('0x3'));var router=express[_0xb33f('0x4')]();var auth=require(_0xb33f('0x5'));var interaction=require(_0xb33f('0x6'));var config=require('../../config/environment');module[_0xb33f('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e50dfd8..2497e82 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 _0xbaf0=['exports','INTEGER'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x172b02,_0x2ebae7){var _0x9875ec=function(_0x2fd0ef){while(--_0x2fd0ef){_0x172b02['push'](_0x172b02['shift']());}};_0x9875ec(++_0x2ebae7);}(_0xe706,0xa3));var _0x6e70=function(_0x5b1db5,_0x559cd7){_0x5b1db5=_0x5b1db5-0x0;var _0x39995c=_0xe706[_0x5b1db5];return _0x39995c;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 925aad1..674c3da 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 _0x651e=['../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','request-promise','path'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x651e,0x102));var _0xe651=function(_0x179beb,_0xc167f3){_0x179beb=_0x179beb-0x0;var _0xeb52b6=_0x651e[_0x179beb];return _0xeb52b6;};'use strict';var _=require(_0xe651('0x0'));var util=require(_0xe651('0x1'));var logger=require('../../config/logger')(_0xe651('0x2'));var moment=require(_0xe651('0x3'));var BPromise=require('bluebird');var rp=require(_0xe651('0x4'));var fs=require('fs');var path=require(_0xe651('0x5'));var rimraf=require('rimraf');var config=require(_0xe651('0x6'));var attributes=require(_0xe651('0x7'));module['exports']=function(_0x525430,_0x3e16ea){return _0x525430[_0xe651('0x8')](_0xe651('0x9'),attributes,{'tableName':_0xe651('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc353=['user_has_openchannel_queues','lodash','api','moment','bluebird','path','rimraf','exports','define','UserOpenchannelQueue'];(function(_0x1d2b1f,_0x40ea2a){var _0x14f4a=function(_0x12b9ed){while(--_0x12b9ed){_0x1d2b1f['push'](_0x1d2b1f['shift']());}};_0x14f4a(++_0x40ea2a);}(_0xc353,0x1e1));var _0x3c35=function(_0x1c9b00,_0x5a6274){_0x1c9b00=_0x1c9b00-0x0;var _0x5f621c=_0xc353[_0x1c9b00];return _0x5f621c;};'use strict';var _=require(_0x3c35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3c35('0x1'));var moment=require(_0x3c35('0x2'));var BPromise=require(_0x3c35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c35('0x4'));var rimraf=require(_0x3c35('0x5'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x3c35('0x6')]=function(_0x3d4c71,_0x432df1){return _0x3d4c71[_0x3c35('0x7')](_0x3c35('0x8'),attributes,{'tableName':_0x3c35('0x9'),'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 c91d758..c67d19a 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 _0x9723=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x95b0a8,_0x8c3b72){var _0x32628f=function(_0x32ab96){while(--_0x32ab96){_0x95b0a8['push'](_0x95b0a8['shift']());}};_0x32628f(++_0x8c3b72);}(_0x9723,0x135));var _0x3972=function(_0x2f1d2f,_0x527d85){_0x2f1d2f=_0x2f1d2f-0x0;var _0x2874cf=_0x9723[_0x2f1d2f];return _0x2874cf;};'use strict';var _=require(_0x3972('0x0'));var util=require(_0x3972('0x1'));var moment=require('moment');var BPromise=require(_0x3972('0x2'));var rs=require(_0x3972('0x3'));var fs=require('fs');var Redis=require(_0x3972('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3972('0x5'));var logger=require('../../config/logger')(_0x3972('0x6'));var config=require(_0x3972('0x7'));var jayson=require(_0x3972('0x8'));var client=jayson[_0x3972('0x9')][_0x3972('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x322ec5,_0xefa9f,_0xb7890f){return new BPromise(function(_0x5249bf,_0x5762e8){return client[_0x3972('0xb')](_0x322ec5,_0xb7890f)[_0x3972('0xc')](function(_0x5a1766){logger[_0x3972('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xefa9f,_0x3972('0xe'));logger[_0x3972('0xf')](_0x3972('0x10'),_0xefa9f,_0x3972('0xe'),JSON[_0x3972('0x11')](_0x5a1766));if(_0x5a1766['error']){if(_0x5a1766[_0x3972('0x12')][_0x3972('0x13')]===0x1f4){logger[_0x3972('0x12')](_0x3972('0x14'),_0xefa9f,_0x5a1766[_0x3972('0x12')][_0x3972('0x15')]);return _0x5762e8(_0x5a1766['error'][_0x3972('0x15')]);}logger[_0x3972('0x12')](_0x3972('0x14'),_0xefa9f,_0x5a1766['error'][_0x3972('0x15')]);return _0x5249bf(_0x5a1766['error'][_0x3972('0x15')]);}else{logger[_0x3972('0xd')](_0x3972('0x14'),_0xefa9f,_0x3972('0xe'));_0x5249bf(_0x5a1766[_0x3972('0x16')][_0x3972('0x15')]);}})[_0x3972('0x17')](function(_0x2da2e5){logger[_0x3972('0x12')](_0x3972('0x14'),_0xefa9f,_0x2da2e5);_0x5762e8(_0x2da2e5);});});} \ No newline at end of file +var _0x2863=['info','result','catch','lodash','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x81dbb5,_0x3e1ddf){var _0x1eecee=function(_0x23d8fd){while(--_0x23d8fd){_0x81dbb5['push'](_0x81dbb5['shift']());}};_0x1eecee(++_0x3e1ddf);}(_0x2863,0x1df));var _0x3286=function(_0x3367ae,_0x26fcaa){_0x3367ae=_0x3367ae-0x0;var _0x155e2e=_0x2863[_0x3367ae];return _0x155e2e;};'use strict';var _=require(_0x3286('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3286('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x3286('0x2'));var logger=require('../../config/logger')(_0x3286('0x3'));var config=require('../../config/environment');var jayson=require(_0x3286('0x4'));var client=jayson['client'][_0x3286('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5bb46a,_0x21680e,_0x3b3092){return new BPromise(function(_0x19411d,_0x15d307){return client[_0x3286('0x6')](_0x5bb46a,_0x3b3092)[_0x3286('0x7')](function(_0xa23e5){logger['info'](_0x3286('0x8'),_0x21680e,_0x3286('0x9'));logger[_0x3286('0xa')](_0x3286('0xb'),_0x21680e,_0x3286('0x9'),JSON['stringify'](_0xa23e5));if(_0xa23e5[_0x3286('0xc')]){if(_0xa23e5[_0x3286('0xc')]['code']===0x1f4){logger['error'](_0x3286('0x8'),_0x21680e,_0xa23e5[_0x3286('0xc')]['message']);return _0x15d307(_0xa23e5[_0x3286('0xc')][_0x3286('0xd')]);}logger[_0x3286('0xc')](_0x3286('0x8'),_0x21680e,_0xa23e5[_0x3286('0xc')][_0x3286('0xd')]);return _0x19411d(_0xa23e5['error']['message']);}else{logger[_0x3286('0xe')](_0x3286('0x8'),_0x21680e,_0x3286('0x9'));_0x19411d(_0xa23e5[_0x3286('0xf')][_0x3286('0xd')]);}})[_0x3286('0x10')](function(_0x38ae74){logger[_0x3286('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x21680e,_0x38ae74);_0x15d307(_0x38ae74);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c4f0fb7..126da72 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 _0x1ced=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','describe','/:id','/:id/sections','getSections','/:id/resources','post','/:id/clone','clone','addSections','addResources','update','delete','destroy','removeSections','exports','util','path','connect-timeout','express'];(function(_0x15998d,_0xe117bd){var _0x1073bd=function(_0xf4c0e8){while(--_0xf4c0e8){_0x15998d['push'](_0x15998d['shift']());}};_0x1073bd(++_0xe117bd);}(_0x1ced,0xb2));var _0xd1ce=function(_0x222e27,_0x52e835){_0x222e27=_0x222e27-0x0;var _0xc79276=_0x1ced[_0x222e27];return _0xc79276;};'use strict';var multer=require('multer');var util=require(_0xd1ce('0x0'));var path=require(_0xd1ce('0x1'));var timeout=require(_0xd1ce('0x2'));var express=require(_0xd1ce('0x3'));var router=express[_0xd1ce('0x4')]();var auth=require(_0xd1ce('0x5'));var interaction=require(_0xd1ce('0x6'));var config=require(_0xd1ce('0x7'));var controller=require(_0xd1ce('0x8'));router[_0xd1ce('0x9')]('/',auth[_0xd1ce('0xa')](),controller['index']);router['get']('/describe',auth[_0xd1ce('0xa')](),controller[_0xd1ce('0xb')]);router[_0xd1ce('0x9')](_0xd1ce('0xc'),auth[_0xd1ce('0xa')](),controller['show']);router[_0xd1ce('0x9')](_0xd1ce('0xd'),auth[_0xd1ce('0xa')](),controller[_0xd1ce('0xe')]);router['get'](_0xd1ce('0xf'),auth[_0xd1ce('0xa')](),controller['getResources']);router[_0xd1ce('0x10')]('/',auth[_0xd1ce('0xa')](),controller['create']);router[_0xd1ce('0x10')](_0xd1ce('0x11'),auth[_0xd1ce('0xa')](),controller[_0xd1ce('0x12')]);router[_0xd1ce('0x10')](_0xd1ce('0xd'),auth[_0xd1ce('0xa')](),controller[_0xd1ce('0x13')]);router[_0xd1ce('0x10')](_0xd1ce('0xf'),auth[_0xd1ce('0xa')](),controller[_0xd1ce('0x14')]);router['put'](_0xd1ce('0xc'),auth[_0xd1ce('0xa')](),controller[_0xd1ce('0x15')]);router[_0xd1ce('0x16')]('/:id',auth[_0xd1ce('0xa')](),controller[_0xd1ce('0x17')]);router['delete'](_0xd1ce('0xd'),auth[_0xd1ce('0xa')](),controller[_0xd1ce('0x18')]);router['delete'](_0xd1ce('0xf'),auth[_0xd1ce('0xa')](),controller['removeResources']);module[_0xd1ce('0x19')]=router; \ No newline at end of file +var _0x3f20=['/:id/sections','isAuthenticated','/:id/resources','create','post','/:id/clone','addSections','addResources','put','/:id','update','delete','destroy','removeSections','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','/describe','describe','show'];(function(_0x3b1106,_0x4bd523){var _0x1fbeef=function(_0x2c6889){while(--_0x2c6889){_0x3b1106['push'](_0x3b1106['shift']());}};_0x1fbeef(++_0x4bd523);}(_0x3f20,0x138));var _0x03f2=function(_0x2cf571,_0x4bac09){_0x2cf571=_0x2cf571-0x0;var _0x574fac=_0x3f20[_0x2cf571];return _0x574fac;};'use strict';var multer=require(_0x03f2('0x0'));var util=require(_0x03f2('0x1'));var path=require('path');var timeout=require(_0x03f2('0x2'));var express=require(_0x03f2('0x3'));var router=express[_0x03f2('0x4')]();var auth=require(_0x03f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x03f2('0x6'));var controller=require(_0x03f2('0x7'));router[_0x03f2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x03f2('0x8')](_0x03f2('0x9'),auth['isAuthenticated'](),controller[_0x03f2('0xa')]);router[_0x03f2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x03f2('0xb')]);router[_0x03f2('0x8')](_0x03f2('0xc'),auth[_0x03f2('0xd')](),controller['getSections']);router[_0x03f2('0x8')](_0x03f2('0xe'),auth[_0x03f2('0xd')](),controller['getResources']);router['post']('/',auth[_0x03f2('0xd')](),controller[_0x03f2('0xf')]);router[_0x03f2('0x10')](_0x03f2('0x11'),auth[_0x03f2('0xd')](),controller['clone']);router['post'](_0x03f2('0xc'),auth[_0x03f2('0xd')](),controller[_0x03f2('0x12')]);router['post'](_0x03f2('0xe'),auth[_0x03f2('0xd')](),controller[_0x03f2('0x13')]);router[_0x03f2('0x14')](_0x03f2('0x15'),auth['isAuthenticated'](),controller[_0x03f2('0x16')]);router[_0x03f2('0x17')](_0x03f2('0x15'),auth[_0x03f2('0xd')](),controller[_0x03f2('0x18')]);router['delete']('/:id/sections',auth[_0x03f2('0xd')](),controller[_0x03f2('0x19')]);router[_0x03f2('0x17')]('/:id/resources',auth[_0x03f2('0xd')](),controller['removeResources']);module[_0x03f2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 47eb74f..a625750 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 _0x0aab=['setDataValue','crudPermissions','join','split','sequelize','name','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0aab,0x169));var _0xb0aa=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0aab[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0xb0aa('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb0aa('0x1')},'crudPermissions':{'type':Sequelize[_0xb0aa('0x2')],'set':function(_0x12f2cf){this[_0xb0aa('0x3')](_0xb0aa('0x4'),_0x12f2cf?_0x12f2cf[_0xb0aa('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb0aa('0x4'))?this['getDataValue'](_0xb0aa('0x4'))[_0xb0aa('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x9f7b=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x4ff1c1,_0x493938){var _0x959074=function(_0x158482){while(--_0x158482){_0x4ff1c1['push'](_0x4ff1c1['shift']());}};_0x959074(++_0x493938);}(_0x9f7b,0x15e));var _0xb9f7=function(_0x1c8862,_0x5cf31d){_0x1c8862=_0x1c8862-0x0;var _0x182a6c=_0x9f7b[_0x1c8862];return _0x182a6c;};'use strict';var Sequelize=require(_0xb9f7('0x0'));module[_0xb9f7('0x1')]={'name':{'type':Sequelize[_0xb9f7('0x2')],'allowNull':![],'unique':_0xb9f7('0x3')},'crudPermissions':{'type':Sequelize[_0xb9f7('0x2')],'set':function(_0x9331e4){this[_0xb9f7('0x4')](_0xb9f7('0x5'),_0x9331e4?_0x9331e4[_0xb9f7('0x6')](''):[]);},'get':function(){return this[_0xb9f7('0x7')](_0xb9f7('0x5'))?this[_0xb9f7('0x7')]('crudPermissions')[_0xb9f7('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb9f7('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index c27a02b..00e5f3e 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 _0x8380=['../../mysqldb','defaults','redis','./userProfile.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','error','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','then','include','rows','catch','show','params','merge','find','create','includeAll','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','UserProfileSection','findAll','each','autoAssociation','sectionId','userProfileId','Resources','describe','transaction','destroy','UserProfileResource','ids','getSections','isEmpty','subsections','includes','some','findOne','Dashboard','push','resourceId','Plugin','forEach','addResources','removeResources','getResources','section','undefined','Sequelize','childModel','ValidationError','parentSections','ignore','union','all','key','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','custom','CustomReports','Tag','color','tag','ThroughTags','value','SquareProject','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','VoiceMail','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','customdashboards','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','AnalyticMetric','html-pdf','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8380,0x1b0));var _0x0838=function(_0x1b4979,_0x4ddc92){_0x1b4979=_0x1b4979-0x0;var _0x2a3784=_0x8380[_0x1b4979];return _0x2a3784;};'use strict';var pdf=require(_0x0838('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0838('0x1'));var zipdir=require(_0x0838('0x2'));var jsonpatch=require(_0x0838('0x3'));var rp=require(_0x0838('0x4'));var moment=require(_0x0838('0x5'));var BPromise=require(_0x0838('0x6'));var Mustache=require('mustache');var util=require(_0x0838('0x7'));var path=require(_0x0838('0x8'));var sox=require('sox');var csv=require(_0x0838('0x9'));var ejs=require(_0x0838('0xa'));var fs=require('fs');var _=require(_0x0838('0xb'));var squel=require(_0x0838('0xc'));var crypto=require(_0x0838('0xd'));var jsforce=require(_0x0838('0xe'));var deskjs=require(_0x0838('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0838('0x10'));var Papa=require('papaparse');var Redis=require(_0x0838('0x11'));var authService=require(_0x0838('0x12'));var qs=require(_0x0838('0x13'));var as=require(_0x0838('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0838('0x15'))(_0x0838('0x16'));var utils=require(_0x0838('0x17'));var config=require('../../config/environment');var db=require(_0x0838('0x18'))['db'];config['redis']=_[_0x0838('0x19')](config[_0x0838('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0838('0x1a')]));require(_0x0838('0x1b'))[_0x0838('0x1c')](socket);function respondWithStatusCode(_0x41644f,_0x3de07c){_0x3de07c=_0x3de07c||0xcc;return function(_0x11ccca){if(_0x11ccca){return _0x41644f[_0x0838('0x1d')](_0x3de07c);}return _0x41644f[_0x0838('0x1e')](_0x3de07c)[_0x0838('0x1f')]();};}function respondWithResult(_0x336921,_0x2f4b8b){_0x2f4b8b=_0x2f4b8b||0xc8;return function(_0x4090c7){if(_0x4090c7){return _0x336921[_0x0838('0x1e')](_0x2f4b8b)[_0x0838('0x20')](_0x4090c7);}};}function respondWithFilteredResult(_0x53b4e7,_0x11cbee){return function(_0x6389d9){if(_0x6389d9){var _0x4bb878=_0x6389d9[_0x0838('0x21')],_0x4b807b=_0x11cbee[_0x0838('0x22')],_0x1d57fd=_0x11cbee[_0x0838('0x22')]+_0x11cbee[_0x0838('0x23')],_0x3629e8;if(_0x1d57fd>=_0x4bb878){_0x1d57fd=_0x4bb878;_0x3629e8=0xc8;}else{_0x3629e8=0xce;}_0x53b4e7[_0x0838('0x1e')](_0x3629e8);return _0x53b4e7[_0x0838('0x24')](_0x0838('0x25'),_0x4b807b+'-'+_0x1d57fd+'/'+_0x4bb878)['json'](_0x6389d9);}return null;};}function patchUpdates(_0x2ffaa1){return function(_0x12f00c){try{jsonpatch[_0x0838('0x26')](_0x12f00c,_0x2ffaa1,!![]);}catch(_0x5c63e6){return BPromise[_0x0838('0x27')](_0x5c63e6);}return _0x12f00c[_0x0838('0x28')]();};}function saveUpdates(_0x4b3a6e,_0xb7467c){return function(_0x117fca){if(_0x117fca){return _0x117fca[_0x0838('0x29')](_0x4b3a6e)['then'](function(_0x5b1bfb){return _0x5b1bfb;});}return null;};}function removeEntity(_0x2def3e,_0x7623d4){return function(_0x2ace38){if(_0x2ace38){return _0x2ace38['destroy']()['then'](function(){_0x2def3e[_0x0838('0x1e')](0xcc)[_0x0838('0x1f')]();});}};}function handleEntityNotFound(_0x3710d9,_0x420748){return function(_0x3af4b6){if(!_0x3af4b6){_0x3710d9[_0x0838('0x1d')](0x194);}return _0x3af4b6;};}function handleError(_0x4deaf7,_0x15c5bf){_0x15c5bf=_0x15c5bf||0x1f4;return function(_0x4fca97){logger[_0x0838('0x2a')](_0x4fca97['stack']);if(_0x4fca97[_0x0838('0x2b')]){delete _0x4fca97[_0x0838('0x2b')];}_0x4deaf7[_0x0838('0x1e')](_0x15c5bf)[_0x0838('0x2c')](_0x4fca97);};}exports['index']=function(_0x46560f,_0x552e0c){var _0x4631cd={},_0x4d6d47={},_0x48949a={'count':0x0,'rows':[]};var _0x519836=_[_0x0838('0x2d')](db[_0x0838('0x2e')][_0x0838('0x2f')],function(_0x238f8a){return{'name':_0x238f8a[_0x0838('0x30')],'type':_0x238f8a[_0x0838('0x31')]['key']};});_0x4d6d47[_0x0838('0x32')]=_[_0x0838('0x2d')](_0x519836,'name');_0x4d6d47[_0x0838('0x33')]=_[_0x0838('0x34')](_0x46560f['query']);_0x4d6d47[_0x0838('0x35')]=_[_0x0838('0x36')](_0x4d6d47['model'],_0x4d6d47[_0x0838('0x33')]);_0x4631cd[_0x0838('0x37')]=_[_0x0838('0x36')](_0x4d6d47['model'],qs[_0x0838('0x38')](_0x46560f['query']['fields']));_0x4631cd[_0x0838('0x37')]=_0x4631cd[_0x0838('0x37')][_0x0838('0x39')]?_0x4631cd[_0x0838('0x37')]:_0x4d6d47['model'];if(!_0x46560f[_0x0838('0x33')][_0x0838('0x3a')](_0x0838('0x3b'))){_0x4631cd[_0x0838('0x23')]=qs['limit'](_0x46560f[_0x0838('0x33')]['limit']);_0x4631cd[_0x0838('0x22')]=qs[_0x0838('0x22')](_0x46560f['query']['offset']);}_0x4631cd[_0x0838('0x3c')]=qs['sort'](_0x46560f[_0x0838('0x33')][_0x0838('0x3d')]);_0x4631cd[_0x0838('0x3e')]=qs['filters'](_[_0x0838('0x3f')](_0x46560f[_0x0838('0x33')],_0x4d6d47[_0x0838('0x35')]));if(_0x46560f[_0x0838('0x33')]['filter']){_0x4631cd[_0x0838('0x3e')]=_['merge'](_0x4631cd['where'],{'$or':_[_0x0838('0x2d')](_0x519836,function(_0x3e9f3d){if(_0x3e9f3d[_0x0838('0x31')]!==_0x0838('0x40')){var _0x37c921={};_0x37c921[_0x3e9f3d[_0x0838('0x2b')]]={'$like':'%'+_0x46560f['query'][_0x0838('0x41')]+'%'};return _0x37c921;}})});}_0x4631cd=_['merge']({},_0x4631cd,_0x46560f[_0x0838('0x42')]);var _0x115711={'where':_0x4631cd[_0x0838('0x3e')]};return db['UserProfile'][_0x0838('0x21')](_0x115711)[_0x0838('0x43')](function(_0x580902){_0x48949a['count']=_0x580902;if(_0x46560f[_0x0838('0x33')]['includeAll']){_0x4631cd[_0x0838('0x44')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x4631cd);})[_0x0838('0x43')](function(_0x180ead){_0x48949a[_0x0838('0x45')]=_0x180ead;return _0x48949a;})['then'](respondWithFilteredResult(_0x552e0c,_0x4631cd))[_0x0838('0x46')](handleError(_0x552e0c,null));};exports[_0x0838('0x47')]=function(_0x58f176,_0x3f3cf4){var _0xa6e41c={'raw':![],'where':{'id':_0x58f176[_0x0838('0x48')]['id']}},_0x2eab07={};_0x2eab07[_0x0838('0x32')]=_[_0x0838('0x34')](db['UserProfile'][_0x0838('0x2f')]);_0x2eab07['query']=_['keys'](_0x58f176[_0x0838('0x33')]);_0x2eab07[_0x0838('0x35')]=_[_0x0838('0x36')](_0x2eab07[_0x0838('0x32')],_0x2eab07[_0x0838('0x33')]);_0xa6e41c[_0x0838('0x37')]=_[_0x0838('0x36')](_0x2eab07[_0x0838('0x32')],qs[_0x0838('0x38')](_0x58f176[_0x0838('0x33')][_0x0838('0x38')]));_0xa6e41c['attributes']=_0xa6e41c[_0x0838('0x37')][_0x0838('0x39')]?_0xa6e41c[_0x0838('0x37')]:_0x2eab07['model'];if(_0x58f176[_0x0838('0x33')]['includeAll']){_0xa6e41c[_0x0838('0x44')]=[{'all':!![]}];}_0xa6e41c=_[_0x0838('0x49')]({},_0xa6e41c,_0x58f176[_0x0838('0x42')]);return db['UserProfile'][_0x0838('0x4a')](_0xa6e41c)[_0x0838('0x43')](handleEntityNotFound(_0x3f3cf4,null))['then'](respondWithResult(_0x3f3cf4,null))[_0x0838('0x46')](handleError(_0x3f3cf4,null));};exports[_0x0838('0x4b')]=function(_0x5a8ba2,_0x36ccfe){return db[_0x0838('0x2e')]['create'](_0x5a8ba2['body'],{})[_0x0838('0x43')](respondWithResult(_0x36ccfe,0xc9))[_0x0838('0x46')](handleError(_0x36ccfe,null));};exports['clone']=function(_0x41247c,_0x5a8dee){var _0x10fea8={'where':{'id':_0x41247c[_0x0838('0x48')]['id']}},_0x20629a={};_0x20629a['model']=_['keys'](db['UserProfile'][_0x0838('0x2f')]);_0x10fea8[_0x0838('0x37')]=_[_0x0838('0x36')](_0x20629a['model'],qs['fields'](_0x41247c[_0x0838('0x33')][_0x0838('0x38')]));_0x10fea8[_0x0838('0x37')]=_0x10fea8['attributes'][_0x0838('0x39')]?_0x10fea8[_0x0838('0x37')]:_0x20629a[_0x0838('0x32')];if(_0x41247c[_0x0838('0x33')][_0x0838('0x4c')]){_0x10fea8[_0x0838('0x44')]=[{'all':!![]}];}_0x10fea8=_['merge']({},_0x10fea8,_0x41247c[_0x0838('0x42')]);return db['UserProfile']['find'](_0x10fea8)[_0x0838('0x43')](handleEntityNotFound(_0x5a8dee,null))[_0x0838('0x43')](function(_0x5754e2){if(_0x5754e2){var _0xddb9dd=_0x5754e2[_0x0838('0x4d')]({'plain':!![]});_0xddb9dd=qs[_0x0838('0x4e')](_0xddb9dd,['id',_0x0838('0x4f'),_0x0838('0x50'),_0x0838('0x51')]);_0x41247c[_0x0838('0x52')]=_[_0x0838('0x4e')](_0x41247c[_0x0838('0x52')],['id',_0x0838('0x4f'),_0x0838('0x50')]);return db[_0x0838('0x53')]['transaction'](function(_0x39c796){return db['UserProfile']['create'](_[_0x0838('0x49')](_0xddb9dd,_0x41247c['body']),{'include':_0x41247c[_0x0838('0x33')][_0x0838('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x39c796})[_0x0838('0x43')](function(_0x340606){var _0x5e5afa=_0x340606[_0x0838('0x4d')]({'plain':!![]});return db[_0x0838('0x54')][_0x0838('0x55')]({'where':{'userProfileId':_0x41247c['params']['id']},'raw':!![]})[_0x0838('0x43')](function(_0x4c1992){if(_0x4c1992){return BPromise[_0x0838('0x56')](_0x4c1992,function(_0x17bae7){return new BPromise(function(_0x12f5b2,_0x1a4935){if(_0x17bae7[_0x0838('0x57')]===null||_0x17bae7[_0x0838('0x57')]===0x1)_0x12f5b2(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x17bae7['id']},'raw':!![]})[_0x0838('0x43')](function(_0x20ffd4){var _0x32f0b5=_['map'](_0x20ffd4,function(_0x470b29){return qs['omit'](_0x470b29,['id',_0x0838('0x4f'),_0x0838('0x50'),_0x0838('0x58')]);});_0x12f5b2(_0x32f0b5);})['catch'](function(_0x5dbb82){_0x1a4935(_0x5dbb82);});})[_0x0838('0x43')](function(_0x288641){var _0xd18569=qs[_0x0838('0x4e')](_0x17bae7,['id','createdAt',_0x0838('0x50')]);_0xd18569[_0x0838('0x59')]=_0x5e5afa['id'];if(_0x288641)_0xd18569[_0x0838('0x5a')]=_0x288641;return _0xd18569;})['then'](function(_0x3c2d15){return db[_0x0838('0x54')][_0x0838('0x4b')](_0x3c2d15,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x39c796});});})['then'](function(){return _0x5e5afa;});}});});});}})[_0x0838('0x43')](respondWithResult(_0x5a8dee,0xc9))['catch'](handleError(_0x5a8dee,null));};exports[_0x0838('0x29')]=function(_0x47584a,_0x294760){if(_0x47584a[_0x0838('0x52')]['id']){delete _0x47584a[_0x0838('0x52')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x47584a[_0x0838('0x48')]['id']}})[_0x0838('0x43')](handleEntityNotFound(_0x294760,null))[_0x0838('0x43')](saveUpdates(_0x47584a['body'],null))[_0x0838('0x43')](respondWithResult(_0x294760,null))[_0x0838('0x46')](handleError(_0x294760,null));};exports['destroy']=function(_0xf7c2c0,_0x337239){return db[_0x0838('0x2e')]['find']({'where':{'id':_0xf7c2c0[_0x0838('0x48')]['id']}})['then'](handleEntityNotFound(_0x337239,null))[_0x0838('0x43')](removeEntity(_0x337239,null))[_0x0838('0x46')](handleError(_0x337239,null));};exports['describe']=function(_0x5a5726,_0x23e107){return db['UserProfile'][_0x0838('0x5b')]()[_0x0838('0x43')](respondWithResult(_0x23e107,null))['catch'](handleError(_0x23e107,null));};exports['addSections']=function(_0xb7d807,_0x4c2fd8){var _0x52ebec=_0xb7d807[_0x0838('0x52')];return db[_0x0838('0x2e')][_0x0838('0x4a')]({'where':{'id':_0xb7d807['params']['id']}})[_0x0838('0x43')](handleEntityNotFound(_0x4c2fd8,null))[_0x0838('0x43')](function(_0x46a6e0){if(_0x46a6e0){return db[_0x0838('0x53')][_0x0838('0x5c')](function(_0x5939ff){return db[_0x0838('0x54')][_0x0838('0x5d')]({'where':{'userProfileId':_0xb7d807['params']['id'],'sectionId':_[_0x0838('0x2d')](_0x52ebec,function(_0x566eba){return _0x566eba[_0x0838('0x58')];})},'transaction':_0x5939ff})['then'](function(){var _0x4bf6c6=_[_0x0838('0x2d')](_0x52ebec,function(_0x3995f2){_0x3995f2[_0x0838('0x59')]=_0xb7d807[_0x0838('0x48')]['id'];return _0x3995f2;});var _0x1e6518=[];return BPromise[_0x0838('0x56')](_0x4bf6c6,function(_0x5d8e4a){return db[_0x0838('0x54')]['create'](_0x5d8e4a,{'include':[{'model':db[_0x0838('0x5e')],'as':_0x0838('0x5a')}],'raw':!![],'transaction':_0x5939ff})[_0x0838('0x43')](function(_0x40c1e7){_0x1e6518['push'](_0x40c1e7['get']({'plain':!![]}));});})[_0x0838('0x43')](function(){return _0x1e6518;});});});}})[_0x0838('0x43')](function(_0x39138d){return _0x39138d;})[_0x0838('0x43')](respondWithResult(_0x4c2fd8,null))[_0x0838('0x46')](handleError(_0x4c2fd8,null));};exports['removeSections']=function(_0x49bac4,_0x2f90da){var _0x224167;return db[_0x0838('0x2e')][_0x0838('0x4a')]({'where':{'id':_0x49bac4[_0x0838('0x48')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x2f90da,null))[_0x0838('0x43')](function(_0xc992d9){if(_0xc992d9){_0x224167=_0xc992d9;return db[_0x0838('0x54')][_0x0838('0x5d')]({'where':{'userProfileId':_0x49bac4[_0x0838('0x48')]['id'],'sectionId':_0x49bac4['query'][_0x0838('0x5f')]}});}})[_0x0838('0x43')](function(){return _0x224167;})[_0x0838('0x43')](respondWithStatusCode(_0x2f90da,null))['catch'](handleError(_0x2f90da,null));};exports[_0x0838('0x60')]=function(_0x5c554d,_0x2acc0e){var _0x135a2b=[];var _0x3c0bb6=[];return db[_0x0838('0x54')][_0x0838('0x55')]({'where':{'userProfileId':_0x5c554d[_0x0838('0x48')]['id']},'raw':!![]})[_0x0838('0x43')](function(_0x32dd2a){_0x135a2b=_[_0x0838('0x41')](_0x32dd2a,function(_0x44443d){return _0x44443d['enabled']===0x1;});if(!_[_0x0838('0x61')](_0x135a2b)){return _[_0x0838('0x2d')](_0x135a2b,function(_0x422e15){return _0x422e15['sectionId'];});}else{return;}})[_0x0838('0x43')](function(_0x1b852e){if(_0x1b852e)_0x3c0bb6=_0x1b852e;if(_['includes'](_0x3c0bb6,0x64)){var _0x52752d=_[_0x0838('0x4a')](_0x135a2b,{'sectionId':0x64});return hasDefaultDashboard(_0x52752d)[_0x0838('0x43')](function(_0x4df137){return _[_0x0838('0x2d')](_0x135a2b,function(_0x134007){if(_0x134007[_0x0838('0x58')]===0x64){_0x134007[_0x0838('0x62')]=_0x4df137;}return _0x134007;});});}else{return;}})['then'](function(_0x253165){if(_0x253165)_0x135a2b=_0x253165;if(_[_0x0838('0x63')](_0x3c0bb6,0x3eb)||_[_0x0838('0x64')](_0x135a2b,{'enabled':![],'sectionId':0x3eb})){var _0x108afa=_[_0x0838('0x4a')](_0x135a2b,{'sectionId':0x3eb});return getCustomDashboards(_0x108afa)[_0x0838('0x43')](function(_0x17e3c7){return _[_0x0838('0x2d')](_0x135a2b,function(_0x1ce653){if(_0x1ce653[_0x0838('0x58')]===0x3eb){_0x1ce653[_0x0838('0x62')]=_0x17e3c7;}return _0x1ce653;});});}else{return;}})[_0x0838('0x43')](function(_0x1814a2){if(_0x1814a2)_0x135a2b=_0x1814a2;if(_[_0x0838('0x63')](_0x3c0bb6,0x709)||_[_0x0838('0x64')](_0x135a2b,{'enabled':![],'sectionId':0x709})){var _0x5ac927=_[_0x0838('0x4a')](_0x135a2b,{'sectionId':0x709});return getPlugins(_0x5ac927)[_0x0838('0x43')](function(_0x15d4be){return _[_0x0838('0x2d')](_0x135a2b,function(_0x24f40){if(_0x24f40[_0x0838('0x58')]===0x709){_0x24f40['subsections']=_0x15d4be;}return _0x24f40;});});}else{return;}})['then'](function(_0x19d522){if(_0x19d522)_0x135a2b=_0x19d522;return _0x135a2b;})[_0x0838('0x43')](respondWithResult(_0x2acc0e,null))[_0x0838('0x46')](handleError(_0x2acc0e,null));};function hasDefaultDashboard(_0x13c47f){var _0x57b433=[0x65];return new BPromise(function(_0x39c6ef,_0x3cb35a){try{if(_0x13c47f[_0x0838('0x57')]){_0x39c6ef(_0x57b433);}else{return db[_0x0838('0x5e')][_0x0838('0x65')]({'where':{'sectionId':_0x13c47f['id']},'raw':!![]})[_0x0838('0x43')](function(_0x33bab8){if(_0x33bab8){_0x39c6ef(_0x57b433);}});}}catch(_0x1befcc){_0x3cb35a(_0x1befcc);}});}function getCustomDashboards(_0x34d10d){var _0x143ad5=[];return new BPromise(function(_0x1fffbf,_0x17bcb8){try{if(_0x34d10d[_0x0838('0x57')]){return db[_0x0838('0x66')]['findAll']({'raw':!![]})[_0x0838('0x43')](function(_0x5d53b0){_0x5d53b0['forEach'](function(_0x3475c7){_0x143ad5[_0x0838('0x67')](_0x3475c7['id']+0x1869f);});_0x1fffbf(_0x143ad5);});}else{return db[_0x0838('0x5e')][_0x0838('0x55')]({'where':{'sectionId':_0x34d10d['id']},'raw':!![]})['then'](function(_0x35eb3a){_0x35eb3a['forEach'](function(_0x133450){_0x143ad5[_0x0838('0x67')](_0x133450[_0x0838('0x68')]+0x1869f);});_0x1fffbf(_0x143ad5);});}}catch(_0x156297){_0x17bcb8(_0x156297);}});}function getPlugins(_0x445c94){var _0x896319=[];return new BPromise(function(_0x1c53d9,_0x3e6aed){try{if(_0x445c94['autoAssociation']){return db[_0x0838('0x69')][_0x0838('0x55')]({'raw':!![]})[_0x0838('0x43')](function(_0x3271a7){_0x3271a7[_0x0838('0x6a')](function(_0x2d8c2d){_0x896319[_0x0838('0x67')](_0x2d8c2d['id']+0x15b38);});_0x1c53d9(_0x896319);});}else{return db[_0x0838('0x5e')][_0x0838('0x55')]({'where':{'sectionId':_0x445c94['id']},'raw':!![]})[_0x0838('0x43')](function(_0x399a3c){_0x399a3c[_0x0838('0x6a')](function(_0x4d284b){_0x896319[_0x0838('0x67')](_0x4d284b[_0x0838('0x68')]+0x15b38);});_0x1c53d9(_0x896319);});}}catch(_0x27285f){_0x3e6aed(_0x27285f);}});}exports[_0x0838('0x6b')]=function(_0x289138,_0x112e83){return db[_0x0838('0x2e')]['find']({'where':{'id':_0x289138[_0x0838('0x48')]['id']}})[_0x0838('0x43')](handleEntityNotFound(_0x112e83,null))[_0x0838('0x43')](function(_0x5e43df){if(_0x5e43df){return db[_0x0838('0x53')][_0x0838('0x5c')](function(_0x595001){return db['UserProfileSection'][_0x0838('0x55')]({'where':{'userProfileId':_0x289138[_0x0838('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x36d3bb){if(_0x36d3bb){return db['UserProfileSection'][_0x0838('0x5d')]({'where':{'userProfileId':_0x289138[_0x0838('0x48')]['id'],'id':_[_0x0838('0x2d')](_0x36d3bb,function(_0x51a893){return _0x51a893['id'];})},'transaction':_0x595001});}})[_0x0838('0x43')](function(_0x32659b){var _0x2606f7=_[_0x0838('0x2d')](_0x289138[_0x0838('0x52')],function(_0x70a01f){_0x70a01f[_0x0838('0x59')]=_0x289138['params']['id'];return _0x70a01f;});return db['UserProfileSection']['bulkCreate'](_0x2606f7,{'raw':!![],'transaction':_0x595001});})[_0x0838('0x43')](function(_0x4a9a58){var _0x3cf4bd=_[_0x0838('0x41')](_[_0x0838('0x2d')](_0x4a9a58,function(_0x496e4d){return _0x496e4d[_0x0838('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x3cf4bd){return db[_0x0838('0x54')][_0x0838('0x55')]({'where':{'userProfileId':_0x289138['params']['id'],'sectionId':_[_0x0838('0x2d')](_0x3cf4bd,function(_0x9e3bbd){return _0x9e3bbd['sectionId'];})},'attributes':['id',_0x0838('0x58')],'raw':!![]})[_0x0838('0x43')](function(_0x4f6f41){var _0x3ee1a7=_[_0x0838('0x2d')](_0x289138[_0x0838('0x52')],function(_0x4be1b7){_0x4be1b7[_0x0838('0x59')]=_0x289138[_0x0838('0x48')]['id'];return _0x4be1b7;});return db[_0x0838('0x5e')]['bulkCreate'](_0x3ee1a7,{'raw':!![],'transaction':_0x595001});});}})[_0x0838('0x46')](handleError(_0x112e83,null));});}})['then'](function(_0x3de9d3){var _0x2b12d2=_['map'](_0x3de9d3,function(_0x1b516b){return _0x1b516b[_0x0838('0x4d')]({'plain':!![]});});})[_0x0838('0x43')](respondWithResult(_0x112e83,null))[_0x0838('0x46')](handleError(_0x112e83,null));};exports[_0x0838('0x6c')]=function(_0x431b65,_0x2a17a7,_0x4abd76){return db[_0x0838('0x2e')]['find']({'where':{'id':_0x431b65[_0x0838('0x48')]['id']}})[_0x0838('0x43')](handleEntityNotFound(_0x2a17a7,null))[_0x0838('0x43')](function(_0x1356f5){if(_0x1356f5){return _0x1356f5[_0x0838('0x6c')](_0x431b65['query']['ids']);}})[_0x0838('0x43')](respondWithStatusCode(_0x2a17a7,null))[_0x0838('0x46')](handleError(_0x2a17a7,null));};exports[_0x0838('0x6d')]=function(_0x2f9284,_0x54a41f){var _0x344395={'raw':![],'where':{}};var _0x486ada={};var _0x40c7ad={'count':0x0,'rows':[]};var _0x4e102f=_0x2f9284[_0x0838('0x33')][_0x0838('0x6e')];if(typeof _0x4e102f===_0x0838('0x6f')){throw new db[(_0x0838('0x70'))]['ValidationError']('Unknown\x20section');}var _0x1ba68d=_0x2f9284[_0x0838('0x33')]['mergeResources']||![];var _0x52346c=getQueryModels(_0x4e102f,_0x1ba68d);if(typeof _0x52346c[_0x0838('0x71')]==='undefined'){throw new db['Sequelize'][(_0x0838('0x72'))]('Invalid\x20section\x20\x27'+_0x4e102f+'\x27');}var _0x1c4fa4=[];if(!_[_0x0838('0x61')](_0x52346c[_0x0838('0x73')])){_0x1c4fa4=_0x52346c[_0x0838('0x73')];}else{_0x1c4fa4=[{'name':_0x4e102f}];}return db[_0x0838('0x2e')]['findOne']({'where':{'id':_0x2f9284['params']['id']}})[_0x0838('0x43')](handleEntityNotFound(_0x54a41f,null))[_0x0838('0x43')](function(_0x3cac72){if(_0x3cac72){var _0x744149=[];for(var _0x3733c7=0x0;_0x3733c7<_0x1c4fa4[_0x0838('0x39')];_0x3733c7++){_0x744149['push'](db['UserProfileSection'][_0x0838('0x65')]({'where':{'userProfileId':_0x3cac72['id'],'name':_0x1c4fa4[_0x3733c7][_0x0838('0x2b')]},'raw':!![]}));}return BPromise['all'](_0x744149);}})[_0x0838('0x43')](function(_0x4c9e7c){var _0x23310e=_[_0x0838('0x41')](_0x4c9e7c,function(_0x222720){return _0x222720?_0x222720:undefined;});var _0x43d680=_[_0x0838('0x41')](_0x1c4fa4,[_0x0838('0x74'),!![]]);var _0xab6c49=_[_0x0838('0x61')](_0x23310e)&&_[_0x0838('0x61')](_0x43d680)?null:_[_0x0838('0x75')](_0x43d680,_0x23310e);if(_0xab6c49){var _0x129581=[];for(var _0x10ed46=0x0;_0x10ed46<_0xab6c49[_0x0838('0x39')];_0x10ed46++){var _0x4272a5=_[_0x0838('0x4a')](_0x1c4fa4,function(_0x37d0cb){return _0xab6c49[_0x10ed46]?_0x37d0cb[_0x0838('0x2b')]===_0xab6c49[_0x10ed46]['name']:null;});if(_0x4272a5){if(_0xab6c49[_0x10ed46][_0x0838('0x74')]){_0x129581['push'](getAllResources(_0x52346c[_0x0838('0x71')],_0xab6c49[_0x10ed46]));}else{if(!_0xab6c49[_0x10ed46][_0x0838('0x57')]){_0x129581[_0x0838('0x67')](getAllowedResources(_0x4272a5,_0xab6c49[_0x10ed46],_0x52346c['childModel']));}else{if(_0x4272a5[_0x0838('0x32')]){_0x129581[_0x0838('0x67')](getAllFilteredResources(_0x4272a5,_0xab6c49[_0x10ed46]));}}}}}return BPromise[_0x0838('0x76')](_0x129581);}else{return null;}})[_0x0838('0x43')](function(_0x3a2b72){var _0x2afafd=_0x3a2b72;var _0x37654d=null;if(_0x2afafd){_0x37654d=_0x2afafd[_0x0838('0x39')]===0x1?_0x2afafd[0x0]:null;}if(_0x37654d||_0x2afafd){var _0x50573f=db[_0x52346c[_0x0838('0x71')]]['rawAttributes'];_0x486ada[_0x0838('0x32')]=_['keys'](_0x50573f);_0x486ada[_0x0838('0x33')]=_[_0x0838('0x34')](_0x2f9284[_0x0838('0x33')]);_0x486ada[_0x0838('0x35')]=_['intersection'](_0x486ada[_0x0838('0x32')],_0x486ada['query']);_0x344395['attributes']=_[_0x0838('0x36')](_0x486ada['model'],qs[_0x0838('0x38')](_0x2f9284[_0x0838('0x33')][_0x0838('0x38')]));_0x344395[_0x0838('0x37')]=_0x344395['attributes']['length']?_0x344395[_0x0838('0x37')]:_0x486ada[_0x0838('0x32')];if(!_0x2f9284[_0x0838('0x33')][_0x0838('0x3a')]('nolimit')){_0x344395[_0x0838('0x23')]=qs[_0x0838('0x23')](_0x2f9284[_0x0838('0x33')][_0x0838('0x23')]);_0x344395[_0x0838('0x22')]=qs[_0x0838('0x22')](_0x2f9284['query']['offset']);}_0x344395[_0x0838('0x3c')]=qs['sort'](_0x2f9284['query'][_0x0838('0x3d')]);_0x344395[_0x0838('0x3e')]=qs[_0x0838('0x35')](_[_0x0838('0x3f')](_0x2f9284[_0x0838('0x33')],_0x486ada[_0x0838('0x35')]));if(_0x2f9284[_0x0838('0x33')][_0x0838('0x41')]){_0x344395[_0x0838('0x3e')]=_[_0x0838('0x49')](_0x344395['where'],{'$or':_[_0x0838('0x2d')](_0x50573f,function(_0x5aa3a7){if(_0x5aa3a7[_0x0838('0x31')][_0x0838('0x77')]!==_0x0838('0x40')){var _0xdcb022={};_0xdcb022[_0x5aa3a7[_0x0838('0x78')]]={'$like':'%'+_0x2f9284[_0x0838('0x33')][_0x0838('0x41')]+'%'};return _0xdcb022;}})});}var _0x58816c=[];if(_0x37654d){var _0x81e7ff=_['find'](_0x1c4fa4,[_0x0838('0x2b'),_0x37654d[_0x0838('0x2b')]]);if(_0x81e7ff['field']){var _0x54e4d3={};if(_0x52346c['childModel']===_0x0838('0x79')){_0x54e4d3[_0x81e7ff[_0x0838('0x7a')]]=_['map'](_0x37654d[_0x0838('0x7b')],'id');}else{_0x54e4d3[_0x81e7ff[_0x0838('0x7a')]]=_0x37654d[_0x0838('0x7b')];}_0x58816c['push'](_0x54e4d3);}else{_0x344395['where']['id']=_0x37654d[_0x0838('0x7b')];}}else{for(var _0x74aeba=0x0;_0x74aeba<_0x2afafd[_0x0838('0x39')];_0x74aeba++){var _0x81e7ff=_[_0x0838('0x4a')](_0x1c4fa4,['name',_0x2afafd[_0x74aeba][_0x0838('0x2b')]]);if(_0x81e7ff[_0x0838('0x78')]){var _0x54e4d3={};_0x54e4d3[_0x81e7ff[_0x0838('0x7a')]]=_0x2afafd[_0x74aeba][_0x0838('0x7b')];_0x58816c['push'](_0x54e4d3);}else{if(!_0x344395[_0x0838('0x3e')]['id'])_0x344395[_0x0838('0x3e')]['id']=[];_0x2afafd[_0x74aeba]['associatedResources']['forEach'](function(_0x16371f){_0x344395['where']['id'][_0x0838('0x67')](_0x16371f);});}}}if(!_[_0x0838('0x61')](_0x58816c)){_0x344395[_0x0838('0x3e')]=_[_0x0838('0x49')](_0x344395[_0x0838('0x3e')],{'$and':{'$or':_0x58816c}});}_0x344395=_[_0x0838('0x49')]({},_0x344395,_0x2f9284[_0x0838('0x42')]);if(_0x37654d&&!_0x37654d[_0x0838('0x57')]&&_0x52346c[_0x0838('0x71')]===_0x0838('0x79')){if(_0x2f9284[_0x0838('0x33')][_0x0838('0x4c')]){_0x344395['include']=[{'all':!![]}];}return db[_0x52346c[_0x0838('0x71')]][_0x0838('0x55')](_0x344395)[_0x0838('0x43')](function(_0x3edb32){var _0x580c3d=[];_0x3edb32['forEach'](function(_0x401423){var _0x4973ff;switch(_0x401423[_0x0838('0x7c')]){case _0x0838('0x7d'):_0x4973ff=_[_0x0838('0x4a')](_0x37654d[_0x0838('0x7b')],function(_0x1ad5cd){return _0x1ad5cd['id']===_0x401423[_0x0838('0x7e')]&&_0x1ad5cd['type']===_0x0838('0x7f');});break;case _0x0838('0x80'):_0x4973ff=_[_0x0838('0x4a')](_0x37654d[_0x0838('0x7b')],function(_0x5e13a3){return _0x5e13a3['id']===_0x401423[_0x0838('0x7e')]&&_0x5e13a3[_0x0838('0x31')]===_0x0838('0x81');});break;}if(_0x4973ff)_0x580c3d[_0x0838('0x67')](_0x401423);});_0x40c7ad[_0x0838('0x21')]=_0x580c3d[_0x0838('0x39')];_0x40c7ad['rows']=_0x580c3d;return _0x40c7ad;});}else{return db[_0x52346c[_0x0838('0x71')]][_0x0838('0x21')]({'where':_0x344395[_0x0838('0x3e')]})[_0x0838('0x43')](function(_0x4a5a18){_0x40c7ad[_0x0838('0x21')]=_0x4a5a18;if(_0x2f9284[_0x0838('0x33')][_0x0838('0x4c')]){if(_0x52346c[_0x0838('0x71')]==='CmContact'){_0x344395['include']=[{'model':db[_0x0838('0x82')],'as':'Tags','attributes':['id',_0x0838('0x2b'),_0x0838('0x83')],'required':_0x2f9284[_0x0838('0x33')][_0x0838('0x84')]?!![]:![]},{'model':db[_0x0838('0x82')],'as':_0x0838('0x85'),'attributes':['id',_0x0838('0x2b'),_0x0838('0x83')],'through':_0x2f9284[_0x0838('0x33')][_0x0838('0x84')]?{'attributes':[],'where':{'TagId':_0x2f9284[_0x0838('0x33')]['tag']||undefined}}:{},'required':_0x2f9284[_0x0838('0x33')][_0x0838('0x84')]?!![]:![]}];}else{_0x344395[_0x0838('0x44')]=[{'all':!![]}];}}return db[_0x52346c['childModel']][_0x0838('0x55')](_0x344395);})[_0x0838('0x43')](function(_0x4579a3){_0x40c7ad[_0x0838('0x45')]=_0x4579a3;return _0x40c7ad;});}}else{return _0x40c7ad;}})['then'](respondWithFilteredResult(_0x54a41f,_0x344395))[_0x0838('0x46')](handleError(_0x54a41f,null));};function getAllResources(_0x2e1474,_0x19a1a8){return new BPromise(function(_0x27d2a1,_0x34060c){if(_0x19a1a8){var _0x4a692b=_0x19a1a8['filter']?{[_0x19a1a8[_0x0838('0x41')][_0x0838('0x78')]]:_0x19a1a8[_0x0838('0x41')][_0x0838('0x86')]}:undefined;return db[_0x2e1474][_0x0838('0x55')]({'where':_0x4a692b,'raw':!![]})[_0x0838('0x43')](function(_0x30d3ec){_0x19a1a8[_0x0838('0x7b')]=_[_0x0838('0x2d')](_0x30d3ec,'id');_0x27d2a1(_0x19a1a8);})[_0x0838('0x46')](function(_0x81742e){_0x34060c(_0x81742e);});}else{_0x27d2a1(null);}});}function getAllFilteredResources(_0x12ea9a,_0x458961){return new BPromise(function(_0x2268b2,_0x358082){var _0x2f4ae3=_0x12ea9a[_0x0838('0x41')]?{[_0x12ea9a['filter']['field']]:_0x12ea9a[_0x0838('0x41')][_0x0838('0x86')]}:undefined;return db[_0x12ea9a['model']][_0x0838('0x55')]({'where':_0x2f4ae3,'raw':!![]})[_0x0838('0x43')](function(_0x2ee66d){_0x458961[_0x0838('0x7b')]=_[_0x0838('0x2d')](_0x2ee66d,function(_0x43c761){return _0x43c761[_0x0838('0x2b')];});_0x2268b2(_0x458961);})[_0x0838('0x46')](function(_0x237c4f){_0x358082(_0x237c4f);});});}function getAllowedResources(_0x2dc398,_0x520c6a,_0x52cb9d){return new BPromise(function(_0x2e0ec3,_0x1b033f){if(_0x520c6a){return db[_0x0838('0x5e')]['findAll']({'where':{'sectionId':_0x520c6a['id']},'raw':!![]})[_0x0838('0x43')](function(_0x5a04d6){if(_0x2dc398[_0x0838('0x78')]&&_0x2dc398[_0x0838('0x78')]!=='id'){_0x520c6a[_0x0838('0x7b')]=_['map'](_0x5a04d6,function(_0x3b0d60){return _0x3b0d60[_0x2dc398[_0x0838('0x78')]];});}else{if(_0x52cb9d===_0x0838('0x79')){_0x520c6a[_0x0838('0x7b')]=_[_0x0838('0x2d')](_0x5a04d6,function(_0x1e9fed){return{'id':_0x1e9fed['resourceId'],'type':_0x1e9fed[_0x0838('0x31')]};});}else{_0x520c6a[_0x0838('0x7b')]=_[_0x0838('0x2d')](_0x5a04d6,function(_0x3fc926){return _0x3fc926['resourceId'];});}}_0x2e0ec3(_0x520c6a);})['catch'](function(_0xbf5201){_0x1b033f(_0xbf5201);});}else{_0x2e0ec3(null);}});}function getQueryModels(_0x57fce7,_0x44ff94){var _0x5ae5c0=_0x57fce7['toLowerCase']();var _0x193306={'childModel':undefined,'parentSections':[]};switch(_0x5ae5c0){case'squareprojects':_0x193306[_0x0838('0x71')]=_0x0838('0x87');break;case'odbc':_0x193306['childModel']=_0x0838('0x88');break;case'squarerecordings':_0x193306[_0x0838('0x71')]=_0x0838('0x89');_0x193306[_0x0838('0x73')]=[{'name':_0x0838('0x8a'),'field':'name','foreignKey':_0x0838('0x8b')}];break;case _0x0838('0x8c'):_0x193306[_0x0838('0x71')]=_0x0838('0x8d');break;case _0x0838('0x8e'):_0x193306[_0x0838('0x71')]=_0x0838('0x8f');_0x193306[_0x0838('0x73')]=[{'name':_0x0838('0x90'),'field':'id','foreignKey':_0x0838('0x91')}];break;case _0x0838('0x92'):_0x193306[_0x0838('0x71')]=_0x0838('0x93');break;case'companies':_0x193306[_0x0838('0x71')]=_0x0838('0x94');break;case _0x0838('0x95'):_0x193306[_0x0838('0x71')]=_0x0838('0x96');break;case'chatqueues':_0x193306[_0x0838('0x71')]='ChatQueue';break;case _0x0838('0x97'):_0x193306[_0x0838('0x71')]=_0x0838('0x98');break;case _0x0838('0x99'):_0x193306[_0x0838('0x71')]='FaxQueue';break;case _0x0838('0x9a'):_0x193306['childModel']=_0x0838('0x9b');break;case _0x0838('0x9c'):case'internalroutes':case _0x0838('0x9d'):_0x193306[_0x0838('0x71')]='VoiceExtension';break;case _0x0838('0x9e'):_0x193306['childModel']=_0x0838('0x9f');break;case'voicemails':_0x193306[_0x0838('0x71')]=_0x0838('0xa0');break;case'voicerecordings':_0x193306[_0x0838('0x71')]='VoiceRecording';_0x193306['parentSections']=[{'name':'Agents','field':'name','foreignKey':_0x0838('0xa1'),'model':'User','filter':{'field':_0x0838('0xa2'),'value':[_0x0838('0xa3')]}},{'name':_0x0838('0xa4'),'field':'name','foreignKey':_0x0838('0xa1'),'model':_0x0838('0xa5'),'filter':{'field':_0x0838('0xa2'),'value':[_0x0838('0xa6')]}},{'name':_0x0838('0xa7'),'field':_0x0838('0x2b'),'foreignKey':_0x0838('0xa8'),'model':_0x0838('0xa9'),'filter':{'field':'type','value':[_0x0838('0xaa')]}},{'name':_0x0838('0xab'),'field':_0x0838('0x2b'),'foreignKey':_0x0838('0xa8'),'model':_0x0838('0xa9'),'filter':{'field':_0x0838('0x31'),'value':[_0x0838('0xac')]}}];break;case _0x0838('0xad'):_0x193306[_0x0838('0x71')]=_0x0838('0xae');break;case'chanspies':_0x193306[_0x0838('0x71')]=_0x0838('0xaf');break;case'voiceprefixes':_0x193306[_0x0838('0x71')]=_0x0838('0xb0');break;case _0x0838('0xb1'):_0x193306[_0x0838('0x71')]=_0x0838('0xb2');break;case'mailqueues':_0x193306[_0x0838('0x71')]='MailQueue';break;case'mailaccounts':_0x193306[_0x0838('0x71')]=_0x0838('0xb3');break;case _0x0838('0xb4'):_0x193306[_0x0838('0x71')]=_0x0838('0xb5');break;case _0x0838('0xb6'):_0x193306[_0x0838('0x71')]=_0x0838('0xb7');break;case _0x0838('0xb8'):_0x193306[_0x0838('0x71')]='OpenchannelAccount';break;case'smsqueues':_0x193306[_0x0838('0x71')]=_0x0838('0xb9');break;case _0x0838('0xba'):_0x193306[_0x0838('0x71')]=_0x0838('0xbb');break;case _0x0838('0xbc'):_0x193306[_0x0838('0x71')]=_0x0838('0xbd');break;case _0x0838('0xbe'):case _0x0838('0xbf'):_0x193306[_0x0838('0x71')]=_0x0838('0xa9');if(_0x44ff94){_0x193306[_0x0838('0x73')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x0838('0xc0'):case _0x0838('0xc1'):case _0x0838('0xc2'):_0x193306[_0x0838('0x71')]='User';if(_0x44ff94){_0x193306[_0x0838('0x73')]=[{'name':_0x0838('0xc3'),'filter':{'field':_0x0838('0xa2'),'value':[_0x0838('0xc4'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x0838('0xa4')}];}break;case _0x0838('0xc5'):_0x193306[_0x0838('0x71')]='ZendeskAccount';break;case _0x0838('0xc6'):_0x193306[_0x0838('0x71')]=_0x0838('0xc7');break;case _0x0838('0xc8'):_0x193306[_0x0838('0x71')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x193306['childModel']=_0x0838('0xc9');break;case'deskaccounts':_0x193306['childModel']=_0x0838('0xca');break;case _0x0838('0xcb'):_0x193306[_0x0838('0x71')]=_0x0838('0xcc');break;case'vtigeraccounts':_0x193306[_0x0838('0x71')]=_0x0838('0xa5');break;case _0x0838('0xcd'):_0x193306[_0x0838('0x71')]=_0x0838('0xce');break;case _0x0838('0xcf'):_0x193306['childModel']='Disposition';break;case _0x0838('0xd0'):_0x193306['childModel']=_0x0838('0x66');break;case _0x0838('0xd1'):_0x193306[_0x0838('0x71')]=_0x0838('0xd2');break;case _0x0838('0xd3'):_0x193306[_0x0838('0x71')]=_0x0838('0xd4');break;case'scheduler':_0x193306['childModel']=_0x0838('0xd5');break;case _0x0838('0xd6'):_0x193306['childModel']=_0x0838('0xd7');break;case _0x0838('0xd8'):_0x193306['childModel']=_0x0838('0x82');break;case _0x0838('0xd9'):_0x193306['childModel']=_0x0838('0xda');break;case _0x0838('0xdb'):_0x193306[_0x0838('0x71')]=_0x0838('0xdc');break;case _0x0838('0xdd'):_0x193306['childModel']=_0x0838('0xde');break;case _0x0838('0xdf'):_0x193306[_0x0838('0x71')]=_0x0838('0xe0');break;case'plugins':_0x193306[_0x0838('0x71')]=_0x0838('0x69');break;case _0x0838('0xe1'):_0x193306[_0x0838('0x71')]=_0x0838('0x79');_0x193306[_0x0838('0x73')]=[{'name':_0x0838('0xe2'),'field':'id','foreignKey':_0x0838('0x7e')}];break;case'metrics':_0x193306[_0x0838('0x71')]=_0x0838('0xe3');break;default:return _0x193306;}return _0x193306;} \ No newline at end of file +var _0x3fdc=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','register','sendStatus','status','json','count','offset','set','update','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','params','fields','include','find','create','body','catch','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','removeSections','getSections','isEmpty','sectionId','includes','subsections','some','findOne','forEach','push','resourceId','Plugin','addResources','transaction','bulkCreate','removeResources','ids','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','Invalid\x20section\x20\x27','parentSections','ignore','childModel','all','order','key','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','tag','ThroughTags','color','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','lists','CmList','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','agent','Telephones','membername','role','telephone','VoiceQueues','VoiceQueue','inbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','Team','voicequeues','queuecampaigns','users','agents','telephones','User','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Interval','scheduler','Schedule','Sound','tags','templates','Template','triggers','Trigger','Trunk','variables','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x2dbc5b,_0x141f92){var _0x2bd121=function(_0x12e161){while(--_0x12e161){_0x2dbc5b['push'](_0x2dbc5b['shift']());}};_0x2bd121(++_0x141f92);}(_0x3fdc,0xd5));var _0xc3fd=function(_0xb78ec8,_0x29e00a){_0xb78ec8=_0xb78ec8-0x0;var _0xddf667=_0x3fdc[_0xb78ec8];return _0xddf667;};'use strict';var pdf=require(_0xc3fd('0x0'));var emlformat=require(_0xc3fd('0x1'));var rimraf=require(_0xc3fd('0x2'));var zipdir=require(_0xc3fd('0x3'));var jsonpatch=require(_0xc3fd('0x4'));var rp=require(_0xc3fd('0x5'));var moment=require(_0xc3fd('0x6'));var BPromise=require(_0xc3fd('0x7'));var Mustache=require(_0xc3fd('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc3fd('0x9'));var fs=require('fs');var _=require(_0xc3fd('0xa'));var squel=require(_0xc3fd('0xb'));var crypto=require(_0xc3fd('0xc'));var jsforce=require(_0xc3fd('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc3fd('0xe'));var Papa=require('papaparse');var Redis=require(_0xc3fd('0xf'));var authService=require(_0xc3fd('0x10'));var qs=require(_0xc3fd('0x11'));var as=require(_0xc3fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3fd('0x13'))(_0xc3fd('0x14'));var utils=require(_0xc3fd('0x15'));var config=require(_0xc3fd('0x16'));var db=require(_0xc3fd('0x17'))['db'];config[_0xc3fd('0x18')]=_['defaults'](config[_0xc3fd('0x18')],{'host':_0xc3fd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc3fd('0x1a'))[_0xc3fd('0x1b')](socket);function respondWithStatusCode(_0x395a78,_0x48694b){_0x48694b=_0x48694b||0xcc;return function(_0x2c243c){if(_0x2c243c){return _0x395a78[_0xc3fd('0x1c')](_0x48694b);}return _0x395a78[_0xc3fd('0x1d')](_0x48694b)['end']();};}function respondWithResult(_0x9b63af,_0x4ef21d){_0x4ef21d=_0x4ef21d||0xc8;return function(_0x545ec7){if(_0x545ec7){return _0x9b63af[_0xc3fd('0x1d')](_0x4ef21d)[_0xc3fd('0x1e')](_0x545ec7);}};}function respondWithFilteredResult(_0x5edfc0,_0x3debe){return function(_0xe21401){if(_0xe21401){var _0x15cd6b=_0xe21401[_0xc3fd('0x1f')],_0x319b1f=_0x3debe[_0xc3fd('0x20')],_0x5e55af=_0x3debe['offset']+_0x3debe['limit'],_0x2507bf;if(_0x5e55af>=_0x15cd6b){_0x5e55af=_0x15cd6b;_0x2507bf=0xc8;}else{_0x2507bf=0xce;}_0x5edfc0[_0xc3fd('0x1d')](_0x2507bf);return _0x5edfc0[_0xc3fd('0x21')]('Content-Range',_0x319b1f+'-'+_0x5e55af+'/'+_0x15cd6b)[_0xc3fd('0x1e')](_0xe21401);}return null;};}function patchUpdates(_0x431a91){return function(_0x4105d8){try{jsonpatch['apply'](_0x4105d8,_0x431a91,!![]);}catch(_0x14a2fc){return BPromise['reject'](_0x14a2fc);}return _0x4105d8['save']();};}function saveUpdates(_0x11960d,_0x589981){return function(_0xf89613){if(_0xf89613){return _0xf89613[_0xc3fd('0x22')](_0x11960d)[_0xc3fd('0x23')](function(_0x2f7ad9){return _0x2f7ad9;});}return null;};}function removeEntity(_0x252930,_0x2716e0){return function(_0x40c3a4){if(_0x40c3a4){return _0x40c3a4[_0xc3fd('0x24')]()[_0xc3fd('0x23')](function(){_0x252930['status'](0xcc)[_0xc3fd('0x25')]();});}};}function handleEntityNotFound(_0xb3f2e2,_0x1dc034){return function(_0x1c4901){if(!_0x1c4901){_0xb3f2e2[_0xc3fd('0x1c')](0x194);}return _0x1c4901;};}function handleError(_0x37dd43,_0x4148c8){_0x4148c8=_0x4148c8||0x1f4;return function(_0x2cebd3){logger[_0xc3fd('0x26')](_0x2cebd3[_0xc3fd('0x27')]);if(_0x2cebd3['name']){delete _0x2cebd3[_0xc3fd('0x28')];}_0x37dd43[_0xc3fd('0x1d')](_0x4148c8)[_0xc3fd('0x29')](_0x2cebd3);};}exports[_0xc3fd('0x2a')]=function(_0x1f8dc0,_0x394ea2){var _0x1758b8={},_0x480102={},_0x1574b7={'count':0x0,'rows':[]};var _0x17516c=_[_0xc3fd('0x2b')](db[_0xc3fd('0x2c')][_0xc3fd('0x2d')],function(_0x1fb621){return{'name':_0x1fb621[_0xc3fd('0x2e')],'type':_0x1fb621[_0xc3fd('0x2f')]['key']};});_0x480102[_0xc3fd('0x30')]=_[_0xc3fd('0x2b')](_0x17516c,_0xc3fd('0x28'));_0x480102[_0xc3fd('0x31')]=_[_0xc3fd('0x32')](_0x1f8dc0[_0xc3fd('0x31')]);_0x480102[_0xc3fd('0x33')]=_[_0xc3fd('0x34')](_0x480102[_0xc3fd('0x30')],_0x480102['query']);_0x1758b8[_0xc3fd('0x35')]=_[_0xc3fd('0x34')](_0x480102[_0xc3fd('0x30')],qs['fields'](_0x1f8dc0[_0xc3fd('0x31')]['fields']));_0x1758b8['attributes']=_0x1758b8[_0xc3fd('0x35')][_0xc3fd('0x36')]?_0x1758b8[_0xc3fd('0x35')]:_0x480102['model'];if(!_0x1f8dc0[_0xc3fd('0x31')][_0xc3fd('0x37')](_0xc3fd('0x38'))){_0x1758b8[_0xc3fd('0x39')]=qs[_0xc3fd('0x39')](_0x1f8dc0[_0xc3fd('0x31')][_0xc3fd('0x39')]);_0x1758b8['offset']=qs[_0xc3fd('0x20')](_0x1f8dc0[_0xc3fd('0x31')]['offset']);}_0x1758b8['order']=qs[_0xc3fd('0x3a')](_0x1f8dc0[_0xc3fd('0x31')][_0xc3fd('0x3a')]);_0x1758b8['where']=qs[_0xc3fd('0x33')](_[_0xc3fd('0x3b')](_0x1f8dc0[_0xc3fd('0x31')],_0x480102[_0xc3fd('0x33')]));if(_0x1f8dc0['query'][_0xc3fd('0x3c')]){_0x1758b8[_0xc3fd('0x3d')]=_['merge'](_0x1758b8[_0xc3fd('0x3d')],{'$or':_['map'](_0x17516c,function(_0x412d84){if(_0x412d84[_0xc3fd('0x2f')]!==_0xc3fd('0x3e')){var _0xd90c8f={};_0xd90c8f[_0x412d84[_0xc3fd('0x28')]]={'$like':'%'+_0x1f8dc0[_0xc3fd('0x31')]['filter']+'%'};return _0xd90c8f;}})});}_0x1758b8=_[_0xc3fd('0x3f')]({},_0x1758b8,_0x1f8dc0[_0xc3fd('0x40')]);var _0x929079={'where':_0x1758b8['where']};return db[_0xc3fd('0x2c')][_0xc3fd('0x1f')](_0x929079)[_0xc3fd('0x23')](function(_0x3c5c3f){_0x1574b7[_0xc3fd('0x1f')]=_0x3c5c3f;if(_0x1f8dc0[_0xc3fd('0x31')][_0xc3fd('0x41')]){_0x1758b8['include']=[{'all':!![]}];}return db[_0xc3fd('0x2c')][_0xc3fd('0x42')](_0x1758b8);})[_0xc3fd('0x23')](function(_0x1c2885){_0x1574b7[_0xc3fd('0x43')]=_0x1c2885;return _0x1574b7;})['then'](respondWithFilteredResult(_0x394ea2,_0x1758b8))['catch'](handleError(_0x394ea2,null));};exports['show']=function(_0x46cb2b,_0x4961cf){var _0x18edb3={'raw':![],'where':{'id':_0x46cb2b[_0xc3fd('0x44')]['id']}},_0x24cdfb={};_0x24cdfb[_0xc3fd('0x30')]=_[_0xc3fd('0x32')](db[_0xc3fd('0x2c')][_0xc3fd('0x2d')]);_0x24cdfb['query']=_['keys'](_0x46cb2b[_0xc3fd('0x31')]);_0x24cdfb[_0xc3fd('0x33')]=_[_0xc3fd('0x34')](_0x24cdfb[_0xc3fd('0x30')],_0x24cdfb['query']);_0x18edb3[_0xc3fd('0x35')]=_[_0xc3fd('0x34')](_0x24cdfb[_0xc3fd('0x30')],qs[_0xc3fd('0x45')](_0x46cb2b['query'][_0xc3fd('0x45')]));_0x18edb3[_0xc3fd('0x35')]=_0x18edb3['attributes'][_0xc3fd('0x36')]?_0x18edb3[_0xc3fd('0x35')]:_0x24cdfb[_0xc3fd('0x30')];if(_0x46cb2b[_0xc3fd('0x31')][_0xc3fd('0x41')]){_0x18edb3[_0xc3fd('0x46')]=[{'all':!![]}];}_0x18edb3=_[_0xc3fd('0x3f')]({},_0x18edb3,_0x46cb2b[_0xc3fd('0x40')]);return db['UserProfile'][_0xc3fd('0x47')](_0x18edb3)[_0xc3fd('0x23')](handleEntityNotFound(_0x4961cf,null))['then'](respondWithResult(_0x4961cf,null))['catch'](handleError(_0x4961cf,null));};exports[_0xc3fd('0x48')]=function(_0xcd64d8,_0x5af920){return db[_0xc3fd('0x2c')]['create'](_0xcd64d8[_0xc3fd('0x49')],{})[_0xc3fd('0x23')](respondWithResult(_0x5af920,0xc9))[_0xc3fd('0x4a')](handleError(_0x5af920,null));};exports[_0xc3fd('0x4b')]=function(_0x35585d,_0x3ddc21){var _0x22ec69={'where':{'id':_0x35585d[_0xc3fd('0x44')]['id']}},_0x1e3689={};_0x1e3689[_0xc3fd('0x30')]=_[_0xc3fd('0x32')](db[_0xc3fd('0x2c')][_0xc3fd('0x2d')]);_0x22ec69[_0xc3fd('0x35')]=_['intersection'](_0x1e3689[_0xc3fd('0x30')],qs[_0xc3fd('0x45')](_0x35585d['query']['fields']));_0x22ec69['attributes']=_0x22ec69[_0xc3fd('0x35')]['length']?_0x22ec69[_0xc3fd('0x35')]:_0x1e3689[_0xc3fd('0x30')];if(_0x35585d[_0xc3fd('0x31')][_0xc3fd('0x41')]){_0x22ec69[_0xc3fd('0x46')]=[{'all':!![]}];}_0x22ec69=_['merge']({},_0x22ec69,_0x35585d[_0xc3fd('0x40')]);return db[_0xc3fd('0x2c')][_0xc3fd('0x47')](_0x22ec69)[_0xc3fd('0x23')](handleEntityNotFound(_0x3ddc21,null))[_0xc3fd('0x23')](function(_0x156a9a){if(_0x156a9a){var _0x4a6d16=_0x156a9a[_0xc3fd('0x4c')]({'plain':!![]});_0x4a6d16=qs[_0xc3fd('0x4d')](_0x4a6d16,['id',_0xc3fd('0x4e'),_0xc3fd('0x4f'),_0xc3fd('0x50')]);_0x35585d[_0xc3fd('0x49')]=_[_0xc3fd('0x4d')](_0x35585d[_0xc3fd('0x49')],['id','createdAt',_0xc3fd('0x4f')]);return db[_0xc3fd('0x51')]['transaction'](function(_0x3944e1){return db[_0xc3fd('0x2c')]['create'](_[_0xc3fd('0x3f')](_0x4a6d16,_0x35585d['body']),{'include':_0x35585d[_0xc3fd('0x31')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3944e1})['then'](function(_0xf6b107){var _0x9cfb7=_0xf6b107[_0xc3fd('0x4c')]({'plain':!![]});return db[_0xc3fd('0x52')][_0xc3fd('0x42')]({'where':{'userProfileId':_0x35585d[_0xc3fd('0x44')]['id']},'raw':!![]})[_0xc3fd('0x23')](function(_0x1aebf2){if(_0x1aebf2){return BPromise[_0xc3fd('0x53')](_0x1aebf2,function(_0x224304){return new BPromise(function(_0x3d56cd,_0xd10ed9){if(_0x224304[_0xc3fd('0x54')]===null||_0x224304[_0xc3fd('0x54')]===0x1)_0x3d56cd(null);return db[_0xc3fd('0x55')][_0xc3fd('0x42')]({'where':{'sectionId':_0x224304['id']},'raw':!![]})['then'](function(_0x4ca02a){var _0x3002c5=_['map'](_0x4ca02a,function(_0x40cac3){return qs[_0xc3fd('0x4d')](_0x40cac3,['id','createdAt',_0xc3fd('0x4f'),'sectionId']);});_0x3d56cd(_0x3002c5);})[_0xc3fd('0x4a')](function(_0x2977ac){_0xd10ed9(_0x2977ac);});})['then'](function(_0x18bee7){var _0x1589e2=qs[_0xc3fd('0x4d')](_0x224304,['id',_0xc3fd('0x4e'),_0xc3fd('0x4f')]);_0x1589e2[_0xc3fd('0x56')]=_0x9cfb7['id'];if(_0x18bee7)_0x1589e2[_0xc3fd('0x57')]=_0x18bee7;return _0x1589e2;})['then'](function(_0x298a88){return db[_0xc3fd('0x52')][_0xc3fd('0x48')](_0x298a88,{'include':[{'model':db[_0xc3fd('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x3944e1});});})[_0xc3fd('0x23')](function(){return _0x9cfb7;});}});});});}})[_0xc3fd('0x23')](respondWithResult(_0x3ddc21,0xc9))[_0xc3fd('0x4a')](handleError(_0x3ddc21,null));};exports[_0xc3fd('0x22')]=function(_0x26f930,_0x1985cb){if(_0x26f930[_0xc3fd('0x49')]['id']){delete _0x26f930[_0xc3fd('0x49')]['id'];}return db[_0xc3fd('0x2c')][_0xc3fd('0x47')]({'where':{'id':_0x26f930[_0xc3fd('0x44')]['id']}})[_0xc3fd('0x23')](handleEntityNotFound(_0x1985cb,null))[_0xc3fd('0x23')](saveUpdates(_0x26f930[_0xc3fd('0x49')],null))[_0xc3fd('0x23')](respondWithResult(_0x1985cb,null))[_0xc3fd('0x4a')](handleError(_0x1985cb,null));};exports[_0xc3fd('0x24')]=function(_0x3aee5e,_0x54e709){return db[_0xc3fd('0x2c')]['find']({'where':{'id':_0x3aee5e[_0xc3fd('0x44')]['id']}})['then'](handleEntityNotFound(_0x54e709,null))[_0xc3fd('0x23')](removeEntity(_0x54e709,null))['catch'](handleError(_0x54e709,null));};exports[_0xc3fd('0x58')]=function(_0x1eb07d,_0x31b030){return db[_0xc3fd('0x2c')][_0xc3fd('0x58')]()[_0xc3fd('0x23')](respondWithResult(_0x31b030,null))[_0xc3fd('0x4a')](handleError(_0x31b030,null));};exports[_0xc3fd('0x59')]=function(_0x333b22,_0x3521a8){var _0x4081bd=_0x333b22[_0xc3fd('0x49')];return db['UserProfile'][_0xc3fd('0x47')]({'where':{'id':_0x333b22['params']['id']}})['then'](handleEntityNotFound(_0x3521a8,null))[_0xc3fd('0x23')](function(_0x24e2c1){if(_0x24e2c1){return db[_0xc3fd('0x51')]['transaction'](function(_0x59a565){return db[_0xc3fd('0x52')]['destroy']({'where':{'userProfileId':_0x333b22[_0xc3fd('0x44')]['id'],'sectionId':_['map'](_0x4081bd,function(_0x26bf22){return _0x26bf22['sectionId'];})},'transaction':_0x59a565})[_0xc3fd('0x23')](function(){var _0x273ffb=_['map'](_0x4081bd,function(_0x57fbb4){_0x57fbb4[_0xc3fd('0x56')]=_0x333b22['params']['id'];return _0x57fbb4;});var _0x2a11fd=[];return BPromise[_0xc3fd('0x53')](_0x273ffb,function(_0x197388){return db[_0xc3fd('0x52')][_0xc3fd('0x48')](_0x197388,{'include':[{'model':db[_0xc3fd('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x59a565})[_0xc3fd('0x23')](function(_0x23d4c5){_0x2a11fd['push'](_0x23d4c5[_0xc3fd('0x4c')]({'plain':!![]}));});})[_0xc3fd('0x23')](function(){return _0x2a11fd;});});});}})[_0xc3fd('0x23')](function(_0x33d032){return _0x33d032;})[_0xc3fd('0x23')](respondWithResult(_0x3521a8,null))['catch'](handleError(_0x3521a8,null));};exports[_0xc3fd('0x5a')]=function(_0x35674a,_0x48f4e5){var _0x21eb30;return db[_0xc3fd('0x2c')][_0xc3fd('0x47')]({'where':{'id':_0x35674a[_0xc3fd('0x44')]['id']},'attributes':['id',_0xc3fd('0x28')]})[_0xc3fd('0x23')](handleEntityNotFound(_0x48f4e5,null))[_0xc3fd('0x23')](function(_0x560ab7){if(_0x560ab7){_0x21eb30=_0x560ab7;return db[_0xc3fd('0x52')][_0xc3fd('0x24')]({'where':{'userProfileId':_0x35674a[_0xc3fd('0x44')]['id'],'sectionId':_0x35674a[_0xc3fd('0x31')]['ids']}});}})['then'](function(){return _0x21eb30;})[_0xc3fd('0x23')](respondWithStatusCode(_0x48f4e5,null))[_0xc3fd('0x4a')](handleError(_0x48f4e5,null));};exports[_0xc3fd('0x5b')]=function(_0x1ca08b,_0x482cbc){var _0x53866d=[];var _0x242038=[];return db[_0xc3fd('0x52')][_0xc3fd('0x42')]({'where':{'userProfileId':_0x1ca08b[_0xc3fd('0x44')]['id']},'raw':!![]})[_0xc3fd('0x23')](function(_0x1e93d3){_0x53866d=_[_0xc3fd('0x3c')](_0x1e93d3,function(_0x466645){return _0x466645['enabled']===0x1;});if(!_[_0xc3fd('0x5c')](_0x53866d)){return _['map'](_0x53866d,function(_0x46a555){return _0x46a555[_0xc3fd('0x5d')];});}else{return;}})['then'](function(_0x58ef78){if(_0x58ef78)_0x242038=_0x58ef78;if(_[_0xc3fd('0x5e')](_0x242038,0x64)){var _0x59becc=_[_0xc3fd('0x47')](_0x53866d,{'sectionId':0x64});return hasDefaultDashboard(_0x59becc)['then'](function(_0x30a674){return _[_0xc3fd('0x2b')](_0x53866d,function(_0x33a2b1){if(_0x33a2b1[_0xc3fd('0x5d')]===0x64){_0x33a2b1[_0xc3fd('0x5f')]=_0x30a674;}return _0x33a2b1;});});}else{return;}})[_0xc3fd('0x23')](function(_0x30a0e4){if(_0x30a0e4)_0x53866d=_0x30a0e4;if(_['includes'](_0x242038,0x3eb)||_['some'](_0x53866d,{'enabled':![],'sectionId':0x3eb})){var _0x172429=_['find'](_0x53866d,{'sectionId':0x3eb});return getCustomDashboards(_0x172429)['then'](function(_0x3a0f96){return _[_0xc3fd('0x2b')](_0x53866d,function(_0x50b37f){if(_0x50b37f[_0xc3fd('0x5d')]===0x3eb){_0x50b37f[_0xc3fd('0x5f')]=_0x3a0f96;}return _0x50b37f;});});}else{return;}})[_0xc3fd('0x23')](function(_0x46c532){if(_0x46c532)_0x53866d=_0x46c532;if(_[_0xc3fd('0x5e')](_0x242038,0x709)||_[_0xc3fd('0x60')](_0x53866d,{'enabled':![],'sectionId':0x709})){var _0x3927ac=_[_0xc3fd('0x47')](_0x53866d,{'sectionId':0x709});return getPlugins(_0x3927ac)[_0xc3fd('0x23')](function(_0x58b8e8){return _['map'](_0x53866d,function(_0x398cd4){if(_0x398cd4['sectionId']===0x709){_0x398cd4[_0xc3fd('0x5f')]=_0x58b8e8;}return _0x398cd4;});});}else{return;}})['then'](function(_0x1411f7){if(_0x1411f7)_0x53866d=_0x1411f7;return _0x53866d;})['then'](respondWithResult(_0x482cbc,null))[_0xc3fd('0x4a')](handleError(_0x482cbc,null));};function hasDefaultDashboard(_0x1dcd48){var _0x3105fe=[0x65];return new BPromise(function(_0x5a61a9,_0x302814){try{if(_0x1dcd48[_0xc3fd('0x54')]){_0x5a61a9(_0x3105fe);}else{return db[_0xc3fd('0x55')][_0xc3fd('0x61')]({'where':{'sectionId':_0x1dcd48['id']},'raw':!![]})[_0xc3fd('0x23')](function(_0x12d830){if(_0x12d830){_0x5a61a9(_0x3105fe);}});}}catch(_0x37030f){_0x302814(_0x37030f);}});}function getCustomDashboards(_0x3b0ac4){var _0x3e861d=[];return new BPromise(function(_0x373083,_0x22e5f6){try{if(_0x3b0ac4[_0xc3fd('0x54')]){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x41ab6c){_0x41ab6c[_0xc3fd('0x62')](function(_0x10eaf4){_0x3e861d[_0xc3fd('0x63')](_0x10eaf4['id']+0x1869f);});_0x373083(_0x3e861d);});}else{return db[_0xc3fd('0x55')][_0xc3fd('0x42')]({'where':{'sectionId':_0x3b0ac4['id']},'raw':!![]})[_0xc3fd('0x23')](function(_0x4c4361){_0x4c4361['forEach'](function(_0x1ad502){_0x3e861d[_0xc3fd('0x63')](_0x1ad502[_0xc3fd('0x64')]+0x1869f);});_0x373083(_0x3e861d);});}}catch(_0x2b2b44){_0x22e5f6(_0x2b2b44);}});}function getPlugins(_0x1155e3){var _0x430e32=[];return new BPromise(function(_0x36efbd,_0x4752fb){try{if(_0x1155e3['autoAssociation']){return db[_0xc3fd('0x65')][_0xc3fd('0x42')]({'raw':!![]})[_0xc3fd('0x23')](function(_0xa19b07){_0xa19b07[_0xc3fd('0x62')](function(_0x1bf155){_0x430e32[_0xc3fd('0x63')](_0x1bf155['id']+0x15b38);});_0x36efbd(_0x430e32);});}else{return db[_0xc3fd('0x55')][_0xc3fd('0x42')]({'where':{'sectionId':_0x1155e3['id']},'raw':!![]})['then'](function(_0x2a5be8){_0x2a5be8[_0xc3fd('0x62')](function(_0x11818e){_0x430e32[_0xc3fd('0x63')](_0x11818e[_0xc3fd('0x64')]+0x15b38);});_0x36efbd(_0x430e32);});}}catch(_0x1e586c){_0x4752fb(_0x1e586c);}});}exports[_0xc3fd('0x66')]=function(_0x1b4319,_0x3cad92){return db[_0xc3fd('0x2c')]['find']({'where':{'id':_0x1b4319[_0xc3fd('0x44')]['id']}})[_0xc3fd('0x23')](handleEntityNotFound(_0x3cad92,null))[_0xc3fd('0x23')](function(_0x2891d2){if(_0x2891d2){return db[_0xc3fd('0x51')][_0xc3fd('0x67')](function(_0x5754d1){return db[_0xc3fd('0x52')][_0xc3fd('0x42')]({'where':{'userProfileId':_0x1b4319[_0xc3fd('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xc3fd('0x23')](function(_0x59e3d9){if(_0x59e3d9){return db[_0xc3fd('0x52')][_0xc3fd('0x24')]({'where':{'userProfileId':_0x1b4319[_0xc3fd('0x44')]['id'],'id':_[_0xc3fd('0x2b')](_0x59e3d9,function(_0x5359d2){return _0x5359d2['id'];})},'transaction':_0x5754d1});}})[_0xc3fd('0x23')](function(_0x1557ed){var _0x4b0bd0=_['map'](_0x1b4319['body'],function(_0x1cebb2){_0x1cebb2['userProfileId']=_0x1b4319[_0xc3fd('0x44')]['id'];return _0x1cebb2;});return db[_0xc3fd('0x52')][_0xc3fd('0x68')](_0x4b0bd0,{'raw':!![],'transaction':_0x5754d1});})[_0xc3fd('0x23')](function(_0x39ec79){var _0x116342=_[_0xc3fd('0x3c')](_[_0xc3fd('0x2b')](_0x39ec79,function(_0x31e9a5){return _0x31e9a5[_0xc3fd('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x116342){return db['UserProfileSection'][_0xc3fd('0x42')]({'where':{'userProfileId':_0x1b4319[_0xc3fd('0x44')]['id'],'sectionId':_[_0xc3fd('0x2b')](_0x116342,function(_0x31d94a){return _0x31d94a[_0xc3fd('0x5d')];})},'attributes':['id',_0xc3fd('0x5d')],'raw':!![]})[_0xc3fd('0x23')](function(_0x318aa0){var _0xbdc0cc=_['map'](_0x1b4319['body'],function(_0x431f7d){_0x431f7d[_0xc3fd('0x56')]=_0x1b4319[_0xc3fd('0x44')]['id'];return _0x431f7d;});return db[_0xc3fd('0x55')][_0xc3fd('0x68')](_0xbdc0cc,{'raw':!![],'transaction':_0x5754d1});});}})[_0xc3fd('0x4a')](handleError(_0x3cad92,null));});}})['then'](function(_0x26214a){var _0x463777=_[_0xc3fd('0x2b')](_0x26214a,function(_0x418aa0){return _0x418aa0['get']({'plain':!![]});});})[_0xc3fd('0x23')](respondWithResult(_0x3cad92,null))[_0xc3fd('0x4a')](handleError(_0x3cad92,null));};exports[_0xc3fd('0x69')]=function(_0x349aa,_0x2ad562,_0x15341d){return db[_0xc3fd('0x2c')][_0xc3fd('0x47')]({'where':{'id':_0x349aa['params']['id']}})[_0xc3fd('0x23')](handleEntityNotFound(_0x2ad562,null))[_0xc3fd('0x23')](function(_0x1d1a00){if(_0x1d1a00){return _0x1d1a00[_0xc3fd('0x69')](_0x349aa['query'][_0xc3fd('0x6a')]);}})[_0xc3fd('0x23')](respondWithStatusCode(_0x2ad562,null))['catch'](handleError(_0x2ad562,null));};exports['getResources']=function(_0x2b9b59,_0x379f02){var _0xd42413={'raw':![],'where':{}};var _0x258801={};var _0x49b4ed={'count':0x0,'rows':[]};var _0x542a99=_0x2b9b59['query'][_0xc3fd('0x6b')];if(typeof _0x542a99===_0xc3fd('0x6c')){throw new db[(_0xc3fd('0x6d'))][(_0xc3fd('0x6e'))](_0xc3fd('0x6f'));}var _0x2f60ec=_0x2b9b59['query'][_0xc3fd('0x70')]||![];var _0x4ee138=getQueryModels(_0x542a99,_0x2f60ec);if(typeof _0x4ee138['childModel']===_0xc3fd('0x6c')){throw new db[(_0xc3fd('0x6d'))]['ValidationError'](_0xc3fd('0x71')+_0x542a99+'\x27');}var _0x418800=[];if(!_[_0xc3fd('0x5c')](_0x4ee138[_0xc3fd('0x72')])){_0x418800=_0x4ee138[_0xc3fd('0x72')];}else{_0x418800=[{'name':_0x542a99}];}return db[_0xc3fd('0x2c')][_0xc3fd('0x61')]({'where':{'id':_0x2b9b59['params']['id']}})[_0xc3fd('0x23')](handleEntityNotFound(_0x379f02,null))['then'](function(_0x133d8a){if(_0x133d8a){var _0x1f627e=[];for(var _0x5aa9bd=0x0;_0x5aa9bd<_0x418800[_0xc3fd('0x36')];_0x5aa9bd++){_0x1f627e['push'](db['UserProfileSection'][_0xc3fd('0x61')]({'where':{'userProfileId':_0x133d8a['id'],'name':_0x418800[_0x5aa9bd][_0xc3fd('0x28')]},'raw':!![]}));}return BPromise['all'](_0x1f627e);}})[_0xc3fd('0x23')](function(_0x34a09e){var _0x421148=_[_0xc3fd('0x3c')](_0x34a09e,function(_0x1a45a9){return _0x1a45a9?_0x1a45a9:undefined;});var _0x2dc196=_[_0xc3fd('0x3c')](_0x418800,[_0xc3fd('0x73'),!![]]);var _0x53caa1=_[_0xc3fd('0x5c')](_0x421148)&&_[_0xc3fd('0x5c')](_0x2dc196)?null:_['union'](_0x2dc196,_0x421148);if(_0x53caa1){var _0x52b60c=[];for(var _0x3df599=0x0;_0x3df599<_0x53caa1['length'];_0x3df599++){var _0x231e4c=_[_0xc3fd('0x47')](_0x418800,function(_0x3bb484){return _0x53caa1[_0x3df599]?_0x3bb484[_0xc3fd('0x28')]===_0x53caa1[_0x3df599][_0xc3fd('0x28')]:null;});if(_0x231e4c){if(_0x53caa1[_0x3df599]['ignore']){_0x52b60c['push'](getAllResources(_0x4ee138[_0xc3fd('0x74')],_0x53caa1[_0x3df599]));}else{if(!_0x53caa1[_0x3df599][_0xc3fd('0x54')]){_0x52b60c[_0xc3fd('0x63')](getAllowedResources(_0x231e4c,_0x53caa1[_0x3df599],_0x4ee138[_0xc3fd('0x74')]));}else{if(_0x231e4c[_0xc3fd('0x30')]){_0x52b60c[_0xc3fd('0x63')](getAllFilteredResources(_0x231e4c,_0x53caa1[_0x3df599]));}}}}}return BPromise[_0xc3fd('0x75')](_0x52b60c);}else{return null;}})[_0xc3fd('0x23')](function(_0x924f25){var _0x29cc70=_0x924f25;var _0x5eaaea=null;if(_0x29cc70){_0x5eaaea=_0x29cc70[_0xc3fd('0x36')]===0x1?_0x29cc70[0x0]:null;}if(_0x5eaaea||_0x29cc70){var _0x414ed2=db[_0x4ee138[_0xc3fd('0x74')]][_0xc3fd('0x2d')];_0x258801['model']=_['keys'](_0x414ed2);_0x258801['query']=_[_0xc3fd('0x32')](_0x2b9b59[_0xc3fd('0x31')]);_0x258801[_0xc3fd('0x33')]=_[_0xc3fd('0x34')](_0x258801[_0xc3fd('0x30')],_0x258801[_0xc3fd('0x31')]);_0xd42413['attributes']=_[_0xc3fd('0x34')](_0x258801[_0xc3fd('0x30')],qs['fields'](_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x45')]));_0xd42413[_0xc3fd('0x35')]=_0xd42413[_0xc3fd('0x35')][_0xc3fd('0x36')]?_0xd42413['attributes']:_0x258801[_0xc3fd('0x30')];if(!_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x37')]('nolimit')){_0xd42413[_0xc3fd('0x39')]=qs[_0xc3fd('0x39')](_0x2b9b59['query'][_0xc3fd('0x39')]);_0xd42413['offset']=qs['offset'](_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x20')]);}_0xd42413[_0xc3fd('0x76')]=qs['sort'](_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x3a')]);_0xd42413['where']=qs[_0xc3fd('0x33')](_['pick'](_0x2b9b59[_0xc3fd('0x31')],_0x258801[_0xc3fd('0x33')]));if(_0x2b9b59['query'][_0xc3fd('0x3c')]){_0xd42413['where']=_[_0xc3fd('0x3f')](_0xd42413[_0xc3fd('0x3d')],{'$or':_[_0xc3fd('0x2b')](_0x414ed2,function(_0x38499a){if(_0x38499a[_0xc3fd('0x2f')][_0xc3fd('0x77')]!==_0xc3fd('0x3e')){var _0x37916e={};_0x37916e[_0x38499a[_0xc3fd('0x78')]]={'$like':'%'+_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x3c')]+'%'};return _0x37916e;}})});}var _0xf4e8d4=[];if(_0x5eaaea){var _0x1ec8e4=_['find'](_0x418800,[_0xc3fd('0x28'),_0x5eaaea['name']]);if(_0x1ec8e4['field']){var _0x615c8b={};if(_0x4ee138['childModel']===_0xc3fd('0x79')){_0x615c8b[_0x1ec8e4[_0xc3fd('0x7a')]]=_['map'](_0x5eaaea['associatedResources'],'id');}else{_0x615c8b[_0x1ec8e4[_0xc3fd('0x7a')]]=_0x5eaaea[_0xc3fd('0x7b')];}_0xf4e8d4['push'](_0x615c8b);}else{_0xd42413[_0xc3fd('0x3d')]['id']=_0x5eaaea[_0xc3fd('0x7b')];}}else{for(var _0x2888ba=0x0;_0x2888ba<_0x29cc70[_0xc3fd('0x36')];_0x2888ba++){var _0x1ec8e4=_['find'](_0x418800,[_0xc3fd('0x28'),_0x29cc70[_0x2888ba]['name']]);if(_0x1ec8e4['field']){var _0x615c8b={};_0x615c8b[_0x1ec8e4['foreignKey']]=_0x29cc70[_0x2888ba][_0xc3fd('0x7b')];_0xf4e8d4[_0xc3fd('0x63')](_0x615c8b);}else{if(!_0xd42413[_0xc3fd('0x3d')]['id'])_0xd42413[_0xc3fd('0x3d')]['id']=[];_0x29cc70[_0x2888ba][_0xc3fd('0x7b')][_0xc3fd('0x62')](function(_0x62394d){_0xd42413[_0xc3fd('0x3d')]['id']['push'](_0x62394d);});}}}if(!_['isEmpty'](_0xf4e8d4)){_0xd42413[_0xc3fd('0x3d')]=_['merge'](_0xd42413[_0xc3fd('0x3d')],{'$and':{'$or':_0xf4e8d4}});}_0xd42413=_[_0xc3fd('0x3f')]({},_0xd42413,_0x2b9b59[_0xc3fd('0x40')]);if(_0x5eaaea&&!_0x5eaaea[_0xc3fd('0x54')]&&_0x4ee138[_0xc3fd('0x74')]===_0xc3fd('0x79')){if(_0x2b9b59['query'][_0xc3fd('0x41')]){_0xd42413[_0xc3fd('0x46')]=[{'all':!![]}];}return db[_0x4ee138[_0xc3fd('0x74')]][_0xc3fd('0x42')](_0xd42413)[_0xc3fd('0x23')](function(_0x1e0fa1){var _0x315677=[];_0x1e0fa1[_0xc3fd('0x62')](function(_0x3fef78){var _0x3ce6b3;switch(_0x3fef78[_0xc3fd('0x7c')]){case _0xc3fd('0x7d'):_0x3ce6b3=_[_0xc3fd('0x47')](_0x5eaaea[_0xc3fd('0x7b')],function(_0x8d6e2f){return _0x8d6e2f['id']===_0x3fef78['reportId']&&_0x8d6e2f[_0xc3fd('0x2f')]===_0xc3fd('0x7e');});break;case _0xc3fd('0x7f'):_0x3ce6b3=_['find'](_0x5eaaea['associatedResources'],function(_0x103668){return _0x103668['id']===_0x3fef78['reportId']&&_0x103668[_0xc3fd('0x2f')]===_0xc3fd('0x80');});break;}if(_0x3ce6b3)_0x315677['push'](_0x3fef78);});_0x49b4ed[_0xc3fd('0x1f')]=_0x315677[_0xc3fd('0x36')];_0x49b4ed[_0xc3fd('0x43')]=_0x315677;return _0x49b4ed;});}else{return db[_0x4ee138[_0xc3fd('0x74')]][_0xc3fd('0x1f')]({'where':_0xd42413[_0xc3fd('0x3d')]})['then'](function(_0x1a891e){_0x49b4ed[_0xc3fd('0x1f')]=_0x1a891e;if(_0x2b9b59['query']['includeAll']){if(_0x4ee138[_0xc3fd('0x74')]===_0xc3fd('0x81')){_0xd42413['include']=[{'model':db[_0xc3fd('0x82')],'as':_0xc3fd('0x83'),'attributes':['id',_0xc3fd('0x28'),'color'],'required':_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x84')]?!![]:![]},{'model':db[_0xc3fd('0x82')],'as':_0xc3fd('0x85'),'attributes':['id',_0xc3fd('0x28'),_0xc3fd('0x86')],'through':_0x2b9b59[_0xc3fd('0x31')]['tag']?{'attributes':[],'where':{'TagId':_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x84')]||undefined}}:{},'required':_0x2b9b59[_0xc3fd('0x31')][_0xc3fd('0x84')]?!![]:![]}];}else{_0xd42413['include']=[{'all':!![]}];}}return db[_0x4ee138[_0xc3fd('0x74')]][_0xc3fd('0x42')](_0xd42413);})['then'](function(_0x67c4fc){_0x49b4ed['rows']=_0x67c4fc;return _0x49b4ed;});}}else{return _0x49b4ed;}})[_0xc3fd('0x23')](respondWithFilteredResult(_0x379f02,_0xd42413))[_0xc3fd('0x4a')](handleError(_0x379f02,null));};function getAllResources(_0x1cc0ce,_0x26a5e9){return new BPromise(function(_0x5c8052,_0x249524){if(_0x26a5e9){var _0x326f2e=_0x26a5e9[_0xc3fd('0x3c')]?{[_0x26a5e9['filter'][_0xc3fd('0x78')]]:_0x26a5e9[_0xc3fd('0x3c')][_0xc3fd('0x87')]}:undefined;return db[_0x1cc0ce][_0xc3fd('0x42')]({'where':_0x326f2e,'raw':!![]})[_0xc3fd('0x23')](function(_0x1b8372){_0x26a5e9[_0xc3fd('0x7b')]=_[_0xc3fd('0x2b')](_0x1b8372,'id');_0x5c8052(_0x26a5e9);})[_0xc3fd('0x4a')](function(_0x268918){_0x249524(_0x268918);});}else{_0x5c8052(null);}});}function getAllFilteredResources(_0x25bdc7,_0x12737e){return new BPromise(function(_0x31f725,_0x3b57bb){var _0x489fa0=_0x25bdc7[_0xc3fd('0x3c')]?{[_0x25bdc7[_0xc3fd('0x3c')][_0xc3fd('0x78')]]:_0x25bdc7[_0xc3fd('0x3c')][_0xc3fd('0x87')]}:undefined;return db[_0x25bdc7[_0xc3fd('0x30')]][_0xc3fd('0x42')]({'where':_0x489fa0,'raw':!![]})[_0xc3fd('0x23')](function(_0x550d51){_0x12737e['associatedResources']=_[_0xc3fd('0x2b')](_0x550d51,function(_0x542560){return _0x542560[_0xc3fd('0x28')];});_0x31f725(_0x12737e);})[_0xc3fd('0x4a')](function(_0xb8df06){_0x3b57bb(_0xb8df06);});});}function getAllowedResources(_0x335ece,_0x2b1c68,_0x812ba3){return new BPromise(function(_0x5e9121,_0x1017fe){if(_0x2b1c68){return db[_0xc3fd('0x55')]['findAll']({'where':{'sectionId':_0x2b1c68['id']},'raw':!![]})[_0xc3fd('0x23')](function(_0x43a749){if(_0x335ece[_0xc3fd('0x78')]&&_0x335ece[_0xc3fd('0x78')]!=='id'){_0x2b1c68[_0xc3fd('0x7b')]=_['map'](_0x43a749,function(_0x54dd21){return _0x54dd21[_0x335ece['field']];});}else{if(_0x812ba3===_0xc3fd('0x79')){_0x2b1c68['associatedResources']=_[_0xc3fd('0x2b')](_0x43a749,function(_0x4bdac0){return{'id':_0x4bdac0[_0xc3fd('0x64')],'type':_0x4bdac0[_0xc3fd('0x2f')]};});}else{_0x2b1c68[_0xc3fd('0x7b')]=_[_0xc3fd('0x2b')](_0x43a749,function(_0x51df21){return _0x51df21[_0xc3fd('0x64')];});}}_0x5e9121(_0x2b1c68);})[_0xc3fd('0x4a')](function(_0x1da9df){_0x1017fe(_0x1da9df);});}else{_0x5e9121(null);}});}function getQueryModels(_0x331ada,_0x5443cf){var _0x65f8ba=_0x331ada[_0xc3fd('0x88')]();var _0x5f2489={'childModel':undefined,'parentSections':[]};switch(_0x65f8ba){case _0xc3fd('0x89'):_0x5f2489['childModel']=_0xc3fd('0x8a');break;case _0xc3fd('0x8b'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x8c');break;case'squarerecordings':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x8d');_0x5f2489[_0xc3fd('0x72')]=[{'name':_0xc3fd('0x8e'),'field':'name','foreignKey':_0xc3fd('0x8f')}];break;case _0xc3fd('0x90'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x91');break;case _0xc3fd('0x92'):_0x5f2489[_0xc3fd('0x74')]='CmContact';_0x5f2489[_0xc3fd('0x72')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xc3fd('0x93'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x94');break;case _0xc3fd('0x95'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x96');break;case'globalcustomfields':_0x5f2489['childModel']='CmCustomField';break;case _0xc3fd('0x97'):_0x5f2489['childModel']=_0xc3fd('0x98');break;case _0xc3fd('0x99'):_0x5f2489[_0xc3fd('0x74')]='ChatWebsite';break;case _0xc3fd('0x9a'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x9b');break;case _0xc3fd('0x9c'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x9d');break;case _0xc3fd('0x9e'):case'internalroutes':case _0xc3fd('0x9f'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xa0');break;case _0xc3fd('0xa1'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xa2');break;case _0xc3fd('0xa3'):_0x5f2489[_0xc3fd('0x74')]='VoiceMail';break;case _0xc3fd('0xa4'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xa5');_0x5f2489[_0xc3fd('0x72')]=[{'name':_0xc3fd('0xa6'),'field':_0xc3fd('0x28'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xc3fd('0xa7')]}},{'name':_0xc3fd('0xa8'),'field':_0xc3fd('0x28'),'foreignKey':_0xc3fd('0xa9'),'model':'User','filter':{'field':_0xc3fd('0xaa'),'value':[_0xc3fd('0xab')]}},{'name':_0xc3fd('0xac'),'field':_0xc3fd('0x28'),'foreignKey':'queue','model':_0xc3fd('0xad'),'filter':{'field':_0xc3fd('0x2f'),'value':[_0xc3fd('0xae')]}},{'name':'QueueCampaigns','field':_0xc3fd('0x28'),'foreignKey':'queue','model':_0xc3fd('0xad'),'filter':{'field':_0xc3fd('0x2f'),'value':['outbound']}}];break;case _0xc3fd('0xaf'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xb0');break;case _0xc3fd('0xb1'):_0x5f2489[_0xc3fd('0x74')]='VoiceChanSpy';break;case _0xc3fd('0xb2'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xb3');break;case _0xc3fd('0xb4'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xb5');break;case'mailqueues':_0x5f2489[_0xc3fd('0x74')]='MailQueue';break;case _0xc3fd('0xb6'):_0x5f2489['childModel']=_0xc3fd('0xb7');break;case _0xc3fd('0xb8'):_0x5f2489['childModel']=_0xc3fd('0xb9');break;case _0xc3fd('0xba'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xbb');break;case'openchannelaccounts':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xbc');break;case _0xc3fd('0xbd'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xbe');break;case'smsaccounts':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xbf');break;case'teams':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xc0');break;case _0xc3fd('0xc1'):case _0xc3fd('0xc2'):_0x5f2489[_0xc3fd('0x74')]='VoiceQueue';if(_0x5443cf){_0x5f2489[_0xc3fd('0x72')]=[{'name':_0xc3fd('0xac')},{'name':'QueueCampaigns'}];}break;case _0xc3fd('0xc3'):case _0xc3fd('0xc4'):case _0xc3fd('0xc5'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xc6');if(_0x5443cf){_0x5f2489['parentSections']=[{'name':'Users','filter':{'field':_0xc3fd('0xaa'),'value':[_0xc3fd('0xc7'),_0xc3fd('0xc8')]},'ignore':!![]},{'name':_0xc3fd('0xa6')},{'name':'Telephones'}];}break;case _0xc3fd('0xc9'):_0x5f2489['childModel']='ZendeskAccount';break;case _0xc3fd('0xca'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xcb');break;case'freshdeskaccounts':_0x5f2489[_0xc3fd('0x74')]='FreshdeskAccount';break;case _0xc3fd('0xcc'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xcd');break;case _0xc3fd('0xce'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xcf');break;case _0xc3fd('0xd0'):_0x5f2489[_0xc3fd('0x74')]='ZohoAccount';break;case _0xc3fd('0xd1'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xc6');break;case'cannedanswers':_0x5f2489['childModel']=_0xc3fd('0xd2');break;case _0xc3fd('0xd3'):_0x5f2489[_0xc3fd('0x74')]='Disposition';break;case _0xc3fd('0xd4'):_0x5f2489[_0xc3fd('0x74')]='Dashboard';break;case'intervals':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xd5');break;case'pauses':_0x5f2489[_0xc3fd('0x74')]='Pause';break;case _0xc3fd('0xd6'):_0x5f2489['childModel']=_0xc3fd('0xd7');break;case'sounds':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xd8');break;case _0xc3fd('0xd9'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x82');break;case _0xc3fd('0xda'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xdb');break;case _0xc3fd('0xdc'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xdd');break;case'trunks':_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0xde');break;case _0xc3fd('0xdf'):_0x5f2489[_0xc3fd('0x74')]='Variable';break;case _0xc3fd('0xe0'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x65');break;case _0xc3fd('0xe1'):_0x5f2489[_0xc3fd('0x74')]=_0xc3fd('0x79');_0x5f2489[_0xc3fd('0x72')]=[{'name':_0xc3fd('0xe2'),'field':'id','foreignKey':_0xc3fd('0xe3')}];break;case _0xc3fd('0xe4'):_0x5f2489['childModel']=_0xc3fd('0xe5');break;default:return _0x5f2489;}return _0x5f2489;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 755b8c7..f189388 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 _0x6bf1=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2c0bf4,_0x5384e6){var _0x29274e=function(_0xb927b2){while(--_0xb927b2){_0x2c0bf4['push'](_0x2c0bf4['shift']());}};_0x29274e(++_0x5384e6);}(_0x6bf1,0x1d6));var _0x16bf=function(_0x2f7e42,_0x4aa0cf){_0x2f7e42=_0x2f7e42-0x0;var _0x1ac0d3=_0x6bf1[_0x2f7e42];return _0x1ac0d3;};'use strict';var EventEmitter=require(_0x16bf('0x0'));var UserProfile=require(_0x16bf('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x16bf('0x2')](0x0);var events={'afterCreate':_0x16bf('0x3'),'afterUpdate':_0x16bf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55df0a){return function(_0x8ed40e,_0x245e9f,_0x1d9a0a){UserProfileEvents[_0x16bf('0x5')](_0x55df0a+':'+_0x8ed40e['id'],_0x8ed40e);UserProfileEvents[_0x16bf('0x5')](_0x55df0a,_0x8ed40e);_0x1d9a0a(null);};}for(var e in events){if(events[_0x16bf('0x6')](e)){var event=events[e];UserProfile[_0x16bf('0x7')](e,emitEvent(event));}}module[_0x16bf('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x7c40=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x580d0e,_0x1e5f43){var _0xb51111=function(_0x4718e7){while(--_0x4718e7){_0x580d0e['push'](_0x580d0e['shift']());}};_0xb51111(++_0x1e5f43);}(_0x7c40,0x98));var _0x07c4=function(_0x581452,_0x47c1dc){_0x581452=_0x581452-0x0;var _0x33a160=_0x7c40[_0x581452];return _0x33a160;};'use strict';var EventEmitter=require(_0x07c4('0x0'));var UserProfile=require(_0x07c4('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x07c4('0x2')](0x0);var events={'afterCreate':_0x07c4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x295c4d){return function(_0x18a9f4,_0x39e933,_0x4750e1){UserProfileEvents[_0x07c4('0x4')](_0x295c4d+':'+_0x18a9f4['id'],_0x18a9f4);UserProfileEvents['emit'](_0x295c4d,_0x18a9f4);_0x4750e1(null);};}for(var e in events){if(events[_0x07c4('0x5')](e)){var event=events[e];UserProfile[_0x07c4('0x6')](e,emitEvent(event));}}module[_0x07c4('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index c8222e3..4249823 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 _0xffcc=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash'];(function(_0x4763c7,_0x223637){var _0x5c3dfc=function(_0x47f19e){while(--_0x47f19e){_0x4763c7['push'](_0x4763c7['shift']());}};_0x5c3dfc(++_0x223637);}(_0xffcc,0x1d3));var _0xcffc=function(_0x514bfc,_0x279afb){_0x514bfc=_0x514bfc-0x0;var _0x264fc1=_0xffcc[_0x514bfc];return _0x264fc1;};'use strict';var _=require(_0xcffc('0x0'));var util=require(_0xcffc('0x1'));var logger=require(_0xcffc('0x2'))('api');var moment=require(_0xcffc('0x3'));var BPromise=require(_0xcffc('0x4'));var rp=require(_0xcffc('0x5'));var fs=require('fs');var path=require(_0xcffc('0x6'));var rimraf=require(_0xcffc('0x7'));var config=require('../../config/environment');var attributes=require(_0xcffc('0x8'));module[_0xcffc('0x9')]=function(_0x34e775,_0x31e303){return _0x34e775[_0xcffc('0xa')](_0xcffc('0xb'),attributes,{'tableName':_0xcffc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7b3=['./userProfile.attributes','UserProfile','user_profiles','lodash','util','moment','path','../../config/environment'];(function(_0x50fc12,_0x38a062){var _0x2d7f94=function(_0x19bd05){while(--_0x19bd05){_0x50fc12['push'](_0x50fc12['shift']());}};_0x2d7f94(++_0x38a062);}(_0xe7b3,0xbb));var _0x3e7b=function(_0x1ce07a,_0x2b6bef){_0x1ce07a=_0x1ce07a-0x0;var _0x1fc301=_0xe7b3[_0x1ce07a];return _0x1fc301;};'use strict';var _=require(_0x3e7b('0x0'));var util=require(_0x3e7b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3e7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e7b('0x3'));var rimraf=require('rimraf');var config=require(_0x3e7b('0x4'));var attributes=require(_0x3e7b('0x5'));module['exports']=function(_0x16636e,_0x2b2408){return _0x16636e['define'](_0x3e7b('0x6'),attributes,{'tableName':_0x3e7b('0x7'),'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 f8626fa..59f00d3 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 _0x687b=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register'];(function(_0x4f0164,_0x8c0882){var _0x46d889=function(_0xff042b){while(--_0xff042b){_0x4f0164['push'](_0x4f0164['shift']());}};_0x46d889(++_0x8c0882);}(_0x687b,0x14a));var _0xb687=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0x687b[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});config[_0xb687('0xc')]=_[_0xb687('0xd')](config['redis'],{'host':_0xb687('0xe'),'port':0x18eb});var socket=require(_0xb687('0xf'))(new Redis(config['redis']));require(_0xb687('0x10'))[_0xb687('0x11')](socket);function respondWithRpcPromise(_0x825ad,_0x15dc9a,_0x404fdb){return new BPromise(function(_0x309d84,_0x3e6271){return client[_0xb687('0x12')](_0x825ad,_0x404fdb)[_0xb687('0x13')](function(_0x5103b9){logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));logger[_0xb687('0x17')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x15dc9a,'request\x20sent',JSON[_0xb687('0x18')](_0x5103b9));if(_0x5103b9[_0xb687('0x19')]){if(_0x5103b9['error'][_0xb687('0x1a')]===0x1f4){logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x3e6271(_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);}logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x309d84(_0x5103b9[_0xb687('0x19')]['message']);}else{logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));_0x309d84(_0x5103b9['result']['message']);}})[_0xb687('0x1c')](function(_0x3a10ef){logger[_0xb687('0x19')]('UserProfile,\x20%s,\x20%s',_0x15dc9a,_0x3a10ef);_0x3e6271(_0x3a10ef);});});} \ No newline at end of file +var _0x2eb2=['../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1daf69,_0x590767){var _0x454322=function(_0x56fa75){while(--_0x56fa75){_0x1daf69['push'](_0x1daf69['shift']());}};_0x454322(++_0x590767);}(_0x2eb2,0x19f));var _0x22eb=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x2eb2[_0x173d7e];return _0x2220d6;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});config[_0x22eb('0xa')]=_[_0x22eb('0xb')](config[_0x22eb('0xa')],{'host':_0x22eb('0xc'),'port':0x18eb});var socket=require(_0x22eb('0xd'))(new Redis(config[_0x22eb('0xa')]));require(_0x22eb('0xe'))[_0x22eb('0xf')](socket);function respondWithRpcPromise(_0x3008e0,_0x489260,_0x46c197){return new BPromise(function(_0x54342e,_0x4ce9fb){return client[_0x22eb('0x10')](_0x3008e0,_0x46c197)['then'](function(_0x17b668){logger[_0x22eb('0x11')]('UserProfile,\x20%s,\x20%s',_0x489260,'request\x20sent');logger[_0x22eb('0x12')](_0x22eb('0x13'),_0x489260,_0x22eb('0x14'),JSON[_0x22eb('0x15')](_0x17b668));if(_0x17b668[_0x22eb('0x16')]){if(_0x17b668['error'][_0x22eb('0x17')]===0x1f4){logger['error'](_0x22eb('0x18'),_0x489260,_0x17b668['error'][_0x22eb('0x19')]);return _0x4ce9fb(_0x17b668[_0x22eb('0x16')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x489260,_0x17b668[_0x22eb('0x16')]['message']);return _0x54342e(_0x17b668['error'][_0x22eb('0x19')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x489260,_0x22eb('0x14'));_0x54342e(_0x17b668[_0x22eb('0x1a')][_0x22eb('0x19')]);}})[_0x22eb('0x1b')](function(_0x3b0940){logger['error'](_0x22eb('0x18'),_0x489260,_0x3b0940);_0x4ce9fb(_0x3b0940);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 46f3842..8f5021f 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 _0x9676=['save','remove','emit','removeListener','./userProfile.events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9676,0x10d));var _0x6967=function(_0xb73f90,_0x23d924){_0xb73f90=_0xb73f90-0x0;var _0x113dd2=_0x9676[_0xb73f90];return _0x113dd2;};'use strict';var UserProfileEvents=require(_0x6967('0x0'));var events=[_0x6967('0x1'),_0x6967('0x2'),'update'];function createListener(_0x93442b,_0x444abc){return function(_0x899ea4){_0x444abc[_0x6967('0x3')](_0x93442b,_0x899ea4);};}function removeListener(_0x3db426,_0x385190){return function(){UserProfileEvents[_0x6967('0x4')](_0x3db426,_0x385190);};}exports['register']=function(_0x2ad8df){for(var _0xbb295=0x0,_0x686b1e=events['length'];_0xbb295<_0x686b1e;_0xbb295++){var _0x31ecb7=events[_0xbb295];var _0x3a077e=createListener('userProfile:'+_0x31ecb7,_0x2ad8df);UserProfileEvents['on'](_0x31ecb7,_0x3a077e);}}; \ No newline at end of file +var _0x5c91=['emit','removeListener','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0x5c91,0xf4));var _0x15c9=function(_0x49e8a4,_0x1f803e){_0x49e8a4=_0x49e8a4-0x0;var _0xd4a270=_0x5c91[_0x49e8a4];return _0xd4a270;};'use strict';var UserProfileEvents=require(_0x15c9('0x0'));var events=[_0x15c9('0x1'),_0x15c9('0x2'),_0x15c9('0x3')];function createListener(_0x4e91e4,_0x391c95){return function(_0x9ab2a2){_0x391c95[_0x15c9('0x4')](_0x4e91e4,_0x9ab2a2);};}function removeListener(_0x5981ac,_0x30a1cb){return function(){UserProfileEvents[_0x15c9('0x5')](_0x5981ac,_0x30a1cb);};}exports['register']=function(_0x328e12){for(var _0x4589e8=0x0,_0x1824a0=events[_0x15c9('0x6')];_0x4589e8<_0x1824a0;_0x4589e8++){var _0x2a744b=events[_0x4589e8];var _0x13b32c=createListener(_0x15c9('0x7')+_0x2a744b,_0x328e12);UserProfileEvents['on'](_0x2a744b,_0x13b32c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index b8e3084..a47bb7e 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 _0x854d=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','put','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x57c673,_0x5418fd){var _0x5e0c0b=function(_0x57ea98){while(--_0x57ea98){_0x57c673['push'](_0x57c673['shift']());}};_0x5e0c0b(++_0x5418fd);}(_0x854d,0x13a));var _0xd854=function(_0x358427,_0x51b87f){_0x358427=_0x358427-0x0;var _0x28b7be=_0x854d[_0x358427];return _0x28b7be;};'use strict';var multer=require(_0xd854('0x0'));var util=require(_0xd854('0x1'));var path=require(_0xd854('0x2'));var timeout=require(_0xd854('0x3'));var express=require(_0xd854('0x4'));var router=express['Router']();var auth=require(_0xd854('0x5'));var interaction=require(_0xd854('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xd854('0x7')]('/',auth[_0xd854('0x8')](),controller[_0xd854('0x9')]);router[_0xd854('0x7')](_0xd854('0xa'),auth['isAuthenticated'](),controller[_0xd854('0xb')]);router[_0xd854('0x7')](_0xd854('0xc'),auth['isAuthenticated'](),controller[_0xd854('0xd')]);router['post']('/',auth[_0xd854('0x8')](),controller['create']);router[_0xd854('0xe')](_0xd854('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd854('0x8')](),controller['destroy']);module[_0xd854('0xf')]=router; \ No newline at end of file +var _0x83f6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','path'];(function(_0xbb6fb5,_0x4db9fb){var _0x2f9501=function(_0x4a9b92){while(--_0x4a9b92){_0xbb6fb5['push'](_0xbb6fb5['shift']());}};_0x2f9501(++_0x4db9fb);}(_0x83f6,0x1dd));var _0x683f=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x83f6[_0x3f5dca];return _0x5b833a;};'use strict';var multer=require(_0x683f('0x0'));var util=require(_0x683f('0x1'));var path=require(_0x683f('0x2'));var timeout=require('connect-timeout');var express=require(_0x683f('0x3'));var router=express[_0x683f('0x4')]();var auth=require(_0x683f('0x5'));var interaction=require(_0x683f('0x6'));var config=require(_0x683f('0x7'));var controller=require('./userProfileResource.controller');router[_0x683f('0x8')]('/',auth[_0x683f('0x9')](),controller[_0x683f('0xa')]);router['get'](_0x683f('0xb'),auth['isAuthenticated'](),controller[_0x683f('0xc')]);router[_0x683f('0x8')](_0x683f('0xd'),auth[_0x683f('0x9')](),controller[_0x683f('0xe')]);router['post']('/',auth[_0x683f('0x9')](),controller[_0x683f('0xf')]);router[_0x683f('0x10')](_0x683f('0xd'),auth[_0x683f('0x9')](),controller[_0x683f('0x11')]);router[_0x683f('0x12')](_0x683f('0xd'),auth['isAuthenticated'](),controller[_0x683f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index aeeab14..954acc2 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 _0xfbee=['INTEGER','sequelize','STRING'];(function(_0x4ef11e,_0x5d866c){var _0x16f7b0=function(_0x49dcba){while(--_0x49dcba){_0x4ef11e['push'](_0x4ef11e['shift']());}};_0x16f7b0(++_0x5d866c);}(_0xfbee,0x106));var _0xefbe=function(_0xa70985,_0x228c29){_0xa70985=_0xa70985-0x0;var _0x5e240f=_0xfbee[_0xa70985];return _0x5e240f;};'use strict';var Sequelize=require(_0xefbe('0x0'));module['exports']={'name':{'type':Sequelize[_0xefbe('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xefbe('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x53de=['exports','STRING','sequelize'];(function(_0x3c6520,_0x3df642){var _0x207567=function(_0x270a66){while(--_0x270a66){_0x3c6520['push'](_0x3c6520['shift']());}};_0x207567(++_0x3df642);}(_0x53de,0x7d));var _0xe53d=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x53de[_0x2e0ffa];return _0x24d627;};'use strict';var Sequelize=require(_0xe53d('0x0'));module[_0xe53d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xe53d('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index aeaf7ee..f631914 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 _0x69c8=['../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x25f4cf,_0x43ae8b){var _0x46559c=function(_0x4dbad2){while(--_0x4dbad2){_0x25f4cf['push'](_0x25f4cf['shift']());}};_0x46559c(++_0x43ae8b);}(_0x69c8,0x1a7));var _0x869c=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x69c8[_0x13ff53];return _0x290228;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x869c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x869c('0x1'));var rp=require(_0x869c('0x2'));var moment=require(_0x869c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x869c('0x4'));var util=require(_0x869c('0x5'));var path=require(_0x869c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x869c('0x7'));var fs=require('fs');var _=require(_0x869c('0x8'));var squel=require(_0x869c('0x9'));var crypto=require(_0x869c('0xa'));var jsforce=require(_0x869c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x869c('0xc'));var querystring=require('querystring');var Papa=require(_0x869c('0xd'));var Redis=require(_0x869c('0xe'));var authService=require(_0x869c('0xf'));var qs=require(_0x869c('0x10'));var as=require(_0x869c('0x11'));var hardwareService=require(_0x869c('0x12'));var logger=require(_0x869c('0x13'))(_0x869c('0x14'));var utils=require(_0x869c('0x15'));var config=require('../../config/environment');var db=require(_0x869c('0x16'))['db'];function respondWithStatusCode(_0x235ac1,_0x213a37){_0x213a37=_0x213a37||0xcc;return function(_0x976604){if(_0x976604){return _0x235ac1[_0x869c('0x17')](_0x213a37);}return _0x235ac1[_0x869c('0x18')](_0x213a37)[_0x869c('0x19')]();};}function respondWithResult(_0x3a27b8,_0x1c11a4){_0x1c11a4=_0x1c11a4||0xc8;return function(_0x2e81b7){if(_0x2e81b7){return _0x3a27b8[_0x869c('0x18')](_0x1c11a4)[_0x869c('0x1a')](_0x2e81b7);}};}function respondWithFilteredResult(_0x363907,_0x58c9cd){return function(_0x3f1629){if(_0x3f1629){var _0x78b655=_0x3f1629[_0x869c('0x1b')],_0x20e4df=_0x58c9cd[_0x869c('0x1c')],_0x5e38ca=_0x58c9cd['offset']+_0x58c9cd[_0x869c('0x1d')],_0x3575b6;if(_0x5e38ca>=_0x78b655){_0x5e38ca=_0x78b655;_0x3575b6=0xc8;}else{_0x3575b6=0xce;}_0x363907['status'](_0x3575b6);return _0x363907[_0x869c('0x1e')](_0x869c('0x1f'),_0x20e4df+'-'+_0x5e38ca+'/'+_0x78b655)[_0x869c('0x1a')](_0x3f1629);}return null;};}function patchUpdates(_0x34a050){return function(_0x2ba15d){try{jsonpatch[_0x869c('0x20')](_0x2ba15d,_0x34a050,!![]);}catch(_0x4a5c98){return BPromise[_0x869c('0x21')](_0x4a5c98);}return _0x2ba15d[_0x869c('0x22')]();};}function saveUpdates(_0x4071b9,_0x191680){return function(_0x3cc460){if(_0x3cc460){return _0x3cc460[_0x869c('0x23')](_0x4071b9)[_0x869c('0x24')](function(_0x59886f){return _0x59886f;});}return null;};}function removeEntity(_0x218ec3,_0x1b7a2e){return function(_0x3a3def){if(_0x3a3def){return _0x3a3def[_0x869c('0x25')]()[_0x869c('0x24')](function(){_0x218ec3[_0x869c('0x18')](0xcc)[_0x869c('0x19')]();});}};}function handleEntityNotFound(_0x1bd66c,_0x551455){return function(_0xb5252a){if(!_0xb5252a){_0x1bd66c[_0x869c('0x17')](0x194);}return _0xb5252a;};}function handleError(_0x520199,_0x3ed936){_0x3ed936=_0x3ed936||0x1f4;return function(_0x250668){logger[_0x869c('0x26')](_0x250668[_0x869c('0x27')]);if(_0x250668[_0x869c('0x28')]){delete _0x250668['name'];}_0x520199[_0x869c('0x18')](_0x3ed936)[_0x869c('0x29')](_0x250668);};}exports[_0x869c('0x2a')]=function(_0x1a2f46,_0x37297b){var _0x115179={},_0x4b8a11={},_0x52b113={'count':0x0,'rows':[]};var _0x24ec7e=_[_0x869c('0x2b')](db[_0x869c('0x2c')][_0x869c('0x2d')],function(_0x1bcb1e){return{'name':_0x1bcb1e['fieldName'],'type':_0x1bcb1e['type']['key']};});_0x4b8a11[_0x869c('0x2e')]=_[_0x869c('0x2b')](_0x24ec7e,_0x869c('0x28'));_0x4b8a11['query']=_[_0x869c('0x2f')](_0x1a2f46[_0x869c('0x30')]);_0x4b8a11[_0x869c('0x31')]=_[_0x869c('0x32')](_0x4b8a11[_0x869c('0x2e')],_0x4b8a11['query']);_0x115179['attributes']=_[_0x869c('0x32')](_0x4b8a11[_0x869c('0x2e')],qs[_0x869c('0x33')](_0x1a2f46[_0x869c('0x30')][_0x869c('0x33')]));_0x115179[_0x869c('0x34')]=_0x115179['attributes'][_0x869c('0x35')]?_0x115179[_0x869c('0x34')]:_0x4b8a11[_0x869c('0x2e')];if(!_0x1a2f46[_0x869c('0x30')][_0x869c('0x36')](_0x869c('0x37'))){_0x115179[_0x869c('0x1d')]=qs[_0x869c('0x1d')](_0x1a2f46['query']['limit']);_0x115179['offset']=qs[_0x869c('0x1c')](_0x1a2f46[_0x869c('0x30')]['offset']);}_0x115179[_0x869c('0x38')]=qs[_0x869c('0x39')](_0x1a2f46[_0x869c('0x30')]['sort']);_0x115179[_0x869c('0x3a')]=qs['filters'](_['pick'](_0x1a2f46[_0x869c('0x30')],_0x4b8a11[_0x869c('0x31')]));if(_0x1a2f46[_0x869c('0x30')][_0x869c('0x3b')]){_0x115179[_0x869c('0x3a')]=_[_0x869c('0x3c')](_0x115179['where'],{'$or':_['map'](_0x24ec7e,function(_0x5dce5a){if(_0x5dce5a[_0x869c('0x3d')]!=='VIRTUAL'){var _0x4022c1={};_0x4022c1[_0x5dce5a[_0x869c('0x28')]]={'$like':'%'+_0x1a2f46[_0x869c('0x30')][_0x869c('0x3b')]+'%'};return _0x4022c1;}})});}_0x115179=_[_0x869c('0x3c')]({},_0x115179,_0x1a2f46['options']);var _0x30a9b2={'where':_0x115179['where']};return db[_0x869c('0x2c')][_0x869c('0x1b')](_0x30a9b2)['then'](function(_0xba1fc1){_0x52b113[_0x869c('0x1b')]=_0xba1fc1;if(_0x1a2f46[_0x869c('0x30')][_0x869c('0x3e')]){_0x115179[_0x869c('0x3f')]=[{'all':!![]}];}return db[_0x869c('0x2c')][_0x869c('0x40')](_0x115179);})[_0x869c('0x24')](function(_0xf9ce9a){_0x52b113[_0x869c('0x41')]=_0xf9ce9a;return _0x52b113;})['then'](respondWithFilteredResult(_0x37297b,_0x115179))['catch'](handleError(_0x37297b,null));};exports[_0x869c('0x42')]=function(_0x1d9a48,_0x2f43d3){var _0x1837b9={'raw':![],'where':{'id':_0x1d9a48[_0x869c('0x43')]['id']}},_0x5153ea={};_0x5153ea[_0x869c('0x2e')]=_[_0x869c('0x2f')](db['UserProfileResource']['rawAttributes']);_0x5153ea[_0x869c('0x30')]=_[_0x869c('0x2f')](_0x1d9a48[_0x869c('0x30')]);_0x5153ea['filters']=_[_0x869c('0x32')](_0x5153ea[_0x869c('0x2e')],_0x5153ea[_0x869c('0x30')]);_0x1837b9[_0x869c('0x34')]=_['intersection'](_0x5153ea[_0x869c('0x2e')],qs['fields'](_0x1d9a48[_0x869c('0x30')]['fields']));_0x1837b9['attributes']=_0x1837b9[_0x869c('0x34')][_0x869c('0x35')]?_0x1837b9[_0x869c('0x34')]:_0x5153ea[_0x869c('0x2e')];if(_0x1d9a48[_0x869c('0x30')][_0x869c('0x3e')]){_0x1837b9[_0x869c('0x3f')]=[{'all':!![]}];}_0x1837b9=_[_0x869c('0x3c')]({},_0x1837b9,_0x1d9a48[_0x869c('0x44')]);return db['UserProfileResource'][_0x869c('0x45')](_0x1837b9)[_0x869c('0x24')](handleEntityNotFound(_0x2f43d3,null))['then'](respondWithResult(_0x2f43d3,null))['catch'](handleError(_0x2f43d3,null));};exports[_0x869c('0x46')]=function(_0x519210,_0x4721ae){return db[_0x869c('0x2c')]['create'](_0x519210[_0x869c('0x47')],{})[_0x869c('0x24')](respondWithResult(_0x4721ae,0xc9))[_0x869c('0x48')](handleError(_0x4721ae,null));};exports[_0x869c('0x23')]=function(_0x3eac04,_0x2f1f1a){if(_0x3eac04[_0x869c('0x47')]['id']){delete _0x3eac04[_0x869c('0x47')]['id'];}return db[_0x869c('0x2c')][_0x869c('0x45')]({'where':{'id':_0x3eac04['params']['id']}})[_0x869c('0x24')](handleEntityNotFound(_0x2f1f1a,null))[_0x869c('0x24')](saveUpdates(_0x3eac04[_0x869c('0x47')],null))['then'](respondWithResult(_0x2f1f1a,null))[_0x869c('0x48')](handleError(_0x2f1f1a,null));};exports[_0x869c('0x25')]=function(_0x416ea3,_0xfdcc20){return db[_0x869c('0x2c')]['find']({'where':{'id':_0x416ea3[_0x869c('0x43')]['id']}})[_0x869c('0x24')](handleEntityNotFound(_0xfdcc20,null))[_0x869c('0x24')](removeEntity(_0xfdcc20,null))[_0x869c('0x48')](handleError(_0xfdcc20,null));};exports[_0x869c('0x49')]=function(_0x342773,_0x34902e){return db[_0x869c('0x2c')]['describe']()['then'](respondWithResult(_0x34902e,null))[_0x869c('0x48')](handleError(_0x34902e,null));}; \ No newline at end of file +var _0x3bf8=['sort','where','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','then','end','error','name','send','map','UserProfileResource','fieldName','key','model','query','attributes','intersection','fields','length','nolimit','order'];(function(_0x40c277,_0x9513e0){var _0x4742c3=function(_0x487154){while(--_0x487154){_0x40c277['push'](_0x40c277['shift']());}};_0x4742c3(++_0x9513e0);}(_0x3bf8,0xe7));var _0x83bf=function(_0x13deba,_0x4fca65){_0x13deba=_0x13deba-0x0;var _0x219bd2=_0x3bf8[_0x13deba];return _0x219bd2;};'use strict';var pdf=require(_0x83bf('0x0'));var emlformat=require(_0x83bf('0x1'));var rimraf=require(_0x83bf('0x2'));var zipdir=require(_0x83bf('0x3'));var jsonpatch=require(_0x83bf('0x4'));var rp=require(_0x83bf('0x5'));var moment=require(_0x83bf('0x6'));var BPromise=require(_0x83bf('0x7'));var Mustache=require('mustache');var util=require(_0x83bf('0x8'));var path=require(_0x83bf('0x9'));var sox=require(_0x83bf('0xa'));var csv=require(_0x83bf('0xb'));var ejs=require(_0x83bf('0xc'));var fs=require('fs');var _=require(_0x83bf('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x83bf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x83bf('0xb'));var querystring=require(_0x83bf('0xf'));var Papa=require(_0x83bf('0x10'));var Redis=require('ioredis');var authService=require(_0x83bf('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83bf('0x12'));var logger=require(_0x83bf('0x13'))(_0x83bf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x83bf('0x15'))['db'];function respondWithStatusCode(_0x59c79e,_0xb19efa){_0xb19efa=_0xb19efa||0xcc;return function(_0x44f2f3){if(_0x44f2f3){return _0x59c79e[_0x83bf('0x16')](_0xb19efa);}return _0x59c79e[_0x83bf('0x17')](_0xb19efa)['end']();};}function respondWithResult(_0x2ba012,_0x27477c){_0x27477c=_0x27477c||0xc8;return function(_0x2838cd){if(_0x2838cd){return _0x2ba012[_0x83bf('0x17')](_0x27477c)[_0x83bf('0x18')](_0x2838cd);}};}function respondWithFilteredResult(_0x4eb9df,_0x1d9c1a){return function(_0x50523a){if(_0x50523a){var _0x268e2c=_0x50523a[_0x83bf('0x19')],_0x29a1a8=_0x1d9c1a[_0x83bf('0x1a')],_0xf77240=_0x1d9c1a['offset']+_0x1d9c1a[_0x83bf('0x1b')],_0x454484;if(_0xf77240>=_0x268e2c){_0xf77240=_0x268e2c;_0x454484=0xc8;}else{_0x454484=0xce;}_0x4eb9df['status'](_0x454484);return _0x4eb9df[_0x83bf('0x1c')](_0x83bf('0x1d'),_0x29a1a8+'-'+_0xf77240+'/'+_0x268e2c)['json'](_0x50523a);}return null;};}function patchUpdates(_0x14d70c){return function(_0x16b279){try{jsonpatch['apply'](_0x16b279,_0x14d70c,!![]);}catch(_0x178cfd){return BPromise['reject'](_0x178cfd);}return _0x16b279[_0x83bf('0x1e')]();};}function saveUpdates(_0x121b8f,_0x54a1a5){return function(_0x5048fb){if(_0x5048fb){return _0x5048fb[_0x83bf('0x1f')](_0x121b8f)[_0x83bf('0x20')](function(_0x17ea6f){return _0x17ea6f;});}return null;};}function removeEntity(_0x1fccd5,_0x38eefb){return function(_0x138ca4){if(_0x138ca4){return _0x138ca4['destroy']()[_0x83bf('0x20')](function(){_0x1fccd5[_0x83bf('0x17')](0xcc)[_0x83bf('0x21')]();});}};}function handleEntityNotFound(_0xb2c38b,_0xaaee2){return function(_0x3fecd0){if(!_0x3fecd0){_0xb2c38b[_0x83bf('0x16')](0x194);}return _0x3fecd0;};}function handleError(_0x423499,_0x59d8f4){_0x59d8f4=_0x59d8f4||0x1f4;return function(_0x412940){logger[_0x83bf('0x22')](_0x412940['stack']);if(_0x412940[_0x83bf('0x23')]){delete _0x412940[_0x83bf('0x23')];}_0x423499['status'](_0x59d8f4)[_0x83bf('0x24')](_0x412940);};}exports['index']=function(_0x5d7553,_0x4d3725){var _0x175d50={},_0x3b6240={},_0x1b1093={'count':0x0,'rows':[]};var _0x1f2fe7=_[_0x83bf('0x25')](db[_0x83bf('0x26')]['rawAttributes'],function(_0x2fa5b7){return{'name':_0x2fa5b7[_0x83bf('0x27')],'type':_0x2fa5b7['type'][_0x83bf('0x28')]};});_0x3b6240[_0x83bf('0x29')]=_[_0x83bf('0x25')](_0x1f2fe7,_0x83bf('0x23'));_0x3b6240['query']=_['keys'](_0x5d7553[_0x83bf('0x2a')]);_0x3b6240['filters']=_['intersection'](_0x3b6240[_0x83bf('0x29')],_0x3b6240['query']);_0x175d50[_0x83bf('0x2b')]=_[_0x83bf('0x2c')](_0x3b6240[_0x83bf('0x29')],qs[_0x83bf('0x2d')](_0x5d7553[_0x83bf('0x2a')]['fields']));_0x175d50['attributes']=_0x175d50[_0x83bf('0x2b')][_0x83bf('0x2e')]?_0x175d50[_0x83bf('0x2b')]:_0x3b6240[_0x83bf('0x29')];if(!_0x5d7553[_0x83bf('0x2a')]['hasOwnProperty'](_0x83bf('0x2f'))){_0x175d50[_0x83bf('0x1b')]=qs['limit'](_0x5d7553[_0x83bf('0x2a')]['limit']);_0x175d50[_0x83bf('0x1a')]=qs[_0x83bf('0x1a')](_0x5d7553[_0x83bf('0x2a')][_0x83bf('0x1a')]);}_0x175d50[_0x83bf('0x30')]=qs[_0x83bf('0x31')](_0x5d7553[_0x83bf('0x2a')][_0x83bf('0x31')]);_0x175d50[_0x83bf('0x32')]=qs[_0x83bf('0x33')](_['pick'](_0x5d7553['query'],_0x3b6240[_0x83bf('0x33')]));if(_0x5d7553[_0x83bf('0x2a')][_0x83bf('0x34')]){_0x175d50[_0x83bf('0x32')]=_[_0x83bf('0x35')](_0x175d50['where'],{'$or':_[_0x83bf('0x25')](_0x1f2fe7,function(_0x41266b){if(_0x41266b[_0x83bf('0x36')]!=='VIRTUAL'){var _0x37924d={};_0x37924d[_0x41266b[_0x83bf('0x23')]]={'$like':'%'+_0x5d7553[_0x83bf('0x2a')][_0x83bf('0x34')]+'%'};return _0x37924d;}})});}_0x175d50=_[_0x83bf('0x35')]({},_0x175d50,_0x5d7553[_0x83bf('0x37')]);var _0x2c1507={'where':_0x175d50[_0x83bf('0x32')]};return db[_0x83bf('0x26')][_0x83bf('0x19')](_0x2c1507)[_0x83bf('0x20')](function(_0x5ab882){_0x1b1093[_0x83bf('0x19')]=_0x5ab882;if(_0x5d7553[_0x83bf('0x2a')][_0x83bf('0x38')]){_0x175d50[_0x83bf('0x39')]=[{'all':!![]}];}return db[_0x83bf('0x26')][_0x83bf('0x3a')](_0x175d50);})[_0x83bf('0x20')](function(_0x1eb7dd){_0x1b1093[_0x83bf('0x3b')]=_0x1eb7dd;return _0x1b1093;})['then'](respondWithFilteredResult(_0x4d3725,_0x175d50))[_0x83bf('0x3c')](handleError(_0x4d3725,null));};exports[_0x83bf('0x3d')]=function(_0x5049c8,_0x59767d){var _0x205ed9={'raw':![],'where':{'id':_0x5049c8[_0x83bf('0x3e')]['id']}},_0x58501c={};_0x58501c['model']=_[_0x83bf('0x3f')](db[_0x83bf('0x26')][_0x83bf('0x40')]);_0x58501c['query']=_[_0x83bf('0x3f')](_0x5049c8[_0x83bf('0x2a')]);_0x58501c[_0x83bf('0x33')]=_['intersection'](_0x58501c[_0x83bf('0x29')],_0x58501c['query']);_0x205ed9[_0x83bf('0x2b')]=_[_0x83bf('0x2c')](_0x58501c[_0x83bf('0x29')],qs[_0x83bf('0x2d')](_0x5049c8[_0x83bf('0x2a')][_0x83bf('0x2d')]));_0x205ed9[_0x83bf('0x2b')]=_0x205ed9[_0x83bf('0x2b')][_0x83bf('0x2e')]?_0x205ed9['attributes']:_0x58501c[_0x83bf('0x29')];if(_0x5049c8[_0x83bf('0x2a')][_0x83bf('0x38')]){_0x205ed9['include']=[{'all':!![]}];}_0x205ed9=_[_0x83bf('0x35')]({},_0x205ed9,_0x5049c8[_0x83bf('0x37')]);return db[_0x83bf('0x26')]['find'](_0x205ed9)[_0x83bf('0x20')](handleEntityNotFound(_0x59767d,null))['then'](respondWithResult(_0x59767d,null))[_0x83bf('0x3c')](handleError(_0x59767d,null));};exports['create']=function(_0x460686,_0x2c0167){return db[_0x83bf('0x26')][_0x83bf('0x41')](_0x460686[_0x83bf('0x42')],{})['then'](respondWithResult(_0x2c0167,0xc9))[_0x83bf('0x3c')](handleError(_0x2c0167,null));};exports[_0x83bf('0x1f')]=function(_0x3c5b68,_0x3ef429){if(_0x3c5b68['body']['id']){delete _0x3c5b68[_0x83bf('0x42')]['id'];}return db[_0x83bf('0x26')][_0x83bf('0x43')]({'where':{'id':_0x3c5b68[_0x83bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ef429,null))[_0x83bf('0x20')](saveUpdates(_0x3c5b68[_0x83bf('0x42')],null))[_0x83bf('0x20')](respondWithResult(_0x3ef429,null))['catch'](handleError(_0x3ef429,null));};exports[_0x83bf('0x44')]=function(_0x1efcc3,_0x391b2d){return db['UserProfileResource']['find']({'where':{'id':_0x1efcc3[_0x83bf('0x3e')]['id']}})[_0x83bf('0x20')](handleEntityNotFound(_0x391b2d,null))['then'](removeEntity(_0x391b2d,null))[_0x83bf('0x3c')](handleError(_0x391b2d,null));};exports['describe']=function(_0x2a29f6,_0xb3a4a7){return db['UserProfileResource'][_0x83bf('0x45')]()['then'](respondWithResult(_0xb3a4a7,null))[_0x83bf('0x3c')](handleError(_0xb3a4a7,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index b332fd0..a9f3969 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 _0x0210=['./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x46c1d5,_0x5ca335){var _0x40fe7b=function(_0x34cb99){while(--_0x34cb99){_0x46c1d5['push'](_0x46c1d5['shift']());}};_0x40fe7b(++_0x5ca335);}(_0x0210,0x158));var _0x0021=function(_0x223399,_0x5082e2){_0x223399=_0x223399-0x0;var _0x49fa24=_0x0210[_0x223399];return _0x49fa24;};'use strict';var _=require(_0x0021('0x0'));var util=require(_0x0021('0x1'));var logger=require(_0x0021('0x2'))(_0x0021('0x3'));var moment=require('moment');var BPromise=require(_0x0021('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0021('0x5'));var config=require(_0x0021('0x6'));var attributes=require(_0x0021('0x7'));module['exports']=function(_0x599e6c,_0x311353){return _0x599e6c[_0x0021('0x8')](_0x0021('0x9'),attributes,{'tableName':_0x0021('0xa'),'paranoid':![],'indexes':[{'name':_0x0021('0xb'),'fields':['resourceId',_0x0021('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8083=['../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x8083,0xea));var _0x3808=function(_0xe2ebaa,_0x138483){_0xe2ebaa=_0xe2ebaa-0x0;var _0x563838=_0x8083[_0xe2ebaa];return _0x563838;};'use strict';var _=require(_0x3808('0x0'));var util=require('util');var logger=require(_0x3808('0x1'))(_0x3808('0x2'));var moment=require(_0x3808('0x3'));var BPromise=require(_0x3808('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3808('0x5'));var config=require(_0x3808('0x6'));var attributes=require(_0x3808('0x7'));module[_0x3808('0x8')]=function(_0x2914c1,_0x1d1c8f){return _0x2914c1[_0x3808('0x9')](_0x3808('0xa'),attributes,{'tableName':_0x3808('0xb'),'paranoid':![],'indexes':[{'name':_0x3808('0xc'),'fields':[_0x3808('0xd'),_0x3808('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 17d7d8f..9dd6e21 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 _0xad80=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0xad80,0x106));var _0x0ad8=function(_0x4b59fd,_0x15969a){_0x4b59fd=_0x4b59fd-0x0;var _0x3d2b10=_0xad80[_0x4b59fd];return _0x3d2b10;};'use strict';var _=require(_0x0ad8('0x0'));var util=require(_0x0ad8('0x1'));var moment=require(_0x0ad8('0x2'));var BPromise=require(_0x0ad8('0x3'));var rs=require(_0x0ad8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ad8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ad8('0x6'))(_0x0ad8('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ad8('0x8'));var client=jayson[_0x0ad8('0x9')][_0x0ad8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42c1c0,_0x13b12d,_0x82040b){return new BPromise(function(_0x2d7e36,_0x3017de){return client[_0x0ad8('0xb')](_0x42c1c0,_0x82040b)[_0x0ad8('0xc')](function(_0x164981){logger['info'](_0x0ad8('0xd'),_0x13b12d,_0x0ad8('0xe'));logger[_0x0ad8('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x13b12d,_0x0ad8('0xe'),JSON[_0x0ad8('0x10')](_0x164981));if(_0x164981[_0x0ad8('0x11')]){if(_0x164981[_0x0ad8('0x11')]['code']===0x1f4){logger[_0x0ad8('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x13b12d,_0x164981[_0x0ad8('0x11')][_0x0ad8('0x12')]);return _0x3017de(_0x164981[_0x0ad8('0x11')]['message']);}logger[_0x0ad8('0x11')](_0x0ad8('0xd'),_0x13b12d,_0x164981[_0x0ad8('0x11')]['message']);return _0x2d7e36(_0x164981[_0x0ad8('0x11')][_0x0ad8('0x12')]);}else{logger[_0x0ad8('0x13')](_0x0ad8('0xd'),_0x13b12d,_0x0ad8('0xe'));_0x2d7e36(_0x164981[_0x0ad8('0x14')][_0x0ad8('0x12')]);}})[_0x0ad8('0x15')](function(_0xcc22e6){logger[_0x0ad8('0x11')](_0x0ad8('0xd'),_0x13b12d,_0xcc22e6);_0x3017de(_0xcc22e6);});});} \ No newline at end of file +var _0x2deb=['error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','client','request','then','request\x20sent','stringify'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x2deb,0x138));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require('util');var moment=require(_0xb2de('0x1'));var BPromise=require(_0xb2de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2de('0x3'));var logger=require(_0xb2de('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb2de('0x5'));var client=jayson[_0xb2de('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54477e,_0x20a352,_0x193b40){return new BPromise(function(_0x316e0d,_0x443dc5){return client[_0xb2de('0x7')](_0x54477e,_0x193b40)[_0xb2de('0x8')](function(_0xa70563){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x20a352,_0xb2de('0x9'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x20a352,_0xb2de('0x9'),JSON[_0xb2de('0xa')](_0xa70563));if(_0xa70563[_0xb2de('0xb')]){if(_0xa70563[_0xb2de('0xb')][_0xb2de('0xc')]===0x1f4){logger[_0xb2de('0xb')](_0xb2de('0xd'),_0x20a352,_0xa70563[_0xb2de('0xb')][_0xb2de('0xe')]);return _0x443dc5(_0xa70563['error'][_0xb2de('0xe')]);}logger[_0xb2de('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x20a352,_0xa70563[_0xb2de('0xb')]['message']);return _0x316e0d(_0xa70563[_0xb2de('0xb')]['message']);}else{logger['info'](_0xb2de('0xd'),_0x20a352,_0xb2de('0x9'));_0x316e0d(_0xa70563[_0xb2de('0xf')][_0xb2de('0xe')]);}})[_0xb2de('0x10')](function(_0x33e7d2){logger[_0xb2de('0xb')](_0xb2de('0xd'),_0x20a352,_0x33e7d2);_0x443dc5(_0x33e7d2);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index cab7671..f448a42 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 _0xa3d4=['delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa3d4[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x4a3d('0x0'));var path=require(_0x4a3d('0x1'));var timeout=require(_0x4a3d('0x2'));var express=require('express');var router=express[_0x4a3d('0x3')]();var auth=require(_0x4a3d('0x4'));var interaction=require(_0x4a3d('0x5'));var config=require(_0x4a3d('0x6'));var controller=require(_0x4a3d('0x7'));router[_0x4a3d('0x8')]('/',auth[_0x4a3d('0x9')](),controller[_0x4a3d('0xa')]);router['get'](_0x4a3d('0xb'),auth[_0x4a3d('0x9')](),controller[_0x4a3d('0xc')]);router[_0x4a3d('0x8')](_0x4a3d('0xd'),auth[_0x4a3d('0x9')](),controller[_0x4a3d('0xe')]);router[_0x4a3d('0xf')]('/',auth[_0x4a3d('0x9')](),controller['create']);router[_0x4a3d('0x10')](_0x4a3d('0xd'),auth[_0x4a3d('0x9')](),controller[_0x4a3d('0x11')]);router[_0x4a3d('0x12')]('/:id',auth[_0x4a3d('0x9')](),controller[_0x4a3d('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3fb7=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../config/environment','./userProfileSection.controller'];(function(_0x4ce6fa,_0x26a348){var _0xcd00be=function(_0x2d29e4){while(--_0x2d29e4){_0x4ce6fa['push'](_0x4ce6fa['shift']());}};_0xcd00be(++_0x26a348);}(_0x3fb7,0x189));var _0x73fb=function(_0x5ada52,_0x25255b){_0x5ada52=_0x5ada52-0x0;var _0x2dc014=_0x3fb7[_0x5ada52];return _0x2dc014;};'use strict';var multer=require('multer');var util=require(_0x73fb('0x0'));var path=require('path');var timeout=require(_0x73fb('0x1'));var express=require(_0x73fb('0x2'));var router=express['Router']();var auth=require(_0x73fb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x73fb('0x4'));var controller=require(_0x73fb('0x5'));router[_0x73fb('0x6')]('/',auth[_0x73fb('0x7')](),controller[_0x73fb('0x8')]);router[_0x73fb('0x6')](_0x73fb('0x9'),auth[_0x73fb('0x7')](),controller[_0x73fb('0xa')]);router[_0x73fb('0x6')](_0x73fb('0xb'),auth[_0x73fb('0x7')](),controller[_0x73fb('0xc')]);router[_0x73fb('0xd')]('/',auth[_0x73fb('0x7')](),controller[_0x73fb('0xe')]);router[_0x73fb('0xf')](_0x73fb('0xb'),auth[_0x73fb('0x7')](),controller[_0x73fb('0x10')]);router[_0x73fb('0x11')](_0x73fb('0xb'),auth['isAuthenticated'](),controller[_0x73fb('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 0633eaf..890a458 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 _0x8828=['STRING','crudPermissions','join','sequelize','exports','INTEGER','BOOLEAN'];(function(_0x17cea6,_0x523d66){var _0x1c6499=function(_0x30c7a2){while(--_0x30c7a2){_0x17cea6['push'](_0x17cea6['shift']());}};_0x1c6499(++_0x523d66);}(_0x8828,0x1d1));var _0x8882=function(_0x1c7dbc,_0x4e535d){_0x1c7dbc=_0x1c7dbc-0x0;var _0x3bd1e4=_0x8828[_0x1c7dbc];return _0x3bd1e4;};'use strict';var Sequelize=require(_0x8882('0x0'));module[_0x8882('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8882('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8882('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8882('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8882('0x4')],'set':function(_0x3034fe){this['setDataValue'](_0x8882('0x5'),_0x3034fe?_0x3034fe[_0x8882('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8882('0x5'))?this['getDataValue'](_0x8882('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x2a31=['crudPermissions','join','getDataValue','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x34870c,_0x41d4b1){var _0x4e42e7=function(_0x4cef5){while(--_0x4cef5){_0x34870c['push'](_0x34870c['shift']());}};_0x4e42e7(++_0x41d4b1);}(_0x2a31,0xe4));var _0x12a3=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x2a31[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x12a3('0x0'));module[_0x12a3('0x1')]={'name':{'type':Sequelize[_0x12a3('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x12a3('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x12a3('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x12a3('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x12a3('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x12a3('0x2')],'set':function(_0x126a35){this[_0x12a3('0x5')](_0x12a3('0x6'),_0x126a35?_0x126a35[_0x12a3('0x7')](''):[]);},'get':function(){return this[_0x12a3('0x8')](_0x12a3('0x6'))?this['getDataValue'](_0x12a3('0x6'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d4e38b9..947bc85 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 _0xeccc=['filter','where','merge','type','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','keys','filters','find','create','body','describe','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','sort'];(function(_0xa9eac1,_0x39a4f7){var _0x282f35=function(_0x30dbd4){while(--_0x30dbd4){_0xa9eac1['push'](_0xa9eac1['shift']());}};_0x282f35(++_0x39a4f7);}(_0xeccc,0xa3));var _0xcecc=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xeccc[_0x448f8];return _0xa73126;};'use strict';var pdf=require(_0xcecc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcecc('0x1'));var zipdir=require(_0xcecc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcecc('0x3'));var BPromise=require(_0xcecc('0x4'));var Mustache=require(_0xcecc('0x5'));var util=require(_0xcecc('0x6'));var path=require(_0xcecc('0x7'));var sox=require(_0xcecc('0x8'));var csv=require(_0xcecc('0x9'));var ejs=require(_0xcecc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcecc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcecc('0xc'));var toCsv=require(_0xcecc('0x9'));var querystring=require(_0xcecc('0xd'));var Papa=require('papaparse');var Redis=require(_0xcecc('0xe'));var authService=require(_0xcecc('0xf'));var qs=require(_0xcecc('0x10'));var as=require(_0xcecc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcecc('0x12'))('api');var utils=require(_0xcecc('0x13'));var config=require(_0xcecc('0x14'));var db=require(_0xcecc('0x15'))['db'];function respondWithStatusCode(_0x250bcb,_0x21020f){_0x21020f=_0x21020f||0xcc;return function(_0x4f4527){if(_0x4f4527){return _0x250bcb[_0xcecc('0x16')](_0x21020f);}return _0x250bcb[_0xcecc('0x17')](_0x21020f)[_0xcecc('0x18')]();};}function respondWithResult(_0x4c58ae,_0x4b5a85){_0x4b5a85=_0x4b5a85||0xc8;return function(_0x2c1af2){if(_0x2c1af2){return _0x4c58ae[_0xcecc('0x17')](_0x4b5a85)[_0xcecc('0x19')](_0x2c1af2);}};}function respondWithFilteredResult(_0x4496b7,_0x566fee){return function(_0x5e1a00){if(_0x5e1a00){var _0x5ac29d=_0x5e1a00[_0xcecc('0x1a')],_0x52e107=_0x566fee[_0xcecc('0x1b')],_0x2a239a=_0x566fee[_0xcecc('0x1b')]+_0x566fee[_0xcecc('0x1c')],_0x2137a7;if(_0x2a239a>=_0x5ac29d){_0x2a239a=_0x5ac29d;_0x2137a7=0xc8;}else{_0x2137a7=0xce;}_0x4496b7[_0xcecc('0x17')](_0x2137a7);return _0x4496b7[_0xcecc('0x1d')](_0xcecc('0x1e'),_0x52e107+'-'+_0x2a239a+'/'+_0x5ac29d)[_0xcecc('0x19')](_0x5e1a00);}return null;};}function patchUpdates(_0x11a7e1){return function(_0x436cd){try{jsonpatch[_0xcecc('0x1f')](_0x436cd,_0x11a7e1,!![]);}catch(_0x4c8a0b){return BPromise['reject'](_0x4c8a0b);}return _0x436cd[_0xcecc('0x20')]();};}function saveUpdates(_0x3da6e7,_0x499272){return function(_0x5ec1ee){if(_0x5ec1ee){return _0x5ec1ee[_0xcecc('0x21')](_0x3da6e7)[_0xcecc('0x22')](function(_0x4d7132){return _0x4d7132;});}return null;};}function removeEntity(_0x258723,_0x5c96cd){return function(_0x40e90c){if(_0x40e90c){return _0x40e90c[_0xcecc('0x23')]()[_0xcecc('0x22')](function(){_0x258723[_0xcecc('0x17')](0xcc)[_0xcecc('0x18')]();});}};}function handleEntityNotFound(_0x4f1630,_0x567f19){return function(_0x10b8df){if(!_0x10b8df){_0x4f1630[_0xcecc('0x16')](0x194);}return _0x10b8df;};}function handleError(_0x3c8730,_0x33d6cb){_0x33d6cb=_0x33d6cb||0x1f4;return function(_0x3e3735){logger[_0xcecc('0x24')](_0x3e3735[_0xcecc('0x25')]);if(_0x3e3735['name']){delete _0x3e3735[_0xcecc('0x26')];}_0x3c8730['status'](_0x33d6cb)[_0xcecc('0x27')](_0x3e3735);};}exports[_0xcecc('0x28')]=function(_0x447d0e,_0x24d1f6){var _0x2af43b={},_0x3f9f17={},_0x251ec5={'count':0x0,'rows':[]};var _0x561d9=_[_0xcecc('0x29')](db['UserProfileSection'][_0xcecc('0x2a')],function(_0x55870e){return{'name':_0x55870e[_0xcecc('0x2b')],'type':_0x55870e['type'][_0xcecc('0x2c')]};});_0x3f9f17[_0xcecc('0x2d')]=_[_0xcecc('0x29')](_0x561d9,_0xcecc('0x26'));_0x3f9f17[_0xcecc('0x2e')]=_['keys'](_0x447d0e['query']);_0x3f9f17['filters']=_[_0xcecc('0x2f')](_0x3f9f17['model'],_0x3f9f17[_0xcecc('0x2e')]);_0x2af43b[_0xcecc('0x30')]=_[_0xcecc('0x2f')](_0x3f9f17[_0xcecc('0x2d')],qs[_0xcecc('0x31')](_0x447d0e['query'][_0xcecc('0x31')]));_0x2af43b[_0xcecc('0x30')]=_0x2af43b[_0xcecc('0x30')][_0xcecc('0x32')]?_0x2af43b[_0xcecc('0x30')]:_0x3f9f17[_0xcecc('0x2d')];if(!_0x447d0e['query']['hasOwnProperty'](_0xcecc('0x33'))){_0x2af43b[_0xcecc('0x1c')]=qs[_0xcecc('0x1c')](_0x447d0e[_0xcecc('0x2e')][_0xcecc('0x1c')]);_0x2af43b[_0xcecc('0x1b')]=qs[_0xcecc('0x1b')](_0x447d0e[_0xcecc('0x2e')][_0xcecc('0x1b')]);}_0x2af43b['order']=qs[_0xcecc('0x34')](_0x447d0e[_0xcecc('0x2e')][_0xcecc('0x34')]);_0x2af43b['where']=qs['filters'](_['pick'](_0x447d0e[_0xcecc('0x2e')],_0x3f9f17['filters']));if(_0x447d0e[_0xcecc('0x2e')][_0xcecc('0x35')]){_0x2af43b[_0xcecc('0x36')]=_[_0xcecc('0x37')](_0x2af43b[_0xcecc('0x36')],{'$or':_[_0xcecc('0x29')](_0x561d9,function(_0x5cde74){if(_0x5cde74[_0xcecc('0x38')]!=='VIRTUAL'){var _0x1af1c1={};_0x1af1c1[_0x5cde74[_0xcecc('0x26')]]={'$like':'%'+_0x447d0e['query'][_0xcecc('0x35')]+'%'};return _0x1af1c1;}})});}_0x2af43b=_[_0xcecc('0x37')]({},_0x2af43b,_0x447d0e[_0xcecc('0x39')]);var _0x8979d5={'where':_0x2af43b[_0xcecc('0x36')]};return db[_0xcecc('0x3a')][_0xcecc('0x1a')](_0x8979d5)['then'](function(_0x2a804d){_0x251ec5['count']=_0x2a804d;if(_0x447d0e['query'][_0xcecc('0x3b')]){_0x2af43b[_0xcecc('0x3c')]=[{'all':!![]}];}return db[_0xcecc('0x3a')][_0xcecc('0x3d')](_0x2af43b);})[_0xcecc('0x22')](function(_0x28a059){_0x251ec5[_0xcecc('0x3e')]=_0x28a059;return _0x251ec5;})['then'](respondWithFilteredResult(_0x24d1f6,_0x2af43b))[_0xcecc('0x3f')](handleError(_0x24d1f6,null));};exports[_0xcecc('0x40')]=function(_0x2736eb,_0x3f0ee7){var _0x6cd0c9={'raw':![],'where':{'id':_0x2736eb[_0xcecc('0x41')]['id']}},_0x2db45a={};_0x2db45a['model']=_[_0xcecc('0x42')](db[_0xcecc('0x3a')]['rawAttributes']);_0x2db45a[_0xcecc('0x2e')]=_['keys'](_0x2736eb['query']);_0x2db45a[_0xcecc('0x43')]=_['intersection'](_0x2db45a[_0xcecc('0x2d')],_0x2db45a[_0xcecc('0x2e')]);_0x6cd0c9[_0xcecc('0x30')]=_[_0xcecc('0x2f')](_0x2db45a[_0xcecc('0x2d')],qs[_0xcecc('0x31')](_0x2736eb[_0xcecc('0x2e')][_0xcecc('0x31')]));_0x6cd0c9[_0xcecc('0x30')]=_0x6cd0c9['attributes'][_0xcecc('0x32')]?_0x6cd0c9[_0xcecc('0x30')]:_0x2db45a[_0xcecc('0x2d')];if(_0x2736eb[_0xcecc('0x2e')]['includeAll']){_0x6cd0c9['include']=[{'all':!![]}];}_0x6cd0c9=_[_0xcecc('0x37')]({},_0x6cd0c9,_0x2736eb['options']);return db[_0xcecc('0x3a')][_0xcecc('0x44')](_0x6cd0c9)['then'](handleEntityNotFound(_0x3f0ee7,null))[_0xcecc('0x22')](respondWithResult(_0x3f0ee7,null))['catch'](handleError(_0x3f0ee7,null));};exports[_0xcecc('0x45')]=function(_0x1f6630,_0x24c42e){return db['UserProfileSection'][_0xcecc('0x45')](_0x1f6630[_0xcecc('0x46')],{})[_0xcecc('0x22')](respondWithResult(_0x24c42e,0xc9))[_0xcecc('0x3f')](handleError(_0x24c42e,null));};exports[_0xcecc('0x21')]=function(_0x14c990,_0x58ab3b){if(_0x14c990['body']['id']){delete _0x14c990['body']['id'];}return db[_0xcecc('0x3a')][_0xcecc('0x44')]({'where':{'id':_0x14c990[_0xcecc('0x41')]['id']}})[_0xcecc('0x22')](handleEntityNotFound(_0x58ab3b,null))['then'](saveUpdates(_0x14c990[_0xcecc('0x46')],null))['then'](respondWithResult(_0x58ab3b,null))[_0xcecc('0x3f')](handleError(_0x58ab3b,null));};exports[_0xcecc('0x23')]=function(_0x122da0,_0x5a06db){return db[_0xcecc('0x3a')][_0xcecc('0x44')]({'where':{'id':_0x122da0['params']['id']}})[_0xcecc('0x22')](handleEntityNotFound(_0x5a06db,null))[_0xcecc('0x22')](removeEntity(_0x5a06db,null))[_0xcecc('0x3f')](handleError(_0x5a06db,null));};exports['describe']=function(_0x19e409,_0x3aef04){return db['UserProfileSection'][_0xcecc('0x47')]()[_0xcecc('0x22')](respondWithResult(_0x3aef04,null))[_0xcecc('0x3f')](handleError(_0x3aef04,null));}; \ No newline at end of file +var _0x4021=['../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','destroy','then','end','error','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','VIRTUAL','options','where','includeAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x5e1da2,_0x2ed13b){var _0x39bd67=function(_0x3e30b4){while(--_0x3e30b4){_0x5e1da2['push'](_0x5e1da2['shift']());}};_0x39bd67(++_0x2ed13b);}(_0x4021,0x79));var _0x1402=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x4021[_0x38537f];return _0x141e23;};'use strict';var pdf=require(_0x1402('0x0'));var emlformat=require(_0x1402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1402('0x2'));var jsonpatch=require(_0x1402('0x3'));var rp=require(_0x1402('0x4'));var moment=require('moment');var BPromise=require(_0x1402('0x5'));var Mustache=require(_0x1402('0x6'));var util=require(_0x1402('0x7'));var path=require(_0x1402('0x8'));var sox=require(_0x1402('0x9'));var csv=require(_0x1402('0xa'));var ejs=require(_0x1402('0xb'));var fs=require('fs');var _=require(_0x1402('0xc'));var squel=require(_0x1402('0xd'));var crypto=require('crypto');var jsforce=require(_0x1402('0xe'));var deskjs=require(_0x1402('0xf'));var toCsv=require(_0x1402('0xa'));var querystring=require(_0x1402('0x10'));var Papa=require(_0x1402('0x11'));var Redis=require('ioredis');var authService=require(_0x1402('0x12'));var qs=require(_0x1402('0x13'));var as=require(_0x1402('0x14'));var hardwareService=require(_0x1402('0x15'));var logger=require(_0x1402('0x16'))('api');var utils=require(_0x1402('0x17'));var config=require(_0x1402('0x18'));var db=require(_0x1402('0x19'))['db'];function respondWithStatusCode(_0x4ba1f1,_0x4544b9){_0x4544b9=_0x4544b9||0xcc;return function(_0x2f0f3c){if(_0x2f0f3c){return _0x4ba1f1[_0x1402('0x1a')](_0x4544b9);}return _0x4ba1f1[_0x1402('0x1b')](_0x4544b9)['end']();};}function respondWithResult(_0x4dc52d,_0x5f2881){_0x5f2881=_0x5f2881||0xc8;return function(_0x47ba77){if(_0x47ba77){return _0x4dc52d[_0x1402('0x1b')](_0x5f2881)[_0x1402('0x1c')](_0x47ba77);}};}function respondWithFilteredResult(_0x16c589,_0x591c14){return function(_0x41310b){if(_0x41310b){var _0x3e095f=_0x41310b[_0x1402('0x1d')],_0x803693=_0x591c14[_0x1402('0x1e')],_0x1ace7e=_0x591c14[_0x1402('0x1e')]+_0x591c14[_0x1402('0x1f')],_0x558204;if(_0x1ace7e>=_0x3e095f){_0x1ace7e=_0x3e095f;_0x558204=0xc8;}else{_0x558204=0xce;}_0x16c589[_0x1402('0x1b')](_0x558204);return _0x16c589[_0x1402('0x20')](_0x1402('0x21'),_0x803693+'-'+_0x1ace7e+'/'+_0x3e095f)[_0x1402('0x1c')](_0x41310b);}return null;};}function patchUpdates(_0x38d795){return function(_0x1a22ff){try{jsonpatch[_0x1402('0x22')](_0x1a22ff,_0x38d795,!![]);}catch(_0x291f4b){return BPromise['reject'](_0x291f4b);}return _0x1a22ff['save']();};}function saveUpdates(_0x231518,_0x2be832){return function(_0x233c1e){if(_0x233c1e){return _0x233c1e['update'](_0x231518)['then'](function(_0x46aa05){return _0x46aa05;});}return null;};}function removeEntity(_0x1d5e9d,_0x226afa){return function(_0x54a377){if(_0x54a377){return _0x54a377[_0x1402('0x23')]()[_0x1402('0x24')](function(){_0x1d5e9d['status'](0xcc)[_0x1402('0x25')]();});}};}function handleEntityNotFound(_0xf1ec9,_0x5551aa){return function(_0x1afe4e){if(!_0x1afe4e){_0xf1ec9[_0x1402('0x1a')](0x194);}return _0x1afe4e;};}function handleError(_0x2816e5,_0x3817cb){_0x3817cb=_0x3817cb||0x1f4;return function(_0x4bebe1){logger[_0x1402('0x26')](_0x4bebe1['stack']);if(_0x4bebe1['name']){delete _0x4bebe1['name'];}_0x2816e5['status'](_0x3817cb)[_0x1402('0x27')](_0x4bebe1);};}exports[_0x1402('0x28')]=function(_0x12d51c,_0x5da64a){var _0x3ab082={},_0x24d37f={},_0xf0e517={'count':0x0,'rows':[]};var _0x4f3b41=_[_0x1402('0x29')](db[_0x1402('0x2a')][_0x1402('0x2b')],function(_0x5ad952){return{'name':_0x5ad952[_0x1402('0x2c')],'type':_0x5ad952[_0x1402('0x2d')][_0x1402('0x2e')]};});_0x24d37f[_0x1402('0x2f')]=_[_0x1402('0x29')](_0x4f3b41,'name');_0x24d37f[_0x1402('0x30')]=_[_0x1402('0x31')](_0x12d51c[_0x1402('0x30')]);_0x24d37f['filters']=_[_0x1402('0x32')](_0x24d37f[_0x1402('0x2f')],_0x24d37f['query']);_0x3ab082[_0x1402('0x33')]=_[_0x1402('0x32')](_0x24d37f[_0x1402('0x2f')],qs[_0x1402('0x34')](_0x12d51c[_0x1402('0x30')]['fields']));_0x3ab082['attributes']=_0x3ab082[_0x1402('0x33')][_0x1402('0x35')]?_0x3ab082[_0x1402('0x33')]:_0x24d37f[_0x1402('0x2f')];if(!_0x12d51c['query'][_0x1402('0x36')](_0x1402('0x37'))){_0x3ab082[_0x1402('0x1f')]=qs[_0x1402('0x1f')](_0x12d51c['query'][_0x1402('0x1f')]);_0x3ab082[_0x1402('0x1e')]=qs[_0x1402('0x1e')](_0x12d51c[_0x1402('0x30')][_0x1402('0x1e')]);}_0x3ab082['order']=qs[_0x1402('0x38')](_0x12d51c['query']['sort']);_0x3ab082['where']=qs['filters'](_[_0x1402('0x39')](_0x12d51c['query'],_0x24d37f[_0x1402('0x3a')]));if(_0x12d51c['query'][_0x1402('0x3b')]){_0x3ab082['where']=_[_0x1402('0x3c')](_0x3ab082['where'],{'$or':_[_0x1402('0x29')](_0x4f3b41,function(_0x170409){if(_0x170409[_0x1402('0x2d')]!==_0x1402('0x3d')){var _0x2f31a9={};_0x2f31a9[_0x170409['name']]={'$like':'%'+_0x12d51c[_0x1402('0x30')]['filter']+'%'};return _0x2f31a9;}})});}_0x3ab082=_[_0x1402('0x3c')]({},_0x3ab082,_0x12d51c[_0x1402('0x3e')]);var _0xc309d5={'where':_0x3ab082[_0x1402('0x3f')]};return db[_0x1402('0x2a')][_0x1402('0x1d')](_0xc309d5)[_0x1402('0x24')](function(_0x23eccd){_0xf0e517[_0x1402('0x1d')]=_0x23eccd;if(_0x12d51c[_0x1402('0x30')][_0x1402('0x40')]){_0x3ab082['include']=[{'all':!![]}];}return db[_0x1402('0x2a')]['findAll'](_0x3ab082);})[_0x1402('0x24')](function(_0x2fc01e){_0xf0e517[_0x1402('0x41')]=_0x2fc01e;return _0xf0e517;})[_0x1402('0x24')](respondWithFilteredResult(_0x5da64a,_0x3ab082))[_0x1402('0x42')](handleError(_0x5da64a,null));};exports[_0x1402('0x43')]=function(_0xf581ef,_0x52cc22){var _0x40283f={'raw':![],'where':{'id':_0xf581ef[_0x1402('0x44')]['id']}},_0x2daf29={};_0x2daf29['model']=_['keys'](db[_0x1402('0x2a')][_0x1402('0x2b')]);_0x2daf29[_0x1402('0x30')]=_[_0x1402('0x31')](_0xf581ef[_0x1402('0x30')]);_0x2daf29[_0x1402('0x3a')]=_[_0x1402('0x32')](_0x2daf29['model'],_0x2daf29['query']);_0x40283f[_0x1402('0x33')]=_[_0x1402('0x32')](_0x2daf29[_0x1402('0x2f')],qs['fields'](_0xf581ef['query'][_0x1402('0x34')]));_0x40283f[_0x1402('0x33')]=_0x40283f[_0x1402('0x33')][_0x1402('0x35')]?_0x40283f['attributes']:_0x2daf29[_0x1402('0x2f')];if(_0xf581ef[_0x1402('0x30')][_0x1402('0x40')]){_0x40283f['include']=[{'all':!![]}];}_0x40283f=_[_0x1402('0x3c')]({},_0x40283f,_0xf581ef[_0x1402('0x3e')]);return db['UserProfileSection'][_0x1402('0x45')](_0x40283f)['then'](handleEntityNotFound(_0x52cc22,null))[_0x1402('0x24')](respondWithResult(_0x52cc22,null))['catch'](handleError(_0x52cc22,null));};exports['create']=function(_0x19a5c8,_0x3a147d){return db[_0x1402('0x2a')][_0x1402('0x46')](_0x19a5c8['body'],{})[_0x1402('0x24')](respondWithResult(_0x3a147d,0xc9))[_0x1402('0x42')](handleError(_0x3a147d,null));};exports['update']=function(_0x22cb3f,_0x117735){if(_0x22cb3f[_0x1402('0x47')]['id']){delete _0x22cb3f[_0x1402('0x47')]['id'];}return db[_0x1402('0x2a')][_0x1402('0x45')]({'where':{'id':_0x22cb3f[_0x1402('0x44')]['id']}})['then'](handleEntityNotFound(_0x117735,null))['then'](saveUpdates(_0x22cb3f['body'],null))[_0x1402('0x24')](respondWithResult(_0x117735,null))['catch'](handleError(_0x117735,null));};exports[_0x1402('0x23')]=function(_0x5efa5f,_0x4178f6){return db[_0x1402('0x2a')]['find']({'where':{'id':_0x5efa5f[_0x1402('0x44')]['id']}})[_0x1402('0x24')](handleEntityNotFound(_0x4178f6,null))[_0x1402('0x24')](removeEntity(_0x4178f6,null))[_0x1402('0x42')](handleError(_0x4178f6,null));};exports[_0x1402('0x48')]=function(_0x2330cf,_0x1590fd){return db['UserProfileSection']['describe']()['then'](respondWithResult(_0x1590fd,null))['catch'](handleError(_0x1590fd,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e3267c6..af7ccb9 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 _0xc953=['util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc953,0x195));var _0x3c95=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xc953[_0x4c06a3];return _0x7ff53c;};'use strict';var _=require(_0x3c95('0x0'));var util=require(_0x3c95('0x1'));var logger=require(_0x3c95('0x2'))(_0x3c95('0x3'));var moment=require(_0x3c95('0x4'));var BPromise=require('bluebird');var rp=require(_0x3c95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c95('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x3c95('0x7')]=function(_0x1fe09b,_0x31b33d){return _0x1fe09b[_0x3c95('0x8')](_0x3c95('0x9'),attributes,{'tableName':_0x3c95('0xa'),'paranoid':![],'indexes':[{'name':_0x3c95('0xb'),'fields':[_0x3c95('0xc'),_0x3c95('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d8d=['UserProfileSection','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x163c25,_0x1952a6){var _0x2cf45f=function(_0x58e936){while(--_0x58e936){_0x163c25['push'](_0x163c25['shift']());}};_0x2cf45f(++_0x1952a6);}(_0x9d8d,0x8e));var _0xd9d8=function(_0x41d795,_0x3ff688){_0x41d795=_0x41d795-0x0;var _0x4aef18=_0x9d8d[_0x41d795];return _0x4aef18;};'use strict';var _=require('lodash');var util=require(_0xd9d8('0x0'));var logger=require(_0xd9d8('0x1'))(_0xd9d8('0x2'));var moment=require(_0xd9d8('0x3'));var BPromise=require(_0xd9d8('0x4'));var rp=require(_0xd9d8('0x5'));var fs=require('fs');var path=require(_0xd9d8('0x6'));var rimraf=require(_0xd9d8('0x7'));var config=require(_0xd9d8('0x8'));var attributes=require(_0xd9d8('0x9'));module[_0xd9d8('0xa')]=function(_0x6f8c42,_0x70fcce){return _0x6f8c42[_0xd9d8('0xb')](_0xd9d8('0xc'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xd9d8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 1d655b9..ca45b82 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 _0xa0b8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../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'];(function(_0x350b22,_0x1050c1){var _0x22bc89=function(_0x25ceb5){while(--_0x25ceb5){_0x350b22['push'](_0x350b22['shift']());}};_0x22bc89(++_0x1050c1);}(_0xa0b8,0x134));var _0x8a0b=function(_0x5982a5,_0x3dc07b){_0x5982a5=_0x5982a5-0x0;var _0x159c80=_0xa0b8[_0x5982a5];return _0x159c80;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a0b('0x0'));var fs=require('fs');var Redis=require(_0x8a0b('0x1'));var db=require(_0x8a0b('0x2'))['db'];var utils=require(_0x8a0b('0x3'));var logger=require(_0x8a0b('0x4'))(_0x8a0b('0x5'));var config=require(_0x8a0b('0x6'));var jayson=require(_0x8a0b('0x7'));var client=jayson[_0x8a0b('0x8')][_0x8a0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x223d6c,_0x31442a,_0x3d03ad){return new BPromise(function(_0x4e27c7,_0x45004d){return client[_0x8a0b('0xa')](_0x223d6c,_0x3d03ad)[_0x8a0b('0xb')](function(_0x3597bf){logger[_0x8a0b('0xc')](_0x8a0b('0xd'),_0x31442a,_0x8a0b('0xe'));logger[_0x8a0b('0xf')](_0x8a0b('0x10'),_0x31442a,'request\x20sent',JSON[_0x8a0b('0x11')](_0x3597bf));if(_0x3597bf[_0x8a0b('0x12')]){if(_0x3597bf[_0x8a0b('0x12')]['code']===0x1f4){logger[_0x8a0b('0x12')](_0x8a0b('0xd'),_0x31442a,_0x3597bf[_0x8a0b('0x12')][_0x8a0b('0x13')]);return _0x45004d(_0x3597bf[_0x8a0b('0x12')]['message']);}logger['error'](_0x8a0b('0xd'),_0x31442a,_0x3597bf[_0x8a0b('0x12')][_0x8a0b('0x13')]);return _0x4e27c7(_0x3597bf[_0x8a0b('0x12')]['message']);}else{logger['info'](_0x8a0b('0xd'),_0x31442a,'request\x20sent');_0x4e27c7(_0x3597bf[_0x8a0b('0x14')]['message']);}})[_0x8a0b('0x15')](function(_0x4d18ca){logger['error'](_0x8a0b('0xd'),_0x31442a,_0x4d18ca);_0x45004d(_0x4d18ca);});});} \ No newline at end of file +var _0x961c=['http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x336e55,_0x4af20b){var _0x489402=function(_0x4c47e1){while(--_0x4c47e1){_0x336e55['push'](_0x336e55['shift']());}};_0x489402(++_0x4af20b);}(_0x961c,0x15c));var _0xc961=function(_0x3d86bc,_0x5bcc61){_0x3d86bc=_0x3d86bc-0x0;var _0x23591c=_0x961c[_0x3d86bc];return _0x23591c;};'use strict';var _=require(_0xc961('0x0'));var util=require('util');var moment=require(_0xc961('0x1'));var BPromise=require(_0xc961('0x2'));var rs=require(_0xc961('0x3'));var fs=require('fs');var Redis=require(_0xc961('0x4'));var db=require(_0xc961('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc961('0x6'))('rpc');var config=require(_0xc961('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc961('0x8')][_0xc961('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12b553,_0x218c35,_0x4ce6ff){return new BPromise(function(_0x5379d9,_0x1904ed){return client[_0xc961('0xa')](_0x12b553,_0x4ce6ff)['then'](function(_0x3c1f31){logger[_0xc961('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x218c35,_0xc961('0xc'));logger[_0xc961('0xd')](_0xc961('0xe'),_0x218c35,_0xc961('0xc'),JSON[_0xc961('0xf')](_0x3c1f31));if(_0x3c1f31['error']){if(_0x3c1f31[_0xc961('0x10')][_0xc961('0x11')]===0x1f4){logger[_0xc961('0x10')](_0xc961('0x12'),_0x218c35,_0x3c1f31[_0xc961('0x10')][_0xc961('0x13')]);return _0x1904ed(_0x3c1f31[_0xc961('0x10')][_0xc961('0x13')]);}logger[_0xc961('0x10')](_0xc961('0x12'),_0x218c35,_0x3c1f31[_0xc961('0x10')][_0xc961('0x13')]);return _0x5379d9(_0x3c1f31[_0xc961('0x10')]['message']);}else{logger[_0xc961('0xb')](_0xc961('0x12'),_0x218c35,_0xc961('0xc'));_0x5379d9(_0x3c1f31[_0xc961('0x14')]['message']);}})['catch'](function(_0x4ebfc4){logger[_0xc961('0x10')](_0xc961('0x12'),_0x218c35,_0x4ebfc4);_0x1904ed(_0x4ebfc4);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0e451c8..a4761d4 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 _0x6f9f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','connect-timeout','express'];(function(_0x3d9319,_0x390e90){var _0x52bc3a=function(_0x237ee7){while(--_0x237ee7){_0x3d9319['push'](_0x3d9319['shift']());}};_0x52bc3a(++_0x390e90);}(_0x6f9f,0x11d));var _0xf6f9=function(_0x54958d,_0x4d60bf){_0x54958d=_0x54958d-0x0;var _0x5f0558=_0x6f9f[_0x54958d];return _0x5f0558;};'use strict';var multer=require('multer');var util=require(_0xf6f9('0x0'));var path=require('path');var timeout=require(_0xf6f9('0x1'));var express=require(_0xf6f9('0x2'));var router=express[_0xf6f9('0x3')]();var auth=require(_0xf6f9('0x4'));var interaction=require(_0xf6f9('0x5'));var config=require(_0xf6f9('0x6'));module[_0xf6f9('0x7')]=router; \ No newline at end of file +var _0x4f1c=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x43b1e1,_0x3db8bf){var _0x5a6169=function(_0x565842){while(--_0x565842){_0x43b1e1['push'](_0x43b1e1['shift']());}};_0x5a6169(++_0x3db8bf);}(_0x4f1c,0x18f));var _0xc4f1=function(_0x1f7518,_0x2e4ab5){_0x1f7518=_0x1f7518-0x0;var _0x52337b=_0x4f1c[_0x1f7518];return _0x52337b;};'use strict';var multer=require(_0xc4f1('0x0'));var util=require(_0xc4f1('0x1'));var path=require(_0xc4f1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4f1('0x3'));var router=express[_0xc4f1('0x4')]();var auth=require(_0xc4f1('0x5'));var interaction=require(_0xc4f1('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 73860d9..dd0d936 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x5f0508,_0x336b54){var _0x25bb3d=function(_0x556770){while(--_0x556770){_0x5f0508['push'](_0x5f0508['shift']());}};_0x25bb3d(++_0x336b54);}(_0xe706,0xa3));var _0x6e70=function(_0x4ea5eb,_0x190c43){_0x4ea5eb=_0x4ea5eb-0x0;var _0x2133cf=_0xe706[_0x4ea5eb];return _0x2133cf;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('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 5b6ab79..5a9f915 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 _0x88c5=['UserSmsQueue','user_has_sms_queues','lodash','moment','request-promise','path','rimraf','./userSmsQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88c5,0x172));var _0x588c=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0x88c5[_0x1f0724];return _0x253ffb;};'use strict';var _=require(_0x588c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x588c('0x1'));var BPromise=require('bluebird');var rp=require(_0x588c('0x2'));var fs=require('fs');var path=require(_0x588c('0x3'));var rimraf=require(_0x588c('0x4'));var config=require('../../config/environment');var attributes=require(_0x588c('0x5'));module['exports']=function(_0x2060c3,_0x434321){return _0x2060c3['define'](_0x588c('0x6'),attributes,{'tableName':_0x588c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2078=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2078,0x193));var _0x8207=function(_0x2c54b9,_0x557f31){_0x2c54b9=_0x2c54b9-0x0;var _0x18d632=_0x2078[_0x2c54b9];return _0x18d632;};'use strict';var _=require(_0x8207('0x0'));var util=require(_0x8207('0x1'));var logger=require(_0x8207('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8207('0x3'));var rp=require(_0x8207('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8207('0x5'));var config=require(_0x8207('0x6'));var attributes=require(_0x8207('0x7'));module['exports']=function(_0x46f0af,_0x4cdadf){return _0x46f0af[_0x8207('0x8')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 866c9d1..1d1c04e 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 _0x32f9=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x462929,_0x3e60d4){var _0x5a7256=function(_0x30c85d){while(--_0x30c85d){_0x462929['push'](_0x462929['shift']());}};_0x5a7256(++_0x3e60d4);}(_0x32f9,0x69));var _0x932f=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x32f9[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x932f('0x0'));var util=require('util');var moment=require(_0x932f('0x1'));var BPromise=require(_0x932f('0x2'));var rs=require(_0x932f('0x3'));var fs=require('fs');var Redis=require(_0x932f('0x4'));var db=require(_0x932f('0x5'))['db'];var utils=require(_0x932f('0x6'));var logger=require(_0x932f('0x7'))(_0x932f('0x8'));var config=require(_0x932f('0x9'));var jayson=require(_0x932f('0xa'));var client=jayson[_0x932f('0xb')][_0x932f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c052f,_0x46d7bd,_0x5dd021){return new BPromise(function(_0x5b61b4,_0x217966){return client[_0x932f('0xd')](_0x4c052f,_0x5dd021)[_0x932f('0xe')](function(_0x8448e8){logger['info'](_0x932f('0xf'),_0x46d7bd,_0x932f('0x10'));logger[_0x932f('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x46d7bd,_0x932f('0x10'),JSON['stringify'](_0x8448e8));if(_0x8448e8[_0x932f('0x12')]){if(_0x8448e8['error'][_0x932f('0x13')]===0x1f4){logger['error'](_0x932f('0xf'),_0x46d7bd,_0x8448e8[_0x932f('0x12')][_0x932f('0x14')]);return _0x217966(_0x8448e8[_0x932f('0x12')]['message']);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x46d7bd,_0x8448e8[_0x932f('0x12')][_0x932f('0x14')]);return _0x5b61b4(_0x8448e8[_0x932f('0x12')]['message']);}else{logger[_0x932f('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0x46d7bd,_0x932f('0x10'));_0x5b61b4(_0x8448e8[_0x932f('0x16')][_0x932f('0x14')]);}})[_0x932f('0x17')](function(_0x23c936){logger['error'](_0x932f('0xf'),_0x46d7bd,_0x23c936);_0x217966(_0x23c936);});});} \ No newline at end of file +var _0xbbfd=['message','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52f141,_0x2184f0){var _0x3f730c=function(_0x436b6e){while(--_0x436b6e){_0x52f141['push'](_0x52f141['shift']());}};_0x3f730c(++_0x2184f0);}(_0xbbfd,0xde));var _0xdbbf=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xbbfd[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require('lodash');var util=require(_0xdbbf('0x0'));var moment=require(_0xdbbf('0x1'));var BPromise=require(_0xdbbf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbbf('0x3'))['db'];var utils=require(_0xdbbf('0x4'));var logger=require(_0xdbbf('0x5'))(_0xdbbf('0x6'));var config=require(_0xdbbf('0x7'));var jayson=require(_0xdbbf('0x8'));var client=jayson['client'][_0xdbbf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e0400,_0x18f808,_0x20b549){return new BPromise(function(_0x47f610,_0x308fe1){return client[_0xdbbf('0xa')](_0x3e0400,_0x20b549)[_0xdbbf('0xb')](function(_0x2c0638){logger[_0xdbbf('0xc')](_0xdbbf('0xd'),_0x18f808,_0xdbbf('0xe'));logger[_0xdbbf('0xf')](_0xdbbf('0x10'),_0x18f808,_0xdbbf('0xe'),JSON[_0xdbbf('0x11')](_0x2c0638));if(_0x2c0638[_0xdbbf('0x12')]){if(_0x2c0638[_0xdbbf('0x12')][_0xdbbf('0x13')]===0x1f4){logger[_0xdbbf('0x12')](_0xdbbf('0xd'),_0x18f808,_0x2c0638['error'][_0xdbbf('0x14')]);return _0x308fe1(_0x2c0638[_0xdbbf('0x12')][_0xdbbf('0x14')]);}logger[_0xdbbf('0x12')](_0xdbbf('0xd'),_0x18f808,_0x2c0638['error'][_0xdbbf('0x14')]);return _0x47f610(_0x2c0638[_0xdbbf('0x12')][_0xdbbf('0x14')]);}else{logger[_0xdbbf('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x18f808,_0xdbbf('0xe'));_0x47f610(_0x2c0638[_0xdbbf('0x15')]['message']);}})['catch'](function(_0x41fae2){logger[_0xdbbf('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x18f808,_0x41fae2);_0x308fe1(_0x41fae2);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index f86a4a3..7f97ad2 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 _0x31f5=['../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x22f625,_0x4793d9){var _0x2442ed=function(_0x4e745a){while(--_0x4e745a){_0x22f625['push'](_0x22f625['shift']());}};_0x2442ed(++_0x4793d9);}(_0x31f5,0x18a));var _0x531f=function(_0x393ebf,_0x382020){_0x393ebf=_0x393ebf-0x0;var _0x4f248d=_0x31f5[_0x393ebf];return _0x4f248d;};'use strict';var multer=require(_0x531f('0x0'));var util=require('util');var path=require(_0x531f('0x1'));var timeout=require(_0x531f('0x2'));var express=require(_0x531f('0x3'));var router=express[_0x531f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x531f('0x5'));var config=require(_0x531f('0x6'));module[_0x531f('0x7')]=router; \ No newline at end of file +var _0x193f=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path','connect-timeout'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x193f,0xdd));var _0xf193=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x193f[_0x491faa];return _0x414440;};'use strict';var multer=require(_0xf193('0x0'));var util=require('util');var path=require(_0xf193('0x1'));var timeout=require(_0xf193('0x2'));var express=require(_0xf193('0x3'));var router=express['Router']();var auth=require(_0xf193('0x4'));var interaction=require(_0xf193('0x5'));var config=require(_0xf193('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index aa4de61..0e74a85 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x538848,_0x374513){var _0x720fac=function(_0x29069e){while(--_0x29069e){_0x538848['push'](_0x538848['shift']());}};_0x720fac(++_0x374513);}(_0xe706,0xa3));var _0x6e70=function(_0x45cd35,_0x41147c){_0x45cd35=_0x45cd35-0x0;var _0x16db84=_0xe706[_0x45cd35];return _0x16db84;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 dd5033f..6dc60fd 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','UserVoiceQueue','util'];(function(_0x2ad378,_0x36ed08){var _0x412d24=function(_0x3910a5){while(--_0x3910a5){_0x2ad378['push'](_0x2ad378['shift']());}};_0x412d24(++_0x36ed08);}(_0xedd9,0xfc));var _0x9edd=function(_0x457496,_0x2e262d){_0x457496=_0x457496-0x0;var _0x7b607b=_0xedd9[_0x457496];return _0x7b607b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ea=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x2ecdbe,_0x114206){var _0x44d6d4=function(_0x2e592a){while(--_0x2e592a){_0x2ecdbe['push'](_0x2ecdbe['shift']());}};_0x44d6d4(++_0x114206);}(_0xd2ea,0x15f));var _0xad2e=function(_0x10670e,_0x4547ab){_0x10670e=_0x10670e-0x0;var _0xb3b25c=_0xd2ea[_0x10670e];return _0xb3b25c;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'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 e20fd32..a19eb90 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 _0xabfc=['http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xabfc,0xaa));var _0xcabf=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0xabfc[_0x4fa438];return _0x4e3958;};'use strict';var _=require(_0xcabf('0x0'));var util=require(_0xcabf('0x1'));var moment=require(_0xcabf('0x2'));var BPromise=require(_0xcabf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcabf('0x4'));var db=require(_0xcabf('0x5'))['db'];var utils=require(_0xcabf('0x6'));var logger=require(_0xcabf('0x7'))(_0xcabf('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcabf('0x9')][_0xcabf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35aa24,_0x23ac6a,_0x48b851){return new BPromise(function(_0x5661a2,_0x472a35){return client['request'](_0x35aa24,_0x48b851)[_0xcabf('0xb')](function(_0x1c1e3e){logger['info'](_0xcabf('0xc'),_0x23ac6a,_0xcabf('0xd'));logger[_0xcabf('0xe')](_0xcabf('0xf'),_0x23ac6a,'request\x20sent',JSON['stringify'](_0x1c1e3e));if(_0x1c1e3e['error']){if(_0x1c1e3e[_0xcabf('0x10')]['code']===0x1f4){logger[_0xcabf('0x10')](_0xcabf('0xc'),_0x23ac6a,_0x1c1e3e[_0xcabf('0x10')][_0xcabf('0x11')]);return _0x472a35(_0x1c1e3e[_0xcabf('0x10')][_0xcabf('0x11')]);}logger[_0xcabf('0x10')](_0xcabf('0xc'),_0x23ac6a,_0x1c1e3e[_0xcabf('0x10')]['message']);return _0x5661a2(_0x1c1e3e[_0xcabf('0x10')][_0xcabf('0x11')]);}else{logger['info'](_0xcabf('0xc'),_0x23ac6a,_0xcabf('0xd'));_0x5661a2(_0x1c1e3e[_0xcabf('0x12')]['message']);}})[_0xcabf('0x13')](function(_0x333816){logger[_0xcabf('0x10')](_0xcabf('0xc'),_0x23ac6a,_0x333816);_0x472a35(_0x333816);});});} \ No newline at end of file +var _0xf34f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x273fde,_0x3db3fd){var _0x5e4b23=function(_0x4d463a){while(--_0x4d463a){_0x273fde['push'](_0x273fde['shift']());}};_0x5e4b23(++_0x3db3fd);}(_0xf34f,0x16b));var _0xff34=function(_0x2dac56,_0x1d9a36){_0x2dac56=_0x2dac56-0x0;var _0x2c04c0=_0xf34f[_0x2dac56];return _0x2c04c0;};'use strict';var _=require(_0xff34('0x0'));var util=require('util');var moment=require(_0xff34('0x1'));var BPromise=require(_0xff34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff34('0x3'));var db=require(_0xff34('0x4'))['db'];var utils=require(_0xff34('0x5'));var logger=require(_0xff34('0x6'))(_0xff34('0x7'));var config=require(_0xff34('0x8'));var jayson=require(_0xff34('0x9'));var client=jayson[_0xff34('0xa')][_0xff34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x380b91,_0x5d8f59,_0x5407ac){return new BPromise(function(_0x560377,_0x2c1f4a){return client['request'](_0x380b91,_0x5407ac)[_0xff34('0xc')](function(_0x5968d6){logger[_0xff34('0xd')](_0xff34('0xe'),_0x5d8f59,_0xff34('0xf'));logger[_0xff34('0x10')](_0xff34('0x11'),_0x5d8f59,_0xff34('0xf'),JSON['stringify'](_0x5968d6));if(_0x5968d6['error']){if(_0x5968d6[_0xff34('0x12')][_0xff34('0x13')]===0x1f4){logger[_0xff34('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x5d8f59,_0x5968d6[_0xff34('0x12')]['message']);return _0x2c1f4a(_0x5968d6[_0xff34('0x12')][_0xff34('0x14')]);}logger[_0xff34('0x12')](_0xff34('0xe'),_0x5d8f59,_0x5968d6['error'][_0xff34('0x14')]);return _0x560377(_0x5968d6[_0xff34('0x12')][_0xff34('0x14')]);}else{logger[_0xff34('0xd')](_0xff34('0xe'),_0x5d8f59,_0xff34('0xf'));_0x560377(_0x5968d6[_0xff34('0x15')][_0xff34('0x14')]);}})[_0xff34('0x16')](function(_0x4ef2a4){logger[_0xff34('0x12')](_0xff34('0xe'),_0x5d8f59,_0x4ef2a4);_0x2c1f4a(_0x4ef2a4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 4f2a34b..3a07f0e 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 _0xda07=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x5d6280,_0x3f72ab){var _0x77b738=function(_0x1b8208){while(--_0x1b8208){_0x5d6280['push'](_0x5d6280['shift']());}};_0x77b738(++_0x3f72ab);}(_0xda07,0x7f));var _0x7da0=function(_0x1806d0,_0x566c77){_0x1806d0=_0x1806d0-0x0;var _0x7dfa63=_0xda07[_0x1806d0];return _0x7dfa63;};'use strict';var multer=require(_0x7da0('0x0'));var util=require(_0x7da0('0x1'));var path=require('path');var timeout=require(_0x7da0('0x2'));var express=require(_0x7da0('0x3'));var router=express['Router']();var auth=require(_0x7da0('0x4'));var interaction=require(_0x7da0('0x5'));var config=require(_0x7da0('0x6'));module[_0x7da0('0x7')]=router; \ No newline at end of file +var _0x6909=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path'];(function(_0x5b35ba,_0x2afe21){var _0xb571a4=function(_0x5e1ae7){while(--_0x5e1ae7){_0x5b35ba['push'](_0x5b35ba['shift']());}};_0xb571a4(++_0x2afe21);}(_0x6909,0x166));var _0x9690=function(_0x653208,_0x447a67){_0x653208=_0x653208-0x0;var _0x247899=_0x6909[_0x653208];return _0x247899;};'use strict';var multer=require('multer');var util=require(_0x9690('0x0'));var path=require(_0x9690('0x1'));var timeout=require(_0x9690('0x2'));var express=require(_0x9690('0x3'));var router=express[_0x9690('0x4')]();var auth=require(_0x9690('0x5'));var interaction=require(_0x9690('0x6'));var config=require(_0x9690('0x7'));module[_0x9690('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index bef0670..c568e90 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 _0x1119=['Required\x20by\x20Asterisk','queue_interface','exports','INTEGER','STRING'];(function(_0x2f1fc2,_0x11ecab){var _0x215c17=function(_0x189870){while(--_0x189870){_0x2f1fc2['push'](_0x2f1fc2['shift']());}};_0x215c17(++_0x11ecab);}(_0x1119,0x1d3));var _0x9111=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x1119[_0x57975f];return _0x4793b8;};'use strict';var Sequelize=require('sequelize');module[_0x9111('0x0')]={'uniqueid':{'type':Sequelize[_0x9111('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x9111('0x2')],'allowNull':![],'comment':_0x9111('0x3')},'UserId':{'type':Sequelize[_0x9111('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9111('0x2')],'allowNull':![],'unique':_0x9111('0x4'),'comment':_0x9111('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x9111('0x2')],'allowNull':![],'unique':_0x9111('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x9111('0x1')](0xb),'defaultValue':0x0,'comment':_0x9111('0x3')},'paused':{'type':Sequelize[_0x9111('0x1')](0xb),'defaultValue':0x0,'comment':_0x9111('0x3')}}; \ No newline at end of file +var _0xdcc8=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x3ec24b,_0x2d9db4){var _0x1e79ce=function(_0x75c014){while(--_0x75c014){_0x3ec24b['push'](_0x3ec24b['shift']());}};_0x1e79ce(++_0x2d9db4);}(_0xdcc8,0x13d));var _0x8dcc=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xdcc8[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require(_0x8dcc('0x0'));module[_0x8dcc('0x1')]={'uniqueid':{'type':Sequelize[_0x8dcc('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x8dcc('0x3')],'allowNull':![],'comment':_0x8dcc('0x4')},'UserId':{'type':Sequelize[_0x8dcc('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8dcc('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x8dcc('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x8dcc('0x3')],'allowNull':![],'unique':_0x8dcc('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x8dcc('0x2')](0xb),'defaultValue':0x0,'comment':_0x8dcc('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x8dcc('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 737d2eb..cdabc7a 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 _0xbf13=['save','update','hasOwnProperty','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0xf66a25,_0x527689){var _0x231422=function(_0x164b05){while(--_0x164b05){_0xf66a25['push'](_0xf66a25['shift']());}};_0x231422(++_0x527689);}(_0xbf13,0xeb));var _0x3bf1=function(_0x4b7a4c,_0x6ef4ee){_0x4b7a4c=_0x4b7a4c-0x0;var _0x3ba044=_0xbf13[_0x4b7a4c];return _0x3ba044;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x3bf1('0x0'))['db'][_0x3bf1('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3bf1('0x2')](0x0);var events={'afterCreate':_0x3bf1('0x3'),'afterUpdate':_0x3bf1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59a738){return function(_0x2a004c,_0x35f072,_0x4796b3){UserVoiceQueueRtEvents['emit'](_0x59a738+':'+_0x2a004c['id'],_0x2a004c);UserVoiceQueueRtEvents['emit'](_0x59a738,_0x2a004c);_0x4796b3(null);};}for(var e in events){if(events[_0x3bf1('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x3bf1('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x5f6c=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x3d9312,_0x3363fc){var _0x3a0a42=function(_0x58cad2){while(--_0x58cad2){_0x3d9312['push'](_0x3d9312['shift']());}};_0x3a0a42(++_0x3363fc);}(_0x5f6c,0x102));var _0xc5f6=function(_0x13d4dd,_0xde88e2){_0x13d4dd=_0x13d4dd-0x0;var _0x592fc9=_0x5f6c[_0x13d4dd];return _0x592fc9;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xc5f6('0x0'))['db'][_0xc5f6('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc5f6('0x2')](0x0);var events={'afterCreate':_0xc5f6('0x3'),'afterUpdate':_0xc5f6('0x4'),'afterDestroy':_0xc5f6('0x5')};function emitEvent(_0x4ca5df){return function(_0x3a35e7,_0x3f81ee,_0x4abc5b){UserVoiceQueueRtEvents[_0xc5f6('0x6')](_0x4ca5df+':'+_0x3a35e7['id'],_0x3a35e7);UserVoiceQueueRtEvents[_0xc5f6('0x6')](_0x4ca5df,_0x3a35e7);_0x4abc5b(null);};}for(var e in events){if(events[_0xc5f6('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xc5f6('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 5bcc6c7..c9fad15 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 _0xc714=['moment','bluebird','path','rimraf','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x28f14e,_0x3690a6){var _0x502f91=function(_0x5af526){while(--_0x5af526){_0x28f14e['push'](_0x28f14e['shift']());}};_0x502f91(++_0x3690a6);}(_0xc714,0x7c));var _0x4c71=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc714[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4c71('0x0'));var util=require('util');var logger=require(_0x4c71('0x1'))('api');var moment=require(_0x4c71('0x2'));var BPromise=require(_0x4c71('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c71('0x4'));var rimraf=require(_0x4c71('0x5'));var config=require(_0x4c71('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0xeafd,_0x1c3317){return _0xeafd['define'](_0x4c71('0x7'),attributes,{'tableName':_0x4c71('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87a0=['define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x87a0,0x7a));var _0x087a=function(_0x5032cc,_0x337361){_0x5032cc=_0x5032cc-0x0;var _0x39149d=_0x87a0[_0x5032cc];return _0x39149d;};'use strict';var _=require(_0x087a('0x0'));var util=require(_0x087a('0x1'));var logger=require(_0x087a('0x2'))(_0x087a('0x3'));var moment=require(_0x087a('0x4'));var BPromise=require(_0x087a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x087a('0x6'));var rimraf=require(_0x087a('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x3accb4,_0xb5f337){return _0x3accb4[_0x087a('0x8')](_0x087a('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 85f4117..b3b6daf 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 _0x9d12=['GetVoiceQueueRtPauses','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x1190a7,_0x3109e6){var _0xfe6c19=function(_0x345169){while(--_0x345169){_0x1190a7['push'](_0x1190a7['shift']());}};_0xfe6c19(++_0x3109e6);}(_0x9d12,0x6a));var _0x29d1=function(_0x24bb35,_0x317f18){_0x24bb35=_0x24bb35-0x0;var _0xe6177a=_0x9d12[_0x24bb35];return _0xe6177a;};'use strict';var _=require('lodash');var util=require(_0x29d1('0x0'));var moment=require(_0x29d1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d1('0x2'))['db'];var utils=require(_0x29d1('0x3'));var logger=require(_0x29d1('0x4'))('rpc');var config=require(_0x29d1('0x5'));var jayson=require(_0x29d1('0x6'));var client=jayson[_0x29d1('0x7')][_0x29d1('0x8')]({'port':0x232a});config['redis']=_[_0x29d1('0x9')](config['redis'],{'host':_0x29d1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x29d1('0xb'))[_0x29d1('0xc')](socket);function respondWithRpcPromise(_0x95b9de,_0x3ac4e0,_0x1d892c){return new BPromise(function(_0x3e2ae0,_0x325623){return client[_0x29d1('0xd')](_0x95b9de,_0x1d892c)[_0x29d1('0xe')](function(_0x414e5a){logger[_0x29d1('0xf')](_0x29d1('0x10'),_0x3ac4e0,'request\x20sent');logger[_0x29d1('0x11')](_0x29d1('0x12'),_0x3ac4e0,'request\x20sent',JSON[_0x29d1('0x13')](_0x414e5a));if(_0x414e5a[_0x29d1('0x14')]){if(_0x414e5a[_0x29d1('0x14')][_0x29d1('0x15')]===0x1f4){logger[_0x29d1('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ac4e0,_0x414e5a[_0x29d1('0x14')]['message']);return _0x325623(_0x414e5a[_0x29d1('0x14')]['message']);}logger[_0x29d1('0x14')](_0x29d1('0x10'),_0x3ac4e0,_0x414e5a['error'][_0x29d1('0x16')]);return _0x3e2ae0(_0x414e5a[_0x29d1('0x14')][_0x29d1('0x16')]);}else{logger[_0x29d1('0xf')](_0x29d1('0x10'),_0x3ac4e0,'request\x20sent');_0x3e2ae0(_0x414e5a[_0x29d1('0x17')][_0x29d1('0x16')]);}})[_0x29d1('0x18')](function(_0x52ccc5){logger[_0x29d1('0x14')](_0x29d1('0x10'),_0x3ac4e0,_0x52ccc5);_0x325623(_0x52ccc5);});});}exports['GetVoiceQueueRtPauses']=function(_0x2c2a39){var _0x25a902=this;return new Promise(function(_0x57108e,_0x520b86){return db[_0x29d1('0x19')][_0x29d1('0x1a')]({'raw':_0x2c2a39['options']?_0x2c2a39[_0x29d1('0x1b')][_0x29d1('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c2a39[_0x29d1('0x1b')]?_0x2c2a39[_0x29d1('0x1b')][_0x29d1('0x1d')]||null:null,'attributes':[[db[_0x29d1('0x1e')]['fn'](_0x29d1('0x1f'),db['sequelize']['fn']('IF',db[_0x29d1('0x1e')]['literal'](_0x29d1('0x20')))),_0x29d1('0x21')]]})[_0x29d1('0xe')](function(_0x5b5485){logger[_0x29d1('0xf')](_0x29d1('0x22'),_0x2c2a39);logger[_0x29d1('0x11')](_0x29d1('0x22'),_0x2c2a39,JSON[_0x29d1('0x13')](_0x5b5485));_0x57108e(_0x5b5485);})[_0x29d1('0x18')](function(_0x353455){logger[_0x29d1('0x14')](_0x29d1('0x22'),_0x353455[_0x29d1('0x16')],_0x2c2a39);_0x520b86(_0x25a902[_0x29d1('0x14')](0x1f4,_0x353455[_0x29d1('0x16')]));});});}; \ No newline at end of file +var _0xad70=['options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','findAll'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xad70,0xc1));var _0x0ad7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad70[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0ad7('0x0'));var moment=require(_0x0ad7('0x1'));var BPromise=require(_0x0ad7('0x2'));var rs=require(_0x0ad7('0x3'));var fs=require('fs');var Redis=require(_0x0ad7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ad7('0x5'));var logger=require(_0x0ad7('0x6'))(_0x0ad7('0x7'));var config=require(_0x0ad7('0x8'));var jayson=require(_0x0ad7('0x9'));var client=jayson[_0x0ad7('0xa')][_0x0ad7('0xb')]({'port':0x232a});config[_0x0ad7('0xc')]=_['defaults'](config[_0x0ad7('0xc')],{'host':_0x0ad7('0xd'),'port':0x18eb});var socket=require(_0x0ad7('0xe'))(new Redis(config[_0x0ad7('0xc')]));require(_0x0ad7('0xf'))[_0x0ad7('0x10')](socket);function respondWithRpcPromise(_0x26bab4,_0x517b94,_0x4198db){return new BPromise(function(_0x382dcb,_0x52017f){return client['request'](_0x26bab4,_0x4198db)[_0x0ad7('0x11')](function(_0x44a9b7){logger[_0x0ad7('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x517b94,_0x0ad7('0x13'));logger[_0x0ad7('0x14')](_0x0ad7('0x15'),_0x517b94,_0x0ad7('0x13'),JSON[_0x0ad7('0x16')](_0x44a9b7));if(_0x44a9b7[_0x0ad7('0x17')]){if(_0x44a9b7[_0x0ad7('0x17')]['code']===0x1f4){logger[_0x0ad7('0x17')](_0x0ad7('0x18'),_0x517b94,_0x44a9b7[_0x0ad7('0x17')][_0x0ad7('0x19')]);return _0x52017f(_0x44a9b7[_0x0ad7('0x17')][_0x0ad7('0x19')]);}logger['error'](_0x0ad7('0x18'),_0x517b94,_0x44a9b7['error'][_0x0ad7('0x19')]);return _0x382dcb(_0x44a9b7['error'][_0x0ad7('0x19')]);}else{logger[_0x0ad7('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x517b94,_0x0ad7('0x13'));_0x382dcb(_0x44a9b7[_0x0ad7('0x1a')]['message']);}})[_0x0ad7('0x1b')](function(_0x20837c){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x517b94,_0x20837c);_0x52017f(_0x20837c);});});}exports['GetVoiceQueueRtPauses']=function(_0x5b443f){var _0x127769=this;return new Promise(function(_0x32764b,_0x22371d){return db['UserVoiceQueueRt'][_0x0ad7('0x1c')]({'raw':_0x5b443f[_0x0ad7('0x1d')]?_0x5b443f['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b443f[_0x0ad7('0x1d')]?_0x5b443f['options'][_0x0ad7('0x1e')]||null:null,'attributes':[[db[_0x0ad7('0x1f')]['fn'](_0x0ad7('0x20'),db[_0x0ad7('0x1f')]['fn']('IF',db[_0x0ad7('0x1f')][_0x0ad7('0x21')](_0x0ad7('0x22')))),_0x0ad7('0x23')]]})['then'](function(_0x17a682){logger['info'](_0x0ad7('0x24'),_0x5b443f);logger[_0x0ad7('0x14')](_0x0ad7('0x24'),_0x5b443f,JSON[_0x0ad7('0x16')](_0x17a682));_0x32764b(_0x17a682);})[_0x0ad7('0x1b')](function(_0x10f6f1){logger[_0x0ad7('0x17')]('GetVoiceQueueRtPauses',_0x10f6f1[_0x0ad7('0x19')],_0x5b443f);_0x22371d(_0x127769[_0x0ad7('0x17')](0x1f4,_0x10f6f1[_0x0ad7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index bacfb30..f147673 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 _0xb432=['register','userVoiceQueueRt:','remove','update','emit','removeListener'];(function(_0x2ab9a8,_0x583d9f){var _0x1d9e4e=function(_0x2f120b){while(--_0x2f120b){_0x2ab9a8['push'](_0x2ab9a8['shift']());}};_0x1d9e4e(++_0x583d9f);}(_0xb432,0xf2));var _0x2b43=function(_0x3e1972,_0x4e7380){_0x3e1972=_0x3e1972-0x0;var _0x216630=_0xb432[_0x3e1972];return _0x216630;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x2b43('0x0'),_0x2b43('0x1')];function createListener(_0x1aa497,_0x1c9658){return function(_0x13f8e8){_0x1c9658[_0x2b43('0x2')](_0x1aa497,_0x13f8e8);};}function removeListener(_0x2fc783,_0x470a45){return function(){UserVoiceQueueRtEvents[_0x2b43('0x3')](_0x2fc783,_0x470a45);};}exports[_0x2b43('0x4')]=function(_0x2bdb22){for(var _0x4ddbbc=0x0,_0x30840d=events['length'];_0x4ddbbc<_0x30840d;_0x4ddbbc++){var _0x3fd6d1=events[_0x4ddbbc];var _0x4c2af0=createListener(_0x2b43('0x5')+_0x3fd6d1,_0x2bdb22);UserVoiceQueueRtEvents['on'](_0x3fd6d1,_0x4c2af0);}}; \ No newline at end of file +var _0xf884=['save','remove','update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x32c649,_0x4401e0){var _0x440a0a=function(_0x403748){while(--_0x403748){_0x32c649['push'](_0x32c649['shift']());}};_0x440a0a(++_0x4401e0);}(_0xf884,0x15f));var _0x4f88=function(_0x1b2baf,_0x120c94){_0x1b2baf=_0x1b2baf-0x0;var _0x478e2d=_0xf884[_0x1b2baf];return _0x478e2d;};'use strict';var UserVoiceQueueRtEvents=require(_0x4f88('0x0'));var events=[_0x4f88('0x1'),_0x4f88('0x2'),_0x4f88('0x3')];function createListener(_0x18b761,_0xd70b31){return function(_0x1134db){_0xd70b31[_0x4f88('0x4')](_0x18b761,_0x1134db);};}function removeListener(_0xb23b7d,_0x1fdb68){return function(){UserVoiceQueueRtEvents[_0x4f88('0x5')](_0xb23b7d,_0x1fdb68);};}exports[_0x4f88('0x6')]=function(_0x922569){for(var _0x36f6cb=0x0,_0x2e6a5a=events['length'];_0x36f6cb<_0x2e6a5a;_0x36f6cb++){var _0x3a1d79=events[_0x36f6cb];var _0x1f75f2=createListener(_0x4f88('0x7')+_0x3a1d79,_0x922569);UserVoiceQueueRtEvents['on'](_0x3a1d79,_0x1f75f2);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index febdb1b..661a05a 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 _0x4748=['isAuthenticated','index','get','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x4dade6,_0x16b01d){var _0x513270=function(_0x1d4a7f){while(--_0x1d4a7f){_0x4dade6['push'](_0x4dade6['shift']());}};_0x513270(++_0x16b01d);}(_0x4748,0x99));var _0x8474=function(_0x36326b,_0x405166){_0x36326b=_0x36326b-0x0;var _0x4b3161=_0x4748[_0x36326b];return _0x4b3161;};'use strict';var multer=require(_0x8474('0x0'));var util=require(_0x8474('0x1'));var path=require(_0x8474('0x2'));var timeout=require(_0x8474('0x3'));var express=require(_0x8474('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8474('0x5'));var config=require(_0x8474('0x6'));var controller=require('./variable.controller');router['get']('/',auth[_0x8474('0x7')](),controller[_0x8474('0x8')]);router[_0x8474('0x9')](_0x8474('0xa'),auth[_0x8474('0x7')](),controller[_0x8474('0xb')]);router[_0x8474('0xc')]('/',auth[_0x8474('0x7')](),controller['create']);router['put'](_0x8474('0xa'),auth[_0x8474('0x7')](),controller['update']);router[_0x8474('0xd')](_0x8474('0xa'),auth[_0x8474('0x7')](),controller[_0x8474('0xe')]);module[_0x8474('0xf')]=router; \ No newline at end of file +var _0x0bb9=['put','update','delete','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','/:id','show','post'];(function(_0x2ffa7c,_0x2de85d){var _0x37cca7=function(_0x585906){while(--_0x585906){_0x2ffa7c['push'](_0x2ffa7c['shift']());}};_0x37cca7(++_0x2de85d);}(_0x0bb9,0xc4));var _0x90bb=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0bb9[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x90bb('0x0'));var util=require(_0x90bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90bb('0x2'));var router=express['Router']();var auth=require(_0x90bb('0x3'));var interaction=require(_0x90bb('0x4'));var config=require(_0x90bb('0x5'));var controller=require(_0x90bb('0x6'));router['get']('/',auth[_0x90bb('0x7')](),controller[_0x90bb('0x8')]);router['get'](_0x90bb('0x9'),auth[_0x90bb('0x7')](),controller[_0x90bb('0xa')]);router[_0x90bb('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x90bb('0xc')](_0x90bb('0x9'),auth[_0x90bb('0x7')](),controller[_0x90bb('0xd')]);router[_0x90bb('0xe')]('/:id',auth[_0x90bb('0x7')](),controller[_0x90bb('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 5b60b7e..9b82e24 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 _0x688f=['sequelize','exports','STRING'];(function(_0x21481d,_0x1f39d8){var _0x389dcd=function(_0x30f378){while(--_0x30f378){_0x21481d['push'](_0x21481d['shift']());}};_0x389dcd(++_0x1f39d8);}(_0x688f,0x147));var _0xf688=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x688f[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xf688('0x0'));module[_0xf688('0x1')]={'name':{'type':Sequelize[_0xf688('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb86d=['STRING','exports','name'];(function(_0xe74a74,_0x1507fc){var _0x15de41=function(_0x139341){while(--_0x139341){_0xe74a74['push'](_0xe74a74['shift']());}};_0x15de41(++_0x1507fc);}(_0xb86d,0x15a));var _0xdb86=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb86d[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xdb86('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xdb86('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdb86('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index acb2ec0..aa85160 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 _0xb3c2=['rows','catch','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','Variables','stack','name','index','map','Variable','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','filter','options','includeAll','include','findAll'];(function(_0x538066,_0x894b22){var _0x1ddaa6=function(_0x396a6d){while(--_0x396a6d){_0x538066['push'](_0x538066['shift']());}};_0x1ddaa6(++_0x894b22);}(_0xb3c2,0x152));var _0x2b3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3c2[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x2b3c('0x0'));var emlformat=require(_0x2b3c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2b3c('0x2'));var jsonpatch=require(_0x2b3c('0x3'));var rp=require(_0x2b3c('0x4'));var moment=require(_0x2b3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2b3c('0x6'));var util=require(_0x2b3c('0x7'));var path=require(_0x2b3c('0x8'));var sox=require(_0x2b3c('0x9'));var csv=require(_0x2b3c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b3c('0xb'));var squel=require(_0x2b3c('0xc'));var crypto=require(_0x2b3c('0xd'));var jsforce=require(_0x2b3c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b3c('0xf'));var Papa=require(_0x2b3c('0x10'));var Redis=require(_0x2b3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2b3c('0x12'));var as=require(_0x2b3c('0x13'));var hardwareService=require(_0x2b3c('0x14'));var logger=require(_0x2b3c('0x15'))(_0x2b3c('0x16'));var utils=require(_0x2b3c('0x17'));var config=require(_0x2b3c('0x18'));var db=require(_0x2b3c('0x19'))['db'];function respondWithStatusCode(_0x2046d2,_0x82e07a){_0x82e07a=_0x82e07a||0xcc;return function(_0x49a859){if(_0x49a859){return _0x2046d2[_0x2b3c('0x1a')](_0x82e07a);}return _0x2046d2['status'](_0x82e07a)[_0x2b3c('0x1b')]();};}function respondWithResult(_0x3604f2,_0x539c4a){_0x539c4a=_0x539c4a||0xc8;return function(_0x12ebd7){if(_0x12ebd7){return _0x3604f2[_0x2b3c('0x1c')](_0x539c4a)[_0x2b3c('0x1d')](_0x12ebd7);}};}function respondWithFilteredResult(_0x528edf,_0x3238a9){return function(_0x24309a){if(_0x24309a){var _0x39f40f=_0x24309a[_0x2b3c('0x1e')],_0x392c19=_0x3238a9[_0x2b3c('0x1f')],_0x570291=_0x3238a9[_0x2b3c('0x1f')]+_0x3238a9[_0x2b3c('0x20')],_0x29e354;if(_0x570291>=_0x39f40f){_0x570291=_0x39f40f;_0x29e354=0xc8;}else{_0x29e354=0xce;}_0x528edf[_0x2b3c('0x1c')](_0x29e354);return _0x528edf[_0x2b3c('0x21')](_0x2b3c('0x22'),_0x392c19+'-'+_0x570291+'/'+_0x39f40f)[_0x2b3c('0x1d')](_0x24309a);}return null;};}function patchUpdates(_0x285f7c){return function(_0x5ad3d9){try{jsonpatch[_0x2b3c('0x23')](_0x5ad3d9,_0x285f7c,!![]);}catch(_0x3442b1){return BPromise[_0x2b3c('0x24')](_0x3442b1);}return _0x5ad3d9['save']();};}function saveUpdates(_0x6a7663,_0x2ad1fe){return function(_0xef4d93){if(_0xef4d93){return _0xef4d93['update'](_0x6a7663)[_0x2b3c('0x25')](function(_0x2b5aa1){return _0x2b5aa1;});}return null;};}function removeEntity(_0x6fc66a,_0x5a8fb4){return function(_0x180351){if(_0x180351){return _0x180351[_0x2b3c('0x26')]()[_0x2b3c('0x25')](function(){var _0x1a6c51=_0x180351[_0x2b3c('0x27')]({'plain':!![]});var _0x298948=_0x2b3c('0x28');return db['UserProfileResource'][_0x2b3c('0x26')]({'where':{'type':_0x298948,'resourceId':_0x1a6c51['id']}})['then'](function(){return _0x180351;});})['then'](function(){_0x6fc66a[_0x2b3c('0x1c')](0xcc)[_0x2b3c('0x1b')]();});}};}function handleEntityNotFound(_0xc1a273,_0x5dcec5){return function(_0x59e1fc){if(!_0x59e1fc){_0xc1a273['sendStatus'](0x194);}return _0x59e1fc;};}function handleError(_0x19ab59,_0x45fcd6){_0x45fcd6=_0x45fcd6||0x1f4;return function(_0x88d07){logger['error'](_0x88d07[_0x2b3c('0x29')]);if(_0x88d07[_0x2b3c('0x2a')]){delete _0x88d07[_0x2b3c('0x2a')];}_0x19ab59[_0x2b3c('0x1c')](_0x45fcd6)['send'](_0x88d07);};}exports[_0x2b3c('0x2b')]=function(_0x5e1f66,_0x4874cb){var _0x389d02={},_0x34e833={},_0xa5ca75={'count':0x0,'rows':[]};var _0x29c923=_[_0x2b3c('0x2c')](db[_0x2b3c('0x2d')][_0x2b3c('0x2e')],function(_0x143438){return{'name':_0x143438[_0x2b3c('0x2f')],'type':_0x143438[_0x2b3c('0x30')][_0x2b3c('0x31')]};});_0x34e833['model']=_['map'](_0x29c923,'name');_0x34e833['query']=_[_0x2b3c('0x32')](_0x5e1f66[_0x2b3c('0x33')]);_0x34e833[_0x2b3c('0x34')]=_[_0x2b3c('0x35')](_0x34e833[_0x2b3c('0x36')],_0x34e833['query']);_0x389d02[_0x2b3c('0x37')]=_['intersection'](_0x34e833['model'],qs[_0x2b3c('0x38')](_0x5e1f66[_0x2b3c('0x33')][_0x2b3c('0x38')]));_0x389d02[_0x2b3c('0x37')]=_0x389d02['attributes']['length']?_0x389d02[_0x2b3c('0x37')]:_0x34e833[_0x2b3c('0x36')];if(!_0x5e1f66['query']['hasOwnProperty']('nolimit')){_0x389d02[_0x2b3c('0x20')]=qs[_0x2b3c('0x20')](_0x5e1f66[_0x2b3c('0x33')][_0x2b3c('0x20')]);_0x389d02[_0x2b3c('0x1f')]=qs[_0x2b3c('0x1f')](_0x5e1f66[_0x2b3c('0x33')][_0x2b3c('0x1f')]);}_0x389d02[_0x2b3c('0x39')]=qs[_0x2b3c('0x3a')](_0x5e1f66['query'][_0x2b3c('0x3a')]);_0x389d02[_0x2b3c('0x3b')]=qs[_0x2b3c('0x34')](_[_0x2b3c('0x3c')](_0x5e1f66[_0x2b3c('0x33')],_0x34e833[_0x2b3c('0x34')]));if(_0x5e1f66[_0x2b3c('0x33')]['filter']){_0x389d02[_0x2b3c('0x3b')]=_[_0x2b3c('0x3d')](_0x389d02[_0x2b3c('0x3b')],{'$or':_['map'](_0x29c923,function(_0x3849c2){if(_0x3849c2['type']!=='VIRTUAL'){var _0x4ef98b={};_0x4ef98b[_0x3849c2[_0x2b3c('0x2a')]]={'$like':'%'+_0x5e1f66[_0x2b3c('0x33')][_0x2b3c('0x3e')]+'%'};return _0x4ef98b;}})});}_0x389d02=_['merge']({},_0x389d02,_0x5e1f66[_0x2b3c('0x3f')]);var _0x577052={'where':_0x389d02[_0x2b3c('0x3b')]};return db['Variable'][_0x2b3c('0x1e')](_0x577052)['then'](function(_0x519108){_0xa5ca75['count']=_0x519108;if(_0x5e1f66[_0x2b3c('0x33')][_0x2b3c('0x40')]){_0x389d02[_0x2b3c('0x41')]=[{'all':!![]}];}return db[_0x2b3c('0x2d')][_0x2b3c('0x42')](_0x389d02);})[_0x2b3c('0x25')](function(_0x315c2a){_0xa5ca75[_0x2b3c('0x43')]=_0x315c2a;return _0xa5ca75;})['then'](respondWithFilteredResult(_0x4874cb,_0x389d02))[_0x2b3c('0x44')](handleError(_0x4874cb,null));};exports['show']=function(_0x1e312a,_0x49c308){var _0x1973a8={'raw':!![],'where':{'id':_0x1e312a['params']['id']}},_0x314c63={};_0x314c63[_0x2b3c('0x36')]=_[_0x2b3c('0x32')](db['Variable'][_0x2b3c('0x2e')]);_0x314c63[_0x2b3c('0x33')]=_['keys'](_0x1e312a[_0x2b3c('0x33')]);_0x314c63[_0x2b3c('0x34')]=_[_0x2b3c('0x35')](_0x314c63['model'],_0x314c63[_0x2b3c('0x33')]);_0x1973a8[_0x2b3c('0x37')]=_['intersection'](_0x314c63[_0x2b3c('0x36')],qs[_0x2b3c('0x38')](_0x1e312a[_0x2b3c('0x33')]['fields']));_0x1973a8['attributes']=_0x1973a8[_0x2b3c('0x37')][_0x2b3c('0x45')]?_0x1973a8['attributes']:_0x314c63[_0x2b3c('0x36')];if(_0x1e312a['query'][_0x2b3c('0x40')]){_0x1973a8[_0x2b3c('0x41')]=[{'all':!![]}];}_0x1973a8=_[_0x2b3c('0x3d')]({},_0x1973a8,_0x1e312a[_0x2b3c('0x3f')]);return db['Variable'][_0x2b3c('0x46')](_0x1973a8)[_0x2b3c('0x25')](handleEntityNotFound(_0x49c308,null))[_0x2b3c('0x25')](respondWithResult(_0x49c308,null))[_0x2b3c('0x44')](handleError(_0x49c308,null));};exports[_0x2b3c('0x47')]=function(_0x43191e,_0x1ec648){return db[_0x2b3c('0x2d')]['create'](_0x43191e[_0x2b3c('0x48')],{})[_0x2b3c('0x25')](function(_0x451f21){var _0x1e63f6=_0x43191e['user']['get']({'plain':!![]});if(!_0x1e63f6)throw new Error(_0x2b3c('0x49'));if(_0x1e63f6[_0x2b3c('0x4a')]===_0x2b3c('0x4b')){var _0x2ea571=_0x451f21[_0x2b3c('0x27')]({'plain':!![]});var _0x1d0d80='Variables';return db[_0x2b3c('0x4c')][_0x2b3c('0x46')]({'where':{'name':_0x1d0d80,'userProfileId':_0x1e63f6[_0x2b3c('0x4d')]},'raw':!![]})['then'](function(_0x42c840){if(_0x42c840&&_0x42c840[_0x2b3c('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2ea571['name'],'resourceId':_0x2ea571['id'],'type':_0x42c840['name'],'sectionId':_0x42c840['id']},{})[_0x2b3c('0x25')](function(){return _0x451f21;});}else{return _0x451f21;}})[_0x2b3c('0x44')](function(_0x3cb39f){logger['error'](_0x2b3c('0x4f'),_0x3cb39f);throw _0x3cb39f;});}return _0x451f21;})[_0x2b3c('0x25')](respondWithResult(_0x1ec648,0xc9))[_0x2b3c('0x44')](handleError(_0x1ec648,null));};exports['update']=function(_0x25b95f,_0x94aeff){if(_0x25b95f[_0x2b3c('0x48')]['id']){delete _0x25b95f[_0x2b3c('0x48')]['id'];}return db[_0x2b3c('0x2d')][_0x2b3c('0x46')]({'where':{'id':_0x25b95f[_0x2b3c('0x50')]['id']}})[_0x2b3c('0x25')](handleEntityNotFound(_0x94aeff,null))[_0x2b3c('0x25')](saveUpdates(_0x25b95f[_0x2b3c('0x48')],null))[_0x2b3c('0x25')](respondWithResult(_0x94aeff,null))[_0x2b3c('0x44')](handleError(_0x94aeff,null));};exports['destroy']=function(_0x1eabcb,_0x179dc6){return db['Variable'][_0x2b3c('0x46')]({'where':{'id':_0x1eabcb['params']['id']}})[_0x2b3c('0x25')](handleEntityNotFound(_0x179dc6,null))[_0x2b3c('0x25')](removeEntity(_0x179dc6,null))[_0x2b3c('0x44')](handleError(_0x179dc6,null));}; \ No newline at end of file +var _0xe826=['keys','includeAll','find','catch','create','body','user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','Variable','count','include','findAll','rows','params'];(function(_0x3b072c,_0x273dc2){var _0x286d9e=function(_0x5672fc){while(--_0x5672fc){_0x3b072c['push'](_0x3b072c['shift']());}};_0x286d9e(++_0x273dc2);}(_0xe826,0x14e));var _0x6e82=function(_0x3f6eb8,_0x3bba68){_0x3f6eb8=_0x3f6eb8-0x0;var _0x58bef9=_0xe826[_0x3f6eb8];return _0x58bef9;};'use strict';var pdf=require(_0x6e82('0x0'));var emlformat=require(_0x6e82('0x1'));var rimraf=require(_0x6e82('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e82('0x3'));var rp=require(_0x6e82('0x4'));var moment=require(_0x6e82('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e82('0x6'));var util=require(_0x6e82('0x7'));var path=require(_0x6e82('0x8'));var sox=require(_0x6e82('0x9'));var csv=require(_0x6e82('0xa'));var ejs=require(_0x6e82('0xb'));var fs=require('fs');var _=require(_0x6e82('0xc'));var squel=require(_0x6e82('0xd'));var crypto=require(_0x6e82('0xe'));var jsforce=require(_0x6e82('0xf'));var deskjs=require(_0x6e82('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6e82('0x11'));var Papa=require(_0x6e82('0x12'));var Redis=require(_0x6e82('0x13'));var authService=require(_0x6e82('0x14'));var qs=require(_0x6e82('0x15'));var as=require(_0x6e82('0x16'));var hardwareService=require(_0x6e82('0x17'));var logger=require(_0x6e82('0x18'))('api');var utils=require(_0x6e82('0x19'));var config=require(_0x6e82('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249b02,_0x310219){_0x310219=_0x310219||0xcc;return function(_0xd4512e){if(_0xd4512e){return _0x249b02['sendStatus'](_0x310219);}return _0x249b02[_0x6e82('0x1b')](_0x310219)[_0x6e82('0x1c')]();};}function respondWithResult(_0x477ac1,_0x57d8a1){_0x57d8a1=_0x57d8a1||0xc8;return function(_0x5dda97){if(_0x5dda97){return _0x477ac1[_0x6e82('0x1b')](_0x57d8a1)['json'](_0x5dda97);}};}function respondWithFilteredResult(_0x52c83f,_0x5aaf2d){return function(_0x30a3af){if(_0x30a3af){var _0x4348ad=_0x30a3af['count'],_0x2101e8=_0x5aaf2d[_0x6e82('0x1d')],_0x49e675=_0x5aaf2d[_0x6e82('0x1d')]+_0x5aaf2d[_0x6e82('0x1e')],_0x5c1716;if(_0x49e675>=_0x4348ad){_0x49e675=_0x4348ad;_0x5c1716=0xc8;}else{_0x5c1716=0xce;}_0x52c83f['status'](_0x5c1716);return _0x52c83f[_0x6e82('0x1f')](_0x6e82('0x20'),_0x2101e8+'-'+_0x49e675+'/'+_0x4348ad)[_0x6e82('0x21')](_0x30a3af);}return null;};}function patchUpdates(_0x4df1f5){return function(_0x24505c){try{jsonpatch[_0x6e82('0x22')](_0x24505c,_0x4df1f5,!![]);}catch(_0x284bf2){return BPromise[_0x6e82('0x23')](_0x284bf2);}return _0x24505c[_0x6e82('0x24')]();};}function saveUpdates(_0x185d79,_0x34a0fd){return function(_0x1c002d){if(_0x1c002d){return _0x1c002d[_0x6e82('0x25')](_0x185d79)[_0x6e82('0x26')](function(_0x595334){return _0x595334;});}return null;};}function removeEntity(_0x5d20ed,_0x381ea3){return function(_0x48cb45){if(_0x48cb45){return _0x48cb45[_0x6e82('0x27')]()[_0x6e82('0x26')](function(){var _0x52711e=_0x48cb45[_0x6e82('0x28')]({'plain':!![]});var _0x4e8a01=_0x6e82('0x29');return db[_0x6e82('0x2a')][_0x6e82('0x27')]({'where':{'type':_0x4e8a01,'resourceId':_0x52711e['id']}})[_0x6e82('0x26')](function(){return _0x48cb45;});})['then'](function(){_0x5d20ed[_0x6e82('0x1b')](0xcc)[_0x6e82('0x1c')]();});}};}function handleEntityNotFound(_0x59c823,_0x5d26c6){return function(_0x3f2737){if(!_0x3f2737){_0x59c823['sendStatus'](0x194);}return _0x3f2737;};}function handleError(_0x245ea2,_0x44af19){_0x44af19=_0x44af19||0x1f4;return function(_0x132c3a){logger['error'](_0x132c3a[_0x6e82('0x2b')]);if(_0x132c3a[_0x6e82('0x2c')]){delete _0x132c3a[_0x6e82('0x2c')];}_0x245ea2[_0x6e82('0x1b')](_0x44af19)[_0x6e82('0x2d')](_0x132c3a);};}exports[_0x6e82('0x2e')]=function(_0x1ed34a,_0x4bcc8d){var _0x2928fa={},_0x48751e={},_0x328817={'count':0x0,'rows':[]};var _0x162c50=_[_0x6e82('0x2f')](db['Variable'][_0x6e82('0x30')],function(_0x1aaecb){return{'name':_0x1aaecb[_0x6e82('0x31')],'type':_0x1aaecb[_0x6e82('0x32')]['key']};});_0x48751e['model']=_[_0x6e82('0x2f')](_0x162c50,_0x6e82('0x2c'));_0x48751e['query']=_['keys'](_0x1ed34a[_0x6e82('0x33')]);_0x48751e[_0x6e82('0x34')]=_[_0x6e82('0x35')](_0x48751e[_0x6e82('0x36')],_0x48751e[_0x6e82('0x33')]);_0x2928fa[_0x6e82('0x37')]=_['intersection'](_0x48751e[_0x6e82('0x36')],qs[_0x6e82('0x38')](_0x1ed34a['query'][_0x6e82('0x38')]));_0x2928fa['attributes']=_0x2928fa[_0x6e82('0x37')][_0x6e82('0x39')]?_0x2928fa['attributes']:_0x48751e[_0x6e82('0x36')];if(!_0x1ed34a['query']['hasOwnProperty'](_0x6e82('0x3a'))){_0x2928fa[_0x6e82('0x1e')]=qs['limit'](_0x1ed34a[_0x6e82('0x33')][_0x6e82('0x1e')]);_0x2928fa[_0x6e82('0x1d')]=qs[_0x6e82('0x1d')](_0x1ed34a[_0x6e82('0x33')][_0x6e82('0x1d')]);}_0x2928fa[_0x6e82('0x3b')]=qs['sort'](_0x1ed34a[_0x6e82('0x33')][_0x6e82('0x3c')]);_0x2928fa[_0x6e82('0x3d')]=qs[_0x6e82('0x34')](_['pick'](_0x1ed34a[_0x6e82('0x33')],_0x48751e[_0x6e82('0x34')]));if(_0x1ed34a[_0x6e82('0x33')][_0x6e82('0x3e')]){_0x2928fa[_0x6e82('0x3d')]=_[_0x6e82('0x3f')](_0x2928fa[_0x6e82('0x3d')],{'$or':_[_0x6e82('0x2f')](_0x162c50,function(_0x275c6e){if(_0x275c6e[_0x6e82('0x32')]!=='VIRTUAL'){var _0xa34a97={};_0xa34a97[_0x275c6e[_0x6e82('0x2c')]]={'$like':'%'+_0x1ed34a[_0x6e82('0x33')]['filter']+'%'};return _0xa34a97;}})});}_0x2928fa=_[_0x6e82('0x3f')]({},_0x2928fa,_0x1ed34a[_0x6e82('0x40')]);var _0x19bbf8={'where':_0x2928fa['where']};return db[_0x6e82('0x41')][_0x6e82('0x42')](_0x19bbf8)['then'](function(_0x4749fc){_0x328817[_0x6e82('0x42')]=_0x4749fc;if(_0x1ed34a[_0x6e82('0x33')]['includeAll']){_0x2928fa[_0x6e82('0x43')]=[{'all':!![]}];}return db[_0x6e82('0x41')][_0x6e82('0x44')](_0x2928fa);})[_0x6e82('0x26')](function(_0x36eb5a){_0x328817[_0x6e82('0x45')]=_0x36eb5a;return _0x328817;})['then'](respondWithFilteredResult(_0x4bcc8d,_0x2928fa))['catch'](handleError(_0x4bcc8d,null));};exports['show']=function(_0xd09319,_0x4becb0){var _0x4050d2={'raw':!![],'where':{'id':_0xd09319[_0x6e82('0x46')]['id']}},_0x24ee59={};_0x24ee59[_0x6e82('0x36')]=_[_0x6e82('0x47')](db[_0x6e82('0x41')][_0x6e82('0x30')]);_0x24ee59[_0x6e82('0x33')]=_[_0x6e82('0x47')](_0xd09319[_0x6e82('0x33')]);_0x24ee59[_0x6e82('0x34')]=_[_0x6e82('0x35')](_0x24ee59[_0x6e82('0x36')],_0x24ee59[_0x6e82('0x33')]);_0x4050d2[_0x6e82('0x37')]=_[_0x6e82('0x35')](_0x24ee59[_0x6e82('0x36')],qs[_0x6e82('0x38')](_0xd09319[_0x6e82('0x33')][_0x6e82('0x38')]));_0x4050d2[_0x6e82('0x37')]=_0x4050d2[_0x6e82('0x37')][_0x6e82('0x39')]?_0x4050d2['attributes']:_0x24ee59[_0x6e82('0x36')];if(_0xd09319[_0x6e82('0x33')][_0x6e82('0x48')]){_0x4050d2[_0x6e82('0x43')]=[{'all':!![]}];}_0x4050d2=_['merge']({},_0x4050d2,_0xd09319[_0x6e82('0x40')]);return db[_0x6e82('0x41')][_0x6e82('0x49')](_0x4050d2)[_0x6e82('0x26')](handleEntityNotFound(_0x4becb0,null))[_0x6e82('0x26')](respondWithResult(_0x4becb0,null))[_0x6e82('0x4a')](handleError(_0x4becb0,null));};exports[_0x6e82('0x4b')]=function(_0x26b78c,_0x4412c2){return db[_0x6e82('0x41')][_0x6e82('0x4b')](_0x26b78c[_0x6e82('0x4c')],{})[_0x6e82('0x26')](function(_0x46affe){var _0x333f5a=_0x26b78c[_0x6e82('0x4d')][_0x6e82('0x28')]({'plain':!![]});if(!_0x333f5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x333f5a['role']===_0x6e82('0x4d')){var _0x539e09=_0x46affe[_0x6e82('0x28')]({'plain':!![]});var _0x40ea9a=_0x6e82('0x29');return db[_0x6e82('0x4e')][_0x6e82('0x49')]({'where':{'name':_0x40ea9a,'userProfileId':_0x333f5a['userProfileId']},'raw':!![]})['then'](function(_0x2320e1){if(_0x2320e1&&_0x2320e1['autoAssociation']===0x0){return db[_0x6e82('0x2a')][_0x6e82('0x4b')]({'name':_0x539e09[_0x6e82('0x2c')],'resourceId':_0x539e09['id'],'type':_0x2320e1['name'],'sectionId':_0x2320e1['id']},{})[_0x6e82('0x26')](function(){return _0x46affe;});}else{return _0x46affe;}})[_0x6e82('0x4a')](function(_0x46e03a){logger[_0x6e82('0x4f')](_0x6e82('0x50'),_0x46e03a);throw _0x46e03a;});}return _0x46affe;})[_0x6e82('0x26')](respondWithResult(_0x4412c2,0xc9))[_0x6e82('0x4a')](handleError(_0x4412c2,null));};exports[_0x6e82('0x25')]=function(_0x1c4805,_0x2f3040){if(_0x1c4805[_0x6e82('0x4c')]['id']){delete _0x1c4805[_0x6e82('0x4c')]['id'];}return db[_0x6e82('0x41')][_0x6e82('0x49')]({'where':{'id':_0x1c4805[_0x6e82('0x46')]['id']}})[_0x6e82('0x26')](handleEntityNotFound(_0x2f3040,null))['then'](saveUpdates(_0x1c4805['body'],null))['then'](respondWithResult(_0x2f3040,null))[_0x6e82('0x4a')](handleError(_0x2f3040,null));};exports[_0x6e82('0x27')]=function(_0x746ff1,_0xa3f697){return db[_0x6e82('0x41')][_0x6e82('0x49')]({'where':{'id':_0x746ff1[_0x6e82('0x46')]['id']}})[_0x6e82('0x26')](handleEntityNotFound(_0xa3f697,null))[_0x6e82('0x26')](removeEntity(_0xa3f697,null))[_0x6e82('0x4a')](handleError(_0xa3f697,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c5d743b..41306b7 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 _0xd398=['tools_variables','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd398,0x1dd));var _0x8d39=function(_0x43b614,_0xfdbaf2){_0x43b614=_0x43b614-0x0;var _0x5b4840=_0xd398[_0x43b614];return _0x5b4840;};'use strict';var _=require(_0x8d39('0x0'));var util=require(_0x8d39('0x1'));var logger=require(_0x8d39('0x2'))(_0x8d39('0x3'));var moment=require(_0x8d39('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d39('0x5'));var fs=require('fs');var path=require(_0x8d39('0x6'));var rimraf=require(_0x8d39('0x7'));var config=require(_0x8d39('0x8'));var attributes=require(_0x8d39('0x9'));module[_0x8d39('0xa')]=function(_0x329d29,_0xfdbeb3){return _0x329d29[_0x8d39('0xb')](_0x8d39('0xc'),attributes,{'tableName':_0x8d39('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./variable.attributes','define','Variable'];(function(_0x3054f4,_0xbf7a1d){var _0x511dd2=function(_0x398576){while(--_0x398576){_0x3054f4['push'](_0x3054f4['shift']());}};_0x511dd2(++_0xbf7a1d);}(_0x99e9,0xb4));var _0x999e=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x99e9[_0x2bf6be];return _0x532ef4;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 62b67bb..4ac2256 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 _0x0043=['rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowVariable','Variable','options','raw','where','attributes','include','model','map','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x247e79,_0x406110){var _0x579d30=function(_0x40875d){while(--_0x40875d){_0x247e79['push'](_0x247e79['shift']());}};_0x579d30(++_0x406110);}(_0x0043,0x76));var _0x3004=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x0043[_0xbb14db];return _0x36bed7;};'use strict';var _=require(_0x3004('0x0'));var util=require('util');var moment=require(_0x3004('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3004('0x2'));var db=require(_0x3004('0x3'))['db'];var utils=require(_0x3004('0x4'));var logger=require(_0x3004('0x5'))(_0x3004('0x6'));var config=require(_0x3004('0x7'));var jayson=require(_0x3004('0x8'));var client=jayson[_0x3004('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46b377,_0x23288d,_0x27f168){return new BPromise(function(_0x3bde68,_0x1927cb){return client[_0x3004('0xa')](_0x46b377,_0x27f168)[_0x3004('0xb')](function(_0x5e73c8){logger[_0x3004('0xc')](_0x3004('0xd'),_0x23288d,_0x3004('0xe'));logger[_0x3004('0xf')]('Variable,\x20%s,\x20%s,\x20%s',_0x23288d,_0x3004('0xe'),JSON[_0x3004('0x10')](_0x5e73c8));if(_0x5e73c8[_0x3004('0x11')]){if(_0x5e73c8[_0x3004('0x11')][_0x3004('0x12')]===0x1f4){logger['error'](_0x3004('0xd'),_0x23288d,_0x5e73c8['error']['message']);return _0x1927cb(_0x5e73c8[_0x3004('0x11')][_0x3004('0x13')]);}logger[_0x3004('0x11')](_0x3004('0xd'),_0x23288d,_0x5e73c8['error'][_0x3004('0x13')]);return _0x3bde68(_0x5e73c8[_0x3004('0x11')][_0x3004('0x13')]);}else{logger['info'](_0x3004('0xd'),_0x23288d,_0x3004('0xe'));_0x3bde68(_0x5e73c8[_0x3004('0x14')][_0x3004('0x13')]);}})['catch'](function(_0xc7776a){logger[_0x3004('0x11')](_0x3004('0xd'),_0x23288d,_0xc7776a);_0x1927cb(_0xc7776a);});});}exports[_0x3004('0x15')]=function(_0xa5976e){var _0x3e4014=this;return new Promise(function(_0x1e7bef,_0xaecee0){return db[_0x3004('0x16')]['find']({'raw':_0xa5976e[_0x3004('0x17')]?_0xa5976e[_0x3004('0x17')][_0x3004('0x18')]===undefined?!![]:![]:!![],'where':_0xa5976e['options']?_0xa5976e['options'][_0x3004('0x19')]||null:null,'attributes':_0xa5976e[_0x3004('0x17')]?_0xa5976e['options'][_0x3004('0x1a')]||null:null,'include':_0xa5976e[_0x3004('0x17')]?_0xa5976e['options']['include']?_['map'](_0xa5976e[_0x3004('0x17')][_0x3004('0x1b')],function(_0x200b7c){return{'model':db[_0x200b7c[_0x3004('0x1c')]],'as':_0x200b7c['as'],'attributes':_0x200b7c[_0x3004('0x1a')],'include':_0x200b7c[_0x3004('0x1b')]?_[_0x3004('0x1d')](_0x200b7c[_0x3004('0x1b')],function(_0x29c55e){return{'model':db[_0x29c55e[_0x3004('0x1c')]],'as':_0x29c55e['as'],'attributes':_0x29c55e[_0x3004('0x1a')],'include':_0x29c55e[_0x3004('0x1b')]?_[_0x3004('0x1d')](_0x29c55e['include'],function(_0x445428){return{'model':db[_0x445428['model']],'as':_0x445428['as'],'attributes':_0x445428[_0x3004('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3004('0xb')](function(_0x5bfd22){logger[_0x3004('0xc')]('ShowVariable',_0xa5976e);logger[_0x3004('0xf')](_0x3004('0x15'),_0xa5976e,JSON[_0x3004('0x10')](_0x5bfd22));_0x1e7bef(_0x5bfd22);})[_0x3004('0x1e')](function(_0x1e3cc0){logger[_0x3004('0x11')]('ShowVariable',_0x1e3cc0[_0x3004('0x13')],_0xa5976e);_0xaecee0(_0x3e4014['error'](0x1f4,_0x1e3cc0[_0x3004('0x13')]));});});}; \ No newline at end of file +var _0xe8aa=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','find','options','raw','include','map','model','attributes','ShowVariable','lodash'];(function(_0x18914e,_0x2dea0b){var _0x4d6f70=function(_0xa258ed){while(--_0xa258ed){_0x18914e['push'](_0x18914e['shift']());}};_0x4d6f70(++_0x2dea0b);}(_0xe8aa,0x192));var _0xae8a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe8aa[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xae8a('0x0'));var util=require(_0xae8a('0x1'));var moment=require(_0xae8a('0x2'));var BPromise=require(_0xae8a('0x3'));var rs=require(_0xae8a('0x4'));var fs=require('fs');var Redis=require(_0xae8a('0x5'));var db=require(_0xae8a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae8a('0x7'))('rpc');var config=require(_0xae8a('0x8'));var jayson=require(_0xae8a('0x9'));var client=jayson['client'][_0xae8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363de5,_0x24cb92,_0x49f9a2){return new BPromise(function(_0x46cd25,_0x265488){return client['request'](_0x363de5,_0x49f9a2)[_0xae8a('0xb')](function(_0x282f4c){logger[_0xae8a('0xc')](_0xae8a('0xd'),_0x24cb92,'request\x20sent');logger[_0xae8a('0xe')](_0xae8a('0xf'),_0x24cb92,_0xae8a('0x10'),JSON[_0xae8a('0x11')](_0x282f4c));if(_0x282f4c[_0xae8a('0x12')]){if(_0x282f4c['error'][_0xae8a('0x13')]===0x1f4){logger[_0xae8a('0x12')](_0xae8a('0xd'),_0x24cb92,_0x282f4c[_0xae8a('0x12')]['message']);return _0x265488(_0x282f4c[_0xae8a('0x12')][_0xae8a('0x14')]);}logger[_0xae8a('0x12')](_0xae8a('0xd'),_0x24cb92,_0x282f4c[_0xae8a('0x12')][_0xae8a('0x14')]);return _0x46cd25(_0x282f4c[_0xae8a('0x12')]['message']);}else{logger[_0xae8a('0xc')]('Variable,\x20%s,\x20%s',_0x24cb92,'request\x20sent');_0x46cd25(_0x282f4c[_0xae8a('0x15')][_0xae8a('0x14')]);}})[_0xae8a('0x16')](function(_0xe9f27e){logger['error'](_0xae8a('0xd'),_0x24cb92,_0xe9f27e);_0x265488(_0xe9f27e);});});}exports['ShowVariable']=function(_0x293569){var _0x473935=this;return new Promise(function(_0x3de700,_0x2d9708){return db['Variable'][_0xae8a('0x17')]({'raw':_0x293569[_0xae8a('0x18')]?_0x293569['options'][_0xae8a('0x19')]===undefined?!![]:![]:!![],'where':_0x293569[_0xae8a('0x18')]?_0x293569[_0xae8a('0x18')]['where']||null:null,'attributes':_0x293569['options']?_0x293569['options']['attributes']||null:null,'include':_0x293569[_0xae8a('0x18')]?_0x293569[_0xae8a('0x18')][_0xae8a('0x1a')]?_[_0xae8a('0x1b')](_0x293569[_0xae8a('0x18')][_0xae8a('0x1a')],function(_0x2ed519){return{'model':db[_0x2ed519[_0xae8a('0x1c')]],'as':_0x2ed519['as'],'attributes':_0x2ed519[_0xae8a('0x1d')],'include':_0x2ed519[_0xae8a('0x1a')]?_[_0xae8a('0x1b')](_0x2ed519['include'],function(_0x57aa20){return{'model':db[_0x57aa20[_0xae8a('0x1c')]],'as':_0x57aa20['as'],'attributes':_0x57aa20['attributes'],'include':_0x57aa20['include']?_['map'](_0x57aa20['include'],function(_0x15c6b5){return{'model':db[_0x15c6b5[_0xae8a('0x1c')]],'as':_0x15c6b5['as'],'attributes':_0x15c6b5[_0xae8a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d498){logger['info'](_0xae8a('0x1e'),_0x293569);logger['debug'](_0xae8a('0x1e'),_0x293569,JSON['stringify'](_0x42d498));_0x3de700(_0x42d498);})[_0xae8a('0x16')](function(_0x2fc0ff){logger[_0xae8a('0x12')](_0xae8a('0x1e'),_0x2fc0ff['message'],_0x293569);_0x2d9708(_0x473935['error'](0x1f4,_0x2fc0ff[_0xae8a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index d284f16..269719c 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 _0x19c4=['/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','migrations','exports','../../components/auth/service','./version.controller','get','index'];(function(_0xc141c6,_0x5eab8c){var _0x7950df=function(_0xbd4166){while(--_0xbd4166){_0xc141c6['push'](_0xc141c6['shift']());}};_0x7950df(++_0x5eab8c);}(_0x19c4,0x1d8));var _0x419c=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x19c4[_0xdbd4f7];return _0x5c3f9d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x419c('0x0'));var controller=require(_0x419c('0x1'));router[_0x419c('0x2')]('/',controller[_0x419c('0x3')]);router[_0x419c('0x2')](_0x419c('0x4'),auth[_0x419c('0x5')](),auth[_0x419c('0x6')](),controller[_0x419c('0x7')]);router[_0x419c('0x2')]('/reset',auth[_0x419c('0x5')](),auth[_0x419c('0x6')](),controller[_0x419c('0x8')]);router[_0x419c('0x2')](_0x419c('0x9'),auth[_0x419c('0x5')](),auth[_0x419c('0x6')](),controller[_0x419c('0xa')]);router[_0x419c('0x2')](_0x419c('0xb'),auth[_0x419c('0x5')](),controller['restart']);router['get']('/migrations',controller[_0x419c('0xc')]);module[_0x419c('0xd')]=router; \ No newline at end of file +var _0x7506=['/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index'];(function(_0x36efdf,_0x1beadd){var _0x150e40=function(_0x27210c){while(--_0x27210c){_0x36efdf['push'](_0x36efdf['shift']());}};_0x150e40(++_0x1beadd);}(_0x7506,0x1e8));var _0x6750=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7506[_0x2c91e9];return _0x13f0ff;};'use strict';var express=require('express');var router=express[_0x6750('0x0')]();var auth=require(_0x6750('0x1'));var controller=require(_0x6750('0x2'));router[_0x6750('0x3')]('/',controller[_0x6750('0x4')]);router[_0x6750('0x3')](_0x6750('0x5'),auth[_0x6750('0x6')](),auth[_0x6750('0x7')](),controller[_0x6750('0x8')]);router[_0x6750('0x3')](_0x6750('0x9'),auth['isAuthenticated'](),auth[_0x6750('0x7')](),controller[_0x6750('0xa')]);router[_0x6750('0x3')](_0x6750('0xb'),auth[_0x6750('0x6')](),auth['canUpdate'](),controller['pull']);router[_0x6750('0x3')](_0x6750('0xc'),auth[_0x6750('0x6')](),controller[_0x6750('0xd')]);router[_0x6750('0x3')](_0x6750('0xe'),controller[_0x6750('0xf')]);module[_0x6750('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3251c0c..0faca71 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 _0xbb61=['lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','root','index','exports','query','latest','tags','status','json','fetch','origin','master','error','info','git\x20fetch','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','readdirSync','join','server','migrations','length','.js','push','sort','sequelize','Migration','getQueryInterface','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0x141744,_0x27ae67){var _0x17360f=function(_0x675af5){while(--_0x675af5){_0x141744['push'](_0x141744['shift']());}};_0x17360f(++_0x27ae67);}(_0xbb61,0x131));var _0x1bb6=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xbb61[_0x1b2ff7];return _0x31656a;};'use strict';var Umzug=require(_0x1bb6('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1bb6('0x1'));var pkginfo=require(_0x1bb6('0x2'))(module,_0x1bb6('0x3'));var compareVersions=require(_0x1bb6('0x4'));var exec=require(_0x1bb6('0x5'))[_0x1bb6('0x6')];var db=require(_0x1bb6('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x1bb6('0x8'));var logger=require(_0x1bb6('0x9'))(_0x1bb6('0xa'));var git=require('simple-git')(config[_0x1bb6('0xb')]);exports[_0x1bb6('0xc')]=function(_0x24d6b9,_0x59a152){var _0x13e2da={'current':module[_0x1bb6('0xd')][_0x1bb6('0x3')],'phonebar':0x2};if(_0x24d6b9[_0x1bb6('0xe')]&&_0x24d6b9[_0x1bb6('0xe')][_0x1bb6('0xf')]){return git['fetch']()[_0x1bb6('0x10')](function(_0x29ee41,_0x59b1b8){_0x13e2da[_0x1bb6('0xf')]=(_0x29ee41?module['exports']['version']:_0x59b1b8['latest'])||'2.0.0';return _0x59a152[_0x1bb6('0x11')](0xc8)[_0x1bb6('0x12')](_0x13e2da);});}else{return _0x59a152['status'](0xc8)['json'](_0x13e2da);}};exports[_0x1bb6('0x13')]=function(_0x39f46e,_0x1455f3){return git[_0x1bb6('0x13')]([_0x1bb6('0x14'),_0x1bb6('0x15')],function(_0x2234d5){if(_0x2234d5){logger[_0x1bb6('0x16')](_0x2234d5);return _0x1455f3['status'](0x1f4)[_0x1bb6('0x12')](_0x2234d5);}logger[_0x1bb6('0x17')](_0x1bb6('0x18'));return _0x1455f3[_0x1bb6('0x11')](0xc8)[_0x1bb6('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x1bb6('0x19')]=function(_0xf67fd2,_0x9e046a){return git['reset']([_0x1bb6('0x1a'),'FETCH_HEAD'],function(_0x203f2b){if(_0x203f2b){logger['error'](_0x203f2b);return _0x9e046a[_0x1bb6('0x11')](0x1f4)[_0x1bb6('0x12')](_0x203f2b);}logger[_0x1bb6('0x17')](_0x1bb6('0x1b'));return _0x9e046a[_0x1bb6('0x11')](0xc8)[_0x1bb6('0x12')]({'output':_0x1bb6('0x1c')});});};exports[_0x1bb6('0x1d')]=function(_0x42cb75,_0x495497){exec(_0x1bb6('0x1e'),function(_0x255e8a,_0x52b6e9,_0x194fa0){logger[_0x1bb6('0x17')](_0x52b6e9);logger[_0x1bb6('0x17')](_0x194fa0);if(_0x255e8a){logger[_0x1bb6('0x16')](_0x255e8a);return _0x495497['status'](0x1f4)['json'](_0x255e8a);}return _0x495497['status'](0xc8)['json']({'output':_0x52b6e9});});};exports['restart']=function(_0x2bdcd3,_0x1ec764){return pm2[_0x1bb6('0x1f')]('motion2')[_0x1bb6('0x20')](function(_0x8e8b4a){logger[_0x1bb6('0x17')](_0x1bb6('0x21'),_0x8e8b4a);return _0x1ec764[_0x1bb6('0x11')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x736c70){logger['error'](_0x736c70);return _0x1ec764['status'](0x1f4)[_0x1bb6('0x12')](_0x736c70);});};exports['migrations']=function(_0x5c7bde,_0x18526d){var _0xf42d9=fs[_0x1bb6('0x22')](path[_0x1bb6('0x23')](config['root'],_0x1bb6('0x24'),_0x1bb6('0x25')));var _0x55485a=[];for(var _0x38a385=0x0;_0x38a385<_0xf42d9[_0x1bb6('0x26')];_0x38a385++){var _0x47fc5d=_0xf42d9[_0x38a385]['replace'](_0x1bb6('0x27'),'');if(compareVersions(module[_0x1bb6('0xd')][_0x1bb6('0x3')],_0x47fc5d)===-0x1){_0x55485a[_0x1bb6('0x28')](_0x47fc5d);}}if(_0x55485a['length']){var _0xbaf60a=_0x55485a[_0x1bb6('0x29')](compareVersions);var _0x4f8565=new Umzug({'storage':_0x1bb6('0x2a'),'storageOptions':{'model':db[_0x1bb6('0x2b')],'modelName':_0x1bb6('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0x1bb6('0x2a')][_0x1bb6('0x2c')](),db[_0x1bb6('0x2a')]['constructor'],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[_0x1bb6('0x23')](config[_0x1bb6('0xb')],'server',_0x1bb6('0x25')),'pattern':/\.js$/}});_0x4f8565['up']({'migrations':_['map'](_0xbaf60a,function(_0x2ab7f5){return _0x2ab7f5+_0x1bb6('0x27');})})[_0x1bb6('0x20')](function(){return _0x18526d[_0x1bb6('0x11')](0xc8)[_0x1bb6('0x12')]({'output':_0x1bb6('0x2d')+module[_0x1bb6('0xd')]['version']+_0x1bb6('0x2e')+_[_0x1bb6('0x2f')](_0xbaf60a),'migrations':_['join'](_0xbaf60a)});})[_0x1bb6('0x30')](function(_0x3ce1ab){if(_0x3ce1ab instanceof db[_0x1bb6('0x2a')][_0x1bb6('0x31')]){return _0x18526d[_0x1bb6('0x11')](0xc8)[_0x1bb6('0x12')]({'output':_0x1bb6('0x32')});}else{return _0x18526d[_0x1bb6('0x11')](0x1f4)['json'](_0x3ce1ab);}});}else{return _0x18526d[_0x1bb6('0x11')](0xc8)[_0x1bb6('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x9bdb=['../../config/environment','../../config/pm2','../../config/logger','update','root','version','query','latest','fetch','exports','2.0.0','status','json','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x51b9d2,_0xa70cc7){_0x51b9d2=_0x51b9d2-0x0;var _0x18caa6=_0x9bdb[_0x51b9d2];return _0x18caa6;};'use strict';var Umzug=require(_0xb9bd('0x0'));var path=require(_0xb9bd('0x1'));var fs=require('fs');var _=require(_0xb9bd('0x2'));var pkginfo=require(_0xb9bd('0x3'))(module,'version');var compareVersions=require(_0xb9bd('0x4'));var exec=require(_0xb9bd('0x5'))[_0xb9bd('0x6')];var db=require(_0xb9bd('0x7'))['db'];var config=require(_0xb9bd('0x8'));var pm2=require(_0xb9bd('0x9'));var logger=require(_0xb9bd('0xa'))(_0xb9bd('0xb'));var git=require('simple-git')(config[_0xb9bd('0xc')]);exports['index']=function(_0x4c287b,_0x6c1aee){var _0x3896ca={'current':module['exports'][_0xb9bd('0xd')],'phonebar':0x2};if(_0x4c287b[_0xb9bd('0xe')]&&_0x4c287b[_0xb9bd('0xe')][_0xb9bd('0xf')]){return git[_0xb9bd('0x10')]()['tags'](function(_0x4ff96c,_0x19db37){_0x3896ca[_0xb9bd('0xf')]=(_0x4ff96c?module[_0xb9bd('0x11')]['version']:_0x19db37['latest'])||_0xb9bd('0x12');return _0x6c1aee[_0xb9bd('0x13')](0xc8)['json'](_0x3896ca);});}else{return _0x6c1aee[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')](_0x3896ca);}};exports[_0xb9bd('0x10')]=function(_0x570e5e,_0x2f5715){return git[_0xb9bd('0x10')]([_0xb9bd('0x15'),'master'],function(_0x56450d){if(_0x56450d){logger[_0xb9bd('0x16')](_0x56450d);return _0x2f5715['status'](0x1f4)[_0xb9bd('0x14')](_0x56450d);}logger['info'](_0xb9bd('0x17'));return _0x2f5715[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')]({'output':_0xb9bd('0x18')});});};exports[_0xb9bd('0x19')]=function(_0x15dc9f,_0x2f6edc){return git[_0xb9bd('0x19')]([_0xb9bd('0x1a'),_0xb9bd('0x1b')],function(_0x219a34){if(_0x219a34){logger['error'](_0x219a34);return _0x2f6edc['status'](0x1f4)[_0xb9bd('0x14')](_0x219a34);}logger[_0xb9bd('0x1c')](_0xb9bd('0x1d'));return _0x2f6edc[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0xb9bd('0x1e')]=function(_0x3657b5,_0x2f8196){exec(_0xb9bd('0x1f'),function(_0x477435,_0x276d85,_0x4657cb){logger[_0xb9bd('0x1c')](_0x276d85);logger[_0xb9bd('0x1c')](_0x4657cb);if(_0x477435){logger['error'](_0x477435);return _0x2f8196[_0xb9bd('0x13')](0x1f4)[_0xb9bd('0x14')](_0x477435);}return _0x2f8196['status'](0xc8)['json']({'output':_0x276d85});});};exports['restart']=function(_0x136930,_0x21ccbb){return pm2['restart'](_0xb9bd('0x20'))[_0xb9bd('0x21')](function(_0x3b9846){logger[_0xb9bd('0x1c')](_0xb9bd('0x22'),_0x3b9846);return _0x21ccbb[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')]({'output':_0xb9bd('0x23')});})[_0xb9bd('0x24')](function(_0x364e2f){logger[_0xb9bd('0x16')](_0x364e2f);return _0x21ccbb[_0xb9bd('0x13')](0x1f4)['json'](_0x364e2f);});};exports['migrations']=function(_0x2b81c4,_0x206e53){var _0x2eba92=fs[_0xb9bd('0x25')](path[_0xb9bd('0x26')](config[_0xb9bd('0xc')],_0xb9bd('0x27'),_0xb9bd('0x28')));var _0x28fd26=[];for(var _0x5881ec=0x0;_0x5881ec<_0x2eba92[_0xb9bd('0x29')];_0x5881ec++){var _0xbd8fea=_0x2eba92[_0x5881ec][_0xb9bd('0x2a')](_0xb9bd('0x2b'),'');if(compareVersions(module['exports'][_0xb9bd('0xd')],_0xbd8fea)===-0x1){_0x28fd26['push'](_0xbd8fea);}}if(_0x28fd26[_0xb9bd('0x29')]){var _0x111bc9=_0x28fd26[_0xb9bd('0x2c')](compareVersions);var _0x2b38a8=new Umzug({'storage':_0xb9bd('0x2d'),'storageOptions':{'model':db[_0xb9bd('0x2e')],'modelName':_0xb9bd('0x2e'),'columnName':_0xb9bd('0xd')},'migrations':{'params':[db[_0xb9bd('0x2d')][_0xb9bd('0x2f')](),db[_0xb9bd('0x2d')][_0xb9bd('0x30')],function(){throw new Error(_0xb9bd('0x31'));}],'path':path[_0xb9bd('0x26')](config['root'],'server',_0xb9bd('0x28')),'pattern':/\.js$/}});_0x2b38a8['up']({'migrations':_['map'](_0x111bc9,function(_0x4e85e8){return _0x4e85e8+_0xb9bd('0x2b');})})[_0xb9bd('0x21')](function(){return _0x206e53[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')]({'output':_0xb9bd('0x32')+module[_0xb9bd('0x11')][_0xb9bd('0xd')]+_0xb9bd('0x33')+_[_0xb9bd('0x34')](_0x111bc9),'migrations':_[_0xb9bd('0x26')](_0x111bc9)});})[_0xb9bd('0x24')](function(_0x5e45b7){if(_0x5e45b7 instanceof db[_0xb9bd('0x2d')][_0xb9bd('0x35')]){return _0x206e53[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x206e53['status'](0x1f4)[_0xb9bd('0x14')](_0x5e45b7);}});}else{return _0x206e53[_0xb9bd('0x13')](0xc8)[_0xb9bd('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 10942f8..b653af3 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 _0x079f=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','exports','multer','path','express','Router'];(function(_0x13da91,_0x3f6375){var _0x118cce=function(_0x5a43d4){while(--_0x5a43d4){_0x13da91['push'](_0x13da91['shift']());}};_0x118cce(++_0x3f6375);}(_0x079f,0x1dc));var _0xf079=function(_0x162053,_0xe1b6fc){_0x162053=_0x162053-0x0;var _0x5236ae=_0x079f[_0x162053];return _0x5236ae;};'use strict';var multer=require(_0xf079('0x0'));var util=require('util');var path=require(_0xf079('0x1'));var timeout=require('connect-timeout');var express=require(_0xf079('0x2'));var router=express[_0xf079('0x3')]();var auth=require(_0xf079('0x4'));var interaction=require(_0xf079('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xf079('0x6')]('/',auth[_0xf079('0x7')](),controller[_0xf079('0x8')]);router[_0xf079('0x6')](_0xf079('0x9'),auth[_0xf079('0x7')](),controller['describe']);router['get'](_0xf079('0xa'),auth[_0xf079('0x7')](),controller[_0xf079('0xb')]);router['post']('/',auth[_0xf079('0x7')](),controller['create']);router[_0xf079('0xc')](_0xf079('0xa'),auth[_0xf079('0x7')](),controller[_0xf079('0xd')]);router[_0xf079('0xe')](_0xf079('0xa'),auth[_0xf079('0x7')](),controller['destroy']);module[_0xf079('0xf')]=router; \ No newline at end of file +var _0x4500=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update','delete','destroy'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x4500,0xa0));var _0x0450=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x4500[_0x420513];return _0x1b44ec;};'use strict';var multer=require(_0x0450('0x0'));var util=require(_0x0450('0x1'));var path=require('path');var timeout=require(_0x0450('0x2'));var express=require(_0x0450('0x3'));var router=express[_0x0450('0x4')]();var auth=require(_0x0450('0x5'));var interaction=require(_0x0450('0x6'));var config=require(_0x0450('0x7'));var controller=require(_0x0450('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0450('0x9')]);router[_0x0450('0xa')](_0x0450('0xb'),auth[_0x0450('0xc')](),controller['describe']);router['get']('/:id',auth[_0x0450('0xc')](),controller[_0x0450('0xd')]);router[_0x0450('0xe')]('/',auth[_0x0450('0xc')](),controller['create']);router[_0x0450('0xf')](_0x0450('0x10'),auth['isAuthenticated'](),controller[_0x0450('0x11')]);router[_0x0450('0x12')](_0x0450('0x10'),auth[_0x0450('0xc')](),controller[_0x0450('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8e157ed..5d1e590 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 _0xee14=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING'];(function(_0x101f19,_0x20a801){var _0x5f07ed=function(_0x9bfe3d){while(--_0x9bfe3d){_0x101f19['push'](_0x101f19['shift']());}};_0x5f07ed(++_0x20a801);}(_0xee14,0x13a));var _0x4ee1=function(_0x5acd1c,_0x26091e){_0x5acd1c=_0x5acd1c-0x0;var _0x1e097c=_0xee14[_0x5acd1c];return _0x1e097c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4ee1('0x0')]},'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridnum':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'queue':{'type':Sequelize[_0x4ee1('0x0')]},'interface':{'type':Sequelize[_0x4ee1('0x0')]},'membername':{'type':Sequelize[_0x4ee1('0x0')]},'agentcalledAt':{'type':Sequelize[_0x4ee1('0x1')]},'agentconnectAt':{'type':Sequelize[_0x4ee1('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x4ee1('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4ee1('0x2')]},'agentcomplete':{'type':Sequelize[_0x4ee1('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4ee1('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4ee1('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4ee1('0x2')]},'agentacw':{'type':Sequelize[_0x4ee1('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4ee1('0x0')]},'lastevent':{'type':Sequelize[_0x4ee1('0x0')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4ee1('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4ee1('0x0')]},'connectedlinenum':{'type':Sequelize[_0x4ee1('0x0')]},'connectedlinename':{'type':Sequelize[_0x4ee1('0x0')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'exten':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'destchannel':{'type':Sequelize[_0x4ee1('0x0')]},'destchannelstate':{'type':Sequelize[_0x4ee1('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4ee1('0x0')]},'destcalleridname':{'type':Sequelize[_0x4ee1('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x4ee1('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4ee1('0x0')]},'destlanguage':{'type':Sequelize[_0x4ee1('0x0')]},'destaccountcode':{'type':Sequelize[_0x4ee1('0x0')]},'destcontext':{'type':Sequelize[_0x4ee1('0x0')]},'destexten':{'type':Sequelize[_0x4ee1('0x0')]},'destpriority':{'type':Sequelize[_0x4ee1('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x4ee1('0x0')]},'transfer':{'type':Sequelize[_0x4ee1('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4ee1('0x0')],'comment':_0x4ee1('0x4')},'transferexten':{'type':Sequelize[_0x4ee1('0x0')]},'transferuniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'agententerreason':{'type':Sequelize[_0x4ee1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb138=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x585be5,_0x19b054){var _0x1d9ee9=function(_0x24556d){while(--_0x24556d){_0x585be5['push'](_0x585be5['shift']());}};_0x1d9ee9(++_0x19b054);}(_0xb138,0x1dd));var _0x8b13=function(_0x14e819,_0x951795){_0x14e819=_0x14e819-0x0;var _0x293b91=_0xb138[_0x14e819];return _0x293b91;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'type':{'type':Sequelize[_0x8b13('0x2')]},'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'calleridnum':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'queue':{'type':Sequelize[_0x8b13('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8b13('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8b13('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8b13('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8b13('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8b13('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8b13('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8b13('0x2')]},'channelstate':{'type':Sequelize[_0x8b13('0x5')]},'channelstatedesc':{'type':Sequelize[_0x8b13('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8b13('0x2')]},'connectedlinename':{'type':Sequelize[_0x8b13('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'exten':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize[_0x8b13('0x2')]},'destchannel':{'type':Sequelize[_0x8b13('0x2')]},'destchannelstate':{'type':Sequelize[_0x8b13('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8b13('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8b13('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8b13('0x2')]},'destexten':{'type':Sequelize[_0x8b13('0x2')]},'destpriority':{'type':Sequelize[_0x8b13('0x2')]},'destuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8b13('0x2')],'comment':_0x8b13('0x6')},'transferexten':{'type':Sequelize[_0x8b13('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'agententerreason':{'type':Sequelize[_0x8b13('0x5')],'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 8fdddc0..10da54b 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 _0x3882=['attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','VoiceAgentReport','includeAll','findAll','catch','intersection','fields','include','find','create','body','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','keys','query','model'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3882,0xa9));var _0x2388=function(_0x279614,_0x4cce43){_0x279614=_0x279614-0x0;var _0x2a331c=_0x3882[_0x279614];return _0x2a331c;};'use strict';var pdf=require(_0x2388('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2388('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2388('0x2'));var rp=require(_0x2388('0x3'));var moment=require(_0x2388('0x4'));var BPromise=require(_0x2388('0x5'));var Mustache=require(_0x2388('0x6'));var util=require(_0x2388('0x7'));var path=require(_0x2388('0x8'));var sox=require(_0x2388('0x9'));var csv=require('to-csv');var ejs=require(_0x2388('0xa'));var fs=require('fs');var _=require(_0x2388('0xb'));var squel=require(_0x2388('0xc'));var crypto=require(_0x2388('0xd'));var jsforce=require(_0x2388('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2388('0xf'));var querystring=require(_0x2388('0x10'));var Papa=require(_0x2388('0x11'));var Redis=require('ioredis');var authService=require(_0x2388('0x12'));var qs=require(_0x2388('0x13'));var as=require(_0x2388('0x14'));var hardwareService=require(_0x2388('0x15'));var logger=require(_0x2388('0x16'))('api');var utils=require(_0x2388('0x17'));var config=require(_0x2388('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5092be,_0x278ed2){_0x278ed2=_0x278ed2||0xcc;return function(_0x76859f){if(_0x76859f){return _0x5092be[_0x2388('0x19')](_0x278ed2);}return _0x5092be[_0x2388('0x1a')](_0x278ed2)[_0x2388('0x1b')]();};}function respondWithResult(_0x3f870e,_0x438f32){_0x438f32=_0x438f32||0xc8;return function(_0x3796d4){if(_0x3796d4){return _0x3f870e[_0x2388('0x1a')](_0x438f32)[_0x2388('0x1c')](_0x3796d4);}};}function respondWithFilteredResult(_0x1f4413,_0x4fbd74){return function(_0x1b0017){if(_0x1b0017){var _0x4480d5=_0x1b0017[_0x2388('0x1d')],_0x445d37=_0x4fbd74[_0x2388('0x1e')],_0x1613d6=_0x4fbd74[_0x2388('0x1e')]+_0x4fbd74[_0x2388('0x1f')],_0xf814ca;if(_0x1613d6>=_0x4480d5){_0x1613d6=_0x4480d5;_0xf814ca=0xc8;}else{_0xf814ca=0xce;}_0x1f4413[_0x2388('0x1a')](_0xf814ca);return _0x1f4413[_0x2388('0x20')](_0x2388('0x21'),_0x445d37+'-'+_0x1613d6+'/'+_0x4480d5)[_0x2388('0x1c')](_0x1b0017);}return null;};}function patchUpdates(_0x4248b2){return function(_0xb1513f){try{jsonpatch[_0x2388('0x22')](_0xb1513f,_0x4248b2,!![]);}catch(_0xd03a1b){return BPromise[_0x2388('0x23')](_0xd03a1b);}return _0xb1513f['save']();};}function saveUpdates(_0x54ed14,_0x190b15){return function(_0x2b0a8c){if(_0x2b0a8c){return _0x2b0a8c[_0x2388('0x24')](_0x54ed14)[_0x2388('0x25')](function(_0x15802e){return _0x15802e;});}return null;};}function removeEntity(_0x15a81c,_0x2aa448){return function(_0xf6bf61){if(_0xf6bf61){return _0xf6bf61[_0x2388('0x26')]()[_0x2388('0x25')](function(){_0x15a81c[_0x2388('0x1a')](0xcc)[_0x2388('0x1b')]();});}};}function handleEntityNotFound(_0x12dcee,_0x2bafa6){return function(_0x324023){if(!_0x324023){_0x12dcee[_0x2388('0x19')](0x194);}return _0x324023;};}function handleError(_0x559083,_0xd2cd54){_0xd2cd54=_0xd2cd54||0x1f4;return function(_0x2970bf){logger[_0x2388('0x27')](_0x2970bf['stack']);if(_0x2970bf[_0x2388('0x28')]){delete _0x2970bf['name'];}_0x559083[_0x2388('0x1a')](_0xd2cd54)['send'](_0x2970bf);};}exports[_0x2388('0x29')]=function(_0x20cbe6,_0x3232a5){var _0x4e4fa3={},_0x1d056e={},_0x4ca113={'count':0x0,'rows':[]};var _0x363d9a=_[_0x2388('0x2a')](db['VoiceAgentReport'][_0x2388('0x2b')],function(_0x2fb390){return{'name':_0x2fb390[_0x2388('0x2c')],'type':_0x2fb390[_0x2388('0x2d')][_0x2388('0x2e')]};});_0x1d056e['model']=_[_0x2388('0x2a')](_0x363d9a,_0x2388('0x28'));_0x1d056e['query']=_[_0x2388('0x2f')](_0x20cbe6[_0x2388('0x30')]);_0x1d056e['filters']=_['intersection'](_0x1d056e[_0x2388('0x31')],_0x1d056e[_0x2388('0x30')]);_0x4e4fa3['attributes']=_['intersection'](_0x1d056e[_0x2388('0x31')],qs['fields'](_0x20cbe6['query']['fields']));_0x4e4fa3[_0x2388('0x32')]=_0x4e4fa3[_0x2388('0x32')][_0x2388('0x33')]?_0x4e4fa3['attributes']:_0x1d056e['model'];if(!_0x20cbe6[_0x2388('0x30')][_0x2388('0x34')](_0x2388('0x35'))){_0x4e4fa3['limit']=qs[_0x2388('0x1f')](_0x20cbe6[_0x2388('0x30')][_0x2388('0x1f')]);_0x4e4fa3[_0x2388('0x1e')]=qs[_0x2388('0x1e')](_0x20cbe6[_0x2388('0x30')][_0x2388('0x1e')]);}_0x4e4fa3[_0x2388('0x36')]=qs[_0x2388('0x37')](_0x20cbe6[_0x2388('0x30')]['sort']);_0x4e4fa3['where']=qs[_0x2388('0x38')](_['pick'](_0x20cbe6[_0x2388('0x30')],_0x1d056e['filters']));if(_0x20cbe6[_0x2388('0x30')][_0x2388('0x39')]){_0x4e4fa3[_0x2388('0x3a')]=_[_0x2388('0x3b')](_0x4e4fa3['where'],{'$or':_['map'](_0x363d9a,function(_0x5c3386){if(_0x5c3386[_0x2388('0x2d')]!==_0x2388('0x3c')){var _0x5b82f2={};_0x5b82f2[_0x5c3386[_0x2388('0x28')]]={'$like':'%'+_0x20cbe6[_0x2388('0x30')][_0x2388('0x39')]+'%'};return _0x5b82f2;}})});}_0x4e4fa3=_[_0x2388('0x3b')]({},_0x4e4fa3,_0x20cbe6['options']);var _0x3b8f73={'where':_0x4e4fa3[_0x2388('0x3a')]};return db[_0x2388('0x3d')]['count'](_0x3b8f73)['then'](function(_0x5553f6){_0x4ca113[_0x2388('0x1d')]=_0x5553f6;if(_0x20cbe6[_0x2388('0x30')][_0x2388('0x3e')]){_0x4e4fa3['include']=[{'all':!![]}];}return db[_0x2388('0x3d')][_0x2388('0x3f')](_0x4e4fa3);})[_0x2388('0x25')](function(_0x1ea59b){_0x4ca113['rows']=_0x1ea59b;return _0x4ca113;})['then'](respondWithFilteredResult(_0x3232a5,_0x4e4fa3))[_0x2388('0x40')](handleError(_0x3232a5,null));};exports['show']=function(_0x25cb77,_0x2c06b7){var _0x313f1c={'raw':![],'where':{'id':_0x25cb77['params']['id']}},_0x2c3756={};_0x2c3756[_0x2388('0x31')]=_[_0x2388('0x2f')](db[_0x2388('0x3d')][_0x2388('0x2b')]);_0x2c3756[_0x2388('0x30')]=_['keys'](_0x25cb77[_0x2388('0x30')]);_0x2c3756['filters']=_[_0x2388('0x41')](_0x2c3756[_0x2388('0x31')],_0x2c3756[_0x2388('0x30')]);_0x313f1c[_0x2388('0x32')]=_[_0x2388('0x41')](_0x2c3756['model'],qs[_0x2388('0x42')](_0x25cb77[_0x2388('0x30')][_0x2388('0x42')]));_0x313f1c[_0x2388('0x32')]=_0x313f1c[_0x2388('0x32')]['length']?_0x313f1c[_0x2388('0x32')]:_0x2c3756[_0x2388('0x31')];if(_0x25cb77['query'][_0x2388('0x3e')]){_0x313f1c[_0x2388('0x43')]=[{'all':!![]}];}_0x313f1c=_['merge']({},_0x313f1c,_0x25cb77['options']);return db['VoiceAgentReport'][_0x2388('0x44')](_0x313f1c)[_0x2388('0x25')](handleEntityNotFound(_0x2c06b7,null))[_0x2388('0x25')](respondWithResult(_0x2c06b7,null))[_0x2388('0x40')](handleError(_0x2c06b7,null));};exports[_0x2388('0x45')]=function(_0x27e8ff,_0x516a2c){return db['VoiceAgentReport'][_0x2388('0x45')](_0x27e8ff['body'],{})[_0x2388('0x25')](respondWithResult(_0x516a2c,0xc9))[_0x2388('0x40')](handleError(_0x516a2c,null));};exports[_0x2388('0x24')]=function(_0x829e9e,_0x48d2a0){if(_0x829e9e[_0x2388('0x46')]['id']){delete _0x829e9e[_0x2388('0x46')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x829e9e[_0x2388('0x47')]['id']}})[_0x2388('0x25')](handleEntityNotFound(_0x48d2a0,null))['then'](saveUpdates(_0x829e9e[_0x2388('0x46')],null))[_0x2388('0x25')](respondWithResult(_0x48d2a0,null))['catch'](handleError(_0x48d2a0,null));};exports[_0x2388('0x26')]=function(_0x5287ec,_0x2dcbc9){return db[_0x2388('0x3d')][_0x2388('0x44')]({'where':{'id':_0x5287ec[_0x2388('0x47')]['id']}})[_0x2388('0x25')](handleEntityNotFound(_0x2dcbc9,null))[_0x2388('0x25')](removeEntity(_0x2dcbc9,null))['catch'](handleError(_0x2dcbc9,null));};exports[_0x2388('0x48')]=function(_0x4f335a,_0x31d0d7){return db[_0x2388('0x3d')]['describe']()['then'](respondWithResult(_0x31d0d7,null))[_0x2388('0x40')](handleError(_0x31d0d7,null));}; \ No newline at end of file +var _0xa532=['save','update','then','destroy','error','stack','name','index','map','VoiceAgentReport','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','show','merge','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','reject'];(function(_0xf69ea2,_0x4b0d5c){var _0x2c88ec=function(_0x25c12f){while(--_0x25c12f){_0xf69ea2['push'](_0xf69ea2['shift']());}};_0x2c88ec(++_0x4b0d5c);}(_0xa532,0x1ef));var _0x2a53=function(_0xf214e6,_0x6a8fca){_0xf214e6=_0xf214e6-0x0;var _0x5cdfbe=_0xa532[_0xf214e6];return _0x5cdfbe;};'use strict';var pdf=require(_0x2a53('0x0'));var emlformat=require(_0x2a53('0x1'));var rimraf=require(_0x2a53('0x2'));var zipdir=require(_0x2a53('0x3'));var jsonpatch=require(_0x2a53('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2a53('0x5'));var Mustache=require(_0x2a53('0x6'));var util=require(_0x2a53('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a53('0x8'));var fs=require('fs');var _=require(_0x2a53('0x9'));var squel=require(_0x2a53('0xa'));var crypto=require(_0x2a53('0xb'));var jsforce=require(_0x2a53('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2a53('0xd'));var querystring=require(_0x2a53('0xe'));var Papa=require(_0x2a53('0xf'));var Redis=require(_0x2a53('0x10'));var authService=require(_0x2a53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2a53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2a53('0x13'));var utils=require(_0x2a53('0x14'));var config=require('../../config/environment');var db=require(_0x2a53('0x15'))['db'];function respondWithStatusCode(_0x4e68f6,_0x7b83a9){_0x7b83a9=_0x7b83a9||0xcc;return function(_0x5c0e01){if(_0x5c0e01){return _0x4e68f6[_0x2a53('0x16')](_0x7b83a9);}return _0x4e68f6[_0x2a53('0x17')](_0x7b83a9)[_0x2a53('0x18')]();};}function respondWithResult(_0x12b656,_0x1511d){_0x1511d=_0x1511d||0xc8;return function(_0x5197a0){if(_0x5197a0){return _0x12b656[_0x2a53('0x17')](_0x1511d)['json'](_0x5197a0);}};}function respondWithFilteredResult(_0x569bc6,_0x20d086){return function(_0x31a375){if(_0x31a375){var _0x1cbfaf=_0x31a375['count'],_0x56c00a=_0x20d086['offset'],_0x2f1093=_0x20d086[_0x2a53('0x19')]+_0x20d086['limit'],_0x2e8c07;if(_0x2f1093>=_0x1cbfaf){_0x2f1093=_0x1cbfaf;_0x2e8c07=0xc8;}else{_0x2e8c07=0xce;}_0x569bc6['status'](_0x2e8c07);return _0x569bc6[_0x2a53('0x1a')](_0x2a53('0x1b'),_0x56c00a+'-'+_0x2f1093+'/'+_0x1cbfaf)[_0x2a53('0x1c')](_0x31a375);}return null;};}function patchUpdates(_0x8bfd3e){return function(_0x122025){try{jsonpatch['apply'](_0x122025,_0x8bfd3e,!![]);}catch(_0x235059){return BPromise[_0x2a53('0x1d')](_0x235059);}return _0x122025[_0x2a53('0x1e')]();};}function saveUpdates(_0x4412a5,_0x5a4f9e){return function(_0x2d4d40){if(_0x2d4d40){return _0x2d4d40[_0x2a53('0x1f')](_0x4412a5)[_0x2a53('0x20')](function(_0x275ddc){return _0x275ddc;});}return null;};}function removeEntity(_0x2ee410,_0x150cbb){return function(_0x4e78d9){if(_0x4e78d9){return _0x4e78d9[_0x2a53('0x21')]()[_0x2a53('0x20')](function(){_0x2ee410[_0x2a53('0x17')](0xcc)[_0x2a53('0x18')]();});}};}function handleEntityNotFound(_0x4e98e7,_0x18daa2){return function(_0x31b5ec){if(!_0x31b5ec){_0x4e98e7[_0x2a53('0x16')](0x194);}return _0x31b5ec;};}function handleError(_0x4362d3,_0x1d42c7){_0x1d42c7=_0x1d42c7||0x1f4;return function(_0x1273fb){logger[_0x2a53('0x22')](_0x1273fb[_0x2a53('0x23')]);if(_0x1273fb[_0x2a53('0x24')]){delete _0x1273fb['name'];}_0x4362d3['status'](_0x1d42c7)['send'](_0x1273fb);};}exports[_0x2a53('0x25')]=function(_0x2efcd4,_0x614fd3){var _0x3ecba9={},_0x1e6cd6={},_0x2c34d5={'count':0x0,'rows':[]};var _0x480beb=_[_0x2a53('0x26')](db[_0x2a53('0x27')][_0x2a53('0x28')],function(_0x411966){return{'name':_0x411966[_0x2a53('0x29')],'type':_0x411966[_0x2a53('0x2a')][_0x2a53('0x2b')]};});_0x1e6cd6['model']=_['map'](_0x480beb,'name');_0x1e6cd6['query']=_[_0x2a53('0x2c')](_0x2efcd4[_0x2a53('0x2d')]);_0x1e6cd6['filters']=_['intersection'](_0x1e6cd6[_0x2a53('0x2e')],_0x1e6cd6[_0x2a53('0x2d')]);_0x3ecba9[_0x2a53('0x2f')]=_[_0x2a53('0x30')](_0x1e6cd6[_0x2a53('0x2e')],qs[_0x2a53('0x31')](_0x2efcd4['query'][_0x2a53('0x31')]));_0x3ecba9['attributes']=_0x3ecba9[_0x2a53('0x2f')][_0x2a53('0x32')]?_0x3ecba9[_0x2a53('0x2f')]:_0x1e6cd6['model'];if(!_0x2efcd4[_0x2a53('0x2d')][_0x2a53('0x33')](_0x2a53('0x34'))){_0x3ecba9[_0x2a53('0x35')]=qs['limit'](_0x2efcd4[_0x2a53('0x2d')][_0x2a53('0x35')]);_0x3ecba9[_0x2a53('0x19')]=qs['offset'](_0x2efcd4['query'][_0x2a53('0x19')]);}_0x3ecba9[_0x2a53('0x36')]=qs[_0x2a53('0x37')](_0x2efcd4[_0x2a53('0x2d')]['sort']);_0x3ecba9[_0x2a53('0x38')]=qs[_0x2a53('0x39')](_[_0x2a53('0x3a')](_0x2efcd4[_0x2a53('0x2d')],_0x1e6cd6[_0x2a53('0x39')]));if(_0x2efcd4[_0x2a53('0x2d')][_0x2a53('0x3b')]){_0x3ecba9['where']=_['merge'](_0x3ecba9[_0x2a53('0x38')],{'$or':_[_0x2a53('0x26')](_0x480beb,function(_0x4aa29d){if(_0x4aa29d[_0x2a53('0x2a')]!==_0x2a53('0x3c')){var _0x2ca2f5={};_0x2ca2f5[_0x4aa29d['name']]={'$like':'%'+_0x2efcd4[_0x2a53('0x2d')][_0x2a53('0x3b')]+'%'};return _0x2ca2f5;}})});}_0x3ecba9=_['merge']({},_0x3ecba9,_0x2efcd4[_0x2a53('0x3d')]);var _0x481c95={'where':_0x3ecba9[_0x2a53('0x38')]};return db[_0x2a53('0x27')][_0x2a53('0x3e')](_0x481c95)[_0x2a53('0x20')](function(_0x383672){_0x2c34d5[_0x2a53('0x3e')]=_0x383672;if(_0x2efcd4[_0x2a53('0x2d')][_0x2a53('0x3f')]){_0x3ecba9[_0x2a53('0x40')]=[{'all':!![]}];}return db[_0x2a53('0x27')][_0x2a53('0x41')](_0x3ecba9);})[_0x2a53('0x20')](function(_0x54c0a7){_0x2c34d5[_0x2a53('0x42')]=_0x54c0a7;return _0x2c34d5;})[_0x2a53('0x20')](respondWithFilteredResult(_0x614fd3,_0x3ecba9))['catch'](handleError(_0x614fd3,null));};exports[_0x2a53('0x43')]=function(_0x4e8942,_0xe7d5b6){var _0x3a7f43={'raw':![],'where':{'id':_0x4e8942['params']['id']}},_0x51f752={};_0x51f752[_0x2a53('0x2e')]=_[_0x2a53('0x2c')](db[_0x2a53('0x27')][_0x2a53('0x28')]);_0x51f752[_0x2a53('0x2d')]=_[_0x2a53('0x2c')](_0x4e8942[_0x2a53('0x2d')]);_0x51f752[_0x2a53('0x39')]=_['intersection'](_0x51f752[_0x2a53('0x2e')],_0x51f752['query']);_0x3a7f43['attributes']=_[_0x2a53('0x30')](_0x51f752[_0x2a53('0x2e')],qs['fields'](_0x4e8942[_0x2a53('0x2d')]['fields']));_0x3a7f43[_0x2a53('0x2f')]=_0x3a7f43['attributes'][_0x2a53('0x32')]?_0x3a7f43[_0x2a53('0x2f')]:_0x51f752[_0x2a53('0x2e')];if(_0x4e8942[_0x2a53('0x2d')][_0x2a53('0x3f')]){_0x3a7f43[_0x2a53('0x40')]=[{'all':!![]}];}_0x3a7f43=_[_0x2a53('0x44')]({},_0x3a7f43,_0x4e8942[_0x2a53('0x3d')]);return db[_0x2a53('0x27')][_0x2a53('0x45')](_0x3a7f43)['then'](handleEntityNotFound(_0xe7d5b6,null))[_0x2a53('0x20')](respondWithResult(_0xe7d5b6,null))[_0x2a53('0x46')](handleError(_0xe7d5b6,null));};exports[_0x2a53('0x47')]=function(_0x35ea93,_0x4287db){return db[_0x2a53('0x27')]['create'](_0x35ea93['body'],{})[_0x2a53('0x20')](respondWithResult(_0x4287db,0xc9))['catch'](handleError(_0x4287db,null));};exports['update']=function(_0x3f52ef,_0x2b29e3){if(_0x3f52ef[_0x2a53('0x48')]['id']){delete _0x3f52ef[_0x2a53('0x48')]['id'];}return db['VoiceAgentReport'][_0x2a53('0x45')]({'where':{'id':_0x3f52ef[_0x2a53('0x49')]['id']}})[_0x2a53('0x20')](handleEntityNotFound(_0x2b29e3,null))[_0x2a53('0x20')](saveUpdates(_0x3f52ef['body'],null))[_0x2a53('0x20')](respondWithResult(_0x2b29e3,null))['catch'](handleError(_0x2b29e3,null));};exports[_0x2a53('0x21')]=function(_0x2a8508,_0x153270){return db[_0x2a53('0x27')][_0x2a53('0x45')]({'where':{'id':_0x2a8508['params']['id']}})['then'](handleEntityNotFound(_0x153270,null))[_0x2a53('0x20')](removeEntity(_0x153270,null))[_0x2a53('0x46')](handleError(_0x153270,null));};exports['describe']=function(_0x8c53ed,_0x546ba7){return db[_0x2a53('0x27')][_0x2a53('0x4a')]()[_0x2a53('0x20')](respondWithResult(_0x546ba7,null))[_0x2a53('0x46')](handleError(_0x546ba7,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 1eb296c..41ec999 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 _0x4704=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','../../config/logger'];(function(_0x2484b8,_0x4850ef){var _0x14b132=function(_0x10bfc2){while(--_0x10bfc2){_0x2484b8['push'](_0x2484b8['shift']());}};_0x14b132(++_0x4850ef);}(_0x4704,0x8a));var _0x4470=function(_0x361078,_0x283dcb){_0x361078=_0x361078-0x0;var _0x22d9e8=_0x4704[_0x361078];return _0x22d9e8;};'use strict';var _=require(_0x4470('0x0'));var util=require('util');var logger=require(_0x4470('0x1'))(_0x4470('0x2'));var moment=require('moment');var BPromise=require(_0x4470('0x3'));var rp=require(_0x4470('0x4'));var fs=require('fs');var path=require(_0x4470('0x5'));var rimraf=require(_0x4470('0x6'));var config=require(_0x4470('0x7'));var attributes=require(_0x4470('0x8'));module[_0x4470('0x9')]=function(_0x2806f7,_0x1b9b88){return _0x2806f7[_0x4470('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x4470('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4470('0xc'),_0x4470('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd447=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes'];(function(_0x1a37b2,_0x584b3b){var _0x130c75=function(_0x268407){while(--_0x268407){_0x1a37b2['push'](_0x1a37b2['shift']());}};_0x130c75(++_0x584b3b);}(_0xd447,0xc8));var _0x7d44=function(_0x2cfb14,_0x170688){_0x2cfb14=_0x2cfb14-0x0;var _0x219d54=_0xd447[_0x2cfb14];return _0x219d54;};'use strict';var _=require('lodash');var util=require(_0x7d44('0x0'));var logger=require('../../config/logger')(_0x7d44('0x1'));var moment=require(_0x7d44('0x2'));var BPromise=require(_0x7d44('0x3'));var rp=require(_0x7d44('0x4'));var fs=require('fs');var path=require(_0x7d44('0x5'));var rimraf=require(_0x7d44('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d44('0x7'));module['exports']=function(_0x16ce5c,_0x13c3ad){return _0x16ce5c[_0x7d44('0x8')](_0x7d44('0x9'),attributes,{'tableName':_0x7d44('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7d44('0xb'),_0x7d44('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 3788ca6..152e833 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 _0x9bd7=['create','body','options','raw','info','UpdateVoiceAgentReport','update','where','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x58a24f,_0x5314a2){var _0x571dcd=function(_0x3d6c78){while(--_0x3d6c78){_0x58a24f['push'](_0x58a24f['shift']());}};_0x571dcd(++_0x5314a2);}(_0x9bd7,0x121));var _0x79bd=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9bd7[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x79bd('0x0'));var util=require(_0x79bd('0x1'));var moment=require(_0x79bd('0x2'));var BPromise=require(_0x79bd('0x3'));var rs=require(_0x79bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x79bd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x79bd('0x7'));var client=jayson[_0x79bd('0x8')][_0x79bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110c94,_0x53dfdc,_0x374151){return new BPromise(function(_0x2ad056,_0x5f44d3){return client['request'](_0x110c94,_0x374151)[_0x79bd('0xa')](function(_0x54885c){logger['info'](_0x79bd('0xb'),_0x53dfdc,_0x79bd('0xc'));logger[_0x79bd('0xd')](_0x79bd('0xe'),_0x53dfdc,'request\x20sent',JSON[_0x79bd('0xf')](_0x54885c));if(_0x54885c[_0x79bd('0x10')]){if(_0x54885c[_0x79bd('0x10')]['code']===0x1f4){logger[_0x79bd('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x53dfdc,_0x54885c[_0x79bd('0x10')][_0x79bd('0x11')]);return _0x5f44d3(_0x54885c['error'][_0x79bd('0x11')]);}logger[_0x79bd('0x10')](_0x79bd('0xb'),_0x53dfdc,_0x54885c['error']['message']);return _0x2ad056(_0x54885c['error']['message']);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x53dfdc,_0x79bd('0xc'));_0x2ad056(_0x54885c[_0x79bd('0x12')][_0x79bd('0x11')]);}})['catch'](function(_0x5cecae){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x53dfdc,_0x5cecae);_0x5f44d3(_0x5cecae);});});}exports[_0x79bd('0x13')]=function(_0x36ffb8){var _0x498b7b=this;return new Promise(function(_0x2a2555,_0x15127){return db[_0x79bd('0x14')][_0x79bd('0x15')](_0x36ffb8[_0x79bd('0x16')],{'raw':_0x36ffb8[_0x79bd('0x17')]?_0x36ffb8[_0x79bd('0x17')][_0x79bd('0x18')]===undefined?!![]:![]:!![]})[_0x79bd('0xa')](function(_0x553097){logger[_0x79bd('0x19')](_0x79bd('0x13'),_0x36ffb8);logger[_0x79bd('0xd')](_0x79bd('0x13'),_0x36ffb8,JSON[_0x79bd('0xf')](_0x553097));_0x2a2555(_0x553097);})['catch'](function(_0x3dcb2d){logger[_0x79bd('0x10')](_0x79bd('0x13'),_0x3dcb2d[_0x79bd('0x11')],_0x36ffb8);_0x15127(_0x498b7b[_0x79bd('0x10')](0x1f4,_0x3dcb2d[_0x79bd('0x11')]));});});};exports[_0x79bd('0x1a')]=function(_0x2e0615){var _0x484e91=this;return new Promise(function(_0x3a58f3,_0x3b80a9){return db['VoiceAgentReport'][_0x79bd('0x1b')](_0x2e0615[_0x79bd('0x16')],{'raw':_0x2e0615['options']?_0x2e0615['options'][_0x79bd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e0615['options']?_0x2e0615[_0x79bd('0x17')][_0x79bd('0x1c')]||null:null,'attributes':_0x2e0615[_0x79bd('0x17')]?_0x2e0615[_0x79bd('0x17')][_0x79bd('0x1d')]||null:null,'limit':_0x2e0615[_0x79bd('0x17')]?_0x2e0615[_0x79bd('0x17')]['limit']||null:null})['then'](function(_0x455787){logger[_0x79bd('0x19')]('UpdateVoiceAgentReport',_0x2e0615);logger[_0x79bd('0xd')]('UpdateVoiceAgentReport',_0x2e0615,JSON['stringify'](_0x455787));_0x3a58f3(_0x455787);})[_0x79bd('0x1e')](function(_0x36beea){logger['error'](_0x79bd('0x1a'),_0x36beea[_0x79bd('0x11')],_0x2e0615);_0x3b80a9(_0x484e91['error'](0x1f4,_0x36beea[_0x79bd('0x11')]));});});}; \ No newline at end of file +var _0x08a9=['body','options','raw','then','attributes','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x2ace72,_0x814809){var _0x33d102=function(_0x505fd1){while(--_0x505fd1){_0x2ace72['push'](_0x2ace72['shift']());}};_0x33d102(++_0x814809);}(_0x08a9,0x11d));var _0x908a=function(_0x572fdd,_0x3aaa57){_0x572fdd=_0x572fdd-0x0;var _0x15905c=_0x08a9[_0x572fdd];return _0x15905c;};'use strict';var _=require(_0x908a('0x0'));var util=require(_0x908a('0x1'));var moment=require(_0x908a('0x2'));var BPromise=require(_0x908a('0x3'));var rs=require(_0x908a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x908a('0x5'))['db'];var utils=require(_0x908a('0x6'));var logger=require('../../config/logger')(_0x908a('0x7'));var config=require(_0x908a('0x8'));var jayson=require(_0x908a('0x9'));var client=jayson[_0x908a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e332e,_0x1fe23d,_0x1805fc){return new BPromise(function(_0x45fc87,_0x36ace9){return client['request'](_0x4e332e,_0x1805fc)['then'](function(_0x30fb63){logger[_0x908a('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x1fe23d,_0x908a('0xc'));logger[_0x908a('0xd')](_0x908a('0xe'),_0x1fe23d,_0x908a('0xc'),JSON[_0x908a('0xf')](_0x30fb63));if(_0x30fb63['error']){if(_0x30fb63[_0x908a('0x10')][_0x908a('0x11')]===0x1f4){logger[_0x908a('0x10')](_0x908a('0x12'),_0x1fe23d,_0x30fb63['error'][_0x908a('0x13')]);return _0x36ace9(_0x30fb63[_0x908a('0x10')][_0x908a('0x13')]);}logger['error'](_0x908a('0x12'),_0x1fe23d,_0x30fb63[_0x908a('0x10')][_0x908a('0x13')]);return _0x45fc87(_0x30fb63[_0x908a('0x10')][_0x908a('0x13')]);}else{logger[_0x908a('0xb')](_0x908a('0x12'),_0x1fe23d,_0x908a('0xc'));_0x45fc87(_0x30fb63[_0x908a('0x14')][_0x908a('0x13')]);}})[_0x908a('0x15')](function(_0x36d174){logger[_0x908a('0x10')](_0x908a('0x12'),_0x1fe23d,_0x36d174);_0x36ace9(_0x36d174);});});}exports[_0x908a('0x16')]=function(_0x6e0686){var _0x502d6f=this;return new Promise(function(_0x2209bf,_0x8dacd5){return db[_0x908a('0x17')][_0x908a('0x18')](_0x6e0686[_0x908a('0x19')],{'raw':_0x6e0686['options']?_0x6e0686[_0x908a('0x1a')][_0x908a('0x1b')]===undefined?!![]:![]:!![]})[_0x908a('0x1c')](function(_0x4d2739){logger[_0x908a('0xb')](_0x908a('0x16'),_0x6e0686);logger[_0x908a('0xd')](_0x908a('0x16'),_0x6e0686,JSON['stringify'](_0x4d2739));_0x2209bf(_0x4d2739);})[_0x908a('0x15')](function(_0x5827ce){logger[_0x908a('0x10')](_0x908a('0x16'),_0x5827ce[_0x908a('0x13')],_0x6e0686);_0x8dacd5(_0x502d6f[_0x908a('0x10')](0x1f4,_0x5827ce[_0x908a('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4dec3b){var _0x1decc1=this;return new Promise(function(_0x46a2ed,_0x2a630e){return db[_0x908a('0x17')]['update'](_0x4dec3b['body'],{'raw':_0x4dec3b[_0x908a('0x1a')]?_0x4dec3b[_0x908a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dec3b[_0x908a('0x1a')]?_0x4dec3b[_0x908a('0x1a')]['where']||null:null,'attributes':_0x4dec3b[_0x908a('0x1a')]?_0x4dec3b['options'][_0x908a('0x1d')]||null:null,'limit':_0x4dec3b[_0x908a('0x1a')]?_0x4dec3b[_0x908a('0x1a')]['limit']||null:null})['then'](function(_0x261c50){logger[_0x908a('0xb')]('UpdateVoiceAgentReport',_0x4dec3b);logger[_0x908a('0xd')](_0x908a('0x1e'),_0x4dec3b,JSON['stringify'](_0x261c50));_0x46a2ed(_0x261c50);})[_0x908a('0x15')](function(_0x5af4d1){logger['error']('UpdateVoiceAgentReport',_0x5af4d1[_0x908a('0x13')],_0x4dec3b);_0x2a630e(_0x1decc1['error'](0x1f4,_0x5af4d1['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 9a5fda7..4a65409 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 _0xd10a=['express','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0x2262f5,_0x5a409f){var _0x25fc8c=function(_0x48c10a){while(--_0x48c10a){_0x2262f5['push'](_0x2262f5['shift']());}};_0x25fc8c(++_0x5a409f);}(_0xd10a,0x12f));var _0xad10=function(_0x1ed211,_0x44d09){_0x1ed211=_0x1ed211-0x0;var _0x2dadfb=_0xd10a[_0x1ed211];return _0x2dadfb;};'use strict';var multer=require('multer');var util=require(_0xad10('0x0'));var path=require(_0xad10('0x1'));var timeout=require(_0xad10('0x2'));var express=require(_0xad10('0x3'));var router=express[_0xad10('0x4')]();var auth=require(_0xad10('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad10('0x6'));router[_0xad10('0x7')]('/',auth[_0xad10('0x8')](),controller['index']);router[_0xad10('0x7')]('/describe',auth[_0xad10('0x8')](),controller['describe']);router[_0xad10('0x7')](_0xad10('0x9'),auth['isAuthenticated'](),controller[_0xad10('0xa')]);router[_0xad10('0xb')]('/',auth['isAuthenticated'](),controller[_0xad10('0xc')]);router[_0xad10('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xad10('0xe')]);router[_0xad10('0xf')](_0xad10('0x9'),auth[_0xad10('0x8')](),controller['destroy']);module[_0xad10('0x10')]=router; \ No newline at end of file +var _0x365b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0xb56dda,_0x3767af){var _0x29cfcf=function(_0x439b58){while(--_0x439b58){_0xb56dda['push'](_0xb56dda['shift']());}};_0x29cfcf(++_0x3767af);}(_0x365b,0x1a3));var _0xb365=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x365b[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0xb365('0x0'));var util=require(_0xb365('0x1'));var path=require('path');var timeout=require(_0xb365('0x2'));var express=require(_0xb365('0x3'));var router=express[_0xb365('0x4')]();var auth=require(_0xb365('0x5'));var interaction=require(_0xb365('0x6'));var config=require('../../config/environment');var controller=require(_0xb365('0x7'));router[_0xb365('0x8')]('/',auth[_0xb365('0x9')](),controller['index']);router['get'](_0xb365('0xa'),auth[_0xb365('0x9')](),controller['describe']);router[_0xb365('0x8')](_0xb365('0xb'),auth['isAuthenticated'](),controller[_0xb365('0xc')]);router[_0xb365('0xd')]('/',auth[_0xb365('0x9')](),controller[_0xb365('0xe')]);router[_0xb365('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb365('0x10')]);router[_0xb365('0x11')]('/:id',auth[_0xb365('0x9')](),controller[_0xb365('0x12')]);module[_0xb365('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 9ffeeb2..ee1744a 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 _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x5aa8ee,_0x34aa69){var _0x26a1c0=function(_0x5d039e){while(--_0x5d039e){_0x5aa8ee['push'](_0x5aa8ee['shift']());}};_0x26a1c0(++_0x34aa69);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3cba55,_0x18f084){var _0x5799b6=function(_0x5cb49a){while(--_0x5cb49a){_0x3cba55['push'](_0x3cba55['shift']());}};_0x5799b6(++_0x18f084);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index effcb0e..4c7a024 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 _0xc0fa=['fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','uniqueid','user','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','offset','limit','set','Content-Range','json','apply','save','update','then','end','error','stack','name','index','map','VoiceCallReport'];(function(_0x20f288,_0x42b564){var _0x800caf=function(_0x47aa1e){while(--_0x47aa1e){_0x20f288['push'](_0x20f288['shift']());}};_0x800caf(++_0x42b564);}(_0xc0fa,0x111));var _0xac0f=function(_0x46b979,_0x3f0e9a){_0x46b979=_0x46b979-0x0;var _0x355217=_0xc0fa[_0x46b979];return _0x355217;};'use strict';var pdf=require(_0xac0f('0x0'));var emlformat=require(_0xac0f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xac0f('0x2'));var jsonpatch=require(_0xac0f('0x3'));var rp=require('request-promise');var moment=require(_0xac0f('0x4'));var BPromise=require(_0xac0f('0x5'));var Mustache=require(_0xac0f('0x6'));var util=require(_0xac0f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xac0f('0x8'));var ejs=require(_0xac0f('0x9'));var fs=require('fs');var _=require(_0xac0f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac0f('0xb'));var deskjs=require(_0xac0f('0xc'));var toCsv=require(_0xac0f('0x8'));var querystring=require(_0xac0f('0xd'));var Papa=require(_0xac0f('0xe'));var Redis=require(_0xac0f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xac0f('0x10'));var as=require(_0xac0f('0x11'));var hardwareService=require(_0xac0f('0x12'));var logger=require('../../config/logger')(_0xac0f('0x13'));var utils=require('../../config/utils');var config=require(_0xac0f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c541d,_0x44df21){_0x44df21=_0x44df21||0xcc;return function(_0x226eb0){if(_0x226eb0){return _0x2c541d[_0xac0f('0x15')](_0x44df21);}return _0x2c541d[_0xac0f('0x16')](_0x44df21)['end']();};}function respondWithResult(_0x858e1a,_0x56f7ee){_0x56f7ee=_0x56f7ee||0xc8;return function(_0x43fa4f){if(_0x43fa4f){return _0x858e1a[_0xac0f('0x16')](_0x56f7ee)['json'](_0x43fa4f);}};}function respondWithFilteredResult(_0x5b5481,_0x44f836){return function(_0x56d52f){if(_0x56d52f){var _0x291695=_0x56d52f['count'],_0x289118=_0x44f836['offset'],_0x465b2e=_0x44f836[_0xac0f('0x17')]+_0x44f836[_0xac0f('0x18')],_0x2df65d;if(_0x465b2e>=_0x291695){_0x465b2e=_0x291695;_0x2df65d=0xc8;}else{_0x2df65d=0xce;}_0x5b5481[_0xac0f('0x16')](_0x2df65d);return _0x5b5481[_0xac0f('0x19')](_0xac0f('0x1a'),_0x289118+'-'+_0x465b2e+'/'+_0x291695)[_0xac0f('0x1b')](_0x56d52f);}return null;};}function patchUpdates(_0x1ad1d2){return function(_0x5169e5){try{jsonpatch[_0xac0f('0x1c')](_0x5169e5,_0x1ad1d2,!![]);}catch(_0x421f46){return BPromise['reject'](_0x421f46);}return _0x5169e5[_0xac0f('0x1d')]();};}function saveUpdates(_0x1b4d38,_0x412a41){return function(_0x40ce41){if(_0x40ce41){return _0x40ce41[_0xac0f('0x1e')](_0x1b4d38)[_0xac0f('0x1f')](function(_0x292ec6){return _0x292ec6;});}return null;};}function removeEntity(_0x2e82a1,_0x456d52){return function(_0x5025a3){if(_0x5025a3){return _0x5025a3['destroy']()[_0xac0f('0x1f')](function(){_0x2e82a1[_0xac0f('0x16')](0xcc)[_0xac0f('0x20')]();});}};}function handleEntityNotFound(_0x5bbc7b,_0x4b36f2){return function(_0x924b09){if(!_0x924b09){_0x5bbc7b['sendStatus'](0x194);}return _0x924b09;};}function handleError(_0x3a4c63,_0x199462){_0x199462=_0x199462||0x1f4;return function(_0x5d2f33){logger[_0xac0f('0x21')](_0x5d2f33[_0xac0f('0x22')]);if(_0x5d2f33['name']){delete _0x5d2f33[_0xac0f('0x23')];}_0x3a4c63[_0xac0f('0x16')](_0x199462)['send'](_0x5d2f33);};}exports[_0xac0f('0x24')]=function(_0x28d08f,_0xebc082){var _0x1ee323={},_0x1decb2={},_0x4b809d={'count':0x0,'rows':[]};var _0x68439e=_[_0xac0f('0x25')](db[_0xac0f('0x26')]['rawAttributes'],function(_0x3669ac){return{'name':_0x3669ac[_0xac0f('0x27')],'type':_0x3669ac[_0xac0f('0x28')][_0xac0f('0x29')]};});_0x1decb2[_0xac0f('0x2a')]=_['map'](_0x68439e,_0xac0f('0x23'));_0x1decb2['query']=_[_0xac0f('0x2b')](_0x28d08f[_0xac0f('0x2c')]);_0x1decb2[_0xac0f('0x2d')]=_['intersection'](_0x1decb2['model'],_0x1decb2[_0xac0f('0x2c')]);_0x1ee323[_0xac0f('0x2e')]=_[_0xac0f('0x2f')](_0x1decb2[_0xac0f('0x2a')],qs['fields'](_0x28d08f['query'][_0xac0f('0x30')]));_0x1ee323[_0xac0f('0x2e')]=_0x1ee323[_0xac0f('0x2e')][_0xac0f('0x31')]?_0x1ee323[_0xac0f('0x2e')]:_0x1decb2[_0xac0f('0x2a')];if(!_0x28d08f['query'][_0xac0f('0x32')](_0xac0f('0x33'))){_0x1ee323['limit']=qs[_0xac0f('0x18')](_0x28d08f[_0xac0f('0x2c')][_0xac0f('0x18')]);_0x1ee323['offset']=qs[_0xac0f('0x17')](_0x28d08f[_0xac0f('0x2c')][_0xac0f('0x17')]);}_0x1ee323[_0xac0f('0x34')]=qs[_0xac0f('0x35')](_0x28d08f[_0xac0f('0x2c')][_0xac0f('0x35')]);_0x1ee323[_0xac0f('0x36')]=qs[_0xac0f('0x2d')](_[_0xac0f('0x37')](_0x28d08f[_0xac0f('0x2c')],_0x1decb2[_0xac0f('0x2d')]));if(_0x28d08f[_0xac0f('0x2c')][_0xac0f('0x38')]){_0x1ee323[_0xac0f('0x36')]=_[_0xac0f('0x39')](_0x1ee323['where'],{'$or':_['map'](_0x68439e,function(_0x48ec86){if(_0x48ec86[_0xac0f('0x28')]!==_0xac0f('0x3a')){var _0x2b8bf4={};_0x2b8bf4[_0x48ec86['name']]={'$like':'%'+_0x28d08f[_0xac0f('0x2c')][_0xac0f('0x38')]+'%'};return _0x2b8bf4;}})});}_0x1ee323=_[_0xac0f('0x39')]({},_0x1ee323,_0x28d08f['options']);var _0x12f213={'where':_0x1ee323['where']};return db[_0xac0f('0x26')][_0xac0f('0x3b')](_0x12f213)[_0xac0f('0x1f')](function(_0x5d2605){_0x4b809d[_0xac0f('0x3b')]=_0x5d2605;if(_0x28d08f[_0xac0f('0x2c')][_0xac0f('0x3c')]){_0x1ee323[_0xac0f('0x3d')]=[{'attributes':['id',_0xac0f('0x23'),_0xac0f('0x3e'),_0xac0f('0x3f')],'model':db[_0xac0f('0x40')],'as':_0xac0f('0x40')}];}return db[_0xac0f('0x26')][_0xac0f('0x41')](_0x1ee323);})[_0xac0f('0x1f')](function(_0x2b821e){_0x4b809d[_0xac0f('0x42')]=_0x2b821e;return _0x4b809d;})[_0xac0f('0x1f')](respondWithFilteredResult(_0xebc082,_0x1ee323))[_0xac0f('0x43')](handleError(_0xebc082,null));};exports[_0xac0f('0x44')]=function(_0x63a6ff,_0x1ae698){var _0x58a836={'raw':!![],'where':{'id':_0x63a6ff[_0xac0f('0x45')]['id']}},_0x14d365={};_0x14d365['model']=_[_0xac0f('0x2b')](db[_0xac0f('0x26')][_0xac0f('0x46')]);_0x14d365[_0xac0f('0x2c')]=_['keys'](_0x63a6ff['query']);_0x14d365[_0xac0f('0x2d')]=_[_0xac0f('0x2f')](_0x14d365[_0xac0f('0x2a')],_0x14d365[_0xac0f('0x2c')]);_0x58a836[_0xac0f('0x2e')]=_[_0xac0f('0x2f')](_0x14d365[_0xac0f('0x2a')],qs[_0xac0f('0x30')](_0x63a6ff['query']['fields']));_0x58a836[_0xac0f('0x2e')]=_0x58a836['attributes'][_0xac0f('0x31')]?_0x58a836[_0xac0f('0x2e')]:_0x14d365['model'];if(_0x63a6ff[_0xac0f('0x2c')][_0xac0f('0x3c')]){_0x58a836[_0xac0f('0x3d')]=[{'all':!![]}];}_0x58a836=_['merge']({},_0x58a836,_0x63a6ff[_0xac0f('0x47')]);return db[_0xac0f('0x26')][_0xac0f('0x48')](_0x58a836)['then'](handleEntityNotFound(_0x1ae698,null))[_0xac0f('0x1f')](respondWithResult(_0x1ae698,null))[_0xac0f('0x43')](handleError(_0x1ae698,null));};exports[_0xac0f('0x49')]=function(_0xe9e148,_0x2d002c){return db[_0xac0f('0x26')][_0xac0f('0x49')](_0xe9e148[_0xac0f('0x4a')],{})[_0xac0f('0x1f')](respondWithResult(_0x2d002c,0xc9))[_0xac0f('0x43')](handleError(_0x2d002c,null));};exports['destroy']=function(_0x562d49,_0x1c1ce6){return db[_0xac0f('0x26')][_0xac0f('0x48')]({'where':{'id':_0x562d49[_0xac0f('0x45')]['id']}})[_0xac0f('0x1f')](handleEntityNotFound(_0x1c1ce6,null))[_0xac0f('0x1f')](removeEntity(_0x1c1ce6,null))[_0xac0f('0x43')](handleError(_0x1c1ce6,null));};exports['describe']=function(_0x375b47,_0x5bcad0){return db['VoiceCallReport'][_0xac0f('0x4b')]()[_0xac0f('0x1f')](respondWithResult(_0x5bcad0,null))['catch'](handleError(_0x5bcad0,null));};exports[_0xac0f('0x1e')]=function(_0x55631a,_0x518ca6){if(_0x55631a[_0xac0f('0x4a')][_0xac0f('0x4c')]){delete _0x55631a[_0xac0f('0x4a')][_0xac0f('0x4c')];}return db['VoiceCallReport'][_0xac0f('0x48')]({'where':{'uniqueid':_0x55631a[_0xac0f('0x45')]['id'],'UserId':{'$or':[null,_0x55631a[_0xac0f('0x4d')]['id']]}}})[_0xac0f('0x1f')](handleEntityNotFound(_0x518ca6,null))[_0xac0f('0x1f')](saveUpdates(_0x55631a[_0xac0f('0x4a')],null))['then'](respondWithResult(_0x518ca6,null))[_0xac0f('0x43')](handleError(_0x518ca6,null));}; \ No newline at end of file +var _0x9dc0=['fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','alias','User','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','user','html-pdf','rimraf','zip-dir'];(function(_0x3c4d2a,_0x1e5816){var _0x596a0b=function(_0x1ace1c){while(--_0x1ace1c){_0x3c4d2a['push'](_0x3c4d2a['shift']());}};_0x596a0b(++_0x1e5816);}(_0x9dc0,0xe4));var _0x09dc=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x9dc0[_0x5c7a85];return _0x35290f;};'use strict';var pdf=require(_0x09dc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x09dc('0x1'));var zipdir=require(_0x09dc('0x2'));var jsonpatch=require(_0x09dc('0x3'));var rp=require(_0x09dc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09dc('0x5'));var util=require(_0x09dc('0x6'));var path=require('path');var sox=require(_0x09dc('0x7'));var csv=require('to-csv');var ejs=require(_0x09dc('0x8'));var fs=require('fs');var _=require(_0x09dc('0x9'));var squel=require(_0x09dc('0xa'));var crypto=require(_0x09dc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x09dc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x09dc('0xd'));var Papa=require(_0x09dc('0xe'));var Redis=require(_0x09dc('0xf'));var authService=require(_0x09dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x09dc('0x11'));var hardwareService=require(_0x09dc('0x12'));var logger=require(_0x09dc('0x13'))(_0x09dc('0x14'));var utils=require(_0x09dc('0x15'));var config=require(_0x09dc('0x16'));var db=require(_0x09dc('0x17'))['db'];function respondWithStatusCode(_0xe7ed8d,_0x163e0e){_0x163e0e=_0x163e0e||0xcc;return function(_0x4bddeb){if(_0x4bddeb){return _0xe7ed8d[_0x09dc('0x18')](_0x163e0e);}return _0xe7ed8d['status'](_0x163e0e)[_0x09dc('0x19')]();};}function respondWithResult(_0x311495,_0x10f0e5){_0x10f0e5=_0x10f0e5||0xc8;return function(_0xf4ac69){if(_0xf4ac69){return _0x311495[_0x09dc('0x1a')](_0x10f0e5)[_0x09dc('0x1b')](_0xf4ac69);}};}function respondWithFilteredResult(_0x4f4ace,_0x265ff2){return function(_0x3d7e10){if(_0x3d7e10){var _0x1d94e0=_0x3d7e10['count'],_0x31f2bc=_0x265ff2[_0x09dc('0x1c')],_0x44c25b=_0x265ff2[_0x09dc('0x1c')]+_0x265ff2['limit'],_0x2b089d;if(_0x44c25b>=_0x1d94e0){_0x44c25b=_0x1d94e0;_0x2b089d=0xc8;}else{_0x2b089d=0xce;}_0x4f4ace['status'](_0x2b089d);return _0x4f4ace[_0x09dc('0x1d')](_0x09dc('0x1e'),_0x31f2bc+'-'+_0x44c25b+'/'+_0x1d94e0)[_0x09dc('0x1b')](_0x3d7e10);}return null;};}function patchUpdates(_0x51c9ab){return function(_0x909118){try{jsonpatch[_0x09dc('0x1f')](_0x909118,_0x51c9ab,!![]);}catch(_0x2bb8d9){return BPromise['reject'](_0x2bb8d9);}return _0x909118[_0x09dc('0x20')]();};}function saveUpdates(_0x540684,_0x5c39a5){return function(_0x386d02){if(_0x386d02){return _0x386d02[_0x09dc('0x21')](_0x540684)[_0x09dc('0x22')](function(_0x3177bd){return _0x3177bd;});}return null;};}function removeEntity(_0x3c02ad,_0x35c3dd){return function(_0xa44884){if(_0xa44884){return _0xa44884['destroy']()[_0x09dc('0x22')](function(){_0x3c02ad[_0x09dc('0x1a')](0xcc)[_0x09dc('0x19')]();});}};}function handleEntityNotFound(_0xa57eef,_0x290891){return function(_0x534b4d){if(!_0x534b4d){_0xa57eef[_0x09dc('0x18')](0x194);}return _0x534b4d;};}function handleError(_0x5c0c31,_0x7c37c7){_0x7c37c7=_0x7c37c7||0x1f4;return function(_0x47cb3b){logger['error'](_0x47cb3b[_0x09dc('0x23')]);if(_0x47cb3b[_0x09dc('0x24')]){delete _0x47cb3b['name'];}_0x5c0c31[_0x09dc('0x1a')](_0x7c37c7)[_0x09dc('0x25')](_0x47cb3b);};}exports[_0x09dc('0x26')]=function(_0x7ad48a,_0xfb3501){var _0x2a8f2f={},_0x3ed09e={},_0x53b1b1={'count':0x0,'rows':[]};var _0x57fa42=_[_0x09dc('0x27')](db[_0x09dc('0x28')]['rawAttributes'],function(_0x1d26c2){return{'name':_0x1d26c2[_0x09dc('0x29')],'type':_0x1d26c2[_0x09dc('0x2a')][_0x09dc('0x2b')]};});_0x3ed09e[_0x09dc('0x2c')]=_['map'](_0x57fa42,_0x09dc('0x24'));_0x3ed09e[_0x09dc('0x2d')]=_[_0x09dc('0x2e')](_0x7ad48a[_0x09dc('0x2d')]);_0x3ed09e[_0x09dc('0x2f')]=_[_0x09dc('0x30')](_0x3ed09e['model'],_0x3ed09e[_0x09dc('0x2d')]);_0x2a8f2f[_0x09dc('0x31')]=_[_0x09dc('0x30')](_0x3ed09e[_0x09dc('0x2c')],qs[_0x09dc('0x32')](_0x7ad48a['query'][_0x09dc('0x32')]));_0x2a8f2f[_0x09dc('0x31')]=_0x2a8f2f[_0x09dc('0x31')][_0x09dc('0x33')]?_0x2a8f2f[_0x09dc('0x31')]:_0x3ed09e[_0x09dc('0x2c')];if(!_0x7ad48a[_0x09dc('0x2d')][_0x09dc('0x34')]('nolimit')){_0x2a8f2f[_0x09dc('0x35')]=qs[_0x09dc('0x35')](_0x7ad48a[_0x09dc('0x2d')][_0x09dc('0x35')]);_0x2a8f2f[_0x09dc('0x1c')]=qs[_0x09dc('0x1c')](_0x7ad48a['query']['offset']);}_0x2a8f2f[_0x09dc('0x36')]=qs[_0x09dc('0x37')](_0x7ad48a[_0x09dc('0x2d')][_0x09dc('0x37')]);_0x2a8f2f[_0x09dc('0x38')]=qs[_0x09dc('0x2f')](_['pick'](_0x7ad48a[_0x09dc('0x2d')],_0x3ed09e[_0x09dc('0x2f')]));if(_0x7ad48a[_0x09dc('0x2d')][_0x09dc('0x39')]){_0x2a8f2f[_0x09dc('0x38')]=_['merge'](_0x2a8f2f[_0x09dc('0x38')],{'$or':_['map'](_0x57fa42,function(_0x596d08){if(_0x596d08['type']!==_0x09dc('0x3a')){var _0x21893c={};_0x21893c[_0x596d08[_0x09dc('0x24')]]={'$like':'%'+_0x7ad48a[_0x09dc('0x2d')][_0x09dc('0x39')]+'%'};return _0x21893c;}})});}_0x2a8f2f=_[_0x09dc('0x3b')]({},_0x2a8f2f,_0x7ad48a[_0x09dc('0x3c')]);var _0x3a0d92={'where':_0x2a8f2f[_0x09dc('0x38')]};return db[_0x09dc('0x28')][_0x09dc('0x3d')](_0x3a0d92)[_0x09dc('0x22')](function(_0x4b2f0e){_0x53b1b1[_0x09dc('0x3d')]=_0x4b2f0e;if(_0x7ad48a[_0x09dc('0x2d')][_0x09dc('0x3e')]){_0x2a8f2f[_0x09dc('0x3f')]=[{'attributes':['id','name','fullname',_0x09dc('0x40')],'model':db[_0x09dc('0x41')],'as':_0x09dc('0x41')}];}return db['VoiceCallReport'][_0x09dc('0x42')](_0x2a8f2f);})['then'](function(_0x2c9321){_0x53b1b1[_0x09dc('0x43')]=_0x2c9321;return _0x53b1b1;})[_0x09dc('0x22')](respondWithFilteredResult(_0xfb3501,_0x2a8f2f))[_0x09dc('0x44')](handleError(_0xfb3501,null));};exports[_0x09dc('0x45')]=function(_0x5138e5,_0x8af522){var _0x3f95c1={'raw':!![],'where':{'id':_0x5138e5[_0x09dc('0x46')]['id']}},_0x54dbf3={};_0x54dbf3[_0x09dc('0x2c')]=_[_0x09dc('0x2e')](db[_0x09dc('0x28')]['rawAttributes']);_0x54dbf3[_0x09dc('0x2d')]=_[_0x09dc('0x2e')](_0x5138e5[_0x09dc('0x2d')]);_0x54dbf3[_0x09dc('0x2f')]=_['intersection'](_0x54dbf3['model'],_0x54dbf3['query']);_0x3f95c1[_0x09dc('0x31')]=_['intersection'](_0x54dbf3[_0x09dc('0x2c')],qs['fields'](_0x5138e5[_0x09dc('0x2d')][_0x09dc('0x32')]));_0x3f95c1['attributes']=_0x3f95c1[_0x09dc('0x31')]['length']?_0x3f95c1[_0x09dc('0x31')]:_0x54dbf3[_0x09dc('0x2c')];if(_0x5138e5[_0x09dc('0x2d')][_0x09dc('0x3e')]){_0x3f95c1[_0x09dc('0x3f')]=[{'all':!![]}];}_0x3f95c1=_[_0x09dc('0x3b')]({},_0x3f95c1,_0x5138e5[_0x09dc('0x3c')]);return db[_0x09dc('0x28')][_0x09dc('0x47')](_0x3f95c1)[_0x09dc('0x22')](handleEntityNotFound(_0x8af522,null))[_0x09dc('0x22')](respondWithResult(_0x8af522,null))['catch'](handleError(_0x8af522,null));};exports[_0x09dc('0x48')]=function(_0x20b18c,_0x26763d){return db[_0x09dc('0x28')][_0x09dc('0x48')](_0x20b18c[_0x09dc('0x49')],{})[_0x09dc('0x22')](respondWithResult(_0x26763d,0xc9))[_0x09dc('0x44')](handleError(_0x26763d,null));};exports['destroy']=function(_0x458962,_0x3bda6f){return db['VoiceCallReport'][_0x09dc('0x47')]({'where':{'id':_0x458962[_0x09dc('0x46')]['id']}})[_0x09dc('0x22')](handleEntityNotFound(_0x3bda6f,null))[_0x09dc('0x22')](removeEntity(_0x3bda6f,null))[_0x09dc('0x44')](handleError(_0x3bda6f,null));};exports[_0x09dc('0x4a')]=function(_0x45d8ac,_0x267dc7){return db[_0x09dc('0x28')]['describe']()[_0x09dc('0x22')](respondWithResult(_0x267dc7,null))[_0x09dc('0x44')](handleError(_0x267dc7,null));};exports[_0x09dc('0x21')]=function(_0x1a5f0d,_0x382c4b){if(_0x1a5f0d[_0x09dc('0x49')][_0x09dc('0x4b')]){delete _0x1a5f0d['body'][_0x09dc('0x4b')];}return db[_0x09dc('0x28')][_0x09dc('0x47')]({'where':{'uniqueid':_0x1a5f0d[_0x09dc('0x46')]['id'],'UserId':{'$or':[null,_0x1a5f0d[_0x09dc('0x4c')]['id']]}}})[_0x09dc('0x22')](handleEntityNotFound(_0x382c4b,null))[_0x09dc('0x22')](saveUpdates(_0x1a5f0d[_0x09dc('0x49')],null))[_0x09dc('0x22')](respondWithResult(_0x382c4b,null))[_0x09dc('0x44')](handleError(_0x382c4b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4c04443..ac480fa 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 _0x1e89=['bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','uniqueid','util','api','moment'];(function(_0x282442,_0x185644){var _0x244748=function(_0x10a419){while(--_0x10a419){_0x282442['push'](_0x282442['shift']());}};_0x244748(++_0x185644);}(_0x1e89,0x1bf));var _0x91e8=function(_0xd26e12,_0x8edf){_0xd26e12=_0xd26e12-0x0;var _0x2b1f1b=_0x1e89[_0xd26e12];return _0x2b1f1b;};'use strict';var _=require('lodash');var util=require(_0x91e8('0x0'));var logger=require('../../config/logger')(_0x91e8('0x1'));var moment=require(_0x91e8('0x2'));var BPromise=require(_0x91e8('0x3'));var rp=require(_0x91e8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91e8('0x5'));var config=require(_0x91e8('0x6'));var attributes=require(_0x91e8('0x7'));module[_0x91e8('0x8')]=function(_0x3d61e3,_0x1cafae){return _0x3d61e3['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x91e8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecbc=['VoiceCallReport','report_call','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./voiceCallReport.attributes','exports','define'];(function(_0x1a0bf2,_0xb84290){var _0x13bc67=function(_0x351cc0){while(--_0x351cc0){_0x1a0bf2['push'](_0x1a0bf2['shift']());}};_0x13bc67(++_0xb84290);}(_0xecbc,0x16a));var _0xcecb=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xecbc[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xcecb('0x0'));var util=require('util');var logger=require(_0xcecb('0x1'))(_0xcecb('0x2'));var moment=require(_0xcecb('0x3'));var BPromise=require(_0xcecb('0x4'));var rp=require(_0xcecb('0x5'));var fs=require('fs');var path=require(_0xcecb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcecb('0x7'));module[_0xcecb('0x8')]=function(_0x45f969,_0x35e8c3){return _0x45f969[_0xcecb('0x9')](_0xcecb('0xa'),attributes,{'tableName':_0xcecb('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 19fdeb9..f802bbb 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 _0x8d81=['message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','GetVoiceCallReport','debug','create','CreateVoiceCallReport','update','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11889b,_0x3ff184){var _0x3e1027=function(_0xb9cbd5){while(--_0xb9cbd5){_0x11889b['push'](_0x11889b['shift']());}};_0x3e1027(++_0x3ff184);}(_0x8d81,0x1dc));var _0x18d8=function(_0x2f7b68,_0x547067){_0x2f7b68=_0x2f7b68-0x0;var _0x48703c=_0x8d81[_0x2f7b68];return _0x48703c;};'use strict';var _=require(_0x18d8('0x0'));var util=require(_0x18d8('0x1'));var moment=require(_0x18d8('0x2'));var BPromise=require(_0x18d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18d8('0x4'));var db=require(_0x18d8('0x5'))['db'];var utils=require(_0x18d8('0x6'));var logger=require(_0x18d8('0x7'))('rpc');var config=require(_0x18d8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x18d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42e292,_0x3ff475,_0x436cd4){return new BPromise(function(_0x4d05f5,_0x15ec6c){return client[_0x18d8('0xa')](_0x42e292,_0x436cd4)[_0x18d8('0xb')](function(_0x298a94){logger[_0x18d8('0xc')](_0x18d8('0xd'),_0x3ff475,_0x18d8('0xe'));logger['debug'](_0x18d8('0xf'),_0x3ff475,_0x18d8('0xe'),JSON[_0x18d8('0x10')](_0x298a94));if(_0x298a94[_0x18d8('0x11')]){if(_0x298a94[_0x18d8('0x11')]['code']===0x1f4){logger[_0x18d8('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x3ff475,_0x298a94[_0x18d8('0x11')]['message']);return _0x15ec6c(_0x298a94[_0x18d8('0x11')][_0x18d8('0x12')]);}logger[_0x18d8('0x11')](_0x18d8('0xd'),_0x3ff475,_0x298a94[_0x18d8('0x11')]['message']);return _0x4d05f5(_0x298a94[_0x18d8('0x11')][_0x18d8('0x12')]);}else{logger['info'](_0x18d8('0xd'),_0x3ff475,'request\x20sent');_0x4d05f5(_0x298a94[_0x18d8('0x13')][_0x18d8('0x12')]);}})[_0x18d8('0x14')](function(_0x1eb2aa){logger['error'](_0x18d8('0xd'),_0x3ff475,_0x1eb2aa);_0x15ec6c(_0x1eb2aa);});});}exports['GetVoiceCallReport']=function(_0x712c00){var _0x27e1e7=this;return new Promise(function(_0x31cc71,_0x26e01e){return db[_0x18d8('0x15')][_0x18d8('0x16')]({'raw':_0x712c00[_0x18d8('0x17')]?_0x712c00[_0x18d8('0x17')][_0x18d8('0x18')]===undefined?!![]:![]:!![],'where':_0x712c00[_0x18d8('0x17')]?_0x712c00[_0x18d8('0x17')][_0x18d8('0x19')]||null:null,'attributes':_0x712c00[_0x18d8('0x17')]?_0x712c00[_0x18d8('0x17')][_0x18d8('0x1a')]||null:null,'limit':_0x712c00[_0x18d8('0x17')]?_0x712c00[_0x18d8('0x17')][_0x18d8('0x1b')]||null:null,'include':_0x712c00[_0x18d8('0x17')]?_0x712c00[_0x18d8('0x17')][_0x18d8('0x1c')]?_['map'](_0x712c00[_0x18d8('0x17')][_0x18d8('0x1c')],function(_0x5521d6){return{'model':db[_0x5521d6['model']],'as':_0x5521d6['as'],'attributes':_0x5521d6[_0x18d8('0x1a')],'include':_0x5521d6[_0x18d8('0x1c')]?_['map'](_0x5521d6['include'],function(_0x5d8bbe){return{'model':db[_0x5d8bbe[_0x18d8('0x1d')]],'as':_0x5d8bbe['as'],'attributes':_0x5d8bbe[_0x18d8('0x1a')],'include':_0x5d8bbe[_0x18d8('0x1c')]?_[_0x18d8('0x1e')](_0x5d8bbe[_0x18d8('0x1c')],function(_0x438083){return{'model':db[_0x438083[_0x18d8('0x1d')]],'as':_0x438083['as'],'attributes':_0x438083[_0x18d8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x18d8('0xb')](function(_0x1f9a1f){logger['info'](_0x18d8('0x1f'),_0x712c00);logger[_0x18d8('0x20')](_0x18d8('0x1f'),_0x712c00,JSON['stringify'](_0x1f9a1f));_0x31cc71(_0x1f9a1f);})['catch'](function(_0x1e500a){logger['error']('GetVoiceCallReport',_0x1e500a['message'],_0x712c00);_0x26e01e(_0x27e1e7[_0x18d8('0x11')](0x1f4,_0x1e500a[_0x18d8('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x3077ca){var _0x881355=this;return new Promise(function(_0x17501e,_0x2ec88e){return db[_0x18d8('0x15')][_0x18d8('0x21')](_0x3077ca['body'],{'raw':_0x3077ca[_0x18d8('0x17')]?_0x3077ca[_0x18d8('0x17')][_0x18d8('0x18')]===undefined?!![]:![]:!![]})[_0x18d8('0xb')](function(_0x1d2a3f){logger[_0x18d8('0xc')]('CreateVoiceCallReport',_0x3077ca);logger['debug'](_0x18d8('0x22'),_0x3077ca,JSON[_0x18d8('0x10')](_0x1d2a3f));_0x17501e(_0x1d2a3f);})[_0x18d8('0x14')](function(_0x1f9aee){logger[_0x18d8('0x11')]('CreateVoiceCallReport',_0x1f9aee[_0x18d8('0x12')],_0x3077ca);_0x2ec88e(_0x881355[_0x18d8('0x11')](0x1f4,_0x1f9aee[_0x18d8('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x604bc){var _0x74e7b4=this;return new Promise(function(_0x179e60,_0x34c6ab){return db[_0x18d8('0x15')][_0x18d8('0x23')](_0x604bc[_0x18d8('0x24')],{'raw':_0x604bc[_0x18d8('0x17')]?_0x604bc[_0x18d8('0x17')][_0x18d8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x604bc[_0x18d8('0x17')]?_0x604bc['options'][_0x18d8('0x19')]||null:null,'attributes':_0x604bc[_0x18d8('0x17')]?_0x604bc[_0x18d8('0x17')]['attributes']||null:null,'limit':_0x604bc[_0x18d8('0x17')]?_0x604bc[_0x18d8('0x17')][_0x18d8('0x1b')]||null:null})['then'](function(_0x22be0b){logger['info'](_0x18d8('0x25'),_0x604bc);logger['debug'](_0x18d8('0x25'),_0x604bc,JSON[_0x18d8('0x10')](_0x22be0b));_0x179e60(_0x22be0b);})[_0x18d8('0x14')](function(_0x427a08){logger[_0x18d8('0x11')]('UpdateVoiceCallReport',_0x427a08[_0x18d8('0x12')],_0x604bc);_0x34c6ab(_0x74e7b4[_0x18d8('0x11')](0x1f4,_0x427a08['message']));});});}; \ No newline at end of file +var _0xbcb7=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','model','include','GetVoiceCallReport','debug','stringify','CreateVoiceCallReport','update','body','UpdateVoiceCallReport','util','moment','bluebird','randomstring','ioredis'];(function(_0x86c0c4,_0x5afc74){var _0x49f909=function(_0x3b2455){while(--_0x3b2455){_0x86c0c4['push'](_0x86c0c4['shift']());}};_0x49f909(++_0x5afc74);}(_0xbcb7,0x10c));var _0x7bcb=function(_0x33643f,_0x5b32af){_0x33643f=_0x33643f-0x0;var _0x30a486=_0xbcb7[_0x33643f];return _0x30a486;};'use strict';var _=require('lodash');var util=require(_0x7bcb('0x0'));var moment=require(_0x7bcb('0x1'));var BPromise=require(_0x7bcb('0x2'));var rs=require(_0x7bcb('0x3'));var fs=require('fs');var Redis=require(_0x7bcb('0x4'));var db=require(_0x7bcb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bcb('0x6'))(_0x7bcb('0x7'));var config=require(_0x7bcb('0x8'));var jayson=require(_0x7bcb('0x9'));var client=jayson[_0x7bcb('0xa')][_0x7bcb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5508ed,_0x43b056,_0x524d94){return new BPromise(function(_0x1b4a78,_0x53d37a){return client[_0x7bcb('0xc')](_0x5508ed,_0x524d94)[_0x7bcb('0xd')](function(_0x223986){logger['info'](_0x7bcb('0xe'),_0x43b056,_0x7bcb('0xf'));logger['debug'](_0x7bcb('0x10'),_0x43b056,_0x7bcb('0xf'),JSON['stringify'](_0x223986));if(_0x223986['error']){if(_0x223986[_0x7bcb('0x11')][_0x7bcb('0x12')]===0x1f4){logger[_0x7bcb('0x11')](_0x7bcb('0xe'),_0x43b056,_0x223986[_0x7bcb('0x11')][_0x7bcb('0x13')]);return _0x53d37a(_0x223986[_0x7bcb('0x11')][_0x7bcb('0x13')]);}logger[_0x7bcb('0x11')](_0x7bcb('0xe'),_0x43b056,_0x223986['error'][_0x7bcb('0x13')]);return _0x1b4a78(_0x223986[_0x7bcb('0x11')][_0x7bcb('0x13')]);}else{logger[_0x7bcb('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x43b056,_0x7bcb('0xf'));_0x1b4a78(_0x223986['result'][_0x7bcb('0x13')]);}})[_0x7bcb('0x15')](function(_0x772168){logger[_0x7bcb('0x11')](_0x7bcb('0xe'),_0x43b056,_0x772168);_0x53d37a(_0x772168);});});}exports['GetVoiceCallReport']=function(_0x391906){var _0x19edd6=this;return new Promise(function(_0x684836,_0x1f0612){return db[_0x7bcb('0x16')][_0x7bcb('0x17')]({'raw':_0x391906['options']?_0x391906[_0x7bcb('0x18')][_0x7bcb('0x19')]===undefined?!![]:![]:!![],'where':_0x391906[_0x7bcb('0x18')]?_0x391906['options'][_0x7bcb('0x1a')]||null:null,'attributes':_0x391906['options']?_0x391906['options'][_0x7bcb('0x1b')]||null:null,'limit':_0x391906[_0x7bcb('0x18')]?_0x391906[_0x7bcb('0x18')][_0x7bcb('0x1c')]||null:null,'include':_0x391906[_0x7bcb('0x18')]?_0x391906['options']['include']?_[_0x7bcb('0x1d')](_0x391906[_0x7bcb('0x18')]['include'],function(_0x2d915c){return{'model':db[_0x2d915c[_0x7bcb('0x1e')]],'as':_0x2d915c['as'],'attributes':_0x2d915c[_0x7bcb('0x1b')],'include':_0x2d915c[_0x7bcb('0x1f')]?_[_0x7bcb('0x1d')](_0x2d915c[_0x7bcb('0x1f')],function(_0x41d6c5){return{'model':db[_0x41d6c5[_0x7bcb('0x1e')]],'as':_0x41d6c5['as'],'attributes':_0x41d6c5[_0x7bcb('0x1b')],'include':_0x41d6c5[_0x7bcb('0x1f')]?_['map'](_0x41d6c5[_0x7bcb('0x1f')],function(_0x2f6529){return{'model':db[_0x2f6529[_0x7bcb('0x1e')]],'as':_0x2f6529['as'],'attributes':_0x2f6529[_0x7bcb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7bcb('0xd')](function(_0x16f7b5){logger[_0x7bcb('0x14')](_0x7bcb('0x20'),_0x391906);logger[_0x7bcb('0x21')](_0x7bcb('0x20'),_0x391906,JSON[_0x7bcb('0x22')](_0x16f7b5));_0x684836(_0x16f7b5);})[_0x7bcb('0x15')](function(_0x5cbf44){logger[_0x7bcb('0x11')](_0x7bcb('0x20'),_0x5cbf44[_0x7bcb('0x13')],_0x391906);_0x1f0612(_0x19edd6['error'](0x1f4,_0x5cbf44[_0x7bcb('0x13')]));});});};exports[_0x7bcb('0x23')]=function(_0x3afb71){var _0x5e714d=this;return new Promise(function(_0x2b0bb7,_0x3504f6){return db['VoiceCallReport']['create'](_0x3afb71['body'],{'raw':_0x3afb71[_0x7bcb('0x18')]?_0x3afb71['options'][_0x7bcb('0x19')]===undefined?!![]:![]:!![]})[_0x7bcb('0xd')](function(_0x44f2e9){logger[_0x7bcb('0x14')]('CreateVoiceCallReport',_0x3afb71);logger[_0x7bcb('0x21')](_0x7bcb('0x23'),_0x3afb71,JSON[_0x7bcb('0x22')](_0x44f2e9));_0x2b0bb7(_0x44f2e9);})[_0x7bcb('0x15')](function(_0x2448d9){logger[_0x7bcb('0x11')](_0x7bcb('0x23'),_0x2448d9[_0x7bcb('0x13')],_0x3afb71);_0x3504f6(_0x5e714d['error'](0x1f4,_0x2448d9[_0x7bcb('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x4dad30){var _0x52f82c=this;return new Promise(function(_0x30d9cd,_0x18f07b){return db['VoiceCallReport'][_0x7bcb('0x24')](_0x4dad30[_0x7bcb('0x25')],{'raw':_0x4dad30[_0x7bcb('0x18')]?_0x4dad30[_0x7bcb('0x18')][_0x7bcb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dad30[_0x7bcb('0x18')]?_0x4dad30[_0x7bcb('0x18')]['where']||null:null,'attributes':_0x4dad30[_0x7bcb('0x18')]?_0x4dad30[_0x7bcb('0x18')][_0x7bcb('0x1b')]||null:null,'limit':_0x4dad30['options']?_0x4dad30[_0x7bcb('0x18')]['limit']||null:null})[_0x7bcb('0xd')](function(_0x1c0d88){logger['info'](_0x7bcb('0x26'),_0x4dad30);logger[_0x7bcb('0x21')]('UpdateVoiceCallReport',_0x4dad30,JSON[_0x7bcb('0x22')](_0x1c0d88));_0x30d9cd(_0x1c0d88);})[_0x7bcb('0x15')](function(_0x1d854e){logger[_0x7bcb('0x11')](_0x7bcb('0x26'),_0x1d854e[_0x7bcb('0x13')],_0x4dad30);_0x18f07b(_0x52f82c['error'](0x1f4,_0x1d854e[_0x7bcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 553c380..70192bb 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 _0x7e47=['index','show','post','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','./voiceChanSpy.controller','isAuthenticated'];(function(_0x3e9fc9,_0x231463){var _0x3662a1=function(_0xadfa66){while(--_0xadfa66){_0x3e9fc9['push'](_0x3e9fc9['shift']());}};_0x3662a1(++_0x231463);}(_0x7e47,0x19d));var _0x77e4=function(_0x3580bc,_0x30508d){_0x3580bc=_0x3580bc-0x0;var _0x1cea64=_0x7e47[_0x3580bc];return _0x1cea64;};'use strict';var multer=require('multer');var util=require(_0x77e4('0x0'));var path=require(_0x77e4('0x1'));var timeout=require(_0x77e4('0x2'));var express=require(_0x77e4('0x3'));var router=express[_0x77e4('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77e4('0x5'));router['get']('/',auth[_0x77e4('0x6')](),controller[_0x77e4('0x7')]);router['get']('/:id',auth[_0x77e4('0x6')](),controller[_0x77e4('0x8')]);router[_0x77e4('0x9')]('/',auth[_0x77e4('0x6')](),controller['create']);router[_0x77e4('0xa')](_0x77e4('0xb'),auth['isAuthenticated'](),controller[_0x77e4('0xc')]);router[_0x77e4('0xd')](_0x77e4('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x77e4('0xe')]=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x55c431,_0x99e7aa){var _0x145c33=function(_0x4f18d3){while(--_0x4f18d3){_0x55c431['push'](_0x55c431['shift']());}};_0x145c33(++_0x99e7aa);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('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 d53f8cd..eefd65e 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 _0xc227=['sequelize','STRING','name','setDataValue','options','getDataValue','BOOLEAN'];(function(_0x4fa0e8,_0x26b636){var _0x19cadd=function(_0x4cda62){while(--_0x4cda62){_0x4fa0e8['push'](_0x4fa0e8['shift']());}};_0x19cadd(++_0x26b636);}(_0xc227,0xcb));var _0x7c22=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xc227[_0x53cf8e];return _0x459197;};'use strict';var Sequelize=require(_0x7c22('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c22('0x1')]},'prefix':{'type':Sequelize[_0x7c22('0x1')],'unique':_0x7c22('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x7c22('0x1')],'set':function(_0x1b72d2){this[_0x7c22('0x3')](_0x7c22('0x4'),_0x1b72d2?_0x1b72d2['join'](''):[]);},'get':function(){return this[_0x7c22('0x5')]('options')?this[_0x7c22('0x5')](_0x7c22('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x7c22('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x7c22('0x1')]},'record':{'type':Sequelize[_0x7c22('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7c22('0x1')]},'description':{'type':Sequelize[_0x7c22('0x1')]}}; \ No newline at end of file +var _0x9670=['getDataValue','options','split','BOOLEAN','sequelize','STRING','setDataValue','join'];(function(_0x27addc,_0x56684c){var _0x40adcc=function(_0x3accab){while(--_0x3accab){_0x27addc['push'](_0x27addc['shift']());}};_0x40adcc(++_0x56684c);}(_0x9670,0x164));var _0x0967=function(_0x35d639,_0x49eebb){_0x35d639=_0x35d639-0x0;var _0x158ff6=_0x9670[_0x35d639];return _0x158ff6;};'use strict';var Sequelize=require(_0x0967('0x0'));module['exports']={'name':{'type':Sequelize[_0x0967('0x1')]},'prefix':{'type':Sequelize[_0x0967('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x0967('0x1')],'set':function(_0x1a62d6){this[_0x0967('0x2')]('options',_0x1a62d6?_0x1a62d6[_0x0967('0x3')](''):[]);},'get':function(){return this[_0x0967('0x4')](_0x0967('0x5'))?this['getDataValue'](_0x0967('0x5'))[_0x0967('0x6')](''):[];}},'auth':{'type':Sequelize[_0x0967('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0967('0x1')]},'record':{'type':Sequelize[_0x0967('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0967('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index ffd41d4..eacf434 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 _0xace3=['count','include','rows','catch','show','params','keys','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','path','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','get','ChanSpies','UserProfileResource','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x20d539,_0x190d38){var _0x2d0fff=function(_0x14a4ae){while(--_0x14a4ae){_0x20d539['push'](_0x20d539['shift']());}};_0x2d0fff(++_0x190d38);}(_0xace3,0x19c));var _0x3ace=function(_0x252ffb,_0x3b0135){_0x252ffb=_0x252ffb-0x0;var _0x2981ca=_0xace3[_0x252ffb];return _0x2981ca;};'use strict';var pdf=require(_0x3ace('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3ace('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ace('0x2'));var rp=require(_0x3ace('0x3'));var moment=require(_0x3ace('0x4'));var BPromise=require(_0x3ace('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ace('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3ace('0x7'));var squel=require(_0x3ace('0x8'));var crypto=require(_0x3ace('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3ace('0xa'));var querystring=require(_0x3ace('0xb'));var Papa=require(_0x3ace('0xc'));var Redis=require(_0x3ace('0xd'));var authService=require(_0x3ace('0xe'));var qs=require(_0x3ace('0xf'));var as=require(_0x3ace('0x10'));var hardwareService=require(_0x3ace('0x11'));var logger=require('../../config/logger')(_0x3ace('0x12'));var utils=require(_0x3ace('0x13'));var config=require(_0x3ace('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118c61,_0x4e566e){_0x4e566e=_0x4e566e||0xcc;return function(_0x12c5a0){if(_0x12c5a0){return _0x118c61[_0x3ace('0x15')](_0x4e566e);}return _0x118c61[_0x3ace('0x16')](_0x4e566e)[_0x3ace('0x17')]();};}function respondWithResult(_0x7e3c75,_0x28cac6){_0x28cac6=_0x28cac6||0xc8;return function(_0x66ff55){if(_0x66ff55){return _0x7e3c75[_0x3ace('0x16')](_0x28cac6)['json'](_0x66ff55);}};}function respondWithFilteredResult(_0xe39238,_0x2ff914){return function(_0x33037b){if(_0x33037b){var _0x467e9a=_0x33037b['count'],_0x123a34=_0x2ff914[_0x3ace('0x18')],_0x49da69=_0x2ff914[_0x3ace('0x18')]+_0x2ff914[_0x3ace('0x19')],_0x3975c1;if(_0x49da69>=_0x467e9a){_0x49da69=_0x467e9a;_0x3975c1=0xc8;}else{_0x3975c1=0xce;}_0xe39238[_0x3ace('0x16')](_0x3975c1);return _0xe39238[_0x3ace('0x1a')](_0x3ace('0x1b'),_0x123a34+'-'+_0x49da69+'/'+_0x467e9a)[_0x3ace('0x1c')](_0x33037b);}return null;};}function patchUpdates(_0x3149ff){return function(_0x2cb96a){try{jsonpatch['apply'](_0x2cb96a,_0x3149ff,!![]);}catch(_0x5d716d){return BPromise[_0x3ace('0x1d')](_0x5d716d);}return _0x2cb96a[_0x3ace('0x1e')]();};}function saveUpdates(_0x5d4824,_0x33773b){return function(_0x587106){if(_0x587106){return _0x587106[_0x3ace('0x1f')](_0x5d4824)[_0x3ace('0x20')](function(_0x5ac6e8){return _0x5ac6e8;});}return null;};}function removeEntity(_0x5c9068,_0x388590){return function(_0x2d59e1){if(_0x2d59e1){return _0x2d59e1['destroy']()[_0x3ace('0x20')](function(){var _0x548feb=_0x2d59e1[_0x3ace('0x21')]({'plain':!![]});var _0x122754=_0x3ace('0x22');return db[_0x3ace('0x23')]['destroy']({'where':{'type':_0x122754,'resourceId':_0x548feb['id']}})[_0x3ace('0x20')](function(){return _0x2d59e1;});})['then'](function(){_0x5c9068[_0x3ace('0x16')](0xcc)[_0x3ace('0x17')]();});}};}function handleEntityNotFound(_0x3b4154,_0x49db53){return function(_0x59953e){if(!_0x59953e){_0x3b4154[_0x3ace('0x15')](0x194);}return _0x59953e;};}function handleError(_0x231ee4,_0x4bfbd2){_0x4bfbd2=_0x4bfbd2||0x1f4;return function(_0x457df9){logger[_0x3ace('0x24')](_0x457df9[_0x3ace('0x25')]);if(_0x457df9[_0x3ace('0x26')]){delete _0x457df9[_0x3ace('0x26')];}_0x231ee4[_0x3ace('0x16')](_0x4bfbd2)['send'](_0x457df9);};}exports[_0x3ace('0x27')]=function(_0x23c347,_0x5009c6){var _0x1d3465={},_0x14eb93={},_0x3e9c48={'count':0x0,'rows':[]};var _0x418604=_[_0x3ace('0x28')](db[_0x3ace('0x29')][_0x3ace('0x2a')],function(_0x113f5b){return{'name':_0x113f5b[_0x3ace('0x2b')],'type':_0x113f5b[_0x3ace('0x2c')][_0x3ace('0x2d')]};});_0x14eb93[_0x3ace('0x2e')]=_[_0x3ace('0x28')](_0x418604,_0x3ace('0x26'));_0x14eb93[_0x3ace('0x2f')]=_['keys'](_0x23c347[_0x3ace('0x2f')]);_0x14eb93[_0x3ace('0x30')]=_[_0x3ace('0x31')](_0x14eb93[_0x3ace('0x2e')],_0x14eb93['query']);_0x1d3465[_0x3ace('0x32')]=_[_0x3ace('0x31')](_0x14eb93['model'],qs[_0x3ace('0x33')](_0x23c347[_0x3ace('0x2f')]['fields']));_0x1d3465[_0x3ace('0x32')]=_0x1d3465[_0x3ace('0x32')][_0x3ace('0x34')]?_0x1d3465[_0x3ace('0x32')]:_0x14eb93[_0x3ace('0x2e')];if(!_0x23c347[_0x3ace('0x2f')][_0x3ace('0x35')](_0x3ace('0x36'))){_0x1d3465[_0x3ace('0x19')]=qs['limit'](_0x23c347[_0x3ace('0x2f')][_0x3ace('0x19')]);_0x1d3465[_0x3ace('0x18')]=qs[_0x3ace('0x18')](_0x23c347[_0x3ace('0x2f')][_0x3ace('0x18')]);}_0x1d3465[_0x3ace('0x37')]=qs[_0x3ace('0x38')](_0x23c347[_0x3ace('0x2f')]['sort']);_0x1d3465[_0x3ace('0x39')]=qs['filters'](_[_0x3ace('0x3a')](_0x23c347['query'],_0x14eb93[_0x3ace('0x30')]));if(_0x23c347[_0x3ace('0x2f')][_0x3ace('0x3b')]){_0x1d3465[_0x3ace('0x39')]=_['merge'](_0x1d3465[_0x3ace('0x39')],{'$or':_[_0x3ace('0x28')](_0x418604,function(_0x5bb50c){if(_0x5bb50c[_0x3ace('0x2c')]!=='VIRTUAL'){var _0x238f5b={};_0x238f5b[_0x5bb50c[_0x3ace('0x26')]]={'$like':'%'+_0x23c347[_0x3ace('0x2f')]['filter']+'%'};return _0x238f5b;}})});}_0x1d3465=_[_0x3ace('0x3c')]({},_0x1d3465,_0x23c347[_0x3ace('0x3d')]);var _0x4b770f={'where':_0x1d3465[_0x3ace('0x39')]};return db['VoiceChanSpy'][_0x3ace('0x3e')](_0x4b770f)['then'](function(_0x12baa7){_0x3e9c48['count']=_0x12baa7;if(_0x23c347['query']['includeAll']){_0x1d3465[_0x3ace('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x1d3465);})['then'](function(_0x23589d){_0x3e9c48[_0x3ace('0x40')]=_0x23589d;return _0x3e9c48;})[_0x3ace('0x20')](respondWithFilteredResult(_0x5009c6,_0x1d3465))[_0x3ace('0x41')](handleError(_0x5009c6,null));};exports[_0x3ace('0x42')]=function(_0x384f6a,_0x5134fd){var _0x1eac6f={'raw':![],'where':{'id':_0x384f6a[_0x3ace('0x43')]['id']}},_0x404d70={};_0x404d70['model']=_[_0x3ace('0x44')](db['VoiceChanSpy'][_0x3ace('0x2a')]);_0x404d70[_0x3ace('0x2f')]=_[_0x3ace('0x44')](_0x384f6a[_0x3ace('0x2f')]);_0x404d70[_0x3ace('0x30')]=_[_0x3ace('0x31')](_0x404d70[_0x3ace('0x2e')],_0x404d70['query']);_0x1eac6f[_0x3ace('0x32')]=_[_0x3ace('0x31')](_0x404d70[_0x3ace('0x2e')],qs[_0x3ace('0x33')](_0x384f6a[_0x3ace('0x2f')][_0x3ace('0x33')]));_0x1eac6f[_0x3ace('0x32')]=_0x1eac6f['attributes'][_0x3ace('0x34')]?_0x1eac6f['attributes']:_0x404d70[_0x3ace('0x2e')];if(_0x384f6a[_0x3ace('0x2f')][_0x3ace('0x45')]){_0x1eac6f[_0x3ace('0x3f')]=[{'all':!![]}];}_0x1eac6f=_[_0x3ace('0x3c')]({},_0x1eac6f,_0x384f6a[_0x3ace('0x3d')]);return db[_0x3ace('0x29')][_0x3ace('0x46')](_0x1eac6f)[_0x3ace('0x20')](handleEntityNotFound(_0x5134fd,null))[_0x3ace('0x20')](respondWithResult(_0x5134fd,null))['catch'](handleError(_0x5134fd,null));};exports[_0x3ace('0x47')]=function(_0x499a8e,_0x2deee2){return db['VoiceChanSpy'][_0x3ace('0x47')](_0x499a8e[_0x3ace('0x48')],{})[_0x3ace('0x20')](function(_0x42a5b0){var _0x1b8172=_0x499a8e['user'][_0x3ace('0x21')]({'plain':!![]});if(!_0x1b8172)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b8172[_0x3ace('0x49')]===_0x3ace('0x4a')){var _0x46bf19=_0x42a5b0[_0x3ace('0x21')]({'plain':!![]});var _0x3dd45b='ChanSpies';return db[_0x3ace('0x4b')][_0x3ace('0x46')]({'where':{'name':_0x3dd45b,'userProfileId':_0x1b8172[_0x3ace('0x4c')]},'raw':!![]})[_0x3ace('0x20')](function(_0x58caae){if(_0x58caae&&_0x58caae[_0x3ace('0x4d')]===0x0){return db['UserProfileResource'][_0x3ace('0x47')]({'name':_0x46bf19[_0x3ace('0x26')],'resourceId':_0x46bf19['id'],'type':_0x58caae['name'],'sectionId':_0x58caae['id']},{})[_0x3ace('0x20')](function(){return _0x42a5b0;});}else{return _0x42a5b0;}})[_0x3ace('0x41')](function(_0x4e898a){logger[_0x3ace('0x24')](_0x3ace('0x4e'),_0x4e898a);throw _0x4e898a;});}return _0x42a5b0;})[_0x3ace('0x20')](respondWithResult(_0x2deee2,0xc9))[_0x3ace('0x41')](handleError(_0x2deee2,null));};exports[_0x3ace('0x1f')]=function(_0x29d738,_0x3f85cf){if(_0x29d738[_0x3ace('0x48')]['id']){delete _0x29d738[_0x3ace('0x48')]['id'];}return db[_0x3ace('0x29')][_0x3ace('0x46')]({'where':{'id':_0x29d738['params']['id']}})[_0x3ace('0x20')](handleEntityNotFound(_0x3f85cf,null))[_0x3ace('0x20')](saveUpdates(_0x29d738['body'],null))['then'](respondWithResult(_0x3f85cf,null))['catch'](handleError(_0x3f85cf,null));};exports['destroy']=function(_0x12bc18,_0x1610c2){return db['VoiceChanSpy'][_0x3ace('0x46')]({'where':{'id':_0x12bc18[_0x3ace('0x43')]['id']}})[_0x3ace('0x20')](handleEntityNotFound(_0x1610c2,null))[_0x3ace('0x20')](removeEntity(_0x1610c2,null))[_0x3ace('0x41')](handleError(_0x1610c2,null));}; \ No newline at end of file +var _0xa1de=['set','json','apply','reject','save','update','then','destroy','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','rawAttributes','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','offset'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0xa1de,0x85));var _0xea1d=function(_0x1af385,_0x593bcc){_0x1af385=_0x1af385-0x0;var _0x4660d7=_0xa1de[_0x1af385];return _0x4660d7;};'use strict';var pdf=require(_0xea1d('0x0'));var emlformat=require(_0xea1d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xea1d('0x2'));var jsonpatch=require(_0xea1d('0x3'));var rp=require(_0xea1d('0x4'));var moment=require(_0xea1d('0x5'));var BPromise=require(_0xea1d('0x6'));var Mustache=require('mustache');var util=require(_0xea1d('0x7'));var path=require(_0xea1d('0x8'));var sox=require(_0xea1d('0x9'));var csv=require(_0xea1d('0xa'));var ejs=require(_0xea1d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea1d('0xc'));var crypto=require('crypto');var jsforce=require(_0xea1d('0xd'));var deskjs=require(_0xea1d('0xe'));var toCsv=require(_0xea1d('0xa'));var querystring=require(_0xea1d('0xf'));var Papa=require(_0xea1d('0x10'));var Redis=require(_0xea1d('0x11'));var authService=require(_0xea1d('0x12'));var qs=require(_0xea1d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea1d('0x14'));var logger=require(_0xea1d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xea1d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4dc5,_0x7ef93f){_0x7ef93f=_0x7ef93f||0xcc;return function(_0x3e7159){if(_0x3e7159){return _0x5e4dc5[_0xea1d('0x17')](_0x7ef93f);}return _0x5e4dc5[_0xea1d('0x18')](_0x7ef93f)[_0xea1d('0x19')]();};}function respondWithResult(_0x4f779f,_0x404ece){_0x404ece=_0x404ece||0xc8;return function(_0x156f4a){if(_0x156f4a){return _0x4f779f[_0xea1d('0x18')](_0x404ece)['json'](_0x156f4a);}};}function respondWithFilteredResult(_0x152561,_0x158f0a){return function(_0x3f1f94){if(_0x3f1f94){var _0x903538=_0x3f1f94['count'],_0x4e8ee9=_0x158f0a[_0xea1d('0x1a')],_0x4c9c5d=_0x158f0a[_0xea1d('0x1a')]+_0x158f0a['limit'],_0x1d9dbe;if(_0x4c9c5d>=_0x903538){_0x4c9c5d=_0x903538;_0x1d9dbe=0xc8;}else{_0x1d9dbe=0xce;}_0x152561[_0xea1d('0x18')](_0x1d9dbe);return _0x152561[_0xea1d('0x1b')]('Content-Range',_0x4e8ee9+'-'+_0x4c9c5d+'/'+_0x903538)[_0xea1d('0x1c')](_0x3f1f94);}return null;};}function patchUpdates(_0x1da412){return function(_0x37c52c){try{jsonpatch[_0xea1d('0x1d')](_0x37c52c,_0x1da412,!![]);}catch(_0x5e9ea0){return BPromise[_0xea1d('0x1e')](_0x5e9ea0);}return _0x37c52c[_0xea1d('0x1f')]();};}function saveUpdates(_0x325d9a,_0x3a18fd){return function(_0x3e13d8){if(_0x3e13d8){return _0x3e13d8[_0xea1d('0x20')](_0x325d9a)[_0xea1d('0x21')](function(_0x77e57d){return _0x77e57d;});}return null;};}function removeEntity(_0x1a79a8,_0x18d71e){return function(_0x339ad5){if(_0x339ad5){return _0x339ad5[_0xea1d('0x22')]()['then'](function(){var _0x305984=_0x339ad5['get']({'plain':!![]});var _0x4c0ac6=_0xea1d('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x4c0ac6,'resourceId':_0x305984['id']}})['then'](function(){return _0x339ad5;});})[_0xea1d('0x21')](function(){_0x1a79a8[_0xea1d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52fcf6,_0x2b50cb){return function(_0x4abe36){if(!_0x4abe36){_0x52fcf6['sendStatus'](0x194);}return _0x4abe36;};}function handleError(_0x2c7d49,_0x5210b4){_0x5210b4=_0x5210b4||0x1f4;return function(_0x410b35){logger[_0xea1d('0x24')](_0x410b35[_0xea1d('0x25')]);if(_0x410b35['name']){delete _0x410b35[_0xea1d('0x26')];}_0x2c7d49[_0xea1d('0x18')](_0x5210b4)[_0xea1d('0x27')](_0x410b35);};}exports[_0xea1d('0x28')]=function(_0x15a9df,_0x492eb3){var _0x39a108={},_0x5c88b3={},_0x5eb173={'count':0x0,'rows':[]};var _0x5088c7=_[_0xea1d('0x29')](db[_0xea1d('0x2a')]['rawAttributes'],function(_0x348d27){return{'name':_0x348d27[_0xea1d('0x2b')],'type':_0x348d27[_0xea1d('0x2c')][_0xea1d('0x2d')]};});_0x5c88b3[_0xea1d('0x2e')]=_['map'](_0x5088c7,'name');_0x5c88b3['query']=_[_0xea1d('0x2f')](_0x15a9df[_0xea1d('0x30')]);_0x5c88b3[_0xea1d('0x31')]=_[_0xea1d('0x32')](_0x5c88b3['model'],_0x5c88b3[_0xea1d('0x30')]);_0x39a108[_0xea1d('0x33')]=_[_0xea1d('0x32')](_0x5c88b3[_0xea1d('0x2e')],qs[_0xea1d('0x34')](_0x15a9df[_0xea1d('0x30')][_0xea1d('0x34')]));_0x39a108[_0xea1d('0x33')]=_0x39a108['attributes'][_0xea1d('0x35')]?_0x39a108['attributes']:_0x5c88b3[_0xea1d('0x2e')];if(!_0x15a9df[_0xea1d('0x30')][_0xea1d('0x36')](_0xea1d('0x37'))){_0x39a108['limit']=qs[_0xea1d('0x38')](_0x15a9df[_0xea1d('0x30')][_0xea1d('0x38')]);_0x39a108[_0xea1d('0x1a')]=qs[_0xea1d('0x1a')](_0x15a9df[_0xea1d('0x30')]['offset']);}_0x39a108['order']=qs['sort'](_0x15a9df[_0xea1d('0x30')][_0xea1d('0x39')]);_0x39a108[_0xea1d('0x3a')]=qs[_0xea1d('0x31')](_[_0xea1d('0x3b')](_0x15a9df[_0xea1d('0x30')],_0x5c88b3['filters']));if(_0x15a9df['query'][_0xea1d('0x3c')]){_0x39a108[_0xea1d('0x3a')]=_['merge'](_0x39a108[_0xea1d('0x3a')],{'$or':_[_0xea1d('0x29')](_0x5088c7,function(_0x5d8b49){if(_0x5d8b49[_0xea1d('0x2c')]!=='VIRTUAL'){var _0x16c165={};_0x16c165[_0x5d8b49[_0xea1d('0x26')]]={'$like':'%'+_0x15a9df[_0xea1d('0x30')][_0xea1d('0x3c')]+'%'};return _0x16c165;}})});}_0x39a108=_[_0xea1d('0x3d')]({},_0x39a108,_0x15a9df[_0xea1d('0x3e')]);var _0x5c094e={'where':_0x39a108[_0xea1d('0x3a')]};return db[_0xea1d('0x2a')][_0xea1d('0x3f')](_0x5c094e)[_0xea1d('0x21')](function(_0x446916){_0x5eb173['count']=_0x446916;if(_0x15a9df['query'][_0xea1d('0x40')]){_0x39a108[_0xea1d('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xea1d('0x42')](_0x39a108);})['then'](function(_0x4cc95c){_0x5eb173[_0xea1d('0x43')]=_0x4cc95c;return _0x5eb173;})[_0xea1d('0x21')](respondWithFilteredResult(_0x492eb3,_0x39a108))[_0xea1d('0x44')](handleError(_0x492eb3,null));};exports['show']=function(_0x238cda,_0x56d33f){var _0x4522ee={'raw':![],'where':{'id':_0x238cda['params']['id']}},_0x4a7565={};_0x4a7565['model']=_[_0xea1d('0x2f')](db[_0xea1d('0x2a')][_0xea1d('0x45')]);_0x4a7565[_0xea1d('0x30')]=_[_0xea1d('0x2f')](_0x238cda[_0xea1d('0x30')]);_0x4a7565[_0xea1d('0x31')]=_[_0xea1d('0x32')](_0x4a7565[_0xea1d('0x2e')],_0x4a7565[_0xea1d('0x30')]);_0x4522ee[_0xea1d('0x33')]=_[_0xea1d('0x32')](_0x4a7565['model'],qs[_0xea1d('0x34')](_0x238cda[_0xea1d('0x30')]['fields']));_0x4522ee[_0xea1d('0x33')]=_0x4522ee[_0xea1d('0x33')][_0xea1d('0x35')]?_0x4522ee[_0xea1d('0x33')]:_0x4a7565[_0xea1d('0x2e')];if(_0x238cda[_0xea1d('0x30')][_0xea1d('0x40')]){_0x4522ee['include']=[{'all':!![]}];}_0x4522ee=_[_0xea1d('0x3d')]({},_0x4522ee,_0x238cda[_0xea1d('0x3e')]);return db[_0xea1d('0x2a')][_0xea1d('0x46')](_0x4522ee)['then'](handleEntityNotFound(_0x56d33f,null))[_0xea1d('0x21')](respondWithResult(_0x56d33f,null))[_0xea1d('0x44')](handleError(_0x56d33f,null));};exports[_0xea1d('0x47')]=function(_0x7c540a,_0x2ead70){return db['VoiceChanSpy'][_0xea1d('0x47')](_0x7c540a['body'],{})['then'](function(_0x319d13){var _0x594fcc=_0x7c540a['user'][_0xea1d('0x48')]({'plain':!![]});if(!_0x594fcc)throw new Error(_0xea1d('0x49'));if(_0x594fcc[_0xea1d('0x4a')]===_0xea1d('0x4b')){var _0x148fcc=_0x319d13[_0xea1d('0x48')]({'plain':!![]});var _0x197766=_0xea1d('0x23');return db['UserProfileSection'][_0xea1d('0x46')]({'where':{'name':_0x197766,'userProfileId':_0x594fcc[_0xea1d('0x4c')]},'raw':!![]})[_0xea1d('0x21')](function(_0x484f14){if(_0x484f14&&_0x484f14['autoAssociation']===0x0){return db[_0xea1d('0x4d')][_0xea1d('0x47')]({'name':_0x148fcc[_0xea1d('0x26')],'resourceId':_0x148fcc['id'],'type':_0x484f14['name'],'sectionId':_0x484f14['id']},{})[_0xea1d('0x21')](function(){return _0x319d13;});}else{return _0x319d13;}})['catch'](function(_0x2fcd23){logger[_0xea1d('0x24')](_0xea1d('0x4e'),_0x2fcd23);throw _0x2fcd23;});}return _0x319d13;})['then'](respondWithResult(_0x2ead70,0xc9))['catch'](handleError(_0x2ead70,null));};exports[_0xea1d('0x20')]=function(_0x400830,_0x152edd){if(_0x400830[_0xea1d('0x4f')]['id']){delete _0x400830['body']['id'];}return db[_0xea1d('0x2a')]['find']({'where':{'id':_0x400830['params']['id']}})[_0xea1d('0x21')](handleEntityNotFound(_0x152edd,null))['then'](saveUpdates(_0x400830['body'],null))[_0xea1d('0x21')](respondWithResult(_0x152edd,null))[_0xea1d('0x44')](handleError(_0x152edd,null));};exports['destroy']=function(_0x200b38,_0x2a6b68){return db[_0xea1d('0x2a')][_0xea1d('0x46')]({'where':{'id':_0x200b38['params']['id']}})[_0xea1d('0x21')](handleEntityNotFound(_0x2a6b68,null))[_0xea1d('0x21')](removeEntity(_0x2a6b68,null))[_0xea1d('0x44')](handleError(_0x2a6b68,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index c0d014c..d34d1b0 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 _0xe9b5=['record','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','destroy','util','bluebird','context','%s%s','push','merge','format','CDR(type)=%s','chanspy'];(function(_0x4218d0,_0x18aa4c){var _0x2c142c=function(_0x27a612){while(--_0x27a612){_0x4218d0['push'](_0x4218d0['shift']());}};_0x2c142c(++_0x18aa4c);}(_0xe9b5,0xbd));var _0x5e9b=function(_0x3fc6d2,_0x1578b7){_0x3fc6d2=_0x3fc6d2-0x0;var _0x2189b8=_0xe9b5[_0x3fc6d2];return _0x2189b8;};'use strict';var _=require('lodash');var util=require(_0x5e9b('0x0'));var BPromise=require(_0x5e9b('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x13f99e,_0x51cbb9,_0x5c474a){var _0x16d2e7=0x1;var _0x576b8e=[];var _0x330e86={'context':_0x51cbb9[_0x5e9b('0x2')]||'from-sip','exten':util['format'](_0x5e9b('0x3'),_0x13f99e['prefix'],_0x5c474a),'type':'system','isApp':![],'ChanSpyId':_0x13f99e['id'],'UserId':_0x51cbb9['id']};_0x576b8e[_0x5e9b('0x4')](_[_0x5e9b('0x5')]({'app':'Set','appdata':util[_0x5e9b('0x6')](_0x5e9b('0x7'),_0x5e9b('0x8')),'priority':_0x16d2e7++},_0x330e86));if(_0x13f99e[_0x5e9b('0x9')]){_0x576b8e[_0x5e9b('0x4')](_[_0x5e9b('0x5')]({'app':'MixMonitor','appdata':util[_0x5e9b('0x6')](_0x5e9b('0xa'),_0x13f99e[_0x5e9b('0xb')]),'priority':_0x16d2e7++},_0x330e86));}if(_0x13f99e[_0x5e9b('0xc')]){_0x576b8e['push'](_[_0x5e9b('0x5')]({'app':_0x5e9b('0xd'),'appdata':_0x13f99e[_0x5e9b('0xe')],'priority':_0x16d2e7++},_0x330e86));}_0x576b8e[_0x5e9b('0x4')](_[_0x5e9b('0x5')]({'app':'ChanSpy','appdata':util[_0x5e9b('0x6')](_0x5e9b('0xf'),_0x51cbb9['name'],_0x13f99e[_0x5e9b('0x10')]?_0x13f99e[_0x5e9b('0x10')][_0x5e9b('0x11')](''):''),'priority':_0x16d2e7++},_0x330e86));if(_0x13f99e[_0x5e9b('0x9')]){_0x576b8e[_0x5e9b('0x4')](_[_0x5e9b('0x5')]({'app':_0x5e9b('0x12'),'priority':_0x16d2e7++},_0x330e86));}return _0x576b8e;};var getChanSpyApplications=function(_0x4cae13,_0x5bbb91){var _0x44e5ee=[];for(var _0x3490c4=0x0,_0x379716=0x1;_0x3490c4<_0x5bbb91['length'];_0x3490c4++,_0x379716=0x1){_0x44e5ee=_0x44e5ee[_0x5e9b('0x13')](getUserApplications(_0x4cae13,_0x5bbb91[_0x3490c4],_0x5bbb91[_0x3490c4][_0x5e9b('0x14')]));if(_0x5bbb91[_0x3490c4][_0x5e9b('0x14')]!=_0x5bbb91[_0x3490c4][_0x5e9b('0x15')]){_0x44e5ee=_0x44e5ee[_0x5e9b('0x13')](getUserApplications(_0x4cae13,_0x5bbb91[_0x3490c4],_0x5bbb91[_0x3490c4]['name']));}}return _0x44e5ee;};var getChanSpyPromise=function(_0x44ebfe,_0x3555f6){return new BPromise(function(_0x344b42,_0x123384){return _0x44ebfe[_0x5e9b('0x16')]['findAll']({'attributes':['id','name',_0x5e9b('0x14')],'where':{'role':_0x5e9b('0x17'),'chanspy':!![]},'raw':!![]})[_0x5e9b('0x18')](function(_0x17dc2b){if(_0x17dc2b){return _0x344b42(getChanSpyApplications(_0x3555f6,_0x17dc2b));}return _0x344b42([]);})[_0x5e9b('0x19')](function(_0x4e3e11){_0x123384(_0x4e3e11);});});};module[_0x5e9b('0x1a')]=function(_0x5c7ef0,_0x389315){var _0x5426dd=_0x5c7ef0[_0x5e9b('0x1b')];return _0x5c7ef0['define'](_0x5e9b('0x1c'),attributes,{'tableName':_0x5e9b('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4cd797,_0x5ed089,_0x289923){return getChanSpyPromise(_0x5426dd,_0x4cd797)[_0x5e9b('0x18')](function(_0x220190){if(_0x220190&&_0x220190[_0x5e9b('0x1e')]){return _0x5426dd[_0x5e9b('0x1f')]['bulkCreate'](_0x220190);}})['then'](function(){_0x289923();})[_0x5e9b('0x19')](function(_0x1f0da0){_0x289923(_0x1f0da0);});},'afterUpdate':function(_0x1bd444,_0x151f49,_0x3a824b){return _0x5426dd[_0x5e9b('0x1f')][_0x5e9b('0x20')]({'where':{'ChanSpyId':_0x1bd444['id']}})['then'](function(){return getChanSpyPromise(_0x5426dd,_0x1bd444);})[_0x5e9b('0x18')](function(_0x2624bb){if(_0x2624bb&&_0x2624bb['length']){return _0x5426dd['VoiceExtension']['bulkCreate'](_0x2624bb);}})[_0x5e9b('0x18')](function(){_0x3a824b();})[_0x5e9b('0x19')](function(_0x5eecff){_0x3a824b(_0x5eecff);});},'afterDestroy':function(_0x4e6bf5,_0x322d5a,_0x245dc9){return _0x5426dd[_0x5e9b('0x1f')][_0x5e9b('0x20')]({'where':{'ChanSpyId':_0x4e6bf5['id']}})[_0x5e9b('0x18')](function(){_0x245dc9();})['catch'](function(_0x248859){_0x245dc9(_0x248859);});}}});}; \ No newline at end of file +var _0xbed9=['bulkCreate','destroy','length','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','system','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','push','Authenticate','ChanSpy','name','options','join','StopMixMonitor','internal','concat','User','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension'];(function(_0x337832,_0x46637b){var _0x400af0=function(_0x2c8763){while(--_0x2c8763){_0x337832['push'](_0x337832['shift']());}};_0x400af0(++_0x46637b);}(_0xbed9,0xc1));var _0x9bed=function(_0x277208,_0x57ab06){_0x277208=_0x277208-0x0;var _0x3e2c03=_0xbed9[_0x277208];return _0x3e2c03;};'use strict';var _=require(_0x9bed('0x0'));var util=require(_0x9bed('0x1'));var BPromise=require(_0x9bed('0x2'));var attributes=require(_0x9bed('0x3'));var getUserApplications=function(_0x4a3af4,_0x2ac34a,_0x375e8c){var _0x29fde5=0x1;var _0xb9c459=[];var _0x6327e0={'context':_0x2ac34a['context']||_0x9bed('0x4'),'exten':util[_0x9bed('0x5')](_0x9bed('0x6'),_0x4a3af4['prefix'],_0x375e8c),'type':_0x9bed('0x7'),'isApp':![],'ChanSpyId':_0x4a3af4['id'],'UserId':_0x2ac34a['id']};_0xb9c459['push'](_[_0x9bed('0x8')]({'app':_0x9bed('0x9'),'appdata':util[_0x9bed('0x5')](_0x9bed('0xa'),_0x9bed('0xb')),'priority':_0x29fde5++},_0x6327e0));if(_0x4a3af4[_0x9bed('0xc')]){_0xb9c459['push'](_[_0x9bed('0x8')]({'app':_0x9bed('0xd'),'appdata':util[_0x9bed('0x5')](_0x9bed('0xe'),_0x4a3af4[_0x9bed('0xf')]),'priority':_0x29fde5++},_0x6327e0));}if(_0x4a3af4['auth']){_0xb9c459[_0x9bed('0x10')](_['merge']({'app':_0x9bed('0x11'),'appdata':_0x4a3af4['password'],'priority':_0x29fde5++},_0x6327e0));}_0xb9c459[_0x9bed('0x10')](_[_0x9bed('0x8')]({'app':_0x9bed('0x12'),'appdata':util[_0x9bed('0x5')]('SIP/%s,%s',_0x2ac34a[_0x9bed('0x13')],_0x4a3af4[_0x9bed('0x14')]?_0x4a3af4[_0x9bed('0x14')][_0x9bed('0x15')](''):''),'priority':_0x29fde5++},_0x6327e0));if(_0x4a3af4[_0x9bed('0xc')]){_0xb9c459['push'](_[_0x9bed('0x8')]({'app':_0x9bed('0x16'),'priority':_0x29fde5++},_0x6327e0));}return _0xb9c459;};var getChanSpyApplications=function(_0x10054f,_0x416774){var _0x4a9680=[];for(var _0x516be3=0x0,_0x147400=0x1;_0x516be3<_0x416774['length'];_0x516be3++,_0x147400=0x1){_0x4a9680=_0x4a9680['concat'](getUserApplications(_0x10054f,_0x416774[_0x516be3],_0x416774[_0x516be3][_0x9bed('0x17')]));if(_0x416774[_0x516be3][_0x9bed('0x17')]!=_0x416774[_0x516be3][_0x9bed('0x13')]){_0x4a9680=_0x4a9680[_0x9bed('0x18')](getUserApplications(_0x10054f,_0x416774[_0x516be3],_0x416774[_0x516be3][_0x9bed('0x13')]));}}return _0x4a9680;};var getChanSpyPromise=function(_0x7890cb,_0x42a898){return new BPromise(function(_0x6d5929,_0x59e6c4){return _0x7890cb[_0x9bed('0x19')][_0x9bed('0x1a')]({'attributes':['id','name',_0x9bed('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x9bed('0x1b')](function(_0xef2667){if(_0xef2667){return _0x6d5929(getChanSpyApplications(_0x42a898,_0xef2667));}return _0x6d5929([]);})[_0x9bed('0x1c')](function(_0x49a18c){_0x59e6c4(_0x49a18c);});});};module[_0x9bed('0x1d')]=function(_0x55db03,_0x315102){var _0x4e0d44=_0x55db03[_0x9bed('0x1e')];return _0x55db03[_0x9bed('0x1f')](_0x9bed('0x20'),attributes,{'tableName':_0x9bed('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f8544,_0x441cbd,_0x2a02c9){return getChanSpyPromise(_0x4e0d44,_0x2f8544)[_0x9bed('0x1b')](function(_0x26aa26){if(_0x26aa26&&_0x26aa26['length']){return _0x4e0d44[_0x9bed('0x22')][_0x9bed('0x23')](_0x26aa26);}})[_0x9bed('0x1b')](function(){_0x2a02c9();})[_0x9bed('0x1c')](function(_0x10ee62){_0x2a02c9(_0x10ee62);});},'afterUpdate':function(_0x13190a,_0xa964eb,_0x2806e0){return _0x4e0d44['VoiceExtension'][_0x9bed('0x24')]({'where':{'ChanSpyId':_0x13190a['id']}})[_0x9bed('0x1b')](function(){return getChanSpyPromise(_0x4e0d44,_0x13190a);})['then'](function(_0x29c5c9){if(_0x29c5c9&&_0x29c5c9[_0x9bed('0x25')]){return _0x4e0d44['VoiceExtension'][_0x9bed('0x23')](_0x29c5c9);}})[_0x9bed('0x1b')](function(){_0x2806e0();})[_0x9bed('0x1c')](function(_0x935bb3){_0x2806e0(_0x935bb3);});},'afterDestroy':function(_0x4a6b6c,_0xd0d65e,_0x186d17){return _0x4e0d44[_0x9bed('0x22')][_0x9bed('0x24')]({'where':{'ChanSpyId':_0x4a6b6c['id']}})[_0x9bed('0x1b')](function(){_0x186d17();})[_0x9bed('0x1c')](function(_0x14c4e2){_0x186d17(_0x14c4e2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 824dea2..6cb2cb2 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 _0x0a2f=['../../config/utils','rpc','../../config/environment','client','request','then','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','ioredis'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0a2f,0xe8));var _0xf0a2=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x0a2f[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require(_0xf0a2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0a2('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0a2('0x2'));var logger=require('../../config/logger')(_0xf0a2('0x3'));var config=require(_0xf0a2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xf0a2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47992c,_0x107f0f,_0x3695e9){return new BPromise(function(_0x2392bd,_0x21dedd){return client[_0xf0a2('0x6')](_0x47992c,_0x3695e9)[_0xf0a2('0x7')](function(_0x27c1a4){logger['info'](_0xf0a2('0x8'),_0x107f0f,'request\x20sent');logger[_0xf0a2('0x9')](_0xf0a2('0xa'),_0x107f0f,_0xf0a2('0xb'),JSON[_0xf0a2('0xc')](_0x27c1a4));if(_0x27c1a4['error']){if(_0x27c1a4[_0xf0a2('0xd')][_0xf0a2('0xe')]===0x1f4){logger[_0xf0a2('0xd')](_0xf0a2('0x8'),_0x107f0f,_0x27c1a4[_0xf0a2('0xd')][_0xf0a2('0xf')]);return _0x21dedd(_0x27c1a4[_0xf0a2('0xd')][_0xf0a2('0xf')]);}logger[_0xf0a2('0xd')](_0xf0a2('0x8'),_0x107f0f,_0x27c1a4[_0xf0a2('0xd')][_0xf0a2('0xf')]);return _0x2392bd(_0x27c1a4[_0xf0a2('0xd')][_0xf0a2('0xf')]);}else{logger['info'](_0xf0a2('0x8'),_0x107f0f,_0xf0a2('0xb'));_0x2392bd(_0x27c1a4[_0xf0a2('0x10')][_0xf0a2('0xf')]);}})[_0xf0a2('0x11')](function(_0xe534fd){logger[_0xf0a2('0xd')](_0xf0a2('0x8'),_0x107f0f,_0xe534fd);_0x21dedd(_0xe534fd);});});} \ No newline at end of file +var _0xd592=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x3d962b,_0x4c7d80){var _0x4cdc0e=function(_0x2a8f3b){while(--_0x2a8f3b){_0x3d962b['push'](_0x3d962b['shift']());}};_0x4cdc0e(++_0x4c7d80);}(_0xd592,0x77));var _0x2d59=function(_0x26b5b0,_0x4af0bf){_0x26b5b0=_0x26b5b0-0x0;var _0x2c067e=_0xd592[_0x26b5b0];return _0x2c067e;};'use strict';var _=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var moment=require(_0x2d59('0x2'));var BPromise=require(_0x2d59('0x3'));var rs=require(_0x2d59('0x4'));var fs=require('fs');var Redis=require(_0x2d59('0x5'));var db=require(_0x2d59('0x6'))['db'];var utils=require(_0x2d59('0x7'));var logger=require(_0x2d59('0x8'))(_0x2d59('0x9'));var config=require(_0x2d59('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2d59('0xb')][_0x2d59('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11cae7,_0x49eb9,_0x1b1d87){return new BPromise(function(_0x2d84c8,_0x218f8a){return client[_0x2d59('0xd')](_0x11cae7,_0x1b1d87)[_0x2d59('0xe')](function(_0x39e432){logger[_0x2d59('0xf')](_0x2d59('0x10'),_0x49eb9,'request\x20sent');logger[_0x2d59('0x11')](_0x2d59('0x12'),_0x49eb9,_0x2d59('0x13'),JSON[_0x2d59('0x14')](_0x39e432));if(_0x39e432[_0x2d59('0x15')]){if(_0x39e432[_0x2d59('0x15')]['code']===0x1f4){logger['error'](_0x2d59('0x10'),_0x49eb9,_0x39e432[_0x2d59('0x15')][_0x2d59('0x16')]);return _0x218f8a(_0x39e432[_0x2d59('0x15')]['message']);}logger['error'](_0x2d59('0x10'),_0x49eb9,_0x39e432[_0x2d59('0x15')][_0x2d59('0x16')]);return _0x2d84c8(_0x39e432['error']['message']);}else{logger[_0x2d59('0xf')](_0x2d59('0x10'),_0x49eb9,_0x2d59('0x13'));_0x2d84c8(_0x39e432['result'][_0x2d59('0x16')]);}})[_0x2d59('0x17')](function(_0x434392){logger['error'](_0x2d59('0x10'),_0x49eb9,_0x434392);_0x218f8a(_0x434392);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index c64a249..d462087 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 _0xea36=['Router','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x21ae69,_0x502734){var _0x113688=function(_0x4e56fa){while(--_0x4e56fa){_0x21ae69['push'](_0x21ae69['shift']());}};_0x113688(++_0x502734);}(_0xea36,0xb0));var _0x6ea3=function(_0x2dc330,_0x8d21fb){_0x2dc330=_0x2dc330-0x0;var _0x11cc49=_0xea36[_0x2dc330];return _0x11cc49;};'use strict';var multer=require(_0x6ea3('0x0'));var util=require(_0x6ea3('0x1'));var path=require(_0x6ea3('0x2'));var timeout=require(_0x6ea3('0x3'));var express=require('express');var router=express[_0x6ea3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6ea3('0x5'));router[_0x6ea3('0x6')]('/',auth[_0x6ea3('0x7')](),controller[_0x6ea3('0x8')]);router[_0x6ea3('0x6')](_0x6ea3('0x9'),auth[_0x6ea3('0x7')](),controller[_0x6ea3('0xa')]);router[_0x6ea3('0xb')]('/',auth[_0x6ea3('0x7')](),controller[_0x6ea3('0xc')]);router[_0x6ea3('0xd')]('/:id',auth[_0x6ea3('0x7')](),controller[_0x6ea3('0xe')]);router[_0x6ea3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6ea3('0x10')]);module[_0x6ea3('0x11')]=router; \ No newline at end of file +var _0xb6e4=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x834acc,_0x483add){var _0x28b761=function(_0x373bae){while(--_0x373bae){_0x834acc['push'](_0x834acc['shift']());}};_0x28b761(++_0x483add);}(_0xb6e4,0x141));var _0x4b6e=function(_0x5228e4,_0x1bf737){_0x5228e4=_0x5228e4-0x0;var _0x1b3dd2=_0xb6e4[_0x5228e4];return _0x1b3dd2;};'use strict';var multer=require(_0x4b6e('0x0'));var util=require(_0x4b6e('0x1'));var path=require(_0x4b6e('0x2'));var timeout=require(_0x4b6e('0x3'));var express=require(_0x4b6e('0x4'));var router=express[_0x4b6e('0x5')]();var auth=require(_0x4b6e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b6e('0x7'));var controller=require(_0x4b6e('0x8'));router['get']('/',auth[_0x4b6e('0x9')](),controller[_0x4b6e('0xa')]);router['get'](_0x4b6e('0xb'),auth[_0x4b6e('0x9')](),controller['show']);router[_0x4b6e('0xc')]('/',auth['isAuthenticated'](),controller[_0x4b6e('0xd')]);router[_0x4b6e('0xe')]('/:id',auth[_0x4b6e('0x9')](),controller[_0x4b6e('0xf')]);router[_0x4b6e('0x10')](_0x4b6e('0xb'),auth[_0x4b6e('0x9')](),controller[_0x4b6e('0x11')]);module[_0x4b6e('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 a6ad0e5..2410ea3 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 _0x9c44=['BOOLEAN','STRING','name'];(function(_0xc09060,_0x30ca8a){var _0x46073f=function(_0x381c4a){while(--_0x381c4a){_0xc09060['push'](_0xc09060['shift']());}};_0x46073f(++_0x30ca8a);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'unique':_0x49c4('0x1')},'description':{'type':Sequelize[_0x49c4('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x2a8826,_0x1b9b5c){var _0x158740=function(_0x4c82ec){while(--_0x4c82ec){_0x2a8826['push'](_0x2a8826['shift']());}};_0x158740(++_0x1b9b5c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4a2fd36..6225b7e 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 _0xe1e7=['params','rawAttributes','intersection','length','include','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','/etc/asterisk/extensions_xcally_contexts.conf','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','request','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','Contexts','UserProfileResource','then','stack','name','send','map','VoiceContext','fieldName','type','key','query','keys','attributes','model','fields','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show'];(function(_0x568882,_0x25e58d){var _0x288477=function(_0xac414){while(--_0xac414){_0x568882['push'](_0x568882['shift']());}};_0x288477(++_0x25e58d);}(_0xe1e7,0xe5));var _0x7e1e=function(_0x2ed24e,_0x141867){_0x2ed24e=_0x2ed24e-0x0;var _0x1e016e=_0xe1e7[_0x2ed24e];return _0x1e016e;};'use strict';var pdf=require(_0x7e1e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e1e('0x2'));var rp=require(_0x7e1e('0x3'));var moment=require(_0x7e1e('0x4'));var BPromise=require(_0x7e1e('0x5'));var Mustache=require(_0x7e1e('0x6'));var util=require(_0x7e1e('0x7'));var path=require(_0x7e1e('0x8'));var sox=require(_0x7e1e('0x9'));var csv=require(_0x7e1e('0xa'));var ejs=require(_0x7e1e('0xb'));var fs=require('fs');var _=require(_0x7e1e('0xc'));var squel=require(_0x7e1e('0xd'));var crypto=require(_0x7e1e('0xe'));var jsforce=require(_0x7e1e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7e1e('0xa'));var querystring=require(_0x7e1e('0x10'));var Papa=require(_0x7e1e('0x11'));var Redis=require(_0x7e1e('0x12'));var authService=require(_0x7e1e('0x13'));var qs=require(_0x7e1e('0x14'));var as=require(_0x7e1e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e1e('0x16'))(_0x7e1e('0x17'));var utils=require(_0x7e1e('0x18'));var config=require(_0x7e1e('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7e1e('0x1a'));var client=jayson['client'][_0x7e1e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x53b083,_0x59b1ca,_0x486ea7){if(_0x486ea7){var _0x44167a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44167a[_0x7e1e('0x1c')](_0x59b1ca)){return _0x53b083;}else{throw new db[(_0x7e1e('0x1d'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x53b083;}}function respondWithRpcPromise(_0x50ffb7,_0x4a92db,_0x5b07a0,_0x5a09bf){return new BPromise(function(_0x40607c,_0xc1975f){var _0x424612=_0x5a09bf||client;return _0x424612[_0x7e1e('0x1e')](_0x50ffb7,_0x5b07a0)['then'](function(_0xf9635e){logger['info']('VoiceContext,\x20%s,\x20%s',_0x4a92db,_0x7e1e('0x1f'));logger['debug'](_0x7e1e('0x20'),_0x4a92db,'request\x20sent',JSON[_0x7e1e('0x21')](_0xf9635e));if(_0xf9635e['error']){if(_0xf9635e['error']['code']===0x1f4){logger[_0x7e1e('0x22')](_0x7e1e('0x23'),_0x4a92db,_0xf9635e[_0x7e1e('0x22')]['message']);return _0xc1975f(_0xf9635e['error']['message']);}logger[_0x7e1e('0x22')]('VoiceContext,\x20%s,\x20%s',_0x4a92db,_0xf9635e['error']['message']);return _0x40607c(_0xf9635e[_0x7e1e('0x22')][_0x7e1e('0x24')]);}else{logger['info'](_0x7e1e('0x23'),_0x4a92db,_0x7e1e('0x1f'));_0x40607c(_0xf9635e['result']['message']);}})[_0x7e1e('0x25')](function(_0xb0574e){logger[_0x7e1e('0x22')]('VoiceContext,\x20%s,\x20%s',_0x4a92db,_0xb0574e);_0xc1975f(_0xb0574e);});});}function respondWithStatusCode(_0x359d97,_0x2737c2){_0x2737c2=_0x2737c2||0xcc;return function(_0x1e338e){if(_0x1e338e){return _0x359d97[_0x7e1e('0x26')](_0x2737c2);}return _0x359d97[_0x7e1e('0x27')](_0x2737c2)['end']();};}function respondWithResult(_0x133559,_0x5e7e6f){_0x5e7e6f=_0x5e7e6f||0xc8;return function(_0x586d04){if(_0x586d04){return _0x133559[_0x7e1e('0x27')](_0x5e7e6f)[_0x7e1e('0x28')](_0x586d04);}};}function respondWithFilteredResult(_0x3c44b9,_0x51ce84){return function(_0x3919dc){if(_0x3919dc){var _0x2aa3c7=_0x3919dc['count'],_0x5d4feb=_0x51ce84[_0x7e1e('0x29')],_0x184160=_0x51ce84[_0x7e1e('0x29')]+_0x51ce84[_0x7e1e('0x2a')],_0x4ba40d;if(_0x184160>=_0x2aa3c7){_0x184160=_0x2aa3c7;_0x4ba40d=0xc8;}else{_0x4ba40d=0xce;}_0x3c44b9['status'](_0x4ba40d);return _0x3c44b9[_0x7e1e('0x2b')](_0x7e1e('0x2c'),_0x5d4feb+'-'+_0x184160+'/'+_0x2aa3c7)[_0x7e1e('0x28')](_0x3919dc);}return null;};}function patchUpdates(_0x43977b){return function(_0x214a60){try{jsonpatch[_0x7e1e('0x2d')](_0x214a60,_0x43977b,!![]);}catch(_0x2c100e){return BPromise[_0x7e1e('0x2e')](_0x2c100e);}return _0x214a60[_0x7e1e('0x2f')]();};}function saveUpdates(_0x3cbcbd,_0xf42415){return function(_0xb8c240){if(_0xb8c240){return _0xb8c240[_0x7e1e('0x30')](_0x3cbcbd)['then'](function(_0x4194c5){return _0x4194c5;});}return null;};}function removeEntity(_0x507ecc,_0xf9e98d){return function(_0x5a4952){if(_0x5a4952){return _0x5a4952[_0x7e1e('0x31')]()['then'](function(){var _0x1d2206=_0x5a4952['get']({'plain':!![]});var _0x106a47=_0x7e1e('0x32');return db[_0x7e1e('0x33')][_0x7e1e('0x31')]({'where':{'type':_0x106a47,'resourceId':_0x1d2206['id']}})['then'](function(){return _0x5a4952;});})[_0x7e1e('0x34')](function(){_0x507ecc[_0x7e1e('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2df8e5,_0x1d202a){return function(_0x15a16b){if(!_0x15a16b){_0x2df8e5[_0x7e1e('0x26')](0x194);}return _0x15a16b;};}function handleError(_0x481ba2,_0x229eb2){_0x229eb2=_0x229eb2||0x1f4;return function(_0x50c495){logger[_0x7e1e('0x22')](_0x50c495[_0x7e1e('0x35')]);if(_0x50c495['name']){delete _0x50c495[_0x7e1e('0x36')];}_0x481ba2[_0x7e1e('0x27')](_0x229eb2)[_0x7e1e('0x37')](_0x50c495);};}exports['index']=function(_0x74a440,_0x5cc920){var _0x1e06eb={},_0x462b02={},_0x444a70={'count':0x0,'rows':[]};var _0x326c98=_[_0x7e1e('0x38')](db[_0x7e1e('0x39')]['rawAttributes'],function(_0x95dc28){return{'name':_0x95dc28[_0x7e1e('0x3a')],'type':_0x95dc28[_0x7e1e('0x3b')][_0x7e1e('0x3c')]};});_0x462b02['model']=_[_0x7e1e('0x38')](_0x326c98,_0x7e1e('0x36'));_0x462b02[_0x7e1e('0x3d')]=_[_0x7e1e('0x3e')](_0x74a440[_0x7e1e('0x3d')]);_0x462b02['filters']=_['intersection'](_0x462b02['model'],_0x462b02['query']);_0x1e06eb[_0x7e1e('0x3f')]=_['intersection'](_0x462b02[_0x7e1e('0x40')],qs[_0x7e1e('0x41')](_0x74a440[_0x7e1e('0x3d')]['fields']));_0x1e06eb['attributes']=_0x1e06eb['attributes']['length']?_0x1e06eb['attributes']:_0x462b02[_0x7e1e('0x40')];if(!_0x74a440[_0x7e1e('0x3d')]['hasOwnProperty']('nolimit')){_0x1e06eb[_0x7e1e('0x2a')]=qs[_0x7e1e('0x2a')](_0x74a440[_0x7e1e('0x3d')][_0x7e1e('0x2a')]);_0x1e06eb['offset']=qs['offset'](_0x74a440['query'][_0x7e1e('0x29')]);}_0x1e06eb['order']=qs['sort'](_0x74a440['query'][_0x7e1e('0x42')]);_0x1e06eb[_0x7e1e('0x43')]=qs[_0x7e1e('0x44')](_['pick'](_0x74a440[_0x7e1e('0x3d')],_0x462b02[_0x7e1e('0x44')]));if(_0x74a440[_0x7e1e('0x3d')][_0x7e1e('0x45')]){_0x1e06eb[_0x7e1e('0x43')]=_[_0x7e1e('0x46')](_0x1e06eb[_0x7e1e('0x43')],{'$or':_[_0x7e1e('0x38')](_0x326c98,function(_0x5ab2a8){if(_0x5ab2a8[_0x7e1e('0x3b')]!==_0x7e1e('0x47')){var _0x464661={};_0x464661[_0x5ab2a8[_0x7e1e('0x36')]]={'$like':'%'+_0x74a440[_0x7e1e('0x3d')]['filter']+'%'};return _0x464661;}})});}_0x1e06eb=_[_0x7e1e('0x46')]({},_0x1e06eb,_0x74a440[_0x7e1e('0x48')]);var _0x4193e9={'where':_0x1e06eb['where']};return db[_0x7e1e('0x39')]['count'](_0x4193e9)[_0x7e1e('0x34')](function(_0x36cfbf){_0x444a70['count']=_0x36cfbf;if(_0x74a440[_0x7e1e('0x3d')][_0x7e1e('0x49')]){_0x1e06eb['include']=[{'all':!![]}];}return db[_0x7e1e('0x39')][_0x7e1e('0x4a')](_0x1e06eb);})[_0x7e1e('0x34')](function(_0x36264e){_0x444a70[_0x7e1e('0x4b')]=_0x36264e;return _0x444a70;})['then'](respondWithFilteredResult(_0x5cc920,_0x1e06eb))['catch'](handleError(_0x5cc920,null));};exports[_0x7e1e('0x4c')]=function(_0x884cef,_0x2a9d25){var _0x42a0e5={'raw':![],'where':{'id':_0x884cef[_0x7e1e('0x4d')]['id']}},_0x44a501={};_0x44a501['model']=_[_0x7e1e('0x3e')](db['VoiceContext'][_0x7e1e('0x4e')]);_0x44a501['query']=_[_0x7e1e('0x3e')](_0x884cef[_0x7e1e('0x3d')]);_0x44a501[_0x7e1e('0x44')]=_[_0x7e1e('0x4f')](_0x44a501[_0x7e1e('0x40')],_0x44a501[_0x7e1e('0x3d')]);_0x42a0e5[_0x7e1e('0x3f')]=_[_0x7e1e('0x4f')](_0x44a501[_0x7e1e('0x40')],qs[_0x7e1e('0x41')](_0x884cef['query'][_0x7e1e('0x41')]));_0x42a0e5[_0x7e1e('0x3f')]=_0x42a0e5[_0x7e1e('0x3f')][_0x7e1e('0x50')]?_0x42a0e5[_0x7e1e('0x3f')]:_0x44a501[_0x7e1e('0x40')];if(_0x884cef[_0x7e1e('0x3d')]['includeAll']){_0x42a0e5[_0x7e1e('0x51')]=[{'all':!![]}];}_0x42a0e5=_[_0x7e1e('0x46')]({},_0x42a0e5,_0x884cef[_0x7e1e('0x48')]);return db[_0x7e1e('0x39')][_0x7e1e('0x52')](_0x42a0e5)[_0x7e1e('0x34')](handleEntityNotFound(_0x2a9d25,null))[_0x7e1e('0x34')](respondWithResult(_0x2a9d25,null))[_0x7e1e('0x25')](handleError(_0x2a9d25,null));};exports['create']=function(_0xb54355,_0x493ebe,_0x15d790){var _0x4de057;return db[_0x7e1e('0x39')][_0x7e1e('0x53')](_0xb54355[_0x7e1e('0x54')],{'raw':!![]})[_0x7e1e('0x34')](function(_0x29828a){_0x4de057=_0x29828a;return db[_0x7e1e('0x39')]['findAll']({'raw':!![]});})[_0x7e1e('0x34')](function(_0xf241c1){var _0x22fb74=fs[_0x7e1e('0x55')](path[_0x7e1e('0x56')](config['root'],_0x7e1e('0x57')),_0x7e1e('0x58'));var _0x2414b0=ejs[_0x7e1e('0x59')](_0x22fb74,{'contexts':_0xf241c1||[]});fs[_0x7e1e('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2414b0);})[_0x7e1e('0x34')](function(){return respondWithRpcPromise(_0x7e1e('0x5b'),_0x7e1e('0x53'),{'module':_0x7e1e('0x5c')});})[_0x7e1e('0x34')](function(){var _0x5638ad=_0xb54355['user']['get']({'plain':!![]});if(!_0x5638ad)throw new Error(_0x7e1e('0x5d'));if(_0x5638ad[_0x7e1e('0x5e')]===_0x7e1e('0x5f')){var _0x97c215=_0x4de057['get']({'plain':!![]});return db[_0x7e1e('0x60')][_0x7e1e('0x52')]({'where':{'name':_0x7e1e('0x32'),'userProfileId':_0x5638ad[_0x7e1e('0x61')]},'raw':!![]})[_0x7e1e('0x34')](function(_0x1ba942){if(_0x1ba942&&_0x1ba942[_0x7e1e('0x62')]===0x0){return db['UserProfileResource'][_0x7e1e('0x53')]({'name':_0x97c215[_0x7e1e('0x36')],'resourceId':_0x97c215['id'],'type':_0x1ba942[_0x7e1e('0x36')],'sectionId':_0x1ba942['id']},{})['then'](function(){return _0x4de057;});}else{return _0x4de057;}})['catch'](function(_0x4cb338){logger[_0x7e1e('0x22')](_0x7e1e('0x63'),_0x4cb338);throw _0x4cb338;});}return _0x4de057;})[_0x7e1e('0x34')](respondWithResult(_0x493ebe,0xc9))['catch'](handleError(_0x493ebe,null));};exports[_0x7e1e('0x30')]=function(_0x3181be,_0x527d88,_0x38db1c){var _0x3e503d;return db[_0x7e1e('0x39')][_0x7e1e('0x52')]({'where':{'id':_0x3181be[_0x7e1e('0x4d')]['id']}})[_0x7e1e('0x34')](handleEntityNotFound(_0x527d88,null))['then'](saveUpdates(_0x3181be[_0x7e1e('0x54')],null))[_0x7e1e('0x34')](function(_0x21abb1){if(_0x21abb1){_0x3e503d=_0x21abb1;return db[_0x7e1e('0x39')][_0x7e1e('0x4a')]({'raw':!![]});}})['then'](function(_0x38755d){var _0x2f854c=fs['readFileSync'](path['join'](config[_0x7e1e('0x64')],_0x7e1e('0x57')),'utf8');var _0x20f549=ejs['render'](_0x2f854c,{'contexts':_0x38755d||[]});fs['writeFileSync'](_0x7e1e('0x65'),_0x20f549);})[_0x7e1e('0x34')](function(){return respondWithRpcPromise(_0x7e1e('0x5b'),'update',{'module':_0x7e1e('0x5c')});})['then'](function(){return _0x3e503d;})[_0x7e1e('0x34')](respondWithResult(_0x527d88,null))[_0x7e1e('0x25')](handleError(_0x527d88,null));};exports[_0x7e1e('0x31')]=function(_0x5a273a,_0x484d8c,_0x35cb22){var _0x5b1e81;return db[_0x7e1e('0x39')][_0x7e1e('0x52')]({'where':{'id':_0x5a273a[_0x7e1e('0x4d')]['id']}})[_0x7e1e('0x34')](handleEntityNotFound(_0x484d8c,null))[_0x7e1e('0x34')](removeEntity(_0x484d8c,null))[_0x7e1e('0x34')](function(){return db[_0x7e1e('0x39')][_0x7e1e('0x4a')]({'raw':!![]});})[_0x7e1e('0x34')](function(_0xea506){var _0x8d7b83=fs[_0x7e1e('0x55')](path[_0x7e1e('0x56')](config[_0x7e1e('0x64')],'server/files/templates/context.ejs'),'utf8');var _0x4fbe78=ejs[_0x7e1e('0x59')](_0x8d7b83,{'contexts':_0xea506});fs[_0x7e1e('0x5a')](_0x7e1e('0x65'),_0x4fbe78);return respondWithRpcPromise('Reload',_0x7e1e('0x31'),{'module':_0x7e1e('0x5c')});})['catch'](handleError(_0x484d8c,null));}; \ No newline at end of file +var _0x5388=['keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','options','includeAll','include','findAll','rows','show','params','merge','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','Sequelize','request','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','then','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','query'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0x5388,0x1ba));var _0x8538=function(_0x351865,_0x595cbe){_0x351865=_0x351865-0x0;var _0x28e5ff=_0x5388[_0x351865];return _0x28e5ff;};'use strict';var pdf=require(_0x8538('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8538('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8538('0x2'));var moment=require(_0x8538('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8538('0x4'));var util=require(_0x8538('0x5'));var path=require(_0x8538('0x6'));var sox=require('sox');var csv=require(_0x8538('0x7'));var ejs=require(_0x8538('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8538('0x9'));var jsforce=require(_0x8538('0xa'));var deskjs=require(_0x8538('0xb'));var toCsv=require(_0x8538('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8538('0xc'));var authService=require(_0x8538('0xd'));var qs=require(_0x8538('0xe'));var as=require(_0x8538('0xf'));var hardwareService=require(_0x8538('0x10'));var logger=require('../../config/logger')(_0x8538('0x11'));var utils=require(_0x8538('0x12'));var config=require(_0x8538('0x13'));var db=require(_0x8538('0x14'))['db'];var jayson=require(_0x8538('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2189e1,_0x54ceb1,_0x2f9779){if(_0x2f9779){var _0x2e9ddb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e9ddb['test'](_0x54ceb1)){return _0x2189e1;}else{throw new db[(_0x8538('0x16'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2189e1;}}function respondWithRpcPromise(_0x372395,_0x166fe7,_0x32359c,_0x241571){return new BPromise(function(_0x111919,_0x18ce5d){var _0x2d6a81=_0x241571||client;return _0x2d6a81[_0x8538('0x17')](_0x372395,_0x32359c)['then'](function(_0x1221a1){logger['info'](_0x8538('0x18'),_0x166fe7,_0x8538('0x19'));logger['debug'](_0x8538('0x1a'),_0x166fe7,'request\x20sent',JSON[_0x8538('0x1b')](_0x1221a1));if(_0x1221a1[_0x8538('0x1c')]){if(_0x1221a1[_0x8538('0x1c')]['code']===0x1f4){logger[_0x8538('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x166fe7,_0x1221a1[_0x8538('0x1c')][_0x8538('0x1d')]);return _0x18ce5d(_0x1221a1[_0x8538('0x1c')][_0x8538('0x1d')]);}logger['error'](_0x8538('0x18'),_0x166fe7,_0x1221a1[_0x8538('0x1c')]['message']);return _0x111919(_0x1221a1[_0x8538('0x1c')][_0x8538('0x1d')]);}else{logger[_0x8538('0x1e')](_0x8538('0x18'),_0x166fe7,_0x8538('0x19'));_0x111919(_0x1221a1[_0x8538('0x1f')][_0x8538('0x1d')]);}})[_0x8538('0x20')](function(_0xd98dba){logger[_0x8538('0x1c')](_0x8538('0x18'),_0x166fe7,_0xd98dba);_0x18ce5d(_0xd98dba);});});}function respondWithStatusCode(_0x39cff0,_0x172762){_0x172762=_0x172762||0xcc;return function(_0x374cc){if(_0x374cc){return _0x39cff0[_0x8538('0x21')](_0x172762);}return _0x39cff0['status'](_0x172762)[_0x8538('0x22')]();};}function respondWithResult(_0x119fad,_0x4bc817){_0x4bc817=_0x4bc817||0xc8;return function(_0x1957ff){if(_0x1957ff){return _0x119fad[_0x8538('0x23')](_0x4bc817)['json'](_0x1957ff);}};}function respondWithFilteredResult(_0x6b0a6f,_0x4bfd5d){return function(_0x19cadf){if(_0x19cadf){var _0x448f37=_0x19cadf[_0x8538('0x24')],_0xb14ff2=_0x4bfd5d['offset'],_0x2420c0=_0x4bfd5d[_0x8538('0x25')]+_0x4bfd5d[_0x8538('0x26')],_0x460560;if(_0x2420c0>=_0x448f37){_0x2420c0=_0x448f37;_0x460560=0xc8;}else{_0x460560=0xce;}_0x6b0a6f[_0x8538('0x23')](_0x460560);return _0x6b0a6f[_0x8538('0x27')](_0x8538('0x28'),_0xb14ff2+'-'+_0x2420c0+'/'+_0x448f37)['json'](_0x19cadf);}return null;};}function patchUpdates(_0x5f2586){return function(_0x5c1576){try{jsonpatch[_0x8538('0x29')](_0x5c1576,_0x5f2586,!![]);}catch(_0x5a7878){return BPromise[_0x8538('0x2a')](_0x5a7878);}return _0x5c1576[_0x8538('0x2b')]();};}function saveUpdates(_0x4c0c2d,_0x347a38){return function(_0x573195){if(_0x573195){return _0x573195['update'](_0x4c0c2d)['then'](function(_0x3b8b49){return _0x3b8b49;});}return null;};}function removeEntity(_0x1abcee,_0x2abddd){return function(_0x3caa68){if(_0x3caa68){return _0x3caa68[_0x8538('0x2c')]()['then'](function(){var _0x37edb8=_0x3caa68[_0x8538('0x2d')]({'plain':!![]});var _0x14b5f7='Contexts';return db[_0x8538('0x2e')]['destroy']({'where':{'type':_0x14b5f7,'resourceId':_0x37edb8['id']}})[_0x8538('0x2f')](function(){return _0x3caa68;});})['then'](function(){_0x1abcee[_0x8538('0x23')](0xcc)[_0x8538('0x22')]();});}};}function handleEntityNotFound(_0x517492,_0xa50b3c){return function(_0x270457){if(!_0x270457){_0x517492[_0x8538('0x21')](0x194);}return _0x270457;};}function handleError(_0xd08743,_0x2e7865){_0x2e7865=_0x2e7865||0x1f4;return function(_0x1cfb6e){logger[_0x8538('0x1c')](_0x1cfb6e[_0x8538('0x30')]);if(_0x1cfb6e[_0x8538('0x31')]){delete _0x1cfb6e[_0x8538('0x31')];}_0xd08743['status'](_0x2e7865)[_0x8538('0x32')](_0x1cfb6e);};}exports[_0x8538('0x33')]=function(_0x4dfc4c,_0x47de6b){var _0x2c3f60={},_0x437aff={},_0x3cef80={'count':0x0,'rows':[]};var _0x2f88cd=_[_0x8538('0x34')](db[_0x8538('0x35')][_0x8538('0x36')],function(_0x4fe064){return{'name':_0x4fe064[_0x8538('0x37')],'type':_0x4fe064['type'][_0x8538('0x38')]};});_0x437aff['model']=_[_0x8538('0x34')](_0x2f88cd,'name');_0x437aff[_0x8538('0x39')]=_[_0x8538('0x3a')](_0x4dfc4c[_0x8538('0x39')]);_0x437aff['filters']=_[_0x8538('0x3b')](_0x437aff[_0x8538('0x3c')],_0x437aff[_0x8538('0x39')]);_0x2c3f60[_0x8538('0x3d')]=_[_0x8538('0x3b')](_0x437aff['model'],qs[_0x8538('0x3e')](_0x4dfc4c[_0x8538('0x39')]['fields']));_0x2c3f60[_0x8538('0x3d')]=_0x2c3f60[_0x8538('0x3d')][_0x8538('0x3f')]?_0x2c3f60[_0x8538('0x3d')]:_0x437aff[_0x8538('0x3c')];if(!_0x4dfc4c[_0x8538('0x39')]['hasOwnProperty'](_0x8538('0x40'))){_0x2c3f60[_0x8538('0x26')]=qs[_0x8538('0x26')](_0x4dfc4c['query'][_0x8538('0x26')]);_0x2c3f60['offset']=qs[_0x8538('0x25')](_0x4dfc4c[_0x8538('0x39')][_0x8538('0x25')]);}_0x2c3f60[_0x8538('0x41')]=qs[_0x8538('0x42')](_0x4dfc4c[_0x8538('0x39')]['sort']);_0x2c3f60[_0x8538('0x43')]=qs[_0x8538('0x44')](_[_0x8538('0x45')](_0x4dfc4c[_0x8538('0x39')],_0x437aff['filters']));if(_0x4dfc4c['query'][_0x8538('0x46')]){_0x2c3f60['where']=_['merge'](_0x2c3f60[_0x8538('0x43')],{'$or':_['map'](_0x2f88cd,function(_0x491f9b){if(_0x491f9b[_0x8538('0x47')]!=='VIRTUAL'){var _0x465deb={};_0x465deb[_0x491f9b[_0x8538('0x31')]]={'$like':'%'+_0x4dfc4c[_0x8538('0x39')]['filter']+'%'};return _0x465deb;}})});}_0x2c3f60=_['merge']({},_0x2c3f60,_0x4dfc4c[_0x8538('0x48')]);var _0x33e5fd={'where':_0x2c3f60['where']};return db[_0x8538('0x35')][_0x8538('0x24')](_0x33e5fd)[_0x8538('0x2f')](function(_0x223084){_0x3cef80[_0x8538('0x24')]=_0x223084;if(_0x4dfc4c[_0x8538('0x39')][_0x8538('0x49')]){_0x2c3f60[_0x8538('0x4a')]=[{'all':!![]}];}return db['VoiceContext'][_0x8538('0x4b')](_0x2c3f60);})[_0x8538('0x2f')](function(_0x166dae){_0x3cef80[_0x8538('0x4c')]=_0x166dae;return _0x3cef80;})['then'](respondWithFilteredResult(_0x47de6b,_0x2c3f60))['catch'](handleError(_0x47de6b,null));};exports[_0x8538('0x4d')]=function(_0x437a6b,_0xd31f6e){var _0xa77a03={'raw':![],'where':{'id':_0x437a6b[_0x8538('0x4e')]['id']}},_0xa2d5f9={};_0xa2d5f9['model']=_[_0x8538('0x3a')](db[_0x8538('0x35')]['rawAttributes']);_0xa2d5f9[_0x8538('0x39')]=_[_0x8538('0x3a')](_0x437a6b['query']);_0xa2d5f9[_0x8538('0x44')]=_[_0x8538('0x3b')](_0xa2d5f9[_0x8538('0x3c')],_0xa2d5f9['query']);_0xa77a03[_0x8538('0x3d')]=_[_0x8538('0x3b')](_0xa2d5f9[_0x8538('0x3c')],qs[_0x8538('0x3e')](_0x437a6b[_0x8538('0x39')][_0x8538('0x3e')]));_0xa77a03[_0x8538('0x3d')]=_0xa77a03[_0x8538('0x3d')][_0x8538('0x3f')]?_0xa77a03[_0x8538('0x3d')]:_0xa2d5f9[_0x8538('0x3c')];if(_0x437a6b[_0x8538('0x39')][_0x8538('0x49')]){_0xa77a03[_0x8538('0x4a')]=[{'all':!![]}];}_0xa77a03=_[_0x8538('0x4f')]({},_0xa77a03,_0x437a6b[_0x8538('0x48')]);return db[_0x8538('0x35')][_0x8538('0x50')](_0xa77a03)['then'](handleEntityNotFound(_0xd31f6e,null))[_0x8538('0x2f')](respondWithResult(_0xd31f6e,null))['catch'](handleError(_0xd31f6e,null));};exports['create']=function(_0x4c2818,_0x5b9430,_0x36b6d9){var _0x31aacd;return db['VoiceContext'][_0x8538('0x51')](_0x4c2818['body'],{'raw':!![]})[_0x8538('0x2f')](function(_0x1e5301){_0x31aacd=_0x1e5301;return db[_0x8538('0x35')][_0x8538('0x4b')]({'raw':!![]});})[_0x8538('0x2f')](function(_0x33ef80){var _0x555445=fs[_0x8538('0x52')](path[_0x8538('0x53')](config[_0x8538('0x54')],_0x8538('0x55')),_0x8538('0x56'));var _0x2ce009=ejs[_0x8538('0x57')](_0x555445,{'contexts':_0x33ef80||[]});fs[_0x8538('0x58')](_0x8538('0x59'),_0x2ce009);})[_0x8538('0x2f')](function(){return respondWithRpcPromise(_0x8538('0x5a'),_0x8538('0x51'),{'module':_0x8538('0x5b')});})[_0x8538('0x2f')](function(){var _0x45aefa=_0x4c2818[_0x8538('0x5c')][_0x8538('0x2d')]({'plain':!![]});if(!_0x45aefa)throw new Error(_0x8538('0x5d'));if(_0x45aefa[_0x8538('0x5e')]===_0x8538('0x5c')){var _0x558041=_0x31aacd[_0x8538('0x2d')]({'plain':!![]});return db[_0x8538('0x5f')][_0x8538('0x50')]({'where':{'name':_0x8538('0x60'),'userProfileId':_0x45aefa[_0x8538('0x61')]},'raw':!![]})[_0x8538('0x2f')](function(_0x298fc9){if(_0x298fc9&&_0x298fc9['autoAssociation']===0x0){return db[_0x8538('0x2e')][_0x8538('0x51')]({'name':_0x558041[_0x8538('0x31')],'resourceId':_0x558041['id'],'type':_0x298fc9['name'],'sectionId':_0x298fc9['id']},{})[_0x8538('0x2f')](function(){return _0x31aacd;});}else{return _0x31aacd;}})[_0x8538('0x20')](function(_0x55c644){logger[_0x8538('0x1c')](_0x8538('0x62'),_0x55c644);throw _0x55c644;});}return _0x31aacd;})[_0x8538('0x2f')](respondWithResult(_0x5b9430,0xc9))[_0x8538('0x20')](handleError(_0x5b9430,null));};exports[_0x8538('0x63')]=function(_0x417b16,_0x20bb8a,_0xd0bd68){var _0x267520;return db[_0x8538('0x35')]['find']({'where':{'id':_0x417b16[_0x8538('0x4e')]['id']}})['then'](handleEntityNotFound(_0x20bb8a,null))[_0x8538('0x2f')](saveUpdates(_0x417b16['body'],null))[_0x8538('0x2f')](function(_0x93885){if(_0x93885){_0x267520=_0x93885;return db[_0x8538('0x35')][_0x8538('0x4b')]({'raw':!![]});}})[_0x8538('0x2f')](function(_0x18faa0){var _0x426d20=fs[_0x8538('0x52')](path[_0x8538('0x53')](config[_0x8538('0x54')],_0x8538('0x55')),_0x8538('0x56'));var _0xda6b8a=ejs[_0x8538('0x57')](_0x426d20,{'contexts':_0x18faa0||[]});fs[_0x8538('0x58')](_0x8538('0x59'),_0xda6b8a);})['then'](function(){return respondWithRpcPromise(_0x8538('0x5a'),'update',{'module':_0x8538('0x5b')});})[_0x8538('0x2f')](function(){return _0x267520;})[_0x8538('0x2f')](respondWithResult(_0x20bb8a,null))[_0x8538('0x20')](handleError(_0x20bb8a,null));};exports[_0x8538('0x2c')]=function(_0x235bb5,_0x4c143d,_0x1e3e2c){var _0x3f8072;return db[_0x8538('0x35')][_0x8538('0x50')]({'where':{'id':_0x235bb5['params']['id']}})[_0x8538('0x2f')](handleEntityNotFound(_0x4c143d,null))[_0x8538('0x2f')](removeEntity(_0x4c143d,null))[_0x8538('0x2f')](function(){return db['VoiceContext'][_0x8538('0x4b')]({'raw':!![]});})['then'](function(_0x31aa06){var _0x29a0c9=fs[_0x8538('0x52')](path[_0x8538('0x53')](config[_0x8538('0x54')],_0x8538('0x55')),_0x8538('0x56'));var _0x288671=ejs[_0x8538('0x57')](_0x29a0c9,{'contexts':_0x31aa06});fs[_0x8538('0x58')](_0x8538('0x59'),_0x288671);return respondWithRpcPromise(_0x8538('0x5a'),'destroy',{'module':'chan_sip.so'});})[_0x8538('0x20')](handleError(_0x4c143d,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c828dd4..5d40ec9 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 _0x1780=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash'];(function(_0x4100e2,_0x2a6291){var _0xdf9806=function(_0x1463d0){while(--_0x1463d0){_0x4100e2['push'](_0x4100e2['shift']());}};_0xdf9806(++_0x2a6291);}(_0x1780,0x83));var _0x0178=function(_0x285cfd,_0x58a050){_0x285cfd=_0x285cfd-0x0;var _0x24cc1a=_0x1780[_0x285cfd];return _0x24cc1a;};'use strict';var _=require(_0x0178('0x0'));var util=require(_0x0178('0x1'));var logger=require(_0x0178('0x2'))(_0x0178('0x3'));var moment=require(_0x0178('0x4'));var BPromise=require('bluebird');var rp=require(_0x0178('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0178('0x6'));var config=require(_0x0178('0x7'));var attributes=require(_0x0178('0x8'));module[_0x0178('0x9')]=function(_0x40268e,_0xf04a71){return _0x40268e[_0x0178('0xa')](_0x0178('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4226=['define','VoiceContext','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x4226,0x1a3));var _0x6422=function(_0x309e46,_0x4d0c0b){_0x309e46=_0x309e46-0x0;var _0x5ed4a9=_0x4226[_0x309e46];return _0x5ed4a9;};'use strict';var _=require('lodash');var util=require(_0x6422('0x0'));var logger=require(_0x6422('0x1'))(_0x6422('0x2'));var moment=require(_0x6422('0x3'));var BPromise=require(_0x6422('0x4'));var rp=require(_0x6422('0x5'));var fs=require('fs');var path=require(_0x6422('0x6'));var rimraf=require(_0x6422('0x7'));var config=require(_0x6422('0x8'));var attributes=require(_0x6422('0x9'));module['exports']=function(_0x2e655d,_0x54bd2d){return _0x2e655d[_0x6422('0xa')](_0x6422('0xb'),attributes,{'tableName':_0x6422('0xc'),'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 2dadfac..98985d0 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 _0x7b33=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0x7b33,0xe1));var _0x37b3=function(_0x5a085c,_0x19d702){_0x5a085c=_0x5a085c-0x0;var _0x14cd5e=_0x7b33[_0x5a085c];return _0x14cd5e;};'use strict';var _=require(_0x37b3('0x0'));var util=require(_0x37b3('0x1'));var moment=require(_0x37b3('0x2'));var BPromise=require('bluebird');var rs=require(_0x37b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37b3('0x4'))['db'];var utils=require(_0x37b3('0x5'));var logger=require('../../config/logger')(_0x37b3('0x6'));var config=require(_0x37b3('0x7'));var jayson=require(_0x37b3('0x8'));var client=jayson['client'][_0x37b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26e704,_0x7c9ed,_0x2a4102){return new BPromise(function(_0x2c93ac,_0x24cc2c){return client[_0x37b3('0xa')](_0x26e704,_0x2a4102)[_0x37b3('0xb')](function(_0x566286){logger['info'](_0x37b3('0xc'),_0x7c9ed,'request\x20sent');logger[_0x37b3('0xd')](_0x37b3('0xe'),_0x7c9ed,_0x37b3('0xf'),JSON[_0x37b3('0x10')](_0x566286));if(_0x566286[_0x37b3('0x11')]){if(_0x566286[_0x37b3('0x11')][_0x37b3('0x12')]===0x1f4){logger[_0x37b3('0x11')](_0x37b3('0xc'),_0x7c9ed,_0x566286['error'][_0x37b3('0x13')]);return _0x24cc2c(_0x566286[_0x37b3('0x11')][_0x37b3('0x13')]);}logger[_0x37b3('0x11')](_0x37b3('0xc'),_0x7c9ed,_0x566286[_0x37b3('0x11')][_0x37b3('0x13')]);return _0x2c93ac(_0x566286['error'][_0x37b3('0x13')]);}else{logger[_0x37b3('0x14')]('VoiceContext,\x20%s,\x20%s',_0x7c9ed,_0x37b3('0xf'));_0x2c93ac(_0x566286[_0x37b3('0x15')][_0x37b3('0x13')]);}})[_0x37b3('0x16')](function(_0x89dc9f){logger[_0x37b3('0x11')](_0x37b3('0xc'),_0x7c9ed,_0x89dc9f);_0x24cc2c(_0x89dc9f);});});} \ No newline at end of file +var _0xf77d=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1f4c71,_0xc2ef3a){var _0x58b9cf=function(_0x4e6774){while(--_0x4e6774){_0x1f4c71['push'](_0x1f4c71['shift']());}};_0x58b9cf(++_0xc2ef3a);}(_0xf77d,0x15c));var _0xdf77=function(_0x1b7a5d,_0x1a068d){_0x1b7a5d=_0x1b7a5d-0x0;var _0x165d76=_0xf77d[_0x1b7a5d];return _0x165d76;};'use strict';var _=require(_0xdf77('0x0'));var util=require(_0xdf77('0x1'));var moment=require(_0xdf77('0x2'));var BPromise=require(_0xdf77('0x3'));var rs=require(_0xdf77('0x4'));var fs=require('fs');var Redis=require(_0xdf77('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf77('0x6'));var logger=require(_0xdf77('0x7'))('rpc');var config=require(_0xdf77('0x8'));var jayson=require(_0xdf77('0x9'));var client=jayson['client'][_0xdf77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30a7f4,_0x572222,_0x1e1f41){return new BPromise(function(_0xba685a,_0xd8cd71){return client[_0xdf77('0xb')](_0x30a7f4,_0x1e1f41)['then'](function(_0x11466f){logger[_0xdf77('0xc')]('VoiceContext,\x20%s,\x20%s',_0x572222,_0xdf77('0xd'));logger[_0xdf77('0xe')](_0xdf77('0xf'),_0x572222,_0xdf77('0xd'),JSON[_0xdf77('0x10')](_0x11466f));if(_0x11466f['error']){if(_0x11466f['error']['code']===0x1f4){logger[_0xdf77('0x11')](_0xdf77('0x12'),_0x572222,_0x11466f['error'][_0xdf77('0x13')]);return _0xd8cd71(_0x11466f[_0xdf77('0x11')][_0xdf77('0x13')]);}logger[_0xdf77('0x11')]('VoiceContext,\x20%s,\x20%s',_0x572222,_0x11466f[_0xdf77('0x11')][_0xdf77('0x13')]);return _0xba685a(_0x11466f['error']['message']);}else{logger[_0xdf77('0xc')](_0xdf77('0x12'),_0x572222,_0xdf77('0xd'));_0xba685a(_0x11466f[_0xdf77('0x14')][_0xdf77('0x13')]);}})[_0xdf77('0x15')](function(_0x58d81b){logger[_0xdf77('0x11')](_0xdf77('0x12'),_0x572222,_0x58d81b);_0xd8cd71(_0x58d81b);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 93f7be0..49efaa6 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 _0x5a4f=['update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show','post','create','put'];(function(_0x19fc13,_0x338343){var _0x5bcdb6=function(_0x2addef){while(--_0x2addef){_0x19fc13['push'](_0x19fc13['shift']());}};_0x5bcdb6(++_0x338343);}(_0x5a4f,0x179));var _0xf5a4=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5a4f[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xf5a4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf5a4('0x1'));var router=express[_0xf5a4('0x2')]();var auth=require(_0xf5a4('0x3'));var interaction=require(_0xf5a4('0x4'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xf5a4('0x5')](),controller[_0xf5a4('0x6')]);router[_0xf5a4('0x7')]('/describe',auth[_0xf5a4('0x5')](),controller[_0xf5a4('0x8')]);router[_0xf5a4('0x7')](_0xf5a4('0x9'),auth[_0xf5a4('0x5')](),controller[_0xf5a4('0xa')]);router[_0xf5a4('0xb')]('/',auth[_0xf5a4('0x5')](),controller[_0xf5a4('0xc')]);router[_0xf5a4('0xd')](_0xf5a4('0x9'),auth[_0xf5a4('0x5')](),controller[_0xf5a4('0xe')]);router['delete'](_0xf5a4('0x9'),auth[_0xf5a4('0x5')](),controller[_0xf5a4('0xf')]);module[_0xf5a4('0x10')]=router; \ No newline at end of file +var _0x687a=['../../config/environment','get','index','/describe','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x687a,0x1af));var _0xa687=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x687a[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xa687('0x0'));var util=require('util');var path=require(_0xa687('0x1'));var timeout=require('connect-timeout');var express=require(_0xa687('0x2'));var router=express[_0xa687('0x3')]();var auth=require(_0xa687('0x4'));var interaction=require(_0xa687('0x5'));var config=require(_0xa687('0x6'));var controller=require('./voiceDialReport.controller');router[_0xa687('0x7')]('/',auth['isAuthenticated'](),controller[_0xa687('0x8')]);router[_0xa687('0x7')](_0xa687('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xa687('0x7')](_0xa687('0xa'),auth['isAuthenticated'](),controller[_0xa687('0xb')]);router[_0xa687('0xc')]('/',auth[_0xa687('0xd')](),controller[_0xa687('0xe')]);router['put'](_0xa687('0xa'),auth[_0xa687('0xd')](),controller[_0xa687('0xf')]);router[_0xa687('0x10')](_0xa687('0xa'),auth[_0xa687('0xd')](),controller[_0xa687('0x11')]);module[_0xa687('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5ce02a9..97e16f5 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 _0xc7d9=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x4103b8,_0x33eaba){var _0x556d11=function(_0x32332a){while(--_0x32332a){_0x4103b8['push'](_0x4103b8['shift']());}};_0x556d11(++_0x33eaba);}(_0xc7d9,0x1d3));var _0x9c7d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc7d9[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x9c7d('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x9c7d('0x1')]},'channel':{'type':Sequelize[_0x9c7d('0x1')]},'channelstate':{'type':Sequelize[_0x9c7d('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9c7d('0x1')]},'calleridnum':{'type':Sequelize[_0x9c7d('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9c7d('0x1')]},'connectedlinename':{'type':Sequelize[_0x9c7d('0x1')]},'language':{'type':Sequelize[_0x9c7d('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9c7d('0x1')]},'exten':{'type':Sequelize[_0x9c7d('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9c7d('0x1')]},'linkedid':{'type':Sequelize[_0x9c7d('0x1')]},'destchannel':{'type':Sequelize[_0x9c7d('0x1')]},'destchannelstate':{'type':Sequelize[_0x9c7d('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9c7d('0x1')]},'destcalleridname':{'type':Sequelize[_0x9c7d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9c7d('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9c7d('0x1')]},'destaccountcode':{'type':Sequelize[_0x9c7d('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9c7d('0x2')]},'destuniqueid':{'type':Sequelize[_0x9c7d('0x1')]},'destlinkedid':{'type':Sequelize[_0x9c7d('0x1')]},'dialstring':{'type':Sequelize[_0x9c7d('0x1')]},'dialstatus':{'type':Sequelize[_0x9c7d('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9c7d('0x3')]},'endtime':{'type':Sequelize[_0x9c7d('0x3')]},'lastevent':{'type':Sequelize[_0x9c7d('0x1')],'comment':_0x9c7d('0x4')},'routeId':{'type':Sequelize[_0x9c7d('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x9c7d('0x2')]},'billableseconds':{'type':Sequelize[_0x9c7d('0x2')]}}; \ No newline at end of file +var _0x4dfc=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4dfc,0x16f));var _0xc4df=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0x4dfc[_0x2b305c];return _0x5d8c85;};'use strict';var Sequelize=require('sequelize');module[_0xc4df('0x0')]={'privilege':{'type':Sequelize[_0xc4df('0x1')]},'channel':{'type':Sequelize[_0xc4df('0x1')]},'channelstate':{'type':Sequelize[_0xc4df('0x2')]},'channelstatedesc':{'type':Sequelize[_0xc4df('0x1')]},'calleridnum':{'type':Sequelize[_0xc4df('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xc4df('0x1')]},'connectedlinename':{'type':Sequelize[_0xc4df('0x1')]},'language':{'type':Sequelize[_0xc4df('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc4df('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc4df('0x2')]},'uniqueid':{'type':Sequelize[_0xc4df('0x1')]},'linkedid':{'type':Sequelize[_0xc4df('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xc4df('0x1')]},'destcalleridnum':{'type':Sequelize[_0xc4df('0x1')]},'destcalleridname':{'type':Sequelize[_0xc4df('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xc4df('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xc4df('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc4df('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc4df('0x1')]},'destpriority':{'type':Sequelize[_0xc4df('0x2')]},'destuniqueid':{'type':Sequelize[_0xc4df('0x1')]},'destlinkedid':{'type':Sequelize[_0xc4df('0x1')]},'dialstring':{'type':Sequelize[_0xc4df('0x1')]},'dialstatus':{'type':Sequelize[_0xc4df('0x1')]},'starttime':{'type':Sequelize[_0xc4df('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0xc4df('0x4')},'routeId':{'type':Sequelize[_0xc4df('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc4df('0x2')]},'billableseconds':{'type':Sequelize[_0xc4df('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index edf07a7..187d989 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 _0x24c9=['update','then','destroy','error','stack','name','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','keys','includeAll','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject'];(function(_0x4e689a,_0x203136){var _0x273373=function(_0x3048ff){while(--_0x3048ff){_0x4e689a['push'](_0x4e689a['shift']());}};_0x273373(++_0x203136);}(_0x24c9,0x1ac));var _0x924c=function(_0x3625cd,_0x35340d){_0x3625cd=_0x3625cd-0x0;var _0x312e98=_0x24c9[_0x3625cd];return _0x312e98;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x924c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x924c('0x1'));var rp=require(_0x924c('0x2'));var moment=require(_0x924c('0x3'));var BPromise=require(_0x924c('0x4'));var Mustache=require(_0x924c('0x5'));var util=require('util');var path=require(_0x924c('0x6'));var sox=require(_0x924c('0x7'));var csv=require(_0x924c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x924c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x924c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x924c('0x8'));var querystring=require(_0x924c('0xb'));var Papa=require(_0x924c('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x924c('0xd'));var hardwareService=require(_0x924c('0xe'));var logger=require('../../config/logger')(_0x924c('0xf'));var utils=require('../../config/utils');var config=require(_0x924c('0x10'));var db=require(_0x924c('0x11'))['db'];function respondWithStatusCode(_0x179a6f,_0x512397){_0x512397=_0x512397||0xcc;return function(_0x1e0c95){if(_0x1e0c95){return _0x179a6f[_0x924c('0x12')](_0x512397);}return _0x179a6f[_0x924c('0x13')](_0x512397)[_0x924c('0x14')]();};}function respondWithResult(_0x1523ba,_0x4a45f9){_0x4a45f9=_0x4a45f9||0xc8;return function(_0x5674cb){if(_0x5674cb){return _0x1523ba[_0x924c('0x13')](_0x4a45f9)[_0x924c('0x15')](_0x5674cb);}};}function respondWithFilteredResult(_0x3a8e10,_0x4a9672){return function(_0x549d39){if(_0x549d39){var _0x11b248=_0x549d39['count'],_0x230eb6=_0x4a9672[_0x924c('0x16')],_0x16a724=_0x4a9672[_0x924c('0x16')]+_0x4a9672[_0x924c('0x17')],_0x4a701d;if(_0x16a724>=_0x11b248){_0x16a724=_0x11b248;_0x4a701d=0xc8;}else{_0x4a701d=0xce;}_0x3a8e10['status'](_0x4a701d);return _0x3a8e10[_0x924c('0x18')](_0x924c('0x19'),_0x230eb6+'-'+_0x16a724+'/'+_0x11b248)['json'](_0x549d39);}return null;};}function patchUpdates(_0x449d6c){return function(_0x1d88bf){try{jsonpatch['apply'](_0x1d88bf,_0x449d6c,!![]);}catch(_0x27a572){return BPromise[_0x924c('0x1a')](_0x27a572);}return _0x1d88bf['save']();};}function saveUpdates(_0x51bc21,_0x4e5f35){return function(_0x413573){if(_0x413573){return _0x413573[_0x924c('0x1b')](_0x51bc21)[_0x924c('0x1c')](function(_0x389eb8){return _0x389eb8;});}return null;};}function removeEntity(_0x5b7190,_0x725a4){return function(_0x91b63c){if(_0x91b63c){return _0x91b63c[_0x924c('0x1d')]()[_0x924c('0x1c')](function(){_0x5b7190[_0x924c('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b333b,_0xe81693){return function(_0xe83038){if(!_0xe83038){_0x1b333b['sendStatus'](0x194);}return _0xe83038;};}function handleError(_0x39a11c,_0x36ab76){_0x36ab76=_0x36ab76||0x1f4;return function(_0x51d502){logger[_0x924c('0x1e')](_0x51d502[_0x924c('0x1f')]);if(_0x51d502[_0x924c('0x20')]){delete _0x51d502[_0x924c('0x20')];}_0x39a11c[_0x924c('0x13')](_0x36ab76)['send'](_0x51d502);};}exports['index']=function(_0x7cfebe,_0x215095){var _0x1df7c0={},_0x3dff6e={},_0x81118d={'count':0x0,'rows':[]};var _0x5d4a8e=_[_0x924c('0x21')](db[_0x924c('0x22')][_0x924c('0x23')],function(_0x451767){return{'name':_0x451767[_0x924c('0x24')],'type':_0x451767[_0x924c('0x25')][_0x924c('0x26')]};});_0x3dff6e[_0x924c('0x27')]=_[_0x924c('0x21')](_0x5d4a8e,'name');_0x3dff6e[_0x924c('0x28')]=_['keys'](_0x7cfebe[_0x924c('0x28')]);_0x3dff6e[_0x924c('0x29')]=_[_0x924c('0x2a')](_0x3dff6e[_0x924c('0x27')],_0x3dff6e['query']);_0x1df7c0[_0x924c('0x2b')]=_[_0x924c('0x2a')](_0x3dff6e['model'],qs['fields'](_0x7cfebe[_0x924c('0x28')][_0x924c('0x2c')]));_0x1df7c0[_0x924c('0x2b')]=_0x1df7c0[_0x924c('0x2b')][_0x924c('0x2d')]?_0x1df7c0[_0x924c('0x2b')]:_0x3dff6e[_0x924c('0x27')];if(!_0x7cfebe[_0x924c('0x28')][_0x924c('0x2e')]('nolimit')){_0x1df7c0[_0x924c('0x17')]=qs[_0x924c('0x17')](_0x7cfebe[_0x924c('0x28')][_0x924c('0x17')]);_0x1df7c0[_0x924c('0x16')]=qs[_0x924c('0x16')](_0x7cfebe[_0x924c('0x28')][_0x924c('0x16')]);}_0x1df7c0['order']=qs[_0x924c('0x2f')](_0x7cfebe['query'][_0x924c('0x2f')]);_0x1df7c0[_0x924c('0x30')]=qs[_0x924c('0x29')](_[_0x924c('0x31')](_0x7cfebe[_0x924c('0x28')],_0x3dff6e['filters']));if(_0x7cfebe['query'][_0x924c('0x32')]){_0x1df7c0[_0x924c('0x30')]=_[_0x924c('0x33')](_0x1df7c0['where'],{'$or':_[_0x924c('0x21')](_0x5d4a8e,function(_0x3e9b27){if(_0x3e9b27['type']!==_0x924c('0x34')){var _0x22acb4={};_0x22acb4[_0x3e9b27[_0x924c('0x20')]]={'$like':'%'+_0x7cfebe[_0x924c('0x28')][_0x924c('0x32')]+'%'};return _0x22acb4;}})});}_0x1df7c0=_[_0x924c('0x33')]({},_0x1df7c0,_0x7cfebe[_0x924c('0x35')]);var _0xdeb87e={'where':_0x1df7c0[_0x924c('0x30')]};return db[_0x924c('0x22')][_0x924c('0x36')](_0xdeb87e)[_0x924c('0x1c')](function(_0xfd0289){_0x81118d[_0x924c('0x36')]=_0xfd0289;if(_0x7cfebe[_0x924c('0x28')]['includeAll']){_0x1df7c0[_0x924c('0x37')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x1df7c0);})[_0x924c('0x1c')](function(_0x3560c3){_0x81118d[_0x924c('0x38')]=_0x3560c3;return _0x81118d;})[_0x924c('0x1c')](respondWithFilteredResult(_0x215095,_0x1df7c0))[_0x924c('0x39')](handleError(_0x215095,null));};exports['show']=function(_0x12b7a5,_0x2e6bf6){var _0x4c84fd={'raw':!![],'where':{'id':_0x12b7a5['params']['id']}},_0x356897={};_0x356897['model']=_[_0x924c('0x3a')](db[_0x924c('0x22')][_0x924c('0x23')]);_0x356897[_0x924c('0x28')]=_['keys'](_0x12b7a5[_0x924c('0x28')]);_0x356897[_0x924c('0x29')]=_[_0x924c('0x2a')](_0x356897[_0x924c('0x27')],_0x356897[_0x924c('0x28')]);_0x4c84fd[_0x924c('0x2b')]=_[_0x924c('0x2a')](_0x356897[_0x924c('0x27')],qs[_0x924c('0x2c')](_0x12b7a5[_0x924c('0x28')][_0x924c('0x2c')]));_0x4c84fd[_0x924c('0x2b')]=_0x4c84fd[_0x924c('0x2b')]['length']?_0x4c84fd['attributes']:_0x356897[_0x924c('0x27')];if(_0x12b7a5['query'][_0x924c('0x3b')]){_0x4c84fd['include']=[{'all':!![]}];}_0x4c84fd=_[_0x924c('0x33')]({},_0x4c84fd,_0x12b7a5['options']);return db[_0x924c('0x22')][_0x924c('0x3c')](_0x4c84fd)[_0x924c('0x1c')](handleEntityNotFound(_0x2e6bf6,null))['then'](respondWithResult(_0x2e6bf6,null))[_0x924c('0x39')](handleError(_0x2e6bf6,null));};exports[_0x924c('0x3d')]=function(_0x25c3a7,_0x435356){return db['VoiceDialReport'][_0x924c('0x3d')](_0x25c3a7[_0x924c('0x3e')],{})[_0x924c('0x1c')](respondWithResult(_0x435356,0xc9))[_0x924c('0x39')](handleError(_0x435356,null));};exports[_0x924c('0x1b')]=function(_0x24af64,_0x3edcab){if(_0x24af64[_0x924c('0x3e')]['id']){delete _0x24af64[_0x924c('0x3e')]['id'];}return db[_0x924c('0x22')]['find']({'where':{'id':_0x24af64[_0x924c('0x3f')]['id']}})[_0x924c('0x1c')](handleEntityNotFound(_0x3edcab,null))[_0x924c('0x1c')](saveUpdates(_0x24af64['body'],null))[_0x924c('0x1c')](respondWithResult(_0x3edcab,null))[_0x924c('0x39')](handleError(_0x3edcab,null));};exports[_0x924c('0x1d')]=function(_0x2ef838,_0x38001f){return db[_0x924c('0x22')][_0x924c('0x3c')]({'where':{'id':_0x2ef838[_0x924c('0x3f')]['id']}})[_0x924c('0x1c')](handleEntityNotFound(_0x38001f,null))[_0x924c('0x1c')](removeEntity(_0x38001f,null))[_0x924c('0x39')](handleError(_0x38001f,null));};exports[_0x924c('0x40')]=function(_0x54d8eb,_0x4a71dd){return db[_0x924c('0x22')][_0x924c('0x40')]()['then'](respondWithResult(_0x4a71dd,null))['catch'](handleError(_0x4a71dd,null));}; \ No newline at end of file +var _0x8a50=['includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','rows','catch','params','keys','rawAttributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8a50,0xdb));var _0x08a5=function(_0xc49d26,_0x24a966){_0xc49d26=_0xc49d26-0x0;var _0x400ac7=_0x8a50[_0xc49d26];return _0x400ac7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x08a5('0x0'));var rimraf=require(_0x08a5('0x1'));var zipdir=require(_0x08a5('0x2'));var jsonpatch=require(_0x08a5('0x3'));var rp=require('request-promise');var moment=require(_0x08a5('0x4'));var BPromise=require(_0x08a5('0x5'));var Mustache=require(_0x08a5('0x6'));var util=require(_0x08a5('0x7'));var path=require(_0x08a5('0x8'));var sox=require(_0x08a5('0x9'));var csv=require(_0x08a5('0xa'));var ejs=require(_0x08a5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x08a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x08a5('0xd'));var toCsv=require(_0x08a5('0xa'));var querystring=require(_0x08a5('0xe'));var Papa=require(_0x08a5('0xf'));var Redis=require(_0x08a5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08a5('0x11'));var logger=require(_0x08a5('0x12'))('api');var utils=require(_0x08a5('0x13'));var config=require(_0x08a5('0x14'));var db=require(_0x08a5('0x15'))['db'];function respondWithStatusCode(_0x297ee3,_0x3a0abc){_0x3a0abc=_0x3a0abc||0xcc;return function(_0x137050){if(_0x137050){return _0x297ee3[_0x08a5('0x16')](_0x3a0abc);}return _0x297ee3['status'](_0x3a0abc)[_0x08a5('0x17')]();};}function respondWithResult(_0x52b0c5,_0x26df6b){_0x26df6b=_0x26df6b||0xc8;return function(_0x109ff2){if(_0x109ff2){return _0x52b0c5[_0x08a5('0x18')](_0x26df6b)[_0x08a5('0x19')](_0x109ff2);}};}function respondWithFilteredResult(_0x2ca672,_0x3fe4fb){return function(_0x539580){if(_0x539580){var _0x39b329=_0x539580[_0x08a5('0x1a')],_0x3c439e=_0x3fe4fb[_0x08a5('0x1b')],_0x39b7a6=_0x3fe4fb['offset']+_0x3fe4fb[_0x08a5('0x1c')],_0x16930b;if(_0x39b7a6>=_0x39b329){_0x39b7a6=_0x39b329;_0x16930b=0xc8;}else{_0x16930b=0xce;}_0x2ca672[_0x08a5('0x18')](_0x16930b);return _0x2ca672['set'](_0x08a5('0x1d'),_0x3c439e+'-'+_0x39b7a6+'/'+_0x39b329)[_0x08a5('0x19')](_0x539580);}return null;};}function patchUpdates(_0x10b4f4){return function(_0x29b1ff){try{jsonpatch[_0x08a5('0x1e')](_0x29b1ff,_0x10b4f4,!![]);}catch(_0x122610){return BPromise[_0x08a5('0x1f')](_0x122610);}return _0x29b1ff[_0x08a5('0x20')]();};}function saveUpdates(_0x2ea8,_0x4612d0){return function(_0x52c24b){if(_0x52c24b){return _0x52c24b[_0x08a5('0x21')](_0x2ea8)[_0x08a5('0x22')](function(_0x1c0477){return _0x1c0477;});}return null;};}function removeEntity(_0xb299fe,_0x2ceca1){return function(_0x49c8fe){if(_0x49c8fe){return _0x49c8fe[_0x08a5('0x23')]()[_0x08a5('0x22')](function(){_0xb299fe[_0x08a5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cb22b,_0x38bb7b){return function(_0x5a7448){if(!_0x5a7448){_0x5cb22b[_0x08a5('0x16')](0x194);}return _0x5a7448;};}function handleError(_0x535525,_0x1a7da7){_0x1a7da7=_0x1a7da7||0x1f4;return function(_0x2c3276){logger[_0x08a5('0x24')](_0x2c3276['stack']);if(_0x2c3276[_0x08a5('0x25')]){delete _0x2c3276['name'];}_0x535525[_0x08a5('0x18')](_0x1a7da7)[_0x08a5('0x26')](_0x2c3276);};}exports[_0x08a5('0x27')]=function(_0x59806a,_0x15a7ba){var _0x29b503={},_0x17cacf={},_0x1bbf2c={'count':0x0,'rows':[]};var _0x1daec4=_[_0x08a5('0x28')](db[_0x08a5('0x29')]['rawAttributes'],function(_0x58de67){return{'name':_0x58de67[_0x08a5('0x2a')],'type':_0x58de67[_0x08a5('0x2b')][_0x08a5('0x2c')]};});_0x17cacf['model']=_['map'](_0x1daec4,_0x08a5('0x25'));_0x17cacf[_0x08a5('0x2d')]=_['keys'](_0x59806a[_0x08a5('0x2d')]);_0x17cacf[_0x08a5('0x2e')]=_[_0x08a5('0x2f')](_0x17cacf['model'],_0x17cacf[_0x08a5('0x2d')]);_0x29b503[_0x08a5('0x30')]=_['intersection'](_0x17cacf[_0x08a5('0x31')],qs['fields'](_0x59806a[_0x08a5('0x2d')][_0x08a5('0x32')]));_0x29b503[_0x08a5('0x30')]=_0x29b503[_0x08a5('0x30')][_0x08a5('0x33')]?_0x29b503['attributes']:_0x17cacf[_0x08a5('0x31')];if(!_0x59806a[_0x08a5('0x2d')][_0x08a5('0x34')](_0x08a5('0x35'))){_0x29b503['limit']=qs[_0x08a5('0x1c')](_0x59806a[_0x08a5('0x2d')][_0x08a5('0x1c')]);_0x29b503['offset']=qs[_0x08a5('0x1b')](_0x59806a[_0x08a5('0x2d')][_0x08a5('0x1b')]);}_0x29b503[_0x08a5('0x36')]=qs[_0x08a5('0x37')](_0x59806a[_0x08a5('0x2d')]['sort']);_0x29b503['where']=qs[_0x08a5('0x2e')](_[_0x08a5('0x38')](_0x59806a[_0x08a5('0x2d')],_0x17cacf['filters']));if(_0x59806a[_0x08a5('0x2d')][_0x08a5('0x39')]){_0x29b503[_0x08a5('0x3a')]=_[_0x08a5('0x3b')](_0x29b503[_0x08a5('0x3a')],{'$or':_[_0x08a5('0x28')](_0x1daec4,function(_0x185d1d){if(_0x185d1d[_0x08a5('0x2b')]!=='VIRTUAL'){var _0x1f4c7c={};_0x1f4c7c[_0x185d1d[_0x08a5('0x25')]]={'$like':'%'+_0x59806a['query'][_0x08a5('0x39')]+'%'};return _0x1f4c7c;}})});}_0x29b503=_[_0x08a5('0x3b')]({},_0x29b503,_0x59806a['options']);var _0x610384={'where':_0x29b503[_0x08a5('0x3a')]};return db[_0x08a5('0x29')][_0x08a5('0x1a')](_0x610384)['then'](function(_0x5bee24){_0x1bbf2c[_0x08a5('0x1a')]=_0x5bee24;if(_0x59806a[_0x08a5('0x2d')]['includeAll']){_0x29b503['include']=[{'all':!![]}];}return db[_0x08a5('0x29')]['findAll'](_0x29b503);})[_0x08a5('0x22')](function(_0x57a12c){_0x1bbf2c[_0x08a5('0x3c')]=_0x57a12c;return _0x1bbf2c;})[_0x08a5('0x22')](respondWithFilteredResult(_0x15a7ba,_0x29b503))[_0x08a5('0x3d')](handleError(_0x15a7ba,null));};exports['show']=function(_0x5949f3,_0x5dcbf7){var _0x37d12c={'raw':!![],'where':{'id':_0x5949f3[_0x08a5('0x3e')]['id']}},_0x5cf635={};_0x5cf635[_0x08a5('0x31')]=_[_0x08a5('0x3f')](db['VoiceDialReport'][_0x08a5('0x40')]);_0x5cf635[_0x08a5('0x2d')]=_[_0x08a5('0x3f')](_0x5949f3[_0x08a5('0x2d')]);_0x5cf635[_0x08a5('0x2e')]=_[_0x08a5('0x2f')](_0x5cf635[_0x08a5('0x31')],_0x5cf635[_0x08a5('0x2d')]);_0x37d12c[_0x08a5('0x30')]=_[_0x08a5('0x2f')](_0x5cf635['model'],qs[_0x08a5('0x32')](_0x5949f3[_0x08a5('0x2d')][_0x08a5('0x32')]));_0x37d12c[_0x08a5('0x30')]=_0x37d12c[_0x08a5('0x30')][_0x08a5('0x33')]?_0x37d12c[_0x08a5('0x30')]:_0x5cf635[_0x08a5('0x31')];if(_0x5949f3[_0x08a5('0x2d')][_0x08a5('0x41')]){_0x37d12c['include']=[{'all':!![]}];}_0x37d12c=_[_0x08a5('0x3b')]({},_0x37d12c,_0x5949f3[_0x08a5('0x42')]);return db[_0x08a5('0x29')][_0x08a5('0x43')](_0x37d12c)[_0x08a5('0x22')](handleEntityNotFound(_0x5dcbf7,null))[_0x08a5('0x22')](respondWithResult(_0x5dcbf7,null))[_0x08a5('0x3d')](handleError(_0x5dcbf7,null));};exports['create']=function(_0x34b740,_0x507729){return db[_0x08a5('0x29')][_0x08a5('0x44')](_0x34b740[_0x08a5('0x45')],{})[_0x08a5('0x22')](respondWithResult(_0x507729,0xc9))[_0x08a5('0x3d')](handleError(_0x507729,null));};exports[_0x08a5('0x21')]=function(_0x48e30a,_0x9df6d5){if(_0x48e30a[_0x08a5('0x45')]['id']){delete _0x48e30a[_0x08a5('0x45')]['id'];}return db[_0x08a5('0x29')][_0x08a5('0x43')]({'where':{'id':_0x48e30a[_0x08a5('0x3e')]['id']}})[_0x08a5('0x22')](handleEntityNotFound(_0x9df6d5,null))[_0x08a5('0x22')](saveUpdates(_0x48e30a[_0x08a5('0x45')],null))['then'](respondWithResult(_0x9df6d5,null))['catch'](handleError(_0x9df6d5,null));};exports[_0x08a5('0x23')]=function(_0x1f1b4e,_0x4d394d){return db[_0x08a5('0x29')]['find']({'where':{'id':_0x1f1b4e[_0x08a5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4d394d,null))[_0x08a5('0x22')](removeEntity(_0x4d394d,null))[_0x08a5('0x3d')](handleError(_0x4d394d,null));};exports[_0x08a5('0x46')]=function(_0xd47d4a,_0x485d7e){return db[_0x08a5('0x29')][_0x08a5('0x46')]()[_0x08a5('0x22')](respondWithResult(_0x485d7e,null))[_0x08a5('0x3d')](handleError(_0x485d7e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index cdd3c84..0a40aaf 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 _0x7f78=['rimraf','../../config/environment','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x7f78,0x158));var _0x87f7=function(_0x221c7e,_0x108b1d){_0x221c7e=_0x221c7e-0x0;var _0x5b68e6=_0x7f78[_0x221c7e];return _0x5b68e6;};'use strict';var _=require(_0x87f7('0x0'));var util=require(_0x87f7('0x1'));var logger=require(_0x87f7('0x2'))(_0x87f7('0x3'));var moment=require(_0x87f7('0x4'));var BPromise=require('bluebird');var rp=require(_0x87f7('0x5'));var fs=require('fs');var path=require(_0x87f7('0x6'));var rimraf=require(_0x87f7('0x7'));var config=require(_0x87f7('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x438692,_0x42c2f8){return _0x438692[_0x87f7('0x9')](_0x87f7('0xa'),attributes,{'tableName':_0x87f7('0xb'),'paranoid':![],'indexes':[{'fields':[_0x87f7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7d8=['VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1a16ee,_0x42143e){var _0x405ab7=function(_0x11c25c){while(--_0x11c25c){_0x1a16ee['push'](_0x1a16ee['shift']());}};_0x405ab7(++_0x42143e);}(_0xd7d8,0x81));var _0x8d7d=function(_0x5be3e8,_0x2c5c15){_0x5be3e8=_0x5be3e8-0x0;var _0x55f67d=_0xd7d8[_0x5be3e8];return _0x55f67d;};'use strict';var _=require(_0x8d7d('0x0'));var util=require(_0x8d7d('0x1'));var logger=require(_0x8d7d('0x2'))(_0x8d7d('0x3'));var moment=require(_0x8d7d('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d7d('0x5'));var fs=require('fs');var path=require(_0x8d7d('0x6'));var rimraf=require(_0x8d7d('0x7'));var config=require(_0x8d7d('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x8d7d('0x9')]=function(_0x46f4c4,_0x343527){return _0x46f4c4[_0x8d7d('0xa')](_0x8d7d('0xb'),attributes,{'tableName':_0x8d7d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8d7d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index bd7f3d4..427258c 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 _0xb32d=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','VoiceDialReport','update','body','where','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x19de38,_0x1d0377){var _0x45cf72=function(_0x5e6edb){while(--_0x5e6edb){_0x19de38['push'](_0x19de38['shift']());}};_0x45cf72(++_0x1d0377);}(_0xb32d,0x1da));var _0xdb32=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0xb32d[_0x1cc961];return _0x471d86;};'use strict';var _=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var moment=require(_0xdb32('0x2'));var BPromise=require(_0xdb32('0x3'));var rs=require(_0xdb32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb32('0x5'));var logger=require(_0xdb32('0x6'))('rpc');var config=require(_0xdb32('0x7'));var jayson=require(_0xdb32('0x8'));var client=jayson[_0xdb32('0x9')][_0xdb32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f4af0,_0x386309,_0x5bb076){return new BPromise(function(_0x3b0995,_0x2686db){return client[_0xdb32('0xb')](_0x6f4af0,_0x5bb076)[_0xdb32('0xc')](function(_0x30e03d){logger[_0xdb32('0xd')](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));logger[_0xdb32('0x10')](_0xdb32('0x11'),_0x386309,_0xdb32('0xf'),JSON[_0xdb32('0x12')](_0x30e03d));if(_0x30e03d[_0xdb32('0x13')]){if(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x14')]===0x1f4){logger[_0xdb32('0x13')](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x2686db(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}logger['error'](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x3b0995(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}else{logger['info'](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));_0x3b0995(_0x30e03d[_0xdb32('0x16')]['message']);}})['catch'](function(_0x59a5f8){logger['error'](_0xdb32('0xe'),_0x386309,_0x59a5f8);_0x2686db(_0x59a5f8);});});}exports['CreateVoiceDialReport']=function(_0x1fd22b){var _0xfab49a=this;return new Promise(function(_0x1ba5f4,_0x301cc3){return db['VoiceDialReport']['create'](_0x1fd22b['body'],{'raw':_0x1fd22b[_0xdb32('0x17')]?_0x1fd22b['options'][_0xdb32('0x18')]===undefined?!![]:![]:!![]})[_0xdb32('0xc')](function(_0x8a5f88){logger[_0xdb32('0xd')](_0xdb32('0x19'),_0x1fd22b);logger['debug'](_0xdb32('0x19'),_0x1fd22b,JSON[_0xdb32('0x12')](_0x8a5f88));_0x1ba5f4(_0x8a5f88);})[_0xdb32('0x1a')](function(_0x5a5a84){logger['error'](_0xdb32('0x19'),_0x5a5a84['message'],_0x1fd22b);_0x301cc3(_0xfab49a['error'](0x1f4,_0x5a5a84[_0xdb32('0x15')]));});});};exports[_0xdb32('0x1b')]=function(_0x307aaf){var _0x4406b9=this;return new Promise(function(_0x537fec,_0x498c20){return db[_0xdb32('0x1c')][_0xdb32('0x1d')](_0x307aaf[_0xdb32('0x1e')],{'raw':_0x307aaf['options']?_0x307aaf[_0xdb32('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x307aaf[_0xdb32('0x17')]?_0x307aaf[_0xdb32('0x17')][_0xdb32('0x1f')]||null:null,'attributes':_0x307aaf[_0xdb32('0x17')]?_0x307aaf[_0xdb32('0x17')]['attributes']||null:null,'limit':_0x307aaf['options']?_0x307aaf[_0xdb32('0x17')]['limit']||null:null})[_0xdb32('0xc')](function(_0x38d7a0){logger[_0xdb32('0xd')]('UpdateVoiceDialReport',_0x307aaf);logger['debug'](_0xdb32('0x1b'),_0x307aaf,JSON[_0xdb32('0x12')](_0x38d7a0));_0x537fec(_0x38d7a0);})[_0xdb32('0x1a')](function(_0x566b8b){logger[_0xdb32('0x13')](_0xdb32('0x1b'),_0x566b8b[_0xdb32('0x15')],_0x307aaf);_0x498c20(_0x4406b9[_0xdb32('0x13')](0x1f4,_0x566b8b[_0xdb32('0x15')]));});});}; \ No newline at end of file +var _0x98e1=['client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','VoiceDialReport','create','body','options','CreateVoiceDialReport','stringify','catch','UpdateVoiceDialReport','update','raw','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x3a7f42,_0x49737a){var _0x2e9379=function(_0x591327){while(--_0x591327){_0x3a7f42['push'](_0x3a7f42['shift']());}};_0x2e9379(++_0x49737a);}(_0x98e1,0x160));var _0x198e=function(_0x58347a,_0xfde6c0){_0x58347a=_0x58347a-0x0;var _0x130460=_0x98e1[_0x58347a];return _0x130460;};'use strict';var _=require('lodash');var util=require(_0x198e('0x0'));var moment=require(_0x198e('0x1'));var BPromise=require(_0x198e('0x2'));var rs=require(_0x198e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x198e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x198e('0x5'));var config=require(_0x198e('0x6'));var jayson=require(_0x198e('0x7'));var client=jayson[_0x198e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545114,_0x46ac1b,_0x4d45d6){return new BPromise(function(_0x3322c5,_0x5ba06f){return client[_0x198e('0x9')](_0x545114,_0x4d45d6)[_0x198e('0xa')](function(_0x1ea2bf){logger[_0x198e('0xb')](_0x198e('0xc'),_0x46ac1b,_0x198e('0xd'));logger[_0x198e('0xe')](_0x198e('0xf'),_0x46ac1b,_0x198e('0xd'),JSON['stringify'](_0x1ea2bf));if(_0x1ea2bf[_0x198e('0x10')]){if(_0x1ea2bf[_0x198e('0x10')]['code']===0x1f4){logger[_0x198e('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x46ac1b,_0x1ea2bf[_0x198e('0x10')]['message']);return _0x5ba06f(_0x1ea2bf['error']['message']);}logger['error'](_0x198e('0xc'),_0x46ac1b,_0x1ea2bf[_0x198e('0x10')][_0x198e('0x11')]);return _0x3322c5(_0x1ea2bf['error'][_0x198e('0x11')]);}else{logger[_0x198e('0xb')](_0x198e('0xc'),_0x46ac1b,'request\x20sent');_0x3322c5(_0x1ea2bf['result']['message']);}})['catch'](function(_0x57f15e){logger[_0x198e('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x46ac1b,_0x57f15e);_0x5ba06f(_0x57f15e);});});}exports['CreateVoiceDialReport']=function(_0x440975){var _0x46c980=this;return new Promise(function(_0x2485ea,_0x4cbf50){return db[_0x198e('0x12')][_0x198e('0x13')](_0x440975[_0x198e('0x14')],{'raw':_0x440975[_0x198e('0x15')]?_0x440975[_0x198e('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x198e('0xa')](function(_0x1b7c84){logger['info'](_0x198e('0x16'),_0x440975);logger[_0x198e('0xe')](_0x198e('0x16'),_0x440975,JSON[_0x198e('0x17')](_0x1b7c84));_0x2485ea(_0x1b7c84);})[_0x198e('0x18')](function(_0x41e27f){logger['error'](_0x198e('0x16'),_0x41e27f[_0x198e('0x11')],_0x440975);_0x4cbf50(_0x46c980[_0x198e('0x10')](0x1f4,_0x41e27f[_0x198e('0x11')]));});});};exports[_0x198e('0x19')]=function(_0x2ab945){var _0xe6c8f3=this;return new Promise(function(_0x5dde96,_0x309326){return db[_0x198e('0x12')][_0x198e('0x1a')](_0x2ab945[_0x198e('0x14')],{'raw':_0x2ab945[_0x198e('0x15')]?_0x2ab945[_0x198e('0x15')][_0x198e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab945[_0x198e('0x15')]?_0x2ab945[_0x198e('0x15')]['where']||null:null,'attributes':_0x2ab945['options']?_0x2ab945[_0x198e('0x15')][_0x198e('0x1c')]||null:null,'limit':_0x2ab945['options']?_0x2ab945['options'][_0x198e('0x1d')]||null:null})[_0x198e('0xa')](function(_0x337c73){logger['info'](_0x198e('0x19'),_0x2ab945);logger[_0x198e('0xe')](_0x198e('0x19'),_0x2ab945,JSON[_0x198e('0x17')](_0x337c73));_0x5dde96(_0x337c73);})[_0x198e('0x18')](function(_0x19a288){logger[_0x198e('0x10')](_0x198e('0x19'),_0x19a288[_0x198e('0x11')],_0x2ab945);_0x309326(_0xe6c8f3['error'](0x1f4,_0x19a288[_0x198e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 62c7f5f..548df6b 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 _0xa6b8=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','addApplications','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0xf0391,_0x4eb9ee){var _0x45dc55=function(_0x1d9bb1){while(--_0x1d9bb1){_0xf0391['push'](_0xf0391['shift']());}};_0x45dc55(++_0x4eb9ee);}(_0xa6b8,0x1bd));var _0x8a6b=function(_0x4fcb0f,_0x5e8627){_0x4fcb0f=_0x4fcb0f-0x0;var _0xf9107d=_0xa6b8[_0x4fcb0f];return _0xf9107d;};'use strict';var multer=require('multer');var util=require(_0x8a6b('0x0'));var path=require(_0x8a6b('0x1'));var timeout=require(_0x8a6b('0x2'));var express=require(_0x8a6b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8a6b('0x4'));var config=require(_0x8a6b('0x5'));var controller=require(_0x8a6b('0x6'));router[_0x8a6b('0x7')]('/',auth[_0x8a6b('0x8')](),controller[_0x8a6b('0x9')]);router[_0x8a6b('0x7')](_0x8a6b('0xa'),auth[_0x8a6b('0x8')](),controller['show']);router[_0x8a6b('0xb')]('/',auth[_0x8a6b('0x8')](),controller['create']);router[_0x8a6b('0xb')]('/:id/applications',auth[_0x8a6b('0x8')](),controller[_0x8a6b('0xc')]);router[_0x8a6b('0xd')](_0x8a6b('0xa'),auth['isAuthenticated'](),controller[_0x8a6b('0xe')]);router[_0x8a6b('0xf')](_0x8a6b('0xa'),auth[_0x8a6b('0x8')](),controller[_0x8a6b('0x10')]);module[_0x8a6b('0x11')]=router; \ No newline at end of file +var _0x8270=['show','post','create','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','/:id'];(function(_0x53bf11,_0x3acb5e){var _0x3a4f47=function(_0x5d215e){while(--_0x5d215e){_0x53bf11['push'](_0x53bf11['shift']());}};_0x3a4f47(++_0x3acb5e);}(_0x8270,0x185));var _0x0827=function(_0x582bd7,_0xc3c370){_0x582bd7=_0x582bd7-0x0;var _0x188b98=_0x8270[_0x582bd7];return _0x188b98;};'use strict';var multer=require(_0x0827('0x0'));var util=require(_0x0827('0x1'));var path=require(_0x0827('0x2'));var timeout=require(_0x0827('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0827('0x4'));var interaction=require(_0x0827('0x5'));var config=require(_0x0827('0x6'));var controller=require(_0x0827('0x7'));router['get']('/',auth[_0x0827('0x8')](),controller[_0x0827('0x9')]);router['get'](_0x0827('0xa'),auth[_0x0827('0x8')](),controller[_0x0827('0xb')]);router[_0x0827('0xc')]('/',auth[_0x0827('0x8')](),controller[_0x0827('0xd')]);router['post'](_0x0827('0xe'),auth[_0x0827('0x8')](),controller[_0x0827('0xf')]);router[_0x0827('0x10')](_0x0827('0xa'),auth[_0x0827('0x8')](),controller[_0x0827('0x11')]);router[_0x0827('0x12')](_0x0827('0xa'),auth[_0x0827('0x8')](),controller[_0x0827('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ce2c449..cd7fa2a 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x2f4db3,_0x6b109d){var _0x39ce3e=function(_0x4715d3){while(--_0x4715d3){_0x2f4db3['push'](_0x2f4db3['shift']());}};_0x39ce3e(++_0x6b109d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x5164f7,_0x41eae0){var _0x535275=function(_0x2192e6){while(--_0x2192e6){_0x5164f7['push'](_0x5164f7['shift']());}};_0x535275(++_0x41eae0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index c0e44a2..0438246 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 _0xbdf3=['map','value','includes','find','type','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceExtension','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','length','include','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','set','apply','reject','save','update','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore'];(function(_0x396677,_0x49d8ae){var _0x7faeb8=function(_0x5e7371){while(--_0x5e7371){_0x396677['push'](_0x396677['shift']());}};_0x7faeb8(++_0x49d8ae);}(_0xbdf3,0x17d));var _0x3bdf=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0xbdf3[_0x1d9163];return _0xb42197;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3bdf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bdf('0x1'));var jsonpatch=require(_0x3bdf('0x2'));var rp=require(_0x3bdf('0x3'));var moment=require('moment');var BPromise=require(_0x3bdf('0x4'));var Mustache=require(_0x3bdf('0x5'));var util=require(_0x3bdf('0x6'));var path=require(_0x3bdf('0x7'));var sox=require('sox');var csv=require(_0x3bdf('0x8'));var ejs=require(_0x3bdf('0x9'));var fs=require('fs');var _=require(_0x3bdf('0xa'));var squel=require(_0x3bdf('0xb'));var crypto=require('crypto');var jsforce=require(_0x3bdf('0xc'));var deskjs=require(_0x3bdf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3bdf('0xe'));var Papa=require(_0x3bdf('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3bdf('0x10'));var as=require(_0x3bdf('0x11'));var hardwareService=require(_0x3bdf('0x12'));var logger=require(_0x3bdf('0x13'))('api');var utils=require(_0x3bdf('0x14'));var config=require(_0x3bdf('0x15'));var db=require('../../mysqldb')['db'];config[_0x3bdf('0x16')]=_[_0x3bdf('0x17')](config['redis'],{'host':_0x3bdf('0x18'),'port':0x18eb});var socket=require(_0x3bdf('0x19'))(new Redis(config[_0x3bdf('0x16')]));require(_0x3bdf('0x1a'))[_0x3bdf('0x1b')](socket);function respondWithStatusCode(_0x5260ef,_0x11fcd5){_0x11fcd5=_0x11fcd5||0xcc;return function(_0x1974ba){if(_0x1974ba){return _0x5260ef['sendStatus'](_0x11fcd5);}return _0x5260ef[_0x3bdf('0x1c')](_0x11fcd5)[_0x3bdf('0x1d')]();};}function respondWithResult(_0x19b57a,_0x5380d5){_0x5380d5=_0x5380d5||0xc8;return function(_0x57f622){if(_0x57f622){return _0x19b57a[_0x3bdf('0x1c')](_0x5380d5)[_0x3bdf('0x1e')](_0x57f622);}};}function respondWithFilteredResult(_0x5368b9,_0x4e5475){return function(_0x1a5e8d){if(_0x1a5e8d){var _0x3567e6=_0x1a5e8d['count'],_0x133027=_0x4e5475[_0x3bdf('0x1f')],_0x3045d4=_0x4e5475['offset']+_0x4e5475['limit'],_0x2d85c2;if(_0x3045d4>=_0x3567e6){_0x3045d4=_0x3567e6;_0x2d85c2=0xc8;}else{_0x2d85c2=0xce;}_0x5368b9['status'](_0x2d85c2);return _0x5368b9[_0x3bdf('0x20')]('Content-Range',_0x133027+'-'+_0x3045d4+'/'+_0x3567e6)[_0x3bdf('0x1e')](_0x1a5e8d);}return null;};}function patchUpdates(_0x37e890){return function(_0x70705b){try{jsonpatch[_0x3bdf('0x21')](_0x70705b,_0x37e890,!![]);}catch(_0x2634f4){return BPromise[_0x3bdf('0x22')](_0x2634f4);}return _0x70705b[_0x3bdf('0x23')]();};}function saveUpdates(_0x13bf35,_0x21b618){return function(_0x418cce){if(_0x418cce){return _0x418cce[_0x3bdf('0x24')](_0x13bf35)[_0x3bdf('0x25')](function(_0x1005c3){return _0x1005c3;});}return null;};}function removeEntity(_0x5c5f1d,_0x1f447e){return function(_0x38f1f2){if(_0x38f1f2){return _0x38f1f2[_0x3bdf('0x26')]()['then'](function(){var _0x31d4fe=_0x38f1f2[_0x3bdf('0x27')]({'plain':!![]});var _0x5376ef=[{'name':_0x3bdf('0x28'),'value':'inbound','ignore':![]},{'name':_0x3bdf('0x29'),'value':_0x3bdf('0x2a'),'ignore':![]},{'name':_0x3bdf('0x2b'),'value':_0x3bdf('0x2c'),'ignore':![]}];var _0x43d389=_(_0x5376ef)[_0x3bdf('0x2d')](_0x3bdf('0x2e'))[_0x3bdf('0x2f')](_0x3bdf('0x30'))[_0x3bdf('0x30')]();if(_[_0x3bdf('0x31')](_0x43d389,_0x31d4fe['type'])){return;}var _0x2a1272=_[_0x3bdf('0x32')](_0x5376ef,[_0x3bdf('0x30'),_0x31d4fe[_0x3bdf('0x33')]])[_0x3bdf('0x34')];return db[_0x3bdf('0x35')][_0x3bdf('0x26')]({'where':{'type':_0x2a1272,'resourceId':_0x31d4fe['id']}})[_0x3bdf('0x25')](function(){return _0x38f1f2;});})[_0x3bdf('0x25')](function(){_0x5c5f1d['status'](0xcc)[_0x3bdf('0x1d')]();});}};}function handleEntityNotFound(_0x30cfa2,_0x540607){return function(_0x526a81){if(!_0x526a81){_0x30cfa2[_0x3bdf('0x36')](0x194);}return _0x526a81;};}function handleError(_0x3a2670,_0x45ed9f){_0x45ed9f=_0x45ed9f||0x1f4;return function(_0x1379cc){logger[_0x3bdf('0x37')](_0x1379cc[_0x3bdf('0x38')]);if(_0x1379cc[_0x3bdf('0x34')]){delete _0x1379cc[_0x3bdf('0x34')];}_0x3a2670[_0x3bdf('0x1c')](_0x45ed9f)[_0x3bdf('0x39')](_0x1379cc);};}exports[_0x3bdf('0x3a')]=function(_0x138ad9,_0x1267ce){var _0x32c483={},_0x33c966={},_0x51d88a={'count':0x0,'rows':[]};var _0x3a1728=_[_0x3bdf('0x2f')](db[_0x3bdf('0x3b')]['rawAttributes'],function(_0x50d3dc){return{'name':_0x50d3dc['fieldName'],'type':_0x50d3dc[_0x3bdf('0x33')][_0x3bdf('0x3c')]};});_0x33c966[_0x3bdf('0x3d')]=_['map'](_0x3a1728,_0x3bdf('0x34'));_0x33c966[_0x3bdf('0x3e')]=_[_0x3bdf('0x3f')](_0x138ad9[_0x3bdf('0x3e')]);_0x33c966[_0x3bdf('0x40')]=_[_0x3bdf('0x41')](_0x33c966[_0x3bdf('0x3d')],_0x33c966[_0x3bdf('0x3e')]);_0x32c483[_0x3bdf('0x42')]=_['intersection'](_0x33c966[_0x3bdf('0x3d')],qs['fields'](_0x138ad9['query'][_0x3bdf('0x43')]));_0x32c483[_0x3bdf('0x42')]=_0x32c483[_0x3bdf('0x42')]['length']?_0x32c483[_0x3bdf('0x42')]:_0x33c966['model'];if(!_0x138ad9[_0x3bdf('0x3e')][_0x3bdf('0x44')](_0x3bdf('0x45'))){_0x32c483['limit']=qs['limit'](_0x138ad9[_0x3bdf('0x3e')]['limit']);_0x32c483[_0x3bdf('0x1f')]=qs[_0x3bdf('0x1f')](_0x138ad9[_0x3bdf('0x3e')][_0x3bdf('0x1f')]);}_0x32c483[_0x3bdf('0x46')]=qs[_0x3bdf('0x47')](_0x138ad9[_0x3bdf('0x3e')][_0x3bdf('0x47')]);_0x32c483[_0x3bdf('0x48')]=qs[_0x3bdf('0x40')](_[_0x3bdf('0x49')](_0x138ad9[_0x3bdf('0x3e')],_0x33c966['filters']));if(_0x138ad9[_0x3bdf('0x3e')][_0x3bdf('0x2d')]){_0x32c483[_0x3bdf('0x48')]=_[_0x3bdf('0x4a')](_0x32c483[_0x3bdf('0x48')],{'$or':_[_0x3bdf('0x2f')](_0x3a1728,function(_0x1ef59a){if(_0x1ef59a['type']!==_0x3bdf('0x4b')){var _0x3e1f32={};_0x3e1f32[_0x1ef59a[_0x3bdf('0x34')]]={'$like':'%'+_0x138ad9[_0x3bdf('0x3e')][_0x3bdf('0x2d')]+'%'};return _0x3e1f32;}})});}_0x32c483=_['merge']({},_0x32c483,_0x138ad9[_0x3bdf('0x4c')]);var _0x26b01d={'where':_0x32c483[_0x3bdf('0x48')]};return db['VoiceExtension'][_0x3bdf('0x4d')](_0x26b01d)[_0x3bdf('0x25')](function(_0x2b95dd){_0x51d88a['count']=_0x2b95dd;if(_0x138ad9[_0x3bdf('0x3e')][_0x3bdf('0x4e')]){_0x32c483['include']=[{'all':!![]}];}return db[_0x3bdf('0x3b')][_0x3bdf('0x4f')](_0x32c483);})[_0x3bdf('0x25')](function(_0x500797){_0x51d88a[_0x3bdf('0x50')]=_0x500797;return _0x51d88a;})[_0x3bdf('0x25')](respondWithFilteredResult(_0x1267ce,_0x32c483))[_0x3bdf('0x51')](handleError(_0x1267ce,null));};exports['show']=function(_0x2758da,_0x3dd052){var _0x596ebe={'raw':![],'where':{'id':_0x2758da['params']['id']}},_0x2657d1={};_0x2657d1[_0x3bdf('0x3d')]=_[_0x3bdf('0x3f')](db[_0x3bdf('0x3b')]['rawAttributes']);_0x2657d1[_0x3bdf('0x3e')]=_[_0x3bdf('0x3f')](_0x2758da[_0x3bdf('0x3e')]);_0x2657d1[_0x3bdf('0x40')]=_[_0x3bdf('0x41')](_0x2657d1[_0x3bdf('0x3d')],_0x2657d1['query']);_0x596ebe[_0x3bdf('0x42')]=_['intersection'](_0x2657d1['model'],qs[_0x3bdf('0x43')](_0x2758da[_0x3bdf('0x3e')][_0x3bdf('0x43')]));_0x596ebe[_0x3bdf('0x42')]=_0x596ebe[_0x3bdf('0x42')][_0x3bdf('0x52')]?_0x596ebe['attributes']:_0x2657d1[_0x3bdf('0x3d')];if(_0x2758da[_0x3bdf('0x3e')][_0x3bdf('0x4e')]){_0x596ebe[_0x3bdf('0x53')]=[{'all':!![]}];}_0x596ebe=_[_0x3bdf('0x4a')]({},_0x596ebe,_0x2758da[_0x3bdf('0x4c')]);return db[_0x3bdf('0x3b')][_0x3bdf('0x32')](_0x596ebe)[_0x3bdf('0x25')](handleEntityNotFound(_0x3dd052,null))[_0x3bdf('0x25')](respondWithResult(_0x3dd052,null))['catch'](handleError(_0x3dd052,null));};exports['destroy']=function(_0x1a2644,_0xd404a2){return db['VoiceExtension']['find']({'where':{'id':_0x1a2644['params']['id']}})[_0x3bdf('0x25')](handleEntityNotFound(_0xd404a2,null))[_0x3bdf('0x25')](removeEntity(_0xd404a2,null))[_0x3bdf('0x51')](handleError(_0xd404a2,null));};exports['create']=function(_0x31759d,_0xf5d43a){if(_0x31759d[_0x3bdf('0x54')][_0x3bdf('0x33')]===_0x3bdf('0x2a')&&!_[_0x3bdf('0x55')](_0x31759d['body'][_0x3bdf('0x56')],'_')){_0x31759d[_0x3bdf('0x54')][_0x3bdf('0x56')]='_'[_0x3bdf('0x57')](_0x31759d[_0x3bdf('0x54')][_0x3bdf('0x56')]);}return db['VoiceExtension'][_0x3bdf('0x58')](_0x31759d['body'],{'raw':![]})['then'](function(_0x26fed1){var _0x2148ad=_0x31759d[_0x3bdf('0x59')][_0x3bdf('0x27')]({'plain':!![]});if(!_0x2148ad)throw new Error(_0x3bdf('0x5a'));if(_0x2148ad['role']===_0x3bdf('0x59')){var _0xa620db=_0x26fed1['get']({'plain':!![]});var _0xa0b080=[{'name':_0x3bdf('0x28'),'value':_0x3bdf('0x5b')},{'name':_0x3bdf('0x29'),'value':_0x3bdf('0x2a')},{'name':'InternalRoutes','value':_0x3bdf('0x2c')}];var _0x8d42d1=_[_0x3bdf('0x32')](_0xa0b080,[_0x3bdf('0x30'),_0xa620db['type']])[_0x3bdf('0x34')];return db[_0x3bdf('0x5c')]['find']({'where':{'name':_0x8d42d1,'userProfileId':_0x2148ad[_0x3bdf('0x5d')]},'raw':!![]})[_0x3bdf('0x25')](function(_0x6656b8){if(_0x6656b8&&_0x6656b8[_0x3bdf('0x5e')]===0x0){return db['UserProfileResource'][_0x3bdf('0x58')]({'name':_0xa620db[_0x3bdf('0x34')],'resourceId':_0xa620db['id'],'type':_0x6656b8[_0x3bdf('0x34')],'sectionId':_0x6656b8['id']},{})[_0x3bdf('0x25')](function(){return _0x26fed1;});}else{return _0x26fed1;}})['catch'](function(_0x2ec589){logger[_0x3bdf('0x37')](_0x3bdf('0x5f'),_0x2ec589);throw _0x2ec589;});}return _0x26fed1;})[_0x3bdf('0x25')](respondWithResult(_0xf5d43a,0xc9))[_0x3bdf('0x51')](handleError(_0xf5d43a,null));};exports[_0x3bdf('0x24')]=function(_0x397b75,_0x16307a){if(_0x397b75[_0x3bdf('0x54')]['id']){delete _0x397b75[_0x3bdf('0x54')]['id'];}return db[_0x3bdf('0x3b')][_0x3bdf('0x32')]({'where':{'id':_0x397b75[_0x3bdf('0x60')]['id']}})[_0x3bdf('0x25')](handleEntityNotFound(_0x16307a,null))[_0x3bdf('0x25')](function(_0x5c37cf){if(_0x5c37cf){return db['VoiceExtension'][_0x3bdf('0x24')](_[_0x3bdf('0x49')](_0x397b75[_0x3bdf('0x54')],[_0x3bdf('0x56'),'context','description','recordingFormat',_0x3bdf('0x61'),_0x3bdf('0x62')]),{'where':{'context':_0x5c37cf[_0x3bdf('0x63')],'exten':_0x5c37cf['exten']},'individualHooks':!![]})['then'](function(_0x52f2a2){return _0x52f2a2;});}return null;})[_0x3bdf('0x25')](respondWithStatusCode(_0x16307a,null))['catch'](handleError(_0x16307a,null));};exports[_0x3bdf('0x64')]=function(_0x55e6bc,_0x39e31b,_0x5a5132){return db[_0x3bdf('0x3b')][_0x3bdf('0x65')]({'where':{'id':_0x55e6bc[_0x3bdf('0x60')]['id']}})[_0x3bdf('0x25')](handleEntityNotFound(_0x39e31b,null))[_0x3bdf('0x25')](function(_0xd9b0e6){if(_0xd9b0e6){return db[_0x3bdf('0x66')][_0x3bdf('0x67')](function(_0x502199){return db[_0x3bdf('0x3b')][_0x3bdf('0x26')]({'where':{'VoiceExtensionId':_0x55e6bc[_0x3bdf('0x60')]['id']},'transaction':_0x502199})[_0x3bdf('0x25')](function(_0x2ee152){var _0x34122b=_[_0x3bdf('0x2f')](_0x55e6bc[_0x3bdf('0x54')],function(_0x25afbb){_0x25afbb[_0x3bdf('0x68')]=_0x55e6bc[_0x3bdf('0x60')]['id'];return _0x25afbb;});return db[_0x3bdf('0x3b')]['bulkCreate'](_0x34122b,{'transaction':_0x502199});});})[_0x3bdf('0x25')](function(){return db[_0x3bdf('0x3b')][_0x3bdf('0x69')]({'where':{'isApp':!![],'VoiceExtensionId':_0x55e6bc['params']['id']},'order':_0x3bdf('0x6a')});});}})['then'](respondWithResult(_0x39e31b,null))[_0x3bdf('0x51')](handleError(_0x39e31b,null));}; \ No newline at end of file +var _0xeda7=['register','sendStatus','status','end','offset','limit','set','Content-Range','apply','update','then','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','keys','params','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','cutdigits','mandatoryDisposition','addApplications','sequelize','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','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','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket'];(function(_0x19f177,_0x31f453){var _0x579289=function(_0xd99d96){while(--_0xd99d96){_0x19f177['push'](_0x19f177['shift']());}};_0x579289(++_0x31f453);}(_0xeda7,0x196));var _0x7eda=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xeda7[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require(_0x7eda('0x0'));var emlformat=require(_0x7eda('0x1'));var rimraf=require(_0x7eda('0x2'));var zipdir=require(_0x7eda('0x3'));var jsonpatch=require(_0x7eda('0x4'));var rp=require(_0x7eda('0x5'));var moment=require(_0x7eda('0x6'));var BPromise=require(_0x7eda('0x7'));var Mustache=require(_0x7eda('0x8'));var util=require(_0x7eda('0x9'));var path=require(_0x7eda('0xa'));var sox=require(_0x7eda('0xb'));var csv=require(_0x7eda('0xc'));var ejs=require(_0x7eda('0xd'));var fs=require('fs');var _=require(_0x7eda('0xe'));var squel=require(_0x7eda('0xf'));var crypto=require(_0x7eda('0x10'));var jsforce=require(_0x7eda('0x11'));var deskjs=require(_0x7eda('0x12'));var toCsv=require(_0x7eda('0xc'));var querystring=require('querystring');var Papa=require(_0x7eda('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7eda('0x14'));var as=require(_0x7eda('0x15'));var hardwareService=require(_0x7eda('0x16'));var logger=require(_0x7eda('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x7eda('0x18'));var db=require(_0x7eda('0x19'))['db'];config[_0x7eda('0x1a')]=_[_0x7eda('0x1b')](config['redis'],{'host':_0x7eda('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7eda('0x1a')]));require(_0x7eda('0x1d'))[_0x7eda('0x1e')](socket);function respondWithStatusCode(_0x145c81,_0x3de1be){_0x3de1be=_0x3de1be||0xcc;return function(_0x192ab2){if(_0x192ab2){return _0x145c81[_0x7eda('0x1f')](_0x3de1be);}return _0x145c81[_0x7eda('0x20')](_0x3de1be)[_0x7eda('0x21')]();};}function respondWithResult(_0x4a8fa2,_0x4d13db){_0x4d13db=_0x4d13db||0xc8;return function(_0x106f26){if(_0x106f26){return _0x4a8fa2['status'](_0x4d13db)['json'](_0x106f26);}};}function respondWithFilteredResult(_0x416760,_0x44c83e){return function(_0x97792c){if(_0x97792c){var _0x8a1a07=_0x97792c['count'],_0x586344=_0x44c83e[_0x7eda('0x22')],_0x4c8420=_0x44c83e['offset']+_0x44c83e[_0x7eda('0x23')],_0x494c83;if(_0x4c8420>=_0x8a1a07){_0x4c8420=_0x8a1a07;_0x494c83=0xc8;}else{_0x494c83=0xce;}_0x416760[_0x7eda('0x20')](_0x494c83);return _0x416760[_0x7eda('0x24')](_0x7eda('0x25'),_0x586344+'-'+_0x4c8420+'/'+_0x8a1a07)['json'](_0x97792c);}return null;};}function patchUpdates(_0x11158){return function(_0x661588){try{jsonpatch[_0x7eda('0x26')](_0x661588,_0x11158,!![]);}catch(_0x35be2c){return BPromise['reject'](_0x35be2c);}return _0x661588['save']();};}function saveUpdates(_0x1dddc1,_0x58c409){return function(_0x3a1ef8){if(_0x3a1ef8){return _0x3a1ef8[_0x7eda('0x27')](_0x1dddc1)[_0x7eda('0x28')](function(_0x2a62e7){return _0x2a62e7;});}return null;};}function removeEntity(_0x1519ee,_0x1c064d){return function(_0x331b5f){if(_0x331b5f){return _0x331b5f[_0x7eda('0x29')]()['then'](function(){var _0x16cda7=_0x331b5f[_0x7eda('0x2a')]({'plain':!![]});var _0x1a4950=[{'name':'InboundRoutes','value':_0x7eda('0x2b'),'ignore':![]},{'name':_0x7eda('0x2c'),'value':_0x7eda('0x2d'),'ignore':![]},{'name':_0x7eda('0x2e'),'value':_0x7eda('0x2f'),'ignore':![]}];var _0x41ca40=_(_0x1a4950)[_0x7eda('0x30')](_0x7eda('0x31'))[_0x7eda('0x32')](_0x7eda('0x33'))['value']();if(_[_0x7eda('0x34')](_0x41ca40,_0x16cda7[_0x7eda('0x35')])){return;}var _0x300e20=_[_0x7eda('0x36')](_0x1a4950,['value',_0x16cda7[_0x7eda('0x35')]])[_0x7eda('0x37')];return db['UserProfileResource'][_0x7eda('0x29')]({'where':{'type':_0x300e20,'resourceId':_0x16cda7['id']}})[_0x7eda('0x28')](function(){return _0x331b5f;});})['then'](function(){_0x1519ee[_0x7eda('0x20')](0xcc)[_0x7eda('0x21')]();});}};}function handleEntityNotFound(_0x4206d6,_0x2f31d7){return function(_0x25c956){if(!_0x25c956){_0x4206d6[_0x7eda('0x1f')](0x194);}return _0x25c956;};}function handleError(_0x17bdc1,_0x234200){_0x234200=_0x234200||0x1f4;return function(_0xac4dc7){logger[_0x7eda('0x38')](_0xac4dc7['stack']);if(_0xac4dc7[_0x7eda('0x37')]){delete _0xac4dc7['name'];}_0x17bdc1[_0x7eda('0x20')](_0x234200)[_0x7eda('0x39')](_0xac4dc7);};}exports[_0x7eda('0x3a')]=function(_0x7505b6,_0x52aaab){var _0x13e4b0={},_0x14ec42={},_0xc81856={'count':0x0,'rows':[]};var _0x5d35c4=_[_0x7eda('0x32')](db[_0x7eda('0x3b')][_0x7eda('0x3c')],function(_0x5e050f){return{'name':_0x5e050f[_0x7eda('0x3d')],'type':_0x5e050f[_0x7eda('0x35')][_0x7eda('0x3e')]};});_0x14ec42[_0x7eda('0x3f')]=_['map'](_0x5d35c4,_0x7eda('0x37'));_0x14ec42[_0x7eda('0x40')]=_['keys'](_0x7505b6[_0x7eda('0x40')]);_0x14ec42[_0x7eda('0x41')]=_[_0x7eda('0x42')](_0x14ec42[_0x7eda('0x3f')],_0x14ec42['query']);_0x13e4b0[_0x7eda('0x43')]=_[_0x7eda('0x42')](_0x14ec42['model'],qs['fields'](_0x7505b6[_0x7eda('0x40')][_0x7eda('0x44')]));_0x13e4b0['attributes']=_0x13e4b0[_0x7eda('0x43')][_0x7eda('0x45')]?_0x13e4b0[_0x7eda('0x43')]:_0x14ec42[_0x7eda('0x3f')];if(!_0x7505b6['query']['hasOwnProperty'](_0x7eda('0x46'))){_0x13e4b0[_0x7eda('0x23')]=qs[_0x7eda('0x23')](_0x7505b6[_0x7eda('0x40')]['limit']);_0x13e4b0[_0x7eda('0x22')]=qs[_0x7eda('0x22')](_0x7505b6[_0x7eda('0x40')][_0x7eda('0x22')]);}_0x13e4b0[_0x7eda('0x47')]=qs[_0x7eda('0x48')](_0x7505b6['query'][_0x7eda('0x48')]);_0x13e4b0[_0x7eda('0x49')]=qs[_0x7eda('0x41')](_['pick'](_0x7505b6[_0x7eda('0x40')],_0x14ec42[_0x7eda('0x41')]));if(_0x7505b6[_0x7eda('0x40')][_0x7eda('0x30')]){_0x13e4b0[_0x7eda('0x49')]=_[_0x7eda('0x4a')](_0x13e4b0[_0x7eda('0x49')],{'$or':_['map'](_0x5d35c4,function(_0x4b4d37){if(_0x4b4d37[_0x7eda('0x35')]!==_0x7eda('0x4b')){var _0x425a16={};_0x425a16[_0x4b4d37[_0x7eda('0x37')]]={'$like':'%'+_0x7505b6[_0x7eda('0x40')][_0x7eda('0x30')]+'%'};return _0x425a16;}})});}_0x13e4b0=_[_0x7eda('0x4a')]({},_0x13e4b0,_0x7505b6[_0x7eda('0x4c')]);var _0xe8b8e8={'where':_0x13e4b0[_0x7eda('0x49')]};return db[_0x7eda('0x3b')][_0x7eda('0x4d')](_0xe8b8e8)[_0x7eda('0x28')](function(_0x1710bc){_0xc81856['count']=_0x1710bc;if(_0x7505b6[_0x7eda('0x40')][_0x7eda('0x4e')]){_0x13e4b0[_0x7eda('0x4f')]=[{'all':!![]}];}return db['VoiceExtension'][_0x7eda('0x50')](_0x13e4b0);})['then'](function(_0x1240f6){_0xc81856[_0x7eda('0x51')]=_0x1240f6;return _0xc81856;})[_0x7eda('0x28')](respondWithFilteredResult(_0x52aaab,_0x13e4b0))[_0x7eda('0x52')](handleError(_0x52aaab,null));};exports['show']=function(_0x144388,_0x20239c){var _0x4adf31={'raw':![],'where':{'id':_0x144388['params']['id']}},_0x42ffb4={};_0x42ffb4[_0x7eda('0x3f')]=_[_0x7eda('0x53')](db[_0x7eda('0x3b')][_0x7eda('0x3c')]);_0x42ffb4['query']=_['keys'](_0x144388[_0x7eda('0x40')]);_0x42ffb4[_0x7eda('0x41')]=_[_0x7eda('0x42')](_0x42ffb4[_0x7eda('0x3f')],_0x42ffb4[_0x7eda('0x40')]);_0x4adf31[_0x7eda('0x43')]=_[_0x7eda('0x42')](_0x42ffb4[_0x7eda('0x3f')],qs[_0x7eda('0x44')](_0x144388[_0x7eda('0x40')][_0x7eda('0x44')]));_0x4adf31['attributes']=_0x4adf31[_0x7eda('0x43')][_0x7eda('0x45')]?_0x4adf31[_0x7eda('0x43')]:_0x42ffb4[_0x7eda('0x3f')];if(_0x144388[_0x7eda('0x40')][_0x7eda('0x4e')]){_0x4adf31['include']=[{'all':!![]}];}_0x4adf31=_[_0x7eda('0x4a')]({},_0x4adf31,_0x144388[_0x7eda('0x4c')]);return db['VoiceExtension'][_0x7eda('0x36')](_0x4adf31)[_0x7eda('0x28')](handleEntityNotFound(_0x20239c,null))[_0x7eda('0x28')](respondWithResult(_0x20239c,null))['catch'](handleError(_0x20239c,null));};exports[_0x7eda('0x29')]=function(_0x55346f,_0x389878){return db['VoiceExtension'][_0x7eda('0x36')]({'where':{'id':_0x55346f[_0x7eda('0x54')]['id']}})['then'](handleEntityNotFound(_0x389878,null))[_0x7eda('0x28')](removeEntity(_0x389878,null))[_0x7eda('0x52')](handleError(_0x389878,null));};exports['create']=function(_0x233ab6,_0x1211a5){if(_0x233ab6[_0x7eda('0x55')][_0x7eda('0x35')]===_0x7eda('0x2d')&&!_[_0x7eda('0x56')](_0x233ab6[_0x7eda('0x55')][_0x7eda('0x57')],'_')){_0x233ab6[_0x7eda('0x55')][_0x7eda('0x57')]='_'[_0x7eda('0x58')](_0x233ab6[_0x7eda('0x55')]['exten']);}return db[_0x7eda('0x3b')]['create'](_0x233ab6['body'],{'raw':![]})[_0x7eda('0x28')](function(_0x8840b9){var _0x3b1a19=_0x233ab6[_0x7eda('0x59')]['get']({'plain':!![]});if(!_0x3b1a19)throw new Error(_0x7eda('0x5a'));if(_0x3b1a19[_0x7eda('0x5b')]===_0x7eda('0x59')){var _0x26445b=_0x8840b9[_0x7eda('0x2a')]({'plain':!![]});var _0x55ebf4=[{'name':_0x7eda('0x5c'),'value':_0x7eda('0x2b')},{'name':_0x7eda('0x2c'),'value':_0x7eda('0x2d')},{'name':_0x7eda('0x2e'),'value':_0x7eda('0x2f')}];var _0x58f95a=_[_0x7eda('0x36')](_0x55ebf4,[_0x7eda('0x33'),_0x26445b[_0x7eda('0x35')]])[_0x7eda('0x37')];return db[_0x7eda('0x5d')][_0x7eda('0x36')]({'where':{'name':_0x58f95a,'userProfileId':_0x3b1a19[_0x7eda('0x5e')]},'raw':!![]})['then'](function(_0x397d24){if(_0x397d24&&_0x397d24[_0x7eda('0x5f')]===0x0){return db[_0x7eda('0x60')][_0x7eda('0x61')]({'name':_0x26445b[_0x7eda('0x37')],'resourceId':_0x26445b['id'],'type':_0x397d24[_0x7eda('0x37')],'sectionId':_0x397d24['id']},{})[_0x7eda('0x28')](function(){return _0x8840b9;});}else{return _0x8840b9;}})[_0x7eda('0x52')](function(_0x42344d){logger[_0x7eda('0x38')](_0x7eda('0x62'),_0x42344d);throw _0x42344d;});}return _0x8840b9;})['then'](respondWithResult(_0x1211a5,0xc9))['catch'](handleError(_0x1211a5,null));};exports['update']=function(_0x3aa89c,_0x1c600c){if(_0x3aa89c[_0x7eda('0x55')]['id']){delete _0x3aa89c[_0x7eda('0x55')]['id'];}return db[_0x7eda('0x3b')][_0x7eda('0x36')]({'where':{'id':_0x3aa89c['params']['id']}})[_0x7eda('0x28')](handleEntityNotFound(_0x1c600c,null))[_0x7eda('0x28')](function(_0x4d9050){if(_0x4d9050){return db['VoiceExtension'][_0x7eda('0x27')](_[_0x7eda('0x63')](_0x3aa89c['body'],['exten',_0x7eda('0x64'),_0x7eda('0x65'),'recordingFormat',_0x7eda('0x66'),_0x7eda('0x67')]),{'where':{'context':_0x4d9050[_0x7eda('0x64')],'exten':_0x4d9050['exten']},'individualHooks':!![]})[_0x7eda('0x28')](function(_0x3e8272){return _0x3e8272;});}return null;})[_0x7eda('0x28')](respondWithStatusCode(_0x1c600c,null))[_0x7eda('0x52')](handleError(_0x1c600c,null));};exports[_0x7eda('0x68')]=function(_0x379e33,_0x11bd58,_0x1eabce){return db[_0x7eda('0x3b')]['findOne']({'where':{'id':_0x379e33[_0x7eda('0x54')]['id']}})[_0x7eda('0x28')](handleEntityNotFound(_0x11bd58,null))[_0x7eda('0x28')](function(_0x27e1fa){if(_0x27e1fa){return db[_0x7eda('0x69')]['transaction'](function(_0x3a4d64){return db[_0x7eda('0x3b')][_0x7eda('0x29')]({'where':{'VoiceExtensionId':_0x379e33[_0x7eda('0x54')]['id']},'transaction':_0x3a4d64})[_0x7eda('0x28')](function(_0x5a7112){var _0x1ec9a0=_['map'](_0x379e33['body'],function(_0x22b4c0){_0x22b4c0['VoiceExtensionId']=_0x379e33[_0x7eda('0x54')]['id'];return _0x22b4c0;});return db[_0x7eda('0x3b')][_0x7eda('0x6a')](_0x1ec9a0,{'transaction':_0x3a4d64});});})[_0x7eda('0x28')](function(){return db[_0x7eda('0x3b')][_0x7eda('0x6b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x379e33['params']['id']},'order':_0x7eda('0x6c')});});}})[_0x7eda('0x28')](respondWithResult(_0x11bd58,null))[_0x7eda('0x52')](handleError(_0x11bd58,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7830fb6..3bb1107 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 _0x2b4a=['VoiceExtension','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x2b4a[_0x349148];return _0x2f2b0f;};'use strict';var EventEmitter=require(_0xa2b4('0x0'));var VoiceExtension=require(_0xa2b4('0x1'))['db'][_0xa2b4('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa2b4('0x3')](0x0);var events={'afterCreate':_0xa2b4('0x4'),'afterUpdate':_0xa2b4('0x5'),'afterDestroy':_0xa2b4('0x6')};function emitEvent(_0x26069a){return function(_0x4c5e61,_0x1caaf8,_0xe1102a){VoiceExtensionEvents[_0xa2b4('0x7')](_0x26069a+':'+_0x4c5e61['id'],_0x4c5e61);VoiceExtensionEvents[_0xa2b4('0x7')](_0x26069a,_0x4c5e61);_0xe1102a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xa2b4('0x8')](e,emitEvent(event));}}module[_0xa2b4('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xcceb=['remove','hook','events','VoiceExtension','setMaxListeners','save','update'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0xcceb,0x79));var _0xbcce=function(_0x545e64,_0x356844){_0x545e64=_0x545e64-0x0;var _0x13dbef=_0xcceb[_0x545e64];return _0x13dbef;};'use strict';var EventEmitter=require(_0xbcce('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xbcce('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbcce('0x2')](0x0);var events={'afterCreate':_0xbcce('0x3'),'afterUpdate':_0xbcce('0x4'),'afterDestroy':_0xbcce('0x5')};function emitEvent(_0x14e96e){return function(_0x141d87,_0x3a9d2f,_0x446a80){VoiceExtensionEvents['emit'](_0x14e96e+':'+_0x141d87['id'],_0x141d87);VoiceExtensionEvents['emit'](_0x14e96e,_0x141d87);_0x446a80(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xbcce('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 18f7df0..2df4bce 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 _0x52f8=['exports','define','VoiceExtension','voice_extensions','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x52f8,0xac));var _0x852f=function(_0x2369cd,_0x142f60){_0x2369cd=_0x2369cd-0x0;var _0x1a0355=_0x52f8[_0x2369cd];return _0x1a0355;};'use strict';var _=require(_0x852f('0x0'));var util=require('util');var logger=require(_0x852f('0x1'))(_0x852f('0x2'));var moment=require('moment');var BPromise=require(_0x852f('0x3'));var rp=require(_0x852f('0x4'));var fs=require('fs');var path=require(_0x852f('0x5'));var rimraf=require('rimraf');var config=require(_0x852f('0x6'));var attributes=require(_0x852f('0x7'));module[_0x852f('0x8')]=function(_0x38b4a0,_0x4c3e4a){return _0x38b4a0[_0x852f('0x9')](_0x852f('0xa'),attributes,{'tableName':_0x852f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d83=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','util'];(function(_0x462ab3,_0x42d82a){var _0x8f391b=function(_0xfd3b2){while(--_0xfd3b2){_0x462ab3['push'](_0x462ab3['shift']());}};_0x8f391b(++_0x42d82a);}(_0x0d83,0x16a));var _0x30d8=function(_0x1c2970,_0x560850){_0x1c2970=_0x1c2970-0x0;var _0x3cab91=_0x0d83[_0x1c2970];return _0x3cab91;};'use strict';var _=require(_0x30d8('0x0'));var util=require(_0x30d8('0x1'));var logger=require(_0x30d8('0x2'))(_0x30d8('0x3'));var moment=require(_0x30d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x30d8('0x5'));var fs=require('fs');var path=require(_0x30d8('0x6'));var rimraf=require(_0x30d8('0x7'));var config=require(_0x30d8('0x8'));var attributes=require(_0x30d8('0x9'));module[_0x30d8('0xa')]=function(_0x479557,_0x27d678){return _0x479557[_0x30d8('0xb')](_0x30d8('0xc'),attributes,{'tableName':'voice_extensions','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 787a110..54b9e68 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 _0x5388=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s','message','catch','VoiceExtension','raw','options','where','attributes','limit','map','include','model','GetVoiceExtension','lodash'];(function(_0x2ceec4,_0x4af973){var _0x416911=function(_0x52a985){while(--_0x52a985){_0x2ceec4['push'](_0x2ceec4['shift']());}};_0x416911(++_0x4af973);}(_0x5388,0x11f));var _0x8538=function(_0x23fde2,_0x3c0ecc){_0x23fde2=_0x23fde2-0x0;var _0x2b910b=_0x5388[_0x23fde2];return _0x2b910b;};'use strict';var _=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var moment=require('moment');var BPromise=require(_0x8538('0x2'));var rs=require(_0x8538('0x3'));var fs=require('fs');var Redis=require(_0x8538('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8538('0x5'));var logger=require('../../config/logger')(_0x8538('0x6'));var config=require(_0x8538('0x7'));var jayson=require(_0x8538('0x8'));var client=jayson[_0x8538('0x9')][_0x8538('0xa')]({'port':0x232a});config['redis']=_[_0x8538('0xb')](config['redis'],{'host':_0x8538('0xc'),'port':0x18eb});var socket=require(_0x8538('0xd'))(new Redis(config[_0x8538('0xe')]));require('./voiceExtension.socket')[_0x8538('0xf')](socket);function respondWithRpcPromise(_0x57a440,_0x2e2883,_0x5eb829){return new BPromise(function(_0x238076,_0x133c63){return client['request'](_0x57a440,_0x5eb829)[_0x8538('0x10')](function(_0x50ecae){logger[_0x8538('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x2e2883,_0x8538('0x12'));logger[_0x8538('0x13')](_0x8538('0x14'),_0x2e2883,_0x8538('0x12'),JSON[_0x8538('0x15')](_0x50ecae));if(_0x50ecae['error']){if(_0x50ecae[_0x8538('0x16')]['code']===0x1f4){logger[_0x8538('0x16')](_0x8538('0x17'),_0x2e2883,_0x50ecae[_0x8538('0x16')]['message']);return _0x133c63(_0x50ecae['error']['message']);}logger[_0x8538('0x16')](_0x8538('0x17'),_0x2e2883,_0x50ecae['error'][_0x8538('0x18')]);return _0x238076(_0x50ecae[_0x8538('0x16')][_0x8538('0x18')]);}else{logger[_0x8538('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x2e2883,_0x8538('0x12'));_0x238076(_0x50ecae['result'][_0x8538('0x18')]);}})[_0x8538('0x19')](function(_0x381eae){logger[_0x8538('0x16')](_0x8538('0x17'),_0x2e2883,_0x381eae);_0x133c63(_0x381eae);});});}exports['GetVoiceExtension']=function(_0x265ce1){var _0x22667f=this;return new Promise(function(_0x925c81,_0x3f1a73){return db[_0x8538('0x1a')]['findAll']({'raw':_0x265ce1['options']?_0x265ce1['options'][_0x8538('0x1b')]===undefined?!![]:![]:!![],'where':_0x265ce1[_0x8538('0x1c')]?_0x265ce1[_0x8538('0x1c')][_0x8538('0x1d')]||null:null,'attributes':_0x265ce1[_0x8538('0x1c')]?_0x265ce1[_0x8538('0x1c')][_0x8538('0x1e')]||null:null,'limit':_0x265ce1['options']?_0x265ce1[_0x8538('0x1c')][_0x8538('0x1f')]||null:null,'include':_0x265ce1['options']?_0x265ce1[_0x8538('0x1c')]['include']?_[_0x8538('0x20')](_0x265ce1[_0x8538('0x1c')][_0x8538('0x21')],function(_0x1c39c8){return{'model':db[_0x1c39c8['model']],'as':_0x1c39c8['as'],'attributes':_0x1c39c8['attributes'],'include':_0x1c39c8[_0x8538('0x21')]?_[_0x8538('0x20')](_0x1c39c8[_0x8538('0x21')],function(_0x1f2d99){return{'model':db[_0x1f2d99[_0x8538('0x22')]],'as':_0x1f2d99['as'],'attributes':_0x1f2d99[_0x8538('0x1e')],'include':_0x1f2d99[_0x8538('0x21')]?_['map'](_0x1f2d99[_0x8538('0x21')],function(_0x283b57){return{'model':db[_0x283b57[_0x8538('0x22')]],'as':_0x283b57['as'],'attributes':_0x283b57[_0x8538('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8538('0x10')](function(_0xb6ca8a){logger[_0x8538('0x11')](_0x8538('0x23'),_0x265ce1);logger[_0x8538('0x13')](_0x8538('0x23'),_0x265ce1,JSON['stringify'](_0xb6ca8a));_0x925c81(_0xb6ca8a);})[_0x8538('0x19')](function(_0x1ebcb1){logger[_0x8538('0x16')](_0x8538('0x23'),_0x1ebcb1['message'],_0x265ce1);_0x3f1a73(_0x22667f[_0x8538('0x16')](0x1f4,_0x1ebcb1[_0x8538('0x18')]));});});}; \ No newline at end of file +var _0xf8c5=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','findAll','options','raw','where','limit','map','include','model','attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x1afecb,_0x3f000c){var _0x29806c=function(_0x27444d){while(--_0x27444d){_0x1afecb['push'](_0x1afecb['shift']());}};_0x29806c(++_0x3f000c);}(_0xf8c5,0x167));var _0x5f8c=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xf8c5[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');var util=require(_0x5f8c('0x0'));var moment=require(_0x5f8c('0x1'));var BPromise=require(_0x5f8c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f8c('0x3'));var db=require(_0x5f8c('0x4'))['db'];var utils=require(_0x5f8c('0x5'));var logger=require(_0x5f8c('0x6'))(_0x5f8c('0x7'));var config=require(_0x5f8c('0x8'));var jayson=require(_0x5f8c('0x9'));var client=jayson[_0x5f8c('0xa')][_0x5f8c('0xb')]({'port':0x232a});config[_0x5f8c('0xc')]=_[_0x5f8c('0xd')](config[_0x5f8c('0xc')],{'host':_0x5f8c('0xe'),'port':0x18eb});var socket=require(_0x5f8c('0xf'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x524ac3,_0x4de0f3,_0x13b2be){return new BPromise(function(_0x485baf,_0x16cf3f){return client[_0x5f8c('0x10')](_0x524ac3,_0x13b2be)[_0x5f8c('0x11')](function(_0xc34915){logger[_0x5f8c('0x12')](_0x5f8c('0x13'),_0x4de0f3,_0x5f8c('0x14'));logger[_0x5f8c('0x15')](_0x5f8c('0x16'),_0x4de0f3,_0x5f8c('0x14'),JSON['stringify'](_0xc34915));if(_0xc34915['error']){if(_0xc34915[_0x5f8c('0x17')][_0x5f8c('0x18')]===0x1f4){logger[_0x5f8c('0x17')](_0x5f8c('0x13'),_0x4de0f3,_0xc34915['error'][_0x5f8c('0x19')]);return _0x16cf3f(_0xc34915[_0x5f8c('0x17')]['message']);}logger[_0x5f8c('0x17')](_0x5f8c('0x13'),_0x4de0f3,_0xc34915['error'][_0x5f8c('0x19')]);return _0x485baf(_0xc34915[_0x5f8c('0x17')][_0x5f8c('0x19')]);}else{logger['info'](_0x5f8c('0x13'),_0x4de0f3,_0x5f8c('0x14'));_0x485baf(_0xc34915[_0x5f8c('0x1a')]['message']);}})[_0x5f8c('0x1b')](function(_0x4108fd){logger[_0x5f8c('0x17')](_0x5f8c('0x13'),_0x4de0f3,_0x4108fd);_0x16cf3f(_0x4108fd);});});}exports[_0x5f8c('0x1c')]=function(_0x171f20){var _0x203074=this;return new Promise(function(_0x203de4,_0x378fb4){return db['VoiceExtension'][_0x5f8c('0x1d')]({'raw':_0x171f20['options']?_0x171f20[_0x5f8c('0x1e')][_0x5f8c('0x1f')]===undefined?!![]:![]:!![],'where':_0x171f20[_0x5f8c('0x1e')]?_0x171f20[_0x5f8c('0x1e')][_0x5f8c('0x20')]||null:null,'attributes':_0x171f20[_0x5f8c('0x1e')]?_0x171f20[_0x5f8c('0x1e')]['attributes']||null:null,'limit':_0x171f20[_0x5f8c('0x1e')]?_0x171f20['options'][_0x5f8c('0x21')]||null:null,'include':_0x171f20[_0x5f8c('0x1e')]?_0x171f20[_0x5f8c('0x1e')]['include']?_[_0x5f8c('0x22')](_0x171f20[_0x5f8c('0x1e')][_0x5f8c('0x23')],function(_0xa7b0f1){return{'model':db[_0xa7b0f1[_0x5f8c('0x24')]],'as':_0xa7b0f1['as'],'attributes':_0xa7b0f1['attributes'],'include':_0xa7b0f1[_0x5f8c('0x23')]?_[_0x5f8c('0x22')](_0xa7b0f1[_0x5f8c('0x23')],function(_0x317007){return{'model':db[_0x317007[_0x5f8c('0x24')]],'as':_0x317007['as'],'attributes':_0x317007[_0x5f8c('0x25')],'include':_0x317007['include']?_[_0x5f8c('0x22')](_0x317007['include'],function(_0x474a06){return{'model':db[_0x474a06[_0x5f8c('0x24')]],'as':_0x474a06['as'],'attributes':_0x474a06[_0x5f8c('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5f8c('0x11')](function(_0x4a516f){logger['info']('GetVoiceExtension',_0x171f20);logger[_0x5f8c('0x15')](_0x5f8c('0x1c'),_0x171f20,JSON['stringify'](_0x4a516f));_0x203de4(_0x4a516f);})['catch'](function(_0x303ccb){logger[_0x5f8c('0x17')](_0x5f8c('0x1c'),_0x303ccb[_0x5f8c('0x19')],_0x171f20);_0x378fb4(_0x203074[_0x5f8c('0x17')](0x1f4,_0x303ccb[_0x5f8c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index cb04d21..a5b992e 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 _0x7a73=['register','length','voiceExtension:','./voiceExtension.events','update','emit','removeListener'];(function(_0x5e1453,_0x8b75b5){var _0x18e245=function(_0x332471){while(--_0x332471){_0x5e1453['push'](_0x5e1453['shift']());}};_0x18e245(++_0x8b75b5);}(_0x7a73,0x161));var _0x37a7=function(_0x1fe4a8,_0x343297){_0x1fe4a8=_0x1fe4a8-0x0;var _0x1759c6=_0x7a73[_0x1fe4a8];return _0x1759c6;};'use strict';var VoiceExtensionEvents=require(_0x37a7('0x0'));var events=['save','remove',_0x37a7('0x1')];function createListener(_0x5a6b69,_0x10c7ee){return function(_0x496bd5){_0x10c7ee[_0x37a7('0x2')](_0x5a6b69,_0x496bd5);};}function removeListener(_0x46a1a0,_0x4f190f){return function(){VoiceExtensionEvents[_0x37a7('0x3')](_0x46a1a0,_0x4f190f);};}exports[_0x37a7('0x4')]=function(_0x1aecf8){for(var _0x1a5273=0x0,_0x3d6d4c=events[_0x37a7('0x5')];_0x1a5273<_0x3d6d4c;_0x1a5273++){var _0x269ba2=events[_0x1a5273];var _0x5035a7=createListener(_0x37a7('0x6')+_0x269ba2,_0x1aecf8);VoiceExtensionEvents['on'](_0x269ba2,_0x5035a7);}}; \ No newline at end of file +var _0x5de8=['remove','update','emit','register','length','./voiceExtension.events','save'];(function(_0x49b677,_0x40aa9e){var _0x35ce17=function(_0x5eedef){while(--_0x5eedef){_0x49b677['push'](_0x49b677['shift']());}};_0x35ce17(++_0x40aa9e);}(_0x5de8,0x163));var _0x85de=function(_0xdc6a4c,_0x171820){_0xdc6a4c=_0xdc6a4c-0x0;var _0x16fd58=_0x5de8[_0xdc6a4c];return _0x16fd58;};'use strict';var VoiceExtensionEvents=require(_0x85de('0x0'));var events=[_0x85de('0x1'),_0x85de('0x2'),_0x85de('0x3')];function createListener(_0x17d570,_0x5ceedb){return function(_0x458335){_0x5ceedb[_0x85de('0x4')](_0x17d570,_0x458335);};}function removeListener(_0x58eefd,_0xeb5ce4){return function(){VoiceExtensionEvents['removeListener'](_0x58eefd,_0xeb5ce4);};}exports[_0x85de('0x5')]=function(_0xcdb50b){for(var _0x5d1578=0x0,_0x4ab548=events[_0x85de('0x6')];_0x5d1578<_0x4ab548;_0x5d1578++){var _0x3222e1=events[_0x5d1578];var _0x4e9610=createListener('voiceExtension:'+_0x3222e1,_0xcdb50b);VoiceExtensionEvents['on'](_0x3222e1,_0x4e9610);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 79cfc3b..977d268 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 _0x65b4=['get','isAuthenticated','index','show','/:id/messages','getMessages','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller'];(function(_0x5f1a05,_0x2a48d4){var _0x48ecbf=function(_0x67ed29){while(--_0x67ed29){_0x5f1a05['push'](_0x5f1a05['shift']());}};_0x48ecbf(++_0x2a48d4);}(_0x65b4,0x7c));var _0x465b=function(_0x322132,_0x4ca6e1){_0x322132=_0x322132-0x0;var _0x409f3c=_0x65b4[_0x322132];return _0x409f3c;};'use strict';var multer=require('multer');var util=require(_0x465b('0x0'));var path=require(_0x465b('0x1'));var timeout=require(_0x465b('0x2'));var express=require(_0x465b('0x3'));var router=express[_0x465b('0x4')]();var auth=require(_0x465b('0x5'));var interaction=require(_0x465b('0x6'));var config=require('../../config/environment');var controller=require(_0x465b('0x7'));router[_0x465b('0x8')]('/',auth[_0x465b('0x9')](),controller[_0x465b('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x465b('0xb')]);router[_0x465b('0x8')](_0x465b('0xc'),auth['isAuthenticated'](),controller[_0x465b('0xd')]);router[_0x465b('0xe')]('/',auth[_0x465b('0x9')](),controller[_0x465b('0xf')]);router[_0x465b('0x10')](_0x465b('0x11'),auth[_0x465b('0x9')](),controller[_0x465b('0x12')]);router[_0x465b('0x13')](_0x465b('0x11'),auth[_0x465b('0x9')](),controller[_0x465b('0x14')]);module[_0x465b('0x15')]=router; \ No newline at end of file +var _0xa29e=['/:id/messages','getMessages','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa29e,0x199));var _0xea29=function(_0x178e71,_0x5c6c7d){_0x178e71=_0x178e71-0x0;var _0x3eec6c=_0xa29e[_0x178e71];return _0x3eec6c;};'use strict';var multer=require(_0xea29('0x0'));var util=require(_0xea29('0x1'));var path=require(_0xea29('0x2'));var timeout=require(_0xea29('0x3'));var express=require('express');var router=express[_0xea29('0x4')]();var auth=require(_0xea29('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea29('0x6'));router[_0xea29('0x7')]('/',auth[_0xea29('0x8')](),controller[_0xea29('0x9')]);router[_0xea29('0x7')]('/:id',auth[_0xea29('0x8')](),controller[_0xea29('0xa')]);router['get'](_0xea29('0xb'),auth[_0xea29('0x8')](),controller[_0xea29('0xc')]);router[_0xea29('0xd')]('/',auth[_0xea29('0x8')](),controller[_0xea29('0xe')]);router[_0xea29('0xf')](_0xea29('0x10'),auth[_0xea29('0x8')](),controller['update']);router[_0xea29('0x11')](_0xea29('0x10'),auth[_0xea29('0x8')](),controller[_0xea29('0x12')]);module[_0xea29('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index b3bde7c..4a908a8 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 _0xea28=['yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM'];(function(_0x5168c3,_0xb7acb9){var _0x37ee00=function(_0x4680a5){while(--_0x4680a5){_0x5168c3['push'](_0x5168c3['shift']());}};_0x37ee00(++_0xb7acb9);}(_0xea28,0x13a));var _0x8ea2=function(_0xc38aff,_0x42eca7){_0xc38aff=_0xc38aff-0x0;var _0x1b4ece=_0xea28[_0xc38aff];return _0x1b4ece;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'customer_id':{'type':Sequelize[_0x8ea2('0x2')]},'context':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':_0x8ea2('0x3'),'unique':_0x8ea2('0x4')},'mailbox':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8ea2('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8ea2('0x2')]},'email':{'type':Sequelize[_0x8ea2('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1ccf12){this['setDataValue'](_0x8ea2('0x5'),typeof _0x1ccf12===_0x8ea2('0x6')&&_0x1ccf12[_0x8ea2('0x7')]()?_0x1ccf12[_0x8ea2('0x7')]():null);}},'pager':{'type':Sequelize[_0x8ea2('0x2')]},'tz':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':_0x8ea2('0x8')},'attach':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':_0x8ea2('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x8ea2('0x2')]},'review':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8ea2('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':_0x8ea2('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8ea2('0x9')](_0x8ea2('0xa'),'no'),'defaultValue':_0x8ea2('0xa'),'allowNull':![]},'stamp':{'type':_0x8ea2('0xb')},'emailsubject':{'type':Sequelize[_0x8ea2('0x2')]},'emailbody':{'type':Sequelize[_0x8ea2('0x2')]},'maxsecs':{'type':Sequelize[_0x8ea2('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8ea2('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8ea2('0xd')],'get':function(){return this[_0x8ea2('0xe')](_0x8ea2('0xf'))+_0x8ea2('0x10')+this[_0x8ea2('0xe')](_0x8ea2('0x11'));}}}; \ No newline at end of file +var _0xb7e7=['sequelize','STRING','from-voicemail','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x4e00b7,_0x59e15a){var _0x297f6f=function(_0x149465){while(--_0x149465){_0x4e00b7['push'](_0x4e00b7['shift']());}};_0x297f6f(++_0x59e15a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb7e7[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7b7e('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x7b7e('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7b7e('0x1')]},'fullname':{'type':Sequelize[_0x7b7e('0x1')]},'email':{'type':Sequelize[_0x7b7e('0x1')],'validate':{'isEmail':!![]},'set':function(_0x52047f){this['setDataValue'](_0x7b7e('0x3'),typeof _0x52047f===_0x7b7e('0x4')&&_0x52047f[_0x7b7e('0x5')]()?_0x52047f['trim']():null);}},'pager':{'type':Sequelize[_0x7b7e('0x1')]},'tz':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x6')},'attach':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7b7e('0x7')]('yes','no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7b7e('0x1')]},'callback':{'type':Sequelize[_0x7b7e('0x1')]},'review':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7b7e('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'stamp':{'type':_0x7b7e('0xa')},'emailsubject':{'type':Sequelize[_0x7b7e('0x1')]},'emailbody':{'type':Sequelize[_0x7b7e('0x1')]},'maxsecs':{'type':Sequelize[_0x7b7e('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7b7e('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7b7e('0xc')],'get':function(){return this[_0x7b7e('0xd')](_0x7b7e('0xe'))+_0x7b7e('0xf')+this[_0x7b7e('0xd')](_0x7b7e('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 10adfa6..f0533a0 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 _0xd240=['then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','map','VoiceMail','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','limit','sort','where','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','VoiceMailMessage','filters','mailbox','findAndCountAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','save','update'];(function(_0x36878e,_0x38281c){var _0xdccfe7=function(_0x3fdaf9){while(--_0x3fdaf9){_0x36878e['push'](_0x36878e['shift']());}};_0xdccfe7(++_0x38281c);}(_0xd240,0x1c7));var _0x0d24=function(_0x235f59,_0x1d5cd1){_0x235f59=_0x235f59-0x0;var _0x28069b=_0xd240[_0x235f59];return _0x28069b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d24('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d24('0x1'));var rp=require(_0x0d24('0x2'));var moment=require(_0x0d24('0x3'));var BPromise=require(_0x0d24('0x4'));var Mustache=require(_0x0d24('0x5'));var util=require(_0x0d24('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d24('0x7'));var ejs=require(_0x0d24('0x8'));var fs=require('fs');var _=require(_0x0d24('0x9'));var squel=require(_0x0d24('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d24('0xb'));var deskjs=require(_0x0d24('0xc'));var toCsv=require(_0x0d24('0x7'));var querystring=require(_0x0d24('0xd'));var Papa=require(_0x0d24('0xe'));var Redis=require(_0x0d24('0xf'));var authService=require(_0x0d24('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0d24('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d24('0x12'))('api');var utils=require(_0x0d24('0x13'));var config=require(_0x0d24('0x14'));var db=require(_0x0d24('0x15'))['db'];function respondWithStatusCode(_0x4c589f,_0x560ea5){_0x560ea5=_0x560ea5||0xcc;return function(_0x29f892){if(_0x29f892){return _0x4c589f[_0x0d24('0x16')](_0x560ea5);}return _0x4c589f[_0x0d24('0x17')](_0x560ea5)['end']();};}function respondWithResult(_0x1149ec,_0x106fb7){_0x106fb7=_0x106fb7||0xc8;return function(_0x58ac0d){if(_0x58ac0d){return _0x1149ec['status'](_0x106fb7)[_0x0d24('0x18')](_0x58ac0d);}};}function respondWithFilteredResult(_0x23772d,_0xb70f7e){return function(_0x175841){if(_0x175841){var _0xd9a534=_0x175841['count'],_0x6ec239=_0xb70f7e[_0x0d24('0x19')],_0xf188c9=_0xb70f7e[_0x0d24('0x19')]+_0xb70f7e['limit'],_0x240f86;if(_0xf188c9>=_0xd9a534){_0xf188c9=_0xd9a534;_0x240f86=0xc8;}else{_0x240f86=0xce;}_0x23772d[_0x0d24('0x17')](_0x240f86);return _0x23772d[_0x0d24('0x1a')](_0x0d24('0x1b'),_0x6ec239+'-'+_0xf188c9+'/'+_0xd9a534)[_0x0d24('0x18')](_0x175841);}return null;};}function patchUpdates(_0x4c5a1e){return function(_0x3bebf7){try{jsonpatch[_0x0d24('0x1c')](_0x3bebf7,_0x4c5a1e,!![]);}catch(_0x527f6b){return BPromise['reject'](_0x527f6b);}return _0x3bebf7[_0x0d24('0x1d')]();};}function saveUpdates(_0x2eca09,_0x3af97e){return function(_0x2f611b){if(_0x2f611b){return _0x2f611b[_0x0d24('0x1e')](_0x2eca09)[_0x0d24('0x1f')](function(_0x120625){return _0x120625;});}return null;};}function removeEntity(_0xc9cd70,_0x2dc0cf){return function(_0x5df68d){if(_0x5df68d){return _0x5df68d[_0x0d24('0x20')]()[_0x0d24('0x1f')](function(){var _0x2e1220=_0x5df68d[_0x0d24('0x21')]({'plain':!![]});var _0x4e6ded=_0x0d24('0x22');return db[_0x0d24('0x23')][_0x0d24('0x20')]({'where':{'type':_0x4e6ded,'resourceId':_0x2e1220['id']}})['then'](function(){return _0x5df68d;});})[_0x0d24('0x1f')](function(){_0xc9cd70[_0x0d24('0x17')](0xcc)[_0x0d24('0x24')]();});}};}function handleEntityNotFound(_0x5905c3,_0x26db95){return function(_0xa5d22d){if(!_0xa5d22d){_0x5905c3[_0x0d24('0x16')](0x194);}return _0xa5d22d;};}function handleError(_0x582169,_0x2226d6){_0x2226d6=_0x2226d6||0x1f4;return function(_0x1a5feb){logger[_0x0d24('0x25')](_0x1a5feb[_0x0d24('0x26')]);if(_0x1a5feb[_0x0d24('0x27')]){delete _0x1a5feb[_0x0d24('0x27')];}_0x582169['status'](_0x2226d6)['send'](_0x1a5feb);};}exports['index']=function(_0x1057c3,_0x2064e3){var _0x1a1ef7={},_0xa1bccb={},_0x31ea4b={'count':0x0,'rows':[]};var _0x8f3446=_[_0x0d24('0x28')](db[_0x0d24('0x29')][_0x0d24('0x2a')],function(_0x45c4bc){return{'name':_0x45c4bc[_0x0d24('0x2b')],'type':_0x45c4bc['type']['key']};});_0xa1bccb[_0x0d24('0x2c')]=_['map'](_0x8f3446,'name');_0xa1bccb[_0x0d24('0x2d')]=_[_0x0d24('0x2e')](_0x1057c3[_0x0d24('0x2d')]);_0xa1bccb['filters']=_[_0x0d24('0x2f')](_0xa1bccb['model'],_0xa1bccb[_0x0d24('0x2d')]);_0x1a1ef7[_0x0d24('0x30')]=_[_0x0d24('0x2f')](_0xa1bccb[_0x0d24('0x2c')],qs[_0x0d24('0x31')](_0x1057c3['query']['fields']));_0x1a1ef7[_0x0d24('0x30')]=_0x1a1ef7[_0x0d24('0x30')][_0x0d24('0x32')]?_0x1a1ef7[_0x0d24('0x30')]:_0xa1bccb[_0x0d24('0x2c')];if(!_0x1057c3[_0x0d24('0x2d')]['hasOwnProperty'](_0x0d24('0x33'))){_0x1a1ef7[_0x0d24('0x34')]=qs['limit'](_0x1057c3[_0x0d24('0x2d')][_0x0d24('0x34')]);_0x1a1ef7['offset']=qs[_0x0d24('0x19')](_0x1057c3[_0x0d24('0x2d')][_0x0d24('0x19')]);}_0x1a1ef7['order']=qs[_0x0d24('0x35')](_0x1057c3[_0x0d24('0x2d')][_0x0d24('0x35')]);_0x1a1ef7[_0x0d24('0x36')]=qs['filters'](_['pick'](_0x1057c3[_0x0d24('0x2d')],_0xa1bccb['filters']));if(_0x1057c3['query']['filter']){_0x1a1ef7[_0x0d24('0x36')]=_['merge'](_0x1a1ef7[_0x0d24('0x36')],{'$or':_[_0x0d24('0x28')](_0x8f3446,function(_0x37302d){if(_0x37302d[_0x0d24('0x37')]!==_0x0d24('0x38')){var _0x274cf5={};_0x274cf5[_0x37302d[_0x0d24('0x27')]]={'$like':'%'+_0x1057c3[_0x0d24('0x2d')][_0x0d24('0x39')]+'%'};return _0x274cf5;}})});}_0x1a1ef7=_['merge']({},_0x1a1ef7,_0x1057c3[_0x0d24('0x3a')]);var _0x554917={'where':_0x1a1ef7['where']};return db[_0x0d24('0x29')][_0x0d24('0x3b')](_0x554917)[_0x0d24('0x1f')](function(_0x1396cf){_0x31ea4b[_0x0d24('0x3b')]=_0x1396cf;if(_0x1057c3[_0x0d24('0x2d')][_0x0d24('0x3c')]){_0x1a1ef7[_0x0d24('0x3d')]=[{'all':!![]}];}return db[_0x0d24('0x29')][_0x0d24('0x3e')](_0x1a1ef7);})[_0x0d24('0x1f')](function(_0x548fee){_0x31ea4b[_0x0d24('0x3f')]=_0x548fee;return _0x31ea4b;})[_0x0d24('0x1f')](respondWithFilteredResult(_0x2064e3,_0x1a1ef7))['catch'](handleError(_0x2064e3,null));};exports[_0x0d24('0x40')]=function(_0x9dd427,_0x119152){var _0x1fbff7={'raw':!![],'where':{'id':_0x9dd427['params']['id']}},_0x4004d7={};_0x4004d7[_0x0d24('0x2c')]=_['keys'](db[_0x0d24('0x29')][_0x0d24('0x2a')]);_0x4004d7['query']=_[_0x0d24('0x2e')](_0x9dd427[_0x0d24('0x2d')]);_0x4004d7['filters']=_['intersection'](_0x4004d7['model'],_0x4004d7[_0x0d24('0x2d')]);_0x1fbff7[_0x0d24('0x30')]=_[_0x0d24('0x2f')](_0x4004d7[_0x0d24('0x2c')],qs[_0x0d24('0x31')](_0x9dd427['query'][_0x0d24('0x31')]));_0x1fbff7[_0x0d24('0x30')]=_0x1fbff7['attributes'][_0x0d24('0x32')]?_0x1fbff7['attributes']:_0x4004d7[_0x0d24('0x2c')];if(_0x9dd427[_0x0d24('0x2d')]['includeAll']){_0x1fbff7[_0x0d24('0x3d')]=[{'all':!![]}];}_0x1fbff7=_[_0x0d24('0x41')]({},_0x1fbff7,_0x9dd427[_0x0d24('0x3a')]);return db[_0x0d24('0x29')][_0x0d24('0x42')](_0x1fbff7)[_0x0d24('0x1f')](handleEntityNotFound(_0x119152,null))[_0x0d24('0x1f')](respondWithResult(_0x119152,null))[_0x0d24('0x43')](handleError(_0x119152,null));};exports[_0x0d24('0x44')]=function(_0x211bea,_0x149ea2){return db[_0x0d24('0x29')]['create'](_0x211bea[_0x0d24('0x45')],{})[_0x0d24('0x1f')](function(_0x14c055){var _0x1eb897=_0x211bea[_0x0d24('0x46')][_0x0d24('0x21')]({'plain':!![]});if(!_0x1eb897)throw new Error(_0x0d24('0x47'));if(_0x1eb897['role']==='user'){var _0x11de9b=_0x14c055[_0x0d24('0x21')]({'plain':!![]});var _0x8a5846=_0x0d24('0x22');return db['UserProfileSection'][_0x0d24('0x42')]({'where':{'name':_0x8a5846,'userProfileId':_0x1eb897[_0x0d24('0x48')]},'raw':!![]})[_0x0d24('0x1f')](function(_0x5544ff){if(_0x5544ff&&_0x5544ff[_0x0d24('0x49')]===0x0){return db[_0x0d24('0x23')][_0x0d24('0x44')]({'name':_0x11de9b[_0x0d24('0x27')],'resourceId':_0x11de9b['id'],'type':_0x5544ff[_0x0d24('0x27')],'sectionId':_0x5544ff['id']},{})[_0x0d24('0x1f')](function(){return _0x14c055;});}else{return _0x14c055;}})[_0x0d24('0x43')](function(_0x534154){logger['error'](_0x0d24('0x4a'),_0x534154);throw _0x534154;});}return _0x14c055;})[_0x0d24('0x1f')](respondWithResult(_0x149ea2,0xc9))[_0x0d24('0x43')](handleError(_0x149ea2,null));};exports['update']=function(_0x3d7e8e,_0x306897){if(_0x3d7e8e[_0x0d24('0x45')]['id']){delete _0x3d7e8e[_0x0d24('0x45')]['id'];}return db[_0x0d24('0x29')][_0x0d24('0x42')]({'where':{'id':_0x3d7e8e[_0x0d24('0x4b')]['id']}})['then'](handleEntityNotFound(_0x306897,null))[_0x0d24('0x1f')](saveUpdates(_0x3d7e8e[_0x0d24('0x45')],null))[_0x0d24('0x1f')](respondWithResult(_0x306897,null))[_0x0d24('0x43')](handleError(_0x306897,null));};exports[_0x0d24('0x20')]=function(_0x4ef505,_0x1dbe31){return db[_0x0d24('0x29')][_0x0d24('0x42')]({'where':{'id':_0x4ef505[_0x0d24('0x4b')]['id']}})[_0x0d24('0x1f')](handleEntityNotFound(_0x1dbe31,null))['then'](removeEntity(_0x1dbe31,null))[_0x0d24('0x43')](handleError(_0x1dbe31,null));};exports['getMessages']=function(_0x2485cf,_0x459fd0,_0x559ec4){return db[_0x0d24('0x29')][_0x0d24('0x4c')]({'where':{'id':_0x2485cf[_0x0d24('0x4b')]['id']}})[_0x0d24('0x1f')](handleEntityNotFound(_0x459fd0,null))[_0x0d24('0x1f')](function(_0x428959){var _0x13afac;var _0x99e67e={},_0x269289={};_0x269289[_0x0d24('0x2c')]=_[_0x0d24('0x2e')](db[_0x0d24('0x4d')][_0x0d24('0x2a')]);_0x269289[_0x0d24('0x2d')]=_[_0x0d24('0x2e')](_0x2485cf['query']);_0x269289[_0x0d24('0x4e')]=_[_0x0d24('0x2f')](_0x269289[_0x0d24('0x2c')],_0x269289[_0x0d24('0x2d')]);_0x99e67e[_0x0d24('0x30')]=_[_0x0d24('0x2f')](_0x269289[_0x0d24('0x2c')],qs[_0x0d24('0x31')](_0x2485cf[_0x0d24('0x2d')]['fields']));_0x99e67e[_0x0d24('0x30')]=_0x99e67e['attributes'][_0x0d24('0x32')]?_0x99e67e[_0x0d24('0x30')]:_0x269289[_0x0d24('0x2c')];if(!_0x2485cf[_0x0d24('0x2d')]['hasOwnProperty'](_0x0d24('0x33'))){_0x99e67e[_0x0d24('0x34')]=qs[_0x0d24('0x34')](_0x2485cf[_0x0d24('0x2d')]['limit']);_0x99e67e[_0x0d24('0x19')]=qs[_0x0d24('0x19')](_0x2485cf[_0x0d24('0x2d')]['offset']);}_0x99e67e['order']=qs[_0x0d24('0x35')](_0x2485cf[_0x0d24('0x2d')][_0x0d24('0x35')]);_0x99e67e['where']=qs[_0x0d24('0x4e')](_['pick'](_0x2485cf[_0x0d24('0x2d')],_0x269289[_0x0d24('0x4e')]));if(_0x2485cf['query'][_0x0d24('0x39')]){_0x99e67e['where']=_[_0x0d24('0x41')](_0x99e67e[_0x0d24('0x36')],{'$or':_[_0x0d24('0x28')](_0x99e67e[_0x0d24('0x30')],function(_0x957841){var _0x580f3c={};_0x580f3c[_0x957841]={'$like':'%'+_0x2485cf[_0x0d24('0x2d')][_0x0d24('0x39')]+'%'};return _0x580f3c;})});}_0x99e67e[_0x0d24('0x36')]=_[_0x0d24('0x41')](_0x99e67e[_0x0d24('0x36')],{'mailboxuser':_0x428959[_0x0d24('0x4f')]});_0x99e67e=_[_0x0d24('0x41')]({},_0x99e67e,_0x2485cf[_0x0d24('0x3a')]);return db[_0x0d24('0x4d')][_0x0d24('0x50')](_0x99e67e)[_0x0d24('0x1f')](respondWithFilteredResult(_0x459fd0,_0x99e67e));})[_0x0d24('0x43')](handleError(_0x459fd0,null));}; \ No newline at end of file +var _0xf04c=['rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','count','includeAll','include','rows','keys','length','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','params','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','set','Content-Range','json','apply','reject','update','destroy','then','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map'];(function(_0x3f61eb,_0x14486f){var _0x15abd5=function(_0x188bcb){while(--_0x188bcb){_0x3f61eb['push'](_0x3f61eb['shift']());}};_0x15abd5(++_0x14486f);}(_0xf04c,0x7c));var _0xcf04=function(_0x3a6d47,_0x528921){_0x3a6d47=_0x3a6d47-0x0;var _0x1a7e3f=_0xf04c[_0x3a6d47];return _0x1a7e3f;};'use strict';var pdf=require(_0xcf04('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf04('0x1'));var jsonpatch=require(_0xcf04('0x2'));var rp=require(_0xcf04('0x3'));var moment=require(_0xcf04('0x4'));var BPromise=require(_0xcf04('0x5'));var Mustache=require(_0xcf04('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcf04('0x7'));var csv=require(_0xcf04('0x8'));var ejs=require(_0xcf04('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcf04('0xa'));var crypto=require(_0xcf04('0xb'));var jsforce=require(_0xcf04('0xc'));var deskjs=require(_0xcf04('0xd'));var toCsv=require(_0xcf04('0x8'));var querystring=require(_0xcf04('0xe'));var Papa=require('papaparse');var Redis=require(_0xcf04('0xf'));var authService=require(_0xcf04('0x10'));var qs=require(_0xcf04('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf04('0x12'));var logger=require(_0xcf04('0x13'))(_0xcf04('0x14'));var utils=require(_0xcf04('0x15'));var config=require('../../config/environment');var db=require(_0xcf04('0x16'))['db'];function respondWithStatusCode(_0x2435f3,_0x304e6f){_0x304e6f=_0x304e6f||0xcc;return function(_0x18c18f){if(_0x18c18f){return _0x2435f3[_0xcf04('0x17')](_0x304e6f);}return _0x2435f3['status'](_0x304e6f)['end']();};}function respondWithResult(_0x4e947f,_0x1fa75a){_0x1fa75a=_0x1fa75a||0xc8;return function(_0x4c337e){if(_0x4c337e){return _0x4e947f[_0xcf04('0x18')](_0x1fa75a)['json'](_0x4c337e);}};}function respondWithFilteredResult(_0x326ab0,_0x58acc0){return function(_0xf4d84d){if(_0xf4d84d){var _0x2abc80=_0xf4d84d['count'],_0x933180=_0x58acc0[_0xcf04('0x19')],_0x12763d=_0x58acc0['offset']+_0x58acc0['limit'],_0x3a5909;if(_0x12763d>=_0x2abc80){_0x12763d=_0x2abc80;_0x3a5909=0xc8;}else{_0x3a5909=0xce;}_0x326ab0[_0xcf04('0x18')](_0x3a5909);return _0x326ab0[_0xcf04('0x1a')](_0xcf04('0x1b'),_0x933180+'-'+_0x12763d+'/'+_0x2abc80)[_0xcf04('0x1c')](_0xf4d84d);}return null;};}function patchUpdates(_0x439842){return function(_0x1af85e){try{jsonpatch[_0xcf04('0x1d')](_0x1af85e,_0x439842,!![]);}catch(_0x1fc868){return BPromise[_0xcf04('0x1e')](_0x1fc868);}return _0x1af85e['save']();};}function saveUpdates(_0x55deed,_0x1e23ab){return function(_0x2526e1){if(_0x2526e1){return _0x2526e1[_0xcf04('0x1f')](_0x55deed)['then'](function(_0x5286b6){return _0x5286b6;});}return null;};}function removeEntity(_0x356e22,_0x124b80){return function(_0x102e70){if(_0x102e70){return _0x102e70[_0xcf04('0x20')]()[_0xcf04('0x21')](function(){var _0x1fbf86=_0x102e70[_0xcf04('0x22')]({'plain':!![]});var _0x54ae74=_0xcf04('0x23');return db[_0xcf04('0x24')][_0xcf04('0x20')]({'where':{'type':_0x54ae74,'resourceId':_0x1fbf86['id']}})[_0xcf04('0x21')](function(){return _0x102e70;});})[_0xcf04('0x21')](function(){_0x356e22[_0xcf04('0x18')](0xcc)[_0xcf04('0x25')]();});}};}function handleEntityNotFound(_0x11fe35,_0x3f3dcb){return function(_0x33a4f1){if(!_0x33a4f1){_0x11fe35[_0xcf04('0x17')](0x194);}return _0x33a4f1;};}function handleError(_0xdc5ff9,_0x2d9b5f){_0x2d9b5f=_0x2d9b5f||0x1f4;return function(_0x3273dd){logger[_0xcf04('0x26')](_0x3273dd[_0xcf04('0x27')]);if(_0x3273dd[_0xcf04('0x28')]){delete _0x3273dd[_0xcf04('0x28')];}_0xdc5ff9[_0xcf04('0x18')](_0x2d9b5f)[_0xcf04('0x29')](_0x3273dd);};}exports[_0xcf04('0x2a')]=function(_0x5e46bc,_0x58b061){var _0x1d94da={},_0x27a3e1={},_0xdd66c9={'count':0x0,'rows':[]};var _0x177ff4=_[_0xcf04('0x2b')](db['VoiceMail'][_0xcf04('0x2c')],function(_0x1b7ea5){return{'name':_0x1b7ea5[_0xcf04('0x2d')],'type':_0x1b7ea5[_0xcf04('0x2e')][_0xcf04('0x2f')]};});_0x27a3e1['model']=_[_0xcf04('0x2b')](_0x177ff4,_0xcf04('0x28'));_0x27a3e1[_0xcf04('0x30')]=_['keys'](_0x5e46bc[_0xcf04('0x30')]);_0x27a3e1[_0xcf04('0x31')]=_[_0xcf04('0x32')](_0x27a3e1[_0xcf04('0x33')],_0x27a3e1['query']);_0x1d94da['attributes']=_[_0xcf04('0x32')](_0x27a3e1[_0xcf04('0x33')],qs[_0xcf04('0x34')](_0x5e46bc[_0xcf04('0x30')][_0xcf04('0x34')]));_0x1d94da[_0xcf04('0x35')]=_0x1d94da['attributes']['length']?_0x1d94da[_0xcf04('0x35')]:_0x27a3e1[_0xcf04('0x33')];if(!_0x5e46bc[_0xcf04('0x30')][_0xcf04('0x36')](_0xcf04('0x37'))){_0x1d94da[_0xcf04('0x38')]=qs['limit'](_0x5e46bc[_0xcf04('0x30')][_0xcf04('0x38')]);_0x1d94da[_0xcf04('0x19')]=qs['offset'](_0x5e46bc[_0xcf04('0x30')][_0xcf04('0x19')]);}_0x1d94da['order']=qs[_0xcf04('0x39')](_0x5e46bc[_0xcf04('0x30')][_0xcf04('0x39')]);_0x1d94da[_0xcf04('0x3a')]=qs[_0xcf04('0x31')](_[_0xcf04('0x3b')](_0x5e46bc[_0xcf04('0x30')],_0x27a3e1['filters']));if(_0x5e46bc['query'][_0xcf04('0x3c')]){_0x1d94da[_0xcf04('0x3a')]=_[_0xcf04('0x3d')](_0x1d94da[_0xcf04('0x3a')],{'$or':_['map'](_0x177ff4,function(_0xedb0f){if(_0xedb0f[_0xcf04('0x2e')]!==_0xcf04('0x3e')){var _0x5e15bb={};_0x5e15bb[_0xedb0f['name']]={'$like':'%'+_0x5e46bc[_0xcf04('0x30')]['filter']+'%'};return _0x5e15bb;}})});}_0x1d94da=_[_0xcf04('0x3d')]({},_0x1d94da,_0x5e46bc[_0xcf04('0x3f')]);var _0x48020f={'where':_0x1d94da[_0xcf04('0x3a')]};return db[_0xcf04('0x40')]['count'](_0x48020f)[_0xcf04('0x21')](function(_0x38ee45){_0xdd66c9[_0xcf04('0x41')]=_0x38ee45;if(_0x5e46bc[_0xcf04('0x30')][_0xcf04('0x42')]){_0x1d94da[_0xcf04('0x43')]=[{'all':!![]}];}return db[_0xcf04('0x40')]['findAll'](_0x1d94da);})['then'](function(_0x269e62){_0xdd66c9[_0xcf04('0x44')]=_0x269e62;return _0xdd66c9;})['then'](respondWithFilteredResult(_0x58b061,_0x1d94da))['catch'](handleError(_0x58b061,null));};exports['show']=function(_0x76b200,_0x1b0efd){var _0x2a8c07={'raw':!![],'where':{'id':_0x76b200['params']['id']}},_0x557489={};_0x557489[_0xcf04('0x33')]=_[_0xcf04('0x45')](db['VoiceMail'][_0xcf04('0x2c')]);_0x557489[_0xcf04('0x30')]=_['keys'](_0x76b200['query']);_0x557489[_0xcf04('0x31')]=_[_0xcf04('0x32')](_0x557489[_0xcf04('0x33')],_0x557489[_0xcf04('0x30')]);_0x2a8c07[_0xcf04('0x35')]=_[_0xcf04('0x32')](_0x557489[_0xcf04('0x33')],qs[_0xcf04('0x34')](_0x76b200[_0xcf04('0x30')][_0xcf04('0x34')]));_0x2a8c07[_0xcf04('0x35')]=_0x2a8c07[_0xcf04('0x35')][_0xcf04('0x46')]?_0x2a8c07[_0xcf04('0x35')]:_0x557489[_0xcf04('0x33')];if(_0x76b200[_0xcf04('0x30')][_0xcf04('0x42')]){_0x2a8c07[_0xcf04('0x43')]=[{'all':!![]}];}_0x2a8c07=_['merge']({},_0x2a8c07,_0x76b200[_0xcf04('0x3f')]);return db['VoiceMail'][_0xcf04('0x47')](_0x2a8c07)['then'](handleEntityNotFound(_0x1b0efd,null))[_0xcf04('0x21')](respondWithResult(_0x1b0efd,null))[_0xcf04('0x48')](handleError(_0x1b0efd,null));};exports['create']=function(_0x541650,_0xbea7de){return db['VoiceMail']['create'](_0x541650[_0xcf04('0x49')],{})[_0xcf04('0x21')](function(_0x217d80){var _0x291267=_0x541650['user']['get']({'plain':!![]});if(!_0x291267)throw new Error(_0xcf04('0x4a'));if(_0x291267[_0xcf04('0x4b')]===_0xcf04('0x4c')){var _0x15da2c=_0x217d80['get']({'plain':!![]});var _0x266850=_0xcf04('0x23');return db[_0xcf04('0x4d')][_0xcf04('0x47')]({'where':{'name':_0x266850,'userProfileId':_0x291267[_0xcf04('0x4e')]},'raw':!![]})[_0xcf04('0x21')](function(_0x4a2de0){if(_0x4a2de0&&_0x4a2de0[_0xcf04('0x4f')]===0x0){return db[_0xcf04('0x24')]['create']({'name':_0x15da2c[_0xcf04('0x28')],'resourceId':_0x15da2c['id'],'type':_0x4a2de0[_0xcf04('0x28')],'sectionId':_0x4a2de0['id']},{})['then'](function(){return _0x217d80;});}else{return _0x217d80;}})[_0xcf04('0x48')](function(_0x51831b){logger[_0xcf04('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51831b);throw _0x51831b;});}return _0x217d80;})[_0xcf04('0x21')](respondWithResult(_0xbea7de,0xc9))[_0xcf04('0x48')](handleError(_0xbea7de,null));};exports[_0xcf04('0x1f')]=function(_0x574cd1,_0x568f7c){if(_0x574cd1[_0xcf04('0x49')]['id']){delete _0x574cd1[_0xcf04('0x49')]['id'];}return db[_0xcf04('0x40')]['find']({'where':{'id':_0x574cd1[_0xcf04('0x50')]['id']}})[_0xcf04('0x21')](handleEntityNotFound(_0x568f7c,null))[_0xcf04('0x21')](saveUpdates(_0x574cd1[_0xcf04('0x49')],null))['then'](respondWithResult(_0x568f7c,null))[_0xcf04('0x48')](handleError(_0x568f7c,null));};exports[_0xcf04('0x20')]=function(_0x58cc21,_0xd3c4ab){return db[_0xcf04('0x40')][_0xcf04('0x47')]({'where':{'id':_0x58cc21[_0xcf04('0x50')]['id']}})[_0xcf04('0x21')](handleEntityNotFound(_0xd3c4ab,null))[_0xcf04('0x21')](removeEntity(_0xd3c4ab,null))[_0xcf04('0x48')](handleError(_0xd3c4ab,null));};exports['getMessages']=function(_0x33b7ce,_0x360ce7,_0x171212){return db[_0xcf04('0x40')]['findOne']({'where':{'id':_0x33b7ce[_0xcf04('0x50')]['id']}})[_0xcf04('0x21')](handleEntityNotFound(_0x360ce7,null))[_0xcf04('0x21')](function(_0x358e4c){var _0x511d4b;var _0x248244={},_0x599a40={};_0x599a40[_0xcf04('0x33')]=_[_0xcf04('0x45')](db[_0xcf04('0x51')][_0xcf04('0x2c')]);_0x599a40['query']=_[_0xcf04('0x45')](_0x33b7ce[_0xcf04('0x30')]);_0x599a40['filters']=_[_0xcf04('0x32')](_0x599a40['model'],_0x599a40[_0xcf04('0x30')]);_0x248244[_0xcf04('0x35')]=_['intersection'](_0x599a40['model'],qs[_0xcf04('0x34')](_0x33b7ce[_0xcf04('0x30')][_0xcf04('0x34')]));_0x248244[_0xcf04('0x35')]=_0x248244[_0xcf04('0x35')][_0xcf04('0x46')]?_0x248244['attributes']:_0x599a40[_0xcf04('0x33')];if(!_0x33b7ce['query']['hasOwnProperty'](_0xcf04('0x37'))){_0x248244[_0xcf04('0x38')]=qs['limit'](_0x33b7ce[_0xcf04('0x30')][_0xcf04('0x38')]);_0x248244[_0xcf04('0x19')]=qs[_0xcf04('0x19')](_0x33b7ce[_0xcf04('0x30')][_0xcf04('0x19')]);}_0x248244['order']=qs['sort'](_0x33b7ce[_0xcf04('0x30')][_0xcf04('0x39')]);_0x248244[_0xcf04('0x3a')]=qs['filters'](_['pick'](_0x33b7ce[_0xcf04('0x30')],_0x599a40[_0xcf04('0x31')]));if(_0x33b7ce['query']['filter']){_0x248244[_0xcf04('0x3a')]=_[_0xcf04('0x3d')](_0x248244[_0xcf04('0x3a')],{'$or':_[_0xcf04('0x2b')](_0x248244[_0xcf04('0x35')],function(_0x2fa198){var _0x2e8e4e={};_0x2e8e4e[_0x2fa198]={'$like':'%'+_0x33b7ce['query']['filter']+'%'};return _0x2e8e4e;})});}_0x248244[_0xcf04('0x3a')]=_[_0xcf04('0x3d')](_0x248244[_0xcf04('0x3a')],{'mailboxuser':_0x358e4c[_0xcf04('0x52')]});_0x248244=_[_0xcf04('0x3d')]({},_0x248244,_0x33b7ce[_0xcf04('0x3f')]);return db[_0xcf04('0x51')][_0xcf04('0x53')](_0x248244)[_0xcf04('0x21')](respondWithFilteredResult(_0x360ce7,_0x248244));})[_0xcf04('0x48')](handleError(_0x360ce7,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 38d9ab8..8b4bd47 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 _0x28b0=['path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x339da8,_0x168655){var _0x3e1788=function(_0x1d62be){while(--_0x1d62be){_0x339da8['push'](_0x339da8['shift']());}};_0x3e1788(++_0x168655);}(_0x28b0,0x174));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x028b('0x0'));var logger=require(_0x028b('0x1'))(_0x028b('0x2'));var moment=require(_0x028b('0x3'));var BPromise=require(_0x028b('0x4'));var rp=require(_0x028b('0x5'));var fs=require('fs');var path=require(_0x028b('0x6'));var rimraf=require(_0x028b('0x7'));var config=require(_0x028b('0x8'));var attributes=require(_0x028b('0x9'));module['exports']=function(_0x14b5c9,_0x5bbe03){return _0x14b5c9[_0x028b('0xa')](_0x028b('0xb'),attributes,{'tableName':_0x028b('0xc'),'paranoid':![],'indexes':[{'name':_0x028b('0xd'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd827=['define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports'];(function(_0x3e5538,_0x1271b9){var _0x150090=function(_0x3c2fda){while(--_0x3c2fda){_0x3e5538['push'](_0x3e5538['shift']());}};_0x150090(++_0x1271b9);}(_0xd827,0x1d6));var _0x7d82=function(_0x2a193f,_0x10ab8e){_0x2a193f=_0x2a193f-0x0;var _0x579e2c=_0xd827[_0x2a193f];return _0x579e2c;};'use strict';var _=require(_0x7d82('0x0'));var util=require('util');var logger=require(_0x7d82('0x1'))(_0x7d82('0x2'));var moment=require('moment');var BPromise=require(_0x7d82('0x3'));var rp=require(_0x7d82('0x4'));var fs=require('fs');var path=require(_0x7d82('0x5'));var rimraf=require(_0x7d82('0x6'));var config=require(_0x7d82('0x7'));var attributes=require(_0x7d82('0x8'));module[_0x7d82('0x9')]=function(_0x2a7b17,_0x2321b1){return _0x2a7b17[_0x7d82('0xa')](_0x7d82('0xb'),attributes,{'tableName':_0x7d82('0xc'),'paranoid':![],'indexes':[{'name':_0x7d82('0xd'),'fields':['mailbox',_0x7d82('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index ce254b4..9256aed 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 _0xf5b8=['code','message','error','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf5b8,0x1be));var _0x8f5b=function(_0x2b5c10,_0x1fc863){_0x2b5c10=_0x2b5c10-0x0;var _0x55fcae=_0xf5b8[_0x2b5c10];return _0x55fcae;};'use strict';var _=require(_0x8f5b('0x0'));var util=require(_0x8f5b('0x1'));var moment=require(_0x8f5b('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f5b('0x3'));var fs=require('fs');var Redis=require(_0x8f5b('0x4'));var db=require(_0x8f5b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f5b('0x6'))(_0x8f5b('0x7'));var config=require(_0x8f5b('0x8'));var jayson=require(_0x8f5b('0x9'));var client=jayson[_0x8f5b('0xa')][_0x8f5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x459629,_0x13d5b9,_0x3fba42){return new BPromise(function(_0x53ecfb,_0x3af55d){return client[_0x8f5b('0xc')](_0x459629,_0x3fba42)['then'](function(_0x2cd567){logger[_0x8f5b('0xd')](_0x8f5b('0xe'),_0x13d5b9,_0x8f5b('0xf'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x13d5b9,'request\x20sent',JSON['stringify'](_0x2cd567));if(_0x2cd567['error']){if(_0x2cd567['error'][_0x8f5b('0x10')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x13d5b9,_0x2cd567['error'][_0x8f5b('0x11')]);return _0x3af55d(_0x2cd567[_0x8f5b('0x12')][_0x8f5b('0x11')]);}logger[_0x8f5b('0x12')](_0x8f5b('0xe'),_0x13d5b9,_0x2cd567[_0x8f5b('0x12')]['message']);return _0x53ecfb(_0x2cd567[_0x8f5b('0x12')][_0x8f5b('0x11')]);}else{logger[_0x8f5b('0xd')]('VoiceMail,\x20%s,\x20%s',_0x13d5b9,_0x8f5b('0xf'));_0x53ecfb(_0x2cd567[_0x8f5b('0x13')][_0x8f5b('0x11')]);}})[_0x8f5b('0x14')](function(_0x569305){logger[_0x8f5b('0x12')](_0x8f5b('0xe'),_0x13d5b9,_0x569305);_0x3af55d(_0x569305);});});} \ No newline at end of file +var _0x6461=['info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x1a2c1e,_0x586125){var _0x3c33d8=function(_0x275b55){while(--_0x275b55){_0x1a2c1e['push'](_0x1a2c1e['shift']());}};_0x3c33d8(++_0x586125);}(_0x6461,0x183));var _0x1646=function(_0x5f0002,_0x542528){_0x5f0002=_0x5f0002-0x0;var _0x48327f=_0x6461[_0x5f0002];return _0x48327f;};'use strict';var _=require(_0x1646('0x0'));var util=require(_0x1646('0x1'));var moment=require(_0x1646('0x2'));var BPromise=require(_0x1646('0x3'));var rs=require(_0x1646('0x4'));var fs=require('fs');var Redis=require(_0x1646('0x5'));var db=require(_0x1646('0x6'))['db'];var utils=require(_0x1646('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1646('0x8'));var client=jayson[_0x1646('0x9')][_0x1646('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x473da2,_0x78db66,_0x246ec6){return new BPromise(function(_0x28e1e2,_0x4bd664){return client[_0x1646('0xb')](_0x473da2,_0x246ec6)[_0x1646('0xc')](function(_0x60424){logger[_0x1646('0xd')](_0x1646('0xe'),_0x78db66,_0x1646('0xf'));logger[_0x1646('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x78db66,_0x1646('0xf'),JSON[_0x1646('0x11')](_0x60424));if(_0x60424[_0x1646('0x12')]){if(_0x60424[_0x1646('0x12')]['code']===0x1f4){logger[_0x1646('0x12')](_0x1646('0xe'),_0x78db66,_0x60424[_0x1646('0x12')][_0x1646('0x13')]);return _0x4bd664(_0x60424[_0x1646('0x12')][_0x1646('0x13')]);}logger[_0x1646('0x12')]('VoiceMail,\x20%s,\x20%s',_0x78db66,_0x60424[_0x1646('0x12')][_0x1646('0x13')]);return _0x28e1e2(_0x60424[_0x1646('0x12')]['message']);}else{logger[_0x1646('0xd')](_0x1646('0xe'),_0x78db66,_0x1646('0xf'));_0x28e1e2(_0x60424['result'][_0x1646('0x13')]);}})['catch'](function(_0x4d6257){logger[_0x1646('0x12')](_0x1646('0xe'),_0x78db66,_0x4d6257);_0x4bd664(_0x4d6257);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 40a7840..c24fac6 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 _0x4975=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x295778,_0x2c5891){var _0x117421=function(_0x41bded){while(--_0x41bded){_0x295778['push'](_0x295778['shift']());}};_0x117421(++_0x2c5891);}(_0x4975,0x86));var _0x5497=function(_0x7ee64d,_0x25ea94){_0x7ee64d=_0x7ee64d-0x0;var _0x518c84=_0x4975[_0x7ee64d];return _0x518c84;};'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'));var controller=require(_0x5497('0x8'));router[_0x5497('0x9')]('/',auth[_0x5497('0xa')](),controller['index']);router[_0x5497('0x9')]('/:id',auth[_0x5497('0xa')](),controller[_0x5497('0xb')]);router[_0x5497('0x9')]('/:id/download',auth[_0x5497('0xa')](),controller['download']);router[_0x5497('0xc')]('/',auth[_0x5497('0xa')](),controller[_0x5497('0xd')]);router[_0x5497('0xe')](_0x5497('0xf'),auth[_0x5497('0xa')](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5497('0x12')]=router; \ No newline at end of file +var _0x187d=['../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x187d,0x93));var _0xd187=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x187d[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0x8')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['download']);router[_0xd187('0xe')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['update']);router[_0xd187('0x11')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 4d1e32d..cf1d4e9 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 _0x3d92=['TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','long'];(function(_0x4b1688,_0x2d46fc){var _0x3644b1=function(_0x957312){while(--_0x957312){_0x4b1688['push'](_0x4b1688['shift']());}};_0x3644b1(++_0x2d46fc);}(_0x3d92,0x81));var _0x23d9=function(_0x3d5db9,_0x2dbe0a){_0x3d5db9=_0x3d5db9-0x0;var _0x3c114c=_0x3d92[_0x3d5db9];return _0x3c114c;};'use strict';var Sequelize=require(_0x23d9('0x0'));module[_0x23d9('0x1')]={'name':{'type':Sequelize[_0x23d9('0x2')],'get':function(_0xffe2f2){return this[_0x23d9('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x23d9('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x23d9('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x23d9('0x5')],'defaultValue':''},'stamp':{'type':_0x23d9('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0x632d=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x35ded5,_0x4cd999){var _0x1bd1ee=function(_0xae2c9c){while(--_0xae2c9c){_0x35ded5['push'](_0x35ded5['shift']());}};_0x1bd1ee(++_0x4cd999);}(_0x632d,0x98));var _0xd632=function(_0x1894e7,_0x1253e6){_0x1894e7=_0x1894e7-0x0;var _0x5e857f=_0x632d[_0x1894e7];return _0x5e857f;};'use strict';var Sequelize=require('sequelize');module[_0xd632('0x0')]={'name':{'type':Sequelize[_0xd632('0x1')],'get':function(_0x2a70d5){return this[_0xd632('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd632('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xd632('0x5')](_0xd632('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd632('0x4')],'defaultValue':''},'stamp':{'type':_0xd632('0x7'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c5073f1..02def5b 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 _0x4d9e=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','count','limit','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','offset','order','sort','where','pick','filter','VIRTUAL','findAll','rows','catch','show','params','includeAll','merge','options','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','html-pdf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x4fc6b2,_0x9d98e6){var _0x1ffe03=function(_0x54f46){while(--_0x54f46){_0x4fc6b2['push'](_0x4fc6b2['shift']());}};_0x1ffe03(++_0x9d98e6);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x9c61c7,_0x23e726){_0x9c61c7=_0x9c61c7-0x0;var _0x4a039f=_0x4d9e[_0x9c61c7];return _0x4a039f;};'use strict';var pdf=require(_0xe4d9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe4d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4d9('0x2'));var moment=require('moment');var BPromise=require(_0xe4d9('0x3'));var Mustache=require(_0xe4d9('0x4'));var util=require('util');var path=require(_0xe4d9('0x5'));var sox=require(_0xe4d9('0x6'));var csv=require(_0xe4d9('0x7'));var ejs=require(_0xe4d9('0x8'));var fs=require('fs');var _=require(_0xe4d9('0x9'));var squel=require(_0xe4d9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4d9('0xb'));var deskjs=require(_0xe4d9('0xc'));var toCsv=require(_0xe4d9('0x7'));var querystring=require(_0xe4d9('0xd'));var Papa=require(_0xe4d9('0xe'));var Redis=require(_0xe4d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe4d9('0x10'));var as=require(_0xe4d9('0x11'));var hardwareService=require(_0xe4d9('0x12'));var logger=require(_0xe4d9('0x13'))(_0xe4d9('0x14'));var utils=require(_0xe4d9('0x15'));var config=require(_0xe4d9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ee099,_0x580c50){_0x580c50=_0x580c50||0xcc;return function(_0x4e0d15){if(_0x4e0d15){return _0x5ee099['sendStatus'](_0x580c50);}return _0x5ee099['status'](_0x580c50)['end']();};}function respondWithResult(_0x5649e1,_0x15c0eb){_0x15c0eb=_0x15c0eb||0xc8;return function(_0x3238d4){if(_0x3238d4){return _0x5649e1[_0xe4d9('0x17')](_0x15c0eb)['json'](_0x3238d4);}};}function respondWithFilteredResult(_0x9f0442,_0x3f6ce4){return function(_0xe4f133){if(_0xe4f133){var _0x4283f7=_0xe4f133[_0xe4d9('0x18')],_0x58d0cf=_0x3f6ce4['offset'],_0x331ef3=_0x3f6ce4['offset']+_0x3f6ce4[_0xe4d9('0x19')],_0x35cbc2;if(_0x331ef3>=_0x4283f7){_0x331ef3=_0x4283f7;_0x35cbc2=0xc8;}else{_0x35cbc2=0xce;}_0x9f0442[_0xe4d9('0x17')](_0x35cbc2);return _0x9f0442['set'](_0xe4d9('0x1a'),_0x58d0cf+'-'+_0x331ef3+'/'+_0x4283f7)['json'](_0xe4f133);}return null;};}function patchUpdates(_0x469931){return function(_0x19f8ce){try{jsonpatch[_0xe4d9('0x1b')](_0x19f8ce,_0x469931,!![]);}catch(_0x2522f3){return BPromise['reject'](_0x2522f3);}return _0x19f8ce[_0xe4d9('0x1c')]();};}function saveUpdates(_0x3c2017,_0x151220){return function(_0x171224){if(_0x171224){return _0x171224[_0xe4d9('0x1d')](_0x3c2017)[_0xe4d9('0x1e')](function(_0x30d923){return _0x30d923;});}return null;};}function removeEntity(_0x29e0c9,_0x562bab){return function(_0x4fed7f){if(_0x4fed7f){return _0x4fed7f[_0xe4d9('0x1f')]()[_0xe4d9('0x1e')](function(){_0x29e0c9['status'](0xcc)[_0xe4d9('0x20')]();});}};}function handleEntityNotFound(_0x50d377,_0x14f3d7){return function(_0x125320){if(!_0x125320){_0x50d377['sendStatus'](0x194);}return _0x125320;};}function handleError(_0xfacee3,_0x32e7da){_0x32e7da=_0x32e7da||0x1f4;return function(_0x5b88e9){logger[_0xe4d9('0x21')](_0x5b88e9[_0xe4d9('0x22')]);if(_0x5b88e9[_0xe4d9('0x23')]){delete _0x5b88e9['name'];}_0xfacee3['status'](_0x32e7da)[_0xe4d9('0x24')](_0x5b88e9);};}exports[_0xe4d9('0x25')]=function(_0x52ef56,_0x5dddd2){var _0x4954b5={},_0x529e2b={},_0x221a61={'count':0x0,'rows':[]};var _0x48d481=_[_0xe4d9('0x26')](db[_0xe4d9('0x27')][_0xe4d9('0x28')],function(_0x535200){return{'name':_0x535200[_0xe4d9('0x29')],'type':_0x535200[_0xe4d9('0x2a')][_0xe4d9('0x2b')]};});_0x529e2b[_0xe4d9('0x2c')]=_[_0xe4d9('0x2d')](_[_0xe4d9('0x26')](_0x48d481,_0xe4d9('0x23')),[_0xe4d9('0x23')]);_0x529e2b[_0xe4d9('0x2e')]=_[_0xe4d9('0x2f')](_0x52ef56[_0xe4d9('0x2e')]);_0x529e2b[_0xe4d9('0x30')]=_['intersection'](_0x529e2b[_0xe4d9('0x2c')],_0x529e2b[_0xe4d9('0x2e')]);_0x4954b5[_0xe4d9('0x31')]=_[_0xe4d9('0x32')](_0x529e2b[_0xe4d9('0x2c')],qs[_0xe4d9('0x33')](_0x52ef56['query']['fields']));_0x4954b5['attributes']=_0x4954b5[_0xe4d9('0x31')][_0xe4d9('0x34')]?_0x4954b5[_0xe4d9('0x31')]:_0x529e2b['model'];if(!_0x52ef56['query']['hasOwnProperty']('nolimit')){_0x4954b5[_0xe4d9('0x19')]=qs[_0xe4d9('0x19')](_0x52ef56['query'][_0xe4d9('0x19')]);_0x4954b5[_0xe4d9('0x35')]=qs['offset'](_0x52ef56[_0xe4d9('0x2e')][_0xe4d9('0x35')]);}_0x4954b5[_0xe4d9('0x36')]=qs[_0xe4d9('0x37')](_0x52ef56[_0xe4d9('0x2e')][_0xe4d9('0x37')]);_0x4954b5[_0xe4d9('0x38')]=qs[_0xe4d9('0x30')](_[_0xe4d9('0x39')](_0x52ef56[_0xe4d9('0x2e')],_0x529e2b[_0xe4d9('0x30')]));if(_0x52ef56[_0xe4d9('0x2e')][_0xe4d9('0x3a')]){_0x4954b5[_0xe4d9('0x38')]=_['merge'](_0x4954b5[_0xe4d9('0x38')],{'$or':_[_0xe4d9('0x26')](_0x48d481,function(_0x46f063){if(_0x46f063[_0xe4d9('0x2a')]!==_0xe4d9('0x3b')){var _0x331161={};_0x331161[_0x46f063[_0xe4d9('0x23')]]={'$like':'%'+_0x52ef56[_0xe4d9('0x2e')][_0xe4d9('0x3a')]+'%'};return _0x331161;}})});}_0x4954b5=_['merge']({},_0x4954b5,_0x52ef56['options']);var _0x5f5bc5={'where':_0x4954b5[_0xe4d9('0x38')]};return db[_0xe4d9('0x27')][_0xe4d9('0x18')](_0x5f5bc5)[_0xe4d9('0x1e')](function(_0xd0e919){_0x221a61[_0xe4d9('0x18')]=_0xd0e919;if(_0x52ef56[_0xe4d9('0x2e')]['includeAll']){_0x4954b5['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xe4d9('0x3c')](_0x4954b5);})[_0xe4d9('0x1e')](function(_0x5a908b){_0x221a61[_0xe4d9('0x3d')]=_0x5a908b;return _0x221a61;})[_0xe4d9('0x1e')](respondWithFilteredResult(_0x5dddd2,_0x4954b5))[_0xe4d9('0x3e')](handleError(_0x5dddd2,null));};exports[_0xe4d9('0x3f')]=function(_0x5d0476,_0x2f5423){var _0x348667={'raw':!![],'where':{'id':_0x5d0476[_0xe4d9('0x40')]['id']}},_0x2afa91={};_0x2afa91[_0xe4d9('0x2c')]=_[_0xe4d9('0x2f')](db[_0xe4d9('0x27')][_0xe4d9('0x28')]);_0x2afa91[_0xe4d9('0x2e')]=_[_0xe4d9('0x2f')](_0x5d0476[_0xe4d9('0x2e')]);_0x2afa91['filters']=_[_0xe4d9('0x32')](_0x2afa91[_0xe4d9('0x2c')],_0x2afa91[_0xe4d9('0x2e')]);_0x348667[_0xe4d9('0x31')]=_[_0xe4d9('0x32')](_0x2afa91['model'],qs[_0xe4d9('0x33')](_0x5d0476[_0xe4d9('0x2e')][_0xe4d9('0x33')]));_0x348667[_0xe4d9('0x31')]=_0x348667[_0xe4d9('0x31')][_0xe4d9('0x34')]?_0x348667[_0xe4d9('0x31')]:_0x2afa91[_0xe4d9('0x2c')];if(_0x5d0476[_0xe4d9('0x2e')][_0xe4d9('0x41')]){_0x348667['include']=[{'all':!![]}];}_0x348667=_[_0xe4d9('0x42')]({},_0x348667,_0x5d0476[_0xe4d9('0x43')]);return db[_0xe4d9('0x27')]['find'](_0x348667)[_0xe4d9('0x1e')](handleEntityNotFound(_0x2f5423,null))[_0xe4d9('0x1e')](respondWithResult(_0x2f5423,null))[_0xe4d9('0x3e')](handleError(_0x2f5423,null));};exports[_0xe4d9('0x44')]=function(_0x1e0b7b,_0x3e4587){return db[_0xe4d9('0x27')]['create'](_0x1e0b7b[_0xe4d9('0x45')],{})[_0xe4d9('0x1e')](respondWithResult(_0x3e4587,0xc9))[_0xe4d9('0x3e')](handleError(_0x3e4587,null));};exports[_0xe4d9('0x1d')]=function(_0x12e3e6,_0x423881){if(_0x12e3e6['body']['id']){delete _0x12e3e6[_0xe4d9('0x45')]['id'];}return db[_0xe4d9('0x27')][_0xe4d9('0x46')]({'where':{'id':_0x12e3e6[_0xe4d9('0x40')]['id']}})[_0xe4d9('0x1e')](handleEntityNotFound(_0x423881,null))[_0xe4d9('0x1e')](saveUpdates(_0x12e3e6['body'],null))[_0xe4d9('0x1e')](respondWithResult(_0x423881,null))[_0xe4d9('0x3e')](handleError(_0x423881,null));};exports['destroy']=function(_0x3eccd4,_0x4c913d){return db[_0xe4d9('0x27')][_0xe4d9('0x46')]({'where':{'id':_0x3eccd4['params']['id']}})[_0xe4d9('0x1e')](handleEntityNotFound(_0x4c913d,null))['then'](removeEntity(_0x4c913d,null))[_0xe4d9('0x3e')](handleError(_0x4c913d,null));};exports[_0xe4d9('0x47')]=function(_0x260917,_0x48b9fa,_0x39634c){return db[_0xe4d9('0x27')]['find']({'where':{'id':_0x260917[_0xe4d9('0x40')]['id']},'attributes':['id',_0xe4d9('0x48'),_0xe4d9('0x49')]})[_0xe4d9('0x1e')](handleEntityNotFound(_0x48b9fa,null))['then'](function(_0x50f513){if(_0x50f513){if(!_0x50f513[_0xe4d9('0x48')]){throw new db[(_0xe4d9('0x4a'))][(_0xe4d9('0x4b'))](_0xe4d9('0x4c'));}var _0x27dea6={'Content-Type':_0xe4d9('0x4d'),'Content-Disposition':'attachment'};if(_0x50f513['msg_id']){_0x27dea6[_0xe4d9('0x4e')]=_0xe4d9('0x4f')+_0x50f513[_0xe4d9('0x49')]+_0xe4d9('0x50');}_0x48b9fa[_0xe4d9('0x51')](_0x27dea6);return _0x48b9fa[_0xe4d9('0x24')](new Buffer(_0x50f513['recording']));}})[_0xe4d9('0x3e')](handleError(_0x48b9fa,null));}; \ No newline at end of file +var _0x0faf=['send','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','filters','intersection','model','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','VoiceMailMessage','count','includeAll','include','rows','catch','show','params','attributes','fields','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','msg_id','.wav\x22','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x281daf,_0x4d30b6){var _0x37ac32=function(_0x5f3143){while(--_0x5f3143){_0x281daf['push'](_0x281daf['shift']());}};_0x37ac32(++_0x4d30b6);}(_0x0faf,0x132));var _0xf0fa=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x0faf[_0x2665a3];return _0x586de6;};'use strict';var pdf=require(_0xf0fa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf0fa('0x1'));var zipdir=require(_0xf0fa('0x2'));var jsonpatch=require(_0xf0fa('0x3'));var rp=require(_0xf0fa('0x4'));var moment=require(_0xf0fa('0x5'));var BPromise=require(_0xf0fa('0x6'));var Mustache=require(_0xf0fa('0x7'));var util=require(_0xf0fa('0x8'));var path=require(_0xf0fa('0x9'));var sox=require('sox');var csv=require(_0xf0fa('0xa'));var ejs=require(_0xf0fa('0xb'));var fs=require('fs');var _=require(_0xf0fa('0xc'));var squel=require(_0xf0fa('0xd'));var crypto=require(_0xf0fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf0fa('0xf'));var toCsv=require(_0xf0fa('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0fa('0x10'));var authService=require(_0xf0fa('0x11'));var qs=require(_0xf0fa('0x12'));var as=require(_0xf0fa('0x13'));var hardwareService=require(_0xf0fa('0x14'));var logger=require(_0xf0fa('0x15'))(_0xf0fa('0x16'));var utils=require(_0xf0fa('0x17'));var config=require('../../config/environment');var db=require(_0xf0fa('0x18'))['db'];function respondWithStatusCode(_0x5b38fa,_0x2f46ff){_0x2f46ff=_0x2f46ff||0xcc;return function(_0x521034){if(_0x521034){return _0x5b38fa[_0xf0fa('0x19')](_0x2f46ff);}return _0x5b38fa[_0xf0fa('0x1a')](_0x2f46ff)[_0xf0fa('0x1b')]();};}function respondWithResult(_0x547952,_0x5821ae){_0x5821ae=_0x5821ae||0xc8;return function(_0x42591b){if(_0x42591b){return _0x547952['status'](_0x5821ae)[_0xf0fa('0x1c')](_0x42591b);}};}function respondWithFilteredResult(_0x81fc49,_0x10ce43){return function(_0x3203ce){if(_0x3203ce){var _0x467d5f=_0x3203ce['count'],_0x33df80=_0x10ce43[_0xf0fa('0x1d')],_0x28bab8=_0x10ce43[_0xf0fa('0x1d')]+_0x10ce43[_0xf0fa('0x1e')],_0x3f3bb7;if(_0x28bab8>=_0x467d5f){_0x28bab8=_0x467d5f;_0x3f3bb7=0xc8;}else{_0x3f3bb7=0xce;}_0x81fc49[_0xf0fa('0x1a')](_0x3f3bb7);return _0x81fc49[_0xf0fa('0x1f')](_0xf0fa('0x20'),_0x33df80+'-'+_0x28bab8+'/'+_0x467d5f)['json'](_0x3203ce);}return null;};}function patchUpdates(_0x56ef81){return function(_0x2f376d){try{jsonpatch[_0xf0fa('0x21')](_0x2f376d,_0x56ef81,!![]);}catch(_0x151d09){return BPromise[_0xf0fa('0x22')](_0x151d09);}return _0x2f376d[_0xf0fa('0x23')]();};}function saveUpdates(_0x403e7d,_0x32c9bc){return function(_0x3de639){if(_0x3de639){return _0x3de639[_0xf0fa('0x24')](_0x403e7d)[_0xf0fa('0x25')](function(_0x1878c4){return _0x1878c4;});}return null;};}function removeEntity(_0x5bead8,_0x10c93e){return function(_0x306f3e){if(_0x306f3e){return _0x306f3e[_0xf0fa('0x26')]()[_0xf0fa('0x25')](function(){_0x5bead8[_0xf0fa('0x1a')](0xcc)[_0xf0fa('0x1b')]();});}};}function handleEntityNotFound(_0x3901aa,_0x1f0eaf){return function(_0x3feb0c){if(!_0x3feb0c){_0x3901aa['sendStatus'](0x194);}return _0x3feb0c;};}function handleError(_0xeb86a9,_0x19e392){_0x19e392=_0x19e392||0x1f4;return function(_0x56134e){logger[_0xf0fa('0x27')](_0x56134e[_0xf0fa('0x28')]);if(_0x56134e[_0xf0fa('0x29')]){delete _0x56134e['name'];}_0xeb86a9[_0xf0fa('0x1a')](_0x19e392)[_0xf0fa('0x2a')](_0x56134e);};}exports[_0xf0fa('0x2b')]=function(_0xf631f6,_0x4e6eef){var _0x4be235={},_0x287810={},_0x1c5eaf={'count':0x0,'rows':[]};var _0x1679cf=_[_0xf0fa('0x2c')](db['VoiceMailMessage'][_0xf0fa('0x2d')],function(_0x409a8c){return{'name':_0x409a8c[_0xf0fa('0x2e')],'type':_0x409a8c['type'][_0xf0fa('0x2f')]};});_0x287810['model']=_[_0xf0fa('0x30')](_[_0xf0fa('0x2c')](_0x1679cf,_0xf0fa('0x29')),['name']);_0x287810[_0xf0fa('0x31')]=_[_0xf0fa('0x32')](_0xf631f6[_0xf0fa('0x31')]);_0x287810[_0xf0fa('0x33')]=_[_0xf0fa('0x34')](_0x287810[_0xf0fa('0x35')],_0x287810['query']);_0x4be235['attributes']=_[_0xf0fa('0x34')](_0x287810[_0xf0fa('0x35')],qs['fields'](_0xf631f6[_0xf0fa('0x31')]['fields']));_0x4be235['attributes']=_0x4be235['attributes'][_0xf0fa('0x36')]?_0x4be235['attributes']:_0x287810[_0xf0fa('0x35')];if(!_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x37')](_0xf0fa('0x38'))){_0x4be235[_0xf0fa('0x1e')]=qs[_0xf0fa('0x1e')](_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x1e')]);_0x4be235['offset']=qs[_0xf0fa('0x1d')](_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x1d')]);}_0x4be235['order']=qs[_0xf0fa('0x39')](_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x39')]);_0x4be235[_0xf0fa('0x3a')]=qs['filters'](_['pick'](_0xf631f6[_0xf0fa('0x31')],_0x287810[_0xf0fa('0x33')]));if(_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x3b')]){_0x4be235[_0xf0fa('0x3a')]=_['merge'](_0x4be235['where'],{'$or':_['map'](_0x1679cf,function(_0x596c2a){if(_0x596c2a[_0xf0fa('0x3c')]!==_0xf0fa('0x3d')){var _0x5ef93e={};_0x5ef93e[_0x596c2a['name']]={'$like':'%'+_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x3b')]+'%'};return _0x5ef93e;}})});}_0x4be235=_[_0xf0fa('0x3e')]({},_0x4be235,_0xf631f6[_0xf0fa('0x3f')]);var _0x2202de={'where':_0x4be235[_0xf0fa('0x3a')]};return db[_0xf0fa('0x40')]['count'](_0x2202de)['then'](function(_0x344bb0){_0x1c5eaf[_0xf0fa('0x41')]=_0x344bb0;if(_0xf631f6[_0xf0fa('0x31')][_0xf0fa('0x42')]){_0x4be235[_0xf0fa('0x43')]=[{'all':!![]}];}return db[_0xf0fa('0x40')]['findAll'](_0x4be235);})[_0xf0fa('0x25')](function(_0x5b0bed){_0x1c5eaf[_0xf0fa('0x44')]=_0x5b0bed;return _0x1c5eaf;})[_0xf0fa('0x25')](respondWithFilteredResult(_0x4e6eef,_0x4be235))[_0xf0fa('0x45')](handleError(_0x4e6eef,null));};exports[_0xf0fa('0x46')]=function(_0x14bee8,_0x8cce53){var _0x14c962={'raw':!![],'where':{'id':_0x14bee8[_0xf0fa('0x47')]['id']}},_0x36778f={};_0x36778f['model']=_['keys'](db['VoiceMailMessage'][_0xf0fa('0x2d')]);_0x36778f[_0xf0fa('0x31')]=_['keys'](_0x14bee8[_0xf0fa('0x31')]);_0x36778f[_0xf0fa('0x33')]=_[_0xf0fa('0x34')](_0x36778f[_0xf0fa('0x35')],_0x36778f['query']);_0x14c962[_0xf0fa('0x48')]=_[_0xf0fa('0x34')](_0x36778f[_0xf0fa('0x35')],qs[_0xf0fa('0x49')](_0x14bee8[_0xf0fa('0x31')][_0xf0fa('0x49')]));_0x14c962[_0xf0fa('0x48')]=_0x14c962[_0xf0fa('0x48')][_0xf0fa('0x36')]?_0x14c962['attributes']:_0x36778f[_0xf0fa('0x35')];if(_0x14bee8[_0xf0fa('0x31')][_0xf0fa('0x42')]){_0x14c962[_0xf0fa('0x43')]=[{'all':!![]}];}_0x14c962=_[_0xf0fa('0x3e')]({},_0x14c962,_0x14bee8[_0xf0fa('0x3f')]);return db['VoiceMailMessage'][_0xf0fa('0x4a')](_0x14c962)[_0xf0fa('0x25')](handleEntityNotFound(_0x8cce53,null))['then'](respondWithResult(_0x8cce53,null))[_0xf0fa('0x45')](handleError(_0x8cce53,null));};exports[_0xf0fa('0x4b')]=function(_0x166b17,_0x14cbe4){return db[_0xf0fa('0x40')][_0xf0fa('0x4b')](_0x166b17[_0xf0fa('0x4c')],{})[_0xf0fa('0x25')](respondWithResult(_0x14cbe4,0xc9))[_0xf0fa('0x45')](handleError(_0x14cbe4,null));};exports['update']=function(_0x32ac29,_0x4b1f41){if(_0x32ac29[_0xf0fa('0x4c')]['id']){delete _0x32ac29[_0xf0fa('0x4c')]['id'];}return db[_0xf0fa('0x40')]['find']({'where':{'id':_0x32ac29[_0xf0fa('0x47')]['id']}})[_0xf0fa('0x25')](handleEntityNotFound(_0x4b1f41,null))[_0xf0fa('0x25')](saveUpdates(_0x32ac29[_0xf0fa('0x4c')],null))[_0xf0fa('0x25')](respondWithResult(_0x4b1f41,null))['catch'](handleError(_0x4b1f41,null));};exports[_0xf0fa('0x26')]=function(_0x4cda3e,_0x19c22f){return db[_0xf0fa('0x40')][_0xf0fa('0x4a')]({'where':{'id':_0x4cda3e[_0xf0fa('0x47')]['id']}})[_0xf0fa('0x25')](handleEntityNotFound(_0x19c22f,null))['then'](removeEntity(_0x19c22f,null))[_0xf0fa('0x45')](handleError(_0x19c22f,null));};exports[_0xf0fa('0x4d')]=function(_0x26b1dc,_0x401995,_0x1002e1){return db[_0xf0fa('0x40')]['find']({'where':{'id':_0x26b1dc[_0xf0fa('0x47')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x401995,null))[_0xf0fa('0x25')](function(_0x31b4b0){if(_0x31b4b0){if(!_0x31b4b0[_0xf0fa('0x4e')]){throw new db[(_0xf0fa('0x4f'))][(_0xf0fa('0x50'))](_0xf0fa('0x51'));}var _0x3c269c={'Content-Type':_0xf0fa('0x52'),'Content-Disposition':_0xf0fa('0x53')};if(_0x31b4b0['msg_id']){_0x3c269c[_0xf0fa('0x54')]='attachment;\x20filename=\x22'+_0x31b4b0[_0xf0fa('0x55')]+_0xf0fa('0x56');}_0x401995[_0xf0fa('0x1f')](_0x3c269c);return _0x401995[_0xf0fa('0x2a')](new Buffer(_0x31b4b0['recording']));}})[_0xf0fa('0x45')](handleError(_0x401995,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 97e7493..77bca2e 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 _0x3303=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x466823,_0x4a7e7a){var _0x1c4f80=function(_0x221367){while(--_0x221367){_0x466823['push'](_0x466823['shift']());}};_0x1c4f80(++_0x4a7e7a);}(_0x3303,0xc5));var _0x3330=function(_0x4d7c20,_0x441a07){_0x4d7c20=_0x4d7c20-0x0;var _0x23982f=_0x3303[_0x4d7c20];return _0x23982f;};'use strict';var _=require(_0x3330('0x0'));var util=require(_0x3330('0x1'));var logger=require(_0x3330('0x2'))(_0x3330('0x3'));var moment=require(_0x3330('0x4'));var BPromise=require(_0x3330('0x5'));var rp=require(_0x3330('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3330('0x7'));var config=require(_0x3330('0x8'));var attributes=require(_0x3330('0x9'));module[_0x3330('0xa')]=function(_0x473b4c,_0x2a5fb3){return _0x473b4c[_0x3330('0xb')](_0x3330('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3330('0xd'),'fields':[_0x3330('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xdd6f=['request-promise','path','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4215a2,_0x19da25){var _0x525bb6=function(_0x320a8e){while(--_0x320a8e){_0x4215a2['push'](_0x4215a2['shift']());}};_0x525bb6(++_0x19da25);}(_0xdd6f,0x19e));var _0xfdd6=function(_0x4258ca,_0x1d4b96){_0x4258ca=_0x4258ca-0x0;var _0x13a6c1=_0xdd6f[_0x4258ca];return _0x13a6c1;};'use strict';var _=require(_0xfdd6('0x0'));var util=require(_0xfdd6('0x1'));var logger=require(_0xfdd6('0x2'))(_0xfdd6('0x3'));var moment=require(_0xfdd6('0x4'));var BPromise=require(_0xfdd6('0x5'));var rp=require(_0xfdd6('0x6'));var fs=require('fs');var path=require(_0xfdd6('0x7'));var rimraf=require('rimraf');var config=require(_0xfdd6('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0xfdd6('0x9')]=function(_0x5a625f,_0x3f1075){return _0x5a625f[_0xfdd6('0xa')](_0xfdd6('0xb'),attributes,{'tableName':_0xfdd6('0xc'),'paranoid':![],'indexes':[{'name':_0xfdd6('0xd'),'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 7a595a9..1e74e1d 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 _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3a7b46,_0x5d26da){var _0x485212=function(_0x3660f2){while(--_0x3660f2){_0x3a7b46['push'](_0x3a7b46['shift']());}};_0x485212(++_0x5d26da);}(_0x57ca,0x108));var _0xa57c=function(_0xff1f39,_0x47d81f){_0xff1f39=_0xff1f39-0x0;var _0x1b0cdb=_0x57ca[_0xff1f39];return _0x1b0cdb;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x38f34e,_0x287825){var _0x3f3adf=function(_0x40c089){while(--_0x40c089){_0x38f34e['push'](_0x38f34e['shift']());}};_0x3f3adf(++_0x287825);}(_0x2ef3,0xba));var _0x32ef=function(_0x58f691,_0x2c0d9f){_0x58f691=_0x58f691-0x0;var _0x5e3039=_0x2ef3[_0x58f691];return _0x5e3039;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3d8643b..6eabaee 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 _0x6682=['../../config/environment','./voiceMusicOnHold.controller','index','/:id','get','isAuthenticated','getSounds','post','/:id/sounds','put','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2fde53,_0x3099d7){var _0x29824f=function(_0x1e3f5d){while(--_0x1e3f5d){_0x2fde53['push'](_0x2fde53['shift']());}};_0x29824f(++_0x3099d7);}(_0x6682,0xa9));var _0x2668=function(_0x4a69cc,_0x360321){_0x4a69cc=_0x4a69cc-0x0;var _0x1e8283=_0x6682[_0x4a69cc];return _0x1e8283;};'use strict';var multer=require(_0x2668('0x0'));var util=require(_0x2668('0x1'));var path=require(_0x2668('0x2'));var timeout=require('connect-timeout');var express=require(_0x2668('0x3'));var router=express[_0x2668('0x4')]();var auth=require(_0x2668('0x5'));var interaction=require(_0x2668('0x6'));var config=require(_0x2668('0x7'));var controller=require(_0x2668('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2668('0x9')]);router['get'](_0x2668('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2668('0xb')]('/:id/sounds',auth[_0x2668('0xc')](),controller[_0x2668('0xd')]);router[_0x2668('0xe')]('/',auth[_0x2668('0xc')](),controller['create']);router['post'](_0x2668('0xf'),auth[_0x2668('0xc')](),controller['addSound']);router[_0x2668('0x10')](_0x2668('0xa'),auth[_0x2668('0xc')](),controller['update']);router['delete'](_0x2668('0xa'),auth[_0x2668('0xc')](),controller[_0x2668('0x11')]);router[_0x2668('0x12')](_0x2668('0x13'),auth[_0x2668('0xc')](),controller[_0x2668('0x14')]);module[_0x2668('0x15')]=router; \ No newline at end of file +var _0x5ebc=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','show','/:id/sounds','getSounds','post','addSound','put','/:id','destroy','delete','/:id/sounds/:id2','removeSound'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x5ebc,0x1a4));var _0xc5eb=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5ebc[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xc5eb('0x0'));var util=require(_0xc5eb('0x1'));var path=require(_0xc5eb('0x2'));var timeout=require(_0xc5eb('0x3'));var express=require('express');var router=express[_0xc5eb('0x4')]();var auth=require(_0xc5eb('0x5'));var interaction=require(_0xc5eb('0x6'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xc5eb('0x7')](),controller['index']);router[_0xc5eb('0x8')]('/:id',auth[_0xc5eb('0x7')](),controller[_0xc5eb('0x9')]);router[_0xc5eb('0x8')](_0xc5eb('0xa'),auth[_0xc5eb('0x7')](),controller[_0xc5eb('0xb')]);router[_0xc5eb('0xc')]('/',auth[_0xc5eb('0x7')](),controller['create']);router[_0xc5eb('0xc')]('/:id/sounds',auth[_0xc5eb('0x7')](),controller[_0xc5eb('0xd')]);router[_0xc5eb('0xe')]('/:id',auth[_0xc5eb('0x7')](),controller['update']);router['delete'](_0xc5eb('0xf'),auth[_0xc5eb('0x7')](),controller[_0xc5eb('0x10')]);router[_0xc5eb('0x11')](_0xc5eb('0x12'),auth[_0xc5eb('0x7')](),controller[_0xc5eb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1b51f87..cdacb1b 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 _0x10bb=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x49832f,_0x3ad1b0){var _0x2a2f56=function(_0x57219c){while(--_0x57219c){_0x49832f['push'](_0x49832f['shift']());}};_0x2a2f56(++_0x3ad1b0);}(_0x10bb,0x1a6));var _0xb10b=function(_0x543cd8,_0x4c5dc3){_0x543cd8=_0x543cd8-0x0;var _0x64622b=_0x10bb[_0x543cd8];return _0x64622b;};'use strict';var Sequelize=require(_0xb10b('0x0'));module[_0xb10b('0x1')]={'name':{'type':Sequelize[_0xb10b('0x2')],'allowNull':![],'unique':_0xb10b('0x3')},'mode':{'type':Sequelize[_0xb10b('0x4')](_0xb10b('0x5'),_0xb10b('0x6'),_0xb10b('0x7'),_0xb10b('0x8'),_0xb10b('0x9'),'mp3'),'allowNull':!![],'defaultValue':_0xb10b('0x6')},'directory':{'type':Sequelize[_0xb10b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xb10b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb10b('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb10b('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xb10b('0x2')],'allowNull':!![]},'stamp':{'type':_0xb10b('0xa')},'defaultEntry':{'type':Sequelize[_0xb10b('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6256=['exports','STRING','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x31f29c,_0x300853){var _0x1bb741=function(_0x1d63af){while(--_0x1d63af){_0x31f29c['push'](_0x31f29c['shift']());}};_0x1bb741(++_0x300853);}(_0x6256,0xdc));var _0x6625=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x6256[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0x6625('0x0'));module[_0x6625('0x1')]={'name':{'type':Sequelize[_0x6625('0x2')],'allowNull':![],'unique':_0x6625('0x3')},'mode':{'type':Sequelize[_0x6625('0x4')](_0x6625('0x5'),_0x6625('0x6'),'mp3nb',_0x6625('0x7'),_0x6625('0x8'),_0x6625('0x9')),'allowNull':!![],'defaultValue':_0x6625('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x6625('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6625('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6625('0x2')],'allowNull':!![],'defaultValue':_0x6625('0xa')},'format':{'type':Sequelize[_0x6625('0x2')],'allowNull':!![]},'stamp':{'type':_0x6625('0xb')},'defaultEntry':{'type':Sequelize[_0x6625('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 2f7adcd..bf0054e 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 _0x5524=['hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','keys','intersection','fields','length','nolimit','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','catch','params','attributes','body','find','create','sequelize','transaction','mode','join','server/files/moh','files','mkdirSync','directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MusicOnHolds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','root','server/files/sounds/converted','format','%s.%s','extname','removeSound','id2','createdAt','getSounds','order'];(function(_0x1d2d4c,_0x340107){var _0x58ed56=function(_0xf95ad){while(--_0xf95ad){_0x1d2d4c['push'](_0x1d2d4c['shift']());}};_0x58ed56(++_0x340107);}(_0x5524,0x6f));var _0x4552=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5524[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x4552('0x0'));var emlformat=require(_0x4552('0x1'));var rimraf=require(_0x4552('0x2'));var zipdir=require(_0x4552('0x3'));var jsonpatch=require(_0x4552('0x4'));var rp=require(_0x4552('0x5'));var moment=require(_0x4552('0x6'));var BPromise=require(_0x4552('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4552('0x8'));var sox=require('sox');var csv=require(_0x4552('0x9'));var ejs=require(_0x4552('0xa'));var fs=require('fs');var _=require(_0x4552('0xb'));var squel=require(_0x4552('0xc'));var crypto=require(_0x4552('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4552('0x9'));var querystring=require('querystring');var Papa=require(_0x4552('0xe'));var Redis=require(_0x4552('0xf'));var authService=require(_0x4552('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4552('0x11'));var hardwareService=require(_0x4552('0x12'));var logger=require(_0x4552('0x13'))(_0x4552('0x14'));var utils=require(_0x4552('0x15'));var config=require(_0x4552('0x16'));var db=require(_0x4552('0x17'))['db'];function respondWithStatusCode(_0x26ffaa,_0x144326){_0x144326=_0x144326||0xcc;return function(_0x9e5ea0){if(_0x9e5ea0){return _0x26ffaa[_0x4552('0x18')](_0x144326);}return _0x26ffaa[_0x4552('0x19')](_0x144326)[_0x4552('0x1a')]();};}function respondWithResult(_0xf475e,_0x19929d){_0x19929d=_0x19929d||0xc8;return function(_0x57700b){if(_0x57700b){return _0xf475e[_0x4552('0x19')](_0x19929d)[_0x4552('0x1b')](_0x57700b);}};}function respondWithFilteredResult(_0x171260,_0x259288){return function(_0x19c5b8){if(_0x19c5b8){var _0x4e93c9=_0x19c5b8[_0x4552('0x1c')],_0x9b0322=_0x259288[_0x4552('0x1d')],_0x49e989=_0x259288[_0x4552('0x1d')]+_0x259288[_0x4552('0x1e')],_0x1e074b;if(_0x49e989>=_0x4e93c9){_0x49e989=_0x4e93c9;_0x1e074b=0xc8;}else{_0x1e074b=0xce;}_0x171260[_0x4552('0x19')](_0x1e074b);return _0x171260[_0x4552('0x1f')]('Content-Range',_0x9b0322+'-'+_0x49e989+'/'+_0x4e93c9)['json'](_0x19c5b8);}return null;};}function patchUpdates(_0x32812c){return function(_0x264c94){try{jsonpatch[_0x4552('0x20')](_0x264c94,_0x32812c,!![]);}catch(_0x21b9e9){return BPromise[_0x4552('0x21')](_0x21b9e9);}return _0x264c94[_0x4552('0x22')]();};}function saveUpdates(_0x1d30d5,_0x50ebcb){return function(_0x266683){if(_0x266683){return _0x266683[_0x4552('0x23')](_0x1d30d5)[_0x4552('0x24')](function(_0x30bd94){return _0x30bd94;});}return null;};}function removeEntity(_0x5eca3d,_0x1e991a){return function(_0x47f885){if(_0x47f885){return _0x47f885['destroy']()[_0x4552('0x24')](function(){var _0x20b247=_0x47f885[_0x4552('0x25')]({'plain':!![]});var _0x5c96d7='MusicOnHolds';return db[_0x4552('0x26')][_0x4552('0x27')]({'where':{'type':_0x5c96d7,'resourceId':_0x20b247['id']}})['then'](function(){return _0x47f885;});})[_0x4552('0x24')](function(){_0x5eca3d[_0x4552('0x19')](0xcc)[_0x4552('0x1a')]();});}};}function handleEntityNotFound(_0x2e0869,_0x2b9b5a){return function(_0x1fb39c){if(!_0x1fb39c){_0x2e0869[_0x4552('0x18')](0x194);}return _0x1fb39c;};}function handleError(_0x33b9a5,_0x41873c){_0x41873c=_0x41873c||0x1f4;return function(_0x5a6476){logger['error'](_0x5a6476[_0x4552('0x28')]);if(_0x5a6476[_0x4552('0x29')]){delete _0x5a6476[_0x4552('0x29')];}_0x33b9a5[_0x4552('0x19')](_0x41873c)['send'](_0x5a6476);};}exports[_0x4552('0x2a')]=function(_0x344753,_0x7553db){var _0x14e55e={},_0x4cec2c={},_0x3609bb={'count':0x0,'rows':[]};var _0x1e2686=_[_0x4552('0x2b')](db[_0x4552('0x2c')][_0x4552('0x2d')],function(_0x28bb56){return{'name':_0x28bb56[_0x4552('0x2e')],'type':_0x28bb56['type'][_0x4552('0x2f')]};});_0x4cec2c[_0x4552('0x30')]=_[_0x4552('0x2b')](_0x1e2686,_0x4552('0x29'));_0x4cec2c[_0x4552('0x31')]=_[_0x4552('0x32')](_0x344753[_0x4552('0x31')]);_0x4cec2c['filters']=_[_0x4552('0x33')](_0x4cec2c[_0x4552('0x30')],_0x4cec2c[_0x4552('0x31')]);_0x14e55e['attributes']=_[_0x4552('0x33')](_0x4cec2c['model'],qs[_0x4552('0x34')](_0x344753['query'][_0x4552('0x34')]));_0x14e55e['attributes']=_0x14e55e['attributes'][_0x4552('0x35')]?_0x14e55e['attributes']:_0x4cec2c[_0x4552('0x30')];if(!_0x344753[_0x4552('0x31')]['hasOwnProperty'](_0x4552('0x36'))){_0x14e55e[_0x4552('0x1e')]=qs[_0x4552('0x1e')](_0x344753[_0x4552('0x31')]['limit']);_0x14e55e[_0x4552('0x1d')]=qs[_0x4552('0x1d')](_0x344753[_0x4552('0x31')][_0x4552('0x1d')]);}_0x14e55e['order']=qs[_0x4552('0x37')](_0x344753[_0x4552('0x31')][_0x4552('0x37')]);_0x14e55e['where']=qs[_0x4552('0x38')](_[_0x4552('0x39')](_0x344753[_0x4552('0x31')],_0x4cec2c[_0x4552('0x38')]));if(_0x344753[_0x4552('0x31')]['filter']){_0x14e55e[_0x4552('0x3a')]=_['merge'](_0x14e55e['where'],{'$or':_[_0x4552('0x2b')](_0x1e2686,function(_0x48b36e){if(_0x48b36e['type']!==_0x4552('0x3b')){var _0x2bc602={};_0x2bc602[_0x48b36e[_0x4552('0x29')]]={'$like':'%'+_0x344753[_0x4552('0x31')][_0x4552('0x3c')]+'%'};return _0x2bc602;}})});}_0x14e55e=_[_0x4552('0x3d')]({},_0x14e55e,_0x344753[_0x4552('0x3e')]);var _0x4f6c1a={'where':_0x14e55e[_0x4552('0x3a')]};return db[_0x4552('0x2c')][_0x4552('0x1c')](_0x4f6c1a)[_0x4552('0x24')](function(_0x341160){_0x3609bb['count']=_0x341160;if(_0x344753[_0x4552('0x31')][_0x4552('0x3f')]){_0x14e55e[_0x4552('0x40')]=[{'all':!![]}];}return db[_0x4552('0x2c')]['findAll'](_0x14e55e);})[_0x4552('0x24')](function(_0x114cf7){_0x3609bb['rows']=_0x114cf7;return _0x3609bb;})['then'](respondWithFilteredResult(_0x7553db,_0x14e55e))[_0x4552('0x41')](handleError(_0x7553db,null));};exports['show']=function(_0x558d7b,_0x4e4f75){var _0x21e927={'raw':![],'where':{'id':_0x558d7b[_0x4552('0x42')]['id']}},_0xa5997={};_0xa5997[_0x4552('0x30')]=_['keys'](db[_0x4552('0x2c')][_0x4552('0x2d')]);_0xa5997['query']=_[_0x4552('0x32')](_0x558d7b[_0x4552('0x31')]);_0xa5997[_0x4552('0x38')]=_[_0x4552('0x33')](_0xa5997[_0x4552('0x30')],_0xa5997[_0x4552('0x31')]);_0x21e927[_0x4552('0x43')]=_[_0x4552('0x33')](_0xa5997['model'],qs[_0x4552('0x34')](_0x558d7b[_0x4552('0x31')][_0x4552('0x34')]));_0x21e927[_0x4552('0x43')]=_0x21e927[_0x4552('0x43')][_0x4552('0x35')]?_0x21e927[_0x4552('0x43')]:_0xa5997[_0x4552('0x30')];if(_0x558d7b[_0x4552('0x31')]['includeAll']){_0x21e927[_0x4552('0x40')]=[{'all':!![]}];}_0x21e927=_[_0x4552('0x3d')]({},_0x21e927,_0x558d7b['options']);return db[_0x4552('0x2c')]['find'](_0x21e927)[_0x4552('0x24')](handleEntityNotFound(_0x4e4f75,null))[_0x4552('0x24')](respondWithResult(_0x4e4f75,null))[_0x4552('0x41')](handleError(_0x4e4f75,null));};exports[_0x4552('0x23')]=function(_0x31e2dd,_0x5887e4){if(_0x31e2dd[_0x4552('0x44')]['id']){delete _0x31e2dd[_0x4552('0x44')]['id'];}return db['VoiceMusicOnHold'][_0x4552('0x45')]({'where':{'id':_0x31e2dd['params']['id']}})['then'](handleEntityNotFound(_0x5887e4,null))[_0x4552('0x24')](saveUpdates(_0x31e2dd[_0x4552('0x44')],null))['then'](respondWithResult(_0x5887e4,null))[_0x4552('0x41')](handleError(_0x5887e4,null));};exports[_0x4552('0x46')]=function(_0x3be01c,_0x5e4e7d,_0x9db268){return db[_0x4552('0x47')][_0x4552('0x48')](function(_0x4f80db){if(_0x3be01c[_0x4552('0x44')][_0x4552('0x49')]==='files'){_0x3be01c['body']['directory']=path[_0x4552('0x4a')](config['root'],_0x4552('0x4b'),_0x3be01c[_0x4552('0x44')]['name']);}return db[_0x4552('0x2c')][_0x4552('0x46')](_0x3be01c['body'],{'transaction':_0x4f80db})[_0x4552('0x24')](function(_0xcf17d9){if(_0x3be01c[_0x4552('0x44')][_0x4552('0x49')]===_0x4552('0x4c')){fs[_0x4552('0x4d')](_0xcf17d9[_0x4552('0x4e')],parseInt(_0x4552('0x4f'),0x8));}var _0x48d312=_0x3be01c['user'][_0x4552('0x25')]({'plain':!![]});if(!_0x48d312)throw new Error(_0x4552('0x50'));if(_0x48d312[_0x4552('0x51')]===_0x4552('0x52')){var _0x4ceb95=_0xcf17d9[_0x4552('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x4552('0x45')]({'where':{'name':_0x4552('0x53'),'userProfileId':_0x48d312[_0x4552('0x54')]},'raw':!![]})[_0x4552('0x24')](function(_0x5dd094){if(_0x5dd094&&_0x5dd094[_0x4552('0x55')]===0x0){return db[_0x4552('0x26')][_0x4552('0x46')]({'name':_0x4ceb95[_0x4552('0x29')],'resourceId':_0x4ceb95['id'],'type':_0x5dd094[_0x4552('0x29')],'sectionId':_0x5dd094['id']},{})[_0x4552('0x24')](function(){return _0xcf17d9;});}else{return _0xcf17d9;}})[_0x4552('0x41')](function(_0x1551d7){logger[_0x4552('0x56')](_0x4552('0x57'),_0x1551d7);});}return _0xcf17d9;});})['then'](respondWithResult(_0x5e4e7d,0xc9))['catch'](handleError(_0x5e4e7d,null));};exports[_0x4552('0x27')]=function(_0xf1485f,_0xae6ba7,_0x122abb){var _0x279f54;return db[_0x4552('0x2c')][_0x4552('0x45')]({'where':{'id':_0xf1485f['params']['id']}})[_0x4552('0x24')](function(_0x7c4c10){if(_0x7c4c10){return db[_0x4552('0x47')][_0x4552('0x48')](function(_0x7827cf){return _0x7c4c10['destroy']({'transaction':_0x7827cf,'raw':!![]})['then'](function(_0x7fbefc){if(_0x7fbefc['directory']){fs[_0x4552('0x58')](_0x7fbefc[_0x4552('0x4e')])[_0x4552('0x59')](function(_0x32c808){fs[_0x4552('0x5a')](path[_0x4552('0x4a')](_0x7fbefc['directory'],_0x32c808));});fs['rmdirSync'](_0x7fbefc[_0x4552('0x4e')]);}return _0x7fbefc;});})[_0x4552('0x41')](function(_0x4ec24c){throw new db[(_0x4552('0x5b'))][(_0x4552('0x5c'))](_0x4ec24c[_0x4552('0x5d')]);});}})[_0x4552('0x24')](handleEntityNotFound(_0xae6ba7,null))['then'](removeEntity(_0xae6ba7,null))[_0x4552('0x41')](handleError(_0xae6ba7,null));};exports['addSound']=function(_0x141ff1,_0x569209,_0x2c3aa6){return db[_0x4552('0x47')][_0x4552('0x48')](function(_0x3f7ef1){var _0x3e48b6;return db['VoiceMusicOnHold'][_0x4552('0x45')]({'where':{'id':_0x141ff1['params']['id']}})['then'](function(_0x121c5e){if(_0x121c5e){_0x3e48b6=_0x121c5e;return _0x121c5e[_0x4552('0x5e')](_0x141ff1['body']['id'],{'transaction':_0x3f7ef1});}})['then'](function(_0x1ae05a){if(_0x1ae05a){return db[_0x4552('0x5f')][_0x4552('0x60')]({'where':{'id':_0x141ff1[_0x4552('0x44')]['id']},'attributes':['id',_0x4552('0x29'),_0x4552('0x61'),_0x4552('0x62'),'createdAt'],'raw':!![]});}})[_0x4552('0x24')](function(_0x1db6a8){if(_0x1db6a8){var _0x2c25dc=path['join'](config[_0x4552('0x63')],_0x4552('0x64'),util[_0x4552('0x65')](_0x4552('0x66'),path['basename'](_0x1db6a8[_0x4552('0x61')],path[_0x4552('0x67')](_0x1db6a8[_0x4552('0x61')])),_0x1db6a8[_0x4552('0x62')]));var _0x3cbf5e=path[_0x4552('0x4a')](config['root'],_0x4552('0x4b'),_0x3e48b6[_0x4552('0x29')],util[_0x4552('0x65')](_0x4552('0x66'),_0x1db6a8['name'],_0x1db6a8[_0x4552('0x62')]));fs['symlinkSync'](_0x2c25dc,_0x3cbf5e);return _0x1db6a8;}})[_0x4552('0x41')](function(_0x3c398b){throw new db['Sequelize'][(_0x4552('0x5c'))](_0x3c398b[_0x4552('0x5d')]);});})['then'](handleEntityNotFound(_0x569209,null))[_0x4552('0x24')](respondWithResult(_0x569209,0xc9))['catch'](handleError(_0x569209,null));};exports[_0x4552('0x68')]=function(_0x1d5640,_0x15764e,_0x4f1f74){return db[_0x4552('0x47')][_0x4552('0x48')](function(_0x42f437){var _0x1211dc;return db[_0x4552('0x2c')][_0x4552('0x60')]({'where':{'id':_0x1d5640[_0x4552('0x42')]['id']}})['then'](handleEntityNotFound(_0x15764e,null))[_0x4552('0x24')](function(_0x33051c){if(_0x33051c){_0x1211dc=_0x33051c;return _0x33051c[_0x4552('0x68')](_0x1d5640[_0x4552('0x42')]['id2']);}})[_0x4552('0x24')](function(_0x281ea9){if(_0x281ea9){return db[_0x4552('0x5f')][_0x4552('0x60')]({'where':{'id':_0x1d5640[_0x4552('0x42')][_0x4552('0x69')]},'attributes':['id','name',_0x4552('0x61'),_0x4552('0x62'),_0x4552('0x6a')],'raw':!![]});}})['then'](function(_0x441279){if(_0x441279){fs['unlinkSync'](path[_0x4552('0x4a')](_0x1211dc[_0x4552('0x4e')],util[_0x4552('0x65')]('%s.%s',_0x441279[_0x4552('0x29')],_0x441279['converted_format'])));return _0x441279;}})[_0x4552('0x41')](function(_0x411e1d){throw new db[(_0x4552('0x5b'))][(_0x4552('0x5c'))](_0x411e1d[_0x4552('0x5d')]);});})[_0x4552('0x24')](handleEntityNotFound(_0x15764e,null))['then'](respondWithStatusCode(_0x15764e,0xcc))[_0x4552('0x41')](handleError(_0x15764e,null));};exports[_0x4552('0x6b')]=function(_0x31727d,_0x2be9a6,_0x56a940){var _0x11bb3b={};var _0x2459e1={};var _0x2d7cf2;var _0xf0159e;return db[_0x4552('0x2c')][_0x4552('0x60')]({'where':{'id':_0x31727d['params']['id']}})[_0x4552('0x24')](handleEntityNotFound(_0x2be9a6,null))[_0x4552('0x24')](function(_0x700a59){if(_0x700a59){_0x2d7cf2=_0x700a59;_0x2459e1[_0x4552('0x30')]=_[_0x4552('0x32')](db[_0x4552('0x5f')][_0x4552('0x2d')]);_0x2459e1[_0x4552('0x31')]=_[_0x4552('0x32')](_0x31727d[_0x4552('0x31')]);_0x2459e1[_0x4552('0x38')]=_[_0x4552('0x33')](_0x2459e1[_0x4552('0x30')],_0x2459e1[_0x4552('0x31')]);_0x11bb3b[_0x4552('0x43')]=_[_0x4552('0x33')](_0x2459e1[_0x4552('0x30')],qs[_0x4552('0x34')](_0x31727d[_0x4552('0x31')][_0x4552('0x34')]));_0x11bb3b[_0x4552('0x43')]=_0x11bb3b[_0x4552('0x43')]['length']?_0x11bb3b[_0x4552('0x43')]:_0x2459e1[_0x4552('0x30')];_0x11bb3b[_0x4552('0x6c')]=qs[_0x4552('0x37')](_0x31727d['query']['sort']);_0x11bb3b[_0x4552('0x3a')]=qs[_0x4552('0x38')](_['pick'](_0x31727d['query'],_0x2459e1['filters']));if(_0x31727d[_0x4552('0x31')][_0x4552('0x3c')]){_0x11bb3b['where']=_['merge'](_0x11bb3b[_0x4552('0x3a')],{'$or':_[_0x4552('0x2b')](_0x11bb3b[_0x4552('0x43')],function(_0x2b2ad1){var _0x3bceca={};_0x3bceca[_0x2b2ad1]={'$like':'%'+_0x31727d[_0x4552('0x31')][_0x4552('0x3c')]+'%'};return _0x3bceca;})});}_0x11bb3b=_[_0x4552('0x3d')]({},_0x11bb3b,_0x31727d[_0x4552('0x3e')]);return _0x2d7cf2[_0x4552('0x6b')](_0x11bb3b);}})[_0x4552('0x24')](function(_0x3df263){if(_0x3df263){_0xf0159e=_0x3df263['length'];if(!_0x31727d[_0x4552('0x31')][_0x4552('0x6d')](_0x4552('0x36'))){_0x11bb3b[_0x4552('0x1e')]=qs['limit'](_0x31727d['query'][_0x4552('0x1e')]);_0x11bb3b[_0x4552('0x1d')]=qs[_0x4552('0x1d')](_0x31727d[_0x4552('0x31')]['offset']);}return _0x2d7cf2[_0x4552('0x6b')](_0x11bb3b);}})['then'](function(_0x271b86){if(_0x271b86){return _0x271b86?{'count':_0xf0159e,'rows':_0x271b86}:null;}})[_0x4552('0x24')](respondWithResult(_0x2be9a6,null))[_0x4552('0x41')](handleError(_0x2be9a6,null));}; \ No newline at end of file +var _0xef8d=['offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','end','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','update','body','create','sequelize','transaction','mode','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','converted_format','createdAt','format','basename','save_name','%s.%s','message','id2','getSounds','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','count'];(function(_0x473ca4,_0x1bef73){var _0x4b8349=function(_0x52779e){while(--_0x52779e){_0x473ca4['push'](_0x473ca4['shift']());}};_0x4b8349(++_0x1bef73);}(_0xef8d,0x12b));var _0xdef8=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xef8d[_0x3df871];return _0x570f7b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdef8('0x0'));var rimraf=require(_0xdef8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdef8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdef8('0x3'));var Mustache=require(_0xdef8('0x4'));var util=require(_0xdef8('0x5'));var path=require(_0xdef8('0x6'));var sox=require(_0xdef8('0x7'));var csv=require(_0xdef8('0x8'));var ejs=require(_0xdef8('0x9'));var fs=require('fs');var _=require(_0xdef8('0xa'));var squel=require(_0xdef8('0xb'));var crypto=require('crypto');var jsforce=require(_0xdef8('0xc'));var deskjs=require(_0xdef8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdef8('0xe'));var Redis=require('ioredis');var authService=require(_0xdef8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdef8('0x10'));var hardwareService=require(_0xdef8('0x11'));var logger=require(_0xdef8('0x12'))(_0xdef8('0x13'));var utils=require(_0xdef8('0x14'));var config=require('../../config/environment');var db=require(_0xdef8('0x15'))['db'];function respondWithStatusCode(_0x4861bc,_0x47fa76){_0x47fa76=_0x47fa76||0xcc;return function(_0x5995eb){if(_0x5995eb){return _0x4861bc[_0xdef8('0x16')](_0x47fa76);}return _0x4861bc['status'](_0x47fa76)['end']();};}function respondWithResult(_0x5cf6c2,_0x1a5137){_0x1a5137=_0x1a5137||0xc8;return function(_0x5aa23c){if(_0x5aa23c){return _0x5cf6c2['status'](_0x1a5137)[_0xdef8('0x17')](_0x5aa23c);}};}function respondWithFilteredResult(_0x21f76b,_0x4c5747){return function(_0x55bfad){if(_0x55bfad){var _0x36c44b=_0x55bfad[_0xdef8('0x18')],_0x1f7357=_0x4c5747[_0xdef8('0x19')],_0x33be0a=_0x4c5747['offset']+_0x4c5747[_0xdef8('0x1a')],_0x3227df;if(_0x33be0a>=_0x36c44b){_0x33be0a=_0x36c44b;_0x3227df=0xc8;}else{_0x3227df=0xce;}_0x21f76b[_0xdef8('0x1b')](_0x3227df);return _0x21f76b[_0xdef8('0x1c')](_0xdef8('0x1d'),_0x1f7357+'-'+_0x33be0a+'/'+_0x36c44b)[_0xdef8('0x17')](_0x55bfad);}return null;};}function patchUpdates(_0x22eaab){return function(_0x8cc5f9){try{jsonpatch[_0xdef8('0x1e')](_0x8cc5f9,_0x22eaab,!![]);}catch(_0x538a38){return BPromise[_0xdef8('0x1f')](_0x538a38);}return _0x8cc5f9[_0xdef8('0x20')]();};}function saveUpdates(_0xe1a52c,_0x454e4e){return function(_0x40c8e4){if(_0x40c8e4){return _0x40c8e4['update'](_0xe1a52c)[_0xdef8('0x21')](function(_0x23d91e){return _0x23d91e;});}return null;};}function removeEntity(_0x93e682,_0x15296a){return function(_0x1fd4f7){if(_0x1fd4f7){return _0x1fd4f7[_0xdef8('0x22')]()[_0xdef8('0x21')](function(){var _0x24bec0=_0x1fd4f7[_0xdef8('0x23')]({'plain':!![]});var _0x4d11ca=_0xdef8('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d11ca,'resourceId':_0x24bec0['id']}})[_0xdef8('0x21')](function(){return _0x1fd4f7;});})[_0xdef8('0x21')](function(){_0x93e682[_0xdef8('0x1b')](0xcc)[_0xdef8('0x25')]();});}};}function handleEntityNotFound(_0x4adbf6,_0x3ce3f3){return function(_0x352f61){if(!_0x352f61){_0x4adbf6['sendStatus'](0x194);}return _0x352f61;};}function handleError(_0x5953d9,_0x2ec59a){_0x2ec59a=_0x2ec59a||0x1f4;return function(_0x48df41){logger[_0xdef8('0x26')](_0x48df41[_0xdef8('0x27')]);if(_0x48df41[_0xdef8('0x28')]){delete _0x48df41['name'];}_0x5953d9[_0xdef8('0x1b')](_0x2ec59a)[_0xdef8('0x29')](_0x48df41);};}exports[_0xdef8('0x2a')]=function(_0x6184e9,_0x5cef9a){var _0x1f224e={},_0x5d2ca7={},_0x347ea8={'count':0x0,'rows':[]};var _0x2ccd29=_[_0xdef8('0x2b')](db[_0xdef8('0x2c')][_0xdef8('0x2d')],function(_0x36c8e5){return{'name':_0x36c8e5[_0xdef8('0x2e')],'type':_0x36c8e5[_0xdef8('0x2f')][_0xdef8('0x30')]};});_0x5d2ca7[_0xdef8('0x31')]=_[_0xdef8('0x2b')](_0x2ccd29,_0xdef8('0x28'));_0x5d2ca7[_0xdef8('0x32')]=_[_0xdef8('0x33')](_0x6184e9[_0xdef8('0x32')]);_0x5d2ca7[_0xdef8('0x34')]=_[_0xdef8('0x35')](_0x5d2ca7[_0xdef8('0x31')],_0x5d2ca7[_0xdef8('0x32')]);_0x1f224e[_0xdef8('0x36')]=_['intersection'](_0x5d2ca7[_0xdef8('0x31')],qs[_0xdef8('0x37')](_0x6184e9[_0xdef8('0x32')]['fields']));_0x1f224e['attributes']=_0x1f224e[_0xdef8('0x36')][_0xdef8('0x38')]?_0x1f224e[_0xdef8('0x36')]:_0x5d2ca7[_0xdef8('0x31')];if(!_0x6184e9[_0xdef8('0x32')][_0xdef8('0x39')](_0xdef8('0x3a'))){_0x1f224e[_0xdef8('0x1a')]=qs[_0xdef8('0x1a')](_0x6184e9[_0xdef8('0x32')]['limit']);_0x1f224e[_0xdef8('0x19')]=qs[_0xdef8('0x19')](_0x6184e9[_0xdef8('0x32')][_0xdef8('0x19')]);}_0x1f224e[_0xdef8('0x3b')]=qs['sort'](_0x6184e9[_0xdef8('0x32')][_0xdef8('0x3c')]);_0x1f224e[_0xdef8('0x3d')]=qs[_0xdef8('0x34')](_[_0xdef8('0x3e')](_0x6184e9[_0xdef8('0x32')],_0x5d2ca7['filters']));if(_0x6184e9[_0xdef8('0x32')][_0xdef8('0x3f')]){_0x1f224e[_0xdef8('0x3d')]=_[_0xdef8('0x40')](_0x1f224e['where'],{'$or':_['map'](_0x2ccd29,function(_0x2b31df){if(_0x2b31df[_0xdef8('0x2f')]!==_0xdef8('0x41')){var _0x272eba={};_0x272eba[_0x2b31df[_0xdef8('0x28')]]={'$like':'%'+_0x6184e9[_0xdef8('0x32')][_0xdef8('0x3f')]+'%'};return _0x272eba;}})});}_0x1f224e=_[_0xdef8('0x40')]({},_0x1f224e,_0x6184e9[_0xdef8('0x42')]);var _0x484d76={'where':_0x1f224e['where']};return db[_0xdef8('0x2c')]['count'](_0x484d76)[_0xdef8('0x21')](function(_0x3de9e7){_0x347ea8['count']=_0x3de9e7;if(_0x6184e9['query'][_0xdef8('0x43')]){_0x1f224e['include']=[{'all':!![]}];}return db[_0xdef8('0x2c')][_0xdef8('0x44')](_0x1f224e);})[_0xdef8('0x21')](function(_0x318f7d){_0x347ea8[_0xdef8('0x45')]=_0x318f7d;return _0x347ea8;})['then'](respondWithFilteredResult(_0x5cef9a,_0x1f224e))[_0xdef8('0x46')](handleError(_0x5cef9a,null));};exports[_0xdef8('0x47')]=function(_0x41853c,_0x584e42){var _0x553eab={'raw':![],'where':{'id':_0x41853c[_0xdef8('0x48')]['id']}},_0x213597={};_0x213597[_0xdef8('0x31')]=_[_0xdef8('0x33')](db[_0xdef8('0x2c')][_0xdef8('0x2d')]);_0x213597['query']=_[_0xdef8('0x33')](_0x41853c[_0xdef8('0x32')]);_0x213597[_0xdef8('0x34')]=_[_0xdef8('0x35')](_0x213597[_0xdef8('0x31')],_0x213597[_0xdef8('0x32')]);_0x553eab[_0xdef8('0x36')]=_[_0xdef8('0x35')](_0x213597[_0xdef8('0x31')],qs[_0xdef8('0x37')](_0x41853c['query'][_0xdef8('0x37')]));_0x553eab[_0xdef8('0x36')]=_0x553eab[_0xdef8('0x36')][_0xdef8('0x38')]?_0x553eab[_0xdef8('0x36')]:_0x213597[_0xdef8('0x31')];if(_0x41853c[_0xdef8('0x32')][_0xdef8('0x43')]){_0x553eab[_0xdef8('0x49')]=[{'all':!![]}];}_0x553eab=_['merge']({},_0x553eab,_0x41853c[_0xdef8('0x42')]);return db[_0xdef8('0x2c')][_0xdef8('0x4a')](_0x553eab)[_0xdef8('0x21')](handleEntityNotFound(_0x584e42,null))[_0xdef8('0x21')](respondWithResult(_0x584e42,null))[_0xdef8('0x46')](handleError(_0x584e42,null));};exports[_0xdef8('0x4b')]=function(_0x2adea,_0x3e537a){if(_0x2adea[_0xdef8('0x4c')]['id']){delete _0x2adea[_0xdef8('0x4c')]['id'];}return db[_0xdef8('0x2c')]['find']({'where':{'id':_0x2adea[_0xdef8('0x48')]['id']}})[_0xdef8('0x21')](handleEntityNotFound(_0x3e537a,null))['then'](saveUpdates(_0x2adea[_0xdef8('0x4c')],null))[_0xdef8('0x21')](respondWithResult(_0x3e537a,null))[_0xdef8('0x46')](handleError(_0x3e537a,null));};exports[_0xdef8('0x4d')]=function(_0x331610,_0x53ab07,_0x14209a){return db[_0xdef8('0x4e')][_0xdef8('0x4f')](function(_0x13b9ad){if(_0x331610[_0xdef8('0x4c')][_0xdef8('0x50')]==='files'){_0x331610[_0xdef8('0x4c')][_0xdef8('0x51')]=path[_0xdef8('0x52')](config[_0xdef8('0x53')],_0xdef8('0x54'),_0x331610[_0xdef8('0x4c')][_0xdef8('0x28')]);}return db['VoiceMusicOnHold']['create'](_0x331610[_0xdef8('0x4c')],{'transaction':_0x13b9ad})[_0xdef8('0x21')](function(_0x5559ac){if(_0x331610[_0xdef8('0x4c')]['mode']==='files'){fs[_0xdef8('0x55')](_0x5559ac[_0xdef8('0x51')],parseInt(_0xdef8('0x56'),0x8));}var _0x5d1156=_0x331610[_0xdef8('0x57')][_0xdef8('0x23')]({'plain':!![]});if(!_0x5d1156)throw new Error(_0xdef8('0x58'));if(_0x5d1156[_0xdef8('0x59')]===_0xdef8('0x57')){var _0x14efcd=_0x5559ac[_0xdef8('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xdef8('0x4a')]({'where':{'name':'MusicOnHolds','userProfileId':_0x5d1156[_0xdef8('0x5a')]},'raw':!![]})[_0xdef8('0x21')](function(_0x152314){if(_0x152314&&_0x152314['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x14efcd[_0xdef8('0x28')],'resourceId':_0x14efcd['id'],'type':_0x152314['name'],'sectionId':_0x152314['id']},{})[_0xdef8('0x21')](function(){return _0x5559ac;});}else{return _0x5559ac;}})['catch'](function(_0x35b09c){logger['error'](_0xdef8('0x5b'),_0x35b09c);});}return _0x5559ac;});})[_0xdef8('0x21')](respondWithResult(_0x53ab07,0xc9))[_0xdef8('0x46')](handleError(_0x53ab07,null));};exports['destroy']=function(_0x4235d7,_0x50c4d6,_0x1f0bd0){var _0x303e4f;return db[_0xdef8('0x2c')][_0xdef8('0x4a')]({'where':{'id':_0x4235d7['params']['id']}})[_0xdef8('0x21')](function(_0x5c3f19){if(_0x5c3f19){return db[_0xdef8('0x4e')]['transaction'](function(_0x5b1ac2){return _0x5c3f19['destroy']({'transaction':_0x5b1ac2,'raw':!![]})[_0xdef8('0x21')](function(_0x13f7cf){if(_0x13f7cf[_0xdef8('0x51')]){fs['readdirSync'](_0x13f7cf['directory'])['forEach'](function(_0x32698f){fs[_0xdef8('0x5c')](path[_0xdef8('0x52')](_0x13f7cf[_0xdef8('0x51')],_0x32698f));});fs[_0xdef8('0x5d')](_0x13f7cf[_0xdef8('0x51')]);}return _0x13f7cf;});})[_0xdef8('0x46')](function(_0x50cf23){throw new db[(_0xdef8('0x5e'))][(_0xdef8('0x5f'))](_0x50cf23['message']);});}})[_0xdef8('0x21')](handleEntityNotFound(_0x50c4d6,null))[_0xdef8('0x21')](removeEntity(_0x50c4d6,null))[_0xdef8('0x46')](handleError(_0x50c4d6,null));};exports[_0xdef8('0x60')]=function(_0x50ff76,_0x476ff2,_0x222847){return db[_0xdef8('0x4e')][_0xdef8('0x4f')](function(_0x16408c){var _0x596985;return db['VoiceMusicOnHold'][_0xdef8('0x4a')]({'where':{'id':_0x50ff76[_0xdef8('0x48')]['id']}})[_0xdef8('0x21')](function(_0x2fa4a6){if(_0x2fa4a6){_0x596985=_0x2fa4a6;return _0x2fa4a6['addSound'](_0x50ff76[_0xdef8('0x4c')]['id'],{'transaction':_0x16408c});}})['then'](function(_0x498edd){if(_0x498edd){return db[_0xdef8('0x61')][_0xdef8('0x62')]({'where':{'id':_0x50ff76[_0xdef8('0x4c')]['id']},'attributes':['id','name','save_name',_0xdef8('0x63'),_0xdef8('0x64')],'raw':!![]});}})[_0xdef8('0x21')](function(_0x37654a){if(_0x37654a){var _0x5d42c1=path[_0xdef8('0x52')](config[_0xdef8('0x53')],'server/files/sounds/converted',util[_0xdef8('0x65')]('%s.%s',path[_0xdef8('0x66')](_0x37654a[_0xdef8('0x67')],path['extname'](_0x37654a[_0xdef8('0x67')])),_0x37654a[_0xdef8('0x63')]));var _0xfe2707=path[_0xdef8('0x52')](config[_0xdef8('0x53')],_0xdef8('0x54'),_0x596985['name'],util[_0xdef8('0x65')](_0xdef8('0x68'),_0x37654a[_0xdef8('0x28')],_0x37654a[_0xdef8('0x63')]));fs['symlinkSync'](_0x5d42c1,_0xfe2707);return _0x37654a;}})[_0xdef8('0x46')](function(_0x1732a0){throw new db[(_0xdef8('0x5e'))][(_0xdef8('0x5f'))](_0x1732a0[_0xdef8('0x69')]);});})[_0xdef8('0x21')](handleEntityNotFound(_0x476ff2,null))[_0xdef8('0x21')](respondWithResult(_0x476ff2,0xc9))[_0xdef8('0x46')](handleError(_0x476ff2,null));};exports['removeSound']=function(_0x5571b3,_0x36de8a,_0x5110a){return db[_0xdef8('0x4e')][_0xdef8('0x4f')](function(_0x108605){var _0x2ebd90;return db[_0xdef8('0x2c')]['findOne']({'where':{'id':_0x5571b3[_0xdef8('0x48')]['id']}})['then'](handleEntityNotFound(_0x36de8a,null))['then'](function(_0x1905f9){if(_0x1905f9){_0x2ebd90=_0x1905f9;return _0x1905f9['removeSound'](_0x5571b3['params'][_0xdef8('0x6a')]);}})[_0xdef8('0x21')](function(_0x212d9d){if(_0x212d9d){return db['Sound'][_0xdef8('0x62')]({'where':{'id':_0x5571b3['params'][_0xdef8('0x6a')]},'attributes':['id',_0xdef8('0x28'),_0xdef8('0x67'),_0xdef8('0x63'),_0xdef8('0x64')],'raw':!![]});}})[_0xdef8('0x21')](function(_0x145418){if(_0x145418){fs[_0xdef8('0x5c')](path[_0xdef8('0x52')](_0x2ebd90[_0xdef8('0x51')],util['format']('%s.%s',_0x145418[_0xdef8('0x28')],_0x145418[_0xdef8('0x63')])));return _0x145418;}})['catch'](function(_0x1d962a){throw new db[(_0xdef8('0x5e'))][(_0xdef8('0x5f'))](_0x1d962a['message']);});})[_0xdef8('0x21')](handleEntityNotFound(_0x36de8a,null))['then'](respondWithStatusCode(_0x36de8a,0xcc))[_0xdef8('0x46')](handleError(_0x36de8a,null));};exports[_0xdef8('0x6b')]=function(_0x1e6580,_0x468447,_0x3e9beb){var _0x3c8a14={};var _0x856fbe={};var _0x5a41d2;var _0x34b89b;return db[_0xdef8('0x2c')][_0xdef8('0x62')]({'where':{'id':_0x1e6580['params']['id']}})[_0xdef8('0x21')](handleEntityNotFound(_0x468447,null))[_0xdef8('0x21')](function(_0x2c055a){if(_0x2c055a){_0x5a41d2=_0x2c055a;_0x856fbe['model']=_[_0xdef8('0x33')](db[_0xdef8('0x61')]['rawAttributes']);_0x856fbe[_0xdef8('0x32')]=_[_0xdef8('0x33')](_0x1e6580['query']);_0x856fbe['filters']=_['intersection'](_0x856fbe[_0xdef8('0x31')],_0x856fbe[_0xdef8('0x32')]);_0x3c8a14[_0xdef8('0x36')]=_[_0xdef8('0x35')](_0x856fbe[_0xdef8('0x31')],qs[_0xdef8('0x37')](_0x1e6580[_0xdef8('0x32')]['fields']));_0x3c8a14['attributes']=_0x3c8a14[_0xdef8('0x36')][_0xdef8('0x38')]?_0x3c8a14[_0xdef8('0x36')]:_0x856fbe[_0xdef8('0x31')];_0x3c8a14['order']=qs['sort'](_0x1e6580[_0xdef8('0x32')]['sort']);_0x3c8a14[_0xdef8('0x3d')]=qs[_0xdef8('0x34')](_[_0xdef8('0x3e')](_0x1e6580[_0xdef8('0x32')],_0x856fbe[_0xdef8('0x34')]));if(_0x1e6580[_0xdef8('0x32')][_0xdef8('0x3f')]){_0x3c8a14[_0xdef8('0x3d')]=_[_0xdef8('0x40')](_0x3c8a14[_0xdef8('0x3d')],{'$or':_[_0xdef8('0x2b')](_0x3c8a14[_0xdef8('0x36')],function(_0x21e124){var _0x497f4d={};_0x497f4d[_0x21e124]={'$like':'%'+_0x1e6580[_0xdef8('0x32')][_0xdef8('0x3f')]+'%'};return _0x497f4d;})});}_0x3c8a14=_['merge']({},_0x3c8a14,_0x1e6580[_0xdef8('0x42')]);return _0x5a41d2[_0xdef8('0x6b')](_0x3c8a14);}})[_0xdef8('0x21')](function(_0x20f2f0){if(_0x20f2f0){_0x34b89b=_0x20f2f0['length'];if(!_0x1e6580[_0xdef8('0x32')]['hasOwnProperty'](_0xdef8('0x3a'))){_0x3c8a14[_0xdef8('0x1a')]=qs[_0xdef8('0x1a')](_0x1e6580['query'][_0xdef8('0x1a')]);_0x3c8a14[_0xdef8('0x19')]=qs['offset'](_0x1e6580[_0xdef8('0x32')][_0xdef8('0x19')]);}return _0x5a41d2['getSounds'](_0x3c8a14);}})[_0xdef8('0x21')](function(_0x344e5b){if(_0x344e5b){return _0x344e5b?{'count':_0x34b89b,'rows':_0x344e5b}:null;}})[_0xdef8('0x21')](respondWithResult(_0x468447,null))[_0xdef8('0x46')](handleError(_0x468447,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 9d0e1e3..38ff5a9 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 _0x67f6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','lodash','util'];(function(_0x5451d4,_0xcd1854){var _0x3d9b3e=function(_0xd1e4be){while(--_0xd1e4be){_0x5451d4['push'](_0x5451d4['shift']());}};_0x3d9b3e(++_0xcd1854);}(_0x67f6,0x142));var _0x667f=function(_0x4432bc,_0xc2db0b){_0x4432bc=_0x4432bc-0x0;var _0x11b793=_0x67f6[_0x4432bc];return _0x11b793;};'use strict';var _=require(_0x667f('0x0'));var util=require(_0x667f('0x1'));var logger=require(_0x667f('0x2'))(_0x667f('0x3'));var moment=require('moment');var BPromise=require(_0x667f('0x4'));var rp=require(_0x667f('0x5'));var fs=require('fs');var path=require(_0x667f('0x6'));var rimraf=require(_0x667f('0x7'));var config=require(_0x667f('0x8'));var attributes=require(_0x667f('0x9'));module[_0x667f('0xa')]=function(_0x19f603,_0x3ce4fe){return _0x19f603[_0x667f('0xb')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3368=['request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','util','../../config/logger','api','bluebird'];(function(_0x327aa2,_0x440807){var _0x26d010=function(_0x19c89d){while(--_0x19c89d){_0x327aa2['push'](_0x327aa2['shift']());}};_0x26d010(++_0x440807);}(_0x3368,0x6a));var _0x8336=function(_0x29e871,_0x330b98){_0x29e871=_0x29e871-0x0;var _0x3380e3=_0x3368[_0x29e871];return _0x3380e3;};'use strict';var _=require('lodash');var util=require(_0x8336('0x0'));var logger=require(_0x8336('0x1'))(_0x8336('0x2'));var moment=require('moment');var BPromise=require(_0x8336('0x3'));var rp=require(_0x8336('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8336('0x5'));var config=require(_0x8336('0x6'));var attributes=require(_0x8336('0x7'));module[_0x8336('0x8')]=function(_0x160200,_0x476f89){return _0x160200[_0x8336('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x8336('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 de0e322..67a272e 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 _0x7a63=['then','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5684e2,_0x2d1879){var _0x3e42bb=function(_0x56fbe7){while(--_0x56fbe7){_0x5684e2['push'](_0x5684e2['shift']());}};_0x3e42bb(++_0x2d1879);}(_0x7a63,0xb2));var _0x37a6=function(_0x5a008b,_0x1bc91e){_0x5a008b=_0x5a008b-0x0;var _0x5100c7=_0x7a63[_0x5a008b];return _0x5100c7;};'use strict';var _=require(_0x37a6('0x0'));var util=require(_0x37a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x37a6('0x2'));var fs=require('fs');var Redis=require(_0x37a6('0x3'));var db=require(_0x37a6('0x4'))['db'];var utils=require(_0x37a6('0x5'));var logger=require(_0x37a6('0x6'))(_0x37a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x37a6('0x8'));var client=jayson[_0x37a6('0x9')][_0x37a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x373bbb,_0x3e8fe4,_0x3df756){return new BPromise(function(_0x4eb336,_0x5c5748){return client['request'](_0x373bbb,_0x3df756)[_0x37a6('0xb')](function(_0x3ba933){logger['info'](_0x37a6('0xc'),_0x3e8fe4,'request\x20sent');logger[_0x37a6('0xd')](_0x37a6('0xe'),_0x3e8fe4,_0x37a6('0xf'),JSON['stringify'](_0x3ba933));if(_0x3ba933['error']){if(_0x3ba933[_0x37a6('0x10')][_0x37a6('0x11')]===0x1f4){logger[_0x37a6('0x10')](_0x37a6('0xc'),_0x3e8fe4,_0x3ba933[_0x37a6('0x10')][_0x37a6('0x12')]);return _0x5c5748(_0x3ba933['error'][_0x37a6('0x12')]);}logger[_0x37a6('0x10')](_0x37a6('0xc'),_0x3e8fe4,_0x3ba933[_0x37a6('0x10')]['message']);return _0x4eb336(_0x3ba933[_0x37a6('0x10')][_0x37a6('0x12')]);}else{logger[_0x37a6('0x13')](_0x37a6('0xc'),_0x3e8fe4,_0x37a6('0xf'));_0x4eb336(_0x3ba933['result']['message']);}})[_0x37a6('0x14')](function(_0x218d07){logger['error'](_0x37a6('0xc'),_0x3e8fe4,_0x218d07);_0x5c5748(_0x218d07);});});} \ No newline at end of file +var _0x62b9=['VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','debug'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x62b9,0x13a));var _0x962b=function(_0x22dc5d,_0x1b4f7b){_0x22dc5d=_0x22dc5d-0x0;var _0x15b0c2=_0x62b9[_0x22dc5d];return _0x15b0c2;};'use strict';var _=require(_0x962b('0x0'));var util=require(_0x962b('0x1'));var moment=require(_0x962b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x962b('0x3'));var db=require(_0x962b('0x4'))['db'];var utils=require(_0x962b('0x5'));var logger=require(_0x962b('0x6'))(_0x962b('0x7'));var config=require(_0x962b('0x8'));var jayson=require(_0x962b('0x9'));var client=jayson[_0x962b('0xa')][_0x962b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a611,_0x445732,_0x35c0dd){return new BPromise(function(_0x5914a2,_0x50b394){return client[_0x962b('0xc')](_0x22a611,_0x35c0dd)['then'](function(_0x55a2a0){logger[_0x962b('0xd')](_0x962b('0xe'),_0x445732,'request\x20sent');logger[_0x962b('0xf')](_0x962b('0x10'),_0x445732,'request\x20sent',JSON[_0x962b('0x11')](_0x55a2a0));if(_0x55a2a0[_0x962b('0x12')]){if(_0x55a2a0['error']['code']===0x1f4){logger['error'](_0x962b('0xe'),_0x445732,_0x55a2a0['error']['message']);return _0x50b394(_0x55a2a0[_0x962b('0x12')][_0x962b('0x13')]);}logger[_0x962b('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x445732,_0x55a2a0[_0x962b('0x12')][_0x962b('0x13')]);return _0x5914a2(_0x55a2a0[_0x962b('0x12')]['message']);}else{logger['info'](_0x962b('0xe'),_0x445732,_0x962b('0x14'));_0x5914a2(_0x55a2a0[_0x962b('0x15')][_0x962b('0x13')]);}})['catch'](function(_0x399890){logger['error'](_0x962b('0xe'),_0x445732,_0x399890);_0x50b394(_0x399890);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 3fa8f7e..39cbedf 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 _0xabba=['getAgents','post','addAgents','put','/:id','update','delete','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/users'];(function(_0x5332b1,_0x192941){var _0x129b49=function(_0x469fd0){while(--_0x469fd0){_0x5332b1['push'](_0x5332b1['shift']());}};_0x129b49(++_0x192941);}(_0xabba,0x97));var _0xaabb=function(_0x14668b,_0x172043){_0x14668b=_0x14668b-0x0;var _0x3cbc46=_0xabba[_0x14668b];return _0x3cbc46;};'use strict';var multer=require(_0xaabb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaabb('0x1')]();var auth=require(_0xaabb('0x2'));var interaction=require(_0xaabb('0x3'));var config=require(_0xaabb('0x4'));var controller=require('./voicePrefix.controller');router[_0xaabb('0x5')]('/',auth[_0xaabb('0x6')](),controller['index']);router[_0xaabb('0x5')](_0xaabb('0x7'),auth['isAuthenticated'](),controller[_0xaabb('0x8')]);router['get']('/:id',auth[_0xaabb('0x6')](),controller[_0xaabb('0x9')]);router['get'](_0xaabb('0xa'),auth[_0xaabb('0x6')](),controller[_0xaabb('0xb')]);router[_0xaabb('0xc')]('/',auth[_0xaabb('0x6')](),controller['create']);router['post'](_0xaabb('0xa'),auth[_0xaabb('0x6')](),controller[_0xaabb('0xd')]);router[_0xaabb('0xe')](_0xaabb('0xf'),auth[_0xaabb('0x6')](),controller[_0xaabb('0x10')]);router[_0xaabb('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xaabb('0x11')](_0xaabb('0xa'),auth[_0xaabb('0x6')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3e30=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','update','delete','exports','util'];(function(_0x478b75,_0x5cbfaa){var _0x4a31d0=function(_0x4522f3){while(--_0x4522f3){_0x478b75['push'](_0x478b75['shift']());}};_0x4a31d0(++_0x5cbfaa);}(_0x3e30,0x1cb));var _0x03e3=function(_0x53927e,_0xc0515d){_0x53927e=_0x53927e-0x0;var _0x495054=_0x3e30[_0x53927e];return _0x495054;};'use strict';var multer=require('multer');var util=require(_0x03e3('0x0'));var path=require(_0x03e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x03e3('0x2'));var router=express[_0x03e3('0x3')]();var auth=require(_0x03e3('0x4'));var interaction=require(_0x03e3('0x5'));var config=require(_0x03e3('0x6'));var controller=require(_0x03e3('0x7'));router[_0x03e3('0x8')]('/',auth[_0x03e3('0x9')](),controller[_0x03e3('0xa')]);router['get'](_0x03e3('0xb'),auth['isAuthenticated'](),controller[_0x03e3('0xc')]);router[_0x03e3('0x8')](_0x03e3('0xd'),auth[_0x03e3('0x9')](),controller[_0x03e3('0xe')]);router[_0x03e3('0x8')](_0x03e3('0xf'),auth[_0x03e3('0x9')](),controller[_0x03e3('0x10')]);router[_0x03e3('0x11')]('/',auth[_0x03e3('0x9')](),controller[_0x03e3('0x12')]);router[_0x03e3('0x11')](_0x03e3('0xf'),auth[_0x03e3('0x9')](),controller[_0x03e3('0x13')]);router['put'](_0x03e3('0xd'),auth['isAuthenticated'](),controller[_0x03e3('0x14')]);router['delete'](_0x03e3('0xd'),auth[_0x03e3('0x9')](),controller['destroy']);router[_0x03e3('0x15')](_0x03e3('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x03e3('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b93d67f..9155375 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 _0x8d00=['sequelize','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x31d849,_0x3db9bc){var _0x1c55b3=function(_0x3b8040){while(--_0x3b8040){_0x31d849['push'](_0x31d849['shift']());}};_0x1c55b3(++_0x3db9bc);}(_0x8d00,0x198));var _0x08d0=function(_0x3b6d3c,_0x176f51){_0x3b6d3c=_0x3b6d3c-0x0;var _0x154376=_0x8d00[_0x3b6d3c];return _0x154376;};'use strict';var Sequelize=require(_0x08d0('0x0'));module['exports']={'name':{'type':Sequelize[_0x08d0('0x1')],'allowNull':![],'unique':_0x08d0('0x2')},'prefix':{'type':Sequelize[_0x08d0('0x3')],'get':function(_0x156e63){return _0x08d0('0x4')+this[_0x08d0('0x5')](_0x08d0('0x2'))+'-';}},'description':{'type':Sequelize[_0x08d0('0x1')]},'callerIdAll':{'type':Sequelize[_0x08d0('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe725=['INTEGER','sequelize','exports','name','VIRTUAL','system-','getDataValue','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe725,0x109));var _0x5e72=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe725[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x5e72('0x0'));module[_0x5e72('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5e72('0x2')},'prefix':{'type':Sequelize[_0x5e72('0x3')],'get':function(_0x57786a){return _0x5e72('0x4')+this[_0x5e72('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x5e72('0x6')]},'callerIdAll':{'type':Sequelize[_0x5e72('0x6')]},'VoiceExtensionId':{'type':Sequelize[_0x5e72('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index c6356af..1be5fdd 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 _0x6576=['VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','reject','save','then','get','VoicePrefixes','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','describe','sequelize','transaction','create','body','VoiceExtension','find'];(function(_0x35537b,_0x421fd9){var _0x185bb2=function(_0x5803c1){while(--_0x5803c1){_0x35537b['push'](_0x35537b['shift']());}};_0x185bb2(++_0x421fd9);}(_0x6576,0x1ab));var _0x6657=function(_0x21d0e6,_0x5a7aa6){_0x21d0e6=_0x21d0e6-0x0;var _0x1cc2d1=_0x6576[_0x21d0e6];return _0x1cc2d1;};'use strict';var pdf=require(_0x6657('0x0'));var emlformat=require(_0x6657('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6657('0x2'));var jsonpatch=require(_0x6657('0x3'));var rp=require('request-promise');var moment=require(_0x6657('0x4'));var BPromise=require(_0x6657('0x5'));var Mustache=require(_0x6657('0x6'));var util=require(_0x6657('0x7'));var path=require(_0x6657('0x8'));var sox=require(_0x6657('0x9'));var csv=require(_0x6657('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6657('0xb'));var squel=require(_0x6657('0xc'));var crypto=require('crypto');var jsforce=require(_0x6657('0xd'));var deskjs=require(_0x6657('0xe'));var toCsv=require(_0x6657('0xa'));var querystring=require('querystring');var Papa=require(_0x6657('0xf'));var Redis=require(_0x6657('0x10'));var authService=require(_0x6657('0x11'));var qs=require(_0x6657('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6657('0x13'));var logger=require(_0x6657('0x14'))(_0x6657('0x15'));var utils=require(_0x6657('0x16'));var config=require(_0x6657('0x17'));var db=require(_0x6657('0x18'))['db'];config['redis']=_[_0x6657('0x19')](config[_0x6657('0x1a')],{'host':_0x6657('0x1b'),'port':0x18eb});var socket=require(_0x6657('0x1c'))(new Redis(config[_0x6657('0x1a')]));require('./voicePrefix.socket')[_0x6657('0x1d')](socket);function respondWithStatusCode(_0x5ad012,_0x2a0d82){_0x2a0d82=_0x2a0d82||0xcc;return function(_0x523b19){if(_0x523b19){return _0x5ad012[_0x6657('0x1e')](_0x2a0d82);}return _0x5ad012[_0x6657('0x1f')](_0x2a0d82)[_0x6657('0x20')]();};}function respondWithResult(_0xce5dad,_0x1102cd){_0x1102cd=_0x1102cd||0xc8;return function(_0x5c5dc7){if(_0x5c5dc7){return _0xce5dad[_0x6657('0x1f')](_0x1102cd)[_0x6657('0x21')](_0x5c5dc7);}};}function respondWithFilteredResult(_0x2e09ec,_0x2e7735){return function(_0x5c2b0e){if(_0x5c2b0e){var _0x14721d=_0x5c2b0e[_0x6657('0x22')],_0x528d56=_0x2e7735['offset'],_0x2e303b=_0x2e7735[_0x6657('0x23')]+_0x2e7735['limit'],_0x586fee;if(_0x2e303b>=_0x14721d){_0x2e303b=_0x14721d;_0x586fee=0xc8;}else{_0x586fee=0xce;}_0x2e09ec['status'](_0x586fee);return _0x2e09ec[_0x6657('0x24')]('Content-Range',_0x528d56+'-'+_0x2e303b+'/'+_0x14721d)[_0x6657('0x21')](_0x5c2b0e);}return null;};}function patchUpdates(_0x2b1560){return function(_0x3c40bd){try{jsonpatch['apply'](_0x3c40bd,_0x2b1560,!![]);}catch(_0x87d5e3){return BPromise[_0x6657('0x25')](_0x87d5e3);}return _0x3c40bd[_0x6657('0x26')]();};}function saveUpdates(_0x319179,_0x271c79){return function(_0x18aa60){if(_0x18aa60){return _0x18aa60['update'](_0x319179)['then'](function(_0x8bf236){return _0x8bf236;});}return null;};}function removeEntity(_0x5b9a40,_0x2b8d4c){return function(_0x43162d){if(_0x43162d){return _0x43162d['destroy']()[_0x6657('0x27')](function(){var _0x143ec5=_0x43162d[_0x6657('0x28')]({'plain':!![]});var _0x2b25de=_0x6657('0x29');return db['UserProfileResource'][_0x6657('0x2a')]({'where':{'type':_0x2b25de,'resourceId':_0x143ec5['id']}})[_0x6657('0x27')](function(){return _0x43162d;});})['then'](function(){_0x5b9a40[_0x6657('0x1f')](0xcc)[_0x6657('0x20')]();});}};}function handleEntityNotFound(_0xa5a921,_0x2fc321){return function(_0x9926b3){if(!_0x9926b3){_0xa5a921[_0x6657('0x1e')](0x194);}return _0x9926b3;};}function handleError(_0x4c2951,_0x5920ad){_0x5920ad=_0x5920ad||0x1f4;return function(_0x1b82df){logger[_0x6657('0x2b')](_0x1b82df[_0x6657('0x2c')]);if(_0x1b82df[_0x6657('0x2d')]){delete _0x1b82df['name'];}_0x4c2951[_0x6657('0x1f')](_0x5920ad)[_0x6657('0x2e')](_0x1b82df);};}exports[_0x6657('0x2f')]=function(_0x3e5b39,_0x35be7){var _0x5243bb={},_0x502c12={},_0x2083e3={'count':0x0,'rows':[]};var _0xf7fb1b=_[_0x6657('0x30')](db[_0x6657('0x31')][_0x6657('0x32')],function(_0x1a1da6){return{'name':_0x1a1da6[_0x6657('0x33')],'type':_0x1a1da6['type']['key']};});_0x502c12['model']=_['map'](_0xf7fb1b,_0x6657('0x2d'));_0x502c12[_0x6657('0x34')]=_[_0x6657('0x35')](_0x3e5b39[_0x6657('0x34')]);_0x502c12[_0x6657('0x36')]=_[_0x6657('0x37')](_0x502c12[_0x6657('0x38')],_0x502c12[_0x6657('0x34')]);_0x5243bb[_0x6657('0x39')]=_[_0x6657('0x37')](_0x502c12[_0x6657('0x38')],qs[_0x6657('0x3a')](_0x3e5b39[_0x6657('0x34')][_0x6657('0x3a')]));_0x5243bb[_0x6657('0x39')]=_0x5243bb[_0x6657('0x39')][_0x6657('0x3b')]?_0x5243bb['attributes']:_0x502c12[_0x6657('0x38')];if(!_0x3e5b39[_0x6657('0x34')][_0x6657('0x3c')](_0x6657('0x3d'))){_0x5243bb['limit']=qs[_0x6657('0x3e')](_0x3e5b39[_0x6657('0x34')][_0x6657('0x3e')]);_0x5243bb[_0x6657('0x23')]=qs[_0x6657('0x23')](_0x3e5b39[_0x6657('0x34')][_0x6657('0x23')]);}_0x5243bb['order']=qs[_0x6657('0x3f')](_0x3e5b39[_0x6657('0x34')][_0x6657('0x3f')]);_0x5243bb[_0x6657('0x40')]=qs['filters'](_[_0x6657('0x41')](_0x3e5b39[_0x6657('0x34')],_0x502c12[_0x6657('0x36')]));if(_0x3e5b39['query'][_0x6657('0x42')]){_0x5243bb[_0x6657('0x40')]=_[_0x6657('0x43')](_0x5243bb[_0x6657('0x40')],{'$or':_[_0x6657('0x30')](_0xf7fb1b,function(_0x19bc34){if(_0x19bc34[_0x6657('0x44')]!==_0x6657('0x45')){var _0xaa2936={};_0xaa2936[_0x19bc34[_0x6657('0x2d')]]={'$like':'%'+_0x3e5b39[_0x6657('0x34')][_0x6657('0x42')]+'%'};return _0xaa2936;}})});}_0x5243bb=_[_0x6657('0x43')]({},_0x5243bb,_0x3e5b39[_0x6657('0x46')]);var _0x31619d={'where':_0x5243bb[_0x6657('0x40')]};return db[_0x6657('0x31')]['count'](_0x31619d)[_0x6657('0x27')](function(_0x3a2a20){_0x2083e3['count']=_0x3a2a20;if(_0x3e5b39[_0x6657('0x34')][_0x6657('0x47')]){_0x5243bb[_0x6657('0x48')]=[{'all':!![]}];}return db[_0x6657('0x31')][_0x6657('0x49')](_0x5243bb);})[_0x6657('0x27')](function(_0x35410f){_0x2083e3[_0x6657('0x4a')]=_0x35410f;return _0x2083e3;})['then'](respondWithFilteredResult(_0x35be7,_0x5243bb))['catch'](handleError(_0x35be7,null));};exports[_0x6657('0x4b')]=function(_0x5e0ee4,_0x4a493d){var _0x24ff0a={'raw':![],'where':{'id':_0x5e0ee4[_0x6657('0x4c')]['id']}},_0x522d93={};_0x522d93[_0x6657('0x38')]=_[_0x6657('0x35')](db[_0x6657('0x31')][_0x6657('0x32')]);_0x522d93[_0x6657('0x34')]=_[_0x6657('0x35')](_0x5e0ee4[_0x6657('0x34')]);_0x522d93['filters']=_[_0x6657('0x37')](_0x522d93[_0x6657('0x38')],_0x522d93[_0x6657('0x34')]);_0x24ff0a['attributes']=_['intersection'](_0x522d93[_0x6657('0x38')],qs[_0x6657('0x3a')](_0x5e0ee4[_0x6657('0x34')][_0x6657('0x3a')]));_0x24ff0a['attributes']=_0x24ff0a[_0x6657('0x39')][_0x6657('0x3b')]?_0x24ff0a[_0x6657('0x39')]:_0x522d93[_0x6657('0x38')];if(_0x5e0ee4[_0x6657('0x34')][_0x6657('0x47')]){_0x24ff0a['include']=[{'all':!![]}];}_0x24ff0a=_[_0x6657('0x43')]({},_0x24ff0a,_0x5e0ee4[_0x6657('0x46')]);return db['VoicePrefix']['find'](_0x24ff0a)[_0x6657('0x27')](handleEntityNotFound(_0x4a493d,null))[_0x6657('0x27')](respondWithResult(_0x4a493d,null))[_0x6657('0x4d')](handleError(_0x4a493d,null));};exports[_0x6657('0x2a')]=function(_0x573628,_0x165ba7){return db[_0x6657('0x31')]['find']({'where':{'id':_0x573628[_0x6657('0x4c')]['id']}})[_0x6657('0x27')](handleEntityNotFound(_0x165ba7,null))[_0x6657('0x27')](removeEntity(_0x165ba7,null))['catch'](handleError(_0x165ba7,null));};exports[_0x6657('0x4e')]=function(_0x2c516f,_0x4cd966){return db['VoicePrefix'][_0x6657('0x4e')]()[_0x6657('0x27')](respondWithResult(_0x4cd966,null))['catch'](handleError(_0x4cd966,null));};exports['create']=function(_0x4d8401,_0x2b7209){var _0x161270;return db[_0x6657('0x4f')][_0x6657('0x50')](function(_0x49f956){return db[_0x6657('0x31')][_0x6657('0x51')](_0x4d8401[_0x6657('0x52')],{'transaction':_0x49f956})[_0x6657('0x27')](function(_0x9b8f82){_0x161270=_0x9b8f82['get']({'plain':!![]});return db[_0x6657('0x53')][_0x6657('0x54')]({'where':{'id':_0x161270[_0x6657('0x55')]},'raw':!![]})[_0x6657('0x27')](function(_0x41410e){return createVoicePrefixExtensions(_0x161270,_0x41410e,_0x49f956);});});})['then'](function(){var _0xee8980=_0x4d8401['user']['get']({'plain':!![]});if(!_0xee8980)throw new Error(_0x6657('0x56'));if(_0xee8980[_0x6657('0x57')]==='user'){var _0x31febe=_0x161270;return db[_0x6657('0x58')][_0x6657('0x54')]({'where':{'name':_0x6657('0x29'),'userProfileId':_0xee8980['userProfileId']},'raw':!![]})[_0x6657('0x27')](function(_0xd8ae84){if(_0xd8ae84&&_0xd8ae84[_0x6657('0x59')]===0x0){return db[_0x6657('0x5a')][_0x6657('0x51')]({'name':_0x31febe['name'],'resourceId':_0x31febe['id'],'type':_0xd8ae84[_0x6657('0x2d')],'sectionId':_0xd8ae84['id']},{})[_0x6657('0x27')](function(){return _0x161270;});}else{return _0x161270;}})[_0x6657('0x4d')](function(_0x2eee8c){logger[_0x6657('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2eee8c);throw _0x2eee8c;});}return _0x161270;})[_0x6657('0x27')](respondWithResult(_0x2b7209,null))[_0x6657('0x4d')](handleError(_0x2b7209,null));};function Extension(_0x4814f5,_0x2fe660,_0x257f1d,_0x2933cd){this[_0x6657('0x5b')]='from-sip';this[_0x6657('0x5c')]=_0x4814f5;this[_0x6657('0x5d')]=_0x257f1d;this['type']='system';this[_0x6657('0x5e')]=_0x6657('0x5f');this[_0x6657('0x60')]=_0x2fe660;this[_0x6657('0x61')]=_0x2933cd;}function createVoicePrefixExtensions(_0x46c129,_0x1498e8,_0x56c481){return new BPromise(function(_0x12bcc1,_0x3e0234){var _0x524084=new Extension(formatPrefixName(_0x46c129['prefix']),0x1,_0x6657('0x62'),_0x6657('0x63'));_0x524084['VoicePrefixId']=_0x46c129['id'];return db['VoiceExtension'][_0x6657('0x51')](_0x524084,{'transaction':_0x56c481})[_0x6657('0x27')](function(_0x3b9d67){var _0x43cdb9=_0x3b9d67[_0x6657('0x28')]({'plain':!![]});var _0x5d33cd=_[_0x6657('0x30')](addVoicePrefixExtensions(_0x46c129,_0x1498e8),function(_0xa7c37f){_0xa7c37f[_0x6657('0x55')]=_0x43cdb9['id'];_0xa7c37f[_0x6657('0x64')]=_0x46c129['id'];return _0xa7c37f;});return db[_0x6657('0x53')][_0x6657('0x65')](_0x5d33cd,{'transaction':_0x56c481})[_0x6657('0x27')](function(_0x4317d){if(!_0x4317d){return _0x3e0234(_0x6657('0x66'));}else{return _0x12bcc1(_0x4317d);}})[_0x6657('0x4d')](function(_0x454264){return _0x3e0234(_0x454264);});});;});};function addVoicePrefixExtensions(_0x29b996,_0x33ca38){var _0x5a46f5=[];var _0x5c7a56=formatPrefixName(_0x29b996[_0x6657('0x67')]);_0x5a46f5['push'](new Extension(_0x5c7a56,0x2,_0x6657('0x68'),_0x6657('0x69')+_0x29b996[_0x6657('0x2d')]));if(_0x29b996[_0x6657('0x6a')]){_0x5a46f5[_0x6657('0x6b')](new Extension(_0x5c7a56,0x3,_0x6657('0x68'),_0x6657('0x6c')+_0x29b996[_0x6657('0x6a')]));}else{_0x5a46f5[_0x6657('0x6b')](new Extension(_0x5c7a56,0x3,_0x6657('0x62'),_0x6657('0x6d')));}_0x5a46f5['push'](new Extension(_0x5c7a56,0x4,_0x6657('0x6e'),_0x33ca38['context']+','+_0x6657('0x6f')+(0x8+_0x29b996['name'][_0x6657('0x3b')])+'}'+','+0x1));return _0x5a46f5;}function formatPrefixName(_0x18545){var _0x239653='_';for(var _0x31a109=0x0;_0x31a109<_0x18545[_0x6657('0x3b')];_0x31a109++){if(_0x18545[_0x6657('0x70')](_0x31a109)=='-'){_0x239653+=_0x18545[_0x6657('0x70')](_0x31a109);}else{_0x239653+='['+_0x18545[_0x6657('0x70')](_0x31a109)+']';}}_0x239653+='.';return _0x239653;}exports[_0x6657('0x71')]=function(_0x3bea6f,_0x204fc0,_0x559663){var _0x5cfb0b=_0x3bea6f['body'];_0x5cfb0b[_0x6657('0x67')]=_0x6657('0x72')+_0x5cfb0b['name']+'-';return db[_0x6657('0x4f')][_0x6657('0x50')](function(_0x2cb992){return db[_0x6657('0x31')][_0x6657('0x71')](_0x5cfb0b,{'where':{'id':_0x5cfb0b['id']},'transaction':_0x2cb992})[_0x6657('0x27')](function(){return db[_0x6657('0x53')][_0x6657('0x2a')]({'where':{'VoicePrefixId':_0x5cfb0b['id']},'transaction':_0x2cb992})[_0x6657('0x27')](function(){return db['VoiceExtension'][_0x6657('0x54')]({'where':{'id':_0x5cfb0b[_0x6657('0x55')]},'raw':!![]})[_0x6657('0x27')](function(_0x53b3e3){return createVoicePrefixExtensions(_0x5cfb0b,_0x53b3e3,_0x2cb992);});});});})[_0x6657('0x27')](function(){return db[_0x6657('0x31')]['findById'](_0x5cfb0b['id']);})['then'](respondWithResult(_0x204fc0,null))[_0x6657('0x4d')](handleError(_0x204fc0,null));};exports[_0x6657('0x73')]=function(_0x55d44f,_0x2cc8ab,_0x150eb){return db['VoicePrefix'][_0x6657('0x54')]({'where':{'id':_0x55d44f[_0x6657('0x4c')]['id']}})[_0x6657('0x27')](handleEntityNotFound(_0x2cc8ab,null))[_0x6657('0x27')](function(_0x3ce09d){if(_0x3ce09d){return _0x3ce09d[_0x6657('0x73')](_0x55d44f['body'][_0x6657('0x74')],_[_0x6657('0x75')](_0x55d44f['body'],[_0x6657('0x74'),'id'])||{})[_0x6657('0x76')](function(_0x17c080){for(var _0xe07f41=0x0;_0xe07f41<_0x55d44f[_0x6657('0x52')][_0x6657('0x74')][_0x6657('0x3b')];_0xe07f41+=0x1){socket[_0x6657('0x77')](_0x6657('0x78'),{'UserId':_0x55d44f[_0x6657('0x52')][_0x6657('0x74')][_0xe07f41],'VoicePrefixId':_0x55d44f['params']['id']});}return _0x17c080;});}})['then'](respondWithResult(_0x2cc8ab,null))[_0x6657('0x4d')](handleError(_0x2cc8ab,null));};exports[_0x6657('0x79')]=function(_0x53dce8,_0xb7bf7c,_0x31876c){return db[_0x6657('0x31')]['find']({'where':{'id':_0x53dce8['params']['id']}})[_0x6657('0x27')](handleEntityNotFound(_0xb7bf7c,null))['then'](function(_0x1350f8){if(_0x1350f8){return _0x1350f8['removeAgents'](_0x53dce8[_0x6657('0x34')][_0x6657('0x74')])[_0x6657('0x27')](function(){if(_[_0x6657('0x7a')](_0x53dce8['query'][_0x6657('0x74')])){for(var _0x1d1f29=0x0;_0x1d1f29<_0x53dce8[_0x6657('0x34')]['ids'][_0x6657('0x3b')];_0x1d1f29+=0x1){socket['emit'](_0x6657('0x7b'),{'UserId':Number(_0x53dce8[_0x6657('0x34')][_0x6657('0x74')][_0x1d1f29]),'VoicePrefixId':Number(_0x53dce8[_0x6657('0x4c')]['id'])});}}else{socket['emit'](_0x6657('0x7b'),{'UserId':Number(_0x53dce8[_0x6657('0x34')][_0x6657('0x74')]),'VoicePrefixId':Number(_0x53dce8[_0x6657('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0xb7bf7c,null))[_0x6657('0x4d')](handleError(_0xb7bf7c,null));};exports[_0x6657('0x7c')]=function(_0x416db8,_0x5ec7b8,_0x5b9106){var _0x4623bc={};var _0x5a4fad={};var _0x4f4218;var _0x3986f2;return db[_0x6657('0x31')][_0x6657('0x7d')]({'where':{'id':_0x416db8[_0x6657('0x4c')]['id']}})[_0x6657('0x27')](handleEntityNotFound(_0x5ec7b8,null))[_0x6657('0x27')](function(_0x356c81){if(_0x356c81){_0x4f4218=_0x356c81;_0x5a4fad[_0x6657('0x38')]=_[_0x6657('0x35')](db[_0x6657('0x7e')][_0x6657('0x32')]);_0x5a4fad[_0x6657('0x34')]=_[_0x6657('0x35')](_0x416db8['query']);_0x5a4fad['filters']=_[_0x6657('0x37')](_0x5a4fad[_0x6657('0x38')],_0x5a4fad[_0x6657('0x34')]);_0x4623bc[_0x6657('0x39')]=_['intersection'](_0x5a4fad[_0x6657('0x38')],qs[_0x6657('0x3a')](_0x416db8[_0x6657('0x34')]['fields']));_0x4623bc[_0x6657('0x39')]=_0x4623bc[_0x6657('0x39')][_0x6657('0x3b')]?_0x4623bc['attributes']:_0x5a4fad[_0x6657('0x38')];_0x4623bc[_0x6657('0x7f')]=qs[_0x6657('0x3f')](_0x416db8[_0x6657('0x34')][_0x6657('0x3f')]);_0x4623bc[_0x6657('0x40')]=qs[_0x6657('0x36')](_[_0x6657('0x41')](_0x416db8['query'],_0x5a4fad['filters']));if(_0x416db8[_0x6657('0x34')]['filter']){_0x4623bc['where']=_[_0x6657('0x43')](_0x4623bc[_0x6657('0x40')],{'$or':_[_0x6657('0x30')](_0x4623bc[_0x6657('0x39')],function(_0x5e4a6d){var _0x38eb66={};_0x38eb66[_0x5e4a6d]={'$like':'%'+_0x416db8['query'][_0x6657('0x42')]+'%'};return _0x38eb66;})});}_0x4623bc=_[_0x6657('0x43')]({},_0x4623bc,_0x416db8[_0x6657('0x46')]);return _0x4f4218[_0x6657('0x7c')](_0x4623bc);}})[_0x6657('0x27')](function(_0x3f3440){if(_0x3f3440){_0x3986f2=_0x3f3440['length'];if(!_0x416db8['query'][_0x6657('0x3c')](_0x6657('0x3d'))){_0x4623bc[_0x6657('0x3e')]=qs['limit'](_0x416db8[_0x6657('0x34')][_0x6657('0x3e')]);_0x4623bc[_0x6657('0x23')]=qs[_0x6657('0x23')](_0x416db8[_0x6657('0x34')][_0x6657('0x23')]);}return _0x4f4218[_0x6657('0x7c')](_0x4623bc);}})[_0x6657('0x27')](function(_0x57184f){if(_0x57184f){return _0x57184f?{'count':_0x3986f2,'rows':_0x57184f}:null;}})['then'](respondWithResult(_0x5ec7b8,null))[_0x6657('0x4d')](handleError(_0x5ec7b8,null));}; \ No newline at end of file +var _0x8f41=['callerIdAll','Set','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','update','findById','addAgents','omit','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','offset','limit','Content-Range','json','apply','save','then','destroy','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','length','find','catch','params','describe','transaction','body','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','push'];(function(_0x583829,_0x188b0e){var _0x34d994=function(_0x568753){while(--_0x568753){_0x583829['push'](_0x583829['shift']());}};_0x34d994(++_0x188b0e);}(_0x8f41,0x182));var _0x18f4=function(_0x2e908b,_0x48503a){_0x2e908b=_0x2e908b-0x0;var _0x1b3b0d=_0x8f41[_0x2e908b];return _0x1b3b0d;};'use strict';var pdf=require(_0x18f4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x18f4('0x1'));var zipdir=require(_0x18f4('0x2'));var jsonpatch=require(_0x18f4('0x3'));var rp=require(_0x18f4('0x4'));var moment=require('moment');var BPromise=require(_0x18f4('0x5'));var Mustache=require('mustache');var util=require(_0x18f4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x18f4('0x7'));var ejs=require(_0x18f4('0x8'));var fs=require('fs');var _=require(_0x18f4('0x9'));var squel=require('squel');var crypto=require(_0x18f4('0xa'));var jsforce=require(_0x18f4('0xb'));var deskjs=require(_0x18f4('0xc'));var toCsv=require(_0x18f4('0x7'));var querystring=require(_0x18f4('0xd'));var Papa=require('papaparse');var Redis=require(_0x18f4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x18f4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18f4('0x10'));var logger=require(_0x18f4('0x11'))(_0x18f4('0x12'));var utils=require(_0x18f4('0x13'));var config=require(_0x18f4('0x14'));var db=require(_0x18f4('0x15'))['db'];config[_0x18f4('0x16')]=_[_0x18f4('0x17')](config['redis'],{'host':_0x18f4('0x18'),'port':0x18eb});var socket=require(_0x18f4('0x19'))(new Redis(config[_0x18f4('0x16')]));require(_0x18f4('0x1a'))[_0x18f4('0x1b')](socket);function respondWithStatusCode(_0xc9f968,_0x1e867d){_0x1e867d=_0x1e867d||0xcc;return function(_0xca9b20){if(_0xca9b20){return _0xc9f968[_0x18f4('0x1c')](_0x1e867d);}return _0xc9f968['status'](_0x1e867d)['end']();};}function respondWithResult(_0x401e6a,_0x4191e7){_0x4191e7=_0x4191e7||0xc8;return function(_0x501fe2){if(_0x501fe2){return _0x401e6a[_0x18f4('0x1d')](_0x4191e7)['json'](_0x501fe2);}};}function respondWithFilteredResult(_0x3a4165,_0x3fde91){return function(_0x49eff4){if(_0x49eff4){var _0x5f0682=_0x49eff4['count'],_0x4fb03b=_0x3fde91[_0x18f4('0x1e')],_0x1575c8=_0x3fde91[_0x18f4('0x1e')]+_0x3fde91[_0x18f4('0x1f')],_0x4d42a2;if(_0x1575c8>=_0x5f0682){_0x1575c8=_0x5f0682;_0x4d42a2=0xc8;}else{_0x4d42a2=0xce;}_0x3a4165[_0x18f4('0x1d')](_0x4d42a2);return _0x3a4165['set'](_0x18f4('0x20'),_0x4fb03b+'-'+_0x1575c8+'/'+_0x5f0682)[_0x18f4('0x21')](_0x49eff4);}return null;};}function patchUpdates(_0x3c0e00){return function(_0x26d652){try{jsonpatch[_0x18f4('0x22')](_0x26d652,_0x3c0e00,!![]);}catch(_0x3406b7){return BPromise['reject'](_0x3406b7);}return _0x26d652[_0x18f4('0x23')]();};}function saveUpdates(_0x4005c7,_0x1cba11){return function(_0x5aeea6){if(_0x5aeea6){return _0x5aeea6['update'](_0x4005c7)[_0x18f4('0x24')](function(_0x4711ef){return _0x4711ef;});}return null;};}function removeEntity(_0x2c330a,_0x4afa1e){return function(_0x1241e9){if(_0x1241e9){return _0x1241e9[_0x18f4('0x25')]()[_0x18f4('0x24')](function(){var _0x392668=_0x1241e9['get']({'plain':!![]});var _0x555698='VoicePrefixes';return db[_0x18f4('0x26')][_0x18f4('0x25')]({'where':{'type':_0x555698,'resourceId':_0x392668['id']}})['then'](function(){return _0x1241e9;});})[_0x18f4('0x24')](function(){_0x2c330a['status'](0xcc)[_0x18f4('0x27')]();});}};}function handleEntityNotFound(_0x1572b0,_0x5292e3){return function(_0xd5c42d){if(!_0xd5c42d){_0x1572b0[_0x18f4('0x1c')](0x194);}return _0xd5c42d;};}function handleError(_0x1ddb75,_0x2d7f3c){_0x2d7f3c=_0x2d7f3c||0x1f4;return function(_0x575db3){logger['error'](_0x575db3[_0x18f4('0x28')]);if(_0x575db3['name']){delete _0x575db3[_0x18f4('0x29')];}_0x1ddb75[_0x18f4('0x1d')](_0x2d7f3c)[_0x18f4('0x2a')](_0x575db3);};}exports[_0x18f4('0x2b')]=function(_0x474ce5,_0x16fc83){var _0x25d92e={},_0x164ede={},_0x2b31c5={'count':0x0,'rows':[]};var _0x3f2226=_[_0x18f4('0x2c')](db[_0x18f4('0x2d')][_0x18f4('0x2e')],function(_0x20ac14){return{'name':_0x20ac14['fieldName'],'type':_0x20ac14[_0x18f4('0x2f')]['key']};});_0x164ede[_0x18f4('0x30')]=_[_0x18f4('0x2c')](_0x3f2226,'name');_0x164ede[_0x18f4('0x31')]=_[_0x18f4('0x32')](_0x474ce5[_0x18f4('0x31')]);_0x164ede[_0x18f4('0x33')]=_[_0x18f4('0x34')](_0x164ede[_0x18f4('0x30')],_0x164ede[_0x18f4('0x31')]);_0x25d92e[_0x18f4('0x35')]=_['intersection'](_0x164ede[_0x18f4('0x30')],qs[_0x18f4('0x36')](_0x474ce5[_0x18f4('0x31')][_0x18f4('0x36')]));_0x25d92e[_0x18f4('0x35')]=_0x25d92e[_0x18f4('0x35')]['length']?_0x25d92e[_0x18f4('0x35')]:_0x164ede[_0x18f4('0x30')];if(!_0x474ce5[_0x18f4('0x31')]['hasOwnProperty'](_0x18f4('0x37'))){_0x25d92e[_0x18f4('0x1f')]=qs['limit'](_0x474ce5[_0x18f4('0x31')]['limit']);_0x25d92e[_0x18f4('0x1e')]=qs[_0x18f4('0x1e')](_0x474ce5[_0x18f4('0x31')][_0x18f4('0x1e')]);}_0x25d92e[_0x18f4('0x38')]=qs[_0x18f4('0x39')](_0x474ce5[_0x18f4('0x31')][_0x18f4('0x39')]);_0x25d92e[_0x18f4('0x3a')]=qs[_0x18f4('0x33')](_[_0x18f4('0x3b')](_0x474ce5[_0x18f4('0x31')],_0x164ede[_0x18f4('0x33')]));if(_0x474ce5[_0x18f4('0x31')][_0x18f4('0x3c')]){_0x25d92e[_0x18f4('0x3a')]=_[_0x18f4('0x3d')](_0x25d92e[_0x18f4('0x3a')],{'$or':_[_0x18f4('0x2c')](_0x3f2226,function(_0x288ae3){if(_0x288ae3[_0x18f4('0x2f')]!==_0x18f4('0x3e')){var _0x4d80c3={};_0x4d80c3[_0x288ae3['name']]={'$like':'%'+_0x474ce5['query']['filter']+'%'};return _0x4d80c3;}})});}_0x25d92e=_[_0x18f4('0x3d')]({},_0x25d92e,_0x474ce5[_0x18f4('0x3f')]);var _0x1135a2={'where':_0x25d92e['where']};return db[_0x18f4('0x2d')]['count'](_0x1135a2)[_0x18f4('0x24')](function(_0x2ddec0){_0x2b31c5[_0x18f4('0x40')]=_0x2ddec0;if(_0x474ce5[_0x18f4('0x31')]['includeAll']){_0x25d92e[_0x18f4('0x41')]=[{'all':!![]}];}return db['VoicePrefix'][_0x18f4('0x42')](_0x25d92e);})['then'](function(_0x23c880){_0x2b31c5[_0x18f4('0x43')]=_0x23c880;return _0x2b31c5;})[_0x18f4('0x24')](respondWithFilteredResult(_0x16fc83,_0x25d92e))['catch'](handleError(_0x16fc83,null));};exports[_0x18f4('0x44')]=function(_0x4e9000,_0x3eaade){var _0x414737={'raw':![],'where':{'id':_0x4e9000['params']['id']}},_0x8c0a7c={};_0x8c0a7c[_0x18f4('0x30')]=_[_0x18f4('0x32')](db['VoicePrefix'][_0x18f4('0x2e')]);_0x8c0a7c[_0x18f4('0x31')]=_[_0x18f4('0x32')](_0x4e9000[_0x18f4('0x31')]);_0x8c0a7c['filters']=_[_0x18f4('0x34')](_0x8c0a7c[_0x18f4('0x30')],_0x8c0a7c['query']);_0x414737[_0x18f4('0x35')]=_[_0x18f4('0x34')](_0x8c0a7c[_0x18f4('0x30')],qs['fields'](_0x4e9000[_0x18f4('0x31')][_0x18f4('0x36')]));_0x414737[_0x18f4('0x35')]=_0x414737['attributes'][_0x18f4('0x45')]?_0x414737[_0x18f4('0x35')]:_0x8c0a7c[_0x18f4('0x30')];if(_0x4e9000[_0x18f4('0x31')]['includeAll']){_0x414737[_0x18f4('0x41')]=[{'all':!![]}];}_0x414737=_[_0x18f4('0x3d')]({},_0x414737,_0x4e9000['options']);return db[_0x18f4('0x2d')][_0x18f4('0x46')](_0x414737)[_0x18f4('0x24')](handleEntityNotFound(_0x3eaade,null))[_0x18f4('0x24')](respondWithResult(_0x3eaade,null))[_0x18f4('0x47')](handleError(_0x3eaade,null));};exports[_0x18f4('0x25')]=function(_0x2b160e,_0x30c127){return db[_0x18f4('0x2d')][_0x18f4('0x46')]({'where':{'id':_0x2b160e[_0x18f4('0x48')]['id']}})[_0x18f4('0x24')](handleEntityNotFound(_0x30c127,null))[_0x18f4('0x24')](removeEntity(_0x30c127,null))[_0x18f4('0x47')](handleError(_0x30c127,null));};exports[_0x18f4('0x49')]=function(_0x4e24fd,_0xf95482){return db[_0x18f4('0x2d')]['describe']()[_0x18f4('0x24')](respondWithResult(_0xf95482,null))['catch'](handleError(_0xf95482,null));};exports['create']=function(_0x5623b3,_0x1f8372){var _0x53f3c7;return db['sequelize'][_0x18f4('0x4a')](function(_0x257f4d){return db[_0x18f4('0x2d')]['create'](_0x5623b3[_0x18f4('0x4b')],{'transaction':_0x257f4d})[_0x18f4('0x24')](function(_0x26c9a2){_0x53f3c7=_0x26c9a2[_0x18f4('0x4c')]({'plain':!![]});return db['VoiceExtension'][_0x18f4('0x46')]({'where':{'id':_0x53f3c7['VoiceExtensionId']},'raw':!![]})[_0x18f4('0x24')](function(_0x35e11c){return createVoicePrefixExtensions(_0x53f3c7,_0x35e11c,_0x257f4d);});});})['then'](function(){var _0x396f5f=_0x5623b3[_0x18f4('0x4d')][_0x18f4('0x4c')]({'plain':!![]});if(!_0x396f5f)throw new Error(_0x18f4('0x4e'));if(_0x396f5f['role']===_0x18f4('0x4d')){var _0x2dedf9=_0x53f3c7;return db[_0x18f4('0x4f')][_0x18f4('0x46')]({'where':{'name':_0x18f4('0x50'),'userProfileId':_0x396f5f['userProfileId']},'raw':!![]})[_0x18f4('0x24')](function(_0x49ec68){if(_0x49ec68&&_0x49ec68[_0x18f4('0x51')]===0x0){return db['UserProfileResource'][_0x18f4('0x52')]({'name':_0x2dedf9[_0x18f4('0x29')],'resourceId':_0x2dedf9['id'],'type':_0x49ec68[_0x18f4('0x29')],'sectionId':_0x49ec68['id']},{})['then'](function(){return _0x53f3c7;});}else{return _0x53f3c7;}})['catch'](function(_0x575ce2){logger['error'](_0x18f4('0x53'),_0x575ce2);throw _0x575ce2;});}return _0x53f3c7;})[_0x18f4('0x24')](respondWithResult(_0x1f8372,null))[_0x18f4('0x47')](handleError(_0x1f8372,null));};function Extension(_0x3a3f55,_0x38d2d2,_0x35891e,_0xfba90c){this['context']=_0x18f4('0x54');this['exten']=_0x3a3f55;this[_0x18f4('0x55')]=_0x35891e;this[_0x18f4('0x2f')]=_0x18f4('0x56');this[_0x18f4('0x57')]=_0x18f4('0x58');this[_0x18f4('0x59')]=_0x38d2d2;this[_0x18f4('0x5a')]=_0xfba90c;}function createVoicePrefixExtensions(_0x3032d7,_0xd2ae84,_0x3fd002){return new BPromise(function(_0x4100cb,_0x13029e){var _0x261fd6=new Extension(formatPrefixName(_0x3032d7[_0x18f4('0x5b')]),0x1,'NoOp',_0x18f4('0x5c'));_0x261fd6[_0x18f4('0x5d')]=_0x3032d7['id'];return db[_0x18f4('0x5e')][_0x18f4('0x52')](_0x261fd6,{'transaction':_0x3fd002})[_0x18f4('0x24')](function(_0x36b5ca){var _0x53a4e9=_0x36b5ca['get']({'plain':!![]});var _0x357715=_['map'](addVoicePrefixExtensions(_0x3032d7,_0xd2ae84),function(_0x1b057c){_0x1b057c[_0x18f4('0x5f')]=_0x53a4e9['id'];_0x1b057c[_0x18f4('0x5d')]=_0x3032d7['id'];return _0x1b057c;});return db['VoiceExtension'][_0x18f4('0x60')](_0x357715,{'transaction':_0x3fd002})['then'](function(_0x398066){if(!_0x398066){return _0x13029e('Extensions\x20creation\x20failed');}else{return _0x4100cb(_0x398066);}})[_0x18f4('0x47')](function(_0x427252){return _0x13029e(_0x427252);});});;});};function addVoicePrefixExtensions(_0x43c974,_0x517ac2){var _0x1c5596=[];var _0x33964e=formatPrefixName(_0x43c974[_0x18f4('0x5b')]);_0x1c5596[_0x18f4('0x61')](new Extension(_0x33964e,0x2,'Set','CDR(prefix)='+_0x43c974[_0x18f4('0x29')]));if(_0x43c974[_0x18f4('0x62')]){_0x1c5596[_0x18f4('0x61')](new Extension(_0x33964e,0x3,_0x18f4('0x63'),_0x18f4('0x64')+_0x43c974['callerIdAll']));}else{_0x1c5596[_0x18f4('0x61')](new Extension(_0x33964e,0x3,_0x18f4('0x65'),_0x18f4('0x66')));}_0x1c5596[_0x18f4('0x61')](new Extension(_0x33964e,0x4,_0x18f4('0x67'),_0x517ac2[_0x18f4('0x68')]+','+_0x18f4('0x69')+(0x8+_0x43c974[_0x18f4('0x29')][_0x18f4('0x45')])+'}'+','+0x1));return _0x1c5596;}function formatPrefixName(_0x5d6dae){var _0x2fb930='_';for(var _0x29a776=0x0;_0x29a776<_0x5d6dae['length'];_0x29a776++){if(_0x5d6dae[_0x18f4('0x6a')](_0x29a776)=='-'){_0x2fb930+=_0x5d6dae[_0x18f4('0x6a')](_0x29a776);}else{_0x2fb930+='['+_0x5d6dae['charAt'](_0x29a776)+']';}}_0x2fb930+='.';return _0x2fb930;}exports[_0x18f4('0x6b')]=function(_0x45262f,_0x2c3857,_0x1f5dfb){var _0x37c80d=_0x45262f[_0x18f4('0x4b')];_0x37c80d[_0x18f4('0x5b')]='system-'+_0x37c80d[_0x18f4('0x29')]+'-';return db['sequelize']['transaction'](function(_0x54aa7c){return db['VoicePrefix'][_0x18f4('0x6b')](_0x37c80d,{'where':{'id':_0x37c80d['id']},'transaction':_0x54aa7c})[_0x18f4('0x24')](function(){return db[_0x18f4('0x5e')]['destroy']({'where':{'VoicePrefixId':_0x37c80d['id']},'transaction':_0x54aa7c})[_0x18f4('0x24')](function(){return db['VoiceExtension'][_0x18f4('0x46')]({'where':{'id':_0x37c80d[_0x18f4('0x5f')]},'raw':!![]})['then'](function(_0x8de597){return createVoicePrefixExtensions(_0x37c80d,_0x8de597,_0x54aa7c);});});});})[_0x18f4('0x24')](function(){return db[_0x18f4('0x2d')][_0x18f4('0x6c')](_0x37c80d['id']);})[_0x18f4('0x24')](respondWithResult(_0x2c3857,null))['catch'](handleError(_0x2c3857,null));};exports[_0x18f4('0x6d')]=function(_0x541a96,_0x1315e1,_0x370830){return db[_0x18f4('0x2d')][_0x18f4('0x46')]({'where':{'id':_0x541a96['params']['id']}})['then'](handleEntityNotFound(_0x1315e1,null))[_0x18f4('0x24')](function(_0x29da1a){if(_0x29da1a){return _0x29da1a[_0x18f4('0x6d')](_0x541a96['body']['ids'],_[_0x18f4('0x6e')](_0x541a96[_0x18f4('0x4b')],[_0x18f4('0x6f'),'id'])||{})['spread'](function(_0x11a832){for(var _0x524d60=0x0;_0x524d60<_0x541a96[_0x18f4('0x4b')][_0x18f4('0x6f')][_0x18f4('0x45')];_0x524d60+=0x1){socket['emit'](_0x18f4('0x70'),{'UserId':_0x541a96[_0x18f4('0x4b')][_0x18f4('0x6f')][_0x524d60],'VoicePrefixId':_0x541a96['params']['id']});}return _0x11a832;});}})[_0x18f4('0x24')](respondWithResult(_0x1315e1,null))[_0x18f4('0x47')](handleError(_0x1315e1,null));};exports['removeAgents']=function(_0x541a66,_0x523305,_0xa0dd9f){return db['VoicePrefix']['find']({'where':{'id':_0x541a66[_0x18f4('0x48')]['id']}})['then'](handleEntityNotFound(_0x523305,null))[_0x18f4('0x24')](function(_0x44dda2){if(_0x44dda2){return _0x44dda2[_0x18f4('0x71')](_0x541a66['query'][_0x18f4('0x6f')])[_0x18f4('0x24')](function(){if(_[_0x18f4('0x72')](_0x541a66['query'][_0x18f4('0x6f')])){for(var _0x3584d8=0x0;_0x3584d8<_0x541a66[_0x18f4('0x31')][_0x18f4('0x6f')][_0x18f4('0x45')];_0x3584d8+=0x1){socket[_0x18f4('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x541a66[_0x18f4('0x31')][_0x18f4('0x6f')][_0x3584d8]),'VoicePrefixId':Number(_0x541a66[_0x18f4('0x48')]['id'])});}}else{socket['emit'](_0x18f4('0x74'),{'UserId':Number(_0x541a66[_0x18f4('0x31')][_0x18f4('0x6f')]),'VoicePrefixId':Number(_0x541a66[_0x18f4('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x523305,null))[_0x18f4('0x47')](handleError(_0x523305,null));};exports[_0x18f4('0x75')]=function(_0xcb0221,_0x351aec,_0x1249ef){var _0x413695={};var _0x499076={};var _0x2ccd87;var _0x5e794a;return db['VoicePrefix'][_0x18f4('0x76')]({'where':{'id':_0xcb0221[_0x18f4('0x48')]['id']}})['then'](handleEntityNotFound(_0x351aec,null))[_0x18f4('0x24')](function(_0x57b606){if(_0x57b606){_0x2ccd87=_0x57b606;_0x499076[_0x18f4('0x30')]=_[_0x18f4('0x32')](db[_0x18f4('0x77')][_0x18f4('0x2e')]);_0x499076['query']=_['keys'](_0xcb0221[_0x18f4('0x31')]);_0x499076[_0x18f4('0x33')]=_[_0x18f4('0x34')](_0x499076['model'],_0x499076[_0x18f4('0x31')]);_0x413695[_0x18f4('0x35')]=_[_0x18f4('0x34')](_0x499076[_0x18f4('0x30')],qs[_0x18f4('0x36')](_0xcb0221[_0x18f4('0x31')][_0x18f4('0x36')]));_0x413695[_0x18f4('0x35')]=_0x413695[_0x18f4('0x35')][_0x18f4('0x45')]?_0x413695[_0x18f4('0x35')]:_0x499076[_0x18f4('0x30')];_0x413695[_0x18f4('0x38')]=qs[_0x18f4('0x39')](_0xcb0221[_0x18f4('0x31')]['sort']);_0x413695[_0x18f4('0x3a')]=qs[_0x18f4('0x33')](_[_0x18f4('0x3b')](_0xcb0221[_0x18f4('0x31')],_0x499076[_0x18f4('0x33')]));if(_0xcb0221[_0x18f4('0x31')][_0x18f4('0x3c')]){_0x413695[_0x18f4('0x3a')]=_[_0x18f4('0x3d')](_0x413695[_0x18f4('0x3a')],{'$or':_[_0x18f4('0x2c')](_0x413695[_0x18f4('0x35')],function(_0x371ebe){var _0xebf5f={};_0xebf5f[_0x371ebe]={'$like':'%'+_0xcb0221[_0x18f4('0x31')][_0x18f4('0x3c')]+'%'};return _0xebf5f;})});}_0x413695=_[_0x18f4('0x3d')]({},_0x413695,_0xcb0221[_0x18f4('0x3f')]);return _0x2ccd87[_0x18f4('0x75')](_0x413695);}})[_0x18f4('0x24')](function(_0x4cdf4b){if(_0x4cdf4b){_0x5e794a=_0x4cdf4b[_0x18f4('0x45')];if(!_0xcb0221[_0x18f4('0x31')][_0x18f4('0x78')](_0x18f4('0x37'))){_0x413695['limit']=qs['limit'](_0xcb0221[_0x18f4('0x31')][_0x18f4('0x1f')]);_0x413695[_0x18f4('0x1e')]=qs[_0x18f4('0x1e')](_0xcb0221[_0x18f4('0x31')][_0x18f4('0x1e')]);}return _0x2ccd87[_0x18f4('0x75')](_0x413695);}})['then'](function(_0x77ea5f){if(_0x77ea5f){return _0x77ea5f?{'count':_0x5e794a,'rows':_0x77ea5f}:null;}})[_0x18f4('0x24')](respondWithResult(_0x351aec,null))['catch'](handleError(_0x351aec,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 80c99d5..2e79870 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 _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x7eb28d,_0x49731a){var _0x3c6044=function(_0x32dbd0){while(--_0x32dbd0){_0x7eb28d['push'](_0x7eb28d['shift']());}};_0x3c6044(++_0x49731a);}(_0x008c,0x188));var _0xc008=function(_0x4c1176,_0xf999e9){_0x4c1176=_0x4c1176-0x0;var _0x2aca97=_0x008c[_0x4c1176];return _0x2aca97;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x34e8,0x12c));var _0x834e=function(_0x4a89e2,_0xdf0859){_0x4a89e2=_0x4a89e2-0x0;var _0x17c82a=_0x34e8[_0x4a89e2];return _0x17c82a;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoicePrefix=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoicePrefixEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoicePrefixEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 14a8539..c2932d8 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 _0xfc43=['VoicePrefix','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./voicePrefix.attributes','exports'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xfc43,0x17d));var _0x3fc4=function(_0x5d76a7,_0x253b66){_0x5d76a7=_0x5d76a7-0x0;var _0x253877=_0xfc43[_0x5d76a7];return _0x253877;};'use strict';var _=require(_0x3fc4('0x0'));var util=require('util');var logger=require(_0x3fc4('0x1'))(_0x3fc4('0x2'));var moment=require(_0x3fc4('0x3'));var BPromise=require(_0x3fc4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fc4('0x5'));var rimraf=require('rimraf');var config=require(_0x3fc4('0x6'));var attributes=require(_0x3fc4('0x7'));module[_0x3fc4('0x8')]=function(_0x170811,_0x3b6b61){return _0x170811['define'](_0x3fc4('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52a3=['moment','bluebird','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','util','../../config/logger','api'];(function(_0x4b7daa,_0x1f757d){var _0x562776=function(_0x4bbe7b){while(--_0x4bbe7b){_0x4b7daa['push'](_0x4b7daa['shift']());}};_0x562776(++_0x1f757d);}(_0x52a3,0x8c));var _0x352a=function(_0x33b990,_0x3d5a5f){_0x33b990=_0x33b990-0x0;var _0x77ae88=_0x52a3[_0x33b990];return _0x77ae88;};'use strict';var _=require('lodash');var util=require(_0x352a('0x0'));var logger=require(_0x352a('0x1'))(_0x352a('0x2'));var moment=require(_0x352a('0x3'));var BPromise=require(_0x352a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x352a('0x5'));var config=require(_0x352a('0x6'));var attributes=require(_0x352a('0x7'));module[_0x352a('0x8')]=function(_0x195244,_0x146ce0){return _0x195244['define'](_0x352a('0x9'),attributes,{'tableName':_0x352a('0xa'),'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 3020475..0cb46dd 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 _0x1e4c=['request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1e4c,0x1bc));var _0xc1e4=function(_0x522b35,_0x53ac9a){_0x522b35=_0x522b35-0x0;var _0x298327=_0x1e4c[_0x522b35];return _0x298327;};'use strict';var _=require(_0xc1e4('0x0'));var util=require(_0xc1e4('0x1'));var moment=require(_0xc1e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc1e4('0x4'));var logger=require(_0xc1e4('0x5'))(_0xc1e4('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1e4('0x7'));var client=jayson[_0xc1e4('0x8')][_0xc1e4('0x9')]({'port':0x232a});config[_0xc1e4('0xa')]=_[_0xc1e4('0xb')](config['redis'],{'host':_0xc1e4('0xc'),'port':0x18eb});var socket=require(_0xc1e4('0xd'))(new Redis(config[_0xc1e4('0xa')]));require('./voicePrefix.socket')[_0xc1e4('0xe')](socket);function respondWithRpcPromise(_0x5db656,_0x400d0b,_0x368d75){return new BPromise(function(_0x574569,_0x480cb4){return client[_0xc1e4('0xf')](_0x5db656,_0x368d75)[_0xc1e4('0x10')](function(_0x261cc5){logger[_0xc1e4('0x11')](_0xc1e4('0x12'),_0x400d0b,'request\x20sent');logger[_0xc1e4('0x13')](_0xc1e4('0x14'),_0x400d0b,_0xc1e4('0x15'),JSON[_0xc1e4('0x16')](_0x261cc5));if(_0x261cc5['error']){if(_0x261cc5[_0xc1e4('0x17')][_0xc1e4('0x18')]===0x1f4){logger[_0xc1e4('0x17')](_0xc1e4('0x12'),_0x400d0b,_0x261cc5['error'][_0xc1e4('0x19')]);return _0x480cb4(_0x261cc5[_0xc1e4('0x17')][_0xc1e4('0x19')]);}logger[_0xc1e4('0x17')](_0xc1e4('0x12'),_0x400d0b,_0x261cc5[_0xc1e4('0x17')]['message']);return _0x574569(_0x261cc5[_0xc1e4('0x17')][_0xc1e4('0x19')]);}else{logger[_0xc1e4('0x11')](_0xc1e4('0x12'),_0x400d0b,_0xc1e4('0x15'));_0x574569(_0x261cc5['result'][_0xc1e4('0x19')]);}})[_0xc1e4('0x1a')](function(_0x45f5ac){logger['error'](_0xc1e4('0x12'),_0x400d0b,_0x45f5ac);_0x480cb4(_0x45f5ac);});});} \ No newline at end of file +var _0x003b=['socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x33c310,_0x9647a4){var _0x54a097=function(_0x17ef7d){while(--_0x17ef7d){_0x33c310['push'](_0x33c310['shift']());}};_0x54a097(++_0x9647a4);}(_0x003b,0xd4));var _0xb003=function(_0x4a003d,_0x2406ba){_0x4a003d=_0x4a003d-0x0;var _0x537006=_0x003b[_0x4a003d];return _0x537006;};'use strict';var _=require(_0xb003('0x0'));var util=require(_0xb003('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb003('0x2'));var fs=require('fs');var Redis=require(_0xb003('0x3'));var db=require(_0xb003('0x4'))['db'];var utils=require(_0xb003('0x5'));var logger=require(_0xb003('0x6'))('rpc');var config=require(_0xb003('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb003('0x8')][_0xb003('0x9')]({'port':0x232a});config['redis']=_[_0xb003('0xa')](config[_0xb003('0xb')],{'host':_0xb003('0xc'),'port':0x18eb});var socket=require(_0xb003('0xd'))(new Redis(config[_0xb003('0xb')]));require('./voicePrefix.socket')[_0xb003('0xe')](socket);function respondWithRpcPromise(_0x3078a6,_0x362a33,_0x2780c1){return new BPromise(function(_0x5148e8,_0x28574a){return client['request'](_0x3078a6,_0x2780c1)[_0xb003('0xf')](function(_0x2ed256){logger[_0xb003('0x10')](_0xb003('0x11'),_0x362a33,_0xb003('0x12'));logger[_0xb003('0x13')](_0xb003('0x14'),_0x362a33,_0xb003('0x12'),JSON['stringify'](_0x2ed256));if(_0x2ed256[_0xb003('0x15')]){if(_0x2ed256[_0xb003('0x15')][_0xb003('0x16')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x362a33,_0x2ed256[_0xb003('0x15')][_0xb003('0x17')]);return _0x28574a(_0x2ed256[_0xb003('0x15')][_0xb003('0x17')]);}logger[_0xb003('0x15')](_0xb003('0x11'),_0x362a33,_0x2ed256[_0xb003('0x15')][_0xb003('0x17')]);return _0x5148e8(_0x2ed256[_0xb003('0x15')]['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x362a33,_0xb003('0x12'));_0x5148e8(_0x2ed256[_0xb003('0x18')]['message']);}})['catch'](function(_0x1108ea){logger[_0xb003('0x15')](_0xb003('0x11'),_0x362a33,_0x1108ea);_0x28574a(_0x1108ea);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f5badc2..4f60a5e 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 _0xb5a9=['register','length','voicePrefix:','./voicePrefix.events','save','remove','update','removeListener'];(function(_0x454876,_0x580571){var _0x1084e6=function(_0x31af3a){while(--_0x31af3a){_0x454876['push'](_0x454876['shift']());}};_0x1084e6(++_0x580571);}(_0xb5a9,0xc3));var _0x9b5a=function(_0x363342,_0x325e80){_0x363342=_0x363342-0x0;var _0x488ecf=_0xb5a9[_0x363342];return _0x488ecf;};'use strict';var VoicePrefixEvents=require(_0x9b5a('0x0'));var events=[_0x9b5a('0x1'),_0x9b5a('0x2'),_0x9b5a('0x3')];function createListener(_0x36f2e8,_0x9b7781){return function(_0x5cc37c){_0x9b7781['emit'](_0x36f2e8,_0x5cc37c);};}function removeListener(_0x3933a9,_0x586670){return function(){VoicePrefixEvents[_0x9b5a('0x4')](_0x3933a9,_0x586670);};}exports[_0x9b5a('0x5')]=function(_0x4b976b){for(var _0x144ff3=0x0,_0x2e72e1=events[_0x9b5a('0x6')];_0x144ff3<_0x2e72e1;_0x144ff3++){var _0x12aafb=events[_0x144ff3];var _0x2d0ee0=createListener(_0x9b5a('0x7')+_0x12aafb,_0x4b976b);VoicePrefixEvents['on'](_0x12aafb,_0x2d0ee0);}}; \ No newline at end of file +var _0xf733=['length','voicePrefix:','./voicePrefix.events','save','update','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf733,0x134));var _0x3f73=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xf733[_0x144b30];return _0x1bb7bc;};'use strict';var VoicePrefixEvents=require(_0x3f73('0x0'));var events=[_0x3f73('0x1'),'remove',_0x3f73('0x2')];function createListener(_0x4dd68d,_0x43663f){return function(_0x39bc13){_0x43663f['emit'](_0x4dd68d,_0x39bc13);};}function removeListener(_0xf0a93,_0x40ec76){return function(){VoicePrefixEvents['removeListener'](_0xf0a93,_0x40ec76);};}exports[_0x3f73('0x3')]=function(_0x12df5c){for(var _0x4d136f=0x0,_0x33daeb=events[_0x3f73('0x4')];_0x4d136f<_0x33daeb;_0x4d136f++){var _0x441ab1=events[_0x4d136f];var _0x3310c7=createListener(_0x3f73('0x5')+_0x441ab1,_0x12df5c);VoicePrefixEvents['on'](_0x441ab1,_0x3310c7);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 461c63a..073a7f5 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 _0xbf36=['clone','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./voiceQueue.controller','isAuthenticated','index','/:id','show','get','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','getAgents','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf36,0x15d));var _0x6bf3=function(_0x534f13,_0x33cbaa){_0x534f13=_0x534f13-0x0;var _0x204ed7=_0xbf36[_0x534f13];return _0x204ed7;};'use strict';var multer=require(_0x6bf3('0x0'));var util=require('util');var path=require(_0x6bf3('0x1'));var timeout=require(_0x6bf3('0x2'));var express=require(_0x6bf3('0x3'));var router=express[_0x6bf3('0x4')]();var auth=require(_0x6bf3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6bf3('0x6'));router['get']('/',auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x8')]);router['get'](_0x6bf3('0x9'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0xa')]);router[_0x6bf3('0xb')]('/:id/hoppers',auth[_0x6bf3('0x7')](),controller[_0x6bf3('0xc')]);router['get'](_0x6bf3('0xd'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0xe')]);router[_0x6bf3('0xb')](_0x6bf3('0xf'),auth['isAuthenticated'](),controller[_0x6bf3('0x10')]);router[_0x6bf3('0xb')](_0x6bf3('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x6bf3('0xb')](_0x6bf3('0x12'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x13')]);router[_0x6bf3('0xb')]('/:id/users',auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x14')]);router[_0x6bf3('0xb')]('/:id/members',auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x15')]);router[_0x6bf3('0xb')](_0x6bf3('0x16'),auth['isAuthenticated'](),controller[_0x6bf3('0x17')]);router[_0x6bf3('0xb')](_0x6bf3('0x18'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x19')]);router[_0x6bf3('0x1a')]('/',auth['isAuthenticated'](),controller[_0x6bf3('0x1b')]);router['post'](_0x6bf3('0x1c'),auth['isAuthenticated'](),controller[_0x6bf3('0x1d')]);router[_0x6bf3('0x1a')]('/:id/teams',auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x1e')]);router[_0x6bf3('0x1a')](_0x6bf3('0x1f'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x20')]);router['post'](_0x6bf3('0x16'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x21')]);router[_0x6bf3('0x1a')](_0x6bf3('0x18'),auth['isAuthenticated'](),controller[_0x6bf3('0x22')]);router[_0x6bf3('0x23')](_0x6bf3('0x9'),auth['isAuthenticated'](),controller[_0x6bf3('0x24')]);router[_0x6bf3('0x25')](_0x6bf3('0x9'),auth['isAuthenticated'](),controller[_0x6bf3('0x26')]);router[_0x6bf3('0x25')]('/:id/teams',auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x27')]);router['delete'](_0x6bf3('0x1f'),auth[_0x6bf3('0x7')](),controller[_0x6bf3('0x28')]);router['delete'](_0x6bf3('0x16'),auth[_0x6bf3('0x7')](),controller['removeLists']);router[_0x6bf3('0x25')](_0x6bf3('0x18'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x6bf3('0x29')]=router; \ No newline at end of file +var _0x1e39=['isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists','/:id/blacklists','getBlackLists','post','clone','addTeams','addAgents','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x21d37c,_0xbb2d20){var _0x48468c=function(_0x588c6a){while(--_0x588c6a){_0x21d37c['push'](_0x21d37c['shift']());}};_0x48468c(++_0xbb2d20);}(_0x1e39,0xc5));var _0x91e3=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0x1e39[_0x1f239e];return _0x826971;};'use strict';var multer=require(_0x91e3('0x0'));var util=require(_0x91e3('0x1'));var path=require(_0x91e3('0x2'));var timeout=require(_0x91e3('0x3'));var express=require(_0x91e3('0x4'));var router=express[_0x91e3('0x5')]();var auth=require(_0x91e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x91e3('0x7'));var controller=require('./voiceQueue.controller');router['get']('/',auth[_0x91e3('0x8')](),controller[_0x91e3('0x9')]);router[_0x91e3('0xa')](_0x91e3('0xb'),auth[_0x91e3('0x8')](),controller[_0x91e3('0xc')]);router[_0x91e3('0xa')](_0x91e3('0xd'),auth[_0x91e3('0x8')](),controller[_0x91e3('0xe')]);router['get'](_0x91e3('0xf'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x10')]);router[_0x91e3('0xa')](_0x91e3('0x11'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x91e3('0xa')](_0x91e3('0x12'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x13')]);router['get'](_0x91e3('0x14'),auth['isAuthenticated'](),controller[_0x91e3('0x15')]);router[_0x91e3('0xa')](_0x91e3('0x16'),auth[_0x91e3('0x8')](),controller['getAgents']);router[_0x91e3('0xa')](_0x91e3('0x17'),auth[_0x91e3('0x8')](),controller['getMembers']);router[_0x91e3('0xa')](_0x91e3('0x18'),auth[_0x91e3('0x8')](),controller['getLists']);router['get'](_0x91e3('0x19'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x1a')]);router[_0x91e3('0x1b')]('/',auth[_0x91e3('0x8')](),controller['create']);router[_0x91e3('0x1b')]('/:id/clone',auth['isAuthenticated'](),controller[_0x91e3('0x1c')]);router[_0x91e3('0x1b')](_0x91e3('0x14'),auth['isAuthenticated'](),controller[_0x91e3('0x1d')]);router[_0x91e3('0x1b')](_0x91e3('0x16'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x1e')]);router[_0x91e3('0x1b')](_0x91e3('0x18'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x1f')]);router['post'](_0x91e3('0x19'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x20')]);router[_0x91e3('0x21')](_0x91e3('0xb'),auth['isAuthenticated'](),controller[_0x91e3('0x22')]);router['delete'](_0x91e3('0xb'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x23')]);router[_0x91e3('0x24')](_0x91e3('0x14'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x25')]);router[_0x91e3('0x24')]('/:id/users',auth[_0x91e3('0x8')](),controller['removeAgents']);router[_0x91e3('0x24')]('/:id/lists',auth[_0x91e3('0x8')](),controller[_0x91e3('0x26')]);router[_0x91e3('0x24')](_0x91e3('0x19'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x27')]);module[_0x91e3('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 02c34d2..1c48238 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 _0x2e5b=['joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','booked','roundrobin','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x2e5b,0x189));var _0xb2e5=function(_0x5c20f6,_0x2df212){_0x5c20f6=_0x5c20f6-0x0;var _0x17e874=_0x2e5b[_0x5c20f6];return _0x17e874;};'use strict';var Sequelize=require(_0xb2e5('0x0'));module['exports']={'name':{'type':Sequelize[_0xb2e5('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xb2e5('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xb2e5('0x4')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xb2e5('0x5'),_0xb2e5('0x6'),_0xb2e5('0x7'),_0xb2e5('0x8'),_0xb2e5('0x9'),_0xb2e5('0xa'),'wrandom',_0xb2e5('0xb')),'allowNull':![],'defaultValue':_0xb2e5('0x5'),'set':function(_0x2605f0){this[_0xb2e5('0xc')](_0xb2e5('0xd'),_0x2605f0?_0x2605f0:_0xb2e5('0x9'));},'get':function(){var _0x418cd2=this[_0xb2e5('0xe')](_0xb2e5('0xf'));var _0x188af0=this[_0xb2e5('0xe')]('dialMethod');var _0x37a57e=this[_0xb2e5('0xe')](_0xb2e5('0xd'));if(_0x418cd2==='inbound'){return _0x37a57e;}if(_0x188af0===_0xb2e5('0x10')&&_0x37a57e===_0xb2e5('0x9')||_0x188af0===_0xb2e5('0x10')&&_0x37a57e===_0xb2e5('0x11')){return _0x37a57e;}if(_0x188af0==='progressive'||_0x188af0==='predictive'||_0x188af0===_0xb2e5('0x12')){return _0x37a57e;}return null;}},'servicelevel':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb2e5('0x13')](0xb)},'timeout':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb2e5('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb2e5('0x2')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no',_0xb2e5('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb2e5('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb2e5('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defaultValue':_0xb2e5('0x14')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xb2e5('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb2e5('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb2e5('0x1')]},'queue_youarenext':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb2e5('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xb2e5('0x1')]},'queue_quantity2':{'type':Sequelize[_0xb2e5('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xb2e5('0x1')]},'queue_less_than':{'type':Sequelize[_0xb2e5('0x1')]},'periodic_announce':{'type':Sequelize[_0xb2e5('0x17')],'set':function(_0x317820){this[_0xb2e5('0xc')](_0xb2e5('0x18'),_0x317820?_0x317820[_0xb2e5('0x19')](','):[]);},'get':function(){return this[_0xb2e5('0xe')](_0xb2e5('0x18'))?this[_0xb2e5('0xe')](_0xb2e5('0x18'))[_0xb2e5('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':_0xb2e5('0x14'),'set':function(_0x1df3db){this[_0xb2e5('0xc')](_0xb2e5('0x1b'),_0x1df3db?_0x1df3db['join'](','):[]);},'get':function(){return this[_0xb2e5('0xe')](_0xb2e5('0x1b'))?this[_0xb2e5('0xe')](_0xb2e5('0x1b'))[_0xb2e5('0x1a')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x377822){this[_0xb2e5('0xc')](_0xb2e5('0x1c'),_0x377822?_0x377822[_0xb2e5('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xb2e5('0x1c'))?this[_0xb2e5('0xe')](_0xb2e5('0x1c'))[_0xb2e5('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xb2e5('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb2e5('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':0x0,'set':function(_0x5216de){this[_0xb2e5('0xc')](_0xb2e5('0x1e'),_0x5216de);if(_0x5216de){if(this[_0xb2e5('0xe')](_0xb2e5('0x1f'))<0x2){this['setDataValue'](_0xb2e5('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb2e5('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':0x0,'comment':_0xb2e5('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0xb2e5('0x21'),_0xb2e5('0x22'),_0xb2e5('0x12'),_0xb2e5('0x23'),_0xb2e5('0x10')),'defaultValue':_0xb2e5('0x22'),'comment':_0xb2e5('0x24')},'dialLimitChannel':{'type':Sequelize[_0xb2e5('0x13')](0x4)[_0xb2e5('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb2e5('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xb2e5('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xb2e5('0x27')](0x2)[_0xb2e5('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb2e5('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x29'),_0xb2e5('0x2a')),'defaultValue':_0xb2e5('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb2e5('0x27')](0x2)[_0xb2e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb2e5('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2e5('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':'tTxX','comment':_0xb2e5('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2e5('0x2e')},'dialQueueProject':{'type':Sequelize[_0xb2e5('0x1')],'comment':_0xb2e5('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb2e5('0x13')](0x5)[_0xb2e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2e5('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0xb2e5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb2e5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2e5('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb2e5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb2e5('0x13')](0x5)[_0xb2e5('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2e5('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb2e5('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb2e5('0x33')},'dialTimezone':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':_0xb2e5('0x34')},'dialPrefix':{'type':Sequelize[_0xb2e5('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb2e5('0x2')]('always',_0xb2e5('0x35'),'onlyIfOpen'),'defaultValue':_0xb2e5('0x36')},'dialAMDActive':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':0x0,'comment':_0xb2e5('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xb2e5('0x13')](0x9)[_0xb2e5('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb2e5('0x38')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb2e5('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb2e5('0x13')](0x9)[_0xb2e5('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb2e5('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xb2e5('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb2e5('0x13')](0x9)[_0xb2e5('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb2e5('0x13')](0x9)[_0xb2e5('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb2e5('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb2e5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb2e5('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb2e5('0x13')](0x5)[_0xb2e5('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb2e5('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb2e5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb2e5('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xb2e5('0x13')](0x5)[_0xb2e5('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb2e5('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':0x0,'comment':_0xb2e5('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb2e5('0x2')](_0xb2e5('0x41'),'ASC'),'defaultValue':_0xb2e5('0x41')},'dialQueueProject2':{'type':Sequelize[_0xb2e5('0x1')],'comment':_0xb2e5('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb2e5('0x42')},'dialCutDigit':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb2e5('0x13')],'allowNull':!![],'comment':_0xb2e5('0x43')},'mandatoryDisposition':{'type':Sequelize[_0xb2e5('0x1d')],'defaultValue':![],'comment':_0xb2e5('0x44'),'set':function(_0x51ebd1){if(!_0x51ebd1)this[_0xb2e5('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xb2e5('0x45'),_0x51ebd1);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb2e5('0x13')](0x3)[_0xb2e5('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x8081=['strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue'];(function(_0x1ba500,_0x404262){var _0x4d0e88=function(_0x5ec642){while(--_0x5ec642){_0x1ba500['push'](_0x1ba500['shift']());}};_0x4d0e88(++_0x404262);}(_0x8081,0x114));var _0x1808=function(_0x14eb4e,_0x23ed1c){_0x14eb4e=_0x14eb4e-0x0;var _0x217821=_0x8081[_0x14eb4e];return _0x217821;};'use strict';var Sequelize=require(_0x1808('0x0'));module[_0x1808('0x1')]={'name':{'type':Sequelize[_0x1808('0x2')],'allowNull':![],'unique':_0x1808('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1808('0x4')](_0x1808('0x5'),_0x1808('0x6')),'allowNull':![],'defaultValue':_0x1808('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x1808('0x7')},'announce':{'type':Sequelize[_0x1808('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1808('0x4')]('rr',_0x1808('0x8'),_0x1808('0x9'),_0x1808('0xa'),_0x1808('0xb'),_0x1808('0xc'),_0x1808('0xd'),'wrandom',_0x1808('0xe')),'allowNull':![],'defaultValue':_0x1808('0x8'),'set':function(_0x520215){this[_0x1808('0xf')](_0x1808('0x10'),_0x520215?_0x520215:_0x1808('0xc'));},'get':function(){var _0x3f02dc=this[_0x1808('0x11')](_0x1808('0x12'));var _0x4b9c01=this[_0x1808('0x11')](_0x1808('0x13'));var _0x5c7894=this[_0x1808('0x11')](_0x1808('0x10'));if(_0x3f02dc===_0x1808('0x5')){return _0x5c7894;}if(_0x4b9c01===_0x1808('0x14')&&_0x5c7894===_0x1808('0xc')||_0x4b9c01===_0x1808('0x14')&&_0x5c7894==='roundrobin'){return _0x5c7894;}if(_0x4b9c01===_0x1808('0x15')||_0x4b9c01===_0x1808('0x16')||_0x4b9c01===_0x1808('0x17')){return _0x5c7894;}return null;}},'servicelevel':{'type':Sequelize[_0x1808('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1808('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1808('0x18')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1808('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1808('0x2')]},'weight':{'type':Sequelize[_0x1808('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1808('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1808('0x19')},'autopause':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no',_0x1808('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1808('0x18')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1808('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1808('0x4')](_0x1808('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1808('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1808('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1808('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1808('0x19')},'announce_holdtime':{'type':Sequelize[_0x1808('0x4')](_0x1808('0x19'),'no',_0x1808('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1808('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x1808('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x1808('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1808('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1808('0x2')]},'queue_youarenext':{'type':Sequelize[_0x1808('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1808('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1808('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1808('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1808('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1808('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1808('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x1808('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x1808('0x2')]},'periodic_announce':{'type':Sequelize[_0x1808('0x1c')],'set':function(_0x20ddd0){this[_0x1808('0xf')](_0x1808('0x1d'),_0x20ddd0?_0x20ddd0[_0x1808('0x1e')](','):[]);},'get':function(){return this[_0x1808('0x11')]('periodic_announce')?this[_0x1808('0x11')](_0x1808('0x1d'))[_0x1808('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0x1808('0x2')],'defaultValue':_0x1808('0x19'),'set':function(_0x16921b){this[_0x1808('0xf')](_0x1808('0x20'),_0x16921b?_0x16921b[_0x1808('0x1e')](','):[]);},'get':function(){return this['getDataValue']('joinempty')?this['getDataValue']('joinempty')[_0x1808('0x1f')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x1808('0x2')],'defaultValue':'no','set':function(_0x38906a){this[_0x1808('0xf')]('leavewhenempty',_0x38906a?_0x38906a['join'](','):[]);},'get':function(){return this[_0x1808('0x11')](_0x1808('0x21'))?this[_0x1808('0x11')](_0x1808('0x21'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x1808('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1808('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1808('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1808('0x2')]},'description':{'type':Sequelize[_0x1808('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x9105a1){this['setDataValue'](_0x1808('0x22'),_0x9105a1);if(_0x9105a1){if(this[_0x1808('0x11')](_0x1808('0x23'))<0x2){this[_0x1808('0xf')](_0x1808('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1808('0x24')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x1808('0x4')](_0x1808('0x25'),_0x1808('0x15'),_0x1808('0x17'),'predictive',_0x1808('0x14')),'defaultValue':_0x1808('0x15'),'comment':_0x1808('0x26')},'dialLimitChannel':{'type':Sequelize[_0x1808('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1808('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x1808('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x1808('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x1808('0x4')](_0x1808('0x2a'),_0x1808('0x2b')),'defaultValue':_0x1808('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x1808('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x1808('0x18')](0x3)[_0x1808('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1808('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1808('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1808('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1808('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x1808('0x2e'),'comment':_0x1808('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1808('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1808('0x30')},'dialQueueProject':{'type':Sequelize[_0x1808('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1808('0x18')](0x3)[_0x1808('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1808('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1808('0x18')](0x5)[_0x1808('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1808('0x18')](0x3)[_0x1808('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x1808('0x18')](0x5)[_0x1808('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1808('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1808('0x18')](0x3)[_0x1808('0x28')],'defaultValue':0x3,'comment':_0x1808('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1808('0x18')](0x5)[_0x1808('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1808('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1808('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1808('0x2')],'defaultValue':_0x1808('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1808('0x36'),_0x1808('0x37'),'onlyIfOpen'),'defaultValue':_0x1808('0x36')},'dialAMDActive':{'type':Sequelize[_0x1808('0x24')],'defaultValue':0x0,'comment':_0x1808('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x1808('0x18')](0x9)[_0x1808('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1808('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x1808('0x18')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1808('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1808('0x18')](0x9)[_0x1808('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1808('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1808('0x18')](0x9)[_0x1808('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1808('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x1808('0x18')](0x9)[_0x1808('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1808('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1808('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1808('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1808('0x18')](0x9)[_0x1808('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1808('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1808('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1808('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1808('0x18')](0x9)[_0x1808('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x1808('0x18')](0x5)[_0x1808('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x1808('0x24')],'defaultValue':0x0,'comment':_0x1808('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1808('0x4')](_0x1808('0x42'),_0x1808('0x43')),'defaultValue':_0x1808('0x42')},'dialQueueProject2':{'type':Sequelize[_0x1808('0x2')],'comment':_0x1808('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1808('0x24')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1808('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1808('0x45')},'dialCutDigit':{'type':Sequelize[_0x1808('0x18')](0x3)[_0x1808('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1808('0x18')],'allowNull':!![],'comment':_0x1808('0x46')},'mandatoryDisposition':{'type':Sequelize[_0x1808('0x24')],'defaultValue':![],'comment':_0x1808('0x47'),'set':function(_0x26c9d5){if(!_0x26c9d5)this[_0x1808('0xf')]('mandatoryDispositionPauseId',null);this[_0x1808('0xf')](_0x1808('0x48'),_0x26c9d5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1808('0x18')](0x3)[_0x1808('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1808('0x28')],'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 44aace5..8d85662 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 _0x5f8a=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','updatedAt','body','omit','createdAt','UserProfileSection','getHoppers','findOne','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','addTeams','each','UserVoiceQueue','findOrCreate','upsert','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','compact','transaction','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','isNil','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','phone','scheduledAt','ContactId','ListId','field','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','fromQuery','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','json','count','offset','limit','status','set','apply','reject','update','destroy','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','UserProfileResource','end','error','stack','name','send','index','VoiceQueue','fieldName','type','key','intersection','model','query','fields'];(function(_0x3b14a6,_0xeab552){var _0x9885a8=function(_0x4c4ea8){while(--_0x4c4ea8){_0x3b14a6['push'](_0x3b14a6['shift']());}};_0x9885a8(++_0xeab552);}(_0x5f8a,0x1df));var _0xa5f8=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x5f8a[_0x1b3a5c];return _0x2ae8cb;};'use strict';var pdf=require(_0xa5f8('0x0'));var emlformat=require(_0xa5f8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5f8('0x2'));var rp=require(_0xa5f8('0x3'));var moment=require(_0xa5f8('0x4'));var BPromise=require(_0xa5f8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa5f8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa5f8('0x7'));var squel=require('squel');var crypto=require(_0xa5f8('0x8'));var jsforce=require(_0xa5f8('0x9'));var deskjs=require(_0xa5f8('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa5f8('0xb'));var Papa=require('papaparse');var Redis=require(_0xa5f8('0xc'));var authService=require(_0xa5f8('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa5f8('0xe'));var utils=require(_0xa5f8('0xf'));var config=require(_0xa5f8('0x10'));var db=require(_0xa5f8('0x11'))['db'];config[_0xa5f8('0x12')]=_[_0xa5f8('0x13')](config[_0xa5f8('0x12')],{'host':_0xa5f8('0x14'),'port':0x18eb});var socket=require(_0xa5f8('0x15'))(new Redis(config[_0xa5f8('0x12')]));require(_0xa5f8('0x16'))[_0xa5f8('0x17')](socket);function respondWithStatusCode(_0x4ed15b,_0x399cbc){_0x399cbc=_0x399cbc||0xcc;return function(_0x491272){if(_0x491272){return _0x4ed15b[_0xa5f8('0x18')](_0x399cbc);}return _0x4ed15b['status'](_0x399cbc)['end']();};}function respondWithResult(_0x421769,_0x5a8f8b){_0x5a8f8b=_0x5a8f8b||0xc8;return function(_0x382b07){if(_0x382b07){return _0x421769['status'](_0x5a8f8b)[_0xa5f8('0x19')](_0x382b07);}};}function respondWithFilteredResult(_0x2fa0d4,_0x3944c8){return function(_0x24c62d){if(_0x24c62d){var _0x22042b=_0x24c62d[_0xa5f8('0x1a')],_0x2331dd=_0x3944c8[_0xa5f8('0x1b')],_0x31ed65=_0x3944c8[_0xa5f8('0x1b')]+_0x3944c8[_0xa5f8('0x1c')],_0x4ba5a8;if(_0x31ed65>=_0x22042b){_0x31ed65=_0x22042b;_0x4ba5a8=0xc8;}else{_0x4ba5a8=0xce;}_0x2fa0d4[_0xa5f8('0x1d')](_0x4ba5a8);return _0x2fa0d4[_0xa5f8('0x1e')]('Content-Range',_0x2331dd+'-'+_0x31ed65+'/'+_0x22042b)['json'](_0x24c62d);}return null;};}function patchUpdates(_0x3b335f){return function(_0x407420){try{jsonpatch[_0xa5f8('0x1f')](_0x407420,_0x3b335f,!![]);}catch(_0x171cf3){return BPromise[_0xa5f8('0x20')](_0x171cf3);}return _0x407420['save']();};}function saveUpdates(_0x449031,_0x112a57){return function(_0x17cafc){if(_0x17cafc){return _0x17cafc[_0xa5f8('0x21')](_0x449031)['then'](function(_0x4057da){return _0x4057da;});}return null;};}function removeEntity(_0x5a8240,_0x4b45b0){return function(_0x3d910c){if(_0x3d910c){return _0x3d910c[_0xa5f8('0x22')]()[_0xa5f8('0x23')](function(){var _0x5c31fc=_0x3d910c['get']({'plain':!![]});var _0x50c406=[{'name':_0xa5f8('0x24'),'value':_0xa5f8('0x25'),'ignore':![]},{'name':_0xa5f8('0x26'),'value':_0xa5f8('0x27'),'ignore':![]}];var _0x5a32ff=_(_0x50c406)[_0xa5f8('0x28')](_0xa5f8('0x29'))[_0xa5f8('0x2a')](_0xa5f8('0x2b'))[_0xa5f8('0x2b')]();if(_[_0xa5f8('0x2c')](_0x5a32ff,_0x5c31fc['type'])){return;}var _0x5a0149=_[_0xa5f8('0x2d')](_0x50c406,[_0xa5f8('0x2b'),_0x5c31fc['type']])['name'];return db[_0xa5f8('0x2e')][_0xa5f8('0x22')]({'where':{'type':_0x5a0149,'resourceId':_0x5c31fc['id']}})[_0xa5f8('0x23')](function(){return _0x3d910c;});})[_0xa5f8('0x23')](function(){_0x5a8240[_0xa5f8('0x1d')](0xcc)[_0xa5f8('0x2f')]();});}};}function handleEntityNotFound(_0x9ad104,_0x2ad784){return function(_0x10a1e0){if(!_0x10a1e0){_0x9ad104['sendStatus'](0x194);}return _0x10a1e0;};}function handleError(_0x255cab,_0x52adce){_0x52adce=_0x52adce||0x1f4;return function(_0x3179b4){logger[_0xa5f8('0x30')](_0x3179b4[_0xa5f8('0x31')]);if(_0x3179b4[_0xa5f8('0x32')]){delete _0x3179b4[_0xa5f8('0x32')];}_0x255cab[_0xa5f8('0x1d')](_0x52adce)[_0xa5f8('0x33')](_0x3179b4);};}exports[_0xa5f8('0x34')]=function(_0x24a4fe,_0x46b4a9){var _0x4b93f6={},_0x5d38bf={},_0xb1e044={'count':0x0,'rows':[]};var _0x54e67a=_[_0xa5f8('0x2a')](db[_0xa5f8('0x35')]['rawAttributes'],function(_0x52780b){return{'name':_0x52780b[_0xa5f8('0x36')],'type':_0x52780b[_0xa5f8('0x37')][_0xa5f8('0x38')]};});_0x5d38bf['model']=_['map'](_0x54e67a,_0xa5f8('0x32'));_0x5d38bf['query']=_['keys'](_0x24a4fe['query']);_0x5d38bf['filters']=_[_0xa5f8('0x39')](_0x5d38bf[_0xa5f8('0x3a')],_0x5d38bf[_0xa5f8('0x3b')]);_0x4b93f6['attributes']=_[_0xa5f8('0x39')](_0x5d38bf[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0x24a4fe[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0x4b93f6[_0xa5f8('0x3d')]=_0x4b93f6[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0x4b93f6[_0xa5f8('0x3d')]:_0x5d38bf[_0xa5f8('0x3a')];if(!_0x24a4fe[_0xa5f8('0x3b')][_0xa5f8('0x3f')](_0xa5f8('0x40'))){_0x4b93f6['limit']=qs[_0xa5f8('0x1c')](_0x24a4fe[_0xa5f8('0x3b')][_0xa5f8('0x1c')]);_0x4b93f6['offset']=qs['offset'](_0x24a4fe[_0xa5f8('0x3b')][_0xa5f8('0x1b')]);}_0x4b93f6[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0x24a4fe[_0xa5f8('0x3b')]['sort']);_0x4b93f6[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_[_0xa5f8('0x45')](_0x24a4fe[_0xa5f8('0x3b')],_0x5d38bf[_0xa5f8('0x44')]));if(_0x24a4fe['query']['filter']){_0x4b93f6['where']=_[_0xa5f8('0x46')](_0x4b93f6[_0xa5f8('0x43')],{'$or':_[_0xa5f8('0x2a')](_0x54e67a,function(_0xbef013){if(_0xbef013['type']!==_0xa5f8('0x47')){var _0x951ff0={};_0x951ff0[_0xbef013[_0xa5f8('0x32')]]={'$like':'%'+_0x24a4fe[_0xa5f8('0x3b')]['filter']+'%'};return _0x951ff0;}})});}_0x4b93f6=_[_0xa5f8('0x46')]({},_0x4b93f6,_0x24a4fe[_0xa5f8('0x48')]);var _0x506437={'where':_0x4b93f6[_0xa5f8('0x43')]};return db[_0xa5f8('0x35')][_0xa5f8('0x1a')](_0x506437)[_0xa5f8('0x23')](function(_0x134550){_0xb1e044[_0xa5f8('0x1a')]=_0x134550;if(_0x24a4fe[_0xa5f8('0x3b')][_0xa5f8('0x49')]){_0x4b93f6[_0xa5f8('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0xa5f8('0x4b')](_0x4b93f6);})[_0xa5f8('0x23')](function(_0xd17bc7){_0xb1e044[_0xa5f8('0x4c')]=_0xd17bc7;return _0xb1e044;})[_0xa5f8('0x23')](respondWithFilteredResult(_0x46b4a9,_0x4b93f6))[_0xa5f8('0x4d')](handleError(_0x46b4a9,null));};exports[_0xa5f8('0x4e')]=function(_0x29a356,_0x2705a5){var _0xfec6={'raw':![],'where':{'id':_0x29a356[_0xa5f8('0x4f')]['id']}},_0x436058={};_0x436058[_0xa5f8('0x3a')]=_['keys'](db[_0xa5f8('0x35')][_0xa5f8('0x50')]);_0x436058['query']=_['keys'](_0x29a356['query']);_0x436058[_0xa5f8('0x44')]=_[_0xa5f8('0x39')](_0x436058['model'],_0x436058[_0xa5f8('0x3b')]);_0xfec6['attributes']=_[_0xa5f8('0x39')](_0x436058[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0x29a356[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0xfec6['attributes']=_0xfec6[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0xfec6[_0xa5f8('0x3d')]:_0x436058[_0xa5f8('0x3a')];if(_0x29a356[_0xa5f8('0x3b')][_0xa5f8('0x49')]){_0xfec6[_0xa5f8('0x4a')]=[{'all':!![]}];}_0xfec6=_['merge']({},_0xfec6,_0x29a356[_0xa5f8('0x48')]);return db[_0xa5f8('0x35')]['find'](_0xfec6)[_0xa5f8('0x23')](handleEntityNotFound(_0x2705a5,null))[_0xa5f8('0x23')](respondWithResult(_0x2705a5,null))['catch'](handleError(_0x2705a5,null));};exports['create']=function(_0x4da62f,_0x4a2728){return db[_0xa5f8('0x35')][_0xa5f8('0x51')](_0x4da62f['body'],{})[_0xa5f8('0x23')](function(_0x41dca0){var _0x12c654=_0x4da62f['user'][_0xa5f8('0x52')]({'plain':!![]});if(!_0x12c654)throw new Error(_0xa5f8('0x53'));if(_0x12c654[_0xa5f8('0x54')]===_0xa5f8('0x55')){var _0x3c4f68=_0x41dca0['get']({'plain':!![]});var _0x43880b=[{'name':_0xa5f8('0x24'),'value':'inbound'},{'name':_0xa5f8('0x26'),'value':'outbound'}];var _0x61f628=_[_0xa5f8('0x2d')](_0x43880b,[_0xa5f8('0x2b'),_0x3c4f68[_0xa5f8('0x37')]])[_0xa5f8('0x32')];return db['UserProfileSection'][_0xa5f8('0x2d')]({'where':{'name':_0x61f628,'userProfileId':_0x12c654[_0xa5f8('0x56')]},'raw':!![]})[_0xa5f8('0x23')](function(_0x57c807){if(_0x57c807&&_0x57c807[_0xa5f8('0x57')]===0x0){return db[_0xa5f8('0x2e')][_0xa5f8('0x51')]({'name':_0x3c4f68[_0xa5f8('0x32')],'resourceId':_0x3c4f68['id'],'type':_0x57c807[_0xa5f8('0x32')],'sectionId':_0x57c807['id']},{})[_0xa5f8('0x23')](function(){return _0x41dca0;});}else{return _0x41dca0;}})[_0xa5f8('0x4d')](function(_0x3b65ea){logger['error'](_0xa5f8('0x58'),_0x3b65ea);throw _0x3b65ea;});}return _0x41dca0;})[_0xa5f8('0x23')](respondWithResult(_0x4a2728,0xc9))[_0xa5f8('0x4d')](handleError(_0x4a2728,null));};exports[_0xa5f8('0x59')]=function(_0x212166,_0x48efc1){var _0x330e32={'where':{'id':_0x212166[_0xa5f8('0x4f')]['id']}},_0x12bd3d={};_0x12bd3d[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x35')]['rawAttributes']);_0x330e32[_0xa5f8('0x3d')]=_[_0xa5f8('0x39')](_0x12bd3d['model'],qs[_0xa5f8('0x3c')](_0x212166[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0x330e32[_0xa5f8('0x3d')]=_0x330e32[_0xa5f8('0x3d')]['length']?_0x330e32['attributes']:_0x12bd3d['model'];if(_0x212166[_0xa5f8('0x3b')][_0xa5f8('0x49')]){_0x330e32[_0xa5f8('0x4a')]=[{'all':!![]}];}_0x330e32=_[_0xa5f8('0x46')]({},_0x330e32,_0x212166[_0xa5f8('0x48')]);return db[_0xa5f8('0x35')][_0xa5f8('0x2d')](_0x330e32)[_0xa5f8('0x23')](handleEntityNotFound(_0x48efc1,null))['then'](function(_0x3fd8f2){if(_0x3fd8f2){var _0x1c6be5=_0x3fd8f2[_0xa5f8('0x52')]({'plain':!![]});_0x1c6be5=qs['omit'](_0x1c6be5,['id','createdAt',_0xa5f8('0x5b')]);_0x212166[_0xa5f8('0x5c')]=_[_0xa5f8('0x5d')](_0x212166[_0xa5f8('0x5c')],['id',_0xa5f8('0x5e'),'updatedAt']);return db[_0xa5f8('0x35')][_0xa5f8('0x51')](_[_0xa5f8('0x46')](_0x1c6be5,_0x212166[_0xa5f8('0x5c')]),{'include':_0x212166[_0xa5f8('0x3b')][_0xa5f8('0x49')]?[{'all':!![]}]:undefined})[_0xa5f8('0x23')](function(_0x326ec0){var _0x262f6c=_0x212166[_0xa5f8('0x55')][_0xa5f8('0x52')]({'plain':!![]});if(!_0x262f6c)throw new Error(_0xa5f8('0x53'));if(_0x262f6c[_0xa5f8('0x54')]===_0xa5f8('0x55')){var _0x1a188b=_0x326ec0[_0xa5f8('0x52')]({'plain':!![]});var _0xed86ac=[{'name':_0xa5f8('0x24'),'value':_0xa5f8('0x25')},{'name':'QueueCampaigns','value':_0xa5f8('0x27')}];var _0x579144=_['find'](_0xed86ac,['value',_0x1a188b[_0xa5f8('0x37')]])[_0xa5f8('0x32')];return db[_0xa5f8('0x5f')][_0xa5f8('0x2d')]({'where':{'name':_0x579144,'userProfileId':_0x262f6c[_0xa5f8('0x56')]},'raw':!![]})[_0xa5f8('0x23')](function(_0xfea0ed){if(_0xfea0ed&&_0xfea0ed['autoAssociation']===0x0){return db[_0xa5f8('0x2e')][_0xa5f8('0x51')]({'name':_0x1a188b[_0xa5f8('0x32')],'resourceId':_0x1a188b['id'],'type':_0xfea0ed['name'],'sectionId':_0xfea0ed['id']},{})[_0xa5f8('0x23')](function(){return _0x326ec0;});}else{return _0x326ec0;}})[_0xa5f8('0x4d')](function(_0x207f61){logger['error'](_0xa5f8('0x58'),_0x207f61);throw _0x207f61;});}return _0x326ec0;});}})[_0xa5f8('0x23')](respondWithResult(_0x48efc1,0xc9))[_0xa5f8('0x4d')](handleError(_0x48efc1,null));};exports[_0xa5f8('0x21')]=function(_0x48b4d2,_0x4b5658){if(_0x48b4d2[_0xa5f8('0x5c')]['id']){delete _0x48b4d2['body']['id'];}return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x48b4d2['params']['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x4b5658,null))[_0xa5f8('0x23')](saveUpdates(_0x48b4d2[_0xa5f8('0x5c')],null))[_0xa5f8('0x23')](respondWithResult(_0x4b5658,null))[_0xa5f8('0x4d')](handleError(_0x4b5658,null));};exports[_0xa5f8('0x22')]=function(_0x4586f7,_0x38c353){return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x4586f7[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x38c353,null))[_0xa5f8('0x23')](removeEntity(_0x38c353,null))[_0xa5f8('0x4d')](handleError(_0x38c353,null));};exports[_0xa5f8('0x60')]=function(_0x12ef8e,_0x1f7f10,_0x5178b5){var _0x9e2936={'raw':![],'where':{}};var _0x52d562={};var _0x2fca8f={'count':0x0,'rows':[]};return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0x12ef8e[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x1f7f10,null))[_0xa5f8('0x23')](function(_0x1ce6cb){if(_0x1ce6cb){_0x52d562[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db['CmHopper'][_0xa5f8('0x50')]);_0x52d562[_0xa5f8('0x3b')]=_[_0xa5f8('0x5a')](_0x12ef8e[_0xa5f8('0x3b')]);_0x52d562[_0xa5f8('0x44')]=_['intersection'](_0x52d562[_0xa5f8('0x3a')],_0x52d562[_0xa5f8('0x3b')]);_0x9e2936[_0xa5f8('0x3d')]=_['intersection'](_0x52d562[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0x12ef8e[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0x9e2936[_0xa5f8('0x3d')]=_0x9e2936['attributes'][_0xa5f8('0x3e')]?_0x9e2936['attributes']:_0x52d562['model'];if(!_0x12ef8e[_0xa5f8('0x3b')][_0xa5f8('0x3f')](_0xa5f8('0x40'))){_0x9e2936[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0x12ef8e['query'][_0xa5f8('0x1c')]);_0x9e2936[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0x12ef8e['query'][_0xa5f8('0x1b')]);}_0x9e2936[_0xa5f8('0x41')]=qs['sort'](_0x12ef8e['query'][_0xa5f8('0x42')]);_0x9e2936['where']=qs[_0xa5f8('0x44')](_['pick'](_0x12ef8e[_0xa5f8('0x3b')],_0x52d562['filters']));_0x9e2936['where'][_0xa5f8('0x62')]=_0x1ce6cb['id'];if(_0x12ef8e[_0xa5f8('0x3b')]['filter']){_0x9e2936[_0xa5f8('0x43')]=_[_0xa5f8('0x46')](_0x9e2936[_0xa5f8('0x43')],{'$or':_[_0xa5f8('0x2a')](_0x9e2936[_0xa5f8('0x3d')],function(_0x4541e7){var _0xaa1451={};_0xaa1451[_0x4541e7]={'$like':'%'+_0x12ef8e[_0xa5f8('0x3b')][_0xa5f8('0x28')]+'%'};return _0xaa1451;})});}_0x9e2936=_[_0xa5f8('0x46')]({},_0x9e2936,_0x12ef8e[_0xa5f8('0x48')]);return db[_0xa5f8('0x63')][_0xa5f8('0x1a')]({'where':_0x9e2936[_0xa5f8('0x43')]})[_0xa5f8('0x23')](function(_0x5716ed){_0x2fca8f['count']=_0x5716ed;if(_0x12ef8e['query']['includeAll']){_0x9e2936['include']=[{'all':!![]}];}return db['CmHopper'][_0xa5f8('0x4b')](_0x9e2936);})[_0xa5f8('0x23')](function(_0xec9b43){_0x2fca8f[_0xa5f8('0x4c')]=_0xec9b43;return _0x2fca8f;});}})[_0xa5f8('0x23')](respondWithFilteredResult(_0x1f7f10,_0x9e2936))['catch'](handleError(_0x1f7f10,null));};exports[_0xa5f8('0x64')]=function(_0xc537c2,_0x6da5ad,_0x3e4cab){var _0x5e1e8f={'raw':!![],'where':{}};var _0x3020b2={};var _0x5e364e={'count':0x0,'rows':[]};return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0xc537c2[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x6da5ad,null))[_0xa5f8('0x23')](function(_0x1fa9b5){if(_0x1fa9b5){_0x3020b2[_0xa5f8('0x3a')]=_['keys'](db[_0xa5f8('0x65')][_0xa5f8('0x50')]);_0x3020b2[_0xa5f8('0x3b')]=_[_0xa5f8('0x5a')](_0xc537c2[_0xa5f8('0x3b')]);_0x3020b2['filters']=_[_0xa5f8('0x39')](_0x3020b2[_0xa5f8('0x3a')],_0x3020b2[_0xa5f8('0x3b')]);_0x5e1e8f[_0xa5f8('0x3d')]=_[_0xa5f8('0x39')](_0x3020b2[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0xc537c2[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0x5e1e8f[_0xa5f8('0x3d')]=_0x5e1e8f[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0x5e1e8f['attributes']:_0x3020b2[_0xa5f8('0x3a')];if(!_0xc537c2['query']['hasOwnProperty']('nolimit')){_0x5e1e8f[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0xc537c2[_0xa5f8('0x3b')][_0xa5f8('0x1c')]);_0x5e1e8f[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0xc537c2[_0xa5f8('0x3b')]['offset']);}_0x5e1e8f[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0xc537c2[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0x5e1e8f[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_[_0xa5f8('0x45')](_0xc537c2['query'],_0x3020b2[_0xa5f8('0x44')]));_0x5e1e8f[_0xa5f8('0x43')]['VoiceQueueId']=_0x1fa9b5['id'];if(_0xc537c2[_0xa5f8('0x3b')][_0xa5f8('0x28')]){_0x5e1e8f['where']=_[_0xa5f8('0x46')](_0x5e1e8f[_0xa5f8('0x43')],{'$or':_['map'](_0x5e1e8f['attributes'],function(_0x3c24c6){var _0x272b37={};_0x272b37[_0x3c24c6]={'$like':'%'+_0xc537c2[_0xa5f8('0x3b')][_0xa5f8('0x28')]+'%'};return _0x272b37;})});}_0x5e1e8f=_[_0xa5f8('0x46')]({},_0x5e1e8f,_0xc537c2[_0xa5f8('0x48')]);return db[_0xa5f8('0x65')][_0xa5f8('0x1a')]({'where':_0x5e1e8f[_0xa5f8('0x43')]})['then'](function(_0x90f004){_0x5e364e[_0xa5f8('0x1a')]=_0x90f004;if(_0xc537c2[_0xa5f8('0x3b')][_0xa5f8('0x49')]){_0x5e1e8f['include']=[{'all':!![]}];}return db[_0xa5f8('0x65')]['findAll'](_0x5e1e8f);})['then'](function(_0x4735ca){_0x5e364e['rows']=_0x4735ca;return _0x5e364e;});}})[_0xa5f8('0x23')](respondWithFilteredResult(_0x6da5ad,_0x5e1e8f))[_0xa5f8('0x4d')](handleError(_0x6da5ad,null));};exports[_0xa5f8('0x66')]=function(_0x53c619,_0x409804,_0x15b9b6){var _0x311723={'raw':!![],'where':{}};var _0x37d52d={};var _0x5d5c1a={'count':0x0,'rows':[]};return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0x53c619[_0xa5f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x409804,null))[_0xa5f8('0x23')](function(_0x58a34d){if(_0x58a34d){_0x37d52d[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x67')]['rawAttributes']);_0x37d52d[_0xa5f8('0x3b')]=_[_0xa5f8('0x5a')](_0x53c619[_0xa5f8('0x3b')]);_0x37d52d['filters']=_[_0xa5f8('0x39')](_0x37d52d[_0xa5f8('0x3a')],_0x37d52d[_0xa5f8('0x3b')]);_0x311723[_0xa5f8('0x3d')]=_['intersection'](_0x37d52d[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0x53c619['query'][_0xa5f8('0x3c')]));_0x311723[_0xa5f8('0x3d')]=_0x311723[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0x311723[_0xa5f8('0x3d')]:_0x37d52d['model'];if(!_0x53c619['query'][_0xa5f8('0x3f')](_0xa5f8('0x40'))){_0x311723[_0xa5f8('0x1c')]=qs['limit'](_0x53c619[_0xa5f8('0x3b')][_0xa5f8('0x1c')]);_0x311723[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0x53c619[_0xa5f8('0x3b')][_0xa5f8('0x1b')]);}_0x311723[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0x53c619[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0x311723[_0xa5f8('0x43')]=qs['filters'](_[_0xa5f8('0x45')](_0x53c619[_0xa5f8('0x3b')],_0x37d52d[_0xa5f8('0x44')]));_0x311723[_0xa5f8('0x43')][_0xa5f8('0x62')]=_0x58a34d['id'];if(_0x53c619[_0xa5f8('0x3b')][_0xa5f8('0x28')]){_0x311723[_0xa5f8('0x43')]=_[_0xa5f8('0x46')](_0x311723[_0xa5f8('0x43')],{'$or':_[_0xa5f8('0x2a')](_0x311723[_0xa5f8('0x3d')],function(_0x1c27fd){var _0x49b022={};_0x49b022[_0x1c27fd]={'$like':'%'+_0x53c619['query']['filter']+'%'};return _0x49b022;})});}_0x311723=_['merge']({},_0x311723,_0x53c619['options']);return db[_0xa5f8('0x67')][_0xa5f8('0x1a')]({'where':_0x311723[_0xa5f8('0x43')]})[_0xa5f8('0x23')](function(_0x4fba20){_0x5d5c1a[_0xa5f8('0x1a')]=_0x4fba20;if(_0x53c619[_0xa5f8('0x3b')][_0xa5f8('0x49')]){_0x311723[_0xa5f8('0x4a')]=[{'all':!![]}];}return db[_0xa5f8('0x67')][_0xa5f8('0x4b')](_0x311723);})[_0xa5f8('0x23')](function(_0x521b39){_0x5d5c1a[_0xa5f8('0x4c')]=_0x521b39;return _0x5d5c1a;});}})[_0xa5f8('0x23')](respondWithFilteredResult(_0x409804,_0x311723))['catch'](handleError(_0x409804,null));};exports[_0xa5f8('0x68')]=function(_0x4ba9e0,_0x599b9b,_0x3387bd){var _0x306a7a={'raw':!![],'where':{}};var _0x1d3554={};var _0x2e2baf={'count':0x0,'rows':[]};return db[_0xa5f8('0x35')]['findOne']({'where':{'id':_0x4ba9e0[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x599b9b,null))[_0xa5f8('0x23')](function(_0x37f26b){if(_0x37f26b){_0x1d3554[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x69')][_0xa5f8('0x50')]);_0x1d3554['query']=_[_0xa5f8('0x5a')](_0x4ba9e0['query']);_0x1d3554[_0xa5f8('0x44')]=_[_0xa5f8('0x39')](_0x1d3554['model'],_0x1d3554[_0xa5f8('0x3b')]);_0x306a7a[_0xa5f8('0x3d')]=_['intersection'](_0x1d3554[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0x4ba9e0[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0x306a7a[_0xa5f8('0x3d')]=_0x306a7a[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0x306a7a[_0xa5f8('0x3d')]:_0x1d3554[_0xa5f8('0x3a')];if(!_0x4ba9e0[_0xa5f8('0x3b')][_0xa5f8('0x3f')]('nolimit')){_0x306a7a[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0x4ba9e0[_0xa5f8('0x3b')][_0xa5f8('0x1c')]);_0x306a7a[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0x4ba9e0[_0xa5f8('0x3b')]['offset']);}_0x306a7a[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0x4ba9e0[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0x306a7a[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_['pick'](_0x4ba9e0[_0xa5f8('0x3b')],_0x1d3554[_0xa5f8('0x44')]));_0x306a7a[_0xa5f8('0x43')][_0xa5f8('0x62')]=_0x37f26b['id'];if(_0x4ba9e0[_0xa5f8('0x3b')][_0xa5f8('0x28')]){_0x306a7a[_0xa5f8('0x43')]=_['merge'](_0x306a7a['where'],{'$or':_['map'](_0x306a7a[_0xa5f8('0x3d')],function(_0x2e51d5){var _0x4a0893={};_0x4a0893[_0x2e51d5]={'$like':'%'+_0x4ba9e0[_0xa5f8('0x3b')]['filter']+'%'};return _0x4a0893;})});}_0x306a7a=_[_0xa5f8('0x46')]({},_0x306a7a,_0x4ba9e0['options']);return db[_0xa5f8('0x69')][_0xa5f8('0x1a')]({'where':_0x306a7a[_0xa5f8('0x43')]})[_0xa5f8('0x23')](function(_0x559400){_0x2e2baf[_0xa5f8('0x1a')]=_0x559400;if(_0x4ba9e0[_0xa5f8('0x3b')][_0xa5f8('0x49')]){_0x306a7a[_0xa5f8('0x4a')]=[{'all':!![]}];}return db[_0xa5f8('0x69')]['findAll'](_0x306a7a);})['then'](function(_0x4ee040){_0x2e2baf[_0xa5f8('0x4c')]=_0x4ee040;return _0x2e2baf;});}})['then'](respondWithFilteredResult(_0x599b9b,_0x306a7a))[_0xa5f8('0x4d')](handleError(_0x599b9b,null));};exports['getTeams']=function(_0xa72fa8,_0x3ed5b8,_0x24cd3a){var _0x134e23={};var _0x2f23b0={};var _0xcdf744;var _0x10a459;return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0xa72fa8[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x3ed5b8,null))[_0xa5f8('0x23')](function(_0xa48227){if(_0xa48227){_0xcdf744=_0xa48227;_0x2f23b0[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x6a')][_0xa5f8('0x50')]);_0x2f23b0['query']=_[_0xa5f8('0x5a')](_0xa72fa8['query']);_0x2f23b0[_0xa5f8('0x44')]=_[_0xa5f8('0x39')](_0x2f23b0[_0xa5f8('0x3a')],_0x2f23b0[_0xa5f8('0x3b')]);_0x134e23[_0xa5f8('0x3d')]=_[_0xa5f8('0x39')](_0x2f23b0['model'],qs['fields'](_0xa72fa8['query'][_0xa5f8('0x3c')]));_0x134e23[_0xa5f8('0x3d')]=_0x134e23[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0x134e23[_0xa5f8('0x3d')]:_0x2f23b0[_0xa5f8('0x3a')];_0x134e23['order']=qs[_0xa5f8('0x42')](_0xa72fa8[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0x134e23[_0xa5f8('0x43')]=qs['filters'](_[_0xa5f8('0x45')](_0xa72fa8[_0xa5f8('0x3b')],_0x2f23b0[_0xa5f8('0x44')]));if(_0xa72fa8['query'][_0xa5f8('0x28')]){_0x134e23[_0xa5f8('0x43')]=_[_0xa5f8('0x46')](_0x134e23['where'],{'$or':_[_0xa5f8('0x2a')](_0x134e23[_0xa5f8('0x3d')],function(_0x2ef1e7){var _0x46ee58={};_0x46ee58[_0x2ef1e7]={'$like':'%'+_0xa72fa8['query'][_0xa5f8('0x28')]+'%'};return _0x46ee58;})});}_0x134e23=_[_0xa5f8('0x46')]({},_0x134e23,_0xa72fa8['options']);return _0xcdf744[_0xa5f8('0x6b')](_0x134e23);}})[_0xa5f8('0x23')](function(_0x4a648e){if(_0x4a648e){_0x10a459=_0x4a648e[_0xa5f8('0x3e')];if(!_0xa72fa8[_0xa5f8('0x3b')][_0xa5f8('0x3f')](_0xa5f8('0x40'))){_0x134e23[_0xa5f8('0x1c')]=qs['limit'](_0xa72fa8['query'][_0xa5f8('0x1c')]);_0x134e23[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0xa72fa8[_0xa5f8('0x3b')][_0xa5f8('0x1b')]);}return _0xcdf744[_0xa5f8('0x6b')](_0x134e23);}})[_0xa5f8('0x23')](function(_0x2ba7c3){if(_0x2ba7c3){return _0x2ba7c3?{'count':_0x10a459,'rows':_0x2ba7c3}:null;}})[_0xa5f8('0x23')](respondWithResult(_0x3ed5b8,null))[_0xa5f8('0x4d')](handleError(_0x3ed5b8,null));};exports['addTeams']=function(_0x4dcbc5,_0x177d24,_0x31497f){var _0x59e1f6=_0x4dcbc5[_0xa5f8('0x5c')][_0xa5f8('0x6c')];var _0x1d3896=_[_0xa5f8('0x2a')](_0x59e1f6,'id');return db[_0xa5f8('0x6a')][_0xa5f8('0x4b')]({'where':{'id':_0x1d3896},'attributes':['id'],'include':[{'model':db[_0xa5f8('0x6d')],'as':_0xa5f8('0x6e'),'attributes':['id','name',_0xa5f8('0x6f'),'voicePause',_0xa5f8('0x70')],'raw':!![]}]})[_0xa5f8('0x23')](function(_0x143888){if(_0x143888){var _0x171c13=_[_0xa5f8('0x71')](_0x143888,function(_0x530346){var _0xeb2d2c=_0x530346['get']({'plain':!![]});_0xeb2d2c[_0xa5f8('0x6e')][_0xa5f8('0x72')](function(_0x4e800d){_0x4e800d[_0xa5f8('0x73')]=_[_0xa5f8('0x2d')](_0x59e1f6,{'id':_0xeb2d2c['id']})[_0xa5f8('0x73')];});return _0xeb2d2c[_0xa5f8('0x6e')];});return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x4dcbc5['params']['id']}})[_0xa5f8('0x23')](function(_0x56ab0d){return db[_0xa5f8('0x74')]['transaction'](function(_0x2be62e){return _0x56ab0d[_0xa5f8('0x75')](_0x1d3896,{'transaction':_0x2be62e})[_0xa5f8('0x23')](function(){return BPromise[_0xa5f8('0x76')](_0x171c13,function(_0x7b7fda){return db[_0xa5f8('0x77')][_0xa5f8('0x78')]({'where':{'UserId':_0x7b7fda['id'],'VoiceQueueId':_0x4dcbc5[_0xa5f8('0x4f')]['id']},'defaults':{'penalty':_0x7b7fda[_0xa5f8('0x73')]},'transaction':_0x2be62e});});})['then'](function(){return BPromise[_0xa5f8('0x76')](_[_0xa5f8('0x28')](_0x171c13,{'online':!![]}),function(_0x414186){return db['UserVoiceQueueRt'][_0xa5f8('0x79')]({'membername':_0x414186[_0xa5f8('0x32')],'UserId':_0x414186['id'],'queue_name':_0x56ab0d['name'],'VoiceQueueId':_0x56ab0d['id'],'interface':_['isNil'](_0x414186[_0xa5f8('0x70')])?util[_0xa5f8('0x7a')](_0xa5f8('0x7b'),_0x414186[_0xa5f8('0x32')]):_0x414186[_0xa5f8('0x70')],'paused':_0x414186[_0xa5f8('0x7c')]||![],'penalty':_0x414186[_0xa5f8('0x73')]},{'transaction':_0x2be62e});});})[_0xa5f8('0x23')](function(){_0x171c13[_0xa5f8('0x72')](function(_0x104845){socket[_0xa5f8('0x7d')](_0xa5f8('0x7e'),{'UserId':_0x104845['id'],'VoiceQueueId':_0x56ab0d['id']});});});});});}})[_0xa5f8('0x23')](respondWithStatusCode(_0x177d24,null))[_0xa5f8('0x4d')](handleError(_0x177d24,null));};exports[_0xa5f8('0x7f')]=function(_0x2c13d8,_0x414488,_0x2af78b){return db[_0xa5f8('0x6a')][_0xa5f8('0x4b')]({'where':{'id':_0x2c13d8[_0xa5f8('0x3b')][_0xa5f8('0x80')]},'attributes':['id'],'include':[{'model':db[_0xa5f8('0x6d')],'as':_0xa5f8('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xa5f8('0x23')](handleEntityNotFound(_0x414488,null))[_0xa5f8('0x23')](function(_0x152490){var _0x38db21=_[_0xa5f8('0x2a')](_0x152490,'id');var _0x345e39=[];var _0x2e1135=[];var _0x190aa6=squel[_0xa5f8('0x81')]();_0x190aa6['field']('tq.TeamId')['from']('team_has_voice_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa5f8('0x43')](_0xa5f8('0x82'),_0x2c13d8[_0xa5f8('0x4f')]['id']);for(var _0x222886=0x0;_0x222886<_0x152490[_0xa5f8('0x3e')];_0x222886+=0x1){let _0x7e45f1=_0x152490[_0x222886];for(var _0x3846b4=0x0;_0x3846b4<_0x7e45f1[_0xa5f8('0x6e')][_0xa5f8('0x3e')];_0x3846b4+=0x1){let _0x174a51=_0x7e45f1[_0xa5f8('0x6e')][_0x3846b4];var _0x5028f0=_0x190aa6[_0xa5f8('0x59')]();_0x5028f0[_0xa5f8('0x43')](_0xa5f8('0x83'),_0x174a51['id']);_0x2e1135[_0xa5f8('0x84')](db['sequelize']['query'](_0x5028f0[_0xa5f8('0x85')](),{'type':db[_0xa5f8('0x74')][_0xa5f8('0x86')][_0xa5f8('0x87')]})[_0xa5f8('0x23')](function(_0x5dee9d){if(_0x5dee9d[_0xa5f8('0x3e')]===0x1){return _0x174a51['id'];}else{var _0x416678=_[_0xa5f8('0x88')](_[_0xa5f8('0x2a')](_0x5dee9d,_0xa5f8('0x89')),function(_0x53e50b){return _['includes'](_0x38db21,_0x53e50b);});if(_0x416678){return _0x174a51['id'];}}}));}}return BPromise['all'](_0x2e1135)[_0xa5f8('0x23')](function(_0x733183){_0x345e39=_(_0x345e39)['union'](_0x733183)[_0xa5f8('0x8a')]()[_0xa5f8('0x2b')]();return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x2c13d8[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](function(_0xe4b5b1){return db[_0xa5f8('0x74')][_0xa5f8('0x8b')](function(_0x1aff6a){return _0xe4b5b1[_0xa5f8('0x7f')](_0x2c13d8['query'][_0xa5f8('0x80')],{'transaction':_0x1aff6a})['then'](function(){if(!_[_0xa5f8('0x8c')](_0x345e39)){return _0xe4b5b1[_0xa5f8('0x8d')](_0x345e39,{'transaction':_0x1aff6a})['then'](function(){return db[_0xa5f8('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x2c13d8[_0xa5f8('0x4f')]['id'],'UserId':_0x345e39},'transaction':_0x1aff6a});});}})[_0xa5f8('0x23')](function(){_0x345e39['forEach'](function(_0x5d2942){socket[_0xa5f8('0x7d')]('userVoiceQueue:remove',{'UserId':_0x5d2942,'VoiceQueueId':_0xe4b5b1['id']});});});});});});})[_0xa5f8('0x23')](respondWithStatusCode(_0x414488,null))[_0xa5f8('0x4d')](handleError(_0x414488,null));};exports['addAgents']=function(_0x279c5a,_0xa08f04,_0x97710f){var _0xd03e04,_0x2e17e7;return db['VoiceQueue'][_0xa5f8('0x2d')]({'where':{'id':_0x279c5a[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0xa08f04,null))[_0xa5f8('0x23')](function(_0x5a4d06){if(_0x5a4d06){_0x2e17e7=_0x5a4d06;return _0x5a4d06[_0xa5f8('0x8f')](_0x279c5a['body'][_0xa5f8('0x80')],_[_0xa5f8('0x5d')](_0x279c5a[_0xa5f8('0x5c')],[_0xa5f8('0x80'),'id'])||{})['spread'](function(_0x10c34d){for(var _0x240464=0x0;_0x240464<_0x279c5a[_0xa5f8('0x5c')][_0xa5f8('0x80')][_0xa5f8('0x3e')];_0x240464+=0x1){socket[_0xa5f8('0x7d')]('userVoiceQueue:save',{'UserId':_0x279c5a[_0xa5f8('0x5c')][_0xa5f8('0x80')][_0x240464],'VoiceQueueId':_0x279c5a[_0xa5f8('0x4f')]['id']});}return _0x10c34d;});}})[_0xa5f8('0x23')](function(_0x16bdd3){_0xd03e04=_0x16bdd3||[];if(_0x2e17e7){return db['User'][_0xa5f8('0x4b')]({'where':{'id':_0x279c5a[_0xa5f8('0x5c')][_0xa5f8('0x80')]},'attributes':['id','name',_0xa5f8('0x6f'),_0xa5f8('0x7c'),_0xa5f8('0x70')],'raw':!![]});}})[_0xa5f8('0x23')](function(_0x566bd3){if(!_[_0xa5f8('0x8c')](_0x566bd3)){var _0x364ebb=[];for(var _0x4bd3c2=0x0;_0x4bd3c2<_0x566bd3[_0xa5f8('0x3e')];_0x4bd3c2++){if(_0x566bd3[_0x4bd3c2]['online']){_0x364ebb[_0xa5f8('0x84')](db[_0xa5f8('0x8e')][_0xa5f8('0x79')]({'membername':_0x566bd3[_0x4bd3c2][_0xa5f8('0x32')],'UserId':_0x566bd3[_0x4bd3c2]['id'],'queue_name':_0x2e17e7['name'],'VoiceQueueId':_0x2e17e7['id'],'interface':_[_0xa5f8('0x90')](_0x566bd3[_0x4bd3c2][_0xa5f8('0x70')])?util['format'](_0xa5f8('0x7b'),_0x566bd3[_0x4bd3c2]['name']):_0x566bd3[_0x4bd3c2]['interface'],'paused':_0x566bd3[_0x4bd3c2]['voicePause']||![],'penalty':_0x279c5a[_0xa5f8('0x5c')]['penalty']||0x0}));}}return BPromise[_0xa5f8('0x91')](_0x364ebb);}})[_0xa5f8('0x23')](function(){return _0xd03e04;})[_0xa5f8('0x23')](respondWithResult(_0xa08f04,null))[_0xa5f8('0x4d')](handleError(_0xa08f04,null));};exports['removeAgents']=function(_0x31bd8e,_0x39f667,_0x4495a9){return db[_0xa5f8('0x35')]['find']({'where':{'id':_0x31bd8e[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x39f667,null))[_0xa5f8('0x23')](function(_0x3a0241){if(_0x3a0241){return _0x3a0241['removeAgents'](_0x31bd8e[_0xa5f8('0x3b')][_0xa5f8('0x80')])[_0xa5f8('0x23')](function(){if(_[_0xa5f8('0x92')](_0x31bd8e[_0xa5f8('0x3b')][_0xa5f8('0x80')])){for(var _0x6d5da=0x0;_0x6d5da<_0x31bd8e[_0xa5f8('0x3b')][_0xa5f8('0x80')][_0xa5f8('0x3e')];_0x6d5da+=0x1){socket['emit'](_0xa5f8('0x93'),{'UserId':Number(_0x31bd8e['query']['ids'][_0x6d5da]),'VoiceQueueId':Number(_0x31bd8e['params']['id'])});}}else{socket[_0xa5f8('0x7d')](_0xa5f8('0x93'),{'UserId':Number(_0x31bd8e[_0xa5f8('0x3b')][_0xa5f8('0x80')]),'VoiceQueueId':Number(_0x31bd8e['params']['id'])});}});}})['then'](function(_0x28dc3f){return db[_0xa5f8('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x31bd8e[_0xa5f8('0x4f')]['id'],'UserId':_0x31bd8e[_0xa5f8('0x3b')][_0xa5f8('0x80')]}})[_0xa5f8('0x23')](function(){return _0x28dc3f;});})[_0xa5f8('0x23')](respondWithStatusCode(_0x39f667,null))[_0xa5f8('0x4d')](handleError(_0x39f667,null));};exports[_0xa5f8('0x94')]=function(_0x38f345,_0x3999b8,_0x18cb79){var _0xb38259={};var _0x1c00da={};var _0x3ce882;var _0x343fe3;return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0x38f345[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x3999b8,null))[_0xa5f8('0x23')](function(_0x4914b7){if(_0x4914b7){_0x3ce882=_0x4914b7;_0x1c00da['model']=_['keys'](db['User'][_0xa5f8('0x50')]);_0x1c00da[_0xa5f8('0x3b')]=_[_0xa5f8('0x5a')](_0x38f345[_0xa5f8('0x3b')]);_0x1c00da[_0xa5f8('0x44')]=_['intersection'](_0x1c00da[_0xa5f8('0x3a')],_0x1c00da[_0xa5f8('0x3b')]);_0xb38259[_0xa5f8('0x3d')]=_[_0xa5f8('0x39')](_0x1c00da['model'],qs[_0xa5f8('0x3c')](_0x38f345[_0xa5f8('0x3b')][_0xa5f8('0x3c')]));_0xb38259[_0xa5f8('0x3d')]=_0xb38259['attributes'][_0xa5f8('0x3e')]?_0xb38259[_0xa5f8('0x3d')]:_0x1c00da[_0xa5f8('0x3a')];_0xb38259[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0x38f345[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0xb38259[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_[_0xa5f8('0x45')](_0x38f345[_0xa5f8('0x3b')],_0x1c00da['filters']));if(_0x38f345[_0xa5f8('0x3b')][_0xa5f8('0x28')]){_0xb38259[_0xa5f8('0x43')]=_['merge'](_0xb38259[_0xa5f8('0x43')],{'$or':_[_0xa5f8('0x2a')](_0xb38259[_0xa5f8('0x3d')],function(_0x4e68c6){var _0x1841ad={};_0x1841ad[_0x4e68c6]={'$like':'%'+_0x38f345[_0xa5f8('0x3b')]['filter']+'%'};return _0x1841ad;})});}_0xb38259=_['merge']({},_0xb38259,_0x38f345[_0xa5f8('0x48')]);return _0x3ce882[_0xa5f8('0x94')](_0xb38259);}})[_0xa5f8('0x23')](function(_0x59244c){if(_0x59244c){_0x343fe3=_0x59244c[_0xa5f8('0x3e')];if(!_0x38f345[_0xa5f8('0x3b')][_0xa5f8('0x3f')](_0xa5f8('0x40'))){_0xb38259[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0x38f345[_0xa5f8('0x3b')][_0xa5f8('0x1c')]);_0xb38259['offset']=qs[_0xa5f8('0x1b')](_0x38f345[_0xa5f8('0x3b')]['offset']);}return _0x3ce882[_0xa5f8('0x94')](_0xb38259);}})[_0xa5f8('0x23')](function(_0x2d3183){if(_0x2d3183){return _0x2d3183?{'count':_0x343fe3,'rows':_0x2d3183}:null;}})['then'](respondWithResult(_0x3999b8,null))['catch'](handleError(_0x3999b8,null));};exports[_0xa5f8('0x95')]=function(_0xf34ba0,_0x25030d,_0x12451f){var _0xd28c48={};var _0x4e9474={};var _0x101099;var _0x394d27;return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0xf34ba0[_0xa5f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x25030d,null))[_0xa5f8('0x23')](function(_0x287ad8){if(_0x287ad8){_0x101099=_0x287ad8;_0x4e9474[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x8e')][_0xa5f8('0x50')]);_0x4e9474['query']=_[_0xa5f8('0x5a')](_0xf34ba0[_0xa5f8('0x3b')]);_0x4e9474['filters']=_['intersection'](_0x4e9474[_0xa5f8('0x3a')],_0x4e9474[_0xa5f8('0x3b')]);_0xd28c48[_0xa5f8('0x3d')]=_[_0xa5f8('0x39')](_0x4e9474[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0xf34ba0['query']['fields']));_0xd28c48[_0xa5f8('0x3d')]=_0xd28c48[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0xd28c48[_0xa5f8('0x3d')]:_0x4e9474['model'];_0xd28c48[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0xf34ba0['query'][_0xa5f8('0x42')]);_0xd28c48[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_[_0xa5f8('0x45')](_0xf34ba0[_0xa5f8('0x3b')],_0x4e9474[_0xa5f8('0x44')]));if(_0xf34ba0[_0xa5f8('0x3b')][_0xa5f8('0x28')]){_0xd28c48['where']=_[_0xa5f8('0x46')](_0xd28c48['where'],{'$or':_[_0xa5f8('0x2a')](_0xd28c48[_0xa5f8('0x3d')],function(_0x42bebb){var _0x4f9dc5={};_0x4f9dc5[_0x42bebb]={'$like':'%'+_0xf34ba0['query'][_0xa5f8('0x28')]+'%'};return _0x4f9dc5;})});}_0xd28c48=_[_0xa5f8('0x46')]({},_0xd28c48,_0xf34ba0['options']);return _0x101099[_0xa5f8('0x95')](_0xd28c48);}})[_0xa5f8('0x23')](function(_0x25ba73){if(_0x25ba73){_0x394d27=_0x25ba73[_0xa5f8('0x3e')];if(!_0xf34ba0[_0xa5f8('0x3b')]['hasOwnProperty'](_0xa5f8('0x40'))){_0xd28c48[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0xf34ba0['query'][_0xa5f8('0x1c')]);_0xd28c48[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0xf34ba0[_0xa5f8('0x3b')][_0xa5f8('0x1b')]);}return _0x101099[_0xa5f8('0x95')](_0xd28c48);}})[_0xa5f8('0x23')](function(_0x53811c){return _0x53811c?{'count':_0x394d27,'rows':_0x53811c}:null;})[_0xa5f8('0x23')](respondWithResult(_0x25030d,null))['catch'](handleError(_0x25030d,null));};exports[_0xa5f8('0x96')]=function(_0x3168e7,_0x3674c6,_0x1cc0b8){var _0x1983e2={};var _0x5e07a8={};var _0x169db7;var _0x153145;return db[_0xa5f8('0x35')][_0xa5f8('0x61')]({'where':{'id':_0x3168e7['params']['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x3674c6,null))[_0xa5f8('0x23')](function(_0xe26332){if(_0xe26332){_0x169db7=_0xe26332;_0x5e07a8[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x97')][_0xa5f8('0x50')]);_0x5e07a8['query']=_[_0xa5f8('0x5a')](_0x3168e7[_0xa5f8('0x3b')]);_0x5e07a8[_0xa5f8('0x44')]=_['intersection'](_0x5e07a8[_0xa5f8('0x3a')],_0x5e07a8[_0xa5f8('0x3b')]);_0x1983e2[_0xa5f8('0x3d')]=_['intersection'](_0x5e07a8['model'],qs[_0xa5f8('0x3c')](_0x3168e7['query'][_0xa5f8('0x3c')]));_0x1983e2[_0xa5f8('0x3d')]=_0x1983e2[_0xa5f8('0x3d')][_0xa5f8('0x3e')]?_0x1983e2[_0xa5f8('0x3d')]:_0x5e07a8[_0xa5f8('0x3a')];_0x1983e2[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0x3168e7[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0x1983e2[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_[_0xa5f8('0x45')](_0x3168e7['query'],_0x5e07a8[_0xa5f8('0x44')]));if(_0x3168e7[_0xa5f8('0x3b')][_0xa5f8('0x28')]){_0x1983e2[_0xa5f8('0x43')]=_[_0xa5f8('0x46')](_0x1983e2[_0xa5f8('0x43')],{'$or':_[_0xa5f8('0x2a')](_0x1983e2[_0xa5f8('0x3d')],function(_0x26a399){var _0x29599f={};_0x29599f[_0x26a399]={'$like':'%'+_0x3168e7[_0xa5f8('0x3b')]['filter']+'%'};return _0x29599f;})});}_0x1983e2=_[_0xa5f8('0x46')]({},_0x1983e2,_0x3168e7[_0xa5f8('0x48')]);return _0x169db7[_0xa5f8('0x96')](_0x1983e2);}})['then'](function(_0x292399){if(_0x292399){_0x153145=_0x292399[_0xa5f8('0x3e')];if(!_0x3168e7[_0xa5f8('0x3b')]['hasOwnProperty'](_0xa5f8('0x40'))){_0x1983e2[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0x3168e7[_0xa5f8('0x3b')]['limit']);_0x1983e2[_0xa5f8('0x1b')]=qs[_0xa5f8('0x1b')](_0x3168e7[_0xa5f8('0x3b')][_0xa5f8('0x1b')]);}return _0x169db7[_0xa5f8('0x96')](_0x1983e2);}})[_0xa5f8('0x23')](function(_0x20ba6f){if(_0x20ba6f){return _0x20ba6f?{'count':_0x153145,'rows':_0x20ba6f}:null;}})[_0xa5f8('0x23')](respondWithResult(_0x3674c6,null))['catch'](handleError(_0x3674c6,null));};exports['addLists']=function(_0x1b2ebd,_0x3528f6,_0x4afae7){var _0x18a8ba,_0x19f537;return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x1b2ebd[_0xa5f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3528f6,null))['then'](function(_0xd62ab8){if(_0xd62ab8){_0x19f537=_0xd62ab8;return _0xd62ab8[_0xa5f8('0x98')](_0x1b2ebd[_0xa5f8('0x5c')][_0xa5f8('0x80')],_['omit'](_0x1b2ebd['body'],[_0xa5f8('0x80'),'id'])||{});}return null;})['spread'](function(_0x349aeb){var _0x1c6d93;_0x18a8ba=_0x349aeb||[];var _0x2a04a3=[];if(_0x349aeb){for(var _0x1ad31b=0x0;_0x1ad31b<_0x349aeb[_0xa5f8('0x3e')];_0x1ad31b+=0x1){var _0x4ea0e6=_0x349aeb[_0x1ad31b]['get']({'plain':!![]});_0x19f537[_0xa5f8('0x99')]=_0x1b2ebd[_0xa5f8('0x5c')]['dialCheckDuplicateType']?_0x1b2ebd['body'][_0xa5f8('0x99')]:_0x19f537[_0xa5f8('0x99')];switch(_0x19f537[_0xa5f8('0x99')]){case'always':_0x1c6d93=squel['insert']()[_0xa5f8('0x9a')]('cm_hopper')['fromQuery']([_0xa5f8('0x9b'),_0xa5f8('0x9c'),_0xa5f8('0x9d'),_0xa5f8('0x9e'),_0xa5f8('0x62'),'createdAt','updatedAt'],squel[_0xa5f8('0x81')]()['field']('phone','phone')[_0xa5f8('0x9f')](_0xa5f8('0xa0'),'scheduledAt')[_0xa5f8('0x9f')]('id','ContactId')[_0xa5f8('0x9f')](_0x4ea0e6['CmListId']['toString'](),'ListId')['field'](_0x1b2ebd[_0xa5f8('0x4f')]['id'][_0xa5f8('0x85')](),_0xa5f8('0x62'))[_0xa5f8('0x9f')](_0xa5f8('0xa0'),'createdAt')[_0xa5f8('0x9f')](_0xa5f8('0xa0'),_0xa5f8('0x5b'))[_0xa5f8('0xa1')](_0xa5f8('0xa2'))[_0xa5f8('0x43')](_0xa5f8('0xa3'))['where'](_0xa5f8('0xa4'),_0x4ea0e6[_0xa5f8('0xa5')][_0xa5f8('0x85')]())[_0xa5f8('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xa5f8('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa5f8('0x81')]()[_0xa5f8('0x9f')](_0xa5f8('0xa6'))[_0xa5f8('0xa1')](_0xa5f8('0xa7'))[_0xa5f8('0x43')](_0xa5f8('0x82'),_0x1b2ebd['params']['id'][_0xa5f8('0x85')]()))[_0xa5f8('0x43')](_0xa5f8('0xa8'),squel[_0xa5f8('0x81')]()[_0xa5f8('0x9f')]('COALESCE(phone,\x27\x27)')['from'](_0xa5f8('0xa9'))['where'](_0xa5f8('0x82'),_0x1b2ebd[_0xa5f8('0x4f')]['id']['toString']())))[_0xa5f8('0x85')]();break;case _0xa5f8('0xaa'):_0x1c6d93=squel[_0xa5f8('0xab')]()[_0xa5f8('0x9a')](_0xa5f8('0xa9'))[_0xa5f8('0xac')](['phone','scheduledAt',_0xa5f8('0x9d'),_0xa5f8('0x9e'),'VoiceQueueId',_0xa5f8('0x5e'),_0xa5f8('0x5b')],squel['select']()['field'](_0xa5f8('0x9b'),'phone')[_0xa5f8('0x9f')](_0xa5f8('0xa0'),'scheduledAt')['field']('id',_0xa5f8('0x9d'))[_0xa5f8('0x9f')](_0x4ea0e6[_0xa5f8('0xa5')][_0xa5f8('0x85')](),_0xa5f8('0x9e'))['field'](_0x1b2ebd['params']['id'][_0xa5f8('0x85')](),'VoiceQueueId')[_0xa5f8('0x9f')](_0xa5f8('0xa0'),_0xa5f8('0x5e'))[_0xa5f8('0x9f')](_0xa5f8('0xa0'),_0xa5f8('0x5b'))[_0xa5f8('0xa1')]('cm_contacts')['where'](_0xa5f8('0xa3'))[_0xa5f8('0x43')](_0xa5f8('0xa4'),_0x4ea0e6[_0xa5f8('0xa5')][_0xa5f8('0x85')]())[_0xa5f8('0x43')](_0xa5f8('0xad'))[_0xa5f8('0x43')](_0xa5f8('0xa8'),squel[_0xa5f8('0x81')]()['field'](_0xa5f8('0xae'))['from'](_0xa5f8('0xa9'))[_0xa5f8('0x43')](_0xa5f8('0x82'),_0x1b2ebd[_0xa5f8('0x4f')]['id']['toString']())))[_0xa5f8('0x85')]();break;default:_0x1c6d93=squel['insert']()[_0xa5f8('0x9a')](_0xa5f8('0xa9'))[_0xa5f8('0xac')]([_0xa5f8('0x9b'),_0xa5f8('0x9c'),_0xa5f8('0x9d'),'ListId',_0xa5f8('0x62'),'createdAt',_0xa5f8('0x5b')],squel[_0xa5f8('0x81')]()[_0xa5f8('0x9f')]('phone',_0xa5f8('0x9b'))[_0xa5f8('0x9f')]('NOW()',_0xa5f8('0x9c'))['field']('id',_0xa5f8('0x9d'))[_0xa5f8('0x9f')](_0x4ea0e6[_0xa5f8('0xa5')][_0xa5f8('0x85')](),_0xa5f8('0x9e'))[_0xa5f8('0x9f')](_0x1b2ebd['params']['id'][_0xa5f8('0x85')](),_0xa5f8('0x62'))[_0xa5f8('0x9f')]('NOW()','createdAt')[_0xa5f8('0x9f')](_0xa5f8('0xa0'),_0xa5f8('0x5b'))['from'](_0xa5f8('0xa2'))['where'](_0xa5f8('0xa3'))[_0xa5f8('0x43')](_0xa5f8('0xa4'),_0x4ea0e6[_0xa5f8('0xa5')][_0xa5f8('0x85')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x2a04a3[_0xa5f8('0x84')](db[_0xa5f8('0x74')]['query'](_0x1c6d93));}return BPromise[_0xa5f8('0x91')](_0x2a04a3);}})[_0xa5f8('0x23')](function(){return _0x18a8ba;})[_0xa5f8('0x23')](respondWithResult(_0x3528f6,null))[_0xa5f8('0x4d')](handleError(_0x3528f6,null));};exports[_0xa5f8('0xaf')]=function(_0x2ef0cf,_0x44510a,_0x2c6671){return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x2ef0cf['params']['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x44510a,null))[_0xa5f8('0x23')](function(_0x758dbb){if(_0x758dbb){return _0x758dbb[_0xa5f8('0xaf')](_0x2ef0cf[_0xa5f8('0x3b')]['ids']);}})[_0xa5f8('0x23')](function(_0x374ccd){if(_0x374ccd){return db[_0xa5f8('0x63')]['destroy']({'where':{'ListId':_0x2ef0cf[_0xa5f8('0x3b')][_0xa5f8('0x80')],'VoiceQueueId':_0x2ef0cf['params']['id']}})[_0xa5f8('0x23')](function(){return _0x374ccd;});}})[_0xa5f8('0x23')](respondWithStatusCode(_0x44510a,null))['catch'](handleError(_0x44510a,null));};exports['getBlackLists']=function(_0x4d111a,_0x573800,_0x51fd56){var _0x47d84f={};var _0x506623={};var _0x46a76f;var _0x1fdac5;return db['VoiceQueue']['findOne']({'where':{'id':_0x4d111a[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x573800,null))[_0xa5f8('0x23')](function(_0x4e3f06){if(_0x4e3f06){_0x46a76f=_0x4e3f06;_0x506623[_0xa5f8('0x3a')]=_[_0xa5f8('0x5a')](db[_0xa5f8('0x97')][_0xa5f8('0x50')]);_0x506623[_0xa5f8('0x3b')]=_['keys'](_0x4d111a[_0xa5f8('0x3b')]);_0x506623[_0xa5f8('0x44')]=_[_0xa5f8('0x39')](_0x506623[_0xa5f8('0x3a')],_0x506623[_0xa5f8('0x3b')]);_0x47d84f[_0xa5f8('0x3d')]=_[_0xa5f8('0x39')](_0x506623[_0xa5f8('0x3a')],qs[_0xa5f8('0x3c')](_0x4d111a['query'][_0xa5f8('0x3c')]));_0x47d84f['attributes']=_0x47d84f['attributes']['length']?_0x47d84f[_0xa5f8('0x3d')]:_0x506623[_0xa5f8('0x3a')];_0x47d84f[_0xa5f8('0x41')]=qs[_0xa5f8('0x42')](_0x4d111a[_0xa5f8('0x3b')][_0xa5f8('0x42')]);_0x47d84f[_0xa5f8('0x43')]=qs[_0xa5f8('0x44')](_[_0xa5f8('0x45')](_0x4d111a[_0xa5f8('0x3b')],_0x506623[_0xa5f8('0x44')]));if(_0x4d111a[_0xa5f8('0x3b')]['filter']){_0x47d84f[_0xa5f8('0x43')]=_[_0xa5f8('0x46')](_0x47d84f[_0xa5f8('0x43')],{'$or':_['map'](_0x47d84f['attributes'],function(_0x15cddc){var _0x160fc9={};_0x160fc9[_0x15cddc]={'$like':'%'+_0x4d111a[_0xa5f8('0x3b')][_0xa5f8('0x28')]+'%'};return _0x160fc9;})});}_0x47d84f=_['merge']({},_0x47d84f,_0x4d111a[_0xa5f8('0x48')]);return _0x46a76f[_0xa5f8('0xb0')](_0x47d84f);}})[_0xa5f8('0x23')](function(_0x3f9caa){if(_0x3f9caa){_0x1fdac5=_0x3f9caa[_0xa5f8('0x3e')];if(!_0x4d111a[_0xa5f8('0x3b')][_0xa5f8('0x3f')](_0xa5f8('0x40'))){_0x47d84f[_0xa5f8('0x1c')]=qs[_0xa5f8('0x1c')](_0x4d111a[_0xa5f8('0x3b')]['limit']);_0x47d84f['offset']=qs[_0xa5f8('0x1b')](_0x4d111a['query'][_0xa5f8('0x1b')]);}return _0x46a76f[_0xa5f8('0xb0')](_0x47d84f);}})[_0xa5f8('0x23')](function(_0x273072){if(_0x273072){return _0x273072?{'count':_0x1fdac5,'rows':_0x273072}:null;}})['then'](respondWithResult(_0x573800,null))[_0xa5f8('0x4d')](handleError(_0x573800,null));};exports[_0xa5f8('0xb1')]=function(_0x3841ea,_0x4d61c5,_0x388f6c){var _0x5a6af5,_0x5b93bc;return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0x3841ea[_0xa5f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d61c5,null))[_0xa5f8('0x23')](function(_0x5cdab9){if(_0x5cdab9){_0x5b93bc=_0x5cdab9;return _0x5cdab9[_0xa5f8('0xb1')](_0x3841ea['body'][_0xa5f8('0x80')],_['omit'](_0x3841ea['body'],['ids','id'])||{});}return null;})[_0xa5f8('0xb2')](function(_0x5d0e97){var _0x3e76bf;_0x5a6af5=_0x5d0e97||[];var _0x3360b4=[];if(_0x5d0e97){for(var _0x238530=0x0;_0x238530<_0x5d0e97[_0xa5f8('0x3e')];_0x238530+=0x1){var _0x536291=_0x5d0e97[_0x238530]['get']({'plain':!![]});_0x3e76bf=squel[_0xa5f8('0xab')]()['into'](_0xa5f8('0xb3'))['fromQuery'](['phone',_0xa5f8('0x9d'),_0xa5f8('0x9e'),_0xa5f8('0x62'),_0xa5f8('0x5e'),_0xa5f8('0x5b')],squel[_0xa5f8('0x81')]()[_0xa5f8('0x9f')](_0xa5f8('0x9b'),'phone')[_0xa5f8('0x9f')]('id',_0xa5f8('0x9d'))[_0xa5f8('0x9f')](_0x536291[_0xa5f8('0xa5')]['toString'](),_0xa5f8('0x9e'))[_0xa5f8('0x9f')](_0x3841ea[_0xa5f8('0x4f')]['id'][_0xa5f8('0x85')](),_0xa5f8('0x62'))[_0xa5f8('0x9f')](_0xa5f8('0xa0'),_0xa5f8('0x5e'))[_0xa5f8('0x9f')](_0xa5f8('0xa0'),_0xa5f8('0x5b'))['from'](_0xa5f8('0xa2'))['where'](_0xa5f8('0xa3'))[_0xa5f8('0x43')](_0xa5f8('0xa4'),_0x536291['CmListId']['toString']())[_0xa5f8('0x43')](_0xa5f8('0xad')))[_0xa5f8('0x85')]();_0x3360b4[_0xa5f8('0x84')](db[_0xa5f8('0x74')][_0xa5f8('0x3b')](_0x3e76bf));}return BPromise['all'](_0x3360b4);}})[_0xa5f8('0x23')](function(){return _0x5a6af5;})[_0xa5f8('0x23')](respondWithResult(_0x4d61c5,null))[_0xa5f8('0x4d')](handleError(_0x4d61c5,null));};exports['removeBlackLists']=function(_0xbd0fd7,_0x17ed2a,_0x1ae30d){return db[_0xa5f8('0x35')][_0xa5f8('0x2d')]({'where':{'id':_0xbd0fd7[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](handleEntityNotFound(_0x17ed2a,null))[_0xa5f8('0x23')](function(_0x1feb35){if(_0x1feb35){return _0x1feb35['removeBlackLists'](_0xbd0fd7[_0xa5f8('0x3b')]['ids']);}})['then'](function(_0x3fc0e3){if(_0x3fc0e3){return db[_0xa5f8('0x69')]['destroy']({'where':{'ListId':_0xbd0fd7[_0xa5f8('0x3b')]['ids'],'VoiceQueueId':_0xbd0fd7[_0xa5f8('0x4f')]['id']}})[_0xa5f8('0x23')](function(){return _0x3fc0e3;});}})[_0xa5f8('0x23')](respondWithStatusCode(_0x17ed2a,null))['catch'](handleError(_0x17ed2a,null));}; \ No newline at end of file +var _0xd253=['sendStatus','status','json','offset','set','apply','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','filter','ignore','value','includes','type','find','name','UserProfileResource','stack','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','VoiceQueue','includeAll','include','findAll','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','VoiceQueueId','count','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','voicePause','flatMap','forEach','sequelize','addTeams','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','penalty','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','online','push','SIP/%s','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0xd253,0x152));var _0x3d25=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xd253[_0x5037ab];return _0x512adb;};'use strict';var pdf=require(_0x3d25('0x0'));var emlformat=require(_0x3d25('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3d25('0x2'));var jsonpatch=require(_0x3d25('0x3'));var rp=require('request-promise');var moment=require(_0x3d25('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3d25('0x5'));var path=require('path');var sox=require(_0x3d25('0x6'));var csv=require(_0x3d25('0x7'));var ejs=require(_0x3d25('0x8'));var fs=require('fs');var _=require(_0x3d25('0x9'));var squel=require('squel');var crypto=require(_0x3d25('0xa'));var jsforce=require(_0x3d25('0xb'));var deskjs=require(_0x3d25('0xc'));var toCsv=require(_0x3d25('0x7'));var querystring=require('querystring');var Papa=require(_0x3d25('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d25('0xe'));var as=require(_0x3d25('0xf'));var hardwareService=require(_0x3d25('0x10'));var logger=require(_0x3d25('0x11'))(_0x3d25('0x12'));var utils=require(_0x3d25('0x13'));var config=require(_0x3d25('0x14'));var db=require(_0x3d25('0x15'))['db'];config['redis']=_[_0x3d25('0x16')](config[_0x3d25('0x17')],{'host':_0x3d25('0x18'),'port':0x18eb});var socket=require(_0x3d25('0x19'))(new Redis(config[_0x3d25('0x17')]));require(_0x3d25('0x1a'))[_0x3d25('0x1b')](socket);function respondWithStatusCode(_0x4ea1b1,_0x5412f7){_0x5412f7=_0x5412f7||0xcc;return function(_0x3692c9){if(_0x3692c9){return _0x4ea1b1[_0x3d25('0x1c')](_0x5412f7);}return _0x4ea1b1['status'](_0x5412f7)['end']();};}function respondWithResult(_0x9ea719,_0x499354){_0x499354=_0x499354||0xc8;return function(_0x1ca68f){if(_0x1ca68f){return _0x9ea719[_0x3d25('0x1d')](_0x499354)[_0x3d25('0x1e')](_0x1ca68f);}};}function respondWithFilteredResult(_0x1f0433,_0x3745a2){return function(_0x2bd377){if(_0x2bd377){var _0x5bb368=_0x2bd377['count'],_0x18a0f3=_0x3745a2[_0x3d25('0x1f')],_0x601196=_0x3745a2['offset']+_0x3745a2['limit'],_0x5321bc;if(_0x601196>=_0x5bb368){_0x601196=_0x5bb368;_0x5321bc=0xc8;}else{_0x5321bc=0xce;}_0x1f0433[_0x3d25('0x1d')](_0x5321bc);return _0x1f0433[_0x3d25('0x20')]('Content-Range',_0x18a0f3+'-'+_0x601196+'/'+_0x5bb368)['json'](_0x2bd377);}return null;};}function patchUpdates(_0xb530b8){return function(_0x4d241d){try{jsonpatch[_0x3d25('0x21')](_0x4d241d,_0xb530b8,!![]);}catch(_0x67a03b){return BPromise[_0x3d25('0x22')](_0x67a03b);}return _0x4d241d[_0x3d25('0x23')]();};}function saveUpdates(_0x1668b7,_0x199974){return function(_0x5c80dc){if(_0x5c80dc){return _0x5c80dc[_0x3d25('0x24')](_0x1668b7)[_0x3d25('0x25')](function(_0x1c28e8){return _0x1c28e8;});}return null;};}function removeEntity(_0x1c3d51,_0x5f34e8){return function(_0x1387c4){if(_0x1387c4){return _0x1387c4[_0x3d25('0x26')]()[_0x3d25('0x25')](function(){var _0x3ca814=_0x1387c4['get']({'plain':!![]});var _0x36c6c5=[{'name':_0x3d25('0x27'),'value':_0x3d25('0x28'),'ignore':![]},{'name':_0x3d25('0x29'),'value':'outbound','ignore':![]}];var _0x181cf8=_(_0x36c6c5)[_0x3d25('0x2a')](_0x3d25('0x2b'))['map'](_0x3d25('0x2c'))['value']();if(_[_0x3d25('0x2d')](_0x181cf8,_0x3ca814[_0x3d25('0x2e')])){return;}var _0x22ad68=_[_0x3d25('0x2f')](_0x36c6c5,[_0x3d25('0x2c'),_0x3ca814[_0x3d25('0x2e')]])[_0x3d25('0x30')];return db[_0x3d25('0x31')][_0x3d25('0x26')]({'where':{'type':_0x22ad68,'resourceId':_0x3ca814['id']}})[_0x3d25('0x25')](function(){return _0x1387c4;});})[_0x3d25('0x25')](function(){_0x1c3d51[_0x3d25('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1703a8,_0x53c1ab){return function(_0x2d8e85){if(!_0x2d8e85){_0x1703a8['sendStatus'](0x194);}return _0x2d8e85;};}function handleError(_0x53a8d1,_0x1704d3){_0x1704d3=_0x1704d3||0x1f4;return function(_0x198ff5){logger['error'](_0x198ff5[_0x3d25('0x32')]);if(_0x198ff5['name']){delete _0x198ff5[_0x3d25('0x30')];}_0x53a8d1[_0x3d25('0x1d')](_0x1704d3)[_0x3d25('0x33')](_0x198ff5);};}exports['index']=function(_0x3ff872,_0x5e0900){var _0x34d66d={},_0x3b0f81={},_0xa621eb={'count':0x0,'rows':[]};var _0x1eb070=_[_0x3d25('0x34')](db['VoiceQueue'][_0x3d25('0x35')],function(_0x3dd2d6){return{'name':_0x3dd2d6[_0x3d25('0x36')],'type':_0x3dd2d6[_0x3d25('0x2e')][_0x3d25('0x37')]};});_0x3b0f81[_0x3d25('0x38')]=_[_0x3d25('0x34')](_0x1eb070,_0x3d25('0x30'));_0x3b0f81[_0x3d25('0x39')]=_[_0x3d25('0x3a')](_0x3ff872['query']);_0x3b0f81[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x3b0f81[_0x3d25('0x38')],_0x3b0f81[_0x3d25('0x39')]);_0x34d66d[_0x3d25('0x3d')]=_[_0x3d25('0x3c')](_0x3b0f81[_0x3d25('0x38')],qs[_0x3d25('0x3e')](_0x3ff872[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x34d66d[_0x3d25('0x3d')]=_0x34d66d[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x34d66d[_0x3d25('0x3d')]:_0x3b0f81[_0x3d25('0x38')];if(!_0x3ff872[_0x3d25('0x39')][_0x3d25('0x40')](_0x3d25('0x41'))){_0x34d66d['limit']=qs[_0x3d25('0x42')](_0x3ff872[_0x3d25('0x39')][_0x3d25('0x42')]);_0x34d66d[_0x3d25('0x1f')]=qs[_0x3d25('0x1f')](_0x3ff872[_0x3d25('0x39')][_0x3d25('0x1f')]);}_0x34d66d[_0x3d25('0x43')]=qs['sort'](_0x3ff872[_0x3d25('0x39')][_0x3d25('0x44')]);_0x34d66d[_0x3d25('0x45')]=qs[_0x3d25('0x3b')](_[_0x3d25('0x46')](_0x3ff872[_0x3d25('0x39')],_0x3b0f81['filters']));if(_0x3ff872['query']['filter']){_0x34d66d[_0x3d25('0x45')]=_['merge'](_0x34d66d[_0x3d25('0x45')],{'$or':_['map'](_0x1eb070,function(_0x227bd1){if(_0x227bd1[_0x3d25('0x2e')]!==_0x3d25('0x47')){var _0x5dfb1d={};_0x5dfb1d[_0x227bd1[_0x3d25('0x30')]]={'$like':'%'+_0x3ff872['query'][_0x3d25('0x2a')]+'%'};return _0x5dfb1d;}})});}_0x34d66d=_[_0x3d25('0x48')]({},_0x34d66d,_0x3ff872[_0x3d25('0x49')]);var _0x2d1e57={'where':_0x34d66d['where']};return db[_0x3d25('0x4a')]['count'](_0x2d1e57)['then'](function(_0x3ffbbe){_0xa621eb['count']=_0x3ffbbe;if(_0x3ff872[_0x3d25('0x39')][_0x3d25('0x4b')]){_0x34d66d[_0x3d25('0x4c')]=[{'all':!![]}];}return db[_0x3d25('0x4a')][_0x3d25('0x4d')](_0x34d66d);})[_0x3d25('0x25')](function(_0x22bc72){_0xa621eb['rows']=_0x22bc72;return _0xa621eb;})['then'](respondWithFilteredResult(_0x5e0900,_0x34d66d))[_0x3d25('0x4e')](handleError(_0x5e0900,null));};exports[_0x3d25('0x4f')]=function(_0x9974c3,_0x59b952){var _0x59ae3a={'raw':![],'where':{'id':_0x9974c3[_0x3d25('0x50')]['id']}},_0x1d6994={};_0x1d6994[_0x3d25('0x38')]=_[_0x3d25('0x3a')](db['VoiceQueue']['rawAttributes']);_0x1d6994[_0x3d25('0x39')]=_[_0x3d25('0x3a')](_0x9974c3[_0x3d25('0x39')]);_0x1d6994[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x1d6994[_0x3d25('0x38')],_0x1d6994[_0x3d25('0x39')]);_0x59ae3a[_0x3d25('0x3d')]=_[_0x3d25('0x3c')](_0x1d6994['model'],qs[_0x3d25('0x3e')](_0x9974c3[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x59ae3a[_0x3d25('0x3d')]=_0x59ae3a[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x59ae3a[_0x3d25('0x3d')]:_0x1d6994[_0x3d25('0x38')];if(_0x9974c3['query'][_0x3d25('0x4b')]){_0x59ae3a['include']=[{'all':!![]}];}_0x59ae3a=_[_0x3d25('0x48')]({},_0x59ae3a,_0x9974c3[_0x3d25('0x49')]);return db[_0x3d25('0x4a')][_0x3d25('0x2f')](_0x59ae3a)[_0x3d25('0x25')](handleEntityNotFound(_0x59b952,null))[_0x3d25('0x25')](respondWithResult(_0x59b952,null))[_0x3d25('0x4e')](handleError(_0x59b952,null));};exports[_0x3d25('0x51')]=function(_0x4312be,_0x1eb797){return db[_0x3d25('0x4a')][_0x3d25('0x51')](_0x4312be[_0x3d25('0x52')],{})['then'](function(_0x5ce93f){var _0x434b99=_0x4312be[_0x3d25('0x53')][_0x3d25('0x54')]({'plain':!![]});if(!_0x434b99)throw new Error(_0x3d25('0x55'));if(_0x434b99[_0x3d25('0x56')]===_0x3d25('0x53')){var _0x54b927=_0x5ce93f[_0x3d25('0x54')]({'plain':!![]});var _0x1105c7=[{'name':'VoiceQueues','value':_0x3d25('0x28')},{'name':_0x3d25('0x29'),'value':'outbound'}];var _0x5a5eb0=_[_0x3d25('0x2f')](_0x1105c7,[_0x3d25('0x2c'),_0x54b927[_0x3d25('0x2e')]])['name'];return db[_0x3d25('0x57')][_0x3d25('0x2f')]({'where':{'name':_0x5a5eb0,'userProfileId':_0x434b99[_0x3d25('0x58')]},'raw':!![]})[_0x3d25('0x25')](function(_0x11a332){if(_0x11a332&&_0x11a332[_0x3d25('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b927['name'],'resourceId':_0x54b927['id'],'type':_0x11a332['name'],'sectionId':_0x11a332['id']},{})['then'](function(){return _0x5ce93f;});}else{return _0x5ce93f;}})[_0x3d25('0x4e')](function(_0x12f79f){logger[_0x3d25('0x5a')](_0x3d25('0x5b'),_0x12f79f);throw _0x12f79f;});}return _0x5ce93f;})[_0x3d25('0x25')](respondWithResult(_0x1eb797,0xc9))[_0x3d25('0x4e')](handleError(_0x1eb797,null));};exports[_0x3d25('0x5c')]=function(_0x49043c,_0x266b34){var _0x270970={'where':{'id':_0x49043c['params']['id']}},_0xe44e0={};_0xe44e0[_0x3d25('0x38')]=_['keys'](db[_0x3d25('0x4a')]['rawAttributes']);_0x270970['attributes']=_[_0x3d25('0x3c')](_0xe44e0[_0x3d25('0x38')],qs['fields'](_0x49043c[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x270970[_0x3d25('0x3d')]=_0x270970['attributes'][_0x3d25('0x3f')]?_0x270970['attributes']:_0xe44e0['model'];if(_0x49043c[_0x3d25('0x39')][_0x3d25('0x4b')]){_0x270970[_0x3d25('0x4c')]=[{'all':!![]}];}_0x270970=_[_0x3d25('0x48')]({},_0x270970,_0x49043c[_0x3d25('0x49')]);return db['VoiceQueue'][_0x3d25('0x2f')](_0x270970)['then'](handleEntityNotFound(_0x266b34,null))[_0x3d25('0x25')](function(_0x3cc51f){if(_0x3cc51f){var _0x318075=_0x3cc51f[_0x3d25('0x54')]({'plain':!![]});_0x318075=qs[_0x3d25('0x5d')](_0x318075,['id',_0x3d25('0x5e'),'updatedAt']);_0x49043c[_0x3d25('0x52')]=_[_0x3d25('0x5d')](_0x49043c[_0x3d25('0x52')],['id','createdAt',_0x3d25('0x5f')]);return db[_0x3d25('0x4a')][_0x3d25('0x51')](_[_0x3d25('0x48')](_0x318075,_0x49043c[_0x3d25('0x52')]),{'include':_0x49043c[_0x3d25('0x39')][_0x3d25('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x2570ba){var _0x434418=_0x49043c[_0x3d25('0x53')][_0x3d25('0x54')]({'plain':!![]});if(!_0x434418)throw new Error(_0x3d25('0x55'));if(_0x434418[_0x3d25('0x56')]===_0x3d25('0x53')){var _0x11027f=_0x2570ba[_0x3d25('0x54')]({'plain':!![]});var _0xb2eac=[{'name':_0x3d25('0x27'),'value':_0x3d25('0x28')},{'name':_0x3d25('0x29'),'value':'outbound'}];var _0x299e65=_['find'](_0xb2eac,[_0x3d25('0x2c'),_0x11027f[_0x3d25('0x2e')]])[_0x3d25('0x30')];return db[_0x3d25('0x57')][_0x3d25('0x2f')]({'where':{'name':_0x299e65,'userProfileId':_0x434418[_0x3d25('0x58')]},'raw':!![]})[_0x3d25('0x25')](function(_0x39552a){if(_0x39552a&&_0x39552a['autoAssociation']===0x0){return db[_0x3d25('0x31')][_0x3d25('0x51')]({'name':_0x11027f[_0x3d25('0x30')],'resourceId':_0x11027f['id'],'type':_0x39552a[_0x3d25('0x30')],'sectionId':_0x39552a['id']},{})['then'](function(){return _0x2570ba;});}else{return _0x2570ba;}})[_0x3d25('0x4e')](function(_0x30fa04){logger[_0x3d25('0x5a')](_0x3d25('0x5b'),_0x30fa04);throw _0x30fa04;});}return _0x2570ba;});}})[_0x3d25('0x25')](respondWithResult(_0x266b34,0xc9))[_0x3d25('0x4e')](handleError(_0x266b34,null));};exports[_0x3d25('0x24')]=function(_0x2c46b3,_0x396d3e){if(_0x2c46b3[_0x3d25('0x52')]['id']){delete _0x2c46b3[_0x3d25('0x52')]['id'];}return db[_0x3d25('0x4a')]['find']({'where':{'id':_0x2c46b3['params']['id']}})['then'](handleEntityNotFound(_0x396d3e,null))[_0x3d25('0x25')](saveUpdates(_0x2c46b3[_0x3d25('0x52')],null))[_0x3d25('0x25')](respondWithResult(_0x396d3e,null))['catch'](handleError(_0x396d3e,null));};exports[_0x3d25('0x26')]=function(_0x39c549,_0x592172){return db[_0x3d25('0x4a')][_0x3d25('0x2f')]({'where':{'id':_0x39c549[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x592172,null))[_0x3d25('0x25')](removeEntity(_0x592172,null))[_0x3d25('0x4e')](handleError(_0x592172,null));};exports[_0x3d25('0x60')]=function(_0x20f7b8,_0x768671,_0x56631d){var _0x34b03a={'raw':![],'where':{}};var _0x3d30a7={};var _0x3e070a={'count':0x0,'rows':[]};return db[_0x3d25('0x4a')][_0x3d25('0x61')]({'where':{'id':_0x20f7b8[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x768671,null))[_0x3d25('0x25')](function(_0x56158d){if(_0x56158d){_0x3d30a7[_0x3d25('0x38')]=_[_0x3d25('0x3a')](db[_0x3d25('0x62')][_0x3d25('0x35')]);_0x3d30a7['query']=_['keys'](_0x20f7b8['query']);_0x3d30a7[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x3d30a7['model'],_0x3d30a7[_0x3d25('0x39')]);_0x34b03a['attributes']=_[_0x3d25('0x3c')](_0x3d30a7[_0x3d25('0x38')],qs[_0x3d25('0x3e')](_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x34b03a[_0x3d25('0x3d')]=_0x34b03a[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x34b03a[_0x3d25('0x3d')]:_0x3d30a7[_0x3d25('0x38')];if(!_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x40')](_0x3d25('0x41'))){_0x34b03a['limit']=qs[_0x3d25('0x42')](_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x42')]);_0x34b03a['offset']=qs[_0x3d25('0x1f')](_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x1f')]);}_0x34b03a[_0x3d25('0x43')]=qs['sort'](_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x44')]);_0x34b03a['where']=qs[_0x3d25('0x3b')](_[_0x3d25('0x46')](_0x20f7b8[_0x3d25('0x39')],_0x3d30a7[_0x3d25('0x3b')]));_0x34b03a['where'][_0x3d25('0x63')]=_0x56158d['id'];if(_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x34b03a[_0x3d25('0x45')]=_[_0x3d25('0x48')](_0x34b03a[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0x34b03a['attributes'],function(_0x48b53b){var _0x36ceb3={};_0x36ceb3[_0x48b53b]={'$like':'%'+_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x2a')]+'%'};return _0x36ceb3;})});}_0x34b03a=_['merge']({},_0x34b03a,_0x20f7b8['options']);return db[_0x3d25('0x62')][_0x3d25('0x64')]({'where':_0x34b03a[_0x3d25('0x45')]})[_0x3d25('0x25')](function(_0x1c3d40){_0x3e070a[_0x3d25('0x64')]=_0x1c3d40;if(_0x20f7b8[_0x3d25('0x39')][_0x3d25('0x4b')]){_0x34b03a[_0x3d25('0x4c')]=[{'all':!![]}];}return db[_0x3d25('0x62')][_0x3d25('0x4d')](_0x34b03a);})[_0x3d25('0x25')](function(_0x580b22){_0x3e070a['rows']=_0x580b22;return _0x3e070a;});}})[_0x3d25('0x25')](respondWithFilteredResult(_0x768671,_0x34b03a))[_0x3d25('0x4e')](handleError(_0x768671,null));};exports[_0x3d25('0x65')]=function(_0x1c944a,_0x1a5a4c,_0x502b84){var _0xa325e9={'raw':!![],'where':{}};var _0x5e6200={};var _0x5ee684={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x1c944a[_0x3d25('0x50')]['id']}})['then'](handleEntityNotFound(_0x1a5a4c,null))['then'](function(_0x40bab2){if(_0x40bab2){_0x5e6200['model']=_[_0x3d25('0x3a')](db[_0x3d25('0x66')][_0x3d25('0x35')]);_0x5e6200[_0x3d25('0x39')]=_[_0x3d25('0x3a')](_0x1c944a['query']);_0x5e6200['filters']=_[_0x3d25('0x3c')](_0x5e6200['model'],_0x5e6200['query']);_0xa325e9[_0x3d25('0x3d')]=_['intersection'](_0x5e6200[_0x3d25('0x38')],qs['fields'](_0x1c944a[_0x3d25('0x39')][_0x3d25('0x3e')]));_0xa325e9[_0x3d25('0x3d')]=_0xa325e9[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0xa325e9['attributes']:_0x5e6200[_0x3d25('0x38')];if(!_0x1c944a['query'][_0x3d25('0x40')](_0x3d25('0x41'))){_0xa325e9[_0x3d25('0x42')]=qs['limit'](_0x1c944a[_0x3d25('0x39')][_0x3d25('0x42')]);_0xa325e9[_0x3d25('0x1f')]=qs[_0x3d25('0x1f')](_0x1c944a['query'][_0x3d25('0x1f')]);}_0xa325e9['order']=qs[_0x3d25('0x44')](_0x1c944a[_0x3d25('0x39')][_0x3d25('0x44')]);_0xa325e9[_0x3d25('0x45')]=qs['filters'](_[_0x3d25('0x46')](_0x1c944a[_0x3d25('0x39')],_0x5e6200[_0x3d25('0x3b')]));_0xa325e9['where']['VoiceQueueId']=_0x40bab2['id'];if(_0x1c944a['query'][_0x3d25('0x2a')]){_0xa325e9[_0x3d25('0x45')]=_[_0x3d25('0x48')](_0xa325e9[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0xa325e9[_0x3d25('0x3d')],function(_0x87ff0c){var _0x5f2f92={};_0x5f2f92[_0x87ff0c]={'$like':'%'+_0x1c944a['query'][_0x3d25('0x2a')]+'%'};return _0x5f2f92;})});}_0xa325e9=_['merge']({},_0xa325e9,_0x1c944a[_0x3d25('0x49')]);return db['CmHopperHistory'][_0x3d25('0x64')]({'where':_0xa325e9[_0x3d25('0x45')]})[_0x3d25('0x25')](function(_0x48e584){_0x5ee684['count']=_0x48e584;if(_0x1c944a['query'][_0x3d25('0x4b')]){_0xa325e9['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d25('0x4d')](_0xa325e9);})[_0x3d25('0x25')](function(_0xd7e58c){_0x5ee684[_0x3d25('0x67')]=_0xd7e58c;return _0x5ee684;});}})['then'](respondWithFilteredResult(_0x1a5a4c,_0xa325e9))[_0x3d25('0x4e')](handleError(_0x1a5a4c,null));};exports[_0x3d25('0x68')]=function(_0x599f62,_0x79696a,_0x4dcfe0){var _0x35af33={'raw':!![],'where':{}};var _0x4549bd={};var _0x31e19d={'count':0x0,'rows':[]};return db[_0x3d25('0x4a')][_0x3d25('0x61')]({'where':{'id':_0x599f62[_0x3d25('0x50')]['id']}})['then'](handleEntityNotFound(_0x79696a,null))['then'](function(_0x539b85){if(_0x539b85){_0x4549bd[_0x3d25('0x38')]=_['keys'](db[_0x3d25('0x69')][_0x3d25('0x35')]);_0x4549bd[_0x3d25('0x39')]=_[_0x3d25('0x3a')](_0x599f62[_0x3d25('0x39')]);_0x4549bd[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x4549bd['model'],_0x4549bd[_0x3d25('0x39')]);_0x35af33['attributes']=_[_0x3d25('0x3c')](_0x4549bd[_0x3d25('0x38')],qs['fields'](_0x599f62[_0x3d25('0x39')]['fields']));_0x35af33[_0x3d25('0x3d')]=_0x35af33[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x35af33[_0x3d25('0x3d')]:_0x4549bd[_0x3d25('0x38')];if(!_0x599f62[_0x3d25('0x39')][_0x3d25('0x40')](_0x3d25('0x41'))){_0x35af33[_0x3d25('0x42')]=qs[_0x3d25('0x42')](_0x599f62[_0x3d25('0x39')][_0x3d25('0x42')]);_0x35af33[_0x3d25('0x1f')]=qs[_0x3d25('0x1f')](_0x599f62[_0x3d25('0x39')][_0x3d25('0x1f')]);}_0x35af33['order']=qs[_0x3d25('0x44')](_0x599f62[_0x3d25('0x39')][_0x3d25('0x44')]);_0x35af33[_0x3d25('0x45')]=qs[_0x3d25('0x3b')](_[_0x3d25('0x46')](_0x599f62['query'],_0x4549bd[_0x3d25('0x3b')]));_0x35af33[_0x3d25('0x45')][_0x3d25('0x63')]=_0x539b85['id'];if(_0x599f62[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x35af33['where']=_[_0x3d25('0x48')](_0x35af33[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0x35af33['attributes'],function(_0x4996bf){var _0x45d8ce={};_0x45d8ce[_0x4996bf]={'$like':'%'+_0x599f62[_0x3d25('0x39')]['filter']+'%'};return _0x45d8ce;})});}_0x35af33=_['merge']({},_0x35af33,_0x599f62[_0x3d25('0x49')]);return db[_0x3d25('0x69')][_0x3d25('0x64')]({'where':_0x35af33[_0x3d25('0x45')]})[_0x3d25('0x25')](function(_0x18591f){_0x31e19d[_0x3d25('0x64')]=_0x18591f;if(_0x599f62[_0x3d25('0x39')]['includeAll']){_0x35af33[_0x3d25('0x4c')]=[{'all':!![]}];}return db[_0x3d25('0x69')][_0x3d25('0x4d')](_0x35af33);})[_0x3d25('0x25')](function(_0x44a36d){_0x31e19d[_0x3d25('0x67')]=_0x44a36d;return _0x31e19d;});}})[_0x3d25('0x25')](respondWithFilteredResult(_0x79696a,_0x35af33))[_0x3d25('0x4e')](handleError(_0x79696a,null));};exports[_0x3d25('0x6a')]=function(_0x40c49b,_0x1d63da,_0x4504f6){var _0x325d29={'raw':!![],'where':{}};var _0x143135={};var _0x381e96={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3d25('0x61')]({'where':{'id':_0x40c49b[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x1d63da,null))[_0x3d25('0x25')](function(_0x2feeae){if(_0x2feeae){_0x143135['model']=_[_0x3d25('0x3a')](db[_0x3d25('0x6b')][_0x3d25('0x35')]);_0x143135['query']=_[_0x3d25('0x3a')](_0x40c49b['query']);_0x143135['filters']=_[_0x3d25('0x3c')](_0x143135[_0x3d25('0x38')],_0x143135['query']);_0x325d29[_0x3d25('0x3d')]=_[_0x3d25('0x3c')](_0x143135[_0x3d25('0x38')],qs[_0x3d25('0x3e')](_0x40c49b[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x325d29[_0x3d25('0x3d')]=_0x325d29[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x325d29[_0x3d25('0x3d')]:_0x143135[_0x3d25('0x38')];if(!_0x40c49b[_0x3d25('0x39')]['hasOwnProperty'](_0x3d25('0x41'))){_0x325d29[_0x3d25('0x42')]=qs['limit'](_0x40c49b['query']['limit']);_0x325d29[_0x3d25('0x1f')]=qs[_0x3d25('0x1f')](_0x40c49b[_0x3d25('0x39')][_0x3d25('0x1f')]);}_0x325d29[_0x3d25('0x43')]=qs['sort'](_0x40c49b['query']['sort']);_0x325d29[_0x3d25('0x45')]=qs['filters'](_[_0x3d25('0x46')](_0x40c49b[_0x3d25('0x39')],_0x143135[_0x3d25('0x3b')]));_0x325d29['where'][_0x3d25('0x63')]=_0x2feeae['id'];if(_0x40c49b[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x325d29[_0x3d25('0x45')]=_['merge'](_0x325d29['where'],{'$or':_[_0x3d25('0x34')](_0x325d29[_0x3d25('0x3d')],function(_0x3a6827){var _0x415c87={};_0x415c87[_0x3a6827]={'$like':'%'+_0x40c49b['query'][_0x3d25('0x2a')]+'%'};return _0x415c87;})});}_0x325d29=_[_0x3d25('0x48')]({},_0x325d29,_0x40c49b['options']);return db[_0x3d25('0x6b')]['count']({'where':_0x325d29[_0x3d25('0x45')]})[_0x3d25('0x25')](function(_0x30dcdf){_0x381e96[_0x3d25('0x64')]=_0x30dcdf;if(_0x40c49b[_0x3d25('0x39')][_0x3d25('0x4b')]){_0x325d29[_0x3d25('0x4c')]=[{'all':!![]}];}return db[_0x3d25('0x6b')][_0x3d25('0x4d')](_0x325d29);})[_0x3d25('0x25')](function(_0x47b6df){_0x381e96[_0x3d25('0x67')]=_0x47b6df;return _0x381e96;});}})['then'](respondWithFilteredResult(_0x1d63da,_0x325d29))[_0x3d25('0x4e')](handleError(_0x1d63da,null));};exports[_0x3d25('0x6c')]=function(_0x4c378c,_0x3110ed,_0x2e3c44){var _0x79fb23={};var _0x1cd1b4={};var _0x2b9ddd;var _0xb5779c;return db[_0x3d25('0x4a')][_0x3d25('0x61')]({'where':{'id':_0x4c378c[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x3110ed,null))[_0x3d25('0x25')](function(_0x5738af){if(_0x5738af){_0x2b9ddd=_0x5738af;_0x1cd1b4[_0x3d25('0x38')]=_[_0x3d25('0x3a')](db[_0x3d25('0x6d')][_0x3d25('0x35')]);_0x1cd1b4[_0x3d25('0x39')]=_[_0x3d25('0x3a')](_0x4c378c['query']);_0x1cd1b4[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x1cd1b4['model'],_0x1cd1b4['query']);_0x79fb23['attributes']=_[_0x3d25('0x3c')](_0x1cd1b4[_0x3d25('0x38')],qs[_0x3d25('0x3e')](_0x4c378c['query'][_0x3d25('0x3e')]));_0x79fb23['attributes']=_0x79fb23[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x79fb23[_0x3d25('0x3d')]:_0x1cd1b4[_0x3d25('0x38')];_0x79fb23[_0x3d25('0x43')]=qs[_0x3d25('0x44')](_0x4c378c[_0x3d25('0x39')][_0x3d25('0x44')]);_0x79fb23['where']=qs[_0x3d25('0x3b')](_['pick'](_0x4c378c[_0x3d25('0x39')],_0x1cd1b4[_0x3d25('0x3b')]));if(_0x4c378c[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x79fb23[_0x3d25('0x45')]=_[_0x3d25('0x48')](_0x79fb23['where'],{'$or':_[_0x3d25('0x34')](_0x79fb23[_0x3d25('0x3d')],function(_0x520070){var _0x2a9fd6={};_0x2a9fd6[_0x520070]={'$like':'%'+_0x4c378c[_0x3d25('0x39')]['filter']+'%'};return _0x2a9fd6;})});}_0x79fb23=_[_0x3d25('0x48')]({},_0x79fb23,_0x4c378c[_0x3d25('0x49')]);return _0x2b9ddd['getTeams'](_0x79fb23);}})[_0x3d25('0x25')](function(_0x23ff8a){if(_0x23ff8a){_0xb5779c=_0x23ff8a[_0x3d25('0x3f')];if(!_0x4c378c[_0x3d25('0x39')][_0x3d25('0x40')](_0x3d25('0x41'))){_0x79fb23['limit']=qs[_0x3d25('0x42')](_0x4c378c[_0x3d25('0x39')]['limit']);_0x79fb23[_0x3d25('0x1f')]=qs[_0x3d25('0x1f')](_0x4c378c[_0x3d25('0x39')]['offset']);}return _0x2b9ddd[_0x3d25('0x6c')](_0x79fb23);}})[_0x3d25('0x25')](function(_0x3c841e){if(_0x3c841e){return _0x3c841e?{'count':_0xb5779c,'rows':_0x3c841e}:null;}})[_0x3d25('0x25')](respondWithResult(_0x3110ed,null))[_0x3d25('0x4e')](handleError(_0x3110ed,null));};exports['addTeams']=function(_0x34899a,_0x522764,_0x322cf2){var _0x204527=_0x34899a[_0x3d25('0x52')]['teams'];var _0x2f0460=_['map'](_0x204527,'id');return db[_0x3d25('0x6d')]['findAll']({'where':{'id':_0x2f0460},'attributes':['id'],'include':[{'model':db[_0x3d25('0x6e')],'as':_0x3d25('0x6f'),'attributes':['id','name','online',_0x3d25('0x70'),'interface'],'raw':!![]}]})[_0x3d25('0x25')](function(_0x2c9c1b){if(_0x2c9c1b){var _0x25da64=_[_0x3d25('0x71')](_0x2c9c1b,function(_0x111523){var _0x1469db=_0x111523[_0x3d25('0x54')]({'plain':!![]});_0x1469db['Agents'][_0x3d25('0x72')](function(_0x4154e3){_0x4154e3['penalty']=_[_0x3d25('0x2f')](_0x204527,{'id':_0x1469db['id']})['penalty'];});return _0x1469db[_0x3d25('0x6f')];});return db[_0x3d25('0x4a')][_0x3d25('0x2f')]({'where':{'id':_0x34899a[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](function(_0x27a7c7){return db[_0x3d25('0x73')]['transaction'](function(_0x2bfd12){return _0x27a7c7[_0x3d25('0x74')](_0x2f0460,{'transaction':_0x2bfd12})[_0x3d25('0x25')](function(){return BPromise[_0x3d25('0x75')](_0x25da64,function(_0x28010a){return db[_0x3d25('0x76')][_0x3d25('0x77')]({'where':{'UserId':_0x28010a['id'],'VoiceQueueId':_0x34899a['params']['id']},'defaults':{'penalty':_0x28010a['penalty']},'transaction':_0x2bfd12});});})['then'](function(){return BPromise[_0x3d25('0x75')](_['filter'](_0x25da64,{'online':!![]}),function(_0x5c1893){return db[_0x3d25('0x78')][_0x3d25('0x79')]({'membername':_0x5c1893[_0x3d25('0x30')],'UserId':_0x5c1893['id'],'queue_name':_0x27a7c7['name'],'VoiceQueueId':_0x27a7c7['id'],'interface':_[_0x3d25('0x7a')](_0x5c1893[_0x3d25('0x7b')])?util[_0x3d25('0x7c')]('SIP/%s',_0x5c1893[_0x3d25('0x30')]):_0x5c1893[_0x3d25('0x7b')],'paused':_0x5c1893[_0x3d25('0x70')]||![],'penalty':_0x5c1893[_0x3d25('0x7d')]},{'transaction':_0x2bfd12});});})[_0x3d25('0x25')](function(){_0x25da64[_0x3d25('0x72')](function(_0x76b9e8){socket['emit'](_0x3d25('0x7e'),{'UserId':_0x76b9e8['id'],'VoiceQueueId':_0x27a7c7['id']});});});});});}})['then'](respondWithStatusCode(_0x522764,null))[_0x3d25('0x4e')](handleError(_0x522764,null));};exports[_0x3d25('0x7f')]=function(_0x1b7138,_0x2328c9,_0x2790e8){return db[_0x3d25('0x6d')][_0x3d25('0x4d')]({'where':{'id':_0x1b7138[_0x3d25('0x39')][_0x3d25('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3d25('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2328c9,null))[_0x3d25('0x25')](function(_0x10f776){var _0x36bc21=_[_0x3d25('0x34')](_0x10f776,'id');var _0x15764e=[];var _0x3e73b7=[];var _0xa7a4a6=squel[_0x3d25('0x81')]();_0xa7a4a6[_0x3d25('0x82')](_0x3d25('0x83'))['from'](_0x3d25('0x84'),'tq')['join'](_0x3d25('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3d25('0x45')](_0x3d25('0x86'),_0x1b7138[_0x3d25('0x50')]['id']);for(var _0x344dc5=0x0;_0x344dc5<_0x10f776['length'];_0x344dc5+=0x1){let _0xfe3e62=_0x10f776[_0x344dc5];for(var _0x56221f=0x0;_0x56221f<_0xfe3e62['Agents'][_0x3d25('0x3f')];_0x56221f+=0x1){let _0x4b344c=_0xfe3e62[_0x3d25('0x6f')][_0x56221f];var _0x5a7828=_0xa7a4a6['clone']();_0x5a7828['where'](_0x3d25('0x87'),_0x4b344c['id']);_0x3e73b7['push'](db['sequelize'][_0x3d25('0x39')](_0x5a7828[_0x3d25('0x88')](),{'type':db[_0x3d25('0x73')][_0x3d25('0x89')][_0x3d25('0x8a')]})['then'](function(_0x25e4ef){if(_0x25e4ef[_0x3d25('0x3f')]===0x1){return _0x4b344c['id'];}else{var _0x34ea21=_[_0x3d25('0x8b')](_[_0x3d25('0x34')](_0x25e4ef,_0x3d25('0x8c')),function(_0x2fe8db){return _[_0x3d25('0x2d')](_0x36bc21,_0x2fe8db);});if(_0x34ea21){return _0x4b344c['id'];}}}));}}return BPromise[_0x3d25('0x8d')](_0x3e73b7)[_0x3d25('0x25')](function(_0x4645dc){_0x15764e=_(_0x15764e)['union'](_0x4645dc)['compact']()['value']();return db[_0x3d25('0x4a')]['find']({'where':{'id':_0x1b7138[_0x3d25('0x50')]['id']}})['then'](function(_0x38cf48){return db['sequelize']['transaction'](function(_0x5de576){return _0x38cf48[_0x3d25('0x7f')](_0x1b7138[_0x3d25('0x39')][_0x3d25('0x80')],{'transaction':_0x5de576})['then'](function(){if(!_[_0x3d25('0x8e')](_0x15764e)){return _0x38cf48[_0x3d25('0x8f')](_0x15764e,{'transaction':_0x5de576})[_0x3d25('0x25')](function(){return db[_0x3d25('0x78')][_0x3d25('0x26')]({'where':{'VoiceQueueId':_0x1b7138[_0x3d25('0x50')]['id'],'UserId':_0x15764e},'transaction':_0x5de576});});}})[_0x3d25('0x25')](function(){_0x15764e[_0x3d25('0x72')](function(_0x5b0d43){socket['emit'](_0x3d25('0x90'),{'UserId':_0x5b0d43,'VoiceQueueId':_0x38cf48['id']});});});});});});})[_0x3d25('0x25')](respondWithStatusCode(_0x2328c9,null))[_0x3d25('0x4e')](handleError(_0x2328c9,null));};exports[_0x3d25('0x91')]=function(_0x20193b,_0xf595,_0x5869c7){var _0x3e9491,_0x2917e4;return db[_0x3d25('0x4a')][_0x3d25('0x2f')]({'where':{'id':_0x20193b[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0xf595,null))[_0x3d25('0x25')](function(_0x55c15e){if(_0x55c15e){_0x2917e4=_0x55c15e;return _0x55c15e[_0x3d25('0x91')](_0x20193b[_0x3d25('0x52')][_0x3d25('0x80')],_[_0x3d25('0x5d')](_0x20193b['body'],[_0x3d25('0x80'),'id'])||{})[_0x3d25('0x92')](function(_0x318386){for(var _0x30d8b6=0x0;_0x30d8b6<_0x20193b[_0x3d25('0x52')][_0x3d25('0x80')]['length'];_0x30d8b6+=0x1){socket[_0x3d25('0x93')](_0x3d25('0x7e'),{'UserId':_0x20193b[_0x3d25('0x52')][_0x3d25('0x80')][_0x30d8b6],'VoiceQueueId':_0x20193b['params']['id']});}return _0x318386;});}})['then'](function(_0x40de0c){_0x3e9491=_0x40de0c||[];if(_0x2917e4){return db[_0x3d25('0x6e')][_0x3d25('0x4d')]({'where':{'id':_0x20193b[_0x3d25('0x52')][_0x3d25('0x80')]},'attributes':['id',_0x3d25('0x30'),_0x3d25('0x94'),_0x3d25('0x70'),'interface'],'raw':!![]});}})[_0x3d25('0x25')](function(_0x5598fc){if(!_['isEmpty'](_0x5598fc)){var _0x133421=[];for(var _0x538988=0x0;_0x538988<_0x5598fc[_0x3d25('0x3f')];_0x538988++){if(_0x5598fc[_0x538988]['online']){_0x133421[_0x3d25('0x95')](db['UserVoiceQueueRt'][_0x3d25('0x79')]({'membername':_0x5598fc[_0x538988][_0x3d25('0x30')],'UserId':_0x5598fc[_0x538988]['id'],'queue_name':_0x2917e4[_0x3d25('0x30')],'VoiceQueueId':_0x2917e4['id'],'interface':_[_0x3d25('0x7a')](_0x5598fc[_0x538988][_0x3d25('0x7b')])?util['format'](_0x3d25('0x96'),_0x5598fc[_0x538988]['name']):_0x5598fc[_0x538988]['interface'],'paused':_0x5598fc[_0x538988][_0x3d25('0x70')]||![],'penalty':_0x20193b[_0x3d25('0x52')][_0x3d25('0x7d')]||0x0}));}}return BPromise[_0x3d25('0x8d')](_0x133421);}})[_0x3d25('0x25')](function(){return _0x3e9491;})['then'](respondWithResult(_0xf595,null))[_0x3d25('0x4e')](handleError(_0xf595,null));};exports[_0x3d25('0x8f')]=function(_0x26e6bc,_0x280f53,_0x164037){return db['VoiceQueue']['find']({'where':{'id':_0x26e6bc['params']['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x280f53,null))['then'](function(_0x5a2660){if(_0x5a2660){return _0x5a2660[_0x3d25('0x8f')](_0x26e6bc[_0x3d25('0x39')][_0x3d25('0x80')])[_0x3d25('0x25')](function(){if(_[_0x3d25('0x97')](_0x26e6bc['query'][_0x3d25('0x80')])){for(var _0x4274ec=0x0;_0x4274ec<_0x26e6bc[_0x3d25('0x39')][_0x3d25('0x80')][_0x3d25('0x3f')];_0x4274ec+=0x1){socket[_0x3d25('0x93')](_0x3d25('0x90'),{'UserId':Number(_0x26e6bc[_0x3d25('0x39')]['ids'][_0x4274ec]),'VoiceQueueId':Number(_0x26e6bc['params']['id'])});}}else{socket['emit'](_0x3d25('0x90'),{'UserId':Number(_0x26e6bc[_0x3d25('0x39')][_0x3d25('0x80')]),'VoiceQueueId':Number(_0x26e6bc[_0x3d25('0x50')]['id'])});}});}})[_0x3d25('0x25')](function(_0x322625){return db[_0x3d25('0x78')][_0x3d25('0x26')]({'where':{'VoiceQueueId':_0x26e6bc[_0x3d25('0x50')]['id'],'UserId':_0x26e6bc[_0x3d25('0x39')]['ids']}})[_0x3d25('0x25')](function(){return _0x322625;});})[_0x3d25('0x25')](respondWithStatusCode(_0x280f53,null))[_0x3d25('0x4e')](handleError(_0x280f53,null));};exports['getAgents']=function(_0x48282c,_0x2f6535,_0x286fe5){var _0x28842f={};var _0x36cd27={};var _0x2cc04b;var _0x1c7f67;return db['VoiceQueue'][_0x3d25('0x61')]({'where':{'id':_0x48282c[_0x3d25('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f6535,null))[_0x3d25('0x25')](function(_0xa016de){if(_0xa016de){_0x2cc04b=_0xa016de;_0x36cd27['model']=_[_0x3d25('0x3a')](db[_0x3d25('0x6e')]['rawAttributes']);_0x36cd27['query']=_[_0x3d25('0x3a')](_0x48282c['query']);_0x36cd27[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x36cd27[_0x3d25('0x38')],_0x36cd27[_0x3d25('0x39')]);_0x28842f[_0x3d25('0x3d')]=_['intersection'](_0x36cd27[_0x3d25('0x38')],qs['fields'](_0x48282c[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x28842f[_0x3d25('0x3d')]=_0x28842f['attributes'][_0x3d25('0x3f')]?_0x28842f[_0x3d25('0x3d')]:_0x36cd27[_0x3d25('0x38')];_0x28842f[_0x3d25('0x43')]=qs[_0x3d25('0x44')](_0x48282c[_0x3d25('0x39')][_0x3d25('0x44')]);_0x28842f['where']=qs[_0x3d25('0x3b')](_[_0x3d25('0x46')](_0x48282c[_0x3d25('0x39')],_0x36cd27[_0x3d25('0x3b')]));if(_0x48282c[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x28842f['where']=_[_0x3d25('0x48')](_0x28842f[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0x28842f[_0x3d25('0x3d')],function(_0x40da80){var _0xe994a0={};_0xe994a0[_0x40da80]={'$like':'%'+_0x48282c[_0x3d25('0x39')][_0x3d25('0x2a')]+'%'};return _0xe994a0;})});}_0x28842f=_[_0x3d25('0x48')]({},_0x28842f,_0x48282c[_0x3d25('0x49')]);return _0x2cc04b['getAgents'](_0x28842f);}})['then'](function(_0x182671){if(_0x182671){_0x1c7f67=_0x182671[_0x3d25('0x3f')];if(!_0x48282c[_0x3d25('0x39')][_0x3d25('0x40')]('nolimit')){_0x28842f['limit']=qs['limit'](_0x48282c[_0x3d25('0x39')][_0x3d25('0x42')]);_0x28842f['offset']=qs[_0x3d25('0x1f')](_0x48282c[_0x3d25('0x39')][_0x3d25('0x1f')]);}return _0x2cc04b[_0x3d25('0x98')](_0x28842f);}})[_0x3d25('0x25')](function(_0x1e9613){if(_0x1e9613){return _0x1e9613?{'count':_0x1c7f67,'rows':_0x1e9613}:null;}})[_0x3d25('0x25')](respondWithResult(_0x2f6535,null))[_0x3d25('0x4e')](handleError(_0x2f6535,null));};exports[_0x3d25('0x99')]=function(_0xce6fae,_0x558620,_0x46dbad){var _0x2d2d8e={};var _0x211f88={};var _0x44ebfc;var _0x48249c;return db['VoiceQueue'][_0x3d25('0x61')]({'where':{'id':_0xce6fae[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x558620,null))[_0x3d25('0x25')](function(_0x35b21e){if(_0x35b21e){_0x44ebfc=_0x35b21e;_0x211f88['model']=_['keys'](db[_0x3d25('0x78')][_0x3d25('0x35')]);_0x211f88['query']=_[_0x3d25('0x3a')](_0xce6fae[_0x3d25('0x39')]);_0x211f88[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x211f88['model'],_0x211f88[_0x3d25('0x39')]);_0x2d2d8e[_0x3d25('0x3d')]=_[_0x3d25('0x3c')](_0x211f88['model'],qs['fields'](_0xce6fae[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x2d2d8e[_0x3d25('0x3d')]=_0x2d2d8e[_0x3d25('0x3d')][_0x3d25('0x3f')]?_0x2d2d8e['attributes']:_0x211f88[_0x3d25('0x38')];_0x2d2d8e['order']=qs[_0x3d25('0x44')](_0xce6fae[_0x3d25('0x39')][_0x3d25('0x44')]);_0x2d2d8e[_0x3d25('0x45')]=qs['filters'](_['pick'](_0xce6fae['query'],_0x211f88[_0x3d25('0x3b')]));if(_0xce6fae[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x2d2d8e[_0x3d25('0x45')]=_[_0x3d25('0x48')](_0x2d2d8e[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0x2d2d8e[_0x3d25('0x3d')],function(_0x520631){var _0x100bf7={};_0x100bf7[_0x520631]={'$like':'%'+_0xce6fae['query']['filter']+'%'};return _0x100bf7;})});}_0x2d2d8e=_[_0x3d25('0x48')]({},_0x2d2d8e,_0xce6fae['options']);return _0x44ebfc[_0x3d25('0x99')](_0x2d2d8e);}})[_0x3d25('0x25')](function(_0x56773d){if(_0x56773d){_0x48249c=_0x56773d[_0x3d25('0x3f')];if(!_0xce6fae[_0x3d25('0x39')]['hasOwnProperty'](_0x3d25('0x41'))){_0x2d2d8e['limit']=qs[_0x3d25('0x42')](_0xce6fae['query']['limit']);_0x2d2d8e[_0x3d25('0x1f')]=qs['offset'](_0xce6fae[_0x3d25('0x39')][_0x3d25('0x1f')]);}return _0x44ebfc[_0x3d25('0x99')](_0x2d2d8e);}})[_0x3d25('0x25')](function(_0x43e89b){return _0x43e89b?{'count':_0x48249c,'rows':_0x43e89b}:null;})[_0x3d25('0x25')](respondWithResult(_0x558620,null))['catch'](handleError(_0x558620,null));};exports['getLists']=function(_0x36e56b,_0x1a4661,_0x2e818d){var _0x3b5f82={};var _0x31613c={};var _0xce81c;var _0x1b7be4;return db[_0x3d25('0x4a')][_0x3d25('0x61')]({'where':{'id':_0x36e56b[_0x3d25('0x50')]['id']}})['then'](handleEntityNotFound(_0x1a4661,null))[_0x3d25('0x25')](function(_0x1490ae){if(_0x1490ae){_0xce81c=_0x1490ae;_0x31613c[_0x3d25('0x38')]=_[_0x3d25('0x3a')](db[_0x3d25('0x9a')][_0x3d25('0x35')]);_0x31613c['query']=_[_0x3d25('0x3a')](_0x36e56b[_0x3d25('0x39')]);_0x31613c[_0x3d25('0x3b')]=_[_0x3d25('0x3c')](_0x31613c[_0x3d25('0x38')],_0x31613c['query']);_0x3b5f82[_0x3d25('0x3d')]=_[_0x3d25('0x3c')](_0x31613c[_0x3d25('0x38')],qs[_0x3d25('0x3e')](_0x36e56b['query']['fields']));_0x3b5f82['attributes']=_0x3b5f82['attributes'][_0x3d25('0x3f')]?_0x3b5f82[_0x3d25('0x3d')]:_0x31613c[_0x3d25('0x38')];_0x3b5f82['order']=qs[_0x3d25('0x44')](_0x36e56b[_0x3d25('0x39')][_0x3d25('0x44')]);_0x3b5f82[_0x3d25('0x45')]=qs[_0x3d25('0x3b')](_['pick'](_0x36e56b[_0x3d25('0x39')],_0x31613c[_0x3d25('0x3b')]));if(_0x36e56b[_0x3d25('0x39')]['filter']){_0x3b5f82[_0x3d25('0x45')]=_[_0x3d25('0x48')](_0x3b5f82[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0x3b5f82[_0x3d25('0x3d')],function(_0x2abca0){var _0x5499df={};_0x5499df[_0x2abca0]={'$like':'%'+_0x36e56b['query']['filter']+'%'};return _0x5499df;})});}_0x3b5f82=_[_0x3d25('0x48')]({},_0x3b5f82,_0x36e56b[_0x3d25('0x49')]);return _0xce81c[_0x3d25('0x9b')](_0x3b5f82);}})[_0x3d25('0x25')](function(_0x57e851){if(_0x57e851){_0x1b7be4=_0x57e851[_0x3d25('0x3f')];if(!_0x36e56b[_0x3d25('0x39')][_0x3d25('0x40')](_0x3d25('0x41'))){_0x3b5f82[_0x3d25('0x42')]=qs['limit'](_0x36e56b[_0x3d25('0x39')][_0x3d25('0x42')]);_0x3b5f82[_0x3d25('0x1f')]=qs['offset'](_0x36e56b[_0x3d25('0x39')][_0x3d25('0x1f')]);}return _0xce81c['getLists'](_0x3b5f82);}})[_0x3d25('0x25')](function(_0x21f27e){if(_0x21f27e){return _0x21f27e?{'count':_0x1b7be4,'rows':_0x21f27e}:null;}})[_0x3d25('0x25')](respondWithResult(_0x1a4661,null))['catch'](handleError(_0x1a4661,null));};exports[_0x3d25('0x9c')]=function(_0x3b2278,_0xeb1dd7,_0xda365b){var _0x575019,_0x58d9f2;return db['VoiceQueue']['find']({'where':{'id':_0x3b2278[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0xeb1dd7,null))[_0x3d25('0x25')](function(_0x88a706){if(_0x88a706){_0x58d9f2=_0x88a706;return _0x88a706[_0x3d25('0x9c')](_0x3b2278[_0x3d25('0x52')]['ids'],_[_0x3d25('0x5d')](_0x3b2278[_0x3d25('0x52')],[_0x3d25('0x80'),'id'])||{});}return null;})[_0x3d25('0x92')](function(_0x219cbd){var _0x49f5e5;_0x575019=_0x219cbd||[];var _0x1a4625=[];if(_0x219cbd){for(var _0x4ec3a9=0x0;_0x4ec3a9<_0x219cbd[_0x3d25('0x3f')];_0x4ec3a9+=0x1){var _0x3db45d=_0x219cbd[_0x4ec3a9][_0x3d25('0x54')]({'plain':!![]});_0x58d9f2['dialCheckDuplicateType']=_0x3b2278[_0x3d25('0x52')]['dialCheckDuplicateType']?_0x3b2278[_0x3d25('0x52')]['dialCheckDuplicateType']:_0x58d9f2[_0x3d25('0x9d')];switch(_0x58d9f2[_0x3d25('0x9d')]){case _0x3d25('0x9e'):_0x49f5e5=squel[_0x3d25('0x9f')]()[_0x3d25('0xa0')](_0x3d25('0xa1'))[_0x3d25('0xa2')](['phone',_0x3d25('0xa3'),_0x3d25('0xa4'),_0x3d25('0xa5'),_0x3d25('0x63'),_0x3d25('0x5e'),'updatedAt'],squel['select']()[_0x3d25('0x82')](_0x3d25('0xa6'),_0x3d25('0xa6'))[_0x3d25('0x82')](_0x3d25('0xa7'),'scheduledAt')[_0x3d25('0x82')]('id',_0x3d25('0xa4'))[_0x3d25('0x82')](_0x3db45d[_0x3d25('0xa8')][_0x3d25('0x88')](),_0x3d25('0xa5'))[_0x3d25('0x82')](_0x3b2278['params']['id'][_0x3d25('0x88')](),_0x3d25('0x63'))[_0x3d25('0x82')](_0x3d25('0xa7'),'createdAt')['field'](_0x3d25('0xa7'),_0x3d25('0x5f'))[_0x3d25('0xa9')]('cm_contacts')[_0x3d25('0x45')](_0x3d25('0xaa'))[_0x3d25('0x45')](_0x3d25('0xab'),_0x3db45d[_0x3d25('0xa8')][_0x3d25('0x88')]())[_0x3d25('0x45')](_0x3d25('0xac'))[_0x3d25('0x45')](_0x3d25('0xad'),squel['select']()[_0x3d25('0x82')](_0x3d25('0xae'))['from']('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x3b2278[_0x3d25('0x50')]['id'][_0x3d25('0x88')]()))[_0x3d25('0x45')](_0x3d25('0xad'),squel[_0x3d25('0x81')]()['field'](_0x3d25('0xaf'))[_0x3d25('0xa9')](_0x3d25('0xa1'))[_0x3d25('0x45')](_0x3d25('0x86'),_0x3b2278['params']['id'][_0x3d25('0x88')]())))[_0x3d25('0x88')]();break;case _0x3d25('0xb0'):_0x49f5e5=squel[_0x3d25('0x9f')]()['into'](_0x3d25('0xa1'))[_0x3d25('0xa2')]([_0x3d25('0xa6'),_0x3d25('0xa3'),_0x3d25('0xa4'),_0x3d25('0xa5'),_0x3d25('0x63'),_0x3d25('0x5e'),_0x3d25('0x5f')],squel[_0x3d25('0x81')]()[_0x3d25('0x82')](_0x3d25('0xa6'),_0x3d25('0xa6'))['field']('NOW()',_0x3d25('0xa3'))['field']('id','ContactId')['field'](_0x3db45d[_0x3d25('0xa8')][_0x3d25('0x88')](),_0x3d25('0xa5'))['field'](_0x3b2278['params']['id'][_0x3d25('0x88')](),_0x3d25('0x63'))['field']('NOW()',_0x3d25('0x5e'))[_0x3d25('0x82')](_0x3d25('0xa7'),'updatedAt')[_0x3d25('0xa9')](_0x3d25('0xb1'))[_0x3d25('0x45')](_0x3d25('0xaa'))[_0x3d25('0x45')](_0x3d25('0xab'),_0x3db45d['CmListId'][_0x3d25('0x88')]())[_0x3d25('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x3d25('0x45')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3d25('0x82')](_0x3d25('0xaf'))[_0x3d25('0xa9')](_0x3d25('0xa1'))[_0x3d25('0x45')](_0x3d25('0x86'),_0x3b2278[_0x3d25('0x50')]['id'][_0x3d25('0x88')]())))[_0x3d25('0x88')]();break;default:_0x49f5e5=squel['insert']()[_0x3d25('0xa0')](_0x3d25('0xa1'))['fromQuery']([_0x3d25('0xa6'),_0x3d25('0xa3'),_0x3d25('0xa4'),'ListId',_0x3d25('0x63'),_0x3d25('0x5e'),_0x3d25('0x5f')],squel['select']()['field'](_0x3d25('0xa6'),_0x3d25('0xa6'))['field'](_0x3d25('0xa7'),_0x3d25('0xa3'))[_0x3d25('0x82')]('id','ContactId')[_0x3d25('0x82')](_0x3db45d[_0x3d25('0xa8')][_0x3d25('0x88')](),_0x3d25('0xa5'))[_0x3d25('0x82')](_0x3b2278[_0x3d25('0x50')]['id']['toString'](),_0x3d25('0x63'))[_0x3d25('0x82')](_0x3d25('0xa7'),_0x3d25('0x5e'))[_0x3d25('0x82')]('NOW()',_0x3d25('0x5f'))['from'](_0x3d25('0xb1'))['where']('deletedAt\x20IS\x20NULL')[_0x3d25('0x45')](_0x3d25('0xab'),_0x3db45d[_0x3d25('0xa8')][_0x3d25('0x88')]())[_0x3d25('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x1a4625[_0x3d25('0x95')](db[_0x3d25('0x73')][_0x3d25('0x39')](_0x49f5e5));}return BPromise[_0x3d25('0x8d')](_0x1a4625);}})[_0x3d25('0x25')](function(){return _0x575019;})[_0x3d25('0x25')](respondWithResult(_0xeb1dd7,null))[_0x3d25('0x4e')](handleError(_0xeb1dd7,null));};exports[_0x3d25('0xb2')]=function(_0x4a066e,_0x3b93da,_0x55daa2){return db[_0x3d25('0x4a')]['find']({'where':{'id':_0x4a066e['params']['id']}})['then'](handleEntityNotFound(_0x3b93da,null))[_0x3d25('0x25')](function(_0x2bdfc1){if(_0x2bdfc1){return _0x2bdfc1[_0x3d25('0xb2')](_0x4a066e[_0x3d25('0x39')][_0x3d25('0x80')]);}})[_0x3d25('0x25')](function(_0x3d45d4){if(_0x3d45d4){return db[_0x3d25('0x62')][_0x3d25('0x26')]({'where':{'ListId':_0x4a066e[_0x3d25('0x39')][_0x3d25('0x80')],'VoiceQueueId':_0x4a066e[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](function(){return _0x3d45d4;});}})[_0x3d25('0x25')](respondWithStatusCode(_0x3b93da,null))[_0x3d25('0x4e')](handleError(_0x3b93da,null));};exports[_0x3d25('0xb3')]=function(_0x11e16a,_0x2a7c55,_0x5f1d7b){var _0x2fd636={};var _0x54c532={};var _0xad0d7a;var _0x4d75bc;return db[_0x3d25('0x4a')][_0x3d25('0x61')]({'where':{'id':_0x11e16a['params']['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x2a7c55,null))['then'](function(_0x481161){if(_0x481161){_0xad0d7a=_0x481161;_0x54c532[_0x3d25('0x38')]=_[_0x3d25('0x3a')](db[_0x3d25('0x9a')][_0x3d25('0x35')]);_0x54c532[_0x3d25('0x39')]=_[_0x3d25('0x3a')](_0x11e16a[_0x3d25('0x39')]);_0x54c532[_0x3d25('0x3b')]=_['intersection'](_0x54c532[_0x3d25('0x38')],_0x54c532[_0x3d25('0x39')]);_0x2fd636[_0x3d25('0x3d')]=_[_0x3d25('0x3c')](_0x54c532['model'],qs['fields'](_0x11e16a[_0x3d25('0x39')][_0x3d25('0x3e')]));_0x2fd636[_0x3d25('0x3d')]=_0x2fd636[_0x3d25('0x3d')]['length']?_0x2fd636[_0x3d25('0x3d')]:_0x54c532[_0x3d25('0x38')];_0x2fd636[_0x3d25('0x43')]=qs[_0x3d25('0x44')](_0x11e16a[_0x3d25('0x39')][_0x3d25('0x44')]);_0x2fd636[_0x3d25('0x45')]=qs[_0x3d25('0x3b')](_['pick'](_0x11e16a[_0x3d25('0x39')],_0x54c532[_0x3d25('0x3b')]));if(_0x11e16a[_0x3d25('0x39')][_0x3d25('0x2a')]){_0x2fd636[_0x3d25('0x45')]=_[_0x3d25('0x48')](_0x2fd636[_0x3d25('0x45')],{'$or':_[_0x3d25('0x34')](_0x2fd636[_0x3d25('0x3d')],function(_0xe613f9){var _0x41f91a={};_0x41f91a[_0xe613f9]={'$like':'%'+_0x11e16a[_0x3d25('0x39')][_0x3d25('0x2a')]+'%'};return _0x41f91a;})});}_0x2fd636=_['merge']({},_0x2fd636,_0x11e16a[_0x3d25('0x49')]);return _0xad0d7a[_0x3d25('0xb3')](_0x2fd636);}})['then'](function(_0xcc47a){if(_0xcc47a){_0x4d75bc=_0xcc47a[_0x3d25('0x3f')];if(!_0x11e16a[_0x3d25('0x39')][_0x3d25('0x40')](_0x3d25('0x41'))){_0x2fd636[_0x3d25('0x42')]=qs[_0x3d25('0x42')](_0x11e16a['query'][_0x3d25('0x42')]);_0x2fd636[_0x3d25('0x1f')]=qs['offset'](_0x11e16a[_0x3d25('0x39')][_0x3d25('0x1f')]);}return _0xad0d7a[_0x3d25('0xb3')](_0x2fd636);}})[_0x3d25('0x25')](function(_0x5ae571){if(_0x5ae571){return _0x5ae571?{'count':_0x4d75bc,'rows':_0x5ae571}:null;}})[_0x3d25('0x25')](respondWithResult(_0x2a7c55,null))[_0x3d25('0x4e')](handleError(_0x2a7c55,null));};exports[_0x3d25('0xb4')]=function(_0x3cea90,_0x382c1a,_0x1c0999){var _0x52fa2b,_0xf79fe5;return db['VoiceQueue'][_0x3d25('0x2f')]({'where':{'id':_0x3cea90['params']['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x382c1a,null))[_0x3d25('0x25')](function(_0x4c8b93){if(_0x4c8b93){_0xf79fe5=_0x4c8b93;return _0x4c8b93[_0x3d25('0xb4')](_0x3cea90[_0x3d25('0x52')][_0x3d25('0x80')],_[_0x3d25('0x5d')](_0x3cea90[_0x3d25('0x52')],['ids','id'])||{});}return null;})[_0x3d25('0x92')](function(_0x20f63a){var _0x124e55;_0x52fa2b=_0x20f63a||[];var _0x58c786=[];if(_0x20f63a){for(var _0x3c414e=0x0;_0x3c414e<_0x20f63a[_0x3d25('0x3f')];_0x3c414e+=0x1){var _0x2879c6=_0x20f63a[_0x3c414e]['get']({'plain':!![]});_0x124e55=squel[_0x3d25('0x9f')]()[_0x3d25('0xa0')](_0x3d25('0xb5'))[_0x3d25('0xa2')]([_0x3d25('0xa6'),_0x3d25('0xa4'),_0x3d25('0xa5'),_0x3d25('0x63'),'createdAt',_0x3d25('0x5f')],squel[_0x3d25('0x81')]()[_0x3d25('0x82')](_0x3d25('0xa6'),_0x3d25('0xa6'))['field']('id',_0x3d25('0xa4'))[_0x3d25('0x82')](_0x2879c6[_0x3d25('0xa8')][_0x3d25('0x88')](),_0x3d25('0xa5'))[_0x3d25('0x82')](_0x3cea90[_0x3d25('0x50')]['id'][_0x3d25('0x88')](),_0x3d25('0x63'))['field'](_0x3d25('0xa7'),_0x3d25('0x5e'))[_0x3d25('0x82')](_0x3d25('0xa7'),'updatedAt')[_0x3d25('0xa9')]('cm_contacts')[_0x3d25('0x45')](_0x3d25('0xaa'))[_0x3d25('0x45')](_0x3d25('0xab'),_0x2879c6[_0x3d25('0xa8')][_0x3d25('0x88')]())[_0x3d25('0x45')](_0x3d25('0xac')))['toString']();_0x58c786[_0x3d25('0x95')](db['sequelize']['query'](_0x124e55));}return BPromise[_0x3d25('0x8d')](_0x58c786);}})['then'](function(){return _0x52fa2b;})[_0x3d25('0x25')](respondWithResult(_0x382c1a,null))[_0x3d25('0x4e')](handleError(_0x382c1a,null));};exports[_0x3d25('0xb6')]=function(_0x453933,_0x255f2c,_0x3f009a){return db[_0x3d25('0x4a')][_0x3d25('0x2f')]({'where':{'id':_0x453933[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](handleEntityNotFound(_0x255f2c,null))[_0x3d25('0x25')](function(_0x56d553){if(_0x56d553){return _0x56d553[_0x3d25('0xb6')](_0x453933[_0x3d25('0x39')][_0x3d25('0x80')]);}})[_0x3d25('0x25')](function(_0xdf7b1b){if(_0xdf7b1b){return db[_0x3d25('0x6b')][_0x3d25('0x26')]({'where':{'ListId':_0x453933[_0x3d25('0x39')][_0x3d25('0x80')],'VoiceQueueId':_0x453933[_0x3d25('0x50')]['id']}})[_0x3d25('0x25')](function(){return _0xdf7b1b;});}})[_0x3d25('0x25')](respondWithStatusCode(_0x255f2c,null))[_0x3d25('0x4e')](handleError(_0x255f2c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 96a63d9..4503fbc 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 _0xf738=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf738,0x18f));var _0x8f73=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xf738[_0x1fc122];return _0xa2cb13;};'use strict';var EventEmitter=require(_0x8f73('0x0'));var VoiceQueue=require(_0x8f73('0x1'))['db'][_0x8f73('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8f73('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f73('0x4'),'afterDestroy':_0x8f73('0x5')};function emitEvent(_0x4dbe30){return function(_0xb87284,_0x2b9e93,_0x24d677){VoiceQueueEvents['emit'](_0x4dbe30+':'+_0xb87284['id'],_0xb87284);VoiceQueueEvents[_0x8f73('0x6')](_0x4dbe30,_0xb87284);_0x24d677(null);};}for(var e in events){if(events[_0x8f73('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x8f73('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xb32d=['save','update','remove','emit','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x1d3f82,_0x287166){var _0x9c7069=function(_0x42bf5e){while(--_0x42bf5e){_0x1d3f82['push'](_0x1d3f82['shift']());}};_0x9c7069(++_0x287166);}(_0xb32d,0x83));var _0xdb32=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xb32d[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xdb32('0x0'));var VoiceQueue=require(_0xdb32('0x1'))['db'][_0xdb32('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdb32('0x3')](0x0);var events={'afterCreate':_0xdb32('0x4'),'afterUpdate':_0xdb32('0x5'),'afterDestroy':_0xdb32('0x6')};function emitEvent(_0x51f6bf){return function(_0x529c36,_0x5dfad2,_0x3a253c){VoiceQueueEvents[_0xdb32('0x7')](_0x51f6bf+':'+_0x529c36['id'],_0x529c36);VoiceQueueEvents['emit'](_0x51f6bf,_0x529c36);_0x3a253c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xdb32('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index f427b6d..3a5e124 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 _0x5a54=['exports','define','VoiceQueue','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x3ae147,_0x4ca19b){var _0x235663=function(_0x1a9a99){while(--_0x1a9a99){_0x3ae147['push'](_0x3ae147['shift']());}};_0x235663(++_0x4ca19b);}(_0x5a54,0x139));var _0x45a5=function(_0x8803d1,_0x25009c){_0x8803d1=_0x8803d1-0x0;var _0x26c261=_0x5a54[_0x8803d1];return _0x26c261;};'use strict';var _=require(_0x45a5('0x0'));var util=require(_0x45a5('0x1'));var logger=require(_0x45a5('0x2'))('api');var moment=require(_0x45a5('0x3'));var BPromise=require(_0x45a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x45a5('0x5'));var rimraf=require('rimraf');var config=require(_0x45a5('0x6'));var attributes=require('./voiceQueue.attributes');module[_0x45a5('0x7')]=function(_0x508712,_0x147c43){return _0x508712[_0x45a5('0x8')](_0x45a5('0x9'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55af=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','define','voice_queues','lodash','util','../../config/logger'];(function(_0x574159,_0x952110){var _0x5dd226=function(_0x5a32f2){while(--_0x5a32f2){_0x574159['push'](_0x574159['shift']());}};_0x5dd226(++_0x952110);}(_0x55af,0x1c5));var _0xf55a=function(_0xcc62d8,_0x5d73c5){_0xcc62d8=_0xcc62d8-0x0;var _0xa6eec1=_0x55af[_0xcc62d8];return _0xa6eec1;};'use strict';var _=require(_0xf55a('0x0'));var util=require(_0xf55a('0x1'));var logger=require(_0xf55a('0x2'))(_0xf55a('0x3'));var moment=require(_0xf55a('0x4'));var BPromise=require(_0xf55a('0x5'));var rp=require(_0xf55a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf55a('0x7'));var config=require(_0xf55a('0x8'));var attributes=require(_0xf55a('0x9'));module['exports']=function(_0x2bba80,_0x3da55c){return _0x2bba80[_0xf55a('0xa')]('VoiceQueue',attributes,{'tableName':_0xf55a('0xb'),'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 7479935..c0bde52 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 _0xd595=['options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd595,0xdc));var _0x5d59=function(_0x117903,_0x5604d7){_0x117903=_0x117903-0x0;var _0x4b392d=_0xd595[_0x117903];return _0x4b392d;};'use strict';var _=require(_0x5d59('0x0'));var util=require(_0x5d59('0x1'));var moment=require(_0x5d59('0x2'));var BPromise=require(_0x5d59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d59('0x4'));var db=require(_0x5d59('0x5'))['db'];var utils=require(_0x5d59('0x6'));var logger=require(_0x5d59('0x7'))('rpc');var config=require(_0x5d59('0x8'));var jayson=require(_0x5d59('0x9'));var client=jayson['client'][_0x5d59('0xa')]({'port':0x232a});config[_0x5d59('0xb')]=_[_0x5d59('0xc')](config[_0x5d59('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d59('0xd'))(new Redis(config[_0x5d59('0xb')]));require(_0x5d59('0xe'))[_0x5d59('0xf')](socket);function respondWithRpcPromise(_0x5ddbff,_0x1bc979,_0x5f22da){return new BPromise(function(_0x545ab1,_0x226ad8){return client[_0x5d59('0x10')](_0x5ddbff,_0x5f22da)[_0x5d59('0x11')](function(_0xcfa6c){logger[_0x5d59('0x12')](_0x5d59('0x13'),_0x1bc979,_0x5d59('0x14'));logger[_0x5d59('0x15')](_0x5d59('0x16'),_0x1bc979,_0x5d59('0x14'),JSON[_0x5d59('0x17')](_0xcfa6c));if(_0xcfa6c[_0x5d59('0x18')]){if(_0xcfa6c[_0x5d59('0x18')][_0x5d59('0x19')]===0x1f4){logger[_0x5d59('0x18')](_0x5d59('0x13'),_0x1bc979,_0xcfa6c['error'][_0x5d59('0x1a')]);return _0x226ad8(_0xcfa6c[_0x5d59('0x18')][_0x5d59('0x1a')]);}logger[_0x5d59('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x1bc979,_0xcfa6c[_0x5d59('0x18')]['message']);return _0x545ab1(_0xcfa6c[_0x5d59('0x18')]['message']);}else{logger[_0x5d59('0x12')](_0x5d59('0x13'),_0x1bc979,'request\x20sent');_0x545ab1(_0xcfa6c[_0x5d59('0x1b')][_0x5d59('0x1a')]);}})[_0x5d59('0x1c')](function(_0x7c80a6){logger[_0x5d59('0x18')](_0x5d59('0x13'),_0x1bc979,_0x7c80a6);_0x226ad8(_0x7c80a6);});});}exports[_0x5d59('0x1d')]=function(_0x53bf84){var _0x22bf9c=this;return new Promise(function(_0x30a4ff,_0x988fd9){return db[_0x5d59('0x1e')][_0x5d59('0x1f')]({'raw':_0x53bf84[_0x5d59('0x20')]?_0x53bf84['options'][_0x5d59('0x21')]===undefined?!![]:![]:!![],'where':_0x53bf84[_0x5d59('0x20')]?_0x53bf84[_0x5d59('0x20')][_0x5d59('0x22')]||null:null,'attributes':_0x53bf84[_0x5d59('0x20')]?_0x53bf84[_0x5d59('0x20')][_0x5d59('0x23')]||null:null,'limit':_0x53bf84['options']?_0x53bf84['options'][_0x5d59('0x24')]||null:null,'include':_0x53bf84[_0x5d59('0x20')]?_0x53bf84[_0x5d59('0x20')][_0x5d59('0x25')]?_[_0x5d59('0x26')](_0x53bf84['options'][_0x5d59('0x25')],function(_0x19130b){return{'model':db[_0x19130b[_0x5d59('0x27')]],'as':_0x19130b['as'],'attributes':_0x19130b[_0x5d59('0x23')],'include':_0x19130b[_0x5d59('0x25')]?_[_0x5d59('0x26')](_0x19130b[_0x5d59('0x25')],function(_0xaaac6e){return{'model':db[_0xaaac6e[_0x5d59('0x27')]],'as':_0xaaac6e['as'],'attributes':_0xaaac6e[_0x5d59('0x23')],'include':_0xaaac6e[_0x5d59('0x25')]?_[_0x5d59('0x26')](_0xaaac6e['include'],function(_0x63897d){return{'model':db[_0x63897d['model']],'as':_0x63897d['as'],'attributes':_0x63897d[_0x5d59('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x300830){logger['info'](_0x5d59('0x1d'),_0x53bf84);logger[_0x5d59('0x15')](_0x5d59('0x1d'),_0x53bf84,JSON['stringify'](_0x300830));_0x30a4ff(_0x300830);})['catch'](function(_0x350703){logger['error']('GetVoiceQueue',_0x350703[_0x5d59('0x1a')],_0x53bf84);_0x988fd9(_0x22bf9c[_0x5d59('0x18')](0x1f4,_0x350703[_0x5d59('0x1a')]));});});};exports[_0x5d59('0x28')]=function(_0x62fb90){var _0x1c0def=this;return new Promise(function(_0x2801c4,_0x3f369e){return db[_0x5d59('0x1e')][_0x5d59('0x29')]({'raw':_0x62fb90['options']?_0x62fb90[_0x5d59('0x20')][_0x5d59('0x21')]===undefined?!![]:![]:!![],'where':_0x62fb90[_0x5d59('0x20')]?_0x62fb90[_0x5d59('0x20')]['where']||null:null,'attributes':_0x62fb90['options']?_0x62fb90[_0x5d59('0x20')][_0x5d59('0x23')]||null:null,'include':_0x62fb90[_0x5d59('0x20')]?_0x62fb90[_0x5d59('0x20')]['include']?_['map'](_0x62fb90[_0x5d59('0x20')][_0x5d59('0x25')],function(_0x66fb2f){return{'model':db[_0x66fb2f[_0x5d59('0x27')]],'as':_0x66fb2f['as'],'attributes':_0x66fb2f[_0x5d59('0x23')],'include':_0x66fb2f[_0x5d59('0x25')]?_[_0x5d59('0x26')](_0x66fb2f['include'],function(_0x32b8d7){return{'model':db[_0x32b8d7[_0x5d59('0x27')]],'as':_0x32b8d7['as'],'attributes':_0x32b8d7['attributes'],'include':_0x32b8d7[_0x5d59('0x25')]?_[_0x5d59('0x26')](_0x32b8d7[_0x5d59('0x25')],function(_0x175788){return{'model':db[_0x175788['model']],'as':_0x175788['as'],'attributes':_0x175788[_0x5d59('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5d59('0x11')](function(_0x495b5f){logger[_0x5d59('0x12')](_0x5d59('0x28'),_0x62fb90);logger['debug'](_0x5d59('0x28'),_0x62fb90,JSON[_0x5d59('0x17')](_0x495b5f));_0x2801c4(_0x495b5f);})[_0x5d59('0x1c')](function(_0x17da81){logger[_0x5d59('0x18')](_0x5d59('0x28'),_0x17da81[_0x5d59('0x1a')],_0x62fb90);_0x3f369e(_0x1c0def[_0x5d59('0x18')](0x1f4,_0x17da81[_0x5d59('0x1a')]));});});}; \ No newline at end of file +var _0x2414=['request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x218d98,_0x3820ca){var _0x10be5f=function(_0x279d91){while(--_0x279d91){_0x218d98['push'](_0x218d98['shift']());}};_0x10be5f(++_0x3820ca);}(_0x2414,0x118));var _0x4241=function(_0x1ee4d0,_0x3abf3c){_0x1ee4d0=_0x1ee4d0-0x0;var _0x442b77=_0x2414[_0x1ee4d0];return _0x442b77;};'use strict';var _=require(_0x4241('0x0'));var util=require(_0x4241('0x1'));var moment=require(_0x4241('0x2'));var BPromise=require(_0x4241('0x3'));var rs=require(_0x4241('0x4'));var fs=require('fs');var Redis=require(_0x4241('0x5'));var db=require(_0x4241('0x6'))['db'];var utils=require(_0x4241('0x7'));var logger=require(_0x4241('0x8'))(_0x4241('0x9'));var config=require(_0x4241('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4241('0xb')]({'port':0x232a});config[_0x4241('0xc')]=_[_0x4241('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4241('0xe'))(new Redis(config[_0x4241('0xc')]));require(_0x4241('0xf'))[_0x4241('0x10')](socket);function respondWithRpcPromise(_0x449694,_0x401d42,_0x16a49a){return new BPromise(function(_0x4a2f06,_0x2fd9b1){return client[_0x4241('0x11')](_0x449694,_0x16a49a)[_0x4241('0x12')](function(_0x329102){logger[_0x4241('0x13')](_0x4241('0x14'),_0x401d42,_0x4241('0x15'));logger[_0x4241('0x16')](_0x4241('0x17'),_0x401d42,_0x4241('0x15'),JSON[_0x4241('0x18')](_0x329102));if(_0x329102['error']){if(_0x329102[_0x4241('0x19')][_0x4241('0x1a')]===0x1f4){logger[_0x4241('0x19')](_0x4241('0x14'),_0x401d42,_0x329102[_0x4241('0x19')]['message']);return _0x2fd9b1(_0x329102[_0x4241('0x19')][_0x4241('0x1b')]);}logger[_0x4241('0x19')](_0x4241('0x14'),_0x401d42,_0x329102[_0x4241('0x19')][_0x4241('0x1b')]);return _0x4a2f06(_0x329102['error'][_0x4241('0x1b')]);}else{logger['info'](_0x4241('0x14'),_0x401d42,'request\x20sent');_0x4a2f06(_0x329102[_0x4241('0x1c')][_0x4241('0x1b')]);}})[_0x4241('0x1d')](function(_0x236c8f){logger[_0x4241('0x19')](_0x4241('0x14'),_0x401d42,_0x236c8f);_0x2fd9b1(_0x236c8f);});});}exports[_0x4241('0x1e')]=function(_0x4b223b){var _0x16d7a8=this;return new Promise(function(_0x46e435,_0xe09abb){return db[_0x4241('0x1f')][_0x4241('0x20')]({'raw':_0x4b223b[_0x4241('0x21')]?_0x4b223b[_0x4241('0x21')][_0x4241('0x22')]===undefined?!![]:![]:!![],'where':_0x4b223b['options']?_0x4b223b[_0x4241('0x21')][_0x4241('0x23')]||null:null,'attributes':_0x4b223b[_0x4241('0x21')]?_0x4b223b[_0x4241('0x21')]['attributes']||null:null,'limit':_0x4b223b[_0x4241('0x21')]?_0x4b223b[_0x4241('0x21')][_0x4241('0x24')]||null:null,'include':_0x4b223b['options']?_0x4b223b[_0x4241('0x21')][_0x4241('0x25')]?_[_0x4241('0x26')](_0x4b223b[_0x4241('0x21')]['include'],function(_0x325c1e){return{'model':db[_0x325c1e[_0x4241('0x27')]],'as':_0x325c1e['as'],'attributes':_0x325c1e[_0x4241('0x28')],'include':_0x325c1e[_0x4241('0x25')]?_['map'](_0x325c1e[_0x4241('0x25')],function(_0x277cc1){return{'model':db[_0x277cc1['model']],'as':_0x277cc1['as'],'attributes':_0x277cc1['attributes'],'include':_0x277cc1[_0x4241('0x25')]?_[_0x4241('0x26')](_0x277cc1['include'],function(_0x1e88a5){return{'model':db[_0x1e88a5[_0x4241('0x27')]],'as':_0x1e88a5['as'],'attributes':_0x1e88a5[_0x4241('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1439bc){logger['info'](_0x4241('0x1e'),_0x4b223b);logger[_0x4241('0x16')](_0x4241('0x1e'),_0x4b223b,JSON[_0x4241('0x18')](_0x1439bc));_0x46e435(_0x1439bc);})[_0x4241('0x1d')](function(_0x4a4e0c){logger[_0x4241('0x19')](_0x4241('0x1e'),_0x4a4e0c[_0x4241('0x1b')],_0x4b223b);_0xe09abb(_0x16d7a8[_0x4241('0x19')](0x1f4,_0x4a4e0c[_0x4241('0x1b')]));});});};exports['ShowVoiceQueue']=function(_0x59a30a){var _0x523c46=this;return new Promise(function(_0x504059,_0x2d39df){return db['VoiceQueue'][_0x4241('0x29')]({'raw':_0x59a30a[_0x4241('0x21')]?_0x59a30a['options'][_0x4241('0x22')]===undefined?!![]:![]:!![],'where':_0x59a30a[_0x4241('0x21')]?_0x59a30a[_0x4241('0x21')][_0x4241('0x23')]||null:null,'attributes':_0x59a30a['options']?_0x59a30a[_0x4241('0x21')][_0x4241('0x28')]||null:null,'include':_0x59a30a[_0x4241('0x21')]?_0x59a30a[_0x4241('0x21')][_0x4241('0x25')]?_[_0x4241('0x26')](_0x59a30a[_0x4241('0x21')][_0x4241('0x25')],function(_0x530d2f){return{'model':db[_0x530d2f[_0x4241('0x27')]],'as':_0x530d2f['as'],'attributes':_0x530d2f[_0x4241('0x28')],'include':_0x530d2f[_0x4241('0x25')]?_['map'](_0x530d2f['include'],function(_0x3b0129){return{'model':db[_0x3b0129[_0x4241('0x27')]],'as':_0x3b0129['as'],'attributes':_0x3b0129[_0x4241('0x28')],'include':_0x3b0129[_0x4241('0x25')]?_[_0x4241('0x26')](_0x3b0129[_0x4241('0x25')],function(_0x45d57a){return{'model':db[_0x45d57a['model']],'as':_0x45d57a['as'],'attributes':_0x45d57a[_0x4241('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14e897){logger['info'](_0x4241('0x2a'),_0x59a30a);logger[_0x4241('0x16')](_0x4241('0x2a'),_0x59a30a,JSON[_0x4241('0x18')](_0x14e897));_0x504059(_0x14e897);})['catch'](function(_0x15ae84){logger[_0x4241('0x19')](_0x4241('0x2a'),_0x15ae84[_0x4241('0x1b')],_0x59a30a);_0x2d39df(_0x523c46[_0x4241('0x19')](0x1f4,_0x15ae84['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index b7752ef..81f6d33 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 _0xb1ef=['update','emit','removeListener','register','voiceQueue:','save'];(function(_0x26f44c,_0x2530c9){var _0x43a819=function(_0x368382){while(--_0x368382){_0x26f44c['push'](_0x26f44c['shift']());}};_0x43a819(++_0x2530c9);}(_0xb1ef,0x107));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xfb1e('0x0'),'remove',_0xfb1e('0x1')];function createListener(_0x445e62,_0x4a6177){return function(_0x5cd507){_0x4a6177[_0xfb1e('0x2')](_0x445e62,_0x5cd507);};}function removeListener(_0x27dd0c,_0x230c7f){return function(){VoiceQueueEvents[_0xfb1e('0x3')](_0x27dd0c,_0x230c7f);};}exports[_0xfb1e('0x4')]=function(_0x37c9e1){for(var _0x24515b=0x0,_0x53a139=events['length'];_0x24515b<_0x53a139;_0x24515b++){var _0x2a7cb9=events[_0x24515b];var _0x4559e6=createListener(_0xfb1e('0x5')+_0x2a7cb9,_0x37c9e1);VoiceQueueEvents['on'](_0x2a7cb9,_0x4559e6);}}; \ No newline at end of file +var _0xf2b9=['register','length','./voiceQueue.events','save','remove','emit','removeListener'];(function(_0x55150b,_0x268df4){var _0xf77a65=function(_0x3c4137){while(--_0x3c4137){_0x55150b['push'](_0x55150b['shift']());}};_0xf77a65(++_0x268df4);}(_0xf2b9,0x183));var _0x9f2b=function(_0x21a8dd,_0x495df3){_0x21a8dd=_0x21a8dd-0x0;var _0xe9bd59=_0xf2b9[_0x21a8dd];return _0xe9bd59;};'use strict';var VoiceQueueEvents=require(_0x9f2b('0x0'));var events=[_0x9f2b('0x1'),_0x9f2b('0x2'),'update'];function createListener(_0x1b1e2c,_0x22ef33){return function(_0xf26791){_0x22ef33[_0x9f2b('0x3')](_0x1b1e2c,_0xf26791);};}function removeListener(_0x179d3d,_0x52c530){return function(){VoiceQueueEvents[_0x9f2b('0x4')](_0x179d3d,_0x52c530);};}exports[_0x9f2b('0x5')]=function(_0x1ff650){for(var _0x328523=0x0,_0x1a8414=events[_0x9f2b('0x6')];_0x328523<_0x1a8414;_0x328523++){var _0x1b2af2=events[_0x328523];var _0x49d533=createListener('voiceQueue:'+_0x1b2af2,_0x1ff650);VoiceQueueEvents['on'](_0x1b2af2,_0x49d533);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ed8479a..bcf0958 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 _0x7ee1=['getVoiceQueuesReport','show','create','put','/:id','update','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index'];(function(_0x1b68ff,_0x5e68a2){var _0x4b3b07=function(_0x465dd9){while(--_0x465dd9){_0x1b68ff['push'](_0x1b68ff['shift']());}};_0x4b3b07(++_0x5e68a2);}(_0x7ee1,0x8d));var _0x17ee=function(_0x6804bf,_0x486f22){_0x6804bf=_0x6804bf-0x0;var _0x2b6f42=_0x7ee1[_0x6804bf];return _0x2b6f42;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var auth=require(_0x17ee('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x17ee('0x4'));var controller=require(_0x17ee('0x5'));router[_0x17ee('0x6')]('/',auth[_0x17ee('0x7')](),controller['index']);router[_0x17ee('0x6')](_0x17ee('0x8'),auth['isAuthenticated'](),controller[_0x17ee('0x9')]);router['get'](_0x17ee('0xa'),auth[_0x17ee('0x7')](),controller[_0x17ee('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x17ee('0xc')]);router['post']('/',auth[_0x17ee('0x7')](),controller[_0x17ee('0xd')]);router[_0x17ee('0xe')](_0x17ee('0xf'),auth['isAuthenticated'](),controller[_0x17ee('0x10')]);router['delete'](_0x17ee('0xf'),auth[_0x17ee('0x7')](),controller[_0x17ee('0x11')]);module[_0x17ee('0x12')]=router; \ No newline at end of file +var _0x7409=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','/index','show','put','/:id','multer','util'];(function(_0x5a495e,_0x480465){var _0x310e05=function(_0x5ec965){while(--_0x5ec965){_0x5a495e['push'](_0x5a495e['shift']());}};_0x310e05(++_0x480465);}(_0x7409,0x6e));var _0x9740=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x7409[_0x5c6022];return _0x4ab5af;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require('path');var timeout=require(_0x9740('0x2'));var express=require(_0x9740('0x3'));var router=express[_0x9740('0x4')]();var auth=require(_0x9740('0x5'));var interaction=require(_0x9740('0x6'));var config=require(_0x9740('0x7'));var controller=require(_0x9740('0x8'));router[_0x9740('0x9')]('/',auth[_0x9740('0xa')](),controller['index']);router[_0x9740('0x9')](_0x9740('0xb'),auth[_0x9740('0xa')](),controller['describe']);router[_0x9740('0x9')](_0x9740('0xc'),auth[_0x9740('0xa')](),controller['getVoiceQueuesReport']);router[_0x9740('0x9')]('/:id',auth[_0x9740('0xa')](),controller[_0x9740('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9740('0xe')](_0x9740('0xf'),auth[_0x9740('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b69af6e..a0c8791 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 _0x0ba0=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN'];(function(_0x55833d,_0x1b440f){var _0x38e933=function(_0x3db6c1){while(--_0x3db6c1){_0x55833d['push'](_0x55833d['shift']());}};_0x38e933(++_0x1b440f);}(_0x0ba0,0x136));var _0x00ba=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x0ba0[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x00ba('0x0'));module[_0x00ba('0x1')]={'type':{'type':Sequelize[_0x00ba('0x2')]},'uniqueid':{'type':Sequelize[_0x00ba('0x2')]},'calleridnum':{'type':Sequelize[_0x00ba('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x00ba('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x00ba('0x3')],'set':function(_0x373bd0){var _0x3161b8=moment(_0x373bd0);var _0x509fe4=moment(this['getDataValue'](_0x00ba('0x4')))['format'](_0x00ba('0x5'));var _0x1b30f6=_0x3161b8[_0x00ba('0x6')](_0x509fe4,_0x00ba('0x7'));this[_0x00ba('0x8')](_0x00ba('0x9'),_0x373bd0);this[_0x00ba('0x8')]('holdtime',_0x1b30f6||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x00ba('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x00ba('0x3')]},'queuecallerexit':{'type':Sequelize[_0x00ba('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x00ba('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x00ba('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x00ba('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x00ba('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x00ba('0x2')]},'priority':{'type':Sequelize[_0x00ba('0x2')]},'holdtime':{'type':Sequelize[_0x00ba('0xa')]},'mohtime':{'type':Sequelize[_0x00ba('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x00ba('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x00ba('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x00ba('0x2')],'comment':_0x00ba('0xd')},'transferexten':{'type':Sequelize[_0x00ba('0x2')]},'transferuniqueid':{'type':Sequelize[_0x00ba('0x2')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd9f6=['seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x5263d2,_0x476862){var _0x2363a0=function(_0x22380d){while(--_0x22380d){_0x5263d2['push'](_0x5263d2['shift']());}};_0x2363a0(++_0x476862);}(_0xd9f6,0x12d));var _0x6d9f=function(_0xa76be9,_0x1929f8){_0xa76be9=_0xa76be9-0x0;var _0x2faaaf=_0xd9f6[_0xa76be9];return _0x2faaaf;};'use strict';var Sequelize=require(_0x6d9f('0x0'));var moment=require('moment');module[_0x6d9f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6d9f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6d9f('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x6d9f('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5c8ce8){var _0x25bee5=moment(_0x5c8ce8);var _0x25e552=moment(this[_0x6d9f('0x4')]('queuecallerjoinAt'))['format'](_0x6d9f('0x5'));var _0x7bb172=_0x25bee5[_0x6d9f('0x6')](_0x25e552,_0x6d9f('0x7'));this[_0x6d9f('0x8')](_0x6d9f('0x9'),_0x5c8ce8);this[_0x6d9f('0x8')]('holdtime',_0x7bb172||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x6d9f('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x6d9f('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6d9f('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x6d9f('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6d9f('0x3')]},'queuecallerexit':{'type':Sequelize[_0x6d9f('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6d9f('0x2')],'comment':_0x6d9f('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x6d9f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6d9f('0x2')]},'connectedlinename':{'type':Sequelize[_0x6d9f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6d9f('0x2')]},'priority':{'type':Sequelize[_0x6d9f('0x2')]},'holdtime':{'type':Sequelize[_0x6d9f('0xa')]},'mohtime':{'type':Sequelize[_0x6d9f('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6d9f('0x2')]},'transfer':{'type':Sequelize[_0x6d9f('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6d9f('0x2')],'comment':_0x6d9f('0xd')},'transferexten':{'type':Sequelize[_0x6d9f('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6d9f('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x6d9f('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 9cd762f..56c119a 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 _0x4975=['sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','index','rawAttributes','fieldName','map','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x55c307,_0x22b2ce){var _0xcca0a9=function(_0x1a2fa9){while(--_0x1a2fa9){_0x55c307['push'](_0x55c307['shift']());}};_0xcca0a9(++_0x22b2ce);}(_0x4975,0x86));var _0x5497=function(_0x8e7e11,_0x1d395b){_0x8e7e11=_0x8e7e11-0x0;var _0x2e917d=_0x4975[_0x8e7e11];return _0x2e917d;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5497('0x18')]=_[_0x5497('0x19')](config[_0x5497('0x18')],{'host':_0x5497('0x1a'),'port':0x18eb});var socket=require(_0x5497('0x1b'))(new Redis(config[_0x5497('0x18')]));require(_0x5497('0x1c'))[_0x5497('0x1d')](socket);function respondWithStatusCode(_0x363a5b,_0x1a4c74){_0x1a4c74=_0x1a4c74||0xcc;return function(_0x55f590){if(_0x55f590){return _0x363a5b[_0x5497('0x1e')](_0x1a4c74);}return _0x363a5b['status'](_0x1a4c74)[_0x5497('0x1f')]();};}function respondWithResult(_0x2bfd8a,_0x19e5f3){_0x19e5f3=_0x19e5f3||0xc8;return function(_0x3ce50b){if(_0x3ce50b){return _0x2bfd8a[_0x5497('0x20')](_0x19e5f3)[_0x5497('0x21')](_0x3ce50b);}};}function respondWithFilteredResult(_0x2f2997,_0x575f6b){return function(_0x56a788){if(_0x56a788){var _0x3f4d20=_0x56a788[_0x5497('0x22')],_0x1bf442=_0x575f6b[_0x5497('0x23')],_0x3a47fd=_0x575f6b[_0x5497('0x23')]+_0x575f6b[_0x5497('0x24')],_0x5d9e24;if(_0x3a47fd>=_0x3f4d20){_0x3a47fd=_0x3f4d20;_0x5d9e24=0xc8;}else{_0x5d9e24=0xce;}_0x2f2997[_0x5497('0x20')](_0x5d9e24);return _0x2f2997[_0x5497('0x25')](_0x5497('0x26'),_0x1bf442+'-'+_0x3a47fd+'/'+_0x3f4d20)[_0x5497('0x21')](_0x56a788);}return null;};}function patchUpdates(_0x2e3960){return function(_0x3f54ef){try{jsonpatch[_0x5497('0x27')](_0x3f54ef,_0x2e3960,!![]);}catch(_0x52c049){return BPromise[_0x5497('0x28')](_0x52c049);}return _0x3f54ef['save']();};}function saveUpdates(_0x19200a,_0xd0868d){return function(_0x44265c){if(_0x44265c){return _0x44265c[_0x5497('0x29')](_0x19200a)[_0x5497('0x2a')](function(_0x3b2fbc){return _0x3b2fbc;});}return null;};}function removeEntity(_0x5018fa,_0x54043a){return function(_0x1eefce){if(_0x1eefce){return _0x1eefce[_0x5497('0x2b')]()[_0x5497('0x2a')](function(){_0x5018fa[_0x5497('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b7a4,_0x57268c){return function(_0x1f3198){if(!_0x1f3198){_0x13b7a4[_0x5497('0x1e')](0x194);}return _0x1f3198;};}function handleError(_0x429d36,_0x34a1a5){_0x34a1a5=_0x34a1a5||0x1f4;return function(_0x163a30){logger[_0x5497('0x2c')](_0x163a30['stack']);if(_0x163a30[_0x5497('0x2d')]){delete _0x163a30['name'];}_0x429d36['status'](_0x34a1a5)['send'](_0x163a30);};}exports[_0x5497('0x2e')]=function(_0x48d146,_0x5e9356){var _0xc3465={},_0xb14593={},_0x1cf908={'count':0x0,'rows':[]};var _0x4c442a=_['map'](db['VoiceQueueReport'][_0x5497('0x2f')],function(_0x471e0b){return{'name':_0x471e0b[_0x5497('0x30')],'type':_0x471e0b['type']['key']};});_0xb14593['model']=_[_0x5497('0x31')](_0x4c442a,'name');_0xb14593[_0x5497('0x32')]=_[_0x5497('0x33')](_0x48d146[_0x5497('0x32')]);_0xb14593['filters']=_[_0x5497('0x34')](_0xb14593[_0x5497('0x35')],_0xb14593['query']);_0xc3465[_0x5497('0x36')]=_[_0x5497('0x34')](_0xb14593[_0x5497('0x35')],qs['fields'](_0x48d146[_0x5497('0x32')][_0x5497('0x37')]));_0xc3465[_0x5497('0x36')]=_0xc3465[_0x5497('0x36')][_0x5497('0x38')]?_0xc3465['attributes']:_0xb14593[_0x5497('0x35')];if(!_0x48d146[_0x5497('0x32')]['hasOwnProperty'](_0x5497('0x39'))){_0xc3465[_0x5497('0x24')]=qs[_0x5497('0x24')](_0x48d146[_0x5497('0x32')][_0x5497('0x24')]);_0xc3465[_0x5497('0x23')]=qs['offset'](_0x48d146[_0x5497('0x32')]['offset']);}_0xc3465[_0x5497('0x3a')]=qs[_0x5497('0x3b')](_0x48d146[_0x5497('0x32')]['sort']);_0xc3465['where']=qs[_0x5497('0x3c')](_[_0x5497('0x3d')](_0x48d146[_0x5497('0x32')],_0xb14593[_0x5497('0x3c')]));if(_0x48d146[_0x5497('0x32')][_0x5497('0x3e')]){_0xc3465['where']=_[_0x5497('0x3f')](_0xc3465[_0x5497('0x40')],{'$or':_[_0x5497('0x31')](_0x4c442a,function(_0x2bd07a){if(_0x2bd07a[_0x5497('0x41')]!==_0x5497('0x42')){var _0x1e3b6a={};_0x1e3b6a[_0x2bd07a[_0x5497('0x2d')]]={'$like':'%'+_0x48d146[_0x5497('0x32')]['filter']+'%'};return _0x1e3b6a;}})});}_0xc3465=_[_0x5497('0x3f')]({},_0xc3465,_0x48d146[_0x5497('0x43')]);var _0x1e9616={'where':_0xc3465[_0x5497('0x40')]};return db[_0x5497('0x44')][_0x5497('0x22')](_0x1e9616)[_0x5497('0x2a')](function(_0x59ed13){_0x1cf908[_0x5497('0x22')]=_0x59ed13;if(_0x48d146[_0x5497('0x32')][_0x5497('0x45')]){_0xc3465[_0x5497('0x46')]=[{'all':!![]}];}return db[_0x5497('0x44')][_0x5497('0x47')](_0xc3465);})[_0x5497('0x2a')](function(_0x547437){_0x1cf908[_0x5497('0x48')]=_0x547437;return _0x1cf908;})[_0x5497('0x2a')](respondWithFilteredResult(_0x5e9356,_0xc3465))[_0x5497('0x49')](handleError(_0x5e9356,null));};exports[_0x5497('0x4a')]=function(_0x20e947,_0xd90608){var _0xc1a999={'raw':![],'where':{'id':_0x20e947[_0x5497('0x4b')]['id']}},_0x3eda22={};_0x3eda22[_0x5497('0x35')]=_['keys'](db[_0x5497('0x44')]['rawAttributes']);_0x3eda22[_0x5497('0x32')]=_[_0x5497('0x33')](_0x20e947[_0x5497('0x32')]);_0x3eda22[_0x5497('0x3c')]=_[_0x5497('0x34')](_0x3eda22['model'],_0x3eda22[_0x5497('0x32')]);_0xc1a999[_0x5497('0x36')]=_['intersection'](_0x3eda22[_0x5497('0x35')],qs['fields'](_0x20e947[_0x5497('0x32')]['fields']));_0xc1a999[_0x5497('0x36')]=_0xc1a999[_0x5497('0x36')][_0x5497('0x38')]?_0xc1a999[_0x5497('0x36')]:_0x3eda22[_0x5497('0x35')];if(_0x20e947['query']['includeAll']){_0xc1a999['include']=[{'all':!![]}];}_0xc1a999=_['merge']({},_0xc1a999,_0x20e947[_0x5497('0x43')]);return db[_0x5497('0x44')][_0x5497('0x4c')](_0xc1a999)[_0x5497('0x2a')](handleEntityNotFound(_0xd90608,null))[_0x5497('0x2a')](respondWithResult(_0xd90608,null))[_0x5497('0x49')](handleError(_0xd90608,null));};exports[_0x5497('0x4d')]=function(_0x466287,_0x2626bf){return db['VoiceQueueReport'][_0x5497('0x4d')](_0x466287[_0x5497('0x4e')],{})[_0x5497('0x2a')](respondWithResult(_0x2626bf,0xc9))['catch'](handleError(_0x2626bf,null));};exports[_0x5497('0x29')]=function(_0x530475,_0x12ffbc){if(_0x530475[_0x5497('0x4e')]['id']){delete _0x530475[_0x5497('0x4e')]['id'];}return db['VoiceQueueReport'][_0x5497('0x4c')]({'where':{'id':_0x530475[_0x5497('0x4b')]['id']}})['then'](handleEntityNotFound(_0x12ffbc,null))[_0x5497('0x2a')](saveUpdates(_0x530475['body'],null))[_0x5497('0x2a')](respondWithResult(_0x12ffbc,null))['catch'](handleError(_0x12ffbc,null));};exports[_0x5497('0x2b')]=function(_0x400860,_0x26fd9f){return db[_0x5497('0x44')][_0x5497('0x4c')]({'where':{'id':_0x400860[_0x5497('0x4b')]['id']}})[_0x5497('0x2a')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x2a')](removeEntity(_0x26fd9f,null))['catch'](handleError(_0x26fd9f,null));};exports[_0x5497('0x4f')]=function(_0x5b2c22,_0x4c516b){return db[_0x5497('0x44')][_0x5497('0x4f')]()['then'](respondWithResult(_0x4c516b,null))[_0x5497('0x49')](handleError(_0x4c516b,null));};exports[_0x5497('0x50')]=function(_0x436a83,_0x3094c7){var _0x4ccf0e={},_0x1b9f3d={},_0x538d18={'count':0x0,'rows':[]};_0x1b9f3d['model']=_[_0x5497('0x33')](db[_0x5497('0x44')][_0x5497('0x2f')]);_0x1b9f3d['query']=_['keys'](_0x436a83[_0x5497('0x32')]);_0x1b9f3d['filters']=_[_0x5497('0x34')](_0x1b9f3d['model'],_0x1b9f3d[_0x5497('0x32')]);_0x4ccf0e['attributes']=_[_0x5497('0x34')](_0x1b9f3d[_0x5497('0x35')],qs['fields'](_0x436a83[_0x5497('0x32')]['fields']));_0x4ccf0e['attributes']=_0x4ccf0e[_0x5497('0x36')][_0x5497('0x38')]?_0x4ccf0e['attributes']:_0x1b9f3d[_0x5497('0x35')];if(!_0x436a83[_0x5497('0x32')][_0x5497('0x51')](_0x5497('0x39'))){_0x4ccf0e[_0x5497('0x24')]=qs[_0x5497('0x24')](_0x436a83['query'][_0x5497('0x24')]);_0x4ccf0e['offset']=qs['offset'](_0x436a83['query'][_0x5497('0x23')]);}_0x4ccf0e[_0x5497('0x3a')]=qs[_0x5497('0x3b')](_0x436a83['query'][_0x5497('0x3b')]);_0x4ccf0e['where']=qs['filters'](_[_0x5497('0x3d')](_0x436a83[_0x5497('0x32')],_0x1b9f3d[_0x5497('0x3c')]));if(_0x436a83[_0x5497('0x32')][_0x5497('0x3e')]){_0x4ccf0e[_0x5497('0x40')]=_['merge'](_0x4ccf0e[_0x5497('0x40')],{'$or':_[_0x5497('0x31')](_0x4ccf0e[_0x5497('0x36')],function(_0xc783ce){var _0x4b86a8={};_0x4b86a8[_0xc783ce]={'$like':'%'+_0x436a83[_0x5497('0x32')][_0x5497('0x3e')]+'%'};return _0x4b86a8;})});}_0x4ccf0e=_[_0x5497('0x3f')]({},_0x4ccf0e,_0x436a83[_0x5497('0x43')]);var _0x5823f6={'where':_0x4ccf0e[_0x5497('0x40')]};return db[_0x5497('0x44')][_0x5497('0x22')](_0x5823f6)['then'](function(_0x1ab48f){_0x538d18['count']=_0x1ab48f;if(_0x436a83['query']['includeAll']){_0x4ccf0e[_0x5497('0x46')]=[{'all':!![]}];}return db[_0x5497('0x44')][_0x5497('0x47')](_0x4ccf0e);})['then'](function(_0x23b8f0){_0x538d18[_0x5497('0x48')]=_0x23b8f0;return _0x538d18;})[_0x5497('0x2a')](respondWithFilteredResult(_0x3094c7,_0x4ccf0e,_0x5497('0x50')))['catch'](handleError(_0x3094c7,null,_0x5497('0x50')));}; \ No newline at end of file +var _0x1967=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','name','index','VoiceQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x1967,0x173));var _0x7196=function(_0x51306d,_0x3ccc97){_0x51306d=_0x51306d-0x0;var _0x5c8409=_0x1967[_0x51306d];return _0x5c8409;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)[_0x7196('0x21')]();});}};}function handleEntityNotFound(_0x70aa65,_0x43f6a2){return function(_0x530ab5){if(!_0x530ab5){_0x70aa65['sendStatus'](0x194);}return _0x530ab5;};}function handleError(_0x1482e5,_0x2d284f){_0x2d284f=_0x2d284f||0x1f4;return function(_0x184c09){logger['error'](_0x184c09['stack']);if(_0x184c09[_0x7196('0x2b')]){delete _0x184c09[_0x7196('0x2b')];}_0x1482e5[_0x7196('0x22')](_0x2d284f)['send'](_0x184c09);};}exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={},_0x30151f={},_0x985727={'count':0x0,'rows':[]};var _0x1257ad=_['map'](db[_0x7196('0x2d')][_0x7196('0x2e')],function(_0x2f9583){return{'name':_0x2f9583[_0x7196('0x2f')],'type':_0x2f9583['type'][_0x7196('0x30')]};});_0x30151f[_0x7196('0x31')]=_[_0x7196('0x32')](_0x1257ad,_0x7196('0x2b'));_0x30151f[_0x7196('0x33')]=_[_0x7196('0x34')](_0x4ecea1[_0x7196('0x33')]);_0x30151f[_0x7196('0x35')]=_[_0x7196('0x36')](_0x30151f[_0x7196('0x31')],_0x30151f[_0x7196('0x33')]);_0x59d79d['attributes']=_[_0x7196('0x36')](_0x30151f['model'],qs[_0x7196('0x37')](_0x4ecea1['query'][_0x7196('0x37')]));_0x59d79d[_0x7196('0x38')]=_0x59d79d['attributes'][_0x7196('0x39')]?_0x59d79d[_0x7196('0x38')]:_0x30151f[_0x7196('0x31')];if(!_0x4ecea1[_0x7196('0x33')][_0x7196('0x3a')]('nolimit')){_0x59d79d[_0x7196('0x3b')]=qs[_0x7196('0x3b')](_0x4ecea1[_0x7196('0x33')][_0x7196('0x3b')]);_0x59d79d[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x4ecea1['query'][_0x7196('0x25')]);}_0x59d79d[_0x7196('0x3c')]=qs[_0x7196('0x3d')](_0x4ecea1['query'][_0x7196('0x3d')]);_0x59d79d[_0x7196('0x3e')]=qs[_0x7196('0x35')](_[_0x7196('0x3f')](_0x4ecea1[_0x7196('0x33')],_0x30151f[_0x7196('0x35')]));if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]){_0x59d79d[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x59d79d['where'],{'$or':_[_0x7196('0x32')](_0x1257ad,function(_0x17cefd){if(_0x17cefd['type']!==_0x7196('0x42')){var _0x54767f={};_0x54767f[_0x17cefd['name']]={'$like':'%'+_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]+'%'};return _0x54767f;}})});}_0x59d79d=_['merge']({},_0x59d79d,_0x4ecea1['options']);var _0x1bad95={'where':_0x59d79d[_0x7196('0x3e')]};return db[_0x7196('0x2d')]['count'](_0x1bad95)[_0x7196('0x29')](function(_0x2d13a5){_0x985727[_0x7196('0x24')]=_0x2d13a5;if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x43')]){_0x59d79d[_0x7196('0x44')]=[{'all':!![]}];}return db[_0x7196('0x2d')][_0x7196('0x45')](_0x59d79d);})['then'](function(_0x89c8ea){_0x985727[_0x7196('0x46')]=_0x89c8ea;return _0x985727;})['then'](respondWithFilteredResult(_0x4fd339,_0x59d79d))[_0x7196('0x47')](handleError(_0x4fd339,null));};exports[_0x7196('0x48')]=function(_0x48178f,_0x471915){var _0x471bb2={'raw':![],'where':{'id':_0x48178f['params']['id']}},_0x3b78c8={};_0x3b78c8[_0x7196('0x31')]=_[_0x7196('0x34')](db['VoiceQueueReport'][_0x7196('0x2e')]);_0x3b78c8[_0x7196('0x33')]=_['keys'](_0x48178f[_0x7196('0x33')]);_0x3b78c8['filters']=_['intersection'](_0x3b78c8['model'],_0x3b78c8['query']);_0x471bb2['attributes']=_[_0x7196('0x36')](_0x3b78c8['model'],qs[_0x7196('0x37')](_0x48178f[_0x7196('0x33')][_0x7196('0x37')]));_0x471bb2[_0x7196('0x38')]=_0x471bb2['attributes'][_0x7196('0x39')]?_0x471bb2['attributes']:_0x3b78c8[_0x7196('0x31')];if(_0x48178f[_0x7196('0x33')][_0x7196('0x43')]){_0x471bb2['include']=[{'all':!![]}];}_0x471bb2=_[_0x7196('0x41')]({},_0x471bb2,_0x48178f[_0x7196('0x49')]);return db[_0x7196('0x2d')]['find'](_0x471bb2)['then'](handleEntityNotFound(_0x471915,null))[_0x7196('0x29')](respondWithResult(_0x471915,null))['catch'](handleError(_0x471915,null));};exports[_0x7196('0x4a')]=function(_0x582884,_0x53b4c7){return db[_0x7196('0x2d')]['create'](_0x582884['body'],{})['then'](respondWithResult(_0x53b4c7,0xc9))[_0x7196('0x47')](handleError(_0x53b4c7,null));};exports['update']=function(_0x48e3b5,_0x28591e){if(_0x48e3b5[_0x7196('0x4b')]['id']){delete _0x48e3b5[_0x7196('0x4b')]['id'];}return db[_0x7196('0x2d')]['find']({'where':{'id':_0x48e3b5[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28591e,null))[_0x7196('0x29')](saveUpdates(_0x48e3b5[_0x7196('0x4b')],null))['then'](respondWithResult(_0x28591e,null))[_0x7196('0x47')](handleError(_0x28591e,null));};exports[_0x7196('0x2a')]=function(_0x3fe092,_0x4fa18f){return db[_0x7196('0x2d')]['find']({'where':{'id':_0x3fe092[_0x7196('0x4c')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x29')](removeEntity(_0x4fa18f,null))[_0x7196('0x47')](handleError(_0x4fa18f,null));};exports[_0x7196('0x4d')]=function(_0x19733a,_0x7e0d3){return db[_0x7196('0x2d')]['describe']()['then'](respondWithResult(_0x7e0d3,null))[_0x7196('0x47')](handleError(_0x7e0d3,null));};exports[_0x7196('0x4e')]=function(_0x40f820,_0xe4b032){var _0x4ebcd7={},_0x76b189={},_0x6948a={'count':0x0,'rows':[]};_0x76b189[_0x7196('0x31')]=_[_0x7196('0x34')](db[_0x7196('0x2d')][_0x7196('0x2e')]);_0x76b189[_0x7196('0x33')]=_[_0x7196('0x34')](_0x40f820[_0x7196('0x33')]);_0x76b189[_0x7196('0x35')]=_[_0x7196('0x36')](_0x76b189['model'],_0x76b189[_0x7196('0x33')]);_0x4ebcd7[_0x7196('0x38')]=_[_0x7196('0x36')](_0x76b189['model'],qs[_0x7196('0x37')](_0x40f820['query'][_0x7196('0x37')]));_0x4ebcd7[_0x7196('0x38')]=_0x4ebcd7[_0x7196('0x38')][_0x7196('0x39')]?_0x4ebcd7[_0x7196('0x38')]:_0x76b189['model'];if(!_0x40f820[_0x7196('0x33')]['hasOwnProperty']('nolimit')){_0x4ebcd7['limit']=qs[_0x7196('0x3b')](_0x40f820[_0x7196('0x33')][_0x7196('0x3b')]);_0x4ebcd7[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x40f820[_0x7196('0x33')][_0x7196('0x25')]);}_0x4ebcd7['order']=qs[_0x7196('0x3d')](_0x40f820[_0x7196('0x33')][_0x7196('0x3d')]);_0x4ebcd7[_0x7196('0x3e')]=qs[_0x7196('0x35')](_['pick'](_0x40f820['query'],_0x76b189[_0x7196('0x35')]));if(_0x40f820[_0x7196('0x33')][_0x7196('0x40')]){_0x4ebcd7[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x4ebcd7[_0x7196('0x3e')],{'$or':_[_0x7196('0x32')](_0x4ebcd7[_0x7196('0x38')],function(_0x13e9d0){var _0x2caadd={};_0x2caadd[_0x13e9d0]={'$like':'%'+_0x40f820[_0x7196('0x33')]['filter']+'%'};return _0x2caadd;})});}_0x4ebcd7=_[_0x7196('0x41')]({},_0x4ebcd7,_0x40f820[_0x7196('0x49')]);var _0x27d5d7={'where':_0x4ebcd7[_0x7196('0x3e')]};return db['VoiceQueueReport'][_0x7196('0x24')](_0x27d5d7)[_0x7196('0x29')](function(_0x1f3acc){_0x6948a[_0x7196('0x24')]=_0x1f3acc;if(_0x40f820[_0x7196('0x33')][_0x7196('0x43')]){_0x4ebcd7[_0x7196('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7196('0x45')](_0x4ebcd7);})[_0x7196('0x29')](function(_0x40df9b){_0x6948a[_0x7196('0x46')]=_0x40df9b;return _0x6948a;})['then'](respondWithFilteredResult(_0xe4b032,_0x4ebcd7,_0x7196('0x4e')))[_0x7196('0x47')](handleError(_0xe4b032,null,_0x7196('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 9edc30f..dfb249a 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 _0x5d22=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2770a6,_0x2fbc63){var _0x3bd4ba=function(_0x162ed4){while(--_0x162ed4){_0x2770a6['push'](_0x2770a6['shift']());}};_0x3bd4ba(++_0x2fbc63);}(_0x5d22,0x168));var _0x25d2=function(_0x4a9ca5,_0x19eb10){_0x4a9ca5=_0x4a9ca5-0x0;var _0xb3318e=_0x5d22[_0x4a9ca5];return _0xb3318e;};'use strict';var EventEmitter=require(_0x25d2('0x0'));var VoiceQueueReport=require(_0x25d2('0x1'))['db'][_0x25d2('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x25d2('0x3')](0x0);var events={'afterCreate':_0x25d2('0x4'),'afterUpdate':_0x25d2('0x5'),'afterDestroy':_0x25d2('0x6')};function emitEvent(_0x1394fa){return function(_0x3368b8,_0x163c7e,_0xd53fed){VoiceQueueReportEvents[_0x25d2('0x7')](_0x1394fa+':'+_0x3368b8['id'],_0x3368b8);VoiceQueueReportEvents[_0x25d2('0x7')](_0x1394fa,_0x3368b8);_0xd53fed(null);};}for(var e in events){if(events[_0x25d2('0x8')](e)){var event=events[e];VoiceQueueReport[_0x25d2('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xbf9e=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','save'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xbf9e,0x101));var _0xebf9=function(_0xa33997,_0x47c1d0){_0xa33997=_0xa33997-0x0;var _0x5cf263=_0xbf9e[_0xa33997];return _0x5cf263;};'use strict';var EventEmitter=require(_0xebf9('0x0'));var VoiceQueueReport=require(_0xebf9('0x1'))['db'][_0xebf9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebf9('0x3'),'afterUpdate':_0xebf9('0x4'),'afterDestroy':_0xebf9('0x5')};function emitEvent(_0x5cfb10){return function(_0x4e529b,_0x16f39c,_0x3d951e){VoiceQueueReportEvents[_0xebf9('0x6')](_0x5cfb10+':'+_0x4e529b['id'],_0x4e529b);VoiceQueueReportEvents[_0xebf9('0x6')](_0x5cfb10,_0x4e529b);_0x3d951e(null);};}for(var e in events){if(events[_0xebf9('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xebf9('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 597664a..5f7928b 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 _0x0b0e=['calleridnum','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid'];(function(_0x36c838,_0x4eba0a){var _0x309537=function(_0x4037a1){while(--_0x4037a1){_0x36c838['push'](_0x36c838['shift']());}};_0x309537(++_0x4eba0a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0x0b0e[_0x5be8cc];return _0x5f1b7e;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe0b0('0xb')]},{'fields':[_0xe0b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x43caa2,_0x1ffb73){var _0x51b342=function(_0x288f85){while(--_0x288f85){_0x43caa2['push'](_0x43caa2['shift']());}};_0x51b342(++_0x1ffb73);}(_0xb10b,0x12a));var _0xbb10=function(_0x240b0a,_0x50335f){_0x240b0a=_0x240b0a-0x0;var _0x35346a=_0xb10b[_0x240b0a];return _0x35346a;};'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')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 3f23313..830b0e0 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 _0xbc49=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','model','map','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','lodash','bluebird'];(function(_0x3246e0,_0x399283){var _0x325ac1=function(_0x3170b9){while(--_0x3170b9){_0x3246e0['push'](_0x3246e0['shift']());}};_0x325ac1(++_0x399283);}(_0xbc49,0xc6));var _0x9bc4=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0xbc49[_0x5c468f];return _0x2136b0;};'use strict';var _=require(_0x9bc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9bc4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bc4('0x2'))['db'];var utils=require(_0x9bc4('0x3'));var logger=require(_0x9bc4('0x4'))(_0x9bc4('0x5'));var config=require(_0x9bc4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9bc4('0x7')][_0x9bc4('0x8')]({'port':0x232a});config[_0x9bc4('0x9')]=_['defaults'](config[_0x9bc4('0x9')],{'host':_0x9bc4('0xa'),'port':0x18eb});var socket=require(_0x9bc4('0xb'))(new Redis(config[_0x9bc4('0x9')]));require(_0x9bc4('0xc'))['register'](socket);function respondWithRpcPromise(_0x2a7628,_0x4d9772,_0x24ebeb){return new BPromise(function(_0x2365c3,_0x5ed8fe){return client['request'](_0x2a7628,_0x24ebeb)[_0x9bc4('0xd')](function(_0x3b1162){logger[_0x9bc4('0xe')](_0x9bc4('0xf'),_0x4d9772,_0x9bc4('0x10'));logger[_0x9bc4('0x11')](_0x9bc4('0x12'),_0x4d9772,_0x9bc4('0x10'),JSON[_0x9bc4('0x13')](_0x3b1162));if(_0x3b1162['error']){if(_0x3b1162[_0x9bc4('0x14')]['code']===0x1f4){logger[_0x9bc4('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d9772,_0x3b1162[_0x9bc4('0x14')]['message']);return _0x5ed8fe(_0x3b1162[_0x9bc4('0x14')]['message']);}logger[_0x9bc4('0x14')](_0x9bc4('0xf'),_0x4d9772,_0x3b1162[_0x9bc4('0x14')][_0x9bc4('0x15')]);return _0x2365c3(_0x3b1162[_0x9bc4('0x14')][_0x9bc4('0x15')]);}else{logger[_0x9bc4('0xe')](_0x9bc4('0xf'),_0x4d9772,_0x9bc4('0x10'));_0x2365c3(_0x3b1162[_0x9bc4('0x16')]['message']);}})[_0x9bc4('0x17')](function(_0x78383b){logger[_0x9bc4('0x14')](_0x9bc4('0xf'),_0x4d9772,_0x78383b);_0x5ed8fe(_0x78383b);});});}exports[_0x9bc4('0x18')]=function(_0x50d16e){var _0x41a6d7=this;return new Promise(function(_0x15349c,_0x5639a9){return db[_0x9bc4('0x19')][_0x9bc4('0x1a')]({'raw':_0x50d16e['options']?_0x50d16e[_0x9bc4('0x1b')][_0x9bc4('0x1c')]===undefined?!![]:![]:!![],'where':_0x50d16e[_0x9bc4('0x1b')]?_0x50d16e[_0x9bc4('0x1b')][_0x9bc4('0x1d')]||null:null,'attributes':_0x50d16e[_0x9bc4('0x1b')]?_0x50d16e[_0x9bc4('0x1b')][_0x9bc4('0x1e')]||null:null,'limit':_0x50d16e[_0x9bc4('0x1b')]?_0x50d16e['options']['limit']||null:null,'include':_0x50d16e[_0x9bc4('0x1b')]?_0x50d16e['options'][_0x9bc4('0x1f')]?_['map'](_0x50d16e[_0x9bc4('0x1b')][_0x9bc4('0x1f')],function(_0x2b5e27){return{'model':db[_0x2b5e27[_0x9bc4('0x20')]],'as':_0x2b5e27['as'],'attributes':_0x2b5e27[_0x9bc4('0x1e')],'include':_0x2b5e27[_0x9bc4('0x1f')]?_[_0x9bc4('0x21')](_0x2b5e27[_0x9bc4('0x1f')],function(_0x2c8308){return{'model':db[_0x2c8308[_0x9bc4('0x20')]],'as':_0x2c8308['as'],'attributes':_0x2c8308[_0x9bc4('0x1e')],'include':_0x2c8308[_0x9bc4('0x1f')]?_['map'](_0x2c8308['include'],function(_0x1cce9f){return{'model':db[_0x1cce9f[_0x9bc4('0x20')]],'as':_0x1cce9f['as'],'attributes':_0x1cce9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x9bc4('0xd')](function(_0x52fb02){logger[_0x9bc4('0xe')](_0x9bc4('0x18'),_0x50d16e);logger[_0x9bc4('0x11')](_0x9bc4('0x18'),_0x50d16e,JSON[_0x9bc4('0x13')](_0x52fb02));_0x15349c(_0x52fb02);})[_0x9bc4('0x17')](function(_0xe392a3){logger[_0x9bc4('0x14')](_0x9bc4('0x18'),_0xe392a3[_0x9bc4('0x15')],_0x50d16e);_0x5639a9(_0x41a6d7['error'](0x1f4,_0xe392a3[_0x9bc4('0x15')]));});});};exports[_0x9bc4('0x22')]=function(_0x477a15){var _0x2d61f1=this;return new Promise(function(_0x33df04,_0x5a3d9a){return db['VoiceQueueReport'][_0x9bc4('0x23')](_0x477a15[_0x9bc4('0x24')],{'raw':_0x477a15['options']?_0x477a15[_0x9bc4('0x1b')][_0x9bc4('0x1c')]===undefined?!![]:![]:!![]})[_0x9bc4('0xd')](function(_0x3d826a){logger['info']('CreateVoiceQueueReport',_0x477a15);logger[_0x9bc4('0x11')]('CreateVoiceQueueReport',_0x477a15,JSON[_0x9bc4('0x13')](_0x3d826a));_0x33df04(_0x3d826a);})[_0x9bc4('0x17')](function(_0x7680b5){logger['error'](_0x9bc4('0x22'),_0x7680b5[_0x9bc4('0x15')],_0x477a15);_0x5a3d9a(_0x2d61f1[_0x9bc4('0x14')](0x1f4,_0x7680b5[_0x9bc4('0x15')]));});});};exports[_0x9bc4('0x25')]=function(_0x313414){var _0x365356=this;return new Promise(function(_0x540b18,_0x174859){return db[_0x9bc4('0x19')][_0x9bc4('0x26')](_0x313414[_0x9bc4('0x24')],{'raw':_0x313414['options']?_0x313414[_0x9bc4('0x1b')][_0x9bc4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x313414[_0x9bc4('0x1b')]?_0x313414[_0x9bc4('0x1b')]['where']||null:null,'attributes':_0x313414[_0x9bc4('0x1b')]?_0x313414['options'][_0x9bc4('0x1e')]||null:null,'limit':_0x313414[_0x9bc4('0x1b')]?_0x313414['options'][_0x9bc4('0x27')]||null:null})[_0x9bc4('0xd')](function(_0x2ec548){logger['info'](_0x9bc4('0x25'),_0x313414);logger[_0x9bc4('0x11')](_0x9bc4('0x25'),_0x313414,JSON[_0x9bc4('0x13')](_0x2ec548));_0x540b18(_0x2ec548);})[_0x9bc4('0x17')](function(_0x333829){logger['error']('UpdateVoiceQueueReport',_0x333829['message'],_0x313414);_0x174859(_0x365356['error'](0x1f4,_0x333829['message']));});});}; \ No newline at end of file +var _0x12c1=['model','GetVoiceQueueReport','stringify','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','map','include'];(function(_0x23ae01,_0x11ce92){var _0x2305ba=function(_0x3ca80c){while(--_0x3ca80c){_0x23ae01['push'](_0x23ae01['shift']());}};_0x2305ba(++_0x11ce92);}(_0x12c1,0x171));var _0x112c=function(_0x38b3f1,_0x3cac1f){_0x38b3f1=_0x38b3f1-0x0;var _0x42d164=_0x12c1[_0x38b3f1];return _0x42d164;};'use strict';var _=require(_0x112c('0x0'));var util=require(_0x112c('0x1'));var moment=require(_0x112c('0x2'));var BPromise=require(_0x112c('0x3'));var rs=require(_0x112c('0x4'));var fs=require('fs');var Redis=require(_0x112c('0x5'));var db=require(_0x112c('0x6'))['db'];var utils=require(_0x112c('0x7'));var logger=require('../../config/logger')(_0x112c('0x8'));var config=require(_0x112c('0x9'));var jayson=require(_0x112c('0xa'));var client=jayson['client'][_0x112c('0xb')]({'port':0x232a});config[_0x112c('0xc')]=_[_0x112c('0xd')](config[_0x112c('0xc')],{'host':_0x112c('0xe'),'port':0x18eb});var socket=require(_0x112c('0xf'))(new Redis(config[_0x112c('0xc')]));require(_0x112c('0x10'))['register'](socket);function respondWithRpcPromise(_0x4ad520,_0x22f431,_0x3f837e){return new BPromise(function(_0x434e44,_0x1189ee){return client[_0x112c('0x11')](_0x4ad520,_0x3f837e)[_0x112c('0x12')](function(_0x2c47b4){logger[_0x112c('0x13')](_0x112c('0x14'),_0x22f431,_0x112c('0x15'));logger[_0x112c('0x16')](_0x112c('0x17'),_0x22f431,_0x112c('0x15'),JSON['stringify'](_0x2c47b4));if(_0x2c47b4[_0x112c('0x18')]){if(_0x2c47b4[_0x112c('0x18')][_0x112c('0x19')]===0x1f4){logger[_0x112c('0x18')](_0x112c('0x14'),_0x22f431,_0x2c47b4['error'][_0x112c('0x1a')]);return _0x1189ee(_0x2c47b4['error'][_0x112c('0x1a')]);}logger['error'](_0x112c('0x14'),_0x22f431,_0x2c47b4['error']['message']);return _0x434e44(_0x2c47b4[_0x112c('0x18')]['message']);}else{logger[_0x112c('0x13')](_0x112c('0x14'),_0x22f431,_0x112c('0x15'));_0x434e44(_0x2c47b4[_0x112c('0x1b')][_0x112c('0x1a')]);}})['catch'](function(_0x4c68dc){logger[_0x112c('0x18')](_0x112c('0x14'),_0x22f431,_0x4c68dc);_0x1189ee(_0x4c68dc);});});}exports['GetVoiceQueueReport']=function(_0x13faf1){var _0x5ad0e8=this;return new Promise(function(_0x28ecbb,_0x14e059){return db[_0x112c('0x1c')][_0x112c('0x1d')]({'raw':_0x13faf1[_0x112c('0x1e')]?_0x13faf1[_0x112c('0x1e')][_0x112c('0x1f')]===undefined?!![]:![]:!![],'where':_0x13faf1[_0x112c('0x1e')]?_0x13faf1['options'][_0x112c('0x20')]||null:null,'attributes':_0x13faf1['options']?_0x13faf1['options'][_0x112c('0x21')]||null:null,'limit':_0x13faf1['options']?_0x13faf1[_0x112c('0x1e')]['limit']||null:null,'include':_0x13faf1['options']?_0x13faf1['options']['include']?_[_0x112c('0x22')](_0x13faf1[_0x112c('0x1e')][_0x112c('0x23')],function(_0x26d54c){return{'model':db[_0x26d54c[_0x112c('0x24')]],'as':_0x26d54c['as'],'attributes':_0x26d54c[_0x112c('0x21')],'include':_0x26d54c['include']?_['map'](_0x26d54c[_0x112c('0x23')],function(_0x169a9f){return{'model':db[_0x169a9f[_0x112c('0x24')]],'as':_0x169a9f['as'],'attributes':_0x169a9f['attributes'],'include':_0x169a9f[_0x112c('0x23')]?_[_0x112c('0x22')](_0x169a9f[_0x112c('0x23')],function(_0x432765){return{'model':db[_0x432765[_0x112c('0x24')]],'as':_0x432765['as'],'attributes':_0x432765[_0x112c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x112c('0x12')](function(_0x357015){logger[_0x112c('0x13')](_0x112c('0x25'),_0x13faf1);logger[_0x112c('0x16')]('GetVoiceQueueReport',_0x13faf1,JSON[_0x112c('0x26')](_0x357015));_0x28ecbb(_0x357015);})[_0x112c('0x27')](function(_0x16ff11){logger['error'](_0x112c('0x25'),_0x16ff11[_0x112c('0x1a')],_0x13faf1);_0x14e059(_0x5ad0e8['error'](0x1f4,_0x16ff11[_0x112c('0x1a')]));});});};exports[_0x112c('0x28')]=function(_0x145b3c){var _0x2f4026=this;return new Promise(function(_0x1ca419,_0x3cb341){return db['VoiceQueueReport'][_0x112c('0x29')](_0x145b3c['body'],{'raw':_0x145b3c[_0x112c('0x1e')]?_0x145b3c[_0x112c('0x1e')][_0x112c('0x1f')]===undefined?!![]:![]:!![]})[_0x112c('0x12')](function(_0x102232){logger['info'](_0x112c('0x28'),_0x145b3c);logger[_0x112c('0x16')](_0x112c('0x28'),_0x145b3c,JSON['stringify'](_0x102232));_0x1ca419(_0x102232);})[_0x112c('0x27')](function(_0x29b6b5){logger[_0x112c('0x18')](_0x112c('0x28'),_0x29b6b5[_0x112c('0x1a')],_0x145b3c);_0x3cb341(_0x2f4026['error'](0x1f4,_0x29b6b5['message']));});});};exports[_0x112c('0x2a')]=function(_0x1806c0){var _0x5a0f0e=this;return new Promise(function(_0xff5f3a,_0x2c6212){return db[_0x112c('0x1c')]['update'](_0x1806c0[_0x112c('0x2b')],{'raw':_0x1806c0[_0x112c('0x1e')]?_0x1806c0[_0x112c('0x1e')][_0x112c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1806c0[_0x112c('0x1e')]?_0x1806c0[_0x112c('0x1e')][_0x112c('0x20')]||null:null,'attributes':_0x1806c0[_0x112c('0x1e')]?_0x1806c0[_0x112c('0x1e')]['attributes']||null:null,'limit':_0x1806c0[_0x112c('0x1e')]?_0x1806c0[_0x112c('0x1e')][_0x112c('0x2c')]||null:null})[_0x112c('0x12')](function(_0x2eace6){logger[_0x112c('0x13')](_0x112c('0x2a'),_0x1806c0);logger['debug']('UpdateVoiceQueueReport',_0x1806c0,JSON[_0x112c('0x26')](_0x2eace6));_0xff5f3a(_0x2eace6);})[_0x112c('0x27')](function(_0xab4b4f){logger[_0x112c('0x18')](_0x112c('0x2a'),_0xab4b4f[_0x112c('0x1a')],_0x1806c0);_0x2c6212(_0x5a0f0e[_0x112c('0x18')](0x1f4,_0xab4b4f[_0x112c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8590ebe..22012d2 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 _0xce7c=['emit','removeListener','register','voiceQueueReport:','save','update'];(function(_0x27f81a,_0x30a30a){var _0x343bf8=function(_0x4f3d53){while(--_0x4f3d53){_0x27f81a['push'](_0x27f81a['shift']());}};_0x343bf8(++_0x30a30a);}(_0xce7c,0x19c));var _0xcce7=function(_0x45081a,_0x3ae384){_0x45081a=_0x45081a-0x0;var _0x55bfe2=_0xce7c[_0x45081a];return _0x55bfe2;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xcce7('0x0'),'remove',_0xcce7('0x1')];function createListener(_0x143fd7,_0x5aef63){return function(_0xf27dfb){_0x5aef63[_0xcce7('0x2')](_0x143fd7,_0xf27dfb);};}function removeListener(_0x945630,_0x12333d){return function(){VoiceQueueReportEvents[_0xcce7('0x3')](_0x945630,_0x12333d);};}exports[_0xcce7('0x4')]=function(_0x901c73){for(var _0xd8bead=0x0,_0x3961cb=events['length'];_0xd8bead<_0x3961cb;_0xd8bead++){var _0x3d7247=events[_0xd8bead];var _0x2dcc26=createListener(_0xcce7('0x5')+_0x3d7247,_0x901c73);VoiceQueueReportEvents['on'](_0x3d7247,_0x2dcc26);}}; \ No newline at end of file +var _0x9bcd=['update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x47cbf7,_0x448632){var _0x3946e4=function(_0x348b58){while(--_0x348b58){_0x47cbf7['push'](_0x47cbf7['shift']());}};_0x3946e4(++_0x448632);}(_0x9bcd,0xe7));var _0xd9bc=function(_0x1308a3,_0x4b8145){_0x1308a3=_0x1308a3-0x0;var _0x1715a0=_0x9bcd[_0x1308a3];return _0x1715a0;};'use strict';var VoiceQueueReportEvents=require(_0xd9bc('0x0'));var events=[_0xd9bc('0x1'),_0xd9bc('0x2'),_0xd9bc('0x3')];function createListener(_0xf4e000,_0x22b703){return function(_0x45d400){_0x22b703[_0xd9bc('0x4')](_0xf4e000,_0x45d400);};}function removeListener(_0x5757cd,_0x58de9d){return function(){VoiceQueueReportEvents[_0xd9bc('0x5')](_0x5757cd,_0x58de9d);};}exports[_0xd9bc('0x6')]=function(_0x1453bf){for(var _0x5a2342=0x0,_0x3992fa=events[_0xd9bc('0x7')];_0x5a2342<_0x3992fa;_0x5a2342++){var _0x2b94e8=events[_0x5a2342];var _0x3459cc=createListener(_0xd9bc('0x8')+_0x2b94e8,_0x1453bf);VoiceQueueReportEvents['on'](_0x2b94e8,_0x3459cc);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 94aa102..66a6b43 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 _0x63f2=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x4f93cd,_0x38b325){var _0x45df11=function(_0x2cf805){while(--_0x2cf805){_0x4f93cd['push'](_0x4f93cd['shift']());}};_0x45df11(++_0x38b325);}(_0x63f2,0x19b));var _0x263f=function(_0x7a6168,_0x1c0ab9){_0x7a6168=_0x7a6168-0x0;var _0xeb73a=_0x63f2[_0x7a6168];return _0xeb73a;};'use strict';var multer=require(_0x263f('0x0'));var util=require(_0x263f('0x1'));var path=require(_0x263f('0x2'));var timeout=require(_0x263f('0x3'));var express=require(_0x263f('0x4'));var router=express[_0x263f('0x5')]();var auth=require(_0x263f('0x6'));var interaction=require(_0x263f('0x7'));var config=require(_0x263f('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0x263f('0x9')]('/',auth[_0x263f('0xa')](),controller['index']);router[_0x263f('0x9')](_0x263f('0xb'),auth[_0x263f('0xa')](),controller['show']);router[_0x263f('0xc')]('/',auth[_0x263f('0xa')](),controller[_0x263f('0xd')]);router[_0x263f('0xe')](_0x263f('0xb'),auth[_0x263f('0xa')](),controller['update']);router[_0x263f('0xf')](_0x263f('0xb'),auth['isAuthenticated'](),controller[_0x263f('0x10')]);module[_0x263f('0x11')]=router; \ No newline at end of file +var _0xfba2=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfba2,0x1a3));var _0x2fba=function(_0x48a162,_0xdde642){_0x48a162=_0x48a162-0x0;var _0x1a3203=_0xfba2[_0x48a162];return _0x1a3203;};'use strict';var multer=require(_0x2fba('0x0'));var util=require(_0x2fba('0x1'));var path=require(_0x2fba('0x2'));var timeout=require(_0x2fba('0x3'));var express=require('express');var router=express[_0x2fba('0x4')]();var auth=require(_0x2fba('0x5'));var interaction=require(_0x2fba('0x6'));var config=require(_0x2fba('0x7'));var controller=require(_0x2fba('0x8'));router[_0x2fba('0x9')]('/',auth['isAuthenticated'](),controller[_0x2fba('0xa')]);router[_0x2fba('0x9')](_0x2fba('0xb'),auth[_0x2fba('0xc')](),controller[_0x2fba('0xd')]);router[_0x2fba('0xe')]('/',auth[_0x2fba('0xc')](),controller['create']);router[_0x2fba('0xf')](_0x2fba('0xb'),auth[_0x2fba('0xc')](),controller[_0x2fba('0x10')]);router[_0x2fba('0x11')](_0x2fba('0xb'),auth[_0x2fba('0xc')](),controller[_0x2fba('0x12')]);module[_0x2fba('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 241b518..b872957 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 _0x1d77=['moment','exports','STRING','DATE','format','sequelize'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x1d77,0x149));var _0x71d7=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0x1d77[_0x5f49c0];return _0x5ab653;};'use strict';var Sequelize=require(_0x71d7('0x0'));var moment=require(_0x71d7('0x1'));module[_0x71d7('0x2')]={'time':{'type':Sequelize[_0x71d7('0x3')]},'callid':{'type':Sequelize[_0x71d7('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x71d7('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x71d7('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x71d7('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x71d7('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x71d7('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x71d7('0x4')],'allowNull':![],'defaultValue':moment()[_0x71d7('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xf4c1=['format','YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf4c1,0x129));var _0x1f4c=function(_0x3ee101,_0x416bf1){_0x3ee101=_0x3ee101-0x0;var _0x105f21=_0xf4c1[_0x3ee101];return _0x105f21;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1f4c('0x0'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x1f4c('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1f4c('0x2')],'allowNull':![],'defaultValue':moment()[_0x1f4c('0x3')](_0x1f4c('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8eddbc2..0cd4161 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 _0xd914=['fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','name','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','mustache','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','reject','update','then','error','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection'];(function(_0x2e5a8c,_0x35f4bf){var _0x5816ec=function(_0x27cf55){while(--_0x27cf55){_0x2e5a8c['push'](_0x2e5a8c['shift']());}};_0x5816ec(++_0x35f4bf);}(_0xd914,0x165));var _0x4d91=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xd914[_0x1030ce];return _0x3367fd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require(_0x4d91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d91('0x3'));var util=require('util');var path=require('path');var sox=require(_0x4d91('0x4'));var csv=require(_0x4d91('0x5'));var ejs=require(_0x4d91('0x6'));var fs=require('fs');var _=require(_0x4d91('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4d91('0x8'));var deskjs=require(_0x4d91('0x9'));var toCsv=require('to-csv');var querystring=require(_0x4d91('0xa'));var Papa=require(_0x4d91('0xb'));var Redis=require(_0x4d91('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4d91('0xd'));var as=require(_0x4d91('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d91('0xf'))(_0x4d91('0x10'));var utils=require('../../config/utils');var config=require(_0x4d91('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c65f3,_0x451b7f){_0x451b7f=_0x451b7f||0xcc;return function(_0x1c797c){if(_0x1c797c){return _0x1c65f3[_0x4d91('0x12')](_0x451b7f);}return _0x1c65f3[_0x4d91('0x13')](_0x451b7f)[_0x4d91('0x14')]();};}function respondWithResult(_0x5b57eb,_0x5defca){_0x5defca=_0x5defca||0xc8;return function(_0x2f351e){if(_0x2f351e){return _0x5b57eb[_0x4d91('0x13')](_0x5defca)[_0x4d91('0x15')](_0x2f351e);}};}function respondWithFilteredResult(_0x139ab3,_0x298677){return function(_0x5043b5){if(_0x5043b5){var _0xcb81fb=_0x5043b5['count'],_0xea28=_0x298677[_0x4d91('0x16')],_0x54c0eb=_0x298677[_0x4d91('0x16')]+_0x298677['limit'],_0x34743a;if(_0x54c0eb>=_0xcb81fb){_0x54c0eb=_0xcb81fb;_0x34743a=0xc8;}else{_0x34743a=0xce;}_0x139ab3[_0x4d91('0x13')](_0x34743a);return _0x139ab3['set']('Content-Range',_0xea28+'-'+_0x54c0eb+'/'+_0xcb81fb)[_0x4d91('0x15')](_0x5043b5);}return null;};}function patchUpdates(_0x6bab99){return function(_0x281264){try{jsonpatch['apply'](_0x281264,_0x6bab99,!![]);}catch(_0x1800e8){return BPromise[_0x4d91('0x17')](_0x1800e8);}return _0x281264['save']();};}function saveUpdates(_0x157fe4,_0x5a9f7d){return function(_0x46bd83){if(_0x46bd83){return _0x46bd83[_0x4d91('0x18')](_0x157fe4)[_0x4d91('0x19')](function(_0x183338){return _0x183338;});}return null;};}function removeEntity(_0x5941bb,_0x3cb619){return function(_0x301270){if(_0x301270){return _0x301270['destroy']()[_0x4d91('0x19')](function(){_0x5941bb[_0x4d91('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc0aaf2,_0x3a414e){return function(_0x2bad57){if(!_0x2bad57){_0xc0aaf2[_0x4d91('0x12')](0x194);}return _0x2bad57;};}function handleError(_0x5f230c,_0x509dec){_0x509dec=_0x509dec||0x1f4;return function(_0x277f34){logger[_0x4d91('0x1a')](_0x277f34['stack']);if(_0x277f34['name']){delete _0x277f34['name'];}_0x5f230c['status'](_0x509dec)[_0x4d91('0x1b')](_0x277f34);};}exports[_0x4d91('0x1c')]=function(_0x2e7abe,_0x48573b){var _0xed9ed4={},_0x6a821e={},_0xbc160e={'count':0x0,'rows':[]};var _0x58e292=_['map'](db[_0x4d91('0x1d')][_0x4d91('0x1e')],function(_0x59c3fe){return{'name':_0x59c3fe[_0x4d91('0x1f')],'type':_0x59c3fe[_0x4d91('0x20')]['key']};});_0x6a821e[_0x4d91('0x21')]=_[_0x4d91('0x22')](_0x58e292,'name');_0x6a821e[_0x4d91('0x23')]=_[_0x4d91('0x24')](_0x2e7abe[_0x4d91('0x23')]);_0x6a821e[_0x4d91('0x25')]=_[_0x4d91('0x26')](_0x6a821e[_0x4d91('0x21')],_0x6a821e[_0x4d91('0x23')]);_0xed9ed4['attributes']=_[_0x4d91('0x26')](_0x6a821e['model'],qs[_0x4d91('0x27')](_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x27')]));_0xed9ed4['attributes']=_0xed9ed4[_0x4d91('0x28')][_0x4d91('0x29')]?_0xed9ed4[_0x4d91('0x28')]:_0x6a821e[_0x4d91('0x21')];if(!_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x2a')](_0x4d91('0x2b'))){_0xed9ed4['limit']=qs['limit'](_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x2c')]);_0xed9ed4[_0x4d91('0x16')]=qs[_0x4d91('0x16')](_0x2e7abe[_0x4d91('0x23')]['offset']);}_0xed9ed4[_0x4d91('0x2d')]=qs[_0x4d91('0x2e')](_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x2e')]);_0xed9ed4['where']=qs['filters'](_[_0x4d91('0x2f')](_0x2e7abe['query'],_0x6a821e['filters']));if(_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x30')]){_0xed9ed4[_0x4d91('0x31')]=_[_0x4d91('0x32')](_0xed9ed4[_0x4d91('0x31')],{'$or':_[_0x4d91('0x22')](_0x58e292,function(_0x3bd6a3){if(_0x3bd6a3[_0x4d91('0x20')]!==_0x4d91('0x33')){var _0x2705eb={};_0x2705eb[_0x3bd6a3[_0x4d91('0x34')]]={'$like':'%'+_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x30')]+'%'};return _0x2705eb;}})});}_0xed9ed4=_['merge']({},_0xed9ed4,_0x2e7abe['options']);var _0x2b6c8b={'where':_0xed9ed4[_0x4d91('0x31')]};return db['VoiceQueuesLog'][_0x4d91('0x35')](_0x2b6c8b)[_0x4d91('0x19')](function(_0x5aa2c3){_0xbc160e[_0x4d91('0x35')]=_0x5aa2c3;if(_0x2e7abe[_0x4d91('0x23')][_0x4d91('0x36')]){_0xed9ed4[_0x4d91('0x37')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x4d91('0x38')](_0xed9ed4);})['then'](function(_0x468a1a){_0xbc160e[_0x4d91('0x39')]=_0x468a1a;return _0xbc160e;})['then'](respondWithFilteredResult(_0x48573b,_0xed9ed4))[_0x4d91('0x3a')](handleError(_0x48573b,null));};exports[_0x4d91('0x3b')]=function(_0x24d1ae,_0x44e9fe){var _0xd85c69={'raw':!![],'where':{'id':_0x24d1ae[_0x4d91('0x3c')]['id']}},_0x22f078={};_0x22f078['model']=_[_0x4d91('0x24')](db['VoiceQueuesLog'][_0x4d91('0x1e')]);_0x22f078['query']=_[_0x4d91('0x24')](_0x24d1ae['query']);_0x22f078[_0x4d91('0x25')]=_[_0x4d91('0x26')](_0x22f078[_0x4d91('0x21')],_0x22f078[_0x4d91('0x23')]);_0xd85c69[_0x4d91('0x28')]=_[_0x4d91('0x26')](_0x22f078['model'],qs[_0x4d91('0x27')](_0x24d1ae[_0x4d91('0x23')][_0x4d91('0x27')]));_0xd85c69['attributes']=_0xd85c69[_0x4d91('0x28')][_0x4d91('0x29')]?_0xd85c69[_0x4d91('0x28')]:_0x22f078['model'];if(_0x24d1ae[_0x4d91('0x23')][_0x4d91('0x36')]){_0xd85c69['include']=[{'all':!![]}];}_0xd85c69=_[_0x4d91('0x32')]({},_0xd85c69,_0x24d1ae[_0x4d91('0x3d')]);return db[_0x4d91('0x1d')][_0x4d91('0x3e')](_0xd85c69)[_0x4d91('0x19')](handleEntityNotFound(_0x44e9fe,null))[_0x4d91('0x19')](respondWithResult(_0x44e9fe,null))[_0x4d91('0x3a')](handleError(_0x44e9fe,null));};exports[_0x4d91('0x3f')]=function(_0x2c3478,_0x13bf0e){return db[_0x4d91('0x1d')]['create'](_0x2c3478[_0x4d91('0x40')],{})[_0x4d91('0x19')](respondWithResult(_0x13bf0e,0xc9))[_0x4d91('0x3a')](handleError(_0x13bf0e,null));};exports[_0x4d91('0x18')]=function(_0xdd0e5e,_0x297360){if(_0xdd0e5e[_0x4d91('0x40')]['id']){delete _0xdd0e5e[_0x4d91('0x40')]['id'];}return db[_0x4d91('0x1d')][_0x4d91('0x3e')]({'where':{'id':_0xdd0e5e[_0x4d91('0x3c')]['id']}})[_0x4d91('0x19')](handleEntityNotFound(_0x297360,null))[_0x4d91('0x19')](saveUpdates(_0xdd0e5e['body'],null))[_0x4d91('0x19')](respondWithResult(_0x297360,null))[_0x4d91('0x3a')](handleError(_0x297360,null));};exports[_0x4d91('0x41')]=function(_0x37d2c3,_0x358513){return db[_0x4d91('0x1d')][_0x4d91('0x3e')]({'where':{'id':_0x37d2c3['params']['id']}})['then'](handleEntityNotFound(_0x358513,null))[_0x4d91('0x19')](removeEntity(_0x358513,null))[_0x4d91('0x3a')](handleError(_0x358513,null));}; \ No newline at end of file +var _0x7c94=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','stack','name','send','map','VoiceQueuesLog','rawAttributes','type','model','keys','filters','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','intersection','find','catch','create','body','html-pdf','eml-format','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x22d598,_0x562e8f){var _0x4e45c4=function(_0x2321f8){while(--_0x2321f8){_0x22d598['push'](_0x22d598['shift']());}};_0x4e45c4(++_0x562e8f);}(_0x7c94,0x19a));var _0x47c9=function(_0x2aaaf8,_0x335045){_0x2aaaf8=_0x2aaaf8-0x0;var _0x3cf92e=_0x7c94[_0x2aaaf8];return _0x3cf92e;};'use strict';var pdf=require(_0x47c9('0x0'));var emlformat=require(_0x47c9('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x47c9('0x2'));var moment=require(_0x47c9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x47c9('0x4'));var util=require('util');var path=require(_0x47c9('0x5'));var sox=require(_0x47c9('0x6'));var csv=require(_0x47c9('0x7'));var ejs=require(_0x47c9('0x8'));var fs=require('fs');var _=require(_0x47c9('0x9'));var squel=require(_0x47c9('0xa'));var crypto=require('crypto');var jsforce=require(_0x47c9('0xb'));var deskjs=require(_0x47c9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x47c9('0xd'));var Papa=require(_0x47c9('0xe'));var Redis=require(_0x47c9('0xf'));var authService=require(_0x47c9('0x10'));var qs=require(_0x47c9('0x11'));var as=require(_0x47c9('0x12'));var hardwareService=require(_0x47c9('0x13'));var logger=require(_0x47c9('0x14'))(_0x47c9('0x15'));var utils=require(_0x47c9('0x16'));var config=require(_0x47c9('0x17'));var db=require(_0x47c9('0x18'))['db'];function respondWithStatusCode(_0x5a7c99,_0x1d36cb){_0x1d36cb=_0x1d36cb||0xcc;return function(_0x520cd5){if(_0x520cd5){return _0x5a7c99[_0x47c9('0x19')](_0x1d36cb);}return _0x5a7c99[_0x47c9('0x1a')](_0x1d36cb)['end']();};}function respondWithResult(_0x92aa48,_0xf06a4c){_0xf06a4c=_0xf06a4c||0xc8;return function(_0xf735ff){if(_0xf735ff){return _0x92aa48[_0x47c9('0x1a')](_0xf06a4c)[_0x47c9('0x1b')](_0xf735ff);}};}function respondWithFilteredResult(_0x285b46,_0x7944df){return function(_0x1f6453){if(_0x1f6453){var _0xfa27ea=_0x1f6453[_0x47c9('0x1c')],_0x49298f=_0x7944df[_0x47c9('0x1d')],_0x1c9183=_0x7944df[_0x47c9('0x1d')]+_0x7944df[_0x47c9('0x1e')],_0x545de3;if(_0x1c9183>=_0xfa27ea){_0x1c9183=_0xfa27ea;_0x545de3=0xc8;}else{_0x545de3=0xce;}_0x285b46[_0x47c9('0x1a')](_0x545de3);return _0x285b46[_0x47c9('0x1f')](_0x47c9('0x20'),_0x49298f+'-'+_0x1c9183+'/'+_0xfa27ea)['json'](_0x1f6453);}return null;};}function patchUpdates(_0x5c1cdc){return function(_0x1d5268){try{jsonpatch['apply'](_0x1d5268,_0x5c1cdc,!![]);}catch(_0x3d23f8){return BPromise[_0x47c9('0x21')](_0x3d23f8);}return _0x1d5268[_0x47c9('0x22')]();};}function saveUpdates(_0x18c664,_0xfc275){return function(_0x198479){if(_0x198479){return _0x198479[_0x47c9('0x23')](_0x18c664)['then'](function(_0x4f0670){return _0x4f0670;});}return null;};}function removeEntity(_0xaa407d,_0xa09ba2){return function(_0x3e5f07){if(_0x3e5f07){return _0x3e5f07[_0x47c9('0x24')]()[_0x47c9('0x25')](function(){_0xaa407d[_0x47c9('0x1a')](0xcc)[_0x47c9('0x26')]();});}};}function handleEntityNotFound(_0x399a80,_0x597a84){return function(_0x2ef68e){if(!_0x2ef68e){_0x399a80['sendStatus'](0x194);}return _0x2ef68e;};}function handleError(_0x5a90c1,_0x43d1c8){_0x43d1c8=_0x43d1c8||0x1f4;return function(_0x3be1b8){logger['error'](_0x3be1b8[_0x47c9('0x27')]);if(_0x3be1b8[_0x47c9('0x28')]){delete _0x3be1b8[_0x47c9('0x28')];}_0x5a90c1['status'](_0x43d1c8)[_0x47c9('0x29')](_0x3be1b8);};}exports['index']=function(_0x2d0327,_0x53006e){var _0x31b968={},_0xb86620={},_0x538a69={'count':0x0,'rows':[]};var _0x49eaa4=_[_0x47c9('0x2a')](db[_0x47c9('0x2b')][_0x47c9('0x2c')],function(_0x5e41ce){return{'name':_0x5e41ce['fieldName'],'type':_0x5e41ce[_0x47c9('0x2d')]['key']};});_0xb86620[_0x47c9('0x2e')]=_['map'](_0x49eaa4,_0x47c9('0x28'));_0xb86620['query']=_[_0x47c9('0x2f')](_0x2d0327['query']);_0xb86620[_0x47c9('0x30')]=_['intersection'](_0xb86620[_0x47c9('0x2e')],_0xb86620[_0x47c9('0x31')]);_0x31b968[_0x47c9('0x32')]=_['intersection'](_0xb86620['model'],qs[_0x47c9('0x33')](_0x2d0327[_0x47c9('0x31')][_0x47c9('0x33')]));_0x31b968['attributes']=_0x31b968['attributes'][_0x47c9('0x34')]?_0x31b968[_0x47c9('0x32')]:_0xb86620['model'];if(!_0x2d0327[_0x47c9('0x31')][_0x47c9('0x35')]('nolimit')){_0x31b968[_0x47c9('0x1e')]=qs[_0x47c9('0x1e')](_0x2d0327[_0x47c9('0x31')][_0x47c9('0x1e')]);_0x31b968['offset']=qs[_0x47c9('0x1d')](_0x2d0327[_0x47c9('0x31')][_0x47c9('0x1d')]);}_0x31b968[_0x47c9('0x36')]=qs['sort'](_0x2d0327[_0x47c9('0x31')][_0x47c9('0x37')]);_0x31b968['where']=qs[_0x47c9('0x30')](_['pick'](_0x2d0327['query'],_0xb86620[_0x47c9('0x30')]));if(_0x2d0327[_0x47c9('0x31')]['filter']){_0x31b968[_0x47c9('0x38')]=_['merge'](_0x31b968[_0x47c9('0x38')],{'$or':_['map'](_0x49eaa4,function(_0x4832a2){if(_0x4832a2[_0x47c9('0x2d')]!=='VIRTUAL'){var _0x4d3155={};_0x4d3155[_0x4832a2[_0x47c9('0x28')]]={'$like':'%'+_0x2d0327[_0x47c9('0x31')][_0x47c9('0x39')]+'%'};return _0x4d3155;}})});}_0x31b968=_[_0x47c9('0x3a')]({},_0x31b968,_0x2d0327[_0x47c9('0x3b')]);var _0x19cca2={'where':_0x31b968[_0x47c9('0x38')]};return db['VoiceQueuesLog'][_0x47c9('0x1c')](_0x19cca2)[_0x47c9('0x25')](function(_0x1c2f1c){_0x538a69[_0x47c9('0x1c')]=_0x1c2f1c;if(_0x2d0327['query'][_0x47c9('0x3c')]){_0x31b968['include']=[{'all':!![]}];}return db[_0x47c9('0x2b')][_0x47c9('0x3d')](_0x31b968);})[_0x47c9('0x25')](function(_0x5d226c){_0x538a69[_0x47c9('0x3e')]=_0x5d226c;return _0x538a69;})['then'](respondWithFilteredResult(_0x53006e,_0x31b968))['catch'](handleError(_0x53006e,null));};exports[_0x47c9('0x3f')]=function(_0x26f9fe,_0x636cfc){var _0x408f3d={'raw':!![],'where':{'id':_0x26f9fe[_0x47c9('0x40')]['id']}},_0x805cc0={};_0x805cc0['model']=_['keys'](db[_0x47c9('0x2b')]['rawAttributes']);_0x805cc0[_0x47c9('0x31')]=_[_0x47c9('0x2f')](_0x26f9fe['query']);_0x805cc0[_0x47c9('0x30')]=_[_0x47c9('0x41')](_0x805cc0['model'],_0x805cc0[_0x47c9('0x31')]);_0x408f3d['attributes']=_[_0x47c9('0x41')](_0x805cc0['model'],qs[_0x47c9('0x33')](_0x26f9fe[_0x47c9('0x31')][_0x47c9('0x33')]));_0x408f3d[_0x47c9('0x32')]=_0x408f3d[_0x47c9('0x32')][_0x47c9('0x34')]?_0x408f3d['attributes']:_0x805cc0[_0x47c9('0x2e')];if(_0x26f9fe[_0x47c9('0x31')][_0x47c9('0x3c')]){_0x408f3d['include']=[{'all':!![]}];}_0x408f3d=_[_0x47c9('0x3a')]({},_0x408f3d,_0x26f9fe[_0x47c9('0x3b')]);return db[_0x47c9('0x2b')][_0x47c9('0x42')](_0x408f3d)[_0x47c9('0x25')](handleEntityNotFound(_0x636cfc,null))[_0x47c9('0x25')](respondWithResult(_0x636cfc,null))[_0x47c9('0x43')](handleError(_0x636cfc,null));};exports[_0x47c9('0x44')]=function(_0x4adcec,_0x453734){return db['VoiceQueuesLog'][_0x47c9('0x44')](_0x4adcec[_0x47c9('0x45')],{})[_0x47c9('0x25')](respondWithResult(_0x453734,0xc9))['catch'](handleError(_0x453734,null));};exports[_0x47c9('0x23')]=function(_0x3ec753,_0x1f5d99){if(_0x3ec753[_0x47c9('0x45')]['id']){delete _0x3ec753[_0x47c9('0x45')]['id'];}return db[_0x47c9('0x2b')]['find']({'where':{'id':_0x3ec753[_0x47c9('0x40')]['id']}})[_0x47c9('0x25')](handleEntityNotFound(_0x1f5d99,null))[_0x47c9('0x25')](saveUpdates(_0x3ec753[_0x47c9('0x45')],null))[_0x47c9('0x25')](respondWithResult(_0x1f5d99,null))[_0x47c9('0x43')](handleError(_0x1f5d99,null));};exports['destroy']=function(_0x77ed4,_0x376e4c){return db[_0x47c9('0x2b')][_0x47c9('0x42')]({'where':{'id':_0x77ed4[_0x47c9('0x40')]['id']}})[_0x47c9('0x25')](handleEntityNotFound(_0x376e4c,null))[_0x47c9('0x25')](removeEntity(_0x376e4c,null))[_0x47c9('0x43')](handleError(_0x376e4c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index af391ea..108a683 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 _0x794c=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','moment','bluebird','request-promise','path'];(function(_0x48a3c7,_0x4ee49d){var _0xbe95c2=function(_0x11af07){while(--_0x11af07){_0x48a3c7['push'](_0x48a3c7['shift']());}};_0xbe95c2(++_0x4ee49d);}(_0x794c,0x78));var _0xc794=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x794c[_0x390a19];return _0x5d8230;};'use strict';var _=require(_0xc794('0x0'));var util=require(_0xc794('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc794('0x2'));var BPromise=require(_0xc794('0x3'));var rp=require(_0xc794('0x4'));var fs=require('fs');var path=require(_0xc794('0x5'));var rimraf=require(_0xc794('0x6'));var config=require(_0xc794('0x7'));var attributes=require(_0xc794('0x8'));module[_0xc794('0x9')]=function(_0x25e6da,_0xe10a81){return _0x25e6da['define'](_0xc794('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc794('0xb'),'fields':[_0xc794('0xc'),_0xc794('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1f33=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment'];(function(_0x5ee386,_0x4d13e2){var _0x460e52=function(_0x4bdc85){while(--_0x4bdc85){_0x5ee386['push'](_0x5ee386['shift']());}};_0x460e52(++_0x4d13e2);}(_0x1f33,0x190));var _0x31f3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1f33[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x31f3('0x0'));var util=require(_0x31f3('0x1'));var logger=require(_0x31f3('0x2'))(_0x31f3('0x3'));var moment=require(_0x31f3('0x4'));var BPromise=require(_0x31f3('0x5'));var rp=require(_0x31f3('0x6'));var fs=require('fs');var path=require(_0x31f3('0x7'));var rimraf=require(_0x31f3('0x8'));var config=require(_0x31f3('0x9'));var attributes=require(_0x31f3('0xa'));module['exports']=function(_0x26428b,_0xbd444){return _0x26428b['define']('VoiceQueuesLog',attributes,{'tableName':_0x31f3('0xb'),'paranoid':![],'indexes':[{'name':_0x31f3('0xc'),'fields':[_0x31f3('0xd'),_0x31f3('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index f71d57f..ac763f9 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 _0x9354=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error'];(function(_0xeabe82,_0x187d88){var _0xafe91=function(_0x1f50b0){while(--_0x1f50b0){_0xeabe82['push'](_0xeabe82['shift']());}};_0xafe91(++_0x187d88);}(_0x9354,0x96));var _0x4935=function(_0xf973b7,_0x46699f){_0xf973b7=_0xf973b7-0x0;var _0x499087=_0x9354[_0xf973b7];return _0x499087;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});} \ No newline at end of file +var _0x2f68=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug'];(function(_0x24a89b,_0x13705c){var _0x28f6b3=function(_0x165428){while(--_0x165428){_0x24a89b['push'](_0x24a89b['shift']());}};_0x28f6b3(++_0x13705c);}(_0x2f68,0x9a));var _0x82f6=function(_0x3ed078,_0x345631){_0x3ed078=_0x3ed078-0x0;var _0x31ff17=_0x2f68[_0x3ed078];return _0x31ff17;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index dc50ad9..940f63c 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 _0x3641=['connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','post','put','update','delete','destroy','util','path'];(function(_0x28c367,_0x14727d){var _0x431c80=function(_0x35aabd){while(--_0x35aabd){_0x28c367['push'](_0x28c367['shift']());}};_0x431c80(++_0x14727d);}(_0x3641,0x1ec));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x1364('0x0'));var path=require(_0x1364('0x1'));var timeout=require(_0x1364('0x2'));var express=require('express');var router=express[_0x1364('0x3')]();var auth=require(_0x1364('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1364('0x5'));var controller=require(_0x1364('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1364('0x7')]);router[_0x1364('0x8')](_0x1364('0x9'),auth[_0x1364('0xa')](),controller[_0x1364('0xb')]);router['get'](_0x1364('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1364('0x8')](_0x1364('0xd'),auth[_0x1364('0xa')](),controller['download']);router['get']('/:id/downloads',controller['downloads']);router[_0x1364('0xe')]('/',auth[_0x1364('0xa')](),controller['create']);router[_0x1364('0xf')](_0x1364('0xc'),auth['isAuthenticated'](),controller[_0x1364('0x10')]);router[_0x1364('0x11')]('/:id',auth[_0x1364('0xa')](),controller[_0x1364('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9415=['/:id/downloads','create','put','update','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','describe','get','/:id','show','/:id/download'];(function(_0x59ac4f,_0xa1c039){var _0x7fb93d=function(_0x555821){while(--_0x555821){_0x59ac4f['push'](_0x59ac4f['shift']());}};_0x7fb93d(++_0xa1c039);}(_0x9415,0x147));var _0x5941=function(_0xe86041,_0x2fbd7b){_0xe86041=_0xe86041-0x0;var _0x1230a9=_0x9415[_0xe86041];return _0x1230a9;};'use strict';var multer=require('multer');var util=require(_0x5941('0x0'));var path=require(_0x5941('0x1'));var timeout=require(_0x5941('0x2'));var express=require(_0x5941('0x3'));var router=express[_0x5941('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5941('0x5'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x5941('0x6')](),controller[_0x5941('0x7')]);router['get']('/describe',auth[_0x5941('0x6')](),controller[_0x5941('0x8')]);router[_0x5941('0x9')](_0x5941('0xa'),auth[_0x5941('0x6')](),controller[_0x5941('0xb')]);router[_0x5941('0x9')](_0x5941('0xc'),auth[_0x5941('0x6')](),controller['download']);router[_0x5941('0x9')](_0x5941('0xd'),controller['downloads']);router['post']('/',auth[_0x5941('0x6')](),controller[_0x5941('0xe')]);router[_0x5941('0xf')]('/:id',auth[_0x5941('0x6')](),controller[_0x5941('0x10')]);router['delete'](_0x5941('0xa'),auth[_0x5941('0x6')](),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 0854b06..e4a1a92 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 _0x8fab=['value','extname','setDataValue','channel','membername','split','STRING','INTEGER','DATE','getDataValue','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','VIRTUAL'];(function(_0x42aa78,_0x20e518){var _0x462067=function(_0x1addad){while(--_0x1addad){_0x42aa78['push'](_0x42aa78['shift']());}};_0x462067(++_0x20e518);}(_0x8fab,0x1ea));var _0xb8fa=function(_0x4943ac,_0x164683){_0x4943ac=_0x4943ac-0x0;var _0xdc1610=_0x8fab[_0x4943ac];return _0xdc1610;};'use strict';var Sequelize=require(_0xb8fa('0x0'));var moment=require(_0xb8fa('0x1'));var path=require(_0xb8fa('0x2'));module['exports']={'format':{'type':Sequelize[_0xb8fa('0x3')],'get':function(){return this['getDataValue'](_0xb8fa('0x4'))?path[_0xb8fa('0x5')](this['getDataValue'](_0xb8fa('0x4'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING'],'set':function(_0x4c84a6){if(_0x4c84a6){this[_0xb8fa('0x6')](_0xb8fa('0x7'),_0x4c84a6);this[_0xb8fa('0x6')](_0xb8fa('0x8'),_0x4c84a6[_0xb8fa('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xb8fa('0xa')]},'calleridnum':{'type':Sequelize[_0xb8fa('0xa')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb8fa('0xa')]},'context':{'type':Sequelize[_0xb8fa('0xa')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xb8fa('0xa')]},'type':{'type':Sequelize[_0xb8fa('0xa')]},'rating':{'type':Sequelize[_0xb8fa('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xb8fa('0xa')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xb8fa('0xc')],'get':function(){return moment(this[_0xb8fa('0xd')](_0xb8fa('0xe')))[_0xb8fa('0xf')](_0xb8fa('0x10'))[_0xb8fa('0x11')]();}},'updatedAt':{'type':Sequelize[_0xb8fa('0xc')],'get':function(){return moment(this[_0xb8fa('0xd')](_0xb8fa('0x12')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xbd5a=['INTEGER','DATE','MM-DD-YYYY\x20HH:mm','toString','updatedAt','format','sequelize','moment','path','VIRTUAL','getDataValue','extname','STRING','setDataValue','channel','membername','split'];(function(_0x2f50db,_0x29205b){var _0x345e51=function(_0x511551){while(--_0x511551){_0x2f50db['push'](_0x2f50db['shift']());}};_0x345e51(++_0x29205b);}(_0xbd5a,0x7d));var _0xabd5=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbd5a[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0xabd5('0x0'));var moment=require(_0xabd5('0x1'));var path=require(_0xabd5('0x2'));module['exports']={'format':{'type':Sequelize[_0xabd5('0x3')],'get':function(){return this[_0xabd5('0x4')]('value')?path[_0xabd5('0x5')](this[_0xabd5('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xabd5('0x6')],'set':function(_0x2dabff){if(_0x2dabff){this[_0xabd5('0x7')](_0xabd5('0x8'),_0x2dabff);this[_0xabd5('0x7')](_0xabd5('0x9'),_0x2dabff[_0xabd5('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xabd5('0x6')]},'calleridname':{'type':Sequelize[_0xabd5('0x6')]},'connectedlinenum':{'type':Sequelize[_0xabd5('0x6')]},'connectedlinename':{'type':Sequelize[_0xabd5('0x6')]},'accountcode':{'type':Sequelize[_0xabd5('0x6')]},'context':{'type':Sequelize[_0xabd5('0x6')]},'exten':{'type':Sequelize[_0xabd5('0x6')]},'value':{'type':Sequelize[_0xabd5('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0xabd5('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xabd5('0x6')]},'userDisposition':{'type':Sequelize[_0xabd5('0x6')]},'createdAt':{'type':Sequelize[_0xabd5('0xc')],'get':function(){return moment(this[_0xabd5('0x4')]('createdAt'))['format'](_0xabd5('0xd'))[_0xabd5('0xe')]();}},'updatedAt':{'type':Sequelize[_0xabd5('0xc')],'get':function(){return moment(this[_0xabd5('0x4')](_0xabd5('0xf')))[_0xabd5('0x10')](_0xabd5('0xd'))[_0xabd5('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 2a5cb8b..f9ed426 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 _0xd7d1=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','VoiceRecording','includeAll','findAll','show','include','find','create','body','catch','params','describe','download','../../components/encryptor','type','uniqueid','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','ValidationError','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','stack','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x320899,_0x4897aa){var _0x34a1fe=function(_0x162321){while(--_0x162321){_0x320899['push'](_0x320899['shift']());}};_0x34a1fe(++_0x4897aa);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x415b58,_0x5de065){_0x415b58=_0x415b58-0x0;var _0x4d63bb=_0xd7d1[_0x415b58];return _0x4d63bb;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require(_0x1d7d('0x1'));var rimraf=require(_0x1d7d('0x2'));var zipdir=require(_0x1d7d('0x3'));var jsonpatch=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var moment=require(_0x1d7d('0x6'));var BPromise=require(_0x1d7d('0x7'));var Mustache=require(_0x1d7d('0x8'));var util=require(_0x1d7d('0x9'));var path=require(_0x1d7d('0xa'));var sox=require(_0x1d7d('0xb'));var csv=require(_0x1d7d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xc'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var db=require(_0x1d7d('0x1b'))['db'];function respondWithStatusCode(_0x5c7445,_0x11b83f){_0x11b83f=_0x11b83f||0xcc;return function(_0x5ae1c9){if(_0x5ae1c9){return _0x5c7445['sendStatus'](_0x11b83f);}return _0x5c7445[_0x1d7d('0x1c')](_0x11b83f)[_0x1d7d('0x1d')]();};}function respondWithResult(_0x5dd438,_0x55dba7){_0x55dba7=_0x55dba7||0xc8;return function(_0x1d3822){if(_0x1d3822){return _0x5dd438[_0x1d7d('0x1c')](_0x55dba7)[_0x1d7d('0x1e')](_0x1d3822);}};}function respondWithFilteredResult(_0x183fc6,_0xeb05b3){return function(_0x53423f){if(_0x53423f){var _0x28adf3=_0x53423f[_0x1d7d('0x1f')],_0x1de6cc=_0xeb05b3[_0x1d7d('0x20')],_0x51cbca=_0xeb05b3[_0x1d7d('0x20')]+_0xeb05b3[_0x1d7d('0x21')],_0xb90a8c;if(_0x51cbca>=_0x28adf3){_0x51cbca=_0x28adf3;_0xb90a8c=0xc8;}else{_0xb90a8c=0xce;}_0x183fc6['status'](_0xb90a8c);return _0x183fc6[_0x1d7d('0x22')](_0x1d7d('0x23'),_0x1de6cc+'-'+_0x51cbca+'/'+_0x28adf3)['json'](_0x53423f);}return null;};}function patchUpdates(_0x495212){return function(_0x2406dd){try{jsonpatch[_0x1d7d('0x24')](_0x2406dd,_0x495212,!![]);}catch(_0x2a9f2b){return BPromise[_0x1d7d('0x25')](_0x2a9f2b);}return _0x2406dd[_0x1d7d('0x26')]();};}function saveUpdates(_0x275d3c,_0x54d401){return function(_0x225f85){if(_0x225f85){return _0x225f85[_0x1d7d('0x27')](_0x275d3c)[_0x1d7d('0x28')](function(_0x5692d9){return _0x5692d9;});}return null;};}function removeEntity(_0x29caf4,_0x12c54b){return function(_0x4a1cdc){if(_0x4a1cdc){return _0x4a1cdc['destroy']()[_0x1d7d('0x28')](function(){_0x29caf4[_0x1d7d('0x1c')](0xcc)[_0x1d7d('0x1d')]();});}};}function handleEntityNotFound(_0x5097b8,_0x377653){return function(_0x106376){if(!_0x106376){_0x5097b8[_0x1d7d('0x29')](0x194);}return _0x106376;};}function handleError(_0x21e59,_0x4fa346){_0x4fa346=_0x4fa346||0x1f4;return function(_0x233463){logger[_0x1d7d('0x2a')](_0x233463['stack']);if(_0x233463['name']){delete _0x233463[_0x1d7d('0x2b')];}_0x21e59['status'](_0x4fa346)[_0x1d7d('0x2c')](_0x233463);};}exports[_0x1d7d('0x2d')]=function(_0x3bc6e8,_0x22c40d){var _0x465938={},_0x59f827={},_0x1c2616={'count':0x0,'rows':[]};var _0x98c1ad=_[_0x1d7d('0x2e')](db['VoiceRecording'][_0x1d7d('0x2f')],function(_0x1a935a){return{'name':_0x1a935a[_0x1d7d('0x30')],'type':_0x1a935a['type']['key']};});_0x59f827['model']=_[_0x1d7d('0x31')](_[_0x1d7d('0x2e')](_0x98c1ad,'name'),[_0x1d7d('0x32')]);_0x59f827[_0x1d7d('0x33')]=_[_0x1d7d('0x34')](_0x3bc6e8[_0x1d7d('0x33')]);_0x59f827[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x59f827[_0x1d7d('0x37')],_0x59f827[_0x1d7d('0x33')]);_0x465938[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0x59f827['model'],qs['fields'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x39')]));_0x465938[_0x1d7d('0x38')]=_0x465938[_0x1d7d('0x38')][_0x1d7d('0x3a')]?_0x465938[_0x1d7d('0x38')]:_0x59f827[_0x1d7d('0x37')];if(!_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3b')]('nolimit')){_0x465938[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x21')]);_0x465938['offset']=qs['offset'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x20')]);}_0x465938['order']=qs[_0x1d7d('0x3c')](_0x3bc6e8[_0x1d7d('0x33')]['sort']);_0x465938['where']=qs[_0x1d7d('0x35')](_[_0x1d7d('0x3d')](_0x3bc6e8[_0x1d7d('0x33')],_0x59f827[_0x1d7d('0x35')]));if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3e')]){_0x465938[_0x1d7d('0x3f')]=_[_0x1d7d('0x40')](_0x465938[_0x1d7d('0x3f')],{'$or':_[_0x1d7d('0x2e')](_0x98c1ad,function(_0x4fcdcc){if(_0x4fcdcc['type']!=='VIRTUAL'){var _0x5cab41={};_0x5cab41[_0x4fcdcc[_0x1d7d('0x2b')]]={'$like':'%'+_0x3bc6e8['query'][_0x1d7d('0x3e')]+'%'};return _0x5cab41;}})});}_0x465938=_[_0x1d7d('0x40')]({},_0x465938,_0x3bc6e8[_0x1d7d('0x41')]);var _0x515199={'where':_0x465938[_0x1d7d('0x3f')]};return db[_0x1d7d('0x42')][_0x1d7d('0x1f')](_0x515199)['then'](function(_0x1a6a8c){_0x1c2616[_0x1d7d('0x1f')]=_0x1a6a8c;if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x465938['include']=[{'all':!![]}];}return db[_0x1d7d('0x42')][_0x1d7d('0x44')](_0x465938);})[_0x1d7d('0x28')](function(_0x456d51){_0x1c2616['rows']=_0x456d51;return _0x1c2616;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x22c40d,_0x465938))['catch'](handleError(_0x22c40d,null));};exports[_0x1d7d('0x45')]=function(_0x31b850,_0x671580){var _0x1106d1={'raw':![],'where':{'id':_0x31b850['params']['id']}},_0xf667a1={};_0xf667a1['model']=_[_0x1d7d('0x34')](db[_0x1d7d('0x42')][_0x1d7d('0x2f')]);_0xf667a1['query']=_['keys'](_0x31b850[_0x1d7d('0x33')]);_0xf667a1['filters']=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],_0xf667a1[_0x1d7d('0x33')]);_0x1106d1[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],qs[_0x1d7d('0x39')](_0x31b850['query'][_0x1d7d('0x39')]));_0x1106d1[_0x1d7d('0x38')]=_0x1106d1['attributes'][_0x1d7d('0x3a')]?_0x1106d1[_0x1d7d('0x38')]:_0xf667a1[_0x1d7d('0x37')];if(_0x31b850[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x1106d1[_0x1d7d('0x46')]=[{'all':!![]}];}_0x1106d1=_[_0x1d7d('0x40')]({},_0x1106d1,_0x31b850[_0x1d7d('0x41')]);return db[_0x1d7d('0x42')][_0x1d7d('0x47')](_0x1106d1)[_0x1d7d('0x28')](handleEntityNotFound(_0x671580,null))[_0x1d7d('0x28')](respondWithResult(_0x671580,null))['catch'](handleError(_0x671580,null));};exports[_0x1d7d('0x48')]=function(_0x5904e0,_0xbfe60){return db['VoiceRecording'][_0x1d7d('0x48')](_0x5904e0[_0x1d7d('0x49')],{})[_0x1d7d('0x28')](respondWithResult(_0xbfe60,0xc9))[_0x1d7d('0x4a')](handleError(_0xbfe60,null));};exports['update']=function(_0x2dbb61,_0x5535d4){if(_0x2dbb61['body']['id']){delete _0x2dbb61[_0x1d7d('0x49')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x2dbb61[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5535d4,null))['then'](saveUpdates(_0x2dbb61[_0x1d7d('0x49')],null))[_0x1d7d('0x28')](respondWithResult(_0x5535d4,null))['catch'](handleError(_0x5535d4,null));};exports[_0x1d7d('0x4c')]=function(_0x2b9faa,_0xa64dbe){return db[_0x1d7d('0x42')]['describe']()['then'](respondWithResult(_0xa64dbe,null))[_0x1d7d('0x4a')](handleError(_0xa64dbe,null));};exports[_0x1d7d('0x4d')]=function(_0x35ff5d,_0x3938d0,_0x3cc5b7){var _0x550c9f=require(_0x1d7d('0x4e'));var _0x24e0b7=![];var _0x344b66={};if(_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]===_0x1d7d('0x50')){_0x344b66[_0x1d7d('0x50')]=_0x35ff5d['params']['id'];}else{_0x344b66['id']=_0x35ff5d[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x344b66,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3938d0,null))[_0x1d7d('0x28')](function(_0x2d4cc3){if(_0x2d4cc3){var _0x3f5434=_0x2d4cc3['value'];var _0x7f41e=util[_0x1d7d('0x32')]('%s.cypher',_0x3f5434);if(fs[_0x1d7d('0x51')](_0x7f41e)){_0x24e0b7=!![];return _0x550c9f[_0x1d7d('0x52')](_0x7f41e,_0x3f5434,config[_0x1d7d('0x53')][_0x1d7d('0x54')])['then'](function(){return _0x2d4cc3;});}return _0x2d4cc3;}})[_0x1d7d('0x28')](function(_0x202af4){if(_0x202af4){var _0x4ba6ec=_0x202af4['value'];if(!fs[_0x1d7d('0x51')](_0x4ba6ec)){throw new db[(_0x1d7d('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x202af4[_0x1d7d('0x56')]){return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,_0x202af4[_0x1d7d('0x56')]+path[_0x1d7d('0x57')](_0x4ba6ec),function(){if(_0x24e0b7){fs['unlink'](_0x4ba6ec);}});}else{return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,function(_0x4b7a81){if(_0x24e0b7){fs[_0x1d7d('0x58')](_0x4ba6ec);}});}}})[_0x1d7d('0x4a')](function(_0x14078d){if(_0x14078d[_0x1d7d('0x59')]==='VoiceRecording\x20not\x20found'){_0x3938d0[_0x1d7d('0x1c')](0x194)[_0x1d7d('0x2c')](_0x1d7d('0x5a'));}else{return handleError(_0x3938d0,null);}});};exports[_0x1d7d('0x5b')]=function(_0x28ec14,_0x1cafd4,_0x17a365){var _0x2bd2a0=require(_0x1d7d('0x4e'));var _0x17c967=![];var _0x44a187={'$and':[db[_0x1d7d('0x5c')][_0x1d7d('0x3f')](db[_0x1d7d('0x5c')]['fn'](_0x1d7d('0x5d'),db['sequelize'][_0x1d7d('0x5e')]('uniqueid')),_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x5f')])]};if(_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]==='uniqueid'){_0x44a187[_0x1d7d('0x60')][_0x1d7d('0x61')]({'uniqueid':_0x28ec14['params']['id']});}else{_0x44a187[_0x1d7d('0x60')]['push']({'id':_0x28ec14[_0x1d7d('0x4b')]['id']});}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x44a187,'attributes':['id',_0x1d7d('0x62')],'raw':!![]})[_0x1d7d('0x28')](handleEntityNotFound(_0x1cafd4,null))[_0x1d7d('0x28')](function(_0x516aa0){if(_0x516aa0){var _0x3768a7=util[_0x1d7d('0x32')]('%s.cypher',_0x516aa0[_0x1d7d('0x62')]);if(fs[_0x1d7d('0x51')](_0x3768a7)){_0x17c967=!![];return _0x2bd2a0[_0x1d7d('0x52')](_0x3768a7,_0x516aa0['value'],config[_0x1d7d('0x53')][_0x1d7d('0x54')])[_0x1d7d('0x28')](function(){return _0x516aa0;});}return _0x516aa0;}})[_0x1d7d('0x28')](function(_0x5f15b7){if(_0x5f15b7){if(!fs[_0x1d7d('0x51')](_0x5f15b7[_0x1d7d('0x62')])){throw new db[(_0x1d7d('0x55'))][(_0x1d7d('0x63'))](_0x1d7d('0x64'));}if(_0x5f15b7['filename']){return _0x1cafd4[_0x1d7d('0x4d')](_0x5f15b7[_0x1d7d('0x62')],_0x5f15b7['filename']+path[_0x1d7d('0x57')](_0x5f15b7[_0x1d7d('0x62')]),function(){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}else{return _0x1cafd4['download'](_0x5f15b7[_0x1d7d('0x62')],function(_0x4a3159){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}}})[_0x1d7d('0x4a')](handleError(_0x1cafd4,null));};exports['destroy']=function(_0x4de5ee,_0x3818f4){return db[_0x1d7d('0x42')]['find']({'where':{'id':_0x4de5ee[_0x1d7d('0x4b')]['id']}})['then'](function(_0x6e9ee6){if(!_0x6e9ee6)throw new ReferenceError(_0x1d7d('0x65'));return _0x6e9ee6;})[_0x1d7d('0x28')](function(_0x446d39){var _0x30cf98=_0x446d39[_0x1d7d('0x62')];logger[_0x1d7d('0x66')](_0x1d7d('0x67'),_0x30cf98);if(!_[_0x1d7d('0x68')](_0x446d39[_0x1d7d('0x62')])&&fs[_0x1d7d('0x51')](_0x30cf98)){logger['info']('File:\x20\x22'+_0x30cf98+_0x1d7d('0x69'));fs[_0x1d7d('0x6a')](_0x30cf98);}_0x30cf98=_0x30cf98+_0x1d7d('0x6b');if(!_['isNil'](_0x446d39[_0x1d7d('0x62')])&&fs['existsSync'](_0x30cf98)){logger[_0x1d7d('0x66')](_0x1d7d('0x6c')+_0x30cf98+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1d7d('0x6a')](_0x30cf98);}return _0x446d39;})[_0x1d7d('0x28')](function(_0x4a8f1f){if(!_0x4a8f1f)throw new InternalError();return _0x4a8f1f[_0x1d7d('0x6d')]();})[_0x1d7d('0x28')](function(){_0x3818f4[_0x1d7d('0x1c')](0xcc)['end']();})['catch'](function(_0x2f774f){var _0x87e6aa=0x1f4;if(e instanceof ReferenceError){_0x87e6aa=0x194;}else if(e instanceof InternalError){_0x87e6aa=0x1f4;}logger['error'](_0x2f774f[_0x1d7d('0x6e')]);if(_0x2f774f[_0x1d7d('0x2b')]){delete _0x2f774f[_0x1d7d('0x2b')];}_0x3818f4[_0x1d7d('0x1c')](_0x87e6aa)['send'](_0x2f774f);});}; \ No newline at end of file +var _0xda3f=['find','create','body','params','download','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','format','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','error','eml-format','rimraf','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x469c77,_0x241e7f){var _0x1cc8d0=function(_0x2820d4){while(--_0x2820d4){_0x469c77['push'](_0x469c77['shift']());}};_0x1cc8d0(++_0x241e7f);}(_0xda3f,0xec));var _0xfda3=function(_0x157864,_0x1c9d4d){_0x157864=_0x157864-0x0;var _0x34a6e9=_0xda3f[_0x157864];return _0x34a6e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfda3('0x0'));var rimraf=require(_0xfda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda3('0x3'));var util=require(_0xfda3('0x4'));var path=require('path');var sox=require(_0xfda3('0x5'));var csv=require(_0xfda3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x6'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var db=require(_0xfda3('0x15'))['db'];function respondWithStatusCode(_0x1443f4,_0x4b77ea){_0x4b77ea=_0x4b77ea||0xcc;return function(_0x583125){if(_0x583125){return _0x1443f4['sendStatus'](_0x4b77ea);}return _0x1443f4[_0xfda3('0x16')](_0x4b77ea)[_0xfda3('0x17')]();};}function respondWithResult(_0x4929fa,_0x501588){_0x501588=_0x501588||0xc8;return function(_0x587e9b){if(_0x587e9b){return _0x4929fa[_0xfda3('0x16')](_0x501588)[_0xfda3('0x18')](_0x587e9b);}};}function respondWithFilteredResult(_0x5ea793,_0x57a229){return function(_0x533365){if(_0x533365){var _0x80ea80=_0x533365[_0xfda3('0x19')],_0x474707=_0x57a229[_0xfda3('0x1a')],_0x249dc6=_0x57a229[_0xfda3('0x1a')]+_0x57a229[_0xfda3('0x1b')],_0x3d8bcd;if(_0x249dc6>=_0x80ea80){_0x249dc6=_0x80ea80;_0x3d8bcd=0xc8;}else{_0x3d8bcd=0xce;}_0x5ea793[_0xfda3('0x16')](_0x3d8bcd);return _0x5ea793[_0xfda3('0x1c')]('Content-Range',_0x474707+'-'+_0x249dc6+'/'+_0x80ea80)[_0xfda3('0x18')](_0x533365);}return null;};}function patchUpdates(_0x1bbdda){return function(_0x12d568){try{jsonpatch[_0xfda3('0x1d')](_0x12d568,_0x1bbdda,!![]);}catch(_0x59a887){return BPromise[_0xfda3('0x1e')](_0x59a887);}return _0x12d568[_0xfda3('0x1f')]();};}function saveUpdates(_0x2ee74c,_0x51e731){return function(_0x5ad52a){if(_0x5ad52a){return _0x5ad52a[_0xfda3('0x20')](_0x2ee74c)[_0xfda3('0x21')](function(_0x4ea9f5){return _0x4ea9f5;});}return null;};}function removeEntity(_0x545320,_0x3cf5a9){return function(_0xef2535){if(_0xef2535){return _0xef2535[_0xfda3('0x22')]()[_0xfda3('0x21')](function(){_0x545320[_0xfda3('0x16')](0xcc)[_0xfda3('0x17')]();});}};}function handleEntityNotFound(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(!_0x16eaa6){_0x2677f6['sendStatus'](0x194);}return _0x16eaa6;};}function handleError(_0x82341b,_0x2d5b44){_0x2d5b44=_0x2d5b44||0x1f4;return function(_0x2e8bf8){logger['error'](_0x2e8bf8[_0xfda3('0x23')]);if(_0x2e8bf8[_0xfda3('0x24')]){delete _0x2e8bf8[_0xfda3('0x24')];}_0x82341b[_0xfda3('0x16')](_0x2d5b44)[_0xfda3('0x25')](_0x2e8bf8);};}exports[_0xfda3('0x26')]=function(_0x514d2a,_0x3c6d7d){var _0x1e87fe={},_0x2bef2b={},_0x1f2884={'count':0x0,'rows':[]};var _0x33ffd4=_['map'](db[_0xfda3('0x27')][_0xfda3('0x28')],function(_0x301509){return{'name':_0x301509[_0xfda3('0x29')],'type':_0x301509[_0xfda3('0x2a')][_0xfda3('0x2b')]};});_0x2bef2b[_0xfda3('0x2c')]=_['differenceBy'](_['map'](_0x33ffd4,_0xfda3('0x24')),['format']);_0x2bef2b['query']=_[_0xfda3('0x2d')](_0x514d2a[_0xfda3('0x2e')]);_0x2bef2b[_0xfda3('0x2f')]=_[_0xfda3('0x30')](_0x2bef2b[_0xfda3('0x2c')],_0x2bef2b[_0xfda3('0x2e')]);_0x1e87fe[_0xfda3('0x31')]=_[_0xfda3('0x30')](_0x2bef2b[_0xfda3('0x2c')],qs['fields'](_0x514d2a[_0xfda3('0x2e')][_0xfda3('0x32')]));_0x1e87fe[_0xfda3('0x31')]=_0x1e87fe[_0xfda3('0x31')][_0xfda3('0x33')]?_0x1e87fe[_0xfda3('0x31')]:_0x2bef2b[_0xfda3('0x2c')];if(!_0x514d2a[_0xfda3('0x2e')][_0xfda3('0x34')]('nolimit')){_0x1e87fe['limit']=qs[_0xfda3('0x1b')](_0x514d2a[_0xfda3('0x2e')]['limit']);_0x1e87fe[_0xfda3('0x1a')]=qs[_0xfda3('0x1a')](_0x514d2a[_0xfda3('0x2e')]['offset']);}_0x1e87fe[_0xfda3('0x35')]=qs[_0xfda3('0x36')](_0x514d2a[_0xfda3('0x2e')][_0xfda3('0x36')]);_0x1e87fe[_0xfda3('0x37')]=qs['filters'](_[_0xfda3('0x38')](_0x514d2a[_0xfda3('0x2e')],_0x2bef2b[_0xfda3('0x2f')]));if(_0x514d2a['query'][_0xfda3('0x39')]){_0x1e87fe['where']=_[_0xfda3('0x3a')](_0x1e87fe[_0xfda3('0x37')],{'$or':_[_0xfda3('0x3b')](_0x33ffd4,function(_0x36a506){if(_0x36a506[_0xfda3('0x2a')]!==_0xfda3('0x3c')){var _0x151f32={};_0x151f32[_0x36a506[_0xfda3('0x24')]]={'$like':'%'+_0x514d2a['query'][_0xfda3('0x39')]+'%'};return _0x151f32;}})});}_0x1e87fe=_[_0xfda3('0x3a')]({},_0x1e87fe,_0x514d2a[_0xfda3('0x3d')]);var _0x8ed2ba={'where':_0x1e87fe['where']};return db[_0xfda3('0x27')][_0xfda3('0x19')](_0x8ed2ba)[_0xfda3('0x21')](function(_0x5bad90){_0x1f2884['count']=_0x5bad90;if(_0x514d2a[_0xfda3('0x2e')][_0xfda3('0x3e')]){_0x1e87fe[_0xfda3('0x3f')]=[{'all':!![]}];}return db[_0xfda3('0x27')][_0xfda3('0x40')](_0x1e87fe);})[_0xfda3('0x21')](function(_0x40b814){_0x1f2884[_0xfda3('0x41')]=_0x40b814;return _0x1f2884;})[_0xfda3('0x21')](respondWithFilteredResult(_0x3c6d7d,_0x1e87fe))[_0xfda3('0x42')](handleError(_0x3c6d7d,null));};exports['show']=function(_0x27200f,_0x22b848){var _0x5c3ac5={'raw':![],'where':{'id':_0x27200f['params']['id']}},_0x1cfa17={};_0x1cfa17['model']=_['keys'](db[_0xfda3('0x27')][_0xfda3('0x28')]);_0x1cfa17[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x27200f['query']);_0x1cfa17[_0xfda3('0x2f')]=_[_0xfda3('0x30')](_0x1cfa17[_0xfda3('0x2c')],_0x1cfa17[_0xfda3('0x2e')]);_0x5c3ac5['attributes']=_[_0xfda3('0x30')](_0x1cfa17[_0xfda3('0x2c')],qs[_0xfda3('0x32')](_0x27200f['query']['fields']));_0x5c3ac5[_0xfda3('0x31')]=_0x5c3ac5[_0xfda3('0x31')][_0xfda3('0x33')]?_0x5c3ac5[_0xfda3('0x31')]:_0x1cfa17[_0xfda3('0x2c')];if(_0x27200f[_0xfda3('0x2e')][_0xfda3('0x3e')]){_0x5c3ac5[_0xfda3('0x3f')]=[{'all':!![]}];}_0x5c3ac5=_[_0xfda3('0x3a')]({},_0x5c3ac5,_0x27200f[_0xfda3('0x3d')]);return db[_0xfda3('0x27')][_0xfda3('0x43')](_0x5c3ac5)[_0xfda3('0x21')](handleEntityNotFound(_0x22b848,null))[_0xfda3('0x21')](respondWithResult(_0x22b848,null))['catch'](handleError(_0x22b848,null));};exports['create']=function(_0x52b5c3,_0x2acde1){return db[_0xfda3('0x27')][_0xfda3('0x44')](_0x52b5c3[_0xfda3('0x45')],{})[_0xfda3('0x21')](respondWithResult(_0x2acde1,0xc9))[_0xfda3('0x42')](handleError(_0x2acde1,null));};exports[_0xfda3('0x20')]=function(_0x1372ee,_0x161fda){if(_0x1372ee['body']['id']){delete _0x1372ee[_0xfda3('0x45')]['id'];}return db[_0xfda3('0x27')][_0xfda3('0x43')]({'where':{'id':_0x1372ee[_0xfda3('0x46')]['id']}})[_0xfda3('0x21')](handleEntityNotFound(_0x161fda,null))['then'](saveUpdates(_0x1372ee[_0xfda3('0x45')],null))[_0xfda3('0x21')](respondWithResult(_0x161fda,null))[_0xfda3('0x42')](handleError(_0x161fda,null));};exports['describe']=function(_0x187402,_0x39c96f){return db[_0xfda3('0x27')]['describe']()[_0xfda3('0x21')](respondWithResult(_0x39c96f,null))[_0xfda3('0x42')](handleError(_0x39c96f,null));};exports[_0xfda3('0x47')]=function(_0x2f6e62,_0x1ab4a8,_0x49662b){var _0x3c49d9=require('../../components/encryptor');var _0x17fe20=![];var _0x587eef={};if(_0x2f6e62[_0xfda3('0x2e')][_0xfda3('0x2a')]&&_0x2f6e62[_0xfda3('0x2e')][_0xfda3('0x2a')]==='uniqueid'){_0x587eef[_0xfda3('0x48')]=_0x2f6e62[_0xfda3('0x46')]['id'];}else{_0x587eef['id']=_0x2f6e62[_0xfda3('0x46')]['id'];}return db[_0xfda3('0x27')][_0xfda3('0x43')]({'where':_0x587eef,'attributes':['id',_0xfda3('0x49')],'raw':!![]})[_0xfda3('0x21')](handleEntityNotFound(_0x1ab4a8,null))['then'](function(_0x4b1410){if(_0x4b1410){var _0x4fb214=_0x4b1410[_0xfda3('0x49')];var _0x218ee5=util['format']('%s.cypher',_0x4fb214);if(fs[_0xfda3('0x4a')](_0x218ee5)){_0x17fe20=!![];return _0x3c49d9[_0xfda3('0x4b')](_0x218ee5,_0x4fb214,config[_0xfda3('0x4c')][_0xfda3('0x4d')])[_0xfda3('0x21')](function(){return _0x4b1410;});}return _0x4b1410;}})['then'](function(_0xb3353b){if(_0xb3353b){var _0x2a30e8=_0xb3353b[_0xfda3('0x49')];if(!fs[_0xfda3('0x4a')](_0x2a30e8)){throw new db[(_0xfda3('0x4e'))][(_0xfda3('0x4f'))](_0xfda3('0x50'));}if(_0xb3353b[_0xfda3('0x51')]){return _0x1ab4a8[_0xfda3('0x47')](_0x2a30e8,_0xb3353b[_0xfda3('0x51')]+path[_0xfda3('0x52')](_0x2a30e8),function(){if(_0x17fe20){fs[_0xfda3('0x53')](_0x2a30e8);}});}else{return _0x1ab4a8['download'](_0x2a30e8,function(_0x28c8a9){if(_0x17fe20){fs[_0xfda3('0x53')](_0x2a30e8);}});}}})[_0xfda3('0x42')](function(_0x32c835){if(_0x32c835[_0xfda3('0x54')]===_0xfda3('0x50')){_0x1ab4a8[_0xfda3('0x16')](0x194)['send']('Not\x20found');}else{return handleError(_0x1ab4a8,null);}});};exports[_0xfda3('0x55')]=function(_0x35178a,_0x486e55,_0x29d503){var _0x178b06=require(_0xfda3('0x56'));var _0x38dbc7=![];var _0x58878c={'$and':[db['sequelize'][_0xfda3('0x37')](db[_0xfda3('0x57')]['fn'](_0xfda3('0x58'),db['sequelize'][_0xfda3('0x59')]('uniqueid')),_0x35178a[_0xfda3('0x2e')][_0xfda3('0x5a')])]};if(_0x35178a[_0xfda3('0x2e')][_0xfda3('0x2a')]&&_0x35178a[_0xfda3('0x2e')][_0xfda3('0x2a')]==='uniqueid'){_0x58878c[_0xfda3('0x5b')][_0xfda3('0x5c')]({'uniqueid':_0x35178a[_0xfda3('0x46')]['id']});}else{_0x58878c[_0xfda3('0x5b')][_0xfda3('0x5c')]({'id':_0x35178a['params']['id']});}return db['VoiceRecording'][_0xfda3('0x43')]({'where':_0x58878c,'attributes':['id',_0xfda3('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x486e55,null))['then'](function(_0x512d7b){if(_0x512d7b){var _0x248174=util[_0xfda3('0x5d')]('%s.cypher',_0x512d7b[_0xfda3('0x49')]);if(fs[_0xfda3('0x4a')](_0x248174)){_0x38dbc7=!![];return _0x178b06[_0xfda3('0x4b')](_0x248174,_0x512d7b[_0xfda3('0x49')],config['secrets'][_0xfda3('0x4d')])[_0xfda3('0x21')](function(){return _0x512d7b;});}return _0x512d7b;}})[_0xfda3('0x21')](function(_0x449d42){if(_0x449d42){if(!fs[_0xfda3('0x4a')](_0x449d42[_0xfda3('0x49')])){throw new db['Sequelize']['ValidationError'](_0xfda3('0x50'));}if(_0x449d42['filename']){return _0x486e55[_0xfda3('0x47')](_0x449d42[_0xfda3('0x49')],_0x449d42[_0xfda3('0x51')]+path[_0xfda3('0x52')](_0x449d42[_0xfda3('0x49')]),function(){if(_0x38dbc7){fs[_0xfda3('0x53')](_0x449d42[_0xfda3('0x49')]);}});}else{return _0x486e55[_0xfda3('0x47')](_0x449d42[_0xfda3('0x49')],function(_0x1eb4dc){if(_0x38dbc7){fs['unlink'](_0x449d42[_0xfda3('0x49')]);}});}}})['catch'](handleError(_0x486e55,null));};exports['destroy']=function(_0x197be4,_0x238762){return db['VoiceRecording'][_0xfda3('0x43')]({'where':{'id':_0x197be4[_0xfda3('0x46')]['id']}})[_0xfda3('0x21')](function(_0x589c7a){if(!_0x589c7a)throw new ReferenceError(_0xfda3('0x5e'));return _0x589c7a;})[_0xfda3('0x21')](function(_0x5b7684){var _0x28f4cd=_0x5b7684[_0xfda3('0x49')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x28f4cd);if(!_['isNil'](_0x5b7684[_0xfda3('0x49')])&&fs[_0xfda3('0x4a')](_0x28f4cd)){logger[_0xfda3('0x5f')](_0xfda3('0x60')+_0x28f4cd+_0xfda3('0x61'));fs[_0xfda3('0x62')](_0x28f4cd);}_0x28f4cd=_0x28f4cd+'.cypher';if(!_[_0xfda3('0x63')](_0x5b7684[_0xfda3('0x49')])&&fs[_0xfda3('0x4a')](_0x28f4cd)){logger[_0xfda3('0x5f')]('File:\x20\x22'+_0x28f4cd+_0xfda3('0x61'));fs['unlinkSync'](_0x28f4cd);}return _0x5b7684;})[_0xfda3('0x21')](function(_0x2672f0){if(!_0x2672f0)throw new InternalError();return _0x2672f0[_0xfda3('0x22')]();})[_0xfda3('0x21')](function(){_0x238762[_0xfda3('0x16')](0xcc)[_0xfda3('0x17')]();})[_0xfda3('0x42')](function(_0x5af4bd){var _0x31f143=0x1f4;if(e instanceof ReferenceError){_0x31f143=0x194;}else if(e instanceof InternalError){_0x31f143=0x1f4;}logger[_0xfda3('0x64')](_0x5af4bd[_0xfda3('0x23')]);if(_0x5af4bd[_0xfda3('0x24')]){delete _0x5af4bd[_0xfda3('0x24')];}_0x238762[_0xfda3('0x16')](_0x31f143)['send'](_0x5af4bd);});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6746370..18119be 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 _0x94ef=['rimraf','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','util','api','bluebird'];(function(_0xecab6a,_0x3c768a){var _0x40b98b=function(_0x448a28){while(--_0x448a28){_0xecab6a['push'](_0xecab6a['shift']());}};_0x40b98b(++_0x3c768a);}(_0x94ef,0x101));var _0xf94e=function(_0x86ab7d,_0x31b555){_0x86ab7d=_0x86ab7d-0x0;var _0xed9ebe=_0x94ef[_0x86ab7d];return _0xed9ebe;};'use strict';var _=require(_0xf94e('0x0'));var util=require(_0xf94e('0x1'));var logger=require('../../config/logger')(_0xf94e('0x2'));var moment=require('moment');var BPromise=require(_0xf94e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf94e('0x4'));var config=require('../../config/environment');var attributes=require(_0xf94e('0x5'));module[_0xf94e('0x6')]=function(_0x13d2b1,_0x5d17a7){return _0x13d2b1['define']('VoiceRecording',attributes,{'tableName':_0xf94e('0x7'),'paranoid':![],'indexes':[{'name':_0xf94e('0x8'),'fields':[_0xf94e('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ac3=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x4d653a,_0x3a30c2){var _0x4ab22d=function(_0x32c6c8){while(--_0x32c6c8){_0x4d653a['push'](_0x4d653a['shift']());}};_0x4ab22d(++_0x3a30c2);}(_0x0ac3,0x109));var _0x30ac=function(_0x33314d,_0x499628){_0x33314d=_0x33314d-0x0;var _0x4ffe8e=_0x0ac3[_0x33314d];return _0x4ffe8e;};'use strict';var _=require(_0x30ac('0x0'));var util=require('util');var logger=require(_0x30ac('0x1'))(_0x30ac('0x2'));var moment=require(_0x30ac('0x3'));var BPromise=require(_0x30ac('0x4'));var rp=require(_0x30ac('0x5'));var fs=require('fs');var path=require(_0x30ac('0x6'));var rimraf=require('rimraf');var config=require(_0x30ac('0x7'));var attributes=require(_0x30ac('0x8'));module[_0x30ac('0x9')]=function(_0x54cc95,_0x5c14aa){return _0x54cc95[_0x30ac('0xa')](_0x30ac('0xb'),attributes,{'tableName':_0x30ac('0xc'),'paranoid':![],'indexes':[{'name':_0x30ac('0xd'),'fields':[_0x30ac('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 50adfd3..09082b2 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 _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x56a1f0,_0x211471){var _0xc48f6=function(_0x463379){while(--_0x463379){_0x56a1f0['push'](_0x56a1f0['shift']());}};_0xc48f6(++_0x211471);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x138387,_0x2a16ac){var _0x45b15a=function(_0x37f412){while(--_0x37f412){_0x138387['push'](_0x138387['shift']());}};_0x45b15a(++_0x2a16ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 82cc4dc..1cffc7d 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 _0xacf4=['/:id','show','post','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4ec7f7,_0x78197e){var _0x32b2ba=function(_0x344167){while(--_0x344167){_0x4ec7f7['push'](_0x4ec7f7['shift']());}};_0x32b2ba(++_0x78197e);}(_0xacf4,0xe7));var _0x4acf=function(_0x2a2cfd,_0x274d1e){_0x2a2cfd=_0x2a2cfd-0x0;var _0x18c062=_0xacf4[_0x2a2cfd];return _0x18c062;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var auth=require(_0x4acf('0x4'));var interaction=require(_0x4acf('0x5'));var config=require(_0x4acf('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x4acf('0x7')]('/',auth[_0x4acf('0x8')](),controller['index']);router[_0x4acf('0x7')](_0x4acf('0x9'),auth[_0x4acf('0x8')](),controller[_0x4acf('0xa')]);router[_0x4acf('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4acf('0xc')]('/:id',auth[_0x4acf('0x8')](),controller[_0x4acf('0xd')]);router[_0x4acf('0xe')]('/:id',auth[_0x4acf('0x8')](),controller[_0x4acf('0xf')]);module['exports']=router; \ No newline at end of file +var _0x687b=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x687b,0x14a));var _0xb687=function(_0x2b7248,_0x17b24e){_0x2b7248=_0x2b7248-0x0;var _0x418838=_0x687b[_0x2b7248];return _0x418838;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb687('0x4'));var interaction=require(_0xb687('0x5'));var config=require(_0xb687('0x6'));var controller=require(_0xb687('0x7'));router[_0xb687('0x8')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xa')]);router[_0xb687('0x8')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller['show']);router[_0xb687('0xc')]('/',auth[_0xb687('0x9')](),controller['create']);router[_0xb687('0xd')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller[_0xb687('0x10')]);module[_0xb687('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 042186a..e6c639b 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 _0xaa72=['attended','STRING','ENUM','Yes','moment','exports','blind'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa72,0x170));var _0x2aa7=function(_0x10bf81,_0x125aa3){_0x10bf81=_0x10bf81-0x0;var _0xb5fb34=_0xaa72[_0x10bf81];return _0xb5fb34;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2aa7('0x0'));module[_0x2aa7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2aa7('0x2'),_0x2aa7('0x3'))},'result':{'type':Sequelize[_0x2aa7('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x2aa7('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x2aa7('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x2aa7('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x2aa7('0x4')]},'transferercontext':{'type':Sequelize[_0x2aa7('0x4')]},'transfererexten':{'type':Sequelize[_0x2aa7('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x2aa7('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x2aa7('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x2aa7('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x2aa7('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x2aa7('0x4')]},'transfereecontext':{'type':Sequelize[_0x2aa7('0x4')]},'transfereeexten':{'type':Sequelize[_0x2aa7('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x2aa7('0x4')]},'isexternal':{'type':Sequelize[_0x2aa7('0x5')](_0x2aa7('0x6'),'No')},'context':{'type':Sequelize[_0x2aa7('0x4')]},'extension':{'type':Sequelize[_0x2aa7('0x4')]}}; \ No newline at end of file +var _0x3b18=['moment','exports','ENUM','STRING','Yes','sequelize'];(function(_0x3c623f,_0x55efeb){var _0xcd5f57=function(_0x47b121){while(--_0x47b121){_0x3c623f['push'](_0x3c623f['shift']());}};_0xcd5f57(++_0x55efeb);}(_0x3b18,0xb3));var _0x83b1=function(_0x4c8c10,_0x4f7743){_0x4c8c10=_0x4c8c10-0x0;var _0x3714c5=_0x3b18[_0x4c8c10];return _0x3714c5;};'use strict';var Sequelize=require(_0x83b1('0x0'));var moment=require(_0x83b1('0x1'));module[_0x83b1('0x2')]={'type':{'type':Sequelize[_0x83b1('0x3')]('blind','attended')},'result':{'type':Sequelize[_0x83b1('0x4')]},'transfererchannel':{'type':Sequelize[_0x83b1('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x83b1('0x4')]},'transferercalleridname':{'type':Sequelize[_0x83b1('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x83b1('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x83b1('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x83b1('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x83b1('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x83b1('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x83b1('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x83b1('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x83b1('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x83b1('0x4')]},'transfereecontext':{'type':Sequelize[_0x83b1('0x4')]},'transfereeexten':{'type':Sequelize[_0x83b1('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x83b1('0x4')]},'isexternal':{'type':Sequelize[_0x83b1('0x3')](_0x83b1('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x83b1('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 18ef9bf..86991b2 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 _0x878f=['then','destroy','error','stack','name','index','map','VoiceTransferReport','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0x878f,0x173));var _0xf878=function(_0x702b70,_0x4e0989){_0x702b70=_0x702b70-0x0;var _0x3b9cb2=_0x878f[_0x702b70];return _0x3b9cb2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf878('0x0'));var rimraf=require(_0xf878('0x1'));var zipdir=require(_0xf878('0x2'));var jsonpatch=require(_0xf878('0x3'));var rp=require(_0xf878('0x4'));var moment=require(_0xf878('0x5'));var BPromise=require(_0xf878('0x6'));var Mustache=require(_0xf878('0x7'));var util=require(_0xf878('0x8'));var path=require(_0xf878('0x9'));var sox=require(_0xf878('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xe'));var authService=require(_0xf878('0xf'));var qs=require(_0xf878('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x11'));var logger=require(_0xf878('0x12'))('api');var utils=require(_0xf878('0x13'));var config=require('../../config/environment');var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x97c396,_0x339c9c){_0x339c9c=_0x339c9c||0xcc;return function(_0x596fb5){if(_0x596fb5){return _0x97c396[_0xf878('0x15')](_0x339c9c);}return _0x97c396[_0xf878('0x16')](_0x339c9c)[_0xf878('0x17')]();};}function respondWithResult(_0x570dcc,_0xe2c2de){_0xe2c2de=_0xe2c2de||0xc8;return function(_0x3902f7){if(_0x3902f7){return _0x570dcc[_0xf878('0x16')](_0xe2c2de)['json'](_0x3902f7);}};}function respondWithFilteredResult(_0x568a3a,_0x4c0948){return function(_0x35ff2d){if(_0x35ff2d){var _0x31d888=_0x35ff2d[_0xf878('0x18')],_0x6dbeca=_0x4c0948[_0xf878('0x19')],_0x44aacc=_0x4c0948[_0xf878('0x19')]+_0x4c0948[_0xf878('0x1a')],_0x186a02;if(_0x44aacc>=_0x31d888){_0x44aacc=_0x31d888;_0x186a02=0xc8;}else{_0x186a02=0xce;}_0x568a3a[_0xf878('0x16')](_0x186a02);return _0x568a3a['set'](_0xf878('0x1b'),_0x6dbeca+'-'+_0x44aacc+'/'+_0x31d888)[_0xf878('0x1c')](_0x35ff2d);}return null;};}function patchUpdates(_0x412de1){return function(_0x622ea8){try{jsonpatch[_0xf878('0x1d')](_0x622ea8,_0x412de1,!![]);}catch(_0x237d15){return BPromise[_0xf878('0x1e')](_0x237d15);}return _0x622ea8['save']();};}function saveUpdates(_0x73f6bf,_0x140866){return function(_0x250f85){if(_0x250f85){return _0x250f85['update'](_0x73f6bf)[_0xf878('0x1f')](function(_0x23590c){return _0x23590c;});}return null;};}function removeEntity(_0xacc440,_0x392822){return function(_0x22d884){if(_0x22d884){return _0x22d884[_0xf878('0x20')]()[_0xf878('0x1f')](function(){_0xacc440[_0xf878('0x16')](0xcc)[_0xf878('0x17')]();});}};}function handleEntityNotFound(_0x1a6506,_0x45e61f){return function(_0x566995){if(!_0x566995){_0x1a6506[_0xf878('0x15')](0x194);}return _0x566995;};}function handleError(_0x5b0b06,_0xa3d3d3){_0xa3d3d3=_0xa3d3d3||0x1f4;return function(_0x12b32f){logger[_0xf878('0x21')](_0x12b32f[_0xf878('0x22')]);if(_0x12b32f[_0xf878('0x23')]){delete _0x12b32f['name'];}_0x5b0b06['status'](_0xa3d3d3)['send'](_0x12b32f);};}exports[_0xf878('0x24')]=function(_0x3baba4,_0x38fa87){var _0x5af87f={},_0xfa3e11={},_0x2e2256={'count':0x0,'rows':[]};var _0x3e848d=_[_0xf878('0x25')](db[_0xf878('0x26')]['rawAttributes'],function(_0x502322){return{'name':_0x502322[_0xf878('0x27')],'type':_0x502322[_0xf878('0x28')]['key']};});_0xfa3e11[_0xf878('0x29')]=_['map'](_0x3e848d,_0xf878('0x23'));_0xfa3e11['query']=_[_0xf878('0x2a')](_0x3baba4['query']);_0xfa3e11[_0xf878('0x2b')]=_['intersection'](_0xfa3e11[_0xf878('0x29')],_0xfa3e11[_0xf878('0x2c')]);_0x5af87f[_0xf878('0x2d')]=_[_0xf878('0x2e')](_0xfa3e11[_0xf878('0x29')],qs[_0xf878('0x2f')](_0x3baba4['query'][_0xf878('0x2f')]));_0x5af87f[_0xf878('0x2d')]=_0x5af87f[_0xf878('0x2d')][_0xf878('0x30')]?_0x5af87f[_0xf878('0x2d')]:_0xfa3e11['model'];if(!_0x3baba4[_0xf878('0x2c')][_0xf878('0x31')]('nolimit')){_0x5af87f[_0xf878('0x1a')]=qs[_0xf878('0x1a')](_0x3baba4[_0xf878('0x2c')][_0xf878('0x1a')]);_0x5af87f[_0xf878('0x19')]=qs['offset'](_0x3baba4[_0xf878('0x2c')][_0xf878('0x19')]);}_0x5af87f[_0xf878('0x32')]=qs[_0xf878('0x33')](_0x3baba4['query'][_0xf878('0x33')]);_0x5af87f['where']=qs['filters'](_[_0xf878('0x34')](_0x3baba4[_0xf878('0x2c')],_0xfa3e11[_0xf878('0x2b')]));if(_0x3baba4[_0xf878('0x2c')][_0xf878('0x35')]){_0x5af87f['where']=_[_0xf878('0x36')](_0x5af87f['where'],{'$or':_[_0xf878('0x25')](_0x3e848d,function(_0x3b1797){if(_0x3b1797['type']!==_0xf878('0x37')){var _0x365e88={};_0x365e88[_0x3b1797['name']]={'$like':'%'+_0x3baba4[_0xf878('0x2c')][_0xf878('0x35')]+'%'};return _0x365e88;}})});}_0x5af87f=_['merge']({},_0x5af87f,_0x3baba4[_0xf878('0x38')]);var _0xbe1673={'where':_0x5af87f[_0xf878('0x39')]};return db[_0xf878('0x26')][_0xf878('0x18')](_0xbe1673)[_0xf878('0x1f')](function(_0x1823b6){_0x2e2256['count']=_0x1823b6;if(_0x3baba4[_0xf878('0x2c')][_0xf878('0x3a')]){_0x5af87f['include']=[{'all':!![]}];}return db[_0xf878('0x26')]['findAll'](_0x5af87f);})['then'](function(_0x2ec109){_0x2e2256[_0xf878('0x3b')]=_0x2ec109;return _0x2e2256;})[_0xf878('0x1f')](respondWithFilteredResult(_0x38fa87,_0x5af87f))[_0xf878('0x3c')](handleError(_0x38fa87,null));};exports[_0xf878('0x3d')]=function(_0x5207e3,_0x3629c3){var _0x4c4ae4={'raw':!![],'where':{'id':_0x5207e3[_0xf878('0x3e')]['id']}},_0xb09736={};_0xb09736['model']=_['keys'](db[_0xf878('0x26')][_0xf878('0x3f')]);_0xb09736[_0xf878('0x2c')]=_[_0xf878('0x2a')](_0x5207e3[_0xf878('0x2c')]);_0xb09736[_0xf878('0x2b')]=_[_0xf878('0x2e')](_0xb09736[_0xf878('0x29')],_0xb09736[_0xf878('0x2c')]);_0x4c4ae4['attributes']=_[_0xf878('0x2e')](_0xb09736[_0xf878('0x29')],qs[_0xf878('0x2f')](_0x5207e3[_0xf878('0x2c')][_0xf878('0x2f')]));_0x4c4ae4[_0xf878('0x2d')]=_0x4c4ae4['attributes'][_0xf878('0x30')]?_0x4c4ae4[_0xf878('0x2d')]:_0xb09736[_0xf878('0x29')];if(_0x5207e3[_0xf878('0x2c')][_0xf878('0x3a')]){_0x4c4ae4['include']=[{'all':!![]}];}_0x4c4ae4=_[_0xf878('0x36')]({},_0x4c4ae4,_0x5207e3[_0xf878('0x38')]);return db[_0xf878('0x26')][_0xf878('0x40')](_0x4c4ae4)['then'](handleEntityNotFound(_0x3629c3,null))[_0xf878('0x1f')](respondWithResult(_0x3629c3,null))[_0xf878('0x3c')](handleError(_0x3629c3,null));};exports[_0xf878('0x41')]=function(_0x5e3d74,_0x4fe92d){return db[_0xf878('0x26')]['create'](_0x5e3d74['body'],{})['then'](respondWithResult(_0x4fe92d,0xc9))[_0xf878('0x3c')](handleError(_0x4fe92d,null));};exports['update']=function(_0x156fdb,_0x450a10){if(_0x156fdb[_0xf878('0x42')]['id']){delete _0x156fdb[_0xf878('0x42')]['id'];}return db[_0xf878('0x26')][_0xf878('0x40')]({'where':{'id':_0x156fdb[_0xf878('0x3e')]['id']}})['then'](handleEntityNotFound(_0x450a10,null))[_0xf878('0x1f')](saveUpdates(_0x156fdb[_0xf878('0x42')],null))[_0xf878('0x1f')](respondWithResult(_0x450a10,null))[_0xf878('0x3c')](handleError(_0x450a10,null));};exports[_0xf878('0x20')]=function(_0x47c8be,_0x4a5b71){return db[_0xf878('0x26')][_0xf878('0x40')]({'where':{'id':_0x47c8be['params']['id']}})[_0xf878('0x1f')](handleEntityNotFound(_0x4a5b71,null))['then'](removeEntity(_0x4a5b71,null))[_0xf878('0x3c')](handleError(_0x4a5b71,null));}; \ No newline at end of file +var _0x087b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','intersection','find','create','body','params','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x541e73,_0x20f67f){var _0x372cff=function(_0x19aac3){while(--_0x19aac3){_0x541e73['push'](_0x541e73['shift']());}};_0x372cff(++_0x20f67f);}(_0x087b,0x11a));var _0xb087=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x087b[_0x556927];return _0x5f1235;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x189e2b,_0x31f977){_0x31f977=_0x31f977||0xcc;return function(_0x323656){if(_0x323656){return _0x189e2b['sendStatus'](_0x31f977);}return _0x189e2b[_0xb087('0x1a')](_0x31f977)[_0xb087('0x1b')]();};}function respondWithResult(_0x43f136,_0x46410b){_0x46410b=_0x46410b||0xc8;return function(_0x11784c){if(_0x11784c){return _0x43f136[_0xb087('0x1a')](_0x46410b)[_0xb087('0x1c')](_0x11784c);}};}function respondWithFilteredResult(_0x5147e3,_0x24e1a3){return function(_0x16d0b7){if(_0x16d0b7){var _0x5193a4=_0x16d0b7[_0xb087('0x1d')],_0x43e576=_0x24e1a3[_0xb087('0x1e')],_0x412b48=_0x24e1a3[_0xb087('0x1e')]+_0x24e1a3['limit'],_0x597478;if(_0x412b48>=_0x5193a4){_0x412b48=_0x5193a4;_0x597478=0xc8;}else{_0x597478=0xce;}_0x5147e3[_0xb087('0x1a')](_0x597478);return _0x5147e3[_0xb087('0x1f')](_0xb087('0x20'),_0x43e576+'-'+_0x412b48+'/'+_0x5193a4)[_0xb087('0x1c')](_0x16d0b7);}return null;};}function patchUpdates(_0x4e333b){return function(_0x13d534){try{jsonpatch[_0xb087('0x21')](_0x13d534,_0x4e333b,!![]);}catch(_0x10bb5b){return BPromise[_0xb087('0x22')](_0x10bb5b);}return _0x13d534['save']();};}function saveUpdates(_0x5aeab1,_0x5ea3dc){return function(_0x49450a){if(_0x49450a){return _0x49450a[_0xb087('0x23')](_0x5aeab1)[_0xb087('0x24')](function(_0x3d0f57){return _0x3d0f57;});}return null;};}function removeEntity(_0x1f3c0e,_0x1fb765){return function(_0x258b4c){if(_0x258b4c){return _0x258b4c[_0xb087('0x25')]()['then'](function(){_0x1f3c0e[_0xb087('0x1a')](0xcc)[_0xb087('0x1b')]();});}};}function handleEntityNotFound(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(!_0x3ad74e){_0x1de654['sendStatus'](0x194);}return _0x3ad74e;};}function handleError(_0x183eab,_0xdd4216){_0xdd4216=_0xdd4216||0x1f4;return function(_0x502438){logger['error'](_0x502438['stack']);if(_0x502438['name']){delete _0x502438['name'];}_0x183eab[_0xb087('0x1a')](_0xdd4216)[_0xb087('0x26')](_0x502438);};}exports[_0xb087('0x27')]=function(_0x3ca2df,_0xd9ec66){var _0xb72173={},_0xf3f41f={},_0x35a52c={'count':0x0,'rows':[]};var _0x6cfb22=_[_0xb087('0x28')](db[_0xb087('0x29')][_0xb087('0x2a')],function(_0xb0baf6){return{'name':_0xb0baf6[_0xb087('0x2b')],'type':_0xb0baf6['type'][_0xb087('0x2c')]};});_0xf3f41f[_0xb087('0x2d')]=_[_0xb087('0x28')](_0x6cfb22,_0xb087('0x2e'));_0xf3f41f[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x3ca2df[_0xb087('0x2f')]);_0xf3f41f[_0xb087('0x31')]=_['intersection'](_0xf3f41f['model'],_0xf3f41f[_0xb087('0x2f')]);_0xb72173[_0xb087('0x32')]=_['intersection'](_0xf3f41f[_0xb087('0x2d')],qs[_0xb087('0x33')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x33')]));_0xb72173[_0xb087('0x32')]=_0xb72173[_0xb087('0x32')][_0xb087('0x34')]?_0xb72173[_0xb087('0x32')]:_0xf3f41f[_0xb087('0x2d')];if(!_0x3ca2df[_0xb087('0x2f')][_0xb087('0x35')](_0xb087('0x36'))){_0xb72173['limit']=qs[_0xb087('0x37')](_0x3ca2df['query'][_0xb087('0x37')]);_0xb72173[_0xb087('0x1e')]=qs[_0xb087('0x1e')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x1e')]);}_0xb72173[_0xb087('0x38')]=qs[_0xb087('0x39')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x39')]);_0xb72173['where']=qs['filters'](_[_0xb087('0x3a')](_0x3ca2df[_0xb087('0x2f')],_0xf3f41f[_0xb087('0x31')]));if(_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]){_0xb72173['where']=_[_0xb087('0x3c')](_0xb72173[_0xb087('0x3d')],{'$or':_['map'](_0x6cfb22,function(_0x480e22){if(_0x480e22[_0xb087('0x3e')]!==_0xb087('0x3f')){var _0x130ee9={};_0x130ee9[_0x480e22['name']]={'$like':'%'+_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]+'%'};return _0x130ee9;}})});}_0xb72173=_[_0xb087('0x3c')]({},_0xb72173,_0x3ca2df[_0xb087('0x40')]);var _0x3c8f51={'where':_0xb72173['where']};return db[_0xb087('0x29')]['count'](_0x3c8f51)[_0xb087('0x24')](function(_0x5a582d){_0x35a52c[_0xb087('0x1d')]=_0x5a582d;if(_0x3ca2df[_0xb087('0x2f')]['includeAll']){_0xb72173[_0xb087('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xb087('0x42')](_0xb72173);})['then'](function(_0x2d2c74){_0x35a52c[_0xb087('0x43')]=_0x2d2c74;return _0x35a52c;})[_0xb087('0x24')](respondWithFilteredResult(_0xd9ec66,_0xb72173))[_0xb087('0x44')](handleError(_0xd9ec66,null));};exports[_0xb087('0x45')]=function(_0x2a4787,_0x35d010){var _0x5e7690={'raw':!![],'where':{'id':_0x2a4787['params']['id']}},_0x1625f6={};_0x1625f6[_0xb087('0x2d')]=_[_0xb087('0x30')](db['VoiceTransferReport'][_0xb087('0x2a')]);_0x1625f6[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x2a4787['query']);_0x1625f6[_0xb087('0x31')]=_['intersection'](_0x1625f6[_0xb087('0x2d')],_0x1625f6[_0xb087('0x2f')]);_0x5e7690['attributes']=_[_0xb087('0x46')](_0x1625f6[_0xb087('0x2d')],qs['fields'](_0x2a4787[_0xb087('0x2f')][_0xb087('0x33')]));_0x5e7690['attributes']=_0x5e7690[_0xb087('0x32')][_0xb087('0x34')]?_0x5e7690[_0xb087('0x32')]:_0x1625f6[_0xb087('0x2d')];if(_0x2a4787['query']['includeAll']){_0x5e7690[_0xb087('0x41')]=[{'all':!![]}];}_0x5e7690=_[_0xb087('0x3c')]({},_0x5e7690,_0x2a4787[_0xb087('0x40')]);return db[_0xb087('0x29')][_0xb087('0x47')](_0x5e7690)[_0xb087('0x24')](handleEntityNotFound(_0x35d010,null))['then'](respondWithResult(_0x35d010,null))['catch'](handleError(_0x35d010,null));};exports[_0xb087('0x48')]=function(_0x520acc,_0x3a405b){return db[_0xb087('0x29')][_0xb087('0x48')](_0x520acc[_0xb087('0x49')],{})['then'](respondWithResult(_0x3a405b,0xc9))[_0xb087('0x44')](handleError(_0x3a405b,null));};exports['update']=function(_0x2fe8a0,_0x73413b){if(_0x2fe8a0[_0xb087('0x49')]['id']){delete _0x2fe8a0[_0xb087('0x49')]['id'];}return db[_0xb087('0x29')]['find']({'where':{'id':_0x2fe8a0[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x73413b,null))[_0xb087('0x24')](saveUpdates(_0x2fe8a0['body'],null))[_0xb087('0x24')](respondWithResult(_0x73413b,null))['catch'](handleError(_0x73413b,null));};exports['destroy']=function(_0x1c9f8f,_0x341665){return db['VoiceTransferReport'][_0xb087('0x47')]({'where':{'id':_0x1c9f8f[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x341665,null))['then'](removeEntity(_0x341665,null))['catch'](handleError(_0x341665,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 5233a83..be0660d 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 _0xdffb=['api','moment','bluebird','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdffb,0xa9));var _0xbdff=function(_0x10070a,_0x5b2bb8){_0x10070a=_0x10070a-0x0;var _0x237f6f=_0xdffb[_0x10070a];return _0x237f6f;};'use strict';var _=require(_0xbdff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdff('0x1'));var moment=require(_0xbdff('0x2'));var BPromise=require(_0xbdff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbdff('0x4'));var attributes=require(_0xbdff('0x5'));module[_0xbdff('0x6')]=function(_0x34ad47,_0x3f878b){return _0x34ad47[_0xbdff('0x7')](_0xbdff('0x8'),attributes,{'tableName':_0xbdff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbec=['define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceTransferReport.attributes','exports'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xbbec,0x85));var _0xcbbe=function(_0x3c004c,_0x44bf23){_0x3c004c=_0x3c004c-0x0;var _0x16cc50=_0xbbec[_0x3c004c];return _0x16cc50;};'use strict';var _=require(_0xcbbe('0x0'));var util=require(_0xcbbe('0x1'));var logger=require(_0xcbbe('0x2'))(_0xcbbe('0x3'));var moment=require(_0xcbbe('0x4'));var BPromise=require(_0xcbbe('0x5'));var rp=require(_0xcbbe('0x6'));var fs=require('fs');var path=require(_0xcbbe('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbbe('0x8'));module[_0xcbbe('0x9')]=function(_0x466300,_0x5d32f9){return _0x466300[_0xcbbe('0xa')](_0xcbbe('0xb'),attributes,{'tableName':_0xcbbe('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 ed893bf..ef152d7 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 _0x9fc3=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0xb42ec7,_0x4a0132){var _0x5824d5=function(_0x3dfd6f){while(--_0x3dfd6f){_0xb42ec7['push'](_0xb42ec7['shift']());}};_0x5824d5(++_0x4a0132);}(_0x9fc3,0x1ee));var _0x39fc=function(_0x4f6042,_0x3fb515){_0x4f6042=_0x4f6042-0x0;var _0x5badcf=_0x9fc3[_0x4f6042];return _0x5badcf;};'use strict';var _=require(_0x39fc('0x0'));var util=require(_0x39fc('0x1'));var moment=require(_0x39fc('0x2'));var BPromise=require(_0x39fc('0x3'));var rs=require(_0x39fc('0x4'));var fs=require('fs');var Redis=require(_0x39fc('0x5'));var db=require(_0x39fc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x39fc('0x7'))('rpc');var config=require(_0x39fc('0x8'));var jayson=require(_0x39fc('0x9'));var client=jayson[_0x39fc('0xa')][_0x39fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24caa3,_0x5865ab,_0x350bb7){return new BPromise(function(_0x108978,_0x2337bd){return client[_0x39fc('0xc')](_0x24caa3,_0x350bb7)[_0x39fc('0xd')](function(_0x384a3a){logger[_0x39fc('0xe')](_0x39fc('0xf'),_0x5865ab,_0x39fc('0x10'));logger[_0x39fc('0x11')](_0x39fc('0x12'),_0x5865ab,_0x39fc('0x10'),JSON['stringify'](_0x384a3a));if(_0x384a3a[_0x39fc('0x13')]){if(_0x384a3a[_0x39fc('0x13')][_0x39fc('0x14')]===0x1f4){logger['error'](_0x39fc('0xf'),_0x5865ab,_0x384a3a[_0x39fc('0x13')][_0x39fc('0x15')]);return _0x2337bd(_0x384a3a['error']['message']);}logger[_0x39fc('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x5865ab,_0x384a3a['error'][_0x39fc('0x15')]);return _0x108978(_0x384a3a['error'][_0x39fc('0x15')]);}else{logger['info'](_0x39fc('0xf'),_0x5865ab,_0x39fc('0x10'));_0x108978(_0x384a3a[_0x39fc('0x16')]['message']);}})[_0x39fc('0x17')](function(_0x2acdbc){logger[_0x39fc('0x13')](_0x39fc('0xf'),_0x5865ab,_0x2acdbc);_0x2337bd(_0x2acdbc);});});}exports[_0x39fc('0x18')]=function(_0x4b7d47){var _0x48d20d=this;return new Promise(function(_0x45c724,_0x5519c0){return db[_0x39fc('0x19')][_0x39fc('0x1a')](_0x4b7d47['body'],{'raw':_0x4b7d47['options']?_0x4b7d47[_0x39fc('0x1b')][_0x39fc('0x1c')]===undefined?!![]:![]:!![]})[_0x39fc('0xd')](function(_0x1b1ef8){logger[_0x39fc('0xe')](_0x39fc('0x18'),_0x4b7d47);logger[_0x39fc('0x11')](_0x39fc('0x18'),_0x4b7d47,JSON[_0x39fc('0x1d')](_0x1b1ef8));_0x45c724(_0x1b1ef8);})['catch'](function(_0x391658){logger['error'](_0x39fc('0x18'),_0x391658[_0x39fc('0x15')],_0x4b7d47);_0x5519c0(_0x48d20d[_0x39fc('0x13')](0x1f4,_0x391658['message']));});});}; \ No newline at end of file +var _0x2cab=['jayson/promise','client','http','request','info','request\x20sent','debug','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x2cab,0x19c));var _0xb2ca=function(_0xfd0380,_0x20399b){_0xfd0380=_0xfd0380-0x0;var _0x54f7fd=_0x2cab[_0xfd0380];return _0x54f7fd;};'use strict';var _=require(_0xb2ca('0x0'));var util=require(_0xb2ca('0x1'));var moment=require(_0xb2ca('0x2'));var BPromise=require(_0xb2ca('0x3'));var rs=require(_0xb2ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb2ca('0x6'));var config=require(_0xb2ca('0x7'));var jayson=require(_0xb2ca('0x8'));var client=jayson[_0xb2ca('0x9')][_0xb2ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ead18,_0x3ef0c2,_0x32439e){return new BPromise(function(_0x370266,_0x1c0bda){return client[_0xb2ca('0xb')](_0x1ead18,_0x32439e)['then'](function(_0xaf96ce){logger[_0xb2ca('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x3ef0c2,_0xb2ca('0xd'));logger[_0xb2ca('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3ef0c2,_0xb2ca('0xd'),JSON['stringify'](_0xaf96ce));if(_0xaf96ce[_0xb2ca('0xf')]){if(_0xaf96ce[_0xb2ca('0xf')][_0xb2ca('0x10')]===0x1f4){logger[_0xb2ca('0xf')](_0xb2ca('0x11'),_0x3ef0c2,_0xaf96ce['error'][_0xb2ca('0x12')]);return _0x1c0bda(_0xaf96ce[_0xb2ca('0xf')][_0xb2ca('0x12')]);}logger['error'](_0xb2ca('0x11'),_0x3ef0c2,_0xaf96ce['error'][_0xb2ca('0x12')]);return _0x370266(_0xaf96ce[_0xb2ca('0xf')][_0xb2ca('0x12')]);}else{logger[_0xb2ca('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x3ef0c2,_0xb2ca('0xd'));_0x370266(_0xaf96ce[_0xb2ca('0x13')][_0xb2ca('0x12')]);}})[_0xb2ca('0x14')](function(_0x5eee74){logger[_0xb2ca('0xf')](_0xb2ca('0x11'),_0x3ef0c2,_0x5eee74);_0x1c0bda(_0x5eee74);});});}exports[_0xb2ca('0x15')]=function(_0x5b5e02){var _0x4e083f=this;return new Promise(function(_0x1dc766,_0x238589){return db[_0xb2ca('0x16')][_0xb2ca('0x17')](_0x5b5e02[_0xb2ca('0x18')],{'raw':_0x5b5e02[_0xb2ca('0x19')]?_0x5b5e02[_0xb2ca('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xb2ca('0x1a')](function(_0x3f5439){logger[_0xb2ca('0xc')](_0xb2ca('0x15'),_0x5b5e02);logger['debug'](_0xb2ca('0x15'),_0x5b5e02,JSON[_0xb2ca('0x1b')](_0x3f5439));_0x1dc766(_0x3f5439);})[_0xb2ca('0x14')](function(_0x28a73b){logger[_0xb2ca('0xf')](_0xb2ca('0x15'),_0x28a73b[_0xb2ca('0x12')],_0x5b5e02);_0x238589(_0x4e083f['error'](0x1f4,_0x28a73b[_0xb2ca('0x12')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index ddd2da6..e7a261a 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd41c=['then','listen','info','start','map','filter','online','join','Offline\x20apps:','status','name','None','./config/seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','sync'];(function(_0x5aec5b,_0x43acb9){var _0x3589f4=function(_0x2ebfbb){while(--_0x2ebfbb){_0x5aec5b['push'](_0x5aec5b['shift']());}};_0x3589f4(++_0x43acb9);}(_0xd41c,0xd6));var _0xcd41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd41c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var mysqldb=require(_0xcd41('0x0'));var rpc=require(_0xcd41('0x1'));var config=require(_0xcd41('0x2'));var logger=require(_0xcd41('0x3'))(_0xcd41('0x4'));var pm2=require(_0xcd41('0x5'));var pm2Config=require(_0xcd41('0x6'));var schedule=require(_0xcd41('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xcd41('0x8')][_0xcd41('0x9')]()[_0xcd41('0xa')](function(){return rpc[_0xcd41('0xb')]();})[_0xcd41('0xa')](function(_0x381552){logger[_0xcd41('0xc')](_0x381552);return chat[_0xcd41('0xd')]();})[_0xcd41('0xa')](function(){return schedule[_0xcd41('0xd')]();})['then'](function(_0x35d030){logger['info'](_0x35d030);return pm2[_0xcd41('0xd')](pm2Config);})['then'](function(_0x425b17){logger[_0xcd41('0xc')]('Online\x20apps:',_[_0xcd41('0xe')](_[_0xcd41('0xf')](_0x425b17,{'status':_0xcd41('0x10')}),'name')[_0xcd41('0x11')]());logger[_0xcd41('0xc')](_0xcd41('0x12'),_[_0xcd41('0xe')](_[_0xcd41('0xf')](_0x425b17,function(_0x4a515e){return _0x4a515e[_0xcd41('0x13')]!==_0xcd41('0x10');}),_0xcd41('0x14'))[_0xcd41('0x11')]()||_0xcd41('0x15'));config['seedDB']&&require(_0xcd41('0x16'))['default']();require(_0xcd41('0x17'))[_0xcd41('0x18')]();})[_0xcd41('0x19')](function(_0x2025ef){logger[_0xcd41('0x1a')](_0xcd41('0x1b'),_0x2025ef);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xb28c=['./config/schedule/chat','sequelize','sync','then','info','start','map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x445b7e,_0x104f17){var _0x5d80d7=function(_0x32e898){while(--_0x32e898){_0x445b7e['push'](_0x445b7e['shift']());}};_0x5d80d7(++_0x104f17);}(_0xb28c,0x6d));var _0xcb28=function(_0x3242e4,_0xcd2969){_0x3242e4=_0x3242e4-0x0;var _0x238043=_0xb28c[_0x3242e4];return _0x238043;};'use strict';var _=require(_0xcb28('0x0'));var mysqldb=require(_0xcb28('0x1'));var rpc=require('./rpc');var config=require(_0xcb28('0x2'));var logger=require('./config/logger')(_0xcb28('0x3'));var pm2=require(_0xcb28('0x4'));var pm2Config=require(_0xcb28('0x5'));var schedule=require(_0xcb28('0x6'));var chat=require(_0xcb28('0x7'));function main(){return mysqldb['db'][_0xcb28('0x8')][_0xcb28('0x9')]()[_0xcb28('0xa')](function(){return rpc['listen']();})[_0xcb28('0xa')](function(_0x5ab96f){logger[_0xcb28('0xb')](_0x5ab96f);return chat[_0xcb28('0xc')]();})[_0xcb28('0xa')](function(){return schedule[_0xcb28('0xc')]();})[_0xcb28('0xa')](function(_0x3c0e03){logger[_0xcb28('0xb')](_0x3c0e03);return pm2['start'](pm2Config);})[_0xcb28('0xa')](function(_0x43c7ed){logger['info']('Online\x20apps:',_[_0xcb28('0xd')](_[_0xcb28('0xe')](_0x43c7ed,{'status':'online'}),_0xcb28('0xf'))[_0xcb28('0x10')]());logger[_0xcb28('0xb')](_0xcb28('0x11'),_[_0xcb28('0xd')](_[_0xcb28('0xe')](_0x43c7ed,function(_0x1cc90a){return _0x1cc90a[_0xcb28('0x12')]!==_0xcb28('0x13');}),_0xcb28('0xf'))[_0xcb28('0x10')]()||_0xcb28('0x14'));config[_0xcb28('0x15')]&&require(_0xcb28('0x16'))[_0xcb28('0x17')]();require(_0xcb28('0x18'))[_0xcb28('0x17')]();})[_0xcb28('0x19')](function(_0x3f7930){logger[_0xcb28('0x1a')](_0xcb28('0x1b'),_0x3f7930);process[_0xcb28('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 60e4e9f..14550b3 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 _0x7278=['authorization','startsWith','Basic','User','then','authenticate','pass','json','Wrong\x20credentials.','headers','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','payload','verify','randomBytes','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','secrets','session','role','name','internal','email','userpic','permissions','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','disposition','closed','status','unmanaged','Unmanaged.','Forbidden.','catch','use'];(function(_0x10813d,_0x47a99b){var _0x4536e9=function(_0x1f1030){while(--_0x1f1030){_0x10813d['push'](_0x10813d['shift']());}};_0x4536e9(++_0x47a99b);}(_0x7278,0x161));var _0x8727=function(_0x6243ba,_0x3af75f){_0x6243ba=_0x6243ba-0x0;var _0x537b1a=_0x7278[_0x6243ba];return _0x537b1a;};'use strict';var db=require(_0x8727('0x0'))['db'];var config=require(_0x8727('0x1'));var hardwareConf=require(_0x8727('0x2'));var _=require(_0x8727('0x3'));var jwt=require(_0x8727('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x8727('0x5'));var basicAuth=require(_0x8727('0x6'));var crypto=require(_0x8727('0x7'));var BPromise=require(_0x8727('0x8'));var validateJwt=expressJwt({'secret':config[_0x8727('0x9')][_0x8727('0xa')]});var userAttributes=['id',_0x8727('0xb'),'fullname',_0x8727('0xc'),_0x8727('0xd'),_0x8727('0xe'),_0x8727('0xf'),_0x8727('0x10'),'md5secret','voicePause','chatPause',_0x8727('0x11'),_0x8727('0x12'),_0x8727('0x13'),_0x8727('0x14'),_0x8727('0x15'),_0x8727('0x16'),_0x8727('0x17'),_0x8727('0x18'),'crudPermissions',_0x8727('0x19'),_0x8727('0x1a'),_0x8727('0x1b'),'phoneBarAutoAnswer',_0x8727('0x1c'),_0x8727('0x1d'),'phoneBarEnableDtmfTone',_0x8727('0x1e'),_0x8727('0x1f'),_0x8727('0x20'),_0x8727('0x21'),_0x8727('0x22'),_0x8727('0x23'),_0x8727('0x24'),_0x8727('0x25')];exports[_0x8727('0x26')]=function(){return this[_0x8727('0x27')](!![])['use'](function(_0x17baba,_0x1f9538,_0x16d1b7){if(_0x17baba[_0x8727('0x28')]){_0x16d1b7();}else{return db[_0x8727('0x29')][_0x8727('0x2a')]({'where':{'id':_0x17baba['params']['id']},'attributes':['id','closed',_0x8727('0x2b')],'raw':!![]})['then'](function(_0x28b10f){if(_0x28b10f&&_0x28b10f[_0x8727('0x2c')]){return _0x1f9538[_0x8727('0x2d')](_0x28b10f[_0x8727('0x2b')]===_0x8727('0x2e')?0x195:0x193)['json']({'message':_0x28b10f[_0x8727('0x2b')]===_0x8727('0x2e')?_0x8727('0x2f'):_0x8727('0x30')});}else{_0x16d1b7();}})[_0x8727('0x31')](function(_0x3140e8){_0x16d1b7(_0x3140e8);});}});};exports[_0x8727('0x27')]=function isAuthenticated(_0x441cc0){return compose()[_0x8727('0x32')](function(_0x56ffd5,_0x268a13,_0x1a69d5){if(_0x56ffd5['headers'][_0x8727('0x33')]){if(_[_0x8727('0x34')](_0x56ffd5['headers']['authorization'],_0x8727('0x35'))){var _0x318684=basicAuth(_0x56ffd5);db[_0x8727('0x36')]['find']({'where':{'name':_0x318684[_0x8727('0xc')]}})[_0x8727('0x37')](function(_0x267008){if(!_0x267008||!_0x267008[_0x8727('0x38')](_0x318684[_0x8727('0x39')])){return _0x268a13[_0x8727('0x2d')](0x191)[_0x8727('0x3a')]({'message':_0x8727('0x3b')});}_0x56ffd5['user']={'id':_0x267008['id']};_0x1a69d5();})[_0x8727('0x31')](function(_0x307055){_0x1a69d5(_0x307055);});}else if(_['startsWith'](_0x56ffd5[_0x8727('0x3c')][_0x8727('0x33')],_0x8727('0x3d'))){validateJwt(_0x56ffd5,_0x268a13,_0x1a69d5);}else{if(_0x441cc0){_0x1a69d5();}else{return _0x268a13[_0x8727('0x2d')](0x193)[_0x8727('0x3a')]({'message':_0x8727('0x3e')});}}}else if(_0x56ffd5['query'][_0x8727('0x3f')]){var _0x563201={'audience':hardwareConf[_0x8727('0x40')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x56ffd5[_0x8727('0x41')][_0x8727('0x3f')],_0x563201)[_0x8727('0x37')](function(_0x2322ab){return db[_0x8727('0x36')][_0x8727('0x42')]({'where':{'id':_0x2322ab[_0x8727('0x43')]}})['then'](function(_0x3ac06a){if(!_0x3ac06a||!_[_0x8727('0x44')](_0x3ac06a[_0x8727('0x45')],_0x2322ab[_0x8727('0x46')])){return _0x268a13[_0x8727('0x2d')](0x193)[_0x8727('0x3a')]({'message':_0x8727('0x47')});}_0x56ffd5[_0x8727('0x28')]={'id':_0x3ac06a['id']};_0x1a69d5();});})[_0x8727('0x31')](function(_0x4435c9){_0x1a69d5(_0x4435c9);});}else if(_0x441cc0){_0x1a69d5();}else{return _0x268a13[_0x8727('0x2d')](0x193)[_0x8727('0x3a')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x456254,_0x3fac76,_0x38a61f){if(_0x456254[_0x8727('0x28')]){db['User'][_0x8727('0x42')]({'where':{'id':_0x456254[_0x8727('0x28')]['id']},'attributes':userAttributes})[_0x8727('0x37')](function(_0x26c545){if(!_0x26c545){return _0x3fac76[_0x8727('0x2d')](0x194)['json']({'message':_0x8727('0x48')});}_0x456254[_0x8727('0x28')]=_0x26c545;_0x38a61f();})[_0x8727('0x31')](function(_0x1b0e88){_0x38a61f(_0x1b0e88);});}else if(_0x441cc0){_0x38a61f();}else{return _0x3fac76[_0x8727('0x2d')](0x194)[_0x8727('0x3a')]({'message':_0x8727('0x49')});}});};exports[_0x8727('0x4a')]=function canUpdate(){return compose()[_0x8727('0x32')](function(_0x1a607a,_0x396f12,_0x308c1d){return require('../../config/license/util')[_0x8727('0x4b')]()[_0x8727('0x37')](function(_0x3f56df){if(_0x3f56df[_0x8727('0x4c')]){_0x308c1d();}else{return _0x396f12[_0x8727('0x2d')](0x193)[_0x8727('0x3a')]({'message':_0x8727('0x4d')});}})[_0x8727('0x31')](function(_0x42d767){_0x308c1d(_0x42d767);});});};exports[_0x8727('0x4e')]=function(_0xc05477,_0x1f719e,_0x2a1063){_0xc05477[_0x8727('0x4e')]=!![];return _0x2a1063();};exports['signToken']=function signToken(_0x15fbe6){return signJwt(_0x15fbe6);};exports[_0x8727('0x4f')]=function(_0x19d08a,_0x4ac9d2){if(!_0x19d08a[_0x8727('0x28')]){return _0x4ac9d2[_0x8727('0x2d')](0x194)[_0x8727('0x3a')]({'message':_0x8727('0x50')});}var _0x57817f={'payload':{'id':_0x19d08a[_0x8727('0x28')]['id'],'role':_0x19d08a[_0x8727('0x28')][_0x8727('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x57817f)[_0x8727('0x37')](function(_0x16b870){_0x4ac9d2[_0x8727('0x51')](_0x8727('0x52'),_0x16b870);_0x4ac9d2[_0x8727('0x53')](_0x8727('0x54'));})[_0x8727('0x31')](function(_0x51e3fa){return _0x4ac9d2[_0x8727('0x2d')](0x1f4)[_0x8727('0x55')](_0x51e3fa);});};exports[_0x8727('0x56')]=function(_0x338f43){if(_[_0x8727('0x57')](_0x338f43['apiKeyNonce'])||_[_0x8727('0x57')](_0x338f43[_0x8727('0x58')])){return null;}else{return createJwt(_0x338f43);}};exports[_0x8727('0x59')]=function(_0x4a9f1a){_0x4a9f1a[_0x8727('0x45')]=generateNonce();_0x4a9f1a[_0x8727('0x58')]=generateIssuedAt();return createJwt(_0x4a9f1a);};exports[_0x8727('0x5a')]=function(_0x3b846e,_0x25d746){var _0x1df94b=_0x3b846e['query'][_0x8727('0x3f')];if(_0x1df94b){var _0x2ed832={'nonce':_0x25d746[_0x8727('0x45')],'iat':_0x25d746['apiKeyIat'],'audience':hardwareConf[_0x8727('0x40')](),'issuer':hardwareConf[_0x8727('0x40')]()};return verifyJwt(_0x1df94b,_0x2ed832)[_0x8727('0x37')](function(){return generateApiKey(_0x25d746);});}else{throw{'message':_0x8727('0x5b')};}};function signJwt(_0x375f84){var _0x11cb79=BPromise[_0x8727('0x5c')](jwt['sign'],{'context':jwt});var _0x24196a=_0x375f84[_0x8727('0x5d')]||config[_0x8727('0x9')][_0x8727('0xa')];return new BPromise(function(_0x152de6,_0x426727){_0x11cb79(_0x375f84[_0x8727('0x5e')],_0x24196a,_0x375f84['options'])[_0x8727('0x37')](function(_0x18d50c){_0x152de6(_0x18d50c);})[_0x8727('0x31')](function(_0x5d6c81){_0x426727(_0x5d6c81);});});}function verifyJwt(_0x30e656,_0x22cd31,_0x24fd60){var _0x4367e8=BPromise[_0x8727('0x5c')](jwt[_0x8727('0x5f')],{'context':jwt});var _0x417d4c=_0x24fd60||config['secrets'][_0x8727('0xa')];return new BPromise(function(_0x4d09b8,_0x207893){_0x4367e8(_0x30e656,_0x417d4c,_0x22cd31)[_0x8727('0x37')](function(_0x594b9f){_0x4d09b8(_0x594b9f);})[_0x8727('0x31')](function(_0x3bb732){_0x207893(_0x3bb732);});});}function generateNonce(){return crypto[_0x8727('0x60')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x8727('0x61')](Date[_0x8727('0x62')]()/0x3e8)[_0x8727('0x63')]();}function createJwt(_0x527223){var _0x102daf={'payload':{'iat':_0x527223[_0x8727('0x58')],'nonce':_0x527223[_0x8727('0x45')]},'options':{'algorithm':_0x8727('0x64'),'subject':_0x527223['id'][_0x8727('0x63')](),'issuer':hardwareConf[_0x8727('0x40')](),'audience':hardwareConf[_0x8727('0x40')]()}};return signJwt(_0x102daf)[_0x8727('0x37')](function(_0x4d6773){return{'iat':_0x527223[_0x8727('0x58')],'nonce':_0x527223[_0x8727('0x45')],'token':_0x4d6773};});} \ No newline at end of file +var _0x4c60=['redirect','apiKeyNonce','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','payload','options','promisify','verify','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','express-jwt','secrets','session','role','fullname','name','internal','email','permissions','md5secret','voicePause','chatPause','openchannelPause','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','authenticate','pass','status','startsWith','Unknown\x20authorization\x20format','query','apikey','sub','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','find','User\x20not\x20found.','canUpdate','../../config/license/util','update','isMiddleware','setTokenCookie','cookie','motion.token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c60,0xc1));var _0x04c6=function(_0x2c6449,_0x1d1d25){_0x2c6449=_0x2c6449-0x0;var _0x2cc571=_0x4c60[_0x2c6449];return _0x2cc571;};'use strict';var db=require(_0x04c6('0x0'))['db'];var config=require(_0x04c6('0x1'));var hardwareConf=require(_0x04c6('0x2'));var _=require(_0x04c6('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x04c6('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require('bluebird');var validateJwt=expressJwt({'secret':config[_0x04c6('0x5')][_0x04c6('0x6')]});var userAttributes=['id',_0x04c6('0x7'),_0x04c6('0x8'),_0x04c6('0x9'),_0x04c6('0xa'),_0x04c6('0xb'),'userpic',_0x04c6('0xc'),_0x04c6('0xd'),_0x04c6('0xe'),_0x04c6('0xf'),'mailPause','faxPause','smsPause',_0x04c6('0x10'),'pauseType',_0x04c6('0x11'),_0x04c6('0x12'),'lastPauseAt',_0x04c6('0x13'),_0x04c6('0x14'),_0x04c6('0x15'),_0x04c6('0x16'),'phoneBarAutoAnswer',_0x04c6('0x17'),_0x04c6('0x18'),_0x04c6('0x19'),'phoneBarEnableSettings',_0x04c6('0x1a'),_0x04c6('0x1b'),_0x04c6('0x1c'),_0x04c6('0x1d'),_0x04c6('0x1e'),_0x04c6('0x1f'),_0x04c6('0x20')];exports[_0x04c6('0x21')]=function(){return this['isAuthenticated'](!![])[_0x04c6('0x22')](function(_0xa2bc92,_0x382e58,_0x2bc754){if(_0xa2bc92[_0x04c6('0x23')]){_0x2bc754();}else{return db[_0x04c6('0x24')][_0x04c6('0x25')]({'where':{'id':_0xa2bc92[_0x04c6('0x26')]['id']},'attributes':['id','closed',_0x04c6('0x27')],'raw':!![]})[_0x04c6('0x28')](function(_0xa70fd2){if(_0xa70fd2&&_0xa70fd2['closed']){return _0x382e58['status'](_0xa70fd2['disposition']===_0x04c6('0x29')?0x195:0x193)[_0x04c6('0x2a')]({'message':_0xa70fd2['disposition']==='unmanaged'?_0x04c6('0x2b'):_0x04c6('0x2c')});}else{_0x2bc754();}})[_0x04c6('0x2d')](function(_0x5daa22){_0x2bc754(_0x5daa22);});}});};exports[_0x04c6('0x2e')]=function isAuthenticated(_0x13f2dc){return compose()[_0x04c6('0x22')](function(_0x49c179,_0x2d3277,_0x41e29f){if(_0x49c179['headers']['authorization']){if(_['startsWith'](_0x49c179[_0x04c6('0x2f')][_0x04c6('0x30')],_0x04c6('0x31'))){var _0x115e35=basicAuth(_0x49c179);db[_0x04c6('0x32')]['find']({'where':{'name':_0x115e35['name']}})[_0x04c6('0x28')](function(_0x2ab1d2){if(!_0x2ab1d2||!_0x2ab1d2[_0x04c6('0x33')](_0x115e35[_0x04c6('0x34')])){return _0x2d3277[_0x04c6('0x35')](0x191)[_0x04c6('0x2a')]({'message':'Wrong\x20credentials.'});}_0x49c179[_0x04c6('0x23')]={'id':_0x2ab1d2['id']};_0x41e29f();})[_0x04c6('0x2d')](function(_0x4e00fe){_0x41e29f(_0x4e00fe);});}else if(_[_0x04c6('0x36')](_0x49c179[_0x04c6('0x2f')]['authorization'],'Bearer')){validateJwt(_0x49c179,_0x2d3277,_0x41e29f);}else{if(_0x13f2dc){_0x41e29f();}else{return _0x2d3277[_0x04c6('0x35')](0x193)[_0x04c6('0x2a')]({'message':_0x04c6('0x37')});}}}else if(_0x49c179[_0x04c6('0x38')][_0x04c6('0x39')]){var _0x43884e={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x49c179['query'][_0x04c6('0x39')],_0x43884e)['then'](function(_0x1e76e2){return db[_0x04c6('0x32')]['find']({'where':{'id':_0x1e76e2[_0x04c6('0x3a')]}})[_0x04c6('0x28')](function(_0x6e43fb){if(!_0x6e43fb||!_[_0x04c6('0x3b')](_0x6e43fb['apiKeyNonce'],_0x1e76e2[_0x04c6('0x3c')])){return _0x2d3277[_0x04c6('0x35')](0x193)[_0x04c6('0x2a')]({'message':_0x04c6('0x3d')});}_0x49c179[_0x04c6('0x23')]={'id':_0x6e43fb['id']};_0x41e29f();});})[_0x04c6('0x2d')](function(_0x3e59b2){_0x41e29f(_0x3e59b2);});}else if(_0x13f2dc){_0x41e29f();}else{return _0x2d3277[_0x04c6('0x35')](0x193)[_0x04c6('0x2a')]({'message':_0x04c6('0x37')});}})[_0x04c6('0x22')](function(_0x973c16,_0x46eccb,_0x3d56ea){if(_0x973c16[_0x04c6('0x23')]){db['User'][_0x04c6('0x3e')]({'where':{'id':_0x973c16[_0x04c6('0x23')]['id']},'attributes':userAttributes})[_0x04c6('0x28')](function(_0x206e32){if(!_0x206e32){return _0x46eccb['status'](0x194)[_0x04c6('0x2a')]({'message':_0x04c6('0x3f')});}_0x973c16['user']=_0x206e32;_0x3d56ea();})['catch'](function(_0x4aac49){_0x3d56ea(_0x4aac49);});}else if(_0x13f2dc){_0x3d56ea();}else{return _0x46eccb[_0x04c6('0x35')](0x194)[_0x04c6('0x2a')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x04c6('0x40')]=function canUpdate(){return compose()['use'](function(_0x15c270,_0x1373ca,_0x3806ea){return require(_0x04c6('0x41'))['getLicense']()['then'](function(_0x2955e6){if(_0x2955e6[_0x04c6('0x42')]){_0x3806ea();}else{return _0x1373ca['status'](0x193)[_0x04c6('0x2a')]({'message':'Forbidden'});}})['catch'](function(_0x317350){_0x3806ea(_0x317350);});});};exports['isMiddleware']=function(_0x181d3f,_0x191ce7,_0x59ca18){_0x181d3f[_0x04c6('0x43')]=!![];return _0x59ca18();};exports['signToken']=function signToken(_0x1dafa5){return signJwt(_0x1dafa5);};exports[_0x04c6('0x44')]=function(_0x2d83eb,_0x120238){if(!_0x2d83eb[_0x04c6('0x23')]){return _0x120238['status'](0x194)[_0x04c6('0x2a')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x74f1d1={'payload':{'id':_0x2d83eb['user']['id'],'role':_0x2d83eb[_0x04c6('0x23')][_0x04c6('0x7')]},'options':{'expiresIn':0x15180}};return signJwt(_0x74f1d1)[_0x04c6('0x28')](function(_0x447b54){_0x120238[_0x04c6('0x45')](_0x04c6('0x46'),_0x447b54);_0x120238[_0x04c6('0x47')]('/dashboards/general');})[_0x04c6('0x2d')](function(_0x4c7a2e){return _0x120238[_0x04c6('0x35')](0x1f4)['send'](_0x4c7a2e);});};exports['retrieveApiKey']=function(_0x463222){if(_['isNil'](_0x463222[_0x04c6('0x48')])||_[_0x04c6('0x49')](_0x463222[_0x04c6('0x4a')])){return null;}else{return createJwt(_0x463222);}};exports['generateApiKey']=function(_0x3df00c){_0x3df00c[_0x04c6('0x48')]=generateNonce();_0x3df00c[_0x04c6('0x4a')]=generateIssuedAt();return createJwt(_0x3df00c);};exports[_0x04c6('0x4b')]=function(_0x21a6a2,_0x5782c5){var _0x240a22=_0x21a6a2['query']['apikey'];if(_0x240a22){var _0x56820={'nonce':_0x5782c5[_0x04c6('0x48')],'iat':_0x5782c5[_0x04c6('0x4a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x04c6('0x4c')]()};return verifyJwt(_0x240a22,_0x56820)[_0x04c6('0x28')](function(){return generateApiKey(_0x5782c5);});}else{throw{'message':_0x04c6('0x4d')};}};function signJwt(_0x549911){var _0x4c9942=BPromise['promisify'](jwt[_0x04c6('0x4e')],{'context':jwt});var _0x25c185=_0x549911['secret']||config[_0x04c6('0x5')][_0x04c6('0x6')];return new BPromise(function(_0x2bd045,_0x4ef366){_0x4c9942(_0x549911[_0x04c6('0x4f')],_0x25c185,_0x549911[_0x04c6('0x50')])['then'](function(_0x25a6fc){_0x2bd045(_0x25a6fc);})[_0x04c6('0x2d')](function(_0x2472ed){_0x4ef366(_0x2472ed);});});}function verifyJwt(_0xee2822,_0x4cfde2,_0x46f0ac){var _0x461549=BPromise[_0x04c6('0x51')](jwt[_0x04c6('0x52')],{'context':jwt});var _0x5155aa=_0x46f0ac||config[_0x04c6('0x5')][_0x04c6('0x6')];return new BPromise(function(_0x4e876f,_0x168933){_0x461549(_0xee2822,_0x5155aa,_0x4cfde2)['then'](function(_0x3a338d){_0x4e876f(_0x3a338d);})[_0x04c6('0x2d')](function(_0x15ec61){_0x168933(_0x15ec61);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x04c6('0x53')](_0x04c6('0x54'));}function generateIssuedAt(){return Math[_0x04c6('0x55')](Date[_0x04c6('0x56')]()/0x3e8)[_0x04c6('0x53')]();}function createJwt(_0x28e563){var _0x1b8fa4={'payload':{'iat':_0x28e563[_0x04c6('0x4a')],'nonce':_0x28e563[_0x04c6('0x48')]},'options':{'algorithm':_0x04c6('0x57'),'subject':_0x28e563['id'][_0x04c6('0x53')](),'issuer':hardwareConf[_0x04c6('0x4c')](),'audience':hardwareConf[_0x04c6('0x4c')]()}};return signJwt(_0x1b8fa4)['then'](function(_0x3a80f6){return{'iat':_0x28e563[_0x04c6('0x4a')],'nonce':_0x28e563[_0x04c6('0x48')],'token':_0x3a80f6};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 107b37f..309c195 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 _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x25003c,_0x53b9d3){var _0x18ac03=function(_0x3df459){while(--_0x3df459){_0x25003c['push'](_0x25003c['shift']());}};_0x18ac03(++_0x53b9d3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x3071('0x0')};function combineOptions(_0x2afa91){var _0x27405a={};for(var _0x305d85 in defaultOptions){if(defaultOptions[_0x3071('0x1')](_0x305d85)){_0x27405a[_0x305d85]=defaultOptions[_0x305d85];}}if(_0x2afa91){for(var _0x52b5fb in _0x2afa91){if(_0x2afa91[_0x3071('0x1')](_0x52b5fb)){_0x27405a[_0x52b5fb]=_0x2afa91[_0x52b5fb];}}}return _0x27405a;}exports[_0x3071('0x2')]=function(_0x33a70c,_0x3137c8,_0xabd7b6,_0x41cf76){return new BPromise(function(_0x1d3dd6,_0x2f1e87){_0x41cf76=combineOptions(_0x41cf76);var _0xbd737f=new Buffer(_0xabd7b6);var _0x22274c=fs[_0x3071('0x3')](_0x33a70c);var _0x2fce7a=fs[_0x3071('0x4')](_0x3137c8);var _0x4a36ec=crypto[_0x3071('0x5')](_0x41cf76[_0x3071('0x6')],_0xbd737f);_0x22274c['on'](_0x3071('0x7'),function(_0xff9a29){var _0x1ce844=new Buffer(_0x4a36ec['update'](_0xff9a29),_0x3071('0x8'));_0x2fce7a[_0x3071('0x9')](_0x1ce844);});_0x22274c['on'](_0x3071('0xa'),function(){try{var _0x3ed4a0=new Buffer(_0x4a36ec[_0x3071('0xb')]('binary'),'binary');_0x2fce7a[_0x3071('0x9')](_0x3ed4a0);_0x2fce7a['end']();_0x2fce7a['on'](_0x3071('0xc'),function(){return _0x1d3dd6(_0x3137c8);});}catch(_0x44fbae){fs['unlink'](_0x3137c8);return _0x2f1e87(_0x44fbae);}});});};exports[_0x3071('0xd')]=function(_0x4e1219,_0x2fc15d,_0x45c93b,_0x1271d0){return new BPromise(function(_0x1f14e1,_0x1caa5d){_0x1271d0=combineOptions(_0x1271d0);var _0x2a6a4b=new Buffer(_0x45c93b);var _0x157a47=fs[_0x3071('0x3')](_0x4e1219);var _0x21aad3=fs[_0x3071('0x4')](_0x2fc15d);var _0x5f3c22=crypto[_0x3071('0xe')](_0x1271d0[_0x3071('0x6')],_0x2a6a4b);_0x157a47['on'](_0x3071('0x7'),function(_0x108a83){var _0x3acf0e=new Buffer(_0x5f3c22[_0x3071('0xf')](_0x108a83),_0x3071('0x8'));_0x21aad3[_0x3071('0x9')](_0x3acf0e);});_0x157a47['on']('end',function(){try{var _0x359e66=new Buffer(_0x5f3c22[_0x3071('0xb')](_0x3071('0x8')),'binary');_0x21aad3[_0x3071('0x9')](_0x359e66);_0x21aad3['end']();_0x21aad3['on'](_0x3071('0xc'),function(){return _0x1f14e1(_0x2fc15d);});}catch(_0x43128c){fs[_0x3071('0x10')](_0x2fc15d);return _0x1caa5d(_0x43128c);}});});}; \ No newline at end of file +var _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x5bcb16,_0x1b955f){var _0xe86558=function(_0x401279){while(--_0x401279){_0x5bcb16['push'](_0x5bcb16['shift']());}};_0xe86558(++_0x1b955f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xb7e7[_0x9df060];return _0x338dfe;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 25884e7..d2f2ba9 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 _0x9f62=['find','split','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x9f62,0x154));var _0x29f6=function(_0x1f9307,_0x5d63c0){_0x1f9307=_0x1f9307-0x0;var _0x5d4ae4=_0x9f62[_0x1f9307];return _0x5d4ae4;};'use strict';var util=require('util');var path=require(_0x29f6('0x0'));var _=require('lodash');var csv=require(_0x29f6('0x1'));var fs=require('fs');var BPromise=require(_0x29f6('0x2'));var zipdir=require(_0x29f6('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x29f6('0x4'))[_0x29f6('0x5')];var logger=require(_0x29f6('0x6'))(_0x29f6('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x29f6('0x8')][0x3];var PATH=process[_0x29f6('0x8')][0x4];function analyticExtractedReport(_0x9a43fe,_0x2ba602){var _0x416c6c={'status':_0x9a43fe};var _0x5e9945={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ba602){_0x416c6c['savename']=_0x2ba602;}return db['AnalyticExtractedReport']['update'](_0x416c6c,_0x5e9945);}function main(){var _0xe25841=0x1388;var _0x44db16;logger['info'](util['format'](_0x29f6('0x9'),EXTRACTED_REPORT_ID,_0x29f6('0xa')));return db['Setting'][_0x29f6('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x29f6('0xc'),'splitSizeCsv']})['then'](function(_0x559585){if(_0x559585){_0x44db16=_0x559585;_0xe25841=_0x44db16['splitSizeCsv']||0x1388;}})[_0x29f6('0xd')](function(){return dbH[_0x29f6('0xe')][_0x29f6('0xf')](util[_0x29f6('0x10')](_0x29f6('0x11'),QUERY),{'type':dbH[_0x29f6('0xe')][_0x29f6('0x12')][_0x29f6('0x13')]});})[_0x29f6('0xd')](function(_0x19331f){if(!_0x19331f[0x0][_0x29f6('0x14')]){return analyticExtractedReport(_0x29f6('0x15'));}var _0x1dde97=[];var _0x3a75d0=0x0;var _0x25e5a2=!![];if(_0x19331f&&_0x19331f[_0x29f6('0x16')]){var _0x3584a1=_0x19331f[0x0]['num']%(_0x3a75d0+_0xe25841);if(_0x44db16['split']){for(;_0x25e5a2;_0x3a75d0+=_0xe25841,_0x3584a1=_0x19331f[0x0][_0x29f6('0x14')]%(_0x3a75d0+_0xe25841)){if(_0x3584a1==0x0||_0x3584a1==_0x19331f[0x0][_0x29f6('0x14')]){_0x25e5a2=![];}_0x1dde97[_0x29f6('0x17')](dbH['sequelize'][_0x29f6('0xf')](util[_0x29f6('0x10')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe25841,_0x3a75d0),{'type':dbH[_0x29f6('0xe')][_0x29f6('0x12')][_0x29f6('0x13')]}));}}else{_0x1dde97[_0x29f6('0x17')](dbH[_0x29f6('0xe')][_0x29f6('0xf')](QUERY,{'type':dbH['sequelize'][_0x29f6('0x12')]['SELECT']}));}}var _0x4acb15=path[_0x29f6('0x18')](PATH);var _0x1fa159=path[_0x29f6('0x19')](PATH,_0x29f6('0x1a'));var _0x54ddeb=_0x44db16[_0x29f6('0xc')]&&_0x1dde97['length']>0x1;var _0xd4179c=[];if(!fs[_0x29f6('0x1b')](path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159))&&_0x54ddeb){fs[_0x29f6('0x1d')](path['join'](_0x4acb15,_0x1fa159));}return BPromise[_0x29f6('0x1e')](_0x1dde97,function(_0x4d494f){_0xd4179c['push'](_0x4d494f);})[_0x29f6('0xd')](function(){for(var _0x45f792=0x0;_0x45f792<_0xd4179c[_0x29f6('0x16')];_0x45f792+=0x1){var _0x342038;var _0x84ccb7=_0xd4179c[_0x45f792];if(_0x54ddeb){_0x342038=path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159,util[_0x29f6('0x10')]('%s%d.%s',_0x1fa159,_0x45f792,_0x29f6('0x1f')));}else{_0x342038=path[_0x29f6('0x1c')](_0x4acb15,util[_0x29f6('0x10')](_0x29f6('0x20'),_0x1fa159,_0x29f6('0x1f')));}fs[_0x29f6('0x21')](_0x342038,csv(_0x84ccb7));}})[_0x29f6('0xd')](function(){if(_0x54ddeb){zipdir(path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159),{'saveTo':path[_0x29f6('0x1c')](_0x4acb15,util[_0x29f6('0x10')](_0x29f6('0x20'),_0x1fa159,_0x29f6('0x22')))},function(_0x40c830,_0x304c28){});rimraf(path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159),function(){});}})[_0x29f6('0xd')](function(){logger[_0x29f6('0x23')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x29f6('0xa')));return analyticExtractedReport('Completed',_0x54ddeb?util[_0x29f6('0x10')](_0x29f6('0x20'),_0x1fa159,_0x54ddeb?_0x29f6('0x22'):_0x29f6('0x1f')):null);});})['catch'](function(_0x53e11f){logger[_0x29f6('0x23')](util[_0x29f6('0x10')](_0x29f6('0x24'),EXTRACTED_REPORT_ID,_0x29f6('0xa')),util[_0x29f6('0x25')](_0x53e11f,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x29f6('0x26'));});}main(); \ No newline at end of file +var _0x17ba=['then','sequelize','query','SELECT','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','split','existsSync','join','each','push','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x17ba,0xab));var _0xa17b=function(_0x4f0f0a,_0x56259f){_0x4f0f0a=_0x4f0f0a-0x0;var _0x378d6c=_0x17ba[_0x4f0f0a];return _0x378d6c;};'use strict';var util=require(_0xa17b('0x0'));var path=require(_0xa17b('0x1'));var _=require('lodash');var csv=require(_0xa17b('0x2'));var fs=require('fs');var BPromise=require(_0xa17b('0x3'));var zipdir=require(_0xa17b('0x4'));var rimraf=require(_0xa17b('0x5'));var db=require(_0xa17b('0x6'))['db'];var dbH=require(_0xa17b('0x6'))[_0xa17b('0x7')];var logger=require(_0xa17b('0x8'))(_0xa17b('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xa17b('0xa')][0x2]);var QUERY=process[_0xa17b('0xa')][0x3];var PATH=process[_0xa17b('0xa')][0x4];function analyticExtractedReport(_0x1957be,_0x57f9cd){var _0x2ca4d3={'status':_0x1957be};var _0x17d1d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57f9cd){_0x2ca4d3[_0xa17b('0xb')]=_0x57f9cd;}return db[_0xa17b('0xc')][_0xa17b('0xd')](_0x2ca4d3,_0x17d1d2);}function main(){var _0x578799=0x1388;var _0x2556c4;logger[_0xa17b('0xe')](util[_0xa17b('0xf')](_0xa17b('0x10'),EXTRACTED_REPORT_ID,_0xa17b('0x11')));return db[_0xa17b('0x12')][_0xa17b('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa17b('0x14')]})[_0xa17b('0x15')](function(_0x3c3a8a){if(_0x3c3a8a){_0x2556c4=_0x3c3a8a;_0x578799=_0x2556c4['splitSizeCsv']||0x1388;}})[_0xa17b('0x15')](function(){return dbH[_0xa17b('0x16')][_0xa17b('0x17')](util[_0xa17b('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa17b('0x16')]['QueryTypes'][_0xa17b('0x18')]});})[_0xa17b('0x15')](function(_0x5de138){if(!_0x5de138[0x0][_0xa17b('0x19')]){return analyticExtractedReport(_0xa17b('0x1a'));}var _0x1c0578=[];var _0x1f8141=0x0;var _0x4870fb=!![];if(_0x5de138&&_0x5de138[_0xa17b('0x1b')]){var _0x5e21c2=_0x5de138[0x0]['num']%(_0x1f8141+_0x578799);if(_0x2556c4['split']){for(;_0x4870fb;_0x1f8141+=_0x578799,_0x5e21c2=_0x5de138[0x0][_0xa17b('0x19')]%(_0x1f8141+_0x578799)){if(_0x5e21c2==0x0||_0x5e21c2==_0x5de138[0x0][_0xa17b('0x19')]){_0x4870fb=![];}_0x1c0578['push'](dbH[_0xa17b('0x16')][_0xa17b('0x17')](util[_0xa17b('0xf')](_0xa17b('0x1c'),QUERY,_0x578799,_0x1f8141),{'type':dbH[_0xa17b('0x16')][_0xa17b('0x1d')][_0xa17b('0x18')]}));}}else{_0x1c0578['push'](dbH[_0xa17b('0x16')][_0xa17b('0x17')](QUERY,{'type':dbH[_0xa17b('0x16')]['QueryTypes'][_0xa17b('0x18')]}));}}var _0x1a6471=path[_0xa17b('0x1e')](PATH);var _0xbbbb62=path[_0xa17b('0x1f')](PATH,_0xa17b('0x20'));var _0x52309c=_0x2556c4[_0xa17b('0x21')]&&_0x1c0578['length']>0x1;var _0xa34739=[];if(!fs[_0xa17b('0x22')](path['join'](_0x1a6471,_0xbbbb62))&&_0x52309c){fs['mkdirSync'](path[_0xa17b('0x23')](_0x1a6471,_0xbbbb62));}return BPromise[_0xa17b('0x24')](_0x1c0578,function(_0x4216ca){_0xa34739[_0xa17b('0x25')](_0x4216ca);})[_0xa17b('0x15')](function(){for(var _0x3a64f5=0x0;_0x3a64f5<_0xa34739['length'];_0x3a64f5+=0x1){var _0x47aff8;var _0x5c98fe=_0xa34739[_0x3a64f5];if(_0x52309c){_0x47aff8=path['join'](_0x1a6471,_0xbbbb62,util[_0xa17b('0xf')]('%s%d.%s',_0xbbbb62,_0x3a64f5,_0xa17b('0x26')));}else{_0x47aff8=path['join'](_0x1a6471,util[_0xa17b('0xf')](_0xa17b('0x27'),_0xbbbb62,_0xa17b('0x26')));}fs[_0xa17b('0x28')](_0x47aff8,csv(_0x5c98fe));}})[_0xa17b('0x15')](function(){if(_0x52309c){zipdir(path[_0xa17b('0x23')](_0x1a6471,_0xbbbb62),{'saveTo':path[_0xa17b('0x23')](_0x1a6471,util[_0xa17b('0xf')](_0xa17b('0x27'),_0xbbbb62,_0xa17b('0x29')))},function(_0xe84db5,_0x573585){});rimraf(path['join'](_0x1a6471,_0xbbbb62),function(){});}})['then'](function(){logger[_0xa17b('0xe')](util[_0xa17b('0xf')](_0xa17b('0x2a'),EXTRACTED_REPORT_ID,_0xa17b('0x11')));return analyticExtractedReport(_0xa17b('0x2b'),_0x52309c?util[_0xa17b('0xf')](_0xa17b('0x27'),_0xbbbb62,_0x52309c?_0xa17b('0x29'):'csv'):null);});})[_0xa17b('0x2c')](function(_0x4da126){logger[_0xa17b('0xe')](util[_0xa17b('0xf')](_0xa17b('0x2d'),EXTRACTED_REPORT_ID,_0xa17b('0x11')),util[_0xa17b('0x2e')](_0x4da126,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xa17b('0x2f'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c45277f..c0f682a 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 _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','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','createWriteStream','finish','err','end','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','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x2661c6,_0x53b30e){var _0x6422f9=function(_0x2e2624){while(--_0x2e2624){_0x2661c6['push'](_0x2661c6['shift']());}};_0x6422f9(++_0x53b30e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x41e7ec,_0x36e5ee){_0x41e7ec=_0x41e7ec-0x0;var _0x533d0f=_0x5f2f[_0x41e7ec];return _0x533d0f;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x43811a,_0x3ca227){var _0x4fdd6d=function(_0x30e9d6){while(--_0x30e9d6){_0x43811a['push'](_0x43811a['shift']());}};_0x4fdd6d(++_0x3ca227);}(_0xb10b,0x12a));var _0xbb10=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0xb10b[_0x44f974];return _0x805dbd;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 282908a..cd1faa2 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 _0x1048=['inspect','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.xlsx','length','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0xf8211c,_0x5c48dd){var _0x22689f=function(_0x5b1bcd){while(--_0x5b1bcd){_0xf8211c['push'](_0xf8211c['shift']());}};_0x22689f(++_0x5c48dd);}(_0x1048,0xec));var _0x8104=function(_0x29c199,_0x481beb){_0x29c199=_0x29c199-0x0;var _0x46ed29=_0x1048[_0x29c199];return _0x46ed29;};'use strict';var util=require(_0x8104('0x0'));var path=require(_0x8104('0x1'));var _=require(_0x8104('0x2'));var fs=require('fs');var json2xls=require(_0x8104('0x3'));var BPromise=require(_0x8104('0x4'));var zipdir=require(_0x8104('0x5'));var rimraf=require(_0x8104('0x6'));var db=require(_0x8104('0x7'))['db'];var dbH=require(_0x8104('0x7'))[_0x8104('0x8')];var logger=require(_0x8104('0x9'))(_0x8104('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x8104('0xb')][0x2]);var QUERY=process[_0x8104('0xb')][0x3];var PATH=process[_0x8104('0xb')][0x4];function analyticExtractedReport(_0xd1566e,_0x24d5c4){var _0x322cc1={'status':_0xd1566e};var _0x300c61={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x24d5c4){_0x322cc1[_0x8104('0xc')]=_0x24d5c4;}return db[_0x8104('0xd')][_0x8104('0xe')](_0x322cc1,_0x300c61);}function main(){var _0x296432=0x1388;var _0x8e9b06;logger[_0x8104('0xf')](util['format'](_0x8104('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x8104('0x11')][_0x8104('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8104('0x13')]})[_0x8104('0x14')](function(_0x317973){if(_0x317973){_0x8e9b06=_0x317973;_0x296432=_0x8e9b06[_0x8104('0x13')]||0x1388;}})[_0x8104('0x14')](function(){return dbH['sequelize'][_0x8104('0x15')](util[_0x8104('0x16')](_0x8104('0x17'),QUERY),{'type':dbH[_0x8104('0x18')][_0x8104('0x19')][_0x8104('0x1a')]});})['then'](function(_0x4bff55){if(!_0x4bff55[0x0][_0x8104('0x1b')]){return analyticExtractedReport(_0x8104('0x1c'));}var _0x2a88f9=[];var _0x2d69c3=0x0;var _0x450121=!![];if(_0x8e9b06[_0x8104('0x1d')]){if(_0x4bff55&&_0x4bff55['length']){var _0x294cb5=_0x4bff55[0x0][_0x8104('0x1b')]%(_0x2d69c3+_0x296432);for(;_0x450121;_0x2d69c3+=_0x296432,_0x294cb5=_0x4bff55[0x0]['num']%(_0x2d69c3+_0x296432)){if(_0x294cb5==0x0||_0x294cb5==_0x4bff55[0x0][_0x8104('0x1b')]){_0x450121=![];}_0x2a88f9[_0x8104('0x1e')](dbH[_0x8104('0x18')][_0x8104('0x15')](util[_0x8104('0x16')](_0x8104('0x1f'),QUERY,_0x296432,_0x2d69c3),{'type':dbH[_0x8104('0x18')][_0x8104('0x19')][_0x8104('0x1a')]}));}}}else{_0x2a88f9[_0x8104('0x1e')](dbH[_0x8104('0x18')][_0x8104('0x15')](QUERY,{'type':dbH['sequelize'][_0x8104('0x19')]['SELECT']}));}var _0x111383=path['dirname'](PATH);var _0x4b7acb=path['basename'](PATH,_0x8104('0x20'));var _0x3f2826=_0x8e9b06['split']&&_0x2a88f9[_0x8104('0x21')]>0x1;var _0x508c17=[];if(!fs[_0x8104('0x22')](path[_0x8104('0x23')](_0x111383,_0x4b7acb))&&_0x3f2826){fs[_0x8104('0x24')](path[_0x8104('0x23')](_0x111383,_0x4b7acb));}return BPromise[_0x8104('0x25')](_0x2a88f9,function(_0x3f9dfd){_0x508c17[_0x8104('0x1e')](_0x3f9dfd);})[_0x8104('0x14')](function(){for(var _0x2754f9=0x0;_0x2754f9<_0x508c17[_0x8104('0x21')];_0x2754f9+=0x1){var _0x31e5fd;var _0x390780=_0x508c17[_0x2754f9];if(_0x3f2826){_0x31e5fd=path[_0x8104('0x23')](_0x111383,_0x4b7acb,util[_0x8104('0x16')]('%s%d.%s',_0x4b7acb,_0x2754f9,_0x8104('0x26')));}else{_0x31e5fd=path[_0x8104('0x23')](_0x111383,util['format'](_0x8104('0x27'),_0x4b7acb,'xlsx'));}fs['writeFileSync'](_0x31e5fd,json2xls(_0x390780),_0x8104('0x28'));}})[_0x8104('0x14')](function(){if(_0x3f2826){zipdir(path[_0x8104('0x23')](_0x111383,_0x4b7acb),{'saveTo':path[_0x8104('0x23')](_0x111383,util[_0x8104('0x16')]('%s.%s',_0x4b7acb,_0x8104('0x29')))},function(_0x465337,_0x4abc6f){});rimraf(path['join'](_0x111383,_0x4b7acb),function(){});}})[_0x8104('0x14')](function(){logger[_0x8104('0xf')](util[_0x8104('0x16')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x8104('0x2a'),_0x3f2826?util['format'](_0x8104('0x27'),_0x4b7acb,_0x3f2826?_0x8104('0x29'):'xlsx'):null);});})[_0x8104('0x2b')](function(_0x3abfb6){logger[_0x8104('0xf')](util[_0x8104('0x16')](_0x8104('0x2c'),EXTRACTED_REPORT_ID,_0x8104('0x2d')),util[_0x8104('0x2e')](_0x3abfb6,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x391f=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','split','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','push','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update'];(function(_0x12cc8f,_0x2b464d){var _0xc7b02c=function(_0x4a927a){while(--_0x4a927a){_0x12cc8f['push'](_0x12cc8f['shift']());}};_0xc7b02c(++_0x2b464d);}(_0x391f,0x10c));var _0xf391=function(_0x58fded,_0x9d34b3){_0x58fded=_0x58fded-0x0;var _0x565ab5=_0x391f[_0x58fded];return _0x565ab5;};'use strict';var util=require(_0xf391('0x0'));var path=require(_0xf391('0x1'));var _=require(_0xf391('0x2'));var fs=require('fs');var json2xls=require(_0xf391('0x3'));var BPromise=require(_0xf391('0x4'));var zipdir=require(_0xf391('0x5'));var rimraf=require(_0xf391('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf391('0x7'))[_0xf391('0x8')];var logger=require(_0xf391('0x9'))(_0xf391('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf391('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf391('0xb')][0x4];function analyticExtractedReport(_0x3d0981,_0x25de03){var _0x202a8a={'status':_0x3d0981};var _0x976646={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25de03){_0x202a8a['savename']=_0x25de03;}return db[_0xf391('0xc')][_0xf391('0xd')](_0x202a8a,_0x976646);}function main(){var _0x44bccf=0x1388;var _0x4f24b6;logger['info'](util[_0xf391('0xe')](_0xf391('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xf391('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf391('0x11')]})[_0xf391('0x12')](function(_0x3fde73){if(_0x3fde73){_0x4f24b6=_0x3fde73;_0x44bccf=_0x4f24b6['splitSizeXlsx']||0x1388;}})[_0xf391('0x12')](function(){return dbH[_0xf391('0x13')][_0xf391('0x14')](util[_0xf391('0xe')](_0xf391('0x15'),QUERY),{'type':dbH[_0xf391('0x13')]['QueryTypes'][_0xf391('0x16')]});})[_0xf391('0x12')](function(_0x5a92e1){if(!_0x5a92e1[0x0][_0xf391('0x17')]){return analyticExtractedReport('Empty');}var _0xbaeaba=[];var _0x3cab92=0x0;var _0x126a61=!![];if(_0x4f24b6[_0xf391('0x18')]){if(_0x5a92e1&&_0x5a92e1[_0xf391('0x19')]){var _0x5d61d0=_0x5a92e1[0x0]['num']%(_0x3cab92+_0x44bccf);for(;_0x126a61;_0x3cab92+=_0x44bccf,_0x5d61d0=_0x5a92e1[0x0][_0xf391('0x17')]%(_0x3cab92+_0x44bccf)){if(_0x5d61d0==0x0||_0x5d61d0==_0x5a92e1[0x0][_0xf391('0x17')]){_0x126a61=![];}_0xbaeaba['push'](dbH[_0xf391('0x13')][_0xf391('0x14')](util[_0xf391('0xe')](_0xf391('0x1a'),QUERY,_0x44bccf,_0x3cab92),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0xbaeaba['push'](dbH['sequelize'][_0xf391('0x14')](QUERY,{'type':dbH[_0xf391('0x13')][_0xf391('0x1b')][_0xf391('0x16')]}));}var _0x5f481c=path[_0xf391('0x1c')](PATH);var _0x2b6fa0=path[_0xf391('0x1d')](PATH,_0xf391('0x1e'));var _0x160bb0=_0x4f24b6['split']&&_0xbaeaba[_0xf391('0x19')]>0x1;var _0x54632e=[];if(!fs[_0xf391('0x1f')](path['join'](_0x5f481c,_0x2b6fa0))&&_0x160bb0){fs[_0xf391('0x20')](path[_0xf391('0x21')](_0x5f481c,_0x2b6fa0));}return BPromise[_0xf391('0x22')](_0xbaeaba,function(_0x1a6f70){_0x54632e[_0xf391('0x23')](_0x1a6f70);})[_0xf391('0x12')](function(){for(var _0x29e9a0=0x0;_0x29e9a0<_0x54632e[_0xf391('0x19')];_0x29e9a0+=0x1){var _0x10b25f;var _0x3f18ca=_0x54632e[_0x29e9a0];if(_0x160bb0){_0x10b25f=path[_0xf391('0x21')](_0x5f481c,_0x2b6fa0,util[_0xf391('0xe')](_0xf391('0x24'),_0x2b6fa0,_0x29e9a0,_0xf391('0x25')));}else{_0x10b25f=path['join'](_0x5f481c,util[_0xf391('0xe')]('%s.%s',_0x2b6fa0,_0xf391('0x25')));}fs[_0xf391('0x26')](_0x10b25f,json2xls(_0x3f18ca),_0xf391('0x27'));}})[_0xf391('0x12')](function(){if(_0x160bb0){zipdir(path[_0xf391('0x21')](_0x5f481c,_0x2b6fa0),{'saveTo':path['join'](_0x5f481c,util[_0xf391('0xe')](_0xf391('0x28'),_0x2b6fa0,_0xf391('0x29')))},function(_0x355d33,_0x35c652){});rimraf(path[_0xf391('0x21')](_0x5f481c,_0x2b6fa0),function(){});}})[_0xf391('0x12')](function(){logger['info'](util['format'](_0xf391('0x2a'),EXTRACTED_REPORT_ID,_0xf391('0x2b')));return analyticExtractedReport(_0xf391('0x2c'),_0x160bb0?util['format'](_0xf391('0x28'),_0x2b6fa0,_0x160bb0?_0xf391('0x29'):'xlsx'):null);});})[_0xf391('0x2d')](function(_0x23aec5){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf391('0x2b')),util['inspect'](_0x23aec5,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xf391('0x2e'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4e5d49b..ae563eb 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 _0x6c4d=['findAll','then','VoiceExtension','IntervalId','uniq','map','exten','filter','groupBy','queue','playback','priority','extension','extensions','push','type','Set','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','toLowerCase','createdAt','interval','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','bulkCreate','sortBy','catch','error','rewrite','lodash','models','Interval'];(function(_0x357a14,_0x3b59c8){var _0x52ff73=function(_0x2fd785){while(--_0x2fd785){_0x357a14['push'](_0x357a14['shift']());}};_0x52ff73(++_0x3b59c8);}(_0x6c4d,0x1dd));var _0xd6c4=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6c4d[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xd6c4('0x0'));var util=require('util');function rewrite(_0x280f64,_0x5d4581){var _0x955905=this;return _0x280f64[_0xd6c4('0x1')][_0xd6c4('0x2')][_0xd6c4('0x3')]({'raw':!![]})[_0xd6c4('0x4')](function(_0x3e523f){_0x955905['intervals']=_0x3e523f;return _0x280f64[_0xd6c4('0x1')][_0xd6c4('0x5')][_0xd6c4('0x3')]({'where':{'IntervalId':_0x5d4581[_0xd6c4('0x6')]},'raw':!![]});})['then'](function(_0x14b89c){return _0x280f64['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0xd6c4('0x7')](_[_0xd6c4('0x8')](_0x14b89c,_0xd6c4('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xd6c4('0x4')](function(_0x32b843){var _0x2ccf5a=_[_0xd6c4('0xa')](_0x32b843,{'priority':'1'});var _0x354b5c=_[_0xd6c4('0xa')](_0x32b843,{'isApp':0x1});var _0x526447=_[_0xd6c4('0xb')](_0x354b5c,_0xd6c4('0x9'));var _0x550135=[_0xd6c4('0xc'),_0xd6c4('0xd')];var _0x4acb37=[];var _0xe8ee38=[];for(var _0x3e2538 in _0x526447){if(_0x526447['hasOwnProperty'](_0x3e2538)){_0x955905[_0xd6c4('0xe')]=0x2;_0x955905['extensions']=[];_0x955905[_0xd6c4('0xf')]=_['find'](_0x2ccf5a,{'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')]});_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':_0xd6c4('0x13'),'appdata':util['format']('CDR(type)=%s',_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')]),'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});if(_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')]===_0xd6c4('0x16')){if(_0x955905[_0xd6c4('0xf')]){_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':'Set','appdata':_0xd6c4('0x17')+(_0x955905['extension'][_0xd6c4('0x18')]?_0xd6c4('0x19')+_0x955905[_0xd6c4('0xf')][_0xd6c4('0x18')]+'}':_0xd6c4('0x1a')),'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0]['VoiceExtensionId']});}_0x955905[_0xd6c4('0x10')]['push']({'type':_0x526447[_0x3e2538][0x0]['type'],'app':_0xd6c4('0x13'),'appdata':_0xd6c4('0x1b')+_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')],'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});var _0x2745b9=_0x955905[_0xd6c4('0xe')]++;_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':_0xd6c4('0x1c'),'appdata':_0xd6c4('0x1d')+(_0x2745b9+0x2)+_0xd6c4('0x1e')+(_0x2745b9+0x1)+')','context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x2745b9,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});if(_0x955905[_0xd6c4('0xf')]){_0x955905[_0xd6c4('0x10')]['push']({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':'Set','appdata':_0x955905['extension'][_0xd6c4('0x18')]?_0xd6c4('0x1f')+_0x955905[_0xd6c4('0xf')]['cutdigits']+'}':_0xd6c4('0x20'),'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0]['exten'],'priority':_0x955905['priority']++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0]['VoiceExtensionId']});}_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':_0xd6c4('0x13'),'appdata':_0xd6c4('0x21')+_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')],'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});if(_0x955905[_0xd6c4('0xf')]&&_0x955905['extension'][_0xd6c4('0x22')]('recordingFormat')&&_0x955905['extension'][_0xd6c4('0x23')]!=='none'){_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0]['type'],'app':_0xd6c4('0x13'),'appdata':_0xd6c4('0x24'),'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0]['exten'],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});_0x955905['extensions']['push']({'type':_0x526447[_0x3e2538][0x0]['type'],'app':_0xd6c4('0x13'),'appdata':_0xd6c4('0x25')+_0x955905['extension'][_0xd6c4('0x23')]||'wav','context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905['priority']++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});}}_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':_0xd6c4('0x13'),'appdata':_0xd6c4('0x26'),'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0]['exten'],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0]['type'],'app':_0xd6c4('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});_0x955905[_0xd6c4('0x10')]['push']({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':_0xd6c4('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x526447[_0x3e2538][0x0]['context'],'exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'priority':_0x955905[_0xd6c4('0xe')]++,'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});for(var _0x4e28ed=0x0,_0x501ff1=0x0;_0x4e28ed<_0x526447[_0x3e2538]['length'];_0x4e28ed+=0x1,_0x501ff1=0x0){var _0x306495=_0x526447[_0x3e2538][_0x4e28ed];if(_0x306495[_0xd6c4('0x12')]){_0x306495[_0xd6c4('0x12')]=_0x306495[_0xd6c4('0x12')][_0xd6c4('0x27')]();}var _0x290065=[];var _0x517426=[];delete _0x306495['id'];delete _0x306495[_0xd6c4('0x28')];delete _0x306495['updatedAt'];var _0x13ca8e=_0x306495[_0xd6c4('0x29')]!=='*,*,*,*'?[_0x306495[_0xd6c4('0x29')]]:_0x306495['IntervalId']?_[_0xd6c4('0x8')](_[_0xd6c4('0xa')](_0x955905['intervals'],{'IntervalId':_0x306495['IntervalId']}),'interval'):[];if(_0x306495[_0xd6c4('0x22')](_0xd6c4('0x2a'))){if(_0x306495['tag']&&_0x306495['tag']!=='--'){_0x290065['push']({'type':_0x306495[_0xd6c4('0x12')],'app':'Set','appdata':'CDR(tag)='+_0x306495[_0xd6c4('0x2a')],'context':_0x306495[_0xd6c4('0x14')],'exten':_0x306495[_0xd6c4('0x9')],'priority':_0x13ca8e[_0xd6c4('0x2b')]+_0x955905['priority']+_0x501ff1++,'VoiceExtensionId':_0x306495[_0xd6c4('0x15')]});}}if(_0x306495[_0xd6c4('0x12')]===_0xd6c4('0x16')&&_0x306495[_0xd6c4('0x22')](_0xd6c4('0x2c'))){if(_0x306495[_0xd6c4('0x2c')]){_0x290065['push']({'type':_0x306495[_0xd6c4('0x12')],'app':_0xd6c4('0x1c'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x306495[_0xd6c4('0x2c')]+')','context':_0x306495[_0xd6c4('0x14')],'exten':_0x306495['exten'],'priority':_0x13ca8e['length']+_0x955905[_0xd6c4('0xe')]+_0x501ff1++,'VoiceExtensionId':_0x306495[_0xd6c4('0x15')]});}else{_0x290065[_0xd6c4('0x11')]({'type':_0x306495['type'],'app':_0xd6c4('0x1c'),'appdata':_0xd6c4('0x2d'),'context':_0x306495['context'],'exten':_0x306495[_0xd6c4('0x9')],'priority':_0x13ca8e['length']+_0x955905[_0xd6c4('0xe')]+_0x501ff1++,'VoiceExtensionId':_0x306495['VoiceExtensionId']});}}if(_0x306495[_0xd6c4('0x22')](_0xd6c4('0x2e'))){if(_0x550135[_0xd6c4('0x2f')](_0x306495['app'][_0xd6c4('0x27')]())>=0x0&&_0x306495['appType']!=='custom'){if(_0x306495['answer']){_0x290065['push']({'type':_0x306495[_0xd6c4('0x12')],'app':_0xd6c4('0x1c'),'appdata':_0xd6c4('0x30'),'context':_0x306495['context'],'exten':_0x306495[_0xd6c4('0x9')],'priority':_0x13ca8e[_0xd6c4('0x2b')]+_0x955905[_0xd6c4('0xe')]+_0x501ff1++,'VoiceExtensionId':_0x306495[_0xd6c4('0x15')]});_0x290065[_0xd6c4('0x11')]({'type':_0x306495[_0xd6c4('0x12')],'app':_0xd6c4('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x306495[_0xd6c4('0x14')],'exten':_0x306495[_0xd6c4('0x9')],'priority':_0x13ca8e['length']+_0x955905[_0xd6c4('0xe')]+_0x501ff1++,'VoiceExtensionId':_0x306495[_0xd6c4('0x15')]});}else{_0x290065[_0xd6c4('0x11')]({'type':_0x306495[_0xd6c4('0x12')],'app':_0xd6c4('0x1c'),'appdata':_0xd6c4('0x31'),'context':_0x306495[_0xd6c4('0x14')],'exten':_0x306495[_0xd6c4('0x9')],'priority':_0x13ca8e[_0xd6c4('0x2b')]+_0x955905[_0xd6c4('0xe')]+_0x501ff1++,'VoiceExtensionId':_0x306495[_0xd6c4('0x15')]});_0x290065[_0xd6c4('0x11')]({'type':_0x306495[_0xd6c4('0x12')],'app':_0xd6c4('0x13'),'appdata':_0xd6c4('0x32'),'context':_0x306495[_0xd6c4('0x14')],'exten':_0x306495[_0xd6c4('0x9')],'priority':_0x13ca8e[_0xd6c4('0x2b')]+_0x955905[_0xd6c4('0xe')]+_0x501ff1++,'VoiceExtensionId':_0x306495['VoiceExtensionId']});}}}for(var _0x1e2d14=0x0;_0x1e2d14<_0x13ca8e[_0xd6c4('0x2b')];_0x1e2d14+=0x1){var _0x437951=_0x955905[_0xd6c4('0xe')]+_0x13ca8e['length'];var _0x307747=_0x1e2d14===_0x13ca8e[_0xd6c4('0x2b')]-0x1?_0x955905[_0xd6c4('0xe')]+_0x290065[_0xd6c4('0x2b')]+_0x517426[_0xd6c4('0x2b')]+0x2:_0x955905[_0xd6c4('0xe')]+_0x1e2d14+0x1;_0x290065[_0xd6c4('0x33')](_0x1e2d14,0x0,{'type':_0x306495[_0xd6c4('0x12')],'app':_0xd6c4('0x34'),'appdata':_0x13ca8e[_0x1e2d14]+'?'+_0x306495[_0xd6c4('0x14')]+_0xd6c4('0x35')+_0x437951+':'+_0x306495[_0xd6c4('0x14')]+_0xd6c4('0x35')+_0x307747,'exten':_0x306495[_0xd6c4('0x9')],'context':_0x306495[_0xd6c4('0x14')],'priority':_0x955905[_0xd6c4('0xe')]+_0x1e2d14,'VoiceExtensionId':_0x526447[_0x3e2538][0x0]['VoiceExtensionId']});}_0x306495[_0xd6c4('0xe')]=_0x290065[_0xd6c4('0x2b')]?_['last'](_0x290065)[_0xd6c4('0xe')]+0x1:_0x955905[_0xd6c4('0xe')];_0x955905['priority']=(_0x517426[_0xd6c4('0x2b')]?_['last'](_0x517426)[_0xd6c4('0xe')]:_0x306495[_0xd6c4('0xe')])+0x1;_0x955905['extensions']=_['concat'](_0x955905[_0xd6c4('0x10')],_0x290065,[_0x306495],_0x517426);}_0x955905[_0xd6c4('0x10')][_0xd6c4('0x11')]({'type':_0x526447[_0x3e2538][0x0][_0xd6c4('0x12')],'app':'Hangup','exten':_0x526447[_0x3e2538][0x0][_0xd6c4('0x9')],'context':_0x526447[_0x3e2538][0x0][_0xd6c4('0x14')],'priority':_0x955905[_0xd6c4('0xe')],'VoiceExtensionId':_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]});_0x4acb37[_0xd6c4('0x11')](_0x526447[_0x3e2538][0x0][_0xd6c4('0x15')]);_0xe8ee38=_[_0xd6c4('0x36')](_0xe8ee38,_0x955905[_0xd6c4('0x10')]);}}return _0x280f64['transaction'](function(_0x170c94){return _0x280f64[_0xd6c4('0x1')][_0xd6c4('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4acb37}},'transaction':_0x170c94})[_0xd6c4('0x4')](function(_0x428847){return _0x280f64[_0xd6c4('0x1')][_0xd6c4('0x5')][_0xd6c4('0x37')](_[_0xd6c4('0x38')](_0xe8ee38,_0xd6c4('0xe')),{'transaction':_0x170c94});});});})[_0xd6c4('0x39')](function(_0x77a5ac){console[_0xd6c4('0x3a')](_0x77a5ac);});}exports[_0xd6c4('0x3b')]=rewrite; \ No newline at end of file +var _0x58fd=['error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extension','find','extensions','push','Set','format','CDR(type)=%s','type','context','outbound','CDR(destination)=','${EXTEN:','cutdigits','VoiceExtensionId','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy'];(function(_0x3c1891,_0x154204){var _0x26d46f=function(_0x47e82d){while(--_0x47e82d){_0x3c1891['push'](_0x3c1891['shift']());}};_0x26d46f(++_0x154204);}(_0x58fd,0xe6));var _0xd58f=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x58fd[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xd58f('0x0'));var util=require(_0xd58f('0x1'));function rewrite(_0x28d3c7,_0x42d75d){var _0xbb774=this;return _0x28d3c7[_0xd58f('0x2')][_0xd58f('0x3')][_0xd58f('0x4')]({'raw':!![]})[_0xd58f('0x5')](function(_0x2eba1a){_0xbb774[_0xd58f('0x6')]=_0x2eba1a;return _0x28d3c7[_0xd58f('0x2')][_0xd58f('0x7')][_0xd58f('0x4')]({'where':{'IntervalId':_0x42d75d[_0xd58f('0x8')]},'raw':!![]});})[_0xd58f('0x5')](function(_0xcdca22){return _0x28d3c7['models'][_0xd58f('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xd58f('0x9')](_['map'](_0xcdca22,_0xd58f('0xa')))}},'order':[{'raw':_0xd58f('0xb')}],'raw':!![]});})['then'](function(_0x4a2d12){var _0x586a56=_['filter'](_0x4a2d12,{'priority':'1'});var _0x1df2ae=_[_0xd58f('0xc')](_0x4a2d12,{'isApp':0x1});var _0x5c5974=_[_0xd58f('0xd')](_0x1df2ae,_0xd58f('0xa'));var _0x3c11e5=['queue',_0xd58f('0xe')];var _0x2d5fcc=[];var _0x20bb22=[];for(var _0x3c8485 in _0x5c5974){if(_0x5c5974[_0xd58f('0xf')](_0x3c8485)){_0xbb774[_0xd58f('0x10')]=0x2;_0xbb774['extensions']=[];_0xbb774[_0xd58f('0x11')]=_[_0xd58f('0x12')](_0x586a56,{'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')]});_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0]['type'],'app':_0xd58f('0x15'),'appdata':util[_0xd58f('0x16')](_0xd58f('0x17'),_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')]),'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0]['VoiceExtensionId']});if(_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')]===_0xd58f('0x1a')){if(_0xbb774['extension']){_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x1b')+(_0xbb774['extension']['cutdigits']?_0xd58f('0x1c')+_0xbb774[_0xd58f('0x11')][_0xd58f('0x1d')]+'}':'${EXTEN}'),'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});}_0xbb774[_0xd58f('0x13')]['push']({'type':_0x5c5974[_0x3c8485][0x0]['type'],'app':'Set','appdata':_0xd58f('0x1f')+_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')],'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0]['VoiceExtensionId']});var _0x2ed648=_0xbb774['priority']++;_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2ed648+0x2)+_0xd58f('0x21')+(_0x2ed648+0x1)+')','context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0]['exten'],'priority':_0x2ed648,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});if(_0xbb774[_0xd58f('0x11')]){_0xbb774[_0xd58f('0x13')]['push']({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xbb774[_0xd58f('0x11')]['cutdigits']?_0xd58f('0x22')+_0xbb774['extension'][_0xd58f('0x1d')]+'}':_0xd58f('0x23'),'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});}_0xbb774['extensions'][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x24')+_0x5c5974[_0x3c8485][0x0]['VoiceExtensionId'],'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0]['exten'],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});if(_0xbb774[_0xd58f('0x11')]&&_0xbb774[_0xd58f('0x11')][_0xd58f('0xf')](_0xd58f('0x25'))&&_0xbb774[_0xd58f('0x11')][_0xd58f('0x25')]!==_0xd58f('0x26')){_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x27'),'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x28')+_0xbb774[_0xd58f('0x11')]['recordingFormat']||_0xd58f('0x29'),'context':_0x5c5974[_0x3c8485][0x0]['context'],'exten':_0x5c5974[_0x3c8485][0x0]['exten'],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});}}_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x2a'),'context':_0x5c5974[_0x3c8485][0x0]['context'],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0]['VoiceExtensionId']});_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x2b'),'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774['priority']++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0]['type'],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x2c'),'context':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x19')],'exten':_0x5c5974[_0x3c8485][0x0][_0xd58f('0xa')],'priority':_0xbb774[_0xd58f('0x10')]++,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});for(var _0x427734=0x0,_0x1a5cfe=0x0;_0x427734<_0x5c5974[_0x3c8485][_0xd58f('0x2d')];_0x427734+=0x1,_0x1a5cfe=0x0){var _0x43c806=_0x5c5974[_0x3c8485][_0x427734];if(_0x43c806[_0xd58f('0x18')]){_0x43c806[_0xd58f('0x18')]=_0x43c806['type'][_0xd58f('0x2e')]();}var _0x5eb18f=[];var _0x4d833a=[];delete _0x43c806['id'];delete _0x43c806[_0xd58f('0x2f')];delete _0x43c806[_0xd58f('0x30')];var _0x360b4a=_0x43c806[_0xd58f('0x31')]!==_0xd58f('0x32')?[_0x43c806[_0xd58f('0x31')]]:_0x43c806['IntervalId']?_[_0xd58f('0x33')](_[_0xd58f('0xc')](_0xbb774['intervals'],{'IntervalId':_0x43c806[_0xd58f('0x8')]}),_0xd58f('0x31')):[];if(_0x43c806[_0xd58f('0xf')](_0xd58f('0x34'))){if(_0x43c806[_0xd58f('0x34')]&&_0x43c806[_0xd58f('0x34')]!=='--'){_0x5eb18f[_0xd58f('0x14')]({'type':_0x43c806[_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x35')+_0x43c806[_0xd58f('0x34')],'context':_0x43c806[_0xd58f('0x19')],'exten':_0x43c806[_0xd58f('0xa')],'priority':_0x360b4a[_0xd58f('0x2d')]+_0xbb774[_0xd58f('0x10')]+_0x1a5cfe++,'VoiceExtensionId':_0x43c806['VoiceExtensionId']});}}if(_0x43c806[_0xd58f('0x18')]===_0xd58f('0x1a')&&_0x43c806[_0xd58f('0xf')](_0xd58f('0x36'))){if(_0x43c806['callerID']){_0x5eb18f[_0xd58f('0x14')]({'type':_0x43c806[_0xd58f('0x18')],'app':'ExecIf','appdata':_0xd58f('0x37')+_0x43c806[_0xd58f('0x36')]+')','context':_0x43c806[_0xd58f('0x19')],'exten':_0x43c806[_0xd58f('0xa')],'priority':_0x360b4a[_0xd58f('0x2d')]+_0xbb774['priority']+_0x1a5cfe++,'VoiceExtensionId':_0x43c806['VoiceExtensionId']});}else{_0x5eb18f['push']({'type':_0x43c806['type'],'app':_0xd58f('0x20'),'appdata':_0xd58f('0x38'),'context':_0x43c806['context'],'exten':_0x43c806[_0xd58f('0xa')],'priority':_0x360b4a[_0xd58f('0x2d')]+_0xbb774[_0xd58f('0x10')]+_0x1a5cfe++,'VoiceExtensionId':_0x43c806[_0xd58f('0x1e')]});}}if(_0x43c806[_0xd58f('0xf')](_0xd58f('0x39'))){if(_0x3c11e5[_0xd58f('0x3a')](_0x43c806[_0xd58f('0x3b')]['toLowerCase']())>=0x0&&_0x43c806[_0xd58f('0x3c')]!==_0xd58f('0x3d')){if(_0x43c806['answer']){_0x5eb18f[_0xd58f('0x14')]({'type':_0x43c806[_0xd58f('0x18')],'app':_0xd58f('0x20'),'appdata':_0xd58f('0x3e'),'context':_0x43c806['context'],'exten':_0x43c806[_0xd58f('0xa')],'priority':_0x360b4a['length']+_0xbb774['priority']+_0x1a5cfe++,'VoiceExtensionId':_0x43c806[_0xd58f('0x1e')]});_0x5eb18f[_0xd58f('0x14')]({'type':_0x43c806[_0xd58f('0x18')],'app':'Set','appdata':_0xd58f('0x3f'),'context':_0x43c806[_0xd58f('0x19')],'exten':_0x43c806[_0xd58f('0xa')],'priority':_0x360b4a[_0xd58f('0x2d')]+_0xbb774[_0xd58f('0x10')]+_0x1a5cfe++,'VoiceExtensionId':_0x43c806[_0xd58f('0x1e')]});}else{_0x5eb18f[_0xd58f('0x14')]({'type':_0x43c806[_0xd58f('0x18')],'app':_0xd58f('0x20'),'appdata':_0xd58f('0x40'),'context':_0x43c806[_0xd58f('0x19')],'exten':_0x43c806['exten'],'priority':_0x360b4a[_0xd58f('0x2d')]+_0xbb774[_0xd58f('0x10')]+_0x1a5cfe++,'VoiceExtensionId':_0x43c806[_0xd58f('0x1e')]});_0x5eb18f['push']({'type':_0x43c806[_0xd58f('0x18')],'app':_0xd58f('0x15'),'appdata':_0xd58f('0x41'),'context':_0x43c806[_0xd58f('0x19')],'exten':_0x43c806[_0xd58f('0xa')],'priority':_0x360b4a[_0xd58f('0x2d')]+_0xbb774[_0xd58f('0x10')]+_0x1a5cfe++,'VoiceExtensionId':_0x43c806['VoiceExtensionId']});}}}for(var _0x30fb32=0x0;_0x30fb32<_0x360b4a[_0xd58f('0x2d')];_0x30fb32+=0x1){var _0x53e122=_0xbb774[_0xd58f('0x10')]+_0x360b4a['length'];var _0x4ba861=_0x30fb32===_0x360b4a[_0xd58f('0x2d')]-0x1?_0xbb774['priority']+_0x5eb18f[_0xd58f('0x2d')]+_0x4d833a[_0xd58f('0x2d')]+0x2:_0xbb774[_0xd58f('0x10')]+_0x30fb32+0x1;_0x5eb18f['splice'](_0x30fb32,0x0,{'type':_0x43c806[_0xd58f('0x18')],'app':_0xd58f('0x42'),'appdata':_0x360b4a[_0x30fb32]+'?'+_0x43c806[_0xd58f('0x19')]+_0xd58f('0x43')+_0x53e122+':'+_0x43c806[_0xd58f('0x19')]+_0xd58f('0x43')+_0x4ba861,'exten':_0x43c806['exten'],'context':_0x43c806[_0xd58f('0x19')],'priority':_0xbb774['priority']+_0x30fb32,'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});}_0x43c806[_0xd58f('0x10')]=_0x5eb18f[_0xd58f('0x2d')]?_[_0xd58f('0x44')](_0x5eb18f)[_0xd58f('0x10')]+0x1:_0xbb774['priority'];_0xbb774['priority']=(_0x4d833a[_0xd58f('0x2d')]?_[_0xd58f('0x44')](_0x4d833a)[_0xd58f('0x10')]:_0x43c806[_0xd58f('0x10')])+0x1;_0xbb774[_0xd58f('0x13')]=_[_0xd58f('0x45')](_0xbb774['extensions'],_0x5eb18f,[_0x43c806],_0x4d833a);}_0xbb774[_0xd58f('0x13')][_0xd58f('0x14')]({'type':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x18')],'app':_0xd58f('0x46'),'exten':_0x5c5974[_0x3c8485][0x0]['exten'],'context':_0x5c5974[_0x3c8485][0x0]['context'],'priority':_0xbb774[_0xd58f('0x10')],'VoiceExtensionId':_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]});_0x2d5fcc[_0xd58f('0x14')](_0x5c5974[_0x3c8485][0x0][_0xd58f('0x1e')]);_0x20bb22=_[_0xd58f('0x45')](_0x20bb22,_0xbb774[_0xd58f('0x13')]);}}return _0x28d3c7['transaction'](function(_0x4517b8){return _0x28d3c7[_0xd58f('0x2')][_0xd58f('0x7')][_0xd58f('0x47')]({'where':{'VoiceExtensionId':{'$in':_0x2d5fcc}},'transaction':_0x4517b8})[_0xd58f('0x5')](function(_0x1faa28){return _0x28d3c7[_0xd58f('0x2')][_0xd58f('0x7')][_0xd58f('0x48')](_[_0xd58f('0x49')](_0x20bb22,_0xd58f('0x10')),{'transaction':_0x4517b8});});});})['catch'](function(_0x3df2bb){console[_0xd58f('0x4a')](_0x3df2bb);});}exports[_0xd58f('0x4b')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 4cd800d..1339725 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 _0xd8b0=['find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ListId','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','insert','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','CmList','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','CompanyId','length'];(function(_0x149a01,_0x4ee365){var _0x554d69=function(_0x59c8a6){while(--_0x59c8a6){_0x149a01['push'](_0x149a01['shift']());}};_0x554d69(++_0x4ee365);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var socket=require(_0x0d8b('0x9'))(new Redis(config['redis']));require(_0x0d8b('0xa'))[_0x0d8b('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0xf'));}var FILEPATH=process[_0x0d8b('0xc')][0x2];if(!process[_0x0d8b('0xc')][0x3]||process[_0x0d8b('0xc')][0x3]==='undefined'||process[_0x0d8b('0xc')][0x3]==='null'||!process[_0x0d8b('0xc')][0x4]||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x10'));}var FIELDS=_[_0x0d8b('0x11')](process[_0x0d8b('0xc')][0x3][_0x0d8b('0x12')](','),process[_0x0d8b('0xc')][0x4][_0x0d8b('0x12')](','));if(!process[_0x0d8b('0xc')][0x5]||process[_0x0d8b('0xc')][0x5]===_0x0d8b('0xd')||process['argv'][0x5]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x13'));}var LISTID=process[_0x0d8b('0xc')][0x5];var COMPANYID=process[_0x0d8b('0xc')][0x6]&&process[_0x0d8b('0xc')][0x6]!=='undefined'&&process[_0x0d8b('0xc')][0x6]!==_0x0d8b('0xe')?process[_0x0d8b('0xc')][0x6]:null;var DUPLICATES=process[_0x0d8b('0xc')][0x7]&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xd')&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xe')?process['argv'][0x7]:null;if(!process[_0x0d8b('0xc')][0x8]||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d8b('0xc')][0x8];}catch(_0x352c17){logger['error'](_0x352c17);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(_0x4f0a1a,_0x33fb87,_0x54a9a7,_0x56c729){var _0x5527d8={'message':_0x33fb87};_0x5527d8[_0x4f0a1a]=!![];if(_0x54a9a7){_0x5527d8[_0x0d8b('0x15')]=_0x54a9a7;}if(_0x56c729){_0x5527d8[_0x0d8b('0x16')]=_0x56c729;}return _0x5527d8;}function isEmail(_0x214778){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))*$/[_0x0d8b('0x17')](_0x214778);}function checkRow(_0x221071,_0x2c64e2,_0x30980c){return new BPromise(function(_0x4562cb,_0x27b695){if(_['isNil'](_0x221071)){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x0d8b('0x19'),null,_0x30980c));}if(_0x221071['errors']&&_0x221071[_0x0d8b('0x1a')]['length']){var _0x3dd149=_[_0x0d8b('0x1b')](_0x221071[_0x0d8b('0x1a')],'message')['join'](';');return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x3dd149,null,_0x30980c));}var _0x3ef745={};for(var _0x4c05ee in FIELDS){if(FIELDS[_0x0d8b('0x1c')](_0x4c05ee)&&FIELDS[_0x4c05ee]){_0x3ef745[_0x4c05ee]=_0x221071['data'][0x0][FIELDS[_0x4c05ee]]||_0x221071[_0x0d8b('0x1d')][0x0]['\ufeff'+FIELDS[_0x4c05ee]];}}if(!_0x3ef745['firstName']){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'firstName\x20not\x20specified!',null,_0x30980c));}if(!_0x3ef745[_0x0d8b('0x1e')]){return _0x27b695(handleCheckRowError('error',_0x0d8b('0x1f'),null,_0x30980c));}if(_0x3ef745['birthDate']){var _0x3c8887=moment(_0x3ef745[_0x0d8b('0x20')],_0x0d8b('0x21'));if(!_0x3c8887['isValid']()){return _0x27b695(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x30980c));}}if(_0x3ef745[_0x0d8b('0x22')]){if(!isEmail(_0x3ef745['email'])){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x30980c));}}_0x3ef745['ListId']=LISTID;_0x3ef745[_0x0d8b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d8b('0x24')]&&_0x2c64e2){var _0x109c14={};for(var _0xdeee5d=0x0,_0x183220=DUPLICATES[_0x0d8b('0x24')];_0xdeee5d<_0x183220;_0xdeee5d+=0x1){_0x109c14[DUPLICATES[_0xdeee5d]]=_0x3ef745[DUPLICATES[_0xdeee5d]];}var _0x4a99d3=_[_0x0d8b('0x25')](_0x2c64e2,_0x109c14);if(_0x4a99d3){return _0x27b695(handleCheckRowError('duplicate',_0x0d8b('0x26'),_0x4a99d3,_0x30980c));}}return db[_0x0d8b('0x27')]['create'](_0x3ef745,{'raw':!![],'hooks':![],'fields':_[_0x0d8b('0x28')](_0x3ef745)})[_0x0d8b('0x29')](function(_0x18a905){if(DUPLICATES&&DUPLICATES['length']&&_0x2c64e2){_0x2c64e2[_0x0d8b('0x2a')](_[_0x0d8b('0x2b')](_0x3ef745,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18a905['id'];return _0x4562cb();})[_0x0d8b('0x2c')](function(_0x31ceba){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x31ceba[_0x0d8b('0x2d')]||JSON[_0x0d8b('0x2e')](_0x31ceba)),null,_0x30980c));});});}function checkHopper(){function _0x5ad0fe(){return function(_0x1180ac){logger[_0x0d8b('0x18')](_0x0d8b('0x2f'),_0x0d8b('0x30'),util[_0x0d8b('0x31')](_0x1180ac,{'showHidden':![],'depth':null}));};}var _0x519088=function(_0x497a71,_0x41b4f9){var _0x5c2c04=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x33'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),'ListId',_0x41b4f9,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()[_0x0d8b('0x3a')](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID['toString'](),_0x0d8b('0x3b'))['field'](_0x497a71['id'][_0x0d8b('0x3c')](),_0x41b4f9)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel['select']()['field'](_0x0d8b('0x1e'))[_0x0d8b('0x3e')](_0x0d8b('0x33'))['where'](_0x41b4f9+_0x0d8b('0x43'),_0x497a71['id'][_0x0d8b('0x3c')]())))['toString']();return _0x5c2c04;};var _0x4d7bb0=function(_0x372740,_0x495870){var _0x1e22e5=squel['insert']()['into'](_0x0d8b('0x33'))[_0x0d8b('0x34')](['phone','scheduledAt','ContactId','ListId',_0x495870,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x372740['id'][_0x0d8b('0x3c')](),_0x495870)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')]('cm_contacts')[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel['str'](hopperContacts))[_0x0d8b('0x40')](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('calleridnum')['from']('cm_hopper_final')[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id']['toString']()))['where'](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('phone')[_0x0d8b('0x3e')](_0x0d8b('0x33'))[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id'][_0x0d8b('0x3c')]())))['toString']();return _0x1e22e5;};function _0x2de903(_0x2afe34,_0x5481fc){var _0x580580=squel[_0x0d8b('0x46')]()[_0x0d8b('0x32')]('cm_hopper')['fromQuery']([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x3b'),_0x5481fc,'createdAt',_0x0d8b('0x38')],squel['select']()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))['field']('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x2afe34['id'][_0x0d8b('0x3c')](),_0x5481fc)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where'](_0x0d8b('0x41')))[_0x0d8b('0x3c')]();return _0x580580;}function _0x181d49(_0x17a87f,_0x1d6cd4){var _0x59ada2=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x49'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),'ContactId',_0x0d8b('0x3b'),_0x1d6cd4,_0x0d8b('0x37'),_0x0d8b('0x38')],squel['select']()[_0x0d8b('0x3a')]('phone',_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))['field'](_0x17a87f['id'][_0x0d8b('0x3c')](),_0x1d6cd4)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),'updatedAt')[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))[_0x0d8b('0x40')](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d8b('0x3c')]();return _0x59ada2;}return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x4f4b4d){var _0x587128=[];if(_0x4f4b4d){var _0x1900e3;for(var _0x1c007b=0x0,_0x70e4b2;_0x1c007b<_0x4f4b4d[_0x0d8b('0x24')];_0x1c007b+=0x1){_0x70e4b2=_0x4f4b4d[_0x1c007b][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x70e4b2[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x4d7bb0(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;case _0x0d8b('0x52'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x519088(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x587128[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x587128;})[_0x0d8b('0x54')]()['then'](function(){return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x56e03c){var _0x10c318=[];if(_0x56e03c){var _0x445a00;for(var _0x24f75=0x0,_0x259ac9;_0x24f75<_0x56e03c[_0x0d8b('0x24')];_0x24f75+=0x1){_0x259ac9=_0x56e03c[_0x24f75][_0x0d8b('0x4d')]({'plain':!![]});_0x10c318[_0x0d8b('0x2a')](db[_0x0d8b('0x50')]['query'](_0x181d49(_0x259ac9,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));}}return _0x10c318;})[_0x0d8b('0x54')]();})[_0x0d8b('0x29')](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id',_0x0d8b('0x4e')],'include':[{'model':db[_0x0d8b('0x55')],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x466082){var _0x5007c0=[];if(_0x466082){for(var _0xe35028=0x0,_0x16df83;_0xe35028<_0x466082['length'];_0xe35028+=0x1){_0x16df83=_0x466082[_0xe35028][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x16df83[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x5007c0['push'](db['sequelize'][_0x0d8b('0x53')](_0x4d7bb0(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));break;case'onlyIfOpen':_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x519088(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x5007c0;})[_0x0d8b('0x54')]();})['then'](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x1dad9f){var _0x3573b4=[];if(_0x1dad9f){for(var _0x14b1b8=0x0,_0x23e2e0;_0x14b1b8<_0x1dad9f[_0x0d8b('0x24')];_0x14b1b8+=0x1){_0x23e2e0=_0x1dad9f[_0x14b1b8]['get']({'plain':!![]});_0x3573b4['push'](db['sequelize'][_0x0d8b('0x53')](_0x181d49(_0x23e2e0,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}return _0x3573b4;})[_0x0d8b('0x54')]();})[_0x0d8b('0x2c')](function(_0x5ef461){logger[_0x0d8b('0x18')](_0x0d8b('0x59'),'generalCheckHopper',_0x5ef461[_0x0d8b('0x2d')]);});}var processPromises=function(_0x57e3c2){return BPromise[_0x0d8b('0x54')](promises)[_0x0d8b('0x29')](function(_0x9dfa5a){})[_0x0d8b('0x2c')](function(_0x10c7ab){logger[_0x0d8b('0x18')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x2e')](_0x10c7ab));})[_0x0d8b('0x5b')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57e3c2){return _0x57e3c2[_0x0d8b('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0d8b('0x29')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d8b('0x5f')](FILEPATH);}catch(_0xf91ecd){logger[_0x0d8b('0x18')](_0x0d8b('0x60'),JSON['stringify'](_0xf91ecd));}finally{process[_0x0d8b('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0d8b('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0d8b('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d8b('0x12')](',');return db[_0x0d8b('0x27')][_0x0d8b('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d8b('0x29')](function(_0x2eece2){var _0x3c7b9b=fs[_0x0d8b('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d8b('0x64')](_0x3c7b9b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20a8b6,_0x3a6014){total+=0x1;var _0x180539=total;promises['push'](checkRow(_0x20a8b6,_0x2eece2,_0x180539)[_0x0d8b('0x29')](function(){success+=0x1;})[_0x0d8b('0x2c')](function(_0x8be77c){if(_0x8be77c['error']){errors+=0x1;delete _0x8be77c['error'];}else if(_0x8be77c[_0x0d8b('0x65')]){duplicates+=0x1;delete _0x8be77c[_0x0d8b('0x65')];}rows[_0x0d8b('0x2a')](_0x8be77c);}));if(total%0xc8===0x0){_0x3a6014[_0x0d8b('0x66')]();return processPromises(_0x3a6014);}},'complete':function(){return processPromises()[_0x0d8b('0x29')](function(){logger[_0x0d8b('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1a96ce,_0x3d6267){logger[_0x0d8b('0x62')](_0x0d8b('0x67'),JSON[_0x0d8b('0x2e')](_0x1a96ce));endCsv();}});})['catch'](function(_0x4dbcfc){logger[_0x0d8b('0x18')](_0x0d8b('0x68'),JSON[_0x0d8b('0x2e')](_0x4dbcfc));});}main(); \ No newline at end of file +var _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);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(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){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'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1a0473d..e74b57c 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 _0x4162=['cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId','fields',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','sequelize','error','send','start','binding','socket_timestamp','root','keys','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','push','email','email\x20wrong\x20format','dateOfBirth','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','each','finish','affectedRows','unlink','catch','arguments\x20\x20\x20','argv','existsSync','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','../../../config/logger','import','redis','defaults','socket.io-emitter','format','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString'];(function(_0x51f2bf,_0x3a6699){var _0x2079ff=function(_0x3ace8b){while(--_0x3ace8b){_0x51f2bf['push'](_0x51f2bf['shift']());}};_0x2079ff(++_0x3a6699);}(_0x4162,0x1bd));var _0x2416=function(_0x1f4490,_0x3aad97){_0x1f4490=_0x1f4490-0x0;var _0x3b6171=_0x4162[_0x1f4490];return _0x3b6171;};'use strict';var fs=require('fs');var path=require(_0x2416('0x0'));var _=require(_0x2416('0x1'));var Papa=require(_0x2416('0x2'));var util=require('util');var BPromise=require(_0x2416('0x3'));var moment=require(_0x2416('0x4'));var squel=require(_0x2416('0x5'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x2416('0x6'))(_0x2416('0x7'));config[_0x2416('0x8')]=_[_0x2416('0x9')](config[_0x2416('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2416('0xa'))(new Redis(config[_0x2416('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2416('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x514b15){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'](_0x514b15);}function selectNotIn(_0x8d1e28,_0x45a703,_0x45f44e,_0x4b697a,_0x451fe9){return squel[_0x2416('0xc')]()[_0x2416('0xd')](_0x2416('0xe'))[_0x2416('0xf')](_0x4b697a)[_0x2416('0x10')](_0x45a703,null,_0x45a703+_0x2416('0x11')+_0x4b697a+'.'+_0x45f44e)[_0x2416('0x12')](_0x4b697a+'.'+_0x45f44e+'\x20=\x20'+_0x8d1e28+'.'+_0x45f44e)[_0x2416('0x12')](_0x45a703+_0x2416('0x13')+_0x451fe9[_0x2416('0x10')]()+')');}function insertCmHopper(_0x56dfab,_0x35c70e,_0x2cf3ce,_0x148844,_0x56bb59){var _0x51389d=[_0x2416('0x14'),_0x2416('0x15'),_0x2416('0x16'),_0x2416('0x17'),_0x35c70e+'.'+_0x148844,_0x2416('0x18'),_0x2416('0x19'),_0x2416('0x1a'),_0x2416('0x1b'),'\x22'+_0x56bb59+'\x22'];return squel[_0x2416('0x1c')]()[_0x2416('0x1d')](_0x2416('0x1e'))[_0x2416('0x1f')]([_0x2416('0xe'),_0x2416('0x20'),_0x2416('0x21'),_0x2416('0x22'),_0x148844,_0x2416('0x23'),_0x2416('0x24'),_0x2416('0x25'),_0x2416('0x26'),'recallme'],squel['select']()['fields'](_0x51389d)[_0x2416('0xf')](_0x35c70e)[_0x2416('0x10')](_0x2416('0x27'),null,_0x2416('0x28')+_0x35c70e+_0x2416('0x29'))[_0x2416('0x10')](_0x2cf3ce,null,_0x2cf3ce+_0x2416('0x11')+_0x35c70e+'.'+_0x148844)[_0x2416('0x12')](_0x35c70e+_0x2416('0x2a'),_0x56dfab)[_0x2416('0x12')](_0x2416('0x2b'),NOW)[_0x2416('0x12')](_0x2416('0x2c'),selectNotIn(_0x35c70e,_0x2cf3ce,_0x148844,_0x2416('0x1e'),[_0x2416('0x2d'),'\x22onlyIfOpen\x22']))[_0x2416('0x12')](_0x2416('0x2c'),selectNotIn(_0x35c70e,_0x2cf3ce,_0x148844,'cm_hopper',['\x22always\x22'])))[_0x2416('0x2e')]();}function insertCmHopperBlack(_0x315490,_0x58ef9a,_0x5f4ef2,_0x2c7e77){var _0x1db3b4=[_0x2416('0x14'),'cm_contacts.id','cm_contacts.ListId',_0x58ef9a+'.'+_0x2c7e77,_0x2416('0x18'),'cm_contacts.updatedAt'];return squel[_0x2416('0x1c')]()[_0x2416('0x1d')]('cm_hopper_black')[_0x2416('0x1f')]([_0x2416('0xe'),_0x2416('0x21'),'ListId',_0x2c7e77,_0x2416('0x23'),_0x2416('0x24')],squel[_0x2416('0xc')]()['fields'](_0x1db3b4)[_0x2416('0xf')](_0x58ef9a)[_0x2416('0x10')](_0x2416('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x58ef9a+_0x2416('0x29'))[_0x2416('0x10')](_0x5f4ef2,null,_0x5f4ef2+_0x2416('0x11')+_0x58ef9a+'.'+_0x2c7e77)[_0x2416('0x12')](_0x58ef9a+_0x2416('0x2a'),_0x315490)['where'](_0x2416('0x2b'),NOW)[_0x2416('0x12')](_0x2416('0x2c'),squel[_0x2416('0xc')]()[_0x2416('0xd')](_0x2416('0xe'))[_0x2416('0xf')](_0x2416('0x2f'))['where'](_0x2416('0x30'),_0x315490)[_0x2416('0x12')](_0x2c7e77+_0x2416('0x31'),_0x58ef9a+'.'+_0x2c7e77)))['toString']();}function insertCmContact(_0x448ad7,_0x2d04d6,_0x1c95fb,_0x4e3c0e){var _0x5022f5=_[_0x2416('0x32')](_['keys'](_0x4e3c0e),[_0x2416('0x22'),_0x2416('0x33'),'createdAt',_0x2416('0x24')]);return squel['insert']()[_0x2416('0x1d')](_0x2416('0x27'))[_0x2416('0x1f')](_0x5022f5,squel['select']()[_0x2416('0x34')](_0x5022f5)[_0x2416('0xf')](_0x2d04d6)[_0x2416('0x12')]('('+_0x1c95fb[_0x2416('0x10')](',')+_0x2416('0x35'),squel[_0x2416('0xc')]()[_0x2416('0x34')](_0x1c95fb)['from'](_0x2416('0x27'))[_0x2416('0x12')]('ListId\x20=\x20?',_0x448ad7))[_0x2416('0x12')](_0x2416('0x36'),squel[_0x2416('0xc')]()[_0x2416('0xd')](_0x2416('0x37'),_0x2416('0x38'))['from'](_0x2d04d6)[_0x2416('0x39')](_0x1c95fb[_0x2416('0x10')](','))))['toString']();}function handleStop(){logger[_0x2416('0x3a')](_0x2416('0x3b'));stopped=!![];}function handleUncaughtException(_0x238710){logger['error'](_0x238710[_0x2416('0x3c')]);process[_0x2416('0x3d')](0x1);}function handleError(_0x470538,_0x2a47a1){stats[_0x2416('0x3e')]['push']({'name':_0x2a47a1['code'],'message':_0x2a47a1['message'],'row':_0x470538});}function handleQuery(_0x37343d){logger['info'](_0x37343d);return db[_0x2416('0x3f')]['query'](_0x37343d)['spread'](function(_0x68d502){results['push'](_0x68d502);})['catch'](function(_0x595d18){logger[_0x2416('0x40')](_0x595d18[_0x2416('0x3c')]);});}function main(_0x3266c8,_0x190857,_0x37d3a2,_0x4c28e1){logger[_0x2416('0x3a')]('main',_0x3266c8,JSON['stringify'](_0x190857));process[_0x2416('0x41')](_0x2416('0x42'));var _0x1b8c8c=_0x190857[_0x2416('0x43')];var _0x36a41f=_0x190857[_0x2416('0x44')];var _0x175c49=path['join'](config[_0x2416('0x45')],'server/files/tmp',_0x36a41f+'.csv');var _0x1e5814=_[_0x2416('0x46')](_0x1b8c8c)[_0x2416('0x10')]();logger[_0x2416('0x3a')](_0x2416('0x47'),_0x1e5814);fs[_0x2416('0x48')](_0x175c49,_0x1e5814+'\x0a');Papa[_0x2416('0x49')](fs[_0x2416('0x4a')](_0x3266c8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5484cd,_0x3d8dd5){try{for(var _0x503f7b=0x0,_0x5e2e4e=[];_0x503f7b<_0x5484cd[_0x2416('0x4b')][_0x2416('0x4c')];_0x503f7b++){stats['rows']+=0x1;if(_0x5484cd['errors'][_0x503f7b]){handleError(_0x5484cd[_0x2416('0x4b')][_0x503f7b],_0x5484cd['errors'][_0x503f7b]);}else{var _0x49a0c0=[];for(var _0x39f387 in _0x1b8c8c){if(_0x1b8c8c[_0x2416('0x4d')](_0x39f387)){if(_0x5484cd['data'][_0x503f7b][_0x1b8c8c[_0x39f387]]){var _0x5b19d2=_[_0x2416('0x4e')](_0x5484cd[_0x2416('0x4b')][_0x503f7b][_0x1b8c8c[_0x39f387]][_0x2416('0x4f')](/"/g,'\x27'));switch(_0x39f387){case _0x2416('0x20'):var _0x53c7fd=moment(_0x5b19d2,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x53c7fd[_0x2416('0x50')]()){_0x5e2e4e['push']('\x22'+_0x5b19d2+'\x22');}else{_0x49a0c0['push'](_0x2416('0x51'));}break;case _0x2416('0x25'):var _0x130564=parseInt(_0x5b19d2);_0x5b19d2=_[_0x2416('0x52')](_0x130564)||_0x130564<0x0||_0x130564>0x4?_0x4c28e1?0x3:0x2:_0x130564;_0x5e2e4e['push']('\x22'+_0x5b19d2+'\x22');break;case'UserId':var _0x2dd35e=parseInt(_0x5b19d2);if(_[_0x2416('0x53')](_0x2dd35e)&&_[_0x2416('0x54')](_0x37d3a2,_0x2dd35e)){_0x5e2e4e[_0x2416('0x55')]('\x22'+_0x2dd35e+'\x22');}else{_0x49a0c0[_0x2416('0x55')]('agent\x20not\x20exists');}break;case _0x2416('0x56'):if(isEmail(_0x5b19d2)){_0x5e2e4e[_0x2416('0x55')]('\x22'+_0x5b19d2+'\x22');}else{_0x49a0c0['push'](_0x2416('0x57'));}break;case _0x2416('0x58'):var _0x2564f0=moment(_0x5b19d2,'YYYY-MM-DD',!![]);if(_0x2564f0[_0x2416('0x50')]()){_0x5e2e4e[_0x2416('0x55')]('\x22'+_0x5b19d2+'\x22');}else{_0x49a0c0[_0x2416('0x55')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x5e2e4e[_0x2416('0x55')]('\x22'+_0x5b19d2+'\x22');}}else{switch(_0x39f387){case'firstName':case _0x2416('0xe'):_0x49a0c0['push'](_0x39f387+'\x20not\x20specified');break;default:_0x5e2e4e[_0x2416('0x55')]('\x22\x22');}}}}if(_0x49a0c0[_0x2416('0x4c')]){handleError(_0x5484cd['data'][_0x503f7b],{'code':'SystemRow','message':_0x49a0c0['join']()});}else{fs[_0x2416('0x59')](_0x175c49,_0x5e2e4e[_0x2416('0x10')]()+'\x0a');}_0x5e2e4e=[];}if(!(stats['rows']%0xc8)){socket[_0x2416('0x5a')](_0x2416('0x5b')+_0x36a41f,stats);stats[_0x2416('0x3e')]=[];}}if(stopped){logger[_0x2416('0x3a')](_0x2416('0x5c'));_0x3d8dd5[_0x2416('0x5d')]();}}catch(_0x2e067){handleError(_0x5484cd[_0x2416('0x4b')][_0x503f7b],{'code':'SystemError','message':_0x2e067[_0x2416('0x3c')]});logger[_0x2416('0x40')](_0x2416('0x5e'),_0x2e067[_0x2416('0x3c')]);}},'complete':function(){try{var _0x436826=[];var _0x16ba39='cm_contacts';if(_0x190857[_0x2416('0x5f')]&&_0x190857[_0x2416('0x5f')][_0x2416('0x4c')]){_0x16ba39='cm_contacts_'+_0x36a41f;_0x436826['push'](_0x2416('0x60')+_0x16ba39+_0x2416('0x61'));}var _0x33da82=util[_0x2416('0xb')](_0x2416('0x62'),_0x175c49,_0x16ba39,_0x1e5814,_0x190857['ListId'],_0x190857[_0x2416('0x33')]||null,NOW,NOW);if(_[_0x2416('0x63')](_0x1b8c8c[_0x2416('0x20')])){_0x33da82+=_0x2416('0x64');}_0x436826[_0x2416('0x55')](_0x33da82);if(_0x190857[_0x2416('0x5f')]&&_0x190857['duplicates'][_0x2416('0x4c')]){_0x436826['push'](insertCmContact(_0x190857[_0x2416('0x22')],_0x16ba39,_0x190857[_0x2416('0x5f')],_0x1b8c8c));_0x436826[_0x2416('0x55')](_0x2416('0x65')+_0x16ba39+';');}_0x436826['push'](insertCmHopper(_0x190857['ListId'],_0x2416('0x66'),'voice_queues',_0x2416('0x67'),_0x4c28e1));_0x436826[_0x2416('0x55')](insertCmHopperBlack(_0x190857[_0x2416('0x22')],_0x2416('0x68'),_0x2416('0x69'),_0x2416('0x67')));_0x436826[_0x2416('0x55')](insertCmHopper(_0x190857[_0x2416('0x22')],_0x2416('0x6a'),_0x2416('0x6b'),_0x2416('0x6c'),_0x4c28e1));_0x436826[_0x2416('0x55')](insertCmHopperBlack(_0x190857[_0x2416('0x22')],'campaigns_has_cm_blacklists',_0x2416('0x6b'),_0x2416('0x6c')));BPromise[_0x2416('0x6d')](_0x436826,handleQuery)['then'](function(_0x4b047e){stats[_0x2416('0x6e')]=!![];stats[_0x2416('0x6f')]=_0x190857[_0x2416('0x5f')]&&_0x190857[_0x2416('0x5f')][_0x2416('0x4c')]?results[0x2][_0x2416('0x6f')]:results[0x0][_0x2416('0x6f')];socket[_0x2416('0x5a')](_0x2416('0x5b')+_0x36a41f,stats);fs[_0x2416('0x70')](_0x3266c8);fs['unlink'](_0x175c49);process['exit'](0x0);})[_0x2416('0x71')](function(_0x5704d9){logger[_0x2416('0x40')](_0x5704d9[_0x2416('0x3c')]);process[_0x2416('0x3d')](0x1);});}catch(_0x2b73df){logger[_0x2416('0x40')]('complete',_0x2b73df[_0x2416('0x3c')]);process[_0x2416('0x3d')](0x1);}},'error':function(_0x4a7072,_0x487463,_0x278d94,_0x20c7b7){throw new Error(_0x20c7b7);}});}function validate(){if(process['argv']&&process['argv'][_0x2416('0x4c')]<0x4){throw new Error(_0x2416('0x72'));}var _0xe6099e=path['join'](config[_0x2416('0x45')],'server/files/tmp',process[_0x2416('0x73')][0x2]);if(!fs[_0x2416('0x74')](_0xe6099e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3ddf95={};try{_0x3ddf95=JSON[_0x2416('0x49')](process[_0x2416('0x73')][0x3]);if(!_0x3ddf95[_0x2416('0x43')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3ddf95[_0x2416('0x43')][_0x2416('0xe')]){throw new Error(_0x2416('0x75'));}if(!_0x3ddf95[_0x2416('0x43')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x82041a=0x0;if(_0x3ddf95[_0x2416('0x43')][_0x2416('0x26')]){_0x82041a=0x1;}if(!_0x3ddf95[_0x2416('0x22')]){throw new Error(_0x2416('0x76'));}}catch(_0x393597){throw new Error(_0x2416('0x77'));}var _0x45ba14=[];try{_0x45ba14=_[_0x2416('0x78')](JSON[_0x2416('0x49')](process[_0x2416('0x73')][0x4]),'id');}catch(_0x49d2ba){logger[_0x2416('0x3a')](_0x2416('0x79'));}main(_0xe6099e,_0x3ddf95,_0x45ba14,_0x82041a);}validate();process['on']('SIGINT',handleStop);process['on'](_0x2416('0x7a'),handleUncaughtException); \ No newline at end of file +var _0xb347=['scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','length','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','.id\x20=\x20','ListId\x20=\x20?','\x20=\x20?','toString','concat','CompanyId','insert','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','push','code','message','query','spread','catch','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','rows','hasOwnProperty','data','trim','replace','isValid'];(function(_0x328f58,_0xd55bb2){var _0x3bfdb8=function(_0x454301){while(--_0x454301){_0x328f58['push'](_0x328f58['shift']());}};_0x3bfdb8(++_0xd55bb2);}(_0xb347,0x14a));var _0x7b34=function(_0x5c868d,_0x8b071){_0x5c868d=_0x5c868d-0x0;var _0x30b436=_0xb347[_0x5c868d];return _0x30b436;};'use strict';var fs=require('fs');var path=require(_0x7b34('0x0'));var _=require(_0x7b34('0x1'));var Papa=require(_0x7b34('0x2'));var util=require(_0x7b34('0x3'));var BPromise=require(_0x7b34('0x4'));var moment=require(_0x7b34('0x5'));var squel=require(_0x7b34('0x6'));var Redis=require('ioredis');var db=require(_0x7b34('0x7'))['db'];var config=require(_0x7b34('0x8'));var logger=require('../../../config/logger')(_0x7b34('0x9'));config[_0x7b34('0xa')]=_[_0x7b34('0xb')](config['redis'],{'host':_0x7b34('0xc'),'port':0x18eb});var socket=require(_0x7b34('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x7b34('0xe')](_0x7b34('0xf'));function isEmail(_0x217a45){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'](_0x217a45);}function selectNotIn(_0x58b633,_0x16f861,_0x27a684,_0x279c60,_0x5e9729){return squel['select']()[_0x7b34('0x10')](_0x7b34('0x11'))[_0x7b34('0x12')](_0x279c60)[_0x7b34('0x13')](_0x16f861,null,_0x16f861+'.id\x20=\x20'+_0x279c60+'.'+_0x27a684)[_0x7b34('0x14')](_0x279c60+'.'+_0x27a684+_0x7b34('0x15')+_0x58b633+'.'+_0x27a684)['where'](_0x16f861+_0x7b34('0x16')+_0x5e9729['join']()+')');}function insertCmHopper(_0x4756df,_0x6621d8,_0x15002c,_0x56da1c,_0x274614){var _0x3bc32c=[_0x7b34('0x17'),_0x7b34('0x18'),'cm_contacts.id',_0x7b34('0x19'),_0x6621d8+'.'+_0x56da1c,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x7b34('0x1a'),'\x22'+_0x274614+'\x22'];return squel['insert']()[_0x7b34('0x1b')](_0x7b34('0x1c'))[_0x7b34('0x1d')]([_0x7b34('0x11'),_0x7b34('0x1e'),_0x7b34('0x1f'),_0x7b34('0x20'),_0x56da1c,_0x7b34('0x21'),_0x7b34('0x22'),_0x7b34('0x23'),_0x7b34('0x24'),'recallme'],squel[_0x7b34('0x25')]()[_0x7b34('0x26')](_0x3bc32c)['from'](_0x6621d8)[_0x7b34('0x13')](_0x7b34('0x27'),null,_0x7b34('0x28')+_0x6621d8+_0x7b34('0x29'))['join'](_0x15002c,null,_0x15002c+'.id\x20=\x20'+_0x6621d8+'.'+_0x56da1c)['where'](_0x6621d8+_0x7b34('0x2a'),_0x4756df)['where'](_0x7b34('0x2b'),NOW)[_0x7b34('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x6621d8,_0x15002c,_0x56da1c,_0x7b34('0x1c'),[_0x7b34('0x2c'),_0x7b34('0x2d')]))['where'](_0x7b34('0x2e'),selectNotIn(_0x6621d8,_0x15002c,_0x56da1c,_0x7b34('0x1c'),[_0x7b34('0x2c')])))['toString']();}function insertCmHopperBlack(_0x40408f,_0x98dbb8,_0xbd25e3,_0xb2be99){var _0x17ed4f=[_0x7b34('0x17'),_0x7b34('0x2f'),_0x7b34('0x19'),_0x98dbb8+'.'+_0xb2be99,_0x7b34('0x30'),_0x7b34('0x31')];return squel['insert']()['into'](_0x7b34('0x32'))[_0x7b34('0x1d')]([_0x7b34('0x11'),_0x7b34('0x1f'),_0x7b34('0x20'),_0xb2be99,_0x7b34('0x21'),_0x7b34('0x22')],squel[_0x7b34('0x25')]()[_0x7b34('0x26')](_0x17ed4f)['from'](_0x98dbb8)['join'](_0x7b34('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x98dbb8+_0x7b34('0x29'))['join'](_0xbd25e3,null,_0xbd25e3+_0x7b34('0x33')+_0x98dbb8+'.'+_0xb2be99)[_0x7b34('0x14')](_0x98dbb8+_0x7b34('0x2a'),_0x40408f)[_0x7b34('0x14')](_0x7b34('0x2b'),NOW)[_0x7b34('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7b34('0x25')]()['field']('phone')[_0x7b34('0x12')](_0x7b34('0x32'))[_0x7b34('0x14')](_0x7b34('0x34'),_0x40408f)[_0x7b34('0x14')](_0xb2be99+_0x7b34('0x35'),_0x98dbb8+'.'+_0xb2be99)))[_0x7b34('0x36')]();}function insertCmContact(_0x1303a0,_0x351882,_0x274347,_0x4884ff){var _0x4f72c2=_[_0x7b34('0x37')](_['keys'](_0x4884ff),[_0x7b34('0x20'),_0x7b34('0x38'),'createdAt',_0x7b34('0x22')]);return squel[_0x7b34('0x39')]()['into'](_0x7b34('0x27'))['fromQuery'](_0x4f72c2,squel[_0x7b34('0x25')]()[_0x7b34('0x26')](_0x4f72c2)[_0x7b34('0x12')](_0x351882)[_0x7b34('0x14')]('('+_0x274347[_0x7b34('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x7b34('0x25')]()[_0x7b34('0x26')](_0x274347)[_0x7b34('0x12')](_0x7b34('0x27'))['where'](_0x7b34('0x34'),_0x1303a0))[_0x7b34('0x14')]('id\x20IN\x20?',squel[_0x7b34('0x25')]()['field'](_0x7b34('0x3a'),_0x7b34('0x3b'))['from'](_0x351882)[_0x7b34('0x3c')](_0x274347[_0x7b34('0x13')](','))))[_0x7b34('0x36')]();}function handleStop(){logger[_0x7b34('0x3d')](_0x7b34('0x3e'));stopped=!![];}function handleUncaughtException(_0x3330f1){logger[_0x7b34('0x3f')](_0x3330f1['message']);process[_0x7b34('0x40')](0x1);}function handleError(_0x227773,_0x5a01c5){stats[_0x7b34('0x41')][_0x7b34('0x42')]({'name':_0x5a01c5[_0x7b34('0x43')],'message':_0x5a01c5[_0x7b34('0x44')],'row':_0x227773});}function handleQuery(_0x4c17ca){logger[_0x7b34('0x3d')](_0x4c17ca);return db['sequelize'][_0x7b34('0x45')](_0x4c17ca)[_0x7b34('0x46')](function(_0x243902){results[_0x7b34('0x42')](_0x243902);})[_0x7b34('0x47')](function(_0x29a07c){logger[_0x7b34('0x3f')](_0x29a07c[_0x7b34('0x44')]);});}function main(_0x188506,_0x4fc4d3,_0x2f7ec1,_0x57a6f6){logger['info']('main',_0x188506,JSON[_0x7b34('0x48')](_0x4fc4d3));process[_0x7b34('0x49')](_0x7b34('0x4a'));var _0x25d993=_0x4fc4d3[_0x7b34('0x4b')];var _0x13c068=_0x4fc4d3[_0x7b34('0x4c')];var _0x5c3a4c=path[_0x7b34('0x13')](config['root'],_0x7b34('0x4d'),_0x13c068+_0x7b34('0x4e'));var _0x433d30=_[_0x7b34('0x4f')](_0x25d993)[_0x7b34('0x13')]();logger[_0x7b34('0x3d')](_0x7b34('0x50'),_0x433d30);fs[_0x7b34('0x51')](_0x5c3a4c,_0x433d30+'\x0a');Papa[_0x7b34('0x52')](fs[_0x7b34('0x53')](_0x188506),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a1d4e,_0xccde4e){try{for(var _0x224b31=0x0,_0x1589df=[];_0x224b31<_0x5a1d4e['data']['length'];_0x224b31++){stats[_0x7b34('0x54')]+=0x1;if(_0x5a1d4e[_0x7b34('0x41')][_0x224b31]){handleError(_0x5a1d4e['data'][_0x224b31],_0x5a1d4e[_0x7b34('0x41')][_0x224b31]);}else{var _0x2a1a0f=[];for(var _0x4b2b1b in _0x25d993){if(_0x25d993[_0x7b34('0x55')](_0x4b2b1b)){if(_0x5a1d4e[_0x7b34('0x56')][_0x224b31][_0x25d993[_0x4b2b1b]]){var _0x508366=_[_0x7b34('0x57')](_0x5a1d4e[_0x7b34('0x56')][_0x224b31][_0x25d993[_0x4b2b1b]][_0x7b34('0x58')](/"/g,'\x27'));switch(_0x4b2b1b){case'scheduledat':var _0x3f2fe7=moment(_0x508366,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3f2fe7[_0x7b34('0x59')]()){_0x1589df[_0x7b34('0x42')]('\x22'+_0x508366+'\x22');}else{_0x2a1a0f['push'](_0x7b34('0x5a'));}break;case _0x7b34('0x23'):var _0x27f283=parseInt(_0x508366);_0x508366=_[_0x7b34('0x5b')](_0x27f283)||_0x27f283<0x0||_0x27f283>0x4?_0x57a6f6?0x3:0x2:_0x27f283;_0x1589df[_0x7b34('0x42')]('\x22'+_0x508366+'\x22');break;case _0x7b34('0x24'):var _0x5a0b98=parseInt(_0x508366);if(_[_0x7b34('0x5c')](_0x5a0b98)&&_[_0x7b34('0x5d')](_0x2f7ec1,_0x5a0b98)){_0x1589df[_0x7b34('0x42')]('\x22'+_0x5a0b98+'\x22');}else{_0x2a1a0f['push'](_0x7b34('0x5e'));}break;case _0x7b34('0x5f'):if(isEmail(_0x508366)){_0x1589df[_0x7b34('0x42')]('\x22'+_0x508366+'\x22');}else{_0x2a1a0f[_0x7b34('0x42')](_0x7b34('0x60'));}break;case _0x7b34('0x61'):var _0x118002=moment(_0x508366,_0x7b34('0x62'),!![]);if(_0x118002[_0x7b34('0x59')]()){_0x1589df[_0x7b34('0x42')]('\x22'+_0x508366+'\x22');}else{_0x2a1a0f[_0x7b34('0x42')](_0x7b34('0x63'));}break;default:_0x1589df[_0x7b34('0x42')]('\x22'+_0x508366+'\x22');}}else{switch(_0x4b2b1b){case'firstName':case _0x7b34('0x11'):_0x2a1a0f[_0x7b34('0x42')](_0x4b2b1b+_0x7b34('0x64'));break;default:_0x1589df[_0x7b34('0x42')]('\x22\x22');}}}}if(_0x2a1a0f['length']){handleError(_0x5a1d4e[_0x7b34('0x56')][_0x224b31],{'code':_0x7b34('0x65'),'message':_0x2a1a0f['join']()});}else{fs['appendFileSync'](_0x5c3a4c,_0x1589df[_0x7b34('0x13')]()+'\x0a');}_0x1589df=[];}if(!(stats['rows']%0xc8)){socket[_0x7b34('0x66')]('contact:import:'+_0x13c068,stats);stats[_0x7b34('0x41')]=[];}}if(stopped){logger[_0x7b34('0x3d')](_0x7b34('0x67'));_0xccde4e[_0x7b34('0x68')]();}}catch(_0x2c9f5c){handleError(_0x5a1d4e[_0x7b34('0x56')][_0x224b31],{'code':_0x7b34('0x69'),'message':_0x2c9f5c[_0x7b34('0x44')]});logger[_0x7b34('0x3f')](_0x7b34('0x6a'),_0x2c9f5c[_0x7b34('0x44')]);}},'complete':function(){try{var _0x2310f4=[];var _0x471058=_0x7b34('0x27');if(_0x4fc4d3[_0x7b34('0x6b')]&&_0x4fc4d3[_0x7b34('0x6b')][_0x7b34('0x6c')]){_0x471058=_0x7b34('0x6d')+_0x13c068;_0x2310f4[_0x7b34('0x42')](_0x7b34('0x6e')+_0x471058+_0x7b34('0x6f'));}var _0x4c208b=util[_0x7b34('0xe')](_0x7b34('0x70'),_0x5c3a4c,_0x471058,_0x433d30,_0x4fc4d3[_0x7b34('0x20')],_0x4fc4d3[_0x7b34('0x38')]||null,NOW,NOW);if(_[_0x7b34('0x71')](_0x25d993['scheduledat'])){_0x4c208b+=_0x7b34('0x72');}_0x2310f4[_0x7b34('0x42')](_0x4c208b);if(_0x4fc4d3[_0x7b34('0x6b')]&&_0x4fc4d3[_0x7b34('0x6b')][_0x7b34('0x6c')]){_0x2310f4[_0x7b34('0x42')](insertCmContact(_0x4fc4d3['ListId'],_0x471058,_0x4fc4d3['duplicates'],_0x25d993));_0x2310f4[_0x7b34('0x42')](_0x7b34('0x73')+_0x471058+';');}_0x2310f4[_0x7b34('0x42')](insertCmHopper(_0x4fc4d3[_0x7b34('0x20')],_0x7b34('0x74'),_0x7b34('0x75'),_0x7b34('0x76'),_0x57a6f6));_0x2310f4[_0x7b34('0x42')](insertCmHopperBlack(_0x4fc4d3[_0x7b34('0x20')],'voice_queues_has_cm_blacklists','voice_queues',_0x7b34('0x76')));_0x2310f4[_0x7b34('0x42')](insertCmHopper(_0x4fc4d3[_0x7b34('0x20')],_0x7b34('0x77'),_0x7b34('0x78'),_0x7b34('0x79'),_0x57a6f6));_0x2310f4[_0x7b34('0x42')](insertCmHopperBlack(_0x4fc4d3[_0x7b34('0x20')],_0x7b34('0x7a'),_0x7b34('0x78'),_0x7b34('0x79')));BPromise[_0x7b34('0x7b')](_0x2310f4,handleQuery)[_0x7b34('0x7c')](function(_0x22d9f4){stats[_0x7b34('0x7d')]=!![];stats[_0x7b34('0x7e')]=_0x4fc4d3['duplicates']&&_0x4fc4d3[_0x7b34('0x6b')]['length']?results[0x2][_0x7b34('0x7e')]:results[0x0][_0x7b34('0x7e')];socket[_0x7b34('0x66')](_0x7b34('0x7f')+_0x13c068,stats);fs[_0x7b34('0x80')](_0x188506);fs['unlink'](_0x5c3a4c);process[_0x7b34('0x40')](0x0);})[_0x7b34('0x47')](function(_0x38245f){logger[_0x7b34('0x3f')](_0x38245f[_0x7b34('0x44')]);process['exit'](0x1);});}catch(_0x3f5ae6){logger[_0x7b34('0x3f')](_0x7b34('0x81'),_0x3f5ae6['message']);process[_0x7b34('0x40')](0x1);}},'error':function(_0x15b269,_0x54eeb6,_0x3730f6,_0x2f0e4b){throw new Error(_0x2f0e4b);}});}function validate(){if(process['argv']&&process[_0x7b34('0x82')]['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x201200=path['join'](config[_0x7b34('0x83')],_0x7b34('0x4d'),process[_0x7b34('0x82')][0x2]);if(!fs[_0x7b34('0x84')](_0x201200)){throw new Error(_0x7b34('0x85'));}var _0x579348={};try{_0x579348=JSON[_0x7b34('0x52')](process[_0x7b34('0x82')][0x3]);if(!_0x579348[_0x7b34('0x4b')]){throw new Error(_0x7b34('0x86'));}if(!_0x579348[_0x7b34('0x4b')][_0x7b34('0x11')]){throw new Error(_0x7b34('0x87'));}if(!_0x579348[_0x7b34('0x4b')]['firstName']){throw new Error(_0x7b34('0x88'));}var _0x194b13=0x0;if(_0x579348['binding'][_0x7b34('0x24')]){_0x194b13=0x1;}if(!_0x579348[_0x7b34('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x4ba699){throw new Error(_0x7b34('0x89'));}var _0x147ce2=[];try{_0x147ce2=_[_0x7b34('0x8a')](JSON[_0x7b34('0x52')](process['argv'][0x4]),'id');}catch(_0x28a14c){logger['info']('No\x20agent\x20available');}main(_0x201200,_0x579348,_0x147ce2,_0x194b13);}validate();process['on']('SIGINT',handleStop);process['on'](_0x7b34('0x8b'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 78290df..aabb627 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 _0x9ccd=['Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','Complete\x20Time','duration','billableseconds','getSubjects','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','Caller\x20Number','calleridname','keyValue','Call\x20To','destexten','Queue','uniqueid'];(function(_0x38cc84,_0x2132bd){var _0x191840=function(_0x8d7c29){while(--_0x8d7c29){_0x38cc84['push'](_0x38cc84['shift']());}};_0x191840(++_0x2132bd);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';exports[_0xd9cc('0x0')]=function(_0x4f1bd5,_0x29ce42){var _0x3ad6c4=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4f1bd5[_0xd9cc('0x1')]()){case'voice':switch(_0x29ce42[_0xd9cc('0x1')]()){case _0xd9cc('0x2'):_0x3ad6c4[_0xd9cc('0x3')]({'type':_0xd9cc('0x4'),'content':'','variableName':_0xd9cc('0x5')});_0x3ad6c4[_0xd9cc('0x3')]({'type':_0xd9cc('0x4'),'content':'','variableName':_0xd9cc('0x6')});break;case _0xd9cc('0x7'):_0x3ad6c4[_0xd9cc('0x3')]({'type':_0xd9cc('0x8'),'content':_0xd9cc('0x9'),'variableName':null});_0x3ad6c4[_0xd9cc('0x3')]({'type':_0xd9cc('0x4'),'content':'','variableName':_0xd9cc('0xa')});break;}}return _0x3ad6c4;};exports[_0xd9cc('0xb')]=function(_0x546ffb,_0x46149b){var _0x2b17db=[];switch(_0x546ffb[_0xd9cc('0x1')]()){case _0xd9cc('0xc'):switch(_0x46149b[_0xd9cc('0x1')]()){case _0xd9cc('0x2'):_0x2b17db=[{'type':_0xd9cc('0x8'),'content':_0xd9cc('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd9cc('0xe'),'keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0xd9cc('0xf')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x11'),'keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x12')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x13'),'keyType':'variable','variableName':_0xd9cc('0x5')},{'type':_0xd9cc('0x10'),'content':'','key':'UniqueId','keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x14')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x15'),'keyType':'variable','variableName':_0xd9cc('0x16')},{'type':_0xd9cc('0x8'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x17'),'keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x18')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0xd9cc('0x8'),'content':_0xd9cc('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x1b'),'keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x16')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x1c'),'keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x1d')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x1e'),'keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x1f')},{'type':'keyValue','content':'','key':_0xd9cc('0x20'),'keyType':_0xd9cc('0x4'),'variableName':'holdtime'},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x21'),'keyType':_0xd9cc('0x4'),'variableName':_0xd9cc('0x22')}];break;case _0xd9cc('0x7'):_0x2b17db=[{'type':_0xd9cc('0x8'),'content':_0xd9cc('0xd'),'variableName':null},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x23'),'keyType':'variable','keyContent':'','variableName':_0xd9cc('0xa')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x24'),'keyType':_0xd9cc('0x4'),'keyContent':'','variableName':_0xd9cc('0x25')},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x26'),'keyType':_0xd9cc('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x15'),'keyType':_0xd9cc('0x4'),'keyContent':'','variableName':_0xd9cc('0x27')},{'type':_0xd9cc('0x8'),'content':_0xd9cc('0x1a')},{'type':'keyValue','content':'','key':_0xd9cc('0x28'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0xd9cc('0x10'),'content':'','key':_0xd9cc('0x29'),'keyType':_0xd9cc('0x4'),'keyContent':'','variableName':'endtime'},{'type':_0xd9cc('0x10'),'content':'','key':'Duration','keyType':_0xd9cc('0x4'),'keyContent':'','variableName':_0xd9cc('0x2a')},{'type':_0xd9cc('0x10'),'content':'','key':'Billable\x20Time','keyType':_0xd9cc('0x4'),'keyContent':'','variableName':_0xd9cc('0x2b')}];break;}}return _0x2b17db;}; \ No newline at end of file +var _0xe3d4=['Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','Date','starttime','answertime','Duration','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','push','variable','outbound','string','Outbound\x20Call','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum'];(function(_0x1d9420,_0x134775){var _0x34eedf=function(_0x22ffca){while(--_0x22ffca){_0x1d9420['push'](_0x1d9420['shift']());}};_0x34eedf(++_0x134775);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x505439,_0x5a4a50){_0x505439=_0x505439-0x0;var _0x54267a=_0xe3d4[_0x505439];return _0x54267a;};'use strict';exports['getSubjects']=function(_0x11b7c2,_0x1c2ba0){var _0x1e583c=[{'type':'string','content':_0x4e3d('0x0'),'variableName':null}];switch(_0x11b7c2[_0x4e3d('0x1')]()){case'voice':switch(_0x1c2ba0[_0x4e3d('0x1')]()){case'inbound':_0x1e583c[_0x4e3d('0x2')]({'type':_0x4e3d('0x3'),'content':'','variableName':'queue'});_0x1e583c[_0x4e3d('0x2')]({'type':_0x4e3d('0x3'),'content':'','variableName':'calleridnum'});break;case _0x4e3d('0x4'):_0x1e583c[_0x4e3d('0x2')]({'type':_0x4e3d('0x5'),'content':_0x4e3d('0x6'),'variableName':null});_0x1e583c[_0x4e3d('0x2')]({'type':_0x4e3d('0x3'),'content':'','variableName':'destcalleridnum'});break;}}return _0x1e583c;};exports['getDescriptions']=function(_0x7f3787,_0x1a79cf){var _0x17ea9a=[];switch(_0x7f3787[_0x4e3d('0x1')]()){case _0x4e3d('0x7'):switch(_0x1a79cf[_0x4e3d('0x1')]()){case'inbound':_0x17ea9a=[{'type':_0x4e3d('0x5'),'content':_0x4e3d('0x8'),'key':null,'keyType':null,'variableName':null},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0xa'),'keyType':_0x4e3d('0x3'),'variableName':_0x4e3d('0xb')},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0xc'),'keyType':'variable','variableName':_0x4e3d('0xd')},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0xe'),'keyType':'variable','variableName':_0x4e3d('0xf')},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x10'),'keyType':_0x4e3d('0x3'),'variableName':_0x4e3d('0x11')},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x12'),'keyType':_0x4e3d('0x3'),'variableName':'uniqueid'},{'type':_0x4e3d('0x9'),'content':'','key':'Date','keyType':'variable','variableName':_0x4e3d('0x13')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x14'),'keyType':_0x4e3d('0x3'),'variableName':_0x4e3d('0x15')},{'type':'keyValue','content':'','key':_0x4e3d('0x16'),'keyType':'variable','variableName':_0x4e3d('0x17')},{'type':'string','content':_0x4e3d('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x19'),'keyType':_0x4e3d('0x3'),'variableName':_0x4e3d('0x13')},{'type':_0x4e3d('0x9'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x4e3d('0x1a')},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x1b'),'keyType':_0x4e3d('0x3'),'variableName':_0x4e3d('0x1c')},{'type':'keyValue','content':'','key':_0x4e3d('0x1d'),'keyType':_0x4e3d('0x3'),'variableName':_0x4e3d('0x1e')},{'type':'keyValue','content':'','key':_0x4e3d('0x1f'),'keyType':_0x4e3d('0x3'),'variableName':'talktime'}];break;case _0x4e3d('0x4'):_0x17ea9a=[{'type':_0x4e3d('0x5'),'content':_0x4e3d('0x8'),'variableName':null},{'type':'keyValue','content':'','key':_0x4e3d('0x20'),'keyType':'variable','keyContent':'','variableName':_0x4e3d('0x17')},{'type':'keyValue','content':'','key':_0x4e3d('0x21'),'keyType':_0x4e3d('0x3'),'keyContent':'','variableName':_0x4e3d('0x22')},{'type':'keyValue','content':'','key':_0x4e3d('0x12'),'keyType':_0x4e3d('0x3'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x4e3d('0x23'),'keyType':_0x4e3d('0x3'),'keyContent':'','variableName':_0x4e3d('0x24')},{'type':'string','content':_0x4e3d('0x18')},{'type':_0x4e3d('0x9'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x4e3d('0x25')},{'type':_0x4e3d('0x9'),'content':'','key':'Complete\x20Time','keyType':_0x4e3d('0x3'),'keyContent':'','variableName':'endtime'},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x26'),'keyType':'variable','keyContent':'','variableName':_0x4e3d('0x27')},{'type':_0x4e3d('0x9'),'content':'','key':_0x4e3d('0x28'),'keyType':'variable','keyContent':'','variableName':_0x4e3d('0x29')}];break;}}return _0x17ea9a;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 3db0875..e4231c8 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 _0x8838=['upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','then','update','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','fax-interactions','sms-interactions','chat-interactions'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8838,0x1ad));var _0x8883=function(_0x2966a3,_0xce332a){_0x2966a3=_0x2966a3-0x0;var _0x46818e=_0x8838[_0x2966a3];return _0x46818e;};'use strict';var _=require(_0x8883('0x0'));var db=require(_0x8883('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x8883('0x2'))('mail-interactions'),'fax':require(_0x8883('0x2'))(_0x8883('0x3')),'sms':require(_0x8883('0x2'))(_0x8883('0x4')),'chat':require(_0x8883('0x2'))(_0x8883('0x5'))};function getInteractionId(_0x24ba46,_0x16fd61,_0x14590c){if(_0x24ba46&&_0x24ba46[_[_0x8883('0x6')](_0x14590c)+'InteractionId']){return _0x24ba46[_[_0x8883('0x6')](_0x14590c)+_0x8883('0x7')];}else if(_0x24ba46&&_0x24ba46['id']){return _0x24ba46['id'];}else if(_0x16fd61&&_0x16fd61['id']){return _0x16fd61['id'];}else{return'unknown';}}function log(_0x2aecd1,_0x1a3ef7,_0x3e098,_0xfadaa6,_0x48f462,_0x22b96b){loggers[_0x48f462[_0x8883('0x8')]()][_0x2aecd1](_0x8883('0x9'),_0x22b96b[_0x8883('0xa')](),_0x1a3ef7?_0x1a3ef7['id']:null,_0x1a3ef7?_0x1a3ef7[_0x8883('0xb')]:null,_0x1a3ef7?_0x1a3ef7[_0x8883('0xc')]:null,getInteractionId(_0x3e098,_0xfadaa6,_0x48f462),_0x3e098?JSON[_0x8883('0xd')](_0x3e098):'null');}function updateUser(_0x59c860,_0x2a8376,_0x57cb64,_0x1d869,_0x48d28a){db[_[_0x8883('0x6')](_0x1d869)+'Interaction'][_0x8883('0xe')]({'where':{'id':getInteractionId(_0x2a8376,_0x57cb64,_0x1d869)}})[_0x8883('0xf')](function(_0x4319cf){if(_0x4319cf){return _0x4319cf[_0x8883('0x10')]({'UserId':_0x59c860?_0x59c860['id']:null});}})[_0x8883('0xf')](function(_0x9f5919){if(_0x9f5919){log('info',_0x59c860,_0x2a8376,_0x57cb64,_0x1d869,_0x48d28a);}})[_0x8883('0x11')](function(){log(_0x8883('0x12'),_0x59c860,_0x2a8376,_0x57cb64,_0x1d869,_0x48d28a);});}exports[_0x8883('0x13')]=function(_0x4d1b05,_0x450319){return function(_0x371ef3,_0xb73e71,_0x36363a){var _0x39e129=_0x371ef3[_0x8883('0x14')];var _0x1a0834={};var _0x16ab4d=_0x371ef3[_0x8883('0x15')];if(_0x1a0834){_0x1a0834=_[_0x8883('0x16')](_0x371ef3[_0x8883('0x17')]);_0x1a0834=_[_0x8883('0x18')](_0x1a0834,[_0x8883('0x17'),_0x8883('0x19'),_0x8883('0x1a'),_0x8883('0x1b'),_0x8883('0x1c')]);}updateUser(_0x39e129,_0x1a0834,_0x16ab4d,_0x4d1b05,_0x450319);_0x36363a(null);};}; \ No newline at end of file +var _0xb096=['toUpperCase','name','role','stringify','null','then','update','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x1b339f,_0x5e7439){var _0xf6b780=function(_0x2e4569){while(--_0x2e4569){_0x1b339f['push'](_0x1b339f['shift']());}};_0xf6b780(++_0x5e7439);}(_0xb096,0x10c));var _0x6b09=function(_0xad3290,_0x5524db){_0xad3290=_0xad3290-0x0;var _0x4476e9=_0xb096[_0xad3290];return _0x4476e9;};'use strict';var _=require(_0x6b09('0x0'));var db=require(_0x6b09('0x1'))['db'];var loggers={'openchannel':require(_0x6b09('0x2'))(_0x6b09('0x3')),'mail':require(_0x6b09('0x2'))('mail-interactions'),'fax':require(_0x6b09('0x2'))('fax-interactions'),'sms':require(_0x6b09('0x2'))(_0x6b09('0x4')),'chat':require(_0x6b09('0x2'))(_0x6b09('0x5'))};function getInteractionId(_0x6ffbe7,_0x185921,_0x50cc4c){if(_0x6ffbe7&&_0x6ffbe7[_[_0x6b09('0x6')](_0x50cc4c)+_0x6b09('0x7')]){return _0x6ffbe7[_[_0x6b09('0x6')](_0x50cc4c)+_0x6b09('0x7')];}else if(_0x6ffbe7&&_0x6ffbe7['id']){return _0x6ffbe7['id'];}else if(_0x185921&&_0x185921['id']){return _0x185921['id'];}else{return _0x6b09('0x8');}}function log(_0x6a702a,_0x5952f0,_0x58694b,_0x2e6524,_0x403c48,_0x3e6cff){loggers[_0x403c48[_0x6b09('0x9')]()][_0x6a702a](_0x6b09('0xa'),_0x3e6cff[_0x6b09('0xb')](),_0x5952f0?_0x5952f0['id']:null,_0x5952f0?_0x5952f0[_0x6b09('0xc')]:null,_0x5952f0?_0x5952f0[_0x6b09('0xd')]:null,getInteractionId(_0x58694b,_0x2e6524,_0x403c48),_0x58694b?JSON[_0x6b09('0xe')](_0x58694b):_0x6b09('0xf'));}function updateUser(_0x5c19dc,_0x4a9795,_0x5e055b,_0x3fea8f,_0xe121fd){db[_[_0x6b09('0x6')](_0x3fea8f)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x4a9795,_0x5e055b,_0x3fea8f)}})[_0x6b09('0x10')](function(_0x2f65a0){if(_0x2f65a0){return _0x2f65a0[_0x6b09('0x11')]({'UserId':_0x5c19dc?_0x5c19dc['id']:null});}})[_0x6b09('0x10')](function(_0x10d618){if(_0x10d618){log(_0x6b09('0x12'),_0x5c19dc,_0x4a9795,_0x5e055b,_0x3fea8f,_0xe121fd);}})[_0x6b09('0x13')](function(){log(_0x6b09('0x14'),_0x5c19dc,_0x4a9795,_0x5e055b,_0x3fea8f,_0xe121fd);});}exports[_0x6b09('0x15')]=function(_0x3be612,_0x574b95){return function(_0x37088a,_0x237431,_0x5f3038){var _0x2d00f5=_0x37088a[_0x6b09('0x16')];var _0x446833={};var _0x2f42bd=_0x37088a[_0x6b09('0x17')];if(_0x446833){_0x446833=_[_0x6b09('0x18')](_0x37088a[_0x6b09('0x19')]);_0x446833=_[_0x6b09('0x1a')](_0x446833,[_0x6b09('0x19'),_0x6b09('0x1b'),_0x6b09('0x1c'),_0x6b09('0x1d'),_0x6b09('0x1e')]);}updateUser(_0x2d00f5,_0x446833,_0x2f42bd,_0x3be612,_0x574b95);_0x5f3038(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index e7421ef..a9d2f4f 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 _0x5da6=['user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin'];(function(_0x1acadd,_0x52f38d){var _0x892b5d=function(_0x230266){while(--_0x230266){_0x1acadd['push'](_0x1acadd['shift']());}};_0x892b5d(++_0x52f38d);}(_0x5da6,0x1ca));var _0x65da=function(_0x912633,_0x442907){_0x912633=_0x912633-0x0;var _0x1561e=_0x5da6[_0x912633];return _0x1561e;};'use strict';var crypto=require('crypto');var util=require(_0x65da('0x0'));var compose=require(_0x65da('0x1'));var db=require(_0x65da('0x2'))['db'];var config=require(_0x65da('0x3'));function getValueFromLicense(_0x48d483,_0x12b0eb){if(_0x48d483&&_0x12b0eb){if(_0x12b0eb['data1']&&_0x12b0eb[_0x65da('0x4')]){var _0x1c431a=_0x12b0eb[_0x65da('0x5')];var _0x298f60=_0x12b0eb['license'];var _0x2b5706=_0x1c431a[_0x65da('0x6')]('-')[0x4];var _0x197769=_0x1c431a[_0x65da('0x6')]('-')[0x0];var _0x26419e=crypto[_0x65da('0x7')](_0x65da('0x8'),util['format'](_0x65da('0x9'),_0x2b5706,_0x1c431a,_0x197769));var _0x176581=_0x26419e['update'](_0x298f60,_0x65da('0xa'),_0x65da('0xb'));_0x176581+=_0x26419e[_0x65da('0xc')](_0x65da('0xb'));var _0x1d463d=JSON[_0x65da('0xd')](_0x176581);return _0x1d463d[_0x65da('0xe')](_0x48d483)?_0x1d463d[_0x48d483]:null;}}return null;}function isLimit(_0x507173,_0x8f19b6,_0x49e9cd,_0x310198){var _0x5c6c25=_0x8f19b6;return compose()['use'](function(_0x3231a7,_0x3861a6,_0x162fcb){return db['License'][_0x65da('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x7c5e7a){var _0x1d6cea=getValueFromLicense(_0x507173,_0x7c5e7a);return _0x1d6cea?_0x1d6cea:_0x5c6c25;})[_0x65da('0x10')](function(_0x282013){_0x5c6c25=_0x282013;return _0x49e9cd['count'](_0x310198);})['then'](function(_0x4e3df0){if(_0x4e3df0>=_0x5c6c25){return _0x3861a6['status'](0x193)[_0x65da('0x11')]({'message':util['format'](_0x65da('0x12'),_0x507173)});}_0x162fcb();})[_0x65da('0x13')](function(_0x2c0b6b){_0x162fcb(_0x2c0b6b);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x65da('0x14')],{'where':{'$or':[{'role':_0x65da('0x15')},{'role':_0x65da('0x16')}]}});}exports[_0x65da('0x17')]=isUserLimit; \ No newline at end of file +var _0x3abd=['%s:%s:%s','update','utf8','final','parse','use','License','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x441f45,_0x16130c){var _0x2bc267=function(_0x44f8a4){while(--_0x44f8a4){_0x441f45['push'](_0x441f45['shift']());}};_0x2bc267(++_0x16130c);}(_0x3abd,0xe8));var _0xd3ab=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x3abd[_0x403c20];return _0x2b271a;};'use strict';var crypto=require(_0xd3ab('0x0'));var util=require(_0xd3ab('0x1'));var compose=require(_0xd3ab('0x2'));var db=require(_0xd3ab('0x3'))['db'];var config=require(_0xd3ab('0x4'));function getValueFromLicense(_0x40009f,_0x28b455){if(_0x40009f&&_0x28b455){if(_0x28b455[_0xd3ab('0x5')]&&_0x28b455[_0xd3ab('0x6')]){var _0x40b5c6=_0x28b455['data1'];var _0x260454=_0x28b455[_0xd3ab('0x6')];var _0x1f4832=_0x40b5c6[_0xd3ab('0x7')]('-')[0x4];var _0x51f150=_0x40b5c6[_0xd3ab('0x7')]('-')[0x0];var _0x250e7e=crypto[_0xd3ab('0x8')](_0xd3ab('0x9'),util[_0xd3ab('0xa')](_0xd3ab('0xb'),_0x1f4832,_0x40b5c6,_0x51f150));var _0x590c22=_0x250e7e[_0xd3ab('0xc')](_0x260454,'base64',_0xd3ab('0xd'));_0x590c22+=_0x250e7e[_0xd3ab('0xe')](_0xd3ab('0xd'));var _0x103546=JSON[_0xd3ab('0xf')](_0x590c22);return _0x103546['hasOwnProperty'](_0x40009f)?_0x103546[_0x40009f]:null;}}return null;}function isLimit(_0x289c0e,_0x500360,_0x30a9c9,_0x56887e){var _0x31e143=_0x500360;return compose()[_0xd3ab('0x10')](function(_0x3426d9,_0x12bdd2,_0x4cfcbe){return db[_0xd3ab('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xd3ab('0x12')](function(_0x36b9bf){var _0x41659f=getValueFromLicense(_0x289c0e,_0x36b9bf);return _0x41659f?_0x41659f:_0x31e143;})[_0xd3ab('0x12')](function(_0x1fe874){_0x31e143=_0x1fe874;return _0x30a9c9['count'](_0x56887e);})[_0xd3ab('0x12')](function(_0x1fd9ad){if(_0x1fd9ad>=_0x31e143){return _0x12bdd2[_0xd3ab('0x13')](0x193)[_0xd3ab('0x14')]({'message':util['format'](_0xd3ab('0x15'),_0x289c0e)});}_0x4cfcbe();})[_0xd3ab('0x16')](function(_0x3f06ea){_0x4cfcbe(_0x3f06ea);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xd3ab('0x17')],{'where':{'$or':[{'role':_0xd3ab('0x18')},{'role':_0xd3ab('0x19')}]}});}exports[_0xd3ab('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 525872e..4e20893 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa533=['operator','$eq','$between','value','castTo','text','CAST(','field','$notIn','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$startsWith','$endsWith','$lt','<\x20?','$gt','>\x20?','$lte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','add','hours','minutes','seconds','format','lodash','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','slice','shift','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE'];(function(_0x51a700,_0x449415){var _0x1c1e59=function(_0x25e8ab){while(--_0x25e8ab){_0x51a700['push'](_0x51a700['shift']());}};_0x1c1e59(++_0x449415);}(_0xa533,0x120));var _0x3a53=function(_0x2203b3,_0x12aa65){_0x2203b3=_0x2203b3-0x0;var _0x3e095a=_0xa533[_0x2203b3];return _0x3e095a;};'use strict';var _=require(_0x3a53('0x0'));var moment=require('moment');exports[_0x3a53('0x1')]=function(_0xc799f6){var _0x22660c={'conditions':[]};_0x22660c[_0x3a53('0x2')]=_['startsWith'](_0xc799f6,_0x3a53('0x3'))?'or':_0x3a53('0x4');var _0x4a3d0c=_0xc799f6[_0x3a53('0x5')](_0x3a53('0x6'),'')[_0x3a53('0x5')]('[$or]','')[_0x3a53('0x7')]('||');for(var _0x4c3f57=0x0;_0x4c3f57<_0x4a3d0c['length'];_0x4c3f57++){var _0x219c0d=_0x4a3d0c[_0x4c3f57][_0x3a53('0x7')](':=');var _0x57d0c3=_0x219c0d[0x0];var _0x179ab7=_0x219c0d[_0x3a53('0x8')](0x1);_0x179ab7['forEach'](function(_0x40c314){var _0x29430a=_0x40c314[_0x3a53('0x7')]('[')[_0x3a53('0x9')]();var _0x1fae59=_0x40c314['match'](/\[(.*?)\]/g);_0x1fae59[_0x3a53('0xa')](function(_0x39d0){var _0x107e88=_0x39d0[_0x3a53('0x7')]('[')[_0x3a53('0xb')](function(_0x357c3c){return _0x357c3c[_0x3a53('0xc')](']')>-0x1;})[_0x3a53('0xd')](function(_0xcbeb8){return _0xcbeb8[_0x3a53('0x7')](']')[0x0];})[0x0];_0x22660c[_0x3a53('0xe')][_0x3a53('0xf')]({'field':_0x57d0c3,'operator':_0x29430a,'value':_0x107e88});});});}return _0x22660c;};exports[_0x3a53('0x10')]=function(_0x595542,_0x35a1f1,_0x5a40db){var _0x2ff64c={};if(_0x35a1f1===_0x3a53('0x11')&&_0x5a40db[_0x3a53('0x12')]===_0x3a53('0x13')){_0x5a40db['operator']=_0x3a53('0x14');_0x5a40db['value']+=','+_0x5a40db[_0x3a53('0x15')];}if(_0x5a40db[_0x3a53('0x16')]){_0x35a1f1=_0x5a40db[_0x3a53('0x16')];_0x2ff64c[_0x3a53('0x17')]=_0x3a53('0x18')+_0x595542+'.'+_0x5a40db['field']+'\x20AS\x20'+_0x5a40db['castTo']+')\x20'+parseOperator(_0x5a40db['operator']);}else{_0x2ff64c[_0x3a53('0x17')]=_0x595542+'.'+_0x5a40db[_0x3a53('0x19')]+'\x20'+parseOperator(_0x5a40db[_0x3a53('0x12')]);}if(_0x5a40db['operator']===_0x3a53('0x1a'))_0x2ff64c[_0x3a53('0x17')]='('+_0x2ff64c[_0x3a53('0x17')]+'\x20OR\x20'+_0x595542+'.'+_0x5a40db[_0x3a53('0x19')]+'\x20IS\x20NULL)';_0x2ff64c['value']=parseValue(_0x35a1f1,_0x5a40db[_0x3a53('0x12')],_0x5a40db[_0x3a53('0x15')]);return _0x2ff64c;};function parseOperator(_0x157732){var _0x2318a8;switch(_0x157732){case _0x3a53('0x1b'):_0x2318a8=_0x3a53('0x1c');break;case'$notIn':_0x2318a8=_0x3a53('0x1d');break;case'$eq':_0x2318a8=_0x3a53('0x1e');break;case _0x3a53('0x1f'):_0x2318a8=_0x3a53('0x20');break;case'$substring':case _0x3a53('0x21'):case _0x3a53('0x22'):_0x2318a8='LIKE\x20?';break;case _0x3a53('0x23'):_0x2318a8=_0x3a53('0x24');break;case _0x3a53('0x25'):_0x2318a8=_0x3a53('0x26');break;case _0x3a53('0x27'):_0x2318a8='<=\x20?';break;case'$gte':_0x2318a8=_0x3a53('0x28');break;case _0x3a53('0x14'):_0x2318a8=_0x3a53('0x29');break;}return _0x2318a8;}function parseValue(_0x16ff28,_0xd68912,_0x1afe6a){var _0x5dcc5b={'start':undefined,'end':undefined};switch(_0xd68912){case _0x3a53('0x1b'):case _0x3a53('0x1a'):_0x5dcc5b[_0x3a53('0x2a')]=_0x1afe6a[_0x3a53('0x7')](',');break;case _0x3a53('0x2b'):_0x5dcc5b[_0x3a53('0x2a')]='%'+_0x1afe6a+'%';break;case _0x3a53('0x21'):_0x5dcc5b[_0x3a53('0x2a')]=_0x1afe6a+'%';break;case _0x3a53('0x22'):_0x5dcc5b[_0x3a53('0x2a')]='%'+_0x1afe6a;break;case _0x3a53('0x14'):var _0xb44c1d=_0x1afe6a[_0x3a53('0x7')](',');var _0x1afe6a=_0xb44c1d[_0x3a53('0x9')]();var _0x5be19d=_0xb44c1d[_0x3a53('0x2c')]();if(_0x16ff28===_0x3a53('0x11')){_0x1afe6a=moment(_0x1afe6a)[_0x3a53('0x2d')](0x0,!![])['format']();_0x5be19d=moment(_0x5be19d)[_0x3a53('0x2d')](0x0,!![])[_0x3a53('0x2e')](0x17,_0x3a53('0x2f'))[_0x3a53('0x2e')](0x3b,_0x3a53('0x30'))['add'](0x3b,_0x3a53('0x31'))[_0x3a53('0x32')]();}_0x5dcc5b={'start':_0x1afe6a,'end':_0x5be19d};break;default:_0x5dcc5b[_0x3a53('0x2a')]=_0x1afe6a;break;}return _0x5dcc5b;} \ No newline at end of file +var _0x4745=['text','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','$ne','$substring','$startsWith','$endsWith','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','format','hours','seconds','lodash','moment','parseSearch','[$or]','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','buildExpression','DATE','operator','$between','value','castTo'];(function(_0x1ba54d,_0x320fd8){var _0x31bf2d=function(_0x3485ca){while(--_0x3485ca){_0x1ba54d['push'](_0x1ba54d['shift']());}};_0x31bf2d(++_0x320fd8);}(_0x4745,0xcd));var _0x5474=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x4745[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x5474('0x0'));var moment=require(_0x5474('0x1'));exports[_0x5474('0x2')]=function(_0x21c619){var _0x233c13={'conditions':[]};_0x233c13['sqlOperator']=_['startsWith'](_0x21c619,_0x5474('0x3'))?'or':'and';var _0x371b5a=_0x21c619['replace'](_0x5474('0x4'),'')['replace'](_0x5474('0x3'),'')[_0x5474('0x5')]('||');for(var _0x28c82f=0x0;_0x28c82f<_0x371b5a[_0x5474('0x6')];_0x28c82f++){var _0x38f8db=_0x371b5a[_0x28c82f]['split'](':=');var _0x54bb86=_0x38f8db[0x0];var _0x231632=_0x38f8db[_0x5474('0x7')](0x1);_0x231632[_0x5474('0x8')](function(_0x2ef496){var _0x8b3814=_0x2ef496[_0x5474('0x5')]('[')[_0x5474('0x9')]();var _0x4f82ba=_0x2ef496[_0x5474('0xa')](/\[(.*?)\]/g);_0x4f82ba[_0x5474('0x8')](function(_0x10ae56){var _0x5b31e6=_0x10ae56[_0x5474('0x5')]('[')[_0x5474('0xb')](function(_0x525382){return _0x525382[_0x5474('0xc')](']')>-0x1;})['map'](function(_0x3082ca){return _0x3082ca['split'](']')[0x0];})[0x0];_0x233c13[_0x5474('0xd')]['push']({'field':_0x54bb86,'operator':_0x8b3814,'value':_0x5b31e6});});});}return _0x233c13;};exports[_0x5474('0xe')]=function(_0x24cfe9,_0x19c452,_0x47cbba){var _0x30b1da={};if(_0x19c452===_0x5474('0xf')&&_0x47cbba[_0x5474('0x10')]==='$eq'){_0x47cbba['operator']=_0x5474('0x11');_0x47cbba[_0x5474('0x12')]+=','+_0x47cbba['value'];}if(_0x47cbba['castTo']){_0x19c452=_0x47cbba[_0x5474('0x13')];_0x30b1da[_0x5474('0x14')]='CAST('+_0x24cfe9+'.'+_0x47cbba[_0x5474('0x15')]+_0x5474('0x16')+_0x47cbba['castTo']+')\x20'+parseOperator(_0x47cbba[_0x5474('0x10')]);}else{_0x30b1da[_0x5474('0x14')]=_0x24cfe9+'.'+_0x47cbba[_0x5474('0x15')]+'\x20'+parseOperator(_0x47cbba[_0x5474('0x10')]);}if(_0x47cbba[_0x5474('0x10')]===_0x5474('0x17'))_0x30b1da[_0x5474('0x14')]='('+_0x30b1da[_0x5474('0x14')]+'\x20OR\x20'+_0x24cfe9+'.'+_0x47cbba['field']+_0x5474('0x18');_0x30b1da[_0x5474('0x12')]=parseValue(_0x19c452,_0x47cbba[_0x5474('0x10')],_0x47cbba[_0x5474('0x12')]);return _0x30b1da;};function parseOperator(_0x1c7a9b){var _0x2ea2f4;switch(_0x1c7a9b){case _0x5474('0x19'):_0x2ea2f4=_0x5474('0x1a');break;case _0x5474('0x17'):_0x2ea2f4=_0x5474('0x1b');break;case _0x5474('0x1c'):_0x2ea2f4='=\x20?';break;case _0x5474('0x1d'):_0x2ea2f4='<>\x20?';break;case _0x5474('0x1e'):case _0x5474('0x1f'):case _0x5474('0x20'):_0x2ea2f4='LIKE\x20?';break;case'$lt':_0x2ea2f4='<\x20?';break;case'$gt':_0x2ea2f4=_0x5474('0x21');break;case _0x5474('0x22'):_0x2ea2f4=_0x5474('0x23');break;case _0x5474('0x24'):_0x2ea2f4=_0x5474('0x25');break;case _0x5474('0x11'):_0x2ea2f4=_0x5474('0x26');break;}return _0x2ea2f4;}function parseValue(_0xcfbe34,_0x25a71f,_0x5acd80){var _0x30f53f={'start':undefined,'end':undefined};switch(_0x25a71f){case _0x5474('0x19'):case _0x5474('0x17'):_0x30f53f[_0x5474('0x27')]=_0x5acd80[_0x5474('0x5')](',');break;case _0x5474('0x1e'):_0x30f53f[_0x5474('0x27')]='%'+_0x5acd80+'%';break;case _0x5474('0x1f'):_0x30f53f[_0x5474('0x27')]=_0x5acd80+'%';break;case _0x5474('0x20'):_0x30f53f[_0x5474('0x27')]='%'+_0x5acd80;break;case _0x5474('0x11'):var _0xa19eeb=_0x5acd80[_0x5474('0x5')](',');var _0x5acd80=_0xa19eeb['shift']();var _0x149065=_0xa19eeb[_0x5474('0x28')]();if(_0xcfbe34===_0x5474('0xf')){_0x5acd80=moment(_0x5acd80)[_0x5474('0x29')](0x0,!![])[_0x5474('0x2a')]();_0x149065=moment(_0x149065)['utcOffset'](0x0,!![])['add'](0x17,_0x5474('0x2b'))['add'](0x3b,'minutes')['add'](0x3b,_0x5474('0x2c'))[_0x5474('0x2a')]();}_0x30f53f={'start':_0x5acd80,'end':_0x149065};break;default:_0x30f53f[_0x5474('0x27')]=_0x5acd80;break;}return _0x30f53f;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 974838b..9c35a43 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 _0x622f=['isArray','parse','limit','indexOf','priority','cast','unsigned','substr','col','ASC','length','omit','isString','hasOwnProperty','isNumeric','match','^[0-9]*$','getFullTextValue','push','toString','lodash','sequelize','split','isEmpty','forOwn'];(function(_0x19cf72,_0x37be00){var _0x2e5b3b=function(_0x3024e8){while(--_0x3024e8){_0x19cf72['push'](_0x19cf72['shift']());}};_0x2e5b3b(++_0x37be00);}(_0x622f,0x172));var _0xf622=function(_0x483167,_0x2b7e29){_0x483167=_0x483167-0x0;var _0x2edd09=_0x622f[_0x483167];return _0x2edd09;};'use strict';var _=require(_0xf622('0x0'));var sequelize=require(_0xf622('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x22dcf7){var _0x714ebc=null;if(_0x22dcf7){_0x714ebc=_0x22dcf7[_0xf622('0x2')](',');}return _0x714ebc;};exports['filters']=function(_0x15c083){var _0x4e7991={};if(!_[_0xf622('0x3')](_0x15c083)){_0x4e7991={};_[_0xf622('0x4')](_0x15c083,function(_0x5214ae,_0x5ee2d0){try{_0x4e7991[_0x5ee2d0]=_[_0xf622('0x5')](_0x5214ae)?_0x5214ae:JSON[_0xf622('0x6')](_0x5214ae);}catch(_0x540b19){_0x4e7991[_0x5ee2d0]=_0x5214ae[_0xf622('0x2')](',');}});}return _0x4e7991;};exports[_0xf622('0x7')]=function(_0x54a7bc){_0x54a7bc=parseInt(_0x54a7bc,0xa);if(!_0x54a7bc||_0x54a7bc<0x0){_0x54a7bc=LIMIT_VALUE;}return _0x54a7bc;};exports['offset']=function(_0x214e41){_0x214e41=parseInt(_0x214e41,0xa);if(!_0x214e41||_0x214e41<0x0){_0x214e41=0x0;}return _0x214e41;};exports['sort']=function(_0x3785d5){var _0xae0980,_0x16e7c4=null;if(_0x3785d5){_0xae0980=_0x3785d5[_0xf622('0x2')](',');_0x16e7c4=_['map'](_0xae0980,function(_0xa70c8f){if(_0xa70c8f[_0xf622('0x8')]('-')===0x0){return[_0xa70c8f===_0xf622('0x9')?sequelize[_0xf622('0xa')](sequelize['col'](_0xf622('0x9')),_0xf622('0xb')):_0xa70c8f[_0xf622('0xc')](0x1),'DESC'];}else{return[_0xa70c8f===_0xf622('0x9')?sequelize[_0xf622('0xa')](sequelize[_0xf622('0xd')](_0xf622('0x9')),_0xf622('0xb')):_0xa70c8f,_0xf622('0xe')];}});}return _0x16e7c4;};exports['omit']=function(_0x21cddf,_0x5ca35f){if(_[_0xf622('0x3')](_0x21cddf)){return _0x21cddf;}if(_['isArray'](_0x21cddf)){for(var _0x43aaf9=0x0;_0x43aaf9<_0x21cddf[_0xf622('0xf')];_0x43aaf9+=0x1){_0x21cddf[_0x43aaf9]=this[_0xf622('0x10')](_0x21cddf[_0x43aaf9],_0x5ca35f);}return _0x21cddf;}if(!_['isObject'](_0x21cddf)){return _0x21cddf;}if(_[_0xf622('0x11')](_0x5ca35f)){_0x5ca35f=[_0x5ca35f];}if(!_[_0xf622('0x5')](_0x5ca35f)){return _0x21cddf;}for(var _0x5a4cf1=0x0;_0x5a4cf1<_0x5ca35f['length'];_0x5a4cf1+=0x1){_['unset'](_0x21cddf,_0x5ca35f[_0x5a4cf1]);}for(var _0x1a572d in _0x21cddf){if(_0x21cddf[_0xf622('0x12')](_0x1a572d)){_0x21cddf[_0x1a572d]=this[_0xf622('0x10')](_0x21cddf[_0x1a572d],_0x5ca35f);}}return _0x21cddf;};exports[_0xf622('0x13')]=function(_0xd37f1c){return _0xd37f1c[_0xf622('0x14')](RegExp(_0xf622('0x15')))?!![]:![];};exports['isEmail']=function(_0x246e8f){return _0x246e8f[_0xf622('0x14')](/^\S+@\S+$/)?!![]:![];};exports[_0xf622('0x16')]=function(_0x2404bb){var _0x20c7b4=[];_0x2404bb[_0xf622('0x2')]('\x20')['forEach'](function(_0x48ee87){_0x20c7b4[_0xf622('0x17')]('+'+_0x48ee87[_0xf622('0x18')]()+'*');});return _0x20c7b4['join']('\x20');}; \ No newline at end of file +var _0xbfe8=['isString','length','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','toString','join','lodash','sequelize','fields','filters','forOwn','isArray','parse','split','limit','offset','sort','map','indexOf','cast','priority','unsigned','substr','col','ASC','omit','isObject'];(function(_0x45b307,_0x1bc393){var _0x5b5713=function(_0x6d6a86){while(--_0x6d6a86){_0x45b307['push'](_0x45b307['shift']());}};_0x5b5713(++_0x1bc393);}(_0xbfe8,0x1eb));var _0x8bfe=function(_0x4a476f,_0x418371){_0x4a476f=_0x4a476f-0x0;var _0x193023=_0xbfe8[_0x4a476f];return _0x193023;};'use strict';var _=require(_0x8bfe('0x0'));var sequelize=require(_0x8bfe('0x1'));var LIMIT_VALUE=0xfa;exports[_0x8bfe('0x2')]=function(_0x5a78d2){var _0x1f4355=null;if(_0x5a78d2){_0x1f4355=_0x5a78d2['split'](',');}return _0x1f4355;};exports[_0x8bfe('0x3')]=function(_0x1e4d0a){var _0x49c626={};if(!_['isEmpty'](_0x1e4d0a)){_0x49c626={};_[_0x8bfe('0x4')](_0x1e4d0a,function(_0x437b15,_0x4f762a){try{_0x49c626[_0x4f762a]=_[_0x8bfe('0x5')](_0x437b15)?_0x437b15:JSON[_0x8bfe('0x6')](_0x437b15);}catch(_0xbb2ac1){_0x49c626[_0x4f762a]=_0x437b15[_0x8bfe('0x7')](',');}});}return _0x49c626;};exports[_0x8bfe('0x8')]=function(_0x21a208){_0x21a208=parseInt(_0x21a208,0xa);if(!_0x21a208||_0x21a208<0x0){_0x21a208=LIMIT_VALUE;}return _0x21a208;};exports[_0x8bfe('0x9')]=function(_0x5c3a0c){_0x5c3a0c=parseInt(_0x5c3a0c,0xa);if(!_0x5c3a0c||_0x5c3a0c<0x0){_0x5c3a0c=0x0;}return _0x5c3a0c;};exports[_0x8bfe('0xa')]=function(_0x4c2907){var _0x57d3ea,_0x134866=null;if(_0x4c2907){_0x57d3ea=_0x4c2907[_0x8bfe('0x7')](',');_0x134866=_[_0x8bfe('0xb')](_0x57d3ea,function(_0x23b269){if(_0x23b269[_0x8bfe('0xc')]('-')===0x0){return[_0x23b269==='priority'?sequelize[_0x8bfe('0xd')](sequelize['col'](_0x8bfe('0xe')),_0x8bfe('0xf')):_0x23b269[_0x8bfe('0x10')](0x1),'DESC'];}else{return[_0x23b269===_0x8bfe('0xe')?sequelize[_0x8bfe('0xd')](sequelize[_0x8bfe('0x11')]('priority'),_0x8bfe('0xf')):_0x23b269,_0x8bfe('0x12')];}});}return _0x134866;};exports[_0x8bfe('0x13')]=function(_0x56d202,_0x206e68){if(_['isEmpty'](_0x56d202)){return _0x56d202;}if(_[_0x8bfe('0x5')](_0x56d202)){for(var _0x33d3d7=0x0;_0x33d3d7<_0x56d202['length'];_0x33d3d7+=0x1){_0x56d202[_0x33d3d7]=this[_0x8bfe('0x13')](_0x56d202[_0x33d3d7],_0x206e68);}return _0x56d202;}if(!_[_0x8bfe('0x14')](_0x56d202)){return _0x56d202;}if(_[_0x8bfe('0x15')](_0x206e68)){_0x206e68=[_0x206e68];}if(!_['isArray'](_0x206e68)){return _0x56d202;}for(var _0x4d2020=0x0;_0x4d2020<_0x206e68[_0x8bfe('0x16')];_0x4d2020+=0x1){_[_0x8bfe('0x17')](_0x56d202,_0x206e68[_0x4d2020]);}for(var _0x66fb6b in _0x56d202){if(_0x56d202[_0x8bfe('0x18')](_0x66fb6b)){_0x56d202[_0x66fb6b]=this[_0x8bfe('0x13')](_0x56d202[_0x66fb6b],_0x206e68);}}return _0x56d202;};exports[_0x8bfe('0x19')]=function(_0x2e6a6f){return _0x2e6a6f[_0x8bfe('0x1a')](RegExp(_0x8bfe('0x1b')))?!![]:![];};exports[_0x8bfe('0x1c')]=function(_0x3682e2){return _0x3682e2[_0x8bfe('0x1a')](/^\S+@\S+$/)?!![]:![];};exports[_0x8bfe('0x1d')]=function(_0x1c3100){var _0x452404=[];_0x1c3100['split']('\x20')['forEach'](function(_0x52e8c3){_0x452404['push']('+'+_0x52e8c3[_0x8bfe('0x1e')]()+'*');});return _0x452404[_0x8bfe('0x1f')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 4def335..b0203e1 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3668=['cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','production','set','appPath','join','public','development','test','root','client','use','json\x20replacer','toISOString','static','views','/server/views','engine','html','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser'];(function(_0x49bbef,_0x38fd17){var _0x5b230c=function(_0xd4e60a){while(--_0xd4e60a){_0x49bbef['push'](_0x49bbef['shift']());}};_0x5b230c(++_0x38fd17);}(_0x3668,0x173));var _0x8366=function(_0x370361,_0x22aefe){_0x370361=_0x370361-0x0;var _0x32b2f8=_0x3668[_0x370361];return _0x32b2f8;};'use strict';var express=require(_0x8366('0x0'));var favicon=require(_0x8366('0x1'));var bodyParser=require(_0x8366('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x8366('0x3'));var errorHandler=require(_0x8366('0x4'));var path=require(_0x8366('0x5'));var passport=require(_0x8366('0x6'));var cors=require(_0x8366('0x7'));var moment=require(_0x8366('0x8'));var config=require(_0x8366('0x9'));var db=require(_0x8366('0xa'))['db'];exports[_0x8366('0xb')]=function(_0x12d36b){var _0x2c6c98=_0x12d36b[_0x8366('0xc')]('env');if(_0x2c6c98===_0x8366('0xd')){_0x12d36b[_0x8366('0xe')](_0x8366('0xf'),path[_0x8366('0x10')](config['root'],_0x8366('0x11')));}if(_0x2c6c98===_0x8366('0x12')||_0x2c6c98===_0x8366('0x13')){_0x12d36b['set'](_0x8366('0xf'),path[_0x8366('0x10')](config[_0x8366('0x14')],_0x8366('0x15')));_0x12d36b[_0x8366('0x16')](errorHandler());}_0x12d36b['set'](_0x8366('0x17'),function(_0x3ef2c7,_0x19bc94){if(this[_0x3ef2c7]instanceof Date){_0x19bc94=this[_0x3ef2c7][_0x8366('0x18')]()['split']('.')[0x0]+'Z';}return _0x19bc94;});_0x12d36b[_0x8366('0x16')](express[_0x8366('0x19')](_0x12d36b[_0x8366('0xc')]('appPath')));_0x12d36b[_0x8366('0xe')](_0x8366('0x1a'),config[_0x8366('0x14')]+_0x8366('0x1b'));_0x12d36b[_0x8366('0x1c')](_0x8366('0x1d'),require('ejs')['renderFile']);_0x12d36b[_0x8366('0xe')]('view\x20engine',_0x8366('0x1d'));_0x12d36b[_0x8366('0x16')](bodyParser[_0x8366('0x1e')]({'limit':'50mb','extended':!![]}));_0x12d36b[_0x8366('0x16')](bodyParser[_0x8366('0x1f')]({'limit':_0x8366('0x20')}));_0x12d36b[_0x8366('0x16')](cors());_0x12d36b['use'](methodOverride());_0x12d36b[_0x8366('0x16')](cookieParser());_0x12d36b['use'](passport[_0x8366('0x21')]());}; \ No newline at end of file +var _0x4b66=['../mysqldb','get','env','production','set','appPath','join','root','public','development','client','use','json\x20replacer','split','static','views','/server/views','html','ejs','renderFile','urlencoded','50mb','json','initialize','serve-favicon','method-override','errorhandler','path','cors','moment','./environment'];(function(_0x40fed0,_0x5d883b){var _0x228102=function(_0x386636){while(--_0x386636){_0x40fed0['push'](_0x40fed0['shift']());}};_0x228102(++_0x5d883b);}(_0x4b66,0xb3));var _0x64b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b66[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var favicon=require(_0x64b6('0x0'));var bodyParser=require('body-parser');var methodOverride=require(_0x64b6('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x64b6('0x2'));var path=require(_0x64b6('0x3'));var passport=require('passport');var cors=require(_0x64b6('0x4'));var moment=require(_0x64b6('0x5'));var config=require(_0x64b6('0x6'));var db=require(_0x64b6('0x7'))['db'];exports['default']=function(_0x3968a2){var _0x3bb76a=_0x3968a2[_0x64b6('0x8')](_0x64b6('0x9'));if(_0x3bb76a===_0x64b6('0xa')){_0x3968a2[_0x64b6('0xb')](_0x64b6('0xc'),path[_0x64b6('0xd')](config[_0x64b6('0xe')],_0x64b6('0xf')));}if(_0x3bb76a===_0x64b6('0x10')||_0x3bb76a==='test'){_0x3968a2['set'](_0x64b6('0xc'),path[_0x64b6('0xd')](config['root'],_0x64b6('0x11')));_0x3968a2[_0x64b6('0x12')](errorHandler());}_0x3968a2[_0x64b6('0xb')](_0x64b6('0x13'),function(_0x392d58,_0x6f47b1){if(this[_0x392d58]instanceof Date){_0x6f47b1=this[_0x392d58]['toISOString']()[_0x64b6('0x14')]('.')[0x0]+'Z';}return _0x6f47b1;});_0x3968a2['use'](express[_0x64b6('0x15')](_0x3968a2[_0x64b6('0x8')](_0x64b6('0xc'))));_0x3968a2['set'](_0x64b6('0x16'),config['root']+_0x64b6('0x17'));_0x3968a2['engine'](_0x64b6('0x18'),require(_0x64b6('0x19'))[_0x64b6('0x1a')]);_0x3968a2[_0x64b6('0xb')]('view\x20engine',_0x64b6('0x18'));_0x3968a2[_0x64b6('0x12')](bodyParser[_0x64b6('0x1b')]({'limit':_0x64b6('0x1c'),'extended':!![]}));_0x3968a2['use'](bodyParser[_0x64b6('0x1d')]({'limit':_0x64b6('0x1c')}));_0x3968a2[_0x64b6('0x12')](cors());_0x3968a2[_0x64b6('0x12')](methodOverride());_0x3968a2[_0x64b6('0x12')](cookieParser());_0x3968a2[_0x64b6('0x12')](passport[_0x64b6('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 5eb530c..ec10ce4 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 _0xf072=['substring','lodash','crypto','bimedia-machine-uuid','execSync','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','createHash','md5','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress'];(function(_0x534ae9,_0x5735c1){var _0x2dc1e7=function(_0x58048a){while(--_0x58048a){_0x534ae9['push'](_0x534ae9['shift']());}};_0x2dc1e7(++_0x5735c1);}(_0xf072,0x1cf));var _0x2f07=function(_0x1d53d5,_0x1519d1){_0x1d53d5=_0x1d53d5-0x0;var _0x3c44e8=_0xf072[_0x1d53d5];return _0x3c44e8;};'use strict';var _=require(_0x2f07('0x0'));var os=require('os');var crypto=require(_0x2f07('0x1'));var machine=require(_0x2f07('0x2'));var exec=require('child_process')[_0x2f07('0x3')];function getInterfaces(){var _0x5f20e3=[];var _0x19cbb9=os[_0x2f07('0x4')]();var _0x1536c3=_['orderBy'](_[_0x2f07('0x5')](_0x19cbb9));for(var _0x14d6e6=0x0;_0x14d6e6<_0x1536c3[_0x2f07('0x6')];_0x14d6e6++){var _0x2e6422=_0x19cbb9[_0x1536c3[_0x14d6e6]][_0x2f07('0x7')](function(_0xf73d1a){return _0xf73d1a[_0x2f07('0x8')]===_0x2f07('0x9')&&_0xf73d1a[_0x2f07('0xa')]===![];});_0x5f20e3=_0x5f20e3[_0x2f07('0xb')](_0x2e6422);}return _0x5f20e3;}function getFirstInterface(){var _0x30c638=_[_0x2f07('0xc')](getInterfaces());return{'macAddress':_0x30c638&&_0x30c638[_0x2f07('0xd')]?_0x30c638[_0x2f07('0xd')]:_0x2f07('0xe'),'ipAddress':_0x30c638&&_0x30c638['address']?_0x30c638[_0x2f07('0xf')]:_0x2f07('0x10')};}exports[_0x2f07('0x11')]=getFirstInterface;function getCPUhash(){var _0x3525be=_['orderBy'](os['cpus']()[_0x2f07('0x12')](function(_0x1e291d){return _0x1e291d['model'];}))[_0x2f07('0x13')](':');return crypto[_0x2f07('0x14')](_0x2f07('0x15'))['update'](_0x3525be)[_0x2f07('0x16')](_0x2f07('0x17'));}exports[_0x2f07('0x18')]=function(){switch(os[_0x2f07('0x19')]()){case _0x2f07('0x1a'):return exec(_0x2f07('0x1b'),{'encoding':'utf8'})[_0x2f07('0x1c')]('\x0d\x0a','');default:var _0x5a7b5c=getFirstInterface();var _0x2232a4=getCPUhash();var _0xe8cf4d=_0x2232a4+'|'+os[_0x2f07('0x1d')]()+'|'+_0x5a7b5c[_0x2f07('0x1e')]+'|'+_0x5a7b5c[_0x2f07('0x1f')];var _0x46c9b4=crypto[_0x2f07('0x14')](_0x2f07('0x15'))['update'](_0xe8cf4d)[_0x2f07('0x16')]('hex');return _0x46c9b4[_0x2f07('0x20')](0x0,0x8)+'-'+_0x46c9b4[_0x2f07('0x20')](0x8,0xc)+'-'+_0x46c9b4[_0x2f07('0x20')](0xc,0x10)+'-'+_0x46c9b4[_0x2f07('0x20')](0x10,0x14)+'-'+_0x46c9b4[_0x2f07('0x20')](0x14);}}; \ No newline at end of file +var _0x1298=['family','IPv4','internal','concat','00:00:00:00:00:00','address','127.0.0.1','model','join','createHash','md5','update','getUuid','win32','utf8','replace','hostname','macAddress','ipAddress','digest','hex','substring','crypto','child_process','execSync','networkInterfaces','orderBy','length'];(function(_0x541cfe,_0x1a5d5c){var _0x386ca0=function(_0x4923aa){while(--_0x4923aa){_0x541cfe['push'](_0x541cfe['shift']());}};_0x386ca0(++_0x1a5d5c);}(_0x1298,0x19e));var _0x8129=function(_0x117e80,_0x20df08){_0x117e80=_0x117e80-0x0;var _0x5e13a0=_0x1298[_0x117e80];return _0x5e13a0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x8129('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x8129('0x1'))[_0x8129('0x2')];function getInterfaces(){var _0x5bdd76=[];var _0x3a133f=os[_0x8129('0x3')]();var _0x31d02a=_[_0x8129('0x4')](_['keys'](_0x3a133f));for(var _0x5b5ab8=0x0;_0x5b5ab8<_0x31d02a[_0x8129('0x5')];_0x5b5ab8++){var _0x579301=_0x3a133f[_0x31d02a[_0x5b5ab8]]['filter'](function(_0x1cd6a6){return _0x1cd6a6[_0x8129('0x6')]===_0x8129('0x7')&&_0x1cd6a6[_0x8129('0x8')]===![];});_0x5bdd76=_0x5bdd76[_0x8129('0x9')](_0x579301);}return _0x5bdd76;}function getFirstInterface(){var _0x53a78b=_['head'](getInterfaces());return{'macAddress':_0x53a78b&&_0x53a78b['mac']?_0x53a78b['mac']:_0x8129('0xa'),'ipAddress':_0x53a78b&&_0x53a78b[_0x8129('0xb')]?_0x53a78b['address']:_0x8129('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x511313=_[_0x8129('0x4')](os['cpus']()['map'](function(_0x392d45){return _0x392d45[_0x8129('0xd')];}))[_0x8129('0xe')](':');return crypto[_0x8129('0xf')](_0x8129('0x10'))[_0x8129('0x11')](_0x511313)['digest']('hex');}exports[_0x8129('0x12')]=function(){switch(os['platform']()){case _0x8129('0x13'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x8129('0x14')})[_0x8129('0x15')]('\x0d\x0a','');default:var _0x5544c4=getFirstInterface();var _0x2ce595=getCPUhash();var _0x55fa91=_0x2ce595+'|'+os[_0x8129('0x16')]()+'|'+_0x5544c4[_0x8129('0x17')]+'|'+_0x5544c4[_0x8129('0x18')];var _0x56efa1=crypto[_0x8129('0xf')](_0x8129('0x10'))[_0x8129('0x11')](_0x55fa91)[_0x8129('0x19')](_0x8129('0x1a'));return _0x56efa1[_0x8129('0x1b')](0x0,0x8)+'-'+_0x56efa1['substring'](0x8,0xc)+'-'+_0x56efa1['substring'](0xc,0x10)+'-'+_0x56efa1[_0x8129('0x1b')](0x10,0x14)+'-'+_0x56efa1['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 8889d64..20142b9 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 _0x8f4c=['fullname','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','openIssue','Motion\x20License\x20Alert','email','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','message','getUuid','License','findOrCreate','spread','error','util','crypto','moment','request-promise','bluebird','pkginfo','../../mysqldb','../environment','./hardware','license','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','createCipher','secrets','session','update','utf8','base64','createDecipher','aes-256-ctr','final','||FIELD||VALUE||\x0a','User','findOne','admin'];(function(_0x4f627d,_0x55d6a7){var _0x117a4d=function(_0x1e3f71){while(--_0x1e3f71){_0x4f627d['push'](_0x4f627d['shift']());}};_0x117a4d(++_0x55d6a7);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5cf2e2,_0x3ba099){_0x5cf2e2=_0x5cf2e2-0x0;var _0x2abbe7=_0x8f4c[_0x5cf2e2];return _0x2abbe7;};'use strict';var util=require(_0xc8f4('0x0'));var crypto=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var rp=require(_0xc8f4('0x3'));var BPromise=require(_0xc8f4('0x4'));var pkginfo=require(_0xc8f4('0x5'))(module,'version');var db=require(_0xc8f4('0x6'))['db'];var config=require(_0xc8f4('0x7'));var hardware=require(_0xc8f4('0x8'));var logger=require('../logger')(_0xc8f4('0x9'));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(_0x520063){return new BPromise(function(_0x373506,_0x48c39d){var _0x3ea9a2=util[_0xc8f4('0xa')](_0xc8f4('0xb'),HOST,_0x520063,module[_0xc8f4('0xc')][_0xc8f4('0xd')]);if(oldToken){_0x3ea9a2=util['format'](_0xc8f4('0xe'),HOST,_0x520063,module[_0xc8f4('0xc')][_0xc8f4('0xd')],oldToken);}var _0x3a2f8a={'uri':_0x3ea9a2,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3a2f8a)[_0xc8f4('0xf')](function(_0x52c699){_0x373506(_0x52c699);})[_0xc8f4('0x10')](function(_0xf07a92){_0x48c39d(_0xf07a92);});});}function encryptDate(_0x45ed6b){var _0x729f8f=crypto[_0xc8f4('0x11')]('aes-256-ctr',config[_0xc8f4('0x12')][_0xc8f4('0x13')]);var _0x39a302=_0x729f8f[_0xc8f4('0x14')](_0x45ed6b,_0xc8f4('0x15'),_0xc8f4('0x16'));_0x39a302+=_0x729f8f['final'](_0xc8f4('0x16'));return _0x39a302;}function decryptDate(_0x2c7bc1){var _0x1518a6=crypto[_0xc8f4('0x17')](_0xc8f4('0x18'),config['secrets'][_0xc8f4('0x13')]);var _0x4d2b77=_0x1518a6['update'](_0x2c7bc1,_0xc8f4('0x16'),_0xc8f4('0x15'));_0x4d2b77+=_0x1518a6[_0xc8f4('0x19')](_0xc8f4('0x15'));return _0x4d2b77;}function sendJiraAlert(_0x4763c1,_0x374761,_0x2459ac){var _0x1074bf=_0xc8f4('0x1a');return db[_0xc8f4('0x1b')][_0xc8f4('0x1c')]({'where':{'role':_0xc8f4('0x1d')},'attributes':[_0xc8f4('0x1e'),'email'],'raw':!![]})[_0xc8f4('0xf')](function(_0x5c520){ADMIN=_0x5c520;_0x1074bf+=_0xc8f4('0x1f')+_0x2459ac+'|\x0a';_0x1074bf+=_0xc8f4('0x20')+_0x4763c1+'|\x0a';_0x1074bf+=_0xc8f4('0x21')+_0x374761+'|\x0a';_0x1074bf+=_0xc8f4('0x22')+ADMIN[_0xc8f4('0x1e')]+'|\x0a';_0x1074bf+=_0xc8f4('0x23')+ADMIN['email']+'|\x0a';return _0x1074bf;})[_0xc8f4('0xf')](function(_0x205c41){var _0x3195ff=hardware[_0xc8f4('0x24')]()['ipAddress'];return jira[_0xc8f4('0x25')]({'key':'MOTLICENSE','summary':_0xc8f4('0x26'),'description':_0x205c41,'issuetype':'Alert','oldToken':_0x4763c1,'newToken':_0x374761,'email':ADMIN[_0xc8f4('0x27')],'name':ADMIN[_0xc8f4('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x3195ff});});}function manageLicense(_0x5c94c6,_0x41f4de){var _0x21062f=_0x41f4de[_0xc8f4('0x28')]({'plain':!![]});httpRequest(_0x5c94c6)[_0xc8f4('0xf')](function(_0x4ce586){if(oldToken){oldToken=undefined;}if(_0x4ce586[_0xc8f4('0x29')]){if(!_0x21062f[_0xc8f4('0x9')]&&_0x21062f['license']!=_0x4ce586[_0xc8f4('0x9')]||_0x21062f[_0xc8f4('0x9')]&&_0x21062f[_0xc8f4('0x2a')]){logger[_0xc8f4('0x2b')](_0xc8f4('0x2c'));}if(_0x21062f[_0xc8f4('0x9')]&&!_0x21062f['data2']&&_0x21062f[_0xc8f4('0x9')]!=_0x4ce586[_0xc8f4('0x9')]){logger[_0xc8f4('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x21062f[_0xc8f4('0x9')]&&!_0x21062f[_0xc8f4('0x2a')]&&_0x21062f['license']==_0x4ce586['license']){return _0x41f4de;}return _0x41f4de['update']({'data1':_0x5c94c6,'data2':null,'license':_0x4ce586[_0xc8f4('0x9')]});}else{if(_0x4ce586[_0xc8f4('0x9')]||_0x21062f[_0xc8f4('0x9')]){if(!_0x21062f[_0xc8f4('0x2a')]){if(_0x21062f[_0xc8f4('0x2d')]==_0x5c94c6){GRAY_PERIOD_REASON=_0xc8f4('0x2e');logger[_0xc8f4('0x2b')](_0xc8f4('0x2f'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x21062f[_0xc8f4('0x2d')];logger[_0xc8f4('0x2b')](_0xc8f4('0x30'),_0x21062f['data1'],_0x5c94c6);}sendJiraAlert(_0x21062f[_0xc8f4('0x2d')],_0x4ce586[_0xc8f4('0x31')],GRAY_PERIOD_REASON);logger['info'](_0xc8f4('0x32'),GRAY_PERIOD_REASON[_0xc8f4('0x33')](),moment()[_0xc8f4('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x41f4de[_0xc8f4('0x14')]({'data2':encryptDate(moment()[_0xc8f4('0xa')](_0xc8f4('0x34')))});}else{if(moment()['diff'](decryptDate(_0x21062f[_0xc8f4('0x2a')]),_0xc8f4('0x35'))>DAYS){logger[_0xc8f4('0x2b')](_0xc8f4('0x36'),moment()[_0xc8f4('0xa')](_0xc8f4('0x34')));return _0x41f4de[_0xc8f4('0x14')]({'data1':_0x5c94c6,'data2':null,'license':null});}}}else{if(_0x21062f[_0xc8f4('0x2d')]!=_0x5c94c6){logger[_0xc8f4('0x2b')](_0xc8f4('0x30'),_0x21062f[_0xc8f4('0x2d')],_0x5c94c6);return _0x41f4de[_0xc8f4('0x14')]({'data1':_0x5c94c6,'data2':null,'license':null});}}}return _0x41f4de;})[_0xc8f4('0xf')](function(_0x12e63b){_0x41f4de=_0x12e63b;})[_0xc8f4('0x10')](function(_0x453640){logger['error'](_0x453640[_0xc8f4('0x37')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xc8f4('0x38')](),_0x41f4de);},TIME);});}function defaultLicense(){var _0x51bfe6=hardware[_0xc8f4('0x38')]();if(_0x51bfe6){return db[_0xc8f4('0x39')][_0xc8f4('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x51bfe6}})[_0xc8f4('0x3b')](function(_0x383fe0,_0x724060){logger[_0xc8f4('0x2b')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x51bfe6);manageLicense(_0x51bfe6,_0x383fe0);})[_0xc8f4('0x10')](function(_0x2bf03c){logger[_0xc8f4('0x3c')](_0x2bf03c[_0xc8f4('0x37')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xc43c=['getUuid','License','findOrCreate','spread','util','crypto','moment','version','../logger','license','../../api/jira/jira.controller','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','aes-256-ctr','secrets','session','utf8','base64','final','createDecipher','update','||FIELD||VALUE||\x0a','User','admin','email','|reason|','|uuid|','|name|','|email|','ipAddress','openIssue','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','DEMO\x20START\x20AT\x20%s','error','message','finally'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc43c,0xd4));var _0xcc43=function(_0x544fbc,_0x20bf9f){_0x544fbc=_0x544fbc-0x0;var _0x3177c7=_0xc43c[_0x544fbc];return _0x3177c7;};'use strict';var util=require(_0xcc43('0x0'));var crypto=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xcc43('0x3'));var db=require('../../mysqldb')['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require(_0xcc43('0x4'))(_0xcc43('0x5'));var jira=require(_0xcc43('0x6'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x359663){return new BPromise(function(_0x3896a9,_0x36e3a5){var _0x25528e=util[_0xcc43('0x7')](_0xcc43('0x8'),HOST,_0x359663,module[_0xcc43('0x9')][_0xcc43('0x3')]);if(oldToken){_0x25528e=util['format'](_0xcc43('0xa'),HOST,_0x359663,module[_0xcc43('0x9')][_0xcc43('0x3')],oldToken);}var _0x3bc51e={'uri':_0x25528e,'method':_0xcc43('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x3bc51e)[_0xcc43('0xc')](function(_0x439c43){_0x3896a9(_0x439c43);})[_0xcc43('0xd')](function(_0x39d042){_0x36e3a5(_0x39d042);});});}function encryptDate(_0x44054b){var _0x31257d=crypto['createCipher'](_0xcc43('0xe'),config[_0xcc43('0xf')][_0xcc43('0x10')]);var _0x2e86f5=_0x31257d['update'](_0x44054b,_0xcc43('0x11'),_0xcc43('0x12'));_0x2e86f5+=_0x31257d[_0xcc43('0x13')](_0xcc43('0x12'));return _0x2e86f5;}function decryptDate(_0xed8608){var _0x538d67=crypto[_0xcc43('0x14')](_0xcc43('0xe'),config['secrets'][_0xcc43('0x10')]);var _0x5ae3e4=_0x538d67[_0xcc43('0x15')](_0xed8608,_0xcc43('0x12'),_0xcc43('0x11'));_0x5ae3e4+=_0x538d67['final'](_0xcc43('0x11'));return _0x5ae3e4;}function sendJiraAlert(_0x295ecb,_0x313402,_0x326851){var _0x485d14=_0xcc43('0x16');return db[_0xcc43('0x17')]['findOne']({'where':{'role':_0xcc43('0x18')},'attributes':['fullname',_0xcc43('0x19')],'raw':!![]})['then'](function(_0x39a48f){ADMIN=_0x39a48f;_0x485d14+=_0xcc43('0x1a')+_0x326851+'|\x0a';_0x485d14+=_0xcc43('0x1b')+_0x295ecb+'|\x0a';_0x485d14+='|machineUuid|'+_0x313402+'|\x0a';_0x485d14+=_0xcc43('0x1c')+ADMIN['fullname']+'|\x0a';_0x485d14+=_0xcc43('0x1d')+ADMIN[_0xcc43('0x19')]+'|\x0a';return _0x485d14;})[_0xcc43('0xc')](function(_0x948783){var _0x36b655=hardware['getFirstInterface']()[_0xcc43('0x1e')];return jira[_0xcc43('0x1f')]({'key':'MOTLICENSE','summary':_0xcc43('0x20'),'description':_0x948783,'issuetype':_0xcc43('0x21'),'oldToken':_0x295ecb,'newToken':_0x313402,'email':ADMIN[_0xcc43('0x19')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x36b655});});}function manageLicense(_0x35d2a1,_0x480662){var _0x26a407=_0x480662[_0xcc43('0x22')]({'plain':!![]});httpRequest(_0x35d2a1)[_0xcc43('0xc')](function(_0x32f9b2){if(oldToken){oldToken=undefined;}if(_0x32f9b2[_0xcc43('0x23')]){if(!_0x26a407['license']&&_0x26a407[_0xcc43('0x5')]!=_0x32f9b2[_0xcc43('0x5')]||_0x26a407[_0xcc43('0x5')]&&_0x26a407[_0xcc43('0x24')]){logger[_0xcc43('0x25')](_0xcc43('0x26'));}if(_0x26a407['license']&&!_0x26a407[_0xcc43('0x24')]&&_0x26a407[_0xcc43('0x5')]!=_0x32f9b2[_0xcc43('0x5')]){logger[_0xcc43('0x25')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x26a407[_0xcc43('0x5')]&&!_0x26a407[_0xcc43('0x24')]&&_0x26a407[_0xcc43('0x5')]==_0x32f9b2[_0xcc43('0x5')]){return _0x480662;}return _0x480662['update']({'data1':_0x35d2a1,'data2':null,'license':_0x32f9b2[_0xcc43('0x5')]});}else{if(_0x32f9b2[_0xcc43('0x5')]||_0x26a407[_0xcc43('0x5')]){if(!_0x26a407[_0xcc43('0x24')]){if(_0x26a407['data1']==_0x35d2a1){GRAY_PERIOD_REASON='Disabled';logger[_0xcc43('0x25')](_0xcc43('0x27'));}else{GRAY_PERIOD_REASON=_0xcc43('0x28');oldToken=_0x26a407[_0xcc43('0x29')];logger[_0xcc43('0x25')](_0xcc43('0x2a'),_0x26a407[_0xcc43('0x29')],_0x35d2a1);}sendJiraAlert(_0x26a407[_0xcc43('0x29')],_0x32f9b2['uuid'],GRAY_PERIOD_REASON);logger[_0xcc43('0x25')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xcc43('0x7')](_0xcc43('0x2b')));return _0x480662[_0xcc43('0x15')]({'data2':encryptDate(moment()[_0xcc43('0x7')](_0xcc43('0x2b')))});}else{if(moment()['diff'](decryptDate(_0x26a407['data2']),'days')>DAYS){logger['info'](_0xcc43('0x2c'),moment()[_0xcc43('0x7')](_0xcc43('0x2b')));return _0x480662['update']({'data1':_0x35d2a1,'data2':null,'license':null});}}}else{if(_0x26a407[_0xcc43('0x29')]!=_0x35d2a1){logger[_0xcc43('0x25')](_0xcc43('0x2a'),_0x26a407['data1'],_0x35d2a1);return _0x480662[_0xcc43('0x15')]({'data1':_0x35d2a1,'data2':null,'license':null});}}}return _0x480662;})[_0xcc43('0xc')](function(_0x574734){_0x480662=_0x574734;})[_0xcc43('0xd')](function(_0x266c39){logger[_0xcc43('0x2d')](_0x266c39[_0xcc43('0x2e')]);})[_0xcc43('0x2f')](function(){setTimeout(function(){manageLicense(hardware[_0xcc43('0x30')](),_0x480662);},TIME);});}function defaultLicense(){var _0x138d00=hardware[_0xcc43('0x30')]();if(_0x138d00){return db[_0xcc43('0x31')][_0xcc43('0x32')]({'where':{'id':0x1},'defaults':{'data1':_0x138d00}})[_0xcc43('0x33')](function(_0x13658d,_0x4c9965){logger[_0xcc43('0x25')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x138d00);manageLicense(_0x138d00,_0x13658d);})[_0xcc43('0xd')](function(_0x2a331f){logger['error'](_0x2a331f[_0xcc43('0x2e')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 07e52d2..cae5ee9 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 _0x4a89=['add','days','grayReason','machineUuid','changed','disabled','Breaking\x20license','message','getLicense','License','find','crypto','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','uuid','getUuid','secrets','session','gray','deadline'];(function(_0x23911b,_0x337195){var _0xca80a=function(_0x3e4c2e){while(--_0x3e4c2e){_0x23911b['push'](_0x23911b['shift']());}};_0xca80a(++_0x337195);}(_0x4a89,0x17d));var _0x94a8=function(_0x3fafc6,_0x4a877d){_0x3fafc6=_0x3fafc6-0x0;var _0x1e1235=_0x4a89[_0x3fafc6];return _0x1e1235;};'use strict';var crypto=require(_0x94a8('0x0'));var util=require('util');var _=require(_0x94a8('0x1'));var moment=require(_0x94a8('0x2'));var hardware=require(_0x94a8('0x3'));var config=require(_0x94a8('0x4'));var db=require(_0x94a8('0x5'))['db'];function checkLicense(_0x5a06d9,_0x166301){if(_0x5a06d9){try{var _0x5cdba5=_0x166301||_0x5a06d9[_0x94a8('0x6')];if(_[_0x94a8('0x7')](_0x5cdba5)){throw new Error(_0x94a8('0x8'));}var _0x3ed973=_0x5a06d9[_0x94a8('0x9')];var _0x4ff026=_0x5a06d9['data2'];var _0x14c077=_0x3ed973[_0x94a8('0xa')]('-')[0x4];var _0x1ee1f5=_0x3ed973[_0x94a8('0xa')]('-')[0x0];var _0x3124b1=crypto[_0x94a8('0xb')](_0x94a8('0xc'),util[_0x94a8('0xd')](_0x94a8('0xe'),_0x14c077,_0x3ed973,_0x1ee1f5));var _0x4e22cd=_0x3124b1[_0x94a8('0xf')](_0x5cdba5,_0x94a8('0x10'),'utf8');_0x4e22cd+=_0x3124b1[_0x94a8('0x11')](_0x94a8('0x12'));var _0x201e75=JSON[_0x94a8('0x13')](_0x4e22cd);_0x201e75['demo']=![];_0x201e75[_0x94a8('0x14')]=_0x3ed973;_0x201e75['machineUuid']=hardware[_0x94a8('0x15')]();if(_0x4ff026){var _0x4832eb=crypto[_0x94a8('0xb')](_0x94a8('0xc'),config[_0x94a8('0x16')][_0x94a8('0x17')]);var _0x1ff5ac=_0x4832eb[_0x94a8('0xf')](_0x4ff026,'base64',_0x94a8('0x12'));_0x1ff5ac+=_0x4832eb[_0x94a8('0x11')]('utf8');_0x201e75[_0x94a8('0x18')]=_0x1ff5ac;_0x201e75[_0x94a8('0x19')]=moment(_0x1ff5ac)[_0x94a8('0x1a')](0x7,_0x94a8('0x1b'))['format']();_0x201e75[_0x94a8('0x1c')]=_0x201e75[_0x94a8('0x14')]!=_0x201e75[_0x94a8('0x1d')]?_0x94a8('0x1e'):_0x94a8('0x1f');}return _0x201e75;}catch(_0x30b583){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x94a8('0x20'),'uuid':_0x5a06d9[_0x94a8('0x9')],'machineUuid':hardware[_0x94a8('0x15')](),'message':_0x30b583[_0x94a8('0x21')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x5a06d9[_0x94a8('0x9')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x94a8('0x22')]=function(_0x47d958){return db[_0x94a8('0x23')][_0x94a8('0x24')](_['defaults'](_0x47d958,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x443515){return checkLicense(_0x443515,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x73b9=['then','checkLicense','util','lodash','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','demo','uuid','machineUuid','getUuid','secrets','gray','deadline','add','days','grayReason','changed','Breaking\x20license','data1','message','Demo\x20license','getLicense','License','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73b9,0xe6));var _0x973b=function(_0x5372d8,_0x5aedf2){_0x5372d8=_0x5372d8-0x0;var _0x23da0b=_0x73b9[_0x5372d8];return _0x23da0b;};'use strict';var crypto=require('crypto');var util=require(_0x973b('0x0'));var _=require(_0x973b('0x1'));var moment=require(_0x973b('0x2'));var hardware=require(_0x973b('0x3'));var config=require('../environment');var db=require(_0x973b('0x4'))['db'];function checkLicense(_0x3f3898,_0x4cafca){if(_0x3f3898){try{var _0x2f971c=_0x4cafca||_0x3f3898[_0x973b('0x5')];if(_[_0x973b('0x6')](_0x2f971c)){throw new Error(_0x973b('0x7'));}var _0x205a9e=_0x3f3898['data1'];var _0x376a47=_0x3f3898[_0x973b('0x8')];var _0x4a5d37=_0x205a9e[_0x973b('0x9')]('-')[0x4];var _0x3012dc=_0x205a9e[_0x973b('0x9')]('-')[0x0];var _0x2ffe6e=crypto[_0x973b('0xa')](_0x973b('0xb'),util[_0x973b('0xc')](_0x973b('0xd'),_0x4a5d37,_0x205a9e,_0x3012dc));var _0x2b8abd=_0x2ffe6e[_0x973b('0xe')](_0x2f971c,_0x973b('0xf'),_0x973b('0x10'));_0x2b8abd+=_0x2ffe6e[_0x973b('0x11')](_0x973b('0x10'));var _0x36d5e7=JSON['parse'](_0x2b8abd);_0x36d5e7[_0x973b('0x12')]=![];_0x36d5e7[_0x973b('0x13')]=_0x205a9e;_0x36d5e7[_0x973b('0x14')]=hardware[_0x973b('0x15')]();if(_0x376a47){var _0x5b3f2b=crypto[_0x973b('0xa')]('aes-256-ctr',config[_0x973b('0x16')]['session']);var _0x2746d2=_0x5b3f2b[_0x973b('0xe')](_0x376a47,_0x973b('0xf'),_0x973b('0x10'));_0x2746d2+=_0x5b3f2b[_0x973b('0x11')](_0x973b('0x10'));_0x36d5e7[_0x973b('0x17')]=_0x2746d2;_0x36d5e7[_0x973b('0x18')]=moment(_0x2746d2)[_0x973b('0x19')](0x7,_0x973b('0x1a'))[_0x973b('0xc')]();_0x36d5e7[_0x973b('0x1b')]=_0x36d5e7[_0x973b('0x13')]!=_0x36d5e7['machineUuid']?_0x973b('0x1c'):'disabled';}return _0x36d5e7;}catch(_0x219548){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x973b('0x1d'),'uuid':_0x3f3898[_0x973b('0x1e')],'machineUuid':hardware[_0x973b('0x15')](),'message':_0x219548[_0x973b('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x973b('0x20'),'uuid':_0x3f3898[_0x973b('0x1e')],'machineUuid':hardware[_0x973b('0x15')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x973b('0x21')]=function(_0x47b601){return db[_0x973b('0x22')][_0x973b('0x23')](_['defaults'](_0x47b601,{'raw':!![],'where':{'id':0x1}}))[_0x973b('0x24')](function(_0x140abb){return checkLicense(_0x140abb,null);});};exports[_0x973b('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 712561b..4a39242 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 _0x7461=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x3873bc,_0xcb1316){var _0x34ea56=function(_0x101529){while(--_0x101529){_0x3873bc['push'](_0x3873bc['shift']());}};_0x34ea56(++_0xcb1316);}(_0x7461,0xdb));var _0x1746=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0x7461[_0x10316a];return _0x36ac2e;};'use strict';module[_0x1746('0x0')]={'DOMAIN':_0x1746('0x1'),'SESSION_SECRET':_0x1746('0x2'),'GOOGLE_ID':_0x1746('0x3'),'GOOGLE_SECRET':_0x1746('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x62ef=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x59b136,_0x2d8ac7){var _0x5a973c=function(_0x49844a){while(--_0x49844a){_0x59b136['push'](_0x59b136['shift']());}};_0x5a973c(++_0x2d8ac7);}(_0x62ef,0xd0));var _0xf62e=function(_0x2125e9,_0x21d8c0){_0x2125e9=_0x2125e9-0x0;var _0x499201=_0x62ef[_0x2125e9];return _0x499201;};'use strict';module[_0xf62e('0x0')]={'DOMAIN':_0xf62e('0x1'),'SESSION_SECRET':_0xf62e('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xf62e('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index bf49565..1b1d59b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2857=['File','error','%s-%s','info','Console','env','debugLevel','moment','path','INFO','log','xcally','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','exports','Logger','transports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2857,0x103));var _0x7285=function(_0x7a4b16,_0x2c3b70){_0x7a4b16=_0x7a4b16-0x0;var _0x59e441=_0x2857[_0x7a4b16];return _0x59e441;};'use strict';var moment=require(_0x7285('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x7285('0x1'));var debugLevel=_0x7285('0x2');function filename(_0x5a4f92,_0x398269){return path['join']('/var',_0x7285('0x3'),_0x7285('0x4'),util['format'](_0x7285('0x5'),_0x5a4f92,_0x398269));}function formatter(_0x5b91d5,_0xc7bed3){return util[_0x7285('0x6')](_0x7285('0x7'),moment()[_0x7285('0x6')](_0x7285('0x8')),_0xc7bed3[_0x7285('0x9')]['toUpperCase'](),_0x5b91d5,_0xc7bed3[_0x7285('0xa')]);}module[_0x7285('0xb')]=function(_0x2487c8){return new winston[(_0x7285('0xc'))]({'transports':[new winston[(_0x7285('0xd'))][(_0x7285('0xe'))]({'name':util[_0x7285('0x6')]('%s-%s',_0x2487c8,_0x7285('0xf')),'filename':filename(_0x2487c8,_0x7285('0xf')),'level':_0x7285('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5a97fb){return formatter(_0x2487c8,_0x5a97fb);}}),new winston[(_0x7285('0xd'))][(_0x7285('0xe'))]({'name':util['format'](_0x7285('0x10'),_0x2487c8,'info'),'filename':filename(_0x2487c8,_0x7285('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2816fd){return formatter(_0x2487c8,_0x2816fd);}}),new winston[(_0x7285('0xd'))][(_0x7285('0x12'))]({'level':process[_0x7285('0x13')][_0x7285('0x14')]||debugLevel,'json':![],'formatter':function(_0x42d630){return formatter(_0x2487c8,_0x42d630);}})]});}; \ No newline at end of file +var _0x10ad=['moment','winston','util','path','INFO','join','/var','log','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel'];(function(_0xf612,_0x54499d){var _0xaec3ba=function(_0x41938b){while(--_0x41938b){_0xf612['push'](_0xf612['shift']());}};_0xaec3ba(++_0x54499d);}(_0x10ad,0xfa));var _0xd10a=function(_0x59ef3b,_0x197060){_0x59ef3b=_0x59ef3b-0x0;var _0x17b3b8=_0x10ad[_0x59ef3b];return _0x17b3b8;};'use strict';var moment=require(_0xd10a('0x0'));var winston=require(_0xd10a('0x1'));var util=require(_0xd10a('0x2'));var path=require(_0xd10a('0x3'));var debugLevel=_0xd10a('0x4');function filename(_0x424469,_0x393ba4){return path[_0xd10a('0x5')](_0xd10a('0x6'),_0xd10a('0x7'),_0xd10a('0x8'),util[_0xd10a('0x9')]('%s-%s.log',_0x424469,_0x393ba4));}function formatter(_0x443c2a,_0x5c15d5){return util[_0xd10a('0x9')](_0xd10a('0xa'),moment()[_0xd10a('0x9')](_0xd10a('0xb')),_0x5c15d5[_0xd10a('0xc')][_0xd10a('0xd')](),_0x443c2a,_0x5c15d5[_0xd10a('0xe')]);}module[_0xd10a('0xf')]=function(_0x25543c){return new winston[(_0xd10a('0x10'))]({'transports':[new winston[(_0xd10a('0x11'))][(_0xd10a('0x12'))]({'name':util[_0xd10a('0x9')](_0xd10a('0x13'),_0x25543c,_0xd10a('0x14')),'filename':filename(_0x25543c,_0xd10a('0x14')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ec86d){return formatter(_0x25543c,_0x3ec86d);}}),new winston[(_0xd10a('0x11'))][(_0xd10a('0x12'))]({'name':util[_0xd10a('0x9')]('%s-%s',_0x25543c,_0xd10a('0x15')),'filename':filename(_0x25543c,_0xd10a('0x15')),'level':_0xd10a('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x671b8e){return formatter(_0x25543c,_0x671b8e);}}),new winston[(_0xd10a('0x11'))][(_0xd10a('0x16'))]({'level':process[_0xd10a('0x17')][_0xd10a('0x18')]||debugLevel,'json':![],'formatter':function(_0x249d23){return formatter(_0x25543c,_0x249d23);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5b46805..0c86477 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 _0x8766=['xdr','../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x40dd0e,_0x307979){var _0x1054a0=function(_0x3a80eb){while(--_0x3a80eb){_0x40dd0e['push'](_0x40dd0e['shift']());}};_0x1054a0(++_0x307979);}(_0x8766,0x7b));var _0x6876=function(_0x3079f4,_0x534678){_0x3079f4=_0x3079f4-0x0;var _0x4e133c=_0x8766[_0x3079f4];return _0x4e133c;};'use strict';var path=require(_0x6876('0x0'));var os=require('os');var config={'apps':[{'name':_0x6876('0x1'),'script':path[_0x6876('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x6876('0x3'),'script':path[_0x6876('0x2')](__dirname,_0x6876('0x4'))},{'name':_0x6876('0x5'),'script':path[_0x6876('0x2')](__dirname,_0x6876('0x6'))},{'name':_0x6876('0x7'),'script':path[_0x6876('0x2')](__dirname,_0x6876('0x8'))},{'name':'routing','script':path[_0x6876('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x6876('0x9'),'script':path[_0x6876('0x2')](__dirname,_0x6876('0xa'))}]};module[_0x6876('0xb')]=config; \ No newline at end of file +var _0xcfd2=['email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','agi','../../services/agi/index.js'];(function(_0x33106d,_0x2e6c18){var _0x35cec5=function(_0x3e7149){while(--_0x3e7149){_0x33106d['push'](_0x33106d['shift']());}};_0x35cec5(++_0x2e6c18);}(_0xcfd2,0xe9));var _0x2cfd=function(_0x53212d,_0x17d0c0){_0x53212d=_0x53212d-0x0;var _0x163539=_0xcfd2[_0x53212d];return _0x163539;};'use strict';var path=require(_0x2cfd('0x0'));var os=require('os');var config={'apps':[{'name':_0x2cfd('0x1'),'script':path[_0x2cfd('0x2')](__dirname,_0x2cfd('0x3'))},{'name':_0x2cfd('0x4'),'script':path[_0x2cfd('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x2cfd('0x5'),'script':path[_0x2cfd('0x2')](__dirname,_0x2cfd('0x6'))},{'name':_0x2cfd('0x7'),'script':path['join'](__dirname,_0x2cfd('0x8'))},{'name':_0x2cfd('0x9'),'script':path['join'](__dirname,_0x2cfd('0xa'))},{'name':'xdr','script':path[_0x2cfd('0x2')](__dirname,_0x2cfd('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4b0c90b..f43a81a 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 _0x4693=['./config','connect','connected','start','then','disconnect','restart','list','describe','delete','saved','pm2'];(function(_0x3f5fcf,_0x17bfab){var _0x3bee90=function(_0x5bed5f){while(--_0x5bed5f){_0x3f5fcf['push'](_0x3f5fcf['shift']());}};_0x3bee90(++_0x17bfab);}(_0x4693,0x18b));var _0x3469=function(_0x1e44ef,_0x5d3cca){_0x1e44ef=_0x1e44ef-0x0;var _0x53f70b=_0x4693[_0x1e44ef];return _0x53f70b;};'use strict';var pm2=require(_0x3469('0x0'));var BPromise=require('bluebird');var config=require(_0x3469('0x1'));function connect(){return new BPromise(function(_0xf4b5c1,_0x16bb87){return pm2[_0x3469('0x2')](function(_0x197f18){if(_0x197f18){return _0x16bb87(_0x197f18);}return _0xf4b5c1(_0x3469('0x3'));});});};exports[_0x3469('0x4')]=function(_0x37429d){return connect()[_0x3469('0x5')](function(){return new BPromise(function(_0x4bca6d,_0x3a1838){return pm2['start'](_0x37429d,function(_0x3cc2ef,_0xd5f530){if(_0x3cc2ef){return _0x3a1838(_0x3cc2ef);}pm2[_0x3469('0x6')]();return _0x4bca6d(_0xd5f530);});});});};exports['stop']=function(_0x37e8d0){return connect()[_0x3469('0x5')](function(){return new BPromise(function(_0x52ef0e,_0x8b557){return pm2['stop'](_0x37e8d0,function(_0x2d0cef,_0x576155){if(_0x2d0cef){return _0x8b557(_0x2d0cef);}pm2[_0x3469('0x6')]();return _0x52ef0e(_0x576155);});});});};exports[_0x3469('0x7')]=function(_0x152ebb){return connect()[_0x3469('0x5')](function(){return new BPromise(function(_0x5067d8,_0x5df9de){return pm2[_0x3469('0x7')](_0x152ebb,function(_0x5d9426,_0x1af67b){if(_0x5d9426){return _0x5df9de(_0x5d9426);}pm2[_0x3469('0x6')]();return _0x5067d8(_0x1af67b);});});});};exports[_0x3469('0x8')]=function(){return connect()[_0x3469('0x5')](function(){return new BPromise(function(_0x13fbfe,_0x2cb4c4){return pm2['list'](function(_0x5ce5d0,_0x16a5f3){if(_0x5ce5d0){return _0x2cb4c4(_0x5ce5d0);}pm2[_0x3469('0x6')]();return _0x13fbfe(_0x16a5f3);});});});};exports[_0x3469('0x9')]=function(_0x1789f4){return connect()['then'](function(){return new BPromise(function(_0x3d7ad8,_0x18c472){return pm2[_0x3469('0x9')](_0x1789f4,function(_0x4bb0f5,_0xc118c8){if(_0x4bb0f5){return _0x18c472(_0x4bb0f5);}pm2[_0x3469('0x6')]();return _0x3d7ad8(_0xc118c8);});});});};exports[_0x3469('0xa')]=function(_0x3cdd50){return connect()['then'](function(){return new BPromise(function(_0x18b084,_0x142905){return pm2['delete'](_0x3cdd50,function(_0x13435d,_0x4b02ab){if(_0x13435d){return _0x142905(_0x13435d);}pm2['disconnect']();return _0x18b084(_0x4b02ab);});});});};exports['dump']=function(){return connect()[_0x3469('0x5')](function(){return new BPromise(function(_0x50fdf4,_0x4f6604){return pm2['dump'](function(_0x562d6b){if(_0x562d6b){return _0x4f6604(_0x562d6b);}return _0x50fdf4(_0x3469('0xb'));});});});}; \ No newline at end of file +var _0x8781=['saved','pm2','bluebird','./config','connect','start','then','disconnect','stop','list','describe','delete','dump'];(function(_0x71e918,_0x5c4b0a){var _0x5ab390=function(_0x3061a8){while(--_0x3061a8){_0x71e918['push'](_0x71e918['shift']());}};_0x5ab390(++_0x5c4b0a);}(_0x8781,0x1c8));var _0x1878=function(_0x28a28d,_0x5c600f){_0x28a28d=_0x28a28d-0x0;var _0x4552b6=_0x8781[_0x28a28d];return _0x4552b6;};'use strict';var pm2=require(_0x1878('0x0'));var BPromise=require(_0x1878('0x1'));var config=require(_0x1878('0x2'));function connect(){return new BPromise(function(_0x1884a3,_0x152ab9){return pm2[_0x1878('0x3')](function(_0xe987a2){if(_0xe987a2){return _0x152ab9(_0xe987a2);}return _0x1884a3('connected');});});};exports[_0x1878('0x4')]=function(_0x1ba0ea){return connect()[_0x1878('0x5')](function(){return new BPromise(function(_0x43ad96,_0x43d827){return pm2[_0x1878('0x4')](_0x1ba0ea,function(_0x4d2374,_0x3f62d9){if(_0x4d2374){return _0x43d827(_0x4d2374);}pm2[_0x1878('0x6')]();return _0x43ad96(_0x3f62d9);});});});};exports[_0x1878('0x7')]=function(_0x46cd98){return connect()[_0x1878('0x5')](function(){return new BPromise(function(_0x2e6c2f,_0x2756b4){return pm2[_0x1878('0x7')](_0x46cd98,function(_0x3f00a4,_0x23b04b){if(_0x3f00a4){return _0x2756b4(_0x3f00a4);}pm2[_0x1878('0x6')]();return _0x2e6c2f(_0x23b04b);});});});};exports['restart']=function(_0x380775){return connect()[_0x1878('0x5')](function(){return new BPromise(function(_0x3cf2ac,_0x36b9e0){return pm2['restart'](_0x380775,function(_0x5867d7,_0x4272ab){if(_0x5867d7){return _0x36b9e0(_0x5867d7);}pm2[_0x1878('0x6')]();return _0x3cf2ac(_0x4272ab);});});});};exports[_0x1878('0x8')]=function(){return connect()[_0x1878('0x5')](function(){return new BPromise(function(_0x565fb4,_0x5804de){return pm2[_0x1878('0x8')](function(_0x396f3a,_0x49d3a1){if(_0x396f3a){return _0x5804de(_0x396f3a);}pm2[_0x1878('0x6')]();return _0x565fb4(_0x49d3a1);});});});};exports[_0x1878('0x9')]=function(_0xb324ba){return connect()['then'](function(){return new BPromise(function(_0x562902,_0x13e16d){return pm2[_0x1878('0x9')](_0xb324ba,function(_0x1ff9c1,_0x43b85e){if(_0x1ff9c1){return _0x13e16d(_0x1ff9c1);}pm2[_0x1878('0x6')]();return _0x562902(_0x43b85e);});});});};exports[_0x1878('0xa')]=function(_0x1d6d24){return connect()[_0x1878('0x5')](function(){return new BPromise(function(_0x16c6b2,_0x2b8492){return pm2[_0x1878('0xa')](_0x1d6d24,function(_0x5a8ea3,_0x5ecfe3){if(_0x5a8ea3){return _0x2b8492(_0x5a8ea3);}pm2[_0x1878('0x6')]();return _0x16c6b2(_0x5ecfe3);});});});};exports[_0x1878('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0xad2b40,_0x1caa20){return pm2[_0x1878('0xb')](function(_0x387f5){if(_0x387f5){return _0x1caa20(_0x387f5);}return _0xad2b40(_0x1878('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index d9ff374..1fb0276 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 _0xfe8a=['ChatInteraction','findAll','lastMsgAt','subtract','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','chatInteraction:update','catch','error','start','lodash','moment','../../mysqldb','../../config/environment','redis','socket.io-emitter','Setting','then','chatTimeout'];(function(_0x578f86,_0xb5a885){var _0x3c4ab8=function(_0x4bd5d9){while(--_0x4bd5d9){_0x578f86['push'](_0x578f86['shift']());}};_0x3c4ab8(++_0xb5a885);}(_0xfe8a,0x132));var _0xafe8=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0xfe8a[_0x303c30];return _0x43161b;};'use strict';var _=require(_0xafe8('0x0'));var moment=require(_0xafe8('0x1'));var Redis=require('ioredis');var db=require(_0xafe8('0x2'))['db'];var config=require(_0xafe8('0x3'));config['redis']=_['defaults'](config[_0xafe8('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xafe8('0x5'))(new Redis(config[_0xafe8('0x4')]));function closeInteractions(){var _0x1bc455=0x0;var _0x4e725b=[];return db[_0xafe8('0x6')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xafe8('0x7')](function(_0x3168d3){_0x1bc455=_0x3168d3[_0xafe8('0x8')];if(_0x1bc455){return db[_0xafe8('0x9')][_0xafe8('0xa')]({'raw':!![],'attributes':['id',_0xafe8('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xafe8('0xc')](_0x3168d3['chatTimeout'],'minutes')}}});}else{return[];}})[_0xafe8('0x7')](function(_0x58a651){_0x4e725b=_0x58a651;if(_0x1bc455){return db[_0xafe8('0x9')]['update']({'closeReason':_0xafe8('0xd'),'disposition':_0xafe8('0xe'),'closed':!![],'closedAt':moment()['format'](_0xafe8('0xf'))},{'where':{'id':_[_0xafe8('0x10')](_0x4e725b||[],'id')}});}})[_0xafe8('0x7')](function(_0x31e12b){for(var _0xec7c04=0x0;_0xec7c04<_0x4e725b['length'];_0xec7c04++){io['emit'](_0xafe8('0x11'),{'id':_0x4e725b[_0xec7c04]['id'],'closed':!![]});}})[_0xafe8('0x12')](function(_0x5165c4){console[_0xafe8('0x13')](_0x5165c4);});}exports[_0xafe8('0x14')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf318=['moment','ioredis','../../mysqldb','redis','defaults','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','start','lodash'];(function(_0x73f20,_0x1a661e){var _0x4bb099=function(_0x4e84ca){while(--_0x4e84ca){_0x73f20['push'](_0x73f20['shift']());}};_0x4bb099(++_0x1a661e);}(_0xf318,0x1b4));var _0x8f31=function(_0x42c8db,_0x334472){_0x42c8db=_0x42c8db-0x0;var _0x5a9fc8=_0xf318[_0x42c8db];return _0x5a9fc8;};'use strict';var _=require(_0x8f31('0x0'));var moment=require(_0x8f31('0x1'));var Redis=require(_0x8f31('0x2'));var db=require(_0x8f31('0x3'))['db'];var config=require('../../config/environment');config[_0x8f31('0x4')]=_[_0x8f31('0x5')](config[_0x8f31('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x8f31('0x6'))(new Redis(config[_0x8f31('0x4')]));function closeInteractions(){var _0xfe1436=0x0;var _0x35ffc5=[];return db[_0x8f31('0x7')]['find']({'raw':!![],'attributes':['id',_0x8f31('0x8')],'where':{'id':0x1}})[_0x8f31('0x9')](function(_0x56ac60){_0xfe1436=_0x56ac60[_0x8f31('0x8')];if(_0xfe1436){return db[_0x8f31('0xa')][_0x8f31('0xb')]({'raw':!![],'attributes':['id',_0x8f31('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x8f31('0xd')](_0x56ac60[_0x8f31('0x8')],_0x8f31('0xe'))}}});}else{return[];}})['then'](function(_0x16eb6d){_0x35ffc5=_0x16eb6d;if(_0xfe1436){return db[_0x8f31('0xa')]['update']({'closeReason':_0x8f31('0xf'),'disposition':_0x8f31('0x10'),'closed':!![],'closedAt':moment()[_0x8f31('0x11')](_0x8f31('0x12'))},{'where':{'id':_['map'](_0x35ffc5||[],'id')}});}})[_0x8f31('0x9')](function(_0x1dbc7d){for(var _0x3d5f05=0x0;_0x3d5f05<_0x35ffc5['length'];_0x3d5f05++){io[_0x8f31('0x13')](_0x8f31('0x14'),{'id':_0x35ffc5[_0x3d5f05]['id'],'closed':!![]});}})[_0x8f31('0x15')](function(_0x35398f){console['error'](_0x35398f);});}exports[_0x8f31('0x16')]=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 315dc3b..73c9aa1 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 _0x289f=['findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','deleteJob','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','email','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','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','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule'];(function(_0x451130,_0x595ee2){var _0x68c08e=function(_0x23fe84){while(--_0x23fe84){_0x451130['push'](_0x451130['shift']());}};_0x68c08e(++_0x595ee2);}(_0x289f,0xd7));var _0xf289=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x289f[_0x3070dc];return _0x431489;};'use strict';var fs=require('fs');var util=require(_0xf289('0x0'));var path=require(_0xf289('0x1'));var _=require(_0xf289('0x2'));var moment=require(_0xf289('0x3'));var CronJobManager=require(_0xf289('0x4'));var jayson=require(_0xf289('0x5'));var BPromise=require(_0xf289('0x6'));var logger=require(_0xf289('0x7'))(_0xf289('0x8'));var db=require(_0xf289('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xf289('0xa'));var client=jayson[_0xf289('0xb')][_0xf289('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5dff97,_0x42a658){return function(){logger[_0xf289('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5dff97['email']);var _0x352595=!![];var _0x233595={'tls':{'rejectUnauthorized':![]}};if(_0x5dff97[_0xf289('0xe')][_0xf289('0xf')][_0xf289('0x10')]){_0x233595['service']=_0x5dff97[_0xf289('0xe')]['Smtp'][_0xf289('0x10')];}else{_0x233595[_0xf289('0x11')]=_0x5dff97[_0xf289('0xe')][_0xf289('0xf')][_0xf289('0x11')];_0x233595[_0xf289('0x12')]=_0x5dff97[_0xf289('0xe')]['Smtp'][_0xf289('0x12')];_0x233595['secure']=_0x5dff97[_0xf289('0xe')][_0xf289('0xf')][_0xf289('0x13')];}if(_0x5dff97[_0xf289('0xe')][_0xf289('0xf')][_0xf289('0x14')]){_0x233595[_0xf289('0x15')]={'user':_0x5dff97[_0xf289('0xe')][_0xf289('0xf')][_0xf289('0x16')],'pass':_0x5dff97[_0xf289('0xe')]['Smtp'][_0xf289('0x17')]};}var _0x470bf4={'account':_0x233595,'message':{'from':util[_0xf289('0x18')]('\x22%s\x22\x20<%s>',_0x5dff97['MailAccount']['name'],_0x5dff97[_0xf289('0xe')][_0xf289('0x19')]||_0x5dff97[_0xf289('0xe')]['Smtp'][_0xf289('0x16')]),'to':_0x5dff97[_0xf289('0x19')],'cc':_0x5dff97['cc'],'bcc':_0x5dff97['bcc'],'subject':util[_0xf289('0x18')](_0xf289('0x1a'),_0x42a658['name'],_0x5dff97[_0xf289('0x1b')],_0x5dff97[_0xf289('0x1c')])}};var _0x69e3b7=path['join'](__dirname,_0xf289('0x1d'));var _0x4e6bd4=_0x42a658[_0xf289('0x1e')];var _0x40ffe2=util[_0xf289('0x18')](_0xf289('0x1f'),path[_0xf289('0x20')](_0x42a658[_0xf289('0x1e')],path['extname'](_0x42a658[_0xf289('0x1e')])),_0xf289('0x21'));var _0x22b2d4=path['join'](_0x69e3b7,_0x4e6bd4);var _0x3cf7ed=path[_0xf289('0x22')](_0x69e3b7,_0x40ffe2);if(fs[_0xf289('0x23')](_0x22b2d4)){_0x42a658[_0xf289('0x24')]=_0xf289('0x25');_0x470bf4[_0xf289('0x26')][_0xf289('0x27')]=[{'filename':_0x4e6bd4,'path':_0x22b2d4}];_0x470bf4[_0xf289('0x26')]['text']=util[_0xf289('0x18')](_0xf289('0x28'),JSON[_0xf289('0x29')](_0x42a658,null,0x2));}else if(fs[_0xf289('0x23')](_0x3cf7ed)){_0x42a658[_0xf289('0x24')]=_0xf289('0x25');_0x470bf4[_0xf289('0x26')]['attachments']=[{'filename':_0x40ffe2,'path':_0x3cf7ed}];}else{_0x470bf4[_0xf289('0x26')][_0xf289('0x2a')]=_0xf289('0x2b');if(!_0x5dff97[_0xf289('0x2c')]){_0x352595=![];logger[_0xf289('0xd')](_0xf289('0x2d'));}}if(_0x352595){return client['request'](_0xf289('0x2e'),_0x470bf4)[_0xf289('0x2f')](function(_0x13ef9c){if(_0x13ef9c[_0xf289('0x30')]){return logger[_0xf289('0x30')]('error\x20mail',JSON[_0xf289('0x29')](_0x13ef9c));}return logger[_0xf289('0xd')]('email\x20sent');})[_0xf289('0x31')](function(_0x1aa9bd){return logger[_0xf289('0x30')](_0xf289('0x32'),JSON[_0xf289('0x29')](_0x1aa9bd));});}};}function handleError(){return function(_0xd37fe6){return logger[_0xf289('0x30')](JSON[_0xf289('0x29')](_0xd37fe6));};}function handleResult(_0x2ad626){return function(_0xc6a820){logger[_0xf289('0xd')](_0xf289('0x33'),JSON[_0xf289('0x29')](_0xc6a820));if(_0x2ad626['MailAccount']&&_0x2ad626[_0xf289('0xe')][_0xf289('0xf')]&&!_[_0xf289('0x34')](_0x2ad626['email'])){setTimeout(handleSendEmail(_0x2ad626,_0xc6a820),0x3c*0x3e8);}};}function handleJob(_0x446a91){return function(){try{if(_[_0xf289('0x34')](_0x446a91[_0xf289('0x1b')])){return logger[_0xf289('0xd')](_0xf289('0x35'));}if(_[_0xf289('0x34')](_0x446a91[_0xf289('0x1c')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5d47cb={'startDate':moment()[_0xf289('0x36')](_0x446a91[_0xf289('0x1b')],_0x446a91[_0xf289('0x1c')])[_0xf289('0x18')](_0xf289('0x37')),'endDate':moment()[_0xf289('0x18')](_0xf289('0x37')),'type':_0xf289('0x38'),'output':_0x446a91[_0xf289('0x39')],'name':_0x446a91[_0xf289('0x3a')]};if(!_[_0xf289('0x34')](_0x446a91[_0xf289('0x3b')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x446a91['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x446a91[_0xf289('0x3b')]},_0x5d47cb)[_0xf289('0x2f')](handleResult(_0x446a91))[_0xf289('0x31')](handleError());}if(!_[_0xf289('0x34')](_0x446a91[_0xf289('0x3c')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x446a91[_0xf289('0x3c')]);return analyticCustomReportController[_0xf289('0x3d')]({'id':_0x446a91[_0xf289('0x3c')]},_0x5d47cb)[_0xf289('0x2f')](handleResult(_0x446a91))[_0xf289('0x31')](handleError());}}catch(_0x34ddd4){logger[_0xf289('0x30')](JSON[_0xf289('0x29')](_0x34ddd4));}return logger[_0xf289('0xd')](_0xf289('0x3e'));};}function getJobs(_0x4bb279){var _0x51b0c0={};if(_0x4bb279){_0x51b0c0['id']=_0x4bb279;}return db[_0xf289('0x3f')][_0xf289('0x40')]({'where':_0x51b0c0,'include':[{'model':db[_0xf289('0xe')],'attributes':['id','name','email'],'include':[{'model':db[_0xf289('0x41')],'as':_0xf289('0xf')}]}]})['then'](function(_0x25bff4){var _0xd3694a=_[_0xf289('0x42')](manager[_0xf289('0x43')]);var _0x231802=_[_0xf289('0x44')](_0x25bff4,function(_0xd0aa51){return _0xd0aa51['id']['toString']();});var _0x272284=_[_0xf289('0x45')](_0x25bff4,function(_0x3f7181){return _0x3f7181['id'][_0xf289('0x46')]();});var _0x313af5=_0x4bb279?_0x231802:_[_0xf289('0x47')](_0x231802,_0xd3694a);var _0x280850=_[_0xf289('0x48')](_0x231802,_0xd3694a);var _0x289290=_[_0xf289('0x47')](_0xd3694a,_0x231802);var _0x1d5575;var _0x241cf9;for(_0x1d5575=0x0;_0x1d5575<_0x289290[_0xf289('0x49')]&&!_0x4bb279;_0x1d5575+=0x1){_0x241cf9=_0x289290[_0x1d5575]['toString']();if(manager[_0xf289('0x4a')](_0x241cf9)){manager['stop'](_0x241cf9);manager[_0xf289('0x4b')](_0x241cf9);logger[_0xf289('0xd')]('delete\x20cron',_0x241cf9);}}logger[_0xf289('0xd')]('toRun',JSON['stringify'](_0x313af5));for(_0x1d5575=0x0;_0x1d5575<_0x313af5['length'];_0x1d5575+=0x1){_0x241cf9=_0x313af5[_0x1d5575]['toString']();logger[_0xf289('0xd')](_0xf289('0x4c'),_0x241cf9);if(_0x4bb279){logger[_0xf289('0xd')](_0xf289('0x4d'),_0x4bb279);logger[_0xf289('0xd')](JSON[_0xf289('0x29')](_0x272284[_0x241cf9]));BPromise[_0xf289('0x4e')]()[_0xf289('0x2f')](handleJob(_0x272284[_0x241cf9]));logger[_0xf289('0xd')](_0xf289('0x4f'),_0x272284[_0x241cf9][_0xf289('0x3a')],_0x272284[_0x241cf9][_0xf289('0x50')]);}else if(_0x272284[_0x241cf9]['cron']&&_0x272284[_0x241cf9][_0xf289('0x51')]&&moment()[_0xf289('0x52')](_0x272284[_0x241cf9][_0xf289('0x53')],_0x272284[_0x241cf9][_0xf289('0x54')])){manager[_0xf289('0x55')](_0x241cf9,_0x272284[_0x241cf9][_0xf289('0x50')],handleJob(_0x272284[_0x241cf9]));manager[_0xf289('0x56')](_0x241cf9);logger[_0xf289('0xd')](_0xf289('0x57'),_0x272284[_0x241cf9][_0xf289('0x3a')],_0x272284[_0x241cf9][_0xf289('0x50')]);}else if(manager['exists'](_0x241cf9)){manager[_0xf289('0x58')](_0x241cf9);manager[_0xf289('0x4b')](_0x241cf9);logger[_0xf289('0xd')]('stop\x20cron',_0x272284[_0x241cf9][_0xf289('0x3a')],_0x272284[_0x241cf9]['cron']);}}for(_0x1d5575=0x0,_0x241cf9;_0x1d5575<_0x280850[_0xf289('0x49')]&&!_0x4bb279;_0x1d5575+=0x1){_0x241cf9=_0x280850[_0x1d5575][_0xf289('0x46')]();if(manager[_0xf289('0x4a')](_0x241cf9)){if(_0x272284[_0x241cf9][_0xf289('0x50')]&&_0x272284[_0x241cf9][_0xf289('0x51')]&&moment()[_0xf289('0x52')](_0x272284[_0x241cf9]['startAt'],_0x272284[_0x241cf9][_0xf289('0x54')])){manager[_0xf289('0x59')](_0x241cf9,_0x272284[_0x241cf9][_0xf289('0x50')],handleJob(_0x272284[_0x241cf9]));logger['info'](_0xf289('0x5a'),_0x272284[_0x241cf9][_0xf289('0x3a')],_0x272284[_0x241cf9]['cron']);}else{manager['stop'](_0x241cf9);manager[_0xf289('0x4b')](_0x241cf9);logger[_0xf289('0xd')](_0xf289('0x5b'),_0x272284[_0x241cf9][_0xf289('0x3a')],_0x272284[_0x241cf9][_0xf289('0x50')]);}}}})[_0xf289('0x31')](function(_0x45fb62){logger[_0xf289('0x30')](JSON['stringify'](_0x45fb62));});}exports[_0xf289('0x5c')]=function(_0x225b6c){return getJobs(_0x225b6c);};exports[_0xf289('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb7fa=['endAt','update','update\x20cron','run','start','util','path','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','secure','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','text','stringify','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','catch','data','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','startAt','add','add\x20cron','stop\x20cron','isBetween'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb7fa,0x10a));var _0xab7f=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xb7fa[_0x421e36];return _0x20b3e3;};'use strict';var fs=require('fs');var util=require(_0xab7f('0x0'));var path=require(_0xab7f('0x1'));var _=require('lodash');var moment=require(_0xab7f('0x2'));var CronJobManager=require(_0xab7f('0x3'));var jayson=require(_0xab7f('0x4'));var BPromise=require('bluebird');var logger=require(_0xab7f('0x5'))(_0xab7f('0x6'));var db=require(_0xab7f('0x7'))['db'];var analyticCustomReportController=require(_0xab7f('0x8'));var analyticDefaultReportController=require(_0xab7f('0x9'));var client=jayson[_0xab7f('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4bf9e2,_0x57225f){return function(){logger[_0xab7f('0xb')](_0xab7f('0xc'),_0x4bf9e2[_0xab7f('0xd')]);var _0x3a757d=!![];var _0xe94103={'tls':{'rejectUnauthorized':![]}};if(_0x4bf9e2[_0xab7f('0xe')]['Smtp'][_0xab7f('0xf')]){_0xe94103[_0xab7f('0xf')]=_0x4bf9e2[_0xab7f('0xe')]['Smtp'][_0xab7f('0xf')];}else{_0xe94103[_0xab7f('0x10')]=_0x4bf9e2[_0xab7f('0xe')][_0xab7f('0x11')][_0xab7f('0x10')];_0xe94103['port']=_0x4bf9e2['MailAccount'][_0xab7f('0x11')]['port'];_0xe94103[_0xab7f('0x12')]=_0x4bf9e2[_0xab7f('0xe')][_0xab7f('0x11')][_0xab7f('0x12')];}if(_0x4bf9e2[_0xab7f('0xe')][_0xab7f('0x11')]['authentication']){_0xe94103['auth']={'user':_0x4bf9e2[_0xab7f('0xe')][_0xab7f('0x11')][_0xab7f('0x13')],'pass':_0x4bf9e2[_0xab7f('0xe')]['Smtp'][_0xab7f('0x14')]};}var _0xb5d68a={'account':_0xe94103,'message':{'from':util[_0xab7f('0x15')](_0xab7f('0x16'),_0x4bf9e2[_0xab7f('0xe')][_0xab7f('0x17')],_0x4bf9e2[_0xab7f('0xe')]['email']||_0x4bf9e2[_0xab7f('0xe')][_0xab7f('0x11')][_0xab7f('0x13')]),'to':_0x4bf9e2['email'],'cc':_0x4bf9e2['cc'],'bcc':_0x4bf9e2[_0xab7f('0x18')],'subject':util['format'](_0xab7f('0x19'),_0x57225f[_0xab7f('0x17')],_0x4bf9e2[_0xab7f('0x1a')],_0x4bf9e2['subtractUnit'])}};var _0x313636=path[_0xab7f('0x1b')](__dirname,'../../files/reports');var _0x52ed5e=_0x57225f['savename'];var _0x5d8f27=util[_0xab7f('0x15')](_0xab7f('0x1c'),path[_0xab7f('0x1d')](_0x57225f[_0xab7f('0x1e')],path[_0xab7f('0x1f')](_0x57225f[_0xab7f('0x1e')])),_0xab7f('0x20'));var _0xd229d5=path[_0xab7f('0x1b')](_0x313636,_0x52ed5e);var _0x43c27b=path['join'](_0x313636,_0x5d8f27);if(fs[_0xab7f('0x21')](_0xd229d5)){_0x57225f[_0xab7f('0x22')]=_0xab7f('0x23');_0xb5d68a[_0xab7f('0x24')][_0xab7f('0x25')]=[{'filename':_0x52ed5e,'path':_0xd229d5}];_0xb5d68a[_0xab7f('0x24')][_0xab7f('0x26')]=util[_0xab7f('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xab7f('0x27')](_0x57225f,null,0x2));}else if(fs[_0xab7f('0x21')](_0x43c27b)){_0x57225f[_0xab7f('0x22')]=_0xab7f('0x23');_0xb5d68a[_0xab7f('0x24')][_0xab7f('0x25')]=[{'filename':_0x5d8f27,'path':_0x43c27b}];}else{_0xb5d68a['message'][_0xab7f('0x26')]=_0xab7f('0x28');if(!_0x4bf9e2['sendIfEmpty']){_0x3a757d=![];logger['info'](_0xab7f('0x29'));}}if(_0x3a757d){return client[_0xab7f('0x2a')](_0xab7f('0x2b'),_0xb5d68a)[_0xab7f('0x2c')](function(_0x103323){if(_0x103323['error']){return logger[_0xab7f('0x2d')]('error\x20mail',JSON['stringify'](_0x103323));}return logger[_0xab7f('0xb')]('email\x20sent');})[_0xab7f('0x2e')](function(_0x41a6d9){return logger[_0xab7f('0x2d')]('error\x20mail',JSON[_0xab7f('0x27')](_0x41a6d9));});}};}function handleError(){return function(_0x446209){return logger['error'](JSON['stringify'](_0x446209));};}function handleResult(_0x18a696){return function(_0x3b7be4){logger['info'](_0xab7f('0x2f'),JSON['stringify'](_0x3b7be4));if(_0x18a696[_0xab7f('0xe')]&&_0x18a696[_0xab7f('0xe')][_0xab7f('0x11')]&&!_[_0xab7f('0x30')](_0x18a696[_0xab7f('0xd')])){setTimeout(handleSendEmail(_0x18a696,_0x3b7be4),0x3c*0x3e8);}};}function handleJob(_0x9c2ed4){return function(){try{if(_[_0xab7f('0x30')](_0x9c2ed4[_0xab7f('0x1a')])){return logger[_0xab7f('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xab7f('0x30')](_0x9c2ed4[_0xab7f('0x31')])){return logger[_0xab7f('0xb')](_0xab7f('0x32'));}var _0xa42f00={'startDate':moment()['subtract'](_0x9c2ed4['subtractNumber'],_0x9c2ed4[_0xab7f('0x31')])[_0xab7f('0x15')](_0xab7f('0x33')),'endDate':moment()[_0xab7f('0x15')](_0xab7f('0x33')),'type':'scheduled','output':_0x9c2ed4[_0xab7f('0x34')],'name':_0x9c2ed4[_0xab7f('0x17')]};if(!_[_0xab7f('0x30')](_0x9c2ed4[_0xab7f('0x35')])){logger[_0xab7f('0xb')](_0xab7f('0x36'),_0x9c2ed4['DefaultReportId']);return analyticDefaultReportController[_0xab7f('0x37')]({'id':_0x9c2ed4['DefaultReportId']},_0xa42f00)[_0xab7f('0x2c')](handleResult(_0x9c2ed4))[_0xab7f('0x2e')](handleError());}if(!_[_0xab7f('0x30')](_0x9c2ed4[_0xab7f('0x38')])){logger[_0xab7f('0xb')](_0xab7f('0x39'),_0x9c2ed4[_0xab7f('0x38')]);return analyticCustomReportController[_0xab7f('0x37')]({'id':_0x9c2ed4[_0xab7f('0x38')]},_0xa42f00)[_0xab7f('0x2c')](handleResult(_0x9c2ed4))['catch'](handleError());}}catch(_0x26c67a){logger[_0xab7f('0x2d')](JSON[_0xab7f('0x27')](_0x26c67a));}return logger[_0xab7f('0xb')]('no\x20report\x20id');};}function getJobs(_0x1d57b9){var _0x915232={};if(_0x1d57b9){_0x915232['id']=_0x1d57b9;}return db[_0xab7f('0x3a')][_0xab7f('0x3b')]({'where':_0x915232,'include':[{'model':db[_0xab7f('0xe')],'attributes':['id',_0xab7f('0x17'),_0xab7f('0xd')],'include':[{'model':db[_0xab7f('0x3c')],'as':_0xab7f('0x11')}]}]})['then'](function(_0x1f1a4f){var _0x298848=_['keys'](manager[_0xab7f('0x3d')]);var _0x1a690b=_[_0xab7f('0x3e')](_0x1f1a4f,function(_0x52be5f){return _0x52be5f['id'][_0xab7f('0x3f')]();});var _0x33c3b3=_[_0xab7f('0x40')](_0x1f1a4f,function(_0x3b1a68){return _0x3b1a68['id']['toString']();});var _0x2e0a1a=_0x1d57b9?_0x1a690b:_[_0xab7f('0x41')](_0x1a690b,_0x298848);var _0x327dda=_[_0xab7f('0x42')](_0x1a690b,_0x298848);var _0x66869a=_[_0xab7f('0x41')](_0x298848,_0x1a690b);var _0x502d14;var _0xf5fa37;for(_0x502d14=0x0;_0x502d14<_0x66869a[_0xab7f('0x43')]&&!_0x1d57b9;_0x502d14+=0x1){_0xf5fa37=_0x66869a[_0x502d14][_0xab7f('0x3f')]();if(manager[_0xab7f('0x44')](_0xf5fa37)){manager[_0xab7f('0x45')](_0xf5fa37);manager[_0xab7f('0x46')](_0xf5fa37);logger[_0xab7f('0xb')](_0xab7f('0x47'),_0xf5fa37);}}logger[_0xab7f('0xb')]('toRun',JSON['stringify'](_0x2e0a1a));for(_0x502d14=0x0;_0x502d14<_0x2e0a1a[_0xab7f('0x43')];_0x502d14+=0x1){_0xf5fa37=_0x2e0a1a[_0x502d14][_0xab7f('0x3f')]();logger['info']('index',_0xf5fa37);if(_0x1d57b9){logger[_0xab7f('0xb')](_0xab7f('0x48'),_0x1d57b9);logger['info'](JSON[_0xab7f('0x27')](_0x33c3b3[_0xf5fa37]));BPromise[_0xab7f('0x49')]()[_0xab7f('0x2c')](handleJob(_0x33c3b3[_0xf5fa37]));logger[_0xab7f('0xb')](_0xab7f('0x4a'),_0x33c3b3[_0xf5fa37]['name'],_0x33c3b3[_0xf5fa37][_0xab7f('0x4b')]);}else if(_0x33c3b3[_0xf5fa37][_0xab7f('0x4b')]&&_0x33c3b3[_0xf5fa37][_0xab7f('0x4c')]&&moment()['isBetween'](_0x33c3b3[_0xf5fa37][_0xab7f('0x4d')],_0x33c3b3[_0xf5fa37]['endAt'])){manager[_0xab7f('0x4e')](_0xf5fa37,_0x33c3b3[_0xf5fa37]['cron'],handleJob(_0x33c3b3[_0xf5fa37]));manager['start'](_0xf5fa37);logger[_0xab7f('0xb')](_0xab7f('0x4f'),_0x33c3b3[_0xf5fa37][_0xab7f('0x17')],_0x33c3b3[_0xf5fa37]['cron']);}else if(manager[_0xab7f('0x44')](_0xf5fa37)){manager['stop'](_0xf5fa37);manager[_0xab7f('0x46')](_0xf5fa37);logger[_0xab7f('0xb')](_0xab7f('0x50'),_0x33c3b3[_0xf5fa37][_0xab7f('0x17')],_0x33c3b3[_0xf5fa37]['cron']);}}for(_0x502d14=0x0,_0xf5fa37;_0x502d14<_0x327dda[_0xab7f('0x43')]&&!_0x1d57b9;_0x502d14+=0x1){_0xf5fa37=_0x327dda[_0x502d14][_0xab7f('0x3f')]();if(manager[_0xab7f('0x44')](_0xf5fa37)){if(_0x33c3b3[_0xf5fa37][_0xab7f('0x4b')]&&_0x33c3b3[_0xf5fa37][_0xab7f('0x4c')]&&moment()[_0xab7f('0x51')](_0x33c3b3[_0xf5fa37][_0xab7f('0x4d')],_0x33c3b3[_0xf5fa37][_0xab7f('0x52')])){manager[_0xab7f('0x53')](_0xf5fa37,_0x33c3b3[_0xf5fa37]['cron'],handleJob(_0x33c3b3[_0xf5fa37]));logger[_0xab7f('0xb')](_0xab7f('0x54'),_0x33c3b3[_0xf5fa37][_0xab7f('0x17')],_0x33c3b3[_0xf5fa37][_0xab7f('0x4b')]);}else{manager[_0xab7f('0x45')](_0xf5fa37);manager[_0xab7f('0x46')](_0xf5fa37);logger[_0xab7f('0xb')](_0xab7f('0x50'),_0x33c3b3[_0xf5fa37]['name'],_0x33c3b3[_0xf5fa37][_0xab7f('0x4b')]);}}}})[_0xab7f('0x2e')](function(_0x486df5){logger['error'](JSON['stringify'](_0x486df5));});}exports[_0xab7f('0x55')]=function(_0x17b738){return getJobs(_0x17b738);};exports[_0xab7f('0x56')]=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 b6d36d1..bd44d03 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa6b=['innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','log','hopper1','contacts2','util','../mysqldb','push'];(function(_0x31c745,_0x15fa1d){var _0x26d163=function(_0x4cbfdd){while(--_0x4cbfdd){_0x31c745['push'](_0x31c745['shift']());}};_0x26d163(++_0x15fa1d);}(_0xfa6b,0x10b));var _0xbfa6=function(_0x4000c7,_0x4484c0){_0x4000c7=_0x4000c7-0x0;var _0x2b5a20=_0xfa6b[_0x4000c7];return _0x2b5a20;};'use strict';var util=require(_0xbfa6('0x0'));var db=require(_0xbfa6('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xbfa6('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xbfa6('0x3')+i+_0xbfa6('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xbfa6('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xbfa6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xbfa6('0x6')+i,'lastName':_0xbfa6('0x7')+i,'phone':0xf879fb460+i,'email':_0xbfa6('0x3')+i+_0xbfa6('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xbfa6('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xbfa6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbfa6('0x5')](),'updatedAt':Date[_0xbfa6('0x5')]()});}db[_0xbfa6('0x8')][_0xbfa6('0x9')]({'where':{}})[_0xbfa6('0xa')](function(){return db[_0xbfa6('0x8')]['bulkCreate'](contacts);})[_0xbfa6('0xa')](function(){console['log'](_0xbfa6('0xb'),_0xbfa6('0xc'));return db[_0xbfa6('0xd')]['destroy']({'where':{}});})['then'](function(){return db[_0xbfa6('0xd')][_0xbfa6('0xe')](hopper);})['then'](function(){console[_0xbfa6('0xf')](_0xbfa6('0xb'),_0xbfa6('0x10'));return db['CmContact'][_0xbfa6('0xe')](contacts2);})[_0xbfa6('0xa')](function(){console[_0xbfa6('0xf')](_0xbfa6('0xb'),_0xbfa6('0x11'));return db['CmHopper'][_0xbfa6('0xe')](hopper2);})['then'](function(){console[_0xbfa6('0xf')](_0xbfa6('0xb'),'hopper2');})['catch'](function(_0x407e82){console[_0xbfa6('0xf')](_0x407e82);}); \ No newline at end of file +var _0xda35=['catch','util','../mysqldb','Innocenzo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2','hopper2'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda35,0x157));var _0x5da3=function(_0x53f025,_0x476c3b){_0x53f025=_0x53f025-0x0;var _0x2a1bca=_0xda35[_0x53f025];return _0x2a1bca;};'use strict';var util=require(_0x5da3('0x0'));var db=require(_0x5da3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x5da3('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5da3('0x3')+i+_0x5da3('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5da3('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5da3('0x6')](),'updatedAt':Date[_0x5da3('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5da3('0x5')]({'id':i,'firstName':_0x5da3('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5da3('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5da3('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x5da3('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5da3('0x6')](),'updatedAt':Date[_0x5da3('0x6')]()});}db[_0x5da3('0x7')][_0x5da3('0x8')]({'where':{}})[_0x5da3('0x9')](function(){return db[_0x5da3('0x7')][_0x5da3('0xa')](contacts);})[_0x5da3('0x9')](function(){console[_0x5da3('0xb')](_0x5da3('0xc'),_0x5da3('0xd'));return db[_0x5da3('0xe')][_0x5da3('0x8')]({'where':{}});})[_0x5da3('0x9')](function(){return db['CmHopper'][_0x5da3('0xa')](hopper);})[_0x5da3('0x9')](function(){console[_0x5da3('0xb')](_0x5da3('0xc'),'hopper1');return db[_0x5da3('0x7')]['bulkCreate'](contacts2);})[_0x5da3('0x9')](function(){console[_0x5da3('0xb')](_0x5da3('0xc'),_0x5da3('0xf'));return db['CmHopper'][_0x5da3('0xa')](hopper2);})['then'](function(){console['log'](_0x5da3('0xc'),_0x5da3('0x10'));})[_0x5da3('0x11')](function(_0x471be3){console[_0x5da3('0xb')](_0x471be3);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index e0b7f08..eb5c50c 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c7b=['%s%s','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','push','format','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2c7b,0x13e));var _0xb2c7=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2c7b[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0xb2c7('0x0'));var db=require(_0xb2c7('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb2c7('0x2')]({'name':util[_0xb2c7('0x3')]('%s%s',_0xb2c7('0x4'),i),'fullname':util['format']('%s%s','agent',i),'email':util[_0xb2c7('0x3')](_0xb2c7('0x5'),_0xb2c7('0x4'),i),'role':_0xb2c7('0x4'),'password':_0xb2c7('0x6'),'internal':0xfa0+i,'type':_0xb2c7('0x7'),'transport':[_0xb2c7('0x8'),'ws',_0xb2c7('0x9')],'disallow':[_0xb2c7('0xa')],'allow':[_0xb2c7('0xb')],'defaultuser':util[_0xb2c7('0x3')](_0xb2c7('0xc'),_0xb2c7('0x4'),i),'encryption':_0xb2c7('0xd'),'avpf':'yes','force_avp':_0xb2c7('0xd'),'icesupport':_0xb2c7('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xb2c7('0xe'),'dtlssetup':_0xb2c7('0xf'),'callerid':util[_0xb2c7('0x3')](_0xb2c7('0x10'),util[_0xb2c7('0x3')](_0xb2c7('0xc'),_0xb2c7('0x4'),i),0xfa0+i)});}db[_0xb2c7('0x11')][_0xb2c7('0x12')](users)[_0xb2c7('0x13')](function(){console[_0xb2c7('0x14')](_0xb2c7('0x15'));})['catch'](function(_0x677cdf){console['log'](_0x677cdf);}); \ No newline at end of file +var _0x8d42=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','format','%s%s','agent','%s%s@xcally.com','udp'];(function(_0x2efd1d,_0x44f696){var _0x1ef3f6=function(_0x25da5f){while(--_0x25da5f){_0x2efd1d['push'](_0x2efd1d['shift']());}};_0x1ef3f6(++_0x44f696);}(_0x8d42,0x14e));var _0x28d4=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8d42[_0x40ac5e];return _0x2839d6;};'use strict';var util=require(_0x28d4('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x28d4('0x1')](_0x28d4('0x2'),_0x28d4('0x3'),i),'fullname':util[_0x28d4('0x1')]('%s%s',_0x28d4('0x3'),i),'email':util[_0x28d4('0x1')](_0x28d4('0x4'),_0x28d4('0x3'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x28d4('0x5'),'ws','wss'],'disallow':[_0x28d4('0x6')],'allow':[_0x28d4('0x7')],'defaultuser':util[_0x28d4('0x1')](_0x28d4('0x2'),'agent',i),'encryption':_0x28d4('0x8'),'avpf':'yes','force_avp':'yes','icesupport':_0x28d4('0x8'),'dtlsenable':_0x28d4('0x8'),'dtlsverify':'no','dtlscertfile':_0x28d4('0x9'),'dtlsprivatekey':_0x28d4('0xa'),'dtlssetup':'actpass','callerid':util[_0x28d4('0x1')](_0x28d4('0xb'),util[_0x28d4('0x1')](_0x28d4('0x2'),_0x28d4('0x3'),i),0xfa0+i)});}db[_0x28d4('0xc')][_0x28d4('0xd')](users)['then'](function(){console[_0x28d4('0xe')](_0x28d4('0xf'));})[_0x28d4('0x10')](function(_0x212593){console[_0x28d4('0xe')](_0x212593);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 655301b..adcf39b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad9f=['format','%s:queue:%s','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','MailQueue','Trunk','Campaign','user','voice:inbound','VoiceQueues','userProfileId','OpenchannelQueue','Trunks','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','fax','sms','mail','trunk:%s','map','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','resourceId','where'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xad9f,0x1ad));var _0xfad9=function(_0x4af2cf,_0x11810c){_0x4af2cf=_0x4af2cf-0x0;var _0xb50aa4=_0xad9f[_0x4af2cf];return _0xb50aa4;};'use strict';var _=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var BPromise=require(_0xfad9('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xfad9('0x3'));var queryQueues={'attributes':['id',_0xfad9('0x4')],'include':[{'as':_0xfad9('0x5'),'model':db[_0xfad9('0x6')],'attributes':['id','name',_0xfad9('0x7')],'raw':!![],'where':{'role':_0xfad9('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfad9('0x4')],'where':{'role':_0xfad9('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xfad9('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xfad9('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xfad9('0xa')],'where':{'type':_0xfad9('0xb')}};function getAssociatedResources(_0x1ef1bb,_0x8e99d6,_0x4963ed){return db[_0xfad9('0xc')][_0xfad9('0xd')]({'where':{'name':_0x1ef1bb,'userProfileId':_0x8e99d6},'raw':!![]})[_0xfad9('0xe')](function(_0x46993b){if(_0x46993b){if(_0x46993b[_0xfad9('0xf')]){switch(_0x1ef1bb){case'VoiceQueues':case _0xfad9('0x10'):case _0xfad9('0x11'):case _0xfad9('0x12'):case _0xfad9('0x13'):case _0xfad9('0x14'):return db[_0x4963ed][_0xfad9('0x15')](queryQueues);case _0xfad9('0x16'):return db[_0x4963ed]['findAll'](queryTelephones);case'Trunks':return db[_0x4963ed][_0xfad9('0x15')](queryTrunks);case _0xfad9('0x17'):return db[_0x4963ed][_0xfad9('0x15')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x46993b['id']},'raw':!![]})['then'](function(_0x44c0dd){if(_0x44c0dd){var _0x599e2a={'where':{'id':_['map'](_0x44c0dd,_0xfad9('0x18'))},'raw':!![]};switch(_0x4963ed){case _0xfad9('0x6'):_0x599e2a[_0xfad9('0x19')][_0xfad9('0x7')]=_0xfad9('0x9');break;case'Campaign':_0x599e2a[_0xfad9('0x19')][_0xfad9('0xa')]=_0xfad9('0xb');break;}return db[_0x4963ed][_0xfad9('0x15')](_0x599e2a);}else{return[];}});}}else{return[];}})[_0xfad9('0xe')](function(_0x4787cd){return _0x4787cd;});}function joinOrLeaveQueues(_0x518213,_0x710486,_0x431533,_0x3e7a50){_0x518213[_0x710486](util[_0xfad9('0x1a')](_0xfad9('0x1b'),_0x431533,_0x3e7a50[_0xfad9('0x4')]));if(_0x3e7a50['Agents']){for(var _0x45166b=0x0;_0x45166b<_0x3e7a50[_0xfad9('0x5')][_0xfad9('0x1c')];_0x45166b+=0x1){_0x518213[_0x710486](util[_0xfad9('0x1a')](_0xfad9('0x1d'),_0x3e7a50[_0xfad9('0x5')][_0x45166b][_0xfad9('0x4')]));}}}function joinOrLeave(_0x4bf53d,_0x9a8871,_0xd03ccc){var _0x151b46;if(_0x4bf53d[_0xfad9('0x1e')][_0xfad9('0x1f')]['id']){db['User'][_0xfad9('0x20')]({'attributes':['id',_0xfad9('0x4'),'role','userProfileId'],'where':{'id':_0x4bf53d['handshake'][_0xfad9('0x1f')]['id']},'include':[{'model':db[_0xfad9('0x21')],'as':_0xfad9('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xfad9('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xfad9('0x24')],'as':_0xfad9('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xfad9('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xfad9('0x27')],'as':_0xfad9('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x588ec2){if(_0x588ec2){_0x151b46=_0x588ec2;_0x4bf53d[_0x9a8871](util['format'](_0xfad9('0x1d'),_0x588ec2[_0xfad9('0x4')]));var _0x7ba47f=[];switch(_0x588ec2['role']){case'admin':_0x4bf53d[_0x9a8871]('voice:inbound');_0x4bf53d[_0x9a8871](_0xfad9('0x29'));if(queryQueues[_0xfad9('0x2a')]('include')){delete queryQueues[_0xfad9('0x2b')];}_0x7ba47f[_0xfad9('0x2c')](db[_0xfad9('0x2d')][_0xfad9('0x15')](queryQueues));_0x7ba47f['push'](db[_0xfad9('0x2e')]['findAll'](queryQueues));_0x7ba47f[_0xfad9('0x2c')](db['FaxQueue'][_0xfad9('0x15')](queryQueues));_0x7ba47f[_0xfad9('0x2c')](db['SmsQueue'][_0xfad9('0x15')](queryQueues));_0x7ba47f[_0xfad9('0x2c')](db[_0xfad9('0x2f')]['findAll'](queryQueues));_0x7ba47f['push'](db['OpenchannelQueue'][_0xfad9('0x15')](queryQueues));_0x7ba47f[_0xfad9('0x2c')](db[_0xfad9('0x6')][_0xfad9('0x15')](queryTelephones));_0x7ba47f[_0xfad9('0x2c')](db[_0xfad9('0x30')][_0xfad9('0x15')](queryTrunks));_0x7ba47f['push'](db[_0xfad9('0x31')]['findAll'](queryCampaigns));_0x7ba47f[_0xfad9('0x2c')](db['User'][_0xfad9('0x15')](queryAgents));break;case _0xfad9('0x32'):_0x4bf53d[_0x9a8871](_0xfad9('0x33'));_0x4bf53d[_0x9a8871]('voice:outbound');_0x7ba47f['push'](getAssociatedResources(_0xfad9('0x34'),_0x588ec2[_0xfad9('0x35')],_0xfad9('0x2d')));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources('ChatQueues',_0x588ec2[_0xfad9('0x35')],_0xfad9('0x2e')));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources(_0xfad9('0x11'),_0x588ec2[_0xfad9('0x35')],'FaxQueue'));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources(_0xfad9('0x12'),_0x588ec2[_0xfad9('0x35')],'SmsQueue'));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources(_0xfad9('0x13'),_0x588ec2[_0xfad9('0x35')],_0xfad9('0x2f')));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources(_0xfad9('0x14'),_0x588ec2[_0xfad9('0x35')],_0xfad9('0x36')));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources('Telephones',_0x588ec2[_0xfad9('0x35')],_0xfad9('0x6')));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources(_0xfad9('0x37'),_0x588ec2[_0xfad9('0x35')],_0xfad9('0x30')));_0x7ba47f[_0xfad9('0x2c')](getAssociatedResources(_0xfad9('0x17'),_0x588ec2[_0xfad9('0x35')],'Campaign'));_0x7ba47f[_0xfad9('0x2c')](db[_0xfad9('0x6')][_0xfad9('0x15')](queryAgents));break;case _0xfad9('0x8'):_0x4bf53d[_0x9a8871]('voice:inbound');_0x4bf53d[_0x9a8871](_0xfad9('0x29'));_0x7ba47f['push'](_0x588ec2[_0xfad9('0x38')]({'attributes':['id',_0xfad9('0x4')]}));_0x7ba47f['push'](_0x588ec2[_0xfad9('0x39')]({'attributes':['id',_0xfad9('0x4')]}));_0x7ba47f[_0xfad9('0x2c')](_0x588ec2[_0xfad9('0x3a')]({'attributes':['id',_0xfad9('0x4')]}));_0x7ba47f[_0xfad9('0x2c')](_0x588ec2[_0xfad9('0x3b')]({'attributes':['id',_0xfad9('0x4')]}));_0x7ba47f[_0xfad9('0x2c')](_0x588ec2[_0xfad9('0x3c')]({'attributes':['id',_0xfad9('0x4')]}));_0x7ba47f[_0xfad9('0x2c')](_0x588ec2['getOpenchannelQueues']({'attributes':['id','name']}));break;}return BPromise[_0xfad9('0x3d')](_0x7ba47f);}})['then'](function(_0x18c438){if(_0x18c438&&_0x18c438[_0xfad9('0x1c')]){for(var _0x4cf678=0x0;_0x4cf678<_0x18c438[_0xfad9('0x1c')];_0x4cf678+=0x1){for(var _0x2a6bcc=0x0;_0x2a6bcc<_0x18c438[_0x4cf678]['length'];_0x2a6bcc+=0x1){switch(_0x4cf678){case 0x0:joinOrLeaveQueues(_0x4bf53d,_0x9a8871,_0xfad9('0x3e'),_0x18c438[_0x4cf678][_0x2a6bcc]);break;case 0x1:joinOrLeaveQueues(_0x4bf53d,_0x9a8871,_0xfad9('0x3f'),_0x18c438[_0x4cf678][_0x2a6bcc]);break;case 0x2:joinOrLeaveQueues(_0x4bf53d,_0x9a8871,_0xfad9('0x40'),_0x18c438[_0x4cf678][_0x2a6bcc]);break;case 0x3:joinOrLeaveQueues(_0x4bf53d,_0x9a8871,_0xfad9('0x41'),_0x18c438[_0x4cf678][_0x2a6bcc]);break;case 0x4:joinOrLeaveQueues(_0x4bf53d,_0x9a8871,_0xfad9('0x42'),_0x18c438[_0x4cf678][_0x2a6bcc]);break;case 0x5:joinOrLeaveQueues(_0x4bf53d,_0x9a8871,'openchannel',_0x18c438[_0x4cf678][_0x2a6bcc]);break;case 0x6:_0x4bf53d[_0x9a8871](util[_0xfad9('0x1a')]('telephone:%s',_0x18c438[_0x4cf678][_0x2a6bcc][_0xfad9('0x4')]));break;case 0x7:_0x4bf53d[_0x9a8871](util[_0xfad9('0x1a')](_0xfad9('0x43'),_0x18c438[_0x4cf678][_0x2a6bcc][_0xfad9('0x4')]));break;case 0x8:_0x4bf53d[_0x9a8871](util[_0xfad9('0x1a')]('campaign:%s:%s',_0x18c438[_0x4cf678][_0x2a6bcc][_0xfad9('0xa')],_0x18c438[_0x4cf678][_0x2a6bcc][_0xfad9('0x4')]));break;case 0x9:_0x4bf53d[_0x9a8871](util[_0xfad9('0x1a')](_0xfad9('0x1d'),_0x18c438[_0x4cf678][_0x2a6bcc][_0xfad9('0x4')]));break;}}}}})[_0xfad9('0xe')](function(){if(_0x9a8871==='leave'){var _0x51b673=_[_0xfad9('0x44')](_0x151b46[_0xfad9('0x22')],'id');return _0x151b46['removeChatInteractions'](_0x51b673)[_0xfad9('0xe')](function(){for(var _0x514ee6=0x0;_0x514ee6<_0x51b673[_0xfad9('0x1c')];_0x514ee6+=0x1){_0xd03ccc[_0xfad9('0x45')](_0xfad9('0x46'),{'ChatInteractionId':Number(_0x51b673[_0x514ee6]),'UserId':Number(_0x151b46['id'])});}});}})[_0xfad9('0xe')](function(){if(_0x9a8871===_0xfad9('0x47')){var _0x4dd921=_['map'](_0x151b46['MailInteractions'],'id');return _0x151b46[_0xfad9('0x48')](_0x4dd921)[_0xfad9('0xe')](function(){for(var _0x4e9617=0x0;_0x4e9617<_0x4dd921[_0xfad9('0x1c')];_0x4e9617+=0x1){_0xd03ccc[_0xfad9('0x45')](_0xfad9('0x49'),{'MailInteractionId':Number(_0x4dd921[_0x4e9617]),'UserId':Number(_0x151b46['id'])});}});}})['then'](function(){if(_0x9a8871===_0xfad9('0x47')){var _0x5a3913=_[_0xfad9('0x44')](_0x151b46[_0xfad9('0x25')],'id');return _0x151b46['removeFaxInteractions'](_0x5a3913)[_0xfad9('0xe')](function(){for(var _0x4e47a2=0x0;_0x4e47a2<_0x5a3913['length'];_0x4e47a2+=0x1){_0xd03ccc['emit'](_0xfad9('0x4a'),{'FaxInteractionId':Number(_0x5a3913[_0x4e47a2]),'UserId':Number(_0x151b46['id'])});}});}})[_0xfad9('0xe')](function(){if(_0x9a8871===_0xfad9('0x47')){var _0x465fa8=_[_0xfad9('0x44')](_0x151b46[_0xfad9('0x4b')],'id');return _0x151b46[_0xfad9('0x4c')](_0x465fa8)[_0xfad9('0xe')](function(){for(var _0x3021f4=0x0;_0x3021f4<_0x465fa8[_0xfad9('0x1c')];_0x3021f4+=0x1){_0xd03ccc[_0xfad9('0x45')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x465fa8[_0x3021f4]),'UserId':Number(_0x151b46['id'])});}});}})[_0xfad9('0xe')](function(){if(_0x9a8871==='leave'){var _0x3c1d78=_[_0xfad9('0x44')](_0x151b46[_0xfad9('0x28')],'id');return _0x151b46[_0xfad9('0x4d')](_0x3c1d78)[_0xfad9('0xe')](function(){for(var _0x1d8941=0x0;_0x1d8941<_0x3c1d78['length'];_0x1d8941+=0x1){_0xd03ccc[_0xfad9('0x45')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3c1d78[_0x1d8941]),'UserId':Number(_0x151b46['id'])});}});}})[_0xfad9('0x4e')](function(_0x280c1a){_0x4bf53d[_0xfad9('0x4f')](_0x280c1a);});}}function onDisconnect(_0x2a2c73,_0x46856d){joinOrLeave(_0x2a2c73,_0xfad9('0x47'),_0x46856d);}function onConnect(_0x539e5d){joinOrLeave(_0x539e5d,_0xfad9('0x50'));}exports[_0xfad9('0x51')]=function(_0x158c6d){_0x158c6d['on'](_0xfad9('0x52'),function(_0x274349){_0x274349[_0xfad9('0x53')](0x0);_0x274349['address']=_0x274349[_0xfad9('0x54')]['connection'][_0xfad9('0x55')]+':'+_0x274349[_0xfad9('0x54')]['connection']['remotePort'];_0x274349[_0xfad9('0x56')]=new Date();_0x274349[_0xfad9('0x4f')]=function(_0x209252){console['log'](_0xfad9('0x57')+_0x274349[_0xfad9('0x58')][_0xfad9('0x4')]+'['+_0x274349['address']+']',_0x209252);};_0x274349['on'](_0xfad9('0x59'),function(){onDisconnect(_0x274349,_0x158c6d);_0x274349[_0xfad9('0x4f')](_0xfad9('0x5a'));});onConnect(_0x274349);_0x274349['log']('CONNECTED');});}; \ No newline at end of file +var _0x6ab6=['join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','FaxQueues','SmsQueues','MailQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','then','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','ChatQueues','MailQueue','OpenchannelQueues','agent','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','sms','openchannel','leave','removeChatInteractions','MailInteractions','removeMailInteractions','emit','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ab6,0x11f));var _0x66ab=function(_0x14a85c,_0x1db7a5){_0x14a85c=_0x14a85c-0x0;var _0x32e12b=_0x6ab6[_0x14a85c];return _0x32e12b;};'use strict';var _=require(_0x66ab('0x0'));var util=require(_0x66ab('0x1'));var BPromise=require(_0x66ab('0x2'));var db=require(_0x66ab('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x66ab('0x4')],'include':[{'as':_0x66ab('0x5'),'model':db[_0x66ab('0x6')],'attributes':['id',_0x66ab('0x4'),_0x66ab('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x66ab('0x4')],'where':{'role':_0x66ab('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x66ab('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x66ab('0x4'),_0x66ab('0x9')],'where':{'type':_0x66ab('0xa')}};function getAssociatedResources(_0x4c6263,_0xac6248,_0x58d0f9){return db[_0x66ab('0xb')][_0x66ab('0xc')]({'where':{'name':_0x4c6263,'userProfileId':_0xac6248},'raw':!![]})['then'](function(_0x2342a7){if(_0x2342a7){if(_0x2342a7[_0x66ab('0xd')]){switch(_0x4c6263){case'VoiceQueues':case'ChatQueues':case _0x66ab('0xe'):case _0x66ab('0xf'):case _0x66ab('0x10'):case'OpenchannelQueues':return db[_0x58d0f9]['findAll'](queryQueues);case _0x66ab('0x11'):return db[_0x58d0f9][_0x66ab('0x12')](queryTelephones);case'Trunks':return db[_0x58d0f9][_0x66ab('0x12')](queryTrunks);case _0x66ab('0x13'):return db[_0x58d0f9][_0x66ab('0x12')](queryCampaigns);}}else{return db[_0x66ab('0x14')][_0x66ab('0x12')]({'attributes':[_0x66ab('0x15')],'where':{'sectionId':_0x2342a7['id']},'raw':!![]})['then'](function(_0x170a7b){if(_0x170a7b){var _0x929fd0={'where':{'id':_[_0x66ab('0x16')](_0x170a7b,'resourceId')},'raw':!![]};switch(_0x58d0f9){case _0x66ab('0x6'):_0x929fd0['where'][_0x66ab('0x7')]=_0x66ab('0x8');break;case _0x66ab('0x17'):_0x929fd0['where'][_0x66ab('0x9')]=_0x66ab('0xa');break;}return db[_0x58d0f9]['findAll'](_0x929fd0);}else{return[];}});}}else{return[];}})[_0x66ab('0x18')](function(_0x244373){return _0x244373;});}function joinOrLeaveQueues(_0x2f1e7b,_0x3fc576,_0x35df45,_0x87cde5){_0x2f1e7b[_0x3fc576](util[_0x66ab('0x19')](_0x66ab('0x1a'),_0x35df45,_0x87cde5[_0x66ab('0x4')]));if(_0x87cde5[_0x66ab('0x5')]){for(var _0x5ec8e3=0x0;_0x5ec8e3<_0x87cde5['Agents'][_0x66ab('0x1b')];_0x5ec8e3+=0x1){_0x2f1e7b[_0x3fc576](util[_0x66ab('0x19')](_0x66ab('0x1c'),_0x87cde5[_0x66ab('0x5')][_0x5ec8e3][_0x66ab('0x4')]));}}}function joinOrLeave(_0x5d1156,_0xa5f016,_0x2a7ed6){var _0x57b83b;if(_0x5d1156[_0x66ab('0x1d')][_0x66ab('0x1e')]['id']){db[_0x66ab('0x6')][_0x66ab('0x1f')]({'attributes':['id',_0x66ab('0x4'),_0x66ab('0x7'),_0x66ab('0x20')],'where':{'id':_0x5d1156['handshake']['query']['id']},'include':[{'model':db[_0x66ab('0x21')],'as':_0x66ab('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x66ab('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x66ab('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x66ab('0x25')],'as':_0x66ab('0x26'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x66ab('0x18')](function(_0x5b89a9){if(_0x5b89a9){_0x57b83b=_0x5b89a9;_0x5d1156[_0xa5f016](util[_0x66ab('0x19')](_0x66ab('0x1c'),_0x5b89a9[_0x66ab('0x4')]));var _0x269b30=[];switch(_0x5b89a9[_0x66ab('0x7')]){case _0x66ab('0x27'):_0x5d1156[_0xa5f016](_0x66ab('0x28'));_0x5d1156[_0xa5f016](_0x66ab('0x29'));if(queryQueues[_0x66ab('0x2a')](_0x66ab('0x2b'))){delete queryQueues[_0x66ab('0x2b')];}_0x269b30['push'](db[_0x66ab('0x2c')]['findAll'](queryQueues));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x2e')][_0x66ab('0x12')](queryQueues));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x2f')][_0x66ab('0x12')](queryQueues));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x30')][_0x66ab('0x12')](queryQueues));_0x269b30[_0x66ab('0x2d')](db['MailQueue'][_0x66ab('0x12')](queryQueues));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x31')][_0x66ab('0x12')](queryQueues));_0x269b30['push'](db[_0x66ab('0x6')][_0x66ab('0x12')](queryTelephones));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x32')][_0x66ab('0x12')](queryTrunks));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x17')][_0x66ab('0x12')](queryCampaigns));_0x269b30['push'](db[_0x66ab('0x6')][_0x66ab('0x12')](queryAgents));break;case _0x66ab('0x33'):_0x5d1156[_0xa5f016]('voice:inbound');_0x5d1156[_0xa5f016]('voice:outbound');_0x269b30[_0x66ab('0x2d')](getAssociatedResources('VoiceQueues',_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x2c')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources(_0x66ab('0x34'),_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x2e')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources(_0x66ab('0xe'),_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x2f')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources('SmsQueues',_0x5b89a9[_0x66ab('0x20')],'SmsQueue'));_0x269b30['push'](getAssociatedResources(_0x66ab('0x10'),_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x35')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources(_0x66ab('0x36'),_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x31')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources(_0x66ab('0x11'),_0x5b89a9['userProfileId'],_0x66ab('0x6')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources('Trunks',_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x32')));_0x269b30[_0x66ab('0x2d')](getAssociatedResources('IvrCampaigns',_0x5b89a9[_0x66ab('0x20')],_0x66ab('0x17')));_0x269b30[_0x66ab('0x2d')](db[_0x66ab('0x6')][_0x66ab('0x12')](queryAgents));break;case _0x66ab('0x37'):_0x5d1156[_0xa5f016](_0x66ab('0x28'));_0x5d1156[_0xa5f016](_0x66ab('0x29'));_0x269b30[_0x66ab('0x2d')](_0x5b89a9[_0x66ab('0x38')]({'attributes':['id',_0x66ab('0x4')]}));_0x269b30[_0x66ab('0x2d')](_0x5b89a9[_0x66ab('0x39')]({'attributes':['id',_0x66ab('0x4')]}));_0x269b30[_0x66ab('0x2d')](_0x5b89a9[_0x66ab('0x3a')]({'attributes':['id',_0x66ab('0x4')]}));_0x269b30[_0x66ab('0x2d')](_0x5b89a9[_0x66ab('0x3b')]({'attributes':['id',_0x66ab('0x4')]}));_0x269b30[_0x66ab('0x2d')](_0x5b89a9[_0x66ab('0x3c')]({'attributes':['id',_0x66ab('0x4')]}));_0x269b30['push'](_0x5b89a9[_0x66ab('0x3d')]({'attributes':['id',_0x66ab('0x4')]}));break;}return BPromise[_0x66ab('0x3e')](_0x269b30);}})[_0x66ab('0x18')](function(_0x44d6d4){if(_0x44d6d4&&_0x44d6d4[_0x66ab('0x1b')]){for(var _0x5438ae=0x0;_0x5438ae<_0x44d6d4[_0x66ab('0x1b')];_0x5438ae+=0x1){for(var _0x18c365=0x0;_0x18c365<_0x44d6d4[_0x5438ae][_0x66ab('0x1b')];_0x18c365+=0x1){switch(_0x5438ae){case 0x0:joinOrLeaveQueues(_0x5d1156,_0xa5f016,_0x66ab('0x3f'),_0x44d6d4[_0x5438ae][_0x18c365]);break;case 0x1:joinOrLeaveQueues(_0x5d1156,_0xa5f016,_0x66ab('0x40'),_0x44d6d4[_0x5438ae][_0x18c365]);break;case 0x2:joinOrLeaveQueues(_0x5d1156,_0xa5f016,'fax',_0x44d6d4[_0x5438ae][_0x18c365]);break;case 0x3:joinOrLeaveQueues(_0x5d1156,_0xa5f016,_0x66ab('0x41'),_0x44d6d4[_0x5438ae][_0x18c365]);break;case 0x4:joinOrLeaveQueues(_0x5d1156,_0xa5f016,'mail',_0x44d6d4[_0x5438ae][_0x18c365]);break;case 0x5:joinOrLeaveQueues(_0x5d1156,_0xa5f016,_0x66ab('0x42'),_0x44d6d4[_0x5438ae][_0x18c365]);break;case 0x6:_0x5d1156[_0xa5f016](util[_0x66ab('0x19')]('telephone:%s',_0x44d6d4[_0x5438ae][_0x18c365][_0x66ab('0x4')]));break;case 0x7:_0x5d1156[_0xa5f016](util[_0x66ab('0x19')]('trunk:%s',_0x44d6d4[_0x5438ae][_0x18c365]['name']));break;case 0x8:_0x5d1156[_0xa5f016](util[_0x66ab('0x19')]('campaign:%s:%s',_0x44d6d4[_0x5438ae][_0x18c365][_0x66ab('0x9')],_0x44d6d4[_0x5438ae][_0x18c365][_0x66ab('0x4')]));break;case 0x9:_0x5d1156[_0xa5f016](util[_0x66ab('0x19')]('user:%s',_0x44d6d4[_0x5438ae][_0x18c365][_0x66ab('0x4')]));break;}}}}})[_0x66ab('0x18')](function(){if(_0xa5f016===_0x66ab('0x43')){var _0x16c2ab=_[_0x66ab('0x16')](_0x57b83b[_0x66ab('0x22')],'id');return _0x57b83b[_0x66ab('0x44')](_0x16c2ab)[_0x66ab('0x18')](function(){for(var _0x278e16=0x0;_0x278e16<_0x16c2ab[_0x66ab('0x1b')];_0x278e16+=0x1){_0x2a7ed6['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x16c2ab[_0x278e16]),'UserId':Number(_0x57b83b['id'])});}});}})['then'](function(){if(_0xa5f016===_0x66ab('0x43')){var _0x31a6b0=_[_0x66ab('0x16')](_0x57b83b[_0x66ab('0x45')],'id');return _0x57b83b[_0x66ab('0x46')](_0x31a6b0)[_0x66ab('0x18')](function(){for(var _0x3b8659=0x0;_0x3b8659<_0x31a6b0['length'];_0x3b8659+=0x1){_0x2a7ed6[_0x66ab('0x47')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x31a6b0[_0x3b8659]),'UserId':Number(_0x57b83b['id'])});}});}})[_0x66ab('0x18')](function(){if(_0xa5f016===_0x66ab('0x43')){var _0x4e1dba=_[_0x66ab('0x16')](_0x57b83b[_0x66ab('0x48')],'id');return _0x57b83b[_0x66ab('0x49')](_0x4e1dba)[_0x66ab('0x18')](function(){for(var _0x4f4a86=0x0;_0x4f4a86<_0x4e1dba[_0x66ab('0x1b')];_0x4f4a86+=0x1){_0x2a7ed6[_0x66ab('0x47')](_0x66ab('0x4a'),{'FaxInteractionId':Number(_0x4e1dba[_0x4f4a86]),'UserId':Number(_0x57b83b['id'])});}});}})[_0x66ab('0x18')](function(){if(_0xa5f016===_0x66ab('0x43')){var _0x180df1=_[_0x66ab('0x16')](_0x57b83b[_0x66ab('0x26')],'id');return _0x57b83b[_0x66ab('0x4b')](_0x180df1)[_0x66ab('0x18')](function(){for(var _0x2443fe=0x0;_0x2443fe<_0x180df1[_0x66ab('0x1b')];_0x2443fe+=0x1){_0x2a7ed6[_0x66ab('0x47')](_0x66ab('0x4c'),{'SmsInteractionId':Number(_0x180df1[_0x2443fe]),'UserId':Number(_0x57b83b['id'])});}});}})[_0x66ab('0x18')](function(){if(_0xa5f016===_0x66ab('0x43')){var _0xb2de0e=_[_0x66ab('0x16')](_0x57b83b[_0x66ab('0x4d')],'id');return _0x57b83b['removeOpenchannelInteractions'](_0xb2de0e)[_0x66ab('0x18')](function(){for(var _0x233caf=0x0;_0x233caf<_0xb2de0e[_0x66ab('0x1b')];_0x233caf+=0x1){_0x2a7ed6['emit'](_0x66ab('0x4e'),{'OpenchannelInteractionId':Number(_0xb2de0e[_0x233caf]),'UserId':Number(_0x57b83b['id'])});}});}})[_0x66ab('0x4f')](function(_0x4fe510){_0x5d1156[_0x66ab('0x50')](_0x4fe510);});}}function onDisconnect(_0x282f1b,_0x45f7de){joinOrLeave(_0x282f1b,'leave',_0x45f7de);}function onConnect(_0x13aa73){joinOrLeave(_0x13aa73,_0x66ab('0x51'));}exports[_0x66ab('0x52')]=function(_0x13cc78){_0x13cc78['on'](_0x66ab('0x53'),function(_0x50673c){_0x50673c[_0x66ab('0x54')](0x0);_0x50673c['address']=_0x50673c[_0x66ab('0x55')]['connection'][_0x66ab('0x56')]+':'+_0x50673c[_0x66ab('0x55')]['connection'][_0x66ab('0x57')];_0x50673c[_0x66ab('0x58')]=new Date();_0x50673c[_0x66ab('0x50')]=function(_0x43de36){console[_0x66ab('0x50')](_0x66ab('0x59')+_0x50673c[_0x66ab('0x5a')][_0x66ab('0x4')]+'['+_0x50673c['address']+']',_0x43de36);};_0x50673c['on']('disconnect',function(){onDisconnect(_0x50673c,_0x13cc78);_0x50673c['log'](_0x66ab('0x5b'));});onConnect(_0x50673c);_0x50673c[_0x66ab('0x50')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e343199..ac8818e 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 _0x7b04=['then','interface','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','newmessage','Sms','SmsInteraction','closedinteraction','FaxInteraction','Fax','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','info','Trigger,\x20%s','EventManager','error','code','channel','event','direction','UserId','User','name','format','SIP/%s','incomingmessage','catch','outgoingmessage','get','opened','closed','find'];(function(_0x3adf3c,_0x218cd7){var _0x4ed835=function(_0x23f6b2){while(--_0x23f6b2){_0x3adf3c['push'](_0x3adf3c['shift']());}};_0x4ed835(++_0x218cd7);}(_0x7b04,0xd5));var _0x47b0=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x7b04[_0x344a3f];return _0x264712;};'use strict';var util=require(_0x47b0('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x47b0('0x1'));var logger=require(_0x47b0('0x2'))(_0x47b0('0x3'));var client=jayson[_0x47b0('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x47b0('0x5'),'model':_0x47b0('0x6'),'event':_0x47b0('0x7'),'condition':_0x47b0('0x8'),'callback':afterCreate},{'channel':_0x47b0('0x5'),'model':_0x47b0('0x6'),'event':_0x47b0('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x47b0('0x5'),'model':'ChatMessage','event':'afterCreate','condition':_0x47b0('0xa'),'callback':afterCreateMessage},{'channel':_0x47b0('0xb'),'model':_0x47b0('0xc'),'event':'afterCreate','condition':_0x47b0('0x8'),'callback':afterCreate},{'channel':_0x47b0('0xb'),'model':_0x47b0('0xc'),'event':'afterUpdate','condition':_0x47b0('0xd'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x47b0('0x7'),'condition':_0x47b0('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x47b0('0xe'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x47b0('0xf'),'model':_0x47b0('0xe'),'event':_0x47b0('0x9'),'condition':_0x47b0('0xd'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x47b0('0x7'),'condition':_0x47b0('0xa'),'callback':afterCreateMessage},{'channel':_0x47b0('0x10'),'model':'MailInteraction','event':_0x47b0('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x47b0('0x10'),'model':_0x47b0('0x11'),'event':'afterUpdate','condition':_0x47b0('0xd'),'callback':afterUpdate},{'channel':_0x47b0('0x10'),'model':'MailMessage','event':_0x47b0('0x7'),'condition':_0x47b0('0xa'),'callback':afterCreateMessage},{'channel':_0x47b0('0x12'),'model':_0x47b0('0x13'),'event':'afterCreate','condition':_0x47b0('0x8'),'callback':afterCreate},{'channel':_0x47b0('0x12'),'model':_0x47b0('0x13'),'event':_0x47b0('0x9'),'condition':_0x47b0('0xd'),'callback':afterUpdate},{'channel':_0x47b0('0x12'),'model':_0x47b0('0x14'),'event':_0x47b0('0x7'),'condition':_0x47b0('0xa'),'callback':afterCreateMessage}];function request(_0x419986){return client[_0x47b0('0x15')]('EventManager',_0x419986)['then'](function(_0x56bfda){logger[_0x47b0('0x16')](_0x47b0('0x17'),_0x47b0('0x18'),_0x56bfda);if(_0x56bfda[_0x47b0('0x19')]){if(_0x56bfda['error'][_0x47b0('0x1a')]===0x1f4){logger[_0x47b0('0x19')]('Trigger,\x20%s',_0x47b0('0x18'),_0x56bfda[_0x47b0('0x19')]);}}})['catch'](function(_0x3e0c02){logger['error'](_0x47b0('0x17'),_0x47b0('0x18'),_0x3e0c02);});}function afterCreateMessage(_0x4f13fd,_0x2edcf0){return function(_0x355c55,_0x2f75d0){_0x355c55=_0x355c55['get']({'plain':!![]});_0x355c55[_0x47b0('0x1b')]=_0x4f13fd;_0x355c55[_0x47b0('0x1c')]=_0x355c55[_0x47b0('0x1d')];if(_0x355c55[_0x47b0('0x1e')]){return db[_0x47b0('0x1f')]['find']({'where':{'id':_0x355c55[_0x47b0('0x1e')]},'attributes':['id',_0x47b0('0x20')],'raw':!![]})['then'](function(_0x587a34){_0x355c55['interface']=util[_0x47b0('0x21')](_0x47b0('0x22'),_0x587a34[_0x47b0('0x20')]);_0x355c55['channel']=_0x4f13fd;return request({'event':_0x47b0('0x23'),'message':_0x355c55});})[_0x47b0('0x24')](function(_0x2ca924){console[_0x47b0('0x19')](_0x2ca924);});}else{return request({'event':_0x47b0('0x25'),'message':_0x355c55});}};}function afterCreate(_0x216131,_0x1321ec){return function(_0x2eb4c1,_0x4f5bdb){_0x2eb4c1=_0x2eb4c1[_0x47b0('0x26')]({'plain':!![]});_0x2eb4c1['channel']=_0x216131;_0x2eb4c1[_0x47b0('0x1c')]=_0x47b0('0x27');return request({'event':_0x1321ec,'message':_0x2eb4c1});};}function afterUpdate(_0x186560,_0x244434){return function(_0x660add,_0x47e1ac){if(_0x660add['changed'](_0x47b0('0x28'))&&_0x660add[_0x47b0('0x28')]){_0x660add=_0x660add['get']({'plain':!![]});_0x660add[_0x47b0('0x1b')]=_0x186560;_0x660add[_0x47b0('0x1c')]='closed';if(_0x660add[_0x47b0('0x1e')]){return db['User'][_0x47b0('0x29')]({'where':{'id':_0x660add[_0x47b0('0x1e')]},'attributes':['id','name'],'raw':!![]})[_0x47b0('0x2a')](function(_0x160c3a){_0x660add[_0x47b0('0x2b')]=util[_0x47b0('0x21')](_0x47b0('0x22'),_0x160c3a['name']);return request({'event':_0x244434,'message':_0x660add});})['catch'](function(_0x5d3e25){console['error'](_0x5d3e25);});}else{return request({'event':_0x244434,'message':_0x660add});}}};}exports[_0x47b0('0x2c')]=function(){for(var _0x3b3768=0x0;_0x3b3768=_0x2e8f5d[_0x23cd('0x10')]){throw Error(_0x23cd('0x11'));}_0x40181c(_0x3a7950);})['catch'](function(_0x60a0c3){_0x2d363b(_0x60a0c3);});});}; \ No newline at end of file +var _0x1ede=['includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','../mysqldb','./license/util','voice','chat','fax','sms','openchannel','getChannels','toLowerCase'];(function(_0x471388,_0x20b096){var _0x64f6f3=function(_0x51381b){while(--_0x51381b){_0x471388['push'](_0x471388['shift']());}};_0x64f6f3(++_0x20b096);}(_0x1ede,0xf3));var _0xe1ed=function(_0x5effd0,_0x810199){_0x5effd0=_0x5effd0-0x0;var _0x2e3a15=_0x1ede[_0x5effd0];return _0x2e3a15;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0xe1ed('0x0'))['db'];var util=require(_0xe1ed('0x1'));var channels=[_0xe1ed('0x2'),'mail',_0xe1ed('0x3'),_0xe1ed('0x4'),_0xe1ed('0x5'),_0xe1ed('0x6')];exports[_0xe1ed('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x272ed8){_0x272ed8=_0x272ed8[_0xe1ed('0x8')]();return _[_0xe1ed('0x9')](channels,_0x272ed8);};exports[_0xe1ed('0xa')]=function(_0x8d4a73,_0x58ec7a,_0x4d7b8b,_0x4a4839){var _0x4f3a53={'loginAttempts':_0x58ec7a,'blocked':_0x4d7b8b};if(!_['isUndefined'](_0x4a4839)){_0x4f3a53[_0xe1ed('0xb')]=_0x4a4839;}return _0x8d4a73[_0xe1ed('0xc')](_0x4f3a53);};exports[_0xe1ed('0xd')]=function(_0x395bbf){return new BPromise(function(_0x10afdc,_0x41b3b4){var _0x1057f3=0x0;if(_0x395bbf[_0xe1ed('0xe')]!==_0xe1ed('0xf')){_0x10afdc(_0x395bbf);}db[_0xe1ed('0x10')][_0xe1ed('0x11')]({'where':{'role':_0xe1ed('0xf'),'online':!![],'id':{'$ne':_0x395bbf['id']}}})[_0xe1ed('0x12')](function(_0x3dca51){_0x1057f3=_0x3dca51;return util['getLicense']();})[_0xe1ed('0x12')](function(_0x44726d){if(_0x44726d&&_0x44726d[_0xe1ed('0x13')]&&_0x1057f3>=_0x44726d[_0xe1ed('0x13')]){throw Error(_0xe1ed('0x14'));}_0x10afdc(_0x395bbf);})['catch'](function(_0x11a545){_0x41b3b4(_0x11a545);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index f365dbb..e7bf830 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x369b=['404','status','render','json','send','exports'];(function(_0x4c9bda,_0x4e3e57){var _0x161ace=function(_0x2d5722){while(--_0x2d5722){_0x4c9bda['push'](_0x4c9bda['shift']());}};_0x161ace(++_0x4e3e57);}(_0x369b,0xc5));var _0xb369=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x369b[_0x4ae625];return _0x31accf;};'use strict';module[_0xb369('0x0')][0x194]=function pageNotFound(_0x2e0483,_0x596603){var _0x1a1ef4=_0xb369('0x1');var _0x13af04=0x194;var _0x21ed83={'status':_0x13af04};_0x596603[_0xb369('0x2')](_0x21ed83[_0xb369('0x2')]);_0x596603[_0xb369('0x3')](_0x1a1ef4,{},function(_0x3c9d5d,_0x409436){if(_0x3c9d5d){return _0x596603['status'](_0x21ed83[_0xb369('0x2')])[_0xb369('0x4')](_0x21ed83);}_0x596603[_0xb369('0x5')](_0x409436);});}; \ No newline at end of file +var _0xdd5a=['exports','status','json','send'];(function(_0x4ddb4e,_0x38c020){var _0x1c2f4c=function(_0x4cf0cb){while(--_0x4cf0cb){_0x4ddb4e['push'](_0x4ddb4e['shift']());}};_0x1c2f4c(++_0x38c020);}(_0xdd5a,0x1c0));var _0xadd5=function(_0x482b7e,_0x3131c7){_0x482b7e=_0x482b7e-0x0;var _0x2af009=_0xdd5a[_0x482b7e];return _0x2af009;};'use strict';module[_0xadd5('0x0')][0x194]=function pageNotFound(_0x1159fa,_0xc79a55){var _0x3f6373='404';var _0x720064=0x194;var _0x56ba7e={'status':_0x720064};_0xc79a55['status'](_0x56ba7e[_0xadd5('0x1')]);_0xc79a55['render'](_0x3f6373,{},function(_0x3fa250,_0x123038){if(_0x3fa250){return _0xc79a55[_0xadd5('0x1')](_0x56ba7e[_0xadd5('0x1')])[_0xadd5('0x2')](_0x56ba7e);}_0xc79a55[_0xadd5('0x3')](_0x123038);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 4c71fda..9af4c4c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67d6=['Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','MailQueues','UserMailQueue','ChatQueues','SmsQueues','UserSmsQueue','UserOpenchannelQueue','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Answers','List','ListId','TemplateId','MailQueue','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','restrict','TagId','Interactions','Exntensions','FaxMessage','FaxInteractionId','FaxAccountId','Owner','fax_interaction_has_tags','Tags','AttachmentId','SmsAccountId','user_has_sms_accounts','SmsQueue','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','ChatGroup','CmHopperFinal','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','ChatApplications','SmsApplications','AnalyticCustomReport','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','DefaultReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Field','VariableId','SugarcrmConfiguration','Descriptions','Subject','Description','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZendeskAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','int_vtiger_configuration_has_tags','ServicenowAccount','ChatQueueReport','FromId','ToId','JscriptyAnswerReport','SessionId','ProjectId','team_has_voice_queues','team_has_fax_queues','FaxQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromAgent','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToAccount','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','Extensions','userProfileId','Resources','sectionId','exports','path','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','name','utf8','utf8_general_ci','sequelizeHistory','mysql','utf8mb4','username','password','database','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','Team','../api/team/team.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasOne','cascade','UserId','VoiceRecording','Recordings','VoiceQueuesRt','hasMany','HopperFinals','CmHopperHistory','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','belongsTo','UserProfile','belongsToMany','Groups','Contacts','cm_user_has_contacts','CmList'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x67d6,0xd0));var _0x667d=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x67d6[_0x515afd];return _0x536d53;};'use strict';var path=require(_0x667d('0x0'));var config=require('../config/environment');var Sequelize=require(_0x667d('0x1'));var _=require(_0x667d('0x2'));var jstz=require(_0x667d('0x3'));var timezone=jstz['determine']();config['sequelize']=_[_0x667d('0x4')](config[_0x667d('0x1')],{'database':_0x667d('0x5'),'username':_0x667d('0x6'),'password':_0x667d('0x7'),'options':{'host':_0x667d('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x667d('0x9')](),'define':{'charset':_0x667d('0xa'),'collate':_0x667d('0xb')}}});config[_0x667d('0xc')]=_[_0x667d('0x4')](config[_0x667d('0xc')],{'database':_0x667d('0x5'),'username':'xcall','password':_0x667d('0x7'),'options':{'host':_0x667d('0x8'),'port':0xcea,'dialect':_0x667d('0xd'),'dialectOptions':{'charset':_0x667d('0xe')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x667d('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x667d('0x1')]['database'],config['sequelize'][_0x667d('0xf')],config[_0x667d('0x1')][_0x667d('0x10')],config[_0x667d('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x667d('0x11')],config[_0x667d('0xc')]['username'],config[_0x667d('0xc')][_0x667d('0x10')],config[_0x667d('0xc')][_0x667d('0x12')])};db[_0x667d('0x13')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x15'));db['VoiceChanSpy']=db['sequelize'][_0x667d('0x14')](_0x667d('0x16'));db['VoiceContext']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x17'));db[_0x667d('0x18')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x19'));db[_0x667d('0x1a')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x1b'));db['VoiceQueue']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x1c'));db['VoiceRecording']=db['sequelize'][_0x667d('0x14')](_0x667d('0x1d'));db[_0x667d('0x1e')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x1f'));db[_0x667d('0x20')]=db[_0x667d('0x1')]['import'](_0x667d('0x21'));db[_0x667d('0x22')]=db[_0x667d('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x23'));db['VoiceDialReport']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x24'));db[_0x667d('0x25')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x26'));db[_0x667d('0x27')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x28'));db[_0x667d('0x29')]=db[_0x667d('0x1')]['import']('../api/memberReport/memberReport.model');db['Trunk']=db['sequelize'][_0x667d('0x14')](_0x667d('0x2a'));db[_0x667d('0x2b')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x2c'));db[_0x667d('0x2d')]=db[_0x667d('0x1')]['import'](_0x667d('0x2e'));db['UserVoiceQueue']=db[_0x667d('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x667d('0x2f')]=db[_0x667d('0x1')]['import'](_0x667d('0x30'));db['UserMailQueue']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x667d('0x31')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x32'));db['UserSmsQueue']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x33'));db['UserOpenchannelQueue']=db['sequelize'][_0x667d('0x14')](_0x667d('0x34'));db[_0x667d('0x35')]=db[_0x667d('0x1')]['import'](_0x667d('0x36'));db[_0x667d('0x37')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x38'));db[_0x667d('0x39')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x3a'));db['MailQueue']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/mailQueue/mailQueue.model');db[_0x667d('0x3b')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x3c'));db[_0x667d('0x3d')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x3e'));db[_0x667d('0x3f')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/mailMessage/mailMessage.model');db[_0x667d('0x40')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x41'));db[_0x667d('0x42')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x43'));db[_0x667d('0x44')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x45'));db[_0x667d('0x46')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db['sequelize'][_0x667d('0x14')](_0x667d('0x47'));db[_0x667d('0x48')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x49'));db['FaxInteraction']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x4a'));db['FaxMessage']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/faxMessage/faxMessage.model');db[_0x667d('0x4b')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x4c'));db[_0x667d('0x4d')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x667d('0x4e')]=db[_0x667d('0x1')]['import']('../api/smsAccount/smsAccount.model');db[_0x667d('0x4f')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/smsApplication/smsApplication.model');db[_0x667d('0x50')]=db[_0x667d('0x1')]['import'](_0x667d('0x51'));db[_0x667d('0x52')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x53'));db['SmsQueue']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x54'));db[_0x667d('0x55')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x56'));db[_0x667d('0x57')]=db['sequelize']['import'](_0x667d('0x58'));db[_0x667d('0x59')]=db[_0x667d('0x1')]['import'](_0x667d('0x5a'));db[_0x667d('0x5b')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x5c'));db[_0x667d('0x5d')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x5e'));db['ChatWebsite']=db['sequelize'][_0x667d('0x14')](_0x667d('0x5f'));db['OpenchannelQueueReport']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x60'));db[_0x667d('0x61')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x62'));db[_0x667d('0x63')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x64'));db[_0x667d('0x65')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x66'));db[_0x667d('0x67')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x667d('0x68')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x69'));db['ChatGroup']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x6a'));db[_0x667d('0x6b')]=db[_0x667d('0x1')]['import'](_0x667d('0x6c'));db[_0x667d('0x6d')]=db['sequelize']['import']('../api/cmCompany/cmCompany.model');db[_0x667d('0x6e')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x6f'));db[_0x667d('0x70')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x71'));db[_0x667d('0x72')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x73'));db['CmHopperFinal']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x667d('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x74'));db[_0x667d('0x75')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x76'));db[_0x667d('0x77')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x78'));db[_0x667d('0x79')]=db['sequelize']['import'](_0x667d('0x7a'));db['CannedAnswer']=db[_0x667d('0x1')]['import'](_0x667d('0x7b'));db[_0x667d('0x7c')]=db['sequelize']['import'](_0x667d('0x7d'));db[_0x667d('0x7e')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/condition/condition.model');db[_0x667d('0x7f')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x80'));db[_0x667d('0x81')]=db[_0x667d('0x1')]['import'](_0x667d('0x82'));db[_0x667d('0x83')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x84'));db[_0x667d('0x85')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x86'));db[_0x667d('0x87')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x88'));db[_0x667d('0x89')]=db[_0x667d('0x1')]['import']('../api/sound/sound.model');db[_0x667d('0x8a')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x8b'));db[_0x667d('0x8c')]=db['sequelize']['import']('../api/template/template.model');db[_0x667d('0x8d')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x8e'));db[_0x667d('0x8f')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x90'));db['Integration']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x91'));db[_0x667d('0x92')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x93'));db['AnalyticCustomReport']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x667d('0x94')]=db['sequelize'][_0x667d('0x14')](_0x667d('0x95'));db[_0x667d('0x96')]=db[_0x667d('0x1')]['import'](_0x667d('0x97'));db[_0x667d('0x98')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x99'));db[_0x667d('0x9a')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x9b'));db['AnalyticTreeReport']=db['sequelize']['import'](_0x667d('0x9c'));db[_0x667d('0x9d')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0x9e'));db[_0x667d('0x9f')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xa0'));db[_0x667d('0xa1')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x667d('0xa2')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xa3'));db['SugarcrmConfiguration']=db['sequelize']['import'](_0x667d('0xa4'));db[_0x667d('0xa5')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xa6'));db['DeskAccount']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xa7'));db['DeskConfiguration']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xa8'));db[_0x667d('0xa9')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/intDeskField/intDeskField.model');db[_0x667d('0xaa')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x667d('0xab')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xac'));db[_0x667d('0xad')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xae'));db['ZendeskAccount']=db[_0x667d('0x1')]['import'](_0x667d('0xaf'));db['ZendeskConfiguration']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xb0'));db['ZendeskField']=db['sequelize'][_0x667d('0x14')](_0x667d('0xb1'));db[_0x667d('0xb2')]=db[_0x667d('0x1')]['import'](_0x667d('0xb3'));db[_0x667d('0xb4')]=db['sequelize']['import'](_0x667d('0xb5'));db[_0x667d('0xb6')]=db[_0x667d('0x1')]['import'](_0x667d('0xb7'));db[_0x667d('0xb8')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xb9'));db['VtigerConfiguration']=db['sequelize']['import'](_0x667d('0xba'));db['VtigerField']=db[_0x667d('0x1')]['import'](_0x667d('0xbb'));db['ServicenowAccount']=db[_0x667d('0x1')]['import'](_0x667d('0xbc'));db[_0x667d('0xbd')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x667d('0xbe')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xbf'));db[_0x667d('0xc0')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xc1'));db[_0x667d('0xc2')]=db['sequelize'][_0x667d('0x14')](_0x667d('0xc3'));db[_0x667d('0xc4')]=db['sequelize']['import'](_0x667d('0xc5'));db['Integration']=db['sequelize'][_0x667d('0x14')](_0x667d('0x91'));db[_0x667d('0xc6')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xc7'));db['ChatQueueReport']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xc8'));db[_0x667d('0xc9')]=db['sequelize'][_0x667d('0x14')](_0x667d('0xca'));db['JscriptyAnswerReport']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x667d('0xcb')]=db[_0x667d('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x667d('0xcc')]=db['sequelize']['import'](_0x667d('0xcd'));db[_0x667d('0xce')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xcf'));db[_0x667d('0xd0')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xd1'));db[_0x667d('0xd2')]=db['sequelize']['import'](_0x667d('0xd3'));db[_0x667d('0xd4')]=db['sequelize'][_0x667d('0x14')](_0x667d('0xd5'));db['Setting']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xd6'));db['SquareOdbc']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0x667d('0xd7')]=db['sequelize'][_0x667d('0x14')](_0x667d('0xd8'));db['SquareRecording']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/squareRecording/squareRecording.model');db[_0x667d('0xd9')]=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db[_0x667d('0xda')]=db['sequelize']['import'](_0x667d('0xdb'));db['License']=db['sequelize'][_0x667d('0x14')]('../api/license/license.model');db[_0x667d('0xdc')]=db[_0x667d('0x1')]['import'](_0x667d('0xdd'));db[_0x667d('0xde')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/migration/migration.model');db[_0x667d('0xdf')]=db[_0x667d('0x1')]['import']('../api/attachment/attachment.model');db['Plugin']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xe0'));db[_0x667d('0xe1')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xe2'));db['ChatTransferReport']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xe3'));db[_0x667d('0xe4')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xe5'));db[_0x667d('0xe6')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xe7'));db['SmsTransferReport']=db[_0x667d('0x1')]['import'](_0x667d('0xe8'));db['CmList']=db[_0x667d('0x1')][_0x667d('0x14')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xe9'));db['UserProfile']=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xea'));db[_0x667d('0xeb')]=db[_0x667d('0x1')][_0x667d('0x14')](_0x667d('0xec'));db[_0x667d('0xed')]=db[_0x667d('0x1')][_0x667d('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x667d('0x13')][_0x667d('0xee')](db[_0x667d('0x20')],{'as':_0x667d('0x20'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')]['hasMany'](db[_0x667d('0xf1')],{'as':_0x667d('0xf2'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')]['hasMany'](db[_0x667d('0x2d')],{'as':_0x667d('0xf3'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')][_0x667d('0xf4')](db[_0x667d('0x18')],{'as':'Extensions','onDelete':_0x667d('0xef'),'hooks':!![]});db[_0x667d('0x13')][_0x667d('0xf4')](db['CmHopperFinal'],{'as':_0x667d('0xf5'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')][_0x667d('0xf4')](db[_0x667d('0xf6')],{'as':'HopperHistory','foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')][_0x667d('0xf4')](db['ReportAgentPreview'],{'as':_0x667d('0xf7'),'foreignKey':_0x667d('0xf0')});db['User'][_0x667d('0xf4')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x667d('0x13')]['hasMany'](db['ChatInteraction'],{'as':_0x667d('0xf8'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')][_0x667d('0xf4')](db[_0x667d('0x50')],{'as':_0x667d('0xf9'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')][_0x667d('0xf4')](db[_0x667d('0xfa')],{'as':_0x667d('0xfb'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x13')][_0x667d('0xf4')](db[_0x667d('0x3d')],{'as':_0x667d('0xfc'),'foreignKey':'UserId'});db[_0x667d('0x13')][_0x667d('0xfd')](db[_0x667d('0xfe')],{'as':_0x667d('0xfe'),'foreignKey':'userProfileId'});db['User'][_0x667d('0xff')](db['ChatGroup'],{'as':_0x667d('0x100'),'through':'chat_group_has_users'});db['User'][_0x667d('0xff')](db[_0x667d('0x6e')],{'as':_0x667d('0x101'),'through':_0x667d('0x102')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x103')],{'as':_0x667d('0x104'),'through':_0x667d('0x105')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0xda')],{'through':'user_has_teams'});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x3d')],{'as':_0x667d('0xfc'),'through':_0x667d('0x106')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x63')],{'as':_0x667d('0xf8'),'through':_0x667d('0x107')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0xfa')],{'as':_0x667d('0xfb'),'through':_0x667d('0x108')});db[_0x667d('0x13')][_0x667d('0xff')](db['SmsInteraction'],{'as':_0x667d('0xf9'),'through':_0x667d('0x109')});db[_0x667d('0x13')]['belongsToMany'](db[_0x667d('0x59')],{'as':_0x667d('0x10a'),'through':_0x667d('0x10b')});db[_0x667d('0x13')]['belongsToMany'](db[_0x667d('0x10c')],{'as':_0x667d('0x10d'),'through':_0x667d('0x10e'),'required':![]});db[_0x667d('0x13')][_0x667d('0xff')](db['MailQueue'],{'as':_0x667d('0x10f'),'through':_0x667d('0x110'),'required':![]});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x68')],{'as':_0x667d('0x111'),'through':_0x667d('0x2f'),'required':![],'hooks':!![]});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x4b')],{'as':'FaxQueues','through':_0x667d('0x31'),'required':![]});db['User'][_0x667d('0xff')](db['SmsQueue'],{'as':_0x667d('0x112'),'through':_0x667d('0x113'),'required':![]});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x5d')],{'as':'OpenchannelQueues','through':_0x667d('0x114'),'required':![]});db['User'][_0x667d('0xff')](db[_0x667d('0x103')],{'through':_0x667d('0x105')});db['User']['belongsToMany'](db[_0x667d('0x115')],{'as':_0x667d('0x116'),'through':_0x667d('0x117'),'required':![]});db[_0x667d('0x13')]['belongsToMany'](db[_0x667d('0x118')],{'as':_0x667d('0x119'),'through':_0x667d('0x11a')});db[_0x667d('0x13')]['belongsToMany'](db[_0x667d('0x11b')],{'as':'FaxAccounts','through':_0x667d('0x11c')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x39')],{'as':_0x667d('0x11d'),'through':_0x667d('0x11e')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x55')],{'as':_0x667d('0x11f'),'through':_0x667d('0x120')});db[_0x667d('0x13')][_0x667d('0xff')](db[_0x667d('0x4e')],{'as':_0x667d('0x121'),'through':'user_has_sms_accounts'});db[_0x667d('0x13')]['belongsToMany'](db['SquareProject'],{'as':_0x667d('0x122'),'through':_0x667d('0x123')});db[_0x667d('0x124')][_0x667d('0xf4')](db[_0x667d('0x18')],{'as':_0x667d('0x125'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x126')});db[_0x667d('0x127')][_0x667d('0xf4')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x667d('0x18')][_0x667d('0xf4')](db[_0x667d('0x18')],{'as':_0x667d('0x128'),'onDelete':_0x667d('0xef')});db[_0x667d('0x1a')][_0x667d('0xff')](db[_0x667d('0x89')],{'as':_0x667d('0x129'),'through':_0x667d('0x12a')});db['VoiceQueue'][_0x667d('0xf4')](db[_0x667d('0x2d')],{'as':_0x667d('0x12b'),'foreignKey':_0x667d('0x12c')});db[_0x667d('0x10c')]['hasMany'](db[_0x667d('0x70')],{'as':_0x667d('0x12d'),'foreignKey':_0x667d('0x12c')});db['VoiceQueue'][_0x667d('0xf4')](db['CmHopperFinal'],{'as':_0x667d('0xf5'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x667d('0xf4')](db[_0x667d('0xf6')],{'as':_0x667d('0x12e'),'foreignKey':_0x667d('0x12c')});db['VoiceQueue'][_0x667d('0xf4')](db[_0x667d('0xf7')],{'as':_0x667d('0xf7'),'foreignKey':_0x667d('0x12c')});db['VoiceQueue'][_0x667d('0xf4')](db[_0x667d('0x72')],{'as':'HopperBlacks','foreignKey':_0x667d('0x12c')});db['VoiceQueue'][_0x667d('0xf4')](db[_0x667d('0xcc')],{'as':_0x667d('0x12f'),'foreignKey':_0x667d('0x12c')});db[_0x667d('0x10c')][_0x667d('0xfd')](db[_0x667d('0x130')],{'as':_0x667d('0x130'),'foreignKey':_0x667d('0x131')});db[_0x667d('0x10c')]['belongsTo'](db[_0x667d('0x130')],{'as':_0x667d('0x132'),'foreignKey':_0x667d('0x133')});db[_0x667d('0x10c')]['belongsTo'](db[_0x667d('0x7f')],{'as':_0x667d('0x7f'),'foreignKey':_0x667d('0x134')});db['VoiceQueue']['belongsTo'](db[_0x667d('0x81')],{'as':_0x667d('0x135'),'foreignKey':_0x667d('0x136')});db[_0x667d('0x10c')][_0x667d('0xff')](db[_0x667d('0x103')],{'as':'Lists','through':_0x667d('0x137')});db[_0x667d('0x10c')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':_0x667d('0x10e')});db[_0x667d('0x10c')]['belongsToMany'](db['Team'],{'as':_0x667d('0x139'),'through':'team_has_voice_queues'});db[_0x667d('0x10c')][_0x667d('0xff')](db[_0x667d('0x103')],{'as':_0x667d('0x13a'),'through':_0x667d('0x13b')});db[_0x667d('0xf1')][_0x667d('0xfd')](db[_0x667d('0x13')],{'as':_0x667d('0x13'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x1e')]['belongsTo'](db[_0x667d('0x13')],{'as':'User','foreignKey':_0x667d('0xf0')});db[_0x667d('0x20')][_0x667d('0xf4')](db[_0x667d('0x22')],{'as':_0x667d('0x13c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x13d'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0x667d('0xfd')](db[_0x667d('0x20')],{'foreignKey':_0x667d('0x13d'),'targetKey':_0x667d('0x13e')});db[_0x667d('0x13f')]['hasMany'](db[_0x667d('0x27')],{'as':'QueueCalls','foreignKey':_0x667d('0x140'),'constraints':![]});db[_0x667d('0x13f')][_0x667d('0xf4')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x667d('0xfd')](db[_0x667d('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x667d('0x13f')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x35')][_0x667d('0xfd')](db[_0x667d('0x39')],{'as':_0x667d('0x39'),'foreignKey':_0x667d('0x143')});db[_0x667d('0x37')][_0x667d('0xfd')](db[_0x667d('0x39')],{'as':'MailAccount','foreignKey':_0x667d('0x143')});db[_0x667d('0x39')][_0x667d('0xee')](db[_0x667d('0x35')],{'as':_0x667d('0x144'),'onDelete':_0x667d('0xef')});db['MailAccount'][_0x667d('0xee')](db[_0x667d('0x37')],{'as':_0x667d('0x145'),'onDelete':_0x667d('0xef')});db[_0x667d('0x39')][_0x667d('0xf4')](db[_0x667d('0x7c')],{'as':_0x667d('0x146'),'foreignKey':'MailAccountId'});db[_0x667d('0x39')]['hasMany'](db[_0x667d('0x147')],{'as':_0x667d('0x148'),'foreignKey':_0x667d('0x143')});db[_0x667d('0x39')][_0x667d('0xf4')](db[_0x667d('0x3f')],{'as':_0x667d('0x13c'),'foreignKey':'MailAccountId'});db[_0x667d('0x39')][_0x667d('0xf4')](db[_0x667d('0x3d')],{'as':'Interactions'});db[_0x667d('0x39')][_0x667d('0xf4')](db[_0x667d('0x40')],{'as':_0x667d('0x128')});db[_0x667d('0x39')][_0x667d('0xfd')](db['CmList'],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x39')][_0x667d('0xfd')](db['Template'],{'as':_0x667d('0x8c'),'foreignKey':_0x667d('0x14b')});db[_0x667d('0x39')][_0x667d('0xfd')](db[_0x667d('0x81')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x667d('0x39')]['belongsToMany'](db[_0x667d('0x13')],{'as':'Agents','through':_0x667d('0x11e')});db[_0x667d('0x14c')][_0x667d('0xff')](db['User'],{'as':_0x667d('0x138'),'through':_0x667d('0x110')});db['MailQueue'][_0x667d('0xff')](db[_0x667d('0xda')],{'through':_0x667d('0x14d'),'as':'Teams'});db[_0x667d('0x3d')][_0x667d('0xf4')](db[_0x667d('0x3f')],{'as':_0x667d('0x13c'),'onDelete':'cascade','foreignKey':_0x667d('0x14e')});db[_0x667d('0x3d')][_0x667d('0xfd')](db[_0x667d('0x39')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x143')});db[_0x667d('0x3d')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db['MailInteraction'][_0x667d('0xfd')](db[_0x667d('0x13')],{'as':'Owner','foreignKey':_0x667d('0xf0')});db['MailInteraction'][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x150'),'as':'Tags'});db['MailInteraction'][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x150'),'as':_0x667d('0x151')});db[_0x667d('0x3d')][_0x667d('0xff')](db['User'],{'as':_0x667d('0x152'),'through':_0x667d('0x106'),'foreignKey':_0x667d('0x14e')});db[_0x667d('0x3f')]['hasMany'](db[_0x667d('0xdf')],{'as':_0x667d('0x153'),'onDelete':_0x667d('0xef')});db[_0x667d('0x3f')][_0x667d('0xfd')](db[_0x667d('0x13')],{'as':_0x667d('0x13')});db['MailMessage'][_0x667d('0xfd')](db['CmContact'],{'onDelete':'cascade','as':_0x667d('0x141')});db[_0x667d('0x3f')][_0x667d('0xfd')](db[_0x667d('0x3d')],{'as':_0x667d('0x154'),'foreignKey':_0x667d('0x14e')});db[_0x667d('0x3f')]['belongsTo'](db['MailAccount'],{'as':_0x667d('0x14f'),'foreignKey':'MailAccountId'});db['MailApplication'][_0x667d('0xfd')](db[_0x667d('0x13')],{'onDelete':_0x667d('0x155')});db[_0x667d('0x40')][_0x667d('0xfd')](db[_0x667d('0x14c')],{'onDelete':_0x667d('0x155')});db[_0x667d('0x40')]['belongsTo'](db[_0x667d('0x39')],{'onDelete':_0x667d('0x155')});db['MailApplication']['belongsTo'](db['Interval'],{'onDelete':_0x667d('0x155'),'foreignKey':'IntervalId'});db[_0x667d('0x40')]['belongsTo'](db[_0x667d('0x8a')],{'onDelete':'restrict','foreignKey':_0x667d('0x156')});db[_0x667d('0x42')][_0x667d('0xfd')](db[_0x667d('0x39')],{});db[_0x667d('0x42')][_0x667d('0xfd')](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x42')][_0x667d('0xfd')](db['CmContact'],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x42')][_0x667d('0xfd')](db[_0x667d('0x3d')],{});db[_0x667d('0x42')]['belongsTo'](db[_0x667d('0x3f')],{});db[_0x667d('0x42')][_0x667d('0xfd')](db['User'],{});db[_0x667d('0x42')][_0x667d('0xfd')](db[_0x667d('0x14c')],{});db[_0x667d('0x44')][_0x667d('0xf4')](db[_0x667d('0x46')],{'as':'Items','onDelete':_0x667d('0xef')});db['FaxAccount']['hasMany'](db[_0x667d('0x7c')],{'as':_0x667d('0x146'),'foreignKey':'FaxAccountId'});db[_0x667d('0x11b')]['hasMany'](db[_0x667d('0x147')],{'as':_0x667d('0x148'),'foreignKey':'FaxAccountId'});db[_0x667d('0x11b')][_0x667d('0xf4')](db[_0x667d('0xfa')],{'as':_0x667d('0x157')});db[_0x667d('0x11b')][_0x667d('0xf4')](db[_0x667d('0x48')],{'as':_0x667d('0x128')});db[_0x667d('0x11b')][_0x667d('0xf4')](db[_0x667d('0x18')],{'as':_0x667d('0x158'),'onDelete':_0x667d('0xef')});db[_0x667d('0x11b')][_0x667d('0xf4')](db[_0x667d('0x159')],{'as':_0x667d('0x13c')});db[_0x667d('0x11b')]['belongsTo'](db['Trunk'],{'as':_0x667d('0x130')});db['FaxAccount']['belongsTo'](db[_0x667d('0x103')],{'as':'List','foreignKey':_0x667d('0x14a')});db[_0x667d('0x11b')][_0x667d('0xfd')](db['Pause'],{'as':_0x667d('0x135'),'foreignKey':_0x667d('0x136')});db[_0x667d('0x11b')][_0x667d('0xff')](db['User'],{'as':'Agents','through':'user_has_fax_accounts'});db['FaxApplication'][_0x667d('0xfd')](db[_0x667d('0x13')],{'onDelete':_0x667d('0x155')});db[_0x667d('0x48')][_0x667d('0xfd')](db['FaxQueue'],{'onDelete':_0x667d('0x155')});db['FaxApplication'][_0x667d('0xfd')](db[_0x667d('0x11b')],{'onDelete':_0x667d('0x155')});db[_0x667d('0x48')][_0x667d('0xfd')](db[_0x667d('0x8a')],{'onDelete':_0x667d('0x155'),'foreignKey':'TagId'});db['FaxInteraction'][_0x667d('0xf4')](db[_0x667d('0x159')],{'as':_0x667d('0x13c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x15a')});db['FaxInteraction'][_0x667d('0xfd')](db[_0x667d('0x11b')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x15b')});db[_0x667d('0xfa')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'as':_0x667d('0x141'),'foreignKey':'ContactId'});db[_0x667d('0xfa')][_0x667d('0xfd')](db[_0x667d('0x13')],{'as':_0x667d('0x15c'),'foreignKey':_0x667d('0xf0')});db['FaxInteraction'][_0x667d('0xff')](db['Tag'],{'through':_0x667d('0x15d'),'as':_0x667d('0x15e')});db[_0x667d('0xfa')]['belongsToMany'](db[_0x667d('0x8a')],{'through':_0x667d('0x15d'),'as':_0x667d('0x151')});db[_0x667d('0xfa')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x152'),'through':_0x667d('0x108'),'foreignKey':_0x667d('0x15a')});db[_0x667d('0x159')][_0x667d('0xfd')](db['User'],{'onDelete':_0x667d('0xef'),'as':_0x667d('0x13')});db[_0x667d('0x159')][_0x667d('0xfd')](db[_0x667d('0xfa')],{'as':'Interaction','foreignKey':_0x667d('0x15a')});db[_0x667d('0x159')]['belongsTo'](db[_0x667d('0x6e')],{'onDelete':_0x667d('0xef'),'as':_0x667d('0x141')});db[_0x667d('0x159')][_0x667d('0xfd')](db[_0x667d('0xdf')],{'as':_0x667d('0xdf'),'foreignKey':_0x667d('0x15f')});db[_0x667d('0x159')][_0x667d('0xfd')](db['FaxAccount'],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x15b')});db['FaxQueue']['belongsToMany'](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':_0x667d('0x31')});db[_0x667d('0x4b')][_0x667d('0xff')](db[_0x667d('0xda')],{'through':'team_has_fax_queues','as':_0x667d('0x139')});db[_0x667d('0x4d')][_0x667d('0xfd')](db[_0x667d('0x11b')],{});db[_0x667d('0x4d')]['belongsTo'](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':'ListId'});db[_0x667d('0x4d')][_0x667d('0xfd')](db['CmContact'],{'as':_0x667d('0x141'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x667d('0xfd')](db[_0x667d('0xfa')],{});db[_0x667d('0x4d')][_0x667d('0xfd')](db['FaxMessage'],{});db[_0x667d('0x4d')][_0x667d('0xfd')](db['User'],{});db['FaxQueueReport'][_0x667d('0xfd')](db[_0x667d('0x4b')],{});db[_0x667d('0x4e')][_0x667d('0xf4')](db[_0x667d('0x7c')],{'as':'Dispositions','foreignKey':_0x667d('0x160')});db['SmsAccount'][_0x667d('0xf4')](db[_0x667d('0x147')],{'as':_0x667d('0x148'),'foreignKey':_0x667d('0x160')});db[_0x667d('0x4e')][_0x667d('0xf4')](db[_0x667d('0x52')],{'as':_0x667d('0x13c'),'foreignKey':_0x667d('0x160')});db['SmsAccount'][_0x667d('0xf4')](db[_0x667d('0x50')],{'as':'Interactions'});db['SmsAccount']['hasMany'](db[_0x667d('0x4f')],{'as':_0x667d('0x128')});db[_0x667d('0x4e')]['belongsTo'](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x4e')][_0x667d('0xfd')](db[_0x667d('0x81')],{'as':_0x667d('0x135'),'foreignKey':_0x667d('0x136')});db[_0x667d('0x4e')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':_0x667d('0x161')});db[_0x667d('0x4f')][_0x667d('0xfd')](db[_0x667d('0x13')],{'onDelete':_0x667d('0x155')});db['SmsApplication'][_0x667d('0xfd')](db[_0x667d('0x162')],{'onDelete':'restrict'});db[_0x667d('0x4f')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x667d('0x155')});db[_0x667d('0x4f')][_0x667d('0xfd')](db[_0x667d('0x7f')],{'onDelete':_0x667d('0x155'),'foreignKey':_0x667d('0x134')});db['SmsApplication'][_0x667d('0xfd')](db[_0x667d('0x8a')],{'onDelete':_0x667d('0x155'),'foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0x667d('0x52')],{'as':'Messages','onDelete':_0x667d('0xef'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x667d('0xfd')](db[_0x667d('0x4e')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x160')});db[_0x667d('0x50')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db['SmsInteraction']['belongsTo'](db[_0x667d('0x13')],{'as':'Owner','foreignKey':_0x667d('0xf0')});db['SmsInteraction'][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x667d('0x50')][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x163'),'as':_0x667d('0x151')});db[_0x667d('0x50')]['belongsToMany'](db[_0x667d('0x13')],{'as':_0x667d('0x152'),'through':'user_has_sms_interactions','foreignKey':_0x667d('0x164')});db[_0x667d('0x52')]['belongsTo'](db[_0x667d('0x13')],{'as':_0x667d('0x13')});db['SmsMessage'][_0x667d('0xfd')](db[_0x667d('0x6e')],{'onDelete':'cascade','as':'Contact'});db[_0x667d('0x52')][_0x667d('0xfd')](db[_0x667d('0x50')],{'onDelete':'cascade','as':_0x667d('0x154'),'foreignKey':'SmsInteractionId'});db[_0x667d('0x52')][_0x667d('0xfd')](db['SmsAccount'],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x160')});db[_0x667d('0x162')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x667d('0x165')});db['SmsQueue'][_0x667d('0xff')](db[_0x667d('0xda')],{'through':_0x667d('0x166'),'as':_0x667d('0x139')});db['OpenchannelAccount']['hasMany'](db[_0x667d('0x7c')],{'as':_0x667d('0x146'),'foreignKey':_0x667d('0x167')});db[_0x667d('0x55')][_0x667d('0xf4')](db[_0x667d('0x147')],{'as':_0x667d('0x148'),'foreignKey':_0x667d('0x167')});db[_0x667d('0x55')][_0x667d('0xf4')](db[_0x667d('0x59')],{'as':_0x667d('0x157'),'foreignKey':_0x667d('0x167')});db[_0x667d('0x55')][_0x667d('0xf4')](db[_0x667d('0x5b')],{'as':_0x667d('0x13c'),'foreignKey':_0x667d('0x167')});db[_0x667d('0x55')][_0x667d('0xf4')](db[_0x667d('0x57')],{'as':_0x667d('0x128'),'foreignKey':'OpenchannelAccountId'});db[_0x667d('0x55')][_0x667d('0xfd')](db['CmList'],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x55')]['belongsTo'](db[_0x667d('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x667d('0x136')});db[_0x667d('0x55')]['belongsToMany'](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x667d('0xfd')](db[_0x667d('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x667d('0xfd')](db[_0x667d('0x5d')],{'onDelete':'restrict','foreignKey':_0x667d('0x168')});db[_0x667d('0x57')]['belongsTo'](db[_0x667d('0x55')],{'onDelete':_0x667d('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x667d('0x57')][_0x667d('0xfd')](db[_0x667d('0x7f')],{'onDelete':_0x667d('0x155'),'foreignKey':'IntervalId'});db[_0x667d('0x57')][_0x667d('0xfd')](db[_0x667d('0x8a')],{'onDelete':_0x667d('0x155'),'foreignKey':_0x667d('0x156')});db['OpenchannelInteraction'][_0x667d('0xf4')](db['OpenchannelMessage'],{'as':_0x667d('0x13c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x169')});db[_0x667d('0x59')][_0x667d('0xfd')](db[_0x667d('0x55')],{'as':_0x667d('0x14f'),'foreignKey':'OpenchannelAccountId'});db[_0x667d('0x59')][_0x667d('0xfd')](db['CmContact'],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x59')][_0x667d('0xfd')](db[_0x667d('0x13')],{'as':_0x667d('0x15c'),'foreignKey':'UserId'});db[_0x667d('0x59')][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x16a'),'as':_0x667d('0x15e')});db[_0x667d('0x59')]['belongsToMany'](db[_0x667d('0x8a')],{'through':_0x667d('0x16a'),'as':_0x667d('0x151')});db[_0x667d('0x59')]['belongsToMany'](db['User'],{'as':'Users','through':_0x667d('0x10b'),'foreignKey':_0x667d('0x169')});db[_0x667d('0x5b')][_0x667d('0xfd')](db[_0x667d('0x13')],{'onDelete':_0x667d('0xef'),'as':_0x667d('0x13')});db[_0x667d('0x5b')][_0x667d('0xfd')](db['CmContact'],{'onDelete':_0x667d('0xef'),'as':_0x667d('0x141')});db[_0x667d('0x5b')][_0x667d('0xfd')](db[_0x667d('0x59')],{'onDelete':_0x667d('0xef'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x667d('0x5b')]['belongsTo'](db['Attachment'],{'as':_0x667d('0xdf'),'foreignKey':_0x667d('0x15f')});db[_0x667d('0x5b')][_0x667d('0xfd')](db[_0x667d('0x55')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x167')});db['OpenchannelQueue'][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':'UserOpenchannelQueue','foreignKey':_0x667d('0x168')});db['OpenchannelQueue'][_0x667d('0xff')](db[_0x667d('0xda')],{'through':_0x667d('0x16b'),'as':_0x667d('0x139')});db[_0x667d('0x118')][_0x667d('0xf4')](db[_0x667d('0x7c')],{'as':_0x667d('0x146'),'foreignKey':_0x667d('0x16c')});db[_0x667d('0x118')][_0x667d('0xf4')](db[_0x667d('0x147')],{'as':_0x667d('0x148'),'foreignKey':_0x667d('0x16c')});db[_0x667d('0x118')]['hasMany'](db[_0x667d('0x6b')],{'as':_0x667d('0x16d')});db[_0x667d('0x118')]['hasMany'](db['ChatInteraction'],{'as':_0x667d('0x157')});db[_0x667d('0x118')][_0x667d('0xf4')](db[_0x667d('0x61')],{'as':_0x667d('0x128')});db[_0x667d('0x118')][_0x667d('0xf4')](db[_0x667d('0x65')],{'as':'Messages'});db[_0x667d('0x118')][_0x667d('0xfd')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x667d('0x118')][_0x667d('0xfd')](db[_0x667d('0x7f')],{'as':_0x667d('0x7f'),'foreignKey':_0x667d('0x134')});db[_0x667d('0x118')]['belongsTo'](db['Pause'],{'as':_0x667d('0x135'),'foreignKey':_0x667d('0x136')});db[_0x667d('0x118')]['belongsToMany'](db[_0x667d('0x13')],{'as':'Agents','through':_0x667d('0x11a')});db[_0x667d('0x16e')][_0x667d('0xfd')](db['OpenchannelAccount'],{});db[_0x667d('0x16e')][_0x667d('0xfd')](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x16e')][_0x667d('0xfd')](db['CmContact'],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db['OpenchannelQueueReport']['belongsTo'](db[_0x667d('0x59')],{});db[_0x667d('0x16e')][_0x667d('0xfd')](db[_0x667d('0x5b')],{});db[_0x667d('0x16e')]['belongsTo'](db[_0x667d('0x13')],{});db[_0x667d('0x16e')][_0x667d('0xfd')](db[_0x667d('0x5d')],{});db[_0x667d('0x61')]['belongsTo'](db[_0x667d('0x13')],{'as':_0x667d('0x16f'),'foreignKey':_0x667d('0xf0'),'onDelete':'restrict'});db[_0x667d('0x61')][_0x667d('0xfd')](db[_0x667d('0x68')],{'as':_0x667d('0x170'),'foreignKey':_0x667d('0x171'),'onDelete':_0x667d('0x155')});db[_0x667d('0x61')][_0x667d('0xfd')](db[_0x667d('0x118')],{'as':_0x667d('0x172'),'foreignKey':_0x667d('0x16c'),'onDelete':_0x667d('0x155')});db[_0x667d('0x61')][_0x667d('0xfd')](db[_0x667d('0x8a')],{'onDelete':_0x667d('0x155'),'foreignKey':'TagId'});db[_0x667d('0x63')][_0x667d('0xf4')](db[_0x667d('0x65')],{'as':_0x667d('0x13c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x173')});db[_0x667d('0x63')][_0x667d('0xfd')](db[_0x667d('0x118')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x16c')});db[_0x667d('0x63')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'as':'Contact','foreignKey':_0x667d('0x142')});db['ChatInteraction'][_0x667d('0xfd')](db['User'],{'as':'Owner','foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0x667d('0x8a')],{'through':_0x667d('0x174'),'as':'Tags'});db[_0x667d('0x63')][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x174'),'as':_0x667d('0x151')});db[_0x667d('0x63')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x152'),'through':'user_has_chat_interactions','foreignKey':_0x667d('0x173')});db[_0x667d('0x65')]['belongsTo'](db[_0x667d('0x13')],{'onDelete':_0x667d('0xef'),'as':'User'});db[_0x667d('0x65')][_0x667d('0xfd')](db['CmContact'],{'onDelete':_0x667d('0xef'),'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x65')]['belongsTo'](db[_0x667d('0x63')],{'onDelete':'cascade','as':_0x667d('0x154'),'foreignKey':_0x667d('0x173')});db['ChatMessage']['belongsTo'](db[_0x667d('0xdf')],{'as':_0x667d('0xdf'),'foreignKey':_0x667d('0x15f')});db[_0x667d('0x65')][_0x667d('0xfd')](db[_0x667d('0x118')],{'as':_0x667d('0x14f'),'foreignKey':'ChatWebsiteId'});db[_0x667d('0x67')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'onDelete':_0x667d('0xef'),'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db['ChatOfflineMessage'][_0x667d('0xfd')](db[_0x667d('0x118')],{'as':_0x667d('0x14f'),'foreignKey':'ChatWebsiteId'});db[_0x667d('0x68')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':'UserChatQueue','hooks':!![]});db[_0x667d('0x68')][_0x667d('0xff')](db['Team'],{'through':_0x667d('0x175'),'as':_0x667d('0x139')});db['ChatGroup'][_0x667d('0xf4')](db[_0x667d('0xc9')],{'as':_0x667d('0x13c'),'foreignKey':_0x667d('0x176'),'onDelete':_0x667d('0xef')});db[_0x667d('0x177')]['belongsToMany'](db[_0x667d('0x13')],{'as':_0x667d('0x12b'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x667d('0xfd')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x667d('0x16c')});db[_0x667d('0x6d')][_0x667d('0xf4')](db[_0x667d('0x6e')],{'as':_0x667d('0x101'),'foreignKey':'CompanyId'});db[_0x667d('0x6e')][_0x667d('0xf4')](db[_0x667d('0x70')],{'as':'Hoppers','foreignKey':_0x667d('0x142')});db[_0x667d('0x6e')][_0x667d('0xf4')](db[_0x667d('0x178')],{'as':_0x667d('0xf5'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x6e')][_0x667d('0xf4')](db['CmHopperHistory'],{'as':_0x667d('0x12e'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x6e')][_0x667d('0xf4')](db[_0x667d('0xf7')],{'as':_0x667d('0xf7'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x6e')][_0x667d('0xf4')](db[_0x667d('0xcc')],{'as':_0x667d('0x12f'),'foreignKey':_0x667d('0x142')});db['CmContact'][_0x667d('0xf4')](db['OpenchannelInteraction'],{'as':_0x667d('0x10a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x667d('0x6e')][_0x667d('0xf4')](db[_0x667d('0x63')],{'as':'ChatInteractions','foreignKey':_0x667d('0x142'),'onDelete':_0x667d('0x155')});db['CmContact']['hasMany'](db[_0x667d('0x50')],{'as':_0x667d('0xf9'),'foreignKey':_0x667d('0x142'),'onDelete':_0x667d('0x155')});db[_0x667d('0x6e')][_0x667d('0xf4')](db[_0x667d('0xfa')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x667d('0x6e')]['hasMany'](db[_0x667d('0x3d')],{'as':_0x667d('0xfc'),'foreignKey':_0x667d('0x142'),'onDelete':'restrict'});db[_0x667d('0x6e')][_0x667d('0xfd')](db[_0x667d('0x6d')],{'as':_0x667d('0x179'),'foreignKey':_0x667d('0x17a')});db['CmContact'][_0x667d('0xfd')](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a'),'onDelete':_0x667d('0xef')});db[_0x667d('0x6e')][_0x667d('0xff')](db['User'],{'as':'Users','through':_0x667d('0x102')});db[_0x667d('0x6e')][_0x667d('0xff')](db[_0x667d('0x8a')],{'as':_0x667d('0x15e'),'through':'cm_contact_has_tags'});db[_0x667d('0x6e')][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x17b'),'as':_0x667d('0x151')});db[_0x667d('0x70')]['belongsTo'](db[_0x667d('0x6e')],{'as':_0x667d('0x141'),'foreignKey':'ContactId','onDelete':_0x667d('0xef')});db['CmHopper']['belongsTo'](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a'),'onDelete':_0x667d('0xef')});db[_0x667d('0x70')]['belongsTo'](db[_0x667d('0x13')],{'as':_0x667d('0x16f'),'foreignKey':_0x667d('0xf0')});db[_0x667d('0x70')]['belongsTo'](db[_0x667d('0x10c')],{'as':_0x667d('0x170'),'foreignKey':_0x667d('0x12c'),'onDelete':_0x667d('0xef')});db[_0x667d('0x70')][_0x667d('0xfd')](db[_0x667d('0xdc')],{'as':_0x667d('0xdc'),'foreignKey':_0x667d('0x17c'),'onDelete':_0x667d('0xef')});db['CmHopper'][_0x667d('0xfd')](db['User'],{'as':_0x667d('0x15c'),'foreignKey':_0x667d('0x17d')});db[_0x667d('0x72')][_0x667d('0xfd')](db['CmContact'],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142'),'onDelete':_0x667d('0xef')});db[_0x667d('0x72')][_0x667d('0xfd')](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a'),'onDelete':_0x667d('0xef')});db[_0x667d('0x72')][_0x667d('0xfd')](db[_0x667d('0x10c')],{'as':_0x667d('0x170'),'foreignKey':_0x667d('0x12c'),'onDelete':_0x667d('0xef')});db[_0x667d('0x72')][_0x667d('0xfd')](db[_0x667d('0xdc')],{'as':_0x667d('0xdc'),'foreignKey':_0x667d('0x17c'),'onDelete':'cascade'});db['Automation'][_0x667d('0xf4')](db[_0x667d('0x7e')],{'as':{'plural':_0x667d('0x17e'),'singular':_0x667d('0x17f')},'foreignKey':'AutomationAllId','onDelete':_0x667d('0xef'),'hooks':!![]});db[_0x667d('0x79')][_0x667d('0xf4')](db[_0x667d('0x7e')],{'as':{'plural':'Any','singular':_0x667d('0x180')},'foreignKey':_0x667d('0x181'),'onDelete':_0x667d('0xef'),'hooks':!![]});db['Automation'][_0x667d('0xf4')](db[_0x667d('0x77')],{'as':_0x667d('0x182'),'foreignKey':_0x667d('0x183'),'onDelete':'cascade','hooks':!![]});db[_0x667d('0x7f')][_0x667d('0xf4')](db[_0x667d('0x7f')],{'as':_0x667d('0x184'),'foreignKey':_0x667d('0x134'),'onDelete':_0x667d('0xef'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x667d('0x18')],{'as':'Extensions','foreignKey':_0x667d('0x134'),'onDelete':'restrict'});db[_0x667d('0x7f')][_0x667d('0xf4')](db['MailApplication'],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0x667d('0x7f')][_0x667d('0xf4')](db[_0x667d('0x61')],{'as':_0x667d('0x185'),'foreignKey':'IntervalId'});db['Interval'][_0x667d('0xf4')](db[_0x667d('0x48')],{'as':'FaxApplications','foreignKey':_0x667d('0x134')});db[_0x667d('0x7f')][_0x667d('0xf4')](db[_0x667d('0x4f')],{'as':_0x667d('0x186'),'foreignKey':_0x667d('0x134')});db[_0x667d('0x87')]['belongsTo'](db[_0x667d('0x39')],{});db[_0x667d('0x87')][_0x667d('0xfd')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0x667d('0x87')][_0x667d('0xfd')](db[_0x667d('0x187')],{'foreignKey':_0x667d('0x188')});db[_0x667d('0x89')][_0x667d('0xff')](db[_0x667d('0x1a')],{'as':_0x667d('0x189'),'through':'moh_has_sounds','onDelete':_0x667d('0x155')});db[_0x667d('0x8a')][_0x667d('0xff')](db[_0x667d('0x6e')],{'through':_0x667d('0x17b')});db[_0x667d('0x8a')][_0x667d('0xff')](db[_0x667d('0x63')],{'through':_0x667d('0x174')});db[_0x667d('0x8a')][_0x667d('0xff')](db[_0x667d('0x3d')],{'through':_0x667d('0x150')});db['Tag']['belongsToMany'](db[_0x667d('0x50')],{'through':_0x667d('0x163')});db[_0x667d('0x8a')][_0x667d('0xff')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x667d('0x8a')][_0x667d('0xff')](db[_0x667d('0x59')],{'through':_0x667d('0x16a')});db[_0x667d('0x8d')]['hasMany'](db[_0x667d('0x7e')],{'as':{'plural':_0x667d('0x18a'),'singular':_0x667d('0x18b')},'foreignKey':_0x667d('0x18c'),'onDelete':_0x667d('0xef'),'hooks':!![]});db[_0x667d('0x8d')][_0x667d('0xf4')](db['Condition'],{'as':{'plural':_0x667d('0x18d'),'singular':_0x667d('0x18e')},'foreignKey':_0x667d('0x18f'),'onDelete':'cascade','hooks':!![]});db[_0x667d('0x8d')]['hasMany'](db[_0x667d('0x77')],{'as':_0x667d('0x182'),'foreignKey':'TriggerId','onDelete':_0x667d('0xef'),'hooks':!![]});db[_0x667d('0x187')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x667d('0x190'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x188'),'hooks':!![]});db[_0x667d('0x94')][_0x667d('0xf4')](db['AnalyticFieldReport'],{'as':_0x667d('0x190'),'onDelete':'cascade','foreignKey':_0x667d('0x191')});db[_0x667d('0x98')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x667d('0x190'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x192')});db[_0x667d('0x9a')]['belongsTo'](db[_0x667d('0x98')],{'foreignKey':'MetricId'});db['SalesforceAccount']['hasMany'](db[_0x667d('0x9f')],{'as':_0x667d('0x193'),'onDelete':'cascade','foreignKey':_0x667d('0x194')});db[_0x667d('0x9f')][_0x667d('0xf4')](db[_0x667d('0xa1')],{'as':_0x667d('0x195'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x196')});db[_0x667d('0x9f')][_0x667d('0xf4')](db[_0x667d('0xa1')],{'as':'Descriptions','onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x197')});db[_0x667d('0x9f')][_0x667d('0xf4')](db[_0x667d('0xa1')],{'as':_0x667d('0x190'),'onDelete':'cascade','foreignKey':_0x667d('0x198')});db[_0x667d('0x9f')][_0x667d('0xfd')](db[_0x667d('0x9d')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x194')});db['SalesforceField'][_0x667d('0xf4')](db[_0x667d('0xa1')],{'as':'Subject','foreignKey':_0x667d('0x196')});db[_0x667d('0xa1')][_0x667d('0xf4')](db[_0x667d('0xa1')],{'as':'Description','foreignKey':_0x667d('0x197')});db[_0x667d('0xa1')][_0x667d('0xf4')](db['SalesforceField'],{'as':_0x667d('0x199'),'foreignKey':_0x667d('0x198')});db[_0x667d('0xa1')][_0x667d('0xfd')](db[_0x667d('0x8f')],{'as':_0x667d('0x8f'),'foreignKey':_0x667d('0x19a')});db['SugarcrmAccount']['hasMany'](db[_0x667d('0x19b')],{'as':_0x667d('0x193'),'onDelete':_0x667d('0xef'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0x667d('0xf4')](db['SugarcrmField'],{'as':_0x667d('0x195'),'onDelete':_0x667d('0xef'),'foreignKey':'SubjectId'});db[_0x667d('0x19b')][_0x667d('0xf4')](db['SugarcrmField'],{'as':_0x667d('0x19c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x197')});db[_0x667d('0x19b')][_0x667d('0xf4')](db[_0x667d('0xa5')],{'as':_0x667d('0x190'),'onDelete':_0x667d('0xef'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x667d('0xfd')](db[_0x667d('0xa2')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x194')});db['SugarcrmField'][_0x667d('0xf4')](db[_0x667d('0xa5')],{'as':_0x667d('0x19d'),'foreignKey':'SubjectId'});db[_0x667d('0xa5')][_0x667d('0xf4')](db[_0x667d('0xa5')],{'as':_0x667d('0x19e'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xa5')][_0x667d('0xf4')](db[_0x667d('0xa5')],{'as':_0x667d('0x199'),'foreignKey':_0x667d('0x198')});db[_0x667d('0xa5')]['belongsTo'](db[_0x667d('0x8f')],{'as':_0x667d('0x8f'),'foreignKey':'VariableId'});db[_0x667d('0x19f')]['hasMany'](db['DeskConfiguration'],{'as':_0x667d('0x193'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x194')});db[_0x667d('0x1a0')][_0x667d('0xf4')](db[_0x667d('0xa9')],{'as':_0x667d('0x195'),'onDelete':'cascade','foreignKey':_0x667d('0x196')});db[_0x667d('0x1a0')][_0x667d('0xf4')](db[_0x667d('0xa9')],{'as':_0x667d('0x19c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x197')});db[_0x667d('0x1a0')]['hasMany'](db[_0x667d('0xa9')],{'as':_0x667d('0x190'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x198')});db[_0x667d('0x1a0')][_0x667d('0xfd')](db[_0x667d('0x19f')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x194')});db[_0x667d('0x1a0')][_0x667d('0xff')](db['Tag'],{'through':_0x667d('0x1a1')});db[_0x667d('0xa9')][_0x667d('0xf4')](db[_0x667d('0xa9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x667d('0xa9')]['hasMany'](db[_0x667d('0xa9')],{'as':_0x667d('0x19e'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xa9')][_0x667d('0xf4')](db['DeskField'],{'as':_0x667d('0x199'),'foreignKey':'FieldId'});db[_0x667d('0xa9')]['belongsTo'](db[_0x667d('0x8f')],{'as':_0x667d('0x8f'),'foreignKey':_0x667d('0x19a')});db[_0x667d('0xaa')][_0x667d('0xf4')](db[_0x667d('0xab')],{'as':_0x667d('0x193'),'onDelete':_0x667d('0xef'),'foreignKey':'AccountId'});db['ZohoConfiguration']['hasMany'](db[_0x667d('0xad')],{'as':_0x667d('0x195'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x196')});db['ZohoConfiguration'][_0x667d('0xf4')](db[_0x667d('0xad')],{'as':_0x667d('0x19c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xab')]['hasMany'](db[_0x667d('0xad')],{'as':_0x667d('0x190'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x667d('0xab')][_0x667d('0xfd')](db[_0x667d('0xaa')],{'as':'Account','foreignKey':_0x667d('0x194')});db[_0x667d('0xad')][_0x667d('0xf4')](db['ZohoField'],{'as':_0x667d('0x19d'),'foreignKey':_0x667d('0x196')});db[_0x667d('0xad')][_0x667d('0xf4')](db[_0x667d('0xad')],{'as':_0x667d('0x19e'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xad')][_0x667d('0xf4')](db[_0x667d('0xad')],{'as':_0x667d('0x199'),'foreignKey':'FieldId'});db[_0x667d('0xad')][_0x667d('0xfd')](db[_0x667d('0x8f')],{'as':_0x667d('0x8f'),'foreignKey':_0x667d('0x19a')});db[_0x667d('0x1a2')]['hasMany'](db[_0x667d('0x1a3')],{'as':_0x667d('0x193'),'onDelete':'cascade','foreignKey':_0x667d('0x194')});db[_0x667d('0x1a3')][_0x667d('0xf4')](db[_0x667d('0x1a4')],{'as':'Subjects','foreignKey':_0x667d('0x196')});db[_0x667d('0x1a3')]['hasMany'](db[_0x667d('0x1a4')],{'as':_0x667d('0x19c'),'foreignKey':_0x667d('0x197')});db[_0x667d('0x1a3')][_0x667d('0xf4')](db['ZendeskField'],{'as':_0x667d('0x190'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x667d('0xfd')](db[_0x667d('0x1a2')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x194')});db['ZendeskConfiguration'][_0x667d('0xff')](db['Tag'],{'through':_0x667d('0x1a5')});db[_0x667d('0x1a4')][_0x667d('0xf4')](db['ZendeskField'],{'as':_0x667d('0x19d'),'foreignKey':_0x667d('0x196')});db[_0x667d('0x1a4')][_0x667d('0xf4')](db[_0x667d('0x1a4')],{'as':_0x667d('0x19e'),'foreignKey':'DescriptionId'});db[_0x667d('0x1a4')][_0x667d('0xf4')](db[_0x667d('0x1a4')],{'as':_0x667d('0x199'),'foreignKey':'FieldId'});db[_0x667d('0x1a4')][_0x667d('0xfd')](db[_0x667d('0x8f')],{'as':'Variable','foreignKey':_0x667d('0x19a')});db[_0x667d('0xb2')][_0x667d('0xf4')](db[_0x667d('0xb4')],{'as':_0x667d('0x193'),'onDelete':_0x667d('0xef'),'foreignKey':'AccountId'});db[_0x667d('0xb4')][_0x667d('0xf4')](db[_0x667d('0xb6')],{'as':_0x667d('0x195'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x196')});db['FreshdeskConfiguration'][_0x667d('0xf4')](db['FreshdeskField'],{'as':_0x667d('0x19c'),'onDelete':_0x667d('0xef'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x667d('0xf4')](db[_0x667d('0xb6')],{'as':_0x667d('0x190'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x667d('0xb4')]['belongsTo'](db[_0x667d('0xb2')],{'as':'Account','foreignKey':_0x667d('0x194')});db[_0x667d('0xb4')]['belongsToMany'](db[_0x667d('0x8a')],{'through':_0x667d('0x1a6')});db[_0x667d('0xb6')][_0x667d('0xf4')](db['FreshdeskField'],{'as':_0x667d('0x19d'),'foreignKey':_0x667d('0x196')});db[_0x667d('0xb6')][_0x667d('0xf4')](db[_0x667d('0xb6')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x667d('0xf4')](db['FreshdeskField'],{'as':_0x667d('0x199'),'foreignKey':'FieldId'});db[_0x667d('0xb6')][_0x667d('0xfd')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x667d('0xb8')][_0x667d('0xf4')](db[_0x667d('0x1a7')],{'as':_0x667d('0x193'),'onDelete':'cascade','foreignKey':_0x667d('0x194')});db[_0x667d('0x1a7')]['hasMany'](db['VtigerField'],{'as':'Subjects','foreignKey':_0x667d('0x196')});db[_0x667d('0x1a7')][_0x667d('0xf4')](db[_0x667d('0x1a8')],{'as':'Descriptions','foreignKey':_0x667d('0x197')});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0x667d('0x190'),'foreignKey':_0x667d('0x198')});db['VtigerConfiguration'][_0x667d('0xfd')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x667d('0x194')});db[_0x667d('0x1a7')][_0x667d('0xff')](db[_0x667d('0x8a')],{'through':_0x667d('0x1a9')});db[_0x667d('0x1a8')][_0x667d('0xf4')](db[_0x667d('0x1a8')],{'as':_0x667d('0x19d'),'foreignKey':_0x667d('0x196')});db[_0x667d('0x1a8')][_0x667d('0xf4')](db['VtigerField'],{'as':_0x667d('0x19e'),'foreignKey':_0x667d('0x197')});db[_0x667d('0x1a8')][_0x667d('0xf4')](db[_0x667d('0x1a8')],{'as':_0x667d('0x199'),'foreignKey':_0x667d('0x198')});db[_0x667d('0x1a8')][_0x667d('0xfd')](db[_0x667d('0x8f')],{'as':_0x667d('0x8f'),'foreignKey':'VariableId'});db[_0x667d('0x1aa')][_0x667d('0xf4')](db[_0x667d('0xbd')],{'as':'Configurations','onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x194')});db[_0x667d('0xbd')][_0x667d('0xf4')](db[_0x667d('0xbe')],{'as':'Subjects','foreignKey':_0x667d('0x196')});db[_0x667d('0xbd')][_0x667d('0xf4')](db[_0x667d('0xbe')],{'as':_0x667d('0x19c'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xbd')][_0x667d('0xf4')](db[_0x667d('0xbe')],{'as':'Fields','foreignKey':_0x667d('0x198')});db[_0x667d('0xbd')]['belongsTo'](db['ServicenowAccount'],{'as':_0x667d('0x14f'),'foreignKey':'AccountId'});db[_0x667d('0xbe')][_0x667d('0xf4')](db[_0x667d('0xbe')],{'as':_0x667d('0x19d'),'foreignKey':_0x667d('0x196')});db[_0x667d('0xbe')][_0x667d('0xf4')](db[_0x667d('0xbe')],{'as':_0x667d('0x19e'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xbe')][_0x667d('0xf4')](db[_0x667d('0xbe')],{'as':_0x667d('0x199'),'foreignKey':_0x667d('0x198')});db[_0x667d('0xbe')][_0x667d('0xfd')](db[_0x667d('0x8f')],{'as':'Variable','foreignKey':_0x667d('0x19a')});db['Dynamics365Account'][_0x667d('0xf4')](db[_0x667d('0xc2')],{'as':_0x667d('0x193'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x194')});db['Dynamics365Configuration'][_0x667d('0xf4')](db[_0x667d('0xc4')],{'as':_0x667d('0x195'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x196')});db['Dynamics365Configuration'][_0x667d('0xf4')](db['Dynamics365Field'],{'as':_0x667d('0x19c'),'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x197')});db[_0x667d('0xc2')][_0x667d('0xf4')](db[_0x667d('0xc4')],{'as':_0x667d('0x190'),'onDelete':'cascade','foreignKey':'FieldId'});db['Dynamics365Configuration']['belongsTo'](db[_0x667d('0xc0')],{'as':_0x667d('0x14f'),'foreignKey':_0x667d('0x194')});db[_0x667d('0xc4')]['hasMany'](db[_0x667d('0xc4')],{'as':_0x667d('0x19d'),'foreignKey':_0x667d('0x196')});db['Dynamics365Field']['hasMany'](db[_0x667d('0xc4')],{'as':_0x667d('0x19e'),'foreignKey':_0x667d('0x197')});db['Dynamics365Field'][_0x667d('0xf4')](db[_0x667d('0xc4')],{'as':'Field','foreignKey':_0x667d('0x198')});db[_0x667d('0xc4')][_0x667d('0xfd')](db[_0x667d('0x8f')],{'as':'Variable','foreignKey':_0x667d('0x19a')});db[_0x667d('0x1ab')][_0x667d('0xfd')](db[_0x667d('0x118')],{});db[_0x667d('0x1ab')]['belongsTo'](db[_0x667d('0x103')],{'as':'List','foreignKey':_0x667d('0x14a')});db[_0x667d('0x1ab')][_0x667d('0xfd')](db['CmContact'],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db[_0x667d('0x1ab')][_0x667d('0xfd')](db[_0x667d('0x63')],{});db[_0x667d('0x1ab')][_0x667d('0xfd')](db[_0x667d('0x65')],{});db[_0x667d('0x1ab')][_0x667d('0xfd')](db[_0x667d('0x13')],{});db['ChatQueueReport'][_0x667d('0xfd')](db['ChatQueue'],{});db[_0x667d('0xc9')][_0x667d('0xfd')](db['User'],{'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x1ac')});db[_0x667d('0xc9')][_0x667d('0xfd')](db[_0x667d('0x13')],{'onDelete':_0x667d('0xef'),'foreignKey':_0x667d('0x1ad')});db[_0x667d('0xcc')][_0x667d('0xf4')](db[_0x667d('0xcb')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x667d('0xcc')][_0x667d('0xf4')](db[_0x667d('0x1ae')],{'foreignKey':_0x667d('0x1af'),'onDelete':_0x667d('0xef')});db['SmsQueueReport'][_0x667d('0xfd')](db[_0x667d('0x4e')],{});db['SmsQueueReport'][_0x667d('0xfd')](db[_0x667d('0x103')],{'as':_0x667d('0x149'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0xce')][_0x667d('0xfd')](db[_0x667d('0x6e')],{'as':_0x667d('0x141'),'foreignKey':_0x667d('0x142')});db[_0x667d('0xce')]['belongsTo'](db[_0x667d('0x50')],{});db[_0x667d('0xce')][_0x667d('0xfd')](db[_0x667d('0x52')],{});db[_0x667d('0xce')][_0x667d('0xfd')](db[_0x667d('0x13')],{});db[_0x667d('0xce')][_0x667d('0xfd')](db['SmsQueue'],{});db['JscriptyProject'][_0x667d('0xf4')](db[_0x667d('0xcc')],{'foreignKey':'ProjectId'});db[_0x667d('0xd4')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x667d('0x1b0')});db[_0x667d('0xd4')]['hasMany'](db[_0x667d('0x1ae')],{'foreignKey':_0x667d('0x1b0')});db[_0x667d('0xd7')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x152'),'through':_0x667d('0x123')});db[_0x667d('0xda')][_0x667d('0xff')](db['User'],{'as':_0x667d('0x138'),'through':'user_has_teams'});db['Team'][_0x667d('0xff')](db[_0x667d('0x10c')],{'through':_0x667d('0x1b1'),'as':'VoiceQueues'});db[_0x667d('0xda')][_0x667d('0xff')](db['MailQueue'],{'through':_0x667d('0x14d'),'as':_0x667d('0x10f')});db['Team'][_0x667d('0xff')](db[_0x667d('0x68')],{'through':_0x667d('0x175'),'as':_0x667d('0x111')});db[_0x667d('0xda')][_0x667d('0xff')](db['FaxQueue'],{'through':_0x667d('0x1b2'),'as':_0x667d('0x1b3')});db[_0x667d('0xda')][_0x667d('0xff')](db[_0x667d('0x162')],{'through':_0x667d('0x166'),'as':_0x667d('0x112')});db[_0x667d('0xda')][_0x667d('0xff')](db[_0x667d('0x5d')],{'through':_0x667d('0x16b'),'as':'OpenchannelQueues'});db[_0x667d('0xdc')][_0x667d('0xf4')](db[_0x667d('0x70')],{'as':_0x667d('0x12d'),'foreignKey':'CampaignId'});db[_0x667d('0xdc')][_0x667d('0xf4')](db[_0x667d('0x178')],{'as':_0x667d('0xf5'),'foreignKey':_0x667d('0x17c')});db[_0x667d('0xdc')]['hasMany'](db[_0x667d('0xf6')],{'as':_0x667d('0x12e'),'foreignKey':'CampaignId'});db[_0x667d('0xdc')][_0x667d('0xf4')](db[_0x667d('0x72')],{'as':'HopperBlacks','foreignKey':_0x667d('0x17c')});db[_0x667d('0xdc')][_0x667d('0xfd')](db[_0x667d('0x130')],{'as':_0x667d('0x130'),'foreignKey':_0x667d('0x131')});db['Campaign'][_0x667d('0xfd')](db[_0x667d('0x130')],{'as':_0x667d('0x132'),'foreignKey':_0x667d('0x133')});db[_0x667d('0xdc')][_0x667d('0xfd')](db['Interval'],{'as':_0x667d('0x7f'),'foreignKey':_0x667d('0x134')});db[_0x667d('0xdc')][_0x667d('0xfd')](db[_0x667d('0xd7')],{'as':'SquareProject','foreignKey':_0x667d('0x1b4')});db['Campaign'][_0x667d('0xff')](db[_0x667d('0x103')],{'as':_0x667d('0x104'),'through':_0x667d('0x1b5')});db[_0x667d('0xdc')][_0x667d('0xff')](db[_0x667d('0x103')],{'as':_0x667d('0x13a'),'through':_0x667d('0x1b6')});db['MailTransferReport']['belongsTo'](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x667d('0x3d')],{});db[_0x667d('0xe1')][_0x667d('0xfd')](db[_0x667d('0x39')],{'foreignKey':_0x667d('0x1b7'),'as':_0x667d('0x1b8')});db['MailTransferReport']['belongsTo'](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1b9'),'as':'FromAgent'});db[_0x667d('0xe1')][_0x667d('0xfd')](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1ba'),'as':'ToAgent'});db[_0x667d('0xe1')][_0x667d('0xfd')](db[_0x667d('0x14c')],{'foreignKey':_0x667d('0x1bb'),'as':_0x667d('0x1bc')});db['MailTransferReport'][_0x667d('0xfd')](db[_0x667d('0x39')],{'foreignKey':_0x667d('0x1bd'),'as':'ToAccount'});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0x667d('0x1be')][_0x667d('0xfd')](db[_0x667d('0x63')],{});db[_0x667d('0x1be')][_0x667d('0xfd')](db[_0x667d('0x118')],{'foreignKey':_0x667d('0x1bf'),'as':_0x667d('0x1b8')});db[_0x667d('0x1be')]['belongsTo'](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1b9'),'as':_0x667d('0x1c0')});db[_0x667d('0x1be')]['belongsTo'](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1ba'),'as':_0x667d('0x1c1')});db[_0x667d('0x1be')][_0x667d('0xfd')](db['ChatQueue'],{'foreignKey':_0x667d('0x1c2'),'as':_0x667d('0x1bc')});db['ChatTransferReport'][_0x667d('0xfd')](db[_0x667d('0x118')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db['FaxTransferReport']['belongsTo'](db[_0x667d('0x159')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0x667d('0xe4')][_0x667d('0xfd')](db[_0x667d('0x11b')],{'foreignKey':_0x667d('0x1c3'),'as':_0x667d('0x1b8')});db['FaxTransferReport'][_0x667d('0xfd')](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1b9'),'as':_0x667d('0x1c0')});db[_0x667d('0xe4')][_0x667d('0xfd')](db['User'],{'foreignKey':'ToUserId','as':_0x667d('0x1c1')});db[_0x667d('0xe4')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x667d('0x1c4'),'as':_0x667d('0x1bc')});db['FaxTransferReport'][_0x667d('0xfd')](db[_0x667d('0x11b')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x667d('0xe6')][_0x667d('0xfd')](db[_0x667d('0x5b')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x667d('0x59')],{});db['OpenchannelTransferReport'][_0x667d('0xfd')](db[_0x667d('0x55')],{'foreignKey':_0x667d('0x1c5'),'as':_0x667d('0x1b8')});db[_0x667d('0xe6')][_0x667d('0xfd')](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1b9'),'as':_0x667d('0x1c0')});db[_0x667d('0xe6')][_0x667d('0xfd')](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1ba'),'as':_0x667d('0x1c1')});db[_0x667d('0xe6')][_0x667d('0xfd')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0x667d('0x1bc')});db[_0x667d('0xe6')][_0x667d('0xfd')](db[_0x667d('0x55')],{'foreignKey':_0x667d('0x1c6'),'as':_0x667d('0x1c7')});db[_0x667d('0x1c8')][_0x667d('0xfd')](db[_0x667d('0x52')],{});db[_0x667d('0x1c8')][_0x667d('0xfd')](db[_0x667d('0x50')],{});db[_0x667d('0x1c8')][_0x667d('0xfd')](db[_0x667d('0x4e')],{'foreignKey':_0x667d('0x1c9'),'as':_0x667d('0x1b8')});db[_0x667d('0x1c8')][_0x667d('0xfd')](db[_0x667d('0x13')],{'foreignKey':_0x667d('0x1b9'),'as':_0x667d('0x1c0')});db[_0x667d('0x1c8')]['belongsTo'](db['User'],{'foreignKey':_0x667d('0x1ba'),'as':_0x667d('0x1c1')});db[_0x667d('0x1c8')][_0x667d('0xfd')](db['SmsQueue'],{'foreignKey':_0x667d('0x1ca'),'as':_0x667d('0x1bc')});db[_0x667d('0x1c8')][_0x667d('0xfd')](db[_0x667d('0x4e')],{'foreignKey':_0x667d('0x1cb'),'as':_0x667d('0x1c7')});db[_0x667d('0x103')][_0x667d('0xf4')](db['Disposition'],{'as':_0x667d('0x146'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x103')][_0x667d('0xf4')](db[_0x667d('0x75')],{'as':_0x667d('0x1cc'),'foreignKey':_0x667d('0x14a')});db['CmList']['hasMany'](db[_0x667d('0x6e')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x667d('0x14a')});db[_0x667d('0x103')][_0x667d('0xf4')](db[_0x667d('0x178')],{'as':'HopperFinals','foreignKey':_0x667d('0x14a')});db[_0x667d('0x103')][_0x667d('0xf4')](db['CmHopperHistory'],{'as':_0x667d('0x1cd'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x103')][_0x667d('0xf4')](db['ReportAgentPreview'],{'as':_0x667d('0xf7'),'foreignKey':_0x667d('0x14a')});db[_0x667d('0x103')][_0x667d('0xff')](db['VoiceQueue'],{'as':_0x667d('0x1ce'),'through':_0x667d('0x137')});db[_0x667d('0x103')][_0x667d('0xff')](db[_0x667d('0x13')],{'as':_0x667d('0x138'),'through':_0x667d('0x105')});db[_0x667d('0x115')][_0x667d('0xf4')](db['VoiceExtension'],{'as':_0x667d('0x1cf'),'onDelete':_0x667d('0x155')});db[_0x667d('0x115')]['belongsToMany'](db['User'],{'as':_0x667d('0x138'),'through':_0x667d('0x117')});db['UserProfile'][_0x667d('0xf4')](db[_0x667d('0x13')],{'as':'Users','foreignKey':'userProfileId'});db[_0x667d('0xfe')]['hasMany'](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x667d('0x1d0'),'onDelete':_0x667d('0xef')});db[_0x667d('0xeb')][_0x667d('0xf4')](db['UserProfileResource'],{'as':_0x667d('0x1d1'),'foreignKey':_0x667d('0x1d2'),'onDelete':_0x667d('0xef')});module[_0x667d('0x1d3')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x31e3=['HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','VoiceAgentReport','ContactId','MailAccountId','MailServerIn','Imap','Smtp','Disposition','Dispositions','Answers','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachment','Attachments','Contact','Interaction','restrict','TagId','Items','FaxAccountId','FaxApplication','FaxMessage','user_has_fax_accounts','FaxInteractionId','Account','fax_interaction_has_tags','AttachmentId','SmsAccountId','Interactions','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ChatWebsiteId','ProactiveActions','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','Members','ChatProactiveAction','Contacts','Hoppers','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Agent','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Descriptions','FieldId','Subject','SubjectId','Description','DescriptionId','Field','Variable','VariableId','Subjects','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','Dynamics365Field','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','ProjectId','JscriptyAnswerReport','VoiceQueues','team_has_fax_queues','SmsQueues','team_has_openchannel_queues','SquareProjectId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','Queues','user_has_voice_prefixes','UserProfileSections','Resources','sectionId','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','127.0.0.1','database','username','options','password','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','Tag','../api/template/template.model','Trigger','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/integration/integration.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','User','hasOne','cascade','hasMany','Recordings','VoiceQueuesRt','UserId','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','belongsTo','userProfileId','belongsToMany','ChatGroup','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueue','OpenchannelQueue','OpenchannelQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','VoiceContext','Applications','Sounds','VoiceQueueId','HopperHistories'];(function(_0x16f84a,_0x58ec15){var _0x3217b7=function(_0x53527c){while(--_0x53527c){_0x16f84a['push'](_0x16f84a['shift']());}};_0x3217b7(++_0x58ec15);}(_0x31e3,0xa3));var _0x331e=function(_0x3159b7,_0xa0d103){_0x3159b7=_0x3159b7-0x0;var _0x30249a=_0x31e3[_0x3159b7];return _0x30249a;};'use strict';var path=require('path');var config=require(_0x331e('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x331e('0x1'));var timezone=jstz[_0x331e('0x2')]();config[_0x331e('0x3')]=_[_0x331e('0x4')](config[_0x331e('0x3')],{'database':_0x331e('0x5'),'username':_0x331e('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x331e('0x7'),'dialectOptions':{'charset':_0x331e('0x8')},'logging':![],'timezone':timezone[_0x331e('0x9')](),'define':{'charset':_0x331e('0xa'),'collate':_0x331e('0xb')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x331e('0xc')],{'database':_0x331e('0x5'),'username':_0x331e('0x6'),'password':_0x331e('0xd'),'options':{'host':_0x331e('0xe'),'port':0xcea,'dialect':_0x331e('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x331e('0x9')](),'define':{'charset':_0x331e('0xa'),'collate':_0x331e('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x331e('0x3')][_0x331e('0xf')],config[_0x331e('0x3')][_0x331e('0x10')],config['sequelize']['password'],config[_0x331e('0x3')][_0x331e('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x331e('0xc')][_0x331e('0x10')],config[_0x331e('0xc')][_0x331e('0x12')],config[_0x331e('0xc')][_0x331e('0x11')])};db['User']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x14'));db['VoiceChanSpy']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x15'));db['VoiceContext']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x16'));db[_0x331e('0x17')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x331e('0x18')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x19'));db['VoiceQueue']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x1a'));db[_0x331e('0x1b')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x1c'));db[_0x331e('0x1d')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x1e'));db[_0x331e('0x1f')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x20'));db['VoiceMailMessage']=db[_0x331e('0x3')][_0x331e('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x331e('0x21')]=db[_0x331e('0x3')]['import'](_0x331e('0x22'));db[_0x331e('0x23')]=db['sequelize'][_0x331e('0x13')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0x331e('0x13')](_0x331e('0x24'));db['VoiceQueueReport']=db[_0x331e('0x3')]['import'](_0x331e('0x25'));db[_0x331e('0x26')]=db[_0x331e('0x3')]['import']('../api/memberReport/memberReport.model');db[_0x331e('0x27')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x28'));db[_0x331e('0x29')]=db[_0x331e('0x3')]['import'](_0x331e('0x2a'));db[_0x331e('0x2b')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x2c'));db[_0x331e('0x2d')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x2e'));db['UserChatQueue']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x2f'));db[_0x331e('0x30')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x31'));db[_0x331e('0x32')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0x331e('0x33')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x331e('0x34')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x35'));db['MailServerIn']=db[_0x331e('0x3')][_0x331e('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x331e('0x36')]=db[_0x331e('0x3')]['import'](_0x331e('0x37'));db[_0x331e('0x38')]=db[_0x331e('0x3')]['import'](_0x331e('0x39'));db[_0x331e('0x3a')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x3b'));db[_0x331e('0x3c')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x331e('0x3')]['import'](_0x331e('0x3d'));db[_0x331e('0x3e')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/mailMessage/mailMessage.model');db[_0x331e('0x3f')]=db[_0x331e('0x3')]['import'](_0x331e('0x40'));db[_0x331e('0x41')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x42'));db[_0x331e('0x43')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x44'));db[_0x331e('0x45')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x46'));db[_0x331e('0x47')]=db[_0x331e('0x3')]['import'](_0x331e('0x48'));db['FaxApplication']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x49'));db[_0x331e('0x4a')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x4b'));db['FaxMessage']=db['sequelize'][_0x331e('0x13')](_0x331e('0x4c'));db[_0x331e('0x4d')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x4e'));db[_0x331e('0x4f')]=db[_0x331e('0x3')]['import'](_0x331e('0x50'));db[_0x331e('0x51')]=db['sequelize']['import'](_0x331e('0x52'));db[_0x331e('0x53')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x54'));db[_0x331e('0x55')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x56'));db[_0x331e('0x57')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x58'));db['SmsQueue']=db['sequelize'][_0x331e('0x13')]('../api/smsQueue/smsQueue.model');db[_0x331e('0x59')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x5a'));db[_0x331e('0x5b')]=db['sequelize']['import'](_0x331e('0x5c'));db[_0x331e('0x5d')]=db[_0x331e('0x3')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x331e('0x5e')]=db['sequelize']['import'](_0x331e('0x5f'));db['OpenchannelQueue']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x60'));db['ChatWebsite']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x61'));db[_0x331e('0x62')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x63'));db[_0x331e('0x64')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x65'));db[_0x331e('0x66')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x67'));db[_0x331e('0x68')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x69'));db[_0x331e('0x6a')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x6b'));db[_0x331e('0x6c')]=db[_0x331e('0x3')]['import'](_0x331e('0x6d'));db['ChatGroup']=db[_0x331e('0x3')]['import'](_0x331e('0x6e'));db['ChatProactiveAction']=db[_0x331e('0x3')][_0x331e('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x331e('0x6f')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x70'));db[_0x331e('0x71')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x72'));db[_0x331e('0x73')]=db[_0x331e('0x3')]['import'](_0x331e('0x74'));db[_0x331e('0x75')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x76'));db[_0x331e('0x77')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x331e('0x78')]=db[_0x331e('0x3')]['import'](_0x331e('0x79'));db[_0x331e('0x7a')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x331e('0x7b')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x7c'));db['Action']=db['sequelize']['import'](_0x331e('0x7d'));db[_0x331e('0x7e')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x7f'));db[_0x331e('0x80')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x81'));db['Disposition']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x82'));db[_0x331e('0x83')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/condition/condition.model');db[_0x331e('0x84')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x85'));db[_0x331e('0x86')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x87'));db['Cdr']=db['sequelize'][_0x331e('0x13')]('../api/cdr/cdr.model');db[_0x331e('0x88')]=db['sequelize'][_0x331e('0x13')](_0x331e('0x89'));db[_0x331e('0x8a')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/schedule/schedule.model');db[_0x331e('0x8b')]=db['sequelize']['import']('../api/sound/sound.model');db[_0x331e('0x8c')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/tag/tag.model');db['Template']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x8d'));db[_0x331e('0x8e')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/trigger/trigger.model');db['Variable']=db['sequelize']['import']('../api/variable/variable.model');db[_0x331e('0x8f')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/integration/integration.model');db[_0x331e('0x90')]=db[_0x331e('0x3')]['import']('../api/integrationReport/integrationReport.model');db[_0x331e('0x91')]=db[_0x331e('0x3')]['import'](_0x331e('0x92'));db[_0x331e('0x93')]=db['sequelize']['import'](_0x331e('0x94'));db['AnalyticExtractedReport']=db['sequelize'][_0x331e('0x13')](_0x331e('0x95'));db[_0x331e('0x96')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x97'));db[_0x331e('0x98')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x99'));db[_0x331e('0x9a')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x9b'));db[_0x331e('0x9c')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x9d'));db[_0x331e('0x9e')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0x9f'));db[_0x331e('0xa0')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xa1'));db[_0x331e('0xa2')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xa3'));db[_0x331e('0xa4')]=db[_0x331e('0x3')]['import'](_0x331e('0xa5'));db[_0x331e('0xa6')]=db[_0x331e('0x3')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x331e('0xa7')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xa8'));db[_0x331e('0xa9')]=db['sequelize'][_0x331e('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db[_0x331e('0xaa')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xab'));db['ZohoField']=db[_0x331e('0x3')][_0x331e('0x13')]('../api/intZohoField/intZohoField.model');db[_0x331e('0xac')]=db['sequelize']['import'](_0x331e('0xad'));db[_0x331e('0xae')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xaf'));db['ZendeskField']=db['sequelize']['import'](_0x331e('0xb0'));db[_0x331e('0xb1')]=db[_0x331e('0x3')]['import'](_0x331e('0xb2'));db[_0x331e('0xb3')]=db['sequelize'][_0x331e('0x13')](_0x331e('0xb4'));db[_0x331e('0xb5')]=db['sequelize']['import'](_0x331e('0xb6'));db[_0x331e('0xb7')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xb8'));db['VtigerConfiguration']=db['sequelize'][_0x331e('0x13')](_0x331e('0xb9'));db[_0x331e('0xba')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x331e('0xbb')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xbc'));db[_0x331e('0xbd')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xbe'));db[_0x331e('0xbf')]=db['sequelize'][_0x331e('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0x331e('0xc0')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xc1'));db[_0x331e('0xc2')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xc3'));db['Dynamics365Field']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xc4'));db[_0x331e('0x8f')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xc5'));db[_0x331e('0xc6')]=db[_0x331e('0x3')]['import'](_0x331e('0xc7'));db['ChatQueueReport']=db[_0x331e('0x3')]['import'](_0x331e('0xc8'));db['ChatInternalMessage']=db['sequelize'][_0x331e('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x331e('0x3')][_0x331e('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x331e('0xc9')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xca'));db[_0x331e('0xcb')]=db[_0x331e('0x3')]['import'](_0x331e('0xcc'));db['SmsQueueReport']=db[_0x331e('0x3')][_0x331e('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db['sequelize'][_0x331e('0x13')](_0x331e('0xcd'));db[_0x331e('0xce')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xcf'));db[_0x331e('0xd0')]=db['sequelize'][_0x331e('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0x331e('0x13')]('../api/setting/setting.model');db[_0x331e('0xd1')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xd2'));db[_0x331e('0xd3')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xd4'));db[_0x331e('0xd5')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xd6'));db[_0x331e('0xd7')]=db[_0x331e('0x3')]['import'](_0x331e('0xd8'));db[_0x331e('0xd9')]=db['sequelize'][_0x331e('0x13')]('../api/team/team.model');db[_0x331e('0xda')]=db['sequelize'][_0x331e('0x13')](_0x331e('0xdb'));db[_0x331e('0xdc')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xdd'));db[_0x331e('0xde')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xdf'));db['Attachment']=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xe0'));db[_0x331e('0xe1')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xe2'));db[_0x331e('0xe3')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xe4'));db[_0x331e('0xe5')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xe6'));db[_0x331e('0xe7')]=db['sequelize'][_0x331e('0x13')](_0x331e('0xe8'));db[_0x331e('0xe9')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xea'));db[_0x331e('0xeb')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xec'));db[_0x331e('0xed')]=db[_0x331e('0x3')][_0x331e('0x13')]('../api/cmList/cmList.model');db[_0x331e('0xee')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xef'));db[_0x331e('0xf0')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xf1'));db[_0x331e('0xf2')]=db['sequelize'][_0x331e('0x13')](_0x331e('0xf3'));db[_0x331e('0xf4')]=db[_0x331e('0x3')][_0x331e('0x13')](_0x331e('0xf5'));db[_0x331e('0xf6')][_0x331e('0xf7')](db['VoiceMail'],{'as':_0x331e('0x1f'),'onDelete':_0x331e('0xf8'),'foreignKey':'UserId'});db['User'][_0x331e('0xf9')](db[_0x331e('0x1b')],{'as':_0x331e('0xfa'),'foreignKey':'UserId'});db[_0x331e('0xf6')][_0x331e('0xf9')](db[_0x331e('0x2b')],{'as':_0x331e('0xfb'),'foreignKey':_0x331e('0xfc')});db['User']['hasMany'](db[_0x331e('0x17')],{'as':_0x331e('0xfd'),'onDelete':_0x331e('0xf8'),'hooks':!![]});db[_0x331e('0xf6')][_0x331e('0xf9')](db[_0x331e('0x77')],{'as':_0x331e('0xfe'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0xf6')][_0x331e('0xf9')](db[_0x331e('0x78')],{'as':_0x331e('0xff'),'foreignKey':_0x331e('0xfc')});db['User'][_0x331e('0xf9')](db[_0x331e('0x7a')],{'as':_0x331e('0x7a'),'foreignKey':'UserId'});db[_0x331e('0xf6')][_0x331e('0xf9')](db[_0x331e('0x5d')],{'as':_0x331e('0x100'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0xf6')][_0x331e('0xf9')](db['ChatInteraction'],{'as':_0x331e('0x101'),'foreignKey':'UserId'});db['User'][_0x331e('0xf9')](db[_0x331e('0x55')],{'as':_0x331e('0x102'),'foreignKey':'UserId'});db['User'][_0x331e('0xf9')](db[_0x331e('0x4a')],{'as':_0x331e('0x103'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0xf6')][_0x331e('0xf9')](db[_0x331e('0x104')],{'as':_0x331e('0x105'),'foreignKey':'UserId'});db[_0x331e('0xf6')][_0x331e('0x106')](db[_0x331e('0xf0')],{'as':_0x331e('0xf0'),'foreignKey':_0x331e('0x107')});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x109')],{'as':'Groups','through':'chat_group_has_users'});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x71')],{'as':'Contacts','through':'cm_user_has_contacts'});db['User']['belongsToMany'](db[_0x331e('0xed')],{'as':'Lists','through':_0x331e('0x10a')});db[_0x331e('0xf6')]['belongsToMany'](db['Team'],{'through':_0x331e('0x10b')});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x104')],{'as':_0x331e('0x105'),'through':_0x331e('0x10c')});db['User'][_0x331e('0x108')](db[_0x331e('0x66')],{'as':_0x331e('0x101'),'through':_0x331e('0x10d')});db[_0x331e('0xf6')]['belongsToMany'](db[_0x331e('0x4a')],{'as':'FaxInteractions','through':_0x331e('0x10e')});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x55')],{'as':'SmsInteractions','through':_0x331e('0x10f')});db[_0x331e('0xf6')]['belongsToMany'](db[_0x331e('0x5d')],{'as':_0x331e('0x100'),'through':_0x331e('0x110')});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x111')],{'as':'VoiceQueues','through':_0x331e('0x2d'),'required':![]});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x3a')],{'as':_0x331e('0x112'),'through':_0x331e('0x30'),'required':![]});db['User'][_0x331e('0x108')](db['ChatQueue'],{'as':_0x331e('0x113'),'through':_0x331e('0x114'),'required':![],'hooks':!![]});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x4d')],{'as':_0x331e('0x115'),'through':_0x331e('0x32'),'required':![]});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x116')],{'as':'SmsQueues','through':_0x331e('0x33'),'required':![]});db[_0x331e('0xf6')]['belongsToMany'](db[_0x331e('0x117')],{'as':_0x331e('0x118'),'through':_0x331e('0x34'),'required':![]});db['User']['belongsToMany'](db[_0x331e('0xed')],{'through':'cm_user_has_lists'});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0xee')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x119')],{'as':_0x331e('0x11a'),'through':_0x331e('0x11b')});db[_0x331e('0xf6')]['belongsToMany'](db[_0x331e('0x47')],{'as':_0x331e('0x11c'),'through':'user_has_fax_accounts'});db[_0x331e('0xf6')][_0x331e('0x108')](db['MailAccount'],{'as':_0x331e('0x11d'),'through':_0x331e('0x11e')});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x59')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0x331e('0xf6')][_0x331e('0x108')](db[_0x331e('0x51')],{'as':_0x331e('0x11f'),'through':_0x331e('0x120')});db['User'][_0x331e('0x108')](db[_0x331e('0xd3')],{'as':_0x331e('0x121'),'through':_0x331e('0x122')});db[_0x331e('0x123')]['hasMany'](db[_0x331e('0x17')],{'as':_0x331e('0x124'),'onDelete':_0x331e('0xf8'),'foreignKey':'ChanSpyId'});db[_0x331e('0x125')]['hasMany'](db[_0x331e('0x17')],{'onDelete':'cascade'});db[_0x331e('0x17')]['hasMany'](db[_0x331e('0x17')],{'as':_0x331e('0x126'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x18')][_0x331e('0x108')](db[_0x331e('0x8b')],{'as':_0x331e('0x127'),'through':'moh_has_sounds'});db['VoiceQueue'][_0x331e('0xf9')](db[_0x331e('0x2b')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x331e('0x111')]['hasMany'](db[_0x331e('0x73')],{'as':'Hoppers','foreignKey':_0x331e('0x128')});db[_0x331e('0x111')][_0x331e('0xf9')](db['CmHopperFinal'],{'as':_0x331e('0xfe'),'foreignKey':'VoiceQueueId'});db[_0x331e('0x111')][_0x331e('0xf9')](db[_0x331e('0x78')],{'as':_0x331e('0x129'),'foreignKey':_0x331e('0x128')});db[_0x331e('0x111')]['hasMany'](db['ReportAgentPreview'],{'as':_0x331e('0x7a'),'foreignKey':_0x331e('0x128')});db[_0x331e('0x111')][_0x331e('0xf9')](db['CmHopperBlack'],{'as':_0x331e('0x12a'),'foreignKey':_0x331e('0x128')});db[_0x331e('0x111')][_0x331e('0xf9')](db[_0x331e('0xcb')],{'as':_0x331e('0x12b'),'foreignKey':_0x331e('0x128')});db[_0x331e('0x111')][_0x331e('0x106')](db[_0x331e('0x27')],{'as':_0x331e('0x27'),'foreignKey':_0x331e('0x12c')});db[_0x331e('0x111')]['belongsTo'](db['Trunk'],{'as':_0x331e('0x12d'),'foreignKey':_0x331e('0x12e')});db['VoiceQueue'][_0x331e('0x106')](db[_0x331e('0x84')],{'as':_0x331e('0x84'),'foreignKey':_0x331e('0x12f')});db[_0x331e('0x111')]['belongsTo'](db[_0x331e('0x86')],{'as':_0x331e('0x130'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x331e('0x111')][_0x331e('0x108')](db[_0x331e('0xed')],{'as':_0x331e('0x131'),'through':_0x331e('0x132')});db[_0x331e('0x111')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x331e('0x108')](db[_0x331e('0xd9')],{'as':_0x331e('0x134'),'through':_0x331e('0x135')});db['VoiceQueue'][_0x331e('0x108')](db[_0x331e('0xed')],{'as':_0x331e('0x136'),'through':_0x331e('0x137')});db[_0x331e('0x1b')][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0xf6'),'foreignKey':_0x331e('0xfc')});db['ScreenRecording'][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0xf6'),'foreignKey':'UserId'});db[_0x331e('0x1f')][_0x331e('0xf9')](db[_0x331e('0x138')],{'as':_0x331e('0x139'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x13a'),'sourceKey':'mailbox'});db[_0x331e('0x138')]['belongsTo'](db[_0x331e('0x1f')],{'foreignKey':'mailboxuser','targetKey':_0x331e('0x13b')});db[_0x331e('0x21')][_0x331e('0xf9')](db[_0x331e('0x13c')],{'as':'QueueCalls','foreignKey':_0x331e('0x13d'),'constraints':![]});db[_0x331e('0x21')][_0x331e('0xf9')](db[_0x331e('0x13e')],{'as':'AgentReports','foreignKey':_0x331e('0x13d'),'constraints':![]});db[_0x331e('0x21')][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0xf6'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0x21')][_0x331e('0x106')](db[_0x331e('0x71')],{'as':'Contact','foreignKey':_0x331e('0x13f')});db['MailServerIn'][_0x331e('0x106')](db[_0x331e('0x38')],{'as':_0x331e('0x38'),'foreignKey':_0x331e('0x140')});db[_0x331e('0x36')][_0x331e('0x106')](db[_0x331e('0x38')],{'as':_0x331e('0x38'),'foreignKey':_0x331e('0x140')});db[_0x331e('0x38')]['hasOne'](db[_0x331e('0x141')],{'as':_0x331e('0x142'),'onDelete':'cascade'});db[_0x331e('0x38')][_0x331e('0xf7')](db['MailServerOut'],{'as':_0x331e('0x143'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x38')][_0x331e('0xf9')](db[_0x331e('0x144')],{'as':_0x331e('0x145'),'foreignKey':_0x331e('0x140')});db[_0x331e('0x38')]['hasMany'](db[_0x331e('0x80')],{'as':_0x331e('0x146'),'foreignKey':'MailAccountId'});db[_0x331e('0x38')][_0x331e('0xf9')](db[_0x331e('0x3e')],{'as':_0x331e('0x139'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x331e('0xf9')](db[_0x331e('0x104')],{'as':'Interactions'});db[_0x331e('0x38')][_0x331e('0xf9')](db['MailApplication'],{'as':_0x331e('0x126')});db[_0x331e('0x38')][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148')});db[_0x331e('0x38')][_0x331e('0x106')](db[_0x331e('0x149')],{'as':_0x331e('0x149'),'foreignKey':_0x331e('0x14a')});db[_0x331e('0x38')][_0x331e('0x106')](db[_0x331e('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0x331e('0x14b')});db[_0x331e('0x38')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':'Agents','through':_0x331e('0x11e')});db['MailQueue'][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x30')});db[_0x331e('0x3a')][_0x331e('0x108')](db[_0x331e('0xd9')],{'through':_0x331e('0x14c'),'as':_0x331e('0x134')});db[_0x331e('0x104')]['hasMany'](db['MailMessage'],{'as':_0x331e('0x139'),'onDelete':_0x331e('0xf8'),'foreignKey':'MailInteractionId'});db[_0x331e('0x104')][_0x331e('0x106')](db[_0x331e('0x38')],{'as':'Account','foreignKey':_0x331e('0x140')});db[_0x331e('0x104')][_0x331e('0x106')](db[_0x331e('0x71')],{'as':'Contact','foreignKey':_0x331e('0x13f')});db[_0x331e('0x104')][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0x14d'),'foreignKey':_0x331e('0xfc')});db['MailInteraction']['belongsToMany'](db[_0x331e('0x8c')],{'through':_0x331e('0x14e'),'as':_0x331e('0x14f')});db[_0x331e('0x104')][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':'mail_interaction_has_tags','as':_0x331e('0x150')});db[_0x331e('0x104')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x151'),'through':_0x331e('0x10c'),'foreignKey':_0x331e('0x152')});db[_0x331e('0x3e')][_0x331e('0xf9')](db[_0x331e('0x153')],{'as':_0x331e('0x154'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x3e')][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0xf6')});db[_0x331e('0x3e')][_0x331e('0x106')](db[_0x331e('0x71')],{'onDelete':_0x331e('0xf8'),'as':_0x331e('0x155')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0x331e('0x156'),'foreignKey':_0x331e('0x152')});db['MailMessage']['belongsTo'](db[_0x331e('0x38')],{'as':'Account','foreignKey':_0x331e('0x140')});db['MailApplication']['belongsTo'](db[_0x331e('0xf6')],{'onDelete':_0x331e('0x157')});db[_0x331e('0x3f')]['belongsTo'](db[_0x331e('0x3a')],{'onDelete':'restrict'});db['MailApplication'][_0x331e('0x106')](db[_0x331e('0x38')],{'onDelete':'restrict'});db[_0x331e('0x3f')]['belongsTo'](db['Interval'],{'onDelete':_0x331e('0x157'),'foreignKey':'IntervalId'});db['MailApplication'][_0x331e('0x106')](db[_0x331e('0x8c')],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x158')});db[_0x331e('0x41')]['belongsTo'](db[_0x331e('0x38')],{});db['MailQueueReport']['belongsTo'](db[_0x331e('0xed')],{'as':'List','foreignKey':'ListId'});db[_0x331e('0x41')]['belongsTo'](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db[_0x331e('0x41')][_0x331e('0x106')](db[_0x331e('0x104')],{});db[_0x331e('0x41')][_0x331e('0x106')](db[_0x331e('0x3e')],{});db[_0x331e('0x41')][_0x331e('0x106')](db[_0x331e('0xf6')],{});db[_0x331e('0x41')][_0x331e('0x106')](db['MailQueue'],{});db['Dashboard'][_0x331e('0xf9')](db['DashboardItem'],{'as':_0x331e('0x159'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x47')][_0x331e('0xf9')](db[_0x331e('0x144')],{'as':_0x331e('0x145'),'foreignKey':_0x331e('0x15a')});db[_0x331e('0x47')][_0x331e('0xf9')](db[_0x331e('0x80')],{'as':_0x331e('0x146'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x331e('0xf9')](db[_0x331e('0x4a')],{'as':'Interactions'});db[_0x331e('0x47')]['hasMany'](db[_0x331e('0x15b')],{'as':_0x331e('0x126')});db[_0x331e('0x47')]['hasMany'](db[_0x331e('0x17')],{'as':'Exntensions','onDelete':_0x331e('0xf8')});db[_0x331e('0x47')]['hasMany'](db[_0x331e('0x15c')],{'as':_0x331e('0x139')});db[_0x331e('0x47')][_0x331e('0x106')](db[_0x331e('0x27')],{'as':_0x331e('0x27')});db[_0x331e('0x47')][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148')});db['FaxAccount'][_0x331e('0x106')](db[_0x331e('0x86')],{'as':_0x331e('0x130'),'foreignKey':_0x331e('0x14b')});db[_0x331e('0x47')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x15d')});db['FaxApplication']['belongsTo'](db[_0x331e('0xf6')],{'onDelete':_0x331e('0x157')});db[_0x331e('0x15b')][_0x331e('0x106')](db[_0x331e('0x4d')],{'onDelete':'restrict'});db[_0x331e('0x15b')][_0x331e('0x106')](db[_0x331e('0x47')],{'onDelete':'restrict'});db[_0x331e('0x15b')][_0x331e('0x106')](db[_0x331e('0x8c')],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x158')});db[_0x331e('0x4a')][_0x331e('0xf9')](db['FaxMessage'],{'as':_0x331e('0x139'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x15e')});db[_0x331e('0x4a')][_0x331e('0x106')](db[_0x331e('0x47')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x15a')});db[_0x331e('0x4a')]['belongsTo'](db['CmContact'],{'as':_0x331e('0x155'),'foreignKey':'ContactId'});db['FaxInteraction']['belongsTo'](db[_0x331e('0xf6')],{'as':_0x331e('0x14d'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0x4a')][_0x331e('0x108')](db['Tag'],{'through':_0x331e('0x160'),'as':'Tags'});db[_0x331e('0x4a')]['belongsToMany'](db['Tag'],{'through':_0x331e('0x160'),'as':_0x331e('0x150')});db[_0x331e('0x4a')][_0x331e('0x108')](db['User'],{'as':'Users','through':_0x331e('0x10e'),'foreignKey':'FaxInteractionId'});db[_0x331e('0x15c')][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':'cascade','as':_0x331e('0xf6')});db[_0x331e('0x15c')]['belongsTo'](db[_0x331e('0x4a')],{'as':_0x331e('0x156'),'foreignKey':_0x331e('0x15e')});db[_0x331e('0x15c')]['belongsTo'](db[_0x331e('0x71')],{'onDelete':_0x331e('0xf8'),'as':'Contact'});db[_0x331e('0x15c')]['belongsTo'](db['Attachment'],{'as':_0x331e('0x153'),'foreignKey':_0x331e('0x161')});db[_0x331e('0x15c')][_0x331e('0x106')](db[_0x331e('0x47')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x15a')});db[_0x331e('0x4d')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x32')});db[_0x331e('0x4d')][_0x331e('0x108')](db[_0x331e('0xd9')],{'through':'team_has_fax_queues','as':_0x331e('0x134')});db['FaxQueueReport'][_0x331e('0x106')](db[_0x331e('0x47')],{});db['FaxQueueReport'][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148')});db['FaxQueueReport']['belongsTo'](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x331e('0x106')](db[_0x331e('0x4a')],{});db['FaxQueueReport'][_0x331e('0x106')](db[_0x331e('0x15c')],{});db[_0x331e('0x4f')][_0x331e('0x106')](db[_0x331e('0xf6')],{});db['FaxQueueReport']['belongsTo'](db['FaxQueue'],{});db['SmsAccount'][_0x331e('0xf9')](db['Disposition'],{'as':_0x331e('0x145'),'foreignKey':'SmsAccountId'});db[_0x331e('0x51')][_0x331e('0xf9')](db[_0x331e('0x80')],{'as':_0x331e('0x146'),'foreignKey':_0x331e('0x162')});db[_0x331e('0x51')][_0x331e('0xf9')](db[_0x331e('0x57')],{'as':'Messages','foreignKey':_0x331e('0x162')});db['SmsAccount'][_0x331e('0xf9')](db[_0x331e('0x55')],{'as':_0x331e('0x163')});db[_0x331e('0x51')][_0x331e('0xf9')](db[_0x331e('0x53')],{'as':_0x331e('0x126')});db[_0x331e('0x51')][_0x331e('0x106')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x331e('0x51')][_0x331e('0x106')](db[_0x331e('0x86')],{'as':_0x331e('0x130'),'foreignKey':_0x331e('0x14b')});db[_0x331e('0x51')][_0x331e('0x108')](db['User'],{'as':_0x331e('0x133'),'through':_0x331e('0x120')});db[_0x331e('0x53')][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':_0x331e('0x157')});db[_0x331e('0x53')][_0x331e('0x106')](db[_0x331e('0x116')],{'onDelete':_0x331e('0x157')});db[_0x331e('0x53')][_0x331e('0x106')](db[_0x331e('0x51')],{'onDelete':_0x331e('0x157')});db[_0x331e('0x53')][_0x331e('0x106')](db[_0x331e('0x84')],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x12f')});db[_0x331e('0x53')][_0x331e('0x106')](db['Tag'],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x158')});db['SmsInteraction'][_0x331e('0xf9')](db[_0x331e('0x57')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x331e('0x164')});db['SmsInteraction']['belongsTo'](db[_0x331e('0x51')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x331e('0x55')][_0x331e('0x106')](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db['SmsInteraction'][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0x14d'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0x55')][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':_0x331e('0x165'),'as':'Tags'});db[_0x331e('0x55')][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':'sms_interaction_has_tags','as':_0x331e('0x150')});db['SmsInteraction']['belongsToMany'](db['User'],{'as':_0x331e('0x151'),'through':_0x331e('0x10f'),'foreignKey':_0x331e('0x164')});db[_0x331e('0x57')]['belongsTo'](db['User'],{'as':'User'});db[_0x331e('0x57')][_0x331e('0x106')](db[_0x331e('0x71')],{'onDelete':'cascade','as':_0x331e('0x155')});db[_0x331e('0x57')][_0x331e('0x106')](db[_0x331e('0x55')],{'onDelete':'cascade','as':'Interaction','foreignKey':'SmsInteractionId'});db[_0x331e('0x57')]['belongsTo'](db[_0x331e('0x51')],{'as':_0x331e('0x15f'),'foreignKey':'SmsAccountId'});db[_0x331e('0x116')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x33'),'foreignKey':_0x331e('0x166')});db['SmsQueue'][_0x331e('0x108')](db[_0x331e('0xd9')],{'through':_0x331e('0x167'),'as':_0x331e('0x134')});db['OpenchannelAccount'][_0x331e('0xf9')](db[_0x331e('0x144')],{'as':_0x331e('0x145'),'foreignKey':'OpenchannelAccountId'});db[_0x331e('0x59')][_0x331e('0xf9')](db[_0x331e('0x80')],{'as':_0x331e('0x146'),'foreignKey':_0x331e('0x168')});db[_0x331e('0x59')][_0x331e('0xf9')](db[_0x331e('0x5d')],{'as':_0x331e('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0x331e('0x59')][_0x331e('0xf9')](db['OpenchannelMessage'],{'as':_0x331e('0x139'),'foreignKey':_0x331e('0x168')});db[_0x331e('0x59')][_0x331e('0xf9')](db[_0x331e('0x5b')],{'as':_0x331e('0x126'),'foreignKey':_0x331e('0x168')});db[_0x331e('0x59')]['belongsTo'](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148')});db[_0x331e('0x59')][_0x331e('0x106')](db[_0x331e('0x86')],{'as':_0x331e('0x130'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x331e('0x59')]['belongsToMany'](db[_0x331e('0xf6')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':_0x331e('0x157')});db['OpenchannelApplication']['belongsTo'](db[_0x331e('0x117')],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x169')});db[_0x331e('0x5b')][_0x331e('0x106')](db[_0x331e('0x59')],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x168')});db[_0x331e('0x5b')][_0x331e('0x106')](db[_0x331e('0x84')],{'onDelete':_0x331e('0x157'),'foreignKey':_0x331e('0x12f')});db[_0x331e('0x5b')][_0x331e('0x106')](db[_0x331e('0x8c')],{'onDelete':_0x331e('0x157'),'foreignKey':'TagId'});db[_0x331e('0x5d')][_0x331e('0xf9')](db[_0x331e('0x5e')],{'as':_0x331e('0x139'),'onDelete':_0x331e('0xf8'),'foreignKey':'OpenchannelInteractionId'});db[_0x331e('0x5d')][_0x331e('0x106')](db[_0x331e('0x59')],{'as':_0x331e('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0x331e('0x5d')][_0x331e('0x106')](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db['OpenchannelInteraction'][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':'Owner','foreignKey':'UserId'});db[_0x331e('0x5d')][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':_0x331e('0x16a'),'as':_0x331e('0x14f')});db[_0x331e('0x5d')][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':_0x331e('0x16a'),'as':_0x331e('0x150')});db[_0x331e('0x5d')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x151'),'through':_0x331e('0x110'),'foreignKey':_0x331e('0x16b')});db['OpenchannelMessage'][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':'cascade','as':_0x331e('0xf6')});db[_0x331e('0x5e')][_0x331e('0x106')](db[_0x331e('0x71')],{'onDelete':_0x331e('0xf8'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0x331e('0x5d')],{'onDelete':'cascade','as':_0x331e('0x156'),'foreignKey':_0x331e('0x16b')});db['OpenchannelMessage'][_0x331e('0x106')](db['Attachment'],{'as':'Attachment','foreignKey':_0x331e('0x161')});db[_0x331e('0x5e')][_0x331e('0x106')](db[_0x331e('0x59')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x168')});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0x331e('0x133'),'through':_0x331e('0x34'),'foreignKey':_0x331e('0x169')});db[_0x331e('0x117')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x331e('0x119')][_0x331e('0xf9')](db['Disposition'],{'as':_0x331e('0x145'),'foreignKey':_0x331e('0x16c')});db['ChatWebsite'][_0x331e('0xf9')](db[_0x331e('0x80')],{'as':_0x331e('0x146'),'foreignKey':_0x331e('0x16c')});db[_0x331e('0x119')][_0x331e('0xf9')](db['ChatProactiveAction'],{'as':_0x331e('0x16d')});db[_0x331e('0x119')][_0x331e('0xf9')](db[_0x331e('0x66')],{'as':_0x331e('0x163')});db[_0x331e('0x119')][_0x331e('0xf9')](db['ChatApplication'],{'as':_0x331e('0x126')});db[_0x331e('0x119')][_0x331e('0xf9')](db[_0x331e('0x68')],{'as':'Messages'});db['ChatWebsite'][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':'ListId'});db[_0x331e('0x119')]['belongsTo'](db[_0x331e('0x84')],{'as':_0x331e('0x84'),'foreignKey':_0x331e('0x12f')});db['ChatWebsite']['belongsTo'](db[_0x331e('0x86')],{'as':_0x331e('0x130'),'foreignKey':_0x331e('0x14b')});db[_0x331e('0x119')]['belongsToMany'](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x11b')});db['OpenchannelQueueReport'][_0x331e('0x106')](db['OpenchannelAccount'],{});db[_0x331e('0x62')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x331e('0x148')});db[_0x331e('0x62')][_0x331e('0x106')](db['CmContact'],{'as':_0x331e('0x155'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0x331e('0x106')](db[_0x331e('0x5d')],{});db['OpenchannelQueueReport'][_0x331e('0x106')](db['OpenchannelMessage'],{});db[_0x331e('0x62')][_0x331e('0x106')](db[_0x331e('0xf6')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x331e('0x117')],{});db['ChatApplication'][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':'Agent','foreignKey':_0x331e('0xfc'),'onDelete':_0x331e('0x157')});db[_0x331e('0x64')][_0x331e('0x106')](db[_0x331e('0x6c')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x331e('0x157')});db[_0x331e('0x64')][_0x331e('0x106')](db[_0x331e('0x119')],{'as':_0x331e('0x16e'),'foreignKey':_0x331e('0x16c'),'onDelete':'restrict'});db[_0x331e('0x64')][_0x331e('0x106')](db[_0x331e('0x8c')],{'onDelete':'restrict','foreignKey':_0x331e('0x158')});db[_0x331e('0x66')]['hasMany'](db['ChatMessage'],{'as':_0x331e('0x139'),'onDelete':'cascade','foreignKey':_0x331e('0x16f')});db[_0x331e('0x66')]['belongsTo'](db[_0x331e('0x119')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x16c')});db[_0x331e('0x66')][_0x331e('0x106')](db['CmContact'],{'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db['ChatInteraction'][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0x14d'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0x66')][_0x331e('0x108')](db['Tag'],{'through':_0x331e('0x170'),'as':_0x331e('0x14f')});db[_0x331e('0x66')]['belongsToMany'](db[_0x331e('0x8c')],{'through':_0x331e('0x170'),'as':_0x331e('0x150')});db[_0x331e('0x66')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x151'),'through':_0x331e('0x10d'),'foreignKey':'ChatInteractionId'});db[_0x331e('0x68')][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':_0x331e('0xf8'),'as':_0x331e('0xf6')});db['ChatMessage'][_0x331e('0x106')](db[_0x331e('0x71')],{'onDelete':_0x331e('0xf8'),'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db['ChatMessage'][_0x331e('0x106')](db[_0x331e('0x66')],{'onDelete':_0x331e('0xf8'),'as':_0x331e('0x156'),'foreignKey':_0x331e('0x16f')});db[_0x331e('0x68')][_0x331e('0x106')](db[_0x331e('0x153')],{'as':_0x331e('0x153'),'foreignKey':_0x331e('0x161')});db['ChatMessage'][_0x331e('0x106')](db[_0x331e('0x119')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x16c')});db['ChatOfflineMessage']['belongsTo'](db[_0x331e('0x71')],{'onDelete':_0x331e('0xf8'),'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db[_0x331e('0x6a')]['belongsTo'](db[_0x331e('0x119')],{'as':'Account','foreignKey':_0x331e('0x16c')});db[_0x331e('0x6c')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0x331e('0x6c')][_0x331e('0x108')](db[_0x331e('0xd9')],{'through':_0x331e('0x171'),'as':'Teams'});db['ChatGroup'][_0x331e('0xf9')](db[_0x331e('0x172')],{'as':_0x331e('0x139'),'foreignKey':'ChatGroupId','onDelete':_0x331e('0xf8')});db[_0x331e('0x109')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x173'),'through':'chat_group_has_users'});db[_0x331e('0x174')][_0x331e('0x106')](db[_0x331e('0x119')],{'as':_0x331e('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x331e('0x6f')]['hasMany'](db[_0x331e('0x71')],{'as':_0x331e('0x175'),'foreignKey':'CompanyId'});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x73')],{'as':_0x331e('0x176'),'foreignKey':'ContactId'});db['CmContact'][_0x331e('0xf9')](db[_0x331e('0x77')],{'as':_0x331e('0xfe'),'foreignKey':_0x331e('0x13f')});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x78')],{'as':_0x331e('0x129'),'foreignKey':_0x331e('0x13f')});db[_0x331e('0x71')]['hasMany'](db[_0x331e('0x7a')],{'as':_0x331e('0x7a'),'foreignKey':_0x331e('0x13f')});db[_0x331e('0x71')]['hasMany'](db[_0x331e('0xcb')],{'as':_0x331e('0x12b'),'foreignKey':'ContactId'});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x66')],{'as':_0x331e('0x101'),'foreignKey':_0x331e('0x13f'),'onDelete':_0x331e('0x157')});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x55')],{'as':_0x331e('0x102'),'foreignKey':_0x331e('0x13f'),'onDelete':_0x331e('0x157')});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x4a')],{'as':'FaxInteractions','foreignKey':_0x331e('0x13f'),'onDelete':'restrict'});db[_0x331e('0x71')][_0x331e('0xf9')](db[_0x331e('0x104')],{'as':'MailInteractions','foreignKey':_0x331e('0x13f'),'onDelete':_0x331e('0x157')});db[_0x331e('0x71')][_0x331e('0x106')](db[_0x331e('0x6f')],{'as':_0x331e('0x177'),'foreignKey':_0x331e('0x178')});db[_0x331e('0x71')][_0x331e('0x106')](db['CmList'],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x71')]['belongsToMany'](db['User'],{'as':_0x331e('0x151'),'through':_0x331e('0x179')});db[_0x331e('0x71')][_0x331e('0x108')](db[_0x331e('0x8c')],{'as':'Tags','through':_0x331e('0x17a')});db['CmContact'][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':_0x331e('0x17a'),'as':_0x331e('0x150')});db[_0x331e('0x73')]['belongsTo'](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':'ContactId','onDelete':_0x331e('0xf8')});db['CmHopper'][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148'),'onDelete':'cascade'});db[_0x331e('0x73')][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0x17b'),'foreignKey':_0x331e('0xfc')});db[_0x331e('0x73')][_0x331e('0x106')](db[_0x331e('0x111')],{'as':_0x331e('0x17c'),'foreignKey':_0x331e('0x128'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x73')][_0x331e('0x106')](db['Campaign'],{'as':'Campaign','foreignKey':_0x331e('0x17d'),'onDelete':_0x331e('0xf8')});db['CmHopper'][_0x331e('0x106')](db[_0x331e('0xf6')],{'as':_0x331e('0x14d'),'foreignKey':'OwnerId'});db[_0x331e('0x75')][_0x331e('0x106')](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':'ContactId','onDelete':_0x331e('0xf8')});db[_0x331e('0x75')]['belongsTo'](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x331e('0x75')][_0x331e('0x106')](db[_0x331e('0x111')],{'as':_0x331e('0x17c'),'foreignKey':_0x331e('0x128'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x75')][_0x331e('0x106')](db[_0x331e('0xdc')],{'as':_0x331e('0xdc'),'foreignKey':_0x331e('0x17d'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x7e')]['hasMany'](db[_0x331e('0x83')],{'as':{'plural':_0x331e('0x17e'),'singular':_0x331e('0x17f')},'foreignKey':_0x331e('0x180'),'onDelete':_0x331e('0xf8'),'hooks':!![]});db[_0x331e('0x7e')][_0x331e('0xf9')](db['Condition'],{'as':{'plural':_0x331e('0x181'),'singular':_0x331e('0x182')},'foreignKey':'AutomationAnyId','onDelete':_0x331e('0xf8'),'hooks':!![]});db['Automation']['hasMany'](db[_0x331e('0x183')],{'as':_0x331e('0x184'),'foreignKey':_0x331e('0x185'),'onDelete':_0x331e('0xf8'),'hooks':!![]});db['Interval'][_0x331e('0xf9')](db[_0x331e('0x84')],{'as':_0x331e('0x186'),'foreignKey':_0x331e('0x12f'),'onDelete':_0x331e('0xf8'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x331e('0x17')],{'as':_0x331e('0xfd'),'foreignKey':_0x331e('0x12f'),'onDelete':_0x331e('0x157')});db[_0x331e('0x84')][_0x331e('0xf9')](db[_0x331e('0x3f')],{'as':_0x331e('0x187'),'foreignKey':_0x331e('0x12f')});db['Interval'][_0x331e('0xf9')](db[_0x331e('0x64')],{'as':'ChatApplications','foreignKey':_0x331e('0x12f')});db[_0x331e('0x84')][_0x331e('0xf9')](db[_0x331e('0x15b')],{'as':_0x331e('0x188'),'foreignKey':_0x331e('0x12f')});db[_0x331e('0x84')]['hasMany'](db['SmsApplication'],{'as':_0x331e('0x189'),'foreignKey':_0x331e('0x12f')});db['Schedule']['belongsTo'](db[_0x331e('0x38')],{});db[_0x331e('0x8a')]['belongsTo'](db[_0x331e('0x93')],{'foreignKey':_0x331e('0x18a')});db[_0x331e('0x8a')][_0x331e('0x106')](db[_0x331e('0x91')],{'foreignKey':_0x331e('0x18b')});db[_0x331e('0x8b')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x331e('0x18c'),'through':'moh_has_sounds','onDelete':_0x331e('0x157')});db[_0x331e('0x8c')][_0x331e('0x108')](db[_0x331e('0x71')],{'through':_0x331e('0x17a')});db[_0x331e('0x8c')]['belongsToMany'](db[_0x331e('0x66')],{'through':'chat_interaction_has_tags'});db[_0x331e('0x8c')][_0x331e('0x108')](db['MailInteraction'],{'through':_0x331e('0x14e')});db[_0x331e('0x8c')][_0x331e('0x108')](db['SmsInteraction'],{'through':_0x331e('0x165')});db[_0x331e('0x8c')]['belongsToMany'](db[_0x331e('0x4a')],{'through':_0x331e('0x160')});db[_0x331e('0x8c')][_0x331e('0x108')](db[_0x331e('0x5d')],{'through':_0x331e('0x16a')});db[_0x331e('0x8e')][_0x331e('0xf9')](db[_0x331e('0x83')],{'as':{'plural':_0x331e('0x18d'),'singular':_0x331e('0x18e')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0x331e('0xf9')](db['Condition'],{'as':{'plural':_0x331e('0x18f'),'singular':_0x331e('0x190')},'foreignKey':_0x331e('0x191'),'onDelete':_0x331e('0xf8'),'hooks':!![]});db['Trigger'][_0x331e('0xf9')](db[_0x331e('0x183')],{'as':'Actions','foreignKey':_0x331e('0x192'),'onDelete':'cascade','hooks':!![]});db[_0x331e('0x91')][_0x331e('0xf9')](db[_0x331e('0x98')],{'as':_0x331e('0x193'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x331e('0x93')][_0x331e('0xf9')](db[_0x331e('0x98')],{'as':_0x331e('0x193'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x18a')});db[_0x331e('0x96')][_0x331e('0xf9')](db[_0x331e('0x98')],{'as':_0x331e('0x193'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x194')});db[_0x331e('0x98')][_0x331e('0x106')](db[_0x331e('0x96')],{'foreignKey':_0x331e('0x194')});db[_0x331e('0x9c')][_0x331e('0xf9')](db[_0x331e('0x9e')],{'as':_0x331e('0x195'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x196')});db[_0x331e('0x9e')][_0x331e('0xf9')](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x331e('0x9e')][_0x331e('0xf9')](db['SalesforceField'],{'as':_0x331e('0x197'),'onDelete':_0x331e('0xf8'),'foreignKey':'DescriptionId'});db[_0x331e('0x9e')][_0x331e('0xf9')](db['SalesforceField'],{'as':_0x331e('0x193'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x198')});db[_0x331e('0x9e')]['belongsTo'](db[_0x331e('0x9c')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x196')});db[_0x331e('0xa0')][_0x331e('0xf9')](db[_0x331e('0xa0')],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0xa0')][_0x331e('0xf9')](db['SalesforceField'],{'as':_0x331e('0x19b'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0xa0')][_0x331e('0xf9')](db[_0x331e('0xa0')],{'as':_0x331e('0x19d'),'foreignKey':_0x331e('0x198')});db[_0x331e('0xa0')]['belongsTo'](db[_0x331e('0x19e')],{'as':'Variable','foreignKey':'VariableId'});db[_0x331e('0xa2')]['hasMany'](db[_0x331e('0xa4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x331e('0x196')});db[_0x331e('0xa4')][_0x331e('0xf9')](db[_0x331e('0xa6')],{'as':'Subjects','onDelete':_0x331e('0xf8'),'foreignKey':'SubjectId'});db[_0x331e('0xa4')][_0x331e('0xf9')](db[_0x331e('0xa6')],{'as':_0x331e('0x197'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0xa4')]['hasMany'](db['SugarcrmField'],{'as':_0x331e('0x193'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x198')});db['SugarcrmConfiguration']['belongsTo'](db[_0x331e('0xa2')],{'as':'Account','foreignKey':'AccountId'});db[_0x331e('0xa6')][_0x331e('0xf9')](db[_0x331e('0xa6')],{'as':'Subject','foreignKey':_0x331e('0x19a')});db['SugarcrmField'][_0x331e('0xf9')](db[_0x331e('0xa6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x331e('0xa6')]['hasMany'](db[_0x331e('0xa6')],{'as':_0x331e('0x19d'),'foreignKey':'FieldId'});db['SugarcrmField']['belongsTo'](db['Variable'],{'as':_0x331e('0x19e'),'foreignKey':_0x331e('0x19f')});db['DeskAccount']['hasMany'](db[_0x331e('0xa9')],{'as':_0x331e('0x195'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x331e('0xa9')][_0x331e('0xf9')](db['DeskField'],{'as':_0x331e('0x1a0'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x19a')});db['DeskConfiguration']['hasMany'](db[_0x331e('0x1a1')],{'as':_0x331e('0x197'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0xa9')]['hasMany'](db['DeskField'],{'as':_0x331e('0x193'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x198')});db['DeskConfiguration'][_0x331e('0x106')](db[_0x331e('0xa7')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x196')});db['DeskConfiguration'][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':_0x331e('0x1a2')});db['DeskField'][_0x331e('0xf9')](db[_0x331e('0x1a1')],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db['DeskField'][_0x331e('0xf9')](db[_0x331e('0x1a1')],{'as':_0x331e('0x19b'),'foreignKey':'DescriptionId'});db[_0x331e('0x1a1')][_0x331e('0xf9')](db[_0x331e('0x1a1')],{'as':_0x331e('0x19d'),'foreignKey':_0x331e('0x198')});db[_0x331e('0x1a1')][_0x331e('0x106')](db['Variable'],{'as':_0x331e('0x19e'),'foreignKey':_0x331e('0x19f')});db[_0x331e('0xaa')]['hasMany'](db[_0x331e('0x1a3')],{'as':'Configurations','onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x196')});db[_0x331e('0x1a3')][_0x331e('0xf9')](db['ZohoField'],{'as':_0x331e('0x1a0'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0x1a3')][_0x331e('0xf9')](db[_0x331e('0x1a4')],{'as':_0x331e('0x197'),'onDelete':'cascade','foreignKey':_0x331e('0x19c')});db[_0x331e('0x1a3')][_0x331e('0xf9')](db[_0x331e('0x1a4')],{'as':_0x331e('0x193'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x331e('0x1a3')][_0x331e('0x106')](db[_0x331e('0xaa')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x196')});db[_0x331e('0x1a4')][_0x331e('0xf9')](db[_0x331e('0x1a4')],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0x1a4')][_0x331e('0xf9')](db['ZohoField'],{'as':_0x331e('0x19b'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0x1a4')]['hasMany'](db[_0x331e('0x1a4')],{'as':_0x331e('0x19d'),'foreignKey':_0x331e('0x198')});db[_0x331e('0x1a4')][_0x331e('0x106')](db[_0x331e('0x19e')],{'as':'Variable','foreignKey':_0x331e('0x19f')});db[_0x331e('0xac')][_0x331e('0xf9')](db[_0x331e('0xae')],{'as':'Configurations','onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x196')});db[_0x331e('0xae')][_0x331e('0xf9')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x331e('0x19a')});db['ZendeskConfiguration'][_0x331e('0xf9')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x331e('0x19c')});db[_0x331e('0xae')]['hasMany'](db[_0x331e('0x1a5')],{'as':_0x331e('0x193'),'foreignKey':_0x331e('0x198')});db['ZendeskConfiguration'][_0x331e('0x106')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x331e('0x196')});db['ZendeskConfiguration'][_0x331e('0x108')](db['Tag'],{'through':_0x331e('0x1a6')});db[_0x331e('0x1a5')][_0x331e('0xf9')](db[_0x331e('0x1a5')],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0x1a5')][_0x331e('0xf9')](db['ZendeskField'],{'as':'Description','foreignKey':_0x331e('0x19c')});db[_0x331e('0x1a5')][_0x331e('0xf9')](db[_0x331e('0x1a5')],{'as':_0x331e('0x19d'),'foreignKey':'FieldId'});db[_0x331e('0x1a5')][_0x331e('0x106')](db[_0x331e('0x19e')],{'as':_0x331e('0x19e'),'foreignKey':_0x331e('0x19f')});db[_0x331e('0xb1')][_0x331e('0xf9')](db[_0x331e('0xb3')],{'as':_0x331e('0x195'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x196')});db[_0x331e('0xb3')][_0x331e('0xf9')](db[_0x331e('0xb5')],{'as':_0x331e('0x1a0'),'onDelete':'cascade','foreignKey':_0x331e('0x19a')});db[_0x331e('0xb3')]['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0xb3')][_0x331e('0xf9')](db[_0x331e('0xb5')],{'as':_0x331e('0x193'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x198')});db[_0x331e('0xb3')][_0x331e('0x106')](db[_0x331e('0xb1')],{'as':'Account','foreignKey':_0x331e('0x196')});db[_0x331e('0xb3')][_0x331e('0x108')](db[_0x331e('0x8c')],{'through':_0x331e('0x1a7')});db[_0x331e('0xb5')]['hasMany'](db['FreshdeskField'],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0xb5')][_0x331e('0xf9')](db[_0x331e('0xb5')],{'as':'Description','foreignKey':_0x331e('0x19c')});db[_0x331e('0xb5')][_0x331e('0xf9')](db['FreshdeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x331e('0xb5')][_0x331e('0x106')](db[_0x331e('0x19e')],{'as':'Variable','foreignKey':_0x331e('0x19f')});db[_0x331e('0xb7')][_0x331e('0xf9')](db['VtigerConfiguration'],{'as':_0x331e('0x195'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x196')});db['VtigerConfiguration']['hasMany'](db[_0x331e('0xba')],{'as':'Subjects','foreignKey':_0x331e('0x19a')});db[_0x331e('0x1a8')][_0x331e('0xf9')](db[_0x331e('0xba')],{'as':_0x331e('0x197'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0x1a8')][_0x331e('0xf9')](db[_0x331e('0xba')],{'as':_0x331e('0x193'),'foreignKey':_0x331e('0x198')});db['VtigerConfiguration'][_0x331e('0x106')](db[_0x331e('0xb7')],{'as':'Account','foreignKey':_0x331e('0x196')});db[_0x331e('0x1a8')]['belongsToMany'](db[_0x331e('0x8c')],{'through':'int_vtiger_configuration_has_tags'});db['VtigerField']['hasMany'](db[_0x331e('0xba')],{'as':_0x331e('0x199'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db[_0x331e('0xba')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x331e('0xba')][_0x331e('0xf9')](db[_0x331e('0xba')],{'as':'Field','foreignKey':_0x331e('0x198')});db[_0x331e('0xba')][_0x331e('0x106')](db['Variable'],{'as':'Variable','foreignKey':_0x331e('0x19f')});db[_0x331e('0xbb')][_0x331e('0xf9')](db[_0x331e('0xbd')],{'as':_0x331e('0x195'),'onDelete':'cascade','foreignKey':_0x331e('0x196')});db[_0x331e('0xbd')][_0x331e('0xf9')](db['ServicenowField'],{'as':_0x331e('0x1a0'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0xbd')][_0x331e('0xf9')](db[_0x331e('0xbf')],{'as':_0x331e('0x197'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0xbd')]['hasMany'](db[_0x331e('0xbf')],{'as':'Fields','foreignKey':'FieldId'});db[_0x331e('0xbd')][_0x331e('0x106')](db[_0x331e('0xbb')],{'as':_0x331e('0x15f'),'foreignKey':_0x331e('0x196')});db[_0x331e('0xbf')][_0x331e('0xf9')](db[_0x331e('0xbf')],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db[_0x331e('0xbf')][_0x331e('0xf9')](db['ServicenowField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x331e('0xbf')][_0x331e('0xf9')](db['ServicenowField'],{'as':'Field','foreignKey':_0x331e('0x198')});db['ServicenowField'][_0x331e('0x106')](db[_0x331e('0x19e')],{'as':_0x331e('0x19e'),'foreignKey':_0x331e('0x19f')});db[_0x331e('0xc0')]['hasMany'](db[_0x331e('0xc2')],{'as':_0x331e('0x195'),'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x196')});db[_0x331e('0xc2')][_0x331e('0xf9')](db['Dynamics365Field'],{'as':_0x331e('0x1a0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x331e('0xc2')][_0x331e('0xf9')](db[_0x331e('0x1a9')],{'as':_0x331e('0x197'),'onDelete':'cascade','foreignKey':_0x331e('0x19c')});db[_0x331e('0xc2')]['hasMany'](db[_0x331e('0x1a9')],{'as':_0x331e('0x193'),'onDelete':'cascade','foreignKey':_0x331e('0x198')});db[_0x331e('0xc2')][_0x331e('0x106')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x331e('0x196')});db[_0x331e('0x1a9')][_0x331e('0xf9')](db[_0x331e('0x1a9')],{'as':_0x331e('0x199'),'foreignKey':_0x331e('0x19a')});db['Dynamics365Field']['hasMany'](db[_0x331e('0x1a9')],{'as':_0x331e('0x19b'),'foreignKey':_0x331e('0x19c')});db[_0x331e('0x1a9')][_0x331e('0xf9')](db[_0x331e('0x1a9')],{'as':_0x331e('0x19d'),'foreignKey':_0x331e('0x198')});db[_0x331e('0x1a9')][_0x331e('0x106')](db[_0x331e('0x19e')],{'as':_0x331e('0x19e'),'foreignKey':_0x331e('0x19f')});db[_0x331e('0x1aa')]['belongsTo'](db['ChatWebsite'],{});db[_0x331e('0x1aa')][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148')});db[_0x331e('0x1aa')][_0x331e('0x106')](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db[_0x331e('0x1aa')][_0x331e('0x106')](db[_0x331e('0x66')],{});db['ChatQueueReport'][_0x331e('0x106')](db['ChatMessage'],{});db[_0x331e('0x1aa')]['belongsTo'](db[_0x331e('0xf6')],{});db['ChatQueueReport'][_0x331e('0x106')](db['ChatQueue'],{});db[_0x331e('0x172')][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x1ab')});db[_0x331e('0x172')][_0x331e('0x106')](db[_0x331e('0xf6')],{'onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x1ac')});db[_0x331e('0xcb')]['hasMany'](db[_0x331e('0xc9')],{'foreignKey':'SessionId','onDelete':_0x331e('0xf8')});db[_0x331e('0xcb')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x331e('0x1ad'),'onDelete':_0x331e('0xf8')});db[_0x331e('0x1ae')][_0x331e('0x106')](db[_0x331e('0x51')],{});db[_0x331e('0x1ae')][_0x331e('0x106')](db[_0x331e('0xed')],{'as':_0x331e('0x147'),'foreignKey':_0x331e('0x148')});db['SmsQueueReport'][_0x331e('0x106')](db[_0x331e('0x71')],{'as':_0x331e('0x155'),'foreignKey':_0x331e('0x13f')});db['SmsQueueReport'][_0x331e('0x106')](db[_0x331e('0x55')],{});db[_0x331e('0x1ae')][_0x331e('0x106')](db[_0x331e('0x57')],{});db[_0x331e('0x1ae')][_0x331e('0x106')](db[_0x331e('0xf6')],{});db[_0x331e('0x1ae')][_0x331e('0x106')](db['SmsQueue'],{});db['JscriptyProject'][_0x331e('0xf9')](db['JscriptySessionReport'],{'foreignKey':_0x331e('0x1af')});db[_0x331e('0xd0')][_0x331e('0xf9')](db['JscriptyQuestionReport'],{'foreignKey':_0x331e('0x1af')});db['JscriptyProject']['hasMany'](db[_0x331e('0x1b0')],{'foreignKey':_0x331e('0x1af')});db[_0x331e('0xd3')]['belongsToMany'](db['User'],{'as':'Users','through':_0x331e('0x122')});db[_0x331e('0xd9')][_0x331e('0x108')](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x10b')});db[_0x331e('0xd9')]['belongsToMany'](db[_0x331e('0x111')],{'through':'team_has_voice_queues','as':_0x331e('0x1b1')});db['Team'][_0x331e('0x108')](db['MailQueue'],{'through':_0x331e('0x14c'),'as':_0x331e('0x112')});db[_0x331e('0xd9')][_0x331e('0x108')](db[_0x331e('0x6c')],{'through':_0x331e('0x171'),'as':_0x331e('0x113')});db[_0x331e('0xd9')][_0x331e('0x108')](db['FaxQueue'],{'through':_0x331e('0x1b2'),'as':_0x331e('0x115')});db[_0x331e('0xd9')][_0x331e('0x108')](db[_0x331e('0x116')],{'through':_0x331e('0x167'),'as':_0x331e('0x1b3')});db[_0x331e('0xd9')][_0x331e('0x108')](db[_0x331e('0x117')],{'through':_0x331e('0x1b4'),'as':'OpenchannelQueues'});db[_0x331e('0xdc')]['hasMany'](db[_0x331e('0x73')],{'as':_0x331e('0x176'),'foreignKey':'CampaignId'});db[_0x331e('0xdc')][_0x331e('0xf9')](db[_0x331e('0x77')],{'as':_0x331e('0xfe'),'foreignKey':'CampaignId'});db[_0x331e('0xdc')][_0x331e('0xf9')](db[_0x331e('0x78')],{'as':'HopperHistories','foreignKey':_0x331e('0x17d')});db['Campaign'][_0x331e('0xf9')](db[_0x331e('0x75')],{'as':_0x331e('0x12a'),'foreignKey':_0x331e('0x17d')});db[_0x331e('0xdc')][_0x331e('0x106')](db[_0x331e('0x27')],{'as':_0x331e('0x27'),'foreignKey':_0x331e('0x12c')});db[_0x331e('0xdc')][_0x331e('0x106')](db['Trunk'],{'as':_0x331e('0x12d'),'foreignKey':_0x331e('0x12e')});db['Campaign'][_0x331e('0x106')](db[_0x331e('0x84')],{'as':'Interval','foreignKey':_0x331e('0x12f')});db[_0x331e('0xdc')]['belongsTo'](db[_0x331e('0xd3')],{'as':'SquareProject','foreignKey':_0x331e('0x1b5')});db[_0x331e('0xdc')][_0x331e('0x108')](db[_0x331e('0xed')],{'as':_0x331e('0x131'),'through':'campaigns_has_cm_lists'});db[_0x331e('0xdc')][_0x331e('0x108')](db[_0x331e('0xed')],{'as':_0x331e('0x136'),'through':'campaigns_has_cm_blacklists'});db[_0x331e('0xe3')][_0x331e('0x106')](db[_0x331e('0x3e')],{});db['MailTransferReport'][_0x331e('0x106')](db[_0x331e('0x104')],{});db[_0x331e('0xe3')][_0x331e('0x106')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x331e('0x1b6')});db['MailTransferReport'][_0x331e('0x106')](db['User'],{'foreignKey':_0x331e('0x1b7'),'as':_0x331e('0x1b8')});db[_0x331e('0xe3')][_0x331e('0x106')](db[_0x331e('0xf6')],{'foreignKey':_0x331e('0x1b9'),'as':_0x331e('0x1ba')});db[_0x331e('0xe3')][_0x331e('0x106')](db[_0x331e('0x3a')],{'foreignKey':_0x331e('0x1bb'),'as':_0x331e('0x1bc')});db[_0x331e('0xe3')][_0x331e('0x106')](db[_0x331e('0x38')],{'foreignKey':_0x331e('0x1bd'),'as':_0x331e('0x1be')});db[_0x331e('0xe5')][_0x331e('0x106')](db[_0x331e('0x68')],{});db[_0x331e('0xe5')]['belongsTo'](db[_0x331e('0x66')],{});db[_0x331e('0xe5')][_0x331e('0x106')](db['ChatWebsite'],{'foreignKey':_0x331e('0x1bf'),'as':_0x331e('0x1b6')});db['ChatTransferReport'][_0x331e('0x106')](db[_0x331e('0xf6')],{'foreignKey':'FromUserId','as':_0x331e('0x1b8')});db[_0x331e('0xe5')]['belongsTo'](db[_0x331e('0xf6')],{'foreignKey':'ToUserId','as':_0x331e('0x1ba')});db[_0x331e('0xe5')]['belongsTo'](db[_0x331e('0x6c')],{'foreignKey':_0x331e('0x1c0'),'as':'ToQueue'});db[_0x331e('0xe5')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x331e('0x1c1'),'as':_0x331e('0x1be')});db[_0x331e('0xe7')]['belongsTo'](db[_0x331e('0x15c')],{});db[_0x331e('0xe7')]['belongsTo'](db['FaxInteraction'],{});db[_0x331e('0xe7')][_0x331e('0x106')](db[_0x331e('0x47')],{'foreignKey':_0x331e('0x1c2'),'as':_0x331e('0x1b6')});db[_0x331e('0xe7')][_0x331e('0x106')](db[_0x331e('0xf6')],{'foreignKey':_0x331e('0x1b7'),'as':_0x331e('0x1b8')});db['FaxTransferReport'][_0x331e('0x106')](db[_0x331e('0xf6')],{'foreignKey':_0x331e('0x1b9'),'as':_0x331e('0x1ba')});db[_0x331e('0xe7')][_0x331e('0x106')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x331e('0x1bc')});db['FaxTransferReport'][_0x331e('0x106')](db[_0x331e('0x47')],{'foreignKey':_0x331e('0x1c3'),'as':_0x331e('0x1be')});db['OpenchannelTransferReport']['belongsTo'](db[_0x331e('0x5e')],{});db[_0x331e('0xe9')][_0x331e('0x106')](db[_0x331e('0x5d')],{});db[_0x331e('0xe9')][_0x331e('0x106')](db[_0x331e('0x59')],{'foreignKey':_0x331e('0x1c4'),'as':_0x331e('0x1b6')});db[_0x331e('0xe9')][_0x331e('0x106')](db['User'],{'foreignKey':_0x331e('0x1b7'),'as':_0x331e('0x1b8')});db[_0x331e('0xe9')]['belongsTo'](db[_0x331e('0xf6')],{'foreignKey':_0x331e('0x1b9'),'as':_0x331e('0x1ba')});db[_0x331e('0xe9')][_0x331e('0x106')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0x331e('0x1bc')});db['OpenchannelTransferReport']['belongsTo'](db[_0x331e('0x59')],{'foreignKey':_0x331e('0x1c5'),'as':_0x331e('0x1be')});db[_0x331e('0xeb')][_0x331e('0x106')](db[_0x331e('0x57')],{});db['SmsTransferReport']['belongsTo'](db[_0x331e('0x55')],{});db['SmsTransferReport'][_0x331e('0x106')](db[_0x331e('0x51')],{'foreignKey':_0x331e('0x1c6'),'as':_0x331e('0x1b6')});db['SmsTransferReport'][_0x331e('0x106')](db[_0x331e('0xf6')],{'foreignKey':_0x331e('0x1b7'),'as':'FromAgent'});db[_0x331e('0xeb')][_0x331e('0x106')](db[_0x331e('0xf6')],{'foreignKey':'ToUserId','as':_0x331e('0x1ba')});db[_0x331e('0xeb')][_0x331e('0x106')](db['SmsQueue'],{'foreignKey':_0x331e('0x1c7'),'as':'ToQueue'});db['SmsTransferReport']['belongsTo'](db[_0x331e('0x51')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x331e('0xed')][_0x331e('0xf9')](db[_0x331e('0x144')],{'as':_0x331e('0x145'),'foreignKey':_0x331e('0x148')});db[_0x331e('0xed')][_0x331e('0xf9')](db[_0x331e('0x7b')],{'as':'CustomFields','foreignKey':_0x331e('0x148')});db[_0x331e('0xed')]['hasMany'](db[_0x331e('0x71')],{'as':'Contacts','onDelete':_0x331e('0xf8'),'foreignKey':_0x331e('0x148')});db[_0x331e('0xed')][_0x331e('0xf9')](db['CmHopperFinal'],{'as':_0x331e('0xfe'),'foreignKey':_0x331e('0x148')});db['CmList']['hasMany'](db[_0x331e('0x78')],{'as':_0x331e('0xff'),'foreignKey':_0x331e('0x148')});db[_0x331e('0xed')][_0x331e('0xf9')](db[_0x331e('0x7a')],{'as':_0x331e('0x7a'),'foreignKey':_0x331e('0x148')});db[_0x331e('0xed')]['belongsToMany'](db[_0x331e('0x111')],{'as':_0x331e('0x1c8'),'through':_0x331e('0x132')});db[_0x331e('0xed')]['belongsToMany'](db[_0x331e('0xf6')],{'as':_0x331e('0x133'),'through':_0x331e('0x10a')});db[_0x331e('0xee')][_0x331e('0xf9')](db[_0x331e('0x17')],{'as':_0x331e('0xfd'),'onDelete':_0x331e('0x157')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':'Agents','through':_0x331e('0x1c9')});db['UserProfile'][_0x331e('0xf9')](db[_0x331e('0xf6')],{'as':_0x331e('0x151'),'foreignKey':_0x331e('0x107')});db[_0x331e('0xf0')]['hasMany'](db[_0x331e('0xf2')],{'as':_0x331e('0x1ca'),'foreignKey':_0x331e('0x107'),'onDelete':_0x331e('0xf8')});db[_0x331e('0xf2')][_0x331e('0xf9')](db['UserProfileResource'],{'as':_0x331e('0x1cb'),'foreignKey':_0x331e('0x1cc'),'onDelete':_0x331e('0xf8')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ab7a042..630ce0c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf487=['./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/integration','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./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/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./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/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/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','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','/www','join','root','/demo','/snippet','snippet','1.0.15','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','path','express-winston','util','./config/logger','api','auth','default','use','%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','name','user','role','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount'];(function(_0x19eaa9,_0x1fbf6b){var _0x25fa51=function(_0xe48acd){while(--_0xe48acd){_0x19eaa9['push'](_0x19eaa9['shift']());}};_0x25fa51(++_0x1fbf6b);}(_0xf487,0x1e7));var _0x7f48=function(_0x22f466,_0x5d2d30){_0x22f466=_0x22f466-0x0;var _0x204d14=_0xf487[_0x22f466];return _0x204d14;};'use strict';var path=require(_0x7f48('0x0'));var express=require('express');var ewinston=require(_0x7f48('0x1'));var util=require(_0x7f48('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x7f48('0x3'))(_0x7f48('0x4'));var authLogger=require(_0x7f48('0x3'))(_0x7f48('0x5'));exports[_0x7f48('0x6')]=function(_0x106725){_0x106725[_0x7f48('0x7')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4cce06,_0x580006){return util['format'](_0x7f48('0x8'),_0x4cce06[_0x7f48('0x9')],_0x4cce06[_0x7f48('0xa')][_0x7f48('0xb')]?_0x4cce06[_0x7f48('0xa')][_0x7f48('0xb')]:_0x4cce06[_0x7f48('0xc')][_0x7f48('0xd')]||_0x4cce06['ip'],_0x4cce06[_0x7f48('0xe')],_0x580006[_0x7f48('0xf')],_0x580006[_0x7f48('0x10')],_0x4cce06['user']?_0x4cce06['user']['id']:null,_0x4cce06['user']?_0x4cce06['user'][_0x7f48('0x11')]:null,_0x4cce06['user']?_0x4cce06[_0x7f48('0x12')][_0x7f48('0x13')]:null);}}));_0x106725[_0x7f48('0x7')](ewinston[_0x7f48('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x52a57f,_0x7d3cb5){var _0x37ff16=_0x7f48('0x15');if(_0x52a57f['body']&&_0x52a57f[_0x7f48('0x16')][_0x7f48('0x17')]&&_0x52a57f[_0x7f48('0x16')][_0x7f48('0x18')]){_0x37ff16='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x37ff16,_0x52a57f[_0x7f48('0x9')],_0x52a57f[_0x7f48('0xa')][_0x7f48('0xb')]?_0x52a57f[_0x7f48('0xa')][_0x7f48('0xb')]:_0x52a57f[_0x7f48('0xc')]['remoteAddress']||_0x52a57f['ip'],_0x52a57f[_0x7f48('0xe')],_0x7d3cb5[_0x7f48('0xf')],_0x7d3cb5[_0x7f48('0x10')],_0x52a57f[_0x7f48('0x12')]?_0x52a57f[_0x7f48('0x12')]['id']:null,_0x52a57f['user']?_0x52a57f[_0x7f48('0x12')][_0x7f48('0x11')]:null,_0x52a57f['user']?_0x52a57f[_0x7f48('0x12')][_0x7f48('0x13')]:null,_0x52a57f[_0x7f48('0x16')]&&_0x52a57f[_0x7f48('0x16')][_0x7f48('0x17')]?_0x52a57f[_0x7f48('0x16')][_0x7f48('0x17')]:_0x7f48('0x19'),_0x52a57f[_0x7f48('0x16')]&&_0x52a57f[_0x7f48('0x16')][_0x7f48('0x18')]?_0x52a57f['body'][_0x7f48('0x18')]:'',_0x52a57f[_0x7f48('0x16')]&&_0x52a57f['body'][_0x7f48('0x1a')]?_0x52a57f['body'][_0x7f48('0x1a')]:'');},'ignoreRoute':function(_0x4d29ea){var _0x1a1aa8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1a1aa8['test'](_0x4d29ea[_0x7f48('0xe')]);}}));_0x106725[_0x7f48('0x7')](_0x7f48('0x1b'),require(_0x7f48('0x1c')));_0x106725[_0x7f48('0x7')](_0x7f48('0x1d'),require(_0x7f48('0x1e')));_0x106725[_0x7f48('0x7')]('/api/voice/contexts',require(_0x7f48('0x1f')));_0x106725[_0x7f48('0x7')]('/api/voice/extensions',require(_0x7f48('0x20')));_0x106725[_0x7f48('0x7')](_0x7f48('0x21'),require(_0x7f48('0x22')));_0x106725[_0x7f48('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x106725['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x106725[_0x7f48('0x7')](_0x7f48('0x23'),require(_0x7f48('0x24')));_0x106725[_0x7f48('0x7')](_0x7f48('0x25'),require(_0x7f48('0x26')));_0x106725[_0x7f48('0x7')](_0x7f48('0x27'),require(_0x7f48('0x28')));_0x106725[_0x7f48('0x7')](_0x7f48('0x29'),require(_0x7f48('0x2a')));_0x106725[_0x7f48('0x7')](_0x7f48('0x2b'),require(_0x7f48('0x2c')));_0x106725[_0x7f48('0x7')](_0x7f48('0x2d'),require(_0x7f48('0x2e')));_0x106725[_0x7f48('0x7')](_0x7f48('0x2f'),require(_0x7f48('0x30')));_0x106725[_0x7f48('0x7')](_0x7f48('0x31'),require(_0x7f48('0x32')));_0x106725[_0x7f48('0x7')](_0x7f48('0x33'),require('./api/trunk'));_0x106725[_0x7f48('0x7')](_0x7f48('0x34'),require(_0x7f48('0x35')));_0x106725[_0x7f48('0x7')]('/api/mail/out_servers',require(_0x7f48('0x36')));_0x106725[_0x7f48('0x7')](_0x7f48('0x37'),require(_0x7f48('0x38')));_0x106725['use']('/api/mail/queues',require('./api/mailQueue'));_0x106725[_0x7f48('0x7')]('/api/mail/substatuses',require(_0x7f48('0x39')));_0x106725[_0x7f48('0x7')](_0x7f48('0x3a'),require(_0x7f48('0x3b')));_0x106725[_0x7f48('0x7')](_0x7f48('0x3c'),require(_0x7f48('0x3d')));_0x106725['use']('/api/mail/applications',require(_0x7f48('0x3e')));_0x106725[_0x7f48('0x7')](_0x7f48('0x3f'),require(_0x7f48('0x40')));_0x106725[_0x7f48('0x7')](_0x7f48('0x41'),require(_0x7f48('0x42')));_0x106725[_0x7f48('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x106725[_0x7f48('0x7')]('/api/fax/accounts',require(_0x7f48('0x43')));_0x106725[_0x7f48('0x7')](_0x7f48('0x44'),require(_0x7f48('0x45')));_0x106725[_0x7f48('0x7')]('/api/fax/interactions',require(_0x7f48('0x46')));_0x106725[_0x7f48('0x7')](_0x7f48('0x47'),require('./api/faxMessage'));_0x106725['use']('/api/fax/queues',require(_0x7f48('0x48')));_0x106725[_0x7f48('0x7')](_0x7f48('0x49'),require('./api/faxQueueReport'));_0x106725[_0x7f48('0x7')](_0x7f48('0x4a'),require(_0x7f48('0x4b')));_0x106725['use']('/api/sms/applications',require(_0x7f48('0x4c')));_0x106725[_0x7f48('0x7')]('/api/sms/interactions',require(_0x7f48('0x4d')));_0x106725[_0x7f48('0x7')](_0x7f48('0x4e'),require('./api/smsMessage'));_0x106725[_0x7f48('0x7')](_0x7f48('0x4f'),require(_0x7f48('0x50')));_0x106725['use']('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x106725['use'](_0x7f48('0x51'),require(_0x7f48('0x52')));_0x106725['use'](_0x7f48('0x53'),require(_0x7f48('0x54')));_0x106725[_0x7f48('0x7')](_0x7f48('0x55'),require(_0x7f48('0x56')));_0x106725[_0x7f48('0x7')](_0x7f48('0x57'),require(_0x7f48('0x58')));_0x106725['use']('/api/chat/websites',require('./api/chatWebsite'));_0x106725[_0x7f48('0x7')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x106725['use'](_0x7f48('0x59'),require(_0x7f48('0x5a')));_0x106725[_0x7f48('0x7')](_0x7f48('0x5b'),require(_0x7f48('0x5c')));_0x106725[_0x7f48('0x7')](_0x7f48('0x5d'),require(_0x7f48('0x5e')));_0x106725['use'](_0x7f48('0x5f'),require(_0x7f48('0x60')));_0x106725[_0x7f48('0x7')](_0x7f48('0x61'),require('./api/chatQueue'));_0x106725['use'](_0x7f48('0x62'),require(_0x7f48('0x63')));_0x106725['use'](_0x7f48('0x64'),require(_0x7f48('0x65')));_0x106725[_0x7f48('0x7')]('/api/cm/companies',require(_0x7f48('0x66')));_0x106725[_0x7f48('0x7')](_0x7f48('0x67'),require(_0x7f48('0x68')));_0x106725[_0x7f48('0x7')](_0x7f48('0x69'),require(_0x7f48('0x6a')));_0x106725[_0x7f48('0x7')](_0x7f48('0x6b'),require(_0x7f48('0x6c')));_0x106725[_0x7f48('0x7')](_0x7f48('0x6d'),require(_0x7f48('0x6e')));_0x106725[_0x7f48('0x7')]('/api/cm/hopper_history',require(_0x7f48('0x6f')));_0x106725['use'](_0x7f48('0x70'),require('./api/cmCustomField'));_0x106725['use'](_0x7f48('0x71'),require(_0x7f48('0x72')));_0x106725[_0x7f48('0x7')](_0x7f48('0x73'),require(_0x7f48('0x74')));_0x106725[_0x7f48('0x7')](_0x7f48('0x75'),require(_0x7f48('0x76')));_0x106725[_0x7f48('0x7')](_0x7f48('0x77'),require(_0x7f48('0x78')));_0x106725['use'](_0x7f48('0x79'),require(_0x7f48('0x7a')));_0x106725[_0x7f48('0x7')](_0x7f48('0x7b'),require(_0x7f48('0x7c')));_0x106725[_0x7f48('0x7')](_0x7f48('0x7d'),require(_0x7f48('0x7e')));_0x106725['use'](_0x7f48('0x7f'),require(_0x7f48('0x80')));_0x106725['use'](_0x7f48('0x81'),require(_0x7f48('0x82')));_0x106725['use']('/api/schedules',require('./api/schedule'));_0x106725[_0x7f48('0x7')](_0x7f48('0x83'),require(_0x7f48('0x84')));_0x106725['use'](_0x7f48('0x85'),require(_0x7f48('0x86')));_0x106725['use'](_0x7f48('0x87'),require(_0x7f48('0x88')));_0x106725[_0x7f48('0x7')](_0x7f48('0x89'),require(_0x7f48('0x8a')));_0x106725[_0x7f48('0x7')]('/api/variables',require('./api/variable'));_0x106725['use']('/api/integrations',require(_0x7f48('0x8b')));_0x106725['use']('/api/integrations/reports',require(_0x7f48('0x8c')));_0x106725['use'](_0x7f48('0x8d'),require('./api/analyticCustomReport'));_0x106725[_0x7f48('0x7')](_0x7f48('0x8e'),require(_0x7f48('0x8f')));_0x106725[_0x7f48('0x7')]('/api/analytics/extracted_reports',require(_0x7f48('0x90')));_0x106725[_0x7f48('0x7')](_0x7f48('0x91'),require('./api/analyticMetric'));_0x106725['use'](_0x7f48('0x92'),require(_0x7f48('0x93')));_0x106725['use']('/api/analytics/tree_reports',require(_0x7f48('0x94')));_0x106725['use']('/api/integrations/salesforce/accounts',require(_0x7f48('0x95')));_0x106725['use'](_0x7f48('0x96'),require(_0x7f48('0x97')));_0x106725[_0x7f48('0x7')](_0x7f48('0x98'),require('./api/intSalesforceField'));_0x106725[_0x7f48('0x7')](_0x7f48('0x99'),require(_0x7f48('0x9a')));_0x106725[_0x7f48('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x7f48('0x9b')));_0x106725[_0x7f48('0x7')](_0x7f48('0x9c'),require(_0x7f48('0x9d')));_0x106725[_0x7f48('0x7')](_0x7f48('0x9e'),require(_0x7f48('0x9f')));_0x106725[_0x7f48('0x7')]('/api/integrations/desk/configurations',require(_0x7f48('0xa0')));_0x106725[_0x7f48('0x7')]('/api/integrations/desk/fields',require(_0x7f48('0xa1')));_0x106725[_0x7f48('0x7')](_0x7f48('0xa2'),require(_0x7f48('0xa3')));_0x106725[_0x7f48('0x7')](_0x7f48('0xa4'),require(_0x7f48('0xa5')));_0x106725['use'](_0x7f48('0xa6'),require(_0x7f48('0xa7')));_0x106725[_0x7f48('0x7')](_0x7f48('0xa8'),require(_0x7f48('0xa9')));_0x106725[_0x7f48('0x7')](_0x7f48('0xaa'),require(_0x7f48('0xab')));_0x106725[_0x7f48('0x7')](_0x7f48('0xac'),require(_0x7f48('0xad')));_0x106725[_0x7f48('0x7')](_0x7f48('0xae'),require(_0x7f48('0xaf')));_0x106725[_0x7f48('0x7')]('/api/integrations/freshdesk/configurations',require(_0x7f48('0xb0')));_0x106725['use'](_0x7f48('0xb1'),require('./api/intFreshdeskField'));_0x106725['use'](_0x7f48('0xb2'),require(_0x7f48('0xb3')));_0x106725[_0x7f48('0x7')](_0x7f48('0xb4'),require(_0x7f48('0xb5')));_0x106725[_0x7f48('0x7')](_0x7f48('0xb6'),require(_0x7f48('0xb7')));_0x106725['use'](_0x7f48('0xb8'),require(_0x7f48('0xb9')));_0x106725[_0x7f48('0x7')](_0x7f48('0xba'),require(_0x7f48('0xbb')));_0x106725[_0x7f48('0x7')](_0x7f48('0xbc'),require(_0x7f48('0xbd')));_0x106725[_0x7f48('0x7')](_0x7f48('0xbe'),require(_0x7f48('0xbf')));_0x106725[_0x7f48('0x7')]('/api/integrations/dynamics365/configurations',require(_0x7f48('0xc0')));_0x106725[_0x7f48('0x7')](_0x7f48('0xc1'),require('./api/intDynamics365Field'));_0x106725[_0x7f48('0x7')]('/api/networks',require(_0x7f48('0xc2')));_0x106725['use'](_0x7f48('0xc3'),require(_0x7f48('0xc4')));_0x106725[_0x7f48('0x7')](_0x7f48('0xc5'),require('./api/chatInternalMessage'));_0x106725[_0x7f48('0x7')](_0x7f48('0xc6'),require(_0x7f48('0xc7')));_0x106725['use'](_0x7f48('0xc8'),require(_0x7f48('0xc9')));_0x106725[_0x7f48('0x7')]('/api/jscripty/sessions/reports',require(_0x7f48('0xca')));_0x106725['use'](_0x7f48('0xcb'),require(_0x7f48('0xcc')));_0x106725['use'](_0x7f48('0xcd'),require(_0x7f48('0xce')));_0x106725[_0x7f48('0x7')](_0x7f48('0xcf'),require('./api/squareReportDetail'));_0x106725[_0x7f48('0x7')](_0x7f48('0xd0'),require(_0x7f48('0xd1')));_0x106725[_0x7f48('0x7')](_0x7f48('0xd2'),require(_0x7f48('0xd3')));_0x106725[_0x7f48('0x7')](_0x7f48('0xd4'),require('./api/squareOdbc'));_0x106725[_0x7f48('0x7')](_0x7f48('0xd5'),require('./api/squareProject'));_0x106725[_0x7f48('0x7')](_0x7f48('0xd6'),require(_0x7f48('0xd7')));_0x106725[_0x7f48('0x7')]('/api/square/messages',require(_0x7f48('0xd8')));_0x106725[_0x7f48('0x7')](_0x7f48('0xd9'),require(_0x7f48('0xda')));_0x106725[_0x7f48('0x7')]('/api/license',require(_0x7f48('0xdb')));_0x106725[_0x7f48('0x7')]('/api/campaigns',require(_0x7f48('0xdc')));_0x106725[_0x7f48('0x7')](_0x7f48('0xdd'),require(_0x7f48('0xde')));_0x106725['use'](_0x7f48('0xdf'),require(_0x7f48('0xe0')));_0x106725['use'](_0x7f48('0xe1'),require(_0x7f48('0xe2')));_0x106725['use'](_0x7f48('0xe3'),require('./api/mailTransferReport'));_0x106725[_0x7f48('0x7')](_0x7f48('0xe4'),require(_0x7f48('0xe5')));_0x106725[_0x7f48('0x7')](_0x7f48('0xe6'),require(_0x7f48('0xe7')));_0x106725[_0x7f48('0x7')](_0x7f48('0xe8'),require(_0x7f48('0xe9')));_0x106725[_0x7f48('0x7')](_0x7f48('0xea'),require(_0x7f48('0xeb')));_0x106725[_0x7f48('0x7')](_0x7f48('0xec'),require(_0x7f48('0xed')));_0x106725[_0x7f48('0x7')](_0x7f48('0xee'),require('./api/voicePrefix'));_0x106725[_0x7f48('0x7')]('/api/userProfiles',require(_0x7f48('0xef')));_0x106725[_0x7f48('0x7')](_0x7f48('0xf0'),require(_0x7f48('0xf1')));_0x106725['use'](_0x7f48('0xf2'),require(_0x7f48('0xf3')));_0x106725[_0x7f48('0x7')](_0x7f48('0xf4'),require('./api/authLocal'));_0x106725[_0x7f48('0x7')](_0x7f48('0xf5'),require(_0x7f48('0xf6')));_0x106725[_0x7f48('0x7')](_0x7f48('0xf7'),require('./api/jira'));_0x106725[_0x7f48('0x7')](_0x7f48('0xf8'),require(_0x7f48('0xf9')));_0x106725[_0x7f48('0x7')](_0x7f48('0xfa'),require(_0x7f48('0xfb')));_0x106725[_0x7f48('0x7')](_0x7f48('0xfc'),require(_0x7f48('0xfd')));_0x106725[_0x7f48('0x7')](_0x7f48('0xfe'),require(_0x7f48('0xff')));_0x106725['use'](_0x7f48('0x100'),express[_0x7f48('0x101')](path['join'](config['root'],_0x7f48('0x100'))));_0x106725[_0x7f48('0x7')](_0x7f48('0x102'),express[_0x7f48('0x101')](path[_0x7f48('0x103')](config[_0x7f48('0x104')],_0x7f48('0x102'))));_0x106725['use']('/demo',express[_0x7f48('0x101')](path[_0x7f48('0x103')](config['root'],_0x7f48('0x105'))));_0x106725[_0x7f48('0x7')](_0x7f48('0x106'),express['static'](path['join'](config['root'],_0x7f48('0x107'),_0x7f48('0x108'))));_0x106725[_0x7f48('0x7')](_0x7f48('0x109'),express[_0x7f48('0x101')](path[_0x7f48('0x103')](config[_0x7f48('0x104')],_0x7f48('0x10a'))));_0x106725[_0x7f48('0x10b')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x106725[_0x7f48('0x10b')]('/*')[_0x7f48('0x10c')](function(_0x45338e,_0x3837eb){_0x3837eb[_0x7f48('0x10d')](path[_0x7f48('0x10e')](_0x106725['get'](_0x7f48('0x10f'))+'/index.html'));});}; \ No newline at end of file +var _0xb089=['./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./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/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/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','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','static','root','/apidoc','/www','/demo','/snippet','join','snippet','1.0.15','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','appPath','/index.html','express','./config/environment','./config/logger','auth','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','name','use','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)','responseTime','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/chatWebsite','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0xb089,0x9f));var _0x9b08=function(_0x2b0a63,_0x140f30){_0x2b0a63=_0x2b0a63-0x0;var _0x5be57f=_0xb089[_0x2b0a63];return _0x5be57f;};'use strict';var path=require('path');var express=require(_0x9b08('0x0'));var ewinston=require('express-winston');var util=require('util');var errors=require('./errors');var config=require(_0x9b08('0x1'));var logger=require(_0x9b08('0x2'))('api');var authLogger=require('./config/logger')(_0x9b08('0x3'));exports['default']=function(_0x5c3c71){_0x5c3c71['use'](ewinston[_0x9b08('0x4')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5a9045,_0x3daeff){return util[_0x9b08('0x5')](_0x9b08('0x6'),_0x5a9045['method'],_0x5a9045[_0x9b08('0x7')][_0x9b08('0x8')]?_0x5a9045[_0x9b08('0x7')][_0x9b08('0x8')]:_0x5a9045[_0x9b08('0x9')][_0x9b08('0xa')]||_0x5a9045['ip'],_0x5a9045[_0x9b08('0xb')],_0x3daeff[_0x9b08('0xc')],_0x3daeff['responseTime'],_0x5a9045[_0x9b08('0xd')]?_0x5a9045[_0x9b08('0xd')]['id']:null,_0x5a9045[_0x9b08('0xd')]?_0x5a9045[_0x9b08('0xd')][_0x9b08('0xe')]:null,_0x5a9045['user']?_0x5a9045['user']['role']:null);}}));_0x5c3c71[_0x9b08('0xf')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x31e103,_0x396ac0){var _0x5e6f9e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x31e103[_0x9b08('0x10')]&&_0x31e103[_0x9b08('0x10')][_0x9b08('0x11')]&&_0x31e103[_0x9b08('0x10')][_0x9b08('0x12')]){_0x5e6f9e=_0x9b08('0x13');}return util['format'](_0x5e6f9e,_0x31e103['method'],_0x31e103['headers'][_0x9b08('0x8')]?_0x31e103[_0x9b08('0x7')][_0x9b08('0x8')]:_0x31e103['connection']['remoteAddress']||_0x31e103['ip'],_0x31e103[_0x9b08('0xb')],_0x396ac0[_0x9b08('0xc')],_0x396ac0[_0x9b08('0x14')],_0x31e103['user']?_0x31e103[_0x9b08('0xd')]['id']:null,_0x31e103[_0x9b08('0xd')]?_0x31e103[_0x9b08('0xd')][_0x9b08('0xe')]:null,_0x31e103[_0x9b08('0xd')]?_0x31e103['user']['role']:null,_0x31e103['body']&&_0x31e103[_0x9b08('0x10')][_0x9b08('0x11')]?_0x31e103[_0x9b08('0x10')][_0x9b08('0x11')]:_0x9b08('0x15'),_0x31e103['body']&&_0x31e103['body'][_0x9b08('0x12')]?_0x31e103[_0x9b08('0x10')][_0x9b08('0x12')]:'',_0x31e103['body']&&_0x31e103[_0x9b08('0x10')][_0x9b08('0x16')]?_0x31e103[_0x9b08('0x10')][_0x9b08('0x16')]:'');},'ignoreRoute':function(_0x448f47){var _0x588adc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x588adc[_0x9b08('0x17')](_0x448f47[_0x9b08('0xb')]);}}));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x18'),require(_0x9b08('0x19')));_0x5c3c71['use'](_0x9b08('0x1a'),require(_0x9b08('0x1b')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x1c'),require(_0x9b08('0x1d')));_0x5c3c71[_0x9b08('0xf')]('/api/voice/extensions',require('./api/voiceExtension'));_0x5c3c71['use'](_0x9b08('0x1e'),require('./api/voiceMusicOnHold'));_0x5c3c71[_0x9b08('0xf')]('/api/voice/queues',require(_0x9b08('0x1f')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x20'),require(_0x9b08('0x21')));_0x5c3c71[_0x9b08('0xf')]('/api/screen/recordings',require(_0x9b08('0x22')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x23'),require(_0x9b08('0x24')));_0x5c3c71['use']('/api/voice/mails/messages',require(_0x9b08('0x25')));_0x5c3c71[_0x9b08('0xf')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x26'),require(_0x9b08('0x27')));_0x5c3c71[_0x9b08('0xf')]('/api/voice/agents/reports',require(_0x9b08('0x28')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x29'),require(_0x9b08('0x2a')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x2b'),require(_0x9b08('0x2c')));_0x5c3c71[_0x9b08('0xf')]('/api/trunks',require(_0x9b08('0x2d')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x2e'),require(_0x9b08('0x2f')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x30'),require(_0x9b08('0x31')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x32'),require(_0x9b08('0x33')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x34'),require(_0x9b08('0x35')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x36'),require(_0x9b08('0x37')));_0x5c3c71[_0x9b08('0xf')]('/api/mail/interactions',require(_0x9b08('0x38')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x39'),require('./api/mailMessage'));_0x5c3c71['use']('/api/mail/applications',require(_0x9b08('0x3a')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x3b'),require(_0x9b08('0x3c')));_0x5c3c71['use'](_0x9b08('0x3d'),require(_0x9b08('0x3e')));_0x5c3c71[_0x9b08('0xf')]('/api/dashboards/items',require(_0x9b08('0x3f')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x40'),require(_0x9b08('0x41')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x42'),require(_0x9b08('0x43')));_0x5c3c71['use']('/api/fax/interactions',require(_0x9b08('0x44')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x45'),require(_0x9b08('0x46')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x47'),require(_0x9b08('0x48')));_0x5c3c71[_0x9b08('0xf')]('/api/fax/reports/queue',require(_0x9b08('0x49')));_0x5c3c71['use'](_0x9b08('0x4a'),require(_0x9b08('0x4b')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x4c'),require(_0x9b08('0x4d')));_0x5c3c71['use'](_0x9b08('0x4e'),require(_0x9b08('0x4f')));_0x5c3c71['use'](_0x9b08('0x50'),require(_0x9b08('0x51')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x52'),require(_0x9b08('0x53')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x54'),require('./api/openchannelAccount'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x55'),require(_0x9b08('0x56')));_0x5c3c71['use'](_0x9b08('0x57'),require(_0x9b08('0x58')));_0x5c3c71['use'](_0x9b08('0x59'),require(_0x9b08('0x5a')));_0x5c3c71[_0x9b08('0xf')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x5c3c71[_0x9b08('0xf')]('/api/chat/websites',require(_0x9b08('0x5b')));_0x5c3c71[_0x9b08('0xf')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x5c3c71['use'](_0x9b08('0x5c'),require(_0x9b08('0x5d')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x5e'),require(_0x9b08('0x5f')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x60'),require('./api/chatMessage'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x61'),require('./api/chatOfflineMessage'));_0x5c3c71[_0x9b08('0xf')]('/api/chat/queues',require(_0x9b08('0x62')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x63'),require(_0x9b08('0x64')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x65'),require(_0x9b08('0x66')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x67'),require(_0x9b08('0x68')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x69'),require('./api/cmContact'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x6a'),require(_0x9b08('0x6b')));_0x5c3c71[_0x9b08('0xf')]('/api/cm/hopper_black',require(_0x9b08('0x6c')));_0x5c3c71['use'](_0x9b08('0x6d'),require(_0x9b08('0x6e')));_0x5c3c71[_0x9b08('0xf')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x6f'),require(_0x9b08('0x70')));_0x5c3c71[_0x9b08('0xf')]('/api/actions',require(_0x9b08('0x71')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x72'),require('./api/automation'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x73'),require(_0x9b08('0x74')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x75'),require('./api/disposition'));_0x5c3c71[_0x9b08('0xf')]('/api/conditions',require(_0x9b08('0x76')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x77'),require(_0x9b08('0x78')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x79'),require(_0x9b08('0x7a')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x7b'),require(_0x9b08('0x7c')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x7d'),require('./api/voiceQueuesLog'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x7e'),require(_0x9b08('0x7f')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x80'),require(_0x9b08('0x81')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x82'),require(_0x9b08('0x83')));_0x5c3c71['use'](_0x9b08('0x84'),require(_0x9b08('0x85')));_0x5c3c71['use'](_0x9b08('0x86'),require(_0x9b08('0x87')));_0x5c3c71['use'](_0x9b08('0x88'),require(_0x9b08('0x89')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x8a'),require(_0x9b08('0x8b')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x8c'),require('./api/integrationReport'));_0x5c3c71[_0x9b08('0xf')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x5c3c71[_0x9b08('0xf')]('/api/analytics/default_reports',require(_0x9b08('0x8d')));_0x5c3c71['use'](_0x9b08('0x8e'),require(_0x9b08('0x8f')));_0x5c3c71['use']('/api/analytics/metrics',require(_0x9b08('0x90')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x91'),require(_0x9b08('0x92')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x93'),require('./api/analyticTreeReport'));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/salesforce/accounts',require(_0x9b08('0x94')));_0x5c3c71['use'](_0x9b08('0x95'),require(_0x9b08('0x96')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x97'),require('./api/intSalesforceField'));_0x5c3c71['use'](_0x9b08('0x98'),require('./api/intSugarcrmAccount'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x99'),require(_0x9b08('0x9a')));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/sugarcrm/fields',require(_0x9b08('0x9b')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x9c'),require(_0x9b08('0x9d')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0x9e'),require(_0x9b08('0x9f')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xa0'),require(_0x9b08('0xa1')));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/zoho/accounts',require(_0x9b08('0xa2')));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/zoho/configurations',require(_0x9b08('0xa3')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xa4'),require(_0x9b08('0xa5')));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/zendesk/accounts',require(_0x9b08('0xa6')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xa7'),require(_0x9b08('0xa8')));_0x5c3c71['use'](_0x9b08('0xa9'),require('./api/intZendeskField'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xaa'),require(_0x9b08('0xab')));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/freshdesk/configurations',require(_0x9b08('0xac')));_0x5c3c71['use'](_0x9b08('0xad'),require(_0x9b08('0xae')));_0x5c3c71['use']('/api/integrations/vtiger/accounts',require(_0x9b08('0xaf')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xb0'),require(_0x9b08('0xb1')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xb2'),require(_0x9b08('0xb3')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xb4'),require(_0x9b08('0xb5')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xb6'),require('./api/intServicenowConfiguration'));_0x5c3c71[_0x9b08('0xf')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xb7'),require(_0x9b08('0xb8')));_0x5c3c71['use'](_0x9b08('0xb9'),require(_0x9b08('0xba')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xbb'),require('./api/intDynamics365Field'));_0x5c3c71['use'](_0x9b08('0xbc'),require(_0x9b08('0xbd')));_0x5c3c71[_0x9b08('0xf')]('/api/chat/reports/queue',require(_0x9b08('0xbe')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xbf'),require('./api/chatInternalMessage'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xc0'),require(_0x9b08('0xc1')));_0x5c3c71['use'](_0x9b08('0xc2'),require(_0x9b08('0xc3')));_0x5c3c71[_0x9b08('0xf')]('/api/jscripty/sessions/reports',require(_0x9b08('0xc4')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xc5'),require(_0x9b08('0xc6')));_0x5c3c71[_0x9b08('0xf')]('/api/square/reports',require(_0x9b08('0xc7')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xc8'),require('./api/squareReportDetail'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xc9'),require('./api/jscriptyProject'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xca'),require(_0x9b08('0xcb')));_0x5c3c71[_0x9b08('0xf')]('/api/square/odbc',require(_0x9b08('0xcc')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xcd'),require(_0x9b08('0xce')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xcf'),require('./api/squareRecording'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xd0'),require('./api/squareMessage'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xd1'),require(_0x9b08('0xd2')));_0x5c3c71['use'](_0x9b08('0xd3'),require(_0x9b08('0xd4')));_0x5c3c71['use']('/api/campaigns',require('./api/campaign'));_0x5c3c71[_0x9b08('0xf')]('/api/migrations',require('./api/migration'));_0x5c3c71['use'](_0x9b08('0xd5'),require(_0x9b08('0xd6')));_0x5c3c71['use'](_0x9b08('0xd7'),require(_0x9b08('0xd8')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xd9'),require('./api/mailTransferReport'));_0x5c3c71['use'](_0x9b08('0xda'),require('./api/chatTransferReport'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xdb'),require(_0x9b08('0xdc')));_0x5c3c71['use'](_0x9b08('0xdd'),require(_0x9b08('0xde')));_0x5c3c71['use'](_0x9b08('0xdf'),require(_0x9b08('0xe0')));_0x5c3c71['use'](_0x9b08('0xe1'),require(_0x9b08('0xe2')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xe3'),require('./api/voicePrefix'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xe4'),require(_0x9b08('0xe5')));_0x5c3c71[_0x9b08('0xf')]('/api/userProfile/sections',require(_0x9b08('0xe6')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xe7'),require(_0x9b08('0xe8')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xe9'),require(_0x9b08('0xea')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xeb'),require('./api/authGoogle'));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xec'),require(_0x9b08('0xed')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xee'),require(_0x9b08('0xef')));_0x5c3c71['use'](_0x9b08('0xf0'),require(_0x9b08('0xf1')));_0x5c3c71['use'](_0x9b08('0xf2'),require(_0x9b08('0xf3')));_0x5c3c71[_0x9b08('0xf')]('/api/pm2',require(_0x9b08('0xf4')));_0x5c3c71[_0x9b08('0xf')]('/apidoc',express[_0x9b08('0xf5')](path['join'](config[_0x9b08('0xf6')],_0x9b08('0xf7'))));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xf8'),express[_0x9b08('0xf5')](path['join'](config[_0x9b08('0xf6')],'/www')));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xf9'),express[_0x9b08('0xf5')](path['join'](config[_0x9b08('0xf6')],_0x9b08('0xf9'))));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xfa'),express['static'](path[_0x9b08('0xfb')](config[_0x9b08('0xf6')],_0x9b08('0xfc'),_0x9b08('0xfd'))));_0x5c3c71[_0x9b08('0xf')](_0x9b08('0xfe'),express[_0x9b08('0xf5')](path[_0x9b08('0xfb')](config[_0x9b08('0xf6')],'/server/files/plugins')));_0x5c3c71['route'](_0x9b08('0xff'))[_0x9b08('0x100')](errors[0x194]);_0x5c3c71[_0x9b08('0x101')]('/*')[_0x9b08('0x100')](function(_0x88ad8c,_0x29422b){_0x29422b['sendFile'](path[_0x9b08('0x102')](_0x5c3c71[_0x9b08('0x100')](_0x9b08('0x103'))+_0x9b08('0x104')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ae8c919..6e49055 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ee=['../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/voiceQueue/voiceQueue.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/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc'];(function(_0xe46696,_0x1b2c7e){var _0x88e1be=function(_0x119eab){while(--_0x119eab){_0xe46696['push'](_0xe46696['shift']());}};_0x88e1be(++_0x1b2c7e);}(_0xb2ee,0x1d9));var _0xeb2e=function(_0x3a691f,_0x3829d2){_0x3a691f=_0x3a691f-0x0;var _0x165f95=_0xb2ee[_0x3a691f];return _0x165f95;};'use strict';var jayson=require(_0xeb2e('0x0'));var BPromise=require(_0xeb2e('0x1'));var _=require(_0xeb2e('0x2'));var config=require(_0xeb2e('0x3'));exports[_0xeb2e('0x4')]=function(){return new BPromise(function(_0x26dec7,_0x6104da){var _0x25ab9e={};_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/user/user.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/voiceExtension/voiceExtension.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x6')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/voiceRecording/voiceRecording.rpc'));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x7')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x8')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x9')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0xa')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0xb')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0xc')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0xd')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0xe')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0xf')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x10')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x11')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x12')));_0x25ab9e=_['merge'](_0x25ab9e,require('../api/mailMessage/mailMessage.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/mailApplication/mailApplication.rpc'));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x13')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x14')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/faxApplication/faxApplication.rpc'));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x15')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x16')));_0x25ab9e=_['merge'](_0x25ab9e,require('../api/faxQueue/faxQueue.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/smsAccount/smsAccount.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/smsInteraction/smsInteraction.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x17')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/smsQueue/smsQueue.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x18')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x19')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x1a')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x1b')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x1c')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x1d')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x1e')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x1f')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x20')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x21')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x22')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x23')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x24')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x25')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/sound/sound.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/template/template.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/trigger/trigger.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x26')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x27')));_0x25ab9e=_['merge'](_0x25ab9e,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x28')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x29')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x2a')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x2b')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x2c')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x2d')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x2e')));_0x25ab9e=_['merge'](_0x25ab9e,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x2f')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x30')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x31')));_0x25ab9e=_['merge'](_0x25ab9e,require(_0xeb2e('0x32')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x33')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x34')));_0x25ab9e=_[_0xeb2e('0x5')](_0x25ab9e,require(_0xeb2e('0x35')));var _0x173c87=jayson[_0xeb2e('0x36')](_0x25ab9e)[_0xeb2e('0x37')]();var _0x543444=config[_0xeb2e('0x38')][_0xeb2e('0x39')]||config[_0xeb2e('0x39')]+0x1;var _0x4372b9=config[_0xeb2e('0x38')]['ip']||_0xeb2e('0x3a');_0x173c87['on'](_0xeb2e('0x3b'),function(_0x486821){return _0x6104da(_0x486821);});_0x173c87[_0xeb2e('0x4')](_0x543444,_0x4372b9,function(){console['log'](_0xeb2e('0x3c'),_0x4372b9,_0x543444);require('../config/triggers')[_0xeb2e('0x3d')]();return _0x26dec7('RPC\x20listening\x20on\x20'+_0x4372b9+':'+_0x543444);});});}; \ No newline at end of file +var _0xad6f=['../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.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/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/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','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailInteraction/mailInteraction.rpc'];(function(_0x38115a,_0x1edb45){var _0x25ec61=function(_0x4c1684){while(--_0x4c1684){_0x38115a['push'](_0x38115a['shift']());}};_0x25ec61(++_0x1edb45);}(_0xad6f,0x157));var _0xfad6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xad6f[_0x138adb];return _0x1b27f2;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfad6('0x0'));var _=require(_0xfad6('0x1'));var config=require(_0xfad6('0x2'));exports[_0xfad6('0x3')]=function(){return new BPromise(function(_0x5341e8,_0x25ce86){var _0x592fdb={};_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x5')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x6')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x7')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x8')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x9')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0xa')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0xb')));_0x592fdb=_['merge'](_0x592fdb,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0xc')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0xd')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0xe')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0xf')));_0x592fdb=_['merge'](_0x592fdb,require('../api/mailServerIn/mailServerIn.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require('../api/mailAccount/mailAccount.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require('../api/mailQueue/mailQueue.rpc'));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x10')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x11')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x12')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x13')));_0x592fdb=_['merge'](_0x592fdb,require('../api/faxAccount/faxAccount.rpc'));_0x592fdb=_['merge'](_0x592fdb,require('../api/faxApplication/faxApplication.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x14')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x15')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x16')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x17')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x18')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x19')));_0x592fdb=_['merge'](_0x592fdb,require('../api/smsMessage/smsMessage.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x1a')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x1b')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x1c')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x1d')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x1e')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x1f')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x20')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x21')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x22')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x23')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x24')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x25')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x26')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x27')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require('../api/interval/interval.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x28')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x29')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require('../api/template/template.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x2a')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x2b')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x2c')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x2d')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x2e')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x2f')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x30')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x31')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x32')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x33')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x34')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x35')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x36')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x37')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x38')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x39')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x3a')));_0x592fdb=_[_0xfad6('0x4')](_0x592fdb,require(_0xfad6('0x3b')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x3c')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x3d')));_0x592fdb=_['merge'](_0x592fdb,require(_0xfad6('0x3e')));var _0x536977=jayson[_0xfad6('0x3f')](_0x592fdb)[_0xfad6('0x40')]();var _0x4baaf4=config[_0xfad6('0x41')][_0xfad6('0x42')]||config[_0xfad6('0x42')]+0x1;var _0x5e7624=config[_0xfad6('0x41')]['ip']||'localhost';_0x536977['on'](_0xfad6('0x43'),function(_0x141231){return _0x25ce86(_0x141231);});_0x536977[_0xfad6('0x3')](_0x4baaf4,_0x5e7624,function(){console[_0xfad6('0x44')](_0xfad6('0x45'),_0x5e7624,_0x4baaf4);require(_0xfad6('0x46'))[_0xfad6('0x47')]();return _0x5341e8('RPC\x20listening\x20on\x20'+_0x5e7624+':'+_0x4baaf4);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 5659e69..b6da503 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 _0xdd71=['call','setEncoding','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','prototype','sendRequest','command','sync','getData','beep','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','AGI','wait','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0xdd71,0xe4));var _0x1dd7=function(_0xda529e,_0x58ac93){_0xda529e=_0xda529e-0x0;var _0x36aaa3=_0xdd71[_0xda529e];return _0x36aaa3;};'use strict';var util=require(_0x1dd7('0x0'));var _=require(_0x1dd7('0x1'));var EventEmitter=require(_0x1dd7('0x2'))[_0x1dd7('0x3')];var AGIReply=require(_0x1dd7('0x4'));var AGIError=require(_0x1dd7('0x5'));function AGIChannel(_0x16f92a){var _0x462d54=this,_0x1ae8b6=new AGIReply(),_0x3a0d81=![],_0x54ae5a={};EventEmitter[_0x1dd7('0x6')](_0x462d54);_0x16f92a[_0x1dd7('0x7')]('utf8');_0x16f92a[_0x1dd7('0x8')](0x8*0x3c*0x3c*0x3e8);_0x1ae8b6['setEncoding']('utf8');_0x1ae8b6['on'](_0x1dd7('0x9'),function(_0x301b9a){for(var _0x47f911 in _0x301b9a){_0x462d54[_0x47f911]=_0x301b9a[_0x47f911];}_0x462d54[_0x1dd7('0xa')](_0x1dd7('0xb'));});_0x1ae8b6['on'](_0x1dd7('0xc'),function(_0x5a1d4a){if(_0x5a1d4a[_0x1dd7('0xd')]()==_0x1dd7('0xe')){_0x462d54['emit'](_0x1dd7('0xe'));return;}if(_0x5a1d4a[_0x1dd7('0xf')](0x0,0xb)==_0x1dd7('0x10')){_0x3a0d81=!![];}if(_0x3a0d81){_0x54ae5a['rx']+=_0x5a1d4a+'\x0a';if(_0x5a1d4a[_0x1dd7('0x11')](_0x1dd7('0x12'))!=-0x1){_0x3a0d81=![];}}else{_0x54ae5a['rx']=_0x5a1d4a;}if(_0x3a0d81){return;}if(typeof _0x54ae5a['cb']==_0x1dd7('0x13')){var _0x40aa7c=_0x54ae5a['rx'][_0x1dd7('0xf')](0x0,0x3),_0x333376=null,_0x193b60=null;_0x40aa7c=parseInt(_0x40aa7c);if(isNaN(_0x40aa7c)){_0x54ae5a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1dd7('0x14')});return;}if(_0x40aa7c!=0xc8){_0x54ae5a['cb'](null,{'code':_0x40aa7c,'result':-0x1,'extra':'KO'});return;}_0x333376=_0x54ae5a['rx'][_0x1dd7('0xf')](0x4)[_0x1dd7('0x15')](_0x1dd7('0x16'),'');if(_0x333376[_0x1dd7('0x17')]('\x20')!=-0x1){_0x333376=_0x333376[_0x1dd7('0x18')](0x0,_0x333376[_0x1dd7('0x17')]('\x20'));}if(_[_0x1dd7('0x19')](_0x333376,'-1')){_0x333376=parseInt(_0x333376);}_0x193b60=_0x54ae5a['rx']['split']('\x20');if(_0x193b60['length']==0x3){_0x193b60=_0x193b60[0x2][_0x1dd7('0xf')](0x1,_0x193b60[0x2][_0x1dd7('0x1a')]-0x1);}else if(_0x193b60[_0x1dd7('0x1a')]>0x3){var _0x4c9a90=/\((.+)\)/;var _0x4608a8=_0x54ae5a['rx'][_0x1dd7('0x1b')](_0x4c9a90);if(_0x4608a8){_0x193b60=_0x4608a8[0x1];}else{_0x193b60=null;}}else{_0x193b60=null;}_0x54ae5a['cb'](null,{'code':_0x40aa7c,'result':_0x333376,'extra':_0x193b60});}});_0x16f92a['on']('error',function(_0x3b978d){_0x462d54['emit']('error',new AGIError(_0x1dd7('0x1c'),_0x3b978d[_0x1dd7('0x1d')]));});_0x16f92a['on'](_0x1dd7('0x1e'),function(){_0x462d54[_0x1dd7('0xa')](_0x1dd7('0x1e'),new AGIError(_0x1dd7('0x1f')));});_0x16f92a['on']('timeout',function(){_0x462d54[_0x1dd7('0xa')]('timeout',new AGIError(_0x1dd7('0x20')));_0x16f92a[_0x1dd7('0x21')]();});_0x16f92a[_0x1dd7('0x22')](_0x1ae8b6);this['command']=function(_0x13e51c,_0x1f6021){var _0x13e51c=_0x13e51c||'',_0x1f6021=typeof _0x1f6021==_0x1dd7('0x13')?_0x1f6021:new Function();_0x54ae5a={'tx':_0x13e51c,'rx':'','cb':_0x1f6021};_0x16f92a[_0x1dd7('0x23')](_0x13e51c+'\x0a');},this[_0x1dd7('0x1e')]=function(){_0x16f92a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x25')]=function(_0x3a404e){return this[_0x1dd7('0x26')][_0x1dd7('0x27')](this,_0x3a404e);};AGIChannel['prototype']['answer']=function(){return this[_0x1dd7('0x25')]('ANSWER');};AGIChannel['prototype'][_0x1dd7('0x28')]=function(_0x5da96c,_0x21b648,_0x2bc572){_0x5da96c=_0x5da96c===undefined?_0x1dd7('0x29'):_0x5da96c;_0x21b648=_0x21b648===undefined?'5':_0x21b648;_0x2bc572=_0x2bc572===undefined?'1':_0x2bc572;return this[_0x1dd7('0x25')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5da96c,_0x21b648*0x3e8,_0x2bc572));};AGIChannel[_0x1dd7('0x24')]['noop']=function(_0x19a68b){_0x19a68b=_0x19a68b||_0x1dd7('0x2a');return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x2c'),_0x19a68b));};AGIChannel[_0x1dd7('0x24')]['exec']=function(_0x282fb6,_0x3bed3d){if(_[_0x1dd7('0x2d')](_0x3bed3d)){return this[_0x1dd7('0x25')](util['format']('EXEC\x20%s\x20%s',_0x282fb6,_0x3bed3d['join'](',')));}return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x2e'),_0x282fb6,_0x3bed3d));};AGIChannel['prototype'][_0x1dd7('0x2f')]=function(_0x1e95bd){return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x30'),_0x1e95bd));};AGIChannel['prototype']['setExtension']=function(_0x521d3a){return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x31'),_0x521d3a));};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x32')]=function(_0x2c96b2){return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x33'),_0x2c96b2));};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0xe')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x34')]=function(_0x2db820,_0x477813){return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x35'),_0x2db820,_0x477813?_0x477813[_0x1dd7('0x36')]()[_0x1dd7('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x1dd7('0x37')]=function(_0x1b25e7,_0x299af7){return this['sendRequest'](util['format'](_0x1dd7('0x38'),_0x1b25e7,_0x299af7));};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x39')]=function(_0xf9202f,_0x3a12ad){return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x3a'),_0xf9202f,_0x3a12ad));};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x3b')]=function(_0x4daa49,_0x1a4987){return this['sendRequest'](util[_0x1dd7('0x2b')](_0x1dd7('0x3c'),_0x4daa49,_0x1a4987));};AGIChannel['prototype'][_0x1dd7('0x3d')]=function(_0x2e6720,_0x4baaa1,_0x41132a){_0x4baaa1=_0x4baaa1||this['extension'];_0x41132a=_0x41132a||0x1;this[_0x1dd7('0x2f')](_0x2e6720);this[_0x1dd7('0x3e')](_0x4baaa1);this['setPriority'](_0x41132a);return this[_0x1dd7('0x3f')](util['format'](_0x1dd7('0x40'),_0x2e6720,_0x4baaa1,_0x41132a));};AGIChannel['prototype'][_0x1dd7('0x41')]=function(_0xb18f1a){return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0xb18f1a));};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x42')]=function(_0x34a5e4,_0x1df55f,_0x15095e,_0x464c38,_0x1691ae,_0x2396c2){_0x1df55f=_0x1df55f||'wav';_0x15095e=_0x15095e||'';_0x464c38=_0x464c38===undefined?-0x1:_0x464c38==='-1'?-0x1:_0x464c38*0x3e8;_0x1691ae=_0x1691ae===undefined?'':'s='+_0x1691ae;_0x2396c2=_0x2396c2?'BEEP':'';return this[_0x1dd7('0x25')](util[_0x1dd7('0x2b')](_0x1dd7('0x43'),_0x34a5e4,_0x1df55f,_0x15095e,_0x464c38,_0x2396c2,_0x1691ae));};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x44')]=function(_0x87e529,_0x2be0d7){_0x2be0d7=_0x2be0d7||'';return this['sendRequest'](util[_0x1dd7('0x2b')](_0x1dd7('0x45'),_0x87e529,_0x2be0d7));};AGIChannel[_0x1dd7('0x24')]['agi']=function(_0x1f48d2){return this[_0x1dd7('0x46')](_0x1dd7('0x47'),_0x1f48d2);};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x48')]=function(_0x519aa3){return this[_0x1dd7('0x46')](_0x1dd7('0x49'),_0x519aa3);};AGIChannel[_0x1dd7('0x24')][_0x1dd7('0x4a')]=function(_0x578ac8,_0xd93900){this[_0x1dd7('0x3f')](util[_0x1dd7('0x2b')](_0x1dd7('0x4b'),_0x578ac8['id'],_0x578ac8[_0x1dd7('0x4c')],_0xd93900));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1dd7('0x4d')]=AGIChannel; \ No newline at end of file +var _0x1eb4=['SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','result=','indexOf','substr','startsWith','length','match','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','pipe','write','inherits','answer','sendRequest','ANSWER','prototype','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','hangup','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace'];(function(_0x23cc7d,_0x553e85){var _0x41abb3=function(_0x3cbbde){while(--_0x3cbbde){_0x23cc7d['push'](_0x23cc7d['shift']());}};_0x41abb3(++_0x553e85);}(_0x1eb4,0xa3));var _0x41eb=function(_0x2d1fbb,_0x66a51){_0x2d1fbb=_0x2d1fbb-0x0;var _0x48e525=_0x1eb4[_0x2d1fbb];return _0x48e525;};'use strict';var util=require(_0x41eb('0x0'));var _=require('lodash');var EventEmitter=require(_0x41eb('0x1'))[_0x41eb('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x41eb('0x3'));function AGIChannel(_0x43090d){var _0x2c5181=this,_0xc07d6f=new AGIReply(),_0x10f971=![],_0xce66e8={};EventEmitter[_0x41eb('0x4')](_0x2c5181);_0x43090d[_0x41eb('0x5')](_0x41eb('0x6'));_0x43090d['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0xc07d6f[_0x41eb('0x5')]('utf8');_0xc07d6f['on'](_0x41eb('0x7'),function(_0x471ba6){for(var _0x2697f3 in _0x471ba6){_0x2c5181[_0x2697f3]=_0x471ba6[_0x2697f3];}_0x2c5181[_0x41eb('0x8')](_0x41eb('0x9'));});_0xc07d6f['on'](_0x41eb('0xa'),function(_0x3eefb9){if(_0x3eefb9[_0x41eb('0xb')]()=='hangup'){_0x2c5181[_0x41eb('0x8')]('hangup');return;}if(_0x3eefb9[_0x41eb('0xc')](0x0,0xb)==_0x41eb('0xd')){_0x10f971=!![];}if(_0x10f971){_0xce66e8['rx']+=_0x3eefb9+'\x0a';if(_0x3eefb9[_0x41eb('0xe')](_0x41eb('0xf'))!=-0x1){_0x10f971=![];}}else{_0xce66e8['rx']=_0x3eefb9;}if(_0x10f971){return;}if(typeof _0xce66e8['cb']=='function'){var _0x585da0=_0xce66e8['rx']['substring'](0x0,0x3),_0x45e374=null,_0x2fef64=null;_0x585da0=parseInt(_0x585da0);if(isNaN(_0x585da0)){_0xce66e8['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x41eb('0x10')});return;}if(_0x585da0!=0xc8){_0xce66e8['cb'](null,{'code':_0x585da0,'result':-0x1,'extra':'KO'});return;}_0x45e374=_0xce66e8['rx'][_0x41eb('0xc')](0x4)['replace'](_0x41eb('0x11'),'');if(_0x45e374[_0x41eb('0x12')]('\x20')!=-0x1){_0x45e374=_0x45e374[_0x41eb('0x13')](0x0,_0x45e374[_0x41eb('0x12')]('\x20'));}if(_[_0x41eb('0x14')](_0x45e374,'-1')){_0x45e374=parseInt(_0x45e374);}_0x2fef64=_0xce66e8['rx']['split']('\x20');if(_0x2fef64[_0x41eb('0x15')]==0x3){_0x2fef64=_0x2fef64[0x2][_0x41eb('0xc')](0x1,_0x2fef64[0x2][_0x41eb('0x15')]-0x1);}else if(_0x2fef64[_0x41eb('0x15')]>0x3){var _0x3228e1=/\((.+)\)/;var _0x3095c1=_0xce66e8['rx'][_0x41eb('0x16')](_0x3228e1);if(_0x3095c1){_0x2fef64=_0x3095c1[0x1];}else{_0x2fef64=null;}}else{_0x2fef64=null;}_0xce66e8['cb'](null,{'code':_0x585da0,'result':_0x45e374,'extra':_0x2fef64});}});_0x43090d['on']('error',function(_0x457479){_0x2c5181['emit']('error',new AGIError(_0x41eb('0x17'),_0x457479[_0x41eb('0x18')]));});_0x43090d['on'](_0x41eb('0x19'),function(){_0x2c5181[_0x41eb('0x8')](_0x41eb('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x43090d['on'](_0x41eb('0x1a'),function(){_0x2c5181[_0x41eb('0x8')](_0x41eb('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x43090d[_0x41eb('0x1b')]();});_0x43090d[_0x41eb('0x1c')](_0xc07d6f);this['command']=function(_0x1b0020,_0x12c080){var _0x1b0020=_0x1b0020||'',_0x12c080=typeof _0x12c080=='function'?_0x12c080:new Function();_0xce66e8={'tx':_0x1b0020,'rx':'','cb':_0x12c080};_0x43090d[_0x41eb('0x1d')](_0x1b0020+'\x0a');},this[_0x41eb('0x19')]=function(){_0x43090d[_0x41eb('0x1b')]();};}util[_0x41eb('0x1e')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x21a803){return this['command']['sync'](this,_0x21a803);};AGIChannel['prototype'][_0x41eb('0x1f')]=function(){return this[_0x41eb('0x20')](_0x41eb('0x21'));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x23')]=function(_0x4008cc,_0x751107,_0x2a65f4){_0x4008cc=_0x4008cc===undefined?'beep':_0x4008cc;_0x751107=_0x751107===undefined?'5':_0x751107;_0x2a65f4=_0x2a65f4===undefined?'1':_0x2a65f4;return this['sendRequest'](util[_0x41eb('0x24')](_0x41eb('0x25'),_0x4008cc,_0x751107*0x3e8,_0x2a65f4));};AGIChannel[_0x41eb('0x22')]['noop']=function(_0x4b212e){_0x4b212e=_0x4b212e||_0x41eb('0x26');return this[_0x41eb('0x20')](util[_0x41eb('0x24')](_0x41eb('0x27'),_0x4b212e));};AGIChannel['prototype']['exec']=function(_0x35e32e,_0x268fc8){if(_[_0x41eb('0x28')](_0x268fc8)){return this[_0x41eb('0x20')](util['format']('EXEC\x20%s\x20%s',_0x35e32e,_0x268fc8[_0x41eb('0x29')](',')));}return this[_0x41eb('0x20')](util[_0x41eb('0x24')](_0x41eb('0x2a'),_0x35e32e,_0x268fc8));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x2b')]=function(_0x1899cc){return this['sendRequest'](util[_0x41eb('0x24')](_0x41eb('0x2c'),_0x1899cc));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x2d')]=function(_0x1d01bc){return this[_0x41eb('0x20')](util[_0x41eb('0x24')]('SET\x20EXTENSION\x20%s',_0x1d01bc));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x2e')]=function(_0x25f8cf){return this[_0x41eb('0x20')](util[_0x41eb('0x24')]('SET\x20PRIORITY\x20%s',_0x25f8cf));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x2f')]=function(){return this[_0x41eb('0x20')](_0x41eb('0x30'));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x31')]=function(_0x157627,_0x41dd3c){return this[_0x41eb('0x20')](util['format'](_0x41eb('0x32'),_0x157627,_0x41dd3c?_0x41dd3c[_0x41eb('0x33')]()[_0x41eb('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x41eb('0x22')]['sayNumber']=function(_0x4a2f96,_0x489375){return this[_0x41eb('0x20')](util[_0x41eb('0x24')](_0x41eb('0x35'),_0x4a2f96,_0x489375));};AGIChannel[_0x41eb('0x22')]['sayDigits']=function(_0x57d2cf,_0x2138f1){return this[_0x41eb('0x20')](util[_0x41eb('0x24')]('SAY\x20DIGITS\x20%s\x20%s',_0x57d2cf,_0x2138f1));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x36')]=function(_0xa6674b,_0x20cdf1){return this['sendRequest'](util[_0x41eb('0x24')](_0x41eb('0x37'),_0xa6674b,_0x20cdf1));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x38')]=function(_0x58a761,_0x755569,_0x14abde){_0x755569=_0x755569||this[_0x41eb('0x39')];_0x14abde=_0x14abde||0x1;this[_0x41eb('0x2b')](_0x58a761);this['setExtension'](_0x755569);this['setPriority'](_0x14abde);return this[_0x41eb('0x3a')](util[_0x41eb('0x24')](_0x41eb('0x3b'),_0x58a761,_0x755569,_0x14abde));};AGIChannel['prototype']['getVariable']=function(_0xbbd5d9){return this[_0x41eb('0x20')](util[_0x41eb('0x24')]('GET\x20VARIABLE\x20\x22%s\x22',_0xbbd5d9));};AGIChannel[_0x41eb('0x22')]['recordFile']=function(_0x12c729,_0xedb400,_0x400359,_0x2a05bf,_0x427744,_0x18248a){_0xedb400=_0xedb400||_0x41eb('0x3c');_0x400359=_0x400359||'';_0x2a05bf=_0x2a05bf===undefined?-0x1:_0x2a05bf==='-1'?-0x1:_0x2a05bf*0x3e8;_0x427744=_0x427744===undefined?'':'s='+_0x427744;_0x18248a=_0x18248a?_0x41eb('0x3d'):'';return this[_0x41eb('0x20')](util[_0x41eb('0x24')](_0x41eb('0x3e'),_0x12c729,_0xedb400,_0x400359,_0x2a05bf,_0x18248a,_0x427744));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x3f')]=function(_0xd5eea5,_0x4a08b8){_0x4a08b8=_0x4a08b8||'';return this['sendRequest'](util[_0x41eb('0x24')](_0x41eb('0x40'),_0xd5eea5,_0x4a08b8));};AGIChannel[_0x41eb('0x22')][_0x41eb('0x41')]=function(_0x149206){return this[_0x41eb('0x42')](_0x41eb('0x43'),_0x149206);};AGIChannel[_0x41eb('0x22')]['wait']=function(_0x3cc284){return this[_0x41eb('0x42')](_0x41eb('0x44'),_0x3cc284);};AGIChannel['prototype'][_0x41eb('0x45')]=function(_0x467003,_0x59ed45){this[_0x41eb('0x3a')](util['format'](_0x41eb('0x46'),_0x467003['id'],_0x467003[_0x41eb('0x47')],_0x59ed45));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index e6589eb..cba43d0 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 _0xb024=['Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x1fc587,_0x2caa8d){var _0x409465=function(_0x46c481){while(--_0x46c481){_0x1fc587['push'](_0x1fc587['shift']());}};_0x409465(++_0x2caa8d);}(_0xb024,0x1ad));var _0x4b02=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb024[_0x138adb];return _0x1b27f2;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x4b02('0x0'),'E_AGI_ARGUMENT_PORT':_0x4b02('0x1'),'E_AGI_SERVER_ERROR':_0x4b02('0x2'),'E_AGI_SERVER_CLOSE':_0x4b02('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x4b02('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x4b02('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x4b02('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4b02('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x206f33){var _0x206f33=_0x206f33||null,_0x5d5c2f=_0x5d5c2f||[],_0x49543e=0x1,_0x305d39='';if(!error[_0x206f33]){_0x206f33=_0x4b02('0x8');}_0x5d5c2f['push'](error[_0x206f33]);while(arguments[_0x49543e]){_0x5d5c2f[_0x4b02('0x9')](arguments[_0x49543e]);_0x49543e++;}_0x305d39=util[_0x4b02('0xa')][_0x4b02('0xb')](util,_0x5d5c2f);this[_0x4b02('0xc')]=_0x305d39;this[_0x4b02('0xd')]=_0x206f33;}module[_0x4b02('0xe')]=AGIError; \ No newline at end of file +var _0xa1a5=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x1aa4d0,_0x19cbe1){_0x1aa4d0=_0x1aa4d0-0x0;var _0x30f9de=_0xa1a5[_0x1aa4d0];return _0x30f9de;};'use strict';var util=require(_0x5a1a('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x5a1a('0x1'),'E_AGI_SERVER_ERROR':_0x5a1a('0x2'),'E_AGI_SERVER_CLOSE':_0x5a1a('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x5a1a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x5a1a('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x5a1a('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x5a1a('0x7'),'E_AGI_COMMAND_EMPTY':_0x5a1a('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5a1a('0x9'),'E_AGI_IVR_ENTRY':_0x5a1a('0xa')};function AGIError(_0x27f71f){var _0x27f71f=_0x27f71f||null,_0x59e0f6=_0x59e0f6||[],_0x1ec37f=0x1,_0x313212='';if(!error[_0x27f71f]){_0x27f71f=_0x5a1a('0xb');}_0x59e0f6[_0x5a1a('0xc')](error[_0x27f71f]);while(arguments[_0x1ec37f]){_0x59e0f6[_0x5a1a('0xc')](arguments[_0x1ec37f]);_0x1ec37f++;}_0x313212=util[_0x5a1a('0xd')][_0x5a1a('0xe')](util,_0x59e0f6);this[_0x5a1a('0xf')]=_0x313212;this[_0x5a1a('0x10')]=_0x27f71f;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 7ddbf41..f7ec78d 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 _0x5c00=['getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','default','menu','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','lodash','../../../config/logger','agi','getdigits','vertices','edges','numberOfEdges','prototype','push','size'];(function(_0x1fdf1d,_0x130332){var _0xb0db2=function(_0x13895b){while(--_0x13895b){_0x1fdf1d['push'](_0x1fdf1d['shift']());}};_0xb0db2(++_0x130332);}(_0x5c00,0x17e));var _0x05c0=function(_0x34f46d,_0x1d6712){_0x34f46d=_0x34f46d-0x0;var _0x3a2d9e=_0x5c00[_0x34f46d];return _0x3a2d9e;};'use strict';var _=require(_0x05c0('0x0'));var logger=require(_0x05c0('0x1'))(_0x05c0('0x2'));var verticesWithRetry=['menu',_0x05c0('0x3'),'getsecretdigits'];var Graph=function(){this[_0x05c0('0x4')]={};this[_0x05c0('0x5')]={};this[_0x05c0('0x6')]=0x0;};Graph[_0x05c0('0x7')]['addVertex']=function(_0x145973){this[_0x05c0('0x4')][_0x145973['id']]=_0x145973;this[_0x05c0('0x5')][_0x145973['id']]=[];};Graph[_0x05c0('0x7')]['addEdge']=function(_0x3a3b1b,_0x34eb5f,_0x3ad5b7){this['edges'][_0x3a3b1b][_0x05c0('0x8')]({'target':_0x34eb5f,'condition':_0x3ad5b7});this[_0x05c0('0x6')]+=0x1;};Graph[_0x05c0('0x7')][_0x05c0('0x9')]=function(){return _[_0x05c0('0x9')](this[_0x05c0('0x4')]);};Graph['prototype']['relations']=function(){return this[_0x05c0('0x6')];};Graph['prototype'][_0x05c0('0xa')]=function(_0x11cf03){return this[_0x05c0('0x4')][_0x11cf03];};Graph['prototype'][_0x05c0('0xb')]=function(_0x5eec41,_0x16a290){if(!this[_0x05c0('0x4')][_0x5eec41]){return logger[_0x05c0('0xc')](_0x05c0('0xd'));}var _0x25764b=_0x16a290(this[_0x05c0('0x4')][_0x5eec41]);if(!_0x25764b){return logger[_0x05c0('0xc')](_0x05c0('0xe'));}if(this['edges'][_0x5eec41][_0x05c0('0xf')]===0x0){return logger[_0x05c0('0xc')](_0x05c0('0x10'));}for(var _0x29e6b0=0x0,_0x27c7bd=[],_0x40153e=![];_0x29e6b0\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','close','Project\x20%s\x20not\x20found','getLicense','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','message','format','[%s]\x20%s','name','[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','error','stack','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','source','target','addEdge','getSquareProject','then','createSquareReport','catch','indexOf','substring','debug','variables'];(function(_0x10d479,_0x84ea59){var _0x1fec1f=function(_0x3a5016){while(--_0x3a5016){_0x10d479['push'](_0x10d479['shift']());}};_0x1fec1f(++_0x84ea59);}(_0x2bd8,0x130));var _0x82bd=function(_0x571e16,_0x57ecd0){_0x571e16=_0x571e16-0x0;var _0x40812e=_0x2bd8[_0x571e16];return _0x40812e;};'use strict';var parser=require(_0x82bd('0x0'));var _=require('lodash');var syncho=require(_0x82bd('0x1'));var util=require(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var config=require(_0x82bd('0x4'));var logger=require(_0x82bd('0x5'))(_0x82bd('0x6'));var utilLicense=require(_0x82bd('0x7'));var rpc=require('./rpc');var mailRpc=require(_0x82bd('0x8'));var Graph=require(_0x82bd('0x9'));var Vertices=require(_0x82bd('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x82bd('0xb')](config[_0x82bd('0x6')],{'ip':_0x82bd('0xc'),'port':0x11dd});function connectionHandler(_0x1f7463){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1f7463);agiHandler(_0x1f7463);}catch(_0x1666cf){logger['error'](_0x1666cf['stack']);}});});}function listeningHandler(){console['log'](_0x82bd('0xd'),config['agi']['port']);logger[_0x82bd('0xe')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x82bd('0x6')]['ip'],config[_0x82bd('0x6')]['port']));}function errorHandler(_0x140ad6){if(_0x140ad6&&_0x140ad6['name']&&_0x140ad6[_0x82bd('0xf')]){logger['error'](util[_0x82bd('0x10')](_0x82bd('0x11'),_0x140ad6[_0x82bd('0x12')],_0x140ad6[_0x82bd('0xf')]));}else{logger['error'](util[_0x82bd('0x10')](_0x82bd('0x13'),_0x140ad6['stack']));}}function closeHandler(){logger[_0x82bd('0xe')](util['format'](_0x82bd('0x14'),this[_0x82bd('0x15')],this[_0x82bd('0x16')],this[_0x82bd('0x17')],this[_0x82bd('0x18')],this[_0x82bd('0x19')]));try{createSquareReport(this);}catch(_0x387d21){logger[_0x82bd('0x1a')](_0x387d21[_0x82bd('0x1b')]);}}function timeoutHandler(){logger[_0x82bd('0xe')](util[_0x82bd('0x10')](_0x82bd('0x1c'),this[_0x82bd('0x15')],this[_0x82bd('0x16')],this['callerid'],this['dnid'],this[_0x82bd('0x19')]));}function hangupHandler(){logger[_0x82bd('0xe')](util[_0x82bd('0x10')](_0x82bd('0x1d'),this[_0x82bd('0x15')],this[_0x82bd('0x16')],this[_0x82bd('0x17')],this[_0x82bd('0x18')],this[_0x82bd('0x19')]));this[_0x82bd('0x1e')]=!![];}function getRoot(_0x2caa29){return parser[_0x82bd('0x1f')](_0x2caa29,{'object':!![]})[_0x82bd('0x20')][_0x82bd('0x21')];}function addVertex(_0x3d9f03,_0x2d9d95,_0x13a42a){_0x2d9d95[_0x82bd('0x22')]=_0x13a42a;if(_0x2d9d95[_0x82bd('0x23')]('retry')){_0x2d9d95['maxRetry']=parseInt(_0x2d9d95[_0x82bd('0x24')],0xa);}_0x3d9f03[_0x82bd('0x25')](_[_0x82bd('0x26')](_0x2d9d95,_0x82bd('0x27')));}function initGraph(_0x25cb16,_0x10d101){var _0x3c7751=new Graph();for(var _0xbef23b in _0x25cb16){if(_0x25cb16[_0x82bd('0x23')](_0xbef23b)){if(_[_0x82bd('0x28')](_0x25cb16[_0xbef23b])){for(var _0x53a2a6=0x0;_0x53a2a6<_0x25cb16[_0xbef23b]['length'];_0x53a2a6+=0x1){addVertex(_0x3c7751,_0x25cb16[_0xbef23b][_0x53a2a6],_0xbef23b);}}else{addVertex(_0x3c7751,_0x25cb16[_0xbef23b],_0xbef23b);}}}for(var _0x5609b7=0x0;_0x5609b7<_0x10d101['length'];_0x5609b7+=0x1){if(_0x10d101[_0x5609b7][_0x82bd('0x29')]&&_0x10d101[_0x5609b7][_0x82bd('0x2a')]){_0x3c7751[_0x82bd('0x2b')](_0x10d101[_0x5609b7][_0x82bd('0x29')],_0x10d101[_0x5609b7][_0x82bd('0x2a')],_0x10d101[_0x5609b7]['value']);}}return _0x3c7751;}function getSquareProject(_0x516c6d,_0x5b21ce){rpc[_0x82bd('0x2c')](_0x516c6d)[_0x82bd('0x2d')](function(_0x40884f){_0x5b21ce(null,_0x40884f);})['catch'](function(_0x166c46){_0x5b21ce(null,_0x166c46);});}function createSquareReport(_0x4f209e,_0x9cc69b){rpc[_0x82bd('0x2e')](_0x4f209e)[_0x82bd('0x2d')](function(_0x476bcf){if(_0x9cc69b){_0x9cc69b(null,_0x476bcf);}})[_0x82bd('0x2f')](function(_0x25e36e){if(_0x9cc69b){_0x9cc69b(null,_0x25e36e);}});}function setChannelVariables(_0x5ca7fc){for(var _0x591b38 in _0x5ca7fc){if(_0x5ca7fc[_0x82bd('0x23')](_0x591b38)){if(_0x591b38[_0x82bd('0x30')]('agi_')===0x0){_0x5ca7fc[_0x591b38[_0x82bd('0x31')](0x4)]=_0x5ca7fc[_0x591b38];delete _0x5ca7fc[_0x591b38];}}}}function getLogFromObject(_0x4c8a9b){return util['inspect'](_0x4c8a9b,{'showHidden':![],'depth':null});}function agiHandler(_0x3b8015){var _0x3eb00d,_0x2cc56,_0x44e1d9,_0xd30754,_0x282270;logger[_0x82bd('0x32')](_0x82bd('0x33'),JSON[_0x82bd('0x34')](_0x3b8015,null,0x2));logger[_0x82bd('0xe')](util[_0x82bd('0x10')](_0x82bd('0x35'),_0x3b8015[_0x82bd('0x15')],_0x3b8015[_0x82bd('0x16')],_0x3b8015[_0x82bd('0x17')],_0x3b8015[_0x82bd('0x18')],_0x3b8015[_0x82bd('0x19')]));_0x3b8015['on']('error',errorHandler);_0x3b8015['on']('close',closeHandler);_0x3b8015['on']('timeout',timeoutHandler);_0x3b8015[_0x82bd('0x1e')]=![];_0x3b8015['on'](_0x82bd('0x36'),hangupHandler);var _0x549a74=getSquareProject[_0x82bd('0x37')](null,_0x3b8015['arg_1']);if(_0x549a74){if(_0x549a74['production']){_0x3eb00d=getRoot(_0x549a74['production']);if(_0x3eb00d&&_0x3eb00d[_0x82bd('0x38')]){logger[_0x82bd('0x32')](_0x82bd('0x21'),JSON[_0x82bd('0x34')](_0x3eb00d,null,0x2));_0x3b8015[_0x82bd('0x39')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2cc56=initGraph(_['omit'](_0x3eb00d,_0x82bd('0x27')),_0x3eb00d['mxCell']);_0x44e1d9=new Vertices(_0x3b8015,rpc,mailRpc);logger['info'](util[_0x82bd('0x10')](_0x82bd('0x3a'),_0x3b8015[_0x82bd('0x15')],_0x3b8015[_0x82bd('0x16')],_0x3b8015[_0x82bd('0x17')],_0x3b8015[_0x82bd('0x18')],_0x3b8015[_0x82bd('0x19')]));_0x2cc56[_0x82bd('0x3b')](_0x3eb00d[_0x82bd('0x38')]['id'],function(_0x5512b0){try{_0x5512b0=_0x44e1d9['clear'](_0x5512b0);logger[_0x82bd('0x32')](_0x82bd('0x3c'),JSON['stringify'](_0x5512b0,null,0x2));if(_0x5512b0['agicommand']===_0x82bd('0x3d')){logger[_0x82bd('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3b8015[_0x82bd('0x3e')]=_0x5512b0[_0x82bd('0x3e')]||_0x3b8015[_0x82bd('0x3e')];_0x3b8015[_0x82bd('0x3f')]=_0x5512b0[_0x82bd('0x3f')];_0x3b8015[_0x82bd('0x40')]=_0x5512b0[_0x82bd('0x40')]?_0x5512b0[_0x82bd('0x40')]-0x1:0x1;return null;}else if(_0x5512b0&&_0x44e1d9[_0x5512b0[_0x82bd('0x22')]]){_0x282270=_0x44e1d9[_0x5512b0[_0x82bd('0x22')]](_0x5512b0);logger[_0x82bd('0xe')](_0x82bd('0x41'),JSON['stringify'](_0x282270,null,0x2));if(_0x282270&&_0x282270[_0x82bd('0x42')]===AGI_CODE_SUCCESS&&_0x282270[_0x82bd('0x43')]!==AGI_RESULT_ERROR&&!_0x3b8015['evtHangup']){logger['debug'](_0x82bd('0x41'),getLogFromObject(_0x282270));return _[_0x82bd('0x44')](_0x282270[_0x82bd('0x43')])?null:_0x282270[_0x82bd('0x43')][_0x82bd('0x45')]();}else{logger['error']('response',getLogFromObject(_0x282270));return null;}}else{logger[_0x82bd('0x1a')](_0x82bd('0x46'));return null;}}catch(_0x4b2fb8){logger[_0x82bd('0x1a')](_0x4b2fb8['stack']);return null;}});if(_0x3eb00d[_0x82bd('0x47')]){logger[_0x82bd('0xe')](util['format'](_0x82bd('0x48'),_0x3b8015[_0x82bd('0x15')],_0x3b8015['calleridname'],_0x3b8015['callerid'],_0x3b8015[_0x82bd('0x18')],_0x3b8015['uniqueid']));_0x2cc56[_0x82bd('0x3b')](_0x3eb00d[_0x82bd('0x47')]['id'],function(_0x34ed39){try{_0x34ed39=_0x44e1d9[_0x82bd('0x49')](_0x34ed39);logger['debug']('vertex',JSON[_0x82bd('0x34')](_0x34ed39,null,0x2));if(_0x34ed39&&_0x44e1d9[_0x34ed39[_0x82bd('0x22')]]){_0x282270=_0x44e1d9[_0x34ed39['agicommand']](_0x34ed39);if(_0x282270){logger[_0x82bd('0x32')](_0x82bd('0x41'),getLogFromObject(_0x282270));return _[_0x82bd('0x44')](_0x282270['result'])?null:_0x282270[_0x82bd('0x43')][_0x82bd('0x45')]();}else{logger[_0x82bd('0x1a')](_0x82bd('0x41'),getLogFromObject(_0x282270));return null;}}else{logger[_0x82bd('0x1a')](_0x82bd('0x46'));return null;}}catch(_0x2e97c3){logger[_0x82bd('0x1a')](_0x2e97c3[_0x82bd('0x1b')]);return null;}});}logger[_0x82bd('0xe')](util[_0x82bd('0x10')](_0x82bd('0x4a'),_0x3b8015[_0x82bd('0x15')],_0x3b8015['calleridname'],_0x3b8015[_0x82bd('0x17')],_0x3b8015[_0x82bd('0x18')],_0x3b8015['uniqueid']));logger[_0x82bd('0xe')](util[_0x82bd('0x10')](_0x82bd('0x4b'),_0x3b8015[_0x82bd('0x3e')],_0x3b8015['extension'],parseInt(_0x3b8015['priority'],0xa)+0x1));_0x3b8015[_0x82bd('0x4c')](_0x3b8015['context'],_0x3b8015['extension'],parseInt(_0x3b8015[_0x82bd('0x40')],0xa)+0x1);_0x3b8015['close']();}}else{logger['error'](util[_0x82bd('0x10')](_0x82bd('0x4d'),_0x3b8015[_0x82bd('0x15')]));_0x3b8015[_0x82bd('0x4c')](_0x3b8015[_0x82bd('0x3e')],_0x3b8015[_0x82bd('0x3f')],parseInt(_0x3b8015[_0x82bd('0x40')],0xa)+0x1);_0x3b8015[_0x82bd('0x4e')]();}}else{logger[_0x82bd('0x1a')](util[_0x82bd('0x10')](_0x82bd('0x4f'),_0x3b8015[_0x82bd('0x15')]));_0x3b8015[_0x82bd('0x4c')](_0x3b8015[_0x82bd('0x3e')],_0x3b8015[_0x82bd('0x3f')],parseInt(_0x3b8015['priority'],0xa)+0x1);_0x3b8015[_0x82bd('0x4e')]();}}function main(){var _0x459021;return utilLicense[_0x82bd('0x50')]()[_0x82bd('0x2d')](function(_0x9bf8fa){if(_0x9bf8fa){if(_0x9bf8fa['voice']){if(_0x9bf8fa['callysquare']&&_0x9bf8fa['callysquare']>0x0){logger['info'](util[_0x82bd('0x10')](_0x82bd('0x51'),_0x9bf8fa[_0x82bd('0x52')]));_0x459021=_0x9bf8fa[_0x82bd('0x52')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x82bd('0xe')](_0x82bd('0x53'));_0x459021=-0x1;}}})[_0x82bd('0x2f')](function(_0x4d7fb4){logger[_0x82bd('0x1a')](_0x82bd('0x54'),_0x4d7fb4[_0x82bd('0x1b')]);})[_0x82bd('0x47')](function(){var _0x3f339d=require(_0x82bd('0x55'))(config[_0x82bd('0x6')][_0x82bd('0x56')],config[_0x82bd('0x6')]['ip'],_0x459021);_0x3f339d['on'](_0x82bd('0x1a'),errorHandler);_0x3f339d['on'](_0x82bd('0x57'),listeningHandler);_0x3f339d['on'](_0x82bd('0x58'),connectionHandler);_0x3f339d['on'](_0x82bd('0x4e'),closeHandler);});}main(); \ No newline at end of file +var _0x44e8=['substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','xml2json','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\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','root','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','length','target','addEdge','source','value','getSquareProject','then','catch','agi_'];(function(_0x11e934,_0x2b2196){var _0x16a48d=function(_0x4a5973){while(--_0x4a5973){_0x11e934['push'](_0x11e934['shift']());}};_0x16a48d(++_0x2b2196);}(_0x44e8,0xd7));var _0x844e=function(_0x55045a,_0x48bf57){_0x55045a=_0x55045a-0x0;var _0x5084b8=_0x44e8[_0x55045a];return _0x5084b8;};'use strict';var parser=require(_0x844e('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var config=require(_0x844e('0x3'));var logger=require(_0x844e('0x4'))('agi');var utilLicense=require(_0x844e('0x5'));var rpc=require(_0x844e('0x6'));var mailRpc=require(_0x844e('0x7'));var Graph=require(_0x844e('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x844e('0x9')]=_[_0x844e('0xa')](config[_0x844e('0x9')],{'ip':_0x844e('0xb'),'port':0x11dd});function connectionHandler(_0x571b91){process[_0x844e('0xc')](function(){syncho(function(){try{setChannelVariables(_0x571b91);agiHandler(_0x571b91);}catch(_0x7dff16){logger[_0x844e('0xd')](_0x7dff16[_0x844e('0xe')]);}});});}function listeningHandler(){console[_0x844e('0xf')](_0x844e('0x10'),config['agi'][_0x844e('0x11')]);logger[_0x844e('0x12')](util[_0x844e('0x13')](_0x844e('0x14'),config[_0x844e('0x9')]['ip'],config[_0x844e('0x9')][_0x844e('0x11')]));}function errorHandler(_0x5c6c08){if(_0x5c6c08&&_0x5c6c08[_0x844e('0x15')]&&_0x5c6c08[_0x844e('0x16')]){logger['error'](util[_0x844e('0x13')](_0x844e('0x17'),_0x5c6c08['name'],_0x5c6c08[_0x844e('0x16')]));}else{logger[_0x844e('0xd')](util[_0x844e('0x13')]('[ERROR]\x20%s',_0x5c6c08[_0x844e('0xe')]));}}function closeHandler(){logger[_0x844e('0x12')](util[_0x844e('0x13')](_0x844e('0x18'),this[_0x844e('0x19')],this[_0x844e('0x1a')],this[_0x844e('0x1b')],this[_0x844e('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x36286c){logger['error'](_0x36286c[_0x844e('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x844e('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x844e('0x19')],this[_0x844e('0x1a')],this[_0x844e('0x1b')],this[_0x844e('0x1c')],this[_0x844e('0x1d')]));}function hangupHandler(){logger[_0x844e('0x12')](util[_0x844e('0x13')](_0x844e('0x1e'),this['arg_1'],this[_0x844e('0x1a')],this['callerid'],this['dnid'],this[_0x844e('0x1d')]));this[_0x844e('0x1f')]=!![];}function getRoot(_0x439b26){return parser[_0x844e('0x20')](_0x439b26,{'object':!![]})['mxGraphModel'][_0x844e('0x21')];}function addVertex(_0x3dde07,_0x571498,_0x2520f8){_0x571498[_0x844e('0x22')]=_0x2520f8;if(_0x571498[_0x844e('0x23')](_0x844e('0x24'))){_0x571498[_0x844e('0x25')]=parseInt(_0x571498[_0x844e('0x24')],0xa);}_0x3dde07['addVertex'](_[_0x844e('0x26')](_0x571498,_0x844e('0x27')));}function initGraph(_0x11859a,_0x263702){var _0x2c915f=new Graph();for(var _0x5d6856 in _0x11859a){if(_0x11859a[_0x844e('0x23')](_0x5d6856)){if(_['isArray'](_0x11859a[_0x5d6856])){for(var _0x57b2ef=0x0;_0x57b2ef<_0x11859a[_0x5d6856][_0x844e('0x28')];_0x57b2ef+=0x1){addVertex(_0x2c915f,_0x11859a[_0x5d6856][_0x57b2ef],_0x5d6856);}}else{addVertex(_0x2c915f,_0x11859a[_0x5d6856],_0x5d6856);}}}for(var _0x130d87=0x0;_0x130d87<_0x263702[_0x844e('0x28')];_0x130d87+=0x1){if(_0x263702[_0x130d87]['source']&&_0x263702[_0x130d87][_0x844e('0x29')]){_0x2c915f[_0x844e('0x2a')](_0x263702[_0x130d87][_0x844e('0x2b')],_0x263702[_0x130d87]['target'],_0x263702[_0x130d87][_0x844e('0x2c')]);}}return _0x2c915f;}function getSquareProject(_0x81d4de,_0x2f1697){rpc[_0x844e('0x2d')](_0x81d4de)[_0x844e('0x2e')](function(_0x799cde){_0x2f1697(null,_0x799cde);})[_0x844e('0x2f')](function(_0x2a06a){_0x2f1697(null,_0x2a06a);});}function createSquareReport(_0x618bf6,_0x2e4bdf){rpc['createSquareReport'](_0x618bf6)[_0x844e('0x2e')](function(_0x397546){if(_0x2e4bdf){_0x2e4bdf(null,_0x397546);}})[_0x844e('0x2f')](function(_0x5f5dc3){if(_0x2e4bdf){_0x2e4bdf(null,_0x5f5dc3);}});}function setChannelVariables(_0x43ae36){for(var _0x31754e in _0x43ae36){if(_0x43ae36[_0x844e('0x23')](_0x31754e)){if(_0x31754e['indexOf'](_0x844e('0x30'))===0x0){_0x43ae36[_0x31754e[_0x844e('0x31')](0x4)]=_0x43ae36[_0x31754e];delete _0x43ae36[_0x31754e];}}}}function getLogFromObject(_0x294dea){return util['inspect'](_0x294dea,{'showHidden':![],'depth':null});}function agiHandler(_0x1d8f82){var _0x1592fb,_0x5d613d,_0x1fdba9,_0x10e867,_0x4eaf55;logger[_0x844e('0x32')](_0x844e('0x33'),JSON[_0x844e('0x34')](_0x1d8f82,null,0x2));logger[_0x844e('0x12')](util[_0x844e('0x13')](_0x844e('0x35'),_0x1d8f82[_0x844e('0x19')],_0x1d8f82['calleridname'],_0x1d8f82[_0x844e('0x1b')],_0x1d8f82[_0x844e('0x1c')],_0x1d8f82[_0x844e('0x1d')]));_0x1d8f82['on'](_0x844e('0xd'),errorHandler);_0x1d8f82['on'](_0x844e('0x36'),closeHandler);_0x1d8f82['on'](_0x844e('0x37'),timeoutHandler);_0x1d8f82[_0x844e('0x1f')]=![];_0x1d8f82['on'](_0x844e('0x38'),hangupHandler);var _0x10dc63=getSquareProject[_0x844e('0x39')](null,_0x1d8f82[_0x844e('0x19')]);if(_0x10dc63){if(_0x10dc63['production']){_0x1592fb=getRoot(_0x10dc63['production']);if(_0x1592fb&&_0x1592fb[_0x844e('0x3a')]){logger[_0x844e('0x32')](_0x844e('0x21'),JSON[_0x844e('0x34')](_0x1592fb,null,0x2));_0x1d8f82[_0x844e('0x3b')]=moment()[_0x844e('0x13')](_0x844e('0x3c'));_0x5d613d=initGraph(_[_0x844e('0x26')](_0x1592fb,_0x844e('0x27')),_0x1592fb['mxCell']);_0x1fdba9=new Vertices(_0x1d8f82,rpc,mailRpc);logger[_0x844e('0x12')](util['format'](_0x844e('0x3d'),_0x1d8f82['arg_1'],_0x1d8f82[_0x844e('0x1a')],_0x1d8f82['callerid'],_0x1d8f82[_0x844e('0x1c')],_0x1d8f82[_0x844e('0x1d')]));_0x5d613d[_0x844e('0x3e')](_0x1592fb[_0x844e('0x3a')]['id'],function(_0x2eb412){try{_0x2eb412=_0x1fdba9[_0x844e('0x3f')](_0x2eb412);logger[_0x844e('0x32')](_0x844e('0x40'),JSON[_0x844e('0x34')](_0x2eb412,null,0x2));if(_0x2eb412[_0x844e('0x22')]===_0x844e('0x41')){logger['info'](_0x844e('0x42'));_0x1d8f82[_0x844e('0x43')]=_0x2eb412[_0x844e('0x43')]||_0x1d8f82['context'];_0x1d8f82['extension']=_0x2eb412[_0x844e('0x44')];_0x1d8f82[_0x844e('0x45')]=_0x2eb412[_0x844e('0x45')]?_0x2eb412['priority']-0x1:0x1;return null;}else if(_0x2eb412&&_0x1fdba9[_0x2eb412['agicommand']]){_0x4eaf55=_0x1fdba9[_0x2eb412['agicommand']](_0x2eb412);logger['info'](_0x844e('0x46'),JSON[_0x844e('0x34')](_0x4eaf55,null,0x2));if(_0x4eaf55&&_0x4eaf55[_0x844e('0x47')]===AGI_CODE_SUCCESS&&_0x4eaf55[_0x844e('0x48')]!==AGI_RESULT_ERROR&&!_0x1d8f82[_0x844e('0x1f')]){logger['debug'](_0x844e('0x46'),getLogFromObject(_0x4eaf55));return _['isUndefined'](_0x4eaf55['result'])?null:_0x4eaf55[_0x844e('0x48')][_0x844e('0x49')]();}else{logger[_0x844e('0xd')](_0x844e('0x46'),getLogFromObject(_0x4eaf55));return null;}}else{logger['error'](_0x844e('0x4a'));return null;}}catch(_0x46f258){logger[_0x844e('0xd')](_0x46f258['stack']);return null;}});if(_0x1592fb[_0x844e('0x4b')]){logger[_0x844e('0x12')](util['format'](_0x844e('0x4c'),_0x1d8f82[_0x844e('0x19')],_0x1d8f82[_0x844e('0x1a')],_0x1d8f82[_0x844e('0x1b')],_0x1d8f82[_0x844e('0x1c')],_0x1d8f82[_0x844e('0x1d')]));_0x5d613d['traverseBFS'](_0x1592fb[_0x844e('0x4b')]['id'],function(_0xf828c3){try{_0xf828c3=_0x1fdba9[_0x844e('0x3f')](_0xf828c3);logger[_0x844e('0x32')](_0x844e('0x40'),JSON[_0x844e('0x34')](_0xf828c3,null,0x2));if(_0xf828c3&&_0x1fdba9[_0xf828c3[_0x844e('0x22')]]){_0x4eaf55=_0x1fdba9[_0xf828c3[_0x844e('0x22')]](_0xf828c3);if(_0x4eaf55){logger[_0x844e('0x32')](_0x844e('0x46'),getLogFromObject(_0x4eaf55));return _['isUndefined'](_0x4eaf55[_0x844e('0x48')])?null:_0x4eaf55[_0x844e('0x48')][_0x844e('0x49')]();}else{logger['error'](_0x844e('0x46'),getLogFromObject(_0x4eaf55));return null;}}else{logger[_0x844e('0xd')](_0x844e('0x4a'));return null;}}catch(_0x247276){logger[_0x844e('0xd')](_0x247276[_0x844e('0xe')]);return null;}});}logger[_0x844e('0x12')](util['format'](_0x844e('0x4d'),_0x1d8f82[_0x844e('0x19')],_0x1d8f82[_0x844e('0x1a')],_0x1d8f82[_0x844e('0x1b')],_0x1d8f82[_0x844e('0x1c')],_0x1d8f82[_0x844e('0x1d')]));logger[_0x844e('0x12')](util[_0x844e('0x13')](_0x844e('0x4e'),_0x1d8f82[_0x844e('0x43')],_0x1d8f82[_0x844e('0x44')],parseInt(_0x1d8f82[_0x844e('0x45')],0xa)+0x1));_0x1d8f82[_0x844e('0x4f')](_0x1d8f82['context'],_0x1d8f82[_0x844e('0x44')],parseInt(_0x1d8f82[_0x844e('0x45')],0xa)+0x1);_0x1d8f82[_0x844e('0x36')]();}}else{logger[_0x844e('0xd')](util[_0x844e('0x13')](_0x844e('0x50'),_0x1d8f82['arg_1']));_0x1d8f82[_0x844e('0x4f')](_0x1d8f82[_0x844e('0x43')],_0x1d8f82['extension'],parseInt(_0x1d8f82[_0x844e('0x45')],0xa)+0x1);_0x1d8f82[_0x844e('0x36')]();}}else{logger[_0x844e('0xd')](util[_0x844e('0x13')](_0x844e('0x51'),_0x1d8f82[_0x844e('0x19')]));_0x1d8f82[_0x844e('0x4f')](_0x1d8f82[_0x844e('0x43')],_0x1d8f82[_0x844e('0x44')],parseInt(_0x1d8f82[_0x844e('0x45')],0xa)+0x1);_0x1d8f82[_0x844e('0x36')]();}}function main(){var _0x1a22a0;return utilLicense[_0x844e('0x52')]()[_0x844e('0x2e')](function(_0x5e723f){if(_0x5e723f){if(_0x5e723f[_0x844e('0x53')]){if(_0x5e723f[_0x844e('0x54')]&&_0x5e723f['callysquare']>0x0){logger[_0x844e('0x12')](util['format'](_0x844e('0x55'),_0x5e723f[_0x844e('0x54')]));_0x1a22a0=_0x5e723f[_0x844e('0x54')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x844e('0x12')](_0x844e('0x56'));_0x1a22a0=-0x1;}}})[_0x844e('0x2f')](function(_0x3d6fa7){logger[_0x844e('0xd')]('[LICENSE]',_0x3d6fa7[_0x844e('0xe')]);})[_0x844e('0x4b')](function(){var _0x4656ab=require(_0x844e('0x57'))(config['agi'][_0x844e('0x11')],config[_0x844e('0x9')]['ip'],_0x1a22a0);_0x4656ab['on'](_0x844e('0xd'),errorHandler);_0x4656ab['on']('listening',listeningHandler);_0x4656ab['on']('connection',connectionHandler);_0x4656ab['on'](_0x844e('0x36'),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 4a68c91..4d4fde5 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(_0x114461,_0x1e2b2e){var _0x45f8fa=function(_0x2f60b7){while(--_0x2f60b7){_0x114461['push'](_0x114461['shift']());}};_0x45f8fa(++_0x1e2b2e);}(_0x814b,0x1a2));var _0xb814=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x814b[_0x347471];return _0x422b6a;};'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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x289060,_0xbef9b1){var _0x46f7b1=function(_0x7bd781){while(--_0x7bd781){_0x289060['push'](_0x289060['shift']());}};_0x46f7b1(++_0xbef9b1);}(_0x814b,0x1a2));var _0xb814=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x814b[_0x9b5bb2];return _0x2e1e92;};'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 diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 7200336..92cd2f4 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(_0x4b4844,_0x2f0dfb){var _0x575192=function(_0x13ee1b){while(--_0x13ee1b){_0x4b4844['push'](_0x4b4844['shift']());}};_0x575192(++_0x2f0dfb);}(_0xb10b,0x12a));var _0xbb10=function(_0xcc4d3a,_0x104f66){_0xcc4d3a=_0xcc4d3a-0x0;var _0x20bae1=_0xb10b[_0xcc4d3a];return _0x20bae1;};'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(_0x2e5eec,_0x43844f){var _0x571f3f=function(_0x11b16d){while(--_0x11b16d){_0x2e5eec['push'](_0x2e5eec['shift']());}};_0x571f3f(++_0x43844f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13eb90,_0x30c64f){_0x13eb90=_0x13eb90-0x0;var _0x1a6359=_0x5f2f[_0x13eb90];return _0x1a6359;};'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 d706382..ce43c53 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 _0x8b6f=['createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x10e8b8,_0x26d9e0){var _0x38904b=function(_0x34e34d){while(--_0x34e34d){_0x10e8b8['push'](_0x10e8b8['shift']());}};_0x38904b(++_0x26d9e0);}(_0x8b6f,0x177));var _0xf8b6=function(_0x4b0948,_0x7dd5c2){_0x4b0948=_0x4b0948-0x0;var _0x2e240a=_0x8b6f[_0x4b0948];return _0x2e240a;};'use strict';var BPromise=require(_0xf8b6('0x0'));var moment=require(_0xf8b6('0x1'));var _=require(_0xf8b6('0x2'));var util=require(_0xf8b6('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xf8b6('0x4')][_0xf8b6('0x5')]({'port':0x2329});function request(_0x487c04,_0x5e81e6){return new BPromise(function(_0x4f1b95,_0x28d940){return client[_0xf8b6('0x6')](_0x487c04,_0x5e81e6)[_0xf8b6('0x7')](function(_0x1830d1){if(_0x1830d1[_0xf8b6('0x8')]){return _0x28d940(_0x1830d1[_0xf8b6('0x8')][_0xf8b6('0x9')]);}else{return _0x4f1b95(_0x1830d1[_0xf8b6('0xa')]);}})[_0xf8b6('0xb')](function(_0x23bb46){return _0x28d940(_0x23bb46);});});}exports[_0xf8b6('0xc')]=function(_0x14226a){return request(_0xf8b6('0xd'),{'options':{'raw':![],'where':{'name':_0x14226a},'attributes':[_0xf8b6('0xe')]}});};exports[_0xf8b6('0xf')]=function(_0x1496ba){return request(_0xf8b6('0x10'),{'options':{'raw':![],'where':{'id':_0x1496ba},'include':[{'model':_0xf8b6('0x11'),'as':_0xf8b6('0x12')}],'attributes':['id',_0xf8b6('0x13'),'email']}});};exports[_0xf8b6('0x14')]=function(_0x1a69ae){return request('ShowSquareProject',{'options':{'where':{'id':_0x1a69ae},'attributes':[_0xf8b6('0x13')]}});};exports[_0xf8b6('0x15')]=function(_0x5d5d1e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5d5d1e},'attributes':[_0xf8b6('0x13')]}});};exports[_0xf8b6('0x16')]=function(_0x3da694){return request(_0xf8b6('0x17'),{'options':{'where':{'id':_0x3da694},'attributes':[_0xf8b6('0x13')]}});};exports['getSquareOdbcById']=function(_0x2019e7){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2019e7},'attributes':['dsn']}});};exports[_0xf8b6('0x18')]=function(_0x50ebd0){return request(_0xf8b6('0x19'),{'options':{'where':{'id':_0x50ebd0},'attributes':['name']}});};exports[_0xf8b6('0x1a')]=function(_0x40350d){return request(_0xf8b6('0x1b'),{'options':{'where':{'id':_0x40350d},'attributes':[_0xf8b6('0x13')]}});};exports['getSoundById']=function(_0x5a51ff){return request(_0xf8b6('0x1c'),{'options':{'where':{'id':_0x5a51ff},'attributes':['save_name']}});};exports[_0xf8b6('0x1d')]=function(_0x57a897){return request(_0xf8b6('0x1e'),{'options':{'raw':![],'where':{'id':_0x57a897},'include':[{'model':_0xf8b6('0x1f'),'as':_0xf8b6('0x20')}]}});};exports[_0xf8b6('0x21')]=function(_0x28c66a){return request(_0xf8b6('0x22'),{'options':{'where':{'id':_0x28c66a},'attributes':['id',_0xf8b6('0x13')]}});};exports[_0xf8b6('0x23')]=function(_0x144f96){return request(_0xf8b6('0x24'),{'body':_0x144f96});};exports[_0xf8b6('0x25')]=function(_0x47c6ae){return request(_0xf8b6('0x26'),{'body':_0x47c6ae});};exports[_0xf8b6('0x27')]=function(_0x18d26d){return request('CreateSquareReport',{'body':_[_0xf8b6('0x28')](_0x18d26d,{'project_name':_0x18d26d[_0xf8b6('0x29')],'prev_project_name':_0x18d26d[_0xf8b6('0x2a')]||'','is_subproject':_0x18d26d[_0xf8b6('0x2a')]?!![]:![],'leaveAt':moment()[_0xf8b6('0x2b')](_0xf8b6('0x2c'))})});};exports[_0xf8b6('0x2d')]=function(_0x3a16c8){return request('CreateSquareRecording',{'body':_0x3a16c8});};exports[_0xf8b6('0x2e')]=function(_0x64dadf){return request(_0xf8b6('0x2f'),{'body':_0x64dadf});};exports[_0xf8b6('0x30')]=function(_0x20bc99){return request(_0xf8b6('0x31'),{'options':{'raw':![],'where':{'phone':_0x20bc99[_0xf8b6('0x32')],'ListId':_0x20bc99[_0xf8b6('0x33')]}}})['then'](function(_0x3a2dbc){if(_0x3a2dbc){return _0x3a2dbc;}return request('CreateCmContact',{'body':_0x20bc99});});};exports[_0xf8b6('0x34')]=function(_0x4b5c94){return request(_0xf8b6('0x35'),{'options':{'where':{'id':_0x4b5c94},'attributes':[_0xf8b6('0x13')]}});};exports['agentLogin']=function(_0x770534,_0x4a979c){return request(_0xf8b6('0x36'),{'body':{'interface':_0x4a979c},'options':{'where':_0x770534}});};exports[_0xf8b6('0x37')]=function(_0x1fb807,_0x49a9e6,_0x17dea4){return request(_0xf8b6('0x38'),{'body':{'type':_0x49a9e6,'uniqueid':_0x17dea4},'options':{'where':_0x1fb807}});};exports[_0xf8b6('0x39')]=function(_0x32429a){return request(_0xf8b6('0x3a'),{'body':{},'options':{'where':_0x32429a}});};exports[_0xf8b6('0x3b')]=function(_0x136f7b){return request('LogoutUser',{'body':{},'options':{'where':_0x136f7b}});}; \ No newline at end of file +var _0xee04=['ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','message','getSquareProject','production','name','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','getVariableById','ShowVariable','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name'];(function(_0xeb2cea,_0x10e366){var _0x2d458c=function(_0x8b7130){while(--_0x8b7130){_0xeb2cea['push'](_0xeb2cea['shift']());}};_0x2d458c(++_0x10e366);}(_0xee04,0x124));var _0x4ee0=function(_0x35851c,_0x273ec4){_0x35851c=_0x35851c-0x0;var _0x43d330=_0xee04[_0x35851c];return _0x43d330;};'use strict';var BPromise=require(_0x4ee0('0x0'));var moment=require(_0x4ee0('0x1'));var _=require(_0x4ee0('0x2'));var util=require(_0x4ee0('0x3'));var jayson=require(_0x4ee0('0x4'));var client=jayson[_0x4ee0('0x5')][_0x4ee0('0x6')]({'port':0x2329});function request(_0x4849bd,_0x5d6c23){return new BPromise(function(_0x49fdcd,_0x457c8f){return client['request'](_0x4849bd,_0x5d6c23)[_0x4ee0('0x7')](function(_0x47e541){if(_0x47e541['error']){return _0x457c8f(_0x47e541[_0x4ee0('0x8')][_0x4ee0('0x9')]);}else{return _0x49fdcd(_0x47e541['result']);}})['catch'](function(_0x2445e3){return _0x457c8f(_0x2445e3);});});}exports[_0x4ee0('0xa')]=function(_0x3b56d2){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3b56d2},'attributes':[_0x4ee0('0xb')]}});};exports['getMailAccountById']=function(_0x4e9bb0){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4e9bb0},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x4ee0('0xc'),_0x4ee0('0xd')]}});};exports[_0x4ee0('0xe')]=function(_0x33fdd2){return request(_0x4ee0('0xf'),{'options':{'where':{'id':_0x33fdd2},'attributes':[_0x4ee0('0xc')]}});};exports['getVoiceQueueById']=function(_0x3a4838){return request(_0x4ee0('0x10'),{'options':{'where':{'id':_0x3a4838},'attributes':['name']}});};exports[_0x4ee0('0x11')]=function(_0x2c7d5e){return request(_0x4ee0('0x12'),{'options':{'where':{'id':_0x2c7d5e},'attributes':[_0x4ee0('0xc')]}});};exports['getSquareOdbcById']=function(_0x578b8b){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x578b8b},'attributes':[_0x4ee0('0x13')]}});};exports[_0x4ee0('0x14')]=function(_0x2b58cc){return request(_0x4ee0('0x15'),{'options':{'where':{'id':_0x2b58cc},'attributes':[_0x4ee0('0xc')]}});};exports[_0x4ee0('0x16')]=function(_0x3cd3da){return request(_0x4ee0('0x17'),{'options':{'where':{'id':_0x3cd3da},'attributes':[_0x4ee0('0xc')]}});};exports['getSoundById']=function(_0x50c0e4){return request(_0x4ee0('0x18'),{'options':{'where':{'id':_0x50c0e4},'attributes':[_0x4ee0('0x19')]}});};exports['getIntervalById']=function(_0x309f4c){return request(_0x4ee0('0x1a'),{'options':{'raw':![],'where':{'id':_0x309f4c},'include':[{'model':'Interval','as':_0x4ee0('0x1b')}]}});};exports[_0x4ee0('0x1c')]=function(_0x7e093d){return request('ShowSmsAccount',{'options':{'where':{'id':_0x7e093d},'attributes':['id',_0x4ee0('0xc')]}});};exports[_0x4ee0('0x1d')]=function(_0x1388eb){return request(_0x4ee0('0x1e'),{'body':_0x1388eb});};exports[_0x4ee0('0x1f')]=function(_0x70e99b){return request(_0x4ee0('0x20'),{'body':_0x70e99b});};exports['createSquareReport']=function(_0x15df6b){return request(_0x4ee0('0x21'),{'body':_[_0x4ee0('0x22')](_0x15df6b,{'project_name':_0x15df6b[_0x4ee0('0x23')],'prev_project_name':_0x15df6b['arg_2']||'','is_subproject':_0x15df6b[_0x4ee0('0x24')]?!![]:![],'leaveAt':moment()[_0x4ee0('0x25')](_0x4ee0('0x26'))})});};exports['createSquareRecording']=function(_0x26b26e){return request('CreateSquareRecording',{'body':_0x26b26e});};exports[_0x4ee0('0x27')]=function(_0x4196a8){return request(_0x4ee0('0x28'),{'body':_0x4196a8});};exports[_0x4ee0('0x29')]=function(_0x4cbfa7){return request(_0x4ee0('0x2a'),{'options':{'raw':![],'where':{'phone':_0x4cbfa7[_0x4ee0('0x2b')],'ListId':_0x4cbfa7[_0x4ee0('0x2c')]}}})['then'](function(_0x41b2ee){if(_0x41b2ee){return _0x41b2ee;}return request(_0x4ee0('0x2d'),{'body':_0x4cbfa7});});};exports[_0x4ee0('0x2e')]=function(_0x5cb67e){return request(_0x4ee0('0x2f'),{'options':{'where':{'id':_0x5cb67e},'attributes':[_0x4ee0('0xc')]}});};exports[_0x4ee0('0x30')]=function(_0x3153cd,_0x366b9d){return request('LoginUser',{'body':{'interface':_0x366b9d},'options':{'where':_0x3153cd}});};exports[_0x4ee0('0x31')]=function(_0x46cb55,_0x52de6d,_0x95e1d1){return request(_0x4ee0('0x32'),{'body':{'type':_0x52de6d,'uniqueid':_0x95e1d1},'options':{'where':_0x46cb55}});};exports[_0x4ee0('0x33')]=function(_0x49fc70){return request('UnpauseUser',{'body':{},'options':{'where':_0x49fc70}});};exports['agentLogout']=function(_0x28f6c5){return request(_0x4ee0('0x34'),{'body':{},'options':{'where':_0x28f6c5}});}; \ 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 fdf003f..f9f3ba7 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 _0xbb53=['exports','./polly','./lex'];(function(_0x55acc3,_0x5da969){var _0x473d95=function(_0x124a8){while(--_0x124a8){_0x55acc3['push'](_0x55acc3['shift']());}};_0x473d95(++_0x5da969);}(_0xbb53,0x121));var _0x3bb5=function(_0x19c39e,_0x447e57){_0x19c39e=_0x19c39e-0x0;var _0xa5391b=_0xbb53[_0x19c39e];return _0xa5391b;};var polly=require(_0x3bb5('0x0'));var lex=require(_0x3bb5('0x1'));module[_0x3bb5('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x00bb=['exports','./polly','./lex'];(function(_0x4a63eb,_0x1f5415){var _0x5bff1f=function(_0x81e770){while(--_0x81e770){_0x4a63eb['push'](_0x4a63eb['shift']());}};_0x5bff1f(++_0x1f5415);}(_0x00bb,0x1d8));var _0xb00b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x00bb[_0x433a86];return _0x23000c;};var polly=require(_0xb00b('0x0'));var lex=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 52a9d73..e1e65a6 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 _0x2209=['exports','./lib/api'];(function(_0xe397b4,_0x37f1c0){var _0x384f1e=function(_0x2cc294){while(--_0x2cc294){_0xe397b4['push'](_0xe397b4['shift']());}};_0x384f1e(++_0x37f1c0);}(_0x2209,0x95));var _0x9220=function(_0x11b711,_0x86769){_0x11b711=_0x11b711-0x0;var _0x212bc3=_0x2209[_0x11b711];return _0x212bc3;};'use strict';var lex=require(_0x9220('0x0'));module[_0x9220('0x1')]=function(_0x165787,_0x19bb93,_0x29dc9b,_0x5d3fe2,_0x2b23aa,_0x5cc72c){return lex(_0x165787,_0x19bb93,_0x29dc9b,_0x5d3fe2,_0x2b23aa,_0x5cc72c);}; \ No newline at end of file +var _0x49e9=['exports','./lib/api'];(function(_0xdd83e4,_0x356cca){var _0x5c9bfc=function(_0x1ae86d){while(--_0x1ae86d){_0xdd83e4['push'](_0xdd83e4['shift']());}};_0x5c9bfc(++_0x356cca);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var lex=require(_0x949e('0x0'));module[_0x949e('0x1')]=function(_0x4d18e7,_0x41404c,_0x1db1b8,_0x259795,_0x5c303a,_0x4f1295){return lex(_0x4d18e7,_0x41404c,_0x1db1b8,_0x259795,_0x5c303a,_0x4f1295);}; \ 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 f152d6e..cfdf6df 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 _0x2f64=['slot_','exports','bluebird','aws-sdk','postText','slots','hasOwnProperty'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x2f64,0x183));var _0x42f6=function(_0x5c6403,_0xb08818){_0x5c6403=_0x5c6403-0x0;var _0x523367=_0x2f64[_0x5c6403];return _0x523367;};'use strict';var BPromise=require(_0x42f6('0x0'));var AWS=require(_0x42f6('0x1'));function lexResult(_0x3f6b60,_0x5809aa){return new BPromise(function(_0x1951b4,_0x21e807){_0x3f6b60[_0x42f6('0x2')](_0x5809aa,function(_0x505ae3,_0x496886){if(_0x505ae3){_0x21e807(_0x505ae3);}if(_0x496886[_0x42f6('0x3')]){for(const _0x536e28 in _0x496886[_0x42f6('0x3')]){if(_0x496886[_0x42f6('0x3')][_0x42f6('0x4')](_0x536e28)){var _0x2e3a4c=_0x496886[_0x42f6('0x3')][_0x536e28];_0x496886[_0x42f6('0x5')+_0x536e28]=_0x2e3a4c;}}}_0x1951b4(_0x496886);});});}module[_0x42f6('0x6')]=function(_0x2684e3,_0x423ef7,_0x5a98b5,_0x418664,_0x190f53,_0x4dbedf){var _0x80e0ef=new AWS['LexRuntime']({'accessKeyId':_0x423ef7,'secretAccessKey':_0x5a98b5,'region':_0x418664});var _0x14d650={'botAlias':'$LATEST','botName':_0x4dbedf,'inputText':_0x190f53,'userId':_0x2684e3};return lexResult(_0x80e0ef,_0x14d650);}; \ No newline at end of file +var _0x8185=['bluebird','aws-sdk','postText','slots','hasOwnProperty','exports'];(function(_0x21e013,_0x2be5cd){var _0x263331=function(_0xeb669e){while(--_0xeb669e){_0x21e013['push'](_0x21e013['shift']());}};_0x263331(++_0x2be5cd);}(_0x8185,0x1aa));var _0x5818=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8185[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x5818('0x0'));var AWS=require(_0x5818('0x1'));function lexResult(_0x494d1c,_0x14ebb2){return new BPromise(function(_0x4731f0,_0x52e9d5){_0x494d1c[_0x5818('0x2')](_0x14ebb2,function(_0x10bcf6,_0xcafb80){if(_0x10bcf6){_0x52e9d5(_0x10bcf6);}if(_0xcafb80['slots']){for(const _0x513435 in _0xcafb80[_0x5818('0x3')]){if(_0xcafb80[_0x5818('0x3')][_0x5818('0x4')](_0x513435)){var _0xb951b7=_0xcafb80[_0x5818('0x3')][_0x513435];_0xcafb80['slot_'+_0x513435]=_0xb951b7;}}}_0x4731f0(_0xcafb80);});});}module[_0x5818('0x5')]=function(_0xddfb46,_0x569eec,_0x6a8e0f,_0x55e8fd,_0x49fa43,_0x4c8fe8){var _0x46e3a6=new AWS['LexRuntime']({'accessKeyId':_0x569eec,'secretAccessKey':_0x6a8e0f,'region':_0x55e8fd});var _0x350a59={'botAlias':'$LATEST','botName':_0x4c8fe8,'inputText':_0x49fa43,'userId':_0xddfb46};return lexResult(_0x46e3a6,_0x350a59);}; \ 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 a11bbdf..f8fd342 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17bc=['./lib/api','exports'];(function(_0x28bc05,_0x1e1e27){var _0x4a0c4f=function(_0x4ba1fb){while(--_0x4ba1fb){_0x28bc05['push'](_0x28bc05['shift']());}};_0x4a0c4f(++_0x1e1e27);}(_0x17bc,0xd2));var _0xc17b=function(_0x401374,_0x2bf180){_0x401374=_0x401374-0x0;var _0x141811=_0x17bc[_0x401374];return _0x141811;};'use strict';var polly=require(_0xc17b('0x0'));module[_0xc17b('0x1')]=function(_0x5e09b5,_0x276f76,_0x51231b,_0xc5c7bc,_0x1dbcff,_0x5162af,_0x43ec2c){return polly(_0x5e09b5,_0x276f76,_0x51231b,_0xc5c7bc,_0x1dbcff,_0x5162af,_0x43ec2c);}; \ No newline at end of file +var _0xce6b=['./lib/api','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xce6b,0x1c4));var _0xbce6=function(_0x31a150,_0x51af27){_0x31a150=_0x31a150-0x0;var _0x539269=_0xce6b[_0x31a150];return _0x539269;};'use strict';var polly=require(_0xbce6('0x0'));module[_0xbce6('0x1')]=function(_0x59f684,_0x22bd66,_0x637af4,_0x586a98,_0x5ec33c,_0x5bbb70,_0x2759ef){return polly(_0x59f684,_0x22bd66,_0x637af4,_0x586a98,_0x5ec33c,_0x5bbb70,_0x2759ef);}; \ 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 b0c47d4..4614b12 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 _0xf338=['aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring'];(function(_0x96c15f,_0x538403){var _0x202a78=function(_0x311a4a){while(--_0x311a4a){_0x96c15f['push'](_0x96c15f['shift']());}};_0x202a78(++_0x538403);}(_0xf338,0x69));var _0x8f33=function(_0x5cf728,_0xb8e38c){_0x5cf728=_0x5cf728-0x0;var _0x199dc2=_0xf338[_0x5cf728];return _0x199dc2;};'use strict';var fs=require('fs');var path=require(_0x8f33('0x0'));var BPromise=require(_0x8f33('0x1'));var rs=require(_0x8f33('0x2'));var AWS=require(_0x8f33('0x3'));function pollyResult(_0x28a23f,_0x590a22,_0x239b4f){return new BPromise(function(_0x5429f4,_0x1cf5fd){_0x28a23f[_0x8f33('0x4')](_0x590a22,function(_0x536dbf,_0x30ac11){if(_0x536dbf){_0x1cf5fd(_0x536dbf);}else if(_0x30ac11){if(_0x30ac11[_0x8f33('0x5')]instanceof Buffer){fs['writeFile'](_0x239b4f,_0x30ac11[_0x8f33('0x5')],function(_0x39edb0){if(_0x39edb0){_0x1cf5fd(_0x39edb0);}else{_0x5429f4();}});}else{_0x1cf5fd(new Error(_0x8f33('0x6')));}}else{_0x1cf5fd(new Error(_0x8f33('0x7')));}});});}module[_0x8f33('0x8')]=function(_0x41adbc,_0x2a2b4a,_0x171e8a,_0x16ab5a,_0x790d03,_0x42f8bb,_0x10a7b0){var _0x5beefa=new AWS[(_0x8f33('0x9'))]({'accessKeyId':_0x41adbc,'secretAccessKey':_0x2a2b4a,'region':_0x171e8a});var _0x590bad={'Text':_0x790d03,'TextType':_0x42f8bb||_0x8f33('0xa'),'OutputFormat':_0x8f33('0xb'),'VoiceId':_0x16ab5a};return pollyResult(_0x5beefa,_0x590bad,_0x10a7b0);}; \ No newline at end of file +var _0x1655=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','mp3','bluebird','randomstring','aws-sdk'];(function(_0x6fc71b,_0x124a76){var _0x6ee6e4=function(_0x846430){while(--_0x846430){_0x6fc71b['push'](_0x6fc71b['shift']());}};_0x6ee6e4(++_0x124a76);}(_0x1655,0xbd));var _0x5165=function(_0x3331bc,_0x48721e){_0x3331bc=_0x3331bc-0x0;var _0x3ec355=_0x1655[_0x3331bc];return _0x3ec355;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x5165('0x0'));var rs=require(_0x5165('0x1'));var AWS=require(_0x5165('0x2'));function pollyResult(_0x3bbf66,_0x2bf157,_0x22b7e3){return new BPromise(function(_0x1f71a9,_0x240f95){_0x3bbf66[_0x5165('0x3')](_0x2bf157,function(_0x569948,_0x384aca){if(_0x569948){_0x240f95(_0x569948);}else if(_0x384aca){if(_0x384aca[_0x5165('0x4')]instanceof Buffer){fs[_0x5165('0x5')](_0x22b7e3,_0x384aca[_0x5165('0x4')],function(_0x2fe395){if(_0x2fe395){_0x240f95(_0x2fe395);}else{_0x1f71a9();}});}else{_0x240f95(new Error(_0x5165('0x6')));}}else{_0x240f95(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x1e10e7,_0x559f4b,_0x4b50b6,_0x46af9a,_0x12e1ef,_0x18a3a6,_0x26cebf){var _0x32cdd7=new AWS['Polly']({'accessKeyId':_0x1e10e7,'secretAccessKey':_0x559f4b,'region':_0x4b50b6});var _0x4a8fa4={'Text':_0x12e1ef,'TextType':_0x18a3a6||'text','OutputFormat':_0x5165('0x7'),'VoiceId':_0x46af9a};return pollyResult(_0x32cdd7,_0x4a8fa4,_0x26cebf);}; \ 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 1a299bd..bd5b647 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 _0x911c=['exports'];(function(_0x1a7d2b,_0x395f8f){var _0x54ceec=function(_0x2c83f0){while(--_0x2c83f0){_0x1a7d2b['push'](_0x1a7d2b['shift']());}};_0x54ceec(++_0x395f8f);}(_0x911c,0x79));var _0xc911=function(_0x3e4db1,_0x385cd6){_0x3e4db1=_0x3e4db1-0x0;var _0x33ecd5=_0x911c[_0x3e4db1];return _0x33ecd5;};'use strict';var asr=require('./lib/api');module[_0xc911('0x0')]=function(_0xe8190b,_0x12bbab,_0x2ddc56,_0x944452){return asr(_0xe8190b,_0x12bbab,_0x2ddc56);}; \ No newline at end of file +var _0x2a80=['exports','./lib/api'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x2a80,0xfb));var _0x02a8=function(_0x55856f,_0x2ae3ee){_0x55856f=_0x55856f-0x0;var _0x2b1242=_0x2a80[_0x55856f];return _0x2b1242;};'use strict';var asr=require(_0x02a8('0x0'));module[_0x02a8('0x1')]=function(_0x18cfc8,_0x4ad65d,_0x1b0f2f,_0x5ae9dd){return asr(_0x18cfc8,_0x4ad65d,_0x1b0f2f);}; \ 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 b347775..08e97ce 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 _0xfeaa=['key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','filepath\x20should\x20be\x20a\x20string','length'];(function(_0x28f8df,_0x3cad64){var _0xffbd8e=function(_0x43eb3c){while(--_0x43eb3c){_0x28f8df['push'](_0x28f8df['shift']());}};_0xffbd8e(++_0x3cad64);}(_0xfeaa,0x19e));var _0xafea=function(_0x1fc7c1,_0xc9e47a){_0x1fc7c1=_0x1fc7c1-0x0;var _0x594545=_0xfeaa[_0x1fc7c1];return _0x594545;};'use strict';var url=require(_0xafea('0x0'));var BPromise=require(_0xafea('0x1'));var fs=require('fs');var host=_0xafea('0x2');module['exports']=function(_0x5b7689,_0x1c50f4,_0x562d79){return new BPromise(function(_0x4c9be9,_0x2169d3){var _0x4a4c66;if(typeof _0x5b7689!==_0xafea('0x3')||_0x5b7689['length']===0x0){return _0x2169d3(_0xafea('0x4'));}if(typeof _0x1c50f4!==_0xafea('0x3')||_0x1c50f4[_0xafea('0x5')]===0x0){return _0x2169d3(_0xafea('0x6'));}if(typeof _0x562d79!=='undefined'&&(typeof _0x562d79!==_0xafea('0x3')||_0x562d79[_0xafea('0x5')]===0x0)){return _0x2169d3('lang\x20should\x20be\x20a\x20string');}try{_0x4a4c66=fs[_0xafea('0x7')](_0x5b7689)[_0xafea('0x8')](_0xafea('0x9'));}catch(_0x3a6a7d){return _0x2169d3(_0x3a6a7d);}return _0x4c9be9({'method':_0xafea('0xa'),'uri':host+_0xafea('0xb')+_0x1c50f4,'body':{'config':{'encoding':_0xafea('0xc'),'sampleRateHertz':_0xafea('0xd'),'languageCode':_0x562d79},'audio':{'content':_0x4a4c66}},'json':!![]});});}; \ No newline at end of file +var _0x554d=['filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','8000','url','bluebird','exports','string','length'];(function(_0xaa2477,_0x1c92a8){var _0x6ceda2=function(_0x2edb94){while(--_0x2edb94){_0xaa2477['push'](_0xaa2477['shift']());}};_0x6ceda2(++_0x1c92a8);}(_0x554d,0xbb));var _0xd554=function(_0x2b85df,_0x42d865){_0x2b85df=_0x2b85df-0x0;var _0x34764d=_0x554d[_0x2b85df];return _0x34764d;};'use strict';var url=require(_0xd554('0x0'));var BPromise=require(_0xd554('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xd554('0x2')]=function(_0x389d64,_0x3d3afd,_0x273cb8){return new BPromise(function(_0x469b12,_0x58d405){var _0x3df108;if(typeof _0x389d64!==_0xd554('0x3')||_0x389d64[_0xd554('0x4')]===0x0){return _0x58d405(_0xd554('0x5'));}if(typeof _0x3d3afd!==_0xd554('0x3')||_0x3d3afd[_0xd554('0x4')]===0x0){return _0x58d405('key\x20should\x20be\x20a\x20string');}if(typeof _0x273cb8!==_0xd554('0x6')&&(typeof _0x273cb8!==_0xd554('0x3')||_0x273cb8[_0xd554('0x4')]===0x0)){return _0x58d405(_0xd554('0x7'));}try{_0x3df108=fs['readFileSync'](_0x389d64)[_0xd554('0x8')]('base64');}catch(_0x1c2eb0){return _0x58d405(_0x1c2eb0);}return _0x469b12({'method':_0xd554('0x9'),'uri':host+_0xd554('0xa')+_0x3d3afd,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xd554('0xb'),'languageCode':_0x273cb8},'audio':{'content':_0x3df108}},'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 cc297b3..10cb4be 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 _0x9490=['./asr','exports'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x9490,0x148));var _0x0949=function(_0x5940f9,_0x10b144){_0x5940f9=_0x5940f9-0x0;var _0x16ea86=_0x9490[_0x5940f9];return _0x16ea86;};var asr=require(_0x0949('0x0'));module[_0x0949('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/scripts/index.js b/server/services/agi/scripts/index.js index ae3b8d2..8615388 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 _0xbb68=['transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','audioConfig','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','split','googleTTS','googleASR','asr','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','audiofile','dirName','path','http','url','parse','randomstring','sox','util','querystring','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','error','\x20failed,\x20status\x20code\x20=\x20','statusCode','request\x20to\x20','statusMessage','info','finish\x20download\x20file','close','unlink','download\x20error','end','data'];(function(_0x7f0a45,_0x522e9a){var _0x2baeb3=function(_0xf9246a){while(--_0xf9246a){_0x7f0a45['push'](_0x7f0a45['shift']());}};_0x2baeb3(++_0x522e9a);}(_0xbb68,0xba));var _0x8bb6=function(_0x10cc59,_0x2c7d3f){_0x10cc59=_0x10cc59-0x0;var _0xdcc21f=_0xbb68[_0x10cc59];return _0xdcc21f;};'use strict';var fs=require('fs');var path=require(_0x8bb6('0x0'));var http=require(_0x8bb6('0x1'));var https=require('https');var urlParse=require(_0x8bb6('0x2'))[_0x8bb6('0x3')];var BPromise=require('bluebird');var rs=require(_0x8bb6('0x4'));var sox=require(_0x8bb6('0x5'));var rp=require('request-promise');var util=require(_0x8bb6('0x6'));var querystring=require(_0x8bb6('0x7'));var tts=require('google-tts-api');var apiai=require('apiai-promise');var md5=require(_0x8bb6('0x8'));var google=require(_0x8bb6('0x9'));var aws=require(_0x8bb6('0xa'));var tilde=require(_0x8bb6('0xb'));var sestek=require(_0x8bb6('0xc'));var logger=require(_0x8bb6('0xd'))(_0x8bb6('0xe'));var ISPEECH_API=_0x8bb6('0xf');function downloadFile(_0x50eafe,_0x135c67){return new BPromise(function(_0x4d5ed0,_0x471830){var _0x58ed80=urlParse(_0x50eafe);var _0x11a046=_0x58ed80[_0x8bb6('0x10')]==='https:'?https:http;var _0x58baf0={'host':_0x58ed80[_0x8bb6('0x11')],'path':_0x58ed80['path'],'headers':{'user-agent':_0x8bb6('0x12')}};_0x11a046[_0x8bb6('0x13')](_0x58baf0,function(_0x159eb8){if(_0x159eb8['statusCode']!==0xc8){logger[_0x8bb6('0x14')]('request\x20to\x20'+_0x50eafe+_0x8bb6('0x15')+_0x159eb8[_0x8bb6('0x16')]+'\x20('+_0x159eb8['statusMessage']+')');_0x471830(new Error(_0x8bb6('0x17')+_0x50eafe+_0x8bb6('0x15')+_0x159eb8[_0x8bb6('0x16')]+'\x20('+_0x159eb8[_0x8bb6('0x18')]+')'));return;}var _0x588098=fs['createWriteStream'](_0x135c67);_0x588098['on']('finish',function(){logger[_0x8bb6('0x19')](_0x8bb6('0x1a'));_0x588098[_0x8bb6('0x1b')](_0x4d5ed0);});_0x588098['on'](_0x8bb6('0x14'),function(_0xf2f2d1){fs[_0x8bb6('0x1c')](_0x135c67);logger[_0x8bb6('0x14')](_0x8bb6('0x1d'),_0xf2f2d1);_0x471830(_0xf2f2d1);});_0x159eb8['pipe'](_0x588098);})['on'](_0x8bb6('0x14'),function(_0x196bca){logger['error'](_0x196bca);_0x471830(_0x196bca);})[_0x8bb6('0x1e')]();});}function uploadFile(_0x53f3e7){return new BPromise(function(_0xae7d10,_0x180c18){var _0x12fc50=urlParse(_0x53f3e7);var _0x23ab0b=_0x12fc50[_0x8bb6('0x10')]==='https:'?https:http;var _0x3f9e4d={'host':_0x12fc50[_0x8bb6('0x11')],'path':_0x12fc50[_0x8bb6('0x0')],'headers':{'user-agent':_0x8bb6('0x12')}};_0x23ab0b['get'](_0x3f9e4d,function(_0xf5920f){if(_0xf5920f[_0x8bb6('0x16')]!==0xc8){_0x180c18(new Error('request\x20to\x20'+_0x53f3e7+_0x8bb6('0x15')+_0xf5920f[_0x8bb6('0x16')]+'\x20('+_0xf5920f['statusMessage']+')'));return;}var _0x1ba603='';_0xf5920f['on'](_0x8bb6('0x1f'),function(_0x35f38c){_0x1ba603+=_0x35f38c;});_0xf5920f['on'](_0x8bb6('0x1e'),function(){_0xae7d10(_0x1ba603);});})['on']('error',function(_0x32c2ee){_0x180c18(_0x32c2ee);})[_0x8bb6('0x1e')]();});}function convertFile(_0x2921d,_0x28f8af){return new BPromise(function(_0x5670da,_0x5e4faf){var _0x2ef913=sox[_0x8bb6('0x20')](_0x2921d,_0x28f8af,{'sampleRate':0x1f40,'format':_0x8bb6('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2ef913['on'](_0x8bb6('0x14'),function(_0x211ee9){logger[_0x8bb6('0x14')](_0x8bb6('0x22'),_0x211ee9);_0x5e4faf(_0x211ee9);});_0x2ef913['on'](_0x8bb6('0x1e'),function(){logger['info'](_0x8bb6('0x23'));_0x5670da();});_0x2ef913[_0x8bb6('0x24')]();});}function base64Decode(_0xc95699,_0x5a802b){var _0x27d854=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs[_0x8bb6('0x27')](0x4)+_0x8bb6('0x28'));fs[_0x8bb6('0x29')](_0x27d854,_0xc95699,_0x8bb6('0x2a'));return convertFile(_0x27d854,_0x5a802b)['then'](function(){try{fs[_0x8bb6('0x1c')](_0x27d854);fs[_0x8bb6('0x2b')](_0x5a802b,'777');}catch(_0x53caca){logger[_0x8bb6('0x14')](_0x53caca);}return _0x5a802b['split']('.')[0x0];});}function base64Encode(_0xd90184){var _0x3c2995=fs[_0x8bb6('0x2c')](_0xd90184);return new Buffer(_0x3c2995)[_0x8bb6('0x2d')](_0x8bb6('0x2a'));}exports[_0x8bb6('0x2e')]=function(_0x2deccc,_0x108d2e,_0x2da5eb,_0x343eeb,_0x3baf31,_0x3cd066){var _0x516b46,_0x44512b;var _0x28f6c7=_0x8bb6('0x2f');var _0x3cd14f='?key='+_0x2deccc;var _0x2e7087={};if(_0x108d2e==='ssml'){_0x2e7087[_0x8bb6('0x30')]={'ssml':_0x2da5eb};}else{_0x2e7087['input']={'text':_0x2da5eb};};_0x2e7087[_0x8bb6('0x31')]={'languageCode':_0x343eeb,'ssmlGender':_0x3baf31};_0x2e7087[_0x8bb6('0x32')]={'audioEncoding':_0x8bb6('0x33'),'sampleRateHertz':0x1f40};var _0x2301a6={'url':_0x28f6c7+_0x8bb6('0x34')+_0x3cd14f,'method':_0x8bb6('0x35'),'json':!![],'body':_0x2e7087};return rp(_0x2301a6)[_0x8bb6('0x36')](function(_0x2d4e0b){return new BPromise(function(_0xa25665,_0x169b9c){_0x516b46=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs['generate'](0x4)+_0x8bb6('0x37'));var _0x44c517=Buffer[_0x8bb6('0x38')](_0x2d4e0b[_0x8bb6('0x39')],_0x8bb6('0x2a'));return fs[_0x8bb6('0x3a')](_0x516b46,_0x44c517,function(_0x3a3944){_0x169b9c(_0x3a3944);},function(_0x30f81f){fs[_0x8bb6('0x2b')](_0x516b46,_0x8bb6('0x3b'));_0xa25665(_0x30f81f);});});})[_0x8bb6('0x36')](function(_0x44a48b){_0x44512b=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs['generate'](0x4)+_0x8bb6('0x28'));return convertFile(_0x516b46,_0x44512b);})['then'](function(){try{fs[_0x8bb6('0x1c')](_0x516b46);fs[_0x8bb6('0x2b')](_0x44512b,'777');}catch(_0xdd9aae){logger[_0x8bb6('0x14')](_0xdd9aae);}logger[_0x8bb6('0x19')](_0x8bb6('0x3c'),_0x44512b[_0x8bb6('0x3d')]('.')[0x0]);return _0x44512b[_0x8bb6('0x3d')]('.')[0x0];});};exports[_0x8bb6('0x3e')]=function(_0x389bdb,_0x30a4c4){var _0x2776f4,_0x505c82;return tts(_0x389bdb,_0x30a4c4||'en',0x1)[_0x8bb6('0x36')](function(_0x17c6c7){logger[_0x8bb6('0x19')](_0x17c6c7);_0x2776f4=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs[_0x8bb6('0x27')](0x4)+_0x8bb6('0x37'));return downloadFile(_0x17c6c7,_0x2776f4);})[_0x8bb6('0x36')](function(){_0x505c82=path[_0x8bb6('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x8bb6('0x28'));return convertFile(_0x2776f4,_0x505c82);})[_0x8bb6('0x36')](function(){try{fs[_0x8bb6('0x1c')](_0x2776f4);fs[_0x8bb6('0x2b')](_0x505c82,_0x8bb6('0x3b'));}catch(_0x28a5ba){logger[_0x8bb6('0x14')](_0x28a5ba);}logger['info']('goggleTTS\x20path',_0x505c82[_0x8bb6('0x3d')]('.')[0x0]);return _0x505c82['split']('.')[0x0];});};exports[_0x8bb6('0x3f')]=function(_0x5ccdd1,_0x437b88,_0x627356){return google[_0x8bb6('0x40')](_0x5ccdd1,_0x437b88,_0x627356)[_0x8bb6('0x36')](function(_0x19526c){logger[_0x8bb6('0x19')](_0x19526c[_0x8bb6('0x41')]);return rp(_0x19526c);})['then'](function(_0x580f40){var _0x5047e9='';var _0x487ea4=0x0;try{fs[_0x8bb6('0x1c')](_0x5ccdd1);}catch(_0x1f212d){logger[_0x8bb6('0x14')](_0x1f212d);}if(_0x580f40&&_0x580f40[_0x8bb6('0x42')]){_0x5047e9=_0x580f40[_0x8bb6('0x42')][_0x8bb6('0x43')](function(_0x8b1d37){return _0x8b1d37&&_0x8b1d37[_0x8bb6('0x44')][0x0]&&_0x8b1d37[_0x8bb6('0x44')][0x0][_0x8bb6('0x45')]?_0x8b1d37[_0x8bb6('0x44')][0x0][_0x8bb6('0x45')]:'';})[_0x8bb6('0x46')]('\x0a');_0x487ea4=_0x580f40['results'][_0x8bb6('0x43')](function(_0x4690cd){return _0x4690cd&&_0x4690cd['alternatives'][0x0]&&_0x4690cd[_0x8bb6('0x44')][0x0]['confidence']?_0x4690cd[_0x8bb6('0x44')][0x0]['confidence']:0x0;})[_0x8bb6('0x46')]('\x0a');}logger['info'](_0x8bb6('0x47'),_0x5047e9);logger[_0x8bb6('0x19')](_0x8bb6('0x48'),_0x487ea4);return{'transcript':_0x5047e9,'confidence':_0x487ea4};})[_0x8bb6('0x49')](function(_0x59c6b9){logger[_0x8bb6('0x14')]('[%s]\x20%s:%s',_0x59c6b9['statusCode'],_0x59c6b9[_0x8bb6('0x4a')],_0x59c6b9[_0x8bb6('0x4b')]);});};exports[_0x8bb6('0x4c')]=function(_0x5b44f,_0x386d03,_0x2f7567,_0x2fd755){var _0x279493=apiai(_0x386d03,{'language':_0x2fd755||'en'});return _0x279493[_0x8bb6('0x4d')](_0x2f7567,{'sessionId':md5(_0x5b44f)})[_0x8bb6('0x36')](function(_0x50c132){logger['info'](JSON[_0x8bb6('0x4e')](_0x50c132));return{'source':_0x50c132[_0x8bb6('0x4f')][_0x8bb6('0x50')],'resolvedQuery':_0x50c132['result'][_0x8bb6('0x51')],'action':_0x50c132[_0x8bb6('0x4f')][_0x8bb6('0x52')],'actionIncomplete':_0x50c132[_0x8bb6('0x4f')][_0x8bb6('0x53')],'speech':_0x50c132[_0x8bb6('0x4f')][_0x8bb6('0x54')][_0x8bb6('0x55')],'score':_0x50c132[_0x8bb6('0x4f')]['score'],'statusCode':_0x50c132[_0x8bb6('0x56')][_0x8bb6('0x57')],'endConversation':_0x50c132['result'][_0x8bb6('0x58')][_0x8bb6('0x59')]||![],'isFallbackIntent':_0x50c132[_0x8bb6('0x4f')][_0x8bb6('0x58')][_0x8bb6('0x5a')]};});};exports[_0x8bb6('0x5b')]=function(_0x215b32,_0x59fc1a,_0x437e54,_0x3df5b5){return tilde[_0x8bb6('0x40')](_0x215b32,_0x59fc1a,_0x437e54,_0x3df5b5)[_0x8bb6('0x36')](function(_0xc1bf7b){try{fs['unlink'](_0x215b32);}catch(_0x189551){logger[_0x8bb6('0x14')](_0x189551);}logger[_0x8bb6('0x19')](_0x8bb6('0x5c'),_0xc1bf7b[_0x8bb6('0x45')]);logger[_0x8bb6('0x19')]('Tilde\x20ASR\x20confidence',_0xc1bf7b['confidence']);return _0xc1bf7b;});};exports[_0x8bb6('0x5d')]=function(_0x557f0a,_0x607c56,_0x3fc830,_0x1f7736,_0x5edc2f,_0x27218a){var _0x18d273=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs[_0x8bb6('0x27')](0x4)+_0x8bb6('0x37'));var _0x5c9e05;return aws[_0x8bb6('0x5e')](_0x557f0a,_0x607c56,_0x3fc830,_0x1f7736,_0x5edc2f,_0x27218a,_0x18d273)[_0x8bb6('0x36')](function(){_0x5c9e05=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs[_0x8bb6('0x27')](0x4)+_0x8bb6('0x28'));return convertFile(_0x18d273,_0x5c9e05);})['then'](function(){try{fs[_0x8bb6('0x1c')](_0x18d273);fs['chmodSync'](_0x5c9e05,_0x8bb6('0x3b'));}catch(_0xb8ad81){logger['error'](_0xb8ad81);}return _0x5c9e05[_0x8bb6('0x3d')]('.')[0x0];});};exports[_0x8bb6('0x5f')]=function(_0x506007,_0x18fbfe,_0x292524,_0x2cd93d,_0x2d47a1,_0xaf15ea){return aws['lex'](_0x506007,_0x18fbfe,_0x292524,_0x2cd93d,_0x2d47a1,_0xaf15ea)[_0x8bb6('0x36')](function(_0x10c599){logger[_0x8bb6('0x19')](JSON['stringify'](_0x10c599));return _0x10c599;});};exports[_0x8bb6('0x60')]=function(_0x13c013,_0x27dadc,_0x2a4b16,_0x39646d){var _0x28cbaf=util[_0x8bb6('0x61')](_0x8bb6('0x62'),ISPEECH_API,_0x13c013,encodeURIComponent(_0x27dadc),_0x2a4b16,_0x39646d);var _0x3ee275=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs[_0x8bb6('0x27')](0x4)+_0x8bb6('0x37'));var _0x1138d7;return downloadFile(_0x28cbaf,_0x3ee275)[_0x8bb6('0x36')](function(){_0x1138d7=path[_0x8bb6('0x25')](__dirname,_0x8bb6('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x3ee275,_0x1138d7);})['then'](function(){try{fs[_0x8bb6('0x1c')](_0x3ee275);fs[_0x8bb6('0x2b')](_0x1138d7,_0x8bb6('0x3b'));}catch(_0x392822){logger['error'](_0x392822);}return _0x1138d7[_0x8bb6('0x3d')]('.')[0x0];});};exports[_0x8bb6('0x63')]=function(_0x4cfa7e,_0x180b7b,_0x536296,_0xc74b31){var _0x21ccb4=util[_0x8bb6('0x61')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x180b7b,_0x536296,base64Encode(_0x4cfa7e),_0xc74b31?util['format'](_0x8bb6('0x64'),encodeURIComponent(_0xc74b31)):'freeform=3');return uploadFile(_0x21ccb4)[_0x8bb6('0x36')](function(_0x5f1a05){return querystring[_0x8bb6('0x3')](_0x5f1a05);});};exports[_0x8bb6('0x65')]=function(_0x456874,_0x343ad2){return sestek[_0x8bb6('0x66')](_0x456874,_0x343ad2)['then'](function(_0x3e1d7a){logger['info'](JSON[_0x8bb6('0x4e')](_0x3e1d7a));var _0x29702d={'speech':_0x3e1d7a[_0x8bb6('0x67')],'action':_0x3e1d7a[_0x8bb6('0x68')]?_0x3e1d7a[_0x8bb6('0x68')][_0x8bb6('0x69')]:undefined,'actiondata':_0x3e1d7a['channelData']?_0x3e1d7a[_0x8bb6('0x68')]['CustomActionData']:undefined};if(_0x3e1d7a['channelData']&&_0x3e1d7a['channelData'][_0x8bb6('0x6a')]){return base64Decode(_0x3e1d7a[_0x8bb6('0x68')]['AudioFromTts']['Data'],path[_0x8bb6('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x8bb6('0x28')))[_0x8bb6('0x36')](function(_0x135d79){_0x29702d[_0x8bb6('0x6b')]=_0x135d79;return _0x29702d;});}return _0x29702d;});};exports[_0x8bb6('0x6c')]=function(){return __dirname;}; \ No newline at end of file +var _0xed4e=['finish','finish\x20download\x20file','close','download\x20error','pipe','end','https:','host','get','\x20failed,\x20status\x20code\x20=\x20','data','transcode','error\x20convert','info','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','confidence','join','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','endConversation','tildeASR','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','channelData','CustomAction','Data','audiofile','dirName','path','http','https','url','parse','bluebird','randomstring','sox','request-promise','util','google-tts-api','apiai-promise','md5','./google','./aws','./sestek','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','error','statusCode','statusMessage','request\x20to\x20','createWriteStream'];(function(_0x138f30,_0x363bbe){var _0x56e392=function(_0x2414b1){while(--_0x2414b1){_0x138f30['push'](_0x138f30['shift']());}};_0x56e392(++_0x363bbe);}(_0xed4e,0x19f));var _0xeed4=function(_0xc41197,_0x3007a5){_0xc41197=_0xc41197-0x0;var _0x426f18=_0xed4e[_0xc41197];return _0x426f18;};'use strict';var fs=require('fs');var path=require(_0xeed4('0x0'));var http=require(_0xeed4('0x1'));var https=require(_0xeed4('0x2'));var urlParse=require(_0xeed4('0x3'))[_0xeed4('0x4')];var BPromise=require(_0xeed4('0x5'));var rs=require(_0xeed4('0x6'));var sox=require(_0xeed4('0x7'));var rp=require(_0xeed4('0x8'));var util=require(_0xeed4('0x9'));var querystring=require('querystring');var tts=require(_0xeed4('0xa'));var apiai=require(_0xeed4('0xb'));var md5=require(_0xeed4('0xc'));var google=require(_0xeed4('0xd'));var aws=require(_0xeed4('0xe'));var tilde=require('./tilde');var sestek=require(_0xeed4('0xf'));var logger=require('../../../config/logger')(_0xeed4('0x10'));var ISPEECH_API=_0xeed4('0x11');function downloadFile(_0x52584a,_0x1de075){return new BPromise(function(_0x5cda3e,_0x47d035){var _0x238a52=urlParse(_0x52584a);var _0x2f2abf=_0x238a52[_0xeed4('0x12')]==='https:'?https:http;var _0x54a9ee={'host':_0x238a52['host'],'path':_0x238a52[_0xeed4('0x0')],'headers':{'user-agent':_0xeed4('0x13')}};_0x2f2abf['get'](_0x54a9ee,function(_0x349ff6){if(_0x349ff6['statusCode']!==0xc8){logger[_0xeed4('0x14')]('request\x20to\x20'+_0x52584a+'\x20failed,\x20status\x20code\x20=\x20'+_0x349ff6[_0xeed4('0x15')]+'\x20('+_0x349ff6[_0xeed4('0x16')]+')');_0x47d035(new Error(_0xeed4('0x17')+_0x52584a+'\x20failed,\x20status\x20code\x20=\x20'+_0x349ff6[_0xeed4('0x15')]+'\x20('+_0x349ff6[_0xeed4('0x16')]+')'));return;}var _0x5cab3c=fs[_0xeed4('0x18')](_0x1de075);_0x5cab3c['on'](_0xeed4('0x19'),function(){logger['info'](_0xeed4('0x1a'));_0x5cab3c[_0xeed4('0x1b')](_0x5cda3e);});_0x5cab3c['on'](_0xeed4('0x14'),function(_0x1fc607){fs['unlink'](_0x1de075);logger[_0xeed4('0x14')](_0xeed4('0x1c'),_0x1fc607);_0x47d035(_0x1fc607);});_0x349ff6[_0xeed4('0x1d')](_0x5cab3c);})['on'](_0xeed4('0x14'),function(_0xfc732d){logger[_0xeed4('0x14')](_0xfc732d);_0x47d035(_0xfc732d);})[_0xeed4('0x1e')]();});}function uploadFile(_0x22ada8){return new BPromise(function(_0x22f950,_0x42b17a){var _0x2ff46a=urlParse(_0x22ada8);var _0x1470a4=_0x2ff46a[_0xeed4('0x12')]===_0xeed4('0x1f')?https:http;var _0x3d2ea2={'host':_0x2ff46a[_0xeed4('0x20')],'path':_0x2ff46a['path'],'headers':{'user-agent':_0xeed4('0x13')}};_0x1470a4[_0xeed4('0x21')](_0x3d2ea2,function(_0x28af38){if(_0x28af38[_0xeed4('0x15')]!==0xc8){_0x42b17a(new Error(_0xeed4('0x17')+_0x22ada8+_0xeed4('0x22')+_0x28af38[_0xeed4('0x15')]+'\x20('+_0x28af38['statusMessage']+')'));return;}var _0xa3a3b2='';_0x28af38['on'](_0xeed4('0x23'),function(_0xe40961){_0xa3a3b2+=_0xe40961;});_0x28af38['on'](_0xeed4('0x1e'),function(){_0x22f950(_0xa3a3b2);});})['on'](_0xeed4('0x14'),function(_0x4284fd){_0x42b17a(_0x4284fd);})[_0xeed4('0x1e')]();});}function convertFile(_0x1f1b9f,_0x19cbc8){return new BPromise(function(_0x572a89,_0x208ac9){var _0x14bed8=sox[_0xeed4('0x24')](_0x1f1b9f,_0x19cbc8,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x14bed8['on'](_0xeed4('0x14'),function(_0x1bdef5){logger[_0xeed4('0x14')](_0xeed4('0x25'),_0x1bdef5);_0x208ac9(_0x1bdef5);});_0x14bed8['on'](_0xeed4('0x1e'),function(){logger[_0xeed4('0x26')]('finish\x20to\x20convert');_0x572a89();});_0x14bed8['start']();});}function base64Decode(_0x40d12f,_0x3d6733){var _0x4b5153=path[_0xeed4('0x27')](__dirname,_0xeed4('0x28'),rs[_0xeed4('0x29')](0x4)+_0xeed4('0x2a'));fs[_0xeed4('0x2b')](_0x4b5153,_0x40d12f,_0xeed4('0x2c'));return convertFile(_0x4b5153,_0x3d6733)[_0xeed4('0x2d')](function(){try{fs[_0xeed4('0x2e')](_0x4b5153);fs[_0xeed4('0x2f')](_0x3d6733,'777');}catch(_0x3906c5){logger['error'](_0x3906c5);}return _0x3d6733[_0xeed4('0x30')]('.')[0x0];});}function base64Encode(_0x80595){var _0x4d4ee6=fs[_0xeed4('0x31')](_0x80595);return new Buffer(_0x4d4ee6)['toString'](_0xeed4('0x2c'));}exports[_0xeed4('0x32')]=function(_0x27758c,_0x35feac,_0x5052a5,_0x5815ca,_0x2877de,_0x439f3e){var _0x2256c5,_0x378462;var _0x52fb24=_0xeed4('0x33');var _0x3e97de=_0xeed4('0x34')+_0x27758c;var _0xb21c6a={};if(_0x35feac===_0xeed4('0x35')){_0xb21c6a['input']={'ssml':_0x5052a5};}else{_0xb21c6a[_0xeed4('0x36')]={'text':_0x5052a5};};_0xb21c6a['voice']={'languageCode':_0x5815ca,'ssmlGender':_0x2877de};_0xb21c6a[_0xeed4('0x37')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x56904a={'url':_0x52fb24+_0xeed4('0x38')+_0x3e97de,'method':'POST','json':!![],'body':_0xb21c6a};return rp(_0x56904a)[_0xeed4('0x2d')](function(_0x4ed02e){return new BPromise(function(_0x33af18,_0x202280){_0x2256c5=path[_0xeed4('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0xeed4('0x39'));var _0x5206a2=Buffer[_0xeed4('0x3a')](_0x4ed02e[_0xeed4('0x3b')],_0xeed4('0x2c'));return fs[_0xeed4('0x3c')](_0x2256c5,_0x5206a2,function(_0x9f64f7){_0x202280(_0x9f64f7);},function(_0x4a33e9){fs[_0xeed4('0x2f')](_0x2256c5,_0xeed4('0x3d'));_0x33af18(_0x4a33e9);});});})[_0xeed4('0x2d')](function(_0x5702aa){_0x378462=path['resolve'](__dirname,_0xeed4('0x28'),rs['generate'](0x4)+_0xeed4('0x2a'));return convertFile(_0x2256c5,_0x378462);})['then'](function(){try{fs[_0xeed4('0x2e')](_0x2256c5);fs[_0xeed4('0x2f')](_0x378462,_0xeed4('0x3d'));}catch(_0x28fc3a){logger[_0xeed4('0x14')](_0x28fc3a);}logger[_0xeed4('0x26')](_0xeed4('0x3e'),_0x378462[_0xeed4('0x30')]('.')[0x0]);return _0x378462['split']('.')[0x0];});};exports[_0xeed4('0x3f')]=function(_0x392b0b,_0x32186b){var _0xc4cb1b,_0x4401b4;return tts(_0x392b0b,_0x32186b||'en',0x1)['then'](function(_0x41d379){logger['info'](_0x41d379);_0xc4cb1b=path[_0xeed4('0x27')](__dirname,_0xeed4('0x28'),rs[_0xeed4('0x29')](0x4)+'.mp3');return downloadFile(_0x41d379,_0xc4cb1b);})['then'](function(){_0x4401b4=path[_0xeed4('0x27')](__dirname,_0xeed4('0x28'),rs[_0xeed4('0x29')](0x4)+_0xeed4('0x2a'));return convertFile(_0xc4cb1b,_0x4401b4);})[_0xeed4('0x2d')](function(){try{fs[_0xeed4('0x2e')](_0xc4cb1b);fs[_0xeed4('0x2f')](_0x4401b4,_0xeed4('0x3d'));}catch(_0x2f2907){logger[_0xeed4('0x14')](_0x2f2907);}logger[_0xeed4('0x26')](_0xeed4('0x40'),_0x4401b4[_0xeed4('0x30')]('.')[0x0]);return _0x4401b4[_0xeed4('0x30')]('.')[0x0];});};exports[_0xeed4('0x41')]=function(_0x37cdca,_0x26d491,_0x3ce8a8){return google[_0xeed4('0x42')](_0x37cdca,_0x26d491,_0x3ce8a8)[_0xeed4('0x2d')](function(_0x5c8d28){logger[_0xeed4('0x26')](_0x5c8d28[_0xeed4('0x43')]);return rp(_0x5c8d28);})[_0xeed4('0x2d')](function(_0x192b5d){var _0x2e636d='';var _0x3ba305=0x0;try{fs[_0xeed4('0x2e')](_0x37cdca);}catch(_0x4aa211){logger[_0xeed4('0x14')](_0x4aa211);}if(_0x192b5d&&_0x192b5d[_0xeed4('0x44')]){_0x2e636d=_0x192b5d[_0xeed4('0x44')][_0xeed4('0x45')](function(_0xcfd6fe){return _0xcfd6fe&&_0xcfd6fe['alternatives'][0x0]&&_0xcfd6fe[_0xeed4('0x46')][0x0]['transcript']?_0xcfd6fe[_0xeed4('0x46')][0x0]['transcript']:'';})['join']('\x0a');_0x3ba305=_0x192b5d[_0xeed4('0x44')][_0xeed4('0x45')](function(_0xe2ee6b){return _0xe2ee6b&&_0xe2ee6b[_0xeed4('0x46')][0x0]&&_0xe2ee6b[_0xeed4('0x46')][0x0][_0xeed4('0x47')]?_0xe2ee6b[_0xeed4('0x46')][0x0][_0xeed4('0x47')]:0x0;})[_0xeed4('0x48')]('\x0a');}logger[_0xeed4('0x26')]('googleASR\x20transcription',_0x2e636d);logger[_0xeed4('0x26')]('googleASR\x20confidence',_0x3ba305);return{'transcript':_0x2e636d,'confidence':_0x3ba305};})[_0xeed4('0x49')](function(_0xbd6fd0){logger['error'](_0xeed4('0x4a'),_0xbd6fd0['statusCode'],_0xbd6fd0[_0xeed4('0x4b')],_0xbd6fd0[_0xeed4('0x4c')]);});};exports[_0xeed4('0x4d')]=function(_0xb7de9e,_0x2d3de3,_0x228c63,_0x4aeaa1){var _0x247c0b=apiai(_0x2d3de3,{'language':_0x4aeaa1||'en'});return _0x247c0b[_0xeed4('0x4e')](_0x228c63,{'sessionId':md5(_0xb7de9e)})[_0xeed4('0x2d')](function(_0x171234){logger[_0xeed4('0x26')](JSON[_0xeed4('0x4f')](_0x171234));return{'source':_0x171234[_0xeed4('0x50')][_0xeed4('0x51')],'resolvedQuery':_0x171234[_0xeed4('0x50')][_0xeed4('0x52')],'action':_0x171234[_0xeed4('0x50')]['action'],'actionIncomplete':_0x171234[_0xeed4('0x50')][_0xeed4('0x53')],'speech':_0x171234['result'][_0xeed4('0x54')][_0xeed4('0x55')],'score':_0x171234[_0xeed4('0x50')][_0xeed4('0x56')],'statusCode':_0x171234[_0xeed4('0x57')][_0xeed4('0x58')],'endConversation':_0x171234[_0xeed4('0x50')]['metadata'][_0xeed4('0x59')]||![],'isFallbackIntent':_0x171234['result']['metadata']['isFallbackIntent']};});};exports[_0xeed4('0x5a')]=function(_0x2e4e38,_0x50d2dd,_0x500a01,_0x44fe1c){return tilde[_0xeed4('0x42')](_0x2e4e38,_0x50d2dd,_0x500a01,_0x44fe1c)[_0xeed4('0x2d')](function(_0x40e060){try{fs[_0xeed4('0x2e')](_0x2e4e38);}catch(_0x4f1c30){logger[_0xeed4('0x14')](_0x4f1c30);}logger[_0xeed4('0x26')]('Tilde\x20ASR\x20transcription',_0x40e060[_0xeed4('0x5b')]);logger[_0xeed4('0x26')](_0xeed4('0x5c'),_0x40e060[_0xeed4('0x47')]);return _0x40e060;});};exports[_0xeed4('0x5d')]=function(_0x2f89a7,_0x7da1dd,_0x5c4b77,_0x3ba8f4,_0x1badb7,_0x3a45c1){var _0x2c4101=path['resolve'](__dirname,_0xeed4('0x28'),rs[_0xeed4('0x29')](0x4)+_0xeed4('0x39'));var _0x4b896a;return aws[_0xeed4('0x5e')](_0x2f89a7,_0x7da1dd,_0x5c4b77,_0x3ba8f4,_0x1badb7,_0x3a45c1,_0x2c4101)['then'](function(){_0x4b896a=path[_0xeed4('0x27')](__dirname,'tmp',rs[_0xeed4('0x29')](0x4)+_0xeed4('0x2a'));return convertFile(_0x2c4101,_0x4b896a);})[_0xeed4('0x2d')](function(){try{fs['unlink'](_0x2c4101);fs[_0xeed4('0x2f')](_0x4b896a,'777');}catch(_0x427de8){logger[_0xeed4('0x14')](_0x427de8);}return _0x4b896a[_0xeed4('0x30')]('.')[0x0];});};exports[_0xeed4('0x5f')]=function(_0x5efc06,_0x526488,_0x169adc,_0x36e64a,_0x4ed782,_0xb51a27){return aws[_0xeed4('0x60')](_0x5efc06,_0x526488,_0x169adc,_0x36e64a,_0x4ed782,_0xb51a27)[_0xeed4('0x2d')](function(_0x3a2d2a){logger[_0xeed4('0x26')](JSON[_0xeed4('0x4f')](_0x3a2d2a));return _0x3a2d2a;});};exports[_0xeed4('0x61')]=function(_0x97bbfe,_0x378a76,_0xce3b55,_0x84b0e4){var _0x51fab3=util['format'](_0xeed4('0x62'),ISPEECH_API,_0x97bbfe,encodeURIComponent(_0x378a76),_0xce3b55,_0x84b0e4);var _0x58072b=path[_0xeed4('0x27')](__dirname,_0xeed4('0x28'),rs[_0xeed4('0x29')](0x4)+'.mp3');var _0x9c5311;return downloadFile(_0x51fab3,_0x58072b)['then'](function(){_0x9c5311=path[_0xeed4('0x27')](__dirname,'tmp',rs[_0xeed4('0x29')](0x4)+_0xeed4('0x2a'));return convertFile(_0x58072b,_0x9c5311);})[_0xeed4('0x2d')](function(){try{fs['unlink'](_0x58072b);fs[_0xeed4('0x2f')](_0x9c5311,'777');}catch(_0x1dd444){logger['error'](_0x1dd444);}return _0x9c5311[_0xeed4('0x30')]('.')[0x0];});};exports[_0xeed4('0x63')]=function(_0x22c9a0,_0xd991fd,_0x2db749,_0x42f2e6){var _0x5e1a20=util[_0xeed4('0x64')](_0xeed4('0x65'),ISPEECH_API,_0xd991fd,_0x2db749,base64Encode(_0x22c9a0),_0x42f2e6?util[_0xeed4('0x64')](_0xeed4('0x66'),encodeURIComponent(_0x42f2e6)):_0xeed4('0x67'));return uploadFile(_0x5e1a20)[_0xeed4('0x2d')](function(_0x1a9178){return querystring[_0xeed4('0x4')](_0x1a9178);});};exports['sestekNDA']=function(_0x4c44dd,_0x1be25d){return sestek['nda'](_0x4c44dd,_0x1be25d)[_0xeed4('0x2d')](function(_0xd301bd){logger[_0xeed4('0x26')](JSON[_0xeed4('0x4f')](_0xd301bd));var _0x5dbf50={'speech':_0xd301bd[_0xeed4('0x68')],'action':_0xd301bd[_0xeed4('0x69')]?_0xd301bd[_0xeed4('0x69')][_0xeed4('0x6a')]:undefined,'actiondata':_0xd301bd[_0xeed4('0x69')]?_0xd301bd[_0xeed4('0x69')]['CustomActionData']:undefined};if(_0xd301bd['channelData']&&_0xd301bd[_0xeed4('0x69')]['AudioFromTts']){return base64Decode(_0xd301bd['channelData']['AudioFromTts'][_0xeed4('0x6b')],path[_0xeed4('0x27')](__dirname,_0xeed4('0x28'),rs[_0xeed4('0x29')](0x4)+_0xeed4('0x2a')))[_0xeed4('0x2d')](function(_0x4fc6c7){_0x5dbf50[_0xeed4('0x6c')]=_0x4fc6c7;return _0x5dbf50;});}return _0x5dbf50;});};exports[_0xeed4('0x6d')]=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 391f69e..932dd7e 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 _0x2e56=['exports','./nda'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x2e56,0x109));var _0x62e5=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0x2e56[_0x8fa4bc];return _0x35b6a7;};var nda=require(_0x62e5('0x0'));module[_0x62e5('0x1')]={'nda':nda}; \ No newline at end of file +var _0x16bc=['exports','./nda'];(function(_0x97c7ff,_0x6477b5){var _0xbd1d6b=function(_0x40a8ad){while(--_0x40a8ad){_0x97c7ff['push'](_0x97c7ff['shift']());}};_0xbd1d6b(++_0x6477b5);}(_0x16bc,0x169));var _0xc16b=function(_0x49923f,_0x671404){_0x49923f=_0x49923f-0x0;var _0x560684=_0x16bc[_0x49923f];return _0x560684;};var nda=require(_0xc16b('0x0'));module[_0xc16b('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 641e349..52d922a 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 _0x8c00=['AudioOutputSettings','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','ndagenerate_audio','channelData'];(function(_0x412a3b,_0x3375c5){var _0x341fc6=function(_0x2062c0){while(--_0x2062c0){_0x412a3b['push'](_0x412a3b['shift']());}};_0x341fc6(++_0x3375c5);}(_0x8c00,0x65));var _0x08c0=function(_0x5876ad,_0x2150c0){_0x5876ad=_0x5876ad-0x0;var _0x4d46f7=_0x8c00[_0x5876ad];return _0x4d46f7;};'use strict';var rp=require(_0x08c0('0x0'));var url=require(_0x08c0('0x1'));var logger=require(_0x08c0('0x2'))(_0x08c0('0x3'));module[_0x08c0('0x4')]=function(_0x22c51e,_0x82e389){var _0x2e91fb={'method':_0x08c0('0x5'),'uri':url[_0x08c0('0x6')](_0x82e389[_0x08c0('0x7')],'/token'),'form':{'grant_type':'password','username':_0x82e389[_0x08c0('0x8')],'password':_0x82e389[_0x08c0('0x9')]},'json':!![]};return rp(_0x2e91fb)[_0x08c0('0xa')](function(_0x433e69){var _0x4e8865={'method':'POST','uri':url[_0x08c0('0x6')](_0x82e389[_0x08c0('0xb')],_0x08c0('0xc')),'body':{'type':_0x82e389[_0x08c0('0xd')]||_0x08c0('0xe'),'channelId':_0x08c0('0xf'),'conversation':{'id':_0x22c51e[_0x08c0('0x10')]},'from':{'id':_0x22c51e[_0x08c0('0x11')],'name':_0x22c51e[_0x08c0('0x12')]},'recipient':{'id':_0x22c51e[_0x08c0('0x13')],'name':_0x22c51e[_0x08c0('0x14')]},'text':_0x82e389[_0x08c0('0x15')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x433e69[_0x08c0('0x16')]},'json':!![]};if(_0x82e389[_0x08c0('0x17')]){_0x4e8865[_0x08c0('0x18')]['channelData']['ProjectName']=_0x82e389[_0x08c0('0x17')];}if(_0x82e389[_0x08c0('0x19')]=='1'){_0x4e8865['body'][_0x08c0('0x1a')][_0x08c0('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x82e389[_0x08c0('0x1c')]){_0x4e8865[_0x08c0('0x18')]['channelData']['CustomAction']=_0x82e389[_0x08c0('0x1c')];if(_0x82e389[_0x08c0('0x1d')]){_0x4e8865[_0x08c0('0x18')][_0x08c0('0x1a')]['CustomActionData']=_0x82e389[_0x08c0('0x1d')];}}logger[_0x08c0('0x1e')](JSON[_0x08c0('0x1f')](_0x4e8865));return rp(_0x4e8865);});}; \ No newline at end of file +var _0xd6ff=['uniqueid','callerid','calleridname','extension','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','body','CustomAction','custom_action','custom_action_data','CustomActionData','url','../../../../../config/logger','agi','exports','POST','resolve','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda'];(function(_0x286592,_0x389a34){var _0x348607=function(_0x3972fa){while(--_0x3972fa){_0x286592['push'](_0x286592['shift']());}};_0x348607(++_0x389a34);}(_0xd6ff,0x8d));var _0xfd6f=function(_0x432458,_0x850c8c){_0x432458=_0x432458-0x0;var _0x31cbea=_0xd6ff[_0x432458];return _0x31cbea;};'use strict';var rp=require('request-promise');var url=require(_0xfd6f('0x0'));var logger=require(_0xfd6f('0x1'))(_0xfd6f('0x2'));module[_0xfd6f('0x3')]=function(_0x20da9a,_0x341444){var _0x3b6edb={'method':_0xfd6f('0x4'),'uri':url[_0xfd6f('0x5')](_0x341444['ndauth_url'],_0xfd6f('0x6')),'form':{'grant_type':'password','username':_0x341444['username'],'password':_0x341444[_0xfd6f('0x7')]},'json':!![]};return rp(_0x3b6edb)[_0xfd6f('0x8')](function(_0x10cad2){var _0x242a83={'method':'POST','uri':url[_0xfd6f('0x5')](_0x341444[_0xfd6f('0x9')],_0xfd6f('0xa')),'body':{'type':_0x341444[_0xfd6f('0xb')]||_0xfd6f('0xc'),'channelId':_0xfd6f('0xd'),'conversation':{'id':_0x20da9a[_0xfd6f('0xe')]},'from':{'id':_0x20da9a[_0xfd6f('0xf')],'name':_0x20da9a[_0xfd6f('0x10')]},'recipient':{'id':_0x20da9a['dnid'],'name':_0x20da9a[_0xfd6f('0x11')]},'text':_0x341444['text'],'channelData':{}},'headers':{'Authorization':_0xfd6f('0x12')+_0x10cad2[_0xfd6f('0x13')]},'json':!![]};if(_0x341444[_0xfd6f('0x14')]){_0x242a83['body'][_0xfd6f('0x15')][_0xfd6f('0x16')]=_0x341444[_0xfd6f('0x14')];}if(_0x341444[_0xfd6f('0x17')]=='1'){_0x242a83['body'][_0xfd6f('0x15')][_0xfd6f('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xfd6f('0x19')};}if(_0x341444['custom_action']){_0x242a83[_0xfd6f('0x1a')][_0xfd6f('0x15')][_0xfd6f('0x1b')]=_0x341444[_0xfd6f('0x1c')];if(_0x341444[_0xfd6f('0x1d')]){_0x242a83[_0xfd6f('0x1a')][_0xfd6f('0x15')][_0xfd6f('0x1e')]=_0x341444['custom_action_data'];}}logger['info'](JSON['stringify'](_0x242a83));return rp(_0x242a83);});}; \ 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 77389e2..8a13d58 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 _0xbede=['./lib/api','exports'];(function(_0x328d36,_0x2a4efa){var _0x28c729=function(_0xa430cf){while(--_0xa430cf){_0x328d36['push'](_0x328d36['shift']());}};_0x28c729(++_0x2a4efa);}(_0xbede,0xe2));var _0xebed=function(_0x3aecf2,_0xba7da4){_0x3aecf2=_0x3aecf2-0x0;var _0x4761f7=_0xbede[_0x3aecf2];return _0x4761f7;};'use strict';var asr=require(_0xebed('0x0'));module[_0xebed('0x1')]=function(_0x46dde3,_0x1dd72c,_0x50f199,_0x3e62fc){return asr(_0x46dde3,_0x1dd72c,_0x50f199,_0x3e62fc);}; \ No newline at end of file +var _0xe649=['exports','./lib/api'];(function(_0x156de8,_0x3bbf5d){var _0x1b0bcc=function(_0x2be6ae){while(--_0x2be6ae){_0x156de8['push'](_0x156de8['shift']());}};_0x1b0bcc(++_0x3bbf5d);}(_0xe649,0x14b));var _0x9e64=function(_0x495a9e,_0x2df3f2){_0x495a9e=_0x495a9e-0x0;var _0x536eb6=_0xe649[_0x495a9e];return _0x536eb6;};'use strict';var asr=require(_0x9e64('0x0'));module[_0x9e64('0x1')]=function(_0xee8a2e,_0x46355b,_0x58ab7c,_0x17a79b){return asr(_0xee8a2e,_0x46355b,_0x58ab7c,_0x17a79b);}; \ 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 629eac7..a32704c 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 _0x46b3=['likelihood','Success.','terminate','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','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','hypotheses'];(function(_0x2d0982,_0xca09c5){var _0x577d6a=function(_0x2ae064){while(--_0x2ae064){_0x2d0982['push'](_0x2d0982['shift']());}};_0x577d6a(++_0xca09c5);}(_0x46b3,0xb0));var _0x346b=function(_0x51bc34,_0x3a499b){_0x51bc34=_0x51bc34-0x0;var _0x17e97e=_0x46b3[_0x51bc34];return _0x17e97e;};'use strict';var BPromise=require(_0x346b('0x0'));var _=require(_0x346b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x346b('0x2'));var crypto=require(_0x346b('0x3'));var logger=require(_0x346b('0x4'))(_0x346b('0x5'));module[_0x346b('0x6')]=function(_0x368c1b,_0x5b5ca7,_0x1bcdc2,_0x130834){return new BPromise(function(_0x139a98,_0x483ba9){logger['info'](_0x346b('0x7'),_0x130834||_0x346b('0x8'));var _0x264ad5=new WebSocket(_0x130834||_0x346b('0x8'),{'perMessageDeflate':![]});var _0xbba583='';var _0x330c50='0';var _0x47cff7='1';var _0x5b6f05=_0x346b('0x9');function _0x54afb4(_0x32e0d9){var _0x3d099c=crypto[_0x346b('0xa')](_0x346b('0xb'));_0x3d099c[_0x346b('0xc')](_0x32e0d9);return _0x3d099c[_0x346b('0xd')]('hex');}function _0x206564(){try{logger[_0x346b('0xe')](_0x346b('0xf'));var _0x13e21c=moment()[_0x346b('0x10')]();var _0x3103bd=_0x54afb4(_0x13e21c+_0x5b5ca7+_0x1bcdc2);_0x264ad5[_0x346b('0x11')](JSON[_0x346b('0x12')]({'appID':_0x5b5ca7,'timestamp':_0x13e21c,'appKey':_0x3103bd}));var _0x2a8aa2=fs[_0x346b('0x13')](_0x368c1b);_0x2a8aa2['on'](_0x346b('0x14'),function(_0xfd1e31){_0x264ad5[_0x346b('0x11')](_0xfd1e31);});_0x2a8aa2['on']('close',function(){_0x264ad5[_0x346b('0x11')](_0x346b('0x15'));});}catch(_0x10bcde){logger[_0x346b('0x16')](_0x346b('0x17'),JSON[_0x346b('0x12')](_0x10bcde));_0x264ad5['terminate']();}}function _0x399988(_0x30bf8a){try{if(_0x30bf8a){var _0xd4fabe=JSON[_0x346b('0x18')](_0x30bf8a);switch(_0xd4fabe[_0x346b('0x19')]){case 0x0:if(_0xd4fabe[_0x346b('0x1a')]){if(_0xd4fabe[_0x346b('0x1a')][_0x346b('0x1b')]){logger[_0x346b('0xe')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0xd4fabe['result'][_0x346b('0x1c')]));_0xbba583=_0xd4fabe[_0x346b('0x1a')][_0x346b('0x1c')][0x0]['transcript'];_0x330c50=_0xd4fabe[_0x346b('0x1a')][_0x346b('0x1c')][0x0][_0x346b('0x1d')];_0x47cff7='0';_0x5b6f05=_0x346b('0x1e');_0x264ad5[_0x346b('0x1f')]();}}break;case 0x1:logger[_0x346b('0xe')](_0x346b('0x9'));_0x47cff7='1';_0x5b6f05='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x346b('0xe')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x47cff7='2';_0x5b6f05='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x346b('0xe')](_0x346b('0x20'));_0x47cff7='9';_0x5b6f05=_0x346b('0x20');break;case 0xa:logger['info'](_0x346b('0x21'));_0x47cff7='10';_0x5b6f05=_0x346b('0x21');break;case 0xb:logger[_0x346b('0xe')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x47cff7='11';_0x5b6f05=_0x346b('0x22');}}}catch(_0x4407f2){logger[_0x346b('0x16')](_0x346b('0x23'),JSON[_0x346b('0x12')](_0x4407f2));_0x264ad5[_0x346b('0x1f')]();}}function _0x39ee49(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x139a98({'transcript':_0xbba583,'confidence':_0x330c50,'status':_0x47cff7,'status_message':_0x5b6f05});}function _0x17f044(_0x4241fd){logger[_0x346b('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x346b('0x24')](_0x4241fd)){logger[_0x346b('0x16')](_[_0x346b('0x25')](_0x4241fd)?JSON[_0x346b('0x12')](_0x4241fd):_0x4241fd);}}_0x264ad5['on'](_0x346b('0x26'),_0x206564);_0x264ad5['on'](_0x346b('0x27'),_0x399988);_0x264ad5['on'](_0x346b('0x28'),_0x39ee49);_0x264ad5['on'](_0x346b('0x16'),_0x17f044);});}; \ No newline at end of file +var _0x393e=['bluebird','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','error','terminate','parse','status','Tilde\x20ASR\x20hypoteses','result','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','close'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x393e,0xe4));var _0xe393=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x393e[_0x2e4e19];return _0x9ba20b;};'use strict';var BPromise=require(_0xe393('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe393('0x1'));var crypto=require(_0xe393('0x2'));var logger=require(_0xe393('0x3'))(_0xe393('0x4'));module[_0xe393('0x5')]=function(_0x2341e7,_0x2968cb,_0x5ec082,_0x524341){return new BPromise(function(_0x255bc5,_0x17355c){logger['info'](_0xe393('0x6'),_0x524341||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x328ccf=new WebSocket(_0x524341||_0xe393('0x7'),{'perMessageDeflate':![]});var _0x3bc12c='';var _0x1d2f77='0';var _0x3d209f='1';var _0x11dde9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x355874(_0x441515){var _0x3b7a01=crypto[_0xe393('0x8')](_0xe393('0x9'));_0x3b7a01[_0xe393('0xa')](_0x441515);return _0x3b7a01[_0xe393('0xb')](_0xe393('0xc'));}function _0x530b4e(){try{logger[_0xe393('0xd')](_0xe393('0xe'));var _0x103acc=moment()['unix']();var _0x24d3d9=_0x355874(_0x103acc+_0x2968cb+_0x5ec082);_0x328ccf[_0xe393('0xf')](JSON[_0xe393('0x10')]({'appID':_0x2968cb,'timestamp':_0x103acc,'appKey':_0x24d3d9}));var _0x1c2543=fs[_0xe393('0x11')](_0x2341e7);_0x1c2543['on'](_0xe393('0x12'),function(_0x1a5bca){_0x328ccf[_0xe393('0xf')](_0x1a5bca);});_0x1c2543['on']('close',function(){_0x328ccf[_0xe393('0xf')]('EOS');});}catch(_0x4bc18e){logger[_0xe393('0x13')]('Tilde\x20ASR\x20send\x20error',JSON[_0xe393('0x10')](_0x4bc18e));_0x328ccf[_0xe393('0x14')]();}}function _0x2c3747(_0x1059f7){try{if(_0x1059f7){var _0x59db21=JSON[_0xe393('0x15')](_0x1059f7);switch(_0x59db21[_0xe393('0x16')]){case 0x0:if(_0x59db21['result']){if(_0x59db21['result']['final']){logger[_0xe393('0xd')](_0xe393('0x17'),JSON[_0xe393('0x10')](_0x59db21['result']['hypotheses']));_0x3bc12c=_0x59db21[_0xe393('0x18')]['hypotheses'][0x0][_0xe393('0x19')];_0x1d2f77=_0x59db21[_0xe393('0x18')]['hypotheses'][0x0]['likelihood'];_0x3d209f='0';_0x11dde9=_0xe393('0x1a');_0x328ccf[_0xe393('0x14')]();}}break;case 0x1:logger[_0xe393('0xd')](_0xe393('0x1b'));_0x3d209f='1';_0x11dde9=_0xe393('0x1b');break;case 0x2:logger[_0xe393('0xd')](_0xe393('0x1c'));_0x3d209f='2';_0x11dde9=_0xe393('0x1c');break;case 0x9:logger[_0xe393('0xd')](_0xe393('0x1d'));_0x3d209f='9';_0x11dde9=_0xe393('0x1d');break;case 0xa:logger[_0xe393('0xd')](_0xe393('0x1e'));_0x3d209f='10';_0x11dde9=_0xe393('0x1e');break;case 0xb:logger[_0xe393('0xd')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3d209f='11';_0x11dde9=_0xe393('0x1f');}}}catch(_0x396ab4){logger[_0xe393('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xe393('0x10')](_0x396ab4));_0x328ccf[_0xe393('0x14')]();}}function _0xed2916(){logger[_0xe393('0xd')](_0xe393('0x20'));_0x255bc5({'transcript':_0x3bc12c,'confidence':_0x1d2f77,'status':_0x3d209f,'status_message':_0x11dde9});}function _0x1de1a5(_0x14b398){logger[_0xe393('0x13')](_0xe393('0x21'));if(!_[_0xe393('0x22')](_0x14b398)){logger[_0xe393('0x13')](_['isObject'](_0x14b398)?JSON[_0xe393('0x10')](_0x14b398):_0x14b398);}}_0x328ccf['on'](_0xe393('0x23'),_0x530b4e);_0x328ccf['on'](_0xe393('0x24'),_0x2c3747);_0x328ccf['on'](_0xe393('0x25'),_0xed2916);_0x328ccf['on'](_0xe393('0x13'),_0x1de1a5);});}; \ 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 133c69a..f99b54c 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 _0x8276=['exports','./asr'];(function(_0x2c13d0,_0x3372b0){var _0x501970=function(_0x2c64d4){while(--_0x2c64d4){_0x2c13d0['push'](_0x2c13d0['shift']());}};_0x501970(++_0x3372b0);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};var asr=require(_0x6827('0x0'));module[_0x6827('0x1')]={'asr':asr}; \ No newline at end of file +var _0xa169=['./asr','exports'];(function(_0x426fcf,_0x5b7ca1){var _0x4780ce=function(_0x3de76c){while(--_0x3de76c){_0x426fcf['push'](_0x426fcf['shift']());}};_0x4780ce(++_0x5b7ca1);}(_0xa169,0xaa));var _0x9a16=function(_0x26c60e,_0x864ef2){_0x26c60e=_0x26c60e-0x0;var _0x47a563=_0xa169[_0x26c60e];return _0x47a563;};var asr=require(_0x9a16('0x0'));module[_0x9a16('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e33e662..d690d4d 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 _0x14ee=['createServer','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','exports','util','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x2a0c73,_0x22c623){var _0x260ff9=function(_0x260028){while(--_0x260028){_0x2a0c73['push'](_0x2a0c73['shift']());}};_0x260ff9(++_0x22c623);}(_0x14ee,0x115));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xe14e('0x0'));var net=require('net');var EventEmitter=require('events')[_0xe14e('0x1')];var AGIError=require(_0xe14e('0x2'));var AGIChannel=require(_0xe14e('0x3'));var AGIServer=function(_0xdff449,_0x244b80,_0x5db128){var _0x1c8074=this,_0xdff449=_0xdff449||0x11dd,_0x244b80=_0x244b80||_0xe14e('0x4'),_0x55d396=null,_0x4c78d1=0x0;EventEmitter[_0xe14e('0x5')](_0x1c8074);function _0x29b76d(){if(!_0xdff449){_0x1c8074[_0xe14e('0x6')](_0xe14e('0x7'),new AGIError(_0xe14e('0x8')));return![];}_0x55d396=net[_0xe14e('0x9')]();_0x55d396[_0xe14e('0xa')](_0xdff449,_0x244b80);_0x55d396['on'](_0xe14e('0xb'),function(){_0x1c8074[_0xe14e('0x6')](_0xe14e('0xb'));});_0x55d396['on'](_0xe14e('0xc'),function(_0x352f07){_0x55d396[_0xe14e('0xd')](function(_0x2a524b,_0x52bfda){if(_0x2a524b){_0x1c8074[_0xe14e('0x6')](_0xe14e('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x2a524b));}else if(_0x5db128&&_0x5db128<0x0){_0x1c8074[_0xe14e('0x6')]('error',new AGIError(_0xe14e('0xe')));_0x352f07[_0xe14e('0xf')]();}else if(_0x5db128&&_0x5db128>0x0&&_0x5db128<_0x52bfda){_0x4c78d1+=0x1;_0x1c8074[_0xe14e('0x6')](_0xe14e('0x7'),new AGIError(_0xe14e('0x10'),_0x4c78d1));_0x352f07[_0xe14e('0xf')]();}else{var _0x3a4eff=new AGIChannel(_0x352f07);_0x3a4eff['on']('ready',function(){_0x1c8074[_0xe14e('0x6')](_0xe14e('0xc'),_0x3a4eff);});}});});_0x55d396['on']('error',function(_0x3fb880){_0x1c8074[_0xe14e('0x6')](_0xe14e('0x7'),new AGIError(_0xe14e('0x11'),_0x3fb880[_0xe14e('0x12')]));});_0x55d396['on'](_0xe14e('0x13'),function(){_0x1c8074[_0xe14e('0x6')](_0xe14e('0x13'),new AGIError(_0xe14e('0x14')));});}process['nextTick'](function(){_0x29b76d();});};util['inherits'](AGIServer,EventEmitter);module[_0xe14e('0x15')]=function(_0x964c9d,_0x4c5099,_0x146b33){return new AGIServer(_0x964c9d,_0x4c5099,_0x146b33);}; \ No newline at end of file +var _0xcb18=['destroy','ready','close','nextTick','inherits','events','./error','127.0.0.1','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED'];(function(_0x52d39d,_0x2b4c80){var _0x1c0504=function(_0x2b3262){while(--_0x2b3262){_0x52d39d['push'](_0x52d39d['shift']());}};_0x1c0504(++_0x2b4c80);}(_0xcb18,0x159));var _0x8cb1=function(_0x14b0f0,_0x429b77){_0x14b0f0=_0x14b0f0-0x0;var _0x1bb17a=_0xcb18[_0x14b0f0];return _0x1bb17a;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x8cb1('0x0'))['EventEmitter'];var AGIError=require(_0x8cb1('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x5e800d,_0x39e801,_0x87b1d3){var _0x15d761=this,_0x5e800d=_0x5e800d||0x11dd,_0x39e801=_0x39e801||_0x8cb1('0x2'),_0x503927=null,_0x355d91=0x0;EventEmitter['call'](_0x15d761);function _0x186f71(){if(!_0x5e800d){_0x15d761['emit'](_0x8cb1('0x3'),new AGIError(_0x8cb1('0x4')));return![];}_0x503927=net['createServer']();_0x503927[_0x8cb1('0x5')](_0x5e800d,_0x39e801);_0x503927['on'](_0x8cb1('0x6'),function(){_0x15d761[_0x8cb1('0x7')](_0x8cb1('0x6'));});_0x503927['on'](_0x8cb1('0x8'),function(_0x59c728){_0x503927[_0x8cb1('0x9')](function(_0x19f26a,_0x42b5be){if(_0x19f26a){_0x15d761['emit'](_0x8cb1('0x3'),new AGIError(_0x8cb1('0xa'),_0x19f26a));}else if(_0x87b1d3&&_0x87b1d3<0x0){_0x15d761[_0x8cb1('0x7')](_0x8cb1('0x3'),new AGIError(_0x8cb1('0xb')));_0x59c728[_0x8cb1('0xc')]();}else if(_0x87b1d3&&_0x87b1d3>0x0&&_0x87b1d3<_0x42b5be){_0x355d91+=0x1;_0x15d761['emit'](_0x8cb1('0x3'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x355d91));_0x59c728[_0x8cb1('0xc')]();}else{var _0x2fe7a3=new AGIChannel(_0x59c728);_0x2fe7a3['on'](_0x8cb1('0xd'),function(){_0x15d761[_0x8cb1('0x7')](_0x8cb1('0x8'),_0x2fe7a3);});}});});_0x503927['on'](_0x8cb1('0x3'),function(_0x576470){_0x15d761[_0x8cb1('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x576470['code']));});_0x503927['on'](_0x8cb1('0xe'),function(){_0x15d761[_0x8cb1('0x7')](_0x8cb1('0xe'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x8cb1('0xf')](function(){_0x186f71();});};util[_0x8cb1('0x10')](AGIServer,EventEmitter);module['exports']=function(_0x57f55c,_0x560b29,_0x2ecfe5){return new AGIServer(_0x57f55c,_0x560b29,_0x2ecfe5);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index bb63764..9d283df 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 _0xcb91=['odbc','randomstring','mustache','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1','callerid','createSquareRecording','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','timeout','number','POST','PUT','method','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','headers','body','stringify','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','agicommand','hasOwnProperty','isString','recursiveNodeIndex','replaceAllVariables','saveRestApiResult','isPlainObject','setVariable','split','length','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','label','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','noop','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','googleDialogflow','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','DIAL','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','test','mindigit','maxdigit','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','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','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s.%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','TILDE_ASR_%s','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','failure','math','operation','math\x20%s','%s[%s]','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','%s/recordings/%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','user','bcc','service','host','port','authentication','auth','pass','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','127.0.0.1','system','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','replaceAll','exports','lodash','shelljs'];(function(_0x19fbb3,_0x4c85af){var _0xb03723=function(_0xb47c5f){while(--_0xb47c5f){_0x19fbb3['push'](_0x19fbb3['shift']());}};_0xb03723(++_0x4c85af);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xcb91[_0x10d34b];return _0x92b0bf;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x1cb9('0x0'));var sh=require(_0x1cb9('0x1'));var odbc=require(_0x1cb9('0x2'))();var rs=require(_0x1cb9('0x3'));var moment=require('moment');var Mustache=require(_0x1cb9('0x4'));var rp=require(_0x1cb9('0x5'));var logger=require('../../config/logger')(_0x1cb9('0x6'));var config=require(_0x1cb9('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x1cb9('0x8');var recursiveMapAttributes=[_0x1cb9('0x9'),'rawBody'];var verticesWithRetry=[_0x1cb9('0xa'),_0x1cb9('0xb'),'getsecretdigits'];var AGIVertices=function(_0x3ae0f1,_0x5a0e99,_0x567139){this[_0x1cb9('0xc')]=_0x3ae0f1;this[_0x1cb9('0xd')]=_0x5a0e99;this[_0x1cb9('0xe')]=_0x567139;};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x10')]=function(_0x50ce71,_0x9b58f1){this[_0x1cb9('0xd')][_0x1cb9('0x11')](_0x50ce71)[_0x1cb9('0x12')](function(_0x46af58){_0x9b58f1(null,_0x46af58?_0x46af58['name']:![]);})['catch'](function(_0x59dec3){_0x9b58f1(_0x59dec3);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x13')]=function(_0x384496,_0x1c714f){this['rpc'][_0x1cb9('0x14')](_0x384496)[_0x1cb9('0x12')](function(_0x1b3cd7){_0x1c714f(null,_0x1b3cd7?_0x1b3cd7[_0x1cb9('0x15')]:![]);})[_0x1cb9('0x16')](function(_0x5806d8){_0x1c714f(_0x5806d8);});};AGIVertices['prototype'][_0x1cb9('0x17')]=function(_0x3cc765,_0x3904b7){this[_0x1cb9('0xd')][_0x1cb9('0x18')](_0x3cc765)[_0x1cb9('0x12')](function(_0x23d3a9){_0x3904b7(null,_0x23d3a9?_0x23d3a9['name']:![]);})['catch'](function(_0x1b2fa6){_0x3904b7(_0x1b2fa6);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x19')]=function(_0x31481a,_0x280a84){this[_0x1cb9('0xd')][_0x1cb9('0x1a')](_0x31481a)['then'](function(_0x559bcc){_0x280a84(null,_0x559bcc?_0x559bcc[_0x1cb9('0x1b')]:![]);})['catch'](function(_0x4750b1){_0x280a84(_0x4750b1);});};AGIVertices[_0x1cb9('0xf')]['getUser']=function(_0x599275,_0x2e3854){this[_0x1cb9('0xd')][_0x1cb9('0x1c')](_0x599275)[_0x1cb9('0x12')](function(_0x45b8d3){_0x2e3854(null,_0x45b8d3?_0x45b8d3[_0x1cb9('0x15')]:![]);})['catch'](function(_0x55b232){_0x2e3854(_0x55b232);});};AGIVertices[_0x1cb9('0xf')]['getTrunk']=function(_0x10a419,_0x2b1275){this[_0x1cb9('0xd')][_0x1cb9('0x1d')](_0x10a419)[_0x1cb9('0x12')](function(_0x53f9fa){_0x2b1275(null,_0x53f9fa?_0x53f9fa[_0x1cb9('0x15')]:![]);})[_0x1cb9('0x16')](function(_0x4c8d76){_0x2b1275(_0x4c8d76);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x1e')]=function(_0x41a9a0,_0x1804fd){var _0x406821=this;this[_0x1cb9('0xd')][_0x1cb9('0x1f')](_0x41a9a0)[_0x1cb9('0x12')](function(_0x41e5c2){_0x1804fd(null,_0x41e5c2?_0x406821[_0x1cb9('0x20')](_0x41e5c2['save_name']):![]);})[_0x1cb9('0x16')](function(_0x536635){_0x1804fd(_0x536635);});};AGIVertices[_0x1cb9('0xf')]['getMailAccount']=function(_0x278327,_0x41011c){this[_0x1cb9('0xd')][_0x1cb9('0x21')](_0x278327)['then'](function(_0x1c701f){_0x41011c(null,_0x1c701f?_0x1c701f:![]);})['catch'](function(_0xe0a0e2){_0x41011c(_0xe0a0e2);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x22')]=function(_0x5d8793,_0xae4c7a,_0x5e84fd){this[_0x1cb9('0xe')]['sendMailMessage'](_0x5d8793,_0xae4c7a)[_0x1cb9('0x12')](function(){_0x5e84fd(null);})[_0x1cb9('0x16')](function(_0x3a2c60){_0x5e84fd(_0x3a2c60);});};AGIVertices[_0x1cb9('0xf')]['getIntervals']=function(_0x2114a4,_0xf71b9a){this[_0x1cb9('0xd')][_0x1cb9('0x23')](_0x2114a4)[_0x1cb9('0x12')](function(_0x2794fa){if(_0x2794fa){if(_0x2794fa[_0x1cb9('0x24')]){_0xf71b9a(null,[_0x2794fa[_0x1cb9('0x25')]]);}else{_0xf71b9a(null,_[_0x1cb9('0x26')](_0x2794fa[_0x1cb9('0x27')],_0x1cb9('0x25')));}}else{_0xf71b9a(null,![]);}})[_0x1cb9('0x16')](function(_0x29f149){_0xf71b9a(_0x29f149);});};AGIVertices['prototype']['getSoundPath']=function(_0x299ff8){return util[_0x1cb9('0x28')](_0x1cb9('0x29'),FILES_PATH,_0x299ff8);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x2a')]=function(_0x3a06e6,_0x35f5e8,_0x3f5637){odbc['open'](_0x3a06e6,function(_0x2aa59b){if(_0x2aa59b){logger[_0x1cb9('0x2b')](_0x1cb9('0x2c'),_0x2aa59b);_0x3f5637(_0x2aa59b);}else{logger['info'](_0x1cb9('0x2d'));odbc['query'](_0x35f5e8,function(_0x313e34,_0x5701a3){if(_0x313e34){logger[_0x1cb9('0x2e')](_0x1cb9('0x2f'),_0x35f5e8);_0x3f5637(_0x313e34);}else{logger[_0x1cb9('0x2e')](_0x1cb9('0x30'),_0x35f5e8);odbc[_0x1cb9('0x31')](function(_0x291802){if(_0x291802){logger[_0x1cb9('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x291802);}_0x3f5637(null,_0x5701a3);});}});}});};AGIVertices['prototype'][_0x1cb9('0x32')]=function(_0x1d2723,_0x7a0d8b){this[_0x1cb9('0xd')][_0x1cb9('0x33')](_0x1d2723)[_0x1cb9('0x12')](function(_0x32130b){_0x7a0d8b(null,_0x32130b?_0x32130b:![]);})['catch'](function(_0xbcaa32){_0x7a0d8b(_0xbcaa32);});};AGIVertices['prototype']['createSmsMessage']=function(_0x4c6c75,_0x409c62){this[_0x1cb9('0xd')][_0x1cb9('0x34')](_0x4c6c75)[_0x1cb9('0x12')](function(_0x2817e9){_0x409c62(null,_0x2817e9);})['catch'](function(_0x2a624f){_0x409c62(_0x2a624f);});};AGIVertices['prototype'][_0x1cb9('0x35')]=function(_0x71db9d,_0x38d973,_0x5efd83){this[_0x1cb9('0xd')]['createSquareDetailsReport']({'uniqueid':this[_0x1cb9('0xc')][_0x1cb9('0x36')],'node':_0x71db9d['label'],'application':_0x71db9d['agicommand'],'data':_0x38d973||null,'project_name':this[_0x1cb9('0xc')][_0x1cb9('0x37')],'callerid':this[_0x1cb9('0xc')][_0x1cb9('0x38')]})[_0x1cb9('0x12')](function(_0x58832e){if(_0x5efd83){_0x5efd83(null,_0x58832e);}})[_0x1cb9('0x16')](function(_0x5594fc){if(_0x5efd83){_0x5efd83(_0x5594fc);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x398d04,_0x242ec4,_0x7405ac,_0x11cea5){this[_0x1cb9('0xd')][_0x1cb9('0x39')]({'uniqueid':this[_0x1cb9('0xc')][_0x1cb9('0x36')],'callerid':this[_0x1cb9('0xc')][_0x1cb9('0x38')],'calleridname':this[_0x1cb9('0xc')]['calleridname'],'context':this[_0x1cb9('0xc')][_0x1cb9('0x3a')],'extension':this[_0x1cb9('0xc')]['extension'],'priority':this[_0x1cb9('0xc')][_0x1cb9('0x3b')],'accountcode':this[_0x1cb9('0xc')][_0x1cb9('0x3c')],'dnid':this[_0x1cb9('0xc')]['dnid'],'projectName':this[_0x1cb9('0xc')]['arg_1'],'saveName':_0x242ec4,'filename':_0x398d04[_0x1cb9('0x3d')]||_0x242ec4,'savePath':_0x7405ac})['then'](function(_0x1cf2ee){_0x11cea5(null,_0x1cf2ee);})[_0x1cb9('0x16')](function(_0x17f3e8){_0x11cea5(_0x17f3e8);});};AGIVertices[_0x1cb9('0xf')]['createSquareMessage']=function(_0x298475,_0x1149b9,_0x1b750d){this[_0x1cb9('0xd')][_0x1cb9('0x3e')]({'uniqueid':this[_0x1cb9('0xc')][_0x1cb9('0x36')],'body':_0x298475,'direction':_0x1149b9})[_0x1cb9('0x12')](function(_0xbb500e){if(_0x1b750d){_0x1b750d(null,_0xbb500e);}})[_0x1cb9('0x16')](function(_0x48dd4a){if(_0x1b750d){_0x1b750d(_0x48dd4a);}});};AGIVertices['prototype'][_0x1cb9('0x3f')]=function(_0x1b3cdf,_0x19e83a){this[_0x1cb9('0xd')][_0x1cb9('0x3f')]({'firstName':_[_0x1cb9('0x40')](_0x1b3cdf[_0x1cb9('0x15')])||_[_0x1cb9('0x41')](_0x1b3cdf[_0x1cb9('0x15')])?_0x1cb9('0x42')+Math['random']():_0x1b3cdf[_0x1cb9('0x15')],'lastName':_['isEmpty'](_0x1b3cdf[_0x1cb9('0x43')])||_['isNil'](_0x1b3cdf[_0x1cb9('0x43')])?null:_0x1b3cdf['lastName'],'phone':_0x1b3cdf['phone'],'ListId':_0x1b3cdf[_0x1cb9('0x44')],'scheduledAt':_0x1b3cdf[_0x1cb9('0x45')],'callbackUniqueid':this[_0x1cb9('0xc')]['uniqueid'],'tags':_0x1cb9('0x46'),'description':_0x1cb9('0x47')+_0x1b3cdf['scheduledAt']['toString'](),'priority':_0x1b3cdf[_0x1cb9('0x48')]})[_0x1cb9('0x12')](function(_0x3e70fc){_0x19e83a(null,_0x3e70fc);})[_0x1cb9('0x16')](function(_0x3de325){_0x19e83a(_0x3de325);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x49')]=function(_0x5912f9,_0x345ddd){this[_0x1cb9('0xd')][_0x1cb9('0x4a')](_0x5912f9)['then'](function(_0x183bd1){_0x345ddd(null,_0x183bd1?_0x183bd1[_0x1cb9('0x15')]:![]);})[_0x1cb9('0x16')](function(_0xf6eb2d){_0x345ddd(_0xf6eb2d);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x4b')]=function(_0x5ae762,_0x37ceb5,_0x36c40d){var _0x41e81f={'role':_0x1cb9('0x4c')};_0x41e81f[_0x5ae762]=this[_0x1cb9('0xc')][_0x1cb9('0x38')];this[_0x1cb9('0xd')][_0x1cb9('0x4b')](_0x41e81f,_0x37ceb5,this[_0x1cb9('0xc')][_0x1cb9('0x36')])[_0x1cb9('0x12')](function(_0x55fb51){_0x36c40d(null,_[_0x1cb9('0x41')](_0x55fb51)?![]:!![]);})[_0x1cb9('0x16')](function(_0xebc79f){logger[_0x1cb9('0x2b')](_0xebc79f);_0x36c40d(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x319358,_0x2f8f27){var _0x31eccc={'role':_0x1cb9('0x4c')};_0x31eccc[_0x319358]=this[_0x1cb9('0xc')][_0x1cb9('0x38')];this[_0x1cb9('0xd')][_0x1cb9('0x4d')](_0x31eccc)['then'](function(_0x49f74c){_0x2f8f27(null,_[_0x1cb9('0x41')](_0x49f74c)?![]:!![]);})['catch'](function(_0x5cefa3){logger['error'](_0x5cefa3);_0x2f8f27(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x455c40,_0x3de895){var _0xe21f20={'role':_0x1cb9('0x4c')};_0xe21f20[_0x455c40]=this[_0x1cb9('0xc')][_0x1cb9('0x38')];this['rpc'][_0x1cb9('0x4e')](_0xe21f20)[_0x1cb9('0x12')](function(_0x5a72c8){_0x3de895(null,_['isNil'](_0x5a72c8)?![]:!![]);})[_0x1cb9('0x16')](function(_0x7b3380){logger[_0x1cb9('0x2b')](_0x7b3380);_0x3de895(null,![]);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x4f')]=function(_0x51ce73,_0x538ff0){var _0x5eb0ad={'role':_0x1cb9('0x4c')};_0x5eb0ad[_0x51ce73]=this[_0x1cb9('0xc')][_0x1cb9('0x38')];var _0x2e83fe=_0x51ce73!=_0x1cb9('0x50')?util['format'](_0x1cb9('0x51'),_0x1cb9('0x52'),this['channel']['callerid']):undefined;this[_0x1cb9('0xd')]['agentLogin'](_0x5eb0ad,_0x2e83fe)[_0x1cb9('0x12')](function(_0x1f8461){_0x538ff0(null,_[_0x1cb9('0x41')](_0x1f8461)?![]:!![]);})[_0x1cb9('0x16')](function(_0x3619a2){logger[_0x1cb9('0x2b')](_0x3619a2);_0x538ff0(null,![]);});};AGIVertices['prototype'][_0x1cb9('0x53')]=function(_0x15fc04,_0x330fc1){sh[_0x1cb9('0x54')](_['trim'](_0x15fc04),function(_0x520d98,_0x20a825){var _0x457b76=_0x20a825[_0x1cb9('0x55')](/(\r\n|\n|\r)/gm,'');_0x330fc1(null,_0x457b76);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x56')]=function(_0x267a3c,_0x4f8756){scripts[_0x1cb9('0x56')](_0x267a3c['apiKey'],_0x267a3c[_0x1cb9('0x57')]||_0x1cb9('0x58'),_0x267a3c['text'],_0x267a3c[_0x1cb9('0x59')]||_0x1cb9('0x5a'),_0x267a3c[_0x1cb9('0x5b')]||'MALE',_0x267a3c[_0x1cb9('0x5c')]||_0x1cb9('0x5d'))[_0x1cb9('0x12')](function(_0x16c6cb){_0x4f8756(null,_0x16c6cb);})[_0x1cb9('0x16')](function(_0x25c5bc){_0x4f8756(_0x25c5bc);});};AGIVertices['prototype'][_0x1cb9('0x5e')]=function(_0x2c097b,_0x38d6a7){scripts[_0x1cb9('0x5e')](_0x2c097b[_0x1cb9('0x58')],_0x2c097b[_0x1cb9('0x5f')]||'en',0x1)[_0x1cb9('0x12')](function(_0x37bcd9){_0x38d6a7(null,_0x37bcd9);})['catch'](function(_0x28bac2){_0x38d6a7(_0x28bac2);});};AGIVertices[_0x1cb9('0xf')]['restAPI']=function(_0x15746e,_0x5415fa){var _0x3a0675={'uri':_0x15746e['url'],'method':_0x15746e['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x15746e[_0x1cb9('0x60')])===_0x1cb9('0x61')&&parseInt(_0x15746e['timeout'])>=0x1?parseInt(_0x15746e[_0x1cb9('0x60')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x1cb9('0x62'),_0x1cb9('0x63')],_0x3a0675[_0x1cb9('0x64')][_0x1cb9('0x65')]())){try{_0x3a0675['body']=_0x15746e[_0x1cb9('0x66')]?JSON[_0x1cb9('0x67')](_0x15746e[_0x1cb9('0x66')]):{};}catch(_0x27cc3c){logger[_0x1cb9('0x2b')](_0x1cb9('0x68'),_0x27cc3c);}}try{_0x3a0675['headers']=_0x15746e[_0x1cb9('0x9')]?JSON[_0x1cb9('0x67')](_0x15746e[_0x1cb9('0x9')]):{};}catch(_0xf3e2d4){logger[_0x1cb9('0x2b')](_0x1cb9('0x69'),_0xf3e2d4);}if(_0x15746e['computedVariables']){try{var _0x3db146=require(_0x15746e[_0x1cb9('0x6a')])['sync'](this,_0x3a0675);_0x3a0675[_0x1cb9('0x6b')]=Mustache[_0x1cb9('0x6c')](_0x15746e[_0x1cb9('0x6d')],_0x3db146,{},['$$','$$']);if(_0x3a0675[_0x1cb9('0x6e')]){_0x3a0675[_0x1cb9('0x6e')]=JSON[_0x1cb9('0x67')](Mustache[_0x1cb9('0x6c')](JSON['stringify'](_0x3a0675[_0x1cb9('0x6e')]),_0x3db146,{},['$$','$$']));}if(_0x3a0675['body']){_0x3a0675[_0x1cb9('0x6f')]=JSON[_0x1cb9('0x67')](Mustache['render'](JSON[_0x1cb9('0x70')](_0x3a0675[_0x1cb9('0x6f')]),_0x3db146,{},['$$','$$']));}}catch(_0x272b86){logger[_0x1cb9('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x272b86);}}rp(_0x3a0675)[_0x1cb9('0x12')](function(_0x39b0cb){var _0x429371={'statusCode':_0x39b0cb['statusCode']||0xc8,'statusMessage':_0x39b0cb[_0x1cb9('0x71')]||'OK','headers':_0x39b0cb[_0x1cb9('0x6e')]||{},'body':_0x39b0cb[_0x1cb9('0x6f')]||{}};_0x5415fa(null,_0x429371);})[_0x1cb9('0x16')](function(_0x10b508){var _0x1ea329={'statusCode':_0x10b508[_0x1cb9('0x72')]||0x1f4,'statusMessage':_0x10b508['message']||_0x1cb9('0x73'),'headers':_0x10b508['options'][_0x1cb9('0x6e')]||{},'body':_0x10b508[_0x1cb9('0x74')][_0x1cb9('0x6f')]||{}};_0x5415fa(null,_0x1ea329);});};AGIVertices[_0x1cb9('0xf')]['googleDialogflow']=function(_0x1ff5e9,_0x89d19b){scripts['googleDialogflow'](this[_0x1cb9('0xc')][_0x1cb9('0x36')],_0x1ff5e9[_0x1cb9('0x75')],_0x1ff5e9[_0x1cb9('0x58')],_0x1ff5e9[_0x1cb9('0x76')]||'en')['then'](function(_0x5e0e56){_0x89d19b(null,_0x5e0e56);})['catch'](function(_0x5ad853){_0x89d19b(_0x5ad853);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x77')]=function(_0xe99ac7,_0x42059d){scripts[_0x1cb9('0x77')](this[_0x1cb9('0xc')],_0xe99ac7)[_0x1cb9('0x12')](function(_0x24612b){_0x42059d(null,_0x24612b);})['catch'](function(_0xff5304){_0x42059d(_0xff5304);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x78')]=function(_0x5eff1e,_0x10977f){scripts[_0x1cb9('0x78')](_0x5eff1e['key'],_0x5eff1e[_0x1cb9('0x58')],_0x5eff1e[_0x1cb9('0x79')]||_0x1cb9('0x5a'),_0x5eff1e[_0x1cb9('0x7a')])['then'](function(_0x2c0416){_0x10977f(null,_0x2c0416);})[_0x1cb9('0x16')](function(_0x50d4ab){_0x10977f(_0x50d4ab);});};AGIVertices['prototype'][_0x1cb9('0x7b')]=function(_0x3ba0a5,_0x4deff1,_0x4e45f8){scripts[_0x1cb9('0x7b')](_0x4deff1,_0x3ba0a5[_0x1cb9('0x75')],_0x3ba0a5['ispeech_asr_language']||'en-US',this[_0x1cb9('0x7c')](_0x3ba0a5['model'])?_0x3ba0a5['model']:undefined)['then'](function(_0x1389c7){_0x4e45f8(null,_0x1389c7);})['catch'](function(_0x5a6970){_0x4e45f8(_0x5a6970);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x7d')]=function(_0x5011df,_0x2fcb20){scripts[_0x1cb9('0x7d')](_0x5011df[_0x1cb9('0x7e')],_0x5011df['aws_secret_access_key'],_0x5011df[_0x1cb9('0x7f')],_0x5011df[_0x1cb9('0x80')]||_0x1cb9('0x81'),_0x5011df[_0x1cb9('0x58')],_0x5011df[_0x1cb9('0x82')]||'text')[_0x1cb9('0x12')](function(_0x3a9cea){_0x2fcb20(null,_0x3a9cea);})[_0x1cb9('0x16')](function(_0x58e97a){_0x2fcb20(_0x58e97a);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x83')]=function(_0x534378,_0x229182){scripts[_0x1cb9('0x83')](this['channel'][_0x1cb9('0x36')],_0x534378[_0x1cb9('0x7e')],_0x534378[_0x1cb9('0x84')],_0x534378[_0x1cb9('0x85')],_0x534378[_0x1cb9('0x58')],_0x534378[_0x1cb9('0x86')])[_0x1cb9('0x12')](function(_0x36864c){_0x229182(null,_0x36864c);})[_0x1cb9('0x16')](function(_0x3134f8){_0x229182(_0x3134f8);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x87')]=function(_0x2f334c,_0x1b2b1c,_0x467d0b){scripts[_0x1cb9('0x87')](_0x1b2b1c,_0x2f334c[_0x1cb9('0x75')],_0x2f334c[_0x1cb9('0x88')]||'en-US')['then'](function(_0x13ba32){_0x467d0b(null,_0x13ba32);})[_0x1cb9('0x16')](function(_0x20af42){_0x467d0b(_0x20af42);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x89')]=function(_0x165789,_0xe93a08,_0x56251d){scripts['tildeASR'](_0xe93a08,_0x165789[_0x1cb9('0x8a')],_0x165789[_0x1cb9('0x8b')],_0x165789[_0x1cb9('0x6b')])[_0x1cb9('0x12')](function(_0xed8968){_0x56251d(null,_0xed8968);})['catch'](function(_0xacf226){_0x56251d(_0xacf226);});};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x8c')]=function(_0x55997d){var _0x36faa4=_[_0x1cb9('0x8d')](verticesWithRetry,_0x55997d[_0x1cb9('0x8e')])?_0x55997d:_['clone'](_0x55997d);for(var _0x17fc5a in _0x36faa4){if(_0x36faa4[_0x1cb9('0x8f')](_0x17fc5a)){if(_0x36faa4[_0x17fc5a]&&_[_0x1cb9('0x90')](_0x36faa4[_0x17fc5a])){if(_['includes'](recursiveMapAttributes,_0x17fc5a)){_0x36faa4[_0x17fc5a]=this['replaceObjectAllVariables'](_0x36faa4[_0x17fc5a]);}else{_0x36faa4[_0x17fc5a]=this['replaceAllVariables'](_0x36faa4[_0x17fc5a]);}}}}return _0x36faa4;};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x91')]=function(_0x32064a){for(var _0x523ca9 in _0x32064a){if(_0x32064a[_0x1cb9('0x8f')](_0x523ca9)){if(_['isPlainObject'](_0x32064a[_0x523ca9])){return this['recursiveNodeIndex'](_0x32064a[_0x523ca9]);}_0x32064a[_0x523ca9]=this[_0x1cb9('0x92')](_0x32064a[_0x523ca9]);}}};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x93')]=function(_0x2fa5b8,_0x2b31b7){for(var _0x2ea265 in _0x2fa5b8){if(_0x2fa5b8[_0x1cb9('0x8f')](_0x2ea265)){if(_[_0x1cb9('0x94')](_0x2fa5b8[_0x2ea265])){if(!_[_0x1cb9('0x40')](_0x2fa5b8[_0x2ea265])){this[_0x1cb9('0x93')](_0x2fa5b8[_0x2ea265],util['format']('%s.%s',_0x2b31b7,_0x2ea265));}}else{if(_0x2fa5b8[_0x2ea265]){this[_0x1cb9('0xc')][_0x1cb9('0x95')](util['format']('%s.%s',_0x2b31b7,_0x2ea265),_0x2fa5b8[_0x2ea265]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x1d67b0){try{var _0xd0e4eb=JSON['parse'](_0x1d67b0);this[_0x1cb9('0x91')](_0xd0e4eb);return JSON[_0x1cb9('0x70')](_0xd0e4eb);}catch(_0x442f56){return this[_0x1cb9('0x92')](_0x1d67b0);}};AGIVertices[_0x1cb9('0xf')]['replaceAllVariables']=function(_0x3a029e){var _0x1767f8=_0x3a029e[_0x1cb9('0x96')]('{');for(var _0x126cb4=0x1;_0x126cb4<_0x1767f8['length'];_0x126cb4+=0x1){var _0x19f3db=_0x1767f8[_0x126cb4][_0x1cb9('0x96')]('}');if(_0x19f3db['length']>0x1){_0x3a029e=_0x3a029e['replaceAll']('{'+_0x19f3db[0x0]+'}',this['channel'][_0x1cb9('0x10')](_0x19f3db[0x0])['extra']||_0x19f3db[0x0]);}}if(_0x1767f8[_0x1cb9('0x97')]===0x1){return _0x3a029e[_0x1cb9('0x98')]();}return this[_0x1cb9('0x92')](_0x3a029e);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x99')]=function(_0x274e7d,_0x5aeacf){var _0x276fee=this[_0x1cb9('0xc')][_0x1cb9('0x10')](_0x274e7d);if(_0x276fee[_0x1cb9('0x9a')]===-0x1){return _0x276fee;}logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x9b'),_0x5aeacf,_0x276fee[_0x1cb9('0x9c')]));return this[_0x1cb9('0xc')][_0x1cb9('0x95')](_0x5aeacf,_0x276fee[_0x1cb9('0x9c')]);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x7c')]=function(_0x1022d8){return _0x1022d8&&_0x1022d8!=='0'&&_0x1022d8!=='-1'&&_0x1022d8!=='';};AGIVertices[_0x1cb9('0xf')]['maxRetry']=function(_0x592c04){this['createSquareDetailsReport'][_0x1cb9('0x9d')](this,_0x592c04,'-');_0x592c04[_0x1cb9('0x9e')]=_0x592c04['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x6')]=function(_0x3cc39d){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x9f'),_0x3cc39d[_0x1cb9('0xa0')]));return this[_0x1cb9('0xc')][_0x1cb9('0x6')]([_0x3cc39d['command'],_0x3cc39d[_0x1cb9('0xa1')]]);};AGIVertices['prototype']['answer']=function(_0x191988){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0xa2'),_0x191988[_0x1cb9('0xa0')]));if(this[_0x1cb9('0x7c')](_0x191988[_0x1cb9('0x60')])){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0xa3'),_0x191988[_0x1cb9('0x60')]));var _0x370df9=this[_0x1cb9('0xc')][_0x1cb9('0xa4')](_0x191988['timeout']);if(_0x370df9[_0x1cb9('0x9a')]===-0x1){return _0x370df9;}}return this[_0x1cb9('0xc')][_0x1cb9('0xa5')]();};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x46')]=function(_0x5420d4){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0xa6'),_0x5420d4['label']));if(!this[_0x1cb9('0x7c')](_0x5420d4[_0x1cb9('0x44')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x5420d4,_0x1cb9('0xa7'));}_0x5420d4[_0x1cb9('0x45')]=moment();if(this['isConfigured'](_0x5420d4[_0x1cb9('0xa8')])){_0x5420d4[_0x1cb9('0x45')]=moment()[_0x1cb9('0xa9')](_0x5420d4['delay'],_0x1cb9('0xaa'));}if(!this[_0x1cb9('0x7c')](_0x5420d4['callback_priority'])){_0x5420d4['callback_priority']=0x2;}this[_0x1cb9('0x3f')][_0x1cb9('0x9d')](this,_0x5420d4);return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5420d4[_0x1cb9('0xac')],_0x5420d4[_0x1cb9('0x44')],_0x5420d4[_0x1cb9('0x45')]));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0xad')]=function(_0x5f168d){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0xae'),_0x5f168d[_0x1cb9('0xa0')]));var _0x4f7cc8=this['channel'][_0x1cb9('0x54')](_0x5f168d[_0x1cb9('0xaf')],_0x5f168d[_0x1cb9('0x74')]);if(_0x4f7cc8['result']===-0x1){return _0x4f7cc8;}return this['channel']['noop'](util[_0x1cb9('0x28')](_0x1cb9('0xb0'),_0x5f168d[_0x1cb9('0xaf')],_0x5f168d['options']));};AGIVertices[_0x1cb9('0xf')]['lumenvoxtts']=function(_0xf571af){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0xb1'),_0xf571af[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0xf571af[_0x1cb9('0x58')])){return this['channel'][_0x1cb9('0xab')](_0x1cb9('0xb2'));}var _0x130136='\x22'+_0xf571af[_0x1cb9('0x58')]+'\x22';if(this[_0x1cb9('0x7c')](_0xf571af['options'])){_0x130136+=','+_0xf571af[_0x1cb9('0x74')];}var _0x174147=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0xb3'),_0x130136);if(_0x174147[_0x1cb9('0x9a')]===-0x1){return _0x174147;}return this[_0x1cb9('0xc')]['noop'](util['format'](_0x1cb9('0xb4'),_0x130136));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0xb5')]=function(_0x1cdff0){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0xb6'),_0x1cdff0[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x1cdff0['text'])){return this[_0x1cb9('0xc')]['noop'](_0x1cb9('0xb2'));}var _0x4af9bb='\x22'+_0x1cdff0[_0x1cb9('0x58')]+'\x22';if(this[_0x1cb9('0x7c')](_0x1cdff0[_0x1cb9('0x74')])){_0x4af9bb+=','+_0x1cdff0[_0x1cb9('0x74')];}var _0x19edfa=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0xb3'),_0x4af9bb);if(_0x19edfa[_0x1cb9('0x9a')]===-0x1){return _0x19edfa;}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4af9bb));};AGIVertices['prototype']['lumenvoxasr']=function(_0x591334){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x591334['label']));if(!this['isConfigured'](_0x591334[_0x1cb9('0xb7')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xb8'));}var _0x4d66d3=_0x591334[_0x1cb9('0xb7')];if(this[_0x1cb9('0x7c')](_0x591334[_0x1cb9('0x74')])){_0x4d66d3+=','+_0x591334['options'];}var _0x3ebce9=this[_0x1cb9('0xc')]['exec'](_0x1cb9('0xb9'),_0x4d66d3);if(_0x3ebce9['result']===-0x1){return _0x3ebce9;}var _0x23f19c=this[_0x1cb9('0x99')](_0x1cb9('0xba'),_0x1cb9('0xbb'));if(_0x23f19c[_0x1cb9('0x9a')]===-0x1){return _0x23f19c;}var _0x2139ba=this[_0x1cb9('0x99')]('RECOG_INPUT()',_0x1cb9('0xbc'));if(_0x2139ba[_0x1cb9('0x9a')]===-0x1){return _0x2139ba;}var _0x21c0ab=this[_0x1cb9('0x99')](_0x1cb9('0xbd'),_0x1cb9('0xbe'));if(_0x21c0ab[_0x1cb9('0x9a')]===-0x1){return _0x21c0ab;}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4d66d3));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0xbf')]=function(_0x32be25){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x32be25[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x32be25['grammar'])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xb8'));}var _0x182e0d=_0x32be25[_0x1cb9('0xb7')];if(this[_0x1cb9('0x7c')](_0x32be25[_0x1cb9('0x74')])){_0x182e0d+=','+_0x32be25[_0x1cb9('0x74')];}var _0x21d13d=this['channel']['exec'](_0x1cb9('0xb9'),_0x182e0d);if(_0x21d13d[_0x1cb9('0x9a')]===-0x1){return _0x21d13d;}var _0x38bf03=this[_0x1cb9('0x99')](_0x1cb9('0xba'),_0x1cb9('0xc0'));if(_0x38bf03[_0x1cb9('0x9a')]===-0x1){return _0x38bf03;}var _0x37b7df=this[_0x1cb9('0x99')](_0x1cb9('0xc1'),'SESTEK_ASR_TRANSCRIPT');if(_0x37b7df[_0x1cb9('0x9a')]===-0x1){return _0x37b7df;}var _0x5101a9=this[_0x1cb9('0x99')](_0x1cb9('0xbd'),_0x1cb9('0xc2'));if(_0x5101a9[_0x1cb9('0x9a')]===-0x1){return _0x5101a9;}return this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xc3'),_0x182e0d));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0xc4')]=function(_0x1bf6a4){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0xc5'),_0x1bf6a4[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x1bf6a4[_0x1cb9('0xc6')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x1bf6a4,_0x1cb9('0xc7'));}var _0x1ad996=this[_0x1cb9('0x19')][_0x1cb9('0x9d')](this,_0x1bf6a4[_0x1cb9('0xc6')]);if(!_0x1ad996){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x1bf6a4,_0x1cb9('0xc8'));}if(!this[_0x1cb9('0x7c')](_0x1bf6a4[_0x1cb9('0xc9')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x1bf6a4,_0x1cb9('0xca'));}var _0xca45c6=_0x1bf6a4[_0x1cb9('0xc9')][_0x1cb9('0x55')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xcb'),_0xca45c6));var _0x9ab004=this[_0x1cb9('0x2a')][_0x1cb9('0x9d')](this,_0x1ad996,_0xca45c6);this['createSquareDetailsReport'][_0x1cb9('0x9d')](this,_0x1bf6a4,_0xca45c6);if(!this['isConfigured'](_0x1bf6a4[_0x1cb9('0xcc')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x15ae24=this[_0x1cb9('0x10')][_0x1cb9('0x9d')](this,_0x1bf6a4[_0x1cb9('0xcc')]);if(!_0x15ae24){return this['channel'][_0x1cb9('0x2b')](_0x1bf6a4,_0x1cb9('0xcd'));}var _0x3557bd=this;_0x9ab004[_0x1cb9('0xce')](function(_0x4f0c63,_0x1c813f){Object[_0x1cb9('0xcf')](_0x4f0c63)['forEach'](function(_0x21d844){_0x3557bd[_0x1cb9('0xc')][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0xd0'),_0x15ae24,_0x1c813f,_0x21d844),_0x4f0c63[_0x21d844]);});});this[_0x1cb9('0xc')][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0xd1'),_0x15ae24),_0x9ab004[_0x1cb9('0x97')]);return this[_0x1cb9('0xc')]['noop'](util[_0x1cb9('0x28')]('variable\x20%s\x20set',_0x15ae24));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0xd2')]=function(_0xc4ac8b){logger[_0x1cb9('0xd3')](util[_0x1cb9('0x28')](_0x1cb9('0xd4'),_0xc4ac8b[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0xc4ac8b[_0x1cb9('0xd5')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0xc4ac8b,_0x1cb9('0xd6'));}var _0xa233e8=this['getUser'][_0x1cb9('0x9d')](this,_0xc4ac8b[_0x1cb9('0xd5')]);if(!_0xa233e8){return this[_0x1cb9('0xc')]['error'](_0xc4ac8b,'no\x20user\x20found');}var _0x4946fd=this[_0x1cb9('0xc')][_0x1cb9('0x54')]('DIAL',[util[_0x1cb9('0x28')](_0x1cb9('0xd7'),_0xa233e8),_0xc4ac8b[_0x1cb9('0x60')],_0xc4ac8b[_0x1cb9('0xd8')],_0xc4ac8b[_0x1cb9('0x6d')]]);if(_0x4946fd['result']===-0x1){return _0x4946fd;}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xd9'),'DIAL'));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0xda')]=function(_0x343dd0){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0xdb'),_0x343dd0['label']));if(!this[_0x1cb9('0x7c')](_0x343dd0[_0x1cb9('0x75')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xdc'));}if(!this[_0x1cb9('0x7c')](_0x343dd0[_0x1cb9('0x58')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xb2'));}this[_0x1cb9('0xc')]['bot']=!![];this[_0x1cb9('0x35')](_0x343dd0);this[_0x1cb9('0x3e')](_0x343dd0['text'],'in');this[_0x1cb9('0xc')]['noop'](util[_0x1cb9('0x28')](_0x1cb9('0xdd'),_0x343dd0[_0x1cb9('0x58')]));var _0x46fb97=this[_0x1cb9('0xde')][_0x1cb9('0x9d')](this,_0x343dd0);if(_0x46fb97){for(var _0x4b5298 in _0x46fb97){if(_0x46fb97[_0x1cb9('0x8f')](_0x4b5298)){this[_0x1cb9('0xc')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x4b5298[_0x1cb9('0x65')]()),_0x46fb97[_0x4b5298]);}}this[_0x1cb9('0x3e')](_0x46fb97[_0x1cb9('0xdf')],'out');return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xe0'),_0x46fb97['speech']));}return this['channel'][_0x1cb9('0x2b')](_0x343dd0,_0x1cb9('0xe1'));};AGIVertices['prototype'][_0x1cb9('0xe2')]=function(_0x3b7e24){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0xe3'),_0x3b7e24[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x3b7e24['ndauth_url'])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x1cb9('0x7c')](_0x3b7e24[_0x1cb9('0xe4')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20username\x20configured');}if(!this[_0x1cb9('0x7c')](_0x3b7e24[_0x1cb9('0xe5')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xe6'));}if(!this['isConfigured'](_0x3b7e24[_0x1cb9('0xe7')])){return this['channel'][_0x1cb9('0xab')]('no\x20text\x20configured');}this[_0x1cb9('0xc')]['bot']=!![];this[_0x1cb9('0x35')](_0x3b7e24);this[_0x1cb9('0x3e')](_0x3b7e24[_0x1cb9('0x58')],'in');this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xe8'),_0x3b7e24[_0x1cb9('0x58')]));var _0x52f565=this[_0x1cb9('0x77')][_0x1cb9('0x9d')](this,_0x3b7e24);if(_0x52f565){for(var _0x3ed806 in _0x52f565){if(_0x52f565[_0x1cb9('0x8f')](_0x3ed806)){this[_0x1cb9('0xc')][_0x1cb9('0x95')](util['format']('SESTEK_NDA_%s',_0x3ed806[_0x1cb9('0x65')]()),_0x52f565[_0x3ed806]);}}this[_0x1cb9('0x3e')](_0x52f565[_0x1cb9('0xdf')],_0x1cb9('0xe9'));if(_0x52f565[_0x1cb9('0xea')]){this[_0x1cb9('0xc')]['noop'](util['format'](_0x1cb9('0xeb'),_0x52f565[_0x1cb9('0xea')]));var _0x35c691=this['channel'][_0x1cb9('0xec')](_0x52f565[_0x1cb9('0xea')]);try{fs[_0x1cb9('0xed')](_0x52f565['audiofile']+_0x1cb9('0xee'));}catch(_0x181246){logger[_0x1cb9('0x2b')](_0x181246);}return _0x35c691;}else{return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xef'),_0x52f565[_0x1cb9('0xdf')]));}}return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x3b7e24,_0x1cb9('0xf0'));};AGIVertices[_0x1cb9('0xf')]['end']=function(_0x1ab1c7){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x1ab1c7['label']));return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('end');};AGIVertices[_0x1cb9('0xf')]['ext_dial']=function(_0x30ef27){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x30ef27[_0x1cb9('0xa0')]));var _0x30e496='';if(_0x30ef27[_0x1cb9('0xf1')]){if(!this[_0x1cb9('0x7c')](_0x30ef27[_0x1cb9('0xf1')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x30ef27,_0x1cb9('0xf2'));}else{var _0x4fb8f9=parseInt(_0x30ef27[_0x1cb9('0xf1')],0xa);if(isNaN(_0x4fb8f9)){_0x30e496=_0x30ef27['trunk_id'];}else{_0x30e496=this[_0x1cb9('0xf3')]['sync'](this,_0x30ef27[_0x1cb9('0xf1')]);if(!_0x30e496){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x30ef27,'no\x20trunk\x20found');}}}}else if(_0x30ef27[_0x1cb9('0xf4')]){_0x30e496=_0x30ef27[_0x1cb9('0xf4')];}else{return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x30ef27,_0x1cb9('0xf2'));}var _0x5e3c80=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0xf5'),[util['format'](_0x1cb9('0xf6'),_0x30e496,_0x30ef27[_0x1cb9('0xac')]),_0x30ef27[_0x1cb9('0x60')],_0x30ef27[_0x1cb9('0xd8')],_0x30ef27['url']]);if(_0x5e3c80[_0x1cb9('0x9a')]===-0x1){return _0x5e3c80;}return this['channel']['noop'](util[_0x1cb9('0x28')]('Executed\x20command\x20%s',_0x1cb9('0xf5')));};AGIVertices['prototype'][_0x1cb9('0xf7')]=function(_0xf38904){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0xf8'),_0xf38904[_0x1cb9('0xa0')]));return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xf7'));};AGIVertices['prototype'][_0x1cb9('0xb')]=function(_0x45a7a4){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0xf9'),_0x45a7a4[_0x1cb9('0xa0')]));if(_0x45a7a4['retry']===0x0){return this['maxRetry'](_0x45a7a4);}_0x45a7a4[_0x1cb9('0x9e')]-=0x1;if(!this[_0x1cb9('0x7c')](_0x45a7a4[_0x1cb9('0xfa')])){return this[_0x1cb9('0xc')]['error'](_0x45a7a4,_0x1cb9('0xfb'));}var _0xd7dd14=this[_0x1cb9('0x1e')]['sync'](this,_0x45a7a4[_0x1cb9('0xfa')]);if(!_0xd7dd14){return this[_0x1cb9('0xc')]['error'](_0x45a7a4,_0x1cb9('0xfc'));}if(!this[_0x1cb9('0x7c')](_0x45a7a4['variable_id'])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x1cb9('0xfd'));}var _0x146ec2=this[_0x1cb9('0xc')][_0x1cb9('0xfe')](_0xd7dd14,_0x45a7a4[_0x1cb9('0xff')],_0x45a7a4['maxdigit']);var _0x3ab599=_0x146ec2['result']?_0x146ec2[_0x1cb9('0x9a')][_0x1cb9('0x98')]():'';logger[_0x1cb9('0x2e')](_0x1cb9('0x100'),JSON['stringify'](_0x146ec2));if(_0x146ec2[_0x1cb9('0x9a')]===-0x1){this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x45a7a4,_0x3ab599);return _0x146ec2;}else if(_0x146ec2['extra']===_0x1cb9('0x60')){_0x146ec2['result']=_0x3ab599['length']>=parseInt(_0x45a7a4[_0x1cb9('0x101')])?'x':'i';}else{_0x146ec2['result']=_0x3ab599[_0x1cb9('0x97')]>=parseInt(_0x45a7a4['mindigit'])&&_0x3ab599[_0x1cb9('0x97')]<=parseInt(_0x45a7a4[_0x1cb9('0x102')])?'x':'i';}var _0x5425bd=this[_0x1cb9('0x10')][_0x1cb9('0x9d')](this,_0x45a7a4[_0x1cb9('0xcc')]);if(!_0x5425bd){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x45a7a4,_0x1cb9('0xcd'));}this[_0x1cb9('0xc')][_0x1cb9('0x95')](_0x5425bd,_0x3ab599);if(this[_0x1cb9('0x7c')](_0x45a7a4[_0x1cb9('0x103')])){var _0x50c592=parseInt(_0x45a7a4[_0x1cb9('0x103')],0xa);var _0x183798=rs['generate']({'charset':'*','length':_0x50c592});var _0x530922=_0x3ab599[_0x1cb9('0x97')];if(_0x530922>0x0){if(_0x530922>_0x50c592){this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x45a7a4,_0x45a7a4['hiddendigitspos']===_0x1cb9('0x104')?_0x183798+_0x3ab599[_0x1cb9('0x105')](_0x50c592):_0x3ab599['substr'](0x0,_0x530922-_0x50c592)+_0x183798);}else{this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x45a7a4,rs[_0x1cb9('0x106')]({'charset':'*','length':_0x530922}));}}else{this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x45a7a4,'');}}else{this[_0x1cb9('0x35')]['sync'](this,_0x45a7a4,_0x3ab599);}return _0x146ec2;};AGIVertices[_0x1cb9('0xf')]['getsecretdigits']=function(_0x30e969){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x107'),_0x30e969[_0x1cb9('0xa0')]));return this[_0x1cb9('0xb')](_0x30e969);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x108')]=function(_0x52810a){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x109'),_0x52810a['label']));this['createSquareDetailsReport'][_0x1cb9('0x9d')](this,_0x52810a,_0x52810a['goalname']);return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format'](_0x1cb9('0x10a'),_0x52810a[_0x1cb9('0x10b')]));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x10c')]=function(_0x41e45d){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x10d'),_0x41e45d[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x41e45d[_0x1cb9('0x7e')])||!this[_0x1cb9('0x7c')](_0x41e45d['aws_secret_access_key'])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0x10e'));}if(!this[_0x1cb9('0x7c')](_0x41e45d[_0x1cb9('0x58')])){return this['channel'][_0x1cb9('0xab')](_0x1cb9('0xb2'));}this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x10f'),_0x41e45d[_0x1cb9('0x58')]));var _0x36f42c=this[_0x1cb9('0x7d')]['sync'](this,_0x41e45d);if(_0x36f42c){this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format'](_0x1cb9('0x110'),_0x36f42c));var _0x16aaad=this[_0x1cb9('0xc')]['streamFile'](_0x36f42c);try{fs['unlink'](_0x36f42c+_0x1cb9('0xee'));}catch(_0x1ee133){logger[_0x1cb9('0x2b')](_0x1ee133);}return _0x16aaad;}return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x41e45d,_0x1cb9('0x111'));};AGIVertices[_0x1cb9('0xf')]['awslex']=function(_0x52fdb2){logger['info'](util[_0x1cb9('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x52fdb2[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x52fdb2[_0x1cb9('0x7e')])||!this[_0x1cb9('0x7c')](_0x52fdb2[_0x1cb9('0x84')])){return this['channel'][_0x1cb9('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x52fdb2[_0x1cb9('0x86')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20bot\x20name\x20configured');}if(!this[_0x1cb9('0x7c')](_0x52fdb2[_0x1cb9('0x58')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xb2'));}this[_0x1cb9('0xc')][_0x1cb9('0x112')]=!![];this[_0x1cb9('0x35')](_0x52fdb2);this[_0x1cb9('0x3e')](_0x52fdb2[_0x1cb9('0x58')],'in');this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x113'),_0x52fdb2[_0x1cb9('0x58')]));var _0x4b389b=this[_0x1cb9('0x83')]['sync'](this,_0x52fdb2);if(_0x4b389b){for(var _0x5bbd57 in _0x4b389b){if(_0x4b389b[_0x1cb9('0x8f')](_0x5bbd57)&&_[_0x1cb9('0x90')](_0x4b389b[_0x5bbd57])){this[_0x1cb9('0xc')][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0x114'),_0x5bbd57[_0x1cb9('0x65')]()),_0x4b389b[_0x5bbd57]);}}if(_['isNil'](_0x4b389b['message'])){return this['channel'][_0x1cb9('0xab')](_0x1cb9('0x115'));}else{this['createSquareMessage'](_0x4b389b['message'],_0x1cb9('0xe9'));return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format'](_0x1cb9('0x116'),_0x4b389b[_0x1cb9('0x117')]));}}return this['channel'][_0x1cb9('0x2b')](_0x52fdb2,_0x1cb9('0x118'));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x119')]=function(_0x38264c){logger[_0x1cb9('0x2e')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x38264c['label'],_0x38264c[_0x1cb9('0x60')]));if(!this['isConfigured'](_0x38264c['key'])){return this[_0x1cb9('0xc')]['noop'](_0x1cb9('0xdc'));}var _0x569e06=_0x1cb9('0x11a');var _0x4b7608=util[_0x1cb9('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x1cb9('0x106')](0x4));var _0x230406=util['format'](_0x1cb9('0x11b'),_0x4b7608,_0x569e06);var _0x2d0b9e=!![];if(_0x38264c[_0x1cb9('0x11c')]===_0x1cb9('0x11d')){_0x2d0b9e=![];}var _0x3f766f=this['channel'][_0x1cb9('0x11e')](_0x4b7608,_0x569e06,_0x38264c['intKey'],_0x38264c[_0x1cb9('0x60')],undefined,_0x2d0b9e);if(_0x3f766f[_0x1cb9('0x9a')]!==-0x1){this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x11f'),_0x230406));var _0x360400=this[_0x1cb9('0x87')]['sync'](this,_0x38264c,_0x230406);if(_0x360400){for(var _0x5d5983 in _0x360400){if(_0x360400['hasOwnProperty'](_0x5d5983)){this[_0x1cb9('0xc')][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0x120'),_0x5d5983[_0x1cb9('0x65')]()),_0x360400[_0x5d5983]);}}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x121'),JSON['stringify'](_0x360400)));}}return _0x3f766f;};AGIVertices['prototype'][_0x1cb9('0x122')]=function(_0x35d396){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x123'),_0x35d396[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x35d396[_0x1cb9('0x8a')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20appid\x20configured');}if(!this[_0x1cb9('0x7c')](_0x35d396[_0x1cb9('0x8b')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20appsecret\x20configured');}var _0x2adc80=_0x1cb9('0x11a');var _0x4313ee=util[_0x1cb9('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x1cb9('0x106')](0x4));var _0x46e5c2=util[_0x1cb9('0x28')](_0x1cb9('0x11b'),_0x4313ee,_0x2adc80);var _0x418cd4=!![];if(_0x35d396[_0x1cb9('0x11c')]===_0x1cb9('0x11d')){_0x418cd4=![];}var _0x36c545=this['channel']['recordFile'](_0x4313ee,_0x2adc80,_0x35d396['intKey'],_0x35d396[_0x1cb9('0x60')],undefined,_0x418cd4);if(_0x36c545['result']!==-0x1){this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('tilde\x20%s\x20file\x20created',_0x46e5c2));var _0x74cb1a=this[_0x1cb9('0x89')]['sync'](this,_0x35d396,_0x46e5c2);if(_0x74cb1a){for(var _0xb04d99 in _0x74cb1a){if(_0x74cb1a[_0x1cb9('0x8f')](_0xb04d99)){this['channel'][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0x124'),_0xb04d99[_0x1cb9('0x65')]()),_0x74cb1a[_0xb04d99]);}}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x1cb9('0x70')](_0x74cb1a)));}}return _0x36c545;};AGIVertices[_0x1cb9('0xf')]['gotoc']=function(_0x1adafc){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1adafc['label']));return this[_0x1cb9('0xc')][_0x1cb9('0x125')](_0x1adafc['context'],_0x1adafc[_0x1cb9('0x126')],_0x1adafc[_0x1cb9('0x3b')]);};AGIVertices[_0x1cb9('0xf')]['gotoif']=function(_0x5079f7){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x127'),_0x5079f7[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x5079f7[_0x1cb9('0x128')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x5079f7,_0x1cb9('0x129'));}try{var _0x199eb7=eval(_0x5079f7['condition'])?'true':_0x1cb9('0x12a');this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x12b'),_0x5079f7[_0x1cb9('0x128')],_0x199eb7));return{'code':0xc8,'result':_0x199eb7};}catch(_0x4c0d42){return{'code':0xc8,'result':_0x1cb9('0x12a')};}};AGIVertices['prototype'][_0x1cb9('0x12c')]=function(_0x1e79a2){logger['info'](util['format'](_0x1cb9('0x12d'),_0x1e79a2[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x1e79a2[_0x1cb9('0x12e')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x1e79a2,_0x1cb9('0x12f'));}var _0x3ea026=this[_0x1cb9('0x130')][_0x1cb9('0x9d')](this,_0x1e79a2[_0x1cb9('0x12e')]);if(!_0x3ea026){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x1e79a2,_0x1cb9('0x131'));}for(var _0x3cf954=0x0;_0x3cf954<_0x3ea026[_0x1cb9('0x97')];_0x3cf954+=0x1){var _0x5a079b=this[_0x1cb9('0xc')][_0x1cb9('0x10')](util[_0x1cb9('0x28')](_0x1cb9('0x132'),_0x3ea026[_0x3cf954]));if(_0x5a079b[_0x1cb9('0x9a')]===-0x1){return _0x5a079b;}logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0x133'),_0x3ea026[_0x3cf954],_0x5a079b[_0x1cb9('0x9c')]));if(_0x5a079b['extra']===_0x1cb9('0x134')){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0x133'),_0x3ea026[_0x3cf954],_0x1cb9('0x134')));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x133'),_0x3ea026[_0x3cf954],'true'));return{'code':0xc8,'result':_0x1cb9('0x134')};}else{logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('IFTIME\x20%s\x20%s',_0x3ea026[_0x3cf954],_0x1cb9('0x12a')));this['channel']['noop'](util[_0x1cb9('0x28')](_0x1cb9('0x133'),_0x3ea026[_0x3cf954],_0x1cb9('0x12a')));}}return{'code':0xc8,'result':_0x1cb9('0x12a')};};AGIVertices['prototype'][_0x1cb9('0x135')]=function(_0x24fd7b){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x136'),_0x24fd7b[_0x1cb9('0xa0')]));return this[_0x1cb9('0xc')]['hangup']();};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x137')]=function(_0x398fc1){logger['info'](util[_0x1cb9('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x398fc1[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x398fc1[_0x1cb9('0x75')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20key\x20configured');}var _0x4c9d41='wav';var _0x4fbe4a=util[_0x1cb9('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x1cb9('0x106')](0x4));var _0x484305=util[_0x1cb9('0x28')](_0x1cb9('0x11b'),_0x4fbe4a,_0x4c9d41);var _0x21d672=!![];if(_0x398fc1[_0x1cb9('0x11c')]===_0x1cb9('0x11d')){_0x21d672=![];}var _0x138763=this[_0x1cb9('0xc')][_0x1cb9('0x11e')](_0x4fbe4a,_0x4c9d41,_0x398fc1['intKey'],_0x398fc1[_0x1cb9('0x60')],undefined,_0x21d672);if(_0x138763[_0x1cb9('0x9a')]!==-0x1){this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('ispeech\x20%s\x20file\x20created',_0x484305));var _0x487ffe=this[_0x1cb9('0x7b')]['sync'](this,_0x398fc1,_0x484305);if(_0x487ffe){for(var _0x5047a9 in _0x487ffe){if(_0x487ffe['hasOwnProperty'](_0x5047a9)){this[_0x1cb9('0xc')][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0x138'),_0x5047a9[_0x1cb9('0x65')]()),_0x487ffe[_0x5047a9]);}}return this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0x1cb9('0x70')](_0x487ffe)));}}return _0x138763;};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x139')]=function(_0xea21b9){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x13a'),_0xea21b9['label']));if(!this[_0x1cb9('0x7c')](_0xea21b9['key'])){return this['channel'][_0x1cb9('0xab')]('no\x20key\x20configured');}if(!this[_0x1cb9('0x7c')](_0xea21b9[_0x1cb9('0x58')])){return this[_0x1cb9('0xc')]['noop'](_0x1cb9('0xb2'));}this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x13b'),_0xea21b9[_0x1cb9('0x58')]));var _0x4d4067=this[_0x1cb9('0x78')][_0x1cb9('0x9d')](this,_0xea21b9);if(_0x4d4067){this['channel']['noop'](util[_0x1cb9('0x28')](_0x1cb9('0x13c'),_0x4d4067));var _0x2ab0ce=this[_0x1cb9('0xc')][_0x1cb9('0xec')](_0x4d4067,_0xea21b9['intKey']);try{fs[_0x1cb9('0xed')](_0x4d4067+'.wav');}catch(_0x18a2bc){logger[_0x1cb9('0x2b')](_0x18a2bc);}return _0x2ab0ce;}return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0xea21b9,_0x1cb9('0x13d'));};AGIVertices['prototype'][_0x1cb9('0x13e')]=function(_0x53095b){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0x13f'),_0x53095b[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x53095b[_0x1cb9('0x140')])){return this['channel'][_0x1cb9('0x2b')](_0x53095b,_0x1cb9('0x141'));}logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x142'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x53095b['findBy']));var _0x50e7f3=this[_0x1cb9('0x4f')][_0x1cb9('0x9d')](this,_0x53095b[_0x1cb9('0x140')]);if(_0x50e7f3){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0x143'),this[_0x1cb9('0xc')]['callerid'],_0x53095b[_0x1cb9('0x140')]));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format'](_0x1cb9('0x143'),this['channel'][_0x1cb9('0x38')],_0x53095b[_0x1cb9('0x140')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x144'),this['channel'][_0x1cb9('0x38')],_0x53095b[_0x1cb9('0x140')]));this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x144'),this[_0x1cb9('0xc')]['callerid'],_0x53095b[_0x1cb9('0x140')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x1cb9('0x145')]=function(_0x4c40da){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x146'),_0x4c40da['label']));if(!this[_0x1cb9('0x7c')](_0x4c40da[_0x1cb9('0x140')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x4c40da,_0x1cb9('0x141'));}logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x142'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x4c40da[_0x1cb9('0x140')]));var _0x28625d=this['agentLogout'][_0x1cb9('0x9d')](this,_0x4c40da[_0x1cb9('0x140')]);if(_0x28625d){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x143'),this[_0x1cb9('0xc')]['callerid'],_0x4c40da[_0x1cb9('0x140')]));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x143'),this['channel'][_0x1cb9('0x38')],_0x4c40da['findBy']));return{'code':0xc8,'result':_0x1cb9('0x147')};}else{logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x144'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x4c40da[_0x1cb9('0x140')]));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x4c40da[_0x1cb9('0x140')]));return{'code':0xc8,'result':_0x1cb9('0x148')};}};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x149')]=function(_0x184465){logger['info'](util[_0x1cb9('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x184465[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x184465[_0x1cb9('0x14a')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x184465,'no\x20operation\x20configured');}this['channel'][_0x1cb9('0xab')](util['format'](_0x1cb9('0x14b'),_0x184465[_0x1cb9('0x14a')]));var _0x4404dc=eval(_0x184465[_0x1cb9('0x14a')]);if(!this[_0x1cb9('0x7c')](_0x184465['variable_id'])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xfd'));}var _0x19a6f7=this[_0x1cb9('0x10')][_0x1cb9('0x9d')](this,_0x184465[_0x1cb9('0xcc')]);if(!_0x19a6f7){return this['channel'][_0x1cb9('0x2b')](_0x184465,'no\x20variable\x20found');}if(_['isArray'](_0x4404dc)){var _0x3f1ebf=this;_0x4404dc[_0x1cb9('0xce')](function(_0x5cf703,_0xb79d5a){_0x3f1ebf[_0x1cb9('0xc')][_0x1cb9('0x95')](util[_0x1cb9('0x28')](_0x1cb9('0x14c'),_0x19a6f7,_0xb79d5a),_0x5cf703);});return this[_0x1cb9('0xc')]['noop'](util[_0x1cb9('0x28')]('variable\x20%s[key]\x20set',_0x19a6f7));}else{return this[_0x1cb9('0xc')][_0x1cb9('0x95')](_0x19a6f7,_0x4404dc);}};AGIVertices[_0x1cb9('0xf')]['menu']=function(_0x55f79c){logger[_0x1cb9('0x2e')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x55f79c[_0x1cb9('0xa0')]));if(_0x55f79c[_0x1cb9('0x9e')]===0x0){return this['maxRetry'](_0x55f79c);}_0x55f79c[_0x1cb9('0x9e')]-=0x1;if(!this[_0x1cb9('0x7c')](_0x55f79c[_0x1cb9('0xfa')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x55f79c,'no\x20file\x20audio\x20selected');}var _0xc369a=this[_0x1cb9('0x1e')][_0x1cb9('0x9d')](this,_0x55f79c[_0x1cb9('0xfa')]);if(!_0xc369a){return this['channel'][_0x1cb9('0x2b')](_0x55f79c,_0x1cb9('0xfc'));}var _0x5e0361=this[_0x1cb9('0xc')]['getData'](_0xc369a,_0x55f79c[_0x1cb9('0xff')],_0x55f79c[_0x1cb9('0x14d')]);var _0x3f318d=_0x5e0361[_0x1cb9('0x9a')];if(_0x5e0361['result']===-0x1){this[_0x1cb9('0x35')]['sync'](this,_0x55f79c,'-1');return _0x5e0361;}else if(_0x5e0361[_0x1cb9('0x9c')]===_0x1cb9('0x60')){_0x5e0361[_0x1cb9('0x9a')]=_0x5e0361[_0x1cb9('0x9a')][_0x1cb9('0x97')]>0x0?_0x5e0361[_0x1cb9('0x9a')]:'t';}else if(_[_0x1cb9('0x40')](_0x5e0361[_0x1cb9('0x9a')])){_0x5e0361[_0x1cb9('0x9a')]='#';_0x3f318d='#';}if(!this[_0x1cb9('0x7c')](_0x55f79c[_0x1cb9('0xcc')])){this[_0x1cb9('0xc')]['noop'](_0x1cb9('0xfd'));}else{var _0x3fe888=this[_0x1cb9('0x10')][_0x1cb9('0x9d')](this,_0x55f79c[_0x1cb9('0xcc')]);if(!_0x3fe888){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x55f79c,_0x1cb9('0xcd'));}this['channel'][_0x1cb9('0x95')](_0x3fe888,_0x3f318d);}this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x55f79c,_0x3f318d);return _0x5e0361;};AGIVertices['prototype'][_0x1cb9('0xab')]=function(_0x4c41b4){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x4c41b4['label']));return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x4c41b4[_0x1cb9('0x14e')]||_0x4c41b4[_0x1cb9('0xa0')]);};AGIVertices[_0x1cb9('0xf')]['pause']=function(_0x54f8e6){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x14f'),_0x54f8e6[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x54f8e6[_0x1cb9('0x140')])){return this[_0x1cb9('0xc')]['error'](_0x54f8e6,'no\x20find\x20by\x20configured');}logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x142'),this[_0x1cb9('0xc')]['callerid'],_0x54f8e6[_0x1cb9('0x140')]));var _0x16d91a=this[_0x1cb9('0x49')][_0x1cb9('0x9d')](this,_0x54f8e6[_0x1cb9('0x150')]);var _0x2ac02b=this['agentPause']['sync'](this,_0x54f8e6['findBy'],_0x16d91a);if(_0x2ac02b){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1cb9('0xc')]['callerid'],_0x54f8e6[_0x1cb9('0x140')]));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x143'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x54f8e6[_0x1cb9('0x140')]));return{'code':0xc8,'result':_0x1cb9('0x147')};}else{logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x144'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x54f8e6['findBy']));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x143'),this['channel'][_0x1cb9('0x38')],_0x54f8e6[_0x1cb9('0x140')]));return{'code':0xc8,'result':_0x1cb9('0x148')};}};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x151')]=function(_0x5ebe0c){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x152'),_0x5ebe0c[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x5ebe0c[_0x1cb9('0xfa')])){return this[_0x1cb9('0xc')]['error'](_0x5ebe0c,_0x1cb9('0xfb'));}var _0x258952=this[_0x1cb9('0x1e')][_0x1cb9('0x9d')](this,_0x5ebe0c[_0x1cb9('0xfa')]);if(!_0x258952){return this['channel'][_0x1cb9('0x2b')](_0x5ebe0c,_0x1cb9('0xfc'));}var _0x26d865=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0x153'),[_0x258952,_0x5ebe0c['opts']]);if(_0x26d865[_0x1cb9('0x9a')]===-0x1){return _0x26d865;}return this[_0x1cb9('0xc')]['noop'](util[_0x1cb9('0x28')](_0x1cb9('0xb0'),_0x1cb9('0x153'),_0x258952));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x154')]=function(_0x3cff8f){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x155'),_0x3cff8f[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x3cff8f[_0x1cb9('0x156')])){return this['channel'][_0x1cb9('0x2b')](_0x3cff8f,_0x1cb9('0x157'));}var _0x5e3e0b='';var _0x29f61c=parseInt(_0x3cff8f['queue_id'],0xa);if(isNaN(_0x29f61c)){_0x5e3e0b=_0x3cff8f[_0x1cb9('0x156')];}else{_0x5e3e0b=this[_0x1cb9('0x13')]['sync'](this,_0x3cff8f['queue_id']);if(!_0x5e3e0b){return this[_0x1cb9('0xc')]['error'](_0x3cff8f,_0x1cb9('0x158'));}}var _0x2c294a='';if(this[_0x1cb9('0x7c')](_0x3cff8f[_0x1cb9('0xfa')])){var _0x40e1d3=this['getSound'][_0x1cb9('0x9d')](this,_0x3cff8f[_0x1cb9('0xfa')]);if(_0x40e1d3){_0x2c294a=_0x40e1d3;}}this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x3cff8f,_0x5e3e0b);if(_0x3cff8f[_0x1cb9('0xd8')][_0x1cb9('0x159')]('x')<0x0){_0x3cff8f['opts']+='x';}if(_0x3cff8f[_0x1cb9('0xd8')]['indexOf']('X')<0x0){_0x3cff8f[_0x1cb9('0xd8')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x5e3e0b?_0x5e3e0b['toLowerCase']():'');var _0x122e22=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0x15a'),[_0x5e3e0b,_0x3cff8f[_0x1cb9('0xd8')],_0x3cff8f[_0x1cb9('0x6d')],_0x2c294a,_0x3cff8f[_0x1cb9('0x60')],_0x3cff8f[_0x1cb9('0x6')],_0x3cff8f[_0x1cb9('0x15b')],_0x3cff8f['gosub'],'',_0x3cff8f[_0x1cb9('0x15c')]]);if(_0x122e22[_0x1cb9('0x9a')]===-0x1){return _0x122e22;}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xb0'),_0x1cb9('0x15a'),_0x5e3e0b));};AGIVertices[_0x1cb9('0xf')]['record']=function(_0x35f8be){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0x15d'),_0x35f8be[_0x1cb9('0xa0')]));var _0x1c4ac0=_0x35f8be[_0x1cb9('0x15e')]||'wav';var _0x2cf89d=util[_0x1cb9('0x28')](_0x1cb9('0x15f'),this[_0x1cb9('0xc')][_0x1cb9('0x36')],rs[_0x1cb9('0x106')](0x5));var _0x36c51b=util[_0x1cb9('0x28')](_0x1cb9('0x160'),FILES_PATH,_0x2cf89d,_0x1c4ac0);var _0x2fa549=util[_0x1cb9('0x28')](_0x1cb9('0x161'),FILES_PATH,_0x2cf89d);this[_0x1cb9('0x39')][_0x1cb9('0x9d')](this,_0x35f8be,_0x2cf89d,_0x36c51b);this['channel'][_0x1cb9('0x95')](_0x1cb9('0x162'),_0x2cf89d);logger[_0x1cb9('0x2e')](_0x1cb9('0x163'),_0x2fa549,_0x1c4ac0,_0x35f8be[_0x1cb9('0x164')],_0x35f8be['timeout']);return this[_0x1cb9('0xc')][_0x1cb9('0x11e')](_0x2fa549,_0x1c4ac0,_0x35f8be['escape_digits'],_0x35f8be['timeout'],undefined,!![]);};AGIVertices['prototype'][_0x1cb9('0x165')]=function(_0x521fc1){logger[_0x1cb9('0x2e')](util['format'](_0x1cb9('0x166'),_0x521fc1['label']));if(!this[_0x1cb9('0x7c')](_0x521fc1[_0x1cb9('0x6d')])){return this['channel'][_0x1cb9('0xab')]('no\x20url\x20configured');}var _0x2fc179=this[_0x1cb9('0x167')]['sync'](this,_0x521fc1);logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x168'),util['inspect'](_0x2fc179,{'showHidden':![],'depth':null})));if(!this[_0x1cb9('0x7c')](_0x521fc1[_0x1cb9('0xcc')])){return this['channel']['noop'](_0x1cb9('0x169'));}var _0x4ed004=this[_0x1cb9('0x10')]['sync'](this,_0x521fc1['variable_id']);if(!_0x4ed004){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x521fc1,_0x1cb9('0xcd'));}this[_0x1cb9('0xc')]['setVariable'](util['format'](_0x1cb9('0x16a'),_0x4ed004),_0x2fc179['statusCode']?_0x2fc179[_0x1cb9('0x72')]:'200');this['channel']['setVariable'](util[_0x1cb9('0x28')](_0x1cb9('0x16b'),_0x4ed004),_0x2fc179[_0x1cb9('0x71')]?_0x2fc179['statusMessage']:'OK');if(_0x2fc179[_0x1cb9('0x6f')]){try{this['saveRestApiResult'](_0x2fc179[_0x1cb9('0x6f')],_0x4ed004);}catch(_0x3dfc2c){logger['error'](util[_0x1cb9('0x28')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x4ed004));}}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('variable\x20%s\x20set',_0x4ed004));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x16c')]=function(_0x2b94ff){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x16d'),_0x2b94ff[_0x1cb9('0xa0')]));return this[_0x1cb9('0xc')]['sayDigits'](_0x2b94ff['digits'][_0x1cb9('0x55')](/\s+/g,''),_0x2b94ff[_0x1cb9('0x164')]);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x16e')]=function(_0xb23d87){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x16f'),_0xb23d87['label']));return this[_0x1cb9('0xc')][_0x1cb9('0x170')](_0xb23d87['number']['replace'](/\s+/g,''),_0xb23d87[_0x1cb9('0x164')]);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x171')]=function(_0x320f39){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x320f39[_0x1cb9('0xa0')]));return this[_0x1cb9('0xc')][_0x1cb9('0x172')](_0x320f39['text'],_0x320f39['escape_digits']);};AGIVertices[_0x1cb9('0xf')]['sendMail']=function(_0x501379){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x173'),_0x501379[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x501379[_0x1cb9('0x174')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0x175'));}var _0x5200a8=this['getMailAccount'][_0x1cb9('0x9d')](this,_0x501379[_0x1cb9('0x174')]);if(!_0x5200a8||!_0x5200a8[_0x1cb9('0x176')]){return this['channel'][_0x1cb9('0x2b')](_0x501379,_0x1cb9('0x177'));}var _0x563527={'from':util[_0x1cb9('0x28')]('\x22%s\x22\x20<%s>',_0x5200a8[_0x1cb9('0x15')],_0x5200a8['email']||_0x5200a8[_0x1cb9('0x176')][_0x1cb9('0x178')]),'to':_0x501379['to']||'','cc':_0x501379['cc']||'','bcc':_0x501379[_0x1cb9('0x179')]||'','subject':_0x501379['subject'],'html':_0x501379[_0x1cb9('0x58')],'text':_0x501379[_0x1cb9('0x58')]};var _0x5987d2={'tls':{'rejectUnauthorized':![]}};if(_0x5200a8[_0x1cb9('0x176')][_0x1cb9('0x17a')]){_0x5987d2[_0x1cb9('0x17a')]=_0x5200a8[_0x1cb9('0x176')]['service'];}else{_0x5987d2[_0x1cb9('0x17b')]=_0x5200a8['Smtp'][_0x1cb9('0x17b')];_0x5987d2[_0x1cb9('0x17c')]=_0x5200a8[_0x1cb9('0x176')][_0x1cb9('0x17c')];_0x5987d2['secure']=_0x5200a8[_0x1cb9('0x176')]['secure'];}if(_0x5200a8[_0x1cb9('0x176')][_0x1cb9('0x17d')]){_0x5987d2[_0x1cb9('0x17e')]={'user':_0x5200a8[_0x1cb9('0x176')][_0x1cb9('0x178')],'pass':_0x5200a8[_0x1cb9('0x176')][_0x1cb9('0x17f')]};}if(this[_0x1cb9('0x7c')](_0x501379[_0x1cb9('0x180')])){}logger[_0x1cb9('0xd3')]('sendMail\x20message',JSON[_0x1cb9('0x70')](_0x563527));this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x501379,_0x501379['account_id']);this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x5200a8[_0x1cb9('0x15')]));this[_0x1cb9('0x22')][_0x1cb9('0x9d')](this,_0x5987d2,_0x563527);return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0x181'));};AGIVertices['prototype'][_0x1cb9('0x182')]=function(_0xc68788){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x183'),_0xc68788['label']));return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x184')]=function(_0x35778c){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x35778c['label']));if(!this[_0x1cb9('0x7c')](_0x35778c[_0x1cb9('0x185')])){return this[_0x1cb9('0xc')]['noop']('no\x20sms\x20account\x20configured');}var _0x408c10=this[_0x1cb9('0x32')][_0x1cb9('0x9d')](this,_0x35778c[_0x1cb9('0x185')]);if(!_0x408c10){return this['channel'][_0x1cb9('0x2b')](_0x35778c,_0x1cb9('0x186'));}var _0x48be0d={'body':_0x35778c[_0x1cb9('0x187')],'phone':_0x35778c['to']||'','SmsAccountId':_0x408c10['id']};logger[_0x1cb9('0xd3')]('sendSMS\x20message',JSON[_0x1cb9('0x70')](_0x48be0d));this[_0x1cb9('0x35')][_0x1cb9('0x9d')](this,_0x35778c,_0x35778c[_0x1cb9('0x185')]);this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x188'),_0x408c10[_0x1cb9('0x15')]));this[_0x1cb9('0x34')][_0x1cb9('0x9d')](this,_0x48be0d);return this['channel'][_0x1cb9('0xab')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x189')]=function(_0x5c4703){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x18a'),_0x5c4703[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x5c4703['variable_id'])){return this['channel'][_0x1cb9('0x2b')](_0x5c4703,_0x1cb9('0x18b'));}var _0x33a0b5=this[_0x1cb9('0x10')][_0x1cb9('0x9d')](this,_0x5c4703[_0x1cb9('0xcc')]);if(!_0x33a0b5){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x5c4703,_0x1cb9('0xcd'));}return this[_0x1cb9('0xc')]['setVariable'](_0x33a0b5,_0x5c4703[_0x1cb9('0x18c')]);};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x18d')]=function(_0x107b44){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x18e'),_0x107b44[_0x1cb9('0xa0')]));this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0x18f'));if(_0x107b44[_0x1cb9('0xa5')]===_0x1cb9('0x190')){this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0x191'));return this[_0x1cb9('0xc')][_0x1cb9('0xa5')]();}return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('Skipped\x20Answer');};AGIVertices[_0x1cb9('0xf')]['subproject']=function(_0x4e0f2c){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x192'),_0x4e0f2c[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x4e0f2c[_0x1cb9('0x193')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x4e0f2c,_0x1cb9('0x194'));}var _0x573c87=this['getSquareProject'][_0x1cb9('0x9d')](this,_0x4e0f2c[_0x1cb9('0x193')]);if(!this['isConfigured'](_0x573c87)){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x4e0f2c,util[_0x1cb9('0x28')](_0x1cb9('0x195'),_0x4e0f2c[_0x1cb9('0x193')]));}if(_0x573c87===this[_0x1cb9('0xc')][_0x1cb9('0x37')]){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x4e0f2c,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x1cb9('0x9d')](this,_0x4e0f2c,_0x573c87);var _0x1ec2e0=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0x196'),util[_0x1cb9('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x1cb9('0x6')][_0x1cb9('0x17b')]||_0x1cb9('0x197'),_0x573c87,this[_0x1cb9('0xc')][_0x1cb9('0x37')]));if(_0x1ec2e0[_0x1cb9('0x9a')]===-0x1){return _0x1ec2e0;}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util['format'](_0x1cb9('0xb0'),_0x1cb9('0x196'),_0x573c87));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x198')]=function(_0x33a43c){logger['info'](util[_0x1cb9('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x33a43c['label']));var _0x42aa32=this[_0x1cb9('0x53')][_0x1cb9('0x9d')](this,_0x33a43c[_0x1cb9('0x199')]);this[_0x1cb9('0x35')]['sync'](this,_0x33a43c,_0x33a43c[_0x1cb9('0x199')]);if(this[_0x1cb9('0x7c')](_0x33a43c['variable_id'])){var _0x2c8331=this['getVariable'][_0x1cb9('0x9d')](this,_0x33a43c[_0x1cb9('0xcc')]);if(_0x2c8331){this[_0x1cb9('0xc')][_0x1cb9('0x95')](_0x2c8331,_0x42aa32);return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x19a'),_0x33a43c[_0x1cb9('0x199')],_0x2c8331));}}return this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x19b'),_0x33a43c[_0x1cb9('0x199')]));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x19c')]=function(_0xfc3517){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x19d'),_0xfc3517['label']));if(!this[_0x1cb9('0x7c')](_0xfc3517['apiKey'])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')]('no\x20apiKey\x20configured');}if(!this[_0x1cb9('0x7c')](_0xfc3517[_0x1cb9('0x58')])){return this['channel'][_0x1cb9('0xab')](_0x1cb9('0xb2'));}this['channel'][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x19e'),_0xfc3517[_0x1cb9('0x58')]));var _0x232855=this['googleCloudTTS'][_0x1cb9('0x9d')](this,_0xfc3517);if(_0x232855){this['channel']['noop'](util[_0x1cb9('0x28')](_0x1cb9('0x19f'),_0x232855));var _0x5a8d27=this[_0x1cb9('0xc')][_0x1cb9('0xec')](_0x232855);try{fs[_0x1cb9('0xed')](_0x232855+_0x1cb9('0xee'));}catch(_0x3dcbe9){logger['error'](_0x3dcbe9);}return _0x5a8d27;}return this[_0x1cb9('0xc')]['error'](_0xfc3517,_0x1cb9('0x1a0'));};AGIVertices[_0x1cb9('0xf')]['tts']=function(_0x1ebd44){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x1a1'),_0x1ebd44['label']));if(!this[_0x1cb9('0x7c')](_0x1ebd44[_0x1cb9('0x58')])){return this[_0x1cb9('0xc')][_0x1cb9('0xab')](_0x1cb9('0xb2'));}this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0x1a2'),_0x1ebd44[_0x1cb9('0x58')]));var _0x2ff2c5=this[_0x1cb9('0x5e')][_0x1cb9('0x9d')](this,_0x1ebd44);if(_0x2ff2c5){this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('Google\x20TTS\x20%s\x20file\x20created',_0x2ff2c5));var _0x51e716=this[_0x1cb9('0xc')][_0x1cb9('0xec')](_0x2ff2c5);try{fs['unlink'](_0x2ff2c5+_0x1cb9('0xee'));}catch(_0x928901){logger['error'](_0x928901);}return _0x51e716;}return this['channel'][_0x1cb9('0x2b')](_0x1ebd44,_0x1cb9('0x1a3'));};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x1a4')]=function(_0x10b2e1){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x1a5'),_0x10b2e1[_0x1cb9('0xa0')]));if(!this[_0x1cb9('0x7c')](_0x10b2e1[_0x1cb9('0x140')])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x10b2e1,'no\x20find\x20by\x20configured');}logger['info'](util[_0x1cb9('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x10b2e1[_0x1cb9('0x140')]));var _0x47b8a9=this[_0x1cb9('0x4d')]['sync'](this,_0x10b2e1[_0x1cb9('0x140')]);if(_0x47b8a9){logger['info'](util[_0x1cb9('0x28')](_0x1cb9('0x143'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x10b2e1[_0x1cb9('0x140')]));this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x10b2e1['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')](_0x1cb9('0x144'),this[_0x1cb9('0xc')]['callerid'],_0x10b2e1[_0x1cb9('0x140')]));this[_0x1cb9('0xc')]['noop'](util[_0x1cb9('0x28')](_0x1cb9('0x144'),this[_0x1cb9('0xc')][_0x1cb9('0x38')],_0x10b2e1[_0x1cb9('0x140')]));return{'code':0xc8,'result':_0x1cb9('0x148')};}};AGIVertices[_0x1cb9('0xf')][_0x1cb9('0x1a6')]=function(_0x13005c){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x13005c['label']));var _0x2803b0=this[_0x1cb9('0xc')][_0x1cb9('0x54')](_0x1cb9('0x1a7'),[_0x13005c[_0x1cb9('0x1a8')],_0x13005c[_0x1cb9('0x74')]]);if(_0x2803b0[_0x1cb9('0x9a')]===-0x1){return _0x2803b0;}return this[_0x1cb9('0xc')][_0x1cb9('0xab')](util[_0x1cb9('0x28')](_0x1cb9('0xb0'),_0x1cb9('0x1a7'),_0x13005c[_0x1cb9('0x1a8')]));};AGIVertices['prototype']['vswitch']=function(_0x329397){logger[_0x1cb9('0x2e')](util[_0x1cb9('0x28')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x329397[_0x1cb9('0xa0')]));if(!this['isConfigured'](_0x329397['variable_id'])){return this[_0x1cb9('0xc')][_0x1cb9('0x2b')](_0x329397,'no\x20variable\x20selected');}var _0x134b91=this[_0x1cb9('0x10')][_0x1cb9('0x9d')](this,_0x329397[_0x1cb9('0xcc')]);if(!_0x134b91){return this[_0x1cb9('0xc')]['error'](_0x329397,_0x1cb9('0xcd'));}var _0x276b48=this[_0x1cb9('0xc')][_0x1cb9('0x10')](_0x134b91);return{'code':0xc8,'result':_0x276b48[_0x1cb9('0x9c')]?_0x276b48[_0x1cb9('0x9c')]:'-'};};String[_0x1cb9('0xf')][_0x1cb9('0x1a9')]=function(_0x297e9d,_0x5bf260){return this[_0x1cb9('0x96')](_0x297e9d)['join'](_0x5bf260);};module[_0x1cb9('0x1aa')]=AGIVertices; \ No newline at end of file +var _0xb43b=['catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getTrunkById','name','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','callerid','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','ispeechTTS','ispeech_tts_language','ispeechASR','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','googleASR','tildeASR','appid','appsecret','uri','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','saveRestApiResult','isPlainObject','%s.%s','replaceObjectAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','setVariable','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','getSound','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','service','host','port','secure','authentication','pass','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','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','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','then','getVoiceQueueById'];(function(_0x829fe4,_0x4dc900){var _0x327cc0=function(_0x3cefe2){while(--_0x3cefe2){_0x829fe4['push'](_0x829fe4['shift']());}};_0x327cc0(++_0x4dc900);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2b2038,_0x36a15b){_0x2b2038=_0x2b2038-0x0;var _0x436249=_0xb43b[_0x2b2038];return _0x436249;};'use strict';var fs=require('fs');var path=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var _=require('lodash');var sh=require(_0xbb43('0x2'));var odbc=require(_0xbb43('0x3'))();var rs=require(_0xbb43('0x4'));var moment=require('moment');var Mustache=require(_0xbb43('0x5'));var rp=require(_0xbb43('0x6'));var logger=require(_0xbb43('0x7'))(_0xbb43('0x8'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0xbb43('0x9');var recursiveMapAttributes=['rawHeaders',_0xbb43('0xa')];var verticesWithRetry=[_0xbb43('0xb'),_0xbb43('0xc'),_0xbb43('0xd')];var AGIVertices=function(_0x364718,_0x4a06f3,_0x208c2b){this[_0xbb43('0xe')]=_0x364718;this['rpc']=_0x4a06f3;this[_0xbb43('0xf')]=_0x208c2b;};AGIVertices[_0xbb43('0x10')][_0xbb43('0x11')]=function(_0x5e3611,_0xfac791){this[_0xbb43('0x12')]['getVariableById'](_0x5e3611)[_0xbb43('0x13')](function(_0x2a5a4d){_0xfac791(null,_0x2a5a4d?_0x2a5a4d['name']:![]);})['catch'](function(_0x41e7e5){_0xfac791(_0x41e7e5);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x438591,_0x5a509f){this[_0xbb43('0x12')][_0xbb43('0x14')](_0x438591)['then'](function(_0x4a6e18){_0x5a509f(null,_0x4a6e18?_0x4a6e18['name']:![]);})[_0xbb43('0x15')](function(_0x2abce0){_0x5a509f(_0x2abce0);});};AGIVertices['prototype']['getSquareProject']=function(_0x202980,_0x563ce1){this['rpc'][_0xbb43('0x16')](_0x202980)[_0xbb43('0x13')](function(_0x2e3b43){_0x563ce1(null,_0x2e3b43?_0x2e3b43['name']:![]);})[_0xbb43('0x15')](function(_0x4f28b8){_0x563ce1(_0x4f28b8);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x17')]=function(_0x4dfc54,_0x5d765b){this[_0xbb43('0x12')][_0xbb43('0x18')](_0x4dfc54)[_0xbb43('0x13')](function(_0x2bf2d4){_0x5d765b(null,_0x2bf2d4?_0x2bf2d4['dsn']:![]);})[_0xbb43('0x15')](function(_0x5f4416){_0x5d765b(_0x5f4416);});};AGIVertices[_0xbb43('0x10')]['getUser']=function(_0x2f5e31,_0x565256){this[_0xbb43('0x12')][_0xbb43('0x19')](_0x2f5e31)['then'](function(_0x1d0768){_0x565256(null,_0x1d0768?_0x1d0768['name']:![]);})[_0xbb43('0x15')](function(_0x298ce2){_0x565256(_0x298ce2);});};AGIVertices[_0xbb43('0x10')]['getTrunk']=function(_0x53f0d5,_0x59a24d){this[_0xbb43('0x12')][_0xbb43('0x1a')](_0x53f0d5)['then'](function(_0x3b3083){_0x59a24d(null,_0x3b3083?_0x3b3083[_0xbb43('0x1b')]:![]);})[_0xbb43('0x15')](function(_0x3874fb){_0x59a24d(_0x3874fb);});};AGIVertices['prototype']['getSound']=function(_0x27fd7a,_0x42800f){var _0xa88db0=this;this[_0xbb43('0x12')][_0xbb43('0x1c')](_0x27fd7a)[_0xbb43('0x13')](function(_0x21d386){_0x42800f(null,_0x21d386?_0xa88db0[_0xbb43('0x1d')](_0x21d386['save_name']):![]);})[_0xbb43('0x15')](function(_0x56fe33){_0x42800f(_0x56fe33);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1e')]=function(_0x34f5b2,_0x1880cd){this['rpc'][_0xbb43('0x1f')](_0x34f5b2)['then'](function(_0x5566cf){_0x1880cd(null,_0x5566cf?_0x5566cf:![]);})['catch'](function(_0x2af898){_0x1880cd(_0x2af898);});};AGIVertices['prototype'][_0xbb43('0x20')]=function(_0x4511d9,_0xc577ac,_0x596a62){this[_0xbb43('0xf')][_0xbb43('0x20')](_0x4511d9,_0xc577ac)[_0xbb43('0x13')](function(){_0x596a62(null);})[_0xbb43('0x15')](function(_0xb16ff6){_0x596a62(_0xb16ff6);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x21')]=function(_0x24375b,_0x4f31ce){this[_0xbb43('0x12')][_0xbb43('0x22')](_0x24375b)[_0xbb43('0x13')](function(_0x244d66){if(_0x244d66){if(_0x244d66[_0xbb43('0x23')]){_0x4f31ce(null,[_0x244d66[_0xbb43('0x24')]]);}else{_0x4f31ce(null,_[_0xbb43('0x25')](_0x244d66[_0xbb43('0x26')],_0xbb43('0x24')));}}else{_0x4f31ce(null,![]);}})[_0xbb43('0x15')](function(_0x21346a){_0x4f31ce(_0x21346a);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1d')]=function(_0x33f45c){return util[_0xbb43('0x27')](_0xbb43('0x28'),FILES_PATH,_0x33f45c);};AGIVertices['prototype'][_0xbb43('0x29')]=function(_0x2d2056,_0x52a694,_0x285014){odbc[_0xbb43('0x2a')](_0x2d2056,function(_0x11d384){if(_0x11d384){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x11d384);_0x285014(_0x11d384);}else{logger['info'](_0xbb43('0x2b'));odbc[_0xbb43('0x2c')](_0x52a694,function(_0x4a95c3,_0x4847df){if(_0x4a95c3){logger[_0xbb43('0x2d')](_0xbb43('0x2e'),_0x52a694);_0x285014(_0x4a95c3);}else{logger[_0xbb43('0x2d')](_0xbb43('0x2f'),_0x52a694);odbc[_0xbb43('0x30')](function(_0x5edacc){if(_0x5edacc){logger[_0xbb43('0x31')](_0xbb43('0x32'),_0x5edacc);}_0x285014(null,_0x4847df);});}});}});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x33')]=function(_0x22fccc,_0x531d96){this[_0xbb43('0x12')]['getSmsAccountById'](_0x22fccc)[_0xbb43('0x13')](function(_0x93aa1c){_0x531d96(null,_0x93aa1c?_0x93aa1c:![]);})['catch'](function(_0x4783fe){_0x531d96(_0x4783fe);});};AGIVertices['prototype'][_0xbb43('0x34')]=function(_0x2d6c99,_0x3d22fc){this[_0xbb43('0x12')]['createSmsMessage'](_0x2d6c99)[_0xbb43('0x13')](function(_0x136bd4){_0x3d22fc(null,_0x136bd4);})['catch'](function(_0x3443f8){_0x3d22fc(_0x3443f8);});};AGIVertices['prototype'][_0xbb43('0x35')]=function(_0x14285d,_0xcb5000,_0x14e57e){this[_0xbb43('0x12')][_0xbb43('0x35')]({'uniqueid':this['channel'][_0xbb43('0x36')],'node':_0x14285d['label'],'application':_0x14285d[_0xbb43('0x37')],'data':_0xcb5000||null,'project_name':this[_0xbb43('0xe')][_0xbb43('0x38')],'callerid':this[_0xbb43('0xe')]['callerid']})[_0xbb43('0x13')](function(_0x39f75f){if(_0x14e57e){_0x14e57e(null,_0x39f75f);}})[_0xbb43('0x15')](function(_0x24ba15){if(_0x14e57e){_0x14e57e(_0x24ba15);}});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x39')]=function(_0x40f519,_0x3592fb,_0x5a662b,_0x2eaece){this[_0xbb43('0x12')]['createSquareRecording']({'uniqueid':this[_0xbb43('0xe')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0xbb43('0x3a')],'context':this['channel'][_0xbb43('0x3b')],'extension':this['channel'][_0xbb43('0x3c')],'priority':this[_0xbb43('0xe')][_0xbb43('0x3d')],'accountcode':this['channel'][_0xbb43('0x3e')],'dnid':this['channel'][_0xbb43('0x3f')],'projectName':this[_0xbb43('0xe')][_0xbb43('0x38')],'saveName':_0x3592fb,'filename':_0x40f519[_0xbb43('0x40')]||_0x3592fb,'savePath':_0x5a662b})[_0xbb43('0x13')](function(_0x13d0a5){_0x2eaece(null,_0x13d0a5);})[_0xbb43('0x15')](function(_0x5ee191){_0x2eaece(_0x5ee191);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x41')]=function(_0x202059,_0x271abb,_0x4bea2a){this[_0xbb43('0x12')][_0xbb43('0x41')]({'uniqueid':this[_0xbb43('0xe')][_0xbb43('0x36')],'body':_0x202059,'direction':_0x271abb})['then'](function(_0x3206c0){if(_0x4bea2a){_0x4bea2a(null,_0x3206c0);}})[_0xbb43('0x15')](function(_0x427618){if(_0x4bea2a){_0x4bea2a(_0x427618);}});};AGIVertices['prototype'][_0xbb43('0x42')]=function(_0x2a8a93,_0x73d4ce){this[_0xbb43('0x12')][_0xbb43('0x42')]({'firstName':_['isEmpty'](_0x2a8a93['name'])||_[_0xbb43('0x43')](_0x2a8a93['name'])?_0xbb43('0x44')+Math[_0xbb43('0x45')]():_0x2a8a93['name'],'lastName':_[_0xbb43('0x46')](_0x2a8a93[_0xbb43('0x47')])||_[_0xbb43('0x43')](_0x2a8a93[_0xbb43('0x47')])?null:_0x2a8a93[_0xbb43('0x47')],'phone':_0x2a8a93['phone'],'ListId':_0x2a8a93[_0xbb43('0x48')],'scheduledAt':_0x2a8a93['scheduledAt'],'callbackUniqueid':this['channel'][_0xbb43('0x36')],'tags':_0xbb43('0x49'),'description':_0xbb43('0x4a')+_0x2a8a93[_0xbb43('0x4b')][_0xbb43('0x4c')](),'priority':_0x2a8a93['callback_priority']})['then'](function(_0x40c20f){_0x73d4ce(null,_0x40c20f);})[_0xbb43('0x15')](function(_0x3a84ad){_0x73d4ce(_0x3a84ad);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x4d')]=function(_0x38d540,_0x44691b){this[_0xbb43('0x12')][_0xbb43('0x4e')](_0x38d540)['then'](function(_0x1b6f96){_0x44691b(null,_0x1b6f96?_0x1b6f96[_0xbb43('0x1b')]:![]);})[_0xbb43('0x15')](function(_0x3675d9){_0x44691b(_0x3675d9);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x4f')]=function(_0x3f7262,_0x3589fd,_0x3e01e4){var _0x49a54e={'role':'agent'};_0x49a54e[_0x3f7262]=this[_0xbb43('0xe')][_0xbb43('0x50')];this[_0xbb43('0x12')][_0xbb43('0x4f')](_0x49a54e,_0x3589fd,this[_0xbb43('0xe')][_0xbb43('0x36')])[_0xbb43('0x13')](function(_0x51d702){_0x3e01e4(null,_[_0xbb43('0x43')](_0x51d702)?![]:!![]);})['catch'](function(_0x5a6ff0){logger[_0xbb43('0x31')](_0x5a6ff0);_0x3e01e4(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x51')]=function(_0x22ce17,_0x24393a){var _0x4347b6={'role':_0xbb43('0x52')};_0x4347b6[_0x22ce17]=this[_0xbb43('0xe')]['callerid'];this['rpc'][_0xbb43('0x51')](_0x4347b6)[_0xbb43('0x13')](function(_0x137e75){_0x24393a(null,_[_0xbb43('0x43')](_0x137e75)?![]:!![]);})[_0xbb43('0x15')](function(_0x2ccacf){logger[_0xbb43('0x31')](_0x2ccacf);_0x24393a(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x53')]=function(_0x555426,_0x165936){var _0x392d1a={'role':_0xbb43('0x52')};_0x392d1a[_0x555426]=this[_0xbb43('0xe')][_0xbb43('0x50')];this[_0xbb43('0x12')]['agentLogout'](_0x392d1a)[_0xbb43('0x13')](function(_0xb48be2){_0x165936(null,_[_0xbb43('0x43')](_0xb48be2)?![]:!![]);})[_0xbb43('0x15')](function(_0xc34a02){logger['error'](_0xc34a02);_0x165936(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x54')]=function(_0xd3dcfc,_0x231b11){var _0x12c765={'role':_0xbb43('0x52')};_0x12c765[_0xd3dcfc]=this[_0xbb43('0xe')][_0xbb43('0x50')];var _0x10fd8b=_0xd3dcfc!=_0xbb43('0x55')?util['format'](_0xbb43('0x56'),'LOCAL',this[_0xbb43('0xe')][_0xbb43('0x50')]):undefined;this[_0xbb43('0x12')][_0xbb43('0x54')](_0x12c765,_0x10fd8b)[_0xbb43('0x13')](function(_0x5cbdb4){_0x231b11(null,_['isNil'](_0x5cbdb4)?![]:!![]);})[_0xbb43('0x15')](function(_0xa22c95){logger['error'](_0xa22c95);_0x231b11(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x57')]=function(_0x41d26a,_0x52ca51){sh[_0xbb43('0x58')](_[_0xbb43('0x59')](_0x41d26a),function(_0x3b89ec,_0x42a737){var _0x5fd9db=_0x42a737[_0xbb43('0x5a')](/(\r\n|\n|\r)/gm,'');_0x52ca51(null,_0x5fd9db);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x5b')]=function(_0x6a258,_0x26509c){scripts['googleCloudTTS'](_0x6a258['apiKey'],_0x6a258[_0xbb43('0x5c')]||_0xbb43('0x5d'),_0x6a258[_0xbb43('0x5d')],_0x6a258['languageCode']||_0xbb43('0x5e'),_0x6a258[_0xbb43('0x5f')]||_0xbb43('0x60'),_0x6a258[_0xbb43('0x61')]||_0xbb43('0x62'))['then'](function(_0x3925f9){_0x26509c(null,_0x3925f9);})[_0xbb43('0x15')](function(_0x4333b2){_0x26509c(_0x4333b2);});};AGIVertices['prototype'][_0xbb43('0x63')]=function(_0x30c42d,_0x3e4619){scripts[_0xbb43('0x63')](_0x30c42d[_0xbb43('0x5d')],_0x30c42d[_0xbb43('0x64')]||'en',0x1)[_0xbb43('0x13')](function(_0x1df6d5){_0x3e4619(null,_0x1df6d5);})[_0xbb43('0x15')](function(_0x2e21c3){_0x3e4619(_0x2e21c3);});};AGIVertices[_0xbb43('0x10')]['restAPI']=function(_0x1cc1cb,_0x29abcd){var _0x2d439f={'uri':_0x1cc1cb[_0xbb43('0x65')],'method':_0x1cc1cb[_0xbb43('0x66')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1cc1cb['timeout'])==='number'&&parseInt(_0x1cc1cb['timeout'])>=0x1?parseInt(_0x1cc1cb[_0xbb43('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xbb43('0x68')]([_0xbb43('0x69'),_0xbb43('0x6a')],_0x2d439f[_0xbb43('0x66')][_0xbb43('0x6b')]())){try{_0x2d439f[_0xbb43('0x6c')]=_0x1cc1cb['rawBody']?JSON[_0xbb43('0x6d')](_0x1cc1cb[_0xbb43('0xa')]):{};}catch(_0x3901c6){logger['error'](_0xbb43('0x6e'),_0x3901c6);}}try{_0x2d439f['headers']=_0x1cc1cb[_0xbb43('0x6f')]?JSON['parse'](_0x1cc1cb[_0xbb43('0x6f')]):{};}catch(_0x17e939){logger[_0xbb43('0x31')](_0xbb43('0x70'),_0x17e939);}if(_0x1cc1cb[_0xbb43('0x71')]){try{var _0x367311=require(_0x1cc1cb[_0xbb43('0x71')])[_0xbb43('0x72')](this,_0x2d439f);_0x2d439f['uri']=Mustache[_0xbb43('0x73')](_0x1cc1cb[_0xbb43('0x65')],_0x367311,{},['$$','$$']);if(_0x2d439f['headers']){_0x2d439f[_0xbb43('0x74')]=JSON[_0xbb43('0x6d')](Mustache[_0xbb43('0x73')](JSON['stringify'](_0x2d439f[_0xbb43('0x74')]),_0x367311,{},['$$','$$']));}if(_0x2d439f[_0xbb43('0x6c')]){_0x2d439f[_0xbb43('0x6c')]=JSON[_0xbb43('0x6d')](Mustache[_0xbb43('0x73')](JSON[_0xbb43('0x75')](_0x2d439f['body']),_0x367311,{},['$$','$$']));}}catch(_0x12dd81){logger['error'](_0xbb43('0x76'),_0x12dd81);}}rp(_0x2d439f)[_0xbb43('0x13')](function(_0x4b2a47){var _0x3e2e84={'statusCode':_0x4b2a47[_0xbb43('0x77')]||0xc8,'statusMessage':_0x4b2a47['statusMessage']||'OK','headers':_0x4b2a47['headers']||{},'body':_0x4b2a47[_0xbb43('0x6c')]||{}};_0x29abcd(null,_0x3e2e84);})[_0xbb43('0x15')](function(_0x29c80c){var _0x3d9154={'statusCode':_0x29c80c[_0xbb43('0x77')]||0x1f4,'statusMessage':_0x29c80c[_0xbb43('0x78')]||_0xbb43('0x79'),'headers':_0x29c80c[_0xbb43('0x7a')][_0xbb43('0x74')]||{},'body':_0x29c80c[_0xbb43('0x7a')]['body']||{}};_0x29abcd(null,_0x3d9154);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x7b')]=function(_0xdaeb62,_0x5b2892){scripts['googleDialogflow'](this[_0xbb43('0xe')][_0xbb43('0x36')],_0xdaeb62[_0xbb43('0x7c')],_0xdaeb62[_0xbb43('0x5d')],_0xdaeb62['dialogflow_language']||'en')[_0xbb43('0x13')](function(_0x5c1012){_0x5b2892(null,_0x5c1012);})[_0xbb43('0x15')](function(_0x8dec5f){_0x5b2892(_0x8dec5f);});};AGIVertices[_0xbb43('0x10')]['sestekNDA']=function(_0x1451ec,_0x144f67){scripts['sestekNDA'](this['channel'],_0x1451ec)[_0xbb43('0x13')](function(_0x2a2c1c){_0x144f67(null,_0x2a2c1c);})[_0xbb43('0x15')](function(_0x91e289){_0x144f67(_0x91e289);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x7d')]=function(_0x32a2ae,_0x15adc6){scripts['ispeechTTS'](_0x32a2ae[_0xbb43('0x7c')],_0x32a2ae[_0xbb43('0x5d')],_0x32a2ae[_0xbb43('0x7e')]||_0xbb43('0x5e'),_0x32a2ae['speed'])[_0xbb43('0x13')](function(_0x58bc68){_0x15adc6(null,_0x58bc68);})['catch'](function(_0x11659e){_0x15adc6(_0x11659e);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x7f')]=function(_0x4fe4d6,_0x4f754a,_0x4ef475){scripts[_0xbb43('0x7f')](_0x4f754a,_0x4fe4d6[_0xbb43('0x7c')],_0x4fe4d6[_0xbb43('0x80')]||_0xbb43('0x5e'),this[_0xbb43('0x81')](_0x4fe4d6['model'])?_0x4fe4d6[_0xbb43('0x82')]:undefined)['then'](function(_0x2eba11){_0x4ef475(null,_0x2eba11);})['catch'](function(_0x56b70c){_0x4ef475(_0x56b70c);});};AGIVertices['prototype'][_0xbb43('0x83')]=function(_0xc2d45,_0x594d01){scripts[_0xbb43('0x83')](_0xc2d45[_0xbb43('0x84')],_0xc2d45[_0xbb43('0x85')],_0xc2d45[_0xbb43('0x86')],_0xc2d45[_0xbb43('0x87')]||_0xbb43('0x88'),_0xc2d45[_0xbb43('0x5d')],_0xc2d45[_0xbb43('0x89')]||_0xbb43('0x5d'))[_0xbb43('0x13')](function(_0x20f767){_0x594d01(null,_0x20f767);})['catch'](function(_0x3c5455){_0x594d01(_0x3c5455);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x8a')]=function(_0x1ff201,_0x1dc30b){scripts[_0xbb43('0x8a')](this[_0xbb43('0xe')][_0xbb43('0x36')],_0x1ff201[_0xbb43('0x84')],_0x1ff201[_0xbb43('0x85')],_0x1ff201[_0xbb43('0x8b')],_0x1ff201['text'],_0x1ff201['aws_bot_name'])[_0xbb43('0x13')](function(_0x354506){_0x1dc30b(null,_0x354506);})['catch'](function(_0x33fe68){_0x1dc30b(_0x33fe68);});};AGIVertices['prototype'][_0xbb43('0x8c')]=function(_0x4683ce,_0x436b48,_0x2c9cdf){scripts[_0xbb43('0x8c')](_0x436b48,_0x4683ce[_0xbb43('0x7c')],_0x4683ce['google_asr_language']||_0xbb43('0x5e'))[_0xbb43('0x13')](function(_0x11b15a){_0x2c9cdf(null,_0x11b15a);})[_0xbb43('0x15')](function(_0x380530){_0x2c9cdf(_0x380530);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x8d')]=function(_0x23e216,_0x1d5d01,_0x32ce38){scripts[_0xbb43('0x8d')](_0x1d5d01,_0x23e216[_0xbb43('0x8e')],_0x23e216[_0xbb43('0x8f')],_0x23e216[_0xbb43('0x90')])[_0xbb43('0x13')](function(_0x4af69c){_0x32ce38(null,_0x4af69c);})[_0xbb43('0x15')](function(_0x3cf923){_0x32ce38(_0x3cf923);});};AGIVertices['prototype']['clear']=function(_0x28ba92){var _0x5560d0=_['includes'](verticesWithRetry,_0x28ba92[_0xbb43('0x37')])?_0x28ba92:_['clone'](_0x28ba92);for(var _0x395dfe in _0x5560d0){if(_0x5560d0[_0xbb43('0x91')](_0x395dfe)){if(_0x5560d0[_0x395dfe]&&_[_0xbb43('0x92')](_0x5560d0[_0x395dfe])){if(_[_0xbb43('0x68')](recursiveMapAttributes,_0x395dfe)){_0x5560d0[_0x395dfe]=this['replaceObjectAllVariables'](_0x5560d0[_0x395dfe]);}else{_0x5560d0[_0x395dfe]=this[_0xbb43('0x93')](_0x5560d0[_0x395dfe]);}}}}return _0x5560d0;};AGIVertices[_0xbb43('0x10')][_0xbb43('0x94')]=function(_0x5c65a1){for(var _0x263d28 in _0x5c65a1){if(_0x5c65a1[_0xbb43('0x91')](_0x263d28)){if(_['isPlainObject'](_0x5c65a1[_0x263d28])){return this[_0xbb43('0x94')](_0x5c65a1[_0x263d28]);}_0x5c65a1[_0x263d28]=this[_0xbb43('0x93')](_0x5c65a1[_0x263d28]);}}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x95')]=function(_0x61ff2f,_0x43a596){for(var _0x457e5b in _0x61ff2f){if(_0x61ff2f[_0xbb43('0x91')](_0x457e5b)){if(_[_0xbb43('0x96')](_0x61ff2f[_0x457e5b])){if(!_[_0xbb43('0x46')](_0x61ff2f[_0x457e5b])){this[_0xbb43('0x95')](_0x61ff2f[_0x457e5b],util[_0xbb43('0x27')](_0xbb43('0x97'),_0x43a596,_0x457e5b));}}else{if(_0x61ff2f[_0x457e5b]){this[_0xbb43('0xe')]['setVariable'](util[_0xbb43('0x27')](_0xbb43('0x97'),_0x43a596,_0x457e5b),_0x61ff2f[_0x457e5b]);}}}}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x98')]=function(_0x50be32){try{var _0x242f05=JSON[_0xbb43('0x6d')](_0x50be32);this[_0xbb43('0x94')](_0x242f05);return JSON[_0xbb43('0x75')](_0x242f05);}catch(_0x3dc08f){return this['replaceAllVariables'](_0x50be32);}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x93')]=function(_0x5d881a){var _0x4686d0=_0x5d881a[_0xbb43('0x99')]('{');for(var _0x53400d=0x1;_0x53400d<_0x4686d0[_0xbb43('0x9a')];_0x53400d+=0x1){var _0x417cbd=_0x4686d0[_0x53400d][_0xbb43('0x99')]('}');if(_0x417cbd[_0xbb43('0x9a')]>0x1){_0x5d881a=_0x5d881a[_0xbb43('0x9b')]('{'+_0x417cbd[0x0]+'}',this['channel'][_0xbb43('0x11')](_0x417cbd[0x0])[_0xbb43('0x9c')]||_0x417cbd[0x0]);}}if(_0x4686d0[_0xbb43('0x9a')]===0x1){return _0x5d881a[_0xbb43('0x4c')]();}return this[_0xbb43('0x93')](_0x5d881a);};AGIVertices['prototype'][_0xbb43('0x9d')]=function(_0x5e7c8b,_0x5eef5b){var _0x247002=this[_0xbb43('0xe')][_0xbb43('0x11')](_0x5e7c8b);if(_0x247002[_0xbb43('0x9e')]===-0x1){return _0x247002;}logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5eef5b,_0x247002['extra']));return this['channel'][_0xbb43('0x9f')](_0x5eef5b,_0x247002[_0xbb43('0x9c')]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x81')]=function(_0x10b34b){return _0x10b34b&&_0x10b34b!=='0'&&_0x10b34b!=='-1'&&_0x10b34b!=='';};AGIVertices[_0xbb43('0x10')][_0xbb43('0xa0')]=function(_0x1c6d98){this['createSquareDetailsReport'][_0xbb43('0x72')](this,_0x1c6d98,'-');_0x1c6d98['retry']=_0x1c6d98[_0xbb43('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbb43('0x10')][_0xbb43('0x8')]=function(_0x47135b){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xa1'),_0x47135b[_0xbb43('0xa2')]));return this[_0xbb43('0xe')]['agi']([_0x47135b[_0xbb43('0xa3')],_0x47135b[_0xbb43('0xa4')]]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0xa5')]=function(_0x53549d){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0xa6'),_0x53549d[_0xbb43('0xa2')]));if(this[_0xbb43('0x81')](_0x53549d[_0xbb43('0x67')])){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xa7'),_0x53549d[_0xbb43('0x67')]));var _0xc4893f=this['channel'][_0xbb43('0xa8')](_0x53549d[_0xbb43('0x67')]);if(_0xc4893f[_0xbb43('0x9e')]===-0x1){return _0xc4893f;}}return this['channel'][_0xbb43('0xa5')]();};AGIVertices['prototype']['callback']=function(_0x12d058){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0xa9'),_0x12d058['label']));if(!this[_0xbb43('0x81')](_0x12d058[_0xbb43('0x48')])){return this[_0xbb43('0xe')]['error'](_0x12d058,'no\x20list\x20selected');}_0x12d058['scheduledAt']=moment();if(this[_0xbb43('0x81')](_0x12d058[_0xbb43('0xaa')])){_0x12d058[_0xbb43('0x4b')]=moment()[_0xbb43('0xab')](_0x12d058[_0xbb43('0xaa')],'minutes');}if(!this[_0xbb43('0x81')](_0x12d058[_0xbb43('0xac')])){_0x12d058[_0xbb43('0xac')]=0x2;}this[_0xbb43('0x42')][_0xbb43('0x72')](this,_0x12d058);return this[_0xbb43('0xe')]['noop'](util['format'](_0xbb43('0xad'),_0x12d058[_0xbb43('0xae')],_0x12d058['list_id'],_0x12d058['scheduledAt']));};AGIVertices[_0xbb43('0x10')]['custom_app']=function(_0x20d7cd){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xaf'),_0x20d7cd['label']));var _0x19b2bb=this[_0xbb43('0xe')][_0xbb43('0x58')](_0x20d7cd[_0xbb43('0xb0')],_0x20d7cd[_0xbb43('0x7a')]);if(_0x19b2bb[_0xbb43('0x9e')]===-0x1){return _0x19b2bb;}return this['channel']['noop'](util[_0xbb43('0x27')](_0xbb43('0xb1'),_0x20d7cd[_0xbb43('0xb0')],_0x20d7cd[_0xbb43('0x7a')]));};AGIVertices[_0xbb43('0x10')]['lumenvoxtts']=function(_0x5b27b5){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xb2'),_0x5b27b5['label']));if(!this[_0xbb43('0x81')](_0x5b27b5[_0xbb43('0x5d')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xb3'));}var _0x4b3beb='\x22'+_0x5b27b5[_0xbb43('0x5d')]+'\x22';if(this[_0xbb43('0x81')](_0x5b27b5[_0xbb43('0x7a')])){_0x4b3beb+=','+_0x5b27b5['options'];}var _0x449d91=this[_0xbb43('0xe')][_0xbb43('0x58')](_0xbb43('0xb4'),_0x4b3beb);if(_0x449d91[_0xbb43('0x9e')]===-0x1){return _0x449d91;}return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xb6'),_0x4b3beb));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xb7')]=function(_0x25357a){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x25357a[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x25357a[_0xbb43('0x5d')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xb3'));}var _0x1091fa='\x22'+_0x25357a[_0xbb43('0x5d')]+'\x22';if(this[_0xbb43('0x81')](_0x25357a[_0xbb43('0x7a')])){_0x1091fa+=','+_0x25357a[_0xbb43('0x7a')];}var _0x2d2127=this[_0xbb43('0xe')][_0xbb43('0x58')](_0xbb43('0xb4'),_0x1091fa);if(_0x2d2127[_0xbb43('0x9e')]===-0x1){return _0x2d2127;}return this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1091fa));};AGIVertices['prototype'][_0xbb43('0xb8')]=function(_0x1be4de){logger['info'](util['format'](_0xbb43('0xb9'),_0x1be4de[_0xbb43('0xa2')]));if(!this['isConfigured'](_0x1be4de[_0xbb43('0xba')])){return this['channel'][_0xbb43('0xb5')]('no\x20grammar\x20configured');}var _0x9fbe45=_0x1be4de[_0xbb43('0xba')];if(this['isConfigured'](_0x1be4de[_0xbb43('0x7a')])){_0x9fbe45+=','+_0x1be4de[_0xbb43('0x7a')];}var _0x1ae77c=this[_0xbb43('0xe')][_0xbb43('0x58')]('MRCPRecog',_0x9fbe45);if(_0x1ae77c[_0xbb43('0x9e')]===-0x1){return _0x1ae77c;}var _0x240d76=this[_0xbb43('0x9d')](_0xbb43('0xbb'),_0xbb43('0xbc'));if(_0x240d76['result']===-0x1){return _0x240d76;}var _0x37ef31=this[_0xbb43('0x9d')](_0xbb43('0xbd'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x37ef31['result']===-0x1){return _0x37ef31;}var _0x28a9a0=this[_0xbb43('0x9d')](_0xbb43('0xbe'),'LUMENVOX_ASR_INSTANCE');if(_0x28a9a0['result']===-0x1){return _0x28a9a0;}return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xbf'),_0x9fbe45));};AGIVertices[_0xbb43('0x10')]['sestekasr']=function(_0x41238f){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xc0'),_0x41238f[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x41238f['grammar'])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xc1'));}var _0x5166b9=_0x41238f[_0xbb43('0xba')];if(this['isConfigured'](_0x41238f[_0xbb43('0x7a')])){_0x5166b9+=','+_0x41238f[_0xbb43('0x7a')];}var _0x8bff1b=this[_0xbb43('0xe')]['exec'](_0xbb43('0xc2'),_0x5166b9);if(_0x8bff1b['result']===-0x1){return _0x8bff1b;}var _0x108ac8=this[_0xbb43('0x9d')](_0xbb43('0xbb'),_0xbb43('0xc3'));if(_0x108ac8[_0xbb43('0x9e')]===-0x1){return _0x108ac8;}var _0x532596=this[_0xbb43('0x9d')](_0xbb43('0xbd'),_0xbb43('0xc4'));if(_0x532596[_0xbb43('0x9e')]===-0x1){return _0x532596;}var _0xb8b5c5=this['getAndSetVariable'](_0xbb43('0xbe'),_0xbb43('0xc5'));if(_0xb8b5c5[_0xbb43('0x9e')]===-0x1){return _0xb8b5c5;}return this['channel'][_0xbb43('0xb5')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x5166b9));};AGIVertices['prototype']['database']=function(_0x44b3de){logger['info'](util[_0xbb43('0x27')](_0xbb43('0xc6'),_0x44b3de[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x44b3de['odbc_id'])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x44b3de,'no\x20database\x20selected');}var _0x166faa=this[_0xbb43('0x17')]['sync'](this,_0x44b3de['odbc_id']);if(!_0x166faa){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x44b3de,_0xbb43('0xc7'));}if(!this['isConfigured'](_0x44b3de[_0xbb43('0x2c')])){return this['channel'][_0xbb43('0x31')](_0x44b3de,_0xbb43('0xc8'));}var _0x44ddc0=_0x44b3de[_0xbb43('0x2c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xc9'),_0x44ddc0));var _0x20040b=this['getQueryOdbc'][_0xbb43('0x72')](this,_0x166faa,_0x44ddc0);this[_0xbb43('0x35')]['sync'](this,_0x44b3de,_0x44ddc0);if(!this['isConfigured'](_0x44b3de[_0xbb43('0xca')])){return this['channel'][_0xbb43('0xb5')](_0xbb43('0xcb'));}var _0x36fddb=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x44b3de[_0xbb43('0xca')]);if(!_0x36fddb){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x44b3de,_0xbb43('0xcc'));}var _0x4482e0=this;_0x20040b['forEach'](function(_0xaacd35,_0x30be3){Object[_0xbb43('0xcd')](_0xaacd35)['forEach'](function(_0x341065){_0x4482e0[_0xbb43('0xe')][_0xbb43('0x9f')](util[_0xbb43('0x27')](_0xbb43('0xce'),_0x36fddb,_0x30be3,_0x341065),_0xaacd35[_0x341065]);});});this['channel'][_0xbb43('0x9f')](util['format']('%s_ROWS_COUNT',_0x36fddb),_0x20040b['length']);return this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xcf'),_0x36fddb));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xd0')]=function(_0x407fdb){logger[_0xbb43('0xd1')](util['format'](_0xbb43('0xd2'),_0x407fdb[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x407fdb[_0xbb43('0xd3')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x407fdb,_0xbb43('0xd4'));}var _0x33c4cb=this[_0xbb43('0xd5')][_0xbb43('0x72')](this,_0x407fdb[_0xbb43('0xd3')]);if(!_0x33c4cb){return this['channel']['error'](_0x407fdb,_0xbb43('0xd6'));}var _0xf305a6=this[_0xbb43('0xe')][_0xbb43('0x58')]('DIAL',[util[_0xbb43('0x27')](_0xbb43('0xd7'),_0x33c4cb),_0x407fdb[_0xbb43('0x67')],_0x407fdb[_0xbb43('0xd8')],_0x407fdb['url']]);if(_0xf305a6['result']===-0x1){return _0xf305a6;}return this[_0xbb43('0xe')]['noop'](util['format'](_0xbb43('0xd9'),_0xbb43('0xda')));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xdb')]=function(_0x514d1d){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xdc'),_0x514d1d['label']));if(!this[_0xbb43('0x81')](_0x514d1d[_0xbb43('0x7c')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xdd'));}if(!this[_0xbb43('0x81')](_0x514d1d['text'])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xb3'));}this[_0xbb43('0xe')][_0xbb43('0xde')]=!![];this[_0xbb43('0x35')](_0x514d1d);this[_0xbb43('0x41')](_0x514d1d[_0xbb43('0x5d')],'in');this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')]('Trying\x20Dialogflow:\x20%s',_0x514d1d[_0xbb43('0x5d')]));var _0x94f837=this[_0xbb43('0x7b')][_0xbb43('0x72')](this,_0x514d1d);if(_0x94f837){for(var _0x174660 in _0x94f837){if(_0x94f837[_0xbb43('0x91')](_0x174660)){this[_0xbb43('0xe')][_0xbb43('0x9f')](util['format'](_0xbb43('0xdf'),_0x174660[_0xbb43('0x6b')]()),_0x94f837[_0x174660]);}}this[_0xbb43('0x41')](_0x94f837[_0xbb43('0xe0')],'out');return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xe1'),_0x94f837[_0xbb43('0xe0')]));}return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x514d1d,_0xbb43('0xe2'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xe3')]=function(_0x4ce374){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xe4'),_0x4ce374['label']));if(!this[_0xbb43('0x81')](_0x4ce374[_0xbb43('0xe5')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xe6'));}if(!this['isConfigured'](_0x4ce374[_0xbb43('0xe7')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xe8'));}if(!this[_0xbb43('0x81')](_0x4ce374[_0xbb43('0xe9')])){return this['channel'][_0xbb43('0xb5')](_0xbb43('0xea'));}if(!this[_0xbb43('0x81')](_0x4ce374[_0xbb43('0xeb')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xb3'));}this[_0xbb43('0xe')][_0xbb43('0xde')]=!![];this[_0xbb43('0x35')](_0x4ce374);this[_0xbb43('0x41')](_0x4ce374[_0xbb43('0x5d')],'in');this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format'](_0xbb43('0xec'),_0x4ce374[_0xbb43('0x5d')]));var _0x1baf8c=this[_0xbb43('0xed')][_0xbb43('0x72')](this,_0x4ce374);if(_0x1baf8c){for(var _0x2a6a38 in _0x1baf8c){if(_0x1baf8c['hasOwnProperty'](_0x2a6a38)){this[_0xbb43('0xe')][_0xbb43('0x9f')](util[_0xbb43('0x27')](_0xbb43('0xee'),_0x2a6a38[_0xbb43('0x6b')]()),_0x1baf8c[_0x2a6a38]);}}this[_0xbb43('0x41')](_0x1baf8c[_0xbb43('0xe0')],_0xbb43('0xef'));if(_0x1baf8c[_0xbb43('0xf0')]){this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xf1'),_0x1baf8c[_0xbb43('0xf0')]));var _0x3ca593=this['channel'][_0xbb43('0xf2')](_0x1baf8c['audiofile']);try{fs['unlink'](_0x1baf8c['audiofile']+_0xbb43('0xf3'));}catch(_0x340adb){logger['error'](_0x340adb);}return _0x3ca593;}else{return this['channel'][_0xbb43('0xb5')](util['format'](_0xbb43('0xf4'),_0x1baf8c[_0xbb43('0xe0')]));}}return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x4ce374,_0xbb43('0xf5'));};AGIVertices['prototype'][_0xbb43('0xf6')]=function(_0x977139){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0xf7'),_0x977139[_0xbb43('0xa2')]));return this['channel'][_0xbb43('0xb5')](_0xbb43('0xf6'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xf8')]=function(_0x40ca42){logger['info'](util[_0xbb43('0x27')](_0xbb43('0xf9'),_0x40ca42[_0xbb43('0xa2')]));var _0x435238='';if(_0x40ca42[_0xbb43('0xfa')]){if(!this[_0xbb43('0x81')](_0x40ca42[_0xbb43('0xfa')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x40ca42,'no\x20trunk\x20selected');}else{var _0x31534a=parseInt(_0x40ca42[_0xbb43('0xfa')],0xa);if(isNaN(_0x31534a)){_0x435238=_0x40ca42[_0xbb43('0xfa')];}else{_0x435238=this[_0xbb43('0xfb')][_0xbb43('0x72')](this,_0x40ca42[_0xbb43('0xfa')]);if(!_0x435238){return this[_0xbb43('0xe')]['error'](_0x40ca42,_0xbb43('0xfc'));}}}}else if(_0x40ca42['trunk_name']){_0x435238=_0x40ca42[_0xbb43('0xfd')];}else{return this['channel'][_0xbb43('0x31')](_0x40ca42,_0xbb43('0xfe'));}var _0x3c6d0e=this[_0xbb43('0xe')][_0xbb43('0x58')]('DIAL',[util['format']('SIP/%s/%s',_0x435238,_0x40ca42[_0xbb43('0xae')]),_0x40ca42[_0xbb43('0x67')],_0x40ca42['opts'],_0x40ca42['url']]);if(_0x3c6d0e[_0xbb43('0x9e')]===-0x1){return _0x3c6d0e;}return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xd9'),'DIAL'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xff')]=function(_0x5651d0){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x100'),_0x5651d0[_0xbb43('0xa2')]));return this['channel'][_0xbb43('0xb5')]('finally');};AGIVertices[_0xbb43('0x10')][_0xbb43('0xc')]=function(_0x32448c){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x32448c[_0xbb43('0xa2')]));if(_0x32448c[_0xbb43('0x101')]===0x0){return this[_0xbb43('0xa0')](_0x32448c);}_0x32448c[_0xbb43('0x101')]-=0x1;if(!this[_0xbb43('0x81')](_0x32448c['file_id'])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x32448c,'no\x20file\x20audio\x20selected');}var _0x4f26e8=this[_0xbb43('0x102')][_0xbb43('0x72')](this,_0x32448c['file_id']);if(!_0x4f26e8){return this['channel'][_0xbb43('0x31')](_0x32448c,_0xbb43('0x103'));}if(!this[_0xbb43('0x81')](_0x32448c[_0xbb43('0xca')])){return this['channel'][_0xbb43('0x31')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2bf4d2=this[_0xbb43('0xe')][_0xbb43('0x104')](_0x4f26e8,_0x32448c['response'],_0x32448c[_0xbb43('0x105')]);var _0x584f8a=_0x2bf4d2[_0xbb43('0x9e')]?_0x2bf4d2[_0xbb43('0x9e')][_0xbb43('0x4c')]():'';logger[_0xbb43('0x2d')](_0xbb43('0x106'),JSON['stringify'](_0x2bf4d2));if(_0x2bf4d2[_0xbb43('0x9e')]===-0x1){this['createSquareDetailsReport'][_0xbb43('0x72')](this,_0x32448c,_0x584f8a);return _0x2bf4d2;}else if(_0x2bf4d2[_0xbb43('0x9c')]===_0xbb43('0x67')){_0x2bf4d2[_0xbb43('0x9e')]=_0x584f8a['length']>=parseInt(_0x32448c[_0xbb43('0x107')])?'x':'i';}else{_0x2bf4d2[_0xbb43('0x9e')]=_0x584f8a['length']>=parseInt(_0x32448c[_0xbb43('0x107')])&&_0x584f8a['length']<=parseInt(_0x32448c[_0xbb43('0x105')])?'x':'i';}var _0x68f023=this[_0xbb43('0x11')]['sync'](this,_0x32448c['variable_id']);if(!_0x68f023){return this[_0xbb43('0xe')]['error'](_0x32448c,_0xbb43('0xcc'));}this['channel'][_0xbb43('0x9f')](_0x68f023,_0x584f8a);if(this[_0xbb43('0x81')](_0x32448c[_0xbb43('0x108')])){var _0x450822=parseInt(_0x32448c[_0xbb43('0x108')],0xa);var _0x25189f=rs[_0xbb43('0x109')]({'charset':'*','length':_0x450822});var _0x315053=_0x584f8a['length'];if(_0x315053>0x0){if(_0x315053>_0x450822){this[_0xbb43('0x35')][_0xbb43('0x72')](this,_0x32448c,_0x32448c[_0xbb43('0x10a')]===_0xbb43('0x10b')?_0x25189f+_0x584f8a['substr'](_0x450822):_0x584f8a[_0xbb43('0x10c')](0x0,_0x315053-_0x450822)+_0x25189f);}else{this[_0xbb43('0x35')][_0xbb43('0x72')](this,_0x32448c,rs[_0xbb43('0x109')]({'charset':'*','length':_0x315053}));}}else{this[_0xbb43('0x35')][_0xbb43('0x72')](this,_0x32448c,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x32448c,_0x584f8a);}return _0x2bf4d2;};AGIVertices['prototype'][_0xbb43('0xd')]=function(_0x5389d9){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5389d9[_0xbb43('0xa2')]));return this[_0xbb43('0xc')](_0x5389d9);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x10d')]=function(_0x2b60f0){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x10e'),_0x2b60f0['label']));this['createSquareDetailsReport'][_0xbb43('0x72')](this,_0x2b60f0,_0x2b60f0['goalname']);return this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format'](_0xbb43('0x10f'),_0x2b60f0[_0xbb43('0x110')]));};AGIVertices['prototype'][_0xbb43('0x111')]=function(_0x5eb021){logger['info'](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5eb021[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x5eb021[_0xbb43('0x84')])||!this[_0xbb43('0x81')](_0x5eb021[_0xbb43('0x85')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x112'));}if(!this['isConfigured'](_0x5eb021[_0xbb43('0x5d')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xb3'));}this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x5eb021[_0xbb43('0x5d')]));var _0x39708b=this[_0xbb43('0x83')]['sync'](this,_0x5eb021);if(_0x39708b){this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x113'),_0x39708b));var _0x5cedde=this[_0xbb43('0xe')]['streamFile'](_0x39708b);try{fs[_0xbb43('0x114')](_0x39708b+_0xbb43('0xf3'));}catch(_0x37ddf9){logger['error'](_0x37ddf9);}return _0x5cedde;}return this[_0xbb43('0xe')]['error'](_0x5eb021,_0xbb43('0x115'));};AGIVertices['prototype']['awslex']=function(_0xb2ae44){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x116'),_0xb2ae44[_0xbb43('0xa2')]));if(!this['isConfigured'](_0xb2ae44['aws_access_key_id'])||!this['isConfigured'](_0xb2ae44[_0xbb43('0x85')])){return this['channel'][_0xbb43('0xb5')](_0xbb43('0x112'));}if(!this[_0xbb43('0x81')](_0xb2ae44[_0xbb43('0x117')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0x118'));}if(!this[_0xbb43('0x81')](_0xb2ae44[_0xbb43('0x5d')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xb3'));}this[_0xbb43('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0xb2ae44);this['createSquareMessage'](_0xb2ae44[_0xbb43('0x5d')],'in');this[_0xbb43('0xe')]['noop'](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0xb2ae44[_0xbb43('0x5d')]));var _0x1107ac=this['awsLex'][_0xbb43('0x72')](this,_0xb2ae44);if(_0x1107ac){for(var _0x368bc5 in _0x1107ac){if(_0x1107ac['hasOwnProperty'](_0x368bc5)&&_[_0xbb43('0x92')](_0x1107ac[_0x368bc5])){this[_0xbb43('0xe')]['setVariable'](util[_0xbb43('0x27')](_0xbb43('0x119'),_0x368bc5['toUpperCase']()),_0x1107ac[_0x368bc5]);}}if(_[_0xbb43('0x43')](_0x1107ac[_0xbb43('0x78')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x11a'));}else{this[_0xbb43('0x41')](_0x1107ac[_0xbb43('0x78')],'out');return this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format'](_0xbb43('0x11b'),_0x1107ac[_0xbb43('0x78')]));}}return this[_0xbb43('0xe')]['error'](_0xb2ae44,_0xbb43('0x11c'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x11d')]=function(_0x1b0cbf){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x11e'),_0x1b0cbf[_0xbb43('0xa2')],_0x1b0cbf['timeout']));if(!this[_0xbb43('0x81')](_0x1b0cbf[_0xbb43('0x7c')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xdd'));}var _0x2a4e59=_0xbb43('0x11f');var _0x178be7=util[_0xbb43('0x27')](_0xbb43('0x120'),FILES_PATH,rs['generate'](0x4));var _0x22eede=util[_0xbb43('0x27')](_0xbb43('0x97'),_0x178be7,_0x2a4e59);var _0xf300f7=!![];if(_0x1b0cbf['beep']==='NOBEEP'){_0xf300f7=![];}var _0x30c920=this[_0xbb43('0xe')][_0xbb43('0x121')](_0x178be7,_0x2a4e59,_0x1b0cbf[_0xbb43('0x122')],_0x1b0cbf[_0xbb43('0x67')],undefined,_0xf300f7);if(_0x30c920[_0xbb43('0x9e')]!==-0x1){this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')](_0xbb43('0x123'),_0x22eede));var _0x306138=this[_0xbb43('0x8c')][_0xbb43('0x72')](this,_0x1b0cbf,_0x22eede);if(_0x306138){for(var _0x62768a in _0x306138){if(_0x306138[_0xbb43('0x91')](_0x62768a)){this[_0xbb43('0xe')][_0xbb43('0x9f')](util[_0xbb43('0x27')]('GOOGLE_ASR_%s',_0x62768a['toUpperCase']()),_0x306138[_0x62768a]);}}return this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')](_0xbb43('0x124'),JSON[_0xbb43('0x75')](_0x306138)));}}return _0x30c920;};AGIVertices['prototype'][_0xbb43('0x125')]=function(_0x364e34){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x126'),_0x364e34[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x364e34['appid'])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0x127'));}if(!this['isConfigured'](_0x364e34[_0xbb43('0x8f')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x128'));}var _0x12b999=_0xbb43('0x11f');var _0x4b9dbc=util[_0xbb43('0x27')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x533465=util[_0xbb43('0x27')](_0xbb43('0x97'),_0x4b9dbc,_0x12b999);var _0x2a927c=!![];if(_0x364e34[_0xbb43('0x129')]===_0xbb43('0x12a')){_0x2a927c=![];}var _0x13c848=this[_0xbb43('0xe')][_0xbb43('0x121')](_0x4b9dbc,_0x12b999,_0x364e34[_0xbb43('0x122')],_0x364e34[_0xbb43('0x67')],undefined,_0x2a927c);if(_0x13c848['result']!==-0x1){this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')]('tilde\x20%s\x20file\x20created',_0x533465));var _0x300460=this['tildeASR']['sync'](this,_0x364e34,_0x533465);if(_0x300460){for(var _0x390dc9 in _0x300460){if(_0x300460[_0xbb43('0x91')](_0x390dc9)){this['channel']['setVariable'](util[_0xbb43('0x27')](_0xbb43('0x12b'),_0x390dc9['toUpperCase']()),_0x300460[_0x390dc9]);}}return this['channel']['noop'](util['format'](_0xbb43('0x12c'),JSON[_0xbb43('0x75')](_0x300460)));}}return _0x13c848;};AGIVertices[_0xbb43('0x10')]['gotoc']=function(_0x2f6755){logger[_0xbb43('0x2d')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2f6755[_0xbb43('0xa2')]));return this['channel'][_0xbb43('0x12d')](_0x2f6755[_0xbb43('0x3b')],_0x2f6755[_0xbb43('0x3c')],_0x2f6755['priority']);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x12e')]=function(_0x2b9851){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x12f'),_0x2b9851[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x2b9851[_0xbb43('0x130')])){return this[_0xbb43('0xe')]['error'](_0x2b9851,'no\x20condition\x20configured');}try{var _0x53bf86=eval(_0x2b9851[_0xbb43('0x130')])?_0xbb43('0x131'):_0xbb43('0x132');this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x133'),_0x2b9851['condition'],_0x53bf86));return{'code':0xc8,'result':_0x53bf86};}catch(_0x51c2a3){return{'code':0xc8,'result':_0xbb43('0x132')};}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x134')]=function(_0x40a618){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x135'),_0x40a618[_0xbb43('0xa2')]));if(!this['isConfigured'](_0x40a618['interval_id'])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x40a618,_0xbb43('0x136'));}var _0x28decb=this[_0xbb43('0x21')][_0xbb43('0x72')](this,_0x40a618[_0xbb43('0x137')]);if(!_0x28decb){return this['channel'][_0xbb43('0x31')](_0x40a618,_0xbb43('0x138'));}for(var _0x5b5018=0x0;_0x5b5018<_0x28decb[_0xbb43('0x9a')];_0x5b5018+=0x1){var _0x43a3e3=this[_0xbb43('0xe')]['getVariable'](util['format'](_0xbb43('0x139'),_0x28decb[_0x5b5018]));if(_0x43a3e3[_0xbb43('0x9e')]===-0x1){return _0x43a3e3;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x28decb[_0x5b5018],_0x43a3e3[_0xbb43('0x9c')]));if(_0x43a3e3[_0xbb43('0x9c')]===_0xbb43('0x131')){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x13a'),_0x28decb[_0x5b5018],'true'));this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')]('IFTIME\x20%s\x20%s',_0x28decb[_0x5b5018],_0xbb43('0x131')));return{'code':0xc8,'result':_0xbb43('0x131')};}else{logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x13a'),_0x28decb[_0x5b5018],'false'));this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')](_0xbb43('0x13a'),_0x28decb[_0x5b5018],_0xbb43('0x132')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xbb43('0x10')][_0xbb43('0x13b')]=function(_0x35eb14){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x13c'),_0x35eb14[_0xbb43('0xa2')]));return this[_0xbb43('0xe')][_0xbb43('0x13b')]();};AGIVertices[_0xbb43('0x10')]['ispeechasr']=function(_0xa8df48){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x13d'),_0xa8df48['label']));if(!this['isConfigured'](_0xa8df48[_0xbb43('0x7c')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')]('no\x20key\x20configured');}var _0xf0626d='wav';var _0x28b81c=util[_0xbb43('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xbb43('0x109')](0x4));var _0x5893fe=util['format'](_0xbb43('0x97'),_0x28b81c,_0xf0626d);var _0xa0d29a=!![];if(_0xa8df48[_0xbb43('0x129')]===_0xbb43('0x12a')){_0xa0d29a=![];}var _0x1174fe=this[_0xbb43('0xe')]['recordFile'](_0x28b81c,_0xf0626d,_0xa8df48['intKey'],_0xa8df48[_0xbb43('0x67')],undefined,_0xa0d29a);if(_0x1174fe[_0xbb43('0x9e')]!==-0x1){this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x13e'),_0x5893fe));var _0x3e6865=this[_0xbb43('0x7f')][_0xbb43('0x72')](this,_0xa8df48,_0x5893fe);if(_0x3e6865){for(var _0x5bd9f4 in _0x3e6865){if(_0x3e6865['hasOwnProperty'](_0x5bd9f4)){this[_0xbb43('0xe')]['setVariable'](util['format'](_0xbb43('0x13f'),_0x5bd9f4[_0xbb43('0x6b')]()),_0x3e6865[_0x5bd9f4]);}}return this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')](_0xbb43('0x140'),JSON[_0xbb43('0x75')](_0x3e6865)));}}return _0x1174fe;};AGIVertices[_0xbb43('0x10')][_0xbb43('0x141')]=function(_0x3c067a){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x142'),_0x3c067a['label']));if(!this['isConfigured'](_0x3c067a[_0xbb43('0x7c')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xdd'));}if(!this['isConfigured'](_0x3c067a['text'])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xb3'));}this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x143'),_0x3c067a[_0xbb43('0x5d')]));var _0x25c597=this[_0xbb43('0x7d')]['sync'](this,_0x3c067a);if(_0x25c597){this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format'](_0xbb43('0x13e'),_0x25c597));var _0x4baf37=this[_0xbb43('0xe')][_0xbb43('0xf2')](_0x25c597,_0x3c067a[_0xbb43('0x122')]);try{fs[_0xbb43('0x114')](_0x25c597+_0xbb43('0xf3'));}catch(_0x3bd358){logger['error'](_0x3bd358);}return _0x4baf37;}return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x3c067a,_0xbb43('0x144'));};AGIVertices['prototype'][_0xbb43('0x145')]=function(_0x54c9a9){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x146'),_0x54c9a9[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x54c9a9[_0xbb43('0x147')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x54c9a9,_0xbb43('0x148'));}logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x54c9a9['findBy']));var _0x1441ef=this[_0xbb43('0x54')]['sync'](this,_0x54c9a9[_0xbb43('0x147')]);if(_0x1441ef){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x149'),this[_0xbb43('0xe')][_0xbb43('0x50')],_0x54c9a9[_0xbb43('0x147')]));this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x149'),this[_0xbb43('0xe')][_0xbb43('0x50')],_0x54c9a9[_0xbb43('0x147')]));return{'code':0xc8,'result':_0xbb43('0x14a')};}else{logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xbb43('0x50')],_0x54c9a9[_0xbb43('0x147')]));this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')](_0xbb43('0x14b'),this[_0xbb43('0xe')][_0xbb43('0x50')],_0x54c9a9[_0xbb43('0x147')]));return{'code':0xc8,'result':_0xbb43('0x14c')};}};AGIVertices[_0xbb43('0x10')]['logout']=function(_0x561e26){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x14d'),_0x561e26[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x561e26[_0xbb43('0x147')])){return this['channel']['error'](_0x561e26,_0xbb43('0x148'));}logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x14e'),this['channel'][_0xbb43('0x50')],_0x561e26[_0xbb43('0x147')]));var _0x2ac864=this[_0xbb43('0x53')][_0xbb43('0x72')](this,_0x561e26[_0xbb43('0x147')]);if(_0x2ac864){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x149'),this[_0xbb43('0xe')]['callerid'],_0x561e26['findBy']));this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x149'),this['channel'][_0xbb43('0x50')],_0x561e26['findBy']));return{'code':0xc8,'result':_0xbb43('0x14a')};}else{logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x14b'),this['channel']['callerid'],_0x561e26[_0xbb43('0x147')]));this['channel']['noop'](util[_0xbb43('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbb43('0xe')][_0xbb43('0x50')],_0x561e26[_0xbb43('0x147')]));return{'code':0xc8,'result':_0xbb43('0x14c')};}};AGIVertices['prototype'][_0xbb43('0x14f')]=function(_0x37d516){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x150'),_0x37d516[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x37d516[_0xbb43('0x151')])){return this[_0xbb43('0xe')]['error'](_0x37d516,_0xbb43('0x152'));}this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format']('math\x20%s',_0x37d516[_0xbb43('0x151')]));var _0x1cd31e=eval(_0x37d516[_0xbb43('0x151')]);if(!this[_0xbb43('0x81')](_0x37d516[_0xbb43('0xca')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1849c9=this['getVariable'][_0xbb43('0x72')](this,_0x37d516[_0xbb43('0xca')]);if(!_0x1849c9){return this['channel']['error'](_0x37d516,_0xbb43('0xcc'));}if(_[_0xbb43('0x153')](_0x1cd31e)){var _0x3b3e36=this;_0x1cd31e[_0xbb43('0x154')](function(_0x51bd51,_0x17e0ba){_0x3b3e36['channel']['setVariable'](util[_0xbb43('0x27')](_0xbb43('0x155'),_0x1849c9,_0x17e0ba),_0x51bd51);});return this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x156'),_0x1849c9));}else{return this['channel'][_0xbb43('0x9f')](_0x1849c9,_0x1cd31e);}};AGIVertices['prototype'][_0xbb43('0xb')]=function(_0xe6324f){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x157'),_0xe6324f[_0xbb43('0xa2')]));if(_0xe6324f['retry']===0x0){return this[_0xbb43('0xa0')](_0xe6324f);}_0xe6324f[_0xbb43('0x101')]-=0x1;if(!this[_0xbb43('0x81')](_0xe6324f[_0xbb43('0x158')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0xe6324f,'no\x20file\x20audio\x20selected');}var _0x1a382f=this[_0xbb43('0x102')][_0xbb43('0x72')](this,_0xe6324f[_0xbb43('0x158')]);if(!_0x1a382f){return this['channel']['error'](_0xe6324f,_0xbb43('0x103'));}var _0x4bc928=this[_0xbb43('0xe')][_0xbb43('0x104')](_0x1a382f,_0xe6324f[_0xbb43('0x159')],_0xe6324f['digit']);var _0x5c892b=_0x4bc928[_0xbb43('0x9e')];if(_0x4bc928[_0xbb43('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0xe6324f,'-1');return _0x4bc928;}else if(_0x4bc928[_0xbb43('0x9c')]===_0xbb43('0x67')){_0x4bc928['result']=_0x4bc928[_0xbb43('0x9e')][_0xbb43('0x9a')]>0x0?_0x4bc928[_0xbb43('0x9e')]:'t';}else if(_[_0xbb43('0x46')](_0x4bc928[_0xbb43('0x9e')])){_0x4bc928[_0xbb43('0x9e')]='#';_0x5c892b='#';}if(!this[_0xbb43('0x81')](_0xe6324f[_0xbb43('0xca')])){this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0xcb'));}else{var _0x4114f1=this['getVariable'][_0xbb43('0x72')](this,_0xe6324f[_0xbb43('0xca')]);if(!_0x4114f1){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0xe6324f,_0xbb43('0xcc'));}this['channel'][_0xbb43('0x9f')](_0x4114f1,_0x5c892b);}this[_0xbb43('0x35')][_0xbb43('0x72')](this,_0xe6324f,_0x5c892b);return _0x4bc928;};AGIVertices[_0xbb43('0x10')][_0xbb43('0xb5')]=function(_0x1d7a72){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x15a'),_0x1d7a72[_0xbb43('0xa2')]));return this['channel'][_0xbb43('0xb5')](_0x1d7a72[_0xbb43('0x15b')]||_0x1d7a72[_0xbb43('0xa2')]);};AGIVertices['prototype'][_0xbb43('0x15c')]=function(_0x28795f){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x15d'),_0x28795f[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x28795f['findBy'])){return this[_0xbb43('0xe')]['error'](_0x28795f,_0xbb43('0x148'));}logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbb43('0xe')]['callerid'],_0x28795f[_0xbb43('0x147')]));var _0xb58c84=this['getPause'][_0xbb43('0x72')](this,_0x28795f[_0xbb43('0x15e')]);var _0x4d04b8=this[_0xbb43('0x4f')][_0xbb43('0x72')](this,_0x28795f['findBy'],_0xb58c84);if(_0x4d04b8){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbb43('0xe')]['callerid'],_0x28795f[_0xbb43('0x147')]));this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x149'),this['channel'][_0xbb43('0x50')],_0x28795f[_0xbb43('0x147')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x14b'),this[_0xbb43('0xe')][_0xbb43('0x50')],_0x28795f[_0xbb43('0x147')]));this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbb43('0xe')][_0xbb43('0x50')],_0x28795f[_0xbb43('0x147')]));return{'code':0xc8,'result':_0xbb43('0x14c')};}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x15f')]=function(_0xc7606f){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x160'),_0xc7606f['label']));if(!this[_0xbb43('0x81')](_0xc7606f[_0xbb43('0x158')])){return this['channel']['error'](_0xc7606f,'no\x20file\x20audio\x20selected');}var _0x457e25=this[_0xbb43('0x102')]['sync'](this,_0xc7606f['file_id']);if(!_0x457e25){return this['channel'][_0xbb43('0x31')](_0xc7606f,_0xbb43('0x103'));}var _0x1bbc70=this['channel'][_0xbb43('0x58')](_0xbb43('0x161'),[_0x457e25,_0xc7606f['opts']]);if(_0x1bbc70[_0xbb43('0x9e')]===-0x1){return _0x1bbc70;}return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')]('Executed\x20command\x20%s\x20%s',_0xbb43('0x161'),_0x457e25));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x162')]=function(_0x1a75eb){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x163'),_0x1a75eb[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x1a75eb[_0xbb43('0x164')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x1a75eb,_0xbb43('0x165'));}var _0xc50a26='';var _0x166e9a=parseInt(_0x1a75eb[_0xbb43('0x164')],0xa);if(isNaN(_0x166e9a)){_0xc50a26=_0x1a75eb['queue_id'];}else{_0xc50a26=this[_0xbb43('0x166')]['sync'](this,_0x1a75eb[_0xbb43('0x164')]);if(!_0xc50a26){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x1a75eb,_0xbb43('0x167'));}}var _0x5c984f='';if(this[_0xbb43('0x81')](_0x1a75eb[_0xbb43('0x158')])){var _0x5c5fba=this['getSound'][_0xbb43('0x72')](this,_0x1a75eb[_0xbb43('0x158')]);if(_0x5c5fba){_0x5c984f=_0x5c5fba;}}this[_0xbb43('0x35')]['sync'](this,_0x1a75eb,_0xc50a26);if(_0x1a75eb['opts']['indexOf']('x')<0x0){_0x1a75eb[_0xbb43('0xd8')]+='x';}if(_0x1a75eb['opts'][_0xbb43('0x168')]('X')<0x0){_0x1a75eb[_0xbb43('0xd8')]+='X';}this[_0xbb43('0xe')]['setVariable'](_0xbb43('0x169'),_0xc50a26?_0xc50a26[_0xbb43('0x16a')]():'');var _0x24d691=this['channel']['exec'](_0xbb43('0x16b'),[_0xc50a26,_0x1a75eb[_0xbb43('0xd8')],_0x1a75eb['url'],_0x5c984f,_0x1a75eb[_0xbb43('0x67')],_0x1a75eb[_0xbb43('0x8')],_0x1a75eb[_0xbb43('0x16c')],_0x1a75eb[_0xbb43('0x16d')],'',_0x1a75eb[_0xbb43('0x16e')]]);if(_0x24d691[_0xbb43('0x9e')]===-0x1){return _0x24d691;}return this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')]('Executed\x20command\x20%s\x20%s','QUEUE',_0xc50a26));};AGIVertices['prototype'][_0xbb43('0x16f')]=function(_0x350095){logger['info'](util['format'](_0xbb43('0x170'),_0x350095[_0xbb43('0xa2')]));var _0x4a426e=_0x350095[_0xbb43('0x171')]||_0xbb43('0x11f');var _0x7fcd8b=util['format'](_0xbb43('0x172'),this[_0xbb43('0xe')][_0xbb43('0x36')],rs[_0xbb43('0x109')](0x5));var _0x3f0fbf=util['format'](_0xbb43('0x173'),FILES_PATH,_0x7fcd8b,_0x4a426e);var _0x2a0408=util[_0xbb43('0x27')](_0xbb43('0x120'),FILES_PATH,_0x7fcd8b);this[_0xbb43('0x39')][_0xbb43('0x72')](this,_0x350095,_0x7fcd8b,_0x3f0fbf);this[_0xbb43('0xe')][_0xbb43('0x9f')](_0xbb43('0x174'),_0x7fcd8b);logger['info'](_0xbb43('0x175'),_0x2a0408,_0x4a426e,_0x350095[_0xbb43('0x176')],_0x350095[_0xbb43('0x67')]);return this['channel']['recordFile'](_0x2a0408,_0x4a426e,_0x350095[_0xbb43('0x176')],_0x350095[_0xbb43('0x67')],undefined,!![]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x177')]=function(_0x5e5b59){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x178'),_0x5e5b59['label']));if(!this[_0xbb43('0x81')](_0x5e5b59[_0xbb43('0x65')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x179'));}var _0x30f57d=this[_0xbb43('0x17a')][_0xbb43('0x72')](this,_0x5e5b59);logger['info'](util[_0xbb43('0x27')]('Response:',util['inspect'](_0x30f57d,{'showHidden':![],'depth':null})));if(!this[_0xbb43('0x81')](_0x5e5b59[_0xbb43('0xca')])){return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x17b'));}var _0x52bd12=this['getVariable'][_0xbb43('0x72')](this,_0x5e5b59[_0xbb43('0xca')]);if(!_0x52bd12){return this[_0xbb43('0xe')]['error'](_0x5e5b59,_0xbb43('0xcc'));}this[_0xbb43('0xe')][_0xbb43('0x9f')](util[_0xbb43('0x27')](_0xbb43('0x17c'),_0x52bd12),_0x30f57d[_0xbb43('0x77')]?_0x30f57d[_0xbb43('0x77')]:_0xbb43('0x17d'));this['channel']['setVariable'](util['format'](_0xbb43('0x17e'),_0x52bd12),_0x30f57d[_0xbb43('0x17f')]?_0x30f57d[_0xbb43('0x17f')]:'OK');if(_0x30f57d[_0xbb43('0x6c')]){try{this[_0xbb43('0x95')](_0x30f57d[_0xbb43('0x6c')],_0x52bd12);}catch(_0x862510){logger[_0xbb43('0x31')](util[_0xbb43('0x27')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x52bd12));}}return this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x27')]('variable\x20%s\x20set',_0x52bd12));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x180')]=function(_0x3869d0){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x181'),_0x3869d0[_0xbb43('0xa2')]));return this[_0xbb43('0xe')]['sayDigits'](_0x3869d0[_0xbb43('0x182')][_0xbb43('0x5a')](/\s+/g,''),_0x3869d0['escape_digits']);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x183')]=function(_0x5f22a7){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5f22a7['label']));return this['channel']['sayNumber'](_0x5f22a7[_0xbb43('0x184')][_0xbb43('0x5a')](/\s+/g,''),_0x5f22a7['escape_digits']);};AGIVertices[_0xbb43('0x10')]['sayphonetic']=function(_0x560e97){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x185'),_0x560e97[_0xbb43('0xa2')]));return this[_0xbb43('0xe')]['sayPhonetic'](_0x560e97['text'],_0x560e97[_0xbb43('0x176')]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x186')]=function(_0x4b6bf8){logger['info'](util[_0xbb43('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4b6bf8[_0xbb43('0xa2')]));if(!this['isConfigured'](_0x4b6bf8[_0xbb43('0x187')])){return this['channel'][_0xbb43('0xb5')](_0xbb43('0x188'));}var _0x2fca1d=this['getMailAccount']['sync'](this,_0x4b6bf8[_0xbb43('0x187')]);if(!_0x2fca1d||!_0x2fca1d['Smtp']){return this['channel'][_0xbb43('0x31')](_0x4b6bf8,_0xbb43('0x189'));}var _0x36fb22={'from':util[_0xbb43('0x27')](_0xbb43('0x18a'),_0x2fca1d[_0xbb43('0x1b')],_0x2fca1d[_0xbb43('0x18b')]||_0x2fca1d[_0xbb43('0x18c')][_0xbb43('0x18d')]),'to':_0x4b6bf8['to']||'','cc':_0x4b6bf8['cc']||'','bcc':_0x4b6bf8['bcc']||'','subject':_0x4b6bf8[_0xbb43('0x18e')],'html':_0x4b6bf8[_0xbb43('0x5d')],'text':_0x4b6bf8[_0xbb43('0x5d')]};var _0x193681={'tls':{'rejectUnauthorized':![]}};if(_0x2fca1d[_0xbb43('0x18c')]['service']){_0x193681[_0xbb43('0x18f')]=_0x2fca1d['Smtp'][_0xbb43('0x18f')];}else{_0x193681[_0xbb43('0x190')]=_0x2fca1d['Smtp']['host'];_0x193681[_0xbb43('0x191')]=_0x2fca1d[_0xbb43('0x18c')][_0xbb43('0x191')];_0x193681['secure']=_0x2fca1d[_0xbb43('0x18c')][_0xbb43('0x192')];}if(_0x2fca1d[_0xbb43('0x18c')][_0xbb43('0x193')]){_0x193681['auth']={'user':_0x2fca1d[_0xbb43('0x18c')]['user'],'pass':_0x2fca1d[_0xbb43('0x18c')][_0xbb43('0x194')]};}if(this['isConfigured'](_0x4b6bf8[_0xbb43('0x195')])){}logger[_0xbb43('0xd1')]('sendMail\x20message',JSON[_0xbb43('0x75')](_0x36fb22));this['createSquareDetailsReport'][_0xbb43('0x72')](this,_0x4b6bf8,_0x4b6bf8['account_id']);this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x2fca1d[_0xbb43('0x1b')]));this[_0xbb43('0x20')][_0xbb43('0x72')](this,_0x193681,_0x36fb22);return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x196'));};AGIVertices['prototype'][_0xbb43('0x197')]=function(_0x308bc7){logger['info'](util['format'](_0xbb43('0x198'),_0x308bc7[_0xbb43('0xa2')]));return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x199'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x19a')]=function(_0x4ac003){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x19b'),_0x4ac003['label']));if(!this[_0xbb43('0x81')](_0x4ac003[_0xbb43('0x19c')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0x19d'));}var _0x341b8d=this[_0xbb43('0x33')][_0xbb43('0x72')](this,_0x4ac003[_0xbb43('0x19c')]);if(!_0x341b8d){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x4ac003,_0xbb43('0x19e'));}var _0xe285e5={'body':_0x4ac003['sms_text'],'phone':_0x4ac003['to']||'','SmsAccountId':_0x341b8d['id']};logger[_0xbb43('0xd1')](_0xbb43('0x19f'),JSON[_0xbb43('0x75')](_0xe285e5));this[_0xbb43('0x35')]['sync'](this,_0x4ac003,_0x4ac003[_0xbb43('0x19c')]);this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x1a0'),_0x341b8d[_0xbb43('0x1b')]));this[_0xbb43('0x34')][_0xbb43('0x72')](this,_0xe285e5);return this[_0xbb43('0xe')][_0xbb43('0xb5')](_0xbb43('0x1a1'));};AGIVertices['prototype'][_0xbb43('0x1a2')]=function(_0x48dd24){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x1a3'),_0x48dd24['label']));if(!this[_0xbb43('0x81')](_0x48dd24['variable_id'])){return this['channel'][_0xbb43('0x31')](_0x48dd24,_0xbb43('0x1a4'));}var _0x1ebfca=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x48dd24[_0xbb43('0xca')]);if(!_0x1ebfca){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x48dd24,_0xbb43('0xcc'));}return this[_0xbb43('0xe')]['setVariable'](_0x1ebfca,_0x48dd24[_0xbb43('0x1a5')]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1a6')]=function(_0x38ba87){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x1a7'),_0x38ba87[_0xbb43('0xa2')]));this[_0xbb43('0xe')][_0xbb43('0xb5')]('START\x20CALLY\x20SQUARE');if(_0x38ba87[_0xbb43('0xa5')]===_0xbb43('0x1a8')){this['channel'][_0xbb43('0xb5')](_0xbb43('0x1a9'));return this['channel'][_0xbb43('0xa5')]();}return this[_0xbb43('0xe')]['noop'](_0xbb43('0x1aa'));};AGIVertices['prototype'][_0xbb43('0x1ab')]=function(_0x3c5d13){logger[_0xbb43('0x2d')](util['format'](_0xbb43('0x1ac'),_0x3c5d13[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x3c5d13[_0xbb43('0x1ad')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x3c5d13,_0xbb43('0x1ae'));}var _0x234dd0=this[_0xbb43('0x1af')]['sync'](this,_0x3c5d13[_0xbb43('0x1ad')]);if(!this[_0xbb43('0x81')](_0x234dd0)){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x3c5d13,util[_0xbb43('0x27')](_0xbb43('0x1b0'),_0x3c5d13[_0xbb43('0x1ad')]));}if(_0x234dd0===this['channel']['arg_1']){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x3c5d13,_0xbb43('0x1b1'));}this['createSquareDetailsReport'][_0xbb43('0x72')](this,_0x3c5d13,_0x234dd0);var _0x56420f=this[_0xbb43('0xe')][_0xbb43('0x58')](_0xbb43('0x1b2'),util[_0xbb43('0x27')](_0xbb43('0x1b3'),config[_0xbb43('0x8')][_0xbb43('0x190')]||_0xbb43('0x1b4'),_0x234dd0,this[_0xbb43('0xe')][_0xbb43('0x38')]));if(_0x56420f[_0xbb43('0x9e')]===-0x1){return _0x56420f;}return this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xb1'),_0xbb43('0x1b2'),_0x234dd0));};AGIVertices[_0xbb43('0x10')]['system']=function(_0x2f1f8e){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x1b5'),_0x2f1f8e[_0xbb43('0xa2')]));var _0x169d2f=this[_0xbb43('0x57')]['sync'](this,_0x2f1f8e[_0xbb43('0xa3')]);this[_0xbb43('0x35')]['sync'](this,_0x2f1f8e,_0x2f1f8e[_0xbb43('0xa3')]);if(this[_0xbb43('0x81')](_0x2f1f8e[_0xbb43('0xca')])){var _0x39f193=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x2f1f8e[_0xbb43('0xca')]);if(_0x39f193){this['channel']['setVariable'](_0x39f193,_0x169d2f);return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x1b6'),_0x2f1f8e[_0xbb43('0xa3')],_0x39f193));}}return this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format'](_0xbb43('0x1b7'),_0x2f1f8e[_0xbb43('0xa3')]));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1b8')]=function(_0x3943e2){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x1b9'),_0x3943e2['label']));if(!this['isConfigured'](_0x3943e2[_0xbb43('0x1ba')])){return this['channel'][_0xbb43('0xb5')](_0xbb43('0x1bb'));}if(!this['isConfigured'](_0x3943e2['text'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x3943e2[_0xbb43('0x5d')]));var _0x43d074=this[_0xbb43('0x5b')][_0xbb43('0x72')](this,_0x3943e2);if(_0x43d074){this['channel'][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x1bc'),_0x43d074));var _0x34e667=this[_0xbb43('0xe')]['streamFile'](_0x43d074);try{fs[_0xbb43('0x114')](_0x43d074+_0xbb43('0xf3'));}catch(_0x3fba42){logger['error'](_0x3fba42);}return _0x34e667;}return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x3943e2,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x3f97b1){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x1bd'),_0x3f97b1[_0xbb43('0xa2')]));if(!this[_0xbb43('0x81')](_0x3f97b1['text'])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xb3'));}this[_0xbb43('0xe')][_0xbb43('0xb5')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x3f97b1['text']));var _0x3a305b=this[_0xbb43('0x63')][_0xbb43('0x72')](this,_0x3f97b1);if(_0x3a305b){this['channel']['noop'](util[_0xbb43('0x27')](_0xbb43('0x1be'),_0x3a305b));var _0x220bc4=this[_0xbb43('0xe')]['streamFile'](_0x3a305b);try{fs[_0xbb43('0x114')](_0x3a305b+_0xbb43('0xf3'));}catch(_0x3c681d){logger[_0xbb43('0x31')](_0x3c681d);}return _0x220bc4;}return this[_0xbb43('0xe')][_0xbb43('0x31')](_0x3f97b1,_0xbb43('0x1bf'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1c0')]=function(_0xe95c6){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0xe95c6[_0xbb43('0xa2')]));if(!this['isConfigured'](_0xe95c6[_0xbb43('0x147')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0xe95c6,_0xbb43('0x148'));}logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x14e'),this[_0xbb43('0xe')][_0xbb43('0x50')],_0xe95c6[_0xbb43('0x147')]));var _0x588183=this[_0xbb43('0x51')][_0xbb43('0x72')](this,_0xe95c6[_0xbb43('0x147')]);if(_0x588183){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0xe95c6[_0xbb43('0x147')]));this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0x149'),this[_0xbb43('0xe')][_0xbb43('0x50')],_0xe95c6[_0xbb43('0x147')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xbb43('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbb43('0xe')]['callerid'],_0xe95c6[_0xbb43('0x147')]));this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbb43('0xe')][_0xbb43('0x50')],_0xe95c6[_0xbb43('0x147')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xbb43('0x10')]['voicemail']=function(_0x3db11d){logger['info'](util[_0xbb43('0x27')](_0xbb43('0x1c1'),_0x3db11d[_0xbb43('0xa2')]));var _0x3d7238=this[_0xbb43('0xe')][_0xbb43('0x58')](_0xbb43('0x1c2'),[_0x3db11d[_0xbb43('0x1c3')],_0x3db11d[_0xbb43('0x7a')]]);if(_0x3d7238['result']===-0x1){return _0x3d7238;}return this[_0xbb43('0xe')][_0xbb43('0xb5')](util[_0xbb43('0x27')](_0xbb43('0xb1'),'VOICEMAIL',_0x3db11d['mailbox']));};AGIVertices[_0xbb43('0x10')]['vswitch']=function(_0xf4a5f6){logger[_0xbb43('0x2d')](util[_0xbb43('0x27')](_0xbb43('0x1c4'),_0xf4a5f6[_0xbb43('0xa2')]));if(!this['isConfigured'](_0xf4a5f6[_0xbb43('0xca')])){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0xf4a5f6,'no\x20variable\x20selected');}var _0x3c5849=this['getVariable']['sync'](this,_0xf4a5f6[_0xbb43('0xca')]);if(!_0x3c5849){return this[_0xbb43('0xe')][_0xbb43('0x31')](_0xf4a5f6,'no\x20variable\x20found');}var _0x812d3=this[_0xbb43('0xe')][_0xbb43('0x11')](_0x3c5849);return{'code':0xc8,'result':_0x812d3[_0xbb43('0x9c')]?_0x812d3[_0xbb43('0x9c')]:'-'};};String['prototype'][_0xbb43('0x9b')]=function(_0x24abee,_0x380814){return this[_0xbb43('0x99')](_0x24abee)[_0xbb43('0x1c5')](_0x380814);};module[_0xbb43('0x1c6')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b48ac6f..06a123d 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 _0x9f62=['isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hangup','syncHangup','syncAgentRingNoAnswer','bind','syncAttendedTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','timer','[TIMER][STOP][AGENT:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s'];(function(_0x176f46,_0x1ae7d4){var _0x3e6691=function(_0x1f547c){while(--_0x1f547c){_0x176f46['push'](_0x176f46['shift']());}};_0x3e6691(++_0x1ae7d4);}(_0x9f62,0x154));var _0x29f6=function(_0x1438ea,_0xee9efd){_0x1438ea=_0x1438ea-0x0;var _0x228cc5=_0x9f62[_0x1438ea];return _0x228cc5;};'use strict';var util=require('util');var _=require(_0x29f6('0x0'));var moment=require('moment');var ami=require(_0x29f6('0x1'));var logger=require(_0x29f6('0x2'))(_0x29f6('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x258ddd){this[_0x29f6('0x4')]=_0x258ddd[_0x29f6('0x4')];this[_0x29f6('0x5')]=_0x258ddd['agents'];this[_0x29f6('0x6')]=_0x258ddd[_0x29f6('0x6')];this[_0x29f6('0x7')]={};ami['on'](_0x29f6('0x8'),this[_0x29f6('0x9')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x29f6('0xa'),this[_0x29f6('0xb')]['bind'](this));ami['on']('agentringnoanswer',this[_0x29f6('0xc')][_0x29f6('0xd')](this));ami['on']('attendedtransfer',this[_0x29f6('0xe')][_0x29f6('0xd')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x29f6('0xf')][_0x29f6('0xd')](this));}function getDiff(_0x189344){var _0x11a1fd=moment()[_0x29f6('0x10')](0x0);var _0x156c96=moment(_0x189344)[_0x29f6('0x10')](0x0);return _0x11a1fd[_0x29f6('0x11')](_0x156c96,_0x29f6('0x12'));}Acw[_0x29f6('0x13')][_0x29f6('0x14')]=function(_0x370484){try{var _0x1dde97=this;var _0x3a75d0=this[_0x29f6('0x7')][_0x370484][_0x29f6('0x15')];var _0x3584a1=this['channels'][_0x370484]['queue'];var _0x2e66d3=this[_0x29f6('0x4')][_0x3584a1];var _0xb31436=![];var _0x5c8246=_0x29f6('0x16');if(_0x2e66d3[_0x29f6('0x17')]){if(_0x2e66d3['mandatoryDispositionPause'][_0x29f6('0x18')]){_0xb31436=!![];_0x5c8246=_0x2e66d3[_0x29f6('0x19')][_0x29f6('0x18')];}}ami[_0x29f6('0x1a')]({'action':_0x29f6('0x1b'),'interface':_0x3a75d0,'paused':!![],'reason':_0x5c8246})[_0x29f6('0x1c')](function(_0x5673c8){if(_0x1dde97[_0x29f6('0x5')][_0x3a75d0]){return RpcUser['getAgent'](_0x1dde97['agents'][_0x3a75d0]['id'])[_0x29f6('0x1c')](function(_0x1fa159){if(_0x1fa159&&!_0x1fa159[_0x29f6('0x1d')]){logger[_0x29f6('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x370484,_0x3a75d0,_0x3584a1);var _0x2c672e=_0x1dde97['channels'][_0x370484][_0x29f6('0x1f')]&&_0x1dde97[_0x29f6('0x7')][_0x370484][_0x29f6('0x20')]?_0x1dde97[_0x29f6('0x7')][_0x370484]['destlinkedid']:_0x370484;return RpcUser[_0x29f6('0x21')](_0x1dde97[_0x29f6('0x5')][_0x3a75d0],_0x5c8246,_0x2c672e)['then'](function(_0x1401fb){if(!_0xb31436){_0x1dde97[_0x29f6('0x6')][_0x3a75d0]={};logger[_0x29f6('0x1e')](_0x29f6('0x22'),_0x370484,_0x1dde97[_0x29f6('0x4')][_0x3584a1][_0x29f6('0x23')],_0x3a75d0,_0x3584a1);_0x1dde97[_0x29f6('0x6')][_0x3a75d0]['timer']=setTimeout(_0x1dde97[_0x29f6('0x24')][_0x29f6('0xd')](_0x1dde97,_0x3a75d0),_0x1dde97[_0x29f6('0x4')][_0x3584a1][_0x29f6('0x23')]*0x3e8);_0x1dde97[_0x29f6('0x6')][_0x3a75d0][_0x29f6('0x25')]=moment()[_0x29f6('0x26')](_0x29f6('0x27'));_0x1dde97[_0x29f6('0x6')][_0x3a75d0][_0x29f6('0x28')]=_0x370484;_0x1dde97[_0x29f6('0x6')][_0x3a75d0][_0x29f6('0x29')]=_0x3584a1;_0x1dde97[_0x29f6('0x6')][_0x3a75d0][_0x29f6('0x2a')]=function(){var _0x375564=getDiff(_0x1dde97[_0x29f6('0x6')][_0x3a75d0][_0x29f6('0x25')]);clearTimeout(_0x1dde97['timers'][_0x3a75d0]['timer']);_0x1dde97[_0x29f6('0x6')][_0x3a75d0]['timer']=![];RpcVoiceAgentReport[_0x29f6('0x2b')]({'acwtime':_0x375564},_0x1dde97[_0x29f6('0x6')][_0x3a75d0][_0x29f6('0x28')],_0x3a75d0)[_0x29f6('0x1c')](function(_0x5e5d89){logger['info'](_0x29f6('0x2c'),_0x370484,_0x375564,_0x5e5d89);})[_0x29f6('0x2d')](function(_0x2edc2e){logger[_0x29f6('0x2e')](_0x29f6('0x2f'),_0x370484,_0x2edc2e);});delete _0x1dde97[_0x29f6('0x6')][_0x3a75d0];};}});}else{logger[_0x29f6('0x1e')](_0x29f6('0x30'),_0x370484,_0x3a75d0,_0x3584a1);}});}})[_0x29f6('0x2d')](function(_0x3bd7cf){logger[_0x29f6('0x2e')](_0x29f6('0x22'),_0x370484,_0x1dde97[_0x29f6('0x4')][_0x3584a1][_0x29f6('0x23')],_0x3a75d0,_0x3584a1);})['finally'](function(){delete _0x1dde97['channels'][_0x370484];});}catch(_0x206beb){logger[_0x29f6('0x2e')](_0x29f6('0x31'),_0x206beb['message']);}};Acw[_0x29f6('0x13')][_0x29f6('0x24')]=function(_0xe3b91f){try{var _0x27d945=this;if(_0x27d945[_0x29f6('0x6')][_0xe3b91f]){_0x27d945['timers'][_0xe3b91f][_0x29f6('0x32')]=![];var _0x2ad06f=_0x27d945[_0x29f6('0x6')][_0xe3b91f][_0x29f6('0x28')];var _0x4f5fe1=_0x27d945[_0x29f6('0x6')][_0xe3b91f][_0x29f6('0x29')];var _0x14b392=_0x27d945[_0x29f6('0x4')][_0x4f5fe1]['acwTimeout'];logger['info'](_0x29f6('0x33'),_0xe3b91f);RpcUser['saveUnpause'](this[_0x29f6('0x5')][_0xe3b91f]);RpcVoiceAgentReport['update']({'acwtime':_0x14b392,'agentacw':!![]},_0x2ad06f,_0xe3b91f)[_0x29f6('0x1c')](function(_0x537210){logger[_0x29f6('0x1e')](_0x29f6('0x2c'),_0x2ad06f,_0x14b392,_0x537210);})['catch'](function(_0x1431fc){logger['error'](_0x29f6('0x2f'),_0x2ad06f,_0x1431fc);});}else{logger[_0x29f6('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xe3b91f);if(_0x27d945[_0x29f6('0x6')]){logger[_0x29f6('0x1e')](_0x29f6('0x34'),JSON[_0x29f6('0x35')](_0x27d945['timers']));}}}catch(_0x43da1a){logger[_0x29f6('0x2e')](_0x29f6('0x36'),_0x43da1a[_0x29f6('0x37')]);}};Acw[_0x29f6('0x13')]['syncAgentConnect']=function(_0xb5f2b1){try{if(this['voiceQueues'][_0xb5f2b1[_0x29f6('0x29')]]&&(this['voiceQueues'][_0xb5f2b1[_0x29f6('0x29')]][_0x29f6('0x3')]||this['voiceQueues'][_0xb5f2b1[_0x29f6('0x29')]][_0x29f6('0x17')])){if(this[_0x29f6('0x5')][_0xb5f2b1[_0x29f6('0x15')]]){this['channels'][_0xb5f2b1[_0x29f6('0x28')]]={'queue':_0xb5f2b1[_0x29f6('0x29')],'interface':_0xb5f2b1[_0x29f6('0x15')],'destlinkedid':_0xb5f2b1['destlinkedid']};}}}catch(_0x3d8244){logger['error'](_0x29f6('0x38'),_0x3d8244['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x452db1){try{if(this[_0x29f6('0x4')][_0x452db1[_0x29f6('0x29')]]&&(this[_0x29f6('0x4')][_0x452db1[_0x29f6('0x29')]][_0x29f6('0x3')]||this[_0x29f6('0x4')][_0x452db1[_0x29f6('0x29')]][_0x29f6('0x17')])){if(this[_0x29f6('0x5')][_0x452db1['interface']]){this['channels'][_0x452db1[_0x29f6('0x28')]]={'queue':_0x452db1[_0x29f6('0x29')],'interface':_0x452db1[_0x29f6('0x15')]};}}}catch(_0x1e14a1){logger['error'](_0x29f6('0x39'),_0x1e14a1[_0x29f6('0x37')]);}};Acw['prototype'][_0x29f6('0x3a')]=function(_0xd8514a){try{if(this[_0x29f6('0x7')][_0xd8514a[_0x29f6('0x28')]]&&_[_0x29f6('0x3b')](this[_0x29f6('0x7')][_0xd8514a[_0x29f6('0x28')]][_0x29f6('0x1f')])){logger[_0x29f6('0x1e')](_0x29f6('0x3c'),_0xd8514a[_0x29f6('0x28')]);this[_0x29f6('0x14')](_0xd8514a['uniqueid']);}else if(this[_0x29f6('0x7')][_0xd8514a[_0x29f6('0x3d')]]&&_[_0x29f6('0x3b')](this[_0x29f6('0x7')][_0xd8514a[_0x29f6('0x3d')]]['attended'])){logger[_0x29f6('0x1e')]('[%s][HANGUP:LINKEDID]',_0xd8514a['linkedid']);this[_0x29f6('0x14')](_0xd8514a[_0x29f6('0x3d')]);}}catch(_0x3194fa){logger[_0x29f6('0x2e')](_0x29f6('0x3e'),_0x3194fa['message']);}};Acw[_0x29f6('0x13')][_0x29f6('0xb')]=function(_0x5f42f3){try{if(this[_0x29f6('0x7')][_0x5f42f3['uniqueid']]&&this[_0x29f6('0x7')][_0x5f42f3[_0x29f6('0x28')]][_0x29f6('0x1f')]){logger[_0x29f6('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5f42f3[_0x29f6('0x28')]);this[_0x29f6('0x14')](_0x5f42f3[_0x29f6('0x28')]);}else if(this[_0x29f6('0x7')][_0x5f42f3[_0x29f6('0x3d')]]&&this[_0x29f6('0x7')][_0x5f42f3[_0x29f6('0x3d')]]['attended']){logger[_0x29f6('0x1e')](_0x29f6('0x3f'),_0x5f42f3[_0x29f6('0x3d')]);this[_0x29f6('0x14')](_0x5f42f3[_0x29f6('0x3d')]);}}catch(_0x1ac20d){logger[_0x29f6('0x2e')](_0x29f6('0x40'),_0x1ac20d[_0x29f6('0x37')]);}};Acw[_0x29f6('0x13')]['syncAttendedTransfer']=function(_0x5d7c9a){try{if(!_[_0x29f6('0x41')](this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x42')]])){this['startAcw'](_0x5d7c9a[_0x29f6('0x42')]);if(this['channels'][_0x5d7c9a['secondtransfereruniqueid']]){this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x43')]]['attended']=!![];this['channels'][_0x5d7c9a[_0x29f6('0x44')]]=this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x43')]];delete this['channels'][_0x5d7c9a[_0x29f6('0x43')]];}}else if(!_[_0x29f6('0x41')](this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x44')]])){this[_0x29f6('0x14')](_0x5d7c9a[_0x29f6('0x44')]);if(this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x45')]]){this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x45')]][_0x29f6('0x1f')]=!![];this[_0x29f6('0x7')][_0x5d7c9a[_0x29f6('0x42')]]=this['channels'][_0x5d7c9a['origtransfereruniqueid']];delete this[_0x29f6('0x7')][_0x5d7c9a['origtransfereruniqueid']];}}}catch(_0x1a5220){logger[_0x29f6('0x2e')](_0x29f6('0x46'),_0x1a5220[_0x29f6('0x37')]);}};Acw[_0x29f6('0x13')]['syncBlindTransfer']=function(_0x56c442){try{if(this[_0x29f6('0x7')][_0x56c442[_0x29f6('0x47')]]){logger[_0x29f6('0x1e')](_0x29f6('0x48'),JSON['stringify'](_0x56c442[_0x29f6('0x47')]));this['startAcw'](_0x56c442['transfereruniqueid']);}else if(this[_0x29f6('0x7')][_0x56c442[_0x29f6('0x49')]]){logger['info'](_0x29f6('0x4a'),JSON[_0x29f6('0x35')](_0x56c442['transfererlinkedid']));this[_0x29f6('0x14')](_0x56c442[_0x29f6('0x49')]);}}catch(_0x94de9c){logger[_0x29f6('0x2e')](_0x29f6('0x4b'),_0x94de9c[_0x29f6('0x37')]);}};Acw[_0x29f6('0x13')]['syncAgentRingNoAnswer']=function(_0x285caf){try{if(this['voiceQueues'][_0x285caf[_0x29f6('0x29')]]&&this['voiceQueues'][_0x285caf['queue']][_0x29f6('0x4c')]===_0x29f6('0x4d')){if(this[_0x29f6('0x5')][_0x285caf['interface']]){logger[_0x29f6('0x1e')](_0x29f6('0x4e'),_0x285caf[_0x29f6('0x28')],_0x285caf['interface'],_0x285caf[_0x29f6('0x29')]);return RpcUser[_0x29f6('0x21')](this[_0x29f6('0x5')][_0x285caf[_0x29f6('0x15')]],_0x29f6('0x4f'),_0x285caf[_0x29f6('0x28')]);}}}catch(_0x6587f3){logger[_0x29f6('0x2e')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x6587f3[_0x29f6('0x37')]);}};module[_0x29f6('0x50')]=Acw; \ No newline at end of file +var _0xedd9=['Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','stopAcw','[TIMER][STOP][AGENT:%s]','stringify','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]'];(function(_0x1a96e1,_0x561aaa){var _0x50db2a=function(_0x4d688a){while(--_0x4d688a){_0x1a96e1['push'](_0x1a96e1['shift']());}};_0x50db2a(++_0x561aaa);}(_0xedd9,0xfc));var _0x9edd=function(_0x19a055,_0xa47374){_0x19a055=_0x19a055-0x0;var _0x3e45ad=_0xedd9[_0x19a055];return _0x3e45ad;};'use strict';var util=require('util');var _=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var ami=require(_0x9edd('0x2'));var logger=require(_0x9edd('0x3'))(_0x9edd('0x4'));var RpcUser=require(_0x9edd('0x5'));var RpcVoiceAgentReport=require(_0x9edd('0x6'));function Acw(_0x36b53f){this['voiceQueues']=_0x36b53f[_0x9edd('0x7')];this[_0x9edd('0x8')]=_0x36b53f[_0x9edd('0x8')];this[_0x9edd('0x9')]=_0x36b53f['timers'];this[_0x9edd('0xa')]={};ami['on']('agentconnect',this[_0x9edd('0xb')][_0x9edd('0xc')](this));ami['on'](_0x9edd('0xd'),this[_0x9edd('0xe')]['bind'](this));ami['on'](_0x9edd('0xf'),this['syncHangup'][_0x9edd('0xc')](this));ami['on'](_0x9edd('0x10'),this['syncAgentRingNoAnswer'][_0x9edd('0xc')](this));ami['on'](_0x9edd('0x11'),this['syncAttendedTransfer'][_0x9edd('0xc')](this));ami['on'](_0x9edd('0x12'),this[_0x9edd('0x13')][_0x9edd('0xc')](this));ami['on'](_0x9edd('0x14'),this[_0x9edd('0x15')][_0x9edd('0xc')](this));}function getDiff(_0xef5498){var _0x47eb64=moment()[_0x9edd('0x16')](0x0);var _0x44fc7c=moment(_0xef5498)[_0x9edd('0x16')](0x0);return _0x47eb64[_0x9edd('0x17')](_0x44fc7c,_0x9edd('0x18'));}Acw[_0x9edd('0x19')][_0x9edd('0x1a')]=function(_0x75a4ab){try{var _0x4ea60f=this;var _0x5f5bf4=this[_0x9edd('0xa')][_0x75a4ab][_0x9edd('0x1b')];var _0x5acf65=this[_0x9edd('0xa')][_0x75a4ab][_0x9edd('0x1c')];var _0x40ba32=this['voiceQueues'][_0x5acf65];var _0x43dc70=![];var _0x5d879c=_0x9edd('0x1d');if(_0x40ba32[_0x9edd('0x1e')]){if(_0x40ba32['mandatoryDispositionPause']['name']){_0x43dc70=!![];_0x5d879c=_0x40ba32[_0x9edd('0x1f')]['name'];}}ami[_0x9edd('0x20')]({'action':'QueuePause','interface':_0x5f5bf4,'paused':!![],'reason':_0x5d879c})['then'](function(_0x356751){if(_0x4ea60f[_0x9edd('0x8')][_0x5f5bf4]){return RpcUser['getAgent'](_0x4ea60f['agents'][_0x5f5bf4]['id'])[_0x9edd('0x21')](function(_0x186186){if(_0x186186&&!_0x186186[_0x9edd('0x22')]){logger['info'](_0x9edd('0x23'),_0x75a4ab,_0x5f5bf4,_0x5acf65);var _0x1dca43=_0x4ea60f[_0x9edd('0xa')][_0x75a4ab][_0x9edd('0x24')]&&_0x4ea60f[_0x9edd('0xa')][_0x75a4ab]['destlinkedid']?_0x4ea60f[_0x9edd('0xa')][_0x75a4ab][_0x9edd('0x25')]:_0x75a4ab;return RpcUser[_0x9edd('0x26')](_0x4ea60f[_0x9edd('0x8')][_0x5f5bf4],_0x5d879c,_0x1dca43)[_0x9edd('0x21')](function(_0x4d507f){if(!_0x43dc70){_0x4ea60f['timers'][_0x5f5bf4]={};logger[_0x9edd('0x27')](_0x9edd('0x28'),_0x75a4ab,_0x4ea60f[_0x9edd('0x7')][_0x5acf65][_0x9edd('0x29')],_0x5f5bf4,_0x5acf65);_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4]['timer']=setTimeout(_0x4ea60f['stopAcw'][_0x9edd('0xc')](_0x4ea60f,_0x5f5bf4),_0x4ea60f[_0x9edd('0x7')][_0x5acf65][_0x9edd('0x29')]*0x3e8);_0x4ea60f['timers'][_0x5f5bf4][_0x9edd('0x2a')]=moment()[_0x9edd('0x2b')](_0x9edd('0x2c'));_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4]['uniqueid']=_0x75a4ab;_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4][_0x9edd('0x1c')]=_0x5acf65;_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4][_0x9edd('0x2d')]=function(){var _0xbbf08f=getDiff(_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4][_0x9edd('0x2a')]);clearTimeout(_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4][_0x9edd('0x2e')]);_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4][_0x9edd('0x2e')]=![];RpcVoiceAgentReport[_0x9edd('0x2f')]({'acwtime':_0xbbf08f},_0x4ea60f[_0x9edd('0x9')][_0x5f5bf4][_0x9edd('0x30')],_0x5f5bf4)[_0x9edd('0x21')](function(_0x5af178){logger[_0x9edd('0x27')](_0x9edd('0x31'),_0x75a4ab,_0xbbf08f,_0x5af178);})[_0x9edd('0x32')](function(_0x5d1707){logger[_0x9edd('0x33')](_0x9edd('0x34'),_0x75a4ab,_0x5d1707);});delete _0x4ea60f[_0x9edd('0x9')][_0x5f5bf4];};}});}else{logger[_0x9edd('0x27')](_0x9edd('0x35'),_0x75a4ab,_0x5f5bf4,_0x5acf65);}});}})[_0x9edd('0x32')](function(_0x473068){logger[_0x9edd('0x33')](_0x9edd('0x28'),_0x75a4ab,_0x4ea60f[_0x9edd('0x7')][_0x5acf65][_0x9edd('0x29')],_0x5f5bf4,_0x5acf65);})[_0x9edd('0x36')](function(){delete _0x4ea60f[_0x9edd('0xa')][_0x75a4ab];});}catch(_0x14f780){logger['error'](_0x9edd('0x37'),_0x14f780['message']);}};Acw[_0x9edd('0x19')][_0x9edd('0x38')]=function(_0x10d6fd){try{var _0x434d26=this;if(_0x434d26[_0x9edd('0x9')][_0x10d6fd]){_0x434d26['timers'][_0x10d6fd][_0x9edd('0x2e')]=![];var _0x44dbfc=_0x434d26[_0x9edd('0x9')][_0x10d6fd][_0x9edd('0x30')];var _0x1be77f=_0x434d26[_0x9edd('0x9')][_0x10d6fd][_0x9edd('0x1c')];var _0x1cbbac=_0x434d26[_0x9edd('0x7')][_0x1be77f][_0x9edd('0x29')];logger['info'](_0x9edd('0x39'),_0x10d6fd);RpcUser['saveUnpause'](this[_0x9edd('0x8')][_0x10d6fd]);RpcVoiceAgentReport['update']({'acwtime':_0x1cbbac,'agentacw':!![]},_0x44dbfc,_0x10d6fd)[_0x9edd('0x21')](function(_0x2858b5){logger[_0x9edd('0x27')]('[%s][UPDATE][ACWTIME:%s]',_0x44dbfc,_0x1cbbac,_0x2858b5);})[_0x9edd('0x32')](function(_0xcbd0ef){logger[_0x9edd('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x44dbfc,_0xcbd0ef);});}else{logger[_0x9edd('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x10d6fd);if(_0x434d26[_0x9edd('0x9')]){logger[_0x9edd('0x27')]('[ACW][TIMERS]',JSON[_0x9edd('0x3a')](_0x434d26[_0x9edd('0x9')]));}}}catch(_0x389f51){logger[_0x9edd('0x33')]('[ACW][STOP]\x20%s',_0x389f51[_0x9edd('0x3b')]);}};Acw['prototype'][_0x9edd('0xb')]=function(_0xc1e657){try{if(this['voiceQueues'][_0xc1e657[_0x9edd('0x1c')]]&&(this['voiceQueues'][_0xc1e657['queue']][_0x9edd('0x4')]||this[_0x9edd('0x7')][_0xc1e657[_0x9edd('0x1c')]][_0x9edd('0x1e')])){if(this[_0x9edd('0x8')][_0xc1e657[_0x9edd('0x1b')]]){this[_0x9edd('0xa')][_0xc1e657[_0x9edd('0x30')]]={'queue':_0xc1e657[_0x9edd('0x1c')],'interface':_0xc1e657[_0x9edd('0x1b')],'destlinkedid':_0xc1e657[_0x9edd('0x25')]};}}}catch(_0x3be90c){logger[_0x9edd('0x33')](_0x9edd('0x3c'),_0x3be90c[_0x9edd('0x3b')]);}};Acw['prototype'][_0x9edd('0x15')]=function(_0x2570e3){try{if(this[_0x9edd('0x7')][_0x2570e3[_0x9edd('0x1c')]]&&(this[_0x9edd('0x7')][_0x2570e3[_0x9edd('0x1c')]][_0x9edd('0x4')]||this['voiceQueues'][_0x2570e3['queue']]['mandatoryDisposition'])){if(this[_0x9edd('0x8')][_0x2570e3['interface']]){this[_0x9edd('0xa')][_0x2570e3[_0x9edd('0x30')]]={'queue':_0x2570e3[_0x9edd('0x1c')],'interface':_0x2570e3[_0x9edd('0x1b')]};}}}catch(_0x367791){logger['error'](_0x9edd('0x3d'),_0x367791[_0x9edd('0x3b')]);}};Acw[_0x9edd('0x19')]['syncHangupRequest']=function(_0x3626bc){try{if(this[_0x9edd('0xa')][_0x3626bc[_0x9edd('0x30')]]&&_[_0x9edd('0x3e')](this[_0x9edd('0xa')][_0x3626bc[_0x9edd('0x30')]]['attended'])){logger[_0x9edd('0x27')](_0x9edd('0x3f'),_0x3626bc['uniqueid']);this[_0x9edd('0x1a')](_0x3626bc[_0x9edd('0x30')]);}else if(this['channels'][_0x3626bc[_0x9edd('0x40')]]&&_[_0x9edd('0x3e')](this[_0x9edd('0xa')][_0x3626bc['linkedid']][_0x9edd('0x24')])){logger[_0x9edd('0x27')](_0x9edd('0x41'),_0x3626bc[_0x9edd('0x40')]);this['startAcw'](_0x3626bc[_0x9edd('0x40')]);}}catch(_0x527727){logger[_0x9edd('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x527727[_0x9edd('0x3b')]);}};Acw[_0x9edd('0x19')]['syncHangup']=function(_0x8e59bd){try{if(this['channels'][_0x8e59bd[_0x9edd('0x30')]]&&this[_0x9edd('0xa')][_0x8e59bd[_0x9edd('0x30')]][_0x9edd('0x24')]){logger[_0x9edd('0x27')](_0x9edd('0x42'),_0x8e59bd[_0x9edd('0x30')]);this[_0x9edd('0x1a')](_0x8e59bd[_0x9edd('0x30')]);}else if(this[_0x9edd('0xa')][_0x8e59bd[_0x9edd('0x40')]]&&this['channels'][_0x8e59bd[_0x9edd('0x40')]][_0x9edd('0x24')]){logger[_0x9edd('0x27')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x8e59bd[_0x9edd('0x40')]);this['startAcw'](_0x8e59bd['linkedid']);}}catch(_0x54ecfa){logger[_0x9edd('0x33')](_0x9edd('0x43'),_0x54ecfa[_0x9edd('0x3b')]);}};Acw[_0x9edd('0x19')]['syncAttendedTransfer']=function(_0x56b38b){try{if(!_['isNil'](this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x44')]])){this[_0x9edd('0x1a')](_0x56b38b[_0x9edd('0x44')]);if(this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x45')]]){this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x45')]]['attended']=!![];this[_0x9edd('0xa')][_0x56b38b['transfertargetuniqueid']]=this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x45')]];delete this['channels'][_0x56b38b[_0x9edd('0x45')]];}}else if(!_[_0x9edd('0x46')](this[_0x9edd('0xa')][_0x56b38b['transfertargetuniqueid']])){this[_0x9edd('0x1a')](_0x56b38b[_0x9edd('0x47')]);if(this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x48')]]){this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x48')]]['attended']=!![];this['channels'][_0x56b38b[_0x9edd('0x44')]]=this['channels'][_0x56b38b[_0x9edd('0x48')]];delete this[_0x9edd('0xa')][_0x56b38b[_0x9edd('0x48')]];}}}catch(_0x17d2f2){logger['error'](_0x9edd('0x49'),_0x17d2f2['message']);}};Acw[_0x9edd('0x19')][_0x9edd('0x13')]=function(_0xc6bde6){try{if(this['channels'][_0xc6bde6[_0x9edd('0x4a')]]){logger['info'](_0x9edd('0x4b'),JSON[_0x9edd('0x3a')](_0xc6bde6['transfereruniqueid']));this[_0x9edd('0x1a')](_0xc6bde6['transfereruniqueid']);}else if(this[_0x9edd('0xa')][_0xc6bde6[_0x9edd('0x4c')]]){logger[_0x9edd('0x27')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x9edd('0x3a')](_0xc6bde6[_0x9edd('0x4c')]));this[_0x9edd('0x1a')](_0xc6bde6[_0x9edd('0x4c')]);}}catch(_0x467512){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x467512[_0x9edd('0x3b')]);}};Acw[_0x9edd('0x19')]['syncAgentRingNoAnswer']=function(_0x5496e9){try{if(this['voiceQueues'][_0x5496e9[_0x9edd('0x1c')]]&&this['voiceQueues'][_0x5496e9['queue']][_0x9edd('0x4d')]===_0x9edd('0x4e')){if(this['agents'][_0x5496e9[_0x9edd('0x1b')]]){logger[_0x9edd('0x27')](_0x9edd('0x4f'),_0x5496e9['uniqueid'],_0x5496e9[_0x9edd('0x1b')],_0x5496e9['queue']);return RpcUser[_0x9edd('0x26')](this[_0x9edd('0x8')][_0x5496e9['interface']],_0x9edd('0x50'),_0x5496e9[_0x9edd('0x30')]);}}}catch(_0x5c1746){logger[_0x9edd('0x33')](_0x9edd('0x51'),_0x5c1746[_0x9edd('0x3b')]);}};module[_0x9edd('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 56c3bbc..b525c8f 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 _0xf831=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionDeviceStateList','actionCoreShowChannels','catch','log','close','exports','asterisk-manager','bluebird','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','inspect'];(function(_0x4275e1,_0x6befc2){var _0x54533b=function(_0x424fd0){while(--_0x424fd0){_0x4275e1['push'](_0x4275e1['shift']());}};_0x54533b(++_0x6befc2);}(_0xf831,0x1de));var _0x1f83=function(_0x3beadb,_0xf6091f){_0x3beadb=_0x3beadb-0x0;var _0x47dd74=_0xf831[_0x3beadb];return _0x47dd74;};'use strict';var Manager=require(_0x1f83('0x0'));var BPromise=require(_0x1f83('0x1'));var moment=require('moment');var util=require('util');var _=require(_0x1f83('0x2'));var logger=require(_0x1f83('0x3'))(_0x1f83('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x1f83('0x5')][_0x1f83('0x6')],config['asterisk']['ip'],config[_0x1f83('0x5')][_0x1f83('0x7')],config['asterisk'][_0x1f83('0x8')],!![]);ami[_0x1f83('0x9')]();ami[_0x1f83('0xa')]=BPromise[_0x1f83('0xb')](ami[_0x1f83('0xc')]);function error(_0x526f30){logger[_0x1f83('0xd')](util[_0x1f83('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1f83('0x5')][_0x1f83('0x7')],config['asterisk']['ip'],config[_0x1f83('0x5')][_0x1f83('0x6')],util[_0x1f83('0xf')](_0x526f30,![],null)));}function close(){logger['error'](util[_0x1f83('0xe')](_0x1f83('0x10'),config[_0x1f83('0x5')][_0x1f83('0x7')],config[_0x1f83('0x5')]['ip'],config[_0x1f83('0x5')][_0x1f83('0x6')]));}ami[_0x1f83('0x11')]=function(){return function(){return ami[_0x1f83('0xa')]({'action':_0x1f83('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x1f83('0xa')]({'action':_0x1f83('0x13')});};};ami[_0x1f83('0x14')]=function(){return function(){return ami[_0x1f83('0xa')]({'action':_0x1f83('0x15')});};};ami[_0x1f83('0x16')]=function(){return function(){return ami[_0x1f83('0xa')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x1f83('0xa')]({'action':_0x1f83('0x17')});};};function connect(_0x2e4b16){logger['info'](util[_0x1f83('0xe')](_0x1f83('0x18'),config[_0x1f83('0x5')][_0x1f83('0x7')],config[_0x1f83('0x5')]['ip'],config[_0x1f83('0x5')][_0x1f83('0x6')]));ami[_0x1f83('0x19')](_0x1f83('0xd'),error);ami[_0x1f83('0x19')]('close',close);}ami['on'](_0x1f83('0x1a'),connect);ami['on']('shutdown',function(_0x32219e){logger[_0x1f83('0x1b')](util['format'](_0x1f83('0x1c'),config[_0x1f83('0x5')][_0x1f83('0x7')],config[_0x1f83('0x5')]['ip'],config[_0x1f83('0x5')][_0x1f83('0x6')],util[_0x1f83('0xf')](_0x32219e,![],null)));});ami['on'](_0x1f83('0x1d'),function(_0x28754b){logger[_0x1f83('0x1b')](util[_0x1f83('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x1f83('0x5')][_0x1f83('0x7')],config[_0x1f83('0x5')]['ip'],config[_0x1f83('0x5')][_0x1f83('0x6')]));return BPromise[_0x1f83('0x1e')]()[_0x1f83('0x1f')](ami[_0x1f83('0x11')]())[_0x1f83('0x1f')](ami[_0x1f83('0x20')]())['then'](ami[_0x1f83('0x14')]())[_0x1f83('0x1f')](ami[_0x1f83('0x16')]())['then'](ami[_0x1f83('0x21')]())[_0x1f83('0x22')](function(_0xe33862){console[_0x1f83('0x23')](_0xe33862);});});ami[_0x1f83('0x19')](_0x1f83('0xd'),error);ami[_0x1f83('0x19')](_0x1f83('0x24'),close);module[_0x1f83('0x25')]=ami; \ No newline at end of file +var _0x4d46=['Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','log','once','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','username','password','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x4d46,0x142));var _0x64d4=function(_0x457d69,_0x2bfa35){_0x457d69=_0x457d69-0x0;var _0x489d9f=_0x4d46[_0x457d69];return _0x489d9f;};'use strict';var Manager=require(_0x64d4('0x0'));var BPromise=require(_0x64d4('0x1'));var moment=require(_0x64d4('0x2'));var util=require(_0x64d4('0x3'));var _=require(_0x64d4('0x4'));var logger=require(_0x64d4('0x5'))(_0x64d4('0x6'));var config=require('../../config/environment');var ami=new Manager(config[_0x64d4('0x7')]['port'],config[_0x64d4('0x7')]['ip'],config[_0x64d4('0x7')][_0x64d4('0x8')],config[_0x64d4('0x7')][_0x64d4('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x64d4('0xa')](ami['action']);function error(_0x5b2e11){logger['error'](util[_0x64d4('0xb')](_0x64d4('0xc'),config[_0x64d4('0x7')][_0x64d4('0x8')],config['asterisk']['ip'],config[_0x64d4('0x7')]['port'],util[_0x64d4('0xd')](_0x5b2e11,![],null)));}function close(){logger[_0x64d4('0xe')](util[_0x64d4('0xb')](_0x64d4('0xf'),config[_0x64d4('0x7')][_0x64d4('0x8')],config[_0x64d4('0x7')]['ip'],config[_0x64d4('0x7')][_0x64d4('0x10')]));}ami[_0x64d4('0x11')]=function(){return function(){return ami[_0x64d4('0x12')]({'action':_0x64d4('0x13')});};};ami[_0x64d4('0x14')]=function(){return function(){return ami[_0x64d4('0x12')]({'action':_0x64d4('0x15')});};};ami[_0x64d4('0x16')]=function(){return function(){return ami[_0x64d4('0x12')]({'action':_0x64d4('0x17')});};};ami[_0x64d4('0x18')]=function(){return function(){return ami[_0x64d4('0x12')]({'action':_0x64d4('0x19')});};};ami[_0x64d4('0x1a')]=function(){return function(){return ami[_0x64d4('0x12')]({'action':_0x64d4('0x1b')});};};function connect(_0x19e8d8){logger[_0x64d4('0x1c')](util['format'](_0x64d4('0x1d'),config[_0x64d4('0x7')][_0x64d4('0x8')],config[_0x64d4('0x7')]['ip'],config[_0x64d4('0x7')][_0x64d4('0x10')]));ami['once']('error',error);ami['once'](_0x64d4('0x1e'),close);}ami['on'](_0x64d4('0x1f'),connect);ami['on'](_0x64d4('0x20'),function(_0x34fcd0){logger[_0x64d4('0x1c')](util['format'](_0x64d4('0x21'),config[_0x64d4('0x7')][_0x64d4('0x8')],config[_0x64d4('0x7')]['ip'],config['asterisk'][_0x64d4('0x10')],util[_0x64d4('0xd')](_0x34fcd0,![],null)));});ami['on'](_0x64d4('0x22'),function(_0xc813bd){logger['info'](util['format'](_0x64d4('0x23'),config[_0x64d4('0x7')][_0x64d4('0x8')],config[_0x64d4('0x7')]['ip'],config[_0x64d4('0x7')][_0x64d4('0x10')]));return BPromise['resolve']()[_0x64d4('0x24')](ami[_0x64d4('0x11')]())[_0x64d4('0x24')](ami[_0x64d4('0x14')]())[_0x64d4('0x24')](ami[_0x64d4('0x16')]())[_0x64d4('0x24')](ami['actionQueueSummary']())[_0x64d4('0x24')](ami[_0x64d4('0x1a')]())['catch'](function(_0x462db5){console[_0x64d4('0x25')](_0x462db5);});});ami['once']('error',error);ami[_0x64d4('0x26')](_0x64d4('0x1e'),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 ffd1357..8359911 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 _0xacc5=['memberReport','error','message','catch','exports','bluebird','../../config/logger','ami','Request','request','then','debug','rpc'];(function(_0x5fc388,_0x43cab8){var _0x1d5cab=function(_0x4477ee){while(--_0x4477ee){_0x5fc388['push'](_0x5fc388['shift']());}};_0x1d5cab(++_0x43cab8);}(_0xacc5,0x116));var _0x5acc=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xacc5[_0x4565bf];return _0x5610ba;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x5acc('0x0'));var logger=require(_0x5acc('0x1'))(_0x5acc('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x5acc('0x3')]=function(_0x246749,_0x17e210){return new BPromise(function(_0x56a3a9,_0x4c2f21){return client[_0x5acc('0x4')](_0x246749,_0x17e210)[_0x5acc('0x5')](function(_0x2f0f6d){logger[_0x5acc('0x6')](_0x5acc('0x7'),_0x5acc('0x8'),_0x246749,_0x17e210,_0x2f0f6d);if(_0x2f0f6d['error']){logger[_0x5acc('0x9')](_0x5acc('0x7'),_0x5acc('0x8'),_0x246749,_0x2f0f6d[_0x5acc('0x9')][_0x5acc('0xa')],_0x17e210);return _0x4c2f21(_0x2f0f6d[_0x5acc('0x9')][_0x5acc('0xa')]);}else{return _0x56a3a9(_0x2f0f6d['result']);}})[_0x5acc('0xb')](function(_0x1f9370){logger['error'](_0x5acc('0x7'),'memberReport',_0x246749,_0x1f9370,_0x17e210);return _0x4c2f21(_0x1f9370);});});};module[_0x5acc('0xc')]=client; \ No newline at end of file +var _0xc991=['result','catch','exports','../../config/logger','ami','client','Request','request','then','debug','memberReport','error','rpc','message'];(function(_0x58439e,_0x4a638f){var _0x2226f6=function(_0x549a58){while(--_0x549a58){_0x58439e['push'](_0x58439e['shift']());}};_0x2226f6(++_0x4a638f);}(_0xc991,0x1ed));var _0x1c99=function(_0xa82b2,_0x3687d0){_0xa82b2=_0xa82b2-0x0;var _0x41bb66=_0xc991[_0xa82b2];return _0x41bb66;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1c99('0x0'))(_0x1c99('0x1'));var client=jayson[_0x1c99('0x2')]['http']({'port':0x2329});client[_0x1c99('0x3')]=function(_0x1570a0,_0x3d8f64){return new BPromise(function(_0x3827a2,_0x178e26){return client[_0x1c99('0x4')](_0x1570a0,_0x3d8f64)[_0x1c99('0x5')](function(_0x36fd5c){logger[_0x1c99('0x6')]('rpc',_0x1c99('0x7'),_0x1570a0,_0x3d8f64,_0x36fd5c);if(_0x36fd5c[_0x1c99('0x8')]){logger[_0x1c99('0x8')](_0x1c99('0x9'),_0x1c99('0x7'),_0x1570a0,_0x36fd5c[_0x1c99('0x8')]['message'],_0x3d8f64);return _0x178e26(_0x36fd5c[_0x1c99('0x8')][_0x1c99('0xa')]);}else{return _0x3827a2(_0x36fd5c[_0x1c99('0xb')]);}})[_0x1c99('0xc')](function(_0x1da4ac){logger['error']('rpc',_0x1c99('0x7'),_0x1570a0,_0x1da4ac,_0x3d8f64);return _0x178e26(_0x1da4ac);});});};module[_0x1c99('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 9269fc1..30d2673 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 _0xaa3f=['isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','VoiceQueueId','CampaignId','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','prototype','getQueue','exports','util','lodash','moment'];(function(_0x22ed4b,_0x20609c){var _0x4e9cf6=function(_0x3a2de1){while(--_0x3a2de1){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4e9cf6(++_0x20609c);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x401831,_0x39883d){_0x401831=_0x401831-0x0;var _0x3487ba=_0xaa3f[_0x401831];return _0x3487ba;};'use strict';var util=require(_0xfaa3('0x0'));var _=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));function checkNameSurname(_0x9c4aab,_0x1ebbfb,_0x1da39b){var _0x408343='';if(!_[_0xfaa3('0x3')](_0x1ebbfb)&&_0xfaa3('0x4')===typeof _0x1ebbfb){_0x408343+=_0x1ebbfb;}if(!_['isNil'](_0x1da39b)&&'string'===typeof _0x1da39b){_0x408343+='\x20'+_0x1da39b;}if(_0x408343!==''){return _0x408343;}return _0x9c4aab;}function Action(_0x2ac57f,_0x4bac92,_0x3d09aa){this[_0xfaa3('0x5')]=_0x2ac57f;this[_0xfaa3('0x6')]=_0x3d09aa||undefined;this[_0xfaa3('0x7')]=checkNameSurname(_0x4bac92[_0xfaa3('0x8')][_0xfaa3('0x9')],_0x4bac92[_0xfaa3('0x8')]['firstName'],_0x4bac92[_0xfaa3('0x8')][_0xfaa3('0xa')]);this['number']=_0x4bac92['Contact'][_0xfaa3('0x9')];this[_0xfaa3('0xb')]=_0x2ac57f[_0xfaa3('0x7')];this[_0xfaa3('0xc')]=_0x4bac92[_0xfaa3('0xc')]||![];this[_0xfaa3('0xd')]=_0x2ac57f['type'];this[_0xfaa3('0xe')]=_0x2ac57f['dialQueueTimeout']||0x3;this[_0xfaa3('0xf')]=_0x4bac92[_0xfaa3('0xf')];this[_0xfaa3('0x10')]=_0x4bac92['countbusyretry'];this[_0xfaa3('0x11')]=_0x4bac92['countcongestionretry'];this[_0xfaa3('0x12')]=_0x4bac92[_0xfaa3('0x12')];this[_0xfaa3('0x13')]=_0x4bac92[_0xfaa3('0x13')];this[_0xfaa3('0x14')]=_0x4bac92[_0xfaa3('0x14')];this['UserId']=_0x4bac92['UserId'];this[_0xfaa3('0x15')]=_0x4bac92[_0xfaa3('0x15')];this[_0xfaa3('0x16')]=_0x4bac92[_0xfaa3('0x16')];this['idHopper']=_0x4bac92['id'];this['ContactFirstName']=_0x4bac92['Contact']['firstName']||'';this['starttime']=moment()[_0xfaa3('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfaa3('0x18')]=_0x4bac92[_0xfaa3('0x18')];this[_0xfaa3('0x19')]=_0x4bac92[_0xfaa3('0x19')];this[_0xfaa3('0x1a')]=_0x4bac92[_0xfaa3('0x1a')];this[_0xfaa3('0x1b')]=_0x4bac92[_0xfaa3('0x1b')];this[_0xfaa3('0x1c')]='';this[_0xfaa3('0x1d')]='';}Action['prototype'][_0xfaa3('0x1e')]=function(){return util[_0xfaa3('0x17')](_0xfaa3('0x1f'),this[_0xfaa3('0x7')],this['voiceQueue'][_0xfaa3('0x20')]>0x0?this[_0xfaa3('0x21')][_0xfaa3('0x22')](this[_0xfaa3('0x5')][_0xfaa3('0x20')]):this[_0xfaa3('0x21')]);};Action[_0xfaa3('0x23')][_0xfaa3('0x24')]=function(){return this['queue'];};module[_0xfaa3('0x25')]=Action; \ No newline at end of file +var _0xea09=['format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime'];(function(_0xd40b0d,_0x1ba0d7){var _0x3cd6c2=function(_0x41ab4d){while(--_0x41ab4d){_0xd40b0d['push'](_0xd40b0d['shift']());}};_0x3cd6c2(++_0x1ba0d7);}(_0xea09,0xd0));var _0x9ea0=function(_0x318e36,_0x18be0f){_0x318e36=_0x318e36-0x0;var _0x45eb83=_0xea09[_0x318e36];return _0x45eb83;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9ea0('0x0'));function checkNameSurname(_0x52d790,_0x575b2f,_0x5615d5){var _0x24ccf8='';if(!_[_0x9ea0('0x1')](_0x575b2f)&&'string'===typeof _0x575b2f){_0x24ccf8+=_0x575b2f;}if(!_['isNil'](_0x5615d5)&&_0x9ea0('0x2')===typeof _0x5615d5){_0x24ccf8+='\x20'+_0x5615d5;}if(_0x24ccf8!==''){return _0x24ccf8;}return _0x52d790;}function Action(_0x64fc39,_0x53dd70,_0x37dd11){this[_0x9ea0('0x3')]=_0x64fc39;this[_0x9ea0('0x4')]=_0x37dd11||undefined;this[_0x9ea0('0x5')]=checkNameSurname(_0x53dd70[_0x9ea0('0x6')][_0x9ea0('0x7')],_0x53dd70[_0x9ea0('0x6')][_0x9ea0('0x8')],_0x53dd70['Contact'][_0x9ea0('0x9')]);this[_0x9ea0('0xa')]=_0x53dd70[_0x9ea0('0x6')][_0x9ea0('0x7')];this[_0x9ea0('0xb')]=_0x64fc39['name'];this[_0x9ea0('0xc')]=_0x53dd70[_0x9ea0('0xc')]||![];this[_0x9ea0('0xd')]=_0x64fc39['type'];this[_0x9ea0('0xe')]=_0x64fc39['dialQueueTimeout']||0x3;this['scheduledat']=_0x53dd70[_0x9ea0('0xf')];this['countbusyretry']=_0x53dd70[_0x9ea0('0x10')];this[_0x9ea0('0x11')]=_0x53dd70[_0x9ea0('0x11')];this[_0x9ea0('0x12')]=_0x53dd70[_0x9ea0('0x12')];this[_0x9ea0('0x13')]=_0x53dd70[_0x9ea0('0x13')];this['ListId']=_0x53dd70[_0x9ea0('0x14')];this[_0x9ea0('0x15')]=_0x53dd70[_0x9ea0('0x15')];this[_0x9ea0('0x16')]=_0x53dd70[_0x9ea0('0x16')];this[_0x9ea0('0x17')]=_0x53dd70[_0x9ea0('0x17')];this['idHopper']=_0x53dd70['id'];this[_0x9ea0('0x18')]=_0x53dd70['Contact']['firstName']||'';this[_0x9ea0('0x19')]=moment()[_0x9ea0('0x1a')](_0x9ea0('0x1b'));this[_0x9ea0('0x1c')]=_0x53dd70[_0x9ea0('0x1c')];this[_0x9ea0('0x1d')]=_0x53dd70[_0x9ea0('0x1d')];this[_0x9ea0('0x1e')]=_0x53dd70[_0x9ea0('0x1e')];this['recallme']=_0x53dd70[_0x9ea0('0x1f')];this[_0x9ea0('0x20')]='';this[_0x9ea0('0x21')]='';}Action[_0x9ea0('0x22')]['getCaller']=function(){return util['format'](_0x9ea0('0x23'),this['name'],this[_0x9ea0('0x3')][_0x9ea0('0x24')]>0x0?this[_0x9ea0('0xa')]['substring'](this[_0x9ea0('0x3')][_0x9ea0('0x24')]):this[_0x9ea0('0xa')]);};Action['prototype'][_0x9ea0('0x25')]=function(){return this['queue'];};module[_0x9ea0('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index c0f08d7..292784b 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 _0xa655=['countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','state','statedesc','Answer','scheduledat','type','countbusyretry'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xa655,0xc3));var _0x5a65=function(_0x35156b,_0x4f47e1){_0x35156b=_0x35156b-0x0;var _0x5e9bee=_0xa655[_0x35156b];return _0x5e9bee;};'use strict';var util=require(_0x5a65('0x0'));var _=require(_0x5a65('0x1'));var moment=require('moment');function getSeconds(_0x31f66a,_0x1f978a){var _0x5123be=moment(_0x31f66a)[_0x5a65('0x2')](0x0);var _0x588b4f=moment(_0x1f978a)[_0x5a65('0x2')](0x0);return _0x5123be['diff'](_0x588b4f,'seconds');}function AgentComplete(_0x227b49,_0x2d6093){this[_0x5a65('0x3')]=0x4;this[_0x5a65('0x4')]=_0x5a65('0x5');this[_0x5a65('0x6')]=_0x227b49[_0x5a65('0x6')];this[_0x5a65('0x7')]=_0x227b49[_0x5a65('0x7')];this['campaigntype']=_0x227b49[_0x5a65('0x7')]==='outbound'?'queue':_0x227b49['type'];this['countbusyretry']=_0x227b49[_0x5a65('0x8')];this[_0x5a65('0x9')]=_0x227b49['countcongestionretry'];this[_0x5a65('0xa')]=_0x227b49[_0x5a65('0xa')];this[_0x5a65('0xb')]=_0x227b49['countbusyretry']+_0x227b49[_0x5a65('0x9')]+_0x227b49[_0x5a65('0xa')];this[_0x5a65('0xc')]=_0x2d6093[_0x5a65('0xc')];this[_0x5a65('0xd')]=_0x227b49[_0x5a65('0xe')];this['calleridnum']=_0x227b49['number'];this[_0x5a65('0xf')]=_0x227b49[_0x5a65('0xf')];this[_0x5a65('0x10')]=_0x227b49[_0x5a65('0x10')];this[_0x5a65('0x11')]=_0x227b49[_0x5a65('0x11')];this[_0x5a65('0x12')]=moment()['format'](_0x5a65('0x13'));this['ringtime']=getSeconds(_0x227b49[_0x5a65('0x10')],_0x227b49['starttime']);this['holdtime']=getSeconds(_0x227b49['answertime'],_0x227b49[_0x5a65('0x10')]);this[_0x5a65('0x14')]=getSeconds(this[_0x5a65('0x12')],_0x227b49['answertime']);this[_0x5a65('0x15')]=_0x2d6093[_0x5a65('0x15')];this[_0x5a65('0x16')]=_0x2d6093[_0x5a65('0x16')];this[_0x5a65('0x17')]=_0x2d6093[_0x5a65('0x17')];this['callback']=_0x227b49[_0x5a65('0x18')];this['callbackuniqueid']=_0x227b49['callbackuniqueid'];this[_0x5a65('0x19')]=_0x227b49['callbackat'];this[_0x5a65('0x1a')]=_0x227b49[_0x5a65('0x1a')];this[_0x5a65('0x1b')]=_0x227b49[_0x5a65('0x1b')];this[_0x5a65('0x1c')]=_0x227b49[_0x5a65('0x1c')];this[_0x5a65('0x1d')]=_0x227b49[_0x5a65('0x1d')];this['VoiceQueueId']=_0x227b49[_0x5a65('0x1e')];this[_0x5a65('0x1f')]=_0x227b49[_0x5a65('0x1f')];this['originatecalleridnum']=_0x227b49[_0x5a65('0x20')]||'';this[_0x5a65('0x21')]=_0x227b49['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x9bc5=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x1d7211,_0x5725eb){var _0x1ddf5c=function(_0x458a78){while(--_0x458a78){_0x1d7211['push'](_0x1d7211['shift']());}};_0x1ddf5c(++_0x5725eb);}(_0x9bc5,0x198));var _0x59bc=function(_0x3adf3d,_0x13bf80){_0x3adf3d=_0x3adf3d-0x0;var _0x327fe4=_0x9bc5[_0x3adf3d];return _0x327fe4;};'use strict';var util=require(_0x59bc('0x0'));var _=require(_0x59bc('0x1'));var moment=require('moment');function getSeconds(_0xc75bf2,_0xdf48fd){var _0x3f4f83=moment(_0xc75bf2)[_0x59bc('0x2')](0x0);var _0x48ad89=moment(_0xdf48fd)[_0x59bc('0x2')](0x0);return _0x3f4f83[_0x59bc('0x3')](_0x48ad89,_0x59bc('0x4'));}function AgentComplete(_0x4c02da,_0x2e0e44){this[_0x59bc('0x5')]=0x4;this['statedesc']='Answer';this[_0x59bc('0x6')]=_0x4c02da[_0x59bc('0x6')];this['type']=_0x4c02da[_0x59bc('0x7')];this[_0x59bc('0x8')]=_0x4c02da[_0x59bc('0x7')]===_0x59bc('0x9')?_0x59bc('0xa'):_0x4c02da['type'];this['countbusyretry']=_0x4c02da[_0x59bc('0xb')];this[_0x59bc('0xc')]=_0x4c02da[_0x59bc('0xc')];this[_0x59bc('0xd')]=_0x4c02da['countnoanswerretry'];this[_0x59bc('0xe')]=_0x4c02da['countbusyretry']+_0x4c02da[_0x59bc('0xc')]+_0x4c02da[_0x59bc('0xd')];this[_0x59bc('0xf')]=_0x2e0e44[_0x59bc('0xf')];this[_0x59bc('0x10')]=_0x4c02da[_0x59bc('0x11')];this[_0x59bc('0x12')]=_0x4c02da[_0x59bc('0x13')];this[_0x59bc('0x14')]=_0x4c02da[_0x59bc('0x14')];this[_0x59bc('0x15')]=_0x4c02da['responsetime'];this[_0x59bc('0x16')]=_0x4c02da[_0x59bc('0x16')];this['endtime']=moment()['format'](_0x59bc('0x17'));this[_0x59bc('0x18')]=getSeconds(_0x4c02da[_0x59bc('0x15')],_0x4c02da[_0x59bc('0x14')]);this['holdtime']=getSeconds(_0x4c02da[_0x59bc('0x16')],_0x4c02da[_0x59bc('0x15')]);this[_0x59bc('0x19')]=getSeconds(this['endtime'],_0x4c02da[_0x59bc('0x16')]);this[_0x59bc('0xa')]=_0x2e0e44[_0x59bc('0xa')];this[_0x59bc('0x1a')]=_0x2e0e44[_0x59bc('0x1a')];this[_0x59bc('0x1b')]=_0x2e0e44[_0x59bc('0x1b')];this[_0x59bc('0x1c')]=_0x4c02da[_0x59bc('0x1c')];this[_0x59bc('0x1d')]=_0x4c02da[_0x59bc('0x1d')];this['callbackat']=_0x4c02da[_0x59bc('0x1e')];this[_0x59bc('0x1f')]=_0x4c02da[_0x59bc('0x1f')];this[_0x59bc('0x20')]=_0x4c02da[_0x59bc('0x20')];this[_0x59bc('0x21')]=_0x4c02da[_0x59bc('0x21')];this[_0x59bc('0x22')]=_0x4c02da['UserId'];this[_0x59bc('0x23')]=_0x4c02da[_0x59bc('0x23')];this[_0x59bc('0x24')]=_0x4c02da[_0x59bc('0x24')];this['originatecalleridnum']=_0x4c02da[_0x59bc('0x25')]||'';this[_0x59bc('0x26')]=_0x4c02da[_0x59bc('0x26')]||'';}module[_0x59bc('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 8470703..2ce2099 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 _0x8cda=['uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x8cda,0x1db));var _0xa8cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cda[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));function getSeconds(_0x43ea86,_0x14ca50){var _0x260677=moment(_0x43ea86)[_0xa8cd('0x2')](0x0);var _0x52a4ca=moment(_0x14ca50)[_0xa8cd('0x2')](0x0);return _0x260677[_0xa8cd('0x3')](_0x52a4ca,_0xa8cd('0x4'));}function Final(_0x5e90f5){this[_0xa8cd('0x5')]=_0x5e90f5[_0xa8cd('0x5')];this[_0xa8cd('0x6')]=_0x5e90f5[_0xa8cd('0x6')];this[_0xa8cd('0x7')]=_0x5e90f5[_0xa8cd('0x7')];this[_0xa8cd('0x8')]=_0x5e90f5[_0xa8cd('0x7')]==='outbound'?'queue':_0x5e90f5['type'];this[_0xa8cd('0x9')]=_0x5e90f5['countbusyretry'];this[_0xa8cd('0xa')]=_0x5e90f5[_0xa8cd('0xa')];this['countnoanswerretry']=_0x5e90f5[_0xa8cd('0xb')];this[_0xa8cd('0xc')]=_0x5e90f5['countbusyretry']+_0x5e90f5['countcongestionretry']+_0x5e90f5[_0xa8cd('0xb')];this[_0xa8cd('0xd')]=_0x5e90f5[_0xa8cd('0xd')];this[_0xa8cd('0xe')]=_0x5e90f5[_0xa8cd('0xe')];this['calleridnum']=_0x5e90f5[_0xa8cd('0xf')];this['starttime']=_0x5e90f5[_0xa8cd('0x10')];this['responsetime']=_0x5e90f5[_0xa8cd('0x11')];this['endtime']=_0x5e90f5[_0xa8cd('0x11')];this[_0xa8cd('0x12')]=_0x5e90f5[_0xa8cd('0x12')]||0x0;this['holdtime']=_0x5e90f5['holdtime']||0x0;this[_0xa8cd('0x13')]=_0x5e90f5[_0xa8cd('0x13')]||0x0;this[_0xa8cd('0x14')]=_0x5e90f5[_0xa8cd('0x14')];this['callbackuniqueid']=_0x5e90f5[_0xa8cd('0x15')];this['callbackat']=_0x5e90f5[_0xa8cd('0x16')];this[_0xa8cd('0x17')]=_0x5e90f5['recallme'];this[_0xa8cd('0x18')]=_0x5e90f5[_0xa8cd('0x18')];this['ListId']=_0x5e90f5[_0xa8cd('0x19')];this[_0xa8cd('0x1a')]=_0x5e90f5[_0xa8cd('0x1a')];this[_0xa8cd('0x1b')]=_0x5e90f5[_0xa8cd('0x1b')];this['CampaignId']=_0x5e90f5[_0xa8cd('0x1c')];this[_0xa8cd('0x1d')]=_0x5e90f5[_0xa8cd('0x1d')]||'';this[_0xa8cd('0x1e')]=_0x5e90f5['originatecalleridname']||'';}module[_0xa8cd('0x1f')]=Final; \ No newline at end of file +var _0x6d4b=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x51e983,_0x227722){_0x51e983=_0x51e983-0x0;var _0x58a8af=_0x6d4b[_0x51e983];return _0x58a8af;};'use strict';var util=require(_0xb6d4('0x0'));var _=require(_0xb6d4('0x1'));var moment=require(_0xb6d4('0x2'));function getSeconds(_0x5d6643,_0x14d398){var _0x180cf9=moment(_0x5d6643)['milliseconds'](0x0);var _0x4d5332=moment(_0x14d398)[_0xb6d4('0x3')](0x0);return _0x180cf9[_0xb6d4('0x4')](_0x4d5332,_0xb6d4('0x5'));}function Final(_0x2558ca){this[_0xb6d4('0x6')]=_0x2558ca[_0xb6d4('0x6')];this[_0xb6d4('0x7')]=_0x2558ca[_0xb6d4('0x7')];this['type']=_0x2558ca[_0xb6d4('0x8')];this[_0xb6d4('0x9')]=_0x2558ca[_0xb6d4('0x8')]===_0xb6d4('0xa')?_0xb6d4('0xb'):_0x2558ca[_0xb6d4('0x8')];this[_0xb6d4('0xc')]=_0x2558ca[_0xb6d4('0xc')];this[_0xb6d4('0xd')]=_0x2558ca[_0xb6d4('0xd')];this['countnoanswerretry']=_0x2558ca['countnoanswerretry'];this['countglobal']=_0x2558ca['countbusyretry']+_0x2558ca[_0xb6d4('0xd')]+_0x2558ca['countnoanswerretry'];this[_0xb6d4('0xb')]=_0x2558ca[_0xb6d4('0xb')];this[_0xb6d4('0xe')]=_0x2558ca[_0xb6d4('0xe')];this['calleridnum']=_0x2558ca[_0xb6d4('0xf')];this[_0xb6d4('0x10')]=_0x2558ca['starttime'];this[_0xb6d4('0x11')]=_0x2558ca['responsetime'];this[_0xb6d4('0x12')]=_0x2558ca[_0xb6d4('0x11')];this[_0xb6d4('0x13')]=_0x2558ca[_0xb6d4('0x13')]||0x0;this[_0xb6d4('0x14')]=_0x2558ca[_0xb6d4('0x14')]||0x0;this[_0xb6d4('0x15')]=_0x2558ca['talktime']||0x0;this[_0xb6d4('0x16')]=_0x2558ca[_0xb6d4('0x16')];this[_0xb6d4('0x17')]=_0x2558ca[_0xb6d4('0x17')];this[_0xb6d4('0x18')]=_0x2558ca[_0xb6d4('0x18')];this[_0xb6d4('0x19')]=_0x2558ca[_0xb6d4('0x19')];this[_0xb6d4('0x1a')]=_0x2558ca['ContactId'];this['ListId']=_0x2558ca[_0xb6d4('0x1b')];this[_0xb6d4('0x1c')]=_0x2558ca[_0xb6d4('0x1c')];this[_0xb6d4('0x1d')]=_0x2558ca[_0xb6d4('0x1d')];this['CampaignId']=_0x2558ca[_0xb6d4('0x1e')];this[_0xb6d4('0x1f')]=_0x2558ca[_0xb6d4('0x1f')]||'';this['originatecalleridname']=_0x2558ca[_0xb6d4('0x20')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 86c2ad5..9cefd44 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 _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(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 +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(_0x48814e,_0x543793){var _0x1517c4=function(_0x310024){while(--_0x310024){_0x48814e['push'](_0x48814e['shift']());}};_0x1517c4(++_0x543793);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 2d729ef..d9c94b6 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 _0xc00f=['endtime','ringtime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','number','starttime'];(function(_0x474ecb,_0x8e815c){var _0x5b1869=function(_0xccbb9){while(--_0xccbb9){_0x474ecb['push'](_0x474ecb['shift']());}};_0x5b1869(++_0x8e815c);}(_0xc00f,0x1e1));var _0xfc00=function(_0x487e2d,_0x1fe8ba){_0x487e2d=_0x487e2d-0x0;var _0xe4457c=_0xc00f[_0x487e2d];return _0xe4457c;};'use strict';var util=require(_0xfc00('0x0'));var _=require(_0xfc00('0x1'));var moment=require('moment');function getSeconds(_0x374273,_0x562954){var _0x87e7a9=moment(_0x374273)[_0xfc00('0x2')](0x0);var _0x199c66=moment(_0x562954)[_0xfc00('0x2')](0x0);return _0x87e7a9['diff'](_0x199c66,_0xfc00('0x3'));}function History(_0x536502){this[_0xfc00('0x4')]=_0x536502[_0xfc00('0x4')];this[_0xfc00('0x5')]=_0x536502[_0xfc00('0x5')]||undefined;this[_0xfc00('0x6')]=_0x536502[_0xfc00('0x6')];this['campaigntype']=_0x536502[_0xfc00('0x6')]==='outbound'?_0xfc00('0x7'):_0x536502[_0xfc00('0x6')];this[_0xfc00('0x8')]=_0x536502[_0xfc00('0x8')];this[_0xfc00('0x9')]=_0x536502[_0xfc00('0x9')];this[_0xfc00('0xa')]=_0x536502[_0xfc00('0xa')];this[_0xfc00('0xb')]=_0x536502[_0xfc00('0x8')]+_0x536502[_0xfc00('0x9')]+_0x536502[_0xfc00('0xa')];this[_0xfc00('0x7')]=_0x536502[_0xfc00('0x7')];this[_0xfc00('0xc')]=_0x536502['name'];this['calleridnum']=_0x536502[_0xfc00('0xd')];this[_0xfc00('0xe')]=_0x536502[_0xfc00('0xe')];this['responsetime']=_0x536502['responsetime'];this[_0xfc00('0xf')]=_0x536502['responsetime'];this[_0xfc00('0x10')]=getSeconds(_0x536502[_0xfc00('0x11')],_0x536502[_0xfc00('0xe')]);this['holdtime']=0x0;this[_0xfc00('0x12')]=0x0;this[_0xfc00('0x13')]=_0x536502[_0xfc00('0x13')];this[_0xfc00('0x14')]=_0x536502[_0xfc00('0x14')];this['callbackat']=_0x536502[_0xfc00('0x15')];this[_0xfc00('0x16')]=_0x536502[_0xfc00('0x16')];this[_0xfc00('0x17')]=_0x536502[_0xfc00('0x17')];this[_0xfc00('0x18')]=_0x536502[_0xfc00('0x18')];this[_0xfc00('0x19')]=_0x536502[_0xfc00('0x19')];this[_0xfc00('0x1a')]=_0x536502[_0xfc00('0x1a')];this['CampaignId']=_0x536502[_0xfc00('0x1b')];this[_0xfc00('0x1c')]=_0x536502[_0xfc00('0x1c')]||'';this[_0xfc00('0x1d')]=_0x536502[_0xfc00('0x1d')]||'';}module[_0xfc00('0x1e')]=History; \ No newline at end of file +var _0x35c6=['originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0x35c6,0x15f));var _0x635c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x35c6[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x635c('0x0'));var _=require(_0x635c('0x1'));var moment=require(_0x635c('0x2'));function getSeconds(_0x166fec,_0x498f18){var _0x665186=moment(_0x166fec)[_0x635c('0x3')](0x0);var _0x59072a=moment(_0x498f18)['milliseconds'](0x0);return _0x665186[_0x635c('0x4')](_0x59072a,_0x635c('0x5'));}function History(_0x48aa1d){this[_0x635c('0x6')]=_0x48aa1d[_0x635c('0x6')];this[_0x635c('0x7')]=_0x48aa1d[_0x635c('0x7')]||undefined;this[_0x635c('0x8')]=_0x48aa1d['type'];this[_0x635c('0x9')]=_0x48aa1d['type']===_0x635c('0xa')?_0x635c('0xb'):_0x48aa1d[_0x635c('0x8')];this['countbusyretry']=_0x48aa1d[_0x635c('0xc')];this[_0x635c('0xd')]=_0x48aa1d['countcongestionretry'];this['countnoanswerretry']=_0x48aa1d[_0x635c('0xe')];this[_0x635c('0xf')]=_0x48aa1d[_0x635c('0xc')]+_0x48aa1d[_0x635c('0xd')]+_0x48aa1d[_0x635c('0xe')];this[_0x635c('0xb')]=_0x48aa1d[_0x635c('0xb')];this[_0x635c('0x10')]=_0x48aa1d['name'];this[_0x635c('0x11')]=_0x48aa1d[_0x635c('0x12')];this[_0x635c('0x13')]=_0x48aa1d[_0x635c('0x13')];this['responsetime']=_0x48aa1d[_0x635c('0x14')];this[_0x635c('0x15')]=_0x48aa1d['responsetime'];this[_0x635c('0x16')]=getSeconds(_0x48aa1d[_0x635c('0x14')],_0x48aa1d[_0x635c('0x13')]);this[_0x635c('0x17')]=0x0;this[_0x635c('0x18')]=0x0;this[_0x635c('0x19')]=_0x48aa1d[_0x635c('0x19')];this['callbackuniqueid']=_0x48aa1d[_0x635c('0x1a')];this['callbackat']=_0x48aa1d[_0x635c('0x1b')];this['recallme']=_0x48aa1d['recallme'];this[_0x635c('0x1c')]=_0x48aa1d['ContactId'];this[_0x635c('0x1d')]=_0x48aa1d[_0x635c('0x1d')];this[_0x635c('0x1e')]=_0x48aa1d[_0x635c('0x1e')];this[_0x635c('0x1f')]=_0x48aa1d['VoiceQueueId'];this[_0x635c('0x20')]=_0x48aa1d[_0x635c('0x20')];this[_0x635c('0x21')]=_0x48aa1d['originatecalleridnum']||'';this[_0x635c('0x22')]=_0x48aa1d[_0x635c('0x22')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9c1f193..fdf26ae 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 _0x174c=['reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','TIMEOUT','outboundDropCallsDayCallersExit','Abandoned','syncNewExten','actionid','strategy','locked','paused','stateinterface','rrmemory','queueBooked','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','ContactId','CampaignId','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','interval','content','indexOf','iftime\x20%s,%s','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','Error','originate\x20action\x20Error','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','minutes','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','object','entity\x20is\x20undefine','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','[callProgressDetecting]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','talking','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','Contact.phone','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','lodash','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','uniqueId','startPredictive','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','message','AGENTS_NOT_LOGGED','name','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','emit','type','answered','pTalking','total','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','md5','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','[uniqueid]','actions','[actions]','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','variable','amdstatus','xcally-motion-dialer','HANGUP','uniqueid','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','outboundAnswerCallsDay','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','value','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow'];(function(_0x2bfe09,_0x243f2a){var _0x3a6bd7=function(_0x519f65){while(--_0x519f65){_0x2bfe09['push'](_0x2bfe09['shift']());}};_0x3a6bd7(++_0x243f2a);}(_0x174c,0x107));var _0xc174=function(_0x1f6553,_0x278aa0){_0x1f6553=_0x1f6553-0x0;var _0x5206da=_0x174c[_0x1f6553];return _0x5206da;};'use strict';var util=require(_0xc174('0x0'));var _=require(_0xc174('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0xc174('0x2'));var config=require(_0xc174('0x3'));var logger=require(_0xc174('0x4'))(_0xc174('0x5'));var loggerBooked=require(_0xc174('0x4'))(_0xc174('0x6'));var loggerPredictive=require(_0xc174('0x4'))(_0xc174('0x7'));var loggerPredictiveCalls=require(_0xc174('0x4'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xc174('0x8'));var ami=require(_0xc174('0x9'));config[_0xc174('0xa')]=_['defaults'](config['redis'],{'host':_0xc174('0xb'),'port':0x18eb});var io=require(_0xc174('0xc'))(new Redis(config[_0xc174('0xa')]));var cmHopper=require(_0xc174('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc174('0xe'));var cmHopperBlack=require(_0xc174('0xf'));var voiceQueueRt=require(_0xc174('0x10'));var Action=require(_0xc174('0x11'));var History=require(_0xc174('0x12'));var Final=require(_0xc174('0x13'));var AgentComplete=require(_0xc174('0x14'));var QueueCallerAbandon=require(_0xc174('0x15'));var Hangup=require(_0xc174('0x16'));var ipAgi=process[_0xc174('0x17')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0xc174('0x18')};var Sequence=function(){};Sequence[_0xc174('0x19')][_0xc174('0x1a')]=function(_0x2a3b9e){this['tail']=this[_0xc174('0x1b')]?this[_0xc174('0x1b')][_0xc174('0x1c')](_0x2a3b9e):_0x2a3b9e();};function Dialer(_0x37ed8a,_0x3e6abf){this[_0xc174('0x1d')]=new Sequence();this[_0xc174('0x1e')]=_0x3e6abf;this[_0xc174('0x1f')]=_0x37ed8a[_0xc174('0x1f')];this['campaigns']=_0x37ed8a[_0xc174('0x20')];this[_0xc174('0x21')]=_0x37ed8a['agents'];this['trunks']=_0x37ed8a[_0xc174('0x22')];this[_0xc174('0x23')]=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this['contactsId']={};this[_0xc174('0x24')]={};this['optionPredictive']={};this[_0xc174('0x25')]={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this[_0xc174('0x26')]={};ami['on'](_0xc174('0x27'),this[_0xc174('0x28')][_0xc174('0x29')](this));ami['on']('queuecallerabandon',this[_0xc174('0x2a')]['bind'](this));ami['on'](_0xc174('0x2b'),this[_0xc174('0x2c')][_0xc174('0x29')](this));ami['on'](_0xc174('0x2d'),this[_0xc174('0x2e')][_0xc174('0x29')](this));ami['on'](_0xc174('0x2f'),this['syncQueueSummary'][_0xc174('0x29')](this));ami['on'](_0xc174('0x30'),this[_0xc174('0x31')][_0xc174('0x29')](this));ami['on'](_0xc174('0x32'),this['syncNewExten']['bind'](this));ami['on'](_0xc174('0x33'),this[_0xc174('0x34')]['bind'](this));ami['on'](_0xc174('0x35'),this[_0xc174('0x36')]['bind'](this));ami['on'](_0xc174('0x37'),this[_0xc174('0x38')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x26b8e3){return _0x26b8e3!==null&&!_[_0xc174('0x39')](_0x26b8e3);}function checkIsLoggedIn(_0x10ee25,_0x4a64a4){return function(){if(_0x4a64a4<=0x0){_0x10ee25[_0xc174('0x3a')]=_0xc174('0x3b');throw _0x10ee25['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x48c57c){return _0x48c57c;}function checkIsActive(_0x149b6b,_0x42bf89){return function(){if(!isActive(_0x42bf89)){_0x149b6b[_0xc174('0x3a')]='NOT_ACTIVE';throw _0x149b6b[_0xc174('0x3c')]+'\x20NOT\x20Active';}};}function checkInterval(_0x3bc8c5){return function(){if(!isNotNull(_0x3bc8c5[_0xc174('0x3d')])){_0x3bc8c5[_0xc174('0x3a')]=_0xc174('0x3e');throw _0x3bc8c5[_0xc174('0x3c')]+_0xc174('0x3f');}if(!isNotNull(_0x3bc8c5[_0xc174('0x3d')][_0xc174('0x40')])){_0x3bc8c5[_0xc174('0x3a')]=_0xc174('0x3e');throw _0x3bc8c5[_0xc174('0x3c')]+_0xc174('0x3f');}if(!isNotNull(_[_0xc174('0x41')](_0x3bc8c5[_0xc174('0x3d')][_0xc174('0x40')]))){_0x3bc8c5[_0xc174('0x3a')]=_0xc174('0x3e');throw _0x3bc8c5[_0xc174('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3d4397,_0x510369,_0x324a11){return{'action':_0x3d4397,'response':_0x510369,'message':_0x324a11,'stack':_0x324a11};}function myreject(_0xe93e54){return function(_0x52c1bb){return _0xe93e54(msgResponse(_0xc174('0x42'),'Error',JSON[_0xc174('0x43')](_0x52c1bb)));};}function getSeconds(_0x40f689,_0x5957bc){var _0x159905=moment(_0x40f689)[_0xc174('0x44')](0x0);var _0x2b323c=moment(_0x5957bc)[_0xc174('0x44')](0x0);return _0x159905['diff'](_0x2b323c,_0xc174('0x45'));}function emit(_0x1331e5,_0x1b6a7d,_0x5c9695){io['to'](_0x1331e5)[_0xc174('0x46')](_0x1b6a7d,_0x5c9695);}function emitVoiceQueueSummary(_0x3448f6){if(_0x3448f6[_0xc174('0x47')]==='outbound'){var _0x412671={'id':_0x3448f6['id'],'name':_0x3448f6[_0xc174('0x3c')],'strategy':_0x3448f6['strategy'],'answered':_0x3448f6[_0xc174('0x48')],'available':_0x3448f6['available'],'loggedIn':_0x3448f6['loggedIn'],'pTalking':_0x3448f6[_0xc174('0x49')],'sumBillable':_0x3448f6['sumBillable'],'sumDuration':_0x3448f6['sumDuration'],'sumHoldTime':_0x3448f6['sumHoldTime']||0x0,'talking':_0x3448f6['talking'],'total':_0x3448f6[_0xc174('0x4a')],'type':_0x3448f6['type'],'unmanaged':_0x3448f6['unmanaged'],'abandoned':_0x3448f6['abandoned'],'waiting':_0x3448f6[_0xc174('0x4b')],'loggedInDb':_0x3448f6[_0xc174('0x4c')],'dialActive':_0x3448f6[_0xc174('0x4d')],'dialMethod':_0x3448f6['dialMethod'],'dialOriginateCallerIdName':_0x3448f6[_0xc174('0x4e')],'dialOriginateCallerIdNumber':_0x3448f6['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3448f6[_0xc174('0x4f')],'dialPrefix':_0x3448f6[_0xc174('0x50')],'outboundAnswerAgiCallsDay':_0x3448f6['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3448f6['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3448f6[_0xc174('0x51')],'outboundBusyCallsDay':_0x3448f6[_0xc174('0x52')],'outboundCongestionCallsDay':_0x3448f6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3448f6['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3448f6['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3448f6[_0xc174('0x53')],'outboundNoAnswerCallsDay':_0x3448f6[_0xc174('0x54')],'outboundNoSuchCallsDay':_0x3448f6[_0xc174('0x55')],'outboundOriginateFailureCallsDay':_0x3448f6[_0xc174('0x56')],'outboundReCallsDay':_0x3448f6[_0xc174('0x57')],'outboundRejectCallsDay':_0x3448f6['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3448f6['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3448f6[_0xc174('0x58')],'predictiveIntervalAvgHoldtime':_0x3448f6['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3448f6[_0xc174('0x59')],'predictiveIntervalDroppedCallsCallersExit':_0x3448f6[_0xc174('0x5a')],'predictiveIntervalDroppedCallsTimeout':_0x3448f6[_0xc174('0x5b')],'predictiveIntervalErlangCalls':_0x3448f6[_0xc174('0x5c')],'predictiveIntervalErlangCallsDroppedCalls':_0x3448f6[_0xc174('0x5d')],'predictiveIntervalHitRate':_0x3448f6[_0xc174('0x5e')],'predictiveIntervalMultiplicativeFactor':_0x3448f6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3448f6[_0xc174('0x5f')],'predictiveIntervalAvailable':_0x3448f6['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3448f6[_0xc174('0x60')],'message':_0x3448f6[_0xc174('0x3a')],'originated':_0x3448f6['originated'],'erlangCalls':_0x3448f6[_0xc174('0x61')],'erlangCallToSecond':_0x3448f6['erlangCallToSecond'],'erlangAbandonmentRate':_0x3448f6[_0xc174('0x62')],'erlangBusyFactor':_0x3448f6[_0xc174('0x63')],'startPredictive':_0x3448f6['startPredictive'],'startProgressive':_0x3448f6[_0xc174('0x64')]};if(_0x3448f6[_0xc174('0x65')]){_0x412671[_0xc174('0x65')]={'id':_0x3448f6[_0xc174('0x65')]['id'],'name':_0x3448f6[_0xc174('0x65')][_0xc174('0x3c')],'active':_0x3448f6[_0xc174('0x65')]['active'],'callerid':_0x3448f6['Trunk']['callerid']};}if(_0x3448f6[_0xc174('0x3d')]){_0x412671['Interval']={'id':_0x3448f6[_0xc174('0x3d')]['id'],'name':_0x3448f6['Interval'][_0xc174('0x3c')]};}var _0x4a46cc=md5(JSON[_0xc174('0x43')](_0x412671));if(_0x3448f6[_0xc174('0x66')]!==_0x4a46cc){_0x3448f6['md5']=_0x4a46cc;emit(util['format']('voice:queue:%s',_0x412671[_0xc174('0x3c')]),_0xc174('0x67'),_0x412671);}}}function emitCampaignSummary(_0x2e098d){if(_0x2e098d[_0xc174('0x47')]===_0xc174('0x68')){emit(util[_0xc174('0x69')](_0xc174('0x6a'),_0x2e098d[_0xc174('0x3c')]),_0xc174('0x6b'),_0x2e098d);}}function checkGetDataPredictive(_0x5b2c65){if(isNotNull(_0x5b2c65)){if(!_[_0xc174('0x41')](_0x5b2c65)){loggerPredictive['info'](_0xc174('0x6c'));loggerPredictive[_0xc174('0x6d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b2c65['predictiveIntervalTotalCalls']);loggerPredictive[_0xc174('0x6d')](_0xc174('0x6e'),_0x5b2c65[_0xc174('0x58')]);loggerPredictive[_0xc174('0x6d')](_0xc174('0x6f'),_0x5b2c65[_0xc174('0x5b')]);loggerPredictive[_0xc174('0x6d')](_0xc174('0x70'),_0x5b2c65['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b2c65['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xc174('0x71'),_0x5b2c65['predictiveIntervalAvgTalktime']);loggerPredictive[_0xc174('0x6d')](_0xc174('0x72'));if(_0x5b2c65[_0xc174('0x60')]>0x0){if(!_['isUndefined'](_0x5b2c65[_0xc174('0x59')])&&_0x5b2c65[_0xc174('0x59')]>0x0){return!![];}else{loggerPredictive['info'](_0xc174('0x73'));}if(!_[_0xc174('0x39')](_0x5b2c65[_0xc174('0x74')])&&_0x5b2c65[_0xc174('0x74')]>0x0){return!![];}else{loggerPredictive[_0xc174('0x6d')](_0xc174('0x75'));}}else{loggerPredictive[_0xc174('0x6d')](_0xc174('0x76'));}}else{loggerPredictive['info'](_0xc174('0x77'));}}else{loggerPredictive[_0xc174('0x6d')](_0xc174('0x77'));}return![];}function mergeDataErlangB(_0x3cf4e2){return function(_0x35f6bb){loggerPredictive[_0xc174('0x6d')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xc174('0x6d')](_0xc174('0x78'),_0x35f6bb[_0xc174('0x61')]);loggerPredictive[_0xc174('0x6d')](_0xc174('0x79'),_0x35f6bb[_0xc174('0x7a')]);loggerPredictive['info'](_0xc174('0x7b'),_0x35f6bb['erlangAbandonmentRate']);loggerPredictive['info'](_0xc174('0x7c'),_0x35f6bb['erlangBusyFactor']);loggerPredictive['info'](_0xc174('0x7b'),_0x35f6bb['erlangAbandonmentRate']);loggerPredictive[_0xc174('0x6d')](_0xc174('0x72'));_[_0xc174('0x7d')](_0x3cf4e2,_0x35f6bb);};}function getDiff(_0xb65081){var _0x2ff48b=moment()[_0xc174('0x44')](0x0);var _0x27c86b=moment(_0xb65081)[_0xc174('0x44')](0x0);return _0x2ff48b['diff'](_0x27c86b,_0xc174('0x45'));}function ifInterval(_0x39ff75,_0x200fea){if(_[_0xc174('0x39')](_0x200fea)){return![];}if(getDiff(_0x200fea)<_0x39ff75*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4e704d){if(isNotNull(_0x4e704d)){if(!_[_0xc174('0x39')](_0x4e704d[_0xc174('0x64')])){_0x4e704d[_0xc174('0x64')]=undefined;loggerPredictive['info'](_0x4e704d[_0xc174('0x3c')],_0xc174('0x7e'));}if(!_['isUndefined'](_0x4e704d[_0xc174('0x25')])){_0x4e704d[_0xc174('0x25')]=undefined;loggerPredictive['info'](_0x4e704d[_0xc174('0x3c')],_0xc174('0x7f'));}if(!_[_0xc174('0x39')](_0x4e704d['handlePredictive'])){clearInterval(_0x4e704d[_0xc174('0x80')]);_0x4e704d['handlePredictive']=undefined;loggerPredictive[_0xc174('0x6d')](_0x4e704d[_0xc174('0x3c')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4d876d,_0x4c7159){if(_0x4c7159===0x0){return 0x0;}var _0x2910f0=0x1;for(var _0x4b93c7=0x1;_0x4b93c7<=_0x4c7159;_0x4b93c7+=0x1){_0x2910f0=0x1+_0x2910f0*_0x4b93c7/_0x4d876d;}return 0x1/_0x2910f0;}function isVoiceQueueOutbound(_0x1461be){return _0x1461be===_0xc174('0x81');}function isNotPreview(_0x376957){return _0x376957!==_0xc174('0x1e');}function isCampaignIvr(_0x1eef3b){return _0x1eef3b===_0xc174('0x68');}function getCallerId(_0x49f800,_0x46688d,_0x59d2b7){if(!_[_0xc174('0x39')](_0x59d2b7)&&_0xc174('0x82')===typeof _0x59d2b7&&!_[_0xc174('0x41')](_0x59d2b7)){if(!_['isUndefined'](_0x46688d)&&_0xc174('0x82')===typeof _0x46688d&&!_[_0xc174('0x41')](_0x46688d)){return util[_0xc174('0x69')]('\x22%s\x22\x20<%s>',_0x46688d,_0x59d2b7);}return util[_0xc174('0x69')](_0xc174('0x83'),_0x59d2b7,_0x59d2b7);}if(!_[_0xc174('0x39')](_0x49f800)&&_0xc174('0x82')===typeof _0x49f800&&!_[_0xc174('0x41')](_0x49f800)){return _0x49f800;}return _0xc174('0x84');}function loggerCatchQueueSummary(_0x3d17dd,_0x1af493){return function(_0x3b22c9){freeVariablesPredictive(_0x1af493);emitVoiceQueueSummary(_0x1af493);emitCampaignSummary(_0x1af493);loggerSyncQueueSummary[_0xc174('0x85')](_0x3d17dd,util[_0xc174('0x86')](_0x3b22c9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3d2c71,_0x320ebd){return function(_0x3be489){loggerPredictive['error'](_0x320ebd['name'],_0x3d2c71);loggerPredictive['error'](_0x3be489['stack']);freeVariablesPredictive(_0x320ebd);};}function loggerCatch(_0x3c8238){return function(_0x57a5e){logger[_0xc174('0x85')](_0x3c8238,util['inspect'](_0x57a5e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x35571e){return _0x35571e&&!_[_0xc174('0x39')](_0x35571e)&&_0x35571e[_0xc174('0x87')]>0x0;}function decremetOriginate(_0x231e49){if(!_[_0xc174('0x39')](_0x231e49)&&_0x231e49!==null){if(_0x231e49[_0xc174('0x88')](_0xc174('0x89'))){if(_0x231e49[_0xc174('0x89')]>0x0){_0x231e49[_0xc174('0x89')]-=0x1;}else{logger[_0xc174('0x85')](_0xc174('0x8a'));}}}else{logger[_0xc174('0x85')](_0xc174('0x8b'));}}function checkContactLowerLimitOriginate(_0x231c0b,_0x5b98c0,_0x515d7d){if(_0x5b98c0>_0x515d7d){for(var _0x1454e1=0x0;_0x1454e1<_0x5b98c0-_0x515d7d;_0x1454e1+=0x1){decremetOriginate(_0x231c0b);}}}function loggerGetContactDialer(_0xdffcf3,_0x32a424,_0x3bacb6){return function(_0x4112da){checkContactLowerLimitOriginate(_0x32a424,_0x3bacb6,0x0);logger['error'](_0xdffcf3,util[_0xc174('0x86')](_0x4112da,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x481c0d){return function(_0xbb612f){if(isNotNull(_0xbb612f)&&isNotNull(_0xbb612f[0x0])){if(_0xbb612f[0x0][_0xc174('0x8c')]>0x0){_0x481c0d['message']=_0xc174('0x8d');logger['info'](_0xc174('0x8e')+_0x481c0d['name'],_0xbb612f[0x0][_0xc174('0x8c')],'contacts');}else{_0x481c0d[_0xc174('0x3a')]=_0xc174('0x8f');logger[_0xc174('0x6d')](_0xc174('0x90')+_0x481c0d[_0xc174('0x3c')]);}}};}function notSendMessagesQueue(_0x5b2908){if(_0x5b2908[_0xc174('0x91')]){freeVariablesPredictive(_0x5b2908);if(_0x5b2908['originated']===0x0&&_0x5b2908['talking']===0x0&&_0x5b2908[_0xc174('0x4b')]===0x0&&(_0x5b2908['pTalking']||0x0)===0x0){_0x5b2908[_0xc174('0x91')]=![];_0x5b2908['available']=0x0;_0x5b2908[_0xc174('0x3a')]=_0xc174('0x92');loggerSyncQueueSummary[_0xc174('0x85')](_0xc174('0x93'),_0x5b2908[_0xc174('0x3c')],'is\x20not\x20active');}else{_0x5b2908[_0xc174('0x3a')]=_0xc174('0x94');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5b2908[_0xc174('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x5b2908);}}function notSendMessagesCampaign(_0x384388){if(_0x384388[_0xc174('0x91')]){if(_0x384388[_0xc174('0x89')]===0x0){_0x384388[_0xc174('0x91')]=![];_0x384388[_0xc174('0x3a')]=_0xc174('0x92');loggerSyncQueueSummary['error'](_0xc174('0x95'),_0x384388['name'],'is\x20not\x20active');}else{_0x384388[_0xc174('0x3a')]=_0xc174('0x94');loggerSyncQueueSummary[_0xc174('0x85')](_0xc174('0x95'),_0x384388[_0xc174('0x3c')],'is\x20disactive');}emitCampaignSummary(_0x384388);}}function createObjHistory(_0x27f6aa,_0x4c888f,_0x3f0b5c,_0x4f2e09,_0x204954){_0x27f6aa[_0xc174('0x3a')]=_0x3f0b5c;var _0x17e8a3=new Action(_0x27f6aa,_0x4c888f);var _0x5a8e45=new History(_0x17e8a3);_0x5a8e45[_0xc174('0x96')]=_0x4f2e09;_0x5a8e45[_0xc174('0x97')]=_0x204954;_0x5a8e45[_0xc174('0x98')]=_0x17e8a3['starttime'];return _0x5a8e45;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x54c3f8=this;setInterval(function(){_0x54c3f8[_0xc174('0x99')](_0x54c3f8[_0xc174('0x24')],_0xc174('0x9a'));_0x54c3f8['clearZombieChannels'](_0x54c3f8[_0xc174('0x9b')],_0xc174('0x9c'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x6a466e,_0x2cce1b){var _0x380e96=this;for(var _0x26a8fa in _0x6a466e){if(_0x6a466e[_0xc174('0x88')](_0x26a8fa)){this[_0xc174('0x1d')]['enqueue'](function(){if(!_[_0xc174('0x9d')](_0x6a466e[_0x26a8fa])){return ami[_0xc174('0x9e')]({'action':_0xc174('0x9f'),'channel':_0x6a466e[_0x26a8fa][_0xc174('0xa0')]})[_0xc174('0xa1')](function(_0x28796a){if(_0x28796a[_0xc174('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x6a466e[_0x26a8fa]&&_0x6a466e[_0x26a8fa]['type']!==_0xc174('0x68')){_0x380e96[_0xc174('0xa2')](_0x380e96[_0xc174('0x1f')][_0x6a466e[_0x26a8fa][_0xc174('0xa3')]]);logger[_0xc174('0x85')](_0xc174('0xa4'),_0x2cce1b,_0x26a8fa,_0x6a466e[_0x26a8fa][_0xc174('0xa3')]);delete _0x6a466e[_0x26a8fa];}if(_0x6a466e[_0x26a8fa]&&_0x6a466e[_0x26a8fa][_0xc174('0x47')]===_0xc174('0x68')){_0x380e96['updateOriginated'](_0x380e96[_0xc174('0x20')][_0x6a466e[_0x26a8fa][_0xc174('0xa3')]]);logger[_0xc174('0x85')](_0xc174('0xa5'),_0x2cce1b,_0x26a8fa,_0x6a466e[_0x26a8fa][_0xc174('0xa3')]);delete _0x6a466e[_0x26a8fa];}},0x2328);}});}});}}};Dialer[_0xc174('0x19')]['countReScheduled']=function(_0x4f8257){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopper[_0xc174('0xa8')](_0x4f8257))[_0xc174('0xa1')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xc174('0x19')]['checkIsBlackList']=function(_0xe9c28f){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopperBlack[_0xc174('0xa9')](_0xe9c28f))[_0xc174('0xa1')](loggerCatch(_0xc174('0xaa')));};Dialer[_0xc174('0x19')][_0xc174('0xab')]=function(_0x3e22c5){return BPromise['resolve']()[_0xc174('0xa7')](cmHopperBlack['checkIsBlackListIvr'](_0x3e22c5))['catch'](loggerCatch(_0xc174('0xac')));};Dialer[_0xc174('0x19')]['averageHandleTime']=function(_0x146b0a){return BPromise[_0xc174('0xa6')]()['then'](cmHopperHistory[_0xc174('0xad')](_0x146b0a))[_0xc174('0xa1')](loggerCatch(_0xc174('0xae')));};Dialer[_0xc174('0x19')][_0xc174('0xaf')]=function(_0x299e7c){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopper[_0xc174('0xaf')](_0x299e7c))['catch'](loggerCatch(_0xc174('0xb0')));};Dialer[_0xc174('0x19')][_0xc174('0xb1')]=function(_0x6add82,_0x15665c,_0x356c22,_0x46dc56){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopper[_0xc174('0xb1')](_0x6add82,_0x15665c,_0x356c22,_0x46dc56))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xc174('0x19')]['getContactDialerIvr']=function(_0x334644,_0x4ffc73,_0xbf1ccc){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopper[_0xc174('0xb2')](_0x334644,_0x4ffc73,_0xbf1ccc))[_0xc174('0xa1')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0xc174('0xb3')]=function(_0x34759c){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](voiceQueueRt[_0xc174('0xb3')](_0x34759c))[_0xc174('0xa1')](loggerCatch(_0xc174('0xb4')));};Dialer[_0xc174('0x19')][_0xc174('0xb5')]=function(_0x5c9e40){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopper[_0xc174('0xb5')](_0x5c9e40))[_0xc174('0xa1')](loggerCatch(_0xc174('0xb6')));};Dialer[_0xc174('0x19')][_0xc174('0xb7')]=function(_0x2b2729){return BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](cmHopperHistory[_0xc174('0xb7')](_0x2b2729))[_0xc174('0xa1')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0xc174('0xa2')]=function(_0x4c32cb){if(!_[_0xc174('0x39')](_0x4c32cb)&&_0x4c32cb!==null){if(_0x4c32cb[_0xc174('0x88')](_0xc174('0x89'))){if(_0x4c32cb[_0xc174('0x89')]>0x0){_0x4c32cb[_0xc174('0x89')]-=0x1;}else{logger[_0xc174('0x85')](_0xc174('0xb8'));}}}else{logger[_0xc174('0x85')](_0xc174('0xb9'));}};Dialer[_0xc174('0x19')][_0xc174('0xba')]=function(_0x43fb98,_0x4d402b){var _0x276616=this;return function(_0x192f12){_0x276616['updateOriginated'](_0x4d402b);logger[_0xc174('0x85')](_0x43fb98,util[_0xc174('0x86')](_0x192f12,{'showHidden':![],'depth':null}));};};Dialer[_0xc174('0x19')][_0xc174('0xbb')]=function(_0x5b1a0c,_0x5dc4c3,_0x492f7f){var _0xf42c5f={'state':0x19,'statedesc':_0xc174('0xbc')};this[_0xc174('0xa2')](_0x5dc4c3);this[_0xc174('0xbd')](_[_0xc174('0x7d')](_0xf42c5f,_[_0xc174('0xbe')](_0x492f7f,['ContactId',_0xc174('0xbf'),_0xc174('0xc0'),_0xc174('0xc1'),'CampaignId'])),_0xc174('0xc2'),'[emptyContact]');logger[_0xc174('0x85')](_0x5b1a0c);};Dialer[_0xc174('0x19')][_0xc174('0xc3')]=function(_0x418017){return _0x418017===_0xc174('0xc4');};Dialer[_0xc174('0x19')][_0xc174('0xc5')]=function(_0xb9af5e){return!_[_0xc174('0x39')](_0xb9af5e)&&_0xb9af5e&&!_[_0xc174('0x39')](_0xb9af5e[_0xc174('0x3c')])&&!_[_0xc174('0x39')](_0xb9af5e[_0xc174('0xc6')])&&_0xb9af5e['active']&&(this[_0xc174('0x22')][util[_0xc174('0x69')](_0xc174('0xc7'),_0xb9af5e[_0xc174('0x3c')])][_0xc174('0x9f')]===_0xc174('0xc8')||this[_0xc174('0x22')][util[_0xc174('0x69')]('SIP/%s',_0xb9af5e[_0xc174('0x3c')])][_0xc174('0x9f')]===_0xc174('0xc9'));};Dialer['prototype'][_0xc174('0xbd')]=function(_0x1bc1e5,_0x128b32,_0x170375){this[_0xc174('0xb7')](_0x1bc1e5)['catch'](loggerCatch(_0x128b32));this[_0xc174('0xb5')](_0x1bc1e5)[_0xc174('0xa1')](loggerCatch(_0x170375));};Dialer['prototype'][_0xc174('0x34')]=function(_0xf63053){var _0x2b6809=this[_0xc174('0x24')][_0xf63053['uniqueid']];var _0x200edf;if(!_[_0xc174('0x9d')](_0xf63053)&&!_[_0xc174('0x9d')](_0xf63053['variable'])&&!_['isNil'](_0xf63053[_0xc174('0xca')][_0xc174('0xcb')])&&_0xf63053['exten']===_0xc174('0xcc')&&_0x2b6809){if(_0x2b6809[_0xc174('0x47')]!==_0xc174('0x68')&&this['voiceQueues'][_0x2b6809['queue']]['dialAMDActive']&&_0xf63053['value']===_0xc174('0xcd')){delete this['uniqueId'][_0xf63053[_0xc174('0xce')]];this[_0xc174('0xa2')](this[_0xc174('0x1f')][_0x2b6809[_0xc174('0xa3')]]);this[_0xc174('0x1f')][_0x2b6809[_0xc174('0xa3')]]['outboundAnswerCallsDay']+=0x1;this[_0xc174('0x1f')][_0x2b6809[_0xc174('0xa3')]][_0xc174('0xcf')]+=0x1;_0x200edf=new Hangup(_0x2b6809,_0xf63053);_0x200edf['state']=0x12;_0x200edf[_0xc174('0x97')]=_0xc174('0xd0');_0x200edf[_0xc174('0xd1')]=_0xc174('0xd2');this[_0xc174('0xbd')](_0x200edf,_0xc174('0xd3'),_0xc174('0xd4'));}if(_0x2b6809[_0xc174('0x47')]!==_0xc174('0x68')&&this[_0xc174('0x1f')][_0x2b6809[_0xc174('0xa3')]][_0xc174('0xd5')]&&_0xf63053['value']===_0xc174('0xd6')){delete this[_0xc174('0x24')][_0xf63053['uniqueid']];this[_0xc174('0xa2')](this[_0xc174('0x1f')][_0x2b6809[_0xc174('0xa3')]]);this[_0xc174('0x1f')][_0x2b6809[_0xc174('0xa3')]][_0xc174('0xd7')]+=0x1;this['voiceQueues'][_0x2b6809[_0xc174('0xa3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x200edf=new Hangup(_0x2b6809,_0xf63053);_0x200edf[_0xc174('0x96')]=0x13;_0x200edf[_0xc174('0x97')]=_0xc174('0xd8');_0x200edf[_0xc174('0xd1')]=_0xc174('0xd2');_0x200edf[_0xc174('0xd9')]=!![];this[_0xc174('0xbd')](_0x200edf,_0xc174('0xda'),_0xc174('0xdb'));}if(_0x2b6809[_0xc174('0x47')]===_0xc174('0x68')&&this[_0xc174('0x20')][_0x2b6809[_0xc174('0xa3')]]['dialAMDActive']&&_0xf63053['value']===_0xc174('0xcd')){delete this[_0xc174('0x24')][_0xf63053[_0xc174('0xce')]];this[_0xc174('0xa2')](this[_0xc174('0x20')][_0x2b6809[_0xc174('0xa3')]]);_0x200edf=new Hangup(_0x2b6809,_0xf63053);_0x200edf[_0xc174('0x96')]=0x12;_0x200edf['statedesc']=_0xc174('0xd0');_0x200edf[_0xc174('0xd1')]=_0xc174('0xd2');this[_0xc174('0xbd')](_0x200edf,_0xc174('0xdc'),_0xc174('0xdd'));}if(_0x2b6809[_0xc174('0x47')]==='ivr'&&this['campaigns'][_0x2b6809[_0xc174('0xa3')]][_0xc174('0xd5')]&&_0xf63053[_0xc174('0xde')]===_0xc174('0xd6')){delete this[_0xc174('0x24')][_0xf63053['uniqueid']];this[_0xc174('0xa2')](this[_0xc174('0x20')][_0x2b6809[_0xc174('0xa3')]]);_0x200edf=new Hangup(_0x2b6809,_0xf63053);_0x200edf[_0xc174('0x96')]=0x13;_0x200edf[_0xc174('0x97')]='Machine';_0x200edf[_0xc174('0xd1')]=_0xc174('0xd2');_0x200edf[_0xc174('0xd9')]=!![];this[_0xc174('0xbd')](_0x200edf,_0xc174('0xdf'),_0xc174('0xe0'));}}};Dialer[_0xc174('0x19')]['syncHangup']=function(_0x34b1dc){var _0x247a1b=this[_0xc174('0x24')][_0x34b1dc[_0xc174('0xce')]];var _0x589ec0=this;var _0x2e547c;if(_0x247a1b&&_0x247a1b['type']===_0xc174('0x68')){delete this['uniqueId'][_0x34b1dc['uniqueid']];this[_0xc174('0xa2')](this[_0xc174('0x20')][_0x247a1b[_0xc174('0xa3')]]);this['campaigns'][_0x247a1b[_0xc174('0xa3')]][_0xc174('0xe1')]+=0x1;_0x2e547c=new Hangup(_0x247a1b,_0x34b1dc);this['createHistory'](_0x2e547c)['catch'](loggerCatch(_0xc174('0xe2')));this[_0xc174('0xb5')](_0x2e547c)['catch'](loggerCatch(_0xc174('0xe3')));}if(_0x247a1b&&_0x247a1b[_0xc174('0x47')]!==_0xc174('0x68')&&isNotNull(this[_0xc174('0x1f')][_0x247a1b[_0xc174('0xa3')]]['dialQueueProject'])){delete this['uniqueId'][_0x34b1dc[_0xc174('0xce')]];this[_0xc174('0xa2')](this[_0xc174('0x1f')][_0x247a1b['queue']]);this['voiceQueues'][_0x247a1b['queue']][_0xc174('0xd7')]+=0x1;this[_0xc174('0x1f')][_0x247a1b[_0xc174('0xa3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2e547c=new Hangup(_0x247a1b,_0x34b1dc);_0x2e547c[_0xc174('0x96')]=0x10;_0x2e547c['statedesc']=_0xc174('0xe4');_0x2e547c[_0xc174('0xd1')]=_0xc174('0xe5');this['createHistory'](_0x2e547c)[_0xc174('0xa1')](loggerCatch(_0xc174('0xe2')));this[_0xc174('0xb5')](_0x2e547c)[_0xc174('0xa1')](loggerCatch(_0xc174('0xe3')));}if(_0x247a1b&&_0x247a1b['type']!==_0xc174('0x68')&&!isNotNull(this[_0xc174('0x1f')][_0x247a1b['queue']][_0xc174('0xe6')])){delete this[_0xc174('0x24')][_0x34b1dc['uniqueid']];this[_0xc174('0xa2')](this[_0xc174('0x1f')][_0x247a1b[_0xc174('0xa3')]]);this[_0xc174('0x1f')][_0x247a1b[_0xc174('0xa3')]][_0xc174('0xe7')]+=0x1;_0x2e547c=new Hangup(_0x247a1b,_0x34b1dc);_0x2e547c[_0xc174('0x96')]=0xc;_0x2e547c[_0xc174('0x97')]=_0x34b1dc[_0xc174('0xe8')];_0x2e547c['membername']=_0xc174('0xe9');this[_0xc174('0xb7')](_0x2e547c)[_0xc174('0xa1')](loggerCatch(_0xc174('0xe2')));this[_0xc174('0xb5')](_0x2e547c)[_0xc174('0xa1')](loggerCatch(_0xc174('0xe3')));}};Dialer[_0xc174('0x19')][_0xc174('0x2e')]=function(_0x57eeda){var _0x297886=this[_0xc174('0x24')][_0x57eeda[_0xc174('0xce')]];var _0x523829=this;if(this[_0xc174('0x1f')][_0x57eeda[_0xc174('0xa3')]]){if(_0x297886&&_0x297886['type']!==_0xc174('0x68')){delete this[_0xc174('0x24')][_0x57eeda[_0xc174('0xce')]];this[_0xc174('0x1f')][_0x57eeda[_0xc174('0xa3')]]['outboundAnswerCallsDay']+=0x1;var _0x5a6ec0=new AgentComplete(_0x297886,_0x57eeda);if(_0x57eeda[_0xc174('0xea')]===_0xc174('0xeb')){_0x5a6ec0[_0xc174('0xec')]=this[_0xc174('0x1f')][_0x57eeda[_0xc174('0xa3')]]['dialQueueProject2']&&this[_0xc174('0x1f')][_0x57eeda[_0xc174('0xa3')]][_0xc174('0xed')]?moment()['format'](_0xc174('0xee')):undefined;}this['createHistory'](_0x5a6ec0)[_0xc174('0xa1')](loggerCatch(_0xc174('0xef')));this['moveContactManagedDialer'](_0x5a6ec0)[_0xc174('0xa1')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xc174('0x28')]=function(_0x237fe9){if(this['voiceQueues'][_0x237fe9[_0xc174('0xa3')]]){if(this[_0xc174('0x24')][_0x237fe9[_0xc174('0xce')]]&&this[_0xc174('0x24')][_0x237fe9['uniqueid']][_0xc174('0x47')]!=='ivr'){this[_0xc174('0xa2')](this[_0xc174('0x1f')][_0x237fe9[_0xc174('0xa3')]]);this['uniqueId'][_0x237fe9['uniqueid']][_0xc174('0xf0')]=moment()[_0xc174('0x69')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xc174('0xf1')]=function(_0x33513d){this[_0xc174('0xb7')](_0x33513d)[_0xc174('0xa1')](loggerCatch(_0xc174('0xef')));this['moveContactManagedDialer'](_0x33513d)['catch'](loggerCatch(_0xc174('0xf2')));};Dialer['prototype'][_0xc174('0x2a')]=function(_0x49b98a){var _0x3cba9b=this['uniqueId'][_0x49b98a[_0xc174('0xce')]];var _0x3c3b81=this;if(this['voiceQueues'][_0x49b98a[_0xc174('0xa3')]]){if(_0x3cba9b&&_0x3cba9b[_0xc174('0x47')]!=='ivr'){delete this[_0xc174('0x24')][_0x49b98a[_0xc174('0xce')]];this[_0xc174('0xa2')](this[_0xc174('0x1f')][_0x49b98a[_0xc174('0xa3')]]);_0x3cba9b['droptime']=moment()[_0xc174('0x69')]('YYYY-MM-DD\x20HH:mm:ss');var _0x16fafb=new QueueCallerAbandon(_0x3cba9b,_0x49b98a);if(getSeconds(_0x3cba9b[_0xc174('0xf3')],_0x3cba9b['responsetime'])>=_0x3cba9b['dialQueueTimeout']){this[_0xc174('0x1f')][_0x49b98a[_0xc174('0xa3')]][_0xc174('0x5b')]+=0x1;this[_0xc174('0x1f')][_0x49b98a[_0xc174('0xa3')]][_0xc174('0x53')]+=0x1;this[_0xc174('0x1f')][_0x49b98a[_0xc174('0xa3')]][_0xc174('0x5d')]+=0x1;_0x16fafb[_0xc174('0x96')]=0xa;_0x16fafb[_0xc174('0x97')]=_0xc174('0xf4');_0x16fafb[_0xc174('0xf5')]=_0xc174('0xf6');_0x16fafb['agiafterat']=this[_0xc174('0x1f')][_0x49b98a[_0xc174('0xa3')]]['dialQueueProject2']?moment()[_0xc174('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xc174('0xf1')](_0x16fafb);}else{this['voiceQueues'][_0x49b98a['queue']][_0xc174('0x5a')]+=0x1;this[_0xc174('0x1f')][_0x49b98a[_0xc174('0xa3')]][_0xc174('0xf7')]+=0x1;_0x16fafb['state']=0xb;_0x16fafb[_0xc174('0x97')]=_0xc174('0xf8');_0x16fafb[_0xc174('0xf5')]='CALLEREXIT';this[_0xc174('0xf1')](_0x16fafb);}}}};Dialer[_0xc174('0x19')][_0xc174('0xf9')]=function(_0xa8c077){if(this[_0xc174('0x9b')][_0xa8c077[_0xc174('0xce')]]){this['actions'][_0xa8c077[_0xc174('0xce')]]['channel']=_0xa8c077[_0xc174('0xa0')];}if(this[_0xc174('0x24')][_0xa8c077[_0xc174('0xce')]]){this[_0xc174('0x24')][_0xa8c077['uniqueid']][_0xc174('0xa0')]=_0xa8c077[_0xc174('0xa0')];}};Dialer[_0xc174('0x19')][_0xc174('0x36')]=function(_0x2c68ac){if(strategy[this[_0xc174('0x1f')][this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xa3')]][_0xc174('0xfb')]]==='roundrobin'){if(this['actions'][_0x2c68ac[_0xc174('0xfa')]]&&_[_0xc174('0x9d')](this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xfc')])&&_0x2c68ac[_0xc174('0x9f')]==='1'&&_0x2c68ac[_0xc174('0xfd')]==='0'){if(this[_0xc174('0x21')][_0x2c68ac['stateinterface']]){if(!this[_0xc174('0x21')][_0x2c68ac[_0xc174('0xfe')]]['locked']){this[_0xc174('0x21')][_0x2c68ac[_0xc174('0xfe')]][_0xc174('0xfc')]=!![];this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xfc')]=!![];this['actions'][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xfe')]=_0x2c68ac[_0xc174('0xfe')];}}}}else if((strategy[this[_0xc174('0x1f')][this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xa3')]][_0xc174('0xfb')]]||'rrmemory')===_0xc174('0xff')){if(this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]]){if(this['agents'][_0x2c68ac['stateinterface']]){this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xfe')]=_0x2c68ac[_0xc174('0xfe')];if(_[_0xc174('0x9d')](this['queueBooked'][this[_0xc174('0x9b')][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xa3')]])){this[_0xc174('0x100')][this[_0xc174('0x9b')][_0x2c68ac['actionid']][_0xc174('0xa3')]]=[];}this[_0xc174('0x100')][this['actions'][_0x2c68ac[_0xc174('0xfa')]][_0xc174('0xa3')]]['push'](_['merge'](_[_0xc174('0xbe')](this['actions'][_0x2c68ac[_0xc174('0xfa')]],['idHopper','stateinterface']),{'status':_0x2c68ac[_0xc174('0x9f')],'paused':_0x2c68ac[_0xc174('0xfd')]}));}}}};function unlockQueueStatus(_0x51cde2,_0x25cef1){setTimeout(function(){if(_[_0xc174('0x39')](_0x51cde2['queueStatusComplete'])){loggerBooked[_0xc174('0x85')](_0xc174('0x101'),_0x25cef1);}_0x51cde2[_0xc174('0x102')]=!![];loggerBooked[_0xc174('0x6d')](_0xc174('0x103'),_0x25cef1,JSON['stringify'](_[_0xc174('0xbe')](_0x51cde2,[_0xc174('0x3c'),_0xc174('0x102')])));},0x1f3);}Dialer[_0xc174('0x19')][_0xc174('0x38')]=function(_0x5a3051){var _0x4f53f7=this;var _0x3fb088=_0x4f53f7[_0xc174('0x1f')][_0x4f53f7[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]];if(strategy[this['voiceQueues'][this['actions'][_0x5a3051['actionid']][_0xc174('0xa3')]][_0xc174('0xfb')]]===_0xc174('0x18')){if(this[_0xc174('0x9b')][_0x5a3051['actionid']]&&this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]]['stateinterface']){this[_0xc174('0x1e')][_0xc174('0x104')](this[_0xc174('0x9b')][_0x5a3051['actionid']]['idHopper'],this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xfe')])['catch'](function(_0x253d3c){logger['error'](_0xc174('0x105'),util[_0xc174('0x86')](_0x253d3c,{'showHidden':![],'depth':null}));})[_0xc174('0x1c')](function(){_0x4f53f7[_0xc174('0xa2')](_0x4f53f7['voiceQueues'][_0x4f53f7[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]);_0x4f53f7[_0xc174('0x21')][_0x4f53f7['actions'][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xfe')]]['locked']=![];delete _0x4f53f7[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]];unlockQueueStatus(_0x3fb088);});}else{this['updateOriginated'](this[_0xc174('0x1f')][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]);this[_0xc174('0xaf')]({'active':![],'ContactId':this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]]['ContactId'],'ListId':this['actions'][_0x5a3051['actionid']][_0xc174('0xbf')],'VoiceQueueId':this[_0xc174('0x9b')][_0x5a3051['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]]['CampaignId']||undefined})[_0xc174('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc174('0x9b')][_0x5a3051['actionid']];unlockQueueStatus(_0x3fb088);}}else if((strategy[this[_0xc174('0x1f')][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]][_0xc174('0xfb')]]||_0xc174('0xff'))==='rrmemory'){var _0x5df730;if(this['actions'][_0x5a3051[_0xc174('0xfa')]]&&!_[_0xc174('0x41')](this[_0xc174('0x100')][this['actions'][_0x5a3051['actionid']]['queue']])){if(this['queueBookedRR'][_0x4f53f7['actions'][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]){this[_0xc174('0x26')][_0x4f53f7[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]=this['queueBookedRR'][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]?this[_0xc174('0x26')][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]:this[_0xc174('0x100')][this[_0xc174('0x9b')][_0x5a3051['actionid']]['queue']]?this[_0xc174('0x100')][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]]['_rr']||0x0:0x0;}this[_0xc174('0x100')][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]]['queue']][_0xc174('0x106')]=this[_0xc174('0x26')][this[_0xc174('0x9b')][_0x5a3051[_0xc174('0xfa')]][_0xc174('0xa3')]];for(var _0x5821a9=0x0;_0x5821a9=0x0?!![]:![];})[_0xc174('0xa1')](myreject(_0x40b27b)));}}else{_0x1fe3ad[_0xc174('0x122')](ami[_0xc174('0x9e')]({'action':_0xc174('0x123'),'command':util[_0xc174('0x69')](_0xc174('0x127'),_0x4193f,!_['isUndefined'](config[_0xc174('0x11e')][_0x3b8904])?_0x3b8904:'')})['then'](function(_0x419f4d){return _0x419f4d[_0xc174('0x125')][_0xc174('0x126')](_0xc174('0x128'))>=0x0?!![]:![];})[_0xc174('0xa1')](myreject(_0x40b27b)));}BPromise[_0xc174('0x129')](_0x1fe3ad)[_0xc174('0xa7')](function(_0x5f1cf7){var _0x551100=_[_0xc174('0x12a')](_0x5f1cf7);if(_0x551100){return _0x554360(_0x551100);}else{_0x139e3d[_0xc174('0x3a')]=_0x1d02e5?_0xc174('0x12b'):'INTERVAL_IS_OVERTIME';return _0x40b27b(msgResponse(_0xc174('0x12c'),_0xc174('0x11c'),_0xc174('0x12d')+_0x1d02e5+'\x20'+_0x25b5d9+_0xc174('0x12e')+util[_0xc174('0x86')](_0x4193f,{'showHidden':![],'depth':null})+_0xc174('0x12f')+_0x3b8904));}})[_0xc174('0xa1')](function(_0x5a0bb0){return _0x40b27b(msgResponse(_0xc174('0x119'),'Failure',JSON[_0xc174('0x43')](_0x5a0bb0)));});});};Dialer[_0xc174('0x19')]['checkDialMethod']=function(_0x1b48ac){var _0x597013=this;return function(){switch(_0x1b48ac[_0xc174('0x130')]){case'progressive':freeVariablesPredictive(_0x1b48ac);_0x597013[_0xc174('0x131')](_0x1b48ac,0x1);break;case _0xc174('0x132'):freeVariablesPredictive(_0x1b48ac);_0x597013[_0xc174('0x131')](_0x1b48ac,_0x1b48ac[_0xc174('0x133')]);break;case _0xc174('0x7'):_0x597013[_0xc174('0x7')](_0x1b48ac);break;case'booked':freeVariablesPredictive(_0x1b48ac);_0x597013[_0xc174('0x131')](_0x1b48ac,0x1);break;default:freeVariablesPredictive(_0x1b48ac);logger[_0xc174('0x85')](_0xc174('0x134'),_0x1b48ac['name'],_0xc174('0x135'));}};};Dialer[_0xc174('0x19')][_0xc174('0x136')]=function(_0x47f717){var _0x83385=this;return function(){_0x83385[_0xc174('0x137')](_0x47f717);};};Dialer[_0xc174('0x19')]['syncQueueSummary']=function(_0x1c23f2){var _0x3175ab=this;if(isNotPreview(_0x1c23f2[_0xc174('0x130')])){if(isVoiceQueueOutbound(_0x1c23f2[_0xc174('0x47')])&&isActive(_0x1c23f2['dialActive'])){_0x1c23f2[_0xc174('0x91')]=!![];BPromise[_0xc174('0xa6')]()[_0xc174('0xa7')](checkIsLoggedIn(_0x1c23f2,_0x1c23f2[_0xc174('0x138')]))[_0xc174('0xa7')](checkIsActive(_0x1c23f2,_0x1c23f2[_0xc174('0x4d')]))[_0xc174('0xa7')](checkInterval(_0x1c23f2))[_0xc174('0xa7')](_0x3175ab['checkIsTrunkReachable'](_0x1c23f2))[_0xc174('0xa7')](_0x3175ab[_0xc174('0x117')](_0x1c23f2[_0xc174('0x139')],_0x1c23f2['dialTimezone'],_0x1c23f2['name'],_0x1c23f2))[_0xc174('0xa7')](_0x3175ab['checkIfTimeIntervals'](_0x1c23f2[_0xc174('0x3d')],_0x1c23f2[_0xc174('0x13a')],_0x1c23f2['name'],_0x1c23f2))['then'](_0x3175ab[_0xc174('0x13b')](_0x1c23f2))[_0xc174('0xa1')](loggerCatchQueueSummary(_0xc174('0x13c'),_0x1c23f2));}else{notSendMessagesQueue(_0x1c23f2);}}else{freeVariablesPredictive(_0x1c23f2);}};Dialer[_0xc174('0x19')][_0xc174('0x13d')]=function(){var _0x1bcbdd=this;var _0x8af371;for(var _0x561f4e in this['campaigns']){if(this['campaigns'][_0xc174('0x88')](_0x561f4e)){_0x8af371=this[_0xc174('0x20')][_0x561f4e];if(isCampaignIvr(_0x8af371[_0xc174('0x47')])&&isActive(_0x8af371[_0xc174('0xc6')])){_0x8af371[_0xc174('0x91')]=!![];BPromise[_0xc174('0xa6')]()['then'](checkIsActive(_0x8af371,_0x8af371['active']))[_0xc174('0xa7')](checkInterval(_0x8af371))[_0xc174('0xa7')](_0x1bcbdd['checkIsTrunkReachable'](_0x8af371))['then'](_0x1bcbdd[_0xc174('0x117')](_0x8af371[_0xc174('0x139')],_0x8af371[_0xc174('0x13a')],_0x8af371[_0xc174('0x3c')],_0x8af371))[_0xc174('0xa7')](_0x1bcbdd[_0xc174('0x118')](_0x8af371[_0xc174('0x3d')],_0x8af371[_0xc174('0x13a')],_0x8af371[_0xc174('0x3c')],_0x8af371))[_0xc174('0xa7')](_0x1bcbdd[_0xc174('0x136')](_0x8af371))[_0xc174('0xa1')](loggerCatchQueueSummary(_0xc174('0x13e'),_0x8af371));}else{notSendMessagesCampaign(_0x8af371);}}}};function getCallerIdRandom(_0xe3b6e4,_0x393276){var _0x5908f3,_0x41eea6,_0x40bf7f;if(_0x393276<=0x0){_0x393276=0x1;}_0x5908f3=new RegExp('\x5cw{0,'+_0x393276+'}$');_0x41eea6=Math[_0xc174('0x13f')](0xa,_0x393276-0x1);_0x40bf7f=Math[_0xc174('0x13f')](0xa,_0x393276)-0x1;return util[_0xc174('0x69')]('%s',_[_0xc174('0x140')](_0xe3b6e4,_0x5908f3,_[_0xc174('0x141')](_0x41eea6,_0x40bf7f)));}function extractCalleridName(_0x440a2){var _0x277815=_0x440a2[_0xc174('0x142')](/"(.*?)"/);return _0x277815?_0x277815[0x1]:_0x440a2;}function extractCalleridNumber(_0x2f4a99){var _0x3526da=_0x2f4a99[_0xc174('0x142')](/<(.*?)>/);return _0x3526da?_0x3526da[0x1]:_0x2f4a99;}Dialer[_0xc174('0x19')][_0xc174('0x143')]=function(_0x49085c,_0x3c9e4c){var _0x43a0cc=this;var _0x249f30=uuid['v4']();this[_0xc174('0x9b')][_0x249f30]=new Action(_0x49085c,_0x3c9e4c,_0x249f30);return new BPromise(function(_0x4d3a24,_0x36932b){if(_[_0xc174('0x39')](_0x49085c)&&'object'!==typeof _0x49085c){return _0x36932b(msgResponse(_0xc174('0x144'),_0xc174('0x11c'),_0xc174('0x145')));}if(_[_0xc174('0x39')](_0x3c9e4c['Contact'][_0xc174('0x146')])||_0x3c9e4c[_0xc174('0x147')]['phone']===null){return _0x36932b(msgResponse(_0xc174('0x144'),'Failure',_0xc174('0x148')));}var _0x5ccfc8={'XMD-CALLERID':_0x43a0cc[_0xc174('0x9b')][_0x249f30][_0xc174('0x149')](),'XMD-AGI':_0x49085c[_0xc174('0xe6')]?util[_0xc174('0x69')](_0xc174('0x14a'),ipAgi,_0x49085c[_0xc174('0xe6')]):_0xc174('0x14b'),'XMD-AGIAFTER':_0x49085c[_0xc174('0x14c')]?util[_0xc174('0x69')]('\x22agi://%s/square,%s\x22',ipAgi,_0x49085c[_0xc174('0x14c')]):_0xc174('0x14b'),'XMD-QUEUE':_0x49085c[_0xc174('0x47')]===_0xc174('0x81')?util[_0xc174('0x69')](_0xc174('0x14d'),_0x49085c[_0xc174('0x3c')],_0x49085c[_0xc174('0x14e')]||'',_0x49085c[_0xc174('0xed')]?'c':'',_0x49085c[_0xc174('0x14f')]||0x3):_0xc174('0x14b'),'XMD-CONTACTID':_0x3c9e4c['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x43a0cc[_0xc174('0x9b')][_0x249f30][_0xc174('0x149')](),'XMD-AMD':_0x49085c[_0xc174('0xd5')]?_0xc174('0x150'):_0xc174('0x14b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x49085c[_0xc174('0xd5')]){_0x5ccfc8[_0xc174('0x151')]=_0x49085c[_0xc174('0x152')]||0x9c4;_0x5ccfc8[_0xc174('0x153')]=_0x49085c[_0xc174('0x154')]||0x5dc;_0x5ccfc8[_0xc174('0x155')]=_0x49085c[_0xc174('0x156')]||0x320;_0x5ccfc8[_0xc174('0x157')]=_0x49085c['dialAMDTotalAnalysisTime']||0x1388;_0x5ccfc8['XMD-AMDMINWORDLENGTH']=_0x49085c[_0xc174('0x158')]||0x64;_0x5ccfc8[_0xc174('0x159')]=_0x49085c[_0xc174('0x15a')]||0x32;_0x5ccfc8[_0xc174('0x15b')]=_0x49085c[_0xc174('0x15c')]||0x3;_0x5ccfc8['XMD-AMDSILENCETHRESHOLD']=_0x49085c['dialAMDSilenceThreshold']||0x100;_0x5ccfc8['XMD-AMDMAXIMUMWORDLENGTH']=_0x49085c[_0xc174('0x15d')]||0x1388;}if(_0x49085c[_0xc174('0x47')]===_0xc174('0x81')){_0x5ccfc8[_0xc174('0x15e')]=_0x3c9e4c[_0xc174('0xc1')];}else{_0x5ccfc8[_0xc174('0x15f')]=_0x3c9e4c[_0xc174('0x10d')];}for(var _0x5c992f in _0x3c9e4c['Contact']){if(_0x3c9e4c['Contact'][_0xc174('0x88')](_0x5c992f)){if(isNotNull(_0x3c9e4c[_0xc174('0x147')][_0x5c992f])&&_0x5c992f!=='id'&&_0x5c992f!==_0xc174('0x160')&&_0x5c992f!==_0xc174('0x161')&&_0x5c992f!==_0xc174('0x162')){_0x5ccfc8[util['format']('%s%s',_0xc174('0x163'),_[_0xc174('0x164')](_0x5c992f))]=_0x3c9e4c[_0xc174('0x147')][_0x5c992f];}}}var _0xf5f2b5=_0x43a0cc['isTrunkReachable'](_0x49085c['Trunk'])?getCallerId(_0x49085c[_0xc174('0x65')][_0xc174('0x165')],_0x49085c[_0xc174('0x4e')],_0x49085c[_0xc174('0x166')]>0x0?getCallerIdRandom(_0x49085c['dialOriginateCallerIdNumber'],_0x49085c[_0xc174('0x166')]):_0x49085c['dialOriginateCallerIdNumber']):getCallerId(_[_0xc174('0x9d')](_0x49085c[_0xc174('0x167')])?_0x49085c['Trunk'][_0xc174('0x165')]:_0x49085c[_0xc174('0x167')][_0xc174('0x165')],_0x49085c[_0xc174('0x4e')],_0x49085c[_0xc174('0x166')]>0x0?getCallerIdRandom(_0x49085c[_0xc174('0x168')],_0x49085c[_0xc174('0x166')]):_0x49085c['dialOriginateCallerIdNumber']);if(_0xf5f2b5){_0x5ccfc8[_0xc174('0x169')]=_0x43a0cc[_0xc174('0x9b')][_0x249f30][_0xc174('0x16a')]=extractCalleridName(_0xf5f2b5);_0x5ccfc8[_0xc174('0x16b')]=_0x43a0cc[_0xc174('0x9b')][_0x249f30]['originatecalleridnum']=extractCalleridNumber(_0xf5f2b5);}return ami[_0xc174('0x9e')]({'actionid':_0x249f30,'action':_0xc174('0x144'),'channel':_0x43a0cc[_0xc174('0xc5')](_0x49085c[_0xc174('0x65')])?util[_0xc174('0x69')](_0xc174('0x16c'),_0x49085c[_0xc174('0x65')][_0xc174('0x3c')],isNotNull(_0x49085c[_0xc174('0x50')])?_0x49085c['dialPrefix'][_0xc174('0x16d')]()||'':'',_0x49085c[_0xc174('0x16e')]>0x0?_0x3c9e4c['Contact'][_0xc174('0x146')][_0xc174('0x16f')](_0x49085c[_0xc174('0x16e')]):_0x3c9e4c[_0xc174('0x147')][_0xc174('0x146')]):util[_0xc174('0x69')](_0xc174('0x16c'),_['isNil'](_0x49085c['TrunkBackup'])?_0x49085c[_0xc174('0x65')]['name']:_0x49085c[_0xc174('0x167')][_0xc174('0x3c')],isNotNull(_0x49085c['dialPrefix'])?_0x49085c[_0xc174('0x50')][_0xc174('0x16d')]()||'':'',_0x49085c[_0xc174('0x16e')]>0x0?_0x3c9e4c[_0xc174('0x147')]['phone'][_0xc174('0x16f')](_0x49085c['dialCutDigit']):_0x3c9e4c[_0xc174('0x147')]['phone']),'callerid':_0xf5f2b5,'Exten':_0xc174('0xcc'),'Context':_0xc174('0x170'),'Priority':'1','variable':_0x5ccfc8,'timeout':(_0x49085c[_0xc174('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x249f30})[_0xc174('0xa7')](function(_0x53ff6){return _0x4d3a24(_0x53ff6);})[_0xc174('0xa1')](function(_0x55c31e){_0x49085c[_0xc174('0x56')]+=0x1;var _0xa093bb=new History(_0x43a0cc['actions'][_0x249f30]);logger[_0xc174('0x85')](util[_0xc174('0x69')](_0xc174('0x171'),JSON['stringify'](_0x55c31e)));_0xa093bb[_0xc174('0x96')]=0xe;_0xa093bb[_0xc174('0x97')]=_0xc174('0x172');_0xa093bb[_0xc174('0x173')]=moment()[_0xc174('0x69')](_0xc174('0xee'));_0xa093bb[_0xc174('0x98')]=_0xa093bb[_0xc174('0x173')];_0x43a0cc['createHistory'](_0xa093bb)[_0xc174('0xa1')](loggerCatch(_0xc174('0x174')));_0x43a0cc[_0xc174('0xb5')](_0xa093bb)[_0xc174('0xa1')](loggerCatch('[originate][error]'))[_0xc174('0x1c')](function(){delete _0x43a0cc[_0xc174('0x9b')][_0x249f30];return _0x36932b(msgResponse('originate',_0xc174('0x175'),_0xc174('0x176')));});});});};Dialer['prototype'][_0xc174('0x2c')]=function(_0x3a4ec3){var _0x40e8ea=this[_0xc174('0x9b')][_0x3a4ec3['actionid']];var _0x116556=this;if(_0x40e8ea){delete this[_0xc174('0x9b')][_0x3a4ec3[_0xc174('0xfa')]];_0x40e8ea[_0xc174('0x177')]=moment()[_0xc174('0x69')](_0xc174('0xee'));var _0x4c28aa=_0x40e8ea[_0xc174('0x47')]===_0xc174('0x68')?this[_0xc174('0x20')][_0x40e8ea[_0xc174('0xa3')]]:this[_0xc174('0x1f')][_0x40e8ea['getQueue']()];if(!this[_0xc174('0xc3')](_0x3a4ec3[_0xc174('0x178')])){this[_0xc174('0xa2')](_0x4c28aa);return this[_0xc174('0x179')](_0x40e8ea,_0x4c28aa,_0x3a4ec3)[_0xc174('0xa7')](function(_0x45781c){})[_0xc174('0xa1')](loggerCatch(_0xc174('0x17a')));}else{this['uniqueId'][_0x3a4ec3[_0xc174('0xce')]]=_0x40e8ea;}}};Dialer[_0xc174('0x19')]['checkRetriveMax']=function(_0x23f616,_0xc0f5f7,_0x426ed){var _0x51c387=new History(_0xc0f5f7);if(_0x51c387['countbusyretry']+_0x51c387[_0xc174('0x17b')]+_0x51c387[_0xc174('0x17c')]>=_0x426ed[_0xc174('0x17d')]-0x1){return!![];}switch(_0x23f616){case 0x3:if(_0x51c387[_0xc174('0x17c')]>=_0x426ed[_0xc174('0x17e')]-0x1){return!![];}else{this[_0xc174('0xaf')]({'active':![],'countnoanswerretry':_0x51c387[_0xc174('0x17c')]+=0x1,'scheduledat':moment()[_0xc174('0x17f')](_0x426ed[_0xc174('0x180')],'minutes')[_0xc174('0x69')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51c387[_0xc174('0x10c')],'ListId':_0x51c387['ListId'],'VoiceQueueId':_0x51c387[_0xc174('0xc1')]||undefined,'CampaignId':_0x51c387[_0xc174('0x10d')]||undefined})[_0xc174('0xa1')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x51c387[_0xc174('0x181')]>=_0x426ed[_0xc174('0x182')]-0x1){return!![];}else{this[_0xc174('0xaf')]({'active':![],'countbusyretry':_0x51c387['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x426ed[_0xc174('0x183')],_0xc174('0x184'))['format'](_0xc174('0xee')),'ContactId':_0x51c387[_0xc174('0x10c')],'ListId':_0x51c387[_0xc174('0xbf')],'VoiceQueueId':_0x51c387[_0xc174('0xc1')]||undefined,'CampaignId':_0x51c387[_0xc174('0x10d')]||undefined})['catch'](loggerCatch(_0xc174('0x185')));}break;case 0x8:if(_0x51c387[_0xc174('0x17b')]>=_0x426ed['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0xc174('0xaf')]({'active':![],'countcongestionretry':_0x51c387['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x426ed[_0xc174('0x186')],_0xc174('0x184'))['format'](_0xc174('0xee')),'ContactId':_0x51c387[_0xc174('0x10c')],'ListId':_0x51c387['ListId'],'VoiceQueueId':_0x51c387[_0xc174('0xc1')]||undefined,'CampaignId':_0x51c387['CampaignId']||undefined})['catch'](loggerCatch(_0xc174('0x187')));}break;default:return!![];}};Dialer[_0xc174('0x19')]['callProgressDetecting']=function(_0x5424cf,_0x3e2410,_0x36fc3b){var _0x54b526=this;var _0x42fc8a=new History(_0x5424cf);return new BPromise(function(_0x24442d,_0x26fc50){if(_[_0xc174('0x39')](_0x3e2410)&&_0xc174('0x188')!==typeof _0x3e2410){return _0x26fc50(msgResponse('[callProgressDetecting]','Failure',_0xc174('0x189')));}if(_[_0xc174('0x39')](_0x36fc3b)&&'object'!==typeof _0x36fc3b){return _0x26fc50(msgResponse('[callProgressDetecting]',_0xc174('0x11c'),_0xc174('0x18a')));}switch(_0x36fc3b['reason']){case'0':_0x3e2410['outboundNoSuchCallsDay']+=0x1;_0x42fc8a[_0xc174('0x96')]=0x0;_0x42fc8a[_0xc174('0x97')]='NoSuchNumber';_0x54b526['createHistory'](_0x42fc8a)[_0xc174('0xa1')](loggerCatch(_0xc174('0x18b')));if(_0x54b526[_0xc174('0x18c')](0x0,_0x5424cf,_0x3e2410)){if(_0x42fc8a[_0xc174('0x181')]+_0x42fc8a['countcongestionretry']+_0x42fc8a['countnoanswerretry']>=_0x3e2410[_0xc174('0x17d')]){_0x54b526[_0xc174('0x18d')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x18e'));}else{_0x54b526[_0xc174('0x18f')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x18e'));}}break;case'3':_0x3e2410[_0xc174('0x54')]+=0x1;_0x42fc8a['state']=0x3;_0x42fc8a[_0xc174('0x97')]=_0xc174('0x190');_0x42fc8a[_0xc174('0x17c')]+=0x1;_0x42fc8a[_0xc174('0x191')]+=0x1;_0x54b526[_0xc174('0xb7')](_0x42fc8a)[_0xc174('0xa1')](loggerCatch(_0xc174('0x192')));if(_0x54b526[_0xc174('0x18c')](0x3,_0x5424cf,_0x3e2410)){if(_0x42fc8a[_0xc174('0x17c')]>=_0x3e2410[_0xc174('0x17e')]){_0x54b526[_0xc174('0x18f')](_0x42fc8a,_0x24442d,_0x26fc50,'reason\x203\x20ringing\x20no\x20answer');}else{_0x54b526[_0xc174('0x18d')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x193'));}}break;case'5':_0x3e2410[_0xc174('0x52')]+=0x1;_0x42fc8a[_0xc174('0x96')]=0x5;_0x42fc8a[_0xc174('0x97')]='Busy';_0x42fc8a[_0xc174('0x181')]+=0x1;_0x42fc8a['countglobal']+=0x1;_0x54b526[_0xc174('0xb7')](_0x42fc8a)[_0xc174('0xa1')](loggerCatch(_0xc174('0x194')));if(_0x54b526['checkRetriveMax'](0x5,_0x5424cf,_0x3e2410)){if(_0x42fc8a[_0xc174('0x181')]>=_0x3e2410[_0xc174('0x182')]){_0x54b526[_0xc174('0x18f')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x195'));}else{_0x54b526[_0xc174('0x18d')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x195'));}}break;case'8':_0x3e2410[_0xc174('0x196')]+=0x1;_0x42fc8a[_0xc174('0x96')]=0x8;_0x42fc8a[_0xc174('0x97')]='Congestion';_0x42fc8a['countcongestionretry']+=0x1;_0x42fc8a[_0xc174('0x191')]+=0x1;_0x54b526[_0xc174('0xb7')](_0x42fc8a)[_0xc174('0xa1')](loggerCatch(_0xc174('0x197')));if(_0x54b526[_0xc174('0x18c')](0x8,_0x5424cf,_0x3e2410)){if(_0x42fc8a[_0xc174('0x17b')]>=_0x3e2410['dialCongestionMaxRetry']){_0x54b526[_0xc174('0x18f')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x198'));}else{_0x54b526[_0xc174('0x18d')](_0x42fc8a,_0x24442d,_0x26fc50,_0xc174('0x198'));}}break;default:_0x3e2410[_0xc174('0xe7')]+=0x1;_0x42fc8a[_0xc174('0x96')]=0xc;_0x42fc8a['statedesc']=_0x36fc3b[_0xc174('0xea')];_0x54b526['createHistory'](_0x42fc8a)[_0xc174('0xa1')](loggerCatch(_0xc174('0x199')));if(_0x54b526['checkRetriveMax'](_0x36fc3b['reason'],_0x5424cf,_0x3e2410)){if(_0x42fc8a[_0xc174('0x181')]+_0x42fc8a[_0xc174('0x17b')]+_0x42fc8a[_0xc174('0x17c')]>=_0x3e2410[_0xc174('0x17d')]){_0x54b526[_0xc174('0x18d')](_0x42fc8a,_0x24442d,_0x26fc50,_0x36fc3b[_0xc174('0xea')]);}else{_0x54b526[_0xc174('0x18f')](_0x42fc8a,_0x24442d,_0x26fc50,_0x36fc3b[_0xc174('0xea')]);}}}});};Dialer[_0xc174('0x19')]['stateGlobal']=function(_0x59b6df,_0x582048,_0x365586,_0xd03543){var _0x491dca=new Final(_0x59b6df);_0x491dca[_0xc174('0x96')]=0xf;_0x491dca['statedesc']='Global';this[_0xc174('0x18f')](_0x491dca,_0x582048,_0x365586,_0xd03543);};Dialer[_0xc174('0x19')]['createStateFinal']=function(_0x2b5fd3,_0x1db981,_0x4078a2,_0x6154a4){this[_0xc174('0xb5')](_0x2b5fd3)[_0xc174('0xa7')](function(_0x5be552){return _0x1db981(msgResponse(_0xc174('0x19a'),_0xc174('0xc4'),_0x6154a4));})[_0xc174('0xa1')](function(_0x1297dd){return _0x4078a2(msgResponse('[moveContactManagedDialer][0]',_0xc174('0x11c'),'contact\x20not\x20moved'));});};Dialer[_0xc174('0x19')][_0xc174('0x7')]=function(_0x27220d){var _0xa46a7=this;var _0x331174=_0x27220d[_0xc174('0x19b')]/0x64;var _0x5605b7=_0x27220d[_0xc174('0x53')]/(_0x27220d[_0xc174('0x53')]+_0x27220d[_0xc174('0xd7')]);var _0x217a6f=Math[_0xc174('0x19c')](_0x27220d[_0xc174('0x19d')]*(_0x27220d[_0xc174('0x19e')]/0x64));var _0x28f486=Math[_0xc174('0x19c')](_0x27220d[_0xc174('0x19d')]*(_0x27220d[_0xc174('0x19f')]/0x64));var _0x4a625a=_0x27220d[_0xc174('0x1a0')]+_0x27220d[_0xc174('0x1a1')];var _0x2974f4=Math[_0xc174('0x1a2')](_0x27220d[_0xc174('0x61')]*_0x27220d[_0xc174('0x62')]*_0x27220d[_0xc174('0x5e')]*_0x27220d[_0xc174('0x1a3')]);if(_[_0xc174('0x39')](_0x27220d['startProgressive'])){if(!_[_0xc174('0x39')](_0x27220d[_0xc174('0x25')])){_0x27220d[_0xc174('0x25')]=undefined;loggerPredictive[_0xc174('0x85')](_0xc174('0x1a4'),_0xc174('0x1a5'));}if(!_['isUndefined'](_0x27220d[_0xc174('0x80')])){loggerPredictive[_0xc174('0x85')](_0xc174('0x1a4'),_0xc174('0x1a6'));clearInterval(_0x27220d[_0xc174('0x80')]);_0x27220d[_0xc174('0x80')]=undefined;}_0x27220d[_0xc174('0x64')]=moment()[_0xc174('0x69')](_0xc174('0xee'));loggerPredictive['info'](_0x27220d[_0xc174('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x27220d[_0xc174('0x64')]);this[_0xc174('0x131')](_0x27220d,0x1);}else if(ifInterval(_0x27220d[_0xc174('0x1a7')],_0x27220d[_0xc174('0x64')])){this[_0xc174('0x131')](_0x27220d,0x1);loggerPredictiveCalls[_0xc174('0x6d')](_0xc174('0x1a8'),_0x27220d['startProgressive'],_0x27220d[_0xc174('0x3c')]);_0x27220d[_0xc174('0x61')]=0x0;_0x27220d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x331174<_0x5605b7&&_0x27220d[_0xc174('0x1a9')]==='dropRate'){freeVariablesPredictive(_0x27220d);loggerPredictive[_0xc174('0x6d')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc174('0x1aa'),_0x5605b7,_0xc174('0x64'),_0x27220d[_0xc174('0x3c')]);}else if(_0x2974f4<_0x27220d['predictiveIntervalErlangCallsDroppedCalls']&&_0x27220d['dialPredictiveOptimization']===_0xc174('0x1ab')){freeVariablesPredictive(_0x27220d);loggerPredictive[_0xc174('0x6d')](_0xc174('0x1ac'),'Max\x20Drop\x20',_0x2974f4,_0xc174('0x1ad'),_0x27220d[_0xc174('0x5d')],_0xc174('0x64'),_0x27220d[_0xc174('0x3c')]);}else if(!ifInterval(_0x27220d[_0xc174('0x1a7')],_0x27220d[_0xc174('0x64')])&&_[_0xc174('0x39')](_0x27220d[_0xc174('0x25')])&&!_[_0xc174('0x39')](_0x27220d[_0xc174('0x64')])){_0x27220d[_0xc174('0x25')]=moment()[_0xc174('0x69')](_0xc174('0xee'));loggerPredictive[_0xc174('0x6d')](_0x27220d[_0xc174('0x3c')],_0xc174('0x1ae'),_0x27220d['startPredictive']);this[_0xc174('0x1af')](_0x27220d['dialPredictiveInterval'])[_0xc174('0xa7')](this[_0xc174('0x1b0')](_0x27220d))[_0xc174('0xa7')](mergeDataErlangB(_0x27220d))[_0xc174('0xa7')](this[_0xc174('0x1b1')](_0x27220d))['catch'](loggerCatchPredictive(_0xc174('0x1b2'),_0x27220d));}else if(!ifInterval(_0x27220d[_0xc174('0x1a7')],_0x27220d[_0xc174('0x25')])){_0x27220d['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x27220d[_0xc174('0x25')]=moment()[_0xc174('0x69')](_0xc174('0xee'));loggerPredictive['info'](_0x27220d[_0xc174('0x3c')],'recalculate\x20predictive\x20at',_0x27220d[_0xc174('0x25')]);clearInterval(_0x27220d[_0xc174('0x80')]);_0x27220d[_0xc174('0x80')]=undefined;this[_0xc174('0x1af')](_0x27220d[_0xc174('0x1a7')])['then'](this[_0xc174('0x1b0')](_0x27220d))['then'](mergeDataErlangB(_0x27220d))[_0xc174('0xa7')](this[_0xc174('0x1b1')](_0x27220d))[_0xc174('0xa1')](loggerCatchPredictive(_0xc174('0x1b3'),_0x27220d));}else if(_0x27220d['predictiveIntervalAvailable']&&_0x4a625a<_0x27220d[_0xc174('0x19d')]-_0x28f486){freeVariablesPredictive(_0x27220d);loggerPredictive[_0xc174('0x6d')](_0x27220d[_0xc174('0x3c')],_0xc174('0x1b4'),_0x4a625a,_0xc174('0x1b5'),_0x27220d[_0xc174('0x19d')],'-',_0x28f486,'=',_0x27220d['predictiveIntervalAvailable']-_0x28f486,')');}else if(_0x27220d[_0xc174('0x19d')]&&_0x4a625a>_0x27220d[_0xc174('0x19d')]+_0x217a6f){freeVariablesPredictive(_0x27220d);loggerPredictive[_0xc174('0x6d')](_0x27220d[_0xc174('0x3c')],_0xc174('0x1b4'),_0x4a625a,_0xc174('0x1b6'),_0x27220d[_0xc174('0x19d')],'+',_0x217a6f,'=',_0x27220d['predictiveIntervalAvailable']+_0x217a6f,')');}};Dialer[_0xc174('0x19')][_0xc174('0x1b0')]=function(_0x28ad1a){var _0x58c088=this;return function(_0x7d268f){return new BPromise(function(_0x4e9195,_0x449eb0){_[_0xc174('0x7d')](_0x28ad1a,_0x7d268f[0x0]);if(checkGetDataPredictive(_0x7d268f[0x0])){var _0x14e9e0=_0x28ad1a[_0xc174('0x19d')]=_0x28ad1a[_0xc174('0x1a1')]+_0x28ad1a[_0xc174('0x1a0')];var _0x1874a7=_0x28ad1a[_0xc174('0x1a7')]*0x3c;var _0x2fe82c=_0x7d268f[0x0]['predictiveIntervalAvgTalktime']+_0x7d268f[0x0][_0xc174('0x74')];var _0x1a313b=(_0x7d268f[0x0][_0xc174('0x58')]+_0x7d268f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x7d268f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x7d268f[0x0][_0xc174('0x60')];_0x28ad1a[_0xc174('0x5e')]=_0x1a313b>0x0?_0x1a313b:0x1;switch(_0x28ad1a[_0xc174('0x1a9')]){case _0xc174('0x1ab'):var _0x1ae927=_0x28ad1a['dialPredictiveOptimizationPercentage']/0x64;return _0x58c088[_0xc174('0x1b7')](_0x14e9e0,_0x1874a7,_0x2fe82c,_0x1a313b,_0x1ae927)['then'](function(_0x5af784){return _0x4e9195(_0x5af784);});case _0xc174('0x1b8'):var _0x4e6a14=_0x28ad1a[_0xc174('0x19b')]/0x64;return _0x58c088[_0xc174('0x1b9')](_0x14e9e0,_0x1874a7,_0x2fe82c,_0x1a313b,_0x4e6a14)[_0xc174('0xa7')](function(_0x5a2c40){return _0x4e9195(_0x5a2c40);});default:return _0x449eb0(msgResponse(_0xc174('0x1ba'),_0xc174('0x11c'),'Unknown\x20Predictive'));}}else{return _0x449eb0(msgResponse(_0xc174('0x1ba'),'Failure','check\x20failure'));}});};};Dialer[_0xc174('0x19')][_0xc174('0x1bb')]=function(_0xf7a40a){var _0x57217f=this;return function(_0x4e0260){return new BPromise(function(_0x39d9c6,_0x1d7bb3){_[_0xc174('0x7d')](_0xf7a40a,_0x4e0260[0x0]);if(checkGetDataPredictive(_0x4e0260[0x0])){loggerPredictive[_0xc174('0x6d')](JSON['stringify'](_0x4e0260[0x0]));if(_0xf7a40a[_0xc174('0x1a9')]===_0xc174('0x1ab')){return _0x57217f[_0xc174('0xb3')](_0xf7a40a['id'])[_0xc174('0xa7')](function(_0x354ee2){var _0x63d05d=_0xf7a40a[_0xc174('0x138')]-_0x354ee2[0x0][_0xc174('0x1bc')];var _0x15be24=_0xf7a40a[_0xc174('0x1a7')]*0x3c;var _0x178e25=_0x4e0260[0x0]['predictiveIntervalAvgTalktime']+_0x4e0260[0x0][_0xc174('0x74')];var _0x4eb9fa=(_0x4e0260[0x0][_0xc174('0x58')]+_0x4e0260[0x0][_0xc174('0x5b')]+_0x4e0260[0x0][_0xc174('0x5a')])/_0x4e0260[0x0][_0xc174('0x60')];var _0xa5fc5=_0xf7a40a[_0xc174('0x19b')]/0x64;_0xf7a40a[_0xc174('0x5f')]=_0x354ee2[0x0][_0xc174('0x1bc')]||0x0;_0xf7a40a[_0xc174('0x5e')]=_0x4eb9fa>0x0?_0x4eb9fa:0x1;return _0x57217f[_0xc174('0x1b7')](_0x63d05d,_0x15be24,_0x178e25,_0x4eb9fa,_0xa5fc5);})[_0xc174('0xa7')](function(_0x22a976){return _0x39d9c6(_0x22a976);})[_0xc174('0xa1')](function(_0x47104b){return _0x1d7bb3(msgResponse(_0xc174('0x1bd'),'Failure',JSON['stringify'](_0x47104b)));});}if(_0xf7a40a[_0xc174('0x1a9')]==='agentBusyFactor'){return _0x57217f[_0xc174('0xb3')](_0xf7a40a['id'])[_0xc174('0xa7')](function(_0x25e7e2){var _0x2acf01=_0xf7a40a['loggedIn']-_0x25e7e2[0x0][_0xc174('0x1bc')];var _0x5d95fb=_0xf7a40a[_0xc174('0x1a7')]*0x3c;var _0x27f218=_0x4e0260[0x0][_0xc174('0x59')]+_0x4e0260[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d4c7c=(_0x4e0260[0x0]['predictiveIntervalAnsweredCalls']+_0x4e0260[0x0][_0xc174('0x5b')]+_0x4e0260[0x0][_0xc174('0x5a')])/_0x4e0260[0x0]['predictiveIntervalTotalCalls'];var _0x393fdf=_0xf7a40a[_0xc174('0x19b')]/0x64;_0xf7a40a['predictiveIntervalPauses']=_0x25e7e2[0x0][_0xc174('0x1bc')]||0x0;_0xf7a40a[_0xc174('0x5e')]=_0x5d4c7c>0x0?_0x5d4c7c:0x1;return _0x57217f[_0xc174('0x1b9')](_0x2acf01,_0x5d95fb,_0x27f218,_0x5d4c7c,_0x393fdf);})[_0xc174('0xa7')](function(_0x23d8c9){return _0x39d9c6(_0x23d8c9);})[_0xc174('0xa1')](function(_0x3d24f2){return _0x1d7bb3(msgResponse(_0xc174('0x1bd'),'Failure',JSON[_0xc174('0x43')](_0x3d24f2)));});}}else{return _0x1d7bb3(msgResponse('[getDataPredictive]',_0xc174('0x11c'),'check\x20failure'));}});};};Dialer['prototype'][_0xc174('0x1b1')]=function(_0x34bcbd){var _0x53f022=this;return function(){var _0x1440e3=0x0;var _0x2daf7a=Math[_0xc174('0x1a2')](_0x34bcbd['erlangCallToSecond']*0x3e8);if(_0x2daf7a>0x0){_0x2daf7a=_0x2daf7a<0x64?0x64:_0x2daf7a;loggerPredictive['info'](_0x34bcbd[_0xc174('0x3c')],'one\x20call\x20every:',_0x2daf7a,_0xc174('0x44'));_0x34bcbd['handlePredictive']=setInterval(function(){_0x53f022['handlePredictive'](_0x34bcbd);loggerPredictiveCalls[_0xc174('0x6d')](_0xc174('0x1be'),_0x1440e3+=0x1);},_0x2daf7a);}else{loggerPredictive[_0xc174('0x6d')](_0x34bcbd[_0xc174('0x3c')],_0xc174('0x1bf'));}};};Dialer['prototype'][_0xc174('0x1c0')]=function(_0x10c592,_0x100bfa){var _0x35eb3a=this;return function(_0x14bb72){if(_[_0xc174('0x41')](_0x14bb72)){if(_[_0xc174('0x9d')](_0x100bfa[_0xc174('0xc0')])||!_0x100bfa[_0xc174('0x1c1')]){if(_0x10c592[_0xc174('0x130')]===_0xc174('0x6')){_0x10c592['queueStatusComplete']=_['isUndefined'](_0x10c592[_0xc174('0x102')])?!![]:_0x10c592[_0xc174('0x102')];var _0x6225d5=uuid['v4']();_0x35eb3a[_0xc174('0x9b')][_0x6225d5]=new Action(_0x10c592,_0x100bfa,_0x6225d5);loggerBooked[_0xc174('0x6d')](_0xc174('0x1c2'),_0x6225d5,_0xc174('0x1c3'),JSON['stringify'](_0x10c592[_0xc174('0x102')]),'Queue:\x20',_0x10c592[_0xc174('0x3c')]);if(_0x10c592['queueStatusComplete']){_0x10c592[_0xc174('0x102')]=![];_0x35eb3a[_0xc174('0x100')][_0x35eb3a[_0xc174('0x9b')][_0x6225d5]['queue']]=[];ami[_0xc174('0x9e')]({'actionid':_0x6225d5,'action':_0xc174('0x1c4'),'queue':_0x10c592['name']})[_0xc174('0xa1')](function(_0x215889){_0x35eb3a[_0xc174('0xa2')](_0x10c592);_0x35eb3a[_0xc174('0xaf')]({'active':![],'ContactId':_0x35eb3a[_0xc174('0x9b')][_0x6225d5][_0xc174('0x10c')],'ListId':_0x35eb3a[_0xc174('0x9b')][_0x6225d5][_0xc174('0xbf')],'VoiceQueueId':_0x35eb3a[_0xc174('0x9b')][_0x6225d5][_0xc174('0xc1')]||undefined,'CampaignId':_0x35eb3a[_0xc174('0x9b')][_0x6225d5][_0xc174('0x10d')]||undefined})[_0xc174('0xa1')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x35eb3a['actions'][_0x6225d5];});}else{loggerBooked[_0xc174('0x6d')](_0xc174('0x1c5'),JSON[_0xc174('0x43')](_0x10c592[_0xc174('0x102')]),_0xc174('0x1c6'),_0x10c592[_0xc174('0x3c')]);_0x35eb3a['updateOriginated'](_0x10c592);_0x35eb3a[_0xc174('0xaf')]({'active':![],'ContactId':_0x35eb3a[_0xc174('0x9b')][_0x6225d5][_0xc174('0x10c')],'ListId':_0x35eb3a[_0xc174('0x9b')][_0x6225d5]['ListId'],'VoiceQueueId':_0x35eb3a['actions'][_0x6225d5][_0xc174('0xc1')]||undefined,'CampaignId':_0x35eb3a['actions'][_0x6225d5][_0xc174('0x10d')]||undefined})[_0xc174('0xa1')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x35eb3a[_0xc174('0x9b')][_0x6225d5];}}else{return _0x35eb3a[_0xc174('0x143')](_0x10c592,_0x100bfa);}}else{if(getDiff(_0x100bfa[_0xc174('0x1c7')])<_0x10c592[_0xc174('0x1c8')]*0x3c){_0x35eb3a[_0xc174('0x1e')][_0xc174('0x104')](_0x100bfa['id'])['finally'](function(){_0x35eb3a[_0xc174('0xa2')](_0x10c592);});}else{_0x10c592[_0xc174('0x57')]+=0x1;_0x35eb3a[_0xc174('0xa2')](_0x10c592);if(_0x10c592[_0xc174('0x1c9')]){_0x35eb3a[_0xc174('0xaf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x100bfa['ContactId'],'ListId':_0x100bfa[_0xc174('0xbf')],'VoiceQueueId':_0x100bfa['VoiceQueueId']||undefined,'CampaignId':_0x100bfa[_0xc174('0x10d')]||undefined})['catch'](loggerCatch(_0xc174('0x1ca')));_0x35eb3a['createHistory'](createObjHistory(_0x10c592,_0x100bfa,_0xc174('0x1cb'),0x17,'RecallInQueue'))[_0xc174('0xa1')](loggerCatch(_0xc174('0x1cc')));}else{_0x35eb3a[_0xc174('0xbd')](createObjHistory(_0x10c592,_0x100bfa,_0xc174('0x1cd'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x10c592[_0xc174('0x51')]+=0x1;_0x35eb3a[_0xc174('0xbd')](createObjHistory(_0x10c592,_0x100bfa,_0xc174('0x1ce'),0xd,_0xc174('0x1cf')),_0xc174('0x1d0'),_0xc174('0x1d1'));throw _0xc174('0x1d2');}};};Dialer['prototype'][_0xc174('0x137')]=function(_0x255b3c){var _0x427319=this;var _0x299252=[];var _0x46c193=_0x255b3c[_0xc174('0x1d3')]-_0x255b3c[_0xc174('0x89')]-_0x255b3c['temp'];emitCampaignSummary(_0x255b3c);if(_0x46c193>0x0){if(_0x46c193>this[_0xc174('0x23')]){_0x46c193=this['maxNumberOriginate'];}_0x255b3c[_0xc174('0x1d4')]+=_0x46c193;this[_0xc174('0xb2')](_0x255b3c['id'],_0x46c193,_0x255b3c[_0xc174('0x1d5')])[_0xc174('0xa7')](function(_0x175e7f){_0x255b3c[_0xc174('0x1d4')]-=_0x46c193;_0x255b3c[_0xc174('0x1d4')]=_0x255b3c[_0xc174('0x1d4')]>0x0?_0x255b3c[_0xc174('0x1d4')]:0x0;if(!checkContactEmpty(_0x175e7f)){_0x255b3c[_0xc174('0x3a')]=_0xc174('0x8f');logger[_0xc174('0x6d')](_0xc174('0x1d6')+_0x255b3c[_0xc174('0x3c')]);}else{_0x255b3c[_0xc174('0x89')]+=_0x175e7f[_0xc174('0x87')];_0x255b3c['message']=_0xc174('0x1d7');for(var _0x52b972=0x0;_0x52b972<_0x175e7f[_0xc174('0x87')];_0x52b972+=0x1){_0x255b3c[_0xc174('0x1d8')]+=0x1;if(_[_0xc174('0x9d')](_0x175e7f[_0x52b972])||_[_0xc174('0x9d')](_0x175e7f[_0x52b972]['Contact'])||_[_0xc174('0x9d')](_0x175e7f[_0x52b972]['Contact'][_0xc174('0x146')])){_0x427319[_0xc174('0xbb')](_0xc174('0x1d9'),_0x255b3c,_0x175e7f[_0x52b972]);}else{_0x427319[_0xc174('0xab')](_['pick'](_0x175e7f[_0x52b972],['CampaignId','Contact.phone']))[_0xc174('0xa7')](_0x427319[_0xc174('0x1c0')](_0x255b3c,_0x175e7f[_0x52b972]))[_0xc174('0xa1')](_0x427319[_0xc174('0xba')](_0xc174('0x1da'),_0x255b3c));}}}})[_0xc174('0xa1')](loggerGetContactDialer(_0xc174('0x1db'),_0x255b3c,_0x46c193));}};Dialer[_0xc174('0x19')][_0xc174('0x131')]=function(_0xbf9865,_0x450df4){var _0x5b9f76=this;var _0x52463d=[];var _0x4ec2fa=_0x450df4>=0x1?_0x450df4:0x1;var _0x5a59d0=[];if(_0xbf9865['dialMethod']===_0xc174('0x6')){_0x4ec2fa=0x1;}var _0x509a0e=Math['floor'](_0xbf9865[_0xc174('0x1a0')]*_0x4ec2fa)-_0xbf9865['originated']-_0xbf9865[_0xc174('0x1d4')];emitVoiceQueueSummary(_0xbf9865);if(_0xbf9865['dialLimitQueue']>0x0){var _0x715693=_0xbf9865[_0xc174('0x1dc')]-_0xbf9865[_0xc174('0x89')]-_0xbf9865[_0xc174('0x1a1')]-_0xbf9865['temp']-_0xbf9865[_0xc174('0x49')];if(_0x509a0e>_0x715693){_0x509a0e=_0x715693;}}if(_0x509a0e>0x0){if(_0xbf9865[_0xc174('0x130')]===_0xc174('0x6')){_0x509a0e=0x1;}if(_0x509a0e>this[_0xc174('0x23')]){_0x509a0e=this[_0xc174('0x23')];}_0xbf9865[_0xc174('0x1d4')]+=_0x509a0e;for(var _0xa7e8af in this[_0xc174('0x21')]){if(this[_0xc174('0x21')][_0xc174('0x88')](_0xa7e8af)){if(this['agents'][_0xa7e8af][_0xc174('0x96')]===_0xc174('0x1dd')&&this[_0xc174('0x21')][_0xa7e8af][_0xc174('0x9f')]===_0xc174('0xc8')){_0x52463d[_0xc174('0x122')](this[_0xc174('0x21')][_0xa7e8af]['id']);}}}this[_0xc174('0xb1')](_0xbf9865['id'],_0x52463d,_0x509a0e,_0xbf9865[_0xc174('0x1d5')])['then'](function(_0xe795c7){_0xbf9865['temp']-=_0x509a0e;_0xbf9865[_0xc174('0x1d4')]=_0xbf9865['temp']>0x0?_0xbf9865[_0xc174('0x1d4')]:0x0;if(!checkContactEmpty(_0xe795c7)){_0x5b9f76[_0xc174('0xa8')](_0xbf9865)[_0xc174('0xa7')](sendMessageReschedule(_0xbf9865))[_0xc174('0xa1')](loggerCatch(_0xc174('0x1de')));}else{_0xbf9865[_0xc174('0x89')]+=_0xe795c7[_0xc174('0x87')];_0xbf9865['message']=_0xbf9865[_0xc174('0x130')]===_0xc174('0x6')?_0xc174('0x150'):'RUNNING';for(var _0x2cbc70=0x0;_0x2cbc70<_0xe795c7[_0xc174('0x87')];_0x2cbc70+=0x1){if(_[_0xc174('0x9d')](_0xe795c7[_0x2cbc70])||_[_0xc174('0x9d')](_0xe795c7[_0x2cbc70]['Contact'])||_[_0xc174('0x9d')](_0xe795c7[_0x2cbc70][_0xc174('0x147')][_0xc174('0x146')])){_0x5b9f76[_0xc174('0xbb')](_0xc174('0x1d9'),_0xbf9865,_0xe795c7[_0x2cbc70]);}else{_0x5b9f76['checkIsBlackList'](_['pick'](_0xe795c7[_0x2cbc70],['VoiceQueueId','Contact.phone']))[_0xc174('0xa7')](_0x5b9f76[_0xc174('0x1c0')](_0xbf9865,_0xe795c7[_0x2cbc70]))['catch'](_0x5b9f76[_0xc174('0xba')](_0xc174('0x1d9'),_0xbf9865));}}}})[_0xc174('0xa1')](loggerGetContactDialer(_0xc174('0x1df'),_0xbf9865,_0x509a0e));}};Dialer[_0xc174('0x19')][_0xc174('0x80')]=function(_0x727af9){var _0x268945=this;if(_0x727af9[_0xc174('0x1dc')]>0x0){var _0x3b112e=_0x727af9[_0xc174('0x1dc')]-_0x727af9[_0xc174('0x89')]-_0x727af9['talking'];if(_0x3b112e>0x0){this['tryOriginatePredictive'](_0x727af9);}else{loggerPredictiveCalls[_0xc174('0x6d')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x727af9);}};Dialer[_0xc174('0x19')][_0xc174('0x1e0')]=function(_0x5c87f1){var _0x54e6cf=this;var _0x70286a=[];_0x5c87f1[_0xc174('0x89')]+=0x1;for(var _0x5ca072 in this['agents']){if(this['agents']['hasOwnProperty'](_0x5ca072)){if(this['agents'][_0x5ca072][_0xc174('0x96')]===_0xc174('0x1dd')&&this[_0xc174('0x21')][_0x5ca072][_0xc174('0x9f')]===_0xc174('0xc8')){_0x70286a[_0xc174('0x122')](this[_0xc174('0x21')][_0x5ca072]['id']);}}}this[_0xc174('0xb1')](_0x5c87f1['id'],_0x70286a,0x1,_0x5c87f1['dialOrderByScheduledAt'])['then'](function(_0x49ca0f){if(!checkContactEmpty(_0x49ca0f)){checkContactLowerLimitOriginate(_0x5c87f1,0x1,0x0);_0x54e6cf['countReScheduled'](_0x5c87f1)[_0xc174('0xa7')](sendMessageReschedule(_0x5c87f1))['catch'](loggerCatch(_0xc174('0x1de')));}else{_0x5c87f1[_0xc174('0x3a')]='RUNNING';if(_['isNil'](_0x49ca0f[0x0])||_[_0xc174('0x9d')](_0x49ca0f[0x0]['Contact'])||_[_0xc174('0x9d')](_0x49ca0f[0x0][_0xc174('0x147')][_0xc174('0x146')])){_0x54e6cf['emptyContact'](_0xc174('0x1d9'),_0x5c87f1,_0x49ca0f[0x0]);}else{_0x54e6cf['checkIsBlackList'](_[_0xc174('0xbe')](_0x49ca0f[0x0],[_0xc174('0xc1'),_0xc174('0x1e1')]))['then'](_0x54e6cf[_0xc174('0x1c0')](_0x5c87f1,_0x49ca0f[0x0]))[_0xc174('0xa1')](_0x54e6cf[_0xc174('0xba')](_0xc174('0x1e2'),_0x5c87f1));}}})[_0xc174('0xa1')](loggerGetContactDialer('[getContactDialerPredictive]',_0x5c87f1,0x1));emitVoiceQueueSummary(_0x5c87f1);};Dialer['prototype'][_0xc174('0x1b7')]=function(_0x265b49,_0xcaf826,_0x204e01,_0x277a6e,_0x3cf546,_0x36a1e9){loggerPredictive[_0xc174('0x6d')](_0xc174('0x1e3'));loggerPredictive['info'](_0xc174('0x1e4'),_0x265b49);loggerPredictive[_0xc174('0x6d')](_0xc174('0x1e5'),_0xcaf826);loggerPredictive['info'](_0xc174('0x1e6'),_0x204e01);loggerPredictive[_0xc174('0x6d')]('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',_0x277a6e);loggerPredictive[_0xc174('0x6d')](_0xc174('0x1e7'),_0x3cf546);loggerPredictive[_0xc174('0x6d')](_0xc174('0x72'));return new BPromise(function(_0x56c9b1,_0xf2416f){if(_0x265b49<=0x0||isNaN(_0x265b49)){return _0xf2416f(msgResponse(_0xc174('0x1e8'),'Error','m\x20=\x20'+_0x265b49));}if(_0x204e01<=0x0||isNaN(_0x204e01)){return _0xf2416f(msgResponse(_0xc174('0x1e8'),_0xc174('0x175'),_0xc174('0x1e9')+_0x204e01));}if(_0x277a6e<=0x0||isNaN(_0x277a6e)){return _0xf2416f(msgResponse(_0xc174('0x1e8'),_0xc174('0x175'),_0xc174('0x1ea')+_0x277a6e));}if(_0xcaf826<=0x0||isNaN(_0xcaf826)){return _0xf2416f(msgResponse(_0xc174('0x1e8'),'Error',_0xc174('0x1eb')+_0xcaf826));}if(_0x3cf546<=0x0||isNaN(_0x3cf546)){return _0xf2416f(msgResponse(_0xc174('0x1e8'),_0xc174('0x175'),_0xc174('0x1ec')+_0x3cf546));}_0x36a1e9=_0x36a1e9||0x0;var _0x316694=0x1/_0x204e01;var _0x22c63c=0x0;var _0x5c5ce8=0x0;var _0x3bae69=0x0;var _0x2445c2=0x0;for(var _0x49193b=0x0;_0x3bae69<_0x3cf546;_0x49193b+=0x1){_0x5c5ce8=_0x49193b/_0xcaf826;_0x22c63c=(_0x277a6e*_0x5c5ce8+_0x36a1e9)/_0x316694;_0x3bae69=erlangb(_0x22c63c,_0x265b49);_0x2445c2=_0x22c63c/_0x265b49*(0x1-erlangb(_0x22c63c,_0x265b49));}return _0x56c9b1({'erlangCalls':_0x49193b,'erlangCallToSecond':_0xcaf826/_0x49193b,'erlangAbandonmentRate':_0x3bae69,'erlangBusyFactor':_0x2445c2});});};Dialer['prototype'][_0xc174('0x1b9')]=function(_0x1e892c,_0x38271f,_0x3ad280,_0x300f6a,_0x167ece,_0x4d84a7){loggerPredictive[_0xc174('0x6d')](_0xc174('0x1ed'));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',_0x1e892c);loggerPredictive[_0xc174('0x6d')](_0xc174('0x1e5'),_0x38271f);loggerPredictive[_0xc174('0x6d')]('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',_0x3ad280);loggerPredictive['info']('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',_0x300f6a);loggerPredictive[_0xc174('0x6d')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x167ece);loggerPredictive[_0xc174('0x6d')](_0xc174('0x72'));return new BPromise(function(_0x24d38f,_0x11e4ed){if(_0x1e892c<=0x0||isNaN(_0x1e892c)){return _0x11e4ed(msgResponse(_0xc174('0x1ee'),_0xc174('0x175'),_0xc174('0x1ef')+_0x1e892c));}if(_0x3ad280<=0x0||isNaN(_0x3ad280)){return _0x11e4ed(msgResponse(_0xc174('0x1ee'),_0xc174('0x175'),'Ts\x20=\x20'+_0x3ad280));}if(_0x300f6a<=0x0||isNaN(_0x300f6a)){return _0x11e4ed(msgResponse('[busyFactor]',_0xc174('0x175'),_0xc174('0x1ea')+_0x300f6a));}if(_0x38271f<=0x0||isNaN(_0x38271f)){return _0x11e4ed(msgResponse('[busyFactor]',_0xc174('0x175'),_0xc174('0x1eb')+_0x38271f));}if(_0x167ece<=0x0||isNaN(_0x167ece)){return _0x11e4ed(msgResponse('[busyFactor]','Error',_0xc174('0x1f0')+_0x167ece));}_0x4d84a7=_0x4d84a7||0x0;var _0x37ca8b=0x1/_0x3ad280;var _0x48f8da=0x0;var _0x3a3a8f=0x0;var _0x53587c=0x0;var _0x24cfbf=0x0;for(var _0x4ee348=0x0;_0x24cfbf<_0x167ece;_0x4ee348+=0x1){_0x3a3a8f=_0x4ee348/_0x38271f;_0x48f8da=(_0x300f6a*_0x3a3a8f+_0x4d84a7)/_0x37ca8b;_0x53587c=erlangb(_0x48f8da,_0x1e892c);_0x24cfbf=_0x48f8da/_0x1e892c*(0x1-erlangb(_0x48f8da,_0x1e892c));}return _0x24d38f({'erlangCalls':_0x4ee348,'erlangCallToSecond':_0x38271f/_0x4ee348,'erlangAbandonmentRate':_0x53587c,'erlangBusyFactor':_0x24cfbf});});};module['exports']=Dialer; \ No newline at end of file +var _0x3a22=['syncAgentConnect','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Abandoned','queueCallerAbandonCreateState','syncNewExten','actionid','paused','stateinterface','locked','push','queueStatusComplete','[unlockQueueStatus][undefined]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','rrmemory','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','true','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','Queue','method\x20not\x20recognized','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','checkDialMethod','launchHandleIvr','\x5cw{0,','pow','match','actionOriginate','originate','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','TrunkBackup','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialGlobalMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyRetryFrequency','dialCongestionMaxRetry','countcongestionretry','[rescheduleContact]\x20[Congestion]','callProgressDetecting','object','[callProgressDetecting]','reason','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginateIvr]\x20','[getContactCampaign2]','booked','dialLimitQueue','not_inuse','[countReScheduled]\x20','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','abandonmentRate','--------\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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','custom:queuesummary','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','string','\x22%s\x22\x20<%s>','inspect','error','stack','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','starttime','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','voiceQueues','queue','[Dialer][checkChannel][ivr]','countReScheduled','catch','checkIsBlackList','resolve','then','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','outboundUnknownCallsDay','Unknow','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent'];(function(_0x2ad588,_0x2e7da8){var _0x2b6d88=function(_0x28dd27){while(--_0x28dd27){_0x2ad588['push'](_0x2ad588['shift']());}};_0x2b6d88(++_0x2e7da8);}(_0x3a22,0xe7));var _0x23a2=function(_0x4c38ca,_0x33209c){_0x4c38ca=_0x4c38ca-0x0;var _0x14f890=_0x3a22[_0x4c38ca];return _0x14f890;};'use strict';var util=require(_0x23a2('0x0'));var _=require(_0x23a2('0x1'));var BPromise=require(_0x23a2('0x2'));var uuid=require(_0x23a2('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x23a2('0x4'));var Redis=require(_0x23a2('0x5'));var config=require(_0x23a2('0x6'));var logger=require(_0x23a2('0x7'))(_0x23a2('0x8'));var loggerBooked=require(_0x23a2('0x7'))('booked');var loggerPredictive=require(_0x23a2('0x7'))(_0x23a2('0x9'));var loggerPredictiveCalls=require(_0x23a2('0x7'))(_0x23a2('0xa'));var loggerSyncQueueSummary=require(_0x23a2('0x7'))(_0x23a2('0xb'));var ami=require(_0x23a2('0xc'));config[_0x23a2('0xd')]=_['defaults'](config['redis'],{'host':_0x23a2('0xe'),'port':0x18eb});var io=require(_0x23a2('0xf'))(new Redis(config[_0x23a2('0xd')]));var cmHopper=require(_0x23a2('0x10'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x23a2('0x11'));var cmHopperBlack=require(_0x23a2('0x12'));var voiceQueueRt=require(_0x23a2('0x13'));var Action=require('./action');var History=require(_0x23a2('0x14'));var Final=require('./final');var AgentComplete=require(_0x23a2('0x15'));var QueueCallerAbandon=require(_0x23a2('0x16'));var Hangup=require(_0x23a2('0x17'));var ipAgi=process[_0x23a2('0x18')][_0x23a2('0x19')]||_0x23a2('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0x23a2('0x1b')};var Sequence=function(){};Sequence[_0x23a2('0x1c')][_0x23a2('0x1d')]=function(_0x19fa85){this[_0x23a2('0x1e')]=this['tail']?this[_0x23a2('0x1e')][_0x23a2('0x1f')](_0x19fa85):_0x19fa85();};function Dialer(_0x5886be,_0x376f6f){this[_0x23a2('0x20')]=new Sequence();this[_0x23a2('0x21')]=_0x376f6f;this['voiceQueues']=_0x5886be['voiceQueues'];this[_0x23a2('0x22')]=_0x5886be[_0x23a2('0x22')];this[_0x23a2('0x23')]=_0x5886be[_0x23a2('0x23')];this[_0x23a2('0x24')]=_0x5886be[_0x23a2('0x24')];this['maxNumberOriginate']=config[_0x23a2('0x25')]||0x2;this[_0x23a2('0x26')]={};this[_0x23a2('0x27')]={};this[_0x23a2('0x28')]={};this[_0x23a2('0x29')]={};this['optionPredictive']={};this[_0x23a2('0x2a')]={};this[_0x23a2('0x2b')]={};this[_0x23a2('0x2c')]={};this[_0x23a2('0x2d')]={};this[_0x23a2('0x2e')]={};ami['on'](_0x23a2('0x2f'),this['syncAgentConnect'][_0x23a2('0x30')](this));ami['on'](_0x23a2('0x31'),this[_0x23a2('0x32')][_0x23a2('0x30')](this));ami['on'](_0x23a2('0x33'),this[_0x23a2('0x34')][_0x23a2('0x30')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x23a2('0x30')](this));ami['on'](_0x23a2('0x35'),this[_0x23a2('0xb')][_0x23a2('0x30')](this));ami['on'](_0x23a2('0x36'),this[_0x23a2('0x37')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x23a2('0x30')](this));ami['on'](_0x23a2('0x38'),this[_0x23a2('0x39')]['bind'](this));ami['on'](_0x23a2('0x3a'),this[_0x23a2('0x3b')][_0x23a2('0x30')](this));ami['on'](_0x23a2('0x3c'),this[_0x23a2('0x3d')][_0x23a2('0x30')](this));this['loopCampaigns']();this[_0x23a2('0x3e')]();}function isNotNull(_0x4f22e6){return _0x4f22e6!==null&&!_[_0x23a2('0x3f')](_0x4f22e6);}function checkIsLoggedIn(_0x3eaf10,_0x375556){return function(){if(_0x375556<=0x0){_0x3eaf10[_0x23a2('0x40')]=_0x23a2('0x41');throw _0x3eaf10[_0x23a2('0x42')]+_0x23a2('0x43');}};}function isActive(_0x130ee0){return _0x130ee0;}function checkIsActive(_0x4af47d,_0x3b0a42){return function(){if(!isActive(_0x3b0a42)){_0x4af47d[_0x23a2('0x40')]=_0x23a2('0x44');throw _0x4af47d[_0x23a2('0x42')]+_0x23a2('0x45');}};}function checkInterval(_0x189cc1){return function(){if(!isNotNull(_0x189cc1['Interval'])){_0x189cc1['message']=_0x23a2('0x46');throw _0x189cc1[_0x23a2('0x42')]+_0x23a2('0x47');}if(!isNotNull(_0x189cc1[_0x23a2('0x48')][_0x23a2('0x49')])){_0x189cc1[_0x23a2('0x40')]=_0x23a2('0x46');throw _0x189cc1[_0x23a2('0x42')]+_0x23a2('0x47');}if(!isNotNull(_[_0x23a2('0x4a')](_0x189cc1[_0x23a2('0x48')][_0x23a2('0x49')]))){_0x189cc1['message']=_0x23a2('0x46');throw _0x189cc1[_0x23a2('0x42')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x14bdbf,_0x52a203,_0x20462c){return{'action':_0x14bdbf,'response':_0x52a203,'message':_0x20462c,'stack':_0x20462c};}function myreject(_0x3f29fb){return function(_0x2e5fda){return _0x3f29fb(msgResponse(_0x23a2('0x4b'),_0x23a2('0x4c'),JSON['stringify'](_0x2e5fda)));};}function getSeconds(_0x206800,_0x38e034){var _0x3404df=moment(_0x206800)[_0x23a2('0x4d')](0x0);var _0x3f2c0a=moment(_0x38e034)[_0x23a2('0x4d')](0x0);return _0x3404df[_0x23a2('0x4e')](_0x3f2c0a,_0x23a2('0x4f'));}function emit(_0x2bf6a8,_0x4381c8,_0x3e2a24){io['to'](_0x2bf6a8)[_0x23a2('0x50')](_0x4381c8,_0x3e2a24);}function emitVoiceQueueSummary(_0x3c7be6){if(_0x3c7be6[_0x23a2('0x51')]===_0x23a2('0x52')){var _0xba778e={'id':_0x3c7be6['id'],'name':_0x3c7be6[_0x23a2('0x42')],'strategy':_0x3c7be6[_0x23a2('0x53')],'answered':_0x3c7be6[_0x23a2('0x54')],'available':_0x3c7be6[_0x23a2('0x55')],'loggedIn':_0x3c7be6[_0x23a2('0x56')],'pTalking':_0x3c7be6[_0x23a2('0x57')],'sumBillable':_0x3c7be6['sumBillable'],'sumDuration':_0x3c7be6['sumDuration'],'sumHoldTime':_0x3c7be6[_0x23a2('0x58')]||0x0,'talking':_0x3c7be6[_0x23a2('0x59')],'total':_0x3c7be6[_0x23a2('0x5a')],'type':_0x3c7be6['type'],'unmanaged':_0x3c7be6['unmanaged'],'abandoned':_0x3c7be6[_0x23a2('0x5b')],'waiting':_0x3c7be6[_0x23a2('0x5c')],'loggedInDb':_0x3c7be6['loggedInDb'],'dialActive':_0x3c7be6[_0x23a2('0x5d')],'dialMethod':_0x3c7be6[_0x23a2('0x5e')],'dialOriginateCallerIdName':_0x3c7be6[_0x23a2('0x5f')],'dialOriginateCallerIdNumber':_0x3c7be6[_0x23a2('0x60')],'dialOriginateTimeout':_0x3c7be6[_0x23a2('0x61')],'dialPrefix':_0x3c7be6[_0x23a2('0x62')],'outboundAnswerAgiCallsDay':_0x3c7be6[_0x23a2('0x63')],'outboundAnswerCallsDay':_0x3c7be6[_0x23a2('0x64')],'outboundBlacklistCallsDay':_0x3c7be6['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3c7be6['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3c7be6[_0x23a2('0x65')],'outboundDropCallsDayACS':_0x3c7be6[_0x23a2('0x66')],'outboundDropCallsDayCallersExit':_0x3c7be6['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3c7be6[_0x23a2('0x67')],'outboundNoAnswerCallsDay':_0x3c7be6[_0x23a2('0x68')],'outboundNoSuchCallsDay':_0x3c7be6[_0x23a2('0x69')],'outboundOriginateFailureCallsDay':_0x3c7be6[_0x23a2('0x6a')],'outboundReCallsDay':_0x3c7be6[_0x23a2('0x6b')],'outboundRejectCallsDay':_0x3c7be6[_0x23a2('0x6c')],'outboundUnknownCallsDay':_0x3c7be6['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3c7be6[_0x23a2('0x6d')],'predictiveIntervalAvgHoldtime':_0x3c7be6[_0x23a2('0x6e')],'predictiveIntervalAvgTalktime':_0x3c7be6['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3c7be6[_0x23a2('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x3c7be6[_0x23a2('0x70')],'predictiveIntervalErlangCalls':_0x3c7be6[_0x23a2('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x3c7be6['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3c7be6[_0x23a2('0x72')],'predictiveIntervalMultiplicativeFactor':_0x3c7be6[_0x23a2('0x73')],'predictiveIntervalPauses':_0x3c7be6[_0x23a2('0x74')],'predictiveIntervalAvailable':_0x3c7be6[_0x23a2('0x75')],'predictiveIntervalTotalCalls':_0x3c7be6[_0x23a2('0x76')],'message':_0x3c7be6[_0x23a2('0x40')],'originated':_0x3c7be6[_0x23a2('0x77')],'erlangCalls':_0x3c7be6[_0x23a2('0x78')],'erlangCallToSecond':_0x3c7be6[_0x23a2('0x79')],'erlangAbandonmentRate':_0x3c7be6[_0x23a2('0x7a')],'erlangBusyFactor':_0x3c7be6[_0x23a2('0x7b')],'startPredictive':_0x3c7be6[_0x23a2('0x2a')],'startProgressive':_0x3c7be6[_0x23a2('0x2b')]};if(_0x3c7be6[_0x23a2('0x7c')]){_0xba778e[_0x23a2('0x7c')]={'id':_0x3c7be6[_0x23a2('0x7c')]['id'],'name':_0x3c7be6['Trunk'][_0x23a2('0x42')],'active':_0x3c7be6[_0x23a2('0x7c')][_0x23a2('0x7d')],'callerid':_0x3c7be6['Trunk'][_0x23a2('0x7e')]};}if(_0x3c7be6[_0x23a2('0x48')]){_0xba778e['Interval']={'id':_0x3c7be6[_0x23a2('0x48')]['id'],'name':_0x3c7be6[_0x23a2('0x48')][_0x23a2('0x42')]};}var _0x3d2e72=md5(JSON[_0x23a2('0x7f')](_0xba778e));if(_0x3c7be6[_0x23a2('0x4')]!==_0x3d2e72){_0x3c7be6[_0x23a2('0x4')]=_0x3d2e72;emit(util[_0x23a2('0x80')](_0x23a2('0x81'),_0xba778e[_0x23a2('0x42')]),'voice_queue:save',_0xba778e);}}}function emitCampaignSummary(_0x320743){if(_0x320743['type']===_0x23a2('0x82')){emit(util['format'](_0x23a2('0x83'),_0x320743['name']),_0x23a2('0x84'),_0x320743);}}function checkGetDataPredictive(_0x5944b9){if(isNotNull(_0x5944b9)){if(!_['isEmpty'](_0x5944b9)){loggerPredictive[_0x23a2('0x85')](_0x23a2('0x86'));loggerPredictive[_0x23a2('0x85')](_0x23a2('0x87'),_0x5944b9[_0x23a2('0x76')]);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x88'),_0x5944b9[_0x23a2('0x6d')]);loggerPredictive['info'](_0x23a2('0x89'),_0x5944b9[_0x23a2('0x70')]);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x8a'),_0x5944b9['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x8b'),_0x5944b9[_0x23a2('0x6e')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5944b9[_0x23a2('0x8c')]);loggerPredictive['info']('---------------------------');if(_0x5944b9[_0x23a2('0x76')]>0x0){if(!_[_0x23a2('0x3f')](_0x5944b9['predictiveIntervalAvgTalktime'])&&_0x5944b9['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x23a2('0x85')](_0x23a2('0x8d'));}if(!_[_0x23a2('0x3f')](_0x5944b9[_0x23a2('0x6e')])&&_0x5944b9[_0x23a2('0x6e')]>0x0){return!![];}else{loggerPredictive[_0x23a2('0x85')](_0x23a2('0x8e'));}}else{loggerPredictive[_0x23a2('0x85')](_0x23a2('0x8f'));}}else{loggerPredictive[_0x23a2('0x85')](_0x23a2('0x90'));}}else{loggerPredictive[_0x23a2('0x85')](_0x23a2('0x90'));}return![];}function mergeDataErlangB(_0x2bcd19){return function(_0x7cb883){loggerPredictive['info'](_0x23a2('0x91'));loggerPredictive['info'](_0x23a2('0x92'),_0x7cb883[_0x23a2('0x78')]);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x93'),_0x7cb883[_0x23a2('0x79')]);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x94'),_0x7cb883['erlangAbandonmentRate']);loggerPredictive['info'](_0x23a2('0x95'),_0x7cb883[_0x23a2('0x7b')]);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x94'),_0x7cb883['erlangAbandonmentRate']);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x96'));_[_0x23a2('0x97')](_0x2bcd19,_0x7cb883);};}function getDiff(_0x3fe4a9){var _0x154983=moment()['milliseconds'](0x0);var _0xd8cb14=moment(_0x3fe4a9)[_0x23a2('0x4d')](0x0);return _0x154983[_0x23a2('0x4e')](_0xd8cb14,_0x23a2('0x4f'));}function ifInterval(_0x503d40,_0x919cdc){if(_[_0x23a2('0x3f')](_0x919cdc)){return![];}if(getDiff(_0x919cdc)<_0x503d40*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x205bb0){if(isNotNull(_0x205bb0)){if(!_['isUndefined'](_0x205bb0['startProgressive'])){_0x205bb0[_0x23a2('0x2b')]=undefined;loggerPredictive[_0x23a2('0x85')](_0x205bb0['name'],_0x23a2('0x98'));}if(!_[_0x23a2('0x3f')](_0x205bb0[_0x23a2('0x2a')])){_0x205bb0[_0x23a2('0x2a')]=undefined;loggerPredictive[_0x23a2('0x85')](_0x205bb0[_0x23a2('0x42')],_0x23a2('0x99'));}if(!_['isUndefined'](_0x205bb0[_0x23a2('0x9a')])){clearInterval(_0x205bb0[_0x23a2('0x9a')]);_0x205bb0[_0x23a2('0x9a')]=undefined;loggerPredictive[_0x23a2('0x85')](_0x205bb0[_0x23a2('0x42')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x215377,_0x169085){if(_0x169085===0x0){return 0x0;}var _0x72a6f7=0x1;for(var _0xc2ca33=0x1;_0xc2ca33<=_0x169085;_0xc2ca33+=0x1){_0x72a6f7=0x1+_0x72a6f7*_0xc2ca33/_0x215377;}return 0x1/_0x72a6f7;}function isVoiceQueueOutbound(_0x732bfe){return _0x732bfe===_0x23a2('0x52');}function isNotPreview(_0x2027f7){return _0x2027f7!==_0x23a2('0x21');}function isCampaignIvr(_0x38573c){return _0x38573c===_0x23a2('0x82');}function getCallerId(_0x49efa6,_0x5108d7,_0x365728){if(!_[_0x23a2('0x3f')](_0x365728)&&_0x23a2('0x9b')===typeof _0x365728&&!_['isEmpty'](_0x365728)){if(!_['isUndefined'](_0x5108d7)&&_0x23a2('0x9b')===typeof _0x5108d7&&!_['isEmpty'](_0x5108d7)){return util['format'](_0x23a2('0x9c'),_0x5108d7,_0x365728);}return util[_0x23a2('0x80')](_0x23a2('0x9c'),_0x365728,_0x365728);}if(!_[_0x23a2('0x3f')](_0x49efa6)&&'string'===typeof _0x49efa6&&!_[_0x23a2('0x4a')](_0x49efa6)){return _0x49efa6;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x41bf97,_0xa5c21){return function(_0x5d2ea3){freeVariablesPredictive(_0xa5c21);emitVoiceQueueSummary(_0xa5c21);emitCampaignSummary(_0xa5c21);loggerSyncQueueSummary['error'](_0x41bf97,util[_0x23a2('0x9d')](_0x5d2ea3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4e48a7,_0x331b42){return function(_0x4ec96e){loggerPredictive[_0x23a2('0x9e')](_0x331b42[_0x23a2('0x42')],_0x4e48a7);loggerPredictive[_0x23a2('0x9e')](_0x4ec96e[_0x23a2('0x9f')]);freeVariablesPredictive(_0x331b42);};}function loggerCatch(_0x51a883){return function(_0x45ef12){logger['error'](_0x51a883,util['inspect'](_0x45ef12,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x303632){return _0x303632&&!_[_0x23a2('0x3f')](_0x303632)&&_0x303632[_0x23a2('0xa0')]>0x0;}function decremetOriginate(_0x5cf828){if(!_['isUndefined'](_0x5cf828)&&_0x5cf828!==null){if(_0x5cf828[_0x23a2('0xa1')](_0x23a2('0x77'))){if(_0x5cf828[_0x23a2('0x77')]>0x0){_0x5cf828[_0x23a2('0x77')]-=0x1;}else{logger[_0x23a2('0x9e')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x23a2('0x9e')](_0x23a2('0xa2'));}}function checkContactLowerLimitOriginate(_0x4578f7,_0x1ec875,_0x2dd796){if(_0x1ec875>_0x2dd796){for(var _0x5b0859=0x0;_0x5b0859<_0x1ec875-_0x2dd796;_0x5b0859+=0x1){decremetOriginate(_0x4578f7);}}}function loggerGetContactDialer(_0x50d600,_0x21c83a,_0x480063){return function(_0x11bde4){checkContactLowerLimitOriginate(_0x21c83a,_0x480063,0x0);logger[_0x23a2('0x9e')](_0x50d600,util['inspect'](_0x11bde4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x87d274){return function(_0x5a0ffc){if(isNotNull(_0x5a0ffc)&&isNotNull(_0x5a0ffc[0x0])){if(_0x5a0ffc[0x0][_0x23a2('0xa3')]>0x0){_0x87d274[_0x23a2('0x40')]=_0x23a2('0xa4');logger['info'](_0x23a2('0xa5')+_0x87d274[_0x23a2('0x42')],_0x5a0ffc[0x0][_0x23a2('0xa3')],_0x23a2('0xa6'));}else{_0x87d274['message']=_0x23a2('0xa7');logger['info'](_0x23a2('0xa8')+_0x87d274[_0x23a2('0x42')]);}}};}function notSendMessagesQueue(_0x273401){if(_0x273401[_0x23a2('0xa9')]){freeVariablesPredictive(_0x273401);if(_0x273401[_0x23a2('0x77')]===0x0&&_0x273401[_0x23a2('0x59')]===0x0&&_0x273401[_0x23a2('0x5c')]===0x0&&(_0x273401[_0x23a2('0x57')]||0x0)===0x0){_0x273401[_0x23a2('0xa9')]=![];_0x273401[_0x23a2('0x55')]=0x0;_0x273401[_0x23a2('0x40')]=_0x23a2('0x44');loggerSyncQueueSummary[_0x23a2('0x9e')](_0x23a2('0xaa'),_0x273401[_0x23a2('0x42')],_0x23a2('0xab'));}else{_0x273401[_0x23a2('0x40')]=_0x23a2('0xac');loggerSyncQueueSummary[_0x23a2('0x9e')](_0x23a2('0xaa'),_0x273401[_0x23a2('0x42')],_0x23a2('0xad'));}emitVoiceQueueSummary(_0x273401);}}function notSendMessagesCampaign(_0x11e6ae){if(_0x11e6ae[_0x23a2('0xa9')]){if(_0x11e6ae[_0x23a2('0x77')]===0x0){_0x11e6ae['sendMessageOneNotActive']=![];_0x11e6ae[_0x23a2('0x40')]=_0x23a2('0x44');loggerSyncQueueSummary['error'](_0x23a2('0xae'),_0x11e6ae['name'],'is\x20not\x20active');}else{_0x11e6ae[_0x23a2('0x40')]=_0x23a2('0xac');loggerSyncQueueSummary[_0x23a2('0x9e')](_0x23a2('0xae'),_0x11e6ae[_0x23a2('0x42')],_0x23a2('0xad'));}emitCampaignSummary(_0x11e6ae);}}function createObjHistory(_0x10856a,_0x2cf6bf,_0x498028,_0x4f37b7,_0x59407d){_0x10856a[_0x23a2('0x40')]=_0x498028;var _0x57db49=new Action(_0x10856a,_0x2cf6bf);var _0x282c12=new History(_0x57db49);_0x282c12[_0x23a2('0xaf')]=_0x4f37b7;_0x282c12['statedesc']=_0x59407d;_0x282c12['endtime']=_0x57db49[_0x23a2('0xb0')];return _0x282c12;}Dialer[_0x23a2('0x1c')]['loopClearZombieChannels']=function(){var _0x74885b=this;setInterval(function(){_0x74885b['clearZombieChannels'](_0x74885b[_0x23a2('0x29')],_0x23a2('0xb1'));_0x74885b[_0x23a2('0xb2')](_0x74885b['actions'],_0x23a2('0xb3'));},0x32c8);};Dialer[_0x23a2('0x1c')]['clearZombieChannels']=function(_0x2ab067,_0x11c167){var _0x36355e=this;for(var _0x36c865 in _0x2ab067){if(_0x2ab067[_0x23a2('0xa1')](_0x36c865)){this['sequence'][_0x23a2('0x1d')](function(){if(!_[_0x23a2('0xb4')](_0x2ab067[_0x36c865])){return ami[_0x23a2('0xb5')]({'action':_0x23a2('0xb6'),'channel':_0x2ab067[_0x36c865][_0x23a2('0xb7')]})['catch'](function(_0x4043b2){if(_0x4043b2[_0x23a2('0x40')]===_0x23a2('0xb8')){setTimeout(function(){if(_0x2ab067[_0x36c865]&&_0x2ab067[_0x36c865][_0x23a2('0x51')]!==_0x23a2('0x82')){_0x36355e[_0x23a2('0xb9')](_0x36355e[_0x23a2('0xba')][_0x2ab067[_0x36c865][_0x23a2('0xbb')]]);logger[_0x23a2('0x9e')]('[Dialer][checkChannel]',_0x11c167,_0x36c865,_0x2ab067[_0x36c865]['queue']);delete _0x2ab067[_0x36c865];}if(_0x2ab067[_0x36c865]&&_0x2ab067[_0x36c865]['type']==='ivr'){_0x36355e[_0x23a2('0xb9')](_0x36355e['campaigns'][_0x2ab067[_0x36c865][_0x23a2('0xbb')]]);logger[_0x23a2('0x9e')](_0x23a2('0xbc'),_0x11c167,_0x36c865,_0x2ab067[_0x36c865]['queue']);delete _0x2ab067[_0x36c865];}},0x2328);}});}});}}};Dialer['prototype'][_0x23a2('0xbd')]=function(_0x499a0a){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x499a0a))[_0x23a2('0xbe')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x23a2('0xbf')]=function(_0x58b095){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopperBlack[_0x23a2('0xbf')](_0x58b095))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xc2')));};Dialer['prototype'][_0x23a2('0xc3')]=function(_0x2a9600){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopperBlack[_0x23a2('0xc3')](_0x2a9600))[_0x23a2('0xbe')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x23a2('0xc4')]=function(_0x5cd411){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopperHistory[_0x23a2('0xc5')](_0x5cd411))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xc6')));};Dialer[_0x23a2('0x1c')]['rescheduleContact']=function(_0x1fcaae){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopper[_0x23a2('0xc7')](_0x1fcaae))[_0x23a2('0xbe')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x23a2('0x1c')][_0x23a2('0xc8')]=function(_0x465950,_0x27453c,_0x1f4c88,_0x6ed3f7){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopper[_0x23a2('0xc8')](_0x465950,_0x27453c,_0x1f4c88,_0x6ed3f7))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xc9')));};Dialer['prototype'][_0x23a2('0xca')]=function(_0xfa5449,_0x2254ee,_0xb1e5f5){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopper[_0x23a2('0xca')](_0xfa5449,_0x2254ee,_0xb1e5f5))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xc9')));};Dialer['prototype'][_0x23a2('0xcb')]=function(_0x39908e){return BPromise['resolve']()[_0x23a2('0xc1')](voiceQueueRt[_0x23a2('0xcb')](_0x39908e))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xcc')));};Dialer[_0x23a2('0x1c')][_0x23a2('0xcd')]=function(_0x59733a){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopper[_0x23a2('0xcd')](_0x59733a))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xce')));};Dialer[_0x23a2('0x1c')]['createHistory']=function(_0x908e4e){return BPromise[_0x23a2('0xc0')]()[_0x23a2('0xc1')](cmHopperHistory[_0x23a2('0xcf')](_0x908e4e))[_0x23a2('0xbe')](loggerCatch('[createHistory]\x20'));};Dialer[_0x23a2('0x1c')][_0x23a2('0xb9')]=function(_0x118a79){if(!_[_0x23a2('0x3f')](_0x118a79)&&_0x118a79!==null){if(_0x118a79['hasOwnProperty'](_0x23a2('0x77'))){if(_0x118a79[_0x23a2('0x77')]>0x0){_0x118a79['originated']-=0x1;}else{logger[_0x23a2('0x9e')](_0x23a2('0xd0'));}}}else{logger[_0x23a2('0x9e')](_0x23a2('0xd1'));}};Dialer[_0x23a2('0x1c')][_0x23a2('0xd2')]=function(_0x3a105a,_0x3c3019){var _0x4c9bec=this;return function(_0x22f8d8){_0x4c9bec[_0x23a2('0xb9')](_0x3c3019);logger['error'](_0x3a105a,util[_0x23a2('0x9d')](_0x22f8d8,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x23a2('0xd3')]=function(_0x3146d9,_0x9236b4,_0x353603){var _0x284fb8={'state':0x19,'statedesc':'notFound'};this[_0x23a2('0xb9')](_0x9236b4);this['saveInDb'](_[_0x23a2('0x97')](_0x284fb8,_[_0x23a2('0xd4')](_0x353603,[_0x23a2('0xd5'),_0x23a2('0xd6'),_0x23a2('0xd7'),_0x23a2('0xd8'),_0x23a2('0xd9')])),_0x23a2('0xda'),_0x23a2('0xdb'));logger[_0x23a2('0x9e')](_0x3146d9);};Dialer[_0x23a2('0x1c')]['isSuccess']=function(_0x22764b){return _0x22764b===_0x23a2('0xdc');};Dialer['prototype'][_0x23a2('0xdd')]=function(_0x290ff8){return!_[_0x23a2('0x3f')](_0x290ff8)&&_0x290ff8&&!_[_0x23a2('0x3f')](_0x290ff8[_0x23a2('0x42')])&&!_['isUndefined'](_0x290ff8[_0x23a2('0x7d')])&&_0x290ff8[_0x23a2('0x7d')]&&(this[_0x23a2('0x24')][util[_0x23a2('0x80')](_0x23a2('0xde'),_0x290ff8[_0x23a2('0x42')])]['status']===_0x23a2('0xdf')||this[_0x23a2('0x24')][util[_0x23a2('0x80')](_0x23a2('0xde'),_0x290ff8[_0x23a2('0x42')])][_0x23a2('0xb6')]===_0x23a2('0xe0'));};Dialer[_0x23a2('0x1c')][_0x23a2('0xe1')]=function(_0x363393,_0x2552f4,_0x5e137c){this['createHistory'](_0x363393)[_0x23a2('0xbe')](loggerCatch(_0x2552f4));this['moveContactManagedDialer'](_0x363393)[_0x23a2('0xbe')](loggerCatch(_0x5e137c));};Dialer['prototype'][_0x23a2('0x39')]=function(_0x80455e){var _0x3bf09e=this[_0x23a2('0x29')][_0x80455e['uniqueid']];var _0xc68fd9;if(!_[_0x23a2('0xb4')](_0x80455e)&&!_[_0x23a2('0xb4')](_0x80455e['variable'])&&!_[_0x23a2('0xb4')](_0x80455e[_0x23a2('0xe2')][_0x23a2('0xe3')])&&_0x80455e[_0x23a2('0xe4')]===_0x23a2('0xe5')&&_0x3bf09e){if(_0x3bf09e[_0x23a2('0x51')]!==_0x23a2('0x82')&&this[_0x23a2('0xba')][_0x3bf09e[_0x23a2('0xbb')]][_0x23a2('0xe6')]&&_0x80455e[_0x23a2('0xe7')]===_0x23a2('0xe8')){delete this[_0x23a2('0x29')][_0x80455e[_0x23a2('0xe9')]];this['updateOriginated'](this['voiceQueues'][_0x3bf09e[_0x23a2('0xbb')]]);this[_0x23a2('0xba')][_0x3bf09e[_0x23a2('0xbb')]][_0x23a2('0x64')]+=0x1;this['voiceQueues'][_0x3bf09e['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0xc68fd9=new Hangup(_0x3bf09e,_0x80455e);_0xc68fd9['state']=0x12;_0xc68fd9[_0x23a2('0xea')]=_0x23a2('0xeb');_0xc68fd9[_0x23a2('0xec')]=_0x23a2('0xed');this[_0x23a2('0xe1')](_0xc68fd9,_0x23a2('0xee'),_0x23a2('0xef'));}if(_0x3bf09e[_0x23a2('0x51')]!==_0x23a2('0x82')&&this['voiceQueues'][_0x3bf09e[_0x23a2('0xbb')]]['dialAMDActive']&&_0x80455e[_0x23a2('0xe7')]===_0x23a2('0xf0')){delete this[_0x23a2('0x29')][_0x80455e[_0x23a2('0xe9')]];this[_0x23a2('0xb9')](this['voiceQueues'][_0x3bf09e[_0x23a2('0xbb')]]);this[_0x23a2('0xba')][_0x3bf09e['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x3bf09e[_0x23a2('0xbb')]][_0x23a2('0x63')]+=0x1;_0xc68fd9=new Hangup(_0x3bf09e,_0x80455e);_0xc68fd9[_0x23a2('0xaf')]=0x13;_0xc68fd9[_0x23a2('0xea')]=_0x23a2('0xf1');_0xc68fd9[_0x23a2('0xec')]=_0x23a2('0xed');_0xc68fd9[_0x23a2('0xf2')]=!![];this[_0x23a2('0xe1')](_0xc68fd9,_0x23a2('0xf3'),_0x23a2('0xf4'));}if(_0x3bf09e[_0x23a2('0x51')]===_0x23a2('0x82')&&this[_0x23a2('0x22')][_0x3bf09e[_0x23a2('0xbb')]][_0x23a2('0xe6')]&&_0x80455e['value']===_0x23a2('0xe8')){delete this[_0x23a2('0x29')][_0x80455e[_0x23a2('0xe9')]];this[_0x23a2('0xb9')](this[_0x23a2('0x22')][_0x3bf09e['queue']]);_0xc68fd9=new Hangup(_0x3bf09e,_0x80455e);_0xc68fd9['state']=0x12;_0xc68fd9[_0x23a2('0xea')]=_0x23a2('0xeb');_0xc68fd9['membername']=_0x23a2('0xed');this[_0x23a2('0xe1')](_0xc68fd9,'[syncHangupInAMDIvr][createHistory]',_0x23a2('0xf5'));}if(_0x3bf09e[_0x23a2('0x51')]===_0x23a2('0x82')&&this['campaigns'][_0x3bf09e[_0x23a2('0xbb')]][_0x23a2('0xe6')]&&_0x80455e[_0x23a2('0xe7')]===_0x23a2('0xf0')){delete this[_0x23a2('0x29')][_0x80455e[_0x23a2('0xe9')]];this[_0x23a2('0xb9')](this['campaigns'][_0x3bf09e[_0x23a2('0xbb')]]);_0xc68fd9=new Hangup(_0x3bf09e,_0x80455e);_0xc68fd9['state']=0x13;_0xc68fd9[_0x23a2('0xea')]=_0x23a2('0xf1');_0xc68fd9[_0x23a2('0xec')]=_0x23a2('0xed');_0xc68fd9[_0x23a2('0xf2')]=!![];this[_0x23a2('0xe1')](_0xc68fd9,_0x23a2('0xf6'),_0x23a2('0xf7'));}}};Dialer['prototype']['syncHangup']=function(_0x2357de){var _0x3d7c7e=this['uniqueId'][_0x2357de['uniqueid']];var _0x66a0ed=this;var _0x1b504d;if(_0x3d7c7e&&_0x3d7c7e['type']==='ivr'){delete this[_0x23a2('0x29')][_0x2357de['uniqueid']];this['updateOriginated'](this['campaigns'][_0x3d7c7e[_0x23a2('0xbb')]]);this[_0x23a2('0x22')][_0x3d7c7e[_0x23a2('0xbb')]][_0x23a2('0xf8')]+=0x1;_0x1b504d=new Hangup(_0x3d7c7e,_0x2357de);this[_0x23a2('0xcf')](_0x1b504d)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xf9')));this[_0x23a2('0xcd')](_0x1b504d)['catch'](loggerCatch(_0x23a2('0xfa')));}if(_0x3d7c7e&&_0x3d7c7e[_0x23a2('0x51')]!==_0x23a2('0x82')&&isNotNull(this[_0x23a2('0xba')][_0x3d7c7e['queue']]['dialQueueProject'])){delete this[_0x23a2('0x29')][_0x2357de['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x3d7c7e[_0x23a2('0xbb')]]);this[_0x23a2('0xba')][_0x3d7c7e[_0x23a2('0xbb')]][_0x23a2('0x64')]+=0x1;this[_0x23a2('0xba')][_0x3d7c7e[_0x23a2('0xbb')]][_0x23a2('0x63')]+=0x1;_0x1b504d=new Hangup(_0x3d7c7e,_0x2357de);_0x1b504d[_0x23a2('0xaf')]=0x10;_0x1b504d[_0x23a2('0xea')]=_0x23a2('0xfb');_0x1b504d['membername']='AGI';this[_0x23a2('0xcf')](_0x1b504d)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xf9')));this['moveContactManagedDialer'](_0x1b504d)[_0x23a2('0xbe')](loggerCatch('[syncHangupIvr]'));}if(_0x3d7c7e&&_0x3d7c7e[_0x23a2('0x51')]!==_0x23a2('0x82')&&!isNotNull(this[_0x23a2('0xba')][_0x3d7c7e['queue']][_0x23a2('0xfc')])){delete this[_0x23a2('0x29')][_0x2357de['uniqueid']];this[_0x23a2('0xb9')](this[_0x23a2('0xba')][_0x3d7c7e['queue']]);this['voiceQueues'][_0x3d7c7e['queue']][_0x23a2('0xfd')]+=0x1;_0x1b504d=new Hangup(_0x3d7c7e,_0x2357de);_0x1b504d[_0x23a2('0xaf')]=0xc;_0x1b504d[_0x23a2('0xea')]=_0x2357de['cause-txt'];_0x1b504d[_0x23a2('0xec')]=_0x23a2('0xfe');this[_0x23a2('0xcf')](_0x1b504d)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0xf9')));this[_0x23a2('0xcd')](_0x1b504d)['catch'](loggerCatch(_0x23a2('0xfa')));}};Dialer[_0x23a2('0x1c')][_0x23a2('0xff')]=function(_0x396ac9){var _0x17abaa=this['uniqueId'][_0x396ac9['uniqueid']];var _0x2213e2=this;if(this[_0x23a2('0xba')][_0x396ac9['queue']]){if(_0x17abaa&&_0x17abaa[_0x23a2('0x51')]!==_0x23a2('0x82')){delete this[_0x23a2('0x29')][_0x396ac9[_0x23a2('0xe9')]];this['voiceQueues'][_0x396ac9[_0x23a2('0xbb')]][_0x23a2('0x64')]+=0x1;var _0x27dd36=new AgentComplete(_0x17abaa,_0x396ac9);if(_0x396ac9['reason']===_0x23a2('0x100')){_0x27dd36[_0x23a2('0x101')]=this[_0x23a2('0xba')][_0x396ac9[_0x23a2('0xbb')]][_0x23a2('0x102')]&&this[_0x23a2('0xba')][_0x396ac9[_0x23a2('0xbb')]][_0x23a2('0x103')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x23a2('0xcf')](_0x27dd36)[_0x23a2('0xbe')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x23a2('0xcd')](_0x27dd36)[_0x23a2('0xbe')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x23a2('0x104')]=function(_0x260b33){if(this[_0x23a2('0xba')][_0x260b33[_0x23a2('0xbb')]]){if(this[_0x23a2('0x29')][_0x260b33[_0x23a2('0xe9')]]&&this[_0x23a2('0x29')][_0x260b33[_0x23a2('0xe9')]]['type']!=='ivr'){this['updateOriginated'](this['voiceQueues'][_0x260b33[_0x23a2('0xbb')]]);this[_0x23a2('0x29')][_0x260b33[_0x23a2('0xe9')]]['answertime']=moment()[_0x23a2('0x80')](_0x23a2('0x105'));}}};Dialer[_0x23a2('0x1c')]['queueCallerAbandonCreateState']=function(_0x15119c){this[_0x23a2('0xcf')](_0x15119c)['catch'](loggerCatch(_0x23a2('0x106')));this[_0x23a2('0xcd')](_0x15119c)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x107')));};Dialer[_0x23a2('0x1c')][_0x23a2('0x32')]=function(_0x1bb204){var _0x4a3564=this[_0x23a2('0x29')][_0x1bb204[_0x23a2('0xe9')]];var _0x48eb94=this;if(this[_0x23a2('0xba')][_0x1bb204[_0x23a2('0xbb')]]){if(_0x4a3564&&_0x4a3564[_0x23a2('0x51')]!==_0x23a2('0x82')){delete this[_0x23a2('0x29')][_0x1bb204[_0x23a2('0xe9')]];this[_0x23a2('0xb9')](this[_0x23a2('0xba')][_0x1bb204[_0x23a2('0xbb')]]);_0x4a3564[_0x23a2('0x108')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x130eaa=new QueueCallerAbandon(_0x4a3564,_0x1bb204);if(getSeconds(_0x4a3564[_0x23a2('0x108')],_0x4a3564['responsetime'])>=_0x4a3564[_0x23a2('0x109')]){this[_0x23a2('0xba')][_0x1bb204[_0x23a2('0xbb')]][_0x23a2('0x70')]+=0x1;this[_0x23a2('0xba')][_0x1bb204[_0x23a2('0xbb')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x23a2('0xba')][_0x1bb204['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x130eaa[_0x23a2('0xaf')]=0xa;_0x130eaa['statedesc']='Drop';_0x130eaa['dropreason']='TIMEOUT';_0x130eaa['agiafterat']=this[_0x23a2('0xba')][_0x1bb204[_0x23a2('0xbb')]][_0x23a2('0x102')]?moment()[_0x23a2('0x80')](_0x23a2('0x105')):undefined;this['queueCallerAbandonCreateState'](_0x130eaa);}else{this[_0x23a2('0xba')][_0x1bb204[_0x23a2('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x23a2('0xba')][_0x1bb204['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x130eaa['state']=0xb;_0x130eaa[_0x23a2('0xea')]=_0x23a2('0x10a');_0x130eaa['dropreason']='CALLEREXIT';this[_0x23a2('0x10b')](_0x130eaa);}}}};Dialer['prototype'][_0x23a2('0x10c')]=function(_0x399858){if(this['actions'][_0x399858[_0x23a2('0xe9')]]){this['actions'][_0x399858[_0x23a2('0xe9')]][_0x23a2('0xb7')]=_0x399858['channel'];}if(this[_0x23a2('0x29')][_0x399858[_0x23a2('0xe9')]]){this['uniqueId'][_0x399858[_0x23a2('0xe9')]][_0x23a2('0xb7')]=_0x399858['channel'];}};Dialer[_0x23a2('0x1c')][_0x23a2('0x3b')]=function(_0x253c90){if(strategy[this['voiceQueues'][this[_0x23a2('0x27')][_0x253c90['actionid']][_0x23a2('0xbb')]][_0x23a2('0x53')]]===_0x23a2('0x1b')){if(this[_0x23a2('0x27')][_0x253c90[_0x23a2('0x10d')]]&&_[_0x23a2('0xb4')](this['actions'][_0x253c90[_0x23a2('0x10d')]]['locked'])&&_0x253c90[_0x23a2('0xb6')]==='1'&&_0x253c90[_0x23a2('0x10e')]==='0'){if(this[_0x23a2('0x23')][_0x253c90[_0x23a2('0x10f')]]){if(!this[_0x23a2('0x23')][_0x253c90[_0x23a2('0x10f')]][_0x23a2('0x110')]){this[_0x23a2('0x23')][_0x253c90[_0x23a2('0x10f')]][_0x23a2('0x110')]=!![];this[_0x23a2('0x27')][_0x253c90[_0x23a2('0x10d')]][_0x23a2('0x110')]=!![];this[_0x23a2('0x27')][_0x253c90[_0x23a2('0x10d')]]['stateinterface']=_0x253c90[_0x23a2('0x10f')];}}}}else if((strategy[this[_0x23a2('0xba')][this[_0x23a2('0x27')][_0x253c90[_0x23a2('0x10d')]][_0x23a2('0xbb')]][_0x23a2('0x53')]]||'rrmemory')==='rrmemory'){if(this[_0x23a2('0x27')][_0x253c90['actionid']]){if(this['agents'][_0x253c90[_0x23a2('0x10f')]]){this['actions'][_0x253c90[_0x23a2('0x10d')]]['stateinterface']=_0x253c90['stateinterface'];if(_[_0x23a2('0xb4')](this['queueBooked'][this['actions'][_0x253c90[_0x23a2('0x10d')]][_0x23a2('0xbb')]])){this['queueBooked'][this[_0x23a2('0x27')][_0x253c90[_0x23a2('0x10d')]][_0x23a2('0xbb')]]=[];}this[_0x23a2('0x2d')][this['actions'][_0x253c90[_0x23a2('0x10d')]][_0x23a2('0xbb')]][_0x23a2('0x111')](_[_0x23a2('0x97')](_['pick'](this[_0x23a2('0x27')][_0x253c90['actionid']],['idHopper',_0x23a2('0x10f')]),{'status':_0x253c90[_0x23a2('0xb6')],'paused':_0x253c90[_0x23a2('0x10e')]}));}}}};function unlockQueueStatus(_0x5120e7,_0xd0537e){setTimeout(function(){if(_['isUndefined'](_0x5120e7[_0x23a2('0x112')])){loggerBooked[_0x23a2('0x9e')](_0x23a2('0x113'),_0xd0537e);}_0x5120e7[_0x23a2('0x112')]=!![];loggerBooked[_0x23a2('0x85')]('[booked][unlockQueueStatus]',_0xd0537e,JSON['stringify'](_[_0x23a2('0xd4')](_0x5120e7,[_0x23a2('0x42'),_0x23a2('0x112')])));},0x1f3);}Dialer[_0x23a2('0x1c')][_0x23a2('0x3d')]=function(_0x5065b5){var _0x41ab00=this;var _0x1a0b3b=_0x41ab00[_0x23a2('0xba')][_0x41ab00[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]];if(strategy[this[_0x23a2('0xba')][this['actions'][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]][_0x23a2('0x53')]]===_0x23a2('0x1b')){if(this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]&&this['actions'][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0x10f')]){this['preview'][_0x23a2('0x114')](this[_0x23a2('0x27')][_0x5065b5['actionid']][_0x23a2('0x115')],this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]['stateinterface'])[_0x23a2('0xbe')](function(_0x1a9372){logger['error'](_0x23a2('0x116'),util[_0x23a2('0x9d')](_0x1a9372,{'showHidden':![],'depth':null}));})[_0x23a2('0x1f')](function(){_0x41ab00[_0x23a2('0xb9')](_0x41ab00[_0x23a2('0xba')][_0x41ab00[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]['queue']]);_0x41ab00['agents'][_0x41ab00[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]['stateinterface']][_0x23a2('0x110')]=![];delete _0x41ab00[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]];unlockQueueStatus(_0x1a0b3b);});}else{this[_0x23a2('0xb9')](this[_0x23a2('0xba')][this[_0x23a2('0x27')][_0x5065b5['actionid']][_0x23a2('0xbb')]]);this[_0x23a2('0xc7')]({'active':![],'ContactId':this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xd5')],'ListId':this[_0x23a2('0x27')][_0x5065b5['actionid']][_0x23a2('0xd6')],'VoiceQueueId':this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xd8')]||undefined,'CampaignId':this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]['CampaignId']||undefined})[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x117')));delete this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]];unlockQueueStatus(_0x1a0b3b);}}else if((strategy[this['voiceQueues'][this['actions'][_0x5065b5[_0x23a2('0x10d')]]['queue']][_0x23a2('0x53')]]||_0x23a2('0x118'))===_0x23a2('0x118')){var _0x5dc07f;if(this['actions'][_0x5065b5['actionid']]&&!_[_0x23a2('0x4a')](this[_0x23a2('0x2d')][this['actions'][_0x5065b5[_0x23a2('0x10d')]]['queue']])){if(this[_0x23a2('0x2e')][_0x41ab00[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]['queue']]){this[_0x23a2('0x2e')][_0x41ab00['actions'][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]]=this[_0x23a2('0x2e')][this['actions'][_0x5065b5[_0x23a2('0x10d')]]['queue']]?this[_0x23a2('0x2e')][this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]]['queue']]:this[_0x23a2('0x2d')][this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]]?this['queueBooked'][this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]][_0x23a2('0x119')]||0x0:0x0;}this[_0x23a2('0x2d')][this['actions'][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]]['_rr']=this[_0x23a2('0x2e')][this[_0x23a2('0x27')][_0x5065b5[_0x23a2('0x10d')]][_0x23a2('0xbb')]];for(var _0x2278d5=0x0;_0x2278d5=0x0?!![]:![];})['catch'](myreject(_0x311e6f)));}}else{_0x1a8bc8[_0x23a2('0x111')](ami[_0x23a2('0xb5')]({'action':_0x23a2('0x130'),'command':util[_0x23a2('0x80')](_0x23a2('0x131'),_0x198a34,!_[_0x23a2('0x3f')](config[_0x23a2('0x12c')][_0x261349])?_0x261349:'')})[_0x23a2('0xc1')](function(_0x155baf){return _0x155baf['content'][_0x23a2('0x134')](_0x23a2('0x133'))>=0x0?!![]:![];})[_0x23a2('0xbe')](myreject(_0x311e6f)));}BPromise[_0x23a2('0x135')](_0x1a8bc8)[_0x23a2('0xc1')](function(_0x39a695){var _0x2f7fc2=_[_0x23a2('0x136')](_0x39a695);if(_0x2f7fc2){return _0x5c78c5(_0x2f7fc2);}else{_0x3882fe[_0x23a2('0x40')]=_0x3ae809?_0x23a2('0x137'):_0x23a2('0x138');return _0x311e6f(msgResponse('[ifTime][promiseAll]',_0x23a2('0x128'),_0x23a2('0x139')+_0x3ae809+'\x20'+_0x3b1d5b+_0x23a2('0x13a')+util[_0x23a2('0x9d')](_0x198a34,{'showHidden':![],'depth':null})+_0x23a2('0x13b')+_0x261349));}})[_0x23a2('0xbe')](function(_0x2c616c){return _0x311e6f(msgResponse(_0x23a2('0x127'),'Failure',JSON[_0x23a2('0x7f')](_0x2c616c)));});});};Dialer[_0x23a2('0x1c')]['checkDialMethod']=function(_0x159db0){var _0x17271d=this;return function(){switch(_0x159db0[_0x23a2('0x5e')]){case _0x23a2('0x13c'):freeVariablesPredictive(_0x159db0);_0x17271d[_0x23a2('0x13d')](_0x159db0,0x1);break;case _0x23a2('0x13e'):freeVariablesPredictive(_0x159db0);_0x17271d[_0x23a2('0x13d')](_0x159db0,_0x159db0['dialPowerLevel']);break;case _0x23a2('0x9'):_0x17271d['predictive'](_0x159db0);break;case'booked':freeVariablesPredictive(_0x159db0);_0x17271d[_0x23a2('0x13d')](_0x159db0,0x1);break;default:freeVariablesPredictive(_0x159db0);logger[_0x23a2('0x9e')](_0x23a2('0x13f'),_0x159db0['name'],_0x23a2('0x140'));}};};Dialer[_0x23a2('0x1c')]['launchHandleIvr']=function(_0x42d276){var _0x5432c5=this;return function(){_0x5432c5['handleIvr'](_0x42d276);};};Dialer['prototype'][_0x23a2('0xb')]=function(_0xe7b28b){var _0x783e59=this;if(isNotPreview(_0xe7b28b['dialMethod'])){if(isVoiceQueueOutbound(_0xe7b28b[_0x23a2('0x51')])&&isActive(_0xe7b28b[_0x23a2('0x5d')])){_0xe7b28b['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x23a2('0xc1')](checkIsLoggedIn(_0xe7b28b,_0xe7b28b[_0x23a2('0x56')]))['then'](checkIsActive(_0xe7b28b,_0xe7b28b[_0x23a2('0x5d')]))[_0x23a2('0xc1')](checkInterval(_0xe7b28b))['then'](_0x783e59[_0x23a2('0x124')](_0xe7b28b))[_0x23a2('0xc1')](_0x783e59['checkIfTime'](_0xe7b28b[_0x23a2('0x141')],_0xe7b28b['dialTimezone'],_0xe7b28b[_0x23a2('0x42')],_0xe7b28b))[_0x23a2('0xc1')](_0x783e59[_0x23a2('0x142')](_0xe7b28b[_0x23a2('0x48')],_0xe7b28b[_0x23a2('0x143')],_0xe7b28b['name'],_0xe7b28b))[_0x23a2('0xc1')](_0x783e59[_0x23a2('0x144')](_0xe7b28b))[_0x23a2('0xbe')](loggerCatchQueueSummary('[syncQueueSummary]',_0xe7b28b));}else{notSendMessagesQueue(_0xe7b28b);}}else{freeVariablesPredictive(_0xe7b28b);}};Dialer['prototype'][_0x23a2('0x123')]=function(){var _0x43b2f1=this;var _0x1263aa;for(var _0xb08f26 in this['campaigns']){if(this['campaigns'][_0x23a2('0xa1')](_0xb08f26)){_0x1263aa=this['campaigns'][_0xb08f26];if(isCampaignIvr(_0x1263aa[_0x23a2('0x51')])&&isActive(_0x1263aa['active'])){_0x1263aa[_0x23a2('0xa9')]=!![];BPromise[_0x23a2('0xc0')]()['then'](checkIsActive(_0x1263aa,_0x1263aa[_0x23a2('0x7d')]))['then'](checkInterval(_0x1263aa))['then'](_0x43b2f1[_0x23a2('0x124')](_0x1263aa))[_0x23a2('0xc1')](_0x43b2f1[_0x23a2('0x126')](_0x1263aa['dialGlobalInterval'],_0x1263aa['dialTimezone'],_0x1263aa[_0x23a2('0x42')],_0x1263aa))[_0x23a2('0xc1')](_0x43b2f1['checkIfTimeIntervals'](_0x1263aa[_0x23a2('0x48')],_0x1263aa['dialTimezone'],_0x1263aa[_0x23a2('0x42')],_0x1263aa))[_0x23a2('0xc1')](_0x43b2f1[_0x23a2('0x145')](_0x1263aa))[_0x23a2('0xbe')](loggerCatchQueueSummary('[syncCampaigns]',_0x1263aa));}else{notSendMessagesCampaign(_0x1263aa);}}}};function getCallerIdRandom(_0x23d0ff,_0x598a6e){var _0x48d729,_0x3656cc,_0x182e61;if(_0x598a6e<=0x0){_0x598a6e=0x1;}_0x48d729=new RegExp(_0x23a2('0x146')+_0x598a6e+'}$');_0x3656cc=Math['pow'](0xa,_0x598a6e-0x1);_0x182e61=Math[_0x23a2('0x147')](0xa,_0x598a6e)-0x1;return util[_0x23a2('0x80')]('%s',_['replace'](_0x23d0ff,_0x48d729,_['random'](_0x3656cc,_0x182e61)));}function extractCalleridName(_0x19f827){var _0x19a4c9=_0x19f827[_0x23a2('0x148')](/"(.*?)"/);return _0x19a4c9?_0x19a4c9[0x1]:_0x19f827;}function extractCalleridNumber(_0x5e5b73){var _0x481a7b=_0x5e5b73[_0x23a2('0x148')](/<(.*?)>/);return _0x481a7b?_0x481a7b[0x1]:_0x5e5b73;}Dialer[_0x23a2('0x1c')][_0x23a2('0x149')]=function(_0x331e7d,_0x5826eb){var _0x48ff40=this;var _0x4d2eda=uuid['v4']();this['actions'][_0x4d2eda]=new Action(_0x331e7d,_0x5826eb,_0x4d2eda);return new BPromise(function(_0xb74dc9,_0x36dce3){if(_[_0x23a2('0x3f')](_0x331e7d)&&'object'!==typeof _0x331e7d){return _0x36dce3(msgResponse(_0x23a2('0x14a'),_0x23a2('0x128'),'voiceQueue\x20is\x20undefine'));}if(_[_0x23a2('0x3f')](_0x5826eb[_0x23a2('0x14b')][_0x23a2('0x14c')])||_0x5826eb[_0x23a2('0x14b')][_0x23a2('0x14c')]===null){return _0x36dce3(msgResponse(_0x23a2('0x14a'),'Failure',_0x23a2('0x14d')));}var _0x23de69={'XMD-CALLERID':_0x48ff40['actions'][_0x4d2eda][_0x23a2('0x14e')](),'XMD-AGI':_0x331e7d[_0x23a2('0xfc')]?util[_0x23a2('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0x331e7d[_0x23a2('0xfc')]):'NONE','XMD-AGIAFTER':_0x331e7d['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x331e7d[_0x23a2('0x102')]):_0x23a2('0x14f'),'XMD-QUEUE':_0x331e7d['type']==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x331e7d[_0x23a2('0x42')],_0x331e7d[_0x23a2('0x150')]||'',_0x331e7d[_0x23a2('0x103')]?'c':'',_0x331e7d[_0x23a2('0x109')]||0x3):_0x23a2('0x14f'),'XMD-CONTACTID':_0x5826eb['ContactId'],'XMD-CDRTYPE':_0x23a2('0x8'),'CALLERID(all)':_0x48ff40[_0x23a2('0x27')][_0x4d2eda][_0x23a2('0x14e')](),'XMD-AMD':_0x331e7d['dialAMDActive']?_0x23a2('0x151'):_0x23a2('0x14f'),'XMD-DESTINATION':_0x23a2('0xe5')};if(_0x331e7d[_0x23a2('0xe6')]){_0x23de69[_0x23a2('0x152')]=_0x331e7d[_0x23a2('0x153')]||0x9c4;_0x23de69['XMD-AMDGREETING']=_0x331e7d[_0x23a2('0x154')]||0x5dc;_0x23de69[_0x23a2('0x155')]=_0x331e7d[_0x23a2('0x156')]||0x320;_0x23de69[_0x23a2('0x157')]=_0x331e7d[_0x23a2('0x158')]||0x1388;_0x23de69[_0x23a2('0x159')]=_0x331e7d[_0x23a2('0x15a')]||0x64;_0x23de69[_0x23a2('0x15b')]=_0x331e7d[_0x23a2('0x15c')]||0x32;_0x23de69[_0x23a2('0x15d')]=_0x331e7d[_0x23a2('0x15e')]||0x3;_0x23de69['XMD-AMDSILENCETHRESHOLD']=_0x331e7d[_0x23a2('0x15f')]||0x100;_0x23de69[_0x23a2('0x160')]=_0x331e7d[_0x23a2('0x161')]||0x1388;}if(_0x331e7d[_0x23a2('0x51')]===_0x23a2('0x52')){_0x23de69[_0x23a2('0x162')]=_0x5826eb['VoiceQueueId'];}else{_0x23de69[_0x23a2('0x163')]=_0x5826eb['CampaignId'];}for(var _0x2da3ad in _0x5826eb[_0x23a2('0x14b')]){if(_0x5826eb[_0x23a2('0x14b')][_0x23a2('0xa1')](_0x2da3ad)){if(isNotNull(_0x5826eb['Contact'][_0x2da3ad])&&_0x2da3ad!=='id'&&_0x2da3ad!==_0x23a2('0x164')&&_0x2da3ad!==_0x23a2('0x165')&&_0x2da3ad!==_0x23a2('0x166')){_0x23de69[util['format'](_0x23a2('0x167'),'XMD-',_['toUpper'](_0x2da3ad))]=_0x5826eb[_0x23a2('0x14b')][_0x2da3ad];}}}var _0x225afe=_0x48ff40[_0x23a2('0xdd')](_0x331e7d[_0x23a2('0x7c')])?getCallerId(_0x331e7d[_0x23a2('0x7c')][_0x23a2('0x7e')],_0x331e7d[_0x23a2('0x5f')],_0x331e7d['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x331e7d['dialOriginateCallerIdNumber'],_0x331e7d['dialRandomLastDigitCallerIdNumber']):_0x331e7d[_0x23a2('0x60')]):getCallerId(_[_0x23a2('0xb4')](_0x331e7d[_0x23a2('0x168')])?_0x331e7d['Trunk'][_0x23a2('0x7e')]:_0x331e7d[_0x23a2('0x168')][_0x23a2('0x7e')],_0x331e7d[_0x23a2('0x5f')],_0x331e7d[_0x23a2('0x169')]>0x0?getCallerIdRandom(_0x331e7d[_0x23a2('0x60')],_0x331e7d[_0x23a2('0x169')]):_0x331e7d[_0x23a2('0x60')]);if(_0x225afe){_0x23de69[_0x23a2('0x16a')]=_0x48ff40['actions'][_0x4d2eda]['originatecalleridname']=extractCalleridName(_0x225afe);_0x23de69[_0x23a2('0x16b')]=_0x48ff40[_0x23a2('0x27')][_0x4d2eda]['originatecalleridnum']=extractCalleridNumber(_0x225afe);}return ami[_0x23a2('0xb5')]({'actionid':_0x4d2eda,'action':_0x23a2('0x14a'),'channel':_0x48ff40[_0x23a2('0xdd')](_0x331e7d[_0x23a2('0x7c')])?util['format']('SIP/%s/%s%s',_0x331e7d[_0x23a2('0x7c')][_0x23a2('0x42')],isNotNull(_0x331e7d[_0x23a2('0x62')])?_0x331e7d[_0x23a2('0x62')][_0x23a2('0x16c')]()||'':'',_0x331e7d[_0x23a2('0x16d')]>0x0?_0x5826eb[_0x23a2('0x14b')][_0x23a2('0x14c')][_0x23a2('0x16e')](_0x331e7d['dialCutDigit']):_0x5826eb[_0x23a2('0x14b')][_0x23a2('0x14c')]):util[_0x23a2('0x80')](_0x23a2('0x16f'),_[_0x23a2('0xb4')](_0x331e7d[_0x23a2('0x168')])?_0x331e7d[_0x23a2('0x7c')][_0x23a2('0x42')]:_0x331e7d[_0x23a2('0x168')][_0x23a2('0x42')],isNotNull(_0x331e7d['dialPrefix'])?_0x331e7d['dialPrefix'][_0x23a2('0x16c')]()||'':'',_0x331e7d[_0x23a2('0x16d')]>0x0?_0x5826eb[_0x23a2('0x14b')][_0x23a2('0x14c')][_0x23a2('0x16e')](_0x331e7d[_0x23a2('0x16d')]):_0x5826eb[_0x23a2('0x14b')][_0x23a2('0x14c')]),'callerid':_0x225afe,'Exten':_0x23a2('0xe5'),'Context':_0x23a2('0x170'),'Priority':'1','variable':_0x23de69,'timeout':(_0x331e7d[_0x23a2('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d2eda})[_0x23a2('0xc1')](function(_0x5ec4dd){return _0xb74dc9(_0x5ec4dd);})[_0x23a2('0xbe')](function(_0x12fa65){_0x331e7d[_0x23a2('0x6a')]+=0x1;var _0x163a02=new History(_0x48ff40['actions'][_0x4d2eda]);logger['error'](util[_0x23a2('0x80')](_0x23a2('0x171'),JSON[_0x23a2('0x7f')](_0x12fa65)));_0x163a02[_0x23a2('0xaf')]=0xe;_0x163a02[_0x23a2('0xea')]=_0x23a2('0x172');_0x163a02['starttime']=moment()[_0x23a2('0x80')](_0x23a2('0x105'));_0x163a02['endtime']=_0x163a02[_0x23a2('0xb0')];_0x48ff40[_0x23a2('0xcf')](_0x163a02)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x173')));_0x48ff40[_0x23a2('0xcd')](_0x163a02)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x173')))[_0x23a2('0x1f')](function(){delete _0x48ff40['actions'][_0x4d2eda];return _0x36dce3(msgResponse('originate',_0x23a2('0x4c'),_0x23a2('0x174')));});});});};Dialer[_0x23a2('0x1c')]['syncOriginateResponse']=function(_0x30fabb){var _0x538d32=this[_0x23a2('0x27')][_0x30fabb[_0x23a2('0x10d')]];var _0x51238e=this;if(_0x538d32){delete this[_0x23a2('0x27')][_0x30fabb[_0x23a2('0x10d')]];_0x538d32['responsetime']=moment()['format'](_0x23a2('0x105'));var _0x3dc331=_0x538d32[_0x23a2('0x51')]===_0x23a2('0x82')?this['campaigns'][_0x538d32[_0x23a2('0xbb')]]:this[_0x23a2('0xba')][_0x538d32[_0x23a2('0x175')]()];if(!this['isSuccess'](_0x30fabb['response'])){this[_0x23a2('0xb9')](_0x3dc331);return this['callProgressDetecting'](_0x538d32,_0x3dc331,_0x30fabb)[_0x23a2('0xc1')](function(_0x239221){})[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x176')));}else{this[_0x23a2('0x29')][_0x30fabb[_0x23a2('0xe9')]]=_0x538d32;}}};Dialer[_0x23a2('0x1c')][_0x23a2('0x177')]=function(_0x3905eb,_0x28b1c1,_0x1895ba){var _0x2d31ff=new History(_0x28b1c1);if(_0x2d31ff['countbusyretry']+_0x2d31ff['countcongestionretry']+_0x2d31ff[_0x23a2('0x178')]>=_0x1895ba[_0x23a2('0x179')]-0x1){return!![];}switch(_0x3905eb){case 0x3:if(_0x2d31ff['countnoanswerretry']>=_0x1895ba['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0x23a2('0xc7')]({'active':![],'countnoanswerretry':_0x2d31ff[_0x23a2('0x178')]+=0x1,'scheduledat':moment()[_0x23a2('0x17a')](_0x1895ba[_0x23a2('0x17b')],_0x23a2('0x17c'))[_0x23a2('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2d31ff[_0x23a2('0xd5')],'ListId':_0x2d31ff[_0x23a2('0xd6')],'VoiceQueueId':_0x2d31ff[_0x23a2('0xd8')]||undefined,'CampaignId':_0x2d31ff['CampaignId']||undefined})[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x17d')));}break;case 0x5:if(_0x2d31ff[_0x23a2('0x17e')]>=_0x1895ba['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x23a2('0xc7')]({'active':![],'countbusyretry':_0x2d31ff[_0x23a2('0x17e')]+=0x1,'scheduledat':moment()['add'](_0x1895ba[_0x23a2('0x17f')],_0x23a2('0x17c'))[_0x23a2('0x80')](_0x23a2('0x105')),'ContactId':_0x2d31ff[_0x23a2('0xd5')],'ListId':_0x2d31ff[_0x23a2('0xd6')],'VoiceQueueId':_0x2d31ff['VoiceQueueId']||undefined,'CampaignId':_0x2d31ff['CampaignId']||undefined})[_0x23a2('0xbe')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x2d31ff['countcongestionretry']>=_0x1895ba[_0x23a2('0x180')]-0x1){return!![];}else{this[_0x23a2('0xc7')]({'active':![],'countcongestionretry':_0x2d31ff[_0x23a2('0x181')]+=0x1,'scheduledat':moment()[_0x23a2('0x17a')](_0x1895ba['dialCongestionRetryFrequency'],_0x23a2('0x17c'))[_0x23a2('0x80')](_0x23a2('0x105')),'ContactId':_0x2d31ff['ContactId'],'ListId':_0x2d31ff['ListId'],'VoiceQueueId':_0x2d31ff[_0x23a2('0xd8')]||undefined,'CampaignId':_0x2d31ff[_0x23a2('0xd9')]||undefined})[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x182')));}break;default:return!![];}};Dialer['prototype'][_0x23a2('0x183')]=function(_0x37d95c,_0x4f123c,_0x178057){var _0x5c047c=this;var _0x2e2edb=new History(_0x37d95c);return new BPromise(function(_0x4c045a,_0x4820ce){if(_[_0x23a2('0x3f')](_0x4f123c)&&_0x23a2('0x184')!==typeof _0x4f123c){return _0x4820ce(msgResponse(_0x23a2('0x185'),'Failure','entity\x20is\x20undefine'));}if(_[_0x23a2('0x3f')](_0x178057)&&'object'!==typeof _0x178057){return _0x4820ce(msgResponse(_0x23a2('0x185'),_0x23a2('0x128'),'evt\x20is\x20undefine'));}switch(_0x178057[_0x23a2('0x186')]){case'0':_0x4f123c[_0x23a2('0x69')]+=0x1;_0x2e2edb[_0x23a2('0xaf')]=0x0;_0x2e2edb[_0x23a2('0xea')]='NoSuchNumber';_0x5c047c[_0x23a2('0xcf')](_0x2e2edb)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5c047c[_0x23a2('0x177')](0x0,_0x37d95c,_0x4f123c)){if(_0x2e2edb[_0x23a2('0x17e')]+_0x2e2edb[_0x23a2('0x181')]+_0x2e2edb[_0x23a2('0x178')]>=_0x4f123c[_0x23a2('0x179')]){_0x5c047c[_0x23a2('0x187')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x23a2('0x188'));}else{_0x5c047c[_0x23a2('0x189')](_0x2e2edb,_0x4c045a,_0x4820ce,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4f123c[_0x23a2('0x68')]+=0x1;_0x2e2edb[_0x23a2('0xaf')]=0x3;_0x2e2edb[_0x23a2('0xea')]=_0x23a2('0x18a');_0x2e2edb[_0x23a2('0x178')]+=0x1;_0x2e2edb[_0x23a2('0x18b')]+=0x1;_0x5c047c[_0x23a2('0xcf')](_0x2e2edb)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x18c')));if(_0x5c047c[_0x23a2('0x177')](0x3,_0x37d95c,_0x4f123c)){if(_0x2e2edb[_0x23a2('0x178')]>=_0x4f123c['dialNoAnswerMaxRetry']){_0x5c047c[_0x23a2('0x189')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x23a2('0x18d'));}else{_0x5c047c[_0x23a2('0x187')](_0x2e2edb,_0x4c045a,_0x4820ce,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x4f123c[_0x23a2('0x18e')]+=0x1;_0x2e2edb['state']=0x5;_0x2e2edb['statedesc']=_0x23a2('0x18f');_0x2e2edb[_0x23a2('0x17e')]+=0x1;_0x2e2edb[_0x23a2('0x18b')]+=0x1;_0x5c047c[_0x23a2('0xcf')](_0x2e2edb)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x190')));if(_0x5c047c['checkRetriveMax'](0x5,_0x37d95c,_0x4f123c)){if(_0x2e2edb[_0x23a2('0x17e')]>=_0x4f123c['dialBusyMaxRetry']){_0x5c047c[_0x23a2('0x189')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x23a2('0x191'));}else{_0x5c047c[_0x23a2('0x187')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x23a2('0x191'));}}break;case'8':_0x4f123c[_0x23a2('0x65')]+=0x1;_0x2e2edb[_0x23a2('0xaf')]=0x8;_0x2e2edb['statedesc']=_0x23a2('0x192');_0x2e2edb['countcongestionretry']+=0x1;_0x2e2edb['countglobal']+=0x1;_0x5c047c[_0x23a2('0xcf')](_0x2e2edb)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x193')));if(_0x5c047c[_0x23a2('0x177')](0x8,_0x37d95c,_0x4f123c)){if(_0x2e2edb[_0x23a2('0x181')]>=_0x4f123c[_0x23a2('0x180')]){_0x5c047c[_0x23a2('0x189')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x23a2('0x194'));}else{_0x5c047c['stateGlobal'](_0x2e2edb,_0x4c045a,_0x4820ce,'reason\x208\x20congestion');}}break;default:_0x4f123c[_0x23a2('0xfd')]+=0x1;_0x2e2edb[_0x23a2('0xaf')]=0xc;_0x2e2edb[_0x23a2('0xea')]=_0x178057[_0x23a2('0x186')];_0x5c047c[_0x23a2('0xcf')](_0x2e2edb)[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x195')));if(_0x5c047c['checkRetriveMax'](_0x178057['reason'],_0x37d95c,_0x4f123c)){if(_0x2e2edb[_0x23a2('0x17e')]+_0x2e2edb[_0x23a2('0x181')]+_0x2e2edb['countnoanswerretry']>=_0x4f123c[_0x23a2('0x179')]){_0x5c047c[_0x23a2('0x187')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x178057[_0x23a2('0x186')]);}else{_0x5c047c[_0x23a2('0x189')](_0x2e2edb,_0x4c045a,_0x4820ce,_0x178057[_0x23a2('0x186')]);}}}});};Dialer[_0x23a2('0x1c')][_0x23a2('0x187')]=function(_0x27e9c7,_0x4d0242,_0x55fea3,_0x547cce){var _0x36b8e6=new Final(_0x27e9c7);_0x36b8e6['state']=0xf;_0x36b8e6[_0x23a2('0xea')]='Global';this['createStateFinal'](_0x36b8e6,_0x4d0242,_0x55fea3,_0x547cce);};Dialer[_0x23a2('0x1c')][_0x23a2('0x189')]=function(_0x10fda0,_0x58f570,_0x4e0464,_0x5e8a96){this[_0x23a2('0xcd')](_0x10fda0)['then'](function(_0x55043b){return _0x58f570(msgResponse(_0x23a2('0x185'),'Success',_0x5e8a96));})[_0x23a2('0xbe')](function(_0x8d59cb){return _0x4e0464(msgResponse(_0x23a2('0x196'),_0x23a2('0x128'),_0x23a2('0x197')));});};Dialer['prototype'][_0x23a2('0x9')]=function(_0x39df09){var _0x41e7e6=this;var _0x235076=_0x39df09[_0x23a2('0x198')]/0x64;var _0x58aeec=_0x39df09[_0x23a2('0x67')]/(_0x39df09[_0x23a2('0x67')]+_0x39df09[_0x23a2('0x64')]);var _0x29c409=Math[_0x23a2('0x199')](_0x39df09['predictiveIntervalAvailable']*(_0x39df09['predictiveIntervalMaxThreshold']/0x64));var _0x2d1a17=Math[_0x23a2('0x199')](_0x39df09[_0x23a2('0x75')]*(_0x39df09['predictiveIntervalMinThreshold']/0x64));var _0x86cd1a=_0x39df09[_0x23a2('0x55')]+_0x39df09[_0x23a2('0x59')];var _0x379b0e=Math[_0x23a2('0x19a')](_0x39df09[_0x23a2('0x78')]*_0x39df09[_0x23a2('0x7a')]*_0x39df09[_0x23a2('0x72')]*_0x39df09[_0x23a2('0x73')]);if(_[_0x23a2('0x3f')](_0x39df09['startProgressive'])){if(!_[_0x23a2('0x3f')](_0x39df09[_0x23a2('0x2a')])){_0x39df09[_0x23a2('0x2a')]=undefined;loggerPredictive[_0x23a2('0x9e')](_0x23a2('0x19b'),_0x23a2('0x19c'));}if(!_[_0x23a2('0x3f')](_0x39df09[_0x23a2('0x9a')])){loggerPredictive[_0x23a2('0x9e')](_0x23a2('0x19b'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x39df09[_0x23a2('0x9a')]);_0x39df09['handlePredictive']=undefined;}_0x39df09[_0x23a2('0x2b')]=moment()[_0x23a2('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x39df09[_0x23a2('0x42')],_0x23a2('0x19d'),_0x39df09[_0x23a2('0x2b')]);this['handlePower'](_0x39df09,0x1);}else if(ifInterval(_0x39df09[_0x23a2('0x19e')],_0x39df09[_0x23a2('0x2b')])){this[_0x23a2('0x13d')](_0x39df09,0x1);loggerPredictiveCalls[_0x23a2('0x85')]('[startMethodPredictive][StartProgressive][Loop]',_0x39df09['startProgressive'],_0x39df09[_0x23a2('0x42')]);_0x39df09[_0x23a2('0x78')]=0x0;_0x39df09[_0x23a2('0x19f')]=0x0;}else if(_0x235076<_0x58aeec&&_0x39df09[_0x23a2('0x1a0')]===_0x23a2('0x1a1')){freeVariablesPredictive(_0x39df09);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1a2'),_0x23a2('0x1a3'),_0x58aeec,'startProgressive',_0x39df09[_0x23a2('0x42')]);}else if(_0x379b0e<_0x39df09[_0x23a2('0x19f')]&&_0x39df09['dialPredictiveOptimization']===_0x23a2('0x1a1')){freeVariablesPredictive(_0x39df09);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1a4'),'Max\x20Drop\x20',_0x379b0e,_0x23a2('0x1a5'),_0x39df09['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x39df09[_0x23a2('0x42')]);}else if(!ifInterval(_0x39df09[_0x23a2('0x19e')],_0x39df09[_0x23a2('0x2b')])&&_[_0x23a2('0x3f')](_0x39df09[_0x23a2('0x2a')])&&!_[_0x23a2('0x3f')](_0x39df09[_0x23a2('0x2b')])){_0x39df09[_0x23a2('0x2a')]=moment()['format'](_0x23a2('0x105'));loggerPredictive['info'](_0x39df09[_0x23a2('0x42')],'started\x20in\x20predictive\x20at',_0x39df09['startPredictive']);this[_0x23a2('0xc4')](_0x39df09[_0x23a2('0x19e')])[_0x23a2('0xc1')](this[_0x23a2('0x1a6')](_0x39df09))['then'](mergeDataErlangB(_0x39df09))[_0x23a2('0xc1')](this['startMethodPredictive'](_0x39df09))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x39df09));}else if(!ifInterval(_0x39df09[_0x23a2('0x19e')],_0x39df09['startPredictive'])){_0x39df09[_0x23a2('0x19f')]=0x0;_0x39df09[_0x23a2('0x2a')]=moment()[_0x23a2('0x80')](_0x23a2('0x105'));loggerPredictive[_0x23a2('0x85')](_0x39df09[_0x23a2('0x42')],_0x23a2('0x1a7'),_0x39df09[_0x23a2('0x2a')]);clearInterval(_0x39df09[_0x23a2('0x9a')]);_0x39df09[_0x23a2('0x9a')]=undefined;this[_0x23a2('0xc4')](_0x39df09[_0x23a2('0x19e')])[_0x23a2('0xc1')](this[_0x23a2('0x1a6')](_0x39df09))['then'](mergeDataErlangB(_0x39df09))[_0x23a2('0xc1')](this[_0x23a2('0x1a8')](_0x39df09))[_0x23a2('0xbe')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x39df09));}else if(_0x39df09['predictiveIntervalAvailable']&&_0x86cd1a<_0x39df09[_0x23a2('0x75')]-_0x2d1a17){freeVariablesPredictive(_0x39df09);loggerPredictive[_0x23a2('0x85')](_0x39df09[_0x23a2('0x42')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x86cd1a,_0x23a2('0x1a9'),_0x39df09[_0x23a2('0x75')],'-',_0x2d1a17,'=',_0x39df09[_0x23a2('0x75')]-_0x2d1a17,')');}else if(_0x39df09[_0x23a2('0x75')]&&_0x86cd1a>_0x39df09[_0x23a2('0x75')]+_0x29c409){freeVariablesPredictive(_0x39df09);loggerPredictive[_0x23a2('0x85')](_0x39df09[_0x23a2('0x42')],_0x23a2('0x1aa'),_0x86cd1a,_0x23a2('0x1ab'),_0x39df09[_0x23a2('0x75')],'+',_0x29c409,'=',_0x39df09[_0x23a2('0x75')]+_0x29c409,')');}};Dialer[_0x23a2('0x1c')][_0x23a2('0x1a6')]=function(_0x3995a8){var _0x30f8ad=this;return function(_0x27be73){return new BPromise(function(_0x31d4d5,_0x1ff6e5){_['merge'](_0x3995a8,_0x27be73[0x0]);if(checkGetDataPredictive(_0x27be73[0x0])){var _0x368379=_0x3995a8[_0x23a2('0x75')]=_0x3995a8[_0x23a2('0x59')]+_0x3995a8[_0x23a2('0x55')];var _0x44f97d=_0x3995a8[_0x23a2('0x19e')]*0x3c;var _0x32eeae=_0x27be73[0x0][_0x23a2('0x8c')]+_0x27be73[0x0][_0x23a2('0x6e')];var _0x3cf35a=(_0x27be73[0x0][_0x23a2('0x6d')]+_0x27be73[0x0][_0x23a2('0x70')]+_0x27be73[0x0][_0x23a2('0x6f')])/_0x27be73[0x0]['predictiveIntervalTotalCalls'];_0x3995a8['predictiveIntervalHitRate']=_0x3cf35a>0x0?_0x3cf35a:0x1;switch(_0x3995a8[_0x23a2('0x1a0')]){case'dropRate':var _0x5f4bf5=_0x3995a8['dialPredictiveOptimizationPercentage']/0x64;return _0x30f8ad['abandonmentRate'](_0x368379,_0x44f97d,_0x32eeae,_0x3cf35a,_0x5f4bf5)[_0x23a2('0xc1')](function(_0x2c8c48){return _0x31d4d5(_0x2c8c48);});case _0x23a2('0x1ac'):var _0x4b9ac9=_0x3995a8[_0x23a2('0x198')]/0x64;return _0x30f8ad[_0x23a2('0x1ad')](_0x368379,_0x44f97d,_0x32eeae,_0x3cf35a,_0x4b9ac9)[_0x23a2('0xc1')](function(_0xaffc6b){return _0x31d4d5(_0xaffc6b);});default:return _0x1ff6e5(msgResponse(_0x23a2('0x1ae'),_0x23a2('0x128'),_0x23a2('0x1af')));}}else{return _0x1ff6e5(msgResponse(_0x23a2('0x1ae'),'Failure',_0x23a2('0x1b0')));}});};};Dialer[_0x23a2('0x1c')][_0x23a2('0x1b1')]=function(_0x514079){var _0x117253=this;return function(_0x3713fd){return new BPromise(function(_0x35ac45,_0x3f8de5){_['merge'](_0x514079,_0x3713fd[0x0]);if(checkGetDataPredictive(_0x3713fd[0x0])){loggerPredictive['info'](JSON[_0x23a2('0x7f')](_0x3713fd[0x0]));if(_0x514079[_0x23a2('0x1a0')]===_0x23a2('0x1a1')){return _0x117253[_0x23a2('0xcb')](_0x514079['id'])['then'](function(_0x3477f0){var _0x5d82af=_0x514079[_0x23a2('0x56')]-_0x3477f0[0x0][_0x23a2('0x1b2')];var _0x2fd5fc=_0x514079[_0x23a2('0x19e')]*0x3c;var _0x581a1d=_0x3713fd[0x0][_0x23a2('0x8c')]+_0x3713fd[0x0][_0x23a2('0x6e')];var _0x46cce5=(_0x3713fd[0x0][_0x23a2('0x6d')]+_0x3713fd[0x0][_0x23a2('0x70')]+_0x3713fd[0x0][_0x23a2('0x6f')])/_0x3713fd[0x0][_0x23a2('0x76')];var _0x4f615e=_0x514079[_0x23a2('0x198')]/0x64;_0x514079['predictiveIntervalPauses']=_0x3477f0[0x0][_0x23a2('0x1b2')]||0x0;_0x514079[_0x23a2('0x72')]=_0x46cce5>0x0?_0x46cce5:0x1;return _0x117253['abandonmentRate'](_0x5d82af,_0x2fd5fc,_0x581a1d,_0x46cce5,_0x4f615e);})[_0x23a2('0xc1')](function(_0x3189cc){return _0x35ac45(_0x3189cc);})['catch'](function(_0x131170){return _0x3f8de5(msgResponse('[CatchErlangB]','Failure',JSON[_0x23a2('0x7f')](_0x131170)));});}if(_0x514079[_0x23a2('0x1a0')]===_0x23a2('0x1ac')){return _0x117253[_0x23a2('0xcb')](_0x514079['id'])['then'](function(_0x4019aa){var _0x2b62f5=_0x514079[_0x23a2('0x56')]-_0x4019aa[0x0]['outboundQueuePauses'];var _0x311d00=_0x514079['dialPredictiveInterval']*0x3c;var _0x12f929=_0x3713fd[0x0][_0x23a2('0x8c')]+_0x3713fd[0x0][_0x23a2('0x6e')];var _0x3d50c9=(_0x3713fd[0x0][_0x23a2('0x6d')]+_0x3713fd[0x0][_0x23a2('0x70')]+_0x3713fd[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3713fd[0x0][_0x23a2('0x76')];var _0x3bd7a1=_0x514079[_0x23a2('0x198')]/0x64;_0x514079[_0x23a2('0x74')]=_0x4019aa[0x0]['outboundQueuePauses']||0x0;_0x514079[_0x23a2('0x72')]=_0x3d50c9>0x0?_0x3d50c9:0x1;return _0x117253['busyFactor'](_0x2b62f5,_0x311d00,_0x12f929,_0x3d50c9,_0x3bd7a1);})[_0x23a2('0xc1')](function(_0x5b84ab){return _0x35ac45(_0x5b84ab);})[_0x23a2('0xbe')](function(_0x3f0882){return _0x3f8de5(msgResponse(_0x23a2('0x1b3'),'Failure',JSON[_0x23a2('0x7f')](_0x3f0882)));});}}else{return _0x3f8de5(msgResponse(_0x23a2('0x1ae'),_0x23a2('0x128'),_0x23a2('0x1b0')));}});};};Dialer[_0x23a2('0x1c')][_0x23a2('0x1a8')]=function(_0xdcc92d){var _0x242e2d=this;return function(){var _0x5ee670=0x0;var _0x3c3538=Math[_0x23a2('0x19a')](_0xdcc92d[_0x23a2('0x79')]*0x3e8);if(_0x3c3538>0x0){_0x3c3538=_0x3c3538<0x64?0x64:_0x3c3538;loggerPredictive[_0x23a2('0x85')](_0xdcc92d[_0x23a2('0x42')],'one\x20call\x20every:',_0x3c3538,_0x23a2('0x4d'));_0xdcc92d[_0x23a2('0x9a')]=setInterval(function(){_0x242e2d[_0x23a2('0x9a')](_0xdcc92d);loggerPredictiveCalls[_0x23a2('0x85')](_0x23a2('0x1b4'),_0x5ee670+=0x1);},_0x3c3538);}else{loggerPredictive['info'](_0xdcc92d[_0x23a2('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x23a2('0x1b5')]=function(_0x5e3cf6,_0x239bf4){var _0x405346=this;return function(_0x186b3a){if(_[_0x23a2('0x4a')](_0x186b3a)){if(_[_0x23a2('0xb4')](_0x239bf4['UserId'])||!_0x239bf4['recallme']){if(_0x5e3cf6['dialMethod']==='booked'){_0x5e3cf6['queueStatusComplete']=_[_0x23a2('0x3f')](_0x5e3cf6[_0x23a2('0x112')])?!![]:_0x5e3cf6['queueStatusComplete'];var _0x1fc6ca=uuid['v4']();_0x405346['actions'][_0x1fc6ca]=new Action(_0x5e3cf6,_0x239bf4,_0x1fc6ca);loggerBooked[_0x23a2('0x85')]('[booked][checkContactBlack]',_0x1fc6ca,_0x23a2('0x1b6'),JSON[_0x23a2('0x7f')](_0x5e3cf6[_0x23a2('0x112')]),_0x23a2('0x1b7'),_0x5e3cf6[_0x23a2('0x42')]);if(_0x5e3cf6['queueStatusComplete']){_0x5e3cf6['queueStatusComplete']=![];_0x405346[_0x23a2('0x2d')][_0x405346[_0x23a2('0x27')][_0x1fc6ca]['queue']]=[];ami[_0x23a2('0xb5')]({'actionid':_0x1fc6ca,'action':'queuestatus','queue':_0x5e3cf6[_0x23a2('0x42')]})['catch'](function(_0x41a2a2){_0x405346[_0x23a2('0xb9')](_0x5e3cf6);_0x405346[_0x23a2('0xc7')]({'active':![],'ContactId':_0x405346['actions'][_0x1fc6ca][_0x23a2('0xd5')],'ListId':_0x405346[_0x23a2('0x27')][_0x1fc6ca][_0x23a2('0xd6')],'VoiceQueueId':_0x405346['actions'][_0x1fc6ca]['VoiceQueueId']||undefined,'CampaignId':_0x405346['actions'][_0x1fc6ca]['CampaignId']||undefined})[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x1b8')));delete _0x405346['actions'][_0x1fc6ca];});}else{loggerBooked[_0x23a2('0x85')](_0x23a2('0x1b9'),JSON[_0x23a2('0x7f')](_0x5e3cf6['queueStatusComplete']),_0x23a2('0x1b7'),_0x5e3cf6[_0x23a2('0x42')]);_0x405346[_0x23a2('0xb9')](_0x5e3cf6);_0x405346[_0x23a2('0xc7')]({'active':![],'ContactId':_0x405346['actions'][_0x1fc6ca][_0x23a2('0xd5')],'ListId':_0x405346[_0x23a2('0x27')][_0x1fc6ca][_0x23a2('0xd6')],'VoiceQueueId':_0x405346[_0x23a2('0x27')][_0x1fc6ca][_0x23a2('0xd8')]||undefined,'CampaignId':_0x405346['actions'][_0x1fc6ca][_0x23a2('0xd9')]||undefined})[_0x23a2('0xbe')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x405346['actions'][_0x1fc6ca];}}else{return _0x405346['actionOriginate'](_0x5e3cf6,_0x239bf4);}}else{if(getDiff(_0x239bf4[_0x23a2('0x1ba')])<_0x5e3cf6['dialRecallMeTimeout']*0x3c){_0x405346['preview']['run'](_0x239bf4['id'])[_0x23a2('0x1f')](function(){_0x405346[_0x23a2('0xb9')](_0x5e3cf6);});}else{_0x5e3cf6[_0x23a2('0x6b')]+=0x1;_0x405346['updateOriginated'](_0x5e3cf6);if(_0x5e3cf6['dialRecallInQueue']){_0x405346['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x239bf4[_0x23a2('0xd5')],'ListId':_0x239bf4[_0x23a2('0xd6')],'VoiceQueueId':_0x239bf4[_0x23a2('0xd8')]||undefined,'CampaignId':_0x239bf4[_0x23a2('0xd9')]||undefined})[_0x23a2('0xbe')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x405346['createHistory'](createObjHistory(_0x5e3cf6,_0x239bf4,_0x23a2('0x1bb'),0x17,_0x23a2('0x1bc')))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x1bd')));}else{_0x405346['saveInDb'](createObjHistory(_0x5e3cf6,_0x239bf4,_0x23a2('0x1be'),0x16,_0x23a2('0x1bf')),_0x23a2('0x1c0'),_0x23a2('0x1c1'));}}}}else{_0x5e3cf6[_0x23a2('0x1c2')]+=0x1;_0x405346[_0x23a2('0xe1')](createObjHistory(_0x5e3cf6,_0x239bf4,_0x23a2('0x1c3'),0xd,_0x23a2('0x1c4')),_0x23a2('0x1c5'),_0x23a2('0x1c6'));throw _0x23a2('0x1c7');}};};Dialer[_0x23a2('0x1c')][_0x23a2('0x1c8')]=function(_0x52cf0e){var _0x330a55=this;var _0x548494=[];var _0x51b662=_0x52cf0e[_0x23a2('0x1c9')]-_0x52cf0e['originated']-_0x52cf0e[_0x23a2('0x1ca')];emitCampaignSummary(_0x52cf0e);if(_0x51b662>0x0){if(_0x51b662>this[_0x23a2('0x25')]){_0x51b662=this[_0x23a2('0x25')];}_0x52cf0e[_0x23a2('0x1ca')]+=_0x51b662;this[_0x23a2('0xca')](_0x52cf0e['id'],_0x51b662,_0x52cf0e[_0x23a2('0x1cb')])[_0x23a2('0xc1')](function(_0x4a1dbe){_0x52cf0e[_0x23a2('0x1ca')]-=_0x51b662;_0x52cf0e[_0x23a2('0x1ca')]=_0x52cf0e[_0x23a2('0x1ca')]>0x0?_0x52cf0e['temp']:0x0;if(!checkContactEmpty(_0x4a1dbe)){_0x52cf0e[_0x23a2('0x40')]=_0x23a2('0xa7');logger[_0x23a2('0x85')](_0x23a2('0x1cc')+_0x52cf0e['name']);}else{_0x52cf0e[_0x23a2('0x77')]+=_0x4a1dbe[_0x23a2('0xa0')];_0x52cf0e[_0x23a2('0x40')]=_0x23a2('0x1cd');for(var _0x5abf5c=0x0;_0x5abf5c<_0x4a1dbe[_0x23a2('0xa0')];_0x5abf5c+=0x1){_0x52cf0e[_0x23a2('0x1ce')]+=0x1;if(_['isNil'](_0x4a1dbe[_0x5abf5c])||_[_0x23a2('0xb4')](_0x4a1dbe[_0x5abf5c][_0x23a2('0x14b')])||_[_0x23a2('0xb4')](_0x4a1dbe[_0x5abf5c][_0x23a2('0x14b')][_0x23a2('0x14c')])){_0x330a55[_0x23a2('0xd3')]('[actionOriginate]\x20',_0x52cf0e,_0x4a1dbe[_0x5abf5c]);}else{_0x330a55[_0x23a2('0xc3')](_[_0x23a2('0xd4')](_0x4a1dbe[_0x5abf5c],[_0x23a2('0xd9'),'Contact.phone']))[_0x23a2('0xc1')](_0x330a55[_0x23a2('0x1b5')](_0x52cf0e,_0x4a1dbe[_0x5abf5c]))[_0x23a2('0xbe')](_0x330a55['loggerHandler'](_0x23a2('0x1cf'),_0x52cf0e));}}}})['catch'](loggerGetContactDialer(_0x23a2('0x1d0'),_0x52cf0e,_0x51b662));}};Dialer[_0x23a2('0x1c')]['handlePower']=function(_0x4f3e78,_0xfe9fbf){var _0x3837b7=this;var _0x80ff39=[];var _0x86acf0=_0xfe9fbf>=0x1?_0xfe9fbf:0x1;var _0x7c4754=[];if(_0x4f3e78[_0x23a2('0x5e')]===_0x23a2('0x1d1')){_0x86acf0=0x1;}var _0x188fc0=Math[_0x23a2('0x19a')](_0x4f3e78['available']*_0x86acf0)-_0x4f3e78[_0x23a2('0x77')]-_0x4f3e78[_0x23a2('0x1ca')];emitVoiceQueueSummary(_0x4f3e78);if(_0x4f3e78['dialLimitQueue']>0x0){var _0x3679c5=_0x4f3e78[_0x23a2('0x1d2')]-_0x4f3e78['originated']-_0x4f3e78[_0x23a2('0x59')]-_0x4f3e78[_0x23a2('0x1ca')]-_0x4f3e78[_0x23a2('0x57')];if(_0x188fc0>_0x3679c5){_0x188fc0=_0x3679c5;}}if(_0x188fc0>0x0){if(_0x4f3e78[_0x23a2('0x5e')]===_0x23a2('0x1d1')){_0x188fc0=0x1;}if(_0x188fc0>this[_0x23a2('0x25')]){_0x188fc0=this[_0x23a2('0x25')];}_0x4f3e78[_0x23a2('0x1ca')]+=_0x188fc0;for(var _0x46b81c in this['agents']){if(this[_0x23a2('0x23')][_0x23a2('0xa1')](_0x46b81c)){if(this[_0x23a2('0x23')][_0x46b81c]['state']===_0x23a2('0x1d3')&&this[_0x23a2('0x23')][_0x46b81c][_0x23a2('0xb6')]===_0x23a2('0xdf')){_0x80ff39[_0x23a2('0x111')](this[_0x23a2('0x23')][_0x46b81c]['id']);}}}this['getContactDialer'](_0x4f3e78['id'],_0x80ff39,_0x188fc0,_0x4f3e78[_0x23a2('0x1cb')])['then'](function(_0x1d0d2e){_0x4f3e78['temp']-=_0x188fc0;_0x4f3e78[_0x23a2('0x1ca')]=_0x4f3e78[_0x23a2('0x1ca')]>0x0?_0x4f3e78[_0x23a2('0x1ca')]:0x0;if(!checkContactEmpty(_0x1d0d2e)){_0x3837b7['countReScheduled'](_0x4f3e78)['then'](sendMessageReschedule(_0x4f3e78))['catch'](loggerCatch(_0x23a2('0x1d4')));}else{_0x4f3e78[_0x23a2('0x77')]+=_0x1d0d2e[_0x23a2('0xa0')];_0x4f3e78[_0x23a2('0x40')]=_0x4f3e78['dialMethod']==='booked'?_0x23a2('0x151'):_0x23a2('0x1cd');for(var _0x976cab=0x0;_0x976cab<_0x1d0d2e[_0x23a2('0xa0')];_0x976cab+=0x1){if(_['isNil'](_0x1d0d2e[_0x976cab])||_['isNil'](_0x1d0d2e[_0x976cab][_0x23a2('0x14b')])||_[_0x23a2('0xb4')](_0x1d0d2e[_0x976cab][_0x23a2('0x14b')][_0x23a2('0x14c')])){_0x3837b7[_0x23a2('0xd3')](_0x23a2('0x1d5'),_0x4f3e78,_0x1d0d2e[_0x976cab]);}else{_0x3837b7[_0x23a2('0xbf')](_[_0x23a2('0xd4')](_0x1d0d2e[_0x976cab],[_0x23a2('0xd8'),_0x23a2('0x1d6')]))[_0x23a2('0xc1')](_0x3837b7['checkContactBlack'](_0x4f3e78,_0x1d0d2e[_0x976cab]))['catch'](_0x3837b7['loggerHandler'](_0x23a2('0x1d5'),_0x4f3e78));}}}})[_0x23a2('0xbe')](loggerGetContactDialer(_0x23a2('0x1d7'),_0x4f3e78,_0x188fc0));}};Dialer[_0x23a2('0x1c')][_0x23a2('0x9a')]=function(_0x4484b2){var _0x2a79e3=this;if(_0x4484b2['dialLimitQueue']>0x0){var _0x3222f3=_0x4484b2['dialLimitQueue']-_0x4484b2['originated']-_0x4484b2[_0x23a2('0x59')];if(_0x3222f3>0x0){this[_0x23a2('0x1d8')](_0x4484b2);}else{loggerPredictiveCalls['info'](_0x23a2('0x1d9'));}}else{this['tryOriginatePredictive'](_0x4484b2);}};Dialer[_0x23a2('0x1c')][_0x23a2('0x1d8')]=function(_0x3824fb){var _0x4842ff=this;var _0x58ac7=[];_0x3824fb[_0x23a2('0x77')]+=0x1;for(var _0x3e9086 in this[_0x23a2('0x23')]){if(this[_0x23a2('0x23')]['hasOwnProperty'](_0x3e9086)){if(this[_0x23a2('0x23')][_0x3e9086]['state']===_0x23a2('0x1d3')&&this[_0x23a2('0x23')][_0x3e9086]['status']===_0x23a2('0xdf')){_0x58ac7[_0x23a2('0x111')](this[_0x23a2('0x23')][_0x3e9086]['id']);}}}this[_0x23a2('0xc8')](_0x3824fb['id'],_0x58ac7,0x1,_0x3824fb['dialOrderByScheduledAt'])[_0x23a2('0xc1')](function(_0x2683a5){if(!checkContactEmpty(_0x2683a5)){checkContactLowerLimitOriginate(_0x3824fb,0x1,0x0);_0x4842ff[_0x23a2('0xbd')](_0x3824fb)[_0x23a2('0xc1')](sendMessageReschedule(_0x3824fb))[_0x23a2('0xbe')](loggerCatch(_0x23a2('0x1d4')));}else{_0x3824fb[_0x23a2('0x40')]=_0x23a2('0x1cd');if(_[_0x23a2('0xb4')](_0x2683a5[0x0])||_[_0x23a2('0xb4')](_0x2683a5[0x0][_0x23a2('0x14b')])||_[_0x23a2('0xb4')](_0x2683a5[0x0][_0x23a2('0x14b')][_0x23a2('0x14c')])){_0x4842ff['emptyContact'](_0x23a2('0x1d5'),_0x3824fb,_0x2683a5[0x0]);}else{_0x4842ff[_0x23a2('0xbf')](_[_0x23a2('0xd4')](_0x2683a5[0x0],[_0x23a2('0xd8'),_0x23a2('0x1d6')]))[_0x23a2('0xc1')](_0x4842ff[_0x23a2('0x1b5')](_0x3824fb,_0x2683a5[0x0]))[_0x23a2('0xbe')](_0x4842ff[_0x23a2('0xd2')](_0x23a2('0x1da'),_0x3824fb));}}})[_0x23a2('0xbe')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3824fb,0x1));emitVoiceQueueSummary(_0x3824fb);};Dialer[_0x23a2('0x1c')][_0x23a2('0x1db')]=function(_0x1c58f6,_0x2418e0,_0x42da80,_0x39206b,_0x48fd25,_0x521fa1){loggerPredictive['info'](_0x23a2('0x1dc'));loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1dd'),_0x1c58f6);loggerPredictive[_0x23a2('0x85')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2418e0);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1de'),_0x42da80);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1df'),_0x39206b);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1e0'),_0x48fd25);loggerPredictive[_0x23a2('0x85')]('---------------------------');return new BPromise(function(_0x194e5a,_0xeb182d){if(_0x1c58f6<=0x0||isNaN(_0x1c58f6)){return _0xeb182d(msgResponse(_0x23a2('0x1e1'),_0x23a2('0x4c'),_0x23a2('0x1e2')+_0x1c58f6));}if(_0x42da80<=0x0||isNaN(_0x42da80)){return _0xeb182d(msgResponse('[abandonmentRate]','Error',_0x23a2('0x1e3')+_0x42da80));}if(_0x39206b<=0x0||isNaN(_0x39206b)){return _0xeb182d(msgResponse(_0x23a2('0x1e1'),'Error',_0x23a2('0x1e4')+_0x39206b));}if(_0x2418e0<=0x0||isNaN(_0x2418e0)){return _0xeb182d(msgResponse(_0x23a2('0x1e1'),_0x23a2('0x4c'),_0x23a2('0x1e5')+_0x2418e0));}if(_0x48fd25<=0x0||isNaN(_0x48fd25)){return _0xeb182d(msgResponse(_0x23a2('0x1e1'),_0x23a2('0x4c'),'Amax\x20=\x20'+_0x48fd25));}_0x521fa1=_0x521fa1||0x0;var _0x516913=0x1/_0x42da80;var _0x2ce014=0x0;var _0x2c83f9=0x0;var _0x22b501=0x0;var _0x523920=0x0;for(var _0x177c32=0x0;_0x22b501<_0x48fd25;_0x177c32+=0x1){_0x2c83f9=_0x177c32/_0x2418e0;_0x2ce014=(_0x39206b*_0x2c83f9+_0x521fa1)/_0x516913;_0x22b501=erlangb(_0x2ce014,_0x1c58f6);_0x523920=_0x2ce014/_0x1c58f6*(0x1-erlangb(_0x2ce014,_0x1c58f6));}return _0x194e5a({'erlangCalls':_0x177c32,'erlangCallToSecond':_0x2418e0/_0x177c32,'erlangAbandonmentRate':_0x22b501,'erlangBusyFactor':_0x523920});});};Dialer[_0x23a2('0x1c')][_0x23a2('0x1ad')]=function(_0x156516,_0xa6a6b2,_0x32ee38,_0x221fca,_0x13057f,_0x23b5f9){loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1e6'));loggerPredictive[_0x23a2('0x85')]('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',_0x156516);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1e7'),_0xa6a6b2);loggerPredictive[_0x23a2('0x85')](_0x23a2('0x1de'),_0x32ee38);loggerPredictive[_0x23a2('0x85')]('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',_0x221fca);loggerPredictive[_0x23a2('0x85')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x13057f);loggerPredictive[_0x23a2('0x85')]('---------------------------');return new BPromise(function(_0x552502,_0x568407){if(_0x156516<=0x0||isNaN(_0x156516)){return _0x568407(msgResponse(_0x23a2('0x1e8'),_0x23a2('0x4c'),_0x23a2('0x1e2')+_0x156516));}if(_0x32ee38<=0x0||isNaN(_0x32ee38)){return _0x568407(msgResponse('[busyFactor]',_0x23a2('0x4c'),_0x23a2('0x1e3')+_0x32ee38));}if(_0x221fca<=0x0||isNaN(_0x221fca)){return _0x568407(msgResponse(_0x23a2('0x1e8'),_0x23a2('0x4c'),_0x23a2('0x1e4')+_0x221fca));}if(_0xa6a6b2<=0x0||isNaN(_0xa6a6b2)){return _0x568407(msgResponse('[busyFactor]',_0x23a2('0x4c'),_0x23a2('0x1e5')+_0xa6a6b2));}if(_0x13057f<=0x0||isNaN(_0x13057f)){return _0x568407(msgResponse(_0x23a2('0x1e8'),_0x23a2('0x4c'),_0x23a2('0x1e9')+_0x13057f));}_0x23b5f9=_0x23b5f9||0x0;var _0x4be297=0x1/_0x32ee38;var _0x2ed2bf=0x0;var _0x2ad00c=0x0;var _0x40e08d=0x0;var _0x1545da=0x0;for(var _0x3f209f=0x0;_0x1545da<_0x13057f;_0x3f209f+=0x1){_0x2ad00c=_0x3f209f/_0xa6a6b2;_0x2ed2bf=(_0x221fca*_0x2ad00c+_0x23b5f9)/_0x4be297;_0x40e08d=erlangb(_0x2ed2bf,_0x156516);_0x1545da=_0x2ed2bf/_0x156516*(0x1-erlangb(_0x2ed2bf,_0x156516));}return _0x552502({'erlangCalls':_0x3f209f,'erlangCallToSecond':_0xa6a6b2/_0x3f209f,'erlangAbandonmentRate':_0x40e08d,'erlangBusyFactor':_0x1545da});});};module[_0x23a2('0x1ea')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 6a44f5e..eac890c 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 _0x3ae4=['recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackat'];(function(_0x451727,_0x2a4bf8){var _0x14da79=function(_0x17008e){while(--_0x17008e){_0x451727['push'](_0x451727['shift']());}};_0x14da79(++_0x2a4bf8);}(_0x3ae4,0x7d));var _0x43ae=function(_0x1ff8a7,_0x50ca3c){_0x1ff8a7=_0x1ff8a7-0x0;var _0x4fc5cd=_0x3ae4[_0x1ff8a7];return _0x4fc5cd;};'use strict';var util=require(_0x43ae('0x0'));var _=require(_0x43ae('0x1'));var moment=require(_0x43ae('0x2'));function getSeconds(_0x1052bb,_0x30fa71){var _0x140a9d=moment(_0x1052bb)[_0x43ae('0x3')](0x0);var _0x52be06=moment(_0x30fa71)[_0x43ae('0x3')](0x0);return _0x140a9d[_0x43ae('0x4')](_0x52be06,_0x43ae('0x5'));}function QueueCallerAbandon(_0x580bd1,_0x35a087){this[_0x43ae('0x6')]=_0x580bd1[_0x43ae('0x6')];this['type']=_0x580bd1[_0x43ae('0x7')];this[_0x43ae('0x8')]=_0x580bd1[_0x43ae('0x7')]===_0x43ae('0x9')?_0x43ae('0xa'):_0x580bd1[_0x43ae('0x7')];this[_0x43ae('0xb')]=_0x580bd1[_0x43ae('0xb')];this[_0x43ae('0xc')]=_0x580bd1[_0x43ae('0xc')];this[_0x43ae('0xd')]=_0x580bd1['countnoanswerretry'];this[_0x43ae('0xe')]=_0x580bd1[_0x43ae('0xb')]+_0x580bd1['countcongestionretry']+_0x580bd1[_0x43ae('0xd')];this[_0x43ae('0xf')]=_0x35a087['uniqueid'];this['calleridname']=_0x580bd1[_0x43ae('0x10')];this[_0x43ae('0x11')]=_0x580bd1[_0x43ae('0x12')];this[_0x43ae('0x13')]=_0x580bd1['starttime'];this[_0x43ae('0x14')]=_0x580bd1[_0x43ae('0x14')];this[_0x43ae('0x15')]=_0x580bd1['droptime'];this[_0x43ae('0x16')]=this[_0x43ae('0x15')];this[_0x43ae('0x17')]=getSeconds(_0x580bd1[_0x43ae('0x14')],_0x580bd1['starttime']);this[_0x43ae('0x18')]=getSeconds(this[_0x43ae('0x15')],_0x580bd1[_0x43ae('0x14')]);this[_0x43ae('0x19')]=0x0;this['queue']=_0x35a087[_0x43ae('0xa')];this[_0x43ae('0x1a')]=_0x35a087[_0x43ae('0x1b')];this[_0x43ae('0x1c')]=_0x35a087[_0x43ae('0x1c')];this[_0x43ae('0x1d')]=_0x580bd1[_0x43ae('0x1d')];this['callbackuniqueid']=_0x580bd1['callbackuniqueid'];this[_0x43ae('0x1e')]=_0x580bd1['callbackat'];this[_0x43ae('0x1f')]=_0x580bd1[_0x43ae('0x1f')];this[_0x43ae('0x20')]=_0x580bd1[_0x43ae('0x20')];this[_0x43ae('0x21')]=_0x580bd1[_0x43ae('0x21')];this['UserId']=_0x580bd1['UserId'];this[_0x43ae('0x22')]=_0x580bd1['VoiceQueueId'];this[_0x43ae('0x23')]=_0x580bd1[_0x43ae('0x23')];this[_0x43ae('0x24')]=_0x580bd1['originatecalleridnum']||'';this[_0x43ae('0x25')]=_0x580bd1['originatecalleridname']||'';}module[_0x43ae('0x26')]=QueueCallerAbandon; \ No newline at end of file +var _0x16a1=['CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countnoanswerretry','countglobal','countbusyretry','countcongestionretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0x16a1,0x1b4));var _0x116a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x16a1[_0x6131cd];return _0x47e916;};'use strict';var util=require('util');var _=require(_0x116a('0x0'));var moment=require(_0x116a('0x1'));function getSeconds(_0x309449,_0xb6d515){var _0x44462d=moment(_0x309449)[_0x116a('0x2')](0x0);var _0x58fc8b=moment(_0xb6d515)[_0x116a('0x2')](0x0);return _0x44462d[_0x116a('0x3')](_0x58fc8b,_0x116a('0x4'));}function QueueCallerAbandon(_0x27a73c,_0x43b977){this[_0x116a('0x5')]=_0x27a73c[_0x116a('0x5')];this[_0x116a('0x6')]=_0x27a73c['type'];this[_0x116a('0x7')]=_0x27a73c[_0x116a('0x6')]===_0x116a('0x8')?_0x116a('0x9'):_0x27a73c['type'];this['countbusyretry']=_0x27a73c['countbusyretry'];this['countcongestionretry']=_0x27a73c['countcongestionretry'];this['countnoanswerretry']=_0x27a73c[_0x116a('0xa')];this[_0x116a('0xb')]=_0x27a73c[_0x116a('0xc')]+_0x27a73c[_0x116a('0xd')]+_0x27a73c['countnoanswerretry'];this[_0x116a('0xe')]=_0x43b977[_0x116a('0xe')];this['calleridname']=_0x27a73c[_0x116a('0xf')];this[_0x116a('0x10')]=_0x27a73c[_0x116a('0x11')];this[_0x116a('0x12')]=_0x27a73c[_0x116a('0x12')];this[_0x116a('0x13')]=_0x27a73c[_0x116a('0x13')];this['droptime']=_0x27a73c[_0x116a('0x14')];this[_0x116a('0x15')]=this[_0x116a('0x14')];this[_0x116a('0x16')]=getSeconds(_0x27a73c[_0x116a('0x13')],_0x27a73c[_0x116a('0x12')]);this['holdtime']=getSeconds(this[_0x116a('0x14')],_0x27a73c[_0x116a('0x13')]);this[_0x116a('0x17')]=0x0;this[_0x116a('0x9')]=_0x43b977[_0x116a('0x9')];this['membername']=_0x43b977[_0x116a('0x18')];this[_0x116a('0x19')]=_0x43b977[_0x116a('0x19')];this['callback']=_0x27a73c[_0x116a('0x1a')];this[_0x116a('0x1b')]=_0x27a73c['callbackuniqueid'];this['callbackat']=_0x27a73c['callbackat'];this[_0x116a('0x1c')]=_0x27a73c['recallme'];this[_0x116a('0x1d')]=_0x27a73c[_0x116a('0x1d')];this[_0x116a('0x1e')]=_0x27a73c[_0x116a('0x1e')];this[_0x116a('0x1f')]=_0x27a73c[_0x116a('0x1f')];this['VoiceQueueId']=_0x27a73c['VoiceQueueId'];this[_0x116a('0x20')]=_0x27a73c['CampaignId'];this[_0x116a('0x21')]=_0x27a73c[_0x116a('0x21')]||'';this[_0x116a('0x22')]=_0x27a73c['originatecalleridname']||'';}module[_0x116a('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 ba3e8fc..1def394 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 _0xb257=['localstationid','headerinfo','AttachmentId','lodash','moment','channel','format','%s/%s/%s','tech'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb257,0x12c));var _0x7b25=function(_0x590096,_0x5cc6b8){_0x590096=_0x590096-0x0;var _0x41fadf=_0xb257[_0x590096];return _0x41fadf;};'use strict';var util=require('util');var _=require(_0x7b25('0x0'));var moment=require(_0x7b25('0x1'));function Action(_0x2b4d4e,_0x541df0,_0xb0ba71){this['uniqueid']=_0x2b4d4e||undefined;this[_0x7b25('0x2')]=util[_0x7b25('0x3')](_0x7b25('0x4'),_0x541df0[_0x7b25('0x5')],_0x541df0['Trunk']['name'],_0xb0ba71['fax']);this['localstationid']=_0x541df0[_0x7b25('0x6')];this['headerinfo']=_0x541df0[_0x7b25('0x7')];this['path']=_0xb0ba71['path'];this['AttachmentId']=_0xb0ba71[_0x7b25('0x8')];}module['exports']=Action; \ No newline at end of file +var _0xc813=['lodash','uniqueid','channel','format','%s/%s/%s','tech','name','fax','localstationid','headerinfo','path','AttachmentId','util'];(function(_0x23747f,_0x1b26cf){var _0x628d05=function(_0x311c8f){while(--_0x311c8f){_0x23747f['push'](_0x23747f['shift']());}};_0x628d05(++_0x1b26cf);}(_0xc813,0xdc));var _0x3c81=function(_0x5e5218,_0x4226ef){_0x5e5218=_0x5e5218-0x0;var _0x2dcd35=_0xc813[_0x5e5218];return _0x2dcd35;};'use strict';var util=require(_0x3c81('0x0'));var _=require(_0x3c81('0x1'));var moment=require('moment');function Action(_0x15843c,_0x4f0a21,_0x3830b2){this[_0x3c81('0x2')]=_0x15843c||undefined;this[_0x3c81('0x3')]=util[_0x3c81('0x4')](_0x3c81('0x5'),_0x4f0a21[_0x3c81('0x6')],_0x4f0a21['Trunk'][_0x3c81('0x7')],_0x3830b2[_0x3c81('0x8')]);this[_0x3c81('0x9')]=_0x4f0a21[_0x3c81('0x9')];this[_0x3c81('0xa')]=_0x4f0a21[_0x3c81('0xa')];this[_0x3c81('0xb')]=_0x3830b2[_0x3c81('0xb')];this[_0x3c81('0xc')]=_0x3830b2[_0x3c81('0xc')];}module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 2962eb9..1c1ac59 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 _0x1153=['uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','syncVarSet','variable','value','channelstate','channelstatedesc','syncNewExten','operation','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','fax','.pdf','error','stringify','catch','\x20receiveFax\x20','merge','response','reason','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','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','format','%s/%s.tif','dir','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','status','reachable','[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','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid'];(function(_0x152116,_0x497b64){var _0x57c6c4=function(_0xdc54b5){while(--_0xdc54b5){_0x152116['push'](_0x152116['shift']());}};_0x57c6c4(++_0x497b64);}(_0x1153,0xd0));var _0x3115=function(_0x117d5f,_0x74db5a){_0x117d5f=_0x117d5f-0x0;var _0x58202e=_0x1153[_0x117d5f];return _0x58202e;};'use strict';var util=require(_0x3115('0x0'));var _=require(_0x3115('0x1'));var BPromise=require(_0x3115('0x2'));var uuid=require(_0x3115('0x3'));var moment=require(_0x3115('0x4'));var path=require(_0x3115('0x5'));var tiff2pdf=require(_0x3115('0x6'));var gs=require(_0x3115('0x7'));var logger=require(_0x3115('0x8'))('fax');var ami=require('../ami');var rpcDb=require(_0x3115('0x9'));var Channel=require(_0x3115('0xa'));var ut=require('./util/util');var Action=require(_0x3115('0xb'));var faxAccount=require(_0x3115('0xc'));var attachment=require(_0x3115('0xd'));var faxMessage=require(_0x3115('0xe'));function Fax(_0x55ac9a){this[_0x3115('0xf')]={};this[_0x3115('0x10')]=_0x55ac9a[_0x3115('0x10')];this[_0x3115('0x11')]=_0x55ac9a[_0x3115('0x11')];this[_0x3115('0x12')]={};ami['on'](_0x3115('0x13'),this[_0x3115('0x14')][_0x3115('0x15')](this));ami['on'](_0x3115('0x16'),this['syncVarSet'][_0x3115('0x15')](this));ami['on'](_0x3115('0x17'),this[_0x3115('0x18')]['bind'](this));ami['on'](_0x3115('0x19'),this['syncNewExten'][_0x3115('0x15')](this));ami['on'](_0x3115('0x1a'),this[_0x3115('0x1b')][_0x3115('0x15')](this));ami['on'](_0x3115('0x1c'),this['syncReceiveFax'][_0x3115('0x15')](this));ami['on'](_0x3115('0x1d'),this[_0x3115('0x1e')]['bind'](this));ami['on'](_0x3115('0x1f'),this[_0x3115('0x20')][_0x3115('0x15')](this));}Fax['prototype']['syncNewchannel']=function(_0x1975fb){if(_0x1975fb[_0x3115('0x21')]===_0x3115('0x22')){for(var _0x4373d2 in this['faxAccounts']){if(this[_0x3115('0x10')][_0x3115('0x23')](_0x4373d2)){if(_0x1975fb[_0x3115('0x24')]===this[_0x3115('0x10')][_0x4373d2][_0x3115('0x25')]){this[_0x3115('0xf')][_0x1975fb[_0x3115('0x26')]]={};this[_0x3115('0xf')][_0x1975fb[_0x3115('0x26')]]['channel']=_0x1975fb[_0x3115('0x27')];this[_0x3115('0xf')][_0x1975fb[_0x3115('0x26')]]['id']=this[_0x3115('0x10')][_0x4373d2]['id'];this[_0x3115('0xf')][_0x1975fb[_0x3115('0x26')]][_0x3115('0x28')]=this['faxAccounts'][_0x4373d2]['name'];logger[_0x3115('0x29')](_0x1975fb[_0x3115('0x26')],_0x3115('0x2a'));}}}}if(this['actions'][_0x1975fb[_0x3115('0x26')]]){this['channels'][_0x1975fb['uniqueid']]={};this[_0x3115('0xf')][_0x1975fb['uniqueid']][_0x3115('0x27')]=_0x1975fb[_0x3115('0x27')];logger[_0x3115('0x29')](_0x1975fb[_0x3115('0x26')],_0x3115('0x2a'));}};Fax[_0x3115('0x2b')][_0x3115('0x2c')]=function(_0x5bc29f){if(this['channels'][_0x5bc29f['uniqueid']]){for(var _0x3d15cf in _0x5bc29f[_0x3115('0x2d')]){if(_0x5bc29f[_0x3115('0x2d')][_0x3115('0x23')](_0x3d15cf)){this['channels'][_0x5bc29f[_0x3115('0x26')]][_0x3d15cf]=_0x5bc29f[_0x3115('0x2e')];}}}};Fax[_0x3115('0x2b')][_0x3115('0x18')]=function(_0x1e6518){if(this[_0x3115('0xf')][_0x1e6518[_0x3115('0x26')]]){this['channels'][_0x1e6518[_0x3115('0x26')]][_0x3115('0x2f')]=_0x1e6518[_0x3115('0x2f')];this[_0x3115('0xf')][_0x1e6518['uniqueid']][_0x3115('0x30')]=_0x1e6518[_0x3115('0x30')];}};Fax['prototype'][_0x3115('0x31')]=function(_0x68ba5f){if(this[_0x3115('0xf')][_0x68ba5f['uniqueid']]){for(var _0x219868 in _0x68ba5f[_0x3115('0x2d')]){if(_0x68ba5f[_0x3115('0x2d')][_0x3115('0x23')](_0x219868)){this[_0x3115('0xf')][_0x68ba5f[_0x3115('0x26')]][_0x219868]=_0x68ba5f['value'];}}}};Fax[_0x3115('0x2b')][_0x3115('0x1b')]=function(_0x51f835){if(this[_0x3115('0xf')][_0x51f835[_0x3115('0x26')]]){this[_0x3115('0xf')][_0x51f835[_0x3115('0x26')]][_0x3115('0x32')]=_0x51f835[_0x3115('0x32')];this['channels'][_0x51f835['uniqueid']]['status']=_0x51f835['status'];this[_0x3115('0xf')][_0x51f835[_0x3115('0x26')]][_0x3115('0x25')]=_0x51f835[_0x3115('0x25')];this[_0x3115('0xf')][_0x51f835[_0x3115('0x26')]][_0x3115('0x33')]=_0x51f835[_0x3115('0x33')];logger['info'](_0x51f835[_0x3115('0x26')],_0x3115('0x34'));}};Fax['prototype'][_0x3115('0x35')]=function(_0x28e050){var _0x290f77=this;if(this[_0x3115('0xf')][_0x28e050[_0x3115('0x26')]]){var _0x10b956=this[_0x3115('0xf')][_0x28e050[_0x3115('0x26')]]['id'];this[_0x3115('0xf')][_0x28e050[_0x3115('0x26')]][_0x3115('0x36')]=_0x28e050[_0x3115('0x36')];this[_0x3115('0xf')][_0x28e050[_0x3115('0x26')]][_0x3115('0x37')]=_0x28e050['pagestransferred'];this['channels'][_0x28e050[_0x3115('0x26')]][_0x3115('0x25')]=_0x28e050[_0x3115('0x25')];this[_0x3115('0xf')][_0x28e050['uniqueid']][_0x3115('0x38')]=_0x28e050['resolution'];this[_0x3115('0xf')][_0x28e050['uniqueid']][_0x3115('0x39')]=_0x28e050['transferrate'];this[_0x3115('0xf')][_0x28e050[_0x3115('0x26')]][_0x3115('0x33')]=_0x28e050['filename'];this[_0x3115('0xf')][_0x28e050[_0x3115('0x26')]]['calleridnum']=_0x28e050[_0x3115('0x3a')];if(this['channels'][_0x28e050['uniqueid']][_0x3115('0x37')]>0x0){tiff2pdf(_0x28e050[_0x3115('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0x3e8aec){logger[_0x3115('0x29')](_0x28e050[_0x3115('0x26')],_0x3115('0x3b'),_0x3e8aec[_0x3115('0x3c')]);attachment[_0x3115('0x3d')]({'name':path[_0x3115('0x3e')](_0x28e050['filename'])[_0x3115('0x28')],'basename':path[_0x3115('0x3e')](_0x28e050[_0x3115('0x33')])[_0x3115('0x28')]+'.pdf','type':_0x3115('0x3f')})['then'](function(_0x4608f5){faxAccount['notify'](_0x10b956,{'from':_0x28e050[_0x3115('0x3a')],'mapKey':_0x3115('0x40'),'body':path[_0x3115('0x3e')](_0x28e050[_0x3115('0x33')])[_0x3115('0x28')]+_0x3115('0x41'),'AttachmentId':_0x4608f5['id']})['catch'](function(_0x3f536f){logger[_0x3115('0x42')](_0x28e050[_0x3115('0x26')],'\x20notify\x20',JSON[_0x3115('0x43')](_0x3f536f));});})[_0x3115('0x44')](function(_0xe47b8b){logger[_0x3115('0x42')](_0x28e050[_0x3115('0x26')],_0x3115('0x45'),JSON['stringify'](_0xe47b8b));});});}logger[_0x3115('0x29')](_0x28e050[_0x3115('0x26')],_0x3115('0x45'));}};Fax[_0x3115('0x2b')][_0x3115('0x20')]=function(_0x443372){if(this[_0x3115('0x12')][_0x443372[_0x3115('0x26')]]){_[_0x3115('0x46')](this[_0x3115('0xf')][_0x443372[_0x3115('0x26')]],_['pick'](_0x443372,[_0x3115('0x47'),_0x3115('0x48')]));}};function updateStatus(_0x22bae6){if(_0x22bae6[_0x3115('0x49')]){faxMessage['update'](_0x22bae6[_0x3115('0x49')],{'failMessage':_0x3115('0x4a')})['then'](function(_0x417886){ut['logger'](_0x3115('0x4b'),_0x417886);})[_0x3115('0x44')](function(_0x8aeef5){ut['logger'](_0x3115('0x4c'),_0x8aeef5);});}else{ut[_0x3115('0x4d')](_0x3115('0x4e'));}}Fax[_0x3115('0x2b')][_0x3115('0x4f')]=function(_0x2b4e0e,_0xa8b406,_0x3ace97){var _0x33f08e=this;var _0x383eec={};if(_0xa8b406){_0x383eec={'read':_0xa8b406};}else{_0x383eec={'failMessage':_0x3ace97};}if(this['actions'][_0x2b4e0e]['AttachmentId']){faxMessage[_0x3115('0x50')](this['actions'][_0x2b4e0e][_0x3115('0x49')],_0x383eec)[_0x3115('0x51')](function(_0x353c1a){ut[_0x3115('0x4d')](_0x3115('0x52'),_0x353c1a);})[_0x3115('0x44')](function(_0x4b93a6){ut['logger'](_0x3115('0x53'),_0x4b93a6);})[_0x3115('0x54')](function(){delete _0x33f08e[_0x3115('0xf')][_0x2b4e0e];delete _0x33f08e[_0x3115('0x12')][_0x2b4e0e];});}else{ut[_0x3115('0x4d')](_0x3115('0x55'));delete this[_0x3115('0xf')][_0x2b4e0e];delete this['actions'][_0x2b4e0e];}};Fax[_0x3115('0x2b')][_0x3115('0x1e')]=function(_0x517214){var _0x5b700e=this;if(this['channels'][_0x517214[_0x3115('0x26')]]){if(this['actions'][_0x517214[_0x3115('0x26')]]){this[_0x3115('0xf')][_0x517214[_0x3115('0x26')]]['id']=this[_0x3115('0x12')][_0x517214[_0x3115('0x26')]]['id'];this[_0x3115('0xf')][_0x517214[_0x3115('0x26')]]['name']=this[_0x3115('0x12')][_0x517214[_0x3115('0x26')]][_0x3115('0x28')];}logger[_0x3115('0x29')](_0x517214[_0x3115('0x26')],this['actions'][_0x517214[_0x3115('0x26')]]?_0x3115('0x56'):_0x3115('0x57'),JSON[_0x3115('0x43')](this['channels'][_0x517214[_0x3115('0x26')]]));if(this[_0x3115('0x12')][_0x517214[_0x3115('0x26')]]){if(this['channels'][_0x517214['uniqueid']][_0x3115('0x58')]>0x0&&this['channels'][_0x517214[_0x3115('0x26')]][_0x3115('0x1a')]===_0x3115('0x59')){this[_0x3115('0x4f')](_0x517214['uniqueid'],!![]);}else{this['updateStatus'](_0x517214[_0x3115('0x26')],![],this[_0x3115('0xf')][_0x517214[_0x3115('0x26')]][_0x3115('0x5a')]?_0x3115('0x5b')+this[_0x3115('0xf')][_0x517214[_0x3115('0x26')]][_0x3115('0x5a')]:_0x3115('0x5c'));}}}};Fax[_0x3115('0x2b')][_0x3115('0x5d')]=function(_0x443531){var _0x1d555f=this;return new BPromise(function(_0x47b8a2,_0x9c0c0e){_0x1d555f[_0x3115('0x5e')](_0x443531,_0x1d555f[_0x3115('0x10')][_0x443531['FaxAccountId']])['then'](function(_0x419384){ut[_0x3115('0x4d')](_0x3115('0x5f'),_0x419384);_0x47b8a2(ut['message'](_0x3115('0x60')));})['catch'](function(_0x41f2dc){ut[_0x3115('0x4d')](_0x3115('0x61'),_0x41f2dc);updateStatus(_0x443531);_0x9c0c0e(ut[_0x3115('0x3c')]('Fax\x20failed'));});});};Fax[_0x3115('0x2b')][_0x3115('0x62')]=function(_0x4db551){var _0x45b31b=this;return new BPromise(function(_0x5f22fd,_0x5e69c3){var _0x18c6c3=_0x45b31b[_0x3115('0x63')](_0x45b31b[_0x3115('0x10')][_0x4db551['FaxAccountId']][_0x3115('0x64')],_0x4db551);if(_0x18c6c3[_0x3115('0x65')]){_0x5f22fd(ut['message']('Trunk\x20Reachable'));}else{_0x5e69c3(ut[_0x3115('0x3c')](_0x18c6c3['message']));}});};function originate(_0x1730cb,_0x395d5b,_0xa121f){return new BPromise(function(_0x13cbb0,_0x101bbb){if(_0xa121f){var _0x7d7ec0=util['format'](_0x3115('0x66'),path[_0x3115('0x3e')](_0x1730cb[_0x3115('0x5')])['name'],_0x1730cb['path']);gs['execute'](_0x7d7ec0)[_0x3115('0x51')](function(){_0x1730cb[_0x3115('0x5')]=util[_0x3115('0x67')](_0x3115('0x68'),path[_0x3115('0x3e')](_0x1730cb[_0x3115('0x5')])[_0x3115('0x69')],path[_0x3115('0x3e')](_0x1730cb[_0x3115('0x5')])['name']);_0x395d5b['XMF-PATH']=_0x1730cb[_0x3115('0x5')];ut[_0x3115('0x4d')]('Convert\x20pdf\x20to\x20tif','');ami[_0x3115('0x6a')](ut['variablesAction'](_0x1730cb,_0x395d5b))[_0x3115('0x51')](function(_0x422a5c){_0x13cbb0(_0x422a5c);})[_0x3115('0x44')](function(_0x454c41){_0x101bbb(_0x454c41);});})['catch'](function(_0x5474b8){_0x101bbb(_0x5474b8);});}else{ami[_0x3115('0x6a')](ut[_0x3115('0x6b')](_0x1730cb,_0x395d5b))[_0x3115('0x51')](function(_0x53a17a){_0x13cbb0(_0x53a17a);})[_0x3115('0x44')](function(_0x1248ac){_0x101bbb(_0x1248ac);});}});}Fax[_0x3115('0x2b')][_0x3115('0x5e')]=function(_0x515dc3,_0x4baba7){var _0x19655f=this;return new BPromise(function(_0x13f63e,_0x6f096f){var _0x47aacb=uuid['v4']();var _0x333d5c=ut[_0x3115('0x6c')](_0x515dc3,_0x4baba7);_0x19655f['actions'][_0x47aacb]=new Action(_0x47aacb,_0x4baba7,_0x515dc3);var _0x2b004b=_0x19655f['actions'][_0x47aacb];if(path['parse'](_0x515dc3[_0x3115('0x5')])['ext']===_0x3115('0x41')){originate(_0x2b004b,_0x333d5c,!![])[_0x3115('0x51')](function(_0x1dc524){_0x13f63e(_0x1dc524);})[_0x3115('0x44')](function(_0x4ba1e0){_0x6f096f(_0x4ba1e0);});}else{originate(_0x2b004b,_0x333d5c,![])['then'](function(_0x3f278d){_0x13f63e(_0x3f278d);})[_0x3115('0x44')](function(_0x3c8bcf){_0x6f096f(_0x3c8bcf);});}});};Fax[_0x3115('0x2b')][_0x3115('0x6d')]=function(_0x5bd3e2){return!_[_0x3115('0x6e')](_0x5bd3e2)&&!_[_0x3115('0x6e')](_0x5bd3e2[_0x3115('0x28')])&&!_[_0x3115('0x6e')](_0x5bd3e2[_0x3115('0x6f')])&&_0x5bd3e2['active']&&!_[_0x3115('0x6e')](this[_0x3115('0x11')][util[_0x3115('0x67')](_0x3115('0x70'),_0x5bd3e2[_0x3115('0x28')])])&&!_[_0x3115('0x6e')](this[_0x3115('0x11')][util[_0x3115('0x67')](_0x3115('0x70'),_0x5bd3e2[_0x3115('0x28')])][_0x3115('0x71')])&&(this[_0x3115('0x11')][util[_0x3115('0x67')]('SIP/%s',_0x5bd3e2[_0x3115('0x28')])][_0x3115('0x71')]===_0x3115('0x72')||this['trunks'][util[_0x3115('0x67')](_0x3115('0x70'),_0x5bd3e2[_0x3115('0x28')])][_0x3115('0x71')]==='unmonitored');};Fax[_0x3115('0x2b')][_0x3115('0x63')]=function(_0x4193c4,_0x1e2eb8){if(!this[_0x3115('0x6d')](_0x4193c4)){ut[_0x3115('0x4d')](_0x3115('0x73'),_['isNil'](_0x4193c4)?'':_0x4193c4[_0x3115('0x28')]+_0x3115('0x74'));return{'isValid':![],'message':_0x3115('0x75')};}if(_[_0x3115('0x6e')](_0x1e2eb8['fax'])){ut[_0x3115('0x4d')](_0x3115('0x76'),JSON[_0x3115('0x43')](_0x1e2eb8));return{'isValid':![],'message':_0x3115('0x77')};}if(_['isNil'](_0x1e2eb8[_0x3115('0x5')])){ut[_0x3115('0x4d')](_0x3115('0x78'),JSON[_0x3115('0x43')](_0x1e2eb8));return{'isValid':![],'message':_0x3115('0x79')};}return{'isValid':!![],'message':_0x3115('0x7a')};};module['exports']=Fax; \ No newline at end of file +var _0xb7a9=['.pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','pick','response','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','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','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','fax','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','channelstate','operation','status','localstationid','filename','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','then','notify'];(function(_0x53c393,_0x2cd57a){var _0xc1ae94=function(_0x1dabd1){while(--_0x1dabd1){_0x53c393['push'](_0x53c393['shift']());}};_0xc1ae94(++_0x2cd57a);}(_0xb7a9,0xb7));var _0x9b7a=function(_0x50570c,_0x40fb18){_0x50570c=_0x50570c-0x0;var _0x3b24ad=_0xb7a9[_0x50570c];return _0x3b24ad;};'use strict';var util=require(_0x9b7a('0x0'));var _=require(_0x9b7a('0x1'));var BPromise=require(_0x9b7a('0x2'));var uuid=require(_0x9b7a('0x3'));var moment=require('moment');var path=require(_0x9b7a('0x4'));var tiff2pdf=require(_0x9b7a('0x5'));var gs=require(_0x9b7a('0x6'));var logger=require(_0x9b7a('0x7'))('fax');var ami=require(_0x9b7a('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x9b7a('0x9'));var ut=require(_0x9b7a('0xa'));var Action=require(_0x9b7a('0xb'));var faxAccount=require(_0x9b7a('0xc'));var attachment=require(_0x9b7a('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1e4fc9){this[_0x9b7a('0xe')]={};this[_0x9b7a('0xf')]=_0x1e4fc9[_0x9b7a('0xf')];this[_0x9b7a('0x10')]=_0x1e4fc9[_0x9b7a('0x10')];this[_0x9b7a('0x11')]={};ami['on'](_0x9b7a('0x12'),this[_0x9b7a('0x13')]['bind'](this));ami['on'](_0x9b7a('0x14'),this[_0x9b7a('0x15')][_0x9b7a('0x16')](this));ami['on'](_0x9b7a('0x17'),this[_0x9b7a('0x18')][_0x9b7a('0x16')](this));ami['on']('newexten',this[_0x9b7a('0x19')][_0x9b7a('0x16')](this));ami['on'](_0x9b7a('0x1a'),this[_0x9b7a('0x1b')][_0x9b7a('0x16')](this));ami['on'](_0x9b7a('0x1c'),this[_0x9b7a('0x1d')][_0x9b7a('0x16')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x9b7a('0x1e'),this['syncOriginateResponse'][_0x9b7a('0x16')](this));}Fax['prototype']['syncNewchannel']=function(_0x12f98b){if(_0x12f98b[_0x9b7a('0x1f')]===_0x9b7a('0x20')){for(var _0x3f68c2 in this[_0x9b7a('0xf')]){if(this[_0x9b7a('0xf')][_0x9b7a('0x21')](_0x3f68c2)){if(_0x12f98b[_0x9b7a('0x22')]===this[_0x9b7a('0xf')][_0x3f68c2]['localstationid']){this[_0x9b7a('0xe')][_0x12f98b[_0x9b7a('0x23')]]={};this['channels'][_0x12f98b[_0x9b7a('0x23')]][_0x9b7a('0x24')]=_0x12f98b['channel'];this['channels'][_0x12f98b[_0x9b7a('0x23')]]['id']=this[_0x9b7a('0xf')][_0x3f68c2]['id'];this[_0x9b7a('0xe')][_0x12f98b[_0x9b7a('0x23')]]['name']=this[_0x9b7a('0xf')][_0x3f68c2][_0x9b7a('0x25')];logger['info'](_0x12f98b[_0x9b7a('0x23')],_0x9b7a('0x26'));}}}}if(this[_0x9b7a('0x11')][_0x12f98b[_0x9b7a('0x23')]]){this[_0x9b7a('0xe')][_0x12f98b[_0x9b7a('0x23')]]={};this[_0x9b7a('0xe')][_0x12f98b[_0x9b7a('0x23')]][_0x9b7a('0x24')]=_0x12f98b['channel'];logger[_0x9b7a('0x27')](_0x12f98b['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x9b7a('0x28')][_0x9b7a('0x15')]=function(_0xbb699e){if(this[_0x9b7a('0xe')][_0xbb699e[_0x9b7a('0x23')]]){for(var _0x34bf97 in _0xbb699e[_0x9b7a('0x29')]){if(_0xbb699e['variable']['hasOwnProperty'](_0x34bf97)){this['channels'][_0xbb699e['uniqueid']][_0x34bf97]=_0xbb699e[_0x9b7a('0x2a')];}}}};Fax['prototype'][_0x9b7a('0x18')]=function(_0x4cb094){if(this[_0x9b7a('0xe')][_0x4cb094[_0x9b7a('0x23')]]){this['channels'][_0x4cb094[_0x9b7a('0x23')]][_0x9b7a('0x2b')]=_0x4cb094[_0x9b7a('0x2b')];this[_0x9b7a('0xe')][_0x4cb094[_0x9b7a('0x23')]]['channelstatedesc']=_0x4cb094['channelstatedesc'];}};Fax[_0x9b7a('0x28')][_0x9b7a('0x19')]=function(_0x1ee1c7){if(this[_0x9b7a('0xe')][_0x1ee1c7[_0x9b7a('0x23')]]){for(var _0x58d80a in _0x1ee1c7[_0x9b7a('0x29')]){if(_0x1ee1c7[_0x9b7a('0x29')]['hasOwnProperty'](_0x58d80a)){this['channels'][_0x1ee1c7['uniqueid']][_0x58d80a]=_0x1ee1c7['value'];}}}};Fax['prototype'][_0x9b7a('0x1b')]=function(_0x1f7de1){if(this['channels'][_0x1f7de1[_0x9b7a('0x23')]]){this[_0x9b7a('0xe')][_0x1f7de1[_0x9b7a('0x23')]][_0x9b7a('0x2c')]=_0x1f7de1[_0x9b7a('0x2c')];this[_0x9b7a('0xe')][_0x1f7de1[_0x9b7a('0x23')]][_0x9b7a('0x2d')]=_0x1f7de1[_0x9b7a('0x2d')];this[_0x9b7a('0xe')][_0x1f7de1[_0x9b7a('0x23')]][_0x9b7a('0x2e')]=_0x1f7de1['localstationid'];this[_0x9b7a('0xe')][_0x1f7de1[_0x9b7a('0x23')]][_0x9b7a('0x2f')]=_0x1f7de1['filename'];logger[_0x9b7a('0x27')](_0x1f7de1[_0x9b7a('0x23')],'\x20syncFaxStatus\x20');}};Fax[_0x9b7a('0x28')]['syncReceiveFax']=function(_0x2f1f19){var _0x4afd2a=this;if(this[_0x9b7a('0xe')][_0x2f1f19[_0x9b7a('0x23')]]){var _0x3bdd1f=this[_0x9b7a('0xe')][_0x2f1f19['uniqueid']]['id'];this[_0x9b7a('0xe')][_0x2f1f19[_0x9b7a('0x23')]][_0x9b7a('0x30')]=_0x2f1f19[_0x9b7a('0x30')];this[_0x9b7a('0xe')][_0x2f1f19['uniqueid']][_0x9b7a('0x31')]=_0x2f1f19['pagestransferred'];this[_0x9b7a('0xe')][_0x2f1f19[_0x9b7a('0x23')]]['localstationid']=_0x2f1f19[_0x9b7a('0x2e')];this[_0x9b7a('0xe')][_0x2f1f19['uniqueid']]['resolution']=_0x2f1f19['resolution'];this[_0x9b7a('0xe')][_0x2f1f19[_0x9b7a('0x23')]][_0x9b7a('0x32')]=_0x2f1f19['transferrate'];this['channels'][_0x2f1f19['uniqueid']][_0x9b7a('0x2f')]=_0x2f1f19['filename'];this[_0x9b7a('0xe')][_0x2f1f19[_0x9b7a('0x23')]][_0x9b7a('0x33')]=_0x2f1f19[_0x9b7a('0x33')];if(this[_0x9b7a('0xe')][_0x2f1f19[_0x9b7a('0x23')]][_0x9b7a('0x31')]>0x0){tiff2pdf(_0x2f1f19[_0x9b7a('0x2f')],_0x9b7a('0x34'),function(_0x484207){logger['info'](_0x2f1f19[_0x9b7a('0x23')],_0x9b7a('0x35'),_0x484207['message']);attachment['create']({'name':path[_0x9b7a('0x36')](_0x2f1f19[_0x9b7a('0x2f')])[_0x9b7a('0x25')],'basename':path['parse'](_0x2f1f19['filename'])[_0x9b7a('0x25')]+'.pdf','type':'application/pdf'})[_0x9b7a('0x37')](function(_0x35534a){faxAccount[_0x9b7a('0x38')](_0x3bdd1f,{'from':_0x2f1f19['calleridnum'],'mapKey':'fax','body':path[_0x9b7a('0x36')](_0x2f1f19['filename'])['name']+_0x9b7a('0x39'),'AttachmentId':_0x35534a['id']})[_0x9b7a('0x3a')](function(_0x5bb926){logger['error'](_0x2f1f19[_0x9b7a('0x23')],_0x9b7a('0x3b'),JSON[_0x9b7a('0x3c')](_0x5bb926));});})['catch'](function(_0x10bfc8){logger[_0x9b7a('0x3d')](_0x2f1f19[_0x9b7a('0x23')],_0x9b7a('0x3e'),JSON['stringify'](_0x10bfc8));});});}logger[_0x9b7a('0x27')](_0x2f1f19[_0x9b7a('0x23')],_0x9b7a('0x3e'));}};Fax[_0x9b7a('0x28')][_0x9b7a('0x3f')]=function(_0x3728a2){if(this[_0x9b7a('0x11')][_0x3728a2[_0x9b7a('0x23')]]){_['merge'](this['channels'][_0x3728a2[_0x9b7a('0x23')]],_[_0x9b7a('0x40')](_0x3728a2,[_0x9b7a('0x41'),'reason']));}};function updateStatus(_0x1f5f96){if(_0x1f5f96['AttachmentId']){faxMessage[_0x9b7a('0x42')](_0x1f5f96[_0x9b7a('0x43')],{'failMessage':_0x9b7a('0x44')})[_0x9b7a('0x37')](function(_0x18dde4){ut[_0x9b7a('0x45')](_0x9b7a('0x46'),_0x18dde4);})[_0x9b7a('0x3a')](function(_0xdb1ca7){ut[_0x9b7a('0x45')](_0x9b7a('0x47'),_0xdb1ca7);});}else{ut['logger'](_0x9b7a('0x48'));}}Fax['prototype'][_0x9b7a('0x49')]=function(_0x5f34f2,_0x40e9e9,_0x2e7a38){var _0x249d54=this;var _0x67c9fe={};if(_0x40e9e9){_0x67c9fe={'read':_0x40e9e9};}else{_0x67c9fe={'failMessage':_0x2e7a38};}if(this[_0x9b7a('0x11')][_0x5f34f2][_0x9b7a('0x43')]){faxMessage[_0x9b7a('0x42')](this[_0x9b7a('0x11')][_0x5f34f2][_0x9b7a('0x43')],_0x67c9fe)[_0x9b7a('0x37')](function(_0x2dc384){ut[_0x9b7a('0x45')](_0x9b7a('0x4a'),_0x2dc384);})['catch'](function(_0x5c5b77){ut[_0x9b7a('0x45')](_0x9b7a('0x4b'),_0x5c5b77);})[_0x9b7a('0x4c')](function(){delete _0x249d54['channels'][_0x5f34f2];delete _0x249d54['actions'][_0x5f34f2];});}else{ut[_0x9b7a('0x45')](_0x9b7a('0x4d'));delete this[_0x9b7a('0xe')][_0x5f34f2];delete this[_0x9b7a('0x11')][_0x5f34f2];}};Fax[_0x9b7a('0x28')][_0x9b7a('0x4e')]=function(_0xc1147e){var _0x41664f=this;if(this[_0x9b7a('0xe')][_0xc1147e[_0x9b7a('0x23')]]){if(this[_0x9b7a('0x11')][_0xc1147e['uniqueid']]){this['channels'][_0xc1147e[_0x9b7a('0x23')]]['id']=this['actions'][_0xc1147e['uniqueid']]['id'];this[_0x9b7a('0xe')][_0xc1147e[_0x9b7a('0x23')]][_0x9b7a('0x25')]=this['actions'][_0xc1147e['uniqueid']]['name'];}logger['info'](_0xc1147e[_0x9b7a('0x23')],this['actions'][_0xc1147e['uniqueid']]?_0x9b7a('0x4f'):_0x9b7a('0x50'),JSON[_0x9b7a('0x3c')](this[_0x9b7a('0xe')][_0xc1147e[_0x9b7a('0x23')]]));if(this['actions'][_0xc1147e['uniqueid']]){if(this[_0x9b7a('0xe')][_0xc1147e['uniqueid']][_0x9b7a('0x51')]>0x0&&this[_0x9b7a('0xe')][_0xc1147e[_0x9b7a('0x23')]][_0x9b7a('0x1a')]==='SUCCESS'){this['updateStatus'](_0xc1147e['uniqueid'],!![]);}else{this[_0x9b7a('0x49')](_0xc1147e['uniqueid'],![],this[_0x9b7a('0xe')][_0xc1147e[_0x9b7a('0x23')]][_0x9b7a('0x52')]?_0x9b7a('0x53')+this[_0x9b7a('0xe')][_0xc1147e[_0x9b7a('0x23')]]['faxstatusstring']:_0x9b7a('0x54'));}}}};Fax['prototype'][_0x9b7a('0x55')]=function(_0x3e8eb1){var _0x4c79ca=this;return new BPromise(function(_0x40e047,_0x4fc2e0){_0x4c79ca[_0x9b7a('0x56')](_0x3e8eb1,_0x4c79ca[_0x9b7a('0xf')][_0x3e8eb1[_0x9b7a('0x57')]])['then'](function(_0x94cf82){ut[_0x9b7a('0x45')](_0x9b7a('0x58'),_0x94cf82);_0x40e047(ut[_0x9b7a('0x59')](_0x9b7a('0x5a')));})[_0x9b7a('0x3a')](function(_0x1c6c67){ut['logger'](_0x9b7a('0x5b'),_0x1c6c67);updateStatus(_0x3e8eb1);_0x4fc2e0(ut[_0x9b7a('0x59')]('Fax\x20failed'));});});};Fax[_0x9b7a('0x28')]['checkAfterSend']=function(_0x3cf7e4){var _0x301c78=this;return new BPromise(function(_0x248aa3,_0x28ad78){var _0x24ae75=_0x301c78[_0x9b7a('0x5c')](_0x301c78[_0x9b7a('0xf')][_0x3cf7e4[_0x9b7a('0x57')]][_0x9b7a('0x5d')],_0x3cf7e4);if(_0x24ae75[_0x9b7a('0x5e')]){_0x248aa3(ut[_0x9b7a('0x59')](_0x9b7a('0x5f')));}else{_0x28ad78(ut['message'](_0x24ae75['message']));}});};function originate(_0x2940e6,_0x7f607a,_0x635f2a){return new BPromise(function(_0x14aead,_0x38bae6){if(_0x635f2a){var _0x2e6be8=util[_0x9b7a('0x60')](_0x9b7a('0x61'),path[_0x9b7a('0x36')](_0x2940e6[_0x9b7a('0x4')])[_0x9b7a('0x25')],_0x2940e6[_0x9b7a('0x4')]);gs['execute'](_0x2e6be8)['then'](function(){_0x2940e6[_0x9b7a('0x4')]=util[_0x9b7a('0x60')](_0x9b7a('0x62'),path['parse'](_0x2940e6[_0x9b7a('0x4')])[_0x9b7a('0x63')],path[_0x9b7a('0x36')](_0x2940e6['path'])['name']);_0x7f607a[_0x9b7a('0x64')]=_0x2940e6[_0x9b7a('0x4')];ut[_0x9b7a('0x45')]('Convert\x20pdf\x20to\x20tif','');ami[_0x9b7a('0x65')](ut['variablesAction'](_0x2940e6,_0x7f607a))[_0x9b7a('0x37')](function(_0x4efccc){_0x14aead(_0x4efccc);})['catch'](function(_0x5a314c){_0x38bae6(_0x5a314c);});})[_0x9b7a('0x3a')](function(_0x1ce598){_0x38bae6(_0x1ce598);});}else{ami[_0x9b7a('0x65')](ut[_0x9b7a('0x66')](_0x2940e6,_0x7f607a))['then'](function(_0x5cc71d){_0x14aead(_0x5cc71d);})[_0x9b7a('0x3a')](function(_0x4f6775){_0x38bae6(_0x4f6775);});}});}Fax[_0x9b7a('0x28')][_0x9b7a('0x56')]=function(_0x36c3b6,_0x1a12c6){var _0x200686=this;return new BPromise(function(_0x3b31cb,_0x28ed9c){var _0x104099=uuid['v4']();var _0x1abcba=ut[_0x9b7a('0x67')](_0x36c3b6,_0x1a12c6);_0x200686[_0x9b7a('0x11')][_0x104099]=new Action(_0x104099,_0x1a12c6,_0x36c3b6);var _0x5da34c=_0x200686[_0x9b7a('0x11')][_0x104099];if(path[_0x9b7a('0x36')](_0x36c3b6[_0x9b7a('0x4')])[_0x9b7a('0x68')]==='.pdf'){originate(_0x5da34c,_0x1abcba,!![])[_0x9b7a('0x37')](function(_0x3ffae5){_0x3b31cb(_0x3ffae5);})[_0x9b7a('0x3a')](function(_0x1f5622){_0x28ed9c(_0x1f5622);});}else{originate(_0x5da34c,_0x1abcba,![])[_0x9b7a('0x37')](function(_0x141a78){_0x3b31cb(_0x141a78);})[_0x9b7a('0x3a')](function(_0x27dac2){_0x28ed9c(_0x27dac2);});}});};Fax[_0x9b7a('0x28')][_0x9b7a('0x69')]=function(_0x4e77c9){return!_[_0x9b7a('0x6a')](_0x4e77c9)&&!_[_0x9b7a('0x6a')](_0x4e77c9[_0x9b7a('0x25')])&&!_[_0x9b7a('0x6a')](_0x4e77c9[_0x9b7a('0x6b')])&&_0x4e77c9[_0x9b7a('0x6b')]&&!_['isNil'](this[_0x9b7a('0x10')][util[_0x9b7a('0x60')]('SIP/%s',_0x4e77c9[_0x9b7a('0x25')])])&&!_['isNil'](this[_0x9b7a('0x10')][util[_0x9b7a('0x60')](_0x9b7a('0x6c'),_0x4e77c9[_0x9b7a('0x25')])][_0x9b7a('0x2d')])&&(this['trunks'][util[_0x9b7a('0x60')](_0x9b7a('0x6c'),_0x4e77c9[_0x9b7a('0x25')])][_0x9b7a('0x2d')]===_0x9b7a('0x6d')||this['trunks'][util['format']('SIP/%s',_0x4e77c9[_0x9b7a('0x25')])][_0x9b7a('0x2d')]===_0x9b7a('0x6e'));};Fax[_0x9b7a('0x28')][_0x9b7a('0x5c')]=function(_0x42a3b9,_0x269aee){if(!this[_0x9b7a('0x69')](_0x42a3b9)){ut['logger'](_0x9b7a('0x6f'),_['isNil'](_0x42a3b9)?'':_0x42a3b9[_0x9b7a('0x25')]+_0x9b7a('0x70'));return{'isValid':![],'message':_0x9b7a('0x71')};}if(_[_0x9b7a('0x6a')](_0x269aee[_0x9b7a('0x72')])){ut[_0x9b7a('0x45')](_0x9b7a('0x73'),JSON[_0x9b7a('0x3c')](_0x269aee));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x9b7a('0x6a')](_0x269aee[_0x9b7a('0x4')])){ut[_0x9b7a('0x45')](_0x9b7a('0x74'),JSON[_0x9b7a('0x3c')](_0x269aee));return{'isValid':![],'message':_0x9b7a('0x75')};}return{'isValid':!![],'message':_0x9b7a('0x76')};};module[_0x9b7a('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 4470171..5827322 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 _0x27f2=['[Notify]\x20','bluebird','preview','lodash','inspect','notify','then'];(function(_0x157033,_0x398810){var _0x45d09f=function(_0x55086b){while(--_0x55086b){_0x157033['push'](_0x157033['shift']());}};_0x45d09f(++_0x398810);}(_0x27f2,0xa9));var _0x227f=function(_0x5ce518,_0x28e71a){_0x5ce518=_0x5ce518-0x0;var _0x221fdd=_0x27f2[_0x5ce518];return _0x221fdd;};'use strict';var util=require('util');var BPromise=require(_0x227f('0x0'));var logger=require('../../../config/logger')(_0x227f('0x1'));var _=require(_0x227f('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x4571aa){return function(_0x4e45ab){logger['error'](_0x4571aa,util[_0x227f('0x3')](_0x4e45ab,{'showHidden':![],'depth':null}));};}exports[_0x227f('0x4')]=function(_0x21b5a2,_0x5b9c08){return BPromise['resolve']()[_0x227f('0x5')](faxAccount['notify'](_0x21b5a2,_0x5b9c08))['catch'](loggerCatch(_0x227f('0x6')));}; \ No newline at end of file +var _0x3c75=['bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','resolve','then','util'];(function(_0x241500,_0x10ed3f){var _0x219020=function(_0x1d5523){while(--_0x1d5523){_0x241500['push'](_0x241500['shift']());}};_0x219020(++_0x10ed3f);}(_0x3c75,0x149));var _0x53c7=function(_0x31ff43,_0x37aca3){_0x31ff43=_0x31ff43-0x0;var _0x5a3964=_0x3c75[_0x31ff43];return _0x5a3964;};'use strict';var util=require(_0x53c7('0x0'));var BPromise=require(_0x53c7('0x1'));var logger=require(_0x53c7('0x2'))(_0x53c7('0x3'));var _=require('lodash');var faxAccount=require(_0x53c7('0x4'));function loggerCatch(_0x4400f5){return function(_0x5819b7){logger[_0x53c7('0x5')](_0x4400f5,util[_0x53c7('0x6')](_0x5819b7,{'showHidden':![],'depth':null}));};}exports[_0x53c7('0x7')]=function(_0x37d5ae,_0x16e98b){return BPromise[_0x53c7('0x8')]()[_0x53c7('0x9')](faxAccount[_0x53c7('0x7')](_0x37d5ae,_0x16e98b))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index cd81ade..7378a84 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 _0x786c=['bluebird','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:','util','fax'];(function(_0x2759b8,_0x3805a9){var _0x2cd2c0=function(_0x22976c){while(--_0x22976c){_0x2759b8['push'](_0x2759b8['shift']());}};_0x2cd2c0(++_0x3805a9);}(_0x786c,0xa0));var _0xc786=function(_0x27fd4e,_0x378506){_0x27fd4e=_0x27fd4e-0x0;var _0x6b1073=_0x786c[_0x27fd4e];return _0x6b1073;};'use strict';var util=require(_0xc786('0x0'));var logger=require('../../../../config/logger')(_0xc786('0x1'));var BPromise=require(_0xc786('0x2'));var exec=require(_0xc786('0x3'))[_0xc786('0x4')];exports[_0xc786('0x5')]=function(_0x147349){return new BPromise(function(_0x7b5e9e,_0x5f5481){exec(_0x147349,function(_0xda7974,_0xca26fb,_0x1475f3){logger['info'](_0xc786('0x6'),_0xca26fb);if(_0xda7974){logger[_0xc786('0x7')](_0xc786('0x6'),_0xc786('0x8'),util['inspect'](_0xda7974,{'showHidden':![],'depth':null}),_0xca26fb,_0x1475f3);_0x5f5481(_0xda7974);}_0x7b5e9e(_0xca26fb);});});}; \ No newline at end of file +var _0xe947=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x5d9613,_0x11eead){var _0x3d96f4=function(_0x1947f9){while(--_0x1947f9){_0x5d9613['push'](_0x5d9613['shift']());}};_0x3d96f4(++_0x11eead);}(_0xe947,0x109));var _0x7e94=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0xe947[_0x4715d2];return _0x141811;};'use strict';var util=require(_0x7e94('0x0'));var logger=require(_0x7e94('0x1'))(_0x7e94('0x2'));var BPromise=require(_0x7e94('0x3'));var exec=require(_0x7e94('0x4'))[_0x7e94('0x5')];exports[_0x7e94('0x6')]=function(_0x117f6c){return new BPromise(function(_0x3b24c9,_0x6b23df){exec(_0x117f6c,function(_0x4fab1a,_0x5e9932,_0x4ea212){logger[_0x7e94('0x7')](_0x7e94('0x8'),_0x5e9932);if(_0x4fab1a){logger[_0x7e94('0x7')](_0x7e94('0x8'),_0x7e94('0x9'),util[_0x7e94('0xa')](_0x4fab1a,{'showHidden':![],'depth':null}),_0x5e9932,_0x4ea212);_0x6b23df(_0x4fab1a);}_0x3b24c9(_0x5e9932);});});}; \ 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 03c2df6..bc4752e 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 _0xa8a8=['message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','modem','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','format','localstationid','util','lodash','moment','../../../../config/logger'];(function(_0x53197a,_0x4c8f6a){var _0x1bb789=function(_0x42dd7b){while(--_0x42dd7b){_0x53197a['push'](_0x53197a['shift']());}};_0x1bb789(++_0x4c8f6a);}(_0xa8a8,0xec));var _0x8a8a=function(_0x226c7f,_0x2d6562){_0x226c7f=_0x226c7f-0x0;var _0x5e8a63=_0xa8a8[_0x226c7f];return _0x5e8a63;};'use strict';var util=require(_0x8a8a('0x0'));var _=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var logger=require(_0x8a8a('0x3'))('fax');exports[_0x8a8a('0x4')]=function(_0x3296a6){return{'message':_0x3296a6};};exports[_0x8a8a('0x5')]=function(_0x3ed1de,_0x45515d){logger[_0x8a8a('0x6')](_0x3ed1de,util[_0x8a8a('0x7')](_0x45515d,{'showHidden':![],'depth':null}));};exports[_0x8a8a('0x8')]=function(_0x2e8193,_0x315fe9){var _0x1d7121={'XMF-ECM':_0x315fe9[_0x8a8a('0x9')],'XMF-HEADERINFO':_0x315fe9[_0x8a8a('0xa')],'XMF-MINRATE':_0x315fe9[_0x8a8a('0xb')],'XMF-MAXRATE':_0x315fe9[_0x8a8a('0xc')],'XMF-MODEM':util['format']('\x22%s\x22',_0x315fe9[_0x8a8a('0xd')]),'XMF-GATEWAY':_0x315fe9['gateway'],'XMF-FAXDETECT':_0x315fe9[_0x8a8a('0xe')],'XMF-T38TIMEOUT':_0x315fe9[_0x8a8a('0xf')],'XMF-LOCALSTATIONID':_0x315fe9['localstationid'],'XMF-PATH':_0x2e8193[_0x8a8a('0x10')]};return _0x1d7121;};exports[_0x8a8a('0x11')]=function(_0xb13fca,_0x5e448d){return{'actionid':_0xb13fca[_0x8a8a('0x12')],'action':_0x8a8a('0x13'),'channel':_0xb13fca[_0x8a8a('0x14')],'Exten':_0x8a8a('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0x8a8a('0x16')]('\x22%s\x22\x20<%s>',_0xb13fca[_0x8a8a('0xa')]?_0xb13fca[_0x8a8a('0xa')]:'',_0xb13fca[_0x8a8a('0x17')]),'variable':_0x5e448d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xb13fca[_0x8a8a('0x12')]};}; \ No newline at end of file +var _0xa74f=['\x22%s\x22','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','moment','message','logger','info','ecm','headerinfo','minrate','format'];(function(_0x37974a,_0x2804cf){var _0x45fd4e=function(_0x33559d){while(--_0x33559d){_0x37974a['push'](_0x37974a['shift']());}};_0x45fd4e(++_0x2804cf);}(_0xa74f,0x9a));var _0xfa74=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0xa74f[_0x19efbc];return _0x205c5e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfa74('0x0'));var logger=require('../../../../config/logger')('fax');exports[_0xfa74('0x1')]=function(_0x110824){return{'message':_0x110824};};exports[_0xfa74('0x2')]=function(_0x25a9b7,_0x5b367b){logger[_0xfa74('0x3')](_0x25a9b7,util['inspect'](_0x5b367b,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x43dd2f,_0x9ddbd2){var _0x3ac32e={'XMF-ECM':_0x9ddbd2[_0xfa74('0x4')],'XMF-HEADERINFO':_0x9ddbd2[_0xfa74('0x5')],'XMF-MINRATE':_0x9ddbd2[_0xfa74('0x6')],'XMF-MAXRATE':_0x9ddbd2['maxrate'],'XMF-MODEM':util[_0xfa74('0x7')](_0xfa74('0x8'),_0x9ddbd2[_0xfa74('0x9')]),'XMF-GATEWAY':_0x9ddbd2[_0xfa74('0xa')],'XMF-FAXDETECT':_0x9ddbd2['faxdetect'],'XMF-T38TIMEOUT':_0x9ddbd2[_0xfa74('0xb')],'XMF-LOCALSTATIONID':_0x9ddbd2[_0xfa74('0xc')],'XMF-PATH':_0x43dd2f['path']};return _0x3ac32e;};exports[_0xfa74('0xd')]=function(_0x1d919d,_0x30b2d5){return{'actionid':_0x1d919d[_0xfa74('0xe')],'action':'originate','channel':_0x1d919d[_0xfa74('0xf')],'Exten':_0xfa74('0x10'),'Context':_0xfa74('0x11'),'Priority':'1','callerid':util[_0xfa74('0x7')]('\x22%s\x22\x20<%s>',_0x1d919d[_0xfa74('0x5')]?_0x1d919d[_0xfa74('0x5')]:'',_0x1d919d[_0xfa74('0xc')]),'variable':_0x30b2d5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1d919d[_0xfa74('0xe')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8828276..458955b 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 _0x9e62=['./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','bluebird','util','moment','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk'];(function(_0x204b58,_0x57c400){var _0x206012=function(_0x7d2782){while(--_0x7d2782){_0x204b58['push'](_0x204b58['shift']());}};_0x206012(++_0x57c400);}(_0x9e62,0x108));var _0x29e6=function(_0x599c76,_0x3a5b7e){_0x599c76=_0x599c76-0x0;var _0x5e6a38=_0x9e62[_0x599c76];return _0x5e6a38;};'use strict';var BPromise=require(_0x29e6('0x0'));var util=require(_0x29e6('0x1'));var moment=require(_0x29e6('0x2'));var server=require('./server');var Realtime=require(_0x29e6('0x3'));var Report=require(_0x29e6('0x4'));var Acw=require('./acw');var Trigger=require(_0x29e6('0x5'));var Dialer=require(_0x29e6('0x6'));var Preview=require(_0x29e6('0x7'));var Fax=require(_0x29e6('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x29e6('0x9'));var voiceQueueReport=require(_0x29e6('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x29e6('0xb'));var trigger=require(_0x29e6('0xc'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x29e6('0xd'));var voiceExtension=require(_0x29e6('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x29e6('0xf'));var salesforce=require(_0x29e6('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x29e6('0x11'));var desk=require(_0x29e6('0x12'));var zoho=require(_0x29e6('0x13'));var vtiger=require(_0x29e6('0x14'));var servicenow=require(_0x29e6('0x15'));var dynamics365=require(_0x29e6('0x16'));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()[_0x29e6('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x29e6('0x17')](_0x29e6('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x29e6('0x19')]()[_0x29e6('0x1a')](user[_0x29e6('0x1b')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x1c')]())['then'](user[_0x29e6('0x1d')]())[_0x29e6('0x1a')](realtime['initTelephones']())[_0x29e6('0x1a')](trunk[_0x29e6('0x1e')]())[_0x29e6('0x1a')](realtime['initTrunks']())[_0x29e6('0x1a')](voiceQueue['getVoiceQueues']())[_0x29e6('0x1a')](realtime[_0x29e6('0x1f')]())[_0x29e6('0x1a')](trigger[_0x29e6('0x20')]())['then'](realtime[_0x29e6('0x21')]())[_0x29e6('0x1a')](template[_0x29e6('0x22')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x23')]())[_0x29e6('0x1a')](zendesk[_0x29e6('0x24')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x25')]())[_0x29e6('0x1a')](salesforce[_0x29e6('0x26')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x27')]())[_0x29e6('0x1a')](sugarcrm[_0x29e6('0x28')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x29')]())['then'](freshdesk[_0x29e6('0x2a')]())['then'](realtime[_0x29e6('0x2b')]())['then'](desk[_0x29e6('0x2c')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x2d')]())[_0x29e6('0x1a')](zoho[_0x29e6('0x2e')]())['then'](realtime[_0x29e6('0x2f')]())['then'](vtiger[_0x29e6('0x30')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x31')]())['then'](servicenow[_0x29e6('0x32')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x33')]())['then'](dynamics365[_0x29e6('0x34')]())['then'](realtime[_0x29e6('0x35')]())['then'](campaign[_0x29e6('0x36')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x37')]())[_0x29e6('0x1a')](voiceExtension[_0x29e6('0x38')]())['then'](realtime[_0x29e6('0x39')]())[_0x29e6('0x1a')](faxAccount[_0x29e6('0x3a')]())['then'](realtime[_0x29e6('0x3b')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x29e6('0x19')]()[_0x29e6('0x1a')](voiceQueueReport[_0x29e6('0x3c')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x3d')]())[_0x29e6('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x29e6('0x1a')](realtime[_0x29e6('0x3e')]())[_0x29e6('0x1a')](cmHopperHistory[_0x29e6('0x3f')]())[_0x29e6('0x1a')](realtime[_0x29e6('0x40')]())[_0x29e6('0x1a')](voiceCallReport[_0x29e6('0x41')]())['then'](realtime[_0x29e6('0x42')]())[_0x29e6('0x1a')](function(_0x187166){})[_0x29e6('0x43')](function(_0x26c639){console['log'](_0x26c639);});}function main(){return server[_0x29e6('0x44')](realtime,preview,fax)['then'](function(_0x5e7951){return initRealtime();})[_0x29e6('0x1a')](function(){return initParams();})[_0x29e6('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x29e6('0x43')](function(_0x3cdb86){console['log'](_0x3cdb86);});}main(); \ No newline at end of file +var _0xc1bc=['./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','initAgents','getTelephones','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','sync','bluebird','./server','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk'];(function(_0x5761db,_0x3acfea){var _0x3309b8=function(_0x30d818){while(--_0x30d818){_0x5761db['push'](_0x5761db['shift']());}};_0x3309b8(++_0x3acfea);}(_0xc1bc,0x1f0));var _0xcc1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1bc[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xcc1b('0x0'));var util=require('util');var moment=require('moment');var server=require(_0xcc1b('0x1'));var Realtime=require(_0xcc1b('0x2'));var Report=require('./report');var Acw=require(_0xcc1b('0x3'));var Trigger=require(_0xcc1b('0x4'));var Dialer=require('./dialer');var Preview=require(_0xcc1b('0x5'));var Fax=require(_0xcc1b('0x6'));var user=require(_0xcc1b('0x7'));var voiceQueue=require(_0xcc1b('0x8'));var voiceQueueReport=require(_0xcc1b('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xcc1b('0xa'));var trigger=require('./rpc/trigger');var template=require(_0xcc1b('0xb'));var cmHopperHistory=require(_0xcc1b('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xcc1b('0xd'));var faxAccount=require(_0xcc1b('0xe'));var zendesk=require(_0xcc1b('0xf'));var salesforce=require(_0xcc1b('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xcc1b('0x11'));var zoho=require(_0xcc1b('0x12'));var vtiger=require(_0xcc1b('0x13'));var servicenow=require(_0xcc1b('0x14'));var dynamics365=require(_0xcc1b('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xcc1b('0x16')](_0xcc1b('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xcc1b('0x18')]()['then'](user[_0xcc1b('0x19')]())['then'](realtime[_0xcc1b('0x1a')]())['then'](user[_0xcc1b('0x1b')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x1d')]())['then'](trunk[_0xcc1b('0x1e')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x1f')]())['then'](voiceQueue[_0xcc1b('0x20')]())['then'](realtime[_0xcc1b('0x21')]())[_0xcc1b('0x1c')](trigger[_0xcc1b('0x22')]())[_0xcc1b('0x1c')](realtime['initTriggers']())[_0xcc1b('0x1c')](template[_0xcc1b('0x23')]())['then'](realtime[_0xcc1b('0x24')]())['then'](zendesk['getZendeskAccounts']())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x25')]())[_0xcc1b('0x1c')](salesforce[_0xcc1b('0x26')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x27')]())['then'](sugarcrm[_0xcc1b('0x28')]())[_0xcc1b('0x1c')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xcc1b('0x29')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x2a')]())['then'](desk[_0xcc1b('0x2b')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x2c')]())[_0xcc1b('0x1c')](zoho['getZohoAccounts']())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x2d')]())['then'](vtiger['getVtigerAccounts']())['then'](realtime[_0xcc1b('0x2e')]())[_0xcc1b('0x1c')](servicenow[_0xcc1b('0x2f')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x30')]())[_0xcc1b('0x1c')](dynamics365['getDynamics365Accounts']())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x31')]())[_0xcc1b('0x1c')](campaign['getCampaigns']())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x32')]())[_0xcc1b('0x1c')](voiceExtension[_0xcc1b('0x33')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x34')]())[_0xcc1b('0x1c')](faxAccount[_0xcc1b('0x35')]())[_0xcc1b('0x1c')](realtime['initFaxAccounts']())[_0xcc1b('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xcc1b('0x18')]()[_0xcc1b('0x1c')](voiceQueueReport[_0xcc1b('0x36')]())['then'](realtime[_0xcc1b('0x37')]())[_0xcc1b('0x1c')](cmHopperHistory[_0xcc1b('0x38')]())['then'](realtime[_0xcc1b('0x39')]())['then'](cmHopperHistory[_0xcc1b('0x3a')]())[_0xcc1b('0x1c')](realtime[_0xcc1b('0x3b')]())[_0xcc1b('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xcc1b('0x3c')]())['then'](function(_0x4aaf56){})[_0xcc1b('0x3d')](function(_0x5ed6f9){console[_0xcc1b('0x3e')](_0x5ed6f9);});}function main(){return server['listen'](realtime,preview,fax)[_0xcc1b('0x1c')](function(_0x2264cb){return initRealtime();})[_0xcc1b('0x1c')](function(){return initParams();})['then'](function(){report[_0xcc1b('0x3f')]();setInterval(initRealtime,0x1388);})[_0xcc1b('0x3d')](function(_0x45bf6d){console[_0xcc1b('0x3e')](_0x45bf6d);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index e204422..efe58d4 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 _0xcc28=['user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','state','unknown','stateTime','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','voiceStatus','statePause','toNumber','format','fullname','status','voiceStatusQueue'];(function(_0x8c9741,_0x1362c8){var _0x580e3e=function(_0x31ee83){while(--_0x31ee83){_0x8c9741['push'](_0x8c9741['shift']());}};_0x580e3e(++_0x1362c8);}(_0xcc28,0x19e));var _0x8cc2=function(_0x227ec7,_0x1ef947){_0x227ec7=_0x227ec7-0x0;var _0x126db8=_0xcc28[_0x227ec7];return _0x126db8;};'use strict';var _=require(_0x8cc2('0x0'));var util=require(_0x8cc2('0x1'));var moment=require(_0x8cc2('0x2'));var md5=require(_0x8cc2('0x3'));var Redis=require(_0x8cc2('0x4'));var config=require('../../../config/environment');config[_0x8cc2('0x5')]=_[_0x8cc2('0x6')](config[_0x8cc2('0x5')],{'host':_0x8cc2('0x7'),'port':0x18eb});var io=require(_0x8cc2('0x8'))(new Redis(config[_0x8cc2('0x5')]));function Agent(_0x34b3ab){this['id']=_0x34b3ab['id']||0x0;this[_0x8cc2('0x9')]=_0x34b3ab[_0x8cc2('0x9')]||'';this[_0x8cc2('0xa')]=_0x34b3ab['email']||'';this['accountcode']=_0x34b3ab[_0x8cc2('0xb')]||'';this['fullname']=_0x34b3ab['fullname']||'';this[_0x8cc2('0xc')]=_0x8cc2('0xd');this[_0x8cc2('0xe')]=0x0;this['status']=_0x8cc2('0xd');this[_0x8cc2('0xf')]='';this[_0x8cc2('0x10')]='';this[_0x8cc2('0x11')]='';this[_0x8cc2('0x12')]='';this[_0x8cc2('0x13')]=_0x34b3ab[_0x8cc2('0x13')]||![];this['voiceStatus']=_0x8cc2('0xd');this[_0x8cc2('0x14')]=0x0;this[_0x8cc2('0x15')]='';this['voiceStatusQueue']='';this[_0x8cc2('0x16')]=![];this[_0x8cc2('0x17')]=![];this[_0x8cc2('0x3')]='';}Agent[_0x8cc2('0x18')][_0x8cc2('0x19')]=function(_0x3efe78){var _0x274968;if(_0x3efe78&&_0x3efe78[_0x8cc2('0xc')]){_0x274968=_0x3efe78[_0x8cc2('0xc')][_0x8cc2('0x1a')]();switch(_0x274968){case _0x8cc2('0x1b'):_0x274968=_0x8cc2('0x1c');break;case'inuse':_0x274968=_0x8cc2('0x1d');break;}}if(_0x274968&&this[_0x8cc2('0x1e')]!==_0x274968||_0x3efe78[_0x8cc2('0x1f')]){this['voiceStatusTime']=_[_0x8cc2('0x20')](moment()[_0x8cc2('0x21')]('x'));}if(_0x274968){this['voiceStatus']=_0x274968;}var _0x21ff23={'id':this['id'],'name':this[_0x8cc2('0x9')],'email':this[_0x8cc2('0xa')],'accountcode':this[_0x8cc2('0xb')],'fullname':this[_0x8cc2('0x22')],'state':this[_0x8cc2('0xc')],'stateTime':this[_0x8cc2('0xe')],'status':this[_0x8cc2('0x23')],'address':this[_0x8cc2('0xf')],'online':this['online'],'voiceStatus':this[_0x8cc2('0x1e')],'voiceStatusTime':this[_0x8cc2('0x14')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x8cc2('0x24')],'interface':this[_0x8cc2('0x12')],'onhold':this[_0x8cc2('0x16')]};var _0x4d6f6d=md5(JSON['stringify'](_0x21ff23));if(this['md5']!==_0x4d6f6d){this[_0x8cc2('0x3')]=_0x4d6f6d;io['to'](util[_0x8cc2('0x21')](_0x8cc2('0x25'),_0x21ff23[_0x8cc2('0x9')]))[_0x8cc2('0x26')](_0x8cc2('0x27'),_0x21ff23);}};module[_0x8cc2('0x28')]=Agent; \ No newline at end of file +var _0xe81f=['stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','status','unknown','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','statePause','voiceStatusTime','toNumber','format','address'];(function(_0x1c4931,_0x4da350){var _0x19dabc=function(_0x119939){while(--_0x119939){_0x1c4931['push'](_0x1c4931['shift']());}};_0x19dabc(++_0x4da350);}(_0xe81f,0x10f));var _0xfe81=function(_0x388898,_0x1728a8){_0x388898=_0x388898-0x0;var _0x4b2bdd=_0xe81f[_0x388898];return _0x4b2bdd;};'use strict';var _=require(_0xfe81('0x0'));var util=require(_0xfe81('0x1'));var moment=require(_0xfe81('0x2'));var md5=require(_0xfe81('0x3'));var Redis=require('ioredis');var config=require(_0xfe81('0x4'));config[_0xfe81('0x5')]=_[_0xfe81('0x6')](config[_0xfe81('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xfe81('0x7'))(new Redis(config[_0xfe81('0x5')]));function Agent(_0x46d7be){this['id']=_0x46d7be['id']||0x0;this[_0xfe81('0x8')]=_0x46d7be['name']||'';this[_0xfe81('0x9')]=_0x46d7be[_0xfe81('0x9')]||'';this[_0xfe81('0xa')]=_0x46d7be['accountcode']||'';this[_0xfe81('0xb')]=_0x46d7be[_0xfe81('0xb')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0xfe81('0xc')]=_0xfe81('0xd');this['address']='';this['phone']='';this['mobile']='';this[_0xfe81('0xe')]='';this['online']=_0x46d7be[_0xfe81('0xf')]||![];this[_0xfe81('0x10')]='unknown';this['voiceStatusTime']=0x0;this[_0xfe81('0x11')]='';this[_0xfe81('0x12')]='';this[_0xfe81('0x13')]=![];this[_0xfe81('0x14')]=![];this[_0xfe81('0x3')]='';}Agent[_0xfe81('0x15')][_0xfe81('0x16')]=function(_0x4f2815){var _0x42a7d0;if(_0x4f2815&&_0x4f2815['state']){_0x42a7d0=_0x4f2815[_0xfe81('0x17')][_0xfe81('0x18')]();switch(_0x42a7d0){case _0xfe81('0x19'):_0x42a7d0=_0xfe81('0x1a');break;case _0xfe81('0x1b'):_0x42a7d0='talking';break;}}if(_0x42a7d0&&this[_0xfe81('0x10')]!==_0x42a7d0||_0x4f2815[_0xfe81('0x1c')]){this[_0xfe81('0x1d')]=_[_0xfe81('0x1e')](moment()[_0xfe81('0x1f')]('x'));}if(_0x42a7d0){this[_0xfe81('0x10')]=_0x42a7d0;}var _0x2dcb5d={'id':this['id'],'name':this[_0xfe81('0x8')],'email':this[_0xfe81('0x9')],'accountcode':this[_0xfe81('0xa')],'fullname':this[_0xfe81('0xb')],'state':this[_0xfe81('0x17')],'stateTime':this['stateTime'],'status':this[_0xfe81('0xc')],'address':this[_0xfe81('0x20')],'online':this['online'],'voiceStatus':this[_0xfe81('0x10')],'voiceStatusTime':this[_0xfe81('0x1d')],'voiceStatusCallerIdNumber':this[_0xfe81('0x11')],'voiceStatusQueue':this[_0xfe81('0x12')],'interface':this[_0xfe81('0xe')],'onhold':this[_0xfe81('0x13')]};var _0x361299=md5(JSON[_0xfe81('0x21')](_0x2dcb5d));if(this[_0xfe81('0x3')]!==_0x361299){this[_0xfe81('0x3')]=_0x361299;io['to'](util[_0xfe81('0x1f')](_0xfe81('0x22'),_0x2dcb5d[_0xfe81('0x8')]))[_0xfe81('0x23')](_0xfe81('0x24'),_0x2dcb5d);}};module[_0xfe81('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index bf94f5a..30642cb 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 _0x0b0e=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0x34bfcd,_0x36163c){var _0x361432=function(_0x4d613e){while(--_0x4d613e){_0x34bfcd['push'](_0x34bfcd['shift']());}};_0x361432(++_0x36163c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x17045c,_0x470ebe){_0x17045c=_0x17045c-0x0;var _0x844ac5=_0x0b0e[_0x17045c];return _0x844ac5;};'use strict';function Campaign(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['type']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=0x0;this[_0xe0b0('0x4')]=0x0;this[_0xe0b0('0x5')]=0x0;this[_0xe0b0('0x6')]=0x0;this[_0xe0b0('0x7')]='';this[_0xe0b0('0x8')]=!![];this[_0xe0b0('0x9')]=_0x29cd1e[_0xe0b0('0x9')];this[_0xe0b0('0xa')]=_0x29cd1e['limitCalls'];this['dialTimezone']=_0x29cd1e[_0xe0b0('0xb')]||null;this[_0xe0b0('0xc')]=_0x29cd1e[_0xe0b0('0xc')]?_0x29cd1e[_0xe0b0('0xc')]:null;this['dialOriginateCallerIdName']=_0x29cd1e[_0xe0b0('0xd')];this[_0xe0b0('0xe')]=_0x29cd1e['dialOriginateCallerIdNumber'];this[_0xe0b0('0xf')]=_0x29cd1e[_0xe0b0('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x29cd1e[_0xe0b0('0x10')];this[_0xe0b0('0x11')]=_0x29cd1e[_0xe0b0('0x11')];this['dialBusyMaxRetry']=_0x29cd1e[_0xe0b0('0x12')];this[_0xe0b0('0x13')]=_0x29cd1e[_0xe0b0('0x13')];this[_0xe0b0('0x14')]=_0x29cd1e[_0xe0b0('0x14')];this['dialNoAnswerRetryFrequency']=_0x29cd1e[_0xe0b0('0x15')];this[_0xe0b0('0x16')]=_0x29cd1e[_0xe0b0('0x16')];this[_0xe0b0('0x17')]=_0x29cd1e[_0xe0b0('0x17')]||'DESC';this[_0xe0b0('0x18')]=_0x29cd1e['dialPrefix']||undefined;this[_0xe0b0('0x19')]=_0x29cd1e[_0xe0b0('0x19')]||undefined;this['dialCutDigit']=_0x29cd1e[_0xe0b0('0x1a')]||undefined;this['TrunkBackup']=_0x29cd1e[_0xe0b0('0x1b')]?_0x29cd1e[_0xe0b0('0x1b')]:undefined;this['Trunk']=_0x29cd1e['Trunk']?_0x29cd1e[_0xe0b0('0x1c')]:undefined;this['Interval']=_0x29cd1e['Interval']?_0x29cd1e['Interval']:undefined;this[_0xe0b0('0x1d')]=_0x29cd1e['SquareProject']?_0x29cd1e['SquareProject']:undefined;this[_0xe0b0('0x1e')]=_0x29cd1e['SquareProject']?_0x29cd1e[_0xe0b0('0x1d')]['name']:undefined;this[_0xe0b0('0x1f')]=_0x29cd1e[_0xe0b0('0x1f')]||![];this[_0xe0b0('0x20')]=_0x29cd1e[_0xe0b0('0x20')];this[_0xe0b0('0x21')]=_0x29cd1e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x29cd1e[_0xe0b0('0x22')];this['dialAMDTotalAnalysisTime']=_0x29cd1e[_0xe0b0('0x23')];this[_0xe0b0('0x24')]=_0x29cd1e['dialAMDMinWordLength'];this[_0xe0b0('0x25')]=_0x29cd1e['dialAMDBetweenWordsSilence'];this[_0xe0b0('0x26')]=_0x29cd1e['dialAMDMaximumNumberOfWords'];this[_0xe0b0('0x27')]=_0x29cd1e['dialAMDSilenceThreshold'];this[_0xe0b0('0x28')]=_0x29cd1e['dialAMDMaximumWordLength'];}module[_0xe0b0('0x29')]=Campaign; \ No newline at end of file +var _0x0713=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active'];(function(_0x2ae992,_0xad30f0){var _0x270a0a=function(_0xc96906){while(--_0xc96906){_0x2ae992['push'](_0x2ae992['shift']());}};_0x270a0a(++_0xad30f0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['name']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')]||_0x3071('0x2');this[_0x3071('0x3')]=0x0;this['temp']=0x0;this[_0x3071('0x4')]=0x0;this[_0x3071('0x5')]=0x0;this[_0x3071('0x6')]='';this[_0x3071('0x7')]=!![];this[_0x3071('0x8')]=_0x4bf247[_0x3071('0x8')];this[_0x3071('0x9')]=_0x4bf247[_0x3071('0x9')];this[_0x3071('0xa')]=_0x4bf247[_0x3071('0xa')]||null;this[_0x3071('0xb')]=_0x4bf247[_0x3071('0xb')]?_0x4bf247[_0x3071('0xb')]:null;this['dialOriginateCallerIdName']=_0x4bf247[_0x3071('0xc')];this[_0x3071('0xd')]=_0x4bf247[_0x3071('0xd')];this[_0x3071('0xe')]=_0x4bf247[_0x3071('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x4bf247[_0x3071('0xf')];this[_0x3071('0x10')]=_0x4bf247[_0x3071('0x10')];this[_0x3071('0x11')]=_0x4bf247[_0x3071('0x11')];this['dialBusyRetryFrequency']=_0x4bf247['dialBusyRetryFrequency'];this[_0x3071('0x12')]=_0x4bf247['dialNoAnswerMaxRetry'];this[_0x3071('0x13')]=_0x4bf247[_0x3071('0x13')];this['dialGlobalMaxRetry']=_0x4bf247[_0x3071('0x14')];this['dialOrderByScheduledAt']=_0x4bf247[_0x3071('0x15')]||_0x3071('0x16');this[_0x3071('0x17')]=_0x4bf247[_0x3071('0x17')]||undefined;this[_0x3071('0x18')]=_0x4bf247[_0x3071('0x18')]||undefined;this[_0x3071('0x19')]=_0x4bf247[_0x3071('0x19')]||undefined;this[_0x3071('0x1a')]=_0x4bf247[_0x3071('0x1a')]?_0x4bf247['TrunkBackup']:undefined;this[_0x3071('0x1b')]=_0x4bf247[_0x3071('0x1b')]?_0x4bf247[_0x3071('0x1b')]:undefined;this[_0x3071('0x1c')]=_0x4bf247[_0x3071('0x1c')]?_0x4bf247[_0x3071('0x1c')]:undefined;this[_0x3071('0x1d')]=_0x4bf247[_0x3071('0x1d')]?_0x4bf247['SquareProject']:undefined;this[_0x3071('0x1e')]=_0x4bf247[_0x3071('0x1d')]?_0x4bf247[_0x3071('0x1d')]['name']:undefined;this[_0x3071('0x1f')]=_0x4bf247['dialAMDActive']||![];this[_0x3071('0x20')]=_0x4bf247[_0x3071('0x20')];this[_0x3071('0x21')]=_0x4bf247[_0x3071('0x21')];this[_0x3071('0x22')]=_0x4bf247[_0x3071('0x22')];this[_0x3071('0x23')]=_0x4bf247[_0x3071('0x23')];this['dialAMDMinWordLength']=_0x4bf247['dialAMDMinWordLength'];this[_0x3071('0x24')]=_0x4bf247[_0x3071('0x24')];this[_0x3071('0x25')]=_0x4bf247[_0x3071('0x25')];this[_0x3071('0x26')]=_0x4bf247[_0x3071('0x26')];this[_0x3071('0x27')]=_0x4bf247[_0x3071('0x27')];}module[_0x3071('0x28')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 11abc59..f65c5ce 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 _0xaaee=['lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','exports','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answered','answertime','endtime','unmanaged'];(function(_0x3b845e,_0x41a27a){var _0x50b68b=function(_0x37fd96){while(--_0x37fd96){_0x3b845e['push'](_0x3b845e['shift']());}};_0x50b68b(++_0x41a27a);}(_0xaaee,0xa9));var _0xeaae=function(_0xfd1a50,_0x2b5787){_0xfd1a50=_0xfd1a50-0x0;var _0x30023d=_0xaaee[_0xfd1a50];return _0x30023d;};'use strict';function Channel(){this[_0xeaae('0x0')]=null;this['channel']='';this[_0xeaae('0x1')]='';this[_0xeaae('0x2')]=0x0;this['calleridname']='';this[_0xeaae('0x3')]=undefined;this[_0xeaae('0x4')]=undefined;this[_0xeaae('0x5')]=0x0;this[_0xeaae('0x6')]='';this['uniqueid']=0x0;this[_0xeaae('0x7')]=0x0;this[_0xeaae('0x8')]=0x0;this[_0xeaae('0x9')]=![];this[_0xeaae('0xa')]=null;this[_0xeaae('0xb')]=null;this[_0xeaae('0xc')]=![];this['abandoned']=![];this[_0xeaae('0xd')]='';this[_0xeaae('0xe')]='';this[_0xeaae('0xf')]=0x0;this[_0xeaae('0x10')]=0x0;this[_0xeaae('0x11')]=0x0;this[_0xeaae('0x12')]=null;this[_0xeaae('0x13')]=null;this[_0xeaae('0x14')]=null;this[_0xeaae('0x15')]=![];this['monitorFilename']=null;this[_0xeaae('0x16')]=null;this[_0xeaae('0x17')]=[];this[_0xeaae('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0xeaae('0x19')]=Channel; \ No newline at end of file +var _0x1c45=['lastdata','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication'];(function(_0x1a5b10,_0xa93a0e){var _0x5c0dca=function(_0xc2d58e){while(--_0xc2d58e){_0x1a5b10['push'](_0x1a5b10['shift']());}};_0x5c0dca(++_0xa93a0e);}(_0x1c45,0x1b0));var _0x51c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1c45[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this[_0x51c4('0x0')]=null;this[_0x51c4('0x1')]='';this[_0x51c4('0x2')]='';this[_0x51c4('0x3')]=0x0;this[_0x51c4('0x4')]='';this[_0x51c4('0x5')]=undefined;this[_0x51c4('0x6')]=undefined;this[_0x51c4('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x51c4('0x8')]=0x0;this[_0x51c4('0x9')]=0x0;this[_0x51c4('0xa')]=![];this[_0x51c4('0xb')]=null;this[_0x51c4('0xc')]=null;this[_0x51c4('0xd')]=![];this[_0x51c4('0xe')]=![];this[_0x51c4('0xf')]='';this[_0x51c4('0x10')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x51c4('0x11')]=0x0;this[_0x51c4('0x12')]=null;this[_0x51c4('0x13')]=null;this[_0x51c4('0x14')]=null;this[_0x51c4('0x15')]=![];this[_0x51c4('0x16')]=null;this['queue']=null;this[_0x51c4('0x17')]=[];this[_0x51c4('0x18')]=undefined;this[_0x51c4('0x19')]=undefined;this[_0x51c4('0x1a')]=0x0;}module[_0x51c4('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 77c1bd9..a50fce0 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 _0x2171=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x1bd079,_0x10691f){var _0x363629=function(_0x4ecc03){while(--_0x4ecc03){_0x1bd079['push'](_0x1bd079['shift']());}};_0x363629(++_0x10691f);}(_0x2171,0x143));var _0x1217=function(_0x1bf85e,_0xac3ba5){_0x1bf85e=_0x1bf85e-0x0;var _0x5423fa=_0x2171[_0x1bf85e];return _0x5423fa;};'use strict';function DeskAccount(_0xcac228){this['id']=_0xcac228['id']||0x0;this[_0x1217('0x0')]=_0xcac228[_0x1217('0x0')]||'';this[_0x1217('0x1')]=_0xcac228['username']||'';this['remoteUri']=_0xcac228[_0x1217('0x2')]||'';this['authType']=_0xcac228[_0x1217('0x3')]||'';this[_0x1217('0x4')]=_0xcac228[_0x1217('0x4')]||'';this[_0x1217('0x5')]=_0xcac228['consumerKey']||'';this[_0x1217('0x6')]=_0xcac228[_0x1217('0x6')]||'';this[_0x1217('0x7')]=_0xcac228['token']||'';this[_0x1217('0x8')]=_0xcac228[_0x1217('0x8')]||'';this[_0x1217('0x9')]=_0xcac228[_0x1217('0x9')]||'';this[_0x1217('0xa')]=_0xcac228[_0x1217('0xa')]||'';this['Configurations']=_0xcac228[_0x1217('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xd1f9=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x5a8be1,_0x4aebbf){var _0x512cbc=function(_0x589684){while(--_0x589684){_0x5a8be1['push'](_0x5a8be1['shift']());}};_0x512cbc(++_0x4aebbf);}(_0xd1f9,0x88));var _0x9d1f=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0xd1f9[_0x11b19b];return _0x1daac1;};'use strict';function DeskAccount(_0x221e96){this['id']=_0x221e96['id']||0x0;this['name']=_0x221e96[_0x9d1f('0x0')]||'';this[_0x9d1f('0x1')]=_0x221e96[_0x9d1f('0x1')]||'';this[_0x9d1f('0x2')]=_0x221e96[_0x9d1f('0x2')]||'';this[_0x9d1f('0x3')]=_0x221e96[_0x9d1f('0x3')]||'';this[_0x9d1f('0x4')]=_0x221e96[_0x9d1f('0x4')]||'';this['consumerKey']=_0x221e96[_0x9d1f('0x5')]||'';this[_0x9d1f('0x6')]=_0x221e96[_0x9d1f('0x6')]||'';this[_0x9d1f('0x7')]=_0x221e96[_0x9d1f('0x7')]||'';this[_0x9d1f('0x8')]=_0x221e96[_0x9d1f('0x8')]||'';this[_0x9d1f('0x9')]=_0x221e96[_0x9d1f('0x9')]||'';this[_0x9d1f('0xa')]=_0x221e96[_0x9d1f('0xa')]||'';this[_0x9d1f('0xb')]=_0x221e96[_0x9d1f('0xb')]||{};}module[_0x9d1f('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 1438ae5..ff5f1eb 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 _0x4eaf=['tenantId','clientId','clientSecret','serverUrl','exports','name','username','password','remoteUri'];(function(_0x24afa6,_0x25552c){var _0x495a7a=function(_0xe38d7d){while(--_0xe38d7d){_0x24afa6['push'](_0x24afa6['shift']());}};_0x495a7a(++_0x25552c);}(_0x4eaf,0x101));var _0xf4ea=function(_0x3c5613,_0x3ca71e){_0x3c5613=_0x3c5613-0x0;var _0x1c4f7e=_0x4eaf[_0x3c5613];return _0x1c4f7e;};'use strict';function Dynamics365Account(_0x5e7105){this['id']=_0x5e7105['id']||0x0;this['name']=_0x5e7105[_0xf4ea('0x0')]||'';this[_0xf4ea('0x1')]=_0x5e7105['username']||'';this[_0xf4ea('0x2')]=_0x5e7105[_0xf4ea('0x2')]||'';this['remoteUri']=_0x5e7105[_0xf4ea('0x3')]||'';this[_0xf4ea('0x4')]=_0x5e7105[_0xf4ea('0x4')]||'';this['clientId']=_0x5e7105[_0xf4ea('0x5')]||'';this[_0xf4ea('0x6')]=_0x5e7105[_0xf4ea('0x6')]||{};this['serverUrl']=_0x5e7105[_0xf4ea('0x7')]||'';this['Configurations']=_0x5e7105['Configurations']||{};}module[_0xf4ea('0x8')]=Dynamics365Account; \ No newline at end of file +var _0xbd3e=['tenantId','clientId','serverUrl','Configurations','exports','name','username','password'];(function(_0x112df9,_0x316301){var _0x3e5773=function(_0x30d011){while(--_0x30d011){_0x112df9['push'](_0x112df9['shift']());}};_0x3e5773(++_0x316301);}(_0xbd3e,0x7d));var _0xebd3=function(_0x3e51a7,_0x407105){_0x3e51a7=_0x3e51a7-0x0;var _0x2107a6=_0xbd3e[_0x3e51a7];return _0x2107a6;};'use strict';function Dynamics365Account(_0x96ea89){this['id']=_0x96ea89['id']||0x0;this[_0xebd3('0x0')]=_0x96ea89[_0xebd3('0x0')]||'';this[_0xebd3('0x1')]=_0x96ea89['username']||'';this[_0xebd3('0x2')]=_0x96ea89['password']||'';this['remoteUri']=_0x96ea89['remoteUri']||'';this[_0xebd3('0x3')]=_0x96ea89[_0xebd3('0x3')]||'';this[_0xebd3('0x4')]=_0x96ea89['clientId']||'';this['clientSecret']=_0x96ea89['clientSecret']||{};this[_0xebd3('0x5')]=_0x96ea89[_0xebd3('0x5')]||'';this['Configurations']=_0x96ea89[_0xebd3('0x6')]||{};}module[_0xebd3('0x7')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index e2a1b34..c2d7eb8 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 _0x0ef4=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x23f8c8,_0xb536b9){var _0x3dc718=function(_0x25d719){while(--_0x25d719){_0x23f8c8['push'](_0x23f8c8['shift']());}};_0x3dc718(++_0xb536b9);}(_0x0ef4,0xc7));var _0x40ef=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x0ef4[_0x334d1e];return _0x3b33ba;};'use strict';function FaxAccount(_0x1655be){this['id']=_0x1655be['id']||0x0;this[_0x40ef('0x0')]=_0x1655be[_0x40ef('0x0')]||'';this[_0x40ef('0x1')]=_0x1655be['description'];this['ecm']=_0x1655be[_0x40ef('0x2')];this[_0x40ef('0x3')]=_0x1655be[_0x40ef('0x3')];this['localstationid']=_0x1655be[_0x40ef('0x4')];this['minrate']=_0x1655be['minrate']||0x960;this[_0x40ef('0x5')]=_0x1655be[_0x40ef('0x5')]||0x3840;this[_0x40ef('0x6')]=_0x1655be[_0x40ef('0x6')]||_0x40ef('0x7');this[_0x40ef('0x8')]=_0x1655be[_0x40ef('0x8')]||'no';this[_0x40ef('0x9')]=_0x1655be[_0x40ef('0x9')]||'no';this['t38timeout']=_0x1655be[_0x40ef('0xa')]||0x1388;this['tech']=_0x1655be[_0x40ef('0xb')]||_0x40ef('0xc');this[_0x40ef('0xd')]=_0x1655be[_0x40ef('0xd')]?_0x1655be['Trunk']:undefined;this[_0x40ef('0xe')]=_0x1655be[_0x40ef('0xe')];this[_0x40ef('0xf')]=_0x1655be[_0x40ef('0xf')];}module[_0x40ef('0x10')]=FaxAccount; \ No newline at end of file +var _0xb3a9=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb3a9,0xa2));var _0x9b3a=function(_0x30f3ba,_0x2a80e4){_0x30f3ba=_0x30f3ba-0x0;var _0x2a3117=_0xb3a9[_0x30f3ba];return _0x2a3117;};'use strict';function FaxAccount(_0x572fdb){this['id']=_0x572fdb['id']||0x0;this[_0x9b3a('0x0')]=_0x572fdb[_0x9b3a('0x0')]||'';this[_0x9b3a('0x1')]=_0x572fdb[_0x9b3a('0x1')];this[_0x9b3a('0x2')]=_0x572fdb['ecm'];this[_0x9b3a('0x3')]=_0x572fdb[_0x9b3a('0x3')];this['localstationid']=_0x572fdb[_0x9b3a('0x4')];this[_0x9b3a('0x5')]=_0x572fdb[_0x9b3a('0x5')]||0x960;this[_0x9b3a('0x6')]=_0x572fdb[_0x9b3a('0x6')]||0x3840;this[_0x9b3a('0x7')]=_0x572fdb[_0x9b3a('0x7')]||'v17,v27,v29';this[_0x9b3a('0x8')]=_0x572fdb['gateway']||'no';this[_0x9b3a('0x9')]=_0x572fdb[_0x9b3a('0x9')]||'no';this['t38timeout']=_0x572fdb[_0x9b3a('0xa')]||0x1388;this[_0x9b3a('0xb')]=_0x572fdb[_0x9b3a('0xb')]||_0x9b3a('0xc');this[_0x9b3a('0xd')]=_0x572fdb[_0x9b3a('0xd')]?_0x572fdb[_0x9b3a('0xd')]:undefined;this['ListId']=_0x572fdb['ListId'];this[_0x9b3a('0xe')]=_0x572fdb[_0x9b3a('0xe')];}module[_0x9b3a('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 2cc00e1..1a9a119 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 _0xb8d5=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x1f7312,_0x45f8b9){var _0x32d540=function(_0x4e181f){while(--_0x4e181f){_0x1f7312['push'](_0x1f7312['shift']());}};_0x32d540(++_0x45f8b9);}(_0xb8d5,0x1b2));var _0x5b8d=function(_0x1e53b6,_0x494054){_0x1e53b6=_0x1e53b6-0x0;var _0x1bbd0a=_0xb8d5[_0x1e53b6];return _0x1bbd0a;};'use strict';function FreshdeskAccount(_0x443053){this['id']=_0x443053['id']||0x0;this['name']=_0x443053['name']||'';this[_0x5b8d('0x0')]=_0x443053[_0x5b8d('0x0')]||'';this[_0x5b8d('0x1')]=_0x443053[_0x5b8d('0x2')]||'';this[_0x5b8d('0x3')]=_0x443053['remoteUri']||'';this[_0x5b8d('0x4')]=_0x443053[_0x5b8d('0x4')]||'';this[_0x5b8d('0x5')]=_0x443053[_0x5b8d('0x5')]||{};}module[_0x5b8d('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x0af4=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x37671c,_0x17fcb3){var _0x8d1935=function(_0x39347b){while(--_0x39347b){_0x37671c['push'](_0x37671c['shift']());}};_0x8d1935(++_0x17fcb3);}(_0x0af4,0xbd));var _0x40af=function(_0xec2d18,_0x51e416){_0xec2d18=_0xec2d18-0x0;var _0xa40459=_0x0af4[_0xec2d18];return _0xa40459;};'use strict';function FreshdeskAccount(_0x1b5990){this['id']=_0x1b5990['id']||0x0;this[_0x40af('0x0')]=_0x1b5990[_0x40af('0x0')]||'';this[_0x40af('0x1')]=_0x1b5990['username']||'';this[_0x40af('0x2')]=_0x1b5990[_0x40af('0x3')]||'';this[_0x40af('0x4')]=_0x1b5990[_0x40af('0x4')]||'';this[_0x40af('0x5')]=_0x1b5990[_0x40af('0x5')]||'';this[_0x40af('0x6')]=_0x1b5990['Configurations']||{};}module[_0x40af('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index faee31f..a8407c1 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 _0xe58a=['exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','connectedlinename','exten','priority','holdtime','assigned','lastAssignedTo','variables'];(function(_0xf3a205,_0x161f99){var _0x3b4e09=function(_0x1b6029){while(--_0x1b6029){_0xf3a205['push'](_0xf3a205['shift']());}};_0x3b4e09(++_0x161f99);}(_0xe58a,0x1a5));var _0xae58=function(_0x58aeef,_0x11cf83){_0x58aeef=_0x58aeef-0x0;var _0x2ce1e7=_0xe58a[_0x58aeef];return _0x2ce1e7;};'use strict';function QueueReport(){this[_0xae58('0x0')]=_0xae58('0x1');this[_0xae58('0x2')]='';this['calleridnum']='';this[_0xae58('0x3')]='';this[_0xae58('0x4')]='';this[_0xae58('0x5')]=null;this[_0xae58('0x6')]=null;this['position']=0x1;this['count']=0x1;this[_0xae58('0x7')]=![];this[_0xae58('0x8')]=null;this[_0xae58('0x9')]=![];this[_0xae58('0xa')]=null;this['queuecallerexit']=![];this[_0xae58('0xb')]=null;this[_0xae58('0xc')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0xae58('0xd')]='';this['accountcode']='';this['context']='';this[_0xae58('0xe')]='';this[_0xae58('0xf')]='';this[_0xae58('0x10')]=0x0;this[_0xae58('0x11')]=![];this[_0xae58('0x12')]='';this['mohtime']=0x0;this[_0xae58('0x13')]={};}module[_0xae58('0x14')]=QueueReport; \ No newline at end of file +var _0xad69=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon'];(function(_0x1ebe08,_0x133161){var _0x243464=function(_0x5c9a9d){while(--_0x5c9a9d){_0x1ebe08['push'](_0x1ebe08['shift']());}};_0x243464(++_0x133161);}(_0xad69,0x92));var _0x9ad6=function(_0x218f93,_0xe0551){_0x218f93=_0x218f93-0x0;var _0x574186=_0xad69[_0x218f93];return _0x574186;};'use strict';function QueueReport(){this[_0x9ad6('0x0')]=_0x9ad6('0x1');this[_0x9ad6('0x2')]='';this[_0x9ad6('0x3')]='';this[_0x9ad6('0x4')]='';this[_0x9ad6('0x5')]='';this[_0x9ad6('0x6')]=null;this[_0x9ad6('0x7')]=null;this[_0x9ad6('0x8')]=0x1;this['count']=0x1;this[_0x9ad6('0x9')]=![];this[_0x9ad6('0xa')]=null;this[_0x9ad6('0xb')]=![];this[_0x9ad6('0xc')]=null;this[_0x9ad6('0xd')]=![];this[_0x9ad6('0xe')]=null;this[_0x9ad6('0xf')]=0x1;this[_0x9ad6('0x10')]='';this['connectedlinenum']='';this[_0x9ad6('0x11')]='';this[_0x9ad6('0x12')]='';this[_0x9ad6('0x13')]='';this[_0x9ad6('0x14')]='';this['priority']='';this['holdtime']=0x0;this[_0x9ad6('0x15')]=![];this[_0x9ad6('0x16')]='';this[_0x9ad6('0x17')]=0x0;this[_0x9ad6('0x18')]={};}module[_0x9ad6('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 77c1d91..1fcf4b6 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 _0xcd78=['Configurations','name','username','remoteUri','clientId','clientSecret','securityToken','serverUrl'];(function(_0x54e856,_0x313d5c){var _0x124873=function(_0x48547e){while(--_0x48547e){_0x54e856['push'](_0x54e856['shift']());}};_0x124873(++_0x313d5c);}(_0xcd78,0xa9));var _0x8cd7=function(_0x209fcd,_0x2638e7){_0x209fcd=_0x209fcd-0x0;var _0x48da20=_0xcd78[_0x209fcd];return _0x48da20;};'use strict';function SalesforceAccount(_0x13619b){this['id']=_0x13619b['id']||0x0;this[_0x8cd7('0x0')]=_0x13619b['name']||'';this[_0x8cd7('0x1')]=_0x13619b[_0x8cd7('0x1')]||'';this[_0x8cd7('0x2')]=_0x13619b[_0x8cd7('0x2')]||'';this['password']=_0x13619b['password']||'';this['clientId']=_0x13619b[_0x8cd7('0x3')]||'';this['clientSecret']=_0x13619b[_0x8cd7('0x4')]||'';this[_0x8cd7('0x5')]=_0x13619b[_0x8cd7('0x5')]||'';this['type']=_0x13619b['type']||'integrationTab';this[_0x8cd7('0x6')]=_0x13619b[_0x8cd7('0x6')]||'';this[_0x8cd7('0x7')]=_0x13619b['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xdd34=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','username','remoteUri'];(function(_0x549e08,_0x117a0d){var _0x552682=function(_0xe1238f){while(--_0xe1238f){_0x549e08['push'](_0x549e08['shift']());}};_0x552682(++_0x117a0d);}(_0xdd34,0x1db));var _0x4dd3=function(_0x2cc1da,_0x455ed3){_0x2cc1da=_0x2cc1da-0x0;var _0x287102=_0xdd34[_0x2cc1da];return _0x287102;};'use strict';function SalesforceAccount(_0x4b4ca1){this['id']=_0x4b4ca1['id']||0x0;this['name']=_0x4b4ca1['name']||'';this[_0x4dd3('0x0')]=_0x4b4ca1['username']||'';this[_0x4dd3('0x1')]=_0x4b4ca1[_0x4dd3('0x1')]||'';this[_0x4dd3('0x2')]=_0x4b4ca1['password']||'';this[_0x4dd3('0x3')]=_0x4b4ca1[_0x4dd3('0x3')]||'';this[_0x4dd3('0x4')]=_0x4b4ca1[_0x4dd3('0x4')]||'';this[_0x4dd3('0x5')]=_0x4b4ca1[_0x4dd3('0x5')]||'';this[_0x4dd3('0x6')]=_0x4b4ca1[_0x4dd3('0x6')]||'integrationTab';this['serverUrl']=_0x4b4ca1[_0x4dd3('0x7')]||'';this[_0x4dd3('0x8')]=_0x4b4ca1[_0x4dd3('0x8')]||{};}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 cd02f1d..0eeaa49 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 _0xeb9a=['username','password','remoteUri','serverUrl','Configurations'];(function(_0x5f24c5,_0x4fdf5b){var _0xf8f7c2=function(_0xcc880d){while(--_0xcc880d){_0x5f24c5['push'](_0x5f24c5['shift']());}};_0xf8f7c2(++_0x4fdf5b);}(_0xeb9a,0x145));var _0xaeb9=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xeb9a[_0x119d5a];return _0x15bff4;};'use strict';function ServicenowAccount(_0x1ffcb0){this['id']=_0x1ffcb0['id']||0x0;this['name']=_0x1ffcb0['name']||'';this[_0xaeb9('0x0')]=_0x1ffcb0[_0xaeb9('0x0')]||'';this[_0xaeb9('0x1')]=_0x1ffcb0['password']||'';this[_0xaeb9('0x2')]=_0x1ffcb0[_0xaeb9('0x2')]||'';this[_0xaeb9('0x3')]=_0x1ffcb0['serverUrl']||'';this[_0xaeb9('0x4')]=_0x1ffcb0[_0xaeb9('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x06b8=['Configurations','exports','username','password','remoteUri','serverUrl'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x06b8,0x1ca));var _0x806b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x06b8[_0x1facfa];return _0x9ec701;};'use strict';function ServicenowAccount(_0xfa6e95){this['id']=_0xfa6e95['id']||0x0;this['name']=_0xfa6e95['name']||'';this[_0x806b('0x0')]=_0xfa6e95[_0x806b('0x0')]||'';this[_0x806b('0x1')]=_0xfa6e95['password']||'';this[_0x806b('0x2')]=_0xfa6e95[_0x806b('0x2')]||'';this[_0x806b('0x3')]=_0xfa6e95[_0x806b('0x3')]||'';this['Configurations']=_0xfa6e95[_0x806b('0x4')]||{};}module[_0x806b('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 89db960..3e412f9 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 _0x4e2e=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4e2e,0x110));var _0xe4e2=function(_0x40efe6,_0x1de3cc){_0x40efe6=_0x40efe6-0x0;var _0x3d2c58=_0x4e2e[_0x40efe6];return _0x3d2c58;};'use strict';function SugarcrmAccount(_0x1230d8){this['id']=_0x1230d8['id']||0x0;this['name']=_0x1230d8[_0xe4e2('0x0')]||'';this[_0xe4e2('0x1')]=_0x1230d8[_0xe4e2('0x1')]||'';this['password']=_0x1230d8[_0xe4e2('0x2')]||'';this[_0xe4e2('0x3')]=_0x1230d8[_0xe4e2('0x3')]||'';this['serverUrl']=_0x1230d8[_0xe4e2('0x4')]||'';this[_0xe4e2('0x5')]=_0x1230d8[_0xe4e2('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x3efc=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x20ac0f,_0x527193){var _0x3fbdb8=function(_0x2ad99d){while(--_0x2ad99d){_0x20ac0f['push'](_0x20ac0f['shift']());}};_0x3fbdb8(++_0x527193);}(_0x3efc,0x19e));var _0xc3ef=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3efc[_0x42cae2];return _0x5f256f;};'use strict';function SugarcrmAccount(_0x5f2cb4){this['id']=_0x5f2cb4['id']||0x0;this[_0xc3ef('0x0')]=_0x5f2cb4[_0xc3ef('0x0')]||'';this[_0xc3ef('0x1')]=_0x5f2cb4[_0xc3ef('0x1')]||'';this[_0xc3ef('0x2')]=_0x5f2cb4['password']||'';this[_0xc3ef('0x3')]=_0x5f2cb4['remoteUri']||'';this[_0xc3ef('0x4')]=_0x5f2cb4[_0xc3ef('0x4')]||'';this[_0xc3ef('0x5')]=_0x5f2cb4[_0xc3ef('0x5')]||{};}module[_0xc3ef('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 29def6a..404e040 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 _0x8e9a=['stateTime','status','unknown','address','exports','name','accountcode','state'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8e9a,0x1a5));var _0xa8e9=function(_0x3c4915,_0x562448){_0x3c4915=_0x3c4915-0x0;var _0x4cff79=_0x8e9a[_0x3c4915];return _0x4cff79;};'use strict';function Telephone(_0x5b6e42){this['id']=_0x5b6e42['id']||0x0;this[_0xa8e9('0x0')]=_0x5b6e42[_0xa8e9('0x0')]||'';this[_0xa8e9('0x1')]=_0x5b6e42[_0xa8e9('0x1')]||'';this[_0xa8e9('0x2')]='unknown';this[_0xa8e9('0x3')]=0x0;this[_0xa8e9('0x4')]=_0xa8e9('0x5');this[_0xa8e9('0x6')]='';}module[_0xa8e9('0x7')]=Telephone; \ No newline at end of file +var _0x9362=['address','exports','name','accountcode','unknown','stateTime'];(function(_0x3bb21a,_0x353b56){var _0x5f3983=function(_0x334b13){while(--_0x334b13){_0x3bb21a['push'](_0x3bb21a['shift']());}};_0x5f3983(++_0x353b56);}(_0x9362,0x12e));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';function Telephone(_0x16a010){this['id']=_0x16a010['id']||0x0;this[_0x2936('0x0')]=_0x16a010[_0x2936('0x0')]||'';this[_0x2936('0x1')]=_0x16a010[_0x2936('0x1')]||'';this['state']=_0x2936('0x2');this[_0x2936('0x3')]=0x0;this['status']=_0x2936('0x2');this[_0x2936('0x4')]='';}module[_0x2936('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index b4cf264..00870ff 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 _0x5dd9=['name','html','exports'];(function(_0xe0d82d,_0x21db60){var _0x268aee=function(_0x589e44){while(--_0x589e44){_0xe0d82d['push'](_0xe0d82d['shift']());}};_0x268aee(++_0x21db60);}(_0x5dd9,0x1e6));var _0x95dd=function(_0x4d3329,_0x53e55b){_0x4d3329=_0x4d3329-0x0;var _0x3abb35=_0x5dd9[_0x4d3329];return _0x3abb35;};'use strict';function template(_0x4f0703){this['id']=_0x4f0703['id']||0x0;this[_0x95dd('0x0')]=_0x4f0703['name']||'';this[_0x95dd('0x1')]=_0x4f0703[_0x95dd('0x1')]||'';}module[_0x95dd('0x2')]=template; \ No newline at end of file +var _0xae18=['html','exports','name'];(function(_0x1c8cdc,_0x37dcaf){var _0x1943f6=function(_0x150246){while(--_0x150246){_0x1c8cdc['push'](_0x1c8cdc['shift']());}};_0x1943f6(++_0x37dcaf);}(_0xae18,0x176));var _0x8ae1=function(_0x246de3,_0x9525a8){_0x246de3=_0x246de3-0x0;var _0x33037d=_0xae18[_0x246de3];return _0x33037d;};'use strict';function template(_0x544059){this['id']=_0x544059['id']||0x0;this['name']=_0x544059[_0x8ae1('0x0')]||'';this[_0x8ae1('0x1')]=_0x544059[_0x8ae1('0x1')]||'';}module[_0x8ae1('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 9ef33af..49aaf13 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 _0x34e8=['channel','voice','status','AllConditions','AnyConditions','Actions','name'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x34e8,0x12c));var _0x834e=function(_0x1fa804,_0x26a4cb){_0x1fa804=_0x1fa804-0x0;var _0xa1c781=_0x34e8[_0x1fa804];return _0xa1c781;};'use strict';function Trigger(_0x26715f){this['id']=_0x26715f['id']||0x0;this[_0x834e('0x0')]=_0x26715f[_0x834e('0x0')]||'';this[_0x834e('0x1')]=_0x26715f['channel']||_0x834e('0x2');this[_0x834e('0x3')]=_0x26715f[_0x834e('0x3')]||![];this[_0x834e('0x4')]=_0x26715f[_0x834e('0x4')]||[];this[_0x834e('0x5')]=_0x26715f[_0x834e('0x5')]||[];this['Actions']=_0x26715f[_0x834e('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x4b84=['name','channel','status','AllConditions','Actions'];(function(_0x29c248,_0x5f1eb3){var _0x1415c8=function(_0x180a98){while(--_0x180a98){_0x29c248['push'](_0x29c248['shift']());}};_0x1415c8(++_0x5f1eb3);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x4b84[_0x5f1617];return _0x3af5da;};'use strict';function Trigger(_0x90ff31){this['id']=_0x90ff31['id']||0x0;this[_0x44b8('0x0')]=_0x90ff31['name']||'';this['channel']=_0x90ff31[_0x44b8('0x1')]||'voice';this['status']=_0x90ff31[_0x44b8('0x2')]||![];this[_0x44b8('0x3')]=_0x90ff31[_0x44b8('0x3')]||[];this['AnyConditions']=_0x90ff31['AnyConditions']||[];this['Actions']=_0x90ff31[_0x44b8('0x4')]||[];}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 59e3b82..ee4a662 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 _0xfd65=['port','domain','refresh','registrationtime','exports','name','unknown','stateTime','status','registry','split','host'];(function(_0x39aef6,_0x2f7f55){var _0xd083eb=function(_0x44b472){while(--_0x44b472){_0x39aef6['push'](_0x39aef6['shift']());}};_0xd083eb(++_0x2f7f55);}(_0xfd65,0x13d));var _0x5fd6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xfd65[_0x19950b];return _0x3c6b41;};'use strict';function Trunk(_0x4b9c83){this['id']=_0x4b9c83['id']||0x0;this['active']=_0x4b9c83['active']||![];this[_0x5fd6('0x0')]=_0x4b9c83[_0x5fd6('0x0')]||'';this['state']=_0x5fd6('0x1');this[_0x5fd6('0x2')]=0x0;this[_0x5fd6('0x3')]=_0x5fd6('0x1');this[_0x5fd6('0x4')]=_0x4b9c83[_0x5fd6('0x4')]&&_0x4b9c83[_0x5fd6('0x4')]['indexOf'](':')?_0x4b9c83['registry'][_0x5fd6('0x5')](':')[0x0]:'';this[_0x5fd6('0x6')]='';this[_0x5fd6('0x7')]='';this[_0x5fd6('0x8')]='';this['domainport']='';this[_0x5fd6('0x9')]='';this['stateRegistry']=_0x5fd6('0x1');this[_0x5fd6('0xa')]='';this['address']='';}module[_0x5fd6('0xb')]=Trunk; \ No newline at end of file +var _0x5044=['active','name','state','stateTime','status','unknown','registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x2c96a7,_0x3984e8){var _0x5b55a5=function(_0x522bbb){while(--_0x522bbb){_0x2c96a7['push'](_0x2c96a7['shift']());}};_0x5b55a5(++_0x3984e8);}(_0x5044,0x1ef));var _0x4504=function(_0xd6b83b,_0x1a4e22){_0xd6b83b=_0xd6b83b-0x0;var _0xcf9f69=_0x5044[_0xd6b83b];return _0xcf9f69;};'use strict';function Trunk(_0x4f7f5c){this['id']=_0x4f7f5c['id']||0x0;this[_0x4504('0x0')]=_0x4f7f5c['active']||![];this[_0x4504('0x1')]=_0x4f7f5c[_0x4504('0x1')]||'';this[_0x4504('0x2')]='unknown';this[_0x4504('0x3')]=0x0;this[_0x4504('0x4')]=_0x4504('0x5');this[_0x4504('0x6')]=_0x4f7f5c[_0x4504('0x6')]&&_0x4f7f5c['registry'][_0x4504('0x7')](':')?_0x4f7f5c[_0x4504('0x6')]['split'](':')[0x0]:'';this[_0x4504('0x8')]='';this[_0x4504('0x9')]='';this[_0x4504('0xa')]='';this[_0x4504('0xb')]='';this[_0x4504('0xc')]='';this[_0x4504('0xd')]='unknown';this[_0x4504('0xe')]='';this['address']='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 4498025..b636194 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 _0x4816=['mandatoryDisposition','exten','none'];(function(_0x14122a,_0x449bf1){var _0x4a50d0=function(_0xa7a373){while(--_0xa7a373){_0x14122a['push'](_0x14122a['shift']());}};_0x4a50d0(++_0x449bf1);}(_0x4816,0x118));var _0x6481=function(_0x337565,_0x3198ec){_0x337565=_0x337565-0x0;var _0x197ff3=_0x4816[_0x337565];return _0x197ff3;};'use strict';function voiceExtension(_0x22d56f){this['id']=_0x22d56f['id']||0x0;this[_0x6481('0x0')]=_0x22d56f[_0x6481('0x0')]||'';this['recordingFormat']=_0x22d56f['recordingFormat']||_0x6481('0x1');this[_0x6481('0x2')]=_0x22d56f['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x391c=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0xe49c5e,_0x366ee4){var _0x38b718=function(_0x1c6e58){while(--_0x1c6e58){_0xe49c5e['push'](_0xe49c5e['shift']());}};_0x38b718(++_0x366ee4);}(_0x391c,0x1ee));var _0xc391=function(_0x3e6d04,_0x954446){_0x3e6d04=_0x3e6d04-0x0;var _0x208489=_0x391c[_0x3e6d04];return _0x208489;};'use strict';function voiceExtension(_0x2565c9){this['id']=_0x2565c9['id']||0x0;this['exten']=_0x2565c9[_0xc391('0x0')]||'';this['recordingFormat']=_0x2565c9[_0xc391('0x1')]||_0xc391('0x2');this[_0xc391('0x3')]=_0x2565c9[_0xc391('0x3')]||![];}module[_0xc391('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8937a00..22260f7 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 _0x2f37=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','unavailable','ringing','wav','wav49','gsm','rrmemory','name','monitor_format','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout'];(function(_0x1add77,_0x30ddf1){var _0xbe222b=function(_0x36294a){while(--_0x36294a){_0x1add77['push'](_0x1add77['shift']());}};_0xbe222b(++_0x30ddf1);}(_0x2f37,0x1e5));var _0x72f3=function(_0x3702e3,_0x4809a5){_0x3702e3=_0x3702e3-0x0;var _0x2fa774=_0x2f37[_0x3702e3];return _0x2fa774;};'use strict';var statusDesc=['unknown',_0x72f3('0x0'),_0x72f3('0x1'),'busy',_0x72f3('0x2'),_0x72f3('0x3'),_0x72f3('0x4'),'ringinuse','onhold'];var monitorFormat={'wav':_0x72f3('0x5'),'wav49':_0x72f3('0x6'),'gsm':_0x72f3('0x7')};var strategy={'rrmemory':_0x72f3('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x32173d){this['id']=_0x32173d['id']||0x0;this[_0x72f3('0x9')]=_0x32173d['name']||'';this[_0x72f3('0xa')]=_0x32173d['monitor_format']||'';this['type']=_0x32173d['type']||_0x72f3('0xb');this[_0x72f3('0xc')]=0x0;this['talking']=0x0;this[_0x72f3('0xd')]=0x0;this[_0x72f3('0xe')]=0x0;this[_0x72f3('0xf')]=0x0;this[_0x72f3('0x10')]=0x0;this[_0x72f3('0x11')]=0x0;this[_0x72f3('0x12')]=0x0;this[_0x72f3('0x13')]=0x0;this[_0x72f3('0x14')]=0x0;this[_0x72f3('0x15')]=0x0;this[_0x72f3('0x16')]=_0x32173d[_0x72f3('0x16')]||![];this['acwTimeout']=_0x32173d[_0x72f3('0x17')]||0xa;this['autopause']=_0x32173d['autopause']||'no';this[_0x72f3('0x18')]=!![];this[_0x72f3('0x19')]='';this[_0x72f3('0x1a')]=0x0;this[_0x72f3('0x1b')]=0x0;this[_0x72f3('0x1c')]=_0x32173d[_0x72f3('0x1c')]||null;this[_0x72f3('0x1d')]=_0x32173d[_0x72f3('0x1d')]?_0x32173d['dialGlobalInterval']:null;this[_0x72f3('0x1e')]=_0x32173d[_0x72f3('0x1e')];this['dialMethod']=_0x32173d[_0x72f3('0x1f')]||_0x72f3('0x20');this['dialLimitChannel']=_0x32173d['dialLimitChannel']||0x0;this[_0x72f3('0x21')]=_0x32173d[_0x72f3('0x21')]||0x0;this[_0x72f3('0x22')]=_0x32173d[_0x72f3('0x22')]||0x1;this['dialPredictiveOptimization']=_0x32173d[_0x72f3('0x23')]||_0x72f3('0x24');this[_0x72f3('0x25')]=_0x32173d[_0x72f3('0x25')]||0.03;this[_0x72f3('0x26')]=_0x32173d[_0x72f3('0x26')]||0x258;this[_0x72f3('0x27')]=_0x32173d['dialOriginateCallerIdName']||'anonymous';this[_0x72f3('0x28')]=_0x32173d[_0x72f3('0x28')]||_0x72f3('0x29');this['dialOriginateTimeout']=_0x32173d[_0x72f3('0x2a')]||0x1e;this[_0x72f3('0x2b')]=_0x32173d['dialQueueOptions']||'tTxX';this[_0x72f3('0x2c')]=_0x32173d[_0x72f3('0x2c')]||0x3;this['dialQueueProject']=_0x32173d['dialQueueProject']||undefined;this[_0x72f3('0x2d')]=_0x32173d[_0x72f3('0x2d')]||0x3;this[_0x72f3('0x2e')]=_0x32173d[_0x72f3('0x2e')]||0x96;this[_0x72f3('0x2f')]=_0x32173d[_0x72f3('0x2f')]||0x3;this[_0x72f3('0x30')]=_0x32173d[_0x72f3('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x32173d[_0x72f3('0x31')]||0x3;this[_0x72f3('0x32')]=_0x32173d['dialNoAnswerRetryFrequency']||0x96;this[_0x72f3('0x33')]=_0x32173d[_0x72f3('0x33')]||0x4;this[_0x72f3('0x34')]=_0x32173d[_0x72f3('0x34')]?_0x32173d['Trunk']:undefined;this[_0x72f3('0x35')]=_0x32173d[_0x72f3('0x35')]?_0x32173d[_0x72f3('0x35')]:undefined;this[_0x72f3('0x36')]=_0x32173d[_0x72f3('0x36')]||undefined;this[_0x72f3('0x37')]=_0x32173d['Interval']?_0x32173d['Interval']:undefined;this[_0x72f3('0x38')]=_0x32173d[_0x72f3('0x38')]||_0x72f3('0x39');this[_0x72f3('0x3a')]=_0x32173d[_0x72f3('0x3a')]||undefined;this[_0x72f3('0x3b')]=_0x32173d[_0x72f3('0x3b')]||undefined;this['strategy']=strategy[_0x32173d[_0x72f3('0x3c')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x72f3('0x3d')]=_0x32173d[_0x72f3('0x3d')]||![];this[_0x72f3('0x3e')]=_0x32173d[_0x72f3('0x3e')];this[_0x72f3('0x3f')]=_0x32173d[_0x72f3('0x3f')];this[_0x72f3('0x40')]=_0x32173d[_0x72f3('0x40')];this[_0x72f3('0x41')]=_0x32173d[_0x72f3('0x41')];this[_0x72f3('0x42')]=_0x32173d[_0x72f3('0x42')];this[_0x72f3('0x43')]=_0x32173d[_0x72f3('0x43')];this[_0x72f3('0x44')]=_0x32173d['dialAMDMaximumNumberOfWords'];this[_0x72f3('0x45')]=_0x32173d[_0x72f3('0x45')];this['dialAMDMaximumWordLength']=_0x32173d['dialAMDMaximumWordLength'];this[_0x72f3('0x46')]=0x0;this[_0x72f3('0x47')]=0x0;this[_0x72f3('0x48')]=_0x32173d[_0x72f3('0x48')];this[_0x72f3('0x49')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x72f3('0x4a')]=0x0;this[_0x72f3('0x4b')]=0x0;this[_0x72f3('0x4c')]=0x0;this[_0x72f3('0x4d')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x72f3('0x4e')]=0x0;this[_0x72f3('0x4f')]=0x0;this[_0x72f3('0x50')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x72f3('0x51')]=0x0;this[_0x72f3('0x52')]=undefined;this[_0x72f3('0x53')]=undefined;this[_0x72f3('0x54')]=undefined;this[_0x72f3('0x55')]=1.05;this[_0x72f3('0x56')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x72f3('0x57')]=0x0;this[_0x72f3('0x58')]=0x0;this[_0x72f3('0x59')]=0x0;this[_0x72f3('0x5a')]=_0x32173d['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x72f3('0x5b')]=_0x32173d[_0x72f3('0x5c')]||0xa;this[_0x72f3('0x5d')]=0x0;this[_0x72f3('0x5e')]=0x0;this[_0x72f3('0x5f')]=0x1;this[_0x72f3('0x60')]=0x0;this[_0x72f3('0x61')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x72f3('0x62')]=0x0;this[_0x72f3('0x63')]=_0x32173d[_0x72f3('0x63')]||0x1e;this[_0x72f3('0x64')]=_0x32173d[_0x72f3('0x64')]||![];this['dialQueueProject2']=_0x32173d[_0x72f3('0x65')]||undefined;this['dialAgiAfterHangupClient']=_0x32173d[_0x72f3('0x66')]||![];this[_0x72f3('0x67')]=_0x32173d[_0x72f3('0x67')]||![];this['monitor_format']=monitorFormat[_0x32173d[_0x72f3('0xa')]]?monitorFormat[_0x32173d[_0x72f3('0xa')]]:undefined;this['mandatoryDisposition']=_0x32173d['mandatoryDisposition']||![];this[_0x72f3('0x68')]=_0x32173d[_0x72f3('0x68')]?_0x32173d[_0x72f3('0x68')]:undefined;}module[_0x72f3('0x69')]=VoiceQueue; \ No newline at end of file +var _0x9a49=['total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking'];(function(_0x5226d9,_0x58c47a){var _0x424d2f=function(_0x3b232a){while(--_0x3b232a){_0x5226d9['push'](_0x5226d9['shift']());}};_0x424d2f(++_0x58c47a);}(_0x9a49,0x13b));var _0x99a4=function(_0x2bdfe5,_0x2bbf23){_0x2bdfe5=_0x2bdfe5-0x0;var _0x1ea441=_0x9a49[_0x2bdfe5];return _0x1ea441;};'use strict';var statusDesc=[_0x99a4('0x0'),_0x99a4('0x1'),_0x99a4('0x2'),_0x99a4('0x3'),_0x99a4('0x4'),_0x99a4('0x5'),_0x99a4('0x6'),'ringinuse',_0x99a4('0x7')];var monitorFormat={'wav':_0x99a4('0x8'),'wav49':_0x99a4('0x9'),'gsm':_0x99a4('0xa')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x99a4('0xb')};function VoiceQueue(_0x3ba955){this['id']=_0x3ba955['id']||0x0;this[_0x99a4('0xc')]=_0x3ba955[_0x99a4('0xc')]||'';this['monitor_format']=_0x3ba955[_0x99a4('0xd')]||'';this[_0x99a4('0xe')]=_0x3ba955['type']||_0x99a4('0xf');this[_0x99a4('0x10')]=0x0;this[_0x99a4('0x11')]=0x0;this[_0x99a4('0x12')]=0x0;this['answered']=0x0;this[_0x99a4('0x13')]=0x0;this[_0x99a4('0x14')]=0x0;this[_0x99a4('0x15')]=0x0;this[_0x99a4('0x16')]=0x0;this[_0x99a4('0x17')]=0x0;this[_0x99a4('0x18')]=0x0;this[_0x99a4('0x19')]=0x0;this['acw']=_0x3ba955[_0x99a4('0x1a')]||![];this[_0x99a4('0x1b')]=_0x3ba955['acwTimeout']||0xa;this[_0x99a4('0x1c')]=_0x3ba955[_0x99a4('0x1c')]||'no';this[_0x99a4('0x1d')]=!![];this[_0x99a4('0x1e')]='';this[_0x99a4('0x1f')]=0x0;this[_0x99a4('0x20')]=0x0;this[_0x99a4('0x21')]=_0x3ba955['dialTimezone']||null;this[_0x99a4('0x22')]=_0x3ba955[_0x99a4('0x22')]?_0x3ba955[_0x99a4('0x22')]:null;this[_0x99a4('0x23')]=_0x3ba955[_0x99a4('0x23')];this[_0x99a4('0x24')]=_0x3ba955[_0x99a4('0x24')]||'progressive';this['dialLimitChannel']=_0x3ba955[_0x99a4('0x25')]||0x0;this['dialLimitQueue']=_0x3ba955[_0x99a4('0x26')]||0x0;this[_0x99a4('0x27')]=_0x3ba955['dialPowerLevel']||0x1;this[_0x99a4('0x28')]=_0x3ba955[_0x99a4('0x28')]||_0x99a4('0x29');this[_0x99a4('0x2a')]=_0x3ba955[_0x99a4('0x2a')]||0.03;this['dialPredictiveInterval']=_0x3ba955['dialPredictiveInterval']||0x258;this[_0x99a4('0x2b')]=_0x3ba955[_0x99a4('0x2b')]||'anonymous';this[_0x99a4('0x2c')]=_0x3ba955[_0x99a4('0x2c')]||_0x99a4('0x2d');this[_0x99a4('0x2e')]=_0x3ba955['dialOriginateTimeout']||0x1e;this[_0x99a4('0x2f')]=_0x3ba955[_0x99a4('0x2f')]||'tTxX';this[_0x99a4('0x30')]=_0x3ba955['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x3ba955[_0x99a4('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x3ba955[_0x99a4('0x32')]||0x3;this[_0x99a4('0x33')]=_0x3ba955[_0x99a4('0x33')]||0x96;this['dialBusyMaxRetry']=_0x3ba955[_0x99a4('0x34')]||0x3;this['dialBusyRetryFrequency']=_0x3ba955[_0x99a4('0x35')]||0x96;this[_0x99a4('0x36')]=_0x3ba955['dialNoAnswerMaxRetry']||0x3;this[_0x99a4('0x37')]=_0x3ba955[_0x99a4('0x37')]||0x96;this[_0x99a4('0x38')]=_0x3ba955['dialGlobalMaxRetry']||0x4;this[_0x99a4('0x39')]=_0x3ba955['Trunk']?_0x3ba955[_0x99a4('0x39')]:undefined;this[_0x99a4('0x3a')]=_0x3ba955[_0x99a4('0x3a')]?_0x3ba955[_0x99a4('0x3a')]:undefined;this['dialPrefix']=_0x3ba955[_0x99a4('0x3b')]||undefined;this[_0x99a4('0x3c')]=_0x3ba955[_0x99a4('0x3c')]?_0x3ba955['Interval']:undefined;this[_0x99a4('0x3d')]=_0x3ba955[_0x99a4('0x3d')]||_0x99a4('0x3e');this['dialRandomLastDigitCallerIdNumber']=_0x3ba955['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x3ba955[_0x99a4('0x3f')]||undefined;this[_0x99a4('0x40')]=strategy[_0x3ba955['strategy']]||_0x99a4('0x41');this[_0x99a4('0x42')]=!![];this[_0x99a4('0x43')]=_0x3ba955[_0x99a4('0x43')]||![];this[_0x99a4('0x44')]=_0x3ba955[_0x99a4('0x44')];this[_0x99a4('0x45')]=_0x3ba955[_0x99a4('0x45')];this['dialAMDAfterGreetingSilence']=_0x3ba955[_0x99a4('0x46')];this[_0x99a4('0x47')]=_0x3ba955['dialAMDTotalAnalysisTime'];this[_0x99a4('0x48')]=_0x3ba955[_0x99a4('0x48')];this[_0x99a4('0x49')]=_0x3ba955[_0x99a4('0x49')];this[_0x99a4('0x4a')]=_0x3ba955[_0x99a4('0x4a')];this[_0x99a4('0x4b')]=_0x3ba955['dialAMDSilenceThreshold'];this[_0x99a4('0x4c')]=_0x3ba955[_0x99a4('0x4c')];this[_0x99a4('0x4d')]=0x0;this['pTalking']=0x0;this['timeout']=_0x3ba955[_0x99a4('0x4e')];this[_0x99a4('0x4f')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x99a4('0x50')]=0x0;this[_0x99a4('0x51')]=0x0;this[_0x99a4('0x52')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x99a4('0x53')]=0x0;this[_0x99a4('0x54')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x99a4('0x55')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x99a4('0x56')]=0x0;this['startProgressive']=undefined;this[_0x99a4('0x57')]=undefined;this[_0x99a4('0x58')]=undefined;this[_0x99a4('0x59')]=1.05;this[_0x99a4('0x5a')]=0x0;this[_0x99a4('0x5b')]=0x0;this[_0x99a4('0x5c')]=0x0;this[_0x99a4('0x5d')]=0x0;this[_0x99a4('0x5e')]=0x0;this[_0x99a4('0x5f')]=0x0;this[_0x99a4('0x60')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x99a4('0x61')]=_0x3ba955[_0x99a4('0x62')]||0x14;this['predictiveIntervalMinThreshold']=_0x3ba955[_0x99a4('0x62')]||0xa;this[_0x99a4('0x63')]=0x0;this[_0x99a4('0x64')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x99a4('0x65')]=0x0;this[_0x99a4('0x66')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x99a4('0x67')]=0x0;this[_0x99a4('0x68')]=_0x3ba955['dialRecallMeTimeout']||0x1e;this[_0x99a4('0x69')]=_0x3ba955[_0x99a4('0x69')]||![];this[_0x99a4('0x6a')]=_0x3ba955['dialQueueProject2']||undefined;this[_0x99a4('0x6b')]=_0x3ba955['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x3ba955['dialAgiAfterHangupAgent']||![];this[_0x99a4('0xd')]=monitorFormat[_0x3ba955[_0x99a4('0xd')]]?monitorFormat[_0x3ba955[_0x99a4('0xd')]]:undefined;this[_0x99a4('0x6c')]=_0x3ba955[_0x99a4('0x6c')]||![];this[_0x99a4('0x6d')]=_0x3ba955['mandatoryDispositionPause']?_0x3ba955[_0x99a4('0x6d')]:undefined;}module[_0x99a4('0x6e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 0ea4c22..16555a3 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 _0xd887=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x281adf,_0x406229){var _0x49aca1=function(_0x2fe7ee){while(--_0x2fe7ee){_0x281adf['push'](_0x281adf['shift']());}};_0x49aca1(++_0x406229);}(_0xd887,0x141));var _0x7d88=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0xd887[_0x5e4b85];return _0x5cd3cb;};'use strict';function VtigerAccount(_0x4f793f){this['id']=_0x4f793f['id']||0x0;this[_0x7d88('0x0')]=_0x4f793f['name']||'';this[_0x7d88('0x1')]=_0x4f793f[_0x7d88('0x1')]||'';this['accessKey']=_0x4f793f[_0x7d88('0x2')]||'';this['remoteUri']=_0x4f793f[_0x7d88('0x3')]||'';this[_0x7d88('0x4')]=_0x4f793f[_0x7d88('0x4')]||'';this[_0x7d88('0x5')]=_0x4f793f['Configurations']||{};}module[_0x7d88('0x6')]=VtigerAccount; \ No newline at end of file +var _0x279d=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x279d,0x1d8));var _0xd279=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x279d[_0x1c8c28];return _0x1f59b4;};'use strict';function VtigerAccount(_0x4f85bf){this['id']=_0x4f85bf['id']||0x0;this[_0xd279('0x0')]=_0x4f85bf[_0xd279('0x0')]||'';this[_0xd279('0x1')]=_0x4f85bf['username']||'';this['accessKey']=_0x4f85bf[_0xd279('0x2')]||'';this[_0xd279('0x3')]=_0x4f85bf['remoteUri']||'';this[_0xd279('0x4')]=_0x4f85bf[_0xd279('0x4')]||'';this[_0xd279('0x5')]=_0x4f85bf[_0xd279('0x5')]||{};}module[_0xd279('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index a10bd34..c57388d 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 _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x382834,_0x41c18a){var _0x66d77c=function(_0x286fe9){while(--_0x286fe9){_0x382834['push'](_0x382834['shift']());}};_0x66d77c(++_0x41c18a);}(_0x2032,0xd9));var _0x2203=function(_0xb168d4,_0x5f0a1b){_0xb168d4=_0xb168d4-0x0;var _0x53e81e=_0x2032[_0xb168d4];return _0x53e81e;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x514b00,_0x81df98){_0x514b00=_0x514b00-0x0;var _0x3ff357=_0xdb28[_0x514b00];return _0x3ff357;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('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 25efd7c..1352687 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 _0x6ca3=['refreshToken','exports','name','description','host','zone','clientSecret','serverUrl'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x6ca3,0xba));var _0x36ca=function(_0x5f7d79,_0x546143){_0x5f7d79=_0x5f7d79-0x0;var _0x577319=_0x6ca3[_0x5f7d79];return _0x577319;};'use strict';function ZohoAccount(_0x569548){this['id']=_0x569548['id']||0x0;this['name']=_0x569548[_0x36ca('0x0')]||'';this[_0x36ca('0x1')]=_0x569548['description']||'';this[_0x36ca('0x2')]=_0x569548[_0x36ca('0x2')]||'';this['zone']=_0x569548[_0x36ca('0x3')]||'';this['clientId']=_0x569548['clientId']||'';this[_0x36ca('0x4')]=_0x569548[_0x36ca('0x4')]||'';this[_0x36ca('0x5')]=_0x569548[_0x36ca('0x5')]||'';this['code']=_0x569548['code']||'';this[_0x36ca('0x6')]=_0x569548[_0x36ca('0x6')]||'';this['Configurations']=_0x569548['Configurations']||{};}module[_0x36ca('0x7')]=ZohoAccount; \ No newline at end of file +var _0x3c8b=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x19c890,_0x578830){_0x19c890=_0x19c890-0x0;var _0x383273=_0x3c8b[_0x19c890];return _0x383273;};'use strict';function ZohoAccount(_0x4bc592){this['id']=_0x4bc592['id']||0x0;this[_0xb3c8('0x0')]=_0x4bc592['name']||'';this[_0xb3c8('0x1')]=_0x4bc592[_0xb3c8('0x1')]||'';this[_0xb3c8('0x2')]=_0x4bc592['host']||'';this[_0xb3c8('0x3')]=_0x4bc592[_0xb3c8('0x3')]||'';this[_0xb3c8('0x4')]=_0x4bc592[_0xb3c8('0x4')]||'';this[_0xb3c8('0x5')]=_0x4bc592[_0xb3c8('0x5')]||'';this[_0xb3c8('0x6')]=_0x4bc592[_0xb3c8('0x6')]||'';this['code']=_0x4bc592[_0xb3c8('0x7')]||'';this['refreshToken']=_0x4bc592[_0xb3c8('0x8')]||'';this[_0xb3c8('0x9')]=_0x4bc592['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 90f9d95..5263fe4 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 _0x9d22=['calleridname','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x27b2ed,_0x42861c){var _0x33641b=function(_0x536eb1){while(--_0x536eb1){_0x27b2ed['push'](_0x27b2ed['shift']());}};_0x33641b(++_0x42861c);}(_0x9d22,0x7a));var _0x29d2=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x9d22[_0x2f3ecd];return _0xffdc44;};'use strict';var util=require(_0x29d2('0x0'));var _=require(_0x29d2('0x1'));var moment=require(_0x29d2('0x2'));function checkNameSurname(_0x4129a8,_0x6113d3,_0x41f865){var _0x22c6a3='';if(!_[_0x29d2('0x3')](_0x6113d3)&&_0x29d2('0x4')===typeof _0x6113d3){_0x22c6a3+=_0x6113d3;}if(!_[_0x29d2('0x3')](_0x41f865)&&'string'===typeof _0x41f865){_0x22c6a3+='\x20'+_0x41f865;}if(_0x22c6a3!==''){return _0x22c6a3;}return _0x4129a8;}function Action(_0x40def3,_0x369a47,_0x3dd655,_0x2bbdf1,_0x2ed5bf){this[_0x29d2('0x5')]=_0x3dd655||undefined;this['idContact']=_0x40def3['id'];this[_0x29d2('0x6')]=_0x369a47[_0x29d2('0x7')];this[_0x29d2('0x8')]=_0x369a47[_0x29d2('0x8')];this[_0x29d2('0x9')]=_0x29d2('0x6');this[_0x29d2('0xa')]=![];this[_0x29d2('0xb')]=_['isNil'](_0x40def3[_0x29d2('0xc')])?undefined:_0x40def3['Agent'][_0x29d2('0x7')];this[_0x29d2('0xd')]=this['membername']?util[_0x29d2('0xe')](_0x29d2('0xf'),this[_0x29d2('0xb')]):_0x2bbdf1||undefined;this['calleridname']=checkNameSurname(_0x40def3[_0x29d2('0x10')][_0x29d2('0x11')],_0x40def3[_0x29d2('0x10')][_0x29d2('0x12')],_0x40def3['Contact']['lastName']);this['active']=_0x40def3[_0x29d2('0x13')]||![];this[_0x29d2('0x14')]=_0x40def3[_0x29d2('0x10')][_0x29d2('0x11')];this[_0x29d2('0x15')]=_0x40def3['scheduledat'];this['countbusyretry']=_0x40def3['countbusyretry']||0x0;this[_0x29d2('0x16')]=_0x40def3['countcongestionretry']||0x0;this['countnoanswerretry']=_0x40def3[_0x29d2('0x17')]||0x0;this[_0x29d2('0x18')]=(_0x40def3[_0x29d2('0x19')]||0x0)+(_0x40def3[_0x29d2('0x16')]||0x0)+(_0x40def3[_0x29d2('0x17')]||0x0);this[_0x29d2('0x1a')]=_0x40def3[_0x29d2('0x1a')];this[_0x29d2('0x1b')]=_0x40def3['callbackuniqueid'];this[_0x29d2('0x1c')]=_0x40def3[_0x29d2('0x1c')];this[_0x29d2('0x1d')]=_0x40def3[_0x29d2('0x1d')];this[_0x29d2('0x1e')]=_0x40def3[_0x29d2('0x1e')];this[_0x29d2('0x1f')]=_0x40def3[_0x29d2('0x1f')];this[_0x29d2('0x20')]=_[_0x29d2('0x3')](_0x40def3[_0x29d2('0xc')])?_0x40def3[_0x29d2('0x20')]:_0x40def3[_0x29d2('0xc')]['id'];this[_0x29d2('0x21')]=_0x40def3[_0x29d2('0x21')];this[_0x29d2('0x22')]='';this['originatecalleridname']='';}Action[_0x29d2('0x23')][_0x29d2('0x24')]=function(){return util[_0x29d2('0xe')](_0x29d2('0x25'),this[_0x29d2('0x26')],this['number']);};module[_0x29d2('0x27')]=Action; \ No newline at end of file +var _0x3ba4=['string','isNil','uniqueid','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','active','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','lodash','moment'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x3ba4,0x1e8));var _0x43ba=function(_0x19e5a8,_0x4986cf){_0x19e5a8=_0x19e5a8-0x0;var _0x20d283=_0x3ba4[_0x19e5a8];return _0x20d283;};'use strict';var util=require('util');var _=require(_0x43ba('0x0'));var moment=require(_0x43ba('0x1'));function checkNameSurname(_0x3bdfd5,_0x5acb1d,_0x45f7ca){var _0x590772='';if(!_['isNil'](_0x5acb1d)&&_0x43ba('0x2')===typeof _0x5acb1d){_0x590772+=_0x5acb1d;}if(!_[_0x43ba('0x3')](_0x45f7ca)&&_0x43ba('0x2')===typeof _0x45f7ca){_0x590772+='\x20'+_0x45f7ca;}if(_0x590772!==''){return _0x590772;}return _0x3bdfd5;}function Action(_0x1ea0fc,_0x4a4621,_0x2951d0,_0x92c38f,_0x24b467){this[_0x43ba('0x4')]=_0x2951d0||undefined;this['idContact']=_0x1ea0fc['id'];this['queue']=_0x4a4621[_0x43ba('0x5')];this['type']=_0x4a4621[_0x43ba('0x6')];this[_0x43ba('0x7')]=_0x43ba('0x8');this[_0x43ba('0x9')]=![];this[_0x43ba('0xa')]=_['isNil'](_0x1ea0fc[_0x43ba('0xb')])?undefined:_0x1ea0fc[_0x43ba('0xb')]['name'];this[_0x43ba('0xc')]=this[_0x43ba('0xa')]?util[_0x43ba('0xd')](_0x43ba('0xe'),this[_0x43ba('0xa')]):_0x92c38f||undefined;this[_0x43ba('0xf')]=checkNameSurname(_0x1ea0fc['Contact'][_0x43ba('0x10')],_0x1ea0fc[_0x43ba('0x11')]['firstName'],_0x1ea0fc[_0x43ba('0x11')]['lastName']);this[_0x43ba('0x12')]=_0x1ea0fc[_0x43ba('0x12')]||![];this['calleridnum']=_0x1ea0fc['Contact']['phone'];this['scheduledat']=_0x1ea0fc['scheduledat'];this[_0x43ba('0x13')]=_0x1ea0fc['countbusyretry']||0x0;this['countcongestionretry']=_0x1ea0fc[_0x43ba('0x14')]||0x0;this[_0x43ba('0x15')]=_0x1ea0fc[_0x43ba('0x15')]||0x0;this[_0x43ba('0x16')]=(_0x1ea0fc['countbusyretry']||0x0)+(_0x1ea0fc[_0x43ba('0x14')]||0x0)+(_0x1ea0fc[_0x43ba('0x15')]||0x0);this[_0x43ba('0x17')]=_0x1ea0fc[_0x43ba('0x17')];this['callbackuniqueid']=_0x1ea0fc['callbackuniqueid'];this[_0x43ba('0x18')]=_0x1ea0fc['callbackat'];this[_0x43ba('0x19')]=_0x1ea0fc['recallme'];this['ContactId']=_0x1ea0fc['ContactId'];this[_0x43ba('0x1a')]=_0x1ea0fc[_0x43ba('0x1a')];this[_0x43ba('0x1b')]=_['isNil'](_0x1ea0fc['Agent'])?_0x1ea0fc['UserId']:_0x1ea0fc[_0x43ba('0xb')]['id'];this[_0x43ba('0x1c')]=_0x1ea0fc['VoiceQueueId'];this[_0x43ba('0x1d')]='';this[_0x43ba('0x1e')]='';}Action[_0x43ba('0x1f')][_0x43ba('0x20')]=function(){return util[_0x43ba('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x43ba('0x21')]);};module[_0x43ba('0x22')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 677d7ab..57a2094 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 _0x8a30=['prototype','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumDuration','talking','total','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','voice_queue:save','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','dialMethod','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','stringify','pTalking:\x20','pick','UserId','ListId','Action','status','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','hasOwnProperty','agentReadyId','getDiff','scheduledat','dialRecallMeTimeout','run','[RecallMe]','starttime','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','logger2','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','outboundAnswerCallsDay','[16]','Answer','crateCustomerReportQueue','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','scheduledAt','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','phone','Contact\x20is\x20undefined','lookAgent','execCall','then','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','createHistory','SIP/%s','reachable','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','VoiceQueueId','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','Contact','substring','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','merge','toLowerVariables','variablesAction','[originateFailure][logOriginateFailure]','channel','logLookAgent','isFailure','response','rejected','callProgressDetectingAgent','syncHangup','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','transfer','[syncHangup][talking][transfer]','addVariable','variables','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','redis','localhost','socket.io-emitter'];(function(_0x54dc7b,_0x592c0f){var _0x4711ee=function(_0x1f4b65){while(--_0x1f4b65){_0x54dc7b['push'](_0x54dc7b['shift']());}};_0x4711ee(++_0x592c0f);}(_0x8a30,0x121));var _0x08a3=function(_0x341854,_0x17e001){_0x341854=_0x341854-0x0;var _0xc7c059=_0x8a30[_0x341854];return _0xc7c059;};'use strict';var util=require(_0x08a3('0x0'));var _=require(_0x08a3('0x1'));var BPromise=require(_0x08a3('0x2'));var uuid=require(_0x08a3('0x3'));var moment=require(_0x08a3('0x4'));var md5=require(_0x08a3('0x5'));var Redis=require(_0x08a3('0x6'));var config=require(_0x08a3('0x7'));var logger=require(_0x08a3('0x8'))(_0x08a3('0x9'));var loggerAction=require(_0x08a3('0x8'))(_0x08a3('0xa'));var ami=require(_0x08a3('0xb'));var rpcDb=require(_0x08a3('0xc'));var Action=require(_0x08a3('0xd'));var ut=require('./util/util');config[_0x08a3('0xe')]=_['defaults'](config[_0x08a3('0xe')],{'host':_0x08a3('0xf'),'port':0x18eb});var io=require(_0x08a3('0x10'))(new Redis(config[_0x08a3('0xe')]));var Sequence=function(){};Sequence[_0x08a3('0x11')][_0x08a3('0x12')]=function(_0x43436e){this[_0x08a3('0x13')]=this[_0x08a3('0x13')]?this[_0x08a3('0x13')][_0x08a3('0x14')](_0x43436e):_0x43436e();};function Preview(_0x28c531){this['sequence']=new Sequence();this[_0x08a3('0x15')]=_0x28c531['voiceQueues'];this[_0x08a3('0x16')]=_0x28c531[_0x08a3('0x16')];this[_0x08a3('0x17')]={};this[_0x08a3('0x18')]=_0x28c531['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x08a3('0x19'),this[_0x08a3('0x1a')][_0x08a3('0x1b')](this));ami['on'](_0x08a3('0x1c'),this['syncHangup'][_0x08a3('0x1b')](this));ami['on'](_0x08a3('0x1d'),this[_0x08a3('0x1e')]['bind'](this));ami['on'](_0x08a3('0x1f'),this[_0x08a3('0x20')][_0x08a3('0x1b')](this));ami['on']('newexten',this[_0x08a3('0x21')][_0x08a3('0x1b')](this));ami['on']('varset',this[_0x08a3('0x22')][_0x08a3('0x1b')](this));ami['on']('attendedtransfer',this[_0x08a3('0x23')][_0x08a3('0x1b')](this));ami['on'](_0x08a3('0x24'),this[_0x08a3('0x25')][_0x08a3('0x1b')](this));this[_0x08a3('0x26')](this['campaignsPreview']);}function emit(_0x51e396,_0x1089dd,_0x2fe568){io['to'](_0x51e396)[_0x08a3('0x27')](_0x1089dd,_0x2fe568);}function emitCampaignPreview(_0xd3d677){if(_0xd3d677[_0x08a3('0x28')]===_0x08a3('0x29')){var _0x53d15f={'id':_0xd3d677['id'],'name':_0xd3d677[_0x08a3('0x2a')],'strategy':_0xd3d677[_0x08a3('0x2b')],'answered':_0xd3d677[_0x08a3('0x2c')],'available':_0xd3d677['available'],'loggedIn':_0xd3d677[_0x08a3('0x2d')],'pTalking':_0xd3d677[_0x08a3('0x2e')],'sumBillable':_0xd3d677['sumBillable'],'sumDuration':_0xd3d677[_0x08a3('0x2f')],'sumHoldTime':_0xd3d677['sumHoldTime']||0x0,'talking':_0xd3d677[_0x08a3('0x30')],'total':_0xd3d677[_0x08a3('0x31')],'type':_0xd3d677[_0x08a3('0x28')],'unmanaged':_0xd3d677['unmanaged'],'abandoned':_0xd3d677['abandoned'],'waiting':_0xd3d677[_0x08a3('0x32')],'loggedInDb':_0xd3d677['loggedInDb'],'dialActive':_0xd3d677[_0x08a3('0x33')],'dialMethod':_0xd3d677['dialMethod'],'dialOriginateCallerIdName':_0xd3d677[_0x08a3('0x34')],'dialOriginateCallerIdNumber':_0xd3d677[_0x08a3('0x35')],'dialOriginateTimeout':_0xd3d677[_0x08a3('0x36')],'dialPrefix':_0xd3d677['dialPrefix'],'outboundAnswerAgiCallsDay':_0xd3d677[_0x08a3('0x37')],'outboundAnswerCallsDay':_0xd3d677['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xd3d677[_0x08a3('0x38')],'outboundBusyCallsDay':_0xd3d677[_0x08a3('0x39')],'outboundCongestionCallsDay':_0xd3d677[_0x08a3('0x3a')],'outboundDropCallsDayACS':_0xd3d677[_0x08a3('0x3b')],'outboundDropCallsDayCallersExit':_0xd3d677['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xd3d677[_0x08a3('0x3c')],'outboundNoAnswerCallsDay':_0xd3d677['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xd3d677['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xd3d677[_0x08a3('0x3d')],'outboundReCallsDay':_0xd3d677[_0x08a3('0x3e')],'outboundRejectCallsDay':_0xd3d677[_0x08a3('0x3f')],'outboundUnknownCallsDay':_0xd3d677['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xd3d677[_0x08a3('0x40')],'predictiveIntervalAvgHoldtime':_0xd3d677[_0x08a3('0x41')],'predictiveIntervalAvgTalktime':_0xd3d677['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xd3d677['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xd3d677['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xd3d677[_0x08a3('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0xd3d677['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xd3d677[_0x08a3('0x43')],'predictiveIntervalMultiplicativeFactor':_0xd3d677[_0x08a3('0x44')],'predictiveIntervalPauses':_0xd3d677[_0x08a3('0x45')],'predictiveIntervalAvailable':_0xd3d677[_0x08a3('0x46')],'predictiveIntervalTotalCalls':_0xd3d677[_0x08a3('0x47')],'message':_0xd3d677['message'],'originated':_0xd3d677['originated'],'erlangCalls':_0xd3d677['erlangCalls'],'erlangCallToSecond':_0xd3d677[_0x08a3('0x48')],'erlangAbandonmentRate':_0xd3d677[_0x08a3('0x49')],'erlangBusyFactor':_0xd3d677[_0x08a3('0x4a')],'startPredictive':_0xd3d677[_0x08a3('0x4b')],'startProgressive':_0xd3d677[_0x08a3('0x4c')]};if(_0xd3d677[_0x08a3('0x4d')]){_0x53d15f[_0x08a3('0x4d')]={'id':_0xd3d677['Trunk']['id'],'name':_0xd3d677['Trunk']['name'],'active':_0xd3d677[_0x08a3('0x4d')][_0x08a3('0x4e')],'callerid':_0xd3d677['Trunk'][_0x08a3('0x4f')]};}if(_0xd3d677['Interval']){_0x53d15f[_0x08a3('0x50')]={'id':_0xd3d677['Interval']['id'],'name':_0xd3d677[_0x08a3('0x50')]['name']};}var _0x12d995=md5(JSON['stringify'](_0x53d15f));if(_0xd3d677[_0x08a3('0x5')]!==_0x12d995){_0xd3d677[_0x08a3('0x5')]=_0x12d995;emit(util['format']('voice:queue:%s',_0x53d15f[_0x08a3('0x2a')]),_0x08a3('0x51'),_0x53d15f);}}}function emitVoiceQueueChannelRemove(_0x378038){emit(util[_0x08a3('0x52')](_0x08a3('0x53'),_0x378038['name']),_0x08a3('0x54'),_0x378038);}function notSendMessagesQueue(_0x1eec03){if(_0x1eec03[_0x08a3('0x55')]){if(_0x1eec03[_0x08a3('0x56')]===0x0&&_0x1eec03[_0x08a3('0x2e')]===0x0){_0x1eec03[_0x08a3('0x55')]=![];_0x1eec03['available']=0x0;_0x1eec03['paused']=0x0;_0x1eec03[_0x08a3('0x57')]=_0x08a3('0x58');ut[_0x08a3('0x59')](_0x08a3('0x5a'),_0x1eec03['name']+'\x20is\x20not\x20active');}else{_0x1eec03[_0x08a3('0x57')]=_0x08a3('0x5b');ut[_0x08a3('0x59')](_0x08a3('0x5a'),_0x1eec03[_0x08a3('0x2a')]+_0x08a3('0x5c'));}emitCampaignPreview(_0x1eec03);}}Preview[_0x08a3('0x11')][_0x08a3('0x26')]=function(){var _0x523b0c=this;setInterval(function(){_0x523b0c['syncCampaigns']();},0x7cf);};Preview[_0x08a3('0x11')][_0x08a3('0x5d')]=function(){var _0x2f9a1d=this[_0x08a3('0x15')];this[_0x08a3('0x5e')]+=0x1;for(var _0x38575c in _0x2f9a1d){if(_0x2f9a1d['hasOwnProperty'](_0x38575c)&&(_0x2f9a1d[_0x38575c][_0x08a3('0x5f')]===_0x08a3('0x9')||_0x2f9a1d[_0x38575c][_0x08a3('0x5f')]===_0x08a3('0x60'))&&_0x2f9a1d[_0x38575c][_0x08a3('0x28')]===_0x08a3('0x29')){if(this[_0x08a3('0x5e')]>0x7){this[_0x08a3('0x5e')]=0x0;this[_0x08a3('0x61')]();}}if(_0x2f9a1d['hasOwnProperty'](_0x38575c)&&_0x2f9a1d[_0x38575c]['dialMethod']===_0x08a3('0x9')&&_0x2f9a1d[_0x38575c]['type']===_0x08a3('0x29')){if(_0x2f9a1d[_0x38575c][_0x08a3('0x33')]){this[_0x08a3('0x62')](_0x2f9a1d[_0x38575c]);this[_0x08a3('0x63')](_0x2f9a1d[_0x38575c]);}else{notSendMessagesQueue(_0x2f9a1d[_0x38575c]);}}}};Preview[_0x08a3('0x11')][_0x08a3('0x64')]=function(_0x59ff87){var _0x1e9b05=this;this[_0x08a3('0x65')][_0x08a3('0x12')](function(){if(!_[_0x08a3('0x66')](_0x1e9b05['actions'][_0x59ff87])){loggerAction[_0x08a3('0x67')](_0x08a3('0x68'),_0x59ff87,_0x08a3('0x69'),_0x1e9b05['actions'][_0x59ff87][_0x08a3('0x6a')],'originated:\x20',JSON[_0x08a3('0x6b')](_0x1e9b05[_0x08a3('0x15')][_0x1e9b05['actions'][_0x59ff87]['queue']][_0x08a3('0x56')]),_0x08a3('0x6c'),JSON['stringify'](_0x1e9b05[_0x08a3('0x15')][_0x1e9b05[_0x08a3('0x17')][_0x59ff87][_0x08a3('0x6a')]][_0x08a3('0x2e')]),JSON[_0x08a3('0x6b')](_0x1e9b05['actions'][_0x59ff87]['dialAnswer']),JSON[_0x08a3('0x6b')](_[_0x08a3('0x6d')](_0x1e9b05[_0x08a3('0x17')][_0x59ff87],['contactId',_0x08a3('0x6e'),'VoiceQueueId',_0x08a3('0x6f')])));return ami[_0x08a3('0x70')]({'action':_0x08a3('0x71'),'channel':_0x1e9b05[_0x08a3('0x17')][_0x59ff87]['channel']})['catch'](function(_0x310dc9){if(_0x310dc9['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x1e9b05['actions'][_0x59ff87]){ut[_0x08a3('0x72')](_0x1e9b05[_0x08a3('0x15')][_0x1e9b05[_0x08a3('0x17')][_0x59ff87][_0x08a3('0x6a')]],_0x08a3('0x73'));if(_0x1e9b05[_0x08a3('0x17')][_0x59ff87][_0x08a3('0x74')]===!![]){ut[_0x08a3('0x75')](_0x1e9b05[_0x08a3('0x15')][_0x1e9b05[_0x08a3('0x17')][_0x59ff87][_0x08a3('0x6a')]],_0x08a3('0x73'));ut[_0x08a3('0x76')](_0x08a3('0x77')+_0x59ff87,_0x1e9b05[_0x08a3('0x17')][_0x59ff87]['queue']);}ut[_0x08a3('0x76')](_0x08a3('0x78')+_0x59ff87,_0x1e9b05[_0x08a3('0x17')][_0x59ff87][_0x08a3('0x6a')]);delete _0x1e9b05['actions'][_0x59ff87];}},0x2328);}});}});};Preview['prototype'][_0x08a3('0x61')]=function(){var _0x49ebbe=this;loggerAction['info'](_0x08a3('0x79'),_[_0x08a3('0x7a')](this[_0x08a3('0x17')]));for(var _0x4b0676 in this[_0x08a3('0x17')]){if(_0x49ebbe[_0x08a3('0x17')][_0x08a3('0x7b')](_0x4b0676)){_0x49ebbe[_0x08a3('0x64')](_0x4b0676);}}};Preview[_0x08a3('0x11')][_0x08a3('0x63')]=function(_0x44a84e){var _0x59143b=this;rpcDb['getContactRecallMe'](_0x44a84e['id'],ut[_0x08a3('0x7c')](this[_0x08a3('0x18')]))['then'](function(_0x288534){if(!_[_0x08a3('0x66')](_0x288534)){for(var _0x57614f=0x0;_0x57614f<_0x288534['length'];_0x57614f+=0x1){if(ut[_0x08a3('0x7d')](_0x288534[_0x57614f][_0x08a3('0x7e')])<_0x44a84e[_0x08a3('0x7f')]*0x3c){_0x59143b[_0x08a3('0x80')](_0x288534[_0x57614f]['id'])['then'](ut['logger2']('[RecallMe]'))['catch'](ut['logger2'](_0x08a3('0x81')));}else{var _0x1a3926=new Action(_0x288534[_0x57614f],_0x44a84e);_0x1a3926[_0x08a3('0x82')]=moment()[_0x08a3('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x44a84e[_0x08a3('0x3e')]+=0x1;ut['logCustomer'](_0x1a3926,0x17,'RecallInQueue');if(_0x44a84e[_0x08a3('0x83')]){rpcDb[_0x08a3('0x84')](ut[_0x08a3('0x85')](_0x288534[_0x57614f]));rpcDb[_0x08a3('0x86')](_0x1a3926,_0x08a3('0x87'));}else{ut[_0x08a3('0x88')](_0x1a3926,0x16,_0x08a3('0x89'));rpcDb[_0x08a3('0x86')](_0x1a3926,_0x08a3('0x8a'));rpcDb[_0x08a3('0x8b')](_0x1a3926,_0x08a3('0x8a'));}}}}})[_0x08a3('0x8c')](ut[_0x08a3('0x8d')]('[getContactRecallMe]'));};Preview[_0x08a3('0x11')][_0x08a3('0x62')]=function(_0x544f6d){_0x544f6d[_0x08a3('0x55')]=!![];if(ut[_0x08a3('0x8e')](_0x544f6d[_0x08a3('0x2d')])){_0x544f6d[_0x08a3('0x57')]=_0x08a3('0x8f');}else if(!ut[_0x08a3('0x90')](_0x544f6d[_0x08a3('0x33')])){_0x544f6d[_0x08a3('0x57')]=_0x08a3('0x58');}else if(!this['isTrunkReachable'](_0x544f6d['Trunk'])){if(!this[_0x08a3('0x91')](_0x544f6d[_0x08a3('0x92')])){_0x544f6d[_0x08a3('0x57')]=_0x08a3('0x93');}else{_0x544f6d[_0x08a3('0x57')]=_0x08a3('0x94');}}else{_0x544f6d[_0x08a3('0x57')]=_0x08a3('0x94');}emitCampaignPreview(_0x544f6d);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x5aa183,_0x2905f1,_0x1c5bef){var _0x20709c=this;var _0x56eab3=this[_0x08a3('0x17')][_0x2905f1];var _0x5696f7=this[_0x08a3('0x15')][_0x56eab3[_0x08a3('0x6a')]];var _0x4b5c77;if(_0x5696f7){switch(_0x1c5bef){case'1':_0x5696f7[_0x08a3('0x95')]+=0x1;_0x56eab3[_0x08a3('0x96')]=ut[_0x08a3('0x97')](_0x56eab3);ut['logCustomer'](_0x56eab3,0x0,_0x08a3('0x98'));rpcDb[_0x08a3('0x86')](_0x56eab3,_0x08a3('0x99'));if(ut[_0x08a3('0x97')](_0x56eab3)>=_0x5696f7[_0x08a3('0x9a')]){_0x4b5c77=ut[_0x08a3('0x9b')](_0x56eab3,0xf,_0x08a3('0x9c'));rpcDb[_0x08a3('0x8b')](_0x4b5c77,_0x08a3('0x9d'));}else{rpcDb[_0x08a3('0x8b')](_0x56eab3,_0x08a3('0x9d'));}delete this[_0x08a3('0x17')][_0x5aa183[_0x08a3('0x9e')]];break;case _0x08a3('0x9f'):var _0x360f3d=moment()[_0x08a3('0x52')](_0x08a3('0xa0'));_0x56eab3[_0x08a3('0xa1')]=_0x360f3d;_0x56eab3['answertime']=_0x360f3d;_0x56eab3[_0x08a3('0x74')]=!![];_0x5696f7[_0x08a3('0x2e')]+=0x1;logger['info'](_0x08a3('0xa2'),_0x56eab3[_0x08a3('0xa3')],_0x08a3('0xa4'),_0x5696f7[_0x08a3('0x2a')],'pTalking:\x20',_0x5696f7[_0x08a3('0x2e')]);ami[_0x08a3('0x27')](_0x08a3('0xa5'),ut['buildObj'](_0x56eab3,_0x08a3('0xa6')));if(_0x5696f7[_0x08a3('0xa7')]){ami[_0x08a3('0x27')](_0x08a3('0xa8'),ut[_0x08a3('0xa9')](_0x56eab3));}break;case'16':ami['emit'](_0x08a3('0xaa'),ut[_0x08a3('0xab')](_0x56eab3,_0x08a3('0xac')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x56eab3,_0x08a3('0xac')));_0x5696f7[_0x08a3('0xad')]+=0x1;_0x5696f7[_0x08a3('0x31')]+=0x1;_0x5696f7[_0x08a3('0x2c')]+=0x1;ut[_0x08a3('0x75')](_0x5696f7,_0x08a3('0xae'));_0x56eab3[_0x08a3('0x96')]=ut[_0x08a3('0x97')](_0x56eab3);ut[_0x08a3('0x88')](_0x56eab3,0x4,_0x08a3('0xaf'));rpcDb[_0x08a3('0x86')](_0x56eab3,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x08a3('0x8b')](_0x56eab3,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x08a3('0xb0')](_0x56eab3);_0x5696f7['sumDuration']+=_0x56eab3['talktime'];_0x5696f7[_0x08a3('0xb1')]+=_0x56eab3[_0x08a3('0xb2')];logger[_0x08a3('0x67')](_0x08a3('0xb3'),_0x56eab3[_0x08a3('0xa3')],_0x08a3('0xa4'),_0x5696f7[_0x08a3('0x2a')],_0x08a3('0x6c'),_0x5696f7[_0x08a3('0x2e')]);delete this[_0x08a3('0x17')][_0x5aa183['linkedid']];break;case _0x08a3('0xb4'):_0x5696f7['outboundBusyCallsDay']+=0x1;_0x56eab3[_0x08a3('0xb5')]+=0x1;_0x56eab3[_0x08a3('0x96')]=ut[_0x08a3('0x97')](_0x56eab3);ut[_0x08a3('0x88')](_0x56eab3,0x5,_0x08a3('0xb6'));rpcDb[_0x08a3('0x86')](_0x56eab3,_0x08a3('0xb7'));if(ut[_0x08a3('0x97')](_0x56eab3)>=_0x5696f7[_0x08a3('0x9a')]){_0x4b5c77=ut[_0x08a3('0x9b')](_0x56eab3,0xf,_0x08a3('0x9c'));rpcDb[_0x08a3('0x8b')](_0x4b5c77,_0x08a3('0xb8'));}else{if(_0x56eab3['countbusyretry']>=_0x5696f7[_0x08a3('0xb9')]){rpcDb['createCustomerFinal'](_0x56eab3,_0x08a3('0xb7'));}else{rpcDb[_0x08a3('0xba')](ut['scheduledAt'](_0x56eab3,_0x08a3('0xb5'),_0x5696f7[_0x08a3('0xbb')]),_0x56eab3[_0x08a3('0xbc')],_0x56eab3[_0x08a3('0xbd')]);}}break;case _0x08a3('0xbe'):_0x5696f7[_0x08a3('0xbf')]+=0x1;_0x56eab3[_0x08a3('0xc0')]+=0x1;_0x56eab3[_0x08a3('0x96')]=ut[_0x08a3('0x97')](_0x56eab3);ut[_0x08a3('0x88')](_0x56eab3,0x3,_0x08a3('0xc1'));rpcDb[_0x08a3('0x86')](_0x56eab3,_0x08a3('0xc2'));if(ut['totalGlobal'](_0x56eab3)>=_0x5696f7['dialGlobalMaxRetry']){_0x4b5c77=ut['cloneAction'](_0x56eab3,0xf,_0x08a3('0x9c'));rpcDb['createCustomerFinal'](_0x4b5c77,_0x08a3('0xc3'));}else{if(_0x56eab3[_0x08a3('0xc0')]>=_0x5696f7[_0x08a3('0xc4')]){rpcDb[_0x08a3('0x8b')](_0x56eab3,_0x08a3('0xc2'));}else{rpcDb[_0x08a3('0xba')](ut[_0x08a3('0xc5')](_0x56eab3,_0x08a3('0xc0'),_0x5696f7[_0x08a3('0xc6')]),_0x56eab3[_0x08a3('0xbc')],_0x56eab3[_0x08a3('0xbd')]);}}break;case _0x08a3('0xc7'):_0x5696f7[_0x08a3('0x3a')]+=0x1;_0x56eab3[_0x08a3('0xc8')]+=0x1;_0x56eab3['countglobal']=ut[_0x08a3('0x97')](_0x56eab3);ut[_0x08a3('0x88')](_0x56eab3,0x8,_0x08a3('0xc9'));rpcDb['createCustomerHistory'](_0x56eab3,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x56eab3)>=_0x5696f7[_0x08a3('0x9a')]){_0x4b5c77=ut[_0x08a3('0x9b')](_0x56eab3,0xf,_0x08a3('0x9c'));rpcDb[_0x08a3('0x8b')](_0x4b5c77,_0x08a3('0xca'));}else{if(_0x56eab3[_0x08a3('0xc8')]>=_0x5696f7[_0x08a3('0xcb')]){rpcDb[_0x08a3('0x8b')](_0x56eab3,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x08a3('0xba')](ut[_0x08a3('0xc5')](_0x56eab3,_0x08a3('0xc8'),_0x5696f7['dialBusyRetryFrequency']),_0x56eab3[_0x08a3('0xbc')],_0x56eab3[_0x08a3('0xbd')]);}}break;case _0x08a3('0xcc'):_0x5696f7[_0x08a3('0x3f')]+=0x1;_0x56eab3[_0x08a3('0x96')]=ut['totalGlobal'](_0x56eab3);ut[_0x08a3('0x88')](_0x56eab3,0x14,'AgentReject');rpcDb['createCustomerHistory'](_0x56eab3,_0x08a3('0xcd'));if(_0x56eab3['unlockAgent']){rpcDb[_0x08a3('0xce')](_0x56eab3[_0x08a3('0xcf')]);}if(_0x56eab3[_0x08a3('0xbd')]){rpcDb[_0x08a3('0xd0')](_0x56eab3['idContact']);}break;default:if(_0x56eab3[_0x08a3('0x74')]){ut['decrementTalkink'](_0x5696f7,_0x08a3('0xd1'));ut['loggerError'](_0x08a3('0xd2')+_0x5696f7[_0x08a3('0x2a')],_0x5aa183);}_0x5696f7[_0x08a3('0xd3')]+=0x1;_0x56eab3[_0x08a3('0x96')]=ut[_0x08a3('0x97')](_0x56eab3);ut[_0x08a3('0x88')](_0x56eab3,0xc,_0x5aa183[_0x08a3('0xd4')]||_0x5aa183[_0x08a3('0xd5')]);rpcDb[_0x08a3('0x86')](_0x56eab3,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x56eab3)>=_0x5696f7[_0x08a3('0x9a')]){_0x4b5c77=ut[_0x08a3('0x9b')](_0x56eab3,0xf,'Global');rpcDb['createCustomerFinal'](_0x4b5c77,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x56eab3,_0x08a3('0xd6'));}delete this[_0x08a3('0x17')][_0x5aa183[_0x08a3('0x9e')]];}if(!(_0x56eab3['dialAnswer']&&_0x1c5bef==='16')){ut['updateOriginated'](_0x5696f7,_0x08a3('0xd7'));logger[_0x08a3('0x67')](_0x08a3('0xd8'),_0x56eab3['uniqueid'],_0x08a3('0xa4'),_0x5696f7[_0x08a3('0x2a')],_0x08a3('0xd9'),_0x5696f7['originated']);}if(_0x1c5bef!==_0x08a3('0x9f')){delete this[_0x08a3('0x17')][_0x5aa183[_0x08a3('0x9e')]];delete this[_0x08a3('0x17')][_0x5aa183[_0x08a3('0xda')]];}}};Preview[_0x08a3('0x11')]['callProgressDetectingAgent']=function(_0x543746,_0x5e66a1,_0x170cd8){if(_[_0x08a3('0xdb')](_0x5e66a1)&&_0x08a3('0xdc')!==typeof _0x5e66a1){return;}if(_[_0x08a3('0xdb')](_0x170cd8)&&_0x08a3('0xdc')!==typeof _0x170cd8){return;}switch(_0x170cd8['reason']){case'0':ut['logAgent'](_0x543746,0x0,_0x08a3('0x98'));rpcDb[_0x08a3('0xdd')](_0x543746,_0x08a3('0xde'));break;case'3':ut[_0x08a3('0xdf')](_0x543746,0x3,_0x08a3('0xc1'));rpcDb[_0x08a3('0xdd')](_0x543746,_0x08a3('0xe0'));break;case'5':ut[_0x08a3('0xdf')](_0x543746,0x5,_0x08a3('0xb6'));rpcDb[_0x08a3('0xdd')](_0x543746,_0x08a3('0xe1'));break;case'8':ut[_0x08a3('0xdf')](_0x543746,0x8,'Congestion');rpcDb[_0x08a3('0xdd')](_0x543746,_0x08a3('0xe2'));break;case'22':ut[_0x08a3('0xdf')](_0x543746,0x16,_0x08a3('0xe3'));rpcDb[_0x08a3('0xdd')](_0x543746,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x543746,0xc,_0x170cd8['reason']);rpcDb[_0x08a3('0xdd')](_0x543746,_0x08a3('0xe2'));}ut[_0x08a3('0x72')](_0x5e66a1,_0x08a3('0xe4'));logger[_0x08a3('0x67')](_0x08a3('0xe5'),_0x543746[_0x08a3('0xa3')],_0x08a3('0xa4'),_0x5e66a1['name'],_0x08a3('0xd9'),_0x5e66a1[_0x08a3('0x56')]);delete this[_0x08a3('0x17')][_0x543746[_0x08a3('0xa3')]];};Preview[_0x08a3('0x11')]['checkInBlack']=function(_0x44cea8,_0x20a190,_0x36b0f5,_0x6e3ce6,_0x180635){var _0x5cb0ed=this;return new BPromise(function(_0x530bda,_0x50b089){if(_[_0x08a3('0x66')](_0x20a190)||_[_0x08a3('0x66')](_0x20a190['Contact'])||_['isNil'](_0x20a190['Contact'][_0x08a3('0xe6')])||_[_0x08a3('0x66')](_0x20a190['VoiceQueueId'])){_0x50b089(ut[_0x08a3('0x57')](_0x08a3('0xe7'),_0x6e3ce6,_0x180635));return;}var _0x31cb59=uuid['v4']();var _0x5b3dd9=_0x5cb0ed[_0x08a3('0x15')][_0x20a190[_0x08a3('0x69')][_0x08a3('0x2a')]];var _0x133aea=_0x36b0f5?_0x5cb0ed['agents'][_0x36b0f5]['id']:undefined;_0x5cb0ed[_0x08a3('0x17')][_0x31cb59]=new Action(_0x20a190,_0x5b3dd9,_0x31cb59,_0x36b0f5,_0x133aea);var _0x3cb724=_0x5cb0ed[_0x08a3('0x17')][_0x31cb59];_0x3cb724[_0x08a3('0xbc')]=_0x6e3ce6;_0x3cb724[_0x08a3('0xbd')]=_0x180635;_0x3cb724[_0x08a3('0xe8')]=_0x36b0f5;if(_['isEmpty'](_0x44cea8)){_0x5cb0ed[_0x08a3('0xe9')](_0x3cb724,_0x5b3dd9,_0x20a190,_0x36b0f5)[_0x08a3('0xea')](function(_0x1cd7b9){logger[_0x08a3('0x67')](_0x08a3('0xeb'),_0x08a3('0xec')+_0x3cb724[_0x08a3('0x6a')]+'\x20IdHopper:\x20'+_0x3cb724[_0x08a3('0xcf')],JSON[_0x08a3('0x6b')](_0x1cd7b9));ami[_0x08a3('0x27')](_0x08a3('0xed'),ut['buildObj'](_0x3cb724,_0x08a3('0xee')));_0x530bda(ut[_0x08a3('0x57')]('Calling'));})[_0x08a3('0x8c')](function(_0x61c125){ut[_0x08a3('0x59')](_0x08a3('0xef'),_0x61c125);_0x50b089(ut[_0x08a3('0x57')]('Call\x20failed',_0x6e3ce6,_0x180635));});}else{_0x5b3dd9['outboundBlacklistCallsDay']+=0x1;ut[_0x08a3('0xf0')](_0x3cb724);rpcDb[_0x08a3('0xf1')](_0x3cb724,'[Blacklist][error]');delete _0x5cb0ed[_0x08a3('0x17')][_0x31cb59];_0x50b089(ut[_0x08a3('0x57')]('Contact\x20in\x20black\x20List',_0x6e3ce6,_0x180635));}});};Preview[_0x08a3('0x11')][_0x08a3('0x91')]=function(_0x29ad34){return!_[_0x08a3('0x66')](_0x29ad34)&&!_[_0x08a3('0x66')](_0x29ad34[_0x08a3('0x2a')])&&!_['isNil'](_0x29ad34[_0x08a3('0x4e')])&&_0x29ad34[_0x08a3('0x4e')]&&!_['isNil'](this[_0x08a3('0x16')][util[_0x08a3('0x52')](_0x08a3('0xf2'),_0x29ad34['name'])])&&!_[_0x08a3('0x66')](this[_0x08a3('0x16')][util['format'](_0x08a3('0xf2'),_0x29ad34['name'])][_0x08a3('0x71')])&&(this[_0x08a3('0x16')][util[_0x08a3('0x52')](_0x08a3('0xf2'),_0x29ad34[_0x08a3('0x2a')])]['status']===_0x08a3('0xf3')||this['trunks'][util[_0x08a3('0x52')]('SIP/%s',_0x29ad34[_0x08a3('0x2a')])][_0x08a3('0x71')]==='unmonitored');};Preview[_0x08a3('0x11')][_0x08a3('0x80')]=function(_0x1efd0c,_0x51a884){var _0x346075=this;return new BPromise(function(_0x31d22f,_0x3eec65){_0x346075[_0x08a3('0xf4')](_0x1efd0c,_0x51a884)[_0x08a3('0xea')](function(_0xdfee34){_0x31d22f(_['pick'](_0xdfee34,[_0x08a3('0x57')]));})['catch'](function(_0x24e97f){if(_0x24e97f[_0x08a3('0xf5')]){rpcDb['unlockContact'](_0x1efd0c);}if(_0x24e97f[_0x08a3('0x4e')]){rpcDb[_0x08a3('0xd0')](_0x1efd0c);}_0x3eec65(_[_0x08a3('0x6d')](_0x24e97f,[_0x08a3('0x57')]));});});};Preview['prototype'][_0x08a3('0xf4')]=function(_0x1c2536,_0x14657f){var _0x4cb63f=this;return new BPromise(function(_0x27509f,_0x323810){var _0x4a2b08,_0x5060f4;rpcDb[_0x08a3('0xf6')](_0x1c2536)['then'](function(_0xa634ad){if(!_[_0x08a3('0x66')](_0xa634ad[0x0])){_0x5060f4=_0xa634ad[0x0]['recallme']?![]:!![];_0x4a2b08=_0xa634ad[0x0][_0x08a3('0xf7')]?!![]:![];_0x4a2b08=_0x14657f?!![]:_0x4a2b08;}var _0x2b84d0=_0x4cb63f[_0x08a3('0xf8')](_0xa634ad);if(_0x2b84d0[_0x08a3('0xf9')]){rpcDb[_0x08a3('0xfa')](_[_0x08a3('0x6d')](_0xa634ad[0x0],[_0x08a3('0xfb'),_0x08a3('0xfc')]))[_0x08a3('0xea')](function(_0x3600c1){_0x4cb63f[_0x08a3('0xfd')](_0x3600c1,_0xa634ad[0x0],_0x14657f,_0x5060f4,_0x4a2b08)[_0x08a3('0xea')](function(_0x273737){_0x27509f(_0x273737);})[_0x08a3('0x8c')](function(_0x195b83){_0x323810(_0x195b83);});})[_0x08a3('0x8c')](function(_0x4713e7){ut[_0x08a3('0x59')](_0x08a3('0xfe'),_0x4713e7);_0x323810(ut[_0x08a3('0x57')](_0x08a3('0xff'),_0x5060f4,_0x4a2b08));});}else{_0x323810(ut[_0x08a3('0x57')](_0x2b84d0['message'],_0x5060f4,_0x4a2b08));}})[_0x08a3('0x8c')](function(_0x1be3a9){ut[_0x08a3('0x59')](_0x08a3('0x100'),_0x1be3a9);_0x323810(ut[_0x08a3('0x57')](_0x08a3('0xff'),![],!![]));});});};Preview[_0x08a3('0x11')][_0x08a3('0xf8')]=function(_0x121775){if(_[_0x08a3('0x66')](_0x121775)||_['isEmpty'](_0x121775)||!_[_0x08a3('0x66')](_0x121775[0x0]['Agent'])&&_[_0x08a3('0x66')](_0x121775[0x0][_0x08a3('0x101')][_0x08a3('0x2a')])){ut[_0x08a3('0x59')]('[Preview][validateContact][Empty\x20Contact]',_0x121775);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x51b4ec=this[_0x08a3('0x15')][_0x121775[0x0]['Queue']['name']];_0x51b4ec['message']=_0x08a3('0x94');if(_[_0x08a3('0x66')](_0x51b4ec)){ut['logger'](_0x08a3('0x102'),_0x51b4ec);return{'isValid':![],'message':_0x08a3('0x103')};}if(!this[_0x08a3('0x91')](_0x51b4ec[_0x08a3('0x4d')])){ut[_0x08a3('0x59')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x08a3('0x104')+_0x51b4ec['name']+_0x08a3('0x105'));if(!this['isTrunkReachable'](_0x51b4ec[_0x08a3('0x92')])){ut[_0x08a3('0x59')](_0x08a3('0x106'),_0x51b4ec[_0x08a3('0x2a')]+_0x08a3('0x107'));return{'isValid':![],'message':_0x08a3('0x108')};}}if(!ut[_0x08a3('0x90')](_0x51b4ec[_0x08a3('0x33')])){ut[_0x08a3('0x59')](_0x08a3('0x109'),_0x51b4ec[_0x08a3('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x08a3('0x104')+_0x51b4ec['name']+_0x08a3('0x10a')};}return{'isValid':!![],'message':_0x08a3('0x10b')};};Preview[_0x08a3('0x11')][_0x08a3('0xe9')]=function(_0x1f67cf,_0xef4fad,_0x34ccb7,_0x50934f){var _0x1110a0=this;return new BPromise(function(_0x189a0e,_0x412280){var _0x187e82=_0x1f67cf[_0x08a3('0xa3')];var _0x26b420=_0x1110a0[_0x08a3('0x91')](_0xef4fad[_0x08a3('0x4d')])?util[_0x08a3('0x52')](_0x08a3('0x10c'),_0xef4fad['Trunk'][_0x08a3('0x2a')],_[_0x08a3('0x66')](_0xef4fad[_0x08a3('0x10d')])?'':_0xef4fad[_0x08a3('0x10d')]['trim']()||'',_0xef4fad[_0x08a3('0x10e')]>0x0?_0x34ccb7[_0x08a3('0x10f')][_0x08a3('0xe6')][_0x08a3('0x110')](_0xef4fad[_0x08a3('0x10e')]):_0x34ccb7[_0x08a3('0x10f')][_0x08a3('0xe6')]):util['format']('SIP/%s/%s%s',_['isNil'](_0xef4fad[_0x08a3('0x92')])?_0xef4fad['Trunk'][_0x08a3('0x2a')]:_0xef4fad['TrunkBackup'][_0x08a3('0x2a')],_['isNil'](_0xef4fad[_0x08a3('0x10d')])?'':_0xef4fad[_0x08a3('0x10d')]['trim']()||'',_0xef4fad[_0x08a3('0x10e')]>0x0?_0x34ccb7[_0x08a3('0x10f')][_0x08a3('0xe6')]['substring'](_0xef4fad[_0x08a3('0x10e')]):_0x34ccb7[_0x08a3('0x10f')]['phone']);var _0xc2a065=_0x1110a0[_0x08a3('0x91')](_0xef4fad[_0x08a3('0x4d')])?ut['getCallerId'](_0xef4fad[_0x08a3('0x4d')][_0x08a3('0x4f')],_0xef4fad['dialOriginateCallerIdName'],_0xef4fad[_0x08a3('0x111')]>0x0?ut['getCallerIdRandom'](_0xef4fad[_0x08a3('0x35')],_0xef4fad['dialRandomLastDigitCallerIdNumber']):_0xef4fad[_0x08a3('0x35')]):ut[_0x08a3('0x112')](_[_0x08a3('0x66')](_0xef4fad[_0x08a3('0x92')])?_0xef4fad[_0x08a3('0x4d')][_0x08a3('0x4f')]:_0xef4fad['TrunkBackup'][_0x08a3('0x4f')],_0xef4fad['dialOriginateCallerIdName'],_0xef4fad[_0x08a3('0x111')]>0x0?ut[_0x08a3('0x113')](_0xef4fad['dialOriginateCallerIdNumber'],_0xef4fad[_0x08a3('0x111')]):_0xef4fad[_0x08a3('0x35')]);if(_0xc2a065){_0x1f67cf[_0x08a3('0x114')]=ut[_0x08a3('0x115')](_0xc2a065);_0x1f67cf['originatecalleridnum']=ut['extractCalleridNumber'](_0xc2a065);}var _0x4e5a1d=ut['addVariables'](_0xef4fad,_0x34ccb7,_0x26b420,_0xc2a065,_0x187e82,_0x1f67cf);_[_0x08a3('0x116')](_0x1f67cf,ut[_0x08a3('0x117')](_0x4e5a1d));_0x1f67cf[_0x08a3('0x82')]=moment()[_0x08a3('0x52')](_0x08a3('0xa0'));ami[_0x08a3('0x70')](ut[_0x08a3('0x118')](_0x1f67cf,_0xef4fad,_0x4e5a1d,_0x1f67cf[_0x08a3('0xbd')],_0x50934f))[_0x08a3('0xea')](function(_0x2a497a){_0xef4fad[_0x08a3('0x56')]+=0x1;logger['info']('[originated][increment]',_0x187e82,'\x20Queue',_0xef4fad[_0x08a3('0x2a')],_0x08a3('0xd9'),_0xef4fad['originated']);_0x189a0e(_0x2a497a);})['catch'](function(_0x44f187){ut[_0x08a3('0xdf')](_0x1f67cf,0xe,'OriginateError');rpcDb[_0x08a3('0xdd')](_0x1f67cf,_0x08a3('0x119'));_0x412280(_0x44f187);});});};Preview[_0x08a3('0x11')][_0x08a3('0x21')]=function(_0x487f65){if(this[_0x08a3('0x17')][_0x487f65[_0x08a3('0x9e')]]){this['actions'][_0x487f65[_0x08a3('0x9e')]][_0x08a3('0x11a')]=_0x487f65[_0x08a3('0x11a')];}};Preview[_0x08a3('0x11')]['syncOriginateResponse']=function(_0x264230){var _0x5a3665=this;var _0x2229be=this[_0x08a3('0x17')][_0x264230['actionid']];if(_0x2229be){if(_0x2229be[_0x08a3('0xe8')]&&this['agents'][_0x2229be[_0x08a3('0xe8')]]){ut[_0x08a3('0x11b')](_0x2229be,this[_0x08a3('0x18')][_0x2229be[_0x08a3('0xe8')]][_0x08a3('0x2a')],this[_0x08a3('0x18')][_0x2229be[_0x08a3('0xe8')]]['id']);}var _0x2449a3=_['clone'](_0x2229be);_0x2449a3['responsetime']=moment()[_0x08a3('0x52')](_0x08a3('0xa0'));var _0x3c1ead=_0x5a3665['campaignsPreview'][_0x2229be['queue']];if(ut[_0x08a3('0x11c')](_0x264230[_0x08a3('0x11d')])){if(_0x2229be[_0x08a3('0xbc')]){rpcDb[_0x08a3('0xce')](_0x2229be[_0x08a3('0xcf')]);}if(_0x2229be[_0x08a3('0xbd')]){rpcDb[_0x08a3('0xd0')](_0x2229be[_0x08a3('0xcf')]);}ami[_0x08a3('0x27')]('custom:agentringnoanswer',ut[_0x08a3('0xab')](_0x2229be,_0x08a3('0x11e')));this[_0x08a3('0x11f')](_0x2449a3,_0x3c1ead,_0x264230);}else{_0x2229be['starttime']=moment()['format'](_0x08a3('0xa0'));ut[_0x08a3('0xdf')](_0x2449a3,0x4,_0x08a3('0xaf'));rpcDb[_0x08a3('0xdd')](_0x2449a3,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x08a3('0x11')][_0x08a3('0x120')]=function(_0x243ecf){var _0x275894=this;var _0x306a2c=this['actions'][_0x243ecf[_0x08a3('0x9e')]];var _0xe759a3;if(_0x306a2c){_0xe759a3=this['campaignsPreview'][_0x306a2c[_0x08a3('0x6a')]];logger[_0x08a3('0x67')](_0x08a3('0x121'),_0x243ecf[_0x08a3('0x9e')],_0x08a3('0xa4'),_0xe759a3[_0x08a3('0x2a')],_0x08a3('0x6c'),_0xe759a3[_0x08a3('0x2e')]);}if(this[_0x08a3('0x17')][_0x243ecf[_0x08a3('0x9e')]]&&_0x243ecf['linkedid']!==_0x243ecf[_0x08a3('0xa3')]){if(_0x243ecf[_0x08a3('0x122')]==='16'&&this['actions'][_0x243ecf['linkedid']]['dialAnswer']){this[_0x08a3('0x123')](_0x243ecf,_0x243ecf[_0x08a3('0x9e')],_0x243ecf[_0x08a3('0x122')]);}else if(this[_0x08a3('0x17')][_0x243ecf[_0x08a3('0x9e')]][_0x08a3('0x74')]){logger[_0x08a3('0x67')](_0x08a3('0x124'),_0x243ecf[_0x08a3('0x9e')],_0x243ecf[_0x08a3('0x122')],_0x08a3('0xa4'),_0xe759a3[_0x08a3('0x2a')],'pTalking:\x20',_0xe759a3[_0x08a3('0x2e')]);this[_0x08a3('0x123')](_0x243ecf,_0x243ecf[_0x08a3('0x9e')],_0x243ecf['cause']);}}else if(_0x306a2c&&_[_0x08a3('0x66')](_0x306a2c[_0x08a3('0x125')])&&_0xe759a3[_0x08a3('0x126')]&&_0x243ecf[_0x08a3('0x9e')]===_0x243ecf[_0x08a3('0xa3')]&&_[_0x08a3('0x66')](_0x243ecf[_0x08a3('0x127')])&&_0x243ecf['cause']==='16'&&_0x243ecf['channelstate']==='6'&&_['isUndefined'](_0x306a2c[_0x08a3('0x128')])){if(_0x306a2c['unlockAgent']){rpcDb['unlockContact'](_0x306a2c[_0x08a3('0xcf')]);}if(_0x306a2c['activeContact']){rpcDb['disableContact'](_0x306a2c[_0x08a3('0xcf')]);}_0x243ecf[_0x08a3('0x127')]='22';this[_0x08a3('0x11f')](_0x306a2c,_0xe759a3,_0x243ecf);}else if(_0x306a2c&&_0x306a2c[_0x08a3('0x128')]){if(_0x243ecf[_0x08a3('0x122')]==='16'&&this[_0x08a3('0x17')][_0x243ecf[_0x08a3('0x9e')]]['dialAnswer']){logger['info'](_0x08a3('0x129'),_0x243ecf['linkedid'],_0x243ecf['cause'],'\x20Queue',_0xe759a3['name'],_0x08a3('0x6c'),_0xe759a3['pTalking']);this[_0x08a3('0x123')](_0x243ecf,_0x243ecf[_0x08a3('0x9e')],_0x243ecf['cause']);}else if(this[_0x08a3('0x17')][_0x243ecf[_0x08a3('0x9e')]][_0x08a3('0x74')]){logger[_0x08a3('0x67')]('[syncHangup][talking][cause]',_0x243ecf['linkedid'],_0x243ecf[_0x08a3('0x122')],_0x08a3('0xa4'),_0xe759a3['name'],_0x08a3('0x6c'),_0xe759a3[_0x08a3('0x2e')]);this[_0x08a3('0x123')](_0x243ecf,_0x243ecf[_0x08a3('0x9e')],_0x243ecf['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x2a3c4e){if(this[_0x08a3('0x17')][_0x2a3c4e[_0x08a3('0xda')]]&&_0x2a3c4e[_0x08a3('0xda')]!==_0x2a3c4e['destuniqueid']){this[_0x08a3('0x123')](_0x2a3c4e,_0x2a3c4e[_0x08a3('0xda')],_0x2a3c4e[_0x08a3('0xd5')]);}};Preview['prototype'][_0x08a3('0x1e')]=function(_0x1d6381){if(this[_0x08a3('0x17')][_0x1d6381[_0x08a3('0x9e')]]&&_0x1d6381[_0x08a3('0x9e')]!==_0x1d6381[_0x08a3('0xa3')]&&!this[_0x08a3('0x17')][_0x1d6381['linkedid']]['dialAnswer']){if(_0x1d6381[_0x08a3('0x122')]==='1'){this[_0x08a3('0x123')](_0x1d6381,_0x1d6381[_0x08a3('0x9e')],_0x1d6381[_0x08a3('0x122')]);}}};Preview[_0x08a3('0x11')][_0x08a3('0x12a')]=function(_0x3961ee,_0x567a27,_0x7afe24){if(this[_0x08a3('0x17')][_0x3961ee]){if(_[_0x08a3('0x66')](this[_0x08a3('0x17')][_0x3961ee][_0x08a3('0x12b')])){this[_0x08a3('0x17')][_0x3961ee][_0x08a3('0x12b')]={};}this['actions'][_0x3961ee][_0x08a3('0x12b')][_0x567a27]=_0x7afe24;}};Preview[_0x08a3('0x11')][_0x08a3('0x22')]=function(_0x3685d4){try{if(!_[_0x08a3('0x66')](_0x3685d4)){if(ut['filterKey'](_[_0x08a3('0x12c')](_0x3685d4[_0x08a3('0x12d')])[0x0])){this[_0x08a3('0x12a')](_0x3685d4[_0x08a3('0xa3')],_[_0x08a3('0x12c')](_0x3685d4['variable'])[0x0],_0x3685d4[_0x08a3('0x12e')]);}}}catch(_0x5cd990){logger['error'](_0x08a3('0x12f'),util[_0x08a3('0x130')](_0x5cd990,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x08a3('0x23')]=function(_0x45926b){if(_0x45926b){if(this[_0x08a3('0x17')][_0x45926b[_0x08a3('0x131')]]){this[_0x08a3('0x17')][_0x45926b[_0x08a3('0x131')]][_0x08a3('0x128')]=!![];}}};Preview['prototype'][_0x08a3('0x25')]=function(_0x35e1bb){if(_0x35e1bb){if(this[_0x08a3('0x17')][_0x35e1bb['transfererlinkedid']]){this['actions'][_0x35e1bb['transfererlinkedid']][_0x08a3('0x128')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x6bda=['ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','logCustomer','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','idContact','disableContact','[default]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','createAgentHistory','NoAnswer','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','phone','substring','trim','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','[originated][increment]','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','dialend','newexten','syncNewExten','varset','syncVarSet','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','md5','voice_queue:save','format','voice:queue:%s','sendMessageOneNotActive','pTalking','paused','message','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','stringify','pick','contactId','VoiceQueueId'];(function(_0x56a434,_0x160af1){var _0x2e34ec=function(_0x3da52a){while(--_0x3da52a){_0x56a434['push'](_0x56a434['shift']());}};_0x2e34ec(++_0x160af1);}(_0x6bda,0xca));var _0xa6bd=function(_0x203527,_0x21b54f){_0x203527=_0x203527-0x0;var _0x40cbd8=_0x6bda[_0x203527];return _0x40cbd8;};'use strict';var util=require(_0xa6bd('0x0'));var _=require(_0xa6bd('0x1'));var BPromise=require(_0xa6bd('0x2'));var uuid=require('uuid');var moment=require(_0xa6bd('0x3'));var md5=require('md5');var Redis=require(_0xa6bd('0x4'));var config=require(_0xa6bd('0x5'));var logger=require(_0xa6bd('0x6'))(_0xa6bd('0x7'));var loggerAction=require(_0xa6bd('0x6'))(_0xa6bd('0x8'));var ami=require(_0xa6bd('0x9'));var rpcDb=require(_0xa6bd('0xa'));var Action=require(_0xa6bd('0xb'));var ut=require(_0xa6bd('0xc'));config[_0xa6bd('0xd')]=_[_0xa6bd('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6bd('0xd')]));var Sequence=function(){};Sequence[_0xa6bd('0xf')][_0xa6bd('0x10')]=function(_0x43a0d7){this[_0xa6bd('0x11')]=this[_0xa6bd('0x11')]?this['tail'][_0xa6bd('0x12')](_0x43a0d7):_0x43a0d7();};function Preview(_0x15f226){this[_0xa6bd('0x13')]=new Sequence();this[_0xa6bd('0x14')]=_0x15f226[_0xa6bd('0x15')];this['trunks']=_0x15f226['trunks'];this[_0xa6bd('0x16')]={};this[_0xa6bd('0x17')]=_0x15f226[_0xa6bd('0x17')];this[_0xa6bd('0x18')]=0x0;ami['on'](_0xa6bd('0x19'),this['syncOriginateResponse'][_0xa6bd('0x1a')](this));ami['on'](_0xa6bd('0x1b'),this[_0xa6bd('0x1c')][_0xa6bd('0x1a')](this));ami['on'](_0xa6bd('0x1d'),this['syncHangupRequest'][_0xa6bd('0x1a')](this));ami['on'](_0xa6bd('0x1e'),this['syncDialEnd'][_0xa6bd('0x1a')](this));ami['on'](_0xa6bd('0x1f'),this[_0xa6bd('0x20')][_0xa6bd('0x1a')](this));ami['on'](_0xa6bd('0x21'),this[_0xa6bd('0x22')][_0xa6bd('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xa6bd('0x1a')](this));ami['on']('blindtransfer',this[_0xa6bd('0x23')][_0xa6bd('0x1a')](this));this[_0xa6bd('0x24')](this[_0xa6bd('0x14')]);}function emit(_0x467758,_0x1c9db6,_0x1c9461){io['to'](_0x467758)['emit'](_0x1c9db6,_0x1c9461);}function emitCampaignPreview(_0xa493c9){if(_0xa493c9[_0xa6bd('0x25')]===_0xa6bd('0x26')){var _0x1a7d20={'id':_0xa493c9['id'],'name':_0xa493c9[_0xa6bd('0x27')],'strategy':_0xa493c9[_0xa6bd('0x28')],'answered':_0xa493c9[_0xa6bd('0x29')],'available':_0xa493c9[_0xa6bd('0x2a')],'loggedIn':_0xa493c9['loggedIn'],'pTalking':_0xa493c9['pTalking'],'sumBillable':_0xa493c9['sumBillable'],'sumDuration':_0xa493c9['sumDuration'],'sumHoldTime':_0xa493c9[_0xa6bd('0x2b')]||0x0,'talking':_0xa493c9[_0xa6bd('0x2c')],'total':_0xa493c9[_0xa6bd('0x2d')],'type':_0xa493c9[_0xa6bd('0x25')],'unmanaged':_0xa493c9['unmanaged'],'abandoned':_0xa493c9[_0xa6bd('0x2e')],'waiting':_0xa493c9[_0xa6bd('0x2f')],'loggedInDb':_0xa493c9[_0xa6bd('0x30')],'dialActive':_0xa493c9[_0xa6bd('0x31')],'dialMethod':_0xa493c9[_0xa6bd('0x32')],'dialOriginateCallerIdName':_0xa493c9['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xa493c9[_0xa6bd('0x33')],'dialOriginateTimeout':_0xa493c9[_0xa6bd('0x34')],'dialPrefix':_0xa493c9[_0xa6bd('0x35')],'outboundAnswerAgiCallsDay':_0xa493c9[_0xa6bd('0x36')],'outboundAnswerCallsDay':_0xa493c9[_0xa6bd('0x37')],'outboundBlacklistCallsDay':_0xa493c9[_0xa6bd('0x38')],'outboundBusyCallsDay':_0xa493c9[_0xa6bd('0x39')],'outboundCongestionCallsDay':_0xa493c9[_0xa6bd('0x3a')],'outboundDropCallsDayACS':_0xa493c9[_0xa6bd('0x3b')],'outboundDropCallsDayCallersExit':_0xa493c9[_0xa6bd('0x3c')],'outboundDropCallsDayTimeout':_0xa493c9[_0xa6bd('0x3d')],'outboundNoAnswerCallsDay':_0xa493c9[_0xa6bd('0x3e')],'outboundNoSuchCallsDay':_0xa493c9[_0xa6bd('0x3f')],'outboundOriginateFailureCallsDay':_0xa493c9['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xa493c9['outboundReCallsDay'],'outboundRejectCallsDay':_0xa493c9[_0xa6bd('0x40')],'outboundUnknownCallsDay':_0xa493c9['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xa493c9['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xa493c9[_0xa6bd('0x41')],'predictiveIntervalAvgTalktime':_0xa493c9[_0xa6bd('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0xa493c9['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xa493c9[_0xa6bd('0x43')],'predictiveIntervalErlangCalls':_0xa493c9[_0xa6bd('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0xa493c9[_0xa6bd('0x45')],'predictiveIntervalHitRate':_0xa493c9[_0xa6bd('0x46')],'predictiveIntervalMultiplicativeFactor':_0xa493c9[_0xa6bd('0x47')],'predictiveIntervalPauses':_0xa493c9[_0xa6bd('0x48')],'predictiveIntervalAvailable':_0xa493c9[_0xa6bd('0x49')],'predictiveIntervalTotalCalls':_0xa493c9[_0xa6bd('0x4a')],'message':_0xa493c9['message'],'originated':_0xa493c9[_0xa6bd('0x4b')],'erlangCalls':_0xa493c9[_0xa6bd('0x4c')],'erlangCallToSecond':_0xa493c9[_0xa6bd('0x4d')],'erlangAbandonmentRate':_0xa493c9['erlangAbandonmentRate'],'erlangBusyFactor':_0xa493c9[_0xa6bd('0x4e')],'startPredictive':_0xa493c9[_0xa6bd('0x4f')],'startProgressive':_0xa493c9['startProgressive']};if(_0xa493c9[_0xa6bd('0x50')]){_0x1a7d20[_0xa6bd('0x50')]={'id':_0xa493c9[_0xa6bd('0x50')]['id'],'name':_0xa493c9[_0xa6bd('0x50')][_0xa6bd('0x27')],'active':_0xa493c9[_0xa6bd('0x50')]['active'],'callerid':_0xa493c9[_0xa6bd('0x50')][_0xa6bd('0x51')]};}if(_0xa493c9[_0xa6bd('0x52')]){_0x1a7d20[_0xa6bd('0x52')]={'id':_0xa493c9[_0xa6bd('0x52')]['id'],'name':_0xa493c9[_0xa6bd('0x52')][_0xa6bd('0x27')]};}var _0x50dcee=md5(JSON['stringify'](_0x1a7d20));if(_0xa493c9[_0xa6bd('0x53')]!==_0x50dcee){_0xa493c9[_0xa6bd('0x53')]=_0x50dcee;emit(util['format']('voice:queue:%s',_0x1a7d20[_0xa6bd('0x27')]),_0xa6bd('0x54'),_0x1a7d20);}}}function emitVoiceQueueChannelRemove(_0x4a2d6b){emit(util[_0xa6bd('0x55')](_0xa6bd('0x56'),_0x4a2d6b[_0xa6bd('0x27')]),'voice_queue_channel:remove',_0x4a2d6b);}function notSendMessagesQueue(_0x570bc0){if(_0x570bc0[_0xa6bd('0x57')]){if(_0x570bc0[_0xa6bd('0x4b')]===0x0&&_0x570bc0[_0xa6bd('0x58')]===0x0){_0x570bc0[_0xa6bd('0x57')]=![];_0x570bc0[_0xa6bd('0x2a')]=0x0;_0x570bc0[_0xa6bd('0x59')]=0x0;_0x570bc0[_0xa6bd('0x5a')]=_0xa6bd('0x5b');ut[_0xa6bd('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x570bc0[_0xa6bd('0x27')]+_0xa6bd('0x5d'));}else{_0x570bc0[_0xa6bd('0x5a')]=_0xa6bd('0x5e');ut[_0xa6bd('0x5c')](_0xa6bd('0x5f'),_0x570bc0[_0xa6bd('0x27')]+_0xa6bd('0x60'));}emitCampaignPreview(_0x570bc0);}}Preview[_0xa6bd('0xf')][_0xa6bd('0x24')]=function(){var _0x55ba1c=this;setInterval(function(){_0x55ba1c[_0xa6bd('0x61')]();},0x7cf);};Preview[_0xa6bd('0xf')][_0xa6bd('0x61')]=function(){var _0x3d9195=this[_0xa6bd('0x14')];this[_0xa6bd('0x18')]+=0x1;for(var _0x10494e in _0x3d9195){if(_0x3d9195['hasOwnProperty'](_0x10494e)&&(_0x3d9195[_0x10494e][_0xa6bd('0x32')]===_0xa6bd('0x7')||_0x3d9195[_0x10494e][_0xa6bd('0x32')]===_0xa6bd('0x62'))&&_0x3d9195[_0x10494e][_0xa6bd('0x25')]===_0xa6bd('0x26')){if(this['clockClearZombieChannels']>0x7){this[_0xa6bd('0x18')]=0x0;this[_0xa6bd('0x63')]();}}if(_0x3d9195[_0xa6bd('0x64')](_0x10494e)&&_0x3d9195[_0x10494e]['dialMethod']===_0xa6bd('0x7')&&_0x3d9195[_0x10494e]['type']==='outbound'){if(_0x3d9195[_0x10494e][_0xa6bd('0x31')]){this['setMessage'](_0x3d9195[_0x10494e]);this[_0xa6bd('0x65')](_0x3d9195[_0x10494e]);}else{notSendMessagesQueue(_0x3d9195[_0x10494e]);}}}};Preview['prototype'][_0xa6bd('0x66')]=function(_0x4e9d8f){var _0x48b052=this;this[_0xa6bd('0x13')][_0xa6bd('0x10')](function(){if(!_[_0xa6bd('0x67')](_0x48b052[_0xa6bd('0x16')][_0x4e9d8f])){loggerAction['info']('[clearZombieChannels][talking]',_0x4e9d8f,_0xa6bd('0x68'),_0x48b052[_0xa6bd('0x16')][_0x4e9d8f][_0xa6bd('0x69')],_0xa6bd('0x6a'),JSON['stringify'](_0x48b052[_0xa6bd('0x14')][_0x48b052[_0xa6bd('0x16')][_0x4e9d8f][_0xa6bd('0x69')]][_0xa6bd('0x4b')]),_0xa6bd('0x6b'),JSON['stringify'](_0x48b052[_0xa6bd('0x14')][_0x48b052[_0xa6bd('0x16')][_0x4e9d8f][_0xa6bd('0x69')]][_0xa6bd('0x58')]),JSON[_0xa6bd('0x6c')](_0x48b052[_0xa6bd('0x16')][_0x4e9d8f]['dialAnswer']),JSON[_0xa6bd('0x6c')](_[_0xa6bd('0x6d')](_0x48b052[_0xa6bd('0x16')][_0x4e9d8f],[_0xa6bd('0x6e'),'UserId',_0xa6bd('0x6f'),_0xa6bd('0x70')])));return ami[_0xa6bd('0x71')]({'action':_0xa6bd('0x72'),'channel':_0x48b052[_0xa6bd('0x16')][_0x4e9d8f][_0xa6bd('0x73')]})[_0xa6bd('0x74')](function(_0x2b12c1){if(_0x2b12c1[_0xa6bd('0x5a')]===_0xa6bd('0x75')){setTimeout(function(){if(_0x48b052[_0xa6bd('0x16')][_0x4e9d8f]){ut[_0xa6bd('0x76')](_0x48b052['campaignsPreview'][_0x48b052[_0xa6bd('0x16')][_0x4e9d8f]['queue']],_0xa6bd('0x77'));if(_0x48b052['actions'][_0x4e9d8f][_0xa6bd('0x78')]===!![]){ut[_0xa6bd('0x79')](_0x48b052[_0xa6bd('0x14')][_0x48b052[_0xa6bd('0x16')][_0x4e9d8f][_0xa6bd('0x69')]],_0xa6bd('0x77'));ut[_0xa6bd('0x7a')](_0xa6bd('0x7b')+_0x4e9d8f,_0x48b052[_0xa6bd('0x16')][_0x4e9d8f][_0xa6bd('0x69')]);}ut[_0xa6bd('0x7a')](_0xa6bd('0x7c')+_0x4e9d8f,_0x48b052['actions'][_0x4e9d8f][_0xa6bd('0x69')]);delete _0x48b052[_0xa6bd('0x16')][_0x4e9d8f];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x58950b=this;loggerAction[_0xa6bd('0x7d')](_0xa6bd('0x7e'),_['size'](this['actions']));for(var _0x43d393 in this[_0xa6bd('0x16')]){if(_0x58950b[_0xa6bd('0x16')][_0xa6bd('0x64')](_0x43d393)){_0x58950b[_0xa6bd('0x66')](_0x43d393);}}};Preview[_0xa6bd('0xf')][_0xa6bd('0x65')]=function(_0x5c80f0){var _0x4b43e3=this;rpcDb[_0xa6bd('0x7f')](_0x5c80f0['id'],ut['agentReadyId'](this['agents']))[_0xa6bd('0x80')](function(_0x485de9){if(!_[_0xa6bd('0x67')](_0x485de9)){for(var _0x35ce43=0x0;_0x35ce43<_0x485de9[_0xa6bd('0x81')];_0x35ce43+=0x1){if(ut[_0xa6bd('0x82')](_0x485de9[_0x35ce43][_0xa6bd('0x83')])<_0x5c80f0[_0xa6bd('0x84')]*0x3c){_0x4b43e3[_0xa6bd('0x85')](_0x485de9[_0x35ce43]['id'])[_0xa6bd('0x80')](ut[_0xa6bd('0x86')](_0xa6bd('0x87')))[_0xa6bd('0x74')](ut['logger2']('[RecallMe]'));}else{var _0x4da7cb=new Action(_0x485de9[_0x35ce43],_0x5c80f0);_0x4da7cb[_0xa6bd('0x88')]=moment()[_0xa6bd('0x55')](_0xa6bd('0x89'));_0x5c80f0[_0xa6bd('0x8a')]+=0x1;ut['logCustomer'](_0x4da7cb,0x17,_0xa6bd('0x8b'));if(_0x5c80f0[_0xa6bd('0x8c')]){rpcDb[_0xa6bd('0x8d')](ut[_0xa6bd('0x8e')](_0x485de9[_0x35ce43]));rpcDb[_0xa6bd('0x8f')](_0x4da7cb,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x4da7cb,0x16,_0xa6bd('0x90'));rpcDb['createCustomerHistory'](_0x4da7cb,_0xa6bd('0x91'));rpcDb[_0xa6bd('0x92')](_0x4da7cb,_0xa6bd('0x91'));}}}}})[_0xa6bd('0x74')](ut['logger2']('[getContactRecallMe]'));};Preview[_0xa6bd('0xf')][_0xa6bd('0x93')]=function(_0x1b407c){_0x1b407c[_0xa6bd('0x57')]=!![];if(ut[_0xa6bd('0x94')](_0x1b407c[_0xa6bd('0x95')])){_0x1b407c[_0xa6bd('0x5a')]=_0xa6bd('0x96');}else if(!ut[_0xa6bd('0x97')](_0x1b407c['dialActive'])){_0x1b407c[_0xa6bd('0x5a')]=_0xa6bd('0x5b');}else if(!this[_0xa6bd('0x98')](_0x1b407c[_0xa6bd('0x50')])){if(!this[_0xa6bd('0x98')](_0x1b407c[_0xa6bd('0x99')])){_0x1b407c[_0xa6bd('0x5a')]=_0xa6bd('0x9a');}else{_0x1b407c[_0xa6bd('0x5a')]=_0xa6bd('0x9b');}}else{_0x1b407c[_0xa6bd('0x5a')]=_0xa6bd('0x9b');}emitCampaignPreview(_0x1b407c);};Preview['prototype'][_0xa6bd('0x9c')]=function(_0x1df349,_0x34c3d9,_0x5342ff){var _0x45f38e=this;var _0x585267=this['actions'][_0x34c3d9];var _0x11c008=this[_0xa6bd('0x14')][_0x585267[_0xa6bd('0x69')]];var _0x208f57;if(_0x11c008){switch(_0x5342ff){case'1':_0x11c008[_0xa6bd('0x3f')]+=0x1;_0x585267[_0xa6bd('0x9d')]=ut[_0xa6bd('0x9e')](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0x0,_0xa6bd('0xa0'));rpcDb['createCustomerHistory'](_0x585267,_0xa6bd('0xa1'));if(ut['totalGlobal'](_0x585267)>=_0x11c008[_0xa6bd('0xa2')]){_0x208f57=ut[_0xa6bd('0xa3')](_0x585267,0xf,'Global');rpcDb[_0xa6bd('0x92')](_0x208f57,_0xa6bd('0xa4'));}else{rpcDb[_0xa6bd('0x92')](_0x585267,_0xa6bd('0xa4'));}delete this[_0xa6bd('0x16')][_0x1df349[_0xa6bd('0xa5')]];break;case _0xa6bd('0xa6'):var _0x5b2585=moment()[_0xa6bd('0x55')](_0xa6bd('0x89'));_0x585267[_0xa6bd('0xa7')]=_0x5b2585;_0x585267[_0xa6bd('0xa8')]=_0x5b2585;_0x585267[_0xa6bd('0x78')]=!![];_0x11c008[_0xa6bd('0x58')]+=0x1;logger[_0xa6bd('0x7d')](_0xa6bd('0xa9'),_0x585267[_0xa6bd('0xaa')],_0xa6bd('0xab'),_0x11c008[_0xa6bd('0x27')],_0xa6bd('0x6b'),_0x11c008['pTalking']);ami[_0xa6bd('0xac')](_0xa6bd('0xad'),ut['buildObj'](_0x585267,_0xa6bd('0xae')));if(_0x11c008[_0xa6bd('0xaf')]){ami[_0xa6bd('0xac')](_0xa6bd('0xb0'),ut[_0xa6bd('0xb1')](_0x585267));}break;case'16':ami[_0xa6bd('0xac')](_0xa6bd('0xb2'),ut[_0xa6bd('0xb3')](_0x585267,_0xa6bd('0xb4')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x585267,_0xa6bd('0xb4')));_0x11c008[_0xa6bd('0x37')]+=0x1;_0x11c008[_0xa6bd('0x2d')]+=0x1;_0x11c008[_0xa6bd('0x29')]+=0x1;ut['decrementTalkink'](_0x11c008,_0xa6bd('0xb5'));_0x585267[_0xa6bd('0x9d')]=ut['totalGlobal'](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0x4,'Answer');rpcDb['createCustomerHistory'](_0x585267,_0xa6bd('0xb6'));rpcDb[_0xa6bd('0x92')](_0x585267,_0xa6bd('0xb7'));rpcDb[_0xa6bd('0xb8')](_0x585267);_0x11c008[_0xa6bd('0xb9')]+=_0x585267[_0xa6bd('0xba')];_0x11c008['sumBillable']+=_0x585267[_0xa6bd('0xba')];logger['info'](_0xa6bd('0xbb'),_0x585267['uniqueid'],_0xa6bd('0xab'),_0x11c008[_0xa6bd('0x27')],_0xa6bd('0x6b'),_0x11c008[_0xa6bd('0x58')]);delete this[_0xa6bd('0x16')][_0x1df349['linkedid']];break;case _0xa6bd('0xbc'):_0x11c008[_0xa6bd('0x39')]+=0x1;_0x585267[_0xa6bd('0xbd')]+=0x1;_0x585267[_0xa6bd('0x9d')]=ut[_0xa6bd('0x9e')](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0x5,_0xa6bd('0xbe'));rpcDb[_0xa6bd('0x8f')](_0x585267,_0xa6bd('0xbf'));if(ut[_0xa6bd('0x9e')](_0x585267)>=_0x11c008[_0xa6bd('0xa2')]){_0x208f57=ut['cloneAction'](_0x585267,0xf,_0xa6bd('0xc0'));rpcDb[_0xa6bd('0x92')](_0x208f57,_0xa6bd('0xc1'));}else{if(_0x585267['countbusyretry']>=_0x11c008['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x585267,_0xa6bd('0xbf'));}else{rpcDb[_0xa6bd('0xc2')](ut[_0xa6bd('0xc3')](_0x585267,'countbusyretry',_0x11c008[_0xa6bd('0xc4')]),_0x585267[_0xa6bd('0xc5')],_0x585267[_0xa6bd('0xc6')]);}}break;case _0xa6bd('0xc7'):_0x11c008['outboundNoAnswerCallsDay']+=0x1;_0x585267[_0xa6bd('0xc8')]+=0x1;_0x585267[_0xa6bd('0x9d')]=ut[_0xa6bd('0x9e')](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0x3,'NoAnswer');rpcDb[_0xa6bd('0x8f')](_0x585267,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x585267)>=_0x11c008[_0xa6bd('0xa2')]){_0x208f57=ut[_0xa6bd('0xa3')](_0x585267,0xf,_0xa6bd('0xc0'));rpcDb['createCustomerFinal'](_0x208f57,_0xa6bd('0xc9'));}else{if(_0x585267[_0xa6bd('0xc8')]>=_0x11c008[_0xa6bd('0xca')]){rpcDb[_0xa6bd('0x92')](_0x585267,_0xa6bd('0xcb'));}else{rpcDb[_0xa6bd('0xc2')](ut[_0xa6bd('0xc3')](_0x585267,'countnoanswerretry',_0x11c008[_0xa6bd('0xcc')]),_0x585267[_0xa6bd('0xc5')],_0x585267[_0xa6bd('0xc6')]);}}break;case _0xa6bd('0xcd'):_0x11c008[_0xa6bd('0x3a')]+=0x1;_0x585267[_0xa6bd('0xce')]+=0x1;_0x585267[_0xa6bd('0x9d')]=ut['totalGlobal'](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0x8,_0xa6bd('0xcf'));rpcDb[_0xa6bd('0x8f')](_0x585267,_0xa6bd('0xd0'));if(ut[_0xa6bd('0x9e')](_0x585267)>=_0x11c008[_0xa6bd('0xa2')]){_0x208f57=ut[_0xa6bd('0xa3')](_0x585267,0xf,'Global');rpcDb[_0xa6bd('0x92')](_0x208f57,_0xa6bd('0xd1'));}else{if(_0x585267[_0xa6bd('0xce')]>=_0x11c008['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x585267,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xa6bd('0xc2')](ut['scheduledAt'](_0x585267,_0xa6bd('0xce'),_0x11c008[_0xa6bd('0xc4')]),_0x585267[_0xa6bd('0xc5')],_0x585267[_0xa6bd('0xc6')]);}}break;case _0xa6bd('0xd2'):_0x11c008[_0xa6bd('0x40')]+=0x1;_0x585267[_0xa6bd('0x9d')]=ut['totalGlobal'](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0x14,_0xa6bd('0xd3'));rpcDb[_0xa6bd('0x8f')](_0x585267,_0xa6bd('0xd4'));if(_0x585267[_0xa6bd('0xc5')]){rpcDb['unlockContact'](_0x585267[_0xa6bd('0xd5')]);}if(_0x585267[_0xa6bd('0xc6')]){rpcDb[_0xa6bd('0xd6')](_0x585267[_0xa6bd('0xd5')]);}break;default:if(_0x585267[_0xa6bd('0x78')]){ut[_0xa6bd('0x79')](_0x11c008,_0xa6bd('0xd7'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x11c008[_0xa6bd('0x27')],_0x1df349);}_0x11c008[_0xa6bd('0xd8')]+=0x1;_0x585267['countglobal']=ut[_0xa6bd('0x9e')](_0x585267);ut[_0xa6bd('0x9f')](_0x585267,0xc,_0x1df349[_0xa6bd('0xd9')]||_0x1df349[_0xa6bd('0xda')]);rpcDb['createCustomerHistory'](_0x585267,_0xa6bd('0xdb'));if(ut[_0xa6bd('0x9e')](_0x585267)>=_0x11c008[_0xa6bd('0xa2')]){_0x208f57=ut[_0xa6bd('0xa3')](_0x585267,0xf,_0xa6bd('0xc0'));rpcDb['createCustomerFinal'](_0x208f57,_0xa6bd('0xdc'));}else{rpcDb['createCustomerFinal'](_0x585267,_0xa6bd('0xdc'));}delete this[_0xa6bd('0x16')][_0x1df349[_0xa6bd('0xa5')]];}if(!(_0x585267[_0xa6bd('0x78')]&&_0x5342ff==='16')){ut[_0xa6bd('0x76')](_0x11c008,_0xa6bd('0xdd'));logger[_0xa6bd('0x7d')](_0xa6bd('0xde'),_0x585267[_0xa6bd('0xaa')],'\x20Queue',_0x11c008['name'],_0xa6bd('0x6a'),_0x11c008[_0xa6bd('0x4b')]);}if(_0x5342ff!=='ANSWER'){delete this['actions'][_0x1df349[_0xa6bd('0xa5')]];delete this[_0xa6bd('0x16')][_0x1df349[_0xa6bd('0xdf')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x5c719b,_0x2573ec,_0x319175){if(_[_0xa6bd('0xe0')](_0x2573ec)&&_0xa6bd('0xe1')!==typeof _0x2573ec){return;}if(_[_0xa6bd('0xe0')](_0x319175)&&_0xa6bd('0xe1')!==typeof _0x319175){return;}switch(_0x319175[_0xa6bd('0xe2')]){case'0':ut['logAgent'](_0x5c719b,0x0,_0xa6bd('0xa0'));rpcDb[_0xa6bd('0xe3')](_0x5c719b,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x5c719b,0x3,_0xa6bd('0xe4'));rpcDb[_0xa6bd('0xe3')](_0x5c719b,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xa6bd('0xe5')](_0x5c719b,0x5,_0xa6bd('0xbe'));rpcDb[_0xa6bd('0xe3')](_0x5c719b,_0xa6bd('0xe6'));break;case'8':ut[_0xa6bd('0xe5')](_0x5c719b,0x8,_0xa6bd('0xcf'));rpcDb[_0xa6bd('0xe3')](_0x5c719b,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xa6bd('0xe5')](_0x5c719b,0x16,'AnswerAGI');rpcDb[_0xa6bd('0xe3')](_0x5c719b,_0xa6bd('0xe7'));break;default:ut['logAgent'](_0x5c719b,0xc,_0x319175['reason']);rpcDb[_0xa6bd('0xe3')](_0x5c719b,_0xa6bd('0xe8'));}ut[_0xa6bd('0x76')](_0x2573ec,_0xa6bd('0xe9'));logger[_0xa6bd('0x7d')]('[originated][decrement][callProgressDetectingAgent]',_0x5c719b[_0xa6bd('0xaa')],_0xa6bd('0xab'),_0x2573ec[_0xa6bd('0x27')],_0xa6bd('0x6a'),_0x2573ec[_0xa6bd('0x4b')]);delete this[_0xa6bd('0x16')][_0x5c719b['uniqueid']];};Preview[_0xa6bd('0xf')][_0xa6bd('0xea')]=function(_0x4735bc,_0x1d2721,_0x3ce85a,_0x3d12df,_0x3f2336){var _0x2bfb2e=this;return new BPromise(function(_0x227c3d,_0x49ecca){if(_[_0xa6bd('0x67')](_0x1d2721)||_['isNil'](_0x1d2721[_0xa6bd('0xeb')])||_[_0xa6bd('0x67')](_0x1d2721[_0xa6bd('0xeb')]['phone'])||_['isNil'](_0x1d2721[_0xa6bd('0x6f')])){_0x49ecca(ut[_0xa6bd('0x5a')](_0xa6bd('0xec'),_0x3d12df,_0x3f2336));return;}var _0xa0d25f=uuid['v4']();var _0x5c9146=_0x2bfb2e[_0xa6bd('0x14')][_0x1d2721['Queue']['name']];var _0x362519=_0x3ce85a?_0x2bfb2e[_0xa6bd('0x17')][_0x3ce85a]['id']:undefined;_0x2bfb2e[_0xa6bd('0x16')][_0xa0d25f]=new Action(_0x1d2721,_0x5c9146,_0xa0d25f,_0x3ce85a,_0x362519);var _0x169723=_0x2bfb2e[_0xa6bd('0x16')][_0xa0d25f];_0x169723[_0xa6bd('0xc5')]=_0x3d12df;_0x169723['activeContact']=_0x3f2336;_0x169723[_0xa6bd('0xed')]=_0x3ce85a;if(_[_0xa6bd('0xee')](_0x4735bc)){_0x2bfb2e[_0xa6bd('0xef')](_0x169723,_0x5c9146,_0x1d2721,_0x3ce85a)['then'](function(_0x31a3d3){logger[_0xa6bd('0x7d')]('[Preview][execCall][success]',_0xa6bd('0xf0')+_0x169723[_0xa6bd('0x69')]+_0xa6bd('0xf1')+_0x169723['idContact'],JSON['stringify'](_0x31a3d3));ami[_0xa6bd('0xac')](_0xa6bd('0xf2'),ut[_0xa6bd('0xb3')](_0x169723,'called'));_0x227c3d(ut[_0xa6bd('0x5a')]('Calling'));})[_0xa6bd('0x74')](function(_0x22488e){ut['logger'](_0xa6bd('0xf3'),_0x22488e);_0x49ecca(ut[_0xa6bd('0x5a')](_0xa6bd('0xf4'),_0x3d12df,_0x3f2336));});}else{_0x5c9146[_0xa6bd('0x38')]+=0x1;ut[_0xa6bd('0xf5')](_0x169723);rpcDb[_0xa6bd('0xf6')](_0x169723,_0xa6bd('0xf7'));delete _0x2bfb2e[_0xa6bd('0x16')][_0xa0d25f];_0x49ecca(ut['message'](_0xa6bd('0xf8'),_0x3d12df,_0x3f2336));}});};Preview[_0xa6bd('0xf')][_0xa6bd('0x98')]=function(_0x9d0686){return!_[_0xa6bd('0x67')](_0x9d0686)&&!_[_0xa6bd('0x67')](_0x9d0686['name'])&&!_[_0xa6bd('0x67')](_0x9d0686[_0xa6bd('0xf9')])&&_0x9d0686[_0xa6bd('0xf9')]&&!_[_0xa6bd('0x67')](this[_0xa6bd('0xfa')][util['format'](_0xa6bd('0xfb'),_0x9d0686[_0xa6bd('0x27')])])&&!_['isNil'](this[_0xa6bd('0xfa')][util[_0xa6bd('0x55')]('SIP/%s',_0x9d0686[_0xa6bd('0x27')])]['status'])&&(this[_0xa6bd('0xfa')][util[_0xa6bd('0x55')](_0xa6bd('0xfb'),_0x9d0686[_0xa6bd('0x27')])][_0xa6bd('0x72')]==='reachable'||this[_0xa6bd('0xfa')][util[_0xa6bd('0x55')]('SIP/%s',_0x9d0686[_0xa6bd('0x27')])]['status']==='unmonitored');};Preview[_0xa6bd('0xf')][_0xa6bd('0x85')]=function(_0x362d06,_0x27d338){var _0x33f689=this;return new BPromise(function(_0x25c3df,_0x3ca87c){_0x33f689[_0xa6bd('0xfc')](_0x362d06,_0x27d338)[_0xa6bd('0x80')](function(_0x400a5a){_0x25c3df(_[_0xa6bd('0x6d')](_0x400a5a,[_0xa6bd('0x5a')]));})[_0xa6bd('0x74')](function(_0x4ae2aa){if(_0x4ae2aa['unlock']){rpcDb['unlockContact'](_0x362d06);}if(_0x4ae2aa[_0xa6bd('0xf9')]){rpcDb[_0xa6bd('0xd6')](_0x362d06);}_0x3ca87c(_[_0xa6bd('0x6d')](_0x4ae2aa,[_0xa6bd('0x5a')]));});});};Preview[_0xa6bd('0xf')][_0xa6bd('0xfc')]=function(_0x1ae75,_0x1833a6){var _0x342a17=this;return new BPromise(function(_0x5c7679,_0x377feb){var _0x57ff31,_0x376257;rpcDb[_0xa6bd('0xfd')](_0x1ae75)[_0xa6bd('0x80')](function(_0x2b5dde){if(!_['isNil'](_0x2b5dde[0x0])){_0x376257=_0x2b5dde[0x0]['recallme']?![]:!![];_0x57ff31=_0x2b5dde[0x0][_0xa6bd('0xfe')]?!![]:![];_0x57ff31=_0x1833a6?!![]:_0x57ff31;}var _0x1f6084=_0x342a17[_0xa6bd('0xff')](_0x2b5dde);if(_0x1f6084[_0xa6bd('0x100')]){rpcDb[_0xa6bd('0x101')](_['pick'](_0x2b5dde[0x0],[_0xa6bd('0x6f'),_0xa6bd('0x102')]))[_0xa6bd('0x80')](function(_0x31946f){_0x342a17['checkInBlack'](_0x31946f,_0x2b5dde[0x0],_0x1833a6,_0x376257,_0x57ff31)[_0xa6bd('0x80')](function(_0x26ec8b){_0x5c7679(_0x26ec8b);})[_0xa6bd('0x74')](function(_0x5edeca){_0x377feb(_0x5edeca);});})[_0xa6bd('0x74')](function(_0x4d130b){ut[_0xa6bd('0x5c')](_0xa6bd('0x103'),_0x4d130b);_0x377feb(ut[_0xa6bd('0x5a')](_0xa6bd('0x104'),_0x376257,_0x57ff31));});}else{_0x377feb(ut[_0xa6bd('0x5a')](_0x1f6084[_0xa6bd('0x5a')],_0x376257,_0x57ff31));}})['catch'](function(_0x57fd62){ut['logger']('[Preview][getContactPreview]',_0x57fd62);_0x377feb(ut[_0xa6bd('0x5a')](_0xa6bd('0x104'),![],!![]));});});};Preview[_0xa6bd('0xf')][_0xa6bd('0xff')]=function(_0x5d2f40){if(_[_0xa6bd('0x67')](_0x5d2f40)||_[_0xa6bd('0xee')](_0x5d2f40)||!_['isNil'](_0x5d2f40[0x0]['Agent'])&&_[_0xa6bd('0x67')](_0x5d2f40[0x0]['Agent'][_0xa6bd('0x27')])){ut[_0xa6bd('0x5c')](_0xa6bd('0x105'),_0x5d2f40);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x3e94e5=this[_0xa6bd('0x14')][_0x5d2f40[0x0]['Queue'][_0xa6bd('0x27')]];_0x3e94e5[_0xa6bd('0x5a')]='ACTIVE';if(_[_0xa6bd('0x67')](_0x3e94e5)){ut[_0xa6bd('0x5c')](_0xa6bd('0x106'),_0x3e94e5);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x3e94e5[_0xa6bd('0x50')])){ut['logger'](_0xa6bd('0x107'),'campaign\x20Name:\x20'+_0x3e94e5[_0xa6bd('0x27')]+_0xa6bd('0x108'));if(!this[_0xa6bd('0x98')](_0x3e94e5['TrunkBackup'])){ut['logger'](_0xa6bd('0x107'),_0x3e94e5['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xa6bd('0x97')](_0x3e94e5[_0xa6bd('0x31')])){ut['logger'](_0xa6bd('0x109'),_0x3e94e5[_0xa6bd('0x27')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3e94e5[_0xa6bd('0x27')]+_0xa6bd('0x10a')};}return{'isValid':!![],'message':_0xa6bd('0x10b')};};Preview[_0xa6bd('0xf')][_0xa6bd('0xef')]=function(_0x37dac8,_0x177558,_0x4fc514,_0x4ef351){var _0x44c017=this;return new BPromise(function(_0x103e2c,_0x23d68a){var _0x2d94f8=_0x37dac8[_0xa6bd('0xaa')];var _0x21091b=_0x44c017[_0xa6bd('0x98')](_0x177558['Trunk'])?util[_0xa6bd('0x55')](_0xa6bd('0x10c'),_0x177558[_0xa6bd('0x50')][_0xa6bd('0x27')],_['isNil'](_0x177558[_0xa6bd('0x35')])?'':_0x177558[_0xa6bd('0x35')]['trim']()||'',_0x177558[_0xa6bd('0x10d')]>0x0?_0x4fc514[_0xa6bd('0xeb')][_0xa6bd('0x10e')][_0xa6bd('0x10f')](_0x177558[_0xa6bd('0x10d')]):_0x4fc514[_0xa6bd('0xeb')]['phone']):util['format'](_0xa6bd('0x10c'),_[_0xa6bd('0x67')](_0x177558[_0xa6bd('0x99')])?_0x177558[_0xa6bd('0x50')][_0xa6bd('0x27')]:_0x177558[_0xa6bd('0x99')][_0xa6bd('0x27')],_['isNil'](_0x177558[_0xa6bd('0x35')])?'':_0x177558[_0xa6bd('0x35')][_0xa6bd('0x110')]()||'',_0x177558['dialCutDigit']>0x0?_0x4fc514[_0xa6bd('0xeb')]['phone'][_0xa6bd('0x10f')](_0x177558[_0xa6bd('0x10d')]):_0x4fc514['Contact'][_0xa6bd('0x10e')]);var _0x462cfe=_0x44c017['isTrunkReachable'](_0x177558[_0xa6bd('0x50')])?ut[_0xa6bd('0x111')](_0x177558[_0xa6bd('0x50')]['callerid'],_0x177558[_0xa6bd('0x112')],_0x177558['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa6bd('0x113')](_0x177558[_0xa6bd('0x33')],_0x177558['dialRandomLastDigitCallerIdNumber']):_0x177558[_0xa6bd('0x33')]):ut[_0xa6bd('0x111')](_[_0xa6bd('0x67')](_0x177558[_0xa6bd('0x99')])?_0x177558[_0xa6bd('0x50')][_0xa6bd('0x51')]:_0x177558[_0xa6bd('0x99')]['callerid'],_0x177558[_0xa6bd('0x112')],_0x177558[_0xa6bd('0x114')]>0x0?ut[_0xa6bd('0x113')](_0x177558[_0xa6bd('0x33')],_0x177558[_0xa6bd('0x114')]):_0x177558[_0xa6bd('0x33')]);if(_0x462cfe){_0x37dac8[_0xa6bd('0x115')]=ut[_0xa6bd('0x116')](_0x462cfe);_0x37dac8[_0xa6bd('0x117')]=ut[_0xa6bd('0x118')](_0x462cfe);}var _0x10701d=ut[_0xa6bd('0x119')](_0x177558,_0x4fc514,_0x21091b,_0x462cfe,_0x2d94f8,_0x37dac8);_[_0xa6bd('0x11a')](_0x37dac8,ut['toLowerVariables'](_0x10701d));_0x37dac8[_0xa6bd('0x88')]=moment()[_0xa6bd('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa6bd('0x71')](ut['variablesAction'](_0x37dac8,_0x177558,_0x10701d,_0x37dac8[_0xa6bd('0xc6')],_0x4ef351))[_0xa6bd('0x80')](function(_0xbea3ea){_0x177558[_0xa6bd('0x4b')]+=0x1;logger[_0xa6bd('0x7d')](_0xa6bd('0x11b'),_0x2d94f8,_0xa6bd('0xab'),_0x177558[_0xa6bd('0x27')],'originated:\x20',_0x177558[_0xa6bd('0x4b')]);_0x103e2c(_0xbea3ea);})[_0xa6bd('0x74')](function(_0x45edc7){ut[_0xa6bd('0xe5')](_0x37dac8,0xe,'OriginateError');rpcDb[_0xa6bd('0xe3')](_0x37dac8,_0xa6bd('0x11c'));_0x23d68a(_0x45edc7);});});};Preview['prototype'][_0xa6bd('0x20')]=function(_0xde10e7){if(this[_0xa6bd('0x16')][_0xde10e7['linkedid']]){this[_0xa6bd('0x16')][_0xde10e7['linkedid']]['channel']=_0xde10e7[_0xa6bd('0x73')];}};Preview[_0xa6bd('0xf')]['syncOriginateResponse']=function(_0x22b25d){var _0x2b73c0=this;var _0x1acb14=this[_0xa6bd('0x16')][_0x22b25d['actionid']];if(_0x1acb14){if(_0x1acb14[_0xa6bd('0xed')]&&this[_0xa6bd('0x17')][_0x1acb14[_0xa6bd('0xed')]]){ut[_0xa6bd('0x11d')](_0x1acb14,this[_0xa6bd('0x17')][_0x1acb14[_0xa6bd('0xed')]][_0xa6bd('0x27')],this[_0xa6bd('0x17')][_0x1acb14[_0xa6bd('0xed')]]['id']);}var _0x69836b=_[_0xa6bd('0x11e')](_0x1acb14);_0x69836b[_0xa6bd('0xa7')]=moment()['format'](_0xa6bd('0x89'));var _0x9dbc3a=_0x2b73c0[_0xa6bd('0x14')][_0x1acb14[_0xa6bd('0x69')]];if(ut[_0xa6bd('0x11f')](_0x22b25d[_0xa6bd('0x120')])){if(_0x1acb14[_0xa6bd('0xc5')]){rpcDb['unlockContact'](_0x1acb14[_0xa6bd('0xd5')]);}if(_0x1acb14[_0xa6bd('0xc6')]){rpcDb[_0xa6bd('0xd6')](_0x1acb14['idContact']);}ami[_0xa6bd('0xac')](_0xa6bd('0x121'),ut[_0xa6bd('0xb3')](_0x1acb14,_0xa6bd('0x122')));this[_0xa6bd('0x123')](_0x69836b,_0x9dbc3a,_0x22b25d);}else{_0x1acb14[_0xa6bd('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x69836b,0x4,_0xa6bd('0x124'));rpcDb[_0xa6bd('0xe3')](_0x69836b,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xa6bd('0xf')][_0xa6bd('0x1c')]=function(_0x1f2b57){var _0x351de4=this;var _0x4cb6e9=this[_0xa6bd('0x16')][_0x1f2b57[_0xa6bd('0xa5')]];var _0x3cdc52;if(_0x4cb6e9){_0x3cdc52=this[_0xa6bd('0x14')][_0x4cb6e9['queue']];logger[_0xa6bd('0x7d')]('[syncHangup][talking]',_0x1f2b57[_0xa6bd('0xa5')],_0xa6bd('0xab'),_0x3cdc52['name'],_0xa6bd('0x6b'),_0x3cdc52[_0xa6bd('0x58')]);}if(this[_0xa6bd('0x16')][_0x1f2b57[_0xa6bd('0xa5')]]&&_0x1f2b57[_0xa6bd('0xa5')]!==_0x1f2b57[_0xa6bd('0xaa')]){if(_0x1f2b57[_0xa6bd('0x125')]==='16'&&this[_0xa6bd('0x16')][_0x1f2b57[_0xa6bd('0xa5')]][_0xa6bd('0x78')]){this[_0xa6bd('0x9c')](_0x1f2b57,_0x1f2b57['linkedid'],_0x1f2b57[_0xa6bd('0x125')]);}else if(this[_0xa6bd('0x16')][_0x1f2b57[_0xa6bd('0xa5')]][_0xa6bd('0x78')]){logger['info'](_0xa6bd('0x126'),_0x1f2b57['linkedid'],_0x1f2b57[_0xa6bd('0x125')],_0xa6bd('0xab'),_0x3cdc52[_0xa6bd('0x27')],_0xa6bd('0x6b'),_0x3cdc52[_0xa6bd('0x58')]);this['callProgressDetectingCustomer'](_0x1f2b57,_0x1f2b57['linkedid'],_0x1f2b57['cause']);}}else if(_0x4cb6e9&&_['isNil'](_0x4cb6e9[_0xa6bd('0x127')])&&_0x3cdc52[_0xa6bd('0x128')]&&_0x1f2b57[_0xa6bd('0xa5')]===_0x1f2b57[_0xa6bd('0xaa')]&&_[_0xa6bd('0x67')](_0x1f2b57[_0xa6bd('0xe2')])&&_0x1f2b57[_0xa6bd('0x125')]==='16'&&_0x1f2b57[_0xa6bd('0x129')]==='6'&&_[_0xa6bd('0xe0')](_0x4cb6e9[_0xa6bd('0x12a')])){if(_0x4cb6e9[_0xa6bd('0xc5')]){rpcDb[_0xa6bd('0x12b')](_0x4cb6e9[_0xa6bd('0xd5')]);}if(_0x4cb6e9[_0xa6bd('0xc6')]){rpcDb['disableContact'](_0x4cb6e9[_0xa6bd('0xd5')]);}_0x1f2b57[_0xa6bd('0xe2')]='22';this['callProgressDetectingAgent'](_0x4cb6e9,_0x3cdc52,_0x1f2b57);}else if(_0x4cb6e9&&_0x4cb6e9[_0xa6bd('0x12a')]){if(_0x1f2b57['cause']==='16'&&this[_0xa6bd('0x16')][_0x1f2b57[_0xa6bd('0xa5')]][_0xa6bd('0x78')]){logger[_0xa6bd('0x7d')](_0xa6bd('0x12c'),_0x1f2b57[_0xa6bd('0xa5')],_0x1f2b57[_0xa6bd('0x125')],_0xa6bd('0xab'),_0x3cdc52[_0xa6bd('0x27')],_0xa6bd('0x6b'),_0x3cdc52[_0xa6bd('0x58')]);this[_0xa6bd('0x9c')](_0x1f2b57,_0x1f2b57['linkedid'],_0x1f2b57[_0xa6bd('0x125')]);}else if(this['actions'][_0x1f2b57[_0xa6bd('0xa5')]][_0xa6bd('0x78')]){logger[_0xa6bd('0x7d')](_0xa6bd('0x126'),_0x1f2b57[_0xa6bd('0xa5')],_0x1f2b57['cause'],_0xa6bd('0xab'),_0x3cdc52['name'],_0xa6bd('0x6b'),_0x3cdc52['pTalking']);this[_0xa6bd('0x9c')](_0x1f2b57,_0x1f2b57['linkedid'],_0x1f2b57[_0xa6bd('0x125')]);}}};Preview['prototype']['syncDialEnd']=function(_0x3f51ae){if(this[_0xa6bd('0x16')][_0x3f51ae[_0xa6bd('0xdf')]]&&_0x3f51ae[_0xa6bd('0xdf')]!==_0x3f51ae[_0xa6bd('0x12d')]){this[_0xa6bd('0x9c')](_0x3f51ae,_0x3f51ae['destlinkedid'],_0x3f51ae['dialstatus']);}};Preview[_0xa6bd('0xf')]['syncHangupRequest']=function(_0x5ae4b5){if(this[_0xa6bd('0x16')][_0x5ae4b5[_0xa6bd('0xa5')]]&&_0x5ae4b5[_0xa6bd('0xa5')]!==_0x5ae4b5[_0xa6bd('0xaa')]&&!this[_0xa6bd('0x16')][_0x5ae4b5[_0xa6bd('0xa5')]]['dialAnswer']){if(_0x5ae4b5[_0xa6bd('0x125')]==='1'){this[_0xa6bd('0x9c')](_0x5ae4b5,_0x5ae4b5['linkedid'],_0x5ae4b5[_0xa6bd('0x125')]);}}};Preview[_0xa6bd('0xf')][_0xa6bd('0x12e')]=function(_0x284b8e,_0x15da2f,_0x4c368c){if(this[_0xa6bd('0x16')][_0x284b8e]){if(_[_0xa6bd('0x67')](this[_0xa6bd('0x16')][_0x284b8e][_0xa6bd('0x12f')])){this[_0xa6bd('0x16')][_0x284b8e][_0xa6bd('0x12f')]={};}this['actions'][_0x284b8e][_0xa6bd('0x12f')][_0x15da2f]=_0x4c368c;}};Preview[_0xa6bd('0xf')][_0xa6bd('0x22')]=function(_0x221dfe){try{if(!_['isNil'](_0x221dfe)){if(ut[_0xa6bd('0x130')](_['keys'](_0x221dfe[_0xa6bd('0x131')])[0x0])){this['addVariable'](_0x221dfe[_0xa6bd('0xaa')],_[_0xa6bd('0x132')](_0x221dfe[_0xa6bd('0x131')])[0x0],_0x221dfe[_0xa6bd('0x133')]);}}}catch(_0x1f219c){logger['error'](_0xa6bd('0x134'),util[_0xa6bd('0x135')](_0x1f219c,{'showHidden':![],'depth':null}));}};Preview[_0xa6bd('0xf')][_0xa6bd('0x136')]=function(_0x1b4d86){if(_0x1b4d86){if(this[_0xa6bd('0x16')][_0x1b4d86[_0xa6bd('0x137')]]){this['actions'][_0x1b4d86[_0xa6bd('0x137')]][_0xa6bd('0x12a')]=!![];}}};Preview[_0xa6bd('0xf')][_0xa6bd('0x23')]=function(_0x15e5ee){if(_0x15e5ee){if(this[_0xa6bd('0x16')][_0x15e5ee[_0xa6bd('0x138')]]){this['actions'][_0x15e5ee['transfererlinkedid']][_0xa6bd('0x12a')]=!![];}}};module[_0xa6bd('0x139')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5138abb..7fceda4 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 _0xe5b3=['[moveContactManagedDialer]\x20','checkIsBlackList','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','moveContactManagedDialer'];(function(_0x3d6bb0,_0x31dc88){var _0x5c8efd=function(_0x517b3b){while(--_0x517b3b){_0x3d6bb0['push'](_0x3d6bb0['shift']());}};_0x5c8efd(++_0x31dc88);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4ff8cf,_0x20d6c6){_0x4ff8cf=_0x4ff8cf-0x0;var _0x14f1ec=_0xe5b3[_0x4ff8cf];return _0x14f1ec;};'use strict';var util=require('util');var BPromise=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var _=require(_0x3e5b('0x3'));var cmHopper=require(_0x3e5b('0x4'));var cmHopperFinal=require(_0x3e5b('0x5'));var cmHopperHistory=require(_0x3e5b('0x6'));var cmHopperBlack=require(_0x3e5b('0x7'));var voiceQueueRt=require(_0x3e5b('0x8'));var agentReportPreview=require(_0x3e5b('0x9'));var voiceQueueReport=require(_0x3e5b('0xa'));function loggerCatch(_0x54e1fb){return function(_0x174923){logger[_0x3e5b('0xb')](_0x54e1fb,util['inspect'](_0x174923,{'showHidden':![],'depth':null}));};}function create(_0x41d46f){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopperHistory[_0x3e5b('0xe')](_0x41d46f))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1fef54){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](agentReportPreview[_0x3e5b('0xe')](_0x1fef54))[_0x3e5b('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3be027){return BPromise['resolve']()[_0x3e5b('0xd')](cmHopper[_0x3e5b('0x10')](_0x3be027,!![]))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x11')));}exports[_0x3e5b('0x12')]=function(_0x3c4eb1){return BPromise[_0x3e5b('0xc')]()['then'](cmHopperBlack[_0x3e5b('0x12')](_0x3c4eb1))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x3754e3){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper['getContactPreview'](_0x3754e3))[_0x3e5b('0xf')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x258d6a,_0x11b41b){create(_0x258d6a)['catch'](loggerCatch(_0x11b41b));moveContact(_0x258d6a)[_0x3e5b('0xf')](loggerCatch(_0x11b41b));};exports[_0x3e5b('0x13')]=function(_0x555002,_0xc56a2a){createAgent(_0x555002)[_0x3e5b('0xf')](loggerCatch(_0xc56a2a));};exports['createCustomerHistory']=function(_0x4b189d,_0x144fa7){create(_0x4b189d)[_0x3e5b('0xf')](loggerCatch(_0x144fa7));};exports[_0x3e5b('0x14')]=function(_0xff4aba,_0x24de5b){moveContact(_0xff4aba)[_0x3e5b('0xf')](loggerCatch(_0x24de5b));};exports[_0x3e5b('0x15')]=function(_0x21fc32,_0x36c988,_0x3d95f3){if(_0x36c988){_0x21fc32[_0x3e5b('0x16')]=null;}if(_0x3d95f3){_0x21fc32[_0x3e5b('0x17')]=![];}return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper['rescheduleContact'](_0x21fc32))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x18')));};exports[_0x3e5b('0x19')]=function(_0x150674){return BPromise['resolve']()[_0x3e5b('0xd')](cmHopper['countReScheduled'](_0x150674))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x1a')));};exports['unlockContact']=function(_0x41b684){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper[_0x3e5b('0x1b')]({'UserId':null},_0x41b684,0x1))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x1c')));};exports[_0x3e5b('0x1d')]=function(_0x2ddf57){return BPromise['resolve']()[_0x3e5b('0xd')](cmHopper['unlockContact']({'active':![]},_0x2ddf57,0x1))[_0x3e5b('0xf')](loggerCatch('[activeContact]\x20'));};exports[_0x3e5b('0x1e')]=function(_0x1f6473){var _0x1296ec={};_0x1296ec[_0x3e5b('0x1f')]=_0x1f6473[_0x3e5b('0x1f')];_0x1296ec[_0x3e5b('0x20')]=_0x1f6473[_0x3e5b('0x20')];_0x1296ec[_0x3e5b('0x21')]=_0x1f6473[_0x3e5b('0x21')];_0x1296ec[_0x3e5b('0x22')]=_0x1f6473[_0x3e5b('0x22')];_0x1296ec['queue']=_0x1f6473[_0x3e5b('0x23')];_0x1296ec[_0x3e5b('0x24')]=_0x1f6473[_0x3e5b('0x25')];_0x1296ec[_0x3e5b('0x26')]=_0x1f6473[_0x3e5b('0x25')];_0x1296ec[_0x3e5b('0x27')]=0x1;_0x1296ec[_0x3e5b('0x28')]=_0x1f6473['endtime'];_0x1296ec[_0x3e5b('0x29')]=_0x1f6473['membername'];_0x1296ec['context']=_0x3e5b('0x2a');_0x1296ec[_0x3e5b('0x2b')]='xcally-motion-preview';_0x1296ec[_0x3e5b('0x2c')]=0x0;_0x1296ec[_0x3e5b('0x2d')]=0x1;_0x1296ec[_0x3e5b('0x2e')]=_0x1f6473[_0x3e5b('0x2f')];_0x1296ec[_0x3e5b('0x30')]=_0x3e5b('0x31');return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](voiceQueueReport[_0x3e5b('0x32')](_0x1296ec))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x33')));};exports[_0x3e5b('0x34')]=function(_0x5a75b9,_0x141b7e){return BPromise[_0x3e5b('0xc')]()['then'](cmHopper['getContactRecallMe'](_0x5a75b9,_0x141b7e))[_0x3e5b('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x3e5b('0x35')]=function(_0x3f68c6){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper['rescheduleContact'](_0x3f68c6,!![],!![]))[_0x3e5b('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x98a8=['[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x2fde26,_0x1e2baa){var _0x5b5eac=function(_0x36696c){while(--_0x36696c){_0x2fde26['push'](_0x2fde26['shift']());}};_0x5b5eac(++_0x1e2baa);}(_0x98a8,0x12c));var _0x898a=function(_0x1045bf,_0x1ad367){_0x1045bf=_0x1045bf-0x0;var _0x3f4973=_0x98a8[_0x1045bf];return _0x3f4973;};'use strict';var util=require(_0x898a('0x0'));var BPromise=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var _=require(_0x898a('0x4'));var cmHopper=require(_0x898a('0x5'));var cmHopperFinal=require(_0x898a('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x898a('0x7'));var voiceQueueRt=require(_0x898a('0x8'));var agentReportPreview=require(_0x898a('0x9'));var voiceQueueReport=require(_0x898a('0xa'));function loggerCatch(_0x3e7ddd){return function(_0x5d7e59){logger[_0x898a('0xb')](_0x3e7ddd,util['inspect'](_0x5d7e59,{'showHidden':![],'depth':null}));};}function create(_0xfa8c50){return BPromise['resolve']()[_0x898a('0xc')](cmHopperHistory[_0x898a('0xd')](_0xfa8c50))[_0x898a('0xe')](loggerCatch(_0x898a('0xf')));}function createAgent(_0x3150df){return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](agentReportPreview[_0x898a('0xd')](_0x3150df))[_0x898a('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3e1867){return BPromise['resolve']()[_0x898a('0xc')](cmHopper['moveContactManagedDialer'](_0x3e1867,!![]))[_0x898a('0xe')](loggerCatch(_0x898a('0x11')));}exports[_0x898a('0x12')]=function(_0x5f5e06){return BPromise['resolve']()['then'](cmHopperBlack[_0x898a('0x12')](_0x5f5e06))[_0x898a('0xe')](loggerCatch(_0x898a('0x13')));};exports[_0x898a('0x14')]=function(_0x1873e9){return BPromise[_0x898a('0x10')]()['then'](cmHopper[_0x898a('0x14')](_0x1873e9))['catch'](loggerCatch(_0x898a('0x15')));};exports['createHistory']=function(_0x303321,_0x4fb05b){create(_0x303321)[_0x898a('0xe')](loggerCatch(_0x4fb05b));moveContact(_0x303321)['catch'](loggerCatch(_0x4fb05b));};exports[_0x898a('0x16')]=function(_0x3197f7,_0x28cc63){createAgent(_0x3197f7)['catch'](loggerCatch(_0x28cc63));};exports[_0x898a('0x17')]=function(_0x5960e0,_0x54c8f3){create(_0x5960e0)[_0x898a('0xe')](loggerCatch(_0x54c8f3));};exports[_0x898a('0x18')]=function(_0x58c3ab,_0x4d374b){moveContact(_0x58c3ab)[_0x898a('0xe')](loggerCatch(_0x4d374b));};exports[_0x898a('0x19')]=function(_0x38a8f0,_0x2917ff,_0x2da52d){if(_0x2917ff){_0x38a8f0[_0x898a('0x1a')]=null;}if(_0x2da52d){_0x38a8f0[_0x898a('0x1b')]=![];}return BPromise['resolve']()[_0x898a('0xc')](cmHopper[_0x898a('0x19')](_0x38a8f0))[_0x898a('0xe')](loggerCatch(_0x898a('0x1c')));};exports[_0x898a('0x1d')]=function(_0x310bfa){return BPromise['resolve']()[_0x898a('0xc')](cmHopper[_0x898a('0x1d')](_0x310bfa))[_0x898a('0xe')](loggerCatch(_0x898a('0x1e')));};exports[_0x898a('0x1f')]=function(_0x1426e3){return BPromise['resolve']()[_0x898a('0xc')](cmHopper['unlockContact']({'UserId':null},_0x1426e3,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x898a('0x20')]=function(_0x1f4d86){return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](cmHopper[_0x898a('0x1f')]({'active':![]},_0x1f4d86,0x1))[_0x898a('0xe')](loggerCatch(_0x898a('0x21')));};exports[_0x898a('0x22')]=function(_0xd31922){var _0x58149d={};_0x58149d['type']=_0xd31922['type'];_0x58149d[_0x898a('0x23')]=_0xd31922[_0x898a('0x23')];_0x58149d[_0x898a('0x24')]=_0xd31922[_0x898a('0x24')];_0x58149d[_0x898a('0x25')]=_0xd31922[_0x898a('0x25')];_0x58149d[_0x898a('0x26')]=_0xd31922[_0x898a('0x26')];_0x58149d[_0x898a('0x27')]=_0xd31922[_0x898a('0x28')];_0x58149d[_0x898a('0x29')]=_0xd31922[_0x898a('0x28')];_0x58149d['queuecallercomplete']=0x1;_0x58149d[_0x898a('0x2a')]=_0xd31922[_0x898a('0x2b')];_0x58149d[_0x898a('0x2c')]=_0xd31922[_0x898a('0x2d')];_0x58149d[_0x898a('0x2e')]='from-sip';_0x58149d['exten']=_0x898a('0x2f');_0x58149d[_0x898a('0x30')]=0x0;_0x58149d[_0x898a('0x31')]=0x1;_0x58149d['lastAssignedTo']=_0xd31922[_0x898a('0x2d')];_0x58149d[_0x898a('0x32')]=_0x898a('0x33');return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](voiceQueueReport[_0x898a('0x34')](_0x58149d))[_0x898a('0xe')](loggerCatch(_0x898a('0x35')));};exports['getContactRecallMe']=function(_0x33a191,_0x5baf5b){return BPromise['resolve']()[_0x898a('0xc')](cmHopper['getContactRecallMe'](_0x33a191,_0x5baf5b))[_0x898a('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x898a('0x36')]=function(_0x4f202c){return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](cmHopper[_0x898a('0x19')](_0x4f202c,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 9aece6a..b2e4f01 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 _0x3009=['logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','Global','scheduledAt','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','name','interface','buildAcw','queue','not_inuse','status','push','getDiff','seconds','createBody','CampaignId','filterKey','dialAnswer','active','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','milliseconds','diff','inspect','logger','info','loggerError','error','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','logAgent','statedesc','ringtime','starttime','logLookAgent','membername','UserId'];(function(_0x293ce7,_0x1c3aab){var _0x27dc1b=function(_0x524b4c){while(--_0x524b4c){_0x293ce7['push'](_0x293ce7['shift']());}};_0x27dc1b(++_0x1c3aab);}(_0x3009,0x152));var _0x9300=function(_0x3b96bd,_0x176c5b){_0x3b96bd=_0x3b96bd-0x0;var _0x212d75=_0x3009[_0x3b96bd];return _0x212d75;};'use strict';var util=require(_0x9300('0x0'));var _=require(_0x9300('0x1'));var moment=require(_0x9300('0x2'));var logger=require(_0x9300('0x3'))(_0x9300('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x2cdf09,_0x15d221){var _0x3b0fa8=moment(_0x2cdf09)[_0x9300('0x5')](0x0);var _0x3e777b=moment(_0x15d221)[_0x9300('0x5')](0x0);return _0x3b0fa8[_0x9300('0x6')](_0x3e777b,'seconds');}exports['loggerCatch']=function(_0x30a713){return function(_0x2d4342){logger['error'](_0x30a713,util[_0x9300('0x7')](_0x2d4342,{'showHidden':![],'depth':null}));};};exports[_0x9300('0x8')]=function(_0x16fcac,_0x85eb16){logger[_0x9300('0x9')](_0x16fcac,util[_0x9300('0x7')](_0x85eb16,{'showHidden':![],'depth':null}));};exports[_0x9300('0xa')]=function(_0x1f87a5,_0x4528c4){logger[_0x9300('0xb')](_0x1f87a5,util[_0x9300('0x7')](_0x4528c4,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x360bfc){return function(_0x5cdd8d){logger[_0x9300('0x9')](_0x360bfc,util[_0x9300('0x7')](_0x5cdd8d,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x50ac0b,_0xf7e2e8,_0xe97e26){return{'message':_0x50ac0b,'unlock':_0xf7e2e8,'active':_0xe97e26};};exports[_0x9300('0xc')]=function(_0x26ebde,_0x262fe2,_0x3b4116){if(!_[_0x9300('0xd')](_0x3b4116)&&'string'===typeof _0x3b4116&&!_[_0x9300('0xe')](_0x3b4116)){if(!_[_0x9300('0xd')](_0x262fe2)&&_0x9300('0xf')===typeof _0x262fe2&&!_[_0x9300('0xe')](_0x262fe2)){return util[_0x9300('0x10')](_0x9300('0x11'),_0x262fe2,_0x3b4116);}return util[_0x9300('0x10')](_0x9300('0x11'),_0x3b4116,_0x3b4116);}if(!_[_0x9300('0xd')](_0x26ebde)&&_0x9300('0xf')===typeof _0x26ebde&&!_[_0x9300('0xe')](_0x26ebde)){return _0x26ebde;}return _0x9300('0x12');};exports[_0x9300('0x13')]=function(_0x4ea8c4){if(_['isNil'](_0x4ea8c4)){return![];}return _0x4ea8c4;};exports[_0x9300('0x14')]=function(_0x10fd55,_0x365f33,_0x7e79b4,_0x24c264,_0x1b620c,_0x4adbbe){var _0x54680c={'XMD-QUEUE':_0x365f33['Queue']?_0x365f33['Queue']['name']:'','XMD-CALLERID':_0x24c264,'XMD-CALLERID-PREVIEW':_0x4adbbe?util[_0x9300('0x10')](_0x9300('0x11'),_0x4adbbe[_0x9300('0x15')],_0x4adbbe[_0x9300('0x16')]):_0x24c264,'XMD-DIALID':_0x1b620c,'XMD-CONTACTID':_0x365f33['ContactId'],'XMD-CDRTYPE':_0x9300('0x17'),'CALLERID(all)':_0x24c264,'XMD-VOICEQUEUEID':_0x365f33[_0x9300('0x18')],'XMD-DIALCHANNEL':_0x7e79b4,'XMD-DIALTIMEOUT':_0x10fd55[_0x9300('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x9300('0x10')]('\x22rtTxX%s%s\x22',_0x10fd55[_0x9300('0x1a')]?'g':'',_[_0x9300('0xe')](_0x10fd55[_0x9300('0x1b')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x10fd55[_0x9300('0x1c')]||'','XMD-AGI':_0x10fd55[_0x9300('0x1d')]?util[_0x9300('0x10')](_0x9300('0x1e'),ipAgi,_0x10fd55[_0x9300('0x1d')]):_0x9300('0x1f'),'XMD-AGIAFTER':_0x10fd55[_0x9300('0x1a')]?util[_0x9300('0x10')](_0x9300('0x1e'),ipAgi,_0x10fd55[_0x9300('0x1a')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4adbbe?_0x4adbbe[_0x9300('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0x4adbbe?_0x4adbbe['originatecalleridname']:'','XMD-DESTINATION':_0x9300('0x21')};if(!_[_0x9300('0xe')](_0x10fd55[_0x9300('0x1b')])){_0x54680c[util['format']('%s',_0x9300('0x22'))]=_0x10fd55[_0x9300('0x1b')];_0x54680c[util[_0x9300('0x10')]('%s',_0x9300('0x23'))]=_0x1b620c;}if(_0x365f33&&_0x365f33[_0x9300('0x24')]){for(var _0x30e673 in _0x365f33[_0x9300('0x24')]){if(_0x365f33[_0x9300('0x24')][_0x9300('0x25')](_0x30e673)){if(!_[_0x9300('0x26')](_0x365f33[_0x9300('0x24')][_0x30e673])&&_0x30e673!=='id'&&_0x30e673!==_0x9300('0x27')&&_0x30e673!=='createdAt'&&_0x30e673!=='updatedAt'){_0x54680c[util['format'](_0x9300('0x28'),_0x9300('0x29'),_['toUpper'](_0x30e673))]=_0x365f33[_0x9300('0x24')][_0x30e673];}}}}return _0x54680c;};exports[_0x9300('0x2a')]=function(_0x42c5fc){var _0x19569c={};for(var _0x46129c in _0x42c5fc){if(_0x42c5fc[_0x9300('0x25')](_0x46129c)){_0x19569c[util[_0x9300('0x10')]('%s',_[_0x9300('0x2b')](_0x46129c))]=_0x42c5fc[_0x46129c];}}return{'variables':_0x19569c};};exports[_0x9300('0x2c')]=function(_0x5650dc,_0xc56cee){if(!_['isNil'](_0x5650dc)){if(_0x5650dc[_0x9300('0x25')](_0x9300('0x2d'))){if(_0x5650dc[_0x9300('0x2d')]>0x0){_0x5650dc[_0x9300('0x2d')]-=0x1;}else{logger[_0x9300('0xb')](_0x9300('0x2e'),_0xc56cee);}}}else{logger[_0x9300('0xb')](_0x9300('0x2f'),_0xc56cee);}};exports[_0x9300('0x30')]=function(_0x4e5ea0){var _0x1069c4=moment()[_0x9300('0x10')](_0x9300('0x31'));_0x4e5ea0[_0x9300('0x32')]=0xd;_0x4e5ea0['statedesc']=_0x9300('0x33');_0x4e5ea0['starttime']=_0x1069c4;_0x4e5ea0[_0x9300('0x34')]=_0x1069c4;_0x4e5ea0[_0x9300('0x35')]=_0x1069c4;};exports[_0x9300('0x36')]=function(_0x5b6305,_0x396399,_0xf2a4be){var _0x40dca7=moment()['format'](_0x9300('0x31'));_0x5b6305[_0x9300('0x32')]=_0x396399;_0x5b6305[_0x9300('0x37')]=_0xf2a4be;_0x5b6305[_0x9300('0x34')]=_0x40dca7;_0x5b6305[_0x9300('0x38')]=getSeconds(_0x5b6305[_0x9300('0x34')],_0x5b6305[_0x9300('0x39')]);};exports[_0x9300('0x3a')]=function(_0x1c39a1,_0x4624f3,_0x501f73){_0x1c39a1[_0x9300('0x3b')]=_0x4624f3;_0x1c39a1[_0x9300('0x3c')]=_0x501f73;};exports[_0x9300('0x3d')]=function(_0x14eaa7,_0x55b3dd,_0x376f4b){var _0x4aab77=moment()[_0x9300('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x14eaa7[_0x9300('0x32')]=_0x55b3dd;_0x14eaa7[_0x9300('0x37')]=_0x376f4b;_0x14eaa7[_0x9300('0x34')]=_0x14eaa7[_0x9300('0x34')]?_0x14eaa7[_0x9300('0x34')]:_0x4aab77;_0x14eaa7[_0x9300('0x35')]=_0x14eaa7[_0x9300('0x35')]?_0x14eaa7['endtime']:_0x4aab77;_0x14eaa7[_0x9300('0x38')]=getSeconds(_0x14eaa7['responsetime']||0x0,_0x14eaa7[_0x9300('0x39')]||0x0);_0x14eaa7[_0x9300('0x3e')]=_0x14eaa7[_0x9300('0x3f')]?getSeconds(_0x14eaa7[_0x9300('0x35')],_0x14eaa7[_0x9300('0x3f')]):0x0;};exports[_0x9300('0x40')]=function(_0x58bc40){return _0x58bc40===_0x9300('0x41');};exports[_0x9300('0x42')]=function(_0x36f9c2,_0x3e30b0,_0x400e90,_0x98db73,_0x291edb){var _0x467b6b=_0x98db73?_0x9300('0x43'):_0x36f9c2[_0x9300('0x15')];_0x467b6b=_0x291edb?_0x9300('0x44'):_0x467b6b;return{'actionid':_0x36f9c2[_0x9300('0x45')],'action':_0x9300('0x46'),'channel':_0x36f9c2[_0x9300('0x47')],'callerid':util[_0x9300('0x10')](_0x9300('0x11'),_0x467b6b,_0x36f9c2['calleridnum']),'Exten':_0x9300('0x21'),'Context':_0x9300('0x48'),'Priority':'1','variable':_0x400e90,'timeout':(_0x3e30b0['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x36f9c2['uniqueid']};};exports[_0x9300('0x49')]=function(_0xa5f68d){return _0xa5f68d[_0x9300('0x4a')]+_0xa5f68d['countcongestionretry']+_0xa5f68d[_0x9300('0x4b')];};exports[_0x9300('0x4c')]=function(_0x55fa5a){var _0x17accd=_['clone'](_0x55fa5a);_0x17accd[_0x9300('0x32')]=0xf;_0x17accd[_0x9300('0x37')]=_0x9300('0x4d');return _0x17accd;};exports[_0x9300('0x4e')]=function(_0x4ba6ed,_0x3b8fa8,_0x56e34c){var _0x55c5a3={};_0x55c5a3[_0x3b8fa8]=_0x4ba6ed[_0x3b8fa8];_0x55c5a3['active']=![];_0x55c5a3['scheduledat']=moment()[_0x9300('0x4f')](_0x56e34c,_0x9300('0x50'))['format'](_0x9300('0x31'));_0x55c5a3['ContactId']=_0x4ba6ed[_0x9300('0x51')];_0x55c5a3[_0x9300('0x52')]=_0x4ba6ed[_0x9300('0x52')];_0x55c5a3[_0x9300('0x18')]=_0x4ba6ed[_0x9300('0x18')]||undefined;return _0x55c5a3;};exports[_0x9300('0x53')]=function(_0x404e0b,_0x46a581){if(!_[_0x9300('0x26')](_0x404e0b)){if(_0x404e0b[_0x9300('0x54')]>0x0){_0x404e0b[_0x9300('0x54')]-=0x1;}else{logger[_0x9300('0xb')](_0x46a581,_0x9300('0x55'));}}else{logger['error'](_0x46a581,_0x9300('0x56'));}};exports['IsNotLoggedIn']=function(_0x1593e6){if(_0x1593e6<=0x0){return!![];}return![];};exports[_0x9300('0x57')]=function(_0x342a03,_0x575728){_0x342a03[_0x9300('0x58')]=_0x575728;_0x342a03[_0x9300('0x59')]=_0x342a03['queue'];_0x342a03[_0x9300('0x5a')]=_0x342a03[_0x9300('0x47')];return _0x342a03;};exports[_0x9300('0x5b')]=function(_0x174f12){var _0x2515e4={};_0x2515e4[_0x9300('0x5c')]=_0x174f12[_0x9300('0x5c')];_0x2515e4[_0x9300('0x5a')]=_0x174f12[_0x9300('0x47')];_0x2515e4[_0x9300('0x45')]=_0x174f12[_0x9300('0x45')];return _0x2515e4;};exports['agentReadyId']=function(_0x3b6cf0){var _0x1f1614=[];for(var _0x89f1a6 in _0x3b6cf0){if(_0x3b6cf0[_0x9300('0x25')](_0x89f1a6)){if(!_['isNil'](_0x3b6cf0[_0x89f1a6])&&_0x3b6cf0[_0x89f1a6][_0x9300('0x32')]===_0x9300('0x5d')&&_0x3b6cf0[_0x89f1a6][_0x9300('0x5e')]==='reachable'){_0x1f1614[_0x9300('0x5f')](_0x3b6cf0[_0x89f1a6]['id']);}}}return _0x1f1614;};exports[_0x9300('0x60')]=function(_0x5355a7){var _0x129968=moment()['milliseconds'](0x0);var _0x624997=moment(_0x5355a7)[_0x9300('0x5')](0x0);return _0x129968[_0x9300('0x6')](_0x624997,_0x9300('0x61'));};exports[_0x9300('0x62')]=function(_0xb3f129){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xb3f129['ContactId'],'ListId':_0xb3f129[_0x9300('0x52')],'VoiceQueueId':_0xb3f129['VoiceQueueId']||undefined,'CampaignId':_0xb3f129[_0x9300('0x63')]||undefined};};exports[_0x9300('0x64')]=function(_0x21ded6){if(_0x21ded6===_0x9300('0x45')||_0x21ded6==='idContact'||_0x21ded6===_0x9300('0x5c')||_0x21ded6==='type'||_0x21ded6==='campaigntype'||_0x21ded6===_0x9300('0x65')||_0x21ded6===_0x9300('0x3b')||_0x21ded6==='channelAgent'||_0x21ded6===_0x9300('0x15')||_0x21ded6===_0x9300('0x66')||_0x21ded6===_0x9300('0x16')||_0x21ded6===_0x9300('0x67')||_0x21ded6===_0x9300('0x4a')||_0x21ded6==='countcongestionretry'||_0x21ded6===_0x9300('0x4b')||_0x21ded6===_0x9300('0x68')||_0x21ded6===_0x9300('0x69')||_0x21ded6===_0x9300('0x6a')||_0x21ded6===_0x9300('0x6b')||_0x21ded6===_0x9300('0x6c')||_0x21ded6===_0x9300('0x51')||_0x21ded6===_0x9300('0x52')||_0x21ded6===_0x9300('0x3c')||_0x21ded6===_0x9300('0x18')||_0x21ded6===_0x9300('0x6d')||_0x21ded6==='xmd-voicequeueid'||_0x21ded6===_0x9300('0x6e')||_0x21ded6===_0x9300('0x6f')||_0x21ded6===_0x9300('0x70')||_0x21ded6==='xmd-dialurl'||_0x21ded6==='xmd-dialtimeout'||_0x21ded6===_0x9300('0x71')||_0x21ded6==='xmd-dialid'||_0x21ded6===_0x9300('0x72')||_0x21ded6===_0x9300('0x73')||_0x21ded6==='xmd-cdrtype'||_0x21ded6===_0x9300('0x74')||_0x21ded6===_0x9300('0x75')||_0x21ded6==='xmd-agi'||_0x21ded6===_0x9300('0x76')||_0x21ded6===_0x9300('0x77')||_0x21ded6===_0x9300('0x78')||_0x21ded6===_0x9300('0x79')||_0x21ded6===_0x9300('0x7a')||_0x21ded6===_0x9300('0x7b')||_0x21ded6==='rtpaudioqosrtt'||_0x21ded6===_0x9300('0x7c')||_0x21ded6===_0x9300('0x76')||_0x21ded6==='rtpaudioqosbridged'||_0x21ded6===_0x9300('0x78')||_0x21ded6===_0x9300('0x79')||_0x21ded6===_0x9300('0x7a')||_0x21ded6===_0x9300('0x7b')||_0x21ded6==='rtpaudioqosrtt'||_0x21ded6===_0x9300('0x7c')||_0x21ded6===_0x9300('0x7d')||_0x21ded6===_0x9300('0x7e')||_0x21ded6===_0x9300('0x32')||_0x21ded6===_0x9300('0x37')){return![];}return!![];};exports[_0x9300('0x7f')]=function(_0x40f2ae,_0x46d8fc){var _0x38cd71,_0x2b98af,_0x1ff84c;if(_0x46d8fc<=0x0){_0x46d8fc=0x1;}_0x38cd71=new RegExp(_0x9300('0x80')+_0x46d8fc+'}$');_0x2b98af=Math[_0x9300('0x81')](0xa,_0x46d8fc-0x1);_0x1ff84c=Math[_0x9300('0x81')](0xa,_0x46d8fc)-0x1;return util[_0x9300('0x10')]('%s',_['replace'](_0x40f2ae,_0x38cd71,_[_0x9300('0x82')](_0x2b98af,_0x1ff84c)));};exports[_0x9300('0x83')]=function(_0x54483b){var _0x81ec21=_0x54483b[_0x9300('0x84')](/"(.*?)"/);return _0x81ec21?_0x81ec21[0x1]:_0x54483b;};exports['extractCalleridNumber']=function(_0x181c6a){var _0x169744=_0x181c6a[_0x9300('0x84')](/<(.*?)>/);return _0x169744?_0x169744[0x1]:_0x181c6a;}; \ No newline at end of file +var _0xa453=['extractCalleridNumber','util','lodash','moment','env','XCALLY_IP_AGI','diff','loggerCatch','logger','inspect','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','statedesc','responsetime','ringtime','logLookAgent','answertime','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','milliseconds','createBody','CampaignId','filterKey','dialAnswer','membername','countglobal','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match'];(function(_0x33ecc7,_0x56a919){var _0x2c4e1b=function(_0x1488d0){while(--_0x1488d0){_0x33ecc7['push'](_0x33ecc7['shift']());}};_0x2c4e1b(++_0x56a919);}(_0xa453,0x1a2));var _0x3a45=function(_0x4c45cc,_0x49e73c){_0x4c45cc=_0x4c45cc-0x0;var _0x4adb7d=_0xa453[_0x4c45cc];return _0x4adb7d;};'use strict';var util=require(_0x3a45('0x0'));var _=require(_0x3a45('0x1'));var moment=require(_0x3a45('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x3a45('0x3')][_0x3a45('0x4')]||'127.0.0.1';function getSeconds(_0x5e0df1,_0x1d26a1){var _0x2dd062=moment(_0x5e0df1)['milliseconds'](0x0);var _0x5c9f71=moment(_0x1d26a1)['milliseconds'](0x0);return _0x2dd062[_0x3a45('0x5')](_0x5c9f71,'seconds');}exports[_0x3a45('0x6')]=function(_0x380d22){return function(_0x533090){logger['error'](_0x380d22,util['inspect'](_0x533090,{'showHidden':![],'depth':null}));};};exports[_0x3a45('0x7')]=function(_0x150f23,_0x864c8d){logger['info'](_0x150f23,util['inspect'](_0x864c8d,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3c017d,_0x4cea85){logger['error'](_0x3c017d,util[_0x3a45('0x8')](_0x4cea85,{'showHidden':![],'depth':null}));};exports[_0x3a45('0x9')]=function(_0x4ff3a1){return function(_0xb4e095){logger['info'](_0x4ff3a1,util[_0x3a45('0x8')](_0xb4e095,{'showHidden':![],'depth':null}));};};exports[_0x3a45('0xa')]=function(_0x602ba9,_0xfec05c,_0x471315){return{'message':_0x602ba9,'unlock':_0xfec05c,'active':_0x471315};};exports[_0x3a45('0xb')]=function(_0x1f6efe,_0x284dc6,_0x2dd2e8){if(!_['isUndefined'](_0x2dd2e8)&&_0x3a45('0xc')===typeof _0x2dd2e8&&!_[_0x3a45('0xd')](_0x2dd2e8)){if(!_[_0x3a45('0xe')](_0x284dc6)&&_0x3a45('0xc')===typeof _0x284dc6&&!_['isEmpty'](_0x284dc6)){return util[_0x3a45('0xf')]('\x22%s\x22\x20<%s>',_0x284dc6,_0x2dd2e8);}return util[_0x3a45('0xf')](_0x3a45('0x10'),_0x2dd2e8,_0x2dd2e8);}if(!_[_0x3a45('0xe')](_0x1f6efe)&&'string'===typeof _0x1f6efe&&!_[_0x3a45('0xd')](_0x1f6efe)){return _0x1f6efe;}return _0x3a45('0x11');};exports[_0x3a45('0x12')]=function(_0x15f216){if(_[_0x3a45('0x13')](_0x15f216)){return![];}return _0x15f216;};exports['addVariables']=function(_0x461af8,_0x5c3494,_0x3afa01,_0x317bce,_0x557da5,_0x2a6ef){var _0x2cb35e={'XMD-QUEUE':_0x5c3494[_0x3a45('0x14')]?_0x5c3494[_0x3a45('0x14')]['name']:'','XMD-CALLERID':_0x317bce,'XMD-CALLERID-PREVIEW':_0x2a6ef?util[_0x3a45('0xf')]('\x22%s\x22\x20<%s>',_0x2a6ef['calleridname'],_0x2a6ef[_0x3a45('0x15')]):_0x317bce,'XMD-DIALID':_0x557da5,'XMD-CONTACTID':_0x5c3494[_0x3a45('0x16')],'XMD-CDRTYPE':_0x3a45('0x17'),'CALLERID(all)':_0x317bce,'XMD-VOICEQUEUEID':_0x5c3494[_0x3a45('0x18')],'XMD-DIALCHANNEL':_0x3afa01,'XMD-DIALTIMEOUT':_0x461af8[_0x3a45('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x3a45('0xf')]('\x22rtTxX%s%s\x22',_0x461af8[_0x3a45('0x1a')]?'g':'',_['isEmpty'](_0x461af8[_0x3a45('0x1b')])?'':_0x3a45('0x1c')),'XMD-DIALURL':_0x461af8[_0x3a45('0x1d')]||'','XMD-AGI':_0x461af8[_0x3a45('0x1e')]?util[_0x3a45('0xf')](_0x3a45('0x1f'),ipAgi,_0x461af8[_0x3a45('0x1e')]):_0x3a45('0x20'),'XMD-AGIAFTER':_0x461af8['dialQueueProject2']?util[_0x3a45('0xf')](_0x3a45('0x1f'),ipAgi,_0x461af8[_0x3a45('0x1a')]):_0x3a45('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x2a6ef?_0x2a6ef[_0x3a45('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x2a6ef?_0x2a6ef[_0x3a45('0x22')]:'','XMD-DESTINATION':_0x3a45('0x23')};if(!_[_0x3a45('0xd')](_0x461af8[_0x3a45('0x1b')])){_0x2cb35e[util[_0x3a45('0xf')]('%s',_0x3a45('0x24'))]=_0x461af8[_0x3a45('0x1b')];_0x2cb35e[util[_0x3a45('0xf')]('%s',_0x3a45('0x25'))]=_0x557da5;}if(_0x5c3494&&_0x5c3494[_0x3a45('0x26')]){for(var _0x354777 in _0x5c3494[_0x3a45('0x26')]){if(_0x5c3494[_0x3a45('0x26')][_0x3a45('0x27')](_0x354777)){if(!_[_0x3a45('0x13')](_0x5c3494[_0x3a45('0x26')][_0x354777])&&_0x354777!=='id'&&_0x354777!==_0x3a45('0x28')&&_0x354777!==_0x3a45('0x29')&&_0x354777!==_0x3a45('0x2a')){_0x2cb35e[util['format'](_0x3a45('0x2b'),_0x3a45('0x2c'),_[_0x3a45('0x2d')](_0x354777))]=_0x5c3494[_0x3a45('0x26')][_0x354777];}}}}return _0x2cb35e;};exports[_0x3a45('0x2e')]=function(_0x4dcafb){var _0x4cf515={};for(var _0x542583 in _0x4dcafb){if(_0x4dcafb[_0x3a45('0x27')](_0x542583)){_0x4cf515[util[_0x3a45('0xf')]('%s',_[_0x3a45('0x2f')](_0x542583))]=_0x4dcafb[_0x542583];}}return{'variables':_0x4cf515};};exports[_0x3a45('0x30')]=function(_0x412c73,_0x2a5b73){if(!_[_0x3a45('0x13')](_0x412c73)){if(_0x412c73[_0x3a45('0x27')](_0x3a45('0x31'))){if(_0x412c73['originated']>0x0){_0x412c73['originated']-=0x1;}else{logger[_0x3a45('0x32')](_0x3a45('0x33'),_0x2a5b73);}}}else{logger[_0x3a45('0x32')](_0x3a45('0x34'),_0x2a5b73);}};exports[_0x3a45('0x35')]=function(_0x17bc12){var _0x4feef5=moment()[_0x3a45('0xf')](_0x3a45('0x36'));_0x17bc12[_0x3a45('0x37')]=0xd;_0x17bc12['statedesc']=_0x3a45('0x38');_0x17bc12[_0x3a45('0x39')]=_0x4feef5;_0x17bc12['responsetime']=_0x4feef5;_0x17bc12[_0x3a45('0x3a')]=_0x4feef5;};exports['logAgent']=function(_0x228c6e,_0x3b124e,_0x574d6b){var _0x57c950=moment()[_0x3a45('0xf')](_0x3a45('0x36'));_0x228c6e['state']=_0x3b124e;_0x228c6e[_0x3a45('0x3b')]=_0x574d6b;_0x228c6e[_0x3a45('0x3c')]=_0x57c950;_0x228c6e[_0x3a45('0x3d')]=getSeconds(_0x228c6e[_0x3a45('0x3c')],_0x228c6e[_0x3a45('0x39')]);};exports[_0x3a45('0x3e')]=function(_0x5a2f5d,_0x56b79b,_0x224041){_0x5a2f5d['membername']=_0x56b79b;_0x5a2f5d['UserId']=_0x224041;};exports['logCustomer']=function(_0x3effba,_0x4a11aa,_0x269627){var _0x5e41c9=moment()[_0x3a45('0xf')](_0x3a45('0x36'));_0x3effba[_0x3a45('0x37')]=_0x4a11aa;_0x3effba[_0x3a45('0x3b')]=_0x269627;_0x3effba['responsetime']=_0x3effba[_0x3a45('0x3c')]?_0x3effba[_0x3a45('0x3c')]:_0x5e41c9;_0x3effba[_0x3a45('0x3a')]=_0x3effba[_0x3a45('0x3a')]?_0x3effba[_0x3a45('0x3a')]:_0x5e41c9;_0x3effba[_0x3a45('0x3d')]=getSeconds(_0x3effba['responsetime']||0x0,_0x3effba[_0x3a45('0x39')]||0x0);_0x3effba['talktime']=_0x3effba[_0x3a45('0x3f')]?getSeconds(_0x3effba[_0x3a45('0x3a')],_0x3effba[_0x3a45('0x3f')]):0x0;};exports['isFailure']=function(_0x36d2e3){return _0x36d2e3===_0x3a45('0x40');};exports[_0x3a45('0x41')]=function(_0x1e656f,_0x33f967,_0xc971bf,_0x346388,_0x2164bf){var _0x392d36=_0x346388?_0x3a45('0x42'):_0x1e656f[_0x3a45('0x43')];_0x392d36=_0x2164bf?'BOOKED':_0x392d36;return{'actionid':_0x1e656f[_0x3a45('0x44')],'action':_0x3a45('0x45'),'channel':_0x1e656f[_0x3a45('0x46')],'callerid':util[_0x3a45('0xf')]('\x22%s\x22\x20<%s>',_0x392d36,_0x1e656f[_0x3a45('0x15')]),'Exten':_0x3a45('0x23'),'Context':_0x3a45('0x47'),'Priority':'1','variable':_0xc971bf,'timeout':(_0x33f967[_0x3a45('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1e656f[_0x3a45('0x44')]};};exports[_0x3a45('0x49')]=function(_0x2cbe76){return _0x2cbe76[_0x3a45('0x4a')]+_0x2cbe76[_0x3a45('0x4b')]+_0x2cbe76[_0x3a45('0x4c')];};exports[_0x3a45('0x4d')]=function(_0x567886){var _0x44b487=_['clone'](_0x567886);_0x44b487['state']=0xf;_0x44b487[_0x3a45('0x3b')]=_0x3a45('0x4e');return _0x44b487;};exports[_0x3a45('0x4f')]=function(_0x331d24,_0x4e54c8,_0x33dfcd){var _0x2de8f8={};_0x2de8f8[_0x4e54c8]=_0x331d24[_0x4e54c8];_0x2de8f8[_0x3a45('0x50')]=![];_0x2de8f8[_0x3a45('0x51')]=moment()[_0x3a45('0x52')](_0x33dfcd,_0x3a45('0x53'))[_0x3a45('0xf')](_0x3a45('0x36'));_0x2de8f8[_0x3a45('0x16')]=_0x331d24[_0x3a45('0x16')];_0x2de8f8[_0x3a45('0x54')]=_0x331d24['ListId'];_0x2de8f8[_0x3a45('0x18')]=_0x331d24[_0x3a45('0x18')]||undefined;return _0x2de8f8;};exports[_0x3a45('0x55')]=function(_0x257007,_0x19d783){if(!_['isNil'](_0x257007)){if(_0x257007[_0x3a45('0x56')]>0x0){_0x257007[_0x3a45('0x56')]-=0x1;}else{logger['error'](_0x19d783,_0x3a45('0x57'));}}else{logger[_0x3a45('0x32')](_0x19d783,_0x3a45('0x58'));}};exports[_0x3a45('0x59')]=function(_0x2ee251){if(_0x2ee251<=0x0){return!![];}return![];};exports['buildObj']=function(_0xea270c,_0x360448){_0xea270c[_0x3a45('0x5a')]=_0x360448;_0xea270c[_0x3a45('0x5b')]=_0xea270c[_0x3a45('0x5c')];_0xea270c['interface']=_0xea270c[_0x3a45('0x46')];return _0xea270c;};exports[_0x3a45('0x5d')]=function(_0x5641df){var _0x5c3992={};_0x5c3992[_0x3a45('0x5c')]=_0x5641df[_0x3a45('0x5c')];_0x5c3992['interface']=_0x5641df['channelAgent'];_0x5c3992[_0x3a45('0x44')]=_0x5641df[_0x3a45('0x44')];return _0x5c3992;};exports[_0x3a45('0x5e')]=function(_0x1bb48f){var _0x163d9a=[];for(var _0x2423f6 in _0x1bb48f){if(_0x1bb48f[_0x3a45('0x27')](_0x2423f6)){if(!_[_0x3a45('0x13')](_0x1bb48f[_0x2423f6])&&_0x1bb48f[_0x2423f6][_0x3a45('0x37')]===_0x3a45('0x5f')&&_0x1bb48f[_0x2423f6][_0x3a45('0x60')]===_0x3a45('0x61')){_0x163d9a['push'](_0x1bb48f[_0x2423f6]['id']);}}}return _0x163d9a;};exports[_0x3a45('0x62')]=function(_0x2ae869){var _0x32a2a2=moment()[_0x3a45('0x63')](0x0);var _0x12e6e8=moment(_0x2ae869)['milliseconds'](0x0);return _0x32a2a2[_0x3a45('0x5')](_0x12e6e8,'seconds');};exports[_0x3a45('0x64')]=function(_0x3f81b0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3f81b0['ContactId'],'ListId':_0x3f81b0[_0x3a45('0x54')],'VoiceQueueId':_0x3f81b0[_0x3a45('0x18')]||undefined,'CampaignId':_0x3f81b0[_0x3a45('0x65')]||undefined};};exports[_0x3a45('0x66')]=function(_0x54d570){if(_0x54d570==='uniqueid'||_0x54d570==='idContact'||_0x54d570===_0x3a45('0x5c')||_0x54d570==='type'||_0x54d570==='campaigntype'||_0x54d570===_0x3a45('0x67')||_0x54d570===_0x3a45('0x68')||_0x54d570===_0x3a45('0x46')||_0x54d570===_0x3a45('0x43')||_0x54d570===_0x3a45('0x50')||_0x54d570===_0x3a45('0x15')||_0x54d570===_0x3a45('0x51')||_0x54d570===_0x3a45('0x4a')||_0x54d570==='countcongestionretry'||_0x54d570===_0x3a45('0x4c')||_0x54d570===_0x3a45('0x69')||_0x54d570==='callback'||_0x54d570===_0x3a45('0x6a')||_0x54d570===_0x3a45('0x6b')||_0x54d570===_0x3a45('0x6c')||_0x54d570==='ContactId'||_0x54d570===_0x3a45('0x54')||_0x54d570===_0x3a45('0x6d')||_0x54d570===_0x3a45('0x18')||_0x54d570===_0x3a45('0x6e')||_0x54d570==='xmd-voicequeueid'||_0x54d570===_0x3a45('0x6f')||_0x54d570===_0x3a45('0x70')||_0x54d570===_0x3a45('0x71')||_0x54d570==='xmd-dialurl'||_0x54d570===_0x3a45('0x72')||_0x54d570===_0x3a45('0x73')||_0x54d570===_0x3a45('0x74')||_0x54d570===_0x3a45('0x75')||_0x54d570===_0x3a45('0x76')||_0x54d570==='xmd-cdrtype'||_0x54d570===_0x3a45('0x77')||_0x54d570===_0x3a45('0x78')||_0x54d570===_0x3a45('0x79')||_0x54d570===_0x3a45('0x7a')||_0x54d570===_0x3a45('0x7b')||_0x54d570===_0x3a45('0x7c')||_0x54d570===_0x3a45('0x7d')||_0x54d570===_0x3a45('0x7e')||_0x54d570===_0x3a45('0x7f')||_0x54d570===_0x3a45('0x80')||_0x54d570==='rtpaudioqosrttbridged'||_0x54d570===_0x3a45('0x7a')||_0x54d570==='rtpaudioqosbridged'||_0x54d570===_0x3a45('0x7c')||_0x54d570===_0x3a45('0x7d')||_0x54d570===_0x3a45('0x7e')||_0x54d570===_0x3a45('0x7f')||_0x54d570===_0x3a45('0x80')||_0x54d570==='rtpaudioqosrttbridged'||_0x54d570===_0x3a45('0x81')||_0x54d570===_0x3a45('0x82')||_0x54d570===_0x3a45('0x37')||_0x54d570===_0x3a45('0x3b')){return![];}return!![];};exports[_0x3a45('0x83')]=function(_0x43c888,_0x2b0c81){var _0x683600,_0x4b1e30,_0x18d5f7;if(_0x2b0c81<=0x0){_0x2b0c81=0x1;}_0x683600=new RegExp(_0x3a45('0x84')+_0x2b0c81+'}$');_0x4b1e30=Math['pow'](0xa,_0x2b0c81-0x1);_0x18d5f7=Math[_0x3a45('0x85')](0xa,_0x2b0c81)-0x1;return util[_0x3a45('0xf')]('%s',_[_0x3a45('0x86')](_0x43c888,_0x683600,_[_0x3a45('0x87')](_0x4b1e30,_0x18d5f7)));};exports[_0x3a45('0x88')]=function(_0x3a9710){var _0x4881bd=_0x3a9710[_0x3a45('0x89')](/"(.*?)"/);return _0x4881bd?_0x4881bd[0x1]:_0x3a9710;};exports[_0x3a45('0x8a')]=function(_0x426805){var _0x3971b3=_0x426805[_0x3a45('0x89')](/<(.*?)>/);return _0x3971b3?_0x3971b3[0x1]:_0x426805;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index bda97d2..4cfcf0e 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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x1e7e79,_0x241325){var _0x5eba07=function(_0x57f6e5){while(--_0x57f6e5){_0x1e7e79['push'](_0x1e7e79['shift']());}};_0x5eba07(++_0x241325);}(_0x5f2f,0x73));var _0xf5f2=function(_0x516a18,_0xb1e5f6){_0x516a18=_0x516a18-0x0;var _0x2b2d6b=_0x5f2f[_0x516a18];return _0x2b2d6b;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x418874,_0x3c4c7e){var _0x1420e4=function(_0x26b306){while(--_0x26b306){_0x418874['push'](_0x418874['shift']());}};_0x1420e4(++_0x3c4c7e);}(_0xb10b,0x12a));var _0xbb10=function(_0x3995dd,_0x24f96f){_0x3995dd=_0x3995dd-0x0;var _0x410f8a=_0xb10b[_0x3995dd];return _0x410f8a;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index bb0e2cb..7457567 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 _0xa138=['initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','initCampaignHopperHistory','exports','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones'];(function(_0x6dde94,_0x519143){var _0x43e0f4=function(_0x12f574){while(--_0x12f574){_0x6dde94['push'](_0x6dde94['shift']());}};_0x43e0f4(++_0x519143);}(_0xa138,0x174));var _0x8a13=function(_0x30fbb3,_0x4a9819){_0x30fbb3=_0x30fbb3-0x0;var _0xf061b1=_0xa138[_0x30fbb3];return _0xf061b1;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x8a13('0x0'));var moment=require(_0x8a13('0x1'));var Agent=require(_0x8a13('0x2'));var Telephone=require(_0x8a13('0x3'));var Trunk=require(_0x8a13('0x4'));var VoiceQueue=require(_0x8a13('0x5'));var Trigger=require(_0x8a13('0x6'));var Template=require(_0x8a13('0x7'));var Campaign=require(_0x8a13('0x8'));var VoiceExtension=require(_0x8a13('0x9'));var ZendeskAccount=require(_0x8a13('0xa'));var SalesforceAccount=require(_0x8a13('0xb'));var FreshdeskAccount=require(_0x8a13('0xc'));var SugarcrmAccount=require(_0x8a13('0xd'));var ZohoAccount=require(_0x8a13('0xe'));var DeskAccount=require(_0x8a13('0xf'));var VtigerAccount=require(_0x8a13('0x10'));var ServicenowAccount=require(_0x8a13('0x11'));var Dynamics365Account=require(_0x8a13('0x12'));var FaxAccount=require(_0x8a13('0x13'));var Realtime=function(){this[_0x8a13('0x14')]={};this[_0x8a13('0x15')]={};this[_0x8a13('0x16')]={};this[_0x8a13('0x17')]={};this[_0x8a13('0x18')]={};this[_0x8a13('0x19')]={};this[_0x8a13('0x1a')]={};this[_0x8a13('0x1b')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8a13('0x1c')]={};this[_0x8a13('0x1d')]={};this[_0x8a13('0x1e')]={};this[_0x8a13('0x1f')]={};this[_0x8a13('0x20')]={};this[_0x8a13('0x21')]={};this[_0x8a13('0x22')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x8a13('0x23')]={};this[_0x8a13('0x24')]={};this[_0x8a13('0x25')]={};this[_0x8a13('0x26')]={};this['dynamics365Accounts']={};this[_0x8a13('0x27')]={};};function freeIsNotKey(_0x5893a9,_0x38fed1,_0x5f38f9){var _0x57411e=_[_0x8a13('0x28')](_0x5893a9,function(_0xaabc6c,_0x101b81){return _0xaabc6c[_0x5f38f9];});for(var _0x2a0011 in _0x38fed1){if(_0x38fed1[_0x8a13('0x29')](_0x2a0011)){if(!_0x57411e[_0x2a0011]){delete _0x38fed1[_0x2a0011];}}}}function freeIsNotKeySip(_0x285b34,_0x16eac2){var _0x5a63ea=_[_0x8a13('0x28')](_0x285b34,function(_0x33b49c,_0x31d2b0){return util[_0x8a13('0x2a')](_0x8a13('0x2b'),_0x33b49c['name']);});for(var _0x40e80d in _0x16eac2){if(_0x16eac2[_0x8a13('0x29')](_0x40e80d)){if(!_0x5a63ea[_0x40e80d]){delete _0x16eac2[_0x40e80d];}}}}function freeIsNotKeyAgent(_0x5007a5,_0x2a4af8){var _0x2e27e6=_['mapKeys'](_0x5007a5,function(_0x129373,_0x28b0ed){var _0x3bcadb=_[_0x8a13('0x2c')](_0x129373[_0x8a13('0x2d')])?util['format'](_0x8a13('0x2b'),_0x129373[_0x8a13('0x2e')]):_0x129373[_0x8a13('0x2d')];return _0x3bcadb;});for(var _0x400429 in _0x2a4af8){if(_0x2a4af8[_0x8a13('0x29')](_0x400429)){if(!_0x2e27e6[_0x400429]){delete _0x2a4af8[_0x400429];}}}}function clearVoiceCallReports(_0x5848b6){_0x5848b6[_0x8a13('0x2f')]=0x0;_0x5848b6[_0x8a13('0x30')]=0x0;_0x5848b6[_0x8a13('0x31')]=0x0;_0x5848b6[_0x8a13('0x32')]=0x0;_0x5848b6['sumBillable']=0x0;}function clearCampaigns(_0x1652d3){if(!_[_0x8a13('0x33')](_0x1652d3)){for(var _0x5c89a0 in _0x1652d3){if(_0x1652d3['hasOwnProperty'](_0x5c89a0)){_0x1652d3[_0x5c89a0][_0x8a13('0x34')]=0x0;_0x1652d3[_0x5c89a0][_0x8a13('0x35')]=0x0;}}}}function clearVoiceQueues(_0x24db35){if(!_[_0x8a13('0x33')](_0x24db35)){for(var _0x2d42e5 in _0x24db35){if(_0x24db35['hasOwnProperty'](_0x2d42e5)){_0x24db35[_0x2d42e5][_0x8a13('0x2f')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x30')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x36')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x37')]=0x0;_0x24db35[_0x2d42e5]['sumHoldTime']=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x32')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x38')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x39')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x3a')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x3b')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x3c')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x3d')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x3e')]=0x0;_0x24db35[_0x2d42e5]['outboundDropCallsDayTimeout']=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x3f')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x40')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x41')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x42')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x43')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x39')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x44')]=0x0;_0x24db35[_0x2d42e5][_0x8a13('0x45')]=!![];}}}}Realtime[_0x8a13('0x46')][_0x8a13('0x47')]=function(_0x3a7a00,_0xefe985){for(var _0x3205df in _0xefe985){if(_0x3a7a00[_0x8a13('0x29')](_0x3205df)){_0x3a7a00[_0x3205df]=_0xefe985[_0x3205df];}}};Realtime[_0x8a13('0x46')][_0x8a13('0x48')]=function(){var _0x1eb612=this;return function(_0x32541d){if(_0x32541d){freeIsNotKeyAgent(_0x32541d,_0x1eb612['agents']);for(var _0x1cea17=0x0,_0x2920c3={},_0x12f050={};_0x1cea17<_0x32541d[_0x8a13('0x49')];_0x1cea17+=0x1){_0x2920c3=_0x32541d[_0x1cea17];var _0x574b22=_[_0x8a13('0x2c')](_0x2920c3[_0x8a13('0x2d')])?util['format']('SIP/%s',_0x2920c3[_0x8a13('0x2e')]):_0x2920c3[_0x8a13('0x2d')];if(_[_0x8a13('0x4a')](_0x1eb612[_0x8a13('0x14')][_0x574b22])){_0x1eb612[_0x8a13('0x14')][_0x574b22]=new Agent(_0x2920c3);}else{_0x1eb612[_0x8a13('0x47')](_0x1eb612[_0x8a13('0x14')][_0x574b22],_0x2920c3);}}}return _0x1eb612[_0x8a13('0x14')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x4b')]=function(){var _0x1c74bb=this;return function(_0x1c3423){if(_0x1c3423){freeIsNotKeySip(_0x1c3423,_0x1c74bb[_0x8a13('0x15')]);for(var _0x4415cd=0x0,_0xc8a590={},_0x2630bd={};_0x4415cd<_0x1c3423['length'];_0x4415cd+=0x1){_0xc8a590=_0x1c3423[_0x4415cd];if(_[_0x8a13('0x4a')](_0x1c74bb[_0x8a13('0x15')][util[_0x8a13('0x2a')](_0x8a13('0x2b'),_0xc8a590['name'])])){_0x1c74bb[_0x8a13('0x15')][util['format']('SIP/%s',_0xc8a590[_0x8a13('0x2e')])]=new Telephone(_0xc8a590);}else{_0x1c74bb[_0x8a13('0x47')](_0x1c74bb['telephones'][util[_0x8a13('0x2a')](_0x8a13('0x2b'),_0xc8a590[_0x8a13('0x2e')])],_0xc8a590);}}}return _0x1c74bb['telephones'];};};Realtime[_0x8a13('0x46')]['initTrunks']=function(){var _0xa4dfbf=this;return function(_0x39c629){if(_0x39c629){freeIsNotKeySip(_0x39c629,_0xa4dfbf[_0x8a13('0x16')]);for(var _0x3aa6f7=0x0,_0x3bfe4d={},_0x24c9a0={};_0x3aa6f7<_0x39c629[_0x8a13('0x49')];_0x3aa6f7+=0x1){_0x3bfe4d=_0x39c629[_0x3aa6f7];if(_[_0x8a13('0x4a')](_0xa4dfbf[_0x8a13('0x16')][util['format']('SIP/%s',_0x3bfe4d[_0x8a13('0x2e')])])){_0xa4dfbf[_0x8a13('0x16')][util[_0x8a13('0x2a')](_0x8a13('0x2b'),_0x3bfe4d['name'])]=new Trunk(_0x3bfe4d);}else{_0xa4dfbf[_0x8a13('0x47')](_0xa4dfbf[_0x8a13('0x16')][util[_0x8a13('0x2a')]('SIP/%s',_0x3bfe4d[_0x8a13('0x2e')])],_0x3bfe4d);}}}return _0xa4dfbf[_0x8a13('0x16')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x4c')]=function(){var _0x5bdbd2=this;return function(_0x45c063){if(_0x45c063){freeIsNotKey(_0x45c063,_0x5bdbd2['voiceQueues'],'name');for(var _0x34583c=0x0,_0x2a7b85={},_0x379e55={};_0x34583c<_0x45c063[_0x8a13('0x49')];_0x34583c+=0x1){_0x2a7b85=_0x45c063[_0x34583c];if(_['isUndefined'](_0x5bdbd2[_0x8a13('0x17')][_0x2a7b85['name']])){_0x5bdbd2[_0x8a13('0x17')][_0x2a7b85[_0x8a13('0x2e')]]=new VoiceQueue(_0x2a7b85);}else{_0x5bdbd2[_0x8a13('0x47')](_0x5bdbd2[_0x8a13('0x17')][_0x2a7b85['name']],_0x2a7b85);}}}return _0x5bdbd2[_0x8a13('0x17')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x4d')]=function(){var _0x526384=this;return function(_0x111a45){if(_0x111a45){freeIsNotKey(_0x111a45,_0x526384[_0x8a13('0x18')],'id');for(var _0x1ecd9a=0x0,_0x551fbe={},_0x39b1cf={};_0x1ecd9a<_0x111a45[_0x8a13('0x49')];_0x1ecd9a+=0x1){_0x551fbe=_0x111a45[_0x1ecd9a];if(_['isUndefined'](_0x526384[_0x8a13('0x18')][_0x551fbe['id']])){_0x526384[_0x8a13('0x18')][_0x551fbe['id']]=new Trigger(_0x551fbe);}else{_0x526384[_0x8a13('0x47')](_0x526384['triggers'][_0x551fbe['id']],_0x551fbe);}}}return _0x526384[_0x8a13('0x18')];};};Realtime['prototype'][_0x8a13('0x4e')]=function(){var _0x3e5758=this;return function(_0x56b3ab){if(_0x56b3ab){freeIsNotKey(_0x56b3ab,_0x3e5758['templates'],'id');for(var _0x30ce87=0x0,_0x50d14a={},_0x12a42c={};_0x30ce87<_0x56b3ab[_0x8a13('0x49')];_0x30ce87+=0x1){_0x50d14a=_0x56b3ab[_0x30ce87];if(_['isUndefined'](_0x3e5758['templates'][_0x50d14a['id']])){_0x3e5758[_0x8a13('0x1a')][_0x50d14a['id']]=new Template(_0x50d14a);}else{_0x3e5758[_0x8a13('0x47')](_0x3e5758[_0x8a13('0x1a')][_0x50d14a['id']],_0x50d14a);}}}return _0x3e5758[_0x8a13('0x1a')];};};Realtime[_0x8a13('0x46')]['initZendeskAccounts']=function(){var _0x3a7e37=this;return function(_0x127185){if(_0x127185){freeIsNotKey(_0x127185,_0x3a7e37[_0x8a13('0x21')],'id');for(var _0x128a62=0x0,_0x5886fc={},_0x8c23e7={};_0x128a62<_0x127185['length'];_0x128a62+=0x1){_0x5886fc=_0x127185[_0x128a62];if(_[_0x8a13('0x4a')](_0x3a7e37[_0x8a13('0x21')][_0x5886fc['id']])){_0x3a7e37[_0x8a13('0x21')][_0x5886fc['id']]=new ZendeskAccount(_0x5886fc);}else{_0x3a7e37[_0x8a13('0x47')](_0x3a7e37[_0x8a13('0x21')][_0x5886fc['id']],_0x5886fc);}}}return _0x3a7e37[_0x8a13('0x21')];};};Realtime['prototype'][_0x8a13('0x4f')]=function(){var _0x3bd942=this;return function(_0x143bc1){if(_0x143bc1){freeIsNotKey(_0x143bc1,_0x3bd942[_0x8a13('0x22')],'id');for(var _0x556cf6=0x0,_0x7977ca={},_0x2b80e4={};_0x556cf6<_0x143bc1[_0x8a13('0x49')];_0x556cf6+=0x1){_0x7977ca=_0x143bc1[_0x556cf6];if(_[_0x8a13('0x4a')](_0x3bd942[_0x8a13('0x22')][_0x7977ca['id']])){_0x3bd942['salesforceAccounts'][_0x7977ca['id']]=new SalesforceAccount(_0x7977ca);}else{_0x3bd942[_0x8a13('0x47')](_0x3bd942[_0x8a13('0x22')][_0x7977ca['id']],_0x7977ca);}}}return _0x3bd942['salesforceAccounts'];};};Realtime[_0x8a13('0x46')][_0x8a13('0x50')]=function(){var _0x34c7f9=this;return function(_0x22a077){if(_0x22a077){freeIsNotKey(_0x22a077,_0x34c7f9[_0x8a13('0x51')],'id');for(var _0x4b4d00=0x0,_0x500cf3={},_0x47b463={};_0x4b4d00<_0x22a077[_0x8a13('0x49')];_0x4b4d00+=0x1){_0x500cf3=_0x22a077[_0x4b4d00];if(_['isUndefined'](_0x34c7f9[_0x8a13('0x51')][_0x500cf3['id']])){_0x34c7f9[_0x8a13('0x51')][_0x500cf3['id']]=new FreshdeskAccount(_0x500cf3);}else{_0x34c7f9[_0x8a13('0x47')](_0x34c7f9[_0x8a13('0x51')][_0x500cf3['id']],_0x500cf3);}}}return _0x34c7f9[_0x8a13('0x51')];};};Realtime['prototype'][_0x8a13('0x52')]=function(){var _0x37002b=this;return function(_0xf57b9c){if(_0xf57b9c){freeIsNotKey(_0xf57b9c,_0x37002b[_0x8a13('0x23')],'id');for(var _0x412778=0x0,_0x44e0f1={},_0x37090f={};_0x412778<_0xf57b9c['length'];_0x412778+=0x1){_0x44e0f1=_0xf57b9c[_0x412778];if(_['isUndefined'](_0x37002b[_0x8a13('0x23')][_0x44e0f1['id']])){_0x37002b['zohoAccounts'][_0x44e0f1['id']]=new ZohoAccount(_0x44e0f1);}else{_0x37002b[_0x8a13('0x47')](_0x37002b[_0x8a13('0x23')][_0x44e0f1['id']],_0x44e0f1);}}}return _0x37002b[_0x8a13('0x23')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x53')]=function(){var _0x5e1a53=this;return function(_0xf8b60a){if(_0xf8b60a){freeIsNotKey(_0xf8b60a,_0x5e1a53[_0x8a13('0x24')],'id');for(var _0x28866f=0x0,_0x1f3d9a={},_0x4ef7ab={};_0x28866f<_0xf8b60a[_0x8a13('0x49')];_0x28866f+=0x1){_0x1f3d9a=_0xf8b60a[_0x28866f];if(_[_0x8a13('0x4a')](_0x5e1a53[_0x8a13('0x24')][_0x1f3d9a['id']])){_0x5e1a53[_0x8a13('0x24')][_0x1f3d9a['id']]=new DeskAccount(_0x1f3d9a);}else{_0x5e1a53[_0x8a13('0x47')](_0x5e1a53[_0x8a13('0x24')][_0x1f3d9a['id']],_0x1f3d9a);}}}return _0x5e1a53['deskAccounts'];};};Realtime[_0x8a13('0x46')]['initSugarcrmAccounts']=function(){var _0x2c6c71=this;return function(_0x4348c6){if(_0x4348c6){freeIsNotKey(_0x4348c6,_0x2c6c71[_0x8a13('0x54')],'id');for(var _0x1a1fd4=0x0,_0x28f538={},_0x4daabb={};_0x1a1fd4<_0x4348c6[_0x8a13('0x49')];_0x1a1fd4+=0x1){_0x28f538=_0x4348c6[_0x1a1fd4];if(_[_0x8a13('0x4a')](_0x2c6c71['sugarcrmAccounts'][_0x28f538['id']])){_0x2c6c71[_0x8a13('0x54')][_0x28f538['id']]=new SugarcrmAccount(_0x28f538);}else{_0x2c6c71['mergeFromDatabase'](_0x2c6c71[_0x8a13('0x54')][_0x28f538['id']],_0x28f538);}}}return _0x2c6c71[_0x8a13('0x54')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x55')]=function(){var _0x3730aa=this;return function(_0x574a1e){if(_0x574a1e){freeIsNotKey(_0x574a1e,_0x3730aa[_0x8a13('0x25')],'id');for(var _0x433a8a=0x0,_0x3cf316={},_0x211bf2={};_0x433a8a<_0x574a1e['length'];_0x433a8a+=0x1){_0x3cf316=_0x574a1e[_0x433a8a];if(_[_0x8a13('0x4a')](_0x3730aa[_0x8a13('0x25')][_0x3cf316['id']])){_0x3730aa['vtigerAccounts'][_0x3cf316['id']]=new VtigerAccount(_0x3cf316);}else{_0x3730aa[_0x8a13('0x47')](_0x3730aa[_0x8a13('0x25')][_0x3cf316['id']],_0x3cf316);}}}return _0x3730aa[_0x8a13('0x25')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x56')]=function(){var _0x225331=this;return function(_0x509071){if(_0x509071){freeIsNotKey(_0x509071,_0x225331['servicenowAccounts'],'id');for(var _0x4367fe=0x0,_0x1c63b6={},_0x6b90f9={};_0x4367fe<_0x509071['length'];_0x4367fe+=0x1){_0x1c63b6=_0x509071[_0x4367fe];if(_['isUndefined'](_0x225331[_0x8a13('0x26')][_0x1c63b6['id']])){_0x225331['servicenowAccounts'][_0x1c63b6['id']]=new ServicenowAccount(_0x1c63b6);}else{_0x225331[_0x8a13('0x47')](_0x225331[_0x8a13('0x26')][_0x1c63b6['id']],_0x1c63b6);}}}return _0x225331[_0x8a13('0x26')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x57')]=function(){var _0x1f6423=this;return function(_0x44c208){if(_0x44c208){freeIsNotKey(_0x44c208,_0x1f6423[_0x8a13('0x58')],'id');for(var _0x5e0e0e=0x0,_0x19bf1d={},_0x148caa={};_0x5e0e0e<_0x44c208['length'];_0x5e0e0e+=0x1){_0x19bf1d=_0x44c208[_0x5e0e0e];if(_[_0x8a13('0x4a')](_0x1f6423[_0x8a13('0x58')][_0x19bf1d['id']])){_0x1f6423[_0x8a13('0x58')][_0x19bf1d['id']]=new Dynamics365Account(_0x19bf1d);}else{_0x1f6423[_0x8a13('0x47')](_0x1f6423[_0x8a13('0x58')][_0x19bf1d['id']],_0x19bf1d);}}}return _0x1f6423['dynamics365Accounts'];};};Realtime[_0x8a13('0x46')][_0x8a13('0x59')]=function(){var _0x17fb26=this;return function(_0x5e615a){for(var _0x566ec2=0x0;_0x566ec2<_0x5e615a[_0x8a13('0x49')];_0x566ec2+=0x1){_[_0x8a13('0x5a')](_0x17fb26[_0x8a13('0x17')][_0x5e615a[_0x566ec2]['name']],_0x5e615a[_0x566ec2]);}return _0x17fb26[_0x8a13('0x17')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x5b')]=function(){var _0x1bf747=this;return function(_0x2ad785){clearVoiceQueues(_0x1bf747[_0x8a13('0x17')]);if(_0x2ad785){_0x2ad785=_[_0x8a13('0x5c')](_0x2ad785,_0x8a13('0x5d'));for(var _0x36214f in _0x2ad785){if(_0x2ad785[_0x8a13('0x29')](_0x36214f)){var _0x1d8fe6={};for(var _0x131e69=0x0;_0x131e69<_0x2ad785[_0x36214f][_0x8a13('0x49')];_0x131e69+=0x1){var _0xe2ae85=_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x5e')];if(_0x1bf747[_0x8a13('0x17')][_0xe2ae85]){if(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x5f')]){_0x1bf747['voiceQueues'][_0xe2ae85][_0x8a13('0x36')]+=0x1;}if(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x60')]){_0x1bf747[_0x8a13('0x17')][_0xe2ae85][_0x8a13('0x37')]+=0x1;}_0x1bf747[_0x8a13('0x17')][_0xe2ae85][_0x8a13('0x31')]+=moment(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x61')])['diff'](moment(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x62')]),_0x8a13('0x63'))||0x0;if(_0x131e69===_0x2ad785[_0x36214f][_0x8a13('0x49')]-0x1){_0x1bf747['voiceQueues'][_0xe2ae85][_0x8a13('0x32')]+=moment(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x64')]||_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x65')]||_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x66')])[_0x8a13('0x67')](moment(_0x2ad785[_0x36214f][_0x131e69]['queuecallerjoinAt']),'seconds')||0x0;_0x1bf747[_0x8a13('0x17')][_0xe2ae85][_0x8a13('0x2f')]+=0x1;if(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x68')]){_0x1bf747['voiceQueues'][_0xe2ae85][_0x8a13('0x30')]+=0x1;_0x1bf747[_0x8a13('0x17')][_0xe2ae85][_0x8a13('0x38')]+=moment(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x64')])[_0x8a13('0x67')](moment(_0x2ad785[_0x36214f][_0x131e69][_0x8a13('0x61')]),_0x8a13('0x63'))||0x0;}}else{_0x1bf747['voiceQueues'][_0xe2ae85][_0x8a13('0x32')]+=_0x1bf747['voiceQueues'][_0xe2ae85][_0x8a13('0x31')]||0x0;}}}}}}return _0x1bf747[_0x8a13('0x17')];};};Realtime[_0x8a13('0x46')][_0x8a13('0x69')]=function(){var _0x1ed805=this;return function(_0x2e3cd9){clearVoiceCallReports(_0x1ed805[_0x8a13('0x1b')]);if(_0x2e3cd9){for(var _0x18c964=0x0;_0x18c964<_0x2e3cd9[_0x8a13('0x49')];_0x18c964+=0x1){_0x1ed805[_0x8a13('0x1b')][_0x8a13('0x2f')]+=0x1;_0x1ed805[_0x8a13('0x1b')][_0x8a13('0x32')]+=_0x2e3cd9[_0x18c964][_0x8a13('0x6a')];if(_0x2e3cd9[_0x18c964][_0x8a13('0x6b')]==='ANSWERED'){_0x1ed805['outbound'][_0x8a13('0x30')]+=0x1;_0x1ed805[_0x8a13('0x1b')]['sumHoldTime']+=_0x2e3cd9[_0x18c964][_0x8a13('0x6a')]-_0x2e3cd9[_0x18c964][_0x8a13('0x6c')]||0x0;_0x1ed805[_0x8a13('0x1b')]['sumBillable']+=_0x2e3cd9[_0x18c964][_0x8a13('0x6c')];}}}return _0x1ed805[_0x8a13('0x1b')];};};Realtime['prototype'][_0x8a13('0x6d')]=function(){var _0x257294=this;return function(_0x5f4243){if(_0x5f4243){freeIsNotKey(_0x5f4243,_0x257294['campaigns'],_0x8a13('0x2e'));for(var _0xe6a986=0x0,_0x2fb85a={};_0xe6a986<_0x5f4243[_0x8a13('0x49')];_0xe6a986+=0x1){_0x2fb85a=_0x5f4243[_0xe6a986];if(_[_0x8a13('0x4a')](_0x257294[_0x8a13('0x19')][_0x2fb85a[_0x8a13('0x2e')]])){_0x257294[_0x8a13('0x19')][_0x2fb85a[_0x8a13('0x2e')]]=new Campaign(_0x2fb85a);}else{_0x257294[_0x8a13('0x47')](_0x257294[_0x8a13('0x19')][_0x2fb85a[_0x8a13('0x2e')]],_0x2fb85a);}}}return _0x257294['campaigns'];};};Realtime[_0x8a13('0x46')]['initVoiceExtensions']=function(){var _0x3b6ee3=this;return function(_0x4ed881){if(_0x4ed881){freeIsNotKey(_0x4ed881,_0x3b6ee3['voiceExtensions'],'id');for(var _0x6aee64=0x0,_0x1df650={};_0x6aee64<_0x4ed881['length'];_0x6aee64+=0x1){_0x1df650=_0x4ed881[_0x6aee64];if(_[_0x8a13('0x4a')](_0x3b6ee3[_0x8a13('0x1c')][_0x1df650['id']])){_0x3b6ee3['voiceExtensions'][_0x1df650['id']]=new VoiceExtension(_0x1df650);}else{_0x3b6ee3[_0x8a13('0x47')](_0x3b6ee3[_0x8a13('0x1c')][_0x1df650['id']],_0x1df650);}}}return _0x3b6ee3[_0x8a13('0x1c')];};};Realtime['prototype'][_0x8a13('0x6e')]=function(){var _0x4d079f=this;return function(_0xaf8d4a){clearCampaigns(_0x4d079f['campaigns']);for(var _0x3f130e=0x0;_0x3f130e<_0xaf8d4a[_0x8a13('0x49')];_0x3f130e+=0x1){_[_0x8a13('0x5a')](_0x4d079f[_0x8a13('0x19')][_0xaf8d4a[_0x3f130e]['name']],_0xaf8d4a[_0x3f130e]);}return _0x4d079f[_0x8a13('0x19')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x5261bc=this;return function(_0x3c1db7){if(_0x3c1db7){freeIsNotKey(_0x3c1db7,_0x5261bc[_0x8a13('0x27')],'id');for(var _0x216875=0x0,_0x477ec1={},_0x7065f1={};_0x216875<_0x3c1db7['length'];_0x216875+=0x1){_0x477ec1=_0x3c1db7[_0x216875];if(_[_0x8a13('0x4a')](_0x5261bc['faxAccounts'][_0x477ec1['id']])){_0x5261bc[_0x8a13('0x27')][_0x477ec1['id']]=new FaxAccount(_0x477ec1);}else{_0x5261bc[_0x8a13('0x47')](_0x5261bc[_0x8a13('0x27')][_0x477ec1['id']],_0x477ec1);}}}return _0x5261bc[_0x8a13('0x27')];};};module[_0x8a13('0x6f')]=Realtime; \ No newline at end of file +var _0xcb4a=['outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents','length','isNil','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercomplete','queuecallercompleteAt','disposition','ANSWERED','duration','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0xcb4a,0x1bf));var _0xacb4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xcb4a[_0x55f8b4];return _0x2475f9;};'use strict';var BPromise=require(_0xacb4('0x0'));var util=require(_0xacb4('0x1'));var _=require(_0xacb4('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xacb4('0x3'));var Trunk=require(_0xacb4('0x4'));var VoiceQueue=require(_0xacb4('0x5'));var Trigger=require('../model/trigger');var Template=require(_0xacb4('0x6'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xacb4('0x7'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xacb4('0x8'));var DeskAccount=require(_0xacb4('0x9'));var VtigerAccount=require(_0xacb4('0xa'));var ServicenowAccount=require(_0xacb4('0xb'));var Dynamics365Account=require(_0xacb4('0xc'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xacb4('0xd')]={};this[_0xacb4('0xe')]={};this[_0xacb4('0xf')]={};this[_0xacb4('0x10')]={};this[_0xacb4('0x11')]={};this[_0xacb4('0x12')]={};this[_0xacb4('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xacb4('0x14')]={};this[_0xacb4('0x15')]={};this['queueChannels']={};this[_0xacb4('0x16')]={};this[_0xacb4('0x17')]={};this[_0xacb4('0x18')]={};this[_0xacb4('0x19')]={};this[_0xacb4('0x1a')]={};this[_0xacb4('0x1b')]={};this['zohoAccounts']={};this[_0xacb4('0x1c')]={};this[_0xacb4('0x1d')]={};this['servicenowAccounts']={};this[_0xacb4('0x1e')]={};this[_0xacb4('0x1f')]={};};function freeIsNotKey(_0x2df5a4,_0x9c59f3,_0x4e1354){var _0x18ef37=_[_0xacb4('0x20')](_0x2df5a4,function(_0x46d5b4,_0xf42ca3){return _0x46d5b4[_0x4e1354];});for(var _0x39d059 in _0x9c59f3){if(_0x9c59f3[_0xacb4('0x21')](_0x39d059)){if(!_0x18ef37[_0x39d059]){delete _0x9c59f3[_0x39d059];}}}}function freeIsNotKeySip(_0x16efbf,_0x400c74){var _0x26d9b8=_[_0xacb4('0x20')](_0x16efbf,function(_0x3348b2,_0x25edc6){return util[_0xacb4('0x22')](_0xacb4('0x23'),_0x3348b2[_0xacb4('0x24')]);});for(var _0x4577f0 in _0x400c74){if(_0x400c74[_0xacb4('0x21')](_0x4577f0)){if(!_0x26d9b8[_0x4577f0]){delete _0x400c74[_0x4577f0];}}}}function freeIsNotKeyAgent(_0x195d26,_0x357087){var _0x4e12a4=_[_0xacb4('0x20')](_0x195d26,function(_0x51a169,_0x3ca5c2){var _0x218c78=_['isNil'](_0x51a169[_0xacb4('0x25')])?util[_0xacb4('0x22')](_0xacb4('0x23'),_0x51a169['name']):_0x51a169[_0xacb4('0x25')];return _0x218c78;});for(var _0xfded88 in _0x357087){if(_0x357087[_0xacb4('0x21')](_0xfded88)){if(!_0x4e12a4[_0xfded88]){delete _0x357087[_0xfded88];}}}}function clearVoiceCallReports(_0x276560){_0x276560[_0xacb4('0x26')]=0x0;_0x276560[_0xacb4('0x27')]=0x0;_0x276560['sumHoldTime']=0x0;_0x276560[_0xacb4('0x28')]=0x0;_0x276560[_0xacb4('0x29')]=0x0;}function clearCampaigns(_0x381e76){if(!_[_0xacb4('0x2a')](_0x381e76)){for(var _0x5dfedd in _0x381e76){if(_0x381e76[_0xacb4('0x21')](_0x5dfedd)){_0x381e76[_0x5dfedd][_0xacb4('0x2b')]=0x0;_0x381e76[_0x5dfedd][_0xacb4('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x3a5181){if(!_[_0xacb4('0x2a')](_0x3a5181)){for(var _0x1b0e3e in _0x3a5181){if(_0x3a5181[_0xacb4('0x21')](_0x1b0e3e)){_0x3a5181[_0x1b0e3e][_0xacb4('0x26')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x27')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x2d')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x2e')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x2f')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x28')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x29')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x30')]=0x0;_0x3a5181[_0x1b0e3e]['outboundNoAnswerCallsDay']=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x31')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x32')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x33')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x34')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x35')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x36')]=0x0;_0x3a5181[_0x1b0e3e]['outboundBlacklistCallsDay']=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x37')]=0x0;_0x3a5181[_0x1b0e3e]['outboundRejectCallsDay']=0x0;_0x3a5181[_0x1b0e3e]['outboundReCallsDay']=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x30')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x38')]=0x0;_0x3a5181[_0x1b0e3e][_0xacb4('0x39')]=!![];}}}}Realtime['prototype'][_0xacb4('0x3a')]=function(_0x401ddc,_0x51d52a){for(var _0x34352f in _0x51d52a){if(_0x401ddc['hasOwnProperty'](_0x34352f)){_0x401ddc[_0x34352f]=_0x51d52a[_0x34352f];}}};Realtime[_0xacb4('0x3b')][_0xacb4('0x3c')]=function(){var _0x30a11b=this;return function(_0xd8ba97){if(_0xd8ba97){freeIsNotKeyAgent(_0xd8ba97,_0x30a11b[_0xacb4('0x3d')]);for(var _0x1b739f=0x0,_0x20043a={},_0x194ff6={};_0x1b739f<_0xd8ba97[_0xacb4('0x3e')];_0x1b739f+=0x1){_0x20043a=_0xd8ba97[_0x1b739f];var _0xcfa04b=_[_0xacb4('0x3f')](_0x20043a[_0xacb4('0x25')])?util[_0xacb4('0x22')](_0xacb4('0x23'),_0x20043a[_0xacb4('0x24')]):_0x20043a['interface'];if(_[_0xacb4('0x40')](_0x30a11b[_0xacb4('0x3d')][_0xcfa04b])){_0x30a11b['agents'][_0xcfa04b]=new Agent(_0x20043a);}else{_0x30a11b['mergeFromDatabase'](_0x30a11b['agents'][_0xcfa04b],_0x20043a);}}}return _0x30a11b['agents'];};};Realtime['prototype']['initTelephones']=function(){var _0x56534f=this;return function(_0x23ef84){if(_0x23ef84){freeIsNotKeySip(_0x23ef84,_0x56534f[_0xacb4('0xd')]);for(var _0x5e3fd4=0x0,_0x480bf8={},_0x33f96a={};_0x5e3fd4<_0x23ef84[_0xacb4('0x3e')];_0x5e3fd4+=0x1){_0x480bf8=_0x23ef84[_0x5e3fd4];if(_[_0xacb4('0x40')](_0x56534f[_0xacb4('0xd')][util[_0xacb4('0x22')](_0xacb4('0x23'),_0x480bf8[_0xacb4('0x24')])])){_0x56534f['telephones'][util[_0xacb4('0x22')](_0xacb4('0x23'),_0x480bf8['name'])]=new Telephone(_0x480bf8);}else{_0x56534f[_0xacb4('0x3a')](_0x56534f[_0xacb4('0xd')][util['format'](_0xacb4('0x23'),_0x480bf8[_0xacb4('0x24')])],_0x480bf8);}}}return _0x56534f[_0xacb4('0xd')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x41')]=function(){var _0xb608ad=this;return function(_0x4bfe82){if(_0x4bfe82){freeIsNotKeySip(_0x4bfe82,_0xb608ad[_0xacb4('0xe')]);for(var _0x28590d=0x0,_0x25a912={},_0x4fa4eb={};_0x28590d<_0x4bfe82['length'];_0x28590d+=0x1){_0x25a912=_0x4bfe82[_0x28590d];if(_['isUndefined'](_0xb608ad[_0xacb4('0xe')][util[_0xacb4('0x22')](_0xacb4('0x23'),_0x25a912['name'])])){_0xb608ad[_0xacb4('0xe')][util['format'](_0xacb4('0x23'),_0x25a912[_0xacb4('0x24')])]=new Trunk(_0x25a912);}else{_0xb608ad[_0xacb4('0x3a')](_0xb608ad[_0xacb4('0xe')][util[_0xacb4('0x22')](_0xacb4('0x23'),_0x25a912[_0xacb4('0x24')])],_0x25a912);}}}return _0xb608ad['trunks'];};};Realtime['prototype'][_0xacb4('0x42')]=function(){var _0x1b5d06=this;return function(_0x541e0e){if(_0x541e0e){freeIsNotKey(_0x541e0e,_0x1b5d06[_0xacb4('0xf')],'name');for(var _0xb784be=0x0,_0x52b94b={},_0x177edc={};_0xb784be<_0x541e0e[_0xacb4('0x3e')];_0xb784be+=0x1){_0x52b94b=_0x541e0e[_0xb784be];if(_[_0xacb4('0x40')](_0x1b5d06[_0xacb4('0xf')][_0x52b94b[_0xacb4('0x24')]])){_0x1b5d06['voiceQueues'][_0x52b94b['name']]=new VoiceQueue(_0x52b94b);}else{_0x1b5d06[_0xacb4('0x3a')](_0x1b5d06[_0xacb4('0xf')][_0x52b94b[_0xacb4('0x24')]],_0x52b94b);}}}return _0x1b5d06['voiceQueues'];};};Realtime['prototype'][_0xacb4('0x43')]=function(){var _0xd685e=this;return function(_0x38cff8){if(_0x38cff8){freeIsNotKey(_0x38cff8,_0xd685e[_0xacb4('0x10')],'id');for(var _0x4398b5=0x0,_0x269280={},_0x5dc961={};_0x4398b5<_0x38cff8[_0xacb4('0x3e')];_0x4398b5+=0x1){_0x269280=_0x38cff8[_0x4398b5];if(_[_0xacb4('0x40')](_0xd685e[_0xacb4('0x10')][_0x269280['id']])){_0xd685e[_0xacb4('0x10')][_0x269280['id']]=new Trigger(_0x269280);}else{_0xd685e[_0xacb4('0x3a')](_0xd685e[_0xacb4('0x10')][_0x269280['id']],_0x269280);}}}return _0xd685e['triggers'];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x44')]=function(){var _0x4f6e2d=this;return function(_0x17b9fe){if(_0x17b9fe){freeIsNotKey(_0x17b9fe,_0x4f6e2d[_0xacb4('0x12')],'id');for(var _0x5dabaf=0x0,_0x318953={},_0x34e5f3={};_0x5dabaf<_0x17b9fe[_0xacb4('0x3e')];_0x5dabaf+=0x1){_0x318953=_0x17b9fe[_0x5dabaf];if(_[_0xacb4('0x40')](_0x4f6e2d[_0xacb4('0x12')][_0x318953['id']])){_0x4f6e2d[_0xacb4('0x12')][_0x318953['id']]=new Template(_0x318953);}else{_0x4f6e2d[_0xacb4('0x3a')](_0x4f6e2d[_0xacb4('0x12')][_0x318953['id']],_0x318953);}}}return _0x4f6e2d[_0xacb4('0x12')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x45')]=function(){var _0x1aeab8=this;return function(_0x433d36){if(_0x433d36){freeIsNotKey(_0x433d36,_0x1aeab8[_0xacb4('0x18')],'id');for(var _0x2fc36b=0x0,_0x1d417f={},_0x395539={};_0x2fc36b<_0x433d36['length'];_0x2fc36b+=0x1){_0x1d417f=_0x433d36[_0x2fc36b];if(_[_0xacb4('0x40')](_0x1aeab8[_0xacb4('0x18')][_0x1d417f['id']])){_0x1aeab8[_0xacb4('0x18')][_0x1d417f['id']]=new ZendeskAccount(_0x1d417f);}else{_0x1aeab8[_0xacb4('0x3a')](_0x1aeab8[_0xacb4('0x18')][_0x1d417f['id']],_0x1d417f);}}}return _0x1aeab8['zendeskAccounts'];};};Realtime['prototype'][_0xacb4('0x46')]=function(){var _0x39e854=this;return function(_0x56f3f6){if(_0x56f3f6){freeIsNotKey(_0x56f3f6,_0x39e854['salesforceAccounts'],'id');for(var _0x4cd530=0x0,_0x3d7632={},_0x26228d={};_0x4cd530<_0x56f3f6[_0xacb4('0x3e')];_0x4cd530+=0x1){_0x3d7632=_0x56f3f6[_0x4cd530];if(_[_0xacb4('0x40')](_0x39e854[_0xacb4('0x19')][_0x3d7632['id']])){_0x39e854[_0xacb4('0x19')][_0x3d7632['id']]=new SalesforceAccount(_0x3d7632);}else{_0x39e854['mergeFromDatabase'](_0x39e854[_0xacb4('0x19')][_0x3d7632['id']],_0x3d7632);}}}return _0x39e854[_0xacb4('0x19')];};};Realtime['prototype'][_0xacb4('0x47')]=function(){var _0x58cc08=this;return function(_0x27f43b){if(_0x27f43b){freeIsNotKey(_0x27f43b,_0x58cc08[_0xacb4('0x1b')],'id');for(var _0x170c9f=0x0,_0x356395={},_0x281b33={};_0x170c9f<_0x27f43b['length'];_0x170c9f+=0x1){_0x356395=_0x27f43b[_0x170c9f];if(_[_0xacb4('0x40')](_0x58cc08[_0xacb4('0x1b')][_0x356395['id']])){_0x58cc08[_0xacb4('0x1b')][_0x356395['id']]=new FreshdeskAccount(_0x356395);}else{_0x58cc08[_0xacb4('0x3a')](_0x58cc08[_0xacb4('0x1b')][_0x356395['id']],_0x356395);}}}return _0x58cc08['freshdeskAccounts'];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x48')]=function(){var _0x50df50=this;return function(_0x29e132){if(_0x29e132){freeIsNotKey(_0x29e132,_0x50df50['zohoAccounts'],'id');for(var _0x566337=0x0,_0x5958ac={},_0x51b80a={};_0x566337<_0x29e132['length'];_0x566337+=0x1){_0x5958ac=_0x29e132[_0x566337];if(_[_0xacb4('0x40')](_0x50df50[_0xacb4('0x49')][_0x5958ac['id']])){_0x50df50[_0xacb4('0x49')][_0x5958ac['id']]=new ZohoAccount(_0x5958ac);}else{_0x50df50['mergeFromDatabase'](_0x50df50['zohoAccounts'][_0x5958ac['id']],_0x5958ac);}}}return _0x50df50[_0xacb4('0x49')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x4a')]=function(){var _0x19dc16=this;return function(_0x57aa11){if(_0x57aa11){freeIsNotKey(_0x57aa11,_0x19dc16[_0xacb4('0x1c')],'id');for(var _0x111052=0x0,_0x4eaa93={},_0x202762={};_0x111052<_0x57aa11[_0xacb4('0x3e')];_0x111052+=0x1){_0x4eaa93=_0x57aa11[_0x111052];if(_[_0xacb4('0x40')](_0x19dc16['deskAccounts'][_0x4eaa93['id']])){_0x19dc16[_0xacb4('0x1c')][_0x4eaa93['id']]=new DeskAccount(_0x4eaa93);}else{_0x19dc16[_0xacb4('0x3a')](_0x19dc16[_0xacb4('0x1c')][_0x4eaa93['id']],_0x4eaa93);}}}return _0x19dc16[_0xacb4('0x1c')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x4b')]=function(){var _0x53fbfd=this;return function(_0x177719){if(_0x177719){freeIsNotKey(_0x177719,_0x53fbfd[_0xacb4('0x1a')],'id');for(var _0x313e96=0x0,_0x10d053={},_0x5abf69={};_0x313e96<_0x177719[_0xacb4('0x3e')];_0x313e96+=0x1){_0x10d053=_0x177719[_0x313e96];if(_[_0xacb4('0x40')](_0x53fbfd[_0xacb4('0x1a')][_0x10d053['id']])){_0x53fbfd[_0xacb4('0x1a')][_0x10d053['id']]=new SugarcrmAccount(_0x10d053);}else{_0x53fbfd[_0xacb4('0x3a')](_0x53fbfd['sugarcrmAccounts'][_0x10d053['id']],_0x10d053);}}}return _0x53fbfd[_0xacb4('0x1a')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x4c')]=function(){var _0x143421=this;return function(_0x55e35d){if(_0x55e35d){freeIsNotKey(_0x55e35d,_0x143421[_0xacb4('0x1d')],'id');for(var _0xb0cb73=0x0,_0x274e31={},_0x8bbce6={};_0xb0cb73<_0x55e35d[_0xacb4('0x3e')];_0xb0cb73+=0x1){_0x274e31=_0x55e35d[_0xb0cb73];if(_[_0xacb4('0x40')](_0x143421['vtigerAccounts'][_0x274e31['id']])){_0x143421[_0xacb4('0x1d')][_0x274e31['id']]=new VtigerAccount(_0x274e31);}else{_0x143421[_0xacb4('0x3a')](_0x143421[_0xacb4('0x1d')][_0x274e31['id']],_0x274e31);}}}return _0x143421['vtigerAccounts'];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x4d')]=function(){var _0x5ba2c3=this;return function(_0x2de32e){if(_0x2de32e){freeIsNotKey(_0x2de32e,_0x5ba2c3['servicenowAccounts'],'id');for(var _0x4cd9c9=0x0,_0x578552={},_0x2272b4={};_0x4cd9c9<_0x2de32e[_0xacb4('0x3e')];_0x4cd9c9+=0x1){_0x578552=_0x2de32e[_0x4cd9c9];if(_[_0xacb4('0x40')](_0x5ba2c3[_0xacb4('0x4e')][_0x578552['id']])){_0x5ba2c3['servicenowAccounts'][_0x578552['id']]=new ServicenowAccount(_0x578552);}else{_0x5ba2c3[_0xacb4('0x3a')](_0x5ba2c3[_0xacb4('0x4e')][_0x578552['id']],_0x578552);}}}return _0x5ba2c3['servicenowAccounts'];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x4f')]=function(){var _0x583301=this;return function(_0x4d9290){if(_0x4d9290){freeIsNotKey(_0x4d9290,_0x583301['dynamics365Accounts'],'id');for(var _0x106c2e=0x0,_0x20ecf9={},_0x5730b8={};_0x106c2e<_0x4d9290[_0xacb4('0x3e')];_0x106c2e+=0x1){_0x20ecf9=_0x4d9290[_0x106c2e];if(_['isUndefined'](_0x583301[_0xacb4('0x1e')][_0x20ecf9['id']])){_0x583301[_0xacb4('0x1e')][_0x20ecf9['id']]=new Dynamics365Account(_0x20ecf9);}else{_0x583301[_0xacb4('0x3a')](_0x583301[_0xacb4('0x1e')][_0x20ecf9['id']],_0x20ecf9);}}}return _0x583301[_0xacb4('0x1e')];};};Realtime['prototype'][_0xacb4('0x50')]=function(){var _0x15b295=this;return function(_0x54f7e2){for(var _0x1e3be6=0x0;_0x1e3be6<_0x54f7e2[_0xacb4('0x3e')];_0x1e3be6+=0x1){_[_0xacb4('0x51')](_0x15b295['voiceQueues'][_0x54f7e2[_0x1e3be6][_0xacb4('0x24')]],_0x54f7e2[_0x1e3be6]);}return _0x15b295[_0xacb4('0xf')];};};Realtime[_0xacb4('0x3b')]['initVoiceQueueReports']=function(){var _0x2a10af=this;return function(_0x46efae){clearVoiceQueues(_0x2a10af[_0xacb4('0xf')]);if(_0x46efae){_0x46efae=_[_0xacb4('0x52')](_0x46efae,_0xacb4('0x53'));for(var _0x4e88b2 in _0x46efae){if(_0x46efae[_0xacb4('0x21')](_0x4e88b2)){var _0x5892e1={};for(var _0xcb8ec1=0x0;_0xcb8ec1<_0x46efae[_0x4e88b2][_0xacb4('0x3e')];_0xcb8ec1+=0x1){var _0xd407f2=_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x54')];if(_0x2a10af[_0xacb4('0xf')][_0xd407f2]){if(_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x55')]){_0x2a10af[_0xacb4('0xf')][_0xd407f2][_0xacb4('0x2d')]+=0x1;}if(_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x56')]){_0x2a10af[_0xacb4('0xf')][_0xd407f2][_0xacb4('0x2e')]+=0x1;}_0x2a10af[_0xacb4('0xf')][_0xd407f2]['sumHoldTime']+=moment(_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x57')])[_0xacb4('0x58')](moment(_0x46efae[_0x4e88b2][_0xcb8ec1]['queuecallerjoinAt']),_0xacb4('0x59'))||0x0;if(_0xcb8ec1===_0x46efae[_0x4e88b2][_0xacb4('0x3e')]-0x1){_0x2a10af[_0xacb4('0xf')][_0xd407f2][_0xacb4('0x28')]+=moment(_0x46efae[_0x4e88b2][_0xcb8ec1]['queuecallercompleteAt']||_0x46efae[_0x4e88b2][_0xcb8ec1]['queuecallerabandonAt']||_0x46efae[_0x4e88b2][_0xcb8ec1]['queuecallerexitAt'])['diff'](moment(_0x46efae[_0x4e88b2][_0xcb8ec1]['queuecallerjoinAt']),_0xacb4('0x59'))||0x0;_0x2a10af[_0xacb4('0xf')][_0xd407f2][_0xacb4('0x26')]+=0x1;if(_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x5a')]){_0x2a10af['voiceQueues'][_0xd407f2][_0xacb4('0x27')]+=0x1;_0x2a10af[_0xacb4('0xf')][_0xd407f2]['sumBillable']+=moment(_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x5b')])[_0xacb4('0x58')](moment(_0x46efae[_0x4e88b2][_0xcb8ec1][_0xacb4('0x57')]),_0xacb4('0x59'))||0x0;}}else{_0x2a10af['voiceQueues'][_0xd407f2]['sumDuration']+=_0x2a10af[_0xacb4('0xf')][_0xd407f2][_0xacb4('0x2f')]||0x0;}}}}}}return _0x2a10af[_0xacb4('0xf')];};};Realtime[_0xacb4('0x3b')]['initVoiceCallReports']=function(){var _0x1fce0f=this;return function(_0x31e87c){clearVoiceCallReports(_0x1fce0f['outbound']);if(_0x31e87c){for(var _0x334a87=0x0;_0x334a87<_0x31e87c['length'];_0x334a87+=0x1){_0x1fce0f['outbound'][_0xacb4('0x26')]+=0x1;_0x1fce0f[_0xacb4('0x13')]['sumDuration']+=_0x31e87c[_0x334a87]['duration'];if(_0x31e87c[_0x334a87][_0xacb4('0x5c')]===_0xacb4('0x5d')){_0x1fce0f[_0xacb4('0x13')][_0xacb4('0x27')]+=0x1;_0x1fce0f[_0xacb4('0x13')][_0xacb4('0x2f')]+=_0x31e87c[_0x334a87][_0xacb4('0x5e')]-_0x31e87c[_0x334a87]['billableseconds']||0x0;_0x1fce0f['outbound'][_0xacb4('0x29')]+=_0x31e87c[_0x334a87]['billableseconds'];}}}return _0x1fce0f['outbound'];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x5f')]=function(){var _0x50ea5b=this;return function(_0x5343ee){if(_0x5343ee){freeIsNotKey(_0x5343ee,_0x50ea5b[_0xacb4('0x11')],_0xacb4('0x24'));for(var _0x49be60=0x0,_0x46801f={};_0x49be60<_0x5343ee[_0xacb4('0x3e')];_0x49be60+=0x1){_0x46801f=_0x5343ee[_0x49be60];if(_[_0xacb4('0x40')](_0x50ea5b[_0xacb4('0x11')][_0x46801f['name']])){_0x50ea5b[_0xacb4('0x11')][_0x46801f[_0xacb4('0x24')]]=new Campaign(_0x46801f);}else{_0x50ea5b[_0xacb4('0x3a')](_0x50ea5b[_0xacb4('0x11')][_0x46801f[_0xacb4('0x24')]],_0x46801f);}}}return _0x50ea5b[_0xacb4('0x11')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x60')]=function(){var _0x3afc1d=this;return function(_0x262e03){if(_0x262e03){freeIsNotKey(_0x262e03,_0x3afc1d['voiceExtensions'],'id');for(var _0x240ad4=0x0,_0x1d1bfb={};_0x240ad4<_0x262e03[_0xacb4('0x3e')];_0x240ad4+=0x1){_0x1d1bfb=_0x262e03[_0x240ad4];if(_['isUndefined'](_0x3afc1d['voiceExtensions'][_0x1d1bfb['id']])){_0x3afc1d[_0xacb4('0x14')][_0x1d1bfb['id']]=new VoiceExtension(_0x1d1bfb);}else{_0x3afc1d['mergeFromDatabase'](_0x3afc1d[_0xacb4('0x14')][_0x1d1bfb['id']],_0x1d1bfb);}}}return _0x3afc1d[_0xacb4('0x14')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x61')]=function(){var _0x3ec14e=this;return function(_0x3151a4){clearCampaigns(_0x3ec14e[_0xacb4('0x11')]);for(var _0x4d6245=0x0;_0x4d6245<_0x3151a4[_0xacb4('0x3e')];_0x4d6245+=0x1){_[_0xacb4('0x51')](_0x3ec14e[_0xacb4('0x11')][_0x3151a4[_0x4d6245][_0xacb4('0x24')]],_0x3151a4[_0x4d6245]);}return _0x3ec14e[_0xacb4('0x11')];};};Realtime[_0xacb4('0x3b')][_0xacb4('0x62')]=function(){var _0x304a3e=this;return function(_0x32335b){if(_0x32335b){freeIsNotKey(_0x32335b,_0x304a3e[_0xacb4('0x1f')],'id');for(var _0x14d156=0x0,_0x498543={},_0x4821b8={};_0x14d156<_0x32335b['length'];_0x14d156+=0x1){_0x498543=_0x32335b[_0x14d156];if(_[_0xacb4('0x40')](_0x304a3e['faxAccounts'][_0x498543['id']])){_0x304a3e[_0xacb4('0x1f')][_0x498543['id']]=new FaxAccount(_0x498543);}else{_0x304a3e['mergeFromDatabase'](_0x304a3e[_0xacb4('0x1f')][_0x498543['id']],_0x498543);}}}return _0x304a3e[_0xacb4('0x1f')];};};module[_0xacb4('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index a7aa034..c519931 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 _0x2347=['../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','accountcode','name','isNil','format','SIP/%s','length','findAgent','connectedlinenum','assigned','interface','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','exten','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport'];(function(_0x4f7c54,_0x32d9fb){var _0x1659d7=function(_0x397947){while(--_0x397947){_0x4f7c54['push'](_0x4f7c54['shift']());}};_0x1659d7(++_0x32d9fb);}(_0x2347,0x1eb));var _0x7234=function(_0x343b0a,_0x586263){_0x343b0a=_0x343b0a-0x0;var _0x3d8ff8=_0x2347[_0x343b0a];return _0x3d8ff8;};'use strict';var BPromise=require(_0x7234('0x0'));var _=require(_0x7234('0x1'));var moment=require(_0x7234('0x2'));var util=require(_0x7234('0x3'));var config=require(_0x7234('0x4'));var logger=require(_0x7234('0x5'))(_0x7234('0x6'));var ami=require(_0x7234('0x7'));var RpcVoiceAgentReport=require(_0x7234('0x8'));var RpcVoiceCallReport=require(_0x7234('0x9'));var RpcVoiceDialReport=require(_0x7234('0xa'));var RpcMemberReport=require(_0x7234('0xb'));var RpcVoiceQueueReport=require(_0x7234('0xc'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x7234('0xd'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x7234('0xe'));var VoiceAgentReport=require(_0x7234('0xf'));var VoiceDialReport=require(_0x7234('0x10'));var UserReport=require(_0x7234('0x11'));function Report(_0x489735){this[_0x7234('0x12')]=_0x489735;this[_0x7234('0x13')]=_0x489735[_0x7234('0x13')];this['telephones']=_0x489735[_0x7234('0x14')];}Report[_0x7234('0x15')][_0x7234('0x16')]=function(_0x27ca4e){var _0x31314d=new VoiceQueueReport(this['realtime']);var _0x250dce=new VoiceAgentReport(this[_0x7234('0x12')]);var _0xf8fd70=new VoiceDialReport(this[_0x7234('0x12')]);var _0x3a56e1=new VoiceCallReport(this[_0x7234('0x12')]);var _0x2caf04=new UserReport(this[_0x7234('0x12')]);if(config[_0x7234('0x17')]&&config[_0x7234('0x17')][_0x7234('0x18')]){ami['on'](_0x7234('0x19'),this[_0x7234('0x1a')][_0x7234('0x1b')](this));ami['on'](_0x7234('0x1c'),this[_0x7234('0x1d')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x7234('0x1e')][_0x7234('0x1b')](this));ami['on']('custom:voiceDialReport',this[_0x7234('0x1f')][_0x7234('0x1b')](this));ami['on'](_0x7234('0x20'),this[_0x7234('0x21')]['bind'](this));ami['on']('attendedtransfer',this[_0x7234('0x22')][_0x7234('0x1b')](this));}};Report[_0x7234('0x15')]['findAgent']=function(_0x5a60cb){var _0x532490=undefined;_0x532490=_[_0x7234('0x23')](this['agents'],function(_0x397ba7){return _0x397ba7[_0x7234('0x24')]==_0x5a60cb||_0x397ba7[_0x7234('0x25')]==_0x5a60cb;});if(_[_0x7234('0x26')](_0x532490)){var _0x1b7e64=_['find'](this[_0x7234('0x14')],function(_0x5633af){return _0x5633af[_0x7234('0x24')]==_0x5a60cb||_0x5633af['name']==_0x5a60cb;});if(_0x1b7e64){_0x532490=_['find'](this[_0x7234('0x13')],function(_0x25a3db){return _0x25a3db['interface']==util[_0x7234('0x27')](_0x7234('0x28'),_0x1b7e64[_0x7234('0x25')]);});}}return _0x532490;};Report['prototype']['voiceQueueReport']=function(_0x22a340){for(var _0x253d12=0x0;_0x253d12<_0x22a340[_0x7234('0x29')];_0x253d12+=0x1){var _0xa86b43=this[_0x7234('0x2a')](_0x22a340[_0x253d12][_0x7234('0x2b')]);if(_0xa86b43){_0x22a340[_0x253d12][_0x7234('0x24')]=_0xa86b43[_0x7234('0x24')];_0x22a340[_0x253d12][_0x7234('0x2c')]=!![];_0x22a340[_0x253d12]['lastAssignedTo']=_0xa86b43[_0x7234('0x25')];_0x22a340[_0x253d12][_0x7234('0x2d')]=_[_0x7234('0x26')](_0xa86b43[_0x7234('0x2d')])?util['format']('SIP/%s',_0xa86b43[_0x7234('0x25')]):_0xa86b43[_0x7234('0x2d')];if(_0x22a340[_0x253d12]['queuecallercomplete']){_0x22a340[_0x253d12]['queuecallercompleteAt']=moment()['format'](_0x7234('0x2e'));}if(_0x22a340[_0x253d12][_0x7234('0x2f')]){_0x22a340[_0x253d12][_0x7234('0x30')]=moment()['format'](_0x7234('0x2e'));}RpcMemberReport[_0x7234('0x1a')](_0x22a340[_0x253d12]);}RpcVoiceQueueReport[_0x7234('0x31')](_0x22a340[_0x253d12]);}};function extractCalleridNumber(_0x1fc615){var _0x4a3208=_0x1fc615[_0x7234('0x32')](/<(.*?)>/);return _0x4a3208?_0x4a3208[0x1]:_0x1fc615;}Report['prototype'][_0x7234('0x1d')]=function(_0x5d6f9b){_0x5d6f9b[_0x7234('0x33')]=_0x5d6f9b[_0x7234('0x33')]||_0x5d6f9b['exten'];if(_0x5d6f9b[_0x7234('0x34')]==_0x7234('0x35')){_0x5d6f9b['lastapplication']=_0x7234('0x36');_0x5d6f9b[_0x7234('0x37')]=_0x5d6f9b[_0x7234('0x36')];if(_0x5d6f9b[_0x7234('0x38')]=='from-voip-provider'){_0x5d6f9b[_0x7234('0x24')]='';_0x5d6f9b[_0x7234('0x33')]=extractCalleridNumber(_0x5d6f9b[_0x7234('0x39')]);}else if(_0x5d6f9b[_0x7234('0x38')]==_0x7234('0x3a')){if(_0x5d6f9b[_0x7234('0x33')]==_0x7234('0x3b')){_0x5d6f9b[_0x7234('0x33')]=extractCalleridNumber(_0x5d6f9b[_0x7234('0x3c')]);_0x5d6f9b[_0x7234('0x3d')]=_0x5d6f9b['originatecalleridnum'];_0x5d6f9b[_0x7234('0x3e')]=[_0x5d6f9b['channel'],_0x5d6f9b[_0x7234('0x3f')]=_0x5d6f9b[_0x7234('0x3e')]][0x0];_0x5d6f9b['callerid']=_0x5d6f9b[_0x7234('0x3c')];}else{_0x5d6f9b[_0x7234('0x33')]=_0x5d6f9b['calleridnum'];_0x5d6f9b['calleridnum']=_0x5d6f9b[_0x7234('0x40')];if(_0x5d6f9b[_0x7234('0x41')]=='ANSWERED'){_0x5d6f9b[_0x7234('0x24')]=_0x5d6f9b[_0x7234('0x2b')];}else{_0x5d6f9b[_0x7234('0x24')]='';}}}}else{_0x5d6f9b['callerid']=util[_0x7234('0x27')](_0x7234('0x42'),_0x5d6f9b[_0x7234('0x43')],_0x5d6f9b[_0x7234('0x3d')]);}RpcVoiceCallReport[_0x7234('0x31')](_0x5d6f9b);if(_0x5d6f9b[_0x7234('0x44')]){for(var _0x1d190f=0x0;_0x1d190f<_0x5d6f9b[_0x7234('0x45')][_0x7234('0x29')];_0x1d190f+=0x1){_0x5d6f9b[_0x7234('0x46')]=_0x5d6f9b[_0x7234('0x45')][_0x1d190f][_0x7234('0x47')];_0x5d6f9b[_0x7234('0x48')]=_0x5d6f9b[_0x7234('0x45')][_0x1d190f][_0x7234('0x48')];if(_0x5d6f9b['exten']=='xcally-motion-preview'){_0x5d6f9b['calleridnum']=_0x5d6f9b[_0x7234('0x2b')];_0x5d6f9b[_0x7234('0x43')]=_0x5d6f9b[_0x7234('0x49')];_0x5d6f9b[_0x7234('0x2b')]=_0x5d6f9b[_0x7234('0x24')];_0x5d6f9b[_0x7234('0x49')]=_0x5d6f9b[_0x7234('0x4a')];_0x5d6f9b[_0x7234('0x4b')]=_0x5d6f9b[_0x7234('0x40')];}else if(_0x5d6f9b[_0x7234('0x4b')]=='xcally-motion-dialer'){_0x5d6f9b[_0x7234('0x3d')]=_0x5d6f9b[_0x7234('0x33')];_0x5d6f9b[_0x7234('0x4b')]=_0x5d6f9b[_0x7234('0x40')];}RpcVoiceRecording[_0x7234('0x31')](_0x5d6f9b);}}};Report[_0x7234('0x15')][_0x7234('0x1e')]=function(_0x2960cd){if(_[_0x7234('0x4c')](_0x2960cd)){_0x2960cd[_0x7234('0x4d')](function(_0xe937b2){RpcVoiceAgentReport['create'](_0xe937b2);});}else{RpcVoiceAgentReport['create'](_0x2960cd);}};Report[_0x7234('0x15')][_0x7234('0x1f')]=function(_0x2e74d0){RpcVoiceDialReport[_0x7234('0x31')](_0x2e74d0);var _0x5ef427=undefined;var _0x5d7ae4=_0x2e74d0[_0x7234('0x3f')];if(_[_0x7234('0x4e')](_0x5d7ae4,'Local')){var _0x54c045=_0x5d7ae4[_0x7234('0x4f')](_0x5d7ae4[_0x7234('0x50')]('/')+0x1,_0x5d7ae4[_0x7234('0x50')]('@'));_0x5ef427=_['find'](this['agents'],function(_0x16f341){return _0x16f341[_0x7234('0x51')]==_0x54c045||_0x16f341[_0x7234('0x52')]==_0x54c045||_0x16f341[_0x7234('0x24')]==_0x54c045;});}else{var _0x54c045=_0x5d7ae4[_0x7234('0x4f')](_0x5d7ae4[_0x7234('0x50')]('/')+0x1,_0x5d7ae4[_0x7234('0x53')]('-'));_0x5ef427=this[_0x7234('0x2a')](_0x54c045);}if(_0x5ef427){_0x2e74d0[_0x7234('0x2d')]=_[_0x7234('0x26')](_0x5ef427['interface'])?util['format'](_0x7234('0x28'),_0x5ef427[_0x7234('0x25')]):_0x5ef427['interface'];_0x2e74d0[_0x7234('0x4a')]=_0x5ef427[_0x7234('0x25')];_0x2e74d0[_0x7234('0x24')]=_0x5ef427[_0x7234('0x24')];RpcMemberReport[_0x7234('0x1f')](_0x2e74d0);}};Report[_0x7234('0x15')][_0x7234('0x21')]=function(_0x274871){RpcVoiceTransferReport[_0x7234('0x21')](_0x274871);};Report['prototype'][_0x7234('0x22')]=function(_0x342207){RpcVoiceTransferReport[_0x7234('0x22')](_0x342207);};module['exports']=Report; \ No newline at end of file +var _0xbf00=['length','connectedlinenum','assigned','lastAssignedTo','interface','isNil','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','format','create','destination','dialer','lastapplication','queue','lastdata','context','from-voip-provider','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','exten','voiceAgentReport','isArray','voiceDialReport','startsWith','substring','indexOf','mobile','phone','exports','bluebird','moment','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','voiceQueueReport','bind','voiceCallReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','SIP/%s'];(function(_0x1b5cc2,_0x4321c2){var _0x375f3b=function(_0x265ddb){while(--_0x265ddb){_0x1b5cc2['push'](_0x1b5cc2['shift']());}};_0x375f3b(++_0x4321c2);}(_0xbf00,0x1a2));var _0x0bf0=function(_0x37dc21,_0x2bae86){_0x37dc21=_0x37dc21-0x0;var _0x34dc9e=_0xbf00[_0x37dc21];return _0x34dc9e;};'use strict';var BPromise=require(_0x0bf0('0x0'));var _=require('lodash');var moment=require(_0x0bf0('0x1'));var util=require(_0x0bf0('0x2'));var config=require(_0x0bf0('0x3'));var logger=require(_0x0bf0('0x4'))('ami');var ami=require(_0x0bf0('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0bf0('0x6'));var RpcVoiceDialReport=require(_0x0bf0('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0bf0('0x8'));var RpcVoiceRecording=require(_0x0bf0('0x9'));var RpcVoiceTransferReport=require(_0x0bf0('0xa'));var VoiceQueueReport=require(_0x0bf0('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x0bf0('0xc'));var UserReport=require('./userReport');function Report(_0x4e2c17){this['realtime']=_0x4e2c17;this['agents']=_0x4e2c17[_0x0bf0('0xd')];this[_0x0bf0('0xe')]=_0x4e2c17[_0x0bf0('0xe')];}Report[_0x0bf0('0xf')][_0x0bf0('0x10')]=function(_0x3388b9){var _0x2d1cff=new VoiceQueueReport(this[_0x0bf0('0x11')]);var _0x451e10=new VoiceAgentReport(this['realtime']);var _0x5441cb=new VoiceDialReport(this[_0x0bf0('0x11')]);var _0x41e565=new VoiceCallReport(this[_0x0bf0('0x11')]);var _0x123a57=new UserReport(this[_0x0bf0('0x11')]);if(config[_0x0bf0('0x12')]&&config[_0x0bf0('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0x0bf0('0x13')][_0x0bf0('0x14')](this));ami['on']('custom:voiceCallReport',this[_0x0bf0('0x15')][_0x0bf0('0x14')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0x0bf0('0x14')](this));ami['on'](_0x0bf0('0x16'),this['voiceDialReport'][_0x0bf0('0x14')](this));ami['on'](_0x0bf0('0x17'),this[_0x0bf0('0x18')][_0x0bf0('0x14')](this));ami['on'](_0x0bf0('0x19'),this[_0x0bf0('0x1a')][_0x0bf0('0x14')](this));}};Report['prototype'][_0x0bf0('0x1b')]=function(_0x33ae2b){var _0x1eaf33=undefined;_0x1eaf33=_[_0x0bf0('0x1c')](this[_0x0bf0('0xd')],function(_0x273fea){return _0x273fea[_0x0bf0('0x1d')]==_0x33ae2b||_0x273fea['name']==_0x33ae2b;});if(_['isNil'](_0x1eaf33)){var _0x1ae42e=_[_0x0bf0('0x1c')](this[_0x0bf0('0xe')],function(_0x22787c){return _0x22787c[_0x0bf0('0x1d')]==_0x33ae2b||_0x22787c[_0x0bf0('0x1e')]==_0x33ae2b;});if(_0x1ae42e){_0x1eaf33=_[_0x0bf0('0x1c')](this[_0x0bf0('0xd')],function(_0x10a3b4){return _0x10a3b4['interface']==util['format'](_0x0bf0('0x1f'),_0x1ae42e['name']);});}}return _0x1eaf33;};Report[_0x0bf0('0xf')][_0x0bf0('0x13')]=function(_0x3b8990){for(var _0x3778be=0x0;_0x3778be<_0x3b8990[_0x0bf0('0x20')];_0x3778be+=0x1){var _0x4b66c4=this['findAgent'](_0x3b8990[_0x3778be][_0x0bf0('0x21')]);if(_0x4b66c4){_0x3b8990[_0x3778be]['accountcode']=_0x4b66c4[_0x0bf0('0x1d')];_0x3b8990[_0x3778be][_0x0bf0('0x22')]=!![];_0x3b8990[_0x3778be][_0x0bf0('0x23')]=_0x4b66c4[_0x0bf0('0x1e')];_0x3b8990[_0x3778be][_0x0bf0('0x24')]=_[_0x0bf0('0x25')](_0x4b66c4[_0x0bf0('0x24')])?util['format'](_0x0bf0('0x1f'),_0x4b66c4[_0x0bf0('0x1e')]):_0x4b66c4['interface'];if(_0x3b8990[_0x3778be]['queuecallercomplete']){_0x3b8990[_0x3778be][_0x0bf0('0x26')]=moment()['format'](_0x0bf0('0x27'));}if(_0x3b8990[_0x3778be][_0x0bf0('0x28')]){_0x3b8990[_0x3778be]['queuecallerexitAt']=moment()[_0x0bf0('0x29')](_0x0bf0('0x27'));}RpcMemberReport['voiceQueueReport'](_0x3b8990[_0x3778be]);}RpcVoiceQueueReport[_0x0bf0('0x2a')](_0x3b8990[_0x3778be]);}};function extractCalleridNumber(_0x3010ed){var _0x570651=_0x3010ed['match'](/<(.*?)>/);return _0x570651?_0x570651[0x1]:_0x3010ed;}Report[_0x0bf0('0xf')][_0x0bf0('0x15')]=function(_0xcbf2ad){_0xcbf2ad[_0x0bf0('0x2b')]=_0xcbf2ad[_0x0bf0('0x2b')]||_0xcbf2ad['exten'];if(_0xcbf2ad['type']==_0x0bf0('0x2c')){_0xcbf2ad[_0x0bf0('0x2d')]=_0x0bf0('0x2e');_0xcbf2ad[_0x0bf0('0x2f')]=_0xcbf2ad[_0x0bf0('0x2e')];if(_0xcbf2ad[_0x0bf0('0x30')]==_0x0bf0('0x31')){_0xcbf2ad[_0x0bf0('0x1d')]='';_0xcbf2ad[_0x0bf0('0x2b')]=extractCalleridNumber(_0xcbf2ad['callerid']);}else if(_0xcbf2ad[_0x0bf0('0x30')]=='from-sip'){if(_0xcbf2ad['destination']=='xcally-motion-preview'){_0xcbf2ad[_0x0bf0('0x2b')]=extractCalleridNumber(_0xcbf2ad[_0x0bf0('0x32')]);_0xcbf2ad[_0x0bf0('0x33')]=_0xcbf2ad[_0x0bf0('0x34')];_0xcbf2ad[_0x0bf0('0x35')]=[_0xcbf2ad[_0x0bf0('0x36')],_0xcbf2ad['channel']=_0xcbf2ad[_0x0bf0('0x35')]][0x0];_0xcbf2ad[_0x0bf0('0x37')]=_0xcbf2ad[_0x0bf0('0x32')];}else{_0xcbf2ad[_0x0bf0('0x2b')]=_0xcbf2ad['calleridnum'];_0xcbf2ad[_0x0bf0('0x33')]=_0xcbf2ad[_0x0bf0('0x34')];if(_0xcbf2ad[_0x0bf0('0x38')]=='ANSWERED'){_0xcbf2ad[_0x0bf0('0x1d')]=_0xcbf2ad[_0x0bf0('0x21')];}else{_0xcbf2ad[_0x0bf0('0x1d')]='';}}}}else{_0xcbf2ad[_0x0bf0('0x37')]=util[_0x0bf0('0x29')](_0x0bf0('0x39'),_0xcbf2ad[_0x0bf0('0x3a')],_0xcbf2ad[_0x0bf0('0x33')]);}RpcVoiceCallReport['create'](_0xcbf2ad);if(_0xcbf2ad['monitor']){for(var _0x2d9a22=0x0;_0x2d9a22<_0xcbf2ad[_0x0bf0('0x3b')][_0x0bf0('0x20')];_0x2d9a22+=0x1){_0xcbf2ad[_0x0bf0('0x3c')]=_0xcbf2ad[_0x0bf0('0x3b')][_0x2d9a22][_0x0bf0('0x3d')];_0xcbf2ad[_0x0bf0('0x3e')]=_0xcbf2ad[_0x0bf0('0x3b')][_0x2d9a22][_0x0bf0('0x3e')];if(_0xcbf2ad['exten']=='xcally-motion-preview'){_0xcbf2ad['calleridnum']=_0xcbf2ad['connectedlinenum'];_0xcbf2ad['calleridname']=_0xcbf2ad[_0x0bf0('0x3f')];_0xcbf2ad[_0x0bf0('0x21')]=_0xcbf2ad['accountcode'];_0xcbf2ad[_0x0bf0('0x3f')]=_0xcbf2ad[_0x0bf0('0x40')];_0xcbf2ad[_0x0bf0('0x41')]=_0xcbf2ad[_0x0bf0('0x34')];}else if(_0xcbf2ad[_0x0bf0('0x41')]=='xcally-motion-dialer'){_0xcbf2ad[_0x0bf0('0x33')]=_0xcbf2ad[_0x0bf0('0x2b')];_0xcbf2ad['exten']=_0xcbf2ad[_0x0bf0('0x34')];}RpcVoiceRecording[_0x0bf0('0x2a')](_0xcbf2ad);}}};Report[_0x0bf0('0xf')][_0x0bf0('0x42')]=function(_0x32aeb1){if(_[_0x0bf0('0x43')](_0x32aeb1)){_0x32aeb1['forEach'](function(_0x205132){RpcVoiceAgentReport[_0x0bf0('0x2a')](_0x205132);});}else{RpcVoiceAgentReport[_0x0bf0('0x2a')](_0x32aeb1);}};Report[_0x0bf0('0xf')][_0x0bf0('0x44')]=function(_0x29b4f9){RpcVoiceDialReport[_0x0bf0('0x2a')](_0x29b4f9);var _0x142f6e=undefined;var _0x54cab6=_0x29b4f9[_0x0bf0('0x36')];if(_[_0x0bf0('0x45')](_0x54cab6,'Local')){var _0x3ff2f1=_0x54cab6[_0x0bf0('0x46')](_0x54cab6[_0x0bf0('0x47')]('/')+0x1,_0x54cab6[_0x0bf0('0x47')]('@'));_0x142f6e=_[_0x0bf0('0x1c')](this[_0x0bf0('0xd')],function(_0x15be07){return _0x15be07[_0x0bf0('0x48')]==_0x3ff2f1||_0x15be07[_0x0bf0('0x49')]==_0x3ff2f1||_0x15be07[_0x0bf0('0x1d')]==_0x3ff2f1;});}else{var _0x3ff2f1=_0x54cab6[_0x0bf0('0x46')](_0x54cab6[_0x0bf0('0x47')]('/')+0x1,_0x54cab6['lastIndexOf']('-'));_0x142f6e=this['findAgent'](_0x3ff2f1);}if(_0x142f6e){_0x29b4f9[_0x0bf0('0x24')]=_['isNil'](_0x142f6e['interface'])?util[_0x0bf0('0x29')](_0x0bf0('0x1f'),_0x142f6e[_0x0bf0('0x1e')]):_0x142f6e[_0x0bf0('0x24')];_0x29b4f9['membername']=_0x142f6e[_0x0bf0('0x1e')];_0x29b4f9[_0x0bf0('0x1d')]=_0x142f6e[_0x0bf0('0x1d')];RpcMemberReport['voiceDialReport'](_0x29b4f9);}};Report['prototype'][_0x0bf0('0x18')]=function(_0x53e32b){RpcVoiceTransferReport[_0x0bf0('0x18')](_0x53e32b);};Report[_0x0bf0('0xf')][_0x0bf0('0x1a')]=function(_0x21ff53){RpcVoiceTransferReport[_0x0bf0('0x1a')](_0x21ff53);};module[_0x0bf0('0x4a')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index f6c21cb..4ef31ea 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 _0x9728=['prototype','actionSipPeerStatus','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit','find','username','stateRegistry','state','merge','event','actionid','format','name','trunk:save','inuse','device','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','trunk:%s','startsWith','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer','local','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','error','inspect'];(function(_0x51bf0f,_0x3b3cfb){var _0x5c8633=function(_0x13ae1a){while(--_0x13ae1a){_0x51bf0f['push'](_0x51bf0f['shift']());}};_0x5c8633(++_0x3b3cfb);}(_0x9728,0xad));var _0x8972=function(_0x4ac86f,_0x5e4929){_0x4ac86f=_0x4ac86f-0x0;var _0x32a65b=_0x9728[_0x4ac86f];return _0x32a65b;};'use strict';var _=require(_0x8972('0x0'));var moment=require(_0x8972('0x1'));var BPromise=require(_0x8972('0x2'));var util=require(_0x8972('0x3'));var Redis=require(_0x8972('0x4'));var config=require(_0x8972('0x5'));var logger=require(_0x8972('0x6'))(_0x8972('0x7'));var ami=require(_0x8972('0x8'));config[_0x8972('0x9')]=_[_0x8972('0xa')](config['redis'],{'host':_0x8972('0xb'),'port':0x18eb});var io=require(_0x8972('0xc'))(new Redis(config[_0x8972('0x9')]));function UserReport(_0x5c3a49){this[_0x8972('0xd')]=_0x5c3a49[_0x8972('0xd')];this[_0x8972('0xe')]=_0x5c3a49[_0x8972('0xe')];this[_0x8972('0xf')]=_0x5c3a49[_0x8972('0xf')];ami['on'](_0x8972('0x10'),this[_0x8972('0x11')][_0x8972('0x12')](this));ami['on']('registry',this[_0x8972('0x11')][_0x8972('0x12')](this));ami['on'](_0x8972('0x13'),this[_0x8972('0x14')][_0x8972('0x12')](this));ami['on'](_0x8972('0x15'),this[_0x8972('0x16')][_0x8972('0x12')](this));this[_0x8972('0x17')]();return BPromise[_0x8972('0x18')]()[_0x8972('0x19')](ami[_0x8972('0x1a')]())['then'](ami[_0x8972('0x1b')]())['then'](ami['actionSipPeerStatus']())[_0x8972('0x1c')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x561e8e){return function(_0x7abec3){logger[_0x8972('0x1d')](_0x561e8e,util[_0x8972('0x1e')](_0x7abec3,{'showHidden':![],'depth':null}));};}UserReport[_0x8972('0x1f')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x8972('0x19')](ami[_0x8972('0x1a')]())[_0x8972('0x19')](ami['actionDeviceStateList']())['then'](ami[_0x8972('0x20')]())[_0x8972('0x1c')](loggerCatch(_0x8972('0x21')));},0x32c8);};UserReport[_0x8972('0x1f')][_0x8972('0x22')]=function(_0x176613){return _0x176613!==null&&!_[_0x8972('0x23')](_0x176613);};UserReport['prototype'][_0x8972('0x24')]=function(_0x45bc1a,_0x2b3400,_0x220573){io['to'](_0x45bc1a)[_0x8972('0x24')](_0x2b3400,_0x220573);};UserReport[_0x8972('0x1f')][_0x8972('0x11')]=function(_0x231be9){try{if(this[_0x8972('0x22')](_0x231be9)){var _0x236273=_[_0x8972('0x25')](this['trunks'],{'registry':_0x231be9[_0x8972('0x26')]});if(_0x236273){_0x231be9[_0x8972('0x27')]=_0x231be9[_0x8972('0x28')];_[_0x8972('0x29')](_0x236273,_['omit'](_0x231be9,[_0x8972('0x2a'),_0x8972('0x2b'),'username','state']));this[_0x8972('0x24')](util[_0x8972('0x2c')]('trunk:%s',_0x236273[_0x8972('0x2d')]),_0x8972('0x2e'),_0x236273);}}}catch(_0x1c5687){logger[_0x8972('0x1d')]('[syncRegistry][UserReport]',util[_0x8972('0x1e')](_0x1c5687,{'showHidden':![],'depth':null}));}};UserReport[_0x8972('0x1f')][_0x8972('0x14')]=function(_0x20466c){try{if(this['isNotNull'](_0x20466c)){if(this[_0x8972('0xe')][_0x20466c['device']]){if(!this[_0x8972('0xe')][_0x20466c['device']]['local']||_0x20466c[_0x8972('0x28')]['toLowerCase']()==_0x8972('0x2f')){this[_0x8972('0xe')][_0x20466c[_0x8972('0x30')]]['local']=![];if(this['agents'][_0x20466c[_0x8972('0x30')]]['state']!==_0x20466c['state'][_0x8972('0x31')]()){this[_0x8972('0xe')][_0x20466c[_0x8972('0x30')]][_0x8972('0x32')]=_[_0x8972('0x33')](moment()['format']('x'));}this['agents'][_0x20466c[_0x8972('0x30')]][_0x8972('0x28')]=_0x20466c[_0x8972('0x28')][_0x8972('0x31')]();this[_0x8972('0xe')][_0x20466c['device']][_0x8972('0x34')](_0x20466c);}}else if(this['telephones'][_0x20466c[_0x8972('0x30')]]){if(this[_0x8972('0xf')][_0x20466c['device']][_0x8972('0x28')]!==_0x20466c[_0x8972('0x28')][_0x8972('0x31')]()){this[_0x8972('0xf')][_0x20466c[_0x8972('0x30')]]['stateTime']=_[_0x8972('0x33')](moment()['format']('x'));}this['telephones'][_0x20466c['device']][_0x8972('0x28')]=_0x20466c[_0x8972('0x28')][_0x8972('0x31')]();this['emit'](util[_0x8972('0x2c')](_0x8972('0x35'),this[_0x8972('0xf')][_0x20466c['device']][_0x8972('0x2d')]),_0x8972('0x36'),this[_0x8972('0xf')][_0x20466c[_0x8972('0x30')]]);}else if(this['trunks'][_0x20466c[_0x8972('0x30')]]){if(this[_0x8972('0xd')][_0x20466c[_0x8972('0x30')]][_0x8972('0x28')]!==_0x20466c[_0x8972('0x28')]['toLowerCase']()){this[_0x8972('0xd')][_0x20466c[_0x8972('0x30')]]['stateTime']=_[_0x8972('0x33')](moment()[_0x8972('0x2c')]('x'));}this['trunks'][_0x20466c[_0x8972('0x30')]]['state']=_0x20466c['state'][_0x8972('0x31')]();this[_0x8972('0x24')](util[_0x8972('0x2c')](_0x8972('0x37'),this[_0x8972('0xd')][_0x20466c[_0x8972('0x30')]]['name']),'trunk:save',this[_0x8972('0xd')][_0x20466c[_0x8972('0x30')]]);}else if(_[_0x8972('0x38')](_0x20466c['device'],'Queue')){}else if(_[_0x8972('0x38')](_0x20466c[_0x8972('0x30')],_0x8972('0x39'))){var _0x57a67d=_0x20466c[_0x8972('0x30')];var _0x4c85f8=_0x57a67d[_0x8972('0x3a')](_0x57a67d[_0x8972('0x3b')]('/')+0x1,_0x57a67d[_0x8972('0x3b')]('@'));var _0xf9be9c=_[_0x8972('0x25')](this['agents'],function(_0x35c37e){return _0x35c37e[_0x8972('0x3c')]==_0x4c85f8||_0x35c37e['phone']==_0x4c85f8||_0x35c37e[_0x8972('0x3d')]==_0x4c85f8;});if(_0xf9be9c){if(_0xf9be9c['state']!==_0x20466c['state'][_0x8972('0x31')]()){_0xf9be9c['stateTime']=_[_0x8972('0x33')](moment()[_0x8972('0x2c')]('x'));}_0xf9be9c[_0x8972('0x28')]=_0x20466c['state'][_0x8972('0x31')]();_0xf9be9c['local']=!![];_0xf9be9c[_0x8972('0x34')](_0x20466c);}}else{}}}catch(_0x1f52a1){logger[_0x8972('0x1d')](_0x8972('0x3e'),util['inspect'](_0x1f52a1,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x8972('0x16')]=function(_0x20c1e4){try{if(this['isNotNull'](_0x20c1e4)&&this[_0x8972('0x22')](_0x20c1e4[_0x8972('0x15')])){if(this[_0x8972('0xe')][_0x20c1e4[_0x8972('0x3f')]]){if(!this[_0x8972('0xe')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x40')]||_0x20c1e4['peerstatus'][_0x8972('0x31')]()=='registered'){this[_0x8972('0xe')][_0x20c1e4['peer']][_0x8972('0x40')]=![];this[_0x8972('0xe')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x41')]=_0x20c1e4['peerstatus'][_0x8972('0x31')]();this[_0x8972('0xe')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x42')]=_0x20c1e4['address'];this[_0x8972('0xe')][_0x20c1e4['peer']][_0x8972('0x34')](_0x20c1e4);}}else if(this[_0x8972('0xf')][_0x20c1e4[_0x8972('0x3f')]]){this['telephones'][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x41')]=_0x20c1e4[_0x8972('0x15')][_0x8972('0x31')]();this[_0x8972('0xf')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x42')]=_0x20c1e4[_0x8972('0x42')];this[_0x8972('0x24')](util['format'](_0x8972('0x35'),this[_0x8972('0xf')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x2d')]),'telephone:save',this[_0x8972('0xf')][_0x20c1e4['peer']]);}else if(this[_0x8972('0xd')][_0x20c1e4[_0x8972('0x3f')]]){this[_0x8972('0xd')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x41')]=_0x20c1e4[_0x8972('0x15')][_0x8972('0x31')]();this['trunks'][_0x20c1e4[_0x8972('0x3f')]]['address']=_0x20c1e4['address'];this['emit'](util[_0x8972('0x2c')](_0x8972('0x37'),this[_0x8972('0xd')][_0x20c1e4[_0x8972('0x3f')]][_0x8972('0x2d')]),_0x8972('0x2e'),this[_0x8972('0xd')][_0x20c1e4[_0x8972('0x3f')]]);}else{}}}catch(_0x1e763d){logger[_0x8972('0x1d')](_0x8972('0x43'),util[_0x8972('0x1e')](_0x1e763d,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x4cb6=['peerstatus','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','ioredis','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','loopSyncRealTimeShow','prototype','isNotNull','isUndefined','emit','find','username','stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','trunk:save','[syncRegistry][UserReport]','device','toLowerCase','inuse','local','toNumber','updateStatusRealtime','stateTime','telephone:%s','name','telephone:save','startsWith','Queue','Local','substring','indexOf','phone','accountcode','[syncDeviceState][UserReport]','peer'];(function(_0xe2d8c4,_0x4e3b34){var _0x5e539a=function(_0x35560e){while(--_0x35560e){_0xe2d8c4['push'](_0xe2d8c4['shift']());}};_0x5e539a(++_0x4e3b34);}(_0x4cb6,0x19d));var _0x64cb=function(_0x12da50,_0x4eab81){_0x12da50=_0x12da50-0x0;var _0x4159b0=_0x4cb6[_0x12da50];return _0x4159b0;};'use strict';var _=require(_0x64cb('0x0'));var moment=require(_0x64cb('0x1'));var BPromise=require(_0x64cb('0x2'));var util=require(_0x64cb('0x3'));var Redis=require(_0x64cb('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require('../ami');config[_0x64cb('0x5')]=_[_0x64cb('0x6')](config['redis'],{'host':_0x64cb('0x7'),'port':0x18eb});var io=require(_0x64cb('0x8'))(new Redis(config['redis']));function UserReport(_0x461254){this['trunks']=_0x461254[_0x64cb('0x9')];this[_0x64cb('0xa')]=_0x461254[_0x64cb('0xa')];this[_0x64cb('0xb')]=_0x461254[_0x64cb('0xb')];ami['on'](_0x64cb('0xc'),this['syncRegistry'][_0x64cb('0xd')](this));ami['on'](_0x64cb('0xe'),this[_0x64cb('0xf')][_0x64cb('0xd')](this));ami['on'](_0x64cb('0x10'),this[_0x64cb('0x11')][_0x64cb('0xd')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x64cb('0xd')](this));this['loopSyncRealTimeShow']();return BPromise[_0x64cb('0x12')]()[_0x64cb('0x13')](ami[_0x64cb('0x14')]())['then'](ami[_0x64cb('0x15')]())[_0x64cb('0x13')](ami[_0x64cb('0x16')]())[_0x64cb('0x17')](loggerCatch(_0x64cb('0x18')));}function loggerCatch(_0x344c9d){return function(_0x305ae4){logger[_0x64cb('0x19')](_0x344c9d,util[_0x64cb('0x1a')](_0x305ae4,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x64cb('0x1b')]=function(){setInterval(function(){BPromise[_0x64cb('0x12')]()['then'](ami[_0x64cb('0x14')]())[_0x64cb('0x13')](ami[_0x64cb('0x15')]())[_0x64cb('0x13')](ami['actionSipPeerStatus']())[_0x64cb('0x17')](loggerCatch(_0x64cb('0x18')));},0x32c8);};UserReport[_0x64cb('0x1c')][_0x64cb('0x1d')]=function(_0x4a03e4){return _0x4a03e4!==null&&!_[_0x64cb('0x1e')](_0x4a03e4);};UserReport[_0x64cb('0x1c')]['emit']=function(_0x1e37ac,_0x3b86d5,_0x48770a){io['to'](_0x1e37ac)[_0x64cb('0x1f')](_0x3b86d5,_0x48770a);};UserReport[_0x64cb('0x1c')][_0x64cb('0xf')]=function(_0x2e5271){try{if(this['isNotNull'](_0x2e5271)){var _0x35718a=_[_0x64cb('0x20')](this[_0x64cb('0x9')],{'registry':_0x2e5271[_0x64cb('0x21')]});if(_0x35718a){_0x2e5271[_0x64cb('0x22')]=_0x2e5271[_0x64cb('0x23')];_[_0x64cb('0x24')](_0x35718a,_[_0x64cb('0x25')](_0x2e5271,[_0x64cb('0x26'),_0x64cb('0x27'),_0x64cb('0x21'),_0x64cb('0x23')]));this[_0x64cb('0x1f')](util[_0x64cb('0x28')](_0x64cb('0x29'),_0x35718a['name']),_0x64cb('0x2a'),_0x35718a);}}}catch(_0x1a9077){logger[_0x64cb('0x19')](_0x64cb('0x2b'),util[_0x64cb('0x1a')](_0x1a9077,{'showHidden':![],'depth':null}));}};UserReport[_0x64cb('0x1c')]['syncDeviceState']=function(_0x4b845a){try{if(this[_0x64cb('0x1d')](_0x4b845a)){if(this[_0x64cb('0xa')][_0x4b845a['device']]){if(!this[_0x64cb('0xa')][_0x4b845a[_0x64cb('0x2c')]]['local']||_0x4b845a[_0x64cb('0x23')][_0x64cb('0x2d')]()==_0x64cb('0x2e')){this[_0x64cb('0xa')][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x2f')]=![];if(this['agents'][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x23')]!==_0x4b845a[_0x64cb('0x23')][_0x64cb('0x2d')]()){this[_0x64cb('0xa')][_0x4b845a[_0x64cb('0x2c')]]['stateTime']=_[_0x64cb('0x30')](moment()[_0x64cb('0x28')]('x'));}this[_0x64cb('0xa')][_0x4b845a['device']][_0x64cb('0x23')]=_0x4b845a['state'][_0x64cb('0x2d')]();this[_0x64cb('0xa')][_0x4b845a['device']][_0x64cb('0x31')](_0x4b845a);}}else if(this[_0x64cb('0xb')][_0x4b845a[_0x64cb('0x2c')]]){if(this[_0x64cb('0xb')][_0x4b845a[_0x64cb('0x2c')]]['state']!==_0x4b845a[_0x64cb('0x23')][_0x64cb('0x2d')]()){this[_0x64cb('0xb')][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x32')]=_['toNumber'](moment()['format']('x'));}this[_0x64cb('0xb')][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x23')]=_0x4b845a[_0x64cb('0x23')]['toLowerCase']();this[_0x64cb('0x1f')](util[_0x64cb('0x28')](_0x64cb('0x33'),this[_0x64cb('0xb')][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x34')]),_0x64cb('0x35'),this['telephones'][_0x4b845a[_0x64cb('0x2c')]]);}else if(this['trunks'][_0x4b845a[_0x64cb('0x2c')]]){if(this[_0x64cb('0x9')][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x23')]!==_0x4b845a[_0x64cb('0x23')][_0x64cb('0x2d')]()){this[_0x64cb('0x9')][_0x4b845a[_0x64cb('0x2c')]]['stateTime']=_[_0x64cb('0x30')](moment()[_0x64cb('0x28')]('x'));}this[_0x64cb('0x9')][_0x4b845a[_0x64cb('0x2c')]][_0x64cb('0x23')]=_0x4b845a[_0x64cb('0x23')][_0x64cb('0x2d')]();this[_0x64cb('0x1f')](util['format'](_0x64cb('0x29'),this[_0x64cb('0x9')][_0x4b845a[_0x64cb('0x2c')]]['name']),_0x64cb('0x2a'),this[_0x64cb('0x9')][_0x4b845a[_0x64cb('0x2c')]]);}else if(_[_0x64cb('0x36')](_0x4b845a[_0x64cb('0x2c')],_0x64cb('0x37'))){}else if(_[_0x64cb('0x36')](_0x4b845a[_0x64cb('0x2c')],_0x64cb('0x38'))){var _0x3dc7ac=_0x4b845a['device'];var _0x4e8575=_0x3dc7ac[_0x64cb('0x39')](_0x3dc7ac[_0x64cb('0x3a')]('/')+0x1,_0x3dc7ac['indexOf']('@'));var _0x2aee25=_[_0x64cb('0x20')](this[_0x64cb('0xa')],function(_0x2df353){return _0x2df353['mobile']==_0x4e8575||_0x2df353[_0x64cb('0x3b')]==_0x4e8575||_0x2df353[_0x64cb('0x3c')]==_0x4e8575;});if(_0x2aee25){if(_0x2aee25['state']!==_0x4b845a['state'][_0x64cb('0x2d')]()){_0x2aee25['stateTime']=_['toNumber'](moment()[_0x64cb('0x28')]('x'));}_0x2aee25[_0x64cb('0x23')]=_0x4b845a[_0x64cb('0x23')][_0x64cb('0x2d')]();_0x2aee25[_0x64cb('0x2f')]=!![];_0x2aee25[_0x64cb('0x31')](_0x4b845a);}}else{}}}catch(_0x2aa490){logger[_0x64cb('0x19')](_0x64cb('0x3d'),util[_0x64cb('0x1a')](_0x2aa490,{'showHidden':![],'depth':null}));}};UserReport[_0x64cb('0x1c')]['syncPeerStatus']=function(_0x500b2e){try{if(this[_0x64cb('0x1d')](_0x500b2e)&&this[_0x64cb('0x1d')](_0x500b2e['peerstatus'])){if(this[_0x64cb('0xa')][_0x500b2e[_0x64cb('0x3e')]]){if(!this[_0x64cb('0xa')][_0x500b2e['peer']][_0x64cb('0x2f')]||_0x500b2e[_0x64cb('0x3f')]['toLowerCase']()==_0x64cb('0x40')){this['agents'][_0x500b2e[_0x64cb('0x3e')]][_0x64cb('0x2f')]=![];this[_0x64cb('0xa')][_0x500b2e[_0x64cb('0x3e')]]['status']=_0x500b2e[_0x64cb('0x3f')]['toLowerCase']();this[_0x64cb('0xa')][_0x500b2e['peer']]['address']=_0x500b2e['address'];this[_0x64cb('0xa')][_0x500b2e['peer']]['updateStatusRealtime'](_0x500b2e);}}else if(this['telephones'][_0x500b2e['peer']]){this[_0x64cb('0xb')][_0x500b2e[_0x64cb('0x3e')]][_0x64cb('0x41')]=_0x500b2e[_0x64cb('0x3f')][_0x64cb('0x2d')]();this['telephones'][_0x500b2e[_0x64cb('0x3e')]]['address']=_0x500b2e[_0x64cb('0x42')];this[_0x64cb('0x1f')](util[_0x64cb('0x28')]('telephone:%s',this[_0x64cb('0xb')][_0x500b2e[_0x64cb('0x3e')]][_0x64cb('0x34')]),_0x64cb('0x35'),this[_0x64cb('0xb')][_0x500b2e[_0x64cb('0x3e')]]);}else if(this[_0x64cb('0x9')][_0x500b2e[_0x64cb('0x3e')]]){this[_0x64cb('0x9')][_0x500b2e[_0x64cb('0x3e')]]['status']=_0x500b2e[_0x64cb('0x3f')][_0x64cb('0x2d')]();this[_0x64cb('0x9')][_0x500b2e[_0x64cb('0x3e')]][_0x64cb('0x42')]=_0x500b2e[_0x64cb('0x42')];this[_0x64cb('0x1f')](util[_0x64cb('0x28')](_0x64cb('0x29'),this[_0x64cb('0x9')][_0x500b2e[_0x64cb('0x3e')]]['name']),_0x64cb('0x2a'),this[_0x64cb('0x9')][_0x500b2e[_0x64cb('0x3e')]]);}else{}}}catch(_0x10caf0){logger[_0x64cb('0x19')](_0x64cb('0x43'),util['inspect'](_0x10caf0,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index d59b17b..1e292c6 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 _0x7361=['musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','privilege','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','queue','destconnectedlinenum','user:agentconnect','custom:agentconnect','reason','lastevent','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','agentringnoanswerAt','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','hasOwnProperty','agentcompleteAt','complete','talktime','transfer','agent','acw','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','memberdynamic','memberinterface','memberrealtime','isNil','syncHangup','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','seconds','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart'];(function(_0xc9df8b,_0x21744d){var _0x35ca5d=function(_0x120ce3){while(--_0x120ce3){_0xc9df8b['push'](_0xc9df8b['shift']());}};_0x35ca5d(++_0x21744d);}(_0x7361,0xd5));var _0x1736=function(_0x85c604,_0x2f17a6){_0x85c604=_0x85c604-0x0;var _0x11a65a=_0x7361[_0x85c604];return _0x11a65a;};'use strict';var _=require(_0x1736('0x0'));var moment=require('moment');var util=require(_0x1736('0x1'));var Redis=require(_0x1736('0x2'));var config=require(_0x1736('0x3'));var logger=require('../../../config/logger')(_0x1736('0x4'));var ami=require(_0x1736('0x5'));config['redis']=_[_0x1736('0x6')](config[_0x1736('0x7')],{'host':_0x1736('0x8'),'port':0x18eb});var io=require(_0x1736('0x9'))(new Redis(config[_0x1736('0x7')]));function VoiceAgentReport(_0x207690){this['channels']={};this[_0x1736('0xa')]=_0x207690['voiceQueues'];this[_0x1736('0xb')]=_0x207690[_0x1736('0xb')];this[_0x1736('0xc')]={};ami['on'](_0x1736('0xd'),this[_0x1736('0xe')][_0x1736('0xf')](this));ami['on']('agentconnect',this[_0x1736('0x10')][_0x1736('0xf')](this));ami['on'](_0x1736('0x11'),this[_0x1736('0x12')][_0x1736('0xf')](this));ami['on'](_0x1736('0x13'),this[_0x1736('0x14')][_0x1736('0xf')](this));ami['on'](_0x1736('0x15'),this['syncAgentComplete']['bind'](this));ami['on'](_0x1736('0x16'),this[_0x1736('0x17')][_0x1736('0xf')](this));ami['on'](_0x1736('0x18'),this['syncHangup']['bind'](this));ami['on'](_0x1736('0x19'),this[_0x1736('0x1a')][_0x1736('0xf')](this));ami['on'](_0x1736('0x1b'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x1736('0x1c'),this[_0x1736('0x1d')][_0x1736('0xf')](this));ami['on'](_0x1736('0x1e'),this[_0x1736('0x1f')][_0x1736('0xf')](this));}VoiceAgentReport[_0x1736('0x20')][_0x1736('0x21')]=function(_0x1c636,_0x216d73,_0xf0bec4){io['to'](_0x1c636)[_0x1736('0x21')](_0x216d73,_0xf0bec4);};VoiceAgentReport['prototype'][_0x1736('0x22')]=function(_0x54e048){return _0x54e048!==null&&!_[_0x1736('0x23')](_0x54e048);};VoiceAgentReport[_0x1736('0x20')][_0x1736('0xe')]=function(_0x186385){try{if(this[_0x1736('0x22')](_0x186385)){if(_[_0x1736('0x23')](this['channels'][_0x186385['uniqueid']])){this[_0x1736('0x24')][_0x186385['uniqueid']]={};}if(_[_0x1736('0x23')](this[_0x1736('0x24')][_0x186385[_0x1736('0x25')]][_0x186385[_0x1736('0x26')]])){this[_0x1736('0x24')][_0x186385[_0x1736('0x25')]][_0x186385[_0x1736('0x26')]]={'agentcalledAt':moment()[_0x1736('0x27')](_0x1736('0x28')),'lastevent':_0x1736('0x29'),'variables':this[_0x1736('0xc')][_0x186385[_0x1736('0x25')]],'type':this[_0x1736('0xa')][_0x186385['queue']]?this[_0x1736('0xa')][_0x186385['queue']]['type']||'inbound':'inbound'};}_['merge'](this[_0x1736('0x24')][_0x186385[_0x1736('0x25')]][_0x186385[_0x1736('0x26')]],_['omit'](_0x186385,['event',_0x1736('0x2a')]));ami['emit'](_0x1736('0x2b'),this[_0x1736('0x24')][_0x186385[_0x1736('0x25')]][_0x186385[_0x1736('0x26')]]);this[_0x1736('0x21')](util[_0x1736('0x27')](_0x1736('0x2c'),_0x186385[_0x1736('0x2d')]),_0x1736('0x2e'),this['channels'][_0x186385['uniqueid']][_0x186385['destuniqueid']]);}}catch(_0x39325b){logger[_0x1736('0x2f')](_0x1736('0x30'),util['inspect'](_0x39325b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1736('0x10')]=function(_0x4d3a6e){try{if(this['isNotNull'](_0x4d3a6e)){if(this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]]){for(var _0x4e843f in this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]]){if(this[_0x1736('0x24')][_0x4d3a6e['uniqueid']]['hasOwnProperty'](_0x4e843f)){if(_0x4d3a6e['destuniqueid']===_0x4e843f){this[_0x1736('0x24')][_0x4d3a6e['uniqueid']][_0x4e843f][_0x1736('0x31')]=moment()[_0x1736('0x27')](_0x1736('0x28'));this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f]['lastevent']=_0x1736('0x32');this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x33')]=_0x4d3a6e['holdtime'];this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f]['connectedlinenum']=_0x4d3a6e[_0x1736('0x34')];this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x35')]=_0x4d3a6e['connectedlinename'];this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x36')]=_0x4d3a6e[_0x1736('0x36')];this['channels'][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x37')]=_0x4d3a6e[_0x1736('0x37')];_[_0x1736('0x38')](this[_0x1736('0xb')][_0x4d3a6e[_0x1736('0x39')]],_['pick'](_0x4d3a6e,[_0x1736('0x3a'),_0x1736('0x3b')]));this['emit'](util[_0x1736('0x27')]('user:%s',_0x4d3a6e['membername']),_0x1736('0x3c'),this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4d3a6e['destuniqueid']]);ami[_0x1736('0x21')](_0x1736('0x3d'),this[_0x1736('0x24')][_0x4d3a6e['uniqueid']][_0x4e843f]);}else if(!this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x11')]&&!this['channels'][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x15')]){this['channels'][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x11')]=!![];this[_0x1736('0x24')][_0x4d3a6e['uniqueid']][_0x4e843f]['agentringnoanswerAt']=moment()[_0x1736('0x27')](_0x1736('0x28'));this['channels'][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x3e')]='answered_elsewhere';this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x3f')]='answered_elsewhere';this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f][_0x1736('0x40')]=_0x4d3a6e['destuniqueid'];this[_0x1736('0x24')][_0x4d3a6e['uniqueid']][_0x4e843f]['answeredelsewheremembername']=_0x4d3a6e['membername'];ami[_0x1736('0x21')](_0x1736('0x41'),this[_0x1736('0x24')][_0x4d3a6e[_0x1736('0x25')]][_0x4e843f]);}}}}}}catch(_0xacdf04){logger['error'](_0x1736('0x42'),util[_0x1736('0x43')](_0xacdf04,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1736('0x20')]['syncAgentRingNoAnswer']=function(_0x5d0f47){try{if(this[_0x1736('0x22')](_0x5d0f47)){if(this['channels'][_0x5d0f47[_0x1736('0x25')]]&&this[_0x1736('0x24')][_0x5d0f47[_0x1736('0x25')]][_0x5d0f47['destuniqueid']]){this[_0x1736('0x24')][_0x5d0f47['uniqueid']][_0x5d0f47[_0x1736('0x26')]][_0x1736('0x11')]=!![];this[_0x1736('0x24')][_0x5d0f47[_0x1736('0x25')]][_0x5d0f47['destuniqueid']][_0x1736('0x44')]=moment()[_0x1736('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1736('0x24')][_0x5d0f47[_0x1736('0x25')]][_0x5d0f47[_0x1736('0x26')]][_0x1736('0x3e')]=_0x1736('0x45');this[_0x1736('0x24')][_0x5d0f47[_0x1736('0x25')]][_0x5d0f47['destuniqueid']][_0x1736('0x3f')]=_0x1736('0x45');ami[_0x1736('0x21')](_0x1736('0x46'),this[_0x1736('0x24')][_0x5d0f47['uniqueid']][_0x5d0f47[_0x1736('0x26')]]);}}}catch(_0x26177b){logger['error'](_0x1736('0x47'),util[_0x1736('0x43')](_0x26177b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x50656a){try{if(this['isNotNull'](_0x50656a)){if(this[_0x1736('0x24')][_0x50656a[_0x1736('0x25')]]){for(var _0x3dc0a2 in this[_0x1736('0x24')][_0x50656a[_0x1736('0x25')]]){if(this[_0x1736('0x24')][_0x50656a['uniqueid']]['hasOwnProperty'](_0x3dc0a2)&&!this[_0x1736('0x24')][_0x50656a[_0x1736('0x25')]][_0x3dc0a2][_0x1736('0x11')]&&!this[_0x1736('0x24')][_0x50656a[_0x1736('0x25')]][_0x3dc0a2]['agentcomplete']){this['channels'][_0x50656a[_0x1736('0x25')]][_0x3dc0a2]['agentringnoanswer']=!![];this['channels'][_0x50656a[_0x1736('0x25')]][_0x3dc0a2][_0x1736('0x44')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1736('0x24')][_0x50656a[_0x1736('0x25')]][_0x3dc0a2]['reason']=_0x1736('0x48');this['channels'][_0x50656a[_0x1736('0x25')]][_0x3dc0a2][_0x1736('0x3f')]='abandoned';ami[_0x1736('0x21')]('custom:agentqueuecallerabandon',this[_0x1736('0x24')][_0x50656a['uniqueid']][_0x3dc0a2]);}}}}}catch(_0x47d6d0){logger[_0x1736('0x2f')](_0x1736('0x49'),util[_0x1736('0x43')](_0x47d6d0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1736('0x20')][_0x1736('0x4a')]=function(_0x316ccb){try{if(this[_0x1736('0x22')](_0x316ccb)){if(this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]]){for(var _0x52386a in this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]]){if(this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x1736('0x4b')](_0x52386a)){if(this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x31')]&&!this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x15')]){this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x15')]=!![];this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x4c')]=moment()[_0x1736('0x27')](_0x1736('0x28'));this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x3f')]=_0x1736('0x4d');this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x4e')]=_0x316ccb[_0x1736('0x4e')];this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a][_0x1736('0x3e')]=_0x316ccb[_0x1736('0x3e')]==_0x1736('0x4f')?_0x1736('0x50'):_0x316ccb[_0x1736('0x3e')];if(this[_0x1736('0xa')][_0x316ccb[_0x1736('0x3a')]]&&this['voiceQueues'][_0x316ccb['queue']][_0x1736('0x51')]){this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a]['agentacw']=!![];this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a]['acwtime']=this[_0x1736('0xa')][_0x316ccb[_0x1736('0x3a')]][_0x1736('0x52')];}this['agents'][_0x316ccb[_0x1736('0x39')]]=_[_0x1736('0x53')](this[_0x1736('0xb')][_0x316ccb[_0x1736('0x39')]],[_0x1736('0x3a'),_0x1736('0x3b')]);this[_0x1736('0x21')](util[_0x1736('0x27')](_0x1736('0x2c'),_0x316ccb['membername']),_0x1736('0x54'),this[_0x1736('0x24')][_0x316ccb[_0x1736('0x25')]][_0x52386a]);ami[_0x1736('0x21')](_0x1736('0x55'),this[_0x1736('0x24')][_0x316ccb['uniqueid']][_0x52386a]);}}}}}}catch(_0x5cb8ce){logger['error'](_0x1736('0x56'),util[_0x1736('0x43')](_0x5cb8ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1736('0x20')]['syncVarSet']=function(_0x1db10c){try{if(this[_0x1736('0x22')](_0x1db10c)){this[_0x1736('0x57')](_0x1db10c['uniqueid'],_['keys'](_0x1db10c[_0x1736('0x58')])[0x0],_0x1db10c[_0x1736('0x59')]);if(this[_0x1736('0x24')][_0x1db10c['uniqueid']]){for(var _0x276d29 in this['channels'][_0x1db10c[_0x1736('0x25')]]){if(this[_0x1736('0x24')][_0x1db10c[_0x1736('0x25')]][_0x1736('0x4b')](_0x276d29)){if(_[_0x1736('0x23')](this['channels'][_0x1db10c['uniqueid']][_0x276d29][_0x1736('0xc')])){this[_0x1736('0x24')][_0x1db10c[_0x1736('0x25')]][_0x276d29][_0x1736('0xc')]={};}this[_0x1736('0x24')][_0x1db10c['uniqueid']][_0x276d29][_0x1736('0xc')]=this['variables'][_0x1db10c[_0x1736('0x25')]];}}}}}catch(_0x29b9ec){logger['error'](_0x1736('0x5a'),util['inspect'](_0x29b9ec,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x10d268,_0x252bf8,_0x536e2a){var _0x585367=[_0x1736('0x5b'),_0x1736('0x5c'),_0x1736('0x5d'),_0x1736('0x5e'),'rtpaudioqosloss',_0x1736('0x5f'),_0x1736('0x60'),_0x1736('0x61'),_0x1736('0x62'),'sipuri','bridgepeer',_0x1736('0x63'),'membercalls',_0x1736('0x64'),_0x1736('0x65'),'memberlastcall',_0x1736('0x2d'),'memberpenalty',_0x1736('0x66')];if(!_[_0x1736('0x67')](_0x252bf8)&&!_['includes'](_0x585367,_0x252bf8)){if(_[_0x1736('0x23')](this[_0x1736('0xc')][_0x10d268])){this[_0x1736('0xc')][_0x10d268]={};}this[_0x1736('0xc')][_0x10d268][_0x252bf8]=_0x536e2a;}};VoiceAgentReport[_0x1736('0x20')][_0x1736('0x68')]=function(_0x358377){try{if(this['isNotNull'](_0x358377)){if(this[_0x1736('0x24')][_0x358377['uniqueid']]){for(var _0x3cfbcd in this[_0x1736('0x24')][_0x358377[_0x1736('0x25')]]){if(this[_0x1736('0x24')][_0x358377[_0x1736('0x25')]][_0x1736('0x4b')](_0x3cfbcd)){if(this[_0x1736('0x24')][_0x358377['uniqueid']][_0x3cfbcd][_0x1736('0x3e')]==_0x1736('0x4f')&&this[_0x1736('0x24')][_0x358377[_0x1736('0x25')]][_0x3cfbcd][_0x1736('0x15')]){this[_0x1736('0x24')][_0x358377['uniqueid']][_0x3cfbcd][_0x1736('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}ami['emit']('custom:voiceAgentReport',_[_0x1736('0x69')](this[_0x1736('0x24')][_0x358377[_0x1736('0x25')]]));delete this[_0x1736('0x24')][_0x358377['uniqueid']];}if(this[_0x1736('0xc')][_0x358377[_0x1736('0x25')]]){delete this[_0x1736('0xc')][_0x358377[_0x1736('0x25')]];}}}catch(_0x4a2908){logger[_0x1736('0x2f')](_0x1736('0x6a'),util[_0x1736('0x43')](_0x4a2908,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1736('0x1d')]=function(_0x21f2fc){try{if(this[_0x1736('0x22')](_0x21f2fc)){if(this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6b')]]){for(var _0x297fbe in this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6b')]]){if(this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6b')]][_0x1736('0x4b')](_0x297fbe)){if(_0x21f2fc[_0x1736('0x6c')]===_0x297fbe){var _0x1fc888=moment();this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6b')]][_0x297fbe]['agentcomplete']=!![];this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6b')]][_0x297fbe][_0x1736('0x4c')]=moment()[_0x1736('0x27')](_0x1736('0x28'));this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6b')]][_0x297fbe]['reason']='transfer';this['channels'][_0x21f2fc[_0x1736('0x6b')]][_0x297fbe][_0x1736('0x3f')]=_0x1736('0x4d');this[_0x1736('0x24')][_0x21f2fc['transfereeuniqueid']][_0x297fbe]['talktime']=_0x1fc888[_0x1736('0x6d')](this['channels'][_0x21f2fc[_0x1736('0x6b')]][_0x297fbe][_0x1736('0x31')],'seconds');}}}}if(this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6e')]]){var _0x4e92a8=this[_0x1736('0x24')][_0x21f2fc[_0x1736('0x6e')]];this[_0x1736('0x24')][_0x21f2fc['secondtransfereruniqueid']]=this[_0x1736('0x24')][_0x21f2fc['transfereeuniqueid']];this[_0x1736('0x24')][_0x21f2fc['transfereeuniqueid']]=_0x4e92a8;}}}catch(_0x220842){logger[_0x1736('0x2f')](_0x1736('0x6f'),util[_0x1736('0x43')](_0x220842,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1736('0x20')][_0x1736('0x1f')]=function(_0x270bbb){try{if(this['isNotNull'](_0x270bbb)){if(this[_0x1736('0x24')][_0x270bbb[_0x1736('0x6b')]]){for(var _0x6151e0 in this[_0x1736('0x24')][_0x270bbb['transfereeuniqueid']]){if(this[_0x1736('0x24')][_0x270bbb[_0x1736('0x6b')]]['hasOwnProperty'](_0x6151e0)){if(_0x270bbb['transfereruniqueid']===_0x6151e0){var _0x310b94=moment();this['channels'][_0x270bbb[_0x1736('0x6b')]][_0x6151e0][_0x1736('0x15')]=!![];this[_0x1736('0x24')][_0x270bbb[_0x1736('0x6b')]][_0x6151e0][_0x1736('0x4c')]=_0x310b94;this[_0x1736('0x24')][_0x270bbb['transfereeuniqueid']][_0x6151e0]['reason']='transfer';this[_0x1736('0x24')][_0x270bbb[_0x1736('0x6b')]][_0x6151e0][_0x1736('0x3f')]=_0x1736('0x4d');this['channels'][_0x270bbb[_0x1736('0x6b')]][_0x6151e0][_0x1736('0x4e')]=_0x310b94[_0x1736('0x6d')](this[_0x1736('0x24')][_0x270bbb[_0x1736('0x6b')]][_0x6151e0][_0x1736('0x31')],_0x1736('0x70'));}}}}}}catch(_0x523f1f){logger[_0x1736('0x2f')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x1736('0x43')](_0x523f1f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x1736('0x1a')]=function(_0x489fa4){var _0x378649='';try{if(this[_0x1736('0x22')](_0x489fa4)){if(_0x489fa4[_0x1736('0x71')]){_0x378649=_0x489fa4[_0x1736('0x71')][_0x1736('0x72')](0x0,_0x489fa4[_0x1736('0x71')][_0x1736('0x73')]('-'));if(this[_0x1736('0xb')][_0x378649]){this['agents'][_0x378649][_0x1736('0x74')]=!![];}}}}catch(_0x462a22){logger[_0x1736('0x2f')](_0x1736('0x75'),util['inspect'](_0x462a22,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x1736('0x20')][_0x1736('0x76')]=function(_0x4ee537){var _0x1250b7='';try{if(this[_0x1736('0x22')](_0x4ee537)){if(_0x4ee537[_0x1736('0x71')]){_0x1250b7=_0x4ee537[_0x1736('0x71')][_0x1736('0x72')](0x0,_0x4ee537[_0x1736('0x71')][_0x1736('0x73')]('-'));if(this[_0x1736('0xb')][_0x1250b7]){this[_0x1736('0xb')][_0x1250b7][_0x1736('0x74')]=![];}}}}catch(_0x497946){logger['error'](_0x1736('0x77'),util[_0x1736('0x43')](_0x497946,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xf532=['[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','emit','isNotNull','isUndefined','prototype','uniqueid','destuniqueid','format','queue','inbound','merge','privilege','user:%s','membername','user:called','inspect','hasOwnProperty','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','connectedlinenum','destchannelstate','destchannelstatedesc','pick','user:agentconnect','custom:agentconnect','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','agentringnoanswerAt','rejected','custom:agentringnoanswer','error','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','complete','talktime','transfer','agent','acw','agentacw','acwtime','acwTimeout','omit','interface','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','value','variables','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberrealtime','isNil','includes','agentcompleteAt','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','transfereruniqueid','syncMusicOnHoldStart','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf532,0xee));var _0x2f53=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf532[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x2f53('0x0'));var moment=require(_0x2f53('0x1'));var util=require(_0x2f53('0x2'));var Redis=require('ioredis');var config=require(_0x2f53('0x3'));var logger=require(_0x2f53('0x4'))(_0x2f53('0x5'));var ami=require(_0x2f53('0x6'));config['redis']=_[_0x2f53('0x7')](config[_0x2f53('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x365a05){this[_0x2f53('0x9')]={};this['voiceQueues']=_0x365a05[_0x2f53('0xa')];this[_0x2f53('0xb')]=_0x365a05[_0x2f53('0xb')];this['variables']={};ami['on'](_0x2f53('0xc'),this[_0x2f53('0xd')][_0x2f53('0xe')](this));ami['on'](_0x2f53('0xf'),this['syncAgentConnect'][_0x2f53('0xe')](this));ami['on'](_0x2f53('0x10'),this[_0x2f53('0x11')][_0x2f53('0xe')](this));ami['on'](_0x2f53('0x12'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x2f53('0x13'),this[_0x2f53('0x14')][_0x2f53('0xe')](this));ami['on'](_0x2f53('0x15'),this[_0x2f53('0x16')][_0x2f53('0xe')](this));ami['on'](_0x2f53('0x17'),this[_0x2f53('0x18')][_0x2f53('0xe')](this));ami['on'](_0x2f53('0x19'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x2f53('0x1a'),this[_0x2f53('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0x2f53('0x1c')]['bind'](this));ami['on']('blindtransfer',this[_0x2f53('0x1d')][_0x2f53('0xe')](this));}VoiceAgentReport['prototype'][_0x2f53('0x1e')]=function(_0x23b005,_0x35aafc,_0xee44cd){io['to'](_0x23b005)[_0x2f53('0x1e')](_0x35aafc,_0xee44cd);};VoiceAgentReport['prototype'][_0x2f53('0x1f')]=function(_0x429b3a){return _0x429b3a!==null&&!_[_0x2f53('0x20')](_0x429b3a);};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0xd')]=function(_0xc44826){try{if(this[_0x2f53('0x1f')](_0xc44826)){if(_[_0x2f53('0x20')](this['channels'][_0xc44826[_0x2f53('0x22')]])){this['channels'][_0xc44826[_0x2f53('0x22')]]={};}if(_[_0x2f53('0x20')](this[_0x2f53('0x9')][_0xc44826[_0x2f53('0x22')]][_0xc44826[_0x2f53('0x23')]])){this[_0x2f53('0x9')][_0xc44826[_0x2f53('0x22')]][_0xc44826['destuniqueid']]={'agentcalledAt':moment()[_0x2f53('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','variables':this['variables'][_0xc44826[_0x2f53('0x22')]],'type':this['voiceQueues'][_0xc44826['queue']]?this[_0x2f53('0xa')][_0xc44826[_0x2f53('0x25')]]['type']||_0x2f53('0x26'):_0x2f53('0x26')};}_[_0x2f53('0x27')](this[_0x2f53('0x9')][_0xc44826[_0x2f53('0x22')]][_0xc44826[_0x2f53('0x23')]],_['omit'](_0xc44826,['event',_0x2f53('0x28')]));ami[_0x2f53('0x1e')]('custom:agentcalled',this[_0x2f53('0x9')][_0xc44826[_0x2f53('0x22')]][_0xc44826[_0x2f53('0x23')]]);this[_0x2f53('0x1e')](util[_0x2f53('0x24')](_0x2f53('0x29'),_0xc44826[_0x2f53('0x2a')]),_0x2f53('0x2b'),this[_0x2f53('0x9')][_0xc44826[_0x2f53('0x22')]][_0xc44826[_0x2f53('0x23')]]);}}catch(_0xf72e60){logger['error']('[syncAgentCalled][VoiceAgentReport]',util[_0x2f53('0x2c')](_0xf72e60,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')]['syncAgentConnect']=function(_0x34e512){try{if(this[_0x2f53('0x1f')](_0x34e512)){if(this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]]){for(var _0x2ed908 in this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]]){if(this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2f53('0x2d')](_0x2ed908)){if(_0x34e512[_0x2f53('0x23')]===_0x2ed908){this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x2e')]=moment()[_0x2f53('0x24')](_0x2f53('0x2f'));this[_0x2f53('0x9')][_0x34e512['uniqueid']][_0x2ed908][_0x2f53('0x30')]=_0x2f53('0x31');this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908]['holdtime']=_0x34e512['holdtime'];this[_0x2f53('0x9')][_0x34e512['uniqueid']][_0x2ed908][_0x2f53('0x32')]=_0x34e512[_0x2f53('0x32')];this[_0x2f53('0x9')][_0x34e512['uniqueid']][_0x2ed908]['connectedlinename']=_0x34e512['connectedlinename'];this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x33')]=_0x34e512['destchannelstate'];this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x34')]=_0x34e512[_0x2f53('0x34')];_[_0x2f53('0x27')](this['agents'][_0x34e512['interface']],_[_0x2f53('0x35')](_0x34e512,[_0x2f53('0x25'),'destconnectedlinenum']));this['emit'](util[_0x2f53('0x24')](_0x2f53('0x29'),_0x34e512[_0x2f53('0x2a')]),_0x2f53('0x36'),this['channels'][_0x34e512['uniqueid']][_0x34e512[_0x2f53('0x23')]]);ami[_0x2f53('0x1e')](_0x2f53('0x37'),this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908]);}else if(!this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x10')]&&!this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x13')]){this[_0x2f53('0x9')][_0x34e512['uniqueid']][_0x2ed908]['agentringnoanswer']=!![];this[_0x2f53('0x9')][_0x34e512[_0x2f53('0x22')]][_0x2ed908]['agentringnoanswerAt']=moment()[_0x2f53('0x24')](_0x2f53('0x2f'));this['channels'][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x38')]=_0x2f53('0x39');this[_0x2f53('0x9')][_0x34e512['uniqueid']][_0x2ed908][_0x2f53('0x30')]=_0x2f53('0x39');this['channels'][_0x34e512[_0x2f53('0x22')]][_0x2ed908]['answeredelsewheredestinationuniqueid']=_0x34e512[_0x2f53('0x23')];this['channels'][_0x34e512[_0x2f53('0x22')]][_0x2ed908][_0x2f53('0x3a')]=_0x34e512[_0x2f53('0x2a')];ami[_0x2f53('0x1e')](_0x2f53('0x3b'),this[_0x2f53('0x9')][_0x34e512['uniqueid']][_0x2ed908]);}}}}}}catch(_0x1750a9){logger['error'](_0x2f53('0x3c'),util[_0x2f53('0x2c')](_0x1750a9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x11')]=function(_0x5e91a7){try{if(this['isNotNull'](_0x5e91a7)){if(this[_0x2f53('0x9')][_0x5e91a7[_0x2f53('0x22')]]&&this['channels'][_0x5e91a7['uniqueid']][_0x5e91a7[_0x2f53('0x23')]]){this['channels'][_0x5e91a7['uniqueid']][_0x5e91a7[_0x2f53('0x23')]][_0x2f53('0x10')]=!![];this[_0x2f53('0x9')][_0x5e91a7[_0x2f53('0x22')]][_0x5e91a7[_0x2f53('0x23')]][_0x2f53('0x3d')]=moment()['format'](_0x2f53('0x2f'));this[_0x2f53('0x9')][_0x5e91a7[_0x2f53('0x22')]][_0x5e91a7[_0x2f53('0x23')]][_0x2f53('0x38')]=_0x2f53('0x3e');this[_0x2f53('0x9')][_0x5e91a7[_0x2f53('0x22')]][_0x5e91a7[_0x2f53('0x23')]][_0x2f53('0x30')]=_0x2f53('0x3e');ami['emit'](_0x2f53('0x3f'),this['channels'][_0x5e91a7['uniqueid']][_0x5e91a7[_0x2f53('0x23')]]);}}}catch(_0x12b2b8){logger[_0x2f53('0x40')](_0x2f53('0x41'),util[_0x2f53('0x2c')](_0x12b2b8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x2eb067){try{if(this[_0x2f53('0x1f')](_0x2eb067)){if(this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]]){for(var _0x499d51 in this['channels'][_0x2eb067[_0x2f53('0x22')]]){if(this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x2f53('0x2d')](_0x499d51)&&!this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x499d51][_0x2f53('0x10')]&&!this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x499d51][_0x2f53('0x13')]){this[_0x2f53('0x9')][_0x2eb067['uniqueid']][_0x499d51][_0x2f53('0x10')]=!![];this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x499d51][_0x2f53('0x3d')]=moment()[_0x2f53('0x24')](_0x2f53('0x2f'));this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x499d51][_0x2f53('0x38')]='abandoned';this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x499d51]['lastevent']=_0x2f53('0x42');ami['emit'](_0x2f53('0x43'),this[_0x2f53('0x9')][_0x2eb067[_0x2f53('0x22')]][_0x499d51]);}}}}}catch(_0x5da9af){logger[_0x2f53('0x40')]('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0x5da9af,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x95eacb){try{if(this['isNotNull'](_0x95eacb)){if(this['channels'][_0x95eacb[_0x2f53('0x22')]]){for(var _0x9ccd53 in this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]]){if(this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x2f53('0x2d')](_0x9ccd53)){if(this[_0x2f53('0x9')][_0x95eacb['uniqueid']][_0x9ccd53]['agentconnectAt']&&!this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53][_0x2f53('0x13')]){this['channels'][_0x95eacb['uniqueid']][_0x9ccd53][_0x2f53('0x13')]=!![];this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53]['agentcompleteAt']=moment()[_0x2f53('0x24')](_0x2f53('0x2f'));this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53][_0x2f53('0x30')]=_0x2f53('0x44');this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53][_0x2f53('0x45')]=_0x95eacb[_0x2f53('0x45')];this['channels'][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53]['reason']=_0x95eacb[_0x2f53('0x38')]==_0x2f53('0x46')?_0x2f53('0x47'):_0x95eacb[_0x2f53('0x38')];if(this['voiceQueues'][_0x95eacb[_0x2f53('0x25')]]&&this[_0x2f53('0xa')][_0x95eacb[_0x2f53('0x25')]][_0x2f53('0x48')]){this['channels'][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53][_0x2f53('0x49')]=!![];this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53][_0x2f53('0x4a')]=this[_0x2f53('0xa')][_0x95eacb['queue']][_0x2f53('0x4b')];}this[_0x2f53('0xb')][_0x95eacb['interface']]=_[_0x2f53('0x4c')](this['agents'][_0x95eacb[_0x2f53('0x4d')]],['queue',_0x2f53('0x4e')]);this[_0x2f53('0x1e')](util[_0x2f53('0x24')](_0x2f53('0x29'),_0x95eacb['membername']),_0x2f53('0x4f'),this[_0x2f53('0x9')][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53]);ami['emit'](_0x2f53('0x50'),this['channels'][_0x95eacb[_0x2f53('0x22')]][_0x9ccd53]);}}}}}}catch(_0x11120a){logger[_0x2f53('0x40')](_0x2f53('0x51'),util[_0x2f53('0x2c')](_0x11120a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x16')]=function(_0x190d62){try{if(this['isNotNull'](_0x190d62)){this[_0x2f53('0x52')](_0x190d62[_0x2f53('0x22')],_[_0x2f53('0x53')](_0x190d62['variable'])[0x0],_0x190d62[_0x2f53('0x54')]);if(this[_0x2f53('0x9')][_0x190d62['uniqueid']]){for(var _0x529f6f in this[_0x2f53('0x9')][_0x190d62[_0x2f53('0x22')]]){if(this['channels'][_0x190d62[_0x2f53('0x22')]]['hasOwnProperty'](_0x529f6f)){if(_['isUndefined'](this[_0x2f53('0x9')][_0x190d62[_0x2f53('0x22')]][_0x529f6f][_0x2f53('0x55')])){this[_0x2f53('0x9')][_0x190d62[_0x2f53('0x22')]][_0x529f6f]['variables']={};}this[_0x2f53('0x9')][_0x190d62['uniqueid']][_0x529f6f][_0x2f53('0x55')]=this[_0x2f53('0x55')][_0x190d62[_0x2f53('0x22')]];}}}}}catch(_0x223de7){logger[_0x2f53('0x40')]('[syncVarSet][VoiceAgentReport]',util[_0x2f53('0x2c')](_0x223de7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x52')]=function(_0x95206d,_0x50217e,_0xf843e4){var _0xc0f03=[_0x2f53('0x56'),_0x2f53('0x57'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x2f53('0x58'),_0x2f53('0x59'),_0x2f53('0x5a'),_0x2f53('0x5b'),_0x2f53('0x5c'),_0x2f53('0x5d'),_0x2f53('0x5e'),_0x2f53('0x5f'),'membercalls',_0x2f53('0x60'),_0x2f53('0x61'),'memberlastcall',_0x2f53('0x2a'),'memberpenalty',_0x2f53('0x62')];if(!_[_0x2f53('0x63')](_0x50217e)&&!_[_0x2f53('0x64')](_0xc0f03,_0x50217e)){if(_['isUndefined'](this[_0x2f53('0x55')][_0x95206d])){this[_0x2f53('0x55')][_0x95206d]={};}this['variables'][_0x95206d][_0x50217e]=_0xf843e4;}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x18')]=function(_0x355f8d){try{if(this[_0x2f53('0x1f')](_0x355f8d)){if(this[_0x2f53('0x9')][_0x355f8d[_0x2f53('0x22')]]){for(var _0x215a06 in this[_0x2f53('0x9')][_0x355f8d[_0x2f53('0x22')]]){if(this[_0x2f53('0x9')][_0x355f8d['uniqueid']]['hasOwnProperty'](_0x215a06)){if(this['channels'][_0x355f8d[_0x2f53('0x22')]][_0x215a06]['reason']==_0x2f53('0x46')&&this[_0x2f53('0x9')][_0x355f8d[_0x2f53('0x22')]][_0x215a06]['agentcomplete']){this[_0x2f53('0x9')][_0x355f8d[_0x2f53('0x22')]][_0x215a06][_0x2f53('0x65')]=moment()[_0x2f53('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x2f53('0x1e')]('custom:voiceAgentReport',_[_0x2f53('0x66')](this[_0x2f53('0x9')][_0x355f8d[_0x2f53('0x22')]]));delete this[_0x2f53('0x9')][_0x355f8d['uniqueid']];}if(this[_0x2f53('0x55')][_0x355f8d[_0x2f53('0x22')]]){delete this[_0x2f53('0x55')][_0x355f8d[_0x2f53('0x22')]];}}}catch(_0x330f1a){logger[_0x2f53('0x40')](_0x2f53('0x67'),util[_0x2f53('0x2c')](_0x330f1a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x1c')]=function(_0x1f2f9f){try{if(this[_0x2f53('0x1f')](_0x1f2f9f)){if(this['channels'][_0x1f2f9f[_0x2f53('0x68')]]){for(var _0x4f3f94 in this[_0x2f53('0x9')][_0x1f2f9f[_0x2f53('0x68')]]){if(this['channels'][_0x1f2f9f['transfereeuniqueid']][_0x2f53('0x2d')](_0x4f3f94)){if(_0x1f2f9f[_0x2f53('0x69')]===_0x4f3f94){var _0x368899=moment();this[_0x2f53('0x9')][_0x1f2f9f[_0x2f53('0x68')]][_0x4f3f94]['agentcomplete']=!![];this[_0x2f53('0x9')][_0x1f2f9f[_0x2f53('0x68')]][_0x4f3f94][_0x2f53('0x65')]=moment()[_0x2f53('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2f53('0x9')][_0x1f2f9f[_0x2f53('0x68')]][_0x4f3f94][_0x2f53('0x38')]=_0x2f53('0x46');this[_0x2f53('0x9')][_0x1f2f9f[_0x2f53('0x68')]][_0x4f3f94][_0x2f53('0x30')]=_0x2f53('0x44');this['channels'][_0x1f2f9f[_0x2f53('0x68')]][_0x4f3f94][_0x2f53('0x45')]=_0x368899[_0x2f53('0x6a')](this['channels'][_0x1f2f9f[_0x2f53('0x68')]][_0x4f3f94][_0x2f53('0x2e')],_0x2f53('0x6b'));}}}}if(this['channels'][_0x1f2f9f['secondtransfereruniqueid']]){var _0x5c15c6=this[_0x2f53('0x9')][_0x1f2f9f['secondtransfereruniqueid']];this[_0x2f53('0x9')][_0x1f2f9f[_0x2f53('0x6c')]]=this[_0x2f53('0x9')][_0x1f2f9f['transfereeuniqueid']];this[_0x2f53('0x9')][_0x1f2f9f['transfereeuniqueid']]=_0x5c15c6;}}}catch(_0x475647){logger['error']('[syncAttendedTransfer][VoiceAgentReport]',util[_0x2f53('0x2c')](_0x475647,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')]['syncBlindTransfer']=function(_0x5737b1){try{if(this[_0x2f53('0x1f')](_0x5737b1)){if(this[_0x2f53('0x9')][_0x5737b1['transfereeuniqueid']]){for(var _0x3755c7 in this[_0x2f53('0x9')][_0x5737b1[_0x2f53('0x68')]]){if(this[_0x2f53('0x9')][_0x5737b1[_0x2f53('0x68')]][_0x2f53('0x2d')](_0x3755c7)){if(_0x5737b1[_0x2f53('0x6d')]===_0x3755c7){var _0x48fd70=moment();this['channels'][_0x5737b1['transfereeuniqueid']][_0x3755c7]['agentcomplete']=!![];this[_0x2f53('0x9')][_0x5737b1[_0x2f53('0x68')]][_0x3755c7][_0x2f53('0x65')]=_0x48fd70;this[_0x2f53('0x9')][_0x5737b1['transfereeuniqueid']][_0x3755c7][_0x2f53('0x38')]=_0x2f53('0x46');this['channels'][_0x5737b1[_0x2f53('0x68')]][_0x3755c7][_0x2f53('0x30')]=_0x2f53('0x44');this[_0x2f53('0x9')][_0x5737b1['transfereeuniqueid']][_0x3755c7][_0x2f53('0x45')]=_0x48fd70[_0x2f53('0x6a')](this[_0x2f53('0x9')][_0x5737b1[_0x2f53('0x68')]][_0x3755c7][_0x2f53('0x2e')],_0x2f53('0x6b'));}}}}}}catch(_0x1e290c){logger[_0x2f53('0x40')]('[syncBlindTransfer][VoiceAgentReport]',util['inspect'](_0x1e290c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x6e')]=function(_0x3d948d){var _0x476de1='';try{if(this[_0x2f53('0x1f')](_0x3d948d)){if(_0x3d948d[_0x2f53('0x6f')]){_0x476de1=_0x3d948d['channel'][_0x2f53('0x70')](0x0,_0x3d948d['channel'][_0x2f53('0x71')]('-'));if(this[_0x2f53('0xb')][_0x476de1]){this['agents'][_0x476de1]['onhold']=!![];}}}}catch(_0x3a65d6){logger[_0x2f53('0x40')](_0x2f53('0x72'),util[_0x2f53('0x2c')](_0x3a65d6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f53('0x21')][_0x2f53('0x1b')]=function(_0x208087){var _0x44c3c2='';try{if(this[_0x2f53('0x1f')](_0x208087)){if(_0x208087['channel']){_0x44c3c2=_0x208087[_0x2f53('0x6f')]['substring'](0x0,_0x208087[_0x2f53('0x6f')][_0x2f53('0x71')]('-'));if(this[_0x2f53('0xb')][_0x44c3c2]){this['agents'][_0x44c3c2][_0x2f53('0x73')]=![];}}}}catch(_0x41f6eb){logger[_0x2f53('0x40')](_0x2f53('0x74'),util[_0x2f53('0x2c')](_0x41f6eb,{'showHidden':![],'depth':null}));}};module[_0x2f53('0x75')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 42257a8..50322b9 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 _0x567c=['ringing','ringinuse','onhold','set','queue','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','then','catch','log','isUndefined','prototype','emit','isNotNull','uniqueid','linkedid','merge','pick','keys','error','syncNewChannel','channel','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','context','from-sip','split','destconnectedlinenum','user:%s','name','user:agentconnect','accountcode','exten','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','toNumber','UserId','membername','syncMixMonitorFilename','monitor','replace','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','xmd-cdrtype','type','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','endtime','holdtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','syncHangup','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable'];(function(_0x5c94e8,_0x28bf6a){var _0x75aefe=function(_0x4d4606){while(--_0x4d4606){_0x5c94e8['push'](_0x5c94e8['shift']());}};_0x75aefe(++_0x28bf6a);}(_0x567c,0x8d));var _0xc567=function(_0x5b5cb2,_0x9fb221){_0x5b5cb2=_0x5b5cb2-0x0;var _0x3e0709=_0x567c[_0x5b5cb2];return _0x3e0709;};'use strict';var BPromise=require(_0xc567('0x0'));var _=require(_0xc567('0x1'));var moment=require(_0xc567('0x2'));var util=require(_0xc567('0x3'));var path=require(_0xc567('0x4'));var Redis=require(_0xc567('0x5'));var config=require(_0xc567('0x6'));var logger=require(_0xc567('0x7'))(_0xc567('0x8'));var ami=require(_0xc567('0x9'));var Channel=require(_0xc567('0xa'));var statusDesc=[_0xc567('0xb'),_0xc567('0xc'),_0xc567('0xd'),_0xc567('0xe'),_0xc567('0xf'),_0xc567('0x10'),_0xc567('0x11'),_0xc567('0x12'),_0xc567('0x13')];var applications=[_0xc567('0x14'),_0xc567('0x15'),'agi',_0xc567('0x16'),'playback',_0xc567('0x17')];var dispositions=[_0xc567('0x18'),_0xc567('0x19'),'FAILED',_0xc567('0x18'),'NO\x20ANSWER',_0xc567('0x18'),_0xc567('0x1a'),_0xc567('0x1b'),_0xc567('0x19'),'FAILED',_0xc567('0x19')];var actions={};config[_0xc567('0x1c')]=_[_0xc567('0x1d')](config['redis'],{'host':_0xc567('0x1e'),'port':0x18eb});var io=require(_0xc567('0x1f'))(new Redis(config[_0xc567('0x1c')]));function VoiceCallReport(_0x5ac6bc){this[_0xc567('0x20')]=_0x5ac6bc[_0xc567('0x20')];this['agents']=_0x5ac6bc[_0xc567('0x21')];ami['on'](_0xc567('0x22'),this[_0xc567('0x23')]['bind'](this));ami['on'](_0xc567('0x24'),this[_0xc567('0x23')][_0xc567('0x25')](this));ami['on'](_0xc567('0x26'),this['syncNewChannel']['bind'](this));ami['on']('newstate',this[_0xc567('0x27')]['bind'](this));ami['on'](_0xc567('0x28'),this[_0xc567('0x29')]['bind'](this));ami['on'](_0xc567('0x2a'),this['syncHangup'][_0xc567('0x25')](this));ami['on'](_0xc567('0x2b'),this[_0xc567('0x2c')]['bind'](this));ami['on'](_0xc567('0x2d'),this[_0xc567('0x2e')]['bind'](this));ami['on'](_0xc567('0x2f'),this[_0xc567('0x30')][_0xc567('0x25')](this));ami['on'](_0xc567('0x31'),this[_0xc567('0x32')][_0xc567('0x25')](this));ami['on']('musiconholdstop',this[_0xc567('0x33')][_0xc567('0x25')](this));return BPromise['resolve']()[_0xc567('0x34')](ami['actionCoreShowChannels']())[_0xc567('0x35')](function(_0x3e4af4){console[_0xc567('0x36')](_0x3e4af4);});}VoiceCallReport['prototype']['isNotNull']=function(_0x60c99c){return _0x60c99c!==null&&!_[_0xc567('0x37')](_0x60c99c);};VoiceCallReport[_0xc567('0x38')][_0xc567('0x39')]=function(_0x445f23,_0x3ef945,_0x38771e){io['to'](_0x445f23)[_0xc567('0x39')](_0x3ef945,_0x38771e);};VoiceCallReport[_0xc567('0x38')][_0xc567('0x2c')]=function(_0x94003b){try{if(this[_0xc567('0x3a')](_0x94003b)){if(_0x94003b[_0xc567('0x3b')]===_0x94003b[_0xc567('0x3c')]){if(!_[_0xc567('0x37')](this[_0xc567('0x20')][_0x94003b['uniqueid']])){_[_0xc567('0x3d')](this[_0xc567('0x20')][_0x94003b[_0xc567('0x3b')]],_[_0xc567('0x3e')](_0x94003b,_[_0xc567('0x3f')](this['channels'][_0x94003b['uniqueid']])));}}}}catch(_0x37c87d){logger[_0xc567('0x40')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x37c87d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')][_0xc567('0x41')]=function(_0x2eb8a3){try{if(this[_0xc567('0x3a')](_0x2eb8a3)){if(_0x2eb8a3[_0xc567('0x3b')]===_0x2eb8a3['linkedid']&&_0x2eb8a3[_0xc567('0x42')]!='OutgoingSpoolFailed'){if(_[_0xc567('0x37')](this['channels'][_0x2eb8a3[_0xc567('0x3b')]])){this[_0xc567('0x20')][_0x2eb8a3[_0xc567('0x3b')]]=new Channel();this[_0xc567('0x20')][_0x2eb8a3[_0xc567('0x3b')]]['starttime']=moment()[_0xc567('0x43')](_0xc567('0x44'));this['channels'][_0x2eb8a3['uniqueid']][_0xc567('0x45')]=dispositions[_['toNumber'](_0x2eb8a3[_0xc567('0x46')])];_[_0xc567('0x3d')](this[_0xc567('0x20')][_0x2eb8a3[_0xc567('0x3b')]],_['pick'](_0x2eb8a3,_[_0xc567('0x3f')](this[_0xc567('0x20')][_0x2eb8a3[_0xc567('0x3b')]])));if(_0x2eb8a3[_0xc567('0x47')]===_0xc567('0x48')){if(this[_0xc567('0x21')][_0x2eb8a3['channel'][_0xc567('0x49')]('-')[0x0]]){this[_0xc567('0x21')][_0x2eb8a3[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]][_0xc567('0x4a')]=_0x2eb8a3['exten'];this[_0xc567('0x39')](util['format'](_0xc567('0x4b'),this[_0xc567('0x21')][_0x2eb8a3[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]][_0xc567('0x4c')]),_0xc567('0x4d'),{'destaccountcode':this['agents'][_0x2eb8a3[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]][_0xc567('0x4e')],'destconnectedlinenum':_0x2eb8a3[_0xc567('0x4f')]});}}}}}}catch(_0x2126f9){logger['error'](_0xc567('0x50'),util[_0xc567('0x51')](_0x2126f9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')][_0xc567('0x23')]=function(_0x5a798b){try{if(this['isNotNull'](_0x5a798b)){if(_0x5a798b[_0xc567('0x3b')]===_0x5a798b[_0xc567('0x3c')]&&_0x5a798b[_0xc567('0x4f')]!='h'&&_0x5a798b[_0xc567('0x42')]!=_0xc567('0x52')){_0x5a798b[_0xc567('0x53')]=_0x5a798b[_0xc567('0x53')][_0xc567('0x54')]();_0x5a798b[_0xc567('0x55')]=(_0x5a798b[_0xc567('0x56')]||_0x5a798b[_0xc567('0x55')])[_0xc567('0x54')]();if(_[_0xc567('0x37')](this[_0xc567('0x20')][_0x5a798b['uniqueid']])){this[_0xc567('0x20')][_0x5a798b['uniqueid']]=new Channel();this['channels'][_0x5a798b[_0xc567('0x3b')]][_0xc567('0x57')]=_0x5a798b[_0xc567('0x58')]?moment()[_0xc567('0x59')](moment[_0xc567('0x58')](_0x5a798b[_0xc567('0x58')])[_0xc567('0x5a')](),_0xc567('0x5a'))[_0xc567('0x43')](_0xc567('0x44')):moment()[_0xc567('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc567('0x20')][_0x5a798b[_0xc567('0x3b')]][_0xc567('0x45')]=_0xc567('0x18');}_[_0xc567('0x3d')](this['channels'][_0x5a798b[_0xc567('0x3b')]],_[_0xc567('0x3e')](_0x5a798b,_[_0xc567('0x3f')](this[_0xc567('0x20')][_0x5a798b[_0xc567('0x3b')]])));if(_[_0xc567('0x5b')](applications,_0x5a798b[_0xc567('0x53')])){this[_0xc567('0x20')][_0x5a798b['uniqueid']][_0xc567('0x5c')]=_0x5a798b[_0xc567('0x53')];this[_0xc567('0x20')][_0x5a798b[_0xc567('0x3b')]][_0xc567('0x5d')]=_0x5a798b[_0xc567('0x55')];if(_0x5a798b[_0xc567('0x53')]==='set'&&_[_0xc567('0x5e')](_0x5a798b[_0xc567('0x55')],_0xc567('0x5f'))){var _0x50beef=_0x5a798b[_0xc567('0x55')][_0xc567('0x49')]('=');var _0x3d4b31=_0x50beef[0x0][_0xc567('0x60')](/cdr\((.*)\)/);if(_0x3d4b31){this[_0xc567('0x20')][_0x5a798b[_0xc567('0x3b')]][_0x3d4b31[0x1]]=_0x50beef[0x1];}}else if(_0x5a798b[_0xc567('0x53')]===_0xc567('0x15')){this[_0xc567('0x20')][_0x5a798b[_0xc567('0x3b')]][_0xc567('0x15')]=_0x5a798b['applicationdata'][_0xc567('0x49')](',')[0x0];}}}}}catch(_0x3707bf){logger[_0xc567('0x40')]('[syncNewExten][VoiceCallReport]',util[_0xc567('0x51')](_0x3707bf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')][_0xc567('0x27')]=function(_0x1fceff){try{if(this[_0xc567('0x3a')](_0x1fceff)){if(_0x1fceff[_0xc567('0x3b')]!==_0x1fceff[_0xc567('0x3c')]){if(this['channels'][_0x1fceff[_0xc567('0x3c')]]){if(_0x1fceff[_0xc567('0x46')]==='6'){if(!this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]]['answered']){var _0x4d283e=moment();this[_0xc567('0x20')][_0x1fceff['linkedid']][_0xc567('0x61')]=!![];this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x62')]=_0x4d283e[_0xc567('0x43')](_0xc567('0x44'));if(this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x57')]){this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]]['holdtime']=_0x4d283e[_0xc567('0x63')](this['channels'][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x57')],_0xc567('0x5a'));}}this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x3c')]=_0x1fceff[_0xc567('0x3b')];if(_0x1fceff[_0xc567('0x64')]!==_0xc567('0x65')){this[_0xc567('0x20')][_0x1fceff['linkedid']][_0xc567('0x66')]=_0x1fceff[_0xc567('0x64')];}this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x67')]=_0x1fceff['calleridname'];this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x68')]=_0x1fceff[_0xc567('0x42')];this[_0xc567('0x20')][_0x1fceff['linkedid']]['disposition']=dispositions[_[_0xc567('0x69')](_0x1fceff[_0xc567('0x46')])];if(this['agents'][_0x1fceff[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]]){this['channels'][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x6a')]=this['agents'][_0x1fceff['channel'][_0xc567('0x49')]('-')[0x0]]['id'];this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3c')]][_0xc567('0x6b')]=this[_0xc567('0x21')][_0x1fceff[_0xc567('0x42')]['split']('-')[0x0]][_0xc567('0x4c')];}}}}else{if(this[_0xc567('0x20')][_0x1fceff[_0xc567('0x3b')]]){if(_0x1fceff[_0xc567('0x46')]==='6'){if(this['agents'][_0x1fceff[_0xc567('0x42')]['split']('-')[0x0]]){this['channels'][_0x1fceff['uniqueid']][_0xc567('0x6a')]=this[_0xc567('0x21')][_0x1fceff[_0xc567('0x42')]['split']('-')[0x0]]['id'];this['channels'][_0x1fceff['uniqueid']]['membername']=this[_0xc567('0x21')][_0x1fceff[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]][_0xc567('0x4c')];}}}}}}catch(_0x2d0a7c){logger[_0xc567('0x40')]('[syncNewState][VoiceCallReport]',util[_0xc567('0x51')](_0x2d0a7c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')][_0xc567('0x6c')]=function(_0x5a7de4,_0x1780a0){if(this[_0xc567('0x20')][_0x5a7de4]){this[_0xc567('0x20')][_0x5a7de4][_0xc567('0x6d')]=!![];if(_['endsWith'](_0x1780a0,'.wav49')){_0x1780a0=_0x1780a0[_0xc567('0x6e')](_0xc567('0x6f'),_0xc567('0x70'));}this[_0xc567('0x20')][_0x5a7de4][_0xc567('0x71')]=_0x1780a0;var _0x489476=_[_0xc567('0x72')](this['channels'][_0x5a7de4][_0xc567('0x73')],{'filename':_0x1780a0});if(_[_0xc567('0x74')](_0x489476)){this['channels'][_0x5a7de4][_0xc567('0x73')][_0xc567('0x75')]({'filename':_0x1780a0,'createdAt':moment()[_0xc567('0x43')](_0xc567('0x44')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xc567('0x38')]['syncVarSet']=function(_0x4093ac){try{if(this[_0xc567('0x3a')](_0x4093ac)){if(this['channels'][_0x4093ac[_0xc567('0x3b')]]&&_0x4093ac[_0xc567('0x42')]!=_0xc567('0x52')){if(this[_0xc567('0x3a')](_0x4093ac[_0xc567('0x76')])){if(this['isNotNull'](_0x4093ac[_0xc567('0x76')][_0xc567('0x77')])){this['syncMixMonitorFilename'](_0x4093ac[_0xc567('0x3b')],_0x4093ac[_0xc567('0x78')]);}else if(this['isNotNull'](_0x4093ac[_0xc567('0x76')][_0xc567('0x79')])){this[_0xc567('0x20')][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x64')]=_0x4093ac[_0xc567('0x78')];}else if(this[_0xc567('0x3a')](_0x4093ac['variable'][_0xc567('0x7a')])){this['channels'][_0x4093ac[_0xc567('0x3b')]]['callerid']=_0x4093ac[_0xc567('0x78')];}else if(this[_0xc567('0x3a')](_0x4093ac[_0xc567('0x76')][_0xc567('0x7b')])){this[_0xc567('0x20')][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x7c')]=_0x4093ac[_0xc567('0x78')];}else if(this[_0xc567('0x3a')](_0x4093ac[_0xc567('0x76')]['xmd-queue'])){this[_0xc567('0x20')][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x15')]=_0x4093ac[_0xc567('0x78')][_0xc567('0x49')](',')[0x0];}else if(this[_0xc567('0x3a')](_0x4093ac['variable']['xmd-originatecalleridnum'])){this[_0xc567('0x20')][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x7d')]=_0x4093ac[_0xc567('0x78')];}else if(this[_0xc567('0x3a')](_0x4093ac[_0xc567('0x76')][_0xc567('0x7e')])){this['channels'][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x7f')]=_0x4093ac['value'];}else if(this['isNotNull'](_0x4093ac[_0xc567('0x76')][_0xc567('0x80')])){this[_0xc567('0x20')][_0x4093ac['uniqueid']]['calleridpreview']=_0x4093ac[_0xc567('0x78')];}else if(this[_0xc567('0x3a')](_0x4093ac[_0xc567('0x76')][_0xc567('0x81')])){this[_0xc567('0x20')][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x15')]=_0x4093ac[_0xc567('0x78')];}else if(this['isNotNull'](_0x4093ac['variable'][_0xc567('0x82')])){this['channels'][_0x4093ac[_0xc567('0x3b')]][_0xc567('0x83')]=_0x4093ac[_0xc567('0x78')];}}}else if(this['isNotNull'](_0x4093ac['variable'][_0xc567('0x77')])){if(_0x4093ac['value']){var _0xca644=path[_0xc567('0x84')](_0x4093ac['value'])[_0xc567('0x4c')];this['syncMixMonitorFilename'](_0xca644,_0x4093ac[_0xc567('0x78')]);}}else if(this[_0xc567('0x20')][_0x4093ac[_0xc567('0x3c')]]){if(this['isNotNull'](_0x4093ac[_0xc567('0x76')])){if(this[_0xc567('0x3a')](_0x4093ac[_0xc567('0x76')][_0xc567('0x82')])){this[_0xc567('0x20')][_0x4093ac['linkedid']]['sipcalllinkedid']=_0x4093ac[_0xc567('0x78')];}}}}}catch(_0x3c4f37){logger['error'](_0xc567('0x85'),util['inspect'](_0x3c4f37,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')]['syncHangup']=function(_0x381371){try{if(this[_0xc567('0x3a')](_0x381371)){if(this[_0xc567('0x20')][_0x381371[_0xc567('0x3b')]]){var _0x46bd8d=moment();this['channels'][_0x381371[_0xc567('0x3b')]][_0xc567('0x86')]=_0x46bd8d[_0xc567('0x43')](_0xc567('0x44'));this[_0xc567('0x20')][_0x381371[_0xc567('0x3b')]][_0xc567('0x58')]=_0x46bd8d[_0xc567('0x63')](this['channels'][_0x381371['uniqueid']]['starttime'],'seconds');if(this[_0xc567('0x20')][_0x381371[_0xc567('0x3b')]]['answered']){this[_0xc567('0x20')][_0x381371['uniqueid']]['billableseconds']=_0x46bd8d[_0xc567('0x63')](this[_0xc567('0x20')][_0x381371[_0xc567('0x3b')]][_0xc567('0x62')],'seconds');this[_0xc567('0x20')][_0x381371['uniqueid']][_0xc567('0x87')]=this[_0xc567('0x20')][_0x381371['uniqueid']][_0xc567('0x58')]-this[_0xc567('0x20')][_0x381371[_0xc567('0x3b')]][_0xc567('0x88')];}if(_0x381371[_0xc567('0x47')]===_0xc567('0x48')){if(this[_0xc567('0x21')][_0x381371[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]]){this[_0xc567('0x21')][_0x381371['channel'][_0xc567('0x49')]('-')[0x0]]=_[_0xc567('0x89')](this[_0xc567('0x21')][_0x381371[_0xc567('0x42')]['split']('-')[0x0]],[_0xc567('0x4a')]);this[_0xc567('0x39')](util['format']('user:%s',this[_0xc567('0x21')][_0x381371[_0xc567('0x42')][_0xc567('0x49')]('-')[0x0]]['name']),_0xc567('0x8a'),{'destaccountcode':this[_0xc567('0x21')][_0x381371['channel']['split']('-')[0x0]][_0xc567('0x4e')]});}}ami[_0xc567('0x39')](_0xc567('0x8b'),this[_0xc567('0x20')][_0x381371['uniqueid']]);delete this['channels'][_0x381371['uniqueid']];}}}catch(_0x2fdc2f){logger[_0xc567('0x40')](_0xc567('0x8c'),util[_0xc567('0x51')](_0x2fdc2f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')][_0xc567('0x2e')]=function(_0x4a9ff9){try{if(this['isNotNull'](_0x4a9ff9)){if(this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x8d')]]){this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x8d')]][_0xc567('0x8e')]=_0x4a9ff9[_0xc567('0x8f')];this[_0xc567('0x20')][_0x4a9ff9['transfereeuniqueid']][_0xc567('0x90')]=_0x4a9ff9[_0xc567('0x91')];if(this[_0xc567('0x20')][_0x4a9ff9['secondtransfereruniqueid']]){var _0x392689=this[_0xc567('0x20')][_0x4a9ff9['secondtransfereruniqueid']];this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x92')]]=this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x8d')]];this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x8d')]]=_0x392689;}}else if(this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x93')]]){this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x93')]][_0xc567('0x8e')]=_0x4a9ff9['origtransferercalleridnum'];this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x93')]][_0xc567('0x90')]=_0x4a9ff9[_0xc567('0x91')];if(this['channels'][_0x4a9ff9[_0xc567('0x94')]]){var _0x392689=this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x94')]];this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x94')]]=this['channels'][_0x4a9ff9[_0xc567('0x93')]];this[_0xc567('0x20')][_0x4a9ff9[_0xc567('0x93')]]=_0x392689;}}}}catch(_0x561ce9){logger[_0xc567('0x40')](_0xc567('0x95'),util[_0xc567('0x51')](_0x561ce9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')]['syncBlindTransfer']=function(_0x1d6452){try{if(this[_0xc567('0x3a')](_0x1d6452)){if(this[_0xc567('0x20')][_0x1d6452['transfereeuniqueid']]){this['channels'][_0x1d6452['transfereeuniqueid']][_0xc567('0x8e')]=_0x1d6452['transfereecalleridnum'];this[_0xc567('0x20')][_0x1d6452[_0xc567('0x8d')]][_0xc567('0x90')]=_0x1d6452[_0xc567('0x96')];this[_0xc567('0x97')]({'event':'BlindTransfer','uniqueid':_0x1d6452[_0xc567('0x8d')],'context':_0x1d6452[_0xc567('0x47')],'channel':_0x1d6452[_0xc567('0x98')]});}}}catch(_0x5c7984){logger['error'](_0xc567('0x99'),util['inspect'](_0x5c7984,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc567('0x38')][_0xc567('0x32')]=function(_0x1e7ba5){try{if(this[_0xc567('0x3a')](_0x1e7ba5)){if(this['channels'][_0x1e7ba5['uniqueid']]){if(!_[_0xc567('0x74')](this['channels'][_0x1e7ba5['uniqueid']][_0xc567('0x62')])){this[_0xc567('0x20')][_0x1e7ba5[_0xc567('0x3b')]][_0xc567('0x9a')]=moment()[_0xc567('0x43')](_0xc567('0x44'));}}}}catch(_0x1957a9){logger[_0xc567('0x40')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0xc567('0x51')](_0x1957a9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc567('0x33')]=function(_0x564a3e){try{if(this[_0xc567('0x3a')](_0x564a3e)){if(this[_0xc567('0x20')][_0x564a3e[_0xc567('0x3b')]]){if(!_['isNil'](this[_0xc567('0x20')][_0x564a3e[_0xc567('0x3b')]][_0xc567('0x9a')])){this[_0xc567('0x20')][_0x564a3e['uniqueid']][_0xc567('0x9b')]+=moment()[_0xc567('0x9c')](0x0)['diff'](this['channels'][_0x564a3e[_0xc567('0x3b')]]['mohstarttime'],_0xc567('0x5a'));delete this[_0xc567('0x20')][_0x564a3e[_0xc567('0x3b')]][_0xc567('0x9a')];}}}}catch(_0x53b458){logger[_0xc567('0x40')](_0xc567('0x9d'),util[_0xc567('0x51')](_0x53b458,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xd164=['milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','localhost','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','catch','log','prototype','isNotNull','emit','linkedid','uniqueid','merge','pick','keys','error','channel','OutgoingSpoolFailed','starttime','format','disposition','toNumber','channelstate','from-sip','split','exten','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','appdata','isUndefined','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastdata','set','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','.WAV','monitorFilename','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','answertime','omit','destconnectedlinenum','user:%s','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','transfereecalleridnum','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime'];(function(_0x241961,_0x38e568){var _0x14e6f9=function(_0x45abb6){while(--_0x45abb6){_0x241961['push'](_0x241961['shift']());}};_0x14e6f9(++_0x38e568);}(_0xd164,0x9e));var _0x4d16=function(_0x506188,_0x2565db){_0x506188=_0x506188-0x0;var _0x2f6628=_0xd164[_0x506188];return _0x2f6628;};'use strict';var BPromise=require('bluebird');var _=require(_0x4d16('0x0'));var moment=require(_0x4d16('0x1'));var util=require(_0x4d16('0x2'));var path=require('path');var Redis=require('ioredis');var config=require(_0x4d16('0x3'));var logger=require(_0x4d16('0x4'))('ami');var ami=require(_0x4d16('0x5'));var Channel=require('../model/channel');var statusDesc=[_0x4d16('0x6'),_0x4d16('0x7'),'inuse','busy',_0x4d16('0x8'),_0x4d16('0x9'),_0x4d16('0xa'),_0x4d16('0xb'),_0x4d16('0xc')];var applications=['set',_0x4d16('0xd'),_0x4d16('0xe'),'dial',_0x4d16('0xf'),_0x4d16('0x10')];var dispositions=[_0x4d16('0x11'),_0x4d16('0x12'),_0x4d16('0x12'),_0x4d16('0x11'),'NO\x20ANSWER',_0x4d16('0x11'),_0x4d16('0x13'),_0x4d16('0x14'),_0x4d16('0x12'),_0x4d16('0x12'),_0x4d16('0x12')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':_0x4d16('0x15'),'port':0x18eb});var io=require(_0x4d16('0x16'))(new Redis(config['redis']));function VoiceCallReport(_0x2fcbce){this[_0x4d16('0x17')]=_0x2fcbce[_0x4d16('0x17')];this[_0x4d16('0x18')]=_0x2fcbce[_0x4d16('0x18')];ami['on']('coreshowchannel',this[_0x4d16('0x19')][_0x4d16('0x1a')](this));ami['on'](_0x4d16('0x1b'),this[_0x4d16('0x19')]['bind'](this));ami['on'](_0x4d16('0x1c'),this[_0x4d16('0x1d')]['bind'](this));ami['on'](_0x4d16('0x1e'),this[_0x4d16('0x1f')][_0x4d16('0x1a')](this));ami['on'](_0x4d16('0x20'),this[_0x4d16('0x21')][_0x4d16('0x1a')](this));ami['on'](_0x4d16('0x22'),this[_0x4d16('0x23')][_0x4d16('0x1a')](this));ami['on'](_0x4d16('0x24'),this[_0x4d16('0x25')]['bind'](this));ami['on']('attendedtransfer',this[_0x4d16('0x26')][_0x4d16('0x1a')](this));ami['on'](_0x4d16('0x27'),this[_0x4d16('0x28')][_0x4d16('0x1a')](this));ami['on']('musiconholdstart',this[_0x4d16('0x29')]['bind'](this));ami['on']('musiconholdstop',this[_0x4d16('0x2a')]['bind'](this));return BPromise[_0x4d16('0x2b')]()['then'](ami['actionCoreShowChannels']())[_0x4d16('0x2c')](function(_0x2b58a5){console[_0x4d16('0x2d')](_0x2b58a5);});}VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x2f')]=function(_0x2e6b57){return _0x2e6b57!==null&&!_['isUndefined'](_0x2e6b57);};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x30')]=function(_0x32c71f,_0x512b53,_0x4a2764){io['to'](_0x32c71f)[_0x4d16('0x30')](_0x512b53,_0x4a2764);};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x25')]=function(_0x3c45f4){try{if(this['isNotNull'](_0x3c45f4)){if(_0x3c45f4['uniqueid']===_0x3c45f4[_0x4d16('0x31')]){if(!_['isUndefined'](this[_0x4d16('0x17')][_0x3c45f4[_0x4d16('0x32')]])){_[_0x4d16('0x33')](this['channels'][_0x3c45f4[_0x4d16('0x32')]],_[_0x4d16('0x34')](_0x3c45f4,_[_0x4d16('0x35')](this[_0x4d16('0x17')][_0x3c45f4['uniqueid']])));}}}}catch(_0xedf753){logger[_0x4d16('0x36')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0xedf753,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x1d')]=function(_0xf396a9){try{if(this['isNotNull'](_0xf396a9)){if(_0xf396a9[_0x4d16('0x32')]===_0xf396a9[_0x4d16('0x31')]&&_0xf396a9[_0x4d16('0x37')]!=_0x4d16('0x38')){if(_['isUndefined'](this[_0x4d16('0x17')][_0xf396a9[_0x4d16('0x32')]])){this[_0x4d16('0x17')][_0xf396a9['uniqueid']]=new Channel();this[_0x4d16('0x17')][_0xf396a9['uniqueid']][_0x4d16('0x39')]=moment()[_0x4d16('0x3a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4d16('0x17')][_0xf396a9[_0x4d16('0x32')]][_0x4d16('0x3b')]=dispositions[_[_0x4d16('0x3c')](_0xf396a9[_0x4d16('0x3d')])];_[_0x4d16('0x33')](this[_0x4d16('0x17')][_0xf396a9[_0x4d16('0x32')]],_[_0x4d16('0x34')](_0xf396a9,_[_0x4d16('0x35')](this['channels'][_0xf396a9['uniqueid']])));if(_0xf396a9['context']===_0x4d16('0x3e')){if(this[_0x4d16('0x18')][_0xf396a9[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]]){this[_0x4d16('0x18')][_0xf396a9[_0x4d16('0x37')]['split']('-')[0x0]]['destconnectedlinenum']=_0xf396a9[_0x4d16('0x40')];this[_0x4d16('0x30')](util['format']('user:%s',this[_0x4d16('0x18')][_0xf396a9[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]][_0x4d16('0x41')]),_0x4d16('0x42'),{'destaccountcode':this['agents'][_0xf396a9[_0x4d16('0x37')]['split']('-')[0x0]][_0x4d16('0x43')],'destconnectedlinenum':_0xf396a9[_0x4d16('0x40')]});}}}}}}catch(_0x1965da){logger['error'](_0x4d16('0x44'),util[_0x4d16('0x45')](_0x1965da,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x19')]=function(_0x129242){try{if(this[_0x4d16('0x2f')](_0x129242)){if(_0x129242[_0x4d16('0x32')]===_0x129242['linkedid']&&_0x129242[_0x4d16('0x40')]!='h'&&_0x129242[_0x4d16('0x37')]!=_0x4d16('0x38')){_0x129242[_0x4d16('0x46')]=_0x129242['application'][_0x4d16('0x47')]();_0x129242[_0x4d16('0x48')]=(_0x129242[_0x4d16('0x49')]||_0x129242['applicationdata'])[_0x4d16('0x47')]();if(_[_0x4d16('0x4a')](this['channels'][_0x129242[_0x4d16('0x32')]])){this[_0x4d16('0x17')][_0x129242[_0x4d16('0x32')]]=new Channel();this[_0x4d16('0x17')][_0x129242[_0x4d16('0x32')]][_0x4d16('0x39')]=_0x129242[_0x4d16('0x4b')]?moment()[_0x4d16('0x4c')](moment[_0x4d16('0x4b')](_0x129242['duration'])['seconds'](),_0x4d16('0x4d'))['format'](_0x4d16('0x4e')):moment()['format'](_0x4d16('0x4e'));this[_0x4d16('0x17')][_0x129242[_0x4d16('0x32')]]['disposition']=_0x4d16('0x11');}_[_0x4d16('0x33')](this[_0x4d16('0x17')][_0x129242['uniqueid']],_[_0x4d16('0x34')](_0x129242,_[_0x4d16('0x35')](this[_0x4d16('0x17')][_0x129242[_0x4d16('0x32')]])));if(_[_0x4d16('0x4f')](applications,_0x129242[_0x4d16('0x46')])){this['channels'][_0x129242['uniqueid']]['lastapplication']=_0x129242[_0x4d16('0x46')];this['channels'][_0x129242['uniqueid']][_0x4d16('0x50')]=_0x129242[_0x4d16('0x48')];if(_0x129242[_0x4d16('0x46')]===_0x4d16('0x51')&&_[_0x4d16('0x52')](_0x129242[_0x4d16('0x48')],_0x4d16('0x53'))){var _0x2b8133=_0x129242[_0x4d16('0x48')]['split']('=');var _0x55d2ed=_0x2b8133[0x0][_0x4d16('0x54')](/cdr\((.*)\)/);if(_0x55d2ed){this[_0x4d16('0x17')][_0x129242[_0x4d16('0x32')]][_0x55d2ed[0x1]]=_0x2b8133[0x1];}}else if(_0x129242[_0x4d16('0x46')]===_0x4d16('0xd')){this[_0x4d16('0x17')][_0x129242[_0x4d16('0x32')]][_0x4d16('0xd')]=_0x129242[_0x4d16('0x48')]['split'](',')[0x0];}}}}}catch(_0x1881e8){logger['error'](_0x4d16('0x55'),util['inspect'](_0x1881e8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x1f')]=function(_0x889c98){try{if(this[_0x4d16('0x2f')](_0x889c98)){if(_0x889c98[_0x4d16('0x32')]!==_0x889c98[_0x4d16('0x31')]){if(this['channels'][_0x889c98['linkedid']]){if(_0x889c98[_0x4d16('0x3d')]==='6'){if(!this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x56')]){var _0x54a636=moment();this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]]['answered']=!![];this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]]['answertime']=_0x54a636[_0x4d16('0x3a')](_0x4d16('0x4e'));if(this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]]['starttime']){this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x57')]=_0x54a636[_0x4d16('0x58')](this[_0x4d16('0x17')][_0x889c98['linkedid']][_0x4d16('0x39')],'seconds');}}this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x31')]=_0x889c98[_0x4d16('0x32')];if(_0x889c98[_0x4d16('0x59')]!==_0x4d16('0x5a')){this[_0x4d16('0x17')][_0x889c98['linkedid']][_0x4d16('0x5b')]=_0x889c98[_0x4d16('0x59')];}this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x5c')]=_0x889c98[_0x4d16('0x5d')];this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x5e')]=_0x889c98[_0x4d16('0x37')];this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x3b')]=dispositions[_['toNumber'](_0x889c98[_0x4d16('0x3d')])];if(this[_0x4d16('0x18')][_0x889c98['channel'][_0x4d16('0x3f')]('-')[0x0]]){this['channels'][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x5f')]=this['agents'][_0x889c98['channel'][_0x4d16('0x3f')]('-')[0x0]]['id'];this['channels'][_0x889c98[_0x4d16('0x31')]][_0x4d16('0x60')]=this['agents'][_0x889c98[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]][_0x4d16('0x41')];}}}}else{if(this['channels'][_0x889c98[_0x4d16('0x32')]]){if(_0x889c98['channelstate']==='6'){if(this[_0x4d16('0x18')][_0x889c98[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]]){this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x32')]][_0x4d16('0x5f')]=this['agents'][_0x889c98[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]]['id'];this[_0x4d16('0x17')][_0x889c98[_0x4d16('0x32')]][_0x4d16('0x60')]=this[_0x4d16('0x18')][_0x889c98['channel'][_0x4d16('0x3f')]('-')[0x0]][_0x4d16('0x41')];}}}}}}catch(_0xd14b53){logger[_0x4d16('0x36')](_0x4d16('0x61'),util[_0x4d16('0x45')](_0xd14b53,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x62')]=function(_0x2b8131,_0x4bd53e){if(this[_0x4d16('0x17')][_0x2b8131]){this[_0x4d16('0x17')][_0x2b8131][_0x4d16('0x63')]=!![];if(_['endsWith'](_0x4bd53e,'.wav49')){_0x4bd53e=_0x4bd53e[_0x4d16('0x64')]('.wav49',_0x4d16('0x65'));}this['channels'][_0x2b8131][_0x4d16('0x66')]=_0x4bd53e;var _0xdc78bf=_['find'](this['channels'][_0x2b8131][_0x4d16('0x67')],{'filename':_0x4bd53e});if(_[_0x4d16('0x68')](_0xdc78bf)){this[_0x4d16('0x17')][_0x2b8131]['monitors'][_0x4d16('0x69')]({'filename':_0x4bd53e,'createdAt':moment()[_0x4d16('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x4d16('0x6a')});}}};VoiceCallReport['prototype'][_0x4d16('0x21')]=function(_0x59dbd1){try{if(this[_0x4d16('0x2f')](_0x59dbd1)){if(this['channels'][_0x59dbd1['uniqueid']]&&_0x59dbd1[_0x4d16('0x37')]!=_0x4d16('0x38')){if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')])){if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x6c')])){this[_0x4d16('0x62')](_0x59dbd1['uniqueid'],_0x59dbd1[_0x4d16('0x6d')]);}else if(this['isNotNull'](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x6e')])){this[_0x4d16('0x17')][_0x59dbd1[_0x4d16('0x32')]][_0x4d16('0x59')]=_0x59dbd1[_0x4d16('0x6d')];}else if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x6f')])){this['channels'][_0x59dbd1[_0x4d16('0x32')]][_0x4d16('0x70')]=_0x59dbd1[_0x4d16('0x6d')];}else if(this[_0x4d16('0x2f')](_0x59dbd1['variable'][_0x4d16('0x71')])){this['channels'][_0x59dbd1['uniqueid']]['type']=_0x59dbd1[_0x4d16('0x6d')];}else if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x72')])){this['channels'][_0x59dbd1['uniqueid']][_0x4d16('0xd')]=_0x59dbd1['value'][_0x4d16('0x3f')](',')[0x0];}else if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x73')])){this[_0x4d16('0x17')][_0x59dbd1[_0x4d16('0x32')]][_0x4d16('0x74')]=_0x59dbd1['value'];}else if(this[_0x4d16('0x2f')](_0x59dbd1['variable'][_0x4d16('0x75')])){this[_0x4d16('0x17')][_0x59dbd1[_0x4d16('0x32')]][_0x4d16('0x76')]=_0x59dbd1['value'];}else if(this['isNotNull'](_0x59dbd1['variable'][_0x4d16('0x77')])){this[_0x4d16('0x17')][_0x59dbd1[_0x4d16('0x32')]][_0x4d16('0x78')]=_0x59dbd1['value'];}else if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x79')])){this[_0x4d16('0x17')][_0x59dbd1['uniqueid']][_0x4d16('0xd')]=_0x59dbd1['value'];}else if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x7a')])){this[_0x4d16('0x17')][_0x59dbd1['uniqueid']][_0x4d16('0x7b')]=_0x59dbd1[_0x4d16('0x6d')];}}}else if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x6c')])){if(_0x59dbd1[_0x4d16('0x6d')]){var _0x481f6a=path[_0x4d16('0x7c')](_0x59dbd1['value'])['name'];this[_0x4d16('0x62')](_0x481f6a,_0x59dbd1[_0x4d16('0x6d')]);}}else if(this[_0x4d16('0x17')][_0x59dbd1['linkedid']]){if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')])){if(this[_0x4d16('0x2f')](_0x59dbd1[_0x4d16('0x6b')][_0x4d16('0x7a')])){this[_0x4d16('0x17')][_0x59dbd1[_0x4d16('0x31')]][_0x4d16('0x7d')]=_0x59dbd1['value'];}}}}}catch(_0x71289f){logger['error'](_0x4d16('0x7e'),util['inspect'](_0x71289f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x23')]=function(_0x3f813b){try{if(this[_0x4d16('0x2f')](_0x3f813b)){if(this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]]){var _0x237ec1=moment();this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]][_0x4d16('0x7f')]=_0x237ec1[_0x4d16('0x3a')](_0x4d16('0x4e'));this[_0x4d16('0x17')][_0x3f813b['uniqueid']][_0x4d16('0x4b')]=_0x237ec1[_0x4d16('0x58')](this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]][_0x4d16('0x39')],_0x4d16('0x4d'));if(this['channels'][_0x3f813b[_0x4d16('0x32')]][_0x4d16('0x56')]){this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]][_0x4d16('0x80')]=_0x237ec1[_0x4d16('0x58')](this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]][_0x4d16('0x81')],_0x4d16('0x4d'));this[_0x4d16('0x17')][_0x3f813b['uniqueid']][_0x4d16('0x57')]=this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]]['duration']-this[_0x4d16('0x17')][_0x3f813b['uniqueid']][_0x4d16('0x80')];}if(_0x3f813b['context']===_0x4d16('0x3e')){if(this['agents'][_0x3f813b[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]]){this[_0x4d16('0x18')][_0x3f813b[_0x4d16('0x37')]['split']('-')[0x0]]=_[_0x4d16('0x82')](this[_0x4d16('0x18')][_0x3f813b[_0x4d16('0x37')][_0x4d16('0x3f')]('-')[0x0]],[_0x4d16('0x83')]);this[_0x4d16('0x30')](util[_0x4d16('0x3a')](_0x4d16('0x84'),this[_0x4d16('0x18')][_0x3f813b[_0x4d16('0x37')]['split']('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0x4d16('0x18')][_0x3f813b[_0x4d16('0x37')]['split']('-')[0x0]][_0x4d16('0x43')]});}}ami[_0x4d16('0x30')](_0x4d16('0x85'),this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]]);delete this[_0x4d16('0x17')][_0x3f813b[_0x4d16('0x32')]];}}}catch(_0x4e90c6){logger[_0x4d16('0x36')](_0x4d16('0x86'),util[_0x4d16('0x45')](_0x4e90c6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x26')]=function(_0x4432ad){try{if(this[_0x4d16('0x2f')](_0x4432ad)){if(this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x87')]]){this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x87')]][_0x4d16('0x88')]=_0x4432ad[_0x4d16('0x89')];this['channels'][_0x4432ad[_0x4d16('0x87')]][_0x4d16('0x8a')]=_0x4432ad['transfertargetcalleridnum'];if(this[_0x4d16('0x17')][_0x4432ad['secondtransfereruniqueid']]){var _0x5570cf=this['channels'][_0x4432ad[_0x4d16('0x8b')]];this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x8b')]]=this['channels'][_0x4432ad[_0x4d16('0x87')]];this[_0x4d16('0x17')][_0x4432ad['transfereeuniqueid']]=_0x5570cf;}}else if(this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x8c')]]){this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x8c')]]['transfercalleridnum']=_0x4432ad['origtransferercalleridnum'];this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x8c')]][_0x4d16('0x8a')]=_0x4432ad[_0x4d16('0x8d')];if(this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x8e')]]){var _0x5570cf=this['channels'][_0x4432ad[_0x4d16('0x8e')]];this[_0x4d16('0x17')][_0x4432ad[_0x4d16('0x8e')]]=this[_0x4d16('0x17')][_0x4432ad['transfertargetuniqueid']];this[_0x4d16('0x17')][_0x4432ad['transfertargetuniqueid']]=_0x5570cf;}}}}catch(_0x123b58){logger[_0x4d16('0x36')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x4d16('0x45')](_0x123b58,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x28')]=function(_0x57000a){try{if(this[_0x4d16('0x2f')](_0x57000a)){if(this[_0x4d16('0x17')][_0x57000a[_0x4d16('0x87')]]){this['channels'][_0x57000a[_0x4d16('0x87')]][_0x4d16('0x88')]=_0x57000a[_0x4d16('0x8f')];this['channels'][_0x57000a[_0x4d16('0x87')]]['transferconnectedlinenum']=_0x57000a[_0x4d16('0x90')];this['syncHangup']({'event':_0x4d16('0x91'),'uniqueid':_0x57000a[_0x4d16('0x87')],'context':_0x57000a[_0x4d16('0x92')],'channel':_0x57000a[_0x4d16('0x93')]});}}}catch(_0x574202){logger['error'](_0x4d16('0x94'),util[_0x4d16('0x45')](_0x574202,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4d16('0x2e')][_0x4d16('0x29')]=function(_0x122672){try{if(this[_0x4d16('0x2f')](_0x122672)){if(this[_0x4d16('0x17')][_0x122672[_0x4d16('0x32')]]){if(!_['isNil'](this[_0x4d16('0x17')][_0x122672[_0x4d16('0x32')]]['answertime'])){this[_0x4d16('0x17')][_0x122672[_0x4d16('0x32')]]['mohstarttime']=moment()['format'](_0x4d16('0x4e'));}}}}catch(_0x16ab0e){logger[_0x4d16('0x36')](_0x4d16('0x95'),util[_0x4d16('0x45')](_0x16ab0e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x5f4ef4){try{if(this[_0x4d16('0x2f')](_0x5f4ef4)){if(this['channels'][_0x5f4ef4[_0x4d16('0x32')]]){if(!_[_0x4d16('0x68')](this['channels'][_0x5f4ef4[_0x4d16('0x32')]][_0x4d16('0x96')])){this['channels'][_0x5f4ef4['uniqueid']][_0x4d16('0x97')]+=moment()[_0x4d16('0x98')](0x0)[_0x4d16('0x58')](this[_0x4d16('0x17')][_0x5f4ef4['uniqueid']][_0x4d16('0x96')],_0x4d16('0x4d'));delete this[_0x4d16('0x17')][_0x5f4ef4[_0x4d16('0x32')]]['mohstarttime'];}}}}catch(_0x515700){logger['error'](_0x4d16('0x99'),util[_0x4d16('0x45')](_0x515700,{'showHidden':![],'depth':null}));}};module[_0x4d16('0x9a')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 36923d7..1023fab 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 _0xd87e=['syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','prototype','isUndefined','emit','isNotNull','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','voice:outbound','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','keys','variable','value','outboundrouteid','variables','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','membername','memberrealtime','isNil','includes','syncHangup','diff','starttime','seconds','complete','total','answered','holdtime','endtime','sumHoldTime','sumBillable','billableseconds','sumDuration','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','defaults','redis','socket.io-emitter','channels','outboundChannels','outbound','dialbegin'];(function(_0x4d77d0,_0x2f91a0){var _0x2f4699=function(_0x4dcc6c){while(--_0x4dcc6c){_0x4d77d0['push'](_0x4d77d0['shift']());}};_0x2f4699(++_0x2f91a0);}(_0xd87e,0x1bf));var _0xed87=function(_0x4b9fd4,_0x3a679e){_0x4b9fd4=_0x4b9fd4-0x0;var _0x112c49=_0xd87e[_0x4b9fd4];return _0x112c49;};'use strict';var _=require(_0xed87('0x0'));var moment=require(_0xed87('0x1'));var util=require('util');var Redis=require(_0xed87('0x2'));var config=require(_0xed87('0x3'));var logger=require(_0xed87('0x4'))('ami');var ami=require(_0xed87('0x5'));config['redis']=_[_0xed87('0x6')](config[_0xed87('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xed87('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x5da793){this[_0xed87('0x9')]=_0x5da793[_0xed87('0xa')];this[_0xed87('0xb')]=_0x5da793[_0xed87('0xb')];this['variables']={};ami['on'](_0xed87('0xc'),this[_0xed87('0xd')][_0xed87('0xe')](this));ami['on'](_0xed87('0xf'),this[_0xed87('0x10')][_0xed87('0xe')](this));ami['on'](_0xed87('0x11'),this['syncVarSet'][_0xed87('0xe')](this));ami['on'](_0xed87('0x12'),this['syncHangup'][_0xed87('0xe')](this));}VoiceDialReport[_0xed87('0x13')]['isNotNull']=function(_0x4ffc2d){return _0x4ffc2d!==null&&!_[_0xed87('0x14')](_0x4ffc2d);};VoiceDialReport[_0xed87('0x13')][_0xed87('0x15')]=function(_0x24fc2a,_0x16bfd6,_0x3865c5){io['to'](_0x24fc2a)['emit'](_0x16bfd6,_0x3865c5);};VoiceDialReport[_0xed87('0x13')][_0xed87('0xd')]=function(_0x1722a6){try{if(this[_0xed87('0x16')](_0x1722a6)){if(this[_0xed87('0x9')][_0x1722a6[_0xed87('0x17')]]){_[_0xed87('0x18')](this[_0xed87('0x9')][_0x1722a6[_0xed87('0x17')]],{'starttime':moment()['format'](_0xed87('0x19')),'lastevent':_0xed87('0x1a'),'interface':_0x1722a6[_0xed87('0x1b')][_0xed87('0x1c')](0x0,_0x1722a6['channel'][_0xed87('0x1d')]('-')),'membername':_0x1722a6[_0xed87('0x1b')][_0xed87('0x1c')](_0x1722a6[_0xed87('0x1b')][_0xed87('0x1d')]('/')+0x1,_0x1722a6[_0xed87('0x1b')][_0xed87('0x1d')]('-'))},_[_0xed87('0x1e')](_0x1722a6,[_0xed87('0x1f'),'privilege']));this['emit']('voice:outbound','voice_outbound_channel:save',this[_0xed87('0x9')][_0x1722a6['uniqueid']]);ami[_0xed87('0x15')](_0xed87('0x20'),this['channels'][_0x1722a6[_0xed87('0x17')]]);}}}catch(_0x505733){logger[_0xed87('0x21')](_0xed87('0x22'),util[_0xed87('0x23')](_0x505733,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xed87('0x13')][_0xed87('0x10')]=function(_0x5d15b3){try{if(this[_0xed87('0x16')](_0x5d15b3)){if(this[_0xed87('0x9')][_0x5d15b3[_0xed87('0x17')]]){this[_0xed87('0x9')][_0x5d15b3[_0xed87('0x17')]][_0xed87('0x24')]=_0x5d15b3[_0xed87('0x24')];if(_0x5d15b3[_0xed87('0x24')]===_0xed87('0x25')){this[_0xed87('0x9')][_0x5d15b3[_0xed87('0x17')]][_0xed87('0x26')]=_0x5d15b3[_0xed87('0x26')];this[_0xed87('0x9')][_0x5d15b3['uniqueid']][_0xed87('0x27')]=_0x5d15b3[_0xed87('0x27')];this['channels'][_0x5d15b3[_0xed87('0x17')]][_0xed87('0x28')]=moment()[_0xed87('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5d15b3[_0xed87('0x17')]][_0xed87('0x2a')]=_0xed87('0x2b');ami['emit'](_0xed87('0x2c'),this[_0xed87('0x9')][_0x5d15b3[_0xed87('0x17')]]);}this[_0xed87('0x15')](_0xed87('0x2d'),_0xed87('0x2e'),this[_0xed87('0x9')][_0x5d15b3[_0xed87('0x17')]]);}}}catch(_0xfdcba4){logger['error'](_0xed87('0x2f'),util[_0xed87('0x23')](_0xfdcba4,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xed87('0x30')]=function(_0x59d84b){try{if(this[_0xed87('0x16')](_0x59d84b)){this[_0xed87('0x31')](_0x59d84b[_0xed87('0x17')],_[_0xed87('0x32')](_0x59d84b[_0xed87('0x33')])[0x0],_0x59d84b[_0xed87('0x34')]);if(this[_0xed87('0x16')](_0x59d84b[_0xed87('0x33')])&&this[_0xed87('0x16')](_0x59d84b[_0xed87('0x33')][_0xed87('0x35')])){if(_['isUndefined'](this[_0xed87('0x9')][_0x59d84b[_0xed87('0x17')]])){this['channels'][_0x59d84b[_0xed87('0x17')]]={'routeId':_0x59d84b['value'],'variables':this[_0xed87('0x36')][_0x59d84b[_0xed87('0x17')]]};this['emit'](_0xed87('0x2d'),_0xed87('0x2e'),this[_0xed87('0x9')][_0x59d84b[_0xed87('0x17')]]);}}}}catch(_0x1384e4){logger['error'](_0xed87('0x37'),util['inspect'](_0x1384e4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xed87('0x13')]['addVariable']=function(_0x32d9a8,_0xb6fe59,_0x2ab170){var _0x217435=[_0xed87('0x38'),_0xed87('0x39'),_0xed87('0x3a'),_0xed87('0x3b'),_0xed87('0x3c'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xed87('0x3d'),_0xed87('0x3e'),_0xed87('0x3f'),_0xed87('0x40'),_0xed87('0x41'),_0xed87('0x42'),'memberdynamic',_0xed87('0x43'),_0xed87('0x44'),_0xed87('0x45'),'memberpenalty',_0xed87('0x46')];if(!_[_0xed87('0x47')](_0xb6fe59)&&!_[_0xed87('0x48')](_0x217435,_0xb6fe59)){if(_[_0xed87('0x14')](this[_0xed87('0x36')][_0x32d9a8])){this[_0xed87('0x36')][_0x32d9a8]={};}this[_0xed87('0x36')][_0x32d9a8][_0xb6fe59]=_0x2ab170;}};VoiceDialReport[_0xed87('0x13')][_0xed87('0x49')]=function(_0x406b73){try{if(this['isNotNull'](_0x406b73)){if(this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]]){this[_0xed87('0x9')][_0x406b73['uniqueid']]['endtime']=moment()[_0xed87('0x29')](_0xed87('0x19'));this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]]['duration']=moment(this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]]['endtime'])[_0xed87('0x4a')](this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x4b')],_0xed87('0x4c'));this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x2a')]=_0xed87('0x4d');this[_0xed87('0xb')][_0xed87('0x4e')]+=0x1;if(this['channels'][_0x406b73[_0xed87('0x17')]][_0xed87('0x28')]){this[_0xed87('0xb')][_0xed87('0x4f')]+=0x1;this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x50')]=moment(this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x28')])[_0xed87('0x4a')](this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x4b')],_0xed87('0x4c'));this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]]['billableseconds']=moment(this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x51')])['diff'](this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]]['answertime'],_0xed87('0x4c'));this[_0xed87('0xb')][_0xed87('0x52')]+=this[_0xed87('0x9')][_0x406b73['uniqueid']][_0xed87('0x50')]||0x0;this[_0xed87('0xb')][_0xed87('0x53')]+=this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x54')];}this[_0xed87('0xb')][_0xed87('0x55')]+=this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]][_0xed87('0x56')];ami[_0xed87('0x15')](_0xed87('0x57'),this['channels'][_0x406b73[_0xed87('0x17')]]);ami['emit'](_0xed87('0x58'),this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]]);this[_0xed87('0x15')](_0xed87('0x2d'),_0xed87('0x59'),this[_0xed87('0xb')]);this[_0xed87('0x15')](_0xed87('0x2d'),_0xed87('0x5a'),this['channels'][_0x406b73[_0xed87('0x17')]]);delete this[_0xed87('0x9')][_0x406b73[_0xed87('0x17')]];}if(this[_0xed87('0x36')][_0x406b73[_0xed87('0x17')]]){delete this[_0xed87('0x36')][_0x406b73[_0xed87('0x17')]];}}}catch(_0x7045d7){logger[_0xed87('0x21')](_0xed87('0x5b'),util[_0xed87('0x23')](_0x7045d7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x153f=['moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','hangup','prototype','isNotNull','isUndefined','emit','channels','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','addVariable','keys','variable','value','outboundrouteid','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','syncHangup','endtime','seconds','complete','total','starttime','billableseconds','diff','sumBillable','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','exports','lodash'];(function(_0x5194bf,_0x31eaf5){var _0x4379a9=function(_0x2b9164){while(--_0x2b9164){_0x5194bf['push'](_0x5194bf['shift']());}};_0x4379a9(++_0x31eaf5);}(_0x153f,0x15b));var _0xf153=function(_0x3e4bb2,_0x1e4004){_0x3e4bb2=_0x3e4bb2-0x0;var _0x465456=_0x153f[_0x3e4bb2];return _0x465456;};'use strict';var _=require(_0xf153('0x0'));var moment=require(_0xf153('0x1'));var util=require(_0xf153('0x2'));var Redis=require(_0xf153('0x3'));var config=require(_0xf153('0x4'));var logger=require(_0xf153('0x5'))(_0xf153('0x6'));var ami=require('../ami');config[_0xf153('0x7')]=_['defaults'](config[_0xf153('0x7')],{'host':_0xf153('0x8'),'port':0x18eb});var io=require(_0xf153('0x9'))(new Redis(config[_0xf153('0x7')]));function VoiceDialReport(_0x21f432){this['channels']=_0x21f432[_0xf153('0xa')];this[_0xf153('0xb')]=_0x21f432[_0xf153('0xb')];this[_0xf153('0xc')]={};ami['on'](_0xf153('0xd'),this[_0xf153('0xe')][_0xf153('0xf')](this));ami['on'](_0xf153('0x10'),this[_0xf153('0x11')][_0xf153('0xf')](this));ami['on']('varset',this[_0xf153('0x12')][_0xf153('0xf')](this));ami['on'](_0xf153('0x13'),this['syncHangup'][_0xf153('0xf')](this));}VoiceDialReport[_0xf153('0x14')][_0xf153('0x15')]=function(_0x1cc666){return _0x1cc666!==null&&!_[_0xf153('0x16')](_0x1cc666);};VoiceDialReport[_0xf153('0x14')][_0xf153('0x17')]=function(_0x1d54c4,_0x3e34fb,_0x4c5283){io['to'](_0x1d54c4)[_0xf153('0x17')](_0x3e34fb,_0x4c5283);};VoiceDialReport[_0xf153('0x14')][_0xf153('0xe')]=function(_0x406e6f){try{if(this[_0xf153('0x15')](_0x406e6f)){if(this[_0xf153('0x18')][_0x406e6f[_0xf153('0x19')]]){_[_0xf153('0x1a')](this['channels'][_0x406e6f[_0xf153('0x19')]],{'starttime':moment()['format'](_0xf153('0x1b')),'lastevent':_0xf153('0x1c'),'interface':_0x406e6f[_0xf153('0x1d')][_0xf153('0x1e')](0x0,_0x406e6f['channel'][_0xf153('0x1f')]('-')),'membername':_0x406e6f[_0xf153('0x1d')][_0xf153('0x1e')](_0x406e6f[_0xf153('0x1d')][_0xf153('0x1f')]('/')+0x1,_0x406e6f[_0xf153('0x1d')][_0xf153('0x1f')]('-'))},_[_0xf153('0x20')](_0x406e6f,[_0xf153('0x21'),_0xf153('0x22')]));this[_0xf153('0x17')](_0xf153('0x23'),'voice_outbound_channel:save',this[_0xf153('0x18')][_0x406e6f[_0xf153('0x19')]]);ami[_0xf153('0x17')](_0xf153('0x24'),this[_0xf153('0x18')][_0x406e6f[_0xf153('0x19')]]);}}}catch(_0x465d88){logger[_0xf153('0x25')](_0xf153('0x26'),util[_0xf153('0x27')](_0x465d88,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf153('0x14')][_0xf153('0x11')]=function(_0x35cfe3){try{if(this[_0xf153('0x15')](_0x35cfe3)){if(this[_0xf153('0x18')][_0x35cfe3[_0xf153('0x19')]]){this[_0xf153('0x18')][_0x35cfe3[_0xf153('0x19')]][_0xf153('0x28')]=_0x35cfe3[_0xf153('0x28')];if(_0x35cfe3['dialstatus']===_0xf153('0x29')){this[_0xf153('0x18')][_0x35cfe3['uniqueid']][_0xf153('0x2a')]=_0x35cfe3[_0xf153('0x2a')];this['channels'][_0x35cfe3[_0xf153('0x19')]][_0xf153('0x2b')]=_0x35cfe3[_0xf153('0x2b')];this[_0xf153('0x18')][_0x35cfe3[_0xf153('0x19')]][_0xf153('0x2c')]=moment()[_0xf153('0x2d')](_0xf153('0x1b'));this[_0xf153('0x18')][_0x35cfe3[_0xf153('0x19')]][_0xf153('0x2e')]=_0xf153('0x2f');ami['emit'](_0xf153('0x30'),this[_0xf153('0x18')][_0x35cfe3[_0xf153('0x19')]]);}this[_0xf153('0x17')]('voice:outbound','voice_outbound_channel:save',this[_0xf153('0x18')][_0x35cfe3['uniqueid']]);}}}catch(_0x4bdd44){logger[_0xf153('0x25')]('[syncDialEnd][VoiceDialReport]',util[_0xf153('0x27')](_0x4bdd44,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf153('0x12')]=function(_0x10f461){try{if(this['isNotNull'](_0x10f461)){this[_0xf153('0x31')](_0x10f461[_0xf153('0x19')],_[_0xf153('0x32')](_0x10f461[_0xf153('0x33')])[0x0],_0x10f461[_0xf153('0x34')]);if(this[_0xf153('0x15')](_0x10f461['variable'])&&this[_0xf153('0x15')](_0x10f461['variable'][_0xf153('0x35')])){if(_[_0xf153('0x16')](this[_0xf153('0x18')][_0x10f461[_0xf153('0x19')]])){this[_0xf153('0x18')][_0x10f461[_0xf153('0x19')]]={'routeId':_0x10f461['value'],'variables':this[_0xf153('0xc')][_0x10f461[_0xf153('0x19')]]};this[_0xf153('0x17')]('voice:outbound',_0xf153('0x36'),this[_0xf153('0x18')][_0x10f461[_0xf153('0x19')]]);}}}}catch(_0x254692){logger[_0xf153('0x25')](_0xf153('0x37'),util['inspect'](_0x254692,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf153('0x14')][_0xf153('0x31')]=function(_0x48b53e,_0x14b2e3,_0x161997){var _0x357666=[_0xf153('0x38'),_0xf153('0x39'),_0xf153('0x3a'),_0xf153('0x3b'),'rtpaudioqosloss',_0xf153('0x3c'),_0xf153('0x3d'),_0xf153('0x3e'),_0xf153('0x3f'),_0xf153('0x40'),_0xf153('0x41'),'bridgepvtcallid','membercalls',_0xf153('0x42'),'memberinterface',_0xf153('0x43'),_0xf153('0x44'),_0xf153('0x45'),_0xf153('0x46')];if(!_[_0xf153('0x47')](_0x14b2e3)&&!_[_0xf153('0x48')](_0x357666,_0x14b2e3)){if(_['isUndefined'](this['variables'][_0x48b53e])){this[_0xf153('0xc')][_0x48b53e]={};}this[_0xf153('0xc')][_0x48b53e][_0x14b2e3]=_0x161997;}};VoiceDialReport['prototype'][_0xf153('0x49')]=function(_0x1c77a6){try{if(this[_0xf153('0x15')](_0x1c77a6)){if(this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]){this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x4a')]=moment()[_0xf153('0x2d')](_0xf153('0x1b'));this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]['duration']=moment(this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x4a')])['diff'](this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]['starttime'],_0xf153('0x4b'));this['channels'][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x2e')]=_0xf153('0x4c');this['outbound'][_0xf153('0x4d')]+=0x1;if(this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x2c')]){this[_0xf153('0xb')]['answered']+=0x1;this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]['holdtime']=moment(this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x2c')])['diff'](this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x4e')],_0xf153('0x4b'));this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x4f')]=moment(this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]['endtime'])[_0xf153('0x50')](this['channels'][_0x1c77a6['uniqueid']]['answertime'],_0xf153('0x4b'));this[_0xf153('0xb')]['sumHoldTime']+=this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]['holdtime']||0x0;this[_0xf153('0xb')][_0xf153('0x51')]+=this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]][_0xf153('0x4f')];}this[_0xf153('0xb')]['sumDuration']+=this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]['duration'];ami['emit'](_0xf153('0x52'),this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]);ami[_0xf153('0x17')](_0xf153('0x53'),this[_0xf153('0x18')][_0x1c77a6['uniqueid']]);this[_0xf153('0x17')]('voice:outbound',_0xf153('0x54'),this[_0xf153('0xb')]);this[_0xf153('0x17')]('voice:outbound',_0xf153('0x55'),this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]]);delete this[_0xf153('0x18')][_0x1c77a6[_0xf153('0x19')]];}if(this[_0xf153('0xc')][_0x1c77a6[_0xf153('0x19')]]){delete this['variables'][_0x1c77a6[_0xf153('0x19')]];}}}catch(_0x150892){logger[_0xf153('0x25')]('[syncHangup][VoiceDialReport]',util[_0xf153('0x27')](_0x150892,{'showHidden':![],'depth':null}));}};module[_0xf153('0x56')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index fe16d26..fc96af8 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 _0x10e8=['bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','length','diff','sumDuration','milliseconds','sumBillable','custom:queuecallerunmanaged','lastevent','[syncHangup][VoiceQueueReport]','transfereeuniqueid','transferexten','secondtransfererexten','ATTENDEDTRANSFER','transfertype','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','extension','context','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','lodash','moment','util','ioredis','../../../config/logger','../ami','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','voiceQueues','flagQueueSummary','campaigns','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','syncAgentComplete','syncAgentConnect','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','loopQueueSummary','loopQueueShow','isUndefined','hasOwnProperty','isEmpty','talking','pTalking','queueStatusComplete','clearZombieChannels','switch','Action','status','channel','catch','message','No\x20such\x20channel','[voiceQueueReport][checkChannel]','queueReports','variables','error','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','emitVoiceQueueSummary','type','inbound','strategy','loggedIn','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','callerid','Interval','stringify','md5','voice_queue:save','isNotNull','queues','[queues]','queuesummary','then','[queuesummary]','queue','countBy','callers','toNumber','loggedin','available','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallerexitreason','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','FORWARD','transferuniqueid','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','CONTINUE','queueposition','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer'];(function(_0x1eac4e,_0x478eb4){var _0x21ece4=function(_0x20203e){while(--_0x20203e){_0x1eac4e['push'](_0x1eac4e['shift']());}};_0x21ece4(++_0x478eb4);}(_0x10e8,0xd8));var _0x810e=function(_0x8e4e07,_0x51c198){_0x8e4e07=_0x8e4e07-0x0;var _0x34d001=_0x10e8[_0x8e4e07];return _0x34d001;};'use strict';var _=require(_0x810e('0x0'));var moment=require(_0x810e('0x1'));var BPromise=require('bluebird');var util=require(_0x810e('0x2'));var md5=require('md5');var Redis=require(_0x810e('0x3'));var config=require('../../../config/environment');var logger=require(_0x810e('0x4'))('ami');var ami=require(_0x810e('0x5'));var QueueReport=require('../model/queueReport');config[_0x810e('0x6')]=_['defaults'](config[_0x810e('0x6')],{'host':_0x810e('0x7'),'port':0x18eb});var io=require(_0x810e('0x8'))(new Redis(config[_0x810e('0x6')]));var Sequence=function(){};Sequence[_0x810e('0x9')][_0x810e('0xa')]=function(_0xfdb5db){this[_0x810e('0xb')]=this['tail']?this['tail'][_0x810e('0xc')](_0xfdb5db):_0xfdb5db();};function VoiceQueueReport(_0x402947){this[_0x810e('0xd')]=new Sequence();this['queueReports']={};this[_0x810e('0xe')]=_0x402947[_0x810e('0xe')];this[_0x810e('0xf')]=_0x402947['queueChannels'];this[_0x810e('0x10')]=_0x402947['voiceQueues'];this[_0x810e('0x11')]=!![];this[_0x810e('0x12')]=_0x402947[_0x810e('0x12')];this['variables']={};ami['on']('queuesummary',this[_0x810e('0x13')]['bind'](this));ami['on'](_0x810e('0x14'),this[_0x810e('0x15')][_0x810e('0x16')](this));ami['on'](_0x810e('0x17'),this[_0x810e('0x18')][_0x810e('0x16')](this));ami['on'](_0x810e('0x19'),this[_0x810e('0x1a')][_0x810e('0x16')](this));ami['on']('queuecallerleave',this[_0x810e('0x1b')][_0x810e('0x16')](this));ami['on']('agentcomplete',this[_0x810e('0x1c')][_0x810e('0x16')](this));ami['on']('agentconnect',this[_0x810e('0x1d')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x810e('0x16')](this));ami['on']('hangup',this[_0x810e('0x1e')][_0x810e('0x16')](this));ami['on'](_0x810e('0x1f'),this[_0x810e('0x20')][_0x810e('0x16')](this));ami['on'](_0x810e('0x21'),this[_0x810e('0x22')]['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x810e('0x16')](this));ami['on'](_0x810e('0x23'),this[_0x810e('0x24')][_0x810e('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x810e('0x16')](this));this[_0x810e('0x25')]();this[_0x810e('0x26')]();}function isNotNull(_0x39f708){return _0x39f708!==null&&!_[_0x810e('0x27')](_0x39f708);}function clearChannels(_0x19cba0){if(!_['isEmpty'](_0x19cba0)){for(var _0x4c84ca in _0x19cba0){if(_0x19cba0[_0x810e('0x28')](_0x4c84ca)){delete _0x19cba0[_0x4c84ca];}}}}function clearCampaigns(_0x1c89c3){if(!_[_0x810e('0x29')](_0x1c89c3)){for(var _0x19f012 in _0x1c89c3){if(_0x1c89c3[_0x810e('0x28')](_0x19f012)){_0x1c89c3[_0x19f012]['originated']=0x0;}}}}function clearVoiceQueues(_0x790094){if(!_[_0x810e('0x29')](_0x790094)){for(var _0x2f0000 in _0x790094){if(_0x790094[_0x810e('0x28')](_0x2f0000)){_0x790094[_0x2f0000]['originated']=0x0;_0x790094[_0x2f0000][_0x810e('0x2a')]=0x0;_0x790094[_0x2f0000][_0x810e('0x2b')]=0x0;_0x790094[_0x2f0000]['waiting']=0x0;_0x790094[_0x2f0000][_0x810e('0x2c')]=!![];}}}}function clearAgentBooked(_0x23af5e){if(!_['isEmpty'](_0x23af5e)){for(var _0xcf1980 in _0x23af5e){if(_0x23af5e['hasOwnProperty'](_0xcf1980)){_0x23af5e[_0xcf1980]['unlockRR']=!![];}}}}VoiceQueueReport[_0x810e('0x9')][_0x810e('0x2d')]=function(){var _0x182f2a=this;for(var _0x5e1ed2 in this[_0x810e('0xf')]){if(this[_0x810e('0xf')][_0x810e('0x28')](_0x5e1ed2)&&!this[_0x810e('0xf')][_0x5e1ed2][_0x810e('0x2e')]){this[_0x810e('0xd')][_0x810e('0xa')](function(){if(!_['isNil'](_0x182f2a[_0x810e('0xf')][_0x5e1ed2])){return ami[_0x810e('0x2f')]({'action':_0x810e('0x30'),'channel':_0x182f2a['channels'][_0x5e1ed2][_0x810e('0x31')]})[_0x810e('0x32')](function(_0x168732){if(_0x168732[_0x810e('0x33')]===_0x810e('0x34')){setTimeout(function(){if(_0x182f2a['channels'][_0x5e1ed2]){delete _0x182f2a['channels'][_0x5e1ed2];logger['error'](_0x810e('0x35'),_0x5e1ed2);}if(_0x182f2a[_0x810e('0x36')][_0x5e1ed2]){delete _0x182f2a[_0x810e('0x36')][_0x5e1ed2];logger['error']('[voiceQueueReport][checkQueueReport]',_0x5e1ed2);}if(_0x182f2a['variables'][_0x5e1ed2]){delete _0x182f2a[_0x810e('0x37')][_0x5e1ed2];logger[_0x810e('0x38')]('[voiceQueueReport][checkVariables]',_0x5e1ed2);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x810e('0x20')]=function(){logger[_0x810e('0x38')](_0x810e('0x39'));clearChannels(this[_0x810e('0xf')]);this[_0x810e('0x3a')](this[_0x810e('0x36')]);clearAgentBooked(this[_0x810e('0xe')]);clearVoiceQueues(this[_0x810e('0x10')]);clearCampaigns(this[_0x810e('0x12')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0x3c6f0b){var _0x33b9c5=this;if(!_[_0x810e('0x29')](_0x3c6f0b)){for(var _0x12366a in _0x3c6f0b){if(_0x3c6f0b[_0x810e('0x28')](_0x12366a)){_0x33b9c5[_0x810e('0x3b')](_0x3c6f0b[_0x12366a]);delete _0x3c6f0b[_0x12366a];}}}};function loggerCatch(_0x1142dc){return function(_0x5e8efb){logger[_0x810e('0x38')](_0x1142dc,util[_0x810e('0x3c')](_0x5e8efb,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0x810e('0x3d')]=function(_0x4b2534,_0x318235,_0x483380){io['to'](_0x4b2534)[_0x810e('0x3d')](_0x318235,_0x483380);};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x3e')]=function(_0x1bf89c){this['emit'](util[_0x810e('0x3f')](_0x810e('0x40'),_0x1bf89c[_0x810e('0x41')]),_0x810e('0x42'),_0x1bf89c);};VoiceQueueReport['prototype'][_0x810e('0x3b')]=function(_0x2d9718){this[_0x810e('0x3d')](util['format'](_0x810e('0x40'),_0x2d9718[_0x810e('0x41')]),'voice_queue_channel:remove',_0x2d9718);};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x43')]=function(_0x55c51b){if(_0x55c51b[_0x810e('0x44')]===_0x810e('0x45')){var _0x4ccb05={'id':_0x55c51b['id'],'name':_0x55c51b['name'],'strategy':_0x55c51b[_0x810e('0x46')],'answered':_0x55c51b['answered'],'available':_0x55c51b['available'],'loggedIn':_0x55c51b[_0x810e('0x47')],'pTalking':_0x55c51b[_0x810e('0x2b')],'sumBillable':_0x55c51b['sumBillable'],'sumDuration':_0x55c51b['sumDuration'],'sumHoldTime':_0x55c51b[_0x810e('0x48')]||0x0,'talking':_0x55c51b[_0x810e('0x2a')],'total':_0x55c51b[_0x810e('0x49')],'type':_0x55c51b[_0x810e('0x44')],'unmanaged':_0x55c51b[_0x810e('0x4a')],'abandoned':_0x55c51b[_0x810e('0x4b')],'waiting':_0x55c51b[_0x810e('0x4c')]};if(_0x55c51b['Trunk']){_0x4ccb05[_0x810e('0x4d')]={'id':_0x55c51b['Trunk']['id'],'name':_0x55c51b['Trunk'][_0x810e('0x41')],'active':_0x55c51b[_0x810e('0x4d')]['active'],'callerid':_0x55c51b[_0x810e('0x4d')][_0x810e('0x4e')]};}if(_0x55c51b[_0x810e('0x4f')]){_0x4ccb05[_0x810e('0x4f')]={'id':_0x55c51b['Interval']['id'],'name':_0x55c51b[_0x810e('0x4f')][_0x810e('0x41')]};}var _0x2a210c=md5(JSON[_0x810e('0x50')](_0x4ccb05));if(_0x55c51b[_0x810e('0x51')]!==_0x2a210c){_0x55c51b[_0x810e('0x51')]=_0x2a210c;this[_0x810e('0x3d')](util[_0x810e('0x3f')](_0x810e('0x40'),_0x4ccb05[_0x810e('0x41')]),_0x810e('0x52'),_0x4ccb05);}}};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x53')]=function(_0x1abaae){return _0x1abaae!==null&&!_[_0x810e('0x27')](_0x1abaae);};VoiceQueueReport[_0x810e('0x9')]['loopQueueShow']=function(){var _0x236316=this;setInterval(function(){_0x236316[_0x810e('0x2d')]();ami[_0x810e('0x2f')]({'action':_0x810e('0x54')})[_0x810e('0x32')](loggerCatch(_0x810e('0x55')));},0x2710);};VoiceQueueReport[_0x810e('0x9')]['loopQueueSummary']=function(){var _0x201102=this;setInterval(function(){if(_0x201102[_0x810e('0x11')]){return ami[_0x810e('0x2f')]({'action':_0x810e('0x56')})[_0x810e('0x57')](function(_0x44478c){_0x201102[_0x810e('0x11')]=![];})[_0x810e('0x32')](loggerCatch(_0x810e('0x58')));}},0x3e8);};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x13')]=function(_0x3ac1f1){try{if(this['isNotNull'](_0x3ac1f1)&&this[_0x810e('0x53')](_0x3ac1f1[_0x810e('0x59')])){if(this['voiceQueues'][_0x3ac1f1[_0x810e('0x59')]]){var _0x416f7b=_[_0x810e('0x5a')](this[_0x810e('0xf')],'queue')[_0x3ac1f1[_0x810e('0x59')]]||0x0;var _0x5173ab=_0x416f7b-_0x3ac1f1[_0x810e('0x5b')];if(this['voiceQueues'][_0x3ac1f1[_0x810e('0x59')]][_0x810e('0x4c')]!==_[_0x810e('0x5c')](_0x3ac1f1[_0x810e('0x5b')])||this['voiceQueues'][_0x3ac1f1[_0x810e('0x59')]][_0x810e('0x47')]!==_[_0x810e('0x5c')](_0x3ac1f1[_0x810e('0x5d')])||this['voiceQueues'][_0x3ac1f1[_0x810e('0x59')]][_0x810e('0x5e')]!==_['toNumber'](_0x3ac1f1[_0x810e('0x5e')])||this[_0x810e('0x10')][_0x3ac1f1[_0x810e('0x59')]]['talking']!==_0x5173ab){this[_0x810e('0x10')][_0x3ac1f1['queue']][_0x810e('0x4c')]=_['toNumber'](_0x3ac1f1[_0x810e('0x5b')]);this[_0x810e('0x10')][_0x3ac1f1['queue']][_0x810e('0x47')]=_[_0x810e('0x5c')](_0x3ac1f1[_0x810e('0x5d')]);this[_0x810e('0x10')][_0x3ac1f1[_0x810e('0x59')]][_0x810e('0x5e')]=_['toNumber'](_0x3ac1f1[_0x810e('0x5e')]);this[_0x810e('0x10')][_0x3ac1f1[_0x810e('0x59')]][_0x810e('0x2a')]=_0x5173ab>0x0?_0x5173ab:0x0;this[_0x810e('0x10')][_0x3ac1f1['queue']]['talking']=this[_0x810e('0x10')][_0x3ac1f1[_0x810e('0x59')]][_0x810e('0x2a')]>_[_0x810e('0x5c')](_0x3ac1f1[_0x810e('0x5d')])?_[_0x810e('0x5c')](_0x3ac1f1[_0x810e('0x5d')]):this['voiceQueues'][_0x3ac1f1[_0x810e('0x59')]]['talking'];this[_0x810e('0x43')](this['voiceQueues'][_0x3ac1f1['queue']]);}ami[_0x810e('0x3d')](_0x810e('0x5f'),this['voiceQueues'][_0x3ac1f1[_0x810e('0x59')]]);}}}catch(_0x4dda48){logger[_0x810e('0x38')](_0x810e('0x60'),util[_0x810e('0x3c')](_0x4dda48,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x810e('0x15')]=function(_0x3ae887){this[_0x810e('0x11')]=!![];};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x61')]=function(_0x266a74){};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x18')]=function(_0x532966){try{if(this['isNotNull'](_0x532966)){if(_['isUndefined'](this[_0x810e('0x36')][_0x532966[_0x810e('0x62')]])){this[_0x810e('0x36')][_0x532966[_0x810e('0x62')]]=[];this[_0x810e('0xf')][_0x532966['uniqueid']]={};}var _0x1804fc=new QueueReport();_0x1804fc[_0x810e('0x41')]=_0x532966[_0x810e('0x59')];_0x1804fc[_0x810e('0x44')]=this[_0x810e('0x10')][_0x1804fc['name']]&&this[_0x810e('0x10')][_0x1804fc[_0x810e('0x41')]]['type']?this[_0x810e('0x10')][_0x1804fc['name']]['type']||_0x810e('0x45'):'inbound';_0x1804fc[_0x810e('0x59')]=_0x532966['queue'];_0x1804fc[_0x810e('0x63')]=moment()['format'](_0x810e('0x64'));_0x1804fc[_0x810e('0x65')]=_0x532966[_0x810e('0x65')];_0x1804fc[_0x810e('0x66')]=_0x532966[_0x810e('0x66')];_['merge'](_0x1804fc,_[_0x810e('0x67')](_0x532966,_[_0x810e('0x68')](_0x1804fc)));this[_0x810e('0x36')][_0x532966['uniqueid']][_0x810e('0x69')](_0x1804fc);this[_0x810e('0xf')][_0x532966['uniqueid']]=_0x1804fc;this[_0x810e('0x3e')](_0x1804fc);}}catch(_0x7810d1){logger['error'](_0x810e('0x6a'),util[_0x810e('0x3c')](_0x7810d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x810e('0x1a')]=function(_0x53bf95){try{if(this[_0x810e('0x53')](_0x53bf95)){if(this[_0x810e('0x36')][_0x53bf95['uniqueid']]){var _0x5e2d12=_[_0x810e('0x6b')](this['queueReports'][_0x53bf95[_0x810e('0x62')]]);_0x5e2d12[_0x810e('0x6c')]=![];_0x5e2d12[_0x810e('0x6d')]=null;_0x5e2d12[_0x810e('0x6e')]=_0x53bf95['holdtime'];_0x5e2d12[_0x810e('0x6f')]=_0x53bf95[_0x810e('0x6f')];_0x5e2d12[_0x810e('0x19')]=!![];_0x5e2d12[_0x810e('0x70')]=moment()[_0x810e('0x3f')](_0x810e('0x64'));_0x5e2d12['queuecallerexitreason']=_0x810e('0x71');_0x5e2d12[_0x810e('0x72')]=null;this['channels'][_0x53bf95[_0x810e('0x62')]]=_0x5e2d12;this[_0x810e('0x3b')](_0x5e2d12);}}}catch(_0x154434){logger[_0x810e('0x38')](_0x810e('0x73'),util['inspect'](_0x154434,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x1b')]=function(_0x394582){try{if(this[_0x810e('0x53')](_0x394582)){if(this[_0x810e('0x36')][_0x394582[_0x810e('0x62')]]){var _0x15ed87=_[_0x810e('0x6b')](this[_0x810e('0x36')][_0x394582[_0x810e('0x62')]]);_0x15ed87[_0x810e('0x74')]=moment()[_0x810e('0x3f')](_0x810e('0x64'));_0x15ed87[_0x810e('0x75')]=_0x394582['connectedlinenum'];_0x15ed87[_0x810e('0x76')]=_0x394582[_0x810e('0x76')];this[_0x810e('0xf')][_0x394582[_0x810e('0x62')]]=_0x15ed87;this[_0x810e('0x3e')](_0x15ed87);}}}catch(_0x7a0ac2){logger[_0x810e('0x38')](_0x810e('0x77'),util[_0x810e('0x3c')](_0x7a0ac2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x1d')]=function(_0x17164c){try{if(this[_0x810e('0x53')](_0x17164c)){if(this[_0x810e('0x36')][_0x17164c[_0x810e('0x62')]]){var _0x4bcb51=_[_0x810e('0x6b')](this[_0x810e('0x36')][_0x17164c['uniqueid']]);_0x4bcb51[_0x810e('0x6c')]=!![];_0x4bcb51[_0x810e('0x78')]='COMPLETEDBYAGENT';}}}catch(_0x40da44){logger['error'](_0x810e('0x79'),util[_0x810e('0x3c')](_0x40da44,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x810e('0x9')][_0x810e('0x1c')]=function(_0x45de10){try{if(this[_0x810e('0x53')](_0x45de10)){if(this[_0x810e('0x36')][_0x45de10[_0x810e('0x62')]]){var _0xfde2f8=_['last'](this[_0x810e('0x36')][_0x45de10[_0x810e('0x62')]]);_0xfde2f8[_0x810e('0x19')]=![];_0xfde2f8[_0x810e('0x70')]=null;_0xfde2f8[_0x810e('0x7a')]=!![];_0xfde2f8[_0x810e('0x72')]=_0x45de10[_0x810e('0x7b')];_0xfde2f8[_0x810e('0x6e')]=_0x45de10[_0x810e('0x6e')];_0xfde2f8[_0x810e('0x6c')]=!![];_0xfde2f8[_0x810e('0x7c')]=![];_0xfde2f8[_0x810e('0x7d')]=null;if(!_0xfde2f8[_0x810e('0x7e')]){if(_0x45de10[_0x810e('0x7f')]==_0x810e('0x7e')){_0xfde2f8[_0x810e('0x78')]=_0x810e('0x80');}else{if(_[_0x810e('0x81')](_0x45de10[_0x810e('0x31')][_0x810e('0x82')](),_0x810e('0x83'))){if(this['queueReports'][_0x45de10[_0x810e('0x84')]]){var _0x5aebe0=_['last'](this[_0x810e('0x36')][_0x45de10[_0x810e('0x84')]]);_0x5aebe0[_0x810e('0x6c')]=![];_0x5aebe0[_0x810e('0x7c')]=!![];_0x5aebe0[_0x810e('0x7d')]=moment(_0xfde2f8[_0x810e('0x63')])[_0x810e('0x85')](_0x45de10[_0x810e('0x6e')],_0x810e('0x86'))[_0x810e('0x3f')](_0x810e('0x64'));_0x5aebe0[_0x810e('0x78')]=_0x810e('0x87');_0x5aebe0[_0x810e('0x7e')]=!![];_0x5aebe0['transfertype']=_0x810e('0x88');_0x5aebe0['transferexten']=_0x45de10['destexten'];_0x5aebe0[_0x810e('0x89')]=_0x45de10[_0x810e('0x62')];var _0x2fe005=this[_0x810e('0x36')][_0x45de10[_0x810e('0x84')]];this[_0x810e('0x36')][_0x45de10[_0x810e('0x84')]]=this['queueReports'][_0x45de10['uniqueid']];this[_0x810e('0x36')][_0x45de10[_0x810e('0x62')]]=_0x2fe005;}}else{_0xfde2f8['queuecallerexitreason']='COMPLETEDBY'+_0x45de10[_0x810e('0x7f')][_0x810e('0x8a')]();}}}this[_0x810e('0xf')][_0x45de10['uniqueid']]=_0xfde2f8;this[_0x810e('0x3b')](_0xfde2f8);}}}catch(_0x42ad66){logger['error'](_0x810e('0x8b'),util[_0x810e('0x3c')](_0x42ad66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x810e('0x9')]['syncVarSet']=function(_0x406388){try{if(this[_0x810e('0x53')](_0x406388)){this[_0x810e('0x8c')](_0x406388[_0x810e('0x62')],_['keys'](_0x406388[_0x810e('0x8d')])[0x0],_0x406388[_0x810e('0x8e')]);if(this['queueReports'][_0x406388[_0x810e('0x62')]]){var _0x2e4aa6=_[_0x810e('0x6b')](this[_0x810e('0x36')][_0x406388[_0x810e('0x62')]]);if(_0x2e4aa6){if(this[_0x810e('0x53')](_0x406388[_0x810e('0x8d')])&&this[_0x810e('0x53')](_0x406388['variable']['queuestatus'])){switch(_0x406388['value']){case _0x810e('0x8f'):_0x2e4aa6['queuecallerexit']=![];_0x2e4aa6['queuecallerexitAt']=null;break;default:_0x2e4aa6[_0x810e('0x7c')]=!![];_0x2e4aa6[_0x810e('0x7d')]=moment()[_0x810e('0x3f')](_0x810e('0x64'));_0x2e4aa6[_0x810e('0x74')]=moment()[_0x810e('0x3f')](_0x810e('0x64'));}_0x2e4aa6[_0x810e('0x19')]=![];_0x2e4aa6[_0x810e('0x70')]=null;_0x2e4aa6[_0x810e('0x78')]=_0x406388[_0x810e('0x8e')];this[_0x810e('0xf')][_0x406388[_0x810e('0x62')]]=_0x2e4aa6;this[_0x810e('0x3b')](_0x2e4aa6);}else if(this[_0x810e('0x53')](_0x406388[_0x810e('0x8d')])&&this[_0x810e('0x53')](_0x406388[_0x810e('0x8d')][_0x810e('0x90')])){if(!_0x2e4aa6[_0x810e('0x19')]){_0x2e4aa6['queuecallerexit']=!![];_0x2e4aa6['queuecallerexitAt']=moment()[_0x810e('0x3f')](_0x810e('0x64'));_0x2e4aa6[_0x810e('0x78')]='EXITWITHKEY';_0x2e4aa6['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x810e('0xf')][_0x406388[_0x810e('0x62')]]=_0x2e4aa6;}}_0x2e4aa6['variables']=this[_0x810e('0x37')][_0x406388['uniqueid']];}}}}catch(_0x11af78){logger[_0x810e('0x38')](_0x810e('0x91'),util[_0x810e('0x3c')](_0x11af78,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x810e('0x8c')]=function(_0x3c0543,_0x30f221,_0x4b1af8){var _0x1fecc5=[_0x810e('0x92'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x810e('0x93'),'rtpaudioqoslossbridged',_0x810e('0x94'),'rtpaudioqosrttbridged',_0x810e('0x95'),_0x810e('0x96'),_0x810e('0x97'),_0x810e('0x98'),_0x810e('0x99'),_0x810e('0x9a'),'memberinterface',_0x810e('0x9b'),_0x810e('0x7b'),_0x810e('0x9c'),_0x810e('0x9d')];if(!_[_0x810e('0x9e')](_0x30f221)&&!_[_0x810e('0x9f')](_0x1fecc5,_0x30f221)){if(_[_0x810e('0x27')](this[_0x810e('0x37')][_0x3c0543])){this[_0x810e('0x37')][_0x3c0543]={};}this[_0x810e('0x37')][_0x3c0543][_0x30f221]=_0x4b1af8;}};VoiceQueueReport[_0x810e('0x9')]['syncHangup']=function(_0xaf01c){try{if(this[_0x810e('0x53')](_0xaf01c)){if(this[_0x810e('0x36')][_0xaf01c[_0x810e('0x62')]]){for(var _0x3dc3b2=0x0,_0x17cace={};_0x3dc3b20x0?_0x124589:0x0;this[_0x610f('0x10')][_0x45b91b[_0x610f('0x5d')]][_0x610f('0x64')]=this[_0x610f('0x10')][_0x45b91b[_0x610f('0x5d')]]['talking']>_[_0x610f('0x61')](_0x45b91b['loggedin'])?_[_0x610f('0x61')](_0x45b91b['loggedin']):this[_0x610f('0x10')][_0x45b91b[_0x610f('0x5d')]][_0x610f('0x64')];this[_0x610f('0x47')](this[_0x610f('0x10')][_0x45b91b['queue']]);}ami[_0x610f('0x41')](_0x610f('0x65'),this['voiceQueues'][_0x45b91b['queue']]);}}}catch(_0x3d0a1f){logger[_0x610f('0x3a')](_0x610f('0x66'),util['inspect'](_0x3d0a1f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x610f('0x7')][_0x610f('0x18')]=function(_0x42c80f){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x610f('0x7')][_0x610f('0x67')]=function(_0x55ce7d){};VoiceQueueReport[_0x610f('0x7')][_0x610f('0x68')]=function(_0x36d64e){try{if(this[_0x610f('0x56')](_0x36d64e)){if(_[_0x610f('0x2d')](this[_0x610f('0xc')][_0x36d64e[_0x610f('0x69')]])){this['queueReports'][_0x36d64e[_0x610f('0x69')]]=[];this[_0x610f('0xe')][_0x36d64e['uniqueid']]={};}var _0x17f327=new QueueReport();_0x17f327[_0x610f('0x45')]=_0x36d64e[_0x610f('0x5d')];_0x17f327[_0x610f('0x4f')]=this[_0x610f('0x10')][_0x17f327[_0x610f('0x45')]]&&this[_0x610f('0x10')][_0x17f327[_0x610f('0x45')]][_0x610f('0x4f')]?this[_0x610f('0x10')][_0x17f327[_0x610f('0x45')]][_0x610f('0x4f')]||'inbound':_0x610f('0x48');_0x17f327[_0x610f('0x5d')]=_0x36d64e[_0x610f('0x5d')];_0x17f327[_0x610f('0x6a')]=moment()[_0x610f('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x17f327[_0x610f('0x6b')]=_0x36d64e[_0x610f('0x6b')];_0x17f327['count']=_0x36d64e[_0x610f('0x6c')];_[_0x610f('0x6d')](_0x17f327,_['pick'](_0x36d64e,_[_0x610f('0x6e')](_0x17f327)));this[_0x610f('0xc')][_0x36d64e[_0x610f('0x69')]][_0x610f('0x6f')](_0x17f327);this[_0x610f('0xe')][_0x36d64e[_0x610f('0x69')]]=_0x17f327;this[_0x610f('0x70')](_0x17f327);}}catch(_0x4f566a){logger[_0x610f('0x3a')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x610f('0x40')](_0x4f566a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x9fea58){try{if(this[_0x610f('0x56')](_0x9fea58)){if(this[_0x610f('0xc')][_0x9fea58[_0x610f('0x69')]]){var _0x41d33f=_['last'](this[_0x610f('0xc')][_0x9fea58[_0x610f('0x69')]]);_0x41d33f[_0x610f('0x71')]=![];_0x41d33f[_0x610f('0x72')]=null;_0x41d33f['holdtime']=_0x9fea58[_0x610f('0x73')];_0x41d33f['originalposition']=_0x9fea58['originalposition'];_0x41d33f['queuecallerabandon']=!![];_0x41d33f[_0x610f('0x74')]=moment()[_0x610f('0x44')](_0x610f('0x75'));_0x41d33f['queuecallerexitreason']=_0x610f('0x76');_0x41d33f['lastAssignedTo']=null;this[_0x610f('0xe')][_0x9fea58[_0x610f('0x69')]]=_0x41d33f;this[_0x610f('0x3f')](_0x41d33f);}}}catch(_0x1a3f2f){logger[_0x610f('0x3a')](_0x610f('0x77'),util['inspect'](_0x1a3f2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x33e15a){try{if(this[_0x610f('0x56')](_0x33e15a)){if(this[_0x610f('0xc')][_0x33e15a[_0x610f('0x69')]]){var _0x3cc330=_[_0x610f('0x78')](this[_0x610f('0xc')][_0x33e15a['uniqueid']]);_0x3cc330[_0x610f('0x79')]=moment()[_0x610f('0x44')](_0x610f('0x75'));_0x3cc330['connectedlinenum']=_0x33e15a[_0x610f('0x7a')];_0x3cc330[_0x610f('0x7b')]=_0x33e15a[_0x610f('0x7b')];this[_0x610f('0xe')][_0x33e15a['uniqueid']]=_0x3cc330;this[_0x610f('0x70')](_0x3cc330);}}}catch(_0x270131){logger[_0x610f('0x3a')](_0x610f('0x7c'),util[_0x610f('0x40')](_0x270131,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x610f('0x7')][_0x610f('0x1f')]=function(_0x8a98a2){try{if(this[_0x610f('0x56')](_0x8a98a2)){if(this[_0x610f('0xc')][_0x8a98a2[_0x610f('0x69')]]){var _0x14292a=_[_0x610f('0x78')](this['queueReports'][_0x8a98a2[_0x610f('0x69')]]);_0x14292a[_0x610f('0x71')]=!![];_0x14292a[_0x610f('0x7d')]='COMPLETEDBYAGENT';}}}catch(_0x8399eb){logger[_0x610f('0x3a')]('[syncAgentConnect][VoiceQueueReport]',util['inspect'](_0x8399eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x610f('0x1d')]=function(_0x36eb23){try{if(this[_0x610f('0x56')](_0x36eb23)){if(this[_0x610f('0xc')][_0x36eb23[_0x610f('0x69')]]){var _0x49036b=_[_0x610f('0x78')](this[_0x610f('0xc')][_0x36eb23['uniqueid']]);_0x49036b['queuecallerabandon']=![];_0x49036b[_0x610f('0x74')]=null;_0x49036b[_0x610f('0x7e')]=!![];_0x49036b['lastAssignedTo']=_0x36eb23['membername'];_0x49036b[_0x610f('0x73')]=_0x36eb23['holdtime'];_0x49036b[_0x610f('0x71')]=!![];_0x49036b[_0x610f('0x7f')]=![];_0x49036b[_0x610f('0x80')]=null;if(!_0x49036b[_0x610f('0x81')]){if(_0x36eb23[_0x610f('0x82')]=='transfer'){_0x49036b['queuecallerexitreason']=_0x610f('0x83');}else{if(_[_0x610f('0x84')](_0x36eb23['channel'][_0x610f('0x85')](),_0x610f('0x86'))){if(this['queueReports'][_0x36eb23[_0x610f('0x87')]]){var _0x43970f=_[_0x610f('0x78')](this[_0x610f('0xc')][_0x36eb23[_0x610f('0x87')]]);_0x43970f[_0x610f('0x71')]=![];_0x43970f[_0x610f('0x7f')]=!![];_0x43970f[_0x610f('0x80')]=moment(_0x49036b[_0x610f('0x6a')])[_0x610f('0x88')](_0x36eb23['holdtime'],_0x610f('0x89'))[_0x610f('0x44')](_0x610f('0x75'));_0x43970f[_0x610f('0x7d')]='FORWARDTRANSFER';_0x43970f[_0x610f('0x81')]=!![];_0x43970f[_0x610f('0x8a')]=_0x610f('0x8b');_0x43970f[_0x610f('0x8c')]=_0x36eb23[_0x610f('0x8d')];_0x43970f[_0x610f('0x8e')]=_0x36eb23[_0x610f('0x69')];var _0x178369=this[_0x610f('0xc')][_0x36eb23[_0x610f('0x87')]];this[_0x610f('0xc')][_0x36eb23[_0x610f('0x87')]]=this[_0x610f('0xc')][_0x36eb23['uniqueid']];this[_0x610f('0xc')][_0x36eb23[_0x610f('0x69')]]=_0x178369;}}else{_0x49036b[_0x610f('0x7d')]=_0x610f('0x8f')+_0x36eb23['reason'][_0x610f('0x90')]();}}}this['channels'][_0x36eb23[_0x610f('0x69')]]=_0x49036b;this[_0x610f('0x3f')](_0x49036b);}}}catch(_0x4c4955){logger[_0x610f('0x3a')](_0x610f('0x91'),util[_0x610f('0x40')](_0x4c4955,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x610f('0x7')][_0x610f('0x21')]=function(_0x2cf3db){try{if(this[_0x610f('0x56')](_0x2cf3db)){this[_0x610f('0x92')](_0x2cf3db[_0x610f('0x69')],_[_0x610f('0x6e')](_0x2cf3db[_0x610f('0x93')])[0x0],_0x2cf3db['value']);if(this[_0x610f('0xc')][_0x2cf3db[_0x610f('0x69')]]){var _0x2eac5f=_[_0x610f('0x78')](this[_0x610f('0xc')][_0x2cf3db[_0x610f('0x69')]]);if(_0x2eac5f){if(this[_0x610f('0x56')](_0x2cf3db[_0x610f('0x93')])&&this[_0x610f('0x56')](_0x2cf3db['variable'][_0x610f('0x94')])){switch(_0x2cf3db['value']){case'CONTINUE':_0x2eac5f[_0x610f('0x7f')]=![];_0x2eac5f[_0x610f('0x80')]=null;break;default:_0x2eac5f[_0x610f('0x7f')]=!![];_0x2eac5f[_0x610f('0x80')]=moment()['format'](_0x610f('0x75'));_0x2eac5f[_0x610f('0x79')]=moment()[_0x610f('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2eac5f['queuecallerabandon']=![];_0x2eac5f[_0x610f('0x74')]=null;_0x2eac5f['queuecallerexitreason']=_0x2cf3db['value'];this['channels'][_0x2cf3db['uniqueid']]=_0x2eac5f;this[_0x610f('0x3f')](_0x2eac5f);}else if(this[_0x610f('0x56')](_0x2cf3db[_0x610f('0x93')])&&this[_0x610f('0x56')](_0x2cf3db[_0x610f('0x93')][_0x610f('0x95')])){if(!_0x2eac5f[_0x610f('0x96')]){_0x2eac5f[_0x610f('0x7f')]=!![];_0x2eac5f[_0x610f('0x80')]=moment()[_0x610f('0x44')](_0x610f('0x75'));_0x2eac5f[_0x610f('0x7d')]=_0x610f('0x97');_0x2eac5f[_0x610f('0x79')]=moment()[_0x610f('0x44')](_0x610f('0x75'));this['channels'][_0x2cf3db['uniqueid']]=_0x2eac5f;}}_0x2eac5f[_0x610f('0x13')]=this['variables'][_0x2cf3db[_0x610f('0x69')]];}}}}catch(_0x4c01d5){logger[_0x610f('0x3a')](_0x610f('0x98'),util[_0x610f('0x40')](_0x4c01d5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x610f('0x7')]['addVariable']=function(_0x43a33a,_0x57dc9a,_0x1245bc){var _0x3fd398=['rtpaudioqos',_0x610f('0x99'),'rtpaudioqosjitter',_0x610f('0x9a'),_0x610f('0x9b'),_0x610f('0x9c'),_0x610f('0x9d'),_0x610f('0x9e'),_0x610f('0x9f'),_0x610f('0xa0'),_0x610f('0xa1'),'bridgepvtcallid',_0x610f('0xa2'),'memberdynamic',_0x610f('0xa3'),_0x610f('0xa4'),'membername',_0x610f('0xa5'),_0x610f('0xa6')];if(!_[_0x610f('0x33')](_0x57dc9a)&&!_['includes'](_0x3fd398,_0x57dc9a)){if(_[_0x610f('0x2d')](this[_0x610f('0x13')][_0x43a33a])){this['variables'][_0x43a33a]={};}this[_0x610f('0x13')][_0x43a33a][_0x57dc9a]=_0x1245bc;}};VoiceQueueReport[_0x610f('0x7')][_0x610f('0x23')]=function(_0x105086){try{if(this[_0x610f('0x56')](_0x105086)){if(this['queueReports'][_0x105086[_0x610f('0x69')]]){for(var _0x548f56=0x0,_0x3b4ac6={};_0x548f56=0x0?moment(_0x5c3b17[_0xce12('0x16')])[_0xce12('0xb')](_0x5c3b17[_0xce12('0x15')],_0xce12('0xd')):null,'data1':_0xce12('0x17'),'data2':_0x5c3b17[_0xce12('0x18')],'data3':_0x5c3b17[_0xce12('0xe')],'data4':_0x5c3b17['dialstring']||null,'role':_0xce12('0xf'),'internal':_0x5c3b17[_0xce12('0x18')]?_[_0xce12('0x10')](_0x5c3b17[_0xce12('0x18')]):undefined,'uniqueid':_0x5c3b17['uniqueid']},'log':_0xce12('0x12')});}; \ No newline at end of file +var _0x3b2e=['exten','toNumber','accountcode','uniqueid','voiceDialReport','Request','membername','endtime','diff','starttime','outbound','dialstring','agent','lodash','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','isNil','interface','format','lastAssignedTo','TALKING','queuecallerleaveAt','seconds','inbound'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x3b2e,0x136));var _0xe3b2=function(_0x26018c,_0x3c0903){_0x26018c=_0x26018c-0x0;var _0x1efc45=_0x3b2e[_0x26018c];return _0x1efc45;};'use strict';var moment=require('moment');var _=require(_0xe3b2('0x0'));var util=require('util');var client=require('../client');exports[_0xe3b2('0x1')]=function(_0x3040ed){var _0x3a192e=_0x3040ed[_0xe3b2('0x2')]||_0x3040ed[_0xe3b2('0x3')];return client['Request'](_0xe3b2('0x4'),{'body':{'channel':_0xe3b2('0x5'),'membername':_0x3040ed['lastAssignedTo'],'interface':_[_0xe3b2('0x6')](_0x3040ed[_0xe3b2('0x7')])?util[_0xe3b2('0x8')]('SIP/%s',_0x3040ed[_0xe3b2('0x9')]):_0x3040ed[_0xe3b2('0x7')],'type':_0xe3b2('0xa'),'enterAt':_0x3040ed['queuecallerleaveAt'],'exitAt':_0x3a192e,'duration':moment(_0x3a192e)['diff'](_0x3040ed[_0xe3b2('0xb')],_0xe3b2('0xc')),'data1':_0xe3b2('0xd'),'data2':_0x3040ed['calleridnum'],'data3':_0x3040ed[_0xe3b2('0xe')],'data4':null,'data5':_0x3040ed['queue'],'role':'agent','internal':_0x3040ed['accountcode']?_[_0xe3b2('0xf')](_0x3040ed[_0xe3b2('0x10')]):undefined,'uniqueid':_0x3040ed[_0xe3b2('0x11')]},'log':'CreateMemberReport'});};exports[_0xe3b2('0x12')]=function(_0xafc5f3){return client[_0xe3b2('0x13')](_0xe3b2('0x4'),{'body':{'channel':_0xe3b2('0x5'),'membername':_0xafc5f3[_0xe3b2('0x14')],'interface':_0xafc5f3['interface'],'type':_0xe3b2('0xa'),'enterAt':_0xafc5f3['starttime'],'exitAt':_0xafc5f3[_0xe3b2('0x15')],'duration':moment(_0xafc5f3['endtime'])[_0xe3b2('0x16')](_0xafc5f3[_0xe3b2('0x17')],_0xe3b2('0xc'))>=0x0?moment(_0xafc5f3['endtime'])[_0xe3b2('0x16')](_0xafc5f3[_0xe3b2('0x17')],'seconds'):null,'data1':_0xe3b2('0x18'),'data2':_0xafc5f3[_0xe3b2('0x10')],'data3':_0xafc5f3['exten'],'data4':_0xafc5f3[_0xe3b2('0x19')]||null,'role':_0xe3b2('0x1a'),'internal':_0xafc5f3[_0xe3b2('0x10')]?_[_0xe3b2('0xf')](_0xafc5f3['accountcode']):undefined,'uniqueid':_0xafc5f3[_0xe3b2('0x11')]},'log':_0xe3b2('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c62da56..6fd4471 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 _0x8130=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x255565,_0x144616){var _0x5574e6=function(_0x5923b0){while(--_0x5923b0){_0x255565['push'](_0x255565['shift']());}};_0x5574e6(++_0x144616);}(_0x8130,0x146));var _0x0813=function(_0x2a140f,_0x3574ed){_0x2a140f=_0x2a140f-0x0;var _0x1cc421=_0x8130[_0x2a140f];return _0x1cc421;};'use strict';var client=require(_0x0813('0x0'));exports[_0x0813('0x1')]=function(_0x5038a7){return function(_0xb7d498){return client[_0x0813('0x2')](_0x0813('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0813('0x4'),_0x0813('0x5')]},'log':_0x0813('0x3')});};}; \ No newline at end of file +var _0x235a=['name','html','GetTemplate','../client','getTemplates','Request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x235a,0x1ef));var _0xa235=function(_0x4d0e8e,_0xd41ef7){_0x4d0e8e=_0x4d0e8e-0x0;var _0x31156c=_0x235a[_0x4d0e8e];return _0x31156c;};'use strict';var client=require(_0xa235('0x0'));exports[_0xa235('0x1')]=function(_0x95e7f5){return function(_0x49f946){return client[_0xa235('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xa235('0x3'),_0xa235('0x4')]},'log':_0xa235('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 6f45e2b..0419915 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 _0xdcd7=['field','operator','AnyConditions','Actions','action','data2','data3','data4','data6','data7','GetTrigger','name','channel','status','Condition','AllConditions'];(function(_0x14e5f3,_0x4967b0){var _0x34598e=function(_0x5830a6){while(--_0x5830a6){_0x14e5f3['push'](_0x14e5f3['shift']());}};_0x34598e(++_0x4967b0);}(_0xdcd7,0x13a));var _0x7dcd=function(_0x7c658d,_0xa5a056){_0x7c658d=_0x7c658d-0x0;var _0x12c7b2=_0xdcd7[_0x7c658d];return _0x12c7b2;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x3d683f){return function(_0xe482b8){return client['Request'](_0x7dcd('0x0'),{'options':{'raw':![],'attributes':['id',_0x7dcd('0x1'),_0x7dcd('0x2'),_0x7dcd('0x3')],'include':[{'model':_0x7dcd('0x4'),'as':_0x7dcd('0x5'),'attributes':['id',_0x7dcd('0x6'),_0x7dcd('0x7'),'value']},{'model':_0x7dcd('0x4'),'as':_0x7dcd('0x8'),'attributes':['id',_0x7dcd('0x6'),_0x7dcd('0x7'),'value']},{'model':'Action','as':_0x7dcd('0x9'),'attributes':['id',_0x7dcd('0xa'),'data1',_0x7dcd('0xb'),_0x7dcd('0xc'),_0x7dcd('0xd'),'data5',_0x7dcd('0xe'),_0x7dcd('0xf')]}]},'log':_0x7dcd('0x0')});};}; \ No newline at end of file +var _0x0e97=['getTriggers','Request','name','channel','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','GetTrigger','../client'];(function(_0x38b8c2,_0x510106){var _0x1c271a=function(_0x27762b){while(--_0x27762b){_0x38b8c2['push'](_0x38b8c2['shift']());}};_0x1c271a(++_0x510106);}(_0x0e97,0xd1));var _0x70e9=function(_0x192b13,_0x35e1f1){_0x192b13=_0x192b13-0x0;var _0x49b885=_0x0e97[_0x192b13];return _0x49b885;};'use strict';var client=require(_0x70e9('0x0'));exports[_0x70e9('0x1')]=function(_0x16ce47){return function(_0x36f234){return client[_0x70e9('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x70e9('0x3'),_0x70e9('0x4'),'status'],'include':[{'model':_0x70e9('0x5'),'as':_0x70e9('0x6'),'attributes':['id',_0x70e9('0x7'),_0x70e9('0x8'),_0x70e9('0x9')]},{'model':_0x70e9('0x5'),'as':'AnyConditions','attributes':['id',_0x70e9('0x7'),_0x70e9('0x8'),_0x70e9('0x9')]},{'model':_0x70e9('0xa'),'as':_0x70e9('0xb'),'attributes':['id',_0x70e9('0xc'),_0x70e9('0xd'),_0x70e9('0xe'),_0x70e9('0xf'),_0x70e9('0x10'),_0x70e9('0x11'),_0x70e9('0x12'),_0x70e9('0x13')]}]},'log':_0x70e9('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a072661..e01029b 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 _0xaf06=['../client','getTrunks','GetTrunk','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaf06,0xb4));var _0x6af0=function(_0x4f9b3a,_0x4b31a2){_0x4f9b3a=_0x4f9b3a-0x0;var _0x10cb16=_0xaf06[_0x4f9b3a];return _0x10cb16;};'use strict';var client=require(_0x6af0('0x0'));exports[_0x6af0('0x1')]=function(_0x266ab9){return function(_0x2aaa4e){return client['Request'](_0x6af0('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6af0('0x3'),'registry']},'log':_0x6af0('0x2')});};}; \ No newline at end of file +var _0xdfc0=['registry','GetTrunk','../client','getTrunks','name'];(function(_0x52bb96,_0x2b8ae9){var _0x5104c5=function(_0x103179){while(--_0x103179){_0x52bb96['push'](_0x52bb96['shift']());}};_0x5104c5(++_0x2b8ae9);}(_0xdfc0,0x6b));var _0x0dfc=function(_0xd919cb,_0x45f5b4){_0xd919cb=_0xd919cb-0x0;var _0x3bd22f=_0xdfc0[_0xd919cb];return _0x3bd22f;};'use strict';var client=require(_0x0dfc('0x0'));exports[_0x0dfc('0x1')]=function(_0x3da735){return function(_0xcfd651){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0dfc('0x2'),_0x0dfc('0x3')]},'log':_0x0dfc('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a7087ad..cbce813 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 _0xd2f7=['pauseType','lastPauseAt','voicePause','phone','interface','getTelephones','internal','Request','PauseUser','UnpauseUser','savePause','ShowUser','online','getAgent','getAgents','GetUser','agent','name','accountcode','lastLoginAt'];(function(_0x39f6b2,_0x52f7d){var _0xe0eef3=function(_0x5dfdf){while(--_0x5dfdf){_0x39f6b2['push'](_0x39f6b2['shift']());}};_0xe0eef3(++_0x52f7d);}(_0xd2f7,0x72));var _0x7d2f=function(_0x2423d7,_0xe6ec57){_0x2423d7=_0x2423d7-0x0;var _0x151d17=_0xd2f7[_0x2423d7];return _0x151d17;};'use strict';var client=require('../client');exports[_0x7d2f('0x0')]=function(){return function(){return client['Request'](_0x7d2f('0x1'),{'options':{'raw':![],'where':{'role':_0x7d2f('0x2')},'attributes':['id',_0x7d2f('0x3'),'email',_0x7d2f('0x4'),'fullname','online',_0x7d2f('0x5'),_0x7d2f('0x6'),_0x7d2f('0x7'),_0x7d2f('0x8'),_0x7d2f('0x9'),'mobile',_0x7d2f('0xa')]},'log':'getAgents'});};};exports[_0x7d2f('0xb')]=function(){return function(){return client['Request'](_0x7d2f('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x7d2f('0x3'),_0x7d2f('0x4'),_0x7d2f('0xc')]},'log':'getTelephones'});};};exports['savePause']=function(_0x9a1501,_0x388586,_0x47a75b){return client[_0x7d2f('0xd')](_0x7d2f('0xe'),{'body':{'type':_0x388586,'uniqueid':_0x47a75b},'options':{'where':{'id':_0x9a1501['id']}},'log':'savePause'});};exports['saveUnpause']=function(_0x375e84){return client[_0x7d2f('0xd')](_0x7d2f('0xf'),{'body':{},'options':{'where':{'id':_0x375e84['id']}},'log':_0x7d2f('0x10')});};exports['getAgent']=function(_0x5edf36){return client[_0x7d2f('0xd')](_0x7d2f('0x11'),{'options':{'raw':![],'where':{'role':_0x7d2f('0x2'),'id':_0x5edf36},'attributes':['id',_0x7d2f('0x3'),'email',_0x7d2f('0x4'),'fullname',_0x7d2f('0x12'),_0x7d2f('0x5'),'pauseType',_0x7d2f('0x7'),_0x7d2f('0x8'),_0x7d2f('0xa')]},'log':_0x7d2f('0x13')});}; \ No newline at end of file +var _0x3871=['saveUnpause','getAgent','email','fullname','pauseType','../client','getAgents','GetUser','agent','name','accountcode','online','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','Request','telephone','internal','PauseUser','savePause'];(function(_0x4979d7,_0x41a5cb){var _0x37fbc6=function(_0x9ee511){while(--_0x9ee511){_0x4979d7['push'](_0x4979d7['shift']());}};_0x37fbc6(++_0x41a5cb);}(_0x3871,0xc5));var _0x1387=function(_0xbb6d84,_0x4665d7){_0xbb6d84=_0xbb6d84-0x0;var _0x3e0539=_0x3871[_0xbb6d84];return _0x3e0539;};'use strict';var client=require(_0x1387('0x0'));exports[_0x1387('0x1')]=function(){return function(){return client['Request'](_0x1387('0x2'),{'options':{'raw':![],'where':{'role':_0x1387('0x3')},'attributes':['id',_0x1387('0x4'),'email',_0x1387('0x5'),'fullname',_0x1387('0x6'),_0x1387('0x7'),'pauseType',_0x1387('0x8'),_0x1387('0x9'),_0x1387('0xa'),_0x1387('0xb'),_0x1387('0xc')]},'log':_0x1387('0x1')});};};exports[_0x1387('0xd')]=function(){return function(){return client[_0x1387('0xe')](_0x1387('0x2'),{'options':{'raw':!![],'where':{'role':_0x1387('0xf')},'attributes':['id','name',_0x1387('0x5'),_0x1387('0x10')]},'log':_0x1387('0xd')});};};exports['savePause']=function(_0x4d8c86,_0x29414f,_0x2f858f){return client[_0x1387('0xe')](_0x1387('0x11'),{'body':{'type':_0x29414f,'uniqueid':_0x2f858f},'options':{'where':{'id':_0x4d8c86['id']}},'log':_0x1387('0x12')});};exports[_0x1387('0x13')]=function(_0x5ec033){return client[_0x1387('0xe')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5ec033['id']}},'log':_0x1387('0x12')});};exports[_0x1387('0x14')]=function(_0x213693){return client[_0x1387('0xe')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x1387('0x3'),'id':_0x213693},'attributes':['id','name',_0x1387('0x15'),_0x1387('0x5'),_0x1387('0x16'),'online','lastLoginAt',_0x1387('0x17'),_0x1387('0x8'),'voicePause',_0x1387('0xc')]},'log':_0x1387('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 593fdc4..50d0ddd 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 _0x34dd=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x1c73ed,_0x5d16c2){var _0x2d1997=function(_0x796897){while(--_0x796897){_0x1c73ed['push'](_0x1c73ed['shift']());}};_0x2d1997(++_0x5d16c2);}(_0x34dd,0x1d4));var _0xd34d=function(_0x4e2015,_0x55c551){_0x4e2015=_0x4e2015-0x0;var _0x409709=_0x34dd[_0x4e2015];return _0x409709;};'use strict';var client=require('../client');exports[_0xd34d('0x0')]=function(_0x2dfd79){return client[_0xd34d('0x1')](_0xd34d('0x2'),{'body':_0x2dfd79,'log':'CreateVoiceAgentReport'});};exports[_0xd34d('0x3')]=function(_0x380fb8,_0x4a2c70,_0x507cbe){return client[_0xd34d('0x1')](_0xd34d('0x4'),{'body':_0x380fb8,'options':{'where':{'uniqueid':_0x4a2c70,'interface':_0x507cbe}},'log':_0xd34d('0x4')});}; \ No newline at end of file +var _0xee8f=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0xee8f,0x1d0));var _0xfee8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xee8f[_0x2b4411];return _0x8e41ef;};'use strict';var client=require('../client');exports[_0xfee8('0x0')]=function(_0x52e01c){return client[_0xfee8('0x1')](_0xfee8('0x2'),{'body':_0x52e01c,'log':_0xfee8('0x2')});};exports[_0xfee8('0x3')]=function(_0x1e58c7,_0x5dfc3d,_0x4634cc){return client['Request'](_0xfee8('0x4'),{'body':_0x1e58c7,'options':{'where':{'uniqueid':_0x5dfc3d,'interface':_0x4634cc}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index b9bd86e..c49055e 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 _0x81d5=['lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','GetVoiceCallReports','moment','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81d5,0x1c6));var _0x581d=function(_0x29d1b2,_0x37aaa4){_0x29d1b2=_0x29d1b2-0x0;var _0x33c0d6=_0x81d5[_0x29d1b2];return _0x33c0d6;};'use strict';var moment=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var _=require(_0x581d('0x2'));var client=require(_0x581d('0x3'));exports[_0x581d('0x4')]=function(_0x1d5d91){return client[_0x581d('0x5')](_0x581d('0x6'),{'body':_[_0x581d('0x7')](_0x1d5d91,{'source':_0x1d5d91[_0x581d('0x8')],'destinationcontext':_0x1d5d91['context'],'callerid':_0x1d5d91[_0x581d('0x9')],'amaflags':_0x581d('0xa')}),'log':_0x581d('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x581d('0x5')](_0x581d('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x581d('0xc')](_0x581d('0xd'))[_0x581d('0xe')](_0x581d('0xf')),moment()[_0x581d('0x10')](_0x581d('0xd'))[_0x581d('0xe')](_0x581d('0xf'))]}},'attributes':[_0x581d('0x11'),'disposition','duration','billableseconds']},'log':_0x581d('0x12')});};}; \ No newline at end of file +var _0x6bcc=['Request','CreateVoiceCallReport','calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','duration','billableseconds','GetVoiceCallReports','moment','util','create'];(function(_0x2f1bf8,_0xecd14){var _0x2c7ea8=function(_0x221387){while(--_0x221387){_0x2f1bf8['push'](_0x2f1bf8['shift']());}};_0x2c7ea8(++_0xecd14);}(_0x6bcc,0x9f));var _0xc6bc=function(_0x1c507d,_0x5f38cf){_0x1c507d=_0x1c507d-0x0;var _0x2bfa74=_0x6bcc[_0x1c507d];return _0x2bfa74;};'use strict';var moment=require(_0xc6bc('0x0'));var util=require(_0xc6bc('0x1'));var _=require('lodash');var client=require('../client');exports[_0xc6bc('0x2')]=function(_0x2c29fc){return client[_0xc6bc('0x3')](_0xc6bc('0x4'),{'body':_['merge'](_0x2c29fc,{'source':_0x2c29fc[_0xc6bc('0x5')],'destinationcontext':_0x2c29fc['context'],'callerid':_0x2c29fc['callerid'],'amaflags':_0xc6bc('0x6')}),'log':_0xc6bc('0x4')});};exports[_0xc6bc('0x7')]=function(){return function(){return client[_0xc6bc('0x3')](_0xc6bc('0x8'),{'options':{'where':{'type':[_0xc6bc('0x9')],'createdAt':{'$between':[moment()[_0xc6bc('0xa')]('day')['format'](_0xc6bc('0xb')),moment()[_0xc6bc('0xc')]('day')[_0xc6bc('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xc6bc('0xe'),'disposition',_0xc6bc('0xf'),_0xc6bc('0x10')]},'log':_0xc6bc('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index a00b6c1..d06aa3d 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 _0x7d28=['Request','CreateVoiceDialReport','create'];(function(_0x37379d,_0x3981cb){var _0x7ac316=function(_0x265002){while(--_0x265002){_0x37379d['push'](_0x37379d['shift']());}};_0x7ac316(++_0x3981cb);}(_0x7d28,0x128));var _0x87d2=function(_0x908967,_0x429697){_0x908967=_0x908967-0x0;var _0x101c2f=_0x7d28[_0x908967];return _0x101c2f;};'use strict';var client=require('../client');exports[_0x87d2('0x0')]=function(_0xf5e17b){return client[_0x87d2('0x1')]('CreateVoiceDialReport',{'body':_0xf5e17b,'log':_0x87d2('0x2')});}; \ No newline at end of file +var _0x74e5=['../client','create','CreateVoiceDialReport'];(function(_0x315be7,_0x2d9fa3){var _0x240246=function(_0x126daa){while(--_0x126daa){_0x315be7['push'](_0x315be7['shift']());}};_0x240246(++_0x2d9fa3);}(_0x74e5,0x138));var _0x574e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x74e5[_0xefd519];return _0x4bb882;};'use strict';var client=require(_0x574e('0x0'));exports[_0x574e('0x1')]=function(_0x4c3577){return client['Request'](_0x574e('0x2'),{'body':_0x4c3577,'log':_0x574e('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2e96a1a..81f4d64 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 _0x622f=['../client','getVoiceExtensions','GetVoiceExtension','exten','recordingFormat'];(function(_0x59af29,_0x51d1c0){var _0x59a554=function(_0x8c8ec6){while(--_0x8c8ec6){_0x59af29['push'](_0x59af29['shift']());}};_0x59a554(++_0x51d1c0);}(_0x622f,0x172));var _0xf622=function(_0x3d611c,_0x3b0677){_0x3d611c=_0x3d611c-0x0;var _0x3e59ee=_0x622f[_0x3d611c];return _0x3e59ee;};'use strict';var client=require(_0xf622('0x0'));exports[_0xf622('0x1')]=function(){return function(){return client['Request'](_0xf622('0x2'),{'options':{'raw':!![],'attributes':['id',_0xf622('0x3'),_0xf622('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xa30e=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa30e,0x117));var _0xea30=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0xa30e[_0x5de818];return _0x345670;};'use strict';var client=require(_0xea30('0x0'));exports[_0xea30('0x1')]=function(){return function(){return client[_0xea30('0x2')](_0xea30('0x3'),{'options':{'raw':!![],'attributes':['id',_0xea30('0x4'),_0xea30('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 2d73c5b..044ed4d 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 _0xd205=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','mandatoryDispositionPause','name','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization'];(function(_0x1a9795,_0x291cc5){var _0x4ad187=function(_0x13946a){while(--_0x13946a){_0x1a9795['push'](_0x1a9795['shift']());}};_0x4ad187(++_0x291cc5);}(_0xd205,0x101));var _0x5d20=function(_0x869641,_0x11ead7){_0x869641=_0x869641-0x0;var _0x4dfc30=_0xd205[_0x869641];return _0x4dfc30;};'use strict';var client=require(_0x5d20('0x0'));exports[_0x5d20('0x1')]=function(){return function(){return client[_0x5d20('0x2')](_0x5d20('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5d20('0x4'),_0x5d20('0x5'),'autopause',_0x5d20('0x6'),_0x5d20('0x7'),_0x5d20('0x8'),_0x5d20('0x9'),_0x5d20('0xa'),'dialLimitQueue',_0x5d20('0xb'),_0x5d20('0xc'),_0x5d20('0xd'),_0x5d20('0xe'),_0x5d20('0xf'),_0x5d20('0x10'),_0x5d20('0x11'),_0x5d20('0x12'),_0x5d20('0x13'),_0x5d20('0x14'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x5d20('0x15'),_0x5d20('0x16'),_0x5d20('0x17'),_0x5d20('0x18'),'dialGlobalMaxRetry',_0x5d20('0x19'),_0x5d20('0x1a'),_0x5d20('0x1b'),_0x5d20('0x1c'),_0x5d20('0x1d'),_0x5d20('0x1e'),'dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x5d20('0x1f'),_0x5d20('0x20'),_0x5d20('0x21'),_0x5d20('0x22'),_0x5d20('0x23'),_0x5d20('0x24'),_0x5d20('0x25'),_0x5d20('0x26'),'dialAgiAfterHangupAgent',_0x5d20('0x27'),_0x5d20('0x28'),_0x5d20('0x6'),_0x5d20('0x29'),_0x5d20('0x2a'),_0x5d20('0x2b'),'mandatoryDisposition',_0x5d20('0x2c'),_0x5d20('0x2d')],'include':[{'model':_0x5d20('0x2e'),'as':_0x5d20('0x2e'),'attributes':['id','name','callerid',_0x5d20('0x2f')]},{'model':'Pause','as':_0x5d20('0x30'),'attributes':['id',_0x5d20('0x31')]},{'model':_0x5d20('0x2e'),'as':'TrunkBackup','attributes':['id',_0x5d20('0x31'),_0x5d20('0x32'),_0x5d20('0x2f')]},{'model':_0x5d20('0x33'),'as':'Interval','attributes':['id',_0x5d20('0x31')],'include':[{'model':_0x5d20('0x33'),'as':_0x5d20('0x34'),'attributes':['id',_0x5d20('0x31'),_0x5d20('0x35')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xf6dd=['dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','Trunk','callerid','Pause','active','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x3b3722,_0x31c569){var _0x2a679a=function(_0x338aaf){while(--_0x338aaf){_0x3b3722['push'](_0x3b3722['shift']());}};_0x2a679a(++_0x31c569);}(_0xf6dd,0x81));var _0xdf6d=function(_0x1ea218,_0x44fd34){_0x1ea218=_0x1ea218-0x0;var _0x4697eb=_0xf6dd[_0x1ea218];return _0x4697eb;};'use strict';var client=require('../client');exports[_0xdf6d('0x0')]=function(){return function(){return client['Request'](_0xdf6d('0x1'),{'options':{'raw':![],'attributes':['id',_0xdf6d('0x2'),_0xdf6d('0x3'),_0xdf6d('0x4'),'autopause','monitor_format','type','dialActive',_0xdf6d('0x5'),'dialLimitChannel',_0xdf6d('0x6'),_0xdf6d('0x7'),_0xdf6d('0x8'),_0xdf6d('0x9'),_0xdf6d('0xa'),_0xdf6d('0xb'),_0xdf6d('0xc'),'dialOriginateTimeout',_0xdf6d('0xd'),_0xdf6d('0xe'),_0xdf6d('0xf'),_0xdf6d('0x10'),_0xdf6d('0x11'),_0xdf6d('0x12'),_0xdf6d('0x13'),_0xdf6d('0x14'),'dialNoAnswerRetryFrequency',_0xdf6d('0x15'),_0xdf6d('0x16'),'dialGlobalInterval',_0xdf6d('0x17'),_0xdf6d('0x18'),_0xdf6d('0x19'),'dialAMDInitialSilence',_0xdf6d('0x1a'),_0xdf6d('0x1b'),_0xdf6d('0x1c'),_0xdf6d('0x1d'),'dialAMDBetweenWordsSilence',_0xdf6d('0x1e'),_0xdf6d('0x1f'),_0xdf6d('0x20'),_0xdf6d('0x21'),_0xdf6d('0x22'),_0xdf6d('0x23'),_0xdf6d('0x24'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xdf6d('0x25'),_0xdf6d('0x26'),_0xdf6d('0x27'),_0xdf6d('0x28'),_0xdf6d('0x29'),_0xdf6d('0x2a'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xdf6d('0x2b'),'as':_0xdf6d('0x2b'),'attributes':['id','name',_0xdf6d('0x2c'),'active']},{'model':_0xdf6d('0x2d'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0xdf6d('0x2'),_0xdf6d('0x2c'),_0xdf6d('0x2e')]},{'model':'Interval','as':_0xdf6d('0x2f'),'attributes':['id',_0xdf6d('0x2')],'include':[{'model':_0xdf6d('0x2f'),'as':_0xdf6d('0x30'),'attributes':['id','name',_0xdf6d('0x31')]}]}]},'log':_0xdf6d('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 09521fd..990ffa9 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 _0xde06=['lodash','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment'];(function(_0x5cbaee,_0x2cf82e){var _0x32486d=function(_0x246b4e){while(--_0x246b4e){_0x5cbaee['push'](_0x5cbaee['shift']());}};_0x32486d(++_0x2cf82e);}(_0xde06,0x113));var _0x6de0=function(_0x59723d,_0xe33549){_0x59723d=_0x59723d-0x0;var _0x34d7e1=_0xde06[_0x59723d];return _0x34d7e1;};'use strict';var moment=require(_0x6de0('0x0'));var _=require(_0x6de0('0x1'));var client=require(_0x6de0('0x2'));exports[_0x6de0('0x3')]=function(_0x5ba682){return client[_0x6de0('0x4')](_0x6de0('0x5'),{'body':_0x5ba682,'log':_0x6de0('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x6de0('0x4')](_0x6de0('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x6de0('0x7')](_0x6de0('0x8'))[_0x6de0('0x9')](_0x6de0('0xa')),moment()[_0x6de0('0xb')](_0x6de0('0x8'))[_0x6de0('0x9')](_0x6de0('0xa'))]}},'attributes':[_0x6de0('0xc'),_0x6de0('0xd'),_0x6de0('0xe'),_0x6de0('0xf'),_0x6de0('0x10'),_0x6de0('0x11'),_0x6de0('0x12'),_0x6de0('0x13'),_0x6de0('0x14'),_0x6de0('0x15')]},'log':_0x6de0('0x16')});};}; \ No newline at end of file +var _0x9399=['YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','moment','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','day','format','endOf'];(function(_0x47b03c,_0x2b8a51){var _0x2a3db5=function(_0x39cabe){while(--_0x39cabe){_0x47b03c['push'](_0x47b03c['shift']());}};_0x2a3db5(++_0x2b8a51);}(_0x9399,0x131));var _0x9939=function(_0x1805de,_0xbb9693){_0x1805de=_0x1805de-0x0;var _0x173d48=_0x9399[_0x1805de];return _0x173d48;};'use strict';var moment=require(_0x9939('0x0'));var _=require(_0x9939('0x1'));var client=require(_0x9939('0x2'));exports[_0x9939('0x3')]=function(_0x25ab12){return client[_0x9939('0x4')](_0x9939('0x5'),{'body':_0x25ab12,'log':_0x9939('0x5')});};exports[_0x9939('0x6')]=function(){return function(){return client[_0x9939('0x4')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x9939('0x7'))[_0x9939('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x9939('0x9')]('day')[_0x9939('0x8')](_0x9939('0xa'))]}},'attributes':[_0x9939('0xb'),_0x9939('0xc'),_0x9939('0xd'),_0x9939('0xe'),_0x9939('0xf'),_0x9939('0x10'),_0x9939('0x11'),_0x9939('0x12'),_0x9939('0x13'),_0x9939('0x14')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index ba81234..3fe9d2e 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 _0x5b47=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x29c9eb,_0x3d680b){var _0x438352=function(_0x1e5198){while(--_0x1e5198){_0x29c9eb['push'](_0x29c9eb['shift']());}};_0x438352(++_0x3d680b);}(_0x5b47,0x1a6));var _0x75b4=function(_0x5782af,_0x5dae24){_0x5782af=_0x5782af-0x0;var _0x50c151=_0x5b47[_0x5782af];return _0x50c151;};'use strict';var client=require(_0x75b4('0x0'));exports[_0x75b4('0x1')]=function(_0x5edcc0){return function(){return client[_0x75b4('0x2')](_0x75b4('0x3'),{'options':{'where':{'VoiceQueueId':_0x5edcc0,'paused':!![]},'raw':!![]},'log':_0x75b4('0x1')});};}; \ No newline at end of file +var _0xc4ff=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x55fd95,_0xef22e4){var _0x2f0aca=function(_0x426c10){while(--_0x426c10){_0x55fd95['push'](_0x55fd95['shift']());}};_0x2f0aca(++_0xef22e4);}(_0xc4ff,0x111));var _0xfc4f=function(_0x4542a6,_0x4a6d60){_0x4542a6=_0x4542a6-0x0;var _0x569810=_0xc4ff[_0x4542a6];return _0x569810;};'use strict';var client=require('../client');exports[_0xfc4f('0x0')]=function(_0x171360){return function(){return client[_0xfc4f('0x1')](_0xfc4f('0x2'),{'options':{'where':{'VoiceQueueId':_0x171360,'paused':!![]},'raw':!![]},'log':_0xfc4f('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 19a4ba9..77100e4 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 _0x424f=['Request','CreateVoiceRecording','merge','monitorFilename','../client','create'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x424f,0x130));var _0xf424=function(_0x14e2a8,_0x546016){_0x14e2a8=_0x14e2a8-0x0;var _0x160181=_0x424f[_0x14e2a8];return _0x160181;};'use strict';var _=require('lodash');var client=require(_0xf424('0x0'));exports[_0xf424('0x1')]=function(_0x2b25a6){return client[_0xf424('0x2')](_0xf424('0x3'),{'body':_[_0xf424('0x4')](_0x2b25a6,{'value':_0x2b25a6[_0xf424('0x5')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x6426=['lodash','../client','Request','CreateVoiceRecording','merge'];(function(_0x864d71,_0x29fc0e){var _0x16995b=function(_0x3afb8e){while(--_0x3afb8e){_0x864d71['push'](_0x864d71['shift']());}};_0x16995b(++_0x29fc0e);}(_0x6426,0x82));var _0x6642=function(_0x10150d,_0x196a3d){_0x10150d=_0x10150d-0x0;var _0x9444b9=_0x6426[_0x10150d];return _0x9444b9;};'use strict';var _=require(_0x6642('0x0'));var client=require(_0x6642('0x1'));exports['create']=function(_0xeef0cc){return client[_0x6642('0x2')](_0x6642('0x3'),{'body':_[_0x6642('0x4')](_0xeef0cc,{'value':_0xeef0cc['monitorFilename']}),'log':_0x6642('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 9f7d353..6345dda 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 _0x93a6=['CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request'];(function(_0x4c7ebd,_0x51daba){var _0x561969=function(_0x3bd578){while(--_0x3bd578){_0x4c7ebd['push'](_0x4c7ebd['shift']());}};_0x561969(++_0x51daba);}(_0x93a6,0x1aa));var _0x693a=function(_0x2ea900,_0xd4c112){_0x2ea900=_0x2ea900-0x0;var _0x20ab6e=_0x93a6[_0x2ea900];return _0x20ab6e;};'use strict';var client=require(_0x693a('0x0'));exports[_0x693a('0x1')]=function(_0x59cfb7){return client[_0x693a('0x2')](_0x693a('0x3'),{'body':{'result':_0x59cfb7[_0x693a('0x4')],'transfererchannel':_0x59cfb7['transfererchannel'],'transferercalleridnum':_0x59cfb7['transferercalleridnum'],'transferercalleridname':_0x59cfb7[_0x693a('0x5')],'transfererconnectedlinenum':_0x59cfb7[_0x693a('0x6')],'transfererconnectedlinename':_0x59cfb7['transfererconnectedlinename'],'transfereraccountcode':_0x59cfb7[_0x693a('0x7')],'transferercontext':_0x59cfb7[_0x693a('0x8')],'transfererexten':_0x59cfb7[_0x693a('0x9')],'transfererlinkedid':_0x59cfb7['transfererlinkedid'],'transfereechannel':_0x59cfb7[_0x693a('0xa')],'transfereecalleridnum':_0x59cfb7[_0x693a('0xb')],'transfereecalleridname':_0x59cfb7[_0x693a('0xc')],'transfereeconnectedlinenum':_0x59cfb7['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x59cfb7[_0x693a('0xd')],'transfereeaccountcode':_0x59cfb7[_0x693a('0xe')],'transfereecontext':_0x59cfb7[_0x693a('0xf')],'transfereeexten':_0x59cfb7[_0x693a('0x10')],'transfereelinkedid':_0x59cfb7[_0x693a('0x11')],'isexternal':_0x59cfb7[_0x693a('0x12')],'context':_0x59cfb7[_0x693a('0x13')],'extension':_0x59cfb7[_0x693a('0x14')],'type':_0x693a('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x43dde5){return client[_0x693a('0x2')](_0x693a('0x3'),{'body':{'result':_0x43dde5[_0x693a('0x4')],'transfererchannel':_0x43dde5[_0x693a('0x16')],'transferercalleridnum':_0x43dde5[_0x693a('0x17')],'transferercalleridname':_0x43dde5['origtransferercalleridname'],'transfererconnectedlinenum':_0x43dde5[_0x693a('0x18')],'transfererconnectedlinename':_0x43dde5[_0x693a('0x19')],'transfereraccountcode':_0x43dde5[_0x693a('0x1a')],'transferercontext':_0x43dde5[_0x693a('0x1b')],'transfererexten':_0x43dde5[_0x693a('0x1c')],'transfererlinkedid':_0x43dde5['origtransfererlinkedid'],'transfereechannel':_0x43dde5['transfertargetchannel'],'transfereecalleridnum':_0x43dde5[_0x693a('0x1d')],'transfereecalleridname':_0x43dde5[_0x693a('0x1e')],'transfereeconnectedlinenum':_0x43dde5[_0x693a('0x1f')],'transfereeconnectedlinename':_0x43dde5[_0x693a('0x20')],'transfereeaccountcode':_0x43dde5[_0x693a('0x21')],'transfereecontext':_0x43dde5['transfertargetcontext'],'transfereeexten':_0x43dde5[_0x693a('0x22')],'transfereelinkedid':_0x43dde5[_0x693a('0x23')],'isexternal':_0x43dde5[_0x693a('0x12')],'context':_0x43dde5[_0x693a('0x24')],'extension':_0x43dde5[_0x693a('0x25')],'type':_0x693a('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x8df4=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinename','transfereecontext','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransfererchannel'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x8df4,0x18d));var _0x48df=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x8df4[_0x27dba4];return _0x35ec9d;};'use strict';var client=require(_0x48df('0x0'));exports[_0x48df('0x1')]=function(_0x4fcc4d){return client[_0x48df('0x2')](_0x48df('0x3'),{'body':{'result':_0x4fcc4d[_0x48df('0x4')],'transfererchannel':_0x4fcc4d[_0x48df('0x5')],'transferercalleridnum':_0x4fcc4d['transferercalleridnum'],'transferercalleridname':_0x4fcc4d['transferercalleridname'],'transfererconnectedlinenum':_0x4fcc4d[_0x48df('0x6')],'transfererconnectedlinename':_0x4fcc4d[_0x48df('0x7')],'transfereraccountcode':_0x4fcc4d[_0x48df('0x8')],'transferercontext':_0x4fcc4d[_0x48df('0x9')],'transfererexten':_0x4fcc4d[_0x48df('0xa')],'transfererlinkedid':_0x4fcc4d[_0x48df('0xb')],'transfereechannel':_0x4fcc4d[_0x48df('0xc')],'transfereecalleridnum':_0x4fcc4d['transfereecalleridnum'],'transfereecalleridname':_0x4fcc4d['transfereecalleridname'],'transfereeconnectedlinenum':_0x4fcc4d['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4fcc4d[_0x48df('0xd')],'transfereeaccountcode':_0x4fcc4d['transfereeaccountcode'],'transfereecontext':_0x4fcc4d[_0x48df('0xe')],'transfereeexten':_0x4fcc4d['transfereeexten'],'transfereelinkedid':_0x4fcc4d[_0x48df('0xf')],'isexternal':_0x4fcc4d[_0x48df('0x10')],'context':_0x4fcc4d[_0x48df('0x11')],'extension':_0x4fcc4d['extension'],'type':_0x48df('0x12')},'log':_0x48df('0x3')});};exports[_0x48df('0x13')]=function(_0x5767f1){return client[_0x48df('0x2')](_0x48df('0x3'),{'body':{'result':_0x5767f1[_0x48df('0x4')],'transfererchannel':_0x5767f1[_0x48df('0x14')],'transferercalleridnum':_0x5767f1['origtransferercalleridnum'],'transferercalleridname':_0x5767f1[_0x48df('0x15')],'transfererconnectedlinenum':_0x5767f1[_0x48df('0x16')],'transfererconnectedlinename':_0x5767f1[_0x48df('0x17')],'transfereraccountcode':_0x5767f1[_0x48df('0x18')],'transferercontext':_0x5767f1[_0x48df('0x19')],'transfererexten':_0x5767f1[_0x48df('0x1a')],'transfererlinkedid':_0x5767f1['origtransfererlinkedid'],'transfereechannel':_0x5767f1[_0x48df('0x1b')],'transfereecalleridnum':_0x5767f1['transfertargetcalleridnum'],'transfereecalleridname':_0x5767f1[_0x48df('0x1c')],'transfereeconnectedlinenum':_0x5767f1[_0x48df('0x1d')],'transfereeconnectedlinename':_0x5767f1[_0x48df('0x1e')],'transfereeaccountcode':_0x5767f1[_0x48df('0x1f')],'transfereecontext':_0x5767f1[_0x48df('0x20')],'transfereeexten':_0x5767f1[_0x48df('0x21')],'transfereelinkedid':_0x5767f1[_0x48df('0x22')],'isexternal':_0x5767f1[_0x48df('0x10')],'context':_0x5767f1[_0x48df('0x23')],'extension':_0x5767f1[_0x48df('0x24')],'type':_0x48df('0x25')},'log':_0x48df('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 5e51554..ec6dfe3 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 _0x37c6=['Command','Action','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','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','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','channels','map','find','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','validate','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','Redirect','context','telephones','outboundChannels','run','event','emit','faxAccounts','checkAfterSend','server','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','error','username','join','keys','action','then','message','catch','isConnected','asterisk','ami\x20disconnected','pick','command'];(function(_0x2507b6,_0x2d059a){var _0x22c8a4=function(_0x3deebb){while(--_0x3deebb){_0x2507b6['push'](_0x2507b6['shift']());}};_0x22c8a4(++_0x2d059a);}(_0x37c6,0xef));var _0x637c=function(_0x4578a6,_0x381e89){_0x4578a6=_0x4578a6-0x0;var _0x12f73a=_0x37c6[_0x4578a6];return _0x12f73a;};'use strict';var _=require(_0x637c('0x0'));var util=require(_0x637c('0x1'));var jayson=require(_0x637c('0x2'));var schema=require('validate');var BPromise=require(_0x637c('0x3'));var moment=require(_0x637c('0x4'));var config=require(_0x637c('0x5'));var properties=require(_0x637c('0x6'));var ami=require(_0x637c('0x7'));exports['listen']=function(_0x1286bb,_0xca42e8,_0x36943f){return new BPromise(function(_0x1b97c3,_0x95cfaa){var _0x556d75={'QueuePause':function(_0x27ef55){return new Promise(function(_0x539de2,_0x406bb){var _0x2e1a29=util[_0x637c('0x8')](_0x637c('0x9'),_0x637c('0xa'),_0x27ef55[_0x637c('0xb')]);if(_0x1286bb['timers']&&_0x1286bb[_0x637c('0xc')][_0x2e1a29]&&_0x1286bb[_0x637c('0xc')][_0x2e1a29][_0x637c('0xd')]){_0x1286bb[_0x637c('0xc')][_0x2e1a29]['updateAcw']();}if(_0x1286bb[_0x637c('0xe')][_0x2e1a29]){_0x1286bb['agents'][_0x2e1a29][_0x637c('0xf')]({'statePause':_0x27ef55[_0x637c('0x10')]?!![]:![]});}_0x539de2({'code':0xc8,'message':_0x637c('0x11')});});},'Reload':function(_0x2b7a6d){var _0x121b74=this;return new Promise(function(_0x5e49c,_0x2baeaa){if(ami['isConnected']()==![]){return _0x2baeaa(_0x121b74[_0x637c('0x12')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x637c('0x13')],'ami\x20disconnected'][_0x637c('0x14')]('\x20')));}_0x2b7a6d=_['pick'](_0x2b7a6d,_[_0x637c('0x15')](properties['module']));_0x2b7a6d[_0x637c('0x16')]='Reload';return ami['Action'](_0x2b7a6d)[_0x637c('0x17')](function(_0xa0989e){_0x5e49c({'code':0xc8,'message':_0xa0989e[_0x637c('0x18')]});})[_0x637c('0x19')](function(_0x191188){_0x2baeaa(_0x121b74[_0x637c('0x12')](0x1f5,_0x191188[_0x637c('0x18')]));});});},'Command':function(_0x15c53c){var _0x4952d9=this;return new Promise(function(_0x2458df,_0x2ec54d){if(ami[_0x637c('0x1a')]()==![]){return _0x2ec54d(_0x4952d9['error'](0x1f4,[config[_0x637c('0x1b')]['ip'],config[_0x637c('0x1b')][_0x637c('0x13')],_0x637c('0x1c')][_0x637c('0x14')]('\x20')));}_0x15c53c=_[_0x637c('0x1d')](_0x15c53c,_0x637c('0x1e'));_0x15c53c[_0x637c('0x16')]=_0x637c('0x1f');return ami[_0x637c('0x20')](_0x15c53c)[_0x637c('0x17')](function(_0x193cae){_0x2458df({'code':0xc8,'message':_0x193cae[_0x637c('0x21')]});})[_0x637c('0x19')](function(_0x241e51){_0x2ec54d(_0x4952d9[_0x637c('0x12')](0x1f5,_0x241e51['message']));});});},'VoiceQueues':function(_0x1f3dc8){return new Promise(function(_0x930b46,_0x39e11f){var _0x1fa3fa=[];for(var _0x144025 in _0x1286bb['voiceQueues']){if(_0x1286bb[_0x637c('0x22')]['hasOwnProperty'](_0x144025)){var _0x581344=_0x1286bb['voiceQueues'][_0x144025];var _0xd30648={'id':_0x581344['id'],'name':_0x581344[_0x637c('0xb')],'strategy':_0x581344[_0x637c('0x23')],'answered':_0x581344[_0x637c('0x24')],'available':_0x581344[_0x637c('0x25')],'loggedIn':_0x581344[_0x637c('0x26')],'pTalking':_0x581344[_0x637c('0x27')],'sumBillable':_0x581344[_0x637c('0x28')],'sumDuration':_0x581344[_0x637c('0x29')],'sumHoldTime':_0x581344[_0x637c('0x2a')]||0x0,'talking':_0x581344['talking'],'total':_0x581344[_0x637c('0x2b')],'type':_0x581344[_0x637c('0x2c')],'unmanaged':_0x581344[_0x637c('0x2d')],'abandoned':_0x581344[_0x637c('0x2e')],'waiting':_0x581344[_0x637c('0x2f')],'loggedInDb':_0x581344[_0x637c('0x30')]};if(_0x581344['type']===_0x637c('0x31')){_0xd30648[_0x637c('0x32')]=_0x581344[_0x637c('0x32')];_0xd30648['dialMethod']=_0x581344['dialMethod'];_0xd30648[_0x637c('0x33')]=_0x581344[_0x637c('0x33')];_0xd30648[_0x637c('0x34')]=_0x581344[_0x637c('0x34')];_0xd30648['dialOriginateTimeout']=_0x581344[_0x637c('0x35')];_0xd30648[_0x637c('0x36')]=_0x581344[_0x637c('0x36')];_0xd30648[_0x637c('0x37')]=_0x581344['outboundAnswerAgiCallsDay'];_0xd30648[_0x637c('0x38')]=_0x581344[_0x637c('0x38')];_0xd30648[_0x637c('0x39')]=_0x581344[_0x637c('0x39')];_0xd30648[_0x637c('0x3a')]=_0x581344['outboundBusyCallsDay'];_0xd30648[_0x637c('0x3b')]=_0x581344[_0x637c('0x3b')];_0xd30648[_0x637c('0x3c')]=_0x581344[_0x637c('0x3c')];_0xd30648[_0x637c('0x3d')]=_0x581344['outboundDropCallsDayCallersExit'];_0xd30648[_0x637c('0x3e')]=_0x581344[_0x637c('0x3e')];_0xd30648['outboundNoAnswerCallsDay']=_0x581344[_0x637c('0x3f')];_0xd30648['outboundNoSuchCallsDay']=_0x581344[_0x637c('0x40')];_0xd30648[_0x637c('0x41')]=_0x581344[_0x637c('0x41')];_0xd30648[_0x637c('0x42')]=_0x581344[_0x637c('0x42')];_0xd30648[_0x637c('0x43')]=_0x581344['outboundRejectCallsDay'];_0xd30648[_0x637c('0x44')]=_0x581344['outboundUnknownCallsDay'];_0xd30648[_0x637c('0x45')]=_0x581344[_0x637c('0x45')];_0xd30648[_0x637c('0x46')]=_0x581344[_0x637c('0x46')];_0xd30648[_0x637c('0x47')]=_0x581344[_0x637c('0x47')];_0xd30648[_0x637c('0x48')]=_0x581344[_0x637c('0x48')];_0xd30648[_0x637c('0x49')]=_0x581344[_0x637c('0x49')];_0xd30648[_0x637c('0x4a')]=_0x581344[_0x637c('0x4a')];_0xd30648[_0x637c('0x4b')]=_0x581344[_0x637c('0x4b')];_0xd30648[_0x637c('0x4c')]=_0x581344[_0x637c('0x4c')];_0xd30648[_0x637c('0x4d')]=_0x581344[_0x637c('0x4d')];_0xd30648[_0x637c('0x4e')]=_0x581344['predictiveIntervalPauses'];_0xd30648['predictiveIntervalAvailable']=_0x581344[_0x637c('0x4f')];_0xd30648[_0x637c('0x50')]=_0x581344[_0x637c('0x50')];_0xd30648[_0x637c('0x18')]=_0x581344[_0x637c('0x18')];_0xd30648['originated']=_0x581344[_0x637c('0x51')];_0xd30648[_0x637c('0x52')]=_0x581344['erlangCalls'];_0xd30648[_0x637c('0x53')]=_0x581344[_0x637c('0x53')];_0xd30648['erlangAbandonmentRate']=_0x581344['erlangAbandonmentRate'];_0xd30648['erlangBusyFactor']=_0x581344[_0x637c('0x54')];_0xd30648['startPredictive']=_0x581344[_0x637c('0x55')];_0xd30648[_0x637c('0x56')]=_0x581344['startProgressive'];}if(_0x581344['Trunk']){_0xd30648[_0x637c('0x57')]={'id':_0x581344['Trunk']['id'],'name':_0x581344['Trunk']['name'],'active':_0x581344['Trunk'][_0x637c('0x58')],'callerid':_0x581344[_0x637c('0x57')][_0x637c('0x59')]};}if(_0x581344[_0x637c('0x5a')]){_0xd30648[_0x637c('0x5a')]={'id':_0x581344[_0x637c('0x5a')]['id'],'name':_0x581344[_0x637c('0x5a')]['name']};}_0x1fa3fa['push'](_0xd30648);}}_0x930b46({'count':_0x1fa3fa[_0x637c('0x5b')],'rows':_0x1fa3fa});});},'VoiceChannels':function(_0x1e5a90){return new Promise(function(_0x33559e,_0xbd10a){var _0x5162d4=_['values'](_0x1286bb[_0x637c('0x5c')]);_0x33559e({'count':_0x5162d4[_0x637c('0x5b')],'rows':_0x5162d4});});},'VoiceChannelMixMonitor':function(_0x1437ea){var _0x2f5ed1=this;return new Promise(function(_0x3ab9d6,_0x3079ec){if(ami[_0x637c('0x1a')]()==![]){return _0x3079ec(_0x2f5ed1[_0x637c('0x12')](0x1f4,[config[_0x637c('0x1b')]['ip'],config['asterisk'][_0x637c('0x13')],_0x637c('0x1c')][_0x637c('0x14')]('\x20')));}var _0x2ebb03=schema(properties['voicechannel'])['validate'](_0x1437ea);if(_0x2ebb03['length']>0x0){return _0x3079ec(_0x2f5ed1['error'](0x1f4,_[_0x637c('0x5d')](_0x2ebb03,_0x637c('0x18'))['join'](',\x20')));}var _0xb75632=_[_0x637c('0x5e')](_0x1286bb['channels'],{'uniqueid':_0x1437ea['uniqueid']});if(_0xb75632&&_0xb75632[_0x637c('0x5f')]){var _0x113ce9=util[_0x637c('0x8')](_0x637c('0x60'),_0x1437ea[_0x637c('0x61')]||_0x1437ea[_0x637c('0x62')],_0x1437ea[_0x637c('0x8')]||_0x637c('0x63'));return ami[_0x637c('0x20')]({'action':_0x637c('0x64'),'channel':_0xb75632['channel'],'file':_0x113ce9,'options':_0x637c('0x65')})['then'](function(_0x531c4c){var _0x1894f9=_[_0x637c('0x5e')](_0xb75632[_0x637c('0x66')],{'filename':_0x637c('0x67')+_0x113ce9[_0x637c('0x68')]()});if(_[_0x637c('0x69')](_0x1894f9)){_0xb75632[_0x637c('0x66')][_0x637c('0x6a')]({'filename':_0x637c('0x67')+_0x113ce9['toLowerCase'](),'createdAt':moment()[_0x637c('0x8')](_0x637c('0x6b')),'mixmonitorid':_0x531c4c['mixmonitorid'],'status':'rec'});}else{_0x1894f9[_0x637c('0x6c')]=_0x531c4c[_0x637c('0x6c')];_0x1894f9[_0x637c('0x6d')]=_0x637c('0x6e');}_0x3ab9d6({'code':0xc8,'message':[_0x1437ea[_0x637c('0x62')],_0x637c('0x6f'),_0x531c4c[_0x637c('0x6c')]]['join']('\x20'),'mixmonitorid':_0x531c4c[_0x637c('0x6c')]});})['catch'](function(_0x4cad47){_0x3079ec(_0x2f5ed1[_0x637c('0x12')](0x1f5,[_0x1437ea['uniqueid'],_0x4cad47[_0x637c('0x18')][_0x637c('0x68')]()][_0x637c('0x14')]('\x20')));});}else{return _0x3079ec(_0x2f5ed1[_0x637c('0x12')](0x1f5,_0x637c('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x49707f){var _0x11a7f0=this;return new Promise(function(_0x6acc1c,_0x1d6289){if(ami[_0x637c('0x1a')]()==![]){return _0x1d6289(_0x11a7f0[_0x637c('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x637c('0x1b')]['username'],_0x637c('0x1c')]['join']('\x20')));}var _0x242b02=schema(properties[_0x637c('0x71')])[_0x637c('0x72')](_0x49707f);if(_0x242b02[_0x637c('0x5b')]>0x0){return _0x1d6289(_0x11a7f0[_0x637c('0x12')](0x1f4,_['map'](_0x242b02,'message')[_0x637c('0x14')](',\x20')));}var _0x32eb0b=_[_0x637c('0x5e')](_0x1286bb['channels'],{'uniqueid':_0x49707f[_0x637c('0x62')]});if(_0x32eb0b){return BPromise[_0x637c('0x73')]()[_0x637c('0x17')](function(){if(_0x32eb0b[_0x637c('0x5f')]){return ami[_0x637c('0x20')]({'action':'StopMixMonitor','channel':_0x32eb0b[_0x637c('0x5f')],'mixmonitorid':_0x49707f[_0x637c('0x6c')]})['catch'](function(_0xad5bfe){});}})['then'](function(){if(_0x32eb0b[_0x637c('0x74')]){return ami[_0x637c('0x20')]({'action':_0x637c('0x75'),'channel':_0x32eb0b['destinationchannel'],'mixmonitorid':_0x49707f[_0x637c('0x6c')]})[_0x637c('0x19')](function(_0x1f21f8){});}})[_0x637c('0x17')](function(_0x156bc1){var _0x264e79=_[_0x637c('0x5e')](_0x32eb0b[_0x637c('0x66')],{'mixmonitorid':_0x49707f[_0x637c('0x6c')]});if(_0x264e79){_0x264e79[_0x637c('0x6d')]=_0x637c('0x76');}})[_0x637c('0x17')](function(){var _0x19fad1=util['format'](_0x637c('0x60'),_0x49707f[_0x637c('0x61')]||_0x49707f[_0x637c('0x62')],_0x49707f[_0x637c('0x8')]||_0x637c('0x63'));var _0x321458=_['find'](_0x32eb0b[_0x637c('0x66')],{'filename':'/var/spool/asterisk/monitor/'+_0x19fad1[_0x637c('0x68')]()});if(_0x321458){_0x321458[_0x637c('0x6d')]=_0x637c('0x76');}})['then'](function(){_0x6acc1c({'code':0xc8,'message':[_0x49707f[_0x637c('0x62')],_0x637c('0x77')]['join']('\x20')});})[_0x637c('0x19')](function(_0x435aa4){_0x1d6289(_0x11a7f0[_0x637c('0x12')](0x1f5,[_0x49707f['uniqueid'],_0x435aa4[_0x637c('0x18')]['toLowerCase']()]['join']('\x20')));});}else{return _0x1d6289(_0x11a7f0['error'](0x1f5,_0x637c('0x70')));}});},'VoiceQueuesChannels':function(_0x245113){return new Promise(function(_0x2bf8d3,_0x471edc){var _0x14c831=_[_0x637c('0x78')](_0x1286bb[_0x637c('0x79')]);_0x2bf8d3({'count':_0x14c831[_0x637c('0x5b')],'rows':_0x14c831});});},'VoiceQueuesChannel':function(_0x40077c){var _0x2b3317=this;return new Promise(function(_0xd0563c,_0xbf1d72){var _0x10c250=schema(properties[_0x637c('0x7a')])[_0x637c('0x72')](_0x40077c);if(_0x10c250['length']>0x0){return _0xbf1d72(_0x2b3317[_0x637c('0x12')](0x1f4,_[_0x637c('0x5d')](_0x10c250,_0x637c('0x18'))['join'](',\x20')));}var _0x274fd0=_[_0x637c('0x5e')](_0x1286bb[_0x637c('0x79')],{'uniqueid':_0x40077c[_0x637c('0x62')]});if(_0x274fd0){_0xd0563c(_0x274fd0);}else{return _0xbf1d72(_0x2b3317[_0x637c('0x12')](0x1f5,_0x637c('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x25b93a){var _0x5b2590=this;return new Promise(function(_0x1e8efa,_0xb56a22){if(ami[_0x637c('0x1a')]()==![]){return _0xb56a22(_0x5b2590[_0x637c('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x637c('0x1b')][_0x637c('0x13')],_0x637c('0x1c')][_0x637c('0x14')]('\x20')));}var _0x17eae6=schema(properties['voicequeuechannelhangup'])[_0x637c('0x72')](_0x25b93a);if(_0x17eae6[_0x637c('0x5b')]>0x0){return _0xb56a22(_0x5b2590[_0x637c('0x12')](0x1f4,_['map'](_0x17eae6,'message')['join'](',\x20')));}var _0x5ee182=_[_0x637c('0x5e')](_0x1286bb['queueChannels'],{'uniqueid':_0x25b93a['uniqueid']});if(_0x5ee182&&_0x5ee182[_0x637c('0x5f')]){return ami[_0x637c('0x20')]({'action':'Hangup','channel':_0x5ee182[_0x637c('0x5f')]})[_0x637c('0x17')](function(_0x4f76f6){_0x1e8efa({'code':0xc8,'message':[_0x25b93a[_0x637c('0x62')],_0x4f76f6[_0x637c('0x18')]['toLowerCase']()]['join']('\x20')});})[_0x637c('0x19')](function(_0x4c0c38){_0xb56a22(_0x5b2590['error'](0x1f5,[_0x25b93a[_0x637c('0x62')],_0x4c0c38[_0x637c('0x18')][_0x637c('0x68')]()][_0x637c('0x14')]('\x20')));});}else{return _0xb56a22(_0x5b2590[_0x637c('0x12')](0x1f5,_0x637c('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x2874f6){var _0x41c93e=this;return new Promise(function(_0x22d708,_0x4feed7){if(ami['isConnected']()==![]){return _0x4feed7(_0x41c93e[_0x637c('0x12')](0x1f4,[config[_0x637c('0x1b')]['ip'],config['asterisk'][_0x637c('0x13')],_0x637c('0x1c')][_0x637c('0x14')]('\x20')));}var _0x21169c=schema(properties['voicequeuechannelredirect'])['validate'](_0x2874f6);if(_0x21169c[_0x637c('0x5b')]>0x0){return _0x4feed7(_0x41c93e[_0x637c('0x12')](0x1f4,_[_0x637c('0x5d')](_0x21169c,_0x637c('0x18'))['join'](',\x20')));}var _0x1aaa2a=_[_0x637c('0x5e')](_0x1286bb[_0x637c('0x79')],{'uniqueid':_0x2874f6[_0x637c('0x62')]});if(_0x1aaa2a&&_0x1aaa2a[_0x637c('0x5f')]){return ami[_0x637c('0x20')]({'action':_0x637c('0x7b'),'channel':_0x1aaa2a[_0x637c('0x5f')],'exten':_0x2874f6['exten'],'context':_0x2874f6[_0x637c('0x7c')]||_0x1aaa2a[_0x637c('0x7c')],'priority':0x1})[_0x637c('0x17')](function(_0x352a33){_0x22d708({'code':0xc8,'message':[_0x2874f6[_0x637c('0x62')],_0x352a33['message'][_0x637c('0x68')]()][_0x637c('0x14')]('\x20')});})[_0x637c('0x19')](function(_0x55b6e4){_0x4feed7(_0x41c93e['error'](0x1f5,[_0x2874f6[_0x637c('0x62')],_0x55b6e4['message'][_0x637c('0x68')]()][_0x637c('0x14')]('\x20')));});}else{return _0x4feed7(_0x41c93e[_0x637c('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x143fb2){return new Promise(function(_0x1b1b94,_0x5e4bc7){var _0x505f3c=_['values'](_0x1286bb[_0x637c('0xe')]);_0x1b1b94({'count':_0x505f3c[_0x637c('0x5b')],'rows':_0x505f3c});});},'Telephones':function(_0x2dcebc){return new Promise(function(_0x8a4698,_0x2e9fbb){var _0x3405f6=_[_0x637c('0x78')](_0x1286bb[_0x637c('0x7d')]);_0x8a4698({'count':_0x3405f6[_0x637c('0x5b')],'rows':_0x3405f6});});},'Trunks':function(_0x95aa4e){return new Promise(function(_0x1ae17f,_0x527eed){var _0x5ead1e=_[_0x637c('0x78')](_0x1286bb['trunks']);_0x1ae17f({'count':_0x5ead1e[_0x637c('0x5b')],'rows':_0x5ead1e});});},'OutboundChannels':function(_0x1d0b26){return new Promise(function(_0x5a82b4,_0xdd2d1e){var _0x38514a=_[_0x637c('0x78')](_0x1286bb[_0x637c('0x7e')]);_0x5a82b4({'count':_0x38514a[_0x637c('0x5b')],'rows':_0x38514a});});},'Outbound':function(_0x4a0c46){return new Promise(function(_0x12d199,_0x128566){_0x12d199(_0x1286bb[_0x637c('0x31')]);});},'Campaigns':function(_0x32fc85){return new Promise(function(_0x2c4b7d,_0x14c405){var _0x53387f=_[_0x637c('0x78')](_0x1286bb['campaigns']);_0x2c4b7d({'count':_0x53387f[_0x637c('0x5b')],'rows':_0x53387f});});},'VoiceQueuesPreview':function(_0x42fb80){var _0x34bde3=this;return new Promise(function(_0x2669ad,_0x3aad1a){_0xca42e8[_0x637c('0x7f')](_0x42fb80['id'])[_0x637c('0x17')](function(_0x282e4f){_0x2669ad({'code':0xc8,'message':_0x282e4f['message']});})[_0x637c('0x19')](function(_0x3938fd){_0x3aad1a(_0x34bde3[_0x637c('0x12')](0x1f4,_0x3938fd[_0x637c('0x18')]));});});},'EventManager':function(_0x1388ca){var _0x3f1eac=this;return new Promise(function(_0x1e8304,_0x2c5494){if(!_0x1388ca[_0x637c('0x80')]){return _0x2c5494(_0x3f1eac[_0x637c('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x637c('0x81')]('custom:'+_0x1388ca[_0x637c('0x80')],_0x1388ca[_0x637c('0x18')]);_0x1e8304({'code':0xc8,'message':_0x1388ca});});},'FaxAccounts':function(_0xc33e58){return new Promise(function(_0x50b8c1,_0x30dfad){var _0x331c5a=_['values'](_0x1286bb[_0x637c('0x82')]);_0x50b8c1({'count':_0x331c5a['length'],'rows':_0x331c5a});});},'SendFax':function(_0x3fc966){var _0x537a90=this;return new Promise(function(_0x482912,_0x252294){_0x36943f['send'](_0x3fc966)[_0x637c('0x17')](function(_0x40c02c){_0x482912({'code':0xc8,'message':_0x40c02c[_0x637c('0x18')]});})[_0x637c('0x19')](function(_0x4d3b21){_0x252294(_0x537a90[_0x637c('0x12')](0x1f4,_0x4d3b21['message']));});});},'CheckAfterSend':function(_0x4c6af7){var _0x396886=this;return new Promise(function(_0x4ce5b9,_0x95c157){_0x36943f[_0x637c('0x83')](_0x4c6af7)[_0x637c('0x17')](function(_0x333298){_0x4ce5b9({'code':0xc8,'message':_0x333298[_0x637c('0x18')]});})[_0x637c('0x19')](function(_0x35df2b){_0x95c157(_0x396886[_0x637c('0x12')](0x1f4,_0x35df2b[_0x637c('0x18')]));});});}};var _0x5880e8=jayson[_0x637c('0x84')](_0x556d75)['http']();_0x5880e8['on'](_0x637c('0x12'),function(_0x2626b){return _0x95cfaa(_0x2626b);});_0x5880e8['listen'](0x232a,'127.0.0.1',function(){console[_0x637c('0x85')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1b97c3(_0x637c('0x86')+0x232a);});});}; \ No newline at end of file +var _0xdd6c=['command','Command','content','voiceQueues','hasOwnProperty','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','push','length','values','channels','validate','map','uniqueid','format','%s.%s','filename','MixMonitor','channel','monitors','isNil','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','wav','find','/var/spool/asterisk/monitor/','toLowerCase','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','module','action','Reload','Action','then','message','catch','join','pick'];(function(_0x43c38e,_0x363fd9){var _0x1e84ed=function(_0x33ce1f){while(--_0x33ce1f){_0x43c38e['push'](_0x43c38e['shift']());}};_0x1e84ed(++_0x363fd9);}(_0xdd6c,0x16c));var _0xcdd6=function(_0x248d91,_0x366668){_0x248d91=_0x248d91-0x0;var _0x316dcb=_0xdd6c[_0x248d91];return _0x316dcb;};'use strict';var _=require('lodash');var util=require(_0xcdd6('0x0'));var jayson=require(_0xcdd6('0x1'));var schema=require('validate');var BPromise=require(_0xcdd6('0x2'));var moment=require(_0xcdd6('0x3'));var config=require(_0xcdd6('0x4'));var properties=require(_0xcdd6('0x5'));var ami=require(_0xcdd6('0x6'));exports[_0xcdd6('0x7')]=function(_0x32da92,_0x34a33d,_0x5aabfd){return new BPromise(function(_0x495996,_0x232211){var _0x484e8e={'QueuePause':function(_0x1cf00d){return new Promise(function(_0x3339c5,_0x2b4280){var _0x4f0115=util['format'](_0xcdd6('0x8'),_0xcdd6('0x9'),_0x1cf00d[_0xcdd6('0xa')]);if(_0x32da92['timers']&&_0x32da92[_0xcdd6('0xb')][_0x4f0115]&&_0x32da92[_0xcdd6('0xb')][_0x4f0115]['timer']){_0x32da92[_0xcdd6('0xb')][_0x4f0115]['updateAcw']();}if(_0x32da92[_0xcdd6('0xc')][_0x4f0115]){_0x32da92['agents'][_0x4f0115][_0xcdd6('0xd')]({'statePause':_0x1cf00d[_0xcdd6('0xe')]?!![]:![]});}_0x3339c5({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x5e17cc){var _0x269f39=this;return new Promise(function(_0x2ebbf0,_0x9bc045){if(ami[_0xcdd6('0xf')]()==![]){return _0x9bc045(_0x269f39[_0xcdd6('0x10')](0x1f4,[config[_0xcdd6('0x11')]['ip'],config[_0xcdd6('0x11')][_0xcdd6('0x12')],_0xcdd6('0x13')]['join']('\x20')));}_0x5e17cc=_['pick'](_0x5e17cc,_['keys'](properties[_0xcdd6('0x14')]));_0x5e17cc[_0xcdd6('0x15')]=_0xcdd6('0x16');return ami[_0xcdd6('0x17')](_0x5e17cc)[_0xcdd6('0x18')](function(_0x37b3d7){_0x2ebbf0({'code':0xc8,'message':_0x37b3d7[_0xcdd6('0x19')]});})[_0xcdd6('0x1a')](function(_0x3eee8a){_0x9bc045(_0x269f39[_0xcdd6('0x10')](0x1f5,_0x3eee8a[_0xcdd6('0x19')]));});});},'Command':function(_0x2e66d3){var _0x15c5f4=this;return new Promise(function(_0x4481fc,_0x290606){if(ami['isConnected']()==![]){return _0x290606(_0x15c5f4['error'](0x1f4,[config[_0xcdd6('0x11')]['ip'],config['asterisk']['username'],_0xcdd6('0x13')][_0xcdd6('0x1b')]('\x20')));}_0x2e66d3=_[_0xcdd6('0x1c')](_0x2e66d3,_0xcdd6('0x1d'));_0x2e66d3['action']=_0xcdd6('0x1e');return ami[_0xcdd6('0x17')](_0x2e66d3)['then'](function(_0x38f02a){_0x4481fc({'code':0xc8,'message':_0x38f02a[_0xcdd6('0x1f')]});})[_0xcdd6('0x1a')](function(_0x1407d0){_0x290606(_0x15c5f4[_0xcdd6('0x10')](0x1f5,_0x1407d0[_0xcdd6('0x19')]));});});},'VoiceQueues':function(_0x2b8b44){return new Promise(function(_0x3bd816,_0x11368d){var _0x47cbc3=[];for(var _0x37dee8 in _0x32da92[_0xcdd6('0x20')]){if(_0x32da92[_0xcdd6('0x20')][_0xcdd6('0x21')](_0x37dee8)){var _0x1f8b99=_0x32da92['voiceQueues'][_0x37dee8];var _0x5c5d8b={'id':_0x1f8b99['id'],'name':_0x1f8b99[_0xcdd6('0xa')],'strategy':_0x1f8b99['strategy'],'answered':_0x1f8b99[_0xcdd6('0x22')],'available':_0x1f8b99[_0xcdd6('0x23')],'loggedIn':_0x1f8b99[_0xcdd6('0x24')],'pTalking':_0x1f8b99[_0xcdd6('0x25')],'sumBillable':_0x1f8b99[_0xcdd6('0x26')],'sumDuration':_0x1f8b99[_0xcdd6('0x27')],'sumHoldTime':_0x1f8b99[_0xcdd6('0x28')]||0x0,'talking':_0x1f8b99['talking'],'total':_0x1f8b99[_0xcdd6('0x29')],'type':_0x1f8b99['type'],'unmanaged':_0x1f8b99[_0xcdd6('0x2a')],'abandoned':_0x1f8b99[_0xcdd6('0x2b')],'waiting':_0x1f8b99[_0xcdd6('0x2c')],'loggedInDb':_0x1f8b99['loggedInDb']};if(_0x1f8b99[_0xcdd6('0x2d')]===_0xcdd6('0x2e')){_0x5c5d8b[_0xcdd6('0x2f')]=_0x1f8b99[_0xcdd6('0x2f')];_0x5c5d8b[_0xcdd6('0x30')]=_0x1f8b99[_0xcdd6('0x30')];_0x5c5d8b[_0xcdd6('0x31')]=_0x1f8b99['dialOriginateCallerIdName'];_0x5c5d8b[_0xcdd6('0x32')]=_0x1f8b99['dialOriginateCallerIdNumber'];_0x5c5d8b['dialOriginateTimeout']=_0x1f8b99[_0xcdd6('0x33')];_0x5c5d8b[_0xcdd6('0x34')]=_0x1f8b99[_0xcdd6('0x34')];_0x5c5d8b[_0xcdd6('0x35')]=_0x1f8b99['outboundAnswerAgiCallsDay'];_0x5c5d8b[_0xcdd6('0x36')]=_0x1f8b99[_0xcdd6('0x36')];_0x5c5d8b[_0xcdd6('0x37')]=_0x1f8b99[_0xcdd6('0x37')];_0x5c5d8b['outboundBusyCallsDay']=_0x1f8b99['outboundBusyCallsDay'];_0x5c5d8b[_0xcdd6('0x38')]=_0x1f8b99[_0xcdd6('0x38')];_0x5c5d8b[_0xcdd6('0x39')]=_0x1f8b99[_0xcdd6('0x39')];_0x5c5d8b['outboundDropCallsDayCallersExit']=_0x1f8b99[_0xcdd6('0x3a')];_0x5c5d8b[_0xcdd6('0x3b')]=_0x1f8b99[_0xcdd6('0x3b')];_0x5c5d8b[_0xcdd6('0x3c')]=_0x1f8b99['outboundNoAnswerCallsDay'];_0x5c5d8b[_0xcdd6('0x3d')]=_0x1f8b99['outboundNoSuchCallsDay'];_0x5c5d8b[_0xcdd6('0x3e')]=_0x1f8b99[_0xcdd6('0x3e')];_0x5c5d8b[_0xcdd6('0x3f')]=_0x1f8b99['outboundReCallsDay'];_0x5c5d8b[_0xcdd6('0x40')]=_0x1f8b99[_0xcdd6('0x40')];_0x5c5d8b[_0xcdd6('0x41')]=_0x1f8b99[_0xcdd6('0x41')];_0x5c5d8b[_0xcdd6('0x42')]=_0x1f8b99[_0xcdd6('0x42')];_0x5c5d8b[_0xcdd6('0x43')]=_0x1f8b99['predictiveIntervalAvgHoldtime'];_0x5c5d8b['predictiveIntervalAvgTalktime']=_0x1f8b99[_0xcdd6('0x44')];_0x5c5d8b[_0xcdd6('0x45')]=_0x1f8b99[_0xcdd6('0x45')];_0x5c5d8b[_0xcdd6('0x46')]=_0x1f8b99[_0xcdd6('0x46')];_0x5c5d8b[_0xcdd6('0x47')]=_0x1f8b99[_0xcdd6('0x47')];_0x5c5d8b[_0xcdd6('0x48')]=_0x1f8b99['predictiveIntervalErlangCallsDroppedCalls'];_0x5c5d8b[_0xcdd6('0x49')]=_0x1f8b99[_0xcdd6('0x49')];_0x5c5d8b[_0xcdd6('0x4a')]=_0x1f8b99[_0xcdd6('0x4a')];_0x5c5d8b['predictiveIntervalPauses']=_0x1f8b99['predictiveIntervalPauses'];_0x5c5d8b[_0xcdd6('0x4b')]=_0x1f8b99['predictiveIntervalAvailable'];_0x5c5d8b['predictiveIntervalTotalCalls']=_0x1f8b99['predictiveIntervalTotalCalls'];_0x5c5d8b[_0xcdd6('0x19')]=_0x1f8b99[_0xcdd6('0x19')];_0x5c5d8b[_0xcdd6('0x4c')]=_0x1f8b99[_0xcdd6('0x4c')];_0x5c5d8b[_0xcdd6('0x4d')]=_0x1f8b99['erlangCalls'];_0x5c5d8b[_0xcdd6('0x4e')]=_0x1f8b99[_0xcdd6('0x4e')];_0x5c5d8b['erlangAbandonmentRate']=_0x1f8b99[_0xcdd6('0x4f')];_0x5c5d8b[_0xcdd6('0x50')]=_0x1f8b99[_0xcdd6('0x50')];_0x5c5d8b[_0xcdd6('0x51')]=_0x1f8b99[_0xcdd6('0x51')];_0x5c5d8b['startProgressive']=_0x1f8b99['startProgressive'];}if(_0x1f8b99[_0xcdd6('0x52')]){_0x5c5d8b[_0xcdd6('0x52')]={'id':_0x1f8b99[_0xcdd6('0x52')]['id'],'name':_0x1f8b99[_0xcdd6('0x52')][_0xcdd6('0xa')],'active':_0x1f8b99['Trunk'][_0xcdd6('0x53')],'callerid':_0x1f8b99[_0xcdd6('0x52')][_0xcdd6('0x54')]};}if(_0x1f8b99[_0xcdd6('0x55')]){_0x5c5d8b['Interval']={'id':_0x1f8b99[_0xcdd6('0x55')]['id'],'name':_0x1f8b99[_0xcdd6('0x55')][_0xcdd6('0xa')]};}_0x47cbc3[_0xcdd6('0x56')](_0x5c5d8b);}}_0x3bd816({'count':_0x47cbc3[_0xcdd6('0x57')],'rows':_0x47cbc3});});},'VoiceChannels':function(_0x376832){return new Promise(function(_0x495d43,_0x505bb7){var _0x47d480=_[_0xcdd6('0x58')](_0x32da92[_0xcdd6('0x59')]);_0x495d43({'count':_0x47d480[_0xcdd6('0x57')],'rows':_0x47d480});});},'VoiceChannelMixMonitor':function(_0x33d295){var _0x16cfa8=this;return new Promise(function(_0x5663bb,_0x536fee){if(ami['isConnected']()==![]){return _0x536fee(_0x16cfa8['error'](0x1f4,[config[_0xcdd6('0x11')]['ip'],config['asterisk'][_0xcdd6('0x12')],_0xcdd6('0x13')][_0xcdd6('0x1b')]('\x20')));}var _0x401904=schema(properties['voicechannel'])[_0xcdd6('0x5a')](_0x33d295);if(_0x401904[_0xcdd6('0x57')]>0x0){return _0x536fee(_0x16cfa8[_0xcdd6('0x10')](0x1f4,_[_0xcdd6('0x5b')](_0x401904,_0xcdd6('0x19'))[_0xcdd6('0x1b')](',\x20')));}var _0x5e590b=_['find'](_0x32da92[_0xcdd6('0x59')],{'uniqueid':_0x33d295[_0xcdd6('0x5c')]});if(_0x5e590b&&_0x5e590b['channel']){var _0x5526f4=util[_0xcdd6('0x5d')](_0xcdd6('0x5e'),_0x33d295[_0xcdd6('0x5f')]||_0x33d295[_0xcdd6('0x5c')],_0x33d295[_0xcdd6('0x5d')]||'wav');return ami[_0xcdd6('0x17')]({'action':_0xcdd6('0x60'),'channel':_0x5e590b[_0xcdd6('0x61')],'file':_0x5526f4,'options':'ai(mixmonitorid)'})[_0xcdd6('0x18')](function(_0x19b998){var _0x212bbc=_['find'](_0x5e590b[_0xcdd6('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x5526f4['toLowerCase']()});if(_[_0xcdd6('0x63')](_0x212bbc)){_0x5e590b[_0xcdd6('0x62')][_0xcdd6('0x56')]({'filename':'/var/spool/asterisk/monitor/'+_0x5526f4['toLowerCase'](),'createdAt':moment()[_0xcdd6('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x19b998[_0xcdd6('0x64')],'status':'rec'});}else{_0x212bbc[_0xcdd6('0x64')]=_0x19b998[_0xcdd6('0x64')];_0x212bbc['status']='rec';}_0x5663bb({'code':0xc8,'message':[_0x33d295[_0xcdd6('0x5c')],_0xcdd6('0x65'),_0x19b998['mixmonitorid']][_0xcdd6('0x1b')]('\x20'),'mixmonitorid':_0x19b998[_0xcdd6('0x64')]});})[_0xcdd6('0x1a')](function(_0x29324b){_0x536fee(_0x16cfa8[_0xcdd6('0x10')](0x1f5,[_0x33d295['uniqueid'],_0x29324b['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x536fee(_0x16cfa8[_0xcdd6('0x10')](0x1f5,_0xcdd6('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x199ad7){var _0x2392c9=this;return new Promise(function(_0x2332bb,_0x1ad00b){if(ami[_0xcdd6('0xf')]()==![]){return _0x1ad00b(_0x2392c9[_0xcdd6('0x10')](0x1f4,[config[_0xcdd6('0x11')]['ip'],config[_0xcdd6('0x11')][_0xcdd6('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x5296a3=schema(properties['voicechannel'])['validate'](_0x199ad7);if(_0x5296a3['length']>0x0){return _0x1ad00b(_0x2392c9[_0xcdd6('0x10')](0x1f4,_['map'](_0x5296a3,_0xcdd6('0x19'))[_0xcdd6('0x1b')](',\x20')));}var _0x3f357b=_['find'](_0x32da92[_0xcdd6('0x59')],{'uniqueid':_0x199ad7[_0xcdd6('0x5c')]});if(_0x3f357b){return BPromise['resolve']()[_0xcdd6('0x18')](function(){if(_0x3f357b['channel']){return ami[_0xcdd6('0x17')]({'action':_0xcdd6('0x67'),'channel':_0x3f357b[_0xcdd6('0x61')],'mixmonitorid':_0x199ad7[_0xcdd6('0x64')]})[_0xcdd6('0x1a')](function(_0xc9bd06){});}})['then'](function(){if(_0x3f357b[_0xcdd6('0x68')]){return ami['Action']({'action':_0xcdd6('0x67'),'channel':_0x3f357b[_0xcdd6('0x68')],'mixmonitorid':_0x199ad7[_0xcdd6('0x64')]})['catch'](function(_0x2b0723){});}})[_0xcdd6('0x18')](function(_0x4bd084){var _0x48380f=_['find'](_0x3f357b['monitors'],{'mixmonitorid':_0x199ad7[_0xcdd6('0x64')]});if(_0x48380f){_0x48380f['status']=_0xcdd6('0x69');}})[_0xcdd6('0x18')](function(){var _0x2d9e81=util[_0xcdd6('0x5d')]('%s.%s',_0x199ad7[_0xcdd6('0x5f')]||_0x199ad7['uniqueid'],_0x199ad7[_0xcdd6('0x5d')]||_0xcdd6('0x6a'));var _0x1b23f9=_[_0xcdd6('0x6b')](_0x3f357b[_0xcdd6('0x62')],{'filename':_0xcdd6('0x6c')+_0x2d9e81[_0xcdd6('0x6d')]()});if(_0x1b23f9){_0x1b23f9['status']=_0xcdd6('0x69');}})['then'](function(){_0x2332bb({'code':0xc8,'message':[_0x199ad7[_0xcdd6('0x5c')],_0xcdd6('0x6e')]['join']('\x20')});})['catch'](function(_0x175673){_0x1ad00b(_0x2392c9[_0xcdd6('0x10')](0x1f5,[_0x199ad7['uniqueid'],_0x175673[_0xcdd6('0x19')][_0xcdd6('0x6d')]()][_0xcdd6('0x1b')]('\x20')));});}else{return _0x1ad00b(_0x2392c9[_0xcdd6('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x416bfe){return new Promise(function(_0x42d261,_0x6ec10c){var _0x443136=_['values'](_0x32da92[_0xcdd6('0x6f')]);_0x42d261({'count':_0x443136['length'],'rows':_0x443136});});},'VoiceQueuesChannel':function(_0x5c95f4){var _0x8746df=this;return new Promise(function(_0x3c151d,_0xbfedb4){var _0x2d304=schema(properties[_0xcdd6('0x70')])[_0xcdd6('0x5a')](_0x5c95f4);if(_0x2d304[_0xcdd6('0x57')]>0x0){return _0xbfedb4(_0x8746df[_0xcdd6('0x10')](0x1f4,_[_0xcdd6('0x5b')](_0x2d304,'message')['join'](',\x20')));}var _0x5a7afd=_[_0xcdd6('0x6b')](_0x32da92[_0xcdd6('0x6f')],{'uniqueid':_0x5c95f4[_0xcdd6('0x5c')]});if(_0x5a7afd){_0x3c151d(_0x5a7afd);}else{return _0xbfedb4(_0x8746df[_0xcdd6('0x10')](0x1f5,_0xcdd6('0x66')));}});},'VoiceQueuesChannelHangup':function(_0x297d9d){var _0x473912=this;return new Promise(function(_0xe30fc9,_0x482e2e){if(ami[_0xcdd6('0xf')]()==![]){return _0x482e2e(_0x473912[_0xcdd6('0x10')](0x1f4,[config[_0xcdd6('0x11')]['ip'],config[_0xcdd6('0x11')][_0xcdd6('0x12')],_0xcdd6('0x13')][_0xcdd6('0x1b')]('\x20')));}var _0x4ea848=schema(properties[_0xcdd6('0x71')])['validate'](_0x297d9d);if(_0x4ea848['length']>0x0){return _0x482e2e(_0x473912[_0xcdd6('0x10')](0x1f4,_['map'](_0x4ea848,_0xcdd6('0x19'))[_0xcdd6('0x1b')](',\x20')));}var _0x41ed70=_['find'](_0x32da92[_0xcdd6('0x6f')],{'uniqueid':_0x297d9d['uniqueid']});if(_0x41ed70&&_0x41ed70[_0xcdd6('0x61')]){return ami[_0xcdd6('0x17')]({'action':'Hangup','channel':_0x41ed70[_0xcdd6('0x61')]})[_0xcdd6('0x18')](function(_0xd46929){_0xe30fc9({'code':0xc8,'message':[_0x297d9d['uniqueid'],_0xd46929['message'][_0xcdd6('0x6d')]()][_0xcdd6('0x1b')]('\x20')});})[_0xcdd6('0x1a')](function(_0x4302d3){_0x482e2e(_0x473912['error'](0x1f5,[_0x297d9d['uniqueid'],_0x4302d3[_0xcdd6('0x19')][_0xcdd6('0x6d')]()]['join']('\x20')));});}else{return _0x482e2e(_0x473912[_0xcdd6('0x10')](0x1f5,_0xcdd6('0x66')));}});},'VoiceQueuesChannelRedirect':function(_0x388d5f){var _0x16925c=this;return new Promise(function(_0x532fe2,_0x4650ca){if(ami[_0xcdd6('0xf')]()==![]){return _0x4650ca(_0x16925c[_0xcdd6('0x10')](0x1f4,[config[_0xcdd6('0x11')]['ip'],config['asterisk']['username'],_0xcdd6('0x13')][_0xcdd6('0x1b')]('\x20')));}var _0x15a4b9=schema(properties[_0xcdd6('0x72')])[_0xcdd6('0x5a')](_0x388d5f);if(_0x15a4b9[_0xcdd6('0x57')]>0x0){return _0x4650ca(_0x16925c['error'](0x1f4,_[_0xcdd6('0x5b')](_0x15a4b9,_0xcdd6('0x19'))[_0xcdd6('0x1b')](',\x20')));}var _0x1dfa5e=_[_0xcdd6('0x6b')](_0x32da92[_0xcdd6('0x6f')],{'uniqueid':_0x388d5f[_0xcdd6('0x5c')]});if(_0x1dfa5e&&_0x1dfa5e['channel']){return ami[_0xcdd6('0x17')]({'action':_0xcdd6('0x73'),'channel':_0x1dfa5e['channel'],'exten':_0x388d5f[_0xcdd6('0x74')],'context':_0x388d5f[_0xcdd6('0x75')]||_0x1dfa5e[_0xcdd6('0x75')],'priority':0x1})[_0xcdd6('0x18')](function(_0x5619d9){_0x532fe2({'code':0xc8,'message':[_0x388d5f[_0xcdd6('0x5c')],_0x5619d9[_0xcdd6('0x19')]['toLowerCase']()]['join']('\x20')});})[_0xcdd6('0x1a')](function(_0x588420){_0x4650ca(_0x16925c[_0xcdd6('0x10')](0x1f5,[_0x388d5f[_0xcdd6('0x5c')],_0x588420['message'][_0xcdd6('0x6d')]()]['join']('\x20')));});}else{return _0x4650ca(_0x16925c['error'](0x1f5,_0xcdd6('0x66')));}});},'Agents':function(_0x984887){return new Promise(function(_0x24824e,_0x341a3b){var _0x4de978=_['values'](_0x32da92['agents']);_0x24824e({'count':_0x4de978[_0xcdd6('0x57')],'rows':_0x4de978});});},'Telephones':function(_0x1dbaab){return new Promise(function(_0x5f331e,_0x544352){var _0x2e811f=_[_0xcdd6('0x58')](_0x32da92['telephones']);_0x5f331e({'count':_0x2e811f[_0xcdd6('0x57')],'rows':_0x2e811f});});},'Trunks':function(_0x3031b5){return new Promise(function(_0x53d2a5,_0x1fd45d){var _0x48eb63=_[_0xcdd6('0x58')](_0x32da92[_0xcdd6('0x76')]);_0x53d2a5({'count':_0x48eb63[_0xcdd6('0x57')],'rows':_0x48eb63});});},'OutboundChannels':function(_0xa13647){return new Promise(function(_0x4e3649,_0x422fac){var _0x1f89fe=_['values'](_0x32da92[_0xcdd6('0x77')]);_0x4e3649({'count':_0x1f89fe[_0xcdd6('0x57')],'rows':_0x1f89fe});});},'Outbound':function(_0x3c5fb5){return new Promise(function(_0x21ea56,_0x497b71){_0x21ea56(_0x32da92[_0xcdd6('0x2e')]);});},'Campaigns':function(_0x19f46d){return new Promise(function(_0x3535e1,_0x8f93c3){var _0x4e9718=_[_0xcdd6('0x58')](_0x32da92[_0xcdd6('0x78')]);_0x3535e1({'count':_0x4e9718[_0xcdd6('0x57')],'rows':_0x4e9718});});},'VoiceQueuesPreview':function(_0x13ca91){var _0x23a489=this;return new Promise(function(_0x53cd1,_0x34ccb2){_0x34a33d[_0xcdd6('0x79')](_0x13ca91['id'])[_0xcdd6('0x18')](function(_0x10dcc6){_0x53cd1({'code':0xc8,'message':_0x10dcc6[_0xcdd6('0x19')]});})['catch'](function(_0x3a1d69){_0x34ccb2(_0x23a489[_0xcdd6('0x10')](0x1f4,_0x3a1d69[_0xcdd6('0x19')]));});});},'EventManager':function(_0x22810e){var _0x464103=this;return new Promise(function(_0x25864e,_0x28e1ef){if(!_0x22810e[_0xcdd6('0x7a')]){return _0x28e1ef(_0x464103[_0xcdd6('0x10')](0x1f4,_0xcdd6('0x7b')));}ami[_0xcdd6('0x7c')](_0xcdd6('0x7d')+_0x22810e[_0xcdd6('0x7a')],_0x22810e[_0xcdd6('0x19')]);_0x25864e({'code':0xc8,'message':_0x22810e});});},'FaxAccounts':function(_0x30461a){return new Promise(function(_0xde8b6e,_0x2501b9){var _0x252900=_[_0xcdd6('0x58')](_0x32da92[_0xcdd6('0x7e')]);_0xde8b6e({'count':_0x252900['length'],'rows':_0x252900});});},'SendFax':function(_0x54081b){var _0x446f1b=this;return new Promise(function(_0x28438f,_0x183f02){_0x5aabfd['send'](_0x54081b)[_0xcdd6('0x18')](function(_0x3cf257){_0x28438f({'code':0xc8,'message':_0x3cf257['message']});})['catch'](function(_0xe2fe4f){_0x183f02(_0x446f1b[_0xcdd6('0x10')](0x1f4,_0xe2fe4f['message']));});});},'CheckAfterSend':function(_0x2a17ae){var _0x3769fd=this;return new Promise(function(_0x4c6890,_0x38a534){_0x5aabfd['checkAfterSend'](_0x2a17ae)['then'](function(_0x3cd236){_0x4c6890({'code':0xc8,'message':_0x3cd236[_0xcdd6('0x19')]});})[_0xcdd6('0x1a')](function(_0xbd8fbb){_0x38a534(_0x3769fd[_0xcdd6('0x10')](0x1f4,_0xbd8fbb[_0xcdd6('0x19')]));});});}};var _0x1b12d6=jayson[_0xcdd6('0x7f')](_0x484e8e)[_0xcdd6('0x80')]();_0x1b12d6['on'](_0xcdd6('0x10'),function(_0x32ec59){return _0x232211(_0x32ec59);});_0x1b12d6[_0xcdd6('0x7')](0x232a,'127.0.0.1',function(){console['log'](_0xcdd6('0x81'),0x232a);return _0x495996(_0xcdd6('0x82')+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 4018006..248dbcb 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 _0xc2c7=['showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','merge','createContact','action','toLowerCase','catch','error','Error\x20creating\x20contact','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','phone','resolve','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4afa3d,_0x32c09c){_0x4afa3d=_0x4afa3d-0x0;var _0x49ef1e=_0xc2c7[_0x4afa3d];return _0x49ef1e;};'use strict';var BPromise=require('bluebird');var util=require(_0x7c2c('0x0'));var _=require(_0x7c2c('0x1'));var Redis=require(_0x7c2c('0x2'));var config=require(_0x7c2c('0x3'));var logger=require(_0x7c2c('0x4'))(_0x7c2c('0x5'));var cmContactRpc=require(_0x7c2c('0x6'));config[_0x7c2c('0x7')]=_['defaults'](config['redis'],{'host':_0x7c2c('0x8'),'port':0x18eb});var io=require(_0x7c2c('0x9'))(new Redis(config[_0x7c2c('0x7')]));function emit(_0x54f027,_0x4abe93,_0x5a1027){logger[_0x7c2c('0xa')](_0x54f027,_0x4abe93,JSON[_0x7c2c('0xb')](_0x5a1027));io['to'](_0x54f027)[_0x7c2c('0xc')](_0x4abe93,_0x5a1027);}exports[_0x7c2c('0xd')]=function(_0x279cff,_0x57b107,_0x3093d2){_0x3093d2[_0x7c2c('0xe')]=0x0;if(_0x57b107[_0x7c2c('0xf')]&&parseInt(_0x57b107[_0x7c2c('0xf')],0xa)){var _0x2587ec={'ListId':parseInt(_0x57b107[_0x7c2c('0x10')],0xa),'phone':_0x3093d2[_0x7c2c('0x11')]};if(_[_0x7c2c('0x12')](_0x3093d2[_0x7c2c('0x13')])){_0x2587ec[_0x7c2c('0x14')]=_0x3093d2[_0x7c2c('0x15')]&&_0x3093d2[_0x7c2c('0x15')]!==_0x7c2c('0x16')?_0x3093d2[_0x7c2c('0x15')]:_0x3093d2[_0x7c2c('0x11')]||_0x3093d2[_0x7c2c('0x17')];}else{_0x2587ec['firstName']=_0x3093d2['destcalleridname']&&_0x3093d2[_0x7c2c('0x18')]!==_0x7c2c('0x16')?_0x3093d2[_0x7c2c('0x18')]:_0x3093d2['destcalleridnum']||_0x3093d2[_0x7c2c('0x17')];_0x2587ec[_0x7c2c('0x19')]=_0x3093d2['destcalleridname']&&_0x3093d2[_0x7c2c('0x18')]!==''?_0x3093d2[_0x7c2c('0x18')]:_0x3093d2['destcalleridnum']||_0x3093d2[_0x7c2c('0x17')];}BPromise[_0x7c2c('0x1a')]()[_0x7c2c('0x1b')](cmContactRpc[_0x7c2c('0x1c')]({'where':_[_0x7c2c('0x1d')](_0x2587ec,[_0x7c2c('0x14')])}))[_0x7c2c('0x1b')](function(_0x1ce7e1){if(_0x1ce7e1){_0x3093d2[_0x7c2c('0x1e')]=_0x1ce7e1['id'];emit(util[_0x7c2c('0x1f')](_0x7c2c('0x20'),_0x279cff[_0x7c2c('0x21')]),util['format'](_0x7c2c('0x22'),_0x57b107['action']['toLowerCase']()),_[_0x7c2c('0x23')](_0x3093d2,{'ListId':parseInt(_0x57b107[_0x7c2c('0x10')],0xa)}));return;}else{return BPromise[_0x7c2c('0x1a')]()[_0x7c2c('0x1b')](cmContactRpc[_0x7c2c('0x24')](_0x2587ec));}})[_0x7c2c('0x1b')](function(_0xa84620){if(_0xa84620){_0x3093d2['xmd-contactid2']=_0xa84620['id'];emit(util[_0x7c2c('0x1f')]('user:%s',_0x279cff[_0x7c2c('0x21')]),util['format'](_0x7c2c('0x22'),_0x57b107[_0x7c2c('0x25')][_0x7c2c('0x26')]()),_['merge'](_0x3093d2,{'ListId':parseInt(_0x57b107['data1'],0xa)}));}})[_0x7c2c('0x27')](function(_0x30c53e){logger[_0x7c2c('0x28')](_0x7c2c('0x29'),JSON[_0x7c2c('0xb')](_0x30c53e));});}else{if(_0x279cff){emit(util[_0x7c2c('0x1f')](_0x7c2c('0x20'),_0x279cff['name']),util[_0x7c2c('0x1f')](_0x7c2c('0x22'),_0x57b107[_0x7c2c('0x25')][_0x7c2c('0x26')]()),_[_0x7c2c('0x23')]({'ListId':parseInt(_0x57b107[_0x7c2c('0x10')],0xa)},_0x3093d2));}}}; \ No newline at end of file +var _0x88c7=['../../rpc/cmContact','redis','localhost','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','uniqueid','destcalleridname','','destcalleridnum','phone','resolve','then','showContact','omit','xmd-contactid2','format','name','trigger:%s','action','toLowerCase','merge','createContact','user:%s','catch','Error\x20creating\x20contact','bluebird','ioredis','../../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88c7,0x6f));var _0x788c=function(_0x73627c,_0x44da6a){_0x73627c=_0x73627c-0x0;var _0xcd0041=_0x88c7[_0x73627c];return _0xcd0041;};'use strict';var BPromise=require(_0x788c('0x0'));var util=require('util');var _=require('lodash');var Redis=require(_0x788c('0x1'));var config=require(_0x788c('0x2'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x788c('0x3'));config[_0x788c('0x4')]=_['defaults'](config[_0x788c('0x4')],{'host':_0x788c('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x788c('0x4')]));function emit(_0x2ed470,_0x54808d,_0x5dde40){logger[_0x788c('0x6')](_0x2ed470,_0x54808d,JSON[_0x788c('0x7')](_0x5dde40));io['to'](_0x2ed470)[_0x788c('0x8')](_0x54808d,_0x5dde40);}exports[_0x788c('0x9')]=function(_0x43f746,_0x53140f,_0x22e1e2){_0x22e1e2[_0x788c('0xa')]=0x0;if(_0x53140f[_0x788c('0xb')]&&parseInt(_0x53140f['data2'],0xa)){var _0x477298={'ListId':parseInt(_0x53140f[_0x788c('0xc')],0xa),'phone':_0x22e1e2[_0x788c('0xd')]};if(_[_0x788c('0xe')](_0x22e1e2[_0x788c('0xf')])){_0x477298[_0x788c('0x10')]=_0x22e1e2['calleridname']&&_0x22e1e2[_0x788c('0x11')]!==''?_0x22e1e2[_0x788c('0x11')]:_0x22e1e2['calleridnum']||_0x22e1e2[_0x788c('0x12')];}else{_0x477298[_0x788c('0x10')]=_0x22e1e2[_0x788c('0x13')]&&_0x22e1e2[_0x788c('0x13')]!==_0x788c('0x14')?_0x22e1e2[_0x788c('0x13')]:_0x22e1e2[_0x788c('0x15')]||_0x22e1e2[_0x788c('0x12')];_0x477298[_0x788c('0x16')]=_0x22e1e2[_0x788c('0x13')]&&_0x22e1e2[_0x788c('0x13')]!==_0x788c('0x14')?_0x22e1e2[_0x788c('0x13')]:_0x22e1e2['destcalleridnum']||_0x22e1e2[_0x788c('0x12')];}BPromise[_0x788c('0x17')]()[_0x788c('0x18')](cmContactRpc[_0x788c('0x19')]({'where':_[_0x788c('0x1a')](_0x477298,[_0x788c('0x10')])}))[_0x788c('0x18')](function(_0x360106){if(_0x360106){_0x22e1e2[_0x788c('0x1b')]=_0x360106['id'];emit(util[_0x788c('0x1c')]('user:%s',_0x43f746[_0x788c('0x1d')]),util[_0x788c('0x1c')](_0x788c('0x1e'),_0x53140f[_0x788c('0x1f')][_0x788c('0x20')]()),_[_0x788c('0x21')](_0x22e1e2,{'ListId':parseInt(_0x53140f[_0x788c('0xc')],0xa)}));return;}else{return BPromise[_0x788c('0x17')]()['then'](cmContactRpc[_0x788c('0x22')](_0x477298));}})[_0x788c('0x18')](function(_0x10d3f7){if(_0x10d3f7){_0x22e1e2[_0x788c('0x1b')]=_0x10d3f7['id'];emit(util[_0x788c('0x1c')](_0x788c('0x23'),_0x43f746[_0x788c('0x1d')]),util[_0x788c('0x1c')]('trigger:%s',_0x53140f[_0x788c('0x1f')][_0x788c('0x20')]()),_['merge'](_0x22e1e2,{'ListId':parseInt(_0x53140f[_0x788c('0xc')],0xa)}));}})[_0x788c('0x24')](function(_0x16741c){logger['error'](_0x788c('0x25'),JSON[_0x788c('0x7')](_0x16741c));});}else{if(_0x43f746){emit(util[_0x788c('0x1c')](_0x788c('0x23'),_0x43f746[_0x788c('0x1d')]),util[_0x788c('0x1c')](_0x788c('0x1e'),_0x53140f[_0x788c('0x1f')][_0x788c('0x20')]()),_['merge']({'ListId':parseInt(_0x53140f[_0x788c('0xc')],0xa)},_0x22e1e2));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 702f100..f547b29 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 _0x6962=['interface','name','contactmanager','exec','integration','urlforward','script','query','replace','every','AllConditions','checkConditions','channel','AnyConditions','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','queue','membername','lastevent','routeId','exports','util','url','mustache','ioredis','./urlforward','./integration','./script','../rpc/cmContact','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','location','uriLocation','data4','data5','windowHeight','data6','600','winapp','winApplication','format','user:%s','jscripty'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6962,0x156));var _0x2696=function(_0x40d5ad,_0x2d4183){_0x40d5ad=_0x40d5ad-0x0;var _0x10d82a=_0x6962[_0x40d5ad];return _0x10d82a;};'use strict';var util=require(_0x2696('0x0'));var _=require('lodash');var url=require(_0x2696('0x1'));var Mustache=require(_0x2696('0x2'));var Redis=require(_0x2696('0x3'));var urlforward=require(_0x2696('0x4'));var integration=require(_0x2696('0x5'));var cmContact=require('./cmContact');var script=require(_0x2696('0x6'));var cmContactRpc=require(_0x2696('0x7'));var config=require('../../../config/environment');var logger=require(_0x2696('0x8'))(_0x2696('0x9'));var ami=require(_0x2696('0xa'));config['redis']=_['defaults'](config[_0x2696('0xb')],{'host':_0x2696('0xc'),'port':0x18eb});var io=require(_0x2696('0xd'))(new Redis(config[_0x2696('0xb')]));var operators={'equals':function(_0x417f5c,_0x27c709){return _0x417f5c==_0x27c709;},'not_equals':function(_0x18f454,_0x2967cc){return _0x18f454!=_0x2967cc;}};var barAndWebActions=[_0x2696('0xe'),'url','winapp'];function Trigger(_0x3c1d53){this[_0x2696('0xf')]=_0x3c1d53['triggers'];this['agents']=_0x3c1d53[_0x2696('0x10')];this[_0x2696('0x11')]=_0x3c1d53[_0x2696('0x11')];this[_0x2696('0x12')]=_0x3c1d53[_0x2696('0x12')];this[_0x2696('0x13')]=_0x3c1d53[_0x2696('0x13')];this['zendeskAccounts']=_0x3c1d53[_0x2696('0x14')];this[_0x2696('0x15')]=_0x3c1d53[_0x2696('0x15')];this[_0x2696('0x16')]=_0x3c1d53['salesforceAccounts'];this[_0x2696('0x17')]=_0x3c1d53[_0x2696('0x17')];this[_0x2696('0x18')]=_0x3c1d53[_0x2696('0x18')];this[_0x2696('0x19')]=_0x3c1d53[_0x2696('0x19')];this['vtigerAccounts']=_0x3c1d53['vtigerAccounts'];this[_0x2696('0x1a')]=_0x3c1d53[_0x2696('0x1a')];this['dynamics365Accounts']=_0x3c1d53[_0x2696('0x1b')];this[_0x2696('0x1c')]={'zendesk':this[_0x2696('0x14')],'salesforce':this[_0x2696('0x16')],'freshdesk':this[_0x2696('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x2696('0x19')],'vtiger':this['vtigerAccounts'],'servicenow':this['servicenowAccounts'],'dynamics365':this['dynamics365Accounts']};ami['on'](_0x2696('0x1d'),this['syncCustomEvent'][_0x2696('0x1e')](this));ami['on'](_0x2696('0x1f'),this[_0x2696('0x20')]['bind'](this));ami['on'](_0x2696('0x21'),this[_0x2696('0x20')]['bind'](this));ami['on'](_0x2696('0x22'),this[_0x2696('0x20')][_0x2696('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0x2696('0x20')][_0x2696('0x1e')](this));ami['on']('custom:dialbegin',this[_0x2696('0x23')]['bind'](this));ami['on']('custom:dialconnect',this[_0x2696('0x23')][_0x2696('0x1e')](this));ami['on'](_0x2696('0x24'),this['syncAgentDial']['bind'](this));ami['on'](_0x2696('0x25'),this['syncCustomEvent'][_0x2696('0x1e')](this));ami['on'](_0x2696('0x26'),this[_0x2696('0x20')][_0x2696('0x1e')](this));ami['on']('custom:incomingmessage',this[_0x2696('0x20')][_0x2696('0x1e')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x2696('0x1e')](this));ami['on'](_0x2696('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x2696('0x28'),this[_0x2696('0x20')][_0x2696('0x1e')](this));}Trigger[_0x2696('0x29')][_0x2696('0x2a')]=function(_0x334783,_0x525348,_0x3cac94){logger[_0x2696('0x2b')](_0x334783,_0x525348,JSON[_0x2696('0x2c')](_0x3cac94));io['to'](_0x334783)[_0x2696('0x2a')](_0x525348,_0x3cac94);};Trigger[_0x2696('0x29')][_0x2696('0x20')]=function(_0x5e6d3c){var _0xf3c73a=_[_0x2696('0x2d')](_0x5e6d3c);this['checkTriggers'](_0xf3c73a);};Trigger[_0x2696('0x29')][_0x2696('0x23')]=function(_0x2fc439){if(this[_0x2696('0x10')][_0x2fc439['interface']]){this[_0x2696('0x20')](_0x2fc439);}};Trigger[_0x2696('0x29')][_0x2696('0x2e')]=function(_0x1b3a8d){var _0xf543c8;for(var _0x2ef4c6 in this[_0x2696('0xf')]){if(this['triggers'][_0x2696('0x2f')](_0x2ef4c6)){if(this[_0x2696('0xf')][_0x2ef4c6][_0x2696('0x30')]){_0xf543c8=this[_0x2696('0x31')](this['triggers'][_0x2ef4c6],_0x1b3a8d);if(_0xf543c8){_[_0x2696('0x32')](_0x1b3a8d,_0x1b3a8d[_0x2696('0x33')]);for(var _0x5a8147=0x0,_0x5ec21d,_0x3abbae,_0x25ebfc;_0x5a81470x0){_0x5704c7=_[_0xfda3('0x27')](_0x1f2884,_0x33ffd4);}return _0x5704c7;}function getCustomFields(_0x301509,_0x474992){var _0xe21ec6=[];var _0x3cfeb2={'custom_fields':{}};if(_0x301509[_0xfda3('0x26')]>0x0){_['forEach'](_0x301509,function(_0x56ca3a){if(_0x56ca3a[_0xfda3('0x28')]==='string'&&_0x56ca3a['nameField']&&!_0x56ca3a[_0xfda3('0x29')]){_0x3cfeb2[_0x56ca3a[_0xfda3('0x2a')][_0xfda3('0x2b')]()]=_0x56ca3a[_0xfda3('0x2c')][_0xfda3('0x1d')]();}else if(_0x56ca3a[_0xfda3('0x28')]===_0xfda3('0x2d')&&_0x56ca3a[_0xfda3('0x2e')]&&_0x56ca3a[_0xfda3('0x29')]){_0x3cfeb2['custom_fields'][_0x56ca3a[_0xfda3('0x2e')]]=_0x56ca3a[_0xfda3('0x2c')][_0xfda3('0x1d')]();}else if(_0x56ca3a[_0xfda3('0x28')]===_0xfda3('0x2f')&&_0x56ca3a[_0xfda3('0x30')]&&_0x56ca3a[_0xfda3('0x2e')]&&_0x56ca3a[_0xfda3('0x29')]){_0x474992[_0x56ca3a[_0xfda3('0x30')]]&&(_0x3cfeb2['custom_fields'][_0x56ca3a['idField']]=_0x474992[_0x56ca3a[_0xfda3('0x30')]][_0xfda3('0x1d')]());}else if(_0x56ca3a['type']===_0xfda3('0x31')&&_0x56ca3a[_0xfda3('0x32')]&&_0x56ca3a[_0xfda3('0x32')]['name']&&_0x56ca3a[_0xfda3('0x2e')]&&_0x56ca3a[_0xfda3('0x29')]){_0x474992[_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x33')][_0xfda3('0x2b')]()]&&(_0x3cfeb2['custom_fields'][_0x56ca3a[_0xfda3('0x2e')]]=_0x474992[_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x33')]['toLowerCase']()][_0xfda3('0x1d')]());}});}if(_0x3cfeb2['priority']){_0x3cfeb2[_0xfda3('0x34')]=Number(_0x3cfeb2[_0xfda3('0x34')]);}return _0x3cfeb2;}function getTicket(_0x43a58a,_0x36a506,_0x21c5cc,_0x2074e7,_0x151f32){logger[_0xfda3('0x9')]('Creating\x20new\x20ticket...');var _0x24c7ad=_[_0xfda3('0x35')]({'subject':intUtil[_0xfda3('0x36')](_0x2074e7[_0xfda3('0x37')],_0x151f32,'\x20'),'type':'phone','status':_0xfda3('0x38'),'labels':[_0xfda3('0x39'),_0xfda3('0x3a'),'CTI']['concat'](getTags(_0x2074e7[_0xfda3('0x3b')],_0xfda3('0x33'))),'description':intUtil[_0xfda3('0x36')](_0x2074e7[_0xfda3('0x3c')],_0x151f32,'\x0a'),'_links':{'assigned_user':{'href':util[_0xfda3('0xb')](_0xfda3('0x3d'),_0x36a506['id']),'class':_0xfda3('0x3e')}},'message':{'direction':'in','body':intUtil[_0xfda3('0x36')](_0x2074e7[_0xfda3('0x3c')],_0x151f32,'\x0a')}},getCustomFields(_0x2074e7[_0xfda3('0x3f')],_0x151f32));return request({'uri':util['format'](_0xfda3('0x40'),_0x43a58a[_0xfda3('0xc')],_0x21c5cc['id']),'method':'POST','body':_0x24c7ad});}exports[_0xfda3('0x41')]=function(_0x5b0296,_0x51a314,_0x4e6886,_0x2208bc,_0x107fb1,_0x260977){var _0x209918,_0x4c1f94;_0x260977[_0xfda3('0xc')]=intUtil[_0xfda3('0x42')](_0x260977[_0xfda3('0xc')]);_0x260977[_0xfda3('0x43')]=intUtil['stripTrailingSlash'](_0x260977[_0xfda3('0x43')]);if(_0x107fb1&&_0x107fb1[_0xfda3('0x44')]){logger[_0xfda3('0x9')]('[QUEUE]','Recording\x20is\x20enabled!');_0x51a314[_0xfda3('0x45')]=util[_0xfda3('0xb')](_0xfda3('0x46'),_0x260977[_0xfda3('0x43')],_0x51a314[_0xfda3('0x47')],md5(_0x51a314[_0xfda3('0x47')]));}else{_0x51a314[_0xfda3('0x45')]='';}headers[_0xfda3('0x48')]=getAuth(_0x260977);return getUser(_0x260977,_0x2208bc[_0xfda3('0x49')])[_0xfda3('0xd')](function(_0x1749f7){_0x209918=_0x1749f7;logger[_0xfda3('0x9')](_0xfda3('0x4a'),_0x209918['id']);return getEndUser(_0x260977,_0x51a314[_0xfda3('0x4b')],_0x51a314['calleridnum']);})['then'](function(_0x52b5c3){_0x4c1f94=_0x52b5c3;logger[_0xfda3('0x9')](_0xfda3('0x4c'),_0x4c1f94['id']);return getTicket(_0x260977,_0x209918,_0x4c1f94,_0x4e6886,_0x51a314);})[_0xfda3('0xd')](function(_0x597e5a){if(_0x597e5a){logger[_0xfda3('0x9')](_0xfda3('0x4d'));logger[_0xfda3('0x9')](_0xfda3('0x4e'),_0x597e5a['id']);switch(_0x260977[_0xfda3('0x28')]){case'integrationTab':logger[_0xfda3('0x9')](_0xfda3('0x4f'),_0xfda3('0x50'));emit(util[_0xfda3('0xb')](_0xfda3('0x51'),_0x2208bc['name']),_0xfda3('0x52'),{'recordId':_0x597e5a['id']});break;case _0xfda3('0x53'):logger[_0xfda3('0x9')]('[QUEUE]',_0xfda3('0x54'));emit(util[_0xfda3('0xb')](_0xfda3('0x51'),_0x2208bc['name']),_0xfda3('0x55'),{'uri':util[_0xfda3('0xb')](_0xfda3('0x56'),_0x597e5a['id'])});break;default:logger[_0xfda3('0x57')](_0xfda3('0x4f'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xfda3('0x58')](function(_0x484fd1){console[_0xfda3('0x57')](_0x484fd1);logger['error'](_0xfda3('0x4f'),JSON[_0xfda3('0x14')](_0x484fd1));});};exports[_0xfda3('0x59')]=function(_0x26ffee,_0x574f02,_0x244c24,_0x3b430d,_0x2f2c32,_0x372f15,_0x18425a){var _0x2ab6e9,_0x1d051f;_0x372f15['remoteUri']=intUtil['stripTrailingSlash'](_0x372f15[_0xfda3('0xc')]);_0x372f15[_0xfda3('0x43')]=intUtil[_0xfda3('0x42')](_0x372f15['serverUrl']);if(_0x18425a&&_0x18425a['recordingFormat']&&_0x18425a[_0xfda3('0x5a')]!==_0xfda3('0x5b')){logger[_0xfda3('0x9')](_0xfda3('0x5c'),_0xfda3('0x5d'));_0x574f02['recordingURL']=util[_0xfda3('0xb')](_0xfda3('0x46'),_0x372f15[_0xfda3('0x43')],_0x574f02[_0xfda3('0x47')],md5(_0x574f02[_0xfda3('0x47')]));}headers[_0xfda3('0x48')]=getAuth(_0x372f15);return getUser(_0x372f15,_0x3b430d[_0xfda3('0x49')])[_0xfda3('0xd')](function(_0x3a8c51){_0x2ab6e9=_0x3a8c51;logger[_0xfda3('0x9')](_0xfda3('0x4a'),_0x2ab6e9['id']);return getEndUser(_0x372f15,_0x574f02[_0xfda3('0x5e')],_0x574f02['destcalleridnum']);})[_0xfda3('0xd')](function(_0x2ce682){_0x1d051f=_0x2ce682;logger[_0xfda3('0x9')](_0xfda3('0x4c'),_0x1d051f['id']);return getTicket(_0x372f15,_0x2ab6e9,_0x1d051f,_0x244c24,_0x574f02);})[_0xfda3('0xd')](function(_0x405d7e){if(_0x405d7e){logger[_0xfda3('0x9')]('Ticket\x20created!');logger['info'](_0xfda3('0x4e'),_0x405d7e['id']);switch(_0x372f15[_0xfda3('0x28')]){case'integrationTab':logger[_0xfda3('0x9')](_0xfda3('0x4f'),_0xfda3('0x50'));emit(util[_0xfda3('0xb')]('user:%s',_0x3b430d['name']),_0xfda3('0x52'),{'recordId':_0x405d7e['id']});break;case _0xfda3('0x53'):logger[_0xfda3('0x9')]('[QUEUE]',_0xfda3('0x54'));emit(util['format'](_0xfda3('0x51'),_0x3b430d[_0xfda3('0x33')]),_0xfda3('0x55'),{'uri':util[_0xfda3('0xb')](_0xfda3('0x5f'),_0x372f15[_0xfda3('0xc')],_0x405d7e['id'])});break;default:logger['error'](_0xfda3('0x5c'),_0xfda3('0x60'));}}})[_0xfda3('0x58')](function(_0x1816e5){logger[_0xfda3('0x57')]('[OUTBOUND]',JSON['stringify'](_0x1816e5));});};exports[_0xfda3('0x61')]=function(_0x18ab57,_0x5afcf5,_0x550822,_0x512d7b,_0x248174,_0x2c93d4){var _0x4f3e45,_0x2de410;_0x2c93d4[_0xfda3('0xc')]=intUtil[_0xfda3('0x42')](_0x2c93d4[_0xfda3('0xc')]);_0x2c93d4['serverUrl']=intUtil[_0xfda3('0x42')](_0x2c93d4[_0xfda3('0x43')]);if(_0x248174&&_0x248174[_0xfda3('0x44')]){logger[_0xfda3('0x9')](_0xfda3('0x62'),_0xfda3('0x5d'));_0x5afcf5['recordingURL']=util['format'](_0xfda3('0x46'),_0x2c93d4['serverUrl'],_0x5afcf5[_0xfda3('0x47')],md5(_0x5afcf5[_0xfda3('0x47')]));}else{_0x5afcf5[_0xfda3('0x45')]='';}headers[_0xfda3('0x48')]=getAuth(_0x2c93d4);return getUser(_0x2c93d4)[_0xfda3('0xd')](function(_0x3c0155){_0x4f3e45=_0x3c0155;logger[_0xfda3('0x9')](_0xfda3('0x4a'),_0x4f3e45['id']);return getEndUser(_0x2c93d4,_0x5afcf5[_0xfda3('0x4b')],_0x5afcf5[_0xfda3('0x63')]);})['then'](function(_0xee8462){_0x2de410=_0xee8462;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2de410['id']);return getTicket(_0x2c93d4,_0x4f3e45,_0x2de410,_0x550822,_0x5afcf5);})[_0xfda3('0xd')](function(_0x238762){if(_0x238762){logger['info'](_0xfda3('0x4d'));logger[_0xfda3('0x9')](_0xfda3('0x4e'),_0x238762['id']);}})['catch'](function(_0x1a825c){logger[_0xfda3('0x57')](_0xfda3('0x62'),JSON[_0xfda3('0x14')](_0x1a825c));});}; \ No newline at end of file +var _0xe511=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','map','string','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','custom_fields','customVariable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','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','stringify','outbound','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','GET','authType','basic','%s:%s','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search'];(function(_0x41976b,_0x1546a6){var _0x216315=function(_0x130089){while(--_0x130089){_0x41976b['push'](_0x41976b['shift']());}};_0x216315(++_0x1546a6);}(_0xe511,0x16f));var _0x1e51=function(_0x59a1a0,_0x45d4a8){_0x59a1a0=_0x59a1a0-0x0;var _0x442238=_0xe511[_0x59a1a0];return _0x442238;};'use strict';var _=require(_0x1e51('0x0'));var rp=require(_0x1e51('0x1'));var md5=require('md5');var util=require(_0x1e51('0x2'));var Redis=require('ioredis');var intUtil=require(_0x1e51('0x3'));var config=require(_0x1e51('0x4'));var logger=require('../../../../config/logger')(_0x1e51('0x5'));config[_0x1e51('0x6')]=_[_0x1e51('0x7')](config[_0x1e51('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1e51('0x8'))(new Redis(config[_0x1e51('0x6')]));function emit(_0x5c4590,_0x4fa2ba,_0x394ad8){io['to'](_0x5c4590)[_0x1e51('0x9')](_0x4fa2ba,_0x394ad8);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x658941,_0x2712e0){if(intUtil[_0x1e51('0xa')](_0x2712e0)===!![]){logger[_0x1e51('0xb')](_0x1e51('0xc'),_0x2712e0);return request({'uri':util[_0x1e51('0xd')]('%s/users',_0x658941[_0x1e51('0xe')])})[_0x1e51('0xf')](function(_0x3350bb){if(_0x3350bb[_0x1e51('0x10')]){return _[_0x1e51('0x11')](_0x3350bb[_0x1e51('0x12')]['entries'],{'email':_0x2712e0});}})[_0x1e51('0xf')](function(_0x102f01){if(_0x102f01){logger[_0x1e51('0xb')](_0x1e51('0x13'));return _0x102f01;}else{logger[_0x1e51('0xb')](_0x1e51('0x14'));return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x15'),_0x658941[_0x1e51('0xe')])});}});}else{logger[_0x1e51('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x15'),_0x658941[_0x1e51('0xe')])});}}function request(_0x5857e2){logger[_0x1e51('0x16')]('[HTTP]',JSON['stringify'](_0x5857e2));return rp(_[_0x1e51('0x7')](_0x5857e2,{'method':_0x1e51('0x17'),'headers':headers,'json':!![]}));}function getAuth(_0x40ae4c){var _0x4785a5;if(_0x40ae4c[_0x1e51('0x18')]===_0x1e51('0x19')){_0x4785a5=util['format'](_0x1e51('0x1a'),_0x40ae4c['username'],_0x40ae4c[_0x1e51('0x1b')]);}else if(_0x40ae4c[_0x1e51('0x18')]===_0x1e51('0x1c')){_0x4785a5=util[_0x1e51('0xd')]('%s/token:%s',_0x40ae4c['username'],_0x40ae4c['token']);}return util['format'](_0x1e51('0x1d'),new Buffer(_0x4785a5)['toString'](_0x1e51('0x1e')));}function getEndUser(_0x28aacb,_0x415154,_0x13240f){logger[_0x1e51('0xb')](_0x1e51('0x1f'),_0x13240f);return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x20'),_0x28aacb['remoteUri']),'qs':{'phone':_0x13240f}})['then'](function(_0x43f5c5){if(_0x43f5c5[_0x1e51('0x10')]){logger[_0x1e51('0xb')](_0x1e51('0x21'));return _0x43f5c5['_embedded']['entries'][0x0];}else{logger['info'](_0x1e51('0x22'));return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x23'),_0x28aacb['remoteUri']),'method':_0x1e51('0x24'),'body':{'first_name':_0x415154,'title':_0x415154,'phone_numbers':[{'type':'work','value':_0x13240f}]}});}});}function getTags(_0x5eccee,_0x3349f0){var _0x5c5bbd=[];if(_0x5eccee&&_0x5eccee[_0x1e51('0x25')]>0x0){_0x5c5bbd=_[_0x1e51('0x26')](_0x5eccee,_0x3349f0);}return _0x5c5bbd;}function getCustomFields(_0x56722f,_0x3e6ef2){var _0x10ee23=[];var _0x71c7af={'custom_fields':{}};if(_0x56722f[_0x1e51('0x25')]>0x0){_['forEach'](_0x56722f,function(_0x4cf046){if(_0x4cf046['type']===_0x1e51('0x27')&&_0x4cf046[_0x1e51('0x28')]&&!_0x4cf046[_0x1e51('0x29')]){_0x71c7af[_0x4cf046[_0x1e51('0x28')][_0x1e51('0x2a')]()]=_0x4cf046[_0x1e51('0x2b')][_0x1e51('0x2c')]();}else if(_0x4cf046[_0x1e51('0x2d')]===_0x1e51('0x27')&&_0x4cf046[_0x1e51('0x2e')]&&_0x4cf046[_0x1e51('0x29')]){_0x71c7af['custom_fields'][_0x4cf046[_0x1e51('0x2e')]]=_0x4cf046[_0x1e51('0x2b')][_0x1e51('0x2c')]();}else if(_0x4cf046[_0x1e51('0x2d')]===_0x1e51('0x2f')&&_0x4cf046['variableName']&&_0x4cf046[_0x1e51('0x2e')]&&_0x4cf046['customField']){_0x3e6ef2[_0x4cf046[_0x1e51('0x30')]]&&(_0x71c7af[_0x1e51('0x31')][_0x4cf046[_0x1e51('0x2e')]]=_0x3e6ef2[_0x4cf046['variableName']][_0x1e51('0x2c')]());}else if(_0x4cf046['type']===_0x1e51('0x32')&&_0x4cf046['Variable']&&_0x4cf046['Variable'][_0x1e51('0x33')]&&_0x4cf046[_0x1e51('0x2e')]&&_0x4cf046[_0x1e51('0x29')]){_0x3e6ef2[_0x4cf046['Variable'][_0x1e51('0x33')]['toLowerCase']()]&&(_0x71c7af[_0x1e51('0x31')][_0x4cf046[_0x1e51('0x2e')]]=_0x3e6ef2[_0x4cf046['Variable'][_0x1e51('0x33')][_0x1e51('0x2a')]()][_0x1e51('0x2c')]());}});}if(_0x71c7af[_0x1e51('0x34')]){_0x71c7af[_0x1e51('0x34')]=Number(_0x71c7af[_0x1e51('0x34')]);}return _0x71c7af;}function getTicket(_0x5c57a6,_0x509f7d,_0x56f86a,_0x58cbbe,_0x3c6c35){logger[_0x1e51('0xb')](_0x1e51('0x35'));var _0xcfa1d8=_[_0x1e51('0x36')]({'subject':intUtil[_0x1e51('0x37')](_0x58cbbe[_0x1e51('0x38')],_0x3c6c35,'\x20'),'type':_0x1e51('0x39'),'status':_0x1e51('0x3a'),'labels':[_0x1e51('0x3b'),_0x1e51('0x3c'),'CTI'][_0x1e51('0x3d')](getTags(_0x58cbbe['Tags'],_0x1e51('0x33'))),'description':intUtil[_0x1e51('0x37')](_0x58cbbe[_0x1e51('0x3e')],_0x3c6c35,'\x0a'),'_links':{'assigned_user':{'href':util[_0x1e51('0xd')](_0x1e51('0x3f'),_0x509f7d['id']),'class':_0x1e51('0x40')}},'message':{'direction':'in','body':intUtil[_0x1e51('0x37')](_0x58cbbe[_0x1e51('0x3e')],_0x3c6c35,'\x0a')}},getCustomFields(_0x58cbbe[_0x1e51('0x41')],_0x3c6c35));return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x42'),_0x5c57a6['remoteUri'],_0x56f86a['id']),'method':'POST','body':_0xcfa1d8});}exports[_0x1e51('0x43')]=function(_0x8bb476,_0x3be495,_0x4650e4,_0x1ef3d3,_0x1a9e0d,_0x25592c){var _0x3ca63d,_0x5a6340;_0x25592c[_0x1e51('0xe')]=intUtil[_0x1e51('0x44')](_0x25592c[_0x1e51('0xe')]);_0x25592c[_0x1e51('0x45')]=intUtil[_0x1e51('0x44')](_0x25592c[_0x1e51('0x45')]);if(_0x1a9e0d&&_0x1a9e0d[_0x1e51('0x46')]){logger['info'](_0x1e51('0x47'),_0x1e51('0x48'));_0x3be495['recordingURL']=util[_0x1e51('0xd')](_0x1e51('0x49'),_0x25592c[_0x1e51('0x45')],_0x3be495['uniqueid'],md5(_0x3be495[_0x1e51('0x4a')]));}else{_0x3be495[_0x1e51('0x4b')]='';}headers[_0x1e51('0x4c')]=getAuth(_0x25592c);return getUser(_0x25592c,_0x1ef3d3[_0x1e51('0x4d')])[_0x1e51('0xf')](function(_0x3baebb){_0x3ca63d=_0x3baebb;logger[_0x1e51('0xb')](_0x1e51('0x4e'),_0x3ca63d['id']);return getEndUser(_0x25592c,_0x3be495[_0x1e51('0x4f')],_0x3be495['calleridnum']);})[_0x1e51('0xf')](function(_0x22a898){_0x5a6340=_0x22a898;logger['info'](_0x1e51('0x50'),_0x5a6340['id']);return getTicket(_0x25592c,_0x3ca63d,_0x5a6340,_0x4650e4,_0x3be495);})[_0x1e51('0xf')](function(_0x139e9f){if(_0x139e9f){logger['info'](_0x1e51('0x51'));logger[_0x1e51('0xb')](_0x1e51('0x52'),_0x139e9f['id']);switch(_0x25592c['type']){case _0x1e51('0x53'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x1e51('0xd')](_0x1e51('0x54'),_0x1ef3d3['name']),'trigger:desk:display',{'recordId':_0x139e9f['id']});break;case _0x1e51('0x55'):logger[_0x1e51('0xb')](_0x1e51('0x47'),_0x1e51('0x56'));emit(util[_0x1e51('0xd')](_0x1e51('0x54'),_0x1ef3d3['name']),_0x1e51('0x57'),{'uri':util['format'](_0x1e51('0x58'),_0x139e9f['id'])});break;default:logger[_0x1e51('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x5f7b11){console[_0x1e51('0x59')](_0x5f7b11);logger[_0x1e51('0x59')]('[QUEUE]',JSON[_0x1e51('0x5a')](_0x5f7b11));});};exports[_0x1e51('0x5b')]=function(_0x4226da,_0x2100d4,_0x1ccb55,_0x12584c,_0x32fe1f,_0x2ca91f,_0x5b64f6){var _0x37eb4d,_0x7c5f61;_0x2ca91f[_0x1e51('0xe')]=intUtil[_0x1e51('0x44')](_0x2ca91f[_0x1e51('0xe')]);_0x2ca91f[_0x1e51('0x45')]=intUtil['stripTrailingSlash'](_0x2ca91f[_0x1e51('0x45')]);if(_0x5b64f6&&_0x5b64f6['recordingFormat']&&_0x5b64f6['recordingFormat']!=='none'){logger[_0x1e51('0xb')](_0x1e51('0x5c'),_0x1e51('0x48'));_0x2100d4['recordingURL']=util[_0x1e51('0xd')](_0x1e51('0x49'),_0x2ca91f[_0x1e51('0x45')],_0x2100d4['uniqueid'],md5(_0x2100d4[_0x1e51('0x4a')]));}headers[_0x1e51('0x4c')]=getAuth(_0x2ca91f);return getUser(_0x2ca91f,_0x12584c[_0x1e51('0x4d')])['then'](function(_0x2d5e58){_0x37eb4d=_0x2d5e58;logger[_0x1e51('0xb')](_0x1e51('0x4e'),_0x37eb4d['id']);return getEndUser(_0x2ca91f,_0x2100d4[_0x1e51('0x5d')],_0x2100d4[_0x1e51('0x5e')]);})[_0x1e51('0xf')](function(_0x215ff7){_0x7c5f61=_0x215ff7;logger[_0x1e51('0xb')]('The\x20Enduser\x20ID\x20is:',_0x7c5f61['id']);return getTicket(_0x2ca91f,_0x37eb4d,_0x7c5f61,_0x1ccb55,_0x2100d4);})[_0x1e51('0xf')](function(_0x2e78e7){if(_0x2e78e7){logger['info']('Ticket\x20created!');logger['info'](_0x1e51('0x52'),_0x2e78e7['id']);switch(_0x2ca91f[_0x1e51('0x2d')]){case _0x1e51('0x53'):logger[_0x1e51('0xb')](_0x1e51('0x47'),_0x1e51('0x5f'));emit(util[_0x1e51('0xd')](_0x1e51('0x54'),_0x12584c[_0x1e51('0x33')]),'trigger:desk:display',{'recordId':_0x2e78e7['id']});break;case'newTab':logger['info'](_0x1e51('0x47'),_0x1e51('0x56'));emit(util['format']('user:%s',_0x12584c[_0x1e51('0x33')]),_0x1e51('0x57'),{'uri':util['format'](_0x1e51('0x60'),_0x2ca91f[_0x1e51('0xe')],_0x2e78e7['id'])});break;default:logger[_0x1e51('0x59')](_0x1e51('0x5c'),_0x1e51('0x61'));}}})[_0x1e51('0x62')](function(_0x2199e5){logger[_0x1e51('0x59')](_0x1e51('0x5c'),JSON[_0x1e51('0x5a')](_0x2199e5));});};exports['abandoned']=function(_0x178baf,_0x2f5bf1,_0x3657a2,_0x402bbd,_0xc720e2,_0x224dbc){var _0x47cc50,_0x56475b;_0x224dbc[_0x1e51('0xe')]=intUtil[_0x1e51('0x44')](_0x224dbc[_0x1e51('0xe')]);_0x224dbc[_0x1e51('0x45')]=intUtil['stripTrailingSlash'](_0x224dbc['serverUrl']);if(_0xc720e2&&_0xc720e2['monitor_format']){logger[_0x1e51('0xb')](_0x1e51('0x63'),_0x1e51('0x48'));_0x2f5bf1[_0x1e51('0x4b')]=util[_0x1e51('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x224dbc[_0x1e51('0x45')],_0x2f5bf1[_0x1e51('0x4a')],md5(_0x2f5bf1[_0x1e51('0x4a')]));}else{_0x2f5bf1['recordingURL']='';}headers[_0x1e51('0x4c')]=getAuth(_0x224dbc);return getUser(_0x224dbc)[_0x1e51('0xf')](function(_0x45e607){_0x47cc50=_0x45e607;logger['info'](_0x1e51('0x4e'),_0x47cc50['id']);return getEndUser(_0x224dbc,_0x2f5bf1[_0x1e51('0x4f')],_0x2f5bf1['calleridnum']);})['then'](function(_0x40d5e8){_0x56475b=_0x40d5e8;logger['info'](_0x1e51('0x50'),_0x56475b['id']);return getTicket(_0x224dbc,_0x47cc50,_0x56475b,_0x3657a2,_0x2f5bf1);})['then'](function(_0x17a9fd){if(_0x17a9fd){logger[_0x1e51('0xb')](_0x1e51('0x51'));logger[_0x1e51('0xb')]('The\x20Ticket\x20ID\x20is:',_0x17a9fd['id']);}})[_0x1e51('0x62')](function(_0x4c9871){logger['error'](_0x1e51('0x63'),JSON[_0x1e51('0x5a')](_0x4c9871));});}; \ 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 5450809..4ab553a 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 _0xd2c0=[']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','message','outbound','destcalleridnum','calleridnum','POST','4.0','substring','lastIndexOf','GET','contacts?$select=telephone1','toLowerCase','telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','string','nameField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','phonecalls','queue','callDirection','Fields','headers','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','clientId','remoteUri','password','clientSecret','then','catch','error'];(function(_0x165aad,_0x3e4a95){var _0x9b8975=function(_0x215fab){while(--_0x215fab){_0x165aad['push'](_0x165aad['shift']());}};_0x9b8975(++_0x3e4a95);}(_0xd2c0,0x116));var _0x0d2c=function(_0x10f0dd,_0x342d6f){_0x10f0dd=_0x10f0dd-0x0;var _0x56e241=_0xd2c0[_0x10f0dd];return _0x56e241;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x0d2c('0x0'));var util=require(_0x0d2c('0x1'));var intUtil=require(_0x0d2c('0x2'));var md5=require(_0x0d2c('0x3'));var Redis=require(_0x0d2c('0x4'));var logger=require(_0x0d2c('0x5'))(_0x0d2c('0x6'));var config=require(_0x0d2c('0x7'));config['redis']=_[_0x0d2c('0x8')](config['redis'],{'host':_0x0d2c('0x9'),'port':0x18eb});var io=require(_0x0d2c('0xa'))(new Redis(config[_0x0d2c('0xb')]));function getAuthToken(_0x25e758,_0x456319,_0x150bba){var _0x5d4206={'method':'POST','uri':_0x456319,'form':{'client_id':_0x25e758[_0x0d2c('0xc')],'resource':_0x25e758[_0x0d2c('0xd')],'username':_0x25e758['username'],'password':_0x25e758[_0x0d2c('0xe')],'grant_type':_0x0d2c('0xe'),'client_secret':_0x25e758[_0x0d2c('0xf')]},'json':!![]};return rp(_0x5d4206)[_0x0d2c('0x10')](function(_0xb0ea98){return _0xb0ea98['access_token'];})[_0x0d2c('0x11')](function(_0x2af388){logger[_0x0d2c('0x12')]('['+[_0x150bba['toUpperCase']()]+_0x0d2c('0x13'));return _0x2af388['message'];});}function getUser(_0x438da3,_0x2b240a,_0x5da9a5,_0x451fa7,_0x260522,_0x43ba50){return new BPromise(function(_0xdca13d,_0x5366a2){return getAuthToken(_0x2b240a,_0x451fa7,_0x43ba50)[_0x0d2c('0x10')](function(_0x44aa58){var _0x2df202={'method':'GET','uri':_0x260522+_0x0d2c('0x14'),'headers':{'Authorization':_0x0d2c('0x15')+_0x44aa58,'OData-Version':'4.0'},'json':!![]};return rp(_0x2df202);})[_0x0d2c('0x10')](function(_0x156db8){var _0x10951d=_0x156db8[_0x0d2c('0x16')];var _0x56faf5=![];var _0x35cb4=null;if(!_[_0x0d2c('0x17')](_0x5da9a5)){if(intUtil[_0x0d2c('0x18')](_0x5da9a5[_0x0d2c('0x19')])){_0x438da3['userEmail']=_0x5da9a5[_0x0d2c('0x19')];for(_0x35cb4=0x0;_0x35cb4<_0x10951d[_0x0d2c('0x1a')];_0x35cb4++){if(_0x10951d[_0x35cb4]['internalemailaddress']===_0x5da9a5[_0x0d2c('0x19')]&&!_0x10951d[_0x35cb4][_0x0d2c('0x1b')]){_0x56faf5=!![];logger[_0x0d2c('0x1c')]('['+[_0x43ba50[_0x0d2c('0x1d')]()]+_0x0d2c('0x1e')+_0x10951d[_0x35cb4][_0x0d2c('0x1f')]+'!');_0x438da3[_0x0d2c('0x20')]=_0x10951d[_0x35cb4]['systemuserid'];}}}}if(!_0x56faf5){logger['info']('['+[_0x43ba50[_0x0d2c('0x1d')]()]+_0x0d2c('0x21'));_0x438da3[_0x0d2c('0x22')]=_0x2b240a[_0x0d2c('0x23')];for(_0x35cb4=0x0;_0x35cb4<_0x10951d[_0x0d2c('0x1a')];_0x35cb4++){if(_0x10951d[_0x35cb4][_0x0d2c('0x24')]===_0x2b240a['username']){_0x438da3[_0x0d2c('0x20')]=_0x10951d[_0x35cb4][_0x0d2c('0x1f')];}}}_0xdca13d(_0x438da3);})[_0x0d2c('0x11')](function(_0x15f655){_0x5366a2(_0x15f655[_0x0d2c('0x25')]);});});}function createEndUser(_0xbf8ed0,_0x1d00b5,_0x428c75,_0xf6293a,_0x5aa713,_0x377351){return new BPromise(function(_0x1d8b52,_0x3cb95c){return getAuthToken(_0x1d00b5,_0x428c75,_0x377351)['then'](function(_0x519561){var _0x95567a=_0x377351['toLowerCase']()===_0x0d2c('0x26')?_0x5aa713[_0x0d2c('0x27')]:_0x5aa713[_0x0d2c('0x28')];var _0x2a21a9={'method':_0x0d2c('0x29'),'uri':_0xf6293a+'contacts','body':{'telephone1':_0x95567a,'fullname':_0x95567a,'firstname':_0x95567a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0xbf8ed0['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x519561,'OData-Version':_0x0d2c('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2a21a9);})[_0x0d2c('0x10')](function(_0x43e17b){var _0x151699=_0x43e17b['headers']['odata-entityid'];var _0x41d833=_0x151699[_0x0d2c('0x2b')](_0x151699[_0x0d2c('0x2c')]('(')+0x1,_0x151699[_0x0d2c('0x2c')](')'));_0xbf8ed0['enduserId']=_0x41d833;_0x1d8b52(_0xbf8ed0);})[_0x0d2c('0x11')](function(_0x24f136){_0x3cb95c(_0x24f136['message']);});});}function getEndUser(_0x500f1a,_0x3cfae1,_0x31d5e5,_0xf6d622,_0x1e1c71,_0x547619){return new BPromise(function(_0x4138dc,_0x1be3d0){return getAuthToken(_0x3cfae1,_0x31d5e5,_0x547619)[_0x0d2c('0x10')](function(_0x4cdfd3){var _0x4504b0={'method':_0x0d2c('0x2d'),'uri':_0xf6d622+_0x0d2c('0x2e'),'headers':{'Authorization':'Bearer\x20'+_0x4cdfd3,'If-None-Match':null,'OData-Version':_0x0d2c('0x2a')},'json':!![]};return rp(_0x4504b0);})[_0x0d2c('0x10')](function(_0x22f1ac){var _0x5cab0f=null;if(_0x22f1ac){var _0x4fc9a2=_0x22f1ac[_0x0d2c('0x16')];var _0xcf2ee4=![];for(_0x5cab0f=0x0;_0x5cab0f<_0x4fc9a2['length'];_0x5cab0f++){var _0x2d9585=_0x547619[_0x0d2c('0x2f')]()===_0x0d2c('0x26')?_0x1e1c71[_0x0d2c('0x27')]:_0x1e1c71[_0x0d2c('0x28')];if(_0x4fc9a2[_0x5cab0f][_0x0d2c('0x30')]===_0x2d9585){_0xcf2ee4=!![];_0x500f1a['enduserId']=_0x4fc9a2[_0x5cab0f][_0x0d2c('0x31')];}}if(_0xcf2ee4){_0x4138dc(_0x500f1a);}else{return createEndUser(_0x500f1a,_0x3cfae1,_0x31d5e5,_0xf6d622,_0x1e1c71,_0x547619)[_0x0d2c('0x10')](function(_0x2dd904){logger[_0x0d2c('0x1c')]('['+[_0x547619[_0x0d2c('0x1d')]()]+_0x0d2c('0x32'),_0x2dd904[_0x0d2c('0x33')]);_0x4138dc(_0x2dd904);});}}else{return createEndUser(_0x500f1a,_0x3cfae1,_0x31d5e5,_0xf6d622,_0x1e1c71,_0x547619)['then'](function(_0x585483){logger['info']('['+[_0x547619[_0x0d2c('0x1d')]()]+_0x0d2c('0x34'),_0x585483[_0x0d2c('0x33')]);_0x4138dc(_0x585483);});}});});}function getCustomFields(_0x36f3e4,_0x2e8d5f,_0x2d7134){var _0x4bcdac={};if(_0x36f3e4[_0x0d2c('0x1a')]>0x0){_['forEach'](_0x36f3e4,function(_0x50667a){if(_0x50667a['type']===_0x0d2c('0x35')&&_0x50667a[_0x0d2c('0x36')]&&!_0x50667a['customField']){var _0x1209f9=_0x50667a[_0x0d2c('0x37')][_0x0d2c('0x2f')]();var _0x1a2329=_0x1209f9['substring'](0x0,_0x1209f9[_0x0d2c('0x38')]('_'));var _0x31b8d8=_0x1209f9[_0x0d2c('0x2b')](_0x1209f9[_0x0d2c('0x38')]('_')+0x1);if(_0x1a2329===_0x2d7134){_0x4bcdac[_0x31b8d8]=_0x50667a[_0x0d2c('0x39')];}}});}return _0x4bcdac;}function getTicket(_0xc9d227,_0x56c528,_0x5b3c8e,_0x1ba485,_0x57a5ca,_0x395989,_0x289fca){return new BPromise(function(_0x4dbbeb,_0x144514){var _0x31a485;return getAuthToken(_0x56c528,_0x5b3c8e,_0x289fca)[_0x0d2c('0x10')](function(_0x8dd41b){if(_0x395989[_0x0d2c('0x3a')]===_0x0d2c('0x3b')){_0x31a485={'method':_0x0d2c('0x29'),'uri':_0x1ba485+_0x0d2c('0x3c'),'body':Object[_0x0d2c('0x3d')]({},{'title':intUtil[_0x0d2c('0x3e')](_0x395989[_0x0d2c('0x3f')],_0x57a5ca,'\x20'),'description':intUtil[_0x0d2c('0x3e')](_0x395989[_0x0d2c('0x40')],_0x57a5ca,'\x0a'),'customerid_contact@odata.bind':_0x0d2c('0x41')+_0xc9d227[_0x0d2c('0x33')]+')','ownerid@odata.bind':_0x0d2c('0x42')+_0xc9d227[_0x0d2c('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x395989['Fields'],_0x57a5ca,_0x395989[_0x0d2c('0x3a')])),'headers':{'Authorization':_0x0d2c('0x15')+_0x8dd41b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x395989['ticketType']==='phonecall'){_0x31a485={'method':_0x0d2c('0x29'),'uri':_0x1ba485+_0x0d2c('0x43'),'body':Object['assign']({},{'subject':intUtil[_0x0d2c('0x3e')](_0x395989[_0x0d2c('0x3f')],_0x57a5ca,'\x20'),'phonenumber':String(_0x57a5ca[_0x0d2c('0x28')]),'description':intUtil[_0x0d2c('0x3e')](_0x395989[_0x0d2c('0x40')],_0x57a5ca,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xc9d227[_0x0d2c('0x33')]+')','ownerid@odata.bind':'/systemusers('+_0xc9d227[_0x0d2c('0x20')]+')','directioncode':_0xc9d227['callDirection']===_0x0d2c('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0d2c('0x42')+_0xc9d227[_0x0d2c('0x20')]+')','participationtypemask':_0xc9d227[_0x0d2c('0x45')]===_0x0d2c('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x0d2c('0x41')+_0xc9d227[_0x0d2c('0x33')]+')','participationtypemask':_0xc9d227['callDirection']===_0x0d2c('0x44')?0x1:0x2}]},getCustomFields(_0x395989[_0x0d2c('0x46')],_0x57a5ca,_0x395989[_0x0d2c('0x3a')])),'headers':{'Authorization':_0x0d2c('0x15')+_0x8dd41b,'OData-Version':_0x0d2c('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x31a485);})[_0x0d2c('0x10')](function(_0xc1578b){var _0x31037a=_0xc1578b[_0x0d2c('0x47')][_0x0d2c('0x48')];var _0x329d2a=_0x31037a[_0x0d2c('0x2b')](_0x31037a[_0x0d2c('0x2c')]('(')+0x1,_0x31037a[_0x0d2c('0x2c')](')'));_0xc9d227[_0x0d2c('0x49')]=_0x329d2a;_0x4dbbeb(_0xc9d227);})[_0x0d2c('0x11')](function(_0x43999e){_0x144514(_0x43999e['message']);});});}function emit(_0xc95c8f,_0xebdf53,_0x22ccaa,_0x2fd0de){var _0x205641={'uri':util[_0x0d2c('0x4a')](_0x0d2c('0x4b'),_0xc95c8f,_0x22ccaa,_0x2fd0de)};io['to'](util[_0x0d2c('0x4a')](_0x0d2c('0x4c'),_0xebdf53))['emit'](_0x0d2c('0x4d'),_0x205641);}exports['cs']=function(_0x3ffaa9,_0xa4dffe,_0x4e0146,_0x3fcf0e,_0x57f119,_0x510a88,_0x1fa763,_0x5ad511){var _0x10b447={};_0x510a88['remoteUri']=intUtil['stripTrailingSlash'](_0x510a88[_0x0d2c('0xd')]);_0x510a88[_0x0d2c('0x4e')]=intUtil[_0x0d2c('0x4f')](_0x510a88[_0x0d2c('0x4e')]);_0x10b447[_0x0d2c('0x45')]=_0x5ad511==='queue'||_0x5ad511===_0x0d2c('0x50')?_0x0d2c('0x44'):_0x0d2c('0x26');var _0x34b0c0=util['format'](_0x0d2c('0x51'),_0x510a88['remoteUri']);var _0x5ff421=util[_0x0d2c('0x4a')](_0x0d2c('0x52'),_0x510a88[_0x0d2c('0x53')]);var _0x906e8=util[_0x0d2c('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x510a88[_0x0d2c('0x4e')],_0xa4dffe[_0x0d2c('0x54')],md5(_0xa4dffe[_0x0d2c('0x54')]));if(_0x57f119&&_0x57f119[_0x0d2c('0x55')]){logger[_0x0d2c('0x1c')](_0x0d2c('0x56'),'Recording\x20is\x20enabled!');_0xa4dffe[_0x0d2c('0x57')]=_0x906e8;}else if(_0x1fa763&&_0x1fa763[_0x0d2c('0x58')]&&_0x1fa763[_0x0d2c('0x58')]!==_0x0d2c('0x59')){logger[_0x0d2c('0x1c')](_0x0d2c('0x5a'),'Recording\x20is\x20enabled!');_0xa4dffe[_0x0d2c('0x57')]=_0x906e8;}else{_0xa4dffe[_0x0d2c('0x57')]='';}return getUser(_0x10b447,_0x510a88,_0x3fcf0e,_0x5ff421,_0x34b0c0,_0x5ad511)[_0x0d2c('0x10')](function(_0x127a2a){logger[_0x0d2c('0x1c')]('['+_0x5ad511['toUpperCase']()+_0x0d2c('0x5b'),_0x127a2a['userId']);logger[_0x0d2c('0x1c')]('['+_0x5ad511['toUpperCase']()+_0x0d2c('0x5c'),_0x127a2a[_0x0d2c('0x22')]);return getEndUser(_0x127a2a,_0x510a88,_0x5ff421,_0x34b0c0,_0xa4dffe,_0x5ad511);})[_0x0d2c('0x10')](function(_0x1ed91b){logger['info']('['+_0x5ad511[_0x0d2c('0x1d')]()+_0x0d2c('0x5d'),_0x1ed91b[_0x0d2c('0x33')]);logger[_0x0d2c('0x1c')]('['+_0x5ad511[_0x0d2c('0x1d')]()+_0x0d2c('0x5e'),_0xa4dffe[_0x0d2c('0x28')]);return getTicket(_0x1ed91b,_0x510a88,_0x5ff421,_0x34b0c0,_0xa4dffe,_0x4e0146,_0x5ad511);})[_0x0d2c('0x10')](function(_0xb782eb){logger[_0x0d2c('0x1c')](util[_0x0d2c('0x4a')]('['+_0x5ad511['toUpperCase']()+_0x0d2c('0x5f'),_0x4e0146[_0x0d2c('0x3a')],_0xb782eb[_0x0d2c('0x49')]));logger[_0x0d2c('0x1c')](util[_0x0d2c('0x4a')]('['+_0x5ad511['toUpperCase']()+_0x0d2c('0x60'),_0x5ad511));if(_0x5ad511!=='abandoned'){logger['info']('['+_0x5ad511[_0x0d2c('0x1d')]()+']',_0x0d2c('0x61'));emit(_0x510a88[_0x0d2c('0xd')],_0x3fcf0e['name'],_0x4e0146[_0x0d2c('0x3a')],_0xb782eb['ticketId']);}})[_0x0d2c('0x11')](function(_0x2b73bb){logger[_0x0d2c('0x12')]('['+_0x5ad511[_0x0d2c('0x1d')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x0d2c('0x62')](_0x2b73bb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3eed=[']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','POST','clientId','username','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','systemuserid','message','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','lastIndexOf','enduserId','outbound','contactid','forEach','type','string','nameField','customField','indexOf','substring','content','ticketType','assign','Subjects','getString','/contacts(','phonecalls','callDirection','queue','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','stripTrailingSlash','remoteUri','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3eed,0x116));var _0xd3ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3eed[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd3ee('0x0'));var BPromise=require(_0xd3ee('0x1'));var rp=require(_0xd3ee('0x2'));var util=require(_0xd3ee('0x3'));var intUtil=require('./util');var md5=require(_0xd3ee('0x4'));var Redis=require(_0xd3ee('0x5'));var logger=require(_0xd3ee('0x6'))(_0xd3ee('0x7'));var config=require('../../../../config/environment');config[_0xd3ee('0x8')]=_[_0xd3ee('0x9')](config[_0xd3ee('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd3ee('0x8')]));function getAuthToken(_0x12b322,_0x547428,_0x41a33e){var _0x58fd5e={'method':_0xd3ee('0xa'),'uri':_0x547428,'form':{'client_id':_0x12b322[_0xd3ee('0xb')],'resource':_0x12b322['remoteUri'],'username':_0x12b322[_0xd3ee('0xc')],'password':_0x12b322['password'],'grant_type':'password','client_secret':_0x12b322['clientSecret']},'json':!![]};return rp(_0x58fd5e)[_0xd3ee('0xd')](function(_0x7dfac4){return _0x7dfac4[_0xd3ee('0xe')];})[_0xd3ee('0xf')](function(_0xd8945){logger[_0xd3ee('0x10')]('['+[_0x41a33e[_0xd3ee('0x11')]()]+_0xd3ee('0x12'));return _0xd8945['message'];});}function getUser(_0x322b29,_0x43c6df,_0x4129e1,_0x447bb2,_0x5e998b,_0x175f21){return new BPromise(function(_0x50e328,_0x28a616){return getAuthToken(_0x43c6df,_0x447bb2,_0x175f21)[_0xd3ee('0xd')](function(_0x367985){var _0x43207c={'method':_0xd3ee('0x13'),'uri':_0x5e998b+_0xd3ee('0x14'),'headers':{'Authorization':_0xd3ee('0x15')+_0x367985,'OData-Version':_0xd3ee('0x16')},'json':!![]};return rp(_0x43207c);})[_0xd3ee('0xd')](function(_0x196566){var _0x52c943=_0x196566[_0xd3ee('0x17')];var _0x4fda18=![];var _0xf9b2b8=null;if(!_[_0xd3ee('0x18')](_0x4129e1)){if(intUtil[_0xd3ee('0x19')](_0x4129e1['email'])){_0x322b29[_0xd3ee('0x1a')]=_0x4129e1[_0xd3ee('0x1b')];for(_0xf9b2b8=0x0;_0xf9b2b8<_0x52c943[_0xd3ee('0x1c')];_0xf9b2b8++){if(_0x52c943[_0xf9b2b8][_0xd3ee('0x1d')]===_0x4129e1[_0xd3ee('0x1b')]&&!_0x52c943[_0xf9b2b8][_0xd3ee('0x1e')]){_0x4fda18=!![];logger[_0xd3ee('0x1f')]('['+[_0x175f21[_0xd3ee('0x11')]()]+_0xd3ee('0x20')+_0x52c943[_0xf9b2b8]['systemuserid']+'!');_0x322b29[_0xd3ee('0x21')]=_0x52c943[_0xf9b2b8]['systemuserid'];}}}}if(!_0x4fda18){logger['info']('['+[_0x175f21[_0xd3ee('0x11')]()]+_0xd3ee('0x22'));_0x322b29[_0xd3ee('0x1a')]=_0x43c6df[_0xd3ee('0xc')];for(_0xf9b2b8=0x0;_0xf9b2b8<_0x52c943[_0xd3ee('0x1c')];_0xf9b2b8++){if(_0x52c943[_0xf9b2b8][_0xd3ee('0x1d')]===_0x43c6df[_0xd3ee('0xc')]){_0x322b29[_0xd3ee('0x21')]=_0x52c943[_0xf9b2b8][_0xd3ee('0x23')];}}}_0x50e328(_0x322b29);})[_0xd3ee('0xf')](function(_0x32388f){_0x28a616(_0x32388f[_0xd3ee('0x24')]);});});}function createEndUser(_0x2c8f8d,_0x402c91,_0x79d487,_0x4a4099,_0x5290bd,_0x33351c){return new BPromise(function(_0x30f8e9,_0x36976d){return getAuthToken(_0x402c91,_0x79d487,_0x33351c)[_0xd3ee('0xd')](function(_0x13fb23){var _0x365737=_0x33351c[_0xd3ee('0x25')]()==='outbound'?_0x5290bd[_0xd3ee('0x26')]:_0x5290bd[_0xd3ee('0x27')];var _0x32d47d={'method':_0xd3ee('0xa'),'uri':_0x4a4099+_0xd3ee('0x28'),'body':{'telephone1':_0x365737,'fullname':_0x365737,'firstname':_0x365737,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd3ee('0x29')+_0x2c8f8d[_0xd3ee('0x21')]+')'},'headers':{'Authorization':_0xd3ee('0x15')+_0x13fb23,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x32d47d);})['then'](function(_0x388a97){var _0x20db32=_0x388a97['headers'][_0xd3ee('0x2a')];var _0x328f24=_0x20db32['substring'](_0x20db32[_0xd3ee('0x2b')]('(')+0x1,_0x20db32['lastIndexOf'](')'));_0x2c8f8d[_0xd3ee('0x2c')]=_0x328f24;_0x30f8e9(_0x2c8f8d);})[_0xd3ee('0xf')](function(_0x2118ce){_0x36976d(_0x2118ce[_0xd3ee('0x24')]);});});}function getEndUser(_0xc3ece7,_0x19ad5a,_0x452df8,_0x271847,_0x16b1b5,_0x1966ee){return new BPromise(function(_0x5813ab,_0x124e99){return getAuthToken(_0x19ad5a,_0x452df8,_0x1966ee)['then'](function(_0x5c97ee){var _0x4e34f1={'method':_0xd3ee('0x13'),'uri':_0x271847+'contacts?$select=telephone1','headers':{'Authorization':_0xd3ee('0x15')+_0x5c97ee,'If-None-Match':null,'OData-Version':_0xd3ee('0x16')},'json':!![]};return rp(_0x4e34f1);})[_0xd3ee('0xd')](function(_0x245c34){var _0x3ee714=null;if(_0x245c34){var _0x375282=_0x245c34[_0xd3ee('0x17')];var _0x3ece78=![];for(_0x3ee714=0x0;_0x3ee714<_0x375282[_0xd3ee('0x1c')];_0x3ee714++){var _0x160d36=_0x1966ee[_0xd3ee('0x25')]()===_0xd3ee('0x2d')?_0x16b1b5['destcalleridnum']:_0x16b1b5[_0xd3ee('0x27')];if(_0x375282[_0x3ee714]['telephone1']===_0x160d36){_0x3ece78=!![];_0xc3ece7[_0xd3ee('0x2c')]=_0x375282[_0x3ee714][_0xd3ee('0x2e')];}}if(_0x3ece78){_0x5813ab(_0xc3ece7);}else{return createEndUser(_0xc3ece7,_0x19ad5a,_0x452df8,_0x271847,_0x16b1b5,_0x1966ee)['then'](function(_0x284ccc){logger[_0xd3ee('0x1f')]('['+[_0x1966ee['toUpperCase']()]+']\x20Enduser\x20created!',_0x284ccc[_0xd3ee('0x2c')]);_0x5813ab(_0x284ccc);});}}else{return createEndUser(_0xc3ece7,_0x19ad5a,_0x452df8,_0x271847,_0x16b1b5,_0x1966ee)[_0xd3ee('0xd')](function(_0x30b72a){logger['info']('['+[_0x1966ee[_0xd3ee('0x11')]()]+']\x20Enduser\x20Created!',_0x30b72a[_0xd3ee('0x2c')]);_0x5813ab(_0x30b72a);});}});});}function getCustomFields(_0x5da6f4,_0x410b04,_0x4ef7db){var _0x2bd54b={};if(_0x5da6f4[_0xd3ee('0x1c')]>0x0){_[_0xd3ee('0x2f')](_0x5da6f4,function(_0x5781a1){if(_0x5781a1[_0xd3ee('0x30')]===_0xd3ee('0x31')&&_0x5781a1[_0xd3ee('0x32')]&&!_0x5781a1[_0xd3ee('0x33')]){var _0x4501d6=_0x5781a1['idField'][_0xd3ee('0x25')]();var _0x5c5b01=_0x4501d6['substring'](0x0,_0x4501d6[_0xd3ee('0x34')]('_'));var _0x5cec36=_0x4501d6[_0xd3ee('0x35')](_0x4501d6[_0xd3ee('0x34')]('_')+0x1);if(_0x5c5b01===_0x4ef7db){_0x2bd54b[_0x5cec36]=_0x5781a1[_0xd3ee('0x36')];}}});}return _0x2bd54b;}function getTicket(_0x284e7d,_0x44defd,_0x15a225,_0x106e5e,_0x40f274,_0x5b455f,_0x4eb8e5){return new BPromise(function(_0x5297e4,_0x50a892){var _0x277e37;return getAuthToken(_0x44defd,_0x15a225,_0x4eb8e5)[_0xd3ee('0xd')](function(_0x18aa89){if(_0x5b455f[_0xd3ee('0x37')]==='incident'){_0x277e37={'method':_0xd3ee('0xa'),'uri':_0x106e5e+'incidents','body':Object[_0xd3ee('0x38')]({},{'title':intUtil['getString'](_0x5b455f[_0xd3ee('0x39')],_0x40f274,'\x20'),'description':intUtil[_0xd3ee('0x3a')](_0x5b455f['Descriptions'],_0x40f274,'\x0a'),'customerid_contact@odata.bind':_0xd3ee('0x3b')+_0x284e7d[_0xd3ee('0x2c')]+')','ownerid@odata.bind':_0xd3ee('0x29')+_0x284e7d[_0xd3ee('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x5b455f['Fields'],_0x40f274,_0x5b455f[_0xd3ee('0x37')])),'headers':{'Authorization':_0xd3ee('0x15')+_0x18aa89,'OData-Version':_0xd3ee('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5b455f[_0xd3ee('0x37')]==='phonecall'){_0x277e37={'method':_0xd3ee('0xa'),'uri':_0x106e5e+_0xd3ee('0x3c'),'body':Object[_0xd3ee('0x38')]({},{'subject':intUtil[_0xd3ee('0x3a')](_0x5b455f[_0xd3ee('0x39')],_0x40f274,'\x20'),'phonenumber':String(_0x40f274[_0xd3ee('0x27')]),'description':intUtil[_0xd3ee('0x3a')](_0x5b455f['Descriptions'],_0x40f274,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x284e7d['enduserId']+')','ownerid@odata.bind':_0xd3ee('0x29')+_0x284e7d[_0xd3ee('0x21')]+')','directioncode':_0x284e7d[_0xd3ee('0x3d')]===_0xd3ee('0x3e')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xd3ee('0x29')+_0x284e7d[_0xd3ee('0x21')]+')','participationtypemask':_0x284e7d['callDirection']===_0xd3ee('0x3e')?0x2:0x1},{'partyid_contact@odata.bind':_0xd3ee('0x3b')+_0x284e7d[_0xd3ee('0x2c')]+')','participationtypemask':_0x284e7d[_0xd3ee('0x3d')]==='queue'?0x1:0x2}]},getCustomFields(_0x5b455f[_0xd3ee('0x3f')],_0x40f274,_0x5b455f[_0xd3ee('0x37')])),'headers':{'Authorization':'Bearer\x20'+_0x18aa89,'OData-Version':_0xd3ee('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x277e37);})['then'](function(_0x2a2de8){var _0x5ec7cd=_0x2a2de8['headers']['odata-entityid'];var _0x44c57f=_0x5ec7cd[_0xd3ee('0x35')](_0x5ec7cd['lastIndexOf']('(')+0x1,_0x5ec7cd[_0xd3ee('0x2b')](')'));_0x284e7d[_0xd3ee('0x40')]=_0x44c57f;_0x5297e4(_0x284e7d);})['catch'](function(_0x5a1a67){_0x50a892(_0x5a1a67[_0xd3ee('0x24')]);});});}function emit(_0x4a1eba,_0x742392,_0x896caa,_0x19ed9e){var _0x398f18={'uri':util['format'](_0xd3ee('0x41'),_0x4a1eba,_0x896caa,_0x19ed9e)};io['to'](util[_0xd3ee('0x42')](_0xd3ee('0x43'),_0x742392))[_0xd3ee('0x44')]('trigger:browser:url',_0x398f18);}exports['cs']=function(_0x58ec62,_0x210af9,_0x2e8c99,_0x216068,_0x3b39e2,_0xeeb393,_0x2b6d1e,_0x25679a){var _0x2958d5={};_0xeeb393['remoteUri']=intUtil[_0xd3ee('0x45')](_0xeeb393[_0xd3ee('0x46')]);_0xeeb393['serverUrl']=intUtil[_0xd3ee('0x45')](_0xeeb393[_0xd3ee('0x47')]);_0x2958d5[_0xd3ee('0x3d')]=_0x25679a===_0xd3ee('0x3e')||_0x25679a===_0xd3ee('0x48')?_0xd3ee('0x3e'):_0xd3ee('0x2d');var _0x2fa8a7=util[_0xd3ee('0x42')](_0xd3ee('0x49'),_0xeeb393['remoteUri']);var _0x12eb8e=util[_0xd3ee('0x42')](_0xd3ee('0x4a'),_0xeeb393[_0xd3ee('0x4b')]);var _0x33eb06=util['format'](_0xd3ee('0x4c'),_0xeeb393[_0xd3ee('0x47')],_0x210af9['uniqueid'],md5(_0x210af9[_0xd3ee('0x4d')]));if(_0x3b39e2&&_0x3b39e2[_0xd3ee('0x4e')]){logger['info'](_0xd3ee('0x4f'),_0xd3ee('0x50'));_0x210af9[_0xd3ee('0x51')]=_0x33eb06;}else if(_0x2b6d1e&&_0x2b6d1e[_0xd3ee('0x52')]&&_0x2b6d1e[_0xd3ee('0x52')]!==_0xd3ee('0x53')){logger[_0xd3ee('0x1f')](_0xd3ee('0x54'),_0xd3ee('0x50'));_0x210af9[_0xd3ee('0x51')]=_0x33eb06;}else{_0x210af9['recordingURL']='';}return getUser(_0x2958d5,_0xeeb393,_0x216068,_0x12eb8e,_0x2fa8a7,_0x25679a)['then'](function(_0xd4ca0d){logger[_0xd3ee('0x1f')]('['+_0x25679a[_0xd3ee('0x11')]()+_0xd3ee('0x55'),_0xd4ca0d[_0xd3ee('0x21')]);logger[_0xd3ee('0x1f')]('['+_0x25679a[_0xd3ee('0x11')]()+']\x20The\x20User\x20email\x20is:',_0xd4ca0d[_0xd3ee('0x1a')]);return getEndUser(_0xd4ca0d,_0xeeb393,_0x12eb8e,_0x2fa8a7,_0x210af9,_0x25679a);})[_0xd3ee('0xd')](function(_0x432714){logger['info']('['+_0x25679a['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x432714['enduserId']);logger[_0xd3ee('0x1f')]('['+_0x25679a[_0xd3ee('0x11')]()+_0xd3ee('0x56'),_0x210af9[_0xd3ee('0x27')]);return getTicket(_0x432714,_0xeeb393,_0x12eb8e,_0x2fa8a7,_0x210af9,_0x2e8c99,_0x25679a);})['then'](function(_0x2647bf){logger[_0xd3ee('0x1f')](util[_0xd3ee('0x42')]('['+_0x25679a[_0xd3ee('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2e8c99[_0xd3ee('0x37')],_0x2647bf[_0xd3ee('0x40')]));logger[_0xd3ee('0x1f')](util['format']('['+_0x25679a[_0xd3ee('0x11')]()+_0xd3ee('0x57'),_0x25679a));if(_0x25679a!==_0xd3ee('0x48')){logger[_0xd3ee('0x1f')]('['+_0x25679a['toUpperCase']()+']',_0xd3ee('0x58'));emit(_0xeeb393[_0xd3ee('0x46')],_0x216068[_0xd3ee('0x59')],_0x2e8c99[_0xd3ee('0x37')],_0x2647bf[_0xd3ee('0x40')]);}})[_0xd3ee('0xf')](function(_0x476738){logger[_0xd3ee('0x10')]('['+_0x25679a['toUpperCase']()+_0xd3ee('0x5a'),util['inspect'](_0x476738,{'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 bfaf6f8..93ea738 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 _0x7b7f=['Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','toString','variableName','Variable','push','queue','stripTrailingSlash','monitor_format','recordingURL','serverUrl','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','abandoned','[ABANDONED]','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','Admin\x20account\x20selected.'];(function(_0x12d836,_0x3a72f8){var _0x488bf1=function(_0x14f410){while(--_0x14f410){_0x12d836['push'](_0x12d836['shift']());}};_0x488bf1(++_0x3a72f8);}(_0x7b7f,0xf0));var _0xf7b7=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x7b7f[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xf7b7('0x0'));var rp=require('request-promise');var md5=require(_0xf7b7('0x1'));var util=require('util');var Redis=require(_0xf7b7('0x2'));var intUtil=require(_0xf7b7('0x3'));var config=require(_0xf7b7('0x4'));var logger=require(_0xf7b7('0x5'))(_0xf7b7('0x6'));config['redis']=_[_0xf7b7('0x7')](config[_0xf7b7('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf7b7('0x9'))(new Redis(config[_0xf7b7('0x8')]));var headers={'Content-Type':_0xf7b7('0xa'),'Accept':_0xf7b7('0xa')};function emit(_0x12d0aa,_0x338ccb,_0x52db02){io['to'](_0x12d0aa)[_0xf7b7('0xb')](_0x338ccb,_0x52db02);}function getTicket(_0x5c8501,_0x310fbe,_0x2df001,_0x3ea596,_0x143f77){logger[_0xf7b7('0xc')](_0xf7b7('0xd'));var _0x2227e3=_[_0xf7b7('0xe')]({'responder_id':_0x310fbe['id'],'requester_id':_0x2df001['id'],'name':util[_0xf7b7('0xf')](_0xf7b7('0x10'),_0x143f77[_0xf7b7('0x11')]),'phone':_0x143f77[_0xf7b7('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf7b7('0x13')](_0x3ea596['Subjects'],_0x143f77,'\x20'),'description':intUtil['getString'](_0x3ea596[_0xf7b7('0x14')],_0x143f77,_0xf7b7('0x15')),'tags':getTags(_0x3ea596[_0xf7b7('0x16')],_0xf7b7('0x17'))},getCustomFields(_0x3ea596['Fields'],_0x143f77));_0x2227e3[_0xf7b7('0x18')]=_['mapValues'](_[_0xf7b7('0x19')](_0x2227e3['custom_fields'],'id'),_0xf7b7('0x1a'));return request({'uri':util[_0xf7b7('0xf')](_0xf7b7('0x1b'),_0x5c8501[_0xf7b7('0x1c')]),'method':_0xf7b7('0x1d'),'body':_0x2227e3})[_0xf7b7('0x1e')](function(_0xc7c6ed){logger[_0xf7b7('0xc')](_0xf7b7('0x1f'));return _0xc7c6ed;});}function getUser(_0x44c9e4,_0x51f7a7){if(intUtil[_0xf7b7('0x20')](_0x51f7a7)){return request({'uri':util['format'](_0xf7b7('0x21'),_0x44c9e4[_0xf7b7('0x1c')]),'qs':{'email':_0x51f7a7}})[_0xf7b7('0x1e')](function(_0x824e7d){if(_0x824e7d[_0xf7b7('0x22')]){logger[_0xf7b7('0xc')](_0xf7b7('0x23'));return _['find'](_0x824e7d,function(_0x525d9c){return _0x525d9c[_0xf7b7('0x24')][_0xf7b7('0x25')]===_0x51f7a7;});}else{logger[_0xf7b7('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x44c9e4['remoteUri'])})[_0xf7b7('0x1e')](function(_0x4b1e4e){logger[_0xf7b7('0xc')](_0xf7b7('0x26'));return _0x4b1e4e;});}});}else{logger[_0xf7b7('0xc')](_0xf7b7('0x27'));return request({'uri':util['format'](_0xf7b7('0x28'),_0x44c9e4[_0xf7b7('0x1c')])})[_0xf7b7('0x1e')](function(_0x5e553a){logger[_0xf7b7('0xc')](_0xf7b7('0x26'));return _0x5e553a;});}}function getEndUser(_0x164add,_0x50c18b,_0x20e80c){logger['info'](_0xf7b7('0x29'),_0x20e80c);return request({'uri':util[_0xf7b7('0xf')](_0xf7b7('0x2a'),_0x164add[_0xf7b7('0x1c')]),'qs':{'phone':_0x20e80c}})[_0xf7b7('0x1e')](function(_0x53f507){if(_0x53f507[_0xf7b7('0x22')]){logger['info'](_0xf7b7('0x2b'));return _[_0xf7b7('0x2c')](_0x53f507,{'phone':_0x20e80c});}else{logger[_0xf7b7('0xc')](_0xf7b7('0x2d'));return request({'uri':util[_0xf7b7('0xf')](_0xf7b7('0x2a'),_0x164add[_0xf7b7('0x1c')]),'method':_0xf7b7('0x1d'),'body':{'name':_0x50c18b,'phone':_0x20e80c}})[_0xf7b7('0x1e')](function(_0x15ecb0){logger['info'](_0xf7b7('0x2e'));return _0x15ecb0;});}});}function getAuth(_0x48fa5d){return util['format'](_0xf7b7('0x2f'),new Buffer(_0x48fa5d[_0xf7b7('0x30')]+':X')['toString'](_0xf7b7('0x31')));}function request(_0x39fd00){logger['debug'](_0xf7b7('0x32'),JSON['stringify'](_0x39fd00));return rp(_[_0xf7b7('0x7')](_0x39fd00,{'method':_0xf7b7('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x4665ae,_0x569148){var _0x50c22e=[];if(_0x4665ae&&_0x4665ae[_0xf7b7('0x22')]>0x0){_0x50c22e=_[_0xf7b7('0x34')](_0x4665ae,_0x569148);}return _0x50c22e;}function getCustomFields(_0x422f1c,_0x35347c){var _0x22a332=[];var _0x36b5bc={'custom_fields':[]};if(_0x422f1c['length']>0x0){_[_0xf7b7('0x35')](_0x422f1c,function(_0x385ca0){if(_0x385ca0[_0xf7b7('0x36')]===_0xf7b7('0x37')&&_0x385ca0[_0xf7b7('0x38')]&&!_0x385ca0[_0xf7b7('0x39')]){_0x36b5bc[_0x385ca0[_0xf7b7('0x38')][_0xf7b7('0x3a')]()]=_0x385ca0[_0xf7b7('0x3b')]['toString']();}else if(_0x385ca0[_0xf7b7('0x36')]===_0xf7b7('0x37')&&_0x385ca0['idField']&&_0x385ca0['customField']){_0x36b5bc[_0xf7b7('0x18')]['push']({'id':_0x385ca0[_0xf7b7('0x3c')],'value':_0x385ca0[_0xf7b7('0x3b')][_0xf7b7('0x3d')]()});}else if(_0x385ca0['type']==='variable'&&_0x385ca0[_0xf7b7('0x3e')]&&_0x385ca0[_0xf7b7('0x3c')]&&_0x385ca0[_0xf7b7('0x39')]){_0x35347c[_0x385ca0[_0xf7b7('0x3e')]]&&_0x36b5bc['custom_fields']['push']({'id':_0x385ca0['idField'],'value':_0x35347c[_0x385ca0['variableName']]['toString']()});}else if(_0x385ca0[_0xf7b7('0x36')]==='customVariable'&&_0x385ca0[_0xf7b7('0x3f')]&&_0x385ca0[_0xf7b7('0x3f')][_0xf7b7('0x17')]&&_0x385ca0[_0xf7b7('0x3c')]&&_0x385ca0[_0xf7b7('0x39')]){_0x35347c[_0x385ca0[_0xf7b7('0x3f')][_0xf7b7('0x17')][_0xf7b7('0x3a')]()]&&_0x36b5bc[_0xf7b7('0x18')][_0xf7b7('0x40')]({'id':_0x385ca0[_0xf7b7('0x3c')],'value':_0x35347c[_0x385ca0['Variable'][_0xf7b7('0x17')][_0xf7b7('0x3a')]()][_0xf7b7('0x3d')]()});}});}return _0x36b5bc;}exports[_0xf7b7('0x41')]=function(_0x3c684b,_0x16214f,_0x329632,_0x26f5d9,_0x4cc423,_0x5c14ee){var _0x1d285f,_0x56aa02;_0x5c14ee[_0xf7b7('0x1c')]=intUtil[_0xf7b7('0x42')](_0x5c14ee[_0xf7b7('0x1c')]);_0x5c14ee['serverUrl']=intUtil[_0xf7b7('0x42')](_0x5c14ee['serverUrl']);if(_0x4cc423&&_0x4cc423[_0xf7b7('0x43')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x16214f[_0xf7b7('0x44')]=util[_0xf7b7('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c14ee[_0xf7b7('0x45')],_0x16214f[_0xf7b7('0x46')],md5(_0x16214f[_0xf7b7('0x46')]));}else{_0x16214f['recordingURL']='';}headers[_0xf7b7('0x47')]=getAuth(_0x5c14ee);return getUser(_0x5c14ee,_0x26f5d9[_0xf7b7('0x25')])[_0xf7b7('0x1e')](function(_0x492a16){_0x1d285f=_0x492a16;logger[_0xf7b7('0xc')](_0xf7b7('0x48'),_0x1d285f['id']);return getEndUser(_0x5c14ee,_0x16214f[_0xf7b7('0x11')],_0x16214f['calleridnum']);})[_0xf7b7('0x1e')](function(_0x252eab){_0x56aa02=_0x252eab;logger[_0xf7b7('0xc')](_0xf7b7('0x49'),_0x56aa02['id']);return getTicket(_0x5c14ee,_0x1d285f,_0x56aa02,_0x329632,_0x16214f);})['then'](function(_0x2a8bcd){if(_0x2a8bcd&&_0x2a8bcd['id']){logger[_0xf7b7('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2a8bcd['id']);logger[_0xf7b7('0xc')](_0xf7b7('0x4a'),_0xf7b7('0x4b'));emit(util[_0xf7b7('0xf')]('user:%s',_0x26f5d9['name']),'trigger:browser:url',{'uri':util[_0xf7b7('0xf')](_0xf7b7('0x4c'),_0x5c14ee['remoteUri'],_0x2a8bcd['id'])});}})['catch'](function(_0x4038b7){logger['error'](_0xf7b7('0x4a'),JSON[_0xf7b7('0x4d')](_0x4038b7));});};exports[_0xf7b7('0x4e')]=function(_0xb5a7ab,_0x302adb,_0x5ecc78,_0x3fb25e,_0x2f64d9,_0x197645,_0x7136e0){var _0x43b12b,_0x1d19b2;_0x197645['remoteUri']=intUtil[_0xf7b7('0x42')](_0x197645[_0xf7b7('0x1c')]);_0x197645['serverUrl']=intUtil[_0xf7b7('0x42')](_0x197645[_0xf7b7('0x45')]);if(_0x7136e0&&_0x7136e0['recordingFormat']&&_0x7136e0[_0xf7b7('0x4f')]!==_0xf7b7('0x50')){logger[_0xf7b7('0xc')](_0xf7b7('0x51'),_0xf7b7('0x52'));_0x302adb[_0xf7b7('0x44')]=util['format'](_0xf7b7('0x53'),_0x197645['serverUrl'],_0x302adb['uniqueid'],md5(_0x302adb[_0xf7b7('0x46')]));}headers[_0xf7b7('0x47')]=getAuth(_0x197645);return getUser(_0x197645,_0x3fb25e['email'])[_0xf7b7('0x1e')](function(_0x1e9fd5){_0x43b12b=_0x1e9fd5;logger['info'](_0xf7b7('0x48'),_0x43b12b['id']);return getEndUser(_0x197645,_0x302adb[_0xf7b7('0x54')],_0x302adb[_0xf7b7('0x55')]);})[_0xf7b7('0x1e')](function(_0x375852){_0x1d19b2=_0x375852;logger['info'](_0xf7b7('0x49'),_0x1d19b2['id']);return getTicket(_0x197645,_0x43b12b,_0x1d19b2,_0x5ecc78,_0x302adb);})[_0xf7b7('0x1e')](function(_0x5b011f){if(_0x5b011f&&_0x5b011f['id']){logger[_0xf7b7('0xc')](_0xf7b7('0x1f'));logger['info'](_0xf7b7('0x56'),_0x5b011f['id']);logger[_0xf7b7('0xc')]('[OUTBOUND]',_0xf7b7('0x4b'));emit(util['format'](_0xf7b7('0x57'),_0x3fb25e[_0xf7b7('0x17')]),_0xf7b7('0x58'),{'uri':util[_0xf7b7('0xf')](_0xf7b7('0x4c'),_0x197645[_0xf7b7('0x1c')],_0x5b011f['id'])});}})[_0xf7b7('0x59')](function(_0x5b820e){logger[_0xf7b7('0x5a')]('[OUTBOUND]',JSON[_0xf7b7('0x4d')](_0x5b820e));});};exports[_0xf7b7('0x5b')]=function(_0x3714f5,_0x38329d,_0x469e1f,_0x290594,_0x3e31f4,_0x57d51e){var _0x498f55,_0x444867;_0x57d51e[_0xf7b7('0x1c')]=intUtil[_0xf7b7('0x42')](_0x57d51e['remoteUri']);_0x57d51e[_0xf7b7('0x45')]=intUtil[_0xf7b7('0x42')](_0x57d51e['serverUrl']);if(_0x3e31f4&&_0x3e31f4[_0xf7b7('0x43')]){logger['info'](_0xf7b7('0x5c'),_0xf7b7('0x52'));_0x38329d['recordingURL']=util['format'](_0xf7b7('0x53'),_0x57d51e[_0xf7b7('0x45')],_0x38329d['uniqueid'],md5(_0x38329d[_0xf7b7('0x46')]));}else{_0x38329d[_0xf7b7('0x44')]='';}headers['Authorization']=getAuth(_0x57d51e);return getUser(_0x57d51e,'')[_0xf7b7('0x1e')](function(_0x5d815d){_0x498f55=_0x5d815d;logger[_0xf7b7('0xc')](_0xf7b7('0x48'),_0x498f55['id']);return getEndUser(_0x57d51e,_0x38329d[_0xf7b7('0x11')],_0x38329d[_0xf7b7('0x12')]);})[_0xf7b7('0x1e')](function(_0x5a77a2){_0x444867=_0x5a77a2;logger[_0xf7b7('0xc')](_0xf7b7('0x49'),_0x444867['id']);return getTicket(_0x57d51e,_0x498f55,_0x444867,_0x469e1f,_0x38329d);})[_0xf7b7('0x1e')](function(_0x559226){if(_0x559226){logger[_0xf7b7('0xc')]('Ticket\x20created!');logger[_0xf7b7('0xc')](_0xf7b7('0x56'),_0x559226['id']);}})[_0xf7b7('0x59')](function(_0x128937){logger[_0xf7b7('0x5a')](_0xf7b7('0x5c'),JSON[_0xf7b7('0x4d')](_0x128937));});}; \ No newline at end of file +var _0x5489=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','catch','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','name','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','forEach','type','nameField','customField','toLowerCase','content','string','idField','variable','variableName','customVariable','Variable','push','queue'];(function(_0x18c6ca,_0xe39ee7){var _0x445129=function(_0x37bb1c){while(--_0x37bb1c){_0x18c6ca['push'](_0x18c6ca['shift']());}};_0x445129(++_0xe39ee7);}(_0x5489,0x186));var _0x9548=function(_0x3e7c57,_0x3bec31){_0x3e7c57=_0x3e7c57-0x0;var _0x3c034d=_0x5489[_0x3e7c57];return _0x3c034d;};'use strict';var _=require(_0x9548('0x0'));var rp=require(_0x9548('0x1'));var md5=require(_0x9548('0x2'));var util=require(_0x9548('0x3'));var Redis=require('ioredis');var intUtil=require(_0x9548('0x4'));var config=require(_0x9548('0x5'));var logger=require(_0x9548('0x6'))(_0x9548('0x7'));config[_0x9548('0x8')]=_['defaults'](config[_0x9548('0x8')],{'host':_0x9548('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9548('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x9548('0xa')};function emit(_0x295781,_0x2c6e46,_0x1c9a29){io['to'](_0x295781)[_0x9548('0xb')](_0x2c6e46,_0x1c9a29);}function getTicket(_0x397d59,_0x57cc41,_0x3757c4,_0x320b92,_0x27e95e){logger[_0x9548('0xc')](_0x9548('0xd'));var _0x4bbeb2=_[_0x9548('0xe')]({'responder_id':_0x57cc41['id'],'requester_id':_0x3757c4['id'],'name':util[_0x9548('0xf')](_0x9548('0x10'),_0x27e95e[_0x9548('0x11')]),'phone':_0x27e95e[_0x9548('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9548('0x13')](_0x320b92[_0x9548('0x14')],_0x27e95e,'\x20'),'description':intUtil['getString'](_0x320b92['Descriptions'],_0x27e95e,_0x9548('0x15')),'tags':getTags(_0x320b92[_0x9548('0x16')],_0x9548('0x17'))},getCustomFields(_0x320b92['Fields'],_0x27e95e));_0x4bbeb2[_0x9548('0x18')]=_[_0x9548('0x19')](_[_0x9548('0x1a')](_0x4bbeb2[_0x9548('0x18')],'id'),'value');return request({'uri':util['format'](_0x9548('0x1b'),_0x397d59[_0x9548('0x1c')]),'method':_0x9548('0x1d'),'body':_0x4bbeb2})[_0x9548('0x1e')](function(_0x45de0c){logger[_0x9548('0xc')]('Ticket\x20created!');return _0x45de0c;});}function getUser(_0x13c5b1,_0x2a80ea){if(intUtil[_0x9548('0x1f')](_0x2a80ea)){return request({'uri':util['format'](_0x9548('0x20'),_0x13c5b1['remoteUri']),'qs':{'email':_0x2a80ea}})['then'](function(_0x36ec18){if(_0x36ec18[_0x9548('0x21')]){logger['info']('Agent\x20found!');return _[_0x9548('0x22')](_0x36ec18,function(_0x40ec19){return _0x40ec19[_0x9548('0x23')]['email']===_0x2a80ea;});}else{logger[_0x9548('0xc')](_0x9548('0x24'));return request({'uri':util['format'](_0x9548('0x25'),_0x13c5b1['remoteUri'])})[_0x9548('0x1e')](function(_0x537041){logger[_0x9548('0xc')](_0x9548('0x26'));return _0x537041;});}});}else{logger[_0x9548('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9548('0xf')]('%s/api/v2/agents/me',_0x13c5b1['remoteUri'])})[_0x9548('0x1e')](function(_0x4fcc6f){logger['info'](_0x9548('0x26'));return _0x4fcc6f;});}}function getEndUser(_0x196bdb,_0xa432b8,_0x440787){logger[_0x9548('0xc')]('Searching\x20enduser\x20with\x20phone',_0x440787);return request({'uri':util['format'](_0x9548('0x27'),_0x196bdb[_0x9548('0x1c')]),'qs':{'phone':_0x440787}})['then'](function(_0x4711b3){if(_0x4711b3[_0x9548('0x21')]){logger[_0x9548('0xc')]('Enduser\x20found!');return _[_0x9548('0x22')](_0x4711b3,{'phone':_0x440787});}else{logger[_0x9548('0xc')](_0x9548('0x28'));return request({'uri':util[_0x9548('0xf')](_0x9548('0x27'),_0x196bdb[_0x9548('0x1c')]),'method':_0x9548('0x1d'),'body':{'name':_0xa432b8,'phone':_0x440787}})['then'](function(_0x3c6cc9){logger[_0x9548('0xc')](_0x9548('0x29'));return _0x3c6cc9;});}});}function getAuth(_0x4ec57e){return util[_0x9548('0xf')](_0x9548('0x2a'),new Buffer(_0x4ec57e[_0x9548('0x2b')]+':X')[_0x9548('0x2c')](_0x9548('0x2d')));}function request(_0x8b6ef3){logger[_0x9548('0x2e')](_0x9548('0x2f'),JSON[_0x9548('0x30')](_0x8b6ef3));return rp(_[_0x9548('0x31')](_0x8b6ef3,{'method':_0x9548('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x22657c,_0x50df50){var _0x3f325e=[];if(_0x22657c&&_0x22657c[_0x9548('0x21')]>0x0){_0x3f325e=_['map'](_0x22657c,_0x50df50);}return _0x3f325e;}function getCustomFields(_0x2a5c46,_0x2dbd67){var _0x310754=[];var _0x221732={'custom_fields':[]};if(_0x2a5c46['length']>0x0){_[_0x9548('0x33')](_0x2a5c46,function(_0x449df3){if(_0x449df3[_0x9548('0x34')]==='string'&&_0x449df3[_0x9548('0x35')]&&!_0x449df3[_0x9548('0x36')]){_0x221732[_0x449df3[_0x9548('0x35')][_0x9548('0x37')]()]=_0x449df3[_0x9548('0x38')][_0x9548('0x2c')]();}else if(_0x449df3[_0x9548('0x34')]===_0x9548('0x39')&&_0x449df3['idField']&&_0x449df3[_0x9548('0x36')]){_0x221732[_0x9548('0x18')]['push']({'id':_0x449df3[_0x9548('0x3a')],'value':_0x449df3[_0x9548('0x38')][_0x9548('0x2c')]()});}else if(_0x449df3[_0x9548('0x34')]===_0x9548('0x3b')&&_0x449df3[_0x9548('0x3c')]&&_0x449df3[_0x9548('0x3a')]&&_0x449df3['customField']){_0x2dbd67[_0x449df3[_0x9548('0x3c')]]&&_0x221732[_0x9548('0x18')]['push']({'id':_0x449df3[_0x9548('0x3a')],'value':_0x2dbd67[_0x449df3[_0x9548('0x3c')]][_0x9548('0x2c')]()});}else if(_0x449df3[_0x9548('0x34')]===_0x9548('0x3d')&&_0x449df3['Variable']&&_0x449df3[_0x9548('0x3e')]['name']&&_0x449df3[_0x9548('0x3a')]&&_0x449df3[_0x9548('0x36')]){_0x2dbd67[_0x449df3['Variable'][_0x9548('0x17')]['toLowerCase']()]&&_0x221732[_0x9548('0x18')][_0x9548('0x3f')]({'id':_0x449df3[_0x9548('0x3a')],'value':_0x2dbd67[_0x449df3[_0x9548('0x3e')][_0x9548('0x17')][_0x9548('0x37')]()][_0x9548('0x2c')]()});}});}return _0x221732;}exports[_0x9548('0x40')]=function(_0x4c1116,_0x28fa18,_0x1e8e2d,_0x47a6b1,_0x393abe,_0x242665){var _0x4cab65,_0x49a683;_0x242665['remoteUri']=intUtil[_0x9548('0x41')](_0x242665[_0x9548('0x1c')]);_0x242665['serverUrl']=intUtil[_0x9548('0x41')](_0x242665[_0x9548('0x42')]);if(_0x393abe&&_0x393abe[_0x9548('0x43')]){logger['info'](_0x9548('0x44'),'Recording\x20is\x20enabled!');_0x28fa18[_0x9548('0x45')]=util['format'](_0x9548('0x46'),_0x242665[_0x9548('0x42')],_0x28fa18[_0x9548('0x47')],md5(_0x28fa18[_0x9548('0x47')]));}else{_0x28fa18[_0x9548('0x45')]='';}headers[_0x9548('0x48')]=getAuth(_0x242665);return getUser(_0x242665,_0x47a6b1['email'])[_0x9548('0x1e')](function(_0x45b901){_0x4cab65=_0x45b901;logger[_0x9548('0xc')](_0x9548('0x49'),_0x4cab65['id']);return getEndUser(_0x242665,_0x28fa18[_0x9548('0x11')],_0x28fa18[_0x9548('0x12')]);})[_0x9548('0x1e')](function(_0x3b23d8){_0x49a683=_0x3b23d8;logger[_0x9548('0xc')](_0x9548('0x4a'),_0x49a683['id']);return getTicket(_0x242665,_0x4cab65,_0x49a683,_0x1e8e2d,_0x28fa18);})[_0x9548('0x1e')](function(_0x43aedf){if(_0x43aedf&&_0x43aedf['id']){logger[_0x9548('0xc')](_0x9548('0x4b'));logger['info'](_0x9548('0x4c'),_0x43aedf['id']);logger[_0x9548('0xc')]('[QUEUE]',_0x9548('0x4d'));emit(util['format'](_0x9548('0x4e'),_0x47a6b1[_0x9548('0x17')]),_0x9548('0x4f'),{'uri':util[_0x9548('0xf')](_0x9548('0x50'),_0x242665[_0x9548('0x1c')],_0x43aedf['id'])});}})['catch'](function(_0x27fe11){logger[_0x9548('0x51')](_0x9548('0x44'),JSON[_0x9548('0x30')](_0x27fe11));});};exports[_0x9548('0x52')]=function(_0x5489dc,_0x575cde,_0x1afcfa,_0x167ecc,_0x167511,_0x18c989,_0x5a1df6){var _0xf4784c,_0x3caef2;_0x18c989[_0x9548('0x1c')]=intUtil[_0x9548('0x41')](_0x18c989[_0x9548('0x1c')]);_0x18c989[_0x9548('0x42')]=intUtil[_0x9548('0x41')](_0x18c989[_0x9548('0x42')]);if(_0x5a1df6&&_0x5a1df6[_0x9548('0x53')]&&_0x5a1df6['recordingFormat']!=='none'){logger[_0x9548('0xc')](_0x9548('0x54'),_0x9548('0x55'));_0x575cde[_0x9548('0x45')]=util['format'](_0x9548('0x46'),_0x18c989[_0x9548('0x42')],_0x575cde['uniqueid'],md5(_0x575cde['uniqueid']));}headers[_0x9548('0x48')]=getAuth(_0x18c989);return getUser(_0x18c989,_0x167ecc[_0x9548('0x56')])[_0x9548('0x1e')](function(_0x5c7cbd){_0xf4784c=_0x5c7cbd;logger[_0x9548('0xc')](_0x9548('0x49'),_0xf4784c['id']);return getEndUser(_0x18c989,_0x575cde[_0x9548('0x57')],_0x575cde[_0x9548('0x58')]);})['then'](function(_0x1dc93a){_0x3caef2=_0x1dc93a;logger[_0x9548('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3caef2['id']);return getTicket(_0x18c989,_0xf4784c,_0x3caef2,_0x1afcfa,_0x575cde);})[_0x9548('0x1e')](function(_0x2c4437){if(_0x2c4437&&_0x2c4437['id']){logger['info'](_0x9548('0x4b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2c4437['id']);logger[_0x9548('0xc')](_0x9548('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9548('0x4e'),_0x167ecc[_0x9548('0x17')]),_0x9548('0x4f'),{'uri':util[_0x9548('0xf')](_0x9548('0x50'),_0x18c989[_0x9548('0x1c')],_0x2c4437['id'])});}})[_0x9548('0x59')](function(_0x418baa){logger['error'](_0x9548('0x54'),JSON[_0x9548('0x30')](_0x418baa));});};exports['abandoned']=function(_0x1e9e56,_0x172c7c,_0x31216e,_0x5514d8,_0x5b624f,_0x12752a){var _0x1a4ec9,_0x3026cf;_0x12752a[_0x9548('0x1c')]=intUtil['stripTrailingSlash'](_0x12752a['remoteUri']);_0x12752a['serverUrl']=intUtil['stripTrailingSlash'](_0x12752a[_0x9548('0x42')]);if(_0x5b624f&&_0x5b624f[_0x9548('0x43')]){logger[_0x9548('0xc')](_0x9548('0x5a'),_0x9548('0x55'));_0x172c7c[_0x9548('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12752a['serverUrl'],_0x172c7c['uniqueid'],md5(_0x172c7c[_0x9548('0x47')]));}else{_0x172c7c[_0x9548('0x45')]='';}headers[_0x9548('0x48')]=getAuth(_0x12752a);return getUser(_0x12752a,'')[_0x9548('0x1e')](function(_0x567541){_0x1a4ec9=_0x567541;logger[_0x9548('0xc')](_0x9548('0x49'),_0x1a4ec9['id']);return getEndUser(_0x12752a,_0x172c7c[_0x9548('0x11')],_0x172c7c[_0x9548('0x12')]);})['then'](function(_0x31dfe1){_0x3026cf=_0x31dfe1;logger[_0x9548('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3026cf['id']);return getTicket(_0x12752a,_0x1a4ec9,_0x3026cf,_0x31216e,_0x172c7c);})[_0x9548('0x1e')](function(_0x2c9381){if(_0x2c9381){logger[_0x9548('0xc')](_0x9548('0x4b'));logger[_0x9548('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2c9381['id']);}})[_0x9548('0x59')](function(_0x4e59d7){logger[_0x9548('0x51')](_0x9548('0x5a'),JSON[_0x9548('0x30')](_0x4e59d7));});}; \ 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 e4c2a03..2488558 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 _0x61b4=['servicenow','dynamics365','exec','data1','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','toLowerCase','error','../../../../config/logger','[EXEC]','format','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x61b4,0xf8));var _0x461b=function(_0x49143c,_0x3f6ad1){_0x49143c=_0x49143c-0x0;var _0xfa7854=_0x61b4[_0x49143c];return _0xfa7854;};'use strict';var _=require(_0x461b('0x0'));var util=require(_0x461b('0x1'));var zendesk=require(_0x461b('0x2'));var salesforce=require(_0x461b('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x461b('0x4'));var zoho=require(_0x461b('0x5'));var desk=require(_0x461b('0x6'));var vtiger=require(_0x461b('0x7'));var servicenow=require(_0x461b('0x8'));var dynamics365=require(_0x461b('0x9'));var integrations=['zendesk',_0x461b('0xa'),_0x461b('0xb'),_0x461b('0xc'),_0x461b('0xd'),_0x461b('0xe'),_0x461b('0xf'),_0x461b('0x10'),_0x461b('0x11')];exports[_0x461b('0x12')]=function(_0x1cb61a,_0x5f2c67,_0x37bef9,_0xd78fc0,_0x4d8a09,_0x5246aa){if(_0x37bef9){if(_['includes'](integrations,_0x1cb61a[_0x461b('0x13')]['toLowerCase']())){try{var _0x404ded=null;var _0x25183c='';var _0x25c460=_0x37bef9[_0x1cb61a['data1']['toLowerCase']()];if(_0x25c460){var _0xdb5f05=_0x25c460[_0x1cb61a[_0x461b('0x14')]];if(_0xdb5f05){var _0xcae79a=_['find'](_0xdb5f05[_0x461b('0x15')],{'id':parseInt(_0x1cb61a[_0x461b('0x16')],0xa)});if(_0xcae79a){if(_0xd78fc0){if(_0x4d8a09&&_0x5f2c67[_0x461b('0x17')]){_0x25183c=_0x461b('0x17');}else if(_0x5f2c67[_0x461b('0x18')]){_0x25183c=_0x461b('0x19');}else{console[_0x461b('0x1a')](_0x461b('0x1b'),_0x5f2c67);}}else{_0x25183c='abandoned';}switch(_0x1cb61a[_0x461b('0x13')][_0x461b('0x1c')]()){case'zendesk':zendesk[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case _0x461b('0xa'):salesforce[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case _0x461b('0xb'):sugarcrm[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case'freshdesk':freshdesk[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case'zoho':zoho[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case _0x461b('0xe'):desk[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case _0x461b('0xf'):vtiger[_0x25183c](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa);break;case'servicenow':servicenow['cs'](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa,_0x25183c);break;case _0x461b('0x11'):dynamics365['cs'](_0x1cb61a,_0x5f2c67,_0xcae79a,_0xd78fc0,_0x4d8a09,_0xdb5f05,_0x5246aa,_0x25183c);break;default:console[_0x461b('0x1a')]('unknown\x20integration');}}else{_0x404ded=require('../../../../config/logger')(_0x1cb61a['data1'][_0x461b('0x1c')]());_0x404ded[_0x461b('0x1d')]('[EXEC]',util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x1cb61a[_0x461b('0x13')]['toLowerCase'](),_0x1cb61a[_0x461b('0x16')]));}}else{_0x404ded=require(_0x461b('0x1e'))(_0x1cb61a[_0x461b('0x13')][_0x461b('0x1c')]());_0x404ded[_0x461b('0x1d')](_0x461b('0x1f'),util[_0x461b('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x1cb61a[_0x461b('0x13')]['toLowerCase'](),_0x1cb61a[_0x461b('0x14')]));}}else{}}catch(_0x8931d3){console[_0x461b('0x1d')](_0x8931d3);}}}}; \ No newline at end of file +var _0x8340=['unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','zoho','desk','vtiger','servicenow','dynamics365','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','abandoned','sugarcrm','freshdesk','log'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x8340,0x12f));var _0x0834=function(_0x251dc3,_0x3bbb14){_0x251dc3=_0x251dc3-0x0;var _0x1f13e5=_0x8340[_0x251dc3];return _0x1f13e5;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x0834('0x0'));var salesforce=require(_0x0834('0x1'));var sugarcrm=require(_0x0834('0x2'));var freshdesk=require(_0x0834('0x3'));var zoho=require(_0x0834('0x4'));var desk=require('./desk');var vtiger=require(_0x0834('0x5'));var servicenow=require(_0x0834('0x6'));var dynamics365=require(_0x0834('0x7'));var integrations=[_0x0834('0x8'),_0x0834('0x9'),'sugarcrm','freshdesk',_0x0834('0xa'),_0x0834('0xb'),_0x0834('0xc'),_0x0834('0xd'),_0x0834('0xe')];exports['exec']=function(_0x2a43bc,_0x30eb19,_0x468d78,_0x31ffbf,_0x2b243c,_0x52701b){if(_0x468d78){if(_[_0x0834('0xf')](integrations,_0x2a43bc[_0x0834('0x10')][_0x0834('0x11')]())){try{var _0x3c2b09=null;var _0x388bb6='';var _0x15741c=_0x468d78[_0x2a43bc[_0x0834('0x10')]['toLowerCase']()];if(_0x15741c){var _0x2abd1d=_0x15741c[_0x2a43bc[_0x0834('0x12')]];if(_0x2abd1d){var _0x54799d=_[_0x0834('0x13')](_0x2abd1d[_0x0834('0x14')],{'id':parseInt(_0x2a43bc[_0x0834('0x15')],0xa)});if(_0x54799d){if(_0x31ffbf){if(_0x2b243c&&_0x30eb19[_0x0834('0x16')]){_0x388bb6='queue';}else if(_0x30eb19[_0x0834('0x17')]){_0x388bb6=_0x0834('0x18');}else{console['log'](_0x0834('0x19'),_0x30eb19);}}else{_0x388bb6=_0x0834('0x1a');}switch(_0x2a43bc[_0x0834('0x10')][_0x0834('0x11')]()){case _0x0834('0x8'):zendesk[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case _0x0834('0x9'):salesforce[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case _0x0834('0x1b'):sugarcrm[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case _0x0834('0x1c'):freshdesk[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case _0x0834('0xa'):zoho[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case _0x0834('0xb'):desk[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case _0x0834('0xc'):vtiger[_0x388bb6](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b);break;case'servicenow':servicenow['cs'](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b,_0x388bb6);break;case'dynamics365':dynamics365['cs'](_0x2a43bc,_0x30eb19,_0x54799d,_0x31ffbf,_0x2b243c,_0x2abd1d,_0x52701b,_0x388bb6);break;default:console[_0x0834('0x1d')](_0x0834('0x1e'));}}else{_0x3c2b09=require('../../../../config/logger')(_0x2a43bc['data1'][_0x0834('0x11')]());_0x3c2b09[_0x0834('0x1f')](_0x0834('0x20'),util['format'](_0x0834('0x21'),_0x2a43bc[_0x0834('0x10')][_0x0834('0x11')](),_0x2a43bc[_0x0834('0x15')]));}}else{_0x3c2b09=require(_0x0834('0x22'))(_0x2a43bc['data1'][_0x0834('0x11')]());_0x3c2b09['error'](_0x0834('0x20'),util[_0x0834('0x23')](_0x0834('0x24'),_0x2a43bc[_0x0834('0x10')][_0x0834('0x11')](),_0x2a43bc[_0x0834('0x12')]));}}else{}}catch(_0x43f938){console[_0x0834('0x1f')](_0x43f938);}}}}; \ 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 8c45e65..cb02e4b 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 _0xb115=['Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','forEach','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','lodash','request-promise','moment','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','ticketType','Task','assign','utc','Subjects','getString','Descriptions','Case','sobject','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','moduleSearch','contact_lead','Contact','Lead','contact','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate'];(function(_0x578ed8,_0x2e3674){var _0x5a13a5=function(_0x30199e){while(--_0x30199e){_0x578ed8['push'](_0x578ed8['shift']());}};_0x5a13a5(++_0x2e3674);}(_0xb115,0x116));var _0x5b11=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb115[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5b11('0x0'));var rp=require(_0x5b11('0x1'));var moment=require(_0x5b11('0x2'));var BPromise=require(_0x5b11('0x3'));var md5=require(_0x5b11('0x4'));var jsforce=require('jsforce');var util=require(_0x5b11('0x5'));var Redis=require('ioredis');var intUtil=require(_0x5b11('0x6'));var config=require(_0x5b11('0x7'));var logger=require(_0x5b11('0x8'))(_0x5b11('0x9'));config[_0x5b11('0xa')]=_[_0x5b11('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5b11('0xc'))(new Redis(config[_0x5b11('0xa')]));function emit(_0x25b7f0,_0xf8f2af,_0x20463d){io['to'](_0x25b7f0)[_0x5b11('0xd')](_0xf8f2af,_0x20463d);}function getTicket(_0x11d0cc,_0x20c92d,_0x2d641b,_0x238467,_0x1ae80a,_0xcce22e,_0x558fcd,_0x163938){var _0xb6db9d={};if(_0x238467[_0x5b11('0xe')]===_0x5b11('0xf')){_0xb6db9d=Object[_0x5b11('0x10')]({},{'OwnerId':_0x20c92d['id'],'ActivityDate':moment[_0x5b11('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x238467[_0x5b11('0x12')],_0x1ae80a,'\x20'),'Description':intUtil[_0x5b11('0x13')](_0x238467[_0x5b11('0x14')],_0x1ae80a,'\x0a')},getCustomFields(_0xcce22e,_0x1ae80a));if(_0x2d641b){_0xb6db9d['WhoId']=_0x2d641b['id'];}}else if(_0x238467['ticketType']===_0x5b11('0x15')){_0xb6db9d=Object[_0x5b11('0x10')]({},{'OwnerId':_0x20c92d['id'],'Subject':intUtil[_0x5b11('0x13')](_0x238467['Subjects'],_0x1ae80a,'\x20'),'Description':intUtil['getString'](_0x238467['Descriptions'],_0x1ae80a,'\x0a')},getCustomFields(_0xcce22e,_0x1ae80a));if(_0x2d641b){_0xb6db9d['ContactId']=_0x2d641b['id'];}}return _0x558fcd[_0x5b11('0x16')](_0x238467['ticketType'])['create'](_0xb6db9d);}function getUser(_0x2bca13,_0x281f50,_0x491f9c){if(!_[_0x5b11('0x17')](_0x281f50)&&intUtil[_0x5b11('0x18')](_0x281f50)){var _0x2225fc={'Email':_0x281f50};var _0x1d345c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x491f9c['sobject'](_0x5b11('0x19'))[_0x5b11('0x1a')](_0x2225fc,_0x1d345c)[_0x5b11('0x1b')]()[_0x5b11('0x1c')](function(_0x15da57){if(_0x15da57[_0x5b11('0x1d')]){var _0x2eca7f=_[_0x5b11('0x1a')](_0x15da57,function(_0x347d9a){return _0x347d9a[_0x5b11('0x1e')]===_0x281f50;});if(_0x2eca7f){logger[_0x5b11('0x1f')](_0x5b11('0x20'),_0x281f50);return BPromise['resolve']({'id':_0x2eca7f['Id'],'name':_0x2eca7f['Name']});}}else{logger['info'](_0x5b11('0x21'),_0x281f50);return _0x491f9c[_0x5b11('0x22')]()[_0x5b11('0x1c')](function(_0x315ecb){return BPromise[_0x5b11('0x23')]({'id':_0x315ecb[_0x5b11('0x24')],'name':_0x315ecb[_0x5b11('0x25')]});});}});}else{logger[_0x5b11('0x1f')](_0x5b11('0x21'),_0x281f50);return _0x491f9c[_0x5b11('0x22')]()[_0x5b11('0x1c')](function(_0xcfcbd7){return BPromise['resolve']({'id':_0xcfcbd7['user_id'],'name':_0xcfcbd7[_0x5b11('0x25')]});});}}function getEndUser(_0x4233b2,_0x1d8fe8,_0x37a57b,_0x199ec8,_0x50eb24){var _0x1f0310={'Phone':_0x199ec8};var _0x39bac4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5b11('0x23')]()[_0x5b11('0x1c')](function(){if(_0x1d8fe8[_0x5b11('0xe')]==='Task'){logger[_0x5b11('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x199ec8,_0x1d8fe8[_0x5b11('0x26')]);switch(_0x1d8fe8[_0x5b11('0x26')]){case _0x5b11('0x27'):return _0x50eb24[_0x5b11('0x16')](_0x5b11('0x28'))[_0x5b11('0x1a')](_0x1f0310,_0x39bac4)[_0x5b11('0x1b')]()['then'](function(_0x31565c){if(_0x31565c&&_0x31565c[_0x5b11('0x1d')]){return _0x31565c;}else{return _0x50eb24[_0x5b11('0x16')](_0x5b11('0x29'))[_0x5b11('0x1a')](_0x1f0310,_0x39bac4);}});case _0x5b11('0x2a'):return _0x50eb24[_0x5b11('0x16')](_0x5b11('0x28'))[_0x5b11('0x1a')](_0x1f0310,_0x39bac4)[_0x5b11('0x1b')]();case'lead':return _0x50eb24[_0x5b11('0x16')](_0x5b11('0x29'))[_0x5b11('0x1a')](_0x1f0310,_0x39bac4);default:return null;}}else if(_0x1d8fe8[_0x5b11('0xe')]===_0x5b11('0x15')){logger[_0x5b11('0x1f')](_0x5b11('0x2b'),_0x199ec8,'contact');return _0x50eb24[_0x5b11('0x16')](_0x5b11('0x28'))[_0x5b11('0x1a')](_0x1f0310,_0x39bac4)[_0x5b11('0x1b')]();}})[_0x5b11('0x1c')](function(_0x4c7196){if(_0x4c7196&&_0x4c7196[_0x5b11('0x1d')]){var _0x32e5fa=_[_0x5b11('0x1a')](_0x4c7196,function(_0x30037e){return _0x30037e[_0x5b11('0x2c')]===_0x199ec8;});if(_0x32e5fa){return BPromise[_0x5b11('0x23')]({'id':_0x32e5fa['Id'],'name':_0x32e5fa[_0x5b11('0x2d')],'phone':_0x32e5fa[_0x5b11('0x2c')]});}}})[_0x5b11('0x1c')](function(_0x3081ff){if(_0x3081ff){logger[_0x5b11('0x1f')](_0x5b11('0x2e'),_0x199ec8);return BPromise[_0x5b11('0x23')](_0x3081ff);}else{logger[_0x5b11('0x1f')](_0x5b11('0x2f'),_0x199ec8);var _0x485fce={'LastName':_0x37a57b!==_0x5b11('0x30')?_0x37a57b:util[_0x5b11('0x31')](_0x5b11('0x32'),_0x199ec8),'Phone':_0x199ec8};if(_0x1d8fe8[_0x5b11('0x33')]){if(_0x1d8fe8[_0x5b11('0x33')]===_0x5b11('0x2a')){logger[_0x5b11('0x1f')](_0x5b11('0x34'),_0x199ec8,_0x1d8fe8[_0x5b11('0x33')]);}else if(_0x1d8fe8['moduleCreate']==='lead'&&_0x1d8fe8[_0x5b11('0xe')]===_0x5b11('0xf')){logger['info'](_0x5b11('0x34'),_0x199ec8,_0x1d8fe8[_0x5b11('0x33')]);_0x485fce[_0x5b11('0x35')]=_0x5b11('0x36');}else{return null;}}return _0x50eb24[_0x5b11('0x16')](_[_0x5b11('0x37')](_0x1d8fe8[_0x5b11('0x33')]))[_0x5b11('0x38')](_0x485fce);}});}function getCustomFields(_0x13c596,_0x369053){var _0xfd6702={};if(_0x13c596['length']>0x0){_[_0x5b11('0x39')](_0x13c596,function(_0x3fa3b7){if(_0x3fa3b7[_0x5b11('0x3a')]==='string'&&_0x3fa3b7[_0x5b11('0x3b')]){_0xfd6702[_0x3fa3b7['idField']]=_0x3fa3b7[_0x5b11('0x3c')][_0x5b11('0x3d')]();}else if(_0x3fa3b7['type']===_0x5b11('0x3e')&&_0x3fa3b7[_0x5b11('0x3f')]&&_0x3fa3b7[_0x5b11('0x3b')]){_0x369053[_0x3fa3b7['variableName']]&&(_0xfd6702[_0x3fa3b7[_0x5b11('0x3b')]]=_0x369053[_0x3fa3b7[_0x5b11('0x3f')]]['toString']());}else if(_0x3fa3b7['type']==='customVariable'&&_0x3fa3b7['Variable']&&_0x3fa3b7[_0x5b11('0x40')][_0x5b11('0x41')]&&_0x3fa3b7[_0x5b11('0x3b')]){_0x369053[_0x3fa3b7['Variable'][_0x5b11('0x41')]['toLowerCase']()]&&(_0xfd6702[_0x3fa3b7['idField']]=_0x369053[_0x3fa3b7['Variable']['name'][_0x5b11('0x42')]()][_0x5b11('0x3d')]());}});}return _0xfd6702;}function getConnection(_0x1ed037){var _0x23da72=_0x1ed037[_0x5b11('0x43')]['concat'](_0x1ed037[_0x5b11('0x44')]);var _0x567626=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1ed037['remoteUri']||_0x5b11('0x45'),'clientId':_0x1ed037[_0x5b11('0x46')],'clientSecret':_0x1ed037['clientSecret']}});return _0x567626[_0x5b11('0x47')](_0x1ed037[_0x5b11('0x48')],_0x23da72)[_0x5b11('0x1c')](function(){logger['info'](_0x5b11('0x49'));return _0x567626;});}exports[_0x5b11('0x4a')]=function(_0x58b052,_0x3179a8,_0xcc7826,_0x58bad6,_0x4e24ce,_0x567c39){var _0x687512,_0x4cfb17,_0x15ce77,_0xd57a6b;_0x567c39[_0x5b11('0x4b')]=intUtil['stripTrailingSlash'](_0x567c39[_0x5b11('0x4b')]);_0x567c39[_0x5b11('0x4c')]=intUtil[_0x5b11('0x4d')](_0x567c39['remoteUri']);if(_0x4e24ce&&_0x4e24ce[_0x5b11('0x4e')]){logger[_0x5b11('0x1f')](_0x5b11('0x4f'),_0x5b11('0x50'));_0x3179a8['recordingURL']=util[_0x5b11('0x31')](_0x5b11('0x51'),_0x567c39[_0x5b11('0x4b')],_0x3179a8[_0x5b11('0x52')],md5(_0x3179a8[_0x5b11('0x52')]));}else{_0x3179a8[_0x5b11('0x53')]='';}return getConnection(_0x567c39)[_0x5b11('0x1c')](function(_0x37d677){_0xd57a6b=_0x37d677;return getUser(_0x567c39,_0x58bad6[_0x5b11('0x54')],_0xd57a6b);})[_0x5b11('0x1c')](function(_0x2dfbbb){_0x687512=_0x2dfbbb;return getEndUser(_0x567c39,_0xcc7826,_0x3179a8[_0x5b11('0x55')],_0x3179a8[_0x5b11('0x56')],_0xd57a6b);})['then'](function(_0x42cfa7){_0x4cfb17=_0x42cfa7;return getTicket(_0x567c39,_0x687512,_0x4cfb17,_0xcc7826,_0x3179a8,_0xcc7826['Fields'],_0xd57a6b,'queue');})[_0x5b11('0x1c')](function(_0x4667c2){_0x15ce77=_0x4667c2;logger[_0x5b11('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x15ce77['id']);logger[_0x5b11('0x1f')](_0x5b11('0x57'),_0x15ce77['id'],_0x58bad6[_0x5b11('0x41')],_0x567c39[_0x5b11('0x3a')]);switch(_0x567c39[_0x5b11('0x3a')]){case _0x5b11('0x58'):emit(util[_0x5b11('0x31')](_0x5b11('0x59'),_0x58bad6[_0x5b11('0x41')]),'trigger:salesforce:display',{'recordId':_0x15ce77['id']});break;case _0x5b11('0x5a'):emit(util[_0x5b11('0x31')]('user:%s',_0x58bad6[_0x5b11('0x41')]),_0x5b11('0x5b'),{'uri':util['format'](_0x5b11('0x5c'),_0xd57a6b['instanceUrl'],_0x15ce77['id'])});break;default:logger['error'](_0x5b11('0x5d'));}})[_0x5b11('0x5e')](function(_0x3ebaf9){logger[_0x5b11('0x5f')](_0x5b11('0x4f'),JSON[_0x5b11('0x60')](_0x3ebaf9));});};exports[_0x5b11('0x61')]=function(_0x41f3a4,_0x2c271d,_0x1a853b,_0x58f690,_0x12db8e,_0x3aa940,_0xefb8e0){var _0xbde67,_0x1da846,_0xcbebe,_0x127a3a;_0x3aa940[_0x5b11('0x4b')]=intUtil[_0x5b11('0x4d')](_0x3aa940[_0x5b11('0x4b')]);_0x3aa940[_0x5b11('0x4c')]=intUtil[_0x5b11('0x4d')](_0x3aa940[_0x5b11('0x4c')]);if(_0xefb8e0&&_0xefb8e0[_0x5b11('0x62')]&&_0xefb8e0[_0x5b11('0x62')]!==_0x5b11('0x63')){logger['info'](_0x5b11('0x64'),_0x5b11('0x50'));_0x2c271d['recordingURL']=util[_0x5b11('0x31')](_0x5b11('0x51'),_0x3aa940[_0x5b11('0x4b')],_0x2c271d[_0x5b11('0x52')],md5(_0x2c271d[_0x5b11('0x52')]));}return getConnection(_0x3aa940)['then'](function(_0x1289e2){_0x127a3a=_0x1289e2;return getUser(_0x3aa940,_0x58f690[_0x5b11('0x54')],_0x127a3a);})[_0x5b11('0x1c')](function(_0x229904){_0xbde67=_0x229904;return getEndUser(_0x3aa940,_0x1a853b,_0x2c271d['destcalleridname'],_0x2c271d[_0x5b11('0x65')],_0x127a3a);})[_0x5b11('0x1c')](function(_0x36d130){_0x1da846=_0x36d130;return getTicket(_0x3aa940,_0xbde67,_0x1da846,_0x1a853b,_0x2c271d,_0x1a853b[_0x5b11('0x66')],_0x127a3a,_0x5b11('0x61'));})[_0x5b11('0x1c')](function(_0x24a7a4){_0xcbebe=_0x24a7a4;logger[_0x5b11('0x1f')](_0x5b11('0x67'),_0xcbebe['id']);logger[_0x5b11('0x1f')](_0x5b11('0x68'),_0xcbebe['id'],_0x58f690[_0x5b11('0x41')],_0x3aa940['type']);switch(_0x3aa940[_0x5b11('0x3a')]){case _0x5b11('0x58'):emit(util[_0x5b11('0x31')]('user:%s',_0x58f690[_0x5b11('0x41')]),_0x5b11('0x69'),{'recordId':_0xcbebe['id']});break;case'newTab':emit(util[_0x5b11('0x31')](_0x5b11('0x59'),_0x58f690['name']),'trigger:browser:url',{'uri':util[_0x5b11('0x31')](_0x5b11('0x5c'),_0x127a3a[_0x5b11('0x6a')],_0xcbebe['id'])});break;default:logger['error']('[OUTBOUND]',_0x5b11('0x6b'));}})[_0x5b11('0x5e')](function(_0x4a5a72){logger['error'](_0x5b11('0x64'),JSON[_0x5b11('0x60')](_0x4a5a72));});};exports['abandoned']=function(_0x49640e,_0x11b90e,_0x146652,_0x2e402d,_0x49d232,_0x1e4452){var _0x6dee4d,_0x15eede,_0x49c64c,_0x16cd12;_0x1e4452[_0x5b11('0x4b')]=intUtil[_0x5b11('0x4d')](_0x1e4452[_0x5b11('0x4b')]);_0x1e4452[_0x5b11('0x4c')]=intUtil['stripTrailingSlash'](_0x1e4452[_0x5b11('0x4c')]);if(_0x49d232&&_0x49d232[_0x5b11('0x4e')]){logger[_0x5b11('0x1f')]('[ABANDONED]',_0x5b11('0x50'));_0x11b90e[_0x5b11('0x53')]=util[_0x5b11('0x31')](_0x5b11('0x51'),_0x1e4452[_0x5b11('0x4b')],_0x11b90e[_0x5b11('0x52')],md5(_0x11b90e[_0x5b11('0x52')]));}else{_0x11b90e[_0x5b11('0x53')]='';}return getConnection(_0x1e4452)[_0x5b11('0x1c')](function(_0x457032){_0x16cd12=_0x457032;if(!_[_0x5b11('0x17')](_0x2e402d)){return getUser(_0x1e4452,_0x2e402d['name'],_0x16cd12);}else{return getUser(_0x1e4452,null,_0x16cd12);}})['then'](function(_0x159046){_0x6dee4d=_0x159046;return getEndUser(_0x1e4452,_0x146652,_0x11b90e[_0x5b11('0x55')],_0x11b90e[_0x5b11('0x56')],_0x16cd12);})[_0x5b11('0x1c')](function(_0x27b968){_0x15eede=_0x27b968;return getTicket(_0x1e4452,_0x6dee4d,_0x15eede,_0x146652,_0x11b90e,_0x146652[_0x5b11('0x66')],_0x16cd12);})['then'](function(_0x151af1){_0x49c64c=_0x151af1;logger['info']('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x49c64c['id']);logger['info'](_0x5b11('0x6c'),_0x1e4452['type']);})[_0x5b11('0x5e')](function(_0xa9569d){logger[_0x5b11('0x5f')](_0x5b11('0x6d'),JSON[_0x5b11('0x60')](_0xa9569d));});}; \ No newline at end of file +var _0xd82c=['Connection','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]','Recording\x20is\x20enabled!','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','WhoId','Case','assign','sobject','ticketType','create','isNil','validateEmail','User','execute','length','find','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','Lead','Contact','lead','contact','Phone','','format','Caller\x20-\x20%s','moduleCreate','Task','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','forEach','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password'];(function(_0xdd0e50,_0x18f7e1){var _0x4f7937=function(_0x27dc90){while(--_0x27dc90){_0xdd0e50['push'](_0xdd0e50['shift']());}};_0x4f7937(++_0x18f7e1);}(_0xd82c,0x95));var _0xcd82=function(_0x291c7c,_0x10b3a){_0x291c7c=_0x291c7c-0x0;var _0x508a0a=_0xd82c[_0x291c7c];return _0x508a0a;};'use strict';var _=require(_0xcd82('0x0'));var rp=require(_0xcd82('0x1'));var moment=require(_0xcd82('0x2'));var BPromise=require('bluebird');var md5=require(_0xcd82('0x3'));var jsforce=require(_0xcd82('0x4'));var util=require('util');var Redis=require(_0xcd82('0x5'));var intUtil=require(_0xcd82('0x6'));var config=require(_0xcd82('0x7'));var logger=require(_0xcd82('0x8'))(_0xcd82('0x9'));config[_0xcd82('0xa')]=_['defaults'](config['redis'],{'host':_0xcd82('0xb'),'port':0x18eb});var io=require(_0xcd82('0xc'))(new Redis(config['redis']));function emit(_0x3373ed,_0x56ff2f,_0x3d6620){io['to'](_0x3373ed)[_0xcd82('0xd')](_0x56ff2f,_0x3d6620);}function getTicket(_0x4404c9,_0x3df0fa,_0x1286c5,_0x3a85e0,_0x29f0d1,_0x3f59ee,_0x1a941a,_0x57b5bd){var _0x50e5d7={};if(_0x3a85e0['ticketType']==='Task'){_0x50e5d7=Object['assign']({},{'OwnerId':_0x3df0fa['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xcd82('0xe')](_0x3a85e0[_0xcd82('0xf')],_0x29f0d1,'\x20'),'Description':intUtil[_0xcd82('0xe')](_0x3a85e0[_0xcd82('0x10')],_0x29f0d1,'\x0a')},getCustomFields(_0x3f59ee,_0x29f0d1));if(_0x1286c5){_0x50e5d7[_0xcd82('0x11')]=_0x1286c5['id'];}}else if(_0x3a85e0['ticketType']===_0xcd82('0x12')){_0x50e5d7=Object[_0xcd82('0x13')]({},{'OwnerId':_0x3df0fa['id'],'Subject':intUtil['getString'](_0x3a85e0['Subjects'],_0x29f0d1,'\x20'),'Description':intUtil[_0xcd82('0xe')](_0x3a85e0[_0xcd82('0x10')],_0x29f0d1,'\x0a')},getCustomFields(_0x3f59ee,_0x29f0d1));if(_0x1286c5){_0x50e5d7['ContactId']=_0x1286c5['id'];}}return _0x1a941a[_0xcd82('0x14')](_0x3a85e0[_0xcd82('0x15')])[_0xcd82('0x16')](_0x50e5d7);}function getUser(_0x26516e,_0x2ce13a,_0xd34956){if(!_[_0xcd82('0x17')](_0x2ce13a)&&intUtil[_0xcd82('0x18')](_0x2ce13a)){var _0x519b0e={'Email':_0x2ce13a};var _0x4fa459={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xd34956[_0xcd82('0x14')](_0xcd82('0x19'))['find'](_0x519b0e,_0x4fa459)[_0xcd82('0x1a')]()['then'](function(_0x32f7a6){if(_0x32f7a6[_0xcd82('0x1b')]){var _0x455a72=_[_0xcd82('0x1c')](_0x32f7a6,function(_0x12a030){return _0x12a030['Email']===_0x2ce13a;});if(_0x455a72){logger[_0xcd82('0x1d')]('Agent\x20%s\x20found.',_0x2ce13a);return BPromise[_0xcd82('0x1e')]({'id':_0x455a72['Id'],'name':_0x455a72[_0xcd82('0x1f')]});}}else{logger[_0xcd82('0x1d')](_0xcd82('0x20'),_0x2ce13a);return _0xd34956[_0xcd82('0x21')]()['then'](function(_0x51bd62){return BPromise['resolve']({'id':_0x51bd62['user_id'],'name':_0x51bd62['display_name']});});}});}else{logger[_0xcd82('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2ce13a);return _0xd34956[_0xcd82('0x21')]()[_0xcd82('0x22')](function(_0x467131){return BPromise['resolve']({'id':_0x467131[_0xcd82('0x23')],'name':_0x467131['display_name']});});}}function getEndUser(_0x1640d9,_0x52f313,_0x46b3ab,_0x3cbee0,_0x4662e6){var _0x182e47={'Phone':_0x3cbee0};var _0x270dff={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xcd82('0x1e')]()[_0xcd82('0x22')](function(){if(_0x52f313[_0xcd82('0x15')]==='Task'){logger[_0xcd82('0x1d')](_0xcd82('0x24'),_0x3cbee0,_0x52f313['moduleSearch']);switch(_0x52f313['moduleSearch']){case _0xcd82('0x25'):return _0x4662e6[_0xcd82('0x14')]('Contact')[_0xcd82('0x1c')](_0x182e47,_0x270dff)[_0xcd82('0x1a')]()[_0xcd82('0x22')](function(_0x48c29a){if(_0x48c29a&&_0x48c29a['length']){return _0x48c29a;}else{return _0x4662e6[_0xcd82('0x14')](_0xcd82('0x26'))[_0xcd82('0x1c')](_0x182e47,_0x270dff);}});case'contact':return _0x4662e6[_0xcd82('0x14')](_0xcd82('0x27'))['find'](_0x182e47,_0x270dff)[_0xcd82('0x1a')]();case _0xcd82('0x28'):return _0x4662e6[_0xcd82('0x14')](_0xcd82('0x26'))[_0xcd82('0x1c')](_0x182e47,_0x270dff);default:return null;}}else if(_0x52f313[_0xcd82('0x15')]===_0xcd82('0x12')){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3cbee0,_0xcd82('0x29'));return _0x4662e6[_0xcd82('0x14')](_0xcd82('0x27'))[_0xcd82('0x1c')](_0x182e47,_0x270dff)[_0xcd82('0x1a')]();}})['then'](function(_0x17a3b7){if(_0x17a3b7&&_0x17a3b7[_0xcd82('0x1b')]){var _0x34d9d2=_[_0xcd82('0x1c')](_0x17a3b7,function(_0x3e205b){return _0x3e205b[_0xcd82('0x2a')]===_0x3cbee0;});if(_0x34d9d2){return BPromise[_0xcd82('0x1e')]({'id':_0x34d9d2['Id'],'name':_0x34d9d2[_0xcd82('0x1f')],'phone':_0x34d9d2['Phone']});}}})['then'](function(_0x5bc661){if(_0x5bc661){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x3cbee0);return BPromise[_0xcd82('0x1e')](_0x5bc661);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x3cbee0);var _0x5f3aa4={'LastName':_0x46b3ab!==_0xcd82('0x2b')?_0x46b3ab:util[_0xcd82('0x2c')](_0xcd82('0x2d'),_0x3cbee0),'Phone':_0x3cbee0};if(_0x52f313['moduleCreate']){if(_0x52f313['moduleCreate']==='contact'){logger[_0xcd82('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3cbee0,_0x52f313[_0xcd82('0x2e')]);}else if(_0x52f313[_0xcd82('0x2e')]==='lead'&&_0x52f313[_0xcd82('0x15')]===_0xcd82('0x2f')){logger['info'](_0xcd82('0x30'),_0x3cbee0,_0x52f313['moduleCreate']);_0x5f3aa4['Company']='No\x20Company';}else{return null;}}return _0x4662e6['sobject'](_['upperFirst'](_0x52f313[_0xcd82('0x2e')]))[_0xcd82('0x16')](_0x5f3aa4);}});}function getCustomFields(_0x1c5e23,_0x1e6931){var _0x5b82c2={};if(_0x1c5e23[_0xcd82('0x1b')]>0x0){_[_0xcd82('0x31')](_0x1c5e23,function(_0x35f865){if(_0x35f865[_0xcd82('0x32')]==='string'&&_0x35f865['idField']){_0x5b82c2[_0x35f865[_0xcd82('0x33')]]=_0x35f865[_0xcd82('0x34')][_0xcd82('0x35')]();}else if(_0x35f865[_0xcd82('0x32')]===_0xcd82('0x36')&&_0x35f865[_0xcd82('0x37')]&&_0x35f865['idField']){_0x1e6931[_0x35f865[_0xcd82('0x37')]]&&(_0x5b82c2[_0x35f865[_0xcd82('0x33')]]=_0x1e6931[_0x35f865[_0xcd82('0x37')]][_0xcd82('0x35')]());}else if(_0x35f865[_0xcd82('0x32')]===_0xcd82('0x38')&&_0x35f865[_0xcd82('0x39')]&&_0x35f865[_0xcd82('0x39')][_0xcd82('0x3a')]&&_0x35f865[_0xcd82('0x33')]){_0x1e6931[_0x35f865[_0xcd82('0x39')][_0xcd82('0x3a')][_0xcd82('0x3b')]()]&&(_0x5b82c2[_0x35f865[_0xcd82('0x33')]]=_0x1e6931[_0x35f865['Variable']['name'][_0xcd82('0x3b')]()]['toString']());}});}return _0x5b82c2;}function getConnection(_0x36f94c){var _0xf5bc1f=_0x36f94c[_0xcd82('0x3c')]['concat'](_0x36f94c['securityToken']);var _0x35dc42=new jsforce[(_0xcd82('0x3d'))]({'oauth2':{'loginUrl':_0x36f94c[_0xcd82('0x3e')]||_0xcd82('0x3f'),'clientId':_0x36f94c['clientId'],'clientSecret':_0x36f94c['clientSecret']}});return _0x35dc42[_0xcd82('0x40')](_0x36f94c[_0xcd82('0x41')],_0xf5bc1f)[_0xcd82('0x22')](function(){logger[_0xcd82('0x1d')](_0xcd82('0x42'));return _0x35dc42;});}exports[_0xcd82('0x43')]=function(_0x1d5a84,_0xb16d14,_0x3188bc,_0x327442,_0x4656c0,_0x52769c){var _0x5dd8ae,_0x56f824,_0x505500,_0x233277;_0x52769c[_0xcd82('0x44')]=intUtil[_0xcd82('0x45')](_0x52769c[_0xcd82('0x44')]);_0x52769c[_0xcd82('0x3e')]=intUtil[_0xcd82('0x45')](_0x52769c['remoteUri']);if(_0x4656c0&&_0x4656c0[_0xcd82('0x46')]){logger['info'](_0xcd82('0x47'),'Recording\x20is\x20enabled!');_0xb16d14['recordingURL']=util[_0xcd82('0x2c')](_0xcd82('0x48'),_0x52769c['serverUrl'],_0xb16d14[_0xcd82('0x49')],md5(_0xb16d14['uniqueid']));}else{_0xb16d14[_0xcd82('0x4a')]='';}return getConnection(_0x52769c)[_0xcd82('0x22')](function(_0x3b5178){_0x233277=_0x3b5178;return getUser(_0x52769c,_0x327442[_0xcd82('0x4b')],_0x233277);})[_0xcd82('0x22')](function(_0x52cb4d){_0x5dd8ae=_0x52cb4d;return getEndUser(_0x52769c,_0x3188bc,_0xb16d14[_0xcd82('0x4c')],_0xb16d14[_0xcd82('0x4d')],_0x233277);})[_0xcd82('0x22')](function(_0x150dcd){_0x56f824=_0x150dcd;return getTicket(_0x52769c,_0x5dd8ae,_0x56f824,_0x3188bc,_0xb16d14,_0x3188bc[_0xcd82('0x4e')],_0x233277,_0xcd82('0x43'));})[_0xcd82('0x22')](function(_0x28009d){_0x505500=_0x28009d;logger[_0xcd82('0x1d')](_0xcd82('0x4f'),_0x505500['id']);logger[_0xcd82('0x1d')](_0xcd82('0x50'),_0x505500['id'],_0x327442[_0xcd82('0x3a')],_0x52769c[_0xcd82('0x32')]);switch(_0x52769c[_0xcd82('0x32')]){case _0xcd82('0x51'):emit(util[_0xcd82('0x2c')](_0xcd82('0x52'),_0x327442[_0xcd82('0x3a')]),_0xcd82('0x53'),{'recordId':_0x505500['id']});break;case _0xcd82('0x54'):emit(util[_0xcd82('0x2c')]('user:%s',_0x327442[_0xcd82('0x3a')]),_0xcd82('0x55'),{'uri':util[_0xcd82('0x2c')](_0xcd82('0x56'),_0x233277[_0xcd82('0x57')],_0x505500['id'])});break;default:logger[_0xcd82('0x58')](_0xcd82('0x59'));}})[_0xcd82('0x5a')](function(_0x16081c){logger[_0xcd82('0x58')](_0xcd82('0x47'),JSON[_0xcd82('0x5b')](_0x16081c));});};exports[_0xcd82('0x5c')]=function(_0x50ae6f,_0x40e3c0,_0x5ed7ef,_0xa66482,_0x305868,_0x10046f,_0x42847d){var _0x219868,_0x21715a,_0x891d8a,_0x311064;_0x10046f['serverUrl']=intUtil[_0xcd82('0x45')](_0x10046f[_0xcd82('0x44')]);_0x10046f['remoteUri']=intUtil[_0xcd82('0x45')](_0x10046f[_0xcd82('0x3e')]);if(_0x42847d&&_0x42847d['recordingFormat']&&_0x42847d[_0xcd82('0x5d')]!==_0xcd82('0x5e')){logger[_0xcd82('0x1d')](_0xcd82('0x5f'),'Recording\x20is\x20enabled!');_0x40e3c0['recordingURL']=util[_0xcd82('0x2c')](_0xcd82('0x48'),_0x10046f[_0xcd82('0x44')],_0x40e3c0['uniqueid'],md5(_0x40e3c0[_0xcd82('0x49')]));}return getConnection(_0x10046f)[_0xcd82('0x22')](function(_0x5b3e01){_0x311064=_0x5b3e01;return getUser(_0x10046f,_0xa66482[_0xcd82('0x4b')],_0x311064);})[_0xcd82('0x22')](function(_0x594b7a){_0x219868=_0x594b7a;return getEndUser(_0x10046f,_0x5ed7ef,_0x40e3c0[_0xcd82('0x60')],_0x40e3c0[_0xcd82('0x61')],_0x311064);})[_0xcd82('0x22')](function(_0x365307){_0x21715a=_0x365307;return getTicket(_0x10046f,_0x219868,_0x21715a,_0x5ed7ef,_0x40e3c0,_0x5ed7ef['Fields'],_0x311064,'outbound');})[_0xcd82('0x22')](function(_0xf8b4b1){_0x891d8a=_0xf8b4b1;logger[_0xcd82('0x1d')](_0xcd82('0x62'),_0x891d8a['id']);logger[_0xcd82('0x1d')](_0xcd82('0x63'),_0x891d8a['id'],_0xa66482[_0xcd82('0x3a')],_0x10046f[_0xcd82('0x32')]);switch(_0x10046f[_0xcd82('0x32')]){case'integrationTab':emit(util[_0xcd82('0x2c')]('user:%s',_0xa66482[_0xcd82('0x3a')]),_0xcd82('0x53'),{'recordId':_0x891d8a['id']});break;case _0xcd82('0x54'):emit(util['format']('user:%s',_0xa66482[_0xcd82('0x3a')]),_0xcd82('0x55'),{'uri':util[_0xcd82('0x2c')](_0xcd82('0x56'),_0x311064[_0xcd82('0x57')],_0x891d8a['id'])});break;default:logger['error'](_0xcd82('0x5f'),_0xcd82('0x64'));}})[_0xcd82('0x5a')](function(_0x1e6ff0){logger[_0xcd82('0x58')](_0xcd82('0x5f'),JSON[_0xcd82('0x5b')](_0x1e6ff0));});};exports['abandoned']=function(_0x1347c2,_0x3a098c,_0x134695,_0x1d7fc0,_0xf24e29,_0x595b54){var _0x29dcc,_0x57d7d4,_0x188e7c,_0x2092e7;_0x595b54[_0xcd82('0x44')]=intUtil['stripTrailingSlash'](_0x595b54[_0xcd82('0x44')]);_0x595b54[_0xcd82('0x3e')]=intUtil[_0xcd82('0x45')](_0x595b54[_0xcd82('0x3e')]);if(_0xf24e29&&_0xf24e29[_0xcd82('0x46')]){logger[_0xcd82('0x1d')](_0xcd82('0x65'),_0xcd82('0x66'));_0x3a098c[_0xcd82('0x4a')]=util[_0xcd82('0x2c')](_0xcd82('0x48'),_0x595b54['serverUrl'],_0x3a098c['uniqueid'],md5(_0x3a098c[_0xcd82('0x49')]));}else{_0x3a098c['recordingURL']='';}return getConnection(_0x595b54)[_0xcd82('0x22')](function(_0x4e18d9){_0x2092e7=_0x4e18d9;if(!_['isNil'](_0x1d7fc0)){return getUser(_0x595b54,_0x1d7fc0['name'],_0x2092e7);}else{return getUser(_0x595b54,null,_0x2092e7);}})['then'](function(_0x53cd37){_0x29dcc=_0x53cd37;return getEndUser(_0x595b54,_0x134695,_0x3a098c[_0xcd82('0x4c')],_0x3a098c[_0xcd82('0x4d')],_0x2092e7);})[_0xcd82('0x22')](function(_0x1bc44a){_0x57d7d4=_0x1bc44a;return getTicket(_0x595b54,_0x29dcc,_0x57d7d4,_0x134695,_0x3a098c,_0x134695[_0xcd82('0x4e')],_0x2092e7);})['then'](function(_0x3a5f5b){_0x188e7c=_0x3a5f5b;logger[_0xcd82('0x1d')](_0xcd82('0x67'),_0x188e7c['id']);logger[_0xcd82('0x1d')](_0xcd82('0x68'),_0x595b54[_0xcd82('0x32')]);})[_0xcd82('0x5a')](function(_0x56a055){logger[_0xcd82('0x58')](_0xcd82('0x65'),JSON[_0xcd82('0x5b')](_0x56a055));});}; \ 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 da226bc..4c3c294 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 _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'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 669d907..7a3e859 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 _0x7f84=['base64','get_server_info','stringify','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','Agent\x20found!','resolve','name_value_list','value','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','','Enduser\x20created.','first_name','debug','map','type','string','nameField','customField','toLowerCase','content','variable','custom_fields','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','remoteUri','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','catch','calleridnum','[ABANDONED]','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','push','idField','variableName','JSON','Calls','format','Basic\x20%s','toString'];(function(_0x1ffcb8,_0x226396){var _0x27ddc6=function(_0x522dec){while(--_0x522dec){_0x1ffcb8['push'](_0x1ffcb8['shift']());}};_0x27ddc6(++_0x226396);}(_0x7f84,0xcd));var _0x47f8=function(_0x1bd03c,_0x4fad19){_0x1bd03c=_0x1bd03c-0x0;var _0x18ffaf=_0x7f84[_0x1bd03c];return _0x18ffaf;};'use strict';var _=require(_0x47f8('0x0'));var rp=require('request-promise');var BPromise=require(_0x47f8('0x1'));var md5=require(_0x47f8('0x2'));var util=require(_0x47f8('0x3'));var Redis=require(_0x47f8('0x4'));var intUtil=require(_0x47f8('0x5'));var config=require(_0x47f8('0x6'));var logger=require('../../../../config/logger')(_0x47f8('0x7'));config[_0x47f8('0x8')]=_[_0x47f8('0x9')](config[_0x47f8('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x47f8('0xa'))(new Redis(config[_0x47f8('0x8')]));var def={'method':_0x47f8('0xb'),'json':!![]};function emit(_0x4a2fc7,_0x5f087c,_0x4b99b8){io['to'](_0x4a2fc7)['emit'](_0x5f087c,_0x4b99b8);}function getTicket(_0x2be1a5,_0x29b337,_0x40a38b,_0x3a7bcd,_0x463af4,_0x39d8e9,_0x33676c,_0xad286f){logger['info'](_0x47f8('0xc'));var _0xa0fd20=new Date();var _0x53267a=[{'name':_0x47f8('0xd'),'value':intUtil[_0x47f8('0xe')](_0x3a7bcd[_0x47f8('0xf')],_0x463af4,'\x20')},{'name':_0x47f8('0x10'),'value':_0x29b337['id']},{'name':'created_by','value':_0x29b337['id']},{'name':_0x47f8('0x11'),'value':intUtil[_0x47f8('0xe')](_0x3a7bcd['Descriptions'],_0x463af4,'\x0a')},{'name':_0x47f8('0x12'),'value':_0xa0fd20[_0x47f8('0x13')]()[_0x47f8('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x47f8('0x15'),'value':'0'},{'name':_0x47f8('0x16'),'value':'15'},{'name':_0x47f8('0x17'),'value':_0x40a38b['id']},{'name':_0x47f8('0x18'),'value':_0x47f8('0x19')},{'name':_0x47f8('0x1a'),'value':_0x40a38b['name']},{'name':_0x47f8('0x1b'),'value':_0xad286f}];if(_0x39d8e9[_0x47f8('0x1c')]){_['forEach'](_0x39d8e9,function(_0x3ac343){if(_0x463af4[_0x3ac343['variableName']]){_0x53267a[_0x47f8('0x1d')]({'name':_0x3ac343[_0x47f8('0x1e')],'value':_0x463af4[_0x3ac343[_0x47f8('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x47f8('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x33676c['id'],'module_name':_0x47f8('0x21'),'name_value_list':_0x53267a})}});}function getAuth(_0x154c9d){return util[_0x47f8('0x22')](_0x47f8('0x23'),new Buffer(_0x154c9d['apiKey']+':X')[_0x47f8('0x24')](_0x47f8('0x25')));}function getServerInfo(_0x282815){return request({'form':{'method':_0x47f8('0x26'),'input_type':_0x47f8('0x20'),'response_type':_0x47f8('0x20'),'rest_data':JSON[_0x47f8('0x27')]({'session':_0x282815['id']})}});}function getUser(_0x1ff359,_0x28b62c,_0x522e3b){if(!_[_0x47f8('0x28')](_0x28b62c)){logger['info']('Getting\x20agent\x20with\x20name',_0x28b62c);return request({'form':{'method':'get_entry_list','input_type':_0x47f8('0x20'),'response_type':_0x47f8('0x20'),'rest_data':JSON['stringify']({'session':_0x522e3b['id'],'module_name':_0x47f8('0x29'),'query':util['format'](_0x47f8('0x2a'),_0x28b62c),'order_by':'','offset':'0','select_fields':['id','name',_0x47f8('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x47f8('0x2c')](function(_0x489ecd){if(_0x489ecd[_0x47f8('0x2d')][_0x47f8('0x1c')]){var _0x1a918f=_[_0x47f8('0x2e')](_0x489ecd[_0x47f8('0x2d')],function(_0x2e39c2){return _0x2e39c2['name_value_list'][_0x47f8('0x2b')]['value']===_0x28b62c;});if(_0x1a918f){logger['info'](_0x47f8('0x2f'));return BPromise[_0x47f8('0x30')]({'id':_0x1a918f[_0x47f8('0x31')]['id'][_0x47f8('0x32')],'name':_0x1a918f[_0x47f8('0x31')][_0x47f8('0xd')][_0x47f8('0x32')]});}}logger[_0x47f8('0x33')](_0x47f8('0x34'));return BPromise[_0x47f8('0x30')]({'id':_0x522e3b[_0x47f8('0x31')][_0x47f8('0x35')][_0x47f8('0x32')],'name':_0x522e3b[_0x47f8('0x31')][_0x47f8('0x2b')][_0x47f8('0x32')]});});}else{logger[_0x47f8('0x33')](_0x47f8('0x36'));return BPromise[_0x47f8('0x30')]({'id':_0x522e3b[_0x47f8('0x31')][_0x47f8('0x35')][_0x47f8('0x32')],'name':_0x522e3b[_0x47f8('0x31')]['user_name'][_0x47f8('0x32')]});}}function getEndUser(_0xb946ff,_0x3bb4d6,_0x51209c,_0x416578){logger[_0x47f8('0x33')]('Searching\x20enduser\x20with\x20phone',_0x51209c);return request({'form':{'method':_0x47f8('0x37'),'input_type':_0x47f8('0x20'),'response_type':_0x47f8('0x20'),'rest_data':JSON[_0x47f8('0x27')]({'session':_0x416578['id'],'module_name':'Contacts','query':util[_0x47f8('0x22')](_0x47f8('0x38'),_0x51209c),'order_by':'','offset':'0','select_fields':['id',_0x47f8('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x47f8('0x2c')](function(_0x24784f){if(_0x24784f[_0x47f8('0x2d')][_0x47f8('0x1c')]){var _0x987133=_[_0x47f8('0x2e')](_0x24784f[_0x47f8('0x2d')],function(_0x4492ae){return _0x4492ae[_0x47f8('0x31')][_0x47f8('0x39')]['value']===_0x51209c;});if(_0x987133){logger['info'](_0x47f8('0x3a'));return BPromise[_0x47f8('0x30')]({'id':_0x987133[_0x47f8('0x31')]['id'][_0x47f8('0x32')],'name':_0x987133[_0x47f8('0x31')][_0x47f8('0xd')][_0x47f8('0x32')],'phone':_0x987133[_0x47f8('0x31')][_0x47f8('0x39')][_0x47f8('0x32')]});}}else{logger[_0x47f8('0x33')](_0x47f8('0x3b'));return request({'form':{'method':_0x47f8('0x3c'),'input_type':_0x47f8('0x20'),'response_type':_0x47f8('0x20'),'rest_data':JSON[_0x47f8('0x27')]({'session':_0x416578['id'],'module_name':_0x47f8('0x19'),'name_value_list':[{'name':'first_name','value':_0x3bb4d6!==_0x47f8('0x3d')?_0x3bb4d6:util[_0x47f8('0x22')]('Caller\x20-\x20%s',_0x51209c)},{'name':_0x47f8('0x39'),'value':_0x51209c}]})}})[_0x47f8('0x2c')](function(_0x69e069){logger['info'](_0x47f8('0x3e'));return BPromise[_0x47f8('0x30')]({'id':_0x69e069['id'],'name':_0x69e069[_0x47f8('0x2d')][_0x47f8('0x3f')]['value'],'phone':_0x69e069[_0x47f8('0x2d')][_0x47f8('0x39')][_0x47f8('0x32')]});});}});}function request(_0x4de578){logger[_0x47f8('0x40')]('[HTTP]',JSON[_0x47f8('0x27')](_0x4de578));return rp(_['merge'](def,_0x4de578));}function getTags(_0xb395c1,_0x435696){var _0x1877e9=[];if(_0xb395c1&&_0xb395c1[_0x47f8('0x1c')]>0x0){_0x1877e9=_[_0x47f8('0x41')](_0xb395c1,_0x435696);}return _0x1877e9;}function getCustomFields(_0x392334,_0x3adf37){var _0x271449=[];var _0xfb9ee0={'custom_fields':[]};if(_0x392334[_0x47f8('0x1c')]>0x0){_['forEach'](_0x392334,function(_0x12b476){if(_0x12b476[_0x47f8('0x42')]===_0x47f8('0x43')&&_0x12b476[_0x47f8('0x44')]&&!_0x12b476[_0x47f8('0x45')]){_0xfb9ee0[_0x12b476[_0x47f8('0x44')][_0x47f8('0x46')]()]=_0x12b476[_0x47f8('0x47')][_0x47f8('0x24')]();}else if(_0x12b476['type']==='string'&&_0x12b476[_0x47f8('0x1e')]&&_0x12b476[_0x47f8('0x45')]){_0xfb9ee0['custom_fields'][_0x47f8('0x1d')]({'id':_0x12b476[_0x47f8('0x1e')],'value':_0x12b476['content'][_0x47f8('0x24')]()});}else if(_0x12b476['type']===_0x47f8('0x48')&&_0x12b476[_0x47f8('0x1f')]&&_0x12b476[_0x47f8('0x1e')]&&_0x12b476[_0x47f8('0x45')]){_0x3adf37[_0x12b476[_0x47f8('0x1f')]]&&_0xfb9ee0[_0x47f8('0x49')][_0x47f8('0x1d')]({'id':_0x12b476[_0x47f8('0x1e')],'value':_0x3adf37[_0x12b476[_0x47f8('0x1f')]][_0x47f8('0x24')]()});}else if(_0x12b476[_0x47f8('0x42')]===_0x47f8('0x4a')&&_0x12b476[_0x47f8('0x4b')]&&_0x12b476[_0x47f8('0x4b')]['name']&&_0x12b476[_0x47f8('0x1e')]&&_0x12b476['customField']){_0x3adf37[_0x12b476[_0x47f8('0x4b')][_0x47f8('0xd')]['toLowerCase']()]&&_0xfb9ee0[_0x47f8('0x49')][_0x47f8('0x1d')]({'id':_0x12b476['idField'],'value':_0x3adf37[_0x12b476[_0x47f8('0x4b')][_0x47f8('0xd')][_0x47f8('0x46')]()][_0x47f8('0x24')]()});}});}return _0xfb9ee0;}function getConnection(_0x226849){return request({'method':_0x47f8('0xb'),'form':{'method':'login','input_type':_0x47f8('0x20'),'response_type':_0x47f8('0x20'),'rest_data':JSON[_0x47f8('0x27')]({'user_auth':{'user_name':_0x226849[_0x47f8('0x4c')],'password':_0x226849[_0x47f8('0x4d')],'encryption':_0x47f8('0x4e')},'application':_0x47f8('0x4f')})}})[_0x47f8('0x2c')](function(_0x6dca46){var _0x42e197=_0x6dca46;if(_0x42e197['id']){def[_0x47f8('0x50')]=_0x42e197['id'];return BPromise['resolve'](_0x42e197);}else{throw new Error(util[_0x47f8('0x22')](_0x47f8('0x51'),_0x226849['id']));}});}function setRelationship(_0x4a40d2,_0x1131e4,_0x2c46c5,_0x31bad6){return request({'form':{'method':_0x47f8('0x52'),'input_type':_0x47f8('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4a40d2['id'],'module_name':_0x47f8('0x21'),'module_id':_0x2c46c5['id'],'link_field_name':_0x31bad6,'related_ids':[_0x1131e4['id']]})}});}exports[_0x47f8('0x53')]=function(_0x5b86c8,_0x1cbbd3,_0x1880b2,_0x12f32b,_0x2f0293,_0x282a54){var _0x4dd1d0,_0x5aea1a,_0x1c1aaa,_0x5634cf;_0x282a54['remoteUri']=intUtil['stripTrailingSlash'](_0x282a54['remoteUri']);_0x282a54['serverUrl']=intUtil[_0x47f8('0x54')](_0x282a54[_0x47f8('0x55')]);def[_0x47f8('0x56')]=util[_0x47f8('0x22')](_0x47f8('0x57'),_0x282a54['remoteUri']);if(_0x2f0293&&_0x2f0293[_0x47f8('0x58')]){logger[_0x47f8('0x33')](_0x47f8('0x59'),_0x47f8('0x5a'));_0x1cbbd3[_0x47f8('0x5b')]=util[_0x47f8('0x22')](_0x47f8('0x5c'),_0x282a54[_0x47f8('0x55')],_0x1cbbd3[_0x47f8('0x5d')],md5(_0x1cbbd3[_0x47f8('0x5d')]));}else{_0x1cbbd3[_0x47f8('0x5b')]='';}return getConnection(_0x282a54)[_0x47f8('0x2c')](function(_0x119f6f){_0x5634cf=_0x119f6f;return getUser(_0x282a54,_0x12f32b[_0x47f8('0xd')],_0x5634cf);})['then'](function(_0x3b9a43){_0x4dd1d0=_0x3b9a43;logger[_0x47f8('0x33')](_0x47f8('0x5e'),_0x4dd1d0['id']);return getEndUser(_0x282a54,_0x1cbbd3[_0x47f8('0x5f')],_0x1cbbd3['calleridnum'],_0x5634cf);})[_0x47f8('0x2c')](function(_0x175685){_0x5aea1a=_0x175685;logger[_0x47f8('0x33')](_0x47f8('0x60'),_0x5aea1a['id']);return getTicket(_0x282a54,_0x4dd1d0,_0x5aea1a,_0x1880b2,_0x1cbbd3,_0x1880b2[_0x47f8('0x61')],_0x5634cf,_0x47f8('0x62'));})[_0x47f8('0x2c')](function(_0x566e0a){_0x1c1aaa=_0x566e0a;logger[_0x47f8('0x33')](_0x47f8('0x63'));logger[_0x47f8('0x33')](_0x47f8('0x64'),_0x1c1aaa['id']);return setRelationship(_0x5634cf,_0x4dd1d0,_0x1c1aaa,_0x47f8('0x65'));})[_0x47f8('0x2c')](function(){return setRelationship(_0x5634cf,_0x5aea1a,_0x1c1aaa,_0x47f8('0x66'));})[_0x47f8('0x2c')](function(){return getServerInfo(_0x5634cf);})['then'](function(_0x28b84d){var _0xe7e6a5=parseInt(_0x28b84d['version']['charAt'](0x0));var _0x231d11=util[_0x47f8('0x22')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x282a54['remoteUri'],_0x1c1aaa['id']);if(_0xe7e6a5>0x6){_0x231d11=util['format'](_0x47f8('0x67'),_0x282a54[_0x47f8('0x68')],_0x1c1aaa['id']);}logger[_0x47f8('0x33')]('[QUEUE]',_0x47f8('0x69'));emit(util[_0x47f8('0x22')](_0x47f8('0x6a'),_0x12f32b[_0x47f8('0xd')]),_0x47f8('0x6b'),{'uri':_0x231d11});})['catch'](function(_0x463721){logger[_0x47f8('0x6c')](_0x47f8('0x59'),JSON[_0x47f8('0x27')](_0x463721));});};exports[_0x47f8('0x6d')]=function(_0x192d4a,_0x52e67d,_0x1db26d,_0x5f353f,_0x1895a6,_0x2735f4,_0x54cd0e){var _0x4277f3,_0xdb4159,_0x294b69,_0x365069;_0x2735f4['remoteUri']=intUtil[_0x47f8('0x54')](_0x2735f4['remoteUri']);_0x2735f4['serverUrl']=intUtil[_0x47f8('0x54')](_0x2735f4[_0x47f8('0x55')]);def['uri']=util[_0x47f8('0x22')]('%s/service/v4_1/rest.php',_0x2735f4['remoteUri']);if(_0x54cd0e&&_0x54cd0e[_0x47f8('0x6e')]&&_0x54cd0e[_0x47f8('0x6e')]!==_0x47f8('0x6f')){logger[_0x47f8('0x33')]('[OUTBOUND]',_0x47f8('0x5a'));_0x52e67d['recordingURL']=util[_0x47f8('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2735f4[_0x47f8('0x55')],_0x52e67d['uniqueid'],md5(_0x52e67d[_0x47f8('0x5d')]));}return getConnection(_0x2735f4)[_0x47f8('0x2c')](function(_0x101225){_0x365069=_0x101225;return getUser(_0x2735f4,_0x5f353f['name'],_0x365069);})[_0x47f8('0x2c')](function(_0xd20d1c){_0x4277f3=_0xd20d1c;logger[_0x47f8('0x33')](_0x47f8('0x5e'),_0x4277f3['id']);return getEndUser(_0x2735f4,_0x52e67d[_0x47f8('0x70')],_0x52e67d[_0x47f8('0x71')],_0x365069);})['then'](function(_0x16e0b0){_0xdb4159=_0x16e0b0;logger[_0x47f8('0x33')](_0x47f8('0x60'),_0xdb4159['id']);return getTicket(_0x2735f4,_0x4277f3,_0xdb4159,_0x1db26d,_0x52e67d,_0x1db26d['Fields'],_0x365069,_0x47f8('0x72'));})[_0x47f8('0x2c')](function(_0x1a20b8){_0x294b69=_0x1a20b8;logger[_0x47f8('0x33')](_0x47f8('0x63'));logger[_0x47f8('0x33')](_0x47f8('0x64'),_0x294b69['id']);return setRelationship(_0x365069,_0x4277f3,_0x294b69,'users');})[_0x47f8('0x2c')](function(){return setRelationship(_0x365069,_0xdb4159,_0x294b69,_0x47f8('0x66'));})[_0x47f8('0x2c')](function(){return getServerInfo(_0x365069);})[_0x47f8('0x2c')](function(_0x5be638){var _0x331c96=parseInt(_0x5be638[_0x47f8('0x73')][_0x47f8('0x74')](0x0));var _0x5daca4=util[_0x47f8('0x22')](_0x47f8('0x75'),_0x2735f4[_0x47f8('0x68')],_0x294b69['id']);if(_0x331c96>0x6){_0x5daca4=util[_0x47f8('0x22')](_0x47f8('0x67'),_0x2735f4[_0x47f8('0x68')],_0x294b69['id']);}logger[_0x47f8('0x33')]('[OUTBOUND]',_0x47f8('0x69'));emit(util[_0x47f8('0x22')](_0x47f8('0x6a'),_0x5f353f['name']),_0x47f8('0x6b'),{'uri':_0x5daca4});})[_0x47f8('0x76')](function(_0x4aef9e){logger[_0x47f8('0x6c')]('[OUTBOUND]',JSON['stringify'](_0x4aef9e));});};exports['abandoned']=function(_0x322797,_0x4aa3dd,_0xc559b0,_0x2efd59,_0x5a2d3f,_0x8b857){var _0x301442,_0x3bc539,_0x456fb1,_0x1f1662;_0x8b857[_0x47f8('0x68')]=intUtil['stripTrailingSlash'](_0x8b857[_0x47f8('0x68')]);_0x8b857[_0x47f8('0x55')]=intUtil[_0x47f8('0x54')](_0x8b857[_0x47f8('0x55')]);def[_0x47f8('0x56')]=util[_0x47f8('0x22')](_0x47f8('0x57'),_0x8b857[_0x47f8('0x68')]);if(_0x5a2d3f&&_0x5a2d3f[_0x47f8('0x58')]){logger['info']('[ABANDONED]',_0x47f8('0x5a'));_0x4aa3dd[_0x47f8('0x5b')]=util[_0x47f8('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b857[_0x47f8('0x55')],_0x4aa3dd[_0x47f8('0x5d')],md5(_0x4aa3dd[_0x47f8('0x5d')]));}else{_0x4aa3dd['recordingURL']='';}return getConnection(_0x8b857)[_0x47f8('0x2c')](function(_0x593847){_0x1f1662=_0x593847;if(!_[_0x47f8('0x28')](_0x2efd59)){return getUser(_0x8b857,_0x2efd59[_0x47f8('0xd')],_0x1f1662);}else{return getUser(_0x8b857,null,_0x1f1662);}})[_0x47f8('0x2c')](function(_0x5293e6){_0x301442=_0x5293e6;logger[_0x47f8('0x33')](_0x47f8('0x5e'),_0x301442['id']);return getEndUser(_0x8b857,_0x4aa3dd[_0x47f8('0x5f')],_0x4aa3dd[_0x47f8('0x77')],_0x1f1662);})[_0x47f8('0x2c')](function(_0x501bdf){_0x3bc539=_0x501bdf;logger[_0x47f8('0x33')]('The\x20Enduser\x20ID\x20is:',_0x3bc539['id']);return getTicket(_0x8b857,_0x301442,_0x3bc539,_0xc559b0,_0x4aa3dd,_0xc559b0['Fields'],_0x1f1662,_0x47f8('0x62'));})['then'](function(_0x1b1db6){_0x456fb1=_0x1b1db6;logger[_0x47f8('0x33')](_0x47f8('0x63'));logger[_0x47f8('0x33')](_0x47f8('0x64'),_0x456fb1['id']);return setRelationship(_0x1f1662,_0x301442,_0x456fb1,'users');})[_0x47f8('0x2c')](function(){return setRelationship(_0x1f1662,_0x3bc539,_0x456fb1,_0x47f8('0x66'));})[_0x47f8('0x2c')](function(){return getServerInfo(_0x1f1662);})[_0x47f8('0x76')](function(_0x56e7e9){logger[_0x47f8('0x6c')](_0x47f8('0x78'),JSON[_0x47f8('0x27')](_0x56e7e9));});}; \ No newline at end of file +var _0xfb02=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','[ABANDONED]','lodash','request-promise','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','Subjects','created_by','description','getString','date_start','slice','replace','duration_hours','parent_id','Contacts','parent_name','direction','length','forEach','push','variableName','JSON','Calls','format','Basic\x20%s','toString','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','find','entry_list','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','nameField','customField','toLowerCase','string','idField','custom_fields','variable','Variable','POST','login','password','PLAIN','set_relationship','queue','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x11b220,_0x17b735){var _0x1a01c1=function(_0x4f5b3a){while(--_0x4f5b3a){_0x11b220['push'](_0x11b220['shift']());}};_0x1a01c1(++_0x17b735);}(_0xfb02,0x8c));var _0x2fb0=function(_0x416a38,_0x5004e0){_0x416a38=_0x416a38-0x0;var _0xec6c28=_0xfb02[_0x416a38];return _0xec6c28;};'use strict';var _=require(_0x2fb0('0x0'));var rp=require(_0x2fb0('0x1'));var BPromise=require(_0x2fb0('0x2'));var md5=require('md5');var util=require(_0x2fb0('0x3'));var Redis=require(_0x2fb0('0x4'));var intUtil=require('./util');var config=require(_0x2fb0('0x5'));var logger=require(_0x2fb0('0x6'))(_0x2fb0('0x7'));config[_0x2fb0('0x8')]=_['defaults'](config[_0x2fb0('0x8')],{'host':_0x2fb0('0x9'),'port':0x18eb});var io=require(_0x2fb0('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2a1064,_0x4634c3,_0x5f0ca8){io['to'](_0x2a1064)[_0x2fb0('0xb')](_0x4634c3,_0x5f0ca8);}function getTicket(_0x24e0e6,_0x3260d2,_0x5c6e8a,_0x29fb8a,_0x27fba2,_0x7ce67b,_0x3bf823,_0x1ba417){logger[_0x2fb0('0xc')](_0x2fb0('0xd'));var _0x5cf7a6=new Date();var _0xeb21e7=[{'name':_0x2fb0('0xe'),'value':intUtil['getString'](_0x29fb8a[_0x2fb0('0xf')],_0x27fba2,'\x20')},{'name':'assigned_user_id','value':_0x3260d2['id']},{'name':_0x2fb0('0x10'),'value':_0x3260d2['id']},{'name':_0x2fb0('0x11'),'value':intUtil[_0x2fb0('0x12')](_0x29fb8a['Descriptions'],_0x27fba2,'\x0a')},{'name':_0x2fb0('0x13'),'value':_0x5cf7a6['toISOString']()[_0x2fb0('0x14')](0x0,0x13)[_0x2fb0('0x15')]('T','\x20')},{'name':_0x2fb0('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x2fb0('0x17'),'value':_0x5c6e8a['id']},{'name':'parent_type','value':_0x2fb0('0x18')},{'name':_0x2fb0('0x19'),'value':_0x5c6e8a[_0x2fb0('0xe')]},{'name':_0x2fb0('0x1a'),'value':_0x1ba417}];if(_0x7ce67b[_0x2fb0('0x1b')]){_[_0x2fb0('0x1c')](_0x7ce67b,function(_0x2f66a6){if(_0x27fba2[_0x2f66a6['variableName']]){_0xeb21e7[_0x2fb0('0x1d')]({'name':_0x2f66a6['idField'],'value':_0x27fba2[_0x2f66a6[_0x2fb0('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x2fb0('0x1f'),'response_type':_0x2fb0('0x1f'),'rest_data':JSON['stringify']({'session':_0x3bf823['id'],'module_name':_0x2fb0('0x20'),'name_value_list':_0xeb21e7})}});}function getAuth(_0x102a3f){return util[_0x2fb0('0x21')](_0x2fb0('0x22'),new Buffer(_0x102a3f['apiKey']+':X')[_0x2fb0('0x23')]('base64'));}function getServerInfo(_0x82ded6){return request({'form':{'method':_0x2fb0('0x24'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2fb0('0x25')]({'session':_0x82ded6['id']})}});}function getUser(_0x41d5ea,_0x17ba83,_0x38f120){if(!_[_0x2fb0('0x26')](_0x17ba83)){logger[_0x2fb0('0xc')](_0x2fb0('0x27'),_0x17ba83);return request({'form':{'method':_0x2fb0('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x38f120['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x17ba83),'order_by':'','offset':'0','select_fields':['id',_0x2fb0('0xe'),_0x2fb0('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2fb0('0x2a')](function(_0xa94a26){if(_0xa94a26['entry_list'][_0x2fb0('0x1b')]){var _0x1b3d70=_[_0x2fb0('0x2b')](_0xa94a26[_0x2fb0('0x2c')],function(_0x4f0eb5){return _0x4f0eb5[_0x2fb0('0x2d')][_0x2fb0('0x29')]['value']===_0x17ba83;});if(_0x1b3d70){logger[_0x2fb0('0xc')](_0x2fb0('0x2e'));return BPromise['resolve']({'id':_0x1b3d70[_0x2fb0('0x2d')]['id'][_0x2fb0('0x2f')],'name':_0x1b3d70[_0x2fb0('0x2d')][_0x2fb0('0xe')]['value']});}}logger[_0x2fb0('0xc')](_0x2fb0('0x30'));return BPromise[_0x2fb0('0x31')]({'id':_0x38f120[_0x2fb0('0x2d')]['user_id'][_0x2fb0('0x2f')],'name':_0x38f120[_0x2fb0('0x2d')][_0x2fb0('0x29')][_0x2fb0('0x2f')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2fb0('0x31')]({'id':_0x38f120[_0x2fb0('0x2d')][_0x2fb0('0x32')]['value'],'name':_0x38f120[_0x2fb0('0x2d')][_0x2fb0('0x29')][_0x2fb0('0x2f')]});}}function getEndUser(_0x21c4a9,_0x5df6c9,_0x45c995,_0x36f45a){logger[_0x2fb0('0xc')]('Searching\x20enduser\x20with\x20phone',_0x45c995);return request({'form':{'method':'get_entry_list','input_type':_0x2fb0('0x1f'),'response_type':_0x2fb0('0x1f'),'rest_data':JSON[_0x2fb0('0x25')]({'session':_0x36f45a['id'],'module_name':'Contacts','query':util[_0x2fb0('0x21')](_0x2fb0('0x33'),_0x45c995),'order_by':'','offset':'0','select_fields':['id',_0x2fb0('0xe'),_0x2fb0('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2fb0('0x2a')](function(_0x49472f){if(_0x49472f[_0x2fb0('0x2c')][_0x2fb0('0x1b')]){var _0xe21fe=_[_0x2fb0('0x2b')](_0x49472f['entry_list'],function(_0x1d0c41){return _0x1d0c41[_0x2fb0('0x2d')][_0x2fb0('0x34')][_0x2fb0('0x2f')]===_0x45c995;});if(_0xe21fe){logger[_0x2fb0('0xc')](_0x2fb0('0x35'));return BPromise['resolve']({'id':_0xe21fe[_0x2fb0('0x2d')]['id'][_0x2fb0('0x2f')],'name':_0xe21fe[_0x2fb0('0x2d')][_0x2fb0('0xe')][_0x2fb0('0x2f')],'phone':_0xe21fe[_0x2fb0('0x2d')][_0x2fb0('0x34')][_0x2fb0('0x2f')]});}}else{logger['info'](_0x2fb0('0x36'));return request({'form':{'method':_0x2fb0('0x37'),'input_type':_0x2fb0('0x1f'),'response_type':_0x2fb0('0x1f'),'rest_data':JSON[_0x2fb0('0x25')]({'session':_0x36f45a['id'],'module_name':'Contacts','name_value_list':[{'name':_0x2fb0('0x38'),'value':_0x5df6c9!==_0x2fb0('0x39')?_0x5df6c9:util[_0x2fb0('0x21')](_0x2fb0('0x3a'),_0x45c995)},{'name':_0x2fb0('0x34'),'value':_0x45c995}]})}})[_0x2fb0('0x2a')](function(_0x1294de){logger['info'](_0x2fb0('0x3b'));return BPromise['resolve']({'id':_0x1294de['id'],'name':_0x1294de[_0x2fb0('0x2c')][_0x2fb0('0x38')]['value'],'phone':_0x1294de['entry_list']['phone_home'][_0x2fb0('0x2f')]});});}});}function request(_0x2ab522){logger[_0x2fb0('0x3c')]('[HTTP]',JSON[_0x2fb0('0x25')](_0x2ab522));return rp(_[_0x2fb0('0x3d')](def,_0x2ab522));}function getTags(_0xc80cfe,_0x248c3c){var _0x4c6a42=[];if(_0xc80cfe&&_0xc80cfe[_0x2fb0('0x1b')]>0x0){_0x4c6a42=_['map'](_0xc80cfe,_0x248c3c);}return _0x4c6a42;}function getCustomFields(_0x44f685,_0x9baa03){var _0x1d40bd=[];var _0x35cd06={'custom_fields':[]};if(_0x44f685[_0x2fb0('0x1b')]>0x0){_[_0x2fb0('0x1c')](_0x44f685,function(_0x54e73b){if(_0x54e73b[_0x2fb0('0x3e')]==='string'&&_0x54e73b[_0x2fb0('0x3f')]&&!_0x54e73b[_0x2fb0('0x40')]){_0x35cd06[_0x54e73b['nameField'][_0x2fb0('0x41')]()]=_0x54e73b['content'][_0x2fb0('0x23')]();}else if(_0x54e73b[_0x2fb0('0x3e')]===_0x2fb0('0x42')&&_0x54e73b[_0x2fb0('0x43')]&&_0x54e73b['customField']){_0x35cd06[_0x2fb0('0x44')]['push']({'id':_0x54e73b[_0x2fb0('0x43')],'value':_0x54e73b['content'][_0x2fb0('0x23')]()});}else if(_0x54e73b[_0x2fb0('0x3e')]===_0x2fb0('0x45')&&_0x54e73b[_0x2fb0('0x1e')]&&_0x54e73b[_0x2fb0('0x43')]&&_0x54e73b[_0x2fb0('0x40')]){_0x9baa03[_0x54e73b['variableName']]&&_0x35cd06[_0x2fb0('0x44')][_0x2fb0('0x1d')]({'id':_0x54e73b[_0x2fb0('0x43')],'value':_0x9baa03[_0x54e73b[_0x2fb0('0x1e')]][_0x2fb0('0x23')]()});}else if(_0x54e73b[_0x2fb0('0x3e')]==='customVariable'&&_0x54e73b['Variable']&&_0x54e73b[_0x2fb0('0x46')][_0x2fb0('0xe')]&&_0x54e73b[_0x2fb0('0x43')]&&_0x54e73b[_0x2fb0('0x40')]){_0x9baa03[_0x54e73b['Variable']['name'][_0x2fb0('0x41')]()]&&_0x35cd06[_0x2fb0('0x44')][_0x2fb0('0x1d')]({'id':_0x54e73b[_0x2fb0('0x43')],'value':_0x9baa03[_0x54e73b[_0x2fb0('0x46')][_0x2fb0('0xe')][_0x2fb0('0x41')]()]['toString']()});}});}return _0x35cd06;}function getConnection(_0x4395fa){return request({'method':_0x2fb0('0x47'),'form':{'method':_0x2fb0('0x48'),'input_type':_0x2fb0('0x1f'),'response_type':_0x2fb0('0x1f'),'rest_data':JSON[_0x2fb0('0x25')]({'user_auth':{'user_name':_0x4395fa['username'],'password':_0x4395fa[_0x2fb0('0x49')],'encryption':_0x2fb0('0x4a')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x2fb0('0x2a')](function(_0x37b587){var _0x5c5490=_0x37b587;if(_0x5c5490['id']){def['sessionID']=_0x5c5490['id'];return BPromise[_0x2fb0('0x31')](_0x5c5490);}else{throw new Error(util[_0x2fb0('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x4395fa['id']));}});}function setRelationship(_0x577b07,_0x13783f,_0x3b19a8,_0x51f734){return request({'form':{'method':_0x2fb0('0x4b'),'input_type':_0x2fb0('0x1f'),'response_type':_0x2fb0('0x1f'),'rest_data':JSON[_0x2fb0('0x25')]({'session':_0x577b07['id'],'module_name':_0x2fb0('0x20'),'module_id':_0x3b19a8['id'],'link_field_name':_0x51f734,'related_ids':[_0x13783f['id']]})}});}exports[_0x2fb0('0x4c')]=function(_0x559af8,_0xca8ac2,_0x2fab21,_0x4def90,_0x15066c,_0x58bd15){var _0x380a45,_0x35bae3,_0xf8e1d6,_0x2907ad;_0x58bd15[_0x2fb0('0x4d')]=intUtil['stripTrailingSlash'](_0x58bd15[_0x2fb0('0x4d')]);_0x58bd15[_0x2fb0('0x4e')]=intUtil['stripTrailingSlash'](_0x58bd15[_0x2fb0('0x4e')]);def[_0x2fb0('0x4f')]=util[_0x2fb0('0x21')](_0x2fb0('0x50'),_0x58bd15[_0x2fb0('0x4d')]);if(_0x15066c&&_0x15066c[_0x2fb0('0x51')]){logger[_0x2fb0('0xc')](_0x2fb0('0x52'),_0x2fb0('0x53'));_0xca8ac2[_0x2fb0('0x54')]=util[_0x2fb0('0x21')](_0x2fb0('0x55'),_0x58bd15[_0x2fb0('0x4e')],_0xca8ac2[_0x2fb0('0x56')],md5(_0xca8ac2[_0x2fb0('0x56')]));}else{_0xca8ac2[_0x2fb0('0x54')]='';}return getConnection(_0x58bd15)['then'](function(_0x1a0a52){_0x2907ad=_0x1a0a52;return getUser(_0x58bd15,_0x4def90[_0x2fb0('0xe')],_0x2907ad);})[_0x2fb0('0x2a')](function(_0x17f80e){_0x380a45=_0x17f80e;logger['info'](_0x2fb0('0x57'),_0x380a45['id']);return getEndUser(_0x58bd15,_0xca8ac2[_0x2fb0('0x58')],_0xca8ac2[_0x2fb0('0x59')],_0x2907ad);})[_0x2fb0('0x2a')](function(_0x3bd218){_0x35bae3=_0x3bd218;logger[_0x2fb0('0xc')](_0x2fb0('0x5a'),_0x35bae3['id']);return getTicket(_0x58bd15,_0x380a45,_0x35bae3,_0x2fab21,_0xca8ac2,_0x2fab21[_0x2fb0('0x5b')],_0x2907ad,_0x2fb0('0x5c'));})[_0x2fb0('0x2a')](function(_0x2b5c93){_0xf8e1d6=_0x2b5c93;logger[_0x2fb0('0xc')](_0x2fb0('0x5d'));logger[_0x2fb0('0xc')]('The\x20Ticket\x20ID\x20is:',_0xf8e1d6['id']);return setRelationship(_0x2907ad,_0x380a45,_0xf8e1d6,_0x2fb0('0x5e'));})['then'](function(){return setRelationship(_0x2907ad,_0x35bae3,_0xf8e1d6,_0x2fb0('0x5f'));})[_0x2fb0('0x2a')](function(){return getServerInfo(_0x2907ad);})[_0x2fb0('0x2a')](function(_0x20ce5b){var _0x3f5a48=parseInt(_0x20ce5b[_0x2fb0('0x60')][_0x2fb0('0x61')](0x0));var _0x2524d4=util[_0x2fb0('0x21')](_0x2fb0('0x62'),_0x58bd15['remoteUri'],_0xf8e1d6['id']);if(_0x3f5a48>0x6){_0x2524d4=util['format'](_0x2fb0('0x63'),_0x58bd15['remoteUri'],_0xf8e1d6['id']);}logger[_0x2fb0('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2fb0('0x64'),_0x4def90[_0x2fb0('0xe')]),_0x2fb0('0x65'),{'uri':_0x2524d4});})[_0x2fb0('0x66')](function(_0x65d368){logger['error']('[QUEUE]',JSON[_0x2fb0('0x25')](_0x65d368));});};exports[_0x2fb0('0x67')]=function(_0x2f7dd4,_0x2a0059,_0x4404fa,_0x17cac9,_0x5bccb6,_0x28ab02,_0x2bfbcc){var _0x52ba52,_0x37e5da,_0xca2ca7,_0x5a7a1e;_0x28ab02[_0x2fb0('0x4d')]=intUtil['stripTrailingSlash'](_0x28ab02['remoteUri']);_0x28ab02[_0x2fb0('0x4e')]=intUtil[_0x2fb0('0x68')](_0x28ab02[_0x2fb0('0x4e')]);def['uri']=util['format'](_0x2fb0('0x50'),_0x28ab02['remoteUri']);if(_0x2bfbcc&&_0x2bfbcc[_0x2fb0('0x69')]&&_0x2bfbcc['recordingFormat']!=='none'){logger[_0x2fb0('0xc')](_0x2fb0('0x6a'),_0x2fb0('0x53'));_0x2a0059['recordingURL']=util[_0x2fb0('0x21')](_0x2fb0('0x55'),_0x28ab02[_0x2fb0('0x4e')],_0x2a0059[_0x2fb0('0x56')],md5(_0x2a0059[_0x2fb0('0x56')]));}return getConnection(_0x28ab02)['then'](function(_0x537922){_0x5a7a1e=_0x537922;return getUser(_0x28ab02,_0x17cac9[_0x2fb0('0xe')],_0x5a7a1e);})[_0x2fb0('0x2a')](function(_0x3deebb){_0x52ba52=_0x3deebb;logger['info'](_0x2fb0('0x57'),_0x52ba52['id']);return getEndUser(_0x28ab02,_0x2a0059[_0x2fb0('0x6b')],_0x2a0059['destcalleridnum'],_0x5a7a1e);})['then'](function(_0x23d88f){_0x37e5da=_0x23d88f;logger[_0x2fb0('0xc')](_0x2fb0('0x5a'),_0x37e5da['id']);return getTicket(_0x28ab02,_0x52ba52,_0x37e5da,_0x4404fa,_0x2a0059,_0x4404fa[_0x2fb0('0x5b')],_0x5a7a1e,'Outbound');})['then'](function(_0x1c1144){_0xca2ca7=_0x1c1144;logger[_0x2fb0('0xc')](_0x2fb0('0x5d'));logger[_0x2fb0('0xc')](_0x2fb0('0x6c'),_0xca2ca7['id']);return setRelationship(_0x5a7a1e,_0x52ba52,_0xca2ca7,'users');})[_0x2fb0('0x2a')](function(){return setRelationship(_0x5a7a1e,_0x37e5da,_0xca2ca7,_0x2fb0('0x5f'));})[_0x2fb0('0x2a')](function(){return getServerInfo(_0x5a7a1e);})[_0x2fb0('0x2a')](function(_0xd47e3c){var _0x415b68=parseInt(_0xd47e3c['version'][_0x2fb0('0x61')](0x0));var _0x345fcf=util['format'](_0x2fb0('0x62'),_0x28ab02[_0x2fb0('0x4d')],_0xca2ca7['id']);if(_0x415b68>0x6){_0x345fcf=util[_0x2fb0('0x21')](_0x2fb0('0x63'),_0x28ab02['remoteUri'],_0xca2ca7['id']);}logger['info']('[OUTBOUND]',_0x2fb0('0x6d'));emit(util[_0x2fb0('0x21')]('user:%s',_0x17cac9[_0x2fb0('0xe')]),'trigger:browser:url',{'uri':_0x345fcf});})[_0x2fb0('0x66')](function(_0x52cf17){logger[_0x2fb0('0x6e')](_0x2fb0('0x6a'),JSON[_0x2fb0('0x25')](_0x52cf17));});};exports['abandoned']=function(_0x2c7534,_0x25568b,_0x1579a2,_0x51cffd,_0x19ac5b,_0x15bf43){var _0x518427,_0x41fac9,_0x1ed161,_0x38f594;_0x15bf43[_0x2fb0('0x4d')]=intUtil[_0x2fb0('0x68')](_0x15bf43[_0x2fb0('0x4d')]);_0x15bf43[_0x2fb0('0x4e')]=intUtil[_0x2fb0('0x68')](_0x15bf43[_0x2fb0('0x4e')]);def[_0x2fb0('0x4f')]=util[_0x2fb0('0x21')](_0x2fb0('0x50'),_0x15bf43[_0x2fb0('0x4d')]);if(_0x19ac5b&&_0x19ac5b['monitor_format']){logger[_0x2fb0('0xc')](_0x2fb0('0x6f'),_0x2fb0('0x53'));_0x25568b[_0x2fb0('0x54')]=util[_0x2fb0('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x15bf43[_0x2fb0('0x4e')],_0x25568b[_0x2fb0('0x56')],md5(_0x25568b[_0x2fb0('0x56')]));}else{_0x25568b[_0x2fb0('0x54')]='';}return getConnection(_0x15bf43)[_0x2fb0('0x2a')](function(_0x224cca){_0x38f594=_0x224cca;if(!_['isNil'](_0x51cffd)){return getUser(_0x15bf43,_0x51cffd['name'],_0x38f594);}else{return getUser(_0x15bf43,null,_0x38f594);}})[_0x2fb0('0x2a')](function(_0x12b413){_0x518427=_0x12b413;logger['info'](_0x2fb0('0x57'),_0x518427['id']);return getEndUser(_0x15bf43,_0x25568b[_0x2fb0('0x58')],_0x25568b['calleridnum'],_0x38f594);})['then'](function(_0x3c4c78){_0x41fac9=_0x3c4c78;logger[_0x2fb0('0xc')]('The\x20Enduser\x20ID\x20is:',_0x41fac9['id']);return getTicket(_0x15bf43,_0x518427,_0x41fac9,_0x1579a2,_0x25568b,_0x1579a2[_0x2fb0('0x5b')],_0x38f594,_0x2fb0('0x5c'));})[_0x2fb0('0x2a')](function(_0x2c7478){_0x1ed161=_0x2c7478;logger['info'](_0x2fb0('0x5d'));logger[_0x2fb0('0xc')](_0x2fb0('0x6c'),_0x1ed161['id']);return setRelationship(_0x38f594,_0x518427,_0x1ed161,_0x2fb0('0x5e'));})[_0x2fb0('0x2a')](function(){return setRelationship(_0x38f594,_0x41fac9,_0x1ed161,_0x2fb0('0x5f'));})[_0x2fb0('0x2a')](function(){return getServerInfo(_0x38f594);})['catch'](function(_0x2b5985){logger[_0x2fb0('0x6e')](_0x2fb0('0x6f'),JSON[_0x2fb0('0x25')](_0x2b5985));});}; \ 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 be4d7e7..82d338b 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 _0x64da=['Variable','name','toLowerCase','toString','keyType','format','%s:\x20%s','key','keyContent','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','lodash','util','length','sortBy','type','string','variableName','push','customVariable'];(function(_0x20047b,_0xe7284e){var _0x252d81=function(_0xa09a7a){while(--_0xa09a7a){_0x20047b['push'](_0x20047b['shift']());}};_0x252d81(++_0xe7284e);}(_0x64da,0x17e));var _0xa64d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x64da[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa64d('0x0'));var util=require(_0xa64d('0x1'));exports['getString']=function(_0x4107e5,_0x91777d,_0x3d0b51){var _0x5b9cc1=[];if(_0x4107e5[_0xa64d('0x2')]>0x0){var _0x17e528=_[_0xa64d('0x3')](_0x4107e5,['id']);for(var _0x33a248=0x0;_0x33a248<_0x17e528[_0xa64d('0x2')];_0x33a248++){var _0xb93b35=_0x17e528[_0x33a248];if(_0xb93b35[_0xa64d('0x4')]===_0xa64d('0x5')){_0x5b9cc1['push'](_0xb93b35['content']);}else if(_0xb93b35[_0xa64d('0x4')]==='variable'&&_0xb93b35[_0xa64d('0x6')]){_0x91777d[_0xb93b35[_0xa64d('0x6')]]&&_0x5b9cc1[_0xa64d('0x7')](_0x91777d[_0xb93b35[_0xa64d('0x6')]]['toString']());}else if(_0xb93b35[_0xa64d('0x4')]===_0xa64d('0x8')&&_0xb93b35['Variable']&&_0xb93b35[_0xa64d('0x9')][_0xa64d('0xa')]){_0x91777d[_0xb93b35['Variable']['name'][_0xa64d('0xb')]()]&&_0x5b9cc1[_0xa64d('0x7')](_0x91777d[_0xb93b35[_0xa64d('0x9')]['name'][_0xa64d('0xb')]()][_0xa64d('0xc')]());}else if(_0xb93b35[_0xa64d('0x4')]==='keyValue'){if(_0xb93b35[_0xa64d('0xd')]==='string'&&_0xb93b35['key']){_0x5b9cc1[_0xa64d('0x7')](util[_0xa64d('0xe')](_0xa64d('0xf'),_0xb93b35[_0xa64d('0x10')],_0xb93b35[_0xa64d('0x11')]));}else if(_0xb93b35['keyType']==='variable'&&_0xb93b35[_0xa64d('0x6')]&&_0xb93b35['key']){_0x91777d[_0xb93b35['variableName']]&&_0x5b9cc1[_0xa64d('0x7')](util['format'](_0xa64d('0xf'),_0xb93b35[_0xa64d('0x10')],_0x91777d[_0xb93b35['variableName']]));}else if(_0xb93b35[_0xa64d('0xd')]===_0xa64d('0x8')&&_0xb93b35[_0xa64d('0x9')]&&_0xb93b35[_0xa64d('0x9')][_0xa64d('0xa')]&&_0xb93b35['key']){_0x91777d[_0xb93b35[_0xa64d('0x9')][_0xa64d('0xa')][_0xa64d('0xb')]()]&&_0x5b9cc1['push'](util[_0xa64d('0xe')](_0xa64d('0xf'),_0xb93b35[_0xa64d('0x10')],_0x91777d[_0xb93b35[_0xa64d('0x9')][_0xa64d('0xa')]['toLowerCase']()]));}}}}return _0x5b9cc1['join'](_0x3d0b51);};exports[_0xa64d('0x12')]=function(_0xebea89){var _0x125cf5=_0xebea89[_0xa64d('0x13')](-0x1);if(_0x125cf5==='/'){_0xebea89=_0xebea89['substring'](0x0,_0xebea89[_0xa64d('0x14')](_0x125cf5));}return _0xebea89;};exports[_0xa64d('0x15')]=function(_0x133102){if(!_[_0xa64d('0x16')](_0x133102)&&_0x133102!==''){var _0x5a0f8b=/^(([^<>()\[\]\\.,;:\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 _0x5a0f8b['test'](String(_0x133102)[_0xa64d('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x95fb=['length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','substring','lastIndexOf','isNil','lodash','getString'];(function(_0xe48a82,_0xa32554){var _0xa47167=function(_0x4ad9e6){while(--_0x4ad9e6){_0xe48a82['push'](_0xe48a82['shift']());}};_0xa47167(++_0xa32554);}(_0x95fb,0x1b3));var _0xb95f=function(_0x13c0fe,_0x2af510){_0x13c0fe=_0x13c0fe-0x0;var _0x922e43=_0x95fb[_0x13c0fe];return _0x922e43;};'use strict';var _=require(_0xb95f('0x0'));var util=require('util');exports[_0xb95f('0x1')]=function(_0x5a37e8,_0x3ae5bb,_0x1c4825){var _0x33c0c8=[];if(_0x5a37e8[_0xb95f('0x2')]>0x0){var _0x2cffab=_['sortBy'](_0x5a37e8,['id']);for(var _0x398b13=0x0;_0x398b13<_0x2cffab[_0xb95f('0x2')];_0x398b13++){var _0x4156f3=_0x2cffab[_0x398b13];if(_0x4156f3[_0xb95f('0x3')]===_0xb95f('0x4')){_0x33c0c8[_0xb95f('0x5')](_0x4156f3[_0xb95f('0x6')]);}else if(_0x4156f3[_0xb95f('0x3')]===_0xb95f('0x7')&&_0x4156f3[_0xb95f('0x8')]){_0x3ae5bb[_0x4156f3['variableName']]&&_0x33c0c8[_0xb95f('0x5')](_0x3ae5bb[_0x4156f3[_0xb95f('0x8')]][_0xb95f('0x9')]());}else if(_0x4156f3[_0xb95f('0x3')]===_0xb95f('0xa')&&_0x4156f3[_0xb95f('0xb')]&&_0x4156f3['Variable'][_0xb95f('0xc')]){_0x3ae5bb[_0x4156f3[_0xb95f('0xb')]['name'][_0xb95f('0xd')]()]&&_0x33c0c8[_0xb95f('0x5')](_0x3ae5bb[_0x4156f3['Variable'][_0xb95f('0xc')]['toLowerCase']()][_0xb95f('0x9')]());}else if(_0x4156f3['type']===_0xb95f('0xe')){if(_0x4156f3[_0xb95f('0xf')]==='string'&&_0x4156f3[_0xb95f('0x10')]){_0x33c0c8[_0xb95f('0x5')](util[_0xb95f('0x11')](_0xb95f('0x12'),_0x4156f3[_0xb95f('0x10')],_0x4156f3['keyContent']));}else if(_0x4156f3[_0xb95f('0xf')]===_0xb95f('0x7')&&_0x4156f3['variableName']&&_0x4156f3[_0xb95f('0x10')]){_0x3ae5bb[_0x4156f3[_0xb95f('0x8')]]&&_0x33c0c8[_0xb95f('0x5')](util[_0xb95f('0x11')](_0xb95f('0x12'),_0x4156f3[_0xb95f('0x10')],_0x3ae5bb[_0x4156f3['variableName']]));}else if(_0x4156f3[_0xb95f('0xf')]===_0xb95f('0xa')&&_0x4156f3[_0xb95f('0xb')]&&_0x4156f3[_0xb95f('0xb')][_0xb95f('0xc')]&&_0x4156f3[_0xb95f('0x10')]){_0x3ae5bb[_0x4156f3[_0xb95f('0xb')][_0xb95f('0xc')][_0xb95f('0xd')]()]&&_0x33c0c8[_0xb95f('0x5')](util['format'](_0xb95f('0x12'),_0x4156f3[_0xb95f('0x10')],_0x3ae5bb[_0x4156f3[_0xb95f('0xb')][_0xb95f('0xc')]['toLowerCase']()]));}}}}return _0x33c0c8['join'](_0x1c4825);};exports[_0xb95f('0x13')]=function(_0x4e55e8){var _0x59fd75=_0x4e55e8['slice'](-0x1);if(_0x59fd75==='/'){_0x4e55e8=_0x4e55e8[_0xb95f('0x14')](0x0,_0x4e55e8[_0xb95f('0x15')](_0x59fd75));}return _0x4e55e8;};exports['validateEmail']=function(_0x2bf0ac){if(!_[_0xb95f('0x16')](_0x2bf0ac)&&_0x2bf0ac!==''){var _0x466db2=/^(([^<>()\[\]\\.,;:\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 _0x466db2['test'](String(_0x2bf0ac)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 3b30da5..1265a58 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 _0x3e74=['Normal','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','admin','getUser','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','create','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','[OUTBOUND]','user:%s','abandoned','[ABANDONED]','lodash','bluebird','md5','util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','forEach','string','idField','content','type','variable','variableName','toString','Variable','name','info','Creating\x20new\x20ticket...','merge'];(function(_0x36599e,_0x251465){var _0x43acb2=function(_0x56660f){while(--_0x56660f){_0x36599e['push'](_0x36599e['shift']());}};_0x43acb2(++_0x251465);}(_0x3e74,0x175));var _0x43e7=function(_0x4f286f,_0x488d2d){_0x4f286f=_0x4f286f-0x0;var _0x4a5cb6=_0x3e74[_0x4f286f];return _0x4a5cb6;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var BPromise=require(_0x43e7('0x1'));var md5=require(_0x43e7('0x2'));var util=require(_0x43e7('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x43e7('0x4'));var logger=require('../../../../config/logger')(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));function emit(_0x3491d6,_0x2ede2d,_0x8528fc){io['to'](_0x3491d6)[_0x43e7('0x9')](_0x2ede2d,_0x8528fc);}function getCustomFields(_0x516b4d,_0x212c6c){var _0x554d44={};if(_0x516b4d['length']>0x0){_[_0x43e7('0xa')](_0x516b4d,function(_0x4139c9){if(_0x4139c9['type']===_0x43e7('0xb')&&_0x4139c9['idField']){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x4139c9[_0x43e7('0xd')]['toString']();}else if(_0x4139c9[_0x43e7('0xe')]===_0x43e7('0xf')&&_0x4139c9[_0x43e7('0x10')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9['variableName']]){_0x554d44[_0x4139c9['idField']]=_0x212c6c[_0x4139c9[_0x43e7('0x10')]][_0x43e7('0x11')]();}else if(_0x4139c9[_0x43e7('0xe')]==='customVariable'&&_0x4139c9['Variable']&&_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9[_0x43e7('0x12')]['name']['toLowerCase']()]){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x212c6c[_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]['toLowerCase']()]['toString']();}});}return _0x554d44;}function createTicket(_0x446986,_0x1ca758,_0x9037d3,_0x140657,_0x3776f5,_0x1f24fb,_0x619236){logger[_0x43e7('0x14')](_0x43e7('0x15'));var _0xab63cf=_[_0x43e7('0x16')]({'parent_id':'','assigned_user_id':_0x1ca758['id'],'ticketpriorities':_0x43e7('0x17'),'ticketstatus':'Open','ticket_title':intUtil[_0x43e7('0x18')](_0x140657[_0x43e7('0x19')],_0x3776f5,'\x20'),'description':intUtil['getString'](_0x140657[_0x43e7('0x1a')],_0x3776f5,'\x0a'),'contact_id':_0x9037d3['id']},getCustomFields(_0x1f24fb,_0x3776f5));var _0x3e281e={'method':_0x43e7('0x1b'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986[_0x43e7('0x1e')]),'form':{'operation':'create','username':_0x446986[_0x43e7('0x1f')],'sessionName':_0x619236['sessionName'],'elementType':'HelpDesk','element':JSON[_0x43e7('0x20')](_0xab63cf)},'json':!![]};return request(_0x3e281e)[_0x43e7('0x21')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x22')]){return BPromise['resolve']({'id':_0x4b2b9f[_0x43e7('0x23')]['id']});}else{throw new Error(util['format'](_0x43e7('0x24'),JSON[_0x43e7('0x20')](_0x4b2b9f[_0x43e7('0x25')])));}})[_0x43e7('0x26')](function(_0x51f4d7){var _0x52b7b3=_0x51f4d7[_0x43e7('0x27')]||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x29'),_0x52b7b3,JSON[_0x43e7('0x20')](_0x51f4d7));});}function getUser(_0xb1fc63,_0x5087d7,_0x33a1a5){if(intUtil[_0x43e7('0x2a')](_0x5087d7)){logger[_0x43e7('0x14')](_0x43e7('0x2b'),_0x5087d7);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0xb1fc63[_0x43e7('0x1e')]),'qs':{'operation':_0x43e7('0x2d'),'username':_0xb1fc63[_0x43e7('0x1f')],'sessionName':_0x33a1a5[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x2f'),_0x5087d7)},'json':!![]})[_0x43e7('0x21')](function(_0x4bdb17){if(_0x4bdb17[_0x43e7('0x22')]&&_0x4bdb17[_0x43e7('0x23')][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x31'));return BPromise['resolve']({'id':_0x4bdb17[_0x43e7('0x23')][0x0]['id'],'email':_0x4bdb17[_0x43e7('0x23')][0x0][_0x43e7('0x32')],'name':_0x4bdb17[_0x43e7('0x23')][0x0]['first_name']+'\x20'+_0x4bdb17['result']['last_name']});}else{logger[_0x43e7('0x14')](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')});}})['catch'](function(_0x47baee){var _0x4ac23d=_0x47baee['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x4ac23d,JSON[_0x43e7('0x20')](_0x47baee));});}else{logger['info'](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')})[_0x43e7('0x26')](function(_0x101d45){var _0x4f1a5f=_0x101d45['statusCode']||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x37'),_0x4f1a5f,JSON[_0x43e7('0x20')](_0x101d45));});}}function getEndUser(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589){logger[_0x43e7('0x14')]('Searching\x20end\x20user\x20with\x20phone',_0x1ed538);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x16cdba[_0x43e7('0x1e')]),'qs':{'operation':'query','username':_0x16cdba[_0x43e7('0x1f')],'sessionName':_0x1d4589[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x38'),_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538)},'json':!![]})[_0x43e7('0x21')](function(_0x234d8f){if(_0x234d8f['success']&&_0x234d8f['result'][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x39'));return BPromise[_0x43e7('0x34')]({'id':_0x234d8f[_0x43e7('0x23')][0x0]['id'],'name':_0x234d8f['result'][0x0][_0x43e7('0x3a')]+'\x20'+_0x234d8f[_0x43e7('0x23')][0x0]['lastname'],'phone':_0x1ed538});}else{logger[_0x43e7('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x43e7('0x1b'),'uri':util['format'](_0x43e7('0x1d'),_0x16cdba[_0x43e7('0x1e')]),'form':{'operation':_0x43e7('0x3b'),'sessionName':_0x1d4589[_0x43e7('0x2e')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x1b1440,'phone':_0x1ed538,'assigned_user_id':'\x20'})},'json':!![]})[_0x43e7('0x21')](function(_0x40c509){logger[_0x43e7('0x14')](_0x43e7('0x3c'));return BPromise['resolve']({'id':_0x40c509['result']['id'],'name':_0x40c509['result'][_0x43e7('0x3d')],'phone':_0x40c509['result'][_0x43e7('0x3e')]});})['catch'](function(_0x5b28db){var _0x46b2e6=_0x5b28db['statusCode']||0x1f4;logger[_0x43e7('0x25')](_0x43e7('0x28'),_0x43e7('0x3f'),_0x46b2e6,JSON[_0x43e7('0x20')](_0x5b28db));});}});}function getConnection(_0x4fc5e8){var _0x91f1e4=_0x4fc5e8[_0x43e7('0x1f')];var _0x23a611=_0x4fc5e8[_0x43e7('0x40')];return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x4fc5e8['remoteUri']),'qs':{'operation':_0x43e7('0x41'),'username':_0x91f1e4},'json':!![]})[_0x43e7('0x21')](function(_0x212841){if(_0x212841['success']){return request({'method':'POST','uri':util['format'](_0x43e7('0x1d'),_0x4fc5e8[_0x43e7('0x1e')]),'form':{'operation':'login','username':_0x91f1e4,'accessKey':md5(_0x212841[_0x43e7('0x23')][_0x43e7('0x42')]+_0x23a611)},'json':!![]});}})[_0x43e7('0x21')](function(_0x560329){if(_0x560329['success']){return BPromise['resolve'](_0x560329['result']);}else{throw new Error(util[_0x43e7('0x1c')](_0x43e7('0x43'),_0x4fc5e8['id']));}})['catch'](function(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x27')]||0x1f4;logger[_0x43e7('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x43e7('0x44'),_0x82d32f,JSON['stringify'](_0x23e7cb));});}function request(_0x4bebd4){logger[_0x43e7('0x14')](_0x43e7('0x45'),JSON[_0x43e7('0x20')](_0x4bebd4));return rp(_0x4bebd4);}exports[_0x43e7('0x46')]=function(_0x13503c,_0x2351cf,_0x1cd87c,_0x256ddd,_0x473fca,_0x2b5515){var _0x58dfd0,_0x119d34,_0x46c910,_0x499c03;_0x2b5515[_0x43e7('0x1e')]=intUtil['stripTrailingSlash'](_0x2b5515[_0x43e7('0x1e')]);if(_0x473fca&&_0x473fca[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x48'),_0x43e7('0x49'));_0x2351cf['recordingURL']=util['format'](_0x43e7('0x4a'),_0x2b5515[_0x43e7('0x4b')],_0x2351cf[_0x43e7('0x4c')],md5(_0x2351cf[_0x43e7('0x4c')]));}else{_0x2351cf[_0x43e7('0x4d')]='';}return getConnection(_0x2b5515)[_0x43e7('0x21')](function(_0xa47464){_0x499c03=_0xa47464;return getUser(_0x2b5515,_0x256ddd[_0x43e7('0x4e')],_0x499c03);})[_0x43e7('0x21')](function(_0x24e758){_0x58dfd0=_0x24e758;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x58dfd0['id']);return getEndUser(_0x2b5515,_0x2351cf[_0x43e7('0x4f')],_0x2351cf[_0x43e7('0x50')],_0x499c03);})['then'](function(_0x4314d8){_0x119d34=_0x4314d8;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x119d34['id']);return createTicket(_0x2b5515,_0x58dfd0,_0x119d34,_0x1cd87c,_0x2351cf,_0x1cd87c['Fields'],_0x499c03);})['then'](function(_0x459c13){_0x46c910=_0x459c13;logger[_0x43e7('0x14')]('Ticket\x20created!');logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x46c910['id']);var _0x49a6ce=util[_0x43e7('0x1c')](_0x43e7('0x52'),_0x2b5515[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x46c910['id'],'x')[0x1]);logger[_0x43e7('0x14')]('[QUEUE]',_0x43e7('0x54'));emit(util[_0x43e7('0x1c')]('user:%s',_0x256ddd[_0x43e7('0x13')]),_0x43e7('0x55'),{'uri':_0x49a6ce});})[_0x43e7('0x26')](function(_0x5bb536){logger['error']('[QUEUE]',JSON[_0x43e7('0x20')](_0x5bb536));});};exports[_0x43e7('0x56')]=function(_0x323cf7,_0x3a6404,_0x52ea9c,_0x5a50fc,_0x1b27da,_0x8b50bb,_0x140438){var _0x5dd349,_0x5ea0db,_0x4438c0,_0x1a7cb5;_0x8b50bb[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x1e')]);_0x8b50bb[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x4b')]);if(_0x140438&&_0x140438[_0x43e7('0x58')]&&_0x140438[_0x43e7('0x58')]!==_0x43e7('0x59')){logger['info']('[OUTBOUND]',_0x43e7('0x49'));_0x3a6404['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b50bb[_0x43e7('0x4b')],_0x3a6404[_0x43e7('0x4c')],md5(_0x3a6404['uniqueid']));}return getConnection(_0x8b50bb)[_0x43e7('0x21')](function(_0x135791){_0x1a7cb5=_0x135791;return getUser(_0x8b50bb,_0x5a50fc[_0x43e7('0x4e')],_0x1a7cb5);})['then'](function(_0x2b7406){_0x5dd349=_0x2b7406;logger[_0x43e7('0x14')](_0x43e7('0x5a'),_0x5dd349['id']);return getEndUser(_0x8b50bb,_0x3a6404[_0x43e7('0x5b')],_0x3a6404[_0x43e7('0x5c')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x1e02fa){_0x5ea0db=_0x1e02fa;logger['info'](_0x43e7('0x51'),_0x5ea0db['id']);return createTicket(_0x8b50bb,_0x5dd349,_0x5ea0db,_0x52ea9c,_0x3a6404,_0x52ea9c[_0x43e7('0x5d')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x549f4e){_0x4438c0=_0x549f4e;logger['info'](_0x43e7('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4438c0['id']);var _0x1b793d=util[_0x43e7('0x1c')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x8b50bb[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x4438c0['id'],'x')[0x1]);logger[_0x43e7('0x14')](_0x43e7('0x5f'),_0x43e7('0x54'));emit(util[_0x43e7('0x1c')](_0x43e7('0x60'),_0x5a50fc['name']),_0x43e7('0x55'),{'uri':_0x1b793d});})[_0x43e7('0x26')](function(_0x4e5956){logger[_0x43e7('0x25')]('[OUTBOUND]',JSON[_0x43e7('0x20')](_0x4e5956));});};exports[_0x43e7('0x61')]=function(_0x37301b,_0x1ca24b,_0x506361,_0x2d25b5,_0x2646c2,_0xf929a5){var _0x556001,_0x17889c,_0x38fa5b,_0x219dc6;_0xf929a5[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0xf929a5['remoteUri']);_0xf929a5[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0xf929a5[_0x43e7('0x4b')]);if(_0x2646c2&&_0x2646c2[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x62'),_0x43e7('0x49'));_0x1ca24b['recordingURL']=util['format'](_0x43e7('0x4a'),_0xf929a5['serverUrl'],_0x1ca24b['uniqueid'],md5(_0x1ca24b['uniqueid']));}else{_0x1ca24b[_0x43e7('0x4d')]='';}return getConnection(_0xf929a5)[_0x43e7('0x21')](function(_0x230fda){_0x219dc6=_0x230fda;return getUser(_0xf929a5,'',_0x219dc6);})[_0x43e7('0x21')](function(_0x18713b){_0x556001=_0x18713b;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x556001['id']);return getEndUser(_0xf929a5,_0x1ca24b[_0x43e7('0x4f')],_0x1ca24b[_0x43e7('0x50')],_0x219dc6);})[_0x43e7('0x21')](function(_0x5b4c76){_0x17889c=_0x5b4c76;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x17889c['id']);return createTicket(_0xf929a5,_0x556001,_0x17889c,_0x506361,_0x1ca24b,_0x506361[_0x43e7('0x5d')],_0x219dc6);})[_0x43e7('0x21')](function(_0x1afea6){_0x38fa5b=_0x1afea6;logger[_0x43e7('0x14')](_0x43e7('0x5e'));logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x38fa5b['id']);})['catch'](function(_0x55990c){logger[_0x43e7('0x25')](_0x43e7('0x62'),JSON['stringify'](_0x55990c));});}; \ No newline at end of file +var _0x008c=['util','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','merge','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','length','Agent\x20found!','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','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;','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Contacts','Enduser\x20created.','lastname','phone','getEndUser','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','lodash','request-promise','bluebird','md5'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x008c,0x188));var _0xc008=function(_0x45cbcf,_0xfbdbc2){_0x45cbcf=_0x45cbcf-0x0;var _0x52ece8=_0x008c[_0x45cbcf];return _0x52ece8;};'use strict';var _=require(_0xc008('0x0'));var rp=require(_0xc008('0x1'));var BPromise=require(_0xc008('0x2'));var md5=require(_0xc008('0x3'));var util=require(_0xc008('0x4'));var Redis=require('ioredis');var intUtil=require(_0xc008('0x5'));var config=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));config[_0xc008('0x9')]=_[_0xc008('0xa')](config[_0xc008('0x9')],{'host':_0xc008('0xb'),'port':0x18eb});var io=require(_0xc008('0xc'))(new Redis(config['redis']));function emit(_0x428fa9,_0x5aa09b,_0x30be38){io['to'](_0x428fa9)['emit'](_0x5aa09b,_0x30be38);}function getCustomFields(_0x52041f,_0x27830d){var _0x7231b4={};if(_0x52041f['length']>0x0){_['forEach'](_0x52041f,function(_0x543eb8){if(_0x543eb8[_0xc008('0xd')]===_0xc008('0xe')&&_0x543eb8['idField']){_0x7231b4[_0x543eb8[_0xc008('0xf')]]=_0x543eb8[_0xc008('0x10')][_0xc008('0x11')]();}else if(_0x543eb8[_0xc008('0xd')]===_0xc008('0x12')&&_0x543eb8[_0xc008('0x13')]&&_0x543eb8[_0xc008('0xf')]&&_0x27830d[_0x543eb8['variableName']]){_0x7231b4[_0x543eb8['idField']]=_0x27830d[_0x543eb8[_0xc008('0x13')]]['toString']();}else if(_0x543eb8[_0xc008('0xd')]===_0xc008('0x14')&&_0x543eb8[_0xc008('0x15')]&&_0x543eb8[_0xc008('0x15')][_0xc008('0x16')]&&_0x543eb8['idField']&&_0x27830d[_0x543eb8['Variable']['name'][_0xc008('0x17')]()]){_0x7231b4[_0x543eb8[_0xc008('0xf')]]=_0x27830d[_0x543eb8[_0xc008('0x15')][_0xc008('0x16')]['toLowerCase']()]['toString']();}});}return _0x7231b4;}function createTicket(_0x540e45,_0x5c2668,_0x46042b,_0x462af5,_0x501137,_0x813397,_0x5906e6){logger['info']('Creating\x20new\x20ticket...');var _0x50261c=_[_0xc008('0x18')]({'parent_id':'','assigned_user_id':_0x5c2668['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil['getString'](_0x462af5['Subjects'],_0x501137,'\x20'),'description':intUtil['getString'](_0x462af5[_0xc008('0x19')],_0x501137,'\x0a'),'contact_id':_0x46042b['id']},getCustomFields(_0x813397,_0x501137));var _0x4777a6={'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x540e45[_0xc008('0x1d')]),'form':{'operation':'create','username':_0x540e45[_0xc008('0x1e')],'sessionName':_0x5906e6['sessionName'],'elementType':'HelpDesk','element':JSON[_0xc008('0x1f')](_0x50261c)},'json':!![]};return request(_0x4777a6)[_0xc008('0x20')](function(_0x2e3cfb){if(_0x2e3cfb[_0xc008('0x21')]){return BPromise['resolve']({'id':_0x2e3cfb['result']['id']});}else{throw new Error(util['format'](_0xc008('0x22'),JSON[_0xc008('0x1f')](_0x2e3cfb[_0xc008('0x23')])));}})[_0xc008('0x24')](function(_0x5bebd9){var _0x5e2aca=_0x5bebd9['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xc008('0x25'),_0x5e2aca,JSON[_0xc008('0x1f')](_0x5bebd9));});}function getUser(_0x25eae4,_0x529961,_0x24c14c){if(intUtil[_0xc008('0x26')](_0x529961)){logger[_0xc008('0x27')](_0xc008('0x28'),_0x529961);return request({'method':'GET','uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x25eae4['remoteUri']),'qs':{'operation':'query','username':_0x25eae4['username'],'sessionName':_0x24c14c[_0xc008('0x29')],'query':util[_0xc008('0x1b')](_0xc008('0x2a'),_0x529961)},'json':!![]})[_0xc008('0x20')](function(_0x1de04b){if(_0x1de04b[_0xc008('0x21')]&&_0x1de04b[_0xc008('0x2b')][_0xc008('0x2c')]){logger[_0xc008('0x27')](_0xc008('0x2d'));return BPromise[_0xc008('0x2e')]({'id':_0x1de04b[_0xc008('0x2b')][0x0]['id'],'email':_0x1de04b['result'][0x0][_0xc008('0x2f')],'name':_0x1de04b[_0xc008('0x2b')][0x0]['first_name']+'\x20'+_0x1de04b[_0xc008('0x2b')][_0xc008('0x30')]});}else{logger[_0xc008('0x27')](_0xc008('0x31'));return BPromise[_0xc008('0x2e')]({'id':_0x24c14c[_0xc008('0x32')],'email':_0x25eae4[_0xc008('0x1e')],'name':_0xc008('0x33')});}})[_0xc008('0x24')](function(_0x4f14d2){var _0x415b87=_0x4f14d2[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')](_0xc008('0x35'),_0xc008('0x36'),_0x415b87,JSON[_0xc008('0x1f')](_0x4f14d2));});}else{logger[_0xc008('0x27')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc008('0x2e')]({'id':_0x24c14c[_0xc008('0x32')],'email':_0x25eae4['username'],'name':_0xc008('0x33')})[_0xc008('0x24')](function(_0x5e38d5){var _0x263473=_0x5e38d5[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x263473,JSON['stringify'](_0x5e38d5));});}}function getEndUser(_0x234f2a,_0x518024,_0x3dd0ac,_0x3884dd){logger[_0xc008('0x27')](_0xc008('0x37'),_0x3dd0ac);return request({'method':_0xc008('0x38'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x234f2a[_0xc008('0x1d')]),'qs':{'operation':_0xc008('0x39'),'username':_0x234f2a[_0xc008('0x1e')],'sessionName':_0x3884dd[_0xc008('0x29')],'query':util[_0xc008('0x1b')](_0xc008('0x3a'),_0x3dd0ac,_0x3dd0ac,_0x3dd0ac,_0x3dd0ac,_0x3dd0ac)},'json':!![]})[_0xc008('0x20')](function(_0x4cace5){if(_0x4cace5[_0xc008('0x21')]&&_0x4cace5[_0xc008('0x2b')][_0xc008('0x2c')]){logger[_0xc008('0x27')]('Enduser\x20found!');return BPromise[_0xc008('0x2e')]({'id':_0x4cace5[_0xc008('0x2b')][0x0]['id'],'name':_0x4cace5[_0xc008('0x2b')][0x0][_0xc008('0x3b')]+'\x20'+_0x4cace5[_0xc008('0x2b')][0x0]['lastname'],'phone':_0x3dd0ac});}else{logger[_0xc008('0x27')](_0xc008('0x3c'));return request({'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')](_0xc008('0x1c'),_0x234f2a['remoteUri']),'form':{'operation':_0xc008('0x3d'),'sessionName':_0x3884dd[_0xc008('0x29')],'elementType':_0xc008('0x3e'),'element':JSON[_0xc008('0x1f')]({'lastname':_0x518024,'phone':_0x3dd0ac,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x26cd05){logger[_0xc008('0x27')](_0xc008('0x3f'));return BPromise['resolve']({'id':_0x26cd05[_0xc008('0x2b')]['id'],'name':_0x26cd05['result'][_0xc008('0x40')],'phone':_0x26cd05['result'][_0xc008('0x41')]});})[_0xc008('0x24')](function(_0x5a5d85){var _0x31007c=_0x5a5d85[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xc008('0x42'),_0x31007c,JSON[_0xc008('0x1f')](_0x5a5d85));});}});}function getConnection(_0x200469){var _0x44fc5d=_0x200469[_0xc008('0x1e')];var _0x372305=_0x200469['accessKey'];return request({'method':'GET','uri':util['format'](_0xc008('0x1c'),_0x200469[_0xc008('0x1d')]),'qs':{'operation':_0xc008('0x43'),'username':_0x44fc5d},'json':!![]})[_0xc008('0x20')](function(_0x25289f){if(_0x25289f[_0xc008('0x21')]){return request({'method':_0xc008('0x1a'),'uri':util[_0xc008('0x1b')]('%s/webservice.php',_0x200469['remoteUri']),'form':{'operation':'login','username':_0x44fc5d,'accessKey':md5(_0x25289f[_0xc008('0x2b')][_0xc008('0x44')]+_0x372305)},'json':!![]});}})[_0xc008('0x20')](function(_0x511383){if(_0x511383[_0xc008('0x21')]){return BPromise[_0xc008('0x2e')](_0x511383[_0xc008('0x2b')]);}else{throw new Error(util[_0xc008('0x1b')](_0xc008('0x45'),_0x200469['id']));}})[_0xc008('0x24')](function(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x34')]||0x1f4;logger[_0xc008('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x405e87,JSON[_0xc008('0x1f')](_0x17ec90));});}function request(_0x51cb14){logger[_0xc008('0x27')](_0xc008('0x46'),JSON[_0xc008('0x1f')](_0x51cb14));return rp(_0x51cb14);}exports['queue']=function(_0x144ab2,_0x32b435,_0xee64,_0x8b9775,_0x750cc9,_0x51105f){var _0x3a7b3b,_0x27b022,_0x4b4c6d,_0x24f775;_0x51105f[_0xc008('0x1d')]=intUtil['stripTrailingSlash'](_0x51105f['remoteUri']);if(_0x750cc9&&_0x750cc9[_0xc008('0x47')]){logger[_0xc008('0x27')](_0xc008('0x48'),_0xc008('0x49'));_0x32b435[_0xc008('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51105f[_0xc008('0x4b')],_0x32b435['uniqueid'],md5(_0x32b435[_0xc008('0x4c')]));}else{_0x32b435[_0xc008('0x4a')]='';}return getConnection(_0x51105f)[_0xc008('0x20')](function(_0x2f1105){_0x24f775=_0x2f1105;return getUser(_0x51105f,_0x8b9775[_0xc008('0x4d')],_0x24f775);})[_0xc008('0x20')](function(_0x49d8b0){_0x3a7b3b=_0x49d8b0;logger[_0xc008('0x27')](_0xc008('0x4e'),_0x3a7b3b['id']);return getEndUser(_0x51105f,_0x32b435[_0xc008('0x4f')],_0x32b435[_0xc008('0x50')],_0x24f775);})[_0xc008('0x20')](function(_0x5aa385){_0x27b022=_0x5aa385;logger[_0xc008('0x27')]('The\x20Enduser\x20ID\x20is:',_0x27b022['id']);return createTicket(_0x51105f,_0x3a7b3b,_0x27b022,_0xee64,_0x32b435,_0xee64['Fields'],_0x24f775);})['then'](function(_0x89bb20){_0x4b4c6d=_0x89bb20;logger[_0xc008('0x27')](_0xc008('0x51'));logger['info'](_0xc008('0x52'),_0x4b4c6d['id']);var _0x2d8361=util[_0xc008('0x1b')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x51105f[_0xc008('0x1d')],_[_0xc008('0x53')](_0x4b4c6d['id'],'x')[0x1]);logger[_0xc008('0x27')](_0xc008('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc008('0x1b')]('user:%s',_0x8b9775[_0xc008('0x16')]),_0xc008('0x54'),{'uri':_0x2d8361});})[_0xc008('0x24')](function(_0x943c91){logger[_0xc008('0x23')](_0xc008('0x48'),JSON['stringify'](_0x943c91));});};exports[_0xc008('0x55')]=function(_0x570001,_0x5bf4a9,_0x37ce5e,_0x30aa1e,_0x56e755,_0xb1befa,_0xb8ba7){var _0x3e373e,_0x4517c0,_0x21ee6d,_0x31a339;_0xb1befa[_0xc008('0x1d')]=intUtil['stripTrailingSlash'](_0xb1befa[_0xc008('0x1d')]);_0xb1befa[_0xc008('0x4b')]=intUtil[_0xc008('0x56')](_0xb1befa[_0xc008('0x4b')]);if(_0xb8ba7&&_0xb8ba7[_0xc008('0x57')]&&_0xb8ba7[_0xc008('0x57')]!==_0xc008('0x58')){logger[_0xc008('0x27')](_0xc008('0x59'),_0xc008('0x49'));_0x5bf4a9[_0xc008('0x4a')]=util[_0xc008('0x1b')](_0xc008('0x5a'),_0xb1befa[_0xc008('0x4b')],_0x5bf4a9['uniqueid'],md5(_0x5bf4a9[_0xc008('0x4c')]));}return getConnection(_0xb1befa)[_0xc008('0x20')](function(_0x3d3a7e){_0x31a339=_0x3d3a7e;return getUser(_0xb1befa,_0x30aa1e['email'],_0x31a339);})[_0xc008('0x20')](function(_0x3214df){_0x3e373e=_0x3214df;logger['info']('The\x20User\x20ID\x20is:',_0x3e373e['id']);return getEndUser(_0xb1befa,_0x5bf4a9[_0xc008('0x5b')],_0x5bf4a9[_0xc008('0x5c')],_0x31a339);})[_0xc008('0x20')](function(_0x39083c){_0x4517c0=_0x39083c;logger[_0xc008('0x27')](_0xc008('0x5d'),_0x4517c0['id']);return createTicket(_0xb1befa,_0x3e373e,_0x4517c0,_0x37ce5e,_0x5bf4a9,_0x37ce5e[_0xc008('0x5e')],_0x31a339);})[_0xc008('0x20')](function(_0x39e219){_0x21ee6d=_0x39e219;logger[_0xc008('0x27')](_0xc008('0x51'));logger['info'](_0xc008('0x52'),_0x21ee6d['id']);var _0x25a52b=util[_0xc008('0x1b')](_0xc008('0x5f'),_0xb1befa['remoteUri'],_[_0xc008('0x53')](_0x21ee6d['id'],'x')[0x1]);logger['info'](_0xc008('0x59'),_0xc008('0x60'));emit(util[_0xc008('0x1b')]('user:%s',_0x30aa1e[_0xc008('0x16')]),_0xc008('0x54'),{'uri':_0x25a52b});})[_0xc008('0x24')](function(_0x553f5c){logger[_0xc008('0x23')]('[OUTBOUND]',JSON[_0xc008('0x1f')](_0x553f5c));});};exports[_0xc008('0x61')]=function(_0x23012c,_0x6fe732,_0x295ec7,_0x4ca4a6,_0x3c30db,_0x3f2342){var _0x49493b,_0x3efb77,_0x5233bb,_0x278cbe;_0x3f2342['remoteUri']=intUtil[_0xc008('0x56')](_0x3f2342['remoteUri']);_0x3f2342[_0xc008('0x4b')]=intUtil[_0xc008('0x56')](_0x3f2342[_0xc008('0x4b')]);if(_0x3c30db&&_0x3c30db[_0xc008('0x47')]){logger['info'](_0xc008('0x62'),_0xc008('0x49'));_0x6fe732[_0xc008('0x4a')]=util[_0xc008('0x1b')](_0xc008('0x5a'),_0x3f2342[_0xc008('0x4b')],_0x6fe732[_0xc008('0x4c')],md5(_0x6fe732[_0xc008('0x4c')]));}else{_0x6fe732['recordingURL']='';}return getConnection(_0x3f2342)[_0xc008('0x20')](function(_0x530c2f){_0x278cbe=_0x530c2f;return getUser(_0x3f2342,'',_0x278cbe);})['then'](function(_0x4c84da){_0x49493b=_0x4c84da;logger[_0xc008('0x27')](_0xc008('0x4e'),_0x49493b['id']);return getEndUser(_0x3f2342,_0x6fe732[_0xc008('0x4f')],_0x6fe732[_0xc008('0x50')],_0x278cbe);})[_0xc008('0x20')](function(_0x2e9646){_0x3efb77=_0x2e9646;logger[_0xc008('0x27')](_0xc008('0x5d'),_0x3efb77['id']);return createTicket(_0x3f2342,_0x49493b,_0x3efb77,_0x295ec7,_0x6fe732,_0x295ec7[_0xc008('0x5e')],_0x278cbe);})['then'](function(_0x38b603){_0x5233bb=_0x38b603;logger[_0xc008('0x27')](_0xc008('0x51'));logger[_0xc008('0x27')](_0xc008('0x52'),_0x5233bb['id']);})[_0xc008('0x24')](function(_0x23d4ff){logger[_0xc008('0x23')](_0xc008('0x62'),JSON[_0xc008('0x1f')](_0x23d4ff));});}; \ 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 a79bfe8..0c7edfc 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 _0x67a2=['ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util'];(function(_0x4c7bb5,_0x609510){var _0x1daf5c=function(_0x3511ce){while(--_0x3511ce){_0x4c7bb5['push'](_0x4c7bb5['shift']());}};_0x1daf5c(++_0x609510);}(_0x67a2,0xd3));var _0x267a=function(_0x31414a,_0x495287){_0x31414a=_0x31414a-0x0;var _0x20baa9=_0x67a2[_0x31414a];return _0x20baa9;};'use strict';var _=require(_0x267a('0x0'));var rp=require(_0x267a('0x1'));var md5=require('md5');var util=require(_0x267a('0x2'));var Redis=require(_0x267a('0x3'));var intUtil=require(_0x267a('0x4'));var config=require(_0x267a('0x5'));var logger=require(_0x267a('0x6'))(_0x267a('0x7'));config[_0x267a('0x8')]=_['defaults'](config['redis'],{'host':_0x267a('0x9'),'port':0x18eb});var io=require(_0x267a('0xa'))(new Redis(config[_0x267a('0x8')]));function emit(_0x4aac51,_0x1ac13e,_0x4f1728){io['to'](_0x4aac51)[_0x267a('0xb')](_0x1ac13e,_0x4f1728);}var headers={'Content-Type':_0x267a('0xc'),'Accept':_0x267a('0xc')};function getTicket(_0x95a54e,_0x207db5,_0x42e210,_0xaaf056,_0x52bb27){logger[_0x267a('0xd')](_0x267a('0xe'));return request({'uri':util[_0x267a('0xf')](_0x267a('0x10'),_0x95a54e[_0x267a('0x11')]),'method':_0x267a('0x12'),'body':{'ticket':_[_0x267a('0x13')]({'requester_id':_0x42e210['id'],'submitter_id':_0x207db5?_0x207db5['id']:undefined,'assignee_id':_0x207db5?_0x207db5['id']:undefined,'tags':getTags(_0xaaf056[_0x267a('0x14')],_0x267a('0x15')),'subject':intUtil[_0x267a('0x16')](_0xaaf056[_0x267a('0x17')],_0x52bb27,'\x20'),'description':intUtil['getString'](_0xaaf056[_0x267a('0x18')],_0x52bb27,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xaaf056[_0x267a('0x18')],_0x52bb27,'\x0a')}},getCustomFields(_0xaaf056[_0x267a('0x19')],_0x52bb27))}})[_0x267a('0x1a')](function(_0x512c13){logger['info'](_0x267a('0x1b'));return _0x512c13[_0x267a('0x1c')];});}function getUser(_0x2dfcb1,_0x5d1a05){if(intUtil[_0x267a('0x1d')](_0x5d1a05)){logger[_0x267a('0xd')](_0x267a('0x1e'),_0x5d1a05);return request({'uri':util[_0x267a('0xf')](_0x267a('0x1f'),_0x2dfcb1['remoteUri']),'qs':{'query':util[_0x267a('0xf')]('type:user\x20role:agent\x20email:%s',_0x5d1a05)}})[_0x267a('0x1a')](function(_0x289cb1){if(_0x289cb1['count']){logger[_0x267a('0xd')]('Agent\x20found!');return _[_0x267a('0x20')](_0x289cb1[_0x267a('0x21')],{'email':_0x5d1a05,'role':_0x267a('0x22')});}else{logger['info'](_0x267a('0x23'));return request({'uri':util[_0x267a('0xf')](_0x267a('0x24'),_0x2dfcb1[_0x267a('0x11')])})['then'](function(_0xd26837){logger[_0x267a('0xd')](_0x267a('0x25'));return _0xd26837[_0x267a('0x26')];});}});}else{logger[_0x267a('0xd')](_0x267a('0x23'));return request({'uri':util[_0x267a('0xf')](_0x267a('0x24'),_0x2dfcb1['remoteUri'])})[_0x267a('0x1a')](function(_0x1b508b){logger[_0x267a('0xd')]('Admin\x20account\x20selected.');return _0x1b508b[_0x267a('0x26')];});}}function getEndUser(_0x499923,_0x520051,_0x1cb987){logger[_0x267a('0xd')](_0x267a('0x27'),_0x1cb987);return request({'uri':util[_0x267a('0xf')](_0x267a('0x1f'),_0x499923[_0x267a('0x11')]),'qs':{'query':util[_0x267a('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x1cb987)}})[_0x267a('0x1a')](function(_0x44feba){var _0x441937;if(_0x44feba['results']['length']){_0x44feba[_0x267a('0x21')]=_['filter'](_0x44feba[_0x267a('0x21')],{'suspended':![],'role':_0x267a('0x28')});if(_0x44feba[_0x267a('0x21')][_0x267a('0x29')]){_0x441937=_[_0x267a('0x2a')](_0x44feba['results']);}}if(_0x441937){logger[_0x267a('0xd')]('Enduser\x20found!');return _0x441937;}else{logger[_0x267a('0xd')](_0x267a('0x2b'));return request({'uri':util[_0x267a('0xf')](_0x267a('0x2c'),_0x499923['remoteUri']),'method':'POST','body':{'user':{'role':_0x267a('0x28'),'name':util[_0x267a('0xf')](_0x267a('0x2d'),_0x520051||_0x1cb987),'phone':_0x1cb987}}})['then'](function(_0x58f297){logger[_0x267a('0xd')](_0x267a('0x2e'));return _0x58f297[_0x267a('0x26')];});}});}function getAuth(_0x2b8b30){var _0x441f08;if(_0x2b8b30[_0x267a('0x2f')]==='password'){_0x441f08=util[_0x267a('0xf')]('%s:%s',_0x2b8b30[_0x267a('0x30')],_0x2b8b30['password']);}else if(_0x2b8b30[_0x267a('0x2f')]===_0x267a('0x31')){_0x441f08=util[_0x267a('0xf')](_0x267a('0x32'),_0x2b8b30[_0x267a('0x30')],_0x2b8b30[_0x267a('0x31')]);}return util[_0x267a('0xf')](_0x267a('0x33'),new Buffer(_0x441f08)[_0x267a('0x34')]('base64'));}function request(_0x2c8e56){logger[_0x267a('0x35')](_0x267a('0x36'),JSON[_0x267a('0x37')](_0x2c8e56));return rp(_['defaults'](_0x2c8e56,{'method':_0x267a('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x382245,_0x5d5302){var _0x2a9fa1=[];if(_0x382245&&_0x382245['length']>0x0){_0x2a9fa1=_[_0x267a('0x39')](_0x382245,_0x5d5302);}return _0x2a9fa1;}function getCustomFields(_0x322e97,_0x52f65c){var _0x3a39ad=[];var _0x5ec7c7={'custom_fields':[]};if(_0x322e97[_0x267a('0x29')]>0x0){_[_0x267a('0x3a')](_0x322e97,function(_0x542d70){if(_0x542d70[_0x267a('0x3b')]===_0x267a('0x3c')&&_0x542d70[_0x267a('0x3d')]&&!_0x542d70[_0x267a('0x3e')]){_0x5ec7c7[_0x542d70[_0x267a('0x3d')][_0x267a('0x3f')]()]=_0x542d70['content'][_0x267a('0x34')]();}else if(_0x542d70[_0x267a('0x3b')]===_0x267a('0x3c')&&_0x542d70[_0x267a('0x40')]&&_0x542d70[_0x267a('0x3e')]){_0x5ec7c7[_0x267a('0x41')][_0x267a('0x42')]({'id':_0x542d70[_0x267a('0x40')],'value':_0x542d70['content'][_0x267a('0x34')]()});}else if(_0x542d70['type']===_0x267a('0x43')&&_0x542d70['variableName']&&_0x542d70[_0x267a('0x40')]&&_0x542d70[_0x267a('0x3e')]){_0x52f65c[_0x542d70[_0x267a('0x44')]]&&_0x5ec7c7[_0x267a('0x41')][_0x267a('0x42')]({'id':_0x542d70[_0x267a('0x40')],'value':_0x52f65c[_0x542d70[_0x267a('0x44')]][_0x267a('0x34')]()});}else if(_0x542d70[_0x267a('0x3b')]===_0x267a('0x45')&&_0x542d70[_0x267a('0x46')]&&_0x542d70[_0x267a('0x46')][_0x267a('0x15')]&&_0x542d70[_0x267a('0x40')]&&_0x542d70[_0x267a('0x3e')]){_0x52f65c[_0x542d70['Variable'][_0x267a('0x15')][_0x267a('0x3f')]()]&&_0x5ec7c7[_0x267a('0x41')][_0x267a('0x42')]({'id':_0x542d70[_0x267a('0x40')],'value':_0x52f65c[_0x542d70[_0x267a('0x46')]['name'][_0x267a('0x3f')]()]['toString']()});}});}return _0x5ec7c7;}exports[_0x267a('0x47')]=function(_0x5a0a91,_0x299d8a,_0x46fcd7,_0x51cd64,_0x234c90,_0x13a14f){var _0x4c55ba,_0x16e9db;_0x13a14f[_0x267a('0x11')]=intUtil[_0x267a('0x48')](_0x13a14f[_0x267a('0x11')]);_0x13a14f[_0x267a('0x49')]=intUtil[_0x267a('0x48')](_0x13a14f[_0x267a('0x49')]);if(_0x234c90&&_0x234c90[_0x267a('0x4a')]){logger[_0x267a('0xd')](_0x267a('0x4b'),'Recording\x20is\x20enabled!');_0x299d8a['recordingURL']=util[_0x267a('0xf')](_0x267a('0x4c'),_0x13a14f[_0x267a('0x49')],_0x299d8a[_0x267a('0x4d')],md5(_0x299d8a[_0x267a('0x4d')]));}else{_0x299d8a['recordingURL']='';}headers[_0x267a('0x4e')]=getAuth(_0x13a14f);return getUser(_0x13a14f,_0x51cd64['email'])[_0x267a('0x1a')](function(_0x18ccfc){_0x4c55ba=_0x18ccfc;logger[_0x267a('0xd')](_0x267a('0x4f'),_0x4c55ba['id']);return getEndUser(_0x13a14f,_0x299d8a[_0x267a('0x50')],_0x299d8a[_0x267a('0x51')]);})[_0x267a('0x1a')](function(_0x3f9395){_0x16e9db=_0x3f9395;logger[_0x267a('0xd')]('The\x20Enduser\x20ID\x20is:',_0x16e9db['id']);return getTicket(_0x13a14f,_0x4c55ba,_0x16e9db,_0x46fcd7,_0x299d8a);})[_0x267a('0x1a')](function(_0x16bdce){if(_0x16bdce){logger[_0x267a('0xd')](_0x267a('0x52'),_0x16bdce['id']);switch(_0x13a14f['type']){case _0x267a('0x53'):logger['info'](_0x267a('0x4b'),_0x267a('0x54'));return request({'uri':util[_0x267a('0xf')](_0x267a('0x55'),_0x13a14f[_0x267a('0x11')],_0x4c55ba['id'],_0x16bdce['id']),'method':_0x267a('0x12')});case _0x267a('0x56'):logger[_0x267a('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x267a('0xf')](_0x267a('0x57'),_0x51cd64[_0x267a('0x15')]),_0x267a('0x58'),{'uri':util[_0x267a('0xf')](_0x267a('0x59'),_0x13a14f[_0x267a('0x11')],_0x16bdce['id'])});break;default:logger[_0x267a('0x5a')](_0x267a('0x4b'),_0x267a('0x5b'));}}})['catch'](function(_0x8429f4){logger[_0x267a('0x5a')](_0x267a('0x5c'),util[_0x267a('0x5d')](_0x8429f4,{'showHidden':!![],'depth':null}));});};exports[_0x267a('0x5e')]=function(_0x4bf890,_0x16bed0,_0x419c19,_0x4e882a,_0x3b3e9a,_0x2f8eeb,_0x1dde10){var _0x5592e4,_0x9f1ed2;_0x2f8eeb[_0x267a('0x11')]=intUtil[_0x267a('0x48')](_0x2f8eeb[_0x267a('0x11')]);_0x2f8eeb[_0x267a('0x49')]=intUtil['stripTrailingSlash'](_0x2f8eeb['serverUrl']);if(_0x1dde10&&_0x1dde10[_0x267a('0x5f')]&&_0x1dde10[_0x267a('0x5f')]!==_0x267a('0x60')){logger[_0x267a('0xd')](_0x267a('0x61'),_0x267a('0x62'));_0x16bed0[_0x267a('0x63')]=util[_0x267a('0xf')](_0x267a('0x4c'),_0x2f8eeb[_0x267a('0x49')],_0x16bed0[_0x267a('0x4d')],md5(_0x16bed0[_0x267a('0x4d')]));}headers[_0x267a('0x4e')]=getAuth(_0x2f8eeb);return getUser(_0x2f8eeb,_0x4e882a['email'])['then'](function(_0x2bad0a){_0x5592e4=_0x2bad0a;logger[_0x267a('0xd')](_0x267a('0x4f'),_0x5592e4['id']);return getEndUser(_0x2f8eeb,_0x16bed0[_0x267a('0x64')],_0x16bed0['destcalleridnum']);})[_0x267a('0x1a')](function(_0x38c198){_0x9f1ed2=_0x38c198;logger[_0x267a('0xd')](_0x267a('0x65'),_0x9f1ed2['id']);return getTicket(_0x2f8eeb,_0x5592e4,_0x9f1ed2,_0x419c19,_0x16bed0);})[_0x267a('0x1a')](function(_0x19aebe){if(_0x19aebe){logger[_0x267a('0xd')](_0x267a('0x52'),_0x19aebe['id']);switch(_0x2f8eeb[_0x267a('0x3b')]){case _0x267a('0x53'):logger[_0x267a('0xd')](_0x267a('0x61'),_0x267a('0x54'));return request({'uri':util[_0x267a('0xf')](_0x267a('0x55'),_0x2f8eeb[_0x267a('0x11')],_0x5592e4['id'],_0x19aebe['id']),'method':_0x267a('0x12')});case _0x267a('0x56'):logger[_0x267a('0xd')](_0x267a('0x61'),_0x267a('0x66'));emit(util[_0x267a('0xf')]('user:%s',_0x4e882a[_0x267a('0x15')]),_0x267a('0x58'),{'uri':util[_0x267a('0xf')]('%s/agent/tickets/%s',_0x2f8eeb[_0x267a('0x11')],_0x19aebe['id'])});break;default:logger[_0x267a('0x5a')](_0x267a('0x61'),_0x267a('0x5b'));}}})[_0x267a('0x67')](function(_0x50d3b0){logger['error'](_0x267a('0x68'),util[_0x267a('0x5d')](_0x50d3b0,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x333e90,_0x23e9ca,_0x5684e6,_0x5eff40,_0xf7f504,_0x5b9d46){var _0xbe801b,_0x3e4f22;_0x5b9d46[_0x267a('0x11')]=intUtil[_0x267a('0x48')](_0x5b9d46['remoteUri']);_0x5b9d46[_0x267a('0x49')]=intUtil['stripTrailingSlash'](_0x5b9d46[_0x267a('0x49')]);if(_0xf7f504&&_0xf7f504[_0x267a('0x4a')]){logger['info'](_0x267a('0x69'),'Recording\x20is\x20enabled!');_0x23e9ca[_0x267a('0x63')]=util[_0x267a('0xf')](_0x267a('0x4c'),_0x5b9d46[_0x267a('0x49')],_0x23e9ca[_0x267a('0x4d')],md5(_0x23e9ca['uniqueid']));}else{_0x23e9ca['recordingURL']='';}headers[_0x267a('0x4e')]=getAuth(_0x5b9d46);return getUser(_0x5b9d46)['then'](function(_0x5ca9bd){_0xbe801b=_0x5ca9bd;logger[_0x267a('0xd')](_0x267a('0x4f'),_0xbe801b['id']);return getEndUser(_0x5b9d46,_0x23e9ca[_0x267a('0x50')],_0x23e9ca['calleridnum']);})[_0x267a('0x1a')](function(_0x536b82){_0x3e4f22=_0x536b82;logger[_0x267a('0xd')](_0x267a('0x65'),_0x3e4f22['id']);return getTicket(_0x5b9d46,_0xbe801b,_0x3e4f22,_0x5684e6,_0x23e9ca);})['then'](function(_0x4f5bec){if(_0x4f5bec){logger[_0x267a('0xd')](_0x267a('0x52'),_0x4f5bec['id']);}})[_0x267a('0x67')](function(_0x25dd92){logger['error'](_0x267a('0x6a'),util[_0x267a('0x5d')](_0x25dd92,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc997=['defaults','localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','GET','map','type','nameField','toLowerCase','content','string','custom_fields','push','variable','variableName','idField','customField','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','monitor_format','[ABANDONED]','The\x20Ticket\x20ID\x20is:','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis'];(function(_0xaa84b9,_0x154a66){var _0x3a6a50=function(_0x16142b){while(--_0x16142b){_0xaa84b9['push'](_0xaa84b9['shift']());}};_0x3a6a50(++_0x154a66);}(_0xc997,0x1ac));var _0x7c99=function(_0x3fc16a,_0xa05b6a){_0x3fc16a=_0x3fc16a-0x0;var _0x2b1530=_0xc997[_0x3fc16a];return _0x2b1530;};'use strict';var _=require('lodash');var rp=require(_0x7c99('0x0'));var md5=require(_0x7c99('0x1'));var util=require(_0x7c99('0x2'));var Redis=require(_0x7c99('0x3'));var intUtil=require(_0x7c99('0x4'));var config=require('../../../../config/environment');var logger=require(_0x7c99('0x5'))(_0x7c99('0x6'));config[_0x7c99('0x7')]=_[_0x7c99('0x8')](config[_0x7c99('0x7')],{'host':_0x7c99('0x9'),'port':0x18eb});var io=require(_0x7c99('0xa'))(new Redis(config[_0x7c99('0x7')]));function emit(_0x56bf58,_0x6d672,_0x33fd86){io['to'](_0x56bf58)[_0x7c99('0xb')](_0x6d672,_0x33fd86);}var headers={'Content-Type':'application/json','Accept':_0x7c99('0xc')};function getTicket(_0x9f6f7c,_0x53f059,_0x8d9e39,_0x5381b5,_0x3b53d8){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x7c99('0xd')](_0x7c99('0xe'),_0x9f6f7c[_0x7c99('0xf')]),'method':_0x7c99('0x10'),'body':{'ticket':_[_0x7c99('0x11')]({'requester_id':_0x8d9e39['id'],'submitter_id':_0x53f059?_0x53f059['id']:undefined,'assignee_id':_0x53f059?_0x53f059['id']:undefined,'tags':getTags(_0x5381b5[_0x7c99('0x12')],_0x7c99('0x13')),'subject':intUtil[_0x7c99('0x14')](_0x5381b5[_0x7c99('0x15')],_0x3b53d8,'\x20'),'description':intUtil[_0x7c99('0x14')](_0x5381b5[_0x7c99('0x16')],_0x3b53d8,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7c99('0x14')](_0x5381b5[_0x7c99('0x16')],_0x3b53d8,'\x0a')}},getCustomFields(_0x5381b5[_0x7c99('0x17')],_0x3b53d8))}})[_0x7c99('0x18')](function(_0x2758a4){logger[_0x7c99('0x19')](_0x7c99('0x1a'));return _0x2758a4[_0x7c99('0x1b')];});}function getUser(_0x43bcd7,_0x330aaf){if(intUtil['validateEmail'](_0x330aaf)){logger[_0x7c99('0x19')]('Getting\x20agent\x20with\x20email',_0x330aaf);return request({'uri':util['format'](_0x7c99('0x1c'),_0x43bcd7[_0x7c99('0xf')]),'qs':{'query':util[_0x7c99('0xd')](_0x7c99('0x1d'),_0x330aaf)}})[_0x7c99('0x18')](function(_0x246b67){if(_0x246b67[_0x7c99('0x1e')]){logger[_0x7c99('0x19')](_0x7c99('0x1f'));return _[_0x7c99('0x20')](_0x246b67['results'],{'email':_0x330aaf,'role':_0x7c99('0x21')});}else{logger[_0x7c99('0x19')](_0x7c99('0x22'));return request({'uri':util['format']('%s/users/me.json',_0x43bcd7['remoteUri'])})['then'](function(_0x598a89){logger[_0x7c99('0x19')](_0x7c99('0x23'));return _0x598a89['user'];});}});}else{logger[_0x7c99('0x19')](_0x7c99('0x22'));return request({'uri':util[_0x7c99('0xd')](_0x7c99('0x24'),_0x43bcd7['remoteUri'])})[_0x7c99('0x18')](function(_0x3d2c44){logger[_0x7c99('0x19')](_0x7c99('0x23'));return _0x3d2c44[_0x7c99('0x25')];});}}function getEndUser(_0x290e68,_0x20dc08,_0xbd1712){logger[_0x7c99('0x19')](_0x7c99('0x26'),_0xbd1712);return request({'uri':util[_0x7c99('0xd')](_0x7c99('0x1c'),_0x290e68['remoteUri']),'qs':{'query':util[_0x7c99('0xd')](_0x7c99('0x27'),_0xbd1712)}})['then'](function(_0x588208){var _0x1cf3cb;if(_0x588208[_0x7c99('0x28')][_0x7c99('0x29')]){_0x588208[_0x7c99('0x28')]=_[_0x7c99('0x2a')](_0x588208[_0x7c99('0x28')],{'suspended':![],'role':'end-user'});if(_0x588208['results']['length']){_0x1cf3cb=_[_0x7c99('0x2b')](_0x588208[_0x7c99('0x28')]);}}if(_0x1cf3cb){logger[_0x7c99('0x19')](_0x7c99('0x2c'));return _0x1cf3cb;}else{logger[_0x7c99('0x19')](_0x7c99('0x2d'));return request({'uri':util[_0x7c99('0xd')](_0x7c99('0x2e'),_0x290e68[_0x7c99('0xf')]),'method':_0x7c99('0x10'),'body':{'user':{'role':_0x7c99('0x2f'),'name':util[_0x7c99('0xd')](_0x7c99('0x30'),_0x20dc08||_0xbd1712),'phone':_0xbd1712}}})['then'](function(_0x2648b9){logger['info'](_0x7c99('0x31'));return _0x2648b9['user'];});}});}function getAuth(_0x411561){var _0x3cd43e;if(_0x411561['authType']===_0x7c99('0x32')){_0x3cd43e=util[_0x7c99('0xd')]('%s:%s',_0x411561[_0x7c99('0x33')],_0x411561[_0x7c99('0x32')]);}else if(_0x411561[_0x7c99('0x34')]===_0x7c99('0x35')){_0x3cd43e=util[_0x7c99('0xd')](_0x7c99('0x36'),_0x411561[_0x7c99('0x33')],_0x411561[_0x7c99('0x35')]);}return util[_0x7c99('0xd')](_0x7c99('0x37'),new Buffer(_0x3cd43e)[_0x7c99('0x38')](_0x7c99('0x39')));}function request(_0x18211e){logger['debug']('[HTTP]',JSON['stringify'](_0x18211e));return rp(_[_0x7c99('0x8')](_0x18211e,{'method':_0x7c99('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x295c40,_0x2e8468){var _0x1e6c9a=[];if(_0x295c40&&_0x295c40['length']>0x0){_0x1e6c9a=_[_0x7c99('0x3b')](_0x295c40,_0x2e8468);}return _0x1e6c9a;}function getCustomFields(_0x5cfdbb,_0x27d6d0){var _0x544dcb=[];var _0x121df8={'custom_fields':[]};if(_0x5cfdbb[_0x7c99('0x29')]>0x0){_['forEach'](_0x5cfdbb,function(_0x3598fc){if(_0x3598fc[_0x7c99('0x3c')]==='string'&&_0x3598fc[_0x7c99('0x3d')]&&!_0x3598fc['customField']){_0x121df8[_0x3598fc[_0x7c99('0x3d')][_0x7c99('0x3e')]()]=_0x3598fc[_0x7c99('0x3f')][_0x7c99('0x38')]();}else if(_0x3598fc[_0x7c99('0x3c')]===_0x7c99('0x40')&&_0x3598fc['idField']&&_0x3598fc['customField']){_0x121df8[_0x7c99('0x41')][_0x7c99('0x42')]({'id':_0x3598fc['idField'],'value':_0x3598fc[_0x7c99('0x3f')]['toString']()});}else if(_0x3598fc[_0x7c99('0x3c')]===_0x7c99('0x43')&&_0x3598fc[_0x7c99('0x44')]&&_0x3598fc[_0x7c99('0x45')]&&_0x3598fc[_0x7c99('0x46')]){_0x27d6d0[_0x3598fc[_0x7c99('0x44')]]&&_0x121df8[_0x7c99('0x41')][_0x7c99('0x42')]({'id':_0x3598fc[_0x7c99('0x45')],'value':_0x27d6d0[_0x3598fc[_0x7c99('0x44')]][_0x7c99('0x38')]()});}else if(_0x3598fc[_0x7c99('0x3c')]===_0x7c99('0x47')&&_0x3598fc[_0x7c99('0x48')]&&_0x3598fc[_0x7c99('0x48')]['name']&&_0x3598fc[_0x7c99('0x45')]&&_0x3598fc['customField']){_0x27d6d0[_0x3598fc[_0x7c99('0x48')][_0x7c99('0x13')][_0x7c99('0x3e')]()]&&_0x121df8['custom_fields'][_0x7c99('0x42')]({'id':_0x3598fc[_0x7c99('0x45')],'value':_0x27d6d0[_0x3598fc[_0x7c99('0x48')]['name'][_0x7c99('0x3e')]()][_0x7c99('0x38')]()});}});}return _0x121df8;}exports['queue']=function(_0xb78a7d,_0x90bd78,_0xb30b1f,_0x2df306,_0x517b26,_0x3432c7){var _0x537761,_0x34f14a;_0x3432c7['remoteUri']=intUtil[_0x7c99('0x49')](_0x3432c7['remoteUri']);_0x3432c7[_0x7c99('0x4a')]=intUtil[_0x7c99('0x49')](_0x3432c7[_0x7c99('0x4a')]);if(_0x517b26&&_0x517b26['monitor_format']){logger[_0x7c99('0x19')](_0x7c99('0x4b'),_0x7c99('0x4c'));_0x90bd78[_0x7c99('0x4d')]=util['format'](_0x7c99('0x4e'),_0x3432c7[_0x7c99('0x4a')],_0x90bd78[_0x7c99('0x4f')],md5(_0x90bd78[_0x7c99('0x4f')]));}else{_0x90bd78[_0x7c99('0x4d')]='';}headers[_0x7c99('0x50')]=getAuth(_0x3432c7);return getUser(_0x3432c7,_0x2df306[_0x7c99('0x51')])[_0x7c99('0x18')](function(_0xbb6b7c){_0x537761=_0xbb6b7c;logger[_0x7c99('0x19')](_0x7c99('0x52'),_0x537761['id']);return getEndUser(_0x3432c7,_0x90bd78[_0x7c99('0x53')],_0x90bd78['calleridnum']);})[_0x7c99('0x18')](function(_0x14e6b2){_0x34f14a=_0x14e6b2;logger['info'](_0x7c99('0x54'),_0x34f14a['id']);return getTicket(_0x3432c7,_0x537761,_0x34f14a,_0xb30b1f,_0x90bd78);})['then'](function(_0x534964){if(_0x534964){logger[_0x7c99('0x19')]('The\x20Ticket\x20ID\x20is:',_0x534964['id']);switch(_0x3432c7['type']){case _0x7c99('0x55'):logger[_0x7c99('0x19')](_0x7c99('0x4b'),_0x7c99('0x56'));return request({'uri':util[_0x7c99('0xd')](_0x7c99('0x57'),_0x3432c7['remoteUri'],_0x537761['id'],_0x534964['id']),'method':_0x7c99('0x10')});case _0x7c99('0x58'):logger[_0x7c99('0x19')](_0x7c99('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7c99('0xd')](_0x7c99('0x59'),_0x2df306[_0x7c99('0x13')]),'trigger:browser:url',{'uri':util[_0x7c99('0xd')](_0x7c99('0x5a'),_0x3432c7['remoteUri'],_0x534964['id'])});break;default:logger[_0x7c99('0x5b')](_0x7c99('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0xce0257){logger['error'](_0x7c99('0x5c'),util[_0x7c99('0x5d')](_0xce0257,{'showHidden':!![],'depth':null}));});};exports[_0x7c99('0x5e')]=function(_0x455f38,_0x1d3296,_0x55fa3d,_0xdeeb09,_0x2a7bb0,_0x3e5b30,_0x117426){var _0x44797a,_0x337e43;_0x3e5b30[_0x7c99('0xf')]=intUtil[_0x7c99('0x49')](_0x3e5b30[_0x7c99('0xf')]);_0x3e5b30['serverUrl']=intUtil[_0x7c99('0x49')](_0x3e5b30[_0x7c99('0x4a')]);if(_0x117426&&_0x117426['recordingFormat']&&_0x117426[_0x7c99('0x5f')]!==_0x7c99('0x60')){logger['info'](_0x7c99('0x61'),_0x7c99('0x4c'));_0x1d3296[_0x7c99('0x4d')]=util['format'](_0x7c99('0x4e'),_0x3e5b30[_0x7c99('0x4a')],_0x1d3296[_0x7c99('0x4f')],md5(_0x1d3296[_0x7c99('0x4f')]));}headers[_0x7c99('0x50')]=getAuth(_0x3e5b30);return getUser(_0x3e5b30,_0xdeeb09[_0x7c99('0x51')])['then'](function(_0x557726){_0x44797a=_0x557726;logger[_0x7c99('0x19')]('The\x20User\x20ID\x20is:',_0x44797a['id']);return getEndUser(_0x3e5b30,_0x1d3296[_0x7c99('0x62')],_0x1d3296[_0x7c99('0x63')]);})[_0x7c99('0x18')](function(_0x276d5c){_0x337e43=_0x276d5c;logger[_0x7c99('0x19')](_0x7c99('0x54'),_0x337e43['id']);return getTicket(_0x3e5b30,_0x44797a,_0x337e43,_0x55fa3d,_0x1d3296);})[_0x7c99('0x18')](function(_0x5c0537){if(_0x5c0537){logger[_0x7c99('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5c0537['id']);switch(_0x3e5b30[_0x7c99('0x3c')]){case _0x7c99('0x55'):logger[_0x7c99('0x19')]('[OUTBOUND]',_0x7c99('0x56'));return request({'uri':util[_0x7c99('0xd')](_0x7c99('0x57'),_0x3e5b30[_0x7c99('0xf')],_0x44797a['id'],_0x5c0537['id']),'method':_0x7c99('0x10')});case _0x7c99('0x58'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7c99('0xd')]('user:%s',_0xdeeb09[_0x7c99('0x13')]),_0x7c99('0x64'),{'uri':util[_0x7c99('0xd')](_0x7c99('0x5a'),_0x3e5b30[_0x7c99('0xf')],_0x5c0537['id'])});break;default:logger[_0x7c99('0x5b')](_0x7c99('0x61'),_0x7c99('0x65'));}}})[_0x7c99('0x66')](function(_0x34cbba){logger[_0x7c99('0x5b')](_0x7c99('0x67'),util[_0x7c99('0x5d')](_0x34cbba,{'showHidden':!![],'depth':null}));});};exports[_0x7c99('0x68')]=function(_0x51611d,_0x3ee012,_0x2719ee,_0x42ad18,_0x3559bc,_0x3d640e){var _0x350888,_0x36d3f5;_0x3d640e['remoteUri']=intUtil[_0x7c99('0x49')](_0x3d640e[_0x7c99('0xf')]);_0x3d640e[_0x7c99('0x4a')]=intUtil[_0x7c99('0x49')](_0x3d640e[_0x7c99('0x4a')]);if(_0x3559bc&&_0x3559bc[_0x7c99('0x69')]){logger[_0x7c99('0x19')](_0x7c99('0x6a'),_0x7c99('0x4c'));_0x3ee012[_0x7c99('0x4d')]=util[_0x7c99('0xd')](_0x7c99('0x4e'),_0x3d640e[_0x7c99('0x4a')],_0x3ee012[_0x7c99('0x4f')],md5(_0x3ee012[_0x7c99('0x4f')]));}else{_0x3ee012[_0x7c99('0x4d')]='';}headers[_0x7c99('0x50')]=getAuth(_0x3d640e);return getUser(_0x3d640e)[_0x7c99('0x18')](function(_0x3eb3fb){_0x350888=_0x3eb3fb;logger['info'](_0x7c99('0x52'),_0x350888['id']);return getEndUser(_0x3d640e,_0x3ee012[_0x7c99('0x53')],_0x3ee012['calleridnum']);})[_0x7c99('0x18')](function(_0x1e7620){_0x36d3f5=_0x1e7620;logger['info'](_0x7c99('0x54'),_0x36d3f5['id']);return getTicket(_0x3d640e,_0x350888,_0x36d3f5,_0x2719ee,_0x3ee012);})[_0x7c99('0x18')](function(_0x1d91a2){if(_0x1d91a2){logger[_0x7c99('0x19')](_0x7c99('0x6b'),_0x1d91a2['id']);}})['catch'](function(_0x2acc7c){logger[_0x7c99('0x5b')](_0x7c99('0x6c'),util['inspect'](_0x2acc7c,{'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 745d8bf..6db2e02 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 _0x7ae6=['The\x20User\x20ID\x20is:','[ABANDONED]','request-promise','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','toString','variable','variableName','Variable','toLowerCase','indexOf','isNil','access_token','isBefore','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','ActiveUsers','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','users','profile','name','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','Search\x20end\x20user','GET','Zoho-oauthtoken\x20','data','enduserType','Contacts','https://www.zohoapis.','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','role','last_name','SUCCESS','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','first_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','talktime','format','mm:ss','endtime','Call_Duration','utc','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','code','Call\x20created!','details','err','log','queue','host','stripTrailingSlash','serverUrl','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','zoho.eu','destcalleridname','destcalleridnum','Outbound','user:%s','trigger:browser:url','[OUTBOUND]','monitor_format','/api/voice/recordings/'];(function(_0x55effb,_0x483086){var _0x138b10=function(_0x203ed7){while(--_0x203ed7){_0x55effb['push'](_0x55effb['shift']());}};_0x138b10(++_0x483086);}(_0x7ae6,0x94));var _0x67ae=function(_0x5ccc02,_0x5b41fb){_0x5ccc02=_0x5ccc02-0x0;var _0x390493=_0x7ae6[_0x5ccc02];return _0x390493;};'use strict';var _=require('lodash');var rp=require(_0x67ae('0x0'));var md5=require('md5');var util=require(_0x67ae('0x1'));var intUtil=require(_0x67ae('0x2'));var moment=require(_0x67ae('0x3'));var Redis=require(_0x67ae('0x4'));var config=require(_0x67ae('0x5'));var logger=require(_0x67ae('0x6'))('zoho');config[_0x67ae('0x7')]=_[_0x67ae('0x8')](config[_0x67ae('0x7')],{'host':_0x67ae('0x9'),'port':0x18eb});var io=require(_0x67ae('0xa'))(new Redis(config['redis']));function emit(_0x456ca9,_0x460304,_0x2591a1){io['to'](_0x456ca9)[_0x67ae('0xb')](_0x460304,_0x2591a1);}function request(_0x169102){logger[_0x67ae('0xc')](_0x67ae('0xd'),JSON[_0x67ae('0xe')](_0x169102));return rp(_0x169102);}function getCustomFields(_0x4d278b,_0x28d20a){var _0x3143cb={};if(_0x4d278b[_0x67ae('0xf')]>0x0){_[_0x67ae('0x10')](_0x4d278b,function(_0xf3f46b){if(_0xf3f46b[_0x67ae('0x11')]===_0x67ae('0x12')&&_0xf3f46b[_0x67ae('0x13')]){_0x3143cb[_0xf3f46b[_0x67ae('0x13')]]=_0xf3f46b[_0x67ae('0x14')][_0x67ae('0x15')]();}else if(_0xf3f46b[_0x67ae('0x11')]===_0x67ae('0x16')&&_0xf3f46b[_0x67ae('0x17')]&&_0xf3f46b[_0x67ae('0x13')]&&_0x28d20a[_0xf3f46b['variableName']]){_0x3143cb[_0xf3f46b[_0x67ae('0x13')]]=_0x28d20a[_0xf3f46b[_0x67ae('0x17')]][_0x67ae('0x15')]();}else if(_0xf3f46b['type']==='customVariable'&&_0xf3f46b[_0x67ae('0x18')]&&_0xf3f46b['Variable']['name']&&_0xf3f46b[_0x67ae('0x13')]&&_0x28d20a[_0xf3f46b[_0x67ae('0x18')]['name']['toLowerCase']()]){_0x3143cb[_0xf3f46b['idField']]=_0x28d20a[_0xf3f46b[_0x67ae('0x18')]['name'][_0x67ae('0x19')]()]['toString']();}});}return _0x3143cb;}function getName(_0x3654fd){if(_0x3654fd[_0x67ae('0x1a')]('\x20')>0x0){var _0xc74da5=_0x3654fd['split'](/ (.+)/);if(_0xc74da5[0x1]){return _0xc74da5;}}return[_0x3654fd,_0x3654fd];}var accountsTokens={};function getAccessToken(_0x30606a){return new Promise(function(_0x18876d,_0x23ca2c){if(!_[_0x67ae('0x1b')](accountsTokens[_0x30606a['id']])&&!_[_0x67ae('0x1b')](accountsTokens[_0x30606a['id']][_0x67ae('0x1c')])){if(moment()[_0x67ae('0x1d')](accountsTokens[_0x30606a['id']]['expires_in'])){_0x18876d(accountsTokens[_0x30606a['id']][_0x67ae('0x1c')]);}}var _0x23eca2;switch(_0x30606a['zone']){case'US':_0x23eca2='https://accounts.zoho.com';break;case'AU':_0x23eca2='https://accounts.zoho.com.au';break;case'EU':_0x23eca2=_0x67ae('0x1e');break;case'IN':_0x23eca2=_0x67ae('0x1f');break;case'CN':_0x23eca2=_0x67ae('0x20');break;default:_0x23eca2='https://accounts.zoho.eu';break;}var _0x22cbf4={'method':_0x67ae('0x21'),'uri':_0x23eca2+'/oauth/v2/token','qs':{'refresh_token':_0x30606a['refreshToken'],'client_id':_0x30606a[_0x67ae('0x22')],'client_secret':_0x30606a[_0x67ae('0x23')],'grant_type':_0x67ae('0x24')},'json':!![]};return rp(_0x22cbf4)[_0x67ae('0x25')](function(_0x33abca){accountsTokens[_0x30606a['id']]={'access_token':_0x33abca[_0x67ae('0x1c')],'expires_in':moment()[_0x67ae('0x26')](_0x33abca[_0x67ae('0x27')],_0x67ae('0x28'))};_0x18876d(_0x33abca['access_token']);})[_0x67ae('0x29')](function(_0x51de0f){logger[_0x67ae('0x2a')](_0x67ae('0x2b'),_0x51de0f[_0x67ae('0x2c')]);_0x23ca2c(_0x51de0f);});});}function getUser(_0x266d26,_0xf5b101,_0x320274,_0x13d219){logger[_0x67ae('0x2d')]('Search\x20user');return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0xf5b101),'qs':{'type':_0x67ae('0x2e')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x266d26},'json':!![]})['then'](function(_0x4720ae){if(_0x4720ae['users']){var _0x17d537=-0x1;if(_['isArrayLikeObject'](_0x4720ae['users'])){if(!_[_0x67ae('0x1b')](_0x13d219)){_0x17d537=_[_0x67ae('0x2f')](_0x4720ae['users'],function(_0x503cc5){return _0x503cc5[_0x67ae('0x30')]===_0x13d219;});}if(_0x17d537>=0x0){logger['info'](_0x67ae('0x31'));}else{logger[_0x67ae('0x2d')](_0x67ae('0x32'));_0x17d537=_[_0x67ae('0x2f')](_0x4720ae[_0x67ae('0x33')],function(_0x57f448){return _0x57f448[_0x67ae('0x34')][_0x67ae('0x35')]===_0x67ae('0x36');});}return _0x4720ae[_0x67ae('0x33')][_0x17d537];}else{if(_0x4720ae[_0x67ae('0x37')][_0x67ae('0x34')]['name']===_0x67ae('0x36')){logger['info'](_0x67ae('0x32'));user=_0x4720ae[_0x67ae('0x37')];return user;}else{logger[_0x67ae('0x2a')]('The\x20failing\x20result\x20is',JSON[_0x67ae('0xe')](_0x4720ae));throw new Error(_0x67ae('0x38')+JSON[_0x67ae('0xe')](_0x4720ae));}}}else{logger[_0x67ae('0x2a')](_0x67ae('0x39'),JSON[_0x67ae('0xe')](_0x4720ae));throw new Error(_0x67ae('0x38')+JSON[_0x67ae('0xe')](_0x4720ae));}})['catch'](function(_0x42ef2b){console['error'](_0x42ef2b);});}function getEndUser(_0x1126ab,_0x3834ce,_0x82ba8c,_0x6439d,_0x4f5681,_0x54b365,_0x567f10){logger[_0x67ae('0x2d')](_0x67ae('0x3a'));return request({'method':_0x67ae('0x3b'),'uri':'https://www.zohoapis.'+_0x3834ce+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4f5681+'))','headers':{'Authorization':_0x67ae('0x3c')+_0x1126ab},'json':!![]})[_0x67ae('0x25')](function(_0x4440c5){if(_0x4440c5){var _0x4d140f=_0x4440c5[_0x67ae('0x3d')][0x0];_0x4d140f[_0x67ae('0x3e')]=_0x67ae('0x3f');logger['info']('End\x20user\x20found\x20(Contact)');return _0x4d140f;}else{return request({'method':_0x67ae('0x3b'),'uri':_0x67ae('0x40')+_0x3834ce+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4f5681+'))','headers':{'Authorization':_0x67ae('0x3c')+_0x1126ab},'json':!![]})['then'](function(_0x2e5354){if(_0x2e5354){var _0x4a8d98=_0x2e5354[_0x67ae('0x3d')][0x0];_0x4a8d98['enduserType']='Leads';logger[_0x67ae('0x2d')](_0x67ae('0x41'));return _0x4a8d98;}else{logger[_0x67ae('0x2d')](_0x67ae('0x42'));_0x6439d=getName(_0x6439d);return request({'method':_0x67ae('0x21'),'uri':'https://www.zohoapis.'+_0x3834ce+_0x67ae('0x43')+_0x567f10[_0x67ae('0x44')],'body':{'data':[{'Last_Name':_0x6439d[0x1],'First_Name':_0x6439d[0x0],'Phone':_0x4f5681,'Owner':{'name':!_['isNil'](_0x54b365[_0x67ae('0x45')][_0x67ae('0x35')])?_0x54b365['role'][_0x67ae('0x35')]:!_[_0x67ae('0x1b')](_0x54b365['first_name'])?_0x54b365['first_name']+'\x20'+_0x54b365[_0x67ae('0x46')]:_0x54b365[_0x67ae('0x46')],'id':_0x54b365['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1126ab},'json':!![]})[_0x67ae('0x25')](function(_0x4ffba5){if(_0x4ffba5&&_0x4ffba5[_0x67ae('0x3d')][0x0]['code']===_0x67ae('0x47')){var _0x4868a5=_0x4ffba5[_0x67ae('0x3d')][0x0]['details'];_0x4868a5[_0x67ae('0x3e')]=_0x567f10[_0x67ae('0x44')];return _0x4868a5;}logger[_0x67ae('0x2a')](_0x67ae('0x39'),JSON[_0x67ae('0xe')](_0x4ffba5));throw new Error(_0x67ae('0x48')+JSON['stringify'](_0x4ffba5));});}});}});}function getCall(_0x4fcd59,_0x42f1c3,_0x42e412,_0x3b4a9d,_0x529757,_0x403910,_0x5bb28f,_0x11046e){logger[_0x67ae('0x2d')](_0x67ae('0x49'));var _0x7fbbdb={};_0x7fbbdb[_0x67ae('0x4a')]={'name':!_[_0x67ae('0x1b')](_0x3b4a9d[_0x67ae('0x45')]['name'])&&!_[_0x67ae('0x1b')](_0x3b4a9d['profile'][_0x67ae('0x35')])&&_0x3b4a9d[_0x67ae('0x34')][_0x67ae('0x35')]==='administrator'?_0x3b4a9d[_0x67ae('0x45')][_0x67ae('0x35')]:!_[_0x67ae('0x1b')](_0x3b4a9d[_0x67ae('0x4b')])?_0x3b4a9d[_0x67ae('0x4b')]+'\x20'+_0x3b4a9d[_0x67ae('0x46')]:_0x3b4a9d['last_name'],'id':_0x3b4a9d['id']};_0x7fbbdb[_0x67ae('0x4c')]=intUtil[_0x67ae('0x4d')](_0x403910[_0x67ae('0x4e')],_0x5bb28f,'\x20');_0x7fbbdb[_0x67ae('0x4f')]=intUtil[_0x67ae('0x4d')](_0x403910[_0x67ae('0x50')],_0x5bb28f,'\x0a');if(_0x529757[_0x67ae('0x3e')]==='Contacts'){_0x7fbbdb[_0x67ae('0x51')]={'name':!_[_0x67ae('0x1b')](_0x529757['Full_Name'])?_0x529757[_0x67ae('0x52')]:!_[_0x67ae('0x1b')](_0x529757[_0x67ae('0x53')])?_0x529757[_0x67ae('0x53')]+'\x20'+_0x529757['Last_Name']:_0x529757[_0x67ae('0x54')],'id':_0x529757['id']};}if(_0x529757[_0x67ae('0x3e')]===_0x67ae('0x55')){_0x7fbbdb[_0x67ae('0x56')]={'name':!_['isNil'](_0x529757['Full_Name'])?_0x529757[_0x67ae('0x52')]:!_[_0x67ae('0x1b')](_0x529757[_0x67ae('0x53')])?_0x529757[_0x67ae('0x53')]+'\x20'+_0x529757[_0x67ae('0x54')]:_0x529757[_0x67ae('0x54')],'id':_0x529757['id']};_0x7fbbdb['$se_module']=_0x529757['enduserType'];}if(_0x5bb28f[_0x67ae('0x57')]){_0x7fbbdb['Call_Duration']=moment['utc'](parseInt(_0x5bb28f['talktime'])*0x3e8)[_0x67ae('0x58')](_0x67ae('0x59'));}else if(_0x5bb28f['answertime']&&_0x5bb28f[_0x67ae('0x5a')]){_0x7fbbdb[_0x67ae('0x5b')]=moment[_0x67ae('0x5c')](moment(_0x5bb28f['endtime'],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x5bb28f[_0x67ae('0x5d')],_0x67ae('0x5e'))))[_0x67ae('0x58')](_0x67ae('0x59'));}switch(_0x5bb28f['lastevent']){case _0x67ae('0x5f'):_0x7fbbdb[_0x67ae('0x60')]=_0x67ae('0x61');break;case _0x67ae('0x62'):case _0x67ae('0x63'):_0x7fbbdb[_0x67ae('0x60')]=_0x67ae('0x64');break;case _0x67ae('0x65'):_0x7fbbdb[_0x67ae('0x60')]=_0x67ae('0x66');break;case _0x67ae('0x67'):_0x7fbbdb['Call_Result']=_0x67ae('0x68');break;default:}_0x7fbbdb['Call_Start_Time']=(_0x11046e===_0x67ae('0x69')?moment(_0x5bb28f[_0x67ae('0x5d')])[_0x67ae('0x58')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5bb28f[_0x67ae('0x6a')])[_0x67ae('0x58')](_0x67ae('0x5e')))||moment()['format'](_0x67ae('0x5e'));_0x7fbbdb[_0x67ae('0x6b')]=_0x11046e||_0x67ae('0x6c');_0x7fbbdb=_[_0x67ae('0x6d')](_0x7fbbdb,getCustomFields(_0x403910['Fields'],_0x5bb28f));return request({'method':_0x67ae('0x21'),'uri':'https://www.zohoapis.'+_0x42f1c3+_0x67ae('0x6e'),'headers':{'Authorization':_0x67ae('0x3c')+_0x4fcd59},'body':{'data':[_0x7fbbdb]},'json':!![]})[_0x67ae('0x25')](function(_0xc31f02){if(_0xc31f02&&_0xc31f02[_0x67ae('0x3d')][0x0][_0x67ae('0x6f')]===_0x67ae('0x47')){logger['info'](_0x67ae('0x70'));return{'id':_0xc31f02[_0x67ae('0x3d')][0x0][_0x67ae('0x71')]['id']};}})[_0x67ae('0x29')](function(_0x48dddf){logger[_0x67ae('0x2d')](_0x67ae('0x72'),_0x48dddf['stack']);console[_0x67ae('0x73')](_0x67ae('0x72'),_0x48dddf);});}exports[_0x67ae('0x74')]=function(_0x259f4e,_0x3c15ba,_0x324338,_0x45b7c0,_0x3c3900,_0x288df5){var _0x541212,_0x59aeb3,_0x3696ee;_0x288df5[_0x67ae('0x75')]=intUtil[_0x67ae('0x76')](_0x288df5[_0x67ae('0x75')]);_0x288df5['serverUrl']=intUtil[_0x67ae('0x76')](_0x288df5[_0x67ae('0x77')]);if(_0x3c3900&&_0x3c3900['monitor_format']){logger[_0x67ae('0x2d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3c15ba[_0x67ae('0x78')]=_0x288df5[_0x67ae('0x77')]+'/api/voice/recordings/'+_0x3c15ba[_0x67ae('0x79')]+_0x67ae('0x7a')+md5(_0x3c15ba['uniqueid']);}else{_0x3c15ba['recordingURL']='';}var _0x4c2434=_0x288df5[_0x67ae('0x75')]==='zoho.eu'?'eu':_0x67ae('0x7b');return getAccessToken(_0x288df5)[_0x67ae('0x25')](function(_0x401a92){_0x3696ee=_0x401a92;return getUser(_0x3696ee,_0x4c2434,_0x288df5,_0x45b7c0[_0x67ae('0x30')]);})[_0x67ae('0x25')](function(_0x53d873){_0x541212=_0x53d873;logger[_0x67ae('0x2d')]('The\x20User\x20ID\x20is:',_0x541212['id']);return getEndUser(_0x3696ee,_0x4c2434,_0x288df5,_0x3c15ba[_0x67ae('0x7c')],_0x3c15ba[_0x67ae('0x7d')],_0x541212,_0x324338);})['then'](function(_0x103834){_0x59aeb3=_0x103834;logger['info'](_0x67ae('0x7e'),_0x59aeb3['id']);return getCall(_0x3696ee,_0x4c2434,_0x288df5,_0x541212,_0x59aeb3,_0x324338,_0x3c15ba,_0x67ae('0x6c'));})[_0x67ae('0x25')](function(_0x5e0d6a){if(_0x5e0d6a){logger[_0x67ae('0x2d')](_0x67ae('0x7f'),_0x5e0d6a['id']);logger[_0x67ae('0x2d')](_0x67ae('0x80'),_0x67ae('0x81'));emit(util['format']('user:%s',_0x45b7c0[_0x67ae('0x35')]),'trigger:browser:url',{'uri':_0x67ae('0x82')+_0x288df5[_0x67ae('0x75')]+_0x67ae('0x83')+_0x5e0d6a['id']});}})[_0x67ae('0x29')](function(_0xbc6147){logger[_0x67ae('0x2a')](_0x67ae('0x80'),JSON[_0x67ae('0xe')](_0xbc6147));});};exports[_0x67ae('0x69')]=function(_0x49563a,_0x1a58b9,_0x478632,_0x4b1631,_0x40c7e4,_0x3e6bfa,_0x3b1ade){var _0x54c14b,_0x3d80d5,_0x1919f1;_0x3e6bfa[_0x67ae('0x75')]=intUtil['stripTrailingSlash'](_0x3e6bfa[_0x67ae('0x75')]);_0x3e6bfa[_0x67ae('0x77')]=intUtil[_0x67ae('0x76')](_0x3e6bfa[_0x67ae('0x77')]);if(_0x3b1ade&&_0x3b1ade[_0x67ae('0x84')]&&_0x3b1ade[_0x67ae('0x84')]!==_0x67ae('0x85')){logger[_0x67ae('0x2d')]('[OUTBOUND]',_0x67ae('0x86'));_0x1a58b9[_0x67ae('0x78')]=_0x3e6bfa[_0x67ae('0x77')]+'/api/voice/recordings/'+_0x1a58b9[_0x67ae('0x79')]+'/downloads?type=uniqueid&token='+md5(_0x1a58b9[_0x67ae('0x79')]);}var _0x1c910f=_0x3e6bfa[_0x67ae('0x75')]===_0x67ae('0x87')?'eu':_0x67ae('0x7b');return getAccessToken(_0x3e6bfa)['then'](function(_0x16fee9){_0x1919f1=_0x16fee9;return getUser(_0x1919f1,_0x1c910f,_0x3e6bfa,_0x4b1631[_0x67ae('0x30')]);})[_0x67ae('0x25')](function(_0x175ad7){_0x54c14b=_0x175ad7;logger[_0x67ae('0x2d')]('The\x20User\x20ID\x20is:',_0x54c14b['id']);return getEndUser(_0x1919f1,_0x1c910f,_0x3e6bfa,_0x1a58b9[_0x67ae('0x88')],_0x1a58b9[_0x67ae('0x89')],_0x54c14b,_0x478632);})[_0x67ae('0x25')](function(_0x42ab3d){_0x3d80d5=_0x42ab3d;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3d80d5['id']);return getCall(_0x1919f1,_0x1c910f,_0x3e6bfa,_0x54c14b,_0x3d80d5,_0x478632,_0x1a58b9,_0x67ae('0x8a'));})[_0x67ae('0x25')](function(_0x1e0863){if(_0x1e0863){logger[_0x67ae('0x2d')](_0x67ae('0x7f'),_0x1e0863['id']);logger[_0x67ae('0x2d')]('[OUTBOUND]',_0x67ae('0x81'));emit(util['format'](_0x67ae('0x8b'),_0x4b1631['name']),_0x67ae('0x8c'),{'uri':_0x67ae('0x82')+_0x3e6bfa['host']+_0x67ae('0x83')+_0x1e0863['id']});}})['catch'](function(_0x44b2be){logger[_0x67ae('0x2a')](_0x67ae('0x8d'),JSON[_0x67ae('0xe')](_0x44b2be));});};exports[_0x67ae('0x67')]=function(_0x43267b,_0x19cb19,_0x486f1f,_0x53a670,_0x46766c,_0x16b06a){var _0x1f88e1,_0x3bfb29,_0xf4e1c9;_0x16b06a['host']=intUtil['stripTrailingSlash'](_0x16b06a[_0x67ae('0x75')]);_0x16b06a['serverUrl']=intUtil['stripTrailingSlash'](_0x16b06a['serverUrl']);if(_0x46766c&&_0x46766c[_0x67ae('0x8e')]){logger[_0x67ae('0x2d')]('[ABANDONED]',_0x67ae('0x86'));_0x19cb19[_0x67ae('0x78')]=_0x16b06a[_0x67ae('0x77')]+_0x67ae('0x8f')+_0x19cb19[_0x67ae('0x79')]+_0x67ae('0x7a')+md5(_0x19cb19[_0x67ae('0x79')]);}else{_0x19cb19[_0x67ae('0x78')]='';}var _0x5c4ae3=_0x16b06a['host']==='zoho.eu'?'eu':_0x67ae('0x7b');return getAccessToken(_0x16b06a)[_0x67ae('0x25')](function(_0x33df5c){_0xf4e1c9=_0x33df5c;return getUser(_0xf4e1c9,_0x5c4ae3,_0x16b06a);})['then'](function(_0x361925){_0x1f88e1=_0x361925;logger[_0x67ae('0x2d')](_0x67ae('0x90'),_0x1f88e1['id']);return getEndUser(_0xf4e1c9,_0x5c4ae3,_0x16b06a,_0x19cb19[_0x67ae('0x7c')],_0x19cb19['calleridnum'],_0x1f88e1,_0x486f1f);})[_0x67ae('0x25')](function(_0xada10f){_0x3bfb29=_0xada10f;logger['info'](_0x67ae('0x7e'),_0x3bfb29['id']);return getCall(_0xf4e1c9,_0x5c4ae3,_0x16b06a,_0x1f88e1,_0x3bfb29,_0x486f1f,_0x19cb19,'Inbound');})[_0x67ae('0x25')](function(_0x39d9b1){if(_0x39d9b1){logger[_0x67ae('0x2d')](_0x67ae('0x7f'),_0x39d9b1['id']);}})['catch'](function(_0x256d2d){logger[_0x67ae('0x2a')](_0x67ae('0x91'),JSON[_0x67ae('0xe')](_0x256d2d));});}; \ No newline at end of file +var _0x5c82=['/oauth/v2/token','refreshToken','clientSecret','refresh_token','seconds','access_token','catch','error','Failing\x20creating\x20the\x20access_token','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','/crm/v2/','moduleCreate','role','first_name','last_name','details','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','complete','connect','Call_Result','rejected','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','code','SUCCESS','Call\x20created!','stack','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','email','destcalleridnum','Outbound','[OUTBOUND]','user:%s','trigger:browser:url','[ABANDONED]','calleridname','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','stringify','forEach','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn'];(function(_0x55a101,_0x3df81b){var _0x43466b=function(_0x5d1e83){while(--_0x5d1e83){_0x55a101['push'](_0x55a101['shift']());}};_0x43466b(++_0x3df81b);}(_0x5c82,0x198));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x25c8('0x0'));var rp=require(_0x25c8('0x1'));var md5=require(_0x25c8('0x2'));var util=require(_0x25c8('0x3'));var intUtil=require(_0x25c8('0x4'));var moment=require(_0x25c8('0x5'));var Redis=require(_0x25c8('0x6'));var config=require(_0x25c8('0x7'));var logger=require(_0x25c8('0x8'))(_0x25c8('0x9'));config[_0x25c8('0xa')]=_[_0x25c8('0xb')](config[_0x25c8('0xa')],{'host':_0x25c8('0xc'),'port':0x18eb});var io=require(_0x25c8('0xd'))(new Redis(config[_0x25c8('0xa')]));function emit(_0x456703,_0x38dc4e,_0x5388af){io['to'](_0x456703)['emit'](_0x38dc4e,_0x5388af);}function request(_0x5cd2d6){logger[_0x25c8('0xe')]('[HTTP]',JSON[_0x25c8('0xf')](_0x5cd2d6));return rp(_0x5cd2d6);}function getCustomFields(_0x24ae74,_0x5ad180){var _0x3e915b={};if(_0x24ae74['length']>0x0){_[_0x25c8('0x10')](_0x24ae74,function(_0x1f2a62){if(_0x1f2a62['type']==='string'&&_0x1f2a62[_0x25c8('0x11')]){_0x3e915b[_0x1f2a62[_0x25c8('0x11')]]=_0x1f2a62[_0x25c8('0x12')]['toString']();}else if(_0x1f2a62[_0x25c8('0x13')]===_0x25c8('0x14')&&_0x1f2a62[_0x25c8('0x15')]&&_0x1f2a62[_0x25c8('0x11')]&&_0x5ad180[_0x1f2a62[_0x25c8('0x15')]]){_0x3e915b[_0x1f2a62[_0x25c8('0x11')]]=_0x5ad180[_0x1f2a62[_0x25c8('0x15')]][_0x25c8('0x16')]();}else if(_0x1f2a62[_0x25c8('0x13')]===_0x25c8('0x17')&&_0x1f2a62[_0x25c8('0x18')]&&_0x1f2a62['Variable']['name']&&_0x1f2a62[_0x25c8('0x11')]&&_0x5ad180[_0x1f2a62['Variable'][_0x25c8('0x19')][_0x25c8('0x1a')]()]){_0x3e915b[_0x1f2a62[_0x25c8('0x11')]]=_0x5ad180[_0x1f2a62[_0x25c8('0x18')][_0x25c8('0x19')][_0x25c8('0x1a')]()][_0x25c8('0x16')]();}});}return _0x3e915b;}function getName(_0x4b67fa){if(_0x4b67fa['indexOf']('\x20')>0x0){var _0x1a3f76=_0x4b67fa[_0x25c8('0x1b')](/ (.+)/);if(_0x1a3f76[0x1]){return _0x1a3f76;}}return[_0x4b67fa,_0x4b67fa];}var accountsTokens={};function getAccessToken(_0x49c60d){return new Promise(function(_0x2a6bfe,_0x10d43b){if(!_[_0x25c8('0x1c')](accountsTokens[_0x49c60d['id']])&&!_['isNil'](accountsTokens[_0x49c60d['id']]['access_token'])){if(moment()[_0x25c8('0x1d')](accountsTokens[_0x49c60d['id']]['expires_in'])){_0x2a6bfe(accountsTokens[_0x49c60d['id']]['access_token']);}}var _0x34e580;switch(_0x49c60d[_0x25c8('0x1e')]){case'US':_0x34e580=_0x25c8('0x1f');break;case'AU':_0x34e580=_0x25c8('0x20');break;case'EU':_0x34e580=_0x25c8('0x21');break;case'IN':_0x34e580=_0x25c8('0x22');break;case'CN':_0x34e580=_0x25c8('0x23');break;default:_0x34e580=_0x25c8('0x21');break;}var _0x30931a={'method':'POST','uri':_0x34e580+_0x25c8('0x24'),'qs':{'refresh_token':_0x49c60d[_0x25c8('0x25')],'client_id':_0x49c60d['clientId'],'client_secret':_0x49c60d[_0x25c8('0x26')],'grant_type':_0x25c8('0x27')},'json':!![]};return rp(_0x30931a)['then'](function(_0x33703d){accountsTokens[_0x49c60d['id']]={'access_token':_0x33703d['access_token'],'expires_in':moment()['add'](_0x33703d['expires_in'],_0x25c8('0x28'))};_0x2a6bfe(_0x33703d[_0x25c8('0x29')]);})[_0x25c8('0x2a')](function(_0x2ff741){logger[_0x25c8('0x2b')](_0x25c8('0x2c'),_0x2ff741['stack']);_0x10d43b(_0x2ff741);});});}function getUser(_0x47a996,_0x3fd79b,_0x1a5a8d,_0x3cd844){logger[_0x25c8('0x2d')]('Search\x20user');return request({'method':_0x25c8('0x2e'),'uri':util['format'](_0x25c8('0x2f'),_0x3fd79b),'qs':{'type':_0x25c8('0x30')},'headers':{'Authorization':_0x25c8('0x31')+_0x47a996},'json':!![]})[_0x25c8('0x32')](function(_0x3c4f8e){if(_0x3c4f8e[_0x25c8('0x33')]){var _0x4fffbf=-0x1;if(_[_0x25c8('0x34')](_0x3c4f8e['users'])){if(!_[_0x25c8('0x1c')](_0x3cd844)){_0x4fffbf=_[_0x25c8('0x35')](_0x3c4f8e[_0x25c8('0x33')],function(_0x4e9366){return _0x4e9366['email']===_0x3cd844;});}if(_0x4fffbf>=0x0){logger['info'](_0x25c8('0x36'));}else{logger[_0x25c8('0x2d')](_0x25c8('0x37'));_0x4fffbf=_[_0x25c8('0x35')](_0x3c4f8e['users'],function(_0x549840){return _0x549840[_0x25c8('0x38')][_0x25c8('0x19')]==='Administrator';});}return _0x3c4f8e[_0x25c8('0x33')][_0x4fffbf];}else{if(_0x3c4f8e[_0x25c8('0x39')]['profile']['name']===_0x25c8('0x3a')){logger[_0x25c8('0x2d')]('Using\x20the\x20admin\x20account!');user=_0x3c4f8e[_0x25c8('0x39')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x25c8('0xf')](_0x3c4f8e));throw new Error(_0x25c8('0x3b')+JSON[_0x25c8('0xf')](_0x3c4f8e));}}}else{logger[_0x25c8('0x2b')](_0x25c8('0x3c'),JSON[_0x25c8('0xf')](_0x3c4f8e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x25c8('0xf')](_0x3c4f8e));}})[_0x25c8('0x2a')](function(_0xb8ea63){console[_0x25c8('0x2b')](_0xb8ea63);});}function getEndUser(_0x5d2694,_0xd9a33f,_0x3caa18,_0x55b812,_0x223a12,_0x4c1e75,_0x2cea20){logger['info'](_0x25c8('0x3d'));return request({'method':'GET','uri':_0x25c8('0x3e')+_0xd9a33f+_0x25c8('0x3f')+_0x223a12+'))','headers':{'Authorization':_0x25c8('0x31')+_0x5d2694},'json':!![]})['then'](function(_0x3527cb){if(_0x3527cb){var _0x3d20ea=_0x3527cb[_0x25c8('0x40')][0x0];_0x3d20ea[_0x25c8('0x41')]=_0x25c8('0x42');logger[_0x25c8('0x2d')](_0x25c8('0x43'));return _0x3d20ea;}else{return request({'method':_0x25c8('0x2e'),'uri':_0x25c8('0x3e')+_0xd9a33f+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x223a12+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d2694},'json':!![]})[_0x25c8('0x32')](function(_0x3b9b1c){if(_0x3b9b1c){var _0x2242ab=_0x3b9b1c[_0x25c8('0x40')][0x0];_0x2242ab['enduserType']=_0x25c8('0x44');logger[_0x25c8('0x2d')](_0x25c8('0x45'));return _0x2242ab;}else{logger[_0x25c8('0x2d')](_0x25c8('0x46'));_0x55b812=getName(_0x55b812);return request({'method':_0x25c8('0x47'),'uri':_0x25c8('0x3e')+_0xd9a33f+_0x25c8('0x48')+_0x2cea20[_0x25c8('0x49')],'body':{'data':[{'Last_Name':_0x55b812[0x1],'First_Name':_0x55b812[0x0],'Phone':_0x223a12,'Owner':{'name':!_[_0x25c8('0x1c')](_0x4c1e75[_0x25c8('0x4a')][_0x25c8('0x19')])?_0x4c1e75[_0x25c8('0x4a')][_0x25c8('0x19')]:!_[_0x25c8('0x1c')](_0x4c1e75['first_name'])?_0x4c1e75[_0x25c8('0x4b')]+'\x20'+_0x4c1e75[_0x25c8('0x4c')]:_0x4c1e75[_0x25c8('0x4c')],'id':_0x4c1e75['id']}}]},'headers':{'Authorization':_0x25c8('0x31')+_0x5d2694},'json':!![]})[_0x25c8('0x32')](function(_0xf5edd5){if(_0xf5edd5&&_0xf5edd5[_0x25c8('0x40')][0x0]['code']==='SUCCESS'){var _0x21aff9=_0xf5edd5[_0x25c8('0x40')][0x0][_0x25c8('0x4d')];_0x21aff9[_0x25c8('0x41')]=_0x2cea20[_0x25c8('0x49')];return _0x21aff9;}logger['error'](_0x25c8('0x3c'),JSON[_0x25c8('0xf')](_0xf5edd5));throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x25c8('0xf')](_0xf5edd5));});}});}});}function getCall(_0x290b5e,_0x26df51,_0x2f457c,_0x2f1a94,_0xfed624,_0x31a6fb,_0x2b6a08,_0xa4e6e4){logger['info'](_0x25c8('0x4e'));var _0x2721cc={};_0x2721cc[_0x25c8('0x4f')]={'name':!_[_0x25c8('0x1c')](_0x2f1a94[_0x25c8('0x4a')][_0x25c8('0x19')])&&!_[_0x25c8('0x1c')](_0x2f1a94[_0x25c8('0x38')]['name'])&&_0x2f1a94['profile']['name']===_0x25c8('0x50')?_0x2f1a94[_0x25c8('0x4a')][_0x25c8('0x19')]:!_[_0x25c8('0x1c')](_0x2f1a94[_0x25c8('0x4b')])?_0x2f1a94['first_name']+'\x20'+_0x2f1a94['last_name']:_0x2f1a94['last_name'],'id':_0x2f1a94['id']};_0x2721cc[_0x25c8('0x51')]=intUtil[_0x25c8('0x52')](_0x31a6fb[_0x25c8('0x53')],_0x2b6a08,'\x20');_0x2721cc[_0x25c8('0x54')]=intUtil['getString'](_0x31a6fb[_0x25c8('0x55')],_0x2b6a08,'\x0a');if(_0xfed624[_0x25c8('0x41')]==='Contacts'){_0x2721cc[_0x25c8('0x56')]={'name':!_[_0x25c8('0x1c')](_0xfed624[_0x25c8('0x57')])?_0xfed624[_0x25c8('0x57')]:!_[_0x25c8('0x1c')](_0xfed624[_0x25c8('0x58')])?_0xfed624[_0x25c8('0x58')]+'\x20'+_0xfed624[_0x25c8('0x59')]:_0xfed624[_0x25c8('0x59')],'id':_0xfed624['id']};}if(_0xfed624['enduserType']===_0x25c8('0x44')){_0x2721cc[_0x25c8('0x5a')]={'name':!_[_0x25c8('0x1c')](_0xfed624[_0x25c8('0x57')])?_0xfed624[_0x25c8('0x57')]:!_[_0x25c8('0x1c')](_0xfed624[_0x25c8('0x58')])?_0xfed624[_0x25c8('0x58')]+'\x20'+_0xfed624[_0x25c8('0x59')]:_0xfed624[_0x25c8('0x59')],'id':_0xfed624['id']};_0x2721cc[_0x25c8('0x5b')]=_0xfed624[_0x25c8('0x41')];}if(_0x2b6a08[_0x25c8('0x5c')]){_0x2721cc[_0x25c8('0x5d')]=moment['utc'](parseInt(_0x2b6a08[_0x25c8('0x5c')])*0x3e8)[_0x25c8('0x5e')](_0x25c8('0x5f'));}else if(_0x2b6a08[_0x25c8('0x60')]&&_0x2b6a08[_0x25c8('0x61')]){_0x2721cc['Call_Duration']=moment['utc'](moment(_0x2b6a08['endtime'],_0x25c8('0x62'))[_0x25c8('0x63')](moment(_0x2b6a08[_0x25c8('0x64')],_0x25c8('0x62'))))['format'](_0x25c8('0x5f'));}switch(_0x2b6a08['lastevent']){case _0x25c8('0x65'):_0x2721cc['Call_Result']='Called';break;case _0x25c8('0x66'):case _0x25c8('0x67'):_0x2721cc[_0x25c8('0x68')]='Answered';break;case _0x25c8('0x69'):_0x2721cc[_0x25c8('0x68')]='Rejected';break;case _0x25c8('0x6a'):_0x2721cc['Call_Result']=_0x25c8('0x6b');break;default:}_0x2721cc['Call_Start_Time']=(_0xa4e6e4===_0x25c8('0x6c')?moment(_0x2b6a08[_0x25c8('0x64')])[_0x25c8('0x5e')](_0x25c8('0x62')):moment(_0x2b6a08[_0x25c8('0x6d')])[_0x25c8('0x5e')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x25c8('0x5e')](_0x25c8('0x62'));_0x2721cc[_0x25c8('0x6e')]=_0xa4e6e4||_0x25c8('0x6f');_0x2721cc=_[_0x25c8('0x70')](_0x2721cc,getCustomFields(_0x31a6fb[_0x25c8('0x71')],_0x2b6a08));return request({'method':'POST','uri':_0x25c8('0x3e')+_0x26df51+'/crm/v2/Calls','headers':{'Authorization':_0x25c8('0x31')+_0x290b5e},'body':{'data':[_0x2721cc]},'json':!![]})['then'](function(_0x27d3c0){if(_0x27d3c0&&_0x27d3c0['data'][0x0][_0x25c8('0x72')]===_0x25c8('0x73')){logger['info'](_0x25c8('0x74'));return{'id':_0x27d3c0[_0x25c8('0x40')][0x0][_0x25c8('0x4d')]['id']};}})['catch'](function(_0x4d3093){logger[_0x25c8('0x2d')]('err',_0x4d3093[_0x25c8('0x75')]);console[_0x25c8('0x76')](_0x25c8('0x77'),_0x4d3093);});}exports[_0x25c8('0x78')]=function(_0x38b528,_0x1a8cd6,_0x196944,_0xc2e04d,_0x3675d6,_0x20c8cd){var _0x56148f,_0x708d87,_0x4d9cbb;_0x20c8cd[_0x25c8('0x79')]=intUtil[_0x25c8('0x7a')](_0x20c8cd['host']);_0x20c8cd[_0x25c8('0x7b')]=intUtil[_0x25c8('0x7a')](_0x20c8cd[_0x25c8('0x7b')]);if(_0x3675d6&&_0x3675d6[_0x25c8('0x7c')]){logger[_0x25c8('0x2d')](_0x25c8('0x7d'),_0x25c8('0x7e'));_0x1a8cd6[_0x25c8('0x7f')]=_0x20c8cd[_0x25c8('0x7b')]+_0x25c8('0x80')+_0x1a8cd6[_0x25c8('0x81')]+_0x25c8('0x82')+md5(_0x1a8cd6[_0x25c8('0x81')]);}else{_0x1a8cd6[_0x25c8('0x7f')]='';}var _0x292efd=_0x20c8cd['host']===_0x25c8('0x83')?'eu':_0x25c8('0x84');return getAccessToken(_0x20c8cd)[_0x25c8('0x32')](function(_0x7d5d51){_0x4d9cbb=_0x7d5d51;return getUser(_0x4d9cbb,_0x292efd,_0x20c8cd,_0xc2e04d['email']);})[_0x25c8('0x32')](function(_0x574d7b){_0x56148f=_0x574d7b;logger[_0x25c8('0x2d')](_0x25c8('0x85'),_0x56148f['id']);return getEndUser(_0x4d9cbb,_0x292efd,_0x20c8cd,_0x1a8cd6['calleridname'],_0x1a8cd6[_0x25c8('0x86')],_0x56148f,_0x196944);})[_0x25c8('0x32')](function(_0x4f0280){_0x708d87=_0x4f0280;logger[_0x25c8('0x2d')](_0x25c8('0x87'),_0x708d87['id']);return getCall(_0x4d9cbb,_0x292efd,_0x20c8cd,_0x56148f,_0x708d87,_0x196944,_0x1a8cd6,'Inbound');})[_0x25c8('0x32')](function(_0x41e311){if(_0x41e311){logger[_0x25c8('0x2d')](_0x25c8('0x88'),_0x41e311['id']);logger['info'](_0x25c8('0x7d'),_0x25c8('0x89'));emit(util[_0x25c8('0x5e')]('user:%s',_0xc2e04d[_0x25c8('0x19')]),'trigger:browser:url',{'uri':'https://crm.'+_0x20c8cd[_0x25c8('0x79')]+_0x25c8('0x8a')+_0x41e311['id']});}})[_0x25c8('0x2a')](function(_0x315322){logger[_0x25c8('0x2b')](_0x25c8('0x7d'),JSON[_0x25c8('0xf')](_0x315322));});};exports['outbound']=function(_0xf418e2,_0xf7a162,_0x3545b5,_0xacf7a0,_0x4c202a,_0x3b374d,_0x5477ea){var _0x5c2a43,_0x42740e,_0x1b32fd;_0x3b374d[_0x25c8('0x79')]=intUtil[_0x25c8('0x7a')](_0x3b374d[_0x25c8('0x79')]);_0x3b374d['serverUrl']=intUtil[_0x25c8('0x7a')](_0x3b374d[_0x25c8('0x7b')]);if(_0x5477ea&&_0x5477ea[_0x25c8('0x8b')]&&_0x5477ea['recordingFormat']!=='none'){logger[_0x25c8('0x2d')]('[OUTBOUND]',_0x25c8('0x7e'));_0xf7a162[_0x25c8('0x7f')]=_0x3b374d[_0x25c8('0x7b')]+_0x25c8('0x80')+_0xf7a162['uniqueid']+_0x25c8('0x82')+md5(_0xf7a162[_0x25c8('0x81')]);}var _0x557b45=_0x3b374d['host']===_0x25c8('0x83')?'eu':'com';return getAccessToken(_0x3b374d)['then'](function(_0x3df8e0){_0x1b32fd=_0x3df8e0;return getUser(_0x1b32fd,_0x557b45,_0x3b374d,_0xacf7a0[_0x25c8('0x8c')]);})[_0x25c8('0x32')](function(_0x526127){_0x5c2a43=_0x526127;logger[_0x25c8('0x2d')]('The\x20User\x20ID\x20is:',_0x5c2a43['id']);return getEndUser(_0x1b32fd,_0x557b45,_0x3b374d,_0xf7a162['destcalleridname'],_0xf7a162[_0x25c8('0x8d')],_0x5c2a43,_0x3545b5);})[_0x25c8('0x32')](function(_0x1d37f9){_0x42740e=_0x1d37f9;logger['info'](_0x25c8('0x87'),_0x42740e['id']);return getCall(_0x1b32fd,_0x557b45,_0x3b374d,_0x5c2a43,_0x42740e,_0x3545b5,_0xf7a162,_0x25c8('0x8e'));})[_0x25c8('0x32')](function(_0x551a69){if(_0x551a69){logger[_0x25c8('0x2d')](_0x25c8('0x88'),_0x551a69['id']);logger['info'](_0x25c8('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x25c8('0x5e')](_0x25c8('0x90'),_0xacf7a0[_0x25c8('0x19')]),_0x25c8('0x91'),{'uri':'https://crm.'+_0x3b374d[_0x25c8('0x79')]+_0x25c8('0x8a')+_0x551a69['id']});}})[_0x25c8('0x2a')](function(_0x24183d){logger['error'](_0x25c8('0x8f'),JSON[_0x25c8('0xf')](_0x24183d));});};exports[_0x25c8('0x6a')]=function(_0x552907,_0x3df7d9,_0x2323fb,_0x4092be,_0x11055e,_0x3228a4){var _0x3c7909,_0x1fa1e9,_0x3f2bc2;_0x3228a4[_0x25c8('0x79')]=intUtil['stripTrailingSlash'](_0x3228a4['host']);_0x3228a4[_0x25c8('0x7b')]=intUtil[_0x25c8('0x7a')](_0x3228a4[_0x25c8('0x7b')]);if(_0x11055e&&_0x11055e[_0x25c8('0x7c')]){logger[_0x25c8('0x2d')](_0x25c8('0x92'),_0x25c8('0x7e'));_0x3df7d9[_0x25c8('0x7f')]=_0x3228a4[_0x25c8('0x7b')]+_0x25c8('0x80')+_0x3df7d9['uniqueid']+_0x25c8('0x82')+md5(_0x3df7d9[_0x25c8('0x81')]);}else{_0x3df7d9[_0x25c8('0x7f')]='';}var _0x3a53ee=_0x3228a4['host']===_0x25c8('0x83')?'eu':_0x25c8('0x84');return getAccessToken(_0x3228a4)['then'](function(_0x5e7f95){_0x3f2bc2=_0x5e7f95;return getUser(_0x3f2bc2,_0x3a53ee,_0x3228a4);})['then'](function(_0x4c4faa){_0x3c7909=_0x4c4faa;logger[_0x25c8('0x2d')](_0x25c8('0x85'),_0x3c7909['id']);return getEndUser(_0x3f2bc2,_0x3a53ee,_0x3228a4,_0x3df7d9[_0x25c8('0x93')],_0x3df7d9[_0x25c8('0x86')],_0x3c7909,_0x2323fb);})['then'](function(_0x4acd2d){_0x1fa1e9=_0x4acd2d;logger[_0x25c8('0x2d')](_0x25c8('0x87'),_0x1fa1e9['id']);return getCall(_0x3f2bc2,_0x3a53ee,_0x3228a4,_0x3c7909,_0x1fa1e9,_0x2323fb,_0x3df7d9,_0x25c8('0x6f'));})[_0x25c8('0x32')](function(_0x5d5486){if(_0x5d5486){logger[_0x25c8('0x2d')](_0x25c8('0x88'),_0x5d5486['id']);}})[_0x25c8('0x2a')](function(_0x4a225d){logger[_0x25c8('0x2b')](_0x25c8('0x92'),JSON[_0x25c8('0xf')](_0x4a225d));});}; \ 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 9ae5908..f90a7c1 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(_0x2358bc,_0x265b79){var _0x3f6a93=function(_0x5606ee){while(--_0x5606ee){_0x2358bc['push'](_0x2358bc['shift']());}};_0x3f6a93(++_0x265b79);}(_0x7a54,0x106));var _0x47a5=function(_0x391ff0,_0x7b6ce9){_0x391ff0=_0x391ff0-0x0;var _0x599b2b=_0x7a54[_0x391ff0];return _0x599b2b;};'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(_0xd6ffe1,_0x168450){var _0x52765b=function(_0x5c5aa4){while(--_0x5c5aa4){_0xd6ffe1['push'](_0xd6ffe1['shift']());}};_0x52765b(++_0x168450);}(_0x7a54,0x106));var _0x47a5=function(_0x52313f,_0xe53d){_0x52313f=_0x52313f-0x0;var _0x565f90=_0x7a54[_0x52313f];return _0x565f90;};'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 2e93ff0..42d8f80 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 _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x59cd77,_0x531b20){var _0x2534da=function(_0xc7ddab){while(--_0xc7ddab){_0x59cd77['push'](_0x59cd77['shift']());}};_0x2534da(++_0x531b20);}(_0x7a54,0x106));var _0x47a5=function(_0xe031d6,_0x4d49d3){_0xe031d6=_0xe031d6-0x0;var _0x591bf6=_0x7a54[_0xe031d6];return _0x591bf6;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x3d5c4e,_0x3f30a3){var _0x4ae9f6=function(_0x1a6b03){while(--_0x1a6b03){_0x3d5c4e['push'](_0x3d5c4e['shift']());}};_0x4ae9f6(++_0x3f30a3);}(_0xb10b,0x12a));var _0xbb10=function(_0x32e919,_0x4fd27c){_0x32e919=_0x32e919-0x0;var _0x2fc4cb=_0xb10b[_0x32e919];return _0x2fc4cb;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 54c4794..8f80f79 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(_0x295166,_0x1b06cd){var _0x9c2cb5=function(_0x420175){while(--_0x420175){_0x295166['push'](_0x295166['shift']());}};_0x9c2cb5(++_0x1b06cd);}(_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 _0x8135=['client','Request','debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing'];(function(_0xb3c2d6,_0x44651f){var _0x11213a=function(_0x581b18){while(--_0x581b18){_0xb3c2d6['push'](_0xb3c2d6['shift']());}};_0x11213a(++_0x44651f);}(_0x8135,0x99));var _0x5813=function(_0x4e174a,_0x76cf77){_0x4e174a=_0x4e174a-0x0;var _0x3446b6=_0x8135[_0x4e174a];return _0x3446b6;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x5813('0x0'));var logger=require(_0x5813('0x1'))(_0x5813('0x2'));var client=jayson[_0x5813('0x3')]['http']({'port':0x2329});client[_0x5813('0x4')]=function(_0x196ea8,_0xf23c29){return new BPromise(function(_0x701689,_0x1c9b08){return client['request'](_0x196ea8,_0xf23c29)['then'](function(_0x27599d){logger[_0x5813('0x5')](_0x5813('0x6'),_0x5813('0x2'),_0x196ea8,_0xf23c29,_0x27599d);if(_0x27599d[_0x5813('0x7')]){logger[_0x5813('0x7')](_0x5813('0x6'),_0x5813('0x2'),_0x196ea8,_0x27599d[_0x5813('0x7')][_0x5813('0x8')],_0xf23c29);return _0x1c9b08(_0x27599d[_0x5813('0x7')][_0x5813('0x8')]);}else{return _0x701689(_0x27599d[_0x5813('0x9')]);}})[_0x5813('0xa')](function(_0x3012b5){logger[_0x5813('0x7')](_0x5813('0x6'),'routing',_0x196ea8,_0x3012b5,_0xf23c29);return _0x1c9b08(_0x3012b5);});});};module[_0x5813('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 81af278..9588ce3 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 _0x5e11=['findOne','loginMailFrequency','log','bluebird','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','refresh','mailAccounts','listen','Setting'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5e11,0x1c3));var _0x15e1=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0x5e11[_0x173113];return _0x3bea89;};'use strict';var BPromise=require(_0x15e1('0x0'));var server=require('./server');var Realtime=require(_0x15e1('0x1'));var EmailChannel=require(_0x15e1('0x2'));var mailAccount=require(_0x15e1('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x15e1('0x4'))['db'];function initRealtime(){return BPromise[_0x15e1('0x5')]()[_0x15e1('0x6')](mailAccount['getMailAccounts']())[_0x15e1('0x6')](realtime['initMailAccounts']())[_0x15e1('0x6')](function(){email[_0x15e1('0x7')](realtime[_0x15e1('0x8')]);return realtime;});}function main(){return server[_0x15e1('0x9')](realtime,email)[_0x15e1('0x6')](function(_0x50b131){return initRealtime();})[_0x15e1('0x6')](function(_0x1f6355){return db[_0x15e1('0xa')][_0x15e1('0xb')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0x15e1('0x6')](function(_0x3cc7d8){return setInterval(initRealtime,_0x3cc7d8[_0x15e1('0xc')]*0x3e8);})['catch'](function(_0x3e0319){console[_0x15e1('0xd')](_0x3e0319);});}main(); \ No newline at end of file +var _0x4491=['./realtime','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','mailAccounts','listen','findOne','loginMailFrequency','log','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4491,0x1bb));var _0x1449=function(_0x48b50d,_0x5088a8){_0x48b50d=_0x48b50d-0x0;var _0x41c519=_0x4491[_0x48b50d];return _0x41c519;};'use strict';var BPromise=require(_0x1449('0x0'));var server=require('./server');var Realtime=require(_0x1449('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x1449('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x1449('0x3'))['db'];function initRealtime(){return BPromise[_0x1449('0x4')]()[_0x1449('0x5')](mailAccount[_0x1449('0x6')]())[_0x1449('0x5')](realtime['initMailAccounts']())[_0x1449('0x5')](function(){email['refresh'](realtime[_0x1449('0x7')]);return realtime;});}function main(){return server[_0x1449('0x8')](realtime,email)[_0x1449('0x5')](function(_0x2f4189){return initRealtime();})[_0x1449('0x5')](function(_0x3bc237){return db['Setting'][_0x1449('0x9')]({'attributes':['id',_0x1449('0xa')],'raw':!![]});})['then'](function(_0x3c48ee){return setInterval(initRealtime,_0x3c48ee[_0x1449('0xa')]*0x3e8);})['catch'](function(_0xea457e){console[_0x1449('0xb')](_0xea457e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 7f11a33..84e1a87 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 _0x7564=['imapAccounts','smtp','emit','name','key','active','Imap','messageStatus','total','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','isNil','status','disabled','connected','messages','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','email','redis','defaults','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts'];(function(_0x594b5f,_0x11d8ea){var _0x4b4704=function(_0x4aa1c4){while(--_0x4aa1c4){_0x594b5f['push'](_0x594b5f['shift']());}};_0x4b4704(++_0x11d8ea);}(_0x7564,0xbb));var _0x4756=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x7564[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x4756('0x0'));var moment=require(_0x4756('0x1'));var BPromise=require(_0x4756('0x2'));var md5=require(_0x4756('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x4756('0x4'));config[_0x4756('0x5')]=_[_0x4756('0x6')](config[_0x4756('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x4756('0x7'))(new Redis(config[_0x4756('0x5')]));var EmailImap=require(_0x4756('0x8'));var EmailSmtp=require(_0x4756('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4bb641){logger[_0x4756('0xa')](_0x4756('0xb'));this[_0x4756('0xc')]=_0x4bb641['mailAccounts'];this[_0x4756('0xd')]={};this[_0x4756('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0x4756('0xf')]=function(_0x3b6031){var _0x393d5c=this['mailAccounts'][_0x3b6031];var _0x4e6950={'id':_0x393d5c['id'],'name':_0x393d5c[_0x4756('0x10')],'key':_0x393d5c[_0x4756('0x11')],'active':_0x393d5c[_0x4756('0x12')],'Imap':{'status':_0x393d5c['Imap']['status'],'messageStatus':_0x393d5c[_0x4756('0x13')][_0x4756('0x14')],'total':_0x393d5c[_0x4756('0x13')][_0x4756('0x15')]}};if(_['isNil'](md5Accounts[_0x3b6031])){md5Accounts[_0x3b6031]={};}var _0x40af69=md5(JSON[_0x4756('0x16')](_0x4e6950));if(md5Accounts[_0x3b6031][_0x4756('0x3')]!==_0x40af69){md5Accounts[_0x3b6031][_0x4756('0x3')]=_0x40af69;io[_0x4756('0xf')](_0x4756('0x17'),_0x4e6950);}};EmailChannel[_0x4756('0x18')][_0x4756('0x19')]=function(_0x5d1346){for(var _0x49eb6a in _0x5d1346){if(_0x5d1346[_0x4756('0x1a')](_0x49eb6a)){if(_0x5d1346[_0x49eb6a]['Imap']&&_0x5d1346[_0x49eb6a][_0x4756('0x12')]){var _0x198db0=_0x5d1346[_0x49eb6a][_0x4756('0x13')];if(!this[_0x4756('0xd')][_0x4756('0x1a')](_0x198db0['id'])){this[_0x4756('0xd')][_0x198db0['id']]=new EmailImap(_0x198db0,_0x5d1346[_0x49eb6a]['email']);this['imapAccounts'][_0x198db0['id']]['on'](_0x4756('0x1b'),this[_0x4756('0x1c')][_0x4756('0x1d')](this,_0x49eb6a));this[_0x4756('0xd')][_0x198db0['id']]['on']('email',this[_0x4756('0x1e')][_0x4756('0x1d')](this,_0x49eb6a));this[_0x4756('0xd')][_0x198db0['id']]['on']('end',this[_0x4756('0x1f')][_0x4756('0x1d')](this,_0x49eb6a));this['imapAccounts'][_0x198db0['id']]['on'](_0x4756('0x20'),this['handleImapError']['bind'](this,_0x49eb6a));}}else{if(_[_0x4756('0x21')](this['mailAccounts'][_0x49eb6a][_0x4756('0x13')])){this['mailAccounts'][_0x49eb6a][_0x4756('0x13')]={};}this[_0x4756('0xc')][_0x49eb6a]['Imap'][_0x4756('0x22')]=_0x4756('0x23');this[_0x4756('0xc')][_0x49eb6a]['Imap'][_0x4756('0x14')]='';this[_0x4756('0xf')](_0x49eb6a);}}}};EmailChannel[_0x4756('0x18')]['handleImapBox']=function(_0x435a73,_0x568986){if(this[_0x4756('0xc')][_0x435a73]){this['mailAccounts'][_0x435a73]['Imap'][_0x4756('0x22')]=_0x4756('0x24');this[_0x4756('0xc')][_0x435a73][_0x4756('0x13')][_0x4756('0x14')]=_0x568986[_0x4756('0x10')];if(_0x568986[_0x4756('0x25')]){this[_0x4756('0xc')][_0x435a73][_0x4756('0x13')]['total']=_0x568986['messages']['total'];}return this['emit'](_0x435a73);}};EmailChannel[_0x4756('0x18')][_0x4756('0x1e')]=function(_0x2fd180,_0x118893){logger[_0x4756('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x118893['firstName'],_0x118893[_0x4756('0x26')],_0x118893['from'],_0x2fd180);if(this[_0x4756('0xc')][_0x2fd180]){return mailAccount[_0x4756('0x27')](_0x2fd180,_0x118893)[_0x4756('0x28')](function(_0x562387){if(_0x562387){logger['info'](_0x4756('0x29'));}})[_0x4756('0x2a')](function(_0x50d250){logger[_0x4756('0x20')](_0x4756('0x2b'),JSON['stringify'](_0x50d250));});}};EmailChannel[_0x4756('0x18')][_0x4756('0x1f')]=function(_0x2bfbc1){if(this[_0x4756('0xc')][_0x2bfbc1]&&this[_0x4756('0xc')][_0x2bfbc1]['Imap']){if(this[_0x4756('0xd')][this[_0x4756('0xc')][_0x2bfbc1]['Imap']['id']]){delete this[_0x4756('0xd')][this[_0x4756('0xc')][_0x2bfbc1][_0x4756('0x13')]['id']];}this[_0x4756('0xc')][_0x2bfbc1][_0x4756('0x13')][_0x4756('0x2c')]=moment();this[_0x4756('0xf')](_0x2bfbc1);}};EmailChannel[_0x4756('0x18')]['handleImapError']=function(_0x16aa28,_0x401072){if(this['mailAccounts'][_0x16aa28]){this[_0x4756('0xc')][_0x16aa28]['Imap'][_0x4756('0x22')]='error';this[_0x4756('0xc')][_0x16aa28][_0x4756('0x13')]['messageStatus']=_0x401072;return this[_0x4756('0xf')](_0x16aa28);}};EmailChannel['prototype']['sendMail']=function(_0xef7c0f,_0x318e45){return this['smtp'][_0x4756('0x2d')](_0xef7c0f,_0x318e45);};EmailChannel['prototype'][_0x4756('0x2e')]=function(_0x366559){var _0x34d43f=this;if(this['mailAccounts'][_0x366559['id']]){if(_['isNil'](this['mailAccounts'][_0x366559['id']]['Smtp'])){this[_0x4756('0xc')][_0x366559['id']][_0x4756('0x2f')]={};}this[_0x4756('0xc')][_0x366559['id']][_0x4756('0x2f')][_0x4756('0x2c')]=moment();return new BPromise(function(_0x19e71f,_0x2b8624){return _0x34d43f[_0x4756('0xe')][_0x4756('0x30')](_0x366559)[_0x4756('0x28')](function(_0x10348d){_0x34d43f['mailAccounts'][_0x366559['id']]['Smtp'][_0x4756('0x22')]='verified';_0x34d43f[_0x4756('0xc')][_0x366559['id']][_0x4756('0x2f')]['messageStatus']='';_0x34d43f[_0x4756('0xf')](_0x366559['id']);_0x19e71f(_0x10348d);})[_0x4756('0x2a')](function(_0x38d896){_0x34d43f['mailAccounts'][_0x366559['id']][_0x4756('0x2f')]['status']=_0x4756('0x20');_0x34d43f[_0x4756('0xc')][_0x366559['id']][_0x4756('0x2f')]['messageStatus']=_0x38d896;_0x34d43f[_0x4756('0xf')](_0x366559['id']);_0x2b8624(_0x38d896);});});}return this['smtp'][_0x4756('0x30')](_0x366559);};module[_0x4756('0x31')]=EmailChannel; \ No newline at end of file +var _0x5100=['md5','ioredis','../../../config/environment','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','box','handleImapBox','bind','handleImapEnd','error','disabled','connected','messages','handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','smtp','send','verifySmtp','Smtp','lastSync','verify','then','verified','moment'];(function(_0x333818,_0x28e5fb){var _0x2a595c=function(_0xbfc459){while(--_0xbfc459){_0x333818['push'](_0x333818['shift']());}};_0x2a595c(++_0x28e5fb);}(_0x5100,0x9e));var _0x0510=function(_0x4ec9b5,_0x1acc65){_0x4ec9b5=_0x4ec9b5-0x0;var _0x5e8bbd=_0x5100[_0x4ec9b5];return _0x5e8bbd;};'use strict';var _=require('lodash');var moment=require(_0x0510('0x0'));var BPromise=require('bluebird');var md5=require(_0x0510('0x1'));var Redis=require(_0x0510('0x2'));var config=require(_0x0510('0x3'));var logger=require('../../../config/logger')(_0x0510('0x4'));config['redis']=_[_0x0510('0x5')](config[_0x0510('0x6')],{'host':_0x0510('0x7'),'port':0x18eb});var io=require(_0x0510('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x0510('0x9'));var EmailSmtp=require(_0x0510('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3472e3){logger['info'](_0x0510('0xb'));this[_0x0510('0xc')]=_0x3472e3[_0x0510('0xc')];this[_0x0510('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x0510('0xe')][_0x0510('0xf')]=function(_0x5cf6e2){var _0x5cc671=this[_0x0510('0xc')][_0x5cf6e2];var _0x374a1b={'id':_0x5cc671['id'],'name':_0x5cc671[_0x0510('0x10')],'key':_0x5cc671[_0x0510('0x11')],'active':_0x5cc671[_0x0510('0x12')],'Imap':{'status':_0x5cc671[_0x0510('0x13')][_0x0510('0x14')],'messageStatus':_0x5cc671[_0x0510('0x13')][_0x0510('0x15')],'total':_0x5cc671[_0x0510('0x13')][_0x0510('0x16')]}};if(_[_0x0510('0x17')](md5Accounts[_0x5cf6e2])){md5Accounts[_0x5cf6e2]={};}var _0xb48914=md5(JSON[_0x0510('0x18')](_0x374a1b));if(md5Accounts[_0x5cf6e2][_0x0510('0x1')]!==_0xb48914){md5Accounts[_0x5cf6e2][_0x0510('0x1')]=_0xb48914;io[_0x0510('0xf')](_0x0510('0x19'),_0x374a1b);}};EmailChannel[_0x0510('0xe')][_0x0510('0x1a')]=function(_0x3d3023){for(var _0x3f994f in _0x3d3023){if(_0x3d3023['hasOwnProperty'](_0x3f994f)){if(_0x3d3023[_0x3f994f]['Imap']&&_0x3d3023[_0x3f994f][_0x0510('0x12')]){var _0x5f3eb5=_0x3d3023[_0x3f994f]['Imap'];if(!this[_0x0510('0xd')]['hasOwnProperty'](_0x5f3eb5['id'])){this[_0x0510('0xd')][_0x5f3eb5['id']]=new EmailImap(_0x5f3eb5,_0x3d3023[_0x3f994f][_0x0510('0x4')]);this[_0x0510('0xd')][_0x5f3eb5['id']]['on'](_0x0510('0x1b'),this[_0x0510('0x1c')][_0x0510('0x1d')](this,_0x3f994f));this[_0x0510('0xd')][_0x5f3eb5['id']]['on'](_0x0510('0x4'),this['handleImapEmail'][_0x0510('0x1d')](this,_0x3f994f));this[_0x0510('0xd')][_0x5f3eb5['id']]['on']('end',this[_0x0510('0x1e')][_0x0510('0x1d')](this,_0x3f994f));this[_0x0510('0xd')][_0x5f3eb5['id']]['on'](_0x0510('0x1f'),this['handleImapError'][_0x0510('0x1d')](this,_0x3f994f));}}else{if(_[_0x0510('0x17')](this[_0x0510('0xc')][_0x3f994f][_0x0510('0x13')])){this[_0x0510('0xc')][_0x3f994f]['Imap']={};}this['mailAccounts'][_0x3f994f][_0x0510('0x13')][_0x0510('0x14')]=_0x0510('0x20');this[_0x0510('0xc')][_0x3f994f][_0x0510('0x13')][_0x0510('0x15')]='';this[_0x0510('0xf')](_0x3f994f);}}}};EmailChannel[_0x0510('0xe')][_0x0510('0x1c')]=function(_0x54835e,_0x2cf0e3){if(this[_0x0510('0xc')][_0x54835e]){this['mailAccounts'][_0x54835e]['Imap'][_0x0510('0x14')]=_0x0510('0x21');this[_0x0510('0xc')][_0x54835e]['Imap'][_0x0510('0x15')]=_0x2cf0e3[_0x0510('0x10')];if(_0x2cf0e3[_0x0510('0x22')]){this[_0x0510('0xc')][_0x54835e][_0x0510('0x13')][_0x0510('0x16')]=_0x2cf0e3[_0x0510('0x22')][_0x0510('0x16')];}return this['emit'](_0x54835e);}};EmailChannel['prototype'][_0x0510('0x23')]=function(_0x413209,_0x47d809){logger[_0x0510('0x24')](_0x0510('0x25'),_0x47d809[_0x0510('0x26')],_0x47d809[_0x0510('0x27')],_0x47d809['from'],_0x413209);if(this['mailAccounts'][_0x413209]){return mailAccount[_0x0510('0x28')](_0x413209,_0x47d809)['then'](function(_0x3e0d1c){if(_0x3e0d1c){logger[_0x0510('0x24')](_0x0510('0x29'));}})[_0x0510('0x2a')](function(_0x3bbd3c){logger['error'](_0x0510('0x2b'),JSON[_0x0510('0x18')](_0x3bbd3c));});}};EmailChannel[_0x0510('0xe')][_0x0510('0x1e')]=function(_0x326cfb){if(this['mailAccounts'][_0x326cfb]&&this['mailAccounts'][_0x326cfb][_0x0510('0x13')]){if(this[_0x0510('0xd')][this[_0x0510('0xc')][_0x326cfb][_0x0510('0x13')]['id']]){delete this[_0x0510('0xd')][this[_0x0510('0xc')][_0x326cfb][_0x0510('0x13')]['id']];}this[_0x0510('0xc')][_0x326cfb]['Imap']['lastSync']=moment();this[_0x0510('0xf')](_0x326cfb);}};EmailChannel['prototype']['handleImapError']=function(_0x294c4b,_0x7fc010){if(this[_0x0510('0xc')][_0x294c4b]){this[_0x0510('0xc')][_0x294c4b][_0x0510('0x13')][_0x0510('0x14')]=_0x0510('0x1f');this[_0x0510('0xc')][_0x294c4b][_0x0510('0x13')][_0x0510('0x15')]=_0x7fc010;return this[_0x0510('0xf')](_0x294c4b);}};EmailChannel[_0x0510('0xe')][_0x0510('0x2c')]=function(_0x26f139,_0x363982){return this[_0x0510('0x2d')][_0x0510('0x2e')](_0x26f139,_0x363982);};EmailChannel['prototype'][_0x0510('0x2f')]=function(_0x5497e5){var _0x41bc8e=this;if(this['mailAccounts'][_0x5497e5['id']]){if(_['isNil'](this['mailAccounts'][_0x5497e5['id']]['Smtp'])){this['mailAccounts'][_0x5497e5['id']][_0x0510('0x30')]={};}this[_0x0510('0xc')][_0x5497e5['id']][_0x0510('0x30')][_0x0510('0x31')]=moment();return new BPromise(function(_0x543252,_0x260b09){return _0x41bc8e[_0x0510('0x2d')][_0x0510('0x32')](_0x5497e5)[_0x0510('0x33')](function(_0x49f2a2){_0x41bc8e['mailAccounts'][_0x5497e5['id']][_0x0510('0x30')][_0x0510('0x14')]=_0x0510('0x34');_0x41bc8e[_0x0510('0xc')][_0x5497e5['id']][_0x0510('0x30')][_0x0510('0x15')]='';_0x41bc8e['emit'](_0x5497e5['id']);_0x543252(_0x49f2a2);})['catch'](function(_0x5a3979){_0x41bc8e['mailAccounts'][_0x5497e5['id']][_0x0510('0x30')][_0x0510('0x14')]='error';_0x41bc8e['mailAccounts'][_0x5497e5['id']][_0x0510('0x30')]['messageStatus']=_0x5a3979;_0x41bc8e[_0x0510('0xf')](_0x5497e5['id']);_0x260b09(_0x5a3979);});});}return this[_0x0510('0x2d')][_0x0510('0x32')](_0x5497e5);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b9e825c..fd245c2 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 _0x3468=['textCode','upperFirst','path','util','imap','mailparser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','required','user','getHost','openBox','handleOpenBox','emit','box','handleCloseBox','prototype','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','email','account','stringify'];(function(_0xe5cd91,_0x489160){var _0x59bf4e=function(_0x1d2207){while(--_0x1d2207){_0xe5cd91['push'](_0xe5cd91['shift']());}};_0x59bf4e(++_0x489160);}(_0x3468,0xb6));var _0x8346=function(_0xaadba3,_0x2e8165){_0xaadba3=_0xaadba3-0x0;var _0x20a09c=_0x3468[_0xaadba3];return _0x20a09c;};'use strict';var fs=require('fs');var path=require(_0x8346('0x0'));var util=require(_0x8346('0x1'));var Imap=require(_0x8346('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x8346('0x3'))['simpleParser'];var Iconv=require(_0x8346('0x4'))[_0x8346('0x5')];var EventEmitter=require(_0x8346('0x6'))[_0x8346('0x7')];var utils=require('./utils');var logger=require(_0x8346('0x8'))('email');function EmailImap(_0x3d2115,_0xcd2995){this[_0x8346('0x9')]='INBOX';this['account']=this[_0x8346('0xa')](_0x3d2115,_0xcd2995);this[_0x8346('0x2')]=new Imap(this['account']);this[_0x8346('0x2')][_0x8346('0xb')](_0x8346('0xc'),this[_0x8346('0xd')][_0x8346('0xe')](this));this[_0x8346('0x2')][_0x8346('0xb')](_0x8346('0xf'),this[_0x8346('0x10')][_0x8346('0xe')](this));this['imap']['on'](_0x8346('0x11'),this[_0x8346('0x12')][_0x8346('0xe')](this));this[_0x8346('0x2')][_0x8346('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x8346('0xa')]=function(_0x3b6e1e,_0xe15cf9){var _0x485ca6={'connTimeout':_0x3b6e1e[_0x8346('0x14')]?_0x3b6e1e[_0x8346('0x14')]*0x3e8:0x2710,'authTimeout':_0x3b6e1e[_0x8346('0x15')]?_0x3b6e1e[_0x8346('0x15')]*0x3e8:0x1388};if(_[_0x8346('0x16')](_0x3b6e1e[_0x8346('0x17')])){if(_0x3b6e1e[_0x8346('0x18')]){_0x485ca6['user']=_0x3b6e1e['user'];_0x485ca6['password']=_0x3b6e1e[_0x8346('0x19')];}_0x485ca6['host']=_0x3b6e1e[_0x8346('0x1a')];_0x485ca6['port']=_0x3b6e1e[_0x8346('0x1b')]||0x3e1;if(_0x3b6e1e['tls']){_0x485ca6[_0x8346('0x1c')]=!![];}else{_0x485ca6[_0x8346('0x1c')]=![];_0x485ca6['autotls']=_0x8346('0x1d');}}else{_0x485ca6[_0x8346('0x1e')]=_0x3b6e1e[_0x8346('0x1e')];_0x485ca6['password']=_0x3b6e1e['password'];_0x485ca6[_0x8346('0x1a')]=utils[_0x8346('0x1f')](_0x3b6e1e[_0x8346('0x17')]);_0x485ca6[_0x8346('0x1b')]=0x3e1;_0x485ca6['tls']=!![];}_0x485ca6['email']=_0xe15cf9||_0x3b6e1e['user']||'anonymous@xcally.com';return _0x485ca6;};EmailImap['prototype'][_0x8346('0xd')]=function(){this[_0x8346('0x2')][_0x8346('0x20')](this[_0x8346('0x9')],![],this[_0x8346('0x21')][_0x8346('0xe')](this));};EmailImap['prototype'][_0x8346('0x21')]=function(_0x545fde,_0x41e180){if(_0x545fde){this[_0x8346('0x12')](_0x545fde,!![]);}else{this[_0x8346('0x22')](_0x8346('0x23'),_0x41e180);this['readUnseen']();}};EmailImap['prototype'][_0x8346('0x24')]=function(_0x37af45){if(_0x37af45){this[_0x8346('0x12')](_0x37af45,!![]);}else{this['imap'][_0x8346('0xf')]();}};EmailImap[_0x8346('0x25')]['readUnseen']=function(){this['imap'][_0x8346('0x26')]([_0x8346('0x27')],this[_0x8346('0x28')][_0x8346('0xe')](this));};EmailImap[_0x8346('0x25')][_0x8346('0x28')]=function(_0x2c7f7b,_0x1d3394){if(_0x2c7f7b){this[_0x8346('0x12')](_0x2c7f7b,!![]);}else{if(_0x1d3394[_0x8346('0x29')]){try{var _0x492ce8=this[_0x8346('0x2')][_0x8346('0x2a')](_0x1d3394,{'bodies':'','markSeen':!![]});_0x492ce8['on'](_0x8346('0x2b'),this[_0x8346('0x2c')][_0x8346('0xe')](this));_0x492ce8[_0x8346('0xb')](_0x8346('0x11'),this[_0x8346('0x2d')][_0x8346('0xe')](this));_0x492ce8[_0x8346('0xb')](_0x8346('0xf'),this[_0x8346('0x2e')][_0x8346('0xe')](this));}catch(_0x2929c8){logger['error'](_0x2929c8);}}else{this[_0x8346('0x2')][_0x8346('0x2f')](!![],this[_0x8346('0x24')][_0x8346('0xe')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x2678fa,_0x53149c){_0x2678fa['on'](_0x8346('0x30'),this[_0x8346('0x31')][_0x8346('0xe')](this));_0x2678fa[_0x8346('0xb')](_0x8346('0x32'),this[_0x8346('0x33')]['bind'](this));_0x2678fa[_0x8346('0xb')](_0x8346('0xf'),this[_0x8346('0x34')][_0x8346('0xe')](this));};EmailImap[_0x8346('0x25')][_0x8346('0x31')]=function(_0x27e2d5,_0x5a1dd5){simpleParser(_0x27e2d5,{'Iconv':Iconv},this['handleSimpleParser'][_0x8346('0xe')](this));};EmailImap[_0x8346('0x25')][_0x8346('0x33')]=function(_0x5650a9){};EmailImap['prototype'][_0x8346('0x34')]=function(){};EmailImap[_0x8346('0x25')][_0x8346('0x35')]=function(_0xebd9d5,_0x5e204a){if(_0xebd9d5){logger[_0x8346('0x11')](_0xebd9d5);}else{var _0x133603=this;utils[_0x8346('0x36')](this['account'],_0x5e204a,function(_0x13449a){_0x133603[_0x8346('0x22')](_0x8346('0x37'),_0x13449a);});}};EmailImap[_0x8346('0x25')]['handleFetchEnd']=function(){this['imap'][_0x8346('0x2f')](!![],this['handleCloseBox'][_0x8346('0xe')](this));};EmailImap['prototype'][_0x8346('0x2d')]=function(_0x3d1b2d){this[_0x8346('0x12')](_0x3d1b2d);this[_0x8346('0x2')][_0x8346('0x2f')](!![],this['handleCloseBox'][_0x8346('0xe')](this));};EmailImap[_0x8346('0x25')][_0x8346('0x10')]=function(){this['emit']('end');};EmailImap[_0x8346('0x25')]['handleError']=function(_0x2a010b,_0x2b9af2){logger[_0x8346('0x11')](_0x8346('0x12'),this[_0x8346('0x38')]['email'],JSON[_0x8346('0x39')](_0x2a010b));var _0x198609='';if(_0x2a010b){if(_0x2a010b[_0x8346('0x3a')]){_0x198609=_0x2a010b[_0x8346('0x3a')];}else{for(var _0x3995e6 in _0x2a010b){if(_0x2a010b['hasOwnProperty'](_0x3995e6)){_0x198609+=_[_0x8346('0x3b')](_0x3995e6)+':\x20'+_0x2a010b[_0x3995e6]+'\x0a';}}}}if(_0x2b9af2){this['imap'][_0x8346('0xf')]();}else{this[_0x8346('0x22')](_0x8346('0x11'),_0x198609);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0xc3d7=['tls','autotls','required','getHost','handleReady','openBox','handleOpenBox','emit','handleCloseBox','end','readUnseen','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','stringify','textCode','hasOwnProperty','upperFirst','util','imap','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','handleEnd','bind','error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port'];(function(_0x1ce988,_0x280d6d){var _0xb17d63=function(_0x596e84){while(--_0x596e84){_0x1ce988['push'](_0x1ce988['shift']());}};_0xb17d63(++_0x280d6d);}(_0xc3d7,0xcd));var _0x7c3d=function(_0x25890d,_0x5670e5){_0x25890d=_0x25890d-0x0;var _0x19683e=_0xc3d7[_0x25890d];return _0x19683e;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x7c3d('0x0'));var Imap=require(_0x7c3d('0x1'));var _=require('lodash');var rs=require(_0x7c3d('0x2'));var simpleParser=require(_0x7c3d('0x3'))[_0x7c3d('0x4')];var Iconv=require(_0x7c3d('0x5'))[_0x7c3d('0x6')];var EventEmitter=require(_0x7c3d('0x7'))[_0x7c3d('0x8')];var utils=require(_0x7c3d('0x9'));var logger=require(_0x7c3d('0xa'))(_0x7c3d('0xb'));function EmailImap(_0x1b1285,_0x196dff){this[_0x7c3d('0xc')]=_0x7c3d('0xd');this['account']=this[_0x7c3d('0xe')](_0x1b1285,_0x196dff);this[_0x7c3d('0x1')]=new Imap(this[_0x7c3d('0xf')]);this[_0x7c3d('0x1')][_0x7c3d('0x10')]('ready',this['handleReady']['bind'](this));this[_0x7c3d('0x1')]['once']('end',this[_0x7c3d('0x11')][_0x7c3d('0x12')](this));this['imap']['on'](_0x7c3d('0x13'),this[_0x7c3d('0x14')][_0x7c3d('0x12')](this));this[_0x7c3d('0x1')]['connect']();}util[_0x7c3d('0x15')](EmailImap,EventEmitter);EmailImap[_0x7c3d('0x16')][_0x7c3d('0xe')]=function(_0x18f50c,_0xc7b76){var _0x52d3ae={'connTimeout':_0x18f50c['connTimeout']?_0x18f50c[_0x7c3d('0x17')]*0x3e8:0x2710,'authTimeout':_0x18f50c[_0x7c3d('0x18')]?_0x18f50c[_0x7c3d('0x18')]*0x3e8:0x1388};if(_[_0x7c3d('0x19')](_0x18f50c['service'])){if(_0x18f50c[_0x7c3d('0x1a')]){_0x52d3ae[_0x7c3d('0x1b')]=_0x18f50c[_0x7c3d('0x1b')];_0x52d3ae[_0x7c3d('0x1c')]=_0x18f50c[_0x7c3d('0x1c')];}_0x52d3ae['host']=_0x18f50c[_0x7c3d('0x1d')];_0x52d3ae[_0x7c3d('0x1e')]=_0x18f50c[_0x7c3d('0x1e')]||0x3e1;if(_0x18f50c[_0x7c3d('0x1f')]){_0x52d3ae[_0x7c3d('0x1f')]=!![];}else{_0x52d3ae[_0x7c3d('0x1f')]=![];_0x52d3ae[_0x7c3d('0x20')]=_0x7c3d('0x21');}}else{_0x52d3ae[_0x7c3d('0x1b')]=_0x18f50c[_0x7c3d('0x1b')];_0x52d3ae[_0x7c3d('0x1c')]=_0x18f50c['password'];_0x52d3ae['host']=utils[_0x7c3d('0x22')](_0x18f50c['service']);_0x52d3ae['port']=0x3e1;_0x52d3ae[_0x7c3d('0x1f')]=!![];}_0x52d3ae['email']=_0xc7b76||_0x18f50c[_0x7c3d('0x1b')]||'anonymous@xcally.com';return _0x52d3ae;};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x23')]=function(){this[_0x7c3d('0x1')][_0x7c3d('0x24')](this['mailbox'],![],this[_0x7c3d('0x25')][_0x7c3d('0x12')](this));};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x25')]=function(_0x2df4e3,_0x8bc4f7){if(_0x2df4e3){this[_0x7c3d('0x14')](_0x2df4e3,!![]);}else{this[_0x7c3d('0x26')]('box',_0x8bc4f7);this['readUnseen']();}};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x27')]=function(_0x21424d){if(_0x21424d){this[_0x7c3d('0x14')](_0x21424d,!![]);}else{this['imap'][_0x7c3d('0x28')]();}};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x29')]=function(){this[_0x7c3d('0x1')]['search'](['UNSEEN'],this[_0x7c3d('0x2a')][_0x7c3d('0x12')](this));};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x2a')]=function(_0x5c6d0c,_0xe90ccf){if(_0x5c6d0c){this['handleError'](_0x5c6d0c,!![]);}else{if(_0xe90ccf[_0x7c3d('0x2b')]){try{var _0x5dd8d5=this[_0x7c3d('0x1')][_0x7c3d('0x2c')](_0xe90ccf,{'bodies':'','markSeen':!![]});_0x5dd8d5['on'](_0x7c3d('0x2d'),this[_0x7c3d('0x2e')]['bind'](this));_0x5dd8d5[_0x7c3d('0x10')](_0x7c3d('0x13'),this[_0x7c3d('0x2f')]['bind'](this));_0x5dd8d5[_0x7c3d('0x10')](_0x7c3d('0x28'),this[_0x7c3d('0x30')][_0x7c3d('0x12')](this));}catch(_0x224b8d){logger[_0x7c3d('0x13')](_0x224b8d);}}else{this[_0x7c3d('0x1')][_0x7c3d('0x31')](!![],this[_0x7c3d('0x27')][_0x7c3d('0x12')](this));}}};EmailImap[_0x7c3d('0x16')]['handleFetchMessage']=function(_0x2c1025,_0x336c6b){_0x2c1025['on'](_0x7c3d('0x32'),this[_0x7c3d('0x33')]['bind'](this));_0x2c1025[_0x7c3d('0x10')]('attributes',this[_0x7c3d('0x34')][_0x7c3d('0x12')](this));_0x2c1025[_0x7c3d('0x10')]('end',this[_0x7c3d('0x35')]['bind'](this));};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x33')]=function(_0x3ea702,_0x4e8c69){simpleParser(_0x3ea702,{'Iconv':Iconv},this[_0x7c3d('0x36')][_0x7c3d('0x12')](this));};EmailImap[_0x7c3d('0x16')]['handleMessageAttributes']=function(_0x5cdf4b){};EmailImap[_0x7c3d('0x16')]['handleMessageEnd']=function(){};EmailImap[_0x7c3d('0x16')]['handleSimpleParser']=function(_0x22d96e,_0x22f3d1){if(_0x22d96e){logger[_0x7c3d('0x13')](_0x22d96e);}else{var _0x551be7=this;utils['parser'](this[_0x7c3d('0xf')],_0x22f3d1,function(_0x1ebc5e){_0x551be7['emit'](_0x7c3d('0xb'),_0x1ebc5e);});}};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x30')]=function(){this[_0x7c3d('0x1')][_0x7c3d('0x31')](!![],this[_0x7c3d('0x27')]['bind'](this));};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x2f')]=function(_0x3ece5f){this[_0x7c3d('0x14')](_0x3ece5f);this[_0x7c3d('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x7c3d('0x12')](this));};EmailImap['prototype'][_0x7c3d('0x11')]=function(){this[_0x7c3d('0x26')](_0x7c3d('0x28'));};EmailImap[_0x7c3d('0x16')][_0x7c3d('0x14')]=function(_0x20502b,_0x2ec6e7){logger[_0x7c3d('0x13')]('handleError',this[_0x7c3d('0xf')][_0x7c3d('0xb')],JSON[_0x7c3d('0x37')](_0x20502b));var _0xd5945b='';if(_0x20502b){if(_0x20502b[_0x7c3d('0x38')]){_0xd5945b=_0x20502b[_0x7c3d('0x38')];}else{for(var _0x4bc9d3 in _0x20502b){if(_0x20502b[_0x7c3d('0x39')](_0x4bc9d3)){_0xd5945b+=_[_0x7c3d('0x3a')](_0x4bc9d3)+':\x20'+_0x20502b[_0x4bc9d3]+'\x0a';}}}}if(_0x2ec6e7){this[_0x7c3d('0x1')][_0x7c3d('0x28')]();}else{this['emit'](_0x7c3d('0x13'),_0xd5945b);this[_0x7c3d('0x26')](_0x7c3d('0x28'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index eec6389..7c2c307 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 _0xc98f=['nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','verify','toString','Not\x20verifired','nodemailer'];(function(_0x1fdded,_0x278992){var _0x333e49=function(_0x173cf7){while(--_0x173cf7){_0x1fdded['push'](_0x1fdded['shift']());}};_0x333e49(++_0x278992);}(_0xc98f,0x8b));var _0xfc98=function(_0x188bf2,_0x3de2ab){_0x188bf2=_0x188bf2-0x0;var _0x59cdb0=_0xc98f[_0x188bf2];return _0x59cdb0;};'use strict';var nodemailer=require(_0xfc98('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xfc98('0x1'));function EmailSmtp(){}EmailSmtp[_0xfc98('0x2')][_0xfc98('0x3')]=function(_0x543e84,_0x3cf98e){return new BPromise(function(_0x6e40a2,_0x4f1d1d){var _0x5046be=nodemailer[_0xfc98('0x4')](_0x543e84);_0x5046be['use'](_0xfc98('0x5'),inlineBase64());_0x5046be[_0xfc98('0x6')](_0x3cf98e,function(_0x40a0ca,_0x4dad37){if(_0x40a0ca){_0x4f1d1d(_0x40a0ca['toString']());}else{_0x6e40a2(_0x4dad37);}});});};EmailSmtp[_0xfc98('0x2')][_0xfc98('0x7')]=function(_0x423da7){return new BPromise(function(_0x522e93,_0x23506a){var _0x1c197d=nodemailer[_0xfc98('0x4')](_0x423da7);_0x1c197d[_0xfc98('0x7')](function(_0x508c38,_0x2ef93d){if(_0x508c38){_0x23506a(_0x508c38[_0xfc98('0x8')]());}else{if(_0x2ef93d){_0x522e93(_0x2ef93d);}else{_0x23506a(_0xfc98('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xee26=['createTransport','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','compile','sendMail','toString','verify'];(function(_0x27182c,_0x1dfe48){var _0x8c9874=function(_0x53556b){while(--_0x53556b){_0x27182c['push'](_0x27182c['shift']());}};_0x8c9874(++_0x1dfe48);}(_0xee26,0x1ce));var _0x6ee2=function(_0x510393,_0x44f011){_0x510393=_0x510393-0x0;var _0x562049=_0xee26[_0x510393];return _0x562049;};'use strict';var nodemailer=require(_0x6ee2('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x6ee2('0x1'));function EmailSmtp(){}EmailSmtp[_0x6ee2('0x2')][_0x6ee2('0x3')]=function(_0x5f2e7e,_0x3918bd){return new BPromise(function(_0x23f9fd,_0x14c780){var _0x819528=nodemailer['createTransport'](_0x5f2e7e);_0x819528['use'](_0x6ee2('0x4'),inlineBase64());_0x819528[_0x6ee2('0x5')](_0x3918bd,function(_0x137921,_0x5c75d7){if(_0x137921){_0x14c780(_0x137921[_0x6ee2('0x6')]());}else{_0x23f9fd(_0x5c75d7);}});});};EmailSmtp[_0x6ee2('0x2')][_0x6ee2('0x7')]=function(_0x5f3ae5){return new BPromise(function(_0x2a81d7,_0x375139){var _0x40b78d=nodemailer[_0x6ee2('0x8')](_0x5f3ae5);_0x40b78d[_0x6ee2('0x7')](function(_0x8ab0cc,_0x1082b6){if(_0x8ab0cc){_0x375139(_0x8ab0cc[_0x6ee2('0x6')]());}else{if(_0x1082b6){_0x2a81d7(_0x1082b6);}else{_0x375139(_0x6ee2('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e862633..0088746 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 _0x28bc=['127.0.0.1','lodash','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','split','slice','Anonymous','length','pop','html','test','replace','body','textAsHtml','Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com'];(function(_0x596b69,_0x5e2869){var _0x1095b2=function(_0xaa07e2){while(--_0xaa07e2){_0x596b69['push'](_0x596b69['shift']());}};_0x1095b2(++_0x5e2869);}(_0x28bc,0x79));var _0xc28b=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x28bc[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xc28b('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require('util');var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xc28b('0x1'));var config=require(_0xc28b('0x2'));function getAddress(_0x2d424e){var _0x4d6954=_['head'](_0x2d424e[_0xc28b('0x3')]);return _0x4d6954&&_0x4d6954[_0xc28b('0x4')]?_0x4d6954[_0xc28b('0x4')]:_0xc28b('0x5')+random[_0xc28b('0x6')](0x6)+_0xc28b('0x7');}function getFirstName(_0x443b64){var _0x45c7b4=_[_0xc28b('0x8')](_0x443b64[_0xc28b('0x3')]);if(_0x45c7b4&&_0x45c7b4[_0xc28b('0x9')]){var _0x2dc32d=_0x45c7b4['name'][_0xc28b('0xa')](/\s+/);return _0x2dc32d['length']?_0x2dc32d[_0xc28b('0xb')](0x0,-0x1)['join']('\x20'):_0x45c7b4[_0xc28b('0x9')];}return _0xc28b('0xc');}function getLastName(_0x47fee9){var _0x213f13=_[_0xc28b('0x8')](_0x47fee9[_0xc28b('0x3')]);if(_0x213f13&&_0x213f13['name']){var _0x2ffe05=_0x213f13['name'][_0xc28b('0xa')](/\s+/);return _0x2ffe05[_0xc28b('0xd')]>0x1?_0x2ffe05[_0xc28b('0xe')]():'';}return'';}function getMails(_0x1fdadc,_0x20f69e){var _0x545d49='';for(var _0x3244a7=0x0;_0x3244a7<_0x20f69e['value'][_0xc28b('0xd')];_0x3244a7+=0x1){if(_0x20f69e['value'][_0x3244a7]['address']!==_0x1fdadc){if(!_['isEmpty'](_0x545d49)){_0x545d49+=',';}_0x545d49+=_0x20f69e[_0xc28b('0x3')][_0x3244a7][_0xc28b('0x9')]||_0x20f69e[_0xc28b('0x3')][_0x3244a7][_0xc28b('0x4')]||'';_0x545d49+='\x20<';_0x545d49+=_0x20f69e[_0xc28b('0x3')][_0x3244a7]['address']?_0x20f69e[_0xc28b('0x3')][_0x3244a7]['address']:_0xc28b('0x5')+random['generate'](0x6)+_0xc28b('0x7');_0x545d49+='>';}}return _0x545d49;}function parseEmail(_0x593743,_0x9d0ab9,_0x411c43){if(_0x9d0ab9[_0xc28b('0xf')]){var _0x12a2b9=/)<[^<]*)*<\/script>/gi;while(_0x12a2b9[_0xc28b('0x10')](_0x9d0ab9['html'])){_0x9d0ab9[_0xc28b('0xf')]=_0x9d0ab9[_0xc28b('0xf')][_0xc28b('0x11')](_0x12a2b9,'');}_0x411c43[_0xc28b('0x12')]=_0x9d0ab9['html'];}else{_0x411c43[_0xc28b('0x12')]=_0x9d0ab9[_0xc28b('0x13')];}if(_0x411c43['body']){_0x411c43[_0xc28b('0x12')]=_0x411c43[_0xc28b('0x12')][_0xc28b('0x11')](/Empty\x20message

','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','lodash','moment','randomstring','path','../../../config/logger','email','../../../config/environment'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9b6d,0x16d));var _0xd9b6=function(_0x4bf497,_0xeb9e5b){_0x4bf497=_0x4bf497-0x0;var _0x5497cb=_0x9b6d[_0x4bf497];return _0x5497cb;};'use strict';var _=require(_0xd9b6('0x0'));var moment=require(_0xd9b6('0x1'));var random=require(_0xd9b6('0x2'));var fs=require('fs');var path=require(_0xd9b6('0x3'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xd9b6('0x4'))(_0xd9b6('0x5'));var config=require(_0xd9b6('0x6'));function getAddress(_0x5bb80f){var _0x1a03ba=_[_0xd9b6('0x7')](_0x5bb80f['value']);return _0x1a03ba&&_0x1a03ba['address']?_0x1a03ba[_0xd9b6('0x8')]:_0xd9b6('0x9')+random[_0xd9b6('0xa')](0x6)+_0xd9b6('0xb');}function getFirstName(_0x3827fb){var _0x5ebff8=_['head'](_0x3827fb[_0xd9b6('0xc')]);if(_0x5ebff8&&_0x5ebff8[_0xd9b6('0xd')]){var _0x1e7bdc=_0x5ebff8[_0xd9b6('0xd')]['split'](/\s+/);return _0x1e7bdc[_0xd9b6('0xe')]?_0x1e7bdc[_0xd9b6('0xf')](0x0,-0x1)['join']('\x20'):_0x5ebff8[_0xd9b6('0xd')];}return _0xd9b6('0x10');}function getLastName(_0x2235ce){var _0x445af4=_[_0xd9b6('0x7')](_0x2235ce[_0xd9b6('0xc')]);if(_0x445af4&&_0x445af4[_0xd9b6('0xd')]){var _0x515d94=_0x445af4[_0xd9b6('0xd')][_0xd9b6('0x11')](/\s+/);return _0x515d94['length']>0x1?_0x515d94[_0xd9b6('0x12')]():'';}return'';}function getMails(_0x20478a,_0x5f06ee){var _0x157aef='';for(var _0x3c5446=0x0;_0x3c5446<_0x5f06ee[_0xd9b6('0xc')]['length'];_0x3c5446+=0x1){if(_0x5f06ee[_0xd9b6('0xc')][_0x3c5446][_0xd9b6('0x8')]!==_0x20478a){if(!_[_0xd9b6('0x13')](_0x157aef)){_0x157aef+=',';}_0x157aef+=_0x5f06ee[_0xd9b6('0xc')][_0x3c5446][_0xd9b6('0xd')]||_0x5f06ee['value'][_0x3c5446][_0xd9b6('0x8')]||'';_0x157aef+='\x20<';_0x157aef+=_0x5f06ee[_0xd9b6('0xc')][_0x3c5446][_0xd9b6('0x8')]?_0x5f06ee[_0xd9b6('0xc')][_0x3c5446][_0xd9b6('0x8')]:'anonymous'+random[_0xd9b6('0xa')](0x6)+_0xd9b6('0xb');_0x157aef+='>';}}return _0x157aef;}function parseEmail(_0x2a1b58,_0x10eff2,_0x4a563b){if(_0x10eff2[_0xd9b6('0x14')]){var _0x2e558a=/)<[^<]*)*<\/script>/gi;while(_0x2e558a[_0xd9b6('0x15')](_0x10eff2[_0xd9b6('0x14')])){_0x10eff2['html']=_0x10eff2[_0xd9b6('0x14')]['replace'](_0x2e558a,'');}_0x4a563b[_0xd9b6('0x16')]=_0x10eff2[_0xd9b6('0x14')];}else{_0x4a563b[_0xd9b6('0x16')]=_0x10eff2[_0xd9b6('0x17')];}if(_0x4a563b[_0xd9b6('0x16')]){_0x4a563b[_0xd9b6('0x16')]=_0x4a563b[_0xd9b6('0x16')][_0xd9b6('0x18')](/Empty\x20message

';if(_0x4c1e66[_0xd9b6('0x34')]){for(var _0xc932f0=0x0;_0xc932f0<_0x4c1e66[_0xd9b6('0x34')][_0xd9b6('0xe')];_0xc932f0++){var _0x3e65da=_0x4c1e66[_0xd9b6('0x34')][_0xc932f0];_0x5821d4[_0xd9b6('0x1a')][_0xd9b6('0x1f')][_0xd9b6('0x27')]({'filename':_0x3e65da[_0xd9b6('0x35')],'content':new Buffer(_0x3e65da[_0xd9b6('0x36')])});}}}_0xce2108(parseEmail(_0xba9c58,_0xa2d96b,_0x5821d4));});}else{_0xa2d96b['html']=_0xd9b6('0x37');_0xce2108(parseEmail(_0xba9c58,_0xa2d96b,_0x5821d4));}}else{_0xce2108(parseEmail(_0xba9c58,_0xa2d96b,_0x5821d4));}};exports[_0xd9b6('0x38')]=function(_0x3f5d64){switch(_0x3f5d64){case'gmail':return _0xd9b6('0x39');case _0xd9b6('0x3a'):return _0xd9b6('0x3b');case'hotmail':return _0xd9b6('0x3c');case'outlook365':return _0xd9b6('0x3d');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index fbcbcb3..73fba97 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb07=['key','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x112e07,_0x3605ca){var _0x505787=function(_0x2f5c14){while(--_0x2f5c14){_0x112e07['push'](_0x112e07['shift']());}};_0x505787(++_0x3605ca);}(_0xdb07,0x7d));var _0x7db0=function(_0x24b5d8,_0x203128){_0x24b5d8=_0x24b5d8-0x0;var _0x54908d=_0xdb07[_0x24b5d8];return _0x54908d;};'use strict';var _=require(_0x7db0('0x0'));function MailAccount(_0x48d3e7){this['id']=_0x48d3e7['id']||0x0;this[_0x7db0('0x1')]=_0x48d3e7[_0x7db0('0x1')]||_0x7db0('0x2');this[_0x7db0('0x3')]=_0x48d3e7['key']||'SERV';this[_0x7db0('0x4')]=_0x48d3e7['active']||![];this['Imap']=_0x48d3e7[_0x7db0('0x5')]||[];this[_0x7db0('0x6')]=_0x48d3e7['Smtp']||[];}module[_0x7db0('0x7')]=MailAccount; \ No newline at end of file +var _0xde2d=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x1b75de,_0x3bb3cf){var _0xf68819=function(_0x1696a1){while(--_0x1696a1){_0x1b75de['push'](_0x1b75de['shift']());}};_0xf68819(++_0x3bb3cf);}(_0xde2d,0xfd));var _0xdde2=function(_0x32b248,_0x4e4850){_0x32b248=_0x32b248-0x0;var _0x1634c4=_0xde2d[_0x32b248];return _0x1634c4;};'use strict';var _=require(_0xdde2('0x0'));function MailAccount(_0x1e44c1){this['id']=_0x1e44c1['id']||0x0;this[_0xdde2('0x1')]=_0x1e44c1['name']||_0xdde2('0x2');this[_0xdde2('0x3')]=_0x1e44c1[_0xdde2('0x3')]||_0xdde2('0x4');this[_0xdde2('0x5')]=_0x1e44c1[_0xdde2('0x5')]||![];this['Imap']=_0x1e44c1[_0xdde2('0x6')]||[];this[_0xdde2('0x7')]=_0x1e44c1[_0xdde2('0x7')]||[];}module[_0xdde2('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index b6cfeb8..63782af 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd21b=['lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','merge','exports'];(function(_0x2b1b15,_0x3b5ec8){var _0x395892=function(_0x4295de){while(--_0x4295de){_0x2b1b15['push'](_0x2b1b15['shift']());}};_0x395892(++_0x3b5ec8);}(_0xd21b,0xf3));var _0xbd21=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0xd21b[_0x65ff6c];return _0x238215;};'use strict';var _=require(_0xbd21('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xbd21('0x1')]={};};function freeIsNotKey(_0x4a2a40,_0x418924,_0x394637){var _0x6fe503=_[_0xbd21('0x2')](_0x4a2a40,function(_0xa94ea6,_0x47b129){return _0xa94ea6[_0x394637];});for(var _0x58089e in _0x418924){if(_0x418924[_0xbd21('0x3')](_0x58089e)){if(!_0x6fe503[_0x58089e]){delete _0x418924[_0x58089e];}}}}Realtime[_0xbd21('0x4')]['mergeFromDatabase']=function(_0x553010,_0x4c9d1d){for(var _0x2a5ddd in _0x4c9d1d){if(_0x553010[_0xbd21('0x3')](_0x2a5ddd)){_0x553010[_0x2a5ddd]=_0x4c9d1d[_0x2a5ddd];}}};Realtime[_0xbd21('0x4')][_0xbd21('0x5')]=function(){var _0x5b5c2d=this;return function(_0x7dd3d2){if(_0x7dd3d2){freeIsNotKey(_0x7dd3d2,_0x5b5c2d[_0xbd21('0x1')],'id');for(var _0x8d3244=0x0,_0x59e7c5={},_0x4fad6e={};_0x8d3244<_0x7dd3d2[_0xbd21('0x6')];_0x8d3244+=0x1){_0x59e7c5=_0x7dd3d2[_0x8d3244];if(_['isUndefined'](_0x5b5c2d[_0xbd21('0x1')][_0x59e7c5['id']])){_0x5b5c2d[_0xbd21('0x1')][_0x59e7c5['id']]=new MailAccount(_0x59e7c5);}else{_[_0xbd21('0x7')](_0x5b5c2d[_0xbd21('0x1')][_0x59e7c5['id']],_0x59e7c5);}}}return _0x5b5c2d[_0xbd21('0x1')];};};module[_0xbd21('0x8')]=Realtime; \ No newline at end of file +var _0x6731=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge'];(function(_0x35795b,_0xd0b90b){var _0xfb845e=function(_0x558f83){while(--_0x558f83){_0x35795b['push'](_0x35795b['shift']());}};_0xfb845e(++_0xd0b90b);}(_0x6731,0x199));var _0x1673=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0x6731[_0x1865d4];return _0x1f0e1c;};'use strict';var _=require(_0x1673('0x0'));var MailAccount=require(_0x1673('0x1'));var Realtime=function(){this[_0x1673('0x2')]={};};function freeIsNotKey(_0xb13563,_0x30fba3,_0x4ece97){var _0x4b79af=_[_0x1673('0x3')](_0xb13563,function(_0x37bc3a,_0x58a6c1){return _0x37bc3a[_0x4ece97];});for(var _0x3a457d in _0x30fba3){if(_0x30fba3[_0x1673('0x4')](_0x3a457d)){if(!_0x4b79af[_0x3a457d]){delete _0x30fba3[_0x3a457d];}}}}Realtime[_0x1673('0x5')][_0x1673('0x6')]=function(_0x46aaee,_0x11952b){for(var _0x32c3c6 in _0x11952b){if(_0x46aaee['hasOwnProperty'](_0x32c3c6)){_0x46aaee[_0x32c3c6]=_0x11952b[_0x32c3c6];}}};Realtime[_0x1673('0x5')][_0x1673('0x7')]=function(){var _0xec2634=this;return function(_0x421f0f){if(_0x421f0f){freeIsNotKey(_0x421f0f,_0xec2634['mailAccounts'],'id');for(var _0x21f8c4=0x0,_0x513dd5={},_0x191c81={};_0x21f8c4<_0x421f0f[_0x1673('0x8')];_0x21f8c4+=0x1){_0x513dd5=_0x421f0f[_0x21f8c4];if(_[_0x1673('0x9')](_0xec2634[_0x1673('0x2')][_0x513dd5['id']])){_0xec2634[_0x1673('0x2')][_0x513dd5['id']]=new MailAccount(_0x513dd5);}else{_[_0x1673('0xa')](_0xec2634['mailAccounts'][_0x513dd5['id']],_0x513dd5);}}}return _0xec2634[_0x1673('0x2')];};};module[_0x1673('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index ebd5230..e48e16a 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7958=['Imap','MailServerOut','Smtp','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email','active','key','ListId','TemplateId'];(function(_0x1ec1e5,_0xa2d760){var _0x3de2e5=function(_0x4c6288){while(--_0x4c6288){_0x1ec1e5['push'](_0x1ec1e5['shift']());}};_0x3de2e5(++_0xa2d760);}(_0x7958,0x126));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8795('0x0'));exports[_0x8795('0x1')]=function(){return function(){return client['Request'](_0x8795('0x2'),{'options':{'attributes':['id',_0x8795('0x3'),_0x8795('0x4'),_0x8795('0x5'),_0x8795('0x6'),_0x8795('0x7'),_0x8795('0x8'),_0x8795('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0x8795('0xa')},{'model':_0x8795('0xb'),'as':_0x8795('0xc')}]},'log':'getMailAccount'});};};exports[_0x8795('0xd')]=function(_0x4ea71f,_0x10506d){return client[_0x8795('0xe')](_0x8795('0xf'),{'account':{'id':_0x4ea71f},'body':_0x10506d,'log':_0x8795('0xf')});}; \ No newline at end of file +var _0x6c65=['ListId','TemplateId','MailServerIn','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','active','key'];(function(_0x276534,_0xa635a9){var _0x252114=function(_0x5686f5){while(--_0x5686f5){_0x276534['push'](_0x276534['shift']());}};_0x252114(++_0xa635a9);}(_0x6c65,0x78));var _0x56c6=function(_0x5b6a86,_0x59489c){_0x5b6a86=_0x5b6a86-0x0;var _0x425888=_0x6c65[_0x5b6a86];return _0x425888;};'use strict';var client=require(_0x56c6('0x0'));exports[_0x56c6('0x1')]=function(){return function(){return client[_0x56c6('0x2')](_0x56c6('0x3'),{'options':{'attributes':['id',_0x56c6('0x4'),_0x56c6('0x5'),'email',_0x56c6('0x6'),_0x56c6('0x7'),_0x56c6('0x8'),_0x56c6('0x9')],'raw':![],'include':[{'model':_0x56c6('0xa'),'as':'Imap'},{'model':_0x56c6('0xb'),'as':_0x56c6('0xc')}]},'log':_0x56c6('0xd')});};};exports[_0x56c6('0xe')]=function(_0x2422a9,_0x5f35af){return client[_0x56c6('0x2')](_0x56c6('0xf'),{'account':{'id':_0x2422a9},'body':_0x5f35af,'log':_0x56c6('0xf')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 9508270..a616736 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9a1=['Verified','values','length','Imap','password','Smtp','pass','http','stringify','listen','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','email','sendMail','account','then','catch','error','verifySmtp'];(function(_0x3c5e71,_0xfc0c07){var _0x71b974=function(_0x40c7e7){while(--_0x40c7e7){_0x3c5e71['push'](_0x3c5e71['shift']());}};_0x71b974(++_0xfc0c07);}(_0xc9a1,0x18e));var _0x1c9a=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xc9a1[_0x5e3b04];return _0x1fc44d;};'use strict';var jayson=require(_0x1c9a('0x0'));var BPromise=require(_0x1c9a('0x1'));var _=require(_0x1c9a('0x2'));var logger=require('../../../config/logger')(_0x1c9a('0x3'));exports['listen']=function(_0x58d0af,_0x50fd39){return new BPromise(function(_0x3ae13e,_0x11ab44){var _0x4440b1={'SendMail':function(_0xef467d){var _0x3b102a=this;return new Promise(function(_0x50ab46,_0x59d612){_0x50fd39[_0x1c9a('0x4')](_0xef467d[_0x1c9a('0x5')],_0xef467d['message'])[_0x1c9a('0x6')](function(_0x54db56){_0x50ab46({'code':0xc8,'message':_0x54db56});})[_0x1c9a('0x7')](function(_0x4fb80a){_0x59d612(_0x3b102a[_0x1c9a('0x8')](0x1f4,_0x4fb80a));});});},'VerifySmtp':function(_0x585d42){var _0x507a43=this;return new Promise(function(_0x147b9d,_0xa31a5a){_0x50fd39[_0x1c9a('0x9')](_0x585d42[_0x1c9a('0x5')])[_0x1c9a('0x6')](function(_0x49ec71){_0x147b9d({'code':0xc8,'message':_0x1c9a('0xa')});})['catch'](function(_0xa3cb05){_0xa31a5a(_0x507a43[_0x1c9a('0x8')](0x1f4,_0xa3cb05));});});},'MailAccounts':function(_0x3099c1){return new Promise(function(_0x4e3256,_0x141307){var _0x541cf3=_[_0x1c9a('0xb')](_0x58d0af['mailAccounts']);for(var _0x127308=0x0;_0x127308<_0x541cf3[_0x1c9a('0xc')];_0x127308+=0x1){if(_0x541cf3[_0x127308][_0x1c9a('0xd')]&&_0x541cf3[_0x127308][_0x1c9a('0xd')]['password']){delete _0x541cf3[_0x127308]['Imap'][_0x1c9a('0xe')];}if(_0x541cf3[_0x127308][_0x1c9a('0xf')]&&_0x541cf3[_0x127308][_0x1c9a('0xf')][_0x1c9a('0x10')]){delete _0x541cf3[_0x127308][_0x1c9a('0xf')][_0x1c9a('0x10')];}}_0x4e3256({'count':_0x541cf3[_0x1c9a('0xc')],'rows':_0x541cf3});});}};var _0x5333ae=jayson['server'](_0x4440b1)[_0x1c9a('0x11')]();_0x5333ae['on'](_0x1c9a('0x8'),function(_0x2e1260){logger[_0x1c9a('0x8')](JSON[_0x1c9a('0x12')](_0x2e1260));return _0x11ab44(_0x2e1260);});_0x5333ae[_0x1c9a('0x13')](0x232b,_0x1c9a('0x14'),function(){console[_0x1c9a('0x15')](_0x1c9a('0x16'),0x232b);return _0x3ae13e(_0x1c9a('0x17')+0x232b);});});}; \ No newline at end of file +var _0x6efc=['../../../config/logger','email','listen','message','then','catch','account','Verified','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','error','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird'];(function(_0x2ad4cb,_0x27e754){var _0x13de84=function(_0x3d6786){while(--_0x3d6786){_0x2ad4cb['push'](_0x2ad4cb['shift']());}};_0x13de84(++_0x27e754);}(_0x6efc,0xf8));var _0xc6ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6efc[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xc6ef('0x0'));var BPromise=require(_0xc6ef('0x1'));var _=require('lodash');var logger=require(_0xc6ef('0x2'))(_0xc6ef('0x3'));exports[_0xc6ef('0x4')]=function(_0x20bece,_0x247367){return new BPromise(function(_0x2def1f,_0x496f4e){var _0x120e67={'SendMail':function(_0x2776e7){var _0x44c1b4=this;return new Promise(function(_0x3ae0d9,_0xa076f4){_0x247367['sendMail'](_0x2776e7['account'],_0x2776e7[_0xc6ef('0x5')])[_0xc6ef('0x6')](function(_0x19fe49){_0x3ae0d9({'code':0xc8,'message':_0x19fe49});})[_0xc6ef('0x7')](function(_0x33419d){_0xa076f4(_0x44c1b4['error'](0x1f4,_0x33419d));});});},'VerifySmtp':function(_0x21b3c9){var _0x1b6285=this;return new Promise(function(_0x4eb19c,_0x334492){_0x247367['verifySmtp'](_0x21b3c9[_0xc6ef('0x8')])[_0xc6ef('0x6')](function(_0x263b54){_0x4eb19c({'code':0xc8,'message':_0xc6ef('0x9')});})[_0xc6ef('0x7')](function(_0x341069){_0x334492(_0x1b6285['error'](0x1f4,_0x341069));});});},'MailAccounts':function(_0x53135e){return new Promise(function(_0x3a175c,_0x138266){var _0xba3c83=_[_0xc6ef('0xa')](_0x20bece[_0xc6ef('0xb')]);for(var _0x17dacd=0x0;_0x17dacd<_0xba3c83[_0xc6ef('0xc')];_0x17dacd+=0x1){if(_0xba3c83[_0x17dacd][_0xc6ef('0xd')]&&_0xba3c83[_0x17dacd][_0xc6ef('0xd')][_0xc6ef('0xe')]){delete _0xba3c83[_0x17dacd]['Imap'][_0xc6ef('0xe')];}if(_0xba3c83[_0x17dacd]['Smtp']&&_0xba3c83[_0x17dacd][_0xc6ef('0xf')][_0xc6ef('0x10')]){delete _0xba3c83[_0x17dacd][_0xc6ef('0xf')][_0xc6ef('0x10')];}}_0x3a175c({'count':_0xba3c83[_0xc6ef('0xc')],'rows':_0xba3c83});});}};var _0x4b3682=jayson[_0xc6ef('0x11')](_0x120e67)[_0xc6ef('0x12')]();_0x4b3682['on'](_0xc6ef('0x13'),function(_0x8426b8){logger['error'](JSON[_0xc6ef('0x14')](_0x8426b8));return _0x496f4e(_0x8426b8);});_0x4b3682['listen'](0x232b,_0xc6ef('0x15'),function(){console[_0xc6ef('0x16')](_0xc6ef('0x17'),0x232b);return _0x2def1f(_0xc6ef('0x18')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 654f5a1..b8cbdd8 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc6b=['sticky-session','ioredis','listen','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express'];(function(_0xef56a8,_0x214711){var _0xb35856=function(_0x3b2eb5){while(--_0x3b2eb5){_0xef56a8['push'](_0xef56a8['shift']());}};_0xb35856(++_0x214711);}(_0xdc6b,0x7c));var _0xbdc6=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0xdc6b[_0x46a38b];return _0x346e75;};'use strict';var _=require('lodash');var http=require(_0xbdc6('0x0'));var express=require(_0xbdc6('0x1'));var sticky=require(_0xbdc6('0x2'));var Redis=require(_0xbdc6('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xbdc6('0x4')](server,config['port'])){var socketio=require(_0xbdc6('0x5'))(server,{'transports':[_0xbdc6('0x6'),_0xbdc6('0x7')]});config[_0xbdc6('0x8')]=_[_0xbdc6('0x9')](config[_0xbdc6('0x8')],{'host':_0xbdc6('0xa'),'port':0x18eb});socketio[_0xbdc6('0xb')](require(_0xbdc6('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xbdc6('0xd')]();require(_0xbdc6('0xe'))[_0xbdc6('0xd')](socketio);require('../../config/express')['default'](app);require(_0xbdc6('0xf'))[_0xbdc6('0xd')](app);}else{server[_0xbdc6('0x10')]('listening',function(){console[_0xbdc6('0x11')](_0xbdc6('0x12'),config[_0xbdc6('0x13')]);});}exports=module[_0xbdc6('0x14')]=app; \ No newline at end of file +var _0xc1c5=['defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../routes','listening','exports','lodash','http','express','ioredis','createServer','listen','port','socket.io','polling','redis'];(function(_0x191fe8,_0x3bb523){var _0x18100b=function(_0x41895d){while(--_0x41895d){_0x191fe8['push'](_0x191fe8['shift']());}};_0x18100b(++_0x3bb523);}(_0xc1c5,0x113));var _0x5c1c=function(_0x39c285,_0x41ab9e){_0x39c285=_0x39c285-0x0;var _0x18586c=_0xc1c5[_0x39c285];return _0x18586c;};'use strict';var _=require(_0x5c1c('0x0'));var http=require(_0x5c1c('0x1'));var express=require(_0x5c1c('0x2'));var sticky=require('sticky-session');var Redis=require(_0x5c1c('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x5c1c('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x5c1c('0x5')](server,config[_0x5c1c('0x6')])){var socketio=require(_0x5c1c('0x7'))(server,{'transports':['websocket',_0x5c1c('0x8')]});config[_0x5c1c('0x9')]=_[_0x5c1c('0xa')](config[_0x5c1c('0x9')],{'host':_0x5c1c('0xb'),'port':0x18eb});socketio[_0x5c1c('0xc')](require(_0x5c1c('0xd'))({'pubClient':new Redis(config[_0x5c1c('0x9')]),'subClient':new Redis(config[_0x5c1c('0x9')])}));require('../../config/triggers')[_0x5c1c('0xe')]();require(_0x5c1c('0xf'))['default'](socketio);require('../../config/express')[_0x5c1c('0xe')](app);require(_0x5c1c('0x10'))[_0x5c1c('0xe')](app);}else{server['once'](_0x5c1c('0x11'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x5c1c('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 0d11734..9e4c7e8 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14f=['client','http','Request','request','debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x56fb4c,_0x236dc9){var _0x562b80=function(_0x1d413d){while(--_0x1d413d){_0x56fb4c['push'](_0x56fb4c['shift']());}};_0x562b80(++_0x236dc9);}(_0xe14f,0xea));var _0xfe14=function(_0x4faa3d,_0x530ae4){_0x4faa3d=_0x4faa3d-0x0;var _0x3adcff=_0xe14f[_0x4faa3d];return _0x3adcff;};'use strict';var jayson=require(_0xfe14('0x0'));var BPromise=require(_0xfe14('0x1'));var logger=require(_0xfe14('0x2'))(_0xfe14('0x3'));var client=jayson[_0xfe14('0x4')][_0xfe14('0x5')]({'port':0x2329});client[_0xfe14('0x6')]=function(_0x3afd97,_0x2b7784){return new BPromise(function(_0x4b7546,_0x576d90){return client[_0xfe14('0x7')](_0x3afd97,_0x2b7784)['then'](function(_0x474d33){logger[_0xfe14('0x8')](_0xfe14('0x9'),_0xfe14('0x3'),_0x3afd97,_0x2b7784,_0x474d33);if(_0x474d33[_0xfe14('0xa')]){logger[_0xfe14('0xa')](_0xfe14('0x9'),_0xfe14('0x3'),_0x3afd97,_0x474d33[_0xfe14('0xa')]['message'],_0x2b7784);return _0x576d90(_0x474d33[_0xfe14('0xa')][_0xfe14('0xb')]);}else{return _0x4b7546(_0x474d33[_0xfe14('0xc')]);}})[_0xfe14('0xd')](function(_0x32f55d){logger[_0xfe14('0xa')]('rpc',_0xfe14('0x3'),_0x3afd97,_0x32f55d,_0x2b7784);return _0x576d90(_0x32f55d);});});};module['exports']=client; \ No newline at end of file +var _0x76bb=['routing','client','Request','then','debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger'];(function(_0x40b3f0,_0x41796e){var _0x15af3e=function(_0x3a5d62){while(--_0x3a5d62){_0x40b3f0['push'](_0x40b3f0['shift']());}};_0x15af3e(++_0x41796e);}(_0x76bb,0x16a));var _0xb76b=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x76bb[_0xce6f11];return _0x35b709;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb76b('0x0'));var logger=require(_0xb76b('0x1'))(_0xb76b('0x2'));var client=jayson[_0xb76b('0x3')]['http']({'port':0x2329});client[_0xb76b('0x4')]=function(_0x1f5d45,_0x4e5042){return new BPromise(function(_0x414cff,_0x19a231){return client['request'](_0x1f5d45,_0x4e5042)[_0xb76b('0x5')](function(_0x361737){logger[_0xb76b('0x6')](_0xb76b('0x7'),_0xb76b('0x2'),_0x1f5d45,_0x4e5042,_0x361737);if(_0x361737['error']){logger[_0xb76b('0x8')](_0xb76b('0x7'),_0xb76b('0x2'),_0x1f5d45,_0x361737[_0xb76b('0x8')]['message'],_0x4e5042);return _0x19a231(_0x361737['error'][_0xb76b('0x9')]);}else{return _0x414cff(_0x361737[_0xb76b('0xa')]);}})[_0xb76b('0xb')](function(_0x2ebb61){logger[_0xb76b('0x8')](_0xb76b('0x7'),_0xb76b('0x2'),_0x1f5d45,_0x2ebb61,_0x4e5042);return _0x19a231(_0x2ebb61);});});};module[_0xb76b('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 454bb42..18f7b9f 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a20=['getFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','initAgents','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0a20,0xfe));var _0x00a2=function(_0x31802b,_0x46ed1d){_0x31802b=_0x31802b-0x0;var _0x59baea=_0x0a20[_0x31802b];return _0x59baea;};'use strict';var BPromise=require(_0x00a2('0x0'));var server=require(_0x00a2('0x1'));var Realtime=require(_0x00a2('0x2'));var user=require(_0x00a2('0x3'));var interval=require(_0x00a2('0x4'));var openchannelQueue=require(_0x00a2('0x5'));var chatQueue=require(_0x00a2('0x6'));var smsQueue=require(_0x00a2('0x7'));var mailQueue=require(_0x00a2('0x8'));var faxQueue=require(_0x00a2('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x00a2('0xa')]()[_0x00a2('0xb')](user['getAgents']())[_0x00a2('0xb')](realtime[_0x00a2('0xc')]())[_0x00a2('0xb')](interval['getIntervals']())[_0x00a2('0xb')](realtime['initIntervals']())[_0x00a2('0xb')](openchannelQueue[_0x00a2('0xd')]())['then'](realtime[_0x00a2('0xe')]())[_0x00a2('0xb')](chatQueue[_0x00a2('0xf')]())[_0x00a2('0xb')](realtime[_0x00a2('0x10')]())[_0x00a2('0xb')](smsQueue[_0x00a2('0x11')]())[_0x00a2('0xb')](realtime[_0x00a2('0x12')]())['then'](mailQueue[_0x00a2('0x13')]())['then'](realtime[_0x00a2('0x14')]())[_0x00a2('0xb')](faxQueue[_0x00a2('0x15')]())['then'](realtime['initFaxQueues']())[_0x00a2('0xb')](function(){return realtime;});}function main(){return server[_0x00a2('0x16')](realtime)[_0x00a2('0xb')](function(_0x4a421e){return initRealtime();})[_0x00a2('0xb')](function(_0x1aa14c){return setInterval(initRealtime,0x1388);})[_0x00a2('0x17')](function(_0x503084){console[_0x00a2('0x18')](_0x503084);});}main(); \ No newline at end of file +var _0xae09=['initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','catch','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','then','initAgents','getOpenchannelQueues','initOpenchannelQueues','getChatQueues'];(function(_0x1515fe,_0x5b104f){var _0x4cf904=function(_0x288589){while(--_0x288589){_0x1515fe['push'](_0x1515fe['shift']());}};_0x4cf904(++_0x5b104f);}(_0xae09,0x16b));var _0x9ae0=function(_0x231807,_0x33ae7b){_0x231807=_0x231807-0x0;var _0x2b6d04=_0xae09[_0x231807];return _0x2b6d04;};'use strict';var BPromise=require(_0x9ae0('0x0'));var server=require('./server');var Realtime=require(_0x9ae0('0x1'));var user=require(_0x9ae0('0x2'));var interval=require(_0x9ae0('0x3'));var openchannelQueue=require(_0x9ae0('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x9ae0('0x5'));var mailQueue=require(_0x9ae0('0x6'));var faxQueue=require(_0x9ae0('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9ae0('0x8')]()['then'](user[_0x9ae0('0x9')]())[_0x9ae0('0xa')](realtime[_0x9ae0('0xb')]())['then'](interval['getIntervals']())[_0x9ae0('0xa')](realtime['initIntervals']())[_0x9ae0('0xa')](openchannelQueue[_0x9ae0('0xc')]())[_0x9ae0('0xa')](realtime[_0x9ae0('0xd')]())[_0x9ae0('0xa')](chatQueue[_0x9ae0('0xe')]())['then'](realtime[_0x9ae0('0xf')]())[_0x9ae0('0xa')](smsQueue['getSmsQueues']())[_0x9ae0('0xa')](realtime[_0x9ae0('0x10')]())['then'](mailQueue['getMailQueues']())['then'](realtime[_0x9ae0('0x11')]())[_0x9ae0('0xa')](faxQueue[_0x9ae0('0x12')]())[_0x9ae0('0xa')](realtime[_0x9ae0('0x13')]())[_0x9ae0('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x9ae0('0xa')](function(_0x34d8ff){return initRealtime();})[_0x9ae0('0xa')](function(_0x4724d3){return setInterval(initRealtime,0x1388);})[_0x9ae0('0x14')](function(_0x2d1f85){console['log'](_0x2d1f85);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 077d5f0..fe6e320 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fb3=['result','clone','consequence','name','index_','nextTick','call','next','restart','isNil','length','condition','matchPath','matches','turn','prioritize','findRules','priority','toString','fromJSON','isString','parse','object','lodash','util','EventEmitter','init','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','activeRules','filter','asc','execute'];(function(_0x34f676,_0x281951){var _0x1ad4ab=function(_0x59b135){while(--_0x59b135){_0x34f676['push'](_0x34f676['shift']());}};_0x1ad4ab(++_0x281951);}(_0x1fb3,0x1b1));var _0x31fb=function(_0x5cc72c,_0x347000){_0x5cc72c=_0x5cc72c-0x0;var _0x2c8346=_0x1fb3[_0x5cc72c];return _0x2c8346;};'use strict';var _=require(_0x31fb('0x0'));var util=require(_0x31fb('0x1'));var EventEmitter=require('events')[_0x31fb('0x2')];function RuleEngine(_0x40572f,_0x2f29d5){this[_0x31fb('0x3')]();if(!_['isNil'](_0x40572f)){this[_0x31fb('0x4')](_0x40572f);}if(_0x2f29d5){this[_0x31fb('0x5')]=_0x2f29d5[_0x31fb('0x5')];}return this;}util[_0x31fb('0x6')](RuleEngine,EventEmitter);RuleEngine[_0x31fb('0x7')][_0x31fb('0x3')]=function(_0xc2591a){this[_0x31fb('0x8')]=[];this['activeRules']=[];};RuleEngine[_0x31fb('0x7')][_0x31fb('0x4')]=function(_0x514521){if(Array[_0x31fb('0x9')](_0x514521)){this[_0x31fb('0x8')]=this['rules'][_0x31fb('0xa')](_0x514521);}else if(_0x514521!==null&&_[_0x31fb('0xb')](_0x514521)){this[_0x31fb('0x8')][_0x31fb('0xc')](_0x514521);}this[_0x31fb('0xd')]();};RuleEngine[_0x31fb('0x7')]['sync']=function(){this[_0x31fb('0xe')]=this['rules'][_0x31fb('0xf')](function(_0x4bf757){if(_['isNil'](_0x4bf757['on'])){_0x4bf757['on']=!![];}if(_0x4bf757['on']===!![]){return _0x4bf757;}});this[_0x31fb('0xe')]=_['orderBy'](this[_0x31fb('0xe')],['p'],[_0x31fb('0x10')]);};RuleEngine[_0x31fb('0x7')][_0x31fb('0x11')]=function(_0x1ce40,_0x366de0){var _0x9c3f3=![];_0x1ce40[_0x31fb('0x12')]=!![];var _0x387962=_['clone'](_0x1ce40);var _0x46e3bb=_[_0x31fb('0x13')](_0x1ce40);var _0x25e9dd=this[_0x31fb('0xe')];var _0x506bb7=[];var _0xa1988c=this['ignoreFactChanges'];(function FnRuleLoop(_0x2b120d){var _0x2edf15={'rules':function(){return _0x25e9dd;},'rule':function(){return _0x25e9dd[_0x2b120d];},'when':function(_0x55f6ca){if(_0x55f6ca){var _0x101c60=_0x25e9dd[_0x2b120d][_0x31fb('0x14')];_0x101c60['ruleRef']=_0x25e9dd[_0x2b120d]['id']||_0x25e9dd[_0x2b120d][_0x31fb('0x15')]||_0x31fb('0x16')+_0x2b120d;process[_0x31fb('0x17')](function(){_0x506bb7['push'](_0x101c60['ruleRef']);_0x101c60[_0x31fb('0x18')](_0x387962,_0x2edf15);});}else{process[_0x31fb('0x17')](function(){_0x2edf15[_0x31fb('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x9c3f3=!![];return FnRuleLoop(0x0);},'next':function(_0x61d471){if(!_0xa1988c&&!_['isEqual'](_0x46e3bb,_0x387962)){_0x46e3bb=_[_0x31fb('0x13')](_0x387962);process[_0x31fb('0x17')](function(){_0x2edf15[_0x31fb('0x1a')]();});}else{process[_0x31fb('0x17')](function(){if(_[_0x31fb('0x1b')](_0x61d471)){return FnRuleLoop(_0x2b120d+0x1);}else{return FnRuleLoop(_0x61d471);}});}}};if(_0x2b120d<_0x25e9dd[_0x31fb('0x1c')]&&_0x9c3f3===![]){var _0x1edbcc=_0x25e9dd[_0x2b120d][_0x31fb('0x1d')];_0x1edbcc[_0x31fb('0x18')](_0x387962,_0x2edf15);}else{process[_0x31fb('0x17')](function(){_0x387962[_0x31fb('0x1e')]=_0x506bb7;return _0x366de0?_0x366de0(_0x387962):_['noop']();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4b22c6){if(_['isNil'](_0x4b22c6)){return this[_0x31fb('0x8')];}else{var _0x2ca4ab=_[_0x31fb('0x1f')](_0x4b22c6);return _[_0x31fb('0xf')](this['rules'],_0x2ca4ab);}};RuleEngine[_0x31fb('0x7')][_0x31fb('0x20')]=function(_0x47a72f,_0x129090){var _0x47a72f=_0x47a72f==='on'||_0x47a72f==='ON'?!![]:![];var _0x3db57e=this['findRules'](_0x129090);for(var _0x43f617=0x0,_0x86c50=_0x3db57e[_0x31fb('0x1c')];_0x43f617<_0x86c50;_0x43f617+=0x1){_0x3db57e[_0x43f617]['on']=_0x47a72f;}this['sync']();};RuleEngine[_0x31fb('0x7')][_0x31fb('0x21')]=function(_0x10fd33,_0x5dff4c){_0x10fd33=parseInt(_0x10fd33,0xa);var _0x5e519c=this[_0x31fb('0x22')](_0x5dff4c);for(var _0x205a4e=0x0,_0x3679f6=_0x5e519c[_0x31fb('0x1c')];_0x205a4e<_0x3679f6;_0x205a4e+=0x1){_0x5e519c[_0x205a4e][_0x31fb('0x23')]=_0x10fd33;}this[_0x31fb('0xd')]();};RuleEngine['prototype']['toJSON']=function(){var _0xfafa5=this['rules'];if(_0xfafa5 instanceof Array){_0xfafa5=_0xfafa5['map'](function(_0x577e9b){_0x577e9b[_0x31fb('0x1d')]=_0x577e9b[_0x31fb('0x1d')][_0x31fb('0x24')]();_0x577e9b[_0x31fb('0x14')]=_0x577e9b[_0x31fb('0x14')][_0x31fb('0x24')]();return _0x577e9b;});}else if(!_['isNil'](_0xfafa5)){_0xfafa5[_0x31fb('0x1d')]=_0xfafa5[_0x31fb('0x1d')][_0x31fb('0x24')]();_0xfafa5[_0x31fb('0x14')]=_0xfafa5[_0x31fb('0x14')][_0x31fb('0x24')]();}return _0xfafa5;};RuleEngine[_0x31fb('0x7')][_0x31fb('0x25')]=function(_0x42e217){this[_0x31fb('0x3')]();if(_[_0x31fb('0x26')](_0x42e217)){_0x42e217=JSON[_0x31fb('0x27')](_0x42e217);}if(_0x42e217 instanceof Array){_0x42e217=_0x42e217['map'](function(_0x2c1bd8){_0x2c1bd8[_0x31fb('0x1d')]=eval('('+_0x2c1bd8['condition']+')');_0x2c1bd8[_0x31fb('0x14')]=eval('('+_0x2c1bd8[_0x31fb('0x14')]+')');return _0x2c1bd8;});}else if(_0x42e217!==null&&typeof _0x42e217==_0x31fb('0x28')){_0x42e217[_0x31fb('0x1d')]=eval('('+_0x42e217[_0x31fb('0x1d')]+')');_0x42e217[_0x31fb('0x14')]=eval('('+_0x42e217[_0x31fb('0x14')]+')');}this[_0x31fb('0x4')](_0x42e217);};module['exports']=RuleEngine; \ No newline at end of file +var _0x18b3=['prioritize','priority','toJSON','map','condition','toString','fromJSON','isString','parse','object','lodash','events','EventEmitter','init','ignoreFactChanges','rules','prototype','register','isArray','concat','push','sync','activeRules','isNil','orderBy','asc','execute','result','clone','consequence','ruleRef','index_','nextTick','call','next','restart','matchPath','findRules','matches','filter','turn','length'];(function(_0x4e7abc,_0x2aeca1){var _0x428796=function(_0xa2c1d){while(--_0xa2c1d){_0x4e7abc['push'](_0x4e7abc['shift']());}};_0x428796(++_0x2aeca1);}(_0x18b3,0xdc));var _0x318b=function(_0x3219a4,_0x51e438){_0x3219a4=_0x3219a4-0x0;var _0x56dbc4=_0x18b3[_0x3219a4];return _0x56dbc4;};'use strict';var _=require(_0x318b('0x0'));var util=require('util');var EventEmitter=require(_0x318b('0x1'))[_0x318b('0x2')];function RuleEngine(_0x319d01,_0x2a8571){this[_0x318b('0x3')]();if(!_['isNil'](_0x319d01)){this['register'](_0x319d01);}if(_0x2a8571){this[_0x318b('0x4')]=_0x2a8571[_0x318b('0x4')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x318b('0x3')]=function(_0x1f74ae){this[_0x318b('0x5')]=[];this['activeRules']=[];};RuleEngine[_0x318b('0x6')][_0x318b('0x7')]=function(_0x2dae6f){if(Array[_0x318b('0x8')](_0x2dae6f)){this[_0x318b('0x5')]=this[_0x318b('0x5')][_0x318b('0x9')](_0x2dae6f);}else if(_0x2dae6f!==null&&_['isObject'](_0x2dae6f)){this[_0x318b('0x5')][_0x318b('0xa')](_0x2dae6f);}this[_0x318b('0xb')]();};RuleEngine[_0x318b('0x6')]['sync']=function(){this[_0x318b('0xc')]=this['rules']['filter'](function(_0x448ff6){if(_[_0x318b('0xd')](_0x448ff6['on'])){_0x448ff6['on']=!![];}if(_0x448ff6['on']===!![]){return _0x448ff6;}});this[_0x318b('0xc')]=_[_0x318b('0xe')](this[_0x318b('0xc')],['p'],[_0x318b('0xf')]);};RuleEngine[_0x318b('0x6')][_0x318b('0x10')]=function(_0xb1c20d,_0x46da77){var _0x20a6ae=![];_0xb1c20d[_0x318b('0x11')]=!![];var _0x48cedd=_['clone'](_0xb1c20d);var _0x32c285=_[_0x318b('0x12')](_0xb1c20d);var _0x4da907=this[_0x318b('0xc')];var _0x5c2234=[];var _0x55073f=this[_0x318b('0x4')];(function FnRuleLoop(_0x1c312e){var _0x61592e={'rules':function(){return _0x4da907;},'rule':function(){return _0x4da907[_0x1c312e];},'when':function(_0x56e84c){if(_0x56e84c){var _0x5c1ba1=_0x4da907[_0x1c312e][_0x318b('0x13')];_0x5c1ba1[_0x318b('0x14')]=_0x4da907[_0x1c312e]['id']||_0x4da907[_0x1c312e]['name']||_0x318b('0x15')+_0x1c312e;process[_0x318b('0x16')](function(){_0x5c2234[_0x318b('0xa')](_0x5c1ba1[_0x318b('0x14')]);_0x5c1ba1[_0x318b('0x17')](_0x48cedd,_0x61592e);});}else{process[_0x318b('0x16')](function(){_0x61592e[_0x318b('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x20a6ae=!![];return FnRuleLoop(0x0);},'next':function(_0x476ae8){if(!_0x55073f&&!_['isEqual'](_0x32c285,_0x48cedd)){_0x32c285=_[_0x318b('0x12')](_0x48cedd);process['nextTick'](function(){_0x61592e[_0x318b('0x19')]();});}else{process['nextTick'](function(){if(_['isNil'](_0x476ae8)){return FnRuleLoop(_0x1c312e+0x1);}else{return FnRuleLoop(_0x476ae8);}});}}};if(_0x1c312e<_0x4da907['length']&&_0x20a6ae===![]){var _0x4b53fe=_0x4da907[_0x1c312e]['condition'];_0x4b53fe[_0x318b('0x17')](_0x48cedd,_0x61592e);}else{process['nextTick'](function(){_0x48cedd[_0x318b('0x1a')]=_0x5c2234;return _0x46da77?_0x46da77(_0x48cedd):_['noop']();});}}(0x0));};RuleEngine[_0x318b('0x6')][_0x318b('0x1b')]=function(_0x804619){if(_[_0x318b('0xd')](_0x804619)){return this[_0x318b('0x5')];}else{var _0x556f8d=_[_0x318b('0x1c')](_0x804619);return _[_0x318b('0x1d')](this[_0x318b('0x5')],_0x556f8d);}};RuleEngine['prototype'][_0x318b('0x1e')]=function(_0xc1b429,_0x2ebff6){var _0xc1b429=_0xc1b429==='on'||_0xc1b429==='ON'?!![]:![];var _0xc27197=this[_0x318b('0x1b')](_0x2ebff6);for(var _0xa9b267=0x0,_0x708696=_0xc27197[_0x318b('0x1f')];_0xa9b267<_0x708696;_0xa9b267+=0x1){_0xc27197[_0xa9b267]['on']=_0xc1b429;}this['sync']();};RuleEngine[_0x318b('0x6')][_0x318b('0x20')]=function(_0x54ec90,_0x1013b5){_0x54ec90=parseInt(_0x54ec90,0xa);var _0x2dcd8d=this['findRules'](_0x1013b5);for(var _0x3ee3d9=0x0,_0x91be21=_0x2dcd8d[_0x318b('0x1f')];_0x3ee3d9<_0x91be21;_0x3ee3d9+=0x1){_0x2dcd8d[_0x3ee3d9][_0x318b('0x21')]=_0x54ec90;}this[_0x318b('0xb')]();};RuleEngine[_0x318b('0x6')][_0x318b('0x22')]=function(){var _0xf1bfaf=this[_0x318b('0x5')];if(_0xf1bfaf instanceof Array){_0xf1bfaf=_0xf1bfaf[_0x318b('0x23')](function(_0xe07560){_0xe07560[_0x318b('0x24')]=_0xe07560[_0x318b('0x24')][_0x318b('0x25')]();_0xe07560['consequence']=_0xe07560[_0x318b('0x13')]['toString']();return _0xe07560;});}else if(!_['isNil'](_0xf1bfaf)){_0xf1bfaf[_0x318b('0x24')]=_0xf1bfaf[_0x318b('0x24')][_0x318b('0x25')]();_0xf1bfaf['consequence']=_0xf1bfaf[_0x318b('0x13')][_0x318b('0x25')]();}return _0xf1bfaf;};RuleEngine[_0x318b('0x6')][_0x318b('0x26')]=function(_0x80855e){this['init']();if(_[_0x318b('0x27')](_0x80855e)){_0x80855e=JSON[_0x318b('0x28')](_0x80855e);}if(_0x80855e instanceof Array){_0x80855e=_0x80855e['map'](function(_0x159c07){_0x159c07[_0x318b('0x24')]=eval('('+_0x159c07[_0x318b('0x24')]+')');_0x159c07[_0x318b('0x13')]=eval('('+_0x159c07['consequence']+')');return _0x159c07;});}else if(_0x80855e!==null&&typeof _0x80855e==_0x318b('0x29')){_0x80855e[_0x318b('0x24')]=eval('('+_0x80855e[_0x318b('0x24')]+')');_0x80855e['consequence']=eval('('+_0x80855e[_0x318b('0x13')]+')');}this[_0x318b('0x7')](_0x80855e);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index e94d5e7..d5d2ddc 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x5b3982,_0x213503){var _0x513510=function(_0xbde732){while(--_0xbde732){_0x5b3982['push'](_0x5b3982['shift']());}};_0x513510(++_0x213503);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x48593f,_0x550bcd){var _0x19ea02=function(_0x13391b){while(--_0x13391b){_0x48593f['push'](_0x48593f['shift']());}};_0x19ea02(++_0x550bcd);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index edb054b..41a0ce9 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfcc=['lodash','ioredis','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','fax','sms','length','StatusTime','toNumber','Status','chatCurrentCapacity','openchannelStatusTime','busy','stringify','md5','emit','user:save'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xbfcc[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0xcbfc('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xcbfc('0x1'));var config=require(_0xcbfc('0x2'));config[_0xcbfc('0x3')]=_[_0xcbfc('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x17bc4a){this['id']=_0x17bc4a['id']||0x0;this[_0xcbfc('0x5')]=_0x17bc4a['name']||'';this[_0xcbfc('0x6')]=_0x17bc4a['online']||!![];this[_0xcbfc('0x7')]=_0x17bc4a[_0xcbfc('0x7')]||![];this[_0xcbfc('0x8')]=_0x17bc4a[_0xcbfc('0x8')]||![];this['mailPause']=_0x17bc4a[_0xcbfc('0x9')]||![];this[_0xcbfc('0xa')]=_0x17bc4a[_0xcbfc('0xa')]||![];this[_0xcbfc('0xb')]=_0x17bc4a[_0xcbfc('0xb')]||![];this[_0xcbfc('0xc')]=_0x17bc4a['openchannelPause']||![];this[_0xcbfc('0xd')]=_0xcbfc('0xe');this[_0xcbfc('0xf')]=0x0;this[_0xcbfc('0x10')]=_0x17bc4a[_0xcbfc('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xcbfc('0x11')]=_0xcbfc('0xe');this[_0xcbfc('0x12')]=0x0;this['mailCapacity']=_0x17bc4a[_0xcbfc('0x13')]||0x0;this[_0xcbfc('0x14')]=0x0;this[_0xcbfc('0x15')]=_0xcbfc('0xe');this[_0xcbfc('0x16')]=0x0;this['faxCapacity']=_0x17bc4a[_0xcbfc('0x17')]||0x0;this[_0xcbfc('0x18')]=0x0;this[_0xcbfc('0x19')]=_0xcbfc('0xe');this['smsStatusTime']=0x0;this['smsCapacity']=_0x17bc4a[_0xcbfc('0x1a')]||0x0;this[_0xcbfc('0x1b')]=0x0;this[_0xcbfc('0x1c')]='unknown';this['openchannelStatusTime']=0x0;this[_0xcbfc('0x1d')]=_0x17bc4a[_0xcbfc('0x1d')]||0x0;this[_0xcbfc('0x1e')]=0x0;this['busy']=![];this[_0xcbfc('0x1f')]=undefined;this['md5']='';this[_0xcbfc('0x20')]();}Agent[_0xcbfc('0x21')][_0xcbfc('0x22')]=function(_0x2fdc5c){if(this[_0x2fdc5c+_0xcbfc('0x23')]>0x0){if(this[_0x2fdc5c+_0xcbfc('0x24')]>0x0&&this[_0x2fdc5c+'CurrentCapacity']>=this[_0x2fdc5c+_0xcbfc('0x24')]){return _0xcbfc('0x25');}else{return'working';}}else{return _0xcbfc('0x26');}};Agent['prototype']['updateRealtime']=function(){var _0x4e2427=[_0xcbfc('0x27'),'chat','openchannel',_0xcbfc('0x28'),_0xcbfc('0x29')];for(var _0x3ceeff=0x0;_0x3ceeff<_0x4e2427[_0xcbfc('0x2a')];_0x3ceeff+=0x1){var _0x49f5bf=this[_0xcbfc('0x22')](_0x4e2427[_0x3ceeff]);if(this[_0x4e2427[_0x3ceeff]+'Status']!==_0x49f5bf){this[_0x4e2427[_0x3ceeff]+_0xcbfc('0x2b')]=_[_0xcbfc('0x2c')](moment()['format']('x'));}this[_0x4e2427[_0x3ceeff]+_0xcbfc('0x2d')]=_0x49f5bf;}var _0x3b73a3={'id':this['id'],'name':this['name'],'online':this[_0xcbfc('0x6')],'voicePause':this[_0xcbfc('0x7')],'chatPause':this[_0xcbfc('0x8')],'mailPause':this[_0xcbfc('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0xcbfc('0xa')],'openchannelPause':this[_0xcbfc('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xcbfc('0xf')],'chatCapacity':this[_0xcbfc('0x10')],'chatCurrentCapacity':this[_0xcbfc('0x2e')],'mailStatus':this[_0xcbfc('0x11')],'mailStatusTime':this[_0xcbfc('0x12')],'mailCapacity':this[_0xcbfc('0x13')],'mailCurrentCapacity':this[_0xcbfc('0x14')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xcbfc('0x16')],'faxCapacity':this[_0xcbfc('0x17')],'faxCurrentCapacity':this[_0xcbfc('0x18')],'smsStatus':this[_0xcbfc('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xcbfc('0x1a')],'smsCurrentCapacity':this[_0xcbfc('0x1b')],'openchannelStatus':this[_0xcbfc('0x1c')],'openchannelStatusTime':this[_0xcbfc('0x2f')],'openchannelCapacity':this[_0xcbfc('0x1d')],'openchannelCurrentCapacity':this[_0xcbfc('0x1e')],'busy':this[_0xcbfc('0x30')],'busyQueue':this['busyQueue']};var _0x8c2f11=md5(JSON[_0xcbfc('0x31')](_0x3b73a3));if(this['md5']!==_0x8c2f11){this[_0xcbfc('0x32')]=_0x8c2f11;io[_0xcbfc('0x33')](_0xcbfc('0x34'),_0x3b73a3);}};module['exports']=Agent; \ No newline at end of file +var _0xa8a8=['lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','updateRealtime','mail','chat','openchannel','fax','sms','length','getChannelStatus','Status','StatusTime','toNumber','format','mailPause','chatStatusTime','faxCurrentCapacity','stringify','exports'];(function(_0x485bad,_0x21c418){var _0x523c91=function(_0x7393a4){while(--_0x7393a4){_0x485bad['push'](_0x485bad['shift']());}};_0x523c91(++_0x21c418);}(_0xa8a8,0xec));var _0x8a8a=function(_0x447add,_0x256a86){_0x447add=_0x447add-0x0;var _0x1e4609=_0xa8a8[_0x447add];return _0x1e4609;};'use strict';var _=require(_0x8a8a('0x0'));var moment=require(_0x8a8a('0x1'));var md5=require(_0x8a8a('0x2'));var Redis=require(_0x8a8a('0x3'));var config=require('../../../config/environment');config[_0x8a8a('0x4')]=_[_0x8a8a('0x5')](config[_0x8a8a('0x4')],{'host':_0x8a8a('0x6'),'port':0x18eb});var io=require(_0x8a8a('0x7'))(new Redis(config[_0x8a8a('0x4')]));function Agent(_0x3184a3){this['id']=_0x3184a3['id']||0x0;this[_0x8a8a('0x8')]=_0x3184a3[_0x8a8a('0x8')]||'';this[_0x8a8a('0x9')]=_0x3184a3[_0x8a8a('0x9')]||!![];this[_0x8a8a('0xa')]=_0x3184a3[_0x8a8a('0xa')]||![];this[_0x8a8a('0xb')]=_0x3184a3[_0x8a8a('0xb')]||![];this['mailPause']=_0x3184a3['mailPause']||![];this[_0x8a8a('0xc')]=_0x3184a3['faxPause']||![];this[_0x8a8a('0xd')]=_0x3184a3[_0x8a8a('0xd')]||![];this['openchannelPause']=_0x3184a3[_0x8a8a('0xe')]||![];this[_0x8a8a('0xf')]=_0x8a8a('0x10');this['chatStatusTime']=0x0;this[_0x8a8a('0x11')]=_0x3184a3[_0x8a8a('0x11')]||0x0;this[_0x8a8a('0x12')]=0x0;this[_0x8a8a('0x13')]='unknown';this[_0x8a8a('0x14')]=0x0;this['mailCapacity']=_0x3184a3[_0x8a8a('0x15')]||0x0;this[_0x8a8a('0x16')]=0x0;this[_0x8a8a('0x17')]=_0x8a8a('0x10');this[_0x8a8a('0x18')]=0x0;this[_0x8a8a('0x19')]=_0x3184a3[_0x8a8a('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x8a8a('0x1a')]='unknown';this[_0x8a8a('0x1b')]=0x0;this[_0x8a8a('0x1c')]=_0x3184a3[_0x8a8a('0x1c')]||0x0;this[_0x8a8a('0x1d')]=0x0;this[_0x8a8a('0x1e')]='unknown';this[_0x8a8a('0x1f')]=0x0;this[_0x8a8a('0x20')]=_0x3184a3[_0x8a8a('0x20')]||0x0;this[_0x8a8a('0x21')]=0x0;this[_0x8a8a('0x22')]=![];this[_0x8a8a('0x23')]=undefined;this['md5']='';this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x4a6601){if(this[_0x4a6601+_0x8a8a('0x24')]>0x0){if(this[_0x4a6601+_0x8a8a('0x25')]>0x0&&this[_0x4a6601+_0x8a8a('0x24')]>=this[_0x4a6601+_0x8a8a('0x25')]){return _0x8a8a('0x26');}else{return _0x8a8a('0x27');}}else{return _0x8a8a('0x28');}};Agent[_0x8a8a('0x29')][_0x8a8a('0x2a')]=function(){var _0x2deecb=[_0x8a8a('0x2b'),_0x8a8a('0x2c'),_0x8a8a('0x2d'),_0x8a8a('0x2e'),_0x8a8a('0x2f')];for(var _0x545a38=0x0;_0x545a38<_0x2deecb[_0x8a8a('0x30')];_0x545a38+=0x1){var _0x16c55b=this[_0x8a8a('0x31')](_0x2deecb[_0x545a38]);if(this[_0x2deecb[_0x545a38]+_0x8a8a('0x32')]!==_0x16c55b){this[_0x2deecb[_0x545a38]+_0x8a8a('0x33')]=_[_0x8a8a('0x34')](moment()[_0x8a8a('0x35')]('x'));}this[_0x2deecb[_0x545a38]+'Status']=_0x16c55b;}var _0x31d21a={'id':this['id'],'name':this[_0x8a8a('0x8')],'online':this[_0x8a8a('0x9')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x8a8a('0x36')],'smsPause':this[_0x8a8a('0xd')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x8a8a('0x37')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x8a8a('0x12')],'mailStatus':this[_0x8a8a('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x8a8a('0x15')],'mailCurrentCapacity':this[_0x8a8a('0x16')],'faxStatus':this[_0x8a8a('0x17')],'faxStatusTime':this[_0x8a8a('0x18')],'faxCapacity':this[_0x8a8a('0x19')],'faxCurrentCapacity':this[_0x8a8a('0x38')],'smsStatus':this[_0x8a8a('0x1a')],'smsStatusTime':this[_0x8a8a('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x8a8a('0x1f')],'openchannelCapacity':this[_0x8a8a('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x8a8a('0x22')],'busyQueue':this[_0x8a8a('0x23')]};var _0x481e92=md5(JSON[_0x8a8a('0x39')](_0x31d21a));if(this[_0x8a8a('0x2')]!==_0x481e92){this[_0x8a8a('0x2')]=_0x481e92;io['emit']('user:save',_0x31d21a);}};module[_0x8a8a('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ecde628..83e7ab7 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 _0x2557=['waiting','updateRouting','updateRealtime','prototype','map','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x399b55,_0xd4f7d2){var _0x3861e1=function(_0x4302b4){while(--_0x4302b4){_0x399b55['push'](_0x399b55['shift']());}};_0x3861e1(++_0xd4f7d2);}(_0x2557,0xb7));var _0x7255=function(_0x5b3703,_0xb11abe){_0x5b3703=_0x5b3703-0x0;var _0x3aed2b=_0x2557[_0x5b3703];return _0x3aed2b;};'use strict';var _=require(_0x7255('0x0'));var md5=require(_0x7255('0x1'));var util=require('util');var Redis=require(_0x7255('0x2'));var config=require(_0x7255('0x3'));config[_0x7255('0x4')]=_[_0x7255('0x5')](config[_0x7255('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7255('0x6'))(new Redis(config['redis']));function ChatQueue(_0x4ed685){this['id']=_0x4ed685['id']||0x0;this[_0x7255('0x7')]=_0x4ed685[_0x7255('0x7')]||'';this[_0x7255('0x8')]=_0x4ed685['timeout']||0xa;this[_0x7255('0x9')]=_0x4ed685[_0x7255('0x9')]||_0x7255('0xa');this[_0x7255('0xb')]=_0x4ed685[_0x7255('0xb')];this[_0x7255('0xc')]={};this[_0x7255('0xd')]=0x0;this[_0x7255('0x1')]='';this[_0x7255('0xe')]();this[_0x7255('0xf')]();}ChatQueue[_0x7255('0x10')]['updateRouting']=function(){var _0x4c0b9c=this[_0x7255('0xc')]['_rr'];this[_0x7255('0xc')]=_[_0x7255('0x11')](this[_0x7255('0xb')],'id');this[_0x7255('0xc')]['_rr']=_0x4c0b9c;};ChatQueue[_0x7255('0x10')]['updateRealtime']=function(){this[_0x7255('0x12')]=0x0;this['paused']=0x0;for(var _0x2d54a7=0x0;_0x2d54a7=0x0?this[_0x7255('0x17')]:0x0;var _0x42ec3b={'id':this['id'],'available':this[_0x7255('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x7255('0xd')]};var _0x3a9a50=md5(JSON[_0x7255('0x18')](_0x42ec3b));if(this[_0x7255('0x1')]!==_0x3a9a50){this[_0x7255('0x1')]=_0x3a9a50;io['to'](util[_0x7255('0x19')](_0x7255('0x1a'),_0x42ec3b[_0x7255('0x7')]))[_0x7255('0x1b')]('chat_queue:save',_0x42ec3b);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x2739=['loggedIn','paused','length','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','_rr','map','prototype'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2739,0x13e));var _0x9273=function(_0xdf5995,_0x17f44a){_0xdf5995=_0xdf5995-0x0;var _0x367ddb=_0x2739[_0xdf5995];return _0x367ddb;};'use strict';var _=require(_0x9273('0x0'));var md5=require(_0x9273('0x1'));var util=require(_0x9273('0x2'));var Redis=require(_0x9273('0x3'));var config=require(_0x9273('0x4'));config['redis']=_[_0x9273('0x5')](config[_0x9273('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x9273('0x7'))(new Redis(config[_0x9273('0x6')]));function ChatQueue(_0x1f06c6){this['id']=_0x1f06c6['id']||0x0;this[_0x9273('0x8')]=_0x1f06c6[_0x9273('0x8')]||'';this[_0x9273('0x9')]=_0x1f06c6[_0x9273('0x9')]||0xa;this['strategy']=_0x1f06c6[_0x9273('0xa')]||_0x9273('0xb');this['Agents']=_0x1f06c6[_0x9273('0xc')];this[_0x9273('0xd')]={};this['waiting']=0x0;this[_0x9273('0x1')]='';this['updateRouting']();this[_0x9273('0xe')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x56e31d=this[_0x9273('0xd')][_0x9273('0xf')];this[_0x9273('0xd')]=_[_0x9273('0x10')](this[_0x9273('0xc')],'id');this[_0x9273('0xd')][_0x9273('0xf')]=_0x56e31d;};ChatQueue[_0x9273('0x11')][_0x9273('0xe')]=function(){this[_0x9273('0x12')]=0x0;this[_0x9273('0x13')]=0x0;for(var _0x377290=0x0;_0x377290=0x0?this[_0x9273('0x16')]:0x0;var _0x1ef9ab={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9273('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x1d95c4=md5(JSON[_0x9273('0x17')](_0x1ef9ab));if(this['md5']!==_0x1d95c4){this[_0x9273('0x1')]=_0x1d95c4;io['to'](util[_0x9273('0x18')](_0x9273('0x19'),_0x1ef9ab[_0x9273('0x8')]))[_0x9273('0x1a')]('chat_queue:save',_0x1ef9ab);}};module[_0x9273('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 87c0d02..f000faf 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 _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x3a815d,_0x10f19f){var _0x2cd25b=function(_0x48aac5){while(--_0x48aac5){_0x3a815d['push'](_0x3a815d['shift']());}};_0x2cd25b(++_0x10f19f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x1388a6,_0x5ea621){var _0x1e5c54=function(_0x26c781){while(--_0x26c781){_0x1388a6['push'](_0x1388a6['shift']());}};_0x1e5c54(++_0x5ea621);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('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 9ff6789..43c3489 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 _0x0e43=['name','Intervals'];(function(_0x29f8d5,_0xc6dbc6){var _0x582d77=function(_0x588306){while(--_0x588306){_0x29f8d5['push'](_0x29f8d5['shift']());}};_0x582d77(++_0xc6dbc6);}(_0x0e43,0x16a));var _0x30e4=function(_0x296ab4,_0x323918){_0x296ab4=_0x296ab4-0x0;var _0x567350=_0x0e43[_0x296ab4];return _0x567350;};'use strict';function Interval(_0x52e3f8){this['id']=_0x52e3f8['id']||0x0;this[_0x30e4('0x0')]=_0x52e3f8[_0x30e4('0x0')]||'';this['Intervals']=_0x52e3f8[_0x30e4('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x0cb9=['Intervals','exports','name'];(function(_0x4e8abf,_0x54a43c){var _0x4b0c6f=function(_0x12d343){while(--_0x12d343){_0x4e8abf['push'](_0x4e8abf['shift']());}};_0x4b0c6f(++_0x54a43c);}(_0x0cb9,0xc8));var _0x90cb=function(_0x44b5c4,_0xb30437){_0x44b5c4=_0x44b5c4-0x0;var _0x3c4b46=_0x0cb9[_0x44b5c4];return _0x3c4b46;};'use strict';function Interval(_0x18317d){this['id']=_0x18317d['id']||0x0;this[_0x90cb('0x0')]=_0x18317d['name']||'';this[_0x90cb('0x1')]=_0x18317d[_0x90cb('0x1')]||{};}module[_0x90cb('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 e495e0f..15b5cbc 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 _0xa108=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','loggedIn','paused','Agents','length','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save'];(function(_0x3faf65,_0x70b5c3){var _0x5d66f3=function(_0x33e42d){while(--_0x33e42d){_0x3faf65['push'](_0x3faf65['shift']());}};_0x5d66f3(++_0x70b5c3);}(_0xa108,0xc4));var _0x8a10=function(_0x25100d,_0x5a870f){_0x25100d=_0x25100d-0x0;var _0x467ad3=_0xa108[_0x25100d];return _0x467ad3;};'use strict';var _=require(_0x8a10('0x0'));var md5=require(_0x8a10('0x1'));var util=require(_0x8a10('0x2'));var Redis=require(_0x8a10('0x3'));var config=require(_0x8a10('0x4'));config[_0x8a10('0x5')]=_['defaults'](config[_0x8a10('0x5')],{'host':_0x8a10('0x6'),'port':0x18eb});var io=require(_0x8a10('0x7'))(new Redis(config[_0x8a10('0x5')]));function MailQueue(_0x54cf4e){this['id']=_0x54cf4e['id']||0x0;this[_0x8a10('0x8')]=_0x54cf4e[_0x8a10('0x8')]||'';this[_0x8a10('0x9')]=_0x54cf4e[_0x8a10('0x9')]||0xa;this[_0x8a10('0xa')]=_0x54cf4e[_0x8a10('0xa')]||'beepall';this['Agents']=_0x54cf4e['Agents'];this['mapAgentsId']={};this[_0x8a10('0xb')]=0x0;this[_0x8a10('0x1')]='';this[_0x8a10('0xc')]();this[_0x8a10('0xd')]();}MailQueue['prototype'][_0x8a10('0xc')]=function(){var _0x5b2032=this[_0x8a10('0xe')][_0x8a10('0xf')];this['mapAgentsId']=_[_0x8a10('0x10')](this['Agents'],'id');this[_0x8a10('0xe')]['_rr']=_0x5b2032;};MailQueue['prototype']['updateRealtime']=function(){this[_0x8a10('0x11')]=0x0;this[_0x8a10('0x12')]=0x0;for(var _0x132870=0x0;_0x132870=0x0?this['available']:0x0;var _0xbba213={'id':this['id'],'available':this[_0x8a10('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x8a10('0x8')],'paused':this[_0x8a10('0x12')],'waiting':this['waiting']};var _0x20458e=md5(JSON[_0x8a10('0x18')](_0xbba213));if(this[_0x8a10('0x1')]!==_0x20458e){this[_0x8a10('0x1')]=_0x20458e;io['to'](util[_0x8a10('0x19')](_0x8a10('0x1a'),_0xbba213[_0x8a10('0x8')]))['emit'](_0x8a10('0x1b'),_0xbba213);}};module['exports']=MailQueue; \ No newline at end of file +var _0x43da=['mapAgentsId','_rr','prototype','loggedIn','paused','online','available','format','mail_queue:save','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime'];(function(_0xcb2c73,_0x49d301){var _0x16d72b=function(_0x2df94c){while(--_0x2df94c){_0xcb2c73['push'](_0xcb2c73['shift']());}};_0x16d72b(++_0x49d301);}(_0x43da,0xb8));var _0xa43d=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x43da[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0xa43d('0x0'));var md5=require('md5');var util=require(_0xa43d('0x1'));var Redis=require(_0xa43d('0x2'));var config=require('../../../config/environment');config[_0xa43d('0x3')]=_[_0xa43d('0x4')](config[_0xa43d('0x3')],{'host':_0xa43d('0x5'),'port':0x18eb});var io=require(_0xa43d('0x6'))(new Redis(config[_0xa43d('0x3')]));function MailQueue(_0x27945b){this['id']=_0x27945b['id']||0x0;this[_0xa43d('0x7')]=_0x27945b[_0xa43d('0x7')]||'';this[_0xa43d('0x8')]=_0x27945b[_0xa43d('0x8')]||0xa;this[_0xa43d('0x9')]=_0x27945b[_0xa43d('0x9')]||_0xa43d('0xa');this['Agents']=_0x27945b[_0xa43d('0xb')];this['mapAgentsId']={};this[_0xa43d('0xc')]=0x0;this[_0xa43d('0xd')]='';this[_0xa43d('0xe')]();this[_0xa43d('0xf')]();}MailQueue['prototype'][_0xa43d('0xe')]=function(){var _0x3cfdce=this[_0xa43d('0x10')][_0xa43d('0x11')];this[_0xa43d('0x10')]=_['map'](this[_0xa43d('0xb')],'id');this[_0xa43d('0x10')][_0xa43d('0x11')]=_0x3cfdce;};MailQueue[_0xa43d('0x12')][_0xa43d('0xf')]=function(){this[_0xa43d('0x13')]=0x0;this[_0xa43d('0x14')]=0x0;for(var _0x4037a3=0x0;_0x4037a3=0x0?this[_0xa43d('0x16')]:0x0;var _0x11d6a7={'id':this['id'],'available':this[_0xa43d('0x16')],'loggedIn':this[_0xa43d('0x13')],'name':this[_0xa43d('0x7')],'paused':this[_0xa43d('0x14')],'waiting':this[_0xa43d('0xc')]};var _0x1b0fbc=md5(JSON['stringify'](_0x11d6a7));if(this[_0xa43d('0xd')]!==_0x1b0fbc){this[_0xa43d('0xd')]=_0x1b0fbc;io['to'](util[_0xa43d('0x17')]('mail:queue:%s',_0x11d6a7['name']))['emit'](_0xa43d('0x18'),_0x11d6a7);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 672a360..719961f 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 _0x5891=['md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','available','stringify','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting'];(function(_0x4a0590,_0x12c19d){var _0x511f87=function(_0x1cd8e0){while(--_0x1cd8e0){_0x4a0590['push'](_0x4a0590['shift']());}};_0x511f87(++_0x12c19d);}(_0x5891,0x1be));var _0x1589=function(_0x3a9a7d,_0xb475ed){_0x3a9a7d=_0x3a9a7d-0x0;var _0x2205b5=_0x5891[_0x3a9a7d];return _0x2205b5;};'use strict';var _=require(_0x1589('0x0'));var md5=require('md5');var util=require(_0x1589('0x1'));var Redis=require('ioredis');var config=require(_0x1589('0x2'));config[_0x1589('0x3')]=_[_0x1589('0x4')](config[_0x1589('0x3')],{'host':_0x1589('0x5'),'port':0x18eb});var io=require(_0x1589('0x6'))(new Redis(config[_0x1589('0x3')]));function OpenchannelQueue(_0x5ebeb0){this['id']=_0x5ebeb0['id']||0x0;this[_0x1589('0x7')]=_0x5ebeb0[_0x1589('0x7')]||'';this['timeout']=_0x5ebeb0[_0x1589('0x8')]||0xa;this[_0x1589('0x9')]=_0x5ebeb0[_0x1589('0x9')]||_0x1589('0xa');this[_0x1589('0xb')]=_0x5ebeb0[_0x1589('0xb')];this['mapAgentsId']={};this[_0x1589('0xc')]=0x0;this[_0x1589('0xd')]='';this[_0x1589('0xe')]();this[_0x1589('0xf')]();}OpenchannelQueue[_0x1589('0x10')][_0x1589('0xe')]=function(){var _0x335db2=this[_0x1589('0x11')][_0x1589('0x12')];this[_0x1589('0x11')]=_[_0x1589('0x13')](this[_0x1589('0xb')],'id');this[_0x1589('0x11')]['_rr']=_0x335db2;};OpenchannelQueue[_0x1589('0x10')][_0x1589('0xf')]=function(){this['loggedIn']=0x0;this[_0x1589('0x14')]=0x0;for(var _0x17b7ac=0x0;_0x17b7ac=0x0?this[_0x1589('0x18')]:0x0;var _0x1ecf41={'id':this['id'],'available':this[_0x1589('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x1589('0x7')],'paused':this[_0x1589('0x14')],'waiting':this[_0x1589('0xc')]};var _0xf82bf1=md5(JSON[_0x1589('0x19')](_0x1ecf41));if(this['md5']!==_0xf82bf1){this[_0x1589('0xd')]=_0xf82bf1;io['to'](util['format']('openchannel:queue:%s',_0x1ecf41[_0x1589('0x7')]))['emit']('openchannel_queue:save',_0x1ecf41);}};module[_0x1589('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0xdd2c=['beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd2c,0x1e4));var _0xcdd2=function(_0x16c62a,_0x16725b){_0x16c62a=_0x16c62a-0x0;var _0xa3b93c=_0xdd2c[_0x16c62a];return _0xa3b93c;};'use strict';var _=require(_0xcdd2('0x0'));var md5=require(_0xcdd2('0x1'));var util=require(_0xcdd2('0x2'));var Redis=require(_0xcdd2('0x3'));var config=require(_0xcdd2('0x4'));config[_0xcdd2('0x5')]=_[_0xcdd2('0x6')](config['redis'],{'host':_0xcdd2('0x7'),'port':0x18eb});var io=require(_0xcdd2('0x8'))(new Redis(config['redis']));function OpenchannelQueue(_0x164484){this['id']=_0x164484['id']||0x0;this['name']=_0x164484[_0xcdd2('0x9')]||'';this[_0xcdd2('0xa')]=_0x164484[_0xcdd2('0xa')]||0xa;this[_0xcdd2('0xb')]=_0x164484[_0xcdd2('0xb')]||_0xcdd2('0xc');this[_0xcdd2('0xd')]=_0x164484[_0xcdd2('0xd')];this[_0xcdd2('0xe')]={};this[_0xcdd2('0xf')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0xcdd2('0x10')][_0xcdd2('0x11')]=function(){var _0x586ca9=this['mapAgentsId'][_0xcdd2('0x12')];this['mapAgentsId']=_[_0xcdd2('0x13')](this[_0xcdd2('0xd')],'id');this[_0xcdd2('0xe')][_0xcdd2('0x12')]=_0x586ca9;};OpenchannelQueue['prototype'][_0xcdd2('0x14')]=function(){this[_0xcdd2('0x15')]=0x0;this[_0xcdd2('0x16')]=0x0;for(var _0x33e79d=0x0;_0x33e79d=0x0?this[_0xcdd2('0x1a')]:0x0;var _0x40e389={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcdd2('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x8f3946=md5(JSON[_0xcdd2('0x1b')](_0x40e389));if(this[_0xcdd2('0x1')]!==_0x8f3946){this['md5']=_0x8f3946;io['to'](util[_0xcdd2('0x1c')]('openchannel:queue:%s',_0x40e389[_0xcdd2('0x9')]))['emit'](_0xcdd2('0x1d'),_0x40e389);}};module[_0xcdd2('0x1e')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d99283e..3234128 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 _0x757a=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','length','online','loggedIn','smsPause','paused','available','format','sms:queue:%s','emit','md5','util','defaults'];(function(_0x35a59c,_0x3c08ef){var _0x11bf0e=function(_0x154cec){while(--_0x154cec){_0x35a59c['push'](_0x35a59c['shift']());}};_0x11bf0e(++_0x3c08ef);}(_0x757a,0xde));var _0xa757=function(_0x5655b5,_0x8c2bde){_0x5655b5=_0x5655b5-0x0;var _0x4aecc=_0x757a[_0x5655b5];return _0x4aecc;};'use strict';var _=require('lodash');var md5=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xa757('0x2')](config[_0xa757('0x3')],{'host':_0xa757('0x4'),'port':0x18eb});var io=require(_0xa757('0x5'))(new Redis(config[_0xa757('0x3')]));function SmsQueue(_0x3caeb0){this['id']=_0x3caeb0['id']||0x0;this['name']=_0x3caeb0[_0xa757('0x6')]||'';this[_0xa757('0x7')]=_0x3caeb0['timeout']||0xa;this[_0xa757('0x8')]=_0x3caeb0[_0xa757('0x8')]||_0xa757('0x9');this[_0xa757('0xa')]=_0x3caeb0[_0xa757('0xa')];this['mapAgentsId']={};this[_0xa757('0xb')]=0x0;this[_0xa757('0x0')]='';this[_0xa757('0xc')]();this[_0xa757('0xd')]();}SmsQueue[_0xa757('0xe')][_0xa757('0xc')]=function(){var _0x17408b=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0xa757('0xf')]['_rr']=_0x17408b;};SmsQueue['prototype'][_0xa757('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x32112b=0x0;_0x32112b=0x0?this['available']:0x0;var _0x54b305={'id':this['id'],'available':this[_0xa757('0x15')],'loggedIn':this[_0xa757('0x12')],'name':this[_0xa757('0x6')],'paused':this[_0xa757('0x14')],'waiting':this[_0xa757('0xb')]};var _0xe2d567=md5(JSON['stringify'](_0x54b305));if(this[_0xa757('0x0')]!==_0xe2d567){this['md5']=_0xe2d567;io['to'](util[_0xa757('0x16')](_0xa757('0x17'),_0x54b305[_0xa757('0x6')]))[_0xa757('0x18')]('sms_queue:save',_0x54b305);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xcb91=['loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','sms_queue:save','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map'];(function(_0x30b4dc,_0x4519be){var _0xcd3d9e=function(_0x8f88cc){while(--_0x8f88cc){_0x30b4dc['push'](_0x30b4dc['shift']());}};_0xcd3d9e(++_0x4519be);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0xcb91[_0x20cc29];return _0x28d513;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1cb9('0x0'));var Redis=require(_0x1cb9('0x1'));var config=require(_0x1cb9('0x2'));config[_0x1cb9('0x3')]=_['defaults'](config[_0x1cb9('0x3')],{'host':_0x1cb9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1cb9('0x3')]));function SmsQueue(_0x1b26cd){this['id']=_0x1b26cd['id']||0x0;this['name']=_0x1b26cd[_0x1cb9('0x5')]||'';this[_0x1cb9('0x6')]=_0x1b26cd['timeout']||0xa;this[_0x1cb9('0x7')]=_0x1b26cd[_0x1cb9('0x7')]||'beepall';this[_0x1cb9('0x8')]=_0x1b26cd['Agents'];this['mapAgentsId']={};this[_0x1cb9('0x9')]=0x0;this[_0x1cb9('0xa')]='';this[_0x1cb9('0xb')]();this[_0x1cb9('0xc')]();}SmsQueue[_0x1cb9('0xd')]['updateRouting']=function(){var _0x9b58f1=this[_0x1cb9('0xe')][_0x1cb9('0xf')];this[_0x1cb9('0xe')]=_[_0x1cb9('0x10')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x9b58f1;};SmsQueue[_0x1cb9('0xd')][_0x1cb9('0xc')]=function(){this[_0x1cb9('0x11')]=0x0;this[_0x1cb9('0x12')]=0x0;for(var _0x56884d=0x0;_0x56884d=0x0?this[_0x1cb9('0x15')]:0x0;var _0x4e1340={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1cb9('0x11')],'name':this[_0x1cb9('0x5')],'paused':this[_0x1cb9('0x12')],'waiting':this[_0x1cb9('0x9')]};var _0x280a84=md5(JSON[_0x1cb9('0x16')](_0x4e1340));if(this[_0x1cb9('0xa')]!==_0x280a84){this['md5']=_0x280a84;io['to'](util['format'](_0x1cb9('0x17'),_0x4e1340['name']))[_0x1cb9('0x18')](_0x1cb9('0x19'),_0x4e1340);}};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 719a012..38b66e9 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 _0x1f8d=['../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','length','isUndefined','mergeFromDatabase','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/chatQueue'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x1f8d,0x165));var _0xd1f8=function(_0x1cb898,_0x1eae51){_0x1cb898=_0x1cb898-0x0;var _0x30b780=_0x1f8d[_0x1cb898];return _0x30b780;};'use strict';var BPromise=require(_0xd1f8('0x0'));var util=require(_0xd1f8('0x1'));var _=require(_0xd1f8('0x2'));var moment=require(_0xd1f8('0x3'));var Agent=require(_0xd1f8('0x4'));var Interval=require('../model/interval');var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xd1f8('0x5'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xd1f8('0x6'));var FaxQueue=require(_0xd1f8('0x7'));var Realtime=function(){this[_0xd1f8('0x8')]={};this[_0xd1f8('0x9')]={};this[_0xd1f8('0xa')]={};this[_0xd1f8('0xb')]={};this['smsQueues']={};this[_0xd1f8('0xc')]={};this[_0xd1f8('0xd')]={};this[_0xd1f8('0xe')]={};this[_0xd1f8('0xf')]={};this['openchannelQueuesWaitingInteractions']={};this[_0xd1f8('0x10')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x6dadce,_0x4e00da,_0x16569d){var _0x2a9b1b=_[_0xd1f8('0x11')](_0x6dadce,function(_0xaaa6ec,_0x3c5ca4){return _0xaaa6ec[_0x16569d];});for(var _0x809e7c in _0x4e00da){if(_0x4e00da[_0xd1f8('0x12')](_0x809e7c)){if(!_0x2a9b1b[_0x809e7c]){delete _0x4e00da[_0x809e7c];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x28715e,_0x51ea28){for(var _0x34b610 in _0x51ea28){if(_0x28715e[_0xd1f8('0x12')](_0x34b610)){_0x28715e[_0x34b610]=_0x51ea28[_0x34b610];}}};Realtime[_0xd1f8('0x13')]['initAgents']=function(){var _0x322324=this;return function(_0x389956){if(_0x389956){freeIsNotKey(_0x389956,_0x322324['agents'],'id');for(var _0x1cf637=0x0,_0xf089a2={},_0x1507c8={};_0x1cf637<_0x389956[_0xd1f8('0x14')];_0x1cf637+=0x1){_0xf089a2=_0x389956[_0x1cf637];if(_[_0xd1f8('0x15')](_0x322324[_0xd1f8('0x8')][_0xf089a2['id']])){_0x322324['agents'][_0xf089a2['id']]=new Agent(_0xf089a2);}else{_0x322324[_0xd1f8('0x16')](_0x322324['agents'][_0xf089a2['id']],_0xf089a2);}}}return _0x322324['agents'];};};Realtime[_0xd1f8('0x13')][_0xd1f8('0x17')]=function(){var _0x5ab937=this;return function(_0x568ebc){if(_0x568ebc){freeIsNotKey(_0x568ebc,_0x5ab937['intervals'],'id');for(var _0x470417=0x0,_0x17b6ee={},_0xcb9db0={};_0x470417<_0x568ebc[_0xd1f8('0x14')];_0x470417+=0x1){_0x17b6ee=_0x568ebc[_0x470417];if(_[_0xd1f8('0x15')](_0x5ab937[_0xd1f8('0x9')][_0x17b6ee['id']])){_0x5ab937[_0xd1f8('0x9')][_0x17b6ee['id']]=new Interval(_0x17b6ee);}else{_0x5ab937[_0xd1f8('0x16')](_0x5ab937['intervals'][_0x17b6ee['id']],_0x17b6ee);}}}return _0x5ab937[_0xd1f8('0x9')];};};Realtime[_0xd1f8('0x13')][_0xd1f8('0x18')]=function(){var _0x45bbea=this;return function(_0x40ef78){if(_0x40ef78){freeIsNotKey(_0x40ef78,_0x45bbea[_0xd1f8('0xa')],'id');for(var _0x5f8229=0x0,_0x129290={},_0x3f8356={};_0x5f8229<_0x40ef78['length'];_0x5f8229+=0x1){_0x129290=_0x40ef78[_0x5f8229];if(_[_0xd1f8('0x15')](_0x45bbea[_0xd1f8('0xa')][_0x129290['id']])){_0x45bbea[_0xd1f8('0xa')][_0x129290['id']]=new OpenchannelQueue(_0x129290);}else{_0x45bbea[_0xd1f8('0x16')](_0x45bbea[_0xd1f8('0xa')][_0x129290['id']],_0x129290);}_0x45bbea[_0xd1f8('0xa')][_0x129290['id']][_0xd1f8('0x19')]();_0x45bbea[_0xd1f8('0xa')][_0x129290['id']][_0xd1f8('0x1a')]();}}return _0x45bbea[_0xd1f8('0xa')];};};Realtime[_0xd1f8('0x13')][_0xd1f8('0x1b')]=function(){var _0x439e34=this;return function(_0x385ed6){if(_0x385ed6){freeIsNotKey(_0x385ed6,_0x439e34[_0xd1f8('0xb')],'id');for(var _0x29ece7=0x0,_0xadb503={},_0x5e0269={};_0x29ece7<_0x385ed6[_0xd1f8('0x14')];_0x29ece7+=0x1){_0xadb503=_0x385ed6[_0x29ece7];if(_[_0xd1f8('0x15')](_0x439e34[_0xd1f8('0xb')][_0xadb503['id']])){_0x439e34[_0xd1f8('0xb')][_0xadb503['id']]=new ChatQueue(_0xadb503);}else{_0x439e34[_0xd1f8('0x16')](_0x439e34['chatQueues'][_0xadb503['id']],_0xadb503);}_0x439e34[_0xd1f8('0xb')][_0xadb503['id']][_0xd1f8('0x19')]();_0x439e34[_0xd1f8('0xb')][_0xadb503['id']]['updateRealtime']();}}return _0x439e34['chatQueues'];};};Realtime[_0xd1f8('0x13')][_0xd1f8('0x1c')]=function(){var _0x14ce6c=this;return function(_0x44d7b4){if(_0x44d7b4){freeIsNotKey(_0x44d7b4,_0x14ce6c[_0xd1f8('0x1d')],'id');for(var _0x4363d9=0x0,_0xd66991={},_0x100674={};_0x4363d9<_0x44d7b4['length'];_0x4363d9+=0x1){_0xd66991=_0x44d7b4[_0x4363d9];if(_[_0xd1f8('0x15')](_0x14ce6c[_0xd1f8('0x1d')][_0xd66991['id']])){_0x14ce6c[_0xd1f8('0x1d')][_0xd66991['id']]=new SmsQueue(_0xd66991);}else{_0x14ce6c[_0xd1f8('0x16')](_0x14ce6c[_0xd1f8('0x1d')][_0xd66991['id']],_0xd66991);}_0x14ce6c[_0xd1f8('0x1d')][_0xd66991['id']][_0xd1f8('0x19')]();_0x14ce6c[_0xd1f8('0x1d')][_0xd66991['id']][_0xd1f8('0x1a')]();}}return _0x14ce6c['smsQueues'];};};Realtime[_0xd1f8('0x13')][_0xd1f8('0x1e')]=function(){var _0x1bd3ed=this;return function(_0x54c592){if(_0x54c592){freeIsNotKey(_0x54c592,_0x1bd3ed[_0xd1f8('0xc')],'id');for(var _0x45b04e=0x0,_0x588c03={},_0x2d6312={};_0x45b04e<_0x54c592[_0xd1f8('0x14')];_0x45b04e+=0x1){_0x588c03=_0x54c592[_0x45b04e];if(_['isUndefined'](_0x1bd3ed[_0xd1f8('0xc')][_0x588c03['id']])){_0x1bd3ed[_0xd1f8('0xc')][_0x588c03['id']]=new MailQueue(_0x588c03);}else{_0x1bd3ed[_0xd1f8('0x16')](_0x1bd3ed[_0xd1f8('0xc')][_0x588c03['id']],_0x588c03);}_0x1bd3ed[_0xd1f8('0xc')][_0x588c03['id']][_0xd1f8('0x19')]();_0x1bd3ed[_0xd1f8('0xc')][_0x588c03['id']][_0xd1f8('0x1a')]();}}return _0x1bd3ed[_0xd1f8('0xc')];};};Realtime[_0xd1f8('0x13')][_0xd1f8('0x1f')]=function(){var _0x3ef7c6=this;return function(_0x232bb7){if(_0x232bb7){freeIsNotKey(_0x232bb7,_0x3ef7c6['faxQueues'],'id');for(var _0x53f7cf=0x0,_0x9b14be={},_0x38ff01={};_0x53f7cf<_0x232bb7[_0xd1f8('0x14')];_0x53f7cf+=0x1){_0x9b14be=_0x232bb7[_0x53f7cf];if(_[_0xd1f8('0x15')](_0x3ef7c6[_0xd1f8('0xd')][_0x9b14be['id']])){_0x3ef7c6[_0xd1f8('0xd')][_0x9b14be['id']]=new FaxQueue(_0x9b14be);}else{_0x3ef7c6[_0xd1f8('0x16')](_0x3ef7c6[_0xd1f8('0xd')][_0x9b14be['id']],_0x9b14be);}_0x3ef7c6[_0xd1f8('0xd')][_0x9b14be['id']][_0xd1f8('0x19')]();_0x3ef7c6[_0xd1f8('0xd')][_0x9b14be['id']][_0xd1f8('0x1a')]();}}return _0x3ef7c6['faxQueues'];};};module[_0xd1f8('0x20')]=Realtime; \ No newline at end of file +var _0xaeec=['initSmsQueues','updateRouting','initMailQueues','bluebird','util','../model/interval','../model/chatQueue','../model/mailQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','mergeFromDatabase','initAgents','length','isUndefined','prototype','initOpenchannelQueues','updateRealtime','initChatQueues'];(function(_0x425ea3,_0x26b830){var _0x54f159=function(_0x148626){while(--_0x148626){_0x425ea3['push'](_0x425ea3['shift']());}};_0x54f159(++_0x26b830);}(_0xaeec,0x125));var _0xcaee=function(_0x5209ad,_0x1458dc){_0x5209ad=_0x5209ad-0x0;var _0x1fae1d=_0xaeec[_0x5209ad];return _0x1fae1d;};'use strict';var BPromise=require(_0xcaee('0x0'));var util=require(_0xcaee('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0xcaee('0x2'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xcaee('0x3'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xcaee('0x4'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xcaee('0x5')]={};this[_0xcaee('0x6')]={};this[_0xcaee('0x7')]={};this[_0xcaee('0x8')]={};this[_0xcaee('0x9')]={};this[_0xcaee('0xa')]={};this[_0xcaee('0xb')]={};this[_0xcaee('0xc')]={};this[_0xcaee('0xd')]={};this[_0xcaee('0xe')]={};this[_0xcaee('0xf')]={};this[_0xcaee('0x10')]={};};function freeIsNotKey(_0x311e4d,_0x2280e7,_0xb41dd5){var _0x20b29=_['mapKeys'](_0x311e4d,function(_0x17960e,_0x3d59d8){return _0x17960e[_0xb41dd5];});for(var _0x2a524f in _0x2280e7){if(_0x2280e7[_0xcaee('0x11')](_0x2a524f)){if(!_0x20b29[_0x2a524f]){delete _0x2280e7[_0x2a524f];}}}}Realtime['prototype'][_0xcaee('0x12')]=function(_0x45ba2c,_0x352ed1){for(var _0x3223ea in _0x352ed1){if(_0x45ba2c[_0xcaee('0x11')](_0x3223ea)){_0x45ba2c[_0x3223ea]=_0x352ed1[_0x3223ea];}}};Realtime['prototype'][_0xcaee('0x13')]=function(){var _0x25b3de=this;return function(_0x292ea9){if(_0x292ea9){freeIsNotKey(_0x292ea9,_0x25b3de[_0xcaee('0x5')],'id');for(var _0x17ecfb=0x0,_0x2684d3={},_0x21f6d7={};_0x17ecfb<_0x292ea9[_0xcaee('0x14')];_0x17ecfb+=0x1){_0x2684d3=_0x292ea9[_0x17ecfb];if(_[_0xcaee('0x15')](_0x25b3de[_0xcaee('0x5')][_0x2684d3['id']])){_0x25b3de[_0xcaee('0x5')][_0x2684d3['id']]=new Agent(_0x2684d3);}else{_0x25b3de[_0xcaee('0x12')](_0x25b3de[_0xcaee('0x5')][_0x2684d3['id']],_0x2684d3);}}}return _0x25b3de[_0xcaee('0x5')];};};Realtime[_0xcaee('0x16')]['initIntervals']=function(){var _0x4b4269=this;return function(_0x38d226){if(_0x38d226){freeIsNotKey(_0x38d226,_0x4b4269[_0xcaee('0x6')],'id');for(var _0x221e9b=0x0,_0x269c47={},_0x1a5185={};_0x221e9b<_0x38d226[_0xcaee('0x14')];_0x221e9b+=0x1){_0x269c47=_0x38d226[_0x221e9b];if(_[_0xcaee('0x15')](_0x4b4269[_0xcaee('0x6')][_0x269c47['id']])){_0x4b4269['intervals'][_0x269c47['id']]=new Interval(_0x269c47);}else{_0x4b4269['mergeFromDatabase'](_0x4b4269['intervals'][_0x269c47['id']],_0x269c47);}}}return _0x4b4269[_0xcaee('0x6')];};};Realtime[_0xcaee('0x16')][_0xcaee('0x17')]=function(){var _0x46d60f=this;return function(_0x4b11f5){if(_0x4b11f5){freeIsNotKey(_0x4b11f5,_0x46d60f[_0xcaee('0x7')],'id');for(var _0x1b644a=0x0,_0xb6f4d9={},_0x27c4e1={};_0x1b644a<_0x4b11f5['length'];_0x1b644a+=0x1){_0xb6f4d9=_0x4b11f5[_0x1b644a];if(_[_0xcaee('0x15')](_0x46d60f['openchannelQueues'][_0xb6f4d9['id']])){_0x46d60f['openchannelQueues'][_0xb6f4d9['id']]=new OpenchannelQueue(_0xb6f4d9);}else{_0x46d60f[_0xcaee('0x12')](_0x46d60f['openchannelQueues'][_0xb6f4d9['id']],_0xb6f4d9);}_0x46d60f[_0xcaee('0x7')][_0xb6f4d9['id']]['updateRouting']();_0x46d60f['openchannelQueues'][_0xb6f4d9['id']][_0xcaee('0x18')]();}}return _0x46d60f['openchannelQueues'];};};Realtime[_0xcaee('0x16')][_0xcaee('0x19')]=function(){var _0x4e8dbb=this;return function(_0x3b1554){if(_0x3b1554){freeIsNotKey(_0x3b1554,_0x4e8dbb[_0xcaee('0x8')],'id');for(var _0xd2d6f9=0x0,_0x58dfd4={},_0x45d136={};_0xd2d6f9<_0x3b1554[_0xcaee('0x14')];_0xd2d6f9+=0x1){_0x58dfd4=_0x3b1554[_0xd2d6f9];if(_[_0xcaee('0x15')](_0x4e8dbb[_0xcaee('0x8')][_0x58dfd4['id']])){_0x4e8dbb[_0xcaee('0x8')][_0x58dfd4['id']]=new ChatQueue(_0x58dfd4);}else{_0x4e8dbb[_0xcaee('0x12')](_0x4e8dbb[_0xcaee('0x8')][_0x58dfd4['id']],_0x58dfd4);}_0x4e8dbb['chatQueues'][_0x58dfd4['id']]['updateRouting']();_0x4e8dbb[_0xcaee('0x8')][_0x58dfd4['id']][_0xcaee('0x18')]();}}return _0x4e8dbb[_0xcaee('0x8')];};};Realtime[_0xcaee('0x16')][_0xcaee('0x1a')]=function(){var _0x3cdf6e=this;return function(_0x29f1d9){if(_0x29f1d9){freeIsNotKey(_0x29f1d9,_0x3cdf6e['smsQueues'],'id');for(var _0x49b4ee=0x0,_0x4b9f07={},_0x4eff80={};_0x49b4ee<_0x29f1d9[_0xcaee('0x14')];_0x49b4ee+=0x1){_0x4b9f07=_0x29f1d9[_0x49b4ee];if(_[_0xcaee('0x15')](_0x3cdf6e[_0xcaee('0x9')][_0x4b9f07['id']])){_0x3cdf6e[_0xcaee('0x9')][_0x4b9f07['id']]=new SmsQueue(_0x4b9f07);}else{_0x3cdf6e[_0xcaee('0x12')](_0x3cdf6e['smsQueues'][_0x4b9f07['id']],_0x4b9f07);}_0x3cdf6e[_0xcaee('0x9')][_0x4b9f07['id']][_0xcaee('0x1b')]();_0x3cdf6e['smsQueues'][_0x4b9f07['id']][_0xcaee('0x18')]();}}return _0x3cdf6e[_0xcaee('0x9')];};};Realtime[_0xcaee('0x16')][_0xcaee('0x1c')]=function(){var _0x2c86fc=this;return function(_0xad1026){if(_0xad1026){freeIsNotKey(_0xad1026,_0x2c86fc[_0xcaee('0xa')],'id');for(var _0x3df865=0x0,_0x149baa={},_0x333660={};_0x3df865<_0xad1026['length'];_0x3df865+=0x1){_0x149baa=_0xad1026[_0x3df865];if(_['isUndefined'](_0x2c86fc['mailQueues'][_0x149baa['id']])){_0x2c86fc[_0xcaee('0xa')][_0x149baa['id']]=new MailQueue(_0x149baa);}else{_0x2c86fc[_0xcaee('0x12')](_0x2c86fc[_0xcaee('0xa')][_0x149baa['id']],_0x149baa);}_0x2c86fc[_0xcaee('0xa')][_0x149baa['id']][_0xcaee('0x1b')]();_0x2c86fc[_0xcaee('0xa')][_0x149baa['id']][_0xcaee('0x18')]();}}return _0x2c86fc['mailQueues'];};};Realtime[_0xcaee('0x16')]['initFaxQueues']=function(){var _0x1fd3cd=this;return function(_0x325f7f){if(_0x325f7f){freeIsNotKey(_0x325f7f,_0x1fd3cd[_0xcaee('0xb')],'id');for(var _0xdb76bc=0x0,_0x3daf86={},_0x24821d={};_0xdb76bc<_0x325f7f[_0xcaee('0x14')];_0xdb76bc+=0x1){_0x3daf86=_0x325f7f[_0xdb76bc];if(_[_0xcaee('0x15')](_0x1fd3cd['faxQueues'][_0x3daf86['id']])){_0x1fd3cd['faxQueues'][_0x3daf86['id']]=new FaxQueue(_0x3daf86);}else{_0x1fd3cd[_0xcaee('0x12')](_0x1fd3cd['faxQueues'][_0x3daf86['id']],_0x3daf86);}_0x1fd3cd[_0xcaee('0xb')][_0x3daf86['id']]['updateRouting']();_0x1fd3cd[_0xcaee('0xb')][_0x3daf86['id']][_0xcaee('0x18')]();}}return _0x1fd3cd[_0xcaee('0xb')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 852304a..d89dedc 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 _0x94ad=['Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x94ad,0xff));var _0xd94a=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x94ad[_0x409353];return _0x4f4b59;};'use strict';var client=require('../client');exports['update']=function(_0x1af363,_0x150115){return client[_0xd94a('0x0')](_0xd94a('0x1'),{'body':_0x150115,'options':{'where':{'id':_0x1af363}},'log':_0xd94a('0x2')});};exports['addTags']=function(_0x310f54,_0x193210){return client['Request'](_0xd94a('0x3'),{'body':_0x193210,'options':{'where':{'id':_0x310f54}},'log':_0xd94a('0x4')});}; \ No newline at end of file +var _0x8ad5=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x8ad5,0x163));var _0x58ad=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x8ad5[_0x134c2e];return _0x2825db;};'use strict';var client=require(_0x58ad('0x0'));exports['update']=function(_0x52c0f0,_0x2bb190){return client[_0x58ad('0x1')](_0x58ad('0x2'),{'body':_0x2bb190,'options':{'where':{'id':_0x52c0f0}},'log':_0x58ad('0x3')});};exports[_0x58ad('0x4')]=function(_0x1a7461,_0x3af02a){return client[_0x58ad('0x1')](_0x58ad('0x5'),{'body':_0x3af02a,'options':{'where':{'id':_0x1a7461}},'log':_0x58ad('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 1ad4cc0..a9fc7ff 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 _0x50b2=['CreateChatMessage','../client','Request'];(function(_0x53f984,_0x15b35d){var _0x220ce7=function(_0x30930a){while(--_0x30930a){_0x53f984['push'](_0x53f984['shift']());}};_0x220ce7(++_0x15b35d);}(_0x50b2,0x8e));var _0x250b=function(_0x19af1f,_0x554215){_0x19af1f=_0x19af1f-0x0;var _0x556bfc=_0x50b2[_0x19af1f];return _0x556bfc;};'use strict';var client=require(_0x250b('0x0'));exports['create']=function(_0x12a131){return client[_0x250b('0x1')](_0x250b('0x2'),{'body':_0x12a131,'log':'createChatMessage'});}; \ No newline at end of file +var _0x86dd=['Request','createChatMessage','create'];(function(_0x221e26,_0x452874){var _0x536576=function(_0x421605){while(--_0x421605){_0x221e26['push'](_0x221e26['shift']());}};_0x536576(++_0x452874);}(_0x86dd,0x134));var _0xd86d=function(_0x3da1d4,_0x40b732){_0x3da1d4=_0x3da1d4-0x0;var _0x573d08=_0x86dd[_0x3da1d4];return _0x573d08;};'use strict';var client=require('../client');exports[_0xd86d('0x0')]=function(_0x519d4a){return client[_0xd86d('0x1')]('CreateChatMessage',{'body':_0x519d4a,'log':_0xd86d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 13055ec..2652c8b 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 _0x5a92=['getChatQueues','name','timeout','Agents','online','../client'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5a92,0x7d));var _0x25a9=function(_0x1e233e,_0x294281){_0x1e233e=_0x1e233e-0x0;var _0x35ab27=_0x5a92[_0x1e233e];return _0x35ab27;};'use strict';var client=require(_0x25a9('0x0'));exports[_0x25a9('0x1')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x25a9('0x2'),_0x25a9('0x3'),'strategy'],'include':[{'model':'User','as':_0x25a9('0x4'),'attributes':['id',_0x25a9('0x2'),_0x25a9('0x5'),'chatPause']}]},'log':_0x25a9('0x1')});};}; \ No newline at end of file +var _0x609d=['timeout','strategy','User','Agents','online','chatPause','../client','Request','GetChatQueue','name'];(function(_0x2918f1,_0x10cb79){var _0x3da12e=function(_0x498b0e){while(--_0x498b0e){_0x2918f1['push'](_0x2918f1['shift']());}};_0x3da12e(++_0x10cb79);}(_0x609d,0x11e));var _0xd609=function(_0x18b5fb,_0x36862b){_0x18b5fb=_0x18b5fb-0x0;var _0x56f0e2=_0x609d[_0x18b5fb];return _0x56f0e2;};'use strict';var client=require(_0xd609('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xd609('0x1')](_0xd609('0x2'),{'options':{'raw':![],'attributes':['id',_0xd609('0x3'),_0xd609('0x4'),_0xd609('0x5')],'include':[{'model':_0xd609('0x6'),'as':_0xd609('0x7'),'attributes':['id','name',_0xd609('0x8'),_0xd609('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index eca4276..3194f31 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 _0xf873=['CreateChatQueueReport','update','DESC','UpdateChatQueueReport','create','Request'];(function(_0x5984c0,_0x5171d8){var _0x2c6592=function(_0xcc298f){while(--_0xcc298f){_0x5984c0['push'](_0x5984c0['shift']());}};_0x2c6592(++_0x5171d8);}(_0xf873,0xb2));var _0x3f87=function(_0x1decbf,_0x13f487){_0x1decbf=_0x1decbf-0x0;var _0x18d7a2=_0xf873[_0x1decbf];return _0x18d7a2;};'use strict';var client=require('../client');exports[_0x3f87('0x0')]=function(_0x3545ce){return client[_0x3f87('0x1')](_0x3f87('0x2'),{'body':_0x3545ce,'log':_0x3f87('0x2')});};exports[_0x3f87('0x3')]=function(_0x2fbb4f,_0x1d68dd){return client[_0x3f87('0x1')]('UpdateChatQueueReport',{'body':_0x1d68dd,'options':{'where':{'uniqueid':_0x2fbb4f},'order':[['id',_0x3f87('0x4')]],'limit':0x1},'log':_0x3f87('0x5')});}; \ No newline at end of file +var _0xa7b4=['UpdateChatQueueReport','create','CreateChatQueueReport','Request'];(function(_0x3cbf67,_0x5eeb81){var _0x56d1e4=function(_0x53c9b3){while(--_0x53c9b3){_0x3cbf67['push'](_0x3cbf67['shift']());}};_0x56d1e4(++_0x5eeb81);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x36684c,_0xbab67){_0x36684c=_0x36684c-0x0;var _0x51ab53=_0xa7b4[_0x36684c];return _0x51ab53;};'use strict';var client=require('../client');exports[_0x4a7b('0x0')]=function(_0x1fb4cd){return client['Request'](_0x4a7b('0x1'),{'body':_0x1fb4cd,'log':_0x4a7b('0x1')});};exports['update']=function(_0x5de6a2,_0x4cadbf){return client[_0x4a7b('0x2')](_0x4a7b('0x3'),{'body':_0x4cadbf,'options':{'where':{'uniqueid':_0x5de6a2},'order':[['id','DESC']],'limit':0x1},'log':_0x4a7b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 86d105e..38f3454 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 _0x5874=['update','Request','UpdateFaxInteraction','updateFaxInteraction','AddTagsToFaxInteraction','../client'];(function(_0x1c7e8b,_0x33f9c5){var _0x57c32e=function(_0x15768f){while(--_0x15768f){_0x1c7e8b['push'](_0x1c7e8b['shift']());}};_0x57c32e(++_0x33f9c5);}(_0x5874,0x17f));var _0x4587=function(_0x32afeb,_0x36f4b9){_0x32afeb=_0x32afeb-0x0;var _0x2e2153=_0x5874[_0x32afeb];return _0x2e2153;};'use strict';var client=require(_0x4587('0x0'));exports[_0x4587('0x1')]=function(_0x2880d3,_0x5bfeaa){return client[_0x4587('0x2')](_0x4587('0x3'),{'body':_0x5bfeaa,'options':{'where':{'id':_0x2880d3}},'log':_0x4587('0x4')});};exports['addTags']=function(_0x2a39ac,_0x5e32bb){return client[_0x4587('0x2')](_0x4587('0x5'),{'body':_0x5e32bb,'options':{'where':{'id':_0x2a39ac}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x1629=['updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','update','UpdateFaxInteraction'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x1629,0xca));var _0x9162=function(_0xd35671,_0x36eb6a){_0xd35671=_0xd35671-0x0;var _0x3c5f3d=_0x1629[_0xd35671];return _0x3c5f3d;};'use strict';var client=require('../client');exports[_0x9162('0x0')]=function(_0x20349f,_0x4d5164){return client['Request'](_0x9162('0x1'),{'body':_0x4d5164,'options':{'where':{'id':_0x20349f}},'log':_0x9162('0x2')});};exports[_0x9162('0x3')]=function(_0x306b9f,_0x3821e9){return client['Request'](_0x9162('0x4'),{'body':_0x3821e9,'options':{'where':{'id':_0x306b9f}},'log':_0x9162('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a91c74c..e641a3f 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 _0xdf85=['CreateFaxMessage','createFaxMessage','create','Request'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xdf85,0x96));var _0x5df8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xdf85[_0x49b207];return _0x2dc8fa;};'use strict';var client=require('../client');exports[_0x5df8('0x0')]=function(_0x481169){return client[_0x5df8('0x1')](_0x5df8('0x2'),{'body':_0x481169,'log':_0x5df8('0x3')});}; \ No newline at end of file +var _0x0d5c=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x51ae61,_0x11dcc1){var _0x3446ce=function(_0x51c6f3){while(--_0x51c6f3){_0x51ae61['push'](_0x51ae61['shift']());}};_0x3446ce(++_0x11dcc1);}(_0x0d5c,0x1b4));var _0xc0d5=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x0d5c[_0x112fe3];return _0x1ec903;};'use strict';var client=require(_0xc0d5('0x0'));exports[_0xc0d5('0x1')]=function(_0x55a0c2){return client[_0xc0d5('0x2')](_0xc0d5('0x3'),{'body':_0x55a0c2,'log':_0xc0d5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4d392dd..bf17db0 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 _0xb196=['faxPause','../client','getFaxQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0x4df86b,_0x1a7d14){var _0x4e47a1=function(_0x879f9){while(--_0x879f9){_0x4df86b['push'](_0x4df86b['shift']());}};_0x4e47a1(++_0x1a7d14);}(_0xb196,0x83));var _0x6b19=function(_0x173346,_0x428b5a){_0x173346=_0x173346-0x0;var _0x89096c=_0xb196[_0x173346];return _0x89096c;};'use strict';var client=require(_0x6b19('0x0'));exports[_0x6b19('0x1')]=function(){return function(){return client[_0x6b19('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x6b19('0x3'),_0x6b19('0x4'),_0x6b19('0x5')],'include':[{'model':_0x6b19('0x6'),'as':_0x6b19('0x7'),'attributes':['id',_0x6b19('0x3'),_0x6b19('0x8'),_0x6b19('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x54d8=['Agents','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x54d8,0x82));var _0x854d=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x54d8[_0xa148b7];return _0x51efd3;};'use strict';var client=require(_0x854d('0x0'));exports[_0x854d('0x1')]=function(){return function(){return client[_0x854d('0x2')](_0x854d('0x3'),{'options':{'raw':![],'attributes':['id',_0x854d('0x4'),_0x854d('0x5'),'strategy'],'include':[{'model':'User','as':_0x854d('0x6'),'attributes':['id',_0x854d('0x4'),'online',_0x854d('0x7')]}]},'log':_0x854d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c377f73..a980923 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 _0x4dd1=['DESC','../client','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x500fb0,_0xc886fc){var _0x7b4c1c=function(_0x32a776){while(--_0x32a776){_0x500fb0['push'](_0x500fb0['shift']());}};_0x7b4c1c(++_0xc886fc);}(_0x4dd1,0xb0));var _0x14dd=function(_0x48121b,_0x48d994){_0x48121b=_0x48121b-0x0;var _0x45c17f=_0x4dd1[_0x48121b];return _0x45c17f;};'use strict';var client=require(_0x14dd('0x0'));exports['create']=function(_0x1832ed){return client[_0x14dd('0x1')](_0x14dd('0x2'),{'body':_0x1832ed,'log':_0x14dd('0x2')});};exports['update']=function(_0x14834f,_0x202a2c){return client[_0x14dd('0x1')](_0x14dd('0x3'),{'body':_0x202a2c,'options':{'where':{'uniqueid':_0x14834f},'order':[['id',_0x14dd('0x4')]],'limit':0x1},'log':_0x14dd('0x3')});}; \ No newline at end of file +var _0x35e2=['DESC','../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x35e2,0x1ed));var _0x235e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x35e2[_0x53ccf2];return _0x5a2964;};'use strict';var client=require(_0x235e('0x0'));exports['create']=function(_0x3a0f33){return client[_0x235e('0x1')](_0x235e('0x2'),{'body':_0x3a0f33,'log':'CreateFaxQueueReport'});};exports[_0x235e('0x3')]=function(_0x40f483,_0x23e633){return client[_0x235e('0x1')](_0x235e('0x4'),{'body':_0x23e633,'options':{'where':{'uniqueid':_0x40f483},'order':[['id',_0x235e('0x5')]],'limit':0x1},'log':_0x235e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f7968e3..47a0316 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 _0x1775=['Request','GetInterval','name','Interval','Intervals','interval','getIntervals'];(function(_0x45da29,_0x5af7ce){var _0x4ea4fb=function(_0x3abcb6){while(--_0x3abcb6){_0x45da29['push'](_0x45da29['shift']());}};_0x4ea4fb(++_0x5af7ce);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0x5177('0x0')]=function(){return function(){return client[_0x5177('0x1')](_0x5177('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5177('0x3')],'include':[{'model':_0x5177('0x4'),'as':_0x5177('0x5'),'attributes':['id',_0x5177('0x3'),_0x5177('0x6')]}]},'log':_0x5177('0x0')});};}; \ No newline at end of file +var _0x69d3=['Interval','interval','../client','getIntervals','Request','name'];(function(_0x3aac12,_0x5ce4a3){var _0x283857=function(_0x581ab6){while(--_0x581ab6){_0x3aac12['push'](_0x3aac12['shift']());}};_0x283857(++_0x5ce4a3);}(_0x69d3,0xda));var _0x369d=function(_0x75c0ba,_0x11d6e8){_0x75c0ba=_0x75c0ba-0x0;var _0x3641a7=_0x69d3[_0x75c0ba];return _0x3641a7;};'use strict';var client=require(_0x369d('0x0'));exports[_0x369d('0x1')]=function(){return function(){return client[_0x369d('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x369d('0x3')],'include':[{'model':_0x369d('0x4'),'as':'Intervals','attributes':['id','name',_0x369d('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index d935dae..6fb9fe7 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 _0xd288=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x680308,_0x1ba28f){var _0x4a8757=function(_0x20e8d4){while(--_0x20e8d4){_0x680308['push'](_0x680308['shift']());}};_0x4a8757(++_0x1ba28f);}(_0xd288,0x120));var _0x8d28=function(_0x3b7705,_0x10bc46){_0x3b7705=_0x3b7705-0x0;var _0xeb1e78=_0xd288[_0x3b7705];return _0xeb1e78;};'use strict';var client=require(_0x8d28('0x0'));exports[_0x8d28('0x1')]=function(_0x5c7c1d,_0x5883ad){return client[_0x8d28('0x2')](_0x8d28('0x3'),{'body':_0x5883ad,'options':{'where':{'id':_0x5c7c1d}},'log':_0x8d28('0x4')});};exports[_0x8d28('0x5')]=function(_0x565078,_0x1c8fa9){return client[_0x8d28('0x2')](_0x8d28('0x6'),{'body':_0x1c8fa9,'options':{'where':{'id':_0x565078}},'log':_0x8d28('0x7')});}; \ No newline at end of file +var _0x67b0=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67b0,0xc4));var _0x067b=function(_0x3e203e,_0x51d103){_0x3e203e=_0x3e203e-0x0;var _0x5427f3=_0x67b0[_0x3e203e];return _0x5427f3;};'use strict';var client=require('../client');exports[_0x067b('0x0')]=function(_0x53a6e1,_0x5e39f0){return client[_0x067b('0x1')](_0x067b('0x2'),{'body':_0x5e39f0,'options':{'where':{'id':_0x53a6e1}},'log':'updateMailInteraction'});};exports[_0x067b('0x3')]=function(_0x44f022,_0x1ee327){return client[_0x067b('0x1')](_0x067b('0x4'),{'body':_0x1ee327,'options':{'where':{'id':_0x44f022}},'log':_0x067b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e6bb7b6..a09d51b 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 _0x8ee4=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x40b99e,_0x493bef){var _0x3add58=function(_0x9779c3){while(--_0x9779c3){_0x40b99e['push'](_0x40b99e['shift']());}};_0x3add58(++_0x493bef);}(_0x8ee4,0x147));var _0x48ee=function(_0x264963,_0x4f7003){_0x264963=_0x264963-0x0;var _0x2c148f=_0x8ee4[_0x264963];return _0x2c148f;};'use strict';var client=require(_0x48ee('0x0'));exports[_0x48ee('0x1')]=function(_0x4037bb){return client['Request'](_0x48ee('0x2'),{'body':_0x4037bb,'log':_0x48ee('0x3')});}; \ No newline at end of file +var _0x4674=['createMailMessage','create','CreateMailMessage'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x4674,0x6a));var _0x4467=function(_0x50d0ba,_0x1f218f){_0x50d0ba=_0x50d0ba-0x0;var _0x28647d=_0x4674[_0x50d0ba];return _0x28647d;};'use strict';var client=require('../client');exports[_0x4467('0x0')]=function(_0x5dd3d0){return client['Request'](_0x4467('0x1'),{'body':_0x5dd3d0,'log':_0x4467('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c69ce31..70ab913 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 _0x742f=['GetMailQueue','name','timeout','strategy','User','Agents','online','../client','getMailQueues','Request'];(function(_0x696a16,_0x233dd2){var _0x47f27b=function(_0x410fca){while(--_0x410fca){_0x696a16['push'](_0x696a16['shift']());}};_0x47f27b(++_0x233dd2);}(_0x742f,0x6b));var _0xf742=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x742f[_0x3ab9ee];return _0x82ee88;};'use strict';var client=require(_0xf742('0x0'));exports[_0xf742('0x1')]=function(){return function(){return client[_0xf742('0x2')](_0xf742('0x3'),{'options':{'raw':![],'attributes':['id',_0xf742('0x4'),_0xf742('0x5'),_0xf742('0x6')],'include':[{'model':_0xf742('0x7'),'as':_0xf742('0x8'),'attributes':['id',_0xf742('0x4'),_0xf742('0x9'),'mailPause']}]},'log':_0xf742('0x1')});};}; \ No newline at end of file +var _0x3866=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','GetMailQueue','name'];(function(_0x376717,_0x592b99){var _0x4c3d32=function(_0x27b03c){while(--_0x27b03c){_0x376717['push'](_0x376717['shift']());}};_0x4c3d32(++_0x592b99);}(_0x3866,0x1d2));var _0x6386=function(_0x1748de,_0x42f2bb){_0x1748de=_0x1748de-0x0;var _0x12eb41=_0x3866[_0x1748de];return _0x12eb41;};'use strict';var client=require(_0x6386('0x0'));exports[_0x6386('0x1')]=function(){return function(){return client['Request'](_0x6386('0x2'),{'options':{'raw':![],'attributes':['id',_0x6386('0x3'),_0x6386('0x4'),_0x6386('0x5')],'include':[{'model':_0x6386('0x6'),'as':_0x6386('0x7'),'attributes':['id',_0x6386('0x3'),_0x6386('0x8'),_0x6386('0x9')]}]},'log':_0x6386('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 85a5aaa..62987bf 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 _0xa387=['Request','CreateMailQueueReport','DESC','UpdateMailQueueReport','../client','create'];(function(_0x273500,_0x5042d1){var _0xdb1722=function(_0x52f238){while(--_0x52f238){_0x273500['push'](_0x273500['shift']());}};_0xdb1722(++_0x5042d1);}(_0xa387,0x70));var _0x7a38=function(_0x469a28,_0x20d979){_0x469a28=_0x469a28-0x0;var _0x2019e8=_0xa387[_0x469a28];return _0x2019e8;};'use strict';var client=require(_0x7a38('0x0'));exports[_0x7a38('0x1')]=function(_0x47050e){return client[_0x7a38('0x2')](_0x7a38('0x3'),{'body':_0x47050e,'log':_0x7a38('0x3')});};exports['update']=function(_0x3e1626,_0x53236e){return client[_0x7a38('0x2')]('UpdateMailQueueReport',{'body':_0x53236e,'options':{'where':{'uniqueid':_0x3e1626},'order':[['id',_0x7a38('0x4')]],'limit':0x1},'log':_0x7a38('0x5')});}; \ No newline at end of file +var _0x2958=['UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','Request'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2958,0x74));var _0x8295=function(_0x2eed49,_0x111968){_0x2eed49=_0x2eed49-0x0;var _0x5d798c=_0x2958[_0x2eed49];return _0x5d798c;};'use strict';var client=require(_0x8295('0x0'));exports[_0x8295('0x1')]=function(_0x2e45bf){return client['Request'](_0x8295('0x2'),{'body':_0x2e45bf,'log':_0x8295('0x2')});};exports['update']=function(_0x1ead17,_0x53ebdb){return client[_0x8295('0x3')](_0x8295('0x4'),{'body':_0x53ebdb,'options':{'where':{'uniqueid':_0x1ead17},'order':[['id',_0x8295('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 50ef80c..ffbb1d3 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 _0xfadf=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x4a7389,_0xa99bd9){var _0x246ee8=function(_0x29cbb0){while(--_0x29cbb0){_0x4a7389['push'](_0x4a7389['shift']());}};_0x246ee8(++_0xa99bd9);}(_0xfadf,0x164));var _0xffad=function(_0x40dba8,_0x355a58){_0x40dba8=_0x40dba8-0x0;var _0xc6c12a=_0xfadf[_0x40dba8];return _0xc6c12a;};'use strict';var client=require(_0xffad('0x0'));exports[_0xffad('0x1')]=function(_0x12ac46,_0x37a2fe){return client[_0xffad('0x2')](_0xffad('0x3'),{'body':_0x37a2fe,'options':{'where':{'id':_0x12ac46}},'log':_0xffad('0x4')});};exports['addTags']=function(_0x4d2166,_0x52c3fd){return client[_0xffad('0x2')](_0xffad('0x5'),{'body':_0x52c3fd,'options':{'where':{'id':_0x4d2166}},'log':_0xffad('0x6')});}; \ No newline at end of file +var _0x6e18=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x6e18,0x1eb));var _0x86e1=function(_0x3feb08,_0x49ba14){_0x3feb08=_0x3feb08-0x0;var _0x597b30=_0x6e18[_0x3feb08];return _0x597b30;};'use strict';var client=require('../client');exports[_0x86e1('0x0')]=function(_0x3ad949,_0x56066e){return client[_0x86e1('0x1')](_0x86e1('0x2'),{'body':_0x56066e,'options':{'where':{'id':_0x3ad949}},'log':'updateOpenchannelInteraction'});};exports[_0x86e1('0x3')]=function(_0x2650f6,_0x55a552){return client[_0x86e1('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x55a552,'options':{'where':{'id':_0x2650f6}},'log':_0x86e1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d058582..2afc8a8 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 _0x00bb=['CreateOpenchannelMessage','../client','create'];(function(_0x45dd0e,_0x28e603){var _0x50e5ca=function(_0x46a412){while(--_0x46a412){_0x45dd0e['push'](_0x45dd0e['shift']());}};_0x50e5ca(++_0x28e603);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var client=require(_0xb00b('0x0'));exports[_0xb00b('0x1')]=function(_0x468a51){return client['Request'](_0xb00b('0x2'),{'body':_0x468a51,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xedd9,0xfc));var _0x9edd=function(_0x5032d0,_0x3e3eaa){_0x5032d0=_0x5032d0-0x0;var _0x6c64fd=_0xedd9[_0x5032d0];return _0x6c64fd;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 4510632..1d583f3 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 _0xf3d1=['../client','getOpenchannelQueues','name','timeout','strategy','Agents','online','openchannelPause'];(function(_0x200ae5,_0x69f648){var _0x47bc67=function(_0x21d46b){while(--_0x21d46b){_0x200ae5['push'](_0x200ae5['shift']());}};_0x47bc67(++_0x69f648);}(_0xf3d1,0x1a8));var _0x1f3d=function(_0x19cce8,_0x23a814){_0x19cce8=_0x19cce8-0x0;var _0x575f93=_0xf3d1[_0x19cce8];return _0x575f93;};'use strict';var client=require(_0x1f3d('0x0'));exports[_0x1f3d('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x1f3d('0x2'),_0x1f3d('0x3'),_0x1f3d('0x4')],'include':[{'model':'User','as':_0x1f3d('0x5'),'attributes':['id',_0x1f3d('0x2'),_0x1f3d('0x6'),_0x1f3d('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xe542=['openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','User','Agents'];(function(_0x5daf92,_0x45021e){var _0x522c96=function(_0x556bcd){while(--_0x556bcd){_0x5daf92['push'](_0x5daf92['shift']());}};_0x522c96(++_0x45021e);}(_0xe542,0x13d));var _0x2e54=function(_0x5a9559,_0x4568c2){_0x5a9559=_0x5a9559-0x0;var _0x1a03f8=_0xe542[_0x5a9559];return _0x1a03f8;};'use strict';var client=require(_0x2e54('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x2e54('0x1')](_0x2e54('0x2'),{'options':{'raw':![],'attributes':['id',_0x2e54('0x3'),_0x2e54('0x4'),'strategy'],'include':[{'model':_0x2e54('0x5'),'as':_0x2e54('0x6'),'attributes':['id',_0x2e54('0x3'),'online',_0x2e54('0x7')]}]},'log':_0x2e54('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index af182af..0489580 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 _0xe790=['../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x2aa158,_0x4adafc){var _0x21a3f4=function(_0x2cb389){while(--_0x2cb389){_0x2aa158['push'](_0x2aa158['shift']());}};_0x21a3f4(++_0x4adafc);}(_0xe790,0xb4));var _0x0e79=function(_0xe8dcbe,_0xd01727){_0xe8dcbe=_0xe8dcbe-0x0;var _0x1f5411=_0xe790[_0xe8dcbe];return _0x1f5411;};'use strict';var client=require(_0x0e79('0x0'));exports['create']=function(_0x253adf){return client[_0x0e79('0x1')](_0x0e79('0x2'),{'body':_0x253adf,'log':_0x0e79('0x2')});};exports[_0x0e79('0x3')]=function(_0x4066b0,_0x2848ba){return client[_0x0e79('0x1')](_0x0e79('0x4'),{'body':_0x2848ba,'options':{'where':{'uniqueid':_0x4066b0},'order':[['id','DESC']],'limit':0x1},'log':_0x0e79('0x4')});}; \ No newline at end of file +var _0xe51b=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x37f220,_0xf0f4ba){var _0x52b81d=function(_0x55de2e){while(--_0x55de2e){_0x37f220['push'](_0x37f220['shift']());}};_0x52b81d(++_0xf0f4ba);}(_0xe51b,0x162));var _0xbe51=function(_0x32b1b6,_0x31851e){_0x32b1b6=_0x32b1b6-0x0;var _0x3c8540=_0xe51b[_0x32b1b6];return _0x3c8540;};'use strict';var client=require(_0xbe51('0x0'));exports[_0xbe51('0x1')]=function(_0x2adf4c){return client[_0xbe51('0x2')](_0xbe51('0x3'),{'body':_0x2adf4c,'log':'CreateOpenchannelQueueReport'});};exports[_0xbe51('0x4')]=function(_0x3ad45a,_0x2efedc){return client[_0xbe51('0x2')](_0xbe51('0x5'),{'body':_0x2efedc,'options':{'where':{'uniqueid':_0x3ad45a},'order':[['id','DESC']],'limit':0x1},'log':_0xbe51('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index ea5f239..f3ce272 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 _0x4ed4=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','Request','updateSmsInteraction'];(function(_0x44036f,_0x367150){var _0x55a334=function(_0x3014c0){while(--_0x3014c0){_0x44036f['push'](_0x44036f['shift']());}};_0x55a334(++_0x367150);}(_0x4ed4,0x80));var _0x44ed=function(_0x1d7206,_0x551236){_0x1d7206=_0x1d7206-0x0;var _0x86f66=_0x4ed4[_0x1d7206];return _0x86f66;};'use strict';var client=require('../client');exports['update']=function(_0x414512,_0x3118c5){return client[_0x44ed('0x0')]('UpdateSmsInteraction',{'body':_0x3118c5,'options':{'where':{'id':_0x414512}},'log':_0x44ed('0x1')});};exports[_0x44ed('0x2')]=function(_0x3c4f41,_0x4c4d03){return client[_0x44ed('0x0')](_0x44ed('0x3'),{'body':_0x4c4d03,'options':{'where':{'id':_0x3c4f41}},'log':_0x44ed('0x4')});}; \ No newline at end of file +var _0xbabc=['addTags','addTagsToSmsInteraction','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x5ee73b,_0x282c4c){var _0x22948a=function(_0x4bb79b){while(--_0x4bb79b){_0x5ee73b['push'](_0x5ee73b['shift']());}};_0x22948a(++_0x282c4c);}(_0xbabc,0x1da));var _0xcbab=function(_0x290a62,_0x3703d9){_0x290a62=_0x290a62-0x0;var _0x5b0259=_0xbabc[_0x290a62];return _0x5b0259;};'use strict';var client=require('../client');exports['update']=function(_0x1ea02b,_0x26f5a1){return client['Request'](_0xcbab('0x0'),{'body':_0x26f5a1,'options':{'where':{'id':_0x1ea02b}},'log':_0xcbab('0x1')});};exports[_0xcbab('0x2')]=function(_0x421f11,_0x44ae2d){return client['Request']('AddTagsToSmsInteraction',{'body':_0x44ae2d,'options':{'where':{'id':_0x421f11}},'log':_0xcbab('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3036735..a0cfc29 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 _0xc521=['createSmsMessage','../client','Request'];(function(_0x2865c9,_0x575948){var _0x585985=function(_0x3f03c2){while(--_0x3f03c2){_0x2865c9['push'](_0x2865c9['shift']());}};_0x585985(++_0x575948);}(_0xc521,0x67));var _0x1c52=function(_0x593ef3,_0x4d54bd){_0x593ef3=_0x593ef3-0x0;var _0x12f0e=_0xc521[_0x593ef3];return _0x12f0e;};'use strict';var client=require(_0x1c52('0x0'));exports['create']=function(_0x1e1707){return client[_0x1c52('0x1')]('CreateSmsMessage',{'body':_0x1e1707,'log':_0x1c52('0x2')});}; \ No newline at end of file +var _0xe936=['createSmsMessage','../client','create'];(function(_0x3e91c7,_0x1c1ad6){var _0x3d84a4=function(_0x52f816){while(--_0x52f816){_0x3e91c7['push'](_0x3e91c7['shift']());}};_0x3d84a4(++_0x1c1ad6);}(_0xe936,0x157));var _0x6e93=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0xe936[_0x10316a];return _0x36ac2e;};'use strict';var client=require(_0x6e93('0x0'));exports[_0x6e93('0x1')]=function(_0x364028){return client['Request']('CreateSmsMessage',{'body':_0x364028,'log':_0x6e93('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 40cbf97..bdabd1b 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 _0xa204=['Request','GetSmsQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0x2fdf37,_0x1a4f02){var _0x20933b=function(_0x564689){while(--_0x564689){_0x2fdf37['push'](_0x2fdf37['shift']());}};_0x20933b(++_0x1a4f02);}(_0xa204,0xbc));var _0x4a20=function(_0x3e8ff8,_0x53eba4){_0x3e8ff8=_0x3e8ff8-0x0;var _0x3c8315=_0xa204[_0x3e8ff8];return _0x3c8315;};'use strict';var client=require(_0x4a20('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x4a20('0x1')](_0x4a20('0x2'),{'options':{'raw':![],'attributes':['id',_0x4a20('0x3'),_0x4a20('0x4'),_0x4a20('0x5')],'include':[{'model':_0x4a20('0x6'),'as':_0x4a20('0x7'),'attributes':['id',_0x4a20('0x3'),_0x4a20('0x8'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x5373=['timeout','strategy','User','online','smsPause','../client','getSmsQueues','Request','GetSmsQueue','name'];(function(_0x50aa69,_0x334f19){var _0x31477b=function(_0x35aca8){while(--_0x35aca8){_0x50aa69['push'](_0x50aa69['shift']());}};_0x31477b(++_0x334f19);}(_0x5373,0xcd));var _0x3537=function(_0x1947bf,_0x40f1ff){_0x1947bf=_0x1947bf-0x0;var _0x1230e1=_0x5373[_0x1947bf];return _0x1230e1;};'use strict';var client=require(_0x3537('0x0'));exports[_0x3537('0x1')]=function(){return function(){return client[_0x3537('0x2')](_0x3537('0x3'),{'options':{'raw':![],'attributes':['id',_0x3537('0x4'),_0x3537('0x5'),_0x3537('0x6')],'include':[{'model':_0x3537('0x7'),'as':'Agents','attributes':['id',_0x3537('0x4'),_0x3537('0x8'),_0x3537('0x9')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f4e45b1..85d329e 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 _0xfcae=['create','Request','CreateSmsQueueReport','update','DESC','UpdateSmsQueueReport','../client'];(function(_0xba0137,_0x34353e){var _0x563fcc=function(_0x47c7d4){while(--_0x47c7d4){_0xba0137['push'](_0xba0137['shift']());}};_0x563fcc(++_0x34353e);}(_0xfcae,0x141));var _0xefca=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xfcae[_0x16d10f];return _0x50c823;};'use strict';var client=require(_0xefca('0x0'));exports[_0xefca('0x1')]=function(_0x23256c){return client[_0xefca('0x2')](_0xefca('0x3'),{'body':_0x23256c,'log':'CreateSmsQueueReport'});};exports[_0xefca('0x4')]=function(_0x2bced9,_0x56a065){return client[_0xefca('0x2')]('UpdateSmsQueueReport',{'body':_0x56a065,'options':{'where':{'uniqueid':_0x2bced9},'order':[['id',_0xefca('0x5')]],'limit':0x1},'log':_0xefca('0x6')});}; \ No newline at end of file +var _0xd8a2=['update','DESC','../client','create','Request','CreateSmsQueueReport'];(function(_0x5e0ca2,_0x20ad2c){var _0x2e6a12=function(_0xc9dd05){while(--_0xc9dd05){_0x5e0ca2['push'](_0x5e0ca2['shift']());}};_0x2e6a12(++_0x20ad2c);}(_0xd8a2,0x128));var _0x2d8a=function(_0x240609,_0x527853){_0x240609=_0x240609-0x0;var _0xb394ce=_0xd8a2[_0x240609];return _0xb394ce;};'use strict';var client=require(_0x2d8a('0x0'));exports[_0x2d8a('0x1')]=function(_0x1e8391){return client[_0x2d8a('0x2')](_0x2d8a('0x3'),{'body':_0x1e8391,'log':_0x2d8a('0x3')});};exports[_0x2d8a('0x4')]=function(_0x47cd9f,_0x2eb13d){return client[_0x2d8a('0x2')]('UpdateSmsQueueReport',{'body':_0x2eb13d,'options':{'where':{'uniqueid':_0x47cd9f},'order':[['id',_0x2d8a('0x5')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 835743d..d4b29a2 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 _0xf7bb=['faxCapacity','smsCapacity','../client','getAgents','Request','GetUser','name','lastPauseAt','chatPause','faxPause','smsPause','chatCapacity','mailCapacity'];(function(_0x573e3e,_0x1a8b5d){var _0xbb1424=function(_0x1c67f2){while(--_0x1c67f2){_0x573e3e['push'](_0x573e3e['shift']());}};_0xbb1424(++_0x1a8b5d);}(_0xf7bb,0xab));var _0xbf7b=function(_0x2d3bf8,_0x544a00){_0x2d3bf8=_0x2d3bf8-0x0;var _0x37ec29=_0xf7bb[_0x2d3bf8];return _0x37ec29;};'use strict';var client=require(_0xbf7b('0x0'));exports[_0xbf7b('0x1')]=function(){return function(){return client[_0xbf7b('0x2')](_0xbf7b('0x3'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0xbf7b('0x4'),'online','pauseType',_0xbf7b('0x5'),'voicePause',_0xbf7b('0x6'),'mailPause',_0xbf7b('0x7'),_0xbf7b('0x8'),'openchannelPause',_0xbf7b('0x9'),_0xbf7b('0xa'),_0xbf7b('0xb'),_0xbf7b('0xc'),'openchannelCapacity']},'log':_0xbf7b('0x1')});};}; \ No newline at end of file +var _0x3170=['chatPause','faxPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','online','pauseType','lastPauseAt','voicePause'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3170,0x1c2));var _0x0317=function(_0x1487e1,_0x373c69){_0x1487e1=_0x1487e1-0x0;var _0x278e9d=_0x3170[_0x1487e1];return _0x278e9d;};'use strict';var client=require(_0x0317('0x0'));exports[_0x0317('0x1')]=function(){return function(){return client[_0x0317('0x2')](_0x0317('0x3'),{'options':{'raw':!![],'where':{'role':_0x0317('0x4')},'attributes':['id','name',_0x0317('0x5'),_0x0317('0x6'),_0x0317('0x7'),_0x0317('0x8'),_0x0317('0x9'),'mailPause',_0x0317('0xa'),'smsPause',_0x0317('0xb'),_0x0317('0xc'),_0x0317('0xd'),_0x0317('0xe'),_0x0317('0xf'),_0x0317('0x10')]},'log':_0x0317('0x1')});};}; \ 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 efceed4..2bf4b5d 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 _0x86ed=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','close','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','name','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','./strategy','string'];(function(_0x48b671,_0x3420ee){var _0x273fc8=function(_0x4c73e9){while(--_0x4c73e9){_0x48b671['push'](_0x48b671['shift']());}};_0x273fc8(++_0x3420ee);}(_0x86ed,0x1b7));var _0xd86e=function(_0x52c049,_0x1cb4ee){_0x52c049=_0x52c049-0x0;var _0x77cda7=_0x86ed[_0x52c049];return _0x77cda7;};'use strict';var schema=require(_0xd86e('0x0'));var _=require(_0xd86e('0x1'));var util=require('util');var seqqueue=require(_0xd86e('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xd86e('0x3'));var queue=schema({'name':{'type':_0xd86e('0x4'),'required':!![],'message':_0xd86e('0x5')},'timeout':{'type':_0xd86e('0x6'),'message':_0xd86e('0x7')}});function writeLog(_0x1bea78,_0xd473a0,_0x4634e8){return logger[_0xd86e('0x8')](util[_0xd86e('0x9')](_0xd86e('0xa'),_0x1bea78,_0xd473a0['name'],_0x4634e8));}function handleFindAgent(_0xb19a93){return function(_0x17d68d){return _0x17d68d['name'][_0xd86e('0xb')]()===_0xb19a93['toLowerCase']();};}exports[_0xd86e('0xc')]=function(_0x5f5be5,_0x452a01,_0x6e3d6e,_0x41aca5){return function(_0x551217){try{var _0x1621ba={'name':_0x452a01[0x0],'timeout':_0x452a01[0x1]};var _0x14f07e=queue['validate'](_0x1621ba,{'typecast':!![]});if(_0x14f07e[_0xd86e('0xd')]){logger[_0xd86e('0xe')](_0xd86e('0xf'),_0x5f5be5,_[_0xd86e('0x10')](_0x14f07e,_0xd86e('0x11'))[_0xd86e('0x12')](',\x20'));_0x551217[_0xd86e('0x13')]();}else{var _0x5660e9=_[_0xd86e('0x14')](_0x6e3d6e[_0xd86e('0x15')],handleFindAgent(_0x1621ba['name']));if(_0x5660e9){var _0x5709b3=(_0x1621ba[_0xd86e('0x16')]||0xa)*0x3e8;var _0x558710,_0x5bed71;var _0x2757f2=seqqueue[_0xd86e('0x17')](_0x5709b3);_0x2757f2['id']=_0x5f5be5;_0x2757f2['atimeout']=_0x5709b3;_0x2757f2[_0xd86e('0x18')]=_0x41aca5[_0xd86e('0x18')];writeLog(_0x5f5be5,_0x5660e9,util[_0xd86e('0x9')](_0xd86e('0x19'),_0x5709b3));_0x6e3d6e['rules'][_0x5f5be5]['on']('end',function(){_0x2757f2[_0xd86e('0x1a')]();clearTimeout(_0x5bed71);_0x5bed71=undefined;if(_0x6e3d6e[_0xd86e('0x1b')][_0x5f5be5]){delete _0x6e3d6e[_0xd86e('0x1b')][_0x5f5be5];}logger['info'](_0xd86e('0x1c'),_0x5f5be5);_0x551217['stop']();});_0x5bed71=setTimeout(function(){clearTimeout(_0x5bed71);_0x2757f2[_0xd86e('0x1a')]();logger[_0xd86e('0x8')](_0xd86e('0x1d'),_0x5f5be5);_0x551217[_0xd86e('0x1e')]();},_0x5709b3);strategy[_0xd86e('0x1f')](_0x2757f2,_0x5660e9,_0x6e3d6e,_0x41aca5);}else{logger[_0xd86e('0xe')](_0xd86e('0x20'),_0x5f5be5,_0x1621ba[_0xd86e('0x21')]);_0x551217['stop']();}}}catch(_0x242194){console[_0xd86e('0x22')](_0x242194);logger[_0xd86e('0xe')](_0xd86e('0x23'),_0x5f5be5,_0x242194[_0xd86e('0x24')]);_0x551217[_0xd86e('0x13')]();}};}; \ No newline at end of file +var _0x0e4e=['format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','stop','find','agents','createQueue','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info'];(function(_0x2399e5,_0x277341){var _0x50dc2c=function(_0x48412f){while(--_0x48412f){_0x2399e5['push'](_0x2399e5['shift']());}};_0x50dc2c(++_0x277341);}(_0x0e4e,0x83));var _0xe0e4=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x0e4e[_0x264545];return _0x114d10;};'use strict';var schema=require(_0xe0e4('0x0'));var _=require(_0xe0e4('0x1'));var util=require(_0xe0e4('0x2'));var seqqueue=require(_0xe0e4('0x3'));var logger=require(_0xe0e4('0x4'))(_0xe0e4('0x5'));var strategy=require(_0xe0e4('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xe0e4('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x5ec4ca,_0x1d55ae,_0x2f164b){return logger[_0xe0e4('0x8')](util[_0xe0e4('0x9')](_0xe0e4('0xa'),_0x5ec4ca,_0x1d55ae[_0xe0e4('0xb')],_0x2f164b));}function handleFindAgent(_0x2333a3){return function(_0x12a1de){return _0x12a1de['name']['toLowerCase']()===_0x2333a3[_0xe0e4('0xc')]();};}exports[_0xe0e4('0xd')]=function(_0x5ccee7,_0x20da2b,_0x4063a5,_0x8d3d60){return function(_0xe19f9b){try{var _0x75c11d={'name':_0x20da2b[0x0],'timeout':_0x20da2b[0x1]};var _0x459cd0=queue[_0xe0e4('0x0')](_0x75c11d,{'typecast':!![]});if(_0x459cd0[_0xe0e4('0xe')]){logger['error'](_0xe0e4('0xf'),_0x5ccee7,_[_0xe0e4('0x10')](_0x459cd0,_0xe0e4('0x11'))['join'](',\x20'));_0xe19f9b[_0xe0e4('0x12')]();}else{var _0x29c8cd=_[_0xe0e4('0x13')](_0x4063a5[_0xe0e4('0x14')],handleFindAgent(_0x75c11d[_0xe0e4('0xb')]));if(_0x29c8cd){var _0x2bfeb8=(_0x75c11d['timeout']||0xa)*0x3e8;var _0x25a86a,_0x396c04;var _0x3edb50=seqqueue[_0xe0e4('0x15')](_0x2bfeb8);_0x3edb50['id']=_0x5ccee7;_0x3edb50['atimeout']=_0x2bfeb8;_0x3edb50[_0xe0e4('0x16')]=_0x8d3d60[_0xe0e4('0x16')];writeLog(_0x5ccee7,_0x29c8cd,util['format'](_0xe0e4('0x17'),_0x2bfeb8));_0x4063a5[_0xe0e4('0x18')][_0x5ccee7]['on']('end',function(){_0x3edb50['close']();clearTimeout(_0x396c04);_0x396c04=undefined;if(_0x4063a5[_0xe0e4('0x18')][_0x5ccee7]){delete _0x4063a5[_0xe0e4('0x18')][_0x5ccee7];}logger[_0xe0e4('0x8')](_0xe0e4('0x19'),_0x5ccee7);_0xe19f9b[_0xe0e4('0x12')]();});_0x396c04=setTimeout(function(){clearTimeout(_0x396c04);_0x3edb50[_0xe0e4('0x1a')]();logger[_0xe0e4('0x8')](_0xe0e4('0x1b'),_0x5ccee7);_0xe19f9b[_0xe0e4('0x1c')]();},_0x2bfeb8);strategy[_0xe0e4('0x1d')](_0x3edb50,_0x29c8cd,_0x4063a5,_0x8d3d60);}else{logger[_0xe0e4('0x1e')](_0xe0e4('0x1f'),_0x5ccee7,_0x75c11d[_0xe0e4('0xb')]);_0xe19f9b[_0xe0e4('0x12')]();}}}catch(_0x44615a){console[_0xe0e4('0x20')](_0x44615a);logger[_0xe0e4('0x1e')](_0xe0e4('0x21'),_0x5ccee7,_0x44615a[_0xe0e4('0x22')]);_0xe19f9b[_0xe0e4('0x12')]();}};}; \ 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 dbc9b79..a9227ed 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 _0xd910=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','amazonlex','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','chat','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x1b1f1b,_0x3f3198){var _0x216eec=function(_0x4f4895){while(--_0x4f4895){_0x1b1f1b['push'](_0x1b1f1b['shift']());}};_0x216eec(++_0x3f3198);}(_0xd910,0x13c));var _0x0d91=function(_0x3e4c70,_0x4f414f){_0x3e4c70=_0x3e4c70-0x0;var _0x5adba2=_0xd910[_0x3e4c70];return _0x5adba2;};'use strict';var _=require(_0x0d91('0x0'));var moment=require(_0x0d91('0x1'));var AWS=require(_0x0d91('0x2'));var utils=require(_0x0d91('0x3'));var logger=require(_0x0d91('0x4'))(_0x0d91('0x5'));var rpc={'chatMessage':require(_0x0d91('0x6')),'openchannelMessage':require(_0x0d91('0x7')),'mailMessage':require(_0x0d91('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x0d91('0x9')]=function(_0x215793,_0x3593a2){return function(_0x4a81a8){try{if(!_[_0x0d91('0xa')](this[_0x0d91('0xb')][_0x0d91('0xc')])){logger[_0x0d91('0xd')](_0x0d91('0xe'),_0x215793,_0x0d91('0xf'));return _0x4a81a8[_0x0d91('0x10')]();}var _0x4d1be4={'ContactId':this[_0x0d91('0x11')]['id'],'sentAt':moment()[_0x0d91('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0d91('0x13')};var _0x2a1a59=this[_0x0d91('0x14')];if(_0x2a1a59===_0x0d91('0x15')){_0x4d1be4['ChatWebsiteId']=this[_0x0d91('0x16')]['id'];}else{_0x4d1be4[_[_0x0d91('0x17')](_0x2a1a59)+'AccountId']=this[_0x0d91('0x16')]['id'];}_0x4d1be4[_[_0x0d91('0x17')](_0x2a1a59)+_0x0d91('0x18')]=this[_0x0d91('0xb')]['id'];if(this[_0x0d91('0xb')]['created']){var _0x14e417=_0x3593a2[0x4];if(!_[_0x0d91('0x19')](_0x14e417)){_0x4d1be4[_0x0d91('0x1a')]=utils[_0x0d91('0x1b')](_0x14e417,this);return rpc[_0x2a1a59+_0x0d91('0x1c')][_0x0d91('0x1d')](_0x4d1be4)[_0x0d91('0x1e')](function(_0x1689cb){logger[_0x0d91('0xd')](_0x0d91('0xe'),_0x215793,_0x4d1be4[_0x0d91('0x1a')]);})[_0x0d91('0x1f')](function(_0x563ec9){logger[_0x0d91('0x20')](_0x0d91('0xe'),_0x215793,JSON[_0x0d91('0x21')](_0x563ec9));})[_0x0d91('0x22')](function(){logger[_0x0d91('0xd')](_0x0d91('0x23'),_0x215793);_0x4a81a8[_0x0d91('0x24')]();});}else{logger['info'](_0x0d91('0x25'),_0x215793);_0x4a81a8[_0x0d91('0x24')]();}}else{var _0x5ab0f8=this;var _0x3d4e64=new AWS[(_0x0d91('0x26'))]({'accessKeyId':_0x3593a2[0x0],'secretAccessKey':_0x3593a2[0x1],'region':_0x3593a2[0x2]});var _0x371469={'botAlias':_0x0d91('0x27'),'botName':_0x3593a2[0x3],'inputText':this[_0x0d91('0x28')]['body'],'userId':this[_0x0d91('0xb')]['id']['toString']()};_0x3d4e64[_0x0d91('0x29')](_0x371469,function(_0x528d44,_0x4bfa0e){if(_0x528d44){logger[_0x0d91('0x20')]('[%s][AMAZONLEX]\x20%s',_0x215793,_0x528d44['message']);_0x4a81a8['next']();}else if(_0x4bfa0e&&_0x4bfa0e[_0x0d91('0x28')]){_0x5ab0f8[_0x0d91('0x1a')][_0x0d91('0x2a')]=_0x4bfa0e;_0x4d1be4[_0x0d91('0x1a')]=_0x4bfa0e[_0x0d91('0x28')];return rpc[_0x2a1a59+_0x0d91('0x1c')][_0x0d91('0x1d')](_0x4d1be4)['then'](function(_0x3c4cd0){logger['info'](_0x0d91('0xe'),_0x215793,_0x4d1be4['body']);if(_0x4bfa0e['dialogState']==_0x0d91('0x2b')){_0x4a81a8[_0x0d91('0x10')]();}else{_0x4a81a8[_0x0d91('0x24')]();}})['catch'](function(_0x4e109b){logger[_0x0d91('0x20')](_0x0d91('0xe'),_0x215793,JSON[_0x0d91('0x21')](_0x4e109b));_0x4a81a8['next']();});}else{_0x4a81a8['next']();}});}}catch(_0xc3614f){logger[_0x0d91('0x20')](_0x0d91('0xe'),_0x215793,JSON[_0x0d91('0x21')](_0xc3614f));_0x4a81a8[_0x0d91('0x24')]();}};}; \ No newline at end of file +var _0x679a=['created','isEmpty','body','getMustacheRender','Message','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','create','Failed','lodash','aws-sdk','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','UserId','info','next','contact','out','chat','ChatWebsiteId','upperFirst','AccountId','account','interaction'];(function(_0x38fea6,_0x3eb746){var _0x16171f=function(_0x7bf93){while(--_0x7bf93){_0x38fea6['push'](_0x38fea6['shift']());}};_0x16171f(++_0x3eb746);}(_0x679a,0x1cd));var _0xa679=function(_0x10119b,_0x2cea53){_0x10119b=_0x10119b-0x0;var _0x312aa9=_0x679a[_0x10119b];return _0x312aa9;};'use strict';var _=require(_0xa679('0x0'));var moment=require('moment');var AWS=require(_0xa679('0x1'));var utils=require(_0xa679('0x2'));var logger=require('../../../../config/logger')(_0xa679('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa679('0x4')),'mailMessage':require(_0xa679('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa679('0x6'))};exports['consequence']=function(_0x4f5c32,_0xa9371){return function(_0x3f4056){try{if(!_[_0xa679('0x7')](this['interaction'][_0xa679('0x8')])){logger[_0xa679('0x9')]('[%s][AMAZONLEX]\x20%s',_0x4f5c32,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3f4056[_0xa679('0xa')]();}var _0x373121={'ContactId':this[_0xa679('0xb')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa679('0xc')};var _0x5e980b=this['channel'];if(_0x5e980b===_0xa679('0xd')){_0x373121[_0xa679('0xe')]=this['account']['id'];}else{_0x373121[_[_0xa679('0xf')](_0x5e980b)+_0xa679('0x10')]=this[_0xa679('0x11')]['id'];}_0x373121[_[_0xa679('0xf')](_0x5e980b)+'InteractionId']=this[_0xa679('0x12')]['id'];if(this[_0xa679('0x12')][_0xa679('0x13')]){var _0x398ff0=_0xa9371[0x4];if(!_[_0xa679('0x14')](_0x398ff0)){_0x373121[_0xa679('0x15')]=utils[_0xa679('0x16')](_0x398ff0,this);return rpc[_0x5e980b+_0xa679('0x17')]['create'](_0x373121)[_0xa679('0x18')](function(_0x11c577){logger[_0xa679('0x9')](_0xa679('0x19'),_0x4f5c32,_0x373121['body']);})[_0xa679('0x1a')](function(_0x591fa3){logger[_0xa679('0x1b')](_0xa679('0x19'),_0x4f5c32,JSON[_0xa679('0x1c')](_0x591fa3));})[_0xa679('0x1d')](function(){logger[_0xa679('0x9')](_0xa679('0x1e'),_0x4f5c32);_0x3f4056[_0xa679('0x1f')]();});}else{logger[_0xa679('0x9')](_0xa679('0x20'),_0x4f5c32);_0x3f4056['stop']();}}else{var _0x39a35d=this;var _0xc369f4=new AWS[(_0xa679('0x21'))]({'accessKeyId':_0xa9371[0x0],'secretAccessKey':_0xa9371[0x1],'region':_0xa9371[0x2]});var _0x420e3b={'botAlias':_0xa679('0x22'),'botName':_0xa9371[0x3],'inputText':this[_0xa679('0x23')][_0xa679('0x15')],'userId':this[_0xa679('0x12')]['id'][_0xa679('0x24')]()};_0xc369f4[_0xa679('0x25')](_0x420e3b,function(_0x232404,_0x908c80){if(_0x232404){logger[_0xa679('0x1b')](_0xa679('0x19'),_0x4f5c32,_0x232404['message']);_0x3f4056[_0xa679('0xa')]();}else if(_0x908c80&&_0x908c80[_0xa679('0x23')]){_0x39a35d[_0xa679('0x15')]['amazonlex']=_0x908c80;_0x373121['body']=_0x908c80['message'];return rpc[_0x5e980b+_0xa679('0x17')][_0xa679('0x26')](_0x373121)[_0xa679('0x18')](function(_0x297735){logger[_0xa679('0x9')](_0xa679('0x19'),_0x4f5c32,_0x373121[_0xa679('0x15')]);if(_0x908c80['dialogState']==_0xa679('0x27')){_0x3f4056[_0xa679('0xa')]();}else{_0x3f4056['stop']();}})[_0xa679('0x1a')](function(_0xe2c72b){logger[_0xa679('0x1b')](_0xa679('0x19'),_0x4f5c32,JSON[_0xa679('0x1c')](_0xe2c72b));_0x3f4056[_0xa679('0xa')]();});}else{_0x3f4056['next']();}});}}catch(_0x44aac8){logger['error'](_0xa679('0x19'),_0x4f5c32,JSON['stringify'](_0x44aac8));_0x3f4056[_0xa679('0x1f')]();}};}; \ 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 2b19d89..6e1e420 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 _0x9c44=['message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','mail','service','host','Smtp','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','body','','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','next','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../mailRpc','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','channel','getMustacheRender','contact','out'];(function(_0x17bef5,_0x423104){var _0x3f92d1=function(_0x1b2f28){while(--_0x1b2f28){_0x17bef5['push'](_0x17bef5['shift']());}};_0x3f92d1(++_0x423104);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x49c4('0x0'));var logger=require(_0x49c4('0x1'))(_0x49c4('0x2'));var rpc={'chatMessage':require(_0x49c4('0x3')),'openchannelMessage':require(_0x49c4('0x4')),'mailMessage':require(_0x49c4('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x49c4('0x6'));exports['consequence']=function(_0xc1278f,_0x6030ae){return function(_0x69bc41){try{if(_0x6030ae[0x0]==='1'&&(_[_0x49c4('0x7')](this[_0x49c4('0x8')]['created'])||!this[_0x49c4('0x8')][_0x49c4('0x9')])){logger[_0x49c4('0xa')](_0x49c4('0xb'),_0xc1278f,'Autoreply\x20already\x20sent');return _0x69bc41['next']();}var _0x451ea6=this[_0x49c4('0xc')];var _0x58cad7={'body':utils[_0x49c4('0xd')](_0x6030ae[0x1],this),'ContactId':this[_0x49c4('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x49c4('0xf')};if(this[_0x49c4('0x10')]){_0x58cad7['to']=this['message'][_0x49c4('0x11')]||'';_0x58cad7['cc']=this[_0x49c4('0x10')]['cc']||'';_0x58cad7['from']=this[_0x49c4('0x10')]['to']||'';_0x58cad7[_0x49c4('0x12')]=this[_0x49c4('0x10')][_0x49c4('0x12')]||'';_0x58cad7[_0x49c4('0x13')]=!![];if(this[_0x49c4('0x10')][_0x49c4('0x14')]){_0x58cad7[_0x49c4('0x14')]='';_0x58cad7['subject']+=_[_0x49c4('0x15')](this[_0x49c4('0x10')][_0x49c4('0x14')],_0x49c4('0x16'))?'':_0x49c4('0x17');_0x58cad7['subject']+=this[_0x49c4('0x10')][_0x49c4('0x14')];}}if(this['channel']==='chat'){_0x58cad7[_0x49c4('0x18')]=this[_0x49c4('0x19')]['id'];}else{_0x58cad7[_[_0x49c4('0x1a')](this['channel'])+_0x49c4('0x1b')]=this['account']['id'];}_0x58cad7[_[_0x49c4('0x1a')](this[_0x49c4('0xc')])+_0x49c4('0x1c')]=this[_0x49c4('0x8')]['id'];if(rpc[this[_0x49c4('0xc')]+_0x49c4('0x1d')]){if(this[_0x49c4('0xc')]===_0x49c4('0x1e')){var _0x2197d2={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x2197d2[_0x49c4('0x1f')]=this['account']['Smtp'][_0x49c4('0x1f')];}else{_0x2197d2[_0x49c4('0x20')]=this[_0x49c4('0x19')][_0x49c4('0x21')]['host'];_0x2197d2['port']=this[_0x49c4('0x19')][_0x49c4('0x21')]['port'];_0x2197d2[_0x49c4('0x22')]=this[_0x49c4('0x19')][_0x49c4('0x21')][_0x49c4('0x22')];}if(this['account']['Smtp'][_0x49c4('0x23')]){_0x2197d2['auth']={'user':this[_0x49c4('0x19')][_0x49c4('0x21')][_0x49c4('0x24')],'pass':this[_0x49c4('0x19')]['Smtp'][_0x49c4('0x25')]};}_0x58cad7[_0x49c4('0x26')]=this[_0x49c4('0x10')][_0x49c4('0x27')];_0x58cad7[_0x49c4('0x28')]=_0x49c4('0x29')+_[_0x49c4('0x2a')](_0x58cad7[_0x49c4('0x2b')],_0x49c4('0x2c'),_0x49c4('0x2d'))+_0x49c4('0x2e');return mailRpc['sendMailMessage'](_0x2197d2,_0x58cad7)['then'](function(_0x59eb84){logger[_0x49c4('0xa')](_0x49c4('0x2f'),_0xc1278f);_0x58cad7[_0x49c4('0x27')]=_0x59eb84[_0x49c4('0x10')][_0x49c4('0x27')];return rpc[_0x451ea6+'Message'][_0x49c4('0x30')](_0x58cad7);})[_0x49c4('0x31')](function(_0x2e7a69){logger[_0x49c4('0xa')]('[%s][AUTOREPLY]\x20%s',_0xc1278f,JSON['stringify'](_0x2e7a69));})[_0x49c4('0x32')](function(_0x9a1bed){logger[_0x49c4('0x33')](_0x49c4('0x34'),_0xc1278f,JSON[_0x49c4('0x35')](_0x9a1bed));})['finally'](function(){_0x69bc41[_0x49c4('0x36')]();});}else{return rpc[this[_0x49c4('0xc')]+_0x49c4('0x1d')]['create'](_0x58cad7)['then'](function(_0x85dce2){logger[_0x49c4('0xa')](_0x49c4('0xb'),_0xc1278f,_0x58cad7[_0x49c4('0x2b')]);})[_0x49c4('0x32')](function(_0x2cf897){logger[_0x49c4('0x33')](_0x49c4('0xb'),_0xc1278f,JSON[_0x49c4('0x35')](_0x2cf897));})['finally'](function(){_0x69bc41[_0x49c4('0x36')]();});}}}catch(_0x5b96df){logger[_0x49c4('0x33')](_0x49c4('0xb'),_0xc1278f,JSON[_0x49c4('0x35')](_0x5b96df));_0x69bc41[_0x49c4('0x37')]();}};}; \ No newline at end of file +var _0xcb91=['consequence','interaction','created','Autoreply\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','mail','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','body','','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x1d850e,_0x723bc4){var _0x2efd1f=function(_0x4aabc7){while(--_0x4aabc7){_0x1d850e['push'](_0x1d850e['shift']());}};_0x2efd1f(++_0x723bc4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0xcb91[_0x13e300];return _0x5a3eea;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};}; \ 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 014472e..5a3662a 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 _0x0d74=['catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x51c43f,_0x2ebbcf){var _0x3b8959=function(_0x37e077){while(--_0x37e077){_0x51c43f['push'](_0x51c43f['shift']());}};_0x3b8959(++_0x2ebbcf);}(_0x0d74,0x146));var _0x40d7=function(_0x6622a2,_0x401a17){_0x6622a2=_0x6622a2-0x0;var _0x52252e=_0x0d74[_0x6622a2];return _0x52252e;};'use strict';var moment=require(_0x40d7('0x0'));var logger=require(_0x40d7('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x40d7('0x2')),'smsInteraction':require(_0x40d7('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0x40d7('0x4')]=function(_0xe5b915,_0x3d8d4d,_0x41b9cb,_0x5edb57){return function(_0x5280f0){try{logger['info'](_0x40d7('0x5'),_0xe5b915,_0x3d8d4d[0x0]);var _0x5b9b25={'closed':0x1,'closedAt':moment()[_0x40d7('0x6')](_0x40d7('0x7')),'closeReason':'system','disposition':_0x3d8d4d[0x0]};if(rpc[_0x5edb57[_0x40d7('0x8')]+_0x40d7('0x9')]){rpc[_0x5edb57[_0x40d7('0x8')]+_0x40d7('0x9')][_0x40d7('0xa')](_0x5edb57[_0x40d7('0xb')]['id'],_0x5b9b25)['then'](function(_0x2f6578){logger[_0x40d7('0xc')](_0x40d7('0xd'),_0xe5b915,_0x5edb57[_0x40d7('0xb')]['id']);})[_0x40d7('0xe')](function(_0x495881){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0xe5b915,JSON[_0x40d7('0x11')](_0x495881));})[_0x40d7('0x12')](function(){_0x5280f0['stop']();});}}catch(_0x1d123f){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0xe5b915,JSON[_0x40d7('0x11')](_0x1d123f));_0x5280f0[_0x40d7('0x13')]();}};}; \ No newline at end of file +var _0x1516=['interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','error','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update'];(function(_0x2eab56,_0x6ebbcf){var _0x267f89=function(_0x5769d5){while(--_0x5769d5){_0x2eab56['push'](_0x2eab56['shift']());}};_0x267f89(++_0x6ebbcf);}(_0x1516,0xb0));var _0x6151=function(_0x55737c,_0xfd44d6){_0x55737c=_0x55737c-0x0;var _0x5db7f4=_0x1516[_0x55737c];return _0x5db7f4;};'use strict';var moment=require(_0x6151('0x0'));var logger=require(_0x6151('0x1'))(_0x6151('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6151('0x3')),'smsInteraction':require(_0x6151('0x4')),'mailInteraction':require(_0x6151('0x5')),'faxInteraction':require(_0x6151('0x6'))};exports[_0x6151('0x7')]=function(_0x59bdaf,_0x198e1d,_0x52ab35,_0x69f924){return function(_0x2585cd){try{logger[_0x6151('0x8')](_0x6151('0x9'),_0x59bdaf,_0x198e1d[0x0]);var _0x46e22f={'closed':0x1,'closedAt':moment()[_0x6151('0xa')](_0x6151('0xb')),'closeReason':_0x6151('0xc'),'disposition':_0x198e1d[0x0]};if(rpc[_0x69f924[_0x6151('0xd')]+'Interaction']){rpc[_0x69f924['channel']+_0x6151('0xe')][_0x6151('0xf')](_0x69f924[_0x6151('0x10')]['id'],_0x46e22f)[_0x6151('0x11')](function(_0x467fc2){logger[_0x6151('0x8')](_0x6151('0x12'),_0x59bdaf,_0x69f924[_0x6151('0x10')]['id']);})[_0x6151('0x13')](function(_0x573f0f){logger['error'](_0x6151('0x14'),_0x59bdaf,JSON[_0x6151('0x15')](_0x573f0f));})[_0x6151('0x16')](function(){_0x2585cd['stop']();});}}catch(_0x1fe484){logger[_0x6151('0x17')](_0x6151('0x14'),_0x59bdaf,JSON[_0x6151('0x15')](_0x1fe484));_0x2585cd['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 6951c7d..8f41f52 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 _0x1fff=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','isEmpty','body','Message','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','speech','endConversation','next','catch','moment','apiai-promise','md5','./utils','../../../../config/logger'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0x1fff,0xa3));var _0xf1ff=function(_0x18e66d,_0x5ed234){_0x18e66d=_0x18e66d-0x0;var _0x492ca2=_0x1fff[_0x18e66d];return _0x492ca2;};'use strict';var _=require('lodash');var moment=require(_0xf1ff('0x0'));var apiai=require(_0xf1ff('0x1'));var md5=require(_0xf1ff('0x2'));var utils=require(_0xf1ff('0x3'));var logger=require(_0xf1ff('0x4'))(_0xf1ff('0x5'));var rpc={'chatMessage':require(_0xf1ff('0x6')),'openchannelMessage':require(_0xf1ff('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf1ff('0x8')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xf1ff('0x9')]=function(_0x350bc0,_0x395cd0){return function(_0x2116e4){try{if(!_[_0xf1ff('0xa')](this[_0xf1ff('0xb')][_0xf1ff('0xc')])){logger[_0xf1ff('0xd')](_0xf1ff('0xe'),_0x350bc0,_0xf1ff('0xf'));return _0x2116e4['next']();}var _0x9a8b6={'ContactId':this[_0xf1ff('0x10')]['id'],'sentAt':moment()[_0xf1ff('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x9ec4ea=this[_0xf1ff('0x12')];if(_0x9ec4ea===_0xf1ff('0x13')){_0x9a8b6[_0xf1ff('0x14')]=this[_0xf1ff('0x15')]['id'];}else{_0x9a8b6[_['upperFirst'](_0x9ec4ea)+_0xf1ff('0x16')]=this[_0xf1ff('0x15')]['id'];}_0x9a8b6[_[_0xf1ff('0x17')](_0x9ec4ea)+'InteractionId']=this[_0xf1ff('0xb')]['id'];if(this[_0xf1ff('0xb')]['created']){var _0x5a1be9=_0x395cd0[0x2];if(!_[_0xf1ff('0x18')](_0x5a1be9)){_0x9a8b6[_0xf1ff('0x19')]=utils['getMustacheRender'](_0x5a1be9,this);return rpc[_0x9ec4ea+_0xf1ff('0x1a')][_0xf1ff('0x1b')](_0x9a8b6)[_0xf1ff('0x1c')](function(_0x2c5514){logger['info'](_0xf1ff('0xe'),_0x350bc0,_0x9a8b6[_0xf1ff('0x19')]);})['catch'](function(_0x3c557e){logger[_0xf1ff('0x1d')](_0xf1ff('0xe'),_0x350bc0,JSON[_0xf1ff('0x1e')](_0x3c557e));})[_0xf1ff('0x1f')](function(){logger[_0xf1ff('0xd')](_0xf1ff('0x20'),_0x350bc0);_0x2116e4[_0xf1ff('0x21')]();});}else{logger[_0xf1ff('0xd')](_0xf1ff('0x22'),_0x350bc0);_0x2116e4[_0xf1ff('0x21')]();}}else{var _0x27cc27=this;var _0x5a88ad=apiai(_0x395cd0[0x0],{'language':_0x395cd0[0x1]||'en'});return _0x5a88ad[_0xf1ff('0x23')](this[_0xf1ff('0x24')]['body'],{'sessionId':md5(this[_0xf1ff('0xb')]['id'])})[_0xf1ff('0x1c')](function(_0x5f4b76){_0x27cc27[_0xf1ff('0x19')][_0xf1ff('0x25')]=_0x5f4b76;_0x9a8b6[_0xf1ff('0x19')]=_0x5f4b76['result']['fulfillment'][_0xf1ff('0x26')];return rpc[_0x9ec4ea+_0xf1ff('0x1a')][_0xf1ff('0x1b')](_0x9a8b6)[_0xf1ff('0x1c')](function(_0x36ff41){logger[_0xf1ff('0xd')](_0xf1ff('0xe'),_0x350bc0,_0x9a8b6['body']);if(_0x5f4b76['result']['metadata'][_0xf1ff('0x27')]){_0x2116e4[_0xf1ff('0x28')]();}else{_0x2116e4['stop']();}})[_0xf1ff('0x29')](function(_0x440d1f){logger[_0xf1ff('0x1d')](_0xf1ff('0xe'),_0x350bc0,JSON[_0xf1ff('0x1e')](_0x440d1f));_0x2116e4['next']();});})[_0xf1ff('0x29')](function(_0x2e7187){logger[_0xf1ff('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x350bc0,_0x2e7187[_0xf1ff('0x24')]);_0x2116e4['next']();});}}catch(_0x4ea6a4){logger[_0xf1ff('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x350bc0,JSON[_0xf1ff('0x1e')](_0x4ea6a4));_0x2116e4[_0xf1ff('0x21')]();}};}; \ No newline at end of file +var _0x0720=['textRequest','message','dialogflow','result','fulfillment','speech','metadata','error','stringify','moment','apiai-promise','md5','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','info','[%s][DIALOGFLOW]\x20%s','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x45ffad,_0x1c09f0){var _0x7c936e=function(_0xae7e55){while(--_0xae7e55){_0x45ffad['push'](_0x45ffad['shift']());}};_0x7c936e(++_0x1c09f0);}(_0x0720,0x1b7));var _0x0072=function(_0xfe0dc5,_0x2ee3b7){_0xfe0dc5=_0xfe0dc5-0x0;var _0xeb13a4=_0x0720[_0xfe0dc5];return _0xeb13a4;};'use strict';var _=require('lodash');var moment=require(_0x0072('0x0'));var apiai=require(_0x0072('0x1'));var md5=require(_0x0072('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x0072('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0072('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0072('0x5')),'faxMessage':require(_0x0072('0x6'))};exports[_0x0072('0x7')]=function(_0x4b4f32,_0x1d4784){return function(_0x3478b2){try{if(!_['isNil'](this['interaction'][_0x0072('0x8')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4b4f32,_0x0072('0x9'));return _0x3478b2[_0x0072('0xa')]();}var _0xdc704b={'ContactId':this[_0x0072('0xb')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0072('0xc')};var _0xcdf805=this[_0x0072('0xd')];if(_0xcdf805==='chat'){_0xdc704b[_0x0072('0xe')]=this[_0x0072('0xf')]['id'];}else{_0xdc704b[_[_0x0072('0x10')](_0xcdf805)+_0x0072('0x11')]=this[_0x0072('0xf')]['id'];}_0xdc704b[_[_0x0072('0x10')](_0xcdf805)+_0x0072('0x12')]=this['interaction']['id'];if(this[_0x0072('0x13')][_0x0072('0x14')]){var _0x4cb10e=_0x1d4784[0x2];if(!_[_0x0072('0x15')](_0x4cb10e)){_0xdc704b[_0x0072('0x16')]=utils[_0x0072('0x17')](_0x4cb10e,this);return rpc[_0xcdf805+_0x0072('0x18')][_0x0072('0x19')](_0xdc704b)[_0x0072('0x1a')](function(_0x44e675){logger[_0x0072('0x1b')](_0x0072('0x1c'),_0x4b4f32,_0xdc704b[_0x0072('0x16')]);})[_0x0072('0x1d')](function(_0x1e08d4){logger['error'](_0x0072('0x1c'),_0x4b4f32,JSON['stringify'](_0x1e08d4));})[_0x0072('0x1e')](function(){logger['info'](_0x0072('0x1f'),_0x4b4f32);_0x3478b2[_0x0072('0x20')]();});}else{logger[_0x0072('0x1b')](_0x0072('0x21'),_0x4b4f32);_0x3478b2['stop']();}}else{var _0x146f28=this;var _0x1f4567=apiai(_0x1d4784[0x0],{'language':_0x1d4784[0x1]||'en'});return _0x1f4567[_0x0072('0x22')](this[_0x0072('0x23')][_0x0072('0x16')],{'sessionId':md5(this[_0x0072('0x13')]['id'])})[_0x0072('0x1a')](function(_0x2c07ec){_0x146f28[_0x0072('0x16')][_0x0072('0x24')]=_0x2c07ec;_0xdc704b[_0x0072('0x16')]=_0x2c07ec[_0x0072('0x25')][_0x0072('0x26')][_0x0072('0x27')];return rpc[_0xcdf805+'Message'][_0x0072('0x19')](_0xdc704b)[_0x0072('0x1a')](function(_0x2e743e){logger[_0x0072('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x4b4f32,_0xdc704b['body']);if(_0x2c07ec[_0x0072('0x25')][_0x0072('0x28')]['endConversation']){_0x3478b2[_0x0072('0xa')]();}else{_0x3478b2[_0x0072('0x20')]();}})['catch'](function(_0xb25674){logger[_0x0072('0x29')](_0x0072('0x1c'),_0x4b4f32,JSON[_0x0072('0x2a')](_0xb25674));_0x3478b2[_0x0072('0xa')]();});})[_0x0072('0x1d')](function(_0x32318a){logger[_0x0072('0x29')](_0x0072('0x1c'),_0x4b4f32,_0x32318a[_0x0072('0x23')]);_0x3478b2[_0x0072('0xa')]();});}}catch(_0x141995){logger[_0x0072('0x29')](_0x0072('0x1c'),_0x4b4f32,JSON[_0x0072('0x2a')](_0x141995));_0x3478b2['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 acd9344..690aa21 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 _0xca5d=['../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','join','stop','condition','priorityTrue','priorityFalse','info','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','validate','lodash','html-to-text','./utils'];(function(_0xaf10ee,_0xf83b12){var _0x52d65a=function(_0x41105b){while(--_0x41105b){_0xaf10ee['push'](_0xaf10ee['shift']());}};_0x52d65a(++_0xf83b12);}(_0xca5d,0xdc));var _0xdca5=function(_0x5da83b,_0x57d4a4){_0x5da83b=_0x5da83b-0x0;var _0x2788ba=_0xca5d[_0x5da83b];return _0x2788ba;};'use strict';var schema=require(_0xdca5('0x0'));var _=require(_0xdca5('0x1'));var htmlToText=require(_0xdca5('0x2'));var utils=require(_0xdca5('0x3'));var logger=require(_0xdca5('0x4'))(_0xdca5('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xdca5('0x6')},'priorityTrue':{'type':_0xdca5('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xdca5('0x7'),'message':_0xdca5('0x8')}});exports[_0xdca5('0x9')]=function(_0x378a0e,_0x59e0aa){return function(_0x432ff9){try{var _0x4754b2={'condition':htmlToText[_0xdca5('0xa')](utils[_0xdca5('0xb')](_0x59e0aa[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x59e0aa[0x1],'priorityFalse':_0x59e0aa[0x2]};var _0x4669bb=gotoif[_0xdca5('0x0')](_0x4754b2,{'typecast':!![]});if(_0x4669bb[_0xdca5('0xc')]){logger['error'](_0xdca5('0xd'),_0x378a0e,_['map'](_0x4669bb,'message')[_0xdca5('0xe')](',\x20'));_0x432ff9[_0xdca5('0xf')]();}else{try{var _0x2f7483=eval('('+_0x4754b2[_0xdca5('0x10')]+')');var _0x45926e=_0x2f7483?_0x4754b2[_0xdca5('0x11')]:_0x4754b2[_0xdca5('0x12')];logger[_0xdca5('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x378a0e,_0x4754b2[_0xdca5('0x10')],_0x2f7483,_0x45926e||'next');if(_0x45926e){var _0x9e40e9=_[_0xdca5('0x14')](_0x432ff9[_0xdca5('0x15')](),{'p':_0x45926e});if(_0x9e40e9>=0x0){logger[_0xdca5('0x13')](_0xdca5('0x16'),_0x378a0e,_0x45926e||_0xdca5('0x17'),_0x9e40e9);_0x432ff9[_0xdca5('0x17')](_0x9e40e9);}else{logger['info'](_0xdca5('0x18'),_0x378a0e,_0x45926e||'next');_0x432ff9['stop']();}}else{_0x432ff9[_0xdca5('0x17')]();}}catch(_0x4d6ddc){logger[_0xdca5('0x19')](_0xdca5('0x1a'),_0x378a0e,_0x4d6ddc[_0xdca5('0x1b')]);_0x432ff9[_0xdca5('0xf')]();}}}catch(_0x252fe5){logger['error'](_0xdca5('0xd'),_0x378a0e,JSON['stringify'](_0x252fe5));_0x432ff9[_0xdca5('0xf')]();}};}; \ No newline at end of file +var _0x917b=['next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','html-to-text','./utils','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info'];(function(_0x43da12,_0x1a7c1d){var _0x328a73=function(_0x4a0335){while(--_0x4a0335){_0x43da12['push'](_0x43da12['shift']());}};_0x328a73(++_0x1a7c1d);}(_0x917b,0x113));var _0xb917=function(_0x1cefe7,_0x4a6350){_0x1cefe7=_0x1cefe7-0x0;var _0x14561d=_0x917b[_0x1cefe7];return _0x14561d;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0xb917('0x0'));var utils=require(_0xb917('0x1'));var logger=require(_0xb917('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xb917('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xb917('0x4'),'message':_0xb917('0x5')},'priorityFalse':{'type':_0xb917('0x4'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xb917('0x6')]=function(_0x2f908d,_0x498662){return function(_0x1c715c){try{var _0x190336={'condition':htmlToText[_0xb917('0x7')](utils[_0xb917('0x8')](_0x498662[0x0],this),{'wordwrap':![]})[_0xb917('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x498662[0x1],'priorityFalse':_0x498662[0x2]};var _0x499cda=gotoif[_0xb917('0xa')](_0x190336,{'typecast':!![]});if(_0x499cda[_0xb917('0xb')]){logger[_0xb917('0xc')](_0xb917('0xd'),_0x2f908d,_[_0xb917('0xe')](_0x499cda,_0xb917('0xf'))[_0xb917('0x10')](',\x20'));_0x1c715c[_0xb917('0x11')]();}else{try{var _0x371398=eval('('+_0x190336[_0xb917('0x12')]+')');var _0x348800=_0x371398?_0x190336[_0xb917('0x13')]:_0x190336[_0xb917('0x14')];logger[_0xb917('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2f908d,_0x190336['condition'],_0x371398,_0x348800||_0xb917('0x16'));if(_0x348800){var _0x167325=_[_0xb917('0x17')](_0x1c715c[_0xb917('0x18')](),{'p':_0x348800});if(_0x167325>=0x0){logger['info'](_0xb917('0x19'),_0x2f908d,_0x348800||'next',_0x167325);_0x1c715c[_0xb917('0x16')](_0x167325);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2f908d,_0x348800||_0xb917('0x16'));_0x1c715c[_0xb917('0x11')]();}}else{_0x1c715c[_0xb917('0x16')]();}}catch(_0xd52592){logger[_0xb917('0xc')](_0xb917('0x1a'),_0x2f908d,_0xd52592['message']);_0x1c715c[_0xb917('0x11')]();}}}catch(_0x5b608a){logger[_0xb917('0xc')](_0xb917('0xd'),_0x2f908d,JSON['stringify'](_0x5b608a));_0x1c715c[_0xb917('0x11')]();}};}; \ 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 069c615..177246c 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 _0x7d0b=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','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','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7d0b,0x1c8));var _0xb7d0=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7d0b[_0x8c43de];return _0xa6591b;};'use strict';var schema=require(_0xb7d0('0x0'));var _=require(_0xb7d0('0x1'));var logger=require(_0xb7d0('0x2'))(_0xb7d0('0x3'));var gotop=schema({'priority':{'type':_0xb7d0('0x4'),'required':!![],'message':_0xb7d0('0x5')}});exports[_0xb7d0('0x6')]=function(_0x5473f4,_0x8362aa){return function(_0x2c4167){try{var _0x1e3a41={'priority':_0x8362aa[0x0]};var _0x1b1771=gotop[_0xb7d0('0x0')](_0x1e3a41,{'typecast':!![]});if(_0x1b1771[_0xb7d0('0x7')]){logger[_0xb7d0('0x8')]('[%s][GOTOP]\x20%s',_0x5473f4,_[_0xb7d0('0x9')](_0x1b1771,_0xb7d0('0xa'))[_0xb7d0('0xb')](',\x20'));_0x2c4167[_0xb7d0('0xc')]();}else{logger[_0xb7d0('0xd')](_0xb7d0('0xe'),_0x5473f4,_0x1e3a41['priority']);if(_0x1e3a41[_0xb7d0('0xf')]){var _0x4e093d=_[_0xb7d0('0x10')](_0x2c4167[_0xb7d0('0x11')](),{'p':_0x1e3a41[_0xb7d0('0xf')]});if(_0x4e093d>=0x0){logger[_0xb7d0('0xd')](_0xb7d0('0x12'),_0x5473f4,_0x1e3a41[_0xb7d0('0xf')]||_0xb7d0('0x13'),_0x4e093d);_0x2c4167[_0xb7d0('0x13')](_0x4e093d);}else{logger[_0xb7d0('0xd')](_0xb7d0('0x14'),_0x5473f4,_0x1e3a41[_0xb7d0('0xf')]||_0xb7d0('0x13'));_0x2c4167[_0xb7d0('0xc')]();}}else{_0x2c4167[_0xb7d0('0x13')]();}}}catch(_0xad19c){logger[_0xb7d0('0x8')](_0xb7d0('0x15'),_0x5473f4,JSON[_0xb7d0('0x16')](_0xad19c));_0x2c4167['stop']();}};}; \ No newline at end of file +var _0x973c=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOP]\x20%s','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x35079c,_0x457536){var _0x21d125=function(_0x371f93){while(--_0x371f93){_0x35079c['push'](_0x35079c['shift']());}};_0x21d125(++_0x457536);}(_0x973c,0x1ad));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xc973('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xc973('0x1'));var gotop=schema({'priority':{'type':_0xc973('0x2'),'required':!![],'message':_0xc973('0x3')}});exports[_0xc973('0x4')]=function(_0x47ca25,_0xe919ac){return function(_0x519e22){try{var _0x11eb56={'priority':_0xe919ac[0x0]};var _0x567b69=gotop[_0xc973('0x0')](_0x11eb56,{'typecast':!![]});if(_0x567b69[_0xc973('0x5')]){logger['error']('[%s][GOTOP]\x20%s',_0x47ca25,_['map'](_0x567b69,_0xc973('0x6'))[_0xc973('0x7')](',\x20'));_0x519e22[_0xc973('0x8')]();}else{logger[_0xc973('0x9')](_0xc973('0xa'),_0x47ca25,_0x11eb56[_0xc973('0xb')]);if(_0x11eb56[_0xc973('0xb')]){var _0x5c7827=_[_0xc973('0xc')](_0x519e22[_0xc973('0xd')](),{'p':_0x11eb56['priority']});if(_0x5c7827>=0x0){logger[_0xc973('0x9')](_0xc973('0xe'),_0x47ca25,_0x11eb56[_0xc973('0xb')]||_0xc973('0xf'),_0x5c7827);_0x519e22[_0xc973('0xf')](_0x5c7827);}else{logger[_0xc973('0x9')](_0xc973('0x10'),_0x47ca25,_0x11eb56[_0xc973('0xb')]||_0xc973('0xf'));_0x519e22[_0xc973('0x8')]();}}else{_0x519e22[_0xc973('0xf')]();}}}catch(_0x4b6570){logger[_0xc973('0x11')](_0xc973('0x12'),_0x47ca25,JSON[_0xc973('0x13')](_0x4b6570));_0x519e22[_0xc973('0x8')]();}};}; \ 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 fa43007..169aa60 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 _0x18b9=['create','then','[%s][MESSAGE]\x20%s','body','catch','stop','stringify','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x18b9,0x1e7));var _0x918b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x18b9[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var utils=require(_0x918b('0x0'));var logger=require(_0x918b('0x1'))(_0x918b('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x918b('0x3')),'smsMessage':require(_0x918b('0x4')),'faxMessage':require(_0x918b('0x5'))};exports[_0x918b('0x6')]=function(_0x4e0651,_0x8596fb){return function(_0x2a6014){try{var _0x1a17f1={'body':utils[_0x918b('0x7')](_0x8596fb[0x0],this),'ContactId':this[_0x918b('0x8')]['id']};if(this[_0x918b('0x9')]==='chat'){_0x1a17f1[_0x918b('0xa')]=this[_0x918b('0xb')]['id'];}else{_0x1a17f1[_[_0x918b('0xc')](this[_0x918b('0x9')])+_0x918b('0xd')]=this['account']['id'];}_0x1a17f1[_[_0x918b('0xc')](this[_0x918b('0x9')])+_0x918b('0xe')]=this[_0x918b('0xf')]['id'];if(rpc[this['channel']+_0x918b('0x10')]){return rpc[this['channel']+_0x918b('0x10')][_0x918b('0x11')](_0x1a17f1)[_0x918b('0x12')](function(_0x3e4659){logger['info'](_0x918b('0x13'),_0x4e0651,_0x1a17f1[_0x918b('0x14')]);_0x2a6014['next']();})[_0x918b('0x15')](function(_0x4e7289){logger['error']('[%s][MESSAGE]\x20%s',_0x4e0651,JSON['stringify'](_0x4e7289));_0x2a6014[_0x918b('0x16')]();});}}catch(_0x318534){logger['error'](_0x918b('0x13'),_0x4e0651,JSON[_0x918b('0x17')](_0x318534));_0x2a6014[_0x918b('0x16')]();}};}; \ No newline at end of file +var _0x9c3e=['[%s][MESSAGE]\x20%s','catch','stringify','stop','error','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','interaction','Message','then','info'];(function(_0x1eb5da,_0x1974ec){var _0x579a2f=function(_0x502c14){while(--_0x502c14){_0x1eb5da['push'](_0x1eb5da['shift']());}};_0x579a2f(++_0x1974ec);}(_0x9c3e,0x185));var _0xe9c3=function(_0x55bfef,_0x50b387){_0x55bfef=_0x55bfef-0x0;var _0x38cbb9=_0x9c3e[_0x55bfef];return _0x38cbb9;};'use strict';var _=require(_0xe9c3('0x0'));var utils=require(_0xe9c3('0x1'));var logger=require('../../../../config/logger')(_0xe9c3('0x2'));var rpc={'chatMessage':require(_0xe9c3('0x3')),'openchannelMessage':require(_0xe9c3('0x4')),'mailMessage':require(_0xe9c3('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe9c3('0x6'))};exports['consequence']=function(_0x4d6ae5,_0xf7f024){return function(_0x4d66d2){try{var _0x3aeb45={'body':utils[_0xe9c3('0x7')](_0xf7f024[0x0],this),'ContactId':this[_0xe9c3('0x8')]['id']};if(this[_0xe9c3('0x9')]===_0xe9c3('0xa')){_0x3aeb45[_0xe9c3('0xb')]=this['account']['id'];}else{_0x3aeb45[_[_0xe9c3('0xc')](this['channel'])+_0xe9c3('0xd')]=this[_0xe9c3('0xe')]['id'];}_0x3aeb45[_[_0xe9c3('0xc')](this[_0xe9c3('0x9')])+'InteractionId']=this[_0xe9c3('0xf')]['id'];if(rpc[this[_0xe9c3('0x9')]+_0xe9c3('0x10')]){return rpc[this[_0xe9c3('0x9')]+_0xe9c3('0x10')]['create'](_0x3aeb45)[_0xe9c3('0x11')](function(_0x363e7d){logger[_0xe9c3('0x12')](_0xe9c3('0x13'),_0x4d6ae5,_0x3aeb45['body']);_0x4d66d2['next']();})[_0xe9c3('0x14')](function(_0x141373){logger['error'](_0xe9c3('0x13'),_0x4d6ae5,JSON[_0xe9c3('0x15')](_0x141373));_0x4d66d2[_0xe9c3('0x16')]();});}}catch(_0x1432f5){logger[_0xe9c3('0x17')](_0xe9c3('0x13'),_0x4d6ae5,JSON[_0xe9c3('0x15')](_0x1432f5));_0x4d66d2[_0xe9c3('0x16')]();}};}; \ 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 53855f9..98965a3 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 _0xd6a9=['routing','consequence','[%s][NOOP]\x20%s','./utils'];(function(_0x1793d9,_0x67b6f6){var _0x1e8559=function(_0x18ff81){while(--_0x18ff81){_0x1793d9['push'](_0x1793d9['shift']());}};_0x1e8559(++_0x67b6f6);}(_0xd6a9,0x1e7));var _0x9d6a=function(_0x4b303a,_0x50361e){_0x4b303a=_0x4b303a-0x0;var _0x3d3f09=_0xd6a9[_0x4b303a];return _0x3d3f09;};'use strict';var utils=require(_0x9d6a('0x0'));var logger=require('../../../../config/logger')(_0x9d6a('0x1'));exports[_0x9d6a('0x2')]=function(_0x38b718,_0x2b9304){return function(_0x2210b4){try{logger['info'](_0x9d6a('0x3'),_0x38b718,utils['getMustacheRender'](_0x2b9304[0x0],this));_0x2210b4['next']();}catch(_0x54e93d){logger['error'](_0x9d6a('0x3'),_0x38b718,JSON['stringify'](_0x54e93d));_0x2210b4['stop']();}};}; \ No newline at end of file +var _0xb182=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x7ad239,_0x2753a8){var _0x4dd372=function(_0x201c82){while(--_0x201c82){_0x7ad239['push'](_0x7ad239['shift']());}};_0x4dd372(++_0x2753a8);}(_0xb182,0xd7));var _0x2b18=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0xb182[_0xcf581b];return _0x4f454d;};'use strict';var utils=require(_0x2b18('0x0'));var logger=require(_0x2b18('0x1'))(_0x2b18('0x2'));exports[_0x2b18('0x3')]=function(_0x478fe9,_0x3f4e99){return function(_0x2ed5f0){try{logger[_0x2b18('0x4')]('[%s][NOOP]\x20%s',_0x478fe9,utils[_0x2b18('0x5')](_0x3f4e99[0x0],this));_0x2ed5f0[_0x2b18('0x6')]();}catch(_0x332293){logger[_0x2b18('0x7')](_0x2b18('0x8'),_0x478fe9,JSON['stringify'](_0x332293));_0x2ed5f0[_0x2b18('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index b89cdbd..e78abb2 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 _0xf794=['save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','from','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue','joinAt','queue_id','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s'];(function(_0x4423da,_0x13bdc1){var _0xe5a20b=function(_0x45f7c5){while(--_0x45f7c5){_0x4423da['push'](_0x4423da['shift']());}};_0xe5a20b(++_0x13bdc1);}(_0xf794,0x8e));var _0x4f79=function(_0x2d489c,_0x484ca5){_0x2d489c=_0x2d489c-0x0;var _0x45e57e=_0xf794[_0x2d489c];return _0x45e57e;};'use strict';var schema=require(_0x4f79('0x0'));var _=require(_0x4f79('0x1'));var util=require(_0x4f79('0x2'));var seqqueue=require(_0x4f79('0x3'));var moment=require(_0x4f79('0x4'));var Redis=require('ioredis');var config=require(_0x4f79('0x5'));var logger=require(_0x4f79('0x6'))(_0x4f79('0x7'));var strategy=require(_0x4f79('0x8'));config[_0x4f79('0x9')]=_[_0x4f79('0xa')](config['redis'],{'host':_0x4f79('0xb'),'port':0x18eb});var io=require(_0x4f79('0xc'))(new Redis(config[_0x4f79('0x9')]));var attributes=['id','queue_id','account',_0x4f79('0xd'),'from',_0x4f79('0xe')];function emit(_0x3b221b,_0x525a96,_0x164f5c){io['to'](_0x3b221b)['emit'](_0x525a96,_0x164f5c);}function emitChannelQueueInteraction(_0x5575ce,_0x482232,_0x2360f3,_0xc80e16,_0xf88d6f,_0x211b6e,_0x2000f5,_0x138277){_0x2360f3[_0x4f79('0xf')]=_0x138277;_0x2360f3[_0x4f79('0xd')]=_0x482232;_0x2360f3[_0x4f79('0x10')]=_0xc80e16;_0x2360f3['id']=_0xf88d6f;if(_0x211b6e){_0x2000f5[util[_0x4f79('0x11')](_0x4f79('0x12'),_0x5575ce)][_0xf88d6f]=_[_0x4f79('0x13')](_0x2360f3,attributes);}else{delete _0x2000f5[util[_0x4f79('0x11')](_0x4f79('0x12'),_0x5575ce)][_0xf88d6f];}emit(util[_0x4f79('0x11')](_0x4f79('0x14'),_0x5575ce,_0x482232),util[_0x4f79('0x11')](_0x4f79('0x15'),_0x5575ce,_0x211b6e?_0x4f79('0x16'):_0x4f79('0x17')),_[_0x4f79('0x13')](_0x2360f3,attributes));}var rpc={'openchannelQueueReport':require(_0x4f79('0x18')),'mailQueueReport':require(_0x4f79('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x4f79('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0x4f79('0x1b'),'required':!![],'message':_0x4f79('0x1c')},'timeout':{'type':_0x4f79('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x524817,_0x109ddb,_0x190537,_0x490942){if(_0x524817&&_0x109ddb&&_0x190537){_0x109ddb['waiting']+=0x1;var _0x2243a9={'uniqueid':_0x524817,'from':_0x190537[_0x4f79('0x1e')]?_0x190537[_0x4f79('0x1e')][_0x4f79('0x1f')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x190537[_0x4f79('0x20')]?_0x190537[_0x4f79('0x20')]['id']:null,'ListId':_0x190537[_0x4f79('0x21')]?_0x190537[_0x4f79('0x21')]['id']:null};_0x2243a9[_[_0x4f79('0x22')](_0x190537[_0x4f79('0x23')])+_0x4f79('0x24')]=_0x109ddb['id']||null;_0x2243a9[_[_0x4f79('0x22')](_0x190537[_0x4f79('0x23')])+_0x4f79('0x25')]=_0x190537[_0x4f79('0x26')]?_0x190537['interaction']['id']:null;_0x2243a9[_[_0x4f79('0x22')](_0x190537[_0x4f79('0x23')])+_0x4f79('0x27')]=_0x190537[_0x4f79('0x28')]?_0x190537['message']['id']:null;_0x2243a9[_[_0x4f79('0x22')](_0x190537[_0x4f79('0x23')])+(_0x190537[_0x4f79('0x23')]!==_0x4f79('0x29')?_0x4f79('0x2a'):_0x4f79('0x2b'))]=_0x190537[_0x4f79('0x10')]?_0x190537[_0x4f79('0x10')]['id']:null;logger[_0x4f79('0x2c')](util[_0x4f79('0x11')](_0x4f79('0x2d'),_0x524817,_0x109ddb[_0x4f79('0x2e')]));emitChannelQueueInteraction(_0x190537[_0x4f79('0x23')],_0x109ddb[_0x4f79('0x2e')],_0x2243a9,_0x190537[_0x4f79('0x10')][_0x4f79('0x2e')],_0x190537[_0x4f79('0x28')]['id'],!![],_0x490942,_0x109ddb['id']);if(rpc[_0x190537['channel']+_0x4f79('0x2f')]){return rpc[_0x190537[_0x4f79('0x23')]+_0x4f79('0x2f')][_0x4f79('0x30')](_0x2243a9)[_0x4f79('0x31')](function(_0x1abc84){logger[_0x4f79('0x32')](_0x4f79('0x33'));});}}}function stopRouting(_0x29ad3b,_0x55b756,_0x453c77,_0x2e2d12){if(_0x29ad3b&&_0x55b756){_0x55b756[_0x4f79('0x34')]-=0x1;var _0x448b98={'leaveAt':moment()[_0x4f79('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x4f79('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4f79('0x35')};logger[_0x4f79('0x2c')](util[_0x4f79('0x11')](_0x4f79('0x36'),_0x29ad3b,_0x55b756[_0x4f79('0x2e')]));emitChannelQueueInteraction(_0x453c77['channel'],_0x55b756['name'],_0x453c77[_0x4f79('0x1e')],_0x453c77[_0x4f79('0x10')][_0x4f79('0x2e')],_0x453c77[_0x4f79('0x28')]['id'],![],_0x2e2d12,_0x55b756['id']);if(rpc[_0x453c77[_0x4f79('0x23')]+_0x4f79('0x2f')]){return rpc[_0x453c77[_0x4f79('0x23')]+'QueueReport'][_0x4f79('0x37')](_0x29ad3b,_0x448b98)[_0x4f79('0x31')](function(_0x580705){logger[_0x4f79('0x32')](_0x4f79('0x38'));});}}}function endRouting(_0x2b05e2,_0x552377,_0x2caa8d,_0x21c9ba){if(_0x2b05e2&&_0x552377){_0x552377['waiting']-=0x1;var _0x1a0a18={'leaveAt':moment()[_0x4f79('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x4f79('0x11')](_0x4f79('0x39')),'reason':_0x4f79('0x3a')};logger[_0x4f79('0x2c')](util[_0x4f79('0x11')](_0x4f79('0x3b'),_0x2b05e2,_0x552377[_0x4f79('0x2e')]));emitChannelQueueInteraction(_0x2caa8d['channel'],_0x552377['name'],_0x2caa8d[_0x4f79('0x1e')],_0x2caa8d[_0x4f79('0x10')][_0x4f79('0x2e')],_0x2caa8d[_0x4f79('0x28')]['id'],![],_0x21c9ba);if(rpc[_0x2caa8d[_0x4f79('0x23')]+_0x4f79('0x2f')]){return rpc[_0x2caa8d['channel']+_0x4f79('0x2f')]['update'](_0x2b05e2,_0x1a0a18)[_0x4f79('0x31')](function(_0x38feaf){logger[_0x4f79('0x32')](_0x4f79('0x38'));});}}}function handleFindQueue(_0x117689){return function(_0x54b21d){return _0x54b21d[_0x4f79('0x2e')][_0x4f79('0x3c')]()===_0x117689[_0x4f79('0x3c')]();};}exports[_0x4f79('0x3d')]=function(_0x45274f,_0x1ed0cc,_0x1958fe,_0x440cd9){return function(_0x5404d2){try{var _0x1f3dfa={'name':_0x1ed0cc[0x0],'timeout':_0x1ed0cc[0x1]};var _0x12288c=queue['validate'](_0x1f3dfa,{'typecast':!![]});if(_0x12288c[_0x4f79('0x3e')]){logger[_0x4f79('0x32')](_0x4f79('0x3f'),_0x45274f,_[_0x4f79('0x40')](_0x12288c,_0x4f79('0x28'))[_0x4f79('0x41')](',\x20'));_0x5404d2[_0x4f79('0x42')]();}else{var _0x55bdb6=_['find'](_0x1958fe[_0x440cd9[_0x4f79('0x23')]+_0x4f79('0x43')],handleFindQueue(_0x1f3dfa[_0x4f79('0x2e')]));if(_0x55bdb6){startRouting(_0x45274f,_0x55bdb6,_0x440cd9,_0x1958fe);var _0x2e5f8e=(_0x55bdb6[_0x4f79('0x3a')]||0xa)*0x3e8;var _0x550cb3=(_0x1f3dfa[_0x4f79('0x3a')]||0x14)*0x3e8;var _0x5cbd09,_0x263e31;if(_0x2e5f8e>_0x550cb3){_0x550cb3=_0x2e5f8e;}var _0x567097=seqqueue[_0x4f79('0x44')](_0x2e5f8e);_0x567097['id']=_0x45274f;_0x567097[_0x4f79('0x45')]=_0x2e5f8e;_0x567097[_0x4f79('0x46')]=_0x550cb3;_0x567097[_0x4f79('0x23')]=_0x440cd9['channel'];_0x1958fe[_0x4f79('0x47')][_0x45274f]['on']('end',function(){stopRouting(_0x45274f,_0x55bdb6,_0x440cd9,_0x1958fe);_0x567097[_0x4f79('0x48')](!![]);clearTimeout(_0x5cbd09);_0x5cbd09=undefined;if(_0x1958fe[_0x4f79('0x47')][_0x45274f]){delete _0x1958fe[_0x4f79('0x47')][_0x45274f];}logger[_0x4f79('0x2c')](_0x4f79('0x49'),_0x45274f);_0x5404d2['stop']();});_0x5cbd09=setTimeout(function(){endRouting(_0x45274f,_0x55bdb6,_0x440cd9,_0x1958fe);clearTimeout(_0x5cbd09);_0x567097[_0x4f79('0x48')](!![]);logger[_0x4f79('0x2c')](_0x4f79('0x4a'),_0x45274f);_0x5404d2[_0x4f79('0x4b')]();},_0x550cb3);switch(_0x55bdb6[_0x4f79('0x4c')]){case _0x4f79('0x4d'):strategy[_0x4f79('0x4d')](_0x567097,_0x55bdb6,_0x1958fe,_0x440cd9);break;default:strategy[_0x4f79('0x4e')](_0x567097,_0x55bdb6,_0x1958fe,_0x440cd9);}}else{logger[_0x4f79('0x32')](_0x4f79('0x4f'),_0x45274f,_0x1f3dfa['name']);_0x5404d2[_0x4f79('0x42')]();}}}catch(_0x16ee88){console[_0x4f79('0x50')](_0x16ee88);logger[_0x4f79('0x32')](_0x4f79('0x3f'),_0x45274f,_0x16ee88[_0x4f79('0x51')]);_0x5404d2[_0x4f79('0x42')]();}};}; \ No newline at end of file +var _0x7420=['rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','redis','defaults','localhost','queue_id','queue','from','joinAt','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','error','toLowerCase','[%s][QUEUE]\x20%s','map','stop','Queues','createQueue','qtimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy'];(function(_0x4d3b77,_0x3c789c){var _0x1a716a=function(_0x10707c){while(--_0x10707c){_0x4d3b77['push'](_0x4d3b77['shift']());}};_0x1a716a(++_0x3c789c);}(_0x7420,0x181));var _0x0742=function(_0x21ea89,_0x1525b2){_0x21ea89=_0x21ea89-0x0;var _0x4acdb2=_0x7420[_0x21ea89];return _0x4acdb2;};'use strict';var schema=require(_0x0742('0x0'));var _=require(_0x0742('0x1'));var util=require('util');var seqqueue=require(_0x0742('0x2'));var moment=require(_0x0742('0x3'));var Redis=require(_0x0742('0x4'));var config=require(_0x0742('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');config[_0x0742('0x6')]=_[_0x0742('0x7')](config[_0x0742('0x6')],{'host':_0x0742('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0742('0x6')]));var attributes=['id',_0x0742('0x9'),'account',_0x0742('0xa'),_0x0742('0xb'),_0x0742('0xc')];function emit(_0x319bb1,_0x1b63d3,_0x2eb0bd){io['to'](_0x319bb1)['emit'](_0x1b63d3,_0x2eb0bd);}function emitChannelQueueInteraction(_0xff32de,_0x5ae60c,_0x5d6663,_0x4c0d96,_0x4a3157,_0x4eac52,_0x572c06,_0x1d50fc){_0x5d6663[_0x0742('0x9')]=_0x1d50fc;_0x5d6663[_0x0742('0xa')]=_0x5ae60c;_0x5d6663['account']=_0x4c0d96;_0x5d6663['id']=_0x4a3157;if(_0x4eac52){_0x572c06[util[_0x0742('0xd')]('%sQueuesWaitingInteractions',_0xff32de)][_0x4a3157]=_[_0x0742('0xe')](_0x5d6663,attributes);}else{delete _0x572c06[util[_0x0742('0xd')](_0x0742('0xf'),_0xff32de)][_0x4a3157];}emit(util[_0x0742('0xd')](_0x0742('0x10'),_0xff32de,_0x5ae60c),util[_0x0742('0xd')](_0x0742('0x11'),_0xff32de,_0x4eac52?_0x0742('0x12'):_0x0742('0x13')),_[_0x0742('0xe')](_0x5d6663,attributes));}var rpc={'openchannelQueueReport':require(_0x0742('0x14')),'mailQueueReport':require(_0x0742('0x15')),'chatQueueReport':require(_0x0742('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x0742('0x17'))};var queue=schema({'name':{'type':_0x0742('0x18'),'required':!![],'message':_0x0742('0x19')},'timeout':{'type':'number','message':_0x0742('0x1a')}});function startRouting(_0x75c147,_0x9f42e,_0x3e8163,_0x215ac8){if(_0x75c147&&_0x9f42e&&_0x3e8163){_0x9f42e[_0x0742('0x1b')]+=0x1;var _0x341c57={'uniqueid':_0x75c147,'from':_0x3e8163[_0x0742('0x1c')]?_0x3e8163[_0x0742('0x1c')][_0x0742('0xb')]:'','joinAt':moment()[_0x0742('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e8163[_0x0742('0x1d')]?_0x3e8163['contact']['id']:null,'ListId':_0x3e8163[_0x0742('0x1e')]?_0x3e8163[_0x0742('0x1e')]['id']:null};_0x341c57[_[_0x0742('0x1f')](_0x3e8163[_0x0742('0x20')])+_0x0742('0x21')]=_0x9f42e['id']||null;_0x341c57[_[_0x0742('0x1f')](_0x3e8163[_0x0742('0x20')])+_0x0742('0x22')]=_0x3e8163[_0x0742('0x23')]?_0x3e8163[_0x0742('0x23')]['id']:null;_0x341c57[_[_0x0742('0x1f')](_0x3e8163[_0x0742('0x20')])+_0x0742('0x24')]=_0x3e8163['message']?_0x3e8163[_0x0742('0x25')]['id']:null;_0x341c57[_['upperFirst'](_0x3e8163[_0x0742('0x20')])+(_0x3e8163['channel']!==_0x0742('0x26')?_0x0742('0x27'):_0x0742('0x28'))]=_0x3e8163[_0x0742('0x29')]?_0x3e8163[_0x0742('0x29')]['id']:null;logger['info'](util[_0x0742('0xd')](_0x0742('0x2a'),_0x75c147,_0x9f42e[_0x0742('0x2b')]));emitChannelQueueInteraction(_0x3e8163[_0x0742('0x20')],_0x9f42e['name'],_0x341c57,_0x3e8163[_0x0742('0x29')]['name'],_0x3e8163[_0x0742('0x25')]['id'],!![],_0x215ac8,_0x9f42e['id']);if(rpc[_0x3e8163[_0x0742('0x20')]+_0x0742('0x2c')]){return rpc[_0x3e8163[_0x0742('0x20')]+_0x0742('0x2c')][_0x0742('0x2d')](_0x341c57)['catch'](function(_0x2d7eca){logger['error'](_0x0742('0x2e'));});}}}function stopRouting(_0x4889a0,_0x4ba989,_0x246ad8,_0x114d10){if(_0x4889a0&&_0x4ba989){_0x4ba989[_0x0742('0x1b')]-=0x1;var _0x3607a9={'leaveAt':moment()[_0x0742('0xd')](_0x0742('0x2f')),'acceptAt':moment()[_0x0742('0xd')](_0x0742('0x2f')),'reason':_0x0742('0x30')};logger[_0x0742('0x31')](util['format'](_0x0742('0x32'),_0x4889a0,_0x4ba989[_0x0742('0x2b')]));emitChannelQueueInteraction(_0x246ad8[_0x0742('0x20')],_0x4ba989['name'],_0x246ad8[_0x0742('0x1c')],_0x246ad8[_0x0742('0x29')][_0x0742('0x2b')],_0x246ad8['message']['id'],![],_0x114d10,_0x4ba989['id']);if(rpc[_0x246ad8[_0x0742('0x20')]+'QueueReport']){return rpc[_0x246ad8[_0x0742('0x20')]+_0x0742('0x2c')][_0x0742('0x33')](_0x4889a0,_0x3607a9)[_0x0742('0x34')](function(_0x1dd1ed){logger['error'](_0x0742('0x35'));});}}}function endRouting(_0x55138f,_0x27baa3,_0x513da4,_0x532536){if(_0x55138f&&_0x27baa3){_0x27baa3[_0x0742('0x1b')]-=0x1;var _0x13c03a={'leaveAt':moment()[_0x0742('0xd')](_0x0742('0x2f')),'exitAt':moment()[_0x0742('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x0742('0x36')};logger[_0x0742('0x31')](util[_0x0742('0xd')](_0x0742('0x37'),_0x55138f,_0x27baa3[_0x0742('0x2b')]));emitChannelQueueInteraction(_0x513da4['channel'],_0x27baa3['name'],_0x513da4[_0x0742('0x1c')],_0x513da4[_0x0742('0x29')]['name'],_0x513da4['message']['id'],![],_0x532536);if(rpc[_0x513da4['channel']+_0x0742('0x2c')]){return rpc[_0x513da4[_0x0742('0x20')]+_0x0742('0x2c')]['update'](_0x55138f,_0x13c03a)[_0x0742('0x34')](function(_0x591d7f){logger[_0x0742('0x38')](_0x0742('0x35'));});}}}function handleFindQueue(_0x3924ec){return function(_0x56e599){return _0x56e599[_0x0742('0x2b')][_0x0742('0x39')]()===_0x3924ec[_0x0742('0x39')]();};}exports['consequence']=function(_0x5da419,_0x17782d,_0x2fe0f7,_0x24ebf5){return function(_0x107a3d){try{var _0x22e469={'name':_0x17782d[0x0],'timeout':_0x17782d[0x1]};var _0x42b19b=queue[_0x0742('0x0')](_0x22e469,{'typecast':!![]});if(_0x42b19b['length']){logger[_0x0742('0x38')](_0x0742('0x3a'),_0x5da419,_[_0x0742('0x3b')](_0x42b19b,_0x0742('0x25'))['join'](',\x20'));_0x107a3d[_0x0742('0x3c')]();}else{var _0x1807e0=_['find'](_0x2fe0f7[_0x24ebf5[_0x0742('0x20')]+_0x0742('0x3d')],handleFindQueue(_0x22e469['name']));if(_0x1807e0){startRouting(_0x5da419,_0x1807e0,_0x24ebf5,_0x2fe0f7);var _0x271db0=(_0x1807e0[_0x0742('0x36')]||0xa)*0x3e8;var _0x3fcfa8=(_0x22e469[_0x0742('0x36')]||0x14)*0x3e8;var _0x10cb06,_0x5ec599;if(_0x271db0>_0x3fcfa8){_0x3fcfa8=_0x271db0;}var _0x3e367a=seqqueue[_0x0742('0x3e')](_0x271db0);_0x3e367a['id']=_0x5da419;_0x3e367a['atimeout']=_0x271db0;_0x3e367a[_0x0742('0x3f')]=_0x3fcfa8;_0x3e367a[_0x0742('0x20')]=_0x24ebf5['channel'];_0x2fe0f7['rules'][_0x5da419]['on'](_0x0742('0x40'),function(){stopRouting(_0x5da419,_0x1807e0,_0x24ebf5,_0x2fe0f7);_0x3e367a[_0x0742('0x41')](!![]);clearTimeout(_0x10cb06);_0x10cb06=undefined;if(_0x2fe0f7[_0x0742('0x42')][_0x5da419]){delete _0x2fe0f7[_0x0742('0x42')][_0x5da419];}logger[_0x0742('0x31')](_0x0742('0x43'),_0x5da419);_0x107a3d[_0x0742('0x3c')]();});_0x10cb06=setTimeout(function(){endRouting(_0x5da419,_0x1807e0,_0x24ebf5,_0x2fe0f7);clearTimeout(_0x10cb06);_0x3e367a['close'](!![]);logger['info'](_0x0742('0x44'),_0x5da419);_0x107a3d[_0x0742('0x45')]();},_0x3fcfa8);switch(_0x1807e0[_0x0742('0x46')]){case'rrmemory':strategy[_0x0742('0x47')](_0x3e367a,_0x1807e0,_0x2fe0f7,_0x24ebf5);break;default:strategy[_0x0742('0x48')](_0x3e367a,_0x1807e0,_0x2fe0f7,_0x24ebf5);}}else{logger[_0x0742('0x38')](_0x0742('0x49'),_0x5da419,_0x22e469[_0x0742('0x2b')]);_0x107a3d[_0x0742('0x3c')]();}}}catch(_0x52597c){console[_0x0742('0x4a')](_0x52597c);logger['error'](_0x0742('0x3a'),_0x5da419,_0x52597c[_0x0742('0x4b')]);_0x107a3d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index e7f304c..675d402 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 _0x4b2e=['info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','bind','handleTimeout','timeout','drained','prototype','push','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','agents','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED'];(function(_0x171c66,_0x10f818){var _0x502d3a=function(_0x47d22a){while(--_0x47d22a){_0x171c66['push'](_0x171c66['shift']());}};_0x502d3a(++_0x10f818);}(_0x4b2e,0xf5));var _0xe4b2=function(_0x1a0818,_0x2530ed){_0x1a0818=_0x1a0818-0x0;var _0x5a19f4=_0x4b2e[_0x1a0818];return _0x5a19f4;};'use strict';var _=require(_0xe4b2('0x0'));var uuid=require(_0xe4b2('0x1'));var util=require(_0xe4b2('0x2'));var logger=require(_0xe4b2('0x3'))(_0xe4b2('0x4'));var Agent=function(_0x2e8865,_0x367048,_0x2c092b,_0x437305){this[_0xe4b2('0x5')]=uuid['v4']();this[_0xe4b2('0x6')]=_0x2e8865;this[_0xe4b2('0x7')]=_0x367048;this[_0xe4b2('0x8')]=_0x2c092b;this['routing']=_0x437305;this[_0xe4b2('0x6')]['push'](this[_0xe4b2('0x9')][_0xe4b2('0xa')](this),this[_0xe4b2('0xb')]['bind'](this));this[_0xe4b2('0x6')]['on'](_0xe4b2('0xc'),this[_0xe4b2('0xb')][_0xe4b2('0xa')](this));this[_0xe4b2('0x6')]['on'](_0xe4b2('0xd'),this['handleDrained'][_0xe4b2('0xa')](this));};Agent[_0xe4b2('0xe')]['push']=function(){this[_0xe4b2('0x6')][_0xe4b2('0xf')](this[_0xe4b2('0x9')]['bind'](this),this[_0xe4b2('0xb')][_0xe4b2('0xa')](this));};Agent[_0xe4b2('0xe')][_0xe4b2('0x10')]=function(){this[_0xe4b2('0xb')](!![]);};Agent[_0xe4b2('0xe')][_0xe4b2('0x9')]=function(_0x1b5871){logger['info'](_0xe4b2('0x11'),this['squeue']['id'],this[_0xe4b2('0x7')]['id']);if(_['isNil'](this[_0xe4b2('0x8')][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xe4b2('0x6')]['id'],this[_0xe4b2('0x7')]['id']);setTimeout(this['push'][_0xe4b2('0xa')](this),0x3e8);}else{if(this[_0xe4b2('0x4')][_0xe4b2('0x13')]||util[_0xe4b2('0x14')](this['squeue']['id'],this[_0xe4b2('0x8')][_0xe4b2('0x12')][this['agent']['id']],this[_0xe4b2('0x6')]['channel'],![])){this[_0xe4b2('0x8')][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']][_0xe4b2('0x15')]=!![];this[_0xe4b2('0x8')][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']][_0xe4b2('0x16')]=undefined;util[_0xe4b2('0x17')](this[_0xe4b2('0x5')],this[_0xe4b2('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],null,this[_0xe4b2('0x4')]);util[_0xe4b2('0x18')](this[_0xe4b2('0x6')]['id'],this[_0xe4b2('0x8')][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']],_0xe4b2('0x19')+(this[_0xe4b2('0x4')][_0xe4b2('0x13')]?_0xe4b2('0x1a'):''));}else{logger[_0xe4b2('0x1b')](_0xe4b2('0x1c'),this[_0xe4b2('0x6')]['id'],this[_0xe4b2('0x7')]['id']);setTimeout(this[_0xe4b2('0xf')][_0xe4b2('0xa')](this),0x3e8);}}};Agent[_0xe4b2('0xe')][_0xe4b2('0xb')]=function(_0x2c2c4e){if(_['isNil'](this['realtime'][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']])){return logger[_0xe4b2('0x1b')](_0xe4b2('0x1d'),this[_0xe4b2('0x6')]['id'],this[_0xe4b2('0x7')]['id']);}else{logger[_0xe4b2('0x1b')](_0xe4b2('0x1e'),this[_0xe4b2('0x6')]['id'],this[_0xe4b2('0x7')]['id']);util[_0xe4b2('0x1f')](this[_0xe4b2('0x5')],this['squeue']['id'],this['realtime'][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']],null,this['routing']);this[_0xe4b2('0x8')][_0xe4b2('0x12')][this['agent']['id']][_0xe4b2('0x15')]=![];this[_0xe4b2('0x8')][_0xe4b2('0x12')][this['agent']['id']][_0xe4b2('0x16')]=undefined;util['writeLog'](this[_0xe4b2('0x6')]['id'],this['realtime'][_0xe4b2('0x12')][this[_0xe4b2('0x7')]['id']],_0x2c2c4e?_0xe4b2('0x20'):_0xe4b2('0x21'));}if(!_0x2c2c4e){setTimeout(this[_0xe4b2('0xf')][_0xe4b2('0xa')](this),0x3e8);}};function agent(_0x39702a,_0x31a2a1,_0x44bd51,_0x6e305c){return new Agent(_0x39702a,_0x31a2a1,_0x44bd51,_0x6e305c);}module['exports']=agent; \ No newline at end of file +var _0x2941=['handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','agent','realtime','routing','squeue','push'];(function(_0x57275b,_0x13c808){var _0x3d42cd=function(_0x13939e){while(--_0x13939e){_0x57275b['push'](_0x57275b['shift']());}};_0x3d42cd(++_0x13c808);}(_0x2941,0x6e));var _0x1294=function(_0x458775,_0x523411){_0x458775=_0x458775-0x0;var _0x48eb06=_0x2941[_0x458775];return _0x48eb06;};'use strict';var _=require(_0x1294('0x0'));var uuid=require(_0x1294('0x1'));var util=require(_0x1294('0x2'));var logger=require(_0x1294('0x3'))('routing');var Agent=function(_0x150ce6,_0x3f8973,_0x221394,_0x237fe1){this[_0x1294('0x4')]=uuid['v4']();this['squeue']=_0x150ce6;this[_0x1294('0x5')]=_0x3f8973;this[_0x1294('0x6')]=_0x221394;this[_0x1294('0x7')]=_0x237fe1;this[_0x1294('0x8')][_0x1294('0x9')](this[_0x1294('0xa')]['bind'](this),this[_0x1294('0xb')][_0x1294('0xc')](this));this[_0x1294('0x8')]['on'](_0x1294('0xd'),this['handleTimeout'][_0x1294('0xc')](this));this[_0x1294('0x8')]['on'](_0x1294('0xe'),this[_0x1294('0xf')][_0x1294('0xc')](this));};Agent[_0x1294('0x10')][_0x1294('0x9')]=function(){this['squeue'][_0x1294('0x9')](this[_0x1294('0xa')][_0x1294('0xc')](this),this[_0x1294('0xb')][_0x1294('0xc')](this));};Agent['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1294('0xa')]=function(_0x81d768){logger[_0x1294('0x11')](_0x1294('0x12'),this['squeue']['id'],this['agent']['id']);if(_[_0x1294('0x13')](this['realtime'][_0x1294('0x14')][this[_0x1294('0x5')]['id']])){logger[_0x1294('0x11')](_0x1294('0x15'),this[_0x1294('0x8')]['id'],this[_0x1294('0x5')]['id']);setTimeout(this[_0x1294('0x9')]['bind'](this),0x3e8);}else{if(this[_0x1294('0x7')][_0x1294('0x16')]||util['isAgentAvailable'](this[_0x1294('0x8')]['id'],this['realtime'][_0x1294('0x14')][this[_0x1294('0x5')]['id']],this[_0x1294('0x8')][_0x1294('0x17')],![])){this['realtime'][_0x1294('0x14')][this[_0x1294('0x5')]['id']][_0x1294('0x18')]=!![];this[_0x1294('0x6')][_0x1294('0x14')][this['agent']['id']][_0x1294('0x19')]=undefined;util['showNotification'](this['notificationId'],this[_0x1294('0x8')]['id'],this[_0x1294('0x6')]['agents'][this['agent']['id']],null,this[_0x1294('0x7')]);util['writeLog'](this['squeue']['id'],this[_0x1294('0x6')][_0x1294('0x14')][this[_0x1294('0x5')]['id']],'RINGING'+(this[_0x1294('0x7')][_0x1294('0x16')]?':FORCED':''));}else{logger[_0x1294('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x1294('0x5')]['id']);setTimeout(this[_0x1294('0x9')][_0x1294('0xc')](this),0x3e8);}}};Agent[_0x1294('0x10')][_0x1294('0xb')]=function(_0x316496){if(_[_0x1294('0x13')](this[_0x1294('0x6')][_0x1294('0x14')][this[_0x1294('0x5')]['id']])){return logger[_0x1294('0x11')](_0x1294('0x15'),this[_0x1294('0x8')]['id'],this['agent']['id']);}else{logger[_0x1294('0x11')](_0x1294('0x1a'),this[_0x1294('0x8')]['id'],this[_0x1294('0x5')]['id']);util['hideNotification'](this[_0x1294('0x4')],this[_0x1294('0x8')]['id'],this[_0x1294('0x6')][_0x1294('0x14')][this[_0x1294('0x5')]['id']],null,this['routing']);this['realtime'][_0x1294('0x14')][this[_0x1294('0x5')]['id']][_0x1294('0x18')]=![];this[_0x1294('0x6')][_0x1294('0x14')][this['agent']['id']][_0x1294('0x19')]=undefined;util[_0x1294('0x1b')](this[_0x1294('0x8')]['id'],this[_0x1294('0x6')][_0x1294('0x14')][this[_0x1294('0x5')]['id']],_0x316496?_0x1294('0x1c'):'TIMEOUT');}if(!_0x316496){setTimeout(this['push'][_0x1294('0xc')](this),0x3e8);}};function agent(_0x13acc4,_0x127156,_0x15aa55,_0x18321d){return new Agent(_0x13acc4,_0x127156,_0x15aa55,_0x18321d);}module[_0x1294('0x1d')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 7f0e326..145b2aa 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 _0x3020=['timeout','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','Agents','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busyQueue','name','showNotification','notificationId','length','writeLog','STOP','TIMEOUT','busy','lodash','uuid','./util','../../../../../config/logger','squeue','queue','routing','push','bind'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x3020,0xff));var _0x0302=function(_0x530d36,_0x4df559){_0x530d36=_0x530d36-0x0;var _0x1658f9=_0x3020[_0x530d36];return _0x1658f9;};'use strict';var _=require(_0x0302('0x0'));var uuid=require(_0x0302('0x1'));var util=require(_0x0302('0x2'));var logger=require(_0x0302('0x3'))('routing');var Beepall=function(_0xc334f1,_0x28f86b,_0x44b474,_0xc66fee){this['notificationId']=uuid['v4']();this[_0x0302('0x4')]=_0xc334f1;this[_0x0302('0x5')]=_0x28f86b;this['realtime']=_0x44b474;this[_0x0302('0x6')]=_0xc66fee;this['squeue'][_0x0302('0x7')](this['handleRun'][_0x0302('0x8')](this),this['handleTimeout'][_0x0302('0x8')](this));this['squeue']['on'](_0x0302('0x9'),this[_0x0302('0xa')][_0x0302('0x8')](this));this[_0x0302('0x4')]['on'](_0x0302('0xb'),this[_0x0302('0xc')][_0x0302('0x8')](this));};Beepall[_0x0302('0xd')][_0x0302('0x7')]=function(){this[_0x0302('0x4')][_0x0302('0x7')](this[_0x0302('0xe')][_0x0302('0x8')](this),this[_0x0302('0xa')][_0x0302('0x8')](this));};Beepall[_0x0302('0xd')][_0x0302('0xc')]=function(_0x2fa2c6){this[_0x0302('0xa')](!![]);};Beepall[_0x0302('0xd')]['handleRun']=function(_0x5d65b2){var _0x946872=!![];if(!_[_0x0302('0xf')](this[_0x0302('0x5')])&&!_[_0x0302('0xf')](this[_0x0302('0x5')][_0x0302('0x10')])&&this[_0x0302('0x5')][_0x0302('0x10')]['length']>0x0){for(var _0x3b09ea=0x0,_0x5ef504;_0x3b09ea0x0){for(var _0x37177d=0x0,_0x4f4754;_0x37177d0x0&&_0x45b2aa[_0x103ebe+_0x6213('0x28')]>=_0x45b2aa[_0x103ebe+_0x6213('0x27')]){writeLog(_0xfa4b5a,_0x45b2aa,_0x103ebe[_0x6213('0x29')]()+_0x6213('0x2a'));return![];}}return!![];};exports[_0x6213('0x2b')]=function(_0x3b4735,_0x363af0,_0x29e86e,_0x58f30b,_0xacf549){return sendNotification(!![],_0x3b4735,_0x363af0,_0x29e86e,_0x58f30b,_0xacf549);};exports[_0x6213('0x2c')]=function(_0x56884a,_0x29674b,_0x224039,_0x4ee434,_0x5732f8){return sendNotification(![],_0x56884a,_0x29674b,_0x224039,_0x4ee434,_0x5732f8);};exports[_0x6213('0x2d')]=writeLog; \ No newline at end of file +var _0xb9a0=['\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','format','name','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','message','user:%s','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','toUpperCase'];(function(_0x315802,_0x4953a9){var _0x2a32b5=function(_0x32c34a){while(--_0x32c34a){_0x315802['push'](_0x315802['shift']());}};_0x2a32b5(++_0x4953a9);}(_0xb9a0,0x186));var _0x0b9a=function(_0x1e8e7b,_0x590356){_0x1e8e7b=_0x1e8e7b-0x0;var _0x523be6=_0xb9a0[_0x1e8e7b];return _0x523be6;};'use strict';var _=require(_0x0b9a('0x0'));var util=require(_0x0b9a('0x1'));var utils=require(_0x0b9a('0x2'));var Mustache=require('mustache');var Redis=require(_0x0b9a('0x3'));var config=require(_0x0b9a('0x4'));var logger=require(_0x0b9a('0x5'))(_0x0b9a('0x6'));config[_0x0b9a('0x7')]=_[_0x0b9a('0x8')](config[_0x0b9a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x0b9a('0x9'))(new Redis(config[_0x0b9a('0x7')]));function emit(_0x131a2c,_0x457e80,_0xe430f6){io['to'](_0x131a2c)[_0x0b9a('0xa')](_0x457e80,_0xe430f6);}function sendNotification(_0x1cec71,_0x2eb863,_0x2f076f,_0x2f78b8,_0x29e057,_0x228706){io['to'](util[_0x0b9a('0xb')]('user:%s',_0x2f78b8[_0x0b9a('0xc')]))['emit'](_0x0b9a('0xd'),_0x2f78b8);var _0x489394=_0x228706||{};var _0x12bff8=_0x2f076f['split']('.');var _0x47948b={'uniqueid':_0x2eb863,'channel':_0x12bff8[0x0],'id':_0x12bff8[0x1],'title':_0x12bff8[0x0]+_0x0b9a('0xe'),'interactionId':_0x12bff8[0x2],'queue':_0x29e057?_0x29e057[_0x0b9a('0xc')]:null,'sound':_0x489394[_0x0b9a('0xf')][_0x0b9a('0x10')],'shake':_0x489394['account'][_0x0b9a('0x11')]};try{if(!_0x489394[_0x0b9a('0x12')]){_0x489394[_0x0b9a('0x12')]={};}if(_0x29e057){_0x489394[_0x0b9a('0x12')][_0x0b9a('0x13')]=_0x29e057;}else if(_0x489394[_0x0b9a('0x12')][_0x0b9a('0x13')]){delete _0x489394[_0x0b9a('0x12')][_0x0b9a('0x13')];}_0x47948b[_0x0b9a('0x14')]=utils[_0x0b9a('0x15')](_0x489394['account'][_0x0b9a('0x16')],_0x489394);}catch(_0x2c94fe){_0x47948b[_0x0b9a('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x0b9a('0x17')](util['format']('[%s][QUEUE]\x20%s',_0x2eb863,_0x2c94fe[_0x0b9a('0x18')]));}io['to'](util[_0x0b9a('0xb')](_0x0b9a('0x19'),_0x2f78b8[_0x0b9a('0xc')]))[_0x0b9a('0xa')](util[_0x0b9a('0xb')](_0x0b9a('0x1a'),_0x1cec71?_0x0b9a('0x1b'):'remove'),_0x47948b);}function writeLog(_0x5d65af,_0x33b88e,_0x53b526){return logger[_0x0b9a('0x1c')](util[_0x0b9a('0xb')](_0x0b9a('0x1d'),_0x5d65af,_0x33b88e[_0x0b9a('0xc')],_0x53b526));}exports[_0x0b9a('0x1e')]=function(_0xdb6a0b,_0x3819f2,_0x1ae8d5,_0x5b2701){if(_0x3819f2[_0x0b9a('0x1f')]){writeLog(_0xdb6a0b,_0x3819f2,_0x0b9a('0x20'));return![];}if(!_0x3819f2[_0x0b9a('0x21')]){writeLog(_0xdb6a0b,_0x3819f2,_0x0b9a('0x22'));return![];}if(_0x3819f2[_0x1ae8d5+_0x0b9a('0x23')]){writeLog(_0xdb6a0b,_0x3819f2,_0x0b9a('0x24'));return![];}if(_0x5b2701&&_0x3819f2[_0x0b9a('0x25')](_0x1ae8d5+_0x0b9a('0x26'))&&_0x3819f2['hasOwnProperty'](_0x1ae8d5+'CurrentCapacity')){if(_0x3819f2[_0x1ae8d5+_0x0b9a('0x26')]>0x0&&_0x3819f2[_0x1ae8d5+'CurrentCapacity']>=_0x3819f2[_0x1ae8d5+_0x0b9a('0x26')]){writeLog(_0xdb6a0b,_0x3819f2,_0x1ae8d5[_0x0b9a('0x27')]()+_0x0b9a('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x2232d8,_0x44cd0d,_0x191cd9,_0x1b8f85,_0x4366b1){return sendNotification(!![],_0x2232d8,_0x44cd0d,_0x191cd9,_0x1b8f85,_0x4366b1);};exports[_0x0b9a('0x29')]=function(_0x4bd629,_0x3bfe08,_0x21ebae,_0x3a260e,_0x3eaa74){return sendNotification(![],_0x4bd629,_0x3bfe08,_0x21ebae,_0x3a260e,_0x3eaa74);};exports[_0x0b9a('0x2a')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 7547e84..2292848 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 _0x0443=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x0443,0x186));var _0x3044=function(_0x21c096,_0x63ad66){_0x21c096=_0x21c096-0x0;var _0x2d1e8d=_0x0443[_0x21c096];return _0x2d1e8d;};'use strict';var schema=require(_0x3044('0x0'));var sh=require(_0x3044('0x1'));var _=require(_0x3044('0x2'));var utils=require(_0x3044('0x3'));var logger=require(_0x3044('0x4'))(_0x3044('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x3044('0x6')}});exports[_0x3044('0x7')]=function(_0x152b3c,_0x176380){return function(_0x4e9c7e){try{var _0x149983={'command':_0x176380[0x0]};var _0x224126=system[_0x3044('0x0')](_0x149983,{'typecast':!![]});if(_0x224126[_0x3044('0x8')]){logger[_0x3044('0x9')](_0x3044('0xa'),_0x152b3c,_[_0x3044('0xb')](_0x224126,_0x3044('0xc'))[_0x3044('0xd')](',\x20'));logger[_0x3044('0xe')](_0x3044('0xf'),_0x152b3c);_0x4e9c7e['next']();}else{var _0x5746b8=this;var _0x59f308=utils[_0x3044('0x10')](_0x176380[0x0],this);logger[_0x3044('0xe')](_0x3044('0x11'),_0x152b3c,_0x59f308);sh['exec'](_[_0x3044('0x12')](_0x59f308),function(_0x36b3c2,_0x4d989d){logger[_0x3044('0xe')](_0x3044('0x13'),_0x152b3c,_0x36b3c2);if(_0x36b3c2==0x0){var _0x2f9a1b=_0x4d989d[_0x3044('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x3044('0x15')](_0x176380[0x1])||_['isEmpty'](_0x176380[0x1])){logger[_0x3044('0xe')](_0x3044('0x16'),_0x152b3c);_0x5746b8[_0x3044('0x17')][_0x176380[0x1]]=_0x2f9a1b;}else{logger[_0x3044('0xe')](_0x3044('0x18'),_0x152b3c,_0x176380[0x1],_0x2f9a1b);_0x5746b8[_0x3044('0x17')][_0x176380[0x1]]=_0x2f9a1b;}}_0x4e9c7e['next']();});}}catch(_0x2789f1){logger['error'](_0x3044('0xa'),_0x152b3c,_[_0x3044('0x19')](_0x2789f1)?JSON[_0x3044('0x1a')](_0x2789f1):_0x2789f1);logger['info'](_0x3044('0xf'),_0x152b3c);_0x4e9c7e['next']();}};}; \ No newline at end of file +var _0x838d=['trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x289e59,_0x45c7f9){var _0x1c37c5=function(_0x53e8a9){while(--_0x53e8a9){_0x289e59['push'](_0x289e59['shift']());}};_0x1c37c5(++_0x45c7f9);}(_0x838d,0x194));var _0xd838=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x838d[_0x4a7631];return _0x1a5a6f;};'use strict';var schema=require('validate');var sh=require(_0xd838('0x0'));var _=require(_0xd838('0x1'));var utils=require('./utils');var logger=require(_0xd838('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xd838('0x3')}});exports[_0xd838('0x4')]=function(_0x567f2e,_0x15e3a6){return function(_0x492b16){try{var _0x3f2432={'command':_0x15e3a6[0x0]};var _0x2841fc=system['validate'](_0x3f2432,{'typecast':!![]});if(_0x2841fc[_0xd838('0x5')]){logger['error'](_0xd838('0x6'),_0x567f2e,_[_0xd838('0x7')](_0x2841fc,'message')['join'](',\x20'));logger[_0xd838('0x8')](_0xd838('0x9'),_0x567f2e);_0x492b16[_0xd838('0xa')]();}else{var _0x2cd2e3=this;var _0x549bf3=utils[_0xd838('0xb')](_0x15e3a6[0x0],this);logger[_0xd838('0x8')](_0xd838('0xc'),_0x567f2e,_0x549bf3);sh[_0xd838('0xd')](_[_0xd838('0xe')](_0x549bf3),function(_0x12b65f,_0x22c041){logger[_0xd838('0x8')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x567f2e,_0x12b65f);if(_0x12b65f==0x0){var _0x1566cc=_0x22c041[_0xd838('0xf')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x15e3a6[0x1])||_[_0xd838('0x10')](_0x15e3a6[0x1])){logger[_0xd838('0x8')](_0xd838('0x11'),_0x567f2e);_0x2cd2e3[_0xd838('0x12')][_0x15e3a6[0x1]]=_0x1566cc;}else{logger[_0xd838('0x8')](_0xd838('0x13'),_0x567f2e,_0x15e3a6[0x1],_0x1566cc);_0x2cd2e3[_0xd838('0x12')][_0x15e3a6[0x1]]=_0x1566cc;}}_0x492b16[_0xd838('0xa')]();});}}catch(_0x1695c0){logger['error'](_0xd838('0x6'),_0x567f2e,_[_0xd838('0x14')](_0x1695c0)?JSON[_0xd838('0x15')](_0x1695c0):_0x1695c0);logger[_0xd838('0x8')](_0xd838('0x9'),_0x567f2e);_0x492b16[_0xd838('0xa')]();}};}; \ 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 6c9822e..aeafcca 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 _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x527379,_0x3ec58d){var _0x219af0=function(_0xf7144){while(--_0xf7144){_0x527379['push'](_0x527379['shift']());}};_0x219af0(++_0x3ec58d);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ 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(_0x5bafb1,_0x1e376a){var _0x5e1ca3=function(_0x12b1b){while(--_0x12b1b){_0x5bafb1['push'](_0x5bafb1['shift']());}};_0x5e1ca3(++_0x1e376a);}(_0x7a54,0x106));var _0x47a5=function(_0x289d07,_0x9b2f2f){_0x289d07=_0x289d07-0x0;var _0x3779a7=_0x7a54[_0x289d07];return _0x3779a7;};'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 bd9910b..30c1b7b 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 _0x18a9=['contact','message','account','interaction','list','exports','render','merge','body'];(function(_0x47791a,_0x562c56){var _0x3b0a30=function(_0x1e01c2){while(--_0x1e01c2){_0x47791a['push'](_0x47791a['shift']());}};_0x3b0a30(++_0x562c56);}(_0x18a9,0x15b));var _0x918a=function(_0x148b96,_0x509987){_0x148b96=_0x148b96-0x0;var _0x11fa97=_0x18a9[_0x148b96];return _0x11fa97;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x918a('0x0')]={'getMustacheRender':function(_0x1710fd,_0x218509){return Mustache[_0x918a('0x1')](_0x1710fd,_[_0x918a('0x2')](_0x218509[_0x918a('0x3')],{'contact':_0x218509[_0x918a('0x4')],'message':_0x218509[_0x918a('0x5')],'account':_0x218509[_0x918a('0x6')],'interaction':_0x218509[_0x918a('0x7')],'list':_0x218509[_0x918a('0x8')]}))||'';}}; \ No newline at end of file +var _0x5640=['account','interaction','list','mustache','exports','render','merge','body','contact','message'];(function(_0x54f049,_0x28e5bb){var _0x427c6c=function(_0x4fd019){while(--_0x4fd019){_0x54f049['push'](_0x54f049['shift']());}};_0x427c6c(++_0x28e5bb);}(_0x5640,0x111));var _0x0564=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5640[_0x2c91e9];return _0x13f0ff;};'use strict';var Mustache=require(_0x0564('0x0'));var _=require('lodash');module[_0x0564('0x1')]={'getMustacheRender':function(_0x2b494e,_0x8ebafe){return Mustache[_0x0564('0x2')](_0x2b494e,_[_0x0564('0x3')](_0x8ebafe[_0x0564('0x4')],{'contact':_0x8ebafe[_0x0564('0x5')],'message':_0x8ebafe[_0x0564('0x6')],'account':_0x8ebafe[_0x0564('0x7')],'interaction':_0x8ebafe[_0x0564('0x8')],'list':_0x8ebafe[_0x0564('0x9')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 22ba276..e51abc1 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 _0xdb4b=['app','toLowerCase','autoreply','appdata','split','push','dialogflow','slice','amazonlex','TagId','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','.js','execute','stringify','matchPath','emit','end','stack','QueueReport','update','catch','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','mailQueues','available','name','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','length','applications','existsSync','join'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdb4b,0x98));var _0xbdb4=function(_0x1f5169,_0x50224c){_0x1f5169=_0x1f5169-0x0;var _0x28989f=_0xdb4b[_0x1f5169];return _0x28989f;};'use strict';var _=require(_0xbdb4('0x0'));var util=require(_0xbdb4('0x1'));var path=require(_0xbdb4('0x2'));var fs=require('fs');var jayson=require(_0xbdb4('0x3'));var BPromise=require('bluebird');var uuid=require(_0xbdb4('0x4'));var config=require(_0xbdb4('0x5'));var logger=require(_0xbdb4('0x6'))(_0xbdb4('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0xbdb4('0x8')),'mailQueueReport':require(_0xbdb4('0x9')),'chatQueueReport':require(_0xbdb4('0xa')),'smsQueueReport':require(_0xbdb4('0xb')),'faxQueueReport':require(_0xbdb4('0xc'))};var RuleEngine=require(_0xbdb4('0xd'));function getId(_0x452ee9,_0x5d659b,_0x5af7de){return util[_0xbdb4('0xe')](_0xbdb4('0xf'),_0x452ee9,_0x5d659b||0x0,_0x5af7de||0x0);}function getIntervals(_0x3b2531,_0x27b209){var _0x241013=[];if(!_[_0xbdb4('0x10')](_0x27b209['IntervalId'])&&!_[_0xbdb4('0x10')](_0x3b2531[_0x27b209[_0xbdb4('0x11')]])&&!_[_0xbdb4('0x10')](_0x3b2531[_0x27b209['IntervalId']]['Intervals'])){_0x241013=_[_0xbdb4('0x12')](_0x3b2531[_0x27b209[_0xbdb4('0x11')]][_0xbdb4('0x13')],'interval');}else if(!_['isNil'](_0x27b209[_0xbdb4('0x14')])){_0x241013=[_0x27b209[_0xbdb4('0x14')]];}return _0x241013;}exports[_0xbdb4('0x15')]=function(_0x48ca38){_0x48ca38[_0xbdb4('0x16')]={};return new BPromise(function(_0x4f7e68,_0x101147){var _0x58a281={'Start':function(_0x5178ae){var _0x4b3f7f=this;return new Promise(function(_0x552917,_0x24c6bb){if(_0x5178ae){try{var _0x583bea=[];var _0x137c91=getId(_0x5178ae[_0xbdb4('0x17')],_0x5178ae[_0xbdb4('0x18')]?_0x5178ae[_0xbdb4('0x18')]['id']:0x0,_0x5178ae[_0xbdb4('0x19')]?_0x5178ae['interaction']['id']:0x0);if(_0x5178ae['applications']&&_['isArray'](_0x5178ae['applications'])&&_0x5178ae['applications'][_0xbdb4('0x1a')]){for(var _0x34116d=0x0;_0x34116d<_0x5178ae[_0xbdb4('0x1b')][_0xbdb4('0x1a')];_0x34116d+=0x1){var _0x48586a=_0x5178ae['applications'][_0x34116d];if(fs[_0xbdb4('0x1c')](path[_0xbdb4('0x1d')](__dirname,'applications',_0x48586a[_0xbdb4('0x1e')]+'.js'))){var _0x282687=[];switch(_0x48586a[_0xbdb4('0x1e')][_0xbdb4('0x1f')]()){case _0xbdb4('0x20'):var _0x502d62=_0x48586a[_0xbdb4('0x21')][_0xbdb4('0x22')](',');_0x282687[_0xbdb4('0x23')](_0x502d62[0x0]);_0x282687[_0xbdb4('0x23')](_0x502d62['slice'](0x1,_0x502d62[_0xbdb4('0x1a')])[_0xbdb4('0x1d')](','));break;case _0xbdb4('0x24'):var _0x502d62=_0x48586a['appdata']['split'](',');_0x282687[_0xbdb4('0x23')](_0x502d62[0x0]);_0x282687[_0xbdb4('0x23')](_0x502d62[0x1]);_0x282687['push'](_0x502d62[_0xbdb4('0x25')](0x2,_0x502d62[_0xbdb4('0x1a')])[_0xbdb4('0x1d')](','));break;case _0xbdb4('0x26'):var _0x502d62=_0x48586a[_0xbdb4('0x21')][_0xbdb4('0x22')](',');_0x282687[_0xbdb4('0x23')](_0x502d62[0x0]);_0x282687[_0xbdb4('0x23')](_0x502d62[0x1]);_0x282687[_0xbdb4('0x23')](_0x502d62[0x2]);_0x282687[_0xbdb4('0x23')](_0x502d62[0x3]);_0x282687[_0xbdb4('0x23')](_0x502d62['slice'](0x4,_0x502d62[_0xbdb4('0x1a')])['join'](','));break;case _0xbdb4('0x18'):_0x282687[_0xbdb4('0x23')](_0x48586a[_0xbdb4('0x21')]);break;case'tag':_0x282687['push'](_0x48586a[_0xbdb4('0x27')]);_0x282687[_0xbdb4('0x23')](_0x48586a['appdata']);break;default:_0x282687=_[_0xbdb4('0x10')](_0x48586a[_0xbdb4('0x21')])?[]:_0x48586a['appdata'][_0xbdb4('0x22')](',');}var _0x2757a8={'id':util['format']('%s:%s:%s',_0x137c91,_0x48586a['id'],_0x48586a['app']),'condition':require(_0xbdb4('0x28'))[_0xbdb4('0x29')](_0x137c91,getIntervals(_0x48ca38[_0xbdb4('0x2a')],_0x48586a),_0x48ca38),'consequence':require(_0xbdb4('0x2b')+_0x48586a[_0xbdb4('0x1e')])[_0xbdb4('0x2c')](_0x137c91,_0x282687,_0x48ca38,_0x5178ae),'p':_0x48586a[_0xbdb4('0x2d')]||0x0};logger[_0xbdb4('0x2e')]('Push\x20new\x20rule',_0x2757a8['id'],_0xbdb4('0x2f'),getIntervals(_0x48ca38[_0xbdb4('0x2a')],_0x48586a)['join'](_0xbdb4('0x30')));_0x583bea[_0xbdb4('0x23')](_0x2757a8);}else{logger[_0xbdb4('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xbdb4('0x1d')](__dirname,'applications',_0x48586a['app']+_0xbdb4('0x32')));}}_0x48ca38[_0xbdb4('0x16')][_0x137c91]=new RuleEngine(_0x583bea);_0x48ca38[_0xbdb4('0x16')][_0x137c91][_0xbdb4('0x33')](_0x5178ae,function(_0x4717ba){logger[_0xbdb4('0x2e')]('Applications\x20executed',JSON[_0xbdb4('0x34')](_0x4717ba[_0xbdb4('0x35')]));if(_0x48ca38[_0xbdb4('0x16')][_0x137c91]){_0x48ca38[_0xbdb4('0x16')][_0x137c91][_0xbdb4('0x36')](_0xbdb4('0x37'));}});return _0x552917({'code':0xc8,'message':_0x5178ae});}else{logger[_0xbdb4('0x2e')]('No\x20applications\x20to\x20execute');return _0x552917({'code':0xc8,'message':_0x5178ae});}}catch(_0x46d92c){logger[_0xbdb4('0x31')](_0x46d92c[_0xbdb4('0x38')]);return _0x24c6bb(_0x4b3f7f['error'](0x1f4,_0x46d92c));}}return _0x24c6bb('routing\x20is\x20empty');});},'AcceptMessage':function(_0x64a883){var _0x5b1e37=this;return new Promise(function(_0x276af1,_0x5dbd2f){if(_0x64a883['message']&&_0x64a883[_0xbdb4('0x18')]['id']){try{var _0x54017f=getId(_0x64a883[_0xbdb4('0x17')],_0x64a883[_0xbdb4('0x18')]?_0x64a883[_0xbdb4('0x18')]['id']:0x0,_0x64a883['interaction']?_0x64a883[_0xbdb4('0x19')]['id']:0x0);if(_0x48ca38[_0xbdb4('0x16')][_0x54017f]){_0x48ca38[_0xbdb4('0x16')][_0x54017f][_0xbdb4('0x36')]('end');if(rpc[_0x64a883[_0xbdb4('0x17')]+_0xbdb4('0x39')]){rpc[_0x64a883[_0xbdb4('0x17')]+_0xbdb4('0x39')][_0xbdb4('0x3a')](_0x54017f,{'UserId':_0x64a883[_0xbdb4('0x18')]['UserId']})[_0xbdb4('0x3b')](function(_0x5e9384){logger[_0xbdb4('0x31')]('error\x20update\x20queue\x20report');});}}return _0x276af1({'code':0xc8,'message':_0x64a883});}catch(_0x4f3c7a){logger[_0xbdb4('0x31')](_0x4f3c7a['stack']);return _0x5dbd2f(_0x5b1e37[_0xbdb4('0x31')](0x1f4,_0x4f3c7a));}}logger[_0xbdb4('0x31')](_0xbdb4('0x3c'));return _0x5dbd2f(_0x5b1e37[_0xbdb4('0x31')](0x1f4,_0xbdb4('0x3c')));});},'RejectMessage':function(_0x33af6b){var _0x1304b4=this;return new Promise(function(_0x3922c9,_0x25d82d){if(_0x33af6b[_0xbdb4('0x3d')]&&_0x33af6b[_0xbdb4('0x3d')]['id']){try{if(_0x48ca38['agents'][_0x33af6b['agent']['id']]){_0x48ca38[_0xbdb4('0x3e')][_0x33af6b['agent']['id']][_0xbdb4('0x3f')]=![];_0x48ca38[_0xbdb4('0x3e')][_0x33af6b[_0xbdb4('0x3d')]['id']][_0xbdb4('0x40')]=undefined;}return _0x3922c9({'code':0xc8,'message':_0x33af6b});}catch(_0x59e6bc){logger[_0xbdb4('0x31')](_0x59e6bc[_0xbdb4('0x38')]);return _0x25d82d(_0x1304b4[_0xbdb4('0x31')](0x1f4,_0x59e6bc));}}logger[_0xbdb4('0x31')](_0xbdb4('0x3c'));return _0x25d82d(_0x1304b4[_0xbdb4('0x31')](0x1f4,_0xbdb4('0x3c')));});},'AbandonInteraction':function(_0x21e5e8){var _0x51796c=this;return new Promise(function(_0x299a9e,_0x1a7422){if(_0x21e5e8['channel']&&_0x21e5e8['interaction']&&_0x21e5e8[_0xbdb4('0x19')]['id']){try{var _0x224529=getId(_0x21e5e8[_0xbdb4('0x17')],_0x21e5e8[_0xbdb4('0x18')]?_0x21e5e8[_0xbdb4('0x18')]['id']:0x0,_0x21e5e8['interaction']?_0x21e5e8[_0xbdb4('0x19')]['id']:0x0);if(_0x48ca38[_0xbdb4('0x16')][_0x224529]){_0x48ca38['rules'][_0x224529][_0xbdb4('0x36')](_0xbdb4('0x37'));}return _0x299a9e({'code':0xc8,'message':_0x21e5e8});}catch(_0xde7c85){logger[_0xbdb4('0x31')](_0xde7c85[_0xbdb4('0x38')]);return _0x1a7422(_0x51796c[_0xbdb4('0x31')](0x1f4,_0xde7c85));}}logger[_0xbdb4('0x31')](_0xbdb4('0x3c'));return _0x1a7422(_0x51796c[_0xbdb4('0x31')](0x1f4,_0xbdb4('0x3c')));});},'AgentCapacity':function(_0xe91127){var _0x13418f=this;return new Promise(function(_0x2097f0,_0x4de379){if(_0x48ca38['agents']['hasOwnProperty'](_0xe91127['id'])){for(var _0x2f3c2d in _0xe91127[_0xbdb4('0x41')]){if(_0xe91127['capacity'][_0xbdb4('0x42')](_0x2f3c2d)){if(_0x48ca38[_0xbdb4('0x3e')][_0xe91127['id']][_0xbdb4('0x42')](_0x2f3c2d+_0xbdb4('0x43'))){_0x48ca38['agents'][_0xe91127['id']][_0x2f3c2d+_0xbdb4('0x43')]=parseInt(_0xe91127[_0xbdb4('0x41')][_0x2f3c2d],0xa);}}}_0x48ca38['agents'][_0xe91127['id']][_0xbdb4('0x44')]();return _0x2097f0({'code':0xc8,'message':_0x48ca38[_0xbdb4('0x3e')][_0xe91127['id']]});}else{return _0x4de379(_0x13418f[_0xbdb4('0x31')](0x1f4,_0xbdb4('0x45')));}});},'Agents':function(_0xb855dd){return new Promise(function(_0x333175,_0xb95f74){var _0x40f113=_[_0xbdb4('0x46')](_0x48ca38['agents']);_0x333175({'count':_0x40f113['length'],'rows':_0x40f113});});},'ChatQueues':function(_0x25d29f){return new Promise(function(_0x3511b2,_0x29d6ce){var _0x4bf92d=[];for(var _0x1cd076 in _0x48ca38[_0xbdb4('0x47')]){if(_0x48ca38['chatQueues'][_0xbdb4('0x42')](_0x1cd076)){var _0x210e10=_0x48ca38[_0xbdb4('0x47')][_0x1cd076];var _0x111f00={'id':_0x210e10['id'],'available':_0x210e10['available'],'loggedIn':_0x210e10[_0xbdb4('0x48')],'name':_0x210e10['name'],'paused':_0x210e10[_0xbdb4('0x49')],'waiting':_0x210e10['waiting']};_0x4bf92d[_0xbdb4('0x23')](_0x111f00);}}_0x3511b2({'count':_0x4bf92d[_0xbdb4('0x1a')],'rows':_0x4bf92d});});},'MailQueues':function(_0x4958ba){return new Promise(function(_0x57782b,_0x566c05){var _0x3efcb1=[];for(var _0x20aed7 in _0x48ca38[_0xbdb4('0x4a')]){if(_0x48ca38[_0xbdb4('0x4a')][_0xbdb4('0x42')](_0x20aed7)){var _0x134214=_0x48ca38['mailQueues'][_0x20aed7];var _0x5ae61f={'id':_0x134214['id'],'available':_0x134214[_0xbdb4('0x4b')],'loggedIn':_0x134214[_0xbdb4('0x48')],'name':_0x134214[_0xbdb4('0x4c')],'paused':_0x134214['paused'],'waiting':_0x134214[_0xbdb4('0x4d')]};_0x3efcb1[_0xbdb4('0x23')](_0x5ae61f);}}_0x57782b({'count':_0x3efcb1[_0xbdb4('0x1a')],'rows':_0x3efcb1});});},'OpenchannelQueues':function(_0x71f044){return new Promise(function(_0x520e0a,_0x8662e5){var _0x840b90=[];for(var _0x5d3b85 in _0x48ca38['openchannelQueues']){if(_0x48ca38['openchannelQueues'][_0xbdb4('0x42')](_0x5d3b85)){var _0x328c74=_0x48ca38[_0xbdb4('0x4e')][_0x5d3b85];var _0x3212d7={'id':_0x328c74['id'],'available':_0x328c74[_0xbdb4('0x4b')],'loggedIn':_0x328c74[_0xbdb4('0x48')],'name':_0x328c74[_0xbdb4('0x4c')],'paused':_0x328c74[_0xbdb4('0x49')],'waiting':_0x328c74[_0xbdb4('0x4d')]};_0x840b90[_0xbdb4('0x23')](_0x3212d7);}}_0x520e0a({'count':_0x840b90[_0xbdb4('0x1a')],'rows':_0x840b90});});},'SmsQueues':function(_0x4d2363){return new Promise(function(_0x1b5166,_0x5ac39c){var _0x385c12=[];for(var _0x4077fa in _0x48ca38['smsQueues']){if(_0x48ca38[_0xbdb4('0x4f')][_0xbdb4('0x42')](_0x4077fa)){var _0x4163f6=_0x48ca38[_0xbdb4('0x4f')][_0x4077fa];var _0x3ea2d5={'id':_0x4163f6['id'],'available':_0x4163f6[_0xbdb4('0x4b')],'loggedIn':_0x4163f6[_0xbdb4('0x48')],'name':_0x4163f6[_0xbdb4('0x4c')],'paused':_0x4163f6[_0xbdb4('0x49')],'waiting':_0x4163f6[_0xbdb4('0x4d')]};_0x385c12[_0xbdb4('0x23')](_0x3ea2d5);}}_0x1b5166({'count':_0x385c12[_0xbdb4('0x1a')],'rows':_0x385c12});});},'FaxQueues':function(_0x27d304){return new Promise(function(_0x2c4607,_0x57fdb2){var _0x5bb625=[];for(var _0x1f9f18 in _0x48ca38['faxQueues']){if(_0x48ca38['faxQueues'][_0xbdb4('0x42')](_0x1f9f18)){var _0xe8e0eb=_0x48ca38[_0xbdb4('0x50')][_0x1f9f18];var _0x420fa6={'id':_0xe8e0eb['id'],'available':_0xe8e0eb['available'],'loggedIn':_0xe8e0eb[_0xbdb4('0x48')],'name':_0xe8e0eb[_0xbdb4('0x4c')],'paused':_0xe8e0eb[_0xbdb4('0x49')],'waiting':_0xe8e0eb[_0xbdb4('0x4d')]};_0x5bb625[_0xbdb4('0x23')](_0x420fa6);}}_0x2c4607({'count':_0x5bb625[_0xbdb4('0x1a')],'rows':_0x5bb625});});},'ChatQueuesWaitingInteractions':function(_0x2ea6bc){return new Promise(function(_0x426b6e,_0x54d94b){var _0x372774=_[_0xbdb4('0x46')](_0x48ca38[_0xbdb4('0x51')]);_0x426b6e({'count':_0x372774['length'],'rows':_0x372774});});},'MailQueuesWaitingInteractions':function(_0x12ee89){return new Promise(function(_0x170621,_0x27b3ca){var _0x467cc5=_[_0xbdb4('0x46')](_0x48ca38[_0xbdb4('0x52')]);_0x170621({'count':_0x467cc5[_0xbdb4('0x1a')],'rows':_0x467cc5});});},'OpenchannelQueuesWaitingInteractions':function(_0x325eb0){return new Promise(function(_0x405ee0,_0x41fc21){var _0x335589=_[_0xbdb4('0x46')](_0x48ca38[_0xbdb4('0x53')]);_0x405ee0({'count':_0x335589['length'],'rows':_0x335589});});},'SmsQueuesWaitingInteractions':function(_0x1021e3){return new Promise(function(_0x5e91b7,_0x3f53fd){var _0x12b1da=_['values'](_0x48ca38[_0xbdb4('0x54')]);_0x5e91b7({'count':_0x12b1da['length'],'rows':_0x12b1da});});},'FaxQueuesWaitingInteractions':function(_0x9b798b){return new Promise(function(_0x4bb109,_0x22c59e){var _0x2f09de=_[_0xbdb4('0x46')](_0x48ca38[_0xbdb4('0x55')]);_0x4bb109({'count':_0x2f09de[_0xbdb4('0x1a')],'rows':_0x2f09de});});}};var _0x1430ea=jayson[_0xbdb4('0x56')](_0x58a281)[_0xbdb4('0x57')]();_0x1430ea['on']('error',function(_0x296170){logger[_0xbdb4('0x31')](JSON[_0xbdb4('0x34')](_0x296170));return _0x101147(_0x296170);});_0x1430ea[_0xbdb4('0x15')](0x232c,_0xbdb4('0x58'),function(){console[_0xbdb4('0x59')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4f7e68(_0xbdb4('0x5a')+0x232c);});});}; \ No newline at end of file +var _0x0bfa=['execute','info','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busyQueue','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','hasOwnProperty','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','appdata','push','slice','split','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under'];(function(_0x3500d1,_0x571280){var _0x5f2b41=function(_0x2c0ffb){while(--_0x2c0ffb){_0x3500d1['push'](_0x3500d1['shift']());}};_0x5f2b41(++_0x571280);}(_0x0bfa,0x13b));var _0xa0bf=function(_0xdf13c9,_0x5da43f){_0xdf13c9=_0xdf13c9-0x0;var _0x302aaa=_0x0bfa[_0xdf13c9];return _0x302aaa;};'use strict';var _=require(_0xa0bf('0x0'));var util=require(_0xa0bf('0x1'));var path=require(_0xa0bf('0x2'));var fs=require('fs');var jayson=require(_0xa0bf('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0xa0bf('0x4'));var logger=require('../../../config/logger')(_0xa0bf('0x5'));var rpc={'openchannelQueueReport':require(_0xa0bf('0x6'))};var rpc={'openchannelQueueReport':require(_0xa0bf('0x6')),'mailQueueReport':require(_0xa0bf('0x7')),'chatQueueReport':require(_0xa0bf('0x8')),'smsQueueReport':require(_0xa0bf('0x9')),'faxQueueReport':require(_0xa0bf('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x29e204,_0x465b47,_0x1e2ac5){return util[_0xa0bf('0xb')](_0xa0bf('0xc'),_0x29e204,_0x465b47||0x0,_0x1e2ac5||0x0);}function getIntervals(_0x443332,_0x400281){var _0x2a59ce=[];if(!_['isNil'](_0x400281[_0xa0bf('0xd')])&&!_[_0xa0bf('0xe')](_0x443332[_0x400281['IntervalId']])&&!_[_0xa0bf('0xe')](_0x443332[_0x400281[_0xa0bf('0xd')]][_0xa0bf('0xf')])){_0x2a59ce=_[_0xa0bf('0x10')](_0x443332[_0x400281[_0xa0bf('0xd')]][_0xa0bf('0xf')],_0xa0bf('0x11'));}else if(!_['isNil'](_0x400281[_0xa0bf('0x11')])){_0x2a59ce=[_0x400281['interval']];}return _0x2a59ce;}exports[_0xa0bf('0x12')]=function(_0x6ea9ee){_0x6ea9ee[_0xa0bf('0x13')]={};return new BPromise(function(_0x2c342d,_0x47bceb){var _0x5a7106={'Start':function(_0x2365dc){var _0x27aa9c=this;return new Promise(function(_0x89cd4f,_0xa5336a){if(_0x2365dc){try{var _0xb329c6=[];var _0x1754cc=getId(_0x2365dc[_0xa0bf('0x14')],_0x2365dc[_0xa0bf('0x15')]?_0x2365dc['message']['id']:0x0,_0x2365dc[_0xa0bf('0x16')]?_0x2365dc['interaction']['id']:0x0);if(_0x2365dc[_0xa0bf('0x17')]&&_['isArray'](_0x2365dc[_0xa0bf('0x17')])&&_0x2365dc[_0xa0bf('0x17')][_0xa0bf('0x18')]){for(var _0x243092=0x0;_0x243092<_0x2365dc[_0xa0bf('0x17')][_0xa0bf('0x18')];_0x243092+=0x1){var _0x3bd2ac=_0x2365dc['applications'][_0x243092];if(fs[_0xa0bf('0x19')](path[_0xa0bf('0x1a')](__dirname,'applications',_0x3bd2ac[_0xa0bf('0x1b')]+_0xa0bf('0x1c')))){var _0x18e4e2=[];switch(_0x3bd2ac['app'][_0xa0bf('0x1d')]()){case'autoreply':var _0x49650e=_0x3bd2ac[_0xa0bf('0x1e')]['split'](',');_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[0x0]);_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[_0xa0bf('0x20')](0x1,_0x49650e[_0xa0bf('0x18')])[_0xa0bf('0x1a')](','));break;case'dialogflow':var _0x49650e=_0x3bd2ac['appdata'][_0xa0bf('0x21')](',');_0x18e4e2['push'](_0x49650e[0x0]);_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[0x1]);_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[_0xa0bf('0x20')](0x2,_0x49650e[_0xa0bf('0x18')])[_0xa0bf('0x1a')](','));break;case _0xa0bf('0x22'):var _0x49650e=_0x3bd2ac[_0xa0bf('0x1e')]['split'](',');_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[0x0]);_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[0x1]);_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[0x2]);_0x18e4e2[_0xa0bf('0x1f')](_0x49650e[0x3]);_0x18e4e2['push'](_0x49650e[_0xa0bf('0x20')](0x4,_0x49650e[_0xa0bf('0x18')])[_0xa0bf('0x1a')](','));break;case _0xa0bf('0x15'):_0x18e4e2[_0xa0bf('0x1f')](_0x3bd2ac[_0xa0bf('0x1e')]);break;case _0xa0bf('0x23'):_0x18e4e2['push'](_0x3bd2ac[_0xa0bf('0x24')]);_0x18e4e2[_0xa0bf('0x1f')](_0x3bd2ac[_0xa0bf('0x1e')]);break;default:_0x18e4e2=_[_0xa0bf('0xe')](_0x3bd2ac[_0xa0bf('0x1e')])?[]:_0x3bd2ac[_0xa0bf('0x1e')]['split'](',');}var _0x15d432={'id':util[_0xa0bf('0xb')](_0xa0bf('0x25'),_0x1754cc,_0x3bd2ac['id'],_0x3bd2ac['app']),'condition':require(_0xa0bf('0x26'))[_0xa0bf('0x27')](_0x1754cc,getIntervals(_0x6ea9ee[_0xa0bf('0x28')],_0x3bd2ac),_0x6ea9ee),'consequence':require(_0xa0bf('0x29')+_0x3bd2ac[_0xa0bf('0x1b')])[_0xa0bf('0x2a')](_0x1754cc,_0x18e4e2,_0x6ea9ee,_0x2365dc),'p':_0x3bd2ac[_0xa0bf('0x2b')]||0x0};logger['info'](_0xa0bf('0x2c'),_0x15d432['id'],_0xa0bf('0x2d'),getIntervals(_0x6ea9ee['intervals'],_0x3bd2ac)[_0xa0bf('0x1a')](_0xa0bf('0x2e')));_0xb329c6[_0xa0bf('0x1f')](_0x15d432);}else{logger[_0xa0bf('0x2f')](_0xa0bf('0x30'),path['join'](__dirname,_0xa0bf('0x17'),_0x3bd2ac[_0xa0bf('0x1b')]+_0xa0bf('0x1c')));}}_0x6ea9ee[_0xa0bf('0x13')][_0x1754cc]=new RuleEngine(_0xb329c6);_0x6ea9ee[_0xa0bf('0x13')][_0x1754cc][_0xa0bf('0x31')](_0x2365dc,function(_0x5cf34f){logger[_0xa0bf('0x32')]('Applications\x20executed',JSON[_0xa0bf('0x33')](_0x5cf34f[_0xa0bf('0x34')]));if(_0x6ea9ee[_0xa0bf('0x13')][_0x1754cc]){_0x6ea9ee['rules'][_0x1754cc][_0xa0bf('0x35')](_0xa0bf('0x36'));}});return _0x89cd4f({'code':0xc8,'message':_0x2365dc});}else{logger[_0xa0bf('0x32')](_0xa0bf('0x37'));return _0x89cd4f({'code':0xc8,'message':_0x2365dc});}}catch(_0x399cfd){logger[_0xa0bf('0x2f')](_0x399cfd[_0xa0bf('0x38')]);return _0xa5336a(_0x27aa9c['error'](0x1f4,_0x399cfd));}}return _0xa5336a(_0xa0bf('0x39'));});},'AcceptMessage':function(_0x4cadc6){var _0x1502a4=this;return new Promise(function(_0x1ae6cd,_0x33e997){if(_0x4cadc6[_0xa0bf('0x15')]&&_0x4cadc6['message']['id']){try{var _0x112781=getId(_0x4cadc6[_0xa0bf('0x14')],_0x4cadc6[_0xa0bf('0x15')]?_0x4cadc6[_0xa0bf('0x15')]['id']:0x0,_0x4cadc6[_0xa0bf('0x16')]?_0x4cadc6[_0xa0bf('0x16')]['id']:0x0);if(_0x6ea9ee[_0xa0bf('0x13')][_0x112781]){_0x6ea9ee[_0xa0bf('0x13')][_0x112781][_0xa0bf('0x35')]('end');if(rpc[_0x4cadc6[_0xa0bf('0x14')]+'QueueReport']){rpc[_0x4cadc6['channel']+_0xa0bf('0x3a')]['update'](_0x112781,{'UserId':_0x4cadc6[_0xa0bf('0x15')]['UserId']})[_0xa0bf('0x3b')](function(_0x558870){logger[_0xa0bf('0x2f')](_0xa0bf('0x3c'));});}}return _0x1ae6cd({'code':0xc8,'message':_0x4cadc6});}catch(_0x4f0e70){logger[_0xa0bf('0x2f')](_0x4f0e70['stack']);return _0x33e997(_0x1502a4['error'](0x1f4,_0x4f0e70));}}logger[_0xa0bf('0x2f')](_0xa0bf('0x3d'));return _0x33e997(_0x1502a4[_0xa0bf('0x2f')](0x1f4,_0xa0bf('0x3d')));});},'RejectMessage':function(_0x4974b0){var _0x5527b8=this;return new Promise(function(_0x19d534,_0x5b3bae){if(_0x4974b0['agent']&&_0x4974b0[_0xa0bf('0x3e')]['id']){try{if(_0x6ea9ee[_0xa0bf('0x3f')][_0x4974b0['agent']['id']]){_0x6ea9ee[_0xa0bf('0x3f')][_0x4974b0[_0xa0bf('0x3e')]['id']]['busy']=![];_0x6ea9ee['agents'][_0x4974b0[_0xa0bf('0x3e')]['id']][_0xa0bf('0x40')]=undefined;}return _0x19d534({'code':0xc8,'message':_0x4974b0});}catch(_0xf4ccb5){logger['error'](_0xf4ccb5['stack']);return _0x5b3bae(_0x5527b8['error'](0x1f4,_0xf4ccb5));}}logger[_0xa0bf('0x2f')]('message\x20is\x20empty');return _0x5b3bae(_0x5527b8[_0xa0bf('0x2f')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x1d55f0){var _0x1c3c58=this;return new Promise(function(_0x31453e,_0x479b86){if(_0x1d55f0[_0xa0bf('0x14')]&&_0x1d55f0['interaction']&&_0x1d55f0['interaction']['id']){try{var _0x59d21f=getId(_0x1d55f0[_0xa0bf('0x14')],_0x1d55f0['message']?_0x1d55f0[_0xa0bf('0x15')]['id']:0x0,_0x1d55f0[_0xa0bf('0x16')]?_0x1d55f0[_0xa0bf('0x16')]['id']:0x0);if(_0x6ea9ee['rules'][_0x59d21f]){_0x6ea9ee['rules'][_0x59d21f][_0xa0bf('0x35')](_0xa0bf('0x36'));}return _0x31453e({'code':0xc8,'message':_0x1d55f0});}catch(_0x1a66bf){logger['error'](_0x1a66bf[_0xa0bf('0x38')]);return _0x479b86(_0x1c3c58[_0xa0bf('0x2f')](0x1f4,_0x1a66bf));}}logger['error'](_0xa0bf('0x3d'));return _0x479b86(_0x1c3c58[_0xa0bf('0x2f')](0x1f4,_0xa0bf('0x3d')));});},'AgentCapacity':function(_0x193c0c){var _0x2621b3=this;return new Promise(function(_0x4d339d,_0x543dfe){if(_0x6ea9ee['agents']['hasOwnProperty'](_0x193c0c['id'])){for(var _0x31ea30 in _0x193c0c[_0xa0bf('0x41')]){if(_0x193c0c[_0xa0bf('0x41')]['hasOwnProperty'](_0x31ea30)){if(_0x6ea9ee['agents'][_0x193c0c['id']]['hasOwnProperty'](_0x31ea30+_0xa0bf('0x42'))){_0x6ea9ee[_0xa0bf('0x3f')][_0x193c0c['id']][_0x31ea30+_0xa0bf('0x42')]=parseInt(_0x193c0c['capacity'][_0x31ea30],0xa);}}}_0x6ea9ee['agents'][_0x193c0c['id']][_0xa0bf('0x43')]();return _0x4d339d({'code':0xc8,'message':_0x6ea9ee[_0xa0bf('0x3f')][_0x193c0c['id']]});}else{return _0x543dfe(_0x2621b3[_0xa0bf('0x2f')](0x1f4,_0xa0bf('0x44')));}});},'Agents':function(_0x4477c3){return new Promise(function(_0xc32bee,_0x330006){var _0x4f77eb=_['values'](_0x6ea9ee[_0xa0bf('0x3f')]);_0xc32bee({'count':_0x4f77eb[_0xa0bf('0x18')],'rows':_0x4f77eb});});},'ChatQueues':function(_0x318954){return new Promise(function(_0x32f372,_0x1b4e1f){var _0x51072b=[];for(var _0x4288ea in _0x6ea9ee[_0xa0bf('0x45')]){if(_0x6ea9ee[_0xa0bf('0x45')][_0xa0bf('0x46')](_0x4288ea)){var _0x4cf9f4=_0x6ea9ee[_0xa0bf('0x45')][_0x4288ea];var _0x360ce4={'id':_0x4cf9f4['id'],'available':_0x4cf9f4[_0xa0bf('0x47')],'loggedIn':_0x4cf9f4[_0xa0bf('0x48')],'name':_0x4cf9f4[_0xa0bf('0x49')],'paused':_0x4cf9f4[_0xa0bf('0x4a')],'waiting':_0x4cf9f4['waiting']};_0x51072b[_0xa0bf('0x1f')](_0x360ce4);}}_0x32f372({'count':_0x51072b[_0xa0bf('0x18')],'rows':_0x51072b});});},'MailQueues':function(_0x82e6de){return new Promise(function(_0x4f6185,_0x44d210){var _0x5e0970=[];for(var _0x1acaa6 in _0x6ea9ee[_0xa0bf('0x4b')]){if(_0x6ea9ee[_0xa0bf('0x4b')][_0xa0bf('0x46')](_0x1acaa6)){var _0x5c40d5=_0x6ea9ee[_0xa0bf('0x4b')][_0x1acaa6];var _0x5b30a0={'id':_0x5c40d5['id'],'available':_0x5c40d5[_0xa0bf('0x47')],'loggedIn':_0x5c40d5[_0xa0bf('0x48')],'name':_0x5c40d5[_0xa0bf('0x49')],'paused':_0x5c40d5[_0xa0bf('0x4a')],'waiting':_0x5c40d5[_0xa0bf('0x4c')]};_0x5e0970[_0xa0bf('0x1f')](_0x5b30a0);}}_0x4f6185({'count':_0x5e0970[_0xa0bf('0x18')],'rows':_0x5e0970});});},'OpenchannelQueues':function(_0x516e4d){return new Promise(function(_0x4bf974,_0x10563c){var _0x2ee33e=[];for(var _0x38faca in _0x6ea9ee['openchannelQueues']){if(_0x6ea9ee[_0xa0bf('0x4d')][_0xa0bf('0x46')](_0x38faca)){var _0x39883f=_0x6ea9ee[_0xa0bf('0x4d')][_0x38faca];var _0x476332={'id':_0x39883f['id'],'available':_0x39883f[_0xa0bf('0x47')],'loggedIn':_0x39883f['loggedIn'],'name':_0x39883f[_0xa0bf('0x49')],'paused':_0x39883f[_0xa0bf('0x4a')],'waiting':_0x39883f[_0xa0bf('0x4c')]};_0x2ee33e['push'](_0x476332);}}_0x4bf974({'count':_0x2ee33e['length'],'rows':_0x2ee33e});});},'SmsQueues':function(_0x3c45e3){return new Promise(function(_0x50ad91,_0xe825d0){var _0x3a4dda=[];for(var _0xa3b880 in _0x6ea9ee[_0xa0bf('0x4e')]){if(_0x6ea9ee['smsQueues']['hasOwnProperty'](_0xa3b880)){var _0x2c4286=_0x6ea9ee[_0xa0bf('0x4e')][_0xa3b880];var _0x25bf62={'id':_0x2c4286['id'],'available':_0x2c4286[_0xa0bf('0x47')],'loggedIn':_0x2c4286[_0xa0bf('0x48')],'name':_0x2c4286['name'],'paused':_0x2c4286[_0xa0bf('0x4a')],'waiting':_0x2c4286[_0xa0bf('0x4c')]};_0x3a4dda[_0xa0bf('0x1f')](_0x25bf62);}}_0x50ad91({'count':_0x3a4dda[_0xa0bf('0x18')],'rows':_0x3a4dda});});},'FaxQueues':function(_0x26a722){return new Promise(function(_0x50505d,_0x5ac3ad){var _0x143e31=[];for(var _0x167f53 in _0x6ea9ee[_0xa0bf('0x4f')]){if(_0x6ea9ee[_0xa0bf('0x4f')][_0xa0bf('0x46')](_0x167f53)){var _0x3f21cc=_0x6ea9ee['faxQueues'][_0x167f53];var _0x473a4a={'id':_0x3f21cc['id'],'available':_0x3f21cc['available'],'loggedIn':_0x3f21cc['loggedIn'],'name':_0x3f21cc[_0xa0bf('0x49')],'paused':_0x3f21cc[_0xa0bf('0x4a')],'waiting':_0x3f21cc[_0xa0bf('0x4c')]};_0x143e31[_0xa0bf('0x1f')](_0x473a4a);}}_0x50505d({'count':_0x143e31[_0xa0bf('0x18')],'rows':_0x143e31});});},'ChatQueuesWaitingInteractions':function(_0x5d82a4){return new Promise(function(_0x1fe31e,_0x3d574b){var _0x174878=_[_0xa0bf('0x50')](_0x6ea9ee[_0xa0bf('0x51')]);_0x1fe31e({'count':_0x174878['length'],'rows':_0x174878});});},'MailQueuesWaitingInteractions':function(_0x2cbbe3){return new Promise(function(_0x1f8275,_0x5cef86){var _0x41dc4f=_[_0xa0bf('0x50')](_0x6ea9ee[_0xa0bf('0x52')]);_0x1f8275({'count':_0x41dc4f[_0xa0bf('0x18')],'rows':_0x41dc4f});});},'OpenchannelQueuesWaitingInteractions':function(_0x5dd9a7){return new Promise(function(_0x1c93b9,_0x9718fe){var _0xb667d4=_['values'](_0x6ea9ee[_0xa0bf('0x53')]);_0x1c93b9({'count':_0xb667d4[_0xa0bf('0x18')],'rows':_0xb667d4});});},'SmsQueuesWaitingInteractions':function(_0xce8d33){return new Promise(function(_0x98baf7,_0x381121){var _0x57431c=_[_0xa0bf('0x50')](_0x6ea9ee[_0xa0bf('0x54')]);_0x98baf7({'count':_0x57431c['length'],'rows':_0x57431c});});},'FaxQueuesWaitingInteractions':function(_0x5649a0){return new Promise(function(_0x3e066e,_0x547b31){var _0x254c25=_[_0xa0bf('0x50')](_0x6ea9ee[_0xa0bf('0x55')]);_0x3e066e({'count':_0x254c25['length'],'rows':_0x254c25});});}};var _0x456c7e=jayson[_0xa0bf('0x56')](_0x5a7106)[_0xa0bf('0x57')]();_0x456c7e['on'](_0xa0bf('0x2f'),function(_0x48ce51){logger[_0xa0bf('0x2f')](JSON[_0xa0bf('0x33')](_0x48ce51));return _0x47bceb(_0x48ce51);});_0x456c7e[_0xa0bf('0x12')](0x232c,_0xa0bf('0x58'),function(){console['log'](_0xa0bf('0x59'),0x232c);return _0x2c342d(_0xa0bf('0x5a')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 5592895..437b060 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 _0x72ca=['error','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','message','catch','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then'];(function(_0x4c2adc,_0x3741a1){var _0x13e846=function(_0x1a1501){while(--_0x1a1501){_0x4c2adc['push'](_0x4c2adc['shift']());}};_0x13e846(++_0x3741a1);}(_0x72ca,0x163));var _0xa72c=function(_0x4c5c02,_0x16bec7){_0x4c5c02=_0x4c5c02-0x0;var _0x4ad0b6=_0x72ca[_0x4c5c02];return _0x4ad0b6;};'use strict';var util=require(_0xa72c('0x0'));var BPromise=require(_0xa72c('0x1'));var jayson=require(_0xa72c('0x2'));var _=require(_0xa72c('0x3'));var logger=require(_0xa72c('0x4'))(_0xa72c('0x5'));var client=jayson[_0xa72c('0x6')]['http']({'port':0x232a});function request(_0x598ce5,_0x4c5bc8){return new BPromise(function(_0x1a3ec7,_0x123db6){return client[_0xa72c('0x7')](_0x598ce5,_0x4c5bc8)[_0xa72c('0x8')](function(_0x37758b){if(_0x37758b[_0xa72c('0x9')]){return _0x123db6(_0x37758b[_0xa72c('0x9')]['message']);}else{return _0x1a3ec7(_0x37758b[_0xa72c('0xa')]);}})['catch'](function(_0x55ce8d){return _0x123db6(_0x55ce8d);});});}exports['condition']=function(_0x1a20b3,_0x340bc4,_0x4a3ac4){return function(_0x1507e0){if(_0x4a3ac4[_0xa72c('0xb')]&&!_0x4a3ac4['rules'][_0x1a20b3]){logger[_0xa72c('0xc')](_0xa72c('0xd'),_0x1a20b3);return _0x1507e0[_0xa72c('0xe')]();}var _0x4fcb00=[];for(var _0x1872f8=0x0;_0x1872f8<_0x340bc4[_0xa72c('0xf')];_0x1872f8+=0x1){_0x4fcb00[_0xa72c('0x10')](request(_0xa72c('0x11'),{'command':util['format'](_0xa72c('0x12'),_0x340bc4[_0x1872f8])})[_0xa72c('0x8')](function(_0x521b73){return _0x521b73&&_0x521b73[_0xa72c('0x13')]&&_0x521b73[_0xa72c('0x13')]['indexOf']('true')>=0x0?!![]:![];})[_0xa72c('0x14')](function(_0x1a10d1){logger['error']('[%s][INTERVAL]\x20%s',_0x1a20b3,_0x340bc4[_0x1872f8]);}));}BPromise[_0xa72c('0x15')](_0x4fcb00)[_0xa72c('0x8')](function(_0x15414b){var _0x193f48=_[_0xa72c('0x16')](_0x15414b);logger[_0xa72c('0xc')](_0xa72c('0x17'),_0x1a20b3,_0x340bc4[_0xa72c('0x18')]('\x20|\x20'),_0x193f48);_0x1507e0[_0xa72c('0x19')](_0x193f48);})[_0xa72c('0x14')](function(_0xe98a35){console[_0xa72c('0x1a')](_0xe98a35);logger[_0xa72c('0x9')](_0xa72c('0x17'),_0x1a20b3,_0x340bc4['join'](_0xa72c('0x1b')),_0xe98a35['stack']);_0x1507e0[_0xa72c('0xe')]();});};}; \ No newline at end of file +var _0xf7d2=['format','iftime\x20%s','then','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0xf7d2,0x1bc));var _0x2f7d=function(_0x9d737b,_0x499dde){_0x9d737b=_0x9d737b-0x0;var _0x3dcef5=_0xf7d2[_0x9d737b];return _0x3dcef5;};'use strict';var util=require(_0x2f7d('0x0'));var BPromise=require(_0x2f7d('0x1'));var jayson=require(_0x2f7d('0x2'));var _=require(_0x2f7d('0x3'));var logger=require(_0x2f7d('0x4'))(_0x2f7d('0x5'));var client=jayson[_0x2f7d('0x6')][_0x2f7d('0x7')]({'port':0x232a});function request(_0x1e9af6,_0x1e481d){return new BPromise(function(_0x455346,_0x2c95ce){return client['request'](_0x1e9af6,_0x1e481d)['then'](function(_0x282551){if(_0x282551[_0x2f7d('0x8')]){return _0x2c95ce(_0x282551['error'][_0x2f7d('0x9')]);}else{return _0x455346(_0x282551[_0x2f7d('0xa')]);}})['catch'](function(_0x3eb2e2){return _0x2c95ce(_0x3eb2e2);});});}exports['condition']=function(_0x16abab,_0x5d0e03,_0x596121){return function(_0x3dd5b1){if(_0x596121[_0x2f7d('0xb')]&&!_0x596121[_0x2f7d('0xb')][_0x16abab]){logger[_0x2f7d('0xc')](_0x2f7d('0xd'),_0x16abab);return _0x3dd5b1[_0x2f7d('0xe')]();}var _0x17856c=[];for(var _0x54d49b=0x0;_0x54d49b<_0x5d0e03[_0x2f7d('0xf')];_0x54d49b+=0x1){_0x17856c[_0x2f7d('0x10')](request(_0x2f7d('0x11'),{'command':util[_0x2f7d('0x12')](_0x2f7d('0x13'),_0x5d0e03[_0x54d49b])})[_0x2f7d('0x14')](function(_0x168b92){return _0x168b92&&_0x168b92[_0x2f7d('0x9')]&&_0x168b92[_0x2f7d('0x9')][_0x2f7d('0x15')](_0x2f7d('0x16'))>=0x0?!![]:![];})[_0x2f7d('0x17')](function(_0x384417){logger[_0x2f7d('0x8')](_0x2f7d('0x18'),_0x16abab,_0x5d0e03[_0x54d49b]);}));}BPromise[_0x2f7d('0x19')](_0x17856c)[_0x2f7d('0x14')](function(_0x388817){var _0x403e15=_[_0x2f7d('0x1a')](_0x388817);logger[_0x2f7d('0xc')](_0x2f7d('0x1b'),_0x16abab,_0x5d0e03[_0x2f7d('0x1c')](_0x2f7d('0x1d')),_0x403e15);_0x3dd5b1[_0x2f7d('0x1e')](_0x403e15);})['catch'](function(_0x204b24){console[_0x2f7d('0x1f')](_0x204b24);logger[_0x2f7d('0x8')](_0x2f7d('0x1b'),_0x16abab,_0x5d0e03[_0x2f7d('0x1c')](_0x2f7d('0x1d')),_0x204b24[_0x2f7d('0x20')]);_0x3dd5b1[_0x2f7d('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ef583d8..d12fd4f 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 _0x0bf4=['format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','membername','interface','connectedlinenum','lastevent','queue','then','type','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','agentringnoanswerAt','rejected','reason','holdtime','ringtime','stack','queuecallerabandon','forIn','abandoned','talktime','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','diffTime','agentcompleteAt','complete','isNil','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','origtransfereruniqueid','secondtransfererexten','transfertargetuniqueid','clone','agent','lodash','util','./utils'];(function(_0x7d400a,_0x542462){var _0x4115cd=function(_0x15a43f){while(--_0x15a43f){_0x7d400a['push'](_0x7d400a['shift']());}};_0x4115cd(++_0x542462);}(_0x0bf4,0x189));var _0x40bf=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0x0bf4[_0x2c3a8f];return _0x189412;};'use strict';var _=require(_0x40bf('0x0'));var util=require(_0x40bf('0x1'));var utils=require(_0x40bf('0x2'));var agents={};var transfers={};function writeDB(_0x3d4464,_0x1e1a9a){utils['info'](util[_0x40bf('0x3')](_0x40bf('0x4'),_0x3d4464['uniqueid'],_0x3d4464[_0x40bf('0x5')],_0x3d4464['queue'],_0x3d4464[_0x40bf('0x6')],_0x3d4464[_0x40bf('0x7')],_0x3d4464['calleridnum'],_0x3d4464[_0x40bf('0x8')],_0x3d4464[_0x40bf('0x9')]));if(_0x3d4464[_0x40bf('0xa')]){utils['getVoiceQueueByName'](_0x3d4464[_0x40bf('0xa')])[_0x40bf('0xb')](function(_0x15345e){if(_0x15345e){_0x3d4464[_0x40bf('0xc')]=_0x15345e['type'];_0x3d4464['agentacw']=_0x3d4464[_0x40bf('0xd')]?_0x15345e['acw']:![];_0x3d4464[_0x40bf('0xe')]=_0x3d4464['agentacw']?_0x15345e[_0x40bf('0xf')]:0x0;}utils[_0x40bf('0x10')](_0x40bf('0x11'),_0x3d4464);});}else{utils[_0x40bf('0x10')](_0x40bf('0x11'),_0x3d4464);}if(_0x1e1a9a){delete transfers[_0x3d4464[_0x40bf('0x12')]];}else{delete agents[_0x3d4464[_0x40bf('0x13')]];}}exports[_0x40bf('0x14')]=function(_0x18d529){try{agents[_0x18d529['destuniqueid']]=_0x18d529;agents[_0x18d529['destuniqueid']][_0x40bf('0x15')]=utils[_0x40bf('0x16')]();agents[_0x18d529[_0x40bf('0x13')]][_0x40bf('0x9')]=_0x40bf('0x17');agents[_0x18d529[_0x40bf('0x13')]][_0x40bf('0x8')]=null;agents[_0x18d529[_0x40bf('0x13')]][_0x40bf('0x18')]=null;}catch(_0x1b4b9e){utils[_0x40bf('0x19')](_0x1b4b9e['stack']);}};exports[_0x40bf('0x1a')]=function(_0x4c87ea){try{if(!_['isNil'](agents[_0x4c87ea[_0x40bf('0x13')]])){agents[_0x4c87ea[_0x40bf('0x13')]]['agentringnoanswer']=!![];agents[_0x4c87ea[_0x40bf('0x13')]][_0x40bf('0x1b')]=utils[_0x40bf('0x16')]();agents[_0x4c87ea[_0x40bf('0x13')]][_0x40bf('0x9')]=_0x40bf('0x1c');agents[_0x4c87ea['destuniqueid']][_0x40bf('0x1d')]='rejected';agents[_0x4c87ea[_0x40bf('0x13')]][_0x40bf('0x1e')]=_0x4c87ea[_0x40bf('0x1f')]?parseInt(_0x4c87ea['ringtime'])/0x3e8:0x0;agents[_0x4c87ea[_0x40bf('0x13')]]['talktime']=0x0;writeDB(agents[_0x4c87ea[_0x40bf('0x13')]]);}}catch(_0x556f6f){utils[_0x40bf('0x19')](_0x556f6f[_0x40bf('0x20')]);}};exports[_0x40bf('0x21')]=function(_0x4c1ae9){try{_[_0x40bf('0x22')](agents,function(_0x3db811,_0x3820c8){if(_0x3db811['uniqueid']==_0x4c1ae9[_0x40bf('0x12')]){_0x3db811[_0x40bf('0x1a')]=!![];_0x3db811[_0x40bf('0x1b')]=utils[_0x40bf('0x16')]();_0x3db811['lastevent']=_0x40bf('0x23');_0x3db811[_0x40bf('0x1d')]=_0x40bf('0x23');_0x3db811['holdtime']=_0x4c1ae9[_0x40bf('0x1e')];_0x3db811[_0x40bf('0x24')]=0x0;writeDB(_0x3db811);}});}catch(_0x586fd0){utils[_0x40bf('0x19')](_0x586fd0[_0x40bf('0x20')]);}};exports['agentconnect']=function(_0x1916fa){try{if(agents[_0x1916fa[_0x40bf('0x13')]]){agents[_0x1916fa[_0x40bf('0x13')]][_0x40bf('0x25')]=utils['now']();agents[_0x1916fa[_0x40bf('0x13')]]['connectedlinenum']=_0x1916fa[_0x40bf('0x8')];agents[_0x1916fa['destuniqueid']][_0x40bf('0x18')]=_0x1916fa[_0x40bf('0x18')];agents[_0x1916fa['destuniqueid']][_0x40bf('0x1e')]=_0x1916fa[_0x40bf('0x1f')];agents[_0x1916fa[_0x40bf('0x13')]]['lastevent']='connect';_[_0x40bf('0x22')](agents,function(_0x2f20e1,_0x4988e9){if(_0x2f20e1['destuniqueid']!=_0x1916fa[_0x40bf('0x13')]&&_0x2f20e1['uniqueid']==_0x1916fa[_0x40bf('0x12')]){_0x2f20e1[_0x40bf('0x24')]=0x0;_0x2f20e1[_0x40bf('0x1e')]=_0x1916fa[_0x40bf('0x1f')];_0x2f20e1[_0x40bf('0x1a')]=!![];_0x2f20e1['agentringnoanswerAt']=utils[_0x40bf('0x16')]();_0x2f20e1[_0x40bf('0x9')]=_0x40bf('0x26');_0x2f20e1['reason']='answered_elsewhere';_0x2f20e1[_0x40bf('0x27')]=_0x1916fa[_0x40bf('0x13')];_0x2f20e1['answeredelsewheremembername']=_0x1916fa['membername'];writeDB(_0x2f20e1);}});}}catch(_0x220941){utils['error'](_0x220941[_0x40bf('0x20')]);}};exports['agentcomplete']=function(_0x5d31ef){try{if(!_['isNil'](agents[_0x5d31ef[_0x40bf('0x13')]])){agents[_0x5d31ef['destuniqueid']][_0x40bf('0xd')]=!![];agents[_0x5d31ef['destuniqueid']]['agentcompleteAt']=utils[_0x40bf('0x16')]();agents[_0x5d31ef[_0x40bf('0x13')]][_0x40bf('0x24')]=utils[_0x40bf('0x28')](agents[_0x5d31ef[_0x40bf('0x13')]][_0x40bf('0x29')],agents[_0x5d31ef[_0x40bf('0x13')]][_0x40bf('0x25')]);agents[_0x5d31ef[_0x40bf('0x13')]][_0x40bf('0x1d')]=_0x5d31ef[_0x40bf('0x1d')];agents[_0x5d31ef['destuniqueid']][_0x40bf('0x9')]=_0x40bf('0x2a');writeDB(agents[_0x5d31ef[_0x40bf('0x13')]]);}}catch(_0x596a56){utils[_0x40bf('0x19')](_0x596a56[_0x40bf('0x20')]);}};exports['blindtransfer']=function(_0x547308){try{if(!_[_0x40bf('0x2b')](agents[_0x547308['transfereruniqueid']])){agents[_0x547308[_0x40bf('0x2c')]][_0x40bf('0x2d')]=!![];agents[_0x547308['transfereruniqueid']][_0x40bf('0x2e')]=_0x40bf('0x2f');agents[_0x547308[_0x40bf('0x2c')]][_0x40bf('0x30')]=_0x547308[_0x40bf('0x31')];agents[_0x547308[_0x40bf('0x2c')]]['transferuniqueid']=agents[_0x547308[_0x40bf('0x2c')]][_0x40bf('0x12')];}}catch(_0x5b229a){utils[_0x40bf('0x19')](_0x5b229a[_0x40bf('0x20')]);}};exports[_0x40bf('0x32')]=function(_0x3cf364){try{if(_0x3cf364['origtransfereruniqueid']==_0x3cf364[_0x40bf('0x33')]){if(!_[_0x40bf('0x2b')](agents[_0x3cf364['secondtransfereruniqueid']])){agents[_0x3cf364[_0x40bf('0x34')]][_0x40bf('0x2d')]=!![];agents[_0x3cf364[_0x40bf('0x34')]][_0x40bf('0x2e')]=_0x40bf('0x35');agents[_0x3cf364[_0x40bf('0x34')]][_0x40bf('0x30')]=_0x3cf364[_0x40bf('0x36')];agents[_0x3cf364[_0x40bf('0x34')]][_0x40bf('0x37')]=_0x3cf364['origtransfereruniqueid'];}if(_0x3cf364['transfereeuniqueid']&&agents[_0x3cf364[_0x40bf('0x38')]]){agents[_0x3cf364[_0x40bf('0x38')]][_0x40bf('0x39')]=0x1;transfers[_0x3cf364['transfereeuniqueid']]=_['clone'](agents[_0x3cf364[_0x40bf('0x38')]]);transfers[_0x3cf364['transfereeuniqueid']][_0x40bf('0x3a')]=agents[_0x3cf364[_0x40bf('0x34')]][_0x40bf('0x3a')];transfers[_0x3cf364['transfereeuniqueid']]['calleridname']=agents[_0x3cf364[_0x40bf('0x34')]][_0x40bf('0x3b')];transfers[_0x3cf364[_0x40bf('0x38')]][_0x40bf('0x15')]=utils['now']();transfers[_0x3cf364[_0x40bf('0x38')]][_0x40bf('0x25')]=utils[_0x40bf('0x16')]();transfers[_0x3cf364[_0x40bf('0x38')]][_0x40bf('0x1e')]=0x0;transfers[_0x3cf364[_0x40bf('0x38')]][_0x40bf('0x39')]=0x2;}}else if(_0x3cf364[_0x40bf('0x34')]==_0x3cf364[_0x40bf('0x3c')]){if(!_['isNil'](agents[_0x3cf364[_0x40bf('0x3d')]])){agents[_0x3cf364['origtransfereruniqueid']]['transfer']=!![];agents[_0x3cf364[_0x40bf('0x3d')]][_0x40bf('0x2e')]=_0x40bf('0x35');agents[_0x3cf364[_0x40bf('0x3d')]]['transferexten']=_0x3cf364[_0x40bf('0x3e')];agents[_0x3cf364[_0x40bf('0x3d')]][_0x40bf('0x37')]=_0x3cf364['secondtransfereruniqueid'];}if(_0x3cf364['transfertargetuniqueid']&&agents[_0x3cf364[_0x40bf('0x3f')]]){agents[_0x3cf364[_0x40bf('0x3f')]]['agententerreason']=0x1;transfers[_0x3cf364[_0x40bf('0x3f')]]=_[_0x40bf('0x40')](agents[_0x3cf364[_0x40bf('0x3f')]]);transfers[_0x3cf364['transfertargetuniqueid']][_0x40bf('0x3a')]=agents[_0x3cf364['origtransfereruniqueid']][_0x40bf('0x3a')];transfers[_0x3cf364[_0x40bf('0x3f')]]['calleridname']=agents[_0x3cf364[_0x40bf('0x3d')]][_0x40bf('0x3b')];transfers[_0x3cf364[_0x40bf('0x3f')]][_0x40bf('0x15')]=utils[_0x40bf('0x16')]();transfers[_0x3cf364[_0x40bf('0x3f')]][_0x40bf('0x25')]=utils[_0x40bf('0x16')]();transfers[_0x3cf364[_0x40bf('0x3f')]][_0x40bf('0x1e')]=0x0;transfers[_0x3cf364[_0x40bf('0x3f')]]['agententerreason']=0x2;}}}catch(_0x535c2c){utils['error'](_0x535c2c['stack']);}};exports['hangup']=function(_0x1cf292){try{if(transfers[_0x1cf292[_0x40bf('0x12')]]){transfers[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0xd')]=!![];transfers[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x29')]=utils[_0x40bf('0x16')]();transfers[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x24')]=utils[_0x40bf('0x28')](transfers[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x29')],transfers[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x25')]);transfers[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x1d')]=_0x40bf('0x41');transfers[_0x1cf292['uniqueid']][_0x40bf('0x9')]='complete';writeDB(transfers[_0x1cf292['uniqueid']],!![]);}if(agents[_0x1cf292[_0x40bf('0x12')]]&&agents[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x25')]){agents[_0x1cf292[_0x40bf('0x12')]]['agentcomplete']=!![];agents[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x29')]=utils[_0x40bf('0x16')]();agents[_0x1cf292['uniqueid']][_0x40bf('0x24')]=utils[_0x40bf('0x28')](agents[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x29')],agents[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x25')]);agents[_0x1cf292[_0x40bf('0x12')]]['reason']=agents[_0x1cf292['uniqueid']][_0x40bf('0x2d')]?'transfer':_0x40bf('0x41');agents[_0x1cf292[_0x40bf('0x12')]][_0x40bf('0x9')]=_0x40bf('0x2a');writeDB(agents[_0x1cf292[_0x40bf('0x12')]]);}}catch(_0x4c52ea){utils[_0x40bf('0x19')](_0x4c52ea[_0x40bf('0x20')]);}}; \ No newline at end of file +var _0x5207=['rejected','holdtime','ringtime','queuecallerabandon','forIn','agentringnoanswer','agentringnoanswerAt','abandoned','error','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','talktime','agentcompleteAt','reason','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','diffTime','agent','complete','lodash','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','membername','interface','connectedlinenum','queue','getVoiceQueueByName','then','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','now','lastevent','connectedlinename','stack','isNil'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0x5207,0x18f));var _0x7520=function(_0x17657e,_0x4235f7){_0x17657e=_0x17657e-0x0;var _0x37163d=_0x5207[_0x17657e];return _0x37163d;};'use strict';var _=require(_0x7520('0x0'));var util=require('util');var utils=require(_0x7520('0x1'));var agents={};var transfers={};function writeDB(_0x42c8af,_0x242b6e){utils[_0x7520('0x2')](util[_0x7520('0x3')](_0x7520('0x4'),_0x42c8af[_0x7520('0x5')],_0x42c8af[_0x7520('0x6')],_0x42c8af['queue'],_0x42c8af[_0x7520('0x7')],_0x42c8af[_0x7520('0x8')],_0x42c8af['calleridnum'],_0x42c8af[_0x7520('0x9')],_0x42c8af['lastevent']));if(_0x42c8af[_0x7520('0xa')]){utils[_0x7520('0xb')](_0x42c8af['queue'])[_0x7520('0xc')](function(_0x27cc05){if(_0x27cc05){_0x42c8af[_0x7520('0xd')]=_0x27cc05['type'];_0x42c8af['agentacw']=_0x42c8af[_0x7520('0xe')]?_0x27cc05['acw']:![];_0x42c8af[_0x7520('0xf')]=_0x42c8af[_0x7520('0x10')]?_0x27cc05[_0x7520('0x11')]:0x0;}utils[_0x7520('0x12')](_0x7520('0x13'),_0x42c8af);});}else{utils[_0x7520('0x12')]('CreateVoiceAgentReport',_0x42c8af);}if(_0x242b6e){delete transfers[_0x42c8af[_0x7520('0x5')]];}else{delete agents[_0x42c8af[_0x7520('0x14')]];}}exports[_0x7520('0x15')]=function(_0x1b0c37){try{agents[_0x1b0c37[_0x7520('0x14')]]=_0x1b0c37;agents[_0x1b0c37[_0x7520('0x14')]]['agentcalledAt']=utils[_0x7520('0x16')]();agents[_0x1b0c37[_0x7520('0x14')]][_0x7520('0x17')]='called';agents[_0x1b0c37[_0x7520('0x14')]][_0x7520('0x9')]=null;agents[_0x1b0c37[_0x7520('0x14')]][_0x7520('0x18')]=null;}catch(_0x5b2095){utils['error'](_0x5b2095[_0x7520('0x19')]);}};exports['agentringnoanswer']=function(_0x36de6d){try{if(!_[_0x7520('0x1a')](agents[_0x36de6d[_0x7520('0x14')]])){agents[_0x36de6d[_0x7520('0x14')]]['agentringnoanswer']=!![];agents[_0x36de6d[_0x7520('0x14')]]['agentringnoanswerAt']=utils[_0x7520('0x16')]();agents[_0x36de6d[_0x7520('0x14')]]['lastevent']='rejected';agents[_0x36de6d[_0x7520('0x14')]]['reason']=_0x7520('0x1b');agents[_0x36de6d['destuniqueid']][_0x7520('0x1c')]=_0x36de6d['ringtime']?parseInt(_0x36de6d[_0x7520('0x1d')])/0x3e8:0x0;agents[_0x36de6d[_0x7520('0x14')]]['talktime']=0x0;writeDB(agents[_0x36de6d['destuniqueid']]);}}catch(_0x3d381a){utils['error'](_0x3d381a[_0x7520('0x19')]);}};exports[_0x7520('0x1e')]=function(_0x2f6b48){try{_[_0x7520('0x1f')](agents,function(_0x49b10e,_0x20ddb){if(_0x49b10e[_0x7520('0x5')]==_0x2f6b48[_0x7520('0x5')]){_0x49b10e[_0x7520('0x20')]=!![];_0x49b10e[_0x7520('0x21')]=utils[_0x7520('0x16')]();_0x49b10e[_0x7520('0x17')]='abandoned';_0x49b10e['reason']=_0x7520('0x22');_0x49b10e[_0x7520('0x1c')]=_0x2f6b48['holdtime'];_0x49b10e['talktime']=0x0;writeDB(_0x49b10e);}});}catch(_0x188596){utils[_0x7520('0x23')](_0x188596[_0x7520('0x19')]);}};exports[_0x7520('0x24')]=function(_0x4bc4ef){try{if(agents[_0x4bc4ef[_0x7520('0x14')]]){agents[_0x4bc4ef[_0x7520('0x14')]][_0x7520('0x25')]=utils[_0x7520('0x16')]();agents[_0x4bc4ef[_0x7520('0x14')]][_0x7520('0x9')]=_0x4bc4ef[_0x7520('0x9')];agents[_0x4bc4ef[_0x7520('0x14')]][_0x7520('0x18')]=_0x4bc4ef[_0x7520('0x18')];agents[_0x4bc4ef['destuniqueid']][_0x7520('0x1c')]=_0x4bc4ef[_0x7520('0x1d')];agents[_0x4bc4ef[_0x7520('0x14')]][_0x7520('0x17')]=_0x7520('0x26');_[_0x7520('0x1f')](agents,function(_0x3cbd04,_0x3ee37a){if(_0x3cbd04['destuniqueid']!=_0x4bc4ef[_0x7520('0x14')]&&_0x3cbd04['uniqueid']==_0x4bc4ef[_0x7520('0x5')]){_0x3cbd04['talktime']=0x0;_0x3cbd04['holdtime']=_0x4bc4ef[_0x7520('0x1d')];_0x3cbd04[_0x7520('0x20')]=!![];_0x3cbd04[_0x7520('0x21')]=utils[_0x7520('0x16')]();_0x3cbd04[_0x7520('0x17')]=_0x7520('0x27');_0x3cbd04['reason']=_0x7520('0x27');_0x3cbd04[_0x7520('0x28')]=_0x4bc4ef[_0x7520('0x14')];_0x3cbd04[_0x7520('0x29')]=_0x4bc4ef[_0x7520('0x7')];writeDB(_0x3cbd04);}});}}catch(_0xbd807b){utils['error'](_0xbd807b[_0x7520('0x19')]);}};exports['agentcomplete']=function(_0x1b20b5){try{if(!_['isNil'](agents[_0x1b20b5[_0x7520('0x14')]])){agents[_0x1b20b5[_0x7520('0x14')]][_0x7520('0xe')]=!![];agents[_0x1b20b5['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x1b20b5[_0x7520('0x14')]][_0x7520('0x2a')]=utils['diffTime'](agents[_0x1b20b5[_0x7520('0x14')]][_0x7520('0x2b')],agents[_0x1b20b5[_0x7520('0x14')]][_0x7520('0x25')]);agents[_0x1b20b5[_0x7520('0x14')]][_0x7520('0x2c')]=_0x1b20b5[_0x7520('0x2c')];agents[_0x1b20b5[_0x7520('0x14')]][_0x7520('0x17')]='complete';writeDB(agents[_0x1b20b5[_0x7520('0x14')]]);}}catch(_0x5dc92e){utils[_0x7520('0x23')](_0x5dc92e[_0x7520('0x19')]);}};exports[_0x7520('0x2d')]=function(_0x524a93){try{if(!_[_0x7520('0x1a')](agents[_0x524a93[_0x7520('0x2e')]])){agents[_0x524a93['transfereruniqueid']][_0x7520('0x2f')]=!![];agents[_0x524a93[_0x7520('0x2e')]][_0x7520('0x30')]=_0x7520('0x31');agents[_0x524a93[_0x7520('0x2e')]][_0x7520('0x32')]=_0x524a93[_0x7520('0x33')];agents[_0x524a93[_0x7520('0x2e')]][_0x7520('0x34')]=agents[_0x524a93[_0x7520('0x2e')]][_0x7520('0x5')];}}catch(_0x25c6f1){utils['error'](_0x25c6f1[_0x7520('0x19')]);}};exports[_0x7520('0x35')]=function(_0x38818d){try{if(_0x38818d[_0x7520('0x36')]==_0x38818d[_0x7520('0x37')]){if(!_[_0x7520('0x1a')](agents[_0x38818d['secondtransfereruniqueid']])){agents[_0x38818d['secondtransfereruniqueid']][_0x7520('0x2f')]=!![];agents[_0x38818d[_0x7520('0x38')]][_0x7520('0x30')]=_0x7520('0x39');agents[_0x38818d[_0x7520('0x38')]]['transferexten']=_0x38818d[_0x7520('0x3a')];agents[_0x38818d[_0x7520('0x38')]][_0x7520('0x34')]=_0x38818d[_0x7520('0x36')];}if(_0x38818d['transfereeuniqueid']&&agents[_0x38818d['transfereeuniqueid']]){agents[_0x38818d[_0x7520('0x3b')]][_0x7520('0x3c')]=0x1;transfers[_0x38818d[_0x7520('0x3b')]]=_[_0x7520('0x3d')](agents[_0x38818d[_0x7520('0x3b')]]);transfers[_0x38818d[_0x7520('0x3b')]][_0x7520('0x3e')]=agents[_0x38818d[_0x7520('0x38')]][_0x7520('0x3e')];transfers[_0x38818d[_0x7520('0x3b')]][_0x7520('0x3f')]=agents[_0x38818d[_0x7520('0x38')]][_0x7520('0x3f')];transfers[_0x38818d[_0x7520('0x3b')]]['agentcalledAt']=utils[_0x7520('0x16')]();transfers[_0x38818d[_0x7520('0x3b')]][_0x7520('0x25')]=utils[_0x7520('0x16')]();transfers[_0x38818d[_0x7520('0x3b')]]['holdtime']=0x0;transfers[_0x38818d['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x38818d[_0x7520('0x38')]==_0x38818d[_0x7520('0x40')]){if(!_['isNil'](agents[_0x38818d[_0x7520('0x36')]])){agents[_0x38818d['origtransfereruniqueid']][_0x7520('0x2f')]=!![];agents[_0x38818d[_0x7520('0x36')]][_0x7520('0x30')]=_0x7520('0x39');agents[_0x38818d[_0x7520('0x36')]][_0x7520('0x32')]=_0x38818d[_0x7520('0x41')];agents[_0x38818d[_0x7520('0x36')]][_0x7520('0x34')]=_0x38818d[_0x7520('0x38')];}if(_0x38818d[_0x7520('0x42')]&&agents[_0x38818d['transfertargetuniqueid']]){agents[_0x38818d['transfertargetuniqueid']][_0x7520('0x3c')]=0x1;transfers[_0x38818d[_0x7520('0x42')]]=_[_0x7520('0x3d')](agents[_0x38818d['transfertargetuniqueid']]);transfers[_0x38818d[_0x7520('0x42')]]['calleridnum']=agents[_0x38818d[_0x7520('0x36')]][_0x7520('0x3e')];transfers[_0x38818d[_0x7520('0x42')]][_0x7520('0x3f')]=agents[_0x38818d[_0x7520('0x36')]]['calleridname'];transfers[_0x38818d[_0x7520('0x42')]]['agentcalledAt']=utils[_0x7520('0x16')]();transfers[_0x38818d[_0x7520('0x42')]][_0x7520('0x25')]=utils[_0x7520('0x16')]();transfers[_0x38818d[_0x7520('0x42')]][_0x7520('0x1c')]=0x0;transfers[_0x38818d['transfertargetuniqueid']][_0x7520('0x3c')]=0x2;}}}catch(_0x1a797f){utils['error'](_0x1a797f[_0x7520('0x19')]);}};exports[_0x7520('0x43')]=function(_0x5c86cb){try{if(transfers[_0x5c86cb[_0x7520('0x5')]]){transfers[_0x5c86cb[_0x7520('0x5')]][_0x7520('0xe')]=!![];transfers[_0x5c86cb['uniqueid']][_0x7520('0x2b')]=utils['now']();transfers[_0x5c86cb[_0x7520('0x5')]][_0x7520('0x2a')]=utils[_0x7520('0x44')](transfers[_0x5c86cb[_0x7520('0x5')]][_0x7520('0x2b')],transfers[_0x5c86cb[_0x7520('0x5')]][_0x7520('0x25')]);transfers[_0x5c86cb[_0x7520('0x5')]]['reason']=_0x7520('0x45');transfers[_0x5c86cb['uniqueid']]['lastevent']=_0x7520('0x46');writeDB(transfers[_0x5c86cb[_0x7520('0x5')]],!![]);}if(agents[_0x5c86cb[_0x7520('0x5')]]&&agents[_0x5c86cb[_0x7520('0x5')]][_0x7520('0x25')]){agents[_0x5c86cb[_0x7520('0x5')]][_0x7520('0xe')]=!![];agents[_0x5c86cb['uniqueid']][_0x7520('0x2b')]=utils[_0x7520('0x16')]();agents[_0x5c86cb[_0x7520('0x5')]]['talktime']=utils[_0x7520('0x44')](agents[_0x5c86cb[_0x7520('0x5')]][_0x7520('0x2b')],agents[_0x5c86cb['uniqueid']][_0x7520('0x25')]);agents[_0x5c86cb['uniqueid']][_0x7520('0x2c')]=agents[_0x5c86cb['uniqueid']][_0x7520('0x2f')]?_0x7520('0x2f'):_0x7520('0x45');agents[_0x5c86cb[_0x7520('0x5')]][_0x7520('0x17')]='complete';writeDB(agents[_0x5c86cb['uniqueid']]);}}catch(_0xf815ae){utils[_0x7520('0x23')](_0xf815ae['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7276f7a..c2209d6 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 _0x2142=['xmd-queue','Queue','queue','xmd-contactid','ContactId','xmd-cdrtype','type','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','split','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','destination','callerid','disposition','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','channelstate','systemanswertime','isNil','transfer','destinationchannel','answertime','toNumber','hangup','calleridname','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstop','musiconholdstartAt','mohtime','varset','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid'];(function(_0x546f24,_0x485e39){var _0x6c3dac=function(_0x5ee073){while(--_0x5ee073){_0x546f24['push'](_0x546f24['shift']());}};_0x6c3dac(++_0x485e39);}(_0x2142,0x68));var _0x2214=function(_0x375e6,_0x2648f7){_0x375e6=_0x375e6-0x0;var _0xa290d8=_0x2142[_0x375e6];return _0xa290d8;};'use strict';var _=require(_0x2214('0x0'));var util=require(_0x2214('0x1'));var utils=require(_0x2214('0x2'));var dispositions=[_0x2214('0x3'),_0x2214('0x4'),'FAILED',_0x2214('0x3'),_0x2214('0x3'),_0x2214('0x3'),_0x2214('0x5'),_0x2214('0x6'),_0x2214('0x4'),'FAILED',_0x2214('0x4')];var channels={};function writeDB(_0x5de513){utils['info'](util['format'](_0x2214('0x7'),_0x5de513[_0x2214('0x8')],_0x5de513[_0x2214('0x9')],_0x5de513['type'],_0x5de513[_0x2214('0xa')],_0x5de513[_0x2214('0xb')],_0x5de513[_0x2214('0xc')],_0x5de513[_0x2214('0xd')],_0x5de513[_0x2214('0xe')]));if(_0x5de513[_0x2214('0xa')]){utils['getUserByInternal'](_0x5de513[_0x2214('0xa')])['then'](function(_0x33a987){if(_0x33a987){_0x5de513[_0x2214('0xf')]=_0x33a987['id'];}utils[_0x2214('0x10')](_0x2214('0x11'),_0x5de513);});}else{utils[_0x2214('0x10')](_0x2214('0x11'),_0x5de513);}if(channels[_0x5de513[_0x2214('0x8')]]){delete channels[_0x5de513['uniqueid']];}}exports[_0x2214('0x12')]=function(_0x477239){try{if(_0x477239[_0x2214('0x8')]==_0x477239[_0x2214('0x13')]&&_0x477239['channel']!=_0x2214('0x14')){channels[_0x477239[_0x2214('0x8')]]={'uniqueid':_0x477239['uniqueid'],'accountcode':_0x477239[_0x2214('0xa')],'source':_0x477239[_0x2214('0x15')],'destination':_0x477239[_0x2214('0x16')],'destinationcontext':_0x477239[_0x2214('0x17')],'channel':_0x477239['channel'],'starttime':utils[_0x2214('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2214('0x3'),'amaflags':_0x2214('0x19')};}}catch(_0x4dd648){utils[_0x2214('0x1a')](_0x4dd648[_0x2214('0x1b')]);}};exports['newstate']=function(_0x430a1c){try{if(!_['isNil'](channels[_0x430a1c['uniqueid']])&&_0x430a1c[_0x2214('0x1c')]==0x6){if(_['isNil'](channels[_0x430a1c[_0x2214('0x8')]][_0x2214('0x1d')])){channels[_0x430a1c[_0x2214('0x8')]][_0x2214('0x1d')]=utils[_0x2214('0x18')]();}}else if(!_[_0x2214('0x1e')](channels[_0x430a1c['linkedid']])&&_0x430a1c['channelstate']==0x6&&_0x430a1c[_0x2214('0x17')]!=_0x2214('0x1f')){channels[_0x430a1c[_0x2214('0x13')]][_0x2214('0xa')]=_0x430a1c[_0x2214('0xa')];channels[_0x430a1c[_0x2214('0x13')]][_0x2214('0x20')]=_0x430a1c['channel'];if(_[_0x2214('0x1e')](channels[_0x430a1c[_0x2214('0x13')]][_0x2214('0x21')])){channels[_0x430a1c[_0x2214('0x13')]][_0x2214('0x21')]=utils[_0x2214('0x18')]();}channels[_0x430a1c[_0x2214('0x13')]][_0x2214('0xe')]=dispositions[_[_0x2214('0x22')](_0x430a1c[_0x2214('0x1c')])]||_0x2214('0x5');}}catch(_0x55f73c){utils[_0x2214('0x1a')](_0x55f73c['stack']);}};exports[_0x2214('0x23')]=function(_0x15d76f){try{if(!_[_0x2214('0x1e')](channels[_0x15d76f[_0x2214('0x8')]])){if(_[_0x2214('0x1e')](channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0xd')])){channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0xd')]=_0x15d76f[_0x2214('0x24')]+'\x20<'+_0x15d76f[_0x2214('0x15')]+'>';}channels[_0x15d76f['uniqueid']][_0x2214('0x25')]=utils[_0x2214('0x18')]();channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0x26')]=utils['diffTime'](channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0x25')],channels[_0x15d76f['uniqueid']][_0x2214('0x27')]);channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0x28')]=channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0x21')]?utils[_0x2214('0x29')](channels[_0x15d76f[_0x2214('0x8')]][_0x2214('0x25')],channels[_0x15d76f[_0x2214('0x8')]]['answertime']):0x0;writeDB(channels[_0x15d76f[_0x2214('0x8')]]);}}catch(_0x3564e5){utils['error'](_0x3564e5[_0x2214('0x1b')]);}};exports[_0x2214('0x2a')]=function(_0x24e0e5){try{if(!_['isNil'](channels[_0x24e0e5[_0x2214('0x2b')]])){if(channels[_0x24e0e5[_0x2214('0x2b')]][_0x2214('0x9')]==_0x24e0e5[_0x2214('0x2c')]){channels[_0x24e0e5[_0x2214('0x2b')]][_0x2214('0x20')]=_0x24e0e5['secondtransfererchannel'];channels[_0x24e0e5['localtwolinkedid']][_0x2214('0x2d')]='_attended';}else if(channels[_0x24e0e5[_0x2214('0x2b')]][_0x2214('0x9')]=_0x24e0e5[_0x2214('0x2e')]){channels[_0x24e0e5[_0x2214('0x2b')]][_0x2214('0x20')]=_0x24e0e5[_0x2214('0x2f')];channels[_0x24e0e5['localtwolinkedid']][_0x2214('0x2d')]=_0x2214('0x30');}}}catch(_0x457c8a){utils[_0x2214('0x1a')](_0x457c8a['stack']);}};exports['musiconholdstart']=function(_0x4f842b){try{if(!_[_0x2214('0x1e')](channels[_0x4f842b['uniqueid']])){channels[_0x4f842b[_0x2214('0x8')]]['musiconholdstartAt']=utils[_0x2214('0x18')]();}}catch(_0x52007e){utils[_0x2214('0x1a')](_0x52007e[_0x2214('0x1b')]);}};exports[_0x2214('0x31')]=function(_0x4c7992){try{if(!_[_0x2214('0x1e')](channels[_0x4c7992[_0x2214('0x8')]])){if(!_[_0x2214('0x1e')](channels[_0x4c7992[_0x2214('0x8')]][_0x2214('0x32')])){channels[_0x4c7992[_0x2214('0x8')]][_0x2214('0x33')]+=utils['diffTime'](utils[_0x2214('0x18')](),channels[_0x4c7992['uniqueid']]['musiconholdstartAt']);delete channels[_0x4c7992[_0x2214('0x8')]]['musiconholdstartAt'];}}}catch(_0x3bafc5){utils[_0x2214('0x1a')](_0x3bafc5[_0x2214('0x1b')]);}};exports[_0x2214('0x34')]=function(_0x5c803e){try{if(!_[_0x2214('0x1e')](channels[_0x5c803e['uniqueid']])){if(!_[_0x2214('0x1e')](_0x5c803e['variable'][_0x2214('0x35')])){channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0xb')]=_0x5c803e[_0x2214('0x36')];}if(!_[_0x2214('0x1e')](_0x5c803e['variable'][_0x2214('0x37')])){channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0xc')]=_0x5c803e[_0x2214('0x36')];channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0xd')]='\x22'+_0x5c803e[_0x2214('0x36')]+_0x2214('0x38')+_0x5c803e[_0x2214('0x36')]+'>';}if(!_[_0x2214('0x1e')](_0x5c803e[_0x2214('0x39')][_0x2214('0x3a')])||!_[_0x2214('0x1e')](_0x5c803e[_0x2214('0x39')][_0x2214('0x3b')])){channels[_0x5c803e['uniqueid']]['callerid']=_0x5c803e['value'];}if(!_[_0x2214('0x1e')](_0x5c803e[_0x2214('0x39')][_0x2214('0x3c')])||!_['isNil'](_0x5c803e[_0x2214('0x39')]['xmcs-queue'])){channels[_0x5c803e[_0x2214('0x8')]]['lastapplication']=_0x2214('0x3d');channels[_0x5c803e[_0x2214('0x8')]]['lastdata']=_0x5c803e['value'];channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0x3e')]=!![];}if(!_[_0x2214('0x1e')](_0x5c803e['variable'][_0x2214('0x3f')])){channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0x40')]=_0x5c803e['value'];}if(!_['isNil'](_0x5c803e[_0x2214('0x39')][_0x2214('0x41')])){channels[_0x5c803e['uniqueid']][_0x2214('0x42')]=_0x5c803e[_0x2214('0x36')];}if(!_[_0x2214('0x1e')](_0x5c803e[_0x2214('0x39')]['outboundrouteid'])){channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0x43')]=_0x5c803e[_0x2214('0x36')];}if(!_[_0x2214('0x1e')](_0x5c803e['variable'][_0x2214('0x44')])){channels[_0x5c803e[_0x2214('0x8')]][_0x2214('0x44')]=_0x5c803e[_0x2214('0x36')];}}}catch(_0x262de2){utils['error'](_0x262de2[_0x2214('0x1b')]);}};exports[_0x2214('0x45')]=function(_0x1e147b){try{if(!_[_0x2214('0x1e')](channels[_0x1e147b[_0x2214('0x8')]])){if(_0x1e147b[_0x2214('0x46')][_0x2214('0x47')]()==_0x2214('0x48')&&_[_0x2214('0x49')](_0x1e147b[_0x2214('0x4a')][_0x2214('0x47')](),'cdr')){var _0x22d499=_0x1e147b[_0x2214('0x4a')][_0x2214('0x4b')]('=');var _0x362973=_0x22d499[0x0]['substring'](_0x22d499[0x0][_0x2214('0x4c')]('(')+0x1,_0x22d499[0x0][_0x2214('0x4c')](')'));var _0x25908f=_0x22d499[0x1];channels[_0x1e147b[_0x2214('0x8')]][_0x362973]=_0x25908f;}if(!_[_0x2214('0x4d')]([_0x2214('0x23'),_0x2214('0x4e'),_0x2214('0x4f'),'set',_0x2214('0x50')],_0x1e147b['application'][_0x2214('0x47')]())){channels[_0x1e147b[_0x2214('0x8')]][_0x2214('0x51')]=_0x1e147b[_0x2214('0x46')];channels[_0x1e147b[_0x2214('0x8')]]['lastdata']=_0x1e147b[_0x2214('0x4a')];}}}catch(_0x1f783e){utils[_0x2214('0x1a')](_0x1f783e[_0x2214('0x1b')]);}}; \ No newline at end of file +var _0xbb14=['ANSWERED','calleridname','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','_attended','transfertargetchannel','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','substring','lastIndexOf','hangup','noop','gotoif','lodash','NO\x20ANSWER','FAILED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','source','destination','callerid','disposition','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','OutgoingSpoolFailed','calleridnum','context','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','linkedid','transfer','answertime','now','toNumber','channelstate'];(function(_0x5d1671,_0x31c856){var _0x57f48d=function(_0x70b96c){while(--_0x70b96c){_0x5d1671['push'](_0x5d1671['shift']());}};_0x57f48d(++_0x31c856);}(_0xbb14,0x174));var _0x4bb1=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbb14[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x4bb1('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0x4bb1('0x1'),_0x4bb1('0x2'),_0x4bb1('0x2'),_0x4bb1('0x1'),_0x4bb1('0x1'),_0x4bb1('0x1'),'ANSWERED',_0x4bb1('0x3'),_0x4bb1('0x2'),_0x4bb1('0x2'),_0x4bb1('0x2')];var channels={};function writeDB(_0x222616){utils[_0x4bb1('0x4')](util['format'](_0x4bb1('0x5'),_0x222616[_0x4bb1('0x6')],_0x222616[_0x4bb1('0x7')],_0x222616['type'],_0x222616['accountcode'],_0x222616[_0x4bb1('0x8')],_0x222616[_0x4bb1('0x9')],_0x222616[_0x4bb1('0xa')],_0x222616[_0x4bb1('0xb')]));if(_0x222616[_0x4bb1('0xc')]){utils[_0x4bb1('0xd')](_0x222616[_0x4bb1('0xc')])[_0x4bb1('0xe')](function(_0x1c96fc){if(_0x1c96fc){_0x222616['UserId']=_0x1c96fc['id'];}utils[_0x4bb1('0xf')](_0x4bb1('0x10'),_0x222616);});}else{utils[_0x4bb1('0xf')](_0x4bb1('0x10'),_0x222616);}if(channels[_0x222616[_0x4bb1('0x6')]]){delete channels[_0x222616['uniqueid']];}}exports[_0x4bb1('0x11')]=function(_0x43e973){try{if(_0x43e973[_0x4bb1('0x6')]==_0x43e973['linkedid']&&_0x43e973['channel']!=_0x4bb1('0x12')){channels[_0x43e973[_0x4bb1('0x6')]]={'uniqueid':_0x43e973[_0x4bb1('0x6')],'accountcode':_0x43e973[_0x4bb1('0xc')],'source':_0x43e973[_0x4bb1('0x13')],'destination':_0x43e973['exten'],'destinationcontext':_0x43e973[_0x4bb1('0x14')],'channel':_0x43e973[_0x4bb1('0x7')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4bb1('0x1'),'amaflags':_0x4bb1('0x15')};}}catch(_0x4bb564){utils[_0x4bb1('0x16')](_0x4bb564[_0x4bb1('0x17')]);}};exports[_0x4bb1('0x18')]=function(_0x1f2bc0){try{if(!_[_0x4bb1('0x19')](channels[_0x1f2bc0[_0x4bb1('0x6')]])&&_0x1f2bc0['channelstate']==0x6){if(_[_0x4bb1('0x19')](channels[_0x1f2bc0['uniqueid']][_0x4bb1('0x1a')])){channels[_0x1f2bc0['uniqueid']]['systemanswertime']=utils['now']();}}else if(!_[_0x4bb1('0x19')](channels[_0x1f2bc0[_0x4bb1('0x1b')]])&&_0x1f2bc0['channelstate']==0x6&&_0x1f2bc0[_0x4bb1('0x14')]!=_0x4bb1('0x1c')){channels[_0x1f2bc0[_0x4bb1('0x1b')]][_0x4bb1('0xc')]=_0x1f2bc0[_0x4bb1('0xc')];channels[_0x1f2bc0[_0x4bb1('0x1b')]]['destinationchannel']=_0x1f2bc0[_0x4bb1('0x7')];if(_['isNil'](channels[_0x1f2bc0['linkedid']][_0x4bb1('0x1d')])){channels[_0x1f2bc0['linkedid']][_0x4bb1('0x1d')]=utils[_0x4bb1('0x1e')]();}channels[_0x1f2bc0[_0x4bb1('0x1b')]][_0x4bb1('0xb')]=dispositions[_[_0x4bb1('0x1f')](_0x1f2bc0[_0x4bb1('0x20')])]||_0x4bb1('0x21');}}catch(_0x13757c){utils['error'](_0x13757c[_0x4bb1('0x17')]);}};exports['hangup']=function(_0x3b7847){try{if(!_[_0x4bb1('0x19')](channels[_0x3b7847[_0x4bb1('0x6')]])){if(_[_0x4bb1('0x19')](channels[_0x3b7847[_0x4bb1('0x6')]][_0x4bb1('0xa')])){channels[_0x3b7847[_0x4bb1('0x6')]][_0x4bb1('0xa')]=_0x3b7847[_0x4bb1('0x22')]+'\x20<'+_0x3b7847[_0x4bb1('0x13')]+'>';}channels[_0x3b7847[_0x4bb1('0x6')]][_0x4bb1('0x23')]=utils[_0x4bb1('0x1e')]();channels[_0x3b7847['uniqueid']][_0x4bb1('0x24')]=utils[_0x4bb1('0x25')](channels[_0x3b7847['uniqueid']][_0x4bb1('0x23')],channels[_0x3b7847['uniqueid']][_0x4bb1('0x26')]);channels[_0x3b7847['uniqueid']][_0x4bb1('0x27')]=channels[_0x3b7847[_0x4bb1('0x6')]]['answertime']?utils['diffTime'](channels[_0x3b7847[_0x4bb1('0x6')]][_0x4bb1('0x23')],channels[_0x3b7847['uniqueid']][_0x4bb1('0x1d')]):0x0;writeDB(channels[_0x3b7847['uniqueid']]);}}catch(_0xd62bf8){utils[_0x4bb1('0x16')](_0xd62bf8['stack']);}};exports['attendedtransfer']=function(_0x63c12){try{if(!_[_0x4bb1('0x19')](channels[_0x63c12[_0x4bb1('0x28')]])){if(channels[_0x63c12[_0x4bb1('0x28')]][_0x4bb1('0x7')]==_0x63c12[_0x4bb1('0x29')]){channels[_0x63c12['localtwolinkedid']][_0x4bb1('0x2a')]=_0x63c12[_0x4bb1('0x2b')];channels[_0x63c12[_0x4bb1('0x28')]]['userfield']=_0x4bb1('0x2c');}else if(channels[_0x63c12[_0x4bb1('0x28')]]['channel']=_0x63c12[_0x4bb1('0x2d')]){channels[_0x63c12[_0x4bb1('0x28')]][_0x4bb1('0x2a')]=_0x63c12['origtransfererchannel'];channels[_0x63c12['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x13ffea){utils['error'](_0x13ffea['stack']);}};exports['musiconholdstart']=function(_0xbce737){try{if(!_[_0x4bb1('0x19')](channels[_0xbce737[_0x4bb1('0x6')]])){channels[_0xbce737[_0x4bb1('0x6')]][_0x4bb1('0x2e')]=utils[_0x4bb1('0x1e')]();}}catch(_0x37a9ea){utils[_0x4bb1('0x16')](_0x37a9ea[_0x4bb1('0x17')]);}};exports[_0x4bb1('0x2f')]=function(_0xa31352){try{if(!_['isNil'](channels[_0xa31352['uniqueid']])){if(!_[_0x4bb1('0x19')](channels[_0xa31352[_0x4bb1('0x6')]][_0x4bb1('0x2e')])){channels[_0xa31352[_0x4bb1('0x6')]][_0x4bb1('0x30')]+=utils[_0x4bb1('0x25')](utils[_0x4bb1('0x1e')](),channels[_0xa31352[_0x4bb1('0x6')]][_0x4bb1('0x2e')]);delete channels[_0xa31352[_0x4bb1('0x6')]][_0x4bb1('0x2e')];}}}catch(_0x2d600e){utils['error'](_0x2d600e[_0x4bb1('0x17')]);}};exports[_0x4bb1('0x31')]=function(_0x30242f){try{if(!_[_0x4bb1('0x19')](channels[_0x30242f[_0x4bb1('0x6')]])){if(!_['isNil'](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x33')])){channels[_0x30242f['uniqueid']][_0x4bb1('0x8')]=_0x30242f[_0x4bb1('0x34')];}if(!_[_0x4bb1('0x19')](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x35')])){channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x9')]=_0x30242f['value'];channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0xa')]='\x22'+_0x30242f[_0x4bb1('0x34')]+_0x4bb1('0x36')+_0x30242f[_0x4bb1('0x34')]+'>';}if(!_[_0x4bb1('0x19')](_0x30242f['variable'][_0x4bb1('0x37')])||!_['isNil'](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x38')])){channels[_0x30242f[_0x4bb1('0x6')]]['callerid']=_0x30242f[_0x4bb1('0x34')];}if(!_[_0x4bb1('0x19')](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x39')])||!_['isNil'](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x3a')])){channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x3b')]=_0x4bb1('0x3c');channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x3d')]=_0x30242f['value'];channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x3e')]=!![];}if(!_[_0x4bb1('0x19')](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x3f')])){channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x40')]=_0x30242f['value'];}if(!_[_0x4bb1('0x19')](_0x30242f[_0x4bb1('0x32')][_0x4bb1('0x41')])){channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x42')]=_0x30242f[_0x4bb1('0x34')];}if(!_[_0x4bb1('0x19')](_0x30242f['variable'][_0x4bb1('0x43')])){channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x44')]=_0x30242f[_0x4bb1('0x34')];}if(!_['isNil'](_0x30242f[_0x4bb1('0x32')]['sipcallid'])){channels[_0x30242f[_0x4bb1('0x6')]][_0x4bb1('0x45')]=_0x30242f[_0x4bb1('0x34')];}}}catch(_0x56d182){utils[_0x4bb1('0x16')](_0x56d182[_0x4bb1('0x17')]);}};exports[_0x4bb1('0x46')]=function(_0x38f3f1){try{if(!_[_0x4bb1('0x19')](channels[_0x38f3f1['uniqueid']])){if(_0x38f3f1[_0x4bb1('0x47')][_0x4bb1('0x48')]()==_0x4bb1('0x49')&&_[_0x4bb1('0x4a')](_0x38f3f1[_0x4bb1('0x4b')][_0x4bb1('0x48')](),'cdr')){var _0x26f392=_0x38f3f1['appdata']['split']('=');var _0xcea0ba=_0x26f392[0x0][_0x4bb1('0x4c')](_0x26f392[0x0]['lastIndexOf']('(')+0x1,_0x26f392[0x0][_0x4bb1('0x4d')](')'));var _0x3f6afb=_0x26f392[0x1];channels[_0x38f3f1[_0x4bb1('0x6')]][_0xcea0ba]=_0x3f6afb;}if(!_['includes']([_0x4bb1('0x4e'),_0x4bb1('0x4f'),'execif',_0x4bb1('0x49'),_0x4bb1('0x50')],_0x38f3f1[_0x4bb1('0x47')][_0x4bb1('0x48')]())){channels[_0x38f3f1['uniqueid']][_0x4bb1('0x3b')]=_0x38f3f1['application'];channels[_0x38f3f1['uniqueid']][_0x4bb1('0x3d')]=_0x38f3f1[_0x4bb1('0x4b')];}}}catch(_0x3f66f4){utils[_0x4bb1('0x16')](_0x3f66f4[_0x4bb1('0x17')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c8c8e44..ab1200c 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 _0xb138=['FULLYBOOTED','error','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','fullybooted'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xb138,0x1dd));var _0x8b13=function(_0x5371a3,_0x1f65d3){_0x5371a3=_0x5371a3-0x0;var _0xf3ee50=_0xb138[_0x5371a3];return _0xf3ee50;};'use strict';var utils=require(_0x8b13('0x0'));var _=require(_0x8b13('0x1'));exports[_0x8b13('0x2')]=function(){utils[_0x8b13('0x3')](_0x8b13('0x4'));};exports[_0x8b13('0x5')]=function(){utils[_0x8b13('0x3')]('SHUTDOWN');};exports[_0x8b13('0x6')]=function(){utils[_0x8b13('0x3')](_0x8b13('0x7'));};exports['error']=function(_0xd19a0f){utils[_0x8b13('0x8')](_0xd19a0f);};exports['close']=function(){utils[_0x8b13('0x3')](_0x8b13('0x9'));};exports[_0x8b13('0xa')]=function(_0x498832){}; \ No newline at end of file +var _0xbd51=['error','close','CLOSE','managerevent','./utils','connect','info','CONNECTED','shutdown','FULLYBOOTED'];(function(_0x46b565,_0x2c5041){var _0x2ae35c=function(_0xd8759c){while(--_0xd8759c){_0x46b565['push'](_0x46b565['shift']());}};_0x2ae35c(++_0x2c5041);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2b66cb,_0x4e8f46){_0x2b66cb=_0x2b66cb-0x0;var _0x1e41bf=_0xbd51[_0x2b66cb];return _0x1e41bf;};'use strict';var utils=require(_0x1bd5('0x0'));var _=require('lodash');exports[_0x1bd5('0x1')]=function(){utils[_0x1bd5('0x2')](_0x1bd5('0x3'));};exports[_0x1bd5('0x4')]=function(){utils['info']('SHUTDOWN');};exports['fullybooted']=function(){utils['info'](_0x1bd5('0x5'));};exports[_0x1bd5('0x6')]=function(_0x43e6b6){utils['error'](_0x43e6b6);};exports[_0x1bd5('0x7')]=function(){utils[_0x1bd5('0x2')](_0x1bd5('0x8'));};exports[_0x1bd5('0x9')]=function(_0xd8418f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 0e6f89e..7e09a20 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 _0x4170=['./utils','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','set','startsWith','appdata','toLowerCase','split','error','stack','variable','value','dialbegin','isNil','assign','starttime','now','called','dialend','ANSWER','answertime','lastevent','hangup','diffTime','endtime','holdtime','billableseconds','lodash','util'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4170,0x166));var _0x0417=function(_0xc86baf,_0x2ffba2){_0xc86baf=_0xc86baf-0x0;var _0xab4b1f=_0x4170[_0xc86baf];return _0xab4b1f;};'use strict';var _=require(_0x0417('0x0'));var util=require(_0x0417('0x1'));var utils=require(_0x0417('0x2'));var dials={};function writeDB(_0x3a9655){utils['info'](util[_0x0417('0x3')](_0x0417('0x4'),_0x3a9655[_0x0417('0x5')],_0x3a9655['channel'],_0x3a9655['dialstring'],_0x3a9655[_0x0417('0x6')],_0x3a9655[_0x0417('0x7')],_0x3a9655[_0x0417('0x8')]));utils[_0x0417('0x9')](_0x0417('0xa'),_0x3a9655);delete dials[_0x3a9655[_0x0417('0x5')]];}exports[_0x0417('0xb')]=function(_0x55eed0){try{if(_0x55eed0['application']['toLowerCase']()==_0x0417('0xc')&&_[_0x0417('0xd')](_0x55eed0[_0x0417('0xe')][_0x0417('0xf')](),'cdr(routeid)')){var _0x4b1e27=_0x55eed0[_0x0417('0xe')][_0x0417('0x10')]('=');dials[_0x55eed0[_0x0417('0x5')]]={'routeId':_0x4b1e27[0x1]};}}catch(_0x30a564){utils[_0x0417('0x11')](_0x30a564[_0x0417('0x12')]);}};exports['varset']=function(_0x2ebb97){try{if(!_['isNil'](_0x2ebb97[_0x0417('0x13')]['outboundrouteid'])){dials[_0x2ebb97['uniqueid']]={'routeId':_0x2ebb97[_0x0417('0x14')]};}}catch(_0x595b67){utils[_0x0417('0x11')](_0x595b67[_0x0417('0x12')]);}};exports[_0x0417('0x15')]=function(_0x57020f){try{if(!_[_0x0417('0x16')](dials[_0x57020f[_0x0417('0x5')]])){dials[_0x57020f['uniqueid']]=_[_0x0417('0x17')](dials[_0x57020f[_0x0417('0x5')]],_0x57020f);dials[_0x57020f[_0x0417('0x5')]][_0x0417('0x18')]=utils[_0x0417('0x19')]();dials[_0x57020f[_0x0417('0x5')]]['lastevent']=_0x0417('0x1a');}}catch(_0x53de39){utils[_0x0417('0x11')](_0x53de39[_0x0417('0x12')]);}};exports[_0x0417('0x1b')]=function(_0x2ee500){try{if(!_[_0x0417('0x16')](dials[_0x2ee500[_0x0417('0x5')]])){dials[_0x2ee500['uniqueid']]['dialstatus']=_0x2ee500['dialstatus'];if(_0x2ee500[_0x0417('0x8')]==_0x0417('0x1c')){dials[_0x2ee500[_0x0417('0x5')]]=_[_0x0417('0x17')](dials[_0x2ee500[_0x0417('0x5')]],_0x2ee500);dials[_0x2ee500[_0x0417('0x5')]][_0x0417('0x1d')]=utils[_0x0417('0x19')]();dials[_0x2ee500[_0x0417('0x5')]][_0x0417('0x1e')]='connect';}}}catch(_0x23db14){utils[_0x0417('0x11')](_0x23db14[_0x0417('0x12')]);}};exports[_0x0417('0x1f')]=function(_0x155d24){try{if(!_['isNil'](dials[_0x155d24['uniqueid']])){dials[_0x155d24[_0x0417('0x5')]]=_[_0x0417('0x17')](dials[_0x155d24['uniqueid']],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x155d24[_0x0417('0x5')]]['duration']=utils[_0x0417('0x20')](dials[_0x155d24[_0x0417('0x5')]][_0x0417('0x21')],dials[_0x155d24[_0x0417('0x5')]][_0x0417('0x18')]);dials[_0x155d24['uniqueid']][_0x0417('0x22')]=utils[_0x0417('0x20')](dials[_0x155d24['uniqueid']]['answertime']||dials[_0x155d24[_0x0417('0x5')]]['endtime'],dials[_0x155d24['uniqueid']][_0x0417('0x18')]);dials[_0x155d24[_0x0417('0x5')]][_0x0417('0x23')]=dials[_0x155d24[_0x0417('0x5')]][_0x0417('0x1d')]?utils[_0x0417('0x20')](dials[_0x155d24[_0x0417('0x5')]]['endtime'],dials[_0x155d24['uniqueid']]['answertime']):0x0;writeDB(dials[_0x155d24[_0x0417('0x5')]]);}}catch(_0x153e16){utils[_0x0417('0x11')](_0x153e16['stack']);}}; \ No newline at end of file +var _0x223e=['split','error','varset','isNil','variable','outboundrouteid','value','stack','dialbegin','starttime','called','dialend','ANSWER','now','lastevent','connect','hangup','complete','duration','diffTime','endtime','holdtime','answertime','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','dialstatus','request','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)'];(function(_0x3f9369,_0x392d10){var _0x3e4d9b=function(_0x5acef4){while(--_0x5acef4){_0x3f9369['push'](_0x3f9369['shift']());}};_0x3e4d9b(++_0x392d10);}(_0x223e,0x1b1));var _0xe223=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x223e[_0xa3c06b];return _0x33aa1d;};'use strict';var _=require(_0xe223('0x0'));var util=require(_0xe223('0x1'));var utils=require(_0xe223('0x2'));var dials={};function writeDB(_0x5ce4d2){utils[_0xe223('0x3')](util[_0xe223('0x4')](_0xe223('0x5'),_0x5ce4d2[_0xe223('0x6')],_0x5ce4d2[_0xe223('0x7')],_0x5ce4d2[_0xe223('0x8')],_0x5ce4d2['calleridnum'],_0x5ce4d2['connectedlinenum'],_0x5ce4d2[_0xe223('0x9')]));utils[_0xe223('0xa')]('CreateVoiceDialReport',_0x5ce4d2);delete dials[_0x5ce4d2[_0xe223('0x6')]];}exports[_0xe223('0xb')]=function(_0x4cffbb){try{if(_0x4cffbb[_0xe223('0xc')][_0xe223('0xd')]()==_0xe223('0xe')&&_[_0xe223('0xf')](_0x4cffbb[_0xe223('0x10')]['toLowerCase'](),_0xe223('0x11'))){var _0x54bc19=_0x4cffbb[_0xe223('0x10')][_0xe223('0x12')]('=');dials[_0x4cffbb[_0xe223('0x6')]]={'routeId':_0x54bc19[0x1]};}}catch(_0xd05f12){utils[_0xe223('0x13')](_0xd05f12['stack']);}};exports[_0xe223('0x14')]=function(_0x1f39be){try{if(!_[_0xe223('0x15')](_0x1f39be[_0xe223('0x16')][_0xe223('0x17')])){dials[_0x1f39be[_0xe223('0x6')]]={'routeId':_0x1f39be[_0xe223('0x18')]};}}catch(_0x53f54f){utils[_0xe223('0x13')](_0x53f54f[_0xe223('0x19')]);}};exports[_0xe223('0x1a')]=function(_0x37634c){try{if(!_['isNil'](dials[_0x37634c['uniqueid']])){dials[_0x37634c[_0xe223('0x6')]]=_['assign'](dials[_0x37634c[_0xe223('0x6')]],_0x37634c);dials[_0x37634c['uniqueid']][_0xe223('0x1b')]=utils['now']();dials[_0x37634c['uniqueid']]['lastevent']=_0xe223('0x1c');}}catch(_0x991276){utils['error'](_0x991276[_0xe223('0x19')]);}};exports[_0xe223('0x1d')]=function(_0x465a34){try{if(!_[_0xe223('0x15')](dials[_0x465a34[_0xe223('0x6')]])){dials[_0x465a34[_0xe223('0x6')]][_0xe223('0x9')]=_0x465a34[_0xe223('0x9')];if(_0x465a34[_0xe223('0x9')]==_0xe223('0x1e')){dials[_0x465a34['uniqueid']]=_['assign'](dials[_0x465a34[_0xe223('0x6')]],_0x465a34);dials[_0x465a34['uniqueid']]['answertime']=utils[_0xe223('0x1f')]();dials[_0x465a34[_0xe223('0x6')]][_0xe223('0x20')]=_0xe223('0x21');}}}catch(_0x2854e7){utils['error'](_0x2854e7[_0xe223('0x19')]);}};exports[_0xe223('0x22')]=function(_0x2e40fe){try{if(!_['isNil'](dials[_0x2e40fe[_0xe223('0x6')]])){dials[_0x2e40fe[_0xe223('0x6')]]=_['assign'](dials[_0x2e40fe[_0xe223('0x6')]],{'endtime':utils[_0xe223('0x1f')](),'lastevent':_0xe223('0x23')});dials[_0x2e40fe[_0xe223('0x6')]][_0xe223('0x24')]=utils[_0xe223('0x25')](dials[_0x2e40fe['uniqueid']][_0xe223('0x26')],dials[_0x2e40fe[_0xe223('0x6')]][_0xe223('0x1b')]);dials[_0x2e40fe['uniqueid']][_0xe223('0x27')]=utils[_0xe223('0x25')](dials[_0x2e40fe['uniqueid']][_0xe223('0x28')]||dials[_0x2e40fe[_0xe223('0x6')]][_0xe223('0x26')],dials[_0x2e40fe[_0xe223('0x6')]]['starttime']);dials[_0x2e40fe[_0xe223('0x6')]]['billableseconds']=dials[_0x2e40fe[_0xe223('0x6')]][_0xe223('0x28')]?utils[_0xe223('0x25')](dials[_0x2e40fe[_0xe223('0x6')]]['endtime'],dials[_0x2e40fe[_0xe223('0x6')]][_0xe223('0x28')]):0x0;writeDB(dials[_0x2e40fe['uniqueid']]);}}catch(_0x593aec){utils[_0xe223('0x13')](_0x593aec['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index dc3e9ad..370ca8b 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 _0x9df8=['attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','hangup','blindtransfer'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0x9df8,0x7b));var _0x89df=function(_0x5ababe,_0x54b6a7){_0x5ababe=_0x5ababe-0x0;var _0x26ea83=_0x9df8[_0x5ababe];return _0x26ea83;};var AsteriskManager=require(_0x89df('0x0'));var config=require('../../config/environment');var utils=require(_0x89df('0x1'));var ami=new AsteriskManager(config[_0x89df('0x2')]['port'],config[_0x89df('0x2')]['ip'],config['asterisk'][_0x89df('0x3')],config[_0x89df('0x2')][_0x89df('0x4')],!![]);ami[_0x89df('0x5')]();if(config['xdr']&&config[_0x89df('0x6')][_0x89df('0x7')]){utils[_0x89df('0x8')](_0x89df('0x9'));}else{var agents=require(_0x89df('0xa'));var calls=require(_0x89df('0xb'));var queues=require('./queues.controller');var recordings=require(_0x89df('0xc'));var members=require(_0x89df('0xd'));var dials=require('./dials.controller');var transfers=require(_0x89df('0xe'));var core=require(_0x89df('0xf'));ami['on'](_0x89df('0x10'),core[_0x89df('0x10')]);ami['on'](_0x89df('0x11'),core['shutdown']);ami['on'](_0x89df('0x12'),core[_0x89df('0x12')]);ami['on']('error',core[_0x89df('0x13')]);ami['on']('close',core[_0x89df('0x14')]);ami['on'](_0x89df('0x15'),core['managerevent']);ami['on'](_0x89df('0x16'),function(_0x12d275){try{members['devicestatechange'](_0x12d275);}catch(_0x14d425){utils['error'](_0x14d425);}});ami['on'](_0x89df('0x17'),function(_0x5938d3){try{agents[_0x89df('0x17')](_0x5938d3);}catch(_0x43cec5){utils[_0x89df('0x13')](_0x43cec5);}});ami['on'](_0x89df('0x18'),function(_0x397e8c){try{agents[_0x89df('0x18')](_0x397e8c);}catch(_0x59b452){utils[_0x89df('0x13')](_0x59b452);}});ami['on'](_0x89df('0x19'),function(_0x9de454){try{agents[_0x89df('0x19')](_0x9de454);queues[_0x89df('0x19')](_0x9de454);}catch(_0x36f8b0){utils[_0x89df('0x13')](_0x36f8b0);}});ami['on'](_0x89df('0x1a'),function(_0x4b4ae6){try{agents[_0x89df('0x1a')](_0x4b4ae6);queues[_0x89df('0x1a')](_0x4b4ae6);members[_0x89df('0x1a')](_0x4b4ae6);}catch(_0x5d6e24){utils['error'](_0x5d6e24);}});ami['on']('queuecallerabandon',function(_0x35121a){try{agents['queuecallerabandon'](_0x35121a);queues['queuecallerabandon'](_0x35121a);}catch(_0x3543bf){utils['error'](_0x3543bf);}});ami['on'](_0x89df('0x1b'),function(_0x21d861){try{queues[_0x89df('0x1b')](_0x21d861);recordings['queuecallerjoin'](_0x21d861);}catch(_0x4a9219){utils[_0x89df('0x13')](_0x4a9219);}});ami['on'](_0x89df('0x1c'),function(_0x20ab38){try{queues['queuecallerleave'](_0x20ab38);}catch(_0x31a6e8){utils[_0x89df('0x13')](_0x31a6e8);}});ami['on']('musiconholdstart',function(_0x152119){try{queues[_0x89df('0x1d')](_0x152119);calls[_0x89df('0x1d')](_0x152119);}catch(_0x1beab0){utils['error'](_0x1beab0);}});ami['on'](_0x89df('0x1e'),function(_0xbcd652){try{queues[_0x89df('0x1e')](_0xbcd652);calls[_0x89df('0x1e')](_0xbcd652);}catch(_0x4e5818){utils['error'](_0x4e5818);}});ami['on']('newstate',function(_0x4512bc){try{calls['newstate'](_0x4512bc);recordings['newstate'](_0x4512bc);}catch(_0x545805){utils[_0x89df('0x13')](_0x545805);}});ami['on'](_0x89df('0x1f'),function(_0x26042f){try{calls[_0x89df('0x1f')](_0x26042f);recordings['hangup'](_0x26042f);dials[_0x89df('0x1f')](_0x26042f);agents['hangup'](_0x26042f);queues['hangup'](_0x26042f);}catch(_0x515c05){utils[_0x89df('0x13')](_0x515c05);}});ami['on']('cdr',function(_0xbf10b7){try{members['cdr'](_0xbf10b7);}catch(_0x3ebc5d){utils[_0x89df('0x13')](_0x3ebc5d);}});ami['on'](_0x89df('0x20'),function(_0x420482){try{queues[_0x89df('0x20')](_0x420482);agents[_0x89df('0x20')](_0x420482);transfers[_0x89df('0x20')](_0x420482);}catch(_0x55b15b){utils[_0x89df('0x13')](_0x55b15b);}});ami['on'](_0x89df('0x21'),function(_0x3978fe){try{queues['attendedtransfer'](_0x3978fe);transfers['attendedtransfer'](_0x3978fe);agents['attendedtransfer'](_0x3978fe);calls[_0x89df('0x21')](_0x3978fe);}catch(_0x482bab){utils[_0x89df('0x13')](_0x482bab);}});ami['on'](_0x89df('0x22'),function(_0x36674f){try{queues['varset'](_0x36674f);recordings['varset'](_0x36674f);calls['varset'](_0x36674f);dials['varset'](_0x36674f);}catch(_0x81a374){utils['error'](_0x81a374);}});ami['on'](_0x89df('0x23'),function(_0x504943){try{calls[_0x89df('0x23')](_0x504943);recordings[_0x89df('0x23')](_0x504943);dials[_0x89df('0x23')](_0x504943);}catch(_0x4ac5dc){utils[_0x89df('0x13')](_0x4ac5dc);}});ami['on'](_0x89df('0x24'),function(_0x37d06c){try{calls[_0x89df('0x24')](_0x37d06c);recordings['newchannel'](_0x37d06c);}catch(_0xf06b1){utils['error'](_0xf06b1);}});ami['on'](_0x89df('0x25'),function(_0x5a5dae){try{dials[_0x89df('0x25')](_0x5a5dae);}catch(_0x3daacf){utils[_0x89df('0x13')](_0x3daacf);}});ami['on'](_0x89df('0x26'),function(_0x700c71){try{dials[_0x89df('0x26')](_0x700c71);}catch(_0x572d61){utils['error'](_0x572d61);}});} \ No newline at end of file +var _0xe993=['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','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./core.controller'];(function(_0x2d3b29,_0x34aed2){var _0x33932a=function(_0x57de74){while(--_0x57de74){_0x2d3b29['push'](_0x2d3b29['shift']());}};_0x33932a(++_0x34aed2);}(_0xe993,0x11c));var _0x3e99=function(_0x1e60b0,_0x103209){_0x1e60b0=_0x1e60b0-0x0;var _0xde9ae1=_0xe993[_0x1e60b0];return _0xde9ae1;};var AsteriskManager=require(_0x3e99('0x0'));var config=require(_0x3e99('0x1'));var utils=require(_0x3e99('0x2'));var ami=new AsteriskManager(config[_0x3e99('0x3')][_0x3e99('0x4')],config['asterisk']['ip'],config[_0x3e99('0x3')][_0x3e99('0x5')],config[_0x3e99('0x3')][_0x3e99('0x6')],!![]);ami[_0x3e99('0x7')]();if(config[_0x3e99('0x8')]&&config['xdr'][_0x3e99('0x9')]){utils[_0x3e99('0xa')](_0x3e99('0xb'));}else{var agents=require(_0x3e99('0xc'));var calls=require(_0x3e99('0xd'));var queues=require(_0x3e99('0xe'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x3e99('0xf'));var transfers=require('./transfers.controller');var core=require(_0x3e99('0x10'));ami['on'](_0x3e99('0x11'),core[_0x3e99('0x11')]);ami['on'](_0x3e99('0x12'),core[_0x3e99('0x12')]);ami['on'](_0x3e99('0x13'),core[_0x3e99('0x13')]);ami['on'](_0x3e99('0x14'),core[_0x3e99('0x14')]);ami['on'](_0x3e99('0x15'),core[_0x3e99('0x15')]);ami['on']('managerevent',core[_0x3e99('0x16')]);ami['on'](_0x3e99('0x17'),function(_0x55b564){try{members[_0x3e99('0x17')](_0x55b564);}catch(_0x1d4bff){utils['error'](_0x1d4bff);}});ami['on'](_0x3e99('0x18'),function(_0x1262af){try{agents[_0x3e99('0x18')](_0x1262af);}catch(_0x2d9382){utils['error'](_0x2d9382);}});ami['on'](_0x3e99('0x19'),function(_0x4a910b){try{agents[_0x3e99('0x19')](_0x4a910b);}catch(_0xa6159d){utils[_0x3e99('0x14')](_0xa6159d);}});ami['on']('agentconnect',function(_0x333d8){try{agents[_0x3e99('0x1a')](_0x333d8);queues['agentconnect'](_0x333d8);}catch(_0x41a47b){utils[_0x3e99('0x14')](_0x41a47b);}});ami['on'](_0x3e99('0x1b'),function(_0x53d3b8){try{agents[_0x3e99('0x1b')](_0x53d3b8);queues[_0x3e99('0x1b')](_0x53d3b8);members[_0x3e99('0x1b')](_0x53d3b8);}catch(_0x5df207){utils[_0x3e99('0x14')](_0x5df207);}});ami['on'](_0x3e99('0x1c'),function(_0x9e92b7){try{agents[_0x3e99('0x1c')](_0x9e92b7);queues[_0x3e99('0x1c')](_0x9e92b7);}catch(_0x240eaf){utils[_0x3e99('0x14')](_0x240eaf);}});ami['on']('queuecallerjoin',function(_0x3eb99a){try{queues[_0x3e99('0x1d')](_0x3eb99a);recordings[_0x3e99('0x1d')](_0x3eb99a);}catch(_0x7c8b0a){utils[_0x3e99('0x14')](_0x7c8b0a);}});ami['on'](_0x3e99('0x1e'),function(_0xd4b270){try{queues[_0x3e99('0x1e')](_0xd4b270);}catch(_0x47104f){utils[_0x3e99('0x14')](_0x47104f);}});ami['on']('musiconholdstart',function(_0x484845){try{queues[_0x3e99('0x1f')](_0x484845);calls[_0x3e99('0x1f')](_0x484845);}catch(_0x4eb80b){utils[_0x3e99('0x14')](_0x4eb80b);}});ami['on']('musiconholdstop',function(_0x287b16){try{queues[_0x3e99('0x20')](_0x287b16);calls['musiconholdstop'](_0x287b16);}catch(_0x5cc918){utils[_0x3e99('0x14')](_0x5cc918);}});ami['on'](_0x3e99('0x21'),function(_0x337aa9){try{calls[_0x3e99('0x21')](_0x337aa9);recordings['newstate'](_0x337aa9);}catch(_0x19cba5){utils[_0x3e99('0x14')](_0x19cba5);}});ami['on']('hangup',function(_0x2177af){try{calls[_0x3e99('0x22')](_0x2177af);recordings[_0x3e99('0x22')](_0x2177af);dials[_0x3e99('0x22')](_0x2177af);agents['hangup'](_0x2177af);queues[_0x3e99('0x22')](_0x2177af);}catch(_0x3e24cc){utils[_0x3e99('0x14')](_0x3e24cc);}});ami['on'](_0x3e99('0x23'),function(_0x275ac4){try{members['cdr'](_0x275ac4);}catch(_0x138337){utils[_0x3e99('0x14')](_0x138337);}});ami['on'](_0x3e99('0x24'),function(_0xe092cb){try{queues['blindtransfer'](_0xe092cb);agents[_0x3e99('0x24')](_0xe092cb);transfers[_0x3e99('0x24')](_0xe092cb);}catch(_0x389287){utils[_0x3e99('0x14')](_0x389287);}});ami['on'](_0x3e99('0x25'),function(_0x78cd46){try{queues['attendedtransfer'](_0x78cd46);transfers[_0x3e99('0x25')](_0x78cd46);agents['attendedtransfer'](_0x78cd46);calls[_0x3e99('0x25')](_0x78cd46);}catch(_0xea185f){utils[_0x3e99('0x14')](_0xea185f);}});ami['on']('varset',function(_0x394edf){try{queues[_0x3e99('0x26')](_0x394edf);recordings['varset'](_0x394edf);calls['varset'](_0x394edf);dials[_0x3e99('0x26')](_0x394edf);}catch(_0x1522c8){utils[_0x3e99('0x14')](_0x1522c8);}});ami['on'](_0x3e99('0x27'),function(_0x4a2c9a){try{calls[_0x3e99('0x27')](_0x4a2c9a);recordings[_0x3e99('0x27')](_0x4a2c9a);dials['newexten'](_0x4a2c9a);}catch(_0x4768ea){utils['error'](_0x4768ea);}});ami['on'](_0x3e99('0x28'),function(_0x86cb46){try{calls[_0x3e99('0x28')](_0x86cb46);recordings[_0x3e99('0x28')](_0x86cb46);}catch(_0x3d0832){utils[_0x3e99('0x14')](_0x3d0832);}});ami['on'](_0x3e99('0x29'),function(_0x1cdf32){try{dials['dialbegin'](_0x1cdf32);}catch(_0x3d1d7e){utils['error'](_0x3d1d7e);}});ami['on'](_0x3e99('0x2a'),function(_0x26a2a8){try{dials[_0x3e99('0x2a')](_0x26a2a8);}catch(_0x591223){utils[_0x3e99('0x14')](_0x591223);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9b9262d..ab06be6 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 _0x0673=['enterAt','agentcomplete','queue','cdr','assign','data3','destinationchannel','data1','source','destination','lodash','./utils','Local/_attended@transfer','info','format','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','internal','request','CreateMemberReport','split','catch','error','some','startsWith','state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime'];(function(_0x193521,_0x5e7474){var _0x3a83e4=function(_0x160a68){while(--_0x160a68){_0x193521['push'](_0x193521['shift']());}};_0x3a83e4(++_0x5e7474);}(_0x0673,0x8e));var _0x3067=function(_0x26bd0d,_0x5cf069){_0x26bd0d=_0x26bd0d-0x0;var _0x5126ba=_0x0673[_0x26bd0d];return _0x5126ba;};'use strict';var _=require(_0x3067('0x0'));var util=require('util');var utils=require(_0x3067('0x1'));var members={};var exclude=[_0x3067('0x2'),'Queue:'];function writeDB(_0x428d8d){utils[_0x3067('0x3')](util[_0x3067('0x4')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x428d8d[_0x3067('0x5')],_0x428d8d['interface'],_0x428d8d[_0x3067('0x6')],_0x428d8d[_0x3067('0x7')],_0x428d8d[_0x3067('0x8')],_0x428d8d[_0x3067('0x9')]));if(_0x428d8d[_0x3067('0xa')]){utils[_0x3067('0xb')](_0x428d8d[_0x3067('0xa')])[_0x3067('0xc')](function(_0x2fdc58){if(_0x2fdc58){_0x428d8d[_0x3067('0x8')]=_0x2fdc58['name'];_0x428d8d['internal']=_0x2fdc58[_0x3067('0xd')];utils[_0x3067('0xe')](_0x3067('0xf'),_0x428d8d);}else{utils['getUserByName'](_0x428d8d[_0x3067('0xa')][_0x3067('0x10')]('/')[0x1])[_0x3067('0xc')](function(_0x3347f2){if(_0x3347f2){_0x428d8d['membername']=_0x3347f2['name'];_0x428d8d['internal']=_0x3347f2[_0x3067('0xd')];utils[_0x3067('0xe')](_0x3067('0xf'),_0x428d8d);}});}})[_0x3067('0x11')](function(_0x12eaae){utils[_0x3067('0x12')](_0x12eaae);});}delete members[_0x428d8d[_0x3067('0xa')]];}function startsWith(_0x473b55,_0xd7b5e6){return _[_0x3067('0x13')](_0x473b55,function(_0x5a46b8){return _[_0x3067('0x14')](_0xd7b5e6,_0x5a46b8);});}exports['devicestatechange']=function(_0xec1388){switch(_0xec1388[_0x3067('0x15')]){case _0x3067('0x16'):case _0x3067('0x17'):if(!startsWith(exclude,_0xec1388[_0x3067('0x18')])){members[_0xec1388[_0x3067('0x18')]]={'channel':_0x3067('0x19'),'interface':_0xec1388[_0x3067('0x18')],'type':_0x3067('0x1a'),'enterAt':utils[_0x3067('0x1b')](),'role':_0x3067('0x1c')};}break;case _0x3067('0x1d'):if(!_[_0x3067('0x1e')](members[_0xec1388[_0x3067('0x18')]])){members[_0xec1388[_0x3067('0x18')]][_0x3067('0x1f')]=utils[_0x3067('0x1b')]();members[_0xec1388[_0x3067('0x18')]][_0x3067('0x20')]=utils[_0x3067('0x21')](members[_0xec1388[_0x3067('0x18')]]['exitAt'],members[_0xec1388[_0x3067('0x18')]][_0x3067('0x22')]);if(members[_0xec1388[_0x3067('0x18')]][_0x3067('0x5')]){writeDB(members[_0xec1388[_0x3067('0x18')]]);}}default:break;}};exports[_0x3067('0x23')]=function(_0x1b1dc9){if(!_[_0x3067('0x1e')](members[_0x1b1dc9[_0x3067('0xa')]])){members[_0x1b1dc9[_0x3067('0xa')]]=_['assign'](members[_0x1b1dc9[_0x3067('0xa')]],{'data4':_0x1b1dc9[_0x3067('0x24')],'uniqueid':_0x1b1dc9[_0x3067('0x5')]});}};exports[_0x3067('0x25')]=function(_0x59fb23){if(_0x59fb23[_0x3067('0x6')]){var _0x1d49a8=_0x59fb23['channel'][_0x3067('0x10')]('-')[0x0];if(!_[_0x3067('0x1e')](members[_0x1d49a8])){members[_0x1d49a8]=_[_0x3067('0x26')](members[_0x1d49a8],{'data1':members[_0x1d49a8]['data1']||_0x59fb23[_0x3067('0x9')],'data2':members[_0x1d49a8]['data2']||_0x59fb23['source'],'data3':members[_0x1d49a8][_0x3067('0x27')]||_0x59fb23['destination'],'uniqueid':members[_0x1d49a8]['uniqueid']||_0x59fb23['uniqueid']});if(members[_0x1d49a8][_0x3067('0x1f')]){writeDB(members[_0x1d49a8]);}}}if(_0x59fb23[_0x3067('0x28')]){var _0x283a26=_0x59fb23[_0x3067('0x28')]['split']('-')[0x0];if(!_[_0x3067('0x1e')](members[_0x283a26])){members[_0x283a26]=_[_0x3067('0x26')](members[_0x283a26],{'data1':members[_0x283a26][_0x3067('0x29')]||_0x59fb23[_0x3067('0x9')],'data2':members[_0x283a26][_0x3067('0x7')]||_0x59fb23[_0x3067('0x2a')],'data3':members[_0x283a26][_0x3067('0x27')]||_0x59fb23[_0x3067('0x2b')],'uniqueid':members[_0x283a26][_0x3067('0x5')]||_0x59fb23[_0x3067('0x5')]});if(members[_0x283a26][_0x3067('0x1f')]){writeDB(members[_0x283a26]);}}}}; \ No newline at end of file +var _0x3a6d=['request','CreateMemberReport','getUserByName','split','error','some','startsWith','devicestatechange','state','INUSE','device','voice','TALKING','agent','NOT_INUSE','now','duration','diffTime','uniqueid','agentcomplete','queue','assign','data1','source','data3','destination','exitAt','destinationchannel','isNil','util','./utils','Local/_attended@transfer','info','format','interface','channel','data2','membername','type','getUserByInterface','then','name','internal'];(function(_0x59f7b9,_0x34cea6){var _0x1754de=function(_0x15875f){while(--_0x15875f){_0x59f7b9['push'](_0x59f7b9['shift']());}};_0x1754de(++_0x34cea6);}(_0x3a6d,0x11f));var _0xd3a6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3a6d[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0xd3a6('0x0'));var utils=require(_0xd3a6('0x1'));var members={};var exclude=[_0xd3a6('0x2'),'Queue:'];function writeDB(_0x5cbef3){utils[_0xd3a6('0x3')](util[_0xd3a6('0x4')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x5cbef3['uniqueid'],_0x5cbef3[_0xd3a6('0x5')],_0x5cbef3[_0xd3a6('0x6')],_0x5cbef3[_0xd3a6('0x7')],_0x5cbef3[_0xd3a6('0x8')],_0x5cbef3[_0xd3a6('0x9')]));if(_0x5cbef3[_0xd3a6('0x5')]){utils[_0xd3a6('0xa')](_0x5cbef3[_0xd3a6('0x5')])[_0xd3a6('0xb')](function(_0x730125){if(_0x730125){_0x5cbef3[_0xd3a6('0x8')]=_0x730125[_0xd3a6('0xc')];_0x5cbef3[_0xd3a6('0xd')]=_0x730125[_0xd3a6('0xd')];utils[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x5cbef3);}else{utils[_0xd3a6('0x10')](_0x5cbef3['interface'][_0xd3a6('0x11')]('/')[0x1])[_0xd3a6('0xb')](function(_0x454ae7){if(_0x454ae7){_0x5cbef3['membername']=_0x454ae7[_0xd3a6('0xc')];_0x5cbef3[_0xd3a6('0xd')]=_0x454ae7['internal'];utils[_0xd3a6('0xe')]('CreateMemberReport',_0x5cbef3);}});}})['catch'](function(_0x3be485){utils[_0xd3a6('0x12')](_0x3be485);});}delete members[_0x5cbef3['interface']];}function startsWith(_0x557ea2,_0xb23df5){return _[_0xd3a6('0x13')](_0x557ea2,function(_0x1594fd){return _[_0xd3a6('0x14')](_0xb23df5,_0x1594fd);});}exports[_0xd3a6('0x15')]=function(_0x1f6ff3){switch(_0x1f6ff3[_0xd3a6('0x16')]){case _0xd3a6('0x17'):case'BUSY':if(!startsWith(exclude,_0x1f6ff3[_0xd3a6('0x18')])){members[_0x1f6ff3[_0xd3a6('0x18')]]={'channel':_0xd3a6('0x19'),'interface':_0x1f6ff3['device'],'type':_0xd3a6('0x1a'),'enterAt':utils['now'](),'role':_0xd3a6('0x1b')};}break;case _0xd3a6('0x1c'):if(!_['isNil'](members[_0x1f6ff3[_0xd3a6('0x18')]])){members[_0x1f6ff3[_0xd3a6('0x18')]]['exitAt']=utils[_0xd3a6('0x1d')]();members[_0x1f6ff3[_0xd3a6('0x18')]][_0xd3a6('0x1e')]=utils[_0xd3a6('0x1f')](members[_0x1f6ff3[_0xd3a6('0x18')]]['exitAt'],members[_0x1f6ff3[_0xd3a6('0x18')]]['enterAt']);if(members[_0x1f6ff3[_0xd3a6('0x18')]][_0xd3a6('0x20')]){writeDB(members[_0x1f6ff3['device']]);}}default:break;}};exports[_0xd3a6('0x21')]=function(_0x24d866){if(!_['isNil'](members[_0x24d866[_0xd3a6('0x5')]])){members[_0x24d866['interface']]=_['assign'](members[_0x24d866[_0xd3a6('0x5')]],{'data4':_0x24d866[_0xd3a6('0x22')],'uniqueid':_0x24d866[_0xd3a6('0x20')]});}};exports['cdr']=function(_0x1dca8e){if(_0x1dca8e[_0xd3a6('0x6')]){var _0x32960e=_0x1dca8e['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x32960e])){members[_0x32960e]=_[_0xd3a6('0x23')](members[_0x32960e],{'data1':members[_0x32960e][_0xd3a6('0x24')]||_0x1dca8e[_0xd3a6('0x9')],'data2':members[_0x32960e][_0xd3a6('0x7')]||_0x1dca8e[_0xd3a6('0x25')],'data3':members[_0x32960e][_0xd3a6('0x26')]||_0x1dca8e[_0xd3a6('0x27')],'uniqueid':members[_0x32960e][_0xd3a6('0x20')]||_0x1dca8e[_0xd3a6('0x20')]});if(members[_0x32960e][_0xd3a6('0x28')]){writeDB(members[_0x32960e]);}}}if(_0x1dca8e[_0xd3a6('0x29')]){var _0x5705c3=_0x1dca8e[_0xd3a6('0x29')][_0xd3a6('0x11')]('-')[0x0];if(!_[_0xd3a6('0x2a')](members[_0x5705c3])){members[_0x5705c3]=_[_0xd3a6('0x23')](members[_0x5705c3],{'data1':members[_0x5705c3]['data1']||_0x1dca8e[_0xd3a6('0x9')],'data2':members[_0x5705c3]['data2']||_0x1dca8e[_0xd3a6('0x25')],'data3':members[_0x5705c3][_0xd3a6('0x26')]||_0x1dca8e[_0xd3a6('0x27')],'uniqueid':members[_0x5705c3]['uniqueid']||_0x1dca8e[_0xd3a6('0x20')]});if(members[_0x5705c3][_0xd3a6('0x28')]){writeDB(members[_0x5705c3]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 52f1296..503a18a 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 _0x2f76=['queuecallercompleteAt','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstop','musiconholdstartAt','lodash','util','./utils','info','format','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','now','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','toUpperCase','queueposition','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','agentcomplete','membername'];(function(_0x577ab0,_0x5a4f08){var _0x2d0314=function(_0x8febac){while(--_0x8febac){_0x577ab0['push'](_0x577ab0['shift']());}};_0x2d0314(++_0x5a4f08);}(_0x2f76,0x1a5));var _0x62f7=function(_0x34b01d,_0x42cce0){_0x34b01d=_0x34b01d-0x0;var _0xcadf5a=_0x2f76[_0x34b01d];return _0xcadf5a;};'use strict';var _=require(_0x62f7('0x0'));var util=require(_0x62f7('0x1'));var utils=require(_0x62f7('0x2'));var queues={};function writeDB(_0xc317){utils[_0x62f7('0x3')](util[_0x62f7('0x4')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0xc317[_0x62f7('0x5')],_0xc317[_0x62f7('0x6')],_0xc317['queue'],_0xc317[_0x62f7('0x7')],_0xc317[_0x62f7('0x8')],_0xc317[_0x62f7('0x9')],_0xc317[_0x62f7('0xa')]));if(_0xc317['queue']){utils[_0x62f7('0xb')](_0xc317['queue'])[_0x62f7('0xc')](function(_0x1b7adb){if(_0x1b7adb){_0xc317[_0x62f7('0xd')]=_0x1b7adb[_0x62f7('0xd')];}utils[_0x62f7('0xe')]('CreateVoiceQueueReport',_0xc317);});}else{utils[_0x62f7('0xe')](_0x62f7('0xf'),_0xc317);}if(_0xc317[_0x62f7('0x10')]){delete queues[_0xc317[_0x62f7('0x10')]];}else{delete queues[_0xc317['uniqueid']];}}exports['queuecallerjoin']=function(_0x4d7de8){queues[_0x4d7de8[_0x62f7('0x5')]]=_[_0x62f7('0x11')](_0x4d7de8,{'originalposition':_0x4d7de8[_0x62f7('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x62f7('0x13')]=function(_0x4c5f8f){if(!_[_0x62f7('0x14')](queues[_0x4c5f8f[_0x62f7('0x5')]])){if(queues[_0x4c5f8f[_0x62f7('0x5')]][_0x62f7('0x15')]){if(!queues[_0x4c5f8f[_0x62f7('0x5')]][_0x62f7('0x16')]&&!queues[_0x4c5f8f[_0x62f7('0x5')]]['queuecallerexit']){queues[_0x4c5f8f[_0x62f7('0x5')]][_0x62f7('0x17')]=!![];queues[_0x4c5f8f['uniqueid']]['queuecallercompleteAt']=utils[_0x62f7('0x18')]();queues[_0x4c5f8f[_0x62f7('0x5')]][_0x62f7('0xa')]=_0x62f7('0x19');}writeDB(queues[_0x4c5f8f[_0x62f7('0x5')]]);}else{if(queues[_0x4c5f8f[_0x62f7('0x5')]][_0x62f7('0x10')]){queues[queues[_0x4c5f8f[_0x62f7('0x5')]]['transfereduniqueid']]=queues[_0x4c5f8f[_0x62f7('0x5')]];queues[queues[_0x4c5f8f['uniqueid']][_0x62f7('0x10')]][_0x62f7('0x1a')]=0x2;delete queues[_0x4c5f8f['uniqueid']];}}}};exports[_0x62f7('0x1b')]=function(_0x41e42e){if(!_['isNil'](_0x41e42e[_0x62f7('0x1c')]['queuestatus'])){if(!_[_0x62f7('0x14')](queues[_0x41e42e[_0x62f7('0x5')]])){queues[_0x41e42e['uniqueid']]['queuecallerabandon']=![];queues[_0x41e42e[_0x62f7('0x5')]][_0x62f7('0x1d')]=null;queues[_0x41e42e['uniqueid']][_0x62f7('0x1e')]=!![];queues[_0x41e42e[_0x62f7('0x5')]][_0x62f7('0x1f')]=utils[_0x62f7('0x18')]();queues[_0x41e42e[_0x62f7('0x5')]][_0x62f7('0xa')]=_0x41e42e[_0x62f7('0x20')][_0x62f7('0x21')]();writeDB(queues[_0x41e42e[_0x62f7('0x5')]]);}}else if(!_[_0x62f7('0x14')](_0x41e42e[_0x62f7('0x1c')][_0x62f7('0x22')])){if(!_[_0x62f7('0x14')](queues[_0x41e42e[_0x62f7('0x5')]])&&!queues[_0x41e42e['uniqueid']][_0x62f7('0x16')]){queues[_0x41e42e[_0x62f7('0x5')]]['queuecallerabandon']=![];queues[_0x41e42e[_0x62f7('0x5')]][_0x62f7('0x1d')]=null;queues[_0x41e42e[_0x62f7('0x5')]]['queuecallerexit']=!![];queues[_0x41e42e[_0x62f7('0x5')]][_0x62f7('0x1f')]=utils[_0x62f7('0x18')]();queues[_0x41e42e[_0x62f7('0x5')]][_0x62f7('0xa')]='EXITWITHKEY';}}};exports['queuecallerabandon']=function(_0x455e2a){if(!_[_0x62f7('0x14')](queues[_0x455e2a[_0x62f7('0x5')]])){queues[_0x455e2a['uniqueid']][_0x62f7('0x1e')]=![];queues[_0x455e2a[_0x62f7('0x5')]][_0x62f7('0x1f')]=null;queues[_0x455e2a['uniqueid']][_0x62f7('0x16')]=!![];queues[_0x455e2a[_0x62f7('0x5')]][_0x62f7('0x1d')]=utils['now']();queues[_0x455e2a[_0x62f7('0x5')]]['queuecallerexitreason']=_0x62f7('0x23');}};exports[_0x62f7('0x24')]=function(_0x581956){if(!_[_0x62f7('0x14')](queues[_0x581956[_0x62f7('0x5')]])){queues[_0x581956[_0x62f7('0x5')]][_0x62f7('0x24')]=!![];queues[_0x581956[_0x62f7('0x5')]][_0x62f7('0x15')]=utils['now']();queues[_0x581956['uniqueid']][_0x62f7('0x25')]=utils[_0x62f7('0x26')](queues[_0x581956[_0x62f7('0x5')]][_0x62f7('0x15')],queues[_0x581956['uniqueid']]['queuecallerjoinAt']);queues[_0x581956[_0x62f7('0x5')]]['position']=_0x581956[_0x62f7('0x12')];queues[_0x581956[_0x62f7('0x5')]]['count']=_0x581956[_0x62f7('0x27')];queues[_0x581956[_0x62f7('0x5')]]['connectedlinenum']=_0x581956[_0x62f7('0x28')];queues[_0x581956[_0x62f7('0x5')]][_0x62f7('0x29')]=_0x581956[_0x62f7('0x29')];}};exports[_0x62f7('0x2a')]=function(_0x20409e){if(!_[_0x62f7('0x14')](queues[_0x20409e[_0x62f7('0x5')]])){queues[_0x20409e['uniqueid']][_0x62f7('0x16')]=![];queues[_0x20409e['uniqueid']]['queuecallerabandon']=![];queues[_0x20409e[_0x62f7('0x5')]][_0x62f7('0x1d')]=null;queues[_0x20409e[_0x62f7('0x5')]][_0x62f7('0x1e')]=![];queues[_0x20409e[_0x62f7('0x5')]][_0x62f7('0x1f')]=null;queues[_0x20409e['uniqueid']][_0x62f7('0x2b')]=!![];queues[_0x20409e[_0x62f7('0x5')]][_0x62f7('0x9')]=_0x20409e[_0x62f7('0x2c')];queues[_0x20409e[_0x62f7('0x5')]][_0x62f7('0x7')]=_0x20409e['membername'];}};exports[_0x62f7('0x2d')]=function(_0x340e76){if(!_['isNil'](queues[_0x340e76['uniqueid']])){if(queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0x15')]){queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0x16')]=![];queues[_0x340e76[_0x62f7('0x5')]]['queuecallerabandon']=![];queues[_0x340e76['uniqueid']][_0x62f7('0x1d')]=null;queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0x1e')]=![];queues[_0x340e76[_0x62f7('0x5')]]['queuecallerexitAt']=null;queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0x2b')]=!![];queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0x7')]=_0x340e76[_0x62f7('0x2e')];queues[_0x340e76[_0x62f7('0x5')]]['queuecallercomplete']=!![];queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0x2f')]=utils[_0x62f7('0x18')]();if(_0x340e76[_0x62f7('0x30')]==_0x62f7('0x31')){if(!queues[_0x340e76[_0x62f7('0x5')]]['transfer']){queues[_0x340e76[_0x62f7('0x5')]][_0x62f7('0xa')]='TRANSFER';}}else{queues[_0x340e76[_0x62f7('0x5')]]['queuecallerexitreason']=_0x62f7('0x32')+_0x340e76[_0x62f7('0x30')][_0x62f7('0x21')]();}writeDB(queues[_0x340e76['uniqueid']]);}}};exports[_0x62f7('0x33')]=function(_0x58bccf){if(!_['isNil'](queues[_0x58bccf[_0x62f7('0x34')]])){queues[_0x58bccf[_0x62f7('0x34')]][_0x62f7('0x31')]=!![];queues[_0x58bccf[_0x62f7('0x34')]][_0x62f7('0x35')]=_0x62f7('0x36');queues[_0x58bccf[_0x62f7('0x34')]][_0x62f7('0x37')]=_0x58bccf[_0x62f7('0x38')];queues[_0x58bccf['transfereeuniqueid']][_0x62f7('0x39')]=_0x58bccf[_0x62f7('0x34')];queues[_0x58bccf[_0x62f7('0x34')]][_0x62f7('0xa')]=_0x62f7('0x3a');}};exports['attendedtransfer']=function(_0x3994f3){try{if(_0x3994f3['origtransfereruniqueid']==_0x3994f3[_0x62f7('0x3b')]){if(!_[_0x62f7('0x14')](queues[_0x3994f3[_0x62f7('0x3c')]])){queues[_0x3994f3['secondtransfererlinkedid']][_0x62f7('0x31')]=!![];queues[_0x3994f3[_0x62f7('0x3c')]][_0x62f7('0x35')]=_0x62f7('0x3d');queues[_0x3994f3[_0x62f7('0x3c')]][_0x62f7('0x37')]=_0x3994f3[_0x62f7('0x3e')];queues[_0x3994f3[_0x62f7('0x3c')]][_0x62f7('0x39')]=_0x3994f3[_0x62f7('0x3f')];queues[_0x3994f3['secondtransfererlinkedid']][_0x62f7('0xa')]=_0x62f7('0x40');}if(!_[_0x62f7('0x14')](queues[_0x3994f3['origtransfererlinkedid']])){if(_0x3994f3[_0x62f7('0x41')]&&queues[_0x3994f3[_0x62f7('0x41')]]){queues[_0x3994f3['transfereelinkedid']][_0x62f7('0x1a')]=0x1;queues[_0x3994f3['transfereeuniqueid']]=_[_0x62f7('0x42')](queues[_0x3994f3[_0x62f7('0x41')]]);queues[_0x3994f3['transfereeuniqueid']]['transfereduniqueid']=_0x3994f3[_0x62f7('0x43')];queues[_0x3994f3['transfereeuniqueid']][_0x62f7('0x1a')]=0x2;queues[_0x3994f3[_0x62f7('0x34')]][_0x62f7('0x8')]=queues[_0x3994f3[_0x62f7('0x3c')]]['calleridnum'];queues[_0x3994f3['transfereeuniqueid']][_0x62f7('0x44')]=queues[_0x3994f3[_0x62f7('0x3c')]][_0x62f7('0x44')];queues[_0x3994f3[_0x62f7('0x34')]][_0x62f7('0x45')]=utils[_0x62f7('0x18')]();queues[_0x3994f3['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x62f7('0x18')]();queues[_0x3994f3[_0x62f7('0x34')]][_0x62f7('0x25')]=0x0;queues[_0x3994f3[_0x62f7('0x34')]][_0x62f7('0x46')]=0x0;}else{queues[_0x3994f3[_0x62f7('0x3b')]][_0x62f7('0x10')]=_0x3994f3[_0x62f7('0x3c')];}}}else if(_0x3994f3[_0x62f7('0x47')]==_0x3994f3['secondtransfererlinkedid']){if(!_[_0x62f7('0x14')](queues[_0x3994f3[_0x62f7('0x3b')]])){queues[_0x3994f3[_0x62f7('0x3b')]][_0x62f7('0x31')]=!![];queues[_0x3994f3[_0x62f7('0x3b')]]['transfertype']=_0x62f7('0x3d');queues[_0x3994f3[_0x62f7('0x3b')]]['transferexten']=_0x3994f3[_0x62f7('0x48')];queues[_0x3994f3[_0x62f7('0x3b')]]['transferuniqueid']=_0x3994f3['secondtransfereruniqueid'];queues[_0x3994f3['origtransfererlinkedid']][_0x62f7('0xa')]=_0x62f7('0x40');}if(!_[_0x62f7('0x14')](queues[_0x3994f3[_0x62f7('0x3c')]])){if(_0x3994f3[_0x62f7('0x49')]&&queues[_0x3994f3[_0x62f7('0x49')]]){queues[_0x3994f3['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x3994f3['transfertargetuniqueid']]=_['clone'](queues[_0x3994f3['transfertargetlinkedid']]);queues[_0x3994f3[_0x62f7('0x43')]][_0x62f7('0x10')]=_0x3994f3[_0x62f7('0x43')];queues[_0x3994f3[_0x62f7('0x43')]][_0x62f7('0x1a')]=0x2;queues[_0x3994f3[_0x62f7('0x43')]][_0x62f7('0x8')]=queues[_0x3994f3[_0x62f7('0x3b')]][_0x62f7('0x8')];queues[_0x3994f3[_0x62f7('0x43')]][_0x62f7('0x44')]=queues[_0x3994f3[_0x62f7('0x3b')]][_0x62f7('0x44')];queues[_0x3994f3['transfertargetuniqueid']][_0x62f7('0x45')]=utils[_0x62f7('0x18')]();queues[_0x3994f3['transfertargetuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x3994f3[_0x62f7('0x43')]][_0x62f7('0x25')]=0x0;queues[_0x3994f3['transfertargetuniqueid']][_0x62f7('0x46')]=0x0;}else{queues[_0x3994f3[_0x62f7('0x3c')]][_0x62f7('0x10')]=_0x3994f3['origtransfererlinkedid'];}}}}catch(_0x23b6b8){utils[_0x62f7('0x4a')](_0x23b6b8[_0x62f7('0x4b')]);}};exports['musiconholdstart']=function(_0x4a4e28){if(!_['isNil'](queues[_0x4a4e28['uniqueid']])){queues[_0x4a4e28[_0x62f7('0x5')]]['musiconholdstartAt']=utils[_0x62f7('0x18')]();}};exports[_0x62f7('0x4c')]=function(_0x582654){if(!_[_0x62f7('0x14')](queues[_0x582654['uniqueid']])){if(!_[_0x62f7('0x14')](queues[_0x582654[_0x62f7('0x5')]][_0x62f7('0x4d')])){queues[_0x582654[_0x62f7('0x5')]][_0x62f7('0x46')]+=utils['diffTime'](utils['now'](),queues[_0x582654[_0x62f7('0x5')]]['musiconholdstartAt']);delete queues[_0x582654[_0x62f7('0x5')]][_0x62f7('0x4d')];}}}; \ No newline at end of file +var _0xc551=['transfer','COMPLETEDBY','reason','toUpperCase','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfertype','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','ATTENDED','secondtransfererexten','transfertargetlinkedid','clone','error','stack','musiconholdstart','musiconholdstop','musiconholdstartAt','lodash','./utils','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','hangup','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','varset','isNil','variable','queuestatus','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','agentcomplete','membername'];(function(_0x545167,_0x3c7e72){var _0x5c86c9=function(_0x5cc61c){while(--_0x5cc61c){_0x545167['push'](_0x545167['shift']());}};_0x5c86c9(++_0x3c7e72);}(_0xc551,0xbd));var _0x1c55=function(_0x1764b2,_0x2bf42b){_0x1764b2=_0x1764b2-0x0;var _0x3aa229=_0xc551[_0x1764b2];return _0x3aa229;};'use strict';var _=require(_0x1c55('0x0'));var util=require('util');var utils=require(_0x1c55('0x1'));var queues={};function writeDB(_0x486de6){utils[_0x1c55('0x2')](util['format'](_0x1c55('0x3'),_0x486de6[_0x1c55('0x4')],_0x486de6[_0x1c55('0x5')],_0x486de6[_0x1c55('0x6')],_0x486de6[_0x1c55('0x7')],_0x486de6[_0x1c55('0x8')],_0x486de6[_0x1c55('0x9')],_0x486de6['queuecallerexitreason']));if(_0x486de6[_0x1c55('0x6')]){utils['getVoiceQueueByName'](_0x486de6[_0x1c55('0x6')])[_0x1c55('0xa')](function(_0x4f4766){if(_0x4f4766){_0x486de6['type']=_0x4f4766[_0x1c55('0xb')];}utils[_0x1c55('0xc')](_0x1c55('0xd'),_0x486de6);});}else{utils['request'](_0x1c55('0xd'),_0x486de6);}if(_0x486de6[_0x1c55('0xe')]){delete queues[_0x486de6[_0x1c55('0xe')]];}else{delete queues[_0x486de6['uniqueid']];}}exports[_0x1c55('0xf')]=function(_0x4f61d5){queues[_0x4f61d5[_0x1c55('0x4')]]=_[_0x1c55('0x10')](_0x4f61d5,{'originalposition':_0x4f61d5[_0x1c55('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x1c55('0x12')]=function(_0x1298a7){if(!_['isNil'](queues[_0x1298a7[_0x1c55('0x4')]])){if(queues[_0x1298a7[_0x1c55('0x4')]][_0x1c55('0x13')]){if(!queues[_0x1298a7[_0x1c55('0x4')]][_0x1c55('0x14')]&&!queues[_0x1298a7[_0x1c55('0x4')]]['queuecallerexit']){queues[_0x1298a7[_0x1c55('0x4')]][_0x1c55('0x15')]=!![];queues[_0x1298a7[_0x1c55('0x4')]][_0x1c55('0x16')]=utils[_0x1c55('0x17')]();queues[_0x1298a7[_0x1c55('0x4')]][_0x1c55('0x18')]=_0x1c55('0x19');}writeDB(queues[_0x1298a7[_0x1c55('0x4')]]);}else{if(queues[_0x1298a7['uniqueid']][_0x1c55('0xe')]){queues[queues[_0x1298a7['uniqueid']][_0x1c55('0xe')]]=queues[_0x1298a7['uniqueid']];queues[queues[_0x1298a7[_0x1c55('0x4')]][_0x1c55('0xe')]][_0x1c55('0x1a')]=0x2;delete queues[_0x1298a7[_0x1c55('0x4')]];}}}};exports[_0x1c55('0x1b')]=function(_0x2bd3a8){if(!_[_0x1c55('0x1c')](_0x2bd3a8[_0x1c55('0x1d')][_0x1c55('0x1e')])){if(!_[_0x1c55('0x1c')](queues[_0x2bd3a8['uniqueid']])){queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x14')]=![];queues[_0x2bd3a8['uniqueid']][_0x1c55('0x1f')]=null;queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x20')]=!![];queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x21')]=utils['now']();queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x18')]=_0x2bd3a8[_0x1c55('0x22')]['toUpperCase']();writeDB(queues[_0x2bd3a8[_0x1c55('0x4')]]);}}else if(!_[_0x1c55('0x1c')](_0x2bd3a8[_0x1c55('0x1d')]['queueposition'])){if(!_['isNil'](queues[_0x2bd3a8[_0x1c55('0x4')]])&&!queues[_0x2bd3a8['uniqueid']][_0x1c55('0x14')]){queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x14')]=![];queues[_0x2bd3a8[_0x1c55('0x4')]]['queuecallerabandonAt']=null;queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x20')]=!![];queues[_0x2bd3a8[_0x1c55('0x4')]]['queuecallerexitAt']=utils[_0x1c55('0x17')]();queues[_0x2bd3a8[_0x1c55('0x4')]][_0x1c55('0x18')]=_0x1c55('0x23');}}};exports[_0x1c55('0x14')]=function(_0x11fbd9){if(!_[_0x1c55('0x1c')](queues[_0x11fbd9[_0x1c55('0x4')]])){queues[_0x11fbd9[_0x1c55('0x4')]]['queuecallerexit']=![];queues[_0x11fbd9[_0x1c55('0x4')]]['queuecallerexitAt']=null;queues[_0x11fbd9[_0x1c55('0x4')]][_0x1c55('0x14')]=!![];queues[_0x11fbd9[_0x1c55('0x4')]][_0x1c55('0x1f')]=utils['now']();queues[_0x11fbd9[_0x1c55('0x4')]][_0x1c55('0x18')]=_0x1c55('0x24');}};exports[_0x1c55('0x25')]=function(_0x2d2227){if(!_[_0x1c55('0x1c')](queues[_0x2d2227['uniqueid']])){queues[_0x2d2227[_0x1c55('0x4')]]['queuecallerleave']=!![];queues[_0x2d2227[_0x1c55('0x4')]][_0x1c55('0x13')]=utils['now']();queues[_0x2d2227[_0x1c55('0x4')]][_0x1c55('0x26')]=utils[_0x1c55('0x27')](queues[_0x2d2227[_0x1c55('0x4')]]['queuecallerleaveAt'],queues[_0x2d2227['uniqueid']]['queuecallerjoinAt']);queues[_0x2d2227[_0x1c55('0x4')]][_0x1c55('0x11')]=_0x2d2227[_0x1c55('0x11')];queues[_0x2d2227[_0x1c55('0x4')]]['count']=_0x2d2227[_0x1c55('0x28')];queues[_0x2d2227['uniqueid']]['connectedlinenum']=_0x2d2227[_0x1c55('0x29')];queues[_0x2d2227[_0x1c55('0x4')]][_0x1c55('0x2a')]=_0x2d2227['connectedlinename'];}};exports[_0x1c55('0x2b')]=function(_0x2054b6){if(!_[_0x1c55('0x1c')](queues[_0x2054b6[_0x1c55('0x4')]])){queues[_0x2054b6[_0x1c55('0x4')]]['queuecallerabandon']=![];queues[_0x2054b6[_0x1c55('0x4')]][_0x1c55('0x14')]=![];queues[_0x2054b6[_0x1c55('0x4')]][_0x1c55('0x1f')]=null;queues[_0x2054b6['uniqueid']]['queuecallerexit']=![];queues[_0x2054b6[_0x1c55('0x4')]][_0x1c55('0x21')]=null;queues[_0x2054b6[_0x1c55('0x4')]][_0x1c55('0x2c')]=!![];queues[_0x2054b6['uniqueid']][_0x1c55('0x9')]=_0x2054b6[_0x1c55('0x2d')];queues[_0x2054b6[_0x1c55('0x4')]]['lastAssignedTo']=_0x2054b6['membername'];}};exports[_0x1c55('0x2e')]=function(_0xdb82c6){if(!_[_0x1c55('0x1c')](queues[_0xdb82c6[_0x1c55('0x4')]])){if(queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x13')]){queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x14')]=![];queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x14')]=![];queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x1f')]=null;queues[_0xdb82c6[_0x1c55('0x4')]]['queuecallerexit']=![];queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x21')]=null;queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x2c')]=!![];queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x7')]=_0xdb82c6[_0x1c55('0x2f')];queues[_0xdb82c6[_0x1c55('0x4')]]['queuecallercomplete']=!![];queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x16')]=utils[_0x1c55('0x17')]();if(_0xdb82c6['reason']==_0x1c55('0x30')){if(!queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x30')]){queues[_0xdb82c6[_0x1c55('0x4')]][_0x1c55('0x18')]='TRANSFER';}}else{queues[_0xdb82c6['uniqueid']][_0x1c55('0x18')]=_0x1c55('0x31')+_0xdb82c6[_0x1c55('0x32')][_0x1c55('0x33')]();}writeDB(queues[_0xdb82c6['uniqueid']]);}}};exports[_0x1c55('0x34')]=function(_0x379739){if(!_[_0x1c55('0x1c')](queues[_0x379739[_0x1c55('0x35')]])){queues[_0x379739[_0x1c55('0x35')]][_0x1c55('0x30')]=!![];queues[_0x379739['transfereeuniqueid']]['transfertype']=_0x1c55('0x36');queues[_0x379739['transfereeuniqueid']][_0x1c55('0x37')]=_0x379739['extension'];queues[_0x379739['transfereeuniqueid']][_0x1c55('0x38')]=_0x379739[_0x1c55('0x35')];queues[_0x379739['transfereeuniqueid']]['queuecallerexitreason']=_0x1c55('0x39');}};exports[_0x1c55('0x3a')]=function(_0x266096){try{if(_0x266096[_0x1c55('0x3b')]==_0x266096[_0x1c55('0x3c')]){if(!_[_0x1c55('0x1c')](queues[_0x266096[_0x1c55('0x3d')]])){queues[_0x266096[_0x1c55('0x3d')]][_0x1c55('0x30')]=!![];queues[_0x266096[_0x1c55('0x3d')]][_0x1c55('0x3e')]='ATTENDED';queues[_0x266096[_0x1c55('0x3d')]][_0x1c55('0x37')]=_0x266096[_0x1c55('0x3f')];queues[_0x266096[_0x1c55('0x3d')]][_0x1c55('0x38')]=_0x266096[_0x1c55('0x3b')];queues[_0x266096['secondtransfererlinkedid']][_0x1c55('0x18')]=_0x1c55('0x40');}if(!_[_0x1c55('0x1c')](queues[_0x266096['origtransfererlinkedid']])){if(_0x266096[_0x1c55('0x41')]&&queues[_0x266096[_0x1c55('0x41')]]){queues[_0x266096[_0x1c55('0x41')]][_0x1c55('0x1a')]=0x1;queues[_0x266096['transfereeuniqueid']]=_['clone'](queues[_0x266096[_0x1c55('0x41')]]);queues[_0x266096[_0x1c55('0x35')]][_0x1c55('0xe')]=_0x266096[_0x1c55('0x42')];queues[_0x266096[_0x1c55('0x35')]][_0x1c55('0x1a')]=0x2;queues[_0x266096[_0x1c55('0x35')]][_0x1c55('0x8')]=queues[_0x266096[_0x1c55('0x3d')]][_0x1c55('0x8')];queues[_0x266096['transfereeuniqueid']][_0x1c55('0x43')]=queues[_0x266096['secondtransfererlinkedid']][_0x1c55('0x43')];queues[_0x266096['transfereeuniqueid']][_0x1c55('0x44')]=utils[_0x1c55('0x17')]();queues[_0x266096['transfereeuniqueid']][_0x1c55('0x13')]=utils['now']();queues[_0x266096[_0x1c55('0x35')]][_0x1c55('0x26')]=0x0;queues[_0x266096[_0x1c55('0x35')]][_0x1c55('0x45')]=0x0;}else{queues[_0x266096[_0x1c55('0x3c')]][_0x1c55('0xe')]=_0x266096[_0x1c55('0x3d')];}}}else if(_0x266096['secondtransfereruniqueid']==_0x266096[_0x1c55('0x3d')]){if(!_['isNil'](queues[_0x266096[_0x1c55('0x3c')]])){queues[_0x266096['origtransfererlinkedid']][_0x1c55('0x30')]=!![];queues[_0x266096[_0x1c55('0x3c')]][_0x1c55('0x3e')]=_0x1c55('0x46');queues[_0x266096['origtransfererlinkedid']]['transferexten']=_0x266096[_0x1c55('0x47')];queues[_0x266096[_0x1c55('0x3c')]][_0x1c55('0x38')]=_0x266096['secondtransfereruniqueid'];queues[_0x266096[_0x1c55('0x3c')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x1c55('0x1c')](queues[_0x266096['secondtransfererlinkedid']])){if(_0x266096['transfertargetlinkedid']&&queues[_0x266096[_0x1c55('0x48')]]){queues[_0x266096[_0x1c55('0x48')]][_0x1c55('0x1a')]=0x1;queues[_0x266096[_0x1c55('0x42')]]=_[_0x1c55('0x49')](queues[_0x266096[_0x1c55('0x48')]]);queues[_0x266096[_0x1c55('0x42')]][_0x1c55('0xe')]=_0x266096[_0x1c55('0x42')];queues[_0x266096[_0x1c55('0x42')]]['queuecallerenterreason']=0x2;queues[_0x266096[_0x1c55('0x42')]][_0x1c55('0x8')]=queues[_0x266096[_0x1c55('0x3c')]]['calleridnum'];queues[_0x266096[_0x1c55('0x42')]][_0x1c55('0x43')]=queues[_0x266096[_0x1c55('0x3c')]]['calleridname'];queues[_0x266096['transfertargetuniqueid']][_0x1c55('0x44')]=utils['now']();queues[_0x266096[_0x1c55('0x42')]][_0x1c55('0x13')]=utils['now']();queues[_0x266096[_0x1c55('0x42')]]['holdtime']=0x0;queues[_0x266096[_0x1c55('0x42')]]['mohtime']=0x0;}else{queues[_0x266096[_0x1c55('0x3d')]][_0x1c55('0xe')]=_0x266096['origtransfererlinkedid'];}}}}catch(_0x39548c){utils[_0x1c55('0x4a')](_0x39548c[_0x1c55('0x4b')]);}};exports[_0x1c55('0x4c')]=function(_0x59fb6a){if(!_['isNil'](queues[_0x59fb6a[_0x1c55('0x4')]])){queues[_0x59fb6a[_0x1c55('0x4')]]['musiconholdstartAt']=utils[_0x1c55('0x17')]();}};exports[_0x1c55('0x4d')]=function(_0x35fea5){if(!_['isNil'](queues[_0x35fea5['uniqueid']])){if(!_[_0x1c55('0x1c')](queues[_0x35fea5[_0x1c55('0x4')]][_0x1c55('0x4e')])){queues[_0x35fea5[_0x1c55('0x4')]][_0x1c55('0x45')]+=utils[_0x1c55('0x27')](utils[_0x1c55('0x17')](),queues[_0x35fea5['uniqueid']]['musiconholdstartAt']);delete queues[_0x35fea5['uniqueid']][_0x1c55('0x4e')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 40d98ed..93a0fb9 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 _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x1f34c5,_0x52c6a8){var _0x4d0642=function(_0x5c71a0){while(--_0x5c71a0){_0x1f34c5['push'](_0x1f34c5['shift']());}};_0x4d0642(++_0x52c6a8);}(_0x70e0,0x17b));var _0x070e=function(_0x2c3fde,_0x1c8960){_0x2c3fde=_0x2c3fde-0x0;var _0x120f82=_0x70e0[_0x2c3fde];return _0x120f82;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file +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(_0x2afd8d,_0x2ef469){var _0x361b60=function(_0x1886a6){while(--_0x1886a6){_0x2afd8d['push'](_0x2afd8d['shift']());}};_0x361b60(++_0x2ef469);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0xcb91[_0x14d896];return _0x28679a;};'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 diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index cb7b23d..a414c51 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 _0x5d01=['transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','format','TRANSFER|%s','CreateVoiceTransferReport','blindtransfer','type','blind','error','stack','assign','origtransferercalleridnum','origtransferercalleridname','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x4ade47,_0x42580f){var _0x2e68ee=function(_0x2377d3){while(--_0x2377d3){_0x4ade47['push'](_0x4ade47['shift']());}};_0x2e68ee(++_0x42580f);}(_0x5d01,0xe5));var _0x15d0=function(_0x2df442,_0x1f4fc2){_0x2df442=_0x2df442-0x0;var _0x1d25d3=_0x5d01[_0x2df442];return _0x1d25d3;};'use strict';var _=require(_0x15d0('0x0'));var util=require('util');var utils=require(_0x15d0('0x1'));function writeDB(_0x451b82){utils['info'](util[_0x15d0('0x2')](_0x15d0('0x3'),_0x451b82['type']));utils['request'](_0x15d0('0x4'),_0x451b82);}exports[_0x15d0('0x5')]=function(_0x451111){try{_0x451111[_0x15d0('0x6')]=_0x15d0('0x7');writeDB(_0x451111);}catch(_0x38d2f4){utils[_0x15d0('0x8')](_0x38d2f4[_0x15d0('0x9')]);}};exports['attendedtransfer']=function(_0x14a682){try{_0x14a682=_[_0x15d0('0xa')](_0x14a682,{'transfererchannel':_0x14a682['origtransfererchannel'],'transferercalleridnum':_0x14a682[_0x15d0('0xb')],'transferercalleridname':_0x14a682[_0x15d0('0xc')],'transfererconnectedlinenum':_0x14a682['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x14a682['secondtransfererconnectedlinename'],'transfereraccountcode':_0x14a682['origtransfereraccountcode'],'transferercontext':_0x14a682[_0x15d0('0xd')],'transfererexten':_0x14a682[_0x15d0('0xe')],'transfererlinkedid':_0x14a682[_0x15d0('0xf')],'context':_0x14a682[_0x15d0('0x10')],'extension':_0x14a682['origtransfererexten'],'type':_0x15d0('0x11')});if(_[_0x15d0('0x12')](_0x14a682[_0x15d0('0x13')])){_0x14a682=_[_0x15d0('0xa')](_0x14a682,{'transfereechannel':_0x14a682[_0x15d0('0x14')],'transfereecalleridnum':_0x14a682[_0x15d0('0x15')],'transfereecalleridname':_0x14a682[_0x15d0('0x16')],'transfereeconnectedlinenum':_0x14a682[_0x15d0('0x17')],'transfereeconnectedlinename':_0x14a682['transfertargetconnectedlinename'],'transfereeaccountcode':_0x14a682[_0x15d0('0x18')],'transfereecontext':_0x14a682[_0x15d0('0x19')],'transfereeexten':_0x14a682[_0x15d0('0x1a')],'transfereelinkedid':_0x14a682[_0x15d0('0x1b')]});}writeDB(_0x14a682);}catch(_0x3613e6){utils[_0x15d0('0x8')](_0x3613e6[_0x15d0('0x9')]);}}; \ No newline at end of file +var _0xa671=['util','./utils','info','type','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa671,0x1a4));var _0x1a67=function(_0x347d95,_0x2d161b){_0x347d95=_0x347d95-0x0;var _0x1a5e53=_0xa671[_0x347d95];return _0x1a5e53;};'use strict';var _=require('lodash');var util=require(_0x1a67('0x0'));var utils=require(_0x1a67('0x1'));function writeDB(_0xb7957c){utils[_0x1a67('0x2')](util['format']('TRANSFER|%s',_0xb7957c[_0x1a67('0x3')]));utils['request'](_0x1a67('0x4'),_0xb7957c);}exports[_0x1a67('0x5')]=function(_0x31394f){try{_0x31394f[_0x1a67('0x3')]=_0x1a67('0x6');writeDB(_0x31394f);}catch(_0x5a5821){utils[_0x1a67('0x7')](_0x5a5821[_0x1a67('0x8')]);}};exports[_0x1a67('0x9')]=function(_0x2c907d){try{_0x2c907d=_[_0x1a67('0xa')](_0x2c907d,{'transfererchannel':_0x2c907d[_0x1a67('0xb')],'transferercalleridnum':_0x2c907d[_0x1a67('0xc')],'transferercalleridname':_0x2c907d[_0x1a67('0xd')],'transfererconnectedlinenum':_0x2c907d[_0x1a67('0xe')],'transfererconnectedlinename':_0x2c907d[_0x1a67('0xf')],'transfereraccountcode':_0x2c907d[_0x1a67('0x10')],'transferercontext':_0x2c907d[_0x1a67('0x11')],'transfererexten':_0x2c907d[_0x1a67('0x12')],'transfererlinkedid':_0x2c907d[_0x1a67('0x13')],'context':_0x2c907d['origtransferercontext'],'extension':_0x2c907d[_0x1a67('0x14')],'type':_0x1a67('0x15')});if(_[_0x1a67('0x16')](_0x2c907d['transfereechannel'])){_0x2c907d=_['assign'](_0x2c907d,{'transfereechannel':_0x2c907d[_0x1a67('0x17')],'transfereecalleridnum':_0x2c907d['transfertargetcalleridnum'],'transfereecalleridname':_0x2c907d[_0x1a67('0x18')],'transfereeconnectedlinenum':_0x2c907d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2c907d[_0x1a67('0x19')],'transfereeaccountcode':_0x2c907d['transfertargetaccountcode'],'transfereecontext':_0x2c907d[_0x1a67('0x1a')],'transfereeexten':_0x2c907d['transfertargetexten'],'transfereelinkedid':_0x2c907d[_0x1a67('0x1b')]});}writeDB(_0x2c907d);}catch(_0x3fdcf1){utils['error'](_0x3fdcf1['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f98e4f1..eaca075 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 _0xb7fd=['then','catch','GetUser','internal','interface','info','GETUSER|','result','length','FOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','GETVOICEQUEUEBYNAME|','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','client','../../config/logger','xdr','debug','stringify','error','stack','request'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xb7fd,0x128));var _0xdb7f=function(_0x9a1d9e,_0x40f7eb){_0x9a1d9e=_0x9a1d9e-0x0;var _0x3f3bb1=_0xb7fd[_0x9a1d9e];return _0x3f3bb1;};'use strict';var jayson=require('jayson/promise');var moment=require('moment');var BPromise=require('bluebird');var client=jayson[_0xdb7f('0x0')]['http']({'port':0x2329});var logger=require(_0xdb7f('0x1'))(_0xdb7f('0x2'));exports['info']=function(_0x14969f){logger['info'](_0x14969f);};exports[_0xdb7f('0x3')]=function(_0x34b1eb){logger[_0xdb7f('0x3')](JSON[_0xdb7f('0x4')](_0x34b1eb));};exports[_0xdb7f('0x5')]=function(_0x9e25fa){logger['error'](_0x9e25fa[_0xdb7f('0x6')]);};exports[_0xdb7f('0x7')]=function(_0x9ab0aa,_0x7d519d){return client['request'](_0x9ab0aa,{'body':_0x7d519d})[_0xdb7f('0x8')](function(_0x35776a){logger['debug'](JSON['stringify'](_0x35776a));})[_0xdb7f('0x9')](function(_0x1dcc51){logger[_0xdb7f('0x5')](_0x1dcc51[_0xdb7f('0x6')]);});};function getUser(_0x588a77){return client[_0xdb7f('0x7')](_0xdb7f('0xa'),{'options':{'raw':!![],'attributes':['id',_0xdb7f('0xb'),'name',_0xdb7f('0xc')],'where':_0x588a77,'limit':0x1}})[_0xdb7f('0x8')](function(_0x4ef10b){logger[_0xdb7f('0xd')](_0xdb7f('0xe')+JSON['stringify'](_0x588a77)+'|'+(_0x4ef10b[_0xdb7f('0xf')][_0xdb7f('0x10')]?_0xdb7f('0x11'):'NOTFOUND'));return _0x4ef10b[_0xdb7f('0xf')][_0xdb7f('0x10')]?_0x4ef10b[_0xdb7f('0xf')][0x0]:null;});}exports[_0xdb7f('0x12')]=function(_0x36247a){return new BPromise(function(_0x3ac83e,_0x2f45b0){if(_0x36247a){return getUser({'internal':_0x36247a})['then'](function(_0x16a38b){return _0x3ac83e(_0x16a38b);})[_0xdb7f('0x9')](function(_0x1bf0dc){logger['error'](_0x1bf0dc['stack']);return _0x3ac83e(null);});}else{return _0x3ac83e(null);}});};exports[_0xdb7f('0x13')]=function(_0x2dd16e){return new BPromise(function(_0x2b1f9b,_0x357479){if(_0x2dd16e){return getUser({'interface':_0x2dd16e})[_0xdb7f('0x8')](function(_0x341bfb){return _0x2b1f9b(_0x341bfb);})[_0xdb7f('0x9')](function(_0x43e99c){logger['error'](_0x43e99c['stack']);return _0x2b1f9b(null);});}else{return _0x2b1f9b(null);}});};exports[_0xdb7f('0x14')]=function(_0x2fefc7){return new BPromise(function(_0x35c379,_0xfa6232){if(_0x2fefc7){return getUser({'name':_0x2fefc7})['then'](function(_0x3fde6a){return _0x35c379(_0x3fde6a);})['catch'](function(_0x2b4c44){logger[_0xdb7f('0x5')](_0x2b4c44[_0xdb7f('0x6')]);return _0x35c379(null);});}else{return _0x35c379(null);}});};exports[_0xdb7f('0x15')]=function(_0x521d01){return new BPromise(function(_0x59ac64,_0x1165ef){if(_0x521d01){return client['request'](_0xdb7f('0x16'),{'options':{'raw':!![],'attributes':['id','name',_0xdb7f('0x17'),'acw',_0xdb7f('0x18')],'where':{'name':_0x521d01},'limit':0x1}})[_0xdb7f('0x8')](function(_0x2a5745){logger['info'](_0xdb7f('0x19')+_0x521d01+'|'+(_0x2a5745['result'][_0xdb7f('0x10')]?'FOUND':'NOTFOUND'));return _0x59ac64(_0x2a5745['result'][_0xdb7f('0x10')]?_0x2a5745['result'][0x0]:null);})[_0xdb7f('0x9')](function(_0x262ef8){logger[_0xdb7f('0x5')](_0x262ef8[_0xdb7f('0x6')]);return _0x59ac64(null);});}else{return _0x59ac64(null);}});};exports['addTime']=function(_0xddbbc2,_0x267a2a){return moment(_0xddbbc2)[_0xdb7f('0x1a')](_0x267a2a,_0xdb7f('0x1b'))[_0xdb7f('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdb7f('0x1d')]=function(_0x168ddd,_0x54572d){return moment(_0x168ddd)[_0xdb7f('0x1e')](_0x54572d,_0xdb7f('0x1b'))[_0xdb7f('0x1c')](_0xdb7f('0x1f'));};exports[_0xdb7f('0x20')]=function(_0x3edf2a,_0x4feb07){return moment(_0x3edf2a)[_0xdb7f('0x21')](moment(_0x4feb07),_0xdb7f('0x1b'));};exports[_0xdb7f('0x22')]=function(_0x7022f0,_0x32de72){return parseInt(_0x7022f0,0xa)+parseInt(_0x32de72,0xa);};exports[_0xdb7f('0x23')]=function(){return moment()[_0xdb7f('0x1c')](_0xdb7f('0x1f'));};exports[_0xdb7f('0x24')]=function(_0x5898d8,_0x31a58c){if(_0x31a58c){return moment(_0x5898d8)['isAfter'](_0x31a58c);}else{return!![];}};exports[_0xdb7f('0x25')]=function(_0x23e06b,_0x38a01b){if(_0x38a01b){return moment(_0x23e06b)[_0xdb7f('0x25')](_0x38a01b);}else if(_0x23e06b){return!![];}else{return![];}}; \ No newline at end of file +var _0xe395=['info','debug','error','then','catch','stack','request','GetUser','internal','name','interface','GETUSER|','stringify','result','length','NOTFOUND','getUserByInterface','getUserByName','getVoiceQueueByName','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr'];(function(_0x20caf0,_0x1e5285){var _0x59936d=function(_0x59d655){while(--_0x59d655){_0x20caf0['push'](_0x20caf0['shift']());}};_0x59936d(++_0x1e5285);}(_0xe395,0x1f1));var _0x5e39=function(_0x5b2ded,_0x2d33fc){_0x5b2ded=_0x5b2ded-0x0;var _0x327cf7=_0xe395[_0x5b2ded];return _0x327cf7;};'use strict';var jayson=require(_0x5e39('0x0'));var moment=require(_0x5e39('0x1'));var BPromise=require(_0x5e39('0x2'));var client=jayson[_0x5e39('0x3')][_0x5e39('0x4')]({'port':0x2329});var logger=require(_0x5e39('0x5'))(_0x5e39('0x6'));exports[_0x5e39('0x7')]=function(_0x258183){logger['info'](_0x258183);};exports['debug']=function(_0x1357a6){logger[_0x5e39('0x8')](JSON['stringify'](_0x1357a6));};exports[_0x5e39('0x9')]=function(_0x11beaf){logger['error'](_0x11beaf['stack']);};exports['request']=function(_0x3253e7,_0x312f6c){return client['request'](_0x3253e7,{'body':_0x312f6c})[_0x5e39('0xa')](function(_0x15eb69){logger[_0x5e39('0x8')](JSON['stringify'](_0x15eb69));})[_0x5e39('0xb')](function(_0x7db576){logger[_0x5e39('0x9')](_0x7db576[_0x5e39('0xc')]);});};function getUser(_0x121961){return client[_0x5e39('0xd')](_0x5e39('0xe'),{'options':{'raw':!![],'attributes':['id',_0x5e39('0xf'),_0x5e39('0x10'),_0x5e39('0x11')],'where':_0x121961,'limit':0x1}})[_0x5e39('0xa')](function(_0x46317f){logger[_0x5e39('0x7')](_0x5e39('0x12')+JSON[_0x5e39('0x13')](_0x121961)+'|'+(_0x46317f[_0x5e39('0x14')][_0x5e39('0x15')]?'FOUND':_0x5e39('0x16')));return _0x46317f[_0x5e39('0x14')][_0x5e39('0x15')]?_0x46317f[_0x5e39('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0xa962dc){return new BPromise(function(_0x1d089e,_0x1a4843){if(_0xa962dc){return getUser({'internal':_0xa962dc})[_0x5e39('0xa')](function(_0x44a223){return _0x1d089e(_0x44a223);})[_0x5e39('0xb')](function(_0x51b662){logger[_0x5e39('0x9')](_0x51b662[_0x5e39('0xc')]);return _0x1d089e(null);});}else{return _0x1d089e(null);}});};exports[_0x5e39('0x17')]=function(_0x50f978){return new BPromise(function(_0x321b62,_0x1087e2){if(_0x50f978){return getUser({'interface':_0x50f978})['then'](function(_0x3a20d5){return _0x321b62(_0x3a20d5);})[_0x5e39('0xb')](function(_0x10c33a){logger[_0x5e39('0x9')](_0x10c33a[_0x5e39('0xc')]);return _0x321b62(null);});}else{return _0x321b62(null);}});};exports[_0x5e39('0x18')]=function(_0x1127ca){return new BPromise(function(_0x136f55,_0x27c61a){if(_0x1127ca){return getUser({'name':_0x1127ca})[_0x5e39('0xa')](function(_0x279e37){return _0x136f55(_0x279e37);})[_0x5e39('0xb')](function(_0x4763c2){logger[_0x5e39('0x9')](_0x4763c2['stack']);return _0x136f55(null);});}else{return _0x136f55(null);}});};exports[_0x5e39('0x19')]=function(_0x50da43){return new BPromise(function(_0x593219,_0x107ead){if(_0x50da43){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5e39('0x10'),_0x5e39('0x1a'),_0x5e39('0x1b'),_0x5e39('0x1c')],'where':{'name':_0x50da43},'limit':0x1}})['then'](function(_0x47f5f3){logger[_0x5e39('0x7')](_0x5e39('0x1d')+_0x50da43+'|'+(_0x47f5f3['result']['length']?_0x5e39('0x1e'):_0x5e39('0x16')));return _0x593219(_0x47f5f3[_0x5e39('0x14')]['length']?_0x47f5f3[_0x5e39('0x14')][0x0]:null);})['catch'](function(_0x29b585){logger[_0x5e39('0x9')](_0x29b585[_0x5e39('0xc')]);return _0x593219(null);});}else{return _0x593219(null);}});};exports['addTime']=function(_0x1fad51,_0x1a3ba6){return moment(_0x1fad51)[_0x5e39('0x1f')](_0x1a3ba6,_0x5e39('0x20'))[_0x5e39('0x21')](_0x5e39('0x22'));};exports[_0x5e39('0x23')]=function(_0x5b2038,_0x5dbfb1){return moment(_0x5b2038)[_0x5e39('0x24')](_0x5dbfb1,_0x5e39('0x20'))[_0x5e39('0x21')](_0x5e39('0x22'));};exports[_0x5e39('0x25')]=function(_0x3e876d,_0x232540){return moment(_0x3e876d)['diff'](moment(_0x232540),_0x5e39('0x20'));};exports[_0x5e39('0x26')]=function(_0x4b1e7e,_0x1d2ace){return parseInt(_0x4b1e7e,0xa)+parseInt(_0x1d2ace,0xa);};exports[_0x5e39('0x27')]=function(){return moment()['format'](_0x5e39('0x22'));};exports[_0x5e39('0x28')]=function(_0x43adce,_0xb348cb){if(_0xb348cb){return moment(_0x43adce)[_0x5e39('0x28')](_0xb348cb);}else{return!![];}};exports[_0x5e39('0x29')]=function(_0x58318c,_0x541f11){if(_0x541f11){return moment(_0x58318c)[_0x5e39('0x29')](_0x541f11);}else if(_0x58318c){return!![];}else{return![];}}; \ No newline at end of file